• 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: Emerald Info Archive

droomph

weeb
4,285
Posts
12
Years
Hey guys...

As you probably know, Emerald has the most features and would be awesome to hack.

As you probably also know, not much is known about Emerald, and thus not many people want to hack it.

Also, I want to find out about Animations, but that's a different story.

However, I can't stand not having all the features, so I decided to make a ROM map.
Spoiler:
Example:
It shouldn't be that hard, if we all work together, no?
----------------------------
WANTED
(like, really)
- Any Dynamic Memory Allocation routines (e.g. realloc(), calloc(), free())
- Integer (rounds toward zero) Arithmetic Routines (Already have Division, Modulus)
- Offsets and lengths of scripts that are not main-story (like Tile Behavior Bytes)
- Any Standard C functions you see; basically anything that someone would use often
- Some Cleanup help :\
-------------------------
Anyways, this is what I have:
Spoiler:
I'm about 10% done. Maybe if we work together, the 90% will be a snap! Bah, doohicky

For the awesome BIOS and pre-installed functions I've done my best to see that they're accurate. However, I can't guarantee 100%, and frankly you shouldn't be playing with it anywho.

Progress: 13.5804%/32.1086% (0x5232AFb) as of March 17, 2012

Don't be afraid to put stuff up; if you have even one new offset, it's very much appreciated.
----------------------
Credits​

I would like to thank these fellow PokéCommunity Members for contributing to this "project" (if you would even call it that), however small their contribution:
Spoiler:
 
Last edited:
28
Posts
15
Years
  • Seen Jan 20, 2019
do you want full routines or just offsets?

also:

0x98E - 0x99D IRQ BIOS branch 1 (0xFb) unsure!

-pretty sure this is the header part of malloc()(and it starts at 8000988)
 

droomph

weeb
4,285
Posts
12
Years
28
Posts
15
Years
  • Seen Jan 20, 2019
e: nvm, gonna go ahead and start putting stuff up.

80003A4-8000466 - AgbMain(800042A-80004BE, main loop)
82E70AC-82E70B8 - soft reset
80B5144 - 80B516E - battle test
80004c4 - 80004d6 - callbackMain
80004d8 - 80004fc - define callback pointers
82e7be0 - 82e7c9e - doMod
80b4984 - 80b4a88 - feebas + feebas tile setup
80005bc - 80005d6 - initCounters
8000684 - 80006cc - initIRQ
80005e4 - 800061c - input handler
8000248 - 8000398 - intrMain
80fc0a0 - 80fc0ae - in safari zone check
8000988 - 800099c - malloc header (A3A3, etc)
8000b1c - 8000b2c - initMalloc
80009b8 - 8000a1c - mallocMain
8000b38 - 8000b46 - malloc()
82e93d4 - 82e9430 - memcpy(void *pDest, void *pSrc, u32 length)


i'll grab the rest from my database and post it in a bit.

e: i just noticed you linked over to my work on project pokemon. good stuff.

and i have a lot more disassembly to do for emerald to get more code laid out, etc in IDA. once i do, i'm sure i'll have quite a bit more to add.

also, someone should do this for black and white. i have 675 functions labelled from the arm9 binary alone. srsly.
 
Last edited:

droomph

weeb
4,285
Posts
12
Years
Oh hey looky I didn't recognize you, you were the one that found almost all the offsets for Emerald ^^

