ldy #0 ; Structure offset
- sei ; Disable interrupts
+ php
+ sei ; Disable interrupts
lda mouseXPos ; Transfer the position
sta (ptr1),y
iny
sta (ptr1),y
- cli ; Reenable interrupts
+ plp ; Reenable interrupts
rts ; Done
; --------------------------------------------------------------------------
_mouse_move:
jsr popsreg ; Get X
- sei ; Disable interrupts
+ php
+ sei ; Disable interrupts
sta mouseYPos
lda sreg
ldx sreg+1
sta mouseXPos
stx mouseXPos+1
- cli ; Enable interrupts
+ plp ; Enable interrupts
rts
; --------------------------------------------------------------------------
bne tvmode
only40: ldx #0 ; COLUMNS40
tvmode: ; PAL/NTSC check here, result in A
- bit rasreg
+ php
+ sei ; disable interrupts
+ bit rasreg
bpl tvmode ; wait for rasterline 127<x<256
lda #24 ; (rasterline now >=256!)
modelp: cmp rasreg ; wait for rasterline = 24 (or 280 on PAL)
modeend: stx tmp1
ora tmp1
+ plp ; restore interrupt state
rts