]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/mcbtxtchar.s
Optimized mul20 & mul40 and extracted to new library.
[cc65] / libsrc / atari / mcbtxtchar.s
index 90a25f673dc8b952a78935bff274e42178fb6a94..4ff79c651d9e0985bd4b1b9116d6e2a128934738 100644 (file)
@@ -12,7 +12,7 @@
 
         .export         _mouse_txt_callbacks
         .importzp       tmp4
-        .import         mul40,loc_tmp
+        .import         _mul40
         .importzp       mouse_txt_char          ; screen code of mouse cursor
 
         .include        "atari.inc"
@@ -104,22 +104,15 @@ movex:
 
 ; Move the mouse cursor y position to the value in A/X.
 movey:
-        tax
-        ldy     tmp4            ; mul40 uses tmp4
-        lda     loc_tmp         ; and this local variable
-        pha
-        txa                     ; get parameter back
+        ldy     tmp4            ; mul40 uses tmp4, save in Y
         lsr     a               ; convert y position to character line
         lsr     a
         lsr     a
-        jsr     mul40
-        clc
+        jsr     _mul40          ; carry is cleared by _mul40
         adc     SAVMSC
         sta     scrptr
         txa
         adc     SAVMSC+1
         sta     scrptr+1
-        pla
-        sta     loc_tmp
-        sty     tmp4
+        sty     tmp4            ; restore tmp4
         rts