commit 9137114
neauoire
·
2022-04-18 19:32:42 +0000 UTC
parent d8f27c8
Simplified LIT opcode
+2,
-2
1@@ -25,7 +25,7 @@ The stack mapping is 254 bytes of data, a byte for the pointer and a byte for an
2 All you need is X11.
3
4 ```sh
5-gcc -DNDEBUG -Og -g0 -s src/uxn.c src/devices/system.c src/devices/screen.c src/devices/controller.c src/devices/mouse.c src/devices/file.c src/devices/datetime.c src/uxn11.c -o bin/uxn11 -lX11
6+gcc -Os -DNDEBUG -g0 -s src/uxn.c src/devices/system.c src/devices/screen.c src/devices/controller.c src/devices/mouse.c src/devices/file.c src/devices/datetime.c src/uxn11.c -o bin/uxn11 -lX11
7 ```
8
9 ### Terminal
10@@ -33,7 +33,7 @@ gcc -DNDEBUG -Og -g0 -s src/uxn.c src/devices/system.c src/devices/screen.c src/
11 If you wish to build the emulator without graphics mode:
12
13 ```sh
14-gcc -DNDEBUG -Og -g0 -s src/uxn.c src/devices/system.c src/devices/file.c src/devices/datetime.c src/uxncli.c -o bin/uxncli
15+gcc -Os -DNDEBUG -g0 -s src/uxn.c src/devices/system.c src/devices/file.c src/devices/datetime.c src/uxncli.c -o bin/uxncli
16 ```
17
18 ## Usage
M
build.sh
+1,
-1
1@@ -1,6 +1,6 @@
2 #!/bin/sh -e
3
4-RELEASE_FLAGS="-Os -DNDEBUG -g0 -s -Wall"
5+RELEASE_FLAGS="-Os -DNDEBUG -g0 -s"
6 DEBUG_FLAGS="-std=c89 -D_POSIX_C_SOURCE=199309L -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined"
7 EMU_INC="src/uxn.c src/devices/system.c src/devices/screen.c src/devices/controller.c src/devices/mouse.c src/devices/file.c src/devices/datetime.c src/uxn11.c -o bin/uxn11 -lX11"
8 CLI_INC="src/uxn.c src/devices/system.c src/devices/file.c src/devices/datetime.c src/uxncli.c -o bin/uxncli"
+1,
-2
1@@ -51,8 +51,7 @@ uxn_eval(Uxn *u, Uint16 pc)
2 bs = instr & 0x20 ? 1 : 0;
3 switch(instr & 0x1f) {
4 /* Stack */
5- case 0x00: /* LIT */ if(bs) { PEEK16(a, pc) PUSH16(src, a) pc += 2; }
6- else { a = u->ram[pc]; PUSH8(src, a) pc++; } break;
7+ case 0x00: /* LIT */ PEEK(a, pc) PUSH(src, a) pc += 1 + bs; break;
8 case 0x01: /* INC */ POP(a) PUSH(src, a + 1) break;
9 case 0x02: /* POP */ POP(a) break;
10 case 0x03: /* NIP */ POP(a) POP(b) PUSH(src, a) break;