Jump to content

RAM map (Boktai 1): Difference between revisions

no edit summary
No edit summary
Line 1: Line 1:
This is the RAM map for Boktai 1 (U). <!-- Please create a new page for maps of other languages! For example "RAM map (Boktai 1, J)". -->
This is the RAM map for Boktai 1 (U). [[ROM map (Boktai 1)|Go to ROM map]].
<!-- Please create a new page for maps of other languages! For example "RAM map (Boktai 1, J)". -->


= EWRAM =
= EWRAM =
{| class="wikitable"
|-
! Address || Type || Description
|-
| 0x020011c0 || i32 || [[Solar sensor]]: Calibrated level (0=dark, 140=max brightness. Calibrated level = calibration - raw level, then clamp to 0-140)
|-
| 0x020011c2 || i32 || Solar sensor: Bars. Calculated from calibrated level (0=dark, 8=max brightness)
|-
| 0x0203c800 || u16[1024] || [[Random number generator|RNG table]] (generated by the bootstrap RNG once on power-on)
|-
| 0x0203d800 || byte[?] || [[#Stat struct]]
|-
| 0x0203e000 || byte[?] || Stat struct - backup (created on screen transitions, reloaded on death, saved to save file when saving)
|-
| 0x0203e800 || byte[?] || [[#World struct]]
|-
| 0x0203ec00 || byte[?] || World struct - backup
|-
| 0x0203f000 || byte[?] || [[#Scratch struct]]
|}


== Stat struct ==
== Stat struct ==
Line 7: Line 29:
|-
|-
! Address || Type || Description
! Address || Type || Description
|-
| 0x0203d80a || i16[7] || Grenade amounts
|-
| 0x0203d88c || i16 || Equipped lens
|-
| 0x0203d88e || i16 || Equipped frame
|-
| 0x0203d892 || i16 || Equipped grenades
|-
| 0x0203d892 || i16 || Equipped battery
|-
|-
| 0x0203d8b0 || i32 || Unlock Astro battery (must be set to <code>*(*0x03001c90 + 0x7dc)</code>)
| 0x0203d8b0 || i32 || Unlock Astro battery (must be set to <code>*(*0x03001c90 + 0x7dc)</code>)
|-
|-
| 0x0203d8f0 || i16[3] || Django position
| 0x0203d8f0 || i16[3] || Django position
|-
| 0x0203d91e || i32 || Solar sensor: Calibrated level (see 0x020011c0)
|-
| 0x0203dc18 || i16 || Item inventory size
|-
| 0x0203dc1a || i16[42] || Item inventory IDs
|-
| 0x0203dc6e || i16[42] || Item inventory amounts
|-
| 0x0203dcc4 || i32 || Lens inventory (bitmask, 1 bit per lens and level)
|-
| 0x0203dcc8 || i32 || Frame inventory (bitmask)
|-
| 0x0203dcd0 || i32 || Battery inventory (bitmask)
|-
| 0x0203dcd8 || i16[8] || Lens EXP
|}
== World struct ==
{| class="wikitable"
|-
! Address || Type || Description
|-
| 0x0203e8c5:6 || bit[64] || "Chest opened" flags for current area (resets on area change)
|}
|}


Line 35: Line 91:
! Address || Type || Description
! Address || Type || Description
|-
|-
| 0x03004610 || void** || Pointer to current [[Map file]] descriptor (usually/always 0x02000010)
| 0x03000630 || i32 || Solar sensor interface: State (0=measuring, 1=resetting, 2=idle)
|-
| 0x03000634 || i32 || Solar sensor interface: Counter (0-511, counts half-cycles of the 74LV4040 counter chip)
|-
| 0x0300063c || i32 || Solar sensor interface: shift out (next value to be written to GPIO_DATA)
|-
| 0x03000648 || void* || [[Script directory]]: Script index pointer
|-
| 0x03000648 || void* || Script directory: Script count
|-
| 0x03000108 || treasure_data* || Pointer to this map's [[#Treasure data]] (NULL if map has no treasures)
|-
| 0x03001c2c || i16 || Solar sensor: Bars. See 0x020011c2.
|-
| 0x03001c90 || void* || Pointer to Django's actor data?
|-
| 0x03001cc8 || void* || Pointer to linked list of bat enemies?
|-
| 0x03004478 || i32 || [[Random number generator|Bootstrap RNG seed]]
|-
| + 0x18 || i32 || Current lens level
|-
| + 0x7dc || i32 || Astro battery unlock password
|-
| 0x030044f8 || i32 || Solar sensor interface: Is enabled (true/false)
|-
| 0x030044fc || i32 || Solar sensor interface: Last result (GPIO_DATA & 8)
|-
| 0x03004508 || i32 || Solar sensor interface: Raw level (counter / 2 when GPIO_DATA & 8 becomes nonzero. 0=max brightness, 255=dark)
|-
| 0x03004520 || void* || [[Bytecode]]: Program counter
|-
| 0x03004524 || void* || Bytecode: Return value
|-
| 0x0300450c || i32 || Solar sensor interface: Timer interval (TM3CNT_LO will be set to -this value)
|-
| 0x03004610 || struct* || Pointer to current [[Map file]] descriptor (usually/always 0x02000010)
|-
|-
| + 0x00 || i32 || Number of [[Map file#Zone data|Zones]]
| + 0x00 || i32 || Number of [[Map file#Zone data|Zones]]
Line 54: Line 146:
|-
|-
| 0x03004620 || i32 || [[Random_number_generator|RNG]] index
| 0x03004620 || i32 || [[Random_number_generator|RNG]] index
|-
| 0x030046a8 || struct* || Pointer to [[#Save data header]] (usually/always? 0x03000768)
|-
| 0x030046c4 || struct* || Pointer to [[#Global save data]] (always 0x03000750)
|-
|-
| 0x030046e8 || i16[3] || [[Coordinate systems|Camera]] position
| 0x030046e8 || i16[3] || [[Coordinate systems|Camera]] position
|}
|}
== Save data header ==
{| class="wikitable"
|-
! Offset || Type || Description
|-
| 0x2c || char[?] || Player name
|}
== Global save data ==
{| class="wikitable"
|-
! Offset || Type || Description
|-
| 0x00 || i32 || Global frame counter
|-
| 0x04 || i32 || Solar sensor calibration (<code>raw level - 2</code> at time of calibration)
|}
= Other structs =
== Treasure data ==
<syntaxhighlight lang="c">
// pointer to this struct is at 0x03000108
struct treasure_data {
  /* offset 0x24 */ treasure_node* list_head;
};
struct treasure_node {
  /* offset 0x14 */ treasure_trigger* trigger;
  /* offset 0x28 */ u32 callback_script_id;
  /* offset 0x2c */ u32 callback_args[?];
  /* offset 0xb8 */ treasure_node* list_next;
};
struct treasure_trigger {
  /* offset 0x20 */ i16 position[3];
};
</syntaxhighlight>


= EEPROM =
= EEPROM =
''TODO''


[[Save data checksums]]
{| class="wikitable"
|-
! Byte address || Byte size || Description
|-
| 0x0000 || 0x18 || [[#Global save data]]
|-
| 0x00c0 || 0x28 || Slot 1: [[#Save data header]]
|-
| 0x0200 || 0x28 || Slot 2: [[#Save data header]]
|-
| 0x0340 || 0x400 || Slot 1: [[#World struct]]
|-
| 0x0780 || 0x418 || Slot 1: [[#Stat struct]]
|-
| 0x0dc0 || 0x400 || Slot 2: [[#World struct]]
|-
| 0x1200 || 0x418 || Slot 2: [[#Stat struct]]
|-
| 0x1840 || 0x168 ||
|-
| 0x1a40 || 0x168 ||
|}
 
Each block is followed by its checksum, see [[Save data checksums]].


[[Category:Documentation]]
[[Category:Documentation]]
[[Category:Boktai 1]]
[[Category:Boktai 1]]