diff --git a/gui/neralie/src/neralie.tal b/gui/neralie/src/neralie.tal index 0414fc0..9743459 100644 --- a/gui/neralie/src/neralie.tal +++ b/gui/neralie/src/neralie.tal @@ -7,12 +7,12 @@ |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 -@frame &x1 $2 &x2 $2 &y1 $2 &y2 $2 + @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 ( program ) @@ -34,11 +34,14 @@ ( | draw frame ) [ LIT2 41 -neralie/color ] STZ .frame/x1 LDZ2 .frame/x2 LDZ2 - OVR2 OVR2 .frame/y1 LDZ2 h - .frame/y2 LDZ2 h + OVR2 OVR2 .frame/y1 LDZ2 + .frame/y2 LDZ2 .frame/y1 LDZ2 #0001 SUB2 .frame/y2 LDZ2 INC2 - OVR2 OVR2 .frame/x1 LDZ2 v - .frame/x2 LDZ2 v + OVR2 OVR2 .frame/x1 LDZ2 + .frame/x2 LDZ2 + +( +@|vectors ) @on-screen ( -> ) ( | update fps ) @@ -81,6 +84,9 @@ BRK ( ) #0006 [ LIT2 00 -DateTime/minute ] DEI MUL2 ADD2 .neralie/n0123 STZ2 JMP2r +( +@|drawing ) + @ ( -- ) ( auto x ) [ LIT2 01 -Screen/auto ] DEO .Screen/width DEI2 #01 SFT2 #0034 SUB2 .Screen/x DEO2 @@ -112,11 +118,9 @@ JMP2r JMP2r @ ( index* -- ) - #30 SFT2 ;font-numbers ADD2 .Screen/addr DEO2 - .neralie/color LDZ .Screen/sprite DEO - -JMP2r + [ LIT2 01 -Screen/sprite ] DEO + JMP2r @ ( -- ) @@ -132,9 +136,9 @@ JMP2r /next #0008 .Screen/x DEO2 .neralie/y LDZ2 #0003 SUB2 .Screen/y DEO2 DUP2 /v - #04 ;v/spacing STA - .frame/y1 LDZ2 #0003 SUB2 .neralie/y LDZ2 .neralie/x LDZ2 v - #01 ;v/spacing STA + #04 ;/spacing STA + .frame/y1 LDZ2 #0003 SUB2 .neralie/y LDZ2 .neralie/x LDZ2 + #01 ;/spacing STA /next #0008 .Screen/y DEO2 .neralie/x LDZ2 #0003 SUB2 .Screen/x DEO2 DUP2 /h /next .Screen/width DEI2 #0010 SUB2 .Screen/x DEO2 .neralie/y LDZ2 #0003 SUB2 .Screen/y DEO2 @@ -159,7 +163,7 @@ JMP2r ORAk ?{ POP2 JMP2r } DUP2 .neralie/y LDZ2 ADD2 .neralie/y STZ2 .neralie/h LDZ2 SWP2 SUB2 .neralie/h STZ2 - .neralie/x LDZ2 DUP2 .neralie/w LDZ2 ADD2 .neralie/y LDZ2 !h + .neralie/x LDZ2 DUP2 .neralie/w LDZ2 ADD2 .neralie/y LDZ2 ! &v ( number* -- ) scale @@ -167,58 +171,49 @@ JMP2r ORAk ?{ 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 + .neralie/y LDZ2 DUP2 .neralie/h LDZ2 ADD2 .neralie/x LDZ2 ! + +@ ( x1* x2* y* -- ) + .Screen/y DEO2 + [ LIT2 -Screen/x -lines/addr ] STZ + ! + +@ ( y1* y2* x* -- ) + .Screen/x DEO2 + [ LIT2 -Screen/y -lines/addr ] STZ + ( >> ) + +@ ( v1* v2* -- ) + LTH2k ?{ SWP2 } + STH2 + &>loop ( -- ) + [ LIT2 00 &spacing 01 ] ADD2 + DUP2 DUP2r STH2r LTH2 ?{ POP2 POP2r JMP2r } + DUP2 .lines/addr LDZ DEO2 + .neralie/color LDZ .Screen/pixel DEO + !&>loop @scale ( 0..10000* -- 0..65535* ) DUP2 #8db8 mul2hi SWP2 #0006 MUL2 ADD2 JMP2r -@h ( x1* x2* y* -- ) - .Screen/y DEO2 - [ LIT2 -Screen/x -lines/addr ] STZ - !v/draw-line - -@v ( y1* y2* x* -- ) - .Screen/x DEO2 - [ LIT2 -Screen/y -lines/addr ] STZ - - &draw-line ( v1* v2* -- ) - LTH2k ?{ SWP2 } - STH2 - - &loop - LIT2 [ 00 ] &spacing [ 01 ] ADD2 - DUP2 DUP2r STH2r LTH2 ?&keep-going - POP2 POP2r - JMP2r - - &keep-going - DUP2 .lines/addr LDZ DEO2 - .neralie/color LDZ .Screen/pixel DEO - !&loop - - - @modf ( dividend* divisor* SUB2 remainder* quotient* ) DIV2k STH2k MUL2 SUB2 STH2r JMP2r @mul2hi ( a* b* -- product-top-16-bits* ) ;mul/bhi STA2 ;mul/ahi STA2 #0000 - [ LIT2 00 -mul/alo ] LDZ [ LIT2 00 -mul/blo ] LDZ MUL2 - POP - [ LIT2 00 -mul/ahi ] LDZ [ LIT2 00 -mul/blo ] LDZ MUL2 /adc - [ LIT2 00 -mul/alo ] LDZ [ LIT2 00 -mul/bhi ] LDZ MUL2 /adc + [ LIT2 00 -mul/alo ] LDZ [ LIT2 00 -mul/blo ] LDZ MUL2 + POP + [ LIT2 00 -mul/ahi ] LDZ [ LIT2 00 -mul/blo ] LDZ MUL2 /adc + [ LIT2 00 -mul/alo ] LDZ [ LIT2 00 -mul/bhi ] LDZ MUL2 /adc POP [ LIT2 00 -mul/ahi ] LDZ [ LIT2 00 -mul/bhi ] LDZ MUL2 ADD2 JMP2r - &adc ( 31..24 a* b* -- 31..24 sum* ) OVR2 ADD2 SWP2 OVR2 - GTH2 ?&carry - JMP2r - &carry + GTH2 ?{ JMP2r } ROT INC ROT ROT JMP2r