From 04869663109a86188677a5e65d8b68d6850a5c27 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 2 Jan 2017 16:25:13 -0800 Subject: Fix Mode 4 sprite table Y scan to account for VRAM byte swapping --- vdp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vdp.c') 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; -- cgit v1.2.3