It's possible to max out Pikachu's happiness without leaving Professor Oak's laboratory using the Potion in the player's PC.
The walking Pikachu happiness glitch occurs in Pokémon Yellow.
Using a HP recovery item such as a Potion, a status condition restoring item other than a Full Heal, or a vitamin on the walking Pikachu will increase its happiness even if it doesn't have any effect.
The happiness value can be viewed at the memory address D46F.
The happiness increases by values depending on Pikachu's current happiness. See the table below:
|Pikachu's current happiness
||Happiness increase via above methods
|0 to 99
|100 to 199
|200 to 255
Note that happiness maxes out at 255.
Using this glitch, it is possible to max out Pikachu's happiness with the Potion from the player's PC, as early as before they leave Professor Oak's laboratory.
This glitch is useful for obtaining the Bulbasaur in Cerulean City, where Pikachu's happiness must be 147 or higher for the player to be able to obtain it.