Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
ItemDex

Major Glitches
Trainer escape glitch
Old man trick
Celebi trick
Select glitches (Japan)
SRAM glitch
CoolTrainer♀ corruption
LOL glitch
Super Glitch
ZZAZZ glitch
Pomeg corruption glitch (Glitzer Popping)
Tweaking
Elite Four door glitch (Japan)
Pokémon merge glitch
Pokémon cloning
Time Capsule exploit
Arbitrary code execution
Coin Case glitch
More

Other Glitch Categories
Glitches by generation
Glitches between two generations
Japan-only/language specific glitches
Music glitches
Natural glitches
Non-core series glitches
Non-Pokémon glitches
Officially acknowledged glitches
Recurring glitches
Dead glitches

References
Pokémon GameShark codes
The Big HEX List
GB programming
Curiosities
Debugging features
Easter eggs
Error traps
Glitch areas
Glitch myths
Non-glitch exploits
Placeholder texts
Pokémon glitch terminology
Unused content and prerelease information

Useful Tools
8F Helper
GBz80 to Items
Old man trick name generator
PATH (Prama's Advanced Tweaking Heaven)
Save file editors
Special stat/Pokémon converter
Trainer escape Trainer Pokémon finder

Affiliates
Legendary Star Blob 2 (Hakuda)
Pokémon Speedruns wiki
PRAMA Initiative
Become an affiliate!

Search Wiki

 

Search Forums

 

Author Topic: Need Explanations  (Read 1762 times)

0 Members and 1 Guest are viewing this topic.

Foundno.

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Need Explanations
« on: April 02, 2015, 06:21:50 pm »
You guys have helped me before, and I trust you will help me again.

I have two questions for you glitch masters to ponder:

1. Why does the Mew/Ditto glitch work? Whenever I ask this, people say "Flying away from the trainer makes the game think you're in a battle when you're not." Thanks, Captain Obvious! Why does making the game think you're in a trainer battle when you're not spawn a Pokemon? Does it change the address at D186? And why does the Special stat determine the Index Number? Why not the Defense stat? And why does the Attack stat change the Level? It just doesn't make sense.

2. What happens when you go out of bounds in English Yellow (my personal fave)? The screen turns blue with patches of green, and the menu can be partially seen in the top right corner. The top half of the menu is written in Ash and Pikachu sprites (I'm presuming the sprites and the text are related somehow, as in many glitches you or an NPC turns into letters), and the bottom half is in Japanese? Huh?

Torchickens or TheZZAZZGlitch (the best glitchers on GCL), could you give me an answer to this?

Even if you are not one of the two mentioned above, could you answer my question? I'm interested.

Háčky

  • Distinguished Member
  • *
  • Offline Offline
  • Pick which packet as an error?
    • View Profile
Re: Need Explanations
« Reply #1 on: April 02, 2015, 08:47:27 pm »
1. Why does the Mew/Ditto glitch work? Whenever I ask this, people say "Flying away from the trainer makes the game think you're in a battle when you're not." Thanks, Captain Obvious! Why does making the game think you're in a trainer battle when you're not spawn a Pokemon? Does it change the address at D186? And why does the Special stat determine the Index Number? Why not the Defense stat? And why does the Attack stat change the Level? It just doesn't make sense.
When a Trainer spots you, the game loads the Trainer class into $CD2D and team number into $CD2E, and sets a map script that will have the Trainer give his/her dialogue and start the battle. When you leave the map, the current script for that map is saved, and will be run again when you re-enter that map.

In battle, $CD0F–CD1F are used to store the stats and stat modifiers of your active Pokémon, and $CD23–CD33 are used for the enemy Pokémon. This data consists of the Pokémon’s level and unmodified stats (HP, Attack, Defense, Speed, Special), followed by the modifier stages for Attack, Defense, Speed, Special, Accuracy, and Evasion. Thus, $CD2D is the lower byte (big-endian) of the enemy’s Special stat, and $CD2E is its Attack modifier. When you return to the map where you began the glitch, the map script will read these values and start a battle against whatever Pokémon or Trainer they indicate.

Torchickens

  • Administrator
  • *****
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Need Explanations
« Reply #2 on: April 03, 2015, 06:27:21 am »
Thanks for your great explanation Háčky!

Do you know why the "!" part of Trainer-Fly disables the start menu and partially disables A and B and why these buttons aren't disabled with a death warp? I guess how it works may be so you can't press start after "!" appears, but in a death warp, after the "!" appears and the game is in the process of warping you via black out, you can use Start and A/B properly again.

I would like to add the fact that the map scripts are stored from D5F1+ onward. They are actually accessible with PC item underflow so you can create a "Trainer-Fly" with no Trainers.

A value of 01 for one of these scripts for certain maps with Trainers means that the previous text box is loaded based on the text ID in CF13 (often 00 start menu), which can be a completely different text box due the same text ID corresponding to another text box in another map. e.g. Lavender's text box 07 "We heal your Pokémon - Pokémon Center" and 07 on Route 8, a Lass battle "We must look silly standing here like this!"

If the text ID corresponds to an NPC that triggers a battle, then CD2D gets overwritten again with the intended (Trainer) battle. This occurs if you return to Viridian Forest/Route 6 immediately after the death warp, but if you have already beaten them their defeated text will appear and you will get the Special stat encounter.


2. What happens when you go out of bounds in English Yellow (my personal fave)? The screen turns blue with patches of green, and the menu can be partially seen in the top right corner. The top half of the menu is written in Ash and Pikachu sprites (I'm presuming the sprites and the text are related somehow, as in many glitches you or an NPC turns into letters), and the bottom half is in Japanese? Huh?

I think this is considered as a connection to map FF; a map that doesn't exist in itself and is written for loading the last map for a warp in an indoor map.  I do not know what goes on, but at some point usually a rst 38 is loaded (ROM:0000 did this), which points to 0038, which also contains a rst 38 (it points to itself). Going backwards from DFFB, the memory starts to get overwritten with 0039 infinitely until a freeze. You may see a black screen if an unknown opcode is run.

When I set a breakpoint to rst 38, I noticed that in blue, part of the previous location I was at (Lavender Town) was loaded and if I advanced the CPU with F9, the game would continue to load the map.



On further analysis, it is not the map but the screen data updated by opening the start menu that is loaded.
When I set a breakpoint to the memory, sometimes the game went to a place in the memory (8000-EFFF) with a rst 38, sometimes it didn't.

The start menu with sprites as text is hidden in the VRAM after you close it.
« Last Edit: April 03, 2015, 06:38:46 am by Torchickens »
Hello. I actually identify as gender questioning, but nowadays feel more firmly that I identify as female. My sex is male but I like to express myself as female.

Thank you TMTRAINER for my avatar and Aeriixion for the cute sprite! :) Roelof also made different variations of the sprite (which I animated).

Contact:

Email Youtube Twitter
Skype: Torchickens
Bulbapedia Starfy Wiki

Beyond all philosophies are the things that go best for you; what makes you feel content. It's important to always follow your heart, so unless you feel perfectly happy about it don't just follow something because it is popular, fits a style or is conventional. Sometimes you may reach a point you're not sure who you are, but as things settle I'm convinced things do work out in time.

Wack0

  • Coder, reverser, beta collector [BetaArchive staff]
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • cBRH - Doing nothing since 2k7
    • View Profile
Re: Need Explanations
« Reply #3 on: April 03, 2015, 10:10:46 am »
Somewhat offtopic, but regarding $0038 containing "rst 38".. I'm going to make a guess that when debugging, hardware breakpoints were set on $0038 so someone could use the stack to locate why a freeze happened.
C H E C K E D . B U I L D S . A R E . A W E S O M E N E S S

BetaArchiveSoftHistory Forumsirc.rol.im #galaxy,#softhistory

Also known as The Distractor.

Shane, please stop telling children that there's a Mew outside under the delivery trucks. - Management

Pokémon: arbitrary code execution 1996-2016

Háčky

  • Distinguished Member
  • *
  • Offline Offline
  • Pick which packet as an error?
    • View Profile
Re: Need Explanations
« Reply #4 on: April 03, 2015, 12:20:28 pm »
Do you know why the "!" part of Trainer-Fly disables the start menu and partially disables A and B and why these buttons aren't disabled with a death warp? I guess how it works may be so you can't press start after "!" appears, but in a death warp, after the "!" appears and the game is in the process of warping you via black out, you can use Start and A/B properly again.

Bit 0 of $CD60 is set when the Trainer spots you, and disables the Start menu and so on. It’s cleared when you win a Trainer battle, when you black out (either in- or out-of-battle), or when you save and reset.

Bit 0 of $D730 is set when an NPC starts walking, and is cleared when they’re done walking. When a Trainer spots you, the battle won’t start until this is cleared, though you can still battle Trainers by talking to them (once you can talk to them, by clearing $CD60). This is why it’s necessary to fight another Trainer who can walk up to you, or to challenge the Elite Four, which clears this flag when Prof. Oak is done walking in the ending cutscene.

Actually, it seems there’s a way to make this glitch work without fighting a Trainer at all: after using the PC to save the game and reset (as in the Elite Four method, clearing $CD60), fly to Pewter City and ask the guy next to the Poké Mart to escort you to the museum. That walking NPC will clear $D730 when he’s done, allowing the battle to start when you return to the map with the long-range Trainer.

Torchickens

  • Administrator
  • *****
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Need Explanations
« Reply #5 on: April 03, 2015, 01:18:02 pm »
Interesting, thanks a lot for your explanation.

Curiously, when bit 0 of CD60 is set although you can't open the start menu manually it can open up by itself (by returning to a route when bit 0 of D730 is clear) and once it is open you can close it with start or B. So the start button is not completely unfunctionable. Once the battle ends, CD60 is reset.
« Last Edit: April 03, 2015, 01:21:27 pm by Torchickens »
Hello. I actually identify as gender questioning, but nowadays feel more firmly that I identify as female. My sex is male but I like to express myself as female.

Thank you TMTRAINER for my avatar and Aeriixion for the cute sprite! :) Roelof also made different variations of the sprite (which I animated).

Contact:

Email Youtube Twitter
Skype: Torchickens
Bulbapedia Starfy Wiki

Beyond all philosophies are the things that go best for you; what makes you feel content. It's important to always follow your heart, so unless you feel perfectly happy about it don't just follow something because it is popular, fits a style or is conventional. Sometimes you may reach a point you're not sure who you are, but as things settle I'm convinced things do work out in time.