The PokéCommunity Forums Fan Games ROM Hacking Research & Development
Development I'm Fixin' It: The Pokédex Glitch

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!

Reply
 
Thread Tools
  #1    
Old February 16th, 2010 (2:34 AM).
HackMew's Avatar
HackMew HackMew is offline
Mewtwo Strikes Back
  • Crystal Tier
 
Join Date: Jun 2006
Posts: 1,314

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

Relevant Advertising!

  #2    
Old February 16th, 2010 (8:07 AM).
Tropical Sunlight's Avatar
Tropical Sunlight Tropical Sunlight is offline
The Faltine
     
    Join Date: Mar 2008
    Location: Slovenia
    Age: 21
    Gender: Male
    Posts: 3,572
    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 (9:20 AM).
    HackMew's Avatar
    HackMew HackMew is offline
    Mewtwo Strikes Back
    • Crystal Tier
     
    Join Date: Jun 2006
    Posts: 1,314
    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 (2:21 PM).
    NarutoActor's Avatar
    NarutoActor NarutoActor is offline
    The rocks cry out to me
    • Silver Tier
     
    Join Date: Jan 2009
    Location: Brooklyn/Marlboro
    Age: 23
    Gender: Female
    Nature: Bashful
    Posts: 1,979
    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 (6:04 PM).
    TB Pro's Avatar
    TB Pro TB Pro is offline
    Old-timer
       
      Join Date: Nov 2004
      Location: Midwestern USA
      Age: 22
      Gender: Male
      Posts: 2,739
      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 (8:55 AM).
      HackMew's Avatar
      HackMew HackMew is offline
      Mewtwo Strikes Back
      • Crystal Tier
       
      Join Date: Jun 2006
      Posts: 1,314
      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 (5:53 PM).
      FlameShocker's Avatar
      FlameShocker FlameShocker is offline
      C++/ASM Programmer
         
        Join Date: Aug 2008
        Location: Location: United States
        Age: 23
        Gender: Male
        Nature: Hasty
        Posts: 64
        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 (5:49 AM). Edited February 28th, 2013 by LocksmithArmy.
        LocksmithArmy's Avatar
        LocksmithArmy LocksmithArmy is offline
        Mew!
           
          Join Date: Feb 2013
          Age: 28
          Gender: Male
          Posts: 415
          this same technique can be done in a Hex editor (jump to those 2 offsets and make them FF)
          __________________
          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

          Forum Jump


          All times are GMT -8. The time now is 12:38 AM.