Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Reload this Page Running Shoes inside buildings

Notices
For all updates, view the main page.

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 January 31st, 2010 (07:12 AM). Edited February 3rd, 2010 by HackMew.
HackMew's Avatar
HackMew HackMew is offline
Mewtwo Strikes Back
Team Unova
Crystal Tier
 
Join Date: Jun 2006
Posts: 1,314

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

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

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

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

    Code:
    0xBD494
  • LeafGreen US v1.0

    Code:
    0xBD468
  • Ruby US v1.0

    Code:
    0xE5E00
  • Sapphire US v1.0

    Code:
    0xE5E00
  • Emerald US v1.0

    Code:
    0x11A1E8

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 January 31st, 2010 (01:23 PM). Edited January 31st, 2010 by hashtag.
hashtag's Avatar
hashtag hashtag is offline
the man in black
Team Johto
Crystal Tier
 
Join Date: Nov 2008
Location: Salisbury, England
Age: 20
Gender: Male
Posts: 6,683
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!
__________________
#
Reply With Quote
  #3    
Old January 31st, 2010 (02:09 PM).
BlitŻ's Avatar
BlitŻ BlitŻ is offline
guahh my dog is so cute
Team Kalos
Crystal Tier
 
Join Date: Feb 2009
Location: Bay Area, Califronia.
Age: 20
Gender: Male
Nature: Jolly
Posts: 472
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
__________________
Reply With Quote
  #4    
Old January 31st, 2010 (02:23 PM).
NarutoActor's Avatar
NarutoActor NarutoActor is offline
The rocks cry out to me
Team Kanto
Silver Tier
 
Join Date: Jan 2009
Location: Brooklyn/Marlboro
Age: 21
Gender: Female
Nature: Bashful
Posts: 1,975
Send a message via AIM to NarutoActor Send a message via Windows Live Messenger to NarutoActor
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
Reply With Quote
  #5    
Old January 31st, 2010 (02:24 PM).
HackChu's Avatar
HackChu HackChu is offline
I need a haircut...
Team Kanto
Silver Tier
 
Join Date: Jan 2007
Location: Bankrupt Amerika
Age: 22
Gender: Male
Nature: Modest
Posts: 673
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
Reply With Quote
  #6    
Old January 31st, 2010 (02:28 PM).
HackMew's Avatar
HackMew HackMew is offline
Mewtwo Strikes Back
Team Unova
Crystal Tier
 
Join Date: Jun 2006
Posts: 1,314
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.
__________________
Reply With Quote
  #7    
Old January 31st, 2010 (02:28 PM). Edited January 31st, 2010 by hashtag.
hashtag's Avatar
hashtag hashtag is offline
the man in black
Team Johto
Crystal Tier
 
