all repos — xrxs @ dd3d31803980b1088963d2f38e42e3891926c969

experimental networked application/game server with 9p

drawing gray borders and have routines for the scanlines; right side scanlines cause a stack underflow, so must fix
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmEYtzIACgkQO3+8IhRO
Y5gzphAAjTS5JlpdBZI+b7FQXGYGFq5CmTEbziDZXCHyTSACWMUQsLq1dPKHGg8K
WExdWuUZGTFs6Th6OdtYKmOVT46lDZTyqPjwsYQp6+Xe03SmrsT4/XPJZIqYZeUp
IHPjrm/6ITumXeX0M4qTiPHZ9olPkooj8WObul+6mr7f5pdfdpfaS2p3fg4Qo4p/
DcihhyhWznkrg0vneWZ9FLIa9ZPHv6ZGbJDGH1VVFxg9Mu2yr3eQQfNizRV61xT6
TCRgG/PZDnsqK6Sdvv0uiDpgheX8gxyNTFuOUVK/3F5eOwCOy4qn89isUaYZBiKI
4CKvEizgN/UN+vOnho0iXwxY5ywq1h1bJsiwEjHmzVbS4g4F4B0W91oJ98ldB3JY
mb5Z+iE3s+vsC3nkuDE2aY/KsoBo9gHNtzTISXf1ac8H7WNCTswHbFZMynBtNPdq
W21msPi187PMkpUIx7wh4GIsTmxOLJ3vcsKtJGVY56GPwWc0nELMW8kPEPOOqCO/
5D4emcuxBR2K6zxAU9iGi0CldMcZHv2eKdrzQJjEHudtIlu5Fh6BFI31pJNH+HU+
a90iEW/hxgAEfEDUEIZbY9UN0vCah5lNkqgz4brSD0ASBN8Ur3gL3PUTbrswrRFP
FjaWIMV+pSMzzUsE+wRWmZZrDeckAQGsiAVfC8T65q6i0qHN2WE=
=8Iv7
-----END PGP SIGNATURE-----
commit

dd3d31803980b1088963d2f38e42e3891926c969

parent

ad433236001195e8449c430a14ffe0855f133aef

1 files changed, 136 insertions(+), 12 deletions(-)

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

@@ -114,6 +114,11 @@ #01 ADD .state STZ BRK

&keep-state POP BRK &state4 DUP #04 NEQ ,&state5 JCN + ;draw-gray-borders JSR2 + ( ;draw-bl-scanlines JSR2 + ;draw-tl-scanlines JSR2 + ;draw-tr-scanlines JSR2 + ;draw-br-scanlines JSR2 ) ;draw-uxn-logo JSR2 ;draw-xrxs-logo-xr JSR2 ;draw-xrxs-logo-xs JSR2

@@ -123,8 +128,7 @@ &state5 POP

BRK @clear-screen ( -> ) - ( fix this to clear the animation AND fix the overflow! ) - + .Screen/width DEI2 #0000 &whilex EQU2k ,&endx JCN DUP2 ,&x STR2 .Screen/height DEI2 #0000 &whiley EQU2k ,&endy JCN

@@ -132,15 +136,15 @@ DUP2 ,&y STR2

,&x LDR2 .Screen/x DEO2 ,&y LDR2 .Screen/y DEO2 ;blank .Screen/addr DEO2 - #80 .Screen/sprite DEO + #10 .Screen/sprite DEO + #40 .Screen/sprite DEO #0008 ADD2 ,&whiley JMP &endy POP2 POP2 #0008 ADD2 ,&whilex JMP &endx POP2 POP2 + RTN - - &x $2 - &y $2 -RTN - +&x $2 +&y $2 + @scoot-logos ( -> ) .logo-coords/x LDZ2 #0021 LTH2 ,&no-scoot-x JCN .logo-coords/x LDZ2 #01 SFT2

@@ -160,7 +164,7 @@ .logo-coords/y LDZ2 #0010 SUB2 .Screen/y DEO2

#0100 #0000 &while EQU2k ,&end JCN DUP2 ;uxnlogo ADD2 .Screen/addr DEO2 - #81 .Screen/sprite DEO INC-X + #c1 .Screen/sprite DEO INC-X NEXT-TILE #0030 AND2 #0000 NEQ2 ,&no-inc-y JCN .logo-coords/x LDZ2 #0020 SUB2 .Screen/x DEO2

@@ -177,7 +181,7 @@ .logo-coords/y LDZ2 #0010 SUB2 .Screen/y DEO2

#0080 #0000 &while EQU2k ,&end JCN DUP2 ;xrxslogo ADD2 .Screen/addr DEO2 - #81 .Screen/sprite DEO INC-X + #c1 .Screen/sprite DEO INC-X NEXT-TILE #0030 AND2 #0000 NEQ2 ,&no-inc-y JCN .logo-coords/x LDZ2 .Screen/x DEO2

@@ -194,7 +198,7 @@ .logo-coords/y LDZ2 .Screen/y DEO2

#0100 #0080 &while EQU2k ,&end JCN DUP2 ;xrxslogo ADD2 .Screen/addr DEO2 - #81 .Screen/sprite DEO INC-X + #c1 .Screen/sprite DEO INC-X NEXT-TILE #0030 AND2 #0000 NEQ2 ,&no-inc-y JCN .logo-coords/x LDZ2 .Screen/x DEO2

@@ -204,10 +208,130 @@ #0010 ADD2 ,&while JMP &end POP2 POP2

