mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-05 08:10:10 +01:00
move module initialization into a module manager, still has some issues like stopping not working and debug crashing add #idef 0 to modules that aren't in the windows project don't double initialize and don't de-initialize for now, since many modules don't expect it and it leads to many errors remove duplicate module lists for empty modules and implemented ones, make Module non-copyable but movable add secondary project, no real use for it now add some memleak config to the emucore and add asmjit path to rpcs3 small rebase error fixed to get it to compile again add filters for emucore re-add the module manager and static file WIP commit, linker errors abound some more abstraction layer stuff fix the remaining linker errors, re-enable platform specific mouse, pad and keyboard handlers rebasing fix memset undefined and re() usage of se_t before declaration Add wxGUI define by default for cmake builds fix copy constructors of Datetime header fix copy constructors of other wx interface classes remove static declarations of global variables make wxGLCanvas constructor non-ambiguous even with wx2.8. compat mode, fix wrong std::exception constructor calls remove duplicate definition for FromUTF8 and ToUTF8 temp changes
107 lines
2 KiB
C++
107 lines
2 KiB
C++
#include "stdafx.h"
|
|
#include "Emu/ConLog.h"
|
|
#include "Emu/Memory/Memory.h"
|
|
#include "Emu/System.h"
|
|
#include "rpcs3.h"
|
|
#include "Ini.h"
|
|
#include "Gui/ConLogFrame.h"
|
|
#include "Emu/GameInfo.h"
|
|
|
|
#ifdef _WIN32
|
|
#include <wx/msw/wrapwin.h>
|
|
#endif
|
|
|
|
#ifdef __UNIX__
|
|
#include <X11/Xlib.h>
|
|
#endif
|
|
|
|
wxDEFINE_EVENT(wxEVT_DBG_COMMAND, wxCommandEvent);
|
|
|
|
IMPLEMENT_APP(Rpcs3App)
|
|
Rpcs3App* TheApp;
|
|
|
|
bool Rpcs3App::OnInit()
|
|
{
|
|
TheApp = this;
|
|
SetAppName(_PRGNAME_);
|
|
wxInitAllImageHandlers();
|
|
|
|
Ini.Load();
|
|
|
|
m_MainFrame = new MainFrame();
|
|
SetTopWindow(m_MainFrame);
|
|
Emu.Init();
|
|
|
|
m_MainFrame->Show();
|
|
m_MainFrame->DoSettings(true);
|
|
|
|
OnArguments();
|
|
|
|
return true;
|
|
}
|
|
|
|
void Rpcs3App::OnArguments()
|
|
{
|
|
// Usage:
|
|
// rpcs3-*.exe Initializes RPCS3
|
|
// rpcs3-*.exe [(S)ELF] Initializes RPCS3, then loads and runs the specified (S)ELF file.
|
|
|
|
if (Rpcs3App::argc > 1)
|
|
{
|
|
// Force this value to be true
|
|
Ini.HLEExitOnStop.SetValue(true);
|
|
|
|
Emu.SetPath(fmt::ToUTF8(argv[1]));
|
|
Emu.Load();
|
|
Emu.Run();
|
|
}
|
|
}
|
|
|
|
void Rpcs3App::Exit()
|
|
{
|
|
Emu.Stop();
|
|
Ini.Save();
|
|
|
|
if(ConLogFrame && !ConLogFrame->IsBeingDeleted()) ConLogFrame->Close();
|
|
|
|
wxApp::Exit();
|
|
}
|
|
|
|
void Rpcs3App::SendDbgCommand(DbgCommand id, CPUThread* thr)
|
|
{
|
|
wxCommandEvent event(wxEVT_DBG_COMMAND, id);
|
|
event.SetClientData(thr);
|
|
AddPendingEvent(event);
|
|
}
|
|
|
|
Rpcs3App::Rpcs3App()
|
|
{
|
|
#if defined(__UNIX__) && !defined(__APPLE__)
|
|
XInitThreads();
|
|
#endif
|
|
}
|
|
/*
|
|
CPUThread& GetCPU(const u8 core)
|
|
{
|
|
return Emu.GetCPU().Get(core);
|
|
}*/
|
|
|
|
//TODOB: remove this
|
|
//convert a wxString to a std::string encoded in utf8
|
|
//CAUTION, only use this to interface with wxWidgets classes
|
|
std::string fmt::ToUTF8(const wxString& right)
|
|
{
|
|
auto ret = std::string(((const char *)right.utf8_str()));
|
|
return ret;
|
|
}
|
|
|
|
//convert a std::string encoded in utf8 to a wxString
|
|
//CAUTION, only use this to interface with wxWidgets classes
|
|
wxString fmt::FromUTF8(const std::string& right)
|
|
{
|
|
auto ret = wxString::FromUTF8(right.c_str());
|
|
return ret;
|
|
}
|
|
|
|
GameInfo CurGameInfo;
|