Fixed uxn-fast.c

This commit is contained in:
Andrew Alderwick 2021-08-01 22:40:14 +01:00
parent 6e21f3aba0
commit 5045a4ca52
1 changed files with 1 additions and 13 deletions

View File

@ -4030,24 +4030,13 @@ error:
int
bootuxn(Uxn *u)
{
size_t i;
unsigned int i;
char *cptr = (char *)u;
for(i = 0; i < sizeof(*u); i++)
cptr[i] = 0;
return 1;
}
int
loaduxn(Uxn *u, char *filepath)
{
FILE *f;
if(!(f = fopen(filepath, "rb")))
return 0;
fread(u->ram.dat + PAGE_PROGRAM, sizeof(u->ram.dat) - PAGE_PROGRAM, 1, f);
fprintf(stderr, "Uxn loaded[%s].\n", filepath);
return 1;
}
Device *
portuxn(Uxn *u, Uint8 id, char *name, void (*talkfn)(Device *d, Uint8 b0, Uint8 w))
{
@ -4056,6 +4045,5 @@ portuxn(Uxn *u, Uint8 id, char *name, void (*talkfn)(Device *d, Uint8 b0, Uint8
d->u = u;
d->mem = u->ram.dat;
d->talk = talkfn;
fprintf(stderr, "Device added #%02x: %s, at 0x%04x \n", id, name, d->addr);
return d;
}