Repository navigation
Fix/opening crash - #62
Merged
Merged
Conversation
The opening, title and attract-movie units each declare their own CFireOmni, CEffectGroup, OBJ_ANIME_SEQ, CObjectFrame/CMapObject and CWater with byte arrays sized for 4-byte pointers, so on a 64-bit build the objects are smaller than the code that constructs and runs them expects. The arrays are replaced with the members they stand for; MWCC output is unchanged for PAL and NTSC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
The couple's dance swaps in each step from a pair of packs read in the background into read_buffer, which the script's object loads also use. One that lands between a pair's read and its swap leaves the second dancer with no pack, so it keeps its old motion and steps through keys the first dancer's new data has replaced; the port crashes in MotionProc at the last step. The port reads each dancer's steps into a buffer of its own. The level-one depth of field in OpA_DrawProcess also passes a single distance where DepthOfField reads two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tororoi
force-pushed
the
fix/opening-crash
branch
from
October 6, 2026 05:38
c618766 to
4a5b068
Compare
Adubbz
added a commit
that referenced
this pull request
Oct 6, 2026
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.
Fixes a crash partway through the opening, during the couple's dance. It's a bug in the original game that the port happens to expose.
The crash
LoadMotionDataplays the dance as ten motion files, each pair read in the background intoread_bufferbefore it's needed. The script's object loads (LoadCharaData) also read intoread_buffer, and when one lands in between, the second dancer's pack is overwritten. Retail doesn't notice:LoadPackDatafinds no pack and leaves that dancer's motion as it was, pointing intoCharaDataBuffer__2[6], which the first dancer's new step has just been loaded over. On the PS2 the data it then reads has the same layout as its own; on 64-bit it doesn't, and the port crashes inMotionProcat the last step on either disc.The port now reads each dancer's steps into a buffer of its own:
LoadMotionData(PC_OVERRIDE,port/src/title/op_b.cpp) and the first pair's read inOpA_InitProcess.Also
CFireOmni,CEffectGroup,OBJ_ANIME_SEQ,CObjectFrame/CMapObjectandCWaterused byte arrays sized for 4-byte pointers, so on 64-bit builds the objects were smaller than the code that runs them expects. They now have their real members. MWCC output is unchanged for both PAL and NTSC.OpA_DrawProcesspassedDepthOfFielda one-element array, but it always reads two distances.Testing
macOS (Apple Silicon) Debug build, July 12 PAL data: the opening runs to the end headless (27,000 frames) where it crashed before, every dance step now finds both dancers' packs, and an AddressSanitizer build is clean over the same run. With the single-disc changes (#) merged in, the opening also runs to the end on NTSC 1.02 data. All 94 tests pass.