all repos — xrxs @ b75de746ed33143ef572aa42da8f1ab7a184ddd5

experimental networked application/game server with 9p

carts be listed :)
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmE7vrgACgkQO3+8IhRO
Y5g92BAAmYfZp/l56hj1zphPva7cXnmwAcPodt3oBXwKV8QFb7mxkYAvFQIxVG6g
kTQvuXjCrktcsF17BAZVY7KOhfoqal1Cyyq87k2gdwgIsWo6pIoDVIxpZmCDvrUG
0lxwG6yEzHoqUkGud2wHPraUEKbQ0ZtaG+GehF6psZVl2LPyPz7auAkrmixoa9Yc
+jbKaYHNxn86mRToZ9+mL/OrbpliU9TMXm3QUuM3ljIJ0oq6Efq0nV8r9y1KfK0t
Hkvq1doJXwGbVfLap2xhYg2K12CaHogJ11qkx7Buq8zOgvRAQKYY9wps8jPzcCAE
d0kYpdjBg5tBrygmir3UaCp2fVUKG0tUbZSG5Ofu/U692Yut0bb25rgE1MOu3Ntp
mV9ho/jt39VXMQ5tbnjW4EcCPaguW5xoPfWO080IaFR10b4HKLajzLFSvcy9yVnZ
TFEUxvrGpAbd5jWxlyLErgEdJj7GPEsxk18wnG29AE5IniZ07PTIZqJB9OCtf5LX
XkMsjbB6pul+fnTOcRODXmMjwcVwnbutc1p3AiryTOZVxXYatsj7suOCCbmkI5Gv
IRiHSwqY7zDQbnO8EgVr+ZX4nRX61ljdM/y6LyQsOMBFD7fF3of24s7sr1AAEI+W
ZAp8dyyri11fOo9dm4Cl9adwlDXHEulhuncIp9DMbq5tgnmGLJw=
=tEju
-----END PGP SIGNATURE-----
commit

b75de746ed33143ef572aa42da8f1ab7a184ddd5

parent

c5862961398e83d58ed9c19aab33ad581f7ec895

1 files changed, 47 insertions(+), 28 deletions(-)

jump to
M uxn-client/xrxs.taluxn-client/xrxs.tal

@@ -45,8 +45,11 @@ &x $2

&y $2 ] +@list-len $2 @list-offset $1 +@list-elem-offset $32 @list-elem $32 + @cart $32 @realm $32

@@ -104,20 +107,20 @@

( 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 @@ .logo-coords/x LDZ2 #0020 GTH2 ,&keep-state JCN

;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 @@ #0008 ADD2 ,&whilembottom JMP &endmbottom POP2 POP2

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 @@ ( now the string address is at the top of the stack )

&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 @@ @strlen ( addr -- len )

DUP2 &loop - #0001 ADD2 LDAk ,&loop JCN + INC2 LDAk ,&loop JCN SWP2 SUB2 RTN

@@ -403,27 +407,38 @@ @render-cart-list ( -> )

#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 + #02 ] ;draw-string JSR2 + #0040 .Screen/x DEO2 INC-Y - #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 + + #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 @@ @title-loadCart "Select 20 "A 20 "Cartridge 00

( 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