diff options
| -rw-r--r-- | CMakeLists.txt | 5 | ||||
| -rw-r--r-- | Data/Sys/GameSettings/GOWE69.ini | 5 | ||||
| -rw-r--r-- | Data/Sys/GameSettings/GW5E69.ini | 5 | ||||
| -rw-r--r-- | Source/Core/Common/Hash.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Common/MemArenaUnix.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/Common/TimeUtil.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Core/IOS/Network/IP/Top.cpp | 34 | ||||
| -rw-r--r-- | Source/Core/Core/PowerPC/JitCommon/JitCache.h | 2 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/AboutDialog.cpp | 8 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/CMakeLists.txt | 9 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/FIFO/FIFOAnalyzer.cpp | 55 | ||||
| -rw-r--r-- | Source/Core/InputCommon/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp | 7 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/PerformanceMetrics.cpp | 2 |
15 files changed, 92 insertions, 51 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7258caeec8..2622a18d7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,10 @@ cmake_policy(SET CMP0080 OLD) # allow using BundleUtilities at configure time # This is inserted into the Info.plist as well. set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0.0" CACHE STRING "") +# When we don't set a sysroot, AppleClang will put /usr/local/include at a higher +# priority than -isystem paths, which can cause weird include issues in Externals +set(CMAKE_OSX_SYSROOT macosx CACHE STRING "") + set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FlagsOverride.cmake") # CMake 3.28 and later scan c++ source files for module imports by default. Since we don't use @@ -697,6 +701,7 @@ endif() if(ENABLE_SDL) dolphin_find_optional_system_library(SDL3 Externals/SDL 3.2.0) + add_definitions(-DHAVE_SDL3) endif() dolphin_find_optional_system_library(SFML Externals/SFML 3.0 COMPONENTS Network System) diff --git a/Data/Sys/GameSettings/GOWE69.ini b/Data/Sys/GameSettings/GOWE69.ini index dcebb5a8aa..2a612a2184 100644 --- a/Data/Sys/GameSettings/GOWE69.ini +++ b/Data/Sys/GameSettings/GOWE69.ini @@ -1,6 +1,5 @@ # GOWE69 - Need for Speed: Most Wanted [Gecko] -$Unlock Black Edition [Xanvier] -C241EECC 00000001 -00000001 00000000 +$Unlock Black Edition [Ralf] +0441EECC 00000001 diff --git a/Data/Sys/GameSettings/GW5E69.ini b/Data/Sys/GameSettings/GW5E69.ini index 156e63381b..080e5b1fc8 100644 --- a/Data/Sys/GameSettings/GW5E69.ini +++ b/Data/Sys/GameSettings/GW5E69.ini @@ -1,6 +1,5 @@ # GW5E69 - Need for Speed: Carbon -[ActionReplay] -$Unlock Collector's Edition -0AB3E002 18000000 +[Gecko] +$Unlock Collector's Edition [Ralf] 045075B8 00000001 diff --git a/Source/Core/Common/Hash.cpp b/Source/Core/Common/Hash.cpp index a3984745f5..3756bdcad4 100644 --- a/Source/Core/Common/Hash.cpp +++ b/Source/Core/Common/Hash.cpp @@ -427,7 +427,7 @@ u64 GetHash64(const u8* src, u32 len, u32 samples) u32 StartCRC32() { - return crc32_z(0L, Z_NULL, 0); + return crc32_z(0L, nullptr, 0); } u32 UpdateCRC32(u32 crc, const u8* data, size_t len) diff --git a/Source/Core/Common/MemArenaUnix.cpp b/Source/Core/Common/MemArenaUnix.cpp index fd4af4e74b..26a123c081 100644 --- a/Source/Core/Common/MemArenaUnix.cpp +++ b/Source/Core/Common/MemArenaUnix.cpp @@ -149,8 +149,8 @@ void* LazyMemoryRegion::Create(size_t size) if (size == 0) return nullptr; - void* memory = - mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); + void* memory = mmap(nullptr, size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); if (memory == MAP_FAILED) { NOTICE_LOG_FMT(MEMMAP, "Memory allocation of {} bytes failed.", size); diff --git a/Source/Core/Common/TimeUtil.cpp b/Source/Core/Common/TimeUtil.cpp index e57078b7e9..fa47e23503 100644 --- a/Source/Core/Common/TimeUtil.cpp +++ b/Source/Core/Common/TimeUtil.cpp @@ -17,7 +17,7 @@ std::optional<std::tm> LocalTime(std::time_t time) #ifdef _MSC_VER if (localtime_s(&local_time, &time) != 0) #else - if (localtime_r(&time, &local_time) == NULL) + if (localtime_r(&time, &local_time) == nullptr) #endif { ERROR_LOG_FMT(COMMON, "Failed to convert time to local time: {}", std::strerror(errno)); diff --git a/Source/Core/Core/IOS/Network/IP/Top.cpp b/Source/Core/Core/IOS/Network/IP/Top.cpp index 86d206d8e4..e38fd1df01 100644 --- a/Source/Core/Core/IOS/Network/IP/Top.cpp +++ b/Source/Core/Core/IOS/Network/IP/Top.cpp @@ -58,6 +58,12 @@ #include <linux/rtnetlink.h> #endif +auto format_as(addrinfo hints) +{ + return fmt::format("flags={}, family={}, socktype={}, protocol={}, addrlen={}", hints.ai_flags, + hints.ai_family, hints.ai_socktype, hints.ai_protocol, hints.ai_addrlen); +} + namespace IOS::HLE { enum SOResultCode : s32 @@ -66,6 +72,21 @@ enum SOResultCode : s32 SO_ERROR_HOST_NOT_FOUND = -305, }; +namespace +{ +const char* GaiStrError(s32 error) +{ +#ifdef _WIN32 + // gai_strerror isn't thread safe on Windows + return Common::DecodeNetworkError(error); +#else + // Unlike Windows it doesn't return regular error codes + // e.g. EAI_AGAIN vs errno's EAGAIN + return gai_strerror(error); +#endif +} +} // namespace + NetIPTopDevice::NetIPTopDevice(EmulationKernel& ios, const std::string& device_name) : EmulationDevice(ios, device_name) { @@ -1281,10 +1302,10 @@ IPCReply NetIPTopDevice::HandleGetAddressInfoRequest(const IOCtlVRequest& reques addrinfo* result = nullptr; int ret = getaddrinfo(pNodeName, pServiceName, hints_valid ? &hints : nullptr, &result); - u32 addr = request.io_vectors[0].address; - u32 sockoffset = addr + 0x460; if (ret == 0) { + u32 addr = request.io_vectors[0].address; + u32 sockoffset = addr + 0x460; constexpr size_t WII_ADDR_INFO_SIZE = 0x20; for (addrinfo* result_iter = result; result_iter != nullptr; result_iter = result_iter->ai_next) { @@ -1326,6 +1347,15 @@ IPCReply NetIPTopDevice::HandleGetAddressInfoRequest(const IOCtlVRequest& reques } else { + const char* const hostname = pNodeName ? pNodeName : "(null)"; + const char* const service = pServiceName ? pServiceName : "(null)"; + const std::string hints_description{hints_valid ? fmt::format("{}", hints) : "(null)"}; + ERROR_LOG_FMT(IOS_NET, + "getaddrinfo failed with error {}: {}\n" + " - hostname: {}\n" + " - service: {}\n" + " - hints: {}", + ret, GaiStrError(ret), hostname, service, hints_description); ret = SO_ERROR_HOST_NOT_FOUND; } diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.h b/Source/Core/Core/PowerPC/JitCommon/JitCache.h index 4b5ac6fd80..8860a42b06 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitCache.h +++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.h @@ -231,7 +231,7 @@ private: // It is used by the assembly dispatcher to quickly // know where to jump based on pc and msr bits. Common::LazyMemoryRegion m_entry_points_arena; - u8** m_entry_points_ptr = 0; + u8** m_entry_points_ptr = nullptr; // An alternative for the above but without a shm segment // in case the shm memory region couldn't be allocated. diff --git a/Source/Core/DolphinQt/AboutDialog.cpp b/Source/Core/DolphinQt/AboutDialog.cpp index 0326d9888f..5261decdbd 100644 --- a/Source/Core/DolphinQt/AboutDialog.cpp +++ b/Source/Core/DolphinQt/AboutDialog.cpp @@ -7,7 +7,9 @@ #include <QTextEdit> #include <QVBoxLayout> #include <QtGlobal> +#ifdef HAVE_SDL3 #include <SDL3/SDL_version.h> +#endif #include "Common/Version.h" @@ -27,11 +29,13 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent) tr("%1 commit(s) ahead of %2").arg(commits_ahead).arg(QStringLiteral("master"))); } +#ifdef HAVE_SDL3 const int sdl_version = SDL_GetVersion(); QString sdl_str = QString::fromStdString("%1.%2.%3") .arg(SDL_VERSIONNUM_MAJOR(sdl_version)) .arg(SDL_VERSIONNUM_MINOR(sdl_version)) .arg(SDL_VERSIONNUM_MICRO(sdl_version)); +#endif const QString text = QStringLiteral(R"( @@ -72,7 +76,11 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent) tr("Revision: %1").arg(QString::fromUtf8(Common::GetScmRevGitStr().c_str()))) .replace(QStringLiteral("%QT_VERSION%"), tr("Using Qt %1").arg(QStringLiteral(QT_VERSION_STR))) +#ifdef HAVE_SDL3 .replace(QStringLiteral("%SDL_VERSION%"), tr("Using SDL %1").arg(sdl_str)) +#else + .replace(QStringLiteral("%SDL_VERSION%"), tr("SDL disabled")) +#endif .replace(QStringLiteral("%CHECK_FOR_UPDATES%"), tr("Check for updates")) .replace(QStringLiteral("%ABOUT_DOLPHIN%"), // i18n: The word "free" in the standard phrase "free and open source" diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index ddfe35cb6d..1228885c1d 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -458,9 +458,15 @@ PRIVATE uicommon imgui implot - SDL3::SDL3 ) +if(ENABLE_SDL) + target_link_libraries(dolphin-emu + PRIVATE + SDL3::SDL3 + ) +endif() + if (NEED_QT_GUI_PRIVATE_COMPONENT) target_link_libraries(dolphin-emu PRIVATE @@ -575,6 +581,7 @@ if (WIN32) --no-translations --no-compiler-runtime --no-system-d3d-compiler + --no-system-dxc-compiler --no-opengl-sw "$<TARGET_FILE:dolphin-emu>" ) diff --git a/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp b/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp index bdd0cc5d82..198b4db230 100644 --- a/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp @@ -78,7 +78,7 @@ private: opt.decorationSize = QSize(0, 0); // Default draw command for paint. - QApplication::style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter, 0); + QApplication::style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter, nullptr); // Draw pixmap at the center of the tablewidget cell QPixmap pix = qvariant_cast<QPixmap>(index.data(Qt::DecorationRole)); diff --git a/Source/Core/DolphinQt/FIFO/FIFOAnalyzer.cpp b/Source/Core/DolphinQt/FIFO/FIFOAnalyzer.cpp index 3df9dfcbbc..e574c2d6e1 100644 --- a/Source/Core/DolphinQt/FIFO/FIFOAnalyzer.cpp +++ b/Source/Core/DolphinQt/FIFO/FIFOAnalyzer.cpp @@ -155,15 +155,15 @@ void FIFOAnalyzer::UpdateTree() recording_item->addChild(frame_item); - const AnalyzedFrameInfo& frame_info = m_fifo_player.GetAnalyzedFrameInfo(frame); - ASSERT(frame_info.parts.size() != 0); + const auto& [parts, part_type_counts] = m_fifo_player.GetAnalyzedFrameInfo(frame); + ASSERT(parts.size() != 0); Common::EnumMap<u32, FramePartType::EFBCopy> part_counts; u32 part_start = 0; - for (u32 part_nr = 0; part_nr < frame_info.parts.size(); part_nr++) + for (u32 part_nr = 0; part_nr < parts.size(); part_nr++) { - const auto& part = frame_info.parts[part_nr]; + const auto& part = parts[part_nr]; const u32 part_type_nr = part_counts[part.m_type]; part_counts[part.m_type]++; @@ -189,9 +189,9 @@ void FIFOAnalyzer::UpdateTree() } // We shouldn't end on a Command (it should end with an EFB copy) - ASSERT(part_start == frame_info.parts.size()); + ASSERT(part_start == parts.size()); // The counts we computed should match the frame's counts - ASSERT(std::ranges::equal(frame_info.part_type_counts, part_counts)); + ASSERT(std::ranges::equal(part_type_counts, part_counts)); } } @@ -344,18 +344,18 @@ void FIFOAnalyzer::UpdateDetails() const u32 start_part_nr = items[0]->data(0, PART_START_ROLE).toUInt(); const u32 end_part_nr = items[0]->data(0, PART_END_ROLE).toUInt(); - const AnalyzedFrameInfo& frame_info = m_fifo_player.GetAnalyzedFrameInfo(frame_nr); + const auto& [parts, _part_type_counts] = m_fifo_player.GetAnalyzedFrameInfo(frame_nr); const auto& fifo_frame = m_fifo_player.GetFile()->GetFrame(frame_nr); - const u32 object_start = frame_info.parts[start_part_nr].m_start; - const u32 object_end = frame_info.parts[end_part_nr].m_end; + const u32 object_start = parts[start_part_nr].m_start; + const u32 object_end = parts[end_part_nr].m_end; const u32 object_size = object_end - object_start; u32 object_offset = 0; // NOTE: object_info.m_cpmem is the state of cpmem _after_ all of the commands in this object. // However, it doesn't matter that it doesn't match the start, since it will match by the time // primitives are reached. - auto callback = DetailCallback(frame_info.parts[end_part_nr].m_cpmem); + auto callback = DetailCallback(parts[end_part_nr].m_cpmem); while (object_offset < object_size) { @@ -427,11 +427,11 @@ void FIFOAnalyzer::BeginSearch() const u32 start_part_nr = items[0]->data(0, PART_START_ROLE).toUInt(); const u32 end_part_nr = items[0]->data(0, PART_END_ROLE).toUInt(); - const AnalyzedFrameInfo& frame_info = m_fifo_player.GetAnalyzedFrameInfo(frame_nr); + const auto& [parts, _part_type_counts] = m_fifo_player.GetAnalyzedFrameInfo(frame_nr); const FifoFrameInfo& fifo_frame = m_fifo_player.GetFile()->GetFrame(frame_nr); - const u32 object_start = frame_info.parts[start_part_nr].m_start; - const u32 object_end = frame_info.parts[end_part_nr].m_end; + const u32 object_start = parts[start_part_nr].m_start; + const u32 object_end = parts[end_part_nr].m_end; const u32 object_size = object_end - object_start; const u8* const object = &fifo_frame.fifoData[object_start]; @@ -612,7 +612,7 @@ public: text = QObject::tr("Primitive %1").arg(QString::fromStdString(name)); text += QLatin1Char{'\n'}; - const auto& vtx_desc = m_cpmem.vtx_desc; + const auto& [low, high] = m_cpmem.vtx_desc; const auto& vtx_attr = m_cpmem.vtx_attr[vat]; u32 i = 0; @@ -668,22 +668,21 @@ public: ASSERT(i == vertex_num * vertex_size); text += QLatin1Char{'\n'}; - if (vtx_desc.low.PosMatIdx) + if (low.PosMatIdx) process_simple_component(1); - for (auto texmtxidx : vtx_desc.low.TexMatIdx) + for (auto texmtxidx : low.TexMatIdx) { if (texmtxidx) process_simple_component(1); } - process_component(vtx_desc.low.Position, vtx_attr.g0.PosFormat, + process_component(low.Position, vtx_attr.g0.PosFormat, vtx_attr.g0.PosElements == CoordComponentCount::XY ? 2 : 3); - const u32 normal_component_count = - vtx_desc.low.Normal == VertexComponentFormat::Direct ? 3 : 1; + const u32 normal_component_count = low.Normal == VertexComponentFormat::Direct ? 3 : 1; const u32 normal_elements = vtx_attr.g0.NormalElements == NormalComponentCount::NTB ? 3 : 1; - process_component(vtx_desc.low.Normal, vtx_attr.g0.NormalFormat, + process_component(low.Normal, vtx_attr.g0.NormalFormat, normal_component_count * normal_elements, vtx_attr.g0.NormalIndex3 ? normal_elements : 1); - for (u32 c = 0; c < vtx_desc.low.Color.Size(); c++) + for (u32 c = 0; c < low.Color.Size(); c++) { static constexpr Common::EnumMap<u32, ColorFormat::RGBA8888> component_sizes = { 2, // RGB565 @@ -693,7 +692,7 @@ public: 3, // RGBA6666 4, // RGBA8888 }; - switch (vtx_desc.low.Color[c]) + switch (low.Color[c]) { case VertexComponentFormat::Index8: process_simple_component(1); @@ -708,9 +707,9 @@ public: break; } } - for (u32 t = 0; t < vtx_desc.high.TexCoord.Size(); t++) + for (u32 t = 0; t < high.TexCoord.Size(); t++) { - process_component(vtx_desc.high.TexCoord[t], vtx_attr.GetTexFormat(t), + process_component(high.TexCoord[t], vtx_attr.GetTexFormat(t), vtx_attr.GetTexElements(t) == TexComponentCount::ST ? 2 : 1); } } @@ -756,15 +755,15 @@ void FIFOAnalyzer::UpdateDescription() const u32 end_part_nr = items[0]->data(0, PART_END_ROLE).toUInt(); const u32 entry_nr = m_detail_list->currentRow(); - const AnalyzedFrameInfo& frame_info = m_fifo_player.GetAnalyzedFrameInfo(frame_nr); + const auto& [parts, _part_type_counts] = m_fifo_player.GetAnalyzedFrameInfo(frame_nr); const FifoFrameInfo& fifo_frame = m_fifo_player.GetFile()->GetFrame(frame_nr); - const u32 object_start = frame_info.parts[start_part_nr].m_start; - const u32 object_end = frame_info.parts[end_part_nr].m_end; + const u32 object_start = parts[start_part_nr].m_start; + const u32 object_end = parts[end_part_nr].m_end; const u32 object_size = object_end - object_start; const u32 entry_start = m_object_data_offsets[entry_nr]; - auto callback = DescriptionCallback(frame_info.parts[end_part_nr].m_cpmem); + auto callback = DescriptionCallback(parts[end_part_nr].m_cpmem); OpcodeDecoder::RunCommand(&fifo_frame.fifoData[object_start + entry_start], object_size - entry_start, callback); m_entry_detail_browser->setText(callback.text); diff --git a/Source/Core/InputCommon/CMakeLists.txt b/Source/Core/InputCommon/CMakeLists.txt index 0e5612f353..5cc6b66ca6 100644 --- a/Source/Core/InputCommon/CMakeLists.txt +++ b/Source/Core/InputCommon/CMakeLists.txt @@ -181,7 +181,6 @@ if(ENABLE_SDL) ControllerInterface/SDL/SDLGamepad.h ) target_link_libraries(inputcommon PRIVATE SDL3::SDL3) - target_compile_definitions(inputcommon PUBLIC HAVE_SDL3=1) endif() if(MSVC) diff --git a/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp b/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp index a10edd13c9..9f7e708593 100644 --- a/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp +++ b/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp @@ -261,12 +261,7 @@ std::vector<std::shared_ptr<Device>> DeviceContainer::GetAllDevices() const { std::lock_guard lk(m_devices_mutex); - std::vector<std::shared_ptr<Device>> devices; - - for (const auto& d : m_devices) - devices.emplace_back(d); - - return devices; + return m_devices; } std::vector<std::string> DeviceContainer::GetAllDeviceStrings() const diff --git a/Source/Core/VideoCommon/PerformanceMetrics.cpp b/Source/Core/VideoCommon/PerformanceMetrics.cpp index 98efa64108..7ea96bd183 100644 --- a/Source/Core/VideoCommon/PerformanceMetrics.cpp +++ b/Source/Core/VideoCommon/PerformanceMetrics.cpp @@ -191,7 +191,7 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale) if (g_ActiveConfig.bShowGraphs) { // A font size of 13 is small enough to keep the tick numbers from overlapping too much. - ImGui::PushFont(NULL, 13.0f); + ImGui::PushFont(nullptr, 13.0f); ImGui::PushStyleColor(ImGuiCol_ResizeGrip, 0); const auto graph_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoNav | movable_flag | |
