• 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

89
Posts
10
Years
Chaos Rush or Shiny Quagsire, could you please post the tables that control how frames alternate between each other? Also, I would appreciate it if someone actually posts how to find limiters, I haven't seen a tutorial for this of all important things, as I intend to try and expand the animation table in Emerald and the Abilities table.
 

sonicfan7895

Just a dude, I guess
122
Posts
13
Years
I did some research into TM extension in Emerald. It seems that the TMs are located at 616040. When I looked at the data, they were two bytes long each. It was a move IDs, in hex, FLIPPED. I used a Pokémon Ruby Gameshark Codes listing to prove it (Here's the link: http://www.ign.com/faqs/2004/pokemon-battle-e-gameshark-sp-codes-list-541208). For example, the move ID for Focus Punch, or or Fighting Punch as the rough Japanese to English translation, in hex would be 108. However, within the TM Data,
it is actually 08 01. It just flipped the first number, 01, with the two other numbers, 08.

The TMs in hex are:
Spoiler:


But what about the HMs? They follow right after:
Spoiler:


I asked someone about this, and they stated that, no matter what, if the move IDs (in hex) are added BEFORE the HM data, this would be the beginning of the expansion of TMs in the game. HMs, however, will always be the last 8 move IDs (in hex).

Here, I just did an example of doing this process, using an expanded moves table:
Spoiler:


If you compare it to the original, there are an extra 50 TMs added. Now, I just need to know how to make the legitimate TM item work. If someone were to look into that, that would be awesome.

I think if we need to make more legitimate TM items work, we would first need to take a large chunk of data starting at wherever the item table starts (which in this case is at 0x5839A0), and take the entire item table (plus a larger chunk of data in order to account for how many more TMs we may need (in this case, 50)), and copy & paste it into free space, change all pointers to the NEW item table, and give respective item stats (sell price, mystery values, etc.). Judging from a certain hex viewer, the item data should last anywhere from 20-34 bytes long, but I can't tell for sure. The hex viewer I'm looking through is called ps2dis, which is actually a hex viewer for handling files specifically for PS2 games, but it works in a pinch (it also views hex in NORMAL hex order, not REVERSE hex order). For actually teaching the new TMs, I believe we would also have to repoint the TM/HM compatibility table within the game (located at 0x252BC8), so that the entire table accounts for the new TMs being able to be taught to a Pokemon. Not only that, but we would also have to put the TM data (starting at 0x616040, ending at 0x6160b0 with Dive), and put new data in between Overheat and Cut (if there are 50 new TMs you want to insert (at least two bytes per new TM), we would have to insert 100 new bytes of data for all the new TMs, which would result in the table ending later. Say the new TMs table was at something like 0xE40000, and I added 100 bytes to the already present bytes for the TMs, that would mean that the new table would end at 0xE4006C. In themselves, they would be pointers to the moves being taught in question (if I'm not mistaken). There's so much to do that it might take a while before expanding on the amount of TMs could even come close to working for Emerald. Anyone want to help in furthering our understanding on item data, and more importantly, come up with a more viable solution to expanding on the amount of TMs within Emerald? I kind of sound like I don't know what I'm talking about, but I think you could see where I'm going with this?
 
252
Posts
10
Years
  • Age 27
  • Seen Jul 6, 2019
I think if we need to make more legitimate TM items work, we would first need to take a large chunk of data starting at wherever the item table starts (which in this case is at 0x5839A0), and take the entire item table (plus a larger chunk of data in order to account for how many more TMs we may need (in this case, 50)), and copy & paste it into free space, change all pointers to the NEW item table, and give respective item stats (sell price, mystery values, etc.). Judging from a certain hex viewer, the item data should last anywhere from 20-34 bytes long, but I can't tell for sure. The hex viewer I'm looking through is called ps2dis, which is actually a hex viewer for handling files specifically for PS2 games, but it works in a pinch (it also views hex in NORMAL hex order, not REVERSE hex order). For actually teaching the new TMs, I believe we would also have to repoint the TM/HM compatibility table within the game (located at 0x252BC8), so that the entire table accounts for the new TMs being able to be taught to a Pokemon. Not only that, but we would also have to put the TM data (starting at 0x616040, ending at 0x6160b0 with Dive), and put new data in between Overheat and Cut (if there are 50 new TMs you want to insert (at least two bytes per new TM), we would have to insert 100 new bytes of data for all the new TMs, which would result in the table ending later. Say the new TMs table was at something like 0xE40000, and I added 100 bytes to the already present bytes for the TMs, that would mean that the new table would end at 0xE4006C. In themselves, they would be pointers to the moves being taught in question (if I'm not mistaken). There's so much to do that it might take a while before expanding on the amount of TMs could even come close to working for Emerald. Anyone want to help in furthering our understanding on item data, and more importantly, come up with a more viable solution to expanding on the amount of TMs within Emerald? I kind of sound like I don't know what I'm talking about, but I think you could see where I'm going with this?
The item data structure has been documented pretty well, actually. You can look at Bulbapedia, or this thread. It's 44 bytes for each item.

With TM expansion, the compatibility table can't be extended with a simple repoint, since the structure is limited to 8 bytes per mon. Luckily, I've found the routine that reads this table (and optimized it, actually), so expanding the structure to 16 bytes per mon, which should be more than enough, won't be hard. I also believe I've found the limiters for the TMs. The main problem I'm running into actually is item limiter problems, which I'm too lazy to fix at the moment. Once I force myself to work on this though, TM expansion should be a thing.

Of course, there's bag space problems that'll probably show up as well. I'll probably just have people deposit their TMs in the PC or something, because screw memory allocation. Not going to find a solution to that. But yeah, that's basically the info I have on TM expansion.
 
199
Posts
12
Years
  • Seen Jul 18, 2016
With TM expansion, the compatibility table can't be extended with a simple repoint, since the structure is limited to 8 bytes per mon. Luckily, I've found the routine that reads this table (and optimized it, actually), so expanding the structure to 16 bytes per mon, which should be more than enough, won't be hard.

Would it be possible to do this with the Move Tutors too?
 

Joexv

ManMadeOfGouda joexv.github.io
1,037
Posts
11
Years
Ok so im posting some title screen logs from emerald,so that someone better at tracing that me can do something with them.
Spoiler:

also 0xde03c8 -----Press Start Pallet

Something I found odd about the log is that the only raw file is the Title screen image, is the entire title screen controlled by asm?

Also upon editing the press start button's location and repointing this appeared in the log
LZ77UnCompVram: 0x09000000,0x06004800 (VCOUNT=150)
This offset is not going to be the same as yours since this is an edited rom.
Upon going to it in gba graphics editor it looks like some raw file, but it isnt.. Its odd. When edited in anyway even reinserting it with the exact same image deletes the Pokemon logo. which is why i feel like its a raw file. It also has a pallet, which I forgot to write the offset down....
qa0dILy.png


And here is the pallet location for the color of the flashing colors of the title screen BEFORE the whole image appears. 0x5dffb0 first 3 colors are the flashing colors. Rest unknown or maybe the colors for the emerald logo.

Hopefully this information will come of use to someone.
 
Last edited:
89
Posts
10
Years
By the way, does anyone have the offsets of the tables that need to be repointed to expand the number of Pokémon animations on Emerald? And also, how do they work? I want to change how the frames are flopped between each other.
 
40
Posts
9
Years
Hello,

How do attacks work? When an attack is chosen, is it load somewhere in ram in a defined address? And the foes, the attack's user, the type of the attack?
Where does the stat changes (like after leer or growl) are stored? And confusion? And field effects (like after spikes)?
 
457
Posts
10
Years
  • Age 29
  • Seen Apr 9, 2024

Emerald Encounter Music

I don't know where should I post this. But then I guess I have found this thread that deals about every research done for R/S/E engine. Was this right? Well, let's just move on to the main topic...

I have been using Unnamed Trainer Editor always for trainer editing. I also wondered why it doesn't list up which encounter music uses (being 0 to end being 0x1A0). I have research that on. And, guess what? Just like in FireRed, an assigned encounter music number plays a certain theme. Since UTE didn't listed up for Emerald so here it goes:

Encounter Themes:
  • 0x0: The Youngster encounter theme which music number is 0x17C
  • 0x1: The Lass encounter theme which music number is 0x197
  • 0x2: The Tuber encounter theme which music number is 0x17B
  • 0x3: The Bug Maniac encounter theme which music number is 0x1A7
  • 0x4: The Black Belt encounter theme which music number is 0x1A0
  • 0x5: The Cool Trainer (now Ace Trainer) encounter theme which music number is 0x1A1
  • 0x6: The Team Aqua encounter theme which music number is 0x1A3
  • 0x7: The Team Magma encounter theme which music number is 0x1B9
  • 0x8: The Swimmer encounter theme which music number is 0x181 (edit at 0xB1C30 to change song number 81 01 00 00)
  • 0x9: The Kid encounter theme which music number is 0x1C1
  • 0xA: The Elite Four encounter theme which music number is 0x1C2
  • 0xB: The Hiker encounter theme which music number is 0x1C3
  • 0xC: The Reporters Gabby and Ty encounter theme which music number is 0x1C5
  • 0xD: The Gentleman encounter theme which music number is 0x18D

0xE until 0xF (14 until 255) plays the Bug Maniac encounter theme which music number is 0x1A7. Alright! That goes for a while. I still need to research them more since there are further information about them on how they work and how they are listed up. I will update this post as soon as I have gathered information.

One important thing: If you have followed the tutorial of expanded Pokedex for Emerald, the ninth step messes up the load of 0x8 encounter music which I have discovered earlier. It seems that in the first twenty-nine 81 01 00 00-s, something related to encounter themes are there. To fix the 0x8 encounter music once again: go to 0xB1C30 then type 81 01 00 00.

To conclude this, you can have no longer translating the Controlling/Extending Encounter Music which is only for FireRed. You can have fourteen kinds of encounter music in Emerald (than FireRed being three unless you have applied that hack) Alright! That concludes for a while. Hope this helps.

Emerald Overworld and Battle Textboxes

Getting lazy all the time screwing up with the unLZ and VBA's Logs? There are few people ask about that nowadays. Alright! For being fair, here are the data you need... again for Emerald:

Emerald Overworld Textbox: 0x08DDD768 (uncompressed image)
Emerald Overworld Textbox Palette: 0x08DDD728 (uncompressed palette)
Emerald Battle Textbox: 0x08C00000 (compressed image)
Emerald Battle Textbox Pal: 0x08C004E0 (compressed palette)

I guess you know what compressed and uncompressed images and palettes are? Good! These things can be done in the latest version of NSE. Good luck!
 
Last edited:

Joexv

ManMadeOfGouda joexv.github.io
1,037
Posts
11
Years
Not really that big of a deal but quite annoying, but pallet 12 for Emerald's sprites causes any sprite assigned to it to be frozen facing down. Good for store clerks or pokeballs, but not really for npcs.
So just a heads up for u peeps.

EDIT: So it turns out any pallet with a pal register 4a000000 is effected with the freeze. Simply changing it to a safe pal register should fix it. I may get a list of safe ones made up soon.
 
Last edited:
218
Posts
10
Years
  • Seen Nov 12, 2021
Spoiler:

I think there is an issue in the routine because everytime I use a move it says "Scizor transform into the type!" what type ?
Maybe a wrong argument is used or a bad address because every moves have a correct STAB, but the defense part won't work. I mean if I'm transformed in dark type, dark moves are neutral for exemple.
Any clue ?

EDIT : Nevermind I am a dumb, it works perfectly.. Except for a pokemon that is double type, scizor for exemple. If I use bullet punch and receive a fight move, it's supper effective
And for the type list one, it a weird coincidence that it shares the same number of the ability (6A). It has something to do with the ability's number ou simple coincidence ? Not sure
Don't forget to change .MoveData: .word 0x08E3E680 into your actual move data location. It took me one hour to figure out why it did not work x)

EDIT 2 : Protean seems to work just one time
Seems to be fixed if I change 6A to the number of my ability in my typelistone
 
Last edited:

Trainer 781

Guest
0
Posts
I
I think there is an issue in the routine because everytime I use a move it says "Scizor transform into the type!" what type ?
Maybe a wrong argument is used or a bad address because every moves have a correct STAB, but the defense part won't work. I mean if I'm transformed in dark type, dark moves are neutral for exemple.
Any clue ?

EDIT : Nevermind I am a dumb, it works perfectly.. Except for a pokemon that is double type, scizor for exemple. If I use bullet punch and receive a fight move, it's supper effective
And for the type list one, it a weird coincidence that it shares the same number of the ability (6A). It has something to do with the ability's number ou simple coincidence ? Not sure
Don't forget to change .MoveData: .word 0x08E3E680 into your actual move data location. It took me one hour to figure out why it did not work x)

EDIT 2 : Protean seems to work just one time
Seems to be fixed if I change 6A to 51 in my first typelist

Protean always changes the pokemon to a monotype regardless of the initial typing. So a surf using protean greninja changes to a mono water type.
 
218
Posts
10
Years
  • Seen Nov 12, 2021
I

Protean always changes the pokemon to a monotype regardless of the initial typing. So a surf using protean greninja changes to a mono water type.

Well, it works fine then.

But a thing to note :
You can edit almost all the move that deal damage at once :
Spoiler:


You just have to repoint all the 2D8A00 pointer on A207A0 (in my example), but there's some move that need an individual editing like earthquake (a pain to me) or hyper beam (perhaps other, I'll edit).
So, the effect for : Absorb, hyperbeam earthquake, fly/bounce/dig/dive, multi-hit moves, return, magnitude and doom desire have to be edited individually, the rest is handled by the first script

EDIT : There you can fix earthquake :
Spoiler:


Don't use dynamic offset with bsp with a script that long, it doesn't compile correctly

Earthquake works perfectly now !

EDIT : Tried this way for multi hit move :
Spoiler:


My poke's type changes indeed and I have a beautiful freeze

I tried million times, can't figure out
I have one version that allow the poke to change type, hit the foe but then it freeze

Here is one cool, don't know why, it display a weird message instead of "hit X times"

Spoiler:


Think I get confuse but anyway, it could gives an idea to someone skilled x) :
Spoiler:


Ok you know what is a dumb ? No you cannot because you don't know me. Anyway I get tired I guess, so if you still want a working script :
Spoiler:


I think you can do the same for every "special effect" like fly and so. I'll edit
Works for Fly and the other. Only hidden power remains normal type, as Tlatchli said.
 
Last edited:
Back
Top