From 225729b79c6f6c1529c78e63a2863c2b2e5d0e49 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 21 Apr 2013 14:43:28 -0700 Subject: [PATCH] Implement BGxHOFS/BGxVOFS --- src/gba/renderers/video-software.c | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/gba/renderers/video-software.c b/src/gba/renderers/video-software.c index 0372e3101..9f9937fe8 100644 --- a/src/gba/renderers/video-software.c +++ b/src/gba/renderers/video-software.c @@ -88,6 +88,38 @@ static uint16_t GBAVideoSoftwareRendererWriteVideoRegister(struct GBAVideoRender value &= 0xFFCF; GBAVideoSoftwareRendererWriteBGCNT(&softwareRenderer->bg[3], value); break; + case REG_BG0HOFS: + value &= 0x01FF; + softwareRenderer->bg[0].x = value; + break; + case REG_BG0VOFS: + value &= 0x01FF; + softwareRenderer->bg[0].y = value; + break; + case REG_BG1HOFS: + value &= 0x01FF; + softwareRenderer->bg[1].x = value; + break; + case REG_BG1VOFS: + value &= 0x01FF; + softwareRenderer->bg[1].y = value; + break; + case REG_BG2HOFS: + value &= 0x01FF; + softwareRenderer->bg[2].x = value; + break; + case REG_BG2VOFS: + value &= 0x01FF; + softwareRenderer->bg[2].y = value; + break; + case REG_BG3HOFS: + value &= 0x01FF; + softwareRenderer->bg[3].x = value; + break; + case REG_BG3VOFS: + value &= 0x01FF; + softwareRenderer->bg[3].y = value; + break; default: GBALog(GBA_LOG_STUB, "Stub video register write: %03x", address); }