Mercurial > repos > blastem
comparison vdp.c @ 143:e5487ef04619
Fix infinite loop bug in sprite rendering
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 31 Dec 2012 18:36:16 -0800 |
parents | b42bcfa09cce |
children | 139e5dcd6aa3 |
comparison
equal
deleted
inserted
replaced
142:b42bcfa09cce | 143:e5487ef04619 |
---|---|
49 x = d->x_pos; | 49 x = d->x_pos; |
50 dir = 1; | 50 dir = 1; |
51 } | 51 } |
52 //printf("Draw Slot %d of %d, Rendering sprite cell from %X to x: %d\n", context->cur_slot, context->sprite_draws, d->address, x); | 52 //printf("Draw Slot %d of %d, Rendering sprite cell from %X to x: %d\n", context->cur_slot, context->sprite_draws, d->address, x); |
53 context->cur_slot--; | 53 context->cur_slot--; |
54 for (uint16_t address = d->address; address < d->address+4; address++) { | 54 for (uint16_t address = d->address; address != ((d->address+4) & 0xFFFF); address++) { |
55 if (x >= 0 && x < 320 && !(context->linebuf[x] & 0xF)) { | 55 if (x >= 0 && x < 320 && !(context->linebuf[x] & 0xF)) { |
56 context->linebuf[x] = (context->vdpmem[address] >> 4) | d->pal_priority; | 56 context->linebuf[x] = (context->vdpmem[address] >> 4) | d->pal_priority; |
57 } | 57 } |
58 x += dir; | 58 x += dir; |
59 if (x >= 0 && x < 320 && !(context->linebuf[x] & 0xF)) { | 59 if (x >= 0 && x < 320 && !(context->linebuf[x] & 0xF)) { |