Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ hooks/
*.n64
*.v64
*.wad
*.iso

# Windows image file caches
Thumbs.db
Expand Down
1 change: 1 addition & 0 deletions genhooks
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ asmgsc "$sym_z64_metronome_check_2" "jal $sym_metronome_check_hook;"
asmgsc "$sym_z64_metronome_check_3" "jal $sym_metronome_check_hook;"
asmgsc "$sym_z64_metronome_check_4" "jal $sym_metronome_check_hook;"
asmgsc "$sym_z64_bombchu_floor_poly_hook" "jal $sym_bombchu_floor_poly_hook;"
asmgsc "$sym_Health_UpdateBeatingHeart_hook" "jal $sym_beep_hook;"
3 changes: 3 additions & 0 deletions lib/liboot-1.0.a
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,6 @@ z64_metronome_check_3 = ovl_En_Skj + 0x2A3C ;
z64_metronome_check_4 = ovl_En_Skj + 0x2AC4 ;
ovl_En_Bom_Chu = 0x809CE9F0 ;
z64_bombchu_floor_poly_hook = ovl_En_Bom_Chu + 0x654 ;
Health_UpdateBeatingHeart = 0x80065A14 ;
Health_UpdateBeatingHeart_hook = Health_UpdateBeatingHeart + 0xA0 ;
Sfx_PlaySfxCentered = 0x800646F0 ;
3 changes: 3 additions & 0 deletions lib/liboot-1.1.a
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,6 @@ z64_metronome_check_3 = ovl_En_Skj + 0x2A3C ;
z64_metronome_check_4 = ovl_En_Skj + 0x2AC4 ;
ovl_En_Bom_Chu = 0x809CEB40 ;
z64_bombchu_floor_poly_hook = ovl_En_Bom_Chu + 0x654 ;
Health_UpdateBeatingHeart = 0x80065A14 ;
Health_UpdateBeatingHeart_hook = Health_UpdateBeatingHeart + 0xA0 ;
Sfx_PlaySfxCentered = 0x800646F0 ;
3 changes: 3 additions & 0 deletions lib/liboot-1.2.a
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,6 @@ z64_metronome_check_3 = ovl_En_Skj + 0x2A3C ;
z64_metronome_check_4 = ovl_En_Skj + 0x2AC4 ;
ovl_En_Bom_Chu = 0x809CEDC0 ;
z64_bombchu_floor_poly_hook = ovl_En_Bom_Chu + 0x654 ;
Health_UpdateBeatingHeart = 0x800660D4 ;
Health_UpdateBeatingHeart_hook = Health_UpdateBeatingHeart + 0xA0 ;
Sfx_PlaySfxCentered = 0x80064DB0 ;
3 changes: 3 additions & 0 deletions lib/liboot-ce-j.a
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,6 @@ z64_metronome_check_3 = ovl_En_Skj + 0x2A3C ;
z64_metronome_check_4 = ovl_En_Skj + 0x2AC4 ;
ovl_En_Bom_Chu = 0x809B3280 ;
z64_bombchu_floor_poly_hook = ovl_En_Bom_Chu + 0x654 ;
Health_UpdateBeatingHeart = 0x800656B0 ;
Health_UpdateBeatingHeart_hook = Health_UpdateBeatingHeart + 0xA0 ;
Sfx_PlaySfxCentered = 0x80064390 ;
3 changes: 3 additions & 0 deletions lib/liboot-gc-j.a
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,6 @@ z64_metronome_check_3 = ovl_En_Skj + 0x2A3C ;
z64_metronome_check_4 = ovl_En_Skj + 0x2AC4 ;
ovl_En_Bom_Chu = 0x809B32B0 ;
z64_bombchu_floor_poly_hook = ovl_En_Bom_Chu + 0x654 ;
Health_UpdateBeatingHeart = 0x800656D0 ;
Health_UpdateBeatingHeart_hook = Health_UpdateBeatingHeart + 0xA0 ;
Sfx_PlaySfxCentered = 0x800643B0 ;
3 changes: 3 additions & 0 deletions lib/liboot-gc-u.a
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,6 @@ z64_metronome_check_3 = ovl_En_Skj + 0x2A3C ;
z64_metronome_check_4 = ovl_En_Skj + 0x2AC4 ;
ovl_En_Bom_Chu = 0x809B3290 ;
z64_bombchu_floor_poly_hook = ovl_En_Bom_Chu + 0x654 ;
Health_UpdateBeatingHeart = 0x800656B0 ;
Health_UpdateBeatingHeart_hook = Health_UpdateBeatingHeart + 0xA0 ;
Sfx_PlaySfxCentered = 0x80064390 ;
3 changes: 3 additions & 0 deletions lib/liboot-ique-cn.a
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,6 @@ z64_metronome_check_3 = ovl_En_Skj + 0x2A3C ;
z64_metronome_check_4 = ovl_En_Skj + 0x2AC4 ;
ovl_En_Bom_Chu = 0x809CFA90 ;
z64_bombchu_floor_poly_hook = ovl_En_Bom_Chu + 0x654 ;
Health_UpdateBeatingHeart = 0x8006C570 ;
Health_UpdateBeatingHeart_hook = Health_UpdateBeatingHeart + 0xA0 ;
Sfx_PlaySfxCentered = 0x8006B250 ;
3 changes: 3 additions & 0 deletions lib/liboot-mq-j.a
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,6 @@ z64_metronome_check_3 = ovl_En_Skj + 0x2A3C ;
z64_metronome_check_4 = ovl_En_Skj + 0x2AC4 ;
ovl_En_Bom_Chu = 0x809B3230 ;
z64_bombchu_floor_poly_hook = ovl_En_Bom_Chu + 0x654 ;
Health_UpdateBeatingHeart = 0x800656D0 ;
Health_UpdateBeatingHeart_hook = Health_UpdateBeatingHeart + 0xA0 ;
Sfx_PlaySfxCentered = 0x800643B0 ;
3 changes: 3 additions & 0 deletions lib/liboot-mq-u.a
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,6 @@ z64_metronome_check_3 = ovl_En_Skj + 0x2A3C ;
z64_metronome_check_4 = ovl_En_Skj + 0x2AC4 ;
ovl_En_Bom_Chu = 0x809B3210 ;
z64_bombchu_floor_poly_hook = ovl_En_Bom_Chu + 0x654 ;
Health_UpdateBeatingHeart = 0x800656B0 ;
Health_UpdateBeatingHeart_hook = Health_UpdateBeatingHeart + 0xA0 ;
Sfx_PlaySfxCentered = 0x80064390 ;
14 changes: 14 additions & 0 deletions src/gz/gz.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ static void main_hook(void)
if (settings->cheats & (1 << CHEAT_NOHUD))
z64_file.hud_flag = 0x001;

