Harmonized interface between mouse drivers and callbacks.
The Apple2 doesn't have sprites so the Apple2 mouse callbacks place a special character on the text screen to indicate the mouse position. In order to support the necessary character removing and redrawing the Apple2 mouse driver called the Apple2 mouse callbacks in an "unusual way". So far so (sort of) good. However the upcoming Atari mouse driver aims to support both "sprite-type" mouse callbacks as well as "text-char-type" mouse callbacks. Therefore the interface between mouse drivers and callbacks needs to be extended to allow the mouse callbacks to hide their different types from the mouse driver. The nature of this change can be seen best by looking at the Apple2 file modifications. The CBM drivers and callbacks (at least the current ones) don't benefit from this change.
This commit is contained in:
@@ -69,6 +69,8 @@ HEADER:
|
||||
|
||||
CHIDE: jmp $0000 ; Hide the cursor
|
||||
CSHOW: jmp $0000 ; Show the cursor
|
||||
CDRAW: jmp $0000 ; Draw the cursor
|
||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
||||
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
||||
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
||||
|
||||
@@ -314,7 +316,7 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||
; MUST return carry clear.
|
||||
;
|
||||
|
||||
IRQ:
|
||||
IRQ: jsr CMOVE
|
||||
|
||||
; Record the state of the buttons.
|
||||
; Avoid crosstalk between the keyboard and the mouse.
|
||||
@@ -417,8 +419,9 @@ IRQ:
|
||||
|
||||
; Done
|
||||
|
||||
@SkipY: jsr CDRAW
|
||||
clc ; Interrupt not "handled"
|
||||
@SkipY: rts
|
||||
rts
|
||||
|
||||
; --------------------------------------------------------------------------
|
||||
;
|
||||
|
||||
@@ -49,6 +49,8 @@ LIBREF: .addr $0000
|
||||
|
||||
CHIDE: jmp $0000 ; Hide the cursor
|
||||
CSHOW: jmp $0000 ; Show the cursor
|
||||
CDRAW: jmp $0000 ; Draw the cursor
|
||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
||||
CMOVEX: jmp $0000 ; Move the cursor to X co-ord.
|
||||
CMOVEY: jmp $0000 ; Move the cursor to Y co-ord.
|
||||
|
||||
@@ -324,7 +326,7 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioctls, for now
|
||||
; MUST return carry clear.
|
||||
;
|
||||
|
||||
IRQ:
|
||||
IRQ: jsr CMOVE
|
||||
|
||||
; Record the state of the buttons.
|
||||
; Try to avoid crosstalk between the keyboard and the lightpen.
|
||||
@@ -422,7 +424,8 @@ IRQ:
|
||||
|
||||
; Done
|
||||
|
||||
@SkipX: clc ; Interrupt not "handled"
|
||||
@SkipX: jsr CDRAW
|
||||
clc ; Interrupt not "handled"
|
||||
rts
|
||||
|
||||
; Move the lightpen pointer to the new Y pos.
|
||||
|
||||
@@ -68,6 +68,8 @@ HEADER:
|
||||
|
||||
CHIDE: jmp $0000 ; Hide the cursor
|
||||
CSHOW: jmp $0000 ; Show the cursor
|
||||
CDRAW: jmp $0000 ; Draw the cursor
|
||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
||||
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
||||
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
||||
|
||||
@@ -319,9 +321,11 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||
; MUST return carry clear.
|
||||
;
|
||||
|
||||
IRQ: jsr CMOVE
|
||||
|
||||
; Avoid crosstalk between the keyboard and a joystick.
|
||||
|
||||
IRQ: ldy #%00000000 ; Set ports A and B to input
|
||||
ldy #%00000000 ; Set ports A and B to input
|
||||
sty CIA1_DDRB
|
||||
sty CIA1_DDRA ; Keyboard won't look like joystick
|
||||
lda CIA1_PRB ; Read Control-Port 1
|
||||
@@ -438,6 +442,7 @@ IRQ: ldy #%00000000 ; Set ports A and B to input
|
||||
|
||||
; Done
|
||||
|
||||
@SkipY: clc ; Interrupt not handled
|
||||
@SkipY: jsr CDRAW
|
||||
clc ; Interrupt not "handled"
|
||||
rts
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ HEADER:
|
||||
|
||||
CHIDE: jmp $0000 ; Hide the cursor
|
||||
CSHOW: jmp $0000 ; Show the cursor
|
||||
CDRAW: jmp $0000 ; Draw the cursor
|
||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
||||
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
||||
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
||||
|
||||
@@ -297,7 +299,8 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||
; (so be careful).
|
||||
;
|
||||
|
||||
IRQ: lda #$7F
|
||||
IRQ: jsr CMOVE
|
||||
lda #$7F
|
||||
sta CIA1_PRA
|
||||
lda CIA1_PRB ; Read port #1
|
||||
and #%00001100
|
||||
@@ -392,4 +395,7 @@ IRQ: lda #$7F
|
||||
; Move the mouse pointer to the new X pos
|
||||
|
||||
tya
|
||||
jmp CMOVEY
|
||||
jsr CMOVEY
|
||||
jsr CDRAW
|
||||
clc ; Interrupt not "handled"
|
||||
rts
|
||||
|
||||
Reference in New Issue
Block a user