Jump to content

RAM map (Boktai 1): Difference between revisions

Created page with "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)". --> = IWRAM = {| class="wikitable" |- ! Address || Type || Description |- | 0x03004620 || i32 || RNG index |} = EEPROM = ''TODO'' Save data checksums Category:Documentation Category:Boktai 1"
 
Stat struct: settings
 
(27 intermediate revisions by the same user not shown)
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]].
<!--
IMPORTANT: Please keep each table sorted by address, thanks.
 
Please create a new page for maps of other languages! For example "RAM map (Boktai 1, J)".
-->
 
= EWRAM =
 
{| class="wikitable exportable"
|-
! Address || Type || Description
|-
| 0x02000000 || || [[Heap]] (105 KiB)
|-
| 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)
|-
| 0x02001b5e || i16 || Current boss health (read only)
|-
| 0x02001b6a || i16 || Current trap health (read only)
|-
| 0x02005610 || i16 || Link points in status room
|-
| 0x02007542 || i16 || Permafrost: frost ceiling
|-
| 0x02008436 || i16 || Purification: top left tower health
|-
| 0x020086c6 || i16 || Purification: bottom right tower health
|-
| 0x02008956 || i16 || Purification: top right tower health
|-
| 0x02008be6 || i16 || Purification: bottom left tower health
|-
| 0x0201a400 || struct || Decompressed [[tile map file]] (only used if the tile map file was compressed, uncompressed files are accessed directly from ROM)
|-
| 0x0203c800 || u16[1024] || [[Random number generator|RNG table]] (generated by the bootstrap RNG once on power-on)
|-
| 0x0203d800 || byte[0x580] || [[#Stat struct]]
|-
| 0x0203e000 || byte[0x580] || Stat struct - backup (created on screen transitions, reloaded on death, saved to save file when saving)
|-
| 0x0203e800 || byte[0x400] || [[#World struct]]
|-
| 0x0203ec00 || byte[0x400] || World struct - backup
|-
| 0x0203f000 || byte[0x400] || [[#Scratch struct]]
|}
 
== Stat struct ==
See also: [[Inventory (Boktai 1)]]
{| class="wikitable exportable"
|-
! Address || Type || Description
|-
| 0x0203d802 || i16 || Control scheme setting
|-
| 0x0203d804 || i16 || Text speed setting
|-
| 0x0203d806 || i16 || Markers on/off setting
|-
| 0x0203d80a || i16[7] || Grenade amounts
|-
| 0x0203d818 || i16[7] || Battery charges
|-
| 0x0203d828 || char[?] || Player name
|-
| 0x0203d840 || i16 || Max HP
|-
| 0x0203d878 || i32 || Doomy debt
|-
| 0x0203d88c || i16 || Equipped lens
|-
| 0x0203d88e || i16 || Equipped frame
|-
| 0x0203d890 || i16 || Equipped grenades
|-
| 0x0203d892 || i16 || Equipped battery
|-
| 0x0203d894 || i16 || Pineapple grenade charge
|-
| 0x0203d898 || i32[5] || Solar plant progress
|-
| 0x0203d8b0 || i32 || Unlock Astro battery (must be set to <code>*(*0x03001c90 + 0x7dc)</code>)
|-
| 0x0203d8b6 || i16 || Playthrough count (0=New Game, 1=New Game+, 2=New Game++, etc.)
|-
| 0x0203d8f0 || i16[3] || Django position
|-
| 0x0203d8f6 || i16 || Django oritentation
|-
| 0x0203d8fa || i16 || Current HP
|-
| 0x0203d8fc || i32 || IGT frames since creating save file
|-
| 0x0203d900 || i16 || Current [[Maps (Boktai 1)|Map ID]]
|-
| 0x0203d90c || u16 || Current map's init script ID
|-
| 0x0203d910 || i32 || Dungeon IGT
|-
| 0x0203d914 || i32 || Dungeon charged energy
|-
| 0x0203d918 || i16 || Dungeon detections
|-
| 0x0203d91c || u16 || Room flags (bit 2=indoors (no sun))
|-
| 0x0203d91e || i32 || Solar sensor: Calibrated level (see 0x020011c0)
|-
| 0x0203d928 || i32 || Dungeon completion flags
|-
| 0x0203dadc || i32 || Current [[Maps (Boktai 1)#Areas|Area ID]]
|-
| 0x0203daf0 || u16 || Dungeon related flags?
|-
| 0x0203daf4 || i32 || Purification: Immortal health
|-
| 0x0203dc18 || i16 || Item inventory size
|-
| 0x0203dc1a || i16[42] || Item inventory IDs
|-
| 0x0203dc6e || i16[42] || Item inventory amounts
|-
| 0x0203dcc2 || i16 || Grenade limit
|-
| 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
|-
| 0x0203dce8 || i32 || Solar station
|-
| 0x0203dd2c || i16 || Link points source
|-
| 0x0203dd2e || i16 || Link battles total
|-
| 0x0203dd30 || i16 || Link battles won
|-
| 0x0203dd32 || i16 || Item exchange amount
|-
| 0x0203dd38 || char[?] || Item exchange partner name
|}
 
== World struct ==
{| class="wikitable exportable"
|-
! Address || Type || Description
|-
| 0x0203e80e || i16 || Global story progress
|-
| 0x0203e898:5 || bit[6] || Roadblock cleared flags: Fog castle, Dark castle (unlocks warp), Firetop, Permafrost, Sol City, Bloodrust
|-
| 0x0203e8bc || i32 || Action difficulty (0=Easy, 1=Normal, 2=Hard)
|-
| 0x0203e8c0:0 || bit[30] || Silver coin collection flags
|-
| 0x0203e8c3:6 || bit[16] || Life fruit collection flags
|-
| 0x0203e8c5:6 || bit[64] || "Chest opened" flags for current area (resets on area change)
|-
| 0x0203e8cf || u8 || Last dungeon rank
|-
| 0x0203e8d0:3 || bit || Undead: Trigger dungeon intro
|-
| 0x0203e8d4 || u8 || Azure Sky Tower: Current room (0=NE, 1=SE, 2=NW, 3=SW)
|-
| 0x0203e8dc || u8 || Azure Sky Tower: Enemy index of key holder (see 0x0203eab4 and 0x0203eac4)
|-
| 0x0203e8dd || u8 || Azure Sky Tower: Current floor
|-
| 0x0203e8e0 || u8 || Azure Sky Tower: Number of completions
|-
| 0x0203e8de || u8 || Azure Sky Tower: Current palette (0-7)
|-
| 0x0203e8e1 || u8[4] || Azure Sky Tower: Current floor room indices (indices: 0=NE, 1=SE, 2=NW, 3=SW). The index of the current room will be copied to 0x0203f2f6.
|-
| 0x0203ea1a || i16 || Current door ID
|-
| 0x0203ea1c || i32 || Current door script ID (used for respawning the player after using the bank/loans)
|-
| 0x0203ea91 || u8 || Bloodrust mansion courtyard layout
|-
| 0x0203eab4 || u8[16] || Azure Sky Tower: Current floor enemy types. Entries 0-3=NE room, 4-7=SE, 8-11=NW, 12-15=SW. (TODO: value list)
|-
| 0x0203eac4 || u8[32] || Azure Sky Tower: Current floor enemy coordinates (TODO: how does this work?)
|}
 
== Scratch struct ==
{| class="wikitable exportable"
|-
! Address || Type || Description
|-
| 0x0203f01f || u8 || Current cutscene progress
|-
| 0x0203f0cc || i16 || Dungeon base score
|-
| 0x0203f140 || u8 || TAIYOJU: Tree palette (0=dark brown, 1=dark blue, 2=light brown)
|-
| 0x0203f1b4 || u8[13] || Carmilla: Pattern list - one of 4 hardcoded lists will be chosen at random when starting the fight
|-
| 0x0203f1c1 || u8[3] || Carmilla: Pattern pool (indices into pattern list)
|-
| 0x0203f1c4 || u8[3] || Carmilla: ???
|-
| 0x0203f1c7 || u8 || Carmilla: Next pool value
|-
| 0x0203f1c8 || u8 || Carmilla: Pattern index (index into pattern pool) - the (current/next?) pattern is pattern_list[pattern_pool[next_pool_value]]
|-
| 0x0203f2f6 || u8 || Azure Sky Tower: Current room index (0-31)
|}


= IWRAM =
= IWRAM =


{| class="wikitable"
{| class="wikitable exportable"
|-
|-
! Address || Type || Description
! Address || Type || Description
|-
| 0x03000600 || void* || ID of [[Tile map file]] that has been decompressed to 0x0201a400
|-
| 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
|-
| 0x0300064c || void* || Script directory: Script count
|-
| 0x03000650 || void* || Script directory: Script data pointer
|-
| 0x03000654 || void* || Script directory: Special script pointer
|-
| 0x03000658 || void* || Script directory: Script index end pointer
|-
| 0x0300065c || void* || Script directory: String index pointer
|-
| 0x03000660 || void* || Script directory: String data pointer
|-
| 0x03000108 || treasure_data* || Pointer to this map's [[#Treasure data]] (NULL if map has no treasures)
|-
| 0x03001c20 || Actor* || Pointer to coffin [[actor]]
|-
| 0x03001c2c || i16 || Solar sensor: Bars. See 0x020011c2.
|-
| 0x03001c40 || u16 || Active item effects (bitmask)
|-
| 0x03001c54 || i16 || Grenade effect duration
|-
| 0x03001c58 || u16 || Active grenade effect (bitmask)
|-
| 0x03001c60 || i16 || Item effect duration
|-
| 0x03001c90 || void* || Pointer to Django's actor data?
|-
| + 0x18 || i32 || Current lens level
|-
| + 0x24 || i16[3] || Current position
|-
| + 0x11a || || Max HP - Current HP
|-
| + 0x79a || u16 || Enduranut buffered damage
|-
| + 0x7dc || i32 || Astro battery unlock password
|-
| 0x03001cc8 || void* || Pointer to linked list of bat enemies?
|-
| 0x03002578 || i16 || Tile map X coordinate in view space
|-
| 0x0300257a || i16 || Tile map Y coordinate in view space
|-
| 0x030025b0 || i32 || Sprite palette count
|-
| 0x030025b4 || void* || Pointer to sprite palettes
|-
| 0x03002650 || GBA_OBJ[128] || GBA [https://problemkaputt.de/gbatek-lcd-obj-oam-attributes.htm OAM], will be copied to OAM memory every frame
|-
| 0x03002a58 || i32 || OAM size
|-
| 0x03002e80 || u16 || GBA [https://problemkaputt.de/gbatek-lcd-i-o-display-control.htm DISPCNT] register
|-
| 0x03003fb0 || u16[0x100] || OBJ palette buffer (copied to PAL memory every frame)
|-
| 0x030043c4 || void* || ''Pointer'' to background palette buffer (0x200 bytes, in IWRAM, copied to PAL memory every frame)
|-
| 0x030043fc || u8 || Text output: Current X coordinate
|-
| 0x03004400 || u8 || Text output: Character count
|-
| 0x03004404 || u8 || Text output: Line height
|-
| 0x03004408 || u8 || Text output: Start X coordinate
|-
| 0x03004410 || u8 || Text output: Character width
|-
| 0x03004414 || u8 || Text output: Current Y coordinate
|-
| 0x03004438 || u32 || [[Actor]] disable flags
|-
| 0x03004450 || u16 || Keypad: down buttons (active-high)
|-
| 0x03004452 || u16 || Keypad: pressed buttons (down current frame, up on previous frame)
|-
| 0x03004454 || u16 || Keypad: released buttons (up on current frame, down on previous frame)
|-
| 0x03004478 || i32 || [[Random number generator|Bootstrap RNG seed]]
|-
| 0x03004480 || Array || [[Actor]] list
|-
| 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]]
|-
| + 0x04 || void* || Pointer to map file tile data
|-
| + 0x0c || void* || Pointer to map file zones
|-
| + 0x10 || void* || Pointer to map file unknown block 1
|-
| + 0x14 || void* || Pointer to map file unknown block 2
|-
| + 0x24 || zone_callback[] || List of zone callbacks:
struct zone_callback {
  /* offset 0x08 */ u16 zone_id;
  /* offset 0x24 */ void* bytecode_ptr; // Generally points into a [[Script directory|Script]]
};
|-
|-
| 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 in view space
|-
| 0x030046f0 || Camera* || Pointer to camera actor
|}
== Save data header ==
{| class="wikitable exportable"
|-
! Offset || Type || Description
|-
| 0x2c || char[?] || Player name
|}
|}
== Global save data ==
{| class="wikitable exportable"
|-
! Offset || Type || Description
|-
| 0x00 || i32 || Global frame counter
|-
| 0x04 || i32 || Solar sensor calibration (<code>raw level - 2</code> at time of calibration)
|-
| 0x08 || i32 || Solar bank
|}
= 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 exportable"
|-
! 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]]