RTN +@draw-gray-borders ( -> ) + + ;blank .Screen/addr DEO2 + #0028 #0000 &whilemtop EQU2k ,&endmtop JCN + DUP2 .Screen/y DEO2 + .Screen/width DEI2 #0000 &whiletop EQU2k ,&endtop JCN + DUP2 .Screen/x DEO2 + #84 .Screen/sprite DEO + #0008 ADD2 ,&whiletop JMP &endtop POP2 POP2 + #0008 ADD2 ,&whilemtop JMP &endmtop POP2 POP2 + + #0040 #0000 &whilemleft EQU2k ,&endmleft JCN + DUP2 .Screen/x DEO2 + .Screen/height DEI2 #0028 SUB2 #0028 &whileleft EQU2k ,&endleft JCN + DUP2 .Screen/y DEO2 + #84 .Screen/sprite DEO + #0008 ADD2 ,&whileleft JMP &endleft POP2 POP2 + #0008 ADD2 ,&whilemleft JMP &endmleft POP2 POP2 + + .Screen/width DEI2 DUP2 #0040 SUB2 &whilemright EQU2k ,&endmright JCN + DUP2 .Screen/x DEO2 + .Screen/height DEI2 #0028 SUB2 #0028 &whileright EQU2k ,&endright JCN + DUP2 .Screen/y DEO2 + #84 .Screen/sprite DEO + #0008 ADD2 ,&whileright JMP &endright POP2 POP2 + #0008 ADD2 ,&whilemright JMP &endmright POP2 POP2 + + .Screen/height DEI2 DUP2 #0028 SUB2 &whilembottom EQU2k ,&endmbottom JCN + DUP2 .Screen/y DEO2 + .Screen/width DEI2 #0000 &whilebottom EQU2k ,&endbottom JCN + DUP2 .Screen/x DEO2 + #84 .Screen/sprite DEO + #0008 ADD2 ,&whilebottom JMP &endbottom POP2 POP2 + #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 ) + +@draw-bl-scanlines ( -> ) + CENTER-Y ,&y STR2 + #0008 ,&x STR2 + + ,&x LDR2 .Screen/x DEO2 + ,&y LDR2 .Screen/y DEO2 + + &whileld + ,&y LDR2 CENTER-Y SUB2 #0004 DIV2 #0008 ADD2 ,&x STR2 + .Screen/height DEI2 #0028 SUB2 ,&y LDR2 LTH2 ,&endld JCN + &dlscan #0040 ,&x LDR2 EQU2 ,&enddlscan JCN + ,&x LDR2 .Screen/x DEO2 + ,&y LDR2 .Screen/y DEO2 + #03 .Screen/pixel DEO + ,&x LDR2 #0001 ADD2 ,&x STR2 ,&dlscan JMP &enddlscan + ,&y LDR2 #0004 ADD2 ,&y STR2 ,&whileld JMP &endld +RTN + &x $2 + &y $2 + +@draw-tl-scanlines + #0028 ,&y STR2 + #0008 ,&x STR2 + + ,&x LDR2 .Screen/x DEO2 + ,&y LDR2 .Screen/y DEO2 +&whilelu + CENTER-Y ,&y LDR2 SUB2 #0004 DIV2 #0008 ADD2 ,&x STR2 + CENTER-Y ,&y LDR2 LTH2 ,&endlu JCN + &ulscan #0040 ,&x LDR2 EQU2 ,&endulscan JCN + ,&x LDR2 .Screen/x DEO2 + ,&y LDR2 .Screen/y DEO2 + #03 .Screen/pixel DEO + ,&x LDR2 #0001 ADD2 ,&x STR2 ,&ulscan JMP &endulscan + ,&y LDR2 #0004 ADD2 ,&y STR2 ,&whilelu JMP &endlu + +RTN + &x $2 + &y $2 + +@draw-br-scanlines ( -> ) + CENTER-Y ,&y STR2 + .Screen/width #0008 SUB2 ,&x STR2 + + ,&x LDR2 .Screen/x DEO2 + ,&y LDR2 .Screen/y DEO2 + + &whilerd + .Screen/width DEI2 ,&y LDR2 CENTER-Y SUB2 #0004 DIV2 #0008 ADD2 SUB2 ,&x STR2 + .Screen/height DEI2 #0028 SUB2 ,&y LDR2 LTH2 ,&endrd JCN + &drscan .Screen/width DEI2 #0040 SUB2 ,&x LDR2 EQU2 ,&enddrscan JCN + ,&x LDR2 .Screen/x DEO2 + ,&y LDR2 .Screen/y DEO2 + #03 .Screen/pixel DEO + ,&x LDR2 #0001 SUB2 ,&x STR2 ,&drscan JMP &enddrscan + ,&y LDR2 #0004 ADD2 ,&y STR2 ,&whilerd JMP &endrd +RTN + &x $2 + &y $2 + +@draw-tr-scanlines + #0028 ,&y STR2 + .Screen/width #0008 SUB2 ,&x STR2 + + ,&x LDR2 .Screen/x DEO2 + ,&y LDR2 .Screen/y DEO2 +&whileru + .Screen/width DEI2 CENTER-Y ,&y LDR2 SUB2 #0004 DIV2 #0008 ADD2 SUB2 ,&x STR2 + CENTER-Y ,&y LDR2 LTH2 ,&endru JCN + &urscan .Screen/width DEI2 #0040 SUB2 ,&x LDR2 EQU2 ,&endurscan JCN + ,&x LDR2 .Screen/x DEO2 + ,&y LDR2 .Screen/y DEO2 + #03 .Screen/pixel DEO + ,&x LDR2 #0001 SUB2 ,&x STR2 ,&urscan JMP &endurscan + ,&y LDR2 #0004 ADD2 ,&y STR2 ,&whileru JMP &endru + +RTN + &x $2 + &y $2 + + ( constants ) @spritesheet "xrxs.chr 00 ( sprites ) @blank $16 -@uxnlogo $128 +@uxnlogo $128 @xrxslogo $128