From 06849b54ba7f7fd8bba09e1cf8a8cc9107ec269b Mon Sep 17 00:00:00 2001 From: Guy Perfect Date: Sun, 29 Dec 2024 09:52:07 -0600 Subject: [PATCH] Fix TRAP restore PC, but better --- core/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/cpu.c b/core/cpu.c index 386ddd2..ce856de 100644 --- a/core/cpu.c +++ b/core/cpu.c @@ -1636,7 +1636,8 @@ static void cpuSUBF_S(VB *sim) { /* TRAP */ static void cpuTRAP(VB *sim) { - cpuAdvance(sim, cpuClocks(15)); + sim->cpu.clocks += cpuClocks(15); + sim->cpu.pc += 2; cpuThrow(sim, 0xFFA0 + cpuGetImm5U(sim)); }