Main Menu
Main Page
Forums
New pages
Recent changes
Random page
Help

Glitches
Arbitrary code execution
Pokémon cloning
Pomeg glitch and Glitzer Popping
Tweaking and voiding
Glitches by generation
Other glitch categories

References/Resources
Databases
Disassembly projects
The Big HEX List
Interactive tools
Reference documents
Terminology

Affiliates
Legendary Star Blob 2 (Hakuda) (日本語/Japanese)
Pokémon Speedruns wiki (English)
PRAMA Initiative (Français/French)
MissingNo. Glitch City (Italiano/Italian)
Become an affiliate!

Technical
Site source code

Search Wiki

 

Search Forums

 

Author Topic: Two fixes for some glitch Pokemon front sprites via Gameshark  (Read 1523 times)

0 Members and 1 Guest are viewing this topic.

Nerator

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
1) This fix intended for pokemon, who have sprite size 0x0 (ex. Y:0xBF (4 4), Y:0xD9(ゥ)). This also works for RB:0xC4 (PokeWTRAINER), even though his sprite size is 5x0
Code: [Select]
0155C2D0 for Red/Blue
Code: [Select]
0155C1D0 for Yellow

2) This fix is for pokemon, whose first byte at their sprite data is 00 (ex. Yellow Missingno. and other pokemon with dex entry #0 in Yellow)
Code: [Select]
0120A3D0
0120A4D0
for Red/Blue (not sure, if such pokemon exists in R/B)
Code: [Select]
0120A2D0
0120A3D0
for Yellow

Not sure, if all this stuff was already known, just wanted to document it here.

P.S. Btw, PokeWTRAINER has a lovely cry :)

Hālian

  • That worldbuilding/micronations/MTG guy
  • Member+
  • *
  • Offline Offline
  • Gender: Male
  • Buried under a pile of OS-tans…
    • View Profile
    • Hoennese Realm
Re: Two fixes for some glitch Pokemon front sprites via Gameshark
« Reply #1 on: May 08, 2014, 03:38:41 pm »
(not sure, if such pokemon exists in R/B)
'M
The Hoennese Realm is under construction. Watch this space!



All sprites made by Naitekiakki, except:
Recolored Gardevoir made by me

Evie the Mother Hen ☽ ❤

  • Head Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • I love My Melody ✿(not really a mum but wanna be)
    • View Profile
Re: Two fixes for some glitch Pokemon front sprites via Gameshark
« Reply #2 on: May 08, 2014, 05:30:06 pm »
(not sure, if such pokemon exists in R/B)
'M

This is about the dimensions of the front sprite; the first sprite related byte in the Pokémon base stats data structure. 'Ms value for that is 8x8 blocks, so it doesn't cause a freeze, but glitch Pokémon that have a nybble of 0 in that byte may.

✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post :)
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
I am a legit yandere and I am ashamed.



(Images © Sanrio, Nintendo, Pokémon, HAL Laboratory)

✿ Hi, I'm Evie. Transgender woman but spiritually doesn't believe 'male'/'female' needs to be defined; lives more stereotypically like a woman/I'm a 'girly' nerd who discovered herself. Call me whichever pronouns you like. :)

Feel free to contact me here about anything regarding the site.

Forgiveness. I feel that the more people pray to our greatest source/God/mathematical equality for world peace, the more and more it manifests into reality (until our next spiritual death).

Thank you Nyapon for this lovely artwork. :3

MissingNoGuy55

  • Member+
  • *
  • Offline Offline
  • Gender: Male
    • View Profile
    • Steam Community
Re: Two fixes for some glitch Pokemon front sprites via Gameshark
« Reply #3 on: May 08, 2014, 06:03:39 pm »
(not sure, if such pokemon exists in R/B)
'M

This is about the dimensions of the front sprite; the first sprite related byte in the Pokémon base stats data structure. 'Ms value for that is 8x8 blocks, so it doesn't cause a freeze, but glitch Pokémon that have a nybble of 0 in that byte may.

I wonder if that's the reason why 'M and MissingNo. crash in Red/Green. Maybe the byte was changed? Cause I remember Pokémon with no front sprite crash in Red/Green.

Also, this code works nicely. It seems this code also fixes F5 (Channeler) and its back sprite which would always crash the game. This is gonna help a lot.

« Last Edit: May 08, 2014, 07:32:37 pm by MissingNoGuy55 »

Nerator

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Two fixes for some glitch Pokemon front sprites via Gameshark
« Reply #4 on: May 09, 2014, 05:26:12 am »
(not sure, if such pokemon exists in R/B)
'M

