• 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?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Quick Research & Development Thread

1,323
Posts
16
Years
  • Seen Dec 9, 2023
So lately I've been studying ASM a bit and gonna try and finally get it down. I've managed to locate parts of the START menu's code simply by finding their text pointer, and then the pointer to that table of pointers, and then looking at the surrounding code in VBA's disassembler. Whenever I saw something such "mov r2, #0x8", I wondered what would happen if I had a different value load into that register. As a result, I've figured this out so far:

0x0806EF94 = X positioning of [name] in the START menu.
Change it and you can reposition [name]:
HWEpZe8.png


0x0806EFD0 = the font used in the START menu.
00 gives you the smaller font. Any other value doesn't seem to do anything.
3vhCUhy.png


0x0806EFD4 = X positioning of the text in the START menu (except [name])
The default value is 08. This is what it looks like if you change it to 00:
VpItE5B.png

(Changing it to FF/giving longer text strings will NOT magically make the menu box's width longer unlike the multichoice boxes that the script engine uses)

0x0806F0DE = relative X positioning of cursor in START menu
0x0806F0E0 = relative Y positioning of cursor in START menu
By positioning, I don't mean the actual selection within the start menu, I mean the actual pixel coordinates of the cursor within the start menu.

None of this info is useful yet, but eventually I would like to port Emerald's START menu look onto FireRed because I find it more aesthetically pleasing.

But that's not all I found!

At 0x083A7344 is a table that basically controls the START menu itself. The format of the table goes like this:
[XX XX XX 08][YY YY YY 08]
XX XX XX 08 = pointer to text string within START menu (such as POKéDEX, POKéMON, BAG, etc.)
YY YY YY 08 = pointer to the routine of aforementioned function. Yes, I'm serious. You can literally switch around your START menu like this:
1ci5ayY.png

Notice how POKéMON is in the first slot like in B/W/B2/W2/X/Y, not POKéDEX like in Gens I-IV. And no, I did not just switch the text string pointer, I switched around the function pointers too. Don't believe me? Try it yourself! It's fun!

Here's the table at 0x083A7344 in detail:
41627D = POKéDEX text string
06F411 = POKéDEX routine (+1)

415A66 = POKéMON text string
06F44D = POKéMON routine (+1)

416285 = BAG text string
06F481 = BAG routine (+1)

41628E = [name] text string
06F4B5 = Trainer Card routine (+1)

416291 = SAVE text string
06F4E9 = SAVE routine (+1)

416296 = OPTION text string
06F4FD = OPTION routine (+1)

41629D = EXIT text string
06F541 = EXIT routine (+1)

4162A2 = RETIRE text string (Safari Zone)
06F555 = RETIRE routine(+1)

41628E = [name] text string
06F56D = ??? (+1) (fadescreen then freezes the game, I'm assuming its for the alternate Trainer Card shown during Link Battles/Trades)

Unfortunately I haven't been able to find what dictates how many entries the START menu gets, but hopefully with this knowledge, it will be a lot easier to implement something like the a PokéGear onto FireRed. Not to mention that these offsets are the actual routines used for the Pokédex, party screen, bag, Trainer Card, Save menu, and Options. I'm not joking lol, if you literally put this in a script:
Code:
//---------------
#dynamic 0x800000
#org @main
callasm 0x806F411 //this is the Pokédex routine offset from the START menu table
end
It will open up the Pokédex. You can literally use callasm and use any of the offsets from the table and it will load up that function!

So say, you wrote a custom PokéGear code. You can edit one of the function pointers in the table to your new code and voila, you'll have a PokéGear within your START menu. Of course, what would be more ideal is if we could figure out how to expand the number of entries the START menu gets. I'm sure it wouldn't be that hard, the thing is that I have no idea how to find the routine that the game uses when you actually press the START button.
 
Last edited:
3
Posts
9
Years
Nice find Chaos Rush!
Really fun to switch it, but note that the flag to active the Menu will be different.
~Original~
setflag 0x828 - Activates Pokemon Menu
setflag 0x829 - Activates Pokedex Menu

~Switched(Pokedex and Pokemon Menu)~
setflag 0x829 - Activates Pokemon Menu
setflag 0x828 - Activates Pokedex Menu
(If we doesn't change that will cause Oak give you pokedex when you choose a pokemon :D)
 
3
Posts
9
Years
I personally thought that block editing with A-map one-by-one was not a clever way.
Esspecially when we trying to redo the whole tileset.

When using block editor in A-map, the [offset:]slot will show the block offset when your mouse move on any block.
Go to hex editor and go to that offset(I use grass as example)and you will see something like this:

6E 02 6F 02 4C 02 4D 02 00 00 00 00 00 00 00 00

Copy and paste this code to the next offset and save.
Go back to A-map, now you will see the next block after the grass will become grass.

The code is actually how tile arranged on the block,

6E02 6F02
4C02 4D02

6E 02-> 02 6E which will be the tile no. 26E
6F 02-> 02 6F which will be the tile no. 26F
4C 02-> 02 4C which will be the tile no. 24C
4D 02-> 02 4D which will be the tile no. 24D

And changing the 0 to something else not higher than 12(C IN HEX) will change the pallete of that tile.
 
135
Posts
10
Years
  • Age 35
  • Seen Mar 10, 2024
I found something that bugs a lot of people, the fact HM moves cannot be deleted, can be easily erased on Fire Red.
I found the Emerald equivalents of the routines detailed in this post from earlier in the thread at 0x6E7CC and 0x1B6D14 respectively. It's not too difficult to extrapolate from there to the changes to disable HMs being undeletable.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
You can change the color filter used by flashbacks by changing the byte at 080572B0 to something else. So if sepia flashbacks are your thing then you can change it to 02, or alternatively you can have color flashbacks with 00.

EDIT: Apparently there's another address, 08057274, that needs tweaking as well. Same procedure, just different address.
 
Last edited:
9
Posts
9
Years
  • Age 32
  • Seen Jun 1, 2014
Just a quick little thing I just discovered about music editing with Sappy. Not sure if this has been covered before (probably), but felt like posting it in case anyone else ran into the same problem.

If you have a .s file where one or more of the tracks sounds all "wavy" (not quite sure how to describe it, but where the notes bend all the time instead of just playing normally), here's how to fix it:

- look at the track details of each track of your song in Sappy
- if the last number (should be an indigo color in sappy 2006) is anything other than 0, that is what is causing the bending
- open the .s file in notepad and navigate to the data for that track
- at the beginning of the track's data, you should see things like VOICE, VOL, PAN, etc.
- the one that controls the bending is MOD
- simply remove the line with the MOD byte and save the .s file

That removes the weird bending.

Not sure if this is even news but hope this helps someone. :P
 

Wobbu

bunger bunger bunger bunger
2,794
Posts
12
Years
Just a quick little thing I just discovered about music editing with Sappy. Not sure if this has been covered before (probably), but felt like posting it in case anyone else ran into the same problem.

If you have a .s file where one or more of the tracks sounds all "wavy" (not quite sure how to describe it, but where the notes bend all the time instead of just playing normally), here's how to fix it:

- look at the track details of each track of your song in Sappy
- if the last number (should be an indigo color in sappy 2006) is anything other than 0, that is what is causing the bending
- open the .s file in notepad and navigate to the data for that track
- at the beginning of the track's data, you should see things like VOICE, VOL, PAN, etc.
- the one that controls the bending is MOD
- simply remove the line with the MOD byte and save the .s file

That removes the weird bending.

Not sure if this is even news but hope this helps someone. :P

You can also remove modulations from the actual midi with Anvil Studio's event editor. If you do it that way, the modulations won't appear again in case you have to remake your S file. But S files are useful for finding how many modulations are in each track if you use notepad and the search feature :D
 
9
Posts
9
Years
  • Age 32
  • Seen Jun 1, 2014
You can also remove modulations from the actual midi with Anvil Studio's event editor. If you do it that way, the modulations won't appear again in case you have to remake your S file. But S files are useful for finding how many modulations are in each track if you use notepad and the search feature :D
Doing it straight from Anvil sounds really handy! I didn't think to do that because I could never actually hear the modulations when listening through Anvil, only when opening in Sappy.
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
Doing it straight from Anvil sounds really handy! I didn't think to do that because I could never actually hear the modulations when listening through Anvil, only when opening in Sappy.

The mod command is quite necessary for most DS songs. Know why? It controls the way the instrument goes from one speaker to the next. To correct it type modt, 12 right under the mod command. Or you can use ipatix' tool MIDFIXforAGB.exe, which does this for you. My mega huge sappy tutorial covers this :D
 
135
Posts
10
Years
  • Age 35
  • Seen Mar 10, 2024
The Pickup table in Emerald is at 0x31C440. It consists of two lists of values, the first for common items, the second for rare items starting at 0x31C464.

e: The Pickup routine is at 0x55C00, and the move command table is at 0x31BD10. There seem to be quite a few blocks in that region of pointer tables followed by data used by the routines they point to.
 
Last edited:
1
Posts
11
Years
  • Seen May 23, 2015
Hi I'm beginner,

I'm trying to understand how is all data about mapping stored. I found this article, which explain some structure of data.

Code:
datacrystal.romhacking.net/wiki/Pok%C3%A9mon_3rd_Generation

But it is uncompleted, it is missing information about block structure, animation structure, etc... Is there any better research/document ? I can't found any.

Thank you for your help.
 
25
Posts
12
Years
  • Seen Aug 25, 2017
Hey there, i need the offset of the generateOAM function + its parameter.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
Hey there, i need the offset of the generateOAM function + its parameter.
The function is located at 08006F8C in Fire Red. I have it formatted as such in my personal .h I've used:
Code:
u32 createSprite(int *template, int *XPos, int *YPos, int *i)
Arguments are pretty self explanatory, except template and i. Template is basically the unit as described here under object_template, and all you need is the proper formatting to get it going. i is usually left at 0 and I haven't actually checked to see what it is. I believe it might have to do with it's priority over other sprites.
 
25
Posts
12
Years
  • Seen Aug 25, 2017
Thank you for your help.

I'm a German, and i don't know for sure wether i understood the template. Is this simply a pointer to the oam's animation data? And what if the object has'nt any animation. Will the obj disappear after displaying all frames listed in the template?

And in what registers i have to transfer ( i don't know how to say this, sorry) each param?

- Viz0r
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
Thank you for your help.

I'm a German, and i don't know for sure wether i understood the template. Is this simply a pointer to the oam's animation data? And what if the object has'nt any animation. Will the obj disappear after displaying all frames listed in the template?

And in what registers i have to transfer ( i don't know how to say this, sorry) each param?

- Viz0r

It's a tad bit complicated, and I haven't actually done this in ASM before so I could be wrong. Basically though, the first four arguments of the function correspond to r0-r3 respectively. As for the template, if you can understand C I'd suggest taking a look at some example coding here where I created a obj_template as a struct along with all the data needed for it. The first two word values (each are two bytes) are usually 2 and 1 based on existing templates in the ROM. Then you have a pointer to the basic OAM data you'd find in the GBA's OAM memory. The rest of it I usually keep to the values 0, 0x08231CFC, 0x080EE4DD, and 0xFF simply because that's what has always worked for me. The animation table is fairly straightforward. You have two bytes for the tile number and two for the duration. 0xFFFF ends the animation and usually removes the sprite, and 0xFFFE will loop it forever.

Let me know if you have any questions, and feel free to browse around some of my C code where I use these functions quite a bit. If you're good with C it might make a bit more sense for you, but otherwise I'd suggest reading up in knizz's research thread.
 
25
Posts
12
Years
  • Seen Aug 25, 2017
Isnt there any way creating OAM without using a entry in the template table? i mean the Overworlds are sureley not genereted due to this table, arent they?
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
Isnt there any way creating OAM without using a entry in the template table? i mean the Overworlds are sureley not genereted due to this table, arent they?

NPCs are actually a lot more complicated due to their dynamic nature and interactability in the game. They have a lot of traits which makes them a tiny bit difficult to add in through ASM (I have yet to do it myself to be honest). And yes, every single OAM in the game is made using this method. While it seems difficult now, once it's created it's all downhill. GameFreak has methods for easily moving, scaling, rotating, and deleting these OAMs, which makes things much easier in the long run as opposed to making a GBA OAM.
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Possibly odd question, has anyone ever looked into/seen any research into removing the pokedex? Mainly, the pop-up when you catch a new pokemon?

I imagine it would take some hardwiring, since it's not something scripting could deal with - unless the sequence can be repointed/reorganised in hex I'm guessing it's an ASM job?
 
Back
Top