• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Research: Exploring Ruby and Emerald

LCCoolJ95

Limited Capacity
638
Posts
14
Years
Before you say anything, I am NOT flaming anyone. I respect everyone's work on these forums.

Adding new moves, creating new battle backgrounds for new moves, creating new battle effects, creating new abilities, expanding the amount of songs, TMs, Pokémon (over 1000 can be added) within a 3rd generation ROM, form changes of Pokémon...

Tell me, this is amazing, right? You would love to put this within Ruby and Emerald ROMs, correct?

Unfortunately, most of these are not possible, within them. Instead, they are all focused on Firered. As you may know, Firered has been edited immensely with many awesome and amazing features, and can be turned into a totally different game. That, or demakes of 4th and 5th generation games.

But, what about Ruby and Emerald (Sapphire and Leafgreen are sort of there, but I don't see many hacks of those games)? I've seen many wonderful hacks made using Ruby and Emerald. Light Platinum, Flora Sky, CrystalDust, Glazed, any of the Ruby Destiny series (In my opinion, Quartz was okay, but not as fantastic. More confusing than anything haha). LP, FS, G, and the RDS have fantastic storylines, and CD is a great demake of Crystal. So nostalgic, it makes me want to cry for joy whenever I play it.

One thing that I did was I updated some of those games. For example, Light Platinum (NOT THE + VERSION), I added new moves, new abilities, and proper cries to the Pokémon. But, you know, what bums me out is that Pokémon are replaced for other Pokémon. Also, no one has a clue on adding in abilities to those games (i.e. Machamp having No Guard in Emerald). Also, and I've seen it done in Firered, expanding the amounts of TMs within a game.

HMs? Eh...that's a big maybe.

There are currently 100 TMs in the current, main storyline Pokémon games. There are 50 TMs in the 3rd generation games...

*flips table* THAT'S NOT ENOUGH D-:<

Ahem, sorry about that. It is possible to have Reusable TMs within either Firered or Emerald however. Here, this is a video showing this within Emerald. Also, this is not advertisement, but reference:


Now, I'll just tell you right now, I am an avid Emerald hacker. I have made a few, personal Emerald ROMs. Fully changing storylines, implementation of the Fairy-type, I even worked on my own personal Black 2/White 2 Demake. Now I'm just freestyling, working on whatever Emerald ROM mod I feel like. But now, everything came to a halt, when I found out that more Pokémon can be added to a 3rd generation. To be more specific, 1020 Pokémon can be added. I don't know why you would want a game with over 1000 Pokémon in it, but that's totally your business.

But, anyways, do you know how amazing that would be if Ruby and Emerald has these features? Yes, I understand that all three of them differentiate vastly, but at least someone has to look into it. I have been doing it, but it's too big of a job for just one person. I want to see if anyone is interested in looking into the data of the games.

In general, Firered isn't the only Pokémon game everyone wants to edit. Ruby and Emerald hacks do exist, and I feel that they should be looked into as well, because I can't do it all alone, so I need help with this, if anyone would be so kind. Thank you, and have a nice day! :)
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
Before this becomes a sea of nothingness, let's get a focus here: The purpose of this thread is supporting research on Ruby and Emerald. This is why I have moved it to R&D. Let's use this thread to only submit research about games other than FR.

Rules:
-Only post if you have something to contribute. Posts like:

"^^^I totally agree!" and "Your idea is awful man." are absolutely pointless and will be removed.

-Ask questions only if you are willing to do the work. Don't just ask how to do something simply because you want someone else to do it. Start a discussion and work together to delve deeper into the mystery.

-This is not Simple Questions. If it can already be done, don't ask it.


Now let's get to work!
 

Tlachtli

Crit happens.
267
Posts
12
Years
EDIT: I realized that my Light Metal had a pretty big oversight in it, so I'm getting to work on fixing that. In the meantime, I'll post some simple-but-useful ASMs for battle scripts.

I've actually been doing some work on getting some Gen 4-6 abilities into Emerald. With Jambo's callasm method for his Battle Script Pro, a lot of them can be done with a combination of battle scripting and relatively simple asm. BSP's damage multiplier can only handle integer multiplication though and a lot of damage multipliers are fractional, so I wrote a couple simple ASMs that can be called in place of the regular damage multiplier command. The 1/2 damage ASM (and others) could be used for several applications, they just need to be called after calculatedamage but before any hp removal.

