]> git.sur5r.net Git - cc65/commitdiff
Mouse driver fixes by Oliver Schmidt.
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 17 Aug 2006 19:22:53 +0000 (19:22 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 17 Aug 2006 19:22:53 +0000 (19:22 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3758 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/apple2/apple2-stdmou.s
libsrc/apple2/apple2.inc

index 1f76efe82ce15b5fe7cd120e0f6b9f2ee74a4d24..13b6c3ee35235c651e024e31b5d3e6b0cab98957 100644 (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
index b6c5e400af2006003576f8f925fd51c4f046a578..2e5a462bc92464c2dfe1064bb39e34006a3701e7 100644 (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