Cite as
pret/pokegold
Original
https://github.com/pret/pokegold
Pinned
pret/pokegold @ fc702b6d922aecce274782d68bba8639936a1182
Accessed
2026-10-21
Licence
none stated (no LICENSE file)
Credit
The pret community. See https://github.com/pret/pokegold/graphs/contributors.
Notes
Builds the English Gold and Silver ROMs, sha1 d8b8a3600a465308c9953dfa04f0081c05bdcb94 (Gold) and 49b163f7e57702bc939d642a18f591de55d92dae (Silver) (README, roms.sha1), and debug builds.

Cited on

Claims (20)

Crystal adds 10 to X for a sleeping or frozen Pokémon, capped at 255, and nothing for burn, poison, or paralysis: the test meant to add 5 for them reads a value the sleep-and-freeze mask has already cleared. Gold and Silver have the same code, and their disassembly notes that those three statuses were meant to rank between sleep and none.engine/items/item_effects.asm L337–353Code
Gold and Silver run the same capture code as Crystal: from the catch-rate load to the final roll, PokeBallEffect differs only in comments, and the wobble table is identical.engine/items/item_effects.asm L240–388data/battle/wobble_probabilities.asm L1–27Code
Crystal keeps Gold and Silver's battle weather unchanged: Rain Dance and Sunny Day set rain or sun for 5 turns, and the weather tables give Water and Fire ×1.5 or ×½ in rain and sun.data/battle/weather_modifiers.asm L1–10Code
Gold and Silver already use the staged critical hit that Crystal keeps line for line: Focus Energy (+1), a high-critical move (+2), and a Scope Lens (+1) add to a critical level, which reads 17, 32, 64, 85, or 128 in 256 from CriticalHitChances. Chansey holding a Lucky Punch and Farfetch'd holding a Stick get level 2 at once and skip the other bonuses.engine/battle/effect_commands.asm L1145–1205data/battle/critical_hit_chances.asm L1–8Code
Gold and Silver's BattleCommand_CheckHit, which Crystal keeps unchanged, subtracts a target's BrightPowder value (20) from the stage-scaled accuracy byte, lets a byte of 255 always hit, and otherwise hits on a random byte below it.engine/battle/effect_commands.asm L1595–1614data/items/attributes.asm L15–16Code
Gold and Silver's type chart file is the one Crystal ships, byte for byte, so the 17 types, Steel and Dark included, and Ghost's ×2 on Psychic date from Gold and Silver.data/types/type_matchups.asm L1–118Code
Gold and Silver's BattleCommand_Stab, which Crystal keeps unchanged, applies the weather and badge type boosts and then STAB, damage+⌊damage/2⌋, before the type rows.engine/battle/effect_commands.asm L1217–1281Code
Gold and Silver's BattleCommand_DamageVariation leaves 0 or 1 damage alone and otherwise multiplies by a random byte, rotated, redrawn until it is at least 217 (85 percent + 1), and divides by 255 (100 percent); Crystal keeps the command unchanged. Their BattleCommand_DamageCalc differs from Crystal's only in comments and one doubling written sla a where Crystal has add a.engine/battle/effect_commands.asm L1503–1543macros/data.asm L23engine/battle/effect_commands.asm L3111–3113Code
Gold and Silver's BattleCommand_EndLoop, which Crystal keeps apart from a comment, loops back to the critical command for every hit of a 2–5-hit move, so each hit rolls its own critical and damage.engine/battle/effect_commands.asm L5161–5292Code
On each step, Gold and Silver's TryWildEncounter reads the map's encounter rate for the current time of day (morning, day, or night), or its water rate, doubles it for the Pokémon March or Ruins of Alph radio, halves it for the Pokémon Lullaby or a Cleanse Tag, and starts a battle when Random is below it; Crystal keeps this unchanged.engine/overworld/wildmons.asm L212–251Code
The time of day picks which of a grass area's three sets of 7 slots is used; a roll from 1 to 100 then picks a slot at 30, 30, 20, 10, 5, 4, and 1 percent, or one of 3 water slots at 60, 30, and 10 percent. Crystal's routine and table are the same.engine/overworld/wildmons.asm L283–295data/wild/probabilities.asm L6–21Code
Gold and Silver set the time of day from the cartridge clock's hour, morning from 4:00 to 9:59, day from 10:00 to 17:59, and night from 18:00 to 3:59.engine/rtc/rtc.asm L25–55constants/misc_constants.asm L37–39Code
Gold and Silver's escape formula is Red and Blue's, ⌊32P/(⌊E/4⌋mod256)⌋ plus 30 for each earlier attempt against a random byte, with a held Smoke Ball that always escapes; Crystal adds two battle types, Celebi's and Suicune's, that block escape.engine/battle/core.asm L3504–3564Code
Gold and Silver order moves by priority, 3 for Protect and Endure, 2 for the priority-hit moves, 0 for Vital Throw and the force-switch, Counter, and Mirror Coat effects, and 1 for the rest; at equal priority a held Quick Claw goes first when a random byte is below its value, 60, about 23% of the time, and otherwise the higher Speed goes first, with a tie split evenly; Crystal keeps the routine.engine/battle/core.asm L431–452engine/battle/core.asm L781–792data/moves/effects_priorities.asm L1–8data/items/attributes.asm L155–156engine/battle/core.asm L485–501Code
Each Gold and Silver item record carries a held effect and a parameter, which battle code reads from the item a Pokémon holds; Quick Claw's is 60, BrightPowder's 20, Leftovers' 10, and Scope Lens's HELD_CRITICAL_UP has 0.data/items/attributes.asm L155–156data/items/attributes.asm L289–290data/items/attributes.asm L302–303Code
Rain Dance and Sunny Day each set their weather for 5 turns; in rain, Water moves do ×1.5 and Fire moves ×½, in sun the reverse, and rain halves SolarBeam.engine/battle/move_effects/rain_dance.asm L1–5data/battle/weather_modifiers.asm L1–10engine/battle/move_effects/sunny_day.asm L1–5Code
HeartGold and SoulSilver (the US releases, which share this code) split the clock's hour into five periods with a 24-entry table: morning from 4:00 to 9:59, day from 10:00 to 16:59, evening from 17:00 to 19:59, night from 20:00 to 23:59, and late night from 0:00 to 3:59. Platinum's table gives every hour the same period (its names are morning, day, twilight, night, and late night). Gold and Silver have three periods: morning from 4:00, day from 10:00, and night from 18:00.constants/misc_constants.asm L37–39Code
Before the two rolls, HeartGold and SoulSilver adjust the map's rate in this order: the lead Pokémon's ability (unless it is an Egg) doubles it for Arena Trap, No Guard, or Illuminate, halves it for White Smoke, Quick Feet, or Stench, or for Snow Cloak in snow, capped at 100; the Black Flute halves it and the White Flute raises it by half; and a Cleanse Tag or Pure Incense held by the lead Pokémon cuts it to 2/3. Gold and Silver instead double the rate for the Pokémon March or the Ruins of Alph radio and halve it for the Pokémon Lullaby or a Cleanse Tag.engine/overworld/wildmons.asm L212–251Code
HeartGold and SoulSilver have 12 grass slots and 5 surfing slots, picked by one LCRandom() % 100 against bounds in EncounterSlot_WildMonSlotRoll_Land and EncounterSlot_WildMonSlotRoll_Surfing, so they come up 20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, and 1 percent and 60, 30, 5, 4, and 1 percent (computed from the bounds). Platinum's GetGroundEncounterSlot and GetWaterEncounterSlot have the same bounds. Gold and Silver have 7 grass slots and 3 water slots, with cumulative bounds in GrassMonProbTable (30, 60, 80, 90, 95, 99, 100) and WaterMonProbTable (60, 90, 100), so 30, 30, 20, 10, 5, 4, and 1 percent and 60, 30, and 10 percent (computed from the differences).data/wild/probabilities.asm L6–21Code
A HeartGold or SoulSilver map's encounter record holds one walking rate and three full species lists for its 12 grass slots, morning, day, and night, sharing one list of levels. Gold and Silver keep a separate grass rate for each time of day and three sets of 7 slots. Platinum keeps one 12-slot list and swaps only slots 2 and 3 for their day or night species outside the morning.engine/overworld/wildmons.asm L212–251engine/overworld/wildmons.asm L283–286Code