2021-02-26 22:46:56 -05:00
|
|
|
( dev/mouse )
|
2021-02-20 17:07:20 -05:00
|
|
|
|
2021-02-26 19:38:20 -05:00
|
|
|
&Screen { width 2 height 2 pad 4 y 2 x 2 color 1 }
|
2021-02-26 19:53:09 -05:00
|
|
|
&Sprite { pad 8 x 2 y 2 addr 2 color 1 }
|
2021-02-26 19:38:20 -05:00
|
|
|
&Mouse { x 2 y 2 state 1 chord 1 }
|
2021-02-20 17:07:20 -05:00
|
|
|
|
2021-02-28 14:17:32 -05:00
|
|
|
&Label2d { x 2 y 2 color 1 addr 2 }
|
2021-02-23 20:57:57 -05:00
|
|
|
&Point2d { x 2 y 2 }
|
|
|
|
|
2021-02-28 14:17:32 -05:00
|
|
|
;label Label2d
|
2021-02-26 20:16:45 -05:00
|
|
|
;cat Point2d
|
|
|
|
;mouse Point2d
|
|
|
|
;pos Point2d
|
|
|
|
;color 1
|
2021-02-26 19:38:20 -05:00
|
|
|
;timer 1
|
2021-02-20 17:07:20 -05:00
|
|
|
|
|
|
|
|0100 @RESET
|
2021-02-23 20:57:57 -05:00
|
|
|
|
|
|
|
( position cat )
|
2021-02-26 19:38:20 -05:00
|
|
|
~dev/screen.width #0002 DIV2 =cat.x
|
|
|
|
~dev/screen.height #0038 SUB2 =cat.y
|
2021-02-26 20:16:45 -05:00
|
|
|
#01 =color
|
2021-02-20 17:07:20 -05:00
|
|
|
( draw polycat )
|
|
|
|
,draw-polycat JSR
|
|
|
|
|
|
|
|
BRK
|
|
|
|
|
2021-02-28 14:17:32 -05:00
|
|
|
|0200 @FRAME
|
2021-02-26 19:38:20 -05:00
|
|
|
|
2021-02-28 14:17:32 -05:00
|
|
|
,draw-cursor JSR
|
|
|
|
|
2021-02-26 20:16:45 -05:00
|
|
|
( reset timer -> move cat tail )
|
2021-02-28 14:17:32 -05:00
|
|
|
,no-click ~dev/mouse.state #00 EQU JMP? POP2
|
2021-02-20 17:07:20 -05:00
|
|
|
#50 =timer
|
|
|
|
@no-click
|
2021-02-26 20:16:45 -05:00
|
|
|
( detect click )
|
2021-02-28 14:17:32 -05:00
|
|
|
,no-click12 ~dev/mouse.state #11 NEQ JMP? POP2
|
|
|
|
#0058 #0040 #01 ,mouse12_text ,draw-label JSR
|
2021-02-26 20:16:45 -05:00
|
|
|
#10 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR
|
|
|
|
~color ,mouse12_icn #0048 #0040 ,draw-sprite JSR
|
|
|
|
,end-click JMP
|
|
|
|
@no-click12
|
2021-02-28 14:17:32 -05:00
|
|
|
,no-click1 ~dev/mouse.state #01 NEQ JMP? POP2
|
|
|
|
#0058 #0040 #01 ,mouse1_text ,draw-label JSR
|
2021-02-26 20:16:45 -05:00
|
|
|
#12 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR
|
|
|
|
~color ,mouse1_icn #0048 #0040 ,draw-sprite JSR
|
|
|
|
,end-click JMP
|
|
|
|
@no-click1
|
2021-02-28 14:17:32 -05:00
|
|
|
,no-click2 ~dev/mouse.state #10 NEQ JMP? POP2
|
|
|
|
#0058 #0040 #01 ,mouse2_text ,draw-label JSR
|
2021-02-26 20:16:45 -05:00
|
|
|
#13 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR
|
|
|
|
~color ,mouse2_icn #0048 #0040 ,draw-sprite JSR
|
|
|
|
,end-click JMP
|
|
|
|
@no-click2
|
|
|
|
( default )
|
2021-02-28 14:17:32 -05:00
|
|
|
#0058 #0040 #01 ,mouse0_text ,draw-label JSR
|
2021-02-26 20:16:45 -05:00
|
|
|
~color ,mouse0_icn #0048 #0040 ,draw-sprite JSR
|
|
|
|
@end-click
|
2021-02-20 17:07:20 -05:00
|
|
|
( animate )
|
|
|
|
,animate-polycat JSR
|
|
|
|
( update last pos )
|
|
|
|
~timer #01 ADD =timer
|
|
|
|
|
|
|
|
BRK
|
|
|
|
|
2021-02-28 14:17:32 -05:00
|
|
|
@draw-cursor
|
|
|
|
|
|
|
|
~mouse.x ~dev/mouse.x NEQU2
|
|
|
|
~mouse.y ~dev/mouse.y NEQU2
|
|
|
|
|
|
|
|
#0000 EQU2 RTS? ( Return if unchanged )
|
|
|
|
|
|
|
|
( clear last cursor )
|
|
|
|
#10 ,clear_icn ~mouse.x ~mouse.y ,draw-sprite JSR
|
|
|
|
( record mouse positions )
|
|
|
|
~dev/mouse.x =mouse.x ~dev/mouse.y =mouse.y
|
|
|
|
#11 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR
|
|
|
|
|
|
|
|
RTS
|
|
|
|
|
2021-02-20 17:07:20 -05:00
|
|
|
@draw-polycat
|
|
|
|
|
|
|
|
( ears )
|
2021-02-23 20:57:57 -05:00
|
|
|
,polycat ~cat.x ~cat.y ,draw-sprite-chr JSR
|
|
|
|
,polycat #0010 ADD2 ~cat.x #0008 ADD2 ~cat.y ,draw-sprite-chr JSR
|
2021-02-20 17:07:20 -05:00
|
|
|
( eye )
|
2021-02-23 20:57:57 -05:00
|
|
|
,polycat #0020 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR
|
|
|
|
,polycat #0030 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR
|
2021-02-20 17:07:20 -05:00
|
|
|
( body )
|
2021-02-23 20:57:57 -05:00
|
|
|
,polycat #00a0 ADD2 ~cat.x ~cat.y #0010 ADD2 ,draw-sprite-chr JSR
|
|
|
|
,polycat #00b0 ADD2 ~cat.x #0008 ADD2 ~cat.y #0010 ADD2 ,draw-sprite-chr JSR
|
2021-02-20 17:07:20 -05:00
|
|
|
|
|
|
|
RTS
|
|
|
|
|
|
|
|
@animate-polycat
|
|
|
|
|
|
|
|
( tail )
|
|
|
|
~timer #50 NEQ ,animate-polycat-tail-next0 ROT JMP? POP2
|
2021-02-23 20:57:57 -05:00
|
|
|
,polycat #00c0 ADD2 ~cat.x #0008 ADD2 ~cat.y #0010 ADD2 ,draw-sprite-chr JSR
|
2021-02-20 17:07:20 -05:00
|
|
|
@animate-polycat-tail-next0
|
|
|
|
~timer #58 NEQ ,animate-polycat-tail-next1 ROT JMP? POP2
|
2021-02-23 20:57:57 -05:00
|
|
|
,polycat #00d0 ADD2 ~cat.x #0008 ADD2 ~cat.y #0010 ADD2 ,draw-sprite-chr JSR
|
2021-02-20 17:07:20 -05:00
|
|
|
@animate-polycat-tail-next1
|
|
|
|
~timer #60 NEQ ,animate-polycat-tail-next2 ROT JMP? POP2
|
2021-02-23 20:57:57 -05:00
|
|
|
,polycat #00b0 ADD2 ~cat.x #0008 ADD2 ~cat.y #0010 ADD2 ,draw-sprite-chr JSR
|
2021-02-20 17:07:20 -05:00
|
|
|
@animate-polycat-tail-next2
|
|
|
|
( look-at )
|
2021-02-23 20:57:57 -05:00
|
|
|
~mouse.x ~cat.x #0008 ADD2 GTH2 ,animate-polycat-right ROT JMP? POP2
|
2021-02-20 17:07:20 -05:00
|
|
|
@animate-polycat-left
|
2021-02-23 20:57:57 -05:00
|
|
|
~mouse.y ~cat.y #0008 ADD2 GTH2 ,animate-polycat-left-down ROT JMP? POP2
|
2021-02-20 17:07:20 -05:00
|
|
|
@animate-polycat-left-up
|
2021-02-23 20:57:57 -05:00
|
|
|
,polycat #0040 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR
|
|
|
|
,polycat #0050 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR
|
2021-02-20 17:07:20 -05:00
|
|
|
RTS
|
|
|
|
@animate-polycat-left-down
|
2021-02-23 20:57:57 -05:00
|
|
|
,polycat #0020 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR
|
|
|
|
,polycat #0030 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR
|
2021-02-20 17:07:20 -05:00
|
|
|
RTS
|
|
|
|
@animate-polycat-right
|
2021-02-23 20:57:57 -05:00
|
|
|
~mouse.y ~cat.y #0008 ADD2 GTH2 ,animate-polycat-right-down ROT JMP? POP2
|
2021-02-20 17:07:20 -05:00
|
|
|
@animate-polycat-right-up
|
2021-02-23 20:57:57 -05:00
|
|
|
,polycat #0060 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR
|
|
|
|
,polycat #0070 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR
|
2021-02-20 17:07:20 -05:00
|
|
|
RTS
|
|
|
|
@animate-polycat-right-down
|
2021-02-23 20:57:57 -05:00
|
|
|
,polycat #0080 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR
|
|
|
|
,polycat #0090 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR
|
2021-02-20 17:07:20 -05:00
|
|
|
RTS
|
|
|
|
|
|
|
|
RTS
|
|
|
|
|
2021-02-28 14:17:32 -05:00
|
|
|
@draw-label ( x y color addr )
|
|
|
|
|
|
|
|
( load ) =label.addr =label.color =dev/sprite.y =dev/sprite.x ~label.addr
|
2021-02-26 20:16:45 -05:00
|
|
|
@draw-label-loop
|
2021-02-28 14:17:32 -05:00
|
|
|
( draw ) DUP2 LDR #00 SWP #0008 MUL2 ,font ADD2 =dev/sprite.addr ~label.color =dev/sprite.color
|
2021-02-26 20:16:45 -05:00
|
|
|
( incr ) #0001 ADD2
|
2021-02-28 14:17:32 -05:00
|
|
|
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x
|
2021-02-26 20:16:45 -05:00
|
|
|
DUP2 LDR #00 NEQ ,draw-label-loop ROT JMP? POP2
|
|
|
|
POP2
|
2021-02-28 14:17:32 -05:00
|
|
|
|
2021-02-26 20:16:45 -05:00
|
|
|
RTS
|
|
|
|
|
2021-02-20 17:07:20 -05:00
|
|
|
@draw-sprite
|
2021-02-26 19:38:20 -05:00
|
|
|
=dev/sprite.y
|
2021-02-26 19:53:09 -05:00
|
|
|
=dev/sprite.x
|
2021-02-26 19:38:20 -05:00
|
|
|
=dev/sprite.addr
|
|
|
|
=dev/sprite.color
|
2021-02-20 17:07:20 -05:00
|
|
|
RTS
|
|
|
|
|
|
|
|
@draw-sprite-chr
|
2021-02-26 19:38:20 -05:00
|
|
|
=dev/sprite.y
|
2021-02-26 19:53:09 -05:00
|
|
|
=dev/sprite.x
|
2021-02-26 19:38:20 -05:00
|
|
|
=dev/sprite.addr
|
|
|
|
#20 =dev/sprite.color
|
2021-02-20 17:07:20 -05:00
|
|
|
RTS
|
|
|
|
|
|
|
|
@clear_icn [ 0000 0000 0000 0000 ]
|
|
|
|
@cursor_icn [ 80c0 e0f0 f8e0 1000 ]
|
|
|
|
|
|
|
|
@polycat [
|
2021-02-20 18:00:34 -05:00
|
|
|
081c 3e3e 7f7f ffff 081c 3e3e 7f7f fffc
|
2021-02-20 17:07:20 -05:00
|
|
|
081c 3c3e 7e7e ffff 081c 3c3e 7e7e ff1f
|
|
|
|
ffff ffff ff7f 3f0f f0e7 cfef f77c 3f0f
|
|
|
|
ffff ffff fffe fcf0 0783 c1c3 871e fcf0
|
|
|
|
ffff ffff ff7f 3f0f f7ef cfe7 f07c 3f0f
|
|
|
|
ffff ffff fffe fcf0 87c3 c183 071e fcf0
|
|
|
|
ffff ffff ff7f 3f0f f0e1 c1e0 f07c 3f0f
|
|
|
|
ffff ffff fffe fcf0 f7fb f9f3 071e fcf0
|
|
|
|
ffff ffff ff7f 3f0f f0e0 c1e1 f07c 3f0f
|
|
|
|
ffff ffff fffe fcf0 07f3 f9fb f71e fcf0
|
|
|
|
0307 0707 0302 0200 0307 0707 0300 0000
|
|
|
|
c0f0 f0e0 e080 8000 c0f2 f9f9 fef8 b000
|
|
|
|
c0f0 f0e0 e080 8000 c0f2 faf9 fef8 b000
|
|
|
|
c0f0 f0e0 e080 8000 c0f1 faf9 fef8 b000
|
|
|
|
]
|
|
|
|
|
2021-02-26 20:16:45 -05:00
|
|
|
|
|
|
|
@mouse0_icn [ 7c82 92ee 8282 4438 ]
|
|
|
|
@mouse1_icn [ 7cf2 f2ee 8282 4438 ]
|
|
|
|
@mouse2_icn [ 7c9e 9eee 8282 4438 ]
|
|
|
|
@mouse12_icn [ 7cfe feee 8282 4438 ]
|
|
|
|
|
|
|
|
@font ( spectrum-zx font )
|
|
|
|
[
|
|
|
|
0000 0000 0000 0000 0000 2400 7e3c 0000 0000 2400 3c42 0000 0000 6c7c 7c38 1000
|
|
|
|
0010 387c 7c38 1000 0038 387c 6c10 3800 0010 387c 7c10 3800 0000 0018 1800 0000
|
|
|
|
007e 4242 4242 7e00 0000 1824 2418 0000 0018 2442 4224 1800 001e 063a 4a48 3000
|
|
|
|
0038 446c 107c 1000 000c 0808 0838 3800 003e 2222 2266 6600 0000 0822 0022 0800
|
|
|
|
0000 1018 1c18 1000 0000 0818 3818 0800 0008 1c00 001c 0800 0028 2828 2800 2800
|
|
|
|
003e 4a4a 3a0a 0a00 000c 3046 620c 3000 0000 0000 0000 ffff 0010 3800 3810 0038
|
|
|
|
0008 1c2a 0808 0800 0008 0808 2a1c 0800 0000 0804 7e04 0800 0000 1020 7e20 1000
|
|
|
|
0000 4040 7e00 0000 0000 0024 6624 0000 0000 1038 7c00 0000 0000 007c 3810 0000
|
|
|
|
0000 0000 0000 0000 0008 0808 0800 0800 0014 1400 0000 0000 0024 7e24 247e 2400
|
|
|
|
0008 1e28 1c0a 3c08 0042 0408 1020 4200 0030 4832 4c44 3a00 0008 1000 0000 0000
|
|
|
|
0004 0808 0808 0400 0010 0808 0808 1000 0000 1408 3e08 1400 0000 0808 3e08 0800
|
|
|
|
0000 0000 0008 0810 0000 0000 3c00 0000 0000 0000 0000 0800 0000 0204 0810 2000
|
|
|
|
003c 464a 5262 3c00 0018 2808 0808 3e00 003c 4202 3c40 7e00 003c 421c 0242 3c00
|
|
|
|
0008 1828 487e 0800 007e 407c 0242 3c00 003c 407c 4242 3c00 007e 0204 0810 1000
|
|
|
|
003c 423c 4242 3c00 003c 4242 3e02 3c00 0000 0008 0000 0800 0000 0800 0008 0810
|
|
|
|
0000 0810 2010 0800 0000 003e 003e 0000 0000 1008 0408 1000 003c 4202 0c00 0800
|
|
|
|
003c 425a 5442 3c00 0018 2442 7e42 4200 007c 427c 4242 7c00 003c 4240 4042 3c00
|
|
|
|
0078 4442 4244 7800 007e 407c 4040 7e00 003e 4040 7c40 4000 003c 4240 4e42 3c00
|
|
|
|
0042 427e 4242 4200 003e 0808 0808 3e00 0002 0202 4242 3c00 0044 4870 4844 4200
|
|
|
|
0040 4040 4040 7e00 0042 665a 4242 4200 0042 6252 4a46 4200 003c 4242 4242 3c00
|
|
|
|
007c 4242 7c40 4000 003c 4242 524a 3c00 007c 4242 7c44 4200 003c 403c 0242 3c00
|
|
|
|
00fe 1010 1010 1000 0042 4242 4242 3c00 0042 4242 4224 1800 0042 4242 5a66 4200
|
|
|
|
0042 2418 1824 4200 0082 4428 1010 1000 007e 0408 1020 7e00 000c 0808 0808 0c00
|
|
|
|
0040 2010 0804 0200 0018 0808 0808 1800 0008 1422 0000 0000 0000 0000 0000 7e00
|
|
|
|
0008 0400 0000 0000 0000 1c02 1e22 1e00 0020 203c 2222 3c00 0000 1e20 2020 1e00
|
|
|
|
0002 021e 2222 1e00 0000 1c22 3c20 1e00 000c 101c 1010 1000 0000 1c22 221e 021c
|
|
|
|
0020 202c 3222 2200 0008 0018 0808 0400 0008 0008 0808 4830 0020 2428 3028 2400
|
|
|
|
0010 1010 1010 0c00 0000 6854 5454 5400 0000 5864 4444 4400 0000 3844 4444 3800
|
|
|
|
0000 7844 4478 4040 0000 3c44 443c 0406 0000 2c30 2020 2000 0000 3840 3804 7800
|
|
|
|
0010 103c 1010 0c00 0000 4444 4444 3800 0000 4444 2828 1000 0000 4454 5454 2800
|
|
|
|
0000 4428 1028 4400 0000 4444 443c 0438 0000 7c08 1020 7c00 000c 0810 1008 0c00
|
|
|
|
0008 0808 0808 0800 0030 1008 0810 3000 0000 0032 4c00 0000 3c42 99a1 a199 423c
|
|
|
|
]
|
|
|
|
|
|
|
|
@chord0_text [ no chord ] <1 .00
|
|
|
|
@chord1_text [ chord 1_ ] <1 .00
|
|
|
|
@chord2_text [ chord _2 ] <1 .00
|
|
|
|
@mouse0_text [ no click ] <1 .00
|
|
|
|
@mouse1_text [ mouse 1_ ] <1 .00
|
|
|
|
@mouse2_text [ mouse _2 ] <1 .00
|
|
|
|
@mouse12_text [ mouse 12 ] <1 .00
|
|
|
|
|
2021-02-28 14:17:32 -05:00
|
|
|
|d000 @ERROR BRK
|
|
|
|
|
2021-02-26 19:38:20 -05:00
|
|
|
|FF10 ;dev/screen Screen
|
|
|
|
|FF20 ;dev/sprite Sprite
|
|
|
|
|FF50 ;dev/mouse Mouse
|
|
|
|
|
2021-02-28 14:41:28 -05:00
|
|
|
|FFF0 .RESET .FRAME .ERROR ( vectors )
|
2021-02-28 14:17:32 -05:00
|
|
|
|FFF8 [ 0f85 0fd5 0fb5 ] ( palette )
|