@@ -38,9 +38,6 @@ void IRAM_ATTR mem_updatemap()
38
38
rom_loadbank (mbc .rombank );
39
39
}
40
40
41
- memset (mbc .rmap , 0 , sizeof (mbc .rmap ));
42
- memset (mbc .wmap , 0 , sizeof (mbc .wmap ));
43
-
44
41
// ROM
45
42
mbc .rmap [0x0 ] = rom .bank [0 ];
46
43
mbc .rmap [0x1 ] = rom .bank [0 ];
@@ -54,21 +51,28 @@ void IRAM_ATTR mem_updatemap()
54
51
mbc .rmap [0x6 ] = rom .bank [mbc .rombank ] - 0x4000 ;
55
52
mbc .rmap [0x7 ] = rom .bank [mbc .rombank ] - 0x4000 ;
56
53
}
54
+ else
55
+ {
56
+ mbc .rmap [0x4 ] = NULL ;
57
+ mbc .rmap [0x5 ] = NULL ;
58
+ mbc .rmap [0x6 ] = NULL ;
59
+ mbc .rmap [0x7 ] = NULL ;
60
+ }
57
61
58
62
// Video RAM
59
63
mbc .rmap [0x8 ] = mbc .wmap [0x8 ] = lcd .vbank [R_VBK & 1 ] - 0x8000 ;
60
64
mbc .rmap [0x9 ] = mbc .wmap [0x9 ] = lcd .vbank [R_VBK & 1 ] - 0x8000 ;
61
65
62
66
// Backup RAM
63
- if (mbc .enableram && !(rtc .sel & 8 ))
64
- {
65
- // mbc.rmap[0xA] = mbc.wmap[0xA] = ram.sbank[mbc.rambank] - 0xA000;
66
- // mbc.rmap[0xB] = mbc.wmap[0xB] = ram.sbank[mbc.rambank] - 0xA000;
67
- }
67
+ mbc .rmap [0xA ] = NULL ;
68
+ mbc .rmap [0xB ] = NULL ;
68
69
69
70
// Work RAM
70
71
mbc .rmap [0xC ] = mbc .wmap [0xC ] = ram .ibank [0 ] - 0xC000 ;
71
72
73
+ // ?
74
+ mbc .rmap [0xD ] = NULL ;
75
+
72
76
// IO port and registers
73
77
mbc .rmap [0xF ] = mbc .wmap [0xF ] = NULL ;
74
78
}
@@ -565,6 +569,9 @@ void mem_reset(bool hard)
565
569
memset (ram .sbank , 0xff , 8192 * mbc .ramsize );
566
570
}
567
571
572
+ memset (mbc .rmap , 0 , sizeof (mbc .rmap ));
573
+ memset (mbc .wmap , 0 , sizeof (mbc .wmap ));
574
+
568
575
// Mark all sectors as dirty and wait for sram_dirty to trigger
569
576
memset (ram .sram_dirty_sector , 1 , 256 );
570
577
ram .sram_dirty = 0 ;
0 commit comments