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

Infinite T-Fly/Rival CT, 9F the Stack Overflow Item and "8 8" the Vblank Item. - Page 1

Infinite T-Fly/Rival CT, 9F the Stack Overflow Item and "8 8" the Vblank Item.

Posted by: luckytyphlosion
Date: 2015-01-17 21:05:38
I'd put this in a new post, but I feel it's probably better to put it in a new post.


[size=18pt]8CT-Fly/Infinite T-Fly + Rival CT/whatever you want to call it[/size]
Today, the 151 Glitchers were looking into Infinite T-Fly/Rival CT, where you can create a Cooltrainer/Lol Glitch based on the screen tiles using Rival CT, and then continually getting encounters to LG off of by using the Infinite T-Fly glitch.

For now, there isn't a video, so I'll post a link one it gets uploaded.

Another thing I want to talk about, is what 9F actually does.

[size=18pt]The Case of 9F[/size]

Usually, we've used 9F to go to the overworld in a Battle. I decided to look at what exactly 9F does (to make sure if it's safe for the 151 run), and I found it very interesting.

Basically, 9F goes through some warp checks, and after, it jumps to the overworld loop. However, it never actually returns. So basically 9F will continually add to the stack, until it eventually overflows into box nicknames. This can be a problem if you're catching pokemon, like with the 8CT-Fly, or if you switch box.

