uxn

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

commit b020732d6d52895dd5834a828737a89a5dee5493
parent 41a3a6b35862c44efbe117b3ab17cb3967f4a944
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date:   Sun, 23 Jul 2023 09:21:09 -0700

(uxn.c) PUT2 should use POKE2 macro

Diffstat:
Msrc/uxn.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/uxn.c b/src/uxn.c @@ -30,7 +30,7 @@ WITH REGARD TO THIS SOFTWARE. #define HALT(c) { return uxn_halt(u, ins, (c), pc - 1); } #define SET(mul, add) { if(mul > s->ptr) HALT(1) tmp = (mul & k) + add + s->ptr; if(tmp > 254) HALT(2) s->ptr = tmp; } #define PUT(o, v) { s->dat[(Uint8)(s->ptr - 1 - (o))] = (v); } -#define PUT2(o, v) { tmp = (v); s->dat[(Uint8)(s->ptr - o - 2)] = tmp >> 8; s->dat[(Uint8)(s->ptr - o - 1)] = tmp; } +#define PUT2(o, v) { tmp = (v); POKE2(s->dat + (Uint8)(s->ptr - o - 2), tmp); } #define PUSH(v) { if(s->ptr > 254) HALT(2) s->dat[s->ptr++] = (v); } #define PUSH2(v) { if(s->ptr > 253) HALT(2) tmp = (v); s->dat[s->ptr] = tmp >> 8; s->dat[s->ptr + 1] = tmp; s->ptr += 2; } #define DEO(a, b) { u->dev[(a)] = (b); if((deo_mask[(a) >> 4] >> ((a) & 0xf)) & 0x1) uxn_deo(u, (a)); }