]> git.sur5r.net Git - cc65/commitdiff
Make the hooking and unhooking of the interrupt interrupt safe.
authorChristian Groessler <chris@groessler.org>
Wed, 23 Apr 2014 22:27:06 +0000 (00:27 +0200)
committerChristian Groessler <chris@groessler.org>
Wed, 23 Apr 2014 22:28:33 +0000 (00:28 +0200)
libsrc/c128/mou/c128-joy.s

index fb087c8fc98a9b3536e7ec6d9fe333453f447d31..339fdc836f7ac0b06817ba35a55830ba713c4723 100644 (file)
@@ -160,7 +160,6 @@ INSTALL:
         lda     YPos
         ldx     YPos+1
         jsr     CMOVEY
-        cli
 
 ; Initialize our IRQ magic
 
@@ -190,6 +189,7 @@ INSTALL:
         iny
         lda     #>(chainIRQ-1)
         sta     (ptr3),y
+        cli
 
 ; Done, return zero (= MOUSE_ERR_OK)
 
@@ -202,11 +202,12 @@ INSTALL:
 ; No return code required (the driver is removed from memory on return).
 
 UNINSTALL:
-
         lda     chainIRQ+1
+        sei
         sta     IRQInd+1
         lda     chainIRQ+2
         sta     IRQInd+2
+        cli
 
         jsr     HIDE                    ; Hide cursor on exit
         lda     INIT_save