2024-05-14 21:25:06 +00:00
|
|
|
// SPDX-FileCopyrightText: 2002-2024 PCSX2 Dev Team
|
2024-07-30 11:42:36 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0+
|
2023-01-03 12:23:10 +00:00
|
|
|
|
2023-06-24 07:46:36 +00:00
|
|
|
#include "pcsx2/Achievements.h"
|
2023-01-03 12:23:10 +00:00
|
|
|
#include "pcsx2/GS.h"
|
2023-10-02 04:57:20 +00:00
|
|
|
#include "pcsx2/GameList.h"
|
2023-01-03 12:23:10 +00:00
|
|
|
#include "pcsx2/Host.h"
|
2024-01-18 11:10:32 +00:00
|
|
|
#include "pcsx2/ImGui/FullscreenUI.h"
|
2024-05-14 21:25:06 +00:00
|
|
|
#include "pcsx2/ImGui/ImGuiAnimated.h"
|
|
|
|
#include "pcsx2/ImGui/ImGuiFullscreen.h"
|
2023-06-24 07:46:36 +00:00
|
|
|
#include "pcsx2/ImGui/ImGuiManager.h"
|
|
|
|
#include "pcsx2/Input/InputManager.h"
|
2023-01-03 12:23:10 +00:00
|
|
|
#include "pcsx2/VMManager.h"
|
2024-06-09 16:27:38 +00:00
|
|
|
#include "common/ProgressCallback.h"
|
2023-01-03 12:23:10 +00:00
|
|
|
|
|
|
|
void Host::CommitBaseSettingChanges()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::LoadSettings(SettingsInterface& si, std::unique_lock<std::mutex>& lock)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::CheckForSettingsChanges(const Pcsx2Config& old_config)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Host::RequestResetSettings(bool folders, bool core, bool controllers, bool hotkeys, bool ui)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::SetDefaultUISettings(SettingsInterface& si)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-06-09 16:27:38 +00:00
|
|
|
std::unique_ptr<ProgressCallback> Host::CreateHostProgressCallback()
|
|
|
|
{
|
|
|
|
return ProgressCallback::CreateNullProgressCallback();
|
|
|
|
}
|
|
|
|
|
2024-05-14 23:42:40 +00:00
|
|
|
void Host::ReportErrorAsync(const std::string_view title, const std::string_view message)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-05-14 23:42:40 +00:00
|
|
|
bool Host::ConfirmMessage(const std::string_view title, const std::string_view message)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2024-05-14 23:42:40 +00:00
|
|
|
void Host::OpenURL(const std::string_view url)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-05-14 23:42:40 +00:00
|
|
|
bool Host::CopyTextToClipboard(const std::string_view text)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::BeginTextInput()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::EndTextInput()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
std::optional<WindowInfo> Host::GetTopLevelWindowInfo()
|
|
|
|
{
|
2023-04-01 05:54:04 +00:00
|
|
|
return std::nullopt;
|
2023-01-03 12:23:10 +00:00
|
|
|
}
|
|
|
|
|
2024-05-14 21:42:19 +00:00
|
|
|
void Host::OnInputDeviceConnected(const std::string_view identifier, const std::string_view device_name)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-05-14 21:42:19 +00:00
|
|
|
void Host::OnInputDeviceDisconnected(const InputBindingKey key, const std::string_view identifier)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-07-23 05:07:46 +00:00
|
|
|
void Host::SetMouseMode(bool relative_mode, bool hide_cursor)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-04-25 12:52:41 +00:00
|
|
|
std::optional<WindowInfo> Host::AcquireRenderWindow(bool recreate_window)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
2023-04-01 05:54:04 +00:00
|
|
|
return std::nullopt;
|
2023-01-03 12:23:10 +00:00
|
|
|
}
|
|
|
|
|
2023-04-01 05:54:04 +00:00
|
|
|
void Host::ReleaseRenderWindow()
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-04-01 05:54:04 +00:00
|
|
|
void Host::BeginPresentFrame()
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::RequestResizeHostDisplay(s32 width, s32 height)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::OnVMStarting()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::OnVMStarted()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::OnVMDestroyed()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::OnVMPaused()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::OnVMResumed()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-06-13 12:43:11 +00:00
|
|
|
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)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::OnPerformanceMetricsUpdated()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-05-14 23:42:40 +00:00
|
|
|
void Host::OnSaveStateLoading(const std::string_view filename)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-05-14 23:42:40 +00:00
|
|
|
void Host::OnSaveStateLoaded(const std::string_view filename, bool was_successful)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-05-14 23:42:40 +00:00
|
|
|
void Host::OnSaveStateSaved(const std::string_view filename)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::RunOnCPUThread(std::function<void()> function, bool block /* = false */)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::RefreshGameListAsync(bool invalidate_cache)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::CancelGameListRefresh()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Host::IsFullscreen()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::SetFullscreen(bool enabled)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-07-06 13:18:30 +00:00
|
|
|
void Host::OnCaptureStarted(const std::string& filename)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::OnCaptureStopped()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-04-12 14:53:58 +00:00
|
|
|
void Host::RequestExitApplication(bool allow_confirm)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::RequestExitBigPicture()
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::RequestVMShutdown(bool allow_confirm, bool allow_save_state, bool default_save_state)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-01-26 11:27:36 +00:00
|
|
|
void Host::PumpMessagesOnCPUThread()
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-06-19 12:03:10 +00:00
|
|
|
s32 Host::Internal::GetTranslatedStringImpl(
|
2024-05-14 23:42:40 +00:00
|
|
|
const std::string_view context, const std::string_view msg, char* tbuf, size_t tbuf_space)
|
2023-06-19 12:03:10 +00:00
|
|
|
{
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
|
2024-05-14 22:11:44 +00:00
|
|
|
std::string Host::TranslatePluralToString(const char* context, const char* msg, const char* disambiguation, int count)
|
|
|
|
{
|
|
|
|
TinyString count_str = TinyString::from_format("{}", count);
|
|
|
|
|
|
|
|
std::string ret(msg);
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
std::string::size_type pos = ret.find("%n");
|
|
|
|
if (pos == std::string::npos)
|
|
|
|
break;
|
|
|
|
|
|
|
|
ret.replace(pos, pos + 2, count_str.view());
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2023-07-27 09:24:55 +00:00
|
|
|
void Host::OnAchievementsLoginRequested(Achievements::LoginRequestReason reason)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-09-17 10:19:51 +00:00
|
|
|
void Host::OnAchievementsLoginSuccess(const char* username, u32 points, u32 sc_points, u32 unread_messages)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-01-03 12:23:10 +00:00
|
|
|
void Host::OnAchievementsRefreshed()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-09-17 10:19:51 +00:00
|
|
|
void Host::OnAchievementsHardcoreModeChanged(bool enabled)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-10-02 04:57:20 +00:00
|
|
|
void Host::OnCoverDownloaderOpenRequested()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-01-18 11:10:32 +00:00
|
|
|
void Host::OnCreateMemoryCardOpenRequested()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-05-14 21:25:06 +00:00
|
|
|
bool Host::ShouldPreferHostFileSelector()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Host::OpenHostFileSelectorAsync(std::string_view title, bool select_directory, FileSelectorCallback callback,
|
|
|
|
FileSelectorFilters filters, std::string_view initial_directory)
|
|
|
|
{
|
|
|
|
callback(std::string());
|
|
|
|
}
|
|
|
|
|
2024-05-14 23:42:40 +00:00
|
|
|
std::optional<u32> InputManager::ConvertHostKeyboardStringToCode(const std::string_view str)
|
2023-01-03 12:23:10 +00:00
|
|
|
{
|
|
|
|
return std::nullopt;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::optional<std::string> InputManager::ConvertHostKeyboardCodeToString(u32 code)
|
|
|
|
{
|
|
|
|
return std::nullopt;
|
|
|
|
}
|
|
|
|
|
2023-12-10 15:28:55 +00:00
|
|
|
const char* InputManager::ConvertHostKeyboardCodeToIcon(u32 code)
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2023-01-03 12:23:10 +00:00
|
|
|
BEGIN_HOTKEY_LIST(g_host_hotkeys)
|
2023-12-22 11:57:49 +00:00
|
|
|
END_HOTKEY_LIST()
|