From f9e457ea3bf37f4a1dfa7aa20ef9b65157ff1e42 Mon Sep 17 00:00:00 2001 From: luigiblood Date: Mon, 14 Nov 2016 20:28:32 +0100 Subject: [PATCH] [BS-X] Read/Write Memory Pack Fixes --- bsx.cpp | 12 ++++++------ memmap.cpp | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/bsx.cpp b/bsx.cpp index 59e80baf..14cd7643 100644 --- a/bsx.cpp +++ b/bsx.cpp @@ -671,7 +671,7 @@ static void BSX_Map (void) Memory.map_WriteProtectROM(); } -static uint8 BSX_Get_Bypass_FlashIO (uint16 offset) +static uint8 BSX_Get_Bypass_FlashIO (uint32 offset) { MapROM = FlashROM = Memory.ROM + Multi.cartOffsetB; @@ -681,7 +681,7 @@ static uint8 BSX_Get_Bypass_FlashIO (uint16 offset) return (MapROM[(offset & 0x1F0000) >> 1 | (offset & 0x7FFF)]); } -static void BSX_Set_Bypass_FlashIO (uint16 offset, uint8 byte) +static void BSX_Set_Bypass_FlashIO (uint32 offset, uint8 byte) { MapROM = FlashROM = Memory.ROM + Multi.cartOffsetB; @@ -856,8 +856,8 @@ void S9xSetBSX (uint8 byte, uint32 address) case 0x20D0: //Block Erase uint32 x; for (x = 0; x < 0x10000; x++) { - BSX_Set_Bypass_FlashIO(((address & 0xFF0000) + x), 0xFF); - //MapROM[((address & 0xFF0000) - 0xC00000) + x] = 0xFF; + //BSX_Set_Bypass_FlashIO(((address & 0xFF0000) + x), 0xFF); + MapROM[(address & 0x0F0000) + x] = 0xFF; } break; @@ -866,8 +866,8 @@ void S9xSetBSX (uint8 byte, uint32 address) { uint32 x; for (x = 0; x < FLASH_SIZE; x++) { - BSX_Set_Bypass_FlashIO(x, 0xFF); - //MapROM[x] = 0xFF; + //BSX_Set_Bypass_FlashIO(x, 0xFF); + MapROM[x] = 0xFF; } } break; diff --git a/memmap.cpp b/memmap.cpp index bbc0f219..4f6d4c06 100644 --- a/memmap.cpp +++ b/memmap.cpp @@ -3403,8 +3403,7 @@ void CMemory::Map_BSCartLoROMMap(uint8 mapping) } map_LoROMSRAM(); - map_index(0xc0, 0xef, 0x0000, 0x7fff, MAP_BSX, MAP_TYPE_RAM); - map_index(0xc0, 0xef, 0x8000, 0xffff, MAP_BSX, MAP_TYPE_RAM); + map_index(0xc0, 0xef, 0x0000, 0xffff, MAP_BSX, MAP_TYPE_RAM); map_WRAM(); map_WriteProtectROM();