diff options
| author | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-11-09 20:49:54 +0000 |
|---|---|---|
| committer | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-11-09 20:49:54 +0000 |
| commit | 4d55a8b8254dff61fdc7b1959f6aef7eafbd9439 (patch) | |
| tree | fb5e56131a7c8b729641c70e7a87883ebaea5186 /libpcsxcore/psxhw.c | |
| parent | 71d6c56271e2650b1a2f5149521a5b1896084710 (diff) | |
| download | pcsxr-4d55a8b8254dff61fdc7b1959f6aef7eafbd9439.tar.gz | |
Patch 10767 (Durandal_1707).
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72138 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/psxhw.c')
| -rw-r--r-- | libpcsxcore/psxhw.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/libpcsxcore/psxhw.c b/libpcsxcore/psxhw.c index bd6a14c9..77e1fd02 100644 --- a/libpcsxcore/psxhw.c +++ b/libpcsxcore/psxhw.c @@ -24,7 +24,7 @@ #include "psxhw.h" #include "mdec.h" #include "cdrom.h" -#include "gpu.h"
+#include "gpu.h" void psxHwReset() { if (Config.Sio) psxHu32ref(0x1070) |= SWAP32(0x80); @@ -41,9 +41,9 @@ u8 psxHwRead8(u32 add) { unsigned char hard; switch (add) { - case 0x1f801040: hard = sioRead8();break;
+ case 0x1f801040: hard = sioRead8();break; #ifdef ENABLE_SIO1API - case 0x1f801050: hard = SIO1_readData8(); break;
+ case 0x1f801050: hard = SIO1_readData8(); break; #endif case 0x1f801800: hard = cdrRead0(); break; case 0x1f801801: hard = cdrRead1(); break; @@ -106,7 +106,7 @@ u16 psxHwRead16(u32 add) { #ifdef PAD_LOG PAD_LOG("sio read16 %x; ret = %x\n", add&0xf, hard); #endif - return hard;
+ return hard; #ifdef ENABLE_SIO1API case 0x1f801050: hard = SIO1_readData16(); @@ -119,7 +119,7 @@ u16 psxHwRead16(u32 add) { return hard; case 0x1f80105e: hard = SIO1_readBaud16(); - return hard;
+ return hard; #endif case 0x1f801100: hard = psxRcntRcount(0); @@ -209,11 +209,11 @@ u32 psxHwRead32(u32 add) { #ifdef PAD_LOG PAD_LOG("sio read32 ;ret = %x\n", hard); #endif - return hard;
+ return hard; #ifdef ENABLE_SIO1API case 0x1f801050: hard = SIO1_readData32(); - return hard;
+ return hard; #endif #ifdef PSXHW_LOG case 0x1f801060: @@ -349,9 +349,9 @@ u32 psxHwRead32(u32 add) { void psxHwWrite8(u32 add, u8 value) { switch (add) { - case 0x1f801040: sioWrite8(value); break;
+ case 0x1f801040: sioWrite8(value); break; #ifdef ENABLE_SIO1API - case 0x1f801050: SIO1_writeData8(value); break;
+ case 0x1f801050: SIO1_writeData8(value); break; #endif case 0x1f801800: cdrWrite0(value); break; case 0x1f801801: cdrWrite1(value); break; @@ -403,7 +403,7 @@ void psxHwWrite16(u32 add, u16 value) { #ifdef PAD_LOG PAD_LOG ("sio write16 %x, %x\n", add&0xf, value); #endif - return;
+ return; #ifdef ENABLE_SIO1API case 0x1f801050: SIO1_writeData16(value); @@ -416,7 +416,7 @@ void psxHwWrite16(u32 add, u16 value) { return; case 0x1f80105e: SIO1_writeBaud16(value); - return;
+ return; #endif case 0x1f801070: #ifdef PSXHW_LOG @@ -518,11 +518,11 @@ void psxHwWrite32(u32 add, u32 value) { #ifdef PAD_LOG PAD_LOG("sio write32 %x\n", value); #endif - return;
+ return; #ifdef ENABLE_SIO1API case 0x1f801050: SIO1_writeData32(value); - return;
+ return; #endif #ifdef PSXHW_LOG case 0x1f801060: @@ -725,19 +725,19 @@ void psxHwWrite32(u32 add, u32 value) { psxRcntWtarget(2, value & 0xffff); return; default: - // Dukes of Hazard 2 - car engine noise
- if (add>=0x1f801c00 && add<0x1f801e00) {
- SPU_writeRegister(add, value&0xffff);
-
- add += 2;
- value >>= 16;
-
- if (add>=0x1f801c00 && add<0x1f801e00)
- SPU_writeRegister(add, value&0xffff);
- return;
- }
-
-
+ // Dukes of Hazard 2 - car engine noise + if (add>=0x1f801c00 && add<0x1f801e00) { + SPU_writeRegister(add, value&0xffff); + + add += 2; + value >>= 16; + + if (add>=0x1f801c00 && add<0x1f801e00) + SPU_writeRegister(add, value&0xffff); + return; + } + + psxHu32ref(add) = SWAPu32(value); #ifdef PSXHW_LOG PSXHW_LOG("*Unknown 32bit write at address %x value %x\n", add, value); |
