From cb5072c3e4cf66d33d30697984a9179534334b38 Mon Sep 17 00:00:00 2001 From: "fires.gc" Date: Wed, 16 Jul 2008 12:19:14 +0000 Subject: [PATCH] added additional information like FPS to the status bar added menu option to activate dual core support git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@11 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/Core.cpp | 3 +++ Source/Core/Core/Src/Host.h | 1 + Source/Core/DebuggerWX/src/CodeWindow.cpp | 4 +-- Source/Core/DolphinWX/src/BootManager.cpp | 4 +-- Source/Core/DolphinWX/src/Frame.cpp | 32 +++++++++++++++++++---- Source/Core/DolphinWX/src/Frame.h | 2 ++ Source/Core/DolphinWX/src/Globals.h | 2 ++ Source/Core/DolphinWX/src/Main.cpp | 6 +++++ 8 files changed, 45 insertions(+), 9 deletions(-) diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 23a5d69aca..f02dc1f8fd 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -444,6 +444,9 @@ void Callback_VideoCopiedToXFB() if( g_pUpdateFPSDisplay != NULL ) g_pUpdateFPSDisplay(temp); + Host_UpdateStatusBar(temp); + + frames = 0; Timer.Update(); } diff --git a/Source/Core/Core/Src/Host.h b/Source/Core/Core/Src/Host.h index 6b703f3eb1..cc177f2baa 100644 --- a/Source/Core/Core/Src/Host.h +++ b/Source/Core/Core/Src/Host.h @@ -49,5 +49,6 @@ void Host_SetWaitCursor(bool enable); void Host_CreateDisplay(); void Host_CloseDisplay(); +void Host_UpdateStatusBar(const char* _pText); #endif diff --git a/Source/Core/DebuggerWX/src/CodeWindow.cpp b/Source/Core/DebuggerWX/src/CodeWindow.cpp index 54a3a2f4f3..fc71e769d7 100644 --- a/Source/Core/DebuggerWX/src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/src/CodeWindow.cpp @@ -144,8 +144,8 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam wxMenuItem* interpreter = pDebugMenu->Append(IDM_INTERPRETER, _T("&Interpreter"), wxEmptyString, wxITEM_CHECK); interpreter->Check(!_LocalCoreStartupParameter.bUseDynarec); - wxMenuItem* dualcore = pDebugMenu->Append(IDM_DUALCORE, _T("&DualCore"), wxEmptyString, wxITEM_CHECK); - dualcore->Check(_LocalCoreStartupParameter.bUseDualCore); +// wxMenuItem* dualcore = pDebugMenu->Append(IDM_DUALCORE, _T("&DualCore"), wxEmptyString, wxITEM_CHECK); +// dualcore->Check(_LocalCoreStartupParameter.bUseDualCore); pMenuBar->Append(pDebugMenu, _T("&Core Startup")); } diff --git a/Source/Core/DolphinWX/src/BootManager.cpp b/Source/Core/DolphinWX/src/BootManager.cpp index d4dcb68c6a..87d6b1741d 100644 --- a/Source/Core/DolphinWX/src/BootManager.cpp +++ b/Source/Core/DolphinWX/src/BootManager.cpp @@ -48,12 +48,12 @@ bool BootCore(const std::string& _rFilename) if (code_frame) { - StartUp.bUseDualCore = code_frame->UseDualCore(); +// StartUp.bUseDualCore = code_frame->UseDualCore(); StartUp.bUseDynarec = !code_frame->UseInterpreter(); } else { - StartUp.bUseDualCore = false; +// StartUp.bUseDualCore = false; StartUp.bUseDynarec = true; } diff --git a/Source/Core/DolphinWX/src/Frame.cpp b/Source/Core/DolphinWX/src/Frame.cpp index dbfaf1065b..7359294a12 100644 --- a/Source/Core/DolphinWX/src/Frame.cpp +++ b/Source/Core/DolphinWX/src/Frame.cpp @@ -89,6 +89,7 @@ EVT_MENU(IDM_CONFIG_DSP_PLUGIN, CFrame::OnPluginDSP) EVT_MENU(IDM_CONFIG_PAD_PLUGIN, CFrame::OnPluginPAD) EVT_MENU(IDM_BROWSE, CFrame::OnBrowse) EVT_MENU(IDM_TOGGLE_FULLSCREEN, CFrame::OnToggleFullscreen) +EVT_MENU(IDM_TOGGLE_DUALCORE, CFrame::OnToggleDualCore) EVT_HOST_COMMAND(wxID_ANY, CFrame::OnHostMessage) END_EVENT_TABLE() @@ -106,6 +107,7 @@ CFrame::CFrame(wxFrame* parent, , m_pMenuBar(NULL) , m_Panel(NULL) , m_pBootProcessDialog(NULL) + , m_pStatusBar(NULL) { InitBitmaps(); @@ -115,7 +117,7 @@ CFrame::CFrame(wxFrame* parent, SetIcon(IconTemp); // Give it a status line - CreateStatusBar(); + m_pStatusBar = CreateStatusBar(); CreateMenu(); // this panel is the parent for rendering and it holds the gamelistctrl @@ -202,13 +204,19 @@ CFrame::CreateMenu() m_pMenuItemStop->SetDisabledBitmap(m_BitmapsMenu[Toolbar_Stop_Dis]); pEmulationMenu->Append(m_pMenuItemStop); } - pEmulationMenu->AppendSeparator(); - // full screen + pEmulationMenu->AppendSeparator(); { + // full screen wxMenuItem* pItem = new wxMenuItem(pEmulationMenu, IDM_TOGGLE_FULLSCREEN, _T("&Fullscreen")); pItem->SetBitmap(m_BitmapsMenu[Toolbar_FullScreen]); pEmulationMenu->Append(pItem); } + { + // dual core + wxMenuItem* pItem = new wxMenuItem(pEmulationMenu, IDM_TOGGLE_DUALCORE, _T("&Dual Core (instable!)"), wxEmptyString, wxITEM_CHECK); + pEmulationMenu->Append(pItem); + pItem->Check(SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore); + } m_pMenuBar->Append(pEmulationMenu, _T("&Emulation")); } @@ -510,7 +518,6 @@ CFrame::OnHostMessage(wxCommandEvent& event) m_pBootProcessDialog = new wxBusyInfo("Booting...", this); } - break; case IDM_BOOTING_ENDED: @@ -521,8 +528,15 @@ CFrame::OnHostMessage(wxCommandEvent& event) delete m_pBootProcessDialog; m_pBootProcessDialog = NULL; } - break; + + case IDM_UPDATESTATUSBAR: + + if (m_pStatusBar != NULL) + { + m_pStatusBar->SetStatusText(event.GetString()); + } + break; } } @@ -535,6 +549,14 @@ CFrame::OnToggleFullscreen(wxCommandEvent& WXUNUSED (event)) } +void +CFrame::OnToggleDualCore(wxCommandEvent& WXUNUSED (event)) +{ + SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore = !SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore; + SConfig::GetInstance().SaveSettings(); +} + + void CFrame::OnKeyDown(wxKeyEvent& event) { diff --git a/Source/Core/DolphinWX/src/Frame.h b/Source/Core/DolphinWX/src/Frame.h index 23fc3b8c87..1f25f9daf1 100644 --- a/Source/Core/DolphinWX/src/Frame.h +++ b/Source/Core/DolphinWX/src/Frame.h @@ -65,10 +65,12 @@ class CFrame void OnStop(wxCommandEvent& event); void OnBrowse(wxCommandEvent& event); void OnToggleFullscreen(wxCommandEvent& event); + void OnToggleDualCore(wxCommandEvent& event); void OnKeyDown(wxKeyEvent& event); void OnHostMessage(wxCommandEvent& event); + wxStatusBar* m_pStatusBar; wxMenuBar* m_pMenuBar; wxMenuItem* m_pMenuItemPlay; diff --git a/Source/Core/DolphinWX/src/Globals.h b/Source/Core/DolphinWX/src/Globals.h index 58b7d08c1d..80453fc89f 100644 --- a/Source/Core/DolphinWX/src/Globals.h +++ b/Source/Core/DolphinWX/src/Globals.h @@ -30,10 +30,12 @@ enum IDM_CONFIG_DSP_PLUGIN, IDM_CONFIG_PAD_PLUGIN, IDM_TOGGLE_FULLSCREEN, + IDM_TOGGLE_DUALCORE, IDM_NOTIFYMAPLOADED, IDM_UPDATELOGDISPLAY, IDM_UPDATEDISASMDIALOG, IDM_UPDATEGUI, + IDM_UPDATESTATUSBAR, IDM_HOST_MESSAGE, IDM_BOOTING_STARTED, IDM_BOOTING_ENDED, diff --git a/Source/Core/DolphinWX/src/Main.cpp b/Source/Core/DolphinWX/src/Main.cpp index 45922f067b..a278f8f8f9 100644 --- a/Source/Core/DolphinWX/src/Main.cpp +++ b/Source/Core/DolphinWX/src/Main.cpp @@ -221,4 +221,10 @@ void Host_CreateDisplay() void Host_CloseDisplay() {} +void Host_UpdateStatusBar(const char* _pText) +{ + wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATESTATUSBAR); + event.SetString(_pText); + wxPostEvent(main_frame, event); +}