settings->bits.disable_health_beep = settings->cheats & (1 << CHEAT_NOHEALTHBEEP) ? 1 : 0;

/* handle commands */
for (int i = 0; i < COMMAND_MAX; ++i) {
_Bool active = 0;
Expand Down Expand Up @@ -1088,6 +1090,18 @@ HOOK void bombchu_floor_poly_hook(z64_game_t *game, z64_actor_t *actor,
}
}

extern void Sfx_PlaySfxCentered(uint16_t sfxId);

/**
* Replaces call to Sfx_PlaySfxCentered in Health_UpdateBeatingHeart to
* allow the low-health sound to play if the cheat is disabled.
*/
HOOK void beep_hook(uint16_t sfxId) {
if (!settings->bits.disable_health_beep) {
Sfx_PlaySfxCentered(sfxId);
}
}

static void main_return_proc(struct menu_item *item, void *data)
{
gz_hide_menu();
Expand Down
1 change: 1 addition & 0 deletions src/gz/gz_cheats.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static const char *cheat_names[] =
"isg",
"quick text",
"no hud",
"no health beep",
};

static int cheat_proc(struct menu_item *item,
Expand Down
2 changes: 2 additions & 0 deletions src/gz/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ enum cheats
CHEAT_ISG,
CHEAT_QUICKTEXT,
CHEAT_NOHUD,
CHEAT_NOHEALTHBEEP,
CHEAT_MAX,
};

Expand Down Expand Up @@ -139,6 +140,7 @@ struct settings_bits
uint32_t watches_visible : 1;
uint32_t gc_oob_chu : 1;
uint32_t ignore_state_rng : 1;
uint32_t disable_health_beep : 1;
};

struct settings_data
Expand Down