Skip to content

feat: Ridge Racer game pack (#92) - #113

Open
OmarAglan wants to merge 9 commits into
mainfrom
phase2/ps1-ridge-racer-pack
Open

OmarAglan wants to merge 9 commits into
mainfrom
phase2/ps1-ridge-racer-pack

Conversation

@OmarAglan

Copy link
Copy Markdown
Contributor

Closes #92 once the phone run passes (see below).

Ridge Racer (USA)'s game pack: its manifest, its recompiled code (public, the owner's choice on 2026-11-28, as ADR 0018 allows) and the app running it.

What's in it

  • manifests/ridge-racer-ntsc-u.toml: the dump's 15 files with sizes, SHA-1 and SHA-256 (the hashes only, never any bytes; games_db checks them against Redump), and [recomp] entries: 129 functions the game only reaches through pointers, found by profiling which calls the interpreter still ran after boot.
  • packs/ps1/ridge-racer-ntsc-u/module.c: the generated module (382 functions, 6.4 MB, marked linguist-generated so diffs fold it). Built by CMake's anqa_ps1_pack into libanqa_pack_ridge-racer-ntsc-u.so, always at -O2. anqa_ps1_module moved from the test programs to runtimes/ps1, so packs and tests build modules the same way.
  • tools/ps1_pack/make.py: remakes the module. It checks the dump beside the CUE against the manifest's sizes and SHA-1s, then runs ps1_recomp with the entries.
  • The app: the APK packages the pack, and --es game ridge-racer-ntsc-u passes it to the PS1 runtime. The native side refuses any id that isn't a manifest-style name (anqa_run::pack_id_ok), since MainActivity is exported and the id becomes a library path.
  • Runtime: the recompiler's miss log starts once some function has matched its hash. Before that, it's the BIOS shell running from the game's addresses, which used to fill all 16 lines before boot.

Tests

  • ps1_pack_tests: 10 unit tests for make.py (entries, dump checks, the command, a stand-in ps1_recomp).
  • ps1_pack_ridge-racer-ntsc-u: the dump run both ways on a PC that has it, same frame at 900 frames. CI has no dump, so it's skipped there; it passes locally.
  • host_runner_test: pack_id_ok. LaunchArgumentsTest (JUnit): the extras to the native arguments.
  • ps1_programs_recompiled: nothing before the EXE is logged as a miss, and recomp_smc's copied code is (a mutant without the rule fails it).
  • Android CI checks both APKs' libraries, now including the pack.

Ridge Racer

On Linux (release build), with the entries: the same frame hash as the interpreter at 3000 frames, and about 96% of the cycles after boot recompiled (85% before). Most of the rest is time slices that end inside a block, which the interpreter finishes; that's #93's speed work.

Not done yet

Checks

  • Build, all tests (ANQA_REQUIRE_VULKAN=1), license audit, games_db, :launcher:assembleDebug, :launcher:testDebugUnitTest
  • PROGRESS.md, PLAN.md, ADR 0021
  • No game data committed: hashes and generated code only

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-28T16:35:50.000369Z
We couldn’t complete this review. Comment @codex review to try again.
147fc69 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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@OmarAglan

Copy link
Copy Markdown
Contributor Author

/code-review (high): two nits fixed in the last commit (make.py now reports a malformed [[dump]] instead of a traceback, with a test; a comment rewrapped). No change for the third: anqa_ps1_pack without a frame count would make a broken local test, but its one call passes 900.

…r-pack

# Conflicts:
#	docs/PLAN.md
#	docs/PROGRESS.md
#	host/android/main.cpp
- An acknowledge that clears STAT bit 9 outright drops a deferred one, and
  a write's acknowledge never defers the edge that same write raises.
- ps1_shot refuses --press with no buttons after the colon; the pack check
  refuses FRAMES that end before its Start press.
- Say what SDL makes of the orientation hint; drop a redundant reset line.
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.

Ridge Racer game pack

1 participant