mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-26 07:45:14 +00:00
system_load() is now private
This commit is contained in:
parent
b737dfca85
commit
d8532e7c0e
2 changed files with 14 additions and 15 deletions
|
@ -22,6 +22,20 @@ static const char *errors[] = {
|
|||
"overflow",
|
||||
"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
|
||||
system_print(Stack *s, char *name)
|
||||
{
|
||||
|
@ -55,20 +69,6 @@ system_error(char *msg, const char *err)
|
|||
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
|
||||
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_inspect(Uxn *u);
|
||||
int system_version(char *emulator, char *date);
|
||||
int system_load(Uxn *u, char *filename);
|
||||
int system_error(char *msg, const char *err);
|
||||
int system_init(Uxn *u, Uint8 *ram, char *rom);
|
||||
|
||||
|
|
Loading…
Reference in a new issue