Glitch City Laboratories Forums

Lab γ: Video Games and Glitches Discussion => Generation I Glitch Discussion => Pokémon Glitch Discussion => Arbitrary Code Execution Discussion => Topic started by: NunoLava1998 on April 24, 2016, 10:05:59 am

Title: Increment a byte in RAM: Crash (Pokémon Blue)
Post by: NunoLava1998 on April 24, 2016, 10:05:59 am
I found that, in RAM at FF80 (Pokémon Blue), incrementing the first byte by 1 will crash the game. But, if you increment the first 3 bytes, some stuff dissapears.



That's how sensitive Pokémon Blue is. Yep.
Title: Re: Increment a byte in RAM: Crash (Pokémon Blue)
Post by: danny on April 24, 2016, 11:49:21 am
FF80 is actually part of the ROM that is mostly the same in all gb games
Title: Re: Increment a byte in RAM: Crash (Pokémon Blue)
Post by: NunoLava1998 on April 26, 2016, 05:01:00 am
Also, at FF80, if you change the 9th byte to FF, the game will crash. For some reason, FE and below doesn't crash the game. But FF just crashes the game for no reason.
Title: Re: Increment a byte in RAM: Crash (Pokémon Blue)
Post by: danny on April 26, 2016, 02:34:05 pm
Also, at FF80, if you change the 9th byte to FF, the game will crash. For some reason, FE and below doesn't crash the game. But FF just crashes the game for no reason.
0xFF actually calls ROM address $0038, which is an 0xFF opcode. You can see why it crashes.
Title: Re: Increment a byte in RAM: Crash (Pokémon Blue)
Post by: NunoLava1998 on April 27, 2016, 01:04:04 am
And in 0040, if you replace the first byte with FF the game crashes.

And it didn't say "Unknown opcode FF at 0038", it just went to that line type of crash.
Title: Re: Increment a byte in RAM: Crash (Pokémon Blue)
Post by: Hālian on April 27, 2016, 01:53:05 am
Because opcode ff is known — it's rst $38. And what's at 0038? Always ff. So the stack floods with an unending deluge of 39.
Title: Re: Increment a byte in RAM: Crash (Pokémon Blue)
Post by: ISSOtm on April 27, 2016, 04:26:24 pm
Literally unending. (Hopefully the values written to ROM don't enable SRAM edition, otherwise... meh)

(Fake) hysterical time : Why didn't they just put a simple ret there ? Aw yeah, I forgot how many glitches exist in Gen I games thanks to wonderful programming. They should get a special award for these. I love these games : "Sup guyz, for the first three champions the data structure {beaten, TM got} is this one" "But I want this completely different one now !" "Okay, but I'm too lazy to change back the previous."
Title: Re: Increment a byte in RAM: Crash (Pokémon Blue)
Post by: Wack0 on April 27, 2016, 04:53:39 pm
(Fake) hysterical time : Why didn't they just put a simple ret there ?

probably they had a breakpoint set there when debugging.
Title: Re: Increment a byte in RAM: Crash (Pokémon Blue)
Post by: ISSOtm on April 28, 2016, 12:24:58 am
Makes no sense to me, but maybe...