I've been working on a text routine for the ObjectStack for the Axe GUI Library, but it's incredibly slow.
I'm only so-so at optimizing, and that's mainly size optimizing, so I'm having some trouble speeding it up. Even at 15mHz speed, it's still slow for large chunks of text. If anyone could help me speed this up, it would be greatly appreciated.
Here is the routine in question:
:Lbl TEX
:0→{L5}r
:0→{L5+2}
:r1→r4
:For(r5,0,length(r3))
:If {r3+r5}=1
:{L5+2} xor 1→{L5+2}
:End
:If {r3+r5}=3
:{L5} xor 1→{L5}
:End
:If {r3+r5}=2
:{L5+1} xor 1→{L5+1}
:End
:If {r3+r5}>3
:Pt-On(r1,r2,{r3+r5}*8+Pic1TX)
:If {L5+2}
:ref(r1,r2,{{r3+r5}+Pic2TX},4)
:rref(r1,r2,{{r3+r5}+Pic2TX},4)
:For(θ,4,7)
:0→{L1+θ}
:End
:conj({r3+r5}*8+Pic1TX,L1,4)
:Pt-On(r1+1→r1,r2,L1)
:End
:If {L5}
:rref(r1-{L5+2},r2,{{r3+r5}+Pic2TX}+{L5+2},6)
:End
:If {L5+1}
:ref(r1-{L5+2},r2+6,{{r3+r5}+Pic2TX}+{L5+2},1)
:End
:r1+{{r3+r5}+Pic2TX}→r1
:End
:If r1≥84
:r4→r1
:r2+6→r2
:End
:End
:Normal
:Return
Pic2TX is a list of the width of every small font character, Pic1TX is a compilation of sprites creating the full small font set.
Attached in the zip is: GUILIB3, the library with the routine in question; GUICML, the source for my library testing; ZGUITEXT, the library containing Pic1TX; ZGUITWID, the library containing Pic2TX; ZDROPMEN, Nemo's dropdown menu routine, slightly modified for my own devious purposes.
Again, any help is greatly appreciated, and would benefit anyone who would use the GUI Library once it's finished. Thank you in advance.