Mercurial > repos > blastem
comparison vdp.c @ 1278:34d3cb05014d
Fix VDP buffer overrun that was causing sprite flickering in some games
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 13 Mar 2017 23:13:24 -0700 |
parents | 6dedaa645843 |
children | 76e47254596b |
comparison
equal
deleted
inserted
replaced
1277:78416556ae02 | 1278:34d3cb05014d |
---|---|
2270 vint_line = context->inactive_start; | 2270 vint_line = context->inactive_start; |
2271 active_line = 0x1FF; | 2271 active_line = 0x1FF; |
2272 } else { | 2272 } else { |
2273 bg_end_slot = BG_START_SLOT + (256+HORIZ_BORDER)/2; | 2273 bg_end_slot = BG_START_SLOT + (256+HORIZ_BORDER)/2; |
2274 max_draws = MAX_DRAWS_H32_MODE4; | 2274 max_draws = MAX_DRAWS_H32_MODE4; |
2275 max_sprites = 8; | |
2275 buf_clear_slot = 136; | 2276 buf_clear_slot = 136; |
2276 index_reset_slot = 253; | 2277 index_reset_slot = 253; |
2277 index_reset_value = 0; | 2278 index_reset_value = 0; |
2278 vint_line = context->inactive_start + 1; | 2279 vint_line = context->inactive_start + 1; |
2279 vint_slot = VINT_SLOT_MODE4; | 2280 vint_slot = VINT_SLOT_MODE4; |
2310 context->sprite_draws = MAX_DRAWS_H32_MODE4; | 2311 context->sprite_draws = MAX_DRAWS_H32_MODE4; |
2311 } | 2312 } |
2312 memset(context->linebuf, 0, LINEBUF_SIZE); | 2313 memset(context->linebuf, 0, LINEBUF_SIZE); |
2313 } else if (context->hslot == index_reset_slot) { | 2314 } else if (context->hslot == index_reset_slot) { |
2314 context->sprite_index = index_reset_value; | 2315 context->sprite_index = index_reset_value; |
2315 context->slot_counter = max_draws; | 2316 context->slot_counter = max_sprites; |
2316 } else if (context->vcounter == vint_line && context->hslot == vint_slot) { | 2317 } else if (context->vcounter == vint_line && context->hslot == vint_slot) { |
2317 context->flags2 |= FLAG2_VINT_PENDING; | 2318 context->flags2 |= FLAG2_VINT_PENDING; |
2318 context->pending_vint_start = context->cycles; | 2319 context->pending_vint_start = context->cycles; |
2319 } | 2320 } |
2320 | 2321 |