system_load() is now private
This commit is contained in:
parent
b737dfca85
commit
d8532e7c0e
|
@ -22,6 +22,20 @@ static const char *errors[] = {
|
||||||
"overflow",
|
"overflow",
|
||||||
"division by zero"};
|
"division by zero"};
|
||||||
|
|
||||||
|
static int
|
||||||
|
system_load(Uxn *u, char *filename)
|
||||||
|
{
|
||||||
|
int l, i = 0;
|
||||||
|
FILE *f = fopen(filename, "rb");
|
||||||
|
if(!f)
|
||||||
|
return 0;
|
||||||
|
l = fread(&u->ram[PAGE_PROGRAM], 0x10000 - PAGE_PROGRAM, 1, f);
|
||||||
|
while(l && ++i < RAM_PAGES)
|
||||||
|
l = fread(u->ram + 0x10000 * i, 0x10000, 1, f);
|
||||||
|
fclose(f);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
system_print(Stack *s, char *name)
|
system_print(Stack *s, char *name)
|
||||||
{
|
{
|
||||||
|
@ -55,20 +69,6 @@ system_error(char *msg, const char *err)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
system_load(Uxn *u, char *filename)
|
|
||||||
{
|
|
||||||
int l, i = 0;
|
|
||||||
FILE *f = fopen(filename, "rb");
|
|
||||||
if(!f)
|
|
||||||
return 0;
|
|
||||||
l = fread(&u->ram[PAGE_PROGRAM], 0x10000 - PAGE_PROGRAM, 1, f);
|
|
||||||
while(l && ++i < RAM_PAGES)
|
|
||||||
l = fread(u->ram + 0x10000 * i, 0x10000, 1, f);
|
|
||||||
fclose(f);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
system_inspect(Uxn *u)
|
system_inspect(Uxn *u)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,6 @@ void system_connect(Uint8 device, Uint8 ver, Uint16 dei, Uint16 deo);
|
||||||
void system_reboot(Uxn *u, char *rom, int soft);
|
void system_reboot(Uxn *u, char *rom, int soft);
|
||||||
void system_inspect(Uxn *u);
|
void system_inspect(Uxn *u);
|
||||||
int system_version(char *emulator, char *date);
|
int system_version(char *emulator, char *date);
|
||||||
int system_load(Uxn *u, char *filename);
|
|
||||||
int system_error(char *msg, const char *err);
|
int system_error(char *msg, const char *err);
|
||||||
int system_init(Uxn *u, Uint8 *ram, char *rom);
|
int system_init(Uxn *u, Uint8 *ram, char *rom);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue