Pmd2 eos asm locations: Difference between revisions

From ProjectPokemon Wiki
Jump to navigation Jump to search
(Added more explanations, and locations)
(β†’β€ŽARM9 Bin (0x2000000): added load file function)
Line 60: Line 60:
| none
| none
| This function would print to the debug log a printf formated string. But in the retail game it does nothing. Its interesting to note that its still called in the released games and is passed various debug strings and value which can be really useful for research!
| This function would print to the debug log a printf formated string. But in the retail game it does nothing. Its interesting to note that its still called in the released games and is passed various debug strings and value which can be really useful for research!
|-
| '''LoadFileFromRom'''
| 0x2008C3C
| NA
| NA
|
*r0: PtrReturnStruct(Struct is 2 32bits integers, first is ptr of file buffer, second is loaded file length)
*r1: PtrStrFilePath (Ptr to path to the file to load)
*r2: Unknown (Set to 0 usually)
| Unknown
| This function will load a file from the rom filesystem into a heap allocated buffer. The function allocates the buffer, and fill it with the file data. The address to the buffer containing the file data and its size in bytes are put one after the other into the 8bytes of memory pointed by r0 when running the function!
|-
|-
| '''HandleSIR0Translation'''
| '''HandleSIR0Translation'''

Revision as of 21:00, 17 December 2016


Overview

This page contains list of the interesting offsets within the game's binaries. The offsets are NDS memory relative, because that's more useful that bin files offsets. Just subtract the binary's load address to get its respective file offset.

Functions

Functions pointers and some documentation on them.

ARM9 Bin (0x2000000)

Name Offset NA Offset EU Offset JP Parameters Return value Description
MemAlloc 0x2001170 NA NA
  • r0: alloc size
  • r1: unknown
  • r0: Pointer to allocated buffer
This function allocates a buffer on the heap of the desired size, and returns a pointer to it. The second parameter's role is unclear.. It might be a flag, since it doesn't seems to change the amount of memory allocated. It can be set to 0.
MemFree 0x2001188 NA NA
  • r0: buffer to free
none This function free a buffer that was allocated by MemAlloc.
ZeroFill 0x2003250 NA NA
  • r0: Buffer to fill
  • r1: Length to fill
none This function fills the given buffer with zeros.
DebugPrint 0x200C240 NA NA Unknown none This function would print to the debug log a printf formated string. But in the retail game it does nothing. Its interesting to note that its still called in the released games and is passed various debug strings and value which can be really useful for research!
LoadFileFromRom 0x2008C3C NA NA
  • r0: PtrReturnStruct(Struct is 2 32bits integers, first is ptr of file buffer, second is loaded file length)
  • r1: PtrStrFilePath (Ptr to path to the file to load)
  • r2: Unknown (Set to 0 usually)
Unknown This function will load a file from the rom filesystem into a heap allocated buffer. The function allocates the buffer, and fill it with the file data. The address to the buffer containing the file data and its size in bytes are put one after the other into the 8bytes of memory pointed by r0 when running the function!
HandleSIR0Translation 0x201F4B4 NA NA
  • r0: PtrToPtrSIR0BegOfData
  • r1: PtrSrcFileBuffer
none This function translates the offsets of a SIR0 file, and change the magic number in the header to SIRO. It places a pointer to the first pointed location in the SIR0 header into the ptr pointed to by r0.

Static Variables

Addresses of static variables and buffers.


Constants

Addresses of static constant values.

ARM9 Bin (0x2000000)

Name Offset NA Offset EU Offset JP Length(bytes) Type Description
PackFilesPathsTable 0x20AF6A0 NA NA 24 char*[6] Contains a list of pointers to path strings to all known pack files. The game uses this table to load its resources when launching dungeon play!

Should contain pointers to the strings:

  • "MONSTER/monster.bin"
  • "MONSTER/m_attack.bin"
  • "MONSTER/m_ground.bin"
  • "EFFECT/effect.bin"
  • "DUNGEON/dungeon.bin"
  • "BALANCE/m_level.bin"