Browse code

Merged sandwich

neauoire authored on 21/04/2021 00:11:02
Showing 20 changed files
... ...
@@ -22,17 +22,11 @@ To build the Uxn emulator, you must have [SDL2](https://wiki.libsdl.org/).
22 22
 Read more in the [Uxambly Guide](https://wiki.xxiivv.com/site/uxambly.html).
23 23
 
24 24
 ```
25
-( Dev/Console )
26
-
27 25
 %RTN { JMP2r }
28 26
 
29
-( devices )
30
-
31
-|0110 @Console    [ &pad $8 &char $1 ]
32
-
33 27
 ( program )
34 28
 
35
-|0200
29
+|0100
36 30
 	
37 31
 	;hello-word ;print JSR2
38 32
 	
... ...
@@ -50,6 +44,9 @@ RTN
50 44
 
51 45
 @hello-word [ 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 ]
52 46
 
47
+( devices )
48
+
49
+|ff10 @Console    [ &pad $8 &char $1 ]
53 50
 ```
54 51
 
55 52
 ## TODOs
... ...
@@ -32,7 +32,7 @@ else
32 32
 fi
33 33
 
34 34
 echo "Assembling.."
35
-./bin/assembler projects/examples/dev.console.usm bin/boot.rom
35
+./bin/assembler projects/examples/dev.controller.buttons.usm bin/boot.rom
36 36
 
37 37
 echo "Running.."
38 38
 if [ "${2}" = '--cli' ]; 
... ...
@@ -22,9 +22,6 @@ contexts:
22 22
       scope: variable.control
23 23
       pop: true
24 24
     # constants
25
-    - match: '\:(\S+)\s?'
26
-      scope: string.control
27
-      pop: true
28 25
     # structs
29 26
 
30 27
     # Special
... ...
@@ -49,6 +46,9 @@ contexts:
49 46
     - match: '\;(\S+)\s?'     # absolute
50 47
       scope: keyword.control
51 48
       pop: true
49
+    - match: '\:(\S+)\s?'     # raw
50
+      scope: keyword.control
51
+      pop: true
52 52
 
53 53
     - match: '\[\s?'
54 54
       scope: comment
55 55
similarity index 100%
56 56
rename from projects/examples/dev.audio.usm
57 57
rename to projects/examples/dev.audio-old.usm
... ...
@@ -25,4 +25,3 @@ RTN
25 25
 ( devices )
26 26
 
27 27
 |ff10 @Console    [ &pad $8 &char $1 ]
28
-
... ...
@@ -84,4 +84,3 @@ BRK
84 84
 |ff10 @Console    [ &pad    $8 &char   $1 &byte   $1 &short $2 &string $2 ]
85 85
 |ff20 @Screen     [ &vector $2 &width  $2 &height $2 &pad   $2 &x      $2 &y $2 &addr $2 &color $1 ]
86 86
 |ff40 @Controller [ &vector $2 &button $1 &key    $1 ]
87
-
88 87
similarity index 100%
89 88
rename from projects/examples/dev.controller.keys.usm
90 89
rename to projects/examples/dev.controller.keys-old.usm
91 90
similarity index 100%
92 91
rename from projects/examples/dev.file.usm
93 92
rename to projects/examples/dev.file-old.usm
94 93
similarity index 100%
95 94
rename from projects/examples/dev.mouse.usm
96 95
rename to projects/examples/dev.mouse-old.usm
97 96
similarity index 100%
98 97
rename from projects/examples/dev.screen.usm
99 98
rename to projects/examples/dev.screen-old.usm
100 99
similarity index 100%
101 100
rename from projects/examples/dev.time.usm
102 101
rename to projects/examples/dev.time-old.usm
103 102
similarity index 100%
104 103
rename from projects/examples/gui.animation.usm
105 104
rename to projects/examples/gui.animation-old.usm
106 105
similarity index 100%
107 106
rename from projects/examples/gui.hover.usm
108 107
rename to projects/examples/gui.hover-old.usm
109 108
similarity index 100%
110 109
rename from projects/examples/gui.label.usm
111 110
rename to projects/examples/gui.label-old.usm
112 111
similarity index 100%
113 112
rename from projects/examples/gui.picture.usm
114 113
rename to projects/examples/gui.picture-old.usm
115 114
similarity index 100%
116 115
rename from projects/examples/gui.shapes.usm
117 116
rename to projects/examples/gui.shapes-old.usm
118 117
similarity index 100%
119 118
rename from projects/examples/gui.wallpaper.usm
120 119
rename to projects/examples/gui.wallpaper-old.usm
... ...
@@ -185,6 +185,7 @@ Uint8
185 185
 system_poke(Uxn *u, Uint8 *m, Uint8 b0, Uint8 b1)
186 186
 {
187 187
 	getcolors(&ppu, &m[0x8]);
188
+	printf("%02x%02x %02x%02x %02x%02x\n", m[0x8], m[0x9], m[0xa], m[0xb], m[0xc], m[0xd]);
188 189
 	reqdraw = 1;
189 190
 	(void)u;
190 191
 	(void)b0;
... ...
@@ -21,7 +21,7 @@ Uint8  pop8(Stack *s) { if (s->ptr == 0) { s->error = 1; return 0; } return s->d
21 21
 Uint8  peek8(Stack *s, Uint8 a) { if (s->ptr < a + 1) s->error = 1; return s->dat[s->ptr - a - 1]; }
22 22
 void   mempoke8(Uxn *u, Uint16 a, Uint8 b) { u->ram.dat[a] = b; }
23 23
 Uint8  mempeek8(Uxn *u, Uint16 a) { return u->ram.dat[a]; }
24
-void   devpoke8(Uxn *u, Uint8 a, Uint8 b) { Device *dev = &u->dev[a >> 4]; dev->dat[a & 0xf] = dev->poke(u, dev->dat, a & 0x0f, b); }
24
+void   devpoke8(Uxn *u, Uint8 a, Uint8 b) { Device *dev = &u->dev[a >> 4]; dev->dat[a & 0xf] = b; dev->poke(u, dev->dat, a & 0x0f, b); }
25 25
 Uint8  devpeek8(Uxn *u, Uint8 a) { return u->dev[a >> 4].dat[a & 0xf]; }
26 26
 void   push16(Stack *s, Uint16 a) { push8(s, a >> 8); push8(s, a); }
27 27
 Uint16 pop16(Stack *s) { return pop8(s) + (pop8(s) << 8); }
... ...
@@ -17,7 +17,6 @@ typedef unsigned short Uint16;
17 17
 typedef signed short Sint16;
18 18
 
19 19
 #define PAGE_PROGRAM 0x0100
20
-#define LOAD_OFFSET 0x0100
21 20
 
22 21
 #define genpeek16(ptr, i) ((ptr[i] << 8) + ptr[i + 1])
23 22
 #define genpoke16(ptr, i, v) \