From ffcc5eaed1752f0d01015a053533063120465505 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Fri, 14 Jun 2024 09:46:02 -0800 Subject: [PATCH] (neralie) Modernizing --- gui/neralie/src/neralie.tal | 82 +++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 44 deletions(-) diff --git a/gui/neralie/src/neralie.tal b/gui/neralie/src/neralie.tal index 3745d03..42ff067 100644 --- a/gui/neralie/src/neralie.tal +++ b/gui/neralie/src/neralie.tal @@ -7,11 +7,11 @@ |000 -@fps ¤t $1 &next $1 &second $1 -@number &started $1 &count $1 -@lines &addr $1 -@neralie &n0123 $2 &n4 $1 &n5 $1 &n6 $1 &n7 $1 &n8 $1 &n9 $1 &color $1 &x $2 &y $2 &w $2 &h $2 -@mul &ahi $1 &alo $1 &bhi $1 &blo $1 +@fps ¤t $1 &next $1 &second $1 +@number &started $1 &count $1 +@lines &addr $1 +@neralie &n0123 $2 &n4 $1 &n5 $1 &n6 $1 &n7 $1 &n8 $1 &n9 $1 &color $1 &x $2 &y $2 &w $2 &h $2 +@mul &ahi $1 &alo $1 &bhi $1 &blo $1 @frame &x1 $2 &x2 $2 &y1 $2 &y2 $2 @@ -23,14 +23,8 @@ #0f3d .System/r DEO2 #0fe3 .System/g DEO2 #0fb2 .System/b DEO2 - ( | vectors ) ;on-screen .Screen/vector DEO2 - - ( | window ) - #0160 .Screen/width DEO2 - #0110 .Screen/height DEO2 - #01 .fps/current STZ ( | set size ) @@ -43,23 +37,23 @@ #01 .neralie/color STZ .frame/x1 LDZ2 .frame/x2 LDZ2 - OVR2 OVR2 .frame/y1 LDZ2 ;h JSR2 - .frame/y2 LDZ2 ;h JSR2 + OVR2 OVR2 .frame/y1 LDZ2 h + .frame/y2 LDZ2 h .frame/y1 LDZ2 #0001 SUB2 .frame/y2 LDZ2 INC2 - OVR2 OVR2 .frame/x1 LDZ2 ;v JSR2 - .frame/x2 LDZ2 ;v JSR2 + OVR2 OVR2 .frame/x1 LDZ2 v + .frame/x2 LDZ2 v @on-screen ( -> ) - ;update-fps JSR2 + update-fps #00 .neralie/color STZ - ;draw-clock JSR2 - ;neralie-calc JSR2 + + neralie-calc #01 .neralie/color STZ - ;draw-date JSR2 - ;draw-clock JSR2 + + BRK @@ -70,14 +64,14 @@ BRK ( ) #00c0 #00 .DateTime/minute DEI MUL2 ADD2 ( ) #00f8 #00 .DateTime/second DEI MUL2 ADD2 ( ) #0271 #00 .fps/next LDZ MUL2 #00 .fps/current LDZ DIV2 #30 SFT2 ADD2 - ( ) #01b0 ;modf JSR2 SWP2 #0017 MUL2 #03e8 DIV2 .neralie/n6 STZ POP + ( ) #01b0 modf SWP2 #0017 MUL2 #03e8 DIV2 .neralie/n6 STZ POP ( | add up units and tens of pulses, store in n5 and n4 ) ( ) #0042 #00 .DateTime/hour DEI MUL2 ADD2 ( ) #005e #00 .DateTime/minute DEI MUL2 ADD2 ( ) #000b #00 .DateTime/second DEI MUL2 ADD2 - ( ) #000a ;modf JSR2 SWP2 .neralie/n5 STZ POP - ( ) #000a ;modf JSR2 SWP2 .neralie/n4 STZ POP + ( ) #000a modf SWP2 .neralie/n5 STZ POP + ( ) #000a modf SWP2 .neralie/n4 STZ POP ( | add up hundreds of pulses + 10 x beats, store in n0123 ) ( ) #01a0 #00 .DateTime/hour DEI MUL2 ADD2 @@ -85,7 +79,7 @@ BRK JMP2r -@draw-date ( -- ) +@ ( -- ) ( auto x ) #01 .Screen/auto DEO @@ -102,33 +96,33 @@ JMP2r DUP2 #000e DIV2 #30 SFT2 ;font-letters ADD2 .Screen/addr DEO2 #01 .Screen/sprite DEO #000e DIV2k MUL2 SUB2 - DUP2 #000a DIV2 ,digit JSR - #000a DIV2k MUL2 SUB2 ,digit JSR + DUP2 #000a DIV2 + #000a DIV2k MUL2 SUB2 .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 ( | neralie ) .neralie/n0123 LDZ2 - #03e8 ;modf JSR2 ,digit JSR - #0064 ;modf JSR2 ,digit JSR - #000a ;modf JSR2 ,digit JSR - #000b ,digit JSR ( the colon ) - ,digit JSR - #00 .neralie/n4 LDZ ,digit JSR - #00 .neralie/n5 LDZ ,digit JSR + #03e8 modf + #0064 modf + #000a modf + #000b ( the colon ) + + #00 .neralie/n4 LDZ + #00 .neralie/n5 LDZ ( auto none ) #00 .Screen/auto DEO JMP2r -@digit ( index* -- ) +@ ( index* -- ) #30 SFT2 ;font-numbers ADD2 .Screen/addr DEO2 .neralie/color LDZ .Screen/sprite DEO JMP2r -@draw-clock ( -- ) +@ ( -- ) .frame/x2 LDZ2 .frame/x1 LDZ2 DUP2 .neralie/x STZ2 SUB2 .neralie/w STZ2 @@ -139,15 +133,15 @@ JMP2r DUP2 ;&h JSR2 - ;&next JSR2 #0008 .Screen/x DEO2 .neralie/y LDZ2 #0003 SUB2 .Screen/y DEO2 ,digit JSR + ;&next JSR2 #0008 .Screen/x DEO2 .neralie/y LDZ2 #0003 SUB2 .Screen/y DEO2 DUP2 ;&v JSR2 #04 ;v/spacing STA - .frame/y1 LDZ2 #0003 SUB2 .neralie/y LDZ2 .neralie/x LDZ2 ;v JSR2 + .frame/y1 LDZ2 #0003 SUB2 .neralie/y LDZ2 .neralie/x LDZ2 v #01 ;v/spacing STA - ,&next JSR #0008 .Screen/y DEO2 .neralie/x LDZ2 #0003 SUB2 .Screen/x DEO2 ;digit JSR2 + ,&next JSR #0008 .Screen/y DEO2 .neralie/x LDZ2 #0003 SUB2 .Screen/x DEO2 DUP2 ,&h JSR - ,&next JSR .Screen/width DEI2 #0010 SUB2 .Screen/x DEO2 .neralie/y LDZ2 #0003 SUB2 .Screen/y DEO2 ;digit JSR2 + ,&next JSR .Screen/width DEI2 #0010 SUB2 .Screen/x DEO2 .neralie/y LDZ2 #0003 SUB2 .Screen/y DEO2 DUP2 ,&v JSR ,&next JSR POP2 DUP2 ,&h JSR @@ -157,7 +151,7 @@ JMP2r JMP2r &next ( digit-addr number* -- next-digit-addr next-number* prev-digit* ) - #03e8 ;modf JSR2 STH2 #000a MUL2 + #03e8 modf STH2 #000a MUL2 ROT STHk INC ROT ROT #00 STHr LDZ ADD2 STH2r @@ -165,7 +159,7 @@ JMP2r &h ( number* -- ) ,scale JSR - .neralie/h LDZ2 ;mul2hi JSR2 + .neralie/h LDZ2 mul2hi ORAk #02 JCN POP2 JMP2r DUP2 .neralie/y LDZ2 ADD2 .neralie/y STZ2 .neralie/h LDZ2 SWP2 SUB2 .neralie/h STZ2 @@ -173,14 +167,14 @@ JMP2r &v ( number* -- ) ,scale JSR - .neralie/w LDZ2 ;mul2hi JSR2 + .neralie/w LDZ2 mul2hi ORAk #02 JCN POP2 JMP2r DUP2 .neralie/x LDZ2 ADD2 .neralie/x STZ2 .neralie/w LDZ2 SWP2 SUB2 .neralie/w STZ2 .neralie/y LDZ2 DUP2 .neralie/h LDZ2 ADD2 .neralie/x LDZ2 ,v JMP @scale ( 0..10000* -- 0..65535* ) - DUP2 #8db8 ;mul2hi JSR2 + DUP2 #8db8 mul2hi SWP2 #0006 MUL2 ADD2 JMP2r @@ -241,7 +235,7 @@ JMP2r ROT INC ROT ROT JMP2r -@font-numbers [ +@font-numbers [ 7cc6 ced6 e6c6 7c00 1838 1818 1818 7e00 3c66 063c 6066 7e00 3c66 061c 0666 3c00 1c3c 6ccc fe0c 1e00 7e62 607c 0666 3c00 3c66 607c 6666 3c00 7e66 060c 1818 1800 3c66 663c 6666 3c00