x0.5 Damage:
Code:
.align 2
.thumb

Start:
    push {r0-r1}
    ldr r0, .input
    ldr r1, [r0]
    lsr r1, #1
    cmp r1, #0x0
    bne Finish
    add r1, #0x1

Finish:
    stm r0!, {r1}
    pop {r0-r1}
    bx lr

.align 2
.input:    .word 0x020241F0 /*attack damage*/
x0.75 Damage:
Code:
.align 2
.thumb

Start:
    push {r0-r2}
    ldr r0, .input
    ldr r1, [r0]
    mov r2, #0x3
    mul r1, r2
    lsr r1, #2
    cmp r1, #0x0
    bne Finish
    add r1, #0x1

Finish:
    stm r0!, {r1}
    pop {r0-r2}
    bx lr

.align 2
.input:    .word 0x020241F0 /*attack damage*/
*Note: the 0.5 and 0.75 multiplications will never return zero damage, because if the logical shift results in zero damage 0x1 will be added to make it nonzero. If you want to change that so it can give zero damage, just get rid of the cmp/bne/add lines above Finish.

x1.25 Damage:
Code:
.align 2
.thumb

Start:
    push {r0-r2}
    ldr r0, .input
    ldr r1, [r0]
    mov r2, #0x5
    mul r1, r2
    lsr r1, #2
    stm r0!, {r1}
    pop {r0-r2}
    bx lr

.align 2
.input:    .word 0x020241F0 /*attack damage*/
x1.5 Damage
Code:
.align 2
.thumb

Start:
    push {r0-r2}
    ldr r0, .input
    ldr r1, [r0]
    mov r2, #0x3
    mul r1, r2
    lsr r1, #1
    stm r0!, {r1}
    pop {r0-r2}
    bx lr

.align 2
.input:    .word 0x020241F0 /*attack damage*/
*Note: the values given for addresses only apply to BPEE, for any other version they need to point to the proper memory addresses.

I have psuedo-code written/planned for probably 25-30 in-battle abilities, I just need to go through the grunt work of actually typing out the scripts and asm's.
 
Last edited:

Deokishisu

Mr. Magius
990
Posts
18
Years
To create reusable TMs is pretty easy in Emerald. Open up Item Editor, navigate to the TMs, and change the first mystery value to 1. Then, change the Price of all of the TMs to 0 so that the player can't sell them.

The TMs will be reusable, unable to be held, and won't have x01 next to them in the Bag.

HOWEVER, this is not true BW functionality. In BW, when TMs were used, they did not restore the PP of the move they were replacing. So, if you had a Pokemon with 2 PP left on Water Gun, and you replaced it with Water Pulse from a TM, the newly learned Water Pulse would only have 2 PP.

Without some ASM to replicate that feature, TMs basically work as Ethers. If I was low on Water Pulse PP, I would simply teach my Pokemon another TM to overwrite it, then learn Water Pulse again and have full PP.

