Skip to content

Port the retail fish race loop - #177

Open
VinLucero wants to merge 1 commit into
TheMoonPeople:masterfrom
VinLucero:gyorace-loop
Open

VinLucero wants to merge 1 commit into
TheMoonPeople:masterfrom
VinLucero:gyorace-loop

Conversation

@VinLucero

Copy link
Copy Markdown
Contributor

sgLoopGyoRace in port/src/object/subgame/gyorace.cpp was still a Ps2Unimplemented placeholder, so the game aborted as soon as a Finny Frenzy race started. This brings the retail loop over from ps2/src/gyorace.cpp in place of the forward declaration (retail order) and drops the placeholder and its stray includes at the end of the file.

Native changes to the retail body:

  • CSceneEventData: declared plainly instead of inside an anonymous union. The native struct has member initializers, which delete the union's default constructor, so the retail form doesn't compile. The memset that follows stays.
  • Results name: dc2::text::Copy/Append replace strcpy/strncpy (the native architecture audit bans those). The name is still padded with spaces to 18 characters as in retail, and is now always terminated.
  • Logging: printf becomes dc2::log::PrintGame, as elsewhere in the file.

Everything else is the retail code as-is, including the helpers the file already uses (grGetFishProgress, AutoCam, SetGyoRaceRanking, the sndSe* calls).

Also drops the "GyoRace hits the sgLoopGyoRace stub" line from docs/DEBUG.md. docs/port/stubs.md still lists it, but that generated file is already out of date on master (it uses old-layout paths and its counts don't match a fresh run), so I didn't touch it here.

Testing: the same loop, compiled from retail on an old-layout local build, ran a race on map 96 (i03h05) from start to finish: laps and timers counted and the results event (350) played. I couldn't build the new layout locally (no Docker), so this PR relies on CI to compile it. The repo's native_architecture source check finds no issues in the file.

🤖 Generated with Claude Code

sgLoopGyoRace was still a Ps2Unimplemented placeholder, so starting a
Finny Frenzy race aborted the game. Bring the retail loop over from
ps2/src/gyorace.cpp in place of its forward declaration.

Native changes to the retail body:
- CSceneEventData is declared plainly rather than inside an anonymous
  union; its member initializers delete the union's default
  constructor. The memset that follows is kept.
- The results name copy uses dc2::text::Copy/Append instead of
  strcpy/strncpy, keeping retail's padding to 18 spaces.
- printf becomes dc2::log::PrintGame, as elsewhere in the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T00:36:25.226277Z db80b5e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db80b5ef66

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


if (camera_pos.f[1] < 0.0f) {
mgSetAmbient(ambient.f);
water_cam = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Port the underwater pass off packed GIF data

When AutoCam selects either negative-Y camera during a normal race, this assignment makes sgEffectDrawGyoRace take its underwater branch (gyorace.cpp:1323-1345). That branch still builds the distortion strips with packed BeginPrim2(4, ...) at line 1267, but mgCDrawPrim::Data explicitly ignores packed runs (port/src/render/mg_drawprim.cpp:778-798), so the framebuffer/water overlay is never submitted and the race logs the "caller needs a port override" warning; port DivSpriteScreen to mgPortPrimVertex/mgPortPrimSubmit when enabling this loop.

Useful? React with 👍 / 👎.

@nicoNaeg

Copy link
Copy Markdown

This is the stub behind #215. In English, the reporter's second log reaches the race course and stops at gyorace.cpp:1426 (sgLoopGyoRace: PlayStation 2 code is not implemented on PC). In French, German and Spanish the race crashes earlier, in sgInitGyoRace; #216 fixes that part.

I merged this branch with current master (bcd19672) and with #216: no conflicts, and the macOS Debug build compiles. The failing checks don't come from this diff:

  • macOS and Linux: the same tests fail on master's latest run (GfxMisc.MeshBoundsFollowTheFlagAndAreInvalidatedByUpdates, GfxMisc.TexaNonblackSpecializationPreservesFilteredAlphaAndBlackUpdates and the MglibAspect.MenuForms* tests).
  • iOS: the build stops on an artifact upload (Failed to CreateArtifact: Unable to make request: ENOTFOUND).

I haven't run a full race with it: I couldn't script the entry through the hall's menus.

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