bool naomi_cart_SelectFile(void* handle) { cfgLoadStr("config", "image", SelectedFile, "null"); #if HOST_OS == OS_WINDOWS if (strcmp(SelectedFile, "null") == 0) { OPENFILENAME ofn = { 0 }; ofn.lStructSize = sizeof(OPENFILENAME); ofn.hInstance = (HINSTANCE)GetModuleHandle(0); ofn.lpstrFile = SelectedFile; ofn.nMaxFile = MAX_PATH; ofn.lpstrFilter = "*.lst\0*.lst\0\0"; ofn.nFilterIndex = 0; ofn.hwndOwner = (HWND)handle; ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR; if (GetOpenFileName(&ofn) <= 0) return true; } #endif if (!naomi_cart_LoadRom(SelectedFile)) { cfgSaveStr("emu", "gamefile", "naomi_bios"); } else { cfgSaveStr("emu", "gamefile", SelectedFile); } printf("EEPROM file : %s.eeprom\n", SelectedFile); return true; }
string cfgLoadStr(const wchar * Section, const wchar * Key, const wchar* Default) { if(!cfgdb.has_entry(string(Section), string(Key))) { cfgSaveStr(Section, Key, Default); } return cfgdb.get(string(Section), string(Key), string(Default)); }
s32 EXPORT_CALL SetEmuSetting(u32 sid,void* value) { wchar* sptr=(wchar*)value; u32* tptr=(u32*)value; switch(sid) { _esai_(DYNAREC_ENABLED,dynarec.Enable,1); SwitchCpu();//switch cpu if needed break; _esai_(DYNAREC_CPPASS,dynarec.CPpass,1); if (sh4_cpu->ResetCache) sh4_cpu->ResetCache(); break; _esai_(DYNAREC_SAFEMODE,dynarec.Safe,1); if (sh4_cpu->ResetCache) sh4_cpu->ResetCache(); break; _esai_(DYNAREC_UCFPU,dynarec.UnderclockFpu,1); if (sh4_cpu->ResetCache) sh4_cpu->ResetCache(); break; _esai_(DREAMCAST_CABLE,dreamcast.cable,3); break; _esai_(DREAMCAST_RTC,dreamcast.RTC,0xFFFFFFFF); break; _esai_(DREAMCAST_REGION,dreamcast.region,3); break; _esai_(DREAMCAST_BROADCAST,dreamcast.broadcast,4); break; _esai_(EMULATOR_ASTART,emulator.AutoStart,1); break; default: if (sid<NDCS_COUNT) { cfgSaveStr(_T("nullDC_plugins"),ndc_snames[sid-NDCS_PLUGIN_PVR],sptr); return rv_ok; } else return rv_error; } return rv_ok; }
void EXPORT_CALL cfgSaveInt(const wchar * Section, const wchar * Key, s32 Int) { wchar tmp[32]; swprintf(tmp,L"%d", Int); cfgSaveStr(Section,Key,tmp); }