From 0161ac331523d128dbd6083b9de0e65071fbe144 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 04:04:27 -0500 Subject: [PATCH 01/29] run `rename_symbols.py --all-symbols` --- libultraship | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship b/libultraship index 9a974e002f..1dd124a884 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 9a974e002f84cd1fe834ee9d2fa4ccf16d899e0f +Subproject commit 1dd124a8841a6d836361cee3434f323529dc3c84 From 088c425c616d3bffa31cc17e2f49ae9b435e87d8 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 04:05:33 -0500 Subject: [PATCH 02/29] run `rename_headers.py` --- libultraship | 2 +- soh/soh/Extractor/Extract.cpp | 2 +- soh/soh/Network/Network.h | 2 +- soh/soh/OTRGlobals.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libultraship b/libultraship index 1dd124a884..3c160249a0 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 1dd124a8841a6d836361cee3434f323529dc3c84 +Subproject commit 3c160249a0dbe52ee6768e0693fb389018e1d53a diff --git a/soh/soh/Extractor/Extract.cpp b/soh/soh/Extractor/Extract.cpp index 673afc8a64..7b15ed2982 100644 --- a/soh/soh/Extractor/Extract.cpp +++ b/soh/soh/Extractor/Extract.cpp @@ -40,7 +40,7 @@ #include -#include +#include #include #include diff --git a/soh/soh/Network/Network.h b/soh/soh/Network/Network.h index 6bd4f81642..3c98600e9c 100644 --- a/soh/soh/Network/Network.h +++ b/soh/soh/Network/Network.h @@ -4,7 +4,7 @@ #ifdef __cplusplus #include -#include +#include #include class Network { diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 7856de88f4..c3f6c12a30 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -54,9 +54,9 @@ #include #ifdef __APPLE__ -#include +#include #else -#include +#include #endif #ifdef __SWITCH__ From 80f969e82b64764ca6dc49d6cd52e2540cded1eb Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 04:07:36 -0500 Subject: [PATCH 03/29] run `rename_macros.py` --- ZAPDTR | 2 +- libultraship | 2 +- soh/include/functions.h | 4 ++-- .../resolution-editor/ResolutionEditor.cpp | 2 +- .../Enhancements/speechsynthesizer/SpeechSynthesizer.h | 2 +- soh/soh/Extractor/FastCrc32C.c | 2 +- soh/soh/Extractor/portable-file-dialogs.h | 10 +++++----- soh/soh/OTRGlobals.cpp | 6 +++--- soh/soh/SohGui.cpp | 2 +- soh/soh/SohMenuBar.cpp | 6 +++--- soh/src/buffers/heaps.c | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ZAPDTR b/ZAPDTR index 04d42249d2..1532480811 160000 --- a/ZAPDTR +++ b/ZAPDTR @@ -1 +1 @@ -Subproject commit 04d42249d2c15c3b442a0282a90bc8b7bda25b03 +Subproject commit 15324808110ffd1e8b68e04b85a14438eca65765 diff --git a/libultraship b/libultraship index 3c160249a0..4085f27db5 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 3c160249a0dbe52ee6768e0693fb389018e1d53a +Subproject commit 4085f27db593111da91b9754639e22316dfc1ec0 diff --git a/soh/include/functions.h b/soh/include/functions.h index 64d7026e1d..b3f8fad7e5 100644 --- a/soh/include/functions.h +++ b/soh/include/functions.h @@ -61,10 +61,10 @@ u32 Locale_IsRegionNative(void); void _assert(const char* exp, const char* file, s32 line); #elif defined(__linux__) void __assert(const char* exp, const char* file, s32 line) __THROW; -#elif !defined(__APPLE__) && !defined(__SWITCH__) +#elif !defined(SDL_PLATFORM_APPLE) && !defined(__SWITCH__) void __assert(const char* exp, const char* file, s32 line); #endif -#if defined(__APPLE__) && defined(NDEBUG) +#if defined(SDL_PLATFORM_APPLE) && defined(NDEBUG) void __assert(const char* exp, const char* file, s32 line); #endif void isPrintfInit(void); diff --git a/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp b/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp index c15f043649..727bb611d5 100644 --- a/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp +++ b/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp @@ -103,7 +103,7 @@ void AdvancedResolutionSettingsWindow::DrawElement() { const bool disabled_everything = !CVarGetInteger(CVAR_PREFIX_ADVANCED_RESOLUTION ".Enabled", 0); const bool disabled_pixelCount = !CVarGetInteger(CVAR_PREFIX_ADVANCED_RESOLUTION ".VerticalResolutionToggle", 0); -#ifdef __APPLE__ +#ifdef SDL_PLATFORM_APPLE // Display HiDPI warning. (Remove this once we can definitively say it's fixed.) ImGui::TextColored(messageColor[MESSAGE_INFO], ICON_FA_INFO_CIRCLE " These settings may behave incorrectly on Retina displays."); diff --git a/soh/soh/Enhancements/speechsynthesizer/SpeechSynthesizer.h b/soh/soh/Enhancements/speechsynthesizer/SpeechSynthesizer.h index 29d209b5f8..ded6a4143d 100644 --- a/soh/soh/Enhancements/speechsynthesizer/SpeechSynthesizer.h +++ b/soh/soh/Enhancements/speechsynthesizer/SpeechSynthesizer.h @@ -33,7 +33,7 @@ class SpeechSynthesizer { #ifdef _WIN32 #include "SAPISpeechSynthesizer.h" -#elif defined(__APPLE__) +#elif defined(SDL_PLATFORM_APPLE) #include "DarwinSpeechSynthesizer.h" #endif diff --git a/soh/soh/Extractor/FastCrc32C.c b/soh/soh/Extractor/FastCrc32C.c index d88b04bebe..44ba03baf2 100644 --- a/soh/soh/Extractor/FastCrc32C.c +++ b/soh/soh/Extractor/FastCrc32C.c @@ -122,7 +122,7 @@ uint32_t CRC32C(unsigned char* data, size_t dataSize) { unsigned int cpuidData[4]; #ifdef _WIN32 __cpuid(cpuidData, 1); -#elif __APPLE__ || (defined(__aarch64__) && defined(__ARM_FEATURE_CRC32)) +#elif SDL_PLATFORM_APPLE || (defined(__aarch64__) && defined(__ARM_FEATURE_CRC32)) // Every Mac that supports SoH should support this instruction. Also check for ARM64 at the same time return CRC32IntrinImpl(data, dataSize); #else diff --git a/soh/soh/Extractor/portable-file-dialogs.h b/soh/soh/Extractor/portable-file-dialogs.h index 1fc79a2910..4333e64cb1 100644 --- a/soh/soh/Extractor/portable-file-dialogs.h +++ b/soh/soh/Extractor/portable-file-dialogs.h @@ -32,7 +32,7 @@ #ifndef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 2 // for popen() #endif -#ifdef __APPLE__ +#ifdef SDL_PLATFORM_APPLE # ifndef _DARWIN_C_SOURCE # define _DARWIN_C_SOURCE # endif @@ -535,7 +535,7 @@ inline settings::settings(bool resync) #if _WIN32 flags(flag::is_vista) = internal::is_vista(); -#elif !__APPLE__ +#elif !SDL_PLATFORM_APPLE flags(flag::has_zenity) = check_program("zenity"); flags(flag::has_matedialog) = check_program("matedialog"); flags(flag::has_qarma) = check_program("qarma"); @@ -559,7 +559,7 @@ inline bool settings::available() { #if _WIN32 return true; -#elif __APPLE__ +#elif SDL_PLATFORM_APPLE return true; #elif __EMSCRIPTEN__ // FIXME: Return true after implementation is complete. @@ -603,7 +603,7 @@ inline bool settings::check_program(std::string const &program) inline bool settings::is_osascript() const { -#if __APPLE__ +#if SDL_PLATFORM_APPLE return true; #else return false; @@ -979,7 +979,7 @@ inline internal::dialog::dialog() inline std::vector internal::dialog::desktop_helper() const { -#if __APPLE__ +#if SDL_PLATFORM_APPLE return { "osascript" }; #else return { flags(flag::has_zenity) ? "zenity" diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index c3f6c12a30..68a97c3fb1 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -53,7 +53,7 @@ #include -#ifdef __APPLE__ +#ifdef SDL_PLATFORM_APPLE #include #else #include @@ -1147,7 +1147,7 @@ extern "C" void InitOTR() { ShipInit::InitAll(); AudioCollection::Instance = new AudioCollection(); ActorDB::Instance = new ActorDB(); -#ifdef __APPLE__ +#ifdef SDL_PLATFORM_APPLE SpeechSynthesizer::Instance = new DarwinSpeechSynthesizer(); SpeechSynthesizer::Instance->Init(); #elif defined(_WIN32) @@ -1333,7 +1333,7 @@ extern "C" void Graph_StartFrame() { break; } -#if defined(_WIN32) || defined(__APPLE__) +#if defined(_WIN32) || defined(SDL_PLATFORM_APPLE) case KbScancode::LUS_KB_F9: { // Toggle TTS CVarSetInteger(CVAR_SETTING("A11yTTS"), !CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)); diff --git a/soh/soh/SohGui.cpp b/soh/soh/SohGui.cpp index 6cc4e1de62..5100dc1ba0 100644 --- a/soh/soh/SohGui.cpp +++ b/soh/soh/SohGui.cpp @@ -13,7 +13,7 @@ #include #include -#ifdef __APPLE__ +#ifdef SDL_PLATFORM_APPLE #include "graphic/Fast3D/gfx_metal.h" #endif diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index f3a9557c27..2930de4f51 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -196,7 +196,7 @@ void DrawShipMenu() { UIWidgets::Spacer(0); #endif if (ImGui::MenuItem("Reset", -#ifdef __APPLE__ +#ifdef SDL_PLATFORM_APPLE "Command-R" #elif !defined(__SWITCH__) && !defined(__WIIU__) "Ctrl+R" @@ -319,7 +319,7 @@ void DrawSettingsMenu() { UIWidgets::Spacer(0); if (ImGui::BeginMenu("Graphics")) { - #ifndef __APPLE__ + #ifndef SDL_PLATFORM_APPLE const bool disabled_resolutionSlider = CVarGetInteger(CVAR_PREFIX_ADVANCED_RESOLUTION ".VerticalResolutionToggle", 0) && CVarGetInteger(CVAR_PREFIX_ADVANCED_RESOLUTION ".Enabled", 0); if (UIWidgets::EnhancementSliderFloat("Internal Resolution: %.1f %%", "##IMul", CVAR_INTERNAL_RESOLUTION, 0.5f, @@ -561,7 +561,7 @@ void DrawSettingsMenu() { UIWidgets::Spacer(0); if (ImGui::BeginMenu("Accessibility")) { - #if defined(_WIN32) || defined(__APPLE__) + #if defined(_WIN32) || defined(SDL_PLATFORM_APPLE) UIWidgets::PaddedEnhancementCheckbox("Text to Speech", CVAR_SETTING("A11yTTS")); UIWidgets::Tooltip("Enables text to speech for in game dialog"); #endif diff --git a/soh/src/buffers/heaps.c b/soh/src/buffers/heaps.c index 2191ae72f6..6efef60a40 100644 --- a/soh/src/buffers/heaps.c +++ b/soh/src/buffers/heaps.c @@ -1,6 +1,6 @@ #include "z64.h" #include -#ifndef __APPLE__ +#ifndef SDL_PLATFORM_APPLE #include #endif #include From 57e1a3eee80db3809474fb09cb37c9dcd73d3acc Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 04:15:55 -0500 Subject: [PATCH 04/29] some cmake stuff --- libultraship | 2 +- soh/CMakeLists.txt | 48 ++++++++++++++-------------------------------- 2 files changed, 15 insertions(+), 35 deletions(-) diff --git a/libultraship b/libultraship index 4085f27db5..ccfdf0e82d 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 4085f27db593111da91b9754639e22316dfc1ec0 +Subproject commit ccfdf0e82db5916b3fed5914412091eb01c72862 diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 8218588e4c..8d6ca27e5e 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -303,19 +303,20 @@ endif() ################################################################################ # Compile definitions ################################################################################ -find_package(SDL2) -set(SDL2-INCLUDE ${SDL2_INCLUDE_DIRS}) +find_package(SDL3) +set(SDL3-INCLUDE ${SDL3_INCLUDE_DIRS}) -if (BUILD_REMOTE_CONTROL) - find_package(SDL2_net) +# todo: figure out sdl net stuff +# if (BUILD_REMOTE_CONTROL) +# find_package(SDL2_net) - if(NOT SDL2_net_FOUND) - message(STATUS "SDL2_net not found (it's possible the version installed is too old). Disabling BUILD_REMOTE_CONTROL.") - set(BUILD_REMOTE_CONTROL 0) - else() - set(SDL2-NET-INCLUDE ${SDL_NET_INCLUDE_DIRS}) - endif() -endif() +# if(NOT SDL2_net_FOUND) +# message(STATUS "SDL2_net not found (it's possible the version installed is too old). Disabling BUILD_REMOTE_CONTROL.") +# set(BUILD_REMOTE_CONTROL 0) +# else() +# set(SDL2-NET-INCLUDE ${SDL_NET_INCLUDE_DIRS}) +# endif() +# endif() target_include_directories(${PROJECT_NAME} PRIVATE assets ${CMAKE_CURRENT_SOURCE_DIR}/include/ @@ -667,35 +668,14 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") "setupapi" ) endif() -elseif(CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch") - find_package(SDL2) - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads REQUIRED) - set(ADDITIONAL_LIBRARY_DEPENDENCIES - "libultraship;" - SDL2::SDL2 - -lglad - Threads::Threads - ) -elseif(CMAKE_SYSTEM_NAME STREQUAL "CafeOS") - find_package(SDL2 REQUIRED) - set(ADDITIONAL_LIBRARY_DEPENDENCIES - "libultraship;" - SDL2::SDL2-static - - "$<$:-Wl,--wrap=abort>" - ) - target_include_directories(${PROJECT_NAME} PRIVATE - ${DEVKITPRO}/portlibs/wiiu/include/ - ) else() - find_package(SDL2) + find_package(SDL3) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) set(ADDITIONAL_LIBRARY_DEPENDENCIES "libultraship;" "ZAPDLib;" - SDL2::SDL2 + SDL3::SDL3 "$<$:SDL2_net::SDL2_net>" ${CMAKE_DL_LIBS} Threads::Threads From 1365a1f182d64b8c43404c65daac6d4310963c08 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 06:55:24 -0500 Subject: [PATCH 05/29] change/document enough stuff that extractassets works --- libultraship | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship b/libultraship index ccfdf0e82d..fc9e4646f2 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit ccfdf0e82db5916b3fed5914412091eb01c72862 +Subproject commit fc9e4646f25684a60a25806efbeacb06ef8a5c58 From edee33600ed34ea8edbe3b60e811b5f8c9f5092c Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 09:57:54 -0500 Subject: [PATCH 06/29] change/document enough stuff that we can get in-game --- libultraship | 2 +- soh/soh/Extractor/Extract.cpp | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libultraship b/libultraship index fc9e4646f2..59310de146 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit fc9e4646f25684a60a25806efbeacb06ef8a5c58 +Subproject commit 59310de146ac9c00364266c825165ca44ef28dcd diff --git a/soh/soh/Extractor/Extract.cpp b/soh/soh/Extractor/Extract.cpp index 7b15ed2982..771b6d4c47 100644 --- a/soh/soh/Extractor/Extract.cpp +++ b/soh/soh/Extractor/Extract.cpp @@ -121,13 +121,15 @@ int Extractor::ShowRomPickBox(uint32_t verCrc) const { SDL_MessageBoxButtonData buttons[3] = { { 0 } }; int ret; - buttons[0].buttonid = 0; + // https://wiki.libsdl.org/SDL3/README/migration#sdl_messageboxh + // The buttonid field of SDL_MessageBoxButtonData has been renamed buttonID. + buttons[0].buttonID = 0; buttons[0].text = "Yes"; buttons[0].flags = SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT; - buttons[1].buttonid = 1; + buttons[1].buttonID = 1; buttons[1].text = "No"; buttons[1].flags = SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT; - buttons[2].buttonid = 2; + buttons[2].buttonID = 2; buttons[2].text = "Find ROM"; boxData.numbuttons = 3; boxData.flags = SDL_MESSAGEBOX_INFORMATION; @@ -152,10 +154,12 @@ int Extractor::ShowYesNoBox(const char* title, const char* box) { SDL_MessageBoxData boxData = { 0 }; SDL_MessageBoxButtonData buttons[2] = { { 0 } }; - buttons[0].buttonid = IDYES; + // https://wiki.libsdl.org/SDL3/README/migration#sdl_messageboxh + // The buttonid field of SDL_MessageBoxButtonData has been renamed buttonID. + buttons[0].buttonID = IDYES; buttons[0].text = "Yes"; buttons[0].flags = SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT; - buttons[1].buttonid = IDNO; + buttons[1].buttonID = IDNO; buttons[1].text = "No"; buttons[1].flags = SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT; boxData.numbuttons = 2; From 3a847293393d28d7588126e4b80cf17769fe71e8 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 10:56:25 -0500 Subject: [PATCH 07/29] some gamepad stuff --- libultraship | 2 +- .../controls/SohInputEditorWindow.cpp | 50 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/libultraship b/libultraship index 59310de146..f460db7bac 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 59310de146ac9c00364266c825165ca44ef28dcd +Subproject commit f460db7bace5f2e57faaf30acd3c1b1554077231 diff --git a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp index 492517738a..a284a8f8ff 100644 --- a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp +++ b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp @@ -330,9 +330,9 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, N64Butt ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetDeviceIndexMappingFromShipDeviceIndex(mapping->GetShipDeviceIndex()); - auto sdlIndexMapping = std::dynamic_pointer_cast(indexMapping); + auto sdlInstanceIDMapping = std::dynamic_pointer_cast(indexMapping); - if (sdlIndexMapping != nullptr && sdlAxisDirectionToButtonMapping != nullptr) { + if (sdlInstanceIDMapping != nullptr && sdlAxisDirectionToButtonMapping != nullptr) { ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.0f, 0.5f)); auto buttonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button); auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered); @@ -360,14 +360,14 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, N64Butt if (sdlAxisDirectionToButtonMapping->AxisIsStick()) { ImGui::Text("Stick axis threshold:"); - int32_t stickAxisThreshold = sdlIndexMapping->GetStickAxisThresholdPercentage(); + int32_t stickAxisThreshold = sdlInstanceIDMapping->GetStickAxisThresholdPercentage(); if (stickAxisThreshold == 0) { ImGui::BeginDisabled(); } ImGui::PushButtonRepeat(true); if (ImGui::Button(StringHelper::Sprintf("-##Stick Axis Threshold%s", id.c_str()).c_str())) { - sdlIndexMapping->SetStickAxisThresholdPercentage(stickAxisThreshold - 1); - sdlIndexMapping->SaveToConfig(); + sdlInstanceIDMapping->SetStickAxisThresholdPercentage(stickAxisThreshold - 1); + sdlInstanceIDMapping->SaveToConfig(); } ImGui::PopButtonRepeat(); if (stickAxisThreshold == 0) { @@ -377,8 +377,8 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, N64Butt ImGui::SetNextItemWidth(SCALE_IMGUI_SIZE(160.0f)); if (ImGui::SliderInt(StringHelper::Sprintf("##Stick Axis Threshold%s", id.c_str()).c_str(), &stickAxisThreshold, 0, 100, "%d%%", ImGuiSliderFlags_AlwaysClamp)) { - sdlIndexMapping->SetStickAxisThresholdPercentage(stickAxisThreshold); - sdlIndexMapping->SaveToConfig(); + sdlInstanceIDMapping->SetStickAxisThresholdPercentage(stickAxisThreshold); + sdlInstanceIDMapping->SaveToConfig(); } ImGui::SameLine(0.0f, 0.0f); if (stickAxisThreshold == 100) { @@ -386,8 +386,8 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, N64Butt } ImGui::PushButtonRepeat(true); if (ImGui::Button(StringHelper::Sprintf("+##Stick Axis Threshold%s", id.c_str()).c_str())) { - sdlIndexMapping->SetStickAxisThresholdPercentage(stickAxisThreshold + 1); - sdlIndexMapping->SaveToConfig(); + sdlInstanceIDMapping->SetStickAxisThresholdPercentage(stickAxisThreshold + 1); + sdlInstanceIDMapping->SaveToConfig(); } ImGui::PopButtonRepeat(); if (stickAxisThreshold == 100) { @@ -398,14 +398,14 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, N64Butt if (sdlAxisDirectionToButtonMapping->AxisIsTrigger()) { ImGui::Text("Trigger axis threshold:"); - int32_t triggerAxisThreshold = sdlIndexMapping->GetTriggerAxisThresholdPercentage(); + int32_t triggerAxisThreshold = sdlInstanceIDMapping->GetTriggerAxisThresholdPercentage(); if (triggerAxisThreshold == 0) { ImGui::BeginDisabled(); } ImGui::PushButtonRepeat(true); if (ImGui::Button(StringHelper::Sprintf("-##Trigger Axis Threshold%s", id.c_str()).c_str())) { - sdlIndexMapping->SetTriggerAxisThresholdPercentage(triggerAxisThreshold - 1); - sdlIndexMapping->SaveToConfig(); + sdlInstanceIDMapping->SetTriggerAxisThresholdPercentage(triggerAxisThreshold - 1); + sdlInstanceIDMapping->SaveToConfig(); } ImGui::PopButtonRepeat(); if (triggerAxisThreshold == 0) { @@ -415,8 +415,8 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, N64Butt ImGui::SetNextItemWidth(SCALE_IMGUI_SIZE(160.0f)); if (ImGui::SliderInt(StringHelper::Sprintf("##Trigger Axis Threshold%s", id.c_str()).c_str(), &triggerAxisThreshold, 0, 100, "%d%%", ImGuiSliderFlags_AlwaysClamp)) { - sdlIndexMapping->SetTriggerAxisThresholdPercentage(triggerAxisThreshold); - sdlIndexMapping->SaveToConfig(); + sdlInstanceIDMapping->SetTriggerAxisThresholdPercentage(triggerAxisThreshold); + sdlInstanceIDMapping->SaveToConfig(); } ImGui::SameLine(0.0f, 0.0f); if (triggerAxisThreshold == 100) { @@ -424,8 +424,8 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, N64Butt } ImGui::PushButtonRepeat(true); if (ImGui::Button(StringHelper::Sprintf("+##Trigger Axis Threshold%s", id.c_str()).c_str())) { - sdlIndexMapping->SetTriggerAxisThresholdPercentage(triggerAxisThreshold + 1); - sdlIndexMapping->SaveToConfig(); + sdlInstanceIDMapping->SetTriggerAxisThresholdPercentage(triggerAxisThreshold + 1); + sdlInstanceIDMapping->SaveToConfig(); } ImGui::PopButtonRepeat(); if (triggerAxisThreshold == 100) { @@ -1657,24 +1657,24 @@ void SohInputEditorWindow::DrawDeviceVisibilityButtons() { ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappingsFromConfig()) { - auto sdlIndexMapping = std::static_pointer_cast(mapping); - if (sdlIndexMapping == nullptr) { + auto sdlInstanceIDMapping = std::static_pointer_cast(mapping); + if (sdlInstanceIDMapping == nullptr) { continue; } - indexMappings[lusIndex] = { sdlIndexMapping->GetSDLControllerName(), -1 }; + indexMappings[lusIndex] = { sdlInstanceIDMapping->GetSDLControllerName(), -1 }; } for (auto [lusIndex, mapping] : Ship::Context::GetInstance() ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappings()) { - auto sdlIndexMapping = std::static_pointer_cast(mapping); - if (sdlIndexMapping == nullptr) { + auto sdlInstanceIDMapping = std::static_pointer_cast(mapping); + if (sdlInstanceIDMapping == nullptr) { continue; } - indexMappings[lusIndex] = { sdlIndexMapping->GetSDLControllerName(), sdlIndexMapping->GetSDLDeviceIndex() }; + indexMappings[lusIndex] = { sdlInstanceIDMapping->GetSDLControllerName(), sdlInstanceIDMapping->GetSDLInstanceID() }; } auto keyboardButtonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button); @@ -2015,12 +2015,12 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) { ->GetControlDeck() ->GetDeviceIndexMappingManager() ->GetAllDeviceIndexMappings()) { - auto sdlIndexMapping = std::static_pointer_cast(mapping); - if (sdlIndexMapping == nullptr) { + auto sdlInstanceIDMapping = std::static_pointer_cast(mapping); + if (sdlInstanceIDMapping == nullptr) { continue; } - indexMappings[lusIndex] = { sdlIndexMapping->GetSDLControllerName(), sdlIndexMapping->GetSDLDeviceIndex() }; + indexMappings[lusIndex] = { sdlInstanceIDMapping->GetSDLControllerName(), sdlInstanceIDMapping->GetSDLInstanceID() }; } bool shouldClose = false; From a543677ab88c3d1d77a479db6df3c2e0ba6e2927 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 11:43:09 -0500 Subject: [PATCH 08/29] controllers --- libultraship | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship b/libultraship index f460db7bac..49f91840c7 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit f460db7bace5f2e57faaf30acd3c1b1554077231 +Subproject commit 49f91840c799fea9f26ccd3d0d52fbe5a9174a5a From 062a48cc9a13c6b5591edfe682680bc0d438185e Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 11:49:46 -0500 Subject: [PATCH 09/29] try to get a linux build on ci --- .github/workflows/generate-builds.yml | 42 +++++++++++++-------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/generate-builds.yml b/.github/workflows/generate-builds.yml index 64c908a37a..407ac77683 100644 --- a/.github/workflows/generate-builds.yml +++ b/.github/workflows/generate-builds.yml @@ -32,16 +32,16 @@ jobs: ${{ runner.os }}-otr-build- path: | build-cmake - SDL2-2.30.3 + SDL3-3.1.8 tinyxml2-10.0.0 - name: Install latest SDL run: | export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" if [ ! -d "SDL2-2.30.3" ]; then - wget https://www.libsdl.org/release/SDL2-2.30.3.tar.gz - tar -xzf SDL2-2.30.3.tar.gz + wget https://www.libsdl.org/release/SDL3-3.1.8.tar.gz + tar -xzf SDL3-3.1.8.tar.gz fi - cd SDL2-2.30.3 + cd SDL3-3.1.8 ./configure --enable-hidapi-libusb make -j 10 sudo make install @@ -158,34 +158,34 @@ jobs: linux-build-${{ github.ref }} linux-build- path: | - SDL2-2.30.3 + SDL3-3.1.8 SDL2_net-2.2.0 tinyxml2-10.0.0 libzip-1.10.1 - name: Install latest SDL run: | export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - if [ ! -d "SDL2-2.30.3" ]; then - wget https://www.libsdl.org/release/SDL2-2.30.3.tar.gz - tar -xzf SDL2-2.30.3.tar.gz + if [ ! -d "SDL3-3.1.8" ]; then + wget https://www.libsdl.org/release/SDL3-3.1.8.tar.gz + tar -xzf SDL3-3.1.8.tar.gz fi - cd SDL2-2.30.3 + cd SDL3-3.1.8 ./configure --enable-hidapi-libusb make -j 10 sudo make install sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ - - name: Install latest SDL_net - run: | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - if [ ! -d "SDL2_net-2.2.0" ]; then - wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz - tar -xzf SDL2_net-2.2.0.tar.gz - fi - cd SDL2_net-2.2.0 - ./configure - make -j 10 - sudo make install - sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ + # - name: Install latest SDL_net + # run: | + # export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + # if [ ! -d "SDL2_net-2.2.0" ]; then + # wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz + # tar -xzf SDL2_net-2.2.0.tar.gz + # fi + # cd SDL2_net-2.2.0 + # ./configure + # make -j 10 + # sudo make install + # sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ - name: Install latest tinyxml2 run: | sudo apt-get remove libtinyxml2-dev From 8b36116e08d1c3f7bf797d01b5faf92750158425 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 11:52:19 -0500 Subject: [PATCH 10/29] submodule commit wrangling --- libultraship | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship b/libultraship index 49f91840c7..4f4460e09c 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 49f91840c799fea9f26ccd3d0d52fbe5a9174a5a +Subproject commit 4f4460e09cf0ab27d3eb6aac802599642232e002 From ac0e9ab9f9a19a50d27e9103b5a8c790273f5815 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 12:03:50 -0500 Subject: [PATCH 11/29] build with cmake --- .github/workflows/generate-builds.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/generate-builds.yml b/.github/workflows/generate-builds.yml index 407ac77683..b8eb114b3b 100644 --- a/.github/workflows/generate-builds.yml +++ b/.github/workflows/generate-builds.yml @@ -37,14 +37,13 @@ jobs: - name: Install latest SDL run: | export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - if [ ! -d "SDL2-2.30.3" ]; then + if [ ! -d "SDL3-3.1.8" ]; then wget https://www.libsdl.org/release/SDL3-3.1.8.tar.gz tar -xzf SDL3-3.1.8.tar.gz fi - cd SDL3-3.1.8 - ./configure --enable-hidapi-libusb - make -j 10 - sudo make install + cmake -S ./SDL3-3.1.8 -B ./SDL_build + cmake --build ./SDL_build + cmake --install ./SDL_build --prefix /usr/local sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ - name: Install latest tinyxml2 run: | From ea9164e0853a373b3fa372d3bf1f14b8df5fd12f Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 12:06:37 -0500 Subject: [PATCH 12/29] sudo it --- .github/workflows/generate-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-builds.yml b/.github/workflows/generate-builds.yml index b8eb114b3b..bc43a3fa4c 100644 --- a/.github/workflows/generate-builds.yml +++ b/.github/workflows/generate-builds.yml @@ -43,7 +43,7 @@ jobs: fi cmake -S ./SDL3-3.1.8 -B ./SDL_build cmake --build ./SDL_build - cmake --install ./SDL_build --prefix /usr/local + sudo cmake --install ./SDL_build --prefix /usr/local sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ - name: Install latest tinyxml2 run: | From 8fa82022d856ea3012c90b54d809971e8d99ff44 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 12:20:12 -0500 Subject: [PATCH 13/29] play with dirs a bit --- .github/workflows/generate-builds.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-builds.yml b/.github/workflows/generate-builds.yml index bc43a3fa4c..672ce52cac 100644 --- a/.github/workflows/generate-builds.yml +++ b/.github/workflows/generate-builds.yml @@ -41,9 +41,12 @@ jobs: wget https://www.libsdl.org/release/SDL3-3.1.8.tar.gz tar -xzf SDL3-3.1.8.tar.gz fi - cmake -S ./SDL3-3.1.8 -B ./SDL_build - cmake --build ./SDL_build - sudo cmake --install ./SDL_build --prefix /usr/local + cd SDL3-3.1.8 + mkdir -p build + cd build + cmake -S .. -B . + cmake --build . + sudo cmake --install . --prefix /usr/local sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ - name: Install latest tinyxml2 run: | From 798cd48fbea7b2a726b5488b1a5b8e07241c06be Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 12:23:49 -0500 Subject: [PATCH 14/29] more dirs --- .github/workflows/generate-builds.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-builds.yml b/.github/workflows/generate-builds.yml index 672ce52cac..adbcb65b45 100644 --- a/.github/workflows/generate-builds.yml +++ b/.github/workflows/generate-builds.yml @@ -172,9 +172,11 @@ jobs: tar -xzf SDL3-3.1.8.tar.gz fi cd SDL3-3.1.8 - ./configure --enable-hidapi-libusb - make -j 10 - sudo make install + mkdir -p build + cd build + cmake -S .. -B . + cmake --build . + sudo cmake --install . --prefix /usr/local sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ # - name: Install latest SDL_net # run: | From 4791796960400050bb1fdd90359a7669a62378d7 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 12:29:30 -0500 Subject: [PATCH 15/29] i guess just install sdl net for now even though i haven't figured out if it works --- .github/workflows/generate-builds.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/generate-builds.yml b/.github/workflows/generate-builds.yml index adbcb65b45..a9c5a3411a 100644 --- a/.github/workflows/generate-builds.yml +++ b/.github/workflows/generate-builds.yml @@ -178,18 +178,18 @@ jobs: cmake --build . sudo cmake --install . --prefix /usr/local sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ - # - name: Install latest SDL_net - # run: | - # export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - # if [ ! -d "SDL2_net-2.2.0" ]; then - # wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz - # tar -xzf SDL2_net-2.2.0.tar.gz - # fi - # cd SDL2_net-2.2.0 - # ./configure - # make -j 10 - # sudo make install - # sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ + - name: Install latest SDL_net + run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + if [ ! -d "SDL2_net-2.2.0" ]; then + wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz + tar -xzf SDL2_net-2.2.0.tar.gz + fi + cd SDL2_net-2.2.0 + ./configure + make -j 10 + sudo make install + sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ - name: Install latest tinyxml2 run: | sudo apt-get remove libtinyxml2-dev From 735a2b4cf328005d2c8a8c295da63e9353930435 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 12:42:57 -0500 Subject: [PATCH 16/29] just rip out sdl net to get stuff to build --- soh/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 8d6ca27e5e..02d6cdc3da 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -676,7 +676,7 @@ else() "libultraship;" "ZAPDLib;" SDL3::SDL3 - "$<$:SDL2_net::SDL2_net>" + # "$<$:SDL2_net::SDL2_net>" ${CMAKE_DL_LIBS} Threads::Threads ) From d66b99ced2ecf2398285403328fdf4f618880a49 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 13:08:53 -0500 Subject: [PATCH 17/29] go the other way --- soh/CMakeLists.txt | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 02d6cdc3da..74fb43c0a0 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -306,17 +306,16 @@ endif() find_package(SDL3) set(SDL3-INCLUDE ${SDL3_INCLUDE_DIRS}) -# todo: figure out sdl net stuff -# if (BUILD_REMOTE_CONTROL) -# find_package(SDL2_net) - -# if(NOT SDL2_net_FOUND) -# message(STATUS "SDL2_net not found (it's possible the version installed is too old). Disabling BUILD_REMOTE_CONTROL.") -# set(BUILD_REMOTE_CONTROL 0) -# else() -# set(SDL2-NET-INCLUDE ${SDL_NET_INCLUDE_DIRS}) -# endif() -# endif() +if (BUILD_REMOTE_CONTROL) + find_package(SDL2_net) + + if(NOT SDL2_net_FOUND) + message(STATUS "SDL2_net not found (it's possible the version installed is too old). Disabling BUILD_REMOTE_CONTROL.") + set(BUILD_REMOTE_CONTROL 0) + else() + set(SDL2-NET-INCLUDE ${SDL_NET_INCLUDE_DIRS}) + endif() +endif() target_include_directories(${PROJECT_NAME} PRIVATE assets ${CMAKE_CURRENT_SOURCE_DIR}/include/ @@ -676,7 +675,7 @@ else() "libultraship;" "ZAPDLib;" SDL3::SDL3 - # "$<$:SDL2_net::SDL2_net>" + "$<$:SDL2_net::SDL2_net>" ${CMAKE_DL_LIBS} Threads::Threads ) From 9b65dd8ca9c360772104c123cd76c912aa9cac6f Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 13:15:37 -0500 Subject: [PATCH 18/29] ? --- soh/soh/Network/Network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Network/Network.h b/soh/soh/Network/Network.h index 3c98600e9c..4108db75ae 100644 --- a/soh/soh/Network/Network.h +++ b/soh/soh/Network/Network.h @@ -4,7 +4,7 @@ #ifdef __cplusplus #include -#include +#include #include class Network { From 13822f5f453897a824d1995f62d0a439578618d7 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 13:35:05 -0500 Subject: [PATCH 19/29] just turn it off for now --- .github/workflows/generate-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-builds.yml b/.github/workflows/generate-builds.yml index a9c5a3411a..440f160c08 100644 --- a/.github/workflows/generate-builds.yml +++ b/.github/workflows/generate-builds.yml @@ -225,7 +225,7 @@ jobs: - name: Build SoH run: | export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_REMOTE_CONTROL=1 + cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_REMOTE_CONTROL=0 cmake --build build-cmake --config Release -j3 (cd build-cmake && cpack -G External) From 4316b45dbc2ba3a201cf7fa8f8371473eecae791 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 13:48:37 -0500 Subject: [PATCH 20/29] start on mac --- .github/workflows/macports-deps.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macports-deps.txt b/.github/workflows/macports-deps.txt index d150390781..9a0578e9c4 100644 --- a/.github/workflows/macports-deps.txt +++ b/.github/workflows/macports-deps.txt @@ -1 +1 @@ -libsdl2 +universal libsdl2_net +universal libpng +universal glew +universal libzip +universal nlohmann-json +universal tinyxml2 +universal \ No newline at end of file +SDL3-devel +universal libsdl2_net +universal libpng +universal glew +universal libzip +universal nlohmann-json +universal tinyxml2 +universal \ No newline at end of file From 8784aee41ee6163201321edd91c33e19d7b94915 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 13:58:19 -0500 Subject: [PATCH 21/29] add windows to the mix --- .github/workflows/generate-builds.yml | 4 ++-- CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-builds.yml b/.github/workflows/generate-builds.yml index 440f160c08..8a6251899c 100644 --- a/.github/workflows/generate-builds.yml +++ b/.github/workflows/generate-builds.yml @@ -120,7 +120,7 @@ jobs: name: soh.otr - name: Build SoH run: | - cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DBUILD_REMOTE_CONTROL=1 + cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DBUILD_REMOTE_CONTROL=0 cmake --build build-cmake --config Release --parallel 10 mv soh.otr build-cmake/soh (cd build-cmake && cpack) @@ -279,7 +279,7 @@ jobs: VCPKG_ROOT: ${{github.workspace}}/vcpkg run: | set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH" - cmake -S . -B build-windows -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DBUILD_REMOTE_CONTROL=1 + cmake -S . -B build-windows -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DBUILD_REMOTE_CONTROL=0 cmake --build build-windows --config Release --parallel 10 mkdir soh-windows diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bdaf1de99..c6cac9557b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,7 +79,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") set(VCPKG_TARGET_TRIPLET x64-windows-static) vcpkg_bootstrap() - vcpkg_install_packages(zlib bzip2 libzip libpng sdl2 sdl2-net glew glfw3 nlohmann-json tinyxml2 spdlog) + vcpkg_install_packages(zlib bzip2 libzip libpng sdl3 sdl2-net glew glfw3 nlohmann-json tinyxml2 spdlog) if (CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache|sccache") set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded) From a004cac4c5246dba72056b8d5ab6f7006a78454d Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:17:39 -0500 Subject: [PATCH 22/29] what's up with macros? --- soh/CMakeLists.txt | 8 ++++---- soh/src/buffers/heaps.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 74fb43c0a0..2c39727c65 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -644,8 +644,8 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") "libultraship;" "ZAPDLib;" "glu32;" - "SDL2::SDL2;" - "SDL2::SDL2main;" + "SDL3::SDL3;" + "SDL3::SDL3main;" "$<$:SDL2_net::SDL2_net-static>" "glfw;" "winmm;" @@ -658,8 +658,8 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") "libultraship;" "ZAPDLib;" "glu32;" - "SDL2::SDL2;" - "SDL2::SDL2main;" + "SDL3::SDL3;" + "SDL3::SDL3main;" "glfw;" "winmm;" "imm32;" diff --git a/soh/src/buffers/heaps.c b/soh/src/buffers/heaps.c index 6efef60a40..2191ae72f6 100644 --- a/soh/src/buffers/heaps.c +++ b/soh/src/buffers/heaps.c @@ -1,6 +1,6 @@ #include "z64.h" #include -#ifndef SDL_PLATFORM_APPLE +#ifndef __APPLE__ #include #endif #include From 56549d8cafb9217f222c7310fe09084ce4c42e13 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:24:44 -0500 Subject: [PATCH 23/29] is sdl3main not a thing? --- soh/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 2c39727c65..8c54cf71fa 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -645,7 +645,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") "ZAPDLib;" "glu32;" "SDL3::SDL3;" - "SDL3::SDL3main;" "$<$:SDL2_net::SDL2_net-static>" "glfw;" "winmm;" @@ -659,7 +658,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") "ZAPDLib;" "glu32;" "SDL3::SDL3;" - "SDL3::SDL3main;" "glfw;" "winmm;" "imm32;" From b011817e0557bb3e2d51dbfa3764ebd9ec4f6ae0 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:32:58 -0500 Subject: [PATCH 24/29] spots --- libultraship | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship b/libultraship index 4f4460e09c..0aaf07be70 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 4f4460e09cf0ab27d3eb6aac802599642232e002 +Subproject commit 0aaf07be7074494a0d88fe964aa5dfd7d1b2abcb From 4e599c90596b88548c106cfd70e5fc4a31269a67 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:48:05 -0500 Subject: [PATCH 25/29] header --- libultraship | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship b/libultraship index 0aaf07be70..4d991531b4 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 0aaf07be7074494a0d88fe964aa5dfd7d1b2abcb +Subproject commit 4d991531b4db8c6fc449c8cad5788e9a30ff3fe1 From b763ceb117290442d3780290a5f2d08a7250c044 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 15:09:51 -0500 Subject: [PATCH 26/29] syswm stuff --- libultraship | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship b/libultraship index 4d991531b4..86714527c1 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 4d991531b4db8c6fc449c8cad5788e9a30ff3fe1 +Subproject commit 86714527c10381c623913b37e143966adddf5217 From 294d6734e8fc397956d10303c5086bda7bab1236 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 15:28:35 -0500 Subject: [PATCH 27/29] pi? huh? --- soh/soh/Enhancements/randomizer/draw.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/soh/soh/Enhancements/randomizer/draw.cpp b/soh/soh/Enhancements/randomizer/draw.cpp index bd7f92a84c..d1e9db40ee 100644 --- a/soh/soh/Enhancements/randomizer/draw.cpp +++ b/soh/soh/Enhancements/randomizer/draw.cpp @@ -20,6 +20,11 @@ #include "soh_assets.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" +// no idea why this suddently decided it didn't exist on windows +#ifndef M_PI_2 +#define M_PI_2 1.57079632679489661923 +#endif + extern "C" { extern SaveContext gSaveContext; } From ee131ec3e06091e4a4697262e62d2ce640f6b4ba Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 15:52:19 -0500 Subject: [PATCH 28/29] main stuff --- soh/src/code/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/soh/src/code/main.c b/soh/src/code/main.c index 9d52833fd0..8f5b97903f 100644 --- a/soh/src/code/main.c +++ b/soh/src/code/main.c @@ -1,5 +1,8 @@ #ifdef _WIN32 #include +// https://wiki.libsdl.org/SDL3/README/migration +// The SDLmain library has been removed, it's been entirely replaced by SDL_main.h. +#include #endif #include "global.h" From 74564d77cf5cd641290f66d12c0d7b917837a048 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sat, 11 Jan 2025 16:20:48 -0500 Subject: [PATCH 29/29] mac? --- libultraship | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship b/libultraship index 86714527c1..a465cf33af 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 86714527c10381c623913b37e143966adddf5217 +Subproject commit a465cf33af4384a3b73a5d64f3cd1ebe3956adc0