diff --git a/assets/config_menu/general.rml b/assets/config_menu/general.rml index 291bf8c..6fac11c 100644 --- a/assets/config_menu/general.rml +++ b/assets/config_menu/general.rml @@ -5,7 +5,7 @@
diff --git a/include/zelda_config.h b/include/zelda_config.h index 59b41f0..98b3ab7 100644 --- a/include/zelda_config.h +++ b/include/zelda_config.h @@ -35,6 +35,9 @@ namespace zelda64 { {zelda64::AutosaveMode::Off, "Off"} }); + AutosaveMode get_autosave_mode(); + void set_autosave_mode(AutosaveMode mode); + enum class TargetingMode { Switch, Hold, @@ -81,12 +84,23 @@ namespace zelda64 { {zelda64::AnalogCamMode::Off, "Off"} }); - AutosaveMode get_autosave_mode(); - void set_autosave_mode(AutosaveMode mode); - AnalogCamMode get_analog_cam_mode(); void set_analog_cam_mode(AnalogCamMode mode); + enum class SpecialItemHudMode { + On, + Off, + OptionCount + }; + + NLOHMANN_JSON_SERIALIZE_ENUM(zelda64::SpecialItemHudMode, { + {zelda64::SpecialItemHudMode::On, "On"}, + {zelda64::SpecialItemHudMode::Off, "Off"} + }); + + SpecialItemHudMode get_special_item_hud_mode(); + void set_special_item_hud_mode(SpecialItemHudMode mode); + void open_quit_game_prompt(); }; diff --git a/patches/patches.h b/patches/patches.h index f0f2b5e..701c848 100644 --- a/patches/patches.h +++ b/patches/patches.h @@ -27,6 +27,7 @@ #define gRandFloat sRandFloat #include "global.h" #include "rt64_extended_gbi.h" +#include "patch_helpers.h" #ifndef gEXFillRectangle #define gEXFillRectangle(cmd, lorigin, rorigin, ulx, uly, lrx, lry) \ @@ -101,4 +102,6 @@ void draw_autosave_icon(PlayState* play); void recomp_crash(const char* err); +DECLARE_FUNC(s32, recomp_special_item_hud_enabled); + #endif diff --git a/patches/syms.ld b/patches/syms.ld index a0e5d7d..70325e8 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_special_item_hud_enabled = 0x8F0000B4; diff --git a/patches/ui_patches.c b/patches/ui_patches.c index a057655..fdc83b7 100644 --- a/patches/ui_patches.c +++ b/patches/ui_patches.c @@ -488,8 +488,10 @@ RECOMP_PATCH void Interface_Draw(PlayState* play) { // @recomp Draw the D-Pad and its item icons as well as the autosave icon if the game is unpaused. if (pauseCtx->state != PAUSE_STATE_MAIN) { - draw_dpad(play); - draw_dpad_icons(play); + if (recomp_special_item_hud_enabled()) { + draw_dpad(play); + draw_dpad_icons(play); + } draw_autosave_icon(play); } diff --git a/src/game/config.cpp b/src/game/config.cpp index ac8ebff..930d2a4 100644 --- a/src/game/config.cpp +++ b/src/game/config.cpp @@ -219,6 +219,7 @@ bool save_general_config(const std::filesystem::path& path) { config_json["autosave_mode"] = zelda64::get_autosave_mode(); config_json["camera_invert_mode"] = zelda64::get_camera_invert_mode(); config_json["analog_cam_mode"] = zelda64::get_analog_cam_mode(); + config_json["special_item_hud_mode"] = zelda64::get_special_item_hud_mode(); config_json["analog_camera_invert_mode"] = zelda64::get_analog_camera_invert_mode(); config_json["debug_mode"] = zelda64::get_debug_mode_enabled(); @@ -235,6 +236,7 @@ void set_general_settings_from_json(const nlohmann::json& config_json) { zelda64::set_autosave_mode(from_or_default(config_json, "autosave_mode", zelda64::AutosaveMode::On)); zelda64::set_camera_invert_mode(from_or_default(config_json, "camera_invert_mode", zelda64::CameraInvertMode::InvertY)); zelda64::set_analog_cam_mode(from_or_default(config_json, "analog_cam_mode", zelda64::AnalogCamMode::Off)); + zelda64::set_special_item_hud_mode(from_or_default(config_json, "special_item_hud_mode", zelda64::SpecialItemHudMode::On)); zelda64::set_analog_camera_invert_mode(from_or_default(config_json, "analog_camera_invert_mode", zelda64::CameraInvertMode::InvertNone)); zelda64::set_debug_mode_enabled(from_or_default(config_json, "debug_mode", false)); } diff --git a/src/game/recomp_api.cpp b/src/game/recomp_api.cpp index 28b4779..582321e 100644 --- a/src/game/recomp_api.cpp +++ b/src/game/recomp_api.cpp @@ -135,6 +135,10 @@ extern "C" void recomp_analog_cam_enabled(uint8_t* rdram, recomp_context* ctx) { _return