2010-06-07 02:23:58 +00:00
|
|
|
#include "stdafx.h"
|
2008-09-18 03:15:49 +00:00
|
|
|
#include "..\\3rd Party\\HTML Help\\HTMLHELP.H"
|
|
|
|
|
2010-05-22 04:47:15 +00:00
|
|
|
CMainMenu::CMainMenu ( CMainGui * hMainWindow ):
|
2008-09-18 03:15:49 +00:00
|
|
|
CBaseMenu(),
|
|
|
|
m_ResetAccelerators(true)
|
|
|
|
{
|
|
|
|
_Gui = hMainWindow; //Make a copy of the attatched window
|
|
|
|
ResetMenu();
|
|
|
|
|
|
|
|
hMainWindow->SetWindowMenu(this);
|
2008-11-14 20:51:06 +00:00
|
|
|
|
|
|
|
m_ChangeSettingList.push_back(Info_ShortCutsChanged);
|
|
|
|
m_ChangeSettingList.push_back(GameRunning_LimitFPS);
|
|
|
|
m_ChangeSettingList.push_back(UserInterface_InFullScreen);
|
|
|
|
m_ChangeSettingList.push_back(UserInterface_AlwaysOnTop);
|
|
|
|
m_ChangeSettingList.push_back(UserInterface_ShowCPUPer);
|
|
|
|
m_ChangeSettingList.push_back(Debugger_ProfileCode);
|
2012-09-28 20:07:45 +00:00
|
|
|
m_ChangeSettingList.push_back(Debugger_ShowTLBMisses);
|
2008-11-14 20:51:06 +00:00
|
|
|
m_ChangeSettingList.push_back(Debugger_ShowUnhandledMemory);
|
|
|
|
m_ChangeSettingList.push_back(Debugger_ShowPifErrors);
|
|
|
|
m_ChangeSettingList.push_back(Debugger_ShowDListAListCount);
|
|
|
|
m_ChangeSettingList.push_back(Debugger_ShowRecompMemSize);
|
2012-09-30 13:07:00 +00:00
|
|
|
m_ChangeSettingList.push_back(Debugger_ShowDivByZero);
|
2008-11-14 20:51:06 +00:00
|
|
|
m_ChangeSettingList.push_back(Debugger_GenerateLogFiles);
|
|
|
|
m_ChangeSettingList.push_back(Debugger_DisableGameFixes);
|
|
|
|
m_ChangeSettingList.push_back(Debugger_AppLogLevel);
|
|
|
|
m_ChangeSettingList.push_back(Debugger_AppLogFlush);
|
|
|
|
m_ChangeSettingList.push_back(Debugger_GenerateDebugLog);
|
|
|
|
m_ChangeSettingList.push_back(Game_CurrentSaveState);
|
|
|
|
m_ChangeSettingList.push_back(Setting_CurrentLanguage);
|
|
|
|
|
|
|
|
for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++)
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->RegisterChangeCB(*iter,this,(CSettings::SettingChangedFunc)SettingsChanged);
|
2008-11-14 20:51:06 +00:00
|
|
|
}
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CMainMenu::~CMainMenu()
|
|
|
|
{
|
2008-11-14 20:51:06 +00:00
|
|
|
for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++)
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->UnregisterChangeCB(*iter,this,(CSettings::SettingChangedFunc)SettingsChanged);
|
2008-11-14 20:51:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CMainMenu::SettingsChanged (CMainMenu * _this )
|
|
|
|
{
|
|
|
|
_this->ResetMenu();
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int CMainMenu::ProcessAccelerator ( WND_HANDLE hWnd, void * lpMsg ) {
|
|
|
|
if (m_ResetAccelerators)
|
|
|
|
{
|
|
|
|
m_ResetAccelerators = false;
|
|
|
|
RebuildAccelerators();
|
|
|
|
}
|
|
|
|
if (!m_AccelTable) { return false; }
|
|
|
|
return TranslateAccelerator((HWND)hWnd,(HACCEL)m_AccelTable,(LPMSG)lpMsg);
|
|
|
|
}
|
|
|
|
|
2012-10-05 09:20:53 +00:00
|
|
|
bool CMainMenu::ProcessMessage(WND_HANDLE hWnd, DWORD /*FromAccelerator*/, DWORD MenuID) {
|
2008-09-18 03:15:49 +00:00
|
|
|
switch (MenuID) {
|
|
|
|
case ID_FILE_OPEN_ROM:
|
|
|
|
{
|
2012-11-17 01:09:19 +00:00
|
|
|
stdstr File = g_BaseSystem->ChooseFileToOpen(hWnd);
|
2008-09-18 03:15:49 +00:00
|
|
|
if (File.length() > 0) {
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->RunFileImage(File.c_str());
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_FILE_ROM_INFO:
|
|
|
|
{
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->DisplayRomInfo(hWnd);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_FILE_STARTEMULATION:
|
|
|
|
_Gui->SaveWindowLoc();
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->StartEmulation(true);
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_FILE_ENDEMULATION:
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_FILE_ENDEMULATION");
|
2013-01-03 08:51:00 +00:00
|
|
|
CN64System::CloseSystem();
|
2008-09-18 03:15:49 +00:00
|
|
|
_Gui->SaveWindowLoc();
|
|
|
|
break;
|
|
|
|
case ID_FILE_ROMDIRECTORY:
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_FILE_ROMDIRECTORY 1");
|
2010-05-22 04:47:15 +00:00
|
|
|
_Gui->SelectRomDir();
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_FILE_ROMDIRECTORY 2");
|
2008-09-18 03:15:49 +00:00
|
|
|
_Gui->RefreshMenu();
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_FILE_ROMDIRECTORY 3");
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_FILE_REFRESHROMLIST: _Gui->RefreshRomBrowser(); break;
|
|
|
|
case ID_FILE_EXIT: DestroyWindow((HWND)hWnd); break;
|
|
|
|
case ID_SYSTEM_RESET_SOFT:
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_RESET_SOFT");
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->ExternalEvent(SysEvent_ResetCPU_Soft);
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_SYSTEM_RESET_HARD:
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_RESET_HARD");
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->ExternalEvent(SysEvent_ResetCPU_Hard);
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_SYSTEM_PAUSE:
|
|
|
|
_Gui->SaveWindowLoc();
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_PAUSE");
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(GameRunning_CPU_Paused))
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_FromMenu);
|
2008-09-18 03:15:49 +00:00
|
|
|
} else {
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_FromMenu);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_PAUSE 1");
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_SYSTEM_BITMAP:
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
stdstr Dir(g_Settings->LoadString(Directory_SnapShot));
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTraceF(TraceGfxPlugin,__FUNCTION__ ": CaptureScreen(%s): Starting",Dir.c_str());
|
2012-11-17 02:20:21 +00:00
|
|
|
g_Plugins->Gfx()->CaptureScreen(Dir.c_str());
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceGfxPlugin,__FUNCTION__ ": CaptureScreen: Done");
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_SYSTEM_LIMITFPS:
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_LIMITFPS");
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(GameRunning_LimitFPS,!g_Settings->LoadBool(GameRunning_LimitFPS));
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_LIMITFPS 1");
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
2010-07-05 11:29:46 +00:00
|
|
|
case ID_SYSTEM_SAVE:
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_SAVE");
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->ExternalEvent(SysEvent_SaveMachineState);
|
2010-07-05 11:29:46 +00:00
|
|
|
break;
|
2008-09-18 03:15:49 +00:00
|
|
|
case ID_SYSTEM_SAVEAS:
|
|
|
|
{
|
|
|
|
char drive[_MAX_DRIVE] ,dir[_MAX_DIR], fname[_MAX_FNAME],ext[_MAX_EXT];
|
|
|
|
char Directory[255], SaveFile[255];
|
|
|
|
OPENFILENAME openfilename;
|
|
|
|
|
|
|
|
memset(&SaveFile, 0, sizeof(SaveFile));
|
|
|
|
memset(&openfilename, 0, sizeof(openfilename));
|
|
|
|
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->LoadString(Directory_LastSave, Directory,sizeof(Directory));
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
openfilename.lStructSize = sizeof( openfilename );
|
|
|
|
openfilename.hwndOwner = (HWND)hWnd;
|
|
|
|
openfilename.lpstrFilter = "PJ64 Saves (*.zip, *.pj)\0*.pj?;*.pj;*.zip;";
|
|
|
|
openfilename.lpstrFile = SaveFile;
|
|
|
|
openfilename.lpstrInitialDir = Directory;
|
|
|
|
openfilename.nMaxFile = MAX_PATH;
|
|
|
|
openfilename.Flags = OFN_HIDEREADONLY;
|
|
|
|
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_SaveGame);
|
2008-09-18 03:15:49 +00:00
|
|
|
if (GetSaveFileName (&openfilename))
|
|
|
|
{
|
2012-10-03 14:22:13 +00:00
|
|
|
|
2008-09-18 03:15:49 +00:00
|
|
|
_splitpath( SaveFile, drive, dir, fname, ext );
|
|
|
|
if (_stricmp(ext, ".pj") == 0 || _stricmp(ext, ".zip") == 0)
|
|
|
|
{
|
|
|
|
_makepath( SaveFile, drive, dir, fname, NULL );
|
|
|
|
_splitpath( SaveFile, drive, dir, fname, ext );
|
|
|
|
if (_stricmp(ext, ".pj") == 0)
|
|
|
|
{
|
|
|
|
_makepath( SaveFile, drive, dir, fname, NULL );
|
|
|
|
}
|
|
|
|
}
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveString(GameRunning_InstantSaveFile,SaveFile);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
char SaveDir[MAX_PATH];
|
|
|
|
_makepath( SaveDir, drive, dir, NULL, NULL );
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveString(Directory_LastSave,SaveDir);
|
2012-11-17 01:07:04 +00:00
|
|
|
g_System->SaveState();
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_SaveGame);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
2012-12-17 00:21:29 +00:00
|
|
|
case ID_SYSTEM_RESTORE: WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_RESTORE"); g_BaseSystem->ExternalEvent(SysEvent_LoadMachineState); break;
|
2008-09-18 03:15:49 +00:00
|
|
|
case ID_SYSTEM_LOAD:
|
|
|
|
{
|
|
|
|
char Directory[255], SaveFile[255];
|
|
|
|
OPENFILENAME openfilename;
|
|
|
|
|
|
|
|
memset(&SaveFile, 0, sizeof(SaveFile));
|
|
|
|
memset(&openfilename, 0, sizeof(openfilename));
|
|
|
|
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->LoadString(Directory_LastSave, Directory,sizeof(Directory));
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
openfilename.lStructSize = sizeof( openfilename );
|
|
|
|
openfilename.hwndOwner = (HWND)hWnd;
|
|
|
|
openfilename.lpstrFilter = "PJ64 Saves (*.zip, *.pj)\0*.pj?;*.pj;*.zip;";
|
|
|
|
openfilename.lpstrFile = SaveFile;
|
|
|
|
openfilename.lpstrInitialDir = Directory;
|
|
|
|
openfilename.nMaxFile = MAX_PATH;
|
|
|
|
openfilename.Flags = OFN_HIDEREADONLY;
|
|
|
|
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_LoadGame);
|
2008-09-18 03:15:49 +00:00
|
|
|
if (GetOpenFileName (&openfilename)) {
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveString(GameRunning_InstantSaveFile,SaveFile);
|
2008-09-18 03:15:49 +00:00
|
|
|
char SaveDir[MAX_PATH], drive[_MAX_DRIVE] ,dir[_MAX_DIR], fname[_MAX_FNAME],ext[_MAX_EXT];
|
|
|
|
_splitpath( SaveFile, drive, dir, fname, ext );
|
|
|
|
_makepath( SaveDir, drive, dir, NULL, NULL );
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveString(Directory_LastSave,SaveDir);
|
2012-11-17 01:07:04 +00:00
|
|
|
g_System->LoadState();
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_LoadGame);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_SYSTEM_CHEAT:
|
|
|
|
{
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->SelectCheats(hWnd);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_SYSTEM_GSBUTTON:
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->ExternalEvent(SysEvent_GSButtonPressed);
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_OPTIONS_DISPLAY_FR:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(UserInterface_DisplayFrameRate,!g_Settings->LoadBool(UserInterface_DisplayFrameRate));
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_OPTIONS_CHANGE_FR:
|
2012-11-17 01:02:04 +00:00
|
|
|
switch (g_Settings->LoadDword(UserInterface_FrameDisplayType))
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
|
|
|
case FR_VIs:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(UserInterface_FrameDisplayType,FR_DLs);
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case FR_DLs:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(UserInterface_FrameDisplayType,FR_PERCENT);
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
default:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(UserInterface_FrameDisplayType,FR_VIs);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_OPTIONS_INCREASE_SPEED:
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->IncreaseSpeed();
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_OPTIONS_DECREASE_SPEED:
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->DecreaeSpeed();
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_OPTIONS_FULLSCREEN:
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->ExternalEvent(SysEvent_ChangingFullScreen);
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_OPTIONS_FULLSCREEN2:
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(UserInterface_InFullScreen))
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN a");
|
2008-09-18 03:15:49 +00:00
|
|
|
_Gui->MakeWindowOnTop(false);
|
|
|
|
Notify().SetGfxPlugin(NULL);
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceGfxPlugin,__FUNCTION__ ": ChangeWindow: Starting");
|
2012-11-17 02:20:21 +00:00
|
|
|
g_Plugins->Gfx()->ChangeWindow();
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceGfxPlugin,__FUNCTION__ ": ChangeWindow: Done");
|
2008-09-18 03:15:49 +00:00
|
|
|
ShowCursor(true);
|
|
|
|
_Gui->ShowStatusBar(true);
|
2012-11-17 01:02:04 +00:00
|
|
|
_Gui->MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop));
|
|
|
|
g_Settings->SaveBool(UserInterface_InFullScreen,(DWORD)false);
|
2008-09-18 03:15:49 +00:00
|
|
|
} else {
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b");
|
2008-09-18 03:15:49 +00:00
|
|
|
ShowCursor(false);
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 1");
|
2008-09-18 03:15:49 +00:00
|
|
|
_Gui->ShowStatusBar(false);
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 2");
|
2008-09-18 03:15:49 +00:00
|
|
|
try {
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceGfxPlugin,__FUNCTION__ ": ChangeWindow: Starting");
|
2012-11-17 02:20:21 +00:00
|
|
|
g_Plugins->Gfx()->ChangeWindow();
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceGfxPlugin,__FUNCTION__ ": ChangeWindow: Done");
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceError,__FUNCTION__ ": Exception when going to full screen");
|
2008-09-18 03:15:49 +00:00
|
|
|
char Message[600];
|
|
|
|
sprintf(Message,"Exception caught\nFile: %s\nLine: %d",__FILE__,__LINE__);
|
|
|
|
MessageBox(NULL,Message,"Exception",MB_OK);
|
|
|
|
}
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 4");
|
2008-09-18 03:15:49 +00:00
|
|
|
_Gui->MakeWindowOnTop(false);
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 5");
|
2012-11-17 02:20:21 +00:00
|
|
|
Notify().SetGfxPlugin(g_Plugins->Gfx());
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 3");
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(UserInterface_InFullScreen,true);
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 6");
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN 1");
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_OPTIONS_ALWAYSONTOP:
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadDword(UserInterface_AlwaysOnTop)) {
|
|
|
|
g_Settings->SaveBool(UserInterface_AlwaysOnTop,false);
|
2008-09-18 03:15:49 +00:00
|
|
|
_Gui->MakeWindowOnTop(false);
|
|
|
|
} else {
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(UserInterface_AlwaysOnTop,true);
|
|
|
|
_Gui->MakeWindowOnTop(g_Settings->LoadBool(GameRunning_CPU_Running));
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
2012-12-17 00:21:29 +00:00
|
|
|
case ID_OPTIONS_CONFIG_RSP: WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_CONFIG_RSP"); g_Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_RSP); break;
|
|
|
|
case ID_OPTIONS_CONFIG_GFX: WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_CONFIG_GFX"); g_Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_GFX); break;
|
|
|
|
case ID_OPTIONS_CONFIG_AUDIO:WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_CONFIG_AUDIO"); g_Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_AUDIO); break;
|
|
|
|
case ID_OPTIONS_CONFIG_CONT: WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_CONFIG_CONT"); g_Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_CONTROLLER); break;
|
2008-09-18 03:15:49 +00:00
|
|
|
case ID_OPTIONS_CPU_USAGE:
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_CPU_USAGE");
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(UserInterface_ShowCPUPer))
|
2008-11-14 20:51:06 +00:00
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(UserInterface_ShowCPUPer,false);
|
2012-11-17 00:58:31 +00:00
|
|
|
g_Notify->DisplayMessage(0,"");
|
2008-09-18 03:15:49 +00:00
|
|
|
} else {
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(UserInterface_ShowCPUPer,true);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
2008-11-14 20:51:06 +00:00
|
|
|
case ID_OPTIONS_SETTINGS:
|
|
|
|
{
|
|
|
|
CSettingConfig SettingConfig;
|
|
|
|
SettingConfig.Display(hWnd);
|
|
|
|
}
|
|
|
|
break;
|
2008-09-18 03:15:49 +00:00
|
|
|
case ID_PROFILE_PROFILE:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(Debugger_ProfileCode,!g_Settings->LoadBool(Debugger_ProfileCode));
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->ExternalEvent(SysEvent_Profile_StartStop);
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
2012-11-17 01:09:19 +00:00
|
|
|
case ID_PROFILE_RESETCOUNTER: g_BaseSystem->ExternalEvent(SysEvent_Profile_ResetLogs); break;
|
|
|
|
case ID_PROFILE_GENERATELOG: g_BaseSystem->ExternalEvent(SysEvent_Profile_GenerateLogs); break;
|
2012-09-28 20:07:45 +00:00
|
|
|
case ID_DEBUG_SHOW_TLB_MISSES:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(Debugger_ShowTLBMisses,!g_Settings->LoadBool(Debugger_ShowTLBMisses));
|
2012-09-28 20:07:45 +00:00
|
|
|
break;
|
2008-09-18 03:15:49 +00:00
|
|
|
case ID_DEBUG_SHOW_UNHANDLED_MEM:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(Debugger_ShowUnhandledMemory,!g_Settings->LoadBool(Debugger_ShowUnhandledMemory));
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_DEBUG_SHOW_PIF_ERRORS:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(Debugger_ShowPifErrors,!g_Settings->LoadBool(Debugger_ShowPifErrors));
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_DEBUG_SHOW_DLIST_COUNT:
|
2012-11-17 00:58:31 +00:00
|
|
|
g_Notify->DisplayMessage(0,"");
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(Debugger_ShowDListAListCount,!g_Settings->LoadBool(Debugger_ShowDListAListCount));
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_DEBUG_SHOW_RECOMP_MEM_SIZE:
|
2012-11-17 00:58:31 +00:00
|
|
|
g_Notify->DisplayMessage(0,"");
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(Debugger_ShowRecompMemSize,!g_Settings->LoadBool(Debugger_ShowRecompMemSize));
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
2012-09-30 13:07:00 +00:00
|
|
|
case ID_DEBUG_SHOW_DIV_BY_ZERO:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(Debugger_ShowDivByZero,!g_Settings->LoadBool(Debugger_ShowDivByZero));
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_DEBUG_GENERATE_LOG_FILES:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(Debugger_GenerateLogFiles,!g_Settings->LoadBool(Debugger_GenerateLogFiles));
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_DEBUG_DISABLE_GAMEFIX:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(Debugger_DisableGameFixes,!g_Settings->LoadBool(Debugger_DisableGameFixes));
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_DEBUGGER_APPLOG_ERRORS:
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel);
|
2008-09-18 03:15:49 +00:00
|
|
|
if ((LogLevel & TraceError) != 0)
|
|
|
|
{
|
|
|
|
LogLevel &= ~TraceError;
|
|
|
|
} else {
|
|
|
|
LogLevel |= TraceError;
|
|
|
|
}
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel );
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_DEBUGGER_APPLOG_SETTINGS:
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel);
|
2008-09-18 03:15:49 +00:00
|
|
|
if ((LogLevel & TraceSettings) != 0)
|
|
|
|
{
|
|
|
|
LogLevel &= ~TraceSettings;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
LogLevel |= TraceSettings;
|
|
|
|
}
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel );
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_DEBUGGER_APPLOG_RECOMPILER:
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel);
|
2008-09-18 03:15:49 +00:00
|
|
|
if ((LogLevel & TraceRecompiler) != 0)
|
|
|
|
{
|
|
|
|
LogLevel &= ~TraceRecompiler;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
LogLevel |= TraceRecompiler;
|
|
|
|
}
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel );
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_DEBUGGER_APPLOG_RSP:
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel);
|
2008-09-18 03:15:49 +00:00
|
|
|
if ((LogLevel & TraceRSP) != 0)
|
|
|
|
{
|
|
|
|
LogLevel &= ~TraceRSP;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
LogLevel |= TraceRSP;
|
|
|
|
}
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel );
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_DEBUGGER_APPLOG_TLB:
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel);
|
2008-09-18 03:15:49 +00:00
|
|
|
if ((LogLevel & TraceTLB) != 0)
|
|
|
|
{
|
|
|
|
LogLevel &= ~TraceTLB;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
LogLevel |= TraceTLB;
|
|
|
|
}
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel );
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_DEBUGGER_APPLOG_GFX_PLUGIN:
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel);
|
2008-09-18 03:15:49 +00:00
|
|
|
if ((LogLevel & TraceGfxPlugin) != 0)
|
|
|
|
{
|
|
|
|
LogLevel &= ~TraceGfxPlugin;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
LogLevel |= TraceGfxPlugin;
|
|
|
|
}
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel );
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_DEBUGGER_APPLOG_DEBUG:
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel);
|
2008-09-18 03:15:49 +00:00
|
|
|
if ((LogLevel & TraceDebug) != 0)
|
|
|
|
{
|
|
|
|
LogLevel &= ~TraceDebug;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
LogLevel |= TraceDebug;
|
|
|
|
}
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel );
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
break;
|
2011-01-04 09:10:28 +00:00
|
|
|
case ID_DEBUGGER_APPLOG_AUDIO_EMU:
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel);
|
2011-01-04 09:10:28 +00:00
|
|
|
if ((LogLevel & TraceAudio) != 0)
|
|
|
|
{
|
|
|
|
LogLevel &= ~TraceAudio;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
LogLevel |= TraceAudio;
|
|
|
|
}
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel );
|
2011-01-04 09:10:28 +00:00
|
|
|
}
|
|
|
|
break;
|
2008-09-18 03:15:49 +00:00
|
|
|
case ID_DEBUGGER_APPLOG_FLUSH:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(Debugger_AppLogFlush,!g_Settings->LoadBool(Debugger_AppLogFlush));
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_DEBUGGER_LOGOPTIONS: _Gui->EnterLogOptions(); break;
|
|
|
|
case ID_DEBUGGER_GENERATELOG:
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveBool(Debugger_GenerateDebugLog,!g_Settings->LoadBool(Debugger_GenerateDebugLog));
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_DEBUGGER_DUMPMEMORY:
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->Debug_ShowMemoryDump();
|
|
|
|
break;
|
|
|
|
case ID_DEBUGGER_SEARCHMEMORY: g_BaseSystem->Debug_ShowMemorySearch(); break;
|
|
|
|
case ID_DEBUGGER_MEMORY: g_BaseSystem->Debug_ShowMemoryWindow(); break;
|
|
|
|
case ID_DEBUGGER_TLBENTRIES: g_BaseSystem->Debug_ShowTLBWindow(); break;
|
|
|
|
case ID_DEBUGGER_INTERRUPT_SP: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_SP); break;
|
|
|
|
case ID_DEBUGGER_INTERRUPT_SI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_SI); break;
|
|
|
|
case ID_DEBUGGER_INTERRUPT_AI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_AI); break;
|
|
|
|
case ID_DEBUGGER_INTERRUPT_VI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_VI); break;
|
|
|
|
case ID_DEBUGGER_INTERRUPT_PI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_PI); break;
|
|
|
|
case ID_DEBUGGER_INTERRUPT_DP: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_DP); break;
|
2008-09-18 03:15:49 +00:00
|
|
|
case ID_CURRENT_SAVE_DEFAULT:
|
|
|
|
Notify().DisplayMessage(3,"Save Slot (%s) selected",GetSaveSlotString(MenuID - ID_CURRENT_SAVE_DEFAULT).c_str());
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(Game_CurrentSaveState,(DWORD)(MenuID - ID_CURRENT_SAVE_DEFAULT));
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_CURRENT_SAVE_1:
|
|
|
|
case ID_CURRENT_SAVE_2:
|
|
|
|
case ID_CURRENT_SAVE_3:
|
|
|
|
case ID_CURRENT_SAVE_4:
|
|
|
|
case ID_CURRENT_SAVE_5:
|
|
|
|
case ID_CURRENT_SAVE_6:
|
|
|
|
case ID_CURRENT_SAVE_7:
|
|
|
|
case ID_CURRENT_SAVE_8:
|
|
|
|
case ID_CURRENT_SAVE_9:
|
|
|
|
case ID_CURRENT_SAVE_10:
|
|
|
|
Notify().DisplayMessage(3,"Save Slot (%s) selected",GetSaveSlotString((MenuID - ID_CURRENT_SAVE_1) + 1).c_str());
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveDword(Game_CurrentSaveState,(DWORD)((MenuID - ID_CURRENT_SAVE_1) + 1));
|
2008-09-18 03:15:49 +00:00
|
|
|
break;
|
|
|
|
case ID_HELP_CONTENTS:
|
|
|
|
{
|
|
|
|
char path_buffer[_MAX_PATH], drive[_MAX_DRIVE] ,dir[_MAX_DIR];
|
|
|
|
char fname[_MAX_FNAME],ext[_MAX_EXT], HelpFileName[_MAX_PATH];
|
|
|
|
|
|
|
|
GetModuleFileName(NULL,path_buffer,sizeof(path_buffer));
|
|
|
|
_splitpath(path_buffer, drive, dir, fname, ext);
|
|
|
|
_makepath(HelpFileName, drive, dir, "Project64", "chm");
|
|
|
|
|
|
|
|
if (HtmlHelp((HWND)hWnd, HelpFileName, HH_DISPLAY_TOPIC, 0) == NULL) {
|
|
|
|
ShellExecute((HWND)hWnd, "open", HelpFileName, NULL, NULL, SW_SHOW);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_HELP_GAMEFAQ:
|
|
|
|
{
|
|
|
|
char path_buffer[_MAX_PATH], drive[_MAX_DRIVE] ,dir[_MAX_DIR];
|
|
|
|
char fname[_MAX_FNAME],ext[_MAX_EXT], HelpFileName[_MAX_PATH], HelpFileName2[_MAX_PATH];
|
|
|
|
|
|
|
|
GetModuleFileName(NULL,path_buffer,sizeof(path_buffer));
|
|
|
|
_splitpath( path_buffer, drive, dir, fname, ext );
|
|
|
|
_makepath( HelpFileName, drive, dir, "PJgameFAQ", "chm" );
|
|
|
|
strcpy(HelpFileName2, HelpFileName);
|
|
|
|
strcat(HelpFileName, "::/html/8 FAQ/games/_index.htm");
|
|
|
|
|
|
|
|
if (HtmlHelp((HWND)hWnd, HelpFileName, HH_DISPLAY_TOPIC, 0) == NULL) {
|
|
|
|
ShellExecute((HWND)hWnd, "open", HelpFileName2, NULL, NULL, SW_SHOW);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2008-11-27 14:34:13 +00:00
|
|
|
case ID_HELP_SUPPORTFORUM: ShellExecute(NULL, "open", "http://forum.pj64-emu.com/", NULL, NULL, SW_SHOWMAXIMIZED); break;
|
2008-11-17 10:02:22 +00:00
|
|
|
case ID_HELP_HOMEPAGE: ShellExecute(NULL, "open", "http://www.pj64-emu.com", NULL, NULL, SW_SHOWMAXIMIZED); break;
|
2008-09-18 03:15:49 +00:00
|
|
|
case ID_HELP_ABOUT: _Gui->AboutBox(); break;
|
|
|
|
case ID_HELP_ABOUTSETTINGFILES: _Gui->AboutIniBox(); break;
|
|
|
|
default:
|
|
|
|
if (MenuID >= ID_RECENT_ROM_START && MenuID < ID_RECENT_ROM_END) {
|
2008-11-17 10:02:22 +00:00
|
|
|
stdstr FileName;
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadStringIndex(File_RecentGameFileIndex,MenuID - ID_RECENT_ROM_START,FileName) &&
|
2008-11-17 10:02:22 +00:00
|
|
|
FileName.length() > 0)
|
|
|
|
{
|
2012-11-17 01:09:19 +00:00
|
|
|
g_BaseSystem->RunFileImage(FileName.c_str());
|
2008-11-17 10:02:22 +00:00
|
|
|
}
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
if (MenuID >= ID_RECENT_DIR_START && MenuID < ID_RECENT_DIR_END) {
|
|
|
|
int Offset = MenuID - ID_RECENT_DIR_START;
|
2012-11-17 01:02:04 +00:00
|
|
|
stdstr Dir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex,Offset);
|
2008-09-18 03:15:49 +00:00
|
|
|
if (Dir.length() > 0) {
|
2012-11-17 01:02:04 +00:00
|
|
|
g_Settings->SaveString(Directory_Game,Dir.c_str());
|
2012-11-17 00:58:31 +00:00
|
|
|
g_Notify->AddRecentDir(Dir.c_str());
|
2008-09-18 03:15:49 +00:00
|
|
|
_Gui->RefreshMenu();
|
|
|
|
if (_Gui->RomBrowserVisible()) {
|
|
|
|
_Gui->RefreshRomBrowser();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (MenuID >= ID_LANG_START && MenuID < ID_LANG_END) {
|
|
|
|
MENUITEMINFO menuinfo;
|
|
|
|
char String[300];
|
|
|
|
|
|
|
|
menuinfo.cbSize = sizeof(MENUITEMINFO);
|
|
|
|
menuinfo.fMask = MIIM_TYPE;
|
|
|
|
menuinfo.fType = MFT_STRING;
|
|
|
|
menuinfo.dwTypeData = String;
|
|
|
|
menuinfo.cch = sizeof(String);
|
|
|
|
GetMenuItemInfo((HMENU)m_MenuHandle,MenuID,FALSE,&menuinfo);
|
|
|
|
|
|
|
|
//See if the language has changed, if not do nothing
|
|
|
|
//Set the language
|
|
|
|
_Lang->SetLanguage(String);
|
|
|
|
_Gui->ResetRomBrowserColomuns();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-11-14 20:51:06 +00:00
|
|
|
/*stdstr CMainMenu::ShortCutString(MSC_MAP & ShortCuts, int MenuID, CMenuShortCutKey::ACCESS_MODE AccessLevel) {
|
|
|
|
Notify().BreakPoint(__FILE__,__LINE__);
|
2008-09-18 03:15:49 +00:00
|
|
|
MSC_MAP::iterator MenuItem = ShortCuts.find(MenuID);
|
|
|
|
if (MenuItem == ShortCuts.end()) { return ""; }
|
|
|
|
|
|
|
|
const SHORTCUT_KEY_LIST & ShortCutList = MenuItem->second.GetAccelItems();
|
|
|
|
for (SHORTCUT_KEY_LIST::const_iterator item = ShortCutList.begin(); item != ShortCutList.end(); item++)
|
|
|
|
{
|
2008-11-14 20:51:06 +00:00
|
|
|
CMenuShortCutKey::ACCESS_MODE ItemMode = item->AccessMode();
|
2008-09-18 03:15:49 +00:00
|
|
|
if ((ItemMode & AccessLevel) != AccessLevel )
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
return item->Name();
|
|
|
|
}
|
|
|
|
return "";
|
2008-11-14 20:51:06 +00:00
|
|
|
}*/
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
stdstr CMainMenu::GetFileLastMod (stdstr FileName)
|
|
|
|
{
|
|
|
|
HANDLE hFile = CreateFile(FileName.c_str(), GENERIC_READ, FILE_SHARE_READ,NULL,
|
|
|
|
OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
|
|
|
|
if (hFile == INVALID_HANDLE_VALUE)
|
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
FILETIME CreationTime, LastAccessTime, LastWriteTime;
|
|
|
|
stdstr LastMod;
|
|
|
|
if (GetFileTime(hFile,&CreationTime,&LastAccessTime,&LastWriteTime))
|
|
|
|
{
|
|
|
|
SYSTEMTIME stUTC, stLocal;
|
|
|
|
|
|
|
|
// Convert the last-write time to local time.
|
|
|
|
FileTimeToSystemTime(&LastWriteTime, &stUTC);
|
|
|
|
SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal);
|
|
|
|
|
|
|
|
LastMod.Format(" [%d/%02d/%02d %02d:%02d]",
|
|
|
|
stLocal.wYear, stLocal.wMonth, stLocal.wDay,stLocal.wHour, stLocal.wMinute);
|
|
|
|
}
|
|
|
|
CloseHandle(hFile);
|
|
|
|
|
|
|
|
return LastMod;
|
|
|
|
}
|
|
|
|
|
|
|
|
stdstr CMainMenu::GetSaveSlotString (int Slot)
|
|
|
|
{
|
|
|
|
stdstr SlotName;
|
|
|
|
switch (Slot)
|
|
|
|
{
|
|
|
|
case 0: SlotName = GS(MENU_SLOT_DEFAULT); break;
|
|
|
|
case 1: SlotName = GS(MENU_SLOT_1); break;
|
|
|
|
case 2: SlotName = GS(MENU_SLOT_2); break;
|
|
|
|
case 3: SlotName = GS(MENU_SLOT_3); break;
|
|
|
|
case 4: SlotName = GS(MENU_SLOT_4); break;
|
|
|
|
case 5: SlotName = GS(MENU_SLOT_5); break;
|
|
|
|
case 6: SlotName = GS(MENU_SLOT_6); break;
|
|
|
|
case 7: SlotName = GS(MENU_SLOT_7); break;
|
|
|
|
case 8: SlotName = GS(MENU_SLOT_8); break;
|
|
|
|
case 9: SlotName = GS(MENU_SLOT_9); break;
|
|
|
|
case 10: SlotName = GS(MENU_SLOT_10); break;
|
|
|
|
}
|
|
|
|
|
2012-11-17 01:02:04 +00:00
|
|
|
if (!g_Settings->LoadBool(GameRunning_CPU_Running)) { return SlotName; }
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
stdstr LastSaveTime;
|
|
|
|
|
|
|
|
//check first save name
|
2012-11-17 01:02:04 +00:00
|
|
|
stdstr _GoodName = g_Settings->LoadString(Game_GoodName);
|
|
|
|
stdstr _InstantSaveDirectory = g_Settings->LoadString(Directory_InstantSave);
|
2008-09-18 03:15:49 +00:00
|
|
|
stdstr CurrentSaveName;
|
|
|
|
if (Slot != 0) {
|
|
|
|
CurrentSaveName.Format("%s.pj%d",_GoodName.c_str(), Slot);
|
|
|
|
} else {
|
|
|
|
CurrentSaveName.Format("%s.pj",_GoodName.c_str());
|
|
|
|
}
|
|
|
|
stdstr_f FileName("%s%s",_InstantSaveDirectory.c_str(),CurrentSaveName.c_str());
|
|
|
|
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadDword(Setting_AutoZipInstantSave))
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
|
|
|
stdstr_f ZipFileName("%s.zip",FileName.c_str());
|
|
|
|
LastSaveTime = GetFileLastMod(ZipFileName);
|
|
|
|
}
|
|
|
|
if (LastSaveTime.empty())
|
|
|
|
{
|
|
|
|
LastSaveTime = GetFileLastMod(FileName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check old file name
|
|
|
|
if (LastSaveTime.empty())
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
stdstr _RomName = g_Settings->LoadString(Game_GameName);
|
2008-09-18 03:15:49 +00:00
|
|
|
if (Slot > 0) {
|
|
|
|
FileName.Format("%s%s.pj%d", _InstantSaveDirectory.c_str(), _RomName.c_str(),Slot);
|
|
|
|
} else {
|
|
|
|
FileName.Format("%s%s.pj",_InstantSaveDirectory.c_str(),_RomName.c_str());
|
|
|
|
}
|
|
|
|
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Setting_AutoZipInstantSave))
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
|
|
|
stdstr_f ZipFileName("%s.zip",FileName.c_str());
|
|
|
|
LastSaveTime = GetFileLastMod(ZipFileName);
|
|
|
|
}
|
|
|
|
if (LastSaveTime.empty())
|
|
|
|
{
|
|
|
|
LastSaveTime = GetFileLastMod(FileName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return stdstr_f("%s%s",SlotName.c_str(),LastSaveTime.c_str()) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMainMenu::FillOutMenu ( MENU_HANDLE hMenu ) {
|
2010-06-12 02:02:06 +00:00
|
|
|
CGuard Guard(m_CS);
|
|
|
|
|
2008-09-18 03:15:49 +00:00
|
|
|
MENU_ITEM Item;
|
|
|
|
|
|
|
|
//Get all flags
|
2012-11-17 01:02:04 +00:00
|
|
|
bool inBasicMode = g_Settings->LoadBool(UserInterface_BasicMode);
|
|
|
|
bool CPURunning = g_Settings->LoadBool(GameRunning_CPU_Running);
|
|
|
|
bool RomLoading = g_Settings->LoadBool(GameRunning_LoadingInProgress);
|
|
|
|
bool RomLoaded = g_Settings->LoadString(Game_GameName).length() > 0;
|
|
|
|
bool RomList = g_Settings->LoadBool(RomBrowser_Enabled) && !CPURunning;
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2008-11-14 20:51:06 +00:00
|
|
|
CMenuShortCutKey::ACCESS_MODE AccessLevel = CMenuShortCutKey::GAME_NOT_RUNNING;
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(GameRunning_CPU_Running))
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
AccessLevel = g_Settings->LoadBool(UserInterface_InFullScreen) ?
|
2008-11-14 20:51:06 +00:00
|
|
|
CMenuShortCutKey::GAME_RUNNING_FULLSCREEN :
|
|
|
|
CMenuShortCutKey::GAME_RUNNING_WINDOW;
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Get the system information to make the menu
|
|
|
|
LanguageList LangList = _Lang->GetLangList();
|
|
|
|
|
|
|
|
MenuItemList LangMenu;
|
|
|
|
int Offset = 0;
|
|
|
|
for (LanguageList::iterator Language = LangList.begin(); Language != LangList.end(); Language++) {
|
|
|
|
Item.Reset(ID_LANG_START + Offset++,EMPTY_STRING,NULL,NULL,Language->LanguageName.c_str());
|
|
|
|
if (_Lang->IsCurrentLang(*Language))
|
|
|
|
{
|
|
|
|
Item.ItemTicked = true;
|
|
|
|
}
|
|
|
|
LangMenu.push_back(Item);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Go through the settings to create a list of Recent Roms
|
|
|
|
MenuItemList RecentRomMenu;
|
2012-11-17 01:02:04 +00:00
|
|
|
DWORD count, RomsToRemember = g_Settings->LoadDword(File_RecentGameFileCount);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
for (count = 0; count < RomsToRemember; count++) {
|
2012-11-17 01:02:04 +00:00
|
|
|
stdstr LastRom = g_Settings->LoadStringIndex(File_RecentGameFileIndex,count);
|
2008-09-18 03:15:49 +00:00
|
|
|
if (LastRom.empty())
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
stdstr_f MenuString("&%d %s",(count + 1) % 10,LastRom.c_str());
|
|
|
|
RecentRomMenu.push_back(MENU_ITEM(ID_RECENT_ROM_START + count,EMPTY_STRING,EMPTY_STDSTR,NULL,MenuString.c_str()));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Recent Dir
|
|
|
|
****************/
|
|
|
|
MenuItemList RecentDirMenu;
|
2012-11-17 01:02:04 +00:00
|
|
|
DWORD DirsToRemember = g_Settings->LoadDword(Directory_RecentGameDirCount);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
for (count = 0; count < DirsToRemember; count++)
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
stdstr LastDir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex,count);
|
2008-09-18 03:15:49 +00:00
|
|
|
if (LastDir.empty())
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
stdstr_f MenuString("&%d %s",(count + 1) % 10,LastDir.c_str());
|
|
|
|
RecentDirMenu.push_back(MENU_ITEM(ID_RECENT_DIR_START + count,EMPTY_STRING,EMPTY_STDSTR,NULL,MenuString.c_str()));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* File Menu
|
|
|
|
****************/
|
|
|
|
MenuItemList FileMenu;
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_FILE_OPEN_ROM, MENU_OPEN, m_ShortCuts.ShortCutString(ID_FILE_OPEN_ROM,AccessLevel));
|
2008-09-18 03:15:49 +00:00
|
|
|
FileMenu.push_back(Item);
|
|
|
|
if (!inBasicMode) {
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_FILE_ROM_INFO, MENU_ROM_INFO,m_ShortCuts.ShortCutString(ID_FILE_ROM_INFO,AccessLevel));
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemEnabled = RomLoaded;
|
|
|
|
FileMenu.push_back(Item);
|
|
|
|
FileMenu.push_back(MENU_ITEM(SPLITER ));
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_FILE_STARTEMULATION,MENU_START, m_ShortCuts.ShortCutString(ID_FILE_STARTEMULATION,AccessLevel) );
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemEnabled = RomLoaded && !CPURunning;
|
|
|
|
FileMenu.push_back(Item);
|
|
|
|
}
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_FILE_ENDEMULATION, MENU_END, m_ShortCuts.ShortCutString(ID_FILE_ENDEMULATION,AccessLevel) );
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemEnabled = CPURunning;
|
|
|
|
FileMenu.push_back(Item);
|
|
|
|
FileMenu.push_back(MENU_ITEM(SPLITER ));
|
|
|
|
Item.Reset(SUB_MENU, MENU_LANGUAGE, EMPTY_STDSTR, &LangMenu );
|
|
|
|
FileMenu.push_back(Item);
|
|
|
|
if (RomList) {
|
|
|
|
FileMenu.push_back(MENU_ITEM(SPLITER ));
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_FILE_ROMDIRECTORY, MENU_CHOOSE_ROM,m_ShortCuts.ShortCutString(ID_FILE_ROMDIRECTORY,AccessLevel) );
|
2008-09-18 03:15:49 +00:00
|
|
|
FileMenu.push_back(Item);
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_FILE_REFRESHROMLIST,MENU_REFRESH,m_ShortCuts.ShortCutString(ID_FILE_REFRESHROMLIST,AccessLevel) );
|
2008-09-18 03:15:49 +00:00
|
|
|
FileMenu.push_back(Item);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!inBasicMode && RomList) {
|
|
|
|
FileMenu.push_back(MENU_ITEM(SPLITER ));
|
|
|
|
Item.Reset(SUB_MENU, MENU_RECENT_ROM,EMPTY_STDSTR, &RecentRomMenu);
|
|
|
|
if (RecentRomMenu.size() == 0) {
|
|
|
|
RecentRomMenu.push_back(MENU_ITEM(SPLITER));
|
|
|
|
Item.ItemEnabled = false;
|
|
|
|
}
|
|
|
|
FileMenu.push_back(Item);
|
|
|
|
Item.Reset(SUB_MENU, MENU_RECENT_DIR,EMPTY_STDSTR, &RecentDirMenu);
|
|
|
|
if (RecentDirMenu.size() == 0) {
|
|
|
|
RecentDirMenu.push_back(MENU_ITEM(SPLITER));
|
|
|
|
Item.ItemEnabled = false;
|
|
|
|
}
|
|
|
|
FileMenu.push_back(Item);
|
|
|
|
} else {
|
|
|
|
if (RecentRomMenu.size() != 0) {
|
|
|
|
FileMenu.push_back(MENU_ITEM(SPLITER ));
|
2012-10-05 09:20:53 +00:00
|
|
|
for (MenuItemList::iterator MenuItem = RecentRomMenu.begin(); MenuItem != RecentRomMenu.end(); MenuItem++)
|
|
|
|
{
|
2008-09-18 03:15:49 +00:00
|
|
|
FileMenu.push_back(*MenuItem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FileMenu.push_back(MENU_ITEM(SPLITER ));
|
2008-11-14 20:51:06 +00:00
|
|
|
FileMenu.push_back(MENU_ITEM(ID_FILE_EXIT, MENU_EXIT,m_ShortCuts.ShortCutString(ID_FILE_EXIT,AccessLevel) ));
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
/* Current Save
|
|
|
|
****************/
|
|
|
|
MenuItemList CurrentSaveMenu;
|
2012-11-17 01:02:04 +00:00
|
|
|
DWORD _CurrentSaveState = g_Settings->LoadDword(Game_CurrentSaveState);
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_CURRENT_SAVE_DEFAULT, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_DEFAULT,AccessLevel),NULL,GetSaveSlotString(0));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (_CurrentSaveState == 0) { Item.ItemTicked = true; }
|
|
|
|
CurrentSaveMenu.push_back(Item);
|
|
|
|
CurrentSaveMenu.push_back(MENU_ITEM(SPLITER));
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_CURRENT_SAVE_1, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_1,AccessLevel),NULL,GetSaveSlotString(1));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (_CurrentSaveState == 1) { Item.ItemTicked = true; }
|
|
|
|
CurrentSaveMenu.push_back(Item);
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_CURRENT_SAVE_2, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_2,AccessLevel),NULL,GetSaveSlotString(2));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (_CurrentSaveState == 2) { Item.ItemTicked = true; }
|
|
|
|
CurrentSaveMenu.push_back(Item);
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_CURRENT_SAVE_3, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_3,AccessLevel),NULL,GetSaveSlotString(3));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (_CurrentSaveState == 3) { Item.ItemTicked = true; }
|
|
|
|
CurrentSaveMenu.push_back(Item);
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_CURRENT_SAVE_4, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_4,AccessLevel),NULL,GetSaveSlotString(4));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (_CurrentSaveState == 4) { Item.ItemTicked = true; }
|
|
|
|
CurrentSaveMenu.push_back(Item);
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_CURRENT_SAVE_5, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_5,AccessLevel),NULL,GetSaveSlotString(5));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (_CurrentSaveState == 5) { Item.ItemTicked = true; }
|
|
|
|
CurrentSaveMenu.push_back(Item);
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_CURRENT_SAVE_6, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_6,AccessLevel),NULL,GetSaveSlotString(6));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (_CurrentSaveState == 6) { Item.ItemTicked = true; }
|
|
|
|
CurrentSaveMenu.push_back(Item);
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_CURRENT_SAVE_7, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_7,AccessLevel),NULL,GetSaveSlotString(7));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (_CurrentSaveState == 7) { Item.ItemTicked = true; }
|
|
|
|
CurrentSaveMenu.push_back(Item);
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_CURRENT_SAVE_8, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_8,AccessLevel),NULL,GetSaveSlotString(8));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (_CurrentSaveState == 8) { Item.ItemTicked = true; }
|
|
|
|
CurrentSaveMenu.push_back(Item);
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_CURRENT_SAVE_9, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_9,AccessLevel),NULL,GetSaveSlotString(9));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (_CurrentSaveState == 9) { Item.ItemTicked = true; }
|
|
|
|
CurrentSaveMenu.push_back(Item);
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_CURRENT_SAVE_10, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_10,AccessLevel),NULL,GetSaveSlotString(10));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (_CurrentSaveState == 10) { Item.ItemTicked = true; }
|
|
|
|
CurrentSaveMenu.push_back(Item);
|
|
|
|
|
|
|
|
/* System Menu
|
|
|
|
****************/
|
|
|
|
MenuItemList SystemMenu;
|
|
|
|
MenuItemList ResetMenu;
|
|
|
|
if (inBasicMode)
|
|
|
|
{
|
2008-11-14 20:51:06 +00:00
|
|
|
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_RESET_SOFT, MENU_RESET, m_ShortCuts.ShortCutString(ID_SYSTEM_RESET_SOFT,AccessLevel) ));
|
2008-09-18 03:15:49 +00:00
|
|
|
} else {
|
2008-11-14 20:51:06 +00:00
|
|
|
ResetMenu.push_back(MENU_ITEM(ID_SYSTEM_RESET_SOFT, MENU_RESET_SOFT, m_ShortCuts.ShortCutString(ID_SYSTEM_RESET_SOFT,AccessLevel) ));
|
|
|
|
ResetMenu.push_back(MENU_ITEM(ID_SYSTEM_RESET_HARD, MENU_RESET_HARD, m_ShortCuts.ShortCutString(ID_SYSTEM_RESET_HARD,AccessLevel)));
|
2008-09-18 03:15:49 +00:00
|
|
|
SystemMenu.push_back(MENU_ITEM(SUB_MENU,MENU_RESET,EMPTY_STDSTR,&ResetMenu));
|
|
|
|
}
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(GameRunning_CPU_Paused)) {
|
2008-11-14 20:51:06 +00:00
|
|
|
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_PAUSE, MENU_RESUME, m_ShortCuts.ShortCutString(ID_SYSTEM_PAUSE,AccessLevel)));
|
2008-09-18 03:15:49 +00:00
|
|
|
} else {
|
2008-11-14 20:51:06 +00:00
|
|
|
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_PAUSE, MENU_PAUSE, m_ShortCuts.ShortCutString(ID_SYSTEM_PAUSE,AccessLevel)));
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
2008-11-14 20:51:06 +00:00
|
|
|
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_BITMAP, MENU_BITMAP, m_ShortCuts.ShortCutString(ID_SYSTEM_BITMAP,AccessLevel)));
|
2008-09-18 03:15:49 +00:00
|
|
|
SystemMenu.push_back(MENU_ITEM(SPLITER ));
|
|
|
|
if (!inBasicMode) {
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_SYSTEM_LIMITFPS, MENU_LIMIT_FPS,m_ShortCuts.ShortCutString(ID_SYSTEM_LIMITFPS,AccessLevel) );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(GameRunning_LimitFPS)) { Item.ItemTicked = true; }
|
2008-09-18 03:15:49 +00:00
|
|
|
SystemMenu.push_back(Item);
|
|
|
|
SystemMenu.push_back(MENU_ITEM(SPLITER ));
|
|
|
|
}
|
2008-11-14 20:51:06 +00:00
|
|
|
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_SAVE, MENU_SAVE, m_ShortCuts.ShortCutString(ID_SYSTEM_SAVE,AccessLevel)));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (!inBasicMode) {
|
2008-11-14 20:51:06 +00:00
|
|
|
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_SAVEAS, MENU_SAVE_AS, m_ShortCuts.ShortCutString(ID_SYSTEM_SAVEAS,AccessLevel)));
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
2008-11-14 20:51:06 +00:00
|
|
|
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_RESTORE, MENU_RESTORE, m_ShortCuts.ShortCutString(ID_SYSTEM_RESTORE,AccessLevel)));
|
2008-09-18 03:15:49 +00:00
|
|
|
if (!inBasicMode) {
|
2008-11-14 20:51:06 +00:00
|
|
|
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_LOAD, MENU_LOAD, m_ShortCuts.ShortCutString(ID_SYSTEM_LOAD,AccessLevel)));
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
SystemMenu.push_back(MENU_ITEM(SPLITER ));
|
|
|
|
SystemMenu.push_back(MENU_ITEM(SUB_MENU, MENU_CURRENT_SAVE, EMPTY_STDSTR, &CurrentSaveMenu ));
|
|
|
|
SystemMenu.push_back(MENU_ITEM(SPLITER ));
|
2008-11-14 20:51:06 +00:00
|
|
|
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_CHEAT, MENU_CHEAT, m_ShortCuts.ShortCutString(ID_SYSTEM_CHEAT,AccessLevel)));
|
|
|
|
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_GSBUTTON, MENU_GS_BUTTON, m_ShortCuts.ShortCutString(ID_SYSTEM_GSBUTTON,AccessLevel) ));
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
/* Option Menu
|
|
|
|
****************/
|
|
|
|
MenuItemList OptionMenu;
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_OPTIONS_FULLSCREEN, MENU_FULL_SCREEN,m_ShortCuts.ShortCutString(ID_OPTIONS_FULLSCREEN,AccessLevel) );
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemEnabled = CPURunning;
|
2012-11-17 02:20:21 +00:00
|
|
|
if (g_Plugins->Gfx() && g_Plugins->Gfx()->ChangeWindow == NULL) {
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemEnabled = false;
|
|
|
|
}
|
|
|
|
OptionMenu.push_back(Item);
|
|
|
|
if (!inBasicMode) {
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_OPTIONS_ALWAYSONTOP, MENU_ON_TOP,m_ShortCuts.ShortCutString(ID_OPTIONS_ALWAYSONTOP,AccessLevel) );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadDword(UserInterface_AlwaysOnTop)) { Item.ItemTicked = true; }
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemEnabled = CPURunning;
|
|
|
|
OptionMenu.push_back(Item);
|
|
|
|
}
|
|
|
|
OptionMenu.push_back(MENU_ITEM(SPLITER ));
|
|
|
|
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_OPTIONS_CONFIG_GFX, MENU_CONFG_GFX,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_GFX,AccessLevel));
|
2012-11-17 02:20:21 +00:00
|
|
|
if (g_Plugins->Gfx() == NULL || g_Plugins->Gfx()->Config == NULL) {
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemEnabled = false;
|
|
|
|
}
|
|
|
|
OptionMenu.push_back(Item);
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_OPTIONS_CONFIG_AUDIO, MENU_CONFG_AUDIO,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_AUDIO,AccessLevel));
|
2012-11-17 02:20:21 +00:00
|
|
|
if (g_Plugins->Audio() == NULL || g_Plugins->Audio()->Config == NULL) {
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemEnabled = false;
|
|
|
|
}
|
|
|
|
OptionMenu.push_back(Item);
|
|
|
|
if (!inBasicMode) {
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_OPTIONS_CONFIG_RSP, MENU_CONFG_RSP,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_RSP,AccessLevel));
|
2012-11-17 02:20:21 +00:00
|
|
|
if (g_Plugins->RSP() == NULL || g_Plugins->RSP()->Config == NULL) {
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemEnabled = false;
|
|
|
|
}
|
|
|
|
OptionMenu.push_back(Item);
|
|
|
|
}
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_OPTIONS_CONFIG_CONT, MENU_CONFG_CTRL,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_CONT,AccessLevel));
|
2012-11-17 02:20:21 +00:00
|
|
|
if (g_Plugins->Control() == NULL || g_Plugins->Control()->Config == NULL) {
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemEnabled = false;
|
|
|
|
}
|
|
|
|
OptionMenu.push_back(Item);
|
|
|
|
|
|
|
|
OptionMenu.push_back(MENU_ITEM(SPLITER ));
|
|
|
|
if (!inBasicMode) {
|
2008-11-14 20:51:06 +00:00
|
|
|
Item.Reset(ID_OPTIONS_CPU_USAGE, MENU_SHOW_CPU,m_ShortCuts.ShortCutString(ID_OPTIONS_CPU_USAGE,AccessLevel) );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadDword(UserInterface_ShowCPUPer)) { Item.ItemTicked = true; }
|
2008-09-18 03:15:49 +00:00
|
|
|
OptionMenu.push_back(Item);
|
|
|
|
}
|
2008-11-14 20:51:06 +00:00
|
|
|
OptionMenu.push_back(MENU_ITEM(ID_OPTIONS_SETTINGS, MENU_SETTINGS,m_ShortCuts.ShortCutString(ID_OPTIONS_SETTINGS,AccessLevel) ));
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
/* Profile Menu
|
|
|
|
****************/
|
|
|
|
MenuItemList DebugProfileMenu;
|
2012-09-28 20:07:45 +00:00
|
|
|
if (bHaveDebugger())
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
|
|
|
Item.Reset(ID_PROFILE_PROFILE,EMPTY_STRING,EMPTY_STDSTR,NULL,"Profile Code" );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Debugger_ProfileCode)) { Item.ItemTicked = true; }
|
2008-09-18 03:15:49 +00:00
|
|
|
DebugProfileMenu.push_back(Item);
|
|
|
|
Item.Reset(ID_PROFILE_RESETCOUNTER,EMPTY_STRING,EMPTY_STDSTR,NULL,"Reset Counters" );
|
|
|
|
if (!CPURunning) { Item.ItemEnabled = false; }
|
|
|
|
DebugProfileMenu.push_back(Item);
|
|
|
|
Item.Reset(ID_PROFILE_GENERATELOG,EMPTY_STRING,EMPTY_STDSTR,NULL,"Generate Log File" );
|
|
|
|
if (!CPURunning) { Item.ItemEnabled = false; }
|
|
|
|
DebugProfileMenu.push_back(Item);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Debugger Menu
|
|
|
|
****************/
|
|
|
|
MenuItemList DebugMenu;
|
|
|
|
MenuItemList DebugLoggingMenu;
|
|
|
|
MenuItemList DebugAppLoggingMenu;
|
|
|
|
MenuItemList DebugR4300Menu;
|
|
|
|
MenuItemList DebugMemoryMenu;
|
|
|
|
MenuItemList DebugInterrupt;
|
2012-09-30 13:07:00 +00:00
|
|
|
MenuItemList DebugNotificationMenu;
|
2012-09-28 20:07:45 +00:00
|
|
|
if (bHaveDebugger()) {
|
2008-09-18 03:15:49 +00:00
|
|
|
/* Debug - Interrupt
|
|
|
|
*******************/
|
|
|
|
Item.Reset(ID_DEBUGGER_INTERRUPT_SP,EMPTY_STRING,EMPTY_STDSTR,NULL,"SP Interrupt" );
|
|
|
|
Item.ItemEnabled = CPURunning;
|
|
|
|
DebugInterrupt.push_back(Item);
|
|
|
|
Item.Reset(ID_DEBUGGER_INTERRUPT_SI,EMPTY_STRING,EMPTY_STDSTR,NULL,"SI Interrupt" );
|
|
|
|
Item.ItemEnabled = CPURunning;
|
|
|
|
DebugInterrupt.push_back(Item);
|
|
|
|
Item.Reset(ID_DEBUGGER_INTERRUPT_AI,EMPTY_STRING,EMPTY_STDSTR,NULL,"AI Interrupt" );
|
|
|
|
Item.ItemEnabled = CPURunning;
|
|
|
|
DebugInterrupt.push_back(Item);
|
|
|
|
Item.Reset(ID_DEBUGGER_INTERRUPT_VI,EMPTY_STRING,EMPTY_STDSTR,NULL,"VI Interrupt" );
|
|
|
|
Item.ItemEnabled = CPURunning;
|
|
|
|
DebugInterrupt.push_back(Item);
|
|
|
|
Item.Reset(ID_DEBUGGER_INTERRUPT_PI,EMPTY_STRING,EMPTY_STDSTR,NULL,"PI Interrupt" );
|
|
|
|
Item.ItemEnabled = CPURunning;
|
|
|
|
DebugInterrupt.push_back(Item);
|
|
|
|
Item.Reset(ID_DEBUGGER_INTERRUPT_DP,EMPTY_STRING,EMPTY_STDSTR,NULL,"DP Interrupt" );
|
|
|
|
Item.ItemEnabled = CPURunning;
|
|
|
|
DebugInterrupt.push_back(Item);
|
|
|
|
|
|
|
|
/* Debug - R4300i
|
|
|
|
*******************/
|
|
|
|
Item.Reset(ID_DEBUGGER_LOGOPTIONS,EMPTY_STRING,EMPTY_STDSTR,NULL,"R4300i &Commands..." );
|
|
|
|
Item.ItemEnabled = false;
|
|
|
|
DebugR4300Menu.push_back(Item);
|
|
|
|
Item.Reset(ID_DEBUGGER_R4300REGISTERS,EMPTY_STRING,EMPTY_STDSTR,NULL,"R4300i &Registers..." );
|
|
|
|
Item.ItemEnabled = true;
|
|
|
|
DebugR4300Menu.push_back(Item);
|
|
|
|
Item.Reset(ID_DEBUG_DISABLE_GAMEFIX,EMPTY_STRING,EMPTY_STDSTR,NULL,"Disable Game Fixes" );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Debugger_DisableGameFixes)) {
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemTicked = true;
|
|
|
|
}
|
|
|
|
DebugR4300Menu.push_back(Item);
|
|
|
|
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugInterrupt,"&Generate Interrupt");
|
|
|
|
DebugR4300Menu.push_back(Item);
|
|
|
|
|
|
|
|
/* Debug - Memory
|
|
|
|
****************/
|
|
|
|
Item.Reset(ID_DEBUGGER_MEMORY,EMPTY_STRING,EMPTY_STDSTR,NULL,"View..." );
|
|
|
|
DebugMemoryMenu.push_back(Item);
|
|
|
|
Item.Reset(ID_DEBUGGER_SEARCHMEMORY,EMPTY_STRING,EMPTY_STDSTR,NULL,"Search..." );
|
|
|
|
DebugMemoryMenu.push_back(Item);
|
|
|
|
Item.Reset(ID_DEBUGGER_DUMPMEMORY,EMPTY_STRING,EMPTY_STDSTR,NULL,"Dump..." );
|
|
|
|
DebugMemoryMenu.push_back(Item);
|
|
|
|
Item.Reset(ID_DEBUGGER_TLBENTRIES,EMPTY_STRING,EMPTY_STDSTR,NULL,"TLB Entries..." );
|
|
|
|
DebugMemoryMenu.push_back(Item);
|
|
|
|
|
|
|
|
/* Debug - App logging
|
|
|
|
*******************/
|
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
Item.Reset(ID_DEBUGGER_APPLOG_ERRORS,EMPTY_STRING,EMPTY_STDSTR,NULL,"Error Messages" );
|
|
|
|
if ((LogLevel & TraceError) != 0) { Item.ItemTicked = true; }
|
|
|
|
DebugAppLoggingMenu.push_back(Item);
|
|
|
|
|
|
|
|
Item.Reset(ID_DEBUGGER_APPLOG_SETTINGS,EMPTY_STRING,EMPTY_STDSTR,NULL,"Settings" );
|
|
|
|
if ((LogLevel & TraceSettings) != 0) { Item.ItemTicked = true; }
|
|
|
|
DebugAppLoggingMenu.push_back(Item);
|
|
|
|
|
|
|
|
Item.Reset(ID_DEBUGGER_APPLOG_RECOMPILER,EMPTY_STRING,EMPTY_STDSTR,NULL,"Recompiler" );
|
|
|
|
if ((LogLevel & TraceRecompiler) != 0) { Item.ItemTicked = true; }
|
|
|
|
DebugAppLoggingMenu.push_back(Item);
|
|
|
|
|
|
|
|
Item.Reset(ID_DEBUGGER_APPLOG_RSP,EMPTY_STRING,EMPTY_STDSTR,NULL,"RSP" );
|
|
|
|
if ((LogLevel & TraceRSP) != 0) { Item.ItemTicked = true; }
|
|
|
|
DebugAppLoggingMenu.push_back(Item);
|
|
|
|
|
|
|
|
Item.Reset(ID_DEBUGGER_APPLOG_TLB,EMPTY_STRING,EMPTY_STDSTR,NULL,"TLB" );
|
|
|
|
if ((LogLevel & TraceTLB) != 0) { Item.ItemTicked = true; }
|
|
|
|
DebugAppLoggingMenu.push_back(Item);
|
|
|
|
|
|
|
|
Item.Reset(ID_DEBUGGER_APPLOG_GFX_PLUGIN,EMPTY_STRING,EMPTY_STDSTR,NULL,"Gfx Plugin" );
|
|
|
|
if ((LogLevel & TraceGfxPlugin) != 0) { Item.ItemTicked = true; }
|
|
|
|
DebugAppLoggingMenu.push_back(Item);
|
|
|
|
|
2011-01-04 09:10:28 +00:00
|
|
|
Item.Reset(ID_DEBUGGER_APPLOG_AUDIO_EMU,EMPTY_STRING,EMPTY_STDSTR,NULL,"Audio Emulation" );
|
|
|
|
if ((LogLevel & TraceAudio) != 0) { Item.ItemTicked = true; }
|
|
|
|
DebugAppLoggingMenu.push_back(Item);
|
|
|
|
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.Reset(ID_DEBUGGER_APPLOG_DEBUG,EMPTY_STRING,EMPTY_STDSTR,NULL,"Debug Messages" );
|
|
|
|
if ((LogLevel & TraceDebug) != 0) { Item.ItemTicked = true; }
|
|
|
|
DebugAppLoggingMenu.push_back(Item);
|
|
|
|
|
|
|
|
DebugAppLoggingMenu.push_back(MENU_ITEM(SPLITER ));
|
|
|
|
|
|
|
|
Item.Reset(ID_DEBUGGER_APPLOG_FLUSH,EMPTY_STRING,EMPTY_STDSTR,NULL,"Auto flush file" );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Debugger_AppLogFlush)) { Item.ItemTicked = true; }
|
2008-09-18 03:15:49 +00:00
|
|
|
DebugAppLoggingMenu.push_back(Item);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Debug - Logging
|
|
|
|
*******************/
|
|
|
|
Item.Reset(ID_DEBUGGER_LOGOPTIONS,EMPTY_STRING,EMPTY_STDSTR,NULL,"Log Options..." );
|
|
|
|
DebugLoggingMenu.push_back(Item);
|
|
|
|
|
|
|
|
|
|
|
|
Item.Reset(ID_DEBUGGER_GENERATELOG,EMPTY_STRING,EMPTY_STDSTR,NULL,"Generate Log" );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Debugger_GenerateDebugLog)) { Item.ItemTicked = true; }
|
2008-09-18 03:15:49 +00:00
|
|
|
DebugLoggingMenu.push_back(Item);
|
|
|
|
|
|
|
|
/* Debugger Main Menu
|
|
|
|
****************/
|
|
|
|
Item.Reset(ID_DEBUGGER_BREAKPOINTS, EMPTY_STRING,EMPTY_STDSTR, NULL,"Breakpoint...");
|
|
|
|
Item.ItemEnabled = CPURunning;
|
|
|
|
DebugMenu.push_back(Item);
|
|
|
|
DebugMenu.push_back(MENU_ITEM(SPLITER));
|
|
|
|
|
|
|
|
/* Debug - RSP
|
|
|
|
*******************/
|
2012-11-17 02:20:21 +00:00
|
|
|
if (g_Plugins->RSP() != NULL && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu()))
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2012-11-17 02:20:21 +00:00
|
|
|
Item.Reset(ID_PLUGIN_MENU,EMPTY_STRING,NULL,g_Plugins->RSP()->GetDebugMenu(),"&RSP" );
|
2008-09-18 03:15:49 +00:00
|
|
|
DebugMenu.push_back(Item);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Debug - RDP
|
|
|
|
*******************/
|
2012-11-17 02:20:21 +00:00
|
|
|
if (g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu()))
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2012-11-17 02:20:21 +00:00
|
|
|
Item.Reset(ID_PLUGIN_MENU,EMPTY_STRING,NULL,g_Plugins->Gfx()->GetDebugMenu(),"&RDP" );
|
2008-09-18 03:15:49 +00:00
|
|
|
DebugMenu.push_back(Item);
|
|
|
|
}
|
|
|
|
|
2012-09-30 13:07:00 +00:00
|
|
|
/* Notification Menu
|
|
|
|
*******************/
|
|
|
|
Item.Reset(ID_DEBUG_SHOW_UNHANDLED_MEM,EMPTY_STRING,EMPTY_STDSTR,NULL,"On Unhandled Memory Actions" );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) {
|
2012-09-30 13:07:00 +00:00
|
|
|
Item.ItemTicked = true;
|
|
|
|
}
|
|
|
|
DebugNotificationMenu.push_back(Item);
|
|
|
|
Item.Reset(ID_DEBUG_SHOW_PIF_ERRORS,EMPTY_STRING,EMPTY_STDSTR,NULL,"On PIF Errors" );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Debugger_ShowPifErrors)) {
|
2012-09-30 13:07:00 +00:00
|
|
|
Item.ItemTicked = true;
|
|
|
|
}
|
|
|
|
DebugNotificationMenu.push_back(Item);
|
|
|
|
Item.Reset(ID_DEBUG_SHOW_DIV_BY_ZERO,EMPTY_STRING,EMPTY_STDSTR,NULL,"On Div By Zero" );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Debugger_ShowDivByZero)) {
|
2012-09-30 13:07:00 +00:00
|
|
|
Item.ItemTicked = true;
|
|
|
|
}
|
|
|
|
DebugNotificationMenu.push_back(Item);
|
|
|
|
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugR4300Menu,"&R4300i");
|
|
|
|
DebugMenu.push_back(Item);
|
|
|
|
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugMemoryMenu,"Memory");
|
|
|
|
Item.ItemEnabled = CPURunning;
|
|
|
|
DebugMenu.push_back(Item);
|
|
|
|
DebugMenu.push_back(MENU_ITEM(SPLITER));
|
|
|
|
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugProfileMenu,"Profile");
|
|
|
|
DebugMenu.push_back(Item);
|
|
|
|
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugAppLoggingMenu,"App Logging");
|
|
|
|
DebugMenu.push_back(Item);
|
|
|
|
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugLoggingMenu,"Logging");
|
|
|
|
DebugMenu.push_back(Item);
|
2012-09-30 13:07:00 +00:00
|
|
|
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugNotificationMenu,"Notification");
|
|
|
|
DebugMenu.push_back(Item);
|
2008-09-18 03:15:49 +00:00
|
|
|
DebugMenu.push_back(MENU_ITEM(SPLITER));
|
2012-09-28 20:07:45 +00:00
|
|
|
Item.Reset(ID_DEBUG_SHOW_TLB_MISSES,EMPTY_STRING,EMPTY_STDSTR,NULL,"Show TLB Misses" );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Debugger_ShowTLBMisses)) {
|
2012-09-28 20:07:45 +00:00
|
|
|
Item.ItemTicked = true;
|
|
|
|
}
|
2012-09-30 13:07:00 +00:00
|
|
|
Item.Reset(ID_DEBUG_SHOW_DLIST_COUNT,EMPTY_STRING,EMPTY_STDSTR,NULL,"Display Alist/Dlist Count" );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Debugger_ShowDListAListCount)) {
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemTicked = true;
|
|
|
|
}
|
|
|
|
DebugMenu.push_back(Item);
|
2012-09-30 13:07:00 +00:00
|
|
|
Item.Reset(ID_DEBUG_SHOW_RECOMP_MEM_SIZE,EMPTY_STRING,EMPTY_STDSTR,NULL,"Display Recompiler Code Buffer Size" );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Debugger_ShowRecompMemSize)) {
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemTicked = true;
|
|
|
|
}
|
|
|
|
DebugMenu.push_back(Item);
|
|
|
|
DebugMenu.push_back(MENU_ITEM(SPLITER));
|
|
|
|
Item.Reset(ID_DEBUG_GENERATE_LOG_FILES,EMPTY_STRING,EMPTY_STDSTR,NULL,"Generate Log Files" );
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Debugger_GenerateLogFiles)) {
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.ItemTicked = true;
|
|
|
|
}
|
|
|
|
DebugMenu.push_back(Item);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Help Menu
|
|
|
|
****************/
|
|
|
|
MenuItemList HelpMenu;
|
2012-11-17 01:02:04 +00:00
|
|
|
if (g_Settings->LoadBool(Beta_IsBetaVersion))
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2012-11-17 01:02:04 +00:00
|
|
|
stdstr_f User("Beta For: %s",g_Settings->LoadString(Beta_UserName).c_str());
|
|
|
|
stdstr_f Email("Email: %s",g_Settings->LoadString(Beta_EmailAddress).c_str());
|
2008-09-18 03:15:49 +00:00
|
|
|
HelpMenu.push_back(MENU_ITEM(NO_ID, EMPTY_STRING,EMPTY_STDSTR,NULL,User ));
|
|
|
|
HelpMenu.push_back(MENU_ITEM(NO_ID, EMPTY_STRING,EMPTY_STDSTR,NULL,Email ));
|
|
|
|
HelpMenu.push_back(MENU_ITEM(SPLITER ));
|
|
|
|
}
|
|
|
|
|
|
|
|
HelpMenu.push_back(MENU_ITEM(ID_HELP_CONTENTS, MENU_USER_MAN ));
|
|
|
|
HelpMenu.push_back(MENU_ITEM(ID_HELP_GAMEFAQ, MENU_GAME_FAQ ));
|
|
|
|
HelpMenu.push_back(MENU_ITEM(SPLITER ));
|
|
|
|
HelpMenu.push_back(MENU_ITEM(ID_HELP_SUPPORTFORUM, MENU_FORUM ));
|
|
|
|
HelpMenu.push_back(MENU_ITEM(ID_HELP_HOMEPAGE, MENU_HOMEPAGE ));
|
|
|
|
HelpMenu.push_back(MENU_ITEM(SPLITER ));
|
|
|
|
if (!inBasicMode) {
|
|
|
|
HelpMenu.push_back(MENU_ITEM(ID_HELP_ABOUTSETTINGFILES, MENU_ABOUT_INI ));
|
|
|
|
}
|
|
|
|
HelpMenu.push_back(MENU_ITEM(ID_HELP_ABOUT, MENU_ABOUT_PJ64 ));
|
|
|
|
|
|
|
|
/* Main Title bar Menu
|
|
|
|
***********************/
|
|
|
|
MenuItemList MainTitleMenu;
|
|
|
|
Item.Reset(SUB_MENU, MENU_FILE, EMPTY_STDSTR, &FileMenu);
|
|
|
|
if (RomLoading) { Item.ItemEnabled = false; }
|
|
|
|
MainTitleMenu.push_back(Item);
|
|
|
|
if (CPURunning) {
|
|
|
|
Item.Reset(SUB_MENU, MENU_SYSTEM, EMPTY_STDSTR, &SystemMenu);
|
|
|
|
if (RomLoading) { Item.ItemEnabled = false; }
|
|
|
|
MainTitleMenu.push_back(Item);
|
|
|
|
}
|
|
|
|
Item.Reset(SUB_MENU, MENU_OPTIONS, EMPTY_STDSTR, &OptionMenu);
|
|
|
|
if (RomLoading) { Item.ItemEnabled = false; }
|
|
|
|
MainTitleMenu.push_back(Item);
|
|
|
|
if (!inBasicMode) {
|
2012-09-28 20:07:45 +00:00
|
|
|
if (bHaveDebugger()) {
|
2008-09-18 03:15:49 +00:00
|
|
|
Item.Reset(SUB_MENU, MENU_DEBUGGER, EMPTY_STDSTR, &DebugMenu);
|
|
|
|
if (RomLoading) { Item.ItemEnabled = false; }
|
|
|
|
MainTitleMenu.push_back(Item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Item.Reset(SUB_MENU, MENU_HELP, EMPTY_STDSTR, &HelpMenu);
|
|
|
|
if (RomLoading) { Item.ItemEnabled = false; }
|
|
|
|
MainTitleMenu.push_back(Item);
|
|
|
|
|
|
|
|
AddMenu(hMenu,MainTitleMenu);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMainMenu::RebuildAccelerators(void) {
|
2010-06-12 02:02:06 +00:00
|
|
|
CGuard Guard(m_CS);
|
|
|
|
|
2008-09-18 03:15:49 +00:00
|
|
|
//Delete the old accel list
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": Start");
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2008-11-14 20:51:06 +00:00
|
|
|
HACCEL m_OldAccelTable = (HACCEL)m_AccelTable;
|
|
|
|
m_AccelTable = m_ShortCuts.GetAcceleratorTable();
|
|
|
|
if (m_OldAccelTable) {
|
|
|
|
DestroyAcceleratorTable(m_OldAccelTable);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": Done");
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|
2012-12-17 00:21:29 +00:00
|
|
|
void CMainMenu::ResetMenu(void)
|
|
|
|
{
|
2012-12-20 20:56:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": Start");
|
2012-11-17 01:02:04 +00:00
|
|
|
if (!g_Settings->LoadBool(UserInterface_InFullScreen))
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
|
|
|
//Create a new window with all the items
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": Create Menu");
|
2008-09-18 03:15:49 +00:00
|
|
|
MENU_HANDLE hMenu = (MENU_HANDLE)CreateMenu();
|
|
|
|
FillOutMenu(hMenu);
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": Create Menu Done");
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
//save old menu to destroy latter
|
2010-06-29 02:11:22 +00:00
|
|
|
MENU_HANDLE OldMenuHandle;
|
|
|
|
{
|
|
|
|
CGuard Guard(m_CS);
|
|
|
|
OldMenuHandle = m_MenuHandle;
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2010-06-29 02:11:22 +00:00
|
|
|
//save handle and re-attach to a window
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": Attach Menu");
|
2010-06-29 02:11:22 +00:00
|
|
|
m_MenuHandle = hMenu;
|
|
|
|
}
|
2008-09-18 03:15:49 +00:00
|
|
|
_Gui->SetWindowMenu(this);
|
|
|
|
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": Remove plugin menu");
|
2012-11-17 02:20:21 +00:00
|
|
|
if (g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu()))
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2012-11-17 02:20:21 +00:00
|
|
|
RemoveMenu((HMENU)OldMenuHandle,(DWORD)g_Plugins->Gfx()->GetDebugMenu(), MF_BYCOMMAND);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
2012-11-17 02:20:21 +00:00
|
|
|
if (g_Plugins->RSP() != NULL && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu()))
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2012-11-17 02:20:21 +00:00
|
|
|
RemoveMenu((HMENU)OldMenuHandle,(DWORD)g_Plugins->RSP()->GetDebugMenu(), MF_BYCOMMAND);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": Destroy Old Menu");
|
2008-11-14 20:51:06 +00:00
|
|
|
|
|
|
|
//Destroy the old menu
|
2008-09-18 03:15:49 +00:00
|
|
|
DestroyMenu((HMENU)OldMenuHandle);
|
|
|
|
}
|
|
|
|
|
|
|
|
ResetAccelerators();
|
|
|
|
|
2012-12-17 00:21:29 +00:00
|
|
|
WriteTrace(TraceDebug,__FUNCTION__ ": Done");
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|