• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • A reminder that our new forum software has 2FA! It can be accessed by clicking your username and then "Password and security" from the menu. We strongly suggest not reusing passwords for your online accounts and enabling 2FA if possible.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Code: Running Shoes inside buildings

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011

Brief Intro

I'm gonna deliberately quote Bulbapedia here:
[jq]The Running Shoes were introduced in Ruby and Sapphire, and used in all Generation III and Generation IV games. They are typically received shortly after the beginning of the game, and allow the player to run instead of walk, by holding the B button and pressing the D-pad in any direction. The speed at which players can run is about twice as that of walking, yet slower than any of the bicycles. In Generation IV, the player can use Running Shoes inside of all structures instead of being limited to certain buildings in past games.[/jq]To be honest, I always disliked the fact you could not run indoors. Eventually, Game Freak realized that too someday.
Now we will fix the annoying issue, letting the player use Running Shoes everywhere, through a simple byte change!

Description

The game does some checks when pressing the B button. Below, part of the routine involved, disassembled from FireRed US v1.0:

Code:
[div="font-family:consolas, courier new,monospace"]080bd490  7e41 ldrb r1, [r0, #0x19]
080bd492  2002 mov r0, #0x2
080bd494  4008 and r0, r1
080bd496  2800 cmp r0, #0x0
080bd498  d006 beq $080bd4a8[/div]

I'll explain briefly what happens. First of all, the "Show name on entering" byte is loaded into r1 and r0 is set to 0x2. Then r0 is ANDed with r1. Here are the possible results:

Code:
[div="font-family:consolas, courier new,monospace"]0x2 AND 0x0 = 0x0
0x2 AND 0x1 = 0x0
0x2 AND 0x2 = 0x2
0x2 AND 0x3 = 0x2
0x2 AND 0x4 = 0x0
0x2 AND 0x5 = 0x0
0x2 AND 0x6 = 0x2
0x2 AND 0x7 = 0x2
0x2 AND 0x8 = 0x0
0x2 AND 0x9 = 0x0
0x2 AND 0xA = 0x2
0x2 AND 0xB = 0x2
0x2 AND 0xC = 0x0
0x2 AND 0xD = 0x0
0x2 AND 0xE = 0x2
0x2 AND 0xF = 0x2[/div]

As you can see, a specific pattern is repeating itself. Going on with the routine, we can see r0 is compared with 0x0. If equal, no Running Shoes :(

Now, if we could change the "and r0, r1" instruction with a "and r0, r0" one, what would happen?
The register r0 is set to 0x2 the instruction before, so it would always be 0x2 AND 0x2 = 0x2. And since 0x2 is not 0x0, we can run anytime.
Regardless of the map header settings :)

That's for FR/LG. In Emerald, things are pretty similar, here's the routine from Emerald US v1.0:

Code:
[div="font-family:consolas, courier new,monospace"]0811a1e4  7e81 ldrb r1, [r0, #0x1a]
0811a1e6  2004 mov r0, #0x4
0811a1e8  4008 and r0, r1
0811a1ea  2800 cmp r0, #0x0
0811a1ec  d006 beq $0811a1fc[/div]

Nothing much to say, really. The main difference is that r0 is set to 0x4 instead of 0x2, which means different patterns.
Not that we really care about that, since we already know all we need to do is to replace the "and r0, r1" instruction there.

In Ruby and Sapphire, things are quite different instead:

Code:
[div="font-family:consolas, courier new,monospace"]080e5dfc  4802 ldr r0, [$080e5e08] (=$0202e828)
080e5dfe  7dc0 ldrb r0, [r0, #0x17]
080e5e00  2808 cmp r0, #0x8
080e5e02  d103 bne $080e5e0c[/div]

The above code, extracted from Ruby US v1.0 will load the "Map Type" byte into r0 at first. Then it's compared with 0x8, which means indoors.
When being not equal, you can run. Otherwhise you cannot, indeed. Now, if we change the "cmp r0, #0x8" with "cmp r0, #0x0", we are always allowed to run.
In fact, no map in the game use the value 0x0.

Whatever game you're using, in hex that means replacing 08 with 00. Offsets are below.

The Offsets


  • FireRed US v1.0

    Code:
    [div="font-family:consolas,courier new,monospace"]0xBD494[/div]
  • LeafGreen US v1.0

    Code:
    [div="font-family:consolas,courier new,monospace"]0xBD468[/div]
  • Ruby US v1.0

    Code:
    [div="font-family:consolas,courier new,monospace"]0xE5E00[/div]
  • Sapphire US v1.0

    Code:
    [div="font-family:consolas,courier new,monospace"]0xE5E00[/div]
  • Emerald US v1.0

    Code:
    [div="font-family:consolas,courier new,monospace"]0x11A1E8[/div]

This research document is Copyright © 2010 by HackMew.
You are not allowed to copy, modify or distribute it without permission.
 
Last edited:

Logan

[img]http://pldh.net/media/pokecons_action/403.gif
10,417
Posts
15
Years
Good research, Andrea. I was trying to find a way to enable this without touching the Map Header options. I just implemented this into my hack; well done!
 
Last edited:

BlitŻ1

guahh my dog is so cute
472
Posts
15
Years
Hmm, this is something that is great ^^. Now I don't havev to change things from indoor to outside to make it work. ^-^ I hope nothing bad will become of my rom though, just in case. >.<

Your research greatly benefits us all. x3
 

NarutoActor

The rocks cry out to me
1,974
Posts
15
Years
Will this mess with the Day & Night System, as in it will be sunny indors? or dose this byte change only change the fact that you can run?
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
To clear it up: this doesn't mess anything up. Obviously. It will simply enable Running Shoes anywhere. Heck, I've used it in Oro Sole too.
 

Logan

[img]http://pldh.net/media/pokecons_action/403.gif
10,417
Posts
15
Years
Will this mess with the Day & Night System, as in it will be sunny indors? or dose this byte change only change the fact that you can run?

It only changes the running; not the weather. :D

edit: beaten :(
 
Last edited:

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
Well I can't find the offset used above in my hex editor.

0xBD494It says string not found.:(

Am I wrong (no, I'm not) or I didn't use the word "search" at all? You just need to go to that offset in your ROM using a hex editor.
Assuming you know how to use one. For further details, just read the first post.
 
Last edited:
1,738
Posts
14
Years
Forgive my misunderstanding, but is this not possible by just changing the "Show Map Name" setting? I previously wanted to do this for my hack, which is based on Emerald. All I had to do is change the petting from "Do not show name" to "05 ???" and That enabled the running shoes while indoors, in any building. And in FireRed it's "02 ???". Although from the amount of 0x2's I see in the first post, that's probably what you were saying. Though... Are you saying that once this code is implemented, you'll be able to run everywhere, regardless of the Show Name setting? Because if that's what you were saying... That is cool. Sorry, for not understanding properly:(.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
Are you saying that once this code is implemented, you'll be able to run everywhere, regardless of the Show Name setting? Because if that's what you were saying... That is cool. Sorry, for not understanding properly:(.

That's exactly what it was designed for.
 
219
Posts
16
Years
This is very interesting.
But this inspire me that why don't we try to reuse select,R,L?
In FR,RL goes to a helpless help and in RSE, it's totally no use...
Maybe we could create codes like what B and select does,and make R,L new use in OW.
Maybe press R to fish?
 

HackChu

I need a haircut...
674
Posts
17
Years
This is very interesting.
But this inspire me that why don't we try to reuse select,R,L?
In FR,RL goes to a helpless help and in RSE, it's totally no use...
Maybe we could create codes like what B and select does,and make R,L new use in OW.
Maybe press R to fish?
Well for one it requires ASM of course and for two...this isn't related to the topic of the thread so please refrain from switching it up.
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
liuyanghejerry said:
This is very interesting.
But this inspire me that why don't we try to reuse select,R,L?
In FR,RL goes to a helpless help and in RSE, it's totally no use...
Maybe we could create codes like what B and select does,and make R,L new use in OW.
Maybe press R to fish?
I think he wants to extend the routine to add in extra stuff for keypresses.

For people interested in having the Running Shoes hack on Ruby, you're in for some good news ^^ I've come up with my own hack for Ruby since I don't think the same way works, AFAIK. Anyways, let's get down to business.. My hack revolves around Map Type byte. There are a lot of routines reading that and one of them checks if the Map type is indoors, if it is then you 'Can't Run' otherwise you can.

Code:
080e5dfc  4802 ldr r0, [$080e5e08] (=$0202e828) @ Map Type Flag is stored here
080e5dfe  7dc0 ldrb r0, [r0, #0x17]
080e5e00  2808 cmp r0, #0x8 @ Indoor Map Type
080e5e02  d103 bne $080e5e0c
080e5e04  2001 mov r0, #0x1
080e5e06  e002 b $080e5e0e
What we are gonna do is change that 08 to 00, since no Map uses 00 anyway as far as it matters just change it to any other value that doesn't involve Maps that you can run on. So, to apply this hack simply put 00 at 0xE5E00.

Enjoy!
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
>> TO ALL: First post updated! Now includes Ruby, Sapphire and Emerald too :D

This is very interesting.
But this inspire me that why don't we try to reuse select,R,L?
In FR,RL goes to a helpless help and in RSE, it's totally no use...
Maybe we could create codes like what B and select does,and make R,L new use in OW.
Maybe press R to fish?

Well, not really. You can use L/R to scroll in the bag or in the Pokémon stat screens. Even on R/S/E. But yeah, those buttons are not used a lot I guess. Anyway, this is kinda offtopic here, sorry.


For people interested in having the Running Shoes hack on Ruby, you're in for some good news ^^ I've come up with my own hack for Ruby since I don't think the same way works, AFAIK.

You know, I was going to post the R/S/E stuff later, but thanks nonetheless.


Awesome, just did this in Turquoise! Thanks, HackMew!

You're welcome. Even if I didn't say explicitly, a tiny bit of credit is always appreciated.
 
Last edited:

Flandre Scarlet

Free your mind.
356
Posts
16
Years
Hahaha, I was just about to ask for an Emerald version :P But it looks like its already done. :) Thank you so much HackMew! Works perfectly!
 
Back
Top