The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Research & Development programs in this forum are subject to moderator approval before they are displayed.


Reply
 
Thread Tools
  #1    
Old February 16th, 2010, 02:34 AM
HackMew's Avatar
HackMew
Mewtwo Strikes Back
 
Join Date: Jun 2006

Brief Intro


The Pokédex Glitch is a glitch exclusive to FireRed and LeafGreen US v1.0. The species names present are cut off, most specifically those species names made up of more than one word with a space in between. This causes Pokémon like Squirtle to be listed as "Tiny Pokémon" rather than "Tiny Turtle Pokémon." This was addressed in later releases of the games.

Description


Here's a part of the routine disassembled from FireRed US v1.0:

Code:
0810583a 7828 ldrb r0, [r5, #0x0] 0810583c 2800 cmp r0, #0x0 0810583e d01b beq $08105878 08105840 4669 mov r1, sp 08105842 1909 add r1, r1, r4 08105844 3108 add r1, #0x8 08105846 1928 add r0, r5, r4 08105848 7800 ldrb r0, [r0, #0x0] 0810584a 7008 strb r0, [r1, #0x0] 0810584c 1c60 add r0, r4, #0x1 0810584e 0600 lsl r0, r0, #0x18 08105850 0e04 lsr r4, r0, #0x18 08105852 1928 add r0, r5, r4 08105854 7800 ldrb r0, [r0, #0x0] 08105856 2800 cmp r0, #0x0 08105858 d00e beq $08105878
The very first byte of the species name is loaded. If this byte is 0x0, no name will be loaded because the routine would treat that as an empty string.
Going on with the routine, there are some other instructions, but we just need to focus on the second cmp. There, the current name byte is checked to see if the end of the string was reached yet.
A blank space (0x0) is confused for the terminating byte (0xFF), basically. Now, changing the cmp instructions a little:

Code:
0810583a 7828 ldrb r0, [r5, #0x0] 0810583c 28ff cmp r0, #0xff 0810583e d01b beq $08105878 08105840 4669 mov r1, sp 08105842 1909 add r1, r1, r4 08105844 3108 add r1, #0x8 08105846 1928 add r0, r5, r4 08105848 7800 ldrb r0, [r0, #0x0] 0810584a 7008 strb r0, [r1, #0x0] 0810584c 1c60 add r0, r4, #0x1 0810584e 0600 lsl r0, r0, #0x18 08105850 0e04 lsr r4, r0, #0x18 08105852 1928 add r0, r5, r4 08105854 7800 ldrb r0, [r0, #0x0] 08105856 28ff cmp r0, #0xff 08105858 d00e beq $08105878
Fixing it is so easy it's not even fair; just replace 00 with FF.

The Offsets


  • FireRed US v1.0

    Code:
    0x10583C 0x105856
  • LeafGreen US v1.0

    Code:
    0x105814 0x10582E

This research document is Copyright © 2010 by HackMew.
You are not allowed to copy, modify or distribute it without permission.
__________________
Reply With Quote
  #2    
Old February 16th, 2010, 08:07 AM
Tropical Sunlight's Avatar
Tropical Sunlight
The Faltine
 
Join Date: Mar 2008
Location: Slovenia
Age: 18
Gender: Male
Send a message via Windows Live Messenger to Tropical Sunlight
What else will they make :D
Good job!

I wonder what other differences between v1.0 and v1.1 are.
__________________
Reply With Quote
  #3    
Old February 16th, 2010, 09:20 AM
HackMew's Avatar
HackMew
Mewtwo Strikes Back
 
Join Date: Jun 2006
Quote:
Originally Posted by H2O Turquoise View Post
What else will they make :D
Good job!

I wonder what other differences between v1.0 and v1.1 are.
Thank you. And I wonder too. AFAIK, there are not many differences at all. Except the said glitch, and the presents screen, I wouldn't really know.
Comparing the ROMs is not a solution because all the data got shifted, making all offsets and pointers different.
__________________
Reply With Quote
  #4    
Old February 16th, 2010, 02:21 PM
NarutoActor's Avatar
NarutoActor
The rocks cry out to me
Community Supporter
 
Join Date: Jan 2009
Location: Brooklyn/Marlboro
Age: 20
Gender: Female
Nature: Bashful
Send a message via AIM to NarutoActor Send a message via Windows Live Messenger to NarutoActor
Nice Nintendo should hire you. XD I never herd of these glitches; They never happened to me. What other glitches are there in FireRed?
__________________
~There are those people who understand hex, F the rest
Reply With Quote
  #5    
Old February 18th, 2010, 06:04 PM
TB Pro's Avatar
TB Pro
Old-timer
 
Join Date: Nov 2004
Location: Midwestern USA
Age: 19
Gender: Male
Great job HackMew! I was suffering from this glitch, so thanks for fixing it.
__________________
--I'm a creepin'..
Reply With Quote
  #6    
Old February 25th, 2010, 08:55 AM
HackMew's Avatar
HackMew
Mewtwo Strikes Back
 
Join Date: Jun 2006
Quote:
Originally Posted by NarutoActor View Post
Nice Nintendo should hire you. XD I never herd of these glitches; They never happened to me. What other glitches are there in FireRed?
There are quite some glitches, but don't worry: I'll fix all of them, one by one xD


Quote:
Originally Posted by TB Pro View Post
Great job HackMew! I was suffering from this glitch, so thanks for fixing it. ^^
You're welcome.
__________________
Reply With Quote
  #7    
Old August 5th, 2010, 05:53 PM
FlameShocker's Avatar
FlameShocker
C++/ASM Programmer
 
Join Date: Aug 2008
Location: Location: United States
Age: 20
Gender: Male
Nature: Hasty
Since the thread revival limit does not apply here.... I noticed this way back in '04 when I got FireRed (I still have that cartridge, and the Wireless Adapter that came with it). At the time, I thought that they were going to stick with not having the full species name thing in future games. I also didn't know that they fixed it in later versions of Fire Red.
Reply With Quote
  #8    
Old February 5th, 2013, 05:49 AM
LocksmithArmy's Avatar
LocksmithArmy
Mew!
 
Join Date: Feb 2013
Age: 25
Gender: Male
this same technique can be done in a Hex editor (jump to those 2 offsets and make them FF)
__________________
~Current Project:

~Completed Projects:



Last edited by LocksmithArmy; February 28th, 2013 at 08:22 AM.
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 08:57 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.