diff --git a/pcsx2/Recording/Utilities/InputRecordingLogger.cpp b/pcsx2/Recording/Utilities/InputRecordingLogger.cpp index cb97907e97..0619301546 100644 --- a/pcsx2/Recording/Utilities/InputRecordingLogger.cpp +++ b/pcsx2/Recording/Utilities/InputRecordingLogger.cpp @@ -1,4 +1,4 @@ -/* PCSX2 - PS2 Emulator for PCs +/* PCSX2 - PS2 Emulator for PCs * Copyright (C) 2002-2021 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms @@ -27,8 +27,7 @@ namespace inputRec recordingConLog(fmt::format("[REC]: {}\n", log)); // NOTE - Color is not currently used for OSD logs - if (GSosdLog) - GSosdLog(log.c_str(), wxGetApp().GetProgramLog()->GetRGBA(ConsoleColors::Color_StrongMagenta)); + GSosdLog(log.c_str(), wxGetApp().GetProgramLog()->GetRGBA(ConsoleColors::Color_StrongMagenta)); } void consoleLog(const std::string& log) @@ -47,4 +46,4 @@ namespace inputRec recordingConLog(log); } -} // namespace inputRec \ No newline at end of file +} // namespace inputRec diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index fb7454b487..bc4c0d7fe1 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -16,7 +16,6 @@ #include "PrecompiledHeader.h" #include "App.h" #include "MainFrame.h" -#include "Plugins.h" #include "MemoryCardFile.h" @@ -221,19 +220,6 @@ namespace PathDefs return GetDocuments() + Base::MemoryCards(); } - wxDirName GetPlugins() - { - // Each linux distributions have his rules for path so we give them the possibility to - // change it with compilation flags. -- Gregory -#ifndef PLUGIN_DIR_COMPILATION - return AppRoot() + Base::Plugins(); -#else -#define xPLUGIN_DIR_str(s) PLUGIN_DIR_str(s) -#define PLUGIN_DIR_str(s) #s - return wxDirName( xPLUGIN_DIR_str(PLUGIN_DIR_COMPILATION) ); -#endif - } - wxDirName GetSettings() { return GetDocuments() + Base::Settings(); @@ -257,7 +243,6 @@ namespace PathDefs { switch( folderidx ) { - case FolderId_Plugins: return GetPlugins(); case FolderId_Settings: return GetSettings(); case FolderId_Bios: return GetBios(); case FolderId_Snapshots: return GetSnapshots(); @@ -280,7 +265,6 @@ wxDirName& AppConfig::FolderOptions::operator[]( FoldersEnum_t folderidx ) { switch( folderidx ) { - case FolderId_Plugins: return PluginsFolder; case FolderId_Settings: return SettingsFolder; case FolderId_Bios: return Bios; case FolderId_Snapshots: return Snapshots; @@ -295,7 +279,7 @@ wxDirName& AppConfig::FolderOptions::operator[]( FoldersEnum_t folderidx ) jNO_DEFAULT } - return PluginsFolder; // unreachable, but suppresses warnings. + return SettingsFolder; // unreachable, but suppresses warnings. } const wxDirName& AppConfig::FolderOptions::operator[]( FoldersEnum_t folderidx ) const @@ -307,7 +291,6 @@ bool AppConfig::FolderOptions::IsDefault( FoldersEnum_t folderidx ) const { switch( folderidx ) { - case FolderId_Plugins: return UseDefaultPluginsFolder; case FolderId_Settings: return UseDefaultSettingsFolder; case FolderId_Bios: return UseDefaultBios; case FolderId_Snapshots: return UseDefaultSnapshots; @@ -329,11 +312,6 @@ void AppConfig::FolderOptions::Set( FoldersEnum_t folderidx, const wxString& src { switch( folderidx ) { - case FolderId_Plugins: - PluginsFolder = src; - UseDefaultPluginsFolder = useDefault; - break; - case FolderId_Settings: SettingsFolder = src; UseDefaultSettingsFolder = useDefault; @@ -437,22 +415,6 @@ namespace FilenameDefs } }; -wxString AppConfig::FullpathTo( PluginsEnum_t pluginidx ) const -{ - return Path::Combine( PluginsFolder, BaseFilenames[pluginidx] ); -} - -// returns true if the filenames are quite absolutely the equivalent. Works for all -// types of filenames, relative and absolute. Very important that you use this function -// rather than any other type of more direct string comparison! -bool AppConfig::FullpathMatchTest( PluginsEnum_t pluginId, const wxString& cmpto ) const -{ - // Implementation note: wxFileName automatically normalizes things as needed in it's - // equality comparison implementations, so we can do a simple comparison as follows: - - return wxFileName(cmpto).SameAs( FullpathTo(pluginId) ); -} - static wxDirName GetResolvedFolder(FoldersEnum_t id) { return g_Conf->Folders.IsDefault(id) ? PathDefs::Get(id) : g_Conf->Folders[id]; @@ -515,7 +477,6 @@ AppConfig::AppConfig() : MainGuiPosition( wxDefaultPosition ) , SysSettingsTabName( L"Cpu" ) , McdSettingsTabName( L"none" ) - , ComponentsTabName( L"Plugins" ) , AppSettingsTabName( L"none" ) , GameDatabaseTabName( L"none" ) { @@ -585,8 +546,6 @@ void App_LoadSaveInstallSettings( IniInterface& ini ) ini.Entry( L"Install_Dir", InstallFolder, (wxDirName)(wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPath()) ); SetFullBaseDir( InstallFolder ); - //ini.Entry( L"PluginsFolder", PluginsFolder, InstallFolder + PathDefs::Base::Plugins() ); - ini.Flush(); } @@ -719,7 +678,6 @@ void AppConfig::FolderOptions::ApplyDefaults() if( UseDefaultMemoryCards ) MemoryCards = PathDefs::GetMemoryCards(); if( UseDefaultLogs ) Logs = PathDefs::GetLogs(); if( UseDefaultLangs ) Langs = PathDefs::GetLangs(); - if( UseDefaultPluginsFolder)PluginsFolder = PathDefs::GetPlugins(); if( UseDefaultCheats ) Cheats = PathDefs::GetCheats(); if( UseDefaultCheatsWS ) CheatsWS = PathDefs::GetCheatsWS(); } @@ -757,7 +715,6 @@ void AppConfig::FolderOptions::LoadSave( IniInterface& ini ) IniBitBool( UseDefaultMemoryCards ); IniBitBool( UseDefaultLogs ); IniBitBool( UseDefaultLangs ); - IniBitBool( UseDefaultPluginsFolder ); IniBitBool( UseDefaultCheats ); IniBitBool( UseDefaultCheatsWS ); @@ -773,7 +730,6 @@ void AppConfig::FolderOptions::LoadSave( IniInterface& ini ) IniEntryDirFile( Langs, rel ); IniEntryDirFile( Cheats, rel ); IniEntryDirFile( CheatsWS, rel ); - ini.Entry( L"PluginsFolder", PluginsFolder, InstallFolder + PathDefs::Base::Plugins(), rel ); IniEntryDirFile( RunIso, rel ); IniEntryDirFile( RunELF, rel ); @@ -789,12 +745,6 @@ void AppConfig::FolderOptions::LoadSave( IniInterface& ini ) } // ------------------------------------------------------------------------ -const wxFileName& AppConfig::FilenameOptions::operator[]( PluginsEnum_t pluginidx ) const -{ - IndexBoundsAssumeDev( L"Filename[Plugin]", pluginidx, PluginId_Count ); - return Plugins[pluginidx]; -} - void AppConfig::FilenameOptions::LoadSave( IniInterface& ini ) { ScopedIniGroup path( ini, L"Filenames" ); @@ -806,15 +756,6 @@ void AppConfig::FilenameOptions::LoadSave( IniInterface& ini ) //note: this will break if converting from install to portable, and custom folders are used. We can live with that. bool needRelativeName = ini.IsSaving() && IsPortable(); - for( int i=0; i conf_install; - - if (InstallationMode == InstallMode_Portable) return; - - // sApp. macro cannot be use because you need the return value of OpenInstallSettingsFile method - if( Pcsx2App* __app_ = (Pcsx2App*)wxApp::GetInstance() ) conf_install = std::unique_ptr((*__app_).OpenInstallSettingsFile()); - conf_install->SetRecordDefaults(false); - - App_SaveInstallSettings( conf_install.get() ); -} - void AppSaveSettings() { // If multiple SaveSettings messages are requested, we want to ignore most of them. @@ -1389,7 +1317,6 @@ void AppSaveSettings() SaveUiSettings(); SaveVmSettings(); - SaveRegSettings(); // save register because of PluginsFolder change isPosted = false; } diff --git a/pcsx2/gui/AppEventSources.cpp b/pcsx2/gui/AppEventSources.cpp index ae1f14278b..79908cd35b 100644 --- a/pcsx2/gui/AppEventSources.cpp +++ b/pcsx2/gui/AppEventSources.cpp @@ -19,7 +19,6 @@ #include "Utilities/EventSource.inl" template class EventSource< IEventListener_CoreThread >; -template class EventSource< IEventListener_Plugins >; template class EventSource< IEventListener_AppStatus >; AppSettingsEventInfo::AppSettingsEventInfo( IniInterface& ini, AppEventType evt_type ) @@ -54,33 +53,6 @@ void IEventListener_CoreThread::DispatchEvent( const CoreThreadStatus& status ) } } -EventListener_Plugins::EventListener_Plugins() -{ - wxGetApp().AddListener( this ); -} - -EventListener_Plugins::~EventListener_Plugins() -{ - wxGetApp().RemoveListener( this ); -} - -void IEventListener_Plugins::DispatchEvent( const PluginEventType& pevt ) -{ - switch( pevt ) - { - case CorePlugins_Loaded: CorePlugins_OnLoaded(); break; - case CorePlugins_Init: CorePlugins_OnInit(); break; - case CorePlugins_Opening: CorePlugins_OnOpening(); break; - case CorePlugins_Opened: CorePlugins_OnOpened(); break; - case CorePlugins_Closing: CorePlugins_OnClosing(); break; - case CorePlugins_Closed: CorePlugins_OnClosed(); break; - case CorePlugins_Shutdown: CorePlugins_OnShutdown(); break; - case CorePlugins_Unloaded: CorePlugins_OnUnloaded(); break; - - jNO_DEFAULT; - } -} - EventListener_AppStatus::EventListener_AppStatus() { wxGetApp().AddListener( this ); @@ -115,13 +87,6 @@ void IEventListener_AppStatus::DispatchEvent( const AppEventInfo& evtinfo ) } } - -void Pcsx2App::DispatchEvent( PluginEventType evt ) -{ - if( !AffinityAssert_AllowFrom_MainUI() ) return; - m_evtsrc_CorePluginStatus.Dispatch( evt ); -} - void Pcsx2App::DispatchEvent( AppEventType evt ) { if( !AffinityAssert_AllowFrom_MainUI() ) return; diff --git a/pcsx2/gui/AppInit.cpp b/pcsx2/gui/AppInit.cpp index f636b4092d..3475bf1877 100644 --- a/pcsx2/gui/AppInit.cpp +++ b/pcsx2/gui/AppInit.cpp @@ -57,11 +57,6 @@ void Pcsx2App::DetectCpuAndUserMode() #endif EstablishAppUserMode(); - - // force unload plugins loaded by the wizard. If we don't do this the recompilers might - // fail to allocate the memory they need to function. - ShutdownPlugins(); - UnloadPlugins(); } void Pcsx2App::OpenMainFrame() @@ -196,8 +191,6 @@ void Pcsx2App::AllocateCoreStuffs() pxIssueConfirmation(exconf, MsgButtons().OK()); } } - - LoadPluginsPassive(); } @@ -240,11 +233,6 @@ void Pcsx2App::OnInitCmdLine(wxCmdLineParser& parser) parser.AddSwitch(wxEmptyString, L"profiling", _("update options to ease profiling (debug)")); - ForPlugins([&](const PluginInfo* pi) { - parser.AddOption(wxEmptyString, pi->GetShortname().Lower(), - pxsFmt(_("specify the file to use as the %s plugin"), WX_STR(pi->GetShortname()))); - }); - parser.SetSwitchChars(L"-"); } @@ -286,33 +274,6 @@ bool Pcsx2App::ParseOverrides(wxCmdLineParser& parser) if (parser.Found(L"windowed")) Overrides.GsWindowMode = GsWinMode_Windowed; - ForPlugins([&](const PluginInfo* pi) { - if (parser.Found(pi->GetShortname().Lower(), &dest)) - { - if (wxFileExists(dest)) - Console.Warning(pi->GetShortname() + L" override: " + dest); - else - { - wxDialogWithHelpers okcan(NULL, AddAppName(_("Plugin Override Error - %s"))); - - okcan += okcan.Heading(wxsFormat( - _("%s Plugin Override Error! The following file does not exist or is not a valid %s plugin:\n\n"), - pi->GetShortname().c_str(), pi->GetShortname().c_str())); - - okcan += okcan.GetCharHeight(); - okcan += okcan.Text(dest); - okcan += okcan.GetCharHeight(); - okcan += okcan.Heading(AddAppName(_("Press OK to use the default configured plugin, or Cancel to close %s."))); - - if (wxID_CANCEL == pxIssueConfirmation(okcan, MsgButtons().OKCancel())) - parsed = false; - } - - if (parsed) - Overrides.Filenames.Plugins[pi->id] = dest; - } - }); - return parsed; } diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index 6d839b1167..2a7195ebfb 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -27,7 +27,6 @@ #include "PAD/Linux/PAD.h" #endif -#include "Plugins.h" #include "ps2/BiosTools.h" #include "Dialogs/ModalPopups.h" @@ -495,9 +494,7 @@ void Pcsx2App::LogicalVsync() renderswitch_delay >>= 1; - // Only call PADupdate here if we're using GSopen2. Legacy GSopen plugins have the - // GS window belonging to the MTGS thread. - if( (GSopen2 != NULL) && (wxGetApp().GetGsFramePtr() != NULL) ) + if( (wxGetApp().GetGsFramePtr() != NULL) ) PADupdate(0); while( const keyEvent* ev = PADkeyEvent() ) @@ -506,9 +503,7 @@ void Pcsx2App::LogicalVsync() // Give plugins first try to handle keys. If none of them handles the key, it will // be passed to the main user interface. - - if( !GetCorePlugins().KeyEvent( *ev ) ) - PadKeyDispatch( *ev ); + PadKeyDispatch( *ev ); } } @@ -725,8 +720,6 @@ void Pcsx2App::resetDebugger() dlg->reset(); } -// NOTE: Plugins are *not* applied by this function. Changes to plugins need to handled -// manually. The PluginSelectorPanel does this, for example. void AppApplySettings( const AppConfig* oldconf ) { AffinityAssert_AllowFrom_MainUI(); @@ -735,8 +728,8 @@ void AppApplySettings( const AppConfig* oldconf ) g_Conf->Folders.ApplyDefaults(); - // Ensure existence of necessary documents folders. Plugins and other parts - // of PCSX2 rely on them. + // Ensure existence of necessary documents folders. + // Other parts of PCSX2 rely on them. g_Conf->Folders.MemoryCards.Mkdir(); g_Conf->Folders.Savestates.Mkdir(); @@ -753,8 +746,6 @@ void AppApplySettings( const AppConfig* oldconf ) wxDoNotLogInThisScope please; i18n_SetLanguage( g_Conf->LanguageId, g_Conf->LanguageCode ); } - - CorePlugins.SetSettingsFolder( GetSettingsFolder().ToString() ); // Update the compression attribute on the Memcards folder. // Memcards generally compress very well via NTFS compression. @@ -874,8 +865,8 @@ void Pcsx2App::OpenGsPanel() gsFrame->SetSize( newsize ); gsFrame->SetSize( oldsize ); } - - pxAssertDev( !GetCorePlugins().IsOpen( PluginId_GS ), "GS Plugin must be closed prior to opening a new Gs Panel!" ); + + //TODO: MAKE SURE GS IS CLOSED HERE #ifdef __WXGTK__ // The x window/display are actually very deeper in the widget. You need both display and window @@ -928,13 +919,6 @@ void Pcsx2App::CloseGsPanel() { if (AppRpc_TryInvoke(&Pcsx2App::CloseGsPanel)) return; - - if (CloseViewportWithPlugins) - { - if (GSFrame* gsFrame = GetGsFramePtr()) - if (GSPanel* woot = gsFrame->GetViewport()) - woot->Destroy(); - } } void Pcsx2App::OnGsFrameClosed(wxWindowID id) @@ -1029,8 +1013,6 @@ protected: // if something unloaded plugins since this messages was queued then it's best to ignore // it, because apparently too much stuff is going on and the emulation states are wonky. - if( !CorePlugins.AreLoaded() ) return; - DbgCon.WriteLn( Color_Gray, "(SysExecute) received." ); CoreThread.ResetQuick(); diff --git a/pcsx2/gui/AppRes.cpp b/pcsx2/gui/AppRes.cpp index b5430ea45f..41bffd036d 100644 --- a/pcsx2/gui/AppRes.cpp +++ b/pcsx2/gui/AppRes.cpp @@ -33,7 +33,6 @@ #include "Resources/ConfigIcon_Speedhacks.h" #include "Resources/ConfigIcon_Gamefixes.h" #include "Resources/ConfigIcon_Paths.h" -#include "Resources/ConfigIcon_Plugins.h" #include "Resources/ConfigIcon_MemoryCard.h" #include "Resources/AppIcon16.h" @@ -147,7 +146,6 @@ wxImageList& Pcsx2App::GetImgList_Config() } FancyLoadMacro(Paths); - FancyLoadMacro(Plugins); FancyLoadMacro(Gamefixes); FancyLoadMacro(Speedhacks); FancyLoadMacro(MemoryCard); diff --git a/pcsx2/gui/ConsoleLogger.cpp b/pcsx2/gui/ConsoleLogger.cpp index 68cdc438e3..252efd5ee2 100644 --- a/pcsx2/gui/ConsoleLogger.cpp +++ b/pcsx2/gui/ConsoleLogger.cpp @@ -1265,16 +1265,13 @@ void Pcsx2App::DisableWindowLogging() const void OSDlog(ConsoleColors color, bool console, const std::string& str) { - if (GSosdLog) - GSosdLog(str.c_str(), wxGetApp().GetProgramLog()->GetRGBA(color)); + GSosdLog(str.c_str(), wxGetApp().GetProgramLog()->GetRGBA(color)); if (console) Console.WriteLn(color, str.c_str()); } void OSDmonitor(ConsoleColors color, const std::string key, const std::string value) { - if(!GSosdMonitor) return; - GSosdMonitor(wxString(key).utf8_str(), wxString(value).utf8_str(), wxGetApp().GetProgramLog()->GetRGBA(color)); } diff --git a/pcsx2/gui/ConsoleLogger.h b/pcsx2/gui/ConsoleLogger.h index 6cec648b26..b0544a0bd9 100644 --- a/pcsx2/gui/ConsoleLogger.h +++ b/pcsx2/gui/ConsoleLogger.h @@ -235,7 +235,7 @@ void OSDlog(ConsoleColors color, bool console, const std::string& str); template void OSDlog(ConsoleColors color, bool console, const std::string& format, Args ... args) { - if (!GSosdLog && !console) return; + if (!console) return; size_t size = snprintf( nullptr, 0, format.c_str(), args ... ) + 1; // Extra space for '\0' std::vector buf(size); diff --git a/pcsx2/gui/Dialogs/FirstTimeWizard.cpp b/pcsx2/gui/Dialogs/FirstTimeWizard.cpp index 3f11d899e5..4c40250ce8 100644 --- a/pcsx2/gui/Dialogs/FirstTimeWizard.cpp +++ b/pcsx2/gui/Dialogs/FirstTimeWizard.cpp @@ -15,7 +15,6 @@ #include "PrecompiledHeader.h" #include "System.h" -#include "Plugins.h" #include "MSWstuff.h" #include "ModalPopups.h" @@ -122,10 +121,8 @@ FirstTimeWizard::FirstTimeWizard( wxWindow* parent ) , m_page_bios ( *new ApplicableWizardPage( this, &m_page_plugins ) ) , m_panel_Intro ( *new FirstTimeIntroPanel( &m_page_intro )) - , m_panel_PluginSel ( *new PluginSelectorPanel( &m_page_plugins ) ) , m_panel_BiosSel ( *new BiosSelectorPanel( &m_page_bios ) ) { - // Page 2 - Plugins Panel // Page 3 - Bios Panel m_page_intro. SetSizer( new wxBoxSizer( wxVERTICAL ) ); @@ -133,7 +130,6 @@ FirstTimeWizard::FirstTimeWizard( wxWindow* parent ) m_page_bios. SetSizer( new wxBoxSizer( wxVERTICAL ) ); m_page_intro += m_panel_Intro | StdExpand(); - m_page_plugins += m_panel_PluginSel | StdExpand(); m_page_bios += m_panel_BiosSel | StdExpand(); // Temporary tutorial message for the BIOS, needs proof-reading!! @@ -232,25 +228,10 @@ void FirstTimeWizard::OnPageChanging( wxWizardEvent& evt ) } } } - else - { - // Moving Backward: - // Some specific panels need per-init actions canceled. - - if( page == 1 ) - { - m_panel_PluginSel.CancelRefresh(); - } - } } void FirstTimeWizard::OnPageChanged( wxWizardEvent& evt ) { - // Plugin Selector needs a special OnShow hack, because Wizard child panels don't - // receive any Show events >_< - if( (sptr)evt.GetPage() == (sptr)&m_page_plugins ) - m_panel_PluginSel.OnShown(); - - else if( (sptr)evt.GetPage() == (sptr)&m_page_bios ) + if( (sptr)evt.GetPage() == (sptr)&m_page_bios ) m_panel_BiosSel.OnShown(); } diff --git a/pcsx2/gui/Dialogs/GSDumpDialog.cpp b/pcsx2/gui/Dialogs/GSDumpDialog.cpp index 31c0018b63..b08cf0ac17 100644 --- a/pcsx2/gui/Dialogs/GSDumpDialog.cpp +++ b/pcsx2/gui/Dialogs/GSDumpDialog.cpp @@ -27,7 +27,6 @@ #include "PathDefs.h" #include "AppConfig.h" -#include "Plugins.h" #include "GSFrame.h" #include "Counters.h" @@ -275,7 +274,7 @@ void Dialogs::GSDumpDialog::ToVSync(wxCommandEvent& event) void Dialogs::GSDumpDialog::OpenSettings(wxCommandEvent& event) { - GetCorePlugins().Configure(PluginId_GS); + GSconfigure(); } void Dialogs::GSDumpDialog::ToStart(wxCommandEvent& event) @@ -632,17 +631,17 @@ void Dialogs::GSDumpDialog::ProcessDumpEvent(const GSData& event, char* regs) std::unique_ptr data(new char[16384]); int addr = 16384 - event.length; memcpy(data.get(), event.data.get() + addr, event.length); - GSgifTransfer1((u32*)data.get(), addr); + GSgifTransfer1((u8*)data.get(), addr); break; } case Path1New: - GSgifTransfer((u32*)event.data.get(), event.length / 16); + GSgifTransfer((u8*)event.data.get(), event.length / 16); break; case Path2: - GSgifTransfer2((u32*)event.data.get(), event.length / 16); + GSgifTransfer2((u8*)event.data.get(), event.length / 16); break; case Path3: - GSgifTransfer3((u32*)event.data.get(), event.length / 16); + GSgifTransfer3((u8*)event.data.get(), event.length / 16); break; default: break; @@ -661,7 +660,7 @@ void Dialogs::GSDumpDialog::ProcessDumpEvent(const GSData& event, char* regs) case ReadFIFO2: { std::unique_ptr arr(new char[*((int*)event.data.get())]); - GSreadFIFO2((u64*)arr.get(), *((int*)event.data.get())); + GSreadFIFO2((u8*)arr.get(), *((int*)event.data.get())); break; } case Registers: @@ -730,7 +729,7 @@ void Dialogs::GSDumpDialog::GSThread::ExecuteTaskInThread() m_dump_file->Read(state_data.get(), ss); m_dump_file->Read(®s, 8192); - freezeData fd = {(int)ss, (s8*)state_data.get()}; + GSFreezeData fd = {(int)ss, (u8*)state_data.get()}; m_root_window->m_dump_packets.clear(); while (m_dump_file->Tell() < m_dump_file->Length()) @@ -760,7 +759,7 @@ void Dialogs::GSDumpDialog::GSThread::ExecuteTaskInThread() m_root_window->m_dump_packets.push_back({id, std::move(data), size, id_transfer}); } - GetCorePlugins().Init(); + GSinit(); sApp.OpenGsPanel(); // to gather the gs frame object we have to be a bit hacky since sApp is not syntax complete @@ -773,8 +772,8 @@ void Dialogs::GSDumpDialog::GSThread::ExecuteTaskInThread() g_FrameCount = 0; } - GSsetBaseMem((void*)regs); - if (GSopen2((void*)pDsp, (renderer_override<<24)) != 0) + GSsetBaseMem((u8*)regs); + if (GSopen2((void**)pDsp, (renderer_override<<24)) != 0) { OnStop(); return; @@ -782,12 +781,12 @@ void Dialogs::GSDumpDialog::GSThread::ExecuteTaskInThread() GSsetGameCRC((int)crc, 0); - if (!GetCorePlugins().DoFreeze(PluginId_GS, 0, &fd, true)) + if (!GSfreeze(0, &fd)) GSDump::isRunning = false; GSvsync(1); GSreset(); - GSsetBaseMem((void*)regs); - GetCorePlugins().DoFreeze(PluginId_GS, 0, &fd, true); + GSsetBaseMem((u8*)regs); + GSfreeze(0, &fd); size_t i = 0; m_debug_index = 0; @@ -855,8 +854,8 @@ void Dialogs::GSDumpDialog::GSThread::ExecuteTaskInThread() { if (!window->IsShown()) { - GetCorePlugins().Close(); - GetCorePlugins().Shutdown(); + GSclose(); + GSshutdown(); sApp.CloseGsPanel(); GSDump::isRunning = false; } diff --git a/pcsx2/gui/Dialogs/SysConfigDialog.cpp b/pcsx2/gui/Dialogs/SysConfigDialog.cpp index 7f919e8346..c9b3c9aa3a 100644 --- a/pcsx2/gui/Dialogs/SysConfigDialog.cpp +++ b/pcsx2/gui/Dialogs/SysConfigDialog.cpp @@ -43,23 +43,6 @@ static void CheckHacksOverrides() pxIssueConfirmation( dialog, MsgButtons().OK(), L"Dialog.SysConfig.Overrides" ); } -static void CheckPluginsOverrides() -{ - if( !wxGetApp().Overrides.HasPluginsOverride() ) return; - - // The user has commandline overrides enabled, so the options they see here and/or apply won't match - // the commandline overrides. Let them know! - - wxDialogWithHelpers dialog( NULL, _("Components Overrides Warning") ); - - dialog += dialog.Text( pxEt( L"Warning! You are running PCSX2 with command line options that override your configured plugin and/or folder settings. These command line options will not be reflected in the settings dialog, and will be disabled when you apply settings changes here." - )); - - // [TODO] : List command line option overrides in action? - - pxIssueConfirmation( dialog, MsgButtons().OK(), L"Dialog.ComponentsConfig.Overrides" ); -} - //Behavior when unchecking 'Presets' is to keep the GUI settings at the last preset (even if not yet applied). // //Alternative possible behavior when unchecking 'Presets' (currently not implemented) is to set the GUI to @@ -243,7 +226,6 @@ Dialogs::ComponentsConfigDialog::ComponentsConfigDialog(wxWindow* parent) CreateListbook( wxGetApp().GetImgList_Config() ); const AppImageIds::ConfigIds& cfgid( wxGetApp().GetImgId().Config ); - AddPage ( pxL("Plugins"), cfgid.Plugins ); AddPage ( pxL("BIOS"), cfgid.Cpu ); AddPage ( pxL("Folders"), cfgid.Paths ); @@ -251,9 +233,6 @@ Dialogs::ComponentsConfigDialog::ComponentsConfigDialog(wxWindow* parent) AddOkCancel(); SetSizerAndFit(GetSizer()); - - if( wxGetApp().Overrides.HasPluginsOverride() ) - wxGetApp().PostMethod( CheckPluginsOverrides ); } Dialogs::InterfaceLanguageDialog::InterfaceLanguageDialog(wxWindow* parent) diff --git a/pcsx2/gui/FrameForGS.cpp b/pcsx2/gui/FrameForGS.cpp index 0dc9d9b2be..7af22ef2ec 100644 --- a/pcsx2/gui/FrameForGS.cpp +++ b/pcsx2/gui/FrameForGS.cpp @@ -328,46 +328,50 @@ void GSPanel::OnMouseEvent( wxMouseEvent& evt ) #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. - if( (GSopen2 != NULL) ) { - keyEvent event; - // FIXME how to handle double click ??? - if (evt.ButtonDown()) { - event.evt = 4; // X equivalent of ButtonPress - event.key = evt.GetButton(); - } else if (evt.ButtonUp()) { - event.evt = 5; // X equivalent of ButtonRelease - event.key = evt.GetButton(); - } else if (evt.Moving() || evt.Dragging()) { - event.evt = 6; // X equivalent of MotionNotify - long x,y; - evt.GetPosition(&x, &y); - - wxCoord w, h; - wxWindowDC dc( this ); - dc.GetSize(&w, &h); - - // Special case to allow continuous mouvement near the border - if (x < 10) - x = 0; - else if (x > (w-10)) - x = 0xFFFF; - - if (y < 10) - y = 0; - else if (y > (w-10)) - y = 0xFFFF; - - // For compatibility purpose with the existing structure. I decide to reduce - // the position to 16 bits. - event.key = ((y & 0xFFFF) << 16) | (x & 0xFFFF); - - } else { - event.key = 0; - event.evt = 0; - } - - PADWriteEvent(event); + keyEvent event; + // FIXME how to handle double click ??? + if (evt.ButtonDown()) + { + event.evt = 4; // X equivalent of ButtonPress + event.key = evt.GetButton(); } + else if (evt.ButtonUp()) + { + event.evt = 5; // X equivalent of ButtonRelease + event.key = evt.GetButton(); + } + else if (evt.Moving() || evt.Dragging()) + { + event.evt = 6; // X equivalent of MotionNotify + long x, y; + evt.GetPosition(&x, &y); + + wxCoord w, h; + wxWindowDC dc(this); + dc.GetSize(&w, &h); + + // Special case to allow continuous mouvement near the border + if (x < 10) + x = 0; + else if (x > (w - 10)) + x = 0xFFFF; + + if (y < 10) + y = 0; + else if (y > (w - 10)) + y = 0xFFFF; + + // For compatibility purpose with the existing structure. I decide to reduce + // the position to 16 bits. + event.key = ((y & 0xFFFF) << 16) | (x & 0xFFFF); + } + else + { + event.key = 0; + event.evt = 0; + } + + PADWriteEvent(event); #endif } @@ -391,18 +395,16 @@ void GSPanel::OnKeyDownOrUp( wxKeyEvent& evt ) #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. - if( (GSopen2 != NULL) ) { - keyEvent event; - event.key = evt.GetRawKeyCode(); - if (evt.GetEventType() == wxEVT_KEY_UP) - event.evt = 3; // X equivalent of KEYRELEASE; - else if (evt.GetEventType() == wxEVT_KEY_DOWN) - event.evt = 2; // X equivalent of KEYPRESS; - else - event.evt = 0; + keyEvent event; + event.key = evt.GetRawKeyCode(); + if (evt.GetEventType() == wxEVT_KEY_UP) + event.evt = 3; // X equivalent of KEYRELEASE; + else if (evt.GetEventType() == wxEVT_KEY_DOWN) + event.evt = 2; // X equivalent of KEYPRESS; + else + event.evt = 0; - PADWriteEvent(event); - } + PADWriteEvent(event); #endif #ifdef __WXMSW__ @@ -476,10 +478,8 @@ void GSPanel::OnFocus( wxFocusEvent& evt ) #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. - if((GSopen2 != NULL) ) { - keyEvent event = {0, 9}; // X equivalent of FocusIn; - PADWriteEvent(event); - } + keyEvent event = {0, 9}; // X equivalent of FocusIn; + PADWriteEvent(event); #endif //Console.Warning("GS frame > focus set"); @@ -494,10 +494,8 @@ void GSPanel::OnFocusLost( wxFocusEvent& evt ) #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. - if((GSopen2 != NULL) ) { - keyEvent event = {0, 10}; // X equivalent of FocusOut - PADWriteEvent(event); - } + keyEvent event = {0, 10}; // X equivalent of FocusOut + PADWriteEvent(event); #endif //Console.Warning("GS frame > focus lost"); @@ -690,7 +688,7 @@ void GSFrame::AppStatusEvent_OnSettingsApplied() if( g_Conf->GSWindow.CloseOnEsc ) { - if( IsShown() && !CorePlugins.IsOpen(PluginId_GS) ) + if (IsShown() /*&& TODO: CHECK IS GS IS CLOSED */) Show( false ); } } diff --git a/pcsx2/gui/GlobalCommands.cpp b/pcsx2/gui/GlobalCommands.cpp index a690a31fd0..9f3c760433 100644 --- a/pcsx2/gui/GlobalCommands.cpp +++ b/pcsx2/gui/GlobalCommands.cpp @@ -390,7 +390,7 @@ namespace Implementations void Sys_TakeSnapshot() { - if (GSmakeSnapshot(g_Conf->Folders.Snapshots.ToUTF8())) + if (GSmakeSnapshot(g_Conf->Folders.Snapshots.ToUTF8().data())) OSDlog(ConsoleColors::Color_Black, true, "Snapshot taken"); } @@ -400,10 +400,12 @@ namespace Implementations return; if (renderswitch_delay == 0) { - ScopedCoreThreadPause paused_core(new SysExecEvent_SaveSinglePlugin(PluginId_GS)); - renderswitch = !renderswitch; - paused_core.AllowResume(); - renderswitch_delay = -1; + /* TODO: reimplement this: + * ScopedCoreThreadPause paused_core(new SysExecEvent_SaveSinglePlugin(PluginId_GS)); + * renderswitch = !renderswitch; + * paused_core.AllowResume(); + * renderswitch_delay = -1; + */ } } @@ -474,33 +476,23 @@ namespace Implementations GetMainFramePtr()->Disable(); } - if (GSsetupRecording) + // GSsetupRecording can be aborted/canceled by the user. Don't go on to record the audio if that happens. + std::string filename; + if (GSsetupRecording(filename)) { - // GSsetupRecording can be aborted/canceled by the user. Don't go on to record the audio if that happens. - std::string filename; - if (GSsetupRecording(filename)) + if (g_Conf->AudioCapture.EnableAudio && !SPU2setupRecording(&filename)) { - if (g_Conf->AudioCapture.EnableAudio && !SPU2setupRecording(&filename)) - { - GSendRecording(); - g_Pcsx2Recording = false; - } - } - else // recording dialog canceled by the user. align our state + GSendRecording(); g_Pcsx2Recording = false; + } } - // the GS doesn't support recording - else if (!g_Conf->AudioCapture.EnableAudio || !SPU2setupRecording(nullptr)) + else // recording dialog canceled by the user. align our state g_Pcsx2Recording = false; - - if (GetMainFramePtr() && needsMainFrameEnable) - GetMainFramePtr()->Enable(); } else { // stop recording - if (GSendRecording) - GSendRecording(); + GSendRecording(); if (g_Conf->AudioCapture.EnableAudio) SPU2endRecording(); } diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index d598e61f79..d4ed3b86e6 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -272,7 +272,7 @@ void MainEmuFrame::ConnectMenus() // Config Bind(wxEVT_MENU, &MainEmuFrame::Menu_SysSettings_Click, this, MenuId_Config_SysSettings); Bind(wxEVT_MENU, &MainEmuFrame::Menu_McdSettings_Click, this, MenuId_Config_McdSettings); - Bind(wxEVT_MENU, &MainEmuFrame::Menu_SelectPluginsBios_Click, this, MenuId_Config_BIOS); + Bind(wxEVT_MENU, &MainEmuFrame::Menu_SelectBios_Click, this, MenuId_Config_BIOS); Bind(wxEVT_MENU, &MainEmuFrame::Menu_AudioSettings_Click, this, MenuId_Config_SPU2); Bind(wxEVT_MENU, &MainEmuFrame::Menu_NetworkSettings_Click, this, MenuId_Config_DEV9); Bind(wxEVT_MENU, &MainEmuFrame::Menu_USBSettings_Click, this, MenuId_Config_USB); @@ -280,8 +280,6 @@ void MainEmuFrame::ConnectMenus() Bind(wxEVT_MENU, &MainEmuFrame::Menu_GSSettings_Click, this, MenuId_Video_CoreSettings); Bind(wxEVT_MENU, &MainEmuFrame::Menu_WindowSettings_Click, this, MenuId_Video_WindowSettings); - for (int i = 0; i < PluginId_Count; ++i) - Bind(wxEVT_MENU, &MainEmuFrame::Menu_ConfigPlugin_Click, this, MenuId_PluginBase_Settings + i * PluginMenuId_Interval); Bind(wxEVT_MENU, &MainEmuFrame::Menu_MultitapToggle_Click, this, MenuId_Config_Multitap0Toggle); Bind(wxEVT_MENU, &MainEmuFrame::Menu_MultitapToggle_Click, this, MenuId_Config_Multitap1Toggle); @@ -344,25 +342,6 @@ void MainEmuFrame::InitLogBoxPosition(AppConfig::ConsoleLogOptions& conf) } } -void MainEmuFrame::DispatchEvent(const PluginEventType& plugin_evt) -{ - if (!pxAssertMsg(GetMenuBar() != NULL, "Mainframe menu bar is NULL!")) - return; - - //ApplyCoreStatus(); - - if (plugin_evt == CorePlugins_Unloaded) - { - for (int i = 0; i < PluginId_Count; ++i) - m_PluginMenuPacks[i].OnUnloaded(); - } - else if (plugin_evt == CorePlugins_Loaded) - { - for (int i = 0; i < PluginId_Count; ++i) - m_PluginMenuPacks[i].OnLoaded(); - } -} - void MainEmuFrame::DispatchEvent(const CoreThreadStatus& status) { if (!pxAssertMsg(GetMenuBar() != NULL, "Mainframe menu bar is NULL!")) @@ -375,16 +354,6 @@ void MainEmuFrame::AppStatusEvent_OnSettingsApplied() ApplySettings(); } -int GetPluginMenuId_Settings(PluginsEnum_t pid) -{ - return MenuId_PluginBase_Settings + ((int)pid * PluginMenuId_Interval); -} - -static int GetPluginMenuId_Name(PluginsEnum_t pid) -{ - return MenuId_PluginBase_Name + ((int)pid * PluginMenuId_Interval); -} - void MainEmuFrame::CreatePcsx2Menu() { // ------------------------------------------------------------------------ @@ -473,7 +442,7 @@ void MainEmuFrame::CreateConfigMenu() { m_menuConfig.Append(MenuId_Config_SysSettings, _("Emulation &Settings...")); m_menuConfig.Append(MenuId_Config_McdSettings, _("&Memory Cards...")); - m_menuConfig.Append(MenuId_Config_BIOS, _("&Plugin/BIOS Selector...")); + m_menuConfig.Append(MenuId_Config_BIOS, _("&BIOS Selector...")); m_menuConfig.Append(MenuId_Config_SPU2, _("&Audio Settings...")); m_menuConfig.Append(MenuId_Config_DEV9, _("&Network and HDD Settings...")); m_menuConfig.Append(MenuId_Config_USB, _("&USB Settings...")); @@ -606,9 +575,6 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) m_RestartEmuOnDelete = false; m_capturingVideo = false; - for (int i = 0; i < PluginId_Count; ++i) - m_PluginMenuPacks[i].Populate((PluginsEnum_t)i); - // ------------------------------------------------------------------------ // Initial menubar setup. This needs to be done first so that the menu bar's visible size // can be factored into the window size (which ends up being background+status+menus) @@ -900,61 +866,3 @@ void MainEmuFrame::enableRecordingMenuItem(MenuIdentifiers menuId, bool enable) item.Enable(enable); } #endif - -// ------------------------------------------------------------------------ -// "Extensible" Plugin Menus -// ------------------------------------------------------------------------ - -void PerPluginMenuInfo::Populate(PluginsEnum_t pid) -{ - if (!pxAssert(pid < PluginId_Count)) - return; - - PluginId = pid; - - MyMenu.Append(GetPluginMenuId_Name(PluginId), _("No plugins loaded."))->Enable(false); - MyMenu.AppendSeparator(); - - if (PluginId == PluginId_GS) - { - MyMenu.Append(MenuId_Video_CoreSettings, _("&Core GS Settings..."), - _("Modify hardware emulation settings regulated by the PCSX2 core virtual machine.")); - - MyMenu.Append(MenuId_Video_WindowSettings, _("&Window Settings..."), - _("Modify window and appearance options, including aspect ratio.")); - - MyMenu.AppendSeparator(); - } - - // Populate options from the plugin here. - - MyMenu.Append(GetPluginMenuId_Settings(PluginId), _("&Plugin Settings..."), - wxsFormat(_("Opens the %s plugin's advanced settings dialog."), tbl_PluginInfo[pid].GetShortname().c_str())); -} - -// deletes menu items belonging to (created by) the plugin. Leaves menu items created -// by the PCSX2 core intact. -void PerPluginMenuInfo::OnUnloaded() -{ - // Delete any menu options added by plugins (typically a plugin will have already - // done its own proper cleanup when the plugin was shutdown or unloaded, but lets - // not trust them, shall we?) - - MenuItemAddonList& curlist(m_PluginMenuItems); - for (uint mx = 0; mx < curlist.size(); ++mx) - MyMenu.Delete(curlist[mx].Item); - - curlist.clear(); - - MyMenu.SetLabel(GetPluginMenuId_Name(PluginId), _("No plugin loaded")); - MyMenu.Enable(GetPluginMenuId_Settings(PluginId), false); -} - -void PerPluginMenuInfo::OnLoaded() -{ - if (!CorePlugins.IsLoaded(PluginId)) - return; - MyMenu.SetLabel(GetPluginMenuId_Name(PluginId), - CorePlugins.GetName(PluginId) + L" " + CorePlugins.GetVersion(PluginId)); - MyMenu.Enable(GetPluginMenuId_Settings(PluginId), true); -} diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index c7a3186f05..d9f0a685b3 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -21,53 +21,6 @@ #include #include -struct PluginMenuAddition -{ - wxString Text; - wxString HelpText; - PS2E_MenuItemStyle Flags; - - wxMenuItem* Item; - int ItemId; - - // Optional user data pointer (or typecast integer value) - void* UserPtr; - - void(PS2E_CALLBACK* OnClicked)(PS2E_THISPTR* thisptr, void* userptr); -}; - -// -------------------------------------------------------------------------------------- -// PerPluginMenuInfo -// -------------------------------------------------------------------------------------- -class PerPluginMenuInfo -{ -protected: - typedef std::vector MenuItemAddonList; - - // A list of menu items belonging to this plugin's menu. - MenuItemAddonList m_PluginMenuItems; - -public: - wxMenu& MyMenu; - PluginsEnum_t PluginId; - -public: - PerPluginMenuInfo() - : MyMenu(*new wxMenu()) - , PluginId(PluginId_Count) - { - } - - virtual ~PerPluginMenuInfo() = default; - - void Populate(PluginsEnum_t pid); - void OnUnloaded(); - void OnLoaded(); - - operator wxMenu*() { return &MyMenu; } - operator const wxMenu*() const { return &MyMenu; } -}; - // -------------------------------------------------------------------------------------- // InvokeMenuCommand_OnSysStateUnlocked // -------------------------------------------------------------------------------------- @@ -96,7 +49,6 @@ public: // MainEmuFrame // -------------------------------------------------------------------------------------- class MainEmuFrame : public wxFrame, - public EventListener_Plugins, public EventListener_CoreThread, public EventListener_AppStatus { @@ -137,11 +89,8 @@ protected: wxMenuItem& m_MenuItem_Console_Stdio; #endif - PerPluginMenuInfo m_PluginMenuPacks[PluginId_Count]; - bool m_capturingVideo; - virtual void DispatchEvent(const PluginEventType& plugin_evt); virtual void DispatchEvent(const CoreThreadStatus& status); virtual void AppStatusEvent_OnSettingsApplied(); @@ -157,7 +106,6 @@ public: void EnableMenuItem(int id, bool enable); void CheckMenuItem(int id, bool checked); void SetMenuItemLabel(int id, wxString str); - void EnableCdvdPluginSubmenu(bool isEnable = true); void CreateCdvdMenu(); void CreatePcsx2Menu(); @@ -207,7 +155,7 @@ protected: void Menu_McdSettings_Click(wxCommandEvent& event); void Menu_WindowSettings_Click(wxCommandEvent& event); void Menu_GSSettings_Click(wxCommandEvent& event); - void Menu_SelectPluginsBios_Click(wxCommandEvent& event); + void Menu_SelectBios_Click(wxCommandEvent& event); void Menu_ResetAllSettings_Click(wxCommandEvent& event); void Menu_IsoBrowse_Click(wxCommandEvent& event); @@ -237,8 +185,6 @@ protected: void Menu_SuspendResume_Click(wxCommandEvent& event); void Menu_SysShutdown_Click(wxCommandEvent& event); - void Menu_ConfigPlugin_Click(wxCommandEvent& event); - void Menu_MultitapToggle_Click(wxCommandEvent& event); void Menu_Debug_Open_Click(wxCommandEvent& event); @@ -290,5 +236,3 @@ protected: friend class Pcsx2App; }; - -extern int GetPluginMenuId_Settings(PluginsEnum_t pid); diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 286c788b60..4e9c3d0163 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -102,7 +102,7 @@ void MainEmuFrame::Menu_GSSettings_Click(wxCommandEvent& event) AppOpenDialog(this)->GetEventHandler()->ProcessEvent(evt); } -void MainEmuFrame::Menu_SelectPluginsBios_Click(wxCommandEvent& event) +void MainEmuFrame::Menu_SelectBios_Click(wxCommandEvent& event) { AppOpenDialog(this); } @@ -844,30 +844,6 @@ void MainEmuFrame::Menu_SysShutdown_Click(wxCommandEvent& event) } } -void MainEmuFrame::Menu_ConfigPlugin_Click(wxCommandEvent& event) -{ - if (GSDump::isRunning) - { - wxMessageBox("Please open the settings window from the main GS Debugger window", _("GS Debugger"), wxICON_ERROR); - return; - } - const int eventId = event.GetId() - MenuId_PluginBase_Settings; - - PluginsEnum_t pid = (PluginsEnum_t)(eventId / PluginMenuId_Interval); - - // Don't try to call the Patches config dialog until we write one. - if (event.GetId() == MenuId_Config_Patches) - return; - - if (!pxAssertDev((eventId >= 0) || (pid < PluginId_Count), "Invalid plugin identifier passed to ConfigPlugin event handler.")) - return; - - wxWindowDisabler disabler; - ScopedCoreThreadPause paused_core(new SysExecEvent_SaveSinglePlugin(pid)); - - GetCorePlugins().Configure(pid); -} - void MainEmuFrame::Menu_Debug_Open_Click(wxCommandEvent& event) { DisassemblyDialog* dlg = wxGetApp().GetDisassemblyPtr(); @@ -969,45 +945,32 @@ void MainEmuFrame::VideoCaptureToggle() Disable(); } - if (GSsetupRecording) + // GSsetupRecording can be aborted/canceled by the user. Don't go on to record the audio if that happens + std::string filename; + if (GSsetupRecording(filename)) { - // GSsetupRecording can be aborted/canceled by the user. Don't go on to record the audio if that happens - std::string filename; - if (GSsetupRecording(filename)) + if (!g_Conf->AudioCapture.EnableAudio || SPU2setupRecording(&filename)) { - if (!g_Conf->AudioCapture.EnableAudio || SPU2setupRecording(&filename)) - { - m_submenuVideoCapture.Enable(MenuId_Capture_Video_Record, false); - m_submenuVideoCapture.Enable(MenuId_Capture_Video_Stop, true); - m_submenuVideoCapture.Enable(MenuId_Capture_Video_IncludeAudio, false); - } - else - { - GSendRecording(); - m_capturingVideo = false; - } + m_submenuVideoCapture.Enable(MenuId_Capture_Video_Record, false); + m_submenuVideoCapture.Enable(MenuId_Capture_Video_Stop, true); + m_submenuVideoCapture.Enable(MenuId_Capture_Video_IncludeAudio, false); } - else // recording dialog canceled by the user. align our state + else + { + GSendRecording(); m_capturingVideo = false; + } } - // the GS doesn't support recording - else if (g_Conf->AudioCapture.EnableAudio && SPU2setupRecording(nullptr)) - { - m_submenuVideoCapture.Enable(MenuId_Capture_Video_Record, false); - m_submenuVideoCapture.Enable(MenuId_Capture_Video_Stop, true); - m_submenuVideoCapture.Enable(MenuId_Capture_Video_IncludeAudio, false); - } - else + else // recording dialog canceled by the user. align our state m_capturingVideo = false; - + if (needsMainFrameEnable) Enable(); } else { // stop recording - if (GSendRecording) - GSendRecording(); + GSendRecording(); if (g_Conf->AudioCapture.EnableAudio) SPU2endRecording(); m_submenuVideoCapture.Enable(MenuId_Capture_Video_Record, true); @@ -1022,7 +985,7 @@ void MainEmuFrame::Menu_Capture_Screenshot_Screenshot_Click(wxCommandEvent& even { return; } - GSmakeSnapshot(g_Conf->Folders.Snapshots.ToAscii()); + GSmakeSnapshot(g_Conf->Folders.Snapshots.ToString().char_str()); } void MainEmuFrame::Menu_Capture_Screenshot_Screenshot_As_Click(wxCommandEvent& event) @@ -1038,7 +1001,7 @@ void MainEmuFrame::Menu_Capture_Screenshot_Screenshot_As_Click(wxCommandEvent& e wxFileDialog fileDialog(this, _("Select a file"), g_Conf->Folders.Snapshots.ToAscii(), wxEmptyString, "PNG files (*.png)|*.png", wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (fileDialog.ShowModal() == wxID_OK) - GSmakeSnapshot(fileDialog.GetPath().c_str()); + GSmakeSnapshot((char*)fileDialog.GetPath().char_str()); // Resume emulation if (!wasPaused) diff --git a/pcsx2/gui/MemoryCardFile.cpp b/pcsx2/gui/MemoryCardFile.cpp index de198b82be..05d6a7fe0e 100644 --- a/pcsx2/gui/MemoryCardFile.cpp +++ b/pcsx2/gui/MemoryCardFile.cpp @@ -599,7 +599,7 @@ uint FileMcd_ConvertToSlot(uint port, uint slot) return slot + 4; // multitap 2 } -static void FileMcd_EmuOpen() +void FileMcd_EmuOpen() { // detect inserted memory card types for (uint slot = 0; slot < 8; ++slot) @@ -627,13 +627,13 @@ static void FileMcd_EmuOpen() Component_FileMcd->implFolder.Open(); } -static void FileMcd_EmuClose() +void FileMcd_EmuClose() { Component_FileMcd->implFolder.Close(); Component_FileMcd->impl.Close(); } -static s32 FileMcd_IsPresent(uint port, uint slot) +s32 FileMcd_IsPresent(uint port, uint slot) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); switch (g_Conf->Mcd[combinedSlot].Type) @@ -647,7 +647,7 @@ static s32 FileMcd_IsPresent(uint port, uint slot) } } -static void FileMcd_GetSizeInfo(uint port, uint slot, McdSizeInfo* outways) +void FileMcd_GetSizeInfo(uint port, uint slot, McdSizeInfo* outways) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); switch (g_Conf->Mcd[combinedSlot].Type) @@ -663,7 +663,7 @@ static void FileMcd_GetSizeInfo(uint port, uint slot, McdSizeInfo* outways) } } -static bool FileMcd_IsPSX(uint port, uint slot) +bool FileMcd_IsPSX(uint port, uint slot) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); switch (g_Conf->Mcd[combinedSlot].Type) @@ -677,7 +677,7 @@ static bool FileMcd_IsPSX(uint port, uint slot) } } -static s32 FileMcd_Read(uint port, uint slot, u8* dest, u32 adr, int size) +s32 FileMcd_Read(uint port, uint slot, u8* dest, u32 adr, int size) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); switch (g_Conf->Mcd[combinedSlot].Type) @@ -691,7 +691,7 @@ static s32 FileMcd_Read(uint port, uint slot, u8* dest, u32 adr, int size) } } -static s32 FileMcd_Save(uint port, uint slot, const u8* src, u32 adr, int size) +s32 FileMcd_Save(uint port, uint slot, const u8* src, u32 adr, int size) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); switch (g_Conf->Mcd[combinedSlot].Type) @@ -705,7 +705,7 @@ static s32 FileMcd_Save(uint port, uint slot, const u8* src, u32 adr, int size) } } -static s32 FileMcd_EraseBlock(uint port, uint slot, u32 adr) +s32 FileMcd_EraseBlock(uint port, uint slot, u32 adr) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); switch (g_Conf->Mcd[combinedSlot].Type) @@ -719,7 +719,7 @@ static s32 FileMcd_EraseBlock(uint port, uint slot, u32 adr) } } -static u64 FileMcd_GetCRC(uint port, uint slot) +u64 FileMcd_GetCRC(uint port, uint slot) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); switch (g_Conf->Mcd[combinedSlot].Type) @@ -733,7 +733,7 @@ static u64 FileMcd_GetCRC(uint port, uint slot) } } -static void FileMcd_NextFrame(uint port, uint slot) +void FileMcd_NextFrame(uint port, uint slot) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); switch (g_Conf->Mcd[combinedSlot].Type) @@ -749,7 +749,7 @@ static void FileMcd_NextFrame(uint port, uint slot) } } -static bool FileMcd_ReIndex(uint port, uint slot, const wxString& filter) +bool FileMcd_ReIndex(uint port, uint slot, const wxString& filter) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); switch (g_Conf->Mcd[combinedSlot].Type) diff --git a/pcsx2/gui/MemoryCardFolder.h b/pcsx2/gui/MemoryCardFolder.h index 73867305ee..9b33660572 100644 --- a/pcsx2/gui/MemoryCardFolder.h +++ b/pcsx2/gui/MemoryCardFolder.h @@ -21,7 +21,6 @@ #include #include -#include "PluginCallbacks.h" #include "AppConfig.h" //#define DEBUG_WRITE_FOLDER_CARD_IN_MEMORY_TO_FILE_ON_CHANGE @@ -390,7 +389,7 @@ public: bool ReIndex(bool enableFiltering, const wxString& filter); s32 IsPresent() const; - void GetSizeInfo(PS2E_McdSizeInfo& outways) const; + void GetSizeInfo(McdSizeInfo& outways) const; bool IsPSX() const; s32 Read(u8* dest, u32 adr, int size); s32 Save(const u8* src, u32 adr, int size); @@ -619,7 +618,7 @@ public: void SetFiltering(const bool enableFiltering); s32 IsPresent(uint slot); - void GetSizeInfo(uint slot, PS2E_McdSizeInfo& outways); + void GetSizeInfo(uint slot, McdSizeInfo& outways); bool IsPSX(uint slot); s32 Read(uint slot, u8* dest, u32 adr, int size); s32 Save(uint slot, const u8* src, u32 adr, int size); diff --git a/pcsx2/gui/Resources/ConfigIcon_Plugins.png b/pcsx2/gui/Resources/ConfigIcon_Plugins.png deleted file mode 100644 index 7c3af3b16b..0000000000 Binary files a/pcsx2/gui/Resources/ConfigIcon_Plugins.png and /dev/null differ