Skip to content

Match Net::ROOMHandler::reset()#304

Open
chrisking1981 wants to merge 1 commit into
snailspeed3:masterfrom
chrisking1981:pr/room-handler-reset
Open

Match Net::ROOMHandler::reset()#304
chrisking1981 wants to merge 1 commit into
snailspeed3:masterfrom
chrisking1981:pr/room-handler-reset

Conversation

@chrisking1981

Copy link
Copy Markdown

Summary

Adds a 100% byte-matching implementation for Net::ROOMHandler::reset() (declared in src/net/packets/ROOM.hpp but not yet defined).

The function zeros out 28 u32 fields in the handler, sets a 0xff byte at offset 0x68, then zeros 4 final u32 fields at 0x74, 0x70, 0x7c, 0x78.

How

Found via decomp-permuter. The trailing 4 stores require an indirect-via-double-pointer trick (u8** new_var = &self) plus a dummy null check to force mwcc into the matching instruction sequence — without it, mwcc picks a different scheduling that fails to byte-match.

The class definition only exposes a _00[0x80] opaque buffer, so the implementation uses u8* self = (u8*)this; to write at raw offsets. This stays consistent with the current header style.

Test plan

  • objdiff: reset__Q23Net11ROOMHandlerFv reports 100% match
  • Full build still produces matching main.dol (ac7d72448630ade7655fc8bc5fd7a6543cb53a49) and StaticR.rel (887bcc076781f5b005cc317a6e3cc8fd5f911300)

🤖 Generated with Claude Code

Found 100% match via decomp-permuter. The function zeros out 28 u32
fields, sets a 0xff byte at 0x68, then zeros 4 final u32s (0x74, 0x70,
0x7c, 0x78). The trailing 4 stores require an indirect-via-double-pointer
trick (`u8** new_var = &self`) plus a dummy null check to force mwcc to
emit the matching instruction sequence — without it the compiler picks a
different scheduling that fails to byte-match.

Verified: reset__Q23Net11ROOMHandlerFv 100% match (objdiff)
ROM-level: build/RMCP01/StaticR/StaticR.rel sha1 unchanged
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