commit 6ed93b5

Devie Lu Linvega  ·  2025-12-13 19:13:21 +0000 UTC
parent 83dcf14
Added perifs test rom
2 files changed,  +15, -18
R etc/examples/controller.tal => etc/examples/perifs.tal
+10, -4
 1@@ -3,7 +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+|90 @Mouse/vector $2 &x $2 &y $2 &state $1 &pad $3 &scrollx $2 &scrolly $2
 7 
 8 |000
 9 
10@@ -95,14 +95,14 @@
11 	BRK
12 
13 @mouse/<draw-cursor> ( -- )
14-	#00 .Screen/auto DEO
15+	[ LIT2 00 -Screen/auto ] DEO
16 	;&cursor-icn .Screen/addr DEO2
17 	[ LIT2 &last-x $2 ] .Screen/x DEO2
18 	[ LIT2 &last-y $2 ] .Screen/y DEO2
19 	[ LIT2 40 -Screen/sprite ] DEO
20-	.Mouse/x DEI2 DUP2 ,&last-x STR2
21+	.Mouse/x DEI2 #0003 SUB2 DUP2 ,&last-x STR2
22 	.Screen/x DEO2
23-	.Mouse/y DEI2 DUP2 ,&last-y STR2
24+	.Mouse/y DEI2 #0003 SUB2 DUP2 ,&last-y STR2
25 	.Screen/y DEO2
26 	[ LIT2 41 -Screen/sprite ] DEO
27 	JMP2r
28@@ -116,6 +116,12 @@
29 	.Screen/y DEI2 #0030 SUB2 .Screen/y DEO2
30 	[ LIT2 01 -Screen/auto ] DEO
31 	.Mouse/state DEI DUP hex/<draw-byte>
32+	( | x )
33+	.Screen/x DEI2 #0018 ADD2 .Screen/x DEO2
34+	.Mouse/x DEI2 hex/<draw-short>
35+	( | y )
36+	.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
37+	.Mouse/y DEI2 hex/<draw-short>
38 	( | mouse 1 )
39 	DUP #01 AND #00 EQU ?{
40 		.center/x LDZ2 #0040 SUB2 .Screen/x DEO2
+5, -14
 1@@ -5,8 +5,8 @@ PREFIX=${HOME}/.local
 2 
 3 .PHONY: run test debug install uninstall format clean grab archive
 4 
 5-run: bin/uxncli bin/uxn11 bin/mouse.rom
 6-	@ bin/uxn11 bin/mouse.rom
 7+run: bin/uxncli bin/uxn11 bin/perifs.rom
 8+	@ bin/uxn11 bin/perifs.rom
 9 
10 cli: bin/uxncli-debug  bin/console.rom
11 	bin/uxncli-debug
12@@ -24,12 +24,6 @@ system: bin/uxncli-debug bin/system.rom
13 console: bin/uxncli-debug bin/console.rom
14 	@ echo "foobar" | bin/uxncli-debug bin/console.rom "baz" "qux"
15 
16-mouse: bin/uxn11-debug bin/mouse.rom
17-	@ bin/uxn11-debug bin/mouse.rom
18-
19-controller: bin/uxn11-debug bin/controller.rom
20-	@ bin/uxn11-debug bin/controller.rom
21-
22 file: bin/uxncli-debug bin/file.rom
23 	@ bin/uxncli-debug bin/file.rom
24 
25@@ -53,7 +47,7 @@ archive:
26 	cp doc/man/uxntal.7 ../oscean/etc/uxntal.7.txt
27 	cp etc/examples/system.tal ../oscean/etc/varvara.system.tal.txt
28 	cp etc/examples/console.tal ../oscean/etc/varvara.console.tal.txt
29-	cp etc/examples/controller.tal ../oscean/etc/varvara.controller.tal.txt
30+	cp etc/examples/perifs.tal ../oscean/etc/varvara.perifs.tal.txt
31 	cp etc/examples/file.tal ../oscean/etc/varvara.file.tal.txt
32 
33 clean:
34@@ -99,11 +93,8 @@ bin/system.rom: bin/uxncli bin/drifblim.rom etc/examples/system.tal
35 bin/console.rom: bin/uxncli bin/drifblim.rom etc/examples/console.tal
36 	@ bin/uxncli bin/drifblim.rom etc/examples/console.tal bin/console.rom
37 
38-bin/mouse.rom: bin/uxncli bin/drifblim.rom etc/examples/mouse.tal
39-	@ bin/uxncli bin/drifblim.rom etc/examples/mouse.tal bin/mouse.rom
40-
41-bin/controller.rom: bin/uxncli bin/drifblim.rom etc/examples/controller.tal
42-	@ bin/uxncli bin/drifblim.rom etc/examples/controller.tal bin/controller.rom
43+bin/perifs.rom: bin/uxncli bin/drifblim.rom etc/examples/perifs.tal
44+	@ bin/uxncli bin/drifblim.rom etc/examples/perifs.tal bin/perifs.rom
45 
46 bin/screen.rom: bin/uxncli bin/drifblim.rom etc/examples/screen.tal
47 	@ bin/uxncli bin/drifblim.rom etc/examples/screen.tal bin/screen.rom