Make the hooking and unhooking of the interrupt interrupt safe.

This commit is contained in:
Christian Groessler
2014-04-24 00:27:06 +02:00
parent 608dbc2cec
commit 4406307c2f

View File

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