Skip to content

Fix main's build: drawHeaderTextBanner and its 15 callers take eTextSections - #387

Merged
gynt merged 1 commit into
sourcehold:mainfrom
kotijekriv:fix/drawHeaderTextBanner-eTextSections
Nov 10, 2026
Merged

gynt merged 1 commit into
sourcehold:mainfrom
kotijekriv:fix/drawHeaderTextBanner-eTextSections

Conversation

@kotijekriv

Copy link
Copy Markdown
Contributor

Main d5d965d doesn't compile 16 files. The Ghidra sync 6c1e0bd declared PencilRenderCore::drawHeaderTextBanner's textGroupIndex as eTextSections (the header line from #384). Main's definition still takes an int (C2511), and 15 of its callers pass a bare number (C2664).

This PR takes #384's versions of those 16 files, unchanged, so main builds again now. #384 merges cleanly after it; if #384 goes first, this one can be closed.

  • The definition takes eTextSections and drops its cast.
  • Each caller names its text group (TEXT_SCENARIO 7, TEXT_GAME_OPTIONS 5, TEXT_XPLAY_WAITING_ROOM 2, TEXT_MAINOPTIONS 1), with the banner's text from cr.tex above the call. The text numbers are decimal, and each file includes its own header first.

Measured:

🤖 Generated with Claude Code

Ghidra sync 6c1e0bd declares drawHeaderTextBanner's textGroupIndex as
eTextSections (the header line from sourcehold#384). Main's definition still takes an
int, and 15 of its callers pass a bare number, so these 16 files don't
compile on d5d965d (C2511 for the definition, C2664 for each caller).

These are sourcehold#384's versions of the 16 files, unchanged (from 1262303,
db68fc5 and 85b9d29): the definition takes eTextSections, each caller
names its text group with the banner's text above the call, and the own
header is included first. sourcehold#384 then merges cleanly on top of this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gynt
gynt added this pull request to the merge queue Nov 10, 2026
Merged via the queue into sourcehold:main with commit 847c77b Nov 10, 2026
5 checks passed
kotijekriv added a commit to kotijekriv/OpenSHC that referenced this pull request Nov 24, 2026
…d FindingNetworkSessions (sourcehold#474)

* reimplement: SHC_3BB0A8C1_0x0047C860 100.0% Reimplemented

ChooseNetworkServiceProvider::MenuModalRenderFunction_ChooseNetworkServiceProvider, moved out of our draft sourcehold#360
(5485692, 65.1%), from Gynt's draft (968b1ee at 65.32% on his fork's reimpl/UI-MenuModals-development; his
closed sourcehold#252 had an earlier version). One behaviour fix against his draft, already in sourcehold#360: the modem tab's second
box reaches from y + 265 to y + 345; his draft moved y on to the bottom first and then drew the top at y + 265 from
there (y + 610). The original takes the top first (0x0047C9C5), as sourcehold's reimpl/UI-MenuModals has it and as
this does.

Both frames, the list's (y + 85 to y + 165) and the modem tab's (y + 265 to y + 345), run from x + 40 to x + 460:
the outline is one pixel outside that (x + 39 to x + 461), and the dimmed box ends at the scroll bar's column line
at x + 440. Each is written in a block with its four edges as int const locals (left = x + 40, top, right = x +
460, bottom) and every coordinate written from them. The original keeps each frame's top in ebx (0x0047C907,
0x0047C9C5). In the list's frame it keeps the left edge less 1 in y's stack slot (0x0047C91C, read back at
0x0047C934, 0x0047C94A and 0x0047C96E) and computes x + 461 again for each line that uses it; in the modem box's it
keeps x + 440 in that slot (0x0047C9E3) and x + 461 in esi (0x0047C9F8). In the draft x and y swapped esi and edi,
and x + 440 kept ebx, where the original keeps the list's top (quick_diff 0.6780, 177 instructions against 177).
With only the list's frame in a block, the modem box's top and left edge swap ebx and ebp (0.9435); with both
blocks the listing is the original's (1.0000). Both orders tried for the edges (left, top, right, bottom and right,
left, top, bottom) give the same listing, and so does int without const. A comment on each block says why it is
one.

