[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 08/10] hw/mos6522: Call mos6522_update_irq() when appropriate
From: |
Finn Thain |
Subject: |
[RFC 08/10] hw/mos6522: Call mos6522_update_irq() when appropriate |
Date: |
Tue, 24 Aug 2021 20:09:36 +1000 |
It necessary to call mos6522_update_irq() when the interrupt flags
change and unnecessary when they haven't.
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
---
hw/misc/mos6522.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c
index 0a241fe9f8..0dd3ccf945 100644
--- a/hw/misc/mos6522.c
+++ b/hw/misc/mos6522.c
@@ -208,11 +208,13 @@ uint64_t mos6522_read(void *opaque, hwaddr addr, unsigned
size)
s->timers[0].oneshot_fired = true;
mos6522_timer1_update(s, &s->timers[0], now);
s->ifr |= T1_INT;
+ mos6522_update_irq(s);
}
if (now >= s->timers[1].next_irq_time) {
s->timers[1].oneshot_fired = true;
mos6522_timer2_update(s, &s->timers[1], now);
s->ifr |= T2_INT;
+ mos6522_update_irq(s);
}
switch (addr) {
case VIA_REG_B:
@@ -237,7 +239,6 @@ uint64_t mos6522_read(void *opaque, hwaddr addr, unsigned
size)
break;
case VIA_REG_T1CH:
val = get_counter(s, &s->timers[0]) >> 8;
- mos6522_update_irq(s);
break;
case VIA_REG_T1LL:
val = s->timers[0].latch & 0xff;
--
2.26.3
- Re: [RFC 04/10] hw/mos6522: Rename timer callback functions, (continued)
- [RFC 05/10] hw/mos6522: Don't clear T1 interrupt flag on latch write, Finn Thain, 2021/08/24
- [RFC 06/10] hw/mos6522: Implement oneshot mode, Finn Thain, 2021/08/24
- [RFC 07/10] hw/mos6522: Fix initial timer counter reload, Finn Thain, 2021/08/24
- [RFC 08/10] hw/mos6522: Call mos6522_update_irq() when appropriate,
Finn Thain <=
- [RFC 09/10] hw/mos6522: Avoid using discrepant QEMU clock values, Finn Thain, 2021/08/24
- [RFC 10/10] hw/mos6522: Synchronize timer interrupt and timer counter, Finn Thain, 2021/08/24