static void BSX_Map (void) { #ifdef BSX_DEBUG printf("BS: Remapping\n"); for (int i = 0; i < 32; i++) printf("BS: MMC %02X: %d\n", i, BSX.MMC[i]); #endif memcpy(BSX.prevMMC, BSX.MMC, sizeof(BSX.MMC)); // Do a quick bank change if (BSX.dirty2 && !BSX.dirty) { BSX_Map_Dirty(); BSX_Map_BIOS(); BSX.dirty2 = FALSE; Memory.map_WriteProtectROM(); return; } if (BSX.MMC[0x01]) { MapROM = PSRAM; FlashSize = PSRAM_SIZE; } else { MapROM = FlashROM; FlashSize = FLASH_SIZE; } BSX_Map_SNES(); if (BSX.MMC[0x02]) BSX_Map_HiROM(); else BSX_Map_LoROM(); BSX_Map_PSRAM(); BSX_Map_SRAM(); BSX_Map_RAM(); BSX_Map_BIOS(); BSX_Map_FlashIO(); BSX_Map_MMC(); // Monitor new register changes BSX.dirty = FALSE; BSX.dirty2 = FALSE; Memory.map_WriteProtectROM(); }
static void BSX_Map (void) { memcpy(BSX.prevMMC, BSX.MMC, sizeof(BSX.MMC)); /* Do a quick bank change */ if (BSX.dirty2 && !BSX.dirty) { BSX_Map_Dirty(); BSX_Map_BIOS(); BSX.dirty2 = FALSE; map_WriteProtectROM(); return; } if (BSX.MMC[0x01]) { MapROM = PSRAM; FlashSize = PSRAM_SIZE; } else { MapROM = FlashROM; FlashSize = FLASH_SIZE; } BSX_Map_SNES(); if (BSX.MMC[0x02]) BSX_Map_HiROM(); else BSX_Map_LoROM(); BSX_Map_PSRAM(); BSX_Map_SRAM(); BSX_Map_RAM(); BSX_Map_BIOS(); BSX_Map_FlashIO(); BSX_Map_MMC(); /* Monitor new register changes */ BSX.dirty = FALSE; BSX.dirty2 = FALSE; map_WriteProtectROM(); }