shithub: zelda3

Download patch

ref: 6741153a8cf32a967c3873e7279832406079a7af
parent: 9bcfd5b9b434c956f027433d11877dd8b2686ee2
author: Snesrev <snesrev@protonmail.com>
date: Tue Sep 20 21:26:41 EDT 2022

Disable the low health beep

--- a/config.c
+++ b/config.c
@@ -288,6 +288,9 @@
     } else if (StringEqualsNoCase(key, "BreakPotsWithSword")) {
       g_config.break_pots_with_sword = (bool)strtol(value, (char **)NULL, 10);
       return true;
+    } else if (StringEqualsNoCase(key, "DisableLowHealthBeep")) {
+      g_config.disable_low_health_beep = (bool)strtol(value, (char **)NULL, 10);
+      return true;
     }
   }
   return false;
--- a/config.h
+++ b/config.h
@@ -52,6 +52,7 @@
   bool mirror_to_darkworld;
   bool collect_items_with_sword;
   bool break_pots_with_sword;
+  bool disable_low_health_beep;
 } Config;
 
 extern Config g_config;
--- a/hud.c
+++ b/hud.c
@@ -406,7 +406,8 @@
     if (link_lowlife_countdown_timer_beep) {
       link_lowlife_countdown_timer_beep--;
     } else if (!sound_effect_1) {
-      sound_effect_1 = 43;
+      if (!(enhanced_features0 & kFeatures0_DisableLowHealthBeep))
+        sound_effect_1 = 43;
       link_lowlife_countdown_timer_beep = 32 - 1;
     }
   }
--- a/main.c
+++ b/main.c
@@ -192,6 +192,7 @@
     f |= g_config.mirror_to_darkworld * kFeatures0_MirrorToDarkworld;
     f |= g_config.collect_items_with_sword * kFeatures0_CollectItemsWithSword;
     f |= g_config.break_pots_with_sword * kFeatures0_BreakPotsWithSword;
+    f |= g_config.disable_low_health_beep * kFeatures0_DisableLowHealthBeep;
     g_wanted_zelda_features = f;
   }
 
--- a/zelda3.ini
+++ b/zelda3.ini
@@ -51,6 +51,9 @@
 # Level 2-4 sword can be used to break pots
 BreakPotsWithSword = 0
 
+# Disable the low health beep
+DisableLowHealthBeep = 0
+
 
 [KeyMap]
 # Change what keyboard keys map to the joypad
--- a/zelda_rtl.h
+++ b/zelda_rtl.h
@@ -120,7 +120,7 @@
   kFeatures0_MirrorToDarkworld = 8,
   kFeatures0_CollectItemsWithSword = 16,
   kFeatures0_BreakPotsWithSword = 32,
-
+  kFeatures0_DisableLowHealthBeep = 64,
 };
 
 #define enhanced_features0 (*(uint32*)(g_ram+0x64c))