From 4f3e5cc5b5069f6d1f718ae90112120fa2db0ccc Mon Sep 17 00:00:00 2001
From: "LT_Schmiddy (Alex Schmid)"
- This option also enables right stick control while looking and aiming.
+ This option also enables right stick control while looking and aiming, and an additional option will allow you to move while aiming.
Inverts the camera controls for the analog camera if it's enabled. None is the default.
diff --git a/include/zelda_config.h b/include/zelda_config.h
index 59b41f0..d0991a4 100644
--- a/include/zelda_config.h
+++ b/include/zelda_config.h
@@ -73,11 +73,13 @@ namespace zelda64 {
enum class AnalogCamMode {
On,
Off,
+ MoveInFirstPerson,
OptionCount
};
NLOHMANN_JSON_SERIALIZE_ENUM(zelda64::AnalogCamMode, {
{zelda64::AnalogCamMode::On, "On"},
+ {zelda64::AnalogCamMode::MoveInFirstPerson, "MoveInFirstPerson"},
{zelda64::AnalogCamMode::Off, "Off"}
});
diff --git a/patches/input.c b/patches/input.c
index 67b3998..a92f1bd 100644
--- a/patches/input.c
+++ b/patches/input.c
@@ -15,7 +15,13 @@ s16 func_80832754(Player* this, s32 arg1);
s32 func_8082EF20(Player* this);
bool recomp_first_person_movement_allowed(PlayState* play, Player* this, bool in_free_look) {
- return play->unk_1887C == 0 && (in_free_look || this->currentMask != PLAYER_MASK_ZORA);
+ return recomp_move_in_first_person_enabled()
+ //return recomp_analog_cam_enabled()
+ && play->unk_1887C == 0
+ && (
+ in_free_look
+ || this->currentMask != PLAYER_MASK_ZORA
+ );
}
void recomp_handle_first_person_movement(PlayState* play, Player* this, s32 arg2) {
diff --git a/patches/input.h b/patches/input.h
index 0f00e36..4b92e47 100644
--- a/patches/input.h
+++ b/patches/input.h
@@ -15,6 +15,7 @@ DECLARE_FUNC(void, recomp_get_mouse_deltas, float* x, float* y);
DECLARE_FUNC(s32, recomp_get_targeting_mode);
DECLARE_FUNC(void, recomp_get_inverted_axes, s32* x, s32* y);
DECLARE_FUNC(s32, recomp_analog_cam_enabled);
+DECLARE_FUNC(s32, recomp_move_in_first_person_enabled);
DECLARE_FUNC(void, recomp_get_analog_inverted_axes, s32* x, s32* y);
DECLARE_FUNC(void, recomp_get_camera_inputs, float* x, float* y);
DECLARE_FUNC(void, recomp_set_right_analog_suppressed, s32 suppressed);
diff --git a/patches/syms.ld b/patches/syms.ld
index a0e5d7d..c0844d5 100644
--- a/patches/syms.ld
+++ b/patches/syms.ld
@@ -44,3 +44,4 @@ recomp_get_inverted_axes = 0x8F0000A4;
recomp_high_precision_fb_enabled = 0x8F0000A8;
recomp_get_resolution_scale = 0x8F0000AC;
recomp_get_analog_inverted_axes = 0x8F0000B0;
+recomp_move_in_first_person_enabled = 0x8F0000B4;
diff --git a/src/game/recomp_api.cpp b/src/game/recomp_api.cpp
index 28b4779..21e6b2b 100644
--- a/src/game/recomp_api.cpp
+++ b/src/game/recomp_api.cpp
@@ -132,7 +132,12 @@ extern "C" void recomp_get_analog_inverted_axes(uint8_t* rdram, recomp_context*
}
extern "C" void recomp_analog_cam_enabled(uint8_t* rdram, recomp_context* ctx) {
- _return