uxn/examples/mouse.usm

41 lines
532 B
Plaintext
Raw Normal View History

2021-02-10 14:06:36 -05:00
( mouse )
2021-02-09 20:22:52 -05:00
2021-02-10 14:06:36 -05:00
:dev/r fff8 ( std read port )
:dev/w fff9 ( std write port )
|0100 @RESET
2021-02-09 20:22:52 -05:00
2021-02-10 14:06:36 -05:00
,02 ,dev/r STR ( set dev/read mouse#02 )
,01 ,dev/w STR ( set dev/write screen#01 )
2021-02-09 20:22:52 -05:00
BRK
2021-02-10 14:06:36 -05:00
|c000 @FRAME
2021-02-09 20:43:53 -05:00
( get mouse button, or break )
2021-02-10 14:06:36 -05:00
,04 IOR
2021-02-09 20:43:53 -05:00
,01 NEQ
BRK?
2021-02-10 14:06:36 -05:00
2021-02-09 20:43:53 -05:00
( paint a white pixel )
,01 ,01
,getmouse JSR
2021-02-09 20:22:52 -05:00
,putpixel JSR
2021-02-10 14:06:36 -05:00
BRK
2021-02-09 20:22:52 -05:00
2021-02-10 14:06:36 -05:00
@getmouse
2021-02-13 11:38:23 -05:00
,00 IOR2 ( get mouse x )
,02 IOR2 ( get mouse y )
2021-02-09 20:43:53 -05:00
RTS
2021-02-10 14:06:36 -05:00
@putpixel
2021-02-13 11:38:23 -05:00
IOW2 ( y short )
IOW2 ( x short )
2021-02-10 14:06:36 -05:00
IOW ( color byte )
IOW ( redraw byte )
RTS
2021-02-09 20:43:53 -05:00
2021-02-09 20:22:52 -05:00
|d000 @ERROR BRK
|FFFA .RESET .FRAME .ERROR