The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

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
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old January 31st, 2010, 07:12 AM
HackMew's Avatar
HackMew
Mewtwo Strikes Back
 
Join Date: Jun 2006

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.
__________________

Last edited by HackMew; February 3rd, 2010 at 03:13 AM.
Reply With Quote
  #2    
Old January 31st, 2010, 01:23 PM
hashtag's Avatar
hashtag
the man in black
Community Supporter
 
Join Date: Nov 2008
Location: Salisbury, England
Age: 19
Gender: Male
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 by hashtag; January 31st, 2010 at 01:56 PM.
Reply With Quote
  #3    
Old January 31st, 2010, 02:09 PM
BlitŻ's Avatar
BlitŻ
guahh my dog is so cute
 
Join Date: Feb 2009
Location: Bay Area, Califronia.
Age: 19
Gender: Male
Nature: Jolly
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
The rocks cry out to me
Community Supporter
 
Join Date: Jan 2009
Location: Brooklyn/Marlboro
Age: 21
Gender: Female
Nature: Bashful
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
I need a haircut...
Community Supporter
 
Join Date: Jan 2007
Location: Bankrupt Amerika
Age: 21
Gender: Male
Nature: Modest
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
Mewtwo Strikes Back
 
Join Date: Jun 2006
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
hashtag's Avatar
hashtag
the man in black
Community Supporter
 
Join Date: Nov 2008
Location: Salisbury, England
Age: 19
Gender: Male
Quote:
Originally Posted by NarutoActor View Post
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 by hashtag; January 31st, 2010 at 02:29 PM. Reason: andrea beaaaattttt me
Reply With Quote
  #8    
Old January 31st, 2010, 02:32 PM
HackChu's Avatar
HackChu
I need a haircut...
Community Supporter
 
Join Date: Jan 2007
Location: Bankrupt Amerika
Age: 21
Gender: Male
Nature: Modest
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
the man in black
Community Supporter
 
Join Date: Nov 2008
Location: Salisbury, England
Age: 19
Gender: Male
Quote:
Originally Posted by tyson View Post
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
Is back...
Community Supporter Tier 4
 
Join Date: Dec 2009
Location: I'm always living aren't I?
Age: 16
Gender: Male
Nature: Relaxed
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
HackMew's Avatar
HackMew
Mewtwo Strikes Back
 
Join Date: Jun 2006
Quote:
Originally Posted by tyson View Post
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 by HackMew; January 31st, 2010 at 02:59 PM.
Reply With Quote
  #12    
Old January 31st, 2010, 03:17 PM
Omega Zero's Avatar
Omega Zero
Is back...
Community Supporter Tier 4
 
Join Date: Dec 2009
Location: I'm always living aren't I?
Age: 16
Gender: Male
Nature: Relaxed
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
Community Supporter
 
Join Date: Apr 2009
Location: Ireland
Age: 21
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to giradialkia
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 'Red', and it's actually kinda 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
Mewtwo Strikes Back
 
Join Date: Jun 2006
Quote:
Originally Posted by giradialkia View Post
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
Trainer
 
Join Date: Jan 2008
Location: China,Xi'an
Nature: Calm
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
I need a haircut...
Community Supporter
 
Join Date: Jan 2007
Location: Bankrupt Amerika
Age: 21
Gender: Male
Nature: Modest
Quote:
Originally Posted by liuyanghejerry View Post
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
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
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
The Faltine
 
Join Date: Mar 2008
Location: Slovenia
Age: 18
Gender: Male
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
HackMew's Avatar
HackMew
Mewtwo Strikes Back
 
Join Date: Jun 2006
>> TO ALL: First post updated! Now includes Ruby, Sapphire and Emerald too :D

Quote:
Originally Posted by liuyanghejerry View Post
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 View Post
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 View Post
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 by HackMew; February 1st, 2010 at 02:46 AM.
Reply With Quote
  #20    
Old February 1st, 2010, 02:29 AM
Flandre Scarlet's Avatar
Flandre Scarlet
Free your mind.
Community Supporter
 
Join Date: Feb 2008
Location: Australia
Age: 18
Gender: Male
Nature: Adamant
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
asleep all summer zzZZ
 
Join Date: Feb 2010
Location: France
Age: 20
Gender: Male
Nature: Calm
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
 
Join Date: Mar 2007
Age: 20
Quote:
Originally Posted by simdu68 View Post
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
asleep all summer zzZZ
 
Join Date: Feb 2010
Location: France
Age: 20
Gender: Male
Nature: Calm
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™
Knows your age
 
Join Date: Dec 2009
Location: sucking balls
Age: 4
Gender: Male
Nature: Calm
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
asleep all summer zzZZ
 
Join Date: Feb 2010
Location: France
Age: 20
Gender: Male
Nature: Calm
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 08:44 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.