mirror of
https://github.com/cc65/cc65.git
synced 2025-01-10 03:30:05 +00:00
interrupt flag is cleared/restored rather than cleared/set
git-svn-id: svn://svn.cc65.org/cc65/trunk@890 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
490e3b8c0f
commit
35f403b702
@ -110,7 +110,8 @@ _mouse_pos:
|
|||||||
|
|
||||||
ldy #0 ; Structure offset
|
ldy #0 ; Structure offset
|
||||||
|
|
||||||
sei ; Disable interrupts
|
php
|
||||||
|
sei ; Disable interrupts
|
||||||
|
|
||||||
lda mouseXPos ; Transfer the position
|
lda mouseXPos ; Transfer the position
|
||||||
sta (ptr1),y
|
sta (ptr1),y
|
||||||
@ -124,7 +125,7 @@ _mouse_pos:
|
|||||||
iny
|
iny
|
||||||
sta (ptr1),y
|
sta (ptr1),y
|
||||||
|
|
||||||
cli ; Reenable interrupts
|
plp ; Reenable interrupts
|
||||||
rts ; Done
|
rts ; Done
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
@ -157,13 +158,14 @@ _mouse_info:
|
|||||||
|
|
||||||
_mouse_move:
|
_mouse_move:
|
||||||
jsr popsreg ; Get X
|
jsr popsreg ; Get X
|
||||||
sei ; Disable interrupts
|
php
|
||||||
|
sei ; Disable interrupts
|
||||||
sta mouseYPos
|
sta mouseYPos
|
||||||
lda sreg
|
lda sreg
|
||||||
ldx sreg+1
|
ldx sreg+1
|
||||||
sta mouseXPos
|
sta mouseXPos
|
||||||
stx mouseXPos+1
|
stx mouseXPos+1
|
||||||
cli ; Enable interrupts
|
plp ; Enable interrupts
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
|
@ -35,7 +35,9 @@ get_tv:
|
|||||||
bne tvmode
|
bne tvmode
|
||||||
only40: ldx #0 ; COLUMNS40
|
only40: ldx #0 ; COLUMNS40
|
||||||
tvmode: ; PAL/NTSC check here, result in A
|
tvmode: ; PAL/NTSC check here, result in A
|
||||||
bit rasreg
|
php
|
||||||
|
sei ; disable interrupts
|
||||||
|
bit rasreg
|
||||||
bpl tvmode ; wait for rasterline 127<x<256
|
bpl tvmode ; wait for rasterline 127<x<256
|
||||||
lda #24 ; (rasterline now >=256!)
|
lda #24 ; (rasterline now >=256!)
|
||||||
modelp: cmp rasreg ; wait for rasterline = 24 (or 280 on PAL)
|
modelp: cmp rasreg ; wait for rasterline = 24 (or 280 on PAL)
|
||||||
@ -48,4 +50,5 @@ ntsc: lda #$80 ; NTSC
|
|||||||
|
|
||||||
modeend: stx tmp1
|
modeend: stx tmp1
|
||||||
ora tmp1
|
ora tmp1
|
||||||
|
plp ; restore interrupt state
|
||||||
rts
|
rts
|
||||||
|
Loading…
x
Reference in New Issue
Block a user