diff --git a/src/gba/context/context.c b/src/gba/context/context.c index 21e9be4ae..d9e33730a 100644 --- a/src/gba/context/context.c +++ b/src/gba/context/context.c @@ -21,7 +21,9 @@ bool GBAContextInit(struct GBAContext* context, const char* port) { context->fname = 0; context->save = 0; context->renderer = 0; +#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 GBADirectorySetInit(&context->dirs); +#endif memset(context->components, 0, sizeof(context->components)); if (!context->gba || !context->cpu) { @@ -79,11 +81,17 @@ void GBAContextDeinit(struct GBAContext* context) { mappedMemoryFree(context->gba, 0); mappedMemoryFree(context->cpu, 0); GBAConfigDeinit(&context->config); +#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 GBADirectorySetDeinit(&context->dirs); +#endif } bool GBAContextLoadROM(struct GBAContext* context, const char* path, bool autoloadSave) { +#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 context->rom = GBADirectorySetOpenPath(&context->dirs, path, GBAIsROM); +#else + context->rom = VFileOpen(path, O_RDONLY); +#endif if (!context->rom) { return false; } @@ -106,7 +114,9 @@ bool GBAContextLoadROM(struct GBAContext* context, const char* path, bool autolo void GBAContextUnloadROM(struct GBAContext* context) { GBAUnloadROM(context->gba); +#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 GBADirectorySetDetachBase(&context->dirs); +#endif if (context->rom) { context->rom->close(context->rom); context->rom = 0; diff --git a/src/gba/context/context.h b/src/gba/context/context.h index d71385074..36168371a 100644 --- a/src/gba/context/context.h +++ b/src/gba/context/context.h @@ -21,7 +21,9 @@ struct GBAContext { const char* fname; struct VFile* save; struct VFile* bios; +#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 struct GBADirectorySet dirs; +#endif struct ARMComponent* components[GBA_COMPONENT_MAX]; struct GBAConfig config; struct GBAOptions opts; diff --git a/src/gba/context/directories.c b/src/gba/context/directories.c index 23648567c..68f59dc01 100644 --- a/src/gba/context/directories.c +++ b/src/gba/context/directories.c @@ -8,6 +8,7 @@ #include "gba/context/config.h" #include "util/vfs.h" +#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 void GBADirectorySetInit(struct GBADirectorySet* dirs) { dirs->base = 0; dirs->archive = 0; @@ -142,3 +143,4 @@ void GBADirectorySetMapOptions(struct GBADirectorySet* dirs, const struct GBAOpt } } } +#endif diff --git a/src/gba/context/directories.h b/src/gba/context/directories.h index 7292c59ae..e0a74c53e 100644 --- a/src/gba/context/directories.h +++ b/src/gba/context/directories.h @@ -8,6 +8,7 @@ #include "util/common.h" +#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 struct VDir; struct GBADirectorySet { @@ -29,5 +30,6 @@ struct VFile* GBADirectorySetOpenPath(struct GBADirectorySet* dirs, const char* struct GBAOptions; void GBADirectorySetMapOptions(struct GBADirectorySet* dirs, const struct GBAOptions* opts); +#endif #endif diff --git a/src/gba/supervisor/thread.h b/src/gba/supervisor/thread.h index 2a70d233c..9eee6a659 100644 --- a/src/gba/supervisor/thread.h +++ b/src/gba/supervisor/thread.h @@ -48,7 +48,9 @@ struct GBAThread { struct GBAVideoRenderer* renderer; struct GBASIODriverSet sioDrivers; struct ARMDebugger* debugger; +#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 struct GBADirectorySet dirs; +#endif struct VFile* rom; struct VFile* save; struct VFile* bios;