From 3e31e934ebbfa48941cdcc66e316ff743a4c908d Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 5 Feb 2011 01:14:40 +0200 Subject: [PATCH] psxmem: backport fixes from pcsxr 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 | 7 +++++++ libpcsxcore/psxmem.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libpcsxcore/psxhw.c b/libpcsxcore/psxhw.c index 0c5320ad..8069c07a 100644 --- a/libpcsxcore/psxhw.c +++ b/libpcsxcore/psxhw.c @@ -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); diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c index 898eac9c..b08d113d 100644 --- a/libpcsxcore/psxmem.c +++ b/libpcsxcore/psxmem.c @@ -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 -- 2.39.5