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

The exact reason why unstable missingno crashes. - Page 1

The exact reason why unstable missingno crashes.

Posted by: Torchickens
Date: 2014-11-16 15:34:06
This is just a question I'd like to raise, out of interest and maybe for something practical. Is there some way without cheats or tools to control whether a regular Missingno. (not fossil or ghost) you get from Trainer-Fly will freeze the game?

I've noticed a difference in effects if I invert the sprites by viewing the sprite of a glitch Pokémon before encountering Yellow Missingno. I also tried Missingno. sprites from 'different banks', but I forgot Missingno.'s sprite pointer, it could be in bank 0 which would make the bank irrelevant or if it's actually the sprite dimensions that matter.

I know that getting regular Missingno. doesn't have much use. The fossil and ghost Missingno. can also duplicate your items. But it may be significantly easier to get an applicable lower Special than 181-183.

Additionally, regular Yellow Missingno.'s extremely high experience cap makes it an ideal donor for merging two Pokémon together. You can get a "perma" level 255 Missingno./X-x hybrid this way, and the base stats would be those of X-x's.

I do have a solution to my problem. You can do the item underflow glitch by encountering a fossil or ghost Missingno. first and getting a stack of 255 Potions, get the items for Lol glitch and then do a Lol glitch here (nets you a hex:43 Missingno.)

[img]http://i3.minus.com/i4w0kOnR4Pk0.png[/img]

