diff --git a/makefile b/makefile index f0e86fb..20aeab3 100644 --- a/makefile +++ b/makefile @@ -13,11 +13,11 @@ dest: @ mkdir -p bin run: all bin/uxnasm bin/uxncli bin/uxn11 @ bin/uxn11 -test: bin/uxnasm bin/uxncli bin/uxn11 +test: all @ bin/uxnasm -v && ./bin/uxncli -v && ./bin/uxn11 -v @ bin/uxnasm etc/opctest.tal bin/opctest.rom @ bin/uxncli bin/opctest.rom -install: all bin/uxnasm bin/uxncli bin/uxn11 +install: all @ cp bin/uxn11 bin/uxnasm bin/uxncli ~/bin/ uninstall: @ rm -f ~/bin/uxn11 ~/bin/uxnasm ~/bin/uxncli @@ -31,6 +31,6 @@ clean: bin/uxnasm: src/uxnasm.c @ cc ${RELEASE_flags} ${CFLAGS} src/uxnasm.c -o bin/uxnasm bin/uxncli: ${CLI_src} src/uxncli.c - @ cc ${DEBUG_flags} ${CFLAGS} ${CLI_src} src/uxncli.c -lutil -o bin/uxncli + @ cc ${RELEASE_flags} ${CFLAGS} ${CLI_src} src/uxncli.c -lutil -o bin/uxncli bin/uxn11: ${EMU_src} src/uxn11.c - @ cc ${DEBUG_flags} ${CFLAGS} ${EMU_src} src/uxn11.c -lX11 -lutil -o bin/uxn11 + @ cc ${RELEASE_flags} ${CFLAGS} ${EMU_src} src/uxn11.c -lX11 -lutil -o bin/uxn11 diff --git a/src/uxn.c b/src/uxn.c index 7994ccb..5357f8e 100644 --- a/src/uxn.c +++ b/src/uxn.c @@ -30,20 +30,19 @@ WITH REGARD TO THIS SOFTWARE. #define T2_(v) { r = (v); T = r; N = r >> 8; } #define N2_(v) { r = (v); L = r; X = r >> 8; } #define L2_(v) { r = (v); Y = r; Z = r >> 8; } -#define FLIP { s = ins & 0x40 ? &u->wst : &u->rst; } +#define FLIP { s = ins & 0x40 ? &uxn.wst : &uxn.rst; } #define SHIFT(y) { s->ptr += (y); } #define SET(x, y) { SHIFT((ins & 0x80) ? x + y : y) } int uxn_eval(Uint16 pc) { - Uxn *u = &uxn; Uint16 t, n, l, r; Uint8 *rr; - if(!pc || u->dev[0x0f]) return 0; + if(!pc || uxn.dev[0x0f]) return 0; for(;;) { Uint8 ins = uxn.ram[pc++]; - Stack *s = ins & 0x40 ? &u->rst : &u->wst; + Stack *s = ins & 0x40 ? &uxn.rst : &uxn.wst; switch(ins & 0x3f) { /* IMM */ case 0x00: case 0x20: