From ed93bc41a2bcf262913a151a537a153d1cd8275e Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Mon, 31 Dec 2012 18:36:16 -0800 Subject: Fix infinite loop bug in sprite rendering --- vdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vdp.c') diff --git a/vdp.c b/vdp.c index 045192f..f6176a5 100644 --- a/vdp.c +++ b/vdp.c @@ -51,7 +51,7 @@ void render_sprite_cells(vdp_context * context) } //printf("Draw Slot %d of %d, Rendering sprite cell from %X to x: %d\n", context->cur_slot, context->sprite_draws, d->address, x); context->cur_slot--; - for (uint16_t address = d->address; address < d->address+4; address++) { + for (uint16_t address = d->address; address != ((d->address+4) & 0xFFFF); address++) { if (x >= 0 && x < 320 && !(context->linebuf[x] & 0xF)) { context->linebuf[x] = (context->vdpmem[address] >> 4) | d->pal_priority; } -- cgit v1.2.3