Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Generation I Glitch Discussion

Official 1st Gen (Red/Blue and Yellow) Glitch Discussion - Page 21

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: Torchickens
Date: 2014-04-13 11:31:41
Ah thanks TheZZAZZGlitch, so at least we know for sure now it's prize money related.

You've found something new. de is D07A, not D079, but D079 is valid. It turns out that it D07A is unused, and by setting it you can use it to make Trainer payouts have 5 or 6 digits! Normally by default the prize money maxes out at 9999 Pokédollars, but you should be able to get +990000 Pokédollars with 8F.

Edit: Oh, I see. 00 is written to D079 as well. Sorry.
Edit2: Wait, "ld (de), a" for 00 to D079 is in 0E:5D07, so that's unrelated.

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: TheZZAZZGlitch
Date: 2014-04-13 12:46:29
OK, I figured this out.

So, as mentioned before, every trainer has a base payout value. To calculate the trainer's winning money, the game takes the level of the last Pokemon in the trainer's roster and multiplies it by the base payout.
Glitch trainers take their base payout values from arbitrary locations, and because of that, their winning money is usually very high. For example, the glitch trainer 0xFC's winning money is 9180 Pokedollars. Next, their rosters are usually empty or very high leveled. If the last level in the roster is 0, the game is actually going to multiply the base times 256. There is no math necessary to know that 9180 multiplied by 256 is going to be way too much.

However, the programmers at Game Freak made an attempt to fix this problem: they implemented multiplication as consecutive addition (like 3*4 is 3+3+3+3). If at any point during the addition chain the payout money exceeds 9999, it gets reset back to 9999. They overlooked a very important problem though - when the subroutine resets the payout money to reasonable numbers, it moves the payout money pointer 3 bytes forward, but it is never changed back.

The procedure then basically looks as follows:



This oversight causes the game to walk through many addresses and replace them with 9999. The 1st byte is never modified, and that's why all multiples of 3 are unaffected by the glitch.

…but wait a second. When fighting the high-leveled trainers at the Cinnabar Coast the payout money is also too big, but no ZZAZZ effects occur?
The coast trainers cause memory corruption too. For example, the "Blue Ultimus" with his last Pokemon being level 215 and his base payout being 50, the winning money is equal to 10750. That means that only two bytes at address $D07C will get corrupted - but it's a change so small that it doesn't make a difference. Bad things start to happen about when the total payout of a trainer exceeds 400000.

It turns out that it D07A is unused, and by setting it you can use it to make Trainer payouts have 5 or 6 digits! Normally by default the prize money maxes out at 9999 Pokédollars, but you should be able to get +990000 Pokédollars with 8F.

The byte at $D079 is not unused. The text command used to display prize money in a textbox only supports 3-byte numbers. The empty first byte is necessary for the number to display correctly.
But yes, after the battle starts, this byte can be modified with 8F to get more than 9999 Pokedollars from a single trainer.

Also, following the recent Game Genie trend, here are some codes to fix the ZZAZZ glitch:

[tt]188-2D8-192
068-2E8-80C[/tt]

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: Kelvinv
Date: 2014-04-13 13:08:25
I've always wondered about the ZZAZZ glitch. I've always thought that it was random that only one trainer class was affected. What is the pokemon species sent out when you have no Pokemon?

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: Torchickens
Date: 2014-04-13 14:17:39

I've always wondered about the ZZAZZ glitch. I've always thought that it was random that only one trainer class was affected. What is the pokemon species sent out when you have no Pokemon?


Trainers with no Pokémon will send out a Charizard 'M or Q (FF), typically at a high level, with high HP over the maximum and afflicted with a status, including poison.

If you mean if you have no Pokémon, in Yellow you'll send out a 3TrainerPoké (00) and in Red/Blue, you'll send out what may be an 'M but the game just hangs with "Go! !". If you have usable Pokémon but all are fainted, you'll black out without sending one out.

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: SM
Date: 2014-04-14 02:26:51
Thanks for explaining about ZZAZZ glitch.
I have another question.

http://youtu.be/1zZPWEJlkpQ?t=28s

When ditto changed positions of transform and cooltrainer move(–),
ditto can use only first cooltrainer move in battle.
But when I saw other pokemon's stat(moves) in pokemon menu,
ditto can use other moves under first cooltrainer move.
And number of useable moves is depend on number of moves of other pokemon that i saw.

why does it happen?

Sorry for bad grammar. :'(

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: Kelvinv
Date: 2014-04-14 05:14:16
What causes the fact that when you use a item at a ZZAZZ trainer it ends the battle? Is it because the battle mode is overwritten with 99?

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: Torchickens
Date: 2014-04-14 06:16:26

What causes the fact that when you use a item at a ZZAZZ trainer it ends the battle? Is it because the battle mode is overwritten with 99?


Likely, but it's not the byte D057 (out of battle/wild Pokémon/Trainer). That byte is left at 02 and is located before the corruption begins.

Incidentally, (I'm going to mention this as I've only done so once or twice) the 'death Trainer' (Red) appears after battle because D12B is greater than 00, and when its first bit is checked, it means you're battling a custom (link battle) Trainer.


