Commit Graph

1582 Commits

Author SHA1 Message Date
David Racine 945f70222a Restore the realId assignment in AudioLoad_AsyncLoadInner (#7105)
The function declares realId and then indexes with it thirteen times -
the load-status tables, AudioLoad_SearchCaches, the table entry it reads
size and address from, every cache allocation, and the status write at the
end - but nothing assigns it. It has read an uninitialised local since
"Custom Sequences" (#2066) dropped the assignment in 2022.

Restoring the line puts back the value the rest of the function expects.
For SEQUENCE_TABLE and FONT_TABLE, AudioLoad_GetRealTableIndex returns the
id unchanged, so this is only a correctness fix in practice: the paths that
reach this function today go through the sequence script's async load
command, which is rare enough that the garbage index has not been tied to
any report.
2026-08-23 12:37:51 +00:00
djevangelia 5f52af7ef2 Enemy rando, make Keese not fall if not dead + fall downscale (#7101) 2026-08-22 19:30:14 +00:00
David Racine 27b71b1a54 Drop the seqLoadStatus bounds checks made redundant by #6932 (#7100)
#6917 guarded the three seqLoadStatus accessors against sequenceMapSize
because the array was allocated at exactly that size, so a custom sequence
id past it read and wrote off the end.

#6932 sized the array to sequenceMapSize + 0xF to match sequenceMap, which
covers the whole id space rather than rejecting the ids outside it, and also
protects the writers those guards never saw: AudioHeap_AllocCached and
AudioHeap_PopCache index seqLoadStatus directly.

The guards are now not just redundant but bounded wrong - they treat the ids
in [sequenceMapSize, sequenceMapSize + 0xF) as absent from a table that now
has room for them. Nothing breaks today because every entry starts at 5, so
AudioLoad_IsSeqLoadComplete answers true regardless and
AudioLoad_SetSeqLoadStatus already declines to overwrite a 5 - but once the
heap cache path moves such an entry off 5, the guard blocks an update that
should happen.

Reverting them restores the three functions to their decompiled form. The
sizing from #6932 and the id check in AudioLoad_SyncInitSeqPlayerInternal
remain the actual protection.
2026-08-22 14:19:04 +00:00
Philip Dubé 9baa114f6b Hookify fish, refactor fishsanity (#7091) 2026-08-18 14:36:30 +00:00
Philip Dubé bd8a5825f9 Hookify masks / timeless equipment (#7088) 2026-08-17 17:24:03 +00:00
David Racine 6a3c9b7604 Add a Skip Warp Cutscenes enhancement (#7059)
Warp song cutscenes were skipped for randomizer players whether they
wanted it or not: Demo_Kankyo cut the departure animation short from a
hardcoded IS_RANDO branch, and entrance rando cleared respawnFlag so the
arrival never played. There was no way to get the vanilla warp back, and
no way for a vanilla playthrough to skip it.

Drop both and put the behavior behind a Skip Warp Cutscenes toggle,
defaulting on in randomizer so existing rando warps are unchanged. It
kills the departure actor as it spawns and puts the arrival spawn mode
back to IDLE, which covers both halves of the warp.

Entrance rando's destination override moves off Demo_Kankyo's update onto
a new OnWarpSongLeave hook fired from Environment_WarpSongLeave. That is
where every warp path -- the cutscene, the skip toggle, and the spawn
failure fallback -- commits its destination, so the override no longer
depends on the departure actor being alive to see it, and a warp song
shuffled onto a grotto return keeps its grotto respawn.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 17:22:34 +00:00
djevangelia 3a8c68be66 Enemy rando, let enemies air walk over voidout floor in clear rooms (#7005)
Behind a setting

Add timed rooms + Fire Temple modifications
2026-08-17 13:08:13 +00:00
djevangelia 917a9b78d9 Enemy rando, fix healthy big Guays not dying (#7065) 2026-08-15 20:37:15 +00:00
Philip Dubé ca0a17cfe7 bombchu bowling setting: first item (#7070)
desirable for speedrun settings that want less variance. also use for moving rando logic into hooks
2026-08-14 22:24:03 +00:00
djevangelia e048afd10a Decomp, three audio functions (#7069) 2026-08-14 20:01:49 +00:00
djevangelia 7e9cf1eb1c Enemy rando, set EnTp EnSkb EnPeehat collider positions on actor init (#7049) 2026-08-10 01:10:40 +00:00
Philip Dubé f27ddede59 Fix mirror decal not rendering on some walls (#7052) 2026-08-09 22:01:31 +00:00
Pedro Nascimento 4e39d06acc fix(audio): bound audio-heap cache tables (SIGSEGV with large custom music packs) (#6932)
Root cause of three identical field crashes (audio thread, opcode fetch
through a pointer with its low 32 bits overwritten, seconds after scene
transitions): AudioHeap_AllocPermanent writes permanentCache[index] with
index = permanentPool.count and no bound against the 32-entry array. In
SoH every soundfont sync-load is forced permanent, and custom sequences
whose SEQ.xml says CachePolicy="Temporary" ALSO allocate permanently
(the factory stores the LUS enum where CACHE_TEMPORARY == 0, while
AudioLoad_SyncLoad's switch reads 0 with the ROM convention
'permanent'). A pack with ~60 streamed customs plus vanilla fonts pushes
count past 32 within a session, after which each allocation sprays a
{ptr, size, tableType/id} triplet at 24-byte stride through
gAudioContext - entry[135]'s ptr field lands exactly on
seqPlayers[0].scriptState.pc and entry[156] on seqPlayers[1]'s (both
verified against the crash-dump registers).

- permanentCache raised 32 -> 512 (12 KB) and AllocPermanent refuses
  allocations past the array instead of corrupting memory.
- Same unbounded-index disease fixed in the three sibling writers:
  AllocCached's persistent path (16-entry array; CACHE_EITHER degrades
  to temporary, hard persistent requests fail cleanly),
  AllocPersistentSampleCacheEntry, AllocTemporarySampleCacheEntry.
- seqLoadStatus malloc sized for the full id space (sequenceMapSize +
  0xF) matching sequenceMap; custom ids above sequenceMapSize previously
  overflowed the allocation by up to 15 bytes.

Upstream SoH bugs, not branch-introduced - this branch's many-track
packs merely made the overflow reachable in normal play. Standalone
upstreamable fix.
2026-08-09 18:36:33 +00:00
Philip Dubé bf7177256a FixFlexDrops (#7047) 2026-08-09 15:46:51 +00:00
Philip Dubé 5ecff16bdb Fix heap corruption due to skybox code using GameState as PlayState (#7045)
Also corrects clearing skybox context before Skybox_Setup
2026-08-09 01:05:15 +00:00
Pepper0ni 07944d785c Allow buying tunic as either age in rando even without shopsanity. (#7016) 2026-08-08 21:17:10 +00:00
Jameriquiah a4901abdc5 Hookify Skeleton Unregisters (#6988)
Co-authored-by: serprex <159546+serprex@users.noreply.github.com>
2026-08-08 21:16:10 +00:00
djevangelia f2f4413bff Decomp, some camera names (#7043) 2026-08-08 21:12:31 +00:00
djevangelia 982f598e01 Savestates, add sEffectContext (#7042) 2026-08-08 20:39:09 +00:00
djevangelia 5d1a396668 Polish, Twinrova intro cutscene skip with Kotake/Koume appear on climb (#7001) 2026-08-08 19:04:04 +00:00
djevangelia 6420c435b1 Enemy rando, fix Dark Link crush etc voidouts (#7038) 2026-08-08 17:59:23 +00:00
Philip Dubé 6706b49d1c Shuffle Treasure Chest Game (#7020) 2026-08-07 03:17:10 +00:00
djevangelia a089fa60ba Restoration, hover fishing condition + XZ speed (#7031) 2026-08-06 19:08:23 +00:00
Philip Dubé b76e303ceb Shuffle Silver (#5659)
Co-authored-by: Pepper0ni <93387759+Pepper0ni@users.noreply.github.com>
Co-authored-by: leggettc18 <chris@leggett.dev>
2026-08-06 01:51:59 +00:00
djevangelia 0ed782ddce Enhancement, drop throw-only actors toggle (#7023)
Co-authored-by: djevangelia <djevangelia>
2026-08-05 15:03:18 +00:00
David Racine 29c7e75688 Fix Gold Skulltula tokens overwriting the Bow inventory slot (#7021)
gItemSlots and sExtraItemBases only cover the item IDs that live in the
inventory, but Item_Give and Item_CheckObtainability index them with any
item ID. Reading past gItemSlots lands on gUpgradeShifts, so
INV_CONTENT(ITEM_SKULL_TOKEN) resolved to the Bow slot and stored the
token there, permanently corrupting the save.

Route both through a bounds-checked Item_GetSlot that reports SLOT_NONE
for items that have no slot, and skip the inventory store in that case.

That read is also undefined behaviour, which link-time optimization is
free to exploit: with it present clang dropped the ITEM_SKULL_TOKEN
branch and the ITEM_MEDALLION_WATER horse fixup from Item_Give
entirely, so tokens were never counted either.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 04:03:12 +00:00
Jordan Longstaff 2fd7e052cc Cleanup and fix Dampe's race both prizes regression (#6999) 2026-08-04 13:22:20 +00:00
David Racine eafafe507e fix: seqLoadStatus OOB reads/writes for custom SAF sequences (#6917)
Custom SAF sequence IDs can exceed sequenceMapSize, causing out-of-bounds
reads/writes on the seqLoadStatus byte array (sized exactly sequenceMapSize).

This is the direct cause of intermittent battle music failure with BGM packs
(issue #5706): on the second encounter, AudioLoad_SyncLoadSeq reads a garbage
value from heap memory past seqLoadStatus[] and may find 1 (loading in
progress), causing it to return NULL early — the sequence player is never
initialized and no battle music plays.

Symmetric fix to the fontLoadStatus guards in PR #6916:
- AudioLoad_IsSeqLoadComplete: return true for OOB seqIds (custom SAF
  sequences are resource-manager-backed, not in the async-load status table)
- AudioLoad_SetSeqLoadStatus: skip update for seqId >= sequenceMapSize
- AudioLoad_SyncLoadSeq: skip the in-progress check for OOB seqIds

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 21:05:07 +00:00
djevangelia 5a57a0cbc3 Decomp, naming (OnePointCS, itemAction, blure, wall/floor types) (#7007) 2026-07-31 16:56:30 +00:00
Jordan Longstaff 2c5762a0f2 [Enhancement] Dampe's Race awards both rewards at once (#6980) 2026-07-25 23:07:07 +00:00
Jordan Longstaff f9512bf446 Ingo Race: skip rematch (#6991) 2026-07-25 14:45:42 +00:00
Jordan Longstaff 2b35211956 [Enhancement] Award both prizes for high score in Horseback Archery (#6982) 2026-07-25 14:01:44 +00:00
Philip Dubé c4e92a70f4 Constant-size texture scroll display lists via G_SETTILESIZE_LERP (#6902)
Rewrite Gfx_TexScrollEx / Gfx_TwoTexScrollEx / Gfx_TwoTexScrollEnvColorEx to
emit one command per tile instead of one baked tile size per interpolated frame,
so texture DL memory no longer scales with InterpolationFPS
2026-07-24 18:35:24 +00:00
Jordan Longstaff 5af79defb6 Ingo Race Once: add option to skip both races (#6975) 2026-07-24 16:30:08 +00:00
Jordan Longstaff 9d1e5d2811 Hookify Lost Woods Ocarina game (#6976) 2026-07-24 16:28:36 +00:00
djevangelia 3c565ed6e6 Vanilla bugfix, allow fishing with blank B (#6826) 2026-07-24 16:24:56 +00:00
Philip Dubé 581af47419 Fix typos (#6978) 2026-07-24 15:19:36 +00:00
Philip Dubé da4e6dc332 Progressive Shuffle Open Chest (#6971) 2026-07-23 23:35:41 +00:00
Jordan Longstaff cca66cdc5d Hookify Shooting Gallery options (#6972) 2026-07-23 23:33:50 +00:00
Jordan Longstaff 5c55c01c68 Hookify frogs' Ocarina game (#6969) 2026-07-23 21:48:46 +00:00
Jordan Longstaff 35dcba5944 [Enhancement] Ingo Race Once (#6965) 2026-07-23 05:33:04 +00:00
Jordan Longstaff 236c9c81f5 Hookify Bombchu Bowling options (#6968)
Cuccos get destroyed when options turned on
2026-07-23 03:56:43 +00:00
djevangelia fb657cc5d5 Savestates, more AudioOcarina serialization (#6954) 2026-07-22 13:48:10 +00:00
Philip Dubé d62c5879aa Fix problems with Zelda's Letter & Weird Egg hatching (#6962) 2026-07-22 12:24:31 +00:00
djevangelia 6f14e7b162 Restoration, fix Japanese subtitle + MQ logo (#6953) 2026-07-22 10:21:32 +00:00
Philip Dubé 1ea7206073 Shuffle Zelda's Letter (#6938)
Removes RSK_SKIP_CHILD_ZELDA & RSK_KAK_GATE,
these are managed by RSK_SHUFFLE_ZELDAS_LETTER & RSK_STARTING_ZELDAS_LETTER & RSK_SHUFFLE_WEIRD_EGG
2026-07-19 22:37:45 +00:00
djevangelia 2c9187f27a Bugfix, make CC invisible Link equips invisible (#6926) 2026-07-19 20:52:22 +00:00
djevangelia e579e7b9a4 Polishing, climb everything door opening + sloped ledge climb up (#6936)
Allow player to try opening doors while climbing. Player can't open anything if a door doesn't offer it, so it's ok to try. Handle doors don't change player y position (player walks in the air), so manually lower it.
    Increase y height limit for doors to offer open from 15.0f/20.0f to 50.0f (normal door height). (For shutter doors height could be individualized depending on shutter door type in the future.)
    Make climbing up animation play even for sloped ledges. The animation/action breaks because game thinks player is not on ground. So, at the end of Player_ProcessSceneCollision, if player is in climbing up action, manually set BGCHECKFLAG_GROUND.
2026-07-19 17:04:32 +00:00
Christopher Leggett 8cb0c74592 Better Save Menu: Ability to Reset to Spawn from anywhere (#6937)
Adds an option for a Better Save Menu that, after saving, allows you to effectively soft-reset the current save (either return to spawn or reset to the dungeon entrance), and additionally lets you reset to spawn specifcally, even if you are in a dungeon. This allows for escaping from the rare entrance-rando related softlock that can happen.
2026-07-19 17:01:50 +00:00
djevangelia 29d4ff4205 Decomp, update AudioOcarina (code_800EC960.c) (#6941) 2026-07-19 16:54:43 +00:00