sh4: timer underflow lost if TCOR is 0 or very small

Fixes DreamShell boot
This commit is contained in:
Flyinghead 2021-08-27 17:55:50 +02:00
parent 088287227e
commit 05d51cc35c
1 changed files with 1 additions and 2 deletions

View File

@ -233,7 +233,7 @@ static int sched_tmu_cb(int ch, int sch_cycl, int jitter)
//schedule next trigger by writing the TCNT register
u32 tcor = TMU_TCOR(ch);
write_TMU_TCNTch(ch, tcor + tcnt);
write_TMU_TCNTch(ch, std::max((s32)(tcor + tcnt), 0));
}
else {
@ -307,7 +307,6 @@ void tmu_reset(bool hard)
}
TMU_TOCR=TMU_TSTR=0;
TMU_TCOR(0) = TMU_TCOR(1) = TMU_TCOR(2) = 0xffffffff;
// TMU_TCNT(0) = TMU_TCNT(1) = TMU_TCNT(2) = 0xffffffff;
TMU_TCR(0) = TMU_TCR(1) = TMU_TCR(2) = 0;
UpdateTMUCounts(0);