Commit 1401ba7c authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Order cachetoolspriteaddress out of line

Was previously inline but called as a function.
Not tagged.
parent d137f7ac
......@@ -661,42 +661,6 @@ maketoollist EntryS "R1-R11"
BLVS cachetoolspriteaddress
Pull "R14"
STR R14,thisCBptr
B %FT07
cachetoolspriteaddress ; [spritename], [thisCBptr], [lengthflags] as for cachespriteaddress
; R4 -> resolution suffix
; R10 = first suffix tried (and failed)
Push "R14"
MOV R14,#&FF
AND R5,R14,R10
AND R6,R14,R10,LSR #8
SUBS R5,R5,#'0'
SUB R6,R6,#'0'
MOVEQ R5,#2
MOVEQ R6,#8 ; pretend '0' was '28' so we try '24' next
TEQ R6,#3
MOVEQ R6,#4 ; pretend '23' was '24' so we try '22' next
05 CMP R5,R6
MOVLO R5,R5,LSL#1
MOVHI R6,R6,LSL#1
BNE %FT06 ; after rectangular pixels, try next squarer version
TEQ R5,#1
MOVEQ R5,#2
MOVEQ R6,#2 ; after '11', try '22'
MOVNE R5,#-'0' ; after any other square pixels, try without suffix
06 ADD R14,R5,#'0'
STRB R14,[R4]
ADD R14,R6,#'0'
STRB R14,[R4,#1]
BL cachespriteaddress
Pull "PC", VC ; success
TEQ R5,#0
BPL %BT05 ; try next suffix
Pull "PC" ; total failure, exit with
07
ADD SP,SP,#16
ADDVS R8,R8,#4*2
......@@ -942,6 +906,46 @@ cachetoolspriteaddress ; [spritename], [thisCBptr], [lengthflags] as for cachesp
EXITS
LTORG
;..............................................................................
; cachetoolspriteaddress
;
; [spritename], [thisCBptr], [lengthflags] as for cachespriteaddress
; in: R4 -> resolution suffix
; R10 = first suffix tried (and failed)
; out: R2 -> sprite
cachetoolspriteaddress
Push "R14"
MOV R14,#&FF
AND R5,R14,R10
AND R6,R14,R10,LSR #8
SUBS R5,R5,#'0'
SUB R6,R6,#'0'
MOVEQ R5,#2
MOVEQ R6,#8 ; pretend '0' was '28' so we try '24' next
TEQ R6,#3
MOVEQ R6,#4 ; pretend '23' was '24' so we try '22' next
05 CMP R5,R6
MOVLO R5,R5,LSL#1
MOVHI R6,R6,LSL#1
BNE %FT06 ; after rectangular pixels, try next squarer version
TEQ R5,#1
MOVEQ R5,#2
MOVEQ R6,#2 ; after '11', try '22'
MOVNE R5,#-'0' ; after any other square pixels, try without suffix
06 ADD R14,R5,#'0'
STRB R14,[R4]
ADD R14,R6,#'0'
STRB R14,[R4,#1]
BL cachespriteaddress
Pull "PC", VC ; success
TEQ R5,#0
BPL %BT05 ; try next suffix
Pull "PC" ; total failure, exit with V set
;..............................................................................
; defaultparams - modify the default parameters ready for further calculations
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment