Facts
Released
1996-02-27 (JP, as Red and Green); 1998-09-28 (NA, as Red and Blue)
Genre
Japanese role-playing game, Monster-taming
Platforms
Game Boy
Developer
Game Freak
Publisher
Nintendo
Series
Pokémon
Code
Disassembly by pret contributors
Explainers
Capture
Wild encounters
Evidence
Code (6)
Wiki (1)
Sources
4
On this page
  1. Data
  2. Related
  3. Mechanics
  4. References
  5. Sources

Game Freak’s Pokémon Red and Green came out in Japan in 1996, and the English Red and Blue in North America in 19981.

Its type effectiveness code is one table of 15 types, 82 rows2 and one routine. That routine applies STAB, then every matching row, truncating as it goes3. Ghost moves have no effect on Psychic types4. The effectiveness text follows only the last matching row5.

A step in grass starts a wild battle 25 times in 256 on Route 16.

Data

All 22 tables

Text encoding, the first 10 of 97 rows:

ByteCharacter
0x7F
0x80A
0x81B
0x82C
0x83D
0x84E
0x85F
0x86G
0x87H
0x88I

All 97 rows on its claim.

Mechanics

MechanicKindHow
Type effectiveness15 types15 types in 82 rows, each row truncating the damage in turn
Same-type attack bonusHalf againdamage plus half, just before the type rows
Damage formulaAttack over defenselevel, power, and Attack over Defense, capped at 997 plus 2, then STAB, the type rows, and a 217–255 roll
Critical hitFrom a stathalf the attacker's base Speed in 256, and eight times that for four high-critical moves
Hit chanceMove accuracyan accuracy byte out of 256, so even a 100% move misses 1 time in 256
Multi-hit attackRepeat the first hit2–5 hits, every one copying the first hit's damage
Random encounterBy areaeach step or turn in place in grass, on water, or anywhere in a cave rolls against the map's rate in 256, then picks one of 10 slots
FleeingSpeed ratioSpeed at least the foe's escapes; otherwise 32 times Speed over a quarter of the foe's, plus 30 per try, out of 256
Turn orderPriority, then SpeedQuick Attack goes first and Counter last, then the higher Speed, with a tie split evenly
Random number generatorHardware-stirredthe hardware divider added to one byte and subtracted from another every frame
Music driverFractional tempoa note lasts length × speed × tempo / 256 frames, the remainder carried to the next
Sampled soundWave channelsix 32-step waves for channel 3, copied into wave RAM on each note
Password and battery saveBattery save with a check valueone copy with a complemented 8-bit sum
CaptureTwo rollsa ball-limited byte less 25 or 12 for status against the catch rate, then a second byte against an HP term; the shakes on a miss are worked out with no roll
Physical/special splitBy typeFire, Water, Grass, Electric, Psychic, Ice, and Dragon moves use Special on both sides; the other types use Attack against Defense
Every claim about this game, by concept (106)
generalPokémon Red and Green came out in Japan on 27 February 1996; the English Red and Blue (developer Game Freak, publisher Nintendo, Game Boy, and Generation I core series) followed in North America on 28 September 1998.Wiki
A POKé BALL costs ¥200, a GREAT BALL ¥600, and an ULTRA BALL ¥1,200, and the NUGGET is the most expensive item at ¥10,000. A mart charges each of the 83 items a price from one table of 3-byte decimal prices, and each of the 50 TMs a price from a second table that keeps one digit per TM, in thousands (¥1,000 to ¥5,000). A purchase costs the price times the quantity, up to 99 at a time, and a sale pays half of that. Key items and HMs can't be sold, and an HM has no price of its own. Eight items that aren't key items have a price of 0, so they sell for nothing: the MASTER BALL, MOON STONE, EXP.ALL, PP UP, ETHER, MAX ETHER, ELIXER, and MAX ELIXER. The first table goes on past the items with 14 elevator floors, each priced 0.Code
Red and Blue have 14 mart clerks: one each in Viridian City, Pewter City, Cerulean City, Vermilion City, Lavender Town, Fuchsia City, Cinnabar Island, Saffron City, and Indigo Plateau, and five in the Celadon Dept. Store, two on 2F, one on 4F, and two on 5F, 94 listings in all. A clerk's list runs from 4 items (Viridian City's) to 9. Viridian City's clerk sells only once Oak's Parcel has been delivered. A clerk's text starts with the mart marker, then the number of items, the items, and $FF; the game copies that list into the buy menu, which prices each item from the price table. Two more lists in the same file, a BICYCLE alone and GREAT BALL, HYPER POTION, SUPER POTION, FULL HEAL, and REVIVE, belong to no map's text.Code
Poké Balls lying on 44 maps hold 104 items, one each, which the player takes by talking to the ball: 27 hold TMs, 9 a RARE CANDY, 2 an ULTRA BALL, and 1 a POKé BALL (in Viridian Forest), and none a GREAT BALL or a MASTER BALL. All but two lie there from the start: Rocket Hideout B4F's SILPH SCOPE appears once Giovanni is beaten there, and its LIFT KEY once a Rocket is beaten and talked to again. A ball is a map object marked as an item, with the item's number, and its text is the pick-up routine. That routine gives 1 of the item and hides the ball, only if the ball is one of the map's objects that can be hidden, as every one of the 104 is; with a full bag it says so and the ball stays.Code
Red and Blue hide 54 items on 39 maps, each found once: among them 4 ULTRA BALLs and 2 GREAT BALLs, and no POKé BALL or MASTER BALL. Two stand apart: a NUGGET in the Safari Zone Gate, which a disassembly comment marks inaccessible, and a MAX ELIXER on map $6F, which the disassembly names unused and whose header entry is Lance's room's. Each hidden item is an entry in its map's hidden-event list that calls the hidden-item routine with the item's number; the routine finds the tile's place in a second list of hidden-item tiles, gives 1 of the item unless that place's found flag is set, and then sets it. With a full bag it says so and the item stays.Code
The Game Corner prize room trades coins at three counters, and no prize is a ball or any item but a TM. The right counter offers TM23, TM15, and TM50 for 3,300, 5,500, and 7,700 coins in both versions. The left and middle counters offer Pokémon, which differ by version: in Red, ABRA (level 9) for 180 coins, CLEFAIRY (8) for 500, NIDORINA (17) for 1,200, DRATINI (18) for 2,800, SCYTHER (25) for 5,500, and PORYGON (26) for 9,999; in Blue, ABRA (6) for 120, CLEFAIRY (12) for 750, NIDORINO (17) for 1,200, PINSIR (20) for 2,500, DRATINI (24) for 4,600, and PORYGON (18) for 6,500. A TM goes in the bag; a Pokémon is given at the level its version's list sets.Code
Three vending machines on the Celadon Dept. Store roof sell FRESH WATER for ¥200, SODA POP for ¥300, and LEMONADE for ¥350, one at a time. They check only that the player has ¥200, whatever the drink: a player with less than a drink's price still gets it, and is left with ¥0 (computed from the subtraction, which sets money that would go below zero to zero). A drink comes from its own price list, not the mart price table.Code
Besides the marts, the Poké Balls on maps, the hidden items, the prize counters, and the vending machines, 45 gifts put an item in the bag or the PC: 20 TMs, all 5 HMs, and 20 other items. The only balls among them are the 5 POKé BALLs Prof. Oak gives and the MASTER BALL from the president of Silph Co. on 11F. Each gift is a script whose condition is in its row: the three from Prof. Oak's aides count the species owned against 10, 30, or 50, and a new game starts with a POTION in the PC.Code
POKé BALLs sell in Viridian City (once Oak's Parcel is delivered), Pewter City, Cerulean City, and Vermilion City; GREAT BALLs in Lavender Town, the Celadon Dept. Store (2F, left clerk), Fuchsia City, Cinnabar Island, Saffron City, and Indigo Plateau; and ULTRA BALLs in Fuchsia City, Cinnabar Island, and Indigo Plateau. No mart sells a MASTER BALL or a SAFARI BALL.Code
The president of Silph Co. on 11F is the only source of a MASTER BALL: he gives one, once. No mart sells one, no Poké Ball on a map or hidden item holds one, the prize counters and the vending machines offer none, and no other script gives one. In the disassembly's debug build of Blue, a separate ROM, the debug menu's DEBUG choice starts a new game with 99.Code
The game's name text uses one byte a character: capitals A to Z from $80, lowercase a to z from $A0, digits 0 to 9 from $F6, and $7F for a space; é is $BA, and $BB to $BF and $E4 and $E5 each hold an apostrophe with a letter ('d, 'l, 's, 't, 'v, 'r, 'm). A name ends at $50.Code
The game numbers 27 types, of which 15 have their own name: NORMAL to GHOST as 0 to 8, and FIRE to DRAGON as 20 to 26. Type 6 is named BIRD, and numbers 9 to 19 all point at NORMAL's name.Code
The 165 moves, by move number, each with its name, effect number, power, type, accuracy (a byte out of 255), and PP. 99 have a power above 1, up to EXPLOSION's 170; nine have a power of 1 (among them GUILLOTINE, SEISMIC TOSS, and DRAGON RAGE), and 57 have none. 78 of the moves are NORMAL. The lowest accuracy is 76 in 255, about 30%, for GUILLOTINE, HORN DRILL, and FISSURE; 104 moves have 255. PP runs from 5 to 40 in steps of 5.Code
The game numbers its species 1 to 190 in an internal order that starts with RHYDON, KANGASKHAN, and NIDORAN♂, not the Pokédex's. 151 of the numbers are Pokémon, each with its Pokédex number in a second table, and the other 39 are named MISSINGNO. and have Pokédex number 0.Code
The 151 Pokémon's base data, in Pokédex order: five base stats, two types (89 Pokémon have one type, listed twice), catch rate, base experience, the moves it knows at level 1, and its growth rate. The five base stats add up to between 175 (CATERPIE and WEEDLE) and 590 (MEWTWO); MEW and DRAGONITE come next at 500. 80 Pokémon grow at the medium-fast rate, 40 medium-slow, 26 slow, and 5 fast; no Pokémon uses the other two of the six rates. Catch rate runs from 3 (ARTICUNO, ZAPDOS, MOLTRES, and MEWTWO) to 255 (fifteen Pokémon), and base HP from 10 (DIGLETT) to 250 (CHANSEY).Code
The 50 TMs and 5 HMs, each the move it teaches, in the order of the TM/HM bits in a Pokémon's base data: TM01 to TM50, then HM01 to HM05.Code
The type chart is a list of 82 matchups, each an attacking type, a defending type, and a multiplier: 38 of 2, 38 of 0.5, and 6 of 0. GHOST against PSYCHIC is listed as 0, POISON against BUG and BUG against POISON as 2 each way, and ICE against FIRE isn't listed.Code
The 97 items numbered $01 to $61, by item number, each with its name and its mart price, stored as six decimal digits in three bytes. 45 have a price above 0, the highest the NUGGET's 10,000; the last 14 are named as floors (B2F to 11F and B4F), each priced 0.Code
The 16 mart lists, in the order they're stored: each a $FE byte, the text command (TX_SCRIPT_MART) that the game's text routine sends to the mart dialogue, then a count and that many item numbers, from 1 item (a BICYCLE alone, in a list pret marks unreferenced) to 9. The second clerk on Celadon Dept. Store 2F sells nine TMs, item numbers $C9 and up; the item table has no row for them, so those cells show the raw item numbers.Code
The six growth rates, each a formula in the level n, (a/b)n³ + cn² + dn − e, from four bytes: medium fast is n³; slightly fast (3/4)n³ + 10n² − 30; slightly slow (3/4)n³ + 20n² − 70; medium slow (6/5)n³ − 15n² + 100n − 140; fast (4/5)n³; and slow (5/4)n³.Code
Red and Blue have 57 lists of wild Pokémon, 570 rows in all: 55 for grass and cave floors, one map each, and two for water, one shared by Routes 19 and 20 and one for Route 21. Each list holds its encounter rate and ten slots, each a level and a species. Grass rates run from 8 (Viridian Forest) to 30 (the Safari Zone); both water lists are all Tentacool, at rate 5. The versions differ in 175 rows across 34 lists, always in the species, and in one row the level too: Pokémon Mansion B1F's slot 8 holds a level-42 Weezing in Red and a level-38 Magmar in Blue. A slot's chance is the same on every list. The species' names are as the game prints them.Code
The Good Rod's list has two entries, a level-10 Goldeen and a level-10 Poliwag, on every map.Code
CaptureEvery wild Pokémon of a species starts with the same catch rate, its species' (45 for a Bulbasaur): when the battle loads the Pokémon it copies the species' catch-rate byte, and the ball's catch-rate test reads that copy. In the Safari Zone, bait halves the copy and a rock doubles it, up to 255.Code
Every ball but the Master Ball starts with a random first number whose range the ball sets: 0 to 255 for a Poké Ball, 0 to 200 for a Great Ball, and 0 to 150 for an Ultra or Safari Ball. The game draws a random byte and draws again while it is above the ball's limit. A Master Ball draws the byte too but ignores it, and catches without this or any later test.Code
A sleeping or frozen Pokémon is easiest to catch, then a burned, paralyzed, or poisoned one. The ball subtracts 25 from its first number for sleep or freeze, 12 for any other status, and nothing without one, and a first number below that amount catches at once: sleep alone catches on 25 of a Poké Ball's 256 first numbers (9.8%) and on 25 of an Ultra Ball's 151 (16.6%) (computed). Otherwise the throw fails when the first number less that amount is above the catch rate, and goes on to the HP test when it isn't.Code
The lower the Pokémon's HP, the likelier a throw that passes the catch-rate test (the first number, less the status amount, at most the catch rate) is to catch, and a Great Ball's second test is easier than any other ball's. The ball computes T=⌊⌊255M/F⌋/max⁡(⌊H/4⌋,1)⌋ from the Pokémon's max HP M and current HP H, with F 8 for a Great Ball and 12 for every other ball, each division rounding down. A T over 255 catches; otherwise a second random byte catches when it is at most T. At full HP the second test so passes about a third of the time (about half with a Great Ball), and from roughly a third of max HP down (half with a Great Ball) it always passes (computed).Code
A Poké Ball catches a Bulbasaur (catch rate 45) with no status and max HP 100 about 6.0% of the time at full HP and 18.0% at 1 HP (computed, counting every value of each random byte as equally likely). Without a status, a throw's chance is min⁡(C+1,N)N⋅min⁡(T+1,256)256: the share of first numbers at most the catch rate C, out of N, 256 for a Poké Ball, 201 for a Great Ball, and 151 for an Ultra or Safari Ball, times the share of second bytes at most T=⌊⌊255M/F⌋/max⁡(⌊H/4⌋,1)⌋, for max HP M, current HP H, and a ball factor F of 8 for a Great Ball and 12 for any other.Code
At full HP a Great Ball can catch more often than an Ultra Ball (computed): against a Bulbasaur (catch rate 45) with max HP 100 and no status, the Great Ball catches about 11.4% of the time and the Ultra Ball about 10.2%. A throw rolls two random numbers from 0 to 255, and on both a low roll is the one that catches. With no status, the first roll must be at or below the species' catch rate, its base-stats byte, which loading the opposing Pokémon copies in; the Great Ball rerolls any first roll above 200 and the Ultra Ball any above 150, so the Ultra Ball's first roll passes at least as often. The second roll must be at or below a target of max HP × 255, divided by 8 for the Great Ball or 12 for the Ultra Ball, then by a quarter of current HP (at least 1); a target above 255 catches with no second roll. The Great Ball's smaller divisor gives it the larger target, and with no status and a catch rate of 200 or more both first rolls always pass, so there the Great Ball never catches less often.Code
A failed throw's shakes depend only on the ball and on the Pokémon's catch rate, HP, and status, so every failed throw of one ball at a Pokémon in the same state shows the same count: no random number feeds it (computed). The game computes Y=⌊100C/B⌋ from the catch rate C, with B 255 for a Poké Ball, 200 for a Great Ball, and 150 for any other, then Z=⌊min⁡(T,255)⋅Y/255⌋ from the HP test's result T, plus 10 for sleep or freeze or 5 for another status. A Z under 10 misses ("You missed the POKéMON!"), under 30 shows one shake ("Darn! The POKéMON broke free!"), under 70 two ("Aww! It appeared to be caught!"), and 70 or more three ("Shoot! It was so close too!"). The code's branch for a Y over 255, which would show three, never runs: Y is at most 170 (computed).Code
A ball thrown at a ghost is dodged ("It dodged the thrown BALL! This POKéMON can't be caught!"): at any wild Pokémon in Pokémon Tower while the Silph Scope isn't in the bag, and at the Marowak on the tower's 6F even with it. A ball thrown in the old man's battle always catches, and that Pokémon isn't added to the player's party, nor is a ball taken from the bag. The ghost tests and the old man's catch both come before any random number is drawn.Code
A Master Ball catches every wild Pokémon but the ghosts, which dodge it as they dodge every ball, unless the party and the current PC box are both full, when no ball can be thrown: after the ghost tests, it skips the catch-rate, status, and HP tests, so neither status nor HP matters. A random byte is drawn before the ball is identified and never used.Code
A badly poisoned Pokémon is as easy to catch as a poisoned one. Toxic sets the same poison bit in the status byte as other poisoning moves, plus a separate badly-poisoned flag, and the ball's status tests read only the status byte, so it subtracts 12 from the first number and adds 5 to the shake count, as for any status but sleep or freeze.Code
A ball can be thrown only in battle; outside one, Oak says "This isn't the time to use that!". With six Pokémon in the party and 20 in the current PC box, a ball can't be thrown ("The POKéMON BOX is full! Can't use that item!"), except in the old man's battle. Thrown at a trainer's Pokémon, the ball is blocked ("The trainer blocked the BALL!", then "Don't be a thief!") and used up.Code
Outside the old man's battle, a caught Pokémon ("All right! … was caught!") joins the party with the HP and status it had when the ball hit, or goes to the current PC box when the party is full, with "… was transferred to BILL's PC!" once the player has met Bill and "someone's PC!" before. A species not yet owned is first registered in the Pokédex and its entry shown ("New POKéDEX data will be added for …!").Code
A Pokémon that is transformed when caught is caught as a Ditto at its level, whatever its species: the catch code assumes only a Ditto can be transformed, which a comment in the disassembly calls a bug, since a wild Pokémon could copy Transform with Mirror Move.Code
A Great Ball costs ¥600 and an Ultra Ball ¥1200, three and six times a Poké Ball's ¥200. The Master, Ultra, Great, Poké, and Safari Balls are all thrown through the same code. The price list gives the Safari Ball ¥1000 and the Master Ball 0.Code
In the Safari Zone the wild Pokémon never attacks. Every battle in the Safari Zone's four areas is a Safari battle, whose menu offers BALL×, BAIT, THROW ROCK, and RUN in place of the usual commands. After each of the player's actions that doesn't end the battle, the Pokémon either flees or the menu comes back; no move is ever chosen for either side.Code
Bait makes a Pokémon harder to catch and a rock easier. Bait halves its catch rate, rounded down, and a rock doubles it, up to 255; each throw works on the rate the last one left, so a Chansey's 30 becomes 15 after bait and 60 after a rock. Halving has no floor: six baits take a catch rate of 45 to 0 (computed), and with no status a rate of 0 still passes the catch-rate test, in which the ball's first random number, less the status amount, must not be above the catch rate, when that first number is 0. When the angry count runs out, the rate returns to the species' own value, undoing every bait and rock before it. When the eating count runs out, the rate stays where the bait left it, and bait thrown at an angry Pokémon clears the angry count without resetting the rate, as a rock thrown at an eating one clears the eating count.Code
Bait makes the Pokémon eat and a rock makes it angry, each for 1 to 5 more turns, and each ends the other: bait clears the angry count and a rock the eating count. The turns added are a random byte's low three bits, redrawn until under 5, plus 1, and a count stops at 255. After each of the player's actions that doesn't end the battle, the game prints "Wild CHANSEY is eating!" (with the Pokémon's name) and takes a turn off the eating count; when the Pokémon isn't eating, it prints "Wild CHANSEY is angry!" and takes one off the angry count, and with neither count it prints nothing.Code
A Safari Pokémon flees more often the faster it is, much less often while eating, and more often while angry: at a speed of 50 it flees about 39% of the time (100 in 256), 9.8% while eating, and 78% while angry (computed). After each of the player's actions that doesn't end the battle, it flees ("Wild CHANSEY ran!") when a random byte is below a threshold b, so with chance b/256. b starts at twice its speed (the speed's low byte, all of any speed under 256), and a low byte of 128 or more makes it flee at once. While it is eating, b is divided by 4, rounded down; while it is angry, b is doubled, up to 255. The count is taken off before the roll, so bait that adds n eating turns lowers the chance on n−1 of them (computed).Code
A Safari Ball catches exactly as an Ultra Ball does: its first roll is redrawn until it is at most 150, its HP check uses a ball factor of 12, and a missed throw counts its shakes against 150. Each throw takes one of the Safari Balls the gate hands out instead of a ball from the bag.Code
A Safari Zone encounter ends in one of four ways: a catch; the Pokémon fleeing; the player choosing RUN, which in the Safari Zone always gets away ("Got away safely!"); or a missed throw with the last Safari Ball, after which the PA announces "Ding-dong! You are out of SAFARI BALLs!" and the battle ends before the flee check.Code
A Safari Game costs ¥500 and gives 30 Safari Balls and a step counter that starts at 502, shown out of 500. Each step takes one off, and a step that finds the counter at 0 ends the game ("PA: Ding-dong! Time's up!"); running out of Safari Balls ends it as soon as the player is back on the map. Either way the PA says "Your SAFARI GAME is over!" and the player is sent back to the gate.Code
A wild Pokémon enters battle at full HP with no status. Its max HP is ⌊2(B+D)L/100⌋+L+10, capped at 999, where B is its species' base HP, L its level, and D its HP DV, with no stat-experience bonus. A DV is a hidden value from 0 to 15 that each Pokémon has for each stat. A wild Pokémon's attack, defense, speed, and special DVs are the four 4-bit halves of two random bytes drawn when the battle loads it, and its HP DV takes the lowest bit of each: 8 from attack, 4 from defense, 2 from speed, and 1 from special. A level 5 Bulbasaur (base HP 45) so has 19 to 21 max HP (computed). A trainer's Pokémon gets fixed DVs and keeps its party HP and status instead, and a transformed one keeps the DVs it had before transforming.Code
Critical hitThe critical-hit test makes a hit critical when a random byte is below a threshold set by the attacker's base Speed S: ⌊S/2⌋ for most moves, and min⁡(255,8⌊S/2⌋) for Karate Chop, Razor Leaf, Crabhammer, and Slash.Code
Without Focus Energy, a Pokémon with base Speed 115, such as Persian, lands a critical hit on 57 of 256 rolls with most moves and on 255 of 256 with Slash.Code
Focus Energy cuts the critical-hit chance to about a quarter instead of raising it: for most moves the threshold becomes ⌊S/8⌋ in 256, where S is the attacker's base Speed, against ⌊S/2⌋ without it, because the code halves a value it should double; a comment in pret's disassembly marks this as a bug.Code
A critical hit doubles the attacker's level in the damage formula and ignores stat stages, Reflect, and Light Screen: the player's Pokémon's attacking or defending stat comes from its party data, and the opponent's is recomputed from its base stat, level, and DVs, without stat experience, or read from its party data in a link battle.Code
Damage formulaType picks the stats: Fire, Water, Grass, Electric, Psychic, Ice, and Dragon (the first special type upward) use Special on both sides; the rest use Attack against Defense.Code
In Red and Blue, a damaging move runs the critical-hit test, the base formula, the type adjustment (STAB, then type rows), the random factor, and then the hit test (accuracy).Code
The base-damage routine computes ⌊⌊(⌊2×Level/5⌋+2)×Power×Attack/Defense⌋/50⌋, caps it at 997, and adds 2, so the type step receives 2–999. For a move with the explode effect it halves Defense first (to at least 1).Code
The damage-randomizing routine multiplies damage by a random byte, 217–255, and integer-divides by 255, leaving 0 or 1 damage untouched.Code
FleeingIn a wild battle, the run routine lets the player escape when their Pokémon's Speed P is at least the foe's E; otherwise it computes Q=⌊32P/(⌊E/4⌋mod256)⌋, adds 30 for each earlier attempt, and escapes when a random byte is at most the result, or at once when the result passes 255.Code
Hit chanceRed and Blue store a move's accuracy as a byte, ⌊255p/100⌋ for p percent, so 100% is 255 and 85% is 216.Code
The hit test lands a move when a random byte is below its accuracy byte, so even a 100% move misses 1 time in 256.Code
The hit-chance routine multiplies the accuracy byte by the attacker's accuracy-stage ratio and then by the defender's evasion-stage ratio, read in reverse; it truncates after each step, keeps at least 1, and caps the result at 255.Code
Swift returns from the hit test before any check, so it never misses, even against a Pokémon in the air from Fly or underground from Dig; other moves always miss such a target, and X Accuracy skips only the roll.Code
Of the 165 moves in the move table, Struggle included, 104 are listed at 100% accuracy and 61 below it; the lowest are the three one-hit KO moves at 30%.Code
Bulbasaur and Squirtle start with Tackle, 35 power at 95% accuracy, and Charmander with Scratch, 40 power at 100%: the starter arrives at level 5 with the moves its base data lists, plus learned moves up to its level, and none of the three learns one before level 7.Code
Four 120-power moves trade accuracy for power against a 95-power, 100%-accurate move of the same type: Thunder (70%) against Thunderbolt, Blizzard (90%) against Ice Beam, Fire Blast (85%) against Flamethrower, and Hydro Pump (80%) against Surf. Sing, Hypnosis, Sleep Powder, Lovely Kiss, and Spore put the target to sleep at 55%, 60%, 75%, 75%, and 100%, and Guillotine, Horn Drill, and Fissure knock out in one hit at 30%.Code
Sand-Attack and Smokescreen (100%), Kinesis (80%), and Flash (70%) lower the target's accuracy by one stage; Double Team and Minimize (100%) raise the user's evasion by one stage.Code
Outside link battles, an enemy's stat-lowering effect first fails when a random byte is below 64, 1 time in 4; the player's moves skip that roll. A move whose main effect lowers a stat, such as Sand-Attack or Smokescreen, then faces the normal accuracy test, while a damaging move's side effect instead takes hold only on a byte below 85, 85 times in 256.Code
Pidgey learns Sand-Attack at level 5, and a wild or trainer Pokémon knows the moves its learnset gives up to its level; so the level-5 Pidgey on Route 1 (the last of its 10 grass slots, 3 encounters in 256) and on Route 2 (the fifth slot, 25 in 256), and the rival's level-9 Pidgey on Route 22, can use it.Code
Multi-hit attackDoubleslap, Comet Punch, Fury Attack, Pin Missile, Spike Cannon, Barrage, and Fury Swipes hit 2 or 3 times with probability 3/8 each, and 4 or 5 times with 1/8 each; Double Kick, Bonemerang, and Twineedle always hit twice.Code
A multi-hit move runs the critical test, the damage formula, and the accuracy roll once; every later hit repeats the first hit's damage, and a first hit that misses ends the move.Code
Twineedle hits twice because its branch stores the value of a poison side-effect constant, which is 2, as the hit count, along with making it the move's effect.Code
Music driverThe sound engine runs once a frame from the vertical blank handler. On the four music channels a note lasts ⌊((ℓ⋅smod256)⋅T+f)mod65536/256⌋ frames, where ℓ is its length in 16ths, s the channel's note speed, T the song's 16-bit tempo, and f the channel's leftover fraction, which the low byte carries to the next note: the product ℓ⋅s keeps only its low byte, and the sum only 16 bits. The sound-effect channels use the sound-effect tempo for T instead, and the last of them, the noise channel's, a fixed $0100.Code
Password and battery savePokémon Red and Blue keep one copy of the game in battery-backed cartridge RAM (the player's name, the main data, the map's sprites, the party, the current PC box, and one byte for tile animations), followed by a check byte that is the complement of the 8-bit sum of all those bytes.Code
When Pokémon Red and Blue load, they recompute the save's one check byte over all the saved game data before copying each of three parts (the first check is tried twice before giving up), and on a mismatch print "The file data is destroyed!", wait 100 frames, and set the save status to 1, which the main menu treats as no save file. The failure path doesn't write to the save: the check turns cartridge RAM off before it returns, so before the message prints, and the path's one store is the status byte, in work RAM.Code
Random encounterIn caves, Pokémon Tower, the Power Plant, and Pokémon Mansion every step off water can start a wild battle; on routes, in Viridian Forest, and in the Safari Zone only a step in grass or on water can. A turn rolls as a step does: pressing a direction other than the last one walked, from standing, first turns the player in place, and the same check runs on the tile the player stands on, before any step. The tile decides: the tileset's grass tile rolls against the map's grass rate and a water tile ($14) against its water rate. Any other tile rolls against the grass rate on an indoor map, by map number, unless the map uses the forest tileset, as Viridian Forest and the four Safari Zone areas do; outdoors it doesn't roll. Only the overworld, forest, and plateau tilesets have a grass tile.Code
On a shore half-block whose water lies only at its bottom right, such as Cinnabar Island's east coast (by the comment), a step rolls at the water rate but meets a Pokémon from the grass list. The rate comes from the half-block's bottom-right tile and the list from its bottom-left tile: the water list only when that tile is water ($14) as well, the grass list otherwise.Code
Surfing on open water meets only Tentacool, of levels 5 to 40, on Routes 19, 20, and 21: theirs are the only water lists. Every other map loads a water rate of 0, which no random byte is below, the water in Seafoam Islands and Cerulean Cave included; the water tile is $14 in every tileset that has water (by the comment). A left-shore half-block rolls at the water rate but draws from the grass list.Code
The slot byte picks slot 0 for 0–50, 1 for 51–101, 2 for 102–140, 3 for 141–165, 4 for 166–190, 5 for 191–215, 6 for 216–228, 7 for 229–241, 8 for 242–252, and 9 for 253–255. The slot table holds each slot's running total of chances less 1, and the byte takes the first slot whose entry it doesn't pass; the step then reads that slot's level and species from the list.Code
Some steps can't start a wild battle wherever they are: the two after a battle, a step while a character's scripted movement runs, a ledge jump, a step out of a door, a step that ends on a door or warp tile, and a step past the map's edge. A turn in place runs the same check and the same limits hold for it, but a turn doesn't count the post-battle cooldown down, since only a finished step does: during the cooldown a turn neither rolls nor shortens it. Those steps and turns also leave a Repel's count alone.Code
A Repel lasts 100 steps, a Super Repel 200, and a Max Repel 250, counted on every step, and every turn in place, that the encounter check runs on, in towns and on paths as well as in grass. Using one outside battle sets the count, replacing what was left. On the step or turn the count reaches 0 the game prints "REPEL's effect wore off." and meets nothing.Code
While a Repel lasts, a wild Pokémon below the level of the first Pokémon in the party is turned away, and one at that level or above still appears, so battles come less often. The rate roll and the slot pick run first and are unchanged: a Repel alters neither how often they turn up a Pokémon nor which one, and a slot below the leader's level then ends the step with no battle. The first Pokémon's level counts even if it has fainted.Code
In Viridian Forest a Pikachu takes about 620 steps of grass on average, in either version, and a Repel only makes it rarer (computed). A grass step starts a battle 8 times in 256, once in 32 steps; 14 in 256 battles are a Pikachu (slot 8 at level 3, 11 in 256, and slot 9 at level 5, 3 in 256), so one comes every 18.3 battles, 585 steps, plus 2 steps of cooldown after each of the 17.3 battles before it. With a Repel and a first Pokémon of level 4 or 5, the level-3 Pikachu is turned away, and the walk grows to about 2,800 steps; above level 5 no Pikachu gets through. A turn in place in the grass rolls as a step does and counts here as one; the 2 steps of cooldown are steps walked, since a turn doesn't count them down.Code
On Mt. Moon 1F a Clefairy takes about 2,350 steps on average, and a Repel saves few of them (computed). Every step there rolls at rate 10, and Clefairy has only slot 9, 3 in 256 at level 8, so one comes every 85.3 battles. With a Repel and a level-8 first Pokémon, the slots below level 8 are turned away: one Clefairy in 60 battles instead, and about 2,300 steps, since a Repel spares battles and their 2 steps of cooldown, not the steps between them. A turn in place rolls as a step does and counts here as one; the 2 steps of cooldown are steps walked, since a turn doesn't count them down.Code
A battle comes once every 256 ÷ rate rolls on average, a roll being a step, or a turn in place, where the tile rolls: about 8.5 in the Safari Zone (rate 30), 10.2 on Route 1 (25), 32 in Viridian Forest (8), and 51.2 on water (5), plus the 2 steps of cooldown after each battle (computed).Code
The Old Rod always gets a bite, and it is always a level-5 Magikarp.Code
Wherever a rod works, a Good Rod cast gets a bite one time in three, a Goldeen or a Poliwag equally (counting each random byte as equally likely and each draw as independent). An odd byte ends the cast with no bite; an even byte bites when its next two bits make 0 or 1, picking that entry, and draws again otherwise, so 64 of the 192 values that end a cast bite.Code
The Super Rod's lists give 33 maps two to four entries each, 109 rows in all, the same in both versions; on any other map it finds nothing. Ten lists are shared among those maps, and every entry is level 15 except Cerulean Cave's and Route 23's four at level 23, Celadon City's and Route 10's Poliwhirl and Fuchsia City's Seaking at 23, and a level-5 Tentacool on Routes 12, 13, 17, and 18. Its only Dratini are in the Safari Zone.Code
A Super Rod cast bites half the time on a map whose list has four entries, 3 times in 7 with three, and once in 3 with two, every entry equally likely (counting each random byte as equally likely and each draw as independent). An odd byte ends the cast with no bite; an even byte's next two bits pick an entry, and a number past the map's list draws again.Code
A rod works only outside battle, facing water or a shore (at Vermilion Dock, water only), and not while surfing. A bite starts its battle at once, without the step's checks, so neither the cooldown after a battle nor a Repel stops a hooked Pokémon.Code
A step, or a turn in place, that can meet a wild Pokémon finds one when a random byte is below the map's encounter rate, out of 256: Route 1's grass rate is 25, so a step in its grass finds one 25 times in 256.Code
A second random byte, which the generator updates along with the first, then picks one of the map's 10 slots, which have 51, 51, 39, 25, 25, 25, 13, 13, 11, and 3 chances in 256.Code
After any battle, including one that ends in a blackout, the first two steps once the map reloads can't start a wild battle and the third can (computed). Every battle's end sets a cooldown flag; the map then reloads (after a blackout, at the place the warp sends the player), and a map load with the flag set sets a counter of 3. Each step not taken under scripted movement counts it down while the flag is set, clearing the flag when it reaches 0, and a wild battle can't start while it is above 0. A step's countdown runs before that step's encounter check.Code
Random number generatorThe random-number update routine adds the hardware divider register to one byte with carry and subtracts it from a second byte with borrow; the VBlank handler calls it every frame, and the routine games call to get a random number returns the first byte.Code
The battle random routine calls the ordinary random routine outside link battles; in a link battle both Game Boys read the first 9 bytes of a shared 10-byte list in turn, and after the ninth read those 9 are each replaced by 5x+1mod256; the tenth byte is never read.Code
Sampled soundChannel 3 plays one of six 32-step waveforms, numbered 0 to 5. A song command picks one with its low nibble, and on each note the engine stops the wave channel, copies the 16 bytes into wave RAM, and starts it again.Code
Same-type attack bonusThe type-adjustment routine applies STAB before any type row: damage+⌊damage/2⌋ when the move's type matches either attacker type.Code
Turn orderQuick Attack moves first and Counter last unless both sides chose the same one; otherwise the Pokémon with higher Speed moves first, and a tie goes either way with probability 1/2.Code
Type effectivenessRed and Blue's type chart has 82 non-neutral (attacker, defender, multiplier) rows over 15 types, ended by -1; unlisted pairs are neutral.Code
Multipliers are integers scaled by 10 (20 for “super effective”, 05 for “not very effective”, and 00 for no effect); the table never uses 10 (effective) or 15 (more effective).Code
In table order, each type chart row matching the move's type and either defender type sets damage to ⌊damage×value/10⌋; 0 marks a miss.Code
Under two ½ rows (×¼), 2 or 3 damage truncates to 0 and the move misses; 4 damage gives 1.Code
Truncating after each row can cost a hit that nets ×1 damage when its ½ row comes first: Ice against Water/Flying takes 3 to ⌊3 × 5 / 10⌋ = 1, then ⌊1 × 20 / 10⌋ = 2, not 3.Code
The Red/Blue type chart gives Ghost-type moves no effect on Psychic types.Code
In Red and Blue, a Saffron Gym trainer's after-battle line, “Psychic #MON fear only ghosts and bugs!”, contradicts the game's own type chart, under which Ghost-type moves have no effect on Psychic types.Code
Bulbapedia reports that “an abundance of evidence suggests” the Gen 1 Ghost → Psychic ×0 “may have been an error”.Wiki
Each matching row overwrites one damage-multiplier byte, so the text follows the last row: above 10 is “super effective”, below 10 “not very effective”, and a miss reads “doesn't affect” only at 0.Code
An Ice move against a Water/Flying Pokémon nets ×1 damage, a ½ row and then a 2× row, yet prints “It's super effective!”, since the message reads only the last matching row's value, 20, and compares it with 10.Code
Earthquake against a Rock/Flying Pokémon does 0 damage and prints that the attack missed, not “It doesn't affect”: the Ground-against-Flying row (×0) zeroes the damage and makes the move miss, but the message reads the last matching row's value, Ground against Rock's ×2, and only a 0 there picks “doesn't affect”.Code
Moves on the set-damage list (Sonic Boom, Seismic Toss, Dragon Rage, Night Shade, Psywave, and Super Fang) jump to the hit test, skipping the base-damage routine and the type-adjustment routine, the only damage routine that reads the type chart.Code
The trainer AI's type-effectiveness lookup stops at the first row matching either defender type, ignoring dual-type products.Code
The type constants still define a Bird type ($06), with a name string, but no type chart row names it.Code

References

  1. ^WikiBulbapedia, “Pokémon Red and Green Versions” · Bulbapedia, “Pokémon Red and Blue Versions”
    How we know

    Pokémon Red and Green came out in Japan on 27 February 1996; the English Red and Blue (developer Game Freak, publisher Nintendo, Game Boy, and Generation I core series) followed in North America on 28 September 1998.

    Japan: February 27, 1996 … (Game Boy)
    infobox, Release dates · archived copy ↗
    Developer: Game Freak … Publisher: Nintendo … Part of: Generation I core series … North America: September 28, 1998 … (Game Boy)
    infobox, Basic info and Release dates · archived copy ↗

    Claim page

  2. ^Codepret/pokeredtype_matchups.asm 1–85; type_constants.asm 1–28
    How we know

    Red and Blue's type chart has 82 non-neutral (attacker, defender, multiplier) rows over 15 types, ended by -1; unlisted pairs are neutral.

    1TypeEffects:
    2	;  attacker,     defender,     *=
    3	db WATER,        FIRE,         SUPER_EFFECTIVE
    ⋮
    85	db -1 ; end
    
    data/types/type_matchups.asm lines 1–85 at af51989 · upstream ↗
    constants/type_constants.asm#L1-L28 · upstream ↗

    Claim page

  3. ^Codepret/pokeredcore.asm 5127–5185
    How we know

    In table order, each type chart row matching the move's type and either defender type sets damage to ⌊damage×value/10⌋; 0 marks a miss.

    5161	call Multiply
    5162	ld a, 10
    5163	ldh [hDivisor], a
    5164	ld b, 4
    5165	call Divide
    
    engine/battle/core.asm lines 5127–5185 at af51989 · upstream ↗

    Claim page

  4. ^Codepret/pokered · Bulbapedia, “Type/Type chart”type_matchups.asm 78
    How we know

    The Red/Blue type chart gives Ghost-type moves no effect on Psychic types.

    78	db GHOST,        PSYCHIC_TYPE, NO_EFFECT
    
    data/types/type_matchups.asm line 78 at af51989 · upstream ↗
    Ghost was made 2× against Psychic instead of 0×.
    Changes: Between Generations I and II · archived copy ↗

    Claim page

  5. ^Codepret/pokeredcore.asm 5147–5153, 3718–3733, 3218–3229; display_effectiveness.asm 1–10
    How we know

    Each matching row overwrites one damage-multiplier byte, so the text follows the last row: above 10 is “super effective”, below 10 “not very effective”, and a miss reads “doesn't affect” only at 0.

    5150	ld a, [hl] ; a = damage multiplier
    5151	ldh [hMultiplier], a
    5152	add b
    5153	ld [wDamageMultipliers], a
    
    engine/battle/core.asm lines 5147–5153 at af51989 · upstream ↗
    2	ld a, [wDamageMultipliers]
    3	and $7F
    4	cp EFFECTIVE
    
    engine/battle/display_effectiveness.asm lines 1–10 at af51989 · upstream ↗
    engine/battle/core.asm#L3718-L3733 · upstream ↗
    engine/battle/core.asm#L3218-L3229 · upstream ↗

    Claim page

  6. ^Codepret/pokeredwild_encounters.asm 26–53; Route1.asm 1–2
    How we know

    A step, or a turn in place, that can meet a wild Pokémon finds one when a random byte is below the map's encounter rate, out of 256: Route 1's grass rate is 25, so a step in its grass finds one 25 times in 256.

    engine/battle/wild_encounters.asm at af51989
    Our readingthe step's tile picks the rate (not all quoted)26–33a random byte not below the rate: no battle50–53
    1Route1WildMons:
    2	def_grass_wildmons 25 ; encounter rate
    
    data/wild/maps/Route1.asm lines 1–2 at af51989 · upstream ↗

    Claim page

  7. ^Codepret/pokeredtype_constants.asm 11; names.asm 40
    How we know

    The type constants still define a Bird type ($06), with a name string, but no type chart row names it.

    11	const BIRD         ; $06
    
    constants/type_constants.asm line 11 at af51989 · upstream ↗
    40.Bird:     db "BIRD@"
    
    data/types/names.asm line 40 at af51989 · upstream ↗

    Measured by a script. It fails if the result disagrees with the claim.

    Claim page

Sources

Code

Secondary