Misc: Various cleanup

Move files from Frontend directory to pcsx2 and/or subdirectories.
Get rid of double GS init.
Combine HostSettings and Host.
Combine Frontend/Achievements.h and Achievements.h.
This commit is contained in:
Stenzek 2023-05-13 14:30:41 +10:00 committed by refractionpcsx2
parent 6fb4c724bd
commit 80675399aa
92 changed files with 1184 additions and 1296 deletions

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -20,7 +20,7 @@
#include "QtHost.h" #include "QtHost.h"
#include "QtUtils.h" #include "QtUtils.h"
#include "pcsx2/HostSettings.h" #include "pcsx2/Host.h"
#include "pcsx2/SysForwardDefs.h" #include "pcsx2/SysForwardDefs.h"
#include "svnrev.h" #include "svnrev.h"

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,12 +15,12 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "common/Assertions.h"
#include "pcsx2/Frontend/GameList.h"
#include "CoverDownloadDialog.h" #include "CoverDownloadDialog.h"
#include "pcsx2/GameList.h"
#include "common/Assertions.h"
CoverDownloadDialog::CoverDownloadDialog(QWidget* parent /*= nullptr*/) CoverDownloadDialog::CoverDownloadDialog(QWidget* parent /*= nullptr*/)
: QDialog(parent) : QDialog(parent)
{ {

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,16 +15,15 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "common/Assertions.h"
#include "pcsx2/Frontend/ImGuiManager.h"
#include "DisplayWidget.h" #include "DisplayWidget.h"
#include "MainWindow.h" #include "MainWindow.h"
#include "QtHost.h" #include "QtHost.h"
#include "QtUtils.h" #include "QtUtils.h"
#include "pcsx2/GS/GSIntrin.h" // _BitScanForward #include "pcsx2/GS/GSIntrin.h" // _BitScanForward
#include "pcsx2/ImGui/ImGuiManager.h"
#include "common/Assertions.h"
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtGui/QGuiApplication> #include <QtGui/QGuiApplication>

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,8 +14,11 @@
*/ */
#pragma once #pragma once
#include "pcsx2/Frontend/GameList.h"
#include "pcsx2/GameList.h"
#include "common/LRUCache.h" #include "common/LRUCache.h"
#include <QtCore/QAbstractTableModel> #include <QtCore/QAbstractTableModel>
#include <QtGui/QPixmap> #include <QtGui/QPixmap>
#include <algorithm> #include <algorithm>

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,11 +15,12 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "GameListRefreshThread.h"
#include "pcsx2/GameList.h"
#include "common/ProgressCallback.h" #include "common/ProgressCallback.h"
#include "common/Timer.h" #include "common/Timer.h"
#include "pcsx2/Frontend/GameList.h"
#include "GameListRefreshThread.h"
#include <QtWidgets/QMessageBox> #include <QtWidgets/QMessageBox>
@ -64,7 +65,9 @@ void AsyncRefreshProgressCallback::SetProgressValue(u32 value)
fireUpdate(); fireUpdate();
} }
void AsyncRefreshProgressCallback::SetTitle(const char* title) {} void AsyncRefreshProgressCallback::SetTitle(const char* title)
{
}
void AsyncRefreshProgressCallback::DisplayError(const char* message) void AsyncRefreshProgressCallback::DisplayError(const char* message)
{ {

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,11 +15,19 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "GameListModel.h"
#include "GameListRefreshThread.h"
#include "GameListWidget.h"
#include "QtHost.h"
#include "QtUtils.h"
#include "pcsx2/GameList.h"
#include "pcsx2/Host.h"
#include "common/Assertions.h" #include "common/Assertions.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "pcsx2/Frontend/GameList.h" #include "fmt/format.h"
#include "pcsx2/HostSettings.h"
#include <QtCore/QSortFilterProxyModel> #include <QtCore/QSortFilterProxyModel>
#include <QtGui/QPixmap> #include <QtGui/QPixmap>
@ -29,14 +37,6 @@
#include <QtWidgets/QMenu> #include <QtWidgets/QMenu>
#include <QtWidgets/QScrollBar> #include <QtWidgets/QScrollBar>
#include "GameListModel.h"
#include "GameListRefreshThread.h"
#include "GameListWidget.h"
#include "QtHost.h"
#include "QtUtils.h"
#include "fmt/format.h"
static const char* SUPPORTED_FORMATS_STRING = QT_TRANSLATE_NOOP(GameListWidget, static const char* SUPPORTED_FORMATS_STRING = QT_TRANSLATE_NOOP(GameListWidget,
".bin/.iso (ISO Disc Images)\n" ".bin/.iso (ISO Disc Images)\n"
".mdf (Media Descriptor File)\n" ".mdf (Media Descriptor File)\n"

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,9 +14,12 @@
*/ */
#pragma once #pragma once
#include "pcsx2/Frontend/GameList.h"
#include "ui_EmptyGameListWidget.h" #include "ui_EmptyGameListWidget.h"
#include "ui_GameListWidget.h" #include "ui_GameListWidget.h"
#include "pcsx2/GameList.h"
#include <QtWidgets/QListView> #include <QtWidgets/QListView>
#include <QtWidgets/QTableView> #include <QtWidgets/QTableView>

View File

@ -15,31 +15,6 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include <QtCore/QDateTime>
#include <QtGui/QCloseEvent>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QInputDialog>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QProgressBar>
#include <QtWidgets/QStyle>
#include <QtWidgets/QStyleFactory>
#include "common/Assertions.h"
#include "common/CocoaTools.h"
#include "common/FileSystem.h"
#include "pcsx2/CDVD/CDVDcommon.h"
#include "pcsx2/CDVD/CDVDdiscReader.h"
#include "pcsx2/Frontend/GameList.h"
#include "pcsx2/Frontend/LogSink.h"
#include "pcsx2/GS.h"
#include "pcsx2/GS/GS.h"
#include "pcsx2/GSDumpReplayer.h"
#include "pcsx2/HostSettings.h"
#include "pcsx2/PerformanceMetrics.h"
#include "pcsx2/Recording/InputRecording.h"
#include "pcsx2/Recording/InputRecordingControls.h"
#include "AboutDialog.h" #include "AboutDialog.h"
#include "AutoUpdaterDialog.h" #include "AutoUpdaterDialog.h"
#include "CoverDownloadDialog.h" #include "CoverDownloadDialog.h"
@ -49,23 +24,45 @@
#include "MainWindow.h" #include "MainWindow.h"
#include "QtHost.h" #include "QtHost.h"
#include "QtUtils.h" #include "QtUtils.h"
#include "SettingWidgetBinder.h"
#include "Settings/ControllerSettingsDialog.h" #include "Settings/ControllerSettingsDialog.h"
#include "Settings/GameListSettingsWidget.h" #include "Settings/GameListSettingsWidget.h"
#include "Settings/InterfaceSettingsWidget.h" #include "Settings/InterfaceSettingsWidget.h"
#include "SettingWidgetBinder.h"
#include "svnrev.h"
#include "Tools/InputRecording/InputRecordingViewer.h" #include "Tools/InputRecording/InputRecordingViewer.h"
#include "Tools/InputRecording/NewInputRecordingDlg.h" #include "Tools/InputRecording/NewInputRecordingDlg.h"
#include "svnrev.h"
#include "pcsx2/Achievements.h"
#include "pcsx2/CDVD/CDVDcommon.h"
#include "pcsx2/CDVD/CDVDdiscReader.h"
#include "pcsx2/GS.h"
#include "pcsx2/GS/GS.h"
#include "pcsx2/GSDumpReplayer.h"
#include "pcsx2/GameList.h"
#include "pcsx2/Host.h"
#include "pcsx2/LogSink.h"
#include "pcsx2/PerformanceMetrics.h"
#include "pcsx2/Recording/InputRecording.h"
#include "pcsx2/Recording/InputRecordingControls.h"
#include "common/Assertions.h"
#include "common/CocoaTools.h"
#include "common/FileSystem.h"
#include <QtCore/QDateTime>
#include <QtGui/QCloseEvent>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QInputDialog>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QProgressBar>
#include <QtWidgets/QStyle>
#include <QtWidgets/QStyleFactory>
#ifdef _WIN32 #ifdef _WIN32
#include "common/RedtapeWindows.h" #include "common/RedtapeWindows.h"
#include <Dbt.h> #include <Dbt.h>
#endif #endif
#ifdef ENABLE_RAINTEGRATION
#include "pcsx2/Frontend/Achievements.h"
#endif
const char* MainWindow::OPEN_FILE_FILTER = const char* MainWindow::OPEN_FILE_FILTER =
QT_TRANSLATE_NOOP("MainWindow", "All File Types (*.bin *.iso *.cue *.mdf *.chd *.cso *.gz *.elf *.irx *.gs *.gs.xz *.gs.zst *.dump);;" QT_TRANSLATE_NOOP("MainWindow", "All File Types (*.bin *.iso *.cue *.mdf *.chd *.cso *.gz *.elf *.irx *.gs *.gs.xz *.gs.zst *.dump);;"
"Single-Track Raw Images (*.bin *.iso);;" "Single-Track Raw Images (*.bin *.iso);;"

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,8 +15,33 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include <cmath> #include "AutoUpdaterDialog.h"
#include <csignal> #include "DisplayWidget.h"
#include "GameList/GameListWidget.h"
#include "MainWindow.h"
#include "QtHost.h"
#include "QtUtils.h"
#include "svnrev.h"
#include "pcsx2/CDVD/CDVDcommon.h"
#include "pcsx2/CommonHost.h"
#include "pcsx2/Achievements.h"
#include "pcsx2/CDVD/CDVD.h"
#include "pcsx2/Counters.h"
#include "pcsx2/DebugTools/Debug.h"
#include "pcsx2/GS.h"
#include "pcsx2/GS/GS.h"
#include "pcsx2/GSDumpReplayer.h"
#include "pcsx2/GameList.h"
#include "pcsx2/Host.h"
#include "pcsx2/INISettingsInterface.h"
#include "pcsx2/ImGui/FullscreenUI.h"
#include "pcsx2/ImGui/ImGuiManager.h"
#include "pcsx2/Input/InputManager.h"
#include "pcsx2/LogSink.h"
#include "pcsx2/PAD/Host/PAD.h"
#include "pcsx2/PerformanceMetrics.h"
#include "pcsx2/VMManager.h"
#include "common/Assertions.h" #include "common/Assertions.h"
#include "common/Console.h" #include "common/Console.h"
@ -28,25 +53,6 @@
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "common/Timer.h" #include "common/Timer.h"
#include "pcsx2/CDVD/CDVD.h"
#include "pcsx2/CDVD/CDVDcommon.h"
#include "pcsx2/Counters.h"
#include "pcsx2/DebugTools/Debug.h"
#include "pcsx2/Frontend/CommonHost.h"
#include "pcsx2/Frontend/FullscreenUI.h"
#include "pcsx2/Frontend/GameList.h"
#include "pcsx2/Frontend/InputManager.h"
#include "pcsx2/Frontend/ImGuiManager.h"
#include "pcsx2/Frontend/LogSink.h"
#include "pcsx2/GS.h"
#include "pcsx2/GS/GS.h"
#include "pcsx2/GSDumpReplayer.h"
#include "pcsx2/HostSettings.h"
#include "pcsx2/INISettingsInterface.h"
#include "pcsx2/PAD/Host/PAD.h"
#include "pcsx2/PerformanceMetrics.h"
#include "pcsx2/VMManager.h"
#include <QtCore/QTimer> #include <QtCore/QTimer>
#include <QtWidgets/QApplication> #include <QtWidgets/QApplication>
#include <QtWidgets/QMessageBox> #include <QtWidgets/QMessageBox>
@ -55,17 +61,8 @@
#include "fmt/core.h" #include "fmt/core.h"
#include "AutoUpdaterDialog.h" #include <cmath>
#include "DisplayWidget.h" #include <csignal>
#include "GameList/GameListWidget.h"
#include "MainWindow.h"
#include "QtHost.h"
#include "QtUtils.h"
#include "svnrev.h"
#ifdef ENABLE_ACHIEVEMENTS
#include "Frontend/Achievements.h"
#endif
static constexpr u32 SETTINGS_SAVE_DELAY = 1000; static constexpr u32 SETTINGS_SAVE_DELAY = 1000;

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -21,8 +21,7 @@
#include <optional> #include <optional>
#include "pcsx2/Host.h" #include "pcsx2/Host.h"
#include "pcsx2/HostSettings.h" #include "pcsx2/Input/InputManager.h"
#include "pcsx2/Frontend/InputManager.h"
#include "pcsx2/VMManager.h" #include "pcsx2/VMManager.h"
#include <QtCore/QList> #include <QtCore/QList>

View File

@ -17,7 +17,7 @@
#include "QtUtils.h" #include "QtUtils.h"
#include "pcsx2/Frontend/InputManager.h" #include "pcsx2/Input/InputManager.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"

View File

@ -35,7 +35,7 @@
#include "common/Path.h" #include "common/Path.h"
#include "pcsx2/Config.h" #include "pcsx2/Config.h"
#include "pcsx2/HostSettings.h" #include "pcsx2/Host.h"
#include "QtHost.h" #include "QtHost.h"
#include "QtUtils.h" #include "QtUtils.h"

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,9 +14,12 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "AchievementLoginDialog.h" #include "AchievementLoginDialog.h"
#include "pcsx2/Frontend/Achievements.h"
#include "QtHost.h" #include "QtHost.h"
#include "pcsx2/Achievements.h"
#include <QtWidgets/QMessageBox> #include <QtWidgets/QMessageBox>
AchievementLoginDialog::AchievementLoginDialog(QWidget* parent) AchievementLoginDialog::AchievementLoginDialog(QWidget* parent)

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -22,8 +22,8 @@
#include "SettingWidgetBinder.h" #include "SettingWidgetBinder.h"
#include "QtUtils.h" #include "QtUtils.h"
#include "pcsx2/Frontend/Achievements.h" #include "pcsx2/Achievements.h"
#include "pcsx2/HostSettings.h" #include "pcsx2/Host.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"

View File

@ -19,7 +19,7 @@
#include <QtWidgets/QFileDialog> #include <QtWidgets/QFileDialog>
#include <algorithm> #include <algorithm>
#include "pcsx2/HostSettings.h" #include "pcsx2/Host.h"
#include "pcsx2/ps2/BiosTools.h" #include "pcsx2/ps2/BiosTools.h"
#include "BIOSSettingsWidget.h" #include "BIOSSettingsWidget.h"

View File

@ -25,7 +25,7 @@
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "pcsx2/HostSettings.h" #include "pcsx2/Host.h"
#include "pcsx2/PAD/Host/PAD.h" #include "pcsx2/PAD/Host/PAD.h"
#include "Settings/ControllerBindingWidgets.h" #include "Settings/ControllerBindingWidgets.h"

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,15 +15,16 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Frontend/InputManager.h"
#include "Settings/ControllerGlobalSettingsWidget.h" #include "Settings/ControllerGlobalSettingsWidget.h"
#include "Settings/ControllerSettingsDialog.h" #include "Settings/ControllerSettingsDialog.h"
#include "Settings/ControllerSettingWidgetBinder.h" #include "Settings/ControllerSettingWidgetBinder.h"
#include "QtUtils.h" #include "QtUtils.h"
#include "SettingWidgetBinder.h" #include "SettingWidgetBinder.h"
#include "pcsx2/Input/InputManager.h"
#ifdef SDL_BUILD #ifdef SDL_BUILD
#include "pcsx2/Frontend/SDLInputSource.h" #include "pcsx2/Input/SDLInputSource.h"
#endif #endif
ControllerGlobalSettingsWidget::ControllerGlobalSettingsWidget(QWidget* parent, ControllerSettingsDialog* dialog) ControllerGlobalSettingsWidget::ControllerGlobalSettingsWidget(QWidget* parent, ControllerSettingsDialog* dialog)

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,6 +15,11 @@
#pragma once #pragma once
#include "pcsx2/Host.h"
#include "QtHost.h"
#include "SettingWidgetBinder.h"
#include <optional> #include <optional>
#include <type_traits> #include <type_traits>
@ -27,11 +32,6 @@
#include <QtWidgets/QSlider> #include <QtWidgets/QSlider>
#include <QtWidgets/QSpinBox> #include <QtWidgets/QSpinBox>
#include "pcsx2/HostSettings.h"
#include "QtHost.h"
#include "SettingWidgetBinder.h"
/// This nastyness is required because input profiles aren't overlaid settings like the rest of them, it's /// This nastyness is required because input profiles aren't overlaid settings like the rest of them, it's
/// input profile *or* global, not both. /// input profile *or* global, not both.
namespace ControllerSettingWidgetBinder namespace ControllerSettingWidgetBinder

View File

@ -21,7 +21,7 @@
#include "Settings/ControllerBindingWidgets.h" #include "Settings/ControllerBindingWidgets.h"
#include "Settings/HotkeySettingsWidget.h" #include "Settings/HotkeySettingsWidget.h"
#include "pcsx2/Frontend/CommonHost.h" #include "pcsx2/CommonHost.h"
#include "pcsx2/INISettingsInterface.h" #include "pcsx2/INISettingsInterface.h"
#include "pcsx2/PAD/Host/PAD.h" #include "pcsx2/PAD/Host/PAD.h"
#include "pcsx2/Sio.h" #include "pcsx2/Sio.h"

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,8 +15,10 @@
#pragma once #pragma once
#include "ui_ControllerSettingsDialog.h" #include "ui_ControllerSettingsDialog.h"
#include "pcsx2/Frontend/InputManager.h"
#include "pcsx2/Input/InputManager.h"
#include "pcsx2/USB/USB.h" #include "pcsx2/USB/USB.h"
#include <QtCore/QList> #include <QtCore/QList>
#include <QtCore/QPair> #include <QtCore/QPair>
#include <QtCore/QString> #include <QtCore/QString>

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -23,7 +23,7 @@
#include "common/Path.h" #include "common/Path.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "pcsx2/HostSettings.h" #include "pcsx2/Host.h"
#include "pcsx2/INISettingsInterface.h" #include "pcsx2/INISettingsInterface.h"
#include "DEV9SettingsWidget.h" #include "DEV9SettingsWidget.h"

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -19,9 +19,10 @@
#include "QtUtils.h" #include "QtUtils.h"
#include "SettingWidgetBinder.h" #include "SettingWidgetBinder.h"
#include "SettingsDialog.h" #include "SettingsDialog.h"
#include <QtWidgets/QMessageBox>
#include "pcsx2/HostSettings.h" #include "pcsx2/Host.h"
#include <QtWidgets/QMessageBox>
DebugSettingsWidget::DebugSettingsWidget(SettingsDialog* dialog, QWidget* parent) DebugSettingsWidget::DebugSettingsWidget(SettingsDialog* dialog, QWidget* parent)
: QWidget(parent) : QWidget(parent)

View File

@ -19,7 +19,7 @@
#include <QtWidgets/QMessageBox> #include <QtWidgets/QMessageBox>
#include <limits> #include <limits>
#include "pcsx2/HostSettings.h" #include "pcsx2/Host.h"
#include "EmulationSettingsWidget.h" #include "EmulationSettingsWidget.h"
#include "QtUtils.h" #include "QtUtils.h"

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,22 +15,22 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "common/StringUtil.h"
#include "Frontend/GameList.h"
#include "PAD/Host/PAD.h"
#include "GameSummaryWidget.h" #include "GameSummaryWidget.h"
#include "SettingsDialog.h" #include "SettingsDialog.h"
#include "MainWindow.h" #include "MainWindow.h"
#include "QtHost.h" #include "QtHost.h"
#include "QtUtils.h" #include "QtUtils.h"
#include <QtCore/QDir> #include "pcsx2/GameList.h"
#include <QtWidgets/QFileDialog> #include "pcsx2/PAD/Host/PAD.h"
#include "common/StringUtil.h"
#include "fmt/format.h" #include "fmt/format.h"
#include <QtCore/QDir>
#include <QtWidgets/QFileDialog>
GameSummaryWidget::GameSummaryWidget(const GameList::Entry* entry, SettingsDialog* dialog, QWidget* parent) GameSummaryWidget::GameSummaryWidget(const GameList::Entry* entry, SettingsDialog* dialog, QWidget* parent)
: m_dialog(dialog) : m_dialog(dialog)
{ {

View File

@ -21,7 +21,7 @@
#include "SettingsDialog.h" #include "SettingsDialog.h"
#include <QtWidgets/QMessageBox> #include <QtWidgets/QMessageBox>
#include "pcsx2/HostSettings.h" #include "pcsx2/Host.h"
#include "pcsx2/GS/GS.h" #include "pcsx2/GS/GS.h"
#include "pcsx2/GS/GSCapture.h" #include "pcsx2/GS/GSCapture.h"
#include "pcsx2/GS/GSUtil.h" #include "pcsx2/GS/GSUtil.h"

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,12 +15,14 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Frontend/InputManager.h"
#include "Settings/HotkeySettingsWidget.h" #include "Settings/HotkeySettingsWidget.h"
#include "Settings/ControllerSettingsDialog.h" #include "Settings/ControllerSettingsDialog.h"
#include "InputBindingWidget.h" #include "InputBindingWidget.h"
#include "QtUtils.h" #include "QtUtils.h"
#include "SettingWidgetBinder.h" #include "SettingWidgetBinder.h"
#include "pcsx2/Input/InputManager.h"
#include <QtWidgets/QGridLayout> #include <QtWidgets/QGridLayout>
#include <QtWidgets/QLabel> #include <QtWidgets/QLabel>
#include <QtWidgets/QMessageBox> #include <QtWidgets/QMessageBox>

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,9 +14,12 @@
*/ */
#pragma once #pragma once
#include "ui_InputBindingDialog.h" #include "ui_InputBindingDialog.h"
#include "pcsx2/Config.h" #include "pcsx2/Config.h"
#include "pcsx2/Frontend/InputManager.h" #include "pcsx2/Input/InputManager.h"
#include <QtWidgets/QDialog> #include <QtWidgets/QDialog>
#include <optional> #include <optional>
#include <string> #include <string>

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -24,7 +24,7 @@
#include <cmath> #include <cmath>
#include <sstream> #include <sstream>
#include "pcsx2/HostSettings.h" #include "pcsx2/Host.h"
#include "pcsx2/GS/GSIntrin.h" // _BitScanForward #include "pcsx2/GS/GSIntrin.h" // _BitScanForward

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,9 +14,10 @@
*/ */
#pragma once #pragma once
#include "common/Pcsx2Defs.h"
#include "pcsx2/Frontend/InputManager.h"
#include "pcsx2/Config.h" #include "pcsx2/Config.h"
#include "pcsx2/Input/InputManager.h"
#include <QtWidgets/QPushButton> #include <QtWidgets/QPushButton>
#include <optional> #include <optional>
#include <utility> #include <utility>

View File

@ -15,38 +15,34 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "common/FileSystem.h"
#include "common/Path.h"
#include "common/StringUtil.h"
#include "pcsx2/Frontend/GameList.h"
#include "pcsx2/HostSettings.h"
#include "pcsx2/INISettingsInterface.h"
#include "MainWindow.h" #include "MainWindow.h"
#include "QtHost.h" #include "QtHost.h"
#include "QtUtils.h" #include "QtUtils.h"
#include "Settings/AchievementSettingsWidget.h"
#include "Settings/AdvancedSettingsWidget.h"
#include "Settings/AudioSettingsWidget.h"
#include "Settings/BIOSSettingsWidget.h"
#include "Settings/DEV9SettingsWidget.h"
#include "Settings/DebugSettingsWidget.h"
#include "Settings/EmulationSettingsWidget.h"
#include "Settings/FolderSettingsWidget.h"
#include "Settings/GameFixSettingsWidget.h"
#include "Settings/GameListSettingsWidget.h"
#include "Settings/GameSummaryWidget.h"
#include "Settings/GraphicsSettingsWidget.h"
#include "Settings/HotkeySettingsWidget.h"
#include "Settings/InterfaceSettingsWidget.h"
#include "Settings/MemoryCardSettingsWidget.h"
#include "SettingsDialog.h" #include "SettingsDialog.h"
#include "AdvancedSettingsWidget.h" #include "pcsx2/Achievements.h"
#include "AudioSettingsWidget.h" #include "pcsx2/GameList.h"
#include "BIOSSettingsWidget.h" #include "pcsx2/Host.h"
#include "EmulationSettingsWidget.h" #include "pcsx2/INISettingsInterface.h"
#include "GameSummaryWidget.h"
#include "GameFixSettingsWidget.h"
#include "GameListSettingsWidget.h"
#include "GraphicsSettingsWidget.h"
#include "DEV9SettingsWidget.h"
#include "FolderSettingsWidget.h"
#include "HotkeySettingsWidget.h"
#include "InterfaceSettingsWidget.h"
#include "MemoryCardSettingsWidget.h"
#include "DebugSettingsWidget.h"
#ifdef ENABLE_ACHIEVEMENTS #include "common/FileSystem.h"
#include "AchievementSettingsWidget.h" #include "common/Path.h"
#include "pcsx2/Frontend/Achievements.h" #include "common/StringUtil.h"
#endif
#include <QtWidgets/QMessageBox> #include <QtWidgets/QMessageBox>
#include <QtWidgets/QTextEdit> #include <QtWidgets/QTextEdit>

View File

@ -17,7 +17,7 @@
#include "QtHost.h" #include "QtHost.h"
#include "pcsx2/Config.h" #include "pcsx2/Config.h"
#include "pcsx2/HostSettings.h" #include "pcsx2/Host.h"
#include "common/Path.h" #include "common/Path.h"

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,48 +15,48 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Frontend/Achievements.h" #ifdef ENABLE_ACHIEVEMENTS
#include "Frontend/CommonHost.h"
#include "Frontend/FullscreenUI.h" #include "CommonHost.h"
#include "Frontend/ImGuiFullscreen.h" #include "Achievements.h"
#include "Frontend/ImGuiManager.h" #include "CDVD/IsoFS/IsoFS.h"
#include "CDVD/IsoFS/IsoFSCDVD.h"
#include "Elfheader.h"
#include "GS.h"
#include "Host.h"
#include "ImGui/FullscreenUI.h"
#include "ImGui/ImGuiFullscreen.h"
#include "ImGui/ImGuiManager.h"
#include "IopMem.h"
#include "Memory.h"
#include "VMManager.h"
#include "svnrev.h"
#include "vtlb.h"
#include "common/Assertions.h" #include "common/Assertions.h"
#include "common/FileSystem.h"
#include "common/HTTPDownloader.h"
#include "common/Console.h" #include "common/Console.h"
#include "common/FileSystem.h"
#include "common/General.h" #include "common/General.h"
#include "common/HTTPDownloader.h"
#include "common/MD5Digest.h" #include "common/MD5Digest.h"
#include "common/Path.h" #include "common/Path.h"
#include "common/ScopedGuard.h" #include "common/ScopedGuard.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "common/Timer.h" #include "common/Timer.h"
#include "fmt/core.h"
#include "rc_api_info.h" #include "rc_api_info.h"
#include "rc_api_request.h" #include "rc_api_request.h"
#include "rc_api_runtime.h" #include "rc_api_runtime.h"
#include "rc_api_user.h" #include "rc_api_user.h"
#include "rcheevos.h" #include "rcheevos.h"
#include "fmt/core.h"
#include "CDVD/IsoFS/IsoFSCDVD.h"
#include "CDVD/IsoFS/IsoFS.h"
#include "Elfheader.h"
#include "GS.h"
#include "Host.h"
#include "HostSettings.h"
#include "IopMem.h"
#include "Memory.h"
#include "VMManager.h"
#include "vtlb.h"
#include "svnrev.h"
#include <algorithm> #include <algorithm>
#include <array> #include <array>
#include <cstdarg> #include <cstdarg>
#include <cstdlib> #include <cstdlib>
#include <limits>
#include <functional> #include <functional>
#include <limits>
#include <optional> #include <optional>
#include <string> #include <string>
#include <vector> #include <vector>
@ -2262,4 +2262,6 @@ void Achievements::RAIntegration::RACallbackWriteMemory(unsigned int address, un
PokeMemory(address, sizeof(value), nullptr, static_cast<unsigned>(value)); PokeMemory(address, sizeof(value), nullptr, static_cast<unsigned>(value));
} }
#endif #endif // ENABLE_RAINTEGRATION
#endif // ENABLE_ACHIEVEMENTS

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,34 +14,177 @@
*/ */
#pragma once #pragma once
#include "common/Pcsx2Types.h" #include "common/Pcsx2Types.h"
#include "Config.h"
#include <functional>
#include <mutex>
#include <optional>
#include <string>
#include <tuple>
#include <utility>
#include <vector> #include <vector>
#ifdef ENABLE_ACHIEVEMENTS
namespace Achievements namespace Achievements
{ {
#ifdef ENABLE_ACHIEVEMENTS enum class AchievementCategory : u8
{
Local = 0,
Core = 3,
Unofficial = 5
};
// Implemented in Host. struct Achievement
extern bool OnReset(); {
extern void LoadState(const u8* state_data, u32 state_data_size); u32 id;
extern std::vector<u8> SaveState(); std::string title;
extern void GameChanged(u32 crc); std::string description;
std::string memaddr;
std::string badge_name;
// badge paths are mutable because they're resolved when they're needed.
mutable std::string locked_badge_path;
mutable std::string unlocked_badge_path;
u32 points;
AchievementCategory category;
bool locked;
bool active;
bool primed;
};
struct Leaderboard
{
u32 id;
std::string title;
std::string description;
int format;
};
struct LeaderboardEntry
{
std::string user;
std::string formatted_score;
time_t submitted;
u32 rank;
bool is_self;
};
// RAIntegration only exists for Windows, so no point checking it on other platforms.
#ifdef ENABLE_RAINTEGRATION
bool IsUsingRAIntegration();
#else
__fi static bool IsUsingRAIntegration()
{
return false;
}
#endif
bool IsActive();
bool IsLoggedIn();
bool ChallengeModeActive();
bool LeaderboardsActive();
bool IsTestModeActive();
bool IsUnofficialTestModeActive();
bool IsRichPresenceEnabled();
bool HasActiveGame();
u32 GetGameID();
/// Acquires the achievements lock. Must be held when accessing any achievement state from another thread.
std::unique_lock<std::recursive_mutex> GetLock();
void Initialize();
void UpdateSettings(const Pcsx2Config::AchievementsOptions& old_config);
/// Called when the system is being reset. If it returns false, the reset should be aborted.
bool OnReset();
/// Called when the system is being shut down. If Shutdown() returns false, the shutdown should be aborted.
bool Shutdown();
/// Called when the system is being paused and resumed.
void OnPaused(bool paused);
/// Called once a frame at vsync time on the CPU thread.
void VSyncUpdate();
/// Called to process pending HTTP requests when the VM is paused, because otherwise the vsync event won't fire.
void ProcessPendingHTTPRequestsFromGSThread();
void LoadState(const u8* state_data, u32 state_data_size);
std::vector<u8> SaveState();
/// Returns true if the current game has any achievements or leaderboards.
/// Does not need to have the lock held.
bool SafeHasAchievementsOrLeaderboards();
const std::string& GetUsername();
const std::string& GetRichPresenceString();
bool LoginAsync(const char* username, const char* password);
bool Login(const char* username, const char* password);
void Logout();
void GameChanged(u32 crc);
const std::string& GetGameTitle();
const std::string& GetGameIcon();
bool EnumerateAchievements(std::function<bool(const Achievement&)> callback);
u32 GetUnlockedAchiementCount();
u32 GetAchievementCount();
u32 GetMaximumPointsForGame();
u32 GetCurrentPointsForGame();
bool EnumerateLeaderboards(std::function<bool(const Leaderboard&)> callback);
std::optional<bool> TryEnumerateLeaderboardEntries(u32 id, std::function<bool(const LeaderboardEntry&)> callback);
const Leaderboard* GetLeaderboardByID(u32 id);
u32 GetLeaderboardCount();
bool IsLeaderboardTimeType(const Leaderboard& leaderboard);
const Achievement* GetAchievementByID(u32 id);
std::pair<u32, u32> GetAchievementProgress(const Achievement& achievement);
std::string GetAchievementProgressText(const Achievement& achievement);
const std::string& GetAchievementBadgePath(
const Achievement& achievement, bool download_if_missing = true, bool force_unlocked_icon = false);
std::string GetAchievementBadgeURL(const Achievement& achievement);
u32 GetPrimedAchievementCount();
#ifdef ENABLE_RAINTEGRATION
void SwitchToRAIntegration();
namespace RAIntegration
{
void MainWindowChanged(void* new_handle);
void GameChanged();
std::vector<std::tuple<int, std::string, bool>> GetMenuItems();
void ActivateMenuItem(int item);
} // namespace RAIntegration
#endif
/// Re-enables hardcode mode if it is enabled in the settings. /// Re-enables hardcode mode if it is enabled in the settings.
extern bool ResetChallengeMode(); bool ResetChallengeMode();
/// Forces hardcore mode off until next reset. /// Forces hardcore mode off until next reset.
extern void DisableChallengeMode(); void DisableChallengeMode();
/// Prompts the user to disable hardcore mode, if they agree, returns true. /// Prompts the user to disable hardcore mode, if they agree, returns true.
extern bool ConfirmChallengeModeDisable(const char* trigger); bool ConfirmChallengeModeDisable(const char* trigger);
/// Returns true if features such as save states should be disabled. /// Returns true if features such as save states should be disabled.
extern bool ChallengeModeActive(); bool ChallengeModeActive();
} // namespace Achievements
#else #else
// Make noops when compiling without cheevos. // Make noops when compiling without cheevos.
namespace Achievements
{
static inline bool OnReset() static inline bool OnReset()
{ {
return true; return true;
@ -67,12 +210,22 @@ namespace Achievements
return false; return false;
} }
static inline void DisableChallengeMode() {} static inline void DisableChallengeMode()
{
}
static inline bool ConfirmChallengeModeDisable(const char* trigger) static inline bool ConfirmChallengeModeDisable(const char* trigger)
{ {
return true; return true;
} }
#endif
} // namespace Achievements } // namespace Achievements
#endif
/// Functions implemented in the frontend.
namespace Host
{
void OnAchievementsRefreshed();
void OnAchievementsChallengeModeChanged();
} // namespace Host

View File

@ -21,7 +21,7 @@
#include "Config.h" #include "Config.h"
#include "ChunksCache.h" #include "ChunksCache.h"
#include "GzippedFileReader.h" #include "GzippedFileReader.h"
#include "HostSettings.h" #include "Host.h"
#include "zlib_indexed.h" #include "zlib_indexed.h"
#define CLAMP(val, minval, maxval) (std::min(maxval, std::max(minval, val))) #define CLAMP(val, minval, maxval) (std::min(maxval, std::max(minval, val)))

View File

@ -60,8 +60,8 @@ if(TARGET SDL2::SDL2 OR TARGET SDL2::SDL2-static)
target_link_libraries(PCSX2_FLAGS INTERFACE SDL2::SDL2) target_link_libraries(PCSX2_FLAGS INTERFACE SDL2::SDL2)
endif() endif()
target_sources(PCSX2 PRIVATE target_sources(PCSX2 PRIVATE
Frontend/SDLInputSource.cpp Input/SDLInputSource.cpp
Frontend/SDLInputSource.h Input/SDLInputSource.h
) )
endif() endif()
@ -83,9 +83,11 @@ endif(WIN32)
# Main pcsx2 source # Main pcsx2 source
set(pcsx2Sources set(pcsx2Sources
Achievements.cpp
Cache.cpp Cache.cpp
COP0.cpp COP0.cpp
COP2.cpp COP2.cpp
CommonHost.cpp
Counters.cpp Counters.cpp
Dmac.cpp Dmac.cpp
GameDatabase.cpp GameDatabase.cpp
@ -93,14 +95,20 @@ set(pcsx2Sources
FW.cpp FW.cpp
FiFo.cpp FiFo.cpp
FPU.cpp FPU.cpp
GameList.cpp
Gif.cpp Gif.cpp
Gif_Logger.cpp Gif_Logger.cpp
Gif_Unit.cpp Gif_Unit.cpp
GS.cpp GS.cpp
GSDumpReplayer.cpp
Host.cpp Host.cpp
Hotkeys.cpp
Hw.cpp Hw.cpp
HwRead.cpp HwRead.cpp
HwWrite.cpp HwWrite.cpp
LayeredSettingsInterface.cpp
LogSink.cpp
INISettingsInterface.cpp
Interpreter.cpp Interpreter.cpp
IopBios.cpp IopBios.cpp
IopCounters.cpp IopCounters.cpp
@ -150,6 +158,7 @@ set(pcsx2Sources
Vif_Transfer.cpp Vif_Transfer.cpp
Vif_Unpack.cpp Vif_Unpack.cpp
VirtualMemory.cpp VirtualMemory.cpp
VMManager.cpp
vtlb.cpp vtlb.cpp
VU0.cpp VU0.cpp
VUmicro.cpp VUmicro.cpp
@ -159,7 +168,8 @@ set(pcsx2Sources
VU1microInterp.cpp VU1microInterp.cpp
VUflags.cpp VUflags.cpp
VUmicroMem.cpp VUmicroMem.cpp
VUops.cpp) VUops.cpp
)
# Main pcsx2 header # Main pcsx2 header
set(pcsx2Headers set(pcsx2Headers
@ -167,6 +177,7 @@ set(pcsx2Headers
AsyncFileReader.h AsyncFileReader.h
Cache.h Cache.h
Common.h Common.h
CommonHost.h
Config.h Config.h
COP0.h COP0.h
Counters.h Counters.h
@ -174,18 +185,23 @@ set(pcsx2Headers
GameDatabase.h GameDatabase.h
Elfheader.h Elfheader.h
FW.h FW.h
GameList.h
Gif.h Gif.h
Gif_Unit.h Gif_Unit.h
GS.h GS.h
GSDumpReplayer.h
Hardware.h Hardware.h
Host.h Host.h
Hw.h Hw.h
INISettingsInterface.h
IopBios.h IopBios.h
IopCounters.h IopCounters.h
IopDma.h IopDma.h
IopGte.h IopGte.h
IopHw.h IopHw.h
IopMem.h IopMem.h
LayeredSettingsInterface.h
LogSink.h
PINE.h PINE.h
Mdec.h Mdec.h
MTVU.h MTVU.h
@ -216,6 +232,7 @@ set(pcsx2Headers
Vif.h Vif.h
Vif_Unpack.h Vif_Unpack.h
VirtualMemory.h VirtualMemory.h
VMManager.h
vtlb.h vtlb.h
VUflags.h VUflags.h
VUmicro.h VUmicro.h
@ -833,16 +850,27 @@ set(pcsx2DebugToolsHeaders
DebugTools/DisVUops.h DebugTools/DisVUops.h
DebugTools/BiosDebugData.h) DebugTools/BiosDebugData.h)
# Frontend sources set(pcsx2ImGuiSources
set(pcsx2FrontendSources ImGui/FullscreenUI.cpp
Frontend/ImGuiManager.cpp ImGui/ImGuiFullscreen.cpp
Frontend/ImGuiOverlays.cpp ImGui/ImGuiManager.cpp
ImGui/ImGuiOverlays.cpp
) )
# Frontend headers set(pcsx2ImGuiHeaders
set(pcsx2FrontendHeaders ImGui/FullscreenUI.h
Frontend/ImGuiManager.h ImGui/ImGuiFullscreen.h
Frontend/ImGuiOverlays.h ImGui/ImGuiManager.h
ImGui/ImGuiOverlays.h
)
set(pcsx2InputSources
Input/InputManager.cpp
Input/InputSource.cpp
)
set(pcsx2InputHeaders
Input/InputManager.h
Input/InputSource.h
) )
if(APPLE) if(APPLE)
@ -861,42 +889,7 @@ if(APPLE)
) )
endif() endif()
list(APPEND pcsx2FrontendSources
Frontend/CommonHost.cpp
Frontend/CommonHotkeys.cpp
Frontend/FullscreenUI.cpp
Frontend/GameList.cpp
Frontend/HostSettings.cpp
Frontend/ImGuiFullscreen.cpp
Frontend/InputManager.cpp
Frontend/InputSource.cpp
Frontend/LayeredSettingsInterface.cpp
Frontend/LogSink.cpp
GSDumpReplayer.cpp
INISettingsInterface.cpp
VMManager.cpp
)
list(APPEND pcsx2FrontendHeaders
Frontend/CommonHost.h
Frontend/FullscreenUI.h
Frontend/GameList.h
Frontend/ImGuiFullscreen.h
Frontend/InputManager.h
Frontend/InputSource.h
Frontend/LayeredSettingsInterface.h
Frontend/LogSink.h
GSDumpReplayer.h
HostSettings.h
INISettingsInterface.h
VMManager.h)
if(USE_ACHIEVEMENTS) if(USE_ACHIEVEMENTS)
list(APPEND pcsx2FrontendSources
Frontend/Achievements.cpp
)
list(APPEND pcsx2FrontendHeaders
Frontend/Achievements.h
)
target_compile_definitions(PCSX2_FLAGS INTERFACE target_compile_definitions(PCSX2_FLAGS INTERFACE
ENABLE_ACHIEVEMENTS ENABLE_ACHIEVEMENTS
) )
@ -922,13 +915,13 @@ if(USE_DISCORD_PRESENCE)
) )
endif() endif()
if(WIN32) if(WIN32)
list(APPEND pcsx2FrontendSources list(APPEND pcsx2InputSources
Frontend/DInputSource.cpp Input/DInputSource.cpp
Frontend/XInputSource.cpp Input/XInputSource.cpp
) )
list(APPEND pcsx2FrontendHeaders list(APPEND pcsx2InputHeaders
Frontend/DInputSource.h Input/DInputSource.h
Frontend/XInputSource.h Input/XInputSource.h
) )
endif() endif()
@ -1132,8 +1125,10 @@ target_sources(PCSX2 PRIVATE
${pcsx2RecordingSources} ${pcsx2RecordingSources}
${pcsx2DebugToolsSources} ${pcsx2DebugToolsSources}
${pcsx2DebugToolsHeaders} ${pcsx2DebugToolsHeaders}
${pcsx2FrontendSources} ${pcsx2ImGuiSources}
${pcsx2FrontendHeaders} ${pcsx2ImGuiHeaders}
${pcsx2InputSources}
${pcsx2InputHeaders}
${pcsx2ps2Sources} ${pcsx2ps2Sources}
${pcsx2ps2Headers} ${pcsx2ps2Headers}
) )

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,32 +14,30 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "common/Assertions.h"
#include "common/CrashHandler.h" #include "CommonHost.h"
#include "common/FileSystem.h" #include "Achievements.h"
#include "common/Path.h"
#include "common/Timer.h"
#include "common/Threading.h"
#include "Frontend/CommonHost.h"
#include "Frontend/FullscreenUI.h"
#include "Frontend/GameList.h"
#include "Frontend/LayeredSettingsInterface.h"
#include "Frontend/InputManager.h"
#include "Frontend/LogSink.h"
#include "GS.h" #include "GS.h"
#include "GS/Renderers/HW/GSTextureReplacements.h" #include "GS/Renderers/HW/GSTextureReplacements.h"
#include "GameList.h"
#include "Host.h" #include "Host.h"
#include "HostSettings.h"
#include "IconsFontAwesome5.h" #include "IconsFontAwesome5.h"
#include "ImGui/FullscreenUI.h"
#include "Input/InputManager.h"
#include "LayeredSettingsInterface.h"
#include "LogSink.h"
#include "MemoryCardFile.h" #include "MemoryCardFile.h"
#include "PAD/Host/PAD.h" #include "PAD/Host/PAD.h"
#include "PerformanceMetrics.h" #include "PerformanceMetrics.h"
#include "Sio.h" #include "Sio.h"
#include "VMManager.h" #include "VMManager.h"
#ifdef ENABLE_ACHIEVEMENTS #include "common/Assertions.h"
#include "Frontend/Achievements.h" #include "common/CrashHandler.h"
#endif #include "common/FileSystem.h"
#include "common/Path.h"
#include "common/Timer.h"
#include "common/Threading.h"
#ifdef ENABLE_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
#include "discord_rpc.h" #include "discord_rpc.h"

View File

@ -1,173 +0,0 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "common/Pcsx2Defs.h"
#include "pcsx2/Achievements.h"
#include "Config.h"
#include <functional>
#include <mutex>
#include <optional>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
namespace Achievements
{
enum class AchievementCategory : u8
{
Local = 0,
Core = 3,
Unofficial = 5
};
struct Achievement
{
u32 id;
std::string title;
std::string description;
std::string memaddr;
std::string badge_name;
// badge paths are mutable because they're resolved when they're needed.
mutable std::string locked_badge_path;
mutable std::string unlocked_badge_path;
u32 points;
AchievementCategory category;
bool locked;
bool active;
bool primed;
};
struct Leaderboard
{
u32 id;
std::string title;
std::string description;
int format;
};
struct LeaderboardEntry
{
std::string user;
std::string formatted_score;
time_t submitted;
u32 rank;
bool is_self;
};
// RAIntegration only exists for Windows, so no point checking it on other platforms.
#ifdef ENABLE_RAINTEGRATION
bool IsUsingRAIntegration();
#else
static __fi bool IsUsingRAIntegration() { return false; }
#endif
bool IsActive();
bool IsLoggedIn();
bool ChallengeModeActive();
bool LeaderboardsActive();
bool IsTestModeActive();
bool IsUnofficialTestModeActive();
bool IsRichPresenceEnabled();
bool HasActiveGame();
u32 GetGameID();
/// Acquires the achievements lock. Must be held when accessing any achievement state from another thread.
std::unique_lock<std::recursive_mutex> GetLock();
void Initialize();
void UpdateSettings(const Pcsx2Config::AchievementsOptions& old_config);
/// Called when the system is being reset. If it returns false, the reset should be aborted.
bool OnReset();
/// Called when the system is being shut down. If Shutdown() returns false, the shutdown should be aborted.
bool Shutdown();
/// Called when the system is being paused and resumed.
void OnPaused(bool paused);
/// Called once a frame at vsync time on the CPU thread.
void VSyncUpdate();
/// Called to process pending HTTP requests when the VM is paused, because otherwise the vsync event won't fire.
void ProcessPendingHTTPRequestsFromGSThread();
void LoadState(const u8* state_data, u32 state_data_size);
std::vector<u8> SaveState();
/// Returns true if the current game has any achievements or leaderboards.
/// Does not need to have the lock held.
bool SafeHasAchievementsOrLeaderboards();
const std::string& GetUsername();
const std::string& GetRichPresenceString();
bool LoginAsync(const char* username, const char* password);
bool Login(const char* username, const char* password);
void Logout();
void GameChanged(u32 crc);
const std::string& GetGameTitle();
const std::string& GetGameIcon();
bool EnumerateAchievements(std::function<bool(const Achievement&)> callback);
u32 GetUnlockedAchiementCount();
u32 GetAchievementCount();
u32 GetMaximumPointsForGame();
u32 GetCurrentPointsForGame();
bool EnumerateLeaderboards(std::function<bool(const Leaderboard&)> callback);
std::optional<bool> TryEnumerateLeaderboardEntries(u32 id, std::function<bool(const LeaderboardEntry&)> callback);
const Leaderboard* GetLeaderboardByID(u32 id);
u32 GetLeaderboardCount();
bool IsLeaderboardTimeType(const Leaderboard& leaderboard);
const Achievement* GetAchievementByID(u32 id);
std::pair<u32, u32> GetAchievementProgress(const Achievement& achievement);
std::string GetAchievementProgressText(const Achievement& achievement);
const std::string& GetAchievementBadgePath(
const Achievement& achievement, bool download_if_missing = true, bool force_unlocked_icon = false);
std::string GetAchievementBadgeURL(const Achievement& achievement);
u32 GetPrimedAchievementCount();
#ifdef ENABLE_RAINTEGRATION
void SwitchToRAIntegration();
namespace RAIntegration
{
void MainWindowChanged(void* new_handle);
void GameChanged();
std::vector<std::tuple<int, std::string, bool>> GetMenuItems();
void ActivateMenuItem(int item);
} // namespace RAIntegration
#endif
} // namespace Achievements
/// Functions implemented in the frontend.
namespace Host
{
void OnAchievementsRefreshed();
void OnAchievementsChallengeModeChanged();
} // namespace Host

View File

@ -1,262 +0,0 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2023 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "common/Assertions.h"
#include "common/CrashHandler.h"
#include "common/FileSystem.h"
#include "common/Path.h"
#include "Frontend/LayeredSettingsInterface.h"
#include "GS.h"
#include "GS/Renderers/HW/GSTextureReplacements.h"
#include "Host.h"
#include "HostSettings.h"
#include "MemoryCardFile.h"
#include "Sio.h"
#include "VMManager.h"
static std::mutex s_settings_mutex;
static LayeredSettingsInterface s_layered_settings_interface;
std::unique_lock<std::mutex> Host::GetSettingsLock()
{
return std::unique_lock<std::mutex>(s_settings_mutex);
}
SettingsInterface* Host::GetSettingsInterface()
{
return &s_layered_settings_interface;
}
SettingsInterface* Host::GetSettingsInterfaceForBindings()
{
SettingsInterface* input_layer = s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_INPUT);
return input_layer ? input_layer : &s_layered_settings_interface;
}
std::string Host::GetBaseStringSettingValue(const char* section, const char* key, const char* default_value /*= ""*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->GetStringValue(section, key, default_value);
}
bool Host::GetBaseBoolSettingValue(const char* section, const char* key, bool default_value /*= false*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->GetBoolValue(section, key, default_value);
}
int Host::GetBaseIntSettingValue(const char* section, const char* key, int default_value /*= 0*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->GetIntValue(section, key, default_value);
}
uint Host::GetBaseUIntSettingValue(const char* section, const char* key, uint default_value /*= 0*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->GetUIntValue(section, key, default_value);
}
float Host::GetBaseFloatSettingValue(const char* section, const char* key, float default_value /*= 0.0f*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->GetFloatValue(section, key, default_value);
}
double Host::GetBaseDoubleSettingValue(const char* section, const char* key, double default_value /* = 0.0f */)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->GetDoubleValue(section, key, default_value);
}
std::vector<std::string> Host::GetBaseStringListSetting(const char* section, const char* key)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->GetStringList(section, key);
}
void Host::SetBaseBoolSettingValue(const char* section, const char* key, bool value)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->SetBoolValue(section, key, value);
}
void Host::SetBaseIntSettingValue(const char* section, const char* key, int value)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->SetIntValue(section, key, value);
}
void Host::SetBaseUIntSettingValue(const char* section, const char* key, uint value)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->SetUIntValue(section, key, value);
}
void Host::SetBaseFloatSettingValue(const char* section, const char* key, float value)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->SetFloatValue(section, key, value);
}
void Host::SetBaseStringSettingValue(const char* section, const char* key, const char* value)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->SetStringValue(section, key, value);
}
void Host::SetBaseStringListSettingValue(const char* section, const char* key, const std::vector<std::string>& values)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->SetStringList(section, key, values);
}
bool Host::AddBaseValueToStringList(const char* section, const char* key, const char* value)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->AddToStringList(section, key, value);
}
bool Host::RemoveBaseValueFromStringList(const char* section, const char* key, const char* value)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->RemoveFromStringList(section, key, value);
}
void Host::RemoveBaseSettingValue(const char* section, const char* key)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->DeleteValue(section, key);
}
std::string Host::GetStringSettingValue(const char* section, const char* key, const char* default_value /*= ""*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetStringValue(section, key, default_value);
}
bool Host::GetBoolSettingValue(const char* section, const char* key, bool default_value /*= false*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetBoolValue(section, key, default_value);
}
int Host::GetIntSettingValue(const char* section, const char* key, int default_value /*= 0*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetIntValue(section, key, default_value);
}
uint Host::GetUIntSettingValue(const char* section, const char* key, uint default_value /*= 0*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetUIntValue(section, key, default_value);
}
float Host::GetFloatSettingValue(const char* section, const char* key, float default_value /*= 0.0f*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetFloatValue(section, key, default_value);
}
double Host::GetDoubleSettingValue(const char* section, const char* key, double default_value /*= 0.0f*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetDoubleValue(section, key, default_value);
}
std::vector<std::string> Host::GetStringListSetting(const char* section, const char* key)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetStringList(section, key);
}
SettingsInterface* Host::Internal::GetBaseSettingsLayer()
{
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE);
}
SettingsInterface* Host::Internal::GetGameSettingsLayer()
{
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_GAME);
}
SettingsInterface* Host::Internal::GetInputSettingsLayer()
{
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_INPUT);
}
void Host::Internal::SetBaseSettingsLayer(SettingsInterface* sif)
{
pxAssertRel(s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE) == nullptr, "Base layer has not been set");
s_layered_settings_interface.SetLayer(LayeredSettingsInterface::LAYER_BASE, sif);
}
void Host::Internal::SetGameSettingsLayer(SettingsInterface* sif)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.SetLayer(LayeredSettingsInterface::LAYER_GAME, sif);
}
void Host::Internal::SetInputSettingsLayer(SettingsInterface* sif)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.SetLayer(LayeredSettingsInterface::LAYER_INPUT, sif);
}
void Host::Internal::UpdateEmuFolders()
{
const std::string old_cheats_directory(EmuFolders::Cheats);
const std::string old_cheats_ws_directory(EmuFolders::CheatsWS);
const std::string old_cheats_ni_directory(EmuFolders::CheatsNI);
const std::string old_memcards_directory(EmuFolders::MemoryCards);
const std::string old_textures_directory(EmuFolders::Textures);
const std::string old_videos_directory(EmuFolders::Videos);
EmuFolders::LoadConfig(*GetBaseSettingsLayer());
EmuFolders::EnsureFoldersExist();
if (VMManager::HasValidVM())
{
if (EmuFolders::Cheats != old_cheats_directory || EmuFolders::CheatsWS != old_cheats_ws_directory ||
EmuFolders::CheatsNI != old_cheats_ni_directory)
{
VMManager::ReloadPatches(true, true);
}
if (EmuFolders::MemoryCards != old_memcards_directory)
{
FileMcd_EmuClose();
FileMcd_EmuOpen();
AutoEject::SetAll();
}
if (EmuFolders::Textures != old_textures_directory)
{
GetMTGS().RunOnGSThread([]() {
if (VMManager::HasValidVM())
GSTextureReplacements::ReloadReplacementMap();
});
}
if (EmuFolders::Videos != old_videos_directory)
{
if (VMManager::HasValidVM())
GetMTGS().RunOnGSThread(&GSEndCapture);
}
}
}

View File

@ -15,92 +15,68 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Config.h"
#include "Counters.h"
#include "ImGui/FullscreenUI.h"
#include "ImGui/ImGuiManager.h"
#include "GS.h" #include "GS.h"
#include "GSCapture.h" #include "GSCapture.h"
#include "GSGL.h"
#include "GSUtil.h"
#include "GSExtra.h" #include "GSExtra.h"
#include "Renderers/Null/GSRendererNull.h" #include "GSGL.h"
#include "Renderers/HW/GSRendererHW.h"
#include "Renderers/HW/GSTextureReplacements.h"
#include "GSLzma.h" #include "GSLzma.h"
#include "GSUtil.h"
#include "Host.h"
#include "Input/InputManager.h"
#include "MultiISA.h" #include "MultiISA.h"
#include "pcsx2/GS.h"
#include "GS/Renderers/Null/GSRendererNull.h"
#include "GS/Renderers/HW/GSRendererHW.h"
#include "GS/Renderers/HW/GSTextureReplacements.h"
#ifdef ENABLE_OPENGL
#include "GS/Renderers/OpenGL/GSDeviceOGL.h"
#endif
#ifdef __APPLE__
#include "GS/Renderers/Metal/GSMetalCPPAccessible.h"
#endif
#ifdef ENABLE_VULKAN
#include "GS/Renderers/Vulkan/GSDeviceVK.h"
#endif
#ifdef _WIN32
#include "GS/Renderers/DX11/GSDevice11.h"
#include "GS/Renderers/DX12/GSDevice12.h"
#include "GS/Renderers/DX11/D3D.h"
#endif
#include "common/Console.h" #include "common/Console.h"
#include "common/FileSystem.h" #include "common/FileSystem.h"
#include "common/Path.h" #include "common/Path.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "pcsx2/Config.h"
#include "pcsx2/Counters.h"
#include "pcsx2/Frontend/ImGuiManager.h"
#include "pcsx2/Host.h"
#include "pcsx2/HostSettings.h"
#include "pcsx2/Frontend/FullscreenUI.h"
#include "pcsx2/Frontend/InputManager.h"
#include "pcsx2/GS.h"
#include "fmt/format.h" #include "fmt/format.h"
#ifdef ENABLE_OPENGL
#include "Renderers/OpenGL/GSDeviceOGL.h"
#endif
#ifdef __APPLE__
#include "Renderers/Metal/GSMetalCPPAccessible.h"
#endif
#ifdef ENABLE_VULKAN
#include "Renderers/Vulkan/GSDeviceVK.h"
#endif
#ifdef _WIN32
#include "Renderers/DX11/GSDevice11.h"
#include "Renderers/DX12/GSDevice12.h"
#include "GS/Renderers/DX11/D3D.h"
static HRESULT s_hr = E_FAIL;
#endif
#include <fstream> #include <fstream>
// do NOT undefine this/put it above includes, as x11 people love to redefine
// things that make obscure compiler bugs, unless you want to run around and
// debug obscure compiler errors --govanify
#undef None
Pcsx2Config::GSOptions GSConfig; Pcsx2Config::GSOptions GSConfig;
static u64 s_next_manual_present_time; static u64 s_next_manual_present_time;
int GSinit() void GSinit()
{ {
GSVertexSW::InitStatic(); GSVertexSW::InitStatic();
GSUtil::Init(); GSUtil::Init();
#ifdef _WIN32
s_hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
#endif
return 0;
} }
void GSshutdown() void GSshutdown()
{ {
GSclose(); GSclose();
#ifdef _WIN32
if (SUCCEEDED(s_hr))
{
::CoUninitialize();
s_hr = E_FAIL;
}
#endif
// ensure all screenshots have been saved // ensure all screenshots have been saved
GSJoinSnapshotThreads(); GSJoinSnapshotThreads();
} }

View File

@ -69,7 +69,7 @@ class HostDisplay;
s16 GSLookupGetSkipCountFunctionId(const std::string_view& name); s16 GSLookupGetSkipCountFunctionId(const std::string_view& name);
s16 GSLookupBeforeDrawFunctionId(const std::string_view& name); s16 GSLookupBeforeDrawFunctionId(const std::string_view& name);
int GSinit(); void GSinit();
void GSshutdown(); void GSshutdown();
bool GSopen(const Pcsx2Config::GSOptions& config, GSRendererType renderer, u8* basemem); bool GSopen(const Pcsx2Config::GSOptions& config, GSRendererType renderer, u8* basemem);
bool GSreopen(bool recreate_device, bool recreate_renderer, const Pcsx2Config::GSOptions& old_config); bool GSreopen(bool recreate_device, bool recreate_renderer, const Pcsx2Config::GSOptions& old_config);

View File

@ -14,10 +14,12 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "GSCrc.h"
#include "GSExtra.h" #include "GS/GSCrc.h"
#include "GS.h" #include "GS/GSExtra.h"
#include "HostSettings.h" #include "GS/GS.h"
#include "Host.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
const CRC::Game CRC::m_games[] = const CRC::Game CRC::m_games[] =

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2021 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,11 +14,12 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "GSDevice.h"
#include "GS/Renderers/Common/GSDevice.h"
#include "GS/GSGL.h" #include "GS/GSGL.h"
#include "GS/GS.h" #include "GS/GS.h"
#include "Host.h" #include "Host.h"
#include "HostSettings.h"
#include "common/Align.h" #include "common/Align.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"

View File

@ -15,8 +15,8 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Frontend/FullscreenUI.h" #include "ImGui/FullscreenUI.h"
#include "Frontend/ImGuiManager.h" #include "ImGui/ImGuiManager.h"
#include "GS/Renderers/Common/GSRenderer.h" #include "GS/Renderers/Common/GSRenderer.h"
#include "GS/GSCapture.h" #include "GS/GSCapture.h"
#include "GS/GSGL.h" #include "GS/GSGL.h"
@ -24,7 +24,6 @@
#include "Host.h" #include "Host.h"
#include "PerformanceMetrics.h" #include "PerformanceMetrics.h"
#include "pcsx2/Config.h" #include "pcsx2/Config.h"
#include "IconsFontAwesome5.h"
#include "VMManager.h" #include "VMManager.h"
#include "common/FileSystem.h" #include "common/FileSystem.h"
@ -34,6 +33,7 @@
#include "common/Timer.h" #include "common/Timer.h"
#include "fmt/core.h" #include "fmt/core.h"
#include "IconsFontAwesome5.h"
#include <algorithm> #include <algorithm>
#include <array> #include <array>

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2021 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,10 +14,10 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "GLLoader.h"
#include "GS/Renderers/OpenGL/GLLoader.h"
#include "GS/GS.h" #include "GS/GS.h"
#include "Host.h" #include "Host.h"
#include "HostSettings.h"
#include "glad.h" #include "glad.h"

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,7 +15,20 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include <atomic> #include "GS.h"
#include "GS/GSLzma.h"
#include "GSDumpReplayer.h"
#include "GameList.h"
#include "Gif.h"
#include "Gif_Unit.h"
#include "Host.h"
#include "ImGui/ImGuiManager.h"
#include "R3000A.h"
#include "R5900.h"
#include "VMManager.h"
#include "VUmicro.h"
#include "imgui.h"
#include "fmt/core.h" #include "fmt/core.h"
@ -23,23 +36,7 @@
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "common/Timer.h" #include "common/Timer.h"
#include "imgui.h" #include <atomic>
// Has to come before Gif.h
#include "MemoryTypes.h"
#include "Frontend/ImGuiManager.h"
#include "Frontend/GameList.h"
#include "Gif.h"
#include "Gif_Unit.h"
#include "GSDumpReplayer.h"
#include "GS/GSLzma.h"
#include "GS.h"
#include "Host.h"
#include "R3000A.h"
#include "R5900.h"
#include "VMManager.h"
#include "VUmicro.h"
static void GSDumpReplayerCpuReserve(); static void GSDumpReplayerCpuReserve();
static void GSDumpReplayerCpuShutdown(); static void GSDumpReplayerCpuShutdown();

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,16 +15,21 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Frontend/GameList.h" #include "CDVD/CDVD.h"
#include "HostSettings.h" #include "Elfheader.h"
#include "GameList.h"
#include "Host.h"
#include "VMManager.h"
#include "common/Assertions.h" #include "common/Assertions.h"
#include "common/Console.h" #include "common/Console.h"
#include "common/FileSystem.h" #include "common/FileSystem.h"
#include "common/HeterogeneousContainers.h"
#include "common/HTTPDownloader.h" #include "common/HTTPDownloader.h"
#include "common/HeterogeneousContainers.h"
#include "common/Path.h" #include "common/Path.h"
#include "common/ProgressCallback.h" #include "common/ProgressCallback.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include <algorithm> #include <algorithm>
#include <array> #include <array>
#include <cctype> #include <cctype>
@ -34,10 +39,6 @@
#include <string_view> #include <string_view>
#include <utility> #include <utility>
#include "CDVD/CDVD.h"
#include "Elfheader.h"
#include "VMManager.h"
#ifdef _WIN32 #ifdef _WIN32
#include "common/RedtapeWindows.h" #include "common/RedtapeWindows.h"
#endif #endif

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,8 +14,11 @@
*/ */
#pragma once #pragma once
#include "GameDatabase.h" #include "GameDatabase.h"
#include "common/Pcsx2Defs.h" #include "common/Pcsx2Defs.h"
#include <ctime> #include <ctime>
#include <functional> #include <functional>
#include <memory> #include <memory>

View File

@ -15,6 +15,8 @@
#pragma once #pragma once
#include "MemoryTypes.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
#define COPY_GS_PACKET_TO_MTGS 0 #define COPY_GS_PACKET_TO_MTGS 0

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2021 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,10 +14,26 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "GS.h"
#include "GS/Renderers/HW/GSTextureReplacements.h"
#include "Host.h" #include "Host.h"
#include "LayeredSettingsInterface.h"
#include "MemoryCardFile.h"
#include "Sio.h"
#include "VMManager.h"
#include "common/Assertions.h"
#include "common/CrashHandler.h"
#include "common/FileSystem.h"
#include "common/Path.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include <cstdarg> #include <cstdarg>
static std::mutex s_settings_mutex;
static LayeredSettingsInterface s_layered_settings_interface;
void Host::ReportFormattedErrorAsync(const std::string_view& title, const char* format, ...) void Host::ReportFormattedErrorAsync(const std::string_view& title, const char* format, ...)
{ {
std::va_list ap; std::va_list ap;
@ -36,3 +52,242 @@ bool Host::ConfirmFormattedMessage(const std::string_view& title, const char* fo
return ConfirmMessage(title, message); return ConfirmMessage(title, message);
} }
std::unique_lock<std::mutex> Host::GetSettingsLock()
{
return std::unique_lock<std::mutex>(s_settings_mutex);
}
SettingsInterface* Host::GetSettingsInterface()
{
return &s_layered_settings_interface;
}
SettingsInterface* Host::GetSettingsInterfaceForBindings()
{
SettingsInterface* input_layer = s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_INPUT);
return input_layer ? input_layer : &s_layered_settings_interface;
}
std::string Host::GetBaseStringSettingValue(const char* section, const char* key, const char* default_value /*= ""*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)
->GetStringValue(section, key, default_value);
}
bool Host::GetBaseBoolSettingValue(const char* section, const char* key, bool default_value /*= false*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)
->GetBoolValue(section, key, default_value);
}
int Host::GetBaseIntSettingValue(const char* section, const char* key, int default_value /*= 0*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)
->GetIntValue(section, key, default_value);
}
uint Host::GetBaseUIntSettingValue(const char* section, const char* key, uint default_value /*= 0*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)
->GetUIntValue(section, key, default_value);
}
float Host::GetBaseFloatSettingValue(const char* section, const char* key, float default_value /*= 0.0f*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)
->GetFloatValue(section, key, default_value);
}
double Host::GetBaseDoubleSettingValue(const char* section, const char* key, double default_value /* = 0.0f */)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)
->GetDoubleValue(section, key, default_value);
}
std::vector<std::string> Host::GetBaseStringListSetting(const char* section, const char* key)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->GetStringList(section, key);
}
void Host::SetBaseBoolSettingValue(const char* section, const char* key, bool value)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->SetBoolValue(section, key, value);
}
void Host::SetBaseIntSettingValue(const char* section, const char* key, int value)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->SetIntValue(section, key, value);
}
void Host::SetBaseUIntSettingValue(const char* section, const char* key, uint value)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->SetUIntValue(section, key, value);
}
void Host::SetBaseFloatSettingValue(const char* section, const char* key, float value)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->SetFloatValue(section, key, value);
}
void Host::SetBaseStringSettingValue(const char* section, const char* key, const char* value)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->SetStringValue(section, key, value);
}
void Host::SetBaseStringListSettingValue(const char* section, const char* key, const std::vector<std::string>& values)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->SetStringList(section, key, values);
}
bool Host::AddBaseValueToStringList(const char* section, const char* key, const char* value)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)
->AddToStringList(section, key, value);
}
bool Host::RemoveBaseValueFromStringList(const char* section, const char* key, const char* value)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)
->RemoveFromStringList(section, key, value);
}
void Host::RemoveBaseSettingValue(const char* section, const char* key)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE)->DeleteValue(section, key);
}
std::string Host::GetStringSettingValue(const char* section, const char* key, const char* default_value /*= ""*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetStringValue(section, key, default_value);
}
bool Host::GetBoolSettingValue(const char* section, const char* key, bool default_value /*= false*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetBoolValue(section, key, default_value);
}
int Host::GetIntSettingValue(const char* section, const char* key, int default_value /*= 0*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetIntValue(section, key, default_value);
}
uint Host::GetUIntSettingValue(const char* section, const char* key, uint default_value /*= 0*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetUIntValue(section, key, default_value);
}
float Host::GetFloatSettingValue(const char* section, const char* key, float default_value /*= 0.0f*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetFloatValue(section, key, default_value);
}
double Host::GetDoubleSettingValue(const char* section, const char* key, double default_value /*= 0.0f*/)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetDoubleValue(section, key, default_value);
}
std::vector<std::string> Host::GetStringListSetting(const char* section, const char* key)
{
std::unique_lock lock(s_settings_mutex);
return s_layered_settings_interface.GetStringList(section, key);
}
SettingsInterface* Host::Internal::GetBaseSettingsLayer()
{
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE);
}
SettingsInterface* Host::Internal::GetGameSettingsLayer()
{
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_GAME);
}
SettingsInterface* Host::Internal::GetInputSettingsLayer()
{
return s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_INPUT);
}
void Host::Internal::SetBaseSettingsLayer(SettingsInterface* sif)
{
pxAssertRel(s_layered_settings_interface.GetLayer(LayeredSettingsInterface::LAYER_BASE) == nullptr,
"Base layer has not been set");
s_layered_settings_interface.SetLayer(LayeredSettingsInterface::LAYER_BASE, sif);
}
void Host::Internal::SetGameSettingsLayer(SettingsInterface* sif)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.SetLayer(LayeredSettingsInterface::LAYER_GAME, sif);
}
void Host::Internal::SetInputSettingsLayer(SettingsInterface* sif)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.SetLayer(LayeredSettingsInterface::LAYER_INPUT, sif);
}
void Host::Internal::UpdateEmuFolders()
{
const std::string old_cheats_directory(EmuFolders::Cheats);
const std::string old_cheats_ws_directory(EmuFolders::CheatsWS);
const std::string old_cheats_ni_directory(EmuFolders::CheatsNI);
const std::string old_memcards_directory(EmuFolders::MemoryCards);
const std::string old_textures_directory(EmuFolders::Textures);
const std::string old_videos_directory(EmuFolders::Videos);
EmuFolders::LoadConfig(*GetBaseSettingsLayer());
EmuFolders::EnsureFoldersExist();
if (VMManager::HasValidVM())
{
if (EmuFolders::Cheats != old_cheats_directory || EmuFolders::CheatsWS != old_cheats_ws_directory ||
EmuFolders::CheatsNI != old_cheats_ni_directory)
{
VMManager::ReloadPatches(true, true);
}
if (EmuFolders::MemoryCards != old_memcards_directory)
{
FileMcd_EmuClose();
FileMcd_EmuOpen();
AutoEject::SetAll();
}
if (EmuFolders::Textures != old_textures_directory)
{
GetMTGS().RunOnGSThread([]() {
if (VMManager::HasValidVM())
GSTextureReplacements::ReloadReplacementMap();
});
}
if (EmuFolders::Videos != old_videos_directory)
{
if (VMManager::HasValidVM())
GetMTGS().RunOnGSThread(&GSEndCapture);
}
}
}

