Add menu option for moving in first person.

This commit is contained in:
LT_Schmiddy (Alex Schmid) 2024-11-16 20:17:54 -05:00
parent 2bc4a1e77f
commit 4f3e5cc5b5
6 changed files with 30 additions and 3 deletions

View file

@ -242,6 +242,18 @@
/>
<label class="config-option__tab-label" for="analog_cam_enabled">On</label>
<input
type="radio"
data-event-blur="set_cur_config_index(-1)"
data-event-focus="set_cur_config_index(8)"
name="analog_cam_mode"
data-checked="analog_cam_mode"
value="MoveInFirstPerson"
id="analog_cam_fpm"
style="nav-up: #camera_inversion_x; nav-down: #analog_camera_inversion_x"
/>
<label class="config-option__tab-label" for="analog_cam_fpm">On - Move In First Person</label>
<input
type="radio"
data-event-blur="set_cur_config_index(-1)"
@ -357,7 +369,7 @@
When you move the right stick, the camera will enter free mode and stop centering behind Link. Press the <b>Target</b> button at any time to go back into the normal camera mode. The camera will also return to normal mode after a cutscene plays or when you move between areas.
<br/>
<br/>
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.
</p>
<p data-if="cur_config_index == 9">
Inverts the camera controls for the analog camera if it's enabled. <b>None</b> is the default.

View file

@ -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"}
});

View file

@ -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) {

View file

@ -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);

View file

@ -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;

View file

@ -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<s32>(ctx, zelda64::get_analog_cam_mode() == zelda64::AnalogCamMode::On);
_return<s32>(ctx, zelda64::get_analog_cam_mode() == zelda64::AnalogCamMode::On
|| zelda64::get_analog_cam_mode() == zelda64::AnalogCamMode::MoveInFirstPerson);
}
extern "C" void recomp_move_in_first_person_enabled(uint8_t* rdram, recomp_context* ctx) {
_return<s32>(ctx, zelda64::get_analog_cam_mode() == zelda64::AnalogCamMode::MoveInFirstPerson);
}
extern "C" void recomp_get_camera_inputs(uint8_t* rdram, recomp_context* ctx) {