From 07ed7813c6223c14e2b5fd81fff59b6415b9b984 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 29 May 2023 10:39:56 -0700 Subject: [PATCH] Minor opt --- src/adelie.tal | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/src/adelie.tal b/src/adelie.tal index 415d2dd..079cc67 100644 --- a/src/adelie.tal +++ b/src/adelie.tal @@ -58,7 +58,7 @@ BRK ( name ) "Adelie 0a ( details ) "A 20 "Slideshow 20 "Program 0a ( author ) "By 20 "Hundred 20 "Rabbits 0a - ( date ) "Mar 20 "8, 20 "2023 00 + ( date ) "May 20 "29, 20 "2023 00 02 ( icon ) 83 =appicon ( mask ) 41 1705 @@ -239,9 +239,9 @@ BRK @toggle-link ( -- ) .links/visible LDZ #00 EQU .links/visible STZ - .slideshow/selection LDZ ;select-slide ( .. ) + .slideshow/selection LDZ -JMP2 +!select-slide ( helpers ) @@ -376,7 +376,7 @@ JMP2r @op-name ( addr* -- addr* ) .slideshow/selection LDZ phex/b - LIT "/ #18 DEO + [ LIT2 "/ 18 ] DEO .slideshow/length LDZ #01 SUB phex/b #2018 DEO DUP2 #0005 ADD2 pstr #0a18 DEO @@ -397,15 +397,12 @@ JMP2r @op-goto ( addr* -- addr* ) - #00 .pen/auto STZ - + [ LIT2 00 -pen/auto ] STZ #0005 ADD2 - ( set auto ) DUP2 ;&auto-txt scmp #00 EQU ?&no-auto - #01 .pen/auto STZ JMP2r + [ LIT2 01 -pen/auto ] STZ JMP2r &no-auto - DUP2 shex #00 SWP #30 SFT2 .pen/x STZ2 #0003 ADD2 DUP2 shex #00 SWP #30 SFT2 .pen/y STZ2 @@ -415,7 +412,7 @@ JMP2r @op-move ( addr* -- addr* ) - #00 .pen/auto STZ + [ LIT2 00 -pen/auto ] STZ #0005 ADD2 DUP2 shex #00 SWP #30 SFT2 .pen/x LDZ2 ADD2 .pen/x STZ2 @@ -539,18 +536,18 @@ JMP2r @draw-marker ( -- ) - #01 .Screen/auto DEO + [ LIT2 01 -Screen/auto ] DEO .Mouse/x DEI2 #03 SFT2 DUP ,&x STR #30 SFT2 #0004 SUB2 .Screen/x DEO2 .Mouse/y DEI2 #03 SFT2 DUP ,&y STR #30 SFT2 #0004 SUB2 .Screen/y DEO2 ;marker-icn .Screen/addr DEO2 #05 .Screen/sprite DEO - #15 .Screen/auto DEO + [ LIT2 15 -Screen/auto ] DEO #07 ;draw-uf2-char/color STA ,&x LDR draw-byte LIT ", draw-uf2-char ,&y LDR draw-byte - #00 .Screen/auto DEO + [ LIT2 00 -Screen/auto ] DEO JMP2r &x $1 &y $1 @@ -590,14 +587,14 @@ JMP2r [ LIT &w $1 ] [ LIT &h $1 ] ;halftone-icn #0a draw-rect INC2 INC2 LDA2 -!draw-uf2 +( >> ) @draw-uf2 ( text* -- ) .Screen/x DEI2 ,&x STR2 .slideshow/mode LDZ ,draw-uf2-char/color STR - #15 .Screen/auto DEO + [ LIT2 15 -Screen/auto ] DEO &while ( linebreak ) LDAk LIT "` NEQ ?&no-lb @@ -610,7 +607,7 @@ JMP2r &resume INC2 LDAk ?&while POP2 - #00 .Screen/auto DEO + [ LIT2 00 -Screen/auto ] DEO JMP2r @@ -629,7 +626,7 @@ JMP2r .Screen/x DEI2 ,&x STR2 .slideshow/mode LDZ ,&color STR - #45 .Screen/auto DEO + [ LIT2 45 -Screen/auto ] DEO &while ( linebreak ) LDAk LIT "` NEQ ?&no-lb @@ -646,7 +643,7 @@ JMP2r &resume INC2 LDAk ?&while POP2 - #00 .Screen/auto DEO + [ LIT2 00 -Screen/auto ] DEO JMP2r @@ -664,7 +661,7 @@ JMP2r ,&color STR .Screen/addr DEO2 .Screen/x DEI2 ,&x STR2 - #01 .Screen/auto DEO + [ LIT2 01 -Screen/auto ] DEO SWP STH #00 &hloop @@ -679,13 +676,13 @@ JMP2r POP2 POPr ,&x LDR2 .Screen/x DEO2 - #00 .Screen/auto DEO + [ LIT2 00 -Screen/auto ] DEO JMP2r @draw-icn ( name* -- ) - #01 .Screen/auto DEO + [ LIT2 01 -Screen/auto ] DEO DUP2 .File/name DEO2 #0008 .File/length DEO2 ;&buf .Screen/addr DEO2 @@ -704,7 +701,7 @@ JMP2r .Screen/y DEI2k #0008 ADD2 ROT DEO2 INC DUP ?&y POP - #00 .Screen/auto DEO + [ LIT2 00 -Screen/auto ] DEO JMP2r &buf $8 @@ -719,7 +716,7 @@ JMP2r JMP2r -@chex ( c -- val|ff ) LIT "0 SUB DUP #09 GTH JMP JMP2r #27 SUB DUP #0f GTH JMP JMP2r POP #ff JMP2r +@chex ( c -- val|ff ) LIT "0 SUB DUP #09 GTH [ JMP JMP2r ] #27 SUB DUP #0f GTH [ JMP JMP2r ] POP #ff JMP2r @scap ( str* -- end* ) LDAk #00 NEQ JMP JMP2r &w INC2 LDAk ?&w JMP2r @sput ( chr str* -- ) scap STA JMP2r @slen ( str* -- len* ) DUP2 scap SWP2 SUB2 JMP2r @@ -739,7 +736,7 @@ JMP2r ;&r .File/read DEO2 ;&g .File/read DEO2 ;&b .File/read DEO2 - .File/success DEI2 ORA #01 JCN JMP2r + .File/success DEI2 #0000 NEQ2 [ JMP2r ] LIT2 &r $2 .System/r DEO2 LIT2 &g $2 .System/g DEO2 LIT2 &b $2 .System/b DEO2 -- 2.45.2