From cfe52ff7fddc1e05d50bcb5fd5c35fd8fb5d8bea Mon Sep 17 00:00:00 2001 From: TheRhysWyrill Date: Sun, 9 Jul 2023 18:28:14 +0100 Subject: [PATCH] Rebase to latest, fixed load state hotkey error, increment version. --- common/vsprops/common.props | 2 +- pcsx2-winrt/App.cpp | 39 +++++++++++++++++++++----------- pcsx2-winrt/Package.appxmanifest | 2 +- pcsx2-winrt/pcsx2-winrt.vcxproj | 1 - pcsx2/Hotkeys.cpp | 2 +- pcsx2/ImGui/FullscreenUI.cpp | 2 +- 6 files changed, 30 insertions(+), 18 deletions(-) diff --git a/common/vsprops/common.props b/common/vsprops/common.props index b55b893087f40..d90c0348ed6c0 100644 --- a/common/vsprops/common.props +++ b/common/vsprops/common.props @@ -54,7 +54,7 @@ comctl32.lib;ws2_32.lib;shlwapi.lib;winmm.lib;rpcrt4.lib;iphlpapi.lib;dsound.lib;%(AdditionalDependencies) - dxguid.lib;dinput8.lib;hid.lib;PowrProf.lib;d3dcompiler.lib;d3d11.lib;d3d12.lib;dxgi.lib;strmiids.lib;opengl32.lib;comsuppw.lib;OneCore.lib;dwmapi.lib;%(AdditionalDependencies) + dxguid.lib;dinput8.lib;hid.lib;PowrProf.lib;d3dcompiler.lib;d3d11.lib;d3d12.lib;dxgi.lib;strmiids.lib;opengl32.lib;OneCore.lib;dwmapi.lib;%(AdditionalDependencies) true Windows diff --git a/pcsx2-winrt/App.cpp b/pcsx2-winrt/App.cpp index d9426a46a19c3..92bd5955d4871 100644 --- a/pcsx2-winrt/App.cpp +++ b/pcsx2-winrt/App.cpp @@ -27,7 +27,6 @@ #include "common/Assertions.h" #include "common/Console.h" -#include "common/Exceptions.h" #include "common/FileSystem.h" #include "common/MemorySettingsInterface.h" #include "common/Path.h" @@ -38,11 +37,11 @@ #include "pcsx2/ImGui/ImGuiManager.h" #include "pcsx2/Input/InputManager.h" #include "pcsx2/LogSink.h" -#include "pcsx2/GS.h" #include "pcsx2/GS/GS.h" #include "pcsx2/GSDumpReplayer.h" #include "pcsx2/Host.h" #include "pcsx2/INISettingsInterface.h" +#include "pcsx2/MTGS.h" #include "pcsx2/PAD/Host/PAD.h" #include "pcsx2/PerformanceMetrics.h" #include "pcsx2/VMManager.h" @@ -78,7 +77,6 @@ namespace WinRTHost } // namespace WinRTHost static std::unique_ptr s_settings_interface; -alignas(16) static SysMtgsThread s_mtgs_thread; const IConsoleWriter* PatchesCon = &Console; BEGIN_HOTKEY_LIST(g_host_hotkeys) @@ -277,8 +275,8 @@ void Host::OnVMResumed() { } -void Host::OnGameChanged(const std::string& disc_path, const std::string& elf_override, const std::string& game_serial, - const std::string& game_name, u32 game_crc) +void Host::OnGameChanged(const std::string& title, const std::string& elf_override, const std::string& disc_path, + const std::string& disc_serial, u32 disc_crc, u32 current_crc) { } @@ -324,6 +322,14 @@ void Host::SetFullscreen(bool enabled) { } +void Host::OnCaptureStarted(const std::string& filename) +{ +} + +void Host::OnCaptureStopped() +{ +} + void Host::RequestExit(bool allow_confirm) { s_running = false; @@ -350,11 +356,6 @@ std::optional InputManager::ConvertHostKeyboardCodeToString(u32 cod return std::nullopt; } -SysMtgsThread& GetMTGS() -{ - return s_mtgs_thread; -} - std::optional WinRTHost::GetPlatformWindowInfo() { WindowInfo wi; @@ -396,6 +397,18 @@ void Host::VSyncOnCPUThread() WinRTHost::ProcessEventQueue(); } +s32 Host::Internal::GetTranslatedStringImpl( + const std::string_view& context, const std::string_view& msg, char* tbuf, size_t tbuf_space) +{ + if (msg.size() > tbuf_space) + return -1; + else if (msg.empty()) + return 0; + + std::memcpy(tbuf, msg.data(), msg.size()); + return static_cast(msg.size()); +} + void WinRTHost::ProcessEventQueue() { if (!m_event_queue.empty()) { @@ -514,7 +527,7 @@ struct App : implements VMManager::SetState(VMState::Running); - GetMTGS().WaitForOpen(); + MTGS::WaitForOpen(); InputManager::ReloadDevices(); }); } @@ -547,7 +560,7 @@ struct App : implements GameList::Refresh(false); ImGuiManager::InitializeFullscreenUI(); - GetMTGS().WaitForOpen(); + MTGS::WaitForOpen(); } window.Dispatcher().RunAsync(CoreDispatcherPriority::Normal, []() { @@ -623,7 +636,7 @@ struct App : implements void OnKeyInput(const IInspectable&, const winrt::Windows::UI::Core::CharacterReceivedEventArgs& args) { if (ImGuiManager::WantsTextInput()) { - GetMTGS().RunOnGSThread([c = args.KeyCode()]() { + MTGS::RunOnGSThread([c = args.KeyCode()]() { if (!ImGui::GetCurrentContext()) return; diff --git a/pcsx2-winrt/Package.appxmanifest b/pcsx2-winrt/Package.appxmanifest index 8682500b27106..e0098df1fc7fa 100644 --- a/pcsx2-winrt/Package.appxmanifest +++ b/pcsx2-winrt/Package.appxmanifest @@ -3,7 +3,7 @@ + Version="2.0.3.0" /> pcsx2-winrt diff --git a/pcsx2-winrt/pcsx2-winrt.vcxproj b/pcsx2-winrt/pcsx2-winrt.vcxproj index 2861980f7ed2f..a3ca496863b8d 100644 --- a/pcsx2-winrt/pcsx2-winrt.vcxproj +++ b/pcsx2-winrt/pcsx2-winrt.vcxproj @@ -64,7 +64,6 @@ True pcsx2-winrt_TemporaryKey.pfx SHA256 - D:\TheRhysWyrill\Downloads\Emu Stuff\AppPackages\ False diff --git a/pcsx2/Hotkeys.cpp b/pcsx2/Hotkeys.cpp index 42b56c27889f2..cfa502c370977 100644 --- a/pcsx2/Hotkeys.cpp +++ b/pcsx2/Hotkeys.cpp @@ -267,7 +267,7 @@ DEFINE_HOTKEY("SaveStateToSlot", TRANSLATE_NOOP("Hotkeys", "Save States"), DEFINE_HOTKEY("LoadStateFromSlot", TRANSLATE_NOOP("Hotkeys", "Save States"), TRANSLATE_NOOP("Hotkeys", "Load State From Selected Slot"), [](s32 pressed) { if (!pressed && VMManager::HasValidVM()) - Host::RunOnCPUThread([]() { HotkeyLoadStateSlot(s_current_save_slot); }); + Host::RunOnCPUThread([]() { VMManager::LoadStateFromSlot(s_current_save_slot); }); }) #define DEFINE_HOTKEY_SAVESTATE_X(slotnum, title) \ diff --git a/pcsx2/ImGui/FullscreenUI.cpp b/pcsx2/ImGui/FullscreenUI.cpp index 01fbb05811d11..0ce4cc6b2e2b8 100644 --- a/pcsx2/ImGui/FullscreenUI.cpp +++ b/pcsx2/ImGui/FullscreenUI.cpp @@ -1112,7 +1112,7 @@ void FullscreenUI::DrawLandingWindow() ImGui::Image(s_app_icon_texture->GetNativeHandle(), ImVec2(image_size, image_size)); } - const char version_txt[] = "v2.0.2"; + const char version_txt[] = "v2.0.3"; ImGui::PushFont(g_medium_font); ImGui::SetCursorPos( ImVec2(LayoutScale(10.0f), ImGui::GetWindowHeight() - LayoutScale(20.0f)));