From f63b25e118ce1861f78d812e6e682bf57f38b9fa Mon Sep 17 00:00:00 2001 From: neauoire Date: Sat, 2 Sep 2023 18:47:33 -0700 Subject: [PATCH] (screen.c) Fixed missing pixel in redraw region --- src/devices/screen.c | 8 +++----- src/uxn.c | 5 ++++- src/uxn.h | 2 -- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/devices/screen.c b/src/devices/screen.c index 18bc021..5e6270b 100644 --- a/src/devices/screen.c +++ b/src/devices/screen.c @@ -214,11 +214,9 @@ screen_deo(Uint8 *ram, Uint8 *d, Uint8 port) Uint16 height = uxn_screen.height; if(x < width && y < height) layer[x + y * width] = color; - x += 1; - y += 1; - screen_change(x, y, x, y); - if(d[0x6] & 0x1) POKE2(port_x, x); - if(d[0x6] & 0x2) POKE2(port_y, y); + screen_change(x, y, x + 1, y + 1); + if(d[0x6] & 0x1) POKE2(port_x, x + 1); + if(d[0x6] & 0x2) POKE2(port_y, y + 1); } break; } diff --git a/src/uxn.c b/src/uxn.c index cc5b585..b73fdc8 100644 --- a/src/uxn.c +++ b/src/uxn.c @@ -31,8 +31,11 @@ WITH REGARD TO THIS SOFTWARE. #define N2_(v) { r = (v); L = r; X = r >> 8; } #define L2_(v) { r = (v); Y = r; Z = r >> 8; } +#define DEI(p) (dei_masks[p] ? emu_dei(u, (p)) : u->dev[(p)]) +#define DEO(p, v) { u->dev[p] = v; if(deo_masks[p]) emu_deo(u, p); } + #define FLIP { s = ins & 0x40 ? &u->wst : &u->rst; } -#define SHIFT(y) { r = s->ptr + (y); ptr = s->dat + r - 1; s->ptr = r; } +#define SHIFT(y) { s->ptr += (y); ptr = s->dat + s->ptr - 1; } #define SET(x, y) { SHIFT((ins & 0x80) ? x + y : y) } int diff --git a/src/uxn.h b/src/uxn.h index 5fc5b5d..193acee 100644 --- a/src/uxn.h +++ b/src/uxn.h @@ -13,8 +13,6 @@ WITH REGARD TO THIS SOFTWARE. #define PEEK2(d) (*(d) << 8 | (d)[1]) #define POKE2(d, v) { *(d) = (v) >> 8; (d)[1] = (v); } -#define DEI(p) (dei_masks[p] ? emu_dei(u, (p)) : u->dev[(p)]) -#define DEO(p, v) { u->dev[p] = v; if(deo_masks[p]) emu_deo(u, p); } /* clang-format on */