all repos — mgba @ 27f5468e01d4361705a1dd0615c195e138e17710

mGBA Game Boy Advance Emulator

Writing for Window registers
Jeffrey Pfau jeffrey@endrift.com
Mon, 29 Jul 2013 01:30:27 -0700
commit

27f5468e01d4361705a1dd0615c195e138e17710

parent

3f122dcf14d2f0df4e747be2e24c9460a69f7334

2 files changed, 54 insertions(+), 0 deletions(-)

jump to
M src/gba/renderers/video-software.csrc/gba/renderers/video-software.c

@@ -246,6 +246,24 @@ softwareRenderer->bldy = 0x10;

} _updatePalettes(softwareRenderer); break; + case REG_WIN0H: + softwareRenderer->win0H.packed = value; + break; + case REG_WIN1H: + softwareRenderer->win1H.packed = value; + break; + case REG_WIN0V: + softwareRenderer->win0V.packed = value; + break; + case REG_WIN1V: + softwareRenderer->win1V.packed = value; + break; + case REG_WININ: + softwareRenderer->winin.packed = value; + break; + case REG_WINOUT: + softwareRenderer->winout.packed = value; + break; default: GBALog(GBA_LOG_STUB, "Stub video register write: %03x", address); }
M src/gba/renderers/video-software.hsrc/gba/renderers/video-software.h

@@ -50,6 +50,34 @@ FLAG_TARGET_1 = 0x04000000,

FLAG_TARGET_2 = 0x02000000 }; +union Window { + struct { + uint8_t end; + uint8_t start; + }; + uint16_t packed; +}; + +union WindowControl { + struct { + unsigned bg0EnableLo : 1; + unsigned bg1EnableLo : 1; + unsigned bg2EnableLo : 1; + unsigned bg3EnableLo : 1; + unsigned objEnableLo : 1; + unsigned blendEnableLo : 1; + unsigned : 2; + unsigned bg0EnableHi : 1; + unsigned bg1EnableHi : 1; + unsigned bg2EnableHi : 1; + unsigned bg3EnableHi : 1; + unsigned objEnableHi : 1; + unsigned blendEnableHi : 1; + unsigned : 2; + }; + uint16_t packed; +}; + struct GBAVideoSoftwareRenderer { struct GBAVideoRenderer d;

@@ -72,6 +100,14 @@

uint16_t blda; uint16_t bldb; uint16_t bldy; + + union Window win0H; + union Window win0V; + union Window win1H; + union Window win1V; + + union WindowControl winin; + union WindowControl winout; struct GBAVideoSoftwareBackground bg[4];