diff --git a/core/cpu.c b/core/cpu.c index 9024966..386ddd2 100644 --- a/core/cpu.c +++ b/core/cpu.c @@ -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)); } diff --git a/core/timer.c b/core/timer.c index 892f5da..5e11ea6 100644 --- a/core/timer.c +++ b/core/timer.c @@ -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);