Tlachi, could you share your code that puts the Physical/Special/Status symbols on the summary and move learning screens? (Also, the small glimpses of your ROM that you're leaking through your sig look amazing. Great work!)

Also, does anyone know where the type for the Egg is stored? We could change Curse to a Ghost type move, Eggs (which were ???-type in 3rd gen) to the Normal-type, and recycle the ??? Type into the Fairy Type for Ruby and Emerald. With Doesntknowhowtoplay's PSS patch, we won't have to worry about our ??? replacement doing, like, no damage. With the ability to change the Egg's type, we wouldn't have to change ??? into Normal, Normal into Fairy, and then shuffle all the types around.

EDIT: Jambo, I believe, figured out how to increase the Pokemon on Ruby in Chaos Rush's old 649 on Ruby project. But, as far as I can remember, the information wasn't released. Perhaps some of that knowledge would be applicable to Emerald as well? This is actually not correct. See the post below this one.

EDIT2: I'd also like to link to a post I found on another forum that basically increases the amount of freespace you have easy access to on Emerald. This right here. It's pretty informative in general about how Emerald freespace works, so that's also cool. The extra space will let us do a bit more in unexpanded ROMs. If anyone has found that the space freed up in this tutorial isn't actually free, please let me know and I'll remove this edit, or advise the reader to change up the offsets a bit.
 
Last edited:
1,323
Posts
16
Years
  • Seen Dec 9, 2023
EDIT: Jambo, I believe, figured out how to increase the Pokemon on Ruby in Chaos Rush's old 649 on Ruby project. But, as far as I can remember, the information wasn't released. Perhaps some of that knowledge would be applicable to Emerald as well?
Actually he didn't. He did research on it (thank you, Jambo) but ultimately concluded that Ruby's coding is a huge mess and that because of how a lot of the pointers are hard-coded, they're near impossible to find. Now, I don't know how similar the code is between Ruby and Emerald, but I do know that Emerald, like FireRed, uses a malloc system for the Pokédex. According to SBird, Emerald does indeed use a malloc (Ruby doesn't at all), but apparently the way it works is rather different from FireRed: http://www.pokecommunity.com/showpost.php?p=8133791&postcount=70
 

Deokishisu

Mr. Magius
990
Posts
18
Years
So, I thought that maybe the Egg's type and other data was stored in the slot after Chimecho (whose name is "-"), but it appears not. That data just seems to be garbage. I'm sure other people thought of this before I did, but I decided to check and confirm for myself. If you're looking to change the Egg's ???-type, don't look there.

Fun fact, the - Pokemon seems to function normally when given to the player ingame, with the exception of freezing the game when you try to heal it at a Pokemon Center. It is Tough and Cute-type, with a garbage ability. It has a sprite, but it only shows for a split second, and it is the second frame of the Egg, the cracked one.

UqdrGPs.png
 

LCCoolJ95

Limited Capacity
638
Posts
14
Years
To create reusable TMs is pretty easy in Emerald. Open up Item Editor, navigate to the TMs, and change the first mystery value to 1. Then, change the Price of all of the TMs to 0 so that the player can't sell them.http://pokemonhackersonline.com/showthread.php?t=5742[/QUOTE]
I have done it, and this is not the way to do it.

It is not in Item Editor, it is within the ROM data itself (I'll post a link to the OP later tonight). Plus, if you set the price of TMs to 0, that would make buyable TMs easy to purchase, when certain ones are really not.

Also, at Tlachtil, nice work :)

And at Chaos Rush, I knew about that Ruby project for a while. I had a feeling Ruby's coding would be complex. But, if someone were to look more in-depth, it would be possible. I mean, there are things in Pokémon hacking that I thought that were impossible, but done. It just takes a lot of hardwork and dedication.
 

Deokishisu

Mr. Magius
990
Posts
18
Years
Plus, if you set the price of TMs to 0, that would make buyable TMs easy to purchase, when certain ones are really not.

The hacker would have to script up some way to keep the player from buying multiple instances of the same TM anyway; I figured they'd be smart enough to script up pseudo-marts for the TMs to give them a price while doing so. But, if you've figured out a way to make them unable to be sold but still have a price, please share! I'm sure buyable, unsellable items will have more uses than just for TMs!

In other news, I think I'm just going to try to Find+Replace bytes in large ranges to see if I can get the Egg's type to change in Emerald. If it does, we'll know it's just a simple byte change and can narrow down exactly where it is. I'm currently searching for 09 09 (because 09 is the ???-type index number, and, in the base stats structure, a ???-type Pokemon would be 09 09 in its type field) and replacing it with 00 00 (pure Normal-type's index number). If anyone thinks this is a stupid idea, or that I should be searching for something else, please speak up. I'm basically hacking blind here.
 
Last edited:

LCCoolJ95

Limited Capacity
638
Posts
14
Years
Well, here's something that you guys will like (credit to itari):

Spoiler:

Reusable TMs in Emerald...have at it, and I'll look through Ruby to see it work as well. Now, let's look to see how expanding the amount of TMs within the games are possible :)
 
Last edited:

AtecainCorp.

Rejishan awake...
1,377
Posts
15
Years
From my personal Pokemon Ruby things. I found many ways <YOURSELF> For editing things like.
- Adding extra 25 Pokemon <Still Investigate to Add cries without ASM. But it was comming close that moment where I must learn how to change cries code>
- Porting Music from GSC and other GBC and GB games to GBA games <Even with unused themes. Simple method to make them usable>
And some other things.

