all repos — mgba @ 67e03bda91d1ffd0162a545d91f819fd56195923

mGBA Game Boy Advance Emulator

GBA I/O: Fix writing to DISPCNT CGB flag (fixes #902)
Vicki Pfau vi@endrift.com
Sun, 14 Jan 2018 21:03:10 -0800
commit

67e03bda91d1ffd0162a545d91f819fd56195923

parent

779296058787683b46550bd44538c5293eb1eb1e

4 files changed, 11 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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.csrc/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.csrc/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;