[Project64] Add Debug languages

This commit is contained in:
zilmar 2016-06-04 19:07:20 +10:00
parent be1f6c9521
commit 47b012bd4a
5 changed files with 36 additions and 7 deletions

View File

@ -501,8 +501,8 @@ void CLanguage::LoadDefaultStrings(void)
}
CLanguage::CLanguage() :
m_emptyString(""),
m_LanguageLoaded(false)
m_emptyString(""),
m_LanguageLoaded(false)
{
LoadDefaultStrings();
if (g_Settings)
@ -513,12 +513,18 @@ m_LanguageLoaded(false)
bool CLanguage::LoadCurrentStrings(void)
{
LanguageList LangList = GetLangList();
stdstr Filename;
//clear all the current strings loaded
m_CurrentStrings.clear();
if (g_Settings->LoadBool(Debugger_DebugLanguage))
{
m_LanguageLoaded = true;
return true;
}
LanguageList LangList = GetLangList();
stdstr Filename;
//Find the file name of the current language
for (LanguageList::iterator Language = LangList.begin(); Language != LangList.end(); Language++)
{
@ -599,6 +605,15 @@ const std::string & CLanguage::GetString(LanguageStringID StringID)
return CurrentString->second;
}
if (g_Settings->LoadBool(Debugger_DebugLanguage))
{
std::pair<LANG_STRINGS::iterator, bool> ret = m_CurrentStrings.insert(LANG_STRINGS::value_type(StringID, stdstr_f("#%d#", StringID)));
if (ret.second)
{
return ret.first->second;
}
}
LANG_STRINGS::iterator DefString = m_DefaultStrings.find(StringID);
if (DefString != m_DefaultStrings.end())
{
@ -645,7 +660,7 @@ std::string CLanguage::GetLangString(const char * FileName, LanguageStringID ID)
LANG_STR CLanguage::GetNextLangString(void * OpenFile)
{
enum { MAX_STRING_LEN = 400 };
enum { MAX_STRING_LEN = 800 };
int32_t StringID;
char szString[MAX_STRING_LEN]; //temp store the string from the file

View File

@ -216,6 +216,7 @@ enum SettingID
Debugger_AppLogFlush,
Debugger_ShowDListAListCount,
Debugger_ShowRecompMemSize,
Debugger_DebugLanguage,
//Trace
Debugger_TraceMD5,

View File

@ -292,6 +292,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Debugger_DisableGameFixes, new CSettingTypeApplication("Debugger", "Disable Game Fixes", false));
AddHandler(Debugger_ShowDListAListCount, new CSettingTypeApplication("Debugger", "Show Dlist Alist Count", false));
AddHandler(Debugger_ShowRecompMemSize, new CSettingTypeApplication("Debugger", "Show Recompiler Memory size", false));
AddHandler(Debugger_DebugLanguage, new CSettingTypeApplication("Debugger", "Debug Language", false));
AddHandler(Debugger_ShowDivByZero, new CSettingTypeApplication("Debugger", "Show Div by zero", false));
AddHandler(Debugger_ProfileCode, new CSettingTypeApplication("Debugger", "Profile Code", (uint32_t)false));
AddHandler(Debugger_AppLogFlush, new CSettingTypeApplication("Logging", "Log Auto Flush", (uint32_t)false));

View File

@ -25,6 +25,7 @@ CMainMenu::CMainMenu(CMainGui * hMainWindow) :
m_ChangeSettingList.push_back(Debugger_ShowUnhandledMemory);
m_ChangeSettingList.push_back(Debugger_ShowPifErrors);
m_ChangeSettingList.push_back(Debugger_ShowDListAListCount);
m_ChangeSettingList.push_back(Debugger_DebugLanguage);
m_ChangeSettingList.push_back(Debugger_ShowRecompMemSize);
m_ChangeSettingList.push_back(Debugger_ShowDivByZero);
m_ChangeSettingList.push_back(Debugger_GenerateLogFiles);
@ -486,6 +487,10 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
g_Notify->DisplayMessage(0, "");
g_Settings->SaveBool(Debugger_ShowDListAListCount, !g_Settings->LoadBool(Debugger_ShowDListAListCount));
break;
case ID_DEBUG_LANGUAGE:
g_Settings->SaveBool(Debugger_DebugLanguage, !g_Settings->LoadBool(Debugger_DebugLanguage));
g_Lang->LoadCurrentStrings();
break;
case ID_DEBUG_SHOW_RECOMP_MEM_SIZE:
g_Notify->DisplayMessage(0, "");
g_Settings->SaveBool(Debugger_ShowRecompMemSize, !g_Settings->LoadBool(Debugger_ShowRecompMemSize));
@ -1205,12 +1210,19 @@ void CMainMenu::FillOutMenu(HMENU hMenu)
{
Item.SetItemTicked(true);
}
DebugMenu.push_back(Item);
Item.Reset(ID_DEBUG_SHOW_DLIST_COUNT, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Display Alist/Dlist Count");
if (g_Settings->LoadBool(Debugger_ShowDListAListCount))
{
Item.SetItemTicked(true);
}
DebugMenu.push_back(Item);
Item.Reset(ID_DEBUG_LANGUAGE, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Debug Language");
if (g_Settings->LoadBool(Debugger_DebugLanguage))
{
Item.SetItemTicked(true);
}
DebugMenu.push_back(Item);
Item.Reset(ID_DEBUG_SHOW_RECOMP_MEM_SIZE, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Display Recompiler Code Buffer Size");
if (g_Settings->LoadBool(Debugger_ShowRecompMemSize))
{

View File

@ -35,7 +35,7 @@ enum MainMenuID
//Debugger Menu
ID_DEBUG_SHOW_TLB_MISSES, ID_DEBUG_SHOW_UNHANDLED_MEM, ID_DEBUG_SHOW_PIF_ERRORS,
ID_DEBUG_SHOW_DLIST_COUNT, ID_DEBUG_SHOW_RECOMP_MEM_SIZE, ID_DEBUG_SHOW_DIV_BY_ZERO,
ID_DEBUG_GENERATE_LOG_FILES, ID_DEBUG_DISABLE_GAMEFIX,
ID_DEBUG_GENERATE_LOG_FILES, ID_DEBUG_DISABLE_GAMEFIX, ID_DEBUG_LANGUAGE,
ID_DEBUGGER_LOGOPTIONS, ID_DEBUGGER_GENERATELOG, ID_DEBUGGER_DUMPMEMORY, ID_DEBUGGER_SEARCHMEMORY,
ID_DEBUGGER_TLBENTRIES, ID_DEBUGGER_BREAKPOINTS, ID_DEBUGGER_MEMORY, ID_DEBUGGER_R4300REGISTERS,
ID_DEBUGGER_INTERRUPT_SP, ID_DEBUGGER_INTERRUPT_SI, ID_DEBUGGER_INTERRUPT_AI, ID_DEBUGGER_INTERRUPT_VI,