It's true. Pokemon Ruby have mesed code with a lot of leftovers from Pokemon Crystal game Code. Now I searching about revive TIME CAPSULE for Pokemon RSE. I know that is in game code leftover text of Time Capsule about Pokemon Center. Meybe with game editing code is possible to link Pokemon Crystal with Pokemon Ruby by Wireless Comunication. I know that a lot of GSC hackers like Mateo or Koolboyman Implement Wireless function on its games. It need's investigation. Meybe some of you help me with that tasks. That make an great option for porting Gen 1 pokemon to Gen 6 by some steps. I mean that need update avaible game codes for trading. In Pokemon GSC add AXVE and for Pokemon Ruby add code of Pokemon Crystal.
 

Deokishisu

Mr. Magius
990
Posts
18
Years
From my personal Pokemon Ruby things. I found many ways <YOURSELF> For editing things like.
- Adding extra 25 Pokemon <Still Investigate to Add cries without ASM. But it was comming close that moment where I must learn how to change cries code>
- Porting Music from GSC and other GBC and GB games to GBA games <Even with unused themes. Simple method to make them usable>
And some other things.

It's true. Pokemon Ruby have mesed code with a lot of leftovers from Pokemon Crystal game Code. Now I searching about revive TIME CAPSULE for Pokemon RSE. I know that is in game code leftover text of Time Capsule about Pokemon Center. Meybe with game editing code is possible to link Pokemon Crystal with Pokemon Ruby by Wireless Comunication. I know that a lot of GSC hackers like Mateo or Koolboyman Implement Wireless function on its games. It need's investigation. Meybe some of you help me with that tasks. That make an great option for porting Gen 1 pokemon to Gen 6 by some steps. I mean that need update avaible game codes for trading. In Pokemon GSC add AXVE and for Pokemon Ruby add code of Pokemon Crystal.

From Crystal? That's not really factual. The only real reason the GBC hacks have "wireless" functionality is because the emulators we play on have to link somehow, and you're not gonna force someone to USB their phones/computers to each other. Either way, with the huge overhauls that happened to how Pokemon Data was structured in Gen 3, as well as how the GBA and GBC differ in how they link, there's no way you'll be able to trade back to Gen 2 without losing data from the Pokemon; and with how much that would have to be generated for a Pokemon traded up from Gen 2, well, you may as well just catch a brand new one in the later Generations. Let's focus on things that are actually possible and realistic.

You're not adding 25 more. You're replacing placeholder Pokemon in between Celebi and Treecko. We've been doing that for years. Now, if you've figured out how to give them cries, that would be something new. But when you catch those placeholders, the Pokedex sequence normally crashes the game, because they don't have dex data associated with them.

Music porting has also been done from the older consoles up into the GBA.
----

In other news, I haven't made much headway on changing the Egg's type. Will report back when I have something to add.
 

LCCoolJ95

Limited Capacity
638
Posts
14
Years
Well... Yes... But I found method of implementing Dex entries for extra Pokemon which do not crushing games.
I know of your method...your way is not legitimate.

According to Jambo:

Spoiler:


In short, your way has a 100% chance of breaking Ruby/Emerald. I should know this, I have tried expanding the amount of Pokémon within Ruby and Emerald before...I think I speak for all hackers here, we do NOT want our ROM hacks in progress broken.

However, if someone were to find a real, non-breaking way to do this in those games, that would be awesome :3
 
252
Posts
11
Years
  • Age 27
  • Seen Jul 6, 2019
I don't think so. I test in a lot of times. Only Footprints was broken. But is easy to fix.
Have you been reading what Karatekid552 and Jambo51 have been telling you in the past? Here, I'll just quote them:

Karatekid552 said:
I know that every single routine has an overflow check to make sure that things aren't loaded that shouldn't be. The only reason your "hack" works on Ruby is because the check was misplaced for 411 instead of 386 like it should have been. This does not exist on any new games. The check is specifically set for 386.
(quoting this from your VM with Karatekid, hope you don't mind)

Jambo51 said:
1) You do not account for the seen and caught flags, meaning this works purely by dumb luck for the first 25, and not at all for any above that.

2) It will NOT work on FR, LG or Emerald, because all 3 of these games employ ASM limiters to limit the length of the Pokédex, something you do not account for.

In short, your method is not desirable at all. It only works for Ruby because there was a mistake made when coding Ruby, as Karatekid mentioned. And your method does not work for Emerald, a game that a LOT more people hack. And 411 Pokemon? I'd rather have 649 Pokemon, for personal reasons. I'm not trying to bash you or anything, but your method isn't going to help people who hack Emerald, like me.
 

