Implement game pad and timer

This commit is contained in:
2024-10-19 20:35:56 -05:00
parent 37b9a94338
commit e9f5437c1f
6 changed files with 386 additions and 9 deletions
+12 -2
View File
@@ -1825,8 +1825,18 @@ static void cpuReset(VB *sim) {
/* Determine how many clocks are guaranteed to process */
static uint32_t cpuUntil(VB *sim, uint32_t clocks) {
return sim->cpu.halt || sim->cpu.clocks > clocks ?
clocks : sim->cpu.clocks;
/* Halting */
if (sim->cpu.halt) {
return
sim->cpu.operation == CPU_HALTING &&
!(sim->cpu.psw.id | sim->cpu.psw.ep | sim->cpu.psw.np) &&
IRQ_LEVELS[sim->cpu.irq] < sim->cpu.psw.i
? 0 : clocks;
}
/* Not halting */
return sim->cpu.clocks > clocks ? clocks : sim->cpu.clocks;
}
#endif /* VBAPI */