Attempted PIC fix.
This commit is contained in:
32
src/pic.c
32
src/pic.c
@@ -223,25 +223,30 @@ find_best_interrupt(pic_t *dev)
|
|||||||
static __inline void
|
static __inline void
|
||||||
pic_update_pending_xt(void)
|
pic_update_pending_xt(void)
|
||||||
{
|
{
|
||||||
if (find_best_interrupt(&pic) != -1) {
|
if (!(pic.interrupt & 0x20)) {
|
||||||
latched++;
|
if (find_best_interrupt(&pic) != -1) {
|
||||||
if (latched == 1)
|
latched++;
|
||||||
timer_on_auto(&pic_timer, 0.35);
|
if (latched == 1)
|
||||||
} else if (latched == 0)
|
timer_on_auto(&pic_timer, 0.35);
|
||||||
pic.int_pending = 0;
|
} else if (latched == 0)
|
||||||
|
pic.int_pending = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void
|
static __inline void
|
||||||
pic_update_pending_at(void)
|
pic_update_pending_at(void)
|
||||||
{
|
{
|
||||||
pic2.int_pending = (find_best_interrupt(&pic2) != -1);
|
if (!(pic2.interrupt & 0x20)) {
|
||||||
|
pic2.int_pending = (find_best_interrupt(&pic2) != -1);
|
||||||
|
|
||||||
if (pic2.int_pending)
|
if (pic2.int_pending)
|
||||||
pic.irr |= (1 << pic2.icw3);
|
pic.irr |= (1 << pic2.icw3);
|
||||||
else
|
else
|
||||||
pic.irr &= ~(1 << pic2.icw3);
|
pic.irr &= ~(1 << pic2.icw3);
|
||||||
|
}
|
||||||
|
|
||||||
pic.int_pending = (find_best_interrupt(&pic) != -1);
|
if (!(pic.interrupt & 0x20))
|
||||||
|
pic.int_pending = (find_best_interrupt(&pic) != -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -755,8 +760,7 @@ picint_common(uint16_t num, int level, int set, uint8_t *irq_state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(pic.interrupt & 0x20) && !(pic2.interrupt & 0x20))
|
update_pending();
|
||||||
update_pending();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t
|
static uint8_t
|
||||||
|
Reference in New Issue
Block a user