Browse code

Added extra keyboard controls to Noodle

neauoire authored on 20/03/2021 18:37:01
Showing 8 changed files
... ...
@@ -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/software/nasu.usm bin/boot.rom
23
+./bin/assembler projects/software/noodle.usm bin/boot.rom
24 24
 ./bin/emulator bin/boot.rom
25 25
deleted file mode 100644
26 26
Binary files a/projects/bigpicture3f2c.bit and /dev/null differ
27 27
similarity index 100%
28 28
rename from projects/font.bit
29 29
rename to projects/fonts/font.bit
30 30
deleted file mode 100644
31 31
Binary files a/projects/picture2a1a.bit and /dev/null differ
32 32
similarity index 100%
33 33
rename from projects/picture2010.bit
34 34
rename to projects/pictures/akane2010.bit
35 35
new file mode 100644
36 36
Binary files /dev/null and b/projects/pictures/logo0808.bit differ
37 37
new file mode 100644
38 38
Binary files /dev/null and b/projects/pictures/tima2a1a.bit differ
... ...
@@ -6,6 +6,8 @@
6 6
 	arrows - move zoom
7 7
 	space - toogle zoom
8 8
 	backspace - blank canvas
9
+	m - toggle mirror mode
10
+	1-8 - select brush size
9 11
 
10 12
 	TODO
11 13
 		- Only draw-canvas when mouse has changed
... ...
@@ -14,6 +16,7 @@
14 16
 		- Limit size
15 17
 		- Draw point inbetween
16 18
 		- Pixel cleanup brush
19
+		- Drag canvas content
17 20
 	BUGS
18 21
 		- If canvas is higher than 0, mouse picking fails
19 22
 )
... ...
@@ -29,7 +32,7 @@
29 32
 
30 33
 ;center { x 2 y 2 }
31 34
 ;toolbar { x1 2 y1 2 x2 2 y2 2 }
32
-;cursor { x 2 y 2 x0 2 y0 2 size 1 patt 1 drag 1 }
35
+;cursor { x 2 y 2 x0 2 y0 2 size 1 patt 1 drag 1 mirror 1 }
33 36
 ;zoom { active 1 x 2 y 2 }
34 37
 ;rect { x1 2 y1 2 x2 2 y2 2 }
35 38
 ;origin { x1 2 y1 2 x2 2 y2 2 }
... ...
@@ -121,7 +124,13 @@ BRK
121 124
 		( in canvas )
122 125
 		,$no-touch-canvas ~Mouse.x CLN2r ~canvas.x1 GTH2 STH2r ~canvas.x2 LTH2 #0101 NEQ2 JMP2?
123 126
 		,$no-touch-canvas ~Mouse.y CLN2r ~canvas.y1 GTH2 STH2r ~canvas.y2 LTH2 #0101 NEQ2 JMP2?
127
+
124 128
 			~Mouse.x ~canvas.x1 SUB2 ~Mouse.y ~canvas.y1 SUB2 ,paint JSR2
129
+
130
+			,$no-mirror-mode ~cursor.mirror #00 EQU JMP2?
131
+				~Mouse.x ~canvas.x1 SUB2 ~canvas.w 8* SWP2 SUB2 ~Mouse.y ~canvas.y1 SUB2 ,paint JSR2
132
+			$no-mirror-mode
133
+
125 134
 		$no-touch-canvas
126 135
 
127 136
 		( background interface )
... ...
@@ -166,7 +175,13 @@ BRK
166 175
 			( toggle zoom ) ~zoom.active #00 EQU =zoom.active ,redraw JSR2 $no-space 
167 176
 		DUP #08 NEQ ,$no-backspace ROT JMP2?
168 177
 			( erase ) ,clear JSR2 $no-backspace
178
+		DUP #6d NEQ ,$no-mkey ROT JMP2?
179
+			( mirror ) ~cursor.mirror #00 EQU =cursor.mirror $no-mkey
180
+		DUP 
181
+			DUP #30 GTH SWP #39 LTH #0101 NEQ2 ,$no-numkey ROT JMP2?
182
+			( size ) ~Keys #31 SUB =cursor.size ,draw-toolbar JSR2 $no-numkey
169 183
 		POP
184
+		
170 185
 		( release ) #00 =Keys
171 186
 	$no-keys
172 187
 
... ...
@@ -437,6 +452,12 @@ RTN
437 452
 	( draw new cursor )
438 453
 	,$outside-canvas ~Mouse.x CLN2r ~canvas.x1 GTH2 STH2r ~canvas.x2 LTH2 #0101 NEQ2 JMP2?
439 454
 	,$outside-canvas ~Mouse.y CLN2r ~canvas.y1 GTH2 STH2r ~canvas.y2 LTH2 #0101 NEQ2 JMP2?	
455
+		( do not draw size in toolbar )
456
+		,$outside-canvas
457
+		~Mouse.x CLN2r ~toolbar.x1 GTH2 STH2r ~toolbar.x2 LTH2 #0101 EQU2 
458
+		~Mouse.y CLN2r ~toolbar.y1 GTH2 STH2r ~toolbar.y2 LTH2 #0101 EQU2 
459
+		#0101 EQU2 JMP2?
460
+		( do not draw size when holding alt )
440 461
 		,$outside-canvas ~Controller #02 EQU JMP2?
441 462
 		~cursor.x #0003 SUB2 =Sprite.x
442 463
 		~cursor.y #0003 SUB2 =Sprite.y
... ...
@@ -613,7 +634,7 @@ RTN
613 634
 @save_icn       [ fe82 8282 848a f400 ]
614 635
 
615 636
 @blank_icn      [ 0000 0000 0000 0000 ]
616
-@filepath       [ projects/picture2a1a.bit 00 ]
637
+@filepath       [ projects/pictures/tima2a1a.bit 00 ]
617 638
 
618 639
 @font_hex ( 0-F ) 
619 640
 [
... ...
@@ -641,4 +662,4 @@ RTN
641 662
 |FF60 ;File { pad 8 name 2 length 2 load 2 save 2 }
642 663
 
643 664
 |FFF0 .RESET .FRAME .ERROR ( vectors )
644
-|FFF8 [ d0ef d03f d03f ]   ( palette )
645 665
\ No newline at end of file
666
+|FFF8 [ f07c f0e2 f0c2 ]   ( palette )
646 667
\ No newline at end of file