mirror of
https://github.com/cc65/cc65.git
synced 2025-01-04 23:33:05 +00:00
Adapt to new mouse driver interface ('prep' and 'draw')
This commit is contained in:
parent
9e155eb096
commit
63ce6e28fe
@ -49,6 +49,8 @@ HEADER:
|
|||||||
|
|
||||||
CHIDE: jmp $0000 ; Hide the cursor
|
CHIDE: jmp $0000 ; Hide the cursor
|
||||||
CSHOW: jmp $0000 ; Show the cursor
|
CSHOW: jmp $0000 ; Show the cursor
|
||||||
|
CPREP: jmp $0000 ; Prepare to move the cursor
|
||||||
|
CDRAW: jmp $0000 ; Draw the cursor
|
||||||
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
||||||
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
||||||
|
|
||||||
@ -82,9 +84,6 @@ XMax: .res 2 ; X2 value of bounding box
|
|||||||
YMax: .res 2 ; Y2 value of bounding box
|
YMax: .res 2 ; Y2 value of bounding box
|
||||||
Buttons: .res 1 ; Button mask
|
Buttons: .res 1 ; Button mask
|
||||||
|
|
||||||
|
|
||||||
visible: .res 1
|
|
||||||
|
|
||||||
; Default values for above variables
|
; Default values for above variables
|
||||||
|
|
||||||
.rodata
|
.rodata
|
||||||
@ -118,9 +117,8 @@ INSTALL:
|
|||||||
dex
|
dex
|
||||||
bpl @L1
|
bpl @L1
|
||||||
|
|
||||||
; Be sure the mouse cursor is invisible and at the default location.
|
; Make sure the mouse cursor is at the default location.
|
||||||
|
|
||||||
jsr CHIDE
|
|
||||||
lda XPos
|
lda XPos
|
||||||
ldx XPos+1
|
ldx XPos+1
|
||||||
jsr CMOVEX
|
jsr CMOVEX
|
||||||
@ -147,8 +145,7 @@ UNINSTALL = HIDE ; Hide cursor on exit
|
|||||||
; no special action is required besides hiding the mouse cursor.
|
; no special action is required besides hiding the mouse cursor.
|
||||||
; No return code required.
|
; No return code required.
|
||||||
|
|
||||||
HIDE: dec visible
|
HIDE: php
|
||||||
php
|
|
||||||
sei
|
sei
|
||||||
jsr CHIDE
|
jsr CHIDE
|
||||||
plp
|
plp
|
||||||
@ -161,8 +158,7 @@ HIDE: dec visible
|
|||||||
; no special action is required besides enabling the mouse cursor.
|
; no special action is required besides enabling the mouse cursor.
|
||||||
; No return code required.
|
; No return code required.
|
||||||
|
|
||||||
SHOW: inc visible
|
SHOW: php
|
||||||
php
|
|
||||||
sei
|
sei
|
||||||
jsr CSHOW
|
jsr CSHOW
|
||||||
plp
|
plp
|
||||||
@ -221,14 +217,12 @@ MOVE: php
|
|||||||
sei ; No interrupts
|
sei ; No interrupts
|
||||||
|
|
||||||
pha
|
pha
|
||||||
lda visible
|
|
||||||
beq @nohide
|
|
||||||
txa
|
txa
|
||||||
pha
|
pha
|
||||||
jsr CHIDE
|
jsr CPREP
|
||||||
pla
|
pla
|
||||||
tax
|
tax
|
||||||
@nohide:pla
|
pla
|
||||||
|
|
||||||
sta YPos
|
sta YPos
|
||||||
stx YPos+1 ; New Y position
|
stx YPos+1 ; New Y position
|
||||||
@ -241,15 +235,11 @@ MOVE: php
|
|||||||
dey
|
dey
|
||||||
lda (sp),y
|
lda (sp),y
|
||||||
sta XPos ; New X position
|
sta XPos ; New X position
|
||||||
|
|
||||||
jsr CMOVEX ; Move the cursor
|
jsr CMOVEX ; Move the cursor
|
||||||
|
|
||||||
lda visible
|
|
||||||
beq @Ret
|
|
||||||
|
|
||||||
jsr CSHOW
|
jsr CSHOW
|
||||||
|
|
||||||
@Ret: plp ; Restore interrupt flag
|
plp ; Restore interrupt flag
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
@ -351,13 +341,11 @@ IRQ:
|
|||||||
lda PADDL1
|
lda PADDL1
|
||||||
cmp #228 ; CF set if equal
|
cmp #228 ; CF set if equal
|
||||||
|
|
||||||
@Cont: lda visible
|
@Cont: php ; remember CF
|
||||||
beq @Go
|
jsr CPREP
|
||||||
php ; remember CF
|
|
||||||
jsr CHIDE
|
|
||||||
plp ; restore CF
|
plp ; restore CF
|
||||||
|
|
||||||
@Go: bcc @L03
|
bcc @L03
|
||||||
jmp @Show
|
jmp @Show
|
||||||
|
|
||||||
@L03: ldx #0
|
@L03: ldx #0
|
||||||
@ -482,10 +470,8 @@ IRQ:
|
|||||||
tya
|
tya
|
||||||
jsr CMOVEY
|
jsr CMOVEY
|
||||||
|
|
||||||
@Show: lda visible
|
@Show: jsr CDRAW
|
||||||
beq @Done
|
|
||||||
jsr CSHOW
|
|
||||||
|
|
||||||
@Done: clc ; Interrupt not "handled"
|
clc ; Interrupt not "handled"
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user