From 27472e8acf860d981425a751a4e92343ccdf387a Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sun, 23 May 2021 14:33:33 +0200 Subject: Normalize the fixed int typedefs --- src/main.c | 42 ++-- src/uxn/devices/ppu.c | 50 +++-- src/uxn/devices/ppu.h | 20 +- src/uxn/uxn.c | 558 +++++++++++++++++++++++++------------------------- src/uxn/uxn.h | 37 ++-- src/uxn/uxn/opcodes.c | 373 --------------------------------- 6 files changed, 346 insertions(+), 734 deletions(-) delete mode 100644 src/uxn/uxn/opcodes.c (limited to 'src') diff --git a/src/main.c b/src/main.c index 5e0aad1..bf30628 100644 --- a/src/main.c +++ b/src/main.c @@ -45,7 +45,7 @@ static Device *devmouse; static Mouse mouse = {SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2}; void -nil_talk(Device *d, Uint8 b0, Uint8 w) { +nil_talk(Device *d, u8 b0, u8 w) { (void)d; (void)b0; (void)w; @@ -66,50 +66,50 @@ console_talk(Device *d, u8 b0, u8 w) { } void -system_talk(Device *d, Uint8 b0, Uint8 w) { +system_talk(Device *d, u8 b0, u8 w) { if(!w) { d->dat[0x2] = d->u->wst.ptr; d->dat[0x3] = d->u->rst.ptr; } else { - putcolors(&ppu, &d->dat[0x8]); + putcolors(&d->dat[0x8]); } (void)b0; } IWRAM_CODE void -screen_talk(Device *d, Uint8 b0, Uint8 w) { +screen_talk(Device *d, u8 b0, u8 w) { if(w && b0 == 0xe) { - Uint16 x = mempeek16(d->dat, 0x8); - Uint16 y = mempeek16(d->dat, 0xa); - Uint8 *addr = &d->mem[mempeek16(d->dat, 0xc)]; - Uint8 *layer = d->dat[0xe] >> 4 & 0x1 ? ppu.fg : ppu.bg; - Uint8 mode = d->dat[0xe] >> 5; + u16 x = mempeek16(d->dat, 0x8); + u16 y = mempeek16(d->dat, 0xa); + u8 *addr = &d->mem[mempeek16(d->dat, 0xc)]; + u8 *layer = d->dat[0xe] >> 4 & 0x1 ? ppu.fg : ppu.bg; + u8 mode = d->dat[0xe] >> 5; if(!mode) { - putpixel(&ppu, layer, x, y, d->dat[0xe] & 0x3); + putpixel(layer, x, y, d->dat[0xe] & 0x3); } else if(mode-- & 0x1) { - puticn(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4); + puticn(layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4); } else { - putchr(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4); + putchr(layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4); } } } void -datetime_talk(Device *d, Uint8 b0, Uint8 w) { +datetime_talk(Device *d, u8 b0, u8 w) { (void)d; (void)b0; (void)w; } void -file_talk(Device *d, Uint8 b0, Uint8 w) { - Uint8 read = b0 == 0xd; +file_talk(Device *d, u8 b0, u8 w) { + u8 read = b0 == 0xd; if(w && (read || b0 == 0xf)) { char *name = (char *)&d->mem[mempeek16(d->dat, 0x8)]; - Uint16 result = 0, length = mempeek16(d->dat, 0xa); - Uint16 offset = mempeek16(d->dat, 0x4); - Uint16 addr = mempeek16(d->dat, b0 - 1); + u16 result = 0, length = mempeek16(d->dat, 0xa); + u16 offset = mempeek16(d->dat, 0x4); + u16 addr = mempeek16(d->dat, b0 - 1); int file_idx = fs_open_file(name, read ? OPEN_READ : OPEN_WRITE); if (file_idx >= 0) { if (read) { @@ -177,7 +177,7 @@ handle_input(Uxn *u) { if (control_method == CONTROL_CONTROLLER) { // TODO: We don't need ifs if we use KEY_INPUTS directly and mayvbe just // swap some things if needed. - Uint8 *flag = &devctrl->dat[2]; + u8 *flag = &devctrl->dat[2]; if (key_pressed(KEY_A)) { *flag |= 0x01; } else { @@ -223,7 +223,7 @@ handle_input(Uxn *u) { devctrl->dat[3] = 0; } else if (control_method == CONTROL_MOUSE) { // Detect "mouse key press". - Uint8 flag = devmouse->dat[6]; + u8 flag = devmouse->dat[6]; if (key_tap(KEY_B)) { flag |= 0x01; } else if (key_released(KEY_B)) { @@ -265,7 +265,7 @@ handle_input(Uxn *u) { static Uxn u; EWRAM_BSS -static Uint8 umem[65536]; +static u8 umem[65536]; int main(void) { // Initialize filesystem. diff --git a/src/uxn/devices/ppu.c b/src/uxn/devices/ppu.c index 4db8c77..02267f0 100644 --- a/src/uxn/devices/ppu.c +++ b/src/uxn/devices/ppu.c @@ -20,7 +20,7 @@ WITH REGARD TO THIS SOFTWARE. #define BG_BACK ((u32*)(MEM_VRAM + KB(64))) #define TILE_MAP ((u32*)(MEM_VRAM + KB(40))) -static Uint32 unpack_icon_lut[256] = { +static u32 unpack_icon_lut[256] = { 0x00000000, 0x00000001, 0x00000010, 0x00000011, 0x00000100, 0x00000101, 0x00000110, 0x00000111, 0x00001000, 0x00001001, 0x00001010, 0x00001011, 0x00001100, 0x00001101, 0x00001110, @@ -75,7 +75,7 @@ static Uint32 unpack_icon_lut[256] = { 0x11111111 }; -static Uint32 unpack_icon_lut_flipx[256] = { +static u32 unpack_icon_lut_flipx[256] = { 0x00000000, 0x10000000, 0x01000000, 0x11000000, 0x00100000, 0x10100000, 0x01100000, 0x11100000, 0x00010000, 0x10010000, 0x01010000, 0x11010000, 0x00110000, 0x10110000, 0x01110000, @@ -133,10 +133,10 @@ static Uint32 unpack_icon_lut_flipx[256] = { static u32 dirty_tiles[21] = {0}; void -putcolors(Ppu *p, Uint8 *addr) { +putcolors(u8 *addr) { int i; for(i = 0; i < 4; ++i) { - Uint8 + u8 r = (*(addr + i / 2) >> (!(i % 2) << 2)) & 0x0f, g = (*(addr + 2 + i / 2) >> (!(i % 2) << 2)) & 0x0f, b = (*(addr + 4 + i / 2) >> (!(i % 2) << 2)) & 0x0f; @@ -145,12 +145,11 @@ putcolors(Ppu *p, Uint8 *addr) { (g << 1) | (g >> 3), (b << 1) | (b >> 3)); } - (void)p; } IWRAM_CODE void -putpixel(Ppu *p, Uint32 *layer, Uint16 x, Uint16 y, Uint8 color) { +putpixel(u32 *layer, u16 x, u16 y, u8 color) { if (x >= SCREEN_WIDTH || y >= SCREEN_HEIGHT) return; size_t tile_x = x / 8; size_t tile_y = y / 8; @@ -160,20 +159,19 @@ putpixel(Ppu *p, Uint32 *layer, Uint16 x, Uint16 y, Uint8 color) { size_t shift = start_col * 4; layer[pos] = (layer[pos] & (~(0xF << shift))) | (color << shift); dirty_tiles[tile_y] |= 1 << tile_x; - (void)p; } IWRAM_CODE void -puticn(Ppu *p, Uint32 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy) { - Uint8 sprline; - Uint16 v; - Uint32 dirtyflag = (1 << (x >> 3)) | (1 << ((x + 7) >> 3)); +puticn(u32 *layer, u16 x, u16 y, u8 *sprite, u8 color, u8 flipx, u8 flipy) { + u8 sprline; + u16 v; + u32 dirtyflag = (1 << (x >> 3)) | (1 << ((x + 7) >> 3)); - Uint32 layerpos = ((y & 7) + (((x >> 3) + (y >> 3) * 32) * 8)); - Uint32 *layerptr = &layer[layerpos]; - Uint32 shift = (x & 7) << 2; - Uint32 *lut_expand = flipx ? unpack_icon_lut : unpack_icon_lut_flipx; + u32 layerpos = ((y & 7) + (((x >> 3) + (y >> 3) * 32) * 8)); + u32 *layerptr = &layer[layerpos]; + u32 shift = (x & 7) << 2; + u32 *lut_expand = flipx ? unpack_icon_lut : unpack_icon_lut_flipx; if (flipy) flipy = 7; @@ -211,21 +209,20 @@ puticn(Ppu *p, Uint32 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Ui dirty_tiles[y >> 3] |= dirtyflag; dirty_tiles[(y + 7) >> 3] |= dirtyflag; - (void)p; } IWRAM_CODE void -putchr(Ppu *p, Uint32 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, - Uint8 flipx, Uint8 flipy) { - Uint8 sprline1, sprline2; - Uint16 v; - Uint32 dirtyflag = (1 << (x >> 3)) | (1 << ((x + 7) >> 3)); +putchr(u32 *layer, u16 x, u16 y, u8 *sprite, u8 color, + u8 flipx, u8 flipy) { + u8 sprline1, sprline2; + u16 v; + u32 dirtyflag = (1 << (x >> 3)) | (1 << ((x + 7) >> 3)); - Uint32 layerpos = ((y & 7) + (((x >> 3) + (y >> 3) * 32) * 8)); - Uint32 *layerptr = &layer[layerpos]; - Uint32 shift = (x & 7) << 2; - Uint32 *lut_expand = flipx ? unpack_icon_lut : unpack_icon_lut_flipx; + u32 layerpos = ((y & 7) + (((x >> 3) + (y >> 3) * 32) * 8)); + u32 *layerptr = &layer[layerpos]; + u32 shift = (x & 7) << 2; + u32 *lut_expand = flipx ? unpack_icon_lut : unpack_icon_lut_flipx; if (flipy) flipy = 7; @@ -254,7 +251,6 @@ putchr(Ppu *p, Uint32 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, dirty_tiles[y >> 3] |= dirtyflag; dirty_tiles[(y + 7) >> 3] |= dirtyflag; - (void)p; } IWRAM_CODE @@ -281,7 +277,7 @@ flipbuf(Ppu *p) { } int -initppu(Ppu *p, Uint8 hor, Uint8 ver, Uint8 pad) { +initppu(Ppu *p, u8 hor, u8 ver, u8 pad) { p->hor = hor; p->ver = ver; p->pad = pad; diff --git a/src/uxn/devices/ppu.h b/src/uxn/devices/ppu.h index 213dc75..0356b63 100644 --- a/src/uxn/devices/ppu.h +++ b/src/uxn/devices/ppu.h @@ -17,20 +17,14 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. */ -typedef unsigned char Uint8; -typedef unsigned short Uint16; -typedef unsigned int Uint32; - typedef struct Ppu { - Uint32 *bg, *fg; - Uint16 hor, ver, pad, width, height; + u32 *bg, *fg; + u16 hor, ver, pad, width, height; } Ppu; -int initppu(Ppu *p, Uint8 hor, Uint8 ver, Uint8 pad); -void putcolors(Ppu *p, Uint8 *addr); -void putpixel(Ppu *p, Uint32 *layer, Uint16 x, Uint16 y, Uint8 color); -void puticn(Ppu *p, Uint32 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy); -void putchr(Ppu *p, Uint32 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy); -void drawppu(Ppu *p); -void drawdebugger(Ppu *p, Uint8 *stack, Uint8 ptr); +int initppu(Ppu *p, u8 hor, u8 ver, u8 pad); +void putcolors(u8 *addr); +void putpixel(u32 *layer, u16 x, u16 y, u8 color); +void puticn(u32 *layer, u16 x, u16 y, u8 *sprite, u8 color, u8 flipx, u8 flipy); +void putchr(u32 *layer, u16 x, u16 y, u8 *sprite, u8 color, u8 flipx, u8 flipy); #endif // UXNGBA_PPU_H diff --git a/src/uxn/uxn.c b/src/uxn/uxn.c index e8ae9f7..2b541d1 100644 --- a/src/uxn/uxn.c +++ b/src/uxn/uxn.c @@ -17,9 +17,9 @@ WITH REGARD TO THIS SOFTWARE. IWRAM_CODE int -evaluxn(Uxn *u, Uint16 vec) +evaluxn(Uxn *u, u16 vec) { - Uint8 instr; + u8 instr; u->ram.ptr = vec; while(u->ram.ptr) { instr = u->ram.dat[u->ram.ptr++]; @@ -77,7 +77,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x04: /* DUP */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->wst.dat[u->wst.ptr - 1] = a; u->wst.dat[u->wst.ptr] = a; #ifndef NO_STACK_CHECKS @@ -95,7 +95,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x05: /* SWP */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = a; u->wst.dat[u->wst.ptr - 1] = b; #ifndef NO_STACK_CHECKS @@ -108,7 +108,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x06: /* OVR */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b; u->wst.dat[u->wst.ptr - 1] = a; u->wst.dat[u->wst.ptr] = b; @@ -127,7 +127,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x07: /* ROT */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3]; u->wst.dat[u->wst.ptr - 3] = b; u->wst.dat[u->wst.ptr - 2] = a; u->wst.dat[u->wst.ptr - 1] = c; @@ -141,7 +141,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x08: /* EQU */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b == a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -154,7 +154,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x09: /* NEQ */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b != a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -167,7 +167,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x0a: /* GTH */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b > a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -180,7 +180,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x0b: /* LTH */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b < a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -193,8 +193,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x0c: /* JMP */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - u->ram.ptr += (Sint8)a; + u8 a = u->wst.dat[u->wst.ptr - 1]; + u->ram.ptr += (s8)a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { u->wst.error = 1; @@ -206,8 +206,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x0d: /* JCN */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - if(u->wst.dat[u->wst.ptr - 2]) u->ram.ptr += (Sint8)a; + u8 a = u->wst.dat[u->wst.ptr - 1]; + if(u->wst.dat[u->wst.ptr - 2]) u->ram.ptr += (s8)a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { u->wst.error = 1; @@ -219,10 +219,10 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x0e: /* JSR */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->rst.dat[u->rst.ptr] = u->ram.ptr >> 8; u->rst.dat[u->rst.ptr + 1] = u->ram.ptr & 0xff; - u->ram.ptr += (Sint8)a; + u->ram.ptr += (s8)a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { u->wst.error = 1; @@ -241,7 +241,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x0f: /* STH */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->rst.dat[u->rst.ptr] = a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { @@ -261,7 +261,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x10: /* LDZ */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->wst.dat[u->wst.ptr - 1] = mempeek8(u->ram.dat, a); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { @@ -273,8 +273,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x11: /* STZ */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - Uint8 b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1]; + u8 b = u->wst.dat[u->wst.ptr - 2]; mempoke8(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -287,8 +287,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x12: /* LDR */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - u->wst.dat[u->wst.ptr - 1] = mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a); + u8 a = u->wst.dat[u->wst.ptr - 1]; + u->wst.dat[u->wst.ptr - 1] = mempeek8(u->ram.dat, u->ram.ptr + (s8)a); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { u->wst.error = 1; @@ -299,9 +299,9 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x13: /* STR */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - Uint8 b = u->wst.dat[u->wst.ptr - 2]; - mempoke8(u->ram.dat, u->ram.ptr + (Sint8)a, b); + u8 a = u->wst.dat[u->wst.ptr - 1]; + u8 b = u->wst.dat[u->wst.ptr - 2]; + mempoke8(u->ram.dat, u->ram.ptr + (s8)a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { u->wst.error = 1; @@ -313,7 +313,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x14: /* LDA */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); u->wst.dat[u->wst.ptr - 2] = mempeek8(u->ram.dat, a); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -326,8 +326,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x15: /* STA */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); - Uint8 b = u->wst.dat[u->wst.ptr - 3]; + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u8 b = u->wst.dat[u->wst.ptr - 3]; mempoke8(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 3) { @@ -340,7 +340,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x16: /* DEI */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->wst.dat[u->wst.ptr - 1] = devpeek8(&u->dev[a >> 4], a); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { @@ -352,7 +352,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x17: /* DEO */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; devpoke8(&u->dev[a >> 4], a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -365,7 +365,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x18: /* ADD */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b + a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -378,7 +378,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x19: /* SUB */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b - a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -391,7 +391,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x1a: /* MUL */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b * a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -404,7 +404,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x1b: /* DIV */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b / a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -417,7 +417,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x1c: /* AND */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b & a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -430,7 +430,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x1d: /* ORA */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b | a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -443,7 +443,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x1e: /* EOR */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b ^ a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -456,7 +456,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x1f: /* SFT */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr - 2] = b >> (a & 0x07) << ((a & 0x70) >> 4); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -495,7 +495,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x24: /* DUP2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); u->wst.dat[u->wst.ptr - 2] = a >> 8; u->wst.dat[u->wst.ptr - 1] = a & 0xff; u->wst.dat[u->wst.ptr] = a >> 8; @@ -515,7 +515,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x25: /* SWP2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr - 4] = a >> 8; u->wst.dat[u->wst.ptr - 3] = a & 0xff; u->wst.dat[u->wst.ptr - 2] = b >> 8; @@ -530,7 +530,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x26: /* OVR2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr - 4] = b >> 8; u->wst.dat[u->wst.ptr - 3] = b & 0xff; u->wst.dat[u->wst.ptr - 2] = a >> 8; @@ -552,7 +552,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x27: /* ROT2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)), c = (u->wst.dat[u->wst.ptr - 5] | (u->wst.dat[u->wst.ptr - 6] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)), c = (u->wst.dat[u->wst.ptr - 5] | (u->wst.dat[u->wst.ptr - 6] << 8)); u->wst.dat[u->wst.ptr - 6] = b >> 8; u->wst.dat[u->wst.ptr - 5] = b & 0xff; u->wst.dat[u->wst.ptr - 4] = a >> 8; @@ -569,7 +569,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x28: /* EQU2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr - 4] = b == a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 4) { @@ -582,7 +582,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x29: /* NEQ2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr - 4] = b != a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 4) { @@ -595,7 +595,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x2a: /* GTH2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr - 4] = b > a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 4) { @@ -608,7 +608,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x2b: /* LTH2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr - 4] = b < a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 4) { @@ -633,7 +633,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x2d: /* JCN2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); if(u->wst.dat[u->wst.ptr - 3]) u->ram.ptr = a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 3) { @@ -667,7 +667,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x2f: /* STH2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); u->rst.dat[u->rst.ptr] = a >> 8; u->rst.dat[u->rst.ptr + 1] = a & 0xff; #ifndef NO_STACK_CHECKS @@ -688,7 +688,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x30: /* LDZ2 */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->wst.dat[u->wst.ptr - 1] = mempeek8(u->ram.dat, a); u->wst.dat[u->wst.ptr] = mempeek8(u->ram.dat, a + 1); #ifndef NO_STACK_CHECKS @@ -706,8 +706,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x31: /* STZ2 */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - Uint16 b = (u->wst.dat[u->wst.ptr - 2] | (u->wst.dat[u->wst.ptr - 3] << 8)); + u8 a = u->wst.dat[u->wst.ptr - 1]; + u16 b = (u->wst.dat[u->wst.ptr - 2] | (u->wst.dat[u->wst.ptr - 3] << 8)); mempoke16(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 3) { @@ -720,9 +720,9 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x32: /* LDR2 */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - u->wst.dat[u->wst.ptr - 1] = mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a); - u->wst.dat[u->wst.ptr] = mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a + 1); + u8 a = u->wst.dat[u->wst.ptr - 1]; + u->wst.dat[u->wst.ptr - 1] = mempeek8(u->ram.dat, u->ram.ptr + (s8)a); + u->wst.dat[u->wst.ptr] = mempeek8(u->ram.dat, u->ram.ptr + (s8)a + 1); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { u->wst.error = 1; @@ -738,9 +738,9 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x33: /* STR2 */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - Uint16 b = (u->wst.dat[u->wst.ptr - 2] | (u->wst.dat[u->wst.ptr - 3] << 8)); - mempoke16(u->ram.dat, u->ram.ptr + (Sint8)a, b); + u8 a = u->wst.dat[u->wst.ptr - 1]; + u16 b = (u->wst.dat[u->wst.ptr - 2] | (u->wst.dat[u->wst.ptr - 3] << 8)); + mempoke16(u->ram.dat, u->ram.ptr + (s8)a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 3) { u->wst.error = 1; @@ -752,7 +752,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x34: /* LDA2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); u->wst.dat[u->wst.ptr - 2] = mempeek8(u->ram.dat, a); u->wst.dat[u->wst.ptr - 1] = mempeek8(u->ram.dat, a + 1); #ifndef NO_STACK_CHECKS @@ -765,8 +765,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x35: /* STA2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); - Uint16 b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u16 b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); mempoke16(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 4) { @@ -779,7 +779,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x36: /* DEI2 */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->wst.dat[u->wst.ptr - 1] = devpeek8(&u->dev[a >> 4], a); u->wst.dat[u->wst.ptr] = devpeek8(&u->dev[a >> 4], a + 1); #ifndef NO_STACK_CHECKS @@ -797,8 +797,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x37: /* DEO2 */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - Uint16 b = (u->wst.dat[u->wst.ptr - 2] | (u->wst.dat[u->wst.ptr - 3] << 8)); + u8 a = u->wst.dat[u->wst.ptr - 1]; + u16 b = (u->wst.dat[u->wst.ptr - 2] | (u->wst.dat[u->wst.ptr - 3] << 8)); devpoke16(&u->dev[a >> 4], a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 3) { @@ -811,7 +811,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x38: /* ADD2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr - 4] = (b + a) >> 8; u->wst.dat[u->wst.ptr - 3] = (b + a) & 0xff; #ifndef NO_STACK_CHECKS @@ -825,7 +825,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x39: /* SUB2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr - 4] = (b - a) >> 8; u->wst.dat[u->wst.ptr - 3] = (b - a) & 0xff; #ifndef NO_STACK_CHECKS @@ -839,7 +839,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x3a: /* MUL2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr - 4] = (b * a) >> 8; u->wst.dat[u->wst.ptr - 3] = (b * a) & 0xff; #ifndef NO_STACK_CHECKS @@ -853,7 +853,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x3b: /* DIV2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr - 4] = (b / a) >> 8; u->wst.dat[u->wst.ptr - 3] = (b / a) & 0xff; #ifndef NO_STACK_CHECKS @@ -867,7 +867,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x3c: /* AND2 */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3], d = u->wst.dat[u->wst.ptr - 4]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3], d = u->wst.dat[u->wst.ptr - 4]; u->wst.dat[u->wst.ptr - 4] = d & b; u->wst.dat[u->wst.ptr - 3] = c & a; #ifndef NO_STACK_CHECKS @@ -881,7 +881,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x3d: /* ORA2 */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3], d = u->wst.dat[u->wst.ptr - 4]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3], d = u->wst.dat[u->wst.ptr - 4]; u->wst.dat[u->wst.ptr - 4] = d | b; u->wst.dat[u->wst.ptr - 3] = c | a; #ifndef NO_STACK_CHECKS @@ -895,7 +895,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x3e: /* EOR2 */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3], d = u->wst.dat[u->wst.ptr - 4]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3], d = u->wst.dat[u->wst.ptr - 4]; u->wst.dat[u->wst.ptr - 4] = d ^ b; u->wst.dat[u->wst.ptr - 3] = c ^ a; #ifndef NO_STACK_CHECKS @@ -909,7 +909,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x3f: /* SFT2 */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr - 4] = (b >> (a & 0x000f) << ((a & 0x00f0) >> 4)) >> 8; u->wst.dat[u->wst.ptr - 3] = (b >> (a & 0x000f) << ((a & 0x00f0) >> 4)) & 0xff; #ifndef NO_STACK_CHECKS @@ -948,7 +948,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x44: /* DUPr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->rst.dat[u->rst.ptr - 1] = a; u->rst.dat[u->rst.ptr] = a; #ifndef NO_STACK_CHECKS @@ -966,7 +966,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x45: /* SWPr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = a; u->rst.dat[u->rst.ptr - 1] = b; #ifndef NO_STACK_CHECKS @@ -979,7 +979,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x46: /* OVRr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b; u->rst.dat[u->rst.ptr - 1] = a; u->rst.dat[u->rst.ptr] = b; @@ -998,7 +998,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x47: /* ROTr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3]; u->rst.dat[u->rst.ptr - 3] = b; u->rst.dat[u->rst.ptr - 2] = a; u->rst.dat[u->rst.ptr - 1] = c; @@ -1012,7 +1012,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x48: /* EQUr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b == a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1025,7 +1025,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x49: /* NEQr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b != a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1038,7 +1038,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x4a: /* GTHr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b > a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1051,7 +1051,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x4b: /* LTHr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b < a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1064,8 +1064,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x4c: /* JMPr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - u->ram.ptr += (Sint8)a; + u8 a = u->rst.dat[u->rst.ptr - 1]; + u->ram.ptr += (s8)a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { u->rst.error = 1; @@ -1077,8 +1077,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x4d: /* JCNr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - if(u->rst.dat[u->rst.ptr - 2]) u->ram.ptr += (Sint8)a; + u8 a = u->rst.dat[u->rst.ptr - 1]; + if(u->rst.dat[u->rst.ptr - 2]) u->ram.ptr += (s8)a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { u->rst.error = 1; @@ -1090,10 +1090,10 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x4e: /* JSRr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->wst.dat[u->wst.ptr] = u->ram.ptr >> 8; u->wst.dat[u->wst.ptr + 1] = u->ram.ptr & 0xff; - u->ram.ptr += (Sint8)a; + u->ram.ptr += (s8)a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { u->rst.error = 1; @@ -1112,7 +1112,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x4f: /* STHr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->wst.dat[u->wst.ptr] = a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { @@ -1132,7 +1132,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x50: /* LDZr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->rst.dat[u->rst.ptr - 1] = mempeek8(u->ram.dat, a); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { @@ -1144,8 +1144,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x51: /* STZr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - Uint8 b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1]; + u8 b = u->rst.dat[u->rst.ptr - 2]; mempoke8(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1158,8 +1158,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x52: /* LDRr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - u->rst.dat[u->rst.ptr - 1] = mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a); + u8 a = u->rst.dat[u->rst.ptr - 1]; + u->rst.dat[u->rst.ptr - 1] = mempeek8(u->ram.dat, u->ram.ptr + (s8)a); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { u->rst.error = 1; @@ -1170,9 +1170,9 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x53: /* STRr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - Uint8 b = u->rst.dat[u->rst.ptr - 2]; - mempoke8(u->ram.dat, u->ram.ptr + (Sint8)a, b); + u8 a = u->rst.dat[u->rst.ptr - 1]; + u8 b = u->rst.dat[u->rst.ptr - 2]; + mempoke8(u->ram.dat, u->ram.ptr + (s8)a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { u->rst.error = 1; @@ -1184,7 +1184,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x54: /* LDAr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); u->rst.dat[u->rst.ptr - 2] = mempeek8(u->ram.dat, a); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1197,8 +1197,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x55: /* STAr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); - Uint8 b = u->rst.dat[u->rst.ptr - 3]; + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u8 b = u->rst.dat[u->rst.ptr - 3]; mempoke8(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 3) { @@ -1211,7 +1211,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x56: /* DEIr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->rst.dat[u->rst.ptr - 1] = devpeek8(&u->dev[a >> 4], a); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { @@ -1223,7 +1223,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x57: /* DEOr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; devpoke8(&u->dev[a >> 4], a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1236,7 +1236,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x58: /* ADDr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b + a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1249,7 +1249,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x59: /* SUBr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b - a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1262,7 +1262,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x5a: /* MULr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b * a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1275,7 +1275,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x5b: /* DIVr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b / a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1288,7 +1288,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x5c: /* ANDr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b & a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1301,7 +1301,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x5d: /* ORAr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b | a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1314,7 +1314,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x5e: /* EORr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b ^ a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1327,7 +1327,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x5f: /* SFTr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr - 2] = b >> (a & 0x07) << ((a & 0x70) >> 4); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -1366,7 +1366,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x64: /* DUP2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); u->rst.dat[u->rst.ptr - 2] = a >> 8; u->rst.dat[u->rst.ptr - 1] = a & 0xff; u->rst.dat[u->rst.ptr] = a >> 8; @@ -1386,7 +1386,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x65: /* SWP2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr - 4] = a >> 8; u->rst.dat[u->rst.ptr - 3] = a & 0xff; u->rst.dat[u->rst.ptr - 2] = b >> 8; @@ -1401,7 +1401,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x66: /* OVR2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr - 4] = b >> 8; u->rst.dat[u->rst.ptr - 3] = b & 0xff; u->rst.dat[u->rst.ptr - 2] = a >> 8; @@ -1423,7 +1423,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x67: /* ROT2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)), c = (u->rst.dat[u->rst.ptr - 5] | (u->rst.dat[u->rst.ptr - 6] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)), c = (u->rst.dat[u->rst.ptr - 5] | (u->rst.dat[u->rst.ptr - 6] << 8)); u->rst.dat[u->rst.ptr - 6] = b >> 8; u->rst.dat[u->rst.ptr - 5] = b & 0xff; u->rst.dat[u->rst.ptr - 4] = a >> 8; @@ -1440,7 +1440,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x68: /* EQU2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr - 4] = b == a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 4) { @@ -1453,7 +1453,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x69: /* NEQ2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr - 4] = b != a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 4) { @@ -1466,7 +1466,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x6a: /* GTH2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr - 4] = b > a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 4) { @@ -1479,7 +1479,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x6b: /* LTH2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr - 4] = b < a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 4) { @@ -1504,7 +1504,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x6d: /* JCN2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); if(u->rst.dat[u->rst.ptr - 3]) u->ram.ptr = a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 3) { @@ -1538,7 +1538,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x6f: /* STH2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); u->wst.dat[u->wst.ptr] = a >> 8; u->wst.dat[u->wst.ptr + 1] = a & 0xff; #ifndef NO_STACK_CHECKS @@ -1559,7 +1559,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x70: /* LDZ2r */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->rst.dat[u->rst.ptr - 1] = mempeek8(u->ram.dat, a); u->rst.dat[u->rst.ptr] = mempeek8(u->ram.dat, a + 1); #ifndef NO_STACK_CHECKS @@ -1577,8 +1577,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x71: /* STZ2r */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - Uint16 b = (u->rst.dat[u->rst.ptr - 2] | (u->rst.dat[u->rst.ptr - 3] << 8)); + u8 a = u->rst.dat[u->rst.ptr - 1]; + u16 b = (u->rst.dat[u->rst.ptr - 2] | (u->rst.dat[u->rst.ptr - 3] << 8)); mempoke16(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 3) { @@ -1591,9 +1591,9 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x72: /* LDR2r */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - u->rst.dat[u->rst.ptr - 1] = mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a); - u->rst.dat[u->rst.ptr] = mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a + 1); + u8 a = u->rst.dat[u->rst.ptr - 1]; + u->rst.dat[u->rst.ptr - 1] = mempeek8(u->ram.dat, u->ram.ptr + (s8)a); + u->rst.dat[u->rst.ptr] = mempeek8(u->ram.dat, u->ram.ptr + (s8)a + 1); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { u->rst.error = 1; @@ -1609,9 +1609,9 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x73: /* STR2r */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - Uint16 b = (u->rst.dat[u->rst.ptr - 2] | (u->rst.dat[u->rst.ptr - 3] << 8)); - mempoke16(u->ram.dat, u->ram.ptr + (Sint8)a, b); + u8 a = u->rst.dat[u->rst.ptr - 1]; + u16 b = (u->rst.dat[u->rst.ptr - 2] | (u->rst.dat[u->rst.ptr - 3] << 8)); + mempoke16(u->ram.dat, u->ram.ptr + (s8)a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 3) { u->rst.error = 1; @@ -1623,7 +1623,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x74: /* LDA2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); u->rst.dat[u->rst.ptr - 2] = mempeek8(u->ram.dat, a); u->rst.dat[u->rst.ptr - 1] = mempeek8(u->ram.dat, a + 1); #ifndef NO_STACK_CHECKS @@ -1636,8 +1636,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x75: /* STA2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); - Uint16 b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u16 b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); mempoke16(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 4) { @@ -1650,7 +1650,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x76: /* DEI2r */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->rst.dat[u->rst.ptr - 1] = devpeek8(&u->dev[a >> 4], a); u->rst.dat[u->rst.ptr] = devpeek8(&u->dev[a >> 4], a + 1); #ifndef NO_STACK_CHECKS @@ -1668,8 +1668,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x77: /* DEO2r */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - Uint16 b = (u->rst.dat[u->rst.ptr - 2] | (u->rst.dat[u->rst.ptr - 3] << 8)); + u8 a = u->rst.dat[u->rst.ptr - 1]; + u16 b = (u->rst.dat[u->rst.ptr - 2] | (u->rst.dat[u->rst.ptr - 3] << 8)); devpoke16(&u->dev[a >> 4], a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 3) { @@ -1682,7 +1682,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x78: /* ADD2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr - 4] = (b + a) >> 8; u->rst.dat[u->rst.ptr - 3] = (b + a) & 0xff; #ifndef NO_STACK_CHECKS @@ -1696,7 +1696,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x79: /* SUB2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr - 4] = (b - a) >> 8; u->rst.dat[u->rst.ptr - 3] = (b - a) & 0xff; #ifndef NO_STACK_CHECKS @@ -1710,7 +1710,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x7a: /* MUL2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr - 4] = (b * a) >> 8; u->rst.dat[u->rst.ptr - 3] = (b * a) & 0xff; #ifndef NO_STACK_CHECKS @@ -1724,7 +1724,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x7b: /* DIV2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr - 4] = (b / a) >> 8; u->rst.dat[u->rst.ptr - 3] = (b / a) & 0xff; #ifndef NO_STACK_CHECKS @@ -1738,7 +1738,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x7c: /* AND2r */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3], d = u->rst.dat[u->rst.ptr - 4]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3], d = u->rst.dat[u->rst.ptr - 4]; u->rst.dat[u->rst.ptr - 4] = d & b; u->rst.dat[u->rst.ptr - 3] = c & a; #ifndef NO_STACK_CHECKS @@ -1752,7 +1752,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x7d: /* ORA2r */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3], d = u->rst.dat[u->rst.ptr - 4]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3], d = u->rst.dat[u->rst.ptr - 4]; u->rst.dat[u->rst.ptr - 4] = d | b; u->rst.dat[u->rst.ptr - 3] = c | a; #ifndef NO_STACK_CHECKS @@ -1766,7 +1766,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x7e: /* EOR2r */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3], d = u->rst.dat[u->rst.ptr - 4]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3], d = u->rst.dat[u->rst.ptr - 4]; u->rst.dat[u->rst.ptr - 4] = d ^ b; u->rst.dat[u->rst.ptr - 3] = c ^ a; #ifndef NO_STACK_CHECKS @@ -1780,7 +1780,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x7f: /* SFT2r */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr - 4] = (b >> (a & 0x000f) << ((a & 0x00f0) >> 4)) >> 8; u->rst.dat[u->rst.ptr - 3] = (b >> (a & 0x000f) << ((a & 0x00f0) >> 4)) & 0xff; #ifndef NO_STACK_CHECKS @@ -1805,7 +1805,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x84: /* DUPk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->wst.dat[u->wst.ptr] = a; u->wst.dat[u->wst.ptr + 1] = a; #ifndef NO_STACK_CHECKS @@ -1823,7 +1823,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x85: /* SWPk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = a; u->wst.dat[u->wst.ptr + 1] = b; #ifndef NO_STACK_CHECKS @@ -1841,7 +1841,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x86: /* OVRk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b; u->wst.dat[u->wst.ptr + 1] = a; u->wst.dat[u->wst.ptr + 2] = b; @@ -1860,7 +1860,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x87: /* ROTk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3]; u->wst.dat[u->wst.ptr] = b; u->wst.dat[u->wst.ptr + 1] = a; u->wst.dat[u->wst.ptr + 2] = c; @@ -1879,7 +1879,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x88: /* EQUk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b == a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -1896,7 +1896,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x89: /* NEQk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b != a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -1913,7 +1913,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x8a: /* GTHk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b > a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -1930,7 +1930,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x8b: /* LTHk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b < a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -1947,8 +1947,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x8c: /* JMPk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - u->ram.ptr += (Sint8)a; + u8 a = u->wst.dat[u->wst.ptr - 1]; + u->ram.ptr += (s8)a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { u->wst.error = 1; @@ -1959,8 +1959,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x8d: /* JCNk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - if(u->wst.dat[u->wst.ptr - 2]) u->ram.ptr += (Sint8)a; + u8 a = u->wst.dat[u->wst.ptr - 1]; + if(u->wst.dat[u->wst.ptr - 2]) u->ram.ptr += (s8)a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { u->wst.error = 1; @@ -1971,10 +1971,10 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x8e: /* JSRk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->rst.dat[u->rst.ptr] = u->ram.ptr >> 8; u->rst.dat[u->rst.ptr + 1] = u->ram.ptr & 0xff; - u->ram.ptr += (Sint8)a; + u->ram.ptr += (s8)a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { u->wst.error = 1; @@ -1992,7 +1992,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x8f: /* STHk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->rst.dat[u->rst.ptr] = a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { @@ -2011,7 +2011,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x90: /* LDZk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->wst.dat[u->wst.ptr] = mempeek8(u->ram.dat, a); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { @@ -2028,8 +2028,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x91: /* STZk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - Uint8 b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1]; + u8 b = u->wst.dat[u->wst.ptr - 2]; mempoke8(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -2041,8 +2041,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x92: /* LDRk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - u->wst.dat[u->wst.ptr] = mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a); + u8 a = u->wst.dat[u->wst.ptr - 1]; + u->wst.dat[u->wst.ptr] = mempeek8(u->ram.dat, u->ram.ptr + (s8)a); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { u->wst.error = 1; @@ -2058,9 +2058,9 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x93: /* STRk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - Uint8 b = u->wst.dat[u->wst.ptr - 2]; - mempoke8(u->ram.dat, u->ram.ptr + (Sint8)a, b); + u8 a = u->wst.dat[u->wst.ptr - 1]; + u8 b = u->wst.dat[u->wst.ptr - 2]; + mempoke8(u->ram.dat, u->ram.ptr + (s8)a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { u->wst.error = 1; @@ -2071,7 +2071,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x94: /* LDAk */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); u->wst.dat[u->wst.ptr] = mempeek8(u->ram.dat, a); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -2088,8 +2088,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x95: /* STAk */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); - Uint8 b = u->wst.dat[u->wst.ptr - 3]; + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u8 b = u->wst.dat[u->wst.ptr - 3]; mempoke8(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 3) { @@ -2101,7 +2101,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x96: /* DEIk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->wst.dat[u->wst.ptr] = devpeek8(&u->dev[a >> 4], a); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { @@ -2118,7 +2118,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x97: /* DEOk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; devpoke8(&u->dev[a >> 4], a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -2130,7 +2130,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x98: /* ADDk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b + a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -2147,7 +2147,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x99: /* SUBk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b - a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -2164,7 +2164,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x9a: /* MULk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b * a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -2181,7 +2181,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x9b: /* DIVk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b / a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -2198,7 +2198,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x9c: /* ANDk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b & a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -2215,7 +2215,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x9d: /* ORAk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b | a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -2232,7 +2232,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x9e: /* EORk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b ^ a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -2249,7 +2249,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0x9f: /* SFTk */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; u->wst.dat[u->wst.ptr] = b >> (a & 0x07) << ((a & 0x70) >> 4); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 2) { @@ -2277,7 +2277,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xa4: /* DUP2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); u->wst.dat[u->wst.ptr] = a >> 8; u->wst.dat[u->wst.ptr + 1] = a & 0xff; u->wst.dat[u->wst.ptr + 2] = a >> 8; @@ -2297,7 +2297,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xa5: /* SWP2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr] = a >> 8; u->wst.dat[u->wst.ptr + 1] = a & 0xff; u->wst.dat[u->wst.ptr + 2] = b >> 8; @@ -2317,7 +2317,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xa6: /* OVR2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr] = b >> 8; u->wst.dat[u->wst.ptr + 1] = b & 0xff; u->wst.dat[u->wst.ptr + 2] = a >> 8; @@ -2339,7 +2339,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xa7: /* ROT2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)), c = (u->wst.dat[u->wst.ptr - 5] | (u->wst.dat[u->wst.ptr - 6] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)), c = (u->wst.dat[u->wst.ptr - 5] | (u->wst.dat[u->wst.ptr - 6] << 8)); u->wst.dat[u->wst.ptr] = b >> 8; u->wst.dat[u->wst.ptr + 1] = b & 0xff; u->wst.dat[u->wst.ptr + 2] = a >> 8; @@ -2361,7 +2361,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xa8: /* EQU2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr] = b == a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 4) { @@ -2378,7 +2378,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xa9: /* NEQ2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr] = b != a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 4) { @@ -2395,7 +2395,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xaa: /* GTH2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr] = b > a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 4) { @@ -2412,7 +2412,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xab: /* LTH2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr] = b < a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 4) { @@ -2440,7 +2440,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xad: /* JCN2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); if(u->wst.dat[u->wst.ptr - 3]) u->ram.ptr = a; #ifndef NO_STACK_CHECKS if(u->wst.ptr < 3) { @@ -2472,7 +2472,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xaf: /* STH2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); u->rst.dat[u->rst.ptr] = a >> 8; u->rst.dat[u->rst.ptr + 1] = a & 0xff; #ifndef NO_STACK_CHECKS @@ -2492,7 +2492,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xb0: /* LDZ2k */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->wst.dat[u->wst.ptr] = mempeek8(u->ram.dat, a); u->wst.dat[u->wst.ptr + 1] = mempeek8(u->ram.dat, a + 1); #ifndef NO_STACK_CHECKS @@ -2510,8 +2510,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xb1: /* STZ2k */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - Uint16 b = (u->wst.dat[u->wst.ptr - 2] | (u->wst.dat[u->wst.ptr - 3] << 8)); + u8 a = u->wst.dat[u->wst.ptr - 1]; + u16 b = (u->wst.dat[u->wst.ptr - 2] | (u->wst.dat[u->wst.ptr - 3] << 8)); mempoke16(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 3) { @@ -2523,9 +2523,9 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xb2: /* LDR2k */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - u->wst.dat[u->wst.ptr] = mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a); - u->wst.dat[u->wst.ptr + 1] = mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a + 1); + u8 a = u->wst.dat[u->wst.ptr - 1]; + u->wst.dat[u->wst.ptr] = mempeek8(u->ram.dat, u->ram.ptr + (s8)a); + u->wst.dat[u->wst.ptr + 1] = mempeek8(u->ram.dat, u->ram.ptr + (s8)a + 1); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 1) { u->wst.error = 1; @@ -2541,9 +2541,9 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xb3: /* STR2k */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - Uint16 b = (u->wst.dat[u->wst.ptr - 2] | (u->wst.dat[u->wst.ptr - 3] << 8)); - mempoke16(u->ram.dat, u->ram.ptr + (Sint8)a, b); + u8 a = u->wst.dat[u->wst.ptr - 1]; + u16 b = (u->wst.dat[u->wst.ptr - 2] | (u->wst.dat[u->wst.ptr - 3] << 8)); + mempoke16(u->ram.dat, u->ram.ptr + (s8)a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 3) { u->wst.error = 1; @@ -2554,7 +2554,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xb4: /* LDA2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); u->wst.dat[u->wst.ptr] = mempeek8(u->ram.dat, a); u->wst.dat[u->wst.ptr + 1] = mempeek8(u->ram.dat, a + 1); #ifndef NO_STACK_CHECKS @@ -2572,8 +2572,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xb5: /* STA2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); - Uint16 b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)); + u16 b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); mempoke16(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 4) { @@ -2585,7 +2585,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xb6: /* DEI2k */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; + u8 a = u->wst.dat[u->wst.ptr - 1]; u->wst.dat[u->wst.ptr] = devpeek8(&u->dev[a >> 4], a); u->wst.dat[u->wst.ptr + 1] = devpeek8(&u->dev[a >> 4], a + 1); #ifndef NO_STACK_CHECKS @@ -2603,8 +2603,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xb7: /* DEO2k */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1]; - Uint16 b = (u->wst.dat[u->wst.ptr - 2] | (u->wst.dat[u->wst.ptr - 3] << 8)); + u8 a = u->wst.dat[u->wst.ptr - 1]; + u16 b = (u->wst.dat[u->wst.ptr - 2] | (u->wst.dat[u->wst.ptr - 3] << 8)); devpoke16(&u->dev[a >> 4], a, b); #ifndef NO_STACK_CHECKS if(u->wst.ptr < 3) { @@ -2616,7 +2616,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xb8: /* ADD2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr] = (b + a) >> 8; u->wst.dat[u->wst.ptr + 1] = (b + a) & 0xff; #ifndef NO_STACK_CHECKS @@ -2634,7 +2634,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xb9: /* SUB2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr] = (b - a) >> 8; u->wst.dat[u->wst.ptr + 1] = (b - a) & 0xff; #ifndef NO_STACK_CHECKS @@ -2652,7 +2652,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xba: /* MUL2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr] = (b * a) >> 8; u->wst.dat[u->wst.ptr + 1] = (b * a) & 0xff; #ifndef NO_STACK_CHECKS @@ -2670,7 +2670,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xbb: /* DIV2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr] = (b / a) >> 8; u->wst.dat[u->wst.ptr + 1] = (b / a) & 0xff; #ifndef NO_STACK_CHECKS @@ -2688,7 +2688,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xbc: /* AND2k */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3], d = u->wst.dat[u->wst.ptr - 4]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3], d = u->wst.dat[u->wst.ptr - 4]; u->wst.dat[u->wst.ptr] = d & b; u->wst.dat[u->wst.ptr + 1] = c & a; #ifndef NO_STACK_CHECKS @@ -2706,7 +2706,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xbd: /* ORA2k */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3], d = u->wst.dat[u->wst.ptr - 4]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3], d = u->wst.dat[u->wst.ptr - 4]; u->wst.dat[u->wst.ptr] = d | b; u->wst.dat[u->wst.ptr + 1] = c | a; #ifndef NO_STACK_CHECKS @@ -2724,7 +2724,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xbe: /* EOR2k */ { - Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3], d = u->wst.dat[u->wst.ptr - 4]; + u8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2], c = u->wst.dat[u->wst.ptr - 3], d = u->wst.dat[u->wst.ptr - 4]; u->wst.dat[u->wst.ptr] = d ^ b; u->wst.dat[u->wst.ptr + 1] = c ^ a; #ifndef NO_STACK_CHECKS @@ -2742,7 +2742,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xbf: /* SFT2k */ { - Uint16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); + u16 a = (u->wst.dat[u->wst.ptr - 1] | (u->wst.dat[u->wst.ptr - 2] << 8)), b = (u->wst.dat[u->wst.ptr - 3] | (u->wst.dat[u->wst.ptr - 4] << 8)); u->wst.dat[u->wst.ptr] = (b >> (a & 0x000f) << ((a & 0x00f0) >> 4)) >> 8; u->wst.dat[u->wst.ptr + 1] = (b >> (a & 0x000f) << ((a & 0x00f0) >> 4)) & 0xff; #ifndef NO_STACK_CHECKS @@ -2771,7 +2771,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xc4: /* DUPkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->rst.dat[u->rst.ptr] = a; u->rst.dat[u->rst.ptr + 1] = a; #ifndef NO_STACK_CHECKS @@ -2789,7 +2789,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xc5: /* SWPkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = a; u->rst.dat[u->rst.ptr + 1] = b; #ifndef NO_STACK_CHECKS @@ -2807,7 +2807,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xc6: /* OVRkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b; u->rst.dat[u->rst.ptr + 1] = a; u->rst.dat[u->rst.ptr + 2] = b; @@ -2826,7 +2826,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xc7: /* ROTkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3]; u->rst.dat[u->rst.ptr] = b; u->rst.dat[u->rst.ptr + 1] = a; u->rst.dat[u->rst.ptr + 2] = c; @@ -2845,7 +2845,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xc8: /* EQUkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b == a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -2862,7 +2862,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xc9: /* NEQkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b != a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -2879,7 +2879,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xca: /* GTHkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b > a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -2896,7 +2896,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xcb: /* LTHkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b < a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -2913,8 +2913,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xcc: /* JMPkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - u->ram.ptr += (Sint8)a; + u8 a = u->rst.dat[u->rst.ptr - 1]; + u->ram.ptr += (s8)a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { u->rst.error = 1; @@ -2925,8 +2925,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xcd: /* JCNkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - if(u->rst.dat[u->rst.ptr - 2]) u->ram.ptr += (Sint8)a; + u8 a = u->rst.dat[u->rst.ptr - 1]; + if(u->rst.dat[u->rst.ptr - 2]) u->ram.ptr += (s8)a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { u->rst.error = 1; @@ -2937,10 +2937,10 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xce: /* JSRkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->wst.dat[u->wst.ptr] = u->ram.ptr >> 8; u->wst.dat[u->wst.ptr + 1] = u->ram.ptr & 0xff; - u->ram.ptr += (Sint8)a; + u->ram.ptr += (s8)a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { u->rst.error = 1; @@ -2958,7 +2958,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xcf: /* STHkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->wst.dat[u->wst.ptr] = a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { @@ -2977,7 +2977,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xd0: /* LDZkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->rst.dat[u->rst.ptr] = mempeek8(u->ram.dat, a); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { @@ -2994,8 +2994,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xd1: /* STZkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - Uint8 b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1]; + u8 b = u->rst.dat[u->rst.ptr - 2]; mempoke8(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -3007,8 +3007,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xd2: /* LDRkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - u->rst.dat[u->rst.ptr] = mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a); + u8 a = u->rst.dat[u->rst.ptr - 1]; + u->rst.dat[u->rst.ptr] = mempeek8(u->ram.dat, u->ram.ptr + (s8)a); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { u->rst.error = 1; @@ -3024,9 +3024,9 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xd3: /* STRkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - Uint8 b = u->rst.dat[u->rst.ptr - 2]; - mempoke8(u->ram.dat, u->ram.ptr + (Sint8)a, b); + u8 a = u->rst.dat[u->rst.ptr - 1]; + u8 b = u->rst.dat[u->rst.ptr - 2]; + mempoke8(u->ram.dat, u->ram.ptr + (s8)a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { u->rst.error = 1; @@ -3037,7 +3037,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xd4: /* LDAkr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); u->rst.dat[u->rst.ptr] = mempeek8(u->ram.dat, a); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -3054,8 +3054,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xd5: /* STAkr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); - Uint8 b = u->rst.dat[u->rst.ptr - 3]; + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u8 b = u->rst.dat[u->rst.ptr - 3]; mempoke8(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 3) { @@ -3067,7 +3067,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xd6: /* DEIkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->rst.dat[u->rst.ptr] = devpeek8(&u->dev[a >> 4], a); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { @@ -3084,7 +3084,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xd7: /* DEOkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; devpoke8(&u->dev[a >> 4], a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -3096,7 +3096,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xd8: /* ADDkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b + a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -3113,7 +3113,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xd9: /* SUBkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b - a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -3130,7 +3130,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xda: /* MULkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b * a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -3147,7 +3147,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xdb: /* DIVkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b / a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -3164,7 +3164,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xdc: /* ANDkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b & a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -3181,7 +3181,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xdd: /* ORAkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b | a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -3198,7 +3198,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xde: /* EORkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b ^ a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -3215,7 +3215,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xdf: /* SFTkr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; u->rst.dat[u->rst.ptr] = b >> (a & 0x07) << ((a & 0x70) >> 4); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 2) { @@ -3243,7 +3243,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xe4: /* DUP2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); u->rst.dat[u->rst.ptr] = a >> 8; u->rst.dat[u->rst.ptr + 1] = a & 0xff; u->rst.dat[u->rst.ptr + 2] = a >> 8; @@ -3263,7 +3263,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xe5: /* SWP2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr] = a >> 8; u->rst.dat[u->rst.ptr + 1] = a & 0xff; u->rst.dat[u->rst.ptr + 2] = b >> 8; @@ -3283,7 +3283,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xe6: /* OVR2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr] = b >> 8; u->rst.dat[u->rst.ptr + 1] = b & 0xff; u->rst.dat[u->rst.ptr + 2] = a >> 8; @@ -3305,7 +3305,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xe7: /* ROT2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)), c = (u->rst.dat[u->rst.ptr - 5] | (u->rst.dat[u->rst.ptr - 6] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)), c = (u->rst.dat[u->rst.ptr - 5] | (u->rst.dat[u->rst.ptr - 6] << 8)); u->rst.dat[u->rst.ptr] = b >> 8; u->rst.dat[u->rst.ptr + 1] = b & 0xff; u->rst.dat[u->rst.ptr + 2] = a >> 8; @@ -3327,7 +3327,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xe8: /* EQU2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr] = b == a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 4) { @@ -3344,7 +3344,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xe9: /* NEQ2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr] = b != a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 4) { @@ -3361,7 +3361,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xea: /* GTH2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr] = b > a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 4) { @@ -3378,7 +3378,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xeb: /* LTH2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr] = b < a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 4) { @@ -3406,7 +3406,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xed: /* JCN2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); if(u->rst.dat[u->rst.ptr - 3]) u->ram.ptr = a; #ifndef NO_STACK_CHECKS if(u->rst.ptr < 3) { @@ -3438,7 +3438,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xef: /* STH2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); u->wst.dat[u->wst.ptr] = a >> 8; u->wst.dat[u->wst.ptr + 1] = a & 0xff; #ifndef NO_STACK_CHECKS @@ -3458,7 +3458,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xf0: /* LDZ2kr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->rst.dat[u->rst.ptr] = mempeek8(u->ram.dat, a); u->rst.dat[u->rst.ptr + 1] = mempeek8(u->ram.dat, a + 1); #ifndef NO_STACK_CHECKS @@ -3476,8 +3476,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xf1: /* STZ2kr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - Uint16 b = (u->rst.dat[u->rst.ptr - 2] | (u->rst.dat[u->rst.ptr - 3] << 8)); + u8 a = u->rst.dat[u->rst.ptr - 1]; + u16 b = (u->rst.dat[u->rst.ptr - 2] | (u->rst.dat[u->rst.ptr - 3] << 8)); mempoke16(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 3) { @@ -3489,9 +3489,9 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xf2: /* LDR2kr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - u->rst.dat[u->rst.ptr] = mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a); - u->rst.dat[u->rst.ptr + 1] = mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a + 1); + u8 a = u->rst.dat[u->rst.ptr - 1]; + u->rst.dat[u->rst.ptr] = mempeek8(u->ram.dat, u->ram.ptr + (s8)a); + u->rst.dat[u->rst.ptr + 1] = mempeek8(u->ram.dat, u->ram.ptr + (s8)a + 1); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 1) { u->rst.error = 1; @@ -3507,9 +3507,9 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xf3: /* STR2kr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - Uint16 b = (u->rst.dat[u->rst.ptr - 2] | (u->rst.dat[u->rst.ptr - 3] << 8)); - mempoke16(u->ram.dat, u->ram.ptr + (Sint8)a, b); + u8 a = u->rst.dat[u->rst.ptr - 1]; + u16 b = (u->rst.dat[u->rst.ptr - 2] | (u->rst.dat[u->rst.ptr - 3] << 8)); + mempoke16(u->ram.dat, u->ram.ptr + (s8)a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 3) { u->rst.error = 1; @@ -3520,7 +3520,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xf4: /* LDA2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); u->rst.dat[u->rst.ptr] = mempeek8(u->ram.dat, a); u->rst.dat[u->rst.ptr + 1] = mempeek8(u->ram.dat, a + 1); #ifndef NO_STACK_CHECKS @@ -3538,8 +3538,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xf5: /* STA2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); - Uint16 b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)); + u16 b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); mempoke16(u->ram.dat, a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 4) { @@ -3551,7 +3551,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xf6: /* DEI2kr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; + u8 a = u->rst.dat[u->rst.ptr - 1]; u->rst.dat[u->rst.ptr] = devpeek8(&u->dev[a >> 4], a); u->rst.dat[u->rst.ptr + 1] = devpeek8(&u->dev[a >> 4], a + 1); #ifndef NO_STACK_CHECKS @@ -3569,8 +3569,8 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xf7: /* DEO2kr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1]; - Uint16 b = (u->rst.dat[u->rst.ptr - 2] | (u->rst.dat[u->rst.ptr - 3] << 8)); + u8 a = u->rst.dat[u->rst.ptr - 1]; + u16 b = (u->rst.dat[u->rst.ptr - 2] | (u->rst.dat[u->rst.ptr - 3] << 8)); devpoke16(&u->dev[a >> 4], a, b); #ifndef NO_STACK_CHECKS if(u->rst.ptr < 3) { @@ -3582,7 +3582,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xf8: /* ADD2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr] = (b + a) >> 8; u->rst.dat[u->rst.ptr + 1] = (b + a) & 0xff; #ifndef NO_STACK_CHECKS @@ -3600,7 +3600,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xf9: /* SUB2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr] = (b - a) >> 8; u->rst.dat[u->rst.ptr + 1] = (b - a) & 0xff; #ifndef NO_STACK_CHECKS @@ -3618,7 +3618,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xfa: /* MUL2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr] = (b * a) >> 8; u->rst.dat[u->rst.ptr + 1] = (b * a) & 0xff; #ifndef NO_STACK_CHECKS @@ -3636,7 +3636,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xfb: /* DIV2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr] = (b / a) >> 8; u->rst.dat[u->rst.ptr + 1] = (b / a) & 0xff; #ifndef NO_STACK_CHECKS @@ -3654,7 +3654,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xfc: /* AND2kr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3], d = u->rst.dat[u->rst.ptr - 4]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3], d = u->rst.dat[u->rst.ptr - 4]; u->rst.dat[u->rst.ptr] = d & b; u->rst.dat[u->rst.ptr + 1] = c & a; #ifndef NO_STACK_CHECKS @@ -3672,7 +3672,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xfd: /* ORA2kr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3], d = u->rst.dat[u->rst.ptr - 4]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3], d = u->rst.dat[u->rst.ptr - 4]; u->rst.dat[u->rst.ptr] = d | b; u->rst.dat[u->rst.ptr + 1] = c | a; #ifndef NO_STACK_CHECKS @@ -3690,7 +3690,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xfe: /* EOR2kr */ { - Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3], d = u->rst.dat[u->rst.ptr - 4]; + u8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2], c = u->rst.dat[u->rst.ptr - 3], d = u->rst.dat[u->rst.ptr - 4]; u->rst.dat[u->rst.ptr] = d ^ b; u->rst.dat[u->rst.ptr + 1] = c ^ a; #ifndef NO_STACK_CHECKS @@ -3708,7 +3708,7 @@ evaluxn(Uxn *u, Uint16 vec) } case 0xff: /* SFT2kr */ { - Uint16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); + u16 a = (u->rst.dat[u->rst.ptr - 1] | (u->rst.dat[u->rst.ptr - 2] << 8)), b = (u->rst.dat[u->rst.ptr - 3] | (u->rst.dat[u->rst.ptr - 4] << 8)); u->rst.dat[u->rst.ptr] = (b >> (a & 0x000f) << ((a & 0x00f0) >> 4)) >> 8; u->rst.dat[u->rst.ptr + 1] = (b >> (a & 0x000f) << ((a & 0x00f0) >> 4)) & 0xff; #ifndef NO_STACK_CHECKS @@ -3756,7 +3756,7 @@ loaduxn(Uxn *u, char *filepath) } Device * -portuxn(Uxn *u, Uint8 id, char *name, void (*talkfn)(Device *d, Uint8 b0, Uint8 w)) +portuxn(Uxn *u, u8 id, char *name, void (*talkfn)(Device *d, u8 b0, u8 w)) { Device *d = &u->dev[id]; d->addr = id * 0x10; diff --git a/src/uxn/uxn.h b/src/uxn/uxn.h index 6c6d53e..a4ab428 100644 --- a/src/uxn/uxn.h +++ b/src/uxn/uxn.h @@ -14,27 +14,22 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. */ -typedef unsigned char Uint8; -typedef signed char Sint8; -typedef unsigned short Uint16; -typedef signed short Sint16; - #define PAGE_PROGRAM 0x0100 typedef struct { - Uint8 ptr, kptr, error; - Uint8 dat[256]; + u8 ptr, kptr, error; + u8 dat[256]; } Stack; typedef struct { - Uint16 ptr; - Uint8 *dat; + u16 ptr; + u8 *dat; } Memory; typedef struct Device { struct Uxn *u; - Uint8 addr, dat[16], *mem; - void (*talk)(struct Device *d, Uint8, Uint8); + u8 addr, dat[16], *mem; + void (*talk)(struct Device *d, u8, u8); } Device; typedef struct Uxn { @@ -45,17 +40,17 @@ typedef struct Uxn { struct Uxn; -static inline void mempoke8(Uint8 *m, Uint16 a, Uint8 b) { m[a] = b; } -static inline Uint8 mempeek8(Uint8 *m, Uint16 a) { return m[a]; } -static inline void mempoke16(Uint8 *m, Uint16 a, Uint16 b) { mempoke8(m, a, b >> 8); mempoke8(m, a + 1, b); } -static inline Uint16 mempeek16(Uint8 *m, Uint16 a) { return (mempeek8(m, a) << 8) + mempeek8(m, a + 1); } -static inline void devpoke8(Device *d, Uint8 a, Uint8 b) { d->dat[a & 0xf] = b; d->talk(d, a & 0x0f, 1); } -static inline Uint8 devpeek8(Device *d, Uint8 a) { d->talk(d, a & 0x0f, 0); return d->dat[a & 0xf]; } -static inline void devpoke16(Device *d, Uint8 a, Uint16 b) { devpoke8(d, a, b >> 8); devpoke8(d, a + 1, b); } -static inline Uint16 devpeek16(Device *d, Uint16 a) { return (devpeek8(d, a) << 8) + devpeek8(d, a + 1); } +static inline void mempoke8(u8 *m, u16 a, u8 b) { m[a] = b; } +static inline u8 mempeek8(u8 *m, u16 a) { return m[a]; } +static inline void mempoke16(u8 *m, u16 a, u16 b) { mempoke8(m, a, b >> 8); mempoke8(m, a + 1, b); } +static inline u16 mempeek16(u8 *m, u16 a) { return (mempeek8(m, a) << 8) + mempeek8(m, a + 1); } +static inline void devpoke8(Device *d, u8 a, u8 b) { d->dat[a & 0xf] = b; d->talk(d, a & 0x0f, 1); } +static inline u8 devpeek8(Device *d, u8 a) { d->talk(d, a & 0x0f, 0); return d->dat[a & 0xf]; } +static inline void devpoke16(Device *d, u8 a, u16 b) { devpoke8(d, a, b >> 8); devpoke8(d, a + 1, b); } +static inline u16 devpeek16(Device *d, u16 a) { return (devpeek8(d, a) << 8) + devpeek8(d, a + 1); } int loaduxn(Uxn *c, char *filepath); int bootuxn(Uxn *c); -int evaluxn(Uxn *u, Uint16 vec); -Device *portuxn(Uxn *u, Uint8 id, char *name, void (*talkfn)(Device *, Uint8, Uint8)); +int evaluxn(Uxn *u, u16 vec); +Device *portuxn(Uxn *u, u8 id, char *name, void (*talkfn)(Device *, u8, u8)); #endif // UXNGBA_UXN_H diff --git a/src/uxn/uxn/opcodes.c b/src/uxn/uxn/opcodes.c deleted file mode 100644 index 947755f..0000000 --- a/src/uxn/uxn/opcodes.c +++ /dev/null @@ -1,373 +0,0 @@ -/* -Copyright (u) 2021 Devine Lu Linvega -Copyright (c) 2021 Adrian "asie" Siekierka - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE. -*/ - -/* 8-BIT OPCODES */ - -case UXN_OPC(0x00): -case UXN_OPC(0x20): { // brk - u->ram.ptr = 0; -} break; -case UXN_OPC(0x01): { // lit - push8(UXN_SRC, mempeek8(u->ram.dat, u->ram.ptr++)); -} break; -case UXN_OPC(0x02): -case UXN_OPC(0x22): { // nop -} break; -case UXN_OPC(0x03): { // pop - UXN_KEEP_SYNC; - pop8(UXN_SRC); -} break; -case UXN_OPC(0x04): { // dup - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - push8(UXN_SRC, a); - push8(UXN_SRC, a); -} break; -case UXN_OPC(0x05): { // swp - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, a); - push8(UXN_SRC, b); -} break; -case UXN_OPC(0x06): { // ovr - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b); - push8(UXN_SRC, a); - push8(UXN_SRC, b); -} break; -case UXN_OPC(0x07): { // rot - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - Uint8 c = pop8(UXN_SRC); - push8(UXN_SRC, b); - push8(UXN_SRC, a); - push8(UXN_SRC, c); -} break; -case UXN_OPC(0x08): { // equ - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b == a); -} break; -case UXN_OPC(0x09): { // neg - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b != a); -} break; -case UXN_OPC(0x0A): { // gth - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b > a); -} break; -case UXN_OPC(0x0B): { // lth - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b < a); -} break; -case UXN_OPC(0x0C): { // jmp - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - u->ram.ptr += (Sint8)a; -} break; -case UXN_OPC(0x0D): { // jnz - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - if (pop8(UXN_SRC)) - u->ram.ptr += (Sint8)a; -} break; -case UXN_OPC(0x0E): { // jsr - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - push16(UXN_DST, u->ram.ptr); - u->ram.ptr += (Sint8)a; -} break; -case UXN_OPC(0x0F): { // sth - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - push8(UXN_DST, a); -} break; -case UXN_OPC(0x10): { // pek - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - push8(UXN_SRC, mempeek8(u->ram.dat, a)); -} break; -case UXN_OPC(0x11): { // pok - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - mempoke8(u->ram.dat, a, b); -} break; -case UXN_OPC(0x12): { // ldr - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - push8(UXN_SRC, mempeek8(u->ram.dat, u->ram.ptr + (Sint8)a)); -} break; -case UXN_OPC(0x13): { // str - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - mempoke8(u->ram.dat, u->ram.ptr + (Sint8)a, b); -} break; -case UXN_OPC(0x14): { // lda - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - push8(UXN_SRC, mempeek8(u->ram.dat, a)); -} break; -case UXN_OPC(0x15): { // sta - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - mempoke8(u->ram.dat, a, b); -} break; -case UXN_OPC(0x16): { // dei - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - push8(UXN_SRC, devpeek8(&u->dev[a >> 4], a)); -} break; -case UXN_OPC(0x17): { // deo - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - devpoke8(&u->dev[a >> 4], a, b); -} break; -case UXN_OPC(0x18): { // add - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b + a); -} break; -case UXN_OPC(0x19): { // sub - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b - a); -} break; -case UXN_OPC(0x1A): { // mul - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b * a); -} break; -case UXN_OPC(0x1B): { // div - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b / a); -} break; -case UXN_OPC(0x1C): { // and - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b & a); -} break; -case UXN_OPC(0x1D): { // ora - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b | a); -} break; -case UXN_OPC(0x1E): { // eor - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b ^ a); -} break; -case UXN_OPC(0x1F): { // sft - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint8 b = pop8(UXN_SRC); - push8(UXN_SRC, b >> (a & 0x07) << ((a & 0x70) >> 4)); -} break; - -/* 16-BIT OPCODES */ - -case UXN_OPC(0x21): { // lit - push16(UXN_SRC, mempeek16(u->ram.dat, u->ram.ptr)); - u->ram.ptr += 2; -} break; -case UXN_OPC(0x23): { // pop - UXN_KEEP_SYNC; - pop16(UXN_SRC); -} break; -case UXN_OPC(0x24): { // dup - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - push16(UXN_SRC, a); - push16(UXN_SRC, a); -} break; -case UXN_OPC(0x25): { // swp - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push16(UXN_SRC, a); - push16(UXN_SRC, b); -} break; -case UXN_OPC(0x26): { // ovr - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push16(UXN_SRC, b); - push16(UXN_SRC, a); - push16(UXN_SRC, b); -} break; -case UXN_OPC(0x27): { // rot - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - Uint16 c = pop16(UXN_SRC); - push16(UXN_SRC, b); - push16(UXN_SRC, a); - push16(UXN_SRC, c); -} break; -case UXN_OPC(0x28): { // equ - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push8(UXN_SRC, b == a); -} break; -case UXN_OPC(0x29): { // neg - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push8(UXN_SRC, b != a); -} break; -case UXN_OPC(0x2A): { // gth - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push8(UXN_SRC, b > a); -} break; -case UXN_OPC(0x2B): { // lth - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push8(UXN_SRC, b < a); -} break; -case UXN_OPC(0x2C): { // jmp - UXN_KEEP_SYNC; - u->ram.ptr = pop16(UXN_SRC); -} break; -case UXN_OPC(0x2D): { // jnz - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - if (pop8(UXN_SRC)) - u->ram.ptr = a; -} break; -case UXN_OPC(0x2E): { // jsr - UXN_KEEP_SYNC; - push16(UXN_DST, u->ram.ptr); - u->ram.ptr = pop16(UXN_SRC); -} break; -case UXN_OPC(0x2F): { // sth - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - push16(UXN_DST, a); -} break; -case UXN_OPC(0x30): { // pek - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - push16(UXN_SRC, mempeek16(u->ram.dat, a)); -} break; -case UXN_OPC(0x31): { // pok - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - mempoke16(u->ram.dat, a, b); -} break; -case UXN_OPC(0x32): { // ldr - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - push16(UXN_SRC, mempeek16(u->ram.dat, u->ram.ptr + (Sint8)a)); -} break; -case UXN_OPC(0x33): { // str - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - mempoke16(u->ram.dat, u->ram.ptr + (Sint8)a, b); -} break; -case UXN_OPC(0x34): { // lda - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - push16(UXN_SRC, mempeek16(u->ram.dat, a)); -} break; -case UXN_OPC(0x35): { // sta - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - mempoke16(u->ram.dat, a, b); -} break; -case UXN_OPC(0x36): { // dei - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - push16(UXN_SRC, devpeek16(&u->dev[a >> 4], a)); -} break; -case UXN_OPC(0x37): { // deo - UXN_KEEP_SYNC; - Uint8 a = pop8(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - devpoke16(&u->dev[a >> 4], a, b); -} break; -case UXN_OPC(0x38): { // add - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push16(UXN_SRC, b + a); -} break; -case UXN_OPC(0x39): { // sub - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push16(UXN_SRC, b - a); -} break; -case UXN_OPC(0x3A): { // mul - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push16(UXN_SRC, b * a); -} break; -case UXN_OPC(0x3B): { // div - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push16(UXN_SRC, b / a); -} break; -case UXN_OPC(0x3C): { // and - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push16(UXN_SRC, b & a); -} break; -case UXN_OPC(0x3D): { // ora - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push16(UXN_SRC, b | a); -} break; -case UXN_OPC(0x3E): { // eor - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push16(UXN_SRC, b ^ a); -} break; -case UXN_OPC(0x3F): { // sft - UXN_KEEP_SYNC; - Uint16 a = pop16(UXN_SRC); - Uint16 b = pop16(UXN_SRC); - push16(UXN_SRC, b >> (a & 0x000f) << ((a & 0x00f0) >> 4)); -} break; -- cgit v1.2.1