GBA I/O: Fix writing to DISPCNT CGB flag (fixes #902)
Vicki Pfau vi@endrift.com
Sun, 14 Jan 2018 21:03:10 -0800
4 files changed,
11 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -40,6 +40,7 @@ - 3DS: Fix opening files in directory names with trailing slashes
- GB MBC: Fix MBC2 saves (fixes mgba.io/i/954) - GBA Memory: Fix copy-on-write memory leak - Core: Fix ROM patches not being unloaded when disabled (fixes mgba.io/i/962) + - GBA I/O: Fix writing to DISPCNT CGB flag (fixes mgba.io/i/902) Misc: - GBA Timer: Use global cycles for timers - GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
M
src/gba/extra/proxy.c
→
src/gba/extra/proxy.c
@@ -171,11 +171,16 @@
uint16_t GBAVideoProxyRendererWriteVideoRegister(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value) { struct GBAVideoProxyRenderer* proxyRenderer = (struct GBAVideoProxyRenderer*) renderer; switch (address) { + case REG_DISPCNT: + value &= 0xFFF7; + break; case REG_BG0CNT: case REG_BG1CNT: + value &= 0xDFFF; + break; case REG_BG2CNT: case REG_BG3CNT: - value &= 0xFFCF; + value &= 0xFFFF; break; case REG_BG0HOFS: case REG_BG0VOFS:
M
src/gba/renderers/video-software.c
→
src/gba/renderers/video-software.c
@@ -157,6 +157,7 @@ }
switch (address) { case REG_DISPCNT: + value &= 0xFFF7; softwareRenderer->dispcnt = value; GBAVideoSoftwareRendererUpdateDISPCNT(softwareRenderer); break;
M
src/gba/video.c
→
src/gba/video.c
@@ -217,6 +217,9 @@ if (renderer->cache) {
GBAVideoCacheWriteVideoRegister(renderer->cache, address, value); } switch (address) { + case REG_DISPCNT: + value &= 0xFFF7; + break; case REG_BG0CNT: case REG_BG1CNT: value &= 0xDFFF;