uxn/examples/pixels.usm

44 lines
811 B
Plaintext
Raw Normal View History

2021-02-10 19:41:16 -05:00
( my default test file )
:dev/r fff8 ( std read port )
:dev/w fff9 ( std write port )
2021-02-10 22:05:40 -05:00
;x 2 ;y 2 ;color 1 ;alive 1
2021-02-10 19:41:16 -05:00
|0100 @RESET
2021-02-13 16:21:05 -05:00
#01 ,dev/w STR ( set dev/write to screen )
#01 ,color STR ( set color )
#0020 ,x STR2 ( set x-pos )
#0030 ,y STR2 ( set y-pos )
#01 ,alive STR ( set alive = true )
2021-02-10 19:41:16 -05:00
BRK
|c000 @FRAME
2021-02-13 16:21:05 -05:00
,alive LDR #00 EQU BRK?
#01 ,color LDR ,x LDR2 ,y LDR2 ,putpixel JSR
2021-02-10 22:05:40 -05:00
,move JSR
2021-02-10 19:41:16 -05:00
BRK
@move
2021-02-13 16:21:05 -05:00
,x LDR2 #0001 ADD2 ,x STR2 ( incr x )
,x LDR2 #0040 LTH2 RTS? ( if x > 60 )
#0020 ,x STR2 ( x = 0x0020 )
,y LDR2 #0001 ADD2 ,y STR2 ( incr y )
,y LDR2 #0050 LTH2 RTS? ( y > 50 )
#00 ,alive STR ( alive = 0 )
2021-02-10 19:41:16 -05:00
RTS
@putpixel
2021-02-13 11:38:23 -05:00
IOW2 ( y short )
IOW2 ( x short )
2021-02-10 22:05:40 -05:00
IOW ( color byte )
IOW ( redraw byte )
2021-02-10 19:41:16 -05:00
RTS
|d000 @ERROR BRK
|FFFA .RESET .FRAME .ERROR