.include "zeropage.inc"
.include "mouse-kernel.inc"
+ .include "apple2.inc"
; ------------------------------------------------------------------------
; Convert to and save slot number
and #$0F
+ sei
sta slot
; Convert to and patch I/O register index
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
; 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
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