uxn/examples/mouse.usm

41 lines
524 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-14 20:00:17 -05:00
#02 =dev/r ( set dev/read mouse#02 )
#01 =dev/w ( 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-13 16:26:14 -05:00
#04 IOR
#01 NEQ
2021-02-09 20:43:53 -05:00
BRK?
2021-02-10 14:06:36 -05:00
2021-02-09 20:43:53 -05:00
( paint a white pixel )
2021-02-13 16:26:14 -05:00
#01 #01
2021-02-09 20:43:53 -05:00
,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 16:26:14 -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