changeset 133:c7f2f63cbcfe

Clear spurious interrupts on warm or cold start
author William Astle <lost@l-w.ca>
date Mon, 24 Jun 2024 23:47:10 -0600
parents 917b4893bb3d
children 3ab4b62665c3
files src/init.s
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/init.s	Mon Jun 24 23:44:39 2024 -0600
+++ b/src/init.s	Mon Jun 24 23:47:10 2024 -0600
@@ -256,6 +256,14 @@
 warmstartb      jsr keyb_reset                  ; reset the keyboard
                 lda #0x35                       ; enable VSYNC interrupt in PIA
                 sta PIA0.CB
+                lda PIA0.DA                     ;* clear any spurious interrupts which should work around weird bugs
+                lda PIA0.DB                     ;* in emulators
+                lda PIA1.DA
+                lda PIA1.DB
+                ifdef COCO3
+                lda GIME.IRQ
+                lda GIME.FIRQ
+                endc
                 andcc #0xaf                     ; enable interrupts at the cpu
                 jmp immediate                   ; go start immediate mode
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;