diff --git a/Assets/dll/gpgx.wbx.zst b/Assets/dll/gpgx.wbx.zst index c30aa68375..1e6d7db00c 100644 Binary files a/Assets/dll/gpgx.wbx.zst and b/Assets/dll/gpgx.wbx.zst differ diff --git a/waterbox/gpgx/core/mem68k.c b/waterbox/gpgx/core/mem68k.c index fa5c52d23e..2957d0e0f0 100644 --- a/waterbox/gpgx/core/mem68k.c +++ b/waterbox/gpgx/core/mem68k.c @@ -658,6 +658,8 @@ void ctrl_io_write_byte(unsigned int address, unsigned int data) case 0x01: /* SUB-CPU control */ { + unsigned int halted = s68k.stopped; + /* RESET bit */ if (data & 0x01) { @@ -686,6 +688,40 @@ void ctrl_io_write_byte(unsigned int address, unsigned int data) s68k_pulse_halt(); } + /* check if SUB-CPU halt status has changed */ + if (s68k.stopped != halted) + { + int i; + + /* PRG-RAM can only be accessed from MAIN 68K & Z80 when SUB-CPU is halted (Dungeon Explorer USA version) */ + if ((data & 0x03) != 0x01) + { + /* $020000-$03FFFF (resp. $420000-$43FFFF) is mapped to PRG-RAM 128K bank (mirrored every 256 KB) */ + for (i=scd.cartridge.boot+0x02; i