uxn

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

commit 3bfebc570deee12c878b2dadfb4b42b6c0d85622
parent c41ba2b1e2962b47b72ef6f1969f4885fa0b6306
Author: neauoire <aliceffekt@gmail.com>
Date:   Thu, 15 Jul 2021 19:52:37 -0700

Made pop16 more robust

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

diff --git a/src/uxn.c b/src/uxn.c @@ -25,7 +25,7 @@ Uint8 mempeek8(Uint8 *m, Uint16 a) { return m[a]; } void devpoke8(Device *d, Uint8 a, Uint8 b) { d->dat[a & 0xf] = b; d->talk(d, a & 0x0f, 1); } Uint8 devpeek8(Device *d, Uint8 a) { d->talk(d, a & 0x0f, 0); return d->dat[a & 0xf]; } void push16(Stack *s, Uint16 a) { push8(s, a >> 8); push8(s, a); } -Uint16 pop16(Stack *s) { return pop8(s) + (pop8(s) << 8); } +Uint16 pop16(Stack *s) { Uint8 a = pop8(s), b = pop8(s); return a + (b << 8); } void mempoke16(Uint8 *m, Uint16 a, Uint16 b) { mempoke8(m, a, b >> 8); mempoke8(m, a + 1, b); } Uint16 mempeek16(Uint8 *m, Uint16 a) { return (mempeek8(m, a) << 8) + mempeek8(m, a + 1); } void devpoke16(Device *d, Uint8 a, Uint16 b) { devpoke8(d, a, b >> 8); devpoke8(d, a + 1, b); }