Fix TRAP restore PC

This commit is contained in:
Guy Perfect 2024-12-29 09:22:14 -06:00
parent db966c8cb8
commit eef255b507
2 changed files with 2 additions and 2 deletions

View File

@ -1636,7 +1636,7 @@ static void cpuSUBF_S(VB *sim) {
/* TRAP */
static void cpuTRAP(VB *sim) {
sim->cpu.clocks += cpuClocks(15);
cpuAdvance(sim, cpuClocks(15));
cpuThrow(sim, 0xFFA0 + cpuGetImm5U(sim));
}

View File

@ -117,7 +117,7 @@ static void tmrWriteControl(VB *sim, uint8_t value) {
if (
!sim->tmr.t_clk_sel &&
(value & 0x10) && /* T-Clk-Sel */
sim->tmr.tick20 != 4
sim->tmr.tick20 != 0
) {
tmrUpdate(sim, sim->tmr.counter == 0 ?
sim->tmr.reload : sim->tmr.counter - 1);