summaryrefslogtreecommitdiff
path: root/sux.h
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-01-19 14:24:51 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2022-01-19 14:24:51 -0400
commitf5d75afcc0572335ad1f3b268c96a940c6db123c (patch)
tree5edb96a21dd08d9d840995e6f7d92285b28d5c3f /sux.h
parent6d0e1d5754a2093ac16e6947231b6bd320c7de0a (diff)
sux.h: Set program counter to interrupt vectors, when
an interrupt gets triggered. This is done in order to properly use the `read_addr()` function.
Diffstat (limited to 'sux.h')
-rw-r--r--sux.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sux.h b/sux.h
index a161c48..43043db 100644
--- a/sux.h
+++ b/sux.h
@@ -1797,10 +1797,10 @@ static /*inline*/ void inst_##op(struct sux *cpu, uint8_t prefix, uint8_t size,
uint64_t dummy = 0, *reg = &dummy; \
int pre_idx = 0, mem_type = ZM; \
/* Decode Address. */ \
- t(1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { addr = 0xFFA0; } /* NMI Vector. */ \
- t(2, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { addr = 0xFFC0; } /* Reset Vector. */ \
- t(4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { addr = 0xFFE0; } /* IRQ Vector. */ \
- t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000) { addr = 0xFFF0; } /* BRK Vector. */ \
+ t(1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { cpu->pc = 0xFFA0; } /* NMI Vector. */ \
+ t(2, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { cpu->pc = 0xFFC0; } /* Reset Vector. */ \
+ t(4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { cpu->pc = 0xFFE0; } /* IRQ Vector. */ \
+ t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000) { cpu->pc = 0xFFF0; } /* BRK Vector. */ \
t(7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000) { prefix = 0x0F; } /* Interrupts. */ \
t(7, 0x00060000, 0x00060000, 0x00160000, 0x00160000, 0x01160200, 0x01160000, 0x01170000, 0x01170000) { mem_type = ABS; } /* Interrupts, and absolute. */ \
t(0, 0x01000100, 0x01000100, 0x04000400, 0x00000000, 0x00000000, 0x40004000, 0x40004000, 0x00000000) { idx = cpu->x; } /* Register index. */ \