From 0ec9fc2ecf46a1337ebac519b0a33f07d502d7c5 Mon Sep 17 00:00:00 2001 From: Sirius902 <10891979+Sirius902@users.noreply.github.com> Date: Wed, 20 Apr 2022 02:13:51 -0700 Subject: [PATCH 01/18] Fix OpenGL framebuffer index (#195) --- libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp index 5373f8799..e19e9538c 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp @@ -646,7 +646,7 @@ static int gfx_opengl_create_framebuffer() { framebuffers[i].clrbuf_msaa = clrbuf_msaa; framebuffers[i].rbo = rbo; - return fbo; + return i; } static void gfx_opengl_update_framebuffer_parameters(int fb_id, uint32_t width, uint32_t height, uint32_t msaa_level, bool opengl_invert_y, bool render_target, bool has_depth_buffer, bool can_extract_depth) { From f66178772dae4a296ae38fae54fdff97cd9c5869 Mon Sep 17 00:00:00 2001 From: Thomas Achatz <30968528+shadeRed@users.noreply.github.com> Date: Thu, 21 Apr 2022 17:33:05 -0500 Subject: [PATCH 02/18] Dynamic Wallet Rupee Icon Color (#123) * dynamic rupee rgb * dynamic_wallet_icon cvar * update blue rgb * update blue rgb to match rando * refactor * Update z_parameter.c * update rupeeWalletColors dimensions --- libultraship/libultraship/GameSettings.cpp | 4 ++++ libultraship/libultraship/GameSettings.h | 1 + libultraship/libultraship/SohImGuiImpl.cpp | 5 +++++ soh/src/code/z_parameter.c | 20 ++++++++++++++++++-- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/libultraship/libultraship/GameSettings.cpp b/libultraship/libultraship/GameSettings.cpp index 1b8d473b2..1d510c7cd 100644 --- a/libultraship/libultraship/GameSettings.cpp +++ b/libultraship/libultraship/GameSettings.cpp @@ -58,6 +58,9 @@ namespace Game { Settings.enhancements.animated_pause_menu = stob(Conf[EnhancementSection]["animated_pause_menu"]); CVar_SetS32("gPauseLiveLink", Settings.enhancements.animated_pause_menu); + Settings.enhancements.dynamic_wallet_icon = stob(Conf[EnhancementSection]["dynamic_wallet_icon"]); + CVar_SetS32(const_cast("gDynamicWalletIcon"), Settings.enhancements.dynamic_wallet_icon); + Settings.enhancements.minimal_ui = stob(Conf[EnhancementSection]["minimal_ui"]); CVar_SetS32("gMinimalUI", Settings.enhancements.minimal_ui); @@ -154,6 +157,7 @@ namespace Game { Conf[EnhancementSection]["fast_text"] = std::to_string(Settings.enhancements.fast_text); Conf[EnhancementSection]["disable_lod"] = std::to_string(Settings.enhancements.disable_lod); Conf[EnhancementSection]["animated_pause_menu"] = std::to_string(Settings.enhancements.animated_pause_menu); + Conf[EnhancementSection]["dynamic_wallet_icon"] = std::to_string(Settings.enhancements.dynamic_wallet_icon); Conf[EnhancementSection]["minimal_ui"] = std::to_string(Settings.enhancements.minimal_ui); Conf[EnhancementSection]["mm_bunny_hood"] = std::to_string(Settings.enhancements.mm_bunny_hood); diff --git a/libultraship/libultraship/GameSettings.h b/libultraship/libultraship/GameSettings.h index fe6087494..18f978386 100644 --- a/libultraship/libultraship/GameSettings.h +++ b/libultraship/libultraship/GameSettings.h @@ -23,6 +23,7 @@ struct SoHConfigType { bool fast_text = false; bool disable_lod = false; bool animated_pause_menu = false; + bool dynamic_wallet_icon = false; bool minimal_ui = false; bool mm_bunny_hood = false; } enhancements; diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 860720433..93343b8dd 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -425,6 +425,11 @@ namespace SohImGui { needs_save = true; } + if (ImGui::Checkbox("Dynamic Wallet Icon", &Game::Settings.enhancements.dynamic_wallet_icon)) { + CVar_SetS32(const_cast("gDynamicWalletIcon"), Game::Settings.enhancements.dynamic_wallet_icon); + needs_save = true; + } + ImGui::EndMenu(); } diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index dc96ba133..edc4348b9 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -3129,6 +3129,14 @@ void Interface_Draw(GlobalContext* globalCtx) { }; static s16 rupeeDigitsFirst[] = { 1, 0, 0 }; static s16 rupeeDigitsCount[] = { 2, 3, 3 }; + + // courtesy of https://github.com/TestRunnerSRL/OoT-Randomizer/blob/Dev/ASM/c/hud_colors.c + static s16 rupeeWalletColors[3][3] = { + { 0xC8, 0xFF, 0x64 }, // Base Wallet (Green) + { 0x82, 0x82, 0xFF }, // Adult's Wallet (Blue) + { 0xFF, 0x64, 0x64 }, // Giant's Wallet (Red) + }; + static s16 spoilingItemEntrances[] = { 0x01AD, 0x0153, 0x0153 }; static f32 D_80125B54[] = { -40.0f, -35.0f }; // unused static s16 D_80125B5C[] = { 91, 91 }; // unused @@ -3171,7 +3179,15 @@ void Interface_Draw(GlobalContext* globalCtx) { if (fullUi) { // Rupee Icon - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 100, interfaceCtx->magicAlpha); + s16* rColor; + + if (CVar_GetS32("gDynamicWalletIcon", 0)) { + rColor = &rupeeWalletColors[CUR_UPG_VALUE(UPG_WALLET)]; + } else { + rColor = &rupeeWalletColors[0]; + } + + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, rColor[0], rColor[1], rColor[2], interfaceCtx->magicAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 80, 0, 255); OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, OTRGetRectDimensionFromLeftEdge(26), 206, 16, 16, 1 << 10, 1 << 10); @@ -3269,7 +3285,7 @@ void Interface_Draw(GlobalContext* globalCtx) { Gfx_TextureI8(OVERLAY_DISP, ((u8*)digitTextures[interfaceCtx->counterDigits[svar2]]), 8, 16, OTRGetRectDimensionFromLeftEdge(svar3), 206, 8, 16, 1 << 10, 1 << 10); } - } + } else { // Make sure item counts have black backgrounds gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, interfaceCtx->magicAlpha); From f5a3d3c4bf2523ddf46a9895aab49b225a2b0784 Mon Sep 17 00:00:00 2001 From: Rozelette Date: Thu, 21 Apr 2022 17:36:21 -0500 Subject: [PATCH 03/18] Invalidate texture cache when loading dungeon maps (fixes #21) (#168) * Invalidate texture cache when loading dungeon maps (fixes #21) * Adjust point of dungeon map invalidation to account for constant updates each frame --- soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c | 1 - soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 52019dcb2..2003a8b14 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -595,7 +595,6 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { gSPInvalidateTexCache(POLY_KAL_DISP++, pauseCtx->iconItemSegment); //gSPInvalidateTexCache(POLY_KAL_DISP++, pauseCtx->iconItem24Segment); gSPInvalidateTexCache(POLY_KAL_DISP++, pauseCtx->nameSegment); - gSPInvalidateTexCache(POLY_KAL_DISP++, globalCtx->interfaceCtx.mapSegment); //gSPSegment(POLY_KAL_DISP++, 0x07, pauseCtx->playerSegment); gSPSegment(POLY_KAL_DISP++, 0x08, pauseCtx->iconItemSegment); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c index 022fdd41d..bd5277286 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c @@ -332,6 +332,10 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC gSPVertex(POLY_KAL_DISP++, &pauseCtx->mapPageVtx[60], 8, 0); + // The dungeon map textures are recreated each frame, so always invalidate them + gSPInvalidateTexCache(POLY_KAL_DISP++, interfaceCtx->mapSegment); + gSPInvalidateTexCache(POLY_KAL_DISP++, interfaceCtx->mapSegment + 0x800); + gDPLoadTextureBlock_4b(POLY_KAL_DISP++, interfaceCtx->mapSegment, G_IM_FMT_CI, 48, 85, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); From ffeb2afcb758ecb024dc4af2ebcb6ac528ae3bdb Mon Sep 17 00:00:00 2001 From: Ada <60364512+GreatArgorath@users.noreply.github.com> Date: Thu, 21 Apr 2022 23:38:56 +0100 Subject: [PATCH 04/18] Changes fast text option to skip text, and makes text speed adjustable via a slider (#173) * Adds fast text option Changes previous "fast text" option to "skip text", and adds a new "fast text" option, which makes text appear 5 times faster. * Fixes magic numbers * Changes text speed to a slider (unfinished) Got most of the code working, but only works upon reloading the game, unsure of how to fix this. * Makes text speed adjustable via a slider * Cleans up changes to z_message_PAL.c --- libultraship/libultraship/GameSettings.cpp | 10 +++++++--- libultraship/libultraship/GameSettings.h | 3 ++- libultraship/libultraship/SohImGuiImpl.cpp | 10 ++++++++-- soh/src/code/z_message_PAL.c | 14 +++++++------- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/libultraship/libultraship/GameSettings.cpp b/libultraship/libultraship/GameSettings.cpp index 1d510c7cd..f396b8f36 100644 --- a/libultraship/libultraship/GameSettings.cpp +++ b/libultraship/libultraship/GameSettings.cpp @@ -49,8 +49,11 @@ namespace Game { Settings.debug.n64mode = stob(Conf[ConfSection]["n64_mode"]); // Enhancements - Settings.enhancements.fast_text = stob(Conf[EnhancementSection]["fast_text"]); - CVar_SetS32("gFastText", Settings.enhancements.fast_text); + Settings.enhancements.skip_text = stob(Conf[EnhancementSection]["skip_text"]); + CVar_SetS32("gSkipText", Settings.enhancements.skip_text); + + Settings.enhancements.text_speed = Ship::stoi(Conf[EnhancementSection]["text_speed"]); + CVar_SetS32("gTextSpeed", Settings.enhancements.text_speed); Settings.enhancements.disable_lod = stob(Conf[EnhancementSection]["disable_lod"]); CVar_SetS32("gDisableLOD", Settings.enhancements.disable_lod); @@ -154,7 +157,8 @@ namespace Game { Conf[AudioSection]["fanfare"] = std::to_string(Settings.audio.fanfare); // Enhancements - Conf[EnhancementSection]["fast_text"] = std::to_string(Settings.enhancements.fast_text); + Conf[EnhancementSection]["skip_text"] = std::to_string(Settings.enhancements.skip_text); + Conf[EnhancementSection]["text_speed"] = std::to_string(Settings.enhancements.text_speed); Conf[EnhancementSection]["disable_lod"] = std::to_string(Settings.enhancements.disable_lod); Conf[EnhancementSection]["animated_pause_menu"] = std::to_string(Settings.enhancements.animated_pause_menu); Conf[EnhancementSection]["dynamic_wallet_icon"] = std::to_string(Settings.enhancements.dynamic_wallet_icon); diff --git a/libultraship/libultraship/GameSettings.h b/libultraship/libultraship/GameSettings.h index 18f978386..1b371fa7e 100644 --- a/libultraship/libultraship/GameSettings.h +++ b/libultraship/libultraship/GameSettings.h @@ -20,7 +20,8 @@ struct SoHConfigType { // Enhancements struct { - bool fast_text = false; + int text_speed = 1; + bool skip_text = false; bool disable_lod = false; bool animated_pause_menu = false; bool dynamic_wallet_icon = false; diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 93343b8dd..7eca28ede 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -395,8 +395,14 @@ namespace SohImGui { ImGui::Text("Gameplay"); ImGui::Separator(); - if (ImGui::Checkbox("Fast Text", &Game::Settings.enhancements.fast_text)) { - CVar_SetS32("gFastText", Game::Settings.enhancements.fast_text); + ImGui::Text("Text Speed", Game::Settings.enhancements.text_speed); + if (ImGui::SliderInt("##TEXTSPEED", &Game::Settings.enhancements.text_speed, 1, 5)) { + CVar_SetS32("gTextSpeed", Game::Settings.enhancements.text_speed); + needs_save = true; + } + + if (ImGui::Checkbox("Skip Text", &Game::Settings.enhancements.skip_text)) { + CVar_SetS32("gSkipText", Game::Settings.enhancements.skip_text); needs_save = true; } diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 43b0fcc12..a767ede79 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -166,7 +166,7 @@ void Message_UpdateOcarinaGame(GlobalContext* globalCtx) { u8 Message_ShouldAdvance(GlobalContext* globalCtx) { Input* input = &globalCtx->state.input[0]; - bool isB_Held = CVar_GetS32("gFastText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) + bool isB_Held = CVar_GetS32("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) : CHECK_BTN_ALL(input->press.button, BTN_B); if (CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP)) { @@ -178,7 +178,7 @@ u8 Message_ShouldAdvance(GlobalContext* globalCtx) { u8 Message_ShouldAdvanceSilent(GlobalContext* globalCtx) { Input* input = &globalCtx->state.input[0]; - bool isB_Held = CVar_GetS32("gFastText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) + bool isB_Held = CVar_GetS32("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) : CHECK_BTN_ALL(input->press.button, BTN_B); return CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP); @@ -951,7 +951,7 @@ void Message_DrawText(GlobalContext* globalCtx, Gfx** gfxP) { } } i = j - 1; - msgCtx->textDrawPos = i + 1; + msgCtx->textDrawPos = i + CVar_GetS32("gTextSpeed", 1); if (character) {} } @@ -1061,7 +1061,7 @@ void Message_DrawText(GlobalContext* globalCtx, Gfx** gfxP) { msgCtx->textDelay = msgCtx->msgBufDecoded[++i]; break; case MESSAGE_UNSKIPPABLE: - msgCtx->textUnskippable = CVar_GetS32("gFastText", 0) != 1; + msgCtx->textUnskippable = CVar_GetS32("gSkipText", 0) != 1; break; case MESSAGE_TWO_CHOICE: msgCtx->textboxEndType = TEXTBOX_ENDTYPE_2_CHOICE; @@ -1144,7 +1144,7 @@ void Message_DrawText(GlobalContext* globalCtx, Gfx** gfxP) { } } if (msgCtx->textDelayTimer == 0) { - msgCtx->textDrawPos = i + 1; + msgCtx->textDrawPos = i + CVar_GetS32("gTextSpeed", 1); msgCtx->textDelayTimer = msgCtx->textDelay; } else { msgCtx->textDelayTimer--; @@ -2026,7 +2026,7 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) { gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); - bool isB_Held = CVar_GetS32("gFastText", 0) != 0 ? CHECK_BTN_ALL(globalCtx->state.input[0].cur.button, BTN_B) + bool isB_Held = CVar_GetS32("gSkipText", 0) != 0 ? CHECK_BTN_ALL(globalCtx->state.input[0].cur.button, BTN_B) : CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_B); switch (msgCtx->msgMode) { @@ -3067,7 +3067,7 @@ void Message_Update(GlobalContext* globalCtx) { return; } - bool isB_Held = CVar_GetS32("gFastText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) && !sTextboxSkipped + bool isB_Held = CVar_GetS32("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) && !sTextboxSkipped : CHECK_BTN_ALL(input->press.button, BTN_B); switch (msgCtx->msgMode) { From f65486d82dfece3b305697e0fd258cdfaa9c6252 Mon Sep 17 00:00:00 2001 From: Ralphie Morell Date: Thu, 21 Apr 2022 18:39:39 -0400 Subject: [PATCH 05/18] Cheats Menu expansion (#176) * Added extra cheats; compacted cheats menu * fixed flag oversight --- .gitignore | 402 +++++++++++++++++++++ libultraship/libultraship/GameSettings.cpp | 12 + libultraship/libultraship/GameSettings.h | 4 + libultraship/libultraship/SohImGuiImpl.cpp | 54 ++- soh/src/code/game.c | 31 ++ 5 files changed, 488 insertions(+), 15 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..fafae443d --- /dev/null +++ b/.gitignore @@ -0,0 +1,402 @@ +# Cache files +__pycache__/ +.pyc +.DS_Store + +# Text editor remnants +.vscode/ +.vs/ +.idea/ +CMakeLists.txt +cmake-build-debug +venv/ + +# Project-specific ignores +build/ +expected/ +notes/ +baserom/ +docs/doxygen/ +*.elf +*.sra +*.z64 +*.n64 +*.v64 +*.map +*.dump +out.txt + +# Tool artifacts +tools/mipspro7.2_compiler/ +tools/overlayhelpers/batchdisasm/output/* +tools/overlayhelpers/batchdisasm/output2/* +tools/overlayhelpers/batchdisasm/mipsdisasm/* +tools/disasm/output/* +tools/asmsplitter/asm/* +tools/asmsplitter/c/* +ctx.c +tools/*dSYM/ +graphs/ + +# Assets +*.png +*.jpg +*.mdli +*.anmi +*.obj +*.mtl +*.fbx +!*_custom* +.extracted-assets.json + +# Docs +!docs/tutorial/ + +# Per-user configuration +.python-version + + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +*.out +*.o +*.d +lib/libgfxd/libgfxd.a +ExporterTest/ExporterTest.a +ZAPDUtils/ZAPDUtils.a +.vscode/ +build/ +ZAPDUtils/build/ +ZAPD/BuildInfo.h + +DebugObj/* +ReleaseObj/* \ No newline at end of file diff --git a/libultraship/libultraship/GameSettings.cpp b/libultraship/libultraship/GameSettings.cpp index f396b8f36..5f19d3c4d 100644 --- a/libultraship/libultraship/GameSettings.cpp +++ b/libultraship/libultraship/GameSettings.cpp @@ -124,6 +124,9 @@ namespace Game { Settings.cheats.infinite_magic = stob(Conf[CheatSection]["infinite_magic"]); CVar_SetS32("gInfiniteMagic", Settings.cheats.infinite_magic); + Settings.cheats.infinite_nayru = stob(Conf[CheatSection]["infinite_nayru"]); + CVar_SetS32("gInfiniteNayru", Settings.cheats.infinite_nayru); + Settings.cheats.no_clip = stob(Conf[CheatSection]["no_clip"]); CVar_SetS32("gNoClip", Settings.cheats.no_clip); @@ -136,6 +139,15 @@ namespace Game { Settings.cheats.super_tunic = stob(Conf[CheatSection]["super_tunic"]); CVar_SetS32("gSuperTunic", Settings.cheats.super_tunic); + Settings.cheats.ez_isg = stob(Conf[CheatSection]["ez_isg"]); + CVar_SetS32("gEzISG", Settings.cheats.ez_isg); + + Settings.cheats.no_restrict_item = stob(Conf[CheatSection]["no_restrict_item"]); + CVar_SetS32("gNoRestrictItems", Settings.cheats.no_restrict_item); + + Settings.cheats.freeze_time = stob(Conf[CheatSection]["freeze_time"]); + CVar_SetS32("gFreezeTime", Settings.cheats.freeze_time); + UpdateAudio(); } diff --git a/libultraship/libultraship/GameSettings.h b/libultraship/libultraship/GameSettings.h index 1b371fa7e..33e0c8b3d 100644 --- a/libultraship/libultraship/GameSettings.h +++ b/libultraship/libultraship/GameSettings.h @@ -49,10 +49,14 @@ struct SoHConfigType { bool infinite_health = false; bool infinite_ammo = false; bool infinite_magic = false; + bool infinite_nayru = false; bool no_clip = false; bool climb_everything = false; bool moon_jump_on_l = false; bool super_tunic = false; + bool ez_isg = false; + bool no_restrict_item = false; + bool freeze_time = false; } cheats; // Graphics diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 7eca28ede..7355d16a2 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -460,24 +460,33 @@ namespace SohImGui { } if (ImGui::BeginMenu("Cheats")) { - if (ImGui::Checkbox("Infinite Money", &Game::Settings.cheats.infinite_money)) { - CVar_SetS32("gInfiniteMoney", Game::Settings.cheats.infinite_money); - needs_save = true; - } + if (ImGui::BeginMenu("Infinite...")) { + if (ImGui::Checkbox("Money", &Game::Settings.cheats.infinite_money)) { + CVar_SetS32("gInfiniteMoney", Game::Settings.cheats.infinite_money); + needs_save = true; + } - if (ImGui::Checkbox("Infinite Health", &Game::Settings.cheats.infinite_health)) { - CVar_SetS32("gInfiniteHealth", Game::Settings.cheats.infinite_health); - needs_save = true; - } + if (ImGui::Checkbox("Health", &Game::Settings.cheats.infinite_health)) { + CVar_SetS32("gInfiniteHealth", Game::Settings.cheats.infinite_health); + needs_save = true; + } - if (ImGui::Checkbox("Infinite Ammo", &Game::Settings.cheats.infinite_ammo)) { - CVar_SetS32("gInfiniteAmmo", Game::Settings.cheats.infinite_ammo); - needs_save = true; - } + if (ImGui::Checkbox("Ammo", &Game::Settings.cheats.infinite_ammo)) { + CVar_SetS32("gInfiniteAmmo", Game::Settings.cheats.infinite_ammo); + needs_save = true; + } - if (ImGui::Checkbox("Infinite Magic", &Game::Settings.cheats.infinite_magic)) { - CVar_SetS32("gInfiniteMagic", Game::Settings.cheats.infinite_magic); - needs_save = true; + if (ImGui::Checkbox("Magic", &Game::Settings.cheats.infinite_magic)) { + CVar_SetS32("gInfiniteMagic", Game::Settings.cheats.infinite_magic); + needs_save = true; + } + + if (ImGui::Checkbox("Nayru's Love", &Game::Settings.cheats.infinite_nayru)) { + CVar_SetS32("gInfiniteNayru", Game::Settings.cheats.infinite_nayru); + needs_save = true; + } + + ImGui::EndMenu(); } if (ImGui::Checkbox("No Clip", &Game::Settings.cheats.no_clip)) { @@ -500,6 +509,21 @@ namespace SohImGui { needs_save = true; } + if (ImGui::Checkbox("Easy ISG", &Game::Settings.cheats.ez_isg)) { + CVar_SetS32("gEzISG", Game::Settings.cheats.ez_isg); + needs_save = true; + } + + if (ImGui::Checkbox("Unrestricted Items", &Game::Settings.cheats.no_restrict_item)) { + CVar_SetS32("gNoRestrictItems", Game::Settings.cheats.no_restrict_item); + needs_save = true; + } + + if (ImGui::Checkbox("Freeze Time", &Game::Settings.cheats.freeze_time)) { + CVar_SetS32("gFreezeTime", Game::Settings.cheats.freeze_time); + needs_save = true; + } + ImGui::EndMenu(); } diff --git a/soh/src/code/game.c b/soh/src/code/game.c index 9392cbc25..b69537fd8 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -381,6 +381,11 @@ void GameState_Update(GameState* gameState) { gSaveContext.magic = (gSaveContext.doubleMagic + 1) * 0x30; } } + + // Inf Nayru's Love Timer + if (CVar_GetS32("gInfiniteNayru", 0) != 0) { + gSaveContext.nayrusLoveTimer = 0x44B; + } // Moon Jump On L if (CVar_GetS32("gMoonJumpOnL", 0) != 0) { @@ -393,6 +398,32 @@ void GameState_Update(GameState* gameState) { } } + // Permanent infinite sword glitch (ISG) + if (CVar_GetS32("gEzISG", 0) != 0) { + if (gGlobalCtx) { + Player* player = GET_PLAYER(gGlobalCtx); + player->swordState = 1; + } + } + + // Unrestricted Items + if (CVar_GetS32("gNoRestrictItems", 0) != 0) { + if (gGlobalCtx) { + memset(&gGlobalCtx->interfaceCtx.restrictions, 0, sizeof(gGlobalCtx->interfaceCtx.restrictions)); + } + } + + // Freeze Time + if (CVar_GetS32("gFreezeTime", 0) != 0) { + if (CVar_GetS32("gPrevTime", -1) == -1) { + CVar_SetS32("gPrevTime", gSaveContext.dayTime); + } + + int32_t prevTime = CVar_GetS32("gPrevTime", gSaveContext.dayTime); + gSaveContext.dayTime = prevTime; + } + + gameState->frames++; } From f05d006479217efab7ff37d184b0e71fc971d58a Mon Sep 17 00:00:00 2001 From: Baoulettes Date: Fri, 22 Apr 2022 00:40:22 +0200 Subject: [PATCH 06/18] [MOD]Visual & audio Stone of agony (#177) * Visual / Audio Stone of Agony This add Sound and blinking icon for the item Stone of Agony. Useful for peoples that have issues with rumble anything other person that is also blind or deaf. This is made with these second person in mind, home they will like it :) * Adding bool there Yes I do fiels one by one to be sure * Adding the Cvar register 1 file left :D * Adding the main change in func_80848EF8 And that the last file :) --- libultraship/libultraship/GameSettings.cpp | 5 +++ libultraship/libultraship/GameSettings.h | 2 + soh/soh/Enhancements/bootcommands.c | 1 + .../actors/ovl_player_actor/z_player.c | 37 +++++++++++++++++++ 4 files changed, 45 insertions(+) diff --git a/libultraship/libultraship/GameSettings.cpp b/libultraship/libultraship/GameSettings.cpp index 5f19d3c4d..2ce22d6f9 100644 --- a/libultraship/libultraship/GameSettings.cpp +++ b/libultraship/libultraship/GameSettings.cpp @@ -67,6 +67,9 @@ namespace Game { Settings.enhancements.minimal_ui = stob(Conf[EnhancementSection]["minimal_ui"]); CVar_SetS32("gMinimalUI", Settings.enhancements.minimal_ui); + Settings.enhancements.visualagony = stob(Conf[EnhancementSection]["visualagony"]); + CVar_SetS32("gVisualAgony", Settings.enhancements.visualagony); + Settings.enhancements.mm_bunny_hood = stob(Conf[EnhancementSection]["mm_bunny_hood"]); CVar_SetS32("gMMBunnyHood", Settings.enhancements.mm_bunny_hood); @@ -175,8 +178,10 @@ namespace Game { Conf[EnhancementSection]["animated_pause_menu"] = std::to_string(Settings.enhancements.animated_pause_menu); Conf[EnhancementSection]["dynamic_wallet_icon"] = std::to_string(Settings.enhancements.dynamic_wallet_icon); Conf[EnhancementSection]["minimal_ui"] = std::to_string(Settings.enhancements.minimal_ui); + Conf[EnhancementSection]["visualagony"] = std::to_string(Settings.enhancements.visualagony); Conf[EnhancementSection]["mm_bunny_hood"] = std::to_string(Settings.enhancements.mm_bunny_hood); + // Controllers Conf[ControllerSection]["gyro_sensitivity"] = std::to_string(Settings.controller.gyro_sensitivity); Conf[ControllerSection]["rumble_strength"] = std::to_string(Settings.controller.rumble_strength); diff --git a/libultraship/libultraship/GameSettings.h b/libultraship/libultraship/GameSettings.h index 33e0c8b3d..070bdce38 100644 --- a/libultraship/libultraship/GameSettings.h +++ b/libultraship/libultraship/GameSettings.h @@ -26,7 +26,9 @@ struct SoHConfigType { bool animated_pause_menu = false; bool dynamic_wallet_icon = false; bool minimal_ui = false; + bool visualagony = false; bool mm_bunny_hood = false; + } enhancements; // Controller diff --git a/soh/soh/Enhancements/bootcommands.c b/soh/soh/Enhancements/bootcommands.c index 685593179..c58a11b6b 100644 --- a/soh/soh/Enhancements/bootcommands.c +++ b/soh/soh/Enhancements/bootcommands.c @@ -25,6 +25,7 @@ void BootCommands_Init() CVar_RegisterS32("gDebugEnabled", 0); CVar_RegisterS32("gPauseLiveLink", 0); CVar_RegisterS32("gMinimalUI", 0); + CVar_RegisterS32("gVisualAgony", 0); } //void BootCommands_ParseBootArgs(char* str) 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 734ba015e..5ff08df85 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -10274,8 +10274,45 @@ void func_80848EF8(Player* this) { } this->unk_6A0 += temp; + + /*Prevent it on horse, while jumping and on title screen. + If you fly around no stone of agony for you! */ + if (CVar_GetS32("gVisualAgony", 0) !=0 && !this->stateFlags1) { + int rectLeft = OTRGetRectDimensionFromLeftEdge(26); //Left X Pos + int rectTop = 60; //Top Y Pos + int rectWidth = 24; //Texture Width + int rectHeight = 24; //Texture Heigh + int DefaultIconA= 50; //Default icon alphe (55 on 255) + + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player.c", 2824); + gDPPipeSync(OVERLAY_DISP++); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA); + gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + if (this->unk_6A0 > 4000000.0f) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255); + } else { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA); + } + if (temp == 0 || temp <= 0.1f) { + /*Fail check, it is used to draw off the icon when + link is standing out range but do not refresh unk_6A0. + Also used to make a default value in my case.*/ + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA); + } + gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); + gDPSetOtherMode(OVERLAY_DISP++, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_IA16 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2); + gDPLoadTextureBlock(OVERLAY_DISP++, gStoneOfAgonyIconTex, G_IM_FMT_RGBA, G_IM_SIZ_32b, 24, 24, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gDPSetOtherMode(OVERLAY_DISP++, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_IA16 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2); + gSPWideTextureRectangle(OVERLAY_DISP++, rectLeft << 2, rectTop << 2, (rectLeft + rectWidth) << 2, (rectTop + rectHeight) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player.c", 3500); + } + if (this->unk_6A0 > 4000000.0f) { this->unk_6A0 = 0.0f; + if (CVar_GetS32("gVisualAgony", 0) !=0 && !this->stateFlags1) { + //This audio is placed here and not in previous CVar check to prevent ears ra.. :) + Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E0); + } func_8083264C(this, 120, 20, 10, 0); } } From 8db83099bb6b66bb731bd9850ed40b1fe311b0b2 Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Fri, 22 Apr 2022 00:44:33 +0200 Subject: [PATCH 07/18] Fix hardcoded keySegment address (#185) --- soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 91c059bee..54b93277c 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -496,7 +496,7 @@ void EnExItem_DrawMagic(EnExItem* this, GlobalContext* globalCtx, s16 magicIndex } void EnExItem_DrawKey(EnExItem* this, GlobalContext* globalCtx, s32 index) { - static s32 keySegments[] = { 0x0403F140 }; + static void* keySegments[] = { gDropKeySmallTex }; OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ex_item.c", 880); From 0ee779f94adbe99c8ff19b04ebe93dddf4f91879 Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Thu, 21 Apr 2022 16:17:27 -0700 Subject: [PATCH 08/18] Make develop compile --- soh/src/overlays/actors/ovl_player_actor/z_player.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 5ff08df85..aa11b6d7e 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -19,6 +19,7 @@ #include "overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_link_child/object_link_child.h" +#include "textures/icon_item_24_static/icon_item_24_static.h" typedef struct { /* 0x00 */ u8 itemId; @@ -10265,7 +10266,7 @@ void func_80848C74(GlobalContext* globalCtx, Player* this) { } } -void func_80848EF8(Player* this) { +void func_80848EF8(Player* this, GlobalContext* globalCtx) { if (CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY)) { f32 temp = 200000.0f - (this->unk_6A4 * 5.0f); @@ -10584,7 +10585,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { else { this->fallStartHeight = this->actor.world.pos.y; } - func_80848EF8(this); + func_80848EF8(this, globalCtx); } } From b540b7fcfcaca50ddaa42f9018232c8634cfd2fa Mon Sep 17 00:00:00 2001 From: Baoulettes Date: Sun, 24 Apr 2022 16:50:41 +0200 Subject: [PATCH 09/18] Add Enhancement 3D Dropped Items (#144) * Add Enhancement 3D Dropped Items It will change most of dropped item to there 3D models variant, Exclude Rupee from Hyrule Castle (when you are child and in quest to see Zelda.) * Fix z_kaleido_scope_PAL.c L and R button color issues This fix an issue in IF and gDPSetPrimColor for button L & R icon. making it with an else to place the on hover and normal color properly in both button so they both have exact same colour * Fix quite a big logic issue for 3D item drops In short,case logic required to be different with break; old version make it all fucked up with improper values. * Clean Const that was present nor not. * Update z_kaleido_scope_PAL.c * Update z_kaleido_scope_PAL.c --- libultraship/libultraship/GameSettings.cpp | 4 + libultraship/libultraship/GameSettings.h | 1 + libultraship/libultraship/SohImGuiImpl.cpp | 6 + soh/soh/Enhancements/bootcommands.c | 2 + soh/src/code/z_en_item00.c | 326 ++++++++++++++++++--- 5 files changed, 293 insertions(+), 46 deletions(-) diff --git a/libultraship/libultraship/GameSettings.cpp b/libultraship/libultraship/GameSettings.cpp index 2ce22d6f9..c056dec71 100644 --- a/libultraship/libultraship/GameSettings.cpp +++ b/libultraship/libultraship/GameSettings.cpp @@ -73,6 +73,9 @@ namespace Game { Settings.enhancements.mm_bunny_hood = stob(Conf[EnhancementSection]["mm_bunny_hood"]); CVar_SetS32("gMMBunnyHood", Settings.enhancements.mm_bunny_hood); + Settings.enhancements.newdrops = stob(Conf[EnhancementSection]["newdrops"]); + CVar_SetS32("gNewDrops", Settings.enhancements.newdrops); + // Audio Settings.audio.master = Ship::stof(Conf[AudioSection]["master"]); CVar_SetFloat("gGameMasterVolume", Settings.audio.master); @@ -178,6 +181,7 @@ namespace Game { Conf[EnhancementSection]["animated_pause_menu"] = std::to_string(Settings.enhancements.animated_pause_menu); Conf[EnhancementSection]["dynamic_wallet_icon"] = std::to_string(Settings.enhancements.dynamic_wallet_icon); Conf[EnhancementSection]["minimal_ui"] = std::to_string(Settings.enhancements.minimal_ui); + Conf[EnhancementSection]["newdrops"] = std::to_string(Settings.enhancements.newdrops); Conf[EnhancementSection]["visualagony"] = std::to_string(Settings.enhancements.visualagony); Conf[EnhancementSection]["mm_bunny_hood"] = std::to_string(Settings.enhancements.mm_bunny_hood); diff --git a/libultraship/libultraship/GameSettings.h b/libultraship/libultraship/GameSettings.h index 070bdce38..990132f4e 100644 --- a/libultraship/libultraship/GameSettings.h +++ b/libultraship/libultraship/GameSettings.h @@ -26,6 +26,7 @@ struct SoHConfigType { bool animated_pause_menu = false; bool dynamic_wallet_icon = false; bool minimal_ui = false; + bool newdrops = false; bool visualagony = false; bool mm_bunny_hood = false; diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 7355d16a2..72a44162e 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -431,8 +431,14 @@ namespace SohImGui { needs_save = true; } + if (ImGui::Checkbox("Enable 3D Dropped items", &Game::Settings.enhancements.newdrops)) { + CVar_SetS32("gNewDrops", Game::Settings.enhancements.newdrops); + needs_save = true; + } + if (ImGui::Checkbox("Dynamic Wallet Icon", &Game::Settings.enhancements.dynamic_wallet_icon)) { CVar_SetS32(const_cast("gDynamicWalletIcon"), Game::Settings.enhancements.dynamic_wallet_icon); + needs_save = true; } diff --git a/soh/soh/Enhancements/bootcommands.c b/soh/soh/Enhancements/bootcommands.c index c58a11b6b..f3ad9aaac 100644 --- a/soh/soh/Enhancements/bootcommands.c +++ b/soh/soh/Enhancements/bootcommands.c @@ -25,7 +25,9 @@ void BootCommands_Init() CVar_RegisterS32("gDebugEnabled", 0); CVar_RegisterS32("gPauseLiveLink", 0); CVar_RegisterS32("gMinimalUI", 0); + CVar_RegisterS32("gNewDrops", 0); CVar_RegisterS32("gVisualAgony", 0); + } //void BootCommands_ParseBootArgs(char* str) diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index 2693c4b0f..d0179a5e1 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -5,6 +5,9 @@ #define FLAGS 0 +//Used to force variable to be used in different function, feel free to correct me if you have a better way +static s16 DroppedItemRot = 0; + void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx); void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx); @@ -355,11 +358,34 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { switch (this->actor.params) { case ITEM00_RUPEE_GREEN: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.3f); + this->scale = 0.3f; + yOffset = 50.0f; + shadowScale = 0.3f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_RUPEE_BLUE: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.3f); + this->scale = 0.3f; + yOffset = 50.0f; + shadowScale = 0.3f; + this->actor.world.rot.x = 0x4000; + } case ITEM00_RUPEE_RED: - Actor_SetScale(&this->actor, 0.015f); - this->scale = 0.015f; - yOffset = 750.0f; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.3f); + this->scale = 0.3f; + yOffset = 50.0f; + shadowScale = 0.3f; + this->actor.world.rot.x = 0x4000; + } else { + Actor_SetScale(&this->actor, 0.015f); + this->scale = 0.015f; + yOffset = 750.0f; + } break; case ITEM00_SMALL_KEY: this->unk_158 = 0; @@ -374,10 +400,18 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { this->scale = 0.02f; break; case ITEM00_HEART: - this->actor.home.rot.z = Rand_CenteredFloat(65535.0f); - yOffset = 430.0f; - Actor_SetScale(&this->actor, 0.02f); - this->scale = 0.02f; + if (CVar_GetS32("gNewDrops", 0) !=0) { + this->actor.home.rot.z = Rand_CenteredFloat(65535.0f); + yOffset = 25.0f; + Actor_SetScale(&this->actor, 0.3f); + this->scale = 0.3f; + shadowScale = 0.5f; + } else { + this->actor.home.rot.z = Rand_CenteredFloat(65535.0f); + yOffset = 430.0f; + Actor_SetScale(&this->actor, 0.02f); + this->scale = 0.02f; + } break; case ITEM00_HEART_CONTAINER: yOffset = 430.0f; @@ -386,42 +420,154 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { this->scale = 0.02f; break; case ITEM00_ARROWS_SINGLE: - yOffset = 400.0f; - Actor_SetScale(&this->actor, 0.02f); - this->scale = 0.02f; - break; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + } else { + yOffset = 400.0f; + Actor_SetScale(&this->actor, 0.02f); + this->scale = 0.02f; + } + break; case ITEM00_ARROWS_SMALL: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_ARROWS_MEDIUM: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_ARROWS_LARGE: - Actor_SetScale(&this->actor, 0.035f); - this->scale = 0.035f; - yOffset = 250.0f; - break; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + } else { + Actor_SetScale(&this->actor, 0.035f); + this->scale = 0.035f; + yOffset = 250.0f; + } + break; case ITEM00_BOMBS_A: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_BOMBS_B: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_NUTS: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_STICK: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_MAGIC_SMALL: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_SEEDS: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_BOMBS_SPECIAL: - Actor_SetScale(&this->actor, 0.03f); - this->scale = 0.03f; - yOffset = 320.0f; - break; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + } else { + Actor_SetScale(&this->actor, 0.03f); + this->scale = 0.03f; + yOffset = 320.0f; + } + break; case ITEM00_MAGIC_LARGE: - Actor_SetScale(&this->actor, 0.045 - 1e-10); - this->scale = 0.045 - 1e-10; - yOffset = 320.0f; - break; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + } else { + Actor_SetScale(&this->actor, 0.045 - 1e-10); + this->scale = 0.045 - 1e-10; + yOffset = 320.0f; + } + break; case ITEM00_RUPEE_ORANGE: - Actor_SetScale(&this->actor, 0.045 - 1e-10); - this->scale = 0.045 - 1e-10; - yOffset = 750.0f; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.45f); + this->scale = 0.45f; + yOffset = 50.0f; + shadowScale = 0.3f; + this->actor.world.rot.x = 0x4000; + } else { + Actor_SetScale(&this->actor, 0.045 - 1e-10); + this->scale = 0.045 - 1e-10; + yOffset = 750.0f; + } break; case ITEM00_RUPEE_PURPLE: - Actor_SetScale(&this->actor, 0.03f); - this->scale = 0.03f; - yOffset = 750.0f; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.4f); + this->scale = 0.4f; + yOffset = 50.0f; + shadowScale = 0.3f; + this->actor.world.rot.x = 0x4000; + } else { + Actor_SetScale(&this->actor, 0.03f); + this->scale = 0.03f; + yOffset = 750.0f; + } break; case ITEM00_FLEXIBLE: yOffset = 500.0f; @@ -558,6 +704,19 @@ void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) { + + if (CVar_GetS32("gNewDrops", 0) !=0) { //set the rotation system on selected model only :) + if ((this->actor.params == ITEM_RUPEE_GOLD) || (this->actor.params == ITEM_RUPEE_PURPLE) || + (this->actor.params == ITEM00_ARROWS_SINGLE) || (this->actor.params == ITEM00_ARROWS_SMALL) || + (this->actor.params == ITEM00_ARROWS_MEDIUM) || (this->actor.params == ITEM00_ARROWS_LARGE) || + (this->actor.params == ITEM00_BOMBS_A) || (this->actor.params == ITEM00_BOMBS_B) || + (this->actor.params == ITEM00_NUTS) || (this->actor.params == ITEM00_STICK) || + (this->actor.params == ITEM00_MAGIC_SMALL) || (this->actor.params == ITEM00_SEEDS) || + (this->actor.params == ITEM00_MAGIC_LARGE) || (this->actor.params == ITEM00_HEART) || (this->actor.params == ITEM00_BOMBS_SPECIAL)) { + this->actor.shape.rot.y = DroppedItemRot; + } + } + if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk_15A < 0)) || (this->actor.params == ITEM00_HEART_PIECE)) { this->actor.shape.rot.y += 960; @@ -731,6 +890,10 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { EnItem00* this = (EnItem00*)thisx; s32 pad; + if (CVar_GetS32("gNewDrops", 0) !=0) { //Update 3D Model rotation on frame update :) + DroppedItemRot += 100; + } + if (this->unk_15A > 0) { this->unk_15A--; } @@ -934,15 +1097,35 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) { EnItem00* this = (EnItem00*)thisx; f32 mtxScale; - + if (!(this->unk_156 & this->unk_158)) { switch (this->actor.params) { case ITEM00_RUPEE_GREEN: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_RUPEE_GREEN); + break; + } case ITEM00_RUPEE_BLUE: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_RUPEE_BLUE); + break; + } case ITEM00_RUPEE_RED: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_RUPEE_RED); + break; + } case ITEM00_RUPEE_ORANGE: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_RUPEE_GOLD); + break; + } case ITEM00_RUPEE_PURPLE: - EnItem00_DrawRupee(this, globalCtx); + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_RUPEE_PURPLE); + } else { + EnItem00_DrawRupee(this, globalCtx); + } break; case ITEM00_HEART_PIECE: EnItem00_DrawHeartPiece(this, globalCtx); @@ -951,34 +1134,85 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) { EnItem00_DrawHeartContainer(this, globalCtx); break; case ITEM00_HEART: - if (this->unk_15A < 0) { - if (this->unk_15A == -1) { - s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART); - - if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) { - this->actor.objBankIndex = bankIndex; - Actor_SetObjectDependency(globalCtx, &this->actor); - this->unk_15A = -2; - } - } else { - mtxScale = 16.0f; - Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); - GetItem_Draw(globalCtx, GID_HEART); - } - break; + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_HEART); + mtxScale = 16.0f; + Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); + break; + } else { + if (this->unk_15A < 0) { + if (this->unk_15A == -1) { + s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART); + + if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) { + this->actor.objBankIndex = bankIndex; + Actor_SetObjectDependency(globalCtx, &this->actor); + this->unk_15A = -2; + } + } else { + mtxScale = 16.0f; + Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); + GetItem_Draw(globalCtx, GID_HEART); + } + break; + } } case ITEM00_BOMBS_A: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_BOMB); + break; + } case ITEM00_BOMBS_B: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_BOMB); + break; + } case ITEM00_BOMBS_SPECIAL: case ITEM00_ARROWS_SINGLE: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_ARROWS_SMALL); + break; + } case ITEM00_ARROWS_SMALL: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_ARROWS_SMALL); + break; + } case ITEM00_ARROWS_MEDIUM: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_ARROWS_MEDIUM); + break; + } case ITEM00_ARROWS_LARGE: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_ARROWS_LARGE); + break; + } case ITEM00_NUTS: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_NUTS); + break; + } case ITEM00_STICK: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_STICK); + break; + } case ITEM00_MAGIC_LARGE: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_MAGIC_LARGE); + break; + } case ITEM00_MAGIC_SMALL: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_MAGIC_SMALL); + break; + } case ITEM00_SEEDS: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_SEEDS); + break; + } case ITEM00_SMALL_KEY: EnItem00_DrawCollectible(this, globalCtx); break; From 6860600648b06778b5ff57e0aab5f2fd48749a1b Mon Sep 17 00:00:00 2001 From: Baoulettes Date: Sun, 24 Apr 2022 16:51:29 +0200 Subject: [PATCH 10/18] Potential fix for Title being over Kaleido. (#162) * Potential fix for Title being over Kaleido. Changing "OVERLAY_DISP" to "POLY_XLU_DISP" seem to fix and do not bring any errors (I did tried scene one by one and walked around in game) It may be no correct but it could point to the right direction if that is not correct. * Update z_actor.c * Update graph.c * Update z64.h * Update macros.h --- soh/include/macros.h | 1 + soh/include/z64.h | 3 +++ soh/src/code/graph.c | 5 +++++ soh/src/code/z_actor.c | 13 +++++++------ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/soh/include/macros.h b/soh/include/macros.h index 0d86c56c3..8563449b1 100644 --- a/soh/include/macros.h +++ b/soh/include/macros.h @@ -129,6 +129,7 @@ extern GraphicsContext* __gfxCtx; #define WORK_DISP __gfxCtx->work.p #define POLY_OPA_DISP __gfxCtx->polyOpa.p #define POLY_XLU_DISP __gfxCtx->polyXlu.p +#define TITLE_CARD_DISP __gfxCtx->titlecard.p #define POLY_KAL_DISP __gfxCtx->polyKal.p #define OVERLAY_DISP __gfxCtx->overlay.p diff --git a/soh/include/z64.h b/soh/include/z64.h index 24ec79946..92966f239 100644 --- a/soh/include/z64.h +++ b/soh/include/z64.h @@ -83,6 +83,7 @@ typedef struct { /* 0x00000 */ u16 headMagic; // GFXPOOL_HEAD_MAGIC /* 0x00008 */ Gfx polyOpaBuffer[0x2FC0]; /* 0x0BF08 */ Gfx polyXluBuffer[0x1000]; + /* 0xXXXXX */ Gfx titlecardBuffer[0x1000]; /* 0x0BF08 */ Gfx polyKalBuffer[0x1000]; /* 0x0FF08 */ Gfx overlayBuffer[0x800]; /* 0x11F08 */ Gfx workBuffer[0x100]; @@ -130,6 +131,7 @@ typedef struct OSScTask { typedef struct GraphicsContext { /* 0x0000 */ Gfx* polyOpaBuffer; // Pointer to "Zelda 0" /* 0x0004 */ Gfx* polyXluBuffer; // Pointer to "Zelda 1" + /* 0xXXX */ Gfx* titlecardBuffer; // Pointer to "Paris" /* 0xXXX */ Gfx* polyKalBuffer; // Pointer to "Rome" /* 0x0008 */ char unk_008[0x08]; // Unused, could this be pointers to "Zelda 2" / "Zelda 3" /* 0x0010 */ Gfx* overlayBuffer; // Pointer to "Zelda 4" @@ -149,6 +151,7 @@ typedef struct GraphicsContext { /* 0x02A8 */ TwoHeadGfxArena overlay; // "Zelda 4" /* 0x02B8 */ TwoHeadGfxArena polyOpa; // "Zelda 0" /* 0x02C8 */ TwoHeadGfxArena polyXlu; // "Zelda 1" + /* 0x0XXX */ TwoHeadGfxArena titlecard; // When in Paris... /* 0x0XXX */ TwoHeadGfxArena polyKal; // When in Rome... /* 0x02D8 */ u32 gfxPoolIdx; /* 0x02DC */ u16* curFrameBuffer; diff --git a/soh/src/code/graph.c b/soh/src/code/graph.c index 34283f342..3a1719731 100644 --- a/soh/src/code/graph.c +++ b/soh/src/code/graph.c @@ -95,12 +95,14 @@ void Graph_InitTHGA(GraphicsContext* gfxCtx) { pool->tailMagic = GFXPOOL_TAIL_MAGIC; THGA_Ct(&gfxCtx->polyOpa, pool->polyOpaBuffer, sizeof(pool->polyOpaBuffer)); THGA_Ct(&gfxCtx->polyXlu, pool->polyXluBuffer, sizeof(pool->polyXluBuffer)); + THGA_Ct(&gfxCtx->titlecard, pool->titlecardBuffer, sizeof(pool->titlecardBuffer)); THGA_Ct(&gfxCtx->polyKal, pool->polyKalBuffer, sizeof(pool->polyKalBuffer)); THGA_Ct(&gfxCtx->overlay, pool->overlayBuffer, sizeof(pool->overlayBuffer)); THGA_Ct(&gfxCtx->work, pool->workBuffer, sizeof(pool->workBuffer)); gfxCtx->polyOpaBuffer = pool->polyOpaBuffer; gfxCtx->polyXluBuffer = pool->polyXluBuffer; + gfxCtx->titlecardBuffer = pool->titlecardBuffer; gfxCtx->polyKalBuffer = pool->polyKalBuffer; gfxCtx->overlayBuffer = pool->overlayBuffer; gfxCtx->workBuffer = pool->workBuffer; @@ -274,6 +276,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { gDPNoOpString(WORK_DISP++, "WORK_DISP 開始", 0); gDPNoOpString(POLY_OPA_DISP++, "POLY_OPA_DISP 開始", 0); gDPNoOpString(POLY_XLU_DISP++, "POLY_XLU_DISP 開始", 0); + gDPNoOpString(TITLE_CARD_DISP++, "TITLE_CARD_DISP 開始", 0);//unsure if needed gDPNoOpString(OVERLAY_DISP++, "OVERLAY_DISP 開始", 0); CLOSE_DISPS(gfxCtx, "../graph.c", 975); @@ -286,6 +289,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { gDPNoOpString(WORK_DISP++, "WORK_DISP 終了", 0); gDPNoOpString(POLY_OPA_DISP++, "POLY_OPA_DISP 終了", 0); gDPNoOpString(POLY_XLU_DISP++, "POLY_XLU_DISP 終了", 0); + gDPNoOpString(TITLE_CARD_DISP++, "TITLE_CARD_DISP 終了", 0); gDPNoOpString(OVERLAY_DISP++, "OVERLAY_DISP 終了", 0); CLOSE_DISPS(gfxCtx, "../graph.c", 996); @@ -294,6 +298,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { gSPBranchList(WORK_DISP++, gfxCtx->polyOpaBuffer); gSPBranchList(POLY_OPA_DISP++, gfxCtx->polyXluBuffer); + gSPBranchList(POLY_XLU_DISP++, gfxCtx->titlecardBuffer); gSPBranchList(POLY_XLU_DISP++, gfxCtx->polyKalBuffer); gSPBranchList(POLY_KAL_DISP++, gfxCtx->overlayBuffer); gDPPipeSync(OVERLAY_DISP++); diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index fee697055..eee9d8882 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -992,29 +992,30 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { height = (width * height > 0x1000) ? 0x1000 / width : height; titleSecondY = titleY + (height * 4); - OVERLAY_DISP = func_80093808(OVERLAY_DISP); + //TITLE_CARD_DISP Goes over POLY_XLU_DISP but under POLY_KAL_DISP + TITLE_CARD_DISP = func_80093808(TITLE_CARD_DISP); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity, + gDPSetPrimColor(TITLE_CARD_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->alpha); - gDPLoadTextureBlock(OVERLAY_DISP++, (uintptr_t)titleCtx->texture + textureLanguageOffset, G_IM_FMT_IA, + gDPLoadTextureBlock(TITLE_CARD_DISP++, (uintptr_t)titleCtx->texture + textureLanguageOffset, G_IM_FMT_IA, G_IM_SIZ_8b, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4) - 1, + gSPTextureRectangle(TITLE_CARD_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4) - 1, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); height = titleCtx->height - height; // If texture is bigger than 0x1000, display the rest if (height > 0) { - gDPLoadTextureBlock(OVERLAY_DISP++, (uintptr_t)titleCtx->texture + textureLanguageOffset + 0x1000, + gDPLoadTextureBlock(TITLE_CARD_DISP++, (uintptr_t)titleCtx->texture + textureLanguageOffset + 0x1000, G_IM_FMT_IA, G_IM_SIZ_8b, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(OVERLAY_DISP++, titleX, titleSecondY, ((doubleWidth * 2) + titleX) - 4, + gSPTextureRectangle(TITLE_CARD_DISP++, titleX, titleSecondY, ((doubleWidth * 2) + titleX) - 4, titleSecondY + (height * 4) - 1, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); } From 7d26b322f580e29855dba20a71670cbcfbfd423f Mon Sep 17 00:00:00 2001 From: Baoulettes Date: Sun, 24 Apr 2022 16:51:54 +0200 Subject: [PATCH 11/18] Fix minimap update in dungeon (#171) Thanks to Rozelette for this method ! --- soh/src/code/z_map_exp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index 734209770..cfef800c9 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -664,6 +664,7 @@ void Minimap_Draw(GlobalContext* globalCtx) { if (CHECK_DUNGEON_ITEM(DUNGEON_MAP, mapIndex)) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 255, 255, interfaceCtx->minimapAlpha); + gSPInvalidateTexCache(OVERLAY_DISP++, interfaceCtx->mapSegment); gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->mapSegment, G_IM_FMT_I, 96, 85, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); From 73ede53447c842c1c48d82a6636d9288490dbf71 Mon Sep 17 00:00:00 2001 From: sholdee <102821812+sholdee@users.noreply.github.com> Date: Sun, 24 Apr 2022 09:58:29 -0500 Subject: [PATCH 12/18] Fix build dates (#194) * Delete build.c * Update build.c * Update soh.vcxproj --- soh/build.c | 8 -------- soh/soh.vcxproj | 5 +---- soh/src/boot/build.c | 4 ---- 3 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 soh/build.c diff --git a/soh/build.c b/soh/build.c deleted file mode 100644 index f3f9bdae6..000000000 --- a/soh/build.c +++ /dev/null @@ -1,8 +0,0 @@ -const char gBuildVersion[] = "DECKARD ALFA (1.0.0)"; -const char gBuildTeam[] = "github.com/harbourmasters"; -#ifdef __TIMESTAMP__ -const char gBuildDate[] = __TIMESTAMP__; -#else -const char gBuildDate[] = __DATE__ " " __TIME__; -#endif -const char gBuildMakeOption[] = ""; diff --git a/soh/soh.vcxproj b/soh/soh.vcxproj index adf205f14..d35dd18b3 100644 --- a/soh/soh.vcxproj +++ b/soh/soh.vcxproj @@ -112,9 +112,6 @@ true true - - copy /b $(ProjectDir)src\boot\build.c +,, - @@ -1407,4 +1404,4 @@ - \ No newline at end of file + diff --git a/soh/src/boot/build.c b/soh/src/boot/build.c index f3f9bdae6..f60380467 100644 --- a/soh/src/boot/build.c +++ b/soh/src/boot/build.c @@ -1,8 +1,4 @@ const char gBuildVersion[] = "DECKARD ALFA (1.0.0)"; const char gBuildTeam[] = "github.com/harbourmasters"; -#ifdef __TIMESTAMP__ -const char gBuildDate[] = __TIMESTAMP__; -#else const char gBuildDate[] = __DATE__ " " __TIME__; -#endif const char gBuildMakeOption[] = ""; From 5a40f394944a69c1fa16d993eee3a2ae8752cd04 Mon Sep 17 00:00:00 2001 From: Ada <60364512+GreatArgorath@users.noreply.github.com> Date: Sun, 24 Apr 2022 15:59:41 +0100 Subject: [PATCH 13/18] Adds checkbox for visual stone of agony (#200) --- libultraship/libultraship/SohImGuiImpl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 72a44162e..3556177d7 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -416,6 +416,11 @@ namespace SohImGui { needs_save = true; } + if (ImGui::Checkbox("Visual Stone of Agony", &Game::Settings.enhancements.visualagony)) { + CVar_SetS32("gVisualAgony", Game::Settings.enhancements.visualagony); + needs_save = true; + } + ImGui::Text("Graphics"); ImGui::Separator(); From eb97186f73187089d6b5134f639b5942b2295cbd Mon Sep 17 00:00:00 2001 From: MegaMech Date: Sun, 24 Apr 2022 09:00:14 -0600 Subject: [PATCH 14/18] readme build instructions split (#201) * Create BUILDING.md * Update README.md * Update README.md * Update README.md --- BUILDING.md | 22 ++++++++++++++++++++++ README.md | 20 +------------------- 2 files changed, 23 insertions(+), 19 deletions(-) create mode 100644 BUILDING.md diff --git a/BUILDING.md b/BUILDING.md new file mode 100644 index 000000000..82c26bff4 --- /dev/null +++ b/BUILDING.md @@ -0,0 +1,22 @@ +# Building Ship of Harkinian + + 1. Install [Python](https://www.python.org/ftp/python/3.10.2/python-3.10.2-amd64.exe) + 2. Install [Visual Studio 2022 Community Edition](https://visualstudio.microsoft.com/vs/community/) + 2b. In the Visual Studio Installer, install `MSVC v142 - VS 2019 C++`. + 4. Clone the Ship of Harkinian repository. + 5. Place one or more [compatible](#compatible-roms) roms in the `OTRExporter` directory with namings of your choice. + 6. Run `OTRExporter/OTRExporter.sln`. + 7. Switch the solution to `Release x64`. + 8. Build the solution. + 9. Launching `OTRExporter/extract_assets.py` will generate an `oot.otr` archive file in `OTRExporter/oot.otr`. + 10. Run `soh/soh.sln` + 11. Switch the solution to `Release x86`. + 12. Build the solution. + 13. Copy the `OTRExporter/oot.otr` archive file to `soh/Release`. + 14. Launch `soh.exe`. + +## Compatible Roms +``` +OOT_PAL_GC checksum 0x09465AC3 +OOT_PAL_GC_DBG1 checksum 0x871E1C92 (debug non-master quest) +``` diff --git a/README.md b/README.md index e9e7b9070..65a6b90e0 100644 --- a/README.md +++ b/README.md @@ -51,26 +51,8 @@ Official Discord: https://discord.com/invite/BtBmd55HVH ## Building The Ship of Harkinian - 1. Install [Python](https://www.python.org/ftp/python/3.10.2/python-3.10.2-amd64.exe) - 2. Install [Visual Studio 2022 Community Edition](https://visualstudio.microsoft.com/vs/community/) - 2b. In the Visual Studio Installer, install `MSVC v142 - VS 2019 C++`. - 4. Clone the Ship of Harkinian repository. - 5. Place one or more [compatible](#compatible-roms) roms in the `OTRExporter` directory with namings of your choice. - 6. Run `OTRExporter/OTRExporter.sln`. - 7. Switch the solution to `Release x64`. - 8. Build the solution. - 9. Launching `OTRExporter/extract_assets.py` will generate an `oot.otr` archive file in `OTRExporter/oot.otr`. - 10. Run `soh/soh.sln` - 11. Switch the solution to `Release x86`. - 12. Build the solution. - 13. Copy the `OTRExporter/oot.otr` archive file to `soh/Release`. - 14. Launch `soh.exe`. +Refer to the [building instructions](https://github.com/HarbourMasters/Shipwright/BUILDING.md) to compile SoH. -## Compatible Roms -``` -OOT_PAL_GC checksum 0x09465AC3 -OOT_PAL_GC_DBG1 checksum 0x871E1C92 (debug non-master quest) -``` ## Troubleshooting The Exporter - Affirm that you have an `/assets` folder filled with XMLs in the same directory as OTRGui.exe - Affirm that `zapd.exe` exists in the `/assets/extractor` folder From 17858fb67c6aee7813e3e4310785803815b9ff08 Mon Sep 17 00:00:00 2001 From: Baoulettes Date: Sun, 24 Apr 2022 17:00:46 +0200 Subject: [PATCH 15/18] Fix languages Zone name on Kaleido (#203) This fix town/village and zone on maps in Kaleido menu. --- .../misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 9db5399a4..3c023105f 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -3177,15 +3177,9 @@ void KaleidoScope_Update(GlobalContext* globalCtx) if (gSaveContext.language == LANGUAGE_ENG) { memcpy(pauseCtx->nameSegment + 0x400, ResourceMgr_LoadTexByName(mapNameTextures[36 + gSaveContext.worldMapArea]), 0xA00); } else if (gSaveContext.language == LANGUAGE_GER) { - DmaMgr_SendRequest1(pauseCtx->nameSegment + 0x400, - (uintptr_t)_map_name_staticSegmentRomStart + - (((void)0, gSaveContext.worldMapArea) * 0xA00) + 0x16C00, - 0xA00, "../z_kaleido_scope_PAL.c", 3780); + memcpy(pauseCtx->nameSegment + 0x400, ResourceMgr_LoadTexByName(mapNameTextures[59 + gSaveContext.worldMapArea]), 0xA00); } else { - DmaMgr_SendRequest1(pauseCtx->nameSegment + 0x400, - (uintptr_t)_map_name_staticSegmentRomStart + - (((void)0, gSaveContext.worldMapArea) * 0xA00) + 0x24800, - 0xA00, "../z_kaleido_scope_PAL.c", 3784); + memcpy(pauseCtx->nameSegment + 0x400, ResourceMgr_LoadTexByName(mapNameTextures[81 + gSaveContext.worldMapArea]), 0xA00); } } // OTRTODO - player on pause From bb3227a7c20c0a6ddbac285a4047ccab3e29b1ea Mon Sep 17 00:00:00 2001 From: Ada <60364512+GreatArgorath@users.noreply.github.com> Date: Sun, 24 Apr 2022 16:02:15 +0100 Subject: [PATCH 16/18] Fixes default text speed (#207) * Fixes text speed * Adds text speed default to ConfigFile.cpp + removes workaround --- libultraship/libultraship/ConfigFile.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libultraship/libultraship/ConfigFile.cpp b/libultraship/libultraship/ConfigFile.cpp index 1b4952139..2e9a8cc94 100644 --- a/libultraship/libultraship/ConfigFile.cpp +++ b/libultraship/libultraship/ConfigFile.cpp @@ -2,6 +2,7 @@ #include "spdlog/spdlog.h" #include "GlobalCtx2.h" #include "Window.h" +#include "GameSettings.h" namespace Ship { ConfigFile::ConfigFile(std::shared_ptr Context, const std::string& Path) : Context(Context), Path(Path), File(Path.c_str()) { @@ -149,6 +150,8 @@ namespace Ship { (*this)["KEYBOARD CONTROLLER BINDING 4"][STR(BTN_STICKDOWN)] = std::to_string(0x01F); (*this)["KEYBOARD CONTROLLER BINDING 4"][STR(BTN_STICKUP)] = std::to_string(0x011); + (*this)["ENHANCEMENT SETTINGS"]["TEXT_SPEED"] = "1"; + (*this)["SDL CONTROLLER 1"]["GUID"] = ""; (*this)["SDL CONTROLLER 2"]["GUID"] = ""; (*this)["SDL CONTROLLER 3"]["GUID"] = ""; From 576842ac74f2e18c2ad75d345be68ea446ad2d2f Mon Sep 17 00:00:00 2001 From: Ada <60364512+GreatArgorath@users.noreply.github.com> Date: Sun, 24 Apr 2022 16:03:25 +0100 Subject: [PATCH 17/18] Makes text speed slider consistent with the rest of the UI (#208) --- libultraship/libultraship/SohImGuiImpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 3556177d7..7af532a09 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -395,8 +395,8 @@ namespace SohImGui { ImGui::Text("Gameplay"); ImGui::Separator(); - ImGui::Text("Text Speed", Game::Settings.enhancements.text_speed); - if (ImGui::SliderInt("##TEXTSPEED", &Game::Settings.enhancements.text_speed, 1, 5)) { + ImGui::Text("Text Speed: %dx", Game::Settings.enhancements.text_speed); + if (ImGui::SliderInt("##TEXTSPEED", &Game::Settings.enhancements.text_speed, 1, 5, "")) { CVar_SetS32("gTextSpeed", Game::Settings.enhancements.text_speed); needs_save = true; } From ffa4a111484cd95cb20985e8f378e59af30eb5dc Mon Sep 17 00:00:00 2001 From: Ada <60364512+GreatArgorath@users.noreply.github.com> Date: Sun, 24 Apr 2022 16:04:06 +0100 Subject: [PATCH 18/18] Fixes visual bug in shops when above 2x text speed (#211) --- soh/src/code/z_message_PAL.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index a767ede79..4780044a6 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1144,7 +1144,7 @@ void Message_DrawText(GlobalContext* globalCtx, Gfx** gfxP) { } } if (msgCtx->textDelayTimer == 0) { - msgCtx->textDrawPos = i + CVar_GetS32("gTextSpeed", 1); + msgCtx->textDrawPos = i + 1; msgCtx->textDelayTimer = msgCtx->textDelay; } else { msgCtx->textDelayTimer--;