commit cf803f4

Devie Lu Linvega  ·  2025-12-13 18:16:20 +0000 UTC
parent e105a1c
Added mouse test to program
1 files changed,  +51, -9
+51, -9
  1@@ -3,6 +3,7 @@
  2 |00 @System/vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1
  3 |20 @Screen/vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
  4 |80 @Controller/vector $2 &button $1 &key $1
  5+|90 @Mouse &vector $2 &x $2 &y $2 &state $1 &pad $3 &modx $2 &mody $2
  6 
  7 |000
  8 
  9@@ -19,6 +20,7 @@
 10 	.Screen/width DEI2 #01 SFT2 .center/x STZ2
 11 	.Screen/height DEI2 #01 SFT2 .center/y STZ2
 12 	controller/<draw>
 13+	mouse/<draw>
 14 	;on-button .Controller/vector DEO2
 15 	BRK
 16 
 17@@ -35,7 +37,7 @@
 18 	.Controller/button DEI2
 19 	( | background )
 20 	.center/x LDZ2 #0040 SUB2 .Screen/x DEO2
 21-	.center/y LDZ2 #0020 SUB2 .Screen/y DEO2
 22+	.center/y LDZ2 #0040 SUB2 .Screen/y DEO2
 23 	#01f9 ;&icns #f6 <draw-times>
 24 	( | output )
 25 	.Screen/x DEI2 #0010 ADD2 .Screen/x DEO2
 26@@ -44,45 +46,51 @@
 27 	( | A button )
 28 	OVR #01 AND #00 EQU ?{
 29 		.center/x LDZ2 #0028 ADD2 .Screen/x DEO2
 30-		.center/y LDZ2 .Screen/y DEO2
 31+		.center/y LDZ2 #0020 SUB2 .Screen/y DEO2
 32 		#01fe ;large/icns #16 <draw-times> }
 33 	( | B button )
 34 	OVR #02 AND #00 EQU ?{
 35 		.center/x LDZ2 #0010 ADD2 .Screen/x DEO2
 36-		.center/y LDZ2 .Screen/y DEO2
 37+		.center/y LDZ2 #0020 SUB2 .Screen/y DEO2
 38 		#01fe ;large/icns #16 <draw-times> }
 39 	( | C button )
 40 	OVR #04 AND #00 EQU ?{
 41 		.center/x LDZ2 #0008 SUB2 .Screen/x DEO2
 42-		.center/y LDZ2 #0008 ADD2 .Screen/y DEO2
 43+		.center/y LDZ2 #0018 SUB2  .Screen/y DEO2
 44 		#01ff ;small/icn #16 <draw-times> }
 45 	( | S button )
 46 	OVR #08 AND #00 EQU ?{
 47 		.center/x LDZ2 #0018 SUB2 .Screen/x DEO2
 48-		.center/y LDZ2 #0008 ADD2 .Screen/y DEO2
 49+		.center/y LDZ2 #0018 SUB2  .Screen/y DEO2
 50 		#01ff ;small/icn #16 <draw-times> }
 51 	( | Up arrow )
 52 	OVR #10 AND #00 EQU ?{
 53 		.center/x LDZ2 #0030 SUB2 .Screen/x DEO2
 54-		.center/y LDZ2 #0008 SUB2 .Screen/y DEO2
 55+		.center/y LDZ2 #0028 SUB2 .Screen/y DEO2
 56 		#05ff ;arrow/icn #00 <draw-times> }
 57 	( | Down arrow )
 58 	OVR #20 AND #00 EQU ?{
 59 		.center/x LDZ2 #0030 SUB2 .Screen/x DEO2
 60-		.center/y LDZ2 #0008 ADD2 .Screen/y DEO2
 61+		.center/y LDZ2 #0018 SUB2  .Screen/y DEO2
 62 		#05ff ;arrow/icn #00 <draw-times> }
 63 	( | Left arrow )
 64 	OVR #40 AND #00 EQU ?{
 65 		.center/x LDZ2 #0038 SUB2 .Screen/x DEO2
 66-		.center/y LDZ2 .Screen/y DEO2
 67+		.center/y LDZ2 #0020 SUB2 .Screen/y DEO2
 68 		#05ff ;arrow/icn #00 <draw-times> }
 69 	( | Right arrow )
 70 	OVR #80 AND #00 EQU ?{
 71 		.center/x LDZ2 #0028 SUB2 .Screen/x DEO2
 72-		.center/y LDZ2 .Screen/y DEO2
 73+		.center/y LDZ2 #0020 SUB2 .Screen/y DEO2
 74 		#05ff ;arrow/icn #00 <draw-times> }
 75 	POP2 JMP2r
 76 
 77+@mouse/<draw> ( -- )
 78+	.center/x LDZ2 #0040 SUB2 .Screen/x DEO2
 79+	.center/y LDZ2 #0020 ADD2 .Screen/y DEO2
 80+	#01fc ;&icns #f6 <draw-times>
 81+	JMP2r
 82+
 83 @<draw-times> ( color times addr* auto -- )
 84 	.Screen/auto DEO
 85 	.Screen/addr DEO2
 86@@ -179,6 +187,40 @@
 87 	0000 0000 0000 00ff 0000 0000 0000 00ff
 88 	0000 0000 0000 00ff 0101 0101 0202 0cf0 ]
 89 
 90+@mouse/icns [
 91+	0000 0001 0618 6482 0718 6080 0000 0000
 92+	e01f 0000 0000 0000 00c0 3f00 001f 2020
 93+	0000 ff00 00f8 0404 0000 ff00 001f 2020
 94+	0000 ff00 00f8 0404 0000 ff00 0000 0000
 95+	0000 ff00 0000 0000 0000 ff00 0000 0000
 96+	0000 ff00 0000 0000 0000 ff00 0000 0000
 97+	0000 ff00 0000 0000 0000 ff00 0000 0000
 98+	0000 ff00 0000 0000 0000 c03e 0101 0101
 99+	6418 0601 0000 0000 0000 0080 6018 0700
100+	0000 0000 001f e000 201f 0000 3fc0 0000
101+	04f8 0000 ff00 0000 201f 0000 ff00 0000
102+	04f8 0000 ff00 0000 0000 0000 ff00 0000
103+	0000 0000 ff00 0000 0000 0000 ff00 0000
104+	0000 0000 ff00 0000 0000 0000 ff00 0000
105+	0000 0000 ff00 0000 0000 0000 ff00 0000
106+	0000 0000 ff00 0000 0101 013e c000 0000
107+	0000 6090 90f0 9090 0000 0000 0000 0000
108+	0000 0000 0000 0000 0000 0302 0203 0202
109+	0000 8040 4080 4040 0000 0102 0202 0202
110+	0000 8040 0000 0040 0000 0000 0000 0000
111+	0000 0000 0000 0000 0000 0000 0000 0000
112+	0000 0000 0000 0000 0000 0000 0000 0000
113+	0000 0000 0000 0000 0000 0000 0000 0000
114+	0000 0000 0000 0000 0000 0000 0000 0000
115+	9000 0000 0000 0000 0000 0000 0000 0000
116+	0000 0000 0000 0000 0300 0000 0000 0000
117+	8000 0000 0000 0000 0100 0000 0000 0000
118+	8000 0000 0000 0000 0000 0000 0000 0000
119+	0000 0000 0000 0000 0000 0000 0000 0000
120+	0000 0000 0000 0000 0000 0000 0000 0000
121+	0000 0000 0000 0000 0000 0000 0000 0000
122+	0000 0000 0000 0000 0000 0000 0000 0000 ]
123+
124 @hex/icns [
125 	0018 2424 2424 2418 0008 1808 0808 0808
126 	0018 2404 1820 203c 0018 2404 1804 2418