This is about the dimensions of the front sprite; the first sprite related byte in the Pokémon base stats data structure. 'Ms value for that is 8x8 blocks, so it doesn't cause a freeze, but glitch Pokémon that have a nybble of 0 in that byte may.
Not entirely true. I meant first byte in actual sprite data, where pointer, defined in base stats points to.

Let's look at Yellow Missingno., for example. Pointer to front sprite for it is 0x0006. Subroutine _UncompressSpriteData (0:251a for RB) reads first byte from there and after some math writes sprite dimensions at 0xD0A3 & 0xD0A4 (0xD0A2 & 0xD0A3 for Yellow). Value at 0x0006 is always 00 (as it is rom header), so this causes too much data copied during sprite uncompression and causes different crashes.

In RB only sprite i could find with such properties is indeed back sprite of 0xF5 (ゥ), which can be fixed by fix #2

For 'M (0x00 one, as 0xFF & 0xFE are hybrids), his pointer to front sprite is 0x1900 and it's value is 0xDD. While it's still high, it doesn't seem to cause crashes.

camper

  • aka GlitcherRed, azum4roll
  • Member+
  • *
  • Offline Offline
  • Gender: Male
  • 975642dx║'r DExsfoF▓1 error.
    • View Profile
Re: Two fixes for some glitch Pokemon front sprites via Gameshark
« Reply #5 on: May 09, 2014, 10:31:37 am »
So Yellow Missingno. copies some data 256 times and overwrites too much memory and crashes the game?
Youtube
 

Guess where this is?

Nerator

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Two fixes for some glitch Pokemon front sprites via Gameshark
« Reply #6 on: May 09, 2014, 02:11:49 pm »
So Yellow Missingno. copies some data 256 times and overwrites too much memory and crashes the game?
I believe that's what happens. It can explain delay when you start fight with it. I tried using debugger to see why exactly crash happens, and saw that subroutine copied data to SPRITEBUFFER1 (at 0xA188) i believe all the way to 0xCxxx, but i still didn't figure out why it crashes. I guess in some time while uncompressing (may be VBlankHandler has something to do with this, not entirely sure, when this is called, but it was) it messes up the stack and it causes PC return to somewhere it shouldn't, causing either unknown opcode crash or FF crash (infinite loop).
« Last Edit: May 09, 2014, 10:16:15 pm by Nerator »

Wack0

  • Coder, reverser, beta collector [BetaArchive staff]
  • Banned
  • *
  • Offline Offline
  • Gender: Male
  • cBRH - Doing nothing since 2k7
    • View Profile
Re: Two fixes for some glitch Pokemon front sprites via Gameshark
« Reply #7 on: May 10, 2014, 11:47:55 am »
I believe that's what happens. It can explain delay when you start fight with it. I tried using debugger to see why exactly crash happens, and saw that subroutine copied data to SPRITEBUFFER1 (at 0xA188) i believe all the way to 0xCxxx, but i still didn't figure out why it crashes. I guess in some time while uncompressing (may be VBlankHandler has something to do with this, not entirely sure, when this is called, but it was) it messes up the stack and it causes PC return to somewhere it shouldn't, causing either unknown opcode crash or FF crash (infinite loop).

I figured this out a while ago, but I couldn't figure out why it was crashing, except the crash occured somewhere in VBlankHandler.
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

Nerator

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Two fixes for some glitch Pokemon front sprites via Gameshark
« Reply #8 on: May 10, 2014, 07:45:38 pm »
I believe that's what happens. It can explain delay when you start fight with it. I tried using debugger to see why exactly crash happens, and saw that subroutine copied data to SPRITEBUFFER1 (at 0xA188) i believe all the way to 0xCxxx, but i still didn't figure out why it crashes. I guess in some time while uncompressing (may be VBlankHandler has something to do with this, not entirely sure, when this is called, but it was) it messes up the stack and it causes PC return to somewhere it shouldn't, causing either unknown opcode crash or FF crash (infinite loop).

I figured this out a while ago, but I couldn't figure out why it was crashing, except the crash occured somewhere in VBlankHandler.
Main difference is subroutines, where overflow happens. In case of PokeWTRAINER (or any pokemon with base sprite sizes 0xX, Xx0 or 0x0) it happens in AlignSpriteDataCentered; in case of Yellow Missingno it happens in UncompressSpriteData. Main problem, that i can't figure out, how this damn VBlankHandler works. And in bgb it's hard to backtrack why PC is changing to what it should not.