diff --git a/src/devices/ppu.c b/src/devices/ppu.c index 3853096..51085e2 100644 --- a/src/devices/ppu.c +++ b/src/devices/ppu.c @@ -22,7 +22,7 @@ static Uint8 blending[5][16] = { void ppu_frame(Ppu *p) { - p->redraw = 0; + p->reqdraw = 0; p->i0 = p->width / PPW + p->height * p->stride; p->i1 = 0; } @@ -53,7 +53,7 @@ ppu_write(Ppu *p, int fg, Uint16 x, Uint16 y, Uint8 color) p->dat[i] &= ~(3 << shift); p->dat[i] |= color << shift; if((v ^ p->dat[i]) != 0) { - p->redraw = 1; + p->reqdraw = 1; p->i0 = p->i0 < i ? p->i0 : i; p->i1 = p->i1 > i ? p->i1 : i; } diff --git a/src/devices/ppu.h b/src/devices/ppu.h index ca6ea29..e4ccabf 100644 --- a/src/devices/ppu.h +++ b/src/devices/ppu.h @@ -22,8 +22,9 @@ typedef unsigned short Uint16; typedef unsigned int Uint32; typedef struct Ppu { + Uint8 reqdraw; Uint16 width, height; - unsigned int i0, i1, redraw, *dat, stride; + unsigned int i0, i1, *dat, stride; } Ppu; Uint8 ppu_read(Ppu *p, Uint16 x, Uint16 y); diff --git a/src/uxnemu.c b/src/uxnemu.c index 7965d3d..aeaadbb 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -220,7 +220,7 @@ redraw(Uxn *u) SDL_Rect up = gRect; if(devsystem->dat[0xe]) draw_inspect(&ppu, u->wst.dat, u->wst.ptr, u->rst.ptr, u->ram.dat); - if(!reqdraw && ppu.redraw) { + if(!reqdraw && ppu.reqdraw) { y0 = ppu.i0 / ppu.stride; y1 = ppu.i1 / ppu.stride + 1; up.y += y0; @@ -546,7 +546,7 @@ run(Uxn *u) } } uxn_eval(u, devscreen->vector); - if(reqdraw || ppu.redraw || devsystem->dat[0xe]) + if(reqdraw || ppu.reqdraw || devsystem->dat[0xe]) redraw(u); if(!BENCH) { elapsed = (SDL_GetPerformanceCounter() - start) / (double)SDL_GetPerformanceFrequency() * 1000.0f;