The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Research & Development (https://www.pokecommunity.com/forumdisplay.php?f=195)
-   -   Research Useful Emerald Stuff (https://www.pokecommunity.com/showthread.php?t=230401)

Chaos Rush August 25th, 2010 9:01 PM

Useful Emerald Stuff
 
I wish more people would hack R/S/E, so hopefully this might encourage people. Anyways, I have 3 useful Emerald stuff:


How to make the Town Map from FR/LG work in Emerald:

Spoiler:

First of all, if you've hacked Emerald before, you may notice that it contains all of the items from FR/LG. Such as Gold Teeth, Vs Seeker, Sapphire, etc. But you may also have noticed that none of them work. Well, of course they don't work, since they're not meant to be obtainable in the game...

But, in R/S/E, the only portable way of viewing the Town Map is in your PokeNav. Some people (like me), may choose to not use the PokeNav, meaning that if you don't have a PokeNav, the only way to view the Town Map is in a Pokemon Center, since the Town Map item does absolutely nothing in Emerald. Well, I've figured out a way to activate the useless item!

Activating the Town Map:

Required:
*A Pokemon Emerald rom
*ItemManager

Step-by-step:
1. Open up your Emerald rom, and scroll down until you see the useless FR/LG items. Click on TOWN MAP.

2. Click on the arrow that's right next to "Save"

3. Right next to where it says, "Field Usage", paste this into the box: 8138C95

You're done! Yep, that is literally all you have to do to make the Town Map function in Emerald. Now how the hell did I find that out, since there's no other item with that function? Well, I assumed that the offset right next to "Field Usage" calls the corresponding routine. JPAN told me where the offset to the special routines are located, so I counted each pointer until I got to the 254th one. Special 0xFE is what views the town map, and FE = 254. Then, using a pointer calculator, I found out that Special 0xFE calls a routine located at 0x138C95. So, I simply put that offset into the Field Usage part of the item manager, and voila, you now have a fully working Town Map.

Here's a video demonstrating the working Town Map:
http://romhacktube.com/video/B54SGO9739XB/Working-FRLG-Town-Map-in-Emerald




How to change the Ralts that Wally fights:

Spoiler:


Um, okay, not really much to say here, but mess with the bytes at 0xB0870. I really don't know how it works, but just change the bytes there, and you'll eventually get what you want. If someone can tell me how the data works, that would be great.

To make Wally fight a Weedle, simply change the bytes at 0xB0870 to:
0D 21 4A

Doing that will give you this:
http://a.imageshack.us/img189/7001/pokemonemerald.png

Also, I don't think this really matters, but at 0xB088C, you can change that byte to change the battle intro, such as making the Team Aqua logo appear, making the Battle Frontier logo appear, make Kyogre's symbol appear, make Regice's symbol appear, etc.



How to make a portable clock:

Spoiler:

1. Open up Item Manager
2. Scroll down to whatever item you want to replace
3. Click on the Arrows right next to Save
4. On the menu next to, "Type", select "01 Out of Battle"
5. Right next to "Field Usage", replace the numbers with: 8137CC9


Credits:
JPAN - He told me the offset at where the Special table in Emerald is located. I would have figured none of this out if he didn't tell me.

Whoever made the Pointer Calculator - It's awesome

ZodiacDaGreat - Item Manager

Logan August 26th, 2010 9:18 AM

Good research and stuff, man. I already knew about Wally's Ralts but this will definitely help me (and others, too) when I get around to making a hack on Emerald. :)

Spherical Ice August 26th, 2010 9:23 AM

Awesome work Chaos! I'll bear this in mind when working with Emerald! It's bound to help a lot of people! <:

giradialkia August 26th, 2010 10:01 AM

Nice, dude (I thought I already posted here..?).
The Town Map info is interesting, people haven't looked too much at the FireRed items in Emerald before, so kudos for making it work. ;)

Chaos Rush August 26th, 2010 11:18 AM

Added how to make a portable clock. Here's a video:
http://romhacktube.com/video/NAMK43BMRR9D/Portable-Clock-in-Emerald

Once again I figured it out simply by calculating the pointer in the special that activates the clock. So, theoretically, we could turn the effect of any Special into an item, you just have to know the offset that the routine is.

EDIT: Does anyone know what the offset of the special table is in Pokemon Ruby? I'd like to experiment with a few things.

Logan August 26th, 2010 12:17 PM

Quote:

Originally Posted by Chaos Rush (Post 6105039)
Added how to make a portable clock. Here's a video:
http://romhacktube.com/video/NAMK43BMRR9D/Portable-Clock-in-Emerald

Once again I figured it out simply by calculating the pointer in the special that activates the clock. So, theoretically, we could turn the effect of any Special into an item, you just have to know the offset that the routine is.

EDIT: Does anyone know what the offset of the special table is in Pokemon Ruby? I'd like to experiment with a few things.

Well, based on this response I think I'll move this over to R&D and you can use it as a document/research page. :)

Amabane~* August 26th, 2010 3:00 PM

Thanks, Chaos. I was just thinking about start a Emerald hack just now^^

But I need to find how to change that Rayquaza's sillouette in the start screeen now...¬¬

Feel yourself welcome to teach us new tricks for Emerald! Is quite hard to find documentation for hacking that game...

Shiny Quagsire August 26th, 2010 11:17 PM

Would it be possible to extract the clock routine, edit some pointers, and reinsert it into fire red? It's been puzzling me for a while now :\

Gamer2020 August 27th, 2010 9:15 AM

Quote:

Originally Posted by Chaos Rush (Post 6103848)
How to change the Ralts that Wally fights:
Spoiler:


Um, okay, not really much to say here, but mess with the bytes at 0xB0870. I really don't know how it works, but just change the bytes there, and you'll eventually get what you want. If someone can tell me how the data works, that would be great.

To make Wally fight a Weedle, simply change the bytes at 0xB0870 to:
0D 21 4A

Doing that will give you this:
http://a.imageshack.us/img189/7001/pokemonemerald.png

Also, I don't think this really matters, but at 0xB088C, you can change that byte to change the battle intro, such as making the Team Aqua logo appear, making the Battle Frontier logo appear, make Kyogre's symbol appear, make Regice's symbol appear, etc.

I think I can explain this. (If someone with better ASM knowledge sees a mistake please correct me. My knowledge is very basic :P)

In BPEE this is what is originally at that offset.

Code:

080B0870 21C4    mov    r1,0xC4
080B0872 0049    lsl    r1,r1,0x1
080B0874 2205    mov    r2,0x5


After your edit this is what it looks like.

Code:

080B0870 210D    mov    r1,0x0D
080B0872 004A    lsl    r2,r1,0x1
080B0874 2205    mov    r2,0x5


Ok now let me start explaining. In this case the vaule for the Pokemon is the 0xC4.

Code:

080B0870 21C4    mov    r1,0xC4


Now if you convert that to Decimal you get 196. Now you must be thinking, "That's not RALTS' hex value". Well it isn't.

Code:

080B0872 0049    lsl    r0,r1,0x1


That makes it so it is. lsl = Logical Shift Left (If I remember correctly XD)

So you take 0xC4 and convert it to binary. You get 11000100. (Use windows calclator.)

You then multiply it by 10 so that the values "shift" 1 to the left. You get 110001000. Convert that back to hex and you get 188.

That should be RALTS' value. I am to lazy to check.

Lets take a look at this line.

Code:

080B0874 2205    mov    r2,0x5


I'm pretty sure that 0x5 is the level :P

Now let's look at your edit.

Code:

080B0870 210D    mov    r1,0x0D
080B0872 004A    lsl    r2,r1,0x1
080B0874 2205    mov    r2,0x5


0x0D is WEEDLE's value. Looks good except for one thing.

Code:

080B0872 004A    lsl    r2,r1,0x1


That can be done better.

If you put the following you will have the same result :P Only do it for value 0xFF or lower. Otherwise use the lsl way.

Code:

080B0872 1C00    mov    r0,r0


http://i450.photobucket.com/albums/qq223/Gamer2020/1986-Pokemon-EmeraldVersionU-Copy_01.png

HackMew August 27th, 2010 9:22 AM

Quote:

Originally Posted by shiny quagsire (Post 6106759)
Would it be possible to extract the clock routine, edit some pointers, and reinsert it into fire red? It's been puzzling me for a while now :\

Nope, it's not easy like that. Either way, what clock routine are you talking about? There are actually many of them.

Quote:

Originally Posted by Gamer2020 (Post 6107690)
If you put the following you will have the same result :P Only do it for value 0xFF or lower. Otherwise use the lsl way.

Code:

080B0872 1C00    mov    r0,r0


http://i450.photobucket.com/albums/qq223/Gamer2020/1986-Pokemon-EmeraldVersionU-Copy_01.png

Actually, it can be done even better. Instead of replacing the logical left shift with an "useless" instruction, it would be better to use an "add r1, #0x0". The way the original routine is made, will always multiply by 2 the Pokémon ID. With the add command instead you might want to do something like:

Code:

mov r1, #0xFF
add r1, #0xXX


Where XX would be an appropriate value for anything from Treecko onwards. Otherwhise, if you don't need anything below Celebi, then XX could simply be set to 00.

EDIT: BTW... even if you can choose any value with the above method, some Pokémon will just not work. There's a sort of check and AFAIK should be intended for legendary Pokémon only. You can eventually patch that (I remember I did it before, you might want to do a quick search).

Gamer2020 August 27th, 2010 10:21 AM

Yes that makes sense.

Alright so,
Code:

mov    r1, 0xXX 'First Pokemon Value.
add    r1, 0xXX 'Added Pokemon Value for Pokemon higher then 0xFF.
mov    r2, 0xXX 'Level of Pokemon.


And yeah legendary Pokemon don't work. They cause the game to freeze.

At least you can see I pay attention when you talk about ASM stuff LOL
I'm learning slowly :P

Chaos Rush August 27th, 2010 10:45 AM

I have a question: Would it be possible to port the Vs Seeker from FR/LG over to Emerald? I'd like to figure out how to make more useless FR/LG items work in Emerald.

HackMew August 27th, 2010 12:54 PM

Quote:

Originally Posted by Chaos Rush (Post 6107884)
I have a question: Would it be possible to port the Vs Seeker from FR/LG over to Emerald? I'd like to figure out how to make more useless FR/LG items work in Emerald.

Usually anything that doesn't go beyond hardware capabilities is doable. I honestly didn't get the "useless" part.

Sierraffinity August 27th, 2010 2:45 PM

I have some useful additions to the thread...
The people above me already figured out the Ralts editing, but what about editing the Zigzagoon Wally uses?
Now, that's contained in another special. The offsets that you have to edit are 0x139472 (PKMN) and 0x139482 (level).
Again, you have to change the lsl command for the add one, but otherwise, you're good to go.

Another thing: disabling the checkgender while flying to Littleroot Town.
Well, the thing is very easy to hack this time: just replace 0x124E62 with 00000000. Or, with some ASM knowledge, you could overwrite the bytes to give you a different situation in a different place.
Also, the bytes around that area are for more special locations: like Ever Grande City, Southern Island, and the Battle Frontier.

HackMew August 27th, 2010 3:05 PM

Quote:

Originally Posted by diegoisawesome (Post 6108471)
I have some useful additions to the thread...
The people above me already figured out the Ralts editing, but what about editing the Zigzagoon Wally uses?
Now, that's contained in another special. The offsets that you have to edit are 0x139472 (PKMN) and 0x139482 (level).
Again, you have to 0000 out the lsl command, but otherwise, you're good to go.

I was able to do the same on Ruby a while ago. However, if you just replace the left shift that way, you won't be able to use anything above Celebi (or 0xFF, for that matter). So the "add method" is preferred IMHO.

Sierraffinity August 27th, 2010 3:08 PM

Quote:

Originally Posted by HackMew (Post 6108521)
I was able to do the same on Ruby a while ago. However, if you just replace the left shift that way, you won't be able to use anything above Celebi (or 0xFF, for that matter). So the "add method" is preferred IMHO.

Yeah, I know that. I should have said that XD

Chaos Rush August 27th, 2010 4:44 PM

Quote:

Originally Posted by HackMew (Post 6108255)
Usually anything that doesn't go beyond hardware capabilities is doable. I honestly didn't get the "useless" part.

Useless as in they don't work in Emerald. For instance, the Town Map item in Emerald does absolutely nothing because you're not supposed to obtain it in the game.

Zeffy August 27th, 2010 9:36 PM

I actually got to starting how to make the Vs. Seeker work for Emerald. I haven't done much, though.

Anyways, this will really help more in hacking Emerald.

>Dante< August 28th, 2010 12:45 AM

Your work it's very very interesting and good...but I've some questions about emerald^^"
- first of all...the town map and the portable clock stuff working also for R/S??
- it's true that there are too possibility that emerald crashed then R/S??
- maybe you know that Emerald (as FR), work with dynamic pointers...it's possible to fix it with static pointers?
for example...if you look this thread that I've opened some time ago...
http://www.pokecommunity.com/showthread.php?t=210193
I explained how, with a easy Writebytetooffset, you can do an instant change of camera becouse Ruby use a static offset...
how can I do it in emerald (for example)??

Chaos Rush August 28th, 2010 9:17 AM

Quote:

Originally Posted by >Dante< (Post 6109800)
Your work it's very very interesting and good...but I've some questions about emerald^^"
- first of all...the town map and the portable clock stuff working also for R/S??
- it's true that there are too possibility that emerald crashed then R/S??
- maybe you know that Emerald (as FR), work with dynamic pointers...it's possible to fix it with static pointers?
for example...if you look this thread that I've opened some time ago...
http://www.pokecommunity.com/showthread.php?t=210193
I explained how, with a easy Writebytetooffset, you can do an instant change of camera becouse Ruby use a static offset...
how can I do it in emerald (for example)??

About the Town Map and portable clock, it should definitely be possible on Ruby, since all I did for Emerald was just input the offset of the corresponding special's routine in Item Manager. It's just that no one appears to know the offset of the special table in Ruby...

But I guess you could find out by searching, "?? ?? ?? 08 ?? ?? ?? 08 ?? ?? ?? 08 ?? ?? ?? 08..." in a hex editor.

Team Rocket's Raichu August 28th, 2010 6:17 PM

Now how about the Zigzagoon that chases the professor around at the beginning. How would that be changed to something else.

I'm not to sure what to look for in a hex editor, and that is why I am asking. (I really wish I had more to contribute than a question, but hey. That is how people learn... by asking questions!)

Gamer2020 August 28th, 2010 7:22 PM

Quote:

Originally Posted by Team Rocket's Raichu (Post 6111566)
Now how about the Zigzagoon that chases the professor around at the beginning. How would that be changed to something else.

I'm not to sure what to look for in a hex editor, and that is why I am asking. (I really wish I had more to contribute than a question, but hey. That is how people learn... by asking questions!)

I could find it if I had the offset for the special table but I am to lazy too debug and get it...

Sierraffinity August 29th, 2010 4:52 AM

Well, then I can help.
0x1DBA64 - special table for BPEE

Team Rocket's Raichu August 29th, 2010 12:23 PM

^ So if I had that number I could go to that offset in a hex editor and change Zigzagoon's hex number to another PKMN's hex number?

Sierraffinity August 29th, 2010 12:58 PM

Quote:

Originally Posted by Team Rocket's Raichu (Post 6113917)
^ So if I had that number I could go to that offset in a hex editor and change Zigzagoon's hex number to another PKMN's hex number?

Well, actually, no. What you have to do is get the correct routine address, then go there and disassemble the routine. Then search for a number that resembles Zigzagoon's hex number (although it might be divided by 2, check and see) and change it accordingly.


All times are GMT -8. The time now is 8:58 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 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 - 2016 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.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.