Advertiser Content

Development Running Shoes inside buildings

Started by HackMew January 31st, 2010 7:12 AM
  • 41985 views
  • 68 replies

HackMew

Mewtwo Strikes Back

Seen October 26th, 2011
Posted October 15th, 2010
1,314 posts
13.7 Years

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:

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
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:

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
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:

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
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:

080e5dfc 4802 ldr r0, [$080e5e08] (=$0202e828) 080e5dfe 7dc0 ldrb r0, [r0, #0x17] 080e5e00 2808 cmp r0, #0x8 080e5e02 d103 bne $080e5e0c
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

    0xBD494
  • LeafGreen US v1.0

    0xBD468
  • Ruby US v1.0

    0xE5E00
  • Sapphire US v1.0

    0xE5E00
  • Emerald US v1.0

    0x11A1E8

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

Logan

Age 25
Male
Salisbury, England
Seen 3 Weeks Ago
Posted December 4th, 2019
10,411 posts
11.3 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!

BlitŻ

guahh my dog is so cute

Age 25
Male
Bay Area, Califronia.
Seen October 1st, 2015
Posted January 22nd, 2013
472 posts
11 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

Age 26
Female
Brooklyn/Marlboro
Seen April 2nd, 2016
Posted March 22nd, 2016
1,978 posts
11.1 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?
~There are those people who understand hex, F the rest

HackChu

I need a haircut...

Age 27
Male
Bankrupt Amerika
Seen December 5th, 2017
Posted October 2nd, 2014
672 posts
13.1 Years
Thanks I was wanting to know how to do this recently, I just hope it doesn't mess anything up.
Join us!

My 'learning how to combine battle scripts' thread:
http://www.pokecommunity.com/showthread.php?t=183001

SoulSilver FC:1162 1864 5409
Name: Ethan

Black FC: 2666 1354 4379
Name: Ashton

White 2 FC: 1120 8065 3049
Name: Nate

3DS Friend Code: 1349-4646-2412
Name: tysonrss

Logan

Age 25
Male
Salisbury, England
Seen 3 Weeks Ago
Posted December 4th, 2019
10,411 posts
11.3 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 :(

HackChu

I need a haircut...

Age 27
Male
Bankrupt Amerika
Seen December 5th, 2017
Posted October 2nd, 2014
672 posts
13.1 Years
Well I can't find the offset used above in my hex editor.

0xBD494It says string not found.:(
Join us!

My 'learning how to combine battle scripts' thread:
http://www.pokecommunity.com/showthread.php?t=183001

SoulSilver FC:1162 1864 5409
Name: Ethan

Black FC: 2666 1354 4379
Name: Ashton

White 2 FC: 1120 8065 3049
Name: Nate

3DS Friend Code: 1349-4646-2412
Name: tysonrss

Logan

Age 25
Male
Salisbury, England
Seen 3 Weeks Ago
Posted December 4th, 2019
10,411 posts
11.3 Years
Well I can't find the offset used above in my hex editor.

0xBD494It says string not found.:(
Search BD494 on it's own in your editor.

HackMew

Mewtwo Strikes Back

Seen October 26th, 2011
Posted October 15th, 2010
1,314 posts
13.7 Years
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.

giradialkia

Age 26
Male
Ireland
Seen 3 Weeks Ago
Posted March 25th, 2019
1,554 posts
10.9 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:(.

I'm working on an album of Pokémon-inspired music. Check out the Soundcloud link if you're interested!


This is my Soundcloud | | This is my bandcamp

HackMew

Mewtwo Strikes Back

Seen October 26th, 2011
Posted October 15th, 2010
1,314 posts
13.7 Years
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.
China,Xi'an
Seen December 18th, 2018
Posted January 23rd, 2017
219 posts
12.1 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?
Zel,thethethethe,LU-HO,Darthatron,HackMew,ZodiacDaGreat,Juan,score_under,JPAN,Tamah-chan,I really appreciate your kindness and your help!:D

HackChu

I need a haircut...

Age 27
Male
Bankrupt Amerika
Seen December 5th, 2017
Posted October 2nd, 2014
672 posts
13.1 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.
Join us!

My 'learning how to combine battle scripts' thread:
http://www.pokecommunity.com/showthread.php?t=183001

SoulSilver FC:1162 1864 5409
Name: Ethan

Black FC: 2666 1354 4379
Name: Ashton

White 2 FC: 1120 8065 3049
Name: Nate

3DS Friend Code: 1349-4646-2412
Name: tysonrss

ZodiacDaGreat

Working on a Mobile System

Age 27
Male
South Pacific
Seen April 25th, 2017
Posted August 14th, 2013
429 posts
13 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?
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.

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

Seen October 26th, 2011
Posted October 15th, 2010
1,314 posts
13.7 Years
>> 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.

simdu68

asleep all summer zzZZ

Age 25
Male
France
Seen January 6th, 2012
Posted November 7th, 2010
221 posts
10.1 Years
sorry but i'm so bad in scripting that i don't understand -_-'

well in fact the first part i understand but not the second with the offsets...........


edit:
in fact i have another question, is it possible to change it also with the bicycle to be able to drive with the bike in the houses? that would also be great^^
Seen 7 Hours Ago
Posted 2 Weeks Ago
780 posts
13 Years
sorry but i'm so bad in scripting that i don't understand -_-'

well in fact the first part i understand but not the second with the offsets...........


edit:
in fact i have another question, is it possible to change it also with the bicycle to be able to drive with the bike in the houses? that would also be great^^
You open a hex editor, go to the specified offset and change the 08 found there with 00.

Biking anywhere is theoretically possible, but not with this.
Advertiser Content