all repos — mgba @ 3c45983d104b34465f5414110ced80c39538cf4a

mGBA Game Boy Advance Emulator

GBA Video: Null renderer should return proper register values
Jeffrey Pfau jeffrey@endrift.com
Fri, 29 Apr 2016 00:32:12 -0700
commit

3c45983d104b34465f5414110ced80c39538cf4a

parent

a6e3c07b0f04e88b4a2276ae3346211a23637566

1 files changed, 32 insertions(+), 1 deletions(-)

jump to
M src/gba/video.csrc/gba/video.c

@@ -224,7 +224,38 @@ }

static uint16_t GBAVideoDummyRendererWriteVideoRegister(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value) { UNUSED(renderer); - UNUSED(address); + switch (address) { + case REG_BG0CNT: + case REG_BG1CNT: + value &= 0xDFFF; + break; + case REG_BG2CNT: + case REG_BG3CNT: + value &= 0xFFFF; + break; + case REG_BG0HOFS: + case REG_BG0VOFS: + case REG_BG1HOFS: + case REG_BG1VOFS: + case REG_BG2HOFS: + case REG_BG2VOFS: + case REG_BG3HOFS: + case REG_BG3VOFS: + value &= 0x01FF; + break; + case REG_BLDCNT: + value &= 0x3FFF; + break; + case REG_BLDALPHA: + value &= 0x1F1F; + break; + case REG_WININ: + case REG_WINOUT: + value &= 0x3F3F; + break; + default: + break; + } return value; }