(neralie) Modernizing

This commit is contained in:
Devine Lu Linvega 2024-06-14 09:46:02 -08:00
parent 956f5fd7b3
commit ffcc5eaed1
1 changed files with 38 additions and 44 deletions

View File

@ -23,14 +23,8 @@
#0f3d .System/r DEO2 #0f3d .System/r DEO2
#0fe3 .System/g DEO2 #0fe3 .System/g DEO2
#0fb2 .System/b DEO2 #0fb2 .System/b DEO2
( | vectors ) ( | vectors )
;on-screen .Screen/vector DEO2 ;on-screen .Screen/vector DEO2
( | window )
#0160 .Screen/width DEO2
#0110 .Screen/height DEO2
#01 .fps/current STZ #01 .fps/current STZ
( | set size ) ( | set size )
@ -43,23 +37,23 @@
#01 .neralie/color STZ #01 .neralie/color STZ
.frame/x1 LDZ2 .frame/x2 LDZ2 .frame/x1 LDZ2 .frame/x2 LDZ2
OVR2 OVR2 .frame/y1 LDZ2 ;h JSR2 OVR2 OVR2 .frame/y1 LDZ2 h
.frame/y2 LDZ2 ;h JSR2 .frame/y2 LDZ2 h
.frame/y1 LDZ2 #0001 SUB2 .frame/y2 LDZ2 INC2 .frame/y1 LDZ2 #0001 SUB2 .frame/y2 LDZ2 INC2
OVR2 OVR2 .frame/x1 LDZ2 ;v JSR2 OVR2 OVR2 .frame/x1 LDZ2 v
.frame/x2 LDZ2 ;v JSR2 .frame/x2 LDZ2 v
@on-screen ( -> ) @on-screen ( -> )
;update-fps JSR2 update-fps
#00 .neralie/color STZ #00 .neralie/color STZ
;draw-clock JSR2 <draw-clock>
;neralie-calc JSR2 neralie-calc
#01 .neralie/color STZ #01 .neralie/color STZ
;draw-date JSR2 <draw-date>
;draw-clock JSR2 <draw-clock>
BRK BRK
@ -70,14 +64,14 @@ BRK
( ) #00c0 #00 .DateTime/minute DEI MUL2 ADD2 ( ) #00c0 #00 .DateTime/minute DEI MUL2 ADD2
( ) #00f8 #00 .DateTime/second DEI MUL2 ADD2 ( ) #00f8 #00 .DateTime/second DEI MUL2 ADD2
( ) #0271 #00 .fps/next LDZ MUL2 #00 .fps/current LDZ DIV2 #30 SFT2 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 ) ( | add up units and tens of pulses, store in n5 and n4 )
( ) #0042 #00 .DateTime/hour DEI MUL2 ADD2 ( ) #0042 #00 .DateTime/hour DEI MUL2 ADD2
( ) #005e #00 .DateTime/minute DEI MUL2 ADD2 ( ) #005e #00 .DateTime/minute DEI MUL2 ADD2
( ) #000b #00 .DateTime/second DEI MUL2 ADD2 ( ) #000b #00 .DateTime/second DEI MUL2 ADD2
( ) #000a ;modf JSR2 SWP2 .neralie/n5 STZ POP ( ) #000a modf SWP2 .neralie/n5 STZ POP
( ) #000a ;modf JSR2 SWP2 .neralie/n4 STZ POP ( ) #000a modf SWP2 .neralie/n4 STZ POP
( | add up hundreds of pulses + 10 x beats, store in n0123 ) ( | add up hundreds of pulses + 10 x beats, store in n0123 )
( ) #01a0 #00 .DateTime/hour DEI MUL2 ADD2 ( ) #01a0 #00 .DateTime/hour DEI MUL2 ADD2
@ -85,7 +79,7 @@ BRK
JMP2r JMP2r
@draw-date ( -- ) @<draw-date> ( -- )
( auto x ) #01 .Screen/auto DEO ( auto x ) #01 .Screen/auto DEO
@ -102,33 +96,33 @@ JMP2r
DUP2 #000e DIV2 #30 SFT2 ;font-letters ADD2 .Screen/addr DEO2 DUP2 #000e DIV2 #30 SFT2 ;font-letters ADD2 .Screen/addr DEO2
#01 .Screen/sprite DEO #01 .Screen/sprite DEO
#000e DIV2k MUL2 SUB2 #000e DIV2k MUL2 SUB2
DUP2 #000a DIV2 ,digit JSR DUP2 #000a DIV2 <draw-digit>
#000a DIV2k MUL2 SUB2 ,digit JSR #000a DIV2k MUL2 SUB2 <draw-digit>
.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
( | neralie ) ( | neralie )
.neralie/n0123 LDZ2 .neralie/n0123 LDZ2
#03e8 ;modf JSR2 ,digit JSR #03e8 modf <draw-digit>
#0064 ;modf JSR2 ,digit JSR #0064 modf <draw-digit>
#000a ;modf JSR2 ,digit JSR #000a modf <draw-digit>
#000b ,digit JSR ( the colon ) #000b <draw-digit> ( the colon )
,digit JSR <draw-digit>
#00 .neralie/n4 LDZ ,digit JSR #00 .neralie/n4 LDZ <draw-digit>
#00 .neralie/n5 LDZ ,digit JSR #00 .neralie/n5 LDZ <draw-digit>
( auto none ) #00 .Screen/auto DEO ( auto none ) #00 .Screen/auto DEO
JMP2r JMP2r
@digit ( index* -- ) @<draw-digit> ( index* -- )
#30 SFT2 ;font-numbers ADD2 .Screen/addr DEO2 #30 SFT2 ;font-numbers ADD2 .Screen/addr DEO2
.neralie/color LDZ .Screen/sprite DEO .neralie/color LDZ .Screen/sprite DEO
JMP2r JMP2r
@draw-clock ( -- ) @<draw-clock> ( -- )
.frame/x2 LDZ2 .frame/x1 LDZ2 .frame/x2 LDZ2 .frame/x1 LDZ2
DUP2 .neralie/x STZ2 SUB2 .neralie/w STZ2 DUP2 .neralie/x STZ2 SUB2 .neralie/w STZ2
@ -139,15 +133,15 @@ JMP2r
DUP2 ;&h JSR2 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 <draw-digit>
DUP2 ;&v JSR2 DUP2 ;&v JSR2
#04 ;v/spacing STA #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 #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 <draw-digit>
DUP2 ,&h JSR 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 <draw-digit>
DUP2 ,&v JSR DUP2 ,&v JSR
,&next JSR POP2 ,&next JSR POP2
DUP2 ,&h JSR DUP2 ,&h JSR
@ -157,7 +151,7 @@ JMP2r
JMP2r JMP2r
&next ( digit-addr number* -- next-digit-addr next-number* prev-digit* ) &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 ROT STHk INC ROT ROT
#00 STHr LDZ ADD2 #00 STHr LDZ ADD2
STH2r STH2r
@ -165,7 +159,7 @@ JMP2r
&h ( number* -- ) &h ( number* -- )
,scale JSR ,scale JSR
.neralie/h LDZ2 ;mul2hi JSR2 .neralie/h LDZ2 mul2hi
ORAk #02 JCN POP2 JMP2r ORAk #02 JCN POP2 JMP2r
DUP2 .neralie/y LDZ2 ADD2 .neralie/y STZ2 DUP2 .neralie/y LDZ2 ADD2 .neralie/y STZ2
.neralie/h LDZ2 SWP2 SUB2 .neralie/h STZ2 .neralie/h LDZ2 SWP2 SUB2 .neralie/h STZ2
@ -173,14 +167,14 @@ JMP2r
&v ( number* -- ) &v ( number* -- )
,scale JSR ,scale JSR
.neralie/w LDZ2 ;mul2hi JSR2 .neralie/w LDZ2 mul2hi
ORAk #02 JCN POP2 JMP2r ORAk #02 JCN POP2 JMP2r
DUP2 .neralie/x LDZ2 ADD2 .neralie/x STZ2 DUP2 .neralie/x LDZ2 ADD2 .neralie/x STZ2
.neralie/w LDZ2 SWP2 SUB2 .neralie/w STZ2 .neralie/w LDZ2 SWP2 SUB2 .neralie/w STZ2
.neralie/y LDZ2 DUP2 .neralie/h LDZ2 ADD2 .neralie/x LDZ2 ,v JMP .neralie/y LDZ2 DUP2 .neralie/h LDZ2 ADD2 .neralie/x LDZ2 ,v JMP
@scale ( 0..10000* -- 0..65535* ) @scale ( 0..10000* -- 0..65535* )
DUP2 #8db8 ;mul2hi JSR2 DUP2 #8db8 mul2hi
SWP2 #0006 MUL2 ADD2 SWP2 #0006 MUL2 ADD2
JMP2r JMP2r