ROM map (Boktai 3)

From Boktai Hacking Wiki
Revision as of 12:43, 21 September 2024 by Raphi (talk | contribs)

This is the ROM map for Boktai 3 (J).

Address Description
0x80001f0 undefined IRQ_Dispatcher(void)

Copied to IWRAM @ 0x3003a60 during boot, and executed from there

0x8000350 int Video_UpdateSpritePalette(Sprite * param_1, undefined4 * param_2)

Copied to and executed from IWRAM @ 0x03000000. Sprite rendering related.

0x8000430 undefined Video_RenderSprite(Sprite * param_1, undefined4 param_2, undefined4 param_3, undefined4 param_4)

Copied to and executed from IWRAM @ 0x030000e0 (more functions like this follow). Renders one sprite.

0x8000e90 undefined Video_RenderAllSpritesImpl(void)

Copied to and executed from IWRAM @ 0x03000b40. Renders all sprites.

0x800145c undefined main(void)
0x803223c char * String_FindCharOrNullTerminator(char * s, char ch)

Almost like strchr(3), but strchr would return NULL if it reaches the null terminator. This function will return a pointer to the null terminator instead.

0x81db474 void OptionMenu_Update(OptionMenu * menu)
0x81db75c undefined OptionMenu_Destroy(void)
0x81db794 int OptionMenu_Init(OptionMenu * menu)
0x81dbb0c OptionMenu * OptionMenu_Create(void)
0x81dc02c void Menu_EraseRect(uint x, uint y, int width, int height)
0x81dc054 void Video_DrawText(uint x, uint y, char * text)
0x81dc154 void Menu_RenderOption(undefined4 param_1, undefined4 param_2, undefined4 pc, undefined4 option_index)
0x81dc178 undefined Sprite_SetPos(Sprite * param_1, undefined4 param_2)
0x81dc6d0 void Time_ShowRegionMenu(int param_1)
0x81dc754 void Time_RegionMenuOnSelect(TimeMenu * param_1)

Called when selecting an option in the region menu

0x81dc7a0 void Time_HandleRegionKeypad(TimeMenu * param_1)
0x81dca6c void Time_DestroyRegionMenu(int param_1)
0x81dca9a int Time_LoadRegionList(int param_1)
0x81dca9c int Time_LoadRegionList(void * param_1)
0x81dcdf4 void * Time_StartRegionMenu(void)
0x81ddbc0 void NameEntry_HandleKeypad(int param_1)
0x81de780 void TimeMenu_RenderCursor(TimeMenu * param_1)
0x81de84c void TimeMenu_RenderNumbers(TimeMenu * param_1)
0x81dea60 void TimeMenu_HandleKeypadUpDown(TimeMenu * param_1)
0x81dec2c void TimeMenu_HandleKeypad(TimeMenu * param_1)
0x81df1d8 void Password_CalcCursorPosition(PasswordMenu * menu)
0x81df32c undefined Password_HandleKeypadUp(void)
0x81df510 void Password_HandleKeypadDown(PasswordMenu * menu)
0x81df694 undefined Password_HandleKeypadLeft(void)
0x81df878 undefined Password_HandleKeypadRight(void)
0x81dfb9c void Password_RenderCaret(PasswordMenu * param_1)
0x81dfcb4 void Password_HandleKeypad(PasswordMenu * param_1)
0x81e00e8 void Password_Destroy(PasswordMenu * param_1)
0x81e013c int Password_InitMenu(PasswordMenu * param_1)
0x81e0474 PasswordMenu * Password_AllocateMenu(void)
0x81e2f44 undefined Help_InitHelpScreen(void)
0x8213d10 undefined Mem_InitializeMemoryWithDMA(void)

Copies interrupt dispatcher (ARM code) from ROM to IWRAM, Clears VRAM/OAM/PAL, and enables game pak & V-Blank interrupts

0x8213fd8 undefined IRQ_DefaultVBlankHandler(void)

Default handler for V-blank IRQ

0x8214144 void IRQ_DefaultVCounterHandler(void)

Default handler for V-counter match IRQ

0x82141b4 undefined IRQ_DefaultHBlankHandler(void)

Default handler for H-blank IRQ (no-op)

0x82141b8 undefined IRQ_DefaultKeypadHandler(void)

Default handler for keypad IRQ (no-op)

0x82141bc undefined IRQ_NoHandler(void)
0x8214424 int Sprite_Install(Sprite * sprite, int param_2)
0x8214450 void Sprite_Uninstall(Sprite * param_1, undefined4 param_2)
0x8215698 undefined Video_GetBackgroundMap(undefined4 bgNum)
0x82156b8 void Video_ClearBackgroundMap(int bgNum)
0x8218be0 int Video_LoadFont(void)
0x8218c78 void * Video_GetFont(void)
0x8218cb0 void Video_ClearBackgroundMap0(void)
0x8218d1c undefined Video_LoadCharFromFont(undefined4 param_1, undefined4 ch, undefined4 param_3, undefined4 param_4, undefined4 param_5)
0x8218f2c void Video_DrawChar(undefined4 ch, undefined4 x, undefined4 y, undefined4 param_4)
0x82195e0 void Sprite_Destroy(Sprite * param_1)
0x8219624 void Video_RenderAllSprites(void)

Calls Video_RenderAllSpritesImpl in IWRAM

