From 54d7fe404d0bdf07a991cce578a73c1302e61a61 Mon Sep 17 00:00:00 2001 From: LuigiBlood Date: Sat, 16 Dec 2017 17:21:00 +0100 Subject: [PATCH] [BS-X] Avoid updating the memory map when it is not needed --- bsx.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bsx.cpp b/bsx.cpp index a0d27914..37d41b4a 100644 --- a/bsx.cpp +++ b/bsx.cpp @@ -741,9 +741,18 @@ void S9xSetBSX (uint8 byte, uint32 address) // MMC if ((bank >= 0x01 && bank <= 0x0E)) { - BSX.MMC[bank] = byte; - if (bank == 0x0E) + //Avoid updating the memory map when it is not needed + if (bank == 0x0E && BSX.dirty) + { BSX_Map(); + BSX.dirty = FALSE; + } + else if (bank != 0x0E && BSX.MMC[bank] != byte) + { + BSX.dirty = TRUE; + } + + BSX.MMC[bank] = byte; } // Flash IO