2021-04-21 12:48:04 -04:00
|
|
|
( dev/mouse )
|
|
|
|
|
|
|
|
%RTN { JMP2r }
|
|
|
|
%8+ { #0008 ADD2 }
|
|
|
|
%++ { #0001 ADD2 }
|
|
|
|
%-- { #0001 SUB2 }
|
|
|
|
|
|
|
|
( devices )
|
|
|
|
|
|
|
|
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|
|
|
|
|10 @Console [ &pad $8 &char $1 &byte $1 &short $2 &string $2 ]
|
|
|
|
|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ]
|
|
|
|
|40 @Controller [ &vector $2 &button $1 &key $1 ]
|
|
|
|
|60 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &chord $1 ]
|
|
|
|
|
|
|
|
|0000
|
|
|
|
|
|
|
|
@pointer [ &x $2 &y $2 ]
|
|
|
|
|
|
|
|
( program )
|
|
|
|
|
|
|
|
|0100 ( -> )
|
|
|
|
|
|
|
|
( theme )
|
2021-04-21 14:12:42 -04:00
|
|
|
#03fd .System/r DEO2
|
|
|
|
#0ef3 .System/g DEO2
|
|
|
|
#0bf2 .System/b DEO2
|
2021-04-21 12:48:04 -04:00
|
|
|
|
2021-04-21 14:12:42 -04:00
|
|
|
( vectors ) ;on-mouse .Mouse/vector DEO2
|
2021-04-21 12:48:04 -04:00
|
|
|
|
|
|
|
BRK
|
|
|
|
|
|
|
|
@on-mouse ( -> )
|
|
|
|
|
|
|
|
;draw-cursor JSR2
|
|
|
|
|
|
|
|
BRK
|
|
|
|
|
|
|
|
@draw-cursor ( -- )
|
|
|
|
|
|
|
|
( clear last cursor )
|
2021-04-21 14:12:42 -04:00
|
|
|
;clear .Screen/addr DEO2
|
|
|
|
.pointer/x PEK2 .Screen/x DEO2
|
|
|
|
.pointer/y PEK2 .Screen/y DEO2
|
|
|
|
#30 .Screen/color DEO
|
2021-04-21 12:48:04 -04:00
|
|
|
|
|
|
|
( record pointer positions )
|
2021-04-21 14:12:42 -04:00
|
|
|
.Mouse/x DEI2 .pointer/x POK2
|
|
|
|
.Mouse/y DEI2 .pointer/y POK2
|
2021-04-21 12:48:04 -04:00
|
|
|
|
|
|
|
( draw new cursor )
|
2021-04-21 14:12:42 -04:00
|
|
|
;cursor .Screen/addr DEO2
|
|
|
|
.pointer/x PEK2 .Screen/x DEO2
|
|
|
|
.pointer/y PEK2 .Screen/y DEO2
|
2021-04-21 12:48:04 -04:00
|
|
|
|
|
|
|
( colorize on state )
|
2021-04-21 14:12:42 -04:00
|
|
|
.Mouse/state DEI #00 NEQ
|
|
|
|
#31 ADD .Screen/color DEO
|
2021-04-21 12:48:04 -04:00
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@clear [ 0000 0000 0000 0000 ]
|
|
|
|
@cursor [ 80c0 e0f0 f8e0 1000 ]
|