... | ... |
@@ -29,11 +29,11 @@ evaluxn(u, u->vframe); /* Each frame |
29 | 29 |
- `;variable 2`, assign an address to a label automatically. |
30 | 30 |
- `:const 1a2b`, assign an address to a label manually. |
31 | 31 |
- `¯o { x 2 y 2 }`, define a macro named `macro`. |
32 |
+- `.address`, push label address to memory. |
|
33 |
+- `,literal`, push label address to stack, prefixed with `LIT LEN`. |
|
32 | 34 |
- `#1a`, a literal byte/short. |
33 | 35 |
- `+1a`, a literal signed byte/short. |
34 | 36 |
- `-1a`, a literal signed byte/short(negative). |
35 |
-- `.ab`, a raw byte/short in memory. |
|
36 |
-- `,literal`, push label address to stack, prefixed with `LIT LEN`. |
|
37 | 37 |
- `=label`, helper to STR, equivalent to `,label STR`, or `label STR2`. |
38 | 38 |
- `~label`, helper to LDR, equivalent to `,label LDR2`, or `,label LDR2`. |
39 | 39 |
- `|0010`, move to position in the program. |
... | ... |
@@ -55,30 +55,30 @@ evaluxn(u, u->vframe); /* Each frame |
55 | 55 |
|
56 | 56 |
|0100 @RESET |
57 | 57 |
|
58 |
- ,text1 ,print-label JSR |
|
59 |
- ,text2 ,print-label JSR |
|
60 |
- #ab =dev/console.byte |
|
61 |
- #cdef =dev/console.short |
|
58 |
+ ,text1 ,print-label JSR2 |
|
59 |
+ ,text2 ,print-label JSR2 |
|
60 |
+ #ab =CNSL.byte |
|
61 |
+ #cdef =CNSL.short |
|
62 | 62 |
|
63 | 63 |
BRK |
64 | 64 |
|
65 | 65 |
@print-label ( text ) |
66 |
- |
|
67 |
- @print-label-loop |
|
68 |
- DUP2 LDR =dev/console.char ( write pointer value to console ) |
|
69 |
- #0001 ADD2 ( increment string pointer ) |
|
70 |
- DUP2 LDR #00 NEQ ,print-label-loop ROT JMP? POP2 ( while *ptr!=0 goto loop ) |
|
66 |
+ |
|
67 |
+ @print-label-loop NOP |
|
68 |
+ ( send ) DUP2 LDR =CNSL.char |
|
69 |
+ ( incr ) #0001 ADD2 |
|
70 |
+ DUP2 LDR #00 NEQ ^print-label-loop MUL JMPS |
|
71 | 71 |
POP2 |
72 | 72 |
|
73 | 73 |
RTS |
74 | 74 |
|
75 |
-@text1 [ Hello World 0a00 ] ( store text with a linebreak and null byte ) |
|
76 |
-@text2 [ Welcome to UxnVM 0a00 ] |
|
75 |
+@text1 [ Hello 20 World 0a00 ] ( store text with a linebreak and null byte ) |
|
76 |
+@text2 [ Welcome 20 to 20 UxnVM 0a00 ] |
|
77 | 77 |
|
78 | 78 |
|c000 @FRAME |
79 | 79 |
|d000 @ERROR |
80 | 80 |
|
81 |
-|FF00 ;dev/console Console |
|
81 |
+|FF00 ;CNSL Console |
|
82 | 82 |
|
83 | 83 |
|FFF0 .RESET .FRAME .ERROR ( vectors ) |
84 | 84 |
|FFF8 [ 13fd 1ef3 1bf2 ] ( palette ) |
... | ... |
@@ -99,6 +99,16 @@ RTS |
99 | 99 |
- Local loops |
100 | 100 |
- Jump helpers |
101 | 101 |
|
102 |
+NOTE: OPCODES should not be relative, but there should be a relative accessor for addresses, like: |
|
103 |
+ |
|
104 |
+$relative_name JMP |
|
105 |
+ |
|
106 |
+## Notes |
|
107 |
+ |
|
108 |
+### Conditional Jumping |
|
109 |
+ |
|
110 |
+I've considered automatically popping an amount of items from the stack equal to the offset between the opcode's push/pop to make the stack length more predictable, and making the pattern JMP? POP2 unecessary, but that idea would make DUP? unusable. That change was reverted. |
|
111 |
+ |
|
102 | 112 |
## Palettes |
103 | 113 |
|
104 | 114 |
- `[ 6a03 4a0d aa0c ]`, purple/cyan |
... | ... |
@@ -184,7 +184,7 @@ makemacro(char *name, FILE *f) |
184 | 184 |
char wv[64]; |
185 | 185 |
if(findmacro(name)) |
186 | 186 |
return error("Macro duplicate", name); |
187 |
- if(sihx(name)) |
|
187 |
+ if(sihx(name) && slen(name) % 2 == 0) |
|
188 | 188 |
return error("Macro name is hex number", name); |
189 | 189 |
if(findopcode(name)) |
190 | 190 |
return error("Macro name is invalid", name); |
... | ... |
@@ -214,7 +214,7 @@ makelabel(char *name, Uint16 addr, Uint8 len, Macro *m) |
214 | 214 |
Label *l; |
215 | 215 |
if(findlabel(name)) |
216 | 216 |
return error("Label duplicate", name); |
217 |
- if(sihx(name)) |
|
217 |
+ if(sihx(name) && slen(name) % 2 == 0) |
|
218 | 218 |
return error("Label name is hex number", name); |
219 | 219 |
if(findopcode(name)) |
220 | 220 |
return error("Label name is invalid", name); |
... | ... |
@@ -309,9 +309,10 @@ pass1(FILE *f) |
309 | 309 |
case '=': addr += 4; break; /* STR helper (lit addr-hb addr-lb str) */ |
310 | 310 |
case '~': addr += 4; break; /* LDR helper (lit addr-hb addr-lb ldr) */ |
311 | 311 |
case ',': addr += 3; break; |
312 |
- case '.': addr += (slen(w + 1) == 2 ? 1 : 2); break; |
|
313 |
- case '+': /* signed positive */ |
|
314 |
- case '-': /* signed negative */ |
|
312 |
+ case '.': addr += 2; break; |
|
313 |
+ case '^': addr += 2; break; /* Relative jump: lit addr-offset */ |
|
314 |
+ case '+': /* signed positive */ |
|
315 |
+ case '-': /* signed negative */ |
|
315 | 316 |
case '#': addr += (slen(w + 1) == 2 ? 2 : 3); break; |
316 | 317 |
default: return error("Unknown label in first pass", w); |
317 | 318 |
} |
... | ... |
@@ -343,21 +344,24 @@ pass2(FILE *f) |
343 | 344 |
} |
344 | 345 |
else if(w[0] == '|') p.ptr = shex(w + 1); |
345 | 346 |
else if((op = findopcode(w)) || scmp(w, "BRK", 4)) pushbyte(op, 0); |
347 |
+ else if(w[0] == '^' && (l = findlabel(w + 1))) { |
|
348 |
+ int off = l->addr - p.ptr - 3; |
|
349 |
+ if(off < -126 || off > 126){ printf("Address %s is too far(%d).\n", w, off); return 0; } |
|
350 |
+ printf("relative %s[%d]\n", w, l->addr - p.ptr - 4); |
|
351 |
+ pushbyte((Sint8)(l->addr - p.ptr - 3), 1); l->refs++; |
|
352 |
+ } |
|
346 | 353 |
else if(w[0] == ':') fscanf(f, "%s", w); |
347 | 354 |
else if(w[0] == ';') fscanf(f, "%s", w); |
348 |
- else if(w[0] == '.' && sihx(w + 1) && slen(w + 1) == 2) pushbyte(shex(w + 1), 0); |
|
349 |
- else if(w[0] == '.' && sihx(w + 1) && slen(w + 1) == 4) pushshort(shex(w + 1), 0); |
|
355 |
+ else if(w[0] == '.' && (l = findlabel(w + 1))) { pushshort(findlabeladdr(w + 1), 0); l->refs++; } |
|
356 |
+ else if(w[0] == ',' && (l = findlabel(w + 1))) { pushshort(findlabeladdr(w + 1), 1); l->refs++; } |
|
357 |
+ else if(w[0] == '=' && (l = findlabel(w + 1)) && l->len){ pushshort(findlabeladdr(w + 1), 1); pushbyte(findopcode(findlabellen(w+1) == 2 ? "STR2" : "STR"), 0); l->refs++;} |
|
358 |
+ else if(w[0] == '~' && (l = findlabel(w + 1)) && l->len){ pushshort(findlabeladdr(w + 1), 1); pushbyte(findopcode(findlabellen(w+1) == 2 ? "LDR2" : "LDR"), 0); l->refs++;} |
|
350 | 359 |
else if(w[0] == '#' && sihx(w + 1) && slen(w + 1) == 2) pushbyte(shex(w + 1), 1); |
351 | 360 |
else if(w[0] == '#' && sihx(w + 1) && slen(w + 1) == 4) pushshort(shex(w + 1), 1); |
352 | 361 |
else if(w[0] == '+' && sihx(w + 1) && slen(w + 1) == 2) pushbyte((Sint8)shex(w + 1), 1); |
353 | 362 |
else if(w[0] == '+' && sihx(w + 1) && slen(w + 1) == 4) pushshort((Sint16)shex(w + 1), 1); |
354 | 363 |
else if(w[0] == '-' && sihx(w + 1) && slen(w + 1) == 2) pushbyte((Sint8)(shex(w + 1) * -1), 1); |
355 | 364 |
else if(w[0] == '-' && sihx(w + 1) && slen(w + 1) == 4) pushshort((Sint16)(shex(w + 1) * -1), 1); |
356 |
- else if(w[0] == '=' && (l = findlabel(w + 1)) && l->len){ pushshort(findlabeladdr(w+1), 1); pushbyte(findopcode(findlabellen(w+1) == 2 ? "STR2" : "STR"), 0); l->refs++;} |
|
357 |
- else if(w[0] == '~' && (l = findlabel(w + 1)) && l->len){ pushshort(findlabeladdr(w+1), 1); pushbyte(findopcode(findlabellen(w+1) == 2 ? "LDR2" : "LDR"), 0); l->refs++;} |
|
358 |
- else if(w[0] == '=' && sihx(w + 1)) { pushshort(shex(w + 1), 1); pushbyte(findopcode("STR2"), 0); } |
|
359 |
- else if(w[0] == '~' && sihx(w + 1)) { pushshort(shex(w + 1), 1); pushbyte(findopcode("LDR2"), 0); } |
|
360 |
- else if((l = findlabel(w + 1))) { pushshort(findlabeladdr(w+1), w[0] == ','); l->refs++; } |
|
361 | 365 |
else return error("Unknown label in second pass", w); |
362 | 366 |
/* clang-format on */ |
363 | 367 |
} |
... | ... |
@@ -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/left.usm bin/boot.rom |
|
24 | 24 |
./bin/emulator bin/boot.rom |
... | ... |
@@ -310,8 +310,10 @@ doctrl(Uxn *u, SDL_Event *event, int z) |
310 | 310 |
{ |
311 | 311 |
Uint8 flag = 0x00; |
312 | 312 |
Uint16 addr = devctrl->addr; |
313 |
- if(z && event->key.keysym.sym == SDLK_h && SDL_GetModState() & KMOD_LCTRL) |
|
313 |
+ if(z && event->key.keysym.sym == SDLK_h && SDL_GetModState() & KMOD_LCTRL) { |
|
314 | 314 |
GUIDES = !GUIDES; |
315 |
+ redraw(pixels, u); |
|
316 |
+ } |
|
315 | 317 |
switch(event->key.keysym.sym) { |
316 | 318 |
case SDLK_LCTRL: flag = 0x01; break; |
317 | 319 |
case SDLK_LALT: flag = 0x02; break; |
... | ... |
@@ -45,16 +45,15 @@ contexts: |
45 | 45 |
- match: '\,(\S+)\s?' |
46 | 46 |
scope: keyword.control |
47 | 47 |
pop: true |
48 |
- - match: '\#(\S+)\s?' |
|
48 |
+ - match: '\.(\S+)\s?' |
|
49 | 49 |
scope: keyword.control |
50 | 50 |
pop: true |
51 |
- - match: '\.(\S+)\s?' |
|
51 |
+ - match: '\^(\S+)\s?' |
|
52 |
+ scope: keyword.control |
|
53 |
+ pop: true |
|
54 |
+ - match: '\#(\S+)\s?' |
|
52 | 55 |
scope: keyword.control |
53 |
- - match: '\+(\S+)\s?' |
|
54 |
- scope: string.control |
|
55 | 56 |
pop: true |
56 |
- - match: '\-(\S+)\s?' |
|
57 |
- scope: string.control |
|
58 | 57 |
|
59 | 58 |
# Blocks |
60 | 59 |
|
... | ... |
@@ -6,17 +6,17 @@ |
6 | 6 |
|
7 | 7 |
,text1 ,print-label JSR2 |
8 | 8 |
,text2 ,print-label JSR2 |
9 |
- #ab =dev/console.byte |
|
10 |
- #cdef =dev/console.short |
|
9 |
+ #ab =CNSL.byte |
|
10 |
+ #cdef =CNSL.short |
|
11 | 11 |
|
12 | 12 |
BRK |
13 | 13 |
|
14 | 14 |
@print-label ( text ) |
15 |
- |
|
16 |
- @print-label-loop |
|
17 |
- DUP2 LDR =dev/console.char ( write pointer value to console ) |
|
18 |
- #0001 ADD2 ( increment string pointer ) |
|
19 |
- DUP2 LDR #00 NEQ ,print-label-loop ROT JMP2? POP2 ( while *ptr!=0 goto loop ) |
|
15 |
+ |
|
16 |
+ @print-label-loop NOP |
|
17 |
+ ( send ) DUP2 LDR =CNSL.char |
|
18 |
+ ( incr ) #0001 ADD2 |
|
19 |
+ DUP2 LDR #00 NEQ ^print-label-loop MUL JMPS |
|
20 | 20 |
POP2 |
21 | 21 |
|
22 | 22 |
RTS |
... | ... |
@@ -27,7 +27,7 @@ RTS |
27 | 27 |
|c000 @FRAME |
28 | 28 |
|d000 @ERROR |
29 | 29 |
|
30 |
-|FF00 ;dev/console Console |
|
30 |
+|FF00 ;CNSL Console |
|
31 | 31 |
|
32 | 32 |
|FFF0 .RESET .FRAME .ERROR ( vectors ) |
33 | 33 |
|FFF8 [ 13fd 1ef3 1bf2 ] ( palette ) |
34 | 34 |
\ No newline at end of file |
... | ... |
@@ -45,7 +45,7 @@ |
45 | 45 |
,filepath ,load-file JSR2 |
46 | 46 |
|
47 | 47 |
( place textarea ) |
48 |
- #0018 =textarea.x1 ~dev/screen.height #0008 SUB2 =textarea.y2 |
|
48 |
+ #0018 =textarea.x1 ~SCRN.height #0008 SUB2 =textarea.y2 |
|
49 | 49 |
|
50 | 50 |
,select JSR2 |
51 | 51 |
,redraw JSR2 |
... | ... |
@@ -56,62 +56,62 @@ BRK |
56 | 56 |
|
57 | 57 |
( ctrl ) |
58 | 58 |
|
59 |
- ,ctrl-end ~dev/ctrl #00 EQU ~lock #00 NEQ #0000 NEQ2 JMP2? POP2 |
|
59 |
+ ,ctrl-end ~CTRL #00 EQU ~lock #00 NEQ #0000 NEQ2 JMP2? POP2 |
|
60 | 60 |
( lock ) #04 =lock |
61 |
- ,no-ctrl-up ~dev/ctrl #10 NEQ JMP2? POP2 |
|
61 |
+ ,no-ctrl-up ~CTRL #10 NEQ JMP2? POP2 |
|
62 | 62 |
( clamp ) ,no-ctrl-up ~position.y #0000 EQU2 JMP2? POP2 |
63 | 63 |
,find-lineoffset JSR2 =position.x |
64 | 64 |
~position.y #0001 SUB2 =position.y |
65 | 65 |
,find-selection JSR2 DUP2 =selection.from #0001 ADD2 =selection.to |
66 | 66 |
,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
67 | 67 |
@no-ctrl-up |
68 |
- ,no-ctrl-down ~dev/ctrl #20 NEQ JMP2? POP2 |
|
68 |
+ ,no-ctrl-down ~CTRL #20 NEQ JMP2? POP2 |
|
69 | 69 |
,find-lineoffset JSR2 =position.x ~position.y #0001 ADD2 =position.y |
70 | 70 |
,find-selection JSR2 DUP2 =selection.from #0001 ADD2 =selection.to |
71 | 71 |
,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
72 | 72 |
@no-ctrl-down |
73 |
- ,no-ctrl-left ~dev/ctrl #40 NEQ JMP2? POP2 |
|
73 |
+ ,no-ctrl-left ~CTRL #40 NEQ JMP2? POP2 |
|
74 | 74 |
( clamp ) ,no-ctrl-left ~selection.from ,document.body EQU2 JMP2? POP2 |
75 | 75 |
~selection.from #0001 SUB2 DUP2 =selection.from #0001 ADD2 =selection.to |
76 | 76 |
,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
77 | 77 |
@no-ctrl-left |
78 |
- ,no-ctrl-right ~dev/ctrl #80 NEQ JMP2? POP2 |
|
78 |
+ ,no-ctrl-right ~CTRL #80 NEQ JMP2? POP2 |
|
79 | 79 |
~selection.from #0001 ADD2 DUP2 =selection.from #0001 ADD2 =selection.to |
80 | 80 |
,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
81 | 81 |
@no-ctrl-right |
82 | 82 |
( alt ) |
83 |
- ,no-alt ~dev/ctrl #0f AND #02 NEQ JMP2? POP2 |
|
84 |
- ,no-aup ~dev/ctrl #04 ROR #01 NEQ JMP2? POP2 |
|
83 |
+ ,no-alt ~CTRL #0f AND #02 NEQ JMP2? POP2 |
|
84 |
+ ,no-aup ~CTRL #04 ROR #01 NEQ JMP2? POP2 |
|
85 | 85 |
,find-wordstart JSR2 =selection.to |
86 | 86 |
,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
87 | 87 |
@no-aup |
88 |
- ,no-adown ~dev/ctrl #04 ROR #02 NEQ JMP2? POP2 |
|
88 |
+ ,no-adown ~CTRL #04 ROR #02 NEQ JMP2? POP2 |
|
89 | 89 |
,find-wordend JSR2 =selection.to |
90 | 90 |
,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
91 | 91 |
@no-adown |
92 |
- ,no-aleft ~dev/ctrl #04 ROR #04 NEQ JMP2? POP2 |
|
92 |
+ ,no-aleft ~CTRL #04 ROR #04 NEQ JMP2? POP2 |
|
93 | 93 |
~selection.to #0001 SUB2 =selection.to |
94 | 94 |
,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
95 | 95 |
@no-aleft |
96 |
- ,no-aright ~dev/ctrl #04 ROR #08 NEQ JMP2? POP2 |
|
96 |
+ ,no-aright ~CTRL #04 ROR #08 NEQ JMP2? POP2 |
|
97 | 97 |
~selection.to #0001 ADD2 =selection.to |
98 | 98 |
,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
99 | 99 |
@no-aright |
100 | 100 |
@no-alt |
101 | 101 |
( ctrl ) |
102 |
- ,no-ctrl ~dev/ctrl #0f AND #01 NEQ JMP2? POP2 |
|
103 |
- ,no-cup ~dev/ctrl #04 ROR #01 NEQ JMP2? POP2 |
|
102 |
+ ,no-ctrl ~CTRL #0f AND #01 NEQ JMP2? POP2 |
|
103 |
+ ,no-cup ~CTRL #04 ROR #01 NEQ JMP2? POP2 |
|
104 | 104 |
~scroll.y #0004 SUB2 =scroll.y |
105 | 105 |
,redraw JSR2 ,ctrl-end JMP2 |
106 | 106 |
@no-cup |
107 |
- ,no-cdown ~dev/ctrl #04 ROR #02 NEQ JMP2? POP2 |
|
107 |
+ ,no-cdown ~CTRL #04 ROR #02 NEQ JMP2? POP2 |
|
108 | 108 |
~scroll.y #0004 ADD2 =scroll.y |
109 | 109 |
,redraw JSR2 ,ctrl-end JMP2 |
110 | 110 |
@no-cdown |
111 |
- ,no-cleft ~dev/ctrl #04 ROR #04 NEQ JMP2? POP2 |
|
111 |
+ ,no-cleft ~CTRL #04 ROR #04 NEQ JMP2? POP2 |
|
112 | 112 |
,goto-linestart JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
113 | 113 |
@no-cleft |
114 |
- ,no-cright ~dev/ctrl #04 ROR #08 NEQ JMP2? POP2 |
|
114 |
+ ,no-cright ~CTRL #04 ROR #08 NEQ JMP2? POP2 |
|
115 | 115 |
,goto-lineend JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
116 | 116 |
@no-cright |
117 | 117 |
@no-ctrl |
... | ... |
@@ -120,39 +120,39 @@ BRK |
120 | 120 |
|
121 | 121 |
( keys ) |
122 | 122 |
|
123 |
- ,keys-end ~dev/key #00 EQU JMP2? POP2 |
|
123 |
+ ,keys-end ~KEYS #00 EQU JMP2? POP2 |
|
124 | 124 |
|
125 |
- ,no-backspace ~dev/key #08 NEQ JMP2? POP2 |
|
125 |
+ ,no-backspace ~KEYS #08 NEQ JMP2? POP2 |
|
126 | 126 |
( erase ) |
127 | 127 |
~selection.to ~selection.from SUB2 ,shift-left JSR2 |
128 | 128 |
~selection.from #0001 SUB2 =selection.from |
129 | 129 |
~selection.from #0001 ADD2 =selection.to |
130 |
- ( release ) #00 =dev/key |
|
130 |
+ ( release ) #00 =KEYS |
|
131 | 131 |
,redraw JSR2 |
132 | 132 |
,keys-end JMP2 |
133 | 133 |
@no-backspace |
134 | 134 |
|
135 | 135 |
( insert ) |
136 | 136 |
~selection.to ~selection.from SUB2 ,shift-right JSR2 |
137 |
- ~dev/key ~selection.from STR |
|
137 |
+ ~KEYS ~selection.from STR |
|
138 | 138 |
~selection.from #0001 ADD2 =selection.from |
139 | 139 |
~selection.from #0001 ADD2 =selection.to |
140 |
- ( release ) #00 =dev/key |
|
140 |
+ ( release ) #00 =KEYS |
|
141 | 141 |
,redraw JSR2 |
142 | 142 |
|
143 | 143 |
@keys-end |
144 | 144 |
|
145 | 145 |
( mouse ) |
146 | 146 |
|
147 |
- ,touch-end ~dev/mouse.state #00 EQU JMP2? POP2 |
|
147 |
+ ,touch-end ~MOUS.state #00 EQU JMP2? POP2 |
|
148 | 148 |
|
149 |
- ,touch-linebar ~dev/mouse.x #0010 LTH2 JMP2? POP2 |
|
150 |
- ,touch-body ~dev/mouse.x ~dev/screen.width #0008 SUB2 LTH2 JMP2? POP2 |
|
149 |
+ ,touch-linebar ~MOUS.x #0010 LTH2 JMP2? POP2 |
|
150 |
+ ,touch-body ~MOUS.x ~SCRN.width #0008 SUB2 LTH2 JMP2? POP2 |
|
151 | 151 |
,touch-scrollbar JMP2 |
152 | 152 |
|
153 | 153 |
@touch-end |
154 | 154 |
|
155 |
- ~dev/mouse.state =touch.state |
|
155 |
+ ~MOUS.state =touch.state |
|
156 | 156 |
|
157 | 157 |
( unlock ) ,skip-unlock ~lock #00 EQU JMP2? POP2 ~lock #01 SUB =lock @skip-unlock |
158 | 158 |
|
... | ... |
@@ -162,15 +162,15 @@ BRK |
162 | 162 |
|
163 | 163 |
@touch-scrollbar |
164 | 164 |
|
165 |
- ,no-click-scroll-up ~dev/mouse.y #0008 GTH2 JMP2? POP2 |
|
165 |
+ ,no-click-scroll-up ~MOUS.y #0008 GTH2 JMP2? POP2 |
|
166 | 166 |
( decr ) ~scroll.y #00 ~scroll.y #0000 NEQ2 SUB2 =scroll.y |
167 | 167 |
,redraw JSR2 ,touch-end JMP2 |
168 | 168 |
@no-click-scroll-up |
169 |
- ,no-click-scroll-down ~dev/mouse.y ~dev/screen.height #0008 SUB2 LTH2 JMP2? POP2 |
|
169 |
+ ,no-click-scroll-down ~MOUS.y ~SCRN.height #0008 SUB2 LTH2 JMP2? POP2 |
|
170 | 170 |
( incr ) ~scroll.y #0001 ADD2 =scroll.y |
171 | 171 |
,redraw JSR2 ,touch-end JMP2 |
172 | 172 |
@no-click-scroll-down |
173 |
- ~dev/mouse.y #0008 SUB2 =scroll.y |
|
173 |
+ ~MOUS.y #0008 SUB2 =scroll.y |
|
174 | 174 |
,redraw JSR2 |
175 | 175 |
,touch-end JMP2 |
176 | 176 |
|
... | ... |
@@ -178,7 +178,7 @@ RTS |
178 | 178 |
|
179 | 179 |
@touch-linebar |
180 | 180 |
|
181 |
- ~dev/mouse.y #0008 DIV2 ~scroll.y ADD2 =position.y #0000 =position.x |
|
181 |
+ ~MOUS.y #0008 DIV2 ~scroll.y ADD2 =position.y #0000 =position.x |
|
182 | 182 |
,find-selection JSR2 DUP2 =selection.from #0001 ADD2 =selection.to |
183 | 183 |
,redraw JSR2 |
184 | 184 |
,touch-end JMP2 |
... | ... |
@@ -187,10 +187,10 @@ RTS |
187 | 187 |
|
188 | 188 |
@touch-body |
189 | 189 |
|
190 |
- ~dev/mouse.y #0008 DIV2 ~scroll.y ADD2 =position.y |
|
191 |
- ~dev/mouse.x ~textarea.x1 SUB2 #0007 ADD2 #0007 DIV2 =position.x |
|
190 |
+ ~MOUS.y #0008 DIV2 ~scroll.y ADD2 =position.y |
|
191 |
+ ~MOUS.x ~textarea.x1 SUB2 #0007 ADD2 #0007 DIV2 =position.x |
|
192 | 192 |
|
193 |
- ,touch-when ~dev/mouse.state ~touch.state NEQ ~dev/ctrl #0f AND #02 NEQ #0101 EQU2 JMP2? POP2 |
|
193 |
+ ,touch-when ~MOUS.state ~touch.state NEQ ~CTRL #0f AND #02 NEQ #0101 EQU2 JMP2? POP2 |
|
194 | 194 |
( on drag ) |
195 | 195 |
,find-selection JSR2 #0001 ADD2 =selection.to |
196 | 196 |
,clamp-selection JSR2 |
... | ... |
@@ -207,7 +207,7 @@ RTS |
207 | 207 |
|
208 | 208 |
@load-file ( path ) |
209 | 209 |
|
210 |
- =dev/file.name #8000 =dev/file.length ,document.body =dev/file.load |
|
210 |
+ =FILE.name #8000 =FILE.length ,document.body =FILE.load |
|
211 | 211 |
|
212 | 212 |
( get file length ) |
213 | 213 |
,document.body =document.eof |
... | ... |
@@ -379,75 +379,75 @@ RTS |
379 | 379 |
|
380 | 380 |
( save/load icons ) |
381 | 381 |
|
382 |
- ~dev/screen.height #0008 SUB2 =dev/sprite.y |
|
382 |
+ ~SCRN.height #0008 SUB2 =SPRT.y |
|
383 | 383 |
|
384 |
- ~dev/screen.width #0018 SUB2 =dev/sprite.x |
|
385 |
- ,load_icn =dev/sprite.addr |
|
386 |
- #02 =dev/sprite.color |
|
384 |
+ ~SCRN.width #0018 SUB2 =SPRT.x |
|
385 |
+ ,load_icn =SPRT.addr |
|
386 |
+ #02 =SPRT.color |
|
387 | 387 |
|
388 |
- ~dev/screen.width #0010 SUB2 =dev/sprite.x |
|
389 |
- ,save_icn =dev/sprite.addr |
|
390 |
- #02 =dev/sprite.color |
|
388 |
+ ~SCRN.width #0010 SUB2 =SPRT.x |
|
389 |
+ ,save_icn =SPRT.addr |
|
390 |
+ #02 =SPRT.color |
|
391 | 391 |
|
392 | 392 |
RTS |
393 | 393 |
|
394 | 394 |
@draw-lines |
395 | 395 |
|
396 | 396 |
#0000 =j |
397 |
- #0000 =dev/sprite.x #0000 =dev/sprite.y |
|
397 |
+ #0000 =SPRT.x #0000 =SPRT.y |
|
398 | 398 |
@draw-lines-loop |
399 | 399 |
~scroll.y ~j ADD2 =addr |
400 |
- #0000 =dev/sprite.x |
|
401 |
- ,font_hex #00 ,addr #0001 ADD2 LDR #f0 AND #04 ROR #08 MUL ADD2 =dev/sprite.addr |
|
402 |
- ( draw ) #02 ~addr ~position.y EQU2 #06 MUL ADD =dev/sprite.color |
|
403 |
- #0008 =dev/sprite.x |
|
404 |
- ,font_hex #00 ,addr #0001 ADD2 LDR #0f AND #08 MUL ADD2 =dev/sprite.addr |
|
405 |
- ( draw ) #02 ~addr ~position.y EQU2 #06 MUL ADD =dev/sprite.color |
|
400 |
+ #0000 =SPRT.x |
|
401 |
+ ,font_hex #00 ,addr #0001 ADD2 LDR #f0 AND #04 ROR #08 MUL ADD2 =SPRT.addr |
|
402 |
+ ( draw ) #02 ~addr ~position.y EQU2 #06 MUL ADD =SPRT.color |
|
403 |
+ #0008 =SPRT.x |
|
404 |
+ ,font_hex #00 ,addr #0001 ADD2 LDR #0f AND #08 MUL ADD2 =SPRT.addr |
|
405 |
+ ( draw ) #02 ~addr ~position.y EQU2 #06 MUL ADD =SPRT.color |
|
406 | 406 |
( incr ) ~j #0001 ADD2 =j |
407 |
- ( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
|
408 |
- ,draw-lines-loop ~j ~dev/screen.height #0008 SUB2 #0008 DIV2 NEQ2 JMP2? POP2 |
|
407 |
+ ( incr ) ~SPRT.y #0008 ADD2 =SPRT.y |
|
408 |
+ ,draw-lines-loop ~j ~SCRN.height #0008 SUB2 #0008 DIV2 NEQ2 JMP2? POP2 |
|
409 | 409 |
|
410 | 410 |
RTS |
411 | 411 |
|
412 | 412 |
@draw-short ( short ) |
413 | 413 |
|
414 | 414 |
=addr |
415 |
- ,font_hex #00 ,addr LDR #f0 AND #04 ROR #08 MUL ADD2 =dev/sprite.addr |
|
416 |
- ( draw ) #0e =dev/sprite.color |
|
417 |
- ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
418 |
- ,font_hex #00 ,addr LDR #0f AND #08 MUL ADD2 =dev/sprite.addr |
|
419 |
- ( draw ) #0e =dev/sprite.color |
|
420 |
- ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
421 |
- ,font_hex #00 ,addr #0001 ADD2 LDR #f0 AND #04 ROR #08 MUL ADD2 =dev/sprite.addr |
|
422 |
- ( draw ) #0e =dev/sprite.color |
|
423 |
- ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
424 |
- ,font_hex #00 ,addr #0001 ADD2 LDR #0f AND #08 MUL ADD2 =dev/sprite.addr |
|
425 |
- ( draw ) #0e =dev/sprite.color |
|
415 |
+ ,font_hex #00 ,addr LDR #f0 AND #04 ROR #08 MUL ADD2 =SPRT.addr |
|
416 |
+ ( draw ) #0e =SPRT.color |
|
417 |
+ ~SPRT.x #0008 ADD2 =SPRT.x |
|
418 |
+ ,font_hex #00 ,addr LDR #0f AND #08 MUL ADD2 =SPRT.addr |
|
419 |
+ ( draw ) #0e =SPRT.color |
|
420 |
+ ~SPRT.x #0008 ADD2 =SPRT.x |
|
421 |
+ ,font_hex #00 ,addr #0001 ADD2 LDR #f0 AND #04 ROR #08 MUL ADD2 =SPRT.addr |
|
422 |
+ ( draw ) #0e =SPRT.color |
|
423 |
+ ~SPRT.x #0008 ADD2 =SPRT.x |
|
424 |
+ ,font_hex #00 ,addr #0001 ADD2 LDR #0f AND #08 MUL ADD2 =SPRT.addr |
|
425 |
+ ( draw ) #0e =SPRT.color |
|
426 | 426 |
|
427 | 427 |
RTS |
428 | 428 |
|
429 | 429 |
@draw-cursor |
430 | 430 |
|
431 |
- ~mouse.x ~dev/mouse.x NEQU2 |
|
432 |
- ~mouse.y ~dev/mouse.y NEQU2 |
|
431 |
+ ~mouse.x ~MOUS.x NEQU2 |
|
432 |
+ ~mouse.y ~MOUS.y NEQU2 |
|
433 | 433 |
|
434 | 434 |
#0000 EQU2 RTS? ( Return if unchanged ) |
435 | 435 |
|
436 | 436 |
( clear last cursor ) |
437 |
- ~mouse.x =dev/sprite.x |
|
438 |
- ~mouse.y =dev/sprite.y |
|
439 |
- ,blank_icn =dev/sprite.addr |
|
440 |
- #10 =dev/sprite.color |
|
437 |
+ ~mouse.x =SPRT.x |
|
438 |
+ ~mouse.y =SPRT.y |
|
439 |
+ ,blank_icn =SPRT.addr |
|
440 |
+ #10 =SPRT.color |
|
441 | 441 |
|
442 | 442 |
( record mouse positions ) |
443 |
- ~dev/mouse.x =mouse.x |
|
444 |
- ~dev/mouse.y =mouse.y |
|
443 |
+ ~MOUS.x =mouse.x |
|
444 |
+ ~MOUS.y =mouse.y |
|
445 | 445 |
|
446 | 446 |
( draw new cursor ) |
447 |
- ~mouse.x =dev/sprite.x |
|
448 |
- ~mouse.y =dev/sprite.y |
|
449 |
- ,cursor_icn =dev/sprite.addr |
|
450 |
- #13 =dev/sprite.color |
|
447 |
+ ~mouse.x =SPRT.x |
|
448 |
+ ~mouse.y =SPRT.y |
|
449 |
+ ,cursor_icn =SPRT.addr |
|
450 |
+ #13 =SPRT.color |
|
451 | 451 |
|
452 | 452 |
RTS |
453 | 453 |
|
... | ... |
@@ -467,42 +467,42 @@ RTS |
467 | 467 |
@find-scroll-offset-end |
468 | 468 |
|
469 | 469 |
~textarea.addr #0000 ADD2 =textarea.addr |
470 |
- #0000 =dev/sprite.y |
|
470 |
+ #0000 =SPRT.y |
|
471 | 471 |
~textarea.addr =j |
472 | 472 |
|
473 |
- #0018 =dev/sprite.x |
|
473 |
+ #0018 =SPRT.x |
|
474 | 474 |
|
475 | 475 |
@draw-textarea-loop |
476 | 476 |
|
477 |
- ,draw-textarea-end ~dev/sprite.y ~dev/screen.height #0010 SUB2 GTH2 JMP2? POP2 |
|
477 |
+ ,draw-textarea-end ~SPRT.y ~SCRN.height #0010 SUB2 GTH2 JMP2? POP2 |
|
478 | 478 |
|
479 | 479 |
( get character ) |
480 |
- ,font #00 ~j LDR #20 SUB #0008 MUL2 ADD2 =dev/sprite.addr |
|
480 |
+ ,font #00 ~j LDR #20 SUB #0008 MUL2 ADD2 =SPRT.addr |
|
481 | 481 |
|
482 | 482 |
( draw ) #01 |
483 | 483 |
~j ~selection.from #0001 SUB2 GTH2 |
484 | 484 |
~j ~selection.to LTH2 #0101 EQU2 |
485 |
- #05 MUL ADD =dev/sprite.color |
|
485 |
+ #05 MUL ADD =SPRT.color |
|
486 | 486 |
|
487 | 487 |
,no-linebreak ~j LDR #0a NEQ ~j LDR #0d NEQ #0101 EQU2 JMP2? POP2 |
488 | 488 |
( draw linebreak ) |
489 |
- ,linebreak_icn =dev/sprite.addr |
|
489 |
+ ,linebreak_icn =SPRT.addr |
|
490 | 490 |
( draw ) #03 |
491 | 491 |
~j ~selection.from #0001 SUB2 GTH2 |
492 | 492 |
~j ~selection.to LTH2 #0101 EQU2 |
493 |
- #05 MUL ADD =dev/sprite.color |
|
493 |
+ #05 MUL ADD =SPRT.color |
|
494 | 494 |
( fill clear ) |
495 | 495 |
@fill-clear |
496 |
- ( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
497 |
- ,font =dev/sprite.addr |
|
498 |
- #01 =dev/sprite.color |
|
499 |
- ,fill-clear ~dev/sprite.x ~dev/screen.width #0008 SUB2 LTH2 JMP2? POP2 |
|
500 |
- #0010 =dev/sprite.x |
|
501 |
- ( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
|
496 |
+ ( incr ) ~SPRT.x #0008 ADD2 =SPRT.x |
|
497 |
+ ,font =SPRT.addr |
|
498 |
+ #01 =SPRT.color |
|
499 |
+ ,fill-clear ~SPRT.x ~SCRN.width #0008 SUB2 LTH2 JMP2? POP2 |
|
500 |
+ #0010 =SPRT.x |
|
501 |
+ ( incr ) ~SPRT.y #0008 ADD2 =SPRT.y |
|
502 | 502 |
@no-linebreak |
503 | 503 |
|
504 | 504 |
( incr ) ~j #0001 ADD2 =j |
505 |
- ( incr ) ~dev/sprite.x #0007 ADD2 =dev/sprite.x |
|
505 |
+ ( incr ) ~SPRT.x #0007 ADD2 =SPRT.x |
|
506 | 506 |
|
507 | 507 |
,draw-textarea-loop ~j LDR #00 NEQ JMP2? POP2 |
508 | 508 |
|
... | ... |
@@ -512,40 +512,40 @@ RTS |
512 | 512 |
|
513 | 513 |
@draw-scrollbar |
514 | 514 |
|
515 |
- ~dev/screen.width #0008 SUB2 =dev/sprite.x |
|
516 |
- #0000 =dev/sprite.y |
|
517 |
- ,scrollbar_bg =dev/sprite.addr |
|
515 |
+ ~SCRN.width #0008 SUB2 =SPRT.x |
|
516 |
+ #0000 =SPRT.y |
|
517 |
+ ,scrollbar_bg =SPRT.addr |
|
518 | 518 |
|
519 | 519 |
@draw-scrollbar-loop |
520 |
- ( draw ) #08 =dev/sprite.color |
|
521 |
- ( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
|
522 |
- ,draw-scrollbar-loop ~dev/sprite.y ~dev/screen.height LTH2 JMP2? POP2 |
|
520 |
+ ( draw ) #08 =SPRT.color |
|
521 |
+ ( incr ) ~SPRT.y #0008 ADD2 =SPRT.y |
|
522 |
+ ,draw-scrollbar-loop ~SPRT.y ~SCRN.height LTH2 JMP2? POP2 |
|
523 | 523 |
|
524 |
- #0000 =dev/sprite.y |
|
525 |
- ,arrowup_icn =dev/sprite.addr |
|
526 |
- ( draw ) #08 =dev/sprite.color |
|
524 |
+ #0000 =SPRT.y |
|
525 |
+ ,arrowup_icn =SPRT.addr |
|
526 |
+ ( draw ) #08 =SPRT.color |
|
527 | 527 |
|
528 | 528 |
( at ) |
529 |
- ~scroll.y #0008 ADD2 =dev/sprite.y |
|
530 |
- ,scrollbar_fg =dev/sprite.addr |
|
531 |
- ( draw ) #08 =dev/sprite.color |
|
529 |
+ ~scroll.y #0008 ADD2 =SPRT.y |
|
530 |
+ ,scrollbar_fg =SPRT.addr |
|
531 |
+ ( draw ) #08 =SPRT.color |
|
532 | 532 |
|
533 |
- ~dev/screen.height #0008 SUB2 =dev/sprite.y |
|
534 |
- ,arrowdown_icn =dev/sprite.addr |
|
535 |
- ( draw ) #08 =dev/sprite.color |
|
533 |
+ ~SCRN.height #0008 SUB2 =SPRT.y |
|
534 |
+ ,arrowdown_icn =SPRT.addr |
|
535 |
+ ( draw ) #08 =SPRT.color |
|
536 | 536 |
|
537 | 537 |
RTS |
538 | 538 |
|
539 | 539 |
@draw-titlebar |
540 | 540 |
|
541 |
- #0018 ~dev/screen.height #0008 SUB2 #09 ,filepath |
|
541 |
+ #0018 ~SCRN.height #0008 SUB2 #09 ,filepath |
|
542 | 542 |
|
543 |
- ( load ) =label.addr =label.color =dev/sprite.y =dev/sprite.x |
|
543 |
+ ( load ) =label.addr =label.color =SPRT.y =SPRT.x |
|
544 | 544 |
~label.addr |
545 | 545 |
@draw-titlebar-loop |
546 |
- ( draw ) DUP2 LDR #00 SWP #20 SUB #0008 MUL2 ,font ADD2 =dev/sprite.addr ~label.color =dev/sprite.color |
|
546 |
+ ( draw ) DUP2 LDR #00 SWP #20 SUB #0008 MUL2 ,font ADD2 =SPRT.addr ~label.color =SPRT.color |
|
547 | 547 |
( incr ) #0001 ADD2 |
548 |
- ( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
548 |
+ ( incr ) ~SPRT.x #0008 ADD2 =SPRT.x |
|
549 | 549 |
DUP2 LDR #00 NEQ ,draw-titlebar-loop ROT JMP2? POP2 |
550 | 550 |
POP2 |
551 | 551 |
|
... | ... |
@@ -628,20 +628,20 @@ RTS |
628 | 628 |
@arrowdown_icn [ 0010 1010 fe7c 3810 ] |
629 | 629 |
@load_icn [ feaa d6aa d4aa f400 ] |
630 | 630 |
@save_icn [ fe82 8282 848a f400 ] |
631 |
-@filepath [ test.txt 00 ] |
|
632 |
-@filepath1 [ projects/software/left.usm 00 ] |
|
631 |
+@filepath1 [ projects/examples/jumptest.usm 00 ] |
|
632 |
+@filepath [ projects/software/left.usm 00 ] |
|
633 | 633 |
|
634 | 634 |
|4000 ;document Document |
635 | 635 |
|
636 | 636 |
|d000 @ERROR BRK |
637 | 637 |
|
638 | 638 |
|FF00 ;dev/console Console |
639 |
-|FF10 ;dev/screen Screen |
|
640 |
-|FF20 ;dev/sprite Sprite |
|
641 |
-|FF30 ;dev/ctrl Controller |
|
642 |
-|FF40 ;dev/key Keyboard |
|
643 |
-|FF50 ;dev/mouse Mouse |
|
644 |
-|FF60 ;dev/file File |
|
639 |
+|FF10 ;SCRN Screen |
|
640 |
+|FF20 ;SPRT Sprite |
|
641 |
+|FF30 ;CTRL Controller |
|
642 |
+|FF40 ;KEYS Keyboard |
|
643 |
+|FF50 ;MOUS Mouse |
|
644 |
+|FF60 ;FILE File |
|
645 | 645 |
|
646 | 646 |
|FFF0 .RESET .FRAME .ERROR ( vectors ) |
647 | 647 |
|FFF8 [ a0fe a0f7 a0f2 ] ( palette ) |
... | ... |
@@ -32,12 +32,12 @@ |
32 | 32 |
|
33 | 33 |
|0100 @RESET |
34 | 34 |
|
35 |
- ~dev/screen.width #0002 DIV2 #008a SUB2 =bankview.x |
|
36 |
- ~dev/screen.height #0002 DIV2 #003f SUB2 =bankview.y |
|
35 |
+ ~SCRN.width #0002 DIV2 #008a SUB2 =bankview.x |
|
36 |
+ ~SCRN.height #0002 DIV2 #003f SUB2 =bankview.y |
|
37 | 37 |
,bank1 =bankview.addr |
38 | 38 |
|
39 |
- ~dev/screen.width #0002 DIV2 #0002 ADD2 =tileview.x |
|
40 |
- ~dev/screen.height #0002 DIV2 #003f SUB2 =tileview.y |
|
39 |
+ ~SCRN.width #0002 DIV2 #0002 ADD2 =tileview.x |
|
40 |
+ ~SCRN.height #0002 DIV2 #003f SUB2 =tileview.y |
|
41 | 41 |
,bank1 #0448 ADD2 =tileview.addr |
42 | 42 |
|
43 | 43 |
,redraw JSR2 |
... | ... |
@@ -48,28 +48,28 @@ BRK |
48 | 48 |
|
49 | 49 |
( keyboard controls ) |
50 | 50 |
|
51 |
- ,no-key ~dev/key #00 EQU JMP2? POP2 |
|
51 |
+ ,no-key ~KEYS #00 EQU JMP2? POP2 |
|
52 | 52 |
|
53 |
- ,no-key ~dev/key #31 LTH JMP2? POP2 |
|
54 |
- ,no-key ~dev/key #33 GTH JMP2? POP2 |
|
55 |
- ( select ) ~dev/key #31 SUB =bankview.mode |
|
56 |
- ( release ) #00 =dev/key |
|
53 |
+ ,no-key ~KEYS #31 LTH JMP2? POP2 |
|
54 |
+ ,no-key ~KEYS #33 GTH JMP2? POP2 |
|
55 |
+ ( select ) ~KEYS #31 SUB =bankview.mode |
|
56 |
+ ( release ) #00 =KEYS |
|
57 | 57 |
,redraw JSR2 |
58 | 58 |
|
59 | 59 |
@no-key |
60 | 60 |
|
61 |
- ,no-ctrl ~dev/ctrl.buttons #00 EQU JMP2? POP2 |
|
61 |
+ ,no-ctrl ~CTRL.buttons #00 EQU JMP2? POP2 |
|
62 | 62 |
|
63 |
- ,no-ctrl-up ~dev/ctrl.buttons #10 EQU JMP2? POP2 |
|
63 |
+ ,no-ctrl-up ~CTRL.buttons #10 EQU JMP2? POP2 |
|
64 | 64 |
~tileview.addr #0080 ADD2 =tileview.addr |
65 | 65 |
@no-ctrl-up |
66 |
- ,no-ctrl-down ~dev/ctrl.buttons #20 EQU JMP2? POP2 |
|
66 |
+ ,no-ctrl-down ~CTRL.buttons #20 EQU JMP2? POP2 |
|
67 | 67 |
~tileview.addr #0080 SUB2 =tileview.addr |
68 | 68 |
@no-ctrl-down |
69 |
- ,no-ctrl-left ~dev/ctrl.buttons #40 EQU JMP2? POP2 |
|
69 |
+ ,no-ctrl-left ~CTRL.buttons #40 EQU JMP2? POP2 |
|
70 | 70 |
~tileview.addr #0008 ADD2 =tileview.addr |
71 | 71 |
@no-ctrl-left |
72 |
- ,no-ctrl-right ~dev/ctrl.buttons #80 EQU JMP2? POP2 |
|
72 |
+ ,no-ctrl-right ~CTRL.buttons #80 EQU JMP2? POP2 |
|
73 | 73 |
~tileview.addr #0008 SUB2 =tileview.addr |
74 | 74 |
@no-ctrl-right |
75 | 75 |
~tileview.addr #0800 DIV2 #0800 MUL2 =bankview.addr |
... | ... |
@@ -79,30 +79,30 @@ BRK |
79 | 79 |
|
80 | 80 |
( mouse controls ) |
81 | 81 |
|
82 |
- ,click-end ~dev/mouse.state #00 EQU JMP2? POP2 |
|
82 |
+ ,click-end ~MOUS.state #00 EQU JMP2? POP2 |
|
83 | 83 |
|
84 | 84 |
( toolbar ) |
85 | 85 |
|
86 |
- ,no-toolbar-click ~dev/mouse.y ~bankview.y #0010 SUB2 SUB2 #0008 DIV2 #0000 NEQ2 JMP2? POP2 |
|
86 |
+ ,no-toolbar-click ~MOUS.y ~bankview.y #0010 SUB2 SUB2 #0008 DIV2 #0000 NEQ2 JMP2? POP2 |
|
87 | 87 |
|
88 | 88 |
( brush ) |
89 | 89 |
|
90 |
- ,no-brush-click ~dev/mouse.x ~bankview.x SUB2 #0008 DIV2 #000d LTH2 JMP2? POP2 |
|
91 |
- ,no-brush-click ~dev/mouse.x ~bankview.x SUB2 #0008 DIV2 #000f GTH2 JMP2? POP2 |
|
90 |
+ ,no-brush-click ~MOUS.x ~bankview.x SUB2 #0008 DIV2 #000d LTH2 JMP2? POP2 |
|
91 |
+ ,no-brush-click ~MOUS.x ~bankview.x SUB2 #0008 DIV2 #000f GTH2 JMP2? POP2 |
|
92 | 92 |
( select ) ~mouse.x ~bankview.x SUB2 #0008 DIV2 #000d SUB2 SWP POP =bankview.mode |
93 |
- ( release ) #00 =dev/mouse.state |
|
93 |
+ ( release ) #00 =MOUS.state |
|
94 | 94 |
,redraw JSR2 ,click-end JMP2 |
95 | 95 |
@no-brush-click |
96 | 96 |
|
97 |
- ,no-load-click ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #000e NEQU2 JMP2? POP2 |
|
98 |
- ( load ) ,filename =dev/file.name #0800 =dev/file.length ~bankview.addr =dev/file.load |
|
99 |
- ( release ) #00 =dev/mouse.state |
|
97 |
+ ,no-load-click ~MOUS.x ~tileview.x SUB2 #0008 DIV2 #000e NEQU2 JMP2? POP2 |
|
98 |
+ ( load ) ,filename =FILE.name #0800 =FILE.length ~bankview.addr =FILE.load |
|
99 |
+ ( release ) #00 =MOUS.state |
|
100 | 100 |
,redraw JSR2 ,click-end JMP2 |
101 | 101 |
@no-load-click |
102 | 102 |
|
103 |
- ,no-save-click ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #000f NEQU2 JMP2? POP2 |
|
104 |
- ( save ) ,filename =dev/file.name #0800 =dev/file.length ~bankview.addr =dev/file.save |
|
105 |
- ( release ) #00 =dev/mouse.state |
|
103 |
+ ,no-save-click ~MOUS.x ~tileview.x SUB2 #0008 DIV2 #000f NEQU2 JMP2? POP2 |
|
104 |
+ ( save ) ,filename =FILE.name #0800 =FILE.length ~bankview.addr =FILE.save |
|
105 |
+ ( release ) #00 =MOUS.state |
|
106 | 106 |
,redraw JSR2 ,click-end JMP2 |
107 | 107 |
@no-save-click |
108 | 108 |
|
... | ... |
@@ -110,8 +110,8 @@ BRK |
110 | 110 |
|
111 | 111 |
( bankview ) |
112 | 112 |
|
113 |
- ~dev/mouse.x ~bankview.x GTH2 ~dev/mouse.x ~bankview.x #0080 ADD2 LTH2 #0101 EQU2 |
|
114 |
- ~dev/mouse.y ~bankview.y GTH2 ~dev/mouse.y ~bankview.y #0080 ADD2 LTH2 #0101 EQU2 |
|
113 |
+ ~MOUS.x ~bankview.x GTH2 ~MOUS.x ~bankview.x #0080 ADD2 LTH2 #0101 EQU2 |
|
114 |
+ ~MOUS.y ~bankview.y GTH2 ~MOUS.y ~bankview.y #0080 ADD2 LTH2 #0101 EQU2 |
|
115 | 115 |
#0101 NEQ2 ,no-bank-click ROT JMP2? POP2 |
116 | 116 |
|
117 | 117 |
,not-copy-mode ~bankview.mode #01 NEQ JMP2? POP2 |
... | ... |
@@ -119,8 +119,8 @@ BRK |
119 | 119 |
@copy-loop |
120 | 120 |
( load ) ~tileview.addr ~i ADD LDR |
121 | 121 |
( get touch addr ) |
122 |
- ~dev/mouse.x ~bankview.x SUB2 #0008 DIV2 #0008 MUL2 |
|
123 |
- ~dev/mouse.y ~bankview.y SUB2 #0008 DIV2 #0008 MUL2 #0010 MUL2 ADD2 |
|
122 |
+ ~MOUS.x ~bankview.x SUB2 #0008 DIV2 #0008 MUL2 |
|
123 |
+ ~MOUS.y ~bankview.y SUB2 #0008 DIV2 #0008 MUL2 #0010 MUL2 ADD2 |
|
124 | 124 |
~bankview.addr ADD2 #00 ~i ADD2 STR |
125 | 125 |
( incr ) ~i #01 ADD =i |
126 | 126 |
,copy-loop ~i #08 LTH JMP2? POP2 |
... | ... |
@@ -132,16 +132,16 @@ BRK |
132 | 132 |
@erase-loop |
133 | 133 |
#00 |
134 | 134 |
( get touch addr ) |
135 |
- ~dev/mouse.x ~bankview.x SUB2 #0008 DIV2 #0008 MUL2 |
|
136 |
- ~dev/mouse.y ~bankview.y SUB2 #0008 DIV2 #0008 MUL2 #0010 MUL2 ADD2 |
|
135 |
+ ~MOUS.x ~bankview.x SUB2 #0008 DIV2 #0008 MUL2 |
|
136 |
+ ~MOUS.y ~bankview.y SUB2 #0008 DIV2 #0008 MUL2 #0010 MUL2 ADD2 |
|
137 | 137 |
~bankview.addr ADD2 #00 ~i ADD2 STR |
138 | 138 |
( incr ) ~i #01 ADD =i |
139 | 139 |
,erase-loop ~i #08 LTH JMP2? POP2 |
140 | 140 |
,redraw JSR2 ,click-end JMP2 |
141 | 141 |
@not-erase-mode |
142 | 142 |
|
143 |
- ~dev/mouse.x ~bankview.x SUB2 #0008 DIV2 #0008 MUL2 |
|
144 |
- ~dev/mouse.y ~bankview.y SUB2 #0008 DIV2 #0008 MUL2 #0010 MUL2 ADD2 |
|
143 |
+ ~MOUS.x ~bankview.x SUB2 #0008 DIV2 #0008 MUL2 |
|
144 |
+ ~MOUS.y ~bankview.y SUB2 #0008 DIV2 #0008 MUL2 #0010 MUL2 ADD2 |
|
145 | 145 |
~bankview.addr ADD2 =tileview.addr |
146 | 146 |
,redraw JSR2 ,click-end JMP2 |
147 | 147 |
|
... | ... |
@@ -149,16 +149,16 @@ BRK |
149 | 149 |
|
150 | 150 |
( tileview ) |
151 | 151 |
|
152 |
- ~dev/mouse.x ~tileview.x GTH2 ~dev/mouse.x ~tileview.x #0080 ADD2 LTH2 #0101 EQU2 |
|
153 |
- ~dev/mouse.y ~tileview.y GTH2 ~dev/mouse.y ~tileview.y #0080 ADD2 LTH2 #0101 EQU2 |
|
152 |
+ ~MOUS.x ~tileview.x GTH2 ~MOUS.x ~tileview.x #0080 ADD2 LTH2 #0101 EQU2 |
|
153 |
+ ~MOUS.y ~tileview.y GTH2 ~MOUS.y ~tileview.y #0080 ADD2 LTH2 #0101 EQU2 |
|
154 | 154 |
#0101 NEQ2 ,no-tile-click ROT JMP2? POP2 |
155 | 155 |
|
156 |
- ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #0008 MUL2 #0040 DIV2 |
|
157 |
- ~dev/mouse.y ~tileview.y SUB2 #0008 DIV2 #0008 MUL2 #0040 DIV2 #0002 MUL2 ADD2 |
|
156 |
+ ~MOUS.x ~tileview.x SUB2 #0008 DIV2 #0008 MUL2 #0040 DIV2 |
|
157 |
+ ~MOUS.y ~tileview.y SUB2 #0008 DIV2 #0008 MUL2 #0040 DIV2 #0002 MUL2 ADD2 |
|
158 | 158 |
#0008 MUL2 |
159 | 159 |
~tileview.addr ADD2 =addr ( addr offset ) |
160 |
- ~dev/mouse.x ~tileview.x SUB2 ~dev/mouse.x ~tileview.x SUB2 #0040 DIV2 #0040 MUL2 SUB2 =pos.x |
|
161 |
- ~dev/mouse.y ~tileview.y SUB2 ~dev/mouse.y ~tileview.y SUB2 #0040 DIV2 #0040 MUL2 SUB2 =pos.y |
|
160 |
+ ~MOUS.x ~tileview.x SUB2 ~MOUS.x ~tileview.x SUB2 #0040 DIV2 #0040 MUL2 SUB2 =pos.x |
|
161 |
+ ~MOUS.y ~tileview.y SUB2 ~MOUS.y ~tileview.y SUB2 #0040 DIV2 #0040 MUL2 SUB2 =pos.y |
|
162 | 162 |
,no-fill-mode ~bankview.mode #01 NEQ JMP2? POP2 |
163 | 163 |
( fill row ) #ff ~addr ~pos.y #0008 DIV2 ADD2 STR |
164 | 164 |
,redraw JSR2 ,click-end JMP2 |
... | ... |
@@ -177,17 +177,17 @@ BRK |
177 | 177 |
|
178 | 178 |
( operations ) |
179 | 179 |
|
180 |
- ,no-operations ~dev/mouse.y ~tileview.y SUB2 #0008 DIV2 #000c NEQ2 JMP2? POP2 |
|
180 |
+ ,no-operations ~MOUS.y ~tileview.y SUB2 #0008 DIV2 #000c NEQ2 JMP2? POP2 |
|
181 | 181 |
|
182 |
- ,no-move-up ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #0011 NEQ2 JMP2? POP2 |
|
182 |
+ ,no-move-up ~MOUS.x ~tileview.x SUB2 #0008 DIV2 #0011 NEQ2 JMP2? POP2 |
|
183 | 183 |
,op_shiftup JSR2 |
184 |
- ( release ) #00 =dev/mouse.state |
|
184 |
+ ( release ) #00 =MOUS.state |
|
185 | 185 |
,redraw JSR2 ,click-end JMP2 |
186 | 186 |
@no-move-up |
187 | 187 |
|
188 |
- ,no-move-down ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #0012 NEQ2 JMP2? POP2 |
|
188 |
+ ,no-move-down ~MOUS.x ~tileview.x SUB2 #0008 DIV2 #0012 NEQ2 JMP2? POP2 |
|
189 | 189 |
,op_shiftdown JSR2 |
190 |
- ( release ) #00 =dev/mouse.state |
|
190 |
+ ( release ) #00 =MOUS.state |
|
191 | 191 |
,redraw JSR2 ,click-end JMP2 |
192 | 192 |
@no-move-down |
193 | 193 |
|
... | ... |
@@ -240,66 +240,66 @@ RTS |
240 | 240 |
|
241 | 241 |
( position ) |
242 | 242 |
|
243 |
- ~bankview.x =dev/sprite.x |
|
244 |
- ~bankview.y #0010 SUB2 =dev/sprite.y |
|
243 |
+ ~bankview.x =SPRT.x |
|
244 |
+ ~bankview.y #0010 SUB2 =SPRT.y |
|
245 | 245 |
~bankview.addr ,draw-short JSR2 |
246 | 246 |
|
247 | 247 |
( toolbar ) |
248 | 248 |
|
249 |
- ~bankview.x #0068 ADD2 =dev/sprite.x |
|
250 |
- ~bankview.y #0010 SUB2 =dev/sprite.y |
|
251 |
- ,tool_selector =dev/sprite.addr |
|
252 |
- #01 ~bankview.mode #00 EQU ADD =dev/sprite.color |
|
249 |
+ ~bankview.x #0068 ADD2 =SPRT.x |
|
250 |
+ ~bankview.y #0010 SUB2 =SPRT.y |
|
251 |
+ ,tool_selector =SPRT.addr |
|
252 |
+ #01 ~bankview.mode #00 EQU ADD =SPRT.color |
|
253 | 253 |
|
254 |
- ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
255 |
- ,tool_hand =dev/sprite.addr |
|
256 |
- #01 ~bankview.mode #01 EQU ADD =dev/sprite.color |
|
254 |
+ ~SPRT.x #0008 ADD2 =SPRT.x |
|
255 |
+ ,tool_hand =SPRT.addr |
|
256 |
+ #01 ~bankview.mode #01 EQU ADD =SPRT.color |
|
257 | 257 |
|
258 |
- ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
259 |
- ,tool_eraser =dev/sprite.addr |
|
260 |
- #01 ~bankview.mode #02 EQU ADD =dev/sprite.color |
|
258 |
+ ~SPRT.x #0008 ADD2 =SPRT.x |
|
259 |
+ ,tool_eraser =SPRT.addr |
|
260 |
+ #01 ~bankview.mode #02 EQU ADD =SPRT.color |
|
261 | 261 |
|
262 |
- ~tileview.x #0070 ADD2 =dev/sprite.x |
|
263 |
- ,load_icn =dev/sprite.addr |
|
264 |
- #01 =dev/sprite.color |
|
262 |
+ ~tileview.x #0070 ADD2 =SPRT.x |
|
263 |
+ ,load_icn =SPRT.addr |
|
264 |
+ #01 =SPRT.color |
|
265 | 265 |
|
266 |
- ~tileview.x #0078 ADD2 =dev/sprite.x |
|
267 |
- ,save_icn =dev/sprite.addr |
|
268 |
- #01 =dev/sprite.color |
|
266 |
+ ~tileview.x #0078 ADD2 =SPRT.x |
|
267 |
+ ,save_icn =SPRT.addr |
|
268 |
+ #01 =SPRT.color |
|
269 | 269 |
|
270 | 270 |
( guides ) |
271 | 271 |
|
272 |
- #00 =i ,font_hex =dev/sprite.addr |
|
272 |
+ #00 =i ,font_hex =SPRT.addr |
|
273 | 273 |
@draw-bankview-guides |
274 |
- ~bankview.x #0010 SUB2 =dev/sprite.x |
|
275 |
- ~bankview.y #00 ~i #08 MUL ADD2 =dev/sprite.y |
|
276 |
- ( draw ) #02 =dev/sprite.color |
|
277 |
- ~bankview.x #00 ~i #08 MUL ADD2 =dev/sprite.x |
|
278 |
- ~bankview.y #0088 ADD2 =dev/sprite.y |
|
279 |
- ( draw ) #02 =dev/sprite.color |
|
280 |
- ~dev/sprite.addr #0008 ADD2 =dev/sprite.addr |
|
274 |
+ ~bankview.x #0010 SUB2 =SPRT.x |
|
275 |
+ ~bankview.y #00 ~i #08 MUL ADD2 =SPRT.y |
|
276 |
+ ( draw ) #02 =SPRT.color |
|
277 |
+ ~bankview.x #00 ~i #08 MUL ADD2 =SPRT.x |
|
278 |
+ ~bankview.y #0088 ADD2 =SPRT.y |
|
279 |
+ ( draw ) #02 =SPRT.color |
|
280 |
+ ~SPRT.addr #0008 ADD2 =SPRT.addr |
|
281 | 281 |
( incr ) ~i #01 ADD =i |
282 | 282 |
,draw-bankview-guides ~i #10 LTH JMP2? POP2 |
283 | 283 |
|
284 | 284 |
( body ) |
285 | 285 |
|
286 |
- ~bankview.x =dev/sprite.x ~bankview.y =dev/sprite.y |
|
287 |
- #00 =pt.x #00 =pt.y ~bankview.addr =dev/sprite.addr |
|
286 |
+ ~bankview.x =SPRT.x ~bankview.y =SPRT.y |
|
287 |
+ #00 =pt.x #00 =pt.y ~bankview.addr =SPRT.addr |
|
288 | 288 |
@draw-bankview-tiles-ver |
289 | 289 |
#00 =pt.x |
290 |
- ~bankview.x =dev/sprite.x |
|
290 |
+ ~bankview.x =SPRT.x |
|
291 | 291 |
@draw-bankview-tiles-hor |
292 |
- ( draw ) #01 =dev/sprite.color |
|
293 |
- ,no-highlight ~dev/sprite.addr ~tileview.addr LTH2 JMP2? POP2 |
|
294 |
- ,no-highlight ~dev/sprite.addr ~tileview.addr #0018 ADD2 GTH2 JMP2? POP2 |
|
295 |
- ( draw ) #0c =dev/sprite.color |
|
292 |
+ ( draw ) #01 =SPRT.color |
|
293 |
+ ,no-highlight ~SPRT.addr ~tileview.addr LTH2 JMP2? POP2 |
|
294 |
+ ,no-highlight ~SPRT.addr ~tileview.addr #0018 ADD2 GTH2 JMP2? POP2 |
|
295 |
+ ( draw ) #0c =SPRT.color |
|
296 | 296 |
@no-highlight |
297 |
- ( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
298 |
- ( incr ) ~dev/sprite.addr #0008 ADD2 =dev/sprite.addr |
|
297 |
+ ( incr ) ~SPRT.x #0008 ADD2 =SPRT.x |
|
298 |
+ ( incr ) ~SPRT.addr #0008 ADD2 =SPRT.addr |
|
299 | 299 |
( incr ) ~pt.x #01 ADD =pt.x |
300 | 300 |
,draw-bankview-tiles-hor ~pt.x #10 LTH JMP2? POP2 |
301 | 301 |
( incr ) ~pt.y #01 ADD =pt.y |
302 |
- ( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
|
302 |
+ ( incr ) ~SPRT.y #0008 ADD2 =SPRT.y |
|
303 | 303 |
,draw-bankview-tiles-ver ~pt.y #10 LTH JMP2? POP2 |
304 | 304 |
|
305 | 305 |
RTS |
... | ... |
@@ -308,96 +308,96 @@ RTS |
308 | 308 |
|
309 | 309 |
~tileview.x #0002 SUB2 ~tileview.y #0002 SUB2 ~tileview.x #0080 ADD2 ~tileview.y #0081 ADD2 #03 ,line-rect JSR2 |
310 | 310 |
|
311 |
- ~tileview.x #0028 ADD2 =dev/sprite.x |
|
312 |
- ~tileview.y #0010 SUB2 =dev/sprite.y |
|
313 |
- ~tileview.addr =dev/sprite.addr |
|
314 |
- #03 =dev/sprite.color |
|
311 |
+ ~tileview.x #0028 ADD2 =SPRT.x |
|
312 |
+ ~tileview.y #0010 SUB2 =SPRT.y |
|
313 |
+ ~tileview.addr =SPRT.addr |
|
314 |
+ #03 =SPRT.color |
|
315 | 315 |
|
316 | 316 |
( position ) |
317 | 317 |
|
318 |
- ~tileview.x =dev/sprite.x |
|
319 |
- ~tileview.y #0010 SUB2 =dev/sprite.y |
|
318 |
+ ~tileview.x =SPRT.x |
|
319 |
+ ~tileview.y #0010 SUB2 =SPRT.y |
|
320 | 320 |
~tileview.addr ,draw-short JSR2 |
321 | 321 |
|
322 | 322 |
( body ) |
323 | 323 |
|
324 |
- ~tileview.x =dev/sprite.x |
|
325 |
- ~tileview.y =dev/sprite.y |
|
324 |
+ ~tileview.x =SPRT.x |
|
325 |
+ ~tileview.y =SPRT.y |
|
326 | 326 |
~tileview.addr =tileview.addr |
327 | 327 |
,draw-tileview-icn JSR2 |
328 | 328 |
|
329 |
- ~tileview.x #0040 ADD2 =dev/sprite.x |
|
330 |
- ~tileview.y =dev/sprite.y |
|
329 |
+ ~tileview.x #0040 ADD2 =SPRT.x |
|
330 |
+ ~tileview.y =SPRT.y |
|
331 | 331 |
~tileview.addr #0008 ADD2 =tileview.addr |
332 | 332 |
,draw-tileview-icn JSR2 |
333 | 333 |
|
334 |
- ~tileview.x =dev/sprite.x |
|
335 |
- ~tileview.y #0040 ADD2 =dev/sprite.y |
|
334 |
+ ~tileview.x =SPRT.x |
|
335 |
+ ~tileview.y #0040 ADD2 =SPRT.y |
|
336 | 336 |
~tileview.addr #0008 ADD2 =tileview.addr |
337 | 337 |
,draw-tileview-icn JSR2 |
338 | 338 |
|
339 |
- ~tileview.x #0040 ADD2 =dev/sprite.x |
|
340 |
- ~tileview.y #0040 ADD2 =dev/sprite.y |
|
339 |
+ ~tileview.x #0040 ADD2 =SPRT.x |
|
340 |
+ ~tileview.y #0040 ADD2 =SPRT.y |
|
341 | 341 |
~tileview.addr #0008 ADD2 =tileview.addr |
342 | 342 |
,draw-tileview-icn JSR2 |
343 | 343 |
|
344 | 344 |
( line hor ) |
345 |
- ~tileview.y #003f ADD2 =dev/screen.y |
|
346 |
- ~tileview.x =dev/screen.x |
|
345 |
+ ~tileview.y #003f ADD2 =SCRN.y |
|
346 |
+ ~tileview.x =SCRN.x |
|
347 | 347 |
@draw-hor |
348 |
- ( draw ) #03 =dev/screen.color |
|
349 |
- ( incr ) ~dev/screen.x #0002 ADD2 =dev/screen.x |
|
350 |
- ~dev/screen.x ~tileview.x #0082 ADD2 LTH2 ,draw-hor ROT JMP2? POP2 |
|
348 |
+ ( draw ) #03 =SCRN.color |
|
349 |
+ ( incr ) ~SCRN.x #0002 ADD2 =SCRN.x |
|
350 |
+ ~SCRN.x ~tileview.x #0082 ADD2 LTH2 ,draw-hor ROT JMP2? POP2 |
|
351 | 351 |
|
352 | 352 |
( line ver ) |
353 |
- ~tileview.y =dev/screen.y |
|
354 |
- ~tileview.x #003f ADD2 =dev/screen.x |
|
353 |
+ ~tileview.y =SCRN.y |
|
354 |
+ ~tileview.x #003f ADD2 =SCRN.x |
|
355 | 355 |
@draw-ver |
356 |
- ( draw ) #03 =dev/screen.color |
|
357 |
- ( incr ) ~dev/screen.y #0002 ADD2 =dev/screen.y |
|
358 |
- ~dev/screen.y ~tileview.y #0081 ADD2 LTH2 ,draw-ver ROT JMP2? POP2 |
|
356 |
+ ( draw ) #03 =SCRN.color |
|
357 |
+ ( incr ) ~SCRN.y #0002 ADD2 =SCRN.y |
|
358 |
+ ~SCRN.y ~tileview.y #0081 ADD2 LTH2 ,draw-ver ROT JMP2? POP2 |
|
359 | 359 |
|
360 | 360 |
( rewind ) ~tileview.addr #0018 SUB2 =tileview.addr |
361 | 361 |
|
362 | 362 |
( bytes ) |
363 | 363 |
|
364 |
- ~tileview.y #0018 ADD2 =dev/sprite.y |
|
364 |
+ ~tileview.y #0018 ADD2 =SPRT.y |
|
365 | 365 |
#00 =i |
366 | 366 |
@draw-tileview-bytes |
367 |
- ~tileview.x #0088 ADD2 =dev/sprite.x |
|
368 |
- ,font_hex #00 ~tileview.addr #00 ~i ADD2 LDR #f0 AND #04 ROR #08 MUL ADD2 =dev/sprite.addr |
|
369 |
- ( draw ) #02 =dev/sprite.color |
|
370 |
- ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
371 |
- ,font_hex #00 ~tileview.addr #00 ~i ADD2 LDR #0f AND #08 MUL ADD2 =dev/sprite.addr |
|
372 |
- ( draw ) #02 =dev/sprite.color |
|
367 |
+ ~tileview.x #0088 ADD2 =SPRT.x |
|
368 |
+ ,font_hex #00 ~tileview.addr #00 ~i ADD2 LDR #f0 AND #04 ROR #08 MUL ADD2 =SPRT.addr |
|
369 |
+ ( draw ) #02 =SPRT.color |
|
370 |
+ ~SPRT.x #0008 ADD2 =SPRT.x |
|
371 |
+ ,font_hex #00 ~tileview.addr #00 ~i ADD2 LDR #0f AND #08 MUL ADD2 =SPRT.addr |
|
372 |
+ ( draw ) #02 =SPRT.color |
|
373 | 373 |
( incr ) ~i #01 ADD =i |
374 |
- ( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
|
374 |
+ ( incr ) ~SPRT.y #0008 ADD2 =SPRT.y |
|
375 | 375 |
,draw-tileview-bytes ~i #08 LTH JMP2? POP2 |
376 | 376 |
|
377 | 377 |
( operations ) |
378 | 378 |
|
379 |
- ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
|
380 |
- ,movedown_icn =dev/sprite.addr |
|
381 |
- #01 =dev/sprite.color |
|
382 |
- ~dev/sprite.x #0008 SUB2 =dev/sprite.x |
|
383 |
- ,moveup_icn =dev/sprite.addr |
|
384 |
- #01 =dev/sprite.color |
|
379 |
+ ~SPRT.y #0008 ADD2 =SPRT.y |
|
380 |
+ ,movedown_icn =SPRT.addr |
|
381 |
+ #01 =SPRT.color |
|
382 |
+ ~SPRT.x #0008 SUB2 =SPRT.x |
|
383 |
+ ,moveup_icn =SPRT.addr |
|
384 |
+ #01 =SPRT.color |
|
385 | 385 |
|
386 | 386 |
( draw tiles ) |
387 |
- ~tileview.y =dev/sprite.y |
|
388 |
- #00 =pt.x #00 =pt.y ~tileview.addr =dev/sprite.addr |
|
387 |
+ ~tileview.y =SPRT.y |
|
388 |
+ #00 =pt.x #00 =pt.y ~tileview.addr =SPRT.addr |
|
389 | 389 |
|
390 | 390 |
@draw-tileview-tiles-ver |
391 | 391 |
#00 =pt.x |
392 |
- ~tileview.x #0088 ADD2 =dev/sprite.x |
|
392 |
+ ~tileview.x #0088 ADD2 =SPRT.x |
|
393 | 393 |
@draw-tileview-tiles-hor |
394 |
- ( draw ) #03 =dev/sprite.color |
|
395 |
- ( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
396 |
- ( incr ) ~dev/sprite.addr #0008 ADD2 =dev/sprite.addr |
|
394 |
+ ( draw ) #03 =SPRT.color |
|
395 |
+ ( incr ) ~SPRT.x #0008 ADD2 =SPRT.x |
|
396 |
+ ( incr ) ~SPRT.addr #0008 ADD2 =SPRT.addr |
|
397 | 397 |
( incr ) ~pt.x #01 ADD =pt.x |
398 | 398 |
,draw-tileview-tiles-hor ~pt.x #02 LTH JMP2? POP2 |
399 | 399 |
( incr ) ~pt.y #01 ADD =pt.y |
400 |
- ( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
|
400 |
+ ( incr ) ~SPRT.y #0008 ADD2 =SPRT.y |
|
401 | 401 |
,draw-tileview-tiles-ver ~pt.y #02 LTH JMP2? POP2 |
402 | 402 |
|
403 | 403 |
RTS |
... | ... |
@@ -411,57 +411,57 @@ RTS |
411 | 411 |
( get bit ) |
412 | 412 |
,blank_icn #00 |
413 | 413 |
~tileview.addr #00 ~pt.y ADD2 LDR #07 ~pt.x SUB ROR #01 AND ( get bit ) |
414 |
- #0008 MUL2 ADD2 =dev/sprite.addr ( add *8 ) |
|
415 |
- ( draw ) #01 =dev/sprite.color |
|
416 |
- ( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
414 |
+ #0008 MUL2 ADD2 =SPRT.addr ( add *8 ) |
|
415 |
+ ( draw ) #01 =SPRT.color |
|
416 |
+ ( incr ) ~SPRT.x #0008 ADD2 =SPRT.x |
|
417 | 417 |
( incr ) ~pt.x #01 ADD =pt.x |
418 | 418 |
,redraw-hor ~pt.x #08 LTH JMP2? POP2 |
419 |
- ( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
|
419 |
+ ( incr ) ~SPRT.y #0008 ADD2 =SPRT.y |
|
420 | 420 |
( incr ) ~pt.y #01 ADD =pt.y |
421 |
- ~dev/sprite.x #0040 SUB2 =dev/sprite.x |
|
421 |
+ ~SPRT.x #0040 SUB2 =SPRT.x |
|
422 | 422 |
,redraw-ver ~pt.y #08 LTH JMP2? POP2 |
423 | 423 |
|
424 | 424 |
RTS |
425 | 425 |
|
426 | 426 |
@draw-cursor |
427 | 427 |
|
428 |
- ~mouse.x ~dev/mouse.x NEQU2 |
|
429 |
- ~mouse.y ~dev/mouse.y NEQU2 |
|
428 |
+ ~mouse.x ~MOUS.x NEQU2 |
|
429 |
+ ~mouse.y ~MOUS.y NEQU2 |
|
430 | 430 |
|
431 | 431 |
#0000 EQU2 RTS? ( Return if unchanged ) |
432 | 432 |
|
433 | 433 |
( clear last cursor ) |
434 |
- ~mouse.x =dev/sprite.x |
|
435 |
- ~mouse.y =dev/sprite.y |
|
436 |
- ,blank_icn =dev/sprite.addr |
|
437 |
- #10 =dev/sprite.color |
|
434 |
+ ~mouse.x =SPRT.x |
|
435 |
+ ~mouse.y =SPRT.y |
|
436 |
+ ,blank_icn =SPRT.addr |
|
437 |
+ #10 =SPRT.color |
|
438 | 438 |
|
439 | 439 |
( record mouse positions ) |
440 |
- ~dev/mouse.x =mouse.x |
|
441 |
- ~dev/mouse.y =mouse.y |
|
440 |
+ ~MOUS.x =mouse.x |
|
441 |
+ ~MOUS.y =mouse.y |
|
442 | 442 |
|
443 | 443 |
( draw new cursor ) |
444 |
- ~mouse.x =dev/sprite.x |
|
445 |
- ~mouse.y =dev/sprite.y |
|
446 |
- ,tool_selector #00 ~bankview.mode #08 MUL ADD2 =dev/sprite.addr |
|
447 |
- #12 =dev/sprite.color |
|
444 |
+ ~mouse.x =SPRT.x |
|
445 |
+ ~mouse.y =SPRT.y |
|
446 |
+ ,tool_selector #00 ~bankview.mode #08 MUL ADD2 =SPRT.addr |
|
447 |
+ #12 =SPRT.color |
|
448 | 448 |
|
449 | 449 |
RTS |
450 | 450 |
|
451 | 451 |
@draw-short ( short ) |
452 | 452 |
|
453 | 453 |
=addr |
454 |
- ,font_hex #00 ,addr LDR #f0 AND #04 ROR #08 MUL ADD2 =dev/sprite.addr |
|
455 |
- ( draw ) #02 =dev/sprite.color |
|
456 |
- ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
457 |
- ,font_hex #00 ,addr LDR #0f AND #08 MUL ADD2 =dev/sprite.addr |
|
458 |
- ( draw ) #02 =dev/sprite.color |
|
459 |
- ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
460 |
- ,font_hex #00 ,addr #0001 ADD2 LDR #f0 AND #04 ROR #08 MUL ADD2 =dev/sprite.addr |
|
461 |
- ( draw ) #02 =dev/sprite.color |
|
462 |
- ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
|
463 |
- ,font_hex #00 ,addr #0001 ADD2 LDR #0f AND #08 MUL ADD2 =dev/sprite.addr |
|
464 |
- ( draw ) #02 =dev/sprite.color |
|
454 |
+ ,font_hex #00 ,addr LDR #f0 AND #04 ROR #08 MUL ADD2 =SPRT.addr |
|
455 |
+ ( draw ) #02 =SPRT.color |
|
456 |
+ ~SPRT.x #0008 ADD2 =SPRT.x |
|
457 |
+ ,font_hex #00 ,addr LDR #0f AND #08 MUL ADD2 =SPRT.addr |
|
458 |
+ ( draw ) #02 =SPRT.color |
|
459 |
+ ~SPRT.x #0008 ADD2 =SPRT.x |
|
460 |
+ ,font_hex #00 ,addr #0001 ADD2 LDR #f0 AND #04 ROR #08 MUL ADD2 =SPRT.addr |
|
461 |
+ ( draw ) #02 =SPRT.color |
|
462 |
+ ~SPRT.x #0008 ADD2 =SPRT.x |
|
463 |
+ ,font_hex #00 ,addr #0001 ADD2 LDR #0f AND #08 MUL ADD2 =SPRT.addr |
|
464 |
+ ( draw ) #02 =SPRT.color |
|
465 | 465 |
|
466 | 466 |
RTS |
467 | 467 |
|
... | ... |
@@ -469,18 +469,18 @@ RTS |
469 | 469 |
|
470 | 470 |
@line-rect ( x1 y1 x2 y2 color ) |
471 | 471 |
|
472 |
- ( load ) =color =rect.y2 =rect.x2 DUP2 =dev/screen.y =rect.y1 DUP2 =dev/screen.x =rect.x1 |
|
472 |
+ ( load ) =color =rect.y2 =rect.x2 DUP2 =SCRN.y =rect.y1 DUP2 =SCRN.x =rect.x1 |
|
473 | 473 |
@line-rect-hor |
474 |
- ( incr ) ~dev/screen.x #0001 ADD2 =dev/screen.x |
|
475 |
- ( draw ) ~rect.y1 =dev/screen.y ~color =dev/screen.color |
|
476 |
- ( draw ) ~rect.y2 =dev/screen.y ~color =dev/screen.color |
|
477 |
- ,line-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP2? POP2 |
|
478 |
- ~rect.y1 =dev/screen.y |
|
474 |
+ ( incr ) ~SCRN.x #0001 ADD2 =SCRN.x |
|
475 |
+ ( draw ) ~rect.y1 =SCRN.y ~color =SCRN.color |
|
476 |
+ ( draw ) ~rect.y2 =SCRN.y ~color =SCRN.color |
|
477 |
+ ,line-rect-hor ~SCRN.x ~rect.x2 LTH2 JMP2? POP2 |
|
478 |
+ ~rect.y1 =SCRN.y |
|
479 | 479 |
@line-rect-ver |
480 |
- ( draw ) ~rect.x1 =dev/screen.x ~color =dev/screen.color |
|
481 |
- ( draw ) ~rect.x2 =dev/screen.x ~color =dev/screen.color |
|
482 |
- ( incr ) ~dev/screen.y #0001 ADD2 =dev/screen.y |
|
483 |
- ,line-rect-ver ~dev/screen.y ~rect.y2 #0001 ADD2 LTH2 JMP2? POP2 |
|
480 |
+ ( draw ) ~rect.x1 =SCRN.x ~color =SCRN.color |
|
481 |
+ ( draw ) ~rect.x2 =SCRN.x ~color =SCRN.color |
|
482 |
+ ( incr ) ~SCRN.y #0001 ADD2 =SCRN.y |
|
483 |
+ ,line-rect-ver ~SCRN.y ~rect.y2 #0001 ADD2 LTH2 JMP2? POP2 |
|
484 | 484 |
|
485 | 485 |
RTS |
486 | 486 |
|
... | ... |
@@ -774,12 +774,12 @@ RTS |
774 | 774 |
|
775 | 775 |
|FE00 @ERROR BRK |
776 | 776 |
|
777 |
-|FF10 ;dev/screen Screen |
|
778 |
-|FF20 ;dev/sprite Sprite |
|
779 |
-|FF30 ;dev/ctrl Controller |
|
780 |
-|FF40 ;dev/key Keyboard |
|
781 |
-|FF50 ;dev/mouse Mouse |
|
782 |
-|FF60 ;dev/file File |
|
777 |
+|FF10 ;SCRN Screen |
|
778 |
+|FF20 ;SPRT Sprite |
|
779 |
+|FF30 ;CTRL Controller |
|
780 |
+|FF40 ;KEYS Keyboard |
|
781 |
+|FF50 ;MOUS Mouse |
|
782 |
+|FF60 ;FILE File |
|
783 | 783 |
|
784 | 784 |
|FFF0 .RESET .FRAME .ERROR ( vectors ) |
785 | 785 |
|FFF8 [ e0fc 30cc 30ac ] ( palette ) |
786 | 786 |
\ No newline at end of file |
787 | 787 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,52 @@ |
1 |
+( tests/jump ) |
|
2 |
+ |
|
3 |
+&Console { pad 8 char 1 byte 1 short 2 } |
|
4 |
+ |
|
5 |
+|0100 @RESET |
|
6 |
+ |
|
7 |
+ ( skip forward with value ) |
|
8 |
+ |
|
9 |
+ #11 =dev/console.byte |
|
10 |
+ #03 JMPS BRK BRK BRK |
|
11 |
+ |
|
12 |
+ ( skip foward with id ) |
|
13 |
+ |
|
14 |
+ #22 =dev/console.byte |
|
15 |
+ ^jump JMPS BRK BRK BRK @jump |
|
16 |
+ |
|
17 |
+ ( skip patterns ) |
|
18 |
+ |
|
19 |
+ #33 =dev/console.byte |
|
20 |
+ |
|
21 |
+ ,skip1 #12 #34 LTH JMP2? POP2 |
|
22 |
+ #ff =dev/console.byte |
|
23 |
+ @skip1 |
|
24 |
+ |
|
25 |
+ #12 #34 LTH ^skip2 #04 SUB MUL JMPS |
|
26 |
+ #ff =dev/console.byte |
|
27 |
+ @skip2 |
|
28 |
+ |
|
29 |
+ #44 =dev/console.byte |
|
30 |
+ |
|
31 |
+ ,end JMP2 |
|
32 |
+ |
|
33 |
+ ( should print aa, bb, cc, dd ) |
|
34 |
+ |
|
35 |
+ @label1 #aa =dev/console.byte ^label3 JMPS |
|
36 |
+ @label2 #cc =dev/console.byte ^label4 JMPS |
|
37 |
+ @label3 #bb =dev/console.byte ^label2 JMPS |
|
38 |
+ @label4 #dd =dev/console.byte BRK |
|
39 |
+ |
|
40 |
+ @end |
|
41 |
+ |
|
42 |
+ ^label1 JMPS |
|
43 |
+ |
|
44 |
+BRK |
|
45 |
+ |
|
46 |
+|c000 @FRAME |
|
47 |
+|d000 @ERROR |
|
48 |
+ |
|
49 |
+|FF00 ;dev/console Console |
|
50 |
+ |
|
51 |
+|FFF0 .RESET .FRAME .ERROR ( vectors ) |
|
52 |
+|FFF8 [ 13fd 1ef3 1bf2 ] ( palette ) |
|
0 | 53 |
\ No newline at end of file |
1 | 54 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,39 @@ |
1 |
+( hello world ) |
|
2 |
+ |
|
3 |
+&Console { pad 8 char 1 byte 1 short 2 } |
|
4 |
+ |
|
5 |
+;a 1 ;b 1 ;c 1 |
|
6 |
+ |
|
7 |
+|0100 @RESET |
|
8 |
+ |
|
9 |
+ ( type: padded muljmp ) |
|
10 |
+ |
|
11 |
+ @loop1 NOP |
|
12 |
+ ~a #01 ADD =a |
|
13 |
+ ~a #d0 LTH ^loop1 MUL JMPS |
|
14 |
+ |
|
15 |
+ ( type: jmppop ) |
|
16 |
+ |
|
17 |
+ @loop2 |
|
18 |
+ ~b #01 ADD =b |
|
19 |
+ ,loop2 ~b #d0 LTH JMP2? POP2 |
|
20 |
+ |
|
21 |
+ ( type: padded jmppop ) |
|
22 |
+ |
|
23 |
+ @loop3 NOP |
|
24 |
+ ~c #01 ADD =c |
|
25 |
+ ~c #d0 LTH ^loop3 SWP JMPS? POP |
|
26 |
+ |
|
27 |
+ ~a =dev/console.byte |
|
28 |
+ ~b =dev/console.byte |
|
29 |
+ ~c =dev/console.byte |
|
30 |
+ |
|
31 |
+BRK |
|
32 |
+ |
|
33 |
+|c000 @FRAME |
|
34 |
+|d000 @ERROR |
|
35 |
+ |
|
36 |
+|FF00 ;dev/console Console |
|
37 |
+ |
|
38 |
+|FFF0 .RESET .FRAME .ERROR ( vectors ) |
|
39 |
+|FFF8 [ 13fd 1ef3 1bf2 ] ( palette ) |
|
0 | 40 |
\ No newline at end of file |
... | ... |
@@ -32,7 +32,7 @@ Uint16 peek16(Stack *s, Uint8 a) { return peek8(s, a * 2) + (peek8(s, a * 2 + 1) |
32 | 32 |
/* I/O */ |
33 | 33 |
void op_brk(Uxn *u) { setflag(&u->status, FLAG_HALT, 1); } |
34 | 34 |
void op_lit(Uxn *u) { u->literal += 1; } |
35 |
-void op_nop(Uxn *u) { printf("0x%02x \n", pop8(&u->wst)); fflush(stdout); } |
|
35 |
+void op_nop(Uxn *u) { (void)u; } |
|
36 | 36 |
void op_jmp(Uxn *u) { Uint8 a = pop8(&u->wst); u->ram.ptr += getflag(&u->status, FLAG_SIGN) ? (Sint8)a : a; } |
37 | 37 |
void op_jsr(Uxn *u) { Uint8 a = pop8(&u->wst); push16(&u->rst, u->ram.ptr); u->ram.ptr += getflag(&u->status, FLAG_SIGN) ? (Sint8)a : a; } |
38 | 38 |
void op_rts(Uxn *u) { u->ram.ptr = pop16(&u->rst); } |
... | ... |
@@ -102,7 +102,7 @@ void (*ops[])(Uxn *u) = { |
102 | 102 |
}; |
103 | 103 |
|
104 | 104 |
Uint8 opr[][2] = { |
105 |
- {0,0}, {0,0}, {0,0}, {2,0}, {2,0}, {0,0}, {2,1}, {3,0}, |
|
105 |
+ {0,0}, {0,0}, {0,0}, {1,0}, {1,0}, {0,0}, {2,1}, {3,0}, |
|
106 | 106 |
{2,0}, {2,0}, {0,0}, {0,0}, {2,1}, {2,1}, {2,1}, {2,1}, |
107 | 107 |
{1,0}, {1,2}, {2,2}, {2,3}, {3,3}, {1,0}, {0,1}, {2,1}, |
108 | 108 |
{2,1}, {2,1}, {2,1}, {2,1}, {2,1}, {2,1}, {2,1}, {2,1}, |