diff --git a/src/devices/file.c b/src/devices/file.c index 6edbf59..bd83619 100644 --- a/src/devices/file.c +++ b/src/devices/file.c @@ -271,18 +271,3 @@ file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port) break; } } - -Uint8 -file_dei(Uint8 id, Uint8 *d, Uint8 port) -{ - UxnFile *c = &uxn_file[id]; - Uint16 res; - switch(port) { - case 0xc: - case 0xd: - res = file_read(c, &d[port], 1); - POKE16(d + 0x2, res); - break; - } - return d[port]; -} diff --git a/src/devices/file.h b/src/devices/file.h index 2a6fa13..c839cfc 100644 --- a/src/devices/file.h +++ b/src/devices/file.h @@ -13,4 +13,3 @@ WITH REGARD TO THIS SOFTWARE. #define DEV_FILE0 0xa void file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port); -Uint8 file_dei(Uint8 id, Uint8 *d, Uint8 port); diff --git a/src/uxn-fast.c b/src/uxn-fast.c index b9e02ce..b67b6be 100644 --- a/src/uxn-fast.c +++ b/src/uxn-fast.c @@ -34,13 +34,16 @@ WITH REGARD TO THIS SOFTWARE. #define PUT2(o, v) { tmp = (v); s->dat[s->ptr - o - 2] = tmp >> 8; s->dat[s->ptr - o - 1] = tmp; } #define PUSH(stack, v) { stack->dat[stack->ptr++] = (v); } #define PUSH2(stack, v) { tmp = (v); stack->dat[stack->ptr] = (v) >> 8; stack->dat[stack->ptr + 1] = (v); stack->ptr += 2; } -#define SEND(a, b) { u->dev[a] = b; if((callbacks[(a) >> 4] >> ((a) & 0xf)) & 0x1) u->deo(u, a); } +#define SEND(a, b) { u->dev[a] = b; if((send_events[(a) >> 4] >> ((a) & 0xf)) & 0x1) u->deo(u, a); } static -Uint16 callbacks[] = { +Uint16 send_events[] = { 0x6a08, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, - 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000 -}; + 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000 }; +static +Uint16 receive_events[] = { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; int uxn_eval(Uxn *u, Uint16 pc) diff --git a/src/uxncli.c b/src/uxncli.c index d8d4a63..e2b0fb0 100644 --- a/src/uxncli.c +++ b/src/uxncli.c @@ -52,8 +52,6 @@ emu_dei(Uxn *u, Uint8 addr) { Uint8 p = addr & 0x0f, d = addr & 0xf0; switch(d) { - case 0xa0: return file_dei(0, &u->dev[d], p); - case 0xb0: return file_dei(1, &u->dev[d], p); case 0xc0: return datetime_dei(u, addr); } return u->dev[addr]; diff --git a/src/uxnemu.c b/src/uxnemu.c index 47186b7..09f1bbd 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -118,8 +118,6 @@ emu_dei(Uxn *u, Uint8 addr) case 0x40: return audio_dei(1, &u->dev[d], p); case 0x50: return audio_dei(2, &u->dev[d], p); case 0x60: return audio_dei(3, &u->dev[d], p); - case 0xa0: return file_dei(0, &u->dev[d], p); - case 0xb0: return file_dei(1, &u->dev[d], p); case 0xc0: return datetime_dei(u, addr); } return u->dev[addr];