changeset 1138:25268334a24c

Fix Mode 4 sprite table Y scan to account for VRAM byte swapping
author Michael Pavone <pavone@retrodev.com>
date Mon, 02 Jan 2017 16:25:13 -0800
parents 9e0f2ea4a0fc
children 160e3f597cec
files vdp.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/vdp.c	Sun Jan 01 23:00:28 2017 -0800
+++ b/vdp.c	Mon Jan 02 16:25:13 2017 -0800
@@ -470,7 +470,7 @@
 		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 @@
 		}
 		
 		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;