View File

@ -19,13 +19,16 @@
#include <ctime> #include <ctime>
#include <functional> #include <functional>
#include <mutex>
#include <optional>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <optional>
#include <vector> #include <vector>
enum class VsyncMode; enum class VsyncMode;
class SettingsInterface;
namespace Host namespace Host
{ {
/// Typical durations for OSD messages. /// Typical durations for OSD messages.
@ -89,4 +92,67 @@ namespace Host
/// Requests shut down of the current virtual machine. /// Requests shut down of the current virtual machine.
void RequestVMShutdown(bool allow_confirm, bool allow_save_state, bool default_save_state); void RequestVMShutdown(bool allow_confirm, bool allow_save_state, bool default_save_state);
/// Base setting retrieval, bypasses layers.
std::string GetBaseStringSettingValue(const char* section, const char* key, const char* default_value = "");
bool GetBaseBoolSettingValue(const char* section, const char* key, bool default_value = false);
int GetBaseIntSettingValue(const char* section, const char* key, int default_value = 0);
uint GetBaseUIntSettingValue(const char* section, const char* key, uint default_value = 0);
float GetBaseFloatSettingValue(const char* section, const char* key, float default_value = 0.0f);
double GetBaseDoubleSettingValue(const char* section, const char* key, double default_value = 0.0);
std::vector<std::string> GetBaseStringListSetting(const char* section, const char* key);
/// Allows the emucore to write settings back to the frontend. Use with care.
/// You should call CommitBaseSettingChanges() after finishing writing, or it may not be written to disk.
void SetBaseBoolSettingValue(const char* section, const char* key, bool value);
void SetBaseIntSettingValue(const char* section, const char* key, int value);
void SetBaseUIntSettingValue(const char* section, const char* key, uint value);
void SetBaseFloatSettingValue(const char* section, const char* key, float value);
void SetBaseStringSettingValue(const char* section, const char* key, const char* value);
void SetBaseStringListSettingValue(const char* section, const char* key, const std::vector<std::string>& values);
bool AddBaseValueToStringList(const char* section, const char* key, const char* value);
bool RemoveBaseValueFromStringList(const char* section, const char* key, const char* value);
void RemoveBaseSettingValue(const char* section, const char* key);
void CommitBaseSettingChanges();
/// Settings access, thread-safe.
std::string GetStringSettingValue(const char* section, const char* key, const char* default_value = "");
bool GetBoolSettingValue(const char* section, const char* key, bool default_value = false);
int GetIntSettingValue(const char* section, const char* key, int default_value = 0);
uint GetUIntSettingValue(const char* section, const char* key, uint default_value = 0);
float GetFloatSettingValue(const char* section, const char* key, float default_value = 0.0f);
double GetDoubleSettingValue(const char* section, const char* key, double default_value = 0.0);
std::vector<std::string> GetStringListSetting(const char* section, const char* key);
/// Direct access to settings interface. Must hold the lock when calling GetSettingsInterface() and while using it.
std::unique_lock<std::mutex> GetSettingsLock();
SettingsInterface* GetSettingsInterface();
/// Returns the settings interface that controller bindings should be loaded from.
/// If an input profile is being used, this will be the input layer, otherwise the layered interface.
SettingsInterface* GetSettingsInterfaceForBindings();
namespace Internal
{
/// Retrieves the base settings layer. Must call with lock held.
SettingsInterface* GetBaseSettingsLayer();
/// Retrieves the game settings layer, if present. Must call with lock held.
SettingsInterface* GetGameSettingsLayer();
/// Retrieves the input settings layer, if present. Must call with lock held.
SettingsInterface* GetInputSettingsLayer();
/// Sets the base settings layer. Should be called by the host at initialization time.
void SetBaseSettingsLayer(SettingsInterface* sif);
/// Sets the game settings layer. Called by VMManager when the game changes.
void SetGameSettingsLayer(SettingsInterface* sif);
/// Sets the input profile settings layer. Called by VMManager when the game changes.
void SetInputSettingsLayer(SettingsInterface* sif);
/// Updates the variables in the EmuFolders namespace, reloading subsystems if needed. Must call with the lock held.
void UpdateEmuFolders();
} // namespace Internal
} // namespace Host } // namespace Host

View File

@ -1,88 +0,0 @@
/* 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
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "common/Pcsx2Defs.h"
#include <string>
#include <mutex>
class SettingsInterface;
namespace Host
{
// Base setting retrieval, bypasses layers.
std::string GetBaseStringSettingValue(const char* section, const char* key, const char* default_value = "");
bool GetBaseBoolSettingValue(const char* section, const char* key, bool default_value = false);
int GetBaseIntSettingValue(const char* section, const char* key, int default_value = 0);
uint GetBaseUIntSettingValue(const char* section, const char* key, uint default_value = 0);
float GetBaseFloatSettingValue(const char* section, const char* key, float default_value = 0.0f);
double GetBaseDoubleSettingValue(const char* section, const char* key, double default_value = 0.0);
std::vector<std::string> GetBaseStringListSetting(const char* section, const char* key);
// Allows the emucore to write settings back to the frontend. Use with care.
// You should call CommitBaseSettingChanges() after finishing writing, or it may not be written to disk.
void SetBaseBoolSettingValue(const char* section, const char* key, bool value);
void SetBaseIntSettingValue(const char* section, const char* key, int value);
void SetBaseUIntSettingValue(const char* section, const char* key, uint value);
void SetBaseFloatSettingValue(const char* section, const char* key, float value);
void SetBaseStringSettingValue(const char* section, const char* key, const char* value);
void SetBaseStringListSettingValue(const char* section, const char* key, const std::vector<std::string>& values);
bool AddBaseValueToStringList(const char* section, const char* key, const char* value);
bool RemoveBaseValueFromStringList(const char* section, const char* key, const char* value);
void RemoveBaseSettingValue(const char* section, const char* key);
void CommitBaseSettingChanges();
// Settings access, thread-safe.
std::string GetStringSettingValue(const char* section, const char* key, const char* default_value = "");
bool GetBoolSettingValue(const char* section, const char* key, bool default_value = false);
int GetIntSettingValue(const char* section, const char* key, int default_value = 0);
uint GetUIntSettingValue(const char* section, const char* key, uint default_value = 0);
float GetFloatSettingValue(const char* section, const char* key, float default_value = 0.0f);
double GetDoubleSettingValue(const char* section, const char* key, double default_value = 0.0);
std::vector<std::string> GetStringListSetting(const char* section, const char* key);
/// Direct access to settings interface. Must hold the lock when calling GetSettingsInterface() and while using it.
std::unique_lock<std::mutex> GetSettingsLock();
SettingsInterface* GetSettingsInterface();
/// Returns the settings interface that controller bindings should be loaded from.
/// If an input profile is being used, this will be the input layer, otherwise the layered interface.
SettingsInterface* GetSettingsInterfaceForBindings();
namespace Internal
{
/// Retrieves the base settings layer. Must call with lock held.
SettingsInterface* GetBaseSettingsLayer();
/// Retrieves the game settings layer, if present. Must call with lock held.
SettingsInterface* GetGameSettingsLayer();
/// Retrieves the input settings layer, if present. Must call with lock held.
SettingsInterface* GetInputSettingsLayer();
/// Sets the base settings layer. Should be called by the host at initialization time.
void SetBaseSettingsLayer(SettingsInterface* sif);
/// Sets the game settings layer. Called by VMManager when the game changes.
void SetGameSettingsLayer(SettingsInterface* sif);
/// Sets the input profile settings layer. Called by VMManager when the game changes.
void SetInputSettingsLayer(SettingsInterface* sif);
/// Updates the variables in the EmuFolders namespace, reloading subsystems if needed. Must call with the lock held.
void UpdateEmuFolders();
} // namespace Internal
} // namespace Host

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,23 +14,21 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "common/Assertions.h"
#include "common/FileSystem.h" #include "CommonHost.h"
#include "common/Path.h" #include "Achievements.h"
#include "pcsx2/Achievements.h"
#include "Frontend/CommonHost.h"
#include "Frontend/FullscreenUI.h"
#include "Frontend/InputManager.h"
#include "GS.h" #include "GS.h"
#include "Host.h" #include "Host.h"
#include "IconsFontAwesome5.h" #include "IconsFontAwesome5.h"
#include "ImGui/FullscreenUI.h"
#include "Input/InputManager.h"
#include "Recording/InputRecording.h" #include "Recording/InputRecording.h"
#include "SPU2/spu2.h" #include "SPU2/spu2.h"
#include "VMManager.h" #include "VMManager.h"
#ifdef ENABLE_ACHIEVEMENTS #include "common/Assertions.h"
#include "Frontend/Achievements.h" #include "common/FileSystem.h"
#endif #include "common/Path.h"
static s32 s_current_save_slot = 1; static s32 s_current_save_slot = 1;
static std::optional<LimiterModeType> s_limiter_mode_prior_to_hold_interaction; static std::optional<LimiterModeType> s_limiter_mode_prior_to_hold_interaction;

View File

@ -17,13 +17,27 @@
#define IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS
#include "Frontend/CommonHost.h" #include "CDVD/CDVDcommon.h"
#include "Frontend/FullscreenUI.h" #include "CommonHost.h"
#include "Frontend/ImGuiManager.h" #include "GS/Renderers/Common/GSDevice.h"
#include "Frontend/ImGuiFullscreen.h" #include "GS/Renderers/Common/GSTexture.h"
#include "Frontend/InputManager.h" #include "Achievements.h"
#include "Frontend/GameList.h" #include "CDVD/CDVDdiscReader.h"
#include "IconsFontAwesome5.h" #include "GS.h"
#include "GameList.h"
#include "Host.h"
#include "INISettingsInterface.h"
#include "ImGui/FullscreenUI.h"
#include "ImGui/ImGuiFullscreen.h"
#include "ImGui/ImGuiManager.h"
#include "Input/InputManager.h"
#include "MemoryCardFile.h"
#include "PAD/Host/PAD.h"
#include "Sio.h"
#include "USB/USB.h"
#include "VMManager.h"
#include "ps2/BiosTools.h"
#include "svnrev.h"
#include "common/FileSystem.h" #include "common/FileSystem.h"
#include "common/Console.h" #include "common/Console.h"
@ -34,25 +48,9 @@
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "common/Timer.h" #include "common/Timer.h"
#include "CDVD/CDVDcommon.h"
#include "CDVD/CDVDdiscReader.h"
#include "GS.h"
#include "GS/Renderers/Common/GSDevice.h"
#include "GS/Renderers/Common/GSTexture.h"
#include "Host.h"
#include "HostSettings.h"
#include "INISettingsInterface.h"
#include "MemoryCardFile.h"
#include "PAD/Host/PAD.h"
#include "ps2/BiosTools.h"
#include "Sio.h"
#include "USB/USB.h"
#include "VMManager.h"
#include "svnrev.h"
#include "imgui.h" #include "imgui.h"
#include "imgui_internal.h" #include "imgui_internal.h"
#include "IconsFontAwesome5.h"
#include "fmt/core.h" #include "fmt/core.h"
@ -62,10 +60,6 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#ifdef ENABLE_ACHIEVEMENTS
#include "Frontend/Achievements.h"
#endif
using ImGuiFullscreen::g_large_font; using ImGuiFullscreen::g_large_font;
using ImGuiFullscreen::g_layout_padding_left; using ImGuiFullscreen::g_layout_padding_left;
using ImGuiFullscreen::g_layout_padding_top; using ImGuiFullscreen::g_layout_padding_top;

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2021 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,35 +15,35 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "GS/Renderers/Common/GSDevice.h"
#include "Config.h"
#include "Counters.h"
#include "GS.h"
#include "GS/GS.h"
#include "Host.h"
#include "IconsFontAwesome5.h"
#include "ImGui/FullscreenUI.h"
#include "ImGui/ImGuiFullscreen.h"
#include "ImGui/ImGuiManager.h"
#include "ImGui/ImGuiOverlays.h"
#include "Input/InputManager.h"
#include "PerformanceMetrics.h"
#include "Recording/InputRecording.h"
#include "VMManager.h"
#include "common/StringUtil.h"
#include "common/Timer.h"
#include "fmt/core.h"
#include "imgui.h"
#include "imgui_internal.h"
#include <chrono> #include <chrono>
#include <cmath> #include <cmath>
#include <deque> #include <deque>
#include <mutex> #include <mutex>
#include <unordered_map> #include <unordered_map>
#include "fmt/core.h"
#include "common/StringUtil.h"
#include "common/Timer.h"
#include "imgui.h"
#include "imgui_internal.h"
#include "Config.h"
#include "Counters.h"
#include "Frontend/FullscreenUI.h"
#include "Frontend/ImGuiFullscreen.h"
#include "Frontend/ImGuiManager.h"
#include "Frontend/ImGuiOverlays.h"
#include "Frontend/InputManager.h"
#include "GS.h"
#include "GS/GS.h"
#include "GS/Renderers/Common/GSDevice.h"
#include "Host.h"
#include "IconsFontAwesome5.h"
#include "PerformanceMetrics.h"
#include "Recording/InputRecording.h"
#include "VMManager.h"
namespace ImGuiManager namespace ImGuiManager
{ {
static void SetStyle(); static void SetStyle();

View File

@ -15,6 +15,34 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Config.h"
#include "Counters.h"
#include "GS.h"
#include "GS/GS.h"
#include "GS/GSCapture.h"
#include "GS/GSVector.h"
#include "Host.h"
#include "IconsFontAwesome5.h"
#include "ImGui/FullscreenUI.h"
#include "ImGui/ImGuiFullscreen.h"
#include "ImGui/ImGuiManager.h"
#include "ImGui/ImGuiOverlays.h"
#include "Input/InputManager.h"
#include "PAD/Host/KeyStatus.h"
#include "PAD/Host/PAD.h"
#include "PerformanceMetrics.h"
#include "USB/USB.h"
#include "VMManager.h"
#include "pcsx2/Recording/InputRecording.h"
#include "common/Align.h"
#include "common/StringUtil.h"
#include "common/Timer.h"
#include "fmt/core.h"
#include "gsl/span"
#include "imgui.h"
#include <array> #include <array>
#include <chrono> #include <chrono>
#include <cmath> #include <cmath>
@ -23,35 +51,6 @@
#include <tuple> #include <tuple>
#include <unordered_map> #include <unordered_map>
#include "gsl/span"
#include "fmt/core.h"
#include "common/Align.h"
#include "common/StringUtil.h"
#include "common/Timer.h"
#include "imgui.h"
#include "Config.h"
#include "Counters.h"
#include "Frontend/FullscreenUI.h"
#include "Frontend/ImGuiManager.h"
#include "Frontend/ImGuiFullscreen.h"
#include "Frontend/ImGuiOverlays.h"
#include "Frontend/InputManager.h"
#include "GS.h"
#include "GS/GS.h"
#include "GS/GSCapture.h"
#include "GS/GSVector.h"
#include "Host.h"
#include "IconsFontAwesome5.h"
#include "PerformanceMetrics.h"
#include "PAD/Host/PAD.h"
#include "PAD/Host/KeyStatus.h"
#include "USB/USB.h"
#include "VMManager.h"
#include "pcsx2/Recording/InputRecording.h"
namespace ImGuiManager namespace ImGuiManager
{ {
static void FormatProcessorStat(std::string& text, double usage, double time); static void FormatProcessorStat(std::string& text, double usage, double time);

View File

@ -17,8 +17,8 @@
#define INITGUID #define INITGUID
#include "Frontend/DInputSource.h" #include "Input/DInputSource.h"
#include "Frontend/InputManager.h" #include "Input/InputManager.h"
#include "common/Assertions.h" #include "common/Assertions.h"
#include "common/Console.h" #include "common/Console.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"

View File

@ -17,7 +17,7 @@
#define DIRECTINPUT_VERSION 0x0800 #define DIRECTINPUT_VERSION 0x0800
#include "common/RedtapeWindows.h" #include "common/RedtapeWindows.h"
#include "common/RedtapeWilCom.h" #include "common/RedtapeWilCom.h"
#include "Frontend/InputSource.h" #include "Input/InputSource.h"
#include <array> #include <array>
#include <dinput.h> #include <dinput.h>
#include <functional> #include <functional>

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,14 +14,16 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Frontend/InputManager.h"
#include "Frontend/InputSource.h" #include "ImGui/ImGuiManager.h"
#include "Frontend/ImGuiManager.h" #include "Input/InputManager.h"
#include "Input/InputSource.h"
#include "PAD/Host/PAD.h" #include "PAD/Host/PAD.h"
#include "USB/USB.h" #include "USB/USB.h"
#include "VMManager.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "common/Timer.h" #include "common/Timer.h"
#include "VMManager.h"
#include "fmt/core.h" #include "fmt/core.h"
@ -1502,12 +1504,12 @@ void InputManager::UpdateInputSourceState(SettingsInterface& si, std::unique_loc
} }
#ifdef _WIN32 #ifdef _WIN32
#include "Frontend/DInputSource.h" #include "Input/DInputSource.h"
#include "Frontend/XInputSource.h" #include "Input/XInputSource.h"
#endif #endif
#ifdef SDL_BUILD #ifdef SDL_BUILD
#include "Frontend/SDLInputSource.h" #include "Input/SDLInputSource.h"
#endif #endif
void InputManager::ReloadSources(SettingsInterface& si, std::unique_lock<std::mutex>& settings_lock) void InputManager::ReloadSources(SettingsInterface& si, std::unique_lock<std::mutex>& settings_lock)

View File

@ -14,7 +14,7 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Frontend/InputSource.h" #include "Input/InputSource.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
InputSource::InputSource() = default; InputSource::InputSource() = default;

View File

@ -21,7 +21,7 @@
#include <vector> #include <vector>
#include "common/Pcsx2Defs.h" #include "common/Pcsx2Defs.h"
#include "Frontend/InputManager.h" #include "Input/InputManager.h"
class SettingsInterface; class SettingsInterface;

View File

@ -14,10 +14,9 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Frontend/SDLInputSource.h" #include "Input/SDLInputSource.h"
#include "Frontend/InputManager.h" #include "Input/InputManager.h"
#include "Host.h" #include "Host.h"
#include "HostSettings.h"
#include "common/Assertions.h" #include "common/Assertions.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "common/Console.h" #include "common/Console.h"

View File

@ -14,7 +14,7 @@
*/ */
#pragma once #pragma once
#include "Frontend/InputSource.h" #include "Input/InputSource.h"
#include "SDL.h" #include "SDL.h"
#include <array> #include <array>
#include <functional> #include <functional>

View File

@ -14,8 +14,8 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Frontend/XInputSource.h" #include "Input/XInputSource.h"
#include "Frontend/InputManager.h" #include "Input/InputManager.h"
#include "common/Assertions.h" #include "common/Assertions.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "common/Console.h" #include "common/Console.h"

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -14,8 +14,11 @@
*/ */
#pragma once #pragma once
#include "Frontend/InputSource.h"
#include "Input/InputSource.h"
#include "common/RedtapeWindows.h" #include "common/RedtapeWindows.h"
#include <Xinput.h> #include <Xinput.h>
#include <array> #include <array>
#include <functional> #include <functional>

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -16,8 +16,8 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "DebugTools/Debug.h" #include "DebugTools/Debug.h"
#include "Frontend/LogSink.h" #include "Host.h"
#include "HostSettings.h" #include "LogSink.h"
#include "common/Assertions.h" #include "common/Assertions.h"
#include "common/Console.h" #include "common/Console.h"
@ -31,8 +31,8 @@
#include "common/RedtapeWindows.h" #include "common/RedtapeWindows.h"
#endif #endif
#include "fmt/core.h"
#include <csignal> #include <csignal>
#include "fmt/core.h"
// Used on both Windows and Linux. // Used on both Windows and Linux.
#ifdef _WIN32 #ifdef _WIN32

View File

@ -109,13 +109,6 @@ void SysMtgsThread::ThreadEntryPoint()
{ {
Threading::SetNameOfCurrentThread("GS"); Threading::SetNameOfCurrentThread("GS");
if (GSinit() != 0)
{
Host::ReportErrorAsync("Error", "GSinit() failed.");
m_open_or_close_done.Post();
return;
}
m_thread_handle = Threading::ThreadHandle::GetForCallingThread(); m_thread_handle = Threading::ThreadHandle::GetForCallingThread();
for (;;) for (;;)

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2021 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,18 +15,17 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Host.h"
#include "Input/InputManager.h"
#include "PAD/Host/Global.h"
#include "PAD/Host/KeyStatus.h"
#include "PAD/Host/PAD.h"
#include "PAD/Host/StateManagement.h"
#include "common/FileSystem.h" #include "common/FileSystem.h"
#include "common/Path.h" #include "common/Path.h"
#include "common/StringUtil.h"
#include "common/SettingsInterface.h" #include "common/SettingsInterface.h"
#include "common/StringUtil.h"
#include "Frontend/InputManager.h"
#include "HostSettings.h"
#include "PAD/Host/Global.h"
#include "PAD/Host/PAD.h"
#include "PAD/Host/KeyStatus.h"
#include "PAD/Host/StateManagement.h"
#include <array> #include <array>

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2021 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -18,7 +18,7 @@
#include "PAD/Host/StateManagement.h" #include "PAD/Host/StateManagement.h"
#include "PAD/Host/KeyStatus.h" #include "PAD/Host/KeyStatus.h"
#include "PAD/Host/PAD.h" #include "PAD/Host/PAD.h"
#include "Frontend/InputManager.h" #include "Input/InputManager.h"
#include "Sio.h" #include "Sio.h"
template <class T> template <class T>

View File

@ -31,8 +31,6 @@
#include <objbase.h> #include <objbase.h>
#endif #endif
#include "HostSettings.h"
class Cubeb : public SndOutModule class Cubeb : public SndOutModule
{ {
private: private:

View File

@ -177,7 +177,7 @@ void SPU2::SetDeviceSampleRateMultiplier(double multiplier)
UpdateSampleRate(); UpdateSampleRate();
} }
bool SPU2::Initialize() void SPU2::Initialize()
{ {
pxAssert(regtable[0x400] == nullptr); pxAssert(regtable[0x400] == nullptr);
spu2regs = (s16*)malloc(0x010000); spu2regs = (s16*)malloc(0x010000);
@ -194,8 +194,8 @@ bool SPU2::Initialize()
if (!spu2regs || !_spu2mem || !pcm_cache_data) if (!spu2regs || !_spu2mem || !pcm_cache_data)
{ {
Console.Error("SPU2: Error allocating Memory"); // If these memory allocations fail, we have much bigger problems.
return false; pxFailRel("Failed to allocate SPU2 memory");
} }
// Patch up a copy of regtable that directly maps "nullptrs" to SPU2 memory. // Patch up a copy of regtable that directly maps "nullptrs" to SPU2 memory.
@ -212,7 +212,6 @@ bool SPU2::Initialize()
} }
InitADSR(); InitADSR();
return true;
} }

View File

@ -24,7 +24,7 @@ struct Pcsx2Config;
namespace SPU2 namespace SPU2
{ {
/// Initialization/cleanup, call at process startup/shutdown. /// Initialization/cleanup, call at process startup/shutdown.
bool Initialize(); void Initialize();
void Shutdown(); void Shutdown();
/// Open/close, call at VM startup/shutdown. /// Open/close, call at VM startup/shutdown.

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2010 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -13,9 +13,30 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Achievements.h"
#include "CDVD/CDVD.h"
#include "COP0.h"
#include "Cache.h"
#include "Config.h"
#include "Counters.h"
#include "DebugTools/Breakpoints.h"
#include "Elfheader.h"
#include "GS.h"
#include "GS/GS.h"
#include "Host.h"
#include "MTVU.h"
#include "PAD/Host/PAD.h"
#include "Patch.h"
#include "R3000A.h"
#include "SPU2/spu2.h"
#include "SaveState.h" #include "SaveState.h"
#include "StateWrapper.h"
#include "USB/USB.h"
#include "VMManager.h"
#include "VUmicro.h"
#include "ps2/BiosTools.h"
#include "common/FileSystem.h" #include "common/FileSystem.h"
#include "common/Path.h" #include "common/Path.h"
@ -24,31 +45,6 @@
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "common/ZipHelpers.h" #include "common/ZipHelpers.h"
#include "ps2/BiosTools.h"
#include "COP0.h"
#include "VUmicro.h"
#include "MTVU.h"
#include "Cache.h"
#include "Config.h"
#include "CDVD/CDVD.h"
#include "R3000A.h"
#include "Elfheader.h"
#include "Counters.h"
#include "Patch.h"
#include "DebugTools/Breakpoints.h"
#include "Host.h"
#include "GS.h"
#include "GS/GS.h"
#include "SPU2/spu2.h"
#include "StateWrapper.h"
#include "PAD/Host/PAD.h"
#include "USB/USB.h"
#include "VMManager.h"
#ifdef ENABLE_ACHIEVEMENTS
#include "Frontend/Achievements.h"
#endif
#include "fmt/core.h" #include "fmt/core.h"
#include <csetjmp> #include <csetjmp>

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2020 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -13,24 +13,26 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <stdexcept>
#include <cstdlib>
#include <string>
#include <cerrno>
#include <cassert>
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Host.h"
#include "StateWrapper.h"
#include "USB/USB.h"
#include "USB/deviceproxy.h"
#include "USB/qemu-usb/USBinternal.h"
#include "USB/qemu-usb/desc.h"
#include "common/SettingsInterface.h" #include "common/SettingsInterface.h"
#include "common/WindowInfo.h" #include "common/WindowInfo.h"
#include "USB.h"
#include "qemu-usb/USBinternal.h"
#include "qemu-usb/desc.h"
#include "deviceproxy.h"
#include "HostSettings.h"
#include "StateWrapper.h"
#include "fmt/format.h" #include "fmt/format.h"
#include <cassert>
#include <cerrno>
#include <cstdlib>
#include <stdexcept>
#include <string>
#define PSXCLK 36864000 /* 36.864 Mhz */ #define PSXCLK 36864000 /* 36.864 Mhz */
namespace USB namespace USB
@ -122,10 +124,9 @@ void USB::UpdateDevice(u32 port)
s_usb_device_proxy[port]->UpdateSettings(s_usb_device[port], *Host::GetSettingsInterface()); s_usb_device_proxy[port]->UpdateSettings(s_usb_device[port], *Host::GetSettingsInterface());
} }
s32 USBinit() void USBinit()
{ {
RegisterDevice::Register(); RegisterDevice::Register();
return 0;
} }
void USBshutdown() void USBshutdown()

View File

@ -93,7 +93,7 @@ struct WindowInfo;
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
s32 USBinit(); void USBinit();
void USBasync(u32 cycles); void USBasync(u32 cycles);
void USBshutdown(); void USBshutdown();
void USBclose(); void USBclose();

View File

@ -24,14 +24,14 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "USB/deviceproxy.h"
#include "USB/qemu-usb/desc.h"
#include "USB/qemu-usb/USBinternal.h"
#include "usb-hid.h"
#include "USB/USB.h"
#include "StateWrapper.h"
#include "Frontend/InputManager.h" #include "Input/InputManager.h"
#include "StateWrapper.h"
#include "USB/USB.h"
#include "USB/deviceproxy.h"
#include "USB/qemu-usb/USBinternal.h"
#include "USB/qemu-usb/desc.h"
#include "USB/usb-hid/usb-hid.h"
namespace usb_hid namespace usb_hid
{ {

View File

@ -14,17 +14,17 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "GS/GS.h"
#include "Input/InputManager.h"
#include "StateWrapper.h"
#include "USB/USB.h"
#include "USB/deviceproxy.h" #include "USB/deviceproxy.h"
#include "USB/qemu-usb/USBinternal.h"
#include "USB/qemu-usb/desc.h" #include "USB/qemu-usb/desc.h"
#include "USB/usb-lightgun/guncon2.h" #include "USB/usb-lightgun/guncon2.h"
#include "USB/qemu-usb/USBinternal.h"
#include "USB/USB.h"
#include "GS/GS.h"
#include "StateWrapper.h"
#include "VMManager.h" #include "VMManager.h"
#include "Frontend/InputManager.h"
#include <tuple> #include <tuple>
namespace usb_lightgun namespace usb_lightgun

View File

@ -14,10 +14,14 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Input/InputManager.h"
#include "USB/usb-pad/usb-pad-sdl-ff.h" #include "USB/usb-pad/usb-pad-sdl-ff.h"
#include "Frontend/InputManager.h"
#include "common/Console.h" #include "common/Console.h"
#include "fmt/format.h" #include "fmt/format.h"
#include <algorithm> #include <algorithm>
#ifdef SDL_BUILD #ifdef SDL_BUILD

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team * Copyright (C) 2002-2023 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -19,7 +19,7 @@
#ifdef SDL_BUILD #ifdef SDL_BUILD
#include "Frontend/SDLInputSource.h" #include "Input/SDLInputSource.h"
namespace usb_pad namespace usb_pad
{ {

View File

@ -16,20 +16,6 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "VMManager.h" #include "VMManager.h"
#include <atomic>
#include <sstream>
#include <mutex>
#include "common/Console.h"
#include "common/FileSystem.h"
#include "common/ScopedGuard.h"
#include "common/StringUtil.h"
#include "common/SettingsWrapper.h"
#include "common/Timer.h"
#include "common/Threading.h"
#include "fmt/core.h"
#include "Achievements.h" #include "Achievements.h"
#include "Counters.h" #include "Counters.h"
#include "CDVD/CDVD.h" #include "CDVD/CDVD.h"
@ -40,7 +26,6 @@
#include "GS.h" #include "GS.h"
#include "GSDumpReplayer.h" #include "GSDumpReplayer.h"
#include "Host.h" #include "Host.h"
#include "HostSettings.h"
#include "INISettingsInterface.h" #include "INISettingsInterface.h"
#include "IopBios.h" #include "IopBios.h"
#include "MTVU.h" #include "MTVU.h"
@ -55,15 +40,26 @@
#include "Sio.h" #include "Sio.h"
#include "ps2/BiosTools.h" #include "ps2/BiosTools.h"
#include "Recording/InputRecordingControls.h" #include "Recording/InputRecordingControls.h"
#include "DebugTools/MIPSAnalyst.h" #include "DebugTools/MIPSAnalyst.h"
#include "DebugTools/SymbolMap.h" #include "DebugTools/SymbolMap.h"
#include "IconsFontAwesome5.h"
#include "Recording/InputRecording.h" #include "Recording/InputRecording.h"
#include "common/Console.h"
#include "common/FileSystem.h"
#include "common/ScopedGuard.h"
#include "common/StringUtil.h"
#include "common/SettingsWrapper.h"
#include "common/Timer.h"
#include "common/Threading.h"
#include "common/emitter/tools.h" #include "common/emitter/tools.h"
#include "IconsFontAwesome5.h"
#include "fmt/core.h"
#include <atomic>
#include <sstream>
#include <mutex>
#ifdef _M_X86 #ifdef _M_X86
#include "common/emitter/x86_intrin.h" #include "common/emitter/x86_intrin.h"
#endif #endif
@ -266,23 +262,9 @@ bool VMManager::Internal::InitializeGlobals()
x86caps.CalculateMHz(); x86caps.CalculateMHz();
SysLogMachineCaps(); SysLogMachineCaps();
if (GSinit() != 0) GSinit();
{ SPU2::Initialize();
Host::ReportErrorAsync("Error", "Failed to initialize GS (GSinit())."); USBinit();
return false;
}
if (!SPU2::Initialize())
{
Host::ReportErrorAsync("Error", "Failed to initialize SPU2.");
return false;
}
if (USBinit() != 0)
{
Host::ReportErrorAsync("Error", "Failed to initialize USB (USBinit())");
return false;
}
return true; return true;
} }

View File

@ -102,7 +102,6 @@
<None Include="..\bin\resources\shaders\dx11\shadeboost.fx" /> <None Include="..\bin\resources\shaders\dx11\shadeboost.fx" />
<None Include="..\bin\resources\shaders\dx11\tfx.fx" /> <None Include="..\bin\resources\shaders\dx11\tfx.fx" />
<None Include="GS\Renderers\Vulkan\VKEntryPoints.inl" /> <None Include="GS\Renderers\Vulkan\VKEntryPoints.inl" />
<None Include="Utilities\folderdesc.txt" />
<None Include="Docs\License.txt" /> <None Include="Docs\License.txt" />
<None Include="ps2\eeHwTraceLog.inl" /> <None Include="ps2\eeHwTraceLog.inl" />
<None Include="x86\microVU_Alloc.inl" /> <None Include="x86\microVU_Alloc.inl" />
@ -121,6 +120,7 @@
<!-- Generate Recording GUI Image Headers --> <!-- Generate Recording GUI Image Headers -->
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="Achievements.cpp" />
<ClCompile Include="CDVD\BlockdumpFileReader.cpp" /> <ClCompile Include="CDVD\BlockdumpFileReader.cpp" />
<ClCompile Include="CDVD\CDVDdiscReader.cpp" /> <ClCompile Include="CDVD\CDVDdiscReader.cpp" />
<ClCompile Include="CDVD\CDVDdiscThread.cpp" /> <ClCompile Include="CDVD\CDVDdiscThread.cpp" />
@ -139,6 +139,7 @@
</ClCompile> </ClCompile>
<ClCompile Include="CDVD\Windows\DriveUtility.cpp" /> <ClCompile Include="CDVD\Windows\DriveUtility.cpp" />
<ClCompile Include="CDVD\Windows\IOCtlSrc.cpp" /> <ClCompile Include="CDVD\Windows\IOCtlSrc.cpp" />
<ClCompile Include="CommonHost.cpp" />
<ClCompile Include="DebugTools\Breakpoints.cpp" /> <ClCompile Include="DebugTools\Breakpoints.cpp" />
<ClCompile Include="DebugTools\DebugInterface.cpp" /> <ClCompile Include="DebugTools\DebugInterface.cpp" />
<ClCompile Include="DebugTools\DisassemblyManager.cpp" /> <ClCompile Include="DebugTools\DisassemblyManager.cpp" />
@ -193,14 +194,7 @@
<ClCompile Include="DEV9\sockets.cpp" /> <ClCompile Include="DEV9\sockets.cpp" />
<ClCompile Include="DEV9\net.cpp" /> <ClCompile Include="DEV9\net.cpp" />
<ClCompile Include="DEV9\Win32\tap-win32.cpp" /> <ClCompile Include="DEV9\Win32\tap-win32.cpp" />
<ClCompile Include="Frontend\CommonHost.cpp" /> <ClCompile Include="GameList.cpp" />
<ClCompile Include="Frontend\CommonHotkeys.cpp" />
<ClCompile Include="Frontend\DInputSource.cpp" />
<ClCompile Include="Frontend\FullscreenUI.cpp" />
<ClCompile Include="Frontend\GameList.cpp" />
<ClCompile Include="Frontend\ImGuiFullscreen.cpp" />
<ClCompile Include="Frontend\ImGuiManager.cpp" />
<ClCompile Include="Frontend\ImGuiOverlays.cpp" />
<ClCompile Include="GS\Renderers\DX11\D3D11ShaderCache.cpp" /> <ClCompile Include="GS\Renderers\DX11\D3D11ShaderCache.cpp" />
<ClCompile Include="GS\Renderers\DX12\D3D12Builders.cpp" /> <ClCompile Include="GS\Renderers\DX12\D3D12Builders.cpp" />
<ClCompile Include="GS\Renderers\DX12\D3D12Context.cpp" /> <ClCompile Include="GS\Renderers\DX12\D3D12Context.cpp" />
@ -220,14 +214,12 @@
<ClCompile Include="GS\Renderers\Vulkan\VKSwapChain.cpp" /> <ClCompile Include="GS\Renderers\Vulkan\VKSwapChain.cpp" />
<ClCompile Include="GS\Renderers\Vulkan\VKUtil.cpp" /> <ClCompile Include="GS\Renderers\Vulkan\VKUtil.cpp" />
<ClCompile Include="GS\Renderers\Vulkan\vk_mem_alloc.cpp" /> <ClCompile Include="GS\Renderers\Vulkan\vk_mem_alloc.cpp" />
<ClCompile Include="Hotkeys.cpp" />
<ClCompile Include="ImGui\FullscreenUI.cpp" />
<ClCompile Include="ImGui\ImGuiFullscreen.cpp" />
<ClCompile Include="ImGui\ImGuiManager.cpp" />
<ClCompile Include="ImGui\ImGuiOverlays.cpp" />
<ClCompile Include="INISettingsInterface.cpp" /> <ClCompile Include="INISettingsInterface.cpp" />
<ClCompile Include="Frontend\InputManager.cpp" />
<ClCompile Include="Frontend\InputSource.cpp" />
<ClCompile Include="Frontend\LayeredSettingsInterface.cpp" />
<ClCompile Include="Frontend\LogSink.cpp" />
<ClCompile Include="Frontend\Achievements.cpp" />
<ClCompile Include="Frontend\SDLInputSource.cpp" />
<ClCompile Include="Frontend\XInputSource.cpp" />
<ClCompile Include="GameDatabase.cpp" /> <ClCompile Include="GameDatabase.cpp" />
<ClCompile Include="Gif_Logger.cpp" /> <ClCompile Include="Gif_Logger.cpp" />
<ClCompile Include="Gif_Unit.cpp" /> <ClCompile Include="Gif_Unit.cpp" />
@ -240,8 +232,14 @@
<ClCompile Include="GS\Renderers\Vulkan\GSDeviceVK.cpp" /> <ClCompile Include="GS\Renderers\Vulkan\GSDeviceVK.cpp" />
<ClCompile Include="GS\Renderers\Vulkan\GSTextureVK.cpp" /> <ClCompile Include="GS\Renderers\Vulkan\GSTextureVK.cpp" />
<ClCompile Include="Host.cpp" /> <ClCompile Include="Host.cpp" />
<ClCompile Include="Frontend\HostSettings.cpp" /> <ClCompile Include="Input\DInputSource.cpp" />
<ClCompile Include="Input\InputManager.cpp" />
<ClCompile Include="Input\InputSource.cpp" />
<ClCompile Include="Input\SDLInputSource.cpp" />
<ClCompile Include="Input\XInputSource.cpp" />
<ClCompile Include="IopGte.cpp" /> <ClCompile Include="IopGte.cpp" />
<ClCompile Include="LayeredSettingsInterface.cpp" />
<ClCompile Include="LogSink.cpp" />
<ClCompile Include="MemoryCardProtocol.cpp" /> <ClCompile Include="MemoryCardProtocol.cpp" />
<ClCompile Include="MultitapProtocol.cpp" /> <ClCompile Include="MultitapProtocol.cpp" />
<ClCompile Include="PAD\Host\KeyStatus.cpp" /> <ClCompile Include="PAD\Host\KeyStatus.cpp" />
@ -501,6 +499,7 @@
<ClInclude Include="CDVD\GzippedFileReader.h" /> <ClInclude Include="CDVD\GzippedFileReader.h" />
<ClInclude Include="CDVD\ThreadedFileReader.h" /> <ClInclude Include="CDVD\ThreadedFileReader.h" />
<ClInclude Include="CDVD\zlib_indexed.h" /> <ClInclude Include="CDVD\zlib_indexed.h" />
<ClInclude Include="CommonHost.h" />
<ClInclude Include="DebugTools\Breakpoints.h" /> <ClInclude Include="DebugTools\Breakpoints.h" />
<ClInclude Include="DebugTools\DebugInterface.h" /> <ClInclude Include="DebugTools\DebugInterface.h" />
<ClInclude Include="DebugTools\DisassemblyManager.h" /> <ClInclude Include="DebugTools\DisassemblyManager.h" />
@ -552,13 +551,7 @@
<ClInclude Include="DEV9\ThreadSafeMap.h" /> <ClInclude Include="DEV9\ThreadSafeMap.h" />
<ClInclude Include="DEV9\Win32\pcap_io_win32_funcs.h" /> <ClInclude Include="DEV9\Win32\pcap_io_win32_funcs.h" />
<ClInclude Include="DEV9\Win32\tap.h" /> <ClInclude Include="DEV9\Win32\tap.h" />
<ClInclude Include="Frontend\CommonHost.h" /> <ClInclude Include="GameList.h" />
<ClInclude Include="Frontend\DInputSource.h" />
<ClInclude Include="Frontend\FullscreenUI.h" />
<ClInclude Include="Frontend\GameList.h" />
<ClInclude Include="Frontend\ImGuiFullscreen.h" />
<ClInclude Include="Frontend\ImGuiManager.h" />
<ClInclude Include="Frontend\ImGuiOverlays.h" />
<ClInclude Include="GS\Renderers\DX11\D3D11ShaderCache.h" /> <ClInclude Include="GS\Renderers\DX11\D3D11ShaderCache.h" />
<ClInclude Include="GS\Renderers\DX12\D3D12Builders.h" /> <ClInclude Include="GS\Renderers\DX12\D3D12Builders.h" />
<ClInclude Include="GS\Renderers\DX12\D3D12Context.h" /> <ClInclude Include="GS\Renderers\DX12\D3D12Context.h" />
@ -579,14 +572,11 @@
<ClInclude Include="GS\Renderers\Vulkan\VKStreamBuffer.h" /> <ClInclude Include="GS\Renderers\Vulkan\VKStreamBuffer.h" />
<ClInclude Include="GS\Renderers\Vulkan\VKSwapChain.h" /> <ClInclude Include="GS\Renderers\Vulkan\VKSwapChain.h" />
<ClInclude Include="GS\Renderers\Vulkan\VKUtil.h" /> <ClInclude Include="GS\Renderers\Vulkan\VKUtil.h" />
<ClInclude Include="ImGui\FullscreenUI.h" />
<ClInclude Include="ImGui\ImGuiFullscreen.h" />
<ClInclude Include="ImGui\ImGuiManager.h" />
<ClInclude Include="ImGui\ImGuiOverlays.h" />
<ClInclude Include="INISettingsInterface.h" /> <ClInclude Include="INISettingsInterface.h" />
<ClInclude Include="Frontend\InputManager.h" />
<ClInclude Include="Frontend\InputSource.h" />
<ClInclude Include="Frontend\LayeredSettingsInterface.h" />
<ClInclude Include="Frontend\LogSink.h" />
<ClInclude Include="Frontend\Achievements.h" />
<ClInclude Include="Frontend\SDLInputSource.h" />
<ClInclude Include="Frontend\XInputSource.h" />
<ClInclude Include="GameDatabase.h" /> <ClInclude Include="GameDatabase.h" />
<ClInclude Include="Gif_Unit.h" /> <ClInclude Include="Gif_Unit.h" />
<ClInclude Include="GSDumpReplayer.h" /> <ClInclude Include="GSDumpReplayer.h" />
@ -597,9 +587,15 @@
<ClInclude Include="GS\Renderers\Vulkan\GSDeviceVK.h" /> <ClInclude Include="GS\Renderers\Vulkan\GSDeviceVK.h" />
<ClInclude Include="GS\Renderers\Vulkan\GSTextureVK.h" /> <ClInclude Include="GS\Renderers\Vulkan\GSTextureVK.h" />
<ClInclude Include="Host.h" /> <ClInclude Include="Host.h" />
<ClInclude Include="HostSettings.h" /> <ClInclude Include="Input\DInputSource.h" />
<ClInclude Include="Input\InputManager.h" />
<ClInclude Include="Input\InputSource.h" />
<ClInclude Include="Input\SDLInputSource.h" />
<ClInclude Include="Input\XInputSource.h" />
<ClInclude Include="IopGte.h" /> <ClInclude Include="IopGte.h" />
<ClInclude Include="IPU\mpeg2_vlc.h" /> <ClInclude Include="IPU\mpeg2_vlc.h" />
<ClInclude Include="LayeredSettingsInterface.h" />
<ClInclude Include="LogSink.h" />
<ClInclude Include="MemoryCardProtocol.h" /> <ClInclude Include="MemoryCardProtocol.h" />
<ClInclude Include="MultitapProtocol.h" /> <ClInclude Include="MultitapProtocol.h" />
<ClInclude Include="PAD\Host\Global.h" /> <ClInclude Include="PAD\Host\Global.h" />

View File

@ -205,9 +205,6 @@
<Filter Include="System\Ps2\GS\GIF"> <Filter Include="System\Ps2\GS\GIF">
<UniqueIdentifier>{78f5077b-255e-435e-9a51-352171dfaee8}</UniqueIdentifier> <UniqueIdentifier>{78f5077b-255e-435e-9a51-352171dfaee8}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="Host">
<UniqueIdentifier>{65f21394-287a-471b-a0c1-d8f0d5d95a81}</UniqueIdentifier>
</Filter>
<Filter Include="System\Ps2\GS\Renderers\Vulkan"> <Filter Include="System\Ps2\GS\Renderers\Vulkan">
<UniqueIdentifier>{98829aa9-bb81-4564-bd6e-128719c4faa0}</UniqueIdentifier> <UniqueIdentifier>{98829aa9-bb81-4564-bd6e-128719c4faa0}</UniqueIdentifier>
</Filter> </Filter>
@ -268,11 +265,14 @@
<Filter Include="System\Ps2\USB\usb-lightgun"> <Filter Include="System\Ps2\USB\usb-lightgun">
<UniqueIdentifier>{b8542664-8208-48ad-bd47-425a316f293c}</UniqueIdentifier> <UniqueIdentifier>{b8542664-8208-48ad-bd47-425a316f293c}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="Misc\Input">
<UniqueIdentifier>{aa9a3402-0b59-4e60-8d53-b77f509bf081}</UniqueIdentifier>
</Filter>
<Filter Include="Misc\ImGui">
<UniqueIdentifier>{8a23ff29-0a43-4d5b-8c6c-a7722871058a}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Utilities\folderdesc.txt">
<Filter>Misc</Filter>
</None>
<None Include="Docs\License.txt"> <None Include="Docs\License.txt">
<Filter>Docs</Filter> <Filter>Docs</Filter>
</None> </None>
@ -1136,42 +1136,12 @@
<ClCompile Include="SPU2\SndOut_Cubeb.cpp"> <ClCompile Include="SPU2\SndOut_Cubeb.cpp">
<Filter>System\Ps2\SPU2</Filter> <Filter>System\Ps2\SPU2</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Frontend\ImGuiManager.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Host.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="GS\Renderers\Vulkan\GSTextureVK.cpp"> <ClCompile Include="GS\Renderers\Vulkan\GSTextureVK.cpp">
<Filter>System\Ps2\GS\Renderers\Vulkan</Filter> <Filter>System\Ps2\GS\Renderers\Vulkan</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GS\Renderers\Vulkan\GSDeviceVK.cpp"> <ClCompile Include="GS\Renderers\Vulkan\GSDeviceVK.cpp">
<Filter>System\Ps2\GS\Renderers\Vulkan</Filter> <Filter>System\Ps2\GS\Renderers\Vulkan</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Frontend\GameList.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="INISettingsInterface.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\InputManager.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\InputSource.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\LayeredSettingsInterface.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\SDLInputSource.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\XInputSource.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\HostSettings.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="VMManager.cpp"> <ClCompile Include="VMManager.cpp">
<Filter>System</Filter> <Filter>System</Filter>
</ClCompile> </ClCompile>
@ -1184,9 +1154,6 @@
<ClCompile Include="PAD\Host\StateManagement.cpp"> <ClCompile Include="PAD\Host\StateManagement.cpp">
<Filter>System\Ps2\PAD</Filter> <Filter>System\Ps2\PAD</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="windows\Optimus.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="GS\Renderers\HW\GSTextureReplacements.cpp"> <ClCompile Include="GS\Renderers\HW\GSTextureReplacements.cpp">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter> <Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClCompile> </ClCompile>
@ -1217,30 +1184,6 @@
<ClCompile Include="Recording\Utilities\InputRecordingLogger.cpp"> <ClCompile Include="Recording\Utilities\InputRecordingLogger.cpp">
<Filter>Tools\Input Recording\Utilities</Filter> <Filter>Tools\Input Recording\Utilities</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Frontend\LogSink.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\ImGuiFullscreen.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\FullscreenUI.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\CommonHost.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\CommonHotkeys.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\Achievements.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\ImGuiOverlays.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="Frontend\DInputSource.cpp">
<Filter>Host</Filter>
</ClCompile>
<ClCompile Include="MemoryCardProtocol.cpp"> <ClCompile Include="MemoryCardProtocol.cpp">
<Filter>System\Ps2\Iop</Filter> <Filter>System\Ps2\Iop</Filter>
</ClCompile> </ClCompile>
@ -1415,6 +1358,60 @@
<ClCompile Include="PerformanceMetrics.cpp"> <ClCompile Include="PerformanceMetrics.cpp">
<Filter>Tools</Filter> <Filter>Tools</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Input\InputSource.cpp">
<Filter>Misc\Input</Filter>
</ClCompile>
<ClCompile Include="Input\SDLInputSource.cpp">
<Filter>Misc\Input</Filter>
</ClCompile>
<ClCompile Include="Input\InputManager.cpp">
<Filter>Misc\Input</Filter>
</ClCompile>
<ClCompile Include="Input\DInputSource.cpp">
<Filter>Misc\Input</Filter>
</ClCompile>
<ClCompile Include="Input\XInputSource.cpp">
<Filter>Misc\Input</Filter>
</ClCompile>
<ClCompile Include="Host.cpp">
<Filter>System</Filter>
</ClCompile>
<ClCompile Include="LogSink.cpp">
<Filter>Misc</Filter>
</ClCompile>
<ClCompile Include="windows\Optimus.cpp">
<Filter>Misc</Filter>
</ClCompile>
<ClCompile Include="GameList.cpp">
<Filter>Misc</Filter>
</ClCompile>
<ClCompile Include="Achievements.cpp">
<Filter>Tools</Filter>
</ClCompile>
<ClCompile Include="CommonHost.cpp">
<Filter>Misc</Filter>
</ClCompile>
<ClCompile Include="Hotkeys.cpp">
<Filter>Misc</Filter>
</ClCompile>
<ClCompile Include="INISettingsInterface.cpp">
<Filter>Misc</Filter>
</ClCompile>
<ClCompile Include="LayeredSettingsInterface.cpp">
<Filter>Misc</Filter>
</ClCompile>
<ClCompile Include="ImGui\ImGuiManager.cpp">
<Filter>Misc\ImGui</Filter>
</ClCompile>
<ClCompile Include="ImGui\ImGuiOverlays.cpp">
<Filter>Misc\ImGui</Filter>
</ClCompile>
<ClCompile Include="ImGui\FullscreenUI.cpp">
<Filter>Misc\ImGui</Filter>
</ClCompile>
<ClCompile Include="ImGui\ImGuiFullscreen.cpp">
<Filter>Misc\ImGui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="Patch.h"> <ClInclude Include="Patch.h">
@ -2089,12 +2086,6 @@
<ClInclude Include="PerformanceMetrics.h"> <ClInclude Include="PerformanceMetrics.h">
<Filter>System\Include</Filter> <Filter>System\Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Host.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="Frontend\ImGuiManager.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="GS\Renderers\Vulkan\GSTextureVK.h"> <ClInclude Include="GS\Renderers\Vulkan\GSTextureVK.h">
<Filter>System\Ps2\GS\Renderers\Vulkan</Filter> <Filter>System\Ps2\GS\Renderers\Vulkan</Filter>
</ClInclude> </ClInclude>
@ -2102,30 +2093,6 @@
<Filter>System\Ps2\GS\Renderers\Vulkan</Filter> <Filter>System\Ps2\GS\Renderers\Vulkan</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="GS.h" /> <ClInclude Include="GS.h" />
<ClInclude Include="Frontend\GameList.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="INISettingsInterface.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="Frontend\InputManager.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="Frontend\InputSource.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="Frontend\LayeredSettingsInterface.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="Frontend\SDLInputSource.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="Frontend\XInputSource.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="HostSettings.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="VMManager.h"> <ClInclude Include="VMManager.h">
<Filter>System</Filter> <Filter>System</Filter>
</ClInclude> </ClInclude>
@ -2168,30 +2135,9 @@
<ClInclude Include="Recording\Utilities\InputRecordingLogger.h"> <ClInclude Include="Recording\Utilities\InputRecordingLogger.h">
<Filter>Tools\Input Recording\Utilities</Filter> <Filter>Tools\Input Recording\Utilities</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Frontend\LogSink.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="Frontend\ImGuiFullscreen.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="Frontend\FullscreenUI.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="Frontend\CommonHost.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="Frontend\Achievements.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="ShaderCacheVersion.h"> <ClInclude Include="ShaderCacheVersion.h">
<Filter>System\Include</Filter> <Filter>System\Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Frontend\ImGuiOverlays.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="Frontend\DInputSource.h">
<Filter>Host</Filter>
</ClInclude>
<ClInclude Include="SioTypes.h"> <ClInclude Include="SioTypes.h">
<Filter>System\Ps2\Iop</Filter> <Filter>System\Ps2\Iop</Filter>
</ClInclude> </ClInclude>
@ -2372,6 +2318,51 @@
<ClInclude Include="Achievements.h"> <ClInclude Include="Achievements.h">
<Filter>Misc</Filter> <Filter>Misc</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Input\InputManager.h">
<Filter>Misc\Input</Filter>
</ClInclude>
<ClInclude Include="Input\InputSource.h">
<Filter>Misc\Input</Filter>
</ClInclude>
<ClInclude Include="Input\SDLInputSource.h">
<Filter>Misc\Input</Filter>
</ClInclude>
<ClInclude Include="Input\DInputSource.h">
<Filter>Misc\Input</Filter>
</ClInclude>
<ClInclude Include="Input\XInputSource.h">
<Filter>Misc\Input</Filter>
</ClInclude>
<ClInclude Include="Host.h">
<Filter>System</Filter>
</ClInclude>
<ClInclude Include="LogSink.h">
<Filter>Misc</Filter>
</ClInclude>
<ClInclude Include="GameList.h">
<Filter>Misc</Filter>
</ClInclude>
<ClInclude Include="CommonHost.h">
<Filter>Misc</Filter>
</ClInclude>
<ClInclude Include="INISettingsInterface.h">
<Filter>Misc</Filter>
</ClInclude>
<ClInclude Include="LayeredSettingsInterface.h">
<Filter>Misc</Filter>
</ClInclude>
<ClInclude Include="ImGui\ImGuiManager.h">
<Filter>Misc\ImGui</Filter>
</ClInclude>
<ClInclude Include="ImGui\ImGuiOverlays.h">
<Filter>Misc\ImGui</Filter>
</ClInclude>
<ClInclude Include="ImGui\FullscreenUI.h">
<Filter>Misc\ImGui</Filter>
</ClInclude>
<ClInclude Include="ImGui\ImGuiFullscreen.h">
<Filter>Misc\ImGui</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<CustomBuildStep Include="rdebug\deci2.h"> <CustomBuildStep Include="rdebug\deci2.h">

View File

@ -13,18 +13,14 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "pcsx2/Frontend/CommonHost.h" #include "pcsx2/CommonHost.h"
#include "pcsx2/Frontend/ImGuiManager.h" #include "pcsx2/ImGui/ImGuiManager.h"
#include "pcsx2/Frontend/InputManager.h" #include "pcsx2/Input/InputManager.h"
#include "pcsx2/GS.h" #include "pcsx2/GS.h"
#include "pcsx2/GS/GS.h" #include "pcsx2/GS/GS.h"
#include "pcsx2/Host.h" #include "pcsx2/Host.h"
#include "pcsx2/HostSettings.h"
#include "pcsx2/VMManager.h" #include "pcsx2/VMManager.h"
#include "pcsx2/Achievements.h"
#ifdef ENABLE_ACHIEVEMENTS
#include "pcsx2/Frontend/Achievements.h"
#endif
void Host::CommitBaseSettingChanges() void Host::CommitBaseSettingChanges()
{ {