0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-08 15:25:05 +00:00
uxn/examples/mouse.usm

41 lines
524 B
Text
Raw Normal View History

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