Port MAIL in the party menu and the PC's MAIL BOX
Giving MAIL opens the mail entry: two lines of up to sixteen characters, kept with the player's name and ID, the holder's species and the MAIL. The party submenu's MAIL reads the letter or takes it, either to the PC's MAILBOX (ten at most) or into the pack without its message. The player's PC lists the MAILBOX by author to read, put in the pack or attach, and Bill's PC keeps a Pokémon holding MAIL out of the boxes. Saves keep each holder's MAIL and the MAILBOX. The letter shows its message and author natively; the stationery's graphics are not drawn yet. Closes #27 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e2dc5ba520
commit
5c1ac9d726
17 files changed
+871
-54
No files matched your search
+26
-6
@@ -31,8 +31,8 @@ These paths refer to the pinned [PRET source](https://github.com/pret/pokecrysta
|
||||
| Event interpreter | `macros/scripts/events.asm`, `engine/overworld/scripting.asm`, `engine/events/std_scripts.asm` | Resumable; yields text, choices, movement, emotes and pauses. Scenes, phone contacts, string buffers and object commands. Unknown commands and specials abort without committing. |
|
||||
| Movement interpreter | `macros/scripts/movement.asm`, `engine/overworld/movement.asm`, `engine/overworld/map_objects.asm` | Turns, steps, slides, jumps (two tiles with the original arc), sleeps, facing locks, visibility and emotes. `follow` takes one tile toward the leader's previous square. All movement opcodes decode, including teleport, fishing, skyfall, shake and flicker poses; Controlled reference scenes check spin, teleport, skyfall, fishing and flicker direction, visibility and lift. |
|
||||
| Specials | `data/events/special_pointers.asm`, `engine/rtc/timeset.asm`, `engine/overworld/decorations.asm` | Selected by routine address from the ROM table: `SetDayOfWeek`, initial DST flags, `RestartMapMusic` (no audio yet), room decoration toggles, `PokemonCenterPC` and `PlayersHousePC` (Bill's, the player's and Oak's PCs), the Town Map, `HealParty`, `HealMachineAnim` (presentation only), `CheckPokerus` and the `StubbedTrainerRankings_Healings` stub. |
|
||||
| `game/scripts/pc.ts` | `engine/events/pokecenter_pc.asm`, `engine/pokemon/bills_pc_top.asm`, `engine/pokemon/bills_pc.asm`, `engine/events/prof_oaks_pc.asm`, `engine/events/std_collision.asm` | The Pokémon Center and house PCs: Bill's PC (deposit, withdraw, release, change and name boxes, MOVE PKMN W/O MAIL, stats), item storage, the empty mail box and Oak's rating. Menu strings and texts come from the ROM; lists are native. Printing is not ported. |
|
||||
| `game/scripts/start-menu.ts` | `engine/menus/start_menu.asm`, `engine/pokemon/mon_menu.asm`, `mon_submenu.asm`, `party_menu.asm`, `switchpartymons.asm`, `engine/items/pack.asm`, `engine/items/item_effects.asm` | The start menu, the party menu with the Pokémon submenu (STATS, SWITCH, MOVE, ITEM) and the pack (USE, GIVE, TOSS) with the field item effects listed below, including Rare Candy, stones and vitamins. Menu strings, prompts and texts come from the ROM; screens are native. Field moves from the menu (checked by the world), Softboiled and Milk Drink, SEL and the Select button (`SelectMenu`). MAIL gives a notice. |
|
||||
| `game/scripts/pc.ts` | `engine/events/pokecenter_pc.asm`, `engine/pokemon/bills_pc_top.asm`, `engine/pokemon/bills_pc.asm`, `engine/events/prof_oaks_pc.asm`, `engine/events/std_collision.asm` | The Pokémon Center and house PCs: Bill's PC (deposit, withdraw, release, change and name boxes, MOVE PKMN W/O MAIL, stats), item storage, the MAIL BOX (`MailboxPC`) and Oak's rating. Menu strings and texts come from the ROM; lists are native. Printing is not ported. |
|
||||
| `game/scripts/start-menu.ts` | `engine/menus/start_menu.asm`, `engine/pokemon/mon_menu.asm`, `mon_submenu.asm`, `party_menu.asm`, `switchpartymons.asm`, `engine/items/pack.asm`, `engine/items/item_effects.asm` | The start menu, the party menu with the Pokémon submenu (STATS, SWITCH, MOVE, ITEM) and the pack (USE, GIVE, TOSS) with the field item effects listed below, including Rare Candy, stones and vitamins. Menu strings, prompts and texts come from the ROM; screens are native. Field moves from the menu (checked by the world), Softboiled and Milk Drink, SEL and the Select button (`SelectMenu`), MAIL (`MonMailAction`, `ComposeMailMessage`) and `SwitchItemsInBag`. `party/mail.ts` holds the `mailmsg` struct. |
|
||||
| `game/scripts/pokegear.ts` | `engine/pokegear/pokegear.asm`, `engine/phone/phone.asm`, `engine/phone/scripts/mom.asm`, `elm.asm`, `engine/rtc/print_hours_mins.asm` | `PokeGear` with each card's joypad handling: the clock (`Pokegear_UpdateClock`, `PrintHoursMins`), the map card's landmark cursor (`TownMap_InitCursorAndPlayerIconPositions`, `TownMap_GetKantoLandmarkLimits`), the phone list (`PokegearPhone_UpdateDisplayList`, `GetCallerClassAndName`, `PokegearPhoneContactSubmenu`, `CheckCanDeletePhoneNumber`) and calls (`MakePhoneCallFromPokegear`, `CheckPhoneContactTimeOfDay`, `GetMapPhoneService`, `HangUp`). Callee scripts run in the event interpreter on the start menu's draft. Screens are native; the radio's stations are not ported. |
|
||||
| `game/scripts/trainer-card.ts` | `engine/menus/trainer_card.asm`, `engine/gfx/player_gfx.asm` (`GetCardPic`), `engine/gfx/cgb_layouts.asm` (`_CGB_TrainerCard`), `home/game_time.asm` | `TrainerCard`'s two reachable pages with their joypad rules, strings from `.Name_Money`, `.Dex_PlayTime` and `.Badges`, the caught count, and the badges from `TrainerCard_JohtoBadgesOAM` with their eight-frame steps. `rendering/trainer-card.ts` draws the card picture, leader faces and badges from the ROM with the card's palettes and attribute map. `world/game-time.ts` is `GameTimer` (capped at 999:59:59). Text is native; the blinking colon's and badges' phase start at the page load. |
|
||||
| `game/scripts/options.ts` | `engine/menus/options_menu.asm`, `data/default_options.asm`, `engine/battle/core.asm` (`CheckWhetherToAskSwitch`), `engine/menus/start_menu.asm` | `_Option` with `OptionsControl` and each option's routine on the four option bytes, `DefaultOptions`, and the two settings consumed so far: `BATTLE_SHIFT` and `MENU_ACCOUNT`. Strings come from the ROM; the screen is native. |
|
||||
@@ -307,8 +307,8 @@ and right (`.cycle_left`, `.cycle_right`) arrive as "left" and "right"
|
||||
answers of a `menu` effect with `sides`. `GiveTakePartyMonItem`,
|
||||
`TryGiveItemToPartymon` (including the swap and the full-pack refund) and
|
||||
`TakePartyItem` use `GiveItemToPokemon`/`ReceiveItemFromPokemon` on the
|
||||
chosen pack slot. Giving MAIL needs `ComposeMailMessage` and is refused
|
||||
before anything changes.
|
||||
chosen pack slot. Giving MAIL ends with `GivePartyItem`'s
|
||||
`ComposeMailMessage`.
|
||||
|
||||
The pack's submenu follows `.ItemBallsKey_LoadSubmenu`: `CANT_TOSS`,
|
||||
`CANT_SELECT` and the field menu (`CheckItemMenu`, the help byte's high
|
||||
@@ -349,6 +349,21 @@ while the menu is open. A Chromium/WebKit test opens the menu with Start,
|
||||
switches Pokémon, changes pockets and tosses a Potion. These are not
|
||||
emulator comparisons.
|
||||
|
||||
MAIL lives on the `PartyMon` that holds it (`sPartyMail` follows its
|
||||
Pokémon, so `_SwitchPartyMons`' mail swap and `RemoveMonFromParty`'s shift
|
||||
need nothing more) and in the state's `mailbox` (`sMailboxes`, up to
|
||||
`MAILBOX_CAPACITY`). Saves accept a message exactly while MAIL is held, and
|
||||
box Pokémon never carry one. The author's "nationality" bytes are not kept.
|
||||
`MonMailAction`'s READ, TAKE (`SendMailToPC`, or `ReceiveItemFromPokemon`
|
||||
after `MailLoseMessageText`) and QUIT, `MailboxPC`'s READ MAIL, PUT IN PACK
|
||||
(`DeleteMailFromPC`) and ATTACH MAIL (`MoveMailFromPCToParty`), and
|
||||
`BillsPC_CheckMail_PreventBlackout`'s `PCString_RemoveMail` use the ROM's
|
||||
strings. The naming screen's `mail` mode is `_ComposeMailMessage`: the
|
||||
first line gets its `<NEXT>` once full, so a second typed line pads it.
|
||||
`ReadAnyMail` shows the message and author natively; `MailGFXPointers`'
|
||||
stationery and the Portrait MAIL's picture are not drawn. A scripted
|
||||
`givepoke` with MAIL (`GivePokeMail`) is refused.
|
||||
|
||||
`Pack_InterpretJoypad`'s Select runs `SwitchItemsInBag` on the bag
|
||||
(`.try_combining_stacks`, `.combine_stacks`, `.above` and `.below`) through
|
||||
a `select:` answer of the `pack` effect, which shows the moving entry
|
||||
@@ -395,10 +410,15 @@ Squirtbottle (the interpreter facing a test Sudowoodo on Route 36),
|
||||
Town with the poses and the bubble, the surf and water refusals, and the
|
||||
Magikarp DV filters. `tests/start-menu.test.ts` moves and merges items
|
||||
with Select (keys included, and none in GIVE's pack) and steps through the
|
||||
party on the MOVE screen past an Egg. `tests/reference-parity.spec.ts` compares
|
||||
party on the MOVE screen past an Egg. `tests/mail.test.ts` writes MAIL
|
||||
given from the pack and swapped for a Berry, reads it, takes it to a PC
|
||||
(and a full MAILBOX) or into the pack (and a full pack), keeps it out of
|
||||
the boxes, reads, packs and attaches it from the MAIL BOX, and covers the
|
||||
save rules. `tests/reference-parity.spec.ts` compares
|
||||
`magikarpLength` with `CalcMagikarpLength` in the reference emulator over
|
||||
1,509 DV and ID pairs. Chromium/WebKit tests hook a Magikarp with the
|
||||
Old Rod and move a Potion below a Rare Candy with the keyboard's Select; the four fishing directions were checked in close-up
|
||||
Old Rod, move a Potion below a Rare Candy with the keyboard's Select, and
|
||||
write and read MAIL through the two-line entry and the letter panel; the four fishing directions were checked in close-up
|
||||
screenshots, not against the original.
|
||||
|
||||
## Evolution
|
||||
|
||||
Reference in new issue
Block a user