From 2b007cf162c8f2c6f96caad3e8f7ce440170f8d5 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Fri, 5 May 2017 23:45:45 -0700 Subject: Fix sprite rendering in double resolution interlace mode --- vdp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vdp.c') diff --git a/vdp.c b/vdp.c index be89bd7..22268f9 100644 --- a/vdp.c +++ b/vdp.c @@ -579,7 +579,7 @@ static void scan_sprite_table(uint32_t line, vdp_context * context) } 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 @@ static void read_sprite_x(uint32_t line, vdp_context * context) 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; -- cgit v1.2.3