From 8073df643283f7194eefc923f90f0d54617adbce Mon Sep 17 00:00:00 2001 From: luigiblood Date: Wed, 16 Nov 2016 01:21:23 +0100 Subject: [PATCH] [BS-X] Fix Block Erase on LoROM, Actual Flash writing Fixes Sound Novel Tsukuru --- bsx.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bsx.cpp b/bsx.cpp index 14cd7643..ce1d0ebb 100644 --- a/bsx.cpp +++ b/bsx.cpp @@ -686,9 +686,9 @@ static void BSX_Set_Bypass_FlashIO (uint32 offset, uint8 byte) MapROM = FlashROM = Memory.ROM + Multi.cartOffsetB; if (BSX.MMC[0x02]) - MapROM[offset & 0x0FFFFF] = byte; + MapROM[offset & 0x0FFFFF] = MapROM[offset & 0x0FFFFF] & byte; else - MapROM[(offset & 0x1F0000) >> 1 | (offset & 0x7FFF)] = byte; + MapROM[(offset & 0x1F0000) >> 1 | (offset & 0x7FFF)] = MapROM[(offset & 0x1F0000) >> 1 | (offset & 0x7FFF)] & byte; } uint8 S9xGetBSX (uint32 address) @@ -857,7 +857,10 @@ void S9xSetBSX (uint8 byte, uint32 address) uint32 x; for (x = 0; x < 0x10000; x++) { //BSX_Set_Bypass_FlashIO(((address & 0xFF0000) + x), 0xFF); - MapROM[(address & 0x0F0000) + x] = 0xFF; + if (BSX.MMC[0x02]) + MapROM[(address & 0x0F0000) + x] = 0xFF; + else + MapROM[((address & 0x1E0000) >> 1) + x] = 0xFF; } break;