diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-05-05 23:45:45 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-05-05 23:45:45 -0700 |
commit | 2b007cf162c8f2c6f96caad3e8f7ce440170f8d5 (patch) | |
tree | a8fe11eecec1bd66a532f1ae70d69f86116e76f4 /vdp.c | |
parent | af64ed7d263f8be0735de61beb8d88ccbf4d60a8 (diff) |
Fix sprite rendering in double resolution interlace mode
Diffstat (limited to 'vdp.c')
-rw-r--r-- | vdp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |