start implementing scroll buffer logic for client
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmFSshAACgkQO3+8IhRO Y5jQsw/+P2IUnqD9NRGlDi6tcnI908wzC8YbaHUjFSLCO7S9/BcN/Js2PnVRTCQI +3M0t6UXTIytRa1VUa2O3nwrvF0qvxg0Pyn47Hxd6wGZEgXUnPTrGMkUQzzKUoA3 LPKgB8wSAbSPUeQuJCFBxym02hePJIHqXZrqiwus6pxZnrmsjRd/Yhpk8MF7nFIT fqARZzrq68SenKMeG/a5k2BW/zeyt/mIq+q3SPg3COxubSr0c9MyK56Ij/9AC6TO BBaL0kKJg3E2WfINdswiWu3XXi0M36FFSR8+BOG9IjzccVNcwSG60gPdS23VEA4F PI8Sj3BG28zamyFO138HYKsl5ig/yd2SFGU5W5OvAC/18UGsA3kT2VUSxRRdO2jM SPjr9LK+EBz//pH1ayRqiaasaP2zmHN5YUuBp6Im2Q9B+CcGCR5FdPvFV6eSfrKr KcHhk/zW1xDrL+kqDyy5IjbmVeR9XEIkYC96ZkkE3gHsFpgHOoU0LEfsm7LZlvRf 13LmTc8j5vcaR1004/m1w56ThLwOa6yC5vbgs3/T50SBYkqN8g8fXBJ2gk2pT+0B Lbi7L9oQ2hNQiXADYT5hrWcE+dcseqNO7gqn1u8vD4KBA90JZ4VWOQamsSUe1hty n6avPfeIQ6s2JlijKn+BVPP+M71HMr2z712/joLK8Vjjn0oMoeU= =Bgi3 -----END PGP SIGNATURE-----
1 files changed,
25 insertions(+),
15 deletions(-)
jump to
M
uxn-client/xrxs.tal
→
uxn-client/xrxs.tal
@@ -13,8 +13,8 @@ %2** { #10 SFT2 } %2// { #01 SFT2 }
%8** { #30 SFT2 } %8// { #03 SFT2 } %TOS { #00 SWP } %TOB { SWP POP } - %NEXT-TILE { DUP2 #0010 ADD2 } +%GET-USABLE-HEIGHT { .Screen/height DEI2 #0050 #03 SFT2 SWP POP } %RTN { JMP2r }@@ -49,7 +49,8 @@ @list-len $2
@list-offset $1 @list-elem-offset $1 @list-elem $32 - +@list-top $1 +@list-height $1 @cart $32 @realm $32@@ -84,6 +85,7 @@ ( initialize state )
#00 .ticker STZ #00 .state STZ #20 .anim-speed STZ + GET-USABLE-HEIGHT .list-height STZ CENTER-X .logo-coords/x STZ2 CENTER-Y .logo-coords/y STZ2@@ -384,22 +386,27 @@ POPr
RTN -@draw-char ( char x y color -- ) - - STH ( save color ) - .Screen/y DEO2 ( set y ) - .Screen/x DEO2 ( set x ) - - #20 MUL SUB TOS 8** ;font ADD2 .Screen/addr DEO2 - STHr .Screen/sprite DEO -RTN - @strlen ( addr -- len ) DUP2 &loop INC2 LDAk ,&loop JCN SWP2 SUB2 + +RTN + +@store-char ( char -- char ) + + #00 .list-elem-offset LDZ ;word ADD2 STA + .list-elem-offset LDZ INC .list-elem-offset STZ + +RTN + +@shouldnt-draw-word ( -- flag ) + + .list-offset LDZ .list-top LDZ LTH + #00 .list-offset LDZ #00 .list-top LDZ #00 .list-height LDZ ADD2 LTH2 + ORA #01 NEQ RTN@@ -408,7 +415,7 @@
#0040 .Screen/x DEO2 #0028 .Screen/y DEO2 - #01 .list-offset STZ + #00 .list-offset STZ .list-len LDZ2 #0000 &while EQU2k ,&end JCN ( get a character from the list ) DUP2 ;listbuf ADD2 LDA@@ -418,19 +425,22 @@ 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 + ;store-char JSR2 ,&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 + ( if the word isn't in the scroll window, don't draw it ) + ;shouldnt-draw-word JSR2 ,&no-draw JCN [ ;word .Screen/x DEI2 .Screen/y DEI2 #02 ] ;draw-string JSR2 #0040 .Screen/x DEO2 + &no-draw + .list-offset LDZ INC .list-offset STZ INC-Y #20 #00 &word_clr EQUk ,&end-clr JCN