summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-01-02 16:25:13 -0800
committerMichael Pavone <pavone@retrodev.com>2017-01-02 16:25:13 -0800
commit04869663109a86188677a5e65d8b68d6850a5c27 (patch)
treeb7f4f2d7fe37dd5efcbe6ca59eb66f4c6454479d
parente87e2d186f3a5663cf91eb93dd1950299bb17020 (diff)
Fix Mode 4 sprite table Y scan to account for VRAM byte swapping
-rw-r--r--vdp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vdp.c b/vdp.c
index a6189b5..42eb469 100644
--- a/vdp.c
+++ b/vdp.c
@@ -470,7 +470,7 @@ static void scan_sprite_table_mode4(vdp_context * context)
line &= 0xFF;
uint32_t sat_address = mode4_address_map[(context->regs[REG_SAT] << 7 & 0x3F00) + context->sprite_index];
- uint32_t y = context->vdpmem[sat_address];
+ uint32_t y = context->vdpmem[sat_address+1];
uint32_t size = (context->regs[REG_MODE_2] & BIT_SPRITE_SZ) ? 16 : 8;
if (y >= 0xd0) {
@@ -491,7 +491,7 @@ static void scan_sprite_table_mode4(vdp_context * context)
}
if (context->sprite_index < MAX_SPRITES_FRAME_H32) {
- y = context->vdpmem[sat_address+1];
+ y = context->vdpmem[sat_address];
if (y >= 0xd0) {
context->sprite_index = MAX_SPRITES_FRAME_H32;
return;