Usually, the game crashes after catching around 8-9 Pokémon, but it varies depending on how lucky you are with how stack corruption lines up with Pokemon Names + OT Names (or if you're super lucky, Pokemon Stats)

[size=18pt]8 8[/size]

8 8 is also used to generate the Infinite Trainer-Fly, but we never figured out what the effect was, as it ranged from running at ROM4 at 50BF (iirc), or generating the encounter as normal. Again, I decided to look into the item's execution path.
What's interesting about this item is that it lands in the VBlank Interrupt, right at 203D. This means the item effect is based on the VBlank Functions, as well as the return address of where the UseItem function was called. However, since you're dealing with corrupted registers (since you use the four addresses on the stack as the new values for all the registers), the effects of 8 8 depend on the values on the stack.

EDIT: I just realized that the return address of 8 8 depends on the next item on the stack after popping hl, de, bc and af. So it doesn't return like 9F, but it pops 8 bytes off the stack though.

Re: Infinite T-Fly/Rival CT, 9F the Stack Overflow Item and "8 8" the Vblank Item.

Posted by: Torchickens
Date: 2015-01-17 22:24:21
Nice research.

Oh, you can use Rival CoolTrainer and Infinite Trainer-Fly combined? That's cool!

I haven't got a video of that combination, but I have videos of them separate.

https://www.youtube.com/watch?v=HwnymX80ZMc - Rival CoolTrainer
https://www.youtube.com/watch?v=Wz8MH9cfusQ ; - Infinite Trainer-Fly chain

So do you use Rival CoolTrainer to manipulate the initial Pokémon you get from the infinite Trainer-Fly chain? (via Special stat of the Pokémon you catch with CT or out of battle?)

Edit: For people who don't know, 8 8 (hex:7C) has the same unlimited Trainer-Fly yield enabling effect because you in-fact are using the item. The Super Glitch (TMTRAINER) item's long internal name corrupts CF91 (item effect) with the screen tile at y=0A, x=02 (always a menu tile that's 7C), and Viridian Forest's initial entrance spot from the south has a suitable 50 tile.

Re: Infinite T-Fly/Rival CT, 9F the Stack Overflow Item and "8 8" the Vblank Item.

Posted by: luckytyphlosion
Date: 2015-01-17 22:52:45
Yes, that's exactly what happens.

The glitch is hard to explain without a video because of all the complications (there are a lot), and Shenanagans is uploading a video, so I'd rather wait until the video is uploaded before explaining it. (I'm also tired and can't type much now, so I don't have time to type a full-fledged explanation)

Re: Infinite T-Fly/Rival CT, 9F the Stack Overflow Item and "8 8" the Vblank Item.

Posted by: Torchickens
Date: 2015-01-17 22:59:52
I can imagine. It would have to be complicated if you want every Special stat (well except Specials 1-4, but you could get 257-260 etc.), with species, level and Special DV being manipulable values, I don't know which ones you could change to anything other than species and how to go about doing it though.

OK, get some rest. You need it. I am tired too as I'm staying up late and should not be really. Been testing Generation IV glitches for a long time today.

Re: Infinite T-Fly/Rival CT, 9F the Stack Overflow Item and "8 8" the Vblank Item.

Posted by: luckytyphlosion
Date: 2015-01-18 10:55:40
Shenanagans posted a video here: https://www.youtube.com/watch?v=bv5OITisjuI

[size=6pt](can someone just give it a [size=1pt]Safe for GCLF[/size] name already)[/size]

Re: Infinite T-Fly/Rival CT, 9F the Stack Overflow Item and "8 8" the Vblank Item.

Posted by: Torchickens
Date: 2015-01-19 18:55:55
Well it is:
Instant Glitch City + infinite Trainer-Fly chain + Rival tile writing name glitch item + LOL glitch.

I don't like the name LOL glitch too much personally. Because as applied here you can escape from battle with 9F and in Yellow you could do it more efficiently with -gm rather than Lg- anyway. Plus Lg- is responsible for more glitches like causing Trainer battles to repeat and Pikachu to stay. I would call LOL glitch "Super Glitch item out of battle capture trick", unfortunately that's a pretty long name.

It seems difficult to provide a descriptive name for this glitch. The suggested "f**k CT Glitch" (I'm no fan of bad language but it works) is clever, "Fly Until (you) Completely Kill CoolTrainer Glitch" but I still don't fully like it. Although you are getting Trainer-Fly yields, it implies you are actually Flying away, Teleporting, etc. every iteration of the glitch.

I think an alternative would be "Rival name encounter chaining" or simply "(Speedrunning) Cooltrainer Killer".

This is a complicated trick, but at the same time it seems like it may be easy to get used to.

Everything works together doesn't it? -

Trainer-Fly - to set up an initial Pokémon yield when you go below Saffron.
Instant Glitch City - needed for the screen data for LOL glitch (via Super Glitch item) to work, and for a place with a suitable hex:53 tile (for printing the Rival's name).
9F - opening the menu from within battle; updating screen data.
Rival tile writing name glitch item - needed for control of the Pokémon you LOL glitch.
Suitable Rival's name - value controlling species can be manipulated - thanks to item underflow it can be manipulated.
LOL glitch (via Super Glitch item) - needed for obtaining Pokémon out of battle, and the initial battle makes it work.
Infinite Trainer-Fly (via 8 8) - for chaining encounters.

Re: Infinite T-Fly/Rival CT, 9F the Stack Overflow Item and "8 8" the Vblank Item.

Posted by: luckytyphlosion
Date: 2015-01-20 19:55:07
Yeah, there's no "actual" offical glitch name. I was thinking of using "CT-Fly", but LG-Fly describes it better. You could say "RivaLG-Fly, Rival CT-Fly, RivaLG T-Fly, etc." too, but I'm not so good at making new glitch names. Dabomstew actually thought up of "ultraLG", which does kind of sum up the glitch. I can't really say it's "infinite", because you only have a limit before stack overflows into Box Nicknames, and then once a Pokemon Nickname overwrites the stack, the game essentially crashes.

I think around $20ish bytes are added to the stack for each encounter (for all the times you use 9F, which is 2). Again, this can only be done around 8 times before it crashes, because of the stack overflow.

Another note is that 8 8 doesn't actually have 8 bytes popped off the stack, since I checked the stack pointer after using 8 8, and it was the same value.

There isn't really any use for it in "casual" gameplay, because there are easier and safer methods to get pokemon, not to mention this is only worth it for getting Multiple Pokémon, but you'd have to plan it out before executing it.