(and if you're still on Project Pokémon you should help do some clean up btw)

Anyways, thanks, I'll look over them asap
 
28
Posts
15
Years
  • Seen Jan 20, 2019
clean up what? not sure what you mean. here are the rest from my database, btw:


8067e90 - 8067ef4 - method H pid gen
806d088 - 806d096 - get nature from temp pids
80b4d78 - 80b4e64 - nature setup
80fc3b8 - 80fc3e4 - pokeblock check
80b4a98 - 80b4aa8 - alternate rng
80b4ac8 - 80b4b80 - set encounter slot
806f5cc - 806f5e4 - rand() (main @ 0x3005d80)
806f620 - 806f630 - rand() (secondary @ 0x3005d84)
8000204 - 8000234 - reset vector
8000560 - 800057a - seed main rng (this function never runs)
80006fc - 8000700 - callbackA+0x10
8000708 - 800070C - callbackA+0x14
800072c - 8000730 - callbackA+0x18
80006f0 - 80006f4 - callbackA+0x0C
8000540 - 800054e - callbackB
80b4c74 - 80b4cf4 - set level for wild+
806f5f8 - 806f606 - setRNG (also never runs)
806f610 - 806f618 - set secondary rng (runs for daycare)
82e04dc - 82e0592 - set up sound + buffer @ 3006380
82e70a8 - 82e70aa - register ram reset
82e7084 - 82e7086 - cpuset
82e7090 - 82e7092 - lz77uncompwram
8000554 - 800055a - set timer1CNT
8000738 - 80007da - vblank handler
8000588 - 800058C - fetch result from 0x02020000 (location of timer1 data writes - for seeding rng(not used) and for creating the trainer id)


that's everything for now until i take more apart in IDA.
 
Last edited:
10
Posts
12
Years
  • Seen Nov 19, 2013
I have a question: in emerald,is there a part of memory never used?
cause i want to store some temp data in the memory.
 

droomph

weeb
4,285
Posts
12
Years
I have a question: in emerald,is there a part of memory never used?
cause i want to store some temp data in the memory.
There's some parts of the 256KB WRAM (0x2000000 on) that are completely blanked out as far as I can tell, you could try those. If you want to SAVE, however, you need to test them yourself; I'm not sure if the whole of the 256+32KB RAM is saved in the save file. If not, then probably you'll need to pick some unused-but-saved bytes (like the two "padding" bytes in Pokémon stats) and use those.

Or, you could remove contests; that could free up a couple hundred bytes.
 
10
Posts
12
Years
  • Seen Nov 19, 2013
There's some parts of the 256KB WRAM (0x2000000 on) that are completely blanked out as far as I can tell, you could try those. If you want to SAVE, however, you need to test them yourself; I'm not sure if the whole of the 256+32KB RAM is saved in the save file. If not, then probably you'll need to pick some unused-but-saved bytes (like the two "padding" bytes in Pokémon stats) and use those.

Or, you could remove contests; that could free up a couple hundred bytes.

Thanks,could you please tell me the address of that "completely blanked out" part?
 

droomph

weeb
4,285
Posts
12
Years
There's many; if you have VBA on PC, you can search through the memory-map tool from 0x2000000 on, you'll find parts that are completely filled with 00s (nulled out). They might have a purpose, however, so I suggest you test them first.
 
10
Posts
12
Years
  • Seen Nov 19, 2013
Thank you very much,actually i wanna make a npc who can tell you the individual values of your 1st pokemon,and now i can store the ivs into the memory (i used 0x20500a0),but i dont know how to use xse script to get the value...Do you have any idea to do this?
 

sonic1

ASM is my life now...
77
Posts
15
Years
Not to mention that ewram only goes up to 02040000 (256kb).
Anyways,

080FB36C ->Truck_Sequence of newgame (ran by callback3)
 

droomph

weeb
4,285
Posts
12
Years
Thanks for your reply ,but i dont understand this,could u explain it ?
That's for the ROM map, which is what the original post is going to be.

EDIT: I now realize how much of an ass I sounded like. I'm sorry if I offended you ^^ no hard feelings?
 
Last edited:

hinkage

Everyone currently in an argument with this member
383
Posts
13
Years
  • Age 28
  • Seen Apr 15, 2024
What do you mean by "Rumbly truck thing (run by callback3)"

If I zero this out, will it make the truck intro go away?
 

droomph

weeb
4,285
Posts
12
Years
Yes, but you will have to add a bx rd to the front of the newly nulled-out section so that it returns every time it's called (because it still will be called).

Alternatively you can use a tool that I recently found around these forums - it's called Truck Remover - that will do all that crap for you.I hope you know how to search

Edit: OH AND HAY GUIZE I really need to know how the LZ77 thing works so I can add all that cool stuff ^^ and possibly squeeze another 2% out Ö
 
Last edited:
28
Posts
15
Years
  • Seen Jan 20, 2019
8084310 - make trainer id set
80842cc - store trainer id set

i should spend some time idly scrolling through the disassembly in ida at some point soon and see if i can pick some more stuff out.. maybe tomorrow.

e:

800a850 - debug printing function
 
Last edited:
Back
Top