From 9292e84b81dc173d547f3db689d214b28766bc60 Mon Sep 17 00:00:00 2001 From: Crementif <26669564+Crementif@users.noreply.github.com> Date: Thu, 30 Dec 2021 03:52:28 +0100 Subject: [PATCH] [BotW] Fix static FPS, multiple ultrawide GUI fixes, more cutscenes fixes Should fix #540 --- .../Graphics/patch_GUIAspectRatio.asm | 57 ++++++++----------- .../Graphics/patch_GUIScreens.asm | 21 ++++++- .../FPS++/patch_ControllerScrollSpeed.asm | 2 +- .../Mods/FPS++/patch_Cutscene.asm | 11 +++- .../Mods/FPS++/patch_GameSpeed.asm | 21 +++---- src/BreathOfTheWild/Mods/FPS++/rules.txt | 6 ++ 6 files changed, 69 insertions(+), 49 deletions(-) diff --git a/src/BreathOfTheWild/Graphics/patch_GUIAspectRatio.asm b/src/BreathOfTheWild/Graphics/patch_GUIAspectRatio.asm index 2a9d0dc8..4b99a946 100644 --- a/src/BreathOfTheWild/Graphics/patch_GUIAspectRatio.asm +++ b/src/BreathOfTheWild/Graphics/patch_GUIAspectRatio.asm @@ -649,8 +649,8 @@ beq scalePaneAndKeepPos b exitScale scaleMainScreenInformationTextPanes: addi r5, r31, 0x80 -lis r10, str_N_Contents_00@ha -addi r10, r10, str_N_Contents_00@l +lis r10, str_Pa_Information_00@ha +addi r10, r10, str_Pa_Information_00@l bla _compareString beq scalePaneNormal b exitScale @@ -663,25 +663,26 @@ beq scalePaneNormal b exitScale scaleMainScreenQuestTextPanes: addi r5, r31, 0x80 -lis r10, str_N_Base_00@ha -addi r10, r10, str_N_Base_00@l +lis r10, str_Pa_QuestName_00@ha +addi r10, r10, str_Pa_QuestName_00@l bla _compareString beq scalePaneNormal -lis r10, str_N_In_00@ha -addi r10, r10, str_N_In_00@l +lis r10, str_P_Base_01@ha +addi r10, r10, str_P_Base_01@l bla _compareString -beq scalePaneNormal -lis r10, str_N_In_01@ha -addi r10, r10, str_N_In_01@l +beq scalePaneReverse +lis r10, str_P_Base_00@ha +addi r10, r10, str_P_Base_00@l bla _compareString -beq scalePaneNormal +beq scalePaneReverse b exitScale + scaleMainScreenSmallLocationTextPanes: addi r5, r31, 0x80 -lis r10, str_N_In_00@ha -addi r10, r10, str_N_In_00@l +lis r10, str_Pa_LocationNameS_00@ha +addi r10, r10, str_Pa_LocationNameS_00@l bla _compareString -beq movePaneToLeftSideAlt +beq scalePaneToLeftSide b exitScale scaleMainScreenBossGaugePanes: addi r5, r31, 0x80 @@ -703,15 +704,8 @@ lis r10, str_N_InOut_01@ha addi r10, r10, str_N_InOut_01@l bla _compareString beq scalePaneNormal -lis r10, str_N_InOut_02@ha -addi r10, r10, str_N_InOut_02@l -bla _compareString -beq scalePaneNormal -b exitScale -scaleMainScreenRunePointingPanes: -addi r5, r31, 0x80 -lis r10, str_N_SunLight_00@ha -addi r10, r10, str_N_SunLight_00@l +lis r10, str_N_Dungeon_00@ha +addi r10, r10, str_N_Dungeon_00@l bla _compareString beq scalePaneNormal b exitScale @@ -726,16 +720,15 @@ addi r10, r10, str_N_IconSeek_00@l bla _compareString beq scalePaneNormal b exitScale +scaleMainScreenRunePointingPanes: +addi r5, r31, 0x80 +lis r10, str_N_SunLight_00@ha +addi r10, r10, str_N_SunLight_00@l +bla _compareString +beq scalePaneNormal +b exitScale scaleMainDungeonPanes: -lis r5, copySubPanelString@ha -addi r5, r5, copySubPanelString@l - -# lis r10, str_Pa_LocationNameS_00@ha -# addi r10, r10, str_Pa_LocationNameS_00@l -# bla _compareString -# beq scaleMainDungeonLocationNames - addi r5, r31, 0x80 lis r10, str_Pa_LocationNameS_00@ha addi r10, r10, str_Pa_LocationNameS_00@l @@ -991,10 +984,6 @@ lis r10, str_N_Cut_00@ha ; scales the item/rune selection bar addi r10, r10, str_N_Cut_00@l bla _compareString beq scalePaneNormal -# lis r10, str_N_Cut_01@ha ; scales the item/rune selection bar -# addi r10, r10, str_N_Cut_01@l -# bla _compareString -# beq scalePaneAndSize lis r10, str_N_Capture_00@ha addi r10, r10, str_N_Capture_00@l diff --git a/src/BreathOfTheWild/Graphics/patch_GUIScreens.asm b/src/BreathOfTheWild/Graphics/patch_GUIScreens.asm index a2c3b367..17ca1208 100644 --- a/src/BreathOfTheWild/Graphics/patch_GUIScreens.asm +++ b/src/BreathOfTheWild/Graphics/patch_GUIScreens.asm @@ -235,8 +235,6 @@ str_Pa_Information_00: .string "Pa_Information_00" str_Pa_LocationName_00: .string "Pa_LocationName_00" -str_Pa_QuestName_00: -.string "Pa_QuestName_00" str_Pa_BossGauge_00: .string "Pa_BossGauge_00" @@ -266,6 +264,25 @@ str_N_Fire_00: .string "N_Fire_00" str_N_Ice_00: .string "N_Ice_00" + +str_Pa_QuestName_00: +.string "Pa_QuestName_00" +str_T_QuestName_00: +.string "T_QuestName_00" +str_T_QuestName_00_JPja: +.string "T_QuestName_00_JPja" + +str_P_CameraPointerL_00: +.string "P_CameraPointerL_00" +str_P_CameraPointerR_00: +.string "P_CameraPointerR_00" +str_P_AbstractR_00: +.string "P_AbstractR_00" +str_P_AbstractL_00: +.string "P_AbstractL_00" +str_N_Dungeon_00: +.string "N_Dungeon_00" + ; Panes from MainScreen3D (stamina bar, enemy spotting gauge, etc) str_Pa_EnemyMark_00: .string "Pa_EnemyMark_00" diff --git a/src/BreathOfTheWild/Mods/FPS++/patch_ControllerScrollSpeed.asm b/src/BreathOfTheWild/Mods/FPS++/patch_ControllerScrollSpeed.asm index 60a3368a..ecc98a98 100644 --- a/src/BreathOfTheWild/Mods/FPS++/patch_ControllerScrollSpeed.asm +++ b/src/BreathOfTheWild/Mods/FPS++/patch_ControllerScrollSpeed.asm @@ -11,7 +11,7 @@ scrollSpeed: 0x10327D60 = menuNavigationSpeedPackEnabled: 0x10327D64 = menuNavigationSpeedPackValue: -_checkCursorSpeed: +_readExternalCursorSpeed: lis r11, menuNavigationSpeedPackEnabled@ha lwz r11, menuNavigationSpeedPackEnabled@l(r11) cmpwi r11, 0x1337 diff --git a/src/BreathOfTheWild/Mods/FPS++/patch_Cutscene.asm b/src/BreathOfTheWild/Mods/FPS++/patch_Cutscene.asm index 42e31664..ac0b4998 100644 --- a/src/BreathOfTheWild/Mods/FPS++/patch_Cutscene.asm +++ b/src/BreathOfTheWild/Mods/FPS++/patch_Cutscene.asm @@ -80,12 +80,19 @@ cmpwi r22, 1620 ; demo162_0 ; Perhaps the crash at the end of vah ruta beq _setCutscene30FPSLimit cmpwi r22, 1630 ; demo163_0 ; Perhaps the crash at the end of vah ruta beq _setCutscene30FPSLimit - cmpwi r22, 3340 ; demo334_0 ; Perhaps the crash at the end of vah ruta beq _setCutscene30FPSLimit +cmpwi r22, 1020 ; demo102_0 ; Start Game - Bright light waking up link on blackscreen +beq _setCutscene30FPSLimit +cmpwi r22, 1690 ; demo169_0 ; Start Game - Zelda waking up link dialogue on blackscreen +beq _setCutscene30FPSLimit + +cmpwi r22, 1030 ; demo103_0 ; Start Game - Walking out of shrine of resurrection +beq _setCutscene60FPSLimit + ; A bunch of divine beast enter and exit events. Could definitely be narrowed down in the future. -cmpwi r22, 1110 ; demo110_0 +cmpwi r22, 1100 ; demo110_0 beq _setCutscene30FPSLimit cmpwi r22, 1110 ; demo111_0 beq _setCutscene30FPSLimit diff --git a/src/BreathOfTheWild/Mods/FPS++/patch_GameSpeed.asm b/src/BreathOfTheWild/Mods/FPS++/patch_GameSpeed.asm index e5e96ff2..5f902253 100644 --- a/src/BreathOfTheWild/Mods/FPS++/patch_GameSpeed.asm +++ b/src/BreathOfTheWild/Mods/FPS++/patch_GameSpeed.asm @@ -93,7 +93,8 @@ debugMultiplier: _calculateGamespeed: stw r0, 0x78(r30) ; Execute original instruction that got replaced with a jump to this function -b _checkCursorSpeed +; Call externalized cursor speed reading function +b _readExternalCursorSpeed ; If the manual speed has been set by an external program to something other then 0, use that as the static speed _checkExternalSpeed: @@ -103,15 +104,6 @@ lfs f10, 0xD0(r30) ; Load the external speed offset fcmpu cr0, f10, f12 ; Compare the value stored in the external memory offset to 0 (f12) bne _setGamespeed -; If static FPS is enabled, always set currently "running" FPS to $fpsLimit -_checkStaticFPS: -li r11, $staticFPSMode ; Load the $staticFPSMode setting into r3 -cmpwi r11, 1 ; Compare with 1, which is when it's enabled -bne _convertTicksToFrametime ; If the comparison is not equal, run -lis r11, fpsLimit@ha ; Load current FPS limit... -lfs f10, fpsLimit@l(r11) ; ...into f10 -b _setGamespeed ; Skip dynamic FPS code when static mode is enabled and go to the game speed setting code - ; Calculate speed of current frame (FPS). It's calculated by using the ticks between the previous frame and now, which is stored in r12, and the amount of ticks that the Wii U executes in a second (the bus speed). _convertTicksToFrametime: xoris r12, r12, 0x8000 ; Flip the sign bit of int ticks for floating point conversion @@ -128,6 +120,15 @@ frsp f10, f10 ; Round the ticks to single precision and store the ticks back ; Call externalized cutscene FPS function which will return to checkExternalSpeed b _checkCutsceneFPSLimit +; If static FPS is enabled, always set currently "running" FPS to $fpsLimit +_checkStaticFPS: +li r11, $staticFPSMode ; Load the $staticFPSMode setting into r3 +cmpwi r11, 1 ; Compare with 1, which is when it's enabled +bne _calculateDynamicFPS ; If the comparison is not equal, run +lis r11, fpsLimit@ha ; Load current FPS limit... +lfs f10, fpsLimit@l(r11) ; ...into f10 +b _setGamespeed ; Skip dynamic FPS code when static mode is enabled and go to the game speed setting code + ; Calculate speed of current frame (FPS). It's calculated by using the ticks between the previous frame and now, which is stored in r12, and the amount of ticks that the Wii U executes in a second (the bus speed). _calculateDynamicFPS: lis r12, const_1@ha ; Load float of 1... diff --git a/src/BreathOfTheWild/Mods/FPS++/rules.txt b/src/BreathOfTheWild/Mods/FPS++/rules.txt index 9554a280..cad57b0d 100644 --- a/src/BreathOfTheWild/Mods/FPS++/rules.txt +++ b/src/BreathOfTheWild/Mods/FPS++/rules.txt @@ -90,6 +90,12 @@ condition = $advancedMode == 0 default = 1 $fpsLimitNormal = 60 +[Preset] +name = 55FPS Limit +category = FPS Limit +condition = $advancedMode == 0 +$fpsLimitNormal = 55 + [Preset] name = 45FPS Limit category = FPS Limit