On main since sourcehold#387 drawHeaderTextBanner takes an eTextSections: the banner's 76 is TEXT_MULTIPLAYER_CONNECTION. y -
0x3c is written y - 60, and the kick timer's test the other way round (timeGetTime() - kickedAtTime > 5000), with
the same listing; an unused include is dropped, and so are the casts on the lines' colour (the same listing).
Gynt's newest commit on the file, af1d790 on his reimpl/UI-MenuItems-development (2026-11-02, 45.8% there),
writes that test as `DVar2 > 5000 - kickedAtTime`, which is a different test; the original subtracts first (`sub
eax`, `cmp eax, 0x1388`, `jbe`), as this does.

No line for cmake/compiler-flags-gl.txt: the file reads 100.0% off the /GL list, and 100.0% on it too. reccmp in a
build of main's whole /GL list (the 133 files that exist) and this file, off the list, with every resolver of those
files on: 144 functions, average 99.56. The function 100.0% raw and normalised, no differing line; the other 143
functions read the same as without the file. That build had the casts, the include and shorter comments; quick_diff
gives the same 177 instructions, line for line, for this text. The sources were main's at 3458fea; main's commits
since add cmake files and tools, and two other UI functions' files (sourcehold#466, sourcehold#467).

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* reimplement: SHC_3BB0A8C1_0x0047D190 100.0% Reimplemented

FindingNetworkSessions::MenuModalRenderFunction_FindingNetworkSessions, moved out of our draft sourcehold#360 (e01e709,
66.9%), from Gynt's draft (9ae7d0b at 66.91% on his fork's reimpl/UI-MenuModals-development, "orig spills one
local"; before it 57.97% at e4d0a08, 58.30% at 861024c and 39.1% at 4462f5d / 70f15af; his closed sourcehold#252
had an earlier version). The draft computes what the original computes; no behaviour is changed against it.

The session list's frame (a dimmed box, its outline, the scroll bar's column and the column's two squares) is
written in a block with its four edges as int const locals, declared left, top, right, bottom (left = x + 40, top =
y + 85, right = x + 460, bottom = y + 285), and every coordinate is written from them. That is how the original
computes them: x's register becomes the right edge (add ebp, 0x1cc at 0x0047D1C7) and y's the bottom (add edi, 0x11d
at 0x0047D1CD), and the left edge less 1 is taken from x's stack slot (0x0047D1EB, 0x0047D1F8) and kept in a slot of
its own (0x0047D1FC). In the draft, with the top, the bottom, the right edge and the outline's two edges (right + 1,
x + 39) as locals and the box's left edge written out, the right edge did not take x's register, x was not read
again, and the function came out four instructions shorter, without the 4-byte frame (quick_diff 0.6691, 134
instructions against 138). Of the 24 declaration orders, the three with left before right, top before bottom and
right before bottom give the original's listing (left, top, right, bottom as here; top, left, right, bottom; left,
right, top, bottom). The other 21 keep 138 instructions: with the bottom declared before the right edge only the two
additions swap (3 orders, quick_diff 0.9855); with right before left or bottom before top the registers differ (18
orders, 0.8478 to 0.9638). A comment on the block says why it is one.

On main since sourcehold#387 drawHeaderTextBanner takes an eTextSections: the banner's 76 is TEXT_MULTIPLAYER_CONNECTION, and
eTextSections.hpp is included.

No line for cmake/compiler-flags-gl.txt: the file reads 100.0% off the /GL list, and 100.0% on it too.

reccmp in a build of main's whole /GL list (the 133 files that exist) and this file, off the list, with every
resolver of those files on: 144 functions, average 99.56. The function 100.0% raw and normalised, no differing
line; the other 143 functions read the same as without the file. That build had a shorter comment on the block;
quick_diff gives the same 138 instructions, line for line, for this text. The sources were main's at 3458fea;
main's commits since add cmake files and tools, and two other UI functions' files (sourcehold#466, sourcehold#467).

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
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.

2 participants