Port the introduction's naming and clock screens
Checks / web (push) Canceled after 0s

A new game now runs NewGame's InitGender and OakSpeech natively before
the bedroom: Boy or Girl, InitClock's hour and minute steppers with
their YES/NO confirmations, Oak's speech with Wooper, and NamePlayer's
preset names or naming field (a blank name takes CHRIS or KRIS). Texts,
menus and time strings come from a new INTRO profile table verified by
check:reference; Oak's and the player's pictures decode from
TrainerPicPointers, ChrisPic/KrisPic and TrainerPalettes.

The chosen time is kept as a minute offset from the device clock, which
time of day, the weekday, NPC hours and the daily reset now read. The
intro runs only when nothing is saved; a save made during it starts it
again. Saves gain intro and clock.minuteOffset, migrated by absence. The
shell's name and character fields are gone. Intentional change: the
steppers start at the device time rather than 10:00.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sébastien QUEROLandClaude Opus 5.5 committed 2026-09-30 09:53:52 +02:00
1 parent 5a0fe1e313
commit b13fd20be4
28 files changed
+975 -101

No files matched your search

+16 -3
View File
@@ -34,7 +34,7 @@ The numbered sections below keep their full scope. Each one opens with a checkli
- Native canvas rendering, camera scrolling, walking, solid-tile/NPC collision, doors and stairs within the supported area.
- A bounded interpreter for a subset of the game's own event bytecode, plus text decoding. This does not execute GB instructions.
- Original initial event flags, readable signs, bedroom radio, bookshelves and supported conversations. Unknown interactions abort without committing partial changes.
- Native DOM dialogue, name/avatar choice, touch/keyboard controls and pause/resume.
- Native DOM dialogue, name/avatar choice, touch/keyboard controls and pause/resume. (The name and character are now chosen in the introduction; see below.)
- A minimal Crystal-style shell with Game, Savegames, Map, Pokédex, Link and Friends tabs across the top. The game uses the available native canvas, and leaving Game releases input and pauses play.
- Existing save, backup export and backup import actions in Savegames. Map shares a live local minimap with the game and shows the current supported area, player position and coordinates. Pokédex, Link and Friends are clearly marked as planned rather than populated with placeholder data.
- Native JSON state inside the backup envelope, separate IndexedDB storage and a separate tab lock. No emulator snapshot or cartridge save migration is implied.
@@ -133,6 +133,19 @@ The numbered sections below keep their full scope. Each one opens with a checkli
- Not ported: MOVE PKMN W/O MAIL and the stats screen (both show a notice and return to the menu), printing, a `givepoke` with a full party (refused; no open map reaches it) and the tutorial with a full party and box (the original repeats the unusable ball). Changing boxes does not show the save messages; the native session saves continuously.
- Next: the introduction's naming and clock screens, player switching and other items in battle, then party and bag menus.
## Implemented: the introduction's naming and clock screens
- A new game runs `NewGame`'s `InitGender` and `OakSpeech` natively before the bedroom: "Boy"/"Girl" (B disabled), `InitClock`, Oak's speech with Wooper, then `NamePlayer`. Texts, menu items, the preset names, the naming title and the time strings come from the ROM (`INTRO` table in the profile, verified by `check:reference`).
- `InitClock`: the hour and minute steppers wrap as `SetHour` and `SetMinutes` do, each confirmed with YES/NO; NO asks again. Labels follow `PrintHour` ("DAY 5 o'clock"), and `OakText_ResponseToSetTime` keeps its `DAY_HOUR + 1` comparison, so 10 AM still "overslept".
- The chosen time is stored as a minute offset from the device clock (the shortest one, within ±12 hours). Time of day, the weekday, NPC hours and the daily reset all read this game clock. Mom's `SetDayOfWeek` offset is taken from the game clock's day.
- `NamePlayer`: NEW NAME opens the naming field; a blank name takes CHRIS or KRIS, as `InitName` does. The other items are the gender's preset names.
- Oak's picture decodes `TrainerPicPointers` through `FixPicBank`; the player's is the uncompressed `ChrisPic`/`KrisPic`. Both use `TrainerPalettes` (Chris class 0, Kris class 1), as `DrawIntroPlayerPic` sets them.
- The intro covers the world and its minimap until it ends. It runs only when no session is saved. A save made during it keeps `intro: true`, and loading that save starts it again. The Game tab's name and character fields are gone.
- Save format 3 gained `intro` and `clock.minuteOffset`, migrated by absence to a finished intro on the device clock.
- Intentional change: the steppers start at the device's current time rather than 10:00, so confirming keeps the device clock.
- Not presented: the palette fades, Wooper's cry, the picture slide during name selection, `ShrinkPlayer` and the Route 30 music (no audio yet).
- Next: player switching and other items in battle; MOVE PKMN W/O MAIL and the stats screen with the party menu; a continuous opening playthrough.
## 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 and type effectiveness. 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, and rollback of unsupported effects. Real Route 29 encounters now use the ROM's encounter tables. Player switching and items other than balls in battle remain unfinished.
@@ -205,7 +218,7 @@ their scripts and story progression are supported.
- [x] Battles: stats, damage, types, accuracy, criticals, status, turn order, fainting, experience, move learning, trainer AI, trainer send-outs and prize money
- [ ] Player switching, and items other than balls, in battle
- [x] The PC and boxes (catching with a full party)
- [ ] The introduction's naming and clock screens
- [x] The introduction's naming and clock screens
- [ ] Controlled-seed comparisons with the original beyond damage and type effectiveness
- [ ] Acceptance: one continuous playthrough of the opening quest with save/reload. The scenes are tested individually from fixtures so far.
@@ -213,7 +226,7 @@ Introduce native player, party, Pokémon, inventory, money and quest models. Rea
Expand script calls, choices, scene state, inventory commands and native special handlers. Translate routines reached through assembly calls into explicit native services; never fall back to emulator execution in the shipping game.
Meeting Mom, Elm's introduction, the starter, the aide's Potion, Route 29, Cherrygrove, Route 30's trainers, Mr. Pokémon's house, the Cherrygrove rival battle, the return to Elm, capture, the catching tutorial and the PC run now. Next: the introduction's naming and clock screens.
Meeting Mom, Elm's introduction, the starter, the aide's Potion, Route 29, Cherrygrove, Route 30's trainers, Mr. Pokémon's house, the Cherrygrove rival battle, the return to Elm, capture, the catching tutorial, the PC and the introduction's naming and clock screens run now. Next: player switching and other items in battle.
Complete and validate the native battle engine: deterministic randomness, stats, move selection, accuracy/critical checks, damage, status, turn order, switching, fainting, experience, capture and rewards. Compare controlled seeds and states with the original, including integer rounding and overflow behavior.