AtecainCorp.

Rejishan awake...
1,377
Posts
15
Years
Meybe. But i think that all who said that Pokemon Ruby is worse do not have right. For me Pokemon Ruby is easiest engine to edit. My method is first step to slove mystery of expanding Pokedex. Ok. I know. It need Footprints table repointing. But when we obtain NATIONAL DEX number of placeholders was shown correctly. From 387 to 411. Also extra footprints for them after repoint is easy to add. I also think, that ASM is not really needed to expand Pokedex. It must been somewhere in the game code Pointer which asigned how many Pokemon was in Pokedex.
 

LCCoolJ95

Limited Capacity
638
Posts
14
Years
Meybe. But i think that all who said that Pokemon Ruby is worse do not have right. For me Pokemon Ruby is easiest engine to edit. My method is first step to slove mystery of expanding Pokedex. Ok. I know. It need Footprints table repointing. But when we obtain NATIONAL DEX number of placeholders was shown correctly. From 387 to 411. Also extra footprints for them after repoint is easy to add. I also think, that ASM is not really needed to expand Pokedex. It must been somewhere in the game code Pointer which asigned how many Pokemon was in Pokedex.
...you know, I'm not going to start a flame war or anything with you. I'm someone who prefers to make peace amongst people. I hate fighting.

Okay, first of all, you MUST listen to the advice HidoranBlaze and I just stated from hackers who have a vast amount of knowledge of Pokédex expansion and ASM hacking. They have looked within the ROM itself. Not just through a hex editor, but the RAM itself. Let me just tell you the facts from my friend Jambo51:

Spoiler:


The three games, Ruby, Fire Red, and Emerald, all have been programmed differently, so the Pokédexes (Pokédexs? I don't know haha) have been done differently. Trying to force the game to extend the amount of Pokémon (and Pokédex entries) WITHOUT ASM WILL DESTROY THE GAME. Don't tell me over and over again that your way works.

Unless you can do it, THE CORRECT WAY WITH ASM, make a video, showcasing a Pokédex in RUBY and EMERALD that has, about, 500 Pokémon. Then, THEN I'll believe you. But for now, get off this thread.

God, I hope that I didn't break any mod rules.
 

LCCoolJ95

Limited Capacity
638
Posts
14
Years
Well, here's what Jambo himself told me about your method:

It's not impossible, it's impractical. There are over 100 (known) locations (and many more unknown) that need modified to make the extended dex work properly.

His method works by sheer fluke, not because it's a proper way to do it, and if he were to actually extensively test his method, he'd find it would break, and quite quickly at that, because his method does not take account of the fact that the data which is necessary to run the Pokédex is stored directly after the Pokédex in Ruby.

So say you have your 386 Pokémon Pokédex, that amounts to 8 * 386 bytes for that data, after that 8 * 386 bytes of data is more data that is necessary to run the dex.

His method doesn't move this data, which means that, eventually, his method will corrupt the Pokédex.

Make sense?
 
91
Posts
14
Years
  • Seen Feb 22, 2023
Whoa guys...

Maybe I can clear some of the things up... First of all: I cannot talk about ruby, since I have never looked at it, but I would imagine, that if there is no way of allocating more memory to the pokédex, it will likely crash your game soon if you just add entries due to the fact that the static data afterwards will be overwritten. That for ruby.

For emerald, the world is completely different: We have malloc, a different one though(Let's call it malloc2), the difference is, that malloc2 clears the space it allocates. Also, for emerald, the pokédex flags do not use malloc (I don't think they do in firered either), to add to here you need some sort of a save hack(Like Jambo's recycle hack) and you need to reallocate the flags yourself. The Pokédex memory uses static, global variables. So let's say we have the data(which by the way stores the GUI and all that visual shinanigance) at BASE_LOCATION, than the scrolling speed is stored at BASE_LOCATION + X and if we just add some entries, they will interfer with "X" which is the global variable. That may or may not make sense now, anyways to get over this fact you have to add a ton of entries, someone suggested doing this by an automated script, that works kind of fine. You also have to kill a lot of limiters, otherwise your data will not be shown or corrupt.

So, thats what I researched, if you still think there is something different I guess you have to take a look at the code yourself.

~SBird
 
Back
Top