Reapplied the PCjr PIC fix from build 4785, fixes #3707.
This commit is contained in:
23
src/pic.c
23
src/pic.c
@@ -223,14 +223,8 @@ find_best_interrupt(pic_t *dev)
|
|||||||
static __inline void
|
static __inline void
|
||||||
pic_update_pending_xt(void)
|
pic_update_pending_xt(void)
|
||||||
{
|
{
|
||||||
if (!(pic.interrupt & 0x20)) {
|
if (!(pic.interrupt & 0x20))
|
||||||
if (find_best_interrupt(&pic) != -1) {
|
pic.int_pending = (find_best_interrupt(&pic) != -1);
|
||||||
latched++;
|
|
||||||
if (latched == 1)
|
|
||||||
timer_on_auto(&pic_timer, 0.35);
|
|
||||||
} else if (latched == 0)
|
|
||||||
pic.int_pending = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only check if PIC 1 frozen, because it should not happen
|
/* Only check if PIC 1 frozen, because it should not happen
|
||||||
@@ -253,13 +247,7 @@ pic_update_pending_at(void)
|
|||||||
static void
|
static void
|
||||||
pic_callback(void *priv)
|
pic_callback(void *priv)
|
||||||
{
|
{
|
||||||
pic_t *dev = (pic_t *) priv;
|
update_pending();
|
||||||
|
|
||||||
dev->int_pending = 1;
|
|
||||||
|
|
||||||
latched--;
|
|
||||||
if (latched > 0)
|
|
||||||
timer_on_auto(&pic_timer, 0.35);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -500,7 +488,10 @@ pic_write(uint16_t addr, uint8_t val, void *priv)
|
|||||||
break;
|
break;
|
||||||
case STATE_NONE:
|
case STATE_NONE:
|
||||||
dev->imr = val;
|
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;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user