Define gmregclear stage tables - #2955
Draft
MarkMcCaskey wants to merge 5 commits into
Draft
Conversation
The two 0x1A-entry stage tables were extern; the target defines them in this unit between the jumptables and the string pool. Reconstructing the initializers (with trailing pads preserving the retail offsets of lbl_803D85F0 and lbl_803D8B88) matches fn_8017C1A4 and gm_8017C838 exactly, improves four more functions, and matches both tables' data bytes. The remaining anchor rows suggest the original file was several translation units; noted at fn_801803FC.
MarkMcCaskey
marked this pull request as draft
July 24, 2026 05:42
Report for GALE01 (482f296 - b680bdf)Total data: 1211186 bytes (-4 bytes) ✅ 73 new matches
...and 43 more new matches 🥀 63 broken matches
...and 33 more broken matches 📈 5 improvements in unmatched items
📉 2 regressions in unmatched items
|
Keep the stage tables with the six functions at 8017C0C8-8017C984 and move their shared types into a private header. This preserves all six exact matches while restoring the later gmregclear data anchors. Replace the emitted data-order helper with named writable string arrays so the retail .data layout is retained without adding synthetic text.
Give the new 17C0 translation unit a symbol-only header, move its struct definitions and typedefs into gm/types.h and gm/forward.h, and keep gmregclear.h limited to its own split. Also relocate the two 1832 declarations that were previously carried by gmregclear.h. Code generation is unchanged.
Recover the Adventure and All-Star percentage accessors by assigning their duplicated conversion constants to separate translation units. Keep fn_8017F008 with regclear so its state remains private and its BSS ordering stays exact. Define the shared game-speed constants in gm_17C0; volatile reads prevent MWCC from folding duplicate literals while preserving all existing matches.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Investigating a match around adventure mode data.
Heavily WIP, ignore this PR for now.