Optimized mul20 & mul40 and extracted to new library.

This commit is contained in:
IrgendwerA8
2019-03-21 15:59:45 +01:00
committed by Oliver Schmidt
parent fbf302e6cd
commit 399250a105
14 changed files with 216 additions and 92 deletions

View 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