0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-08 15:25:05 +00:00
uxn/examples/screen.usm
neauoire e86503901c *
2021-02-10 16:41:16 -08:00

36 lines
515 B
Text

( screen )
:dev/r fff8 ( std read port )
:dev/w fff9 ( std write port )
;width 2
;height 2
|0100 @RESET
( set read/write to dev/screen )
,01 DUP ,dev/r STR ,dev/w STR
( load screen size )
,00 IOR^ ,width STR^
,02 IOR^ ,height STR^
( draw pixel at screen center )
,0101
,width LDR^ ,0002 DIV^
,height LDR^ ,0002 DIV^
,putpixel JSR
BRK
|c000 @FRAME BRK
@putpixel
IOW^ ( y short )
IOW^ ( x short )
IOW ( color byte )
IOW ( redraw byte )
RTS
|d000 @ERROR BRK
|FFFA .RESET .FRAME .ERROR