Reapplied the PCjr PIC fix from build 4785, fixes #3707.

This commit is contained in:
OBattler
2023-10-04 05:38:07 +02:00
parent 209c8fbbda
commit 488e066e8c

View File

@@ -223,14 +223,8 @@ find_best_interrupt(pic_t *dev)
static __inline void
pic_update_pending_xt(void)
{
if (!(pic.interrupt & 0x20)) {
if (find_best_interrupt(&pic) != -1) {
latched++;
if (latched == 1)
timer_on_auto(&pic_timer, 0.35);
} else if (latched == 0)
pic.int_pending = 0;
}
if (!(pic.interrupt & 0x20))
pic.int_pending = (find_best_interrupt(&pic) != -1);
}
/* Only check if PIC 1 frozen, because it should not happen
@@ -253,13 +247,7 @@ pic_update_pending_at(void)
static void
pic_callback(void *priv)
{
pic_t *dev = (pic_t *) priv;
dev->int_pending = 1;
latched--;
if (latched > 0)
timer_on_auto(&pic_timer, 0.35);
update_pending();
}
void
@@ -500,7 +488,10 @@ pic_write(uint16_t addr, uint8_t val, void *priv)
break;
case STATE_NONE:
dev->imr = val;
update_pending();
if (is286)
update_pending();
else
timer_on_auto(&pic_timer, .0 * ((10000000.0 * (double) xt_cpu_multi) / (double) cpu_s->rspeed));
break;
default: