psxmem: backport fixes from pcsxr
authornotaz <notasas@gmail.com>
Fri, 4 Feb 2011 23:14:40 +0000 (01:14 +0200)
committernotaz <notasas@gmail.com>
Wed, 9 Feb 2011 12:59:32 +0000 (14:59 +0200)
shalma:
Duke Nukem - Land of Babes - psxmem.c
 - Clear correct dynarec area
 - Fixes Paradox intro crash
Dukes of Hazard 2 - psxhw.c
 - 32-bit spu write
 - fix engine noise

libpcsxcore/psxhw.c
libpcsxcore/psxmem.c

index 0c5320a..8069c07 100644 (file)
@@ -728,6 +728,13 @@ 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);
+                               SPU_writeRegister(add + 2, value>>16);
+                               return;
+                       }
+
                        psxHu32ref(add) = SWAPu32(value);
 #ifdef PSXHW_LOG
                        PSXHW_LOG("*Unknown 32bit write at address %x value %x\n", add, value);
index 898eac9..b08d113 100644 (file)
@@ -261,7 +261,7 @@ void psxMemWrite16(u32 mem, u16 value) {
                                DebugCheckBP((mem & 0xffffff) | 0x80000000, W2);
                        *(u16 *)(p + (mem & 0xffff)) = SWAPu16(value);
 #ifdef PSXREC
-                       psxCpu->Clear((mem & (~1)), 1);
+                       psxCpu->Clear((mem & (~3)), 1);
 #endif
                } else {
 #ifdef PSXMEM_LOG