Removed file dei event

This commit is contained in:
Devine Lu Linvega 2023-03-03 21:04:26 -08:00
parent 9ac7f06fde
commit aeceaf75bf
5 changed files with 7 additions and 24 deletions

View File

@ -271,18 +271,3 @@ file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port)
break; 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];
}

View File

@ -13,4 +13,3 @@ WITH REGARD TO THIS SOFTWARE.
#define DEV_FILE0 0xa #define DEV_FILE0 0xa
void file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port); void file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port);
Uint8 file_dei(Uint8 id, Uint8 *d, Uint8 port);

View File

@ -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 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 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 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 static
Uint16 callbacks[] = { Uint16 send_events[] = {
0x6a08, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 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 int
uxn_eval(Uxn *u, Uint16 pc) uxn_eval(Uxn *u, Uint16 pc)

View File

@ -52,8 +52,6 @@ emu_dei(Uxn *u, Uint8 addr)
{ {
Uint8 p = addr & 0x0f, d = addr & 0xf0; Uint8 p = addr & 0x0f, d = addr & 0xf0;
switch(d) { 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); case 0xc0: return datetime_dei(u, addr);
} }
return u->dev[addr]; return u->dev[addr];

View File

@ -118,8 +118,6 @@ emu_dei(Uxn *u, Uint8 addr)
case 0x40: return audio_dei(1, &u->dev[d], p); case 0x40: return audio_dei(1, &u->dev[d], p);
case 0x50: return audio_dei(2, &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 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); case 0xc0: return datetime_dei(u, addr);
} }
return u->dev[addr]; return u->dev[addr];