# HG changeset patch # User Michael Pavone # Date 1494053145 25200 # Node ID f7ca42e020fd66074fc7dcfc1af3a61b39263333 # Parent 696a029d09e9f6b2343417c65de231a5e9f894d9 Fix sprite rendering in double resolution interlace mode diff -r 696a029d09e9 -r f7ca42e020fd vdp.c --- 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;