uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit d8532e7c0e8bf806715e5f6f628c542e03ac3946
parent b737dfca85029b618d7d30a1d0266531c9bff53f
Author: neauoire <aliceffekt@gmail.com>
Date:   Tue, 15 Aug 2023 19:21:06 -0700

system_load() is now private

Diffstat:
Msrc/devices/system.c | 28++++++++++++++--------------
Msrc/devices/system.h | 1-
2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/devices/system.c b/src/devices/system.c @@ -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) { diff --git a/src/devices/system.h b/src/devices/system.h @@ -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);