Browse code

Fixed picking issue in Noodle

neauoire authored on 22/03/2021 16:56:33
Showing 3 changed files
... ...
@@ -76,8 +76,10 @@ RTN
76 76
 - Includes
77 77
 - Defines
78 78
 - Jump helpers
79
-- LDRS should load from the zeropage?
80
-- A fast way(2 bytes) to read from the zero page #aa LDR.
79
+- Implement Peek/Pook to helpers
80
+- Create a theme designer application
81
+- DateTime device
82
+- Document controller.player2
81 83
 
82 84
 ## Notes
83 85
 
... ...
@@ -20,5 +20,5 @@ cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werr
20 20
 # cc uxn.c emulator.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -L/usr/local/lib -lSDL2 -o bin/emulator
21 21
 
22 22
 # run
23
-./bin/assembler projects/examples/gui.ripples.usm bin/boot.rom
23
+./bin/assembler projects/software/noodle.usm bin/boot.rom
24 24
 ./bin/emulator bin/boot.rom
... ...
@@ -14,22 +14,23 @@
14 14
 		- Only draw-canvas target tile
15 15
 		- Resize buttons
16 16
 		- Limit size
17
-		- Draw point inbetween
18 17
 		- Pixel cleanup brush
19 18
 		- Drag canvas content
20
-	BUGS
21
-		- If canvas is higher than 0, mouse picking fails
19
+		- [tool] fill rect
20
+		- [tool] spray
21
+		- [tool] pen
22 22
 )
23 23
 
24 24
 %RTN   { JMP2r }
25 25
 %RTN?  { JMP2r? }
26 26
 %ABS2 { DUP2 #000f SFT2 #ffff SWP2 SWP POP MUL2? } 
27
+%STEP8 { #0033 SFT2 }
28
+%MOD8 { #0007 AND2  }
29
+%SFL { #40 SFT SFT }
27 30
 %++ { #0001 ADD2 } %-- { #0001 SUB2 }
28 31
 %2/ { #0001 SFT2 }
29 32
 %8/ { #0003 SFT2 } %8* { #0030 SFT2 }
30 33
 %8+ { #0008 ADD2 }
31
-%MOD8 { #0007 AND2  }
32
-%SFL { #40 SFT SFT }
33 34
 
34 35
 ( variables )
35 36
 
... ...
@@ -140,8 +141,8 @@ BRK
140 141
 		$no-touch-toolbar
141 142
 
142 143
 		( in canvas )
143
-		,$no-touch-canvas ~Mouse.x CLN2r ~canvas.x1 GTH2 STH2r ~canvas.x2 LTH2 #0101 NEQ2 JMP2?
144
-		,$no-touch-canvas ~Mouse.y CLN2r ~canvas.y1 GTH2 STH2r ~canvas.y2 LTH2 #0101 NEQ2 JMP2?
144
+		,$no-touch-canvas ~Mouse.x CLN2r ~canvas.x1 GTS2 STH2r ~canvas.x2 LTS2 #0101 NEQ2 JMP2?
145
+		,$no-touch-canvas ~Mouse.y CLN2r ~canvas.y1 GTS2 STH2r ~canvas.y2 LTS2 #0101 NEQ2 JMP2?
145 146
 
146 147
 			( set cursor operation )
147 148
 			,add-pixel =cursor.oper
... ...
@@ -158,30 +159,34 @@ BRK
158 159
 			,$no-mirror-mode ~cursor.mirror #00 EQU JMP2?
159 160
 				~Mouse.x ~canvas.x1 SUB2 ~canvas.w 8* SWP2 SUB2 ~Mouse.y ~canvas.y1 SUB2 ,paint JSR2
160 161
 			$no-mirror-mode
162
+			,$touch-end JMP2
161 163
 
162 164
 		$no-touch-canvas
163 165
 
164 166
 		( background interface )
165
-		~Mouse.x ~Screen.width #0020 SUB2 SUB2 8/ 
166
-		DUP2 
167
-		#0000 NEQ2 ,$no-toggle-zoom ROT JMP2?
168
-			~zoom.active #00 EQU =zoom.active
169
-			( release ) #00 =Mouse.state
170
-			,redraw JSR2
171
-		$no-toggle-zoom
172
-		DUP2 
173
-		#0001 NEQ2 ,$no-load-button ROT JMP2?
174
-			,filepath ,load-file JSR2
175
-			,draw-canvas JSR2
176
-			( release ) #00 =Mouse.state
177
-		$no-load-button
178
-		DUP2 
179
-		#0002 NEQ2 ,$no-save-button ROT JMP2?
180
-			,filepath ,save-file JSR2
181
-			( release ) #00 =Mouse.state
182
-		$no-save-button
183
-		POP2
184
-
167
+		,$no-touch-background ~Mouse.y STEP8 ~Screen.height #0010 SUB2 NEQ2 JMP2?
168
+			~Mouse.x ~Screen.width #0020 SUB2 SUB2 8/ 
169
+			DUP2 
170
+			#0000 NEQ2 ,$no-toggle-zoom ROT JMP2?
171
+				~zoom.active #00 EQU =zoom.active
172
+				( release ) #00 =Mouse.state
173
+				,redraw JSR2
174
+			$no-toggle-zoom
175
+			DUP2 
176
+			#0001 NEQ2 ,$no-load-button ROT JMP2?
177
+				,filepath ,load-file JSR2
178
+				,draw-canvas JSR2
179
+				( release ) #00 =Mouse.state
180
+			$no-load-button
181
+			DUP2 
182
+			#0002 NEQ2 ,$no-save-button ROT JMP2?
183
+				,filepath ,save-file JSR2
184
+				( release ) #00 =Mouse.state
185
+			$no-save-button
186
+			POP2
187
+		$no-touch-background
188
+
189
+		( jump label )
185 190
 		$touch-end
186 191
 
187 192
 	$no-touch