neauoire authored on 04/02/2021 23:38:04
Showing 2 changed files
... ...
@@ -26,22 +26,20 @@ cc uxn.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o uxn
26 26
 - `( comment )`
27 27
 
28 28
 ```
29
-( comment )
29
+;value ( alloc zero-page variable )
30 30
 
31
-;variable1
32
-;variable2
33
-;variable3
31
+@0010 ( start at page 1 )
34 32
 
35
-.there ( 0a 05 GTH ) JMC
33
+,there [ ,0a ,05 GTH ] JMC
36 34
 
37 35
 :here
38
-	< when not equal >
39
-	ee
36
+	( when not equal )
37
+	,ee
40 38
 	BRK
41 39
 
42 40
 :there
43
-	< when is equal >
44
-	ff
41
+	( when is equal )
42
+	,ff
45 43
 	BRK
46 44
 ```
47 45
 
... ...
@@ -49,7 +47,6 @@ cc uxn.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o uxn
49 47
 
50 48
 ### Assembler
51 49
 
52
-- Crash on missing label
53 50
 - Catch overflow/underflow
54 51
 - Constants
55 52
 - Jumps should be relative
... ...
@@ -58,20 +55,12 @@ cc uxn.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o uxn
58 55
 
59 56
 - Pointers/Literals
60 57
 - A Three-Way Decision Routine(http://www.6502.org/tutorials/compare_instructions.html)
61
-- Carry flag?
62 58
 - Print word to stdout
63 59
 - Draw pixel to screen
64 60
 - Detect mouse click
65 61
 - SDL Layer Emulator
66 62
 - Build PPU
67
-- Interrupts, vectors
68
-
69
-### 16 Bit Missions
70
-
71
-- 16 bits addressing
72
-- jumping to subroutine should be relative
73
-- Implement addressing
74
-- Implement 16 bits operations
63
+- Add flags..
75 64
 
76 65
 ## Refs
77 66
 
... ...
@@ -165,7 +165,7 @@ error(char *name)
165 165
 }
166 166
 
167 167
 int
168
-eval()
168
+eval(void)
169 169
 {
170 170
 	Uint8 instr = cpu.rom.dat[cpu.rom.ptr++];
171 171
 	if(cpu.literal > 0) {
... ...
@@ -197,7 +197,13 @@ start(FILE *f)
197 197
 	cpu.vreset = mempoke16(0xfffa);
198 198
 	cpu.vframe = mempoke16(0xfffc);
199 199
 	cpu.verror = mempoke16(0xfffe);
200
-	while(!(cpu.status & FLAG_HALT) && eval(cpu))
200
+	/* eval reset */
201
+	cpu.rom.ptr = cpu.vreset;
202
+	while(!(cpu.status & FLAG_HALT) && eval())
203
+		;
204
+	/*eval frame */
205
+	cpu.rom.ptr = cpu.vframe;
206
+	while(!(cpu.status & FLAG_HALT) && eval())
201 207
 		;
202 208
 	/* debug */
203 209
 	printf("ended @ %d steps | ", cpu.counter);