Read the English 1.0 and Australian cartridges besides 1.1 (#84)
Checks / web (push) Failing after 19s
Private ROM checks / private-rom (push) Failing after 25m36s

PRET's crystal and crystal_au builds reproduce both retail cartridges,
and every label the profile pins keeps its address in all three;
check:reference now verifies that when the rebuilds are present. The
revision comes from the header. Revision 1.0's Battle Tower draws only
the first 21 trainers and picks its texts' gender from the name's sixth
character, checked against each cartridge. A native backup imports
across the three, which share every map, event and object.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kawaandClaude Opus 5.5 committed 2026-10-17 16:12:00 +02:00
1 parent acdaf62eaa
commit 3c480a28f0
17 files changed
+317 -26

No files matched your search

+10 -1
View File
@@ -4,7 +4,7 @@
Translate Crystal's Game Boy assembly systems into a native TypeScript game. The browser runs the translated engine; the user's original ROM supplies data and assets. The emulator is a separate development reference for checking behavior, never a dependency of the native release.
PRET's [disassembly](https://github.com/pret/pokecrystal) is pinned at `7a7881d0d62e0ddbd82dcf10e7116807487ac651`. Its `crystal11` build with RGBDS 1.0.3 was verified byte-for-byte against the supplied English US/Europe 1.1 ROM. Required SHA-1: `f2f52230b536214ef7c9924f483392993e226cfb`. Other revisions require separate verified profiles.
PRET's [disassembly](https://github.com/pret/pokecrystal) is pinned at `7a7881d0d62e0ddbd82dcf10e7116807487ac651`. Its `crystal11` build with RGBDS 1.0.3 was verified byte-for-byte against the supplied English US/Europe 1.1 ROM (SHA-1 `f2f52230b536214ef7c9924f483392993e226cfb`). Its `crystal` and `crystal_au` builds reproduce the retail English 1.0 (`f4cd194bdee0d04ca4eac29e09b8e4e9d818c133`) and Australian (`a0fc810f1d4e124434f7be2c989ab5b5892ddf36`) cartridges, which the same profile reads (board #84). Other languages require their own verified profiles.
The emulator-backed prototype is now at `/reference.html`. The default application is the native port. The previous plan to progressively modify an emulated ROM has been superseded.
@@ -549,6 +549,15 @@ The numbered sections below keep their full scope. Each one opens with a checkli
- Tests: `tests/kanto.test.ts` (Snorlax's coordinates, 2×2 block and flute battle; Bill's grandpa's Everstone; the Trainer House's CAL; the Magnet Train both ways; the Diploma and its printer; Oak opening Mt. Silver; the move tutor; the rival in Mt. Moon and at Indigo Plateau on Mondays but not Tuesdays). The playthrough continues with fourteen stages: the S.S. Aqua, the eight Kanto badges in the order Thunder, Marsh, Cascade (with the Power Plant's manager, the Machine Part and Misty's date), Boulder (after the power returns, Rock Tunnel, the EXPN card and Snorlax), Volcano, Soul (Blue on Cinnabar), Rainbow (Cycling Road) and Earth, Oak opening Mt. Silver, training outside Silver Cave, TM26 from Victory Road, and Red with the credits, ending at `SPAWN_MT_SILVER`. Test saves: `vermilion-city`, `saffron-city`, `celadon-city`, `mt-silver`, `red-beaten`.
- Not presented: Mystery Gift's Trainer House opponents and printing; the Diploma's B prompt cursor (the page has no ▼).
## Implemented: the other English cartridges (board #84, increment A)
- Accepted: the English US/Europe revisions 1.1 and 1.0 and the Australian release (`src/rom/validate.ts`), the three cartridges PRET rebuilds byte for byte. Every label the profile pins has the same address in all three; `check:reference` now verifies that against `pokecrystal.sym` and `pokecrystal_au.sym` whenever those rebuilds are present, and checks their hashes.
- `romRevision` (`game/rom/revision.ts`) tells them apart from the header (game code BYTE or BYTU, mask ROM version 0 or 1). Revision 1.0's two Battle Tower bugs are reproduced: `LoadOpponentTrainerAndPokemon` draws only the first 21 trainers (BATTLETOWER_NUM_UNIQUE_MON), and `BattleTowerText` indexes `BTTrainerClassGenders` with the sixth character of the trainer's name. The Australian release differs only in the Game Corners' and Celadon's texts and one Buena call, which come from the ROM.
- Saves: each cartridge keeps its own list (slots are keyed by the ROM's SHA-1), and a native backup from one of the others imports, with a "Cartridge" line in the preview; the three share every map, event and object, so nothing is converted. Cartridge `.sav` files have the same layout in all three.
- Reference: `tests/reference-revisions.spec.ts` runs the cartridge's `BattleTowerText` on 1.1, 1.0 and the Australian rebuild for every trainer, six random values and the three texts. Tests: `tests/revisions.test.ts` (each cartridge is accepted under its name and recognised from its header, a changed byte is refused, the Battle Tower's trainer range), `tests/save-slots.test.ts` (a backup carried over between cartridges). The whole unit suite and the playthrough from the introduction to Red pass with `CRYSTAL_ROM_PATH` set to each rebuild (only the private CI downloader's 1.1 check is specific).
- Not affected: 1.0's other differences, the Pokédex's `wPokedexStatus` sharing a byte with `wPrevDexEntryBackup` (it misplaces the cursor after a search result's entry; the search mode is not ported) and the mobile Stadium 2 tilemap.
- Not supported: the French, German, Italian, Spanish and Japanese releases. PRET builds none of them, and no copy was available to verify a profile against; each needs its own addresses, character set and name lengths (the Japanese release most of all).
## Native battles: current state
The battle core, ROM tables, encounter hooks, battle UI and whiteout hooks are present. Unit tests cover wins, escape, loss, experience, move learning and capture; reference tests compare damage, type effectiveness, stat calculation and experience curves. Browser tests drive a test-only wild encounter through the real UI: victory with level-up and move learning, escape, whiteout, catching with a nickname, keyboard and on-screen D-pad menu navigation, mid-battle backup restore, rollback of unsupported effects, switching through the party menu and a Potion from the Items pocket. Real Route 29 encounters now use the ROM's encounter tables. Every ball can be thrown; only the contest's Park Ball handling remains.