Thanks for explaining about ZZAZZ glitch.
I have another question.

http://youtu.be/1zZPWEJlkpQ?t=28s

When ditto changed positions of transform and cooltrainer move(–),
ditto can use only first cooltrainer move in battle.
But when I saw other pokemon's stat(moves) in pokemon menu,
ditto can use other moves under first cooltrainer move.
And number of useable moves is depend on number of moves of other pokemon that i saw.

why does it happen?

Sorry for bad grammar. :'(


I don't know. I wasn't aware of that though, thanks for mentioning it!

Your post is readable, don't worry. 포 걸

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: TheZZAZZGlitch
Date: 2014-04-14 10:31:18

What causes the fact that when you use a item at a ZZAZZ trainer it ends the battle? Is it because the battle mode is overwritten with 99?


This behavior is caused by the address $D11C. If it's changed to something other than 00, the game will end the battle immediately after using an item. It is used in Old Man's demonstration, to end the battle before the Pokedex entry appears.


Thanks for explaining about ZZAZZ glitch.
I have another question.

http://youtu.be/1zZPWEJlkpQ?t=28s

When ditto changed positions of transform and cooltrainer move(–),
ditto can use only first cooltrainer move in battle.
But when I saw other pokemon's stat(moves) in pokemon menu,
ditto can use other moves under first cooltrainer move.
And number of useable moves is depend on number of moves of other pokemon that i saw.

why does it happen?

Sorry for bad grammar. :'(


In the exact moment where you open your fight menu, the Cooltrainer move corrupts your in-battle data, and together with that, the current Pokemon's moveset.
So after opening the move list the memory gets corrupted. Then, from the game's point of view, the Cooltrainer move is no longer the first move in the list (it was replaced with arbitrary data), so you're allowed to move the cursor freely.

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: luckytyphlosion
Date: 2014-04-14 15:47:48
What do the glitch items "JACK/JOHN, GARY/ASH, RIVAL's, NICKNAME?, NAME?, etc." actually do to allow you to clip through 1 space walls and remove trainer sprites (so you can trainer-fly off of any trainer)?

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: TheZZAZZGlitch
Date: 2014-04-15 00:01:41
The game has an internal list of all items that open the Pokemon menu when used:

Moon Stone, Antidote, Burn Heal, Ice Heal, Awakening, Parlyz Heal, Full Restore, Max Potion, Hyper Potion, Super Potion, Potion, Fire Stone, Thunder Stone, Water Stone, Hp Up, Protein, Iron, Carbos, Calcium, Rare Candy, Leaf Stone, Full Heal, Revive, Max Revive, Fresh Water, Soda Pop, Lemonade, X Attack, X Defend, X Speed, X Special, Pp Up, Ether, Max Ether, Elixer, Max Elixer.

(X Attack/Defend/Speed/Special are on this list even though they don't open the party screen directly - maybe they were intended to at some point?)

Items like RIVAL's or NICKNAME? open the Pokemon menu when used, but they are not included in the list. After using such item, the game does not know that the party screen was opened, so it does not close it after using the item.

After using RIVAL's/NICKNAME?/etc. and exiting back to overworld, 'half of the game' is thinking that you're in the Pokemon menu, while the other half thinks you're in the overworld. It can be compared to the surfing glitch, where some parts of the game think you're facing left, and other parts think you're facing down.
One of the side-effects is that in this state the game will not update the direction you're facing - so it's possible to move around, but the player is still facing the same direction.

This will essentially allow the player to go up while facing down. When the game checks if the block is passable or not, it just checks the block in front of the player. In the scenario presented before, the player will go up, but the collision check is done for the block below the player, thus allowing to go through the barrier.

Disappearing sprites are also the result of the game thinking you're in the Pokemon screen.

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: luckytyphlosion
Date: 2014-04-15 18:23:08
Thanks for telling me. I really wanted to know what it does so I could explain in the http://www.pokemonspeedruns.com/index.php/Pok%C3%A9mon_Red/Blue/151_Pokémon [Pokemon Catch 'Em All Info Page] I also want to thank you for discovering how to use cooltrainer to catch Pokémon, which helped a lot with saving time. :D

There are 3 minor glitches I still don't understand:

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: camper
Date: 2014-05-17 10:27:43
I just learned this the hard way:

A Pokeball is deducted from the inventory AFTER the Pokemon is caught and is registered in the Pokedex.
=> It's not applicable to get 255 Pokeballs for the Items Underflow Glitch. I should've used Potions instead…

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: snuggles08
Date: 2014-05-24 21:23:19
What memory address can I check to see if I captured a Pokemon in battle mode?

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: Kelvinv
Date: 2014-05-30 06:34:19
What causes the pokemon opponent names to not appear when having no Pokemon?

Re: Official 1st Gen (Red/Blue and Yellow) Glitch Discussion

Posted by: Lum
Date: 2014-05-30 09:49:47
In the Japanese version, why are there zero wild Pokemon encounters on the eastern Cinnabar Island coast?
I know our page on the Old Man Trick hasn't covered that yet.