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

+17
View File
@@ -0,0 +1,17 @@
import type { RomReader } from "./reader";
/** The cartridges the port reads, as PRET builds them (`make crystal`,
* `crystal11` and `crystal_au`): the English US/Europe revisions 1.0 and
* 1.1, and the Australian release, which is 1.1 with the Game Corners'
* gambling texts rewritten. All three keep every label the port reads at the
* same address; only the routines `romRevision` callers check differ. */
export type Revision = "1.0" | "1.1" | "au";
/** The revision from the cartridge header (rgbfix's -i and -n): game code
* BYTU for the Australian release, else BYTE with mask ROM version 0 or 1. */
export function romRevision(r: RomReader): Revision {
const code = String.fromCharCode(r.byte(0x13f), r.byte(0x140), r.byte(0x141), r.byte(0x142));
if (code === "BYTU") return "au";
if (code !== "BYTE") throw new Error("Unknown cartridge game code.");
return r.byte(0x14c) === 0 ? "1.0" : "1.1";
}