The six tests drew their cases from one generator shared by the file, so
a test's inputs depended on which tests the worker had run before it:
Chromium and WebKit, or a full run and a single test, compared different
cases, and a failure could not be replayed by running that test alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a page process has opened many AudioContexts, WebKit can hand out
one whose sampleRate is 0. The adapter passed that rate to binjgb, whose
emulator_run_until divides by the audio frequency on every call, so the
first frame trapped with "Division by zero". This failed the Day-Care
cartridge comparisons on WebKit after earlier tests had created hundreds
of emulators, and could crash the reference player in Safari.
A context without a usable rate is now closed and the emulator runs
silently at the fallback rate, as when no AudioContext can be created.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Day-Care and breeding: deposits, withdrawal pricing and growth,
compatibility, egg species, DVs and moves, DayCareStep, egg
collection and the Odd Egg, compared with the cartridge's routines.
- CountStep: walking happiness, DoEggStep, DayCareStep and DoBikeStep
in the original's order; HatchEggs with the ROM's hatch animation,
compared frame by frame with the original.
- MAIL: all ten stationery types and the Portrait MAIL picture,
compared with the cartridge's tilemaps, graphics and palettes.
- Printing: Bill's PC boxes, Pokedex PRNT, MAIL and the Photo Studio
take the original's absent-printer path.
- Hall of Fame records (saved apart from the League flag, ready for the
League to call) and the Hall of Fame PC, compared with the cartridge's
_HallOfFamePC on 255 pages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Savegames now lists independent save slots made with the loaded ROM:
new game, continue, rename, duplicate, export and delete. The native
database moves to IndexedDB version 2; the singleton save becomes
"Save 1" inside the upgrade transaction, so it migrates exactly once and
the old store is left untouched. Each write adds a generation and drops
older ones in one transaction, keeping two records with CRC-32
checksums: a damaged newest record falls back to the previous one.
Slots and records from a newer player are kept and never written.
Imports are checked in a scratch world before anything changes and
previewed with the trainer, progress, saved time, game data version and
the slots of the same trainer; they go into a new save or replace one,
whose previous record stays recoverable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every registered trainer's callee and caller scripts run, with the
missing specials and commands (RandomPhoneWildMon, RandomUnseenWildMon,
swarms, gettrainerclassname, Kenji's break, the Blue Card and Buena's
password variables). Fight counts are saved, so rematches and gifts work
on every open map, and the daily reset clears the phone's flags.
Random calls follow CheckPhoneCall and the 20/10/5/3-minute call timer;
received calls ring twice with the caller's name, and calls play their
ringing, hang-up and no-signal sounds. Grass and fishing swarms use the
swarm tables.
The radio ports PlayRadioShow and every station frame by frame, with its
music: the Pokégear's radio card tunes by knob, house radios play through
MapRadio, and Buena's show takes the day's password for Blue Card points
that her receptionist exchanges for prizes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sound engine (audio/engine.asm, home/audio.asm) is ported on a byte
copy of its audio WRAM and a sound register model. A reference test runs
the cartridge's routines beside it and matches the WRAM and registers
after every UpdateSound for all songs, effects and cries, fades, the
danger tone and effect priority. apu.ts synthesizes the four channels in
an AudioWorklet; its output matches the reference emulator's APU by
spectrum. The world runs the engine twice per tick; Play or the first
press unlocks sound, pausing suspends it, Settings sets the volume.
Wired in: map music by map setup and special map music, script audio
commands, text fanfares, WaitSFX and cries that hold the script frozen
(the last page stays shown), battle music, cries, fainting, victory,
capture and the low HP tone, Pokémon Center healing, evolution, the
intro, the Pokédex's cries, PCs, marts, healing items, talk and menu
clicks, bumps, ledges, warps, boulders, the Bicycle and Surf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
findPath now takes the visible objects and warps once per search, and
training and map crossings measure every candidate tile in one search
instead of one search per tile. The routes chosen are the same; the
45-stage playthrough runs in seconds again, which the slower CI host
needs (the Whitney stage hit its time limit there).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Route 40 gate, the Battle Tower and its rooms are open with the
offline challenge: the rules, the save before entering, the level menu
with its level and uber checks, seven trainers drawn from
BattleTowerTrainers with Pokémon from BattleTowerMons, BattleTowerText,
save and quit with the receptionist resuming it, cancelling, losing and
the vitamin reward. After each battle the party and Pokédex return to the
quick save's, as LoadPokemonData does.
Battle Tower battles turn off obedience, badge boosts, experience, items,
AI items and prize money, use Falkner's AI attributes, keep Sleep to one
to three turns and never fail the AI's status moves at random. New script
command battletowertext; new specials BattleTowerAction (offline actions),
BattleTowerRoomMenu, CheckForBattleTowerRules, BattleTowerBattle,
LoadOpponentTrainerAndPokemonWithOTSprite, Menu_ChallengeExplanationCancel,
TryQuickSave and Reset.
DoBadgeTypeBoosts was missing from every battle; it now adds an eighth of
the damage for the first badge matching the move's type on the player's
turn, checked against the original routine.
This completes Johto from Azalea to Blackthorn: Kanto, the League and the
S.S. Aqua continue on #33; radio, rematches and Buena's password on #30.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tin Tower's floors and roof and the Whirl Islands are open. The Clear Bell
gets the player past the sages to Suicune in Tin Tower; after the League,
the Rainbow Wing leads up to Ho-Oh, and the Silver Wing to Lugia.
New specials: MonCheck and BeastsCheck (CheckOwnMonAnywhere, with its
five-letter OT comparison and no Day-Care search).
The playthrough driver plans ledge jumps for the later stages, waterfall
descents, warp panels and Surf between warps; the run gains two stages,
Routes 45 and 46 back to Ecruteak and Tin Tower's Suicune.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rocket-held Radio Tower, the Underground's switch room and warehouse,
Ice Path, Blackthorn City and its gym, Routes 45 and 46, Dark Cave's
Blackthorn entrance, Dragon's Den and the Dragon Shrine are open. The story
plays through the Basement Key, the switches and the director, the Clear
Bell, Ice Path's falling boulder, Clair's gym and the shrine's test for the
RISINGBADGE, TM24 and the elder's Dratini.
New specials: GiveDratini and MoveDeletion. A save keeps an object that a
script made disappear (or appear against its flag) as Continue does, so the
Radio Tower director no longer blocks the 5F stairs after a reload. A
whiteout from a battle started in an scall no longer refuses.
The playthrough driver pushes boulders into their holes (planned breadth
first), clears whirlpools, chooses the move a TM replaces and heals with
the strongest potion; the run gains six stages to the Rising Badge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route 42, Mt. Mortar, Mahogany Town, Route 43 and its gates, the Lake of
Rage and its houses, the Rocket Hideout and Route 44 are open. The story
plays through the toll, the red Gyarados, Lance, the hideout and Pryce's
GLACIERBADGE, which starts the Radio Tower takeover.
The fishing guru measures Magikarp (CheckMagikarpLength,
MagikarpHouseSign, FindPartyMonThatSpecies); the record is saved.
takemoney now leaves a short account at zero as TakeMoney does, and
setmapscene/setscene on a map without scenes consume the byte instead of
refusing. The playthrough's path search slides on ice and the run gains
five stages to Pryce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enable Route 38 and its Ecruteak gate, Route 39 with the MooMoo farm,
Olivine City and its buildings, the Lighthouse's six floors, Routes 40
and 41, and Cianwood City with its gym, pharmacy, Photo Studio, Mania's
house, the Poke Seer and the Lugia speech house. Olivine's port, the
Battle Tower gate and Whirl Islands stay closed. The story runs from the
rival in Olivine through Jasmine and Amphy, Suicune and Eusine, the
SecretPotion, Chuck's boulders, the STORMBADGE, TM01 and HM02, back to
Amphy's cure, Jasmine, the MINERALBADGE and TM23.
Port GiveShuckle and ReturnShuckie with every return code and Mania's
wrong last-Pokemon speech, PokeSeer with its high-byte-only OT check and
reused caught level, PhotoStudio's no-printer path (Printer Error 2),
and PlaySlowCry. wMooMooBerries joins the saved script bytes.
Port trainer item AI: the 13 healing, status and X items, the
highest-level gate, item use while Mean Look or Wrap prevents
switching, and the original's random and state quirks, checked against
the ROM over 5,632 states. Leaders with items are no longer refused.
Game Corner sprites match the original frame by frame: cursor and reel
positions, Golem's whole-frame flips, frame timing, the frame a removed
sprite is still drawn, and the Golem roll's screen shake. The Burned
Tower rival's garbage trainer header is documented as a boundary: its
seen text dispatches text command $7f into home code before any battle.
The playthrough continues for six stages to Jasmine; its driver can
Surf, fish and travel through floors joined by holes. New tests cover
trainer items, Olivine and Cianwood side content, and reference checks
for trainer items, trainer sight and Game Corner animations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enable Route 35, Route 36, Route 37, the National Park and its gates,
Ecruteak City and its buildings, the Tin Tower entrance, the Wise Trio's
room and both floors of the Burned Tower. The story runs from Floria,
the SquirtBottle and Sudowoodo through the Kimono Girls' HM03 Surf, the
rival in the Burned Tower and the beasts' release to Ecruteak Gym,
Morty, the FOGBADGE and TM30.
Port roaming Pokémon (InitRoamMons, UpdateRoamMons, JumpRoamMons,
CheckEncounterRoamMon) with their state in the save; only Continue moves
them on restore, so a failed import's rollback keeps them in place.
Port the Bug-Catching Contest: registration on contest days, Park Balls,
contestants, the timer, QUIT, the catch-and-swap prompt, judging from
the ROM's contestant table, prizes and the saved contest state.
Port the Game Corner's SlotMachine and CardFlip on a new realtime tile
screen that advances two frames per tick with buffered buttons: reel
strips and scrolling, bias tables, the seven streak, Golem and Chansey,
payouts, the Card Flip board, cursor and navigation. Their tilemaps are
checked against the ROM's own data.
Also port getnum, a plain warp that continues its script on the new map,
and PokemonNames' EGG entry. A trainer whose script is ObjectEvent (the
Burned Tower rival) is no longer sighted once its own flag is set, as
the original's read of bit 1 of wNumKeyItems gives with the usual key
items.
The playthrough walks through the National Park and continues to Morty;
its driver chooses moves by type matchup, buys at Marts and uses Super
Potions and Awakenings in trainer battles. New tests cover roaming, the
contest, the Game Corner and Ecruteak's side content.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enable Goldenrod City and its buildings, the department store with its
elevator and rooftop, the Underground and its rooms, the Radio Tower
floors and the Route 35 gate.
Port what their scripts need: the herb shop, bargain shop, pharmacy and
rooftop sale marts with ROM stock, prices and text; the Name Rater; the
haircut brothers' happiness tables; the Lucky Number show over the party
and boxes with its saved number and Friday countdown (RTC day timers with
the 140-day wrap); coin and money balance boxes; Game Corner prize
registration through NewPokedexEntry; gift Pokémon to the box when the
party is full, with OT, nickname and MAIL (Kenya's 15-letter first line
now stores). Saves gain hallOfFame, timers and luckyNumber, with
defaults for older saves, and wUndergroundSwitchPositions joins the
saved script bytes.
The playthrough continues to the Bicycle, Whitney, the PLAINBADGE and the
radio card. SlotMachine and CardFlip are still refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enable Route 32 and its Pokémon Center, the Ruins of Alph with the four
chambers, item and word rooms, inner chamber and research center, Union
Cave, Route 33, Azalea Town with Kurt's house, the kiln and Bugsy's gym,
the Slowpoke Well, Ilex Forest and Route 34.
Port what their scripts need: saved WRAM bytes by label (readmem,
writemem, loadmem: wFarfetchdPosition, wKurtApricornQuantity),
VAR_UNOWNCOUNT and VAR_KURT_APRICORNS, SelectApricornForKurt and
verbosegiveitemvar, Unown letters (GetUnownLetter, per-letter pictures,
CheckUnownLetter's redraw, UpdateUnownDex, wFirstUnownSeen), the chamber
puzzles (_UnownPuzzle), DisplayUnownWords, HoOhChamber and
OmanyteChamber.
Minigames and specials that draw a whole screen in tiles now share a
tile screen effect with ROM graphics, palettes and sprites, answered
with buttons; the standard font and textbox frame load for them.
The playthrough continues through Kurt's Slowpoke Well, Bugsy, the rival
and the Farfetch'd to the Route 34 gate; its helpers move to
tests/playthrough-driver.ts. New tests solve the Kabuto puzzle through
the world, catch Unown and make Kurt's balls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
describe.skipIf still runs the describe body to collect tests, so the
ROM and PRET reads at describe level failed the synthetic CI job without
a ROM (runs 123–133). The reads now happen in beforeAll, as in the other
ROM suites.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
YES/NO and battle lists are single columns moved with Up/Down, the battle
menu cursor follows the 2x2 grid, and the dialogue menu shows every entry.
Not pushed yet: awaiting manual testing (#64, #65).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A manifest and icons rendered from icon.svg make the app installable.
The native build emits a service worker that precaches exactly the
built files and passes everything else to the network, so ROMs never
reach its cache. New versions wait for the player's Update, which saves
before reloading. Savegames offers installation, iPhone steps and
persistent storage, and a full disk gets its own save error.
Acceptance on physical iPhone and Android devices remains.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settings sets the text size (100, 125 or 150 %) and the key of each
button, kept in this browser's storage and validated on load. Every font
size scales with --text-scale, and the dialogue box scrolls instead of
growing past the screen. The game screen's label, the Play message and
Help's control list name the current keys.
Screen reader announcements for every native screen and touch control
remapping remain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Map tab draws the region's Town Map from the ROM with the player's
landmark, the visited flypoints as Fly destinations and the landmarks
whose maps are ported. Kanto opens with the Fly map's Indigo Plateau
rule. Landmark positions and flypoints are compared with the pinned
PRET source.
Closes#36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The start menu's POKéDEX runs Pokedex in New mode: the list up to the
last seen Pokémon, its cursor and page moves, and DisplayDexEntry with
the category, number, footprint, and the height, weight and pages once
caught. The Pokédex tab shows the same records from the loaded game.
Order, entries and footprints are compared with the pinned PRET source.
AREA, CRY, PRNT, the option and search screens, Old and A to Z modes
and Unown mode remain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pack's TM/HM pocket lists TMs and HMs with their moves, gives TMs and teaches either through the ABLE/NOT ABLE party menu, the compatibility and "already knows" checks and LearnMove; a TM is used up and makes the Pokémon happier. Eggs show no level or HP in the party menus, get the Egg stats page with its hatching hint, and are skipped by HealParty. Bug Catcher Wade's number registers (VAR_CALLERID and RandomPhoneMon).
The playthrough now runs through Falkner's ZEPHYRBADGE, the Togepi Egg, Kyle's Onix, Flash in Dark Cave, Wade's number and Earl's blackboard. With MAKE_TEST_SAVES it writes a Violet City backup for the manual checks.
Validated with 610 unit tests, 157 browser tests (including all 256 badge bytes against the original BadgeStatBoosts), native/reference builds and reference/vendor/release checks. Egg hatching (#29) and trainer calls (#30) remain on their cards.
Closes#31
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enable Route 31 and its gate, Dark Cave's Violet entrance, Violet City with its buildings and Sprout Tower. Port the script commands they use: gettrainername, askforphonenumber (with AddPhoneNumber's room for Mom and Elm; addcellnum now reports failure as the original does), checkpokemail, loadmenu/_2dmenu/closewindow, giveegg and trade (NPCTrade, with wTradeFlags saved).
Eggs keep their species with an egg flag, as wPartySpecies does. The pack's TM/HM counts receive, check and toss TMs and HMs, which are named TM01-HM07.
The playthrough continues through Route 31 (with Mom's call), Violet City and Sprout Tower to Elder Li's Flash.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BadgeStatBoosts runs where the original calls it: when a Pokémon is sent out, after an in-battle level-up, and in CalcPlayerStats. It keeps the PlainBadge/MineralBadge swap and the Glacier Badge's Special Defense register bug. A transformed Pokémon that levels up now keeps its copied stats.
The reference emulator compares all 256 badge bytes over 28 stat sets per browser against the unmodified routine.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run the forced-shiny, trap, forced-item, Celebi, Suicune, roaming and Bug-Catching Contest battle types. Roaming battles keep their struct's DVs and HP byte, and every other battle makes CleanUpBattleRAM's roaming roll. The contest shows PARKBALL×, counts down Park Balls, ends when they run out, keeps its catch outside the party and asks before switching. Scripts load the special types with loadvar, and while a contest runs, encounters use BugCatchingContestBattleScript and ContestMons.
Validated with 596 unit tests, 155 browser tests (including the contest menu and switch screen), native/reference builds and reference/vendor/release checks. National Park's contest event, the roaming release and the Ilex Forest Celebi event come with their maps.
Closes#28
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add the Heavy, Level, Lure, Fast, Friend, Moon and Love Balls with their documented bugs, the Park Ball's multiplier outside the contest, and Friend Ball happiness in the party and the PC. The Heavy Ball is refused for Kadabra and Sunflora, whose original weight read runs into VRAM.
The reference emulator compares 6,153 more catch states per browser against the unmodified PokeBallEffect. Validated with 582 unit tests, 153 browser tests, native/reference builds and reference/vendor/release checks. The Bug-Catching Contest and other special battle types remain on #28.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Translate every AI_Smart_EffectHandlers entry, so trainers with the Smart layer are no longer refused. The AI's type checks keep the CheckTypeMatchup bug: they read the move type and Foresight flag through hBattleTurn, and Conversion2's write to the player's move type persists.
The reference emulator runs the unmodified AI_Smart routine over 6,024 states per browser, comparing scores, Random consumption, hBattleTurn and the player's move type. Validated with 579 unit tests, 151 browser tests, native/reference builds and reference/vendor/release checks. Kurt's balls, Park and Safari balls and special battle types remain on #28.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Complete the weather, Substitute, Transform, called-move and forced-switch effects. Add held-item behavior, Exp. Share awards and badge-based traded Pokemon obedience, and persist trainer berry consumption.
Validated with 576 passing unit tests and 149 browser tests, native/reference builds, reference/vendor/release checks and 320 Metal Powder emulator comparisons per browser. Smart AI and special balls/battle types remain on #28.
Toxic, Leech Seed, Nightmare and Curse hurt in ResidualDamage's order.
Protect, Detect, Endure, Destiny Bond, Spite, Heal Bell, Disable, Encore,
Attract, Mist, Focus Energy, Haze, the healing moves and Rest, Mean Look,
Pain Split, Belly Drum, Psych Up, Safeguard, Perish Song, Spikes, Rapid
Spin, AncientPower and Future Sight now run, with Future Sight, Perish
Song, Safeguard and Encore handled between turns and Spikes on entry.
A trainer's party struct now follows its Pokémon where the original
updates it, and the enemy's moves spend PP there or in the wild
Pokémon's kept PP, so a caught Pokémon keeps the PP it used.
Part of #28
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A recharging, charged, rampaging or rolling Pokémon plays on without the
battle menu on either side, and a biding one uses FIGHT without the move
list. Razor Wind, Solarbeam, Skull Bash, Sky Attack, Fly and Dig charge
first; flying and digging Pokémon can only be hit by the original's
exceptions. Hyper Beam recharges, Thrash and its kind end in confusion,
Rollout and Fury Cutter double up, and Bide returns twice the damage it
took.
The trapping moves hurt their target between turns until it is released,
Mind Reader and Lock-On make the next move hit, and Pursuit strikes a
Pokémon being withdrawn first, on either side.
The new commands are compared with the original in the reference
emulator. Its fixture no longer zeroes wPlayerScreens with its sentinel.
Part of #28
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Multi-hit moves loop back to the script's critical command as EndLoop
does, with its hit-count draws, Triple Kick's growing kicks and Beat Up's
party members, and say "Hit n times!" from the borrowed high byte of the
user's damage taken. ConstantDamage covers Seismic Toss, Night Shade,
Sonicboom, Dragon Rage, Psywave, Super Fang and Flail/Reversal.
One-hit KO moves, Counter, Mirror Coat, False Swipe, Magnitude, Present,
Hidden Power, Return, Frustration, Selfdestruct, Dream Eater, Thief, Pay
Day, freezing, Tri Attack, added confusion, Swagger, thawing by fire
moves, Jump Kick's crash and Minimize with Stomp now run. Pay Day's coins
are paid after a win, and the Amulet Coin is checked at every send-out.
A Focus Band now also holds on at 1 HP.
The original's arithmetic commands are compared with the native ones in
the reference emulator on shared states and random streams.
Part of #28
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The handoff lists the four commits for the remaining field items, the
gaps found on the way and the manual test cards, whose backup the
manual-test save writer now produces.
[no-card]
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
The Old, Good and Super Rods run FishFunction facing water: the map's fish
group and Fish pick no fish, no bite, or a Pokémon from FishGroups and the
time of day's TimeFishGroups. The player casts and jiggles with the
fishing frames drawn from LoadFishingGFX's tiles, shows "!" on a bite, and
the hooked Pokémon attacks as BATTLETYPE_FISH. Facing pieces now use
signed offsets, which the rod above and left of the player needs.
Wild Magikarp no longer stop a battle: LoadEnemyMon redraws their DVs
through CalcMagikarpLength and its filters, as the original does. The
length routine matches the original in the reference emulator.
Part of #27
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repel, Super Repel and Max Repel count down 100, 200 or 250 steps where
CountStep does, keep weaker wild Pokémon away from the first party member
that has not fainted, and print "REPEL's effect wore off." on the last
step. The Coin Case and the Blue Card show their balances, Sacred Ash
revives the party once one Pokémon has fainted, and the Normal and
Gorgeous Boxes send their trophy home.
The Itemfinder looks for unfound hidden items on the original's screen
around the player. The Card Key, the Basement Key and the Squirtbottle
run the original's checks for their doors and Sudowoodo, whose maps are
not open yet. Saves gain the Repel's steps, the coins and the Blue Card's
points.
Part of #27
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Facing a Headbutt tree asks to HEADBUTT it, and HEADBUTT from the party
menu skips the question. ShakeHeadbuttTree shakes the tree as a sprite over
grass, then TreeMonEncounter scores the facing tile against the trainer ID
and draws from the map's common or rare tree table. A Pokémon that falls
fights as BATTLETYPE_TREE: "fell out of the tree!", and the time of day's
AsleepTreeMons species start asleep.
Smashable rocks run SmashRockScript, and ROCK SMASH from the party menu
acts on the facing rock; after the rock breaks, RockMonEncounter gives the
map's rock set a 40% chance of a wild battle.
Closes#26
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The board gains an "A tester" column for the checks that need a person:
the project-board hook now reads it, so a commit that mentions one of its
cards moves the card instead of adding it to a second column. A test that
runs only with MAKE_TEST_SAVES=1 writes the backup those checks import,
built from the local ROM and kept out of git.
[no-card]
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FLY opens _FlyMap in the party menu: the region's Town Map with "Where?",
the visited flypoints in turn and the Fly user's icon, then FlyScript flies
the icon off along SpriteAnimFunc_FlyFrom's path, enters the spawn point and
lands it with SpriteAnimFunc_FlyTo. Teleport returns to the last Pokémon
Center's town through IsSpawnPoint. Dig and the Escape Rope lead out of a
cave to the warp EnterMapWarp's SaveDigWarp recorded, which saves now keep.
newloadmap stops its script as StopScript does and the world resumes it on
the new map, which the landing and return movements need. A destination
that is not ported yet gives a notice.
Closes#25
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OPTION in the start menu runs _Option with the ROM's labels and settings,
OptionsControl's cursor wrapping and each option's bit handling. The four
option bytes live in the script state and saves, defaulting to
DefaultOptions. The battle style now decides whether a trainer's next
Pokémon brings an offer to switch, and the menu account whether the start
menu describes its items; the other settings are kept for later.
Closes#24
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The player's name in the start menu opens TrainerCard: page 1 with the
name, ID, money, Pokédex count and play time, page 2 with the Johto
leaders and the badges owned, turned and closed with the original
buttons. The card picture, leader faces and animated badges come from the
ROM with _CGB_TrainerCard's palettes. GameTimer now counts the play time
from the end of the introduction, capped at 999:59:59, and saves keep it.
Closes#23
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POKéGEAR in the start menu runs the clock, Town Map and phone cards with
the original joypad rules. Calls to Elm and Mom run their callee scripts,
with the out-of-area and out-of-hours cases and HangUp's corrected timing.
Mom saves a quarter of trainer prizes once asked, talking to her at home
opens BankOfMom (GET, SAVE, CHANGE and the DST checks) with its digit
amount box, and MomTriesToBuySomething buys items and dolls with her
savings. Saves gain Mom's money, her next item and its trigger balance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Field moves chosen in the party menu run their original checks and the
ROM's from-menu scripts (Cut, Surf, Strength, Flash, Whirlpool, Waterfall,
Sweet Scent), and Softboiled and Milk Drink share HP. SEL registers a key
item that Select then uses, replacing the Key Items shortcut, and Bill's
PC moves Pokémon between the party and every box.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pokémon that levelled up evolve after a won battle, following
EvolveAfterBattle's checks over the ROM's evolution bytes, with the
evolution screen that B can stop and move learning outside battle. The pack
uses Rare Candy, stones (with ABLE/NOT ABLE labels) and vitamins, and its
pocket tabs now sit in their own row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start opens the original start menu. POKéMON shows the party with the
Pokémon submenu (stats, switching, move order, held items); PACK shows the
four pockets with the field item effects for healing, PP and the Bicycle,
plus giving and tossing. The menu runs on a script draft, and its cursors
persist until a battle clears them. Select keeps the Key Items shortcut.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Run every non-ball item effect usable in battle from the ROM's
ItemEffects: Full Restore, revives, bitter medicine, Bitter Berry, Ethers
and Elixers, X items, X Accuracy, Guard Spec, Dire Hit and Poké Doll.
- Read happiness changes from HappinessChanges, including the larger
level-up gain where a Pokémon was caught.
- Model hBattleTurn at the battle menu, including the trainer AI's writes,
and drop the status-heal refusal.
- Port the stats screen for battles and Bill's PC.
- Compare the send-out and withdraw texts, RestoreHealth, RestorePP,
ChangeHappiness and CalcPlayerStats with the original routines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>