commit 83dcf14

Devie Lu Linvega  ·  2025-12-13 18:53:01 +0000 UTC
parent 4699a1f
Improved device test
1 files changed,  +35, -16
+35, -16
  1@@ -21,23 +21,19 @@
  2 	.Screen/height DEI2 #01 SFT2 .center/y STZ2
  3 	controller/<draw>
  4 	mouse/<draw>
  5-	;on-button .Controller/vector DEO2
  6-	;on-mouse .Mouse/vector DEO2
  7+	;controller/on-event .Controller/vector DEO2
  8+	;mouse/on-event .Mouse/vector DEO2
  9 	BRK
 10 
 11-@on-button ( -> )
 12-	controller/<draw>
 13+(
 14+@|Controller )
 15+
 16+@controller/on-event ( -> )
 17+	/<draw>
 18 	( | print stack on start button )
 19 	[ LIT2 08 -Controller/button ] DEI NEQ ?{ #010e DEO }
 20 	BRK
 21 
 22-@on-mouse ( -> )
 23-	mouse/<draw>
 24-	BRK
 25-
 26-(
 27-@|Controller )
 28-
 29 @controller/<draw> ( -- )
 30 	.Controller/button DEI2
 31 	( | background )
 32@@ -90,6 +86,27 @@
 33 		#05ff ;arrow/icn #00 <draw-times> }
 34 	POP2 JMP2r
 35 
 36+(
 37+@|Mouse )
 38+
 39+@mouse/on-event ( -> )
 40+	/<draw>
 41+	/<draw-cursor>
 42+	BRK
 43+
 44+@mouse/<draw-cursor> ( -- )
 45+	#00 .Screen/auto DEO
 46+	;&cursor-icn .Screen/addr DEO2
 47+	[ LIT2 &last-x $2 ] .Screen/x DEO2
 48+	[ LIT2 &last-y $2 ] .Screen/y DEO2
 49+	[ LIT2 40 -Screen/sprite ] DEO
 50+	.Mouse/x DEI2 DUP2 ,&last-x STR2
 51+	.Screen/x DEO2
 52+	.Mouse/y DEI2 DUP2 ,&last-y STR2
 53+	.Screen/y DEO2
 54+	[ LIT2 41 -Screen/sprite ] DEO
 55+	JMP2r
 56+
 57 @mouse/<draw> ( -- )
 58 	.center/x LDZ2 #0040 SUB2 .Screen/x DEO2
 59 	.center/y LDZ2 #0020 ADD2 .Screen/y DEO2
 60@@ -116,6 +133,9 @@
 61 		#05ff ;small/icn #16 <draw-times> }
 62 	POP JMP2r
 63 
 64+(
 65+@|Generics )
 66+
 67 @<draw-times> ( color times addr* auto -- )
 68 	.Screen/auto DEO
 69 	.Screen/addr DEO2
 70@@ -126,9 +146,6 @@
 71 		INC DUP ?&>l
 72 	POP POP2r JMP2r
 73 
 74-(
 75-@|drawing )
 76-
 77 @hex/<draw-short> ( short* -- )
 78 	[ LIT2 01 -Screen/auto ] DEO
 79 	SWP /<draw-byte>
 80@@ -140,11 +157,11 @@
 81 
 82 @hex/<draw-char> ( char -- )
 83 	#00 SWP #0f AND #30 SFT2 ;&icns ADD2 .Screen/addr DEO2
 84-	[ LIT2 03 -Screen/sprite ] DEO
 85+	[ LIT2 01 -Screen/sprite ] DEO
 86 	JMP2r
 87 
 88 (
 89-@|assets )
 90+@|Assets )
 91 
 92 @large/icns [
 93 	071f 3f7f 7fff ffff e0f8 fcfe feff ffff
 94@@ -214,6 +231,8 @@
 95 
 96 @mouse/tip-icn [ 0000 0000 187c 1800 $8 ]
 97 
 98+@mouse/cursor-icn [ 1010 10ee 1010 1000 ]
 99+
100 @mouse/icns [
101 	0000 0001 0618 6482 0718 6080 0000 0000
102 	e01f 0000 0000 0000 00c0 3f00 001f 2020