uxn/examples/screen.usm

37 lines
515 B
Plaintext
Raw Normal View History

2021-02-10 14:06:36 -05:00
( screen )
:dev/r fff8 ( std read port )
:dev/w fff9 ( std write port )
2021-02-10 19:41:16 -05:00
;width 2
;height 2
2021-02-10 14:06:36 -05:00
|0100 @RESET
( set read/write to dev/screen )
,01 DUP ,dev/r STR ,dev/w STR
( load screen size )
2021-02-10 19:41:16 -05:00
,00 IOR^ ,width STR^
,02 IOR^ ,height STR^
2021-02-10 14:06:36 -05:00
( draw pixel at screen center )
,0101
2021-02-10 19:41:16 -05:00
,width LDR^ ,0002 DIV^
,height LDR^ ,0002 DIV^
2021-02-10 14:06:36 -05:00
,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