port: save config on exit

This commit is contained in:
fgsfds committed 2023-08-22 20:37:18 +02:00
1 parent 47258ebd7f
commit 143d2a107a
3 files changed
+10 -1

No files matched your search

+2
View File
@@ -2,6 +2,8 @@
#include <PR/ultratypes.h>
#define CONFIG_FNAME "./pd.ini"
void configInit(void);
s32 configLoad(const char *fname);
s32 configSave(const char *fname);
-1
View File
@@ -8,7 +8,6 @@
#define CONFIG_MAX_STR 512
#define CONFIG_MAX_SECNAME 128
#define CONFIG_FNAME "./pd.ini"
enum configtype {
CONFIG_END,
+8
View File
@@ -52,6 +52,12 @@ void bootCreateSched(void)
}
}
static void cleanup(void)
{
configSave(CONFIG_FNAME);
// TODO: actually shut down all subsystems
}
int main(int argc, const char **argv)
{
fsInit();
@@ -61,6 +67,8 @@ int main(int argc, const char **argv)
audioInit();
romdataInit();
atexit(cleanup);
bootCreateSched();
osMemSize = configGetInt("Game.MemorySize", 16) * 1024 * 1024;