- // save SRAM
- if((currentConfig.EmuOpt & 1) && SRam.changed) {
- emu_SaveLoadGame(0, 1);
- SRam.changed = 0;
- }
-
- if (!(currentConfig.EmuOpt & 0x20)) {
- FILE *f = fopen(PicoConfigFile, "r+b");
- if (!f) emu_WriteConfig(0);
- else {
- // if we already have config, reload it, except last ROM
- fseek(f, sizeof(currentConfig.lastRomFile), SEEK_SET);
- fread(¤tConfig.EmuOpt, 1, sizeof(currentConfig) - sizeof(currentConfig.lastRomFile), f);
- fseek(f, 0, SEEK_SET);
- fwrite(¤tConfig, 1, sizeof(currentConfig), f);
- fflush(f);
- fclose(f);
- }
- }
-
- PicoExit();
-}
-
-void emu_setDefaultConfig(void)
-{
- memset(¤tConfig, 0, sizeof(currentConfig));
- currentConfig.lastRomFile[0] = 0;
- currentConfig.EmuOpt = 0x1f | 0x680; // | confirm_save, cd_leds, 16bit rend
- currentConfig.PicoOpt = 0x07 | 0xc00; // | cd_pcm, cd_cdda
- currentConfig.PsndRate = 22050;
- currentConfig.PicoRegion = 0; // auto
- currentConfig.PicoAutoRgnOrder = 0x184; // US, EU, JP
- currentConfig.Frameskip = -1; // auto
- currentConfig.volume = 50;
- currentConfig.KeyBinds[ 2] = 1<<0; // SACB RLDU
- currentConfig.KeyBinds[ 3] = 1<<1;
- currentConfig.KeyBinds[ 0] = 1<<2;
- currentConfig.KeyBinds[ 1] = 1<<3;
- currentConfig.KeyBinds[ 5] = 1<<4;
- currentConfig.KeyBinds[ 6] = 1<<5;
- currentConfig.KeyBinds[ 7] = 1<<6;
- currentConfig.KeyBinds[ 4] = 1<<7;
- currentConfig.KeyBinds[13] = 1<<26; // switch rend
- currentConfig.KeyBinds[ 8] = 1<<27; // save state
- currentConfig.KeyBinds[ 9] = 1<<28; // load state
- currentConfig.KeyBinds[12] = 1<<29; // vol up
- currentConfig.KeyBinds[11] = 1<<30; // vol down
- currentConfig.PicoCDBuffers = 0;
- currentConfig.scaling = 0;
+ defaultConfig.s_PsndRate = 22050;
+ defaultConfig.s_PicoCDBuffers = 0;
+ defaultConfig.KeyBinds[ 2] = 1<<0; // SACB RLDU
+ defaultConfig.KeyBinds[ 3] = 1<<1;
+ defaultConfig.KeyBinds[ 0] = 1<<2;
+ defaultConfig.KeyBinds[ 1] = 1<<3;
+ defaultConfig.KeyBinds[ 5] = 1<<4;
+ defaultConfig.KeyBinds[ 6] = 1<<5;
+ defaultConfig.KeyBinds[ 7] = 1<<6;
+ defaultConfig.KeyBinds[ 4] = 1<<7;
+ defaultConfig.KeyBinds[13] = 1<<26; // switch rend
+ defaultConfig.KeyBinds[ 8] = 1<<27; // save state
+ defaultConfig.KeyBinds[ 9] = 1<<28; // load state
+ defaultConfig.KeyBinds[12] = 1<<29; // vol up
+ defaultConfig.KeyBinds[11] = 1<<30; // vol down
+ defaultConfig.scaling = 0;