Pmd2 eos asm locations: Difference between revisions

From ProjectPokemon Wiki
Jump to navigation Jump to search
(Created the base structure of the page and added a few functions to the list for now. More to do!!)
 
(Added more explanations, and locations)
Line 7: Line 7:
== Overview ==
== Overview ==
This page contains list of the interesting offsets within the game's binaries.
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 ==
Functions pointers and some documentation on them.
Functions pointers and some documentation on them.


=== ARM9 Bin ===
=== ARM9 Bin (0x2000000) ===
{| class="wikitable"
{| class="wikitable"
! Name
! Name
Line 30: Line 32:
|
|
*r0: Pointer to allocated buffer
*r0: Pointer to allocated buffer
| This function allocates a buffer on the heap of the desired size, and returns a pointer to it.
| 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'''
| '''MemFree'''
Line 58: 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!
|-
| '''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.
|}
|}


Line 66: Line 78:
== Constants ==
== Constants ==
Addresses of static constant values.
Addresses of static constant values.
=== ARM9 Bin (0x2000000) ===
{| class="wikitable"
! 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"
|}

Revision as of 20:28, 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!
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"