Various mirror mode fixes (#1725)

* Fix mirror mode stage map scrolling

* Fix Link's arrow rotation on fullscreen map

* Fix fishing in mirror mode

* Fix cucco controls in mirror mode

* Only stick_x is necessary

---------

Co-authored-by: TakaRikka <38417346+TakaRikka@users.noreply.github.com>
Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
Irastris
2026-05-24 14:31:04 -04:00
committed by GitHub
parent 8668474a33
commit 78e1a05aef
4 changed files with 59 additions and 7 deletions
+36 -7
View File
@@ -25,7 +25,10 @@
#include <cmath>
#include <cstring>
#if TARGET_PC
#include "dusk/settings.h"
#include "dusk/version.hpp"
#endif
class dmg_rod_HIO_c : public JORReflexible {
public:
@@ -1137,8 +1140,14 @@ static int lure_standby(dmg_rod_class* i_this) {
dComIfGp_setDoStatusForce(42, 0);
}
i_this->rod_stick_x = mDoCPd_c::getStickX3D(PAD_1) * mDoCPd_c::getStickX3D(PAD_1);
if (mDoCPd_c::getStickX3D(PAD_1) < 0.0f) {
f32 stick_x = mDoCPd_c::getStickX3D(PAD_1);
#if TARGET_PC
if (dusk::getSettings().game.enableMirrorMode) {
stick_x = -stick_x;
}
#endif
i_this->rod_stick_x = stick_x * stick_x;
if (stick_x < 0.0f) {
i_this->rod_stick_x *= -1.0f;
}
@@ -3671,7 +3680,13 @@ static void uki_standby(dmg_rod_class* i_this) {
cLib_addCalc2(&i_this->field_0x150c, substickX, 0.5f, 0.2f);
if (i_this->field_0x1508 > 0.3f && i_this->play_cam_mode < 5) {
ANGLE_ADD(i_this->field_0x1418, (-500.0f + VREG_F(3)) * mDoCPd_c::getStickX3D(PAD_1));
f32 stick_x = mDoCPd_c::getStickX3D(PAD_1);
#if TARGET_PC
if (dusk::getSettings().game.enableMirrorMode) {
stick_x = -stick_x;
}
#endif
ANGLE_ADD(i_this->field_0x1418, (-500.0f + VREG_F(3)) * stick_x);
}
cMtx_YrotS(*calc_mtx, i_this->field_0x1418);
@@ -5043,8 +5058,15 @@ static void play_camera(dmg_rod_class* i_this) {
static f32 old_stick_x = 0.0f;
static f32 old_stick_sx = 0.0f;
f32 stick_x = mDoCPd_c::getStickX3D(PAD_1);
#if TARGET_PC
if (dusk::getSettings().game.enableMirrorMode) {
stick_x = -stick_x;
}
#endif
if (
(mDoCPd_c::getStickX3D(PAD_1) >= 0.8f && old_stick_x < 0.8f) || (mDoCPd_c::getStickX3D(PAD_1) <= -0.8f && old_stick_x > -0.8f)
(stick_x >= 0.8f && old_stick_x < 0.8f) || (stick_x <= -0.8f && old_stick_x > -0.8f)
#if VERSION != VERSION_SHIELD_DEBUG
|| (mDoCPd_c::getSubStickX3D(PAD_1) >= 0.8f && old_stick_sx < 0.8f) || (mDoCPd_c::getSubStickX3D(PAD_1) <= -0.8f && old_stick_sx > -0.8f)
#endif
@@ -5060,7 +5082,7 @@ static void play_camera(dmg_rod_class* i_this) {
}
if (i_this->play_cam_timer >= 15) {
if (mDoCPd_c::getStickX3D(PAD_1) >= 0.5f
if (stick_x >= 0.5f
#if VERSION != VERSION_SHIELD_DEBUG
|| mDoCPd_c::getSubStickX3D(PAD_1) >= 0.5f
#endif
@@ -5082,8 +5104,8 @@ static void play_camera(dmg_rod_class* i_this) {
}
}
old_stick_x = mDoCPd_c::getStickX3D(PAD_1);
old_stick_sx = mDoCPd_c::getSubStickX(PAD_1);
old_stick_x = stick_x;
old_stick_sx = mDoCPd_c::getSubStickX3D(PAD_1);
if (i_this->play_cam_timer == 1) {
if (i_this->field_0xf81 == 0) {
@@ -5788,7 +5810,14 @@ static int dmg_rod_Execute(dmg_rod_class* i_this) {
i_this->rod_stick_x = mDoCPd_c::getStickX3D(PAD_1);
i_this->rod_stick_y = mDoCPd_c::getStickY(PAD_1);
#if TARGET_PC
if (dusk::getSettings().game.enableMirrorMode) {
i_this->rod_stick_x = -i_this->rod_stick_x;
}
i_this->rod_substick_x = mDoCPd_c::getSubStickX3D(PAD_1);
#else
i_this->rod_substick_x = mDoCPd_c::getSubStickX(PAD_1);
#endif
i_this->prev_rod_substick_y = i_this->rod_substick_y;
i_this->rod_substick_y = mDoCPd_c::getSubStickY(PAD_1);
+5
View File
@@ -943,6 +943,11 @@ static int ni_play(ni_class* i_this) {
s16 var_r28 = 0x4000;
i_this->mPadMainStickX = mDoCPd_c::getStickX3D(PAD_1);
#if TARGET_PC
if (dusk::getSettings().game.enableMirrorMode) {
i_this->mPadMainStickX = -i_this->mPadMainStickX;
}
#endif
i_this->mPadMainStickY = mDoCPd_c::getStickY(PAD_1);
i_this->mPadSubStickY = mDoCPd_c::getSubStickY(PAD_1);
i_this->mPadSubStickX = mDoCPd_c::getSubStickX(PAD_1);
+5
View File
@@ -1973,6 +1973,11 @@ void dMenu_Fmap2DBack_c::stageMapMove(STControl* i_stick, u8 param_1, bool param
if (stick_value >= slow_bound && param_2 && field_0x1238 != 2) {
bVar6 = true;
s16 angle = i_stick->getAngleStick();
#if TARGET_PC
if (dusk::getSettings().game.enableMirrorMode) {
angle = -angle;
}
#endif
f32 local_68 = mTexMaxX - mTexMinX;
f32 spot_zoom = getSpotMapZoomRate();
f32 region_zoom = getRegionMapZoomRate(mRegionCursor);
+13
View File
@@ -394,8 +394,21 @@ void dMenuMapCommon_c::drawIcon(f32 i_posX, f32 i_posY, f32 param_3, f32 param_4
icon_size_y *= _c7c;
}
#if TARGET_PC
f32 rotation = mIconInfo[info_idx].rotation;
if (dusk::getSettings().game.enableMirrorMode &&
(mIconInfo[info_idx].icon_no == ICON_LINK_e ||
mIconInfo[info_idx].icon_no == ICON_LINK_ENTER_e))
{
rotation = -rotation;
}
mPictures[mIconInfo[info_idx].icon_no]->rotate(icon_size_x / 2, icon_size_y / 2, ROTATE_Z,
rotation);
#else
mPictures[mIconInfo[info_idx].icon_no]->rotate(icon_size_x / 2, icon_size_y / 2, ROTATE_Z,
mIconInfo[info_idx].rotation);
#endif
if (mIconInfo[info_idx].icon_no == ICON_LIGHT_DROP_e) {
mPictures[mIconInfo[info_idx].icon_no]->setAlpha((180.0f * _c80) / 255.0f);