From 15e22349df2def6b4904b9b3dd1589d703fa7105 Mon Sep 17 00:00:00 2001
From: Ada <60364512+GreatArgorath@users.noreply.github.com>
Date: Fri, 30 Sep 2022 19:24:59 +0100
Subject: [PATCH 1/7] Fixes Master Quest on Mac and Linux (#1641)
---
scripts/linux/appimage/soh.sh | 4 ++++
soh/macosx/soh-macos.sh | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/scripts/linux/appimage/soh.sh b/scripts/linux/appimage/soh.sh
index 120d775c0..4df9798b3 100644
--- a/scripts/linux/appimage/soh.sh
+++ b/scripts/linux/appimage/soh.sh
@@ -25,6 +25,10 @@ while [[ ! -e "$SHIP_HOME"/oot.otr ]]; do
ROM=GC_NMQ_D;;
0227d7c0074f2d0ac935631990da8ec5914597b4)
ROM=GC_NMQ_PAL_F;;
+ 50bebedad9e0f10746a52b07239e47fa6c284d03)
+ ROM=GC_MQ_D;;
+ 079b855b943d6ad8bd1eb026c0ed169ecbdac7da)
+ ROM=GC_MQ_D;;
*)
if [ -n "$ZENITY" ]; then
zenity --error --timeout=10 --text="ROM hash $ROMHASH does not match" --title="Incorrect ROM file" --width=500 --width=200
diff --git a/soh/macosx/soh-macos.sh b/soh/macosx/soh-macos.sh
index 4d57f8782..14242a29a 100755
--- a/soh/macosx/soh-macos.sh
+++ b/soh/macosx/soh-macos.sh
@@ -40,6 +40,10 @@ while [ ! -e "$DATA_SHARE/oot.otr" ]; do
export ROM=GC_NMQ_D;;
0227d7c0074f2d0ac935631990da8ec5914597b4)
export ROM=GC_NMQ_PAL_F;;
+ 50bebedad9e0f10746a52b07239e47fa6c284d03)
+ export ROM=GC_MQ_D;;
+ 079b855b943d6ad8bd1eb026c0ed169ecbdac7da)
+ export ROM=GC_MQ_D;;
*)
WRONGHASH="$(osascript -ss - "$ROMHASH" <<-EOF
display dialog "Incompatible ROM hash $ROMHASH" \
From 97211093f3f8366bfbefe7b7ad89542cf53a1549 Mon Sep 17 00:00:00 2001
From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com>
Date: Sat, 1 Oct 2022 18:06:00 +0200
Subject: [PATCH 2/7] Wii U: Fix overflow for GX2CopySurfaceEx (#1655)
The max amount of rects is 25, everything larger silently overwrites the stack
---
libultraship/libultraship/Lib/Fast3D/gfx_gx2.cpp | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_gx2.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_gx2.cpp
index f3e734772..ac599160a 100644
--- a/libultraship/libultraship/Lib/Fast3D/gfx_gx2.cpp
+++ b/libultraship/libultraship/Lib/Fast3D/gfx_gx2.cpp
@@ -738,15 +738,11 @@ static std::unordered_map, uint16_t, hash_pair_ff> gfx_g
}
std::unordered_map, uint16_t, hash_pair_ff> res;
- if (!coordinates.size()) {
- return res;
- }
-
- GX2Rect srcRects[32];
- GX2Point dstPoints[32];
+ GX2Rect srcRects[25];
+ GX2Point dstPoints[25];
size_t num_coordinates = coordinates.size();
while (num_coordinates > 0) {
- size_t numRects = 32;
+ size_t numRects = 25;
if (num_coordinates < numRects) {
numRects = num_coordinates;
}
@@ -755,8 +751,8 @@ static std::unordered_map, uint16_t, hash_pair_ff> gfx_g
// initialize rects and points
for (size_t i = 0; i < numRects; ++i) {
const auto& c = *std::next(coordinates.begin(), num_coordinates + i);
- const int32_t x = (int32_t) std::clamp(c.first, 0.0f, (float) buffer->depth_buffer.surface.width - 1);
- const int32_t y = (int32_t) std::clamp(c.second, 0.0f, (float) buffer->depth_buffer.surface.height - 1);
+ const int32_t x = (int32_t) std::clamp(c.first, 0.0f, (float) (buffer->depth_buffer.surface.width - 1));
+ const int32_t y = (int32_t) std::clamp(c.second, 0.0f, (float) (buffer->depth_buffer.surface.height - 1));
srcRects[i] = GX2Rect{
x,
From af13595aae07c02fbe19b7fa417ba670c513cbc3 Mon Sep 17 00:00:00 2001
From: briaguya
Date: Sat, 1 Oct 2022 12:59:10 -0400
Subject: [PATCH 3/7] fix: disable randomizer cvar when in master quest
---
soh/soh/Enhancements/bootcommands.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/soh/soh/Enhancements/bootcommands.c b/soh/soh/Enhancements/bootcommands.c
index 1e589297d..498e9d9e7 100644
--- a/soh/soh/Enhancements/bootcommands.c
+++ b/soh/soh/Enhancements/bootcommands.c
@@ -27,6 +27,11 @@ void BootCommands_Init()
CVar_RegisterS32("gHudColors", 1); //0 = N64 / 1 = NGC / 2 = Custom
CVar_RegisterS32("gInvertYAxis", 1);
CVar_RegisterS32("gTrailDuration", 4); // 4 = Default trail duration
+ if (ResourceMgr_IsGameMasterQuest()) {
+ CVar_SetS32("gRandomizer", 0);
+ } else {
+ CVar_RegisterS32("gRandomizer", 0);
+ }
#if defined(__SWITCH__) || defined(__WIIU__)
CVar_RegisterS32("gControlNav", 1); // always enable controller nav on switch/wii u
#endif
From d61b398f41dcb22aa25031dcdb0b3055e73a88bf Mon Sep 17 00:00:00 2001
From: louis
Date: Sat, 1 Oct 2022 12:53:03 -0400
Subject: [PATCH 4/7] Fix MQ not going away after deleting file
---
soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c
index 18cf4598f..2349dc5ef 100644
--- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c
+++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c
@@ -1421,7 +1421,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0);
}
//Draw MQ label
- if (Save_GetSaveMetaInfo(i)->isMasterQuest) {
+ if (Save_GetSaveMetaInfo(i)->isMasterQuest && Save_GetSaveMetaInfo(i)->valid) {
if (CVar_GetS32("gHudColors", 1) == 2 && FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->nameAlpha[i]);
} else if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) {
From 973ec52b2a90ed46970a0d4dd88985306963c6a4 Mon Sep 17 00:00:00 2001
From: briaguya
Date: Fri, 30 Sep 2022 01:07:41 -0400
Subject: [PATCH 5/7] chore: increment version to bravo
---
CMakeLists.txt | 2 +-
soh/macosx/Info.plist | 6 +++---
soh/src/boot/build.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 536bb4d25..436872372 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,7 +10,7 @@ project(Ship C CXX)
set(PROJECT_VERSION_MAJOR "4")
set(PROJECT_VERSION_MINOR "0")
-set(PROJECT_VERSION_PATCH "0")
+set(PROJECT_VERSION_PATCH "1")
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
add_compile_options($<$:/MP>)
diff --git a/soh/macosx/Info.plist b/soh/macosx/Info.plist
index 96a23c83d..800d42eeb 100644
--- a/soh/macosx/Info.plist
+++ b/soh/macosx/Info.plist
@@ -9,7 +9,7 @@
CFBundleExecutable
soh
CFBundleGetInfoString
- 4.0.0
+ 4.0.1
CFBundleIconFile
soh.icns
CFBundleIdentifier
@@ -22,11 +22,11 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 4.0.0
+ 4.0.1
CFBundleSignature
ZOoT
CFBundleVersion
- 4.0.0
+ 4.0.1
NSHumanReadableCopyright
Copyright 2022 HarbourMasters.
LSMinimumSystemVersion
diff --git a/soh/src/boot/build.c b/soh/src/boot/build.c
index f4cb1c21b..0fb6d64ad 100644
--- a/soh/src/boot/build.c
+++ b/soh/src/boot/build.c
@@ -1,4 +1,4 @@
-const char gBuildVersion[] = "ZHORA ALFA (4.0.0)";
+const char gBuildVersion[] = "ZHORA BRAVO (4.0.1)";
const char gBuildTeam[] = "github.com/harbourmasters";
const char gBuildDate[] = __DATE__ " " __TIME__;
const char gBuildMakeOption[] = "";
From 9804035dc013d505b0ef13ae3a56310be816b1fc Mon Sep 17 00:00:00 2001
From: briaguya
Date: Thu, 29 Sep 2022 23:57:19 -0400
Subject: [PATCH 6/7] fix: match auto center option text to behavior
---
soh/soh/Enhancements/controls/GameControlEditor.cpp | 2 +-
soh/soh/GameMenuBar.cpp | 4 ++--
soh/src/overlays/actors/ovl_player_actor/z_player.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/soh/soh/Enhancements/controls/GameControlEditor.cpp b/soh/soh/Enhancements/controls/GameControlEditor.cpp
index a2ec4f209..e2eccab8b 100644
--- a/soh/soh/Enhancements/controls/GameControlEditor.cpp
+++ b/soh/soh/Enhancements/controls/GameControlEditor.cpp
@@ -238,7 +238,7 @@ namespace GameControlEditor {
UIWidgets::PaddedEnhancementCheckbox("Right Stick Aiming", "gRightStickAiming");
UIWidgets::Tooltip("Allows for aiming with the rights stick when:\n-Aiming in the C-Up view\n-Aiming with weapons");
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 5);
- UIWidgets::PaddedEnhancementCheckbox("Disable Auto-Centering in First Person View", "gAutoCenterView");
+ UIWidgets::PaddedEnhancementCheckbox("Disable Auto-Centering in First Person View", "gDisableAutoCenterView");
UIWidgets::Tooltip("Prevents the C-Up view from auto-centering, allowing for Gyro Aiming");
}
diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp
index 3be689c4d..c74ac8f17 100644
--- a/soh/soh/GameMenuBar.cpp
+++ b/soh/soh/GameMenuBar.cpp
@@ -117,8 +117,8 @@ namespace GameMenuBar {
CVar_SetS32("gInvertYAxis", 1);
// Right Stick Aiming
CVar_SetS32("gRightStickAiming", 0);
- // Auto-Center First Person View
- CVar_SetS32("gAutoCenterView", 0);
+ // Disable Auto-Center First Person View
+ CVar_SetS32("gDisableAutoCenterView", 0);
// Text Speed (1 to 5)
CVar_SetS32("gTextSpeed", 1);
diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c
index 1a0877373..ed7ad12bf 100644
--- a/soh/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c
@@ -11175,7 +11175,7 @@ s16 func_8084ABD8(GlobalContext* globalCtx, Player* this, s32 arg2, s16 arg3) {
s16 temp3;
if (!func_8002DD78(this) && !func_808334B4(this) && (arg2 == 0)) {
- if (CVar_GetS32("gAutoCenterView", 0)) {
+ if (!CVar_GetS32("gDisableAutoCenterView", 0)) {
temp2 = sControlInput->rel.stick_y * 240.0f * (CVar_GetS32("gInvertYAxis", 1) ? -1 : 1);
Math_SmoothStepToS(&this->actor.focus.rot.x, temp2, 14, 4000, 30);
From 36e40665bb51a76f36a459524c8419c5b9e403f3 Mon Sep 17 00:00:00 2001
From: briaguya <70942617+briaguya-ai@users.noreply.github.com>
Date: Sat, 1 Oct 2022 13:48:46 -0400
Subject: [PATCH 7/7] fix: don't hardcode path for global.sav (#1656)
Co-authored-by: briaguya
---
soh/soh/SaveManager.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp
index 1eafcf642..80ed3648a 100644
--- a/soh/soh/SaveManager.cpp
+++ b/soh/soh/SaveManager.cpp
@@ -543,7 +543,10 @@ void SaveManager::SaveGlobal() {
globalBlock["zTargetSetting"] = gSaveContext.zTargetSetting;
globalBlock["language"] = gSaveContext.language;
- std::ofstream output("Save/global.sav");
+ const std::filesystem::path sSavePath(Ship::Window::GetPathRelativeToAppDirectory("Save"));
+ const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav");
+
+ std::ofstream output(sGlobalPath);
output << std::setw(4) << globalBlock << std::endl;
}