mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 01:08:39 +12:00
Merge remote-tracking branch 'upstream/master'
Conflicts: rpcs3/Emu/GS/GL/GLGSRender.cpp rpcs3/Gui/InterpreterDisAsm.cpp rpcs3/Gui/MainFrame.cpp
This commit is contained in:
commit
f4b98074b0
117 changed files with 11008 additions and 2535 deletions
|
@ -6,6 +6,8 @@
|
|||
#include "Emu/System.h"
|
||||
#include "Ini.h"
|
||||
#include "Emu/GS/sysutil_video.h"
|
||||
#include "Gui/VHDDManager.h"
|
||||
#include "Gui/VFSManager.h"
|
||||
#include <wx/dynlib.h>
|
||||
|
||||
BEGIN_EVENT_TABLE(MainFrame, FrameBase)
|
||||
|
@ -19,8 +21,11 @@ enum IDs
|
|||
id_boot_game,
|
||||
id_sys_pause,
|
||||
id_sys_stop,
|
||||
id_sys_send_open_menu,
|
||||
id_sys_send_exit,
|
||||
id_config_emu,
|
||||
id_config_vfs_manager,
|
||||
id_config_vhdd_manager,
|
||||
id_update_dbg,
|
||||
};
|
||||
|
||||
|
@ -32,8 +37,9 @@ wxString GetPaneName()
|
|||
}
|
||||
|
||||
MainFrame::MainFrame()
|
||||
: FrameBase(NULL, wxID_ANY, "", "MainFrame", wxSize(280, 180))
|
||||
: FrameBase(nullptr, wxID_ANY, "", "MainFrame", wxSize(800, 600))
|
||||
, m_aui_mgr(this)
|
||||
, m_sys_menu_opened(false)
|
||||
{
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
@ -60,25 +66,34 @@ MainFrame::MainFrame()
|
|||
menu_sys.Append(id_sys_pause, "Pause")->Enable(false);
|
||||
menu_sys.Append(id_sys_stop, "Stop\tCtrl + S")->Enable(false);
|
||||
menu_sys.AppendSeparator();
|
||||
menu_sys.Append(id_sys_send_open_menu, "Send open system menu cmd")->Enable(false);
|
||||
menu_sys.Append(id_sys_send_exit, "Send exit cmd")->Enable(false);
|
||||
|
||||
menu_conf.Append(id_config_emu, "Settings");
|
||||
menu_conf.AppendSeparator();
|
||||
menu_conf.Append(id_config_vfs_manager, "Virtual File System Manager");
|
||||
menu_conf.Append(id_config_vhdd_manager, "Virtual HDD Manager");
|
||||
|
||||
SetMenuBar(&menubar);
|
||||
|
||||
m_game_viewer = new GameViewer(this);
|
||||
AddPane(m_game_viewer, "Game List", wxAUI_DOCK_BOTTOM);
|
||||
|
||||
Connect( id_boot_game, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::BootGame) );
|
||||
Connect( id_boot_elf, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::BootElf) );
|
||||
Connect( id_boot_self, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::BootSelf) );
|
||||
Connect( id_boot_game, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::BootGame) );
|
||||
Connect( id_boot_elf, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::BootElf) );
|
||||
Connect( id_boot_self, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::BootSelf) );
|
||||
|
||||
Connect( id_sys_pause, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::Pause) );
|
||||
Connect( id_sys_stop, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::Stop) );
|
||||
Connect( id_sys_send_exit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::SendExit) );
|
||||
Connect( id_update_dbg, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::UpdateUI) );
|
||||
Connect( id_sys_pause, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::Pause) );
|
||||
Connect( id_sys_stop, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::Stop) );
|
||||
Connect( id_sys_send_open_menu, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::SendOpenCloseSysMenu) );
|
||||
Connect( id_sys_send_exit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::SendExit) );
|
||||
|
||||
Connect( id_config_emu, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::Config) );
|
||||
Connect( id_config_vfs_manager, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::ConfigVFS) );
|
||||
Connect( id_config_vhdd_manager,wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::ConfigVHDD) );
|
||||
|
||||
Connect( id_update_dbg, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::UpdateUI) );
|
||||
|
||||
Connect( id_config_emu, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::Config) );
|
||||
m_app_connector.Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainFrame::OnKeyDown), (wxObject*)0, this);
|
||||
m_app_connector.Connect(wxEVT_DBG_COMMAND, wxCommandEventHandler(MainFrame::UpdateUI), (wxObject*)0, this);
|
||||
}
|
||||
|
@ -90,6 +105,7 @@ MainFrame::~MainFrame()
|
|||
|
||||
void MainFrame::AddPane(wxWindow* wind, const wxString& caption, int flags)
|
||||
{
|
||||
wind->SetSize(-1, 300);
|
||||
m_aui_mgr.AddPane(wind, wxAuiPaneInfo().Name(GetPaneName()).Caption(caption).Direction(flags).CloseButton(false).MaximizeButton());
|
||||
}
|
||||
|
||||
|
@ -267,6 +283,13 @@ void MainFrame::SendExit(wxCommandEvent& event)
|
|||
Emu.GetCallbackManager().m_exit_callback.Handle(0x0101, 0);
|
||||
}
|
||||
|
||||
void MainFrame::SendOpenCloseSysMenu(wxCommandEvent& event)
|
||||
{
|
||||
Emu.GetCallbackManager().m_exit_callback.Handle(m_sys_menu_opened ? 0x0132 : 0x0131, 0);
|
||||
m_sys_menu_opened = !m_sys_menu_opened;
|
||||
UpdateUI(wxCommandEvent());
|
||||
}
|
||||
|
||||
void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
//TODO
|
||||
|
@ -373,6 +396,16 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
|||
if(paused) Emu.Resume();
|
||||
}
|
||||
|
||||
void MainFrame::ConfigVFS(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
VFSManagerDialog(this).ShowModal();
|
||||
}
|
||||
|
||||
void MainFrame::ConfigVHDD(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
VHDDManagerDialog(this).ShowModal();
|
||||
}
|
||||
|
||||
void MainFrame::UpdateUI(wxCommandEvent& event)
|
||||
{
|
||||
event.Skip();
|
||||
|
@ -395,6 +428,7 @@ void MainFrame::UpdateUI(wxCommandEvent& event)
|
|||
is_running = false;
|
||||
is_stopped = true;
|
||||
is_ready = false;
|
||||
m_sys_menu_opened = false;
|
||||
break;
|
||||
|
||||
case DID_PAUSE_EMU:
|
||||
|
@ -417,11 +451,14 @@ void MainFrame::UpdateUI(wxCommandEvent& event)
|
|||
is_ready = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
case DID_REGISTRED_CALLBACK:
|
||||
is_running = Emu.IsRunning();
|
||||
is_stopped = Emu.IsStopped();
|
||||
is_ready = Emu.IsReady();
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -434,15 +471,19 @@ void MainFrame::UpdateUI(wxCommandEvent& event)
|
|||
wxMenuBar& menubar( *GetMenuBar() );
|
||||
wxMenuItem& pause = *menubar.FindItem( id_sys_pause );
|
||||
wxMenuItem& stop = *menubar.FindItem( id_sys_stop );
|
||||
wxMenuItem& send_exit = *menubar.FindItem( id_sys_send_exit );
|
||||
|
||||
wxMenuItem& send_exit = *menubar.FindItem( id_sys_send_exit );
|
||||
wxMenuItem& send_open_menu = *menubar.FindItem( id_sys_send_open_menu );
|
||||
pause.SetText(is_running ? "Pause\tCtrl + P" : is_ready ? "Start\tCtrl + C" : "Resume\tCtrl + C");
|
||||
pause.Enable(!is_stopped);
|
||||
stop.Enable(!is_stopped);
|
||||
//send_exit.Enable(false);
|
||||
send_exit.Enable(!is_stopped && Emu.GetCallbackManager().m_exit_callback.m_callbacks.GetCount());
|
||||
bool enable_commands = !is_stopped && Emu.GetCallbackManager().m_exit_callback.m_callbacks.GetCount();
|
||||
|
||||
m_aui_mgr.Update();
|
||||
send_open_menu.SetText(wxString::Format("Send %s system menu cmd", m_sys_menu_opened ? "close" : "open"));
|
||||
send_open_menu.Enable(enable_commands);
|
||||
send_exit.Enable(enable_commands);
|
||||
|
||||
//m_aui_mgr.Update();
|
||||
|
||||
//wxCommandEvent refit( wxEVT_COMMAND_MENU_SELECTED, id_update_dbg );
|
||||
//GetEventHandler()->AddPendingEvent( refit );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue