commit 4c0da27

Devine Lu Linvega  ·  2025-04-23 19:13:53 +0000 UTC
parent 1fef0ff
Skip rewise when size is same
3 files changed,  +36, -10
+32, -8
 1@@ -24,16 +24,25 @@
 2 @on-button ( -> )
 3 	.Controller/button DEI
 4 	( | handlers )
 5-	DUP #10 AND #00 EQU ?{
 6-		.position/y LDZ2 #0004 SUB2 .position/y STZ2 }
 7-	DUP #20 AND #00 EQU ?{
 8-		.position/y LDZ2 #0004 ADD2 .position/y STZ2 }
 9-	DUP #40 AND #00 EQU ?{
10-		.position/x LDZ2 #0004 SUB2 .position/x STZ2 }
11-	DUP #80 AND #00 EQU ?{
12-		.position/x LDZ2 #0004 ADD2 .position/x STZ2 }
13+	DUP #10 NEQ ?{
14+		.position/x LDZ2 .position/y LDZ2 #0004 SUB2 <move> }
15+	DUP #20 NEQ ?{
16+		.position/x LDZ2 .position/y LDZ2 #0004 ADD2 <move> }
17+	DUP #40 NEQ ?{
18+		.position/x LDZ2 #0004 SUB2 .position/y LDZ2 <move> }
19+	DUP #80 NEQ ?{
20+		.position/x LDZ2 #0004 ADD2 .position/y LDZ2 <move> }
21+	DUP #14 NEQ ?{
22+		.position/x LDZ2 .position/y LDZ2 #0040 SUB2 <move> }
23+	DUP #24 NEQ ?{
24+		.position/x LDZ2 .position/y LDZ2 #0040 ADD2 <move> }
25+	DUP #44 NEQ ?{
26+		.position/x LDZ2 #0040 SUB2 .position/y LDZ2 <move> }
27+	DUP #84 NEQ ?{
28+		.position/x LDZ2 #0040 ADD2 .position/y LDZ2 <move> }
29 	DUP #01 NEQ ?{ <toggle-size> }
30 	DUP #02 NEQ ?{ <toggle-theme> }
31+	DUP #08 NEQ ?{ <toggle-pos> }
32 	POP <draw-portraits>
33 	BRK
34 
35@@ -44,6 +53,11 @@
36 (
37 @|drawing )
38 
39+@<toggle-pos> ( -- )
40+	.position/x LDZ2 #8000 NEQ2 ?{
41+		#0000 DUP2 !<move> }
42+	#8000 DUP2 !<move>
43+
44 @<toggle-size> ( -- )
45 	.Screen/width DEI2 #0200 EQU2 ?{
46 		#0200 .Screen/width DEO2
47@@ -75,6 +89,8 @@
48 		#40 .Screen/sprite DEO
49 		INC DUP ?&>l
50 	POP
51+	OVR2 <phex> #2018 DEO
52+	DUP2 <phex> #0a18 DEO
53 	( | update )
54 	.position/y STZ2
55 	.position/x STZ2
56@@ -191,6 +207,14 @@
57 	.Screen/sprite DEO
58 	JMP2r
59 
60+@<phex> ( short* -: )
61+	SWP /b
62+	&b ( byte -: )
63+		DUP #04 SFT /c
64+	&c ( byte -: )
65+		#0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO
66+		JMP2r
67+
68 @guide-icn [ 8000 0000 0000 0000 ]
69 
70 @fill-icn [ ffff ffff ffff ffff ]
+1, -1
1@@ -24,7 +24,7 @@ test: all bin/uxncli-debug bin/uxn11-debug bin/opctest.rom bin/screen.rom
2 	bin/uxn11-debug bin/screen.rom
3 
4 format:
5-	@ clang-format -i src/uxncli.c src/uxn11.c src/devices/*
6+	@ clang-format -i src/uxncli.c src/uxn11.c
7 
8 grab:
9 	@ cp ../drifblim/etc/drifblim.rom.txt etc/utils/drifblim.rom.txt
+3, -1
 1@@ -540,6 +540,8 @@ screen_apply(int width, int height)
 2 	int length;
 3 	clamp(width, 8, 0x800);
 4 	clamp(height, 8, 0x800);
 5+	if(width == uxn_screen.width && height == uxn_screen.height)
 6+		return;
 7 	length = MAR2(width) * MAR2(height);
 8 	uxn_screen.bg = realloc(uxn_screen.bg, length), uxn_screen.fg = realloc(uxn_screen.fg, length);
 9 	memset(uxn_screen.bg, 0, length);
10@@ -1309,7 +1311,7 @@ main(int argc, char **argv)
11 {
12 	int i = 1;
13 	if(argc == 2 && argv[1][0] == '-' && argv[1][1] == 'v')
14-		return !fprintf(stdout, "Uxn11 - Varvara Emulator, 20 Apr 2025.\n");
15+		return !fprintf(stdout, "Uxn11 - Varvara Emulator, 23 Apr 2025.\n");
16 	else if(argc == 1)
17 		return !fprintf(stdout, "usage: %s [-v] file.rom [args..]\n", argv[0]);
18 	else if(!display_init())