Skip to content

Improve decompiled symbol names for ocarina interactions - #6967

Closed
bassdr wants to merge 1 commit into
HarbourMasters:developfrom
bassdr:docs/ocarina-decomp-symbols
Closed

Improve decompiled symbol names for ocarina interactions#6967
bassdr wants to merge 1 commit into
HarbourMasters:developfrom
bassdr:docs/ocarina-decomp-symbols

Conversation

@bassdr

@bassdr bassdr commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What

Renames raw func_ADDRESS / unk_ symbols involved in ocarina interactions to descriptive names. No behavior change - pure documentation.

Shared message helpers

  • func_8010BD58 -> Message_StartOcarinaWithSongEffect
  • func_8010BD88 -> Message_StartOcarinaNoSongEffect
  • MessageContext.unk_E40E -> disableSongEffect
  • Player.unk_6A8 -> ocarinaTargetActor

Per-actor ocarina handlers

  • En_Okarina_Tag: WaitForPlayer / WaitForOcarina / WaitForPlaybackResult / HandleSongEvent / OfferTalk / WaitForDialogue; EnOkarinaTag.unk_158 -> success
  • En_Box: EnBox_WaitForOcarina
  • En_Du (Darunia): EnDu_WaitForOcarina / EnDu_ListenToOcarina
  • Obj_Warp2block: PlayerIsInRange / WaitForOcarina / WaitForSong / UpdateSongObserver, songObserverFunc + songEndTimer fields (mirrors its Obj_Timeblock sibling)

Why

These names were reverse-engineered while working on ocarina-related features; splitting the naming out as a standalone, behavior-neutral change to keep functional PRs readable.

Testing

Builds clean; no functional changes.

Build Artifacts

Rename the shared ocarina message helpers and the per-actor ocarina
wait/listen handlers from raw func_ADDRESS / unk_ names to descriptive
ones. No behavior change.

- Message_StartOcarinaWithSongEffect / Message_StartOcarinaNoSongEffect
  (func_8010BD58 / func_8010BD88)
- MessageContext.disableSongEffect (unk_E40E)
- Player.ocarinaTargetActor (unk_6A8)
- En_Okarina_Tag: WaitForPlayer / WaitForOcarina / WaitForPlaybackResult
  / HandleSongEvent / OfferTalk / WaitForDialogue; EnOkarinaTag.success
- En_Box: EnBox_WaitForOcarina
- En_Du: EnDu_WaitForOcarina / EnDu_ListenToOcarina
- Obj_Warp2block: PlayerIsInRange / WaitForOcarina / WaitForSong /
  UpdateSongObserver, songObserverFunc + songEndTimer fields (mirrors
  its Obj_Timeblock sibling)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread soh/include/z64.h
/* 0xE408 */ Actor* talkActor;
/* 0xE40C */ s16 disableWarpSongs; // warp song flag set by scene commands
/* 0xE40E */ s16 unk_E40E; // ocarina related
/* 0xE40E */ s16 disableSongEffect; // ocarina related

@serprex serprex Jul 23, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be striving to match decomp, for example they named this field disableSunsSong

where they haven't made a rename there should be an upstream PR at least proposing the renames there

@djevangelia

Copy link
Copy Markdown
Contributor

I think it is probably a better use of AI to incorporate named things in decomp into SoH than coming up with new names. I wouldn't trust AI names to fully reflect the usage of a certain function/variable, nor to conform to informal naming conventions (such as ocarinaTargetActor introducing a "target actor", when there is already interact(Range)Actor and talkActor that can merge with ocarina to keep naming more compact).

@bassdr

bassdr commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

I think it is probably a better use of AI to incorporate named things in decomp into SoH than coming up with new names. I wouldn't trust AI names to fully reflect the usage of a certain function/variable, nor to conform to informal naming conventions (such as ocarinaTargetActor introducing a "target actor", when there is already interact(Range)Actor and talkActor that can merge with ocarina to keep naming more compact).

I'm not sure I understand your comment, I did not use the AI to guess the names, I changed the name using VSCode rename symbol tool, then asked the AI to review and create the PR to save some time. Maybe I misunderstood the code or the naming conventions tho, this is possible as I am still learning the codebase... The AI did not need this symbol renaming at all, Claude is very good without it... This was so it's easier to read the code myself, not for him him...

Anyway, I'll close this, I added comments instead in #6951 .

bassdr added a commit to bassdr/Shipwright that referenced this pull request Jul 24, 2026
Drop the dependency on the ocarina symbol-rename PR (HarbourMasters#6967): the En_Du and
En_Okarina_Tag listening handlers this feature calls are already non-static
on develop, just not yet given descriptive names, so reference them by
their raw func_ symbols (documented inline). Every other handler
(En_Md, En_Ma2, Obj_Timeblock, Shot_Sun) is already named on develop. The
feature now touches no decompiled files at all.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HjDjMt2YeFw6wzqYL1zM6Y
@bassdr bassdr closed this Jul 24, 2026
@djevangelia

Copy link
Copy Markdown
Contributor

Sorry, it's hard to tell as, as you said, your PR text is AI-generated. But my point stands that the AI review didn't point out that disableSunsSong is only used to disable Sun's Song. It's a bit convoluted, but seen in OceffSpot_End() and can be confirmed empirically by always disabling it and playing other songs (including warp songs; warping could also be seen as an effect).
That's why new names are best always submitted to decomp, as their mission is more about documentation and they will scrutinize in a way that would not happen here to ensure that names are accurate. 👍

bassdr added a commit to bassdr/Shipwright that referenced this pull request Jul 27, 2026
Drop the dependency on the ocarina symbol-rename PR (HarbourMasters#6967): the En_Du and
En_Okarina_Tag listening handlers this feature calls are already non-static
on develop, just not yet given descriptive names, so reference them by
their raw func_ symbols (documented inline). Every other handler
(En_Md, En_Ma2, Obj_Timeblock, Shot_Sun) is already named on develop. The
feature now touches no decompiled files at all.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HjDjMt2YeFw6wzqYL1zM6Y
bassdr added a commit to bassdr/Shipwright that referenced this pull request Jul 27, 2026
Drop the dependency on the ocarina symbol-rename PR (HarbourMasters#6967): the En_Du and
En_Okarina_Tag listening handlers this feature calls are already non-static
on develop, just not yet given descriptive names, so reference them by
their raw func_ symbols (documented inline). Every other handler
(En_Md, En_Ma2, Obj_Timeblock, Shot_Sun) is already named on develop. The
feature now touches no decompiled files at all.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HjDjMt2YeFw6wzqYL1zM6Y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants