Add file reading with .File/read DEI(2).

This commit is contained in:
Andrew Alderwick 2022-03-17 19:03:41 +00:00
parent 205cc89bcb
commit 7ce8cc1d24
1 changed files with 9 additions and 0 deletions

View File

@ -198,5 +198,14 @@ file_i_deo(int instance, Device *d, Uint8 port)
Uint8
file_i_dei(int instance, Device *d, Uint8 port)
{
UxnFile *c = &uxn_file[instance];
Uint16 res;
switch(port) {
case 0xc:
case 0xd:
res = file_read(c, &d->dat[port], 1);
DEVPOKE16(0x2, res);
break;
}
return d->dat[port];
}