HackMew
Mewtwo Strikes Back
- 1,314
- Posts
- 17
- Years
- Seen Oct 26, 2011
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:
[div="font-family:consolas, courier new,monospace"]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[/div]
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:
[div="font-family:consolas, courier new,monospace"]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[/div]
Fixing it is so easy it's not even fair; just replace 00 with FF.
The Offsets
- FireRed US v1.0
Code:[div="font-family:consolas,courier new,monospace"]0x10583C 0x105856[/div]
- LeafGreen US v1.0
Code:[div="font-family:consolas,courier new,monospace"]0x105814 0x10582E[/div]
This research document is Copyright © 2010 by HackMew.
You are not allowed to copy, modify or distribute it without permission.