Colour pinstripe/Display: Difference between revisions

Improve Uxntal version with suggestions from #uxn IRC channel
m (→‎{{header|Wren}}: Changed to Wren S/H)
(Improve Uxntal version with suggestions from #uxn IRC channel)
 
(2 intermediate revisions by 2 users not shown)
Line 2,181:
 
=={{header|Uxntal}}==
<syntaxhighlight lang="Uxntaluxntal">|00( @Systemuxnasm &vectorcolor-pinstripe.tal $2color-pinstripe.rom &expansion $2 &wst $1uxnemu &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &statecolor-pinstripe.rom $1)
 
|00 @System &vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &state $1
|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
 
|0100 @reset
( set theme )
#0f00 .System/r DEO2
#00f0 .System/g DEO2
#000f .System/b DEO2
 
.Screen/width( store DEI2screen ,&width STR2)
.Screen/width DEI2 ,draw-layer/width STR2
( store a quarter of the screen height )
.Screen/height DEI2 #02 SFT2 ,&quarter-height STR2
 
( draw the four stripe layers )
#0000 .Screen/y DEO2
#000000
&loop ( -- )
( update y coordinate )
#00 OVR [ LIT2 &quarter-height $2 ] MUL2 .Screen/y DEO2
( draw a layer )
INCk draw-layer
( do it four times )
INC DUP #04 LTH ?&loop
POP BRK
 
@draw-layer ( step -: )
#0000
( extend step to short, create counter )
&loop
#00 SWP #0000
DUP2 .Screen/x DEO2
&loop ( -- )
( update x coordinate )
#0000 MUL2k .Screen/yx DEO2
( fill a region )
DUP #03 AND #80 ORA .Screen/pixel DEO
INC2( DUP2loop [until LIT2the &widthend $2of ]the NEQ2screen ?&loop)
INC2 MUL2k [ LIT2 &width $2 ] LTH2 ?&loop
BRK POP2 POP2 JMP2r</syntaxhighlight>
[[File:Colour pinstripe-Display in Uxntal.png|thumb|none|alt=Uxntal implementation of Colour pinstripe/display in an emulator.|Running in an emulator.]]
 
=={{header|Visual Basic .NET}}==
57

edits