Skip to content

Commit

Permalink
Rebase to latest, fixed load state hotkey error, increment version.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRhysWyrill committed Jul 9, 2023
1 parent ff01148 commit cfe52ff
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 18 deletions.
2 changes: 1 addition & 1 deletion common/vsprops/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</ClCompile>
<Link>
<AdditionalDependencies>comctl32.lib;ws2_32.lib;shlwapi.lib;winmm.lib;rpcrt4.lib;iphlpapi.lib;dsound.lib;%(AdditionalDependencies)</AdditionalDependencies>
<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)</AdditionalDependencies>
<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)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
Expand Down
39 changes: 26 additions & 13 deletions pcsx2-winrt/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -78,7 +77,6 @@ namespace WinRTHost
} // namespace WinRTHost

static std::unique_ptr<INISettingsInterface> s_settings_interface;
alignas(16) static SysMtgsThread s_mtgs_thread;

const IConsoleWriter* PatchesCon = &Console;
BEGIN_HOTKEY_LIST(g_host_hotkeys)
Expand Down Expand Up @@ -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)
{
}

Expand Down Expand Up @@ -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;
Expand All @@ -350,11 +356,6 @@ std::optional<std::string> InputManager::ConvertHostKeyboardCodeToString(u32 cod
return std::nullopt;
}

SysMtgsThread& GetMTGS()
{
return s_mtgs_thread;
}

std::optional<WindowInfo> WinRTHost::GetPlatformWindowInfo()
{
WindowInfo wi;
Expand Down Expand Up @@ -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<s32>(msg.size());
}

void WinRTHost::ProcessEventQueue() {
if (!m_event_queue.empty())
{
Expand Down Expand Up @@ -514,7 +527,7 @@ struct App : implements<App, IFrameworkViewSource, IFrameworkView>

VMManager::SetState(VMState::Running);

GetMTGS().WaitForOpen();
MTGS::WaitForOpen();
InputManager::ReloadDevices();
});
}
Expand Down Expand Up @@ -547,7 +560,7 @@ struct App : implements<App, IFrameworkViewSource, IFrameworkView>
GameList::Refresh(false);
ImGuiManager::InitializeFullscreenUI();

GetMTGS().WaitForOpen();
MTGS::WaitForOpen();
}

window.Dispatcher().RunAsync(CoreDispatcherPriority::Normal, []() {
Expand Down Expand Up @@ -623,7 +636,7 @@ struct App : implements<App, IFrameworkViewSource, IFrameworkView>
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;

Expand Down
2 changes: 1 addition & 1 deletion pcsx2-winrt/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Identity
Name="XBSX2"
Publisher="CN=SirMangler"
Version="2.0.2.0" />
Version="2.0.3.0" />
<mp:PhoneIdentity PhoneProductId="595c25f0-b370-4d7a-9b14-3027fbd69ecf" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>pcsx2-winrt</DisplayName>
Expand Down
1 change: 0 additions & 1 deletion pcsx2-winrt/pcsx2-winrt.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<PackageCertificateKeyFile>pcsx2-winrt_TemporaryKey.pfx</PackageCertificateKeyFile>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxPackageDir>D:\TheRhysWyrill\Downloads\Emu Stuff\AppPackages\</AppxPackageDir>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
</PropertyGroup>
<ItemDefinitionGroup>
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/Hotkeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/ImGui/FullscreenUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit cfe52ff

Please # to comment.