From a07dd24a962d4b63728e118fcf3cd3a66c8e7e16 Mon Sep 17 00:00:00 2001 From: Nikhil Narayana Date: Fri, 9 Feb 2024 23:25:25 -0800 Subject: [PATCH] fix: post merge build failures --- .github/workflows/main.yml | 1 + CMakeLists.txt | 1 + Source/Core/Core/CoreTiming.cpp | 5 +++- Source/Core/Core/GeckoCode.cpp | 17 +++++------- Source/Core/Core/HW/EXI/EXI_DeviceSlippi.cpp | 2 +- Source/Core/Core/HW/VideoInterface.cpp | 4 +-- Source/Core/Core/Slippi/SlippiMatchmaking.cpp | 4 +-- Source/Core/Core/Slippi/SlippiNetplay.cpp | 10 +++---- Source/Core/Core/Slippi/SlippiSavestate.cpp | 4 +-- Source/Core/Core/Slippi/SlippiUser.h | 1 - .../DolphinQt/Config/Graphics/HacksWidget.cpp | 2 +- Source/Core/DolphinQt/HotkeyScheduler.cpp | 27 ++++++++++--------- .../ControllerInterface/Pipes/Pipes.cpp | 9 +++---- 13 files changed, 43 insertions(+), 44 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5af8099f66..c19071f772 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -216,6 +216,7 @@ jobs: libegl1-mesa-dev \ libpng-dev \ qt6-base-private-dev \ + libqt6svg6-dev \ libxxf86vm-dev \ x11proto-xinerama-dev \ libfuse2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 89fb9aee78..0d4fcb1314 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -654,6 +654,7 @@ include_directories(Externals/nlohmann) add_subdirectory(Externals/semver) include_directories(Externals/semver/include) add_subdirectory(Externals/open-vcdiff) +include_directories(Externals) if(ENABLE_VULKAN) add_definitions(-DHAS_VULKAN) diff --git a/Source/Core/Core/CoreTiming.cpp b/Source/Core/Core/CoreTiming.cpp index 627f14cbce..e938d19eb1 100644 --- a/Source/Core/Core/CoreTiming.cpp +++ b/Source/Core/Core/CoreTiming.cpp @@ -348,7 +348,10 @@ void CoreTimingManager::Advance() m_event_queue.pop_back(); Throttle(evt.time); - evt.type->callback(m_system, evt.userdata, m_globals.global_timer - evt.time); + if (evt.type != nullptr) // slippi change + { + evt.type->callback(m_system, evt.userdata, m_globals.global_timer - evt.time); + } } m_is_global_timer_sane = false; diff --git a/Source/Core/Core/GeckoCode.cpp b/Source/Core/Core/GeckoCode.cpp index 3b95a1f0ff..d9bc9696ef 100644 --- a/Source/Core/Core/GeckoCode.cpp +++ b/Source/Core/Core/GeckoCode.cpp @@ -16,6 +16,7 @@ #include "Common/FileUtil.h" #include "Core/Config/MainSettings.h" +#include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/PowerPC/MMU.h" #include "Core/PowerPC/PowerPC.h" @@ -196,7 +197,10 @@ static Installation InstallCodeHandlerLocked(const Core::CPUThreadGuard& guard) // Install bootloader gct for (size_t i = 0; i < bootloaderData.length(); ++i) - PowerPC::MMU::HostWrite_U8(guard, bootloaderData[i], static_cast(codelist_base_address + i)); + PowerPC::MMU::HostWrite_U8(guard, bootloaderData[i], + static_cast(codelist_base_address + i)); + + PowerPC::MMU::HostWrite_U32(guard, 0, HLE_TRAMPOLINE_ADDRESS); } else { @@ -242,18 +246,9 @@ static Installation InstallCodeHandlerLocked(const Core::CPUThreadGuard& guard) // Stop code. Tells the handler that this is the end of the list. PowerPC::MMU::HostWrite_U32(guard, 0xF0000000, next_address); PowerPC::MMU::HostWrite_U32(guard, 0x00000000, next_address + 4); - WARN_LOG_FMT(ACTIONREPLAY, "GeckoCodes: Using {} of {} bytes", next_address - start_address, - end_address - start_address); + PowerPC::MMU::HostWrite_U32(guard, 0, HLE_TRAMPOLINE_ADDRESS); } - WARN_LOG_FMT(ACTIONREPLAY, "GeckoCodes: Using {} of {} bytes", next_address - start_address, - end_address - start_address); - - // Stop code. Tells the handler that this is the end of the list. - PowerPC::MMU::HostWrite_U32(guard, 0xF0000000, next_address); - PowerPC::MMU::HostWrite_U32(guard, 0x00000000, next_address + 4); - PowerPC::MMU::HostWrite_U32(guard, 0, HLE_TRAMPOLINE_ADDRESS); - // Turn on codes PowerPC::MMU::HostWrite_U8(guard, 1, INSTALLER_BASE_ADDRESS + 7); diff --git a/Source/Core/Core/HW/EXI/EXI_DeviceSlippi.cpp b/Source/Core/Core/HW/EXI/EXI_DeviceSlippi.cpp index 7e2fcbe514..f90e7b9d4f 100644 --- a/Source/Core/Core/HW/EXI/EXI_DeviceSlippi.cpp +++ b/Source/Core/Core/HW/EXI/EXI_DeviceSlippi.cpp @@ -3084,7 +3084,7 @@ void CEXISlippi::DMAWrite(u32 _uAddr, u32 _uSize) ASSERT(Core::IsCPUThread()); Core::CPUThreadGuard guard(system); NOTICE_LOG_FMT(SLIPPI, "DMA Write was passed an invalid address: {:x}", _uAddr); - Dolphin_Debugger::PrintCallstack(system, guard, Common::Log::LogType::SLIPPI, + Dolphin_Debugger::PrintCallstack(guard, Common::Log::LogType::SLIPPI, Common::Log::LogLevel::LNOTICE); m_read_queue.clear(); return; diff --git a/Source/Core/Core/HW/VideoInterface.cpp b/Source/Core/Core/HW/VideoInterface.cpp index 58586aa395..f49b1b2c0c 100644 --- a/Source/Core/Core/HW/VideoInterface.cpp +++ b/Source/Core/Core/HW/VideoInterface.cpp @@ -849,7 +849,7 @@ void VideoInterfaceManager::EndField(FieldType field, u64 ticks) void VideoInterfaceManager::Update(u64 ticks) { // Try calling SI Poll every time update is called - SerialInterface::UpdateDevices(); + m_system.GetSerialInterface().UpdateDevices(); Core::UpdateInputGate(!Config::Get(Config::MAIN_INPUT_BACKGROUND_INPUT), Config::Get(Config::MAIN_LOCK_CURSOR)); @@ -886,7 +886,7 @@ void VideoInterfaceManager::Update(u64 ticks) if (m_half_line_count == 0 || m_half_line_count == GetHalfLinesPerEvenField()) Core::Callback_NewField(m_system); - // SLIPPINOTES: this section is disable because we would rather poll every chance we get to reduce + // SLIPPINOTES: this section is disabled because we would rather poll every chance we get to reduce // lag // // If an SI poll is scheduled to happen on this half-line, do it! // if (m_half_line_of_next_si_poll == m_half_line_count) diff --git a/Source/Core/Core/Slippi/SlippiMatchmaking.cpp b/Source/Core/Core/Slippi/SlippiMatchmaking.cpp index 98f4ac9658..85e0228924 100644 --- a/Source/Core/Core/Slippi/SlippiMatchmaking.cpp +++ b/Source/Core/Core/Slippi/SlippiMatchmaking.cpp @@ -2,7 +2,7 @@ #include #include #include "Common/Common.h" -#include "Common/ENetUtil.h" +#include "Common/ENet.h" #include "Common/Logging/Log.h" #include "Common/StringUtil.h" #include "Common/Version.h" @@ -347,7 +347,7 @@ void SlippiMatchmaking::startMatchmaking() } net_event.peer->data = &user_info.display_name; - m_client->intercept = ENetUtil::InterceptCallback; + m_client->intercept = Common::ENet::InterceptCallback; is_mm_connected = true; ERROR_LOG_FMT(SLIPPI_ONLINE, "[Matchmaking] Connected to mm server..."); } diff --git a/Source/Core/Core/Slippi/SlippiNetplay.cpp b/Source/Core/Core/Slippi/SlippiNetplay.cpp index b24db96de2..4c7876085f 100644 --- a/Source/Core/Core/Slippi/SlippiNetplay.cpp +++ b/Source/Core/Core/Slippi/SlippiNetplay.cpp @@ -5,7 +5,7 @@ #include "Core/Slippi/SlippiNetplay.h" #include "Common/CommonTypes.h" #include "Common/Config/Config.h" -#include "Common/ENetUtil.h" +#include "Common/ENet.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" #include "Common/Timer.h" @@ -40,9 +40,9 @@ SlippiNetplayClient::~SlippiNetplayClient() Disconnect(); } - if (g_MainNetHost.get() == m_client) + if (Common::g_MainNetHost.get() == m_client) { - g_MainNetHost.release(); + Common::g_MainNetHost.release(); } if (m_client) { @@ -726,7 +726,7 @@ void SlippiNetplayClient::SendAsync(std::unique_ptr packet) std::lock_guard lkq(m_crit.async_queue_write); m_async_queue.Push(std::move(packet)); } - ENetUtil::WakeupThread(m_client); + Common::ENet::WakeupThread(m_client); } // called from ---NETPLAY--- thread @@ -858,7 +858,7 @@ void SlippiNetplayClient::ThreadFunc() if (all_connected) { - m_client->intercept = ENetUtil::InterceptCallback; + m_client->intercept = Common::ENet::InterceptCallback; INFO_LOG_FMT(SLIPPI_ONLINE, "Slippi online connection successful!"); slippi_connect_status = SlippiConnectStatus::NET_CONNECT_STATUS_CONNECTED; break; diff --git a/Source/Core/Core/Slippi/SlippiSavestate.cpp b/Source/Core/Core/Slippi/SlippiSavestate.cpp index 10dbfa3a71..f57751d6f5 100644 --- a/Source/Core/Core/Slippi/SlippiSavestate.cpp +++ b/Source/Core/Core/Slippi/SlippiSavestate.cpp @@ -113,8 +113,8 @@ void SlippiSavestate::initBackupLocs() ASSERT(Core::IsCPUThread()); Core::CPUThreadGuard guard(Core::System::GetInstance()); // Get Main Heap Boundaries - full_backup_regions[3].start_address = PowerPC::HostRead_U32(guard, 0x804d76b8); - full_backup_regions[3].end_address = PowerPC::HostRead_U32(guard, 0x804d76bc); + full_backup_regions[3].start_address = PowerPC::MMU::HostRead_U32(guard, 0x804d76b8); + full_backup_regions[3].end_address = PowerPC::MMU::HostRead_U32(guard, 0x804d76bc); WARN_LOG_FMT(SLIPPI_ONLINE, "Heap start is: {:#x}", full_backup_regions[3].start_address); WARN_LOG_FMT(SLIPPI_ONLINE, "Heap end is: {:#x}", full_backup_regions[3].end_address); diff --git a/Source/Core/Core/Slippi/SlippiUser.h b/Source/Core/Core/Slippi/SlippiUser.h index aa473fabb4..d48a9ebf9f 100644 --- a/Source/Core/Core/Slippi/SlippiUser.h +++ b/Source/Core/Core/Slippi/SlippiUser.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include #include diff --git a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp index f422f428f8..fe5e4ed8c2 100644 --- a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp @@ -91,8 +91,8 @@ void HacksWidget::CreateWidgets() m_store_xfb_copies = new ConfigBool(tr("Store XFB Copies to Texture Only"), Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM); // slippi: don't let people touch this! - m_immediate_xfb->setEnabled(false); m_immediate_xfb = new ConfigBool(tr("Immediately Present XFB"), Config::GFX_HACK_IMMEDIATE_XFB); + m_immediate_xfb->setEnabled(false); m_skip_duplicate_xfbs = new ConfigBool(tr("Skip Presenting Duplicate Frames"), Config::GFX_HACK_SKIP_DUPLICATE_XFBS); diff --git a/Source/Core/DolphinQt/HotkeyScheduler.cpp b/Source/Core/DolphinQt/HotkeyScheduler.cpp index ddb7805f81..04659b66fa 100644 --- a/Source/Core/DolphinQt/HotkeyScheduler.cpp +++ b/Source/Core/DolphinQt/HotkeyScheduler.cpp @@ -477,24 +477,27 @@ void HotkeyScheduler::Run() "Speed Limit: Unlimited" : fmt::format("Speed Limit: {}%", std::lround(emulation_speed * 100.f))); }; - if (!IsOnline()) { - auto speed = Config::Get(Config::MAIN_EMULATION_SPEED) - 0.1; - if (speed > 0) + if (IsHotkey(HK_INCREASE_EMULATION_SPEED)) { + auto speed = Config::Get(Config::MAIN_EMULATION_SPEED) + 0.1; speed = (speed >= 0.95 && speed <= 1.05) ? 1.0 : speed; Config::SetCurrent(Config::MAIN_EMULATION_SPEED, speed); + ShowEmulationSpeed(); + } + if (IsHotkey(HK_DECREASE_EMULATION_SPEED)) + { + { + auto speed = Config::Get(Config::MAIN_EMULATION_SPEED) - 0.1; + if (speed > 0) + { + speed = (speed >= 0.95 && speed <= 1.05) ? 1.0 : speed; + Config::SetCurrent(Config::MAIN_EMULATION_SPEED, speed); + } + ShowEmulationSpeed(); + } } - ShowEmulationSpeed(); - } - - if (IsHotkey(HK_INCREASE_EMULATION_SPEED)) - { - auto speed = Config::Get(Config::MAIN_EMULATION_SPEED) + 0.1; - speed = (speed >= 0.95 && speed <= 1.05) ? 1.0 : speed; - Config::SetCurrent(Config::MAIN_EMULATION_SPEED, speed); - ShowEmulationSpeed(); } // USB Device Emulation diff --git a/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp b/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp index ae3ca86114..5a67a80be2 100644 --- a/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp @@ -172,12 +172,8 @@ Core::DeviceRemoval PipeDevice::UpdateInput() // Read any pending characters off the pipe. If we hit a newline, // then dequeue a command off the front of m_buf and parse it. char buf[32]; - s32 bytes_read = readFromPipe(m_fd, buf, sizeof buf); - if (bytes_read == 0) - { - // Pipe died, so just quit out - return; - } + std::size_t bytes_read = + readFromPipe(m_fd, buf, sizeof buf); // slippi: confirm this still works for libmelee while (bytes_read > 0) { m_buf.append(buf, bytes_read); @@ -192,6 +188,7 @@ Core::DeviceRemoval PipeDevice::UpdateInput() newline = m_buf.find("\n"); } } while (!finished && Config::Get(Config::SLIPPI_BLOCKING_PIPES)); + return Core::DeviceRemoval::Keep; } void PipeDevice::AddAxis(const std::string& name, double value)