uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit f3b3823b0ca9493e96ac1b1fe3c5b97c922005ae
parent 7f3a889771d07f53205242719a53ff2a671c2cfe
Author: neauoire <aliceffekt@gmail.com>
Date:   Wed, 29 Sep 2021 16:14:13 -0700

The PPU require-draw flag is renamed to reqdraw

Diffstat:
Msrc/devices/ppu.c | 4++--
Msrc/devices/ppu.h | 3++-
Msrc/uxnemu.c | 4++--
3 files changed, 6 insertions(+), 5 deletions(-)

diff --git 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 @@ -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 @@ -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;