Removed file ID passing to file_deo
This commit is contained in:
parent
b3fcbe9874
commit
ed24273f66
|
@ -245,44 +245,76 @@ file_delete(UxnFile *c)
|
||||||
/* IO */
|
/* IO */
|
||||||
|
|
||||||
void
|
void
|
||||||
file_deo(Uint8 id, Uint8 port)
|
file_deo(Uint8 port)
|
||||||
{
|
{
|
||||||
UxnFile *c = &uxn_file[id];
|
|
||||||
Uint16 addr, len, res;
|
Uint16 addr, len, res;
|
||||||
Uint8 *d = id ? &uxn.dev[0xb0] : &uxn.dev[0xa0];
|
|
||||||
switch(port) {
|
switch(port) {
|
||||||
case 0x5:
|
case 0xa5:
|
||||||
addr = PEEK2(d + 0x4);
|
addr = PEEK2(&uxn.dev[0xa4]);
|
||||||
len = PEEK2(d + 0xa);
|
len = PEEK2(&uxn.dev[0xaa]);
|
||||||
if(len > 0x10000 - addr)
|
if(len > 0x10000 - addr)
|
||||||
len = 0x10000 - addr;
|
len = 0x10000 - addr;
|
||||||
res = file_stat(c, &uxn.ram[addr], len);
|
res = file_stat(&uxn_file[0], &uxn.ram[addr], len);
|
||||||
POKE2(d + 0x2, res);
|
POKE2(&uxn.dev[0xa2], res);
|
||||||
break;
|
break;
|
||||||
case 0x6:
|
case 0xa6:
|
||||||
res = file_delete(c);
|
res = file_delete(&uxn_file[0]);
|
||||||
POKE2(d + 0x2, res);
|
POKE2(&uxn.dev[0xa2], res);
|
||||||
break;
|
break;
|
||||||
case 0x9:
|
case 0xa9:
|
||||||
addr = PEEK2(d + 0x8);
|
addr = PEEK2(&uxn.dev[0xa8]);
|
||||||
res = file_init(c, (char *)&uxn.ram[addr], 0x10000 - addr, 0);
|
res = file_init(&uxn_file[0], (char *)&uxn.ram[addr], 0x10000 - addr, 0);
|
||||||
POKE2(d + 0x2, res);
|
POKE2(&uxn.dev[0xa2], res);
|
||||||
break;
|
break;
|
||||||
case 0xd:
|
case 0xad:
|
||||||
addr = PEEK2(d + 0xc);
|
addr = PEEK2(&uxn.dev[0xac]);
|
||||||
len = PEEK2(d + 0xa);
|
len = PEEK2(&uxn.dev[0xaa]);
|
||||||
if(len > 0x10000 - addr)
|
if(len > 0x10000 - addr)
|
||||||
len = 0x10000 - addr;
|
len = 0x10000 - addr;
|
||||||
res = file_read(c, &uxn.ram[addr], len);
|
res = file_read(&uxn_file[0], &uxn.ram[addr], len);
|
||||||
POKE2(d + 0x2, res);
|
POKE2(&uxn.dev[0xa2], res);
|
||||||
break;
|
break;
|
||||||
case 0xf:
|
case 0xaf:
|
||||||
addr = PEEK2(d + 0xe);
|
addr = PEEK2(&uxn.dev[0xae]);
|
||||||
len = PEEK2(d + 0xa);
|
len = PEEK2(&uxn.dev[0xaa]);
|
||||||
if(len > 0x10000 - addr)
|
if(len > 0x10000 - addr)
|
||||||
len = 0x10000 - addr;
|
len = 0x10000 - addr;
|
||||||
res = file_write(c, &uxn.ram[addr], len, d[0x7]);
|
res = file_write(&uxn_file[0], &uxn.ram[addr], len, uxn.dev[0xa7]);
|
||||||
POKE2(d + 0x2, res);
|
POKE2(&uxn.dev[0xa2], res);
|
||||||
|
break;
|
||||||
|
/* File 2 */
|
||||||
|
case 0xb5:
|
||||||
|
addr = PEEK2(&uxn.dev[0xb4]);
|
||||||
|
len = PEEK2(&uxn.dev[0xba]);
|
||||||
|
if(len > 0x10000 - addr)
|
||||||
|
len = 0x10000 - addr;
|
||||||
|
res = file_stat(&uxn_file[1], &uxn.ram[addr], len);
|
||||||
|
POKE2(&uxn.dev[0xb2], res);
|
||||||
|
break;
|
||||||
|
case 0xb6:
|
||||||
|
res = file_delete(&uxn_file[1]);
|
||||||
|
POKE2(&uxn.dev[0xb2], res);
|
||||||
|
break;
|
||||||
|
case 0xb9:
|
||||||
|
addr = PEEK2(&uxn.dev[0xb8]);
|
||||||
|
res = file_init(&uxn_file[1], (char *)&uxn.ram[addr], 0x10000 - addr, 0);
|
||||||
|
POKE2(&uxn.dev[0xb2], res);
|
||||||
|
break;
|
||||||
|
case 0xbd:
|
||||||
|
addr = PEEK2(&uxn.dev[0xbc]);
|
||||||
|
len = PEEK2(&uxn.dev[0xba]);
|
||||||
|
if(len > 0x10000 - addr)
|
||||||
|
len = 0x10000 - addr;
|
||||||
|
res = file_read(&uxn_file[1], &uxn.ram[addr], len);
|
||||||
|
POKE2(&uxn.dev[0xb2], res);
|
||||||
|
break;
|
||||||
|
case 0xbf:
|
||||||
|
addr = PEEK2(&uxn.dev[0xbe]);
|
||||||
|
len = PEEK2(&uxn.dev[0xba]);
|
||||||
|
if(len > 0x10000 - addr)
|
||||||
|
len = 0x10000 - addr;
|
||||||
|
res = file_write(&uxn_file[1], &uxn.ram[addr], len, uxn.dev[0xb7]);
|
||||||
|
POKE2(&uxn.dev[0xb2], res);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,4 +12,4 @@ WITH REGARD TO THIS SOFTWARE.
|
||||||
#define POLYFILEY 2
|
#define POLYFILEY 2
|
||||||
#define DEV_FILE0 0xa
|
#define DEV_FILE0 0xa
|
||||||
|
|
||||||
void file_deo(Uint8 id, Uint8 port);
|
void file_deo(Uint8 port);
|
||||||
|
|
|
@ -69,8 +69,8 @@ emu_deo(Uint8 addr, Uint8 value)
|
||||||
break;
|
break;
|
||||||
case 0x10: console_deo(p); break;
|
case 0x10: console_deo(p); break;
|
||||||
case 0x20: screen_deo(p); break;
|
case 0x20: screen_deo(p); break;
|
||||||
case 0xa0: file_deo(0, p); break;
|
case 0xa0: file_deo(addr); break;
|
||||||
case 0xb0: file_deo(1, p); break;
|
case 0xb0: file_deo(addr); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,8 @@ emu_deo(Uint8 addr, Uint8 value)
|
||||||
switch(addr & 0xf0) {
|
switch(addr & 0xf0) {
|
||||||
case 0x00: system_deo(p); break;
|
case 0x00: system_deo(p); break;
|
||||||
case 0x10: console_deo(p); break;
|
case 0x10: console_deo(p); break;
|
||||||
case 0xa0: file_deo(0, p); break;
|
case 0xa0: file_deo(addr); break;
|
||||||
case 0xb0: file_deo(1, p); break;
|
case 0xb0: file_deo(addr); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue