From 60f6ee3055b2a7875e7dc4c2a12a173ee09e8bb0 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 20 Oct 2024 23:21:49 +1000 Subject: [PATCH] RegTest: Build fix --- src/duckstation-regtest/regtest_host.cpp | 43 +++++++++++++++++------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/src/duckstation-regtest/regtest_host.cpp b/src/duckstation-regtest/regtest_host.cpp index 3eff010c1..9464d0e75 100644 --- a/src/duckstation-regtest/regtest_host.cpp +++ b/src/duckstation-regtest/regtest_host.cpp @@ -349,11 +349,10 @@ void Host::SetFullscreen(bool enabled) // } -std::optional Host::AcquireRenderWindow(bool recreate_window) +std::optional Host::AcquireRenderWindow(RenderAPI render_api, bool fullscreen, bool exclusive_fullscreen, + Error* error) { - WindowInfo wi; - wi.SetSurfaceless(); - return wi; + return WindowInfo(); } void Host::ReleaseRenderWindow() @@ -361,6 +360,19 @@ void Host::ReleaseRenderWindow() // } +bool Host::CreateAuxiliaryRenderWindow(s32 x, s32 y, u32 width, u32 height, std::string_view title, + std::string_view icon_name, AuxiliaryRenderWindowUserData userdata, + AuxiliaryRenderWindowHandle* handle, WindowInfo* wi, Error* error) +{ + return false; +} + +void Host::DestroyAuxiliaryRenderWindow(AuxiliaryRenderWindowHandle handle, s32* pos_x /* = nullptr */, + s32* pos_y /* = nullptr */, u32* width /* = nullptr */, + u32* height /* = nullptr */) +{ +} + void Host::FrameDone() { const u32 frame = System::GetFrameNumber(); @@ -714,10 +726,11 @@ bool RegTestHost::SetNewDataRoot(const std::string& filename) // Switch to file logging. INFO_LOG("Dumping frames to '{}'...", dump_directory); EmuFolders::DataRoot = std::move(dump_directory); - s_base_settings_interface->SetBoolValue("Logging", "LogToConsole", false); s_base_settings_interface->SetBoolValue("Logging", "LogToFile", true); s_base_settings_interface->SetStringValue("Logging", "LogLevel", Settings::GetLogLevelName(Log::Level::Dev)); - System::ApplySettings(false); + g_settings.log_to_file = true; + g_settings.log_level = Log::Level::Dev; + g_settings.UpdateLogSettings(); } return true; @@ -730,6 +743,14 @@ std::string RegTestHost::GetFrameDumpFilename(u32 frame) int main(int argc, char* argv[]) { + Error startup_error; + if (!System::Internal::PerformEarlyHardwareChecks(&startup_error) || + !System::Internal::ProcessStartup(&startup_error)) + { + ERROR_LOG("CPUThreadInitialize() failed: {}", startup_error.GetDescription()); + return EXIT_FAILURE; + } + RegTestHost::InitializeEarlyConsole(); if (!RegTestHost::InitializeConfig()) @@ -748,14 +769,10 @@ int main(int argc, char* argv[]) if (!RegTestHost::SetNewDataRoot(autoboot->filename)) return EXIT_FAILURE; + if (!System::Internal::CPUThreadInitialize(&startup_error)) { - Error startup_error; - if (!System::Internal::PerformEarlyHardwareChecks(&startup_error) || - !System::Internal::ProcessStartup(&startup_error) || !System::Internal::CPUThreadInitialize(&startup_error)) - { - ERROR_LOG("CPUThreadInitialize() failed: {}", startup_error.GetDescription()); - return EXIT_FAILURE; - } + ERROR_LOG("CPUThreadInitialize() failed: {}", startup_error.GetDescription()); + return EXIT_FAILURE; } RegTestHost::HookSignals();