carts be listed :)

This commit is contained in:
Iris Lightshard 2021-09-10 14:23:20 -06:00
parent c586296139
commit b75de746ed
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398

View file

@ -45,9 +45,12 @@
&y $2
]
@list-len $2
@list-offset $1
@list-elem-offset $32
@list-elem $32
@cart $32
@realm $32
@ -104,20 +107,20 @@ BRK
( draw uxn logo )
DUP #00 NEQ ,&state1 JCN
;draw-uxn-logo JSR2
#01 ADD .state STZ
INC .state STZ
BRK
( draw first syllable of xrxs logo )
&state1 DUP #01 NEQ ,&state2 JCN
;draw-xrxs-logo-xr JSR2
#01 ADD .state STZ
INC .state STZ
BRK
( draw second syllable of xrxs logo )
&state2 DUP #02 NEQ ,&state3 JCN
;draw-xrxs-logo-xs JSR2
#01 ADD .state STZ
INC .state STZ
BRK
( clear screen )
@ -135,7 +138,8 @@ BRK
;cartlist .File/name DEO2
#2000 .File/length DEO2
;listbuf .File/load DEO2
#01 ADD .state STZ BRK
.File/success DEI2 .list-len STZ2
INC .state STZ BRK
&keep-state POP
BRK
@ -278,7 +282,7 @@ RTN
RTN
( come up with a more elegant way to draw these that doesn't cause a stack underflow )
( come up with a more elegant way to draw these )
@draw-bl-scanlines ( -> )
CENTER-Y ,&y STR2
@ -372,8 +376,8 @@ RTN
&loop
LDAk DUP #00 NEQ #20 MUL SUB TOS 8** ;font ADD2 .Screen/addr DEO2
STHkr .Screen/sprite DEO
.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
#0001 ADD2
INC-X
INC2
LDAk #00 NEQ ,&loop JCN
POP2
POPr
@ -394,7 +398,7 @@ RTN
DUP2
&loop
#0001 ADD2 LDAk ,&loop JCN
INC2 LDAk ,&loop JCN
SWP2 SUB2
RTN
@ -403,27 +407,38 @@ RTN
#0040 .Screen/x DEO2
#0028 .Screen/y DEO2
&lines $1
,&lines #00 STZ
#2000 #0000 &while EQU2k ,&end JCN
DUP2 ;listbuf ADD2 LDA ( get a character from the list )
DUP #00 NEQ ,&terminate JCN
DUP #0a NEQk ,&no-inc-line JCN
[ ( char )
#01 .list-offset STZ
.list-len LDZ2 #0000 &while EQU2k ,&end JCN
( get a character from the list )
DUP2 ;listbuf ADD2 LDA
( if null byte, terminate loop )
DUP #00 EQU ,&end JCN
( if not newline, store the character and increment the offsets )
DUP #0a EQU ,&inc-line JCN
#00 .list-elem-offset LDZ ;word ADD2 STA
.list-elem-offset LDZ INC .list-elem-offset STZ
,&continue JMP ( continue looping )
( if newline, print the word, increment x, reset y )
( clear the word and word offsets, increment the buffer offset )
&inc-line
#00 .list-elem-offset LDZ ;word ADD2 STA
[ ;word
.Screen/x DEI2
.Screen/y DEI2
#02 ] ;draw-char JSR2
,&lines LDR INC ,&lines STR
INC-Y
#02 ] ;draw-string JSR2
#0040 .Screen/x DEO2
&no-inc-line INC-X
OVR EQU ,&no-store-char JCN
OVR2 ;list-elem ADD2k OVR2 NIP2 NIP STZk
&no-store-char
INC2 ,&while JMP &end POP2 POP2 RTN
&terminate POP2 POP2 POP2
INC-Y
#20 #00 &word_clr EQUk ,&end-clr JCN
#00 OVR SWP DUP ROT ;word ADD2 STA
INC ,&word_clr JMP &end-clr POP2
#00 .list-elem-offset STZ
&continue INC2 ,&while JMP
&end POP2 POP2
RTN
( constants )
@ -434,11 +449,15 @@ RTN
( sprites )
@blank $16
@uxnlogo $128
@xrxslogo $128
@uxnlogo $256
@xrxslogo $256
@pointer_icn [ 80c0 e0f0 f8e0 1000 ]
@font $768
( big data )
@word [ #0000 #0000 #0000 #0000
#0000 #0000 #0000 #0000
#0000 #0000 #0000 #0000
#0000 #0000 #0000 #0000 ]
@listbuf $8192