1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-24 11:31:31 +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:
cuz 2006-08-17 19:22:53 +00:00
parent 39f096b34e
commit c0e46594f0
2 changed files with 41 additions and 8 deletions

View File

@ -6,6 +6,7 @@
.include "zeropage.inc"
.include "mouse-kernel.inc"
.include "apple2.inc"
; ------------------------------------------------------------------------
@ -136,6 +137,7 @@ next: inc ptr1+1
; Convert to and save slot number
and #$0F
sei
sta slot
; Convert to and patch I/O register index
@ -144,14 +146,32 @@ next: inc ptr1+1
asl
asl
sta yparam+1
; Apple II Mouse TechNote #1, Interrupt Environment with the Mouse:
; "Disable interrupts when calling any mouse routine."
sei
.ifdef __APPLE2ENH__
; Save LC read state
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
ldx #INITMOUSE
jsr firmware
.ifdef __APPLE2ENH__
; Restore LC read state
plx
sta $C000,x ; STA keeps LC write state
.endif
; Turn mouse on
lda #%00000001
@ -354,12 +374,16 @@ IOCTL:
; is clear on entry. The routine must return with carry set if the interrupt
; was handled, otherwise with carry clear.
IRQ:
; Check for installed mouse
lda slot
beq done
; Check for mouse interrupt
ldx #SERVEMOUSE
jsr firmware
bcc :+
clc ; Interrupt not handled
rts
done: rts
: ldx #READMOUSE
jsr firmware

View File

@ -31,15 +31,24 @@ PWREDUP := $03F4 ; This must be = EOR #$A5 of SOFTEV+1
KBD := $C000 ; Read keyboard
KBDSTRB := $C010 ; Clear keyboard strobe
; 80 column card switches
; 80 column video switches
CLR80COL:= $C000 ; Disable 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
SETALTCHAR := $C00F ; Norm/inv LC, no flash
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
MIXSET := $C053 ; Enable 4 lines of text
LOWSCR := $C054 ; Page 1