This commit is contained in:
zilmar 2015-11-15 07:57:03 +11:00
commit 56ebb74588
5 changed files with 48 additions and 23 deletions

View File

@ -375,6 +375,11 @@ void CN64System::StartEmulation(bool NewThread)
void CN64System::StartEmulationThread(ThreadInfo * Info)
{
if (g_Settings->LoadBool(Setting_CN64TimeCritical))
{
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_TIME_CRITICAL);
}
CoInitialize(NULL);
EmulationStarting(*Info->ThreadHandle, Info->ThreadID);

View File

@ -182,7 +182,11 @@ void CAudioPlugin::DacrateChanged(SYSTEM_TYPE Type)
void CAudioPlugin::AudioThread(CAudioPlugin * _this) {
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
for (;;)
if (g_Settings->LoadBool(Setting_CN64TimeCritical))
{
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_HIGHEST);
}
for (;;)
{
_this->AiUpdate(true);
}

View File

@ -109,6 +109,7 @@ void CSettings::AddHowToHandleSetting()
AddHandler(Setting_ApplicationName, new CSettingTypeTempString(""));
AddHandler(Setting_UseFromRegistry, new CSettingTypeApplication("Settings", "Use Registry", (uint32_t)false));
AddHandler(Setting_RdbEditor, new CSettingTypeApplication("", "Rdb Editor", false));
AddHandler(Setting_CN64TimeCritical,new CSettingTypeApplication("","CN64TimeCritical",false));
AddHandler(Setting_PluginPageFirst, new CSettingTypeApplication("", "Plugin Page First", false));
AddHandler(Setting_DisableScrSaver, new CSettingTypeApplication("", "Disable Screen Saver", (uint32_t)true));
AddHandler(Setting_AutoSleep, new CSettingTypeApplication("", "Auto Sleep", (uint32_t)true));

View File

@ -48,6 +48,7 @@ enum SettingID
Setting_ApplicationName,
Setting_UseFromRegistry,
Setting_RdbEditor,
Setting_CN64TimeCritical,
Setting_PluginPageFirst,
Setting_DisableScrSaver,
Setting_AutoSleep,

View File

@ -545,8 +545,13 @@ void CRomBrowser::NotificationCB(LPCWSTR Status, CRomBrowser * /*_this*/)
g_Notify->DisplayMessage(5, Status);
}
static const char* ROM_extensions[] = {
"zip", "7z", "v64", "z64", "n64", "rom", "jap", "pal", "usa", "eur", "bin",
};
void CRomBrowser::AddFileNameToList(strlist & FileList, const stdstr & Directory, CPath & File)
{
uint8_t i;
if (FileList.size() > 3000)
{
return;
@ -555,14 +560,16 @@ void CRomBrowser::AddFileNameToList(strlist & FileList, const stdstr & Directory
stdstr Drive, Dir, Name, Extension;
File.GetComponents(NULL, &Dir, &Name, &Extension);
Extension.ToLower();
if (Extension == "zip" || Extension == "7z" || Extension == "v64" || Extension == "z64" ||
Extension == "n64" || Extension == "rom" || Extension == "jap" || Extension == "pal" ||
Extension == "usa" || Extension == "eur" || Extension == "bin")
{
stdstr FileName = Directory + Name + Extension;
FileName.ToLower();
FileList.push_back(FileName);
}
for (i = 0; i < sizeof(ROM_extensions) / sizeof(ROM_extensions[0]); i++)
{
if (Extension == ROM_extensions[i])
{
stdstr FileName = Directory + Name + Extension;
FileName.ToLower();
FileList.push_back(FileName);
break;
}
}
}
void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, const stdstr & Directory, const char * lpLastRom)
@ -579,6 +586,10 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
do
{
uint8_t ext_ID;
int8_t new_list_entry = 0;
const uint8_t exts = sizeof(ROM_extensions) / sizeof(ROM_extensions[0]);
//TODO: Fix exception on Windows XP (Visual Studio 2010+)
//WriteTraceF(TraceDebug,__FUNCTION__ ": 2 %s m_StopRefresh = %d",(LPCSTR)SearchPath,m_StopRefresh);
if (m_StopRefresh) { break; }
@ -598,13 +609,20 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
stdstr Extension = SearchPath.GetExtension();
Extension.ToLower();
if (Extension == "zip" || Extension == "v64" || Extension == "z64" || Extension == "n64" ||
Extension == "rom" || Extension == "jap" || Extension == "pal" || Extension == "usa" ||
Extension == "eur" || Extension == "bin")
{
AddRomToList(SearchPath, lpLastRom);
continue;
}
for (ext_ID = 0; ext_ID < exts; ext_ID++)
{
if (Extension == ROM_extensions[ext_ID] && Extension != "7z")
{
new_list_entry = 1;
break;
}
}
if (new_list_entry)
{
AddRomToList(SearchPath, lpLastRom);
continue;
}
if (Extension == "7z")
{
try
@ -641,11 +659,7 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
_splitpath(FileName.c_str(), drive2, dir2, FileName2, ext2);
WriteTraceF(TraceDebug, __FUNCTION__ ": 6 %s", ext2);
if (_stricmp(ext2, ".v64") != 0 && _stricmp(ext2, ".z64") != 0 &&
_stricmp(ext2, ".n64") != 0 && _stricmp(ext2, ".rom") != 0 &&
_stricmp(ext2, ".jap") != 0 && _stricmp(ext2, ".pal") != 0 &&
_stricmp(ext2, ".usa") != 0 && _stricmp(ext2, ".eur") != 0 &&
_stricmp(ext2, ".bin") == 0)
if (_stricmp(ext2, ".bin") == 0)
{
continue;
}