From 59975a6fa1cedf96a03330f39af3a50f24b3a477 Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Wed, 8 Apr 2026 11:20:08 -0400 Subject: [PATCH 01/10] Oxygen & Tears of Light now widescreen --- src/d/d_meter_HIO.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/d/d_meter_HIO.cpp b/src/d/d_meter_HIO.cpp index dbfe11cf53..c23e6c3230 100644 --- a/src/d/d_meter_HIO.cpp +++ b/src/d/d_meter_HIO.cpp @@ -2293,7 +2293,10 @@ void dMeter_drawHIO_c::updateOnWide() { g_drawHIO.mMainHUDButtonsPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mMainHUDButtonsPosX); g_drawHIO.mRingHUDButtonsPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mRingHUDButtonsPosX); + g_drawHIO.mLightDrop.mVesselPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mLightDrop.mVesselPosX); + g_drawHIO.mLightDrop.mVesselTalkPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mLightDrop.mVesselTalkPosX); g_drawHIO.mRupeeKeyPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mRupeeKeyPosX); + g_drawHIO.mOxygenMeterPosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mOxygenMeterPosX); g_drawHIO.mButtonCrossOFFPosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mButtonCrossOFFPosX); g_drawHIO.mButtonCrossONPosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mButtonCrossONPosX); g_drawHIO.mLifeGaugePosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mLifeGaugePosX); From 10d0b014c636d304c5223a07534847b822988f3a Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Wed, 8 Apr 2026 11:39:53 -0400 Subject: [PATCH 02/10] Modified line width back to vanilla default --- src/d/d_map_path.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d/d_map_path.cpp b/src/d/d_map_path.cpp index f7ce0f1a51..c57dd85a48 100644 --- a/src/d/d_map_path.cpp +++ b/src/d/d_map_path.cpp @@ -19,7 +19,7 @@ constexpr u16 kMapResolutionMultiplier = 4; // Line widths are relative to the framebuffer size. Since we're rendering to a separate // framebuffer, we have to scale them accordingly. The original game used about half of the // EFB for the map rendering, so this is a reasonable approximation. -constexpr u8 kMapLineWidthMultiplier = 2; +constexpr u8 kMapLineWidthMultiplier = 1; #endif void dMpath_n::dTexObjAggregate_c::create() { From 406580c5d64e920282d35e5350d83a5c235d2863 Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Wed, 8 Apr 2026 11:44:35 -0400 Subject: [PATCH 03/10] nvm that --- src/d/d_map_path.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d/d_map_path.cpp b/src/d/d_map_path.cpp index c57dd85a48..f7ce0f1a51 100644 --- a/src/d/d_map_path.cpp +++ b/src/d/d_map_path.cpp @@ -19,7 +19,7 @@ constexpr u16 kMapResolutionMultiplier = 4; // Line widths are relative to the framebuffer size. Since we're rendering to a separate // framebuffer, we have to scale them accordingly. The original game used about half of the // EFB for the map rendering, so this is a reasonable approximation. -constexpr u8 kMapLineWidthMultiplier = 1; +constexpr u8 kMapLineWidthMultiplier = 2; #endif void dMpath_n::dTexObjAggregate_c::create() { From a94fa51c805f5b1422cc9c13677035dd80346c8f Mon Sep 17 00:00:00 2001 From: Jeffrey Crowell Date: Wed, 8 Apr 2026 15:13:21 -0400 Subject: [PATCH 04/10] Fix Crash at the end of the Armogohma cutscene #282 zero stack buffers in JASSeqParser::cmdPrintf on PC builds use AVOID_UB instead of TARGET_PC --- libs/JSystem/src/JAudio2/JASSeqParser.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/JSystem/src/JAudio2/JASSeqParser.cpp b/libs/JSystem/src/JAudio2/JASSeqParser.cpp index 376ec22b4c..b2077ce499 100644 --- a/libs/JSystem/src/JAudio2/JASSeqParser.cpp +++ b/libs/JSystem/src/JAudio2/JASSeqParser.cpp @@ -813,9 +813,15 @@ s32 JASSeqParser::cmdDump(JASTrack* param_0, u32* param_1) { } s32 JASSeqParser::cmdPrintf(JASTrack* param_0, u32* param_1) { +#if AVOID_UB + u8 stack_c[4] = {0}; + u32 stack_10[4] = {0}; + char buffer[128] = {0}; +#else u8 stack_c[4]; u32 stack_10[4]; char buffer[128]; +#endif JASSeqCtrl* seqCtrl = param_0->getSeqCtrl(); u32 r30 = 0; From 7fd77e611b1aa7cc8e282719cc57adcd58555f43 Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Wed, 8 Apr 2026 17:17:03 -0400 Subject: [PATCH 05/10] Fixes senses when changing window size --- src/d/actor/d_a_alink_effect.inc | 3 +-- src/d/d_kankyo.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/d/actor/d_a_alink_effect.inc b/src/d/actor/d_a_alink_effect.inc index 1c02cb54f0..d595cd4293 100644 --- a/src/d/actor/d_a_alink_effect.inc +++ b/src/d/actor/d_a_alink_effect.inc @@ -1564,8 +1564,7 @@ void daAlink_c::setMetamorphoseEffectStartLink() { #endif #if TARGET_PC - static const Vec effWideScale = {mDoGph_gInf_c::getAspect(), 1.0f, 1.0f}; - emitter->setGlobalParticleScale(effWideScale); + emitter->setGlobalParticleScale(mDoGph_gInf_c::getScale(), 1.0f); #endif } diff --git a/src/d/d_kankyo.cpp b/src/d/d_kankyo.cpp index b9262bab23..8644d433aa 100644 --- a/src/d/d_kankyo.cpp +++ b/src/d/d_kankyo.cpp @@ -821,12 +821,20 @@ static void dKy_FiveSenses_fullthrottle_dark_static1() { } if (kankyo->senses_ef_emitter1 != NULL) { + #if TARGET_PC + kankyo->senses_ef_emitter1->setGlobalParticleScale(mDoGph_gInf_c::getScale(), 1.0f); + #endif + kankyo->senses_ef_emitter1->setGlobalTranslation(particle_pos.x, particle_pos.y, particle_pos.z); kankyo->senses_ef_emitter1->setGlobalAlpha(kankyo->senses_effect_strength * 255.0f); } if (kankyo->senses_ef_emitter2 != NULL) { + #if TARGET_PC + kankyo->senses_ef_emitter2->setGlobalParticleScale(mDoGph_gInf_c::getScale(), 1.0f); + #endif + kankyo->senses_ef_emitter2->setGlobalTranslation(particle_pos.x, particle_pos.y, particle_pos.z); From 0277640a17a8ceeca71994529deffba6c6dbdf17 Mon Sep 17 00:00:00 2001 From: SuperDude88 <82904174+SuperDude88@users.noreply.github.com> Date: Wed, 8 Apr 2026 17:58:21 -0400 Subject: [PATCH 06/10] Free Magic Armor Remove the rupee drain for using the magic armor --- include/dusk/settings.h | 1 + src/d/actor/d_a_alink.cpp | 10 ++++++++++ src/d/actor/d_a_alink_damage.inc | 5 +++++ src/d/actor/d_a_alink_wolf.inc | 11 ++++++++++- src/dusk/imgui/ImGuiMenuEnhancements.cpp | 5 +++++ src/dusk/settings.cpp | 2 ++ 6 files changed, 33 insertions(+), 1 deletion(-) diff --git a/include/dusk/settings.h b/include/dusk/settings.h index 2436be70f5..ea7ec1521b 100644 --- a/include/dusk/settings.h +++ b/include/dusk/settings.h @@ -60,6 +60,7 @@ struct UserSettings { ConfigVar enableFastIronBoots; ConfigVar canTransformAnywhere; ConfigVar fastSpinner; + ConfigVar freeMagicArmor; // Technical ConfigVar restoreWiiGlitches; diff --git a/src/d/actor/d_a_alink.cpp b/src/d/actor/d_a_alink.cpp index 48269ddc56..670dd169c3 100644 --- a/src/d/actor/d_a_alink.cpp +++ b/src/d/actor/d_a_alink.cpp @@ -12677,7 +12677,11 @@ void daAlink_c::setMagicArmorBrk(int i_status) { } BOOL daAlink_c::checkMagicArmorHeavy() const { +#if TARGET_PC + return checkMagicArmorWearAbility() && (dComIfGs_getRupee() == 0 && !dusk::getSettings().game.freeMagicArmor); +#else return checkMagicArmorWearAbility() && dComIfGs_getRupee() == 0; +#endif } BOOL daAlink_c::checkBootsOrArmorHeavy() const { @@ -18583,7 +18587,13 @@ int daAlink_c::execute() { field_0x372c = cXyz::Zero; field_0x2fb8 = 0; +#if TARGET_PC + // This handles rupee drain and transitions between rupees/no rupees + // We can skip all of that if the magic armor doesn't use rupees + if (!dusk::getSettings().game.freeMagicArmor && checkMagicArmorWearAbility() && mClothesChangeWaitTimer == 0) { +#else if (checkMagicArmorWearAbility() && mClothesChangeWaitTimer == 0) { +#endif if (checkMagicArmorNoDamage() && !checkEventRun()) { if (field_0x2fc3 == 0) { field_0x2fc3 = 10; diff --git a/src/d/actor/d_a_alink_damage.inc b/src/d/actor/d_a_alink_damage.inc index 420011cfd6..ac5175e314 100644 --- a/src/d/actor/d_a_alink_damage.inc +++ b/src/d/actor/d_a_alink_damage.inc @@ -187,6 +187,11 @@ int daAlink_c::setDamagePoint(int i_dmgAmount, BOOL i_checkZoraMag, BOOL i_setDm } if (checkMagicArmorNoDamage()) { +#if TARGET_PC + if(dusk::getSettings().game.freeMagicArmor) { + i_dmgAmount = 0; + } +#endif dComIfGp_setItemRupeeCount(-i_dmgAmount * 10); } else #if DEBUG diff --git a/src/d/actor/d_a_alink_wolf.inc b/src/d/actor/d_a_alink_wolf.inc index 2bf1129f17..2e38298090 100644 --- a/src/d/actor/d_a_alink_wolf.inc +++ b/src/d/actor/d_a_alink_wolf.inc @@ -313,7 +313,12 @@ void daAlink_c::changeLink(int param_0) { mpLinkHandModel = initModel(static_cast(dComIfG_getObjectRes(l_mArcName, "al_hands.bmd")), 0); - if (dComIfGs_getRupee() != 0) { +#if TARGET_PC + if (dComIfGs_getRupee() != 0 || dusk::getSettings().game.freeMagicArmor) +#else + if (dComIfGs_getRupee() != 0) +#endif + { setMagicArmorBrk(1); } else { setMagicArmorBrk(0); @@ -398,7 +403,11 @@ void daAlink_c::changeLink(int param_0) { field_0x06ec = field_0x064C->getMaterialNodePointer(1)->getShape(); field_0x06f0 = field_0x064C->getMaterialNodePointer(2)->getShape(); +#if TARGET_PC + if (dComIfGs_getRupee() != 0 || dusk::getSettings().game.freeMagicArmor) { +#else if (dComIfGs_getRupee() != 0) { +#endif var_r27 = 4; } else { var_r27 = 5; diff --git a/src/dusk/imgui/ImGuiMenuEnhancements.cpp b/src/dusk/imgui/ImGuiMenuEnhancements.cpp index e9404e2476..b17ab76b1b 100644 --- a/src/dusk/imgui/ImGuiMenuEnhancements.cpp +++ b/src/dusk/imgui/ImGuiMenuEnhancements.cpp @@ -106,6 +106,11 @@ namespace dusk { ImGui::SetTooltip("Speeds up Spinner movement when holding R."); } + config::ImGuiCheckbox("Free Magic Armor", getSettings().game.freeMagicArmor); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Makes the magic armor work without rupees."); + } + ImGui::EndMenu(); } diff --git a/src/dusk/settings.cpp b/src/dusk/settings.cpp index d923a2b00e..ce203e2016 100644 --- a/src/dusk/settings.cpp +++ b/src/dusk/settings.cpp @@ -48,6 +48,7 @@ UserSettings g_userSettings = { .enableFastIronBoots {"game.enableFastIronBoots", false}, .canTransformAnywhere {"game.canTransformAnywhere", false}, .fastSpinner {"game.fastSpinner", false}, + .freeMagicArmor {"game.freeMagicArmor", false}, // Technical .restoreWiiGlitches {"game.restoreWiiGlitches", false}, @@ -91,6 +92,7 @@ void registerSettings() { Register(g_userSettings.game.useWaterProjectionOffset); Register(g_userSettings.game.enableFastIronBoots); Register(g_userSettings.game.canTransformAnywhere); + Register(g_userSettings.game.freeMagicArmor); Register(g_userSettings.game.restoreWiiGlitches); Register(g_userSettings.game.noMissClimbing); Register(g_userSettings.game.noLowHpSound); From 1b8162c30e6068679ca3694dc6fb2e89f2935911 Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Wed, 8 Apr 2026 18:35:41 -0400 Subject: [PATCH 07/10] Fix the rest of the water projections --- src/d/actor/d_a_obj_groundwater.cpp | 8 ++++++++ src/d/actor/d_a_obj_lv3Water.cpp | 6 ++++++ src/d/actor/d_a_obj_lv3Water2.cpp | 9 ++++++++- src/d/actor/d_a_obj_lv3WaterB.cpp | 7 +++++++ src/d/actor/d_a_obj_rstair.cpp | 7 +++++++ src/d/actor/d_a_obj_tp.cpp | 7 +++++++ 6 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/d/actor/d_a_obj_groundwater.cpp b/src/d/actor/d_a_obj_groundwater.cpp index 2d3d05a36c..ab6b7af922 100644 --- a/src/d/actor/d_a_obj_groundwater.cpp +++ b/src/d/actor/d_a_obj_groundwater.cpp @@ -300,11 +300,19 @@ int daGrdWater_c::Draw() { J3DTexMtxInfo* mtxInfo = &material->getTexGenBlock()->getTexMtx(0)->getTexMtxInfo(); if (mtxInfo != NULL) { Mtx afStack_50; + + #if TARGET_PC + C_MTXLightPerspective(afStack_50, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, + 1.0f, 1.0f, dusk::getSettings().game.useWaterProjectionOffset ? -0.01f : 0.0f, 0.0f); + #else C_MTXLightPerspective(afStack_50, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.01f, 0.0f); + #endif + #if WIDESCREEN_SUPPORT mDoGph_gInf_c::setWideZoomLightProjection(afStack_50); #endif + mtxInfo->setEffectMtx(afStack_50); modelData2->simpleCalcMaterial(0, (MtxP)j3dDefaultMtx); } diff --git a/src/d/actor/d_a_obj_lv3Water.cpp b/src/d/actor/d_a_obj_lv3Water.cpp index a228b2cbc8..934cb3140d 100644 --- a/src/d/actor/d_a_obj_lv3Water.cpp +++ b/src/d/actor/d_a_obj_lv3Water.cpp @@ -371,8 +371,14 @@ int daLv3Water_c::Draw() { texMtxInfo = &material->getTexGenBlock()->getTexMtx(0)->getTexMtxInfo(); if (texMtxInfo != NULL) { Mtx lightProjMtx; + + #if TARGET_PC + C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy, + dComIfGd_getView()->aspect, 1.0f, 1.0f, dusk::getSettings().game.useWaterProjectionOffset ? -0.01f : 0.0f, 0.0f); + #else C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.01f, 0.0f); + #endif #if WIDESCREEN_SUPPORT mDoGph_gInf_c::setWideZoomLightProjection(lightProjMtx); diff --git a/src/d/actor/d_a_obj_lv3Water2.cpp b/src/d/actor/d_a_obj_lv3Water2.cpp index b6814875cc..4e367e8912 100644 --- a/src/d/actor/d_a_obj_lv3Water2.cpp +++ b/src/d/actor/d_a_obj_lv3Water2.cpp @@ -197,7 +197,14 @@ int daLv3Water2_c::Draw() { texMtxInfo = &btkMaterial->getTexGenBlock()->getTexMtx(0)->getTexMtxInfo(); if(texMtxInfo) { Mtx lightProjMtx; - C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.01f, 0); + + #if TARGET_PC + C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy, + dComIfGd_getView()->aspect, 1.0f, 1.0f, dusk::getSettings().game.useWaterProjectionOffset ? -0.01f : 0.0f, 0); + #else + C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy, + dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.01f, 0); + #endif #if WIDESCREEN_SUPPORT mDoGph_gInf_c::setWideZoomLightProjection(lightProjMtx); diff --git a/src/d/actor/d_a_obj_lv3WaterB.cpp b/src/d/actor/d_a_obj_lv3WaterB.cpp index f4ad49685d..33285d975f 100644 --- a/src/d/actor/d_a_obj_lv3WaterB.cpp +++ b/src/d/actor/d_a_obj_lv3WaterB.cpp @@ -27,8 +27,15 @@ static int daObj_Lv3waterB_Draw(obj_lv3WaterB_class* i_this) { J3DTexMtxInfo* tex_mtx_info = &material_p->getTexGenBlock()->getTexMtx(0)->getTexMtxInfo(); if (tex_mtx_info != NULL) { Mtx m; + + #if TARGET_PC + C_MTXLightPerspective(m, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, 1.0f, 1.0f, + dusk::getSettings().game.useWaterProjectionOffset ? -0.015f : 0.0f, 0.0f); + #else C_MTXLightPerspective(m, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.015f, 0.0f); + #endif + #if WIDESCREEN_SUPPORT mDoGph_gInf_c::setWideZoomLightProjection(m); #endif diff --git a/src/d/actor/d_a_obj_rstair.cpp b/src/d/actor/d_a_obj_rstair.cpp index 609a0cf7b8..7e44cc3700 100644 --- a/src/d/actor/d_a_obj_rstair.cpp +++ b/src/d/actor/d_a_obj_rstair.cpp @@ -313,8 +313,15 @@ int daObjRotStair_c::Draw() { J3DTexMtxInfo* texMtxInfo = &material->getTexGenBlock()->getTexMtx(0)->getTexMtxInfo(); if (texMtxInfo != NULL) { Mtx lightMtx; + + #if TARGET_PC + C_MTXLightPerspective(lightMtx, dComIfGd_getView()->fovy, + dComIfGd_getView()->aspect, 1.0f, 1.0f, dusk::getSettings().game.useWaterProjectionOffset ? -0.01f : 0.0f, 0); + #else C_MTXLightPerspective(lightMtx, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.01f, 0); + #endif + #if WIDESCREEN_SUPPORT mDoGph_gInf_c::setWideZoomLightProjection(lightMtx); #endif diff --git a/src/d/actor/d_a_obj_tp.cpp b/src/d/actor/d_a_obj_tp.cpp index 2690de3e04..e2ede47b15 100644 --- a/src/d/actor/d_a_obj_tp.cpp +++ b/src/d/actor/d_a_obj_tp.cpp @@ -36,8 +36,15 @@ static int daObj_Tp_Draw(obj_tp_class* i_this) { &material->getTexGenBlock()->getTexMtx(0)->getTexMtxInfo(); if (texMtxInfo != NULL) { Mtx lightProjMtx; + + #if TARGET_PC + C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy, + dComIfGd_getView()->aspect, 1.0f, 1.0f, dusk::getSettings().game.useWaterProjectionOffset ? -0.01f : 0.0f, 0); + #else C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.01f, 0); + #endif + #if WIDESCREEN_SUPPORT mDoGph_gInf_c::setWideZoomLightProjection(lightProjMtx); #endif From d2969bc55249fb07278bc4bf148a38ae7fdbb9e1 Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Wed, 8 Apr 2026 18:37:50 -0400 Subject: [PATCH 08/10] Fix line indent --- src/d/actor/d_a_obj_lv3Water2.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/d/actor/d_a_obj_lv3Water2.cpp b/src/d/actor/d_a_obj_lv3Water2.cpp index 4e367e8912..55fc94d605 100644 --- a/src/d/actor/d_a_obj_lv3Water2.cpp +++ b/src/d/actor/d_a_obj_lv3Water2.cpp @@ -202,8 +202,7 @@ int daLv3Water2_c::Draw() { C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, 1.0f, 1.0f, dusk::getSettings().game.useWaterProjectionOffset ? -0.01f : 0.0f, 0); #else - C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy, - dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.01f, 0); + C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.01f, 0); #endif #if WIDESCREEN_SUPPORT From ce42f76aab77e619fdd41c30dd68ac67a3545481 Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Wed, 8 Apr 2026 18:50:57 -0400 Subject: [PATCH 09/10] Fix Action icons in Text boxes --- src/d/d_msg_scrn_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d/d_msg_scrn_item.cpp b/src/d/d_msg_scrn_item.cpp index 7cba6c7b86..40732eff25 100644 --- a/src/d/d_msg_scrn_item.cpp +++ b/src/d/d_msg_scrn_item.cpp @@ -411,7 +411,7 @@ void dMsgScrnItem_c::drawSelf() { f32 globalPosX = mpTm_c[0]->getGlobalPosX(); - #if WIDESCREEN_SUPPORT + #if WIDESCREEN_SUPPORT && !TARGET_PC if (mDoGph_gInf_c::isWide()) { drawOutFont(g_MsgObject_HIO_c.mBoxItemTextPosX + 7.0f + YREG_F(2), g_MsgObject_HIO_c.mBoxItemTextPosY, 1.0f); From b78e5c05b87fb8983898d48be305afa3ea6f170f Mon Sep 17 00:00:00 2001 From: TakaRikka Date: Thu, 9 Apr 2026 04:09:17 -0700 Subject: [PATCH 10/10] a little controller config ui cleanup --- extern/aurora | 2 +- src/dusk/imgui/ImGuiConsole.cpp | 7 ++-- src/dusk/imgui/ImGuiMenuGame.cpp | 62 +++++++++++++++----------------- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/extern/aurora b/extern/aurora index f5c5917832..b1bf531884 160000 --- a/extern/aurora +++ b/extern/aurora @@ -1 +1 @@ -Subproject commit f5c59178322c31b42676f49dd24e760e3b014f24 +Subproject commit b1bf531884172075dd97403edddc7d3301f4ca46 diff --git a/src/dusk/imgui/ImGuiConsole.cpp b/src/dusk/imgui/ImGuiConsole.cpp index 93b5b4a787..fa47e53da3 100644 --- a/src/dusk/imgui/ImGuiConsole.cpp +++ b/src/dusk/imgui/ImGuiConsole.cpp @@ -158,10 +158,13 @@ namespace dusk { auto itemMin = ImGui::GetItemRectMin(); auto itemMax = ImGui::GetItemRectMax(); + float frameSpacingY = 8.0f; + float frameBottomPadding = 10.0f; + ImVec2 halfFrame = ImVec2((frameHeight * 0.25f) * 0.5f, frameHeight * 0.5f); ImGui::GetWindowDrawList()->AddRect( - ImVec2(itemMin.x + halfFrame.x, itemMin.y + halfFrame.y), - ImVec2(itemMax.x - halfFrame.x, itemMax.y), + ImVec2(itemMin.x + halfFrame.x, itemMin.y + halfFrame.y + frameSpacingY), + ImVec2(itemMax.x - halfFrame.x, itemMax.y + frameBottomPadding), ImColor(ImGui::GetStyleColorVec4(ImGuiCol_Border)), halfFrame.x); diff --git a/src/dusk/imgui/ImGuiMenuGame.cpp b/src/dusk/imgui/ImGuiMenuGame.cpp index cbe26ba81c..8125583c8b 100644 --- a/src/dusk/imgui/ImGuiMenuGame.cpp +++ b/src/dusk/imgui/ImGuiMenuGame.cpp @@ -116,9 +116,9 @@ namespace dusk { static void drawVirtualStick(const char* id, const ImVec2& stick) { float scale = ImGuiScale(); - ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPos().x + 5 * scale, ImGui::GetCursorPos().y)); + ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPos().x + 45 * scale, ImGui::GetCursorPos().y + 10)); - ImGui::BeginChild(id, ImVec2(80 * scale, 80 * scale)); + ImGui::BeginChild(id, ImVec2(80 * scale, 80 * scale), 0, ImGuiWindowFlags_NoBackground); ImDrawList* dl = ImGui::GetWindowDrawList(); ImVec2 p = ImGui::GetCursorScreenPos(); @@ -222,6 +222,7 @@ namespace dusk { // controller selection combo box bool changedController = false; int changedControllerIndex = 0; + ImGui::SetNextItemWidth(400.0f * scale); if (ImGui::BeginCombo("##ControllerDeviceList", currentName.c_str())) { for (int i = 0; const auto& name : controllerList) { if (ImGui::Selectable(name.c_str(), currentName == name)) { @@ -300,7 +301,7 @@ namespace dusk { uint32_t axisCount; PADAxisMapping* axisMappingList = PADGetAxisMappings(m_controllerConfig.m_selectedPort, &axisCount); - ImGuiBeginGroupPanel("Triggers", ImVec2(150 * scale, 20 * scale)); + ImGuiBeginGroupPanel("Analog Triggers", ImVec2(150 * scale, 20 * scale)); PADAxis triggers[] = {PAD_AXIS_TRIGGER_L, PAD_AXIS_TRIGGER_R}; if (axisMappingList != nullptr) { @@ -334,11 +335,34 @@ namespace dusk { } } + int port = m_controllerConfig.m_selectedPort; + PADDeadZones* deadZones = PADGetDeadZones(port); + + if (deadZones != nullptr) { + ImGui::Text("L Threshold"); + ImGui::SameLine(); + { + float tmp = static_cast(deadZones->leftTriggerActivationZone * 100.f) / 32767.f; + if (ImGui::DragFloat("##LThreshold", &tmp, 0.5f, 0.f, 100.f, "%.3f%%")) { + deadZones->leftTriggerActivationZone = static_cast((tmp / 100.f) * 32767); + } + } + } + + if (deadZones != nullptr) { + ImGui::Text("R Threshold"); + ImGui::SameLine(); + { + float tmp = static_cast(deadZones->rightTriggerActivationZone * 100.f) / 32767.f; + if (ImGui::DragFloat("##RThreshold", &tmp, 0.5f, 0.f, 100.f, "%.3f%%")) { + deadZones->rightTriggerActivationZone = static_cast((tmp / 100.f) * 32767); + } + } + } + ImGuiEndGroupPanel(); ImGui::SameLine(); - int port = m_controllerConfig.m_selectedPort; - // main stick panel ImGuiBeginGroupPanel("Control Stick", ImVec2(150 * scale, 20 * scale)); @@ -388,8 +412,6 @@ namespace dusk { } } - PADDeadZones* deadZones = PADGetDeadZones(port); - if (deadZones != nullptr) { ImGui::Text("Dead Zone"); { @@ -465,32 +487,6 @@ namespace dusk { ImGuiEndGroupPanel(); ImGui::SameLine(); - // Triggers Panel - ImGuiBeginGroupPanel("Triggers", ImVec2(150 * scale, 20 * scale)); - - if (deadZones != nullptr) { - ImGui::Text("L Threshold"); - { - float tmp = static_cast(deadZones->leftTriggerActivationZone * 100.f) / 32767.f; - if (ImGui::DragFloat("##LThreshold", &tmp, 0.5f, 0.f, 100.f, "%.3f%%")) { - deadZones->leftTriggerActivationZone = static_cast((tmp / 100.f) * 32767); - } - } - } - - if (deadZones != nullptr) { - ImGui::Text("R Threshold"); - { - float tmp = static_cast(deadZones->rightTriggerActivationZone * 100.f) / 32767.f; - if (ImGui::DragFloat("##RThreshold", &tmp, 0.5f, 0.f, 100.f, "%.3f%%")) { - deadZones->rightTriggerActivationZone = static_cast((tmp / 100.f) * 32767); - } - } - } - - ImGuiEndGroupPanel(); - ImGui::SameLine(); - // Options panel ImGuiBeginGroupPanel("Options", ImVec2(150 * scale, 20 * scale));