PDA

View Full Version : Useful Emerald Stuff


Chaos Rush
August 25th, 2010, 09:01 PM
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:

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:


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:

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

Hashtag
August 26th, 2010, 09: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, 09: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.

Hashtag
August 26th, 2010, 12:17 PM
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, 03: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, 09:15 AM
How to change the Ralts that Wally fights:


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.


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.


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.


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.


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.


080B0874 2205 mov r2,0x5
I'm pretty sure that 0x5 is the level :P

Now let's look at your edit.


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.


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.


080B0872 1C00 mov r0,r0
http://i450.photobucket.com/albums/qq223/Gamer2020/1986-Pokemon-EmeraldVersionU-Copy_01.png

HackMew
August 27th, 2010, 09:22 AM
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.

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.


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:


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

diegoisawesome
August 27th, 2010, 02: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, 03:05 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 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.

diegoisawesome
August 27th, 2010, 03:08 PM
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, 04:44 PM
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, 09: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, 09:17 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)??

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, 06: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, 07:22 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!)
I could find it if I had the offset for the special table but I am to lazy too debug and get it...

diegoisawesome
August 29th, 2010, 04: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?

diegoisawesome
August 29th, 2010, 12:58 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?
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.

Team Rocket's Raichu
August 30th, 2010, 02:34 PM
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.

Okay, when I have some more free time. I'll check it out, and see if I can find anything. I'm to busy right now to do it, maybe the weekend.

U_Flame
October 19th, 2010, 06:47 PM
The portable clock seems like an amazing idea! I'm currently hacking Sapphire, what do I need to do to make a portable clock there?

Gamer2020
October 19th, 2010, 09:35 PM
The portable clock seems like an amazing idea! I'm currently hacking Sapphire, what do I need to do to make a portable clock there?
Find the special table, calculate which is the pointer for the clock routine, and then put that as the item routine thing.

itari
October 20th, 2010, 04:35 AM
Wow. This really useful stuff. Especially to me because I'm a total looser at hacking Emerald. So, this helps me a lot. Thanks!

dt200
November 7th, 2010, 11:34 PM
I hope you find it out for R/S too.
:)

SnapTime
December 21st, 2010, 10:08 PM
thanks so much!
this is gonna help with my emerald hack

Farful
December 28th, 2010, 06:31 PM
thank you. you've convinced me to hack emerald!!!

droomph
December 19th, 2011, 04:09 PM
Wow, I freaking feel like a loser. I can't do anything on my own, can't I?

Well anyways thanks for the pointer for the clock special. I can probably work something out from there.

EDÐIT:Hah wow I stoopid

WintersDreaming
December 28th, 2011, 01:06 AM
Thankyou I can finally get rid of the PokeNav :)

Falchion
April 5th, 2012, 04:11 PM
Isnt there a way to hack the trainers backsprite in emerald

FirEmerald
October 16th, 2012, 05:21 PM
This document contains ALL the LZ77 compressed data offsets in pokemon Emerald(not deep scan), so those of you with a pokemon Emerald rom can rip the images.

Bond697
November 9th, 2012, 11:10 AM
i was honestly not expecting to find this:

ROM:082E1880 ReadFlashID:
ROM:082E191C FlashTimerIntr:
ROM:082E1944 @ u16 __fastcall SetFlashTimerIntr(u8 timerNo, void (**IntrFunc)(void))
ROM:082E1980 StartFlashTimer:
ROM:082E1A28 StopFlashTimer:
ROM:082E1A6C ReadFlash1:
ROM:082E1A70 SetReadFlash1:
ROM:082E1AB0 ReadFlash_Core:
ROM:082E1AD4 @ void __fastcall ReadFlash(u16 secNo, u32 offset, u8 *dst, u32 size)
ROM:082E1B70 VerifyFlashSector_Core:
ROM:082E1BA0 @ u32 __fastcall VerifyFlashSector(u16 secNo, u8 *src)
ROM:082E1D5C @ u16 __fastcall IdentifyFlash()
ROM:082E1DFC PollingSR_COMMON:
ROM:082E1E9C @ u16 __fastcall EraseFlashChip_LE()
ROM:082E1F10 @ u16 __fastcall EraseFlashSector_LE(u16 secNo)
ROM:082E2074 ProgramFlashByte_LE:


there's more, but i need to finish going through the static library

AntiRellik1
October 15th, 2013, 07:12 PM
Let's say I activate the FRLG Town Map in Emerald, and I edit the graphics in unLZ... but what about modifying flying locations or editing the map/town locations in Advance Map? AMap would show up the Hoenn map, not the FRLG one.

Shiny Quagsire
October 15th, 2013, 08:30 PM
Let's say I activate the FRLG Town Map in Emerald, and I edit the graphics in unLZ... but what about modifying flying locations or editing the map/town locations in Advance Map? AMap would show up the Hoenn map, not the FRLG one.

When he says the FRLG Town Map, he means he's editing the leftover FRLG item to actually work with the PokeNav map, not adding the actual FRLG map.

AntiRellik1
October 16th, 2013, 07:32 PM
When he says the FRLG Town Map, he means he's editing the leftover FRLG item to actually work with the PokeNav map, not adding the actual FRLG map.

Oh. I thought that actually using the FRLG Town Map in Emerald would work, considering the data must be there along with the rest of the leftover FRLG stuff.

The advantage of that is that we could have a much bigger world map.... RSE has only one for all Hoenn, FRLG has 1 for Kanto and 3 other screens/pages for the Sevii Islands.