... | ... |
@@ -33,18 +33,8 @@ WITH REGARD TO THIS SOFTWARE. |
33 | 33 |
#define PUT2(o, v) { tmp = (v); s->dat[s->ptr - o - 2] = tmp >> 8; s->dat[s->ptr - o - 1] = tmp; } |
34 | 34 |
#define PUSH(stack, v) { if(s->ptr > 254) HALT(2) stack->dat[stack->ptr++] = (v); } |
35 | 35 |
#define PUSH2(stack, v) { if(s->ptr > 253) HALT(2) tmp = (v); stack->dat[stack->ptr] = (v) >> 8; stack->dat[stack->ptr + 1] = (v); stack->ptr += 2; } |
36 |
-#define DEO(a, b) { u->dev[a] = b; if((deo_masks[(a) >> 4] >> ((a) & 0xf)) & 0x1) uxn_deo(u, a); } |
|
37 |
-#define DEI(a, b) { PUT(a, ((dei_masks[(b) >> 4] >> ((b) & 0xf)) & 0x1) ? uxn_dei(u, b) : u->dev[b]) } |
|
38 |
- |
|
39 |
-static |
|
40 |
-Uint16 deo_masks[] = { |
|
41 |
- 0x6a08, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, |
|
42 |
- 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000}; |
|
43 |
- |
|
44 |
-static |
|
45 |
-Uint16 dei_masks[] = { |
|
46 |
- 0x0000, 0x0000, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0000, |
|
47 |
- 0x0000, 0x0000, 0x0000, 0x0000, 0x07fd, 0x0000, 0x0000, 0x0000}; |
|
36 |
+#define DEO(a, b) { u->dev[a] = b; if((deo_mask[(a) >> 4] >> ((a) & 0xf)) & 0x1) uxn_deo(u, a); } |
|
37 |
+#define DEI(a, b) { PUT(a, ((dei_mask[(b) >> 4] >> ((b) & 0xf)) & 0x1) ? uxn_dei(u, b) : u->dev[b]) } |
|
48 | 38 |
|
49 | 39 |
int |
50 | 40 |
uxn_eval(Uxn *u, Uint16 pc) |
... | ... |
@@ -40,6 +40,8 @@ typedef struct Uxn { |
40 | 40 |
extern Uint8 uxn_dei(Uxn *u, Uint8 addr); |
41 | 41 |
extern void uxn_deo(Uxn *u, Uint8 addr); |
42 | 42 |
extern int uxn_halt(Uxn *u, Uint8 instr, Uint8 err, Uint16 addr); |
43 |
+extern Uint16 dei_mask[]; |
|
44 |
+extern Uint16 deo_mask[]; |
|
43 | 45 |
|
44 | 46 |
/* built-ins */ |
45 | 47 |
|
... | ... |
@@ -17,6 +17,9 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
17 | 17 |
WITH REGARD TO THIS SOFTWARE. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
+Uint16 deo_mask[] = {0x6a08, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000}; |
|
21 |
+Uint16 dei_mask[] = {0x0000, 0x0000, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07fd, 0x0000, 0x0000, 0x0000}; |
|
22 |
+ |
|
20 | 23 |
static int |
21 | 24 |
emu_error(char *msg, const char *err) |
22 | 25 |
{ |
... | ... |
@@ -46,6 +46,9 @@ static SDL_AudioDeviceID audio_id; |
46 | 46 |
static SDL_Rect gRect; |
47 | 47 |
static SDL_Thread *stdin_thread; |
48 | 48 |
|
49 |
+Uint16 deo_mask[] = {0x6a08, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000}; |
|
50 |
+Uint16 dei_mask[] = {0x0000, 0x0000, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07fd, 0x0000, 0x0000, 0x0000}; |
|
51 |
+ |
|
49 | 52 |
/* devices */ |
50 | 53 |
|
51 | 54 |
static Uint8 zoom = 1; |