- FILE *f;\r
- char cfg[512], extbuf[16];\r
- int bread = 0;\r
-\r
- if (!game)\r
- {\r
- if (!no_defaults)\r
- {\r
- // set default config\r
- memset(¤tConfig, 0, sizeof(currentConfig));\r
- currentConfig.lastRomFile[0] = 0;\r
- currentConfig.EmuOpt = 0x1f | 0x600; // | confirm_save, cd_leds\r
- currentConfig.PicoOpt = 0x0f | 0xe00; // | use_940, cd_pcm, cd_cdda\r
- currentConfig.PsndRate = 22050; // 44100;\r
- currentConfig.PicoRegion = 0; // auto\r
- currentConfig.PicoAutoRgnOrder = 0x184; // US, EU, JP\r
- currentConfig.Frameskip = -1; // auto\r
- currentConfig.CPUclock = 200;\r
- currentConfig.volume = 50;\r
- currentConfig.KeyBinds[ 0] = 1<<0; // SACB RLDU\r
- currentConfig.KeyBinds[ 4] = 1<<1;\r
- currentConfig.KeyBinds[ 2] = 1<<2;\r
- currentConfig.KeyBinds[ 6] = 1<<3;\r
- currentConfig.KeyBinds[14] = 1<<4;\r
- currentConfig.KeyBinds[13] = 1<<5;\r
- currentConfig.KeyBinds[12] = 1<<6;\r
- currentConfig.KeyBinds[ 8] = 1<<7;\r
- currentConfig.KeyBinds[15] = 1<<26; // switch rend\r
- currentConfig.KeyBinds[10] = 1<<27; // save state\r
- currentConfig.KeyBinds[11] = 1<<28; // load state\r
- currentConfig.KeyBinds[23] = 1<<29; // vol up\r
- currentConfig.KeyBinds[22] = 1<<30; // vol down\r
- currentConfig.gamma = 100;\r
- currentConfig.PicoCDBuffers = 64;\r
- currentConfig.scaling = 0;\r
- }\r
- strncpy(cfg, PicoConfigFile, 511);\r
- if (config_slot != 0)\r
- {\r
- char *p = strrchr(cfg, '.');\r
- if (p == NULL) p = cfg + strlen(cfg);\r
- sprintf(extbuf, ".%i.pbcfg", config_slot);\r
- strncpy(p, extbuf, 511 - (p - cfg));\r
- }\r
- cfg[511] = 0;\r
- } else {\r
- if (config_slot != 0)\r
- sprintf(extbuf, ".%i.pbcfg", config_slot);\r
- else strcpy(extbuf, ".pbcfg");\r
- romfname_ext(cfg, "cfg/", extbuf);\r
- f = fopen(cfg, "rb");\r
- if (!f) romfname_ext(cfg, NULL, ".pbcfg");\r
- else fclose(f);\r
- }\r