mirror of
https://github.com/cc65/cc65.git
synced 2024-12-25 02:29:52 +00:00
Mouse driver fixes by Oliver Schmidt.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3758 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
39f096b34e
commit
c0e46594f0
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "mouse-kernel.inc"
|
.include "mouse-kernel.inc"
|
||||||
|
.include "apple2.inc"
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -136,6 +137,7 @@ next: inc ptr1+1
|
|||||||
|
|
||||||
; Convert to and save slot number
|
; Convert to and save slot number
|
||||||
and #$0F
|
and #$0F
|
||||||
|
sei
|
||||||
sta slot
|
sta slot
|
||||||
|
|
||||||
; Convert to and patch I/O register index
|
; Convert to and patch I/O register index
|
||||||
@ -144,14 +146,32 @@ next: inc ptr1+1
|
|||||||
asl
|
asl
|
||||||
asl
|
asl
|
||||||
sta yparam+1
|
sta yparam+1
|
||||||
|
|
||||||
; Apple II Mouse TechNote #1, Interrupt Environment with the Mouse:
|
.ifdef __APPLE2ENH__
|
||||||
; "Disable interrupts when calling any mouse routine."
|
; Save LC read state
|
||||||
sei
|
ldx #<ROMIN
|
||||||
|
bit RDLCRAM
|
||||||
|
bpl :+
|
||||||
|
ldx #<LCBANK1
|
||||||
|
bit RDLCBNK2
|
||||||
|
bpl :+
|
||||||
|
ldx #<LCBANK2
|
||||||
|
: phx
|
||||||
|
|
||||||
|
; The AppleMouse II Card needs the ROM swapped in
|
||||||
|
; to be able to detect an Apple //e and use RDVBL
|
||||||
|
sta ROMIN ; STA keeps LC write state
|
||||||
|
.endif
|
||||||
|
|
||||||
; Reset mouse hardware
|
; Reset mouse hardware
|
||||||
ldx #INITMOUSE
|
ldx #INITMOUSE
|
||||||
jsr firmware
|
jsr firmware
|
||||||
|
|
||||||
|
.ifdef __APPLE2ENH__
|
||||||
|
; Restore LC read state
|
||||||
|
plx
|
||||||
|
sta $C000,x ; STA keeps LC write state
|
||||||
|
.endif
|
||||||
|
|
||||||
; Turn mouse on
|
; Turn mouse on
|
||||||
lda #%00000001
|
lda #%00000001
|
||||||
@ -354,12 +374,16 @@ IOCTL:
|
|||||||
; is clear on entry. The routine must return with carry set if the interrupt
|
; is clear on entry. The routine must return with carry set if the interrupt
|
||||||
; was handled, otherwise with carry clear.
|
; was handled, otherwise with carry clear.
|
||||||
IRQ:
|
IRQ:
|
||||||
|
; Check for installed mouse
|
||||||
|
lda slot
|
||||||
|
beq done
|
||||||
|
|
||||||
; Check for mouse interrupt
|
; Check for mouse interrupt
|
||||||
ldx #SERVEMOUSE
|
ldx #SERVEMOUSE
|
||||||
jsr firmware
|
jsr firmware
|
||||||
bcc :+
|
bcc :+
|
||||||
clc ; Interrupt not handled
|
clc ; Interrupt not handled
|
||||||
rts
|
done: rts
|
||||||
|
|
||||||
: ldx #READMOUSE
|
: ldx #READMOUSE
|
||||||
jsr firmware
|
jsr firmware
|
||||||
|
@ -31,15 +31,24 @@ PWREDUP := $03F4 ; This must be = EOR #$A5 of SOFTEV+1
|
|||||||
KBD := $C000 ; Read keyboard
|
KBD := $C000 ; Read keyboard
|
||||||
KBDSTRB := $C010 ; Clear keyboard strobe
|
KBDSTRB := $C010 ; Clear keyboard strobe
|
||||||
|
|
||||||
; 80 column card switches
|
; 80 column video switches
|
||||||
CLR80COL:= $C000 ; Disable 80 column store
|
CLR80COL:= $C000 ; Disable 80 column store
|
||||||
SET80COL:= $C001 ; Enable 80 column store
|
SET80COL:= $C001 ; Enable 80 column store
|
||||||
|
RD80VID := $C01F ; >127 if 80 column video enabled
|
||||||
|
|
||||||
|
; Character set switches
|
||||||
CLRALTCHAR := $C00E ; Normal Apple II char set
|
CLRALTCHAR := $C00E ; Normal Apple II char set
|
||||||
SETALTCHAR := $C00F ; Norm/inv LC, no flash
|
SETALTCHAR := $C00F ; Norm/inv LC, no flash
|
||||||
ALTCHARSET := $C01E ; >127 if alt charset switched in
|
ALTCHARSET := $C01E ; >127 if alt charset switched in
|
||||||
RD80VID := $C01F ; >127 if 80 column video enabled
|
|
||||||
|
|
||||||
; Video soft switches
|
; Language card switches
|
||||||
|
RDLCBNK2 := $C011 ; >127 if LC bank 2 in use
|
||||||
|
RDLCRAM := $C012 ; >127 if LC is read enabled
|
||||||
|
ROMIN := $C081 ; Swap in D000-FFFF ROM
|
||||||
|
LCBANK2 := $C083 ; Swap in LC bank 2
|
||||||
|
LCBANK1 := $C08B ; Swap in LC bank 1
|
||||||
|
|
||||||
|
; Video mode switches
|
||||||
MIXCLR := $C052 ; Disable 4 lines of text
|
MIXCLR := $C052 ; Disable 4 lines of text
|
||||||
MIXSET := $C053 ; Enable 4 lines of text
|
MIXSET := $C053 ; Enable 4 lines of text
|
||||||
LOWSCR := $C054 ; Page 1
|
LOWSCR := $C054 ; Page 1
|
||||||
|
Loading…
Reference in New Issue
Block a user