diff options
Diffstat (limited to 'src/uxn/uxn.c')
-rw-r--r-- | src/uxn/uxn.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/uxn/uxn.c b/src/uxn/uxn.c index 8e76660..53f7983 100644 --- a/src/uxn/uxn.c +++ b/src/uxn/uxn.c | |||
@@ -16,21 +16,12 @@ WITH REGARD TO THIS SOFTWARE. | |||
16 | /* clang-format off */ | 16 | /* clang-format off */ |
17 | 17 | ||
18 | static inline void push8(Stack *s, Uint8 a) { | 18 | static inline void push8(Stack *s, Uint8 a) { |
19 | #ifdef CPU_ERROR_CHECKING | ||
20 | if (s->ptr == 0xff) { s->error = 2; return; } | ||
21 | #endif | ||
22 | s->dat[s->ptr++] = a; | 19 | s->dat[s->ptr++] = a; |
23 | } | 20 | } |
24 | static inline Uint8 pop8_keep(Stack *s) { | 21 | static inline Uint8 pop8_keep(Stack *s) { |
25 | #ifdef CPU_ERROR_CHECKING | ||
26 | if (s->kptr == 0) { s->error = 1; return 0; } | ||
27 | #endif | ||
28 | return s->dat[--s->kptr]; | 22 | return s->dat[--s->kptr]; |
29 | } | 23 | } |
30 | static inline Uint8 pop8_nokeep(Stack *s) { | 24 | static inline Uint8 pop8_nokeep(Stack *s) { |
31 | #ifdef CPU_ERROR_CHECKING | ||
32 | if (s->ptr == 0) { s->error = 1; return 0; } | ||
33 | #endif | ||
34 | return s->dat[--s->ptr]; | 25 | return s->dat[--s->ptr]; |
35 | } | 26 | } |
36 | static inline void devpoke8(Device *d, Uint8 a, Uint8 b) { d->dat[a & 0xf] = b; d->talk(d, a & 0x0f, 1); } | 27 | static inline void devpoke8(Device *d, Uint8 a, Uint8 b) { d->dat[a & 0xf] = b; d->talk(d, a & 0x0f, 1); } |
@@ -55,7 +46,7 @@ IWRAM_CODE | |||
55 | static inline void | 46 | static inline void |
56 | opcuxn(Uxn *u, Uint8 instr) | 47 | opcuxn(Uxn *u, Uint8 instr) |
57 | { | 48 | { |
58 | #ifdef CPU_ERROR_CHECKING | 49 | #if 1 |
59 | // With CPU error checking enabled, the codebase becomes too large to fit in ITCM. | 50 | // With CPU error checking enabled, the codebase becomes too large to fit in ITCM. |
60 | // Therefore, we take some concessions. | 51 | // Therefore, we take some concessions. |
61 | if (instr & 0x40) { | 52 | if (instr & 0x40) { |
@@ -155,8 +146,6 @@ int | |||
155 | evaluxn(Uxn *u, Uint16 vec) | 146 | evaluxn(Uxn *u, Uint16 vec) |
156 | { | 147 | { |
157 | u->ram.ptr = vec; | 148 | u->ram.ptr = vec; |
158 | u->wst.error = 0; | ||
159 | u->rst.error = 0; | ||
160 | while(u->ram.ptr) { | 149 | while(u->ram.ptr) { |
161 | opcuxn(u, u->ram.dat[u->ram.ptr++]); | 150 | opcuxn(u, u->ram.dat[u->ram.ptr++]); |
162 | } | 151 | } |