Join Date: Nov 2008
Location: Salisbury, England
Age: 20
Gender: Male
Posts: 6,683
Quote originally posted by NarutoActor:
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 :(
__________________
#
Reply With Quote
  #8    
Old January 31st, 2010 (02:32 PM).
HackChu's Avatar
HackChu HackChu is offline
I need a haircut...
Team Kanto
Silver Tier
 
Join Date: Jan 2007
Location: Bankrupt Amerika
Age: 22
Gender: Male
Nature: Modest
Posts: 673
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
Reply With Quote
  #9    
Old January 31st, 2010 (02:34 PM).
hashtag's Avatar
hashtag hashtag is offline
the man in black
Team Johto
Crystal Tier
 
Join Date: Nov 2008
Location: Salisbury, England
Age: 20
Gender: Male
Posts: 6,683
Quote originally posted by tyson:
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.
__________________
#
Reply With Quote
  #10    
Old January 31st, 2010 (02:36 PM).
Omega Zero's Avatar
Omega Zero Omega Zero is offline
Is back...
Team Sinnoh
Gold Tier
 
Join Date: Dec 2009
Location: I'm always living aren't I?
Age: 17
Gender: Male
Nature: Relaxed
Posts: 445
Send a message via Skype™ to Omega Zero
WoW really useful i just used it right now :3
__________________
Reply With Quote
  #11    
Old January 31st, 2010 (02:48 PM). Edited January 31st, 2010 by HackMew.
HackMew's Avatar
HackMew HackMew is offline
Mewtwo Strikes Back
Team Unova
Crystal Tier
 
Join Date: Jun 2006
Posts: 1,314
Quote originally posted by tyson:
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.
__________________
Reply With Quote
  #12    
Old January 31st, 2010 (03:17 PM).
Omega Zero's Avatar
Omega Zero Omega Zero is offline
Is back...
Team Sinnoh
Gold Tier
 
Join Date: Dec 2009
Location: I'm always living aren't I?
Age: 17
Gender: Male
Nature: Relaxed
Posts: 445
Send a message via Skype™ to Omega Zero
the reason it said string not found cause you probally pressed Ctrl+F press Ctrl+G then try it
__________________
Reply With Quote
  #13    
Old January 31st, 2010 (03:29 PM).
giradialkia's Avatar
giradialkia giradialkia is offline
I mean...
Team Sinnoh
Crystal Tier
 
Join Date: Apr 2009
Location: Ireland
Age: 21
Gender: Male
Nature: Timid
Posts: 1,561
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.
__________________

This one's called 'Blue', and it's very Pokémon themed, so have a listen! Check out the links below for more stuff, if you like this!



This is the Doctor
This is my Soundcloud
This is my bandcamp

My Pokémon Y character is the same as my username. If you see me as a Passerby let me know! I tend to get a lot of Passerby requests and I often wonder if it's people from this site.
Reply With Quote
  #14    
Old January 31st, 2010 (03:53 PM).
HackMew's Avatar
HackMew HackMew is offline
Mewtwo Strikes Back
Team Unova
Crystal Tier
 
Join Date: Jun 2006
Posts: 1,314
Quote originally posted by giradialkia:
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.
__________________
Reply With Quote
  #15    
Old January 31st, 2010 (05:59 PM).
liuyanghejerry's Avatar
liuyanghejerry liuyanghejerry is offline
Team Kalos
 
Join Date: Jan 2008
Location: China,Xi'an
Nature: Calm
Posts: 218
Send a message via ICQ to liuyanghejerry Send a message via Windows Live Messenger to liuyanghejerry Send a message via Yahoo to liuyanghejerry
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


I did something that really bad.But made all Chinese can hack Pokemon, too.If you guys hate me, I totally understand,but cannot do anything but force to keep everything.
If there must be someone to undertake all spit and curse, it must be me.
Reply With Quote
  #16    
Old January 31st, 2010 (06:18 PM).
HackChu's Avatar
HackChu HackChu is offline
I need a haircut...
Team Kanto
Silver Tier
 
Join Date: Jan 2007
Location: Bankrupt Amerika
Age: 22
Gender: Male
Nature: Modest
Posts: 673
Quote originally posted by liuyanghejerry:
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
Reply With Quote
  #17    
Old January 31st, 2010 (08:43 PM).
ZodiacDaGreat's Avatar
ZodiacDaGreat ZodiacDaGreat is offline
Working on a Mobile System
Team Hoenn
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Posts: 429
Send a message via ICQ to ZodiacDaGreat
Quote originally posted by liuyanghejerry:
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!
__________________
Reply With Quote
  #18    
Old January 31st, 2010 (11:17 PM).
Tropical Sunlight's Avatar
Tropical Sunlight Tropical Sunlight is offline
The Faltine
Team Kanto
 
Join Date: Mar 2008
Location: Slovenia
Age: 19
Gender: Male
Posts: 3,578
Send a message via Windows Live Messenger to Tropical Sunlight
Awesome, just did this in Turquoise! Thanks, HackMew!
Reply With Quote
  #19    
Old February 1st, 2010 (12:52 AM). Edited February 1st, 2010 by HackMew.
HackMew's Avatar
HackMew HackMew is offline
Mewtwo Strikes Back
Team Unova
Crystal Tier
 
Join Date: Jun 2006
Posts: 1,314
>> TO ALL: First post updated! Now includes Ruby, Sapphire and Emerald too :D

Quote originally posted by liuyanghejerry:
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.


Quote originally posted by ZodiacDaGreat:
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.


Quote originally posted by H2O Turquoise:
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.
__________________
Reply With Quote
  #20    
Old February 1st, 2010 (02:29 AM).
Flandre Scarlet's Avatar
Flandre Scarlet Flandre Scarlet is offline
Free your mind.
Team Sinnoh
Gold Tier
 
Join Date: Feb 2008
Location: Australia
Age: 19
Gender: Male
Nature: Adamant
Posts: 354
Hahaha, I was just about to ask for an Emerald version But it looks like its already done. Thank you so much HackMew! Works perfectly!
Reply With Quote
  #21    
Old February 12th, 2010 (10:19 AM).
simdu68's Avatar
simdu68 simdu68 is offline
asleep all summer zzZZ
Team Kanto
 
Join Date: Feb 2010
Location: France
Age: 20
Gender: Male
Nature: Calm
Posts: 221
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
Reply With Quote
  #22    
Old February 12th, 2010 (11:29 AM).
Sagiri's Avatar
Sagiri Sagiri is offline
Team Kalos
 
Join Date: Mar 2007
Age: 21
Posts: 611
Quote originally posted by simdu68:
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.
Reply With Quote
  #23    
Old February 12th, 2010 (11:41 AM).
simdu68's Avatar
simdu68 simdu68 is offline
asleep all summer zzZZ
Team Kanto
 
Join Date: Feb 2010
Location: France
Age: 20
Gender: Male
Nature: Calm
Posts: 221
ah ok
i haven't got hex editor i'm making scripts with something alse, probably worse

so i'll download hex editor maybe i'll understand

thanx :D
Reply With Quote
  #24    
Old February 12th, 2010 (11:46 AM).
Muffin™'s Avatar
Muffin™ Muffin™ is offline
Knows your age
Team Sinnoh
 
Join Date: Dec 2009
Location: sucking balls
Age: 4
Gender: Male
Nature: Calm
Posts: 429
Send a message via AIM to Muffin™
Thanks so much HackMew! I always love your tutorials!!!
__________________
>>>/v/
Reply With Quote
  #25    
Old February 12th, 2010 (12:02 PM).
simdu68's Avatar
simdu68 simdu68 is offline
asleep all summer zzZZ
Team Kanto
 
Join Date: Feb 2010
Location: France
Age: 20
Gender: Male
Nature: Calm
Posts: 221
i just now read a scripting tutorial, now i understand your tutorial also

in fact i just didn't know this scripting language....... but hex editor is much better than my old programm
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 UTC -8. The time now is 01:25 AM.