uxn

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

commit a323cb5c56dd8e5179648ddb8cbc4566d29c4f3c
parent fb892e4329c37d2b0eaa20ce5652096db02d9f5e
Author: neauoire <aliceffekt@gmail.com>
Date:   Sat,  2 Sep 2023 18:34:04 -0700

(screen.c)Fixed redraw issue

Diffstat:
Msrc/devices/screen.c | 8+++-----
Msrc/uxn.c | 5++++-
Msrc/uxn.h | 2--
3 files changed, 7 insertions(+), 8 deletions(-)

diff --git 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 @@ -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 @@ -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 */