| ... | ... |
@@ -20,5 +20,5 @@ cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werr |
| 20 | 20 |
# cc uxn.c emulator.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -L/usr/local/lib -lSDL2 -o bin/emulator |
| 21 | 21 |
|
| 22 | 22 |
# run |
| 23 |
-./bin/assembler projects/software/nasu.usm bin/boot.rom |
|
| 23 |
+./bin/assembler projects/software/left.usm bin/boot.rom |
|
| 24 | 24 |
./bin/emulator bin/boot.rom |
| ... | ... |
@@ -103,12 +103,12 @@ void (*ops[])(Uxn *u) = {
|
| 103 | 103 |
Uint8 opr[][4] = { /* wstack-/+ rstack-/+ */
|
| 104 | 104 |
{0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {2,1,0,0}, {3,0,0,0}, {1,0,0,0}, {1,0,0,2}, {0,0,2,0},
|
| 105 | 105 |
{2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0},
|
| 106 |
- {1,0,0,0}, {1,2,0,0}, {2,2,0,0}, {2,3,0,0}, {3,3,0,0}, {0,0,0,0}, {1,0,0,1}, {0,1,1,0},
|
|
| 106 |
+ {1,0,0,0}, {0,2,0,0}, {2,2,0,0}, {2,3,0,0}, {3,3,0,0}, {0,0,0,0}, {1,0,0,1}, {0,1,1,0},
|
|
| 107 | 107 |
{2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,2,0,0},
|
| 108 | 108 |
/* 16-bit */ |
| 109 | 109 |
{0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {2,2,0,0}, {4,0,0,0}, {2,0,0,0}, {2,0,0,0}, {0,0,0,0}, /* TODO */
|
| 110 |
- {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, /* TODO */
|
|
| 111 |
- {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {2,0,0,2}, {0,2,2,0}, /* TODO */
|
|
| 110 |
+ {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, /* TODO */
|
|
| 111 |
+ {0,2,0,0}, {0,2,0,0}, {1,1,0,0}, {4,6,0,0}, {6,6,0,0}, {0,0,0,0}, {2,0,0,2}, {0,2,2,0}, /* TODO */
|
|
| 112 | 112 |
{4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,2,0,0}
|
| 113 | 113 |
}; |
| 114 | 114 |
|
| ... | ... |
@@ -156,12 +156,8 @@ opcuxn(Uxn *u, Uint8 instr) |
| 156 | 156 |
return haltuxn(u, "Return-stack overflow", instr); |
| 157 | 157 |
if(!fcond || (fcond && pop8(&u->wst))) |
| 158 | 158 |
(*ops[op])(u); |
| 159 |
- else {
|
|
| 160 |
- if(freturn) |
|
| 161 |
- u->src->ptr -= opr[op][2] - opr[op][3]; |
|
| 162 |
- else |
|
| 163 |
- u->src->ptr -= opr[op][0] - opr[op][1]; |
|
| 164 |
- } |
|
| 159 |
+ else |
|
| 160 |
+ u->src->ptr -= opr[op][freturn ? 2 : 0] - opr[op][freturn ? 3 : 1]; |
|
| 165 | 161 |
return 1; |
| 166 | 162 |
} |
| 167 | 163 |
|