Match cmMenuFixedController::init and update - #127
Open
vagnertxr wants to merge 1 commit into
Open
Conversation
Completes and links sora/cm/cm_controller_menu_fixed.cpp. init was at 23%. Three things were wrong: - unkFA.m_flag2 is actually m_rotate; the target ORs 0x40, not 0x04. - The camera has to be held in a local. Indexing m_cameraManager->m_cameras[0] per statement reloads the manager every time. - m_rot is written through an 8-byte temporary, not a Vec3f. A Vec3f temporary forces a 32-byte frame in every position it can occupy, while the target's frame is 16. The flag writes are split deliberately: setting m_flag7 through the mask keeps the original read live, so the following two writes chain off it. With all three written through the mask, mwcc folds (flags|0x82)|0x40 into flags|0xC2 and hoists it above the first store. update was never written. It is storeDefault() behind the unk8 guard, then init(), then m_transformFlag and the call. Caching m_cameraManager in a local is what keeps the manager in one register across the inlined bodies. fn_800A69AC is renamed to its mangled name, which follows from the existing virtual void update(float) declaration. Requires Sammi-Husky/BrawlHeaders#66: init only matches with gfCamera::TransformFlag's bitfields declared over u16, so that the flag accesses are halfword-wide. Verified: `ninja` reports 127 files OK. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Completes and links
sora/cm/cm_controller_menu_fixed.cpp.Depends on Sammi-Husky/BrawlHeaders#66 —
initonly matches withgfCamera::TransformFlag's bitfields declared overu16, so that the flag accesses are halfword-wide. This PR does not bump the submodule; it needs that one merged first.