From 8260d9496f83caa8fc360773d515dd28aa36fb6a Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 10 Apr 2023 10:53:30 -0700 Subject: [PATCH] Removed POKDEV/PEKDEV macros --- src/devices/screen.c | 1 - src/devices/system.c | 6 ++---- src/uxn.h | 3 --- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/devices/screen.c b/src/devices/screen.c index 070ef8c..3e13614 100644 --- a/src/devices/screen.c +++ b/src/devices/screen.c @@ -186,4 +186,3 @@ screen_deo(Uint8 *ram, Uint8 *d, Uint8 port) } } } - diff --git a/src/devices/system.c b/src/devices/system.c index 8178191..317744e 100644 --- a/src/devices/system.c +++ b/src/devices/system.c @@ -71,14 +71,12 @@ system_load(Uxn *u, char *filename) void system_deo(Uxn *u, Uint8 *d, Uint8 port) { - Uint16 a; switch(port) { case 0x3: - PEKDEV(a, 0x2); - system_cmd(u->ram, a); + system_cmd(u->ram, PEEK2(d + 2)); break; case 0xe: - if(u->wst->ptr || u->rst->ptr) system_inspect(u); + system_inspect(u); break; } } diff --git a/src/uxn.h b/src/uxn.h index c6c5912..807b007 100644 --- a/src/uxn.h +++ b/src/uxn.h @@ -22,9 +22,6 @@ typedef unsigned int Uint32; #define POKE2(d, v) { (d)[0] = (v) >> 8; (d)[1] = (v); } #define PEEK2(d) ((d)[0] << 8 | (d)[1]) -#define POKDEV(x, y) { d[(x)] = (y) >> 8; d[(x) + 1] = (y); } -#define PEKDEV(o, x) { (o) = (d[(x)] << 8) + d[(x) + 1]; } - /* clang-format on */ typedef struct {