But for what I want to do, I thought encountering fossil and ghost Missingno. and getting the lol glitch items would take significantly longer than successfully getting/seeing regular Missingno. (incidentally ExtraTricky's double Trainer-Fly method apparently gives you a 1/8 chance of encountering a special Missingno. if you do a double Trainer-Fly with the level 80 Starmie from the Cubone for Machoke trade).

Edit: Remaining HP glitch may also be able to give you regular Missingno. or a Pokémon with the CoolTrainer move as move 1 for Yellow's only CoolTrainers (Missingno. and Horsea). It's a shame that box 1 has to never have been filled for that.

Re: The exact reason why unstable missingno crashes.

Posted by: Bert
Date: 2014-11-16 16:06:57
Yellow MissingNo is one volatile dude.

In my experience, I've had the most luck with the Channelers in Pokémon Tower. I think several (at least 3) of the Fishermen on Route 12 will spawn MissingNo and have a very low chance of freezing/crashing the game.

Re: The exact reason why unstable missingno crashes.

Posted by: Torchickens
Date: 2014-11-16 16:17:36

Yellow MissingNo is one volatile dude.

In my experience, I've had the most luck with the Channelers in Pokémon Tower. I think several (at least 3) of the Fishermen on Route 12 will spawn MissingNo and have a very low chance of freezing/crashing the game.


Thanks for the tip. I tried a Channeler but unfortunately still got freezes. I'll try the Fishermen next.

If you want to look up the Trainer yields, I recommend this huge image, but it's not fully accurate for Yellow due to roster changes between Red/Blue and Yellow.

Edit: I'm not getting much different results. It could be something specific in the memory that's affecting it, but I'm not very good at using a debugger. Bert, can I use your save if you've got one where it works, please?

Re: The exact reason why unstable missingno crashes.

Posted by: Bert
Date: 2014-11-16 16:27:53
…Everything I said suddenly becomes hypocritical since I can't even test this myself. My Yellow Version is still a glitchy mess and Trainers still send out level 0 Pokémon with boatloads of HP. That's assuming I can even fly to one of those locations instead of getting thrown into battle against a Trainer after choosing 'Fly.'

It's all based on my memory anyway.

That's a great image! Kudos to the creator.

Re: The exact reason why unstable missingno crashes.

Posted by: Torchickens
Date: 2014-11-16 16:30:16
Oh, OK. Thanks anyway. Incidentally on my BGB save I get "Missingno. is trying to learn", while on my VBA save I just get a freeze. I've yet to test if it's due to me using different emulators or if there's something about my save that's causing the differences.

Edit: Huh, that gives me an idea. Maybe I should open my Pokémon menu in that Celadon Mansion anti-Super Glitch spot, then immediately cheat a Missingno. by altering D058 (011F58D0). I know this is likely completely unrelated though.
Edit 2: Nope, didn't work lol. I should try using BGB debugger, even though I'm not too experienced with it.
Edit 3: It's not ''completely'' unpredictable, because from the same state I've got the game trying to run the same invalid opcode in the ROM (3F:6BE9) even after waiting a little/doing things before closing the menu. I was doing what I did above though in the anti Super Glitch spot.
Edit 4: The game apparently did a 'call 6BD4' at 0:2314 to get to that invalid opcode.

Edit 5: So I was tracing through things, and the game was doing this to this sprites (drawing blackness and moving sprites down). The game repeated the code at RO2F:7482 a lot, where there is a jr nz, 7482 at 2F:7486.

[img]http://i2.minus.com/ijTYpwzqxTQ2J.png[/img]
[img]http://i5.minus.com/ifElySFAfTuAA.png[/img]

Re: The exact reason why unstable missingno crashes.

Posted by: luckytyphlosion
Date: 2015-02-28 17:37:38
Today, I decided to look into unstable missingno once again, and this time, I found something interesting and very useful.

Unstable Missingno's sprite is too large, so it overflows into WRAM, and corrupts the audio addresses. Through some breakpoints (and a bit of luck), I was able to track down the cause of the crash.

The crash is due to wC0EF being overwritten, where wC0EF is a value that determines the music rom bank. The new ROM bank swapped to will most likely cause a crash, unless you get really lucky because for some reason, wC0EF can be "random". The randomness appears to be set every time you perform the tfly, but I don't know what exactly causes the randomness.

To see which ROM Bank is swapped to, simply put a(n) jump/execute breakpoint to 22EC.

Re: The exact reason why unstable missingno crashes.

Posted by: SatoMew
Date: 2015-02-28 17:48:15
I don't know if you've watched it but Crystal_ has a video series on MissingNo.

https://www.youtube.com/playlist?list=PLLvtRtlPBbbir2XWF9T5UhGnOsYhJbD2Y

Re: The exact reason why unstable missingno crashes.

Posted by: luckytyphlosion
Date: 2015-02-28 17:59:01
Oh, that video series documents about Red/Blue Missingno, which is different than Yellow Missingno. Yellow Missingno is infamous for crashing the game once it slides across the screen. The audio usually becomes corrupted too.

Re: The exact reason why unstable missingno crashes.

Posted by: SatoMew
Date: 2015-02-28 18:01:55

Oh, that video series documents about Red/Blue Missingno, which is different than Yellow Missingno. Yellow Missingno is infamous for crashing the game once it slides across the screen. The audio usually becomes corrupted too.


Oops! I misunderstood the variant of MissingNo. you were referring to. My bad.

Re: The exact reason why unstable missingno crashes.

Posted by: Torchickens
Date: 2015-03-01 07:14:27
Merged because there was an existing thread related to this.

That is pretty enlightening, simply C0EF (and C0F0)!

Without any deeper knowledge, I will just speculate as food for thought:

Maybe there is a way to have Yellow Missngno. never freeze the game, if the value it becomes is not too random (and if you can change it to 02, 08, 1F, 20; valid sound banks or any 'safe for running from/catching Yellow Missingno.' glitch value).

Maybe if you can anticipate that the value is going to change to a glitch bank, then certain glitch banks will end up executing code in writable memory?

Re: The exact reason why unstable missingno crashes.

Posted by: camper
Date: 2015-03-01 11:39:50
Yellow Missingno. has a 10x13 sprite that's just enough to corrupt a small part of WRAM but not ALL of it like those #205 Pokemon in Red/Blue with 5x256 sprites. Its front sprite pointer is 0x0006 though, which is supposed to be constant, so it's the decompressing process that's varying…

Re: The exact reason why unstable missingno crashes.

Posted by: luckytyphlosion
Date: 2015-05-18 15:49:38
After looking at Unstable/Yellow Missingno again, I've finally found out why it exactly crashes the game. Here's a summary of the first discovery, which I already covered in the previous post.



So if Unstable Missingno's Sprite overflows into WRAM, but the sprite data is clearly taken from ROM, then why do the effects seem random when encountering it?

The "randomness" of Unstable Missingno is (unsurprisingly) caused by the content of unused SRAM, more specifically $BF66 and $BF67. When the game decompresses Missingno's sprite, it clears the sprite buffers, but not the unused SRAM. This means that the bytes copied to the Music Banks will always be different. I'm not familiar with the decompression function, so I'm not exactly sure if other sram portions affect whether Unstable Missingno would crash or not.

In order to make Missingno stable, one would need to repeatedly encounter it until the SRAM bytes become re-written in a way that would write a stable music bank.

Re: The exact reason why unstable missingno crashes.

Posted by: camper
Date: 2015-05-20 02:30:21

After looking at Unstable/Yellow Missingno again, I've finally found out why it exactly crashes the game. Here's a summary of the first discovery, which I already covered in the previous post.


    [li]Unstable Missingno's Sprite has quite enormous dimensions (8x10 iirc?), which overflows into music and sprite related data. wc0ef and wc0f0 mark the bank in which the current music is stored in, so when its sprite is decompressed, those addresses are overflowed, which causes the game to run through garbage data and ultimately crash the game.[/li]


So if Unstable Missingno's Sprite overflows into WRAM, but the sprite data is clearly taken from ROM, then why do the effects seem random when encountering it?

The "randomness" of Unstable Missingno is (unsurprisingly) caused by the content of unused SRAM, more specifically $BF66 and $BF67. When the game decompresses Missingno's sprite, it clears the sprite buffers, but not the unused SRAM. This means that the bytes copied to the Music Banks will always be different. I'm not familiar with the decompression function, so I'm not exactly sure if other sram portions affect whether Unstable Missingno would crash or not.

In order to make Missingno stable, one would need to repeatedly encounter it until the SRAM bytes become re-written in a way that would write a stable music bank.


Unstable Missingno. has a dimension of 11x13.

So does it mean once you encounter Missingno. once in a save and it doesn't crash, it's safe to encounter it again?

Re: The exact reason why unstable missingno crashes.

Posted by: Crystal_
Date: 2015-05-22 10:31:32
The problem with Yellow MissingNo is not its 10x13 sprite size at 0x39fcc (base stats data), but the first byte of its sprite data which is also supposed to be the sprite size. This size value is used during the decompression while the one in the base stats data is used during the "post-decompression" to determine how to arrange and where to place the decompressed chunks of the sprite on the screen. This is all I know though.

Yellow MissingNo.'s frontsprite pointer points to 0x0006 which is 0x00. This means both height and width of 0. These width (high nybble) and height (low nybble) values are multiplied by 8 and saved to W_SPRITEWIDTH and W_SPRITEHEIGHT. I don't really know what happens from here but if you change 0x0006 to anything between 0x01 to 0xFF (i.e. anything not 0 width AND 0 height) everything will be fine other than the well-known HoF corruption which is still very far from reaching WRAM.

Re: The exact reason why unstable missingno crashes.

Posted by: Spoink
Date: 2017-03-17 20:16:56

Unstable Missingno. has a dimension of 11x13.


Wrong, 10x13. (Wow, bumping an entire thread just to add that little note.)