From 65228e6fb8ee96d6ea2d10075c7e09c6e3fc4860 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 6 Oct 2015 20:15:42 -0700 Subject: [PATCH] add type signatures - many of these probably have mistakes --- asm/dma3_manager.s | 35 +++-- asm/emerald.s | 351 ++++++++++++++++++++++++++++++++++++------ asm/gpu_bg.s | 53 ++++++- asm/gpu_obj.s | 65 ++++++++ asm/gpu_reg_manager.s | 12 ++ asm/libagbbackup.s | 6 + asm/libagbsyscall.s | 9 ++ asm/libgcc.s | 11 ++ asm/libmks4agb.s | 4 + asm/main.s | 27 +++- asm/malloc.s | 12 ++ asm/pixel_buffer.s | 4 + asm/task.s | 8 + asm/text_renderer.s | 26 ++++ asm/window.s | 24 +++ 15 files changed, 580 insertions(+), 67 deletions(-) diff --git a/asm/dma3_manager.s b/asm/dma3_manager.s index edd7e2cf1..e75e70179 100644 --- a/asm/dma3_manager.s +++ b/asm/dma3_manager.s @@ -1,5 +1,6 @@ - thumb_func_start dma3_transfer_queue_clear -dma3_transfer_queue_clear: @ 8000BB8 + thumb_func_start ClearDma3Requests +@ void ClearDma3Requests() +ClearDma3Requests: @ 8000BB8 push {lr} ldr r2, =0x03000810 movs r0, 0x1 @@ -24,10 +25,11 @@ _08000BCC: bx r0 .align 2, 0 .pool - thumb_func_end dma3_transfer_queue_clear + thumb_func_end ClearDma3Requests - thumb_func_start dma_transfer_queue_process -dma_transfer_queue_process: @ 8000BF0 + thumb_func_start ProcessDma3Requests +@ void ProcessDma3Requests() +ProcessDma3Requests: @ 8000BF0 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -341,10 +343,11 @@ _08000E46: bx r0 .align 2, 0 .pool - thumb_func_end dma_transfer_queue_process + thumb_func_end ProcessDma3Requests - thumb_func_start dma3_transfer_queue_add_copy -dma3_transfer_queue_add_copy: @ 8000E68 + thumb_func_start RequestDma3Copy +@ int RequestDma3Copy(void *src, void *dest, u16 size, u8 mode) +RequestDma3Copy: @ 8000E68 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -422,10 +425,11 @@ _08000EF0: pop {r4-r7} pop {r1} bx r1 - thumb_func_end dma3_transfer_queue_add_copy + thumb_func_end RequestDma3Copy - thumb_func_start dma3_transfer_queue_add_fill -dma3_transfer_queue_add_fill: @ 8000F00 + thumb_func_start RequestDma3Fill +@ int RequestDma3Fill(s32 value, void *dest, u16 size, u8 mode) +RequestDma3Fill: @ 8000F00 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -509,10 +513,11 @@ _08000F96: pop {r4-r7} pop {r1} bx r1 - thumb_func_end dma3_transfer_queue_add_fill + thumb_func_end RequestDma3Fill - thumb_func_start dma3_transfer_queue_check_for_space -dma3_transfer_queue_check_for_space: @ 8000FA4 + thumb_func_start CheckForSpaceForDma3Request +@ int CheckForSpaceForDma3Request(s16 index) +CheckForSpaceForDma3Request: @ 8000FA4 push {lr} movs r2, 0 lsls r0, 16 @@ -550,4 +555,4 @@ _08000FDC: bx r1 .align 2, 0 .pool - thumb_func_end dma3_transfer_queue_check_for_space + thumb_func_end CheckForSpaceForDma3Request diff --git a/asm/emerald.s b/asm/emerald.s index 91e42cca2..c35638638 100644 --- a/asm/emerald.s +++ b/asm/emerald.s @@ -308,6 +308,7 @@ _08008CBA: thumb_func_end sub_8008C94 thumb_func_start decimal_int_to_string +@ int decimal_int_to_string(char *dest, int decimal_num, int mode, int max_digits) decimal_int_to_string: @ 8008CC0 push {r4-r7,lr} mov r7, r8 @@ -616,6 +617,7 @@ _08008ECA: thumb_func_end sub_8008E20 thumb_func_start ExpandTextCodes +@ char *ExpandTextCodes(char *dest, char *src) ExpandTextCodes: @ 8008EE0 push {r4,r5,lr} adds r4, r0, 0 @@ -931,8 +933,9 @@ _080090F2: .pool thumb_func_end get_fcode_buffer - thumb_func_start sub_80090FC -sub_80090FC: @ 80090FC + thumb_func_start RepeatChar +@ int RepeatChar(char *dest, char c, u16 length) +RepeatChar: @ 80090FC push {lr} adds r3, r0, 0 lsls r1, 24 @@ -956,7 +959,7 @@ _0800911C: adds r0, r3, 0 pop {r1} bx r1 - thumb_func_end sub_80090FC + thumb_func_end RepeatChar thumb_func_start sub_8009128 sub_8009128: @ 8009128 @@ -1014,7 +1017,7 @@ sub_800917C: @ 800917C lsls r2, r1, 16 lsrs r2, 16 movs r1, 0xFF - bl sub_80090FC + bl RepeatChar pop {r1} bx r1 thumb_func_end sub_800917C @@ -47275,7 +47278,7 @@ sub_8020584: @ 8020584 movs r0, 0 movs r2, 0x20 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill movs r0, 0x20 str r0, [sp] str r0, [sp, 0x4] @@ -47386,7 +47389,7 @@ sub_8020680: @ 8020680 movs r0, 0 movs r2, 0x20 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill pop {r0} bx r0 .align 2, 0 @@ -77973,6 +77976,7 @@ sub_802F6C8: @ 802F6C8 thumb_func_end sub_802F6C8 thumb_func_start c2_title_menu_2 +@ void c2_title_menu_2() c2_title_menu_2: @ 802F6DC push {lr} movs r0, 0 @@ -77982,6 +77986,7 @@ c2_title_menu_2: @ 802F6DC thumb_func_end c2_title_menu_2 thumb_func_start c2_title_menu_2_dupe +@ void c2_title_menu_2_dupe() c2_title_menu_2_dupe: @ 802F6E8 push {lr} movs r0, 0x1 @@ -77991,6 +77996,7 @@ c2_title_menu_2_dupe: @ 802F6E8 thumb_func_end c2_title_menu_2_dupe thumb_func_start init_title_menu +@ void init_title_menu(int useless_param) init_title_menu: @ 802F6F4 push {r4,r5,lr} sub sp, 0xC @@ -78170,6 +78176,7 @@ _0802F7FE: thumb_func_end init_title_menu thumb_func_start task_init_title_menu_graphics +@ void task_init_title_menu_graphics(int task_id) task_init_title_menu_graphics: @ 802F8D8 push {r4-r7,lr} mov r7, r8 @@ -78498,6 +78505,7 @@ _0802FB8C: thumb_func_end task_init_title_menu_battery_dry thumb_func_start task_init_title_menu_graphics_3 +@ void task_init_title_menu_graphics_3(int task_id) task_init_title_menu_graphics_3: @ 802FBA4 push {r4-r7,lr} mov r7, r9 @@ -78997,6 +79005,7 @@ _0803006C: thumb_func_end task_init_title_menu_graphics_3 thumb_func_start task_title_menu_highlight_selected_menu_items +@ void task_title_menu_highlight_selected_menu_items(int task_id) task_title_menu_highlight_selected_menu_items: @ 80300B0 push {r4,lr} lsls r0, 24 @@ -79219,6 +79228,7 @@ _0803026C: thumb_func_end task_title_menu_handle_input thumb_func_start title_menu_handle_keypad_a_pressed +@ void title_menu_handle_keypad_a_pressed(int task_id) title_menu_handle_keypad_a_pressed: @ 803027C push {r4-r7,lr} sub sp, 0x4 @@ -79713,6 +79723,7 @@ _08030688: thumb_func_end sub_80305A4 thumb_func_start title_menu_highlight_selected_menu_items +@ void title_menu_highlight_selected_menu_items(u8 a1, u8 selected_menu_item, u16 a3) title_menu_highlight_selected_menu_items: @ 8030698 push {r4-r6,lr} lsls r0, 24 @@ -79867,6 +79878,7 @@ _080307A4: thumb_func_end title_menu_highlight_selected_menu_items thumb_func_start task_new_game_prof_birch_speech_1 +@ void task_new_game_prof_birch_speech_1(int task_id) task_new_game_prof_birch_speech_1: @ 80307B0 push {r4,r5,lr} sub sp, 0x4 @@ -80023,6 +80035,7 @@ _0803091A: thumb_func_end task_new_game_prof_birch_speech_2 thumb_func_start task_new_game_prof_birch_speech_3 +@ int task_new_game_prof_birch_speech_3() task_new_game_prof_birch_speech_3: @ 8030928 push {r4,lr} lsls r0, 24 @@ -82495,6 +82508,7 @@ sub_8031DB4: @ 8031DB4 thumb_func_end sub_8031DB4 thumb_func_start set_default_player_name +@ void set_default_player_name(int name_id) set_default_player_name: @ 8031DC4 push {r4,r5,lr} lsls r0, 24 @@ -82539,6 +82553,7 @@ _08031DF0: thumb_func_end set_default_player_name thumb_func_start draw_text_box +@ void draw_text_box(void *text_ptr) draw_text_box: @ 8031E18 push {r4,lr} sub sp, 0xC @@ -82858,6 +82873,7 @@ unknown_title_pattern_data_to_vram: @ 80320A4 thumb_func_end unknown_title_pattern_data_to_vram thumb_func_start write_textbox_border_to_bg_tilemap +@ void write_textbox_border_to_bg_tilemap(struct rbox_template *box, int base_tile_num) write_textbox_border_to_bg_tilemap: @ 80320EC push {r4-r7,lr} mov r7, r10 @@ -87415,6 +87431,7 @@ dp01_build_cmdbuf_x37_a: @ 80344C8 thumb_func_end dp01_build_cmdbuf_x37_a thumb_func_start call_LZZUnCompWram +@ void call_LZZUnCompWram(void *src, void *dest) call_LZZUnCompWram: @ 8034518 push {lr} bl LZ77UnCompWram @@ -87423,6 +87440,7 @@ call_LZZUnCompWram: @ 8034518 thumb_func_end call_LZZUnCompWram thumb_func_start call_LZZUnCompVram +@ void call_LZZUnCompVram(void *src, void *dest) call_LZZUnCompVram: @ 8034524 push {lr} bl LZ77UnCompVram @@ -87431,6 +87449,7 @@ call_LZZUnCompVram: @ 8034524 thumb_func_end call_LZZUnCompVram thumb_func_start gpu_tile_obj_decompress_and_load +@ u16 gpu_tile_obj_decompress_and_load(struct rom_obj_tile_data *x) gpu_tile_obj_decompress_and_load: @ 8034530 push {r4,r5,lr} sub sp, 0x8 @@ -87458,6 +87477,7 @@ gpu_tile_obj_decompress_and_load: @ 8034530 thumb_func_end gpu_tile_obj_decompress_and_load thumb_func_start gpu_tile_obj_decompress_and_load2 +@ void gpu_tile_obj_decompress_and_load2(struct rom_obj_tile_data *x, void *dest) gpu_tile_obj_decompress_and_load2: @ 8034564 push {r4,r5,lr} sub sp, 0x8 @@ -87480,6 +87500,7 @@ gpu_tile_obj_decompress_and_load2: @ 8034564 thumb_func_end gpu_tile_obj_decompress_and_load2 thumb_func_start gpu_pal_obj_decompress_and_apply +@ void gpu_pal_obj_decompress_and_apply(struct rom_obj_pal_data *x) gpu_pal_obj_decompress_and_apply: @ 803458C push {r4,r5,lr} sub sp, 0x8 @@ -87506,6 +87527,7 @@ gpu_pal_obj_decompress_and_apply: @ 803458C thumb_func_end gpu_pal_obj_decompress_and_apply thumb_func_start gpu_pal_obj_decompress_and_apply2 +@ void gpu_pal_obj_decompress_and_apply2(struct rom_obj_pal_data *x, void *dest) gpu_pal_obj_decompress_and_apply2: @ 80345C0 push {r4,r5,lr} sub sp, 0x8 @@ -87531,6 +87553,7 @@ gpu_pal_obj_decompress_and_apply2: @ 80345C0 thumb_func_end gpu_pal_obj_decompress_and_apply2 thumb_func_start sub_80345F0 +@ void sub_80345F0(void **a1, void *a2, int species_num) sub_80345F0: @ 80345F0 push {r4,r5,lr} adds r3, r0, 0 @@ -87560,6 +87583,7 @@ _08034618: thumb_func_end sub_80345F0 thumb_func_start sub_8034628 +@ void sub_8034628(int *a1, void *a2, int species_num, int a4) sub_8034628: @ 8034628 push {r4,r5,lr} sub sp, 0x4 @@ -87586,6 +87610,7 @@ _0803463E: thumb_func_end sub_8034628 thumb_func_start sub_8034654 +@ void sub_8034654(void **a1, void *a2, int species_num, unsigned int a4, u8 a5) sub_8034654: @ 8034654 push {r4-r7,lr} mov r7, r8 @@ -88047,6 +88072,7 @@ sub_8034974: @ 8034974 thumb_func_end sub_8034974 thumb_func_start gpu_tile_obj_decompress_and_load3 +@ u16 gpu_tile_obj_decompress_and_load3(struct rom_obj_tile_data *x) gpu_tile_obj_decompress_and_load3: @ 8034988 push {r4,r5,lr} sub sp, 0x8 @@ -88077,6 +88103,7 @@ gpu_tile_obj_decompress_and_load3: @ 8034988 thumb_func_end gpu_tile_obj_decompress_and_load3 thumb_func_start gpu_pal_obj_decompress_and_apply3 +@ int gpu_pal_obj_decompress_and_apply3(struct rom_obj_pal_data *x) gpu_pal_obj_decompress_and_apply3: @ 80349C4 push {r4,r5,lr} sub sp, 0x8 @@ -88110,6 +88137,7 @@ gpu_pal_obj_decompress_and_apply3: @ 80349C4 thumb_func_end gpu_pal_obj_decompress_and_apply3 thumb_func_start LZ77UnCompAnyRam +@ void LZ77UnCompAnyRam(void **a1, void *a2, int species_num) LZ77UnCompAnyRam: @ 8034A08 push {r4,r5,lr} adds r3, r0, 0 @@ -88139,6 +88167,7 @@ _08034A30: thumb_func_end LZ77UnCompAnyRam thumb_func_start load_poke_gfx_probably +@ void load_poke_gfx_probably(void **a1, void *a2, int species_num, int a4, u8 a5) load_poke_gfx_probably: @ 8034A40 push {r4-r7,lr} mov r7, r8 @@ -88238,6 +88267,7 @@ _08034ADC: thumb_func_end load_poke_gfx_probably thumb_func_start help_system_enable_unless_flashback__sp199 +@ void help_system_enable_unless_flashback__sp199(int *a1, void *a2, int species_num, int a4) help_system_enable_unless_flashback__sp199: @ 8034AFC push {r4,r5,lr} sub sp, 0x4 @@ -88264,6 +88294,7 @@ _08034B12: thumb_func_end help_system_enable_unless_flashback__sp199 thumb_func_start sub_8034B28 +@ void sub_8034B28(void **a1, void *a2, int species_num) sub_8034B28: @ 8034B28 push {lr} adds r3, r0, 0 @@ -88286,6 +88317,7 @@ _08034B4A: thumb_func_end sub_8034B28 thumb_func_start sub_8034B50 +@ void sub_8034B50(int a1, int a2) sub_8034B50: @ 8034B50 push {r4,r5,lr} sub sp, 0x4 @@ -88312,6 +88344,7 @@ _08034B66: thumb_func_end sub_8034B50 thumb_func_start sub_8034B7C +@ void sub_8034B7C(void **a1, void *a2, int species_num, int a4, u8 a5) sub_8034B7C: @ 8034B7C push {r4-r7,lr} mov r7, r8 @@ -88408,6 +88441,7 @@ _08034C18: thumb_func_end sub_8034B7C thumb_func_start duplicate_deoxys_graphics_data +@ void duplicate_deoxys_graphics_data(int a1, int species_num) duplicate_deoxys_graphics_data: @ 8034C30 push {lr} adds r3, r0, 0 @@ -137156,7 +137190,7 @@ sub_804F220: @ 804F220 lsls r2, 16 lsrs r2, 16 movs r1, 0x77 - bl sub_80090FC + bl RepeatChar adds r5, r0, 0 cmp r7, 0xFF beq _0804F320 @@ -166517,6 +166551,7 @@ _0805ED56: thumb_func_end sub_805EC84 thumb_func_start sub_805ED70 +@ int sub_805ED70(obj *a1) sub_805ED70: @ 805ED70 push {r4-r7,lr} mov r7, r8 @@ -183226,6 +183261,7 @@ nullsub_92: @ 8067A70 thumb_func_end nullsub_92 thumb_func_start zero_pokemon_boxed_data +@ void zero_pokemon_boxed_data(pokemon *mon) zero_pokemon_boxed_data: @ 8067A74 push {lr} adds r2, r0, 0 @@ -183242,6 +183278,7 @@ _08067A7C: thumb_func_end zero_pokemon_boxed_data thumb_func_start zero_pokemon_struct +@ void zero_pokemon_struct(pokemon *mon) zero_pokemon_struct: @ 8067A8C push {r4,lr} sub sp, 0x4 @@ -183298,6 +183335,7 @@ zero_pokemon_struct: @ 8067A8C thumb_func_end zero_pokemon_struct thumb_func_start zero_player_party_data +@ void zero_player_party_data() zero_player_party_data: @ 8067B0C push {r4,r5,lr} ldr r4, =0x020244ec @@ -183338,6 +183376,7 @@ _08067B36: thumb_func_end zero_enemy_party_data thumb_func_start create_pokemon_set_level +@ void create_pokemon_set_level(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) create_pokemon_set_level: @ 8067B4C push {r4-r7,lr} mov r7, r8 @@ -183393,6 +183432,7 @@ create_pokemon_set_level: @ 8067B4C thumb_func_end create_pokemon_set_level thumb_func_start create_pokemon +@ void create_pokemon(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) create_pokemon: @ 8067BBC push {r4-r7,lr} mov r7, r10 @@ -185409,6 +185449,7 @@ _08068C60: thumb_func_end sub_8068C18 thumb_func_start pokemon_calc_checksum +@ int pokemon_calc_checksum(pokemon *mon) pokemon_calc_checksum: @ 8068C78 push {r4-r7,lr} mov r7, r8 @@ -188164,6 +188205,7 @@ _0806A20A: thumb_func_end sub_806A1C0 thumb_func_start pokemon_encrypt +@ void pokemon_encrypt(pokemon *mon) pokemon_encrypt: @ 806A228 push {r4,lr} adds r3, r0, 0 @@ -188187,6 +188229,7 @@ _0806A232: thumb_func_end pokemon_encrypt thumb_func_start pokemon_decrypt +@ void pokemon_decrypt(pokemon *mon) pokemon_decrypt: @ 806A24C push {r4,lr} adds r3, r0, 0 @@ -188210,6 +188253,7 @@ _0806A256: thumb_func_end pokemon_decrypt thumb_func_start pokemon_data_permutator +@ int pokemon_data_permutator(pokemon *mon, int a2, u8 a3) pokemon_data_permutator: @ 806A270 push {r4-r6,lr} adds r5, r0, 0 @@ -188600,6 +188644,7 @@ _0806A510: thumb_func_end pokemon_data_permutator thumb_func_start pokemon_getattr +@ int pokemon_getattr(pokemon *mon, enum pokemon_data_request req, void *data) pokemon_getattr: @ 806A518 push {r4,lr} adds r4, r0, 0 @@ -188757,6 +188802,7 @@ _0806A66E: thumb_func_end pokemon_getattr thumb_func_start pokemon_getattr_encrypted +@ int pokemon_getattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) pokemon_getattr_encrypted: @ 806A674 push {r4-r7,lr} mov r7, r10 @@ -189559,6 +189605,7 @@ _0806AC98: thumb_func_end pokemon_getattr_encrypted thumb_func_start pokemon_setattr +@ int pokemon_setattr(pokemon *mon, enum pokemon_data_request req, void *data) pokemon_setattr: @ 806ACAC push {lr} adds r3, r0, 0 @@ -189683,6 +189730,7 @@ _0806AD96: thumb_func_end pokemon_setattr thumb_func_start pokemon_setattr_encrypted +@ int pokemon_setattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) pokemon_setattr_encrypted: @ 806AD9C push {r4-r7,lr} mov r7, r10 @@ -190492,6 +190540,7 @@ _0806B3EC: thumb_func_end pokemon_setattr_encrypted thumb_func_start memcpy_pokemon +@ void *memcpy_pokemon(void *dest, void *src, unsigned int size) memcpy_pokemon: @ 806B408 push {lr} bl memcpy @@ -190500,6 +190549,7 @@ memcpy_pokemon: @ 806B408 thumb_func_end memcpy_pokemon thumb_func_start pokemon_catch +@ int pokemon_catch(pokemon *mon) pokemon_catch: @ 806B414 push {r4-r6,lr} adds r6, r0, 0 @@ -190560,6 +190610,7 @@ _0806B48A: thumb_func_end pokemon_catch thumb_func_start pokemon_add_to_pc +@ int pokemon_add_to_pc(pokemon *mon) pokemon_add_to_pc: @ 806B490 push {r4-r7,lr} mov r7, r8 @@ -190637,6 +190688,7 @@ _0806B530: thumb_func_end pokemon_add_to_pc thumb_func_start calc_player_party_count +@ u8 calc_player_party_count() calc_player_party_count: @ 806B53C push {r4,lr} ldr r0, =0x020244e9 @@ -190675,6 +190727,7 @@ _0806B572: thumb_func_end calc_player_party_count thumb_func_start calc_enemy_party_count +@ u8 calc_enemy_party_count() calc_enemy_party_count: @ 806B580 push {r4,lr} ldr r0, =0x020244ea @@ -190822,6 +190875,7 @@ _0806B68C: thumb_func_end sub_806B638 thumb_func_start sub_806B694 +@ int sub_806B694(u16 a1, int a2) sub_806B694: @ 806B694 push {lr} lsls r0, 16 @@ -191147,6 +191201,7 @@ _0806B90E: thumb_func_end sub_806B8E4 thumb_func_start get_pokemon_name +@ void get_pokemon_name(char *dest, u16 species_num) get_pokemon_name: @ 806B914 push {r4-r7,lr} adds r6, r0, 0 @@ -193979,6 +194034,7 @@ _0806D04E: thumb_func_end sub_806CF78 thumb_func_start get_nature +@ u8 get_nature(pokemon *mon) get_nature: @ 806D070 push {lr} movs r1, 0 @@ -198832,6 +198888,7 @@ _0806F530: thumb_func_end sub_806F4F8 thumb_func_start sine +@ s16 sine(s16 t, s16 amplitude) sine: @ 806F534 lsls r1, 16 asrs r1, 16 @@ -198850,6 +198907,7 @@ sine: @ 806F534 thumb_func_end sine thumb_func_start cosine +@ s16 cosine(s16 t, s16 amplitude) cosine: @ 806F550 lsls r1, 16 asrs r1, 16 @@ -198869,6 +198927,7 @@ cosine: @ 806F550 thumb_func_end cosine thumb_func_start sine2 +@ s16 sine2(u16 angle) sine2: @ 806F570 push {r4,r5,lr} adds r5, r0, 0 @@ -198906,6 +198965,7 @@ _0806F5AC: thumb_func_end sine2 thumb_func_start cosine2 +@ s16 cosine2(u16 angle) cosine2: @ 806F5B4 push {lr} lsls r0, 16 @@ -198921,6 +198981,7 @@ cosine2: @ 806F5B4 thumb_func_end cosine2 thumb_func_start GenerateRandomNumber +@ u16 GenerateRandomNumber() GenerateRandomNumber: @ 806F5CC ldr r2, =0x03005d80 ldr r1, [r2] @@ -198940,6 +199001,7 @@ GenerateRandomNumber: @ 806F5CC thumb_func_end GenerateRandomNumber thumb_func_start SeedRng +@ void SeedRng(u16 seed) SeedRng: @ 806F5F8 lsls r0, 16 lsrs r0, 16 @@ -213541,6 +213603,7 @@ _08076B4E: thumb_func_end sub_8076B14 thumb_func_start flash_timeout_start_on_timer_2_when_flash_present +@ void flash_timeout_start_on_timer_2_when_flash_present() flash_timeout_start_on_timer_2_when_flash_present: @ 8076B68 push {lr} bl IdentifyFlash @@ -213797,6 +213860,7 @@ sav2_gender2_inplace_and_xFE: @ 8076D78 thumb_func_end sav2_gender2_inplace_and_xFE thumb_func_start copy_player_party_to_sav1 +@ void copy_player_party_to_sav1() copy_player_party_to_sav1: @ 8076D8C push {r4,lr} ldr r0, =0x03005d8c @@ -238741,6 +238805,7 @@ set_max_playtime: @ 80842A4 thumb_func_end set_max_playtime thumb_func_start write_word_to_mem +@ void write_word_to_mem(int value, int *mem) write_word_to_mem: @ 80842CC strb r0, [r1] lsrs r2, r0, 8 @@ -239533,6 +239598,7 @@ mapdata_load_assets_to_gpu_and_full_redraw: @ 8084980 thumb_func_end mapdata_load_assets_to_gpu_and_full_redraw thumb_func_start get_mapdata_header +@ mapdata_header *get_mapdata_header() get_mapdata_header: @ 80849A8 push {lr} ldr r0, =0x03005d8c @@ -239558,6 +239624,7 @@ _080849C6: thumb_func_end get_mapdata_header thumb_func_start warp_shift +@ void warp_shift() warp_shift: @ 80849D0 ldr r3, =0x020322dc ldr r0, =0x03005d8c @@ -239586,6 +239653,7 @@ warp_shift: @ 80849D0 thumb_func_end warp_shift thumb_func_start set_warp2_warp3_to_neg_1 +@ void set_warp2_warp3_to_neg_1() set_warp2_warp3_to_neg_1: @ 8084A14 ldr r2, =0x020322ec ldr r0, =0x08339d3c @@ -239602,6 +239670,7 @@ set_warp2_warp3_to_neg_1: @ 8084A14 thumb_func_end set_warp2_warp3_to_neg_1 thumb_func_start warp_set +@ void warp_set(warpdata *warp, char bank, char map, char warpid, char enter_x, char enter_y) warp_set: @ 8084A34 push {r4,r5,lr} ldr r4, [sp, 0xC] @@ -239621,6 +239690,7 @@ warp_set: @ 8084A34 thumb_func_end warp_set thumb_func_start warp_data_is_not_neg_1 +@ int warp_data_is_not_neg_1(warpdata *warp) warp_data_is_not_neg_1: @ 8084A54 push {lr} adds r1, r0, 0 @@ -239656,6 +239726,7 @@ _08084A8A: thumb_func_end warp_data_is_not_neg_1 thumb_func_start get_mapheader_by_bank_and_number +@ struct mapheader *get_mapheader_by_bank_and_number(unsigned int bank, unsigned int num) get_mapheader_by_bank_and_number: @ 8084A90 lsls r0, 16 lsls r1, 16 @@ -239672,6 +239743,7 @@ get_mapheader_by_bank_and_number: @ 8084A90 thumb_func_end get_mapheader_by_bank_and_number thumb_func_start warp1_get_mapheader +@ struct mapheader *warp1_get_mapheader() warp1_get_mapheader: @ 8084AA8 push {lr} ldr r1, =0x020322e4 @@ -239692,6 +239764,7 @@ warp1_get_mapheader: @ 8084AA8 thumb_func_end warp1_get_mapheader thumb_func_start set_current_map_header_from_sav1_save_old_name +@ void set_current_map_header_from_sav1_save_old_name() set_current_map_header_from_sav1_save_old_name: @ 8084ACC push {r4-r6,lr} ldr r1, =0x020322fc @@ -239762,6 +239835,7 @@ set_current_map_header_from_sav1: @ 8084B1C thumb_func_end set_current_map_header_from_sav1 thumb_func_start update_camera_pos_from_warpid +@ void update_camera_pos_from_warpid() update_camera_pos_from_warpid: @ 8084B5C push {r4,r5,lr} ldr r0, =0x03005d8c @@ -239838,6 +239912,7 @@ warp_in: @ 8084BD8 thumb_func_end warp_in thumb_func_start warp1_set +@ void warp1_set(char bank, char map, char warpid, char enter_x, char enter_y) warp1_set: @ 8084BEC push {r4-r6,lr} sub sp, 0x8 @@ -239871,6 +239946,7 @@ warp1_set: @ 8084BEC thumb_func_end warp1_set thumb_func_start warp1_set_2 +@ void warp1_set_2(char bank, char map, char warpid) warp1_set_2: @ 8084C28 push {lr} sub sp, 0x4 @@ -239890,6 +239966,7 @@ warp1_set_2: @ 8084C28 thumb_func_end warp1_set_2 thumb_func_start saved_warp2_set +@ void saved_warp2_set(char bank, char map, char warpid) saved_warp2_set: @ 8084C48 push {r4,r5,lr} sub sp, 0x8 @@ -239963,6 +240040,7 @@ copy_saved_warp2_bank_and_enter_x_to_warp1: @ 8084CB4 thumb_func_end copy_saved_warp2_bank_and_enter_x_to_warp1 thumb_func_start sub_8084CCC +@ void sub_8084CCC(int a1) sub_8084CCC: @ 8084CCC push {r4,lr} sub sp, 0x4 @@ -239993,6 +240071,7 @@ _08084CFA: thumb_func_end sub_8084CCC thumb_func_start copy_saved_warp3_bank_and_enter_x_to_warp1 +@ void copy_saved_warp3_bank_and_enter_x_to_warp1() copy_saved_warp3_bank_and_enter_x_to_warp1: @ 8084D04 ldr r2, =0x020322e4 ldr r0, =0x03005d8c @@ -241875,6 +241954,7 @@ _08085B62: thumb_func_end sub_8085B2C thumb_func_start get_map_light_level_by_bank_and_number +@ int get_map_light_level_by_bank_and_number(int bank, int number) get_map_light_level_by_bank_and_number: @ 8085B74 push {lr} lsls r0, 24 @@ -241890,6 +241970,7 @@ get_map_light_level_by_bank_and_number: @ 8085B74 thumb_func_end get_map_light_level_by_bank_and_number thumb_func_start get_map_light_level_from_warp +@ int get_map_light_level_from_warp(warpdata *warp) get_map_light_level_from_warp: @ 8085B8C push {lr} movs r2, 0 @@ -242066,6 +242147,7 @@ sav1_map_get_battletype: @ 8085C80 thumb_func_end sav1_map_get_battletype thumb_func_start overworld_bg_setup +@ void overworld_bg_setup() overworld_bg_setup: @ 8085CA8 push {r4-r6,lr} mov r6, r8 @@ -242167,6 +242249,7 @@ flag_clear_is_in_safari_zone_: @ 8085D80 thumb_func_end flag_clear_is_in_safari_zone_ thumb_func_start is_c1_link_related_active +@ _BOOL4 is_c1_link_related_active() is_c1_link_related_active: @ 8085D8C push {lr} ldr r0, =0x030022c0 @@ -242186,6 +242269,7 @@ _08085DA6: thumb_func_end is_c1_link_related_active thumb_func_start c1_overworld_normal +@ void c1_overworld_normal(int buttons_new, int buttons_held) c1_overworld_normal: @ 8085DAC push {r4-r6,lr} sub sp, 0x4 @@ -242793,6 +242877,7 @@ _08086308: thumb_func_end sub_8086230 thumb_func_start sub_808631C +@ void sub_808631C() sub_808631C: @ 808631C push {r4,lr} bl warp0_in_pokecenter @@ -243025,6 +243110,7 @@ _08086514: thumb_func_end map_loading_iteration_3 thumb_func_start load_map_stuff +@ int load_map_stuff(u8 *a1, int a2) load_map_stuff: @ 808651C push {r4,r5,lr} adds r4, r0, 0 @@ -246274,6 +246360,7 @@ _08087E56: thumb_func_end mapheader_copy_mapdata_with_padding thumb_func_start map_copy_with_padding +@ int map_copy_with_padding(void *src) map_copy_with_padding: @ 8087E70 push {r4-r7,lr} mov r7, r9 @@ -246795,6 +246882,7 @@ _0808821E: thumb_func_end cur_mapdata_get_middle2bit_at thumb_func_start cur_mapdata_get_blockid_at +@ int cur_mapdata_get_blockid_at(int x, int y) cur_mapdata_get_blockid_at: @ 8088224 push {r4-r6,lr} adds r5, r0, 0 @@ -246876,6 +246964,7 @@ _080882B0: thumb_func_end cur_mapdata_get_blockid_at thumb_func_start cur_mapdata_block_get_role_at +@ int cur_mapdata_block_get_role_at(int x, int y) cur_mapdata_block_get_role_at: @ 80882BC push {lr} bl cur_mapdata_get_blockid_at @@ -246890,6 +246979,7 @@ cur_mapdata_block_get_role_at: @ 80882BC thumb_func_end cur_mapdata_block_get_role_at thumb_func_start cur_mapdata_block_get_bgs_at +@ int cur_mapdata_block_get_bgs_at(int x, int y) cur_mapdata_block_get_bgs_at: @ 80882D4 push {lr} bl cur_mapdata_get_blockid_at @@ -246976,6 +247066,7 @@ _08088364: thumb_func_end sub_8088338 thumb_func_start cur_mapdata_get_behaviour_by_blockid +@ int cur_mapdata_get_behaviour_by_blockid(u16 block_id) cur_mapdata_get_behaviour_by_blockid: @ 8088370 push {lr} lsls r0, 16 @@ -248196,6 +248287,7 @@ _08088C2E: thumb_func_end sub_8088BF0 thumb_func_start copy_tileset_patterns_to_vram +@ void copy_tileset_patterns_to_vram(tileset *tileset, int num_tiles, int offset) copy_tileset_patterns_to_vram: @ 8088C34 push {r4-r7,lr} sub sp, 0x4 @@ -248234,6 +248326,7 @@ _08088C70: thumb_func_end copy_tileset_patterns_to_vram thumb_func_start copy_tileset_patterns_to_vram2 +@ void copy_tileset_patterns_to_vram2(tileset *tileset, int num_tiles, int offset) copy_tileset_patterns_to_vram2: @ 8088C78 push {r4-r7,lr} sub sp, 0x4 @@ -248282,6 +248375,7 @@ nullsub_90: @ 8088CC0 thumb_func_end nullsub_90 thumb_func_start apply_map_tileset_palette +@ void apply_map_tileset_palette(tileset *tileset, int dest_offset, int size) apply_map_tileset_palette: @ 8088CC4 push {r4-r7,lr} mov r7, r8 @@ -248351,6 +248445,7 @@ _08088D42: thumb_func_end apply_map_tileset_palette thumb_func_start copy_map_tileset1_to_vram +@ void copy_map_tileset1_to_vram(mapdata_header *a1) copy_map_tileset1_to_vram: @ 8088D50 push {lr} ldr r0, [r0, 0x10] @@ -248363,6 +248458,7 @@ copy_map_tileset1_to_vram: @ 8088D50 thumb_func_end copy_map_tileset1_to_vram thumb_func_start copy_map_tileset2_to_vram +@ void copy_map_tileset2_to_vram(mapdata_header *a1) copy_map_tileset2_to_vram: @ 8088D64 push {lr} ldr r0, [r0, 0x14] @@ -248375,6 +248471,7 @@ copy_map_tileset2_to_vram: @ 8088D64 thumb_func_end copy_map_tileset2_to_vram thumb_func_start copy_map_tileset2_to_vram_2 +@ void copy_map_tileset2_to_vram_2(mapdata_header *a1) copy_map_tileset2_to_vram_2: @ 8088D78 push {lr} ldr r0, [r0, 0x14] @@ -248387,6 +248484,7 @@ copy_map_tileset2_to_vram_2: @ 8088D78 thumb_func_end copy_map_tileset2_to_vram_2 thumb_func_start apply_map_tileset1_palette +@ void apply_map_tileset1_palette(mapdata_header *a1) apply_map_tileset1_palette: @ 8088D8C push {lr} ldr r0, [r0, 0x10] @@ -248398,6 +248496,7 @@ apply_map_tileset1_palette: @ 8088D8C thumb_func_end apply_map_tileset1_palette thumb_func_start apply_map_tileset2_palette +@ void apply_map_tileset2_palette(mapdata_header *a1) apply_map_tileset2_palette: @ 8088D9C push {lr} ldr r0, [r0, 0x14] @@ -248409,6 +248508,7 @@ apply_map_tileset2_palette: @ 8088D9C thumb_func_end apply_map_tileset2_palette thumb_func_start copy_map_tileset1_tileset2_to_vram +@ void copy_map_tileset1_tileset2_to_vram(mapdata_header *a1) copy_map_tileset1_tileset2_to_vram: @ 8088DAC push {r4,r5,lr} adds r5, r0, 0 @@ -248431,6 +248531,7 @@ _08088DCC: thumb_func_end copy_map_tileset1_tileset2_to_vram thumb_func_start apply_map_tileset1_tileset2_palette +@ void apply_map_tileset1_tileset2_palette(mapdata_header *a1) apply_map_tileset1_tileset2_palette: @ 8088DD4 push {r4,lr} adds r4, r0, 0 @@ -251031,6 +251132,7 @@ _08089B54: thumb_func_end sub_8089B44 thumb_func_start move_tilemap_camera_to_upper_left_corner_ +@ void move_tilemap_camera_to_upper_left_corner_(struc_28 *a1) move_tilemap_camera_to_upper_left_corner_: @ 8089B58 movs r1, 0 strb r1, [r0, 0x2] @@ -251072,6 +251174,7 @@ coords8_add: @ 8089B84 thumb_func_end coords8_add thumb_func_start move_tilemap_camera_to_upper_left_corner +@ void move_tilemap_camera_to_upper_left_corner() move_tilemap_camera_to_upper_left_corner: @ 8089B94 push {lr} ldr r0, =0x03000e20 @@ -251149,6 +251252,7 @@ sub_8089C08: @ 8089C08 thumb_func_end sub_8089C08 thumb_func_start cur_mapdata_full_redraw +@ void cur_mapdata_full_redraw() cur_mapdata_full_redraw: @ 8089C34 push {lr} ldr r0, =0x03005d8c @@ -251170,6 +251274,7 @@ cur_mapdata_full_redraw: @ 8089C34 thumb_func_end cur_mapdata_full_redraw thumb_func_start cur_mapdata_redraw_all_blocks_at +@ void cur_mapdata_redraw_all_blocks_at(int x, int y, mapdata_header *mapdata_header) cur_mapdata_redraw_all_blocks_at: @ 8089C60 push {r4-r7,lr} mov r7, r10 @@ -251544,6 +251649,7 @@ _08089F04: thumb_func_end overworld_draw_block_type1_on_map_coord thumb_func_start cur_mapdata_draw_block_at_internal +@ void cur_mapdata_draw_block_at_internal(mapdata_header *mapdata_header, u16 offset, int x, int y) cur_mapdata_draw_block_at_internal: @ 8089F10 push {r4-r7,lr} mov r7, r8 @@ -251600,6 +251706,7 @@ _08089F54: thumb_func_end cur_mapdata_draw_block_at_internal thumb_func_start overworld_draw_block +@ void overworld_draw_block(int bg, void *block, u16 offset) overworld_draw_block: @ 8089F78 push {r4,lr} adds r4, r1, 0 @@ -252970,6 +253077,7 @@ sub_808A9BC: @ 808A9BC thumb_func_end sub_808A9BC thumb_func_start player_step +@ void player_step(int dpad_direction, int buttons_new, int buttons_held) player_step: @ 808A9C0 push {r4-r7,lr} mov r7, r8 @@ -253079,6 +253187,7 @@ _0808AA94: thumb_func_end sub_808AA38 thumb_func_start npc_clear_strange_bits +@ int npc_clear_strange_bits(npc_state *) npc_clear_strange_bits: @ 808AA9C ldrb r2, [r0, 0x1] movs r1, 0x11 @@ -253101,6 +253210,7 @@ npc_clear_strange_bits: @ 808AA9C thumb_func_end npc_clear_strange_bits thumb_func_start player_step_by_keypad +@ void player_step_by_keypad(int dpad_direction, int buttons_new, int buttons_held) player_step_by_keypad: @ 808AAC0 push {r4,lr} lsls r0, 24 @@ -253614,6 +253724,7 @@ _0808AE62: thumb_func_end sub_808AE10 thumb_func_start dp04_continue_movement +@ void dp04_continue_movement(int dpad_direction, int buttons_held) dp04_continue_movement: @ 808AE68 push {r4-r6,lr} adds r4, r0, 0 @@ -255253,6 +255364,7 @@ player_get_pos_to_plus_one_step_in_direction_player_is_facing: @ 808BA68 thumb_func_end player_get_pos_to_plus_one_step_in_direction_player_is_facing thumb_func_start player_get_pos_to +@ void player_get_pos_to(int *x, int *y) player_get_pos_to: @ 808BAAC push {r4,r5,lr} ldr r5, =0x02037350 @@ -283498,6 +283610,7 @@ _08098772: thumb_func_end sub_8098758 thumb_func_start copy_textbox_border_tile_patterns_to_vram +@ void copy_textbox_border_tile_patterns_to_vram(u8 rbox_id, u16 tile_pattern_dest_offset, u8 pal_dest_offset) copy_textbox_border_tile_patterns_to_vram: @ 809877C push {r4,r5,lr} adds r4, r1, 0 @@ -284162,6 +284275,7 @@ sub_8098C6C: @ 8098C6C thumb_func_end sub_8098C6C thumb_func_start script_env_init +@ void script_env_init(script_env *env, int a2, int a3) script_env_init: @ 8098CB8 push {lr} adds r3, r0, 0 @@ -284197,6 +284311,7 @@ _08098CE6: thumb_func_end script_env_init thumb_func_start script_setup_bytecode_script +@ int script_setup_bytecode_script(script_env *env, void *script_ptr) script_setup_bytecode_script: @ 8098CF4 str r1, [r0, 0x8] movs r1, 0x1 @@ -284214,6 +284329,7 @@ script_setup_asm_script: @ 8098D00 thumb_func_end script_setup_asm_script thumb_func_start script_stop +@ void script_stop(script_env *env) script_stop: @ 8098D08 movs r1, 0 strb r1, [r0, 0x1] @@ -284222,6 +284338,7 @@ script_stop: @ 8098D08 thumb_func_end script_stop thumb_func_start script_main_handler +@ int script_main_handler(script_env *env) script_main_handler: @ 8098D10 push {r4,lr} adds r4, r0, 0 @@ -284302,6 +284419,7 @@ _08098D90: thumb_func_end script_main_handler thumb_func_start script_stack_push +@ int script_stack_push(script_env *env, int value) script_stack_push: @ 8098D98 push {lr} adds r2, r0, 0 @@ -284328,6 +284446,7 @@ _08098DBC: thumb_func_end script_stack_push thumb_func_start script_stack_pop +@ int script_stack_pop(script_env *env) script_stack_pop: @ 8098DC0 push {lr} adds r2, r0, 0 @@ -284351,12 +284470,14 @@ _08098DDE: thumb_func_end script_stack_pop thumb_func_start script_jump +@ void script_jump(script_env *env, int address) script_jump: @ 8098DE4 str r1, [r0, 0x8] bx lr thumb_func_end script_jump thumb_func_start script_call +@ void script_call(script_env *env, int address) script_call: @ 8098DE8 push {r4,r5,lr} adds r4, r0, 0 @@ -284370,6 +284491,7 @@ script_call: @ 8098DE8 thumb_func_end script_call thumb_func_start script_return +@ void script_return(script_env *env) script_return: @ 8098DFC push {r4,lr} adds r4, r0, 0 @@ -284381,6 +284503,7 @@ script_return: @ 8098DFC thumb_func_end script_return thumb_func_start script_read_halfword +@ int script_read_halfword(script_env *env) script_read_halfword: @ 8098E0C adds r3, r0, 0 ldr r2, [r3, 0x8] @@ -284396,6 +284519,7 @@ script_read_halfword: @ 8098E0C thumb_func_end script_read_halfword thumb_func_start script_read_word +@ int script_read_word(script_env *env) script_read_word: @ 8098E24 push {r4-r6,lr} adds r3, r0, 0 @@ -284444,6 +284568,7 @@ script_env_2_disable: @ 8098E60 thumb_func_end script_env_2_disable thumb_func_start script_env_2_is_enabled +@ int script_env_2_is_enabled() script_env_2_is_enabled: @ 8098E6C ldr r0, =0x03000f2c ldrb r0, [r0] @@ -284453,6 +284578,7 @@ script_env_2_is_enabled: @ 8098E6C thumb_func_end script_env_2_is_enabled thumb_func_start script_env_context_is_running +@ int script_env_context_is_running() script_env_context_is_running: @ 8098E78 push {lr} ldr r0, =0x03000e38 @@ -284564,6 +284690,7 @@ script_env_2_enable_and_set_ctx_running: @ 8098F3C thumb_func_end script_env_2_enable_and_set_ctx_running thumb_func_start script_env_2_execute_new_script +@ void script_env_2_execute_new_script(void *script_ptr) script_env_2_execute_new_script: @ 8098F50 push {r4,r5,lr} adds r5, r0, 0 @@ -284644,6 +284771,7 @@ _08098FDA: thumb_func_end mapheader_run_script_by_tag thumb_func_start mapheader_get_first_match_from_tagged_ptr_list +@ int mapheader_get_first_match_from_tagged_ptr_list(int tag) mapheader_get_first_match_from_tagged_ptr_list: @ 8098FE0 push {r4-r6,lr} lsls r0, 24 @@ -284743,6 +284871,7 @@ mapheader_run_script_with_tag_x6: @ 8099070 thumb_func_end mapheader_run_script_with_tag_x6 thumb_func_start mapheader_run_first_tag2_script_list_match +@ int mapheader_run_first_tag2_script_list_match() mapheader_run_first_tag2_script_list_match: @ 809907C push {lr} movs r0, 0x2 @@ -284760,6 +284889,7 @@ _08099092: thumb_func_end mapheader_run_first_tag2_script_list_match thumb_func_start mapheader_run_first_tag4_script_list_match +@ void mapheader_run_first_tag4_script_list_match() mapheader_run_first_tag4_script_list_match: @ 8099098 push {lr} movs r0, 0x4 @@ -285167,6 +285297,7 @@ s04_call: @ 809938C thumb_func_end s04_call thumb_func_start s06_if_jump +@ int s06_if_jump(script_env *env) s06_if_jump: @ 80993A4 push {r4,r5,lr} adds r5, r0, 0 @@ -285231,6 +285362,7 @@ _0809940E: thumb_func_end s07_if_call thumb_func_start sB8_set_virtual_address +@ int sB8_set_virtual_address(script_env *env) sB8_set_virtual_address: @ 809941C push {r4,lr} ldr r4, [r0, 0x8] @@ -285248,6 +285380,7 @@ sB8_set_virtual_address: @ 809941C thumb_func_end sB8_set_virtual_address thumb_func_start sB9_virtual_jump +@ int sB9_virtual_jump(script_env *env) sB9_virtual_jump: @ 8099438 push {r4,lr} adds r4, r0, 0 @@ -285520,6 +285653,7 @@ s0E_set_byte: @ 809962C thumb_func_end s0E_set_byte thumb_func_start s0F_u32_var_to_const +@ int s0F_u32_var_to_const(script_env *env) s0F_u32_var_to_const: @ 8099644 push {r4,r5,lr} adds r4, r0, 0 @@ -285540,6 +285674,7 @@ s0F_u32_var_to_const: @ 8099644 thumb_func_end s0F_u32_var_to_const thumb_func_start s12_u32_var_to_ptr +@ int s12_u32_var_to_ptr(script_env *env) s12_u32_var_to_ptr: @ 8099668 push {r4,r5,lr} adds r4, r0, 0 @@ -285561,6 +285696,7 @@ s12_u32_var_to_ptr: @ 8099668 thumb_func_end s12_u32_var_to_ptr thumb_func_start s11_u8_ptr_to_const +@ int s11_u8_ptr_to_const(script_env *env) s11_u8_ptr_to_const: @ 809968C push {r4,lr} ldr r1, [r0, 0x8] @@ -285576,6 +285712,7 @@ s11_u8_ptr_to_const: @ 809968C thumb_func_end s11_u8_ptr_to_const thumb_func_start s10_u8_var_to_const +@ int s10_u8_var_to_const(script_env *env) s10_u8_var_to_const: @ 80996A4 ldr r1, [r0, 0x8] ldrb r3, [r1] @@ -285594,6 +285731,7 @@ s10_u8_var_to_const: @ 80996A4 thumb_func_end s10_u8_var_to_const thumb_func_start s13_u8_var_to_ptr +@ int s13_u8_var_to_ptr(script_env *env) s13_u8_var_to_ptr: @ 80996C0 push {r4,r5,lr} adds r4, r0, 0 @@ -286292,6 +286430,7 @@ sub_8099BE8: @ 8099BE8 thumb_func_end sub_8099BE8 thumb_func_start s29_flag_set +@ int s29_flag_set(script_env *env) s29_flag_set: @ 8099C14 push {lr} bl script_read_halfword @@ -286304,6 +286443,7 @@ s29_flag_set: @ 8099C14 thumb_func_end s29_flag_set thumb_func_start s2A_flag_clear +@ int s2A_flag_clear(script_env *env) s2A_flag_clear: @ 8099C28 push {lr} bl script_read_halfword @@ -286316,6 +286456,7 @@ s2A_flag_clear: @ 8099C28 thumb_func_end s2A_flag_clear thumb_func_start s2B_flag_check +@ int s2B_flag_check(script_env *env) s2B_flag_check: @ 8099C3C push {r4,lr} adds r4, r0, 0 @@ -286331,6 +286472,7 @@ s2B_flag_check: @ 8099C3C thumb_func_end s2B_flag_check thumb_func_start sC3_unknown +@ int sC3_unknown(script_env *env) sC3_unknown: @ 8099C58 push {lr} ldr r1, [r0, 0x8] @@ -286345,6 +286487,7 @@ sC3_unknown: @ 8099C58 thumb_func_end sC3_unknown thumb_func_start s9A_unknown +@ int s9A_unknown(script_env *env) s9A_unknown: @ 8099C70 push {lr} ldr r1, [r0, 0x8] @@ -286360,6 +286503,7 @@ s9A_unknown: @ 8099C70 thumb_func_end s9A_unknown thumb_func_start s99_unknown +@ int s99_unknown(script_env *env) s99_unknown: @ 8099C8C push {lr} bl script_read_halfword @@ -286395,6 +286539,7 @@ _08099CC2: thumb_func_end sub_8099CA8 thumb_func_start s97_screen_special_effect +@ int s97_screen_special_effect(script_env *env) s97_screen_special_effect: @ 8099CC8 push {r4,lr} adds r4, r0, 0 @@ -286416,6 +286561,7 @@ s97_screen_special_effect: @ 8099CC8 thumb_func_end s97_screen_special_effect thumb_func_start s98_refade_with_timer +@ int s98_refade_with_timer(script_env *env) s98_refade_with_timer: @ 8099CF0 push {r4,lr} adds r4, r0, 0 @@ -286441,6 +286587,7 @@ s98_refade_with_timer: @ 8099CF0 thumb_func_end s98_refade_with_timer thumb_func_start sub_8099D20 +@ int sub_8099D20(script_env *env) sub_8099D20: @ 8099D20 push {r4,r5,lr} adds r5, r0, 0 @@ -286511,6 +286658,7 @@ _08099DAE: thumb_func_end s28_pause_asm thumb_func_start s28_pause +@ int s28_pause(script_env *env) s28_pause: @ 8099DB4 push {r4,lr} adds r4, r0, 0 @@ -286529,6 +286677,7 @@ s28_pause: @ 8099DB4 thumb_func_end s28_pause thumb_func_start s2C_unknown +@ int s2C_unknown(script_env *env) s2C_unknown: @ 8099DD8 push {r4,r5,lr} adds r5, r0, 0 @@ -286556,6 +286705,7 @@ s2C_unknown: @ 8099DD8 thumb_func_end s2C_unknown thumb_func_start s2D_unknown +@ int s2D_unknown(script_env *env) s2D_unknown: @ 8099E10 push {lr} bl sub_809E7B0 @@ -286565,6 +286715,7 @@ s2D_unknown: @ 8099E10 thumb_func_end s2D_unknown thumb_func_start s2E_unknown +@ int s2E_unknown(script_env *env) s2E_unknown: @ 8099E1C push {lr} bl sub_802F588 @@ -286589,6 +286740,7 @@ s2E_unknown: @ 8099E1C thumb_func_end s2E_unknown thumb_func_start sA4_set_weather_data +@ int sA4_set_weather_data(script_env *env) sA4_set_weather_data: @ 8099E54 push {lr} bl script_read_halfword @@ -286604,6 +286756,7 @@ sA4_set_weather_data: @ 8099E54 thumb_func_end sA4_set_weather_data thumb_func_start sA3_set_standard_weather_data +@ int sA3_set_standard_weather_data(script_env *env) sA3_set_standard_weather_data: @ 8099E70 push {lr} bl sub_80AEDBC @@ -286613,6 +286766,7 @@ sA3_set_standard_weather_data: @ 8099E70 thumb_func_end sA3_set_standard_weather_data thumb_func_start sub_8099E7C +@ int sub_8099E7C(script_env *env) sub_8099E7C: @ 8099E7C push {lr} bl sub_80AEE20 @@ -286622,6 +286776,7 @@ sub_8099E7C: @ 8099E7C thumb_func_end sub_8099E7C thumb_func_start sA6_activate_per_step_callback_eg_ash +@ int sA6_activate_per_step_callback_eg_ash(script_env *env) sA6_activate_per_step_callback_eg_ash: @ 8099E88 push {lr} ldr r1, [r0, 0x8] @@ -286636,6 +286791,7 @@ sA6_activate_per_step_callback_eg_ash: @ 8099E88 thumb_func_end sA6_activate_per_step_callback_eg_ash thumb_func_start sA7_set_new_map_footer +@ int sA7_set_new_map_footer(script_env *env) sA7_set_new_map_footer: @ 8099EA0 push {lr} bl script_read_halfword @@ -286651,6 +286807,7 @@ sA7_set_new_map_footer: @ 8099EA0 thumb_func_end sA7_set_new_map_footer thumb_func_start s39_warp_sfx +@ int s39_warp_sfx(script_env *env) s39_warp_sfx: @ 8099EBC push {r4-r6,lr} mov r6, r9 @@ -286715,6 +286872,7 @@ s39_warp_sfx: @ 8099EBC thumb_func_end s39_warp_sfx thumb_func_start s3A_warp_new_music +@ int s3A_warp_new_music(script_env *env) s3A_warp_new_music: @ 8099F44 push {r4-r6,lr} mov r6, r9 @@ -286779,6 +286937,7 @@ s3A_warp_new_music: @ 8099F44 thumb_func_end s3A_warp_new_music thumb_func_start s3B_warp_keep_music +@ int s3B_warp_keep_music(script_env *env) s3B_warp_keep_music: @ 8099FCC push {r4-r6,lr} mov r6, r9 @@ -287342,6 +287501,7 @@ sC4_unknown: @ 809A3DC thumb_func_end sC4_unknown thumb_func_start s42_get_map_camera_pos +@ int s42_get_map_camera_pos(script_env *env) s42_get_map_camera_pos: @ 809A45C push {r4,r5,lr} adds r4, r0, 0 @@ -287461,6 +287621,7 @@ s32_fanfare_wait: @ 809A518 thumb_func_end s32_fanfare_wait thumb_func_start s33_play_music +@ int s33_play_music(script_env *env) s33_play_music: @ 809A52C push {r4,r5,lr} adds r4, r0, 0 @@ -289433,6 +289594,7 @@ _0809B44A: thumb_func_end sub_809B3DC thumb_func_start s90_add_money +@ int s90_add_money(script_env *env) s90_add_money: @ 809B458 push {r4,lr} adds r4, r0, 0 @@ -289461,6 +289623,7 @@ _0809B47E: thumb_func_end s90_add_money thumb_func_start s91_subtract_money +@ int s91_subtract_money(script_env *env) s91_subtract_money: @ 809B48C push {r4,lr} adds r4, r0, 0 @@ -289489,6 +289652,7 @@ _0809B4B2: thumb_func_end s91_subtract_money thumb_func_start s92_check_money +@ int s92_check_money(script_env *env) s92_check_money: @ 809B4C0 push {r4,lr} adds r4, r0, 0 @@ -289521,6 +289685,7 @@ _0809B4EE: thumb_func_end s92_check_money thumb_func_start s93_display_money +@ int s93_display_money(script_env *env) s93_display_money: @ 809B500 push {r4,r5,lr} ldr r1, [r0, 0x8] @@ -289563,6 +289728,7 @@ s94_hide_money: @ 809B53C thumb_func_end s94_hide_money thumb_func_start s95_update_money +@ int s95_update_money(script_env *env) s95_update_money: @ 809B548 push {lr} ldr r1, [r0, 0x8] @@ -290867,6 +291033,7 @@ sub_809BEDC: @ 809BEDC thumb_func_end sub_809BEDC thumb_func_start process_overworld_input +@ void process_overworld_input(overworld_input_data *input_data, char buttons_new, char buttons_held) process_overworld_input: @ 809BF08 push {r4-r7,lr} mov r7, r9 @@ -291014,6 +291181,7 @@ _0809C006: thumb_func_end process_overworld_input thumb_func_start sub_809C014 +@ int sub_809C014(overworld_input_data *input_data) sub_809C014: @ 809C014 push {r4-r6,lr} sub sp, 0x8 @@ -293771,6 +293939,7 @@ _0809D642: thumb_func_end sub_809D614 thumb_func_start var_get_pointer +@ u16 *var_get_pointer(u16 var_id) var_get_pointer: @ 809D648 push {lr} lsls r0, 16 @@ -293811,6 +293980,7 @@ _0809D688: thumb_func_end var_get_pointer thumb_func_start var_get +@ u16 var_get(u16 var_id) var_get: @ 809D694 push {r4,lr} lsls r0, 16 @@ -293830,6 +294000,7 @@ _0809D6AA: thumb_func_end var_get thumb_func_start var_set +@ bool var_set(u16 var_id, u16 value) var_set: @ 809D6B0 push {r4,lr} lsls r0, 16 @@ -293868,6 +294039,7 @@ var_load_x4010_plus_r0: @ 809D6D0 thumb_func_end var_load_x4010_plus_r0 thumb_func_start flag_get_pointer +@ u8 *flag_get_pointer(u16 flag_id) flag_get_pointer: @ 809D6EC push {lr} lsls r1, r0, 16 @@ -293909,6 +294081,7 @@ _0809D72E: thumb_func_end flag_get_pointer thumb_func_start flag_set +@ bool flag_set(u16 flag_id) flag_set: @ 809D740 push {r4,lr} lsls r0, 16 @@ -293933,6 +294106,7 @@ _0809D760: thumb_func_end flag_set thumb_func_start flag_clear +@ bool flag_clear(u16 flag_id) flag_clear: @ 809D768 push {r4,lr} lsls r0, 16 @@ -293957,6 +294131,7 @@ _0809D788: thumb_func_end flag_clear thumb_func_start flag_check +@ bool flag_check(u16 flag_id) flag_check: @ 809D790 push {r4,lr} lsls r0, 16 @@ -300179,6 +300354,7 @@ append_byte: @ 80A0944 thumb_func_end append_byte thumb_func_start sub_80A0954 +@ void sub_80A0954() sub_80A0954: @ 80A0954 push {lr} sub sp, 0x4 @@ -302113,6 +302289,7 @@ _080A18D6: thumb_func_end sub_80A1884 thumb_func_start decompress_palette +@ void decompress_palette(void *src, u16 offset, u16 size) decompress_palette: @ 80A18F4 push {r4-r6,lr} adds r4, r1, 0 @@ -302144,6 +302321,7 @@ decompress_palette: @ 80A18F4 thumb_func_end decompress_palette thumb_func_start gpu_pal_apply +@ void gpu_pal_apply(void *src, int dest_offset, int mode) gpu_pal_apply: @ 80A1938 push {r4-r6,lr} adds r6, r0, 0 @@ -302210,6 +302388,7 @@ rboxid_80040B8: @ 80A1970 thumb_func_end rboxid_80040B8 thumb_func_start copy_pal_bg_faded_to_pal_ram +@ void copy_pal_bg_faded_to_pal_ram() copy_pal_bg_faded_to_pal_ram: @ 80A19C0 push {r4,r5,lr} ldr r4, =0x02037fd4 @@ -302252,6 +302431,7 @@ _080A1A02: thumb_func_end copy_pal_bg_faded_to_pal_ram thumb_func_start fade_and_return_progress_probably +@ int fade_and_return_progress_probably() fade_and_return_progress_probably: @ 80A1A1C push {lr} ldr r0, =0x02037fe4 @@ -305460,6 +305640,7 @@ sub_80A3228: @ 80A3228 thumb_func_end sub_80A3228 thumb_func_start play_sound_effect +@ void play_sound_effect(u8 a1) play_sound_effect: @ 80A3240 push {lr} adds r1, r0, 0 @@ -306843,6 +307024,7 @@ ma00_load_graphics: @ 80A3D24 thumb_func_end ma00_load_graphics thumb_func_start ma01_080728D0 +@ void ma01_080728D0() ma01_080728D0: @ 80A3D8C push {r4-r6,lr} ldr r6, =0x020383f0 @@ -307598,13 +307780,13 @@ _080A43AA: lsls r2, 6 movs r0, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill ldr r1, =0x0600f000 movs r2, 0x80 lsls r2, 5 movs r0, 0xFF movs r3, 0 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill b _080A43F8 .align 2, 0 .pool @@ -307614,13 +307796,13 @@ _080A43DC: lsls r2, 6 movs r0, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill ldr r1, =0x0600e000 movs r2, 0x80 lsls r2, 5 movs r0, 0xFF movs r3, 0 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill _080A43F8: add r0, sp, 0x10 bl sub_80A6B30 @@ -307775,14 +307957,14 @@ _080A455E: lsls r2, 6 movs r0, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill ldr r1, =0x0600f000 movs r7, 0x80 lsls r7, 5 movs r0, 0 adds r2, r7, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill add r0, sp, 0x10 movs r1, 0x2 bl sub_80A6B90 @@ -308068,6 +308250,7 @@ _080A47C6: thumb_func_end sub_80A477C thumb_func_start task_pA_ma0A_obj_to_bg_pal +@ void task_pA_ma0A_obj_to_bg_pal(int task_id) task_pA_ma0A_obj_to_bg_pal: @ 80A47D8 push {r4-r6,lr} sub sp, 0x10 @@ -316100,7 +316283,7 @@ _080A8540: movs r2, 0x80 lsls r2, 4 movs r3, 0x1 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy ldr r0, [r5] adds r0, r4 ldr r0, [r0] @@ -319550,6 +319733,7 @@ _080AA556: thumb_func_end sub_80AA548 thumb_func_start title_screen_logo_shine_obj_callback_type1 +@ void title_screen_logo_shine_obj_callback_type1(struct obj *obj) title_screen_logo_shine_obj_callback_type1: @ 80AA5A4 push {r4,lr} adds r3, r0, 0 @@ -319645,6 +319829,7 @@ _080AA648: thumb_func_end title_screen_logo_shine_obj_callback_type1 thumb_func_start title_screen_logo_shine_obj_callback_type2 +@ void title_screen_logo_shine_obj_callback_type2(struct obj *obj) title_screen_logo_shine_obj_callback_type2: @ 80AA654 push {lr} adds r2, r0, 0 @@ -319669,6 +319854,7 @@ _080AA676: thumb_func_end title_screen_logo_shine_obj_callback_type2 thumb_func_start title_screen_add_logo_shine_obj +@ void title_screen_add_logo_shine_obj(int a1) title_screen_add_logo_shine_obj: @ 80AA67C push {r4-r6,lr} mov r6, r10 @@ -319797,6 +319983,7 @@ _080AA766: thumb_func_end title_screen_add_logo_shine_obj thumb_func_start title_screen_vblank_callback +@ void title_screen_vblank_callback() title_screen_vblank_callback: @ 80AA780 push {lr} bl sub_80BA0A8 @@ -319814,6 +320001,7 @@ title_screen_vblank_callback: @ 80AA780 thumb_func_end title_screen_vblank_callback thumb_func_start c2_title_screen_1 +@ void c2_title_screen_1() c2_title_screen_1: @ 80AA7A4 push {r4,lr} sub sp, 0x14 @@ -320133,6 +320321,7 @@ _080AAB1E: thumb_func_end c2_title_screen_1 thumb_func_start c2_title_screen_2 +@ void c2_title_screen_2() c2_title_screen_2: @ 80AAB2C push {lr} bl run_active_tasks @@ -320144,6 +320333,7 @@ c2_title_screen_2: @ 80AAB2C thumb_func_end c2_title_screen_2 thumb_func_start task_title_screen_1 +@ void task_title_screen_1(int task_id) task_title_screen_1: @ 80AAB44 push {r4-r6,lr} lsls r0, 24 @@ -320265,6 +320455,7 @@ _080AAC32: thumb_func_end task_title_screen_1 thumb_func_start task_title_screen_2 +@ void task_title_screen_2(int task_id) task_title_screen_2: @ 80AAC50 push {r4-r7,lr} lsls r0, 24 @@ -320394,6 +320585,7 @@ _080AAD20: thumb_func_end task_title_screen_2 thumb_func_start task_title_screen_3 +@ void task_title_screen_3(int task_id) task_title_screen_3: @ 80AAD64 push {r4,r5,lr} sub sp, 0x4 @@ -320621,6 +320813,7 @@ _080AAF3E: thumb_func_end c2_berry_program_update_screen_1 thumb_func_start title_screen_update_rayquaza_ring_palette +@ void title_screen_update_rayquaza_ring_palette(u8 a1) title_screen_update_rayquaza_ring_palette: @ 80AAF48 push {lr} sub sp, 0x4 @@ -320671,6 +320864,7 @@ _080AAF9C: thumb_func_end title_screen_update_rayquaza_ring_palette thumb_func_start sub_80AAFA4 +@ void sub_80AAFA4() sub_80AAFA4: @ 80AAFA4 push {r4-r6,lr} ldr r0, =sub_80AB1B0 + 1 @@ -377368,7 +377562,7 @@ sub_80C7E98: @ 80C7E98 bl reset_all_obj_data bl gpu_tile_obj_tags_reset bl gpu_pal_allocator_reset - bl dma3_transfer_queue_clear + bl ClearDma3Requests ldr r1, =0x02021b3a movs r2, 0xA0 lsls r2, 2 @@ -385682,7 +385876,7 @@ _080CC3B0: lsls r2, 5 movs r0, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill strh r0, [r4, 0xA] b _080CC458 .align 2, 0 @@ -385690,7 +385884,7 @@ _080CC3B0: _080CC3E8: movs r1, 0xA ldrsh r0, [r4, r1] - bl dma3_transfer_queue_check_for_space + bl CheckForSpaceForDma3Request lsls r0, 16 asrs r0, 16 movs r1, 0x1 @@ -390776,25 +390970,25 @@ _080CEE34: adds r0, r3 movs r1, 0 movs r2, 0x5 - bl sub_80090FC + bl RepeatChar ldr r0, [r4] ldr r1, =0x00000cf9 adds r0, r1 movs r1, 0 movs r2, 0x8 - bl sub_80090FC + bl RepeatChar ldr r0, [r4] ldr r2, =0x00000d1d adds r0, r2 movs r1, 0 movs r2, 0x8 - bl sub_80090FC + bl RepeatChar ldr r0, [r4] ldr r3, =0x00000d41 adds r0, r3 movs r1, 0 movs r2, 0x8 - bl sub_80090FC + bl RepeatChar ldr r0, [r4] ldr r1, =0x00000d65 adds r0, r1 @@ -390834,20 +391028,20 @@ _080CEECE: adds r0, r3 movs r1, 0 movs r2, 0x8 - bl sub_80090FC + bl RepeatChar ldr r0, [r4] ldr r1, =0x00000d41 adds r0, r1 movs r1, 0 movs r2, 0x8 - bl sub_80090FC + bl RepeatChar ldr r0, [r4] ldr r2, =0x00000d65 adds r0, r2 _080CEEF2: movs r1, 0 movs r2, 0x8 - bl sub_80090FC + bl RepeatChar b _080CF0B8 .align 2, 0 .pool @@ -391019,7 +391213,7 @@ _080CF0AC: adds r0, r4, r1 movs r1, 0 movs r2, 0x8 - bl sub_80090FC + bl RepeatChar _080CF0B8: pop {r3-r5} mov r8, r3 @@ -396674,6 +396868,7 @@ nullsub_98: @ 80D1D08 thumb_func_end nullsub_98 thumb_func_start get_preferred_box +@ char get_preferred_box() get_preferred_box: @ 80D1D0C ldr r0, =0x03005d94 ldr r0, [r0] @@ -397179,6 +397374,7 @@ _080D2088: thumb_func_end sub_80D2054 thumb_func_start get_pokemon_by_box_and_pos +@ pokemon *get_pokemon_by_box_and_pos(u8 box_id, u8 pos) get_pokemon_by_box_and_pos: @ 80D2094 push {r4,lr} lsls r0, 24 @@ -406186,6 +406382,7 @@ call_encrypt_decrypt_all_item_quantities: @ 80D65E4 thumb_func_end call_encrypt_decrypt_all_item_quantities thumb_func_start init_bag_pockets +@ void init_bag_pockets() init_bag_pockets: @ 80D65F0 push {r4,lr} ldr r1, =0x02039dd8 @@ -406229,6 +406426,7 @@ init_bag_pockets: @ 80D65F0 thumb_func_end init_bag_pockets thumb_func_start itemid_get_name +@ void itemid_get_name(int item_id, char *dest) itemid_get_name: @ 80D6644 push {r4,lr} adds r4, r1, 0 @@ -406626,6 +406824,7 @@ _080D6916: thumb_func_end sub_80D6800 thumb_func_start bag_add_item +@ int bag_add_item(int item_id, int quantity) bag_add_item: @ 80D6928 push {r4-r7,lr} mov r7, r10 @@ -407411,6 +407610,7 @@ _080D6F0E: thumb_func_end sub_80D6EDC thumb_func_start bag_pocket_get_itemid +@ int bag_pocket_get_itemid(int pocket_id_plus_1, int item_index_in_pocket) bag_pocket_get_itemid: @ 80D6F14 lsls r0, 24 lsls r1, 16 @@ -407428,6 +407628,7 @@ bag_pocket_get_itemid: @ 80D6F14 thumb_func_end bag_pocket_get_itemid thumb_func_start bag_pocket_get_item_quantity +@ int bag_pocket_get_item_quantity(int pocket_id_plus_1, int item_index_in_pocket) bag_pocket_get_item_quantity: @ 80D6F30 push {lr} lsls r0, 24 @@ -408133,6 +408334,7 @@ _080D7470: thumb_func_end itemid_sanitize thumb_func_start itemid_get_item +@ item *itemid_get_item(s16 itemId) itemid_get_item: @ 80D7474 push {lr} lsls r0, 16 @@ -409336,17 +409538,17 @@ _080D7E84: movs r0, 0 adds r2, r4, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill ldr r1, =0x06008000 movs r0, 0 adds r2, r4, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill ldr r1, =0x06010000 movs r0, 0 adds r2, r4, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill b _080D80AE .align 2, 0 .pool @@ -418632,7 +418834,7 @@ sub_80DC9EC: @ 80DC9EC lsls r2, 4 mov r10, r2 movs r3, 0x1 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy ldr r0, [r7] ldr r0, [r0, 0x38] ldrh r1, [r5, 0x4] @@ -418641,7 +418843,7 @@ sub_80DC9EC: @ 80DC9EC adds r1, r6 mov r2, r10 movs r3, 0x1 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy mov r3, r8 strh r3, [r4, 0x2E] mov r0, r9 @@ -421066,7 +421268,7 @@ sub_80DDE30: @ 80DDE30 movs r2, 0x80 lsls r2, 5 movs r3, 0x1 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy b _080DDE8C .align 2, 0 .pool @@ -421076,7 +421278,7 @@ _080DDE78: movs r2, 0x80 lsls r2, 5 movs r3, 0x1 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy ldrh r0, [r4, 0x20] adds r0, 0x1 strh r0, [r4, 0x20] @@ -421683,7 +421885,7 @@ sub_80DE350: @ 80DE350 lsls r2, 6 movs r0, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill movs r5, 0 str r5, [sp] ldr r6, =0x02039f34 @@ -424645,6 +424847,7 @@ _080DFA70: thumb_func_end sub_80DFA08 thumb_func_start CreateShopMainMenu +@ s8 CreateShopMainMenu(s8 type) CreateShopMainMenu: @ 80DFA78 push {r4,r5,lr} sub sp, 0x10 @@ -424732,6 +424935,7 @@ _080DFAF8: thumb_func_end CreateShopMainMenu thumb_func_start SetShopMenuCallback +@ void SetShopMenuCallback() SetShopMenuCallback: @ 80DFB4C ldr r1, =0x02039f60 str r0, [r1] @@ -424741,6 +424945,7 @@ SetShopMenuCallback: @ 80DFB4C thumb_func_end SetShopMenuCallback thumb_func_start SetShopItemsForSale +@ int SetShopItemsForSale(s16 *itemsForSale) SetShopItemsForSale: @ 80DFB58 push {lr} adds r1, r0, 0 @@ -425280,6 +425485,7 @@ _080DFFDE: thumb_func_end GetShopItemNames thumb_func_start GetShopItemName +@ void GetShopItemName(ShopItem *items1, s16 itemId, char *name) GetShopItemName: @ 80E0000 push {r4-r6,lr} adds r6, r0, 0 @@ -429692,6 +429898,7 @@ _080E2360: thumb_func_end sub_80E2308 thumb_func_start sp109_CreatePCMenu +@ bool sp109_CreatePCMenu() sp109_CreatePCMenu: @ 80E236C push {lr} ldr r0, =sub_80E2058 + 1 @@ -430919,6 +431126,7 @@ _080E2D70: thumb_func_end sub_80E2D5C thumb_func_start do_choose_name_or_words_screen +@ int do_choose_name_or_words_screen(u8 type, sav2 *sav2_ptr, s16 player_gender, s16 a4, int a5, void ( *after_finishing_callback)()) do_choose_name_or_words_screen: @ 80E2D78 push {r4-r7,lr} mov r7, r8 @@ -431055,6 +431263,7 @@ _080E2EA4: thumb_func_end c2_choose_name_or_words_screen thumb_func_start choose_name_or_words_screen_setup +@ void choose_name_or_words_screen_setup() choose_name_or_words_screen_setup: @ 80E2EA8 push {r4-r7,lr} ldr r5, =0x02039f94 @@ -435278,6 +435487,7 @@ sub_80E50EC: @ 80E50EC thumb_func_end sub_80E50EC thumb_func_start decrypt_money +@ int decrypt_money(int *money_ptr) decrypt_money: @ 80E5114 ldr r1, =0x03005d90 ldr r1, [r1] @@ -435291,6 +435501,7 @@ decrypt_money: @ 80E5114 thumb_func_end decrypt_money thumb_func_start encrypt_money +@ void encrypt_money(int *money_ptr, int value) encrypt_money: @ 80E5128 ldr r2, =0x03005d90 ldr r2, [r2] @@ -435304,6 +435515,7 @@ encrypt_money: @ 80E5128 thumb_func_end encrypt_money thumb_func_start is_money_greater_than +@ int is_money_greater_than(int *money_ptr, int amount) is_money_greater_than: @ 80E513C push {r4,lr} adds r4, r1, 0 @@ -435321,6 +435533,7 @@ _080E514E: thumb_func_end is_money_greater_than thumb_func_start add_money +@ void add_money(int *money_ptr, int amount) add_money: @ 80E5154 push {r4-r6,lr} adds r6, r0, 0 @@ -435350,6 +435563,7 @@ _080E5178: thumb_func_end add_money thumb_func_start subtract_money +@ void subtract_money(int *money_ptr, int amount) subtract_money: @ 80E518C push {r4,r5,lr} adds r5, r0, 0 @@ -435407,6 +435621,7 @@ sub_80E51D4: @ 80E51D4 thumb_func_end sub_80E51D4 thumb_func_start PrintMoneyAmountInMoneyBox +@ void PrintMoneyAmountInMoneyBox(u8 windowId, int amount, s8 a3) PrintMoneyAmountInMoneyBox: @ 80E51F4 push {lr} sub sp, 0x4 @@ -435425,6 +435640,7 @@ PrintMoneyAmountInMoneyBox: @ 80E51F4 thumb_func_end PrintMoneyAmountInMoneyBox thumb_func_start PrintMoneyAmount +@ void PrintMoneyAmount(u8 windowId, char x, char y, int amount, u8 a5) PrintMoneyAmount: @ 80E5214 push {r4-r7,lr} mov r7, r8 @@ -435489,6 +435705,7 @@ _080E5264: thumb_func_end PrintMoneyAmount thumb_func_start set_window_border_style_and_print_money_box +@ void set_window_border_style_and_print_money_box(u8 windowId, u16 tileStart, u8 palette, int amount) set_window_border_style_and_print_money_box: @ 80E5298 push {r4-r6,lr} mov r6, r8 @@ -435534,6 +435751,7 @@ sub_80E52D4: @ 80E52D4 thumb_func_end sub_80E52D4 thumb_func_start sub_80E52EC +@ void sub_80E52EC(int money, int x, int y) sub_80E52EC: @ 80E52EC push {r4-r6,lr} mov r6, r8 @@ -468261,7 +468479,7 @@ _080F69DE: lsls r2, 1 adds r0, r3, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy adds r0, r4, 0 adds r0, 0xA lsls r0, 28 @@ -468298,7 +468516,7 @@ _080F6A40: lsls r2, 1 adds r0, r3, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy _080F6A54: add sp, 0x10 pop {r3} @@ -468412,7 +468630,7 @@ sub_80F6AE8: @ 80F6AE8 adds r1, r2 movs r2, 0x80 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill ldr r0, =0x0858d8c8 movs r1, 0x8 movs r2, 0x8 @@ -473295,6 +473513,7 @@ _080F922C: thumb_func_end sp000_heal_pokemon thumb_func_start sub_80F9244 +@ void sub_80F9244(s16 species_num, u8 level, int held_item) sub_80F9244: @ 80F9244 push {r4-r6,lr} mov r6, r8 @@ -478514,6 +478733,7 @@ _080FBBF2: thumb_func_end sub_80FBB64 thumb_func_start overworld_free_bgmaps +@ void overworld_free_bgmaps() overworld_free_bgmaps: @ 80FBC00 push {lr} ldr r0, =0x08591d58 @@ -481368,6 +481588,7 @@ sub_80FD278: @ 80FD278 thumb_func_end sub_80FD278 thumb_func_start item_field_func_bike +@ void item_field_func_bike(int task_id) item_field_func_bike: @ 80FD298 push {r4-r6,lr} sub sp, 0x4 @@ -537410,6 +537631,7 @@ _08119148: thumb_func_end sub_8119094 thumb_func_start dp04_initiate_movement +@ void dp04_initiate_movement(int dpad_direction, int buttons_new, int buttons_held) dp04_initiate_movement: @ 8119164 push {r4,lr} lsls r0, 24 @@ -537728,6 +537950,7 @@ _081193BE: thumb_func_end npc_state_reaction_to_tile thumb_func_start sub_81193C8 +@ void sub_81193C8(int dpad_direction, int buttons_new, int buttons_held) sub_81193C8: @ 81193C8 push {r4,lr} sub sp, 0x4 @@ -538825,6 +539048,7 @@ _08119C36: thumb_func_end sub_8119BC4 thumb_func_start sub_8119C3C +@ void sub_8119C3C(int buttons_new, int buttons_held) sub_8119C3C: @ 8119C3C push {lr} lsls r0, 16 @@ -538848,6 +539072,7 @@ _08119C5A: thumb_func_end sub_8119C3C thumb_func_start sub_8119C64 +@ void sub_8119C64(int buttons_new, int buttons_held) sub_8119C64: @ 8119C64 push {r4,r5,lr} lsls r1, 16 @@ -552117,7 +552342,7 @@ sub_8120084: @ 8120084 adds r0, r2 movs r2, 0x80 movs r3, 0x10 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy pop {r0} bx r0 .align 2, 0 @@ -557781,6 +558006,7 @@ _08122CB6: thumb_func_end sub_8122C94 thumb_func_start sub_8122CBC +@ warpdata *sub_8122CBC(int a1) sub_8122CBC: @ 8122CBC push {lr} cmp r0, 0 @@ -561063,7 +561289,7 @@ _081245A6: adds r0, r5, 0 movs r1, 0 adds r2, r4, 0 - bl sub_80090FC + bl RepeatChar b _081245D6 _081245B2: cmp r4, 0 @@ -561323,7 +561549,7 @@ _0812479C: adds r0, r1 movs r1, 0 movs r2, 0x10 - bl sub_80090FC + bl RepeatChar ldr r1, =0x03001180 movs r0, 0x1 str r0, [r1] @@ -606655,6 +606881,7 @@ sub_813B1D0: @ 813B1D0 thumb_func_end sub_813B1D0 thumb_func_start set_unknown_box_id +@ void set_unknown_box_id(char id) set_unknown_box_id: @ 813B204 ldr r1, =0x0203ab6f strb r0, [r1] @@ -610963,7 +611190,7 @@ _0813D4A8: adds r0, r1 movs r1, 0 movs r2, 0x10 - bl sub_80090FC + bl RepeatChar b _0813D584 .align 2, 0 .pool @@ -703414,6 +703641,7 @@ _0816CC66: thumb_func_end sub_816CC54 thumb_func_start load_copyright_graphics +@ void load_copyright_graphics(u16 tile_patterns_dest, u16 tilemap_dest, u16 unknown_dest) load_copyright_graphics: @ 816CC70 push {r4-r6,lr} adds r3, r0, 0 @@ -703699,6 +703927,7 @@ c2_show_copyright_and_intro_again_2: @ 816CF0C thumb_func_end c2_show_copyright_and_intro_again_2 thumb_func_start task_intro_1 +@ void task_intro_1(int task_id) task_intro_1: @ 816CF18 push {r4-r6,lr} mov r6, r8 @@ -704458,6 +704687,7 @@ _0816D598: thumb_func_end task_intro_7 thumb_func_start task_intro_8 +@ void task_intro_8(int task_id) task_intro_8: @ 816D650 push {r4-r7,lr} sub sp, 0x4 @@ -707643,6 +707873,7 @@ _0816F0B2: thumb_func_end sub_816EEA8 thumb_func_start intro_reset_and_hide_bgs +@ void intro_reset_and_hide_bgs() intro_reset_and_hide_bgs: @ 816F0C0 push {lr} movs r0, 0 @@ -715238,7 +715469,7 @@ _08172E4E: lsls r2, 4 movs r0, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill ldrb r0, [r4] bl sub_805E974 adds r0, r5, 0 @@ -765758,6 +765989,7 @@ _0818CFD4: thumb_func_end dp13_810BB8C thumb_func_start load_pokemon_image_TODO +@ int load_pokemon_image_TODO(int species_num, unsigned int a2, u8 a3, void *a4, int a5, u8 a6) load_pokemon_image_TODO: @ 818CFF4 push {r4-r7,lr} sub sp, 0x4 @@ -786226,6 +786458,7 @@ sub_8197804: @ 8197804 thumb_func_end sub_8197804 thumb_func_start SetStandardWindowBorderStyle +@ void SetStandardWindowBorderStyle(u8 windowId, bool copyToVram) SetStandardWindowBorderStyle: @ 8197854 push {lr} lsls r0, 24 @@ -787045,6 +787278,7 @@ sub_8197E30: @ 8197E30 thumb_func_end sub_8197E30 thumb_func_start SetWindowBorderStyle +@ void SetWindowBorderStyle(u8 windowId, bool copyToVram, s16 tileStart, s8 palette) SetWindowBorderStyle: @ 8197E80 push {r4,r5,lr} adds r4, r1, 0 @@ -787787,6 +788021,7 @@ sub_81983EC: @ 81983EC thumb_func_end sub_81983EC thumb_func_start RedrawMenuCursor +@ void RedrawMenuCursor(s8 oldPos, s8 newPos) RedrawMenuCursor: @ 8198448 push {r4-r6,lr} mov r6, r9 @@ -787857,6 +788092,7 @@ RedrawMenuCursor: @ 8198448 thumb_func_end RedrawMenuCursor thumb_func_start MoveMenuCursor +@ s8 MoveMenuCursor(s8 cursorDelta) MoveMenuCursor: @ 81984D8 push {r4,r5,lr} ldr r1, =0x0203cd90 @@ -787896,6 +788132,7 @@ _0819850A: thumb_func_end MoveMenuCursor thumb_func_start MoveMenuCursorNoWrapAround +@ s8 MoveMenuCursorNoWrapAround(s8 cursorDelta) MoveMenuCursorNoWrapAround: @ 819851C push {r4,r5,lr} ldr r1, =0x0203cd90 @@ -788002,6 +788239,7 @@ _081985D2: thumb_func_end ProcessMenuInput thumb_func_start ProcessMenuInputNoWrapAround +@ int ProcessMenuInputNoWrapAround() ProcessMenuInputNoWrapAround: @ 81985D8 push {r4-r6,lr} ldr r4, =0x0203cd90 @@ -788570,6 +788808,7 @@ sub_81989B8: @ 81989B8 thumb_func_end sub_81989B8 thumb_func_start rbox_template_set +@ void rbox_template_set(rbox_template *template, char bg_id, char x, char y, char w, char h, char a7, s16 a8) rbox_template_set: @ 8198A24 push {r4-r7,lr} mov r7, r8 @@ -790020,6 +790259,7 @@ _0819951E: thumb_func_end sub_8199484 thumb_func_start InitMenuInUpperLeftCorner +@ int InitMenuInUpperLeftCorner(s8 windowId, s8 numItems, u8 initialCursorPos, bool doNotPlaySoundWhenAPressed) InitMenuInUpperLeftCorner: @ 8199524 push {r4-r6,lr} lsls r1, 24 @@ -790616,6 +790856,7 @@ _08199992: thumb_func_end sub_8199944 thumb_func_start clear_scheduled_bg_copies_to_vram +@ void clear_scheduled_bg_copies_to_vram() clear_scheduled_bg_copies_to_vram: @ 81999A8 push {lr} ldr r0, =0x0203cda4 @@ -790629,6 +790870,7 @@ clear_scheduled_bg_copies_to_vram: @ 81999A8 thumb_func_end clear_scheduled_bg_copies_to_vram thumb_func_start schedule_bg_copy_tilemap_to_vram +@ void schedule_bg_copy_tilemap_to_vram(u8 bg_id) schedule_bg_copy_tilemap_to_vram: @ 81999BC lsls r0, 24 lsrs r0, 24 @@ -790642,6 +790884,7 @@ schedule_bg_copy_tilemap_to_vram: @ 81999BC thumb_func_end schedule_bg_copy_tilemap_to_vram thumb_func_start do_scheduled_bg_tilemap_copies_to_vram +@ void do_scheduled_bg_tilemap_copies_to_vram() do_scheduled_bg_tilemap_copies_to_vram: @ 81999D0 push {r4,lr} ldr r4, =0x0203cda4 @@ -790685,6 +790928,7 @@ _08199A14: thumb_func_end do_scheduled_bg_tilemap_copies_to_vram thumb_func_start reset_temp_tile_data_buffers +@ void reset_temp_tile_data_buffers() reset_temp_tile_data_buffers: @ 8199A20 push {lr} ldr r3, =0x0203cda8 @@ -790749,6 +790993,7 @@ _08199A8A: thumb_func_end free_temp_tile_data_buffers_if_possible thumb_func_start decompress_and_copy_tile_data_to_vram +@ int decompress_and_copy_tile_data_to_vram(u8 bg_id, int src, int size, u16 offset, u8 mode) decompress_and_copy_tile_data_to_vram: @ 8199A90 push {r4-r7,lr} mov r7, r9 @@ -790813,6 +791058,7 @@ _08199AFA: thumb_func_end decompress_and_copy_tile_data_to_vram thumb_func_start copy_decompressed_tile_data_to_vram_autofree +@ void copy_decompressed_tile_data_to_vram_autofree(u8 bg_id, int src, u16 size, u16 offset, u8 mode) copy_decompressed_tile_data_to_vram_autofree: @ 8199B08 push {r4-r7,lr} mov r7, r9 @@ -790875,6 +791121,7 @@ _08199B6E: thumb_func_end copy_decompressed_tile_data_to_vram_autofree thumb_func_start task_free_buf_after_copying_tile_data_to_vram +@ void task_free_buf_after_copying_tile_data_to_vram(int task_id) task_free_buf_after_copying_tile_data_to_vram: @ 8199B84 push {r4,lr} lsls r0, 24 @@ -790886,7 +791133,7 @@ task_free_buf_after_copying_tile_data_to_vram: @ 8199B84 adds r0, r1 movs r1, 0x8 ldrsh r0, [r0, r1] - bl dma3_transfer_queue_check_for_space + bl CheckForSpaceForDma3Request lsls r0, 16 cmp r0, 0 bne _08199BB4 @@ -790905,6 +791152,7 @@ _08199BB4: thumb_func_end task_free_buf_after_copying_tile_data_to_vram thumb_func_start malloc_and_decompress +@ void *malloc_and_decompress(void *src, int *size) malloc_and_decompress: @ 8199BC0 push {r4,r5,lr} adds r5, r0, 0 @@ -790932,6 +791180,7 @@ _08199BE8: thumb_func_end malloc_and_decompress thumb_func_start copy_decompressed_tile_data_to_vram +@ s16 copy_decompressed_tile_data_to_vram(u8 bg_id, int src, u16 size, u16 offset, u8 mode) copy_decompressed_tile_data_to_vram: @ 8199BF0 push {r4,lr} adds r4, r1, 0 @@ -791257,7 +791506,7 @@ _08199E16: lsrs r2, 16 adds r1, r4, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_fill + bl RequestDma3Fill pop {r3,r4} mov r8, r3 mov r9, r4 @@ -824301,6 +824550,7 @@ sub_81AAB70: @ 81AAB70 thumb_func_end sub_81AAB70 thumb_func_start c2_bag +@ void c2_bag() c2_bag: @ 81AAB9C push {lr} ldr r2, =sub_8086194 + 1 @@ -825088,6 +825338,7 @@ allocate_bag_item_list_buffers: @ 81AB218 thumb_func_end allocate_bag_item_list_buffers thumb_func_start load_bag_item_list_buffers +@ void load_bag_item_list_buffers(int pocket_id) load_bag_item_list_buffers: @ 81AB240 push {r4-r7,lr} mov r7, r8 @@ -825243,6 +825494,7 @@ _081AB34A: thumb_func_end load_bag_item_list_buffers thumb_func_start get_name +@ void get_name(char *dest, int name_id) get_name: @ 81AB39C push {r4-r6,lr} adds r6, r0, 0 @@ -825413,6 +825665,7 @@ _081AB50C: thumb_func_end sub_81AB450 thumb_func_start sub_81AB520 +@ void sub_81AB520(u8 rbox_id, int item_index_in_pocket, int a3) sub_81AB520: @ 81AB520 push {r4-r7,lr} mov r7, r9 @@ -825590,6 +825843,7 @@ _081AB696: thumb_func_end sub_81AB520 thumb_func_start bag_menu_print_description_box_text +@ void bag_menu_print_description_box_text(int a1) bag_menu_print_description_box_text: @ 81AB6B0 push {r4,lr} sub sp, 0x14 @@ -827006,6 +827260,7 @@ sub_81AC23C: @ 81AC23C thumb_func_end sub_81AC23C thumb_func_start bag_menu_draw_pocket_indicator_square +@ void bag_menu_draw_pocket_indicator_square(char x, int is_current_bag) bag_menu_draw_pocket_indicator_square: @ 81AC26C push {lr} sub sp, 0x8 @@ -829196,6 +829451,7 @@ _081AD5D2: thumb_func_end sub_81AD520 thumb_func_start display_sell_item_ask_str +@ void display_sell_item_ask_str(int a1) display_sell_item_ask_str: @ 81AD5DC push {r4-r7,lr} lsls r0, 24 @@ -854181,6 +854437,7 @@ _081BA220: thumb_func_end sub_81BA040 thumb_func_start fbox6_func +@ int fbox6_func(struct TextBox *x) fbox6_func: @ 81BA250 push {r4-r6,lr} adds r6, r0, 0 @@ -880387,7 +880644,7 @@ sub_81C7E58: @ 81C7E58 adds r0, r4, 0 adds r2, r5, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy movs r0, 0x2 bl gpu_tile_obj_tag_get_range_start ldr r3, [r7, 0x20] @@ -880470,7 +880727,7 @@ sub_81C7F24: @ 81C7F24 adds r0, r4, 0 adds r2, r5, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy _081C7F8A: pop {r4-r6} pop {r0} @@ -889468,7 +889725,7 @@ sub_81CC39C: @ 81CC39C lsls r2, 4 adds r0, r5, 0 movs r3, 0x1 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -889530,7 +889787,7 @@ sub_81CC440: @ 81CC440 _081CC452: movs r1, 0x3C ldrsh r0, [r4, r1] - bl dma3_transfer_queue_check_for_space + bl CheckForSpaceForDma3Request lsls r0, 16 asrs r0, 16 movs r1, 0x1 diff --git a/asm/gpu_bg.s b/asm/gpu_bg.s index 16416062a..b59d3368c 100644 --- a/asm/gpu_bg.s +++ b/asm/gpu_bg.s @@ -1,4 +1,5 @@ thumb_func_start gpu_init_bgs +@ void gpu_init_bgs() gpu_init_bgs: @ 80012F0 push {lr} bl gpu_reset_bg_configs @@ -13,6 +14,7 @@ gpu_init_bgs: @ 80012F0 thumb_func_end gpu_init_bgs thumb_func_start gpu_set_bg_mode +@ void gpu_set_bg_mode(u8 bg_mode) gpu_set_bg_mode: @ 8001308 lsls r0, 24 lsrs r0, 24 @@ -28,6 +30,7 @@ gpu_set_bg_mode: @ 8001308 thumb_func_end gpu_set_bg_mode thumb_func_start gpu_get_bg_mode +@ u8 gpu_get_bg_mode() gpu_get_bg_mode: @ 8001324 ldr r0, =0x030008e0 ldrb r1, [r0, 0x10] @@ -39,6 +42,7 @@ gpu_get_bg_mode: @ 8001324 thumb_func_end gpu_get_bg_mode thumb_func_start gpu_reset_bg_configs +@ void gpu_reset_bg_configs() gpu_reset_bg_configs: @ 8001334 push {lr} ldr r2, =0x030008e0 @@ -82,6 +86,7 @@ _08001372: thumb_func_end sub_8001354 thumb_func_start gpu_bg_config_set_fields +@ void gpu_bg_config_set_fields(u8 bg_id, u8 character_base_block, u8 screen_base_block, u8 screen_size, u8 palette_size_select, u8 priority, u8 mosaic, u8 wraparound) gpu_bg_config_set_fields: @ 8001380 push {r4-r7,lr} mov r7, r10 @@ -243,6 +248,7 @@ _08001498: thumb_func_end gpu_bg_config_set_fields thumb_func_start gpu_bg_config_get_field +@ int gpu_bg_config_get_field(u8 bg_id, u8 field_id) gpu_bg_config_get_field: @ 80014AC push {r4,r5,lr} lsls r0, 24 @@ -337,6 +343,7 @@ _0800155A: thumb_func_end gpu_bg_config_get_field thumb_func_start gpu_copy_to_vram_by_bg_id +@ s8 gpu_copy_to_vram_by_bg_id(u8 bg_id, int src, u16 byte_count, u16 dest_offset, gpu_copy_to_vram_type type) gpu_copy_to_vram_by_bg_id: @ 8001560 push {r4-r7,lr} mov r7, r8 @@ -391,7 +398,7 @@ _080015B4: mov r0, r8 adds r2, r7, 0 movs r3, 0 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy lsls r0, 24 lsrs r2, r0, 24 asrs r0, 24 @@ -413,6 +420,7 @@ _080015DE: thumb_func_end gpu_copy_to_vram_by_bg_id thumb_func_start gpu_bg_show +@ void gpu_bg_show(u8 bg_id) gpu_bg_show: @ 80015E8 push {r4,r5,lr} lsls r0, 24 @@ -476,6 +484,7 @@ _08001656: thumb_func_end gpu_bg_show thumb_func_start gpu_bg_hide +@ void gpu_bg_hide(u8 bg_id) gpu_bg_hide: @ 8001664 push {r4,lr} lsls r0, 24 @@ -504,6 +513,7 @@ _0800168A: thumb_func_end gpu_bg_hide thumb_func_start gpu_sync_bg_visibility_and_mode +@ void gpu_sync_bg_visibility_and_mode() gpu_sync_bg_visibility_and_mode: @ 8001698 push {lr} movs r0, 0 @@ -522,6 +532,7 @@ gpu_sync_bg_visibility_and_mode: @ 8001698 thumb_func_end gpu_sync_bg_visibility_and_mode thumb_func_start gpu_sync_text_mode_and_hide_bgs +@ void gpu_sync_text_mode_and_hide_bgs() gpu_sync_text_mode_and_hide_bgs: @ 80016BC push {lr} movs r0, 0 @@ -537,6 +548,7 @@ gpu_sync_text_mode_and_hide_bgs: @ 80016BC thumb_func_end gpu_sync_text_mode_and_hide_bgs thumb_func_start gpu_bg_affine_set +@ void gpu_bg_affine_set(u8 bg_id, int bg_center_x, int bg_center_y, u16 display_center_x, s16 display_center_y, s16 scale_x, s16 scale_y, s16 rotation_angle) gpu_bg_affine_set: @ 80016D8 push {r4-r7,lr} mov r7, r8 @@ -635,6 +647,7 @@ _08001796: thumb_func_end gpu_bg_affine_set thumb_func_start is_invalid_bg_id +@ _BOOL1 is_invalid_bg_id(u8 bg_id) is_invalid_bg_id: @ 80017A4 push {lr} lsls r0, 24 @@ -651,12 +664,14 @@ _080017B4: thumb_func_end is_invalid_bg_id thumb_func_start do_nothing +@ int do_nothing() do_nothing: @ 80017B8 movs r0, 0 bx lr thumb_func_end do_nothing thumb_func_start gpu_reset_bgs_and_dma3_busy_flags +@ void gpu_reset_bgs_and_dma3_busy_flags(int a1) gpu_reset_bgs_and_dma3_busy_flags: @ 80017BC push {r4,lr} adds r4, r0, 0 @@ -680,6 +695,7 @@ _080017CC: thumb_func_end gpu_reset_bgs_and_dma3_busy_flags thumb_func_start bg_vram_setup +@ void bg_vram_setup(u8 bg_mode, struct bg_config3 *bg_config3s, u8 entry_count) bg_vram_setup: @ 80017E8 push {r4-r7,lr} mov r7, r10 @@ -780,6 +796,7 @@ _08001894: thumb_func_end bg_vram_setup thumb_func_start bg_init_bg_config_2_from_bg_config_3 +@ void bg_init_bg_config_2_from_bg_config_3(struct bg_config_3 *bg) bg_init_bg_config_2_from_bg_config_3: @ 80018B0 push {r4-r7,lr} sub sp, 0x10 @@ -846,6 +863,7 @@ _08001920: thumb_func_end bg_init_bg_config_2_from_bg_config_3 thumb_func_start call_gpu_set_bg_mode +@ void call_gpu_set_bg_mode(u8 bg_id) call_gpu_set_bg_mode: @ 8001934 push {lr} lsls r0, 24 @@ -856,6 +874,7 @@ call_gpu_set_bg_mode: @ 8001934 thumb_func_end call_gpu_set_bg_mode thumb_func_start gpu_copy_bg_tile_pattern_data_to_vram +@ s16 gpu_copy_bg_tile_pattern_data_to_vram(u8 bg_id, int src, u16 size, u16 offset) gpu_copy_bg_tile_pattern_data_to_vram: @ 8001944 push {r4-r7,lr} mov r7, r8 @@ -1022,7 +1041,7 @@ unused_copy_palette: @ 8001A4C adds r0, r7, 0 adds r2, r6, 0 movs r3, 0 - bl dma3_transfer_queue_add_copy + bl RequestDma3Copy lsls r3, r0, 24 asrs r1, r3, 24 movs r0, 0x1 @@ -1063,6 +1082,7 @@ _08001AC8: thumb_func_end unused_copy_palette thumb_func_start is_dma3_queue_busy_with_gpu_copy +@ int is_dma3_queue_busy_with_gpu_copy() is_dma3_queue_busy_with_gpu_copy: @ 8001AD4 push {r4-r7,lr} movs r5, 0 @@ -1091,7 +1111,7 @@ _08001AE4: beq _08001B22 lsls r0, r5, 16 asrs r0, 16 - bl dma3_transfer_queue_check_for_space + bl CheckForSpaceForDma3Request lsls r0, 24 asrs r0, 24 cmp r0, r7 @@ -1116,6 +1136,7 @@ _08001B2A: thumb_func_end is_dma3_queue_busy_with_gpu_copy thumb_func_start gpu_sync_bg_show +@ void gpu_sync_bg_show(u8 bg_id) gpu_sync_bg_show: @ 8001B30 push {lr} lsls r0, 24 @@ -1127,6 +1148,7 @@ gpu_sync_bg_show: @ 8001B30 thumb_func_end gpu_sync_bg_show thumb_func_start gpu_sync_bg_hide +@ void gpu_sync_bg_hide(u8 bg_id) gpu_sync_bg_hide: @ 8001B44 push {lr} lsls r0, 24 @@ -1138,6 +1160,7 @@ gpu_sync_bg_hide: @ 8001B44 thumb_func_end gpu_sync_bg_hide thumb_func_start gpu_bg_config_set_field +@ int gpu_bg_config_set_field(u8 bg_id, bg_config_get_field field_id, u8 value) gpu_bg_config_set_field: @ 8001B58 push {r4,lr} sub sp, 0x10 @@ -1356,6 +1379,7 @@ _08001CFA: thumb_func_end bg_get_field thumb_func_start bg_change_x_offset +@ int bg_change_x_offset(u8 bg_id, int offset, u8 operation) bg_change_x_offset: @ 8001D04 push {r4-r6,lr} adds r6, r1, 0 @@ -1518,6 +1542,7 @@ _08001E34: thumb_func_end bg_change_x_offset thumb_func_start bg_get_x_offset +@ int bg_get_x_offset(u8 bg_id) bg_get_x_offset: @ 8001E40 push {r4,lr} lsls r0, 24 @@ -1550,6 +1575,7 @@ _08001E74: thumb_func_end bg_get_x_offset thumb_func_start bg_change_y_offset +@ int bg_change_y_offset(u8 bg_id, int offset, u8 operation) bg_change_y_offset: @ 8001E7C push {r4-r6,lr} adds r6, r1, 0 @@ -1712,6 +1738,7 @@ _08001FAC: thumb_func_end bg_change_y_offset thumb_func_start bg_change_y_offset_to_copy_queue +@ int bg_change_y_offset_to_copy_queue(u8 bg_id, int a2, u8 a3) bg_change_y_offset_to_copy_queue: @ 8001FB8 push {r4-r6,lr} adds r6, r1, 0 @@ -1874,6 +1901,7 @@ _080020E8: thumb_func_end bg_change_y_offset_to_copy_queue thumb_func_start bg_get_y_offset +@ int bg_get_y_offset(u8 bg_id) bg_get_y_offset: @ 80020F4 push {r4,lr} lsls r0, 24 @@ -1906,6 +1934,7 @@ _08002128: thumb_func_end bg_get_y_offset thumb_func_start call_gpu_bg_affine_set +@ void call_gpu_bg_affine_set(u8 a1, int a2, int a3, u16 a4, s16 a5, s16 a6, s16 a7, s16 a8) call_gpu_bg_affine_set: @ 8002130 push {r4-r7,lr} mov r7, r8 @@ -2063,6 +2092,7 @@ _08002226: thumb_func_end mosaic_something thumb_func_start bg_set_tilemap +@ void bg_set_tilemap(u8 bg_id, int tilemap) bg_set_tilemap: @ 8002250 push {r4,r5,lr} adds r5, r1, 0 @@ -2092,6 +2122,7 @@ _0800227A: thumb_func_end bg_set_tilemap thumb_func_start bg_unset_tilemap +@ void bg_unset_tilemap(u8 bg_id) bg_unset_tilemap: @ 8002284 push {r4,r5,lr} lsls r0, 24 @@ -2121,6 +2152,7 @@ _080022AE: thumb_func_end bg_unset_tilemap thumb_func_start bg_get_tilemap +@ int bg_get_tilemap(u8 bg_id) bg_get_tilemap: @ 80022B8 push {r4,lr} lsls r0, 24 @@ -2152,6 +2184,7 @@ _080022EA: thumb_func_end bg_get_tilemap thumb_func_start gpu_copy_to_wram_bg_tile_map +@ void gpu_copy_to_wram_bg_tile_map(u8 bg_id, void *src, int mode, int dest_offset) gpu_copy_to_wram_bg_tile_map: @ 80022F0 push {r4-r7,lr} mov r7, r10 @@ -2215,6 +2248,7 @@ _08002358: thumb_func_end gpu_copy_to_wram_bg_tile_map thumb_func_start gpu_copy_wram_bg_tilemap_to_vram +@ void gpu_copy_wram_bg_tilemap_to_vram(int bg_id) gpu_copy_wram_bg_tilemap_to_vram: @ 800236C push {r4,lr} sub sp, 0x4 @@ -2270,6 +2304,7 @@ _080023C8: thumb_func_end gpu_copy_wram_bg_tilemap_to_vram thumb_func_start gpu_copy_to_iwram_tile_map_rect +@ void gpu_copy_to_iwram_tile_map_rect(u8 bg_id, int first_tile_num, u8 tilemap_x, u8 tilemap_y, u8 width_in_tiles, u8 height_in_tiles) gpu_copy_to_iwram_tile_map_rect: @ 80023D4 push {r4-r7,lr} mov r7, r10 @@ -2408,6 +2443,7 @@ _080024C4: thumb_func_end gpu_copy_to_iwram_tile_map_rect thumb_func_start bg_copy_tilemap_rect_simple +@ void bg_copy_tilemap_rect_simple(u8 bg_id, void *src, u8 dest_x, u8 dest_y, u8 w, u8 h, u8 a7) bg_copy_tilemap_rect_simple: @ 80024D8 push {r4-r6,lr} sub sp, 0x24 @@ -2445,6 +2481,7 @@ bg_copy_tilemap_rect_simple: @ 80024D8 thumb_func_end bg_copy_tilemap_rect_simple thumb_func_start bg_copy_tilemap_rect +@ void bg_copy_tilemap_rect(u8 bg_id, void *src, u8 src_x, u8 src_y, u8 src_w, int src_h, u8 dest_x, u8 dest_y, u8 dest_w, u8 dest_h, u8 a11, int tile_num_delta, s16 a13) bg_copy_tilemap_rect: @ 800251C push {r4-r7,lr} mov r7, r10 @@ -2694,6 +2731,7 @@ _080026EE: thumb_func_end bg_copy_tilemap_rect thumb_func_start bg_fill_tilemap_rect +@ void bg_fill_tilemap_rect(u8 bg_id, s16 tile, u8 x, u8 y, u8 w, u8 h) bg_fill_tilemap_rect: @ 8002704 push {r4-r7,lr} mov r7, r10 @@ -2830,6 +2868,7 @@ _080027F0: thumb_func_end bg_fill_tilemap_rect thumb_func_start Bg_FillWramTileMapRectWithTileAndPalette +@ void Bg_FillWramTileMapRectWithTileAndPalette(u8 bg_id, s16 tile_num, u8 tilemap_x, u8 tilemap_y, u8 width_in_tiles, u8 height_in_tiles, u8 palette) Bg_FillWramTileMapRectWithTileAndPalette: @ 8002804 push {r4-r6,lr} sub sp, 0x10 @@ -2863,6 +2902,7 @@ Bg_FillWramTileMapRectWithTileAndPalette: @ 8002804 thumb_func_end Bg_FillWramTileMapRectWithTileAndPalette thumb_func_start bg_write_sequence_to_wram_tile_map_rect +@ void bg_write_sequence_to_wram_tile_map_rect(u8 bg_id, s16 first_tile_num, u8 tilemap_x, u8 tilemap_y, u8 width_in_tiles, u8 height_in_tiles, u8 palette, u16 tile_num_inc_amount) bg_write_sequence_to_wram_tile_map_rect: @ 8002840 push {r4-r7,lr} mov r7, r10 @@ -3078,6 +3118,7 @@ _080029D4: thumb_func_end bg_write_sequence_to_wram_tile_map_rect thumb_func_start bg_get_screen_size_in_regular_mode +@ int bg_get_screen_size_in_regular_mode(u8 bg_id, int mode) bg_get_screen_size_in_regular_mode: @ 80029EC push {r4,r5,lr} lsls r0, 24 @@ -3147,6 +3188,7 @@ _08002A54: thumb_func_end bg_get_screen_size_in_regular_mode thumb_func_start bg_get_screen_size_in_affine_mode +@ int bg_get_screen_size_in_affine_mode(u8 bg_id, u8 a2) bg_get_screen_size_in_affine_mode: @ 8002A5C push {r4,lr} lsls r0, 24 @@ -3202,6 +3244,7 @@ _08002AAE: thumb_func_end bg_get_screen_size_in_affine_mode thumb_func_start bg_get_index_from_tile_coords +@ int bg_get_index_from_tile_coords(int tilemap_x, int tilemap_y, int screen_size, int tilemap_w, int tilemap_h) bg_get_index_from_tile_coords: @ 8002AB4 push {r4,lr} adds r4, r0, 0 @@ -3235,6 +3278,7 @@ _08002AE0: thumb_func_end bg_get_index_from_tile_coords thumb_func_start bg_copy_tilemap_entry_not_rotscale_mode +@ void bg_copy_tilemap_entry_not_rotscale_mode(u16 *tile_src, u16 *tile_dest, signed int palette, s16 a4, int a5) bg_copy_tilemap_entry_not_rotscale_mode: @ 8002AEC push {r4-r6,lr} adds r4, r0, 0 @@ -3288,6 +3332,7 @@ _08002B3C: thumb_func_end bg_copy_tilemap_entry_not_rotscale_mode thumb_func_start bg_get_type_by_bg_id +@ u16 bg_get_type_by_bg_id(u8 bg_id) bg_get_type_by_bg_id: @ 8002B48 push {r4,r5,lr} lsls r0, 24 @@ -3339,6 +3384,7 @@ _08002B90: thumb_func_end bg_get_type_by_bg_id thumb_func_start is_invalid_bg_id_2 +@ int is_invalid_bg_id_2(u8 bg_id) is_invalid_bg_id_2: @ 8002B9C push {lr} lsls r0, 24 @@ -3355,6 +3401,7 @@ _08002BAC: thumb_func_end is_invalid_bg_id_2 thumb_func_start IsTileMapOutsideWram +@ bool IsTileMapOutsideWram(u8 bg_id) IsTileMapOutsideWram: @ 8002BB0 push {lr} lsls r0, 24 diff --git a/asm/gpu_obj.s b/asm/gpu_obj.s index eaa19f3cf..cb6ebbc30 100644 --- a/asm/gpu_obj.s +++ b/asm/gpu_obj.s @@ -28,6 +28,7 @@ reset_all_obj_data: @ 8006974 thumb_func_end reset_all_obj_data thumb_func_start call_obj_callbacks +@ void call_obj_callbacks() call_obj_callbacks: @ 80069C0 push {r4-r7,lr} movs r6, 0 @@ -69,6 +70,7 @@ _080069F6: thumb_func_end call_obj_callbacks thumb_func_start obj_sync_something +@ void obj_sync_something() obj_sync_something: @ 8006A0C push {r4,r5,lr} bl update_obj_oam_coords @@ -467,6 +469,7 @@ _08006D04: thumb_func_end determine_visible_sprites_maybe thumb_func_start copy_rotscale_coeffs_to_super_sprites +@ void copy_rotscale_coeffs_to_super_sprites() copy_rotscale_coeffs_to_super_sprites: @ 8006D1C push {r4-r6,lr} movs r4, 0 @@ -508,6 +511,7 @@ _08006D24: thumb_func_end copy_rotscale_coeffs_to_super_sprites thumb_func_start super_sprites_fill +@ void super_sprites_fill() super_sprites_fill: @ 8006D68 push {r4-r6,lr} sub sp, 0x4 @@ -577,6 +581,7 @@ _08006DD8: thumb_func_end super_sprites_fill thumb_func_start obj_add_from_template_forward_search +@ int obj_add_from_template_forward_search(struct objtemplate *template, s16 x, s16 y, u8 y_height_related) obj_add_from_template_forward_search: @ 8006DF4 push {r4-r7,lr} sub sp, 0x4 @@ -624,6 +629,7 @@ _08006E40: thumb_func_end obj_add_from_template_forward_search thumb_func_start obj_add_from_template_backward_search +@ int obj_add_from_template_backward_search(struct objtemplate *template, s16 x, s16 y, u8 y_height_related) obj_add_from_template_backward_search: @ 8006E48 push {r4-r7,lr} mov r7, r8 @@ -682,6 +688,7 @@ _08006EA6: thumb_func_end obj_add_from_template_backward_search thumb_func_start obj_add_empty_with_callback +@ int obj_add_empty_with_callback(void ( *func)()) obj_add_empty_with_callback: @ 8006EB4 push {r4-r6,lr} adds r6, r0, 0 @@ -720,6 +727,7 @@ _08006EF6: thumb_func_end obj_add_empty_with_callback thumb_func_start template_read +@ int template_read(u8 obj_id, struct objtemplate *a2, s16 x, s16 y, u8 y_height_related) template_read: @ 8006EFC push {r4-r7,lr} mov r7, r10 @@ -889,6 +897,7 @@ _08007040: thumb_func_end template_read thumb_func_start obj_add_from_template_call_callback_once +@ int obj_add_from_template_call_callback_once(struct objtemplate *template, s16 x, s16 y, u8 y_height_related) obj_add_from_template_call_callback_once: @ 8007054 push {r4-r7,lr} mov r7, r10 @@ -967,6 +976,7 @@ _080070D8: thumb_func_end obj_add_from_template_call_callback_once thumb_func_start obj_delete_and_free_tiles +@ void obj_delete_and_free_tiles(struct obj *obj) obj_delete_and_free_tiles: @ 80070E8 push {r4-r7,lr} adds r5, r0, 0 @@ -1024,6 +1034,7 @@ _08007144: thumb_func_end obj_delete_and_free_tiles thumb_func_start reset_super_sprites +@ void reset_super_sprites(u8 a1, u8 a2) reset_super_sprites: @ 8007150 push {r4-r6,lr} lsls r0, 24 @@ -1055,6 +1066,7 @@ _08007178: thumb_func_end reset_super_sprites thumb_func_start copy_super_sprites_to_oam +@ void copy_super_sprites_to_oam() copy_super_sprites_to_oam: @ 8007188 push {lr} ldr r2, =0x030022c0 @@ -1158,6 +1170,7 @@ rotscale_set_direct: @ 8007224 thumb_func_end rotscale_set_direct thumb_func_start obj_delete +@ void obj_delete(struct obj *obj) obj_delete: @ 8007244 push {lr} ldr r1, =0x082ec64c @@ -1208,6 +1221,7 @@ _08007286: thumb_func_end oam_center thumb_func_start gpu_tile_obj_alloc +@ int gpu_tile_obj_alloc(u16 tile_count) gpu_tile_obj_alloc: @ 800729C push {r4-r7,lr} mov r7, r9 @@ -1360,6 +1374,7 @@ _080073A4: thumb_func_end gpu_tile_obj_alloc thumb_func_start gpu_tile_obj_alloc_map_bit_op +@ unsigned int gpu_tile_obj_alloc_map_bit_op(int tile_id, bit_operation operation) gpu_tile_obj_alloc_map_bit_op: @ 80073B8 push {r4-r6,lr} lsls r0, 16 @@ -1427,6 +1442,7 @@ nullsub_12: @ 8007428 thumb_func_end nullsub_12 thumb_func_start copy_queue_process +@ void copy_queue_process() copy_queue_process: @ 800742C push {r4-r7,lr} ldr r0, =0x02021834 @@ -1524,6 +1540,7 @@ _080074D8: thumb_func_end copy_queue_add_oam_frame thumb_func_start copy_queue_add +@ void copy_queue_add(void *src, void *dest, u16 len) copy_queue_add: @ 80074EC push {r4-r6,lr} adds r4, r0, 0 @@ -1566,6 +1583,7 @@ _0800752C: thumb_func_end copy_queue_add thumb_func_start copy_all_from_objects +@ void copy_all_from_objects(void *dest) copy_all_from_objects: @ 800753C push {r4,lr} adds r1, r0, 0 @@ -1588,6 +1606,7 @@ _08007546: thumb_func_end copy_all_from_objects thumb_func_start copy_all_to_objects +@ void copy_all_to_objects(void *src) copy_all_to_objects: @ 8007564 push {r4,lr} adds r1, r0, 0 @@ -1610,6 +1629,7 @@ _0800756E: thumb_func_end copy_all_to_objects thumb_func_start obj_delete_all +@ void obj_delete_all() obj_delete_all: @ 800758C push {r4,r5,lr} movs r4, 0 @@ -1641,6 +1661,7 @@ _08007590: thumb_func_end obj_delete_all thumb_func_start obj_free_tiles +@ void obj_free_tiles(struct obj *obj) obj_free_tiles: @ 80075C8 push {lr} ldr r2, [r0, 0x14] @@ -1658,6 +1679,7 @@ _080075DA: thumb_func_end obj_free_tiles thumb_func_start obj_free_pal +@ void obj_free_pal(struct obj *obj) obj_free_pal: @ 80075E4 push {lr} ldr r0, [r0, 0x14] @@ -1668,6 +1690,7 @@ obj_free_pal: @ 80075E4 thumb_func_end obj_free_pal thumb_func_start obj_free_rotscale_entry +@ void obj_free_rotscale_entry(struct obj *obj) obj_free_rotscale_entry: @ 80075F4 push {r4,lr} adds r4, r0, 0 @@ -1694,6 +1717,7 @@ _0800761A: thumb_func_end obj_free_rotscale_entry thumb_func_start obj_delete_and_free_resources +@ void obj_delete_and_free_resources(struct obj *obj) obj_delete_and_free_resources: @ 8007620 push {r4,lr} adds r4, r0, 0 @@ -1710,6 +1734,7 @@ obj_delete_and_free_resources: @ 8007620 thumb_func_end obj_delete_and_free_resources thumb_func_start obj_anim_step +@ void obj_anim_step(struct obj *obj) obj_anim_step: @ 8007640 push {r4,r5,lr} adds r4, r0, 0 @@ -1745,6 +1770,7 @@ _08007676: thumb_func_end obj_anim_step thumb_func_start obj_anim_image_begin +@ void obj_anim_image_begin(struct obj *obj) obj_anim_image_begin: @ 8007688 push {r4-r7,lr} mov r7, r9 @@ -1868,6 +1894,7 @@ _0800776C: thumb_func_end obj_anim_image_begin thumb_func_start obj_anim_image_continue +@ void obj_anim_image_continue(struct obj *obj) obj_anim_image_continue: @ 8007778 push {r4,lr} adds r4, r0, 0 @@ -1952,6 +1979,7 @@ _0800780E: thumb_func_end obj_anim_image_continue thumb_func_start anim_image_3 +@ void anim_image_3(struct obj *obj) anim_image_3: @ 8007818 push {r4-r7,lr} mov r7, r8 @@ -2042,6 +2070,7 @@ _080078BA: thumb_func_end anim_image_3 thumb_func_start anim_image_2 +@ void anim_image_2(struct obj *obj) anim_image_2: @ 80078C4 adds r2, r0, 0 adds r2, 0x2B @@ -2057,6 +2086,7 @@ anim_image_2: @ 80078C4 thumb_func_end anim_image_2 thumb_func_start anim_image_1 +@ void anim_image_1(struct obj *obj) anim_image_1: @ 80078DC push {r4-r7,lr} mov r7, r8 @@ -2160,6 +2190,7 @@ _0800799A: thumb_func_end anim_image_1 thumb_func_start anim_image_0 +@ void anim_image_0(struct obj *obj) anim_image_0: @ 80079A4 push {lr} adds r1, r0, 0 @@ -2179,6 +2210,7 @@ _080079BE: thumb_func_end anim_image_0 thumb_func_start sub_80079C4 +@ void sub_80079C4(struct obj *obj) sub_80079C4: @ 80079C4 push {r4,lr} adds r4, r0, 0 @@ -2209,6 +2241,7 @@ sub_80079C4: @ 80079C4 thumb_func_end sub_80079C4 thumb_func_start sub_80079FC +@ void sub_80079FC(struct obj *obj) sub_80079FC: @ 80079FC push {r4,lr} adds r4, r0, 0 @@ -2227,6 +2260,7 @@ sub_80079FC: @ 80079FC thumb_func_end sub_80079FC thumb_func_start obj_anim_rewind_to_cmd00 +@ void obj_anim_rewind_to_cmd00(struct obj *obj) obj_anim_rewind_to_cmd00: @ 8007A1C push {r4-r7,lr} mov r12, r0 @@ -2726,6 +2760,7 @@ anim_rotscale_3: @ 8007DA0 thumb_func_end anim_rotscale_3 thumb_func_start rotscale_set_indirect +@ void rotscale_set_indirect(u8 rotscale_entry_index, s16 rotscale_data[]) rotscale_set_indirect: @ 8007DD8 lsls r0, 24 ldr r2, =0x02021bc0 @@ -2745,6 +2780,7 @@ rotscale_set_indirect: @ 8007DD8 thumb_func_end rotscale_set_indirect thumb_func_start obj_get_rotscale_entry_index +@ int obj_get_rotscale_entry_index(struct obj *obj) obj_get_rotscale_entry_index: @ 8007DF8 push {lr} adds r2, r0, 0 @@ -2766,6 +2802,7 @@ _08007E12: thumb_func_end obj_get_rotscale_entry_index thumb_func_start sub_8007E18 +@ void sub_8007E18(struct obj *obj, s16 a2, s16 a3) sub_8007E18: @ 8007E18 strh r1, [r0, 0x3A] strh r2, [r0, 0x3C] @@ -2778,6 +2815,7 @@ sub_8007E18: @ 8007E18 thumb_func_end sub_8007E18 thumb_func_start sub_8007E28 +@ int sub_8007E28(int a1, int a2, int a3) sub_8007E28: @ 8007E28 push {r4,r5,lr} adds r3, r0, 0 @@ -2804,6 +2842,7 @@ _08007E3E: thumb_func_end sub_8007E28 thumb_func_start obj_update_pos2 +@ void obj_update_pos2(struct obj *obj, int a2, int a3) obj_update_pos2: @ 8007E54 push {r4-r7,lr} mov r7, r9 @@ -2881,6 +2920,7 @@ _08007EDA: thumb_func_end obj_update_pos2 thumb_func_start obj_set_horizonal_and_vertical_flip +@ void obj_set_horizonal_and_vertical_flip(struct obj *obj, u8 a2, char a3) obj_set_horizonal_and_vertical_flip: @ 8007EF0 push {r4-r6,lr} mov r6, r8 @@ -2942,6 +2982,7 @@ obj_set_horizonal_and_vertical_flip: @ 8007EF0 thumb_func_end obj_set_horizonal_and_vertical_flip thumb_func_start rotscale_reset_half +@ void rotscale_reset_half(u8 index) rotscale_reset_half: @ 8007F64 lsls r0, 24 lsrs r0, 24 @@ -2960,6 +3001,7 @@ rotscale_reset_half: @ 8007F64 thumb_func_end rotscale_reset_half thumb_func_start rotscale_reset_full_1 +@ void rotscale_reset_full_1(u8 index) rotscale_reset_full_1: @ 8007F80 lsls r0, 24 lsrs r0, 24 @@ -2984,6 +3026,7 @@ rotscale_reset_full_1: @ 8007F80 thumb_func_end rotscale_reset_full_1 thumb_func_start rotscale_reset_full_2 +@ void rotscale_reset_full_2(u8 index) rotscale_reset_full_2: @ 8007FA8 lsls r0, 24 lsrs r0, 24 @@ -3008,6 +3051,7 @@ rotscale_reset_full_2: @ 8007FA8 thumb_func_end rotscale_reset_full_2 thumb_func_start rotscale_frame_apply_absolute +@ void rotscale_frame_apply_absolute(u8 index, int a2) rotscale_frame_apply_absolute: @ 8007FD0 lsls r0, 24 lsrs r0, 24 @@ -3083,6 +3127,7 @@ _08008040: thumb_func_end obj_anim_rotscale_delay_progress thumb_func_start rotscale_frame_apply_relative_and_sync +@ void rotscale_frame_apply_relative_and_sync(u8 index, int a2) rotscale_frame_apply_relative_and_sync: @ 800804C push {r4-r6,lr} sub sp, 0x10 @@ -3152,6 +3197,7 @@ rotscale_frame_apply_relative_and_sync: @ 800804C thumb_func_end rotscale_frame_apply_relative_and_sync thumb_func_start divide_0x10000_by +@ int divide_0x10000_by(int n) divide_0x10000_by: @ 80080E4 push {lr} adds r1, r0, 0 @@ -3167,6 +3213,7 @@ divide_0x10000_by: @ 80080E4 thumb_func_end divide_0x10000_by thumb_func_start rotscale_load_frame +@ void rotscale_load_frame(u8 index, int a2, int a3) rotscale_load_frame: @ 80080FC push {r4,lr} lsls r0, 24 @@ -3514,6 +3561,7 @@ _08008370: thumb_func_end sub_8008324 thumb_func_start rotscale_reset_all +@ void rotscale_reset_all() rotscale_reset_all: @ 800837C push {r4,lr} ldr r1, =0x02021cc0 @@ -3540,6 +3588,7 @@ _08008390: thumb_func_end rotscale_reset_all thumb_func_start rotscale_alloc_entry +@ u8 rotscale_alloc_entry() rotscale_alloc_entry: @ 80083B0 push {r4,lr} movs r2, 0 @@ -3574,6 +3623,7 @@ _080083E2: thumb_func_end rotscale_alloc_entry thumb_func_start rotscale_free_entry +@ void rotscale_free_entry(u8 rotscale_index) rotscale_free_entry: @ 80083E8 push {lr} sub sp, 0x4 @@ -3610,6 +3660,7 @@ _08008406: thumb_func_end rotscale_free_entry thumb_func_start obj_alloc_rotscale_entry +@ void obj_alloc_rotscale_entry(struct obj *obj) obj_alloc_rotscale_entry: @ 8008428 push {r4,r5,lr} adds r4, r0, 0 @@ -3713,6 +3764,7 @@ sub_8008478: @ 8008478 thumb_func_end sub_8008478 thumb_func_start gpu_tile_obj_alloc_tag_and_copy_to_vram +@ int gpu_tile_obj_alloc_tag_and_copy_to_vram(struct rom_obj_tile_data *x) gpu_tile_obj_alloc_tag_and_copy_to_vram: @ 80084F8 push {r4-r6,lr} adds r5, r0, 0 @@ -3749,6 +3801,7 @@ _08008536: thumb_func_end gpu_tile_obj_alloc_tag_and_copy_to_vram thumb_func_start gpu_tile_obj_alloc_and_load_multiple +@ void gpu_tile_obj_alloc_and_load_multiple(struct rom_obj_tile_data[]) gpu_tile_obj_alloc_and_load_multiple: @ 800853C push {r4,r5,lr} adds r5, r0, 0 @@ -3775,6 +3828,7 @@ _08008560: thumb_func_end gpu_tile_obj_alloc_and_load_multiple thumb_func_start gpu_tile_obj_free_by_tag +@ void gpu_tile_obj_free_by_tag(int tag) gpu_tile_obj_free_by_tag: @ 8008568 push {r4-r7,lr} mov r7, r8 @@ -3835,6 +3889,7 @@ _080085C6: thumb_func_end gpu_tile_obj_free_by_tag thumb_func_start gpu_tile_obj_tags_reset +@ void gpu_tile_obj_tags_reset() gpu_tile_obj_tags_reset: @ 80085E0 push {r4-r7,lr} movs r2, 0 @@ -3868,6 +3923,7 @@ _080085F0: thumb_func_end gpu_tile_obj_tags_reset thumb_func_start gpu_tile_obj_tag_get_range_start +@ int gpu_tile_obj_tag_get_range_start(int tag) gpu_tile_obj_tag_get_range_start: @ 8008620 push {lr} lsls r0, 16 @@ -3962,6 +4018,7 @@ _080086B8: thumb_func_end gpu_tile_obj_tag_get_by_range_start thumb_func_start gpu_tile_obj_tag_add +@ void gpu_tile_obj_tag_add(u16 tag, u16 start, u16 count) gpu_tile_obj_tag_add: @ 80086C4 push {r4-r6,lr} adds r4, r0, 0 @@ -4024,6 +4081,7 @@ _0800871C: thumb_func_end gpu_pal_allocator_reset thumb_func_start gpu_pal_obj_alloc_tag_and_apply +@ s8 gpu_pal_obj_alloc_tag_and_apply(struct rom_obj_pal_data *data) gpu_pal_obj_alloc_tag_and_apply: @ 8008744 push {r4,r5,lr} adds r5, r0, 0 @@ -4091,6 +4149,7 @@ _080087B6: thumb_func_end gpu_pal_obj_alloc_and_load_multiple thumb_func_start gpu_pal_obj_load +@ void gpu_pal_obj_load(palette *pal, u16 offset) gpu_pal_obj_load: @ 80087BC push {lr} lsls r1, 16 @@ -4105,6 +4164,7 @@ gpu_pal_obj_load: @ 80087BC thumb_func_end gpu_pal_obj_load thumb_func_start gpu_pal_alloc_new +@ int gpu_pal_alloc_new(u16 tag) gpu_pal_alloc_new: @ 80087D4 push {r4,lr} lsls r0, 16 @@ -4132,6 +4192,7 @@ _080087FE: thumb_func_end gpu_pal_alloc_new thumb_func_start gpu_pal_tags_index_of +@ int gpu_pal_tags_index_of(u16 a1) gpu_pal_tags_index_of: @ 8008804 push {lr} lsls r0, 16 @@ -4177,6 +4238,7 @@ gpu_pal_tag_by_index: @ 800883C thumb_func_end gpu_pal_tag_by_index thumb_func_start gpu_pal_free_tag +@ void gpu_pal_free_tag(int tag) gpu_pal_free_tag: @ 800884C push {lr} lsls r0, 16 @@ -4199,6 +4261,7 @@ _08008868: thumb_func_end gpu_pal_free_tag thumb_func_start obj_set_f18_to_r0_f42_to_40 +@ void obj_set_f18_to_r0_f42_to_40(struct obj *obj, int a2) obj_set_f18_to_r0_f42_to_40: @ 8008874 str r1, [r0, 0x18] adds r0, 0x42 @@ -4208,6 +4271,7 @@ obj_set_f18_to_r0_f42_to_40: @ 8008874 thumb_func_end obj_set_f18_to_r0_f42_to_40 thumb_func_start super_sprite_add +@ int super_sprite_add(struct obj *obj, u8 *index) super_sprite_add: @ 8008880 push {r4,lr} adds r4, r0, 0 @@ -4268,6 +4332,7 @@ _080088E0: thumb_func_end super_sprite_add thumb_func_start sub_80088EC +@ int sub_80088EC(struct obj *obj, int a2, int a3) sub_80088EC: @ 80088EC push {r4-r7,lr} mov r7, r10 diff --git a/asm/gpu_reg_manager.s b/asm/gpu_reg_manager.s index 13f4bc528..7cd842e53 100644 --- a/asm/gpu_reg_manager.s +++ b/asm/gpu_reg_manager.s @@ -1,4 +1,5 @@ thumb_func_start lcd_io_copy_queue_clean +@ void lcd_io_copy_queue_clean() lcd_io_copy_queue_clean: @ 8000FE4 push {r4-r7,lr} mov r7, r8 @@ -40,6 +41,7 @@ _08000FFE: thumb_func_end lcd_io_copy_queue_clean thumb_func_start lcd_io_buffer_to_hardware +@ void lcd_io_buffer_to_hardware(u8 reg) lcd_io_buffer_to_hardware: @ 800103C push {lr} lsls r0, 24 @@ -75,6 +77,7 @@ _08001076: thumb_func_end lcd_io_buffer_to_hardware thumb_func_start lcd_io_copy_queue_process +@ void lcd_io_copy_queue_process() lcd_io_copy_queue_process: @ 8001080 push {r4,r5,lr} ldr r0, =0x030008d8 @@ -103,6 +106,7 @@ _080010A4: thumb_func_end lcd_io_copy_queue_process thumb_func_start lcd_io_set +@ void lcd_io_set(u8 reg, u16 value) lcd_io_set: @ 80010B4 push {r4,r5,lr} lsls r0, 24 @@ -177,6 +181,7 @@ _08001130: thumb_func_end lcd_io_set thumb_func_start lcd_io_set_forced_blank +@ void lcd_io_set_forced_blank(u8 reg, u16 value) lcd_io_set_forced_blank: @ 8001140 push {r4,r5,lr} lsls r0, 24 @@ -241,6 +246,7 @@ _080011A8: thumb_func_end lcd_io_set_forced_blank thumb_func_start lcd_io_get +@ u16 lcd_io_get(u8 reg) lcd_io_get: @ 80011B8 push {lr} lsls r0, 24 @@ -273,6 +279,7 @@ _080011E0: thumb_func_end lcd_io_get thumb_func_start lcd_io_set_bits +@ void lcd_io_set_bits(u8 reg, u16 mask) lcd_io_set_bits: @ 80011E8 push {lr} adds r2, r1, 0 @@ -292,6 +299,7 @@ lcd_io_set_bits: @ 80011E8 thumb_func_end lcd_io_set_bits thumb_func_start lcd_io_clear_bits +@ void lcd_io_clear_bits(u8 reg, u16 mask) lcd_io_clear_bits: @ 8001208 push {lr} adds r2, r1, 0 @@ -311,6 +319,7 @@ lcd_io_clear_bits: @ 8001208 thumb_func_end lcd_io_clear_bits thumb_func_start update_hardware_IE +@ void update_hardware_IE() update_hardware_IE: @ 8001228 push {r4,r5,lr} ldr r5, =0x030008d9 @@ -336,6 +345,7 @@ _08001246: thumb_func_end update_hardware_IE thumb_func_start enable_irqs +@ void enable_irqs(u16 value) enable_irqs: @ 800125C push {r4,lr} lsls r0, 16 @@ -358,6 +368,7 @@ enable_irqs: @ 800125C thumb_func_end enable_irqs thumb_func_start disable_irqs +@ void disable_irqs(u16 value) disable_irqs: @ 8001288 push {r4,lr} lsls r0, 16 @@ -380,6 +391,7 @@ disable_irqs: @ 8001288 thumb_func_end disable_irqs thumb_func_start dispstat_set_vblank_hblank_irqs +@ void dispstat_set_vblank_hblank_irqs(u16 value) dispstat_set_vblank_hblank_irqs: @ 80012B4 push {r4,lr} adds r4, r0, 0 diff --git a/asm/libagbbackup.s b/asm/libagbbackup.s index 3104489b1..e09323ab6 100644 --- a/asm/libagbbackup.s +++ b/asm/libagbbackup.s @@ -20,6 +20,7 @@ _082E187C: .4byte 0x0e002aaa thumb_func_end SwitchFlashBank thumb_func_start ReadFlashID +@ u16 ReadFlashID() ReadFlashID: @ 82E1880 push {r4,r5,lr} sub sp, 0x44 @@ -95,6 +96,7 @@ _082E1908: thumb_func_end ReadFlashID thumb_func_start FlashTimerIntr +@ void FlashTimerIntr() FlashTimerIntr: @ 82E191C push {lr} ldr r1, _082E193C @@ -119,6 +121,7 @@ _082E1940: .4byte 0x03007840 thumb_func_end FlashTimerIntr thumb_func_start SetFlashTimerIntr +@ void SetFlashTimerIntr(u8 timer_id, void ( **irq_timer_func)()) SetFlashTimerIntr: @ 82E1944 push {lr} adds r2, r1, 0 @@ -263,12 +266,14 @@ _082E1A68: .4byte 0x03001a78 thumb_func_end StopFlashTimer thumb_func_start ReadFlash1 +@ u8 ReadFlash1(int address) ReadFlash1: @ 82E1A6C ldrb r0, [r0] bx lr thumb_func_end ReadFlash1 thumb_func_start SetReadFlash1 +@ void SetReadFlash1(u8 ( *target_func)(int address)) SetReadFlash1: @ 82E1A70 push {lr} adds r2, r0, 0 @@ -666,6 +671,7 @@ _082E1D58: .4byte 0x0300784c thumb_func_end ProgramFlashSectorsVerifyFirstNBytes thumb_func_start IdentifyFlash +@ _BOOL2 IdentifyFlash() IdentifyFlash: @ 82E1D5C push {r4,lr} ldr r2, _082E1D7C diff --git a/asm/libagbsyscall.s b/asm/libagbsyscall.s index 529e2dd92..668044ef7 100644 --- a/asm/libagbsyscall.s +++ b/asm/libagbsyscall.s @@ -5,18 +5,21 @@ ArcTan2: @ 82E7078 thumb_func_end ArcTan2 thumb_func_start BgAffineSet +@ void BgAffineSet(BgAffineSet_src_data *src, BgAffineSet_dest_data *dest, int entry_count) BgAffineSet: @ 82E707C swi 0xE bx lr thumb_func_end BgAffineSet thumb_func_start CpuFastSet +@ void CpuFastSet(void *src, void *dest, unsigned int mode) CpuFastSet: @ 82E7080 swi 0xC bx lr thumb_func_end CpuFastSet thumb_func_start CpuSet +@ void CpuSet(void *src, void *dest, unsigned int mode) CpuSet: @ 82E7084 swi 0xB bx lr @@ -29,12 +32,14 @@ Div: @ 82E7088 thumb_func_end Div thumb_func_start LZ77UnCompVram +@ void LZ77UnCompVram(void *src, void *dest) LZ77UnCompVram: @ 82E708C swi 0x12 bx lr thumb_func_end LZ77UnCompVram thumb_func_start LZ77UnCompWram +@ void LZ77UnCompWram(void *src, void *dest) LZ77UnCompWram: @ 82E7090 swi 0x11 bx lr @@ -67,12 +72,14 @@ RLUnCompWram: @ 82E70A4 thumb_func_end RLUnCompWram thumb_func_start RegisterRamReset +@ void RegisterRamReset(int ResetFlags) RegisterRamReset: @ 82E70A8 swi 0x1 bx lr thumb_func_end RegisterRamReset thumb_func_start SoftReset +@ void SoftReset() SoftReset: @ 82E70AC ldr r3, _082E70BC movs r2, 0 @@ -87,12 +94,14 @@ _082E70C0: .4byte 0x03007f00 thumb_func_end SoftReset thumb_func_start Sqrt +@ s16 Sqrt(int) Sqrt: @ 82E70C4 swi 0x8 bx lr thumb_func_end Sqrt thumb_func_start VBlankIntrWait +@ void VBlankIntrWait() VBlankIntrWait: @ 82E70C8 movs r2, 0 swi 0x5 diff --git a/asm/libgcc.s b/asm/libgcc.s index 44ebe86b9..35fcbfe2b 100644 --- a/asm/libgcc.s +++ b/asm/libgcc.s @@ -11,6 +11,7 @@ _call_via_r1: @ 82E70D4 thumb_func_end _call_via_r1 thumb_func_start _call_via_r2 +@ void __usercall_call_via_r2(void ( *func)()) _call_via_r2: @ 82E70D8 bx r2 mov r8, r8 @@ -29,6 +30,7 @@ _call_via_r4: @ 82E70E0 thumb_func_end _call_via_r4 thumb_func_start _call_via_r5 +@ void __usercall_call_via_r5(void ( *func)()) _call_via_r5: @ 82E70E4 bx r5 mov r8, r8 @@ -643,6 +645,7 @@ _082E753C: .4byte 0x0000ffff thumb_func_end __divdi3 thumb_func_start __divsi3 +@ int __divsi3(int dividend, int divisor) __divsi3: @ 82E7540 cmp r1, 0 beq _082E75C8 @@ -1484,6 +1487,7 @@ _082E7B64: .4byte 0x0000ffff thumb_func_end __udivdi3 thumb_func_start __udivsi3 +@ unsigned int __udivsi3(unsigned int dividend, unsigned int divisor) __udivsi3: @ 82E7B68 cmp r1, 0 beq _082E7BD6 @@ -1557,6 +1561,7 @@ _082E7BD6: thumb_func_end __udivsi3 thumb_func_start __umodsi3 +@ unsigned int __umodsi3(unsigned int dividend, unsigned int divisor) __umodsi3: @ 82E7BE0 cmp r1, 0 beq _082E7C96 @@ -2302,6 +2307,7 @@ _082E8128: .4byte 0x1fffffff thumb_func_end __fpadd_parts_d thumb_func_start __adddf3 +@ double __adddf3(double arg_a, double arg_b) __adddf3: @ 82E812C push {r4,lr} sub sp, 0x4C @@ -3242,6 +3248,7 @@ _082E87D0: thumb_func_end __gtdf2 thumb_func_start __gedf2 +@ int __gedf2(double arg_a, double arg_b) __gedf2: @ 82E87D4 push {r4,lr} sub sp, 0x38 @@ -3442,6 +3449,7 @@ _082E8930: .4byte 0x0fffffff thumb_func_end __floatsidf thumb_func_start __fixdfsi +@ int __fixdfsi(double arg_a) __fixdfsi: @ 82E8934 push {lr} sub sp, 0x1C @@ -5018,6 +5026,7 @@ _082E93CA: thumb_func_end __negdi2 thumb_func_start memcpy +@ void *memcpy(void *dest, void *src, int size) memcpy: @ 82E93D4 push {r4,r5,lr} adds r5, r0, 0 @@ -5075,6 +5084,7 @@ _082E942E: thumb_func_end memcpy thumb_func_start memset +@ void *memset(void *dest, char c, int size) memset: @ 82E9434 push {r4,r5,lr} adds r5, r0, 0 @@ -5125,6 +5135,7 @@ _082E947A: thumb_func_end memset thumb_func_start strcmp +@ int strcmp(char *s1, char *s2) strcmp: @ 82E9488 push {r4,r5,lr} adds r2, r0, 0 diff --git a/asm/libmks4agb.s b/asm/libmks4agb.s index 006f6da5c..49acba179 100644 --- a/asm/libmks4agb.s +++ b/asm/libmks4agb.s @@ -1959,6 +1959,7 @@ _082E004C: .4byte 0x7fffffff thumb_func_end MPlayContinue thumb_func_start MPlayFadeOut +@ void MPlayFadeOut(mplay_table_entry *a1, s16 a2) MPlayFadeOut: @ 82E0050 adds r2, r0, 0 lsls r1, 16 @@ -2310,6 +2311,7 @@ _082E02F4: .4byte 0x030073a0 thumb_func_end m4aMPlayAllContinue thumb_func_start m4aMPlayFadeOut +@ void m4aMPlayFadeOut(mplay_table_entry *a1, u16 a2) m4aMPlayFadeOut: @ 82E02F8 push {lr} lsls r1, 16 @@ -2406,6 +2408,7 @@ _082E0392: thumb_func_end m4aMPlayImmInit thumb_func_start MPlayExtender +@ int MPlayExtender(void *dest) MPlayExtender: @ 82E0398 push {r4-r6,lr} sub sp, 0x4 @@ -2561,6 +2564,7 @@ _082E04D8: .4byte 0x030074ec thumb_func_end Clear64byte_rev thumb_func_start SoundInit_rev01 +@ int SoundInit_rev01(void *dest) SoundInit_rev01: @ 82E04DC push {r4,r5,lr} sub sp, 0x4 diff --git a/asm/main.s b/asm/main.s index b16d392ab..d229d43e5 100644 --- a/asm/main.s +++ b/asm/main.s @@ -24,7 +24,7 @@ Main: bl flash_timeout_start_on_timer_2_when_flash_present bl init_saveblock_ptrs_and_set_copyright_callback2 bl sound_sources_off - bl dma3_transfer_queue_clear + bl ClearDma3Requests bl gpu_init_bgs bl fboxes_set_default_ptr ldr r0, =0x02000000 @@ -107,6 +107,7 @@ _080004B2: thumb_func_end Main thumb_func_start call_callbacks_wrapper +@ void call_callbacks_wrapper() call_callbacks_wrapper: @ 80004C4 push {lr} bl sub_800B40C @@ -120,6 +121,7 @@ _080004D4: thumb_func_end call_callbacks_wrapper thumb_func_start init_saveblock_ptrs_and_set_copyright_callback2 +@ void init_saveblock_ptrs_and_set_copyright_callback2() init_saveblock_ptrs_and_set_copyright_callback2: @ 80004D8 push {lr} ldr r2, =0x030022c0 @@ -144,6 +146,7 @@ init_saveblock_ptrs_and_set_copyright_callback2: @ 80004D8 thumb_func_end init_saveblock_ptrs_and_set_copyright_callback2 thumb_func_start call_callbacks +@ void call_callbacks() call_callbacks: @ 800051C push {r4,lr} ldr r4, =0x030022c0 @@ -165,6 +168,7 @@ _08000534: thumb_func_end call_callbacks thumb_func_start set_callback2 +@ void set_callback2(void ( *func)()) set_callback2: @ 8000540 ldr r1, =0x030022c0 str r0, [r1, 0x4] @@ -179,6 +183,7 @@ set_callback2: @ 8000540 thumb_func_end set_callback2 thumb_func_start start_timer1 +@ void start_timer1() start_timer1: @ 8000554 ldr r1, =0x04000106 movs r0, 0x80 @@ -189,6 +194,7 @@ start_timer1: @ 8000554 thumb_func_end start_timer1 thumb_func_start set_rand_seed_and_trainer_id_hi +@ void set_rand_seed_and_trainer_id_hi() set_rand_seed_and_trainer_id_hi: @ 8000560 push {r4,lr} ldr r0, =0x04000104 @@ -208,6 +214,7 @@ set_rand_seed_and_trainer_id_hi: @ 8000560 thumb_func_end set_rand_seed_and_trainer_id_hi thumb_func_start get_trainer_id_hi +@ u16 get_trainer_id_hi() get_trainer_id_hi: @ 8000588 ldr r0, =0x02020000 ldrh r0, [r0] @@ -217,6 +224,7 @@ get_trainer_id_hi: @ 8000588 thumb_func_end get_trainer_id_hi thumb_func_start lcd_enable_vcount_irq_at_150px +@ void lcd_enable_vcount_irq_at_150px() lcd_enable_vcount_irq_at_150px: @ 8000594 push {lr} movs r0, 0x4 @@ -238,6 +246,7 @@ lcd_enable_vcount_irq_at_150px: @ 8000594 thumb_func_end lcd_enable_vcount_irq_at_150px thumb_func_start init_keypad_data +@ void init_keypad_data() init_keypad_data: @ 80005BC ldr r1, =0x030026fc movs r0, 0x5 @@ -258,6 +267,7 @@ init_keypad_data: @ 80005BC thumb_func_end init_keypad_data thumb_func_start load_keys +@ void load_keys() load_keys: @ 80005E4 push {lr} ldr r0, =0x04000130 @@ -338,6 +348,7 @@ _08000676: thumb_func_end load_keys thumb_func_start init_irq_handler +@ void init_irq_handler() init_irq_handler: @ 8000684 push {r4,r5,lr} ldr r5, =InterruptMain @@ -378,6 +389,7 @@ _08000690: thumb_func_end init_irq_handler thumb_func_start SetVBlankCallback +@ void SetVBlankCallback(void ( *func)()) SetVBlankCallback: @ 80006F0 ldr r1, =0x030022c0 str r0, [r1, 0xC] @@ -387,6 +399,7 @@ SetVBlankCallback: @ 80006F0 thumb_func_end SetVBlankCallback thumb_func_start SetHBlankCallback +@ void SetHBlankCallback(void ( *func)()) SetHBlankCallback: @ 80006FC ldr r1, =0x030022c0 str r0, [r1, 0x10] @@ -405,6 +418,7 @@ SetVCountCallback: @ 8000708 thumb_func_end SetVCountCallback thumb_func_start restore_serial_timer3_irq_handlers +@ void restore_serial_timer3_irq_handlers() restore_serial_timer3_irq_handlers: @ 8000714 ldr r0, =0x03002710 ldr r1, =irq_serial + 1 @@ -417,6 +431,7 @@ restore_serial_timer3_irq_handlers: @ 8000714 thumb_func_end restore_serial_timer3_irq_handlers thumb_func_start set_serial_callback +@ void set_serial_callback(void ( *func)()) set_serial_callback: @ 800072C ldr r1, =0x030022c0 str r0, [r1, 0x18] @@ -426,6 +441,7 @@ set_serial_callback: @ 800072C thumb_func_end set_serial_callback thumb_func_start irq_vblank +@ void irq_vblank() irq_vblank: @ 8000738 push {r4,lr} ldr r0, =0x030030fc @@ -469,7 +485,7 @@ _08000782: adds r0, 0x1 str r0, [r4, 0x24] bl lcd_io_copy_queue_process - bl dma_transfer_queue_process + bl ProcessDma3Requests ldr r1, =0x03002f50 ldr r0, =0x03006380 ldrb r0, [r0, 0x4] @@ -511,6 +527,7 @@ _080007BE: thumb_func_end irq_vblank thumb_func_start flash_timeout_start_on_timer_2 +@ void flash_timeout_start_on_timer_2() flash_timeout_start_on_timer_2: @ 8000800 push {lr} ldr r1, =0x0300272c @@ -523,6 +540,7 @@ flash_timeout_start_on_timer_2: @ 8000800 thumb_func_end flash_timeout_start_on_timer_2 thumb_func_start irq_hblank +@ void irq_hblank() irq_hblank: @ 8000814 push {r4,lr} ldr r4, =0x030022c0 @@ -548,6 +566,7 @@ _08000822: thumb_func_end irq_hblank thumb_func_start irq_vcount +@ void irq_vcount() irq_vcount: @ 8000844 push {r4,lr} ldr r4, =0x030022c0 @@ -574,6 +593,7 @@ _08000852: thumb_func_end irq_vcount thumb_func_start irq_serial +@ void irq_serial() irq_serial: @ 8000878 push {r4,lr} ldr r4, =0x030022c0 @@ -599,11 +619,13 @@ _08000886: thumb_func_end irq_serial thumb_func_start irq_other +@ void irq_other() irq_other: @ 80008A8 bx lr thumb_func_end irq_other thumb_func_start wait_for_vblank +@ void wait_for_vblank() wait_for_vblank: @ 80008AC push {lr} ldr r2, =0x030022c0 @@ -651,6 +673,7 @@ sub_80008E8: @ 80008E8 thumb_func_end sub_80008E8 thumb_func_start do_reset +@ void do_reset() do_reset: @ 80008F4 push {r4,lr} ldr r1, =0x04000208 diff --git a/asm/malloc.s b/asm/malloc.s index ceedc291b..511f979a1 100644 --- a/asm/malloc.s +++ b/asm/malloc.s @@ -1,4 +1,5 @@ thumb_func_start malloc_header +@ void malloc_header(struct memblk *blk, struct memblk *prev, struct memblk *next, u32 size) malloc_header: @ 8000988 push {r4,lr} movs r4, 0 @@ -16,6 +17,7 @@ malloc_header: @ 8000988 thumb_func_end malloc_header thumb_func_start malloc_unlinked_header +@ void malloc_unlinked_header(struct memblk *blk, u32 size) malloc_unlinked_header: @ 80009A4 push {lr} adds r2, r0, 0 @@ -28,6 +30,7 @@ malloc_unlinked_header: @ 80009A4 thumb_func_end malloc_unlinked_header thumb_func_start malloc_core +@ void *malloc_core(struct memblk *head, u32 size) malloc_core: @ 80009B8 push {r4-r6,lr} adds r4, r0, 0 @@ -89,6 +92,7 @@ _08000A18: thumb_func_end malloc_core thumb_func_start free_core +@ void free_core(struct memblk *head, struct memblk *node) free_core: @ 8000A20 push {r4,r5,lr} cmp r1, 0 @@ -145,6 +149,7 @@ _08000A7C: thumb_func_end free_core thumb_func_start malloc_core_and_clear +@ void *malloc_core_and_clear(struct memblk *head, unsigned int size) malloc_core_and_clear: @ 8000A84 push {r4,r5,lr} sub sp, 0x4 @@ -180,6 +185,7 @@ _08000AB8: thumb_func_end malloc_core_and_clear thumb_func_start check_memblk_core +@ _BOOL4 check_memblk_core(struct memblk *head, struct memblk *node) check_memblk_core: @ 8000AC4 push {r4,r5,lr} adds r5, r0, 0 @@ -232,6 +238,7 @@ _08000B16: thumb_func_end check_memblk_core thumb_func_start init_malloc +@ void init_malloc(u32 heapStart, u32 heapSize) init_malloc: @ 8000B1C push {lr} ldr r2, =0x03000004 @@ -246,6 +253,7 @@ init_malloc: @ 8000B1C thumb_func_end init_malloc thumb_func_start malloc +@ void *malloc(u32 size) malloc: @ 8000B38 push {lr} adds r1, r0, 0 @@ -259,6 +267,7 @@ malloc: @ 8000B38 thumb_func_end malloc thumb_func_start malloc_and_clear +@ void *malloc_and_clear(u32 size) malloc_and_clear: @ 8000B4C push {lr} adds r1, r0, 0 @@ -272,6 +281,7 @@ malloc_and_clear: @ 8000B4C thumb_func_end malloc_and_clear thumb_func_start free +@ void free(void *ptr) free: @ 8000B60 push {lr} adds r1, r0, 0 @@ -285,6 +295,7 @@ free: @ 8000B60 thumb_func_end free thumb_func_start check_memblk +@ _BOOL4 check_memblk(struct memblk *node) check_memblk: @ 8000B74 push {lr} adds r1, r0, 0 @@ -298,6 +309,7 @@ check_memblk: @ 8000B74 thumb_func_end check_memblk thumb_func_start check_all_memblks +@ _BOOL4 check_all_memblks() check_all_memblks: @ 8000B88 push {r4,r5,lr} ldr r0, =0x03000004 diff --git a/asm/pixel_buffer.s b/asm/pixel_buffer.s index e45102453..65ac15099 100644 --- a/asm/pixel_buffer.s +++ b/asm/pixel_buffer.s @@ -36,6 +36,7 @@ sub_8002BDC: @ 8002BDC thumb_func_end sub_8002BDC thumb_func_start PixelBlock_CopyRect4Bpp +@ void PixelBlock_CopyRect4Bpp(struct PixelBlock *src_pixels_data, struct PixelBlock *dest_pixels_data, u16 src_x, u16 src_y, u16 dest_x, u16 dest_y, u16 dest_w, u16 dest_h, u8 a9) PixelBlock_CopyRect4Bpp: @ 8002C20 push {r4-r7,lr} mov r7, r10 @@ -290,6 +291,7 @@ _08002DEE: thumb_func_end PixelBlock_CopyRect4Bpp thumb_func_start PixelBlock_FillRect4Bpp +@ int PixelBlock_FillRect4Bpp(struct PixelBlock *pixels_data, u16 x, u16 y, u16 w, u16 h, u8 fill_value) PixelBlock_FillRect4Bpp: @ 8002E00 push {r4-r7,lr} mov r7, r10 @@ -401,6 +403,7 @@ _08002EB6: thumb_func_end PixelBlock_FillRect4Bpp thumb_func_start PixelBlock_CopyRect4BppTo8Bpp +@ void PixelBlock_CopyRect4BppTo8Bpp(struct PixelBlock *src_pixels_data, struct PixelBlock *dest_pixels_data, u16 src_x, u16 src_y, u16 dest_x, u16 dest_y, u16 dest_w, u16 dest_h, int a9, int a10) PixelBlock_CopyRect4BppTo8Bpp: @ 8002EC8 push {r4-r7,lr} mov r7, r10 @@ -717,6 +720,7 @@ _08003106: thumb_func_end PixelBlock_CopyRect4BppTo8Bpp thumb_func_start PixelBlock_FillRect8Bpp +@ void PixelBlock_FillRect8Bpp(struct PixelBlock *pixels_data, u16 x, u16 y, u16 w, u16 h, char fill_value) PixelBlock_FillRect8Bpp: @ 8003118 push {r4-r7,lr} mov r7, r10 diff --git a/asm/task.s b/asm/task.s index a5cdeac41..f1e605d0b 100644 --- a/asm/task.s +++ b/asm/task.s @@ -1,4 +1,5 @@ thumb_func_start clear_tasks +@ void clear_tasks() clear_tasks: @ 80A8F50 push {r4-r7,lr} movs r4, 0 @@ -46,6 +47,7 @@ _080A8F5A: thumb_func_end clear_tasks thumb_func_start AddTask +@ int AddTask(void ( *func)(int task_id), u8 priority) AddTask: @ 80A8FB0 push {r4-r7,lr} adds r2, r0, 0 @@ -91,6 +93,7 @@ _080A8FFC: thumb_func_end AddTask thumb_func_start insert_task_in_order_by_priority +@ void insert_task_in_order_by_priority(int task_id) insert_task_in_order_by_priority: @ 80A9004 push {r4-r7,lr} mov r7, r8 @@ -174,6 +177,7 @@ _080A9090: thumb_func_end insert_task_in_order_by_priority thumb_func_start remove_task +@ void remove_task(int task_id) remove_task: @ 80A909C push {r4,lr} lsls r0, 24 @@ -237,6 +241,7 @@ _080A9106: thumb_func_end remove_task thumb_func_start run_active_tasks +@ void run_active_tasks() run_active_tasks: @ 80A910C push {r4,r5,lr} bl get_first_active_task @@ -264,6 +269,7 @@ _080A9130: thumb_func_end run_active_tasks thumb_func_start get_first_active_task +@ int get_first_active_task() get_first_active_task: @ 80A913C push {lr} movs r2, 0 @@ -363,6 +369,7 @@ set_task_function_to_args_14_15: @ 80A91B0 thumb_func_end set_task_function_to_args_14_15 thumb_func_start is_function_an_active_task +@ int is_function_an_active_task(void ( *func)(int task_id)) is_function_an_active_task: @ 80A91E4 push {r4,lr} adds r3, r0, 0 @@ -397,6 +404,7 @@ _080A9214: thumb_func_end is_function_an_active_task thumb_func_start get_task_id_by_function +@ int get_task_id_by_function(void ( *func)(int task_id)) get_task_id_by_function: @ 80A921C push {lr} adds r3, r0, 0 diff --git a/asm/text_renderer.s b/asm/text_renderer.s index 6bde7bf78..9266acf39 100644 --- a/asm/text_renderer.s +++ b/asm/text_renderer.s @@ -1,4 +1,5 @@ thumb_func_start fboxes_set_ptr +@ void fboxes_set_ptr(struct fbox *ptr) fboxes_set_ptr: @ 80045A4 ldr r1, =0x03002f80 str r0, [r1] @@ -8,6 +9,7 @@ fboxes_set_ptr: @ 80045A4 thumb_func_end fboxes_set_ptr thumb_func_start TextBox_ResetSomeField +@ void TextBox_ResetSomeField() TextBox_ResetSomeField: @ 80045B0 push {lr} ldr r1, =0x020201b0 @@ -26,6 +28,7 @@ _080045BA: thumb_func_end TextBox_ResetSomeField thumb_func_start Print +@ int Print(u8 windowId, u8 fontId, int char_cursor, char x, char y, u8 a6, int a7) Print: @ 80045D0 push {r4-r7,lr} mov r7, r8 @@ -115,6 +118,7 @@ Print: @ 80045D0 thumb_func_end Print thumb_func_start remo_copy +@ int remo_copy(struct TextBox *x, u8 text_speed, int a3) remo_copy: @ 800467C push {r4-r7,lr} adds r6, r0, 0 @@ -241,6 +245,7 @@ _08004766: thumb_func_end remo_copy thumb_func_start run_remoboxes +@ void run_remoboxes() run_remoboxes: @ 8004778 push {r4-r7,lr} mov r7, r8 @@ -328,6 +333,7 @@ a_pressed_maybe: @ 8004800 thumb_func_end a_pressed_maybe thumb_func_start fbox_exec +@ int fbox_exec(struct TextBox *x) fbox_exec: @ 8004818 push {r4,lr} adds r4, r0, 0 @@ -841,6 +847,7 @@ restore_remo_colors: @ 8004C00 thumb_func_end restore_remo_colors thumb_func_start font_render_sub +@ void font_render_sub(u16 *src, u32 *dest) font_render_sub: @ 8004C10 push {r4-r7,lr} mov r7, r8 @@ -1048,6 +1055,7 @@ _08004D9A: thumb_func_end sub_8004D58 thumb_func_start CopyGlyphToWindow +@ int CopyGlyphToWindow(struct TextBox *x) CopyGlyphToWindow: @ 8004DA0 push {r4-r7,lr} mov r7, r10 @@ -1754,6 +1762,7 @@ _080052AA: thumb_func_end CopyGlyphToWindow thumb_func_start Text_ClearHorizontalSpan +@ void Text_ClearHorizontalSpan(TextBox *textBox, int width) Text_ClearHorizontalSpan: @ 80052C8 push {r4-r6,lr} sub sp, 0x10 @@ -1807,6 +1816,7 @@ _0800531E: thumb_func_end Text_ClearHorizontalSpan thumb_func_start fbox0_func +@ int fbox0_func(struct TextBox *x) fbox0_func: @ 800533C push {lr} adds r2, r0, 0 @@ -1836,6 +1846,7 @@ _08005360: thumb_func_end fbox0_func thumb_func_start fbox1_func +@ int fbox1_func(struct TextBox *x) fbox1_func: @ 8005370 push {lr} adds r2, r0, 0 @@ -1867,6 +1878,7 @@ _08005398: thumb_func_end fbox1_func thumb_func_start fbox2_func +@ int fbox2_func(struct TextBox *x) fbox2_func: @ 80053A8 push {lr} adds r2, r0, 0 @@ -1898,6 +1910,7 @@ _080053D0: thumb_func_end fbox2_func thumb_func_start fbox3_func +@ int fbox3_func(struct TextBox *x) fbox3_func: @ 80053E0 push {lr} adds r2, r0, 0 @@ -1929,6 +1942,7 @@ _08005408: thumb_func_end fbox3_func thumb_func_start fbox4_func +@ int fbox4_func(struct TextBox *x) fbox4_func: @ 8005418 push {lr} adds r2, r0, 0 @@ -1960,6 +1974,7 @@ _08005440: thumb_func_end fbox4_func thumb_func_start fbox5_func +@ int fbox5_func(struct TextBox *x) fbox5_func: @ 8005450 push {lr} adds r2, r0, 0 @@ -1991,6 +2006,7 @@ _08005478: thumb_func_end fbox5_func thumb_func_start fbox7_func +@ int fbox7_func(struct TextBox *x) fbox7_func: @ 8005488 push {lr} adds r2, r0, 0 @@ -2022,6 +2038,7 @@ _080054B0: thumb_func_end fbox7_func thumb_func_start fbox8_func +@ int fbox8_func(struct TextBox *x) fbox8_func: @ 80054C0 push {lr} adds r2, r0, 0 @@ -2053,6 +2070,7 @@ _080054E8: thumb_func_end fbox8_func thumb_func_start sub_80054F8 +@ void sub_80054F8(TextBox *textBox) sub_80054F8: @ 80054F8 push {lr} adds r2, r0, 0 @@ -2083,6 +2101,7 @@ _08005524: thumb_func_end sub_80054F8 thumb_func_start remo_draw_bouncing_down_arrow +@ int remo_draw_bouncing_down_arrow(TextBox *x) remo_draw_bouncing_down_arrow: @ 8005528 push {r4-r7,lr} sub sp, 0x18 @@ -2193,6 +2212,7 @@ _080055EE: thumb_func_end remo_draw_bouncing_down_arrow thumb_func_start remo_clear_down_arrow +@ int remo_clear_down_arrow(TextBox *x) remo_clear_down_arrow: @ 8005600 push {r4,r5,lr} sub sp, 0x8 @@ -2220,6 +2240,7 @@ remo_clear_down_arrow: @ 8005600 thumb_func_end remo_clear_down_arrow thumb_func_start remo_is_it_time_to_continue_autopilot +@ int remo_is_it_time_to_continue_autopilot(struct TextBox *x) remo_is_it_time_to_continue_autopilot: @ 8005634 push {lr} adds r1, r0, 0 @@ -2422,6 +2443,7 @@ _0800579A: thumb_func_end draw_bouncing_down_arrow_2 thumb_func_start font_render_b +@ int font_render_b(struct TextBox *x) font_render_b: @ 80057B4 push {r4-r6,lr} adds r6, r0, 0 @@ -3334,6 +3356,7 @@ _08005ED0: thumb_func_end font_get_get_width_func thumb_func_start font_get_width_of_string +@ unsigned int font_get_width_of_string(u8 a1, u8 *s, u16 a3) font_get_width_of_string: @ 8005ED8 push {r4-r7,lr} mov r7, r10 @@ -3651,6 +3674,7 @@ _0800612E: thumb_func_end font_get_width_of_string thumb_func_start font_render_some +@ int font_render_some(char *pixels, u8 font, int a3) font_render_some: @ 8006140 push {r4-r7,lr} mov r7, r10 @@ -4284,6 +4308,7 @@ _08006642: thumb_func_end get_font_width_black_en thumb_func_start Text_DecompressGlyphFont8 +@ void Text_DecompressGlyphFont8(u16 glyphIndex, bool japanese) Text_DecompressGlyphFont8: @ 8006648 push {r4,r5,lr} lsls r0, 16 @@ -4522,6 +4547,7 @@ _08006832: thumb_func_end get_font_width_unk thumb_func_start Text_DecompressGlyphFont1 +@ void Text_DecompressGlyphFont1(int a1, int japanese) Text_DecompressGlyphFont1: @ 8006840 push {r4-r6,lr} lsls r0, 16 diff --git a/asm/window.s b/asm/window.s index 867a95f21..5b3bfc6f3 100644 --- a/asm/window.s +++ b/asm/window.s @@ -4,6 +4,7 @@ nullsub_8: @ 80031BC thumb_func_end nullsub_8 thumb_func_start Window_InitFromTemplates +@ int Window_InitFromTemplates(struct rbox_template *template) Window_InitFromTemplates: @ 80031C0 push {r4-r7,lr} mov r7, r10 @@ -219,6 +220,7 @@ _08003364: thumb_func_end Window_InitFromTemplates thumb_func_start Window_AddFromTemplate +@ int Window_AddFromTemplate(struct rbox_template *template) Window_AddFromTemplate: @ 8003380 push {r4-r7,lr} mov r7, r10 @@ -386,6 +388,7 @@ _080034C0: thumb_func_end Window_AddFromTemplate thumb_func_start Window_AddFromTemplateWithoutAllocatingMemory +@ int Window_AddFromTemplateWithoutAllocatingMemory(struct rbox_template *template) Window_AddFromTemplateWithoutAllocatingMemory: @ 80034D8 push {r4-r6,lr} adds r5, r0, 0 @@ -467,6 +470,7 @@ _08003564: thumb_func_end Window_AddFromTemplateWithoutAllocatingMemory thumb_func_start Window_Remove +@ int Window_Remove(int rbox_id) Window_Remove: @ 8003574 push {r4-r7,lr} lsls r0, 24 @@ -533,6 +537,7 @@ _080035E8: thumb_func_end Window_Remove thumb_func_start Window_FreeMemory +@ void Window_FreeMemory() Window_FreeMemory: @ 8003604 push {r4-r6,lr} ldr r4, =0x03002f70 @@ -577,6 +582,7 @@ _0800363E: thumb_func_end Window_FreeMemory thumb_func_start Window_CopyToVram +@ void Window_CopyToVram(u8 rbox_id, u8 mode) Window_CopyToVram: @ 8003658 push {r4-r6,lr} sub sp, 0xC @@ -645,6 +651,7 @@ _080036CE: thumb_func_end Window_CopyToVram thumb_func_start Window_CopyRectToVram +@ void Window_CopyRectToVram(int rbox_id, int mode, int x, int y, int w, int h) Window_CopyRectToVram: @ 80036D8 push {r4-r7,lr} sub sp, 0xC @@ -739,6 +746,7 @@ _08003782: thumb_func_end Window_CopyRectToVram thumb_func_start Window_WriteStandardTileMap +@ void Window_WriteStandardTileMap(int rbox_id) Window_WriteStandardTileMap: @ 800378C push {r4,lr} sub sp, 0x1C @@ -789,6 +797,7 @@ Window_WriteStandardTileMap: @ 800378C thumb_func_end Window_WriteStandardTileMap thumb_func_start Window_WriteStandardTileMapRectOverridePalette +@ void Window_WriteStandardTileMapRectOverridePalette(u8 rbox_id, u8 x, u8 y, u8 w, u8 h, u8 palette) Window_WriteStandardTileMapRectOverridePalette: @ 80037EC push {r4-r7,lr} mov r7, r10 @@ -884,6 +893,7 @@ _0800388E: thumb_func_end Window_WriteStandardTileMapRectOverridePalette thumb_func_start Window_FillTileMap +@ void Window_FillTileMap(int rbox_id) Window_FillTileMap: @ 80038A4 push {r4,lr} sub sp, 0x18 @@ -924,6 +934,7 @@ Window_FillTileMap: @ 80038A4 thumb_func_end Window_FillTileMap thumb_func_start Window_WriteStandardTileMapRect +@ void Window_WriteStandardTileMapRect(u8 rbox_id, u8 x, u8 y, u8 w, u8 h) Window_WriteStandardTileMapRect: @ 80038F4 push {r4-r7,lr} mov r7, r10 @@ -1015,6 +1026,7 @@ _0800398E: thumb_func_end Window_WriteStandardTileMapRect thumb_func_start Window_CopyWholePixelBlockToWindow +@ void Window_CopyWholePixelBlockToWindow(u8 rbox_id, int a2, u16 x, u16 y, u16 w, u16 h) Window_CopyWholePixelBlockToWindow: @ 80039A4 push {r4,r5,lr} sub sp, 0x18 @@ -1046,6 +1058,7 @@ Window_CopyWholePixelBlockToWindow: @ 80039A4 thumb_func_end Window_CopyWholePixelBlockToWindow thumb_func_start Window_CopyPixelRectToWindow +@ void Window_CopyPixelRectToWindow(u8 rbox_id, void *pixels, u16 src_x, u16 src_y, u16 src_w, int src_h, u16 dest_x, u16 dest_y, u16 dest_w, u16 dest_h) Window_CopyPixelRectToWindow: @ 80039DC push {r4-r7,lr} mov r7, r10 @@ -1140,6 +1153,7 @@ Window_CopyPixelRectToWindow: @ 80039DC thumb_func_end Window_CopyPixelRectToWindow thumb_func_start Window_copy_pixels_rect_3 +@ void Window_copy_pixels_rect_3(u8 rbox_id, void *pixels, u16 src_x, u16 src_y, u16 src_w, int src_h, u16 dest_x, u16 dest_y, u16 dest_w, u16 dest_h, u8 a11) Window_copy_pixels_rect_3: @ 8003A9C push {r4-r7,lr} mov r7, r10 @@ -1238,6 +1252,7 @@ Window_copy_pixels_rect_3: @ 8003A9C thumb_func_end Window_copy_pixels_rect_3 thumb_func_start Window_FillPixelRect +@ void Window_FillPixelRect(u8 rbox_id, char fill_value, u16 x, u16 y, u16 w, u16 h) Window_FillPixelRect: @ 8003B64 push {r4-r6,lr} mov r6, r9 @@ -1352,6 +1367,7 @@ _08003C3C: thumb_func_end Window_CopyToPixels thumb_func_start Window_FastFillPixels +@ void Window_FastFillPixels(u8 rbox_id, int value) Window_FastFillPixels: @ 8003C48 push {r4,r5,lr} sub sp, 0x4 @@ -1392,6 +1408,7 @@ Window_FastFillPixels: @ 8003C48 thumb_func_end Window_FastFillPixels thumb_func_start Window_ScrollVertically +@ int Window_ScrollVertically(u8 a1, u8 mode, u8 a3, int a4) Window_ScrollVertically: @ 8003C94 push {r4-r7,lr} mov r7, r10 @@ -1918,6 +1935,7 @@ _08004046: thumb_func_end Window_ScrollVertically thumb_func_start CallWindowFunction +@ void CallWindowFunction(u8 windowId, void ( *functionPointer)(s8, s8, s8, s8)) CallWindowFunction: @ 8004058 push {r4-r6,lr} mov r6, r8 @@ -2161,6 +2179,7 @@ _0800422A: thumb_func_end Window_GetField thumb_func_start GetNumActiveWindowsOnBg +@ int GetNumActiveWindowsOnBg(int bg_id) GetNumActiveWindowsOnBg: @ 8004230 push {r4,lr} lsls r0, 24 @@ -2194,6 +2213,7 @@ nullsub_9: @ 800425C thumb_func_end nullsub_9 thumb_func_start Window_AddFromTemplate8Bpp +@ int Window_AddFromTemplate8Bpp(struct rbox_template *template) Window_AddFromTemplate8Bpp: @ 8004260 push {r4-r7,lr} mov r7, r10 @@ -2325,6 +2345,7 @@ _08004356: thumb_func_end Window_AddFromTemplate8Bpp thumb_func_start Window_FillPixels8Bpp +@ void Window_FillPixels8Bpp(u8 rbox_id, char value) Window_FillPixels8Bpp: @ 8004368 push {r4-r6,lr} lsls r0, 24 @@ -2363,6 +2384,7 @@ _0800439E: thumb_func_end Window_FillPixels8Bpp thumb_func_start Window_FillPixelRect8Bpp +@ void Window_FillPixelRect8Bpp(u8 a1, char fill_value, u16 x, u16 y, u16 w, u16 h) Window_FillPixelRect8Bpp: @ 80043A8 push {r4-r6,lr} mov r6, r9 @@ -2431,6 +2453,7 @@ Window_FillPixelRect8Bpp: @ 80043A8 thumb_func_end Window_FillPixelRect8Bpp thumb_func_start Window_CopyPixelRectToWindow4BppTo8Bpp +@ void Window_CopyPixelRectToWindow4BppTo8Bpp(u8 rbox_id, void *pixels, u16 src_x, u16 src_y, u16 src_w, int src_h, u16 dest_x, u16 dest_y, u16 dest_w, u16 dest_h, u8 a11) Window_CopyPixelRectToWindow4BppTo8Bpp: @ 8004434 push {r4-r7,lr} mov r7, r10 @@ -2591,6 +2614,7 @@ _08004570: thumb_func_end Window_CopyToVram8Bpp thumb_func_start GetNumActiveWindowsOnBgDuplicate +@ int GetNumActiveWindowsOnBgDuplicate(int bg_id) GetNumActiveWindowsOnBgDuplicate: @ 8004578 push {r4,lr} lsls r0, 24