From f5d75afcc0572335ad1f3b268c96a940c6db123c Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Wed, 19 Jan 2022 14:24:51 -0400 Subject: 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. --- sux.h | 8 ++++---- 1 file 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. */ \ -- cgit v1.2.3-13-gbd6f