Move items with Select and browse the party's moves

In the start menu's pack, Select marks an item and asks where it should
go; A or Select on another row moves it there, merging stacks of the
same item unless either holds 99, and B ends the move. The packs that
GIVE and the PC open ignore Select, as in the original.

Left and right on the MOVE screen show the previous or next party
member's moves, skipping Eggs, unless a move is being moved.

Part of #27

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sébastien QUEROLandClaude Opus 5.5 committed 2026-10-03 00:56:51 +02:00
1 parent 397dcef44c
commit e2dc5ba520
9 files changed
+362 -34

No files matched your search

+15 -5
View File
@@ -302,8 +302,9 @@ when fewer than `NUM_MONMENU_ITEMS` are listed; the strings come from
`MonMenuOptionStrings` and move names. `SwitchPartyMons`/`_SwitchPartyMons`
swap two party entries. `MoveScreenLoop` swaps two moves and their PP; the
original's flag-dependent write into `wBattleMon` after a swap outside
battle is not modelled (the next battle reloads that structure), and left
and right do not move to another Pokémon's moves. `GiveTakePartyMonItem`,
battle is not modelled (the next battle reloads that structure). Its left
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
@@ -348,6 +349,13 @@ 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.
`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
(`wSwitchItem`) and `AskItemMoveText`; the original's CANCEL row is the
pack's BACK. The cursor now stays on the last row chosen while the pack is
open.
`DoRepelStep` runs in the world where `CountStep` calls it, after
`CheckSpecialPhoneCall`; the poison, happiness, egg, Day-Care and bike
steps of `CountStep` are not ported yet. `RepelWoreOffScript` starts with
@@ -385,10 +393,12 @@ the keys (a start-menu run with the unopened maps' positions) and the
Squirtbottle (the interpreter facing a test Sudowoodo on Route 36),
`Fish` against the Shore tables, a bite, no bite and no fish in New Bark
Town with the poses and the bubble, the surf and water refusals, and the
Magikarp DV filters. `tests/reference-parity.spec.ts` compares
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
`magikarpLength` with `CalcMagikarpLength` in the reference emulator over
1,509 DV and ID pairs. A Chromium/WebKit test hooks a Magikarp with the
Old Rod; the four fishing directions were checked in close-up
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
screenshots, not against the original.
## Evolution
+3 -1
View File
@@ -169,7 +169,7 @@ The numbered sections below keep their full scope. Each one opens with a checkli
- PACK: the Items, Balls, Key and TM pockets (left and right change pockets; there are no TMs or HMs yet), and each item's submenu chosen by its permissions and field menu (`USE`, `GIVE`, `TOSS`, `SEL`, `QUIT`). TOSS asks how many and confirms. USE follows `UseItem`: Oak's warning without a field use, "You don't have a POKéMON!" for party items without one, and `_DoItemEffect` by the item's `ItemEffects` address: Potions and the other `HealingHPAmounts` items, status healers, Full Restore, Revive and Max Revive, the bitter Energypowder, Energy Root, Heal Powder and Revival Herb, Ethers, Elixers, the MysteryBerry and PP Up. The Bicycle closes the menu and runs `Script_GetOnBike` or `Script_GetOffBike` outdoors; elsewhere Oak objects, because `wFieldMoveSucceeded` shares `wItemEffectSucceeded`'s byte.
- PP Up keeps a quirk: `wUsePPUp` shares `wTempPP`'s byte, so `ComputeMaxPP` adds one step (a fifth of the base PP, at most 7) to the current PP as well as the maximum. Sketch and moves with three PP Ups are "maxed out".
- The menu runs on a script draft, like the PC. Changes commit when it closes; a save made while it is open keeps the state from before it. The start menu cursor, the party menu cursor and the last pocket stay in memory between openings and are cleared after a battle, as `CleanUpBattleRAM` does. The party cursor reaches the next battle's `ChangeHappiness`.
- Not ported: MAIL, switching to another party member's moves with left and right, and item reordering with Select (each gives a notice and changes nothing; the Escape Rope runs since the Fly section below, Repels and the other items of the last section since then). Rare Candy, evolution stones and vitamins run since the evolution section below; field moves, SEL and Select since the section after it.
- Not ported: MAIL (it gives a notice and changes nothing). The Escape Rope runs since the Fly section below; Repels and the other field items, the rods, item reordering with Select and left and right on the MOVE screen since the last section. Rare Candy, evolution stones and vitamins run since the evolution section below; field moves, SEL and Select since the section after it.
## Implemented: evolution
@@ -249,6 +249,8 @@ The numbered sections below keep their full scope. Each one opens with a checkli
- The Itemfinder answers "Yes! ITEMFINDER indicates there's an item nearby." when a hidden item not found yet lies on the original's screen around the player (`CheckForHiddenItems`: four squares left and up, five right, four down), and "Nope!" otherwise. Route 30's hidden Potion is the only one on an open map.
- The Card Key and the Basement Key run their door scripts only facing the Radio Tower 3F slot or the Goldenrod Underground door (Oak objects elsewhere). The Squirtbottle sprinkles water, and on Route 36 starts the Sudowoodo battle when facing it (`WateredWeirdTreeScript`). None of these maps is open yet.
- The Old, Good and Super Rods fish facing water, never while surfing (Oak objects otherwise; the facing tile may hold an object, as in the original). The map header's fish group decides: none gives "Not even a nibble!" at once; otherwise `Fish` bites below 50% + 1 and picks the rod's `FishGroups` entry, with `TimeFishGroups` for the morning and day or the night. The player casts with the fishing frames (`LoadFishingGFX`'s body and rod tiles), jiggles four times on a bite, shows "!", and after "Oh! A bite!" puts the rod away before a `BATTLETYPE_FISH` battle: "The hooked MAGIKARP attacked!". Qwilfish and Remoraid swarms come from trainer calls, which are not ported. New Bark Town, Route 30 and Cherrygrove City have fish.
- In the start menu's pack, Select marks an item and asks "Where should this be moved to?"; A or Select on another row of the same pocket moves it there (the rows between shift), merging it into a stack of the same item unless either holds 99 (what exceeds 99 stays behind), and B ends the move without leaving the pack. Left and right keep the pocket meanwhile. The packs that GIVE and the PC open ignore Select, as `DepositSellPack` does.
- On the MOVE screen, left and right show the previous or next party member's moves, skipping Eggs (`MoveScreenLoop`'s `.cycle_left` and `.cycle_right`, which come back to the same Pokémon past either end), with the cursor back on the first move; not while a move is being moved. The party menu's cursor follows.
- Wild Magikarp now battle: `LoadEnemyMon` draws their DVs again as the original does, through `CalcMagikarpLength` (compared with the original routine) and its filters, whose millimetre limits only work as a floor of four feet that about 39% of draws skip (39 percent + 1), nowhere in map group 9 or on maps numbered 6 (the Lake of Rage check). Unown are still refused.
- Save format 3 gained `repel`, `coins` and `blueCardBalance`, migrated by absence to 0.