changeset 1346:f7ca42e020fd

Fix sprite rendering in double resolution interlace mode
author Michael Pavone <pavone@retrodev.com>
date Fri, 05 May 2017 23:45:45 -0700
parents 696a029d09e9
children 4c4beb22b042
files vdp.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/vdp.c	Fri May 05 23:41:14 2017 -0700
+++ b/vdp.c	Fri May 05 23:45:45 2017 -0700
@@ -579,7 +579,7 @@
 		}
 		uint16_t address = context->sprite_index * 4;
 		line += ymin;
-		line &= 0x1FF;
+		line &= ymask;
 		uint16_t y = ((context->sat_cache[address] & 0x3) << 8 | context->sat_cache[address+1]) & ymask;
 		uint8_t height = ((context->sat_cache[address+2] & 0x3) + 1) * height_mult;
 		//printf("Sprite %d | y: %d, height: %d\n", context->sprite_index, y, height);
@@ -693,7 +693,7 @@
 			uint8_t pal_priority = (tileinfo >> 9) & 0x70;
 			uint8_t row;
 			uint16_t cache_addr = context->sprite_info_list[context->cur_slot].index * 4;
-			line = (line + ymin) & 0x1FF;
+			line = (line + ymin) & ymask;
 			int16_t y = ((context->sat_cache[cache_addr] << 8 | context->sat_cache[cache_addr+1]) & ymask)/* - ymin*/;
 			if (tileinfo & MAP_BIT_V_FLIP) {
 				row = (y + height - 1) - line;