diff options
Diffstat (limited to 'apps/plugins/rockboy/mem.c')
-rw-r--r-- | apps/plugins/rockboy/mem.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/apps/plugins/rockboy/mem.c b/apps/plugins/rockboy/mem.c index e00dadfa3c..4ef38c010d 100644 --- a/apps/plugins/rockboy/mem.c +++ b/apps/plugins/rockboy/mem.c | |||
@@ -28,6 +28,8 @@ struct ram ram; | |||
28 | * make the old maps potentially invalid. | 28 | * make the old maps potentially invalid. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #pragma GCC diagnostic push | ||
32 | #pragma GCC diagnostic ignored "-Warray-bounds" | ||
31 | void mem_updatemap(void) | 33 | void mem_updatemap(void) |
32 | { | 34 | { |
33 | int n; | 35 | int n; |
@@ -46,27 +48,27 @@ void mem_updatemap(void) | |||
46 | map[0x7] = rom.bank[mbc.rombank] - 0x4000; | 48 | map[0x7] = rom.bank[mbc.rombank] - 0x4000; |
47 | } | 49 | } |
48 | else map[0x4] = map[0x5] = map[0x6] = map[0x7] = NULL; | 50 | else map[0x4] = map[0x5] = map[0x6] = map[0x7] = NULL; |
49 | if (R_VBK & 1) | 51 | if (0 && (R_STAT & 0x03) == 0x03) |
50 | { | 52 | { |
51 | map[0x8] = lcd.vbank[1] - 0x8000; | 53 | map[0x8] = NULL; |
52 | map[0x9] = lcd.vbank[1] - 0x8000; | 54 | map[0x9] = NULL; |
53 | } | 55 | } |
54 | else | 56 | else |
55 | { | 57 | { |
56 | map[0x8] = lcd.vbank[0]/*[R_VBK & 1]*/ - 0x8000; | 58 | map[0x8] = lcd.vbank[R_VBK & 1] - 0x8000; |
57 | map[0x9] = lcd.vbank[0]/*[R_VBK & 1]*/ - 0x8000; | 59 | map[0x9] = lcd.vbank[R_VBK & 1] - 0x8000; |
60 | } | ||
58 | 61 | ||
59 | } | ||
60 | if (mbc.enableram && !(rtc.sel&8)) | 62 | if (mbc.enableram && !(rtc.sel&8)) |
61 | { | 63 | { |
62 | map[0xA] = ram.sbank[mbc.rambank] - 0xA000; | 64 | map[0xA] = ram.sbank[mbc.rambank] - 0xA000; |
63 | map[0xB] = ram.sbank[mbc.rambank] - 0xA000; | 65 | map[0xB] = ram.sbank[mbc.rambank] - 0xA000; |
64 | } | 66 | } |
65 | else map[0xA] = map[0xB] = NULL; | 67 | else map[0xA] = map[0xB] = NULL; |
66 | map[0xC] = ram.ibank[0] - 0xC000; | 68 | map[0xC] = ram.ibank[0] - 0xC000; // XXX |
67 | n = R_SVBK & 0x07; | 69 | n = R_SVBK & 0x07; |
68 | map[0xD] = ram.ibank[n?n:1] - 0xD000; | 70 | map[0xD] = ram.ibank[n?n:1] - 0xD000; |
69 | map[0xE] = ram.ibank[0] - 0xE000; | 71 | map[0xE] = ram.ibank[0] - 0xE000; // XXX |
70 | map[0xF] = NULL; | 72 | map[0xF] = NULL; |
71 | 73 | ||
72 | map = mbc.wmap; | 74 | map = mbc.wmap; |
@@ -79,13 +81,13 @@ void mem_updatemap(void) | |||
79 | map[0xB] = ram.sbank[mbc.rambank] - 0xA000; | 81 | map[0xB] = ram.sbank[mbc.rambank] - 0xA000; |
80 | } | 82 | } |
81 | else map[0xA] = map[0xB] = NULL; | 83 | else map[0xA] = map[0xB] = NULL; |
82 | map[0xC] = ram.ibank[0] - 0xC000; | 84 | map[0xC] = ram.ibank[0] - 0xC000; // XXX |
83 | n = R_SVBK & 0x07; | 85 | n = R_SVBK & 0x07; |
84 | map[0xD] = ram.ibank[n?n:1] - 0xD000; | 86 | map[0xD] = ram.ibank[n?n:1] - 0xD000; |
85 | map[0xE] = ram.ibank[0] - 0xE000; | 87 | map[0xE] = ram.ibank[0] - 0xE000; // XXX |
86 | map[0xF] = NULL; | 88 | map[0xF] = NULL; |
87 | } | 89 | } |
88 | 90 | #pragma GCC diagnostic pop | |
89 | 91 | ||
90 | /* | 92 | /* |
91 | * ioreg_write handles output to io registers in the FF00-FF7F,FFFF | 93 | * ioreg_write handles output to io registers in the FF00-FF7F,FFFF |