0x82196c4 int SpriteSet_Load(SpriteSet * dest, SpriteSetHeader * src)
0x8219728 int Sprite_LoadSprite(Sprite * sprite, SpriteSet * set, uint spriteIndex)
0x82197a4 int Sprite_InitWithSprite(undefined4 sprite, SpriteSet * set, undefined4 spriteIndex, undefined4 param_4, undefined1 param_5, undefined1 param_6, undefined2 param_7, short * initialPosition)
0x821980c int Sprite_SetSprite(Sprite * sprite, SpriteSet * set, undefined2 index, undefined param_4)
0x821983c int Sprite_Create(Sprite * sprite, SpriteSet * set, int spriteId, uint param_4, undefined param_5, undefined param_6, undefined param_7, int * initialPosition)
0x8219aac undefined Actor_Boot(void)
0x8219b24 void Sys_ReadKeypad(void)
0x8219c00 uint rand_bootstrap(void)
0x8219c40 void * malloc(int bytes)
0x8219cb4 undefined malloc2(void)

TODO: How is this different from malloc?

0x8219d38 void free(void * mem)
0x8219db4 void memcpy(void * dest, void * source, uint len)
0x8219dd8 void bzero(void * mem, uint bytes)
0x8219f50 undefined Actor_InitializeList(void)
0x8219f74 void Actor_Install(Actor * param_1)

Adds an actor to the actor list.

0x8219f94 void Actor_Uninstall(Actor * * param_1)

Removes an actor from the actor list.

0x8219fbc Actor * Actor_Create(byte type, undefined4 size)

Allocates an actor, and adds it to the actor list.

0x821a004 Actor * Actor_Create2(undefined1 type, undefined4 size)

Like Actor_Create, but uses malloc2 instead of malloc.

0x821a04c void Actor_SetCallbacks(Actor * object, ActionOfPtr * frame_cb, ActionOfPtr * destroy_cb)

Sets the "on_frame" and "on_destroy" callbacks of an actor.

0x821a054 void Actor_RunAll(void)

Runs the onFrame and onDestroy (as required) callbacks for all actors

0x821a0c0 int Actor_Delete(Actor * param_1)
0x821a520 void * Mft_GetFile(ushort dirId, undefined4 fileId)
0x821a66c int Script_ReadLength(byte * pc, int * length)

Returns pc after all the length bytes, the length itself is stored in *length.

0x821a6f0 byte * Script_GetValueCore(byte * pc, uint * param_2, int * out_value)
0x821a91c undefined Script_StoreVariable(void)
0x821a960 void Script_SetPc(byte * pc)
0x821a96c byte * Script_SeekToKeyword(char kw)
0x821aa00 int Script_GetValueAt(byte * pc)
0x821aa88 int Script_GetValueAtSafe(byte * param_1)
0x821aabc ushort Script_ParseStringRef(byte * pc)
0x821ab18 void * Script_GetPc(void)
0x821ab40 int Script_GetValue(void)
0x821ab88 int Script_GetValueSafe(void)
0x821acdc byte * Script_LookupById(int script_id, uint * param_2)
0x821ad08 int Script_ExecById(int script_id, int param_2)
0x821add4 char * Textbox_LookupString(int string_id)
0x821af2c int Script_ExecBlock(byte * pc, undefined4 param_2, undefined4 param_3)
0x821afd8 int Script_Exec(byte * pc, int param_2)
0x821b20c undefined Script_LoadPointer(byte * param_1, uint * param_2, int param_3, uint * param_4)
0x821b3e4 undefined Script_StorePointer(void)
0x821b938 undefined Script_RunOperator(void)
0x821ba5c int Script_RunExpression(byte * pc)
0x82284f4 void Time_ClearData(void)
0x822a7a8 undefined Time_CalculateSunriseSunset'(undefined4 param_1, undefined4 param_2, undefined4 param_3, undefined4 param_4, undefined4 param_5, undefined4 param_6, undefined4 param_7, undefined4 tz_offset)
0x822ae00 undefined Time_CalculateSunriseSunset(void)
0x822b2f8 undefined Sound_Play(void)
0x822c238 undefined Sensor_GetBars(void)
0x8243d28 void Sensor_Timer3Handler(void)
0x8248590 void Mem_CpuFastSet(void * source, void * destination, uint count)
0x8248594 void Mem_CpuSet(void * source, void * destination, uint count)
0x8248598 int Math_Div(int dividend, int divisor)
0x824859c int Math_Mod(int dividend, int divisor)
0x82485a4 int Math_ModArm(int divisor, undefined4 dividend)
0x82485ac undefined Sys_LZ77Uncomp8Bit(void * src, void * dest)
0x82485b0 undefined Sys_RegisterRamReset(int resetFlags)
0x82485b4 void Sys_SoftReset(int param_1)
0x82485d0 void Sys_SoundBiasLow(void)
0x82485d8 void Sys_SoundBiasHigh(void)
0x82485e0 int Math_Sqrt(int x)
0x82485e4 void Sys_VBlankIntrWait(void)
0x8248970 void GPIO_EnableClearFlag(void)
0x8248988 void GPIO_DisableSetFlag(void)
0x8249210 void GPIO_Enable(void)
0x8249224 void GPIO_Disable(void)
0x824923c undefined4 CallParam2(void * arg, ActionOfPtr * fn)
0x824da48 void * memcpy'(void * dest, void * src, uint len)

How is this different from memcpy?

0x860330c Engine call table (null-terminated array of struct { void(*)(int r0) fn; int id; })
0x8614d6c Master file table