From 4339dc18fcabc452470687b1d7a5d72a8d08301f Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sun, 29 Nov 2015 23:17:50 -0800 Subject: [PATCH] clean bg and core function names --- asm/emerald.s | 9929 +++++++++++++++++++++-------------------- asm/gpu_bg.s | 665 +-- asm/gpu_reg_manager.s | 118 +- asm/main.s | 221 +- asm/main_menu.s | 321 +- asm/malloc.s | 114 +- asm/pixel_buffer.s | 42 +- asm/text_renderer.s | 8 +- asm/window.s | 138 +- data/data2.s | 28 +- 10 files changed, 5796 insertions(+), 5788 deletions(-) diff --git a/asm/emerald.s b/asm/emerald.s index 83cadc241..bef0051ff 100644 --- a/asm/emerald.s +++ b/asm/emerald.s @@ -34,7 +34,7 @@ sub_80093CC: ; 80093CC beq @080093F4 bl sub_800B4A4 bl sub_80097E8 - bl restore_serial_timer3_irq_handlers + bl RestoreSerialTimer3IntrHandlers movs r0, 0 b @080093FE .pool @@ -117,7 +117,7 @@ sub_8009414: ; 8009414 lsls r0, r7, 2 orrs r1, r0 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg b @080094C0 @0800949E: lsls r1, r6, 8 @@ -126,7 +126,7 @@ sub_8009414: ; 8009414 lsls r0, r7, 2 orrs r1, r0 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg b @080094C0 @080094B0: lsls r1, r6, 8 @@ -135,7 +135,7 @@ sub_8009414: ; 8009414 lsls r0, r7, 2 orrs r1, r0 movs r0, 0xE - bl lcd_io_set + bl SetGpuReg @080094C0: mov r0, r8 lsls r4, r0, 2 @@ -144,13 +144,13 @@ sub_8009414: ; 8009414 lsls r0, 24 lsrs r0, 24 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r4, 0x12 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r3} mov r8, r3 pop {r4-r7} @@ -205,7 +205,7 @@ sub_80094EC: ; 80094EC lsls r5, 2 orrs r4, r5 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg pop {r3} mov r8, r3 pop {r4-r6} @@ -253,7 +253,7 @@ sub_8009570: ; 8009570 movs r1, 0xAA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_8009404 movs r1, 0 bl AddTask @@ -268,7 +268,7 @@ sub_8009570: ; 8009570 movs r1, 0 bl AddTask ldr r0, =c2_08009A8C - bl set_callback2 + bl SetMainCallback2 add sp, 0x4 pop {r4} pop {r0} @@ -1057,7 +1057,7 @@ sub_8009AA0: ; 8009AA0 beq @08009D0C @08009CEC: ldr r0, =c2_800ACD4 - bl set_callback2 + bl SetMainCallback2 b @08009D6E .pool @08009D0C: @@ -2907,7 +2907,7 @@ sub_800AB18: ; 800AB18 strb r0, [r1] bl sub_80097E8 ldr r0, =c2_800ACD4 - bl set_callback2 + bl SetMainCallback2 @0800AB6A: adds r0, r4, 0x1 lsls r0, 24 @@ -3328,7 +3328,7 @@ sub_800AEB4: ; 800AEB4 ldrb r0, [r0] strb r0, [r1, 0x5] ldr r0, =c2_800ACD4 - bl set_callback2 + bl SetMainCallback2 @0800AEEA: ldr r1, =0x0300306c movs r0, 0x1 @@ -3359,7 +3359,7 @@ c2_800ACD4: ; 800AF30 push {r4,lr} movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x030075f0 bl MPlayStop_rev01 ldr r0, =0x03007630 @@ -3369,7 +3369,7 @@ c2_800ACD4: ; 800AF30 ldr r0, =0x02000000 movs r1, 0xE0 lsls r1, 9 - bl init_malloc + bl InitHeap bl reset_all_obj_data bl gpu_pal_allocator_reset bl pal_fade_control_reset_maybe @@ -3395,19 +3395,19 @@ c2_800ACD4: ; 800AF30 ldr r0, =sub_80096BC bl SetVBlankCallback movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_082ED1FC movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x02022b0c movs r0, 0x80 lsls r0, 4 - bl malloc + bl Alloc adds r1, r0, 0 str r1, [r4] movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r0, =gUnknown_082ED204 bl InitWindows lsls r0, 16 @@ -3417,26 +3417,26 @@ c2_800ACD4: ; 800AF30 bl reset_temp_tile_data_buffers movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0xE0 lsls r1, 8 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 @@ -3456,7 +3456,7 @@ c2_800ACD4: ; 800AF30 bl obj_sync_something bl fade_and_return_progress_probably ldr r0, =sub_800B1A0 - bl set_callback2 + bl SetMainCallback2 @0800B03C: pop {r4} pop {r0} @@ -3472,7 +3472,7 @@ sub_800B080: ; 800B080 movs r0, 0 movs r2, 0x20 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, =gUnknown_082EC88C movs r5, 0 str r5, [sp] @@ -3484,9 +3484,9 @@ sub_800B080: ; 800B080 movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =gUnknown_082EC86C movs r1, 0 movs r2, 0x20 @@ -3541,7 +3541,7 @@ sub_800B138: ; 800B138 movs r0, 0 movs r2, 0x20 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles movs r0, 0x1 movs r1, 0 bl FillWindowPixelBuffer @@ -3619,13 +3619,13 @@ sub_800B1A0: ; 800B1A0 b @0800B260 @0800B1F2: movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =0x02022b00 ldrb r0, [r0, 0x6] cmp r0, 0 beq @0800B260 movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg b @0800B260 .pool @0800B20C: @@ -3700,7 +3700,7 @@ sub_800B1A0: ; 800B1A0 beq @0800B2C2 bl rfu_REQ_stopMode bl rfu_waitREQComplete - bl do_reset + bl Reset @0800B2C2: ldr r0, =0x030022c0 movs r2, 0x87 @@ -3863,7 +3863,7 @@ sub_800B3A4: ; 800B3A4 beq @0800B3F4 @0800B3EE: ldr r0, =c2_800ACD4 - bl set_callback2 + bl SetMainCallback2 @0800B3F4: pop {r4-r6} pop {r0} @@ -3871,8 +3871,8 @@ sub_800B3A4: ; 800B3A4 .pool thumb_func_end sub_800B3A4 - thumb_func_start sub_800B40C -sub_800B40C: ; 800B40C + thumb_func_start HandleLinkConnection +HandleLinkConnection: ; 800B40C push {r4,r5,lr} ldr r0, =0x030030fc ldrb r0, [r0] @@ -3920,7 +3920,7 @@ sub_800B40C: ; 800B40C pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_800B40C + thumb_func_end HandleLinkConnection thumb_func_start sub_800B488 sub_800B488: ; 800B488 @@ -4030,7 +4030,7 @@ sub_800B53C: ; 800B53C push {lr} sub sp, 0x4 movs r0, 0xC0 - bl disable_irqs + bl DisableInterrupts ldr r1, =0x04000128 movs r2, 0x80 lsls r2, 6 @@ -4065,7 +4065,7 @@ sub_800B594: ; 800B594 push {r4,r5,lr} sub sp, 0x4 movs r0, 0xC0 - bl disable_irqs + bl DisableInterrupts ldr r0, =0x04000134 movs r4, 0 strh r4, [r0] @@ -4080,7 +4080,7 @@ sub_800B594: ; 800B594 orrs r0, r1 strh r0, [r2] movs r0, 0x80 - bl enable_irqs + bl EnableInterrupts ldr r0, =0x0400012a strh r4, [r0] movs r5, 0 @@ -4303,7 +4303,7 @@ sub_800B790: ; 800B790 movs r0, 0x41 strh r0, [r1] movs r0, 0x40 - bl enable_irqs + bl EnableInterrupts @0800B7AE: pop {r0} bx r0 @@ -4611,14 +4611,14 @@ sub_800B9B8: ; 800B9B8 .pool thumb_func_end sub_800B9B8 - thumb_func_start irq_timer3 -irq_timer3: ; 800BA28 + thumb_func_start Timer3Intr +Timer3Intr: ; 800BA28 push {lr} bl sub_800BD98 bl sub_800BAC0 pop {r0} bx r0 - thumb_func_end irq_timer3 + thumb_func_end Timer3Intr thumb_func_start sub_800BA38 sub_800BA38: ; 800BA38 @@ -9925,7 +9925,7 @@ sub_800E3A8: ; 800E3A8 b @0800E520 @0800E3BE: movs r0, 0xF0 - bl malloc_and_clear + bl AllocZeroed str r0, [sp, 0x14] movs r4, 0 b @0800E434 @@ -10092,7 +10092,7 @@ sub_800E3A8: ; 800E3A8 movs r2, 0xF0 bl memcpy ldr r0, [sp, 0x14] - bl free + bl Free @0800E520: add sp, 0x20 pop {r3-r5} @@ -15007,7 +15007,7 @@ sub_8010DB4: ; 8010DB4 @08010DE4: ldr r4, =c2_800ACD4 adds r0, r4, 0 - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x030022c0 str r4, [r0, 0x8] ldr r5, =0x03005000 @@ -16649,14 +16649,14 @@ sub_8011AFC: ; 8011AFC movs r1, 0xAA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg bl run_active_tasks bl call_obj_callbacks bl obj_sync_something bl fade_and_return_progress_probably bl sub_8011BA4 ldr r0, =sub_8011BF8 - bl set_callback2 + bl SetMainCallback2 @08011B70: pop {r4} pop {r0} @@ -18171,13 +18171,13 @@ sub_8012780: ; 8012780 .pool @080128A0: movs r0, 0x70 - bl malloc_and_clear + bl AllocZeroed str r0, [r6, 0x4] movs r0, 0xA0 - bl malloc_and_clear + bl AllocZeroed str r0, [r6] movs r0, 0xA0 - bl malloc_and_clear + bl AllocZeroed str r0, [r6, 0x8] ldr r0, [r6, 0x4] movs r1, 0x4 @@ -18283,7 +18283,7 @@ sub_8012780: ; 8012780 movs r1, 0x2 bl CopyWindowToVram movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram mov r5, r8 strb r5, [r6, 0x13] strb r4, [r6, 0xC] @@ -18978,7 +18978,7 @@ sub_8012F64: ; 8012F64 movs r1, 0 bl sub_819746C movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldrb r0, [r4, 0x11] bl RemoveWindow ldrb r0, [r4, 0xF] @@ -18988,11 +18988,11 @@ sub_8012F64: ; 8012F64 ldrb r0, [r4, 0x17] bl remove_task ldr r0, [r4, 0x8] - bl free + bl Free ldr r0, [r4] - bl free + bl Free ldr r0, [r4, 0x4] - bl free + bl Free pop {r4} pop {r0} bx r0 @@ -19671,11 +19671,11 @@ sub_80134E8: ; 80134E8 bl sub_8009734 bl sub_8011C5C movs r0, 0x70 - bl malloc_and_clear + bl AllocZeroed str r0, [r6, 0x4] movs r0, 0x80 lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r6] movs r0, 0x1 strb r0, [r6, 0x8] @@ -19766,7 +19766,7 @@ sub_80134E8: ; 80134E8 movs r1, 0x2 bl CopyWindowToVram movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram strb r4, [r6, 0xF] movs r0, 0x3 strb r0, [r6, 0x8] @@ -20180,7 +20180,7 @@ sub_80134E8: ; 80134E8 movs r1, 0 bl sub_819746C movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldrb r0, [r6, 0xD] bl RemoveWindow ldrb r0, [r6, 0xB] @@ -20190,9 +20190,9 @@ sub_80134E8: ; 80134E8 ldrb r0, [r6, 0x11] bl remove_task ldr r0, [r6] - bl free + bl Free ldr r0, [r6, 0x4] - bl free + bl Free ldrb r0, [r6, 0x8] adds r0, 0x1 strb r0, [r6, 0x8] @@ -20421,11 +20421,11 @@ sub_8013C7C: ; 8013C7C movs r0, 0x1 bl sub_80111B0 movs r0, 0x70 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0x4] movs r0, 0x80 lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r0, 0x2 strb r0, [r4, 0x8] @@ -20472,9 +20472,9 @@ sub_8013C7C: ; 8013C7C ldrb r0, [r4, 0x11] bl remove_task ldr r0, [r4] - bl free + bl Free ldr r0, [r4, 0x4] - bl free + bl Free bl sub_800EDD4 ldrb r0, [r4, 0x8] adds r0, 0x1 @@ -20898,7 +20898,7 @@ sub_8013F90: ; 8013F90 ldr r0, =c2_exit_to_overworld_2_switch str r0, [r1, 0x8] ldr r0, =sub_807AE50 - bl set_callback2 + bl SetMainCallback2 mov r0, r8 bl sub_801807C adds r0, r6, 0 @@ -21241,7 +21241,7 @@ sub_8014384: ; 8014384 cmp r0, 0 bne @080143C6 ldr r0, =sub_8086074 - bl set_callback2 + bl SetMainCallback2 @080143C6: bl run_active_tasks bl RunTextPrinters @@ -21494,7 +21494,7 @@ sub_801440C: ; 801440C @080146B0: bl sub_8014304 ldr r0, =sub_8014384 - bl set_callback2 + bl SetMainCallback2 b @08014764 .pool @080146C4: @@ -21525,7 +21525,7 @@ sub_801440C: ; 801440C movs r1, 0 bl sub_80143E4 ldr r0, =sub_80141A4 - bl set_callback2 + bl SetMainCallback2 b @08014764 .pool @08014714: @@ -21720,7 +21720,7 @@ sub_8014790: ; 8014790 adds r0, r4, 0 bl remove_task ldr r0, =sub_80773AC - bl set_callback2 + bl SetMainCallback2 b @080149B2 .pool @08014914: @@ -21924,13 +21924,13 @@ sub_8014A40: ; 8014A40 .pool @08014AEC: movs r0, 0x70 - bl malloc_and_clear + bl AllocZeroed str r0, [r5, 0x4] movs r0, 0xA0 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] movs r0, 0xA0 - bl malloc_and_clear + bl AllocZeroed str r0, [r5, 0x8] ldr r0, [r5, 0x4] movs r1, 0x4 @@ -22001,7 +22001,7 @@ sub_8014A40: ; 8014A40 bl calls_per_item_funcs_in_list_outer strb r0, [r5, 0x12] movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 strb r0, [r5, 0x13] b @08014C42 @@ -22292,17 +22292,17 @@ sub_8014A40: ; 8014A40 movs r2, 0 bl sub_81AE6C8 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldrb r0, [r5, 0xF] bl RemoveWindow ldrb r0, [r5, 0x17] bl remove_task ldr r0, [r5, 0x8] - bl free + bl Free ldr r0, [r5] - bl free + bl Free ldr r0, [r5, 0x4] - bl free + bl Free b @08014EDA @08014E4E: adds r0, r5, 0 @@ -22348,17 +22348,17 @@ sub_8014A40: ; 8014A40 movs r2, 0 bl sub_81AE6C8 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldrb r0, [r5, 0xF] bl RemoveWindow ldrb r0, [r5, 0x17] bl remove_task ldr r0, [r5, 0x8] - bl free + bl Free ldr r0, [r5] - bl free + bl Free ldr r0, [r5, 0x4] - bl free + bl Free bl sub_800ADF8 @08014EDA: ldrb r0, [r5, 0xC] @@ -22456,11 +22456,11 @@ sub_8014F48: ; 8014F48 bl sub_8009734 bl sub_8011C5C movs r0, 0x70 - bl malloc_and_clear + bl AllocZeroed str r0, [r7, 0x4] movs r0, 0x80 lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r7] movs r0, 0x1 strb r0, [r7, 0x8] @@ -22545,7 +22545,7 @@ sub_8014F48: ; 8014F48 movs r1, 0x2 bl CopyWindowToVram movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram strb r6, [r7, 0xF] movs r0, 0x3 strb r0, [r7, 0x8] @@ -22704,7 +22704,7 @@ sub_8014F48: ; 8014F48 movs r2, 0 bl sub_81AE6C8 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldrb r0, [r7, 0xD] bl RemoveWindow ldrb r0, [r7, 0xB] @@ -22712,9 +22712,9 @@ sub_8014F48: ; 8014F48 ldrb r0, [r7, 0x11] bl remove_task ldr r0, [r7] - bl free + bl Free ldr r0, [r7, 0x4] - bl free + bl Free ldrb r0, [r7, 0x8] adds r0, 0x1 strb r0, [r7, 0x8] @@ -22844,11 +22844,11 @@ task00_081182DC: ; 80152F4 bl sub_8009734 bl sub_8011C5C movs r0, 0x70 - bl malloc_and_clear + bl AllocZeroed str r0, [r5, 0x4] movs r0, 0x80 lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] movs r0, 0x1 strb r0, [r5, 0x8] @@ -22906,7 +22906,7 @@ task00_081182DC: ; 80152F4 bl calls_per_item_funcs_in_list_outer strb r0, [r5, 0xE] movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @08015404: movs r0, 0 strb r0, [r5, 0xF] @@ -23073,16 +23073,16 @@ task00_081182DC: ; 80152F4 movs r2, 0 bl sub_81AE6C8 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldrb r0, [r5, 0xB] bl RemoveWindow @08015580: ldrb r0, [r5, 0x11] bl remove_task ldr r0, [r5] - bl free + bl Free ldr r0, [r5, 0x4] - bl free + bl Free ldrb r0, [r5, 0x8] adds r0, 0x1 strb r0, [r5, 0x8] @@ -23150,7 +23150,7 @@ sub_801560C: ; 801560C ldr r4, =0x02022c30 movs r0, 0x9B lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, =0x03000da8 str r0, [r1] @@ -23331,17 +23331,17 @@ sub_80156E0: ; 80156E0 .4byte @080165DC @080157FC: movs r0, 0x70 - bl malloc_and_clear + bl AllocZeroed str r0, [r6, 0x4] movs r0, 0x70 - bl malloc_and_clear + bl AllocZeroed str r0, [r6, 0xC] movs r0, 0x80 lsls r0, 1 - bl malloc_and_clear + bl AllocZeroed str r0, [r6] movs r0, 0x20 - bl malloc_and_clear + bl AllocZeroed str r0, [r6, 0x8] ldr r0, [r6] movs r1, 0x8 @@ -24094,7 +24094,7 @@ sub_80156E0: ; 80156E0 bl @08016878 @08015F5C: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r4, =0x02022c2c movs r0, 0x45 strb r0, [r4] @@ -24528,13 +24528,13 @@ sub_80156E0: ; 80156E0 b @08016876 @08016360: ldr r0, [r6, 0x8] - bl free + bl Free ldr r0, [r6] - bl free + bl Free ldr r0, [r6, 0xC] - bl free + bl Free ldr r0, [r6, 0x4] - bl free + bl Free adds r0, r6, 0 adds r0, 0x20 ldrb r0, [r0] @@ -24566,7 +24566,7 @@ sub_80156E0: ; 80156E0 bl remove_task ldr r0, =0x02022c30 ldr r0, [r0] - bl free + bl Free bl sub_80149D8 b @08016878 .pool @@ -25187,7 +25187,7 @@ sub_8016934: ; 8016934 ldr r4, =0x02022c30 movs r0, 0x9B lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, =0x03000da8 str r0, [r1] @@ -25250,23 +25250,23 @@ task00_081199FC: ; 801697C b @08016AC8 @080169E0: movs r0, 0x70 - bl malloc_and_clear + bl AllocZeroed str r0, [r5, 0x4] movs r1, 0x4 bl sub_80175EC movs r0, 0x70 - bl malloc_and_clear + bl AllocZeroed str r0, [r5, 0xC] movs r1, 0x4 bl sub_80175EC movs r0, 0x80 lsls r0, 1 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] movs r1, 0x8 bl sub_8017580 movs r0, 0x20 - bl malloc_and_clear + bl AllocZeroed str r0, [r5, 0x8] movs r1, 0x1 bl sub_8017580 @@ -25328,20 +25328,20 @@ task00_081199FC: ; 801697C .pool @08016A94: ldr r0, [r5, 0x8] - bl free + bl Free ldr r0, [r5] - bl free + bl Free ldr r0, [r5, 0xC] - bl free + bl Free ldr r0, [r5, 0x4] - bl free + bl Free adds r0, r5, 0 adds r0, 0x20 ldrb r0, [r0] bl remove_task ldr r0, =0x02022c30 ldr r0, [r0] - bl free + bl Free bl sub_800EDD4 adds r0, r4, 0 bl remove_task @@ -26508,9 +26508,9 @@ sub_80173B0: ; 80173B0 movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0xC pop {r0} bx r0 @@ -28657,65 +28657,65 @@ sub_8018450: ; 8018450 bl clear_tasks bl remove_some_task movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_082F0598 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r4, 0x80 lsls r4, 4 adds r0, r4, 0 - bl malloc + bl Alloc adds r1, r0, 0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc + bl Alloc adds r1, r0, 0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc + bl Alloc adds r1, r0, 0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc + bl Alloc adds r1, r0, 0 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0x3 bl bgid_upload_textbox_1 ldr r0, =gUnknown_082F05A8 @@ -28724,16 +28724,16 @@ sub_8018450: ; 8018450 movs r1, 0xC0 lsls r1, 7 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg b @08018610 .pool @08018574: @@ -28765,7 +28765,7 @@ sub_8018450: ; 8018450 movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -28773,7 +28773,7 @@ sub_8018450: ; 8018450 movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -28781,7 +28781,7 @@ sub_8018450: ; 8018450 movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0x3 bl sub_8018798 lsls r0, r7, 24 @@ -28792,13 +28792,13 @@ sub_8018450: ; 8018450 .pool @080185F8: movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @08018610: ldrb r0, [r6] adds r0, 0x1 @@ -28806,15 +28806,15 @@ sub_8018450: ; 8018450 b @08018644 @08018618: movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =0x0000021d bl song_play_for_text ldr r0, =sub_8018424 bl SetVBlankCallback movs r0, 0xC5 - bl enable_irqs + bl EnableInterrupts movs r0, 0x1 b @08018646 .pool @@ -28835,7 +28835,7 @@ c2_mystery_gift: ; 8018650 cmp r0, 0 beq @0801866C ldr r0, =sub_8018438 - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x02022c60 movs r0, 0 strb r0, [r1] @@ -28855,7 +28855,7 @@ sub_801867C: ; 801867C cmp r0, 0 beq @08018698 ldr r0, =sub_8018438 - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x02022c60 movs r0, 0x1 strb r0, [r1] @@ -28874,19 +28874,19 @@ sub_80186A4: ; 80186A4 strb r0, [r1] bl FreeAllWindowBuffers movs r0, 0 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free movs r0, 0x1 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free movs r0, 0x2 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free movs r0, 0x3 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free ldr r0, =c2_title_screen_1 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -28992,7 +28992,7 @@ sub_8018798: ; 8018798 movs r1, 0x3 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r8, r4 movs r4, 0x1 @080187C8: @@ -29020,7 +29020,7 @@ sub_8018798: ; 8018798 lsrs r0, r1, 24 movs r1, 0x1 lsrs r3, r5, 24 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect b @08018812 @080187FC: lsrs r2, r6, 24 @@ -29032,7 +29032,7 @@ sub_8018798: ; 8018798 lsrs r0, r1, 24 movs r1, 0x2 lsrs r3, r5, 24 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @08018812: movs r0, 0x80 lsls r0, 17 @@ -29073,7 +29073,7 @@ sub_8018838: ; 8018838 movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect b @08018876 @0801885E: movs r0, 0x20 @@ -29086,10 +29086,10 @@ sub_8018838: ; 8018838 movs r1, 0 movs r2, 0 movs r3, 0x2 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @08018876: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0xC pop {r0} bx r0 @@ -30259,7 +30259,7 @@ task_add_00_mystery_gift: ; 80191AC strh r0, [r4, 0x6] strb r1, [r4, 0xE] movs r0, 0x40 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0x10] pop {r4} pop {r0} @@ -31118,11 +31118,11 @@ task00_mystery_gift: ; 80191F4 @0801990C: bl sub_80097E8 ldr r0, [r5, 0x10] - bl free + bl Free adds r0, r4, 0 bl remove_task ldr r0, =sub_80186A4 - bl set_callback2 + bl SetMainCallback2 @08019922: add sp, 0x4 pop {r4,r5} @@ -32555,7 +32555,7 @@ sub_801A3D0: ; 801A3D0 thumb_func_start sub_801A3F4 sub_801A3F4: ; 801A3F4 push {lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0801A414 @@ -32583,7 +32583,7 @@ sub_801A418: ; 801A418 sub_801A42C: ; 801A42C push {lr} ldr r0, =sub_801A43C - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -32595,31 +32595,31 @@ sub_801A43C: ; 801A43C sub sp, 0xC movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r5, =0x03000dac movs r0, 0x6C - bl malloc_and_clear + bl AllocZeroed str r0, [r5] movs r0, 0 bl SetVBlankCallback movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_082F0D34 movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates movs r4, 0x80 lsls r4, 4 adds r0, r4, 0 - bl malloc + bl Alloc adds r1, r0, 0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc + bl Alloc adds r1, r0, 0 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, =gUnknown_082F0990 movs r0, 0 str r0, [sp] @@ -32631,7 +32631,7 @@ sub_801A43C: ; 801A43C movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r0, =gUnknown_082F0D3C bl InitWindows bl DeactivateAllTextPrinters @@ -32658,19 +32658,19 @@ sub_801A43C: ; 801A43C movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r0, =gUnknown_082F0790 movs r1, 0 movs r2, 0x20 @@ -32687,11 +32687,11 @@ sub_801A43C: ; 801A43C movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =sub_801A3F4 - bl set_callback2 + bl SetMainCallback2 bl run_active_tasks bl RunTextPrinters bl call_obj_callbacks @@ -32712,16 +32712,16 @@ sub_801A584: ; 801A584 @0801A58C: lsls r0, r4, 24 lsrs r0, 24 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free adds r4, 0x1 cmp r4, 0x1 ble @0801A58C ldr r0, =0x03000dac ldr r0, [r0] - bl free + bl Free ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 pop {r4} pop {r0} bx r0 @@ -32909,11 +32909,11 @@ sub_801A6C0: ; 801A6C0 movs r3, 0 bl pal_fade_maybe movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg b @0801A86C @0801A74C: ldr r0, =0x02037fd4 @@ -33068,7 +33068,7 @@ sub_801A6C0: ; 801A6C0 cmp r0, 0 bne @0801A89C ldr r0, =sub_801A584 - bl set_callback2 + bl SetMainCallback2 adds r0, r5, 0 bl remove_task @0801A89C: @@ -33436,7 +33436,7 @@ sub_801AAD4: ; 801AAD4 adds r1, r2, 0 strh r1, [r0] ldr r0, =sub_8036760 - bl set_callback2 + bl SetMainCallback2 pop {r4-r7} pop {r0} bx r0 @@ -33641,20 +33641,20 @@ sub_801AC54: ; 801AC54 @0801AD4C: movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x02022c6c movs r0, 0x4 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] bl reset_all_obj_data bl gpu_pal_allocator_reset bl clear_tasks movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_082F0DD0 movs r0, 0 movs r2, 0x1 - bl bg_vram_setup + bl InitBgsFromTemplates bl reset_temp_tile_data_buffers ldr r0, =gUnknown_082F0DD4 bl InitWindows @@ -33682,7 +33682,7 @@ sub_801AC54: ; 801AC54 movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0 movs r1, 0x1 movs r2, 0xD0 @@ -33725,7 +33725,7 @@ sub_801AC54: ; 801AC54 movs r3, 0 bl pal_fade_maybe movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 @@ -33844,7 +33844,7 @@ sub_801AC54: ; 801AC54 cmp r0, 0 beq @0801AFAE ldr r0, =sub_801AAD4 - bl set_callback2 + bl SetMainCallback2 b @0801AFAE .pool @0801AF58: @@ -33856,7 +33856,7 @@ sub_801AC54: ; 801AC54 cmp r0, 0 beq @0801AFAE ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 b @0801AFAE .pool @0801AF7C: @@ -33882,7 +33882,7 @@ sub_801AC54: ; 801AC54 cmp r0, 0 beq @0801AFAE ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 @0801AFAE: bl run_active_tasks bl RunTextPrinters @@ -35320,7 +35320,7 @@ sub_801BAAC: ; 801BAAC beq @0801BAC8 ldr r7, =0x02022c74 ldr r0, =0x0000145c - bl malloc_and_clear + bl AllocZeroed str r0, [r7] cmp r0, 0 bne @0801BAD4 @@ -35402,7 +35402,7 @@ sub_801BB48: ; 801BB48 movs r1, 0 bl memset ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] @0801BB64: @@ -35475,27 +35475,27 @@ sub_801BB74: ; 801BB74 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r5, [sp] str r4, [sp, 0x4] movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r5, [sp] str r4, [sp, 0x4] movs r0, 0x2 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r5, =0x02022c74 ldr r0, [r5] movs r1, 0xB8 @@ -35588,9 +35588,9 @@ sub_801BB74: ; 801BB74 movs r0, 0x2 movs r2, 0 movs r3, 0 - bl bg_copy_tilemap_rect + bl CopyRectToBgTileMapBufferRect movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0801BD86 .pool @0801BD14: @@ -35604,16 +35604,16 @@ sub_801BB74: ; 801BB74 movs r0, 0x2 bl sub_801C178 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0801BD86 @0801BD34: bl sub_80D2F04 b @0801BD86 @0801BD3A: movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F @@ -35720,33 +35720,33 @@ sub_801BDA4: ; 801BDA4 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r5, [sp] str r4, [sp, 0x4] movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r5, [sp] str r4, [sp, 0x4] movs r0, 0x2 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0801BEDA @0801BE56: movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x2 - bl gpu_sync_bg_hide + bl HideBg ldr r4, =0x02022c74 ldr r0, [r4] movs r1, 0xBD @@ -35778,7 +35778,7 @@ sub_801BDA4: ; 801BDA4 adds r1, r2, 0 bl sub_80186EC movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 negs r0, r0 movs r1, 0 @@ -36777,7 +36777,7 @@ sub_801C6C8: ; 801C6C8 beq @0801C6DE ldr r5, =0x02022c78 ldr r0, =0x000013a4 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] cmp r0, 0 bne @0801C6EC @@ -36828,7 +36828,7 @@ sub_801C72C: ; 801C72C movs r1, 0 bl memset ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] @0801C748: @@ -36898,35 +36898,35 @@ sub_801C758: ; 801C758 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x40 movs r1, 0xF0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001a98 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x1F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x1B - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits b @0801CA1E .pool @0801C82C: @@ -36938,36 +36938,36 @@ sub_801C758: ; 801C758 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r5, [sp] str r4, [sp, 0x4] movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r5, [sp] str r4, [sp, 0x4] movs r0, 0x2 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r5, [sp] str r4, [sp, 0x4] movs r0, 0x3 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r5, =0x02022c78 ldr r0, [r5] movs r1, 0xDE @@ -37057,7 +37057,7 @@ sub_801C758: ; 801C758 str r7, [sp, 0x20] movs r2, 0 movs r3, 0 - bl bg_copy_tilemap_rect + bl CopyRectToBgTileMapBufferRect mov r3, r8 ldr r1, [r3] adds r1, r6 @@ -37076,11 +37076,11 @@ sub_801C758: ; 801C758 movs r0, 0x3 movs r2, 0 movs r3, 0x3 - bl bg_copy_tilemap_rect + bl CopyRectToBgTileMapBufferRect movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0801CA1E .pool @0801C990: @@ -37089,17 +37089,17 @@ sub_801C758: ; 801C758 @0801C996: bl sub_801CE7C movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0801CA1E @0801C9A8: movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F @@ -37225,23 +37225,23 @@ sub_801CA50: ; 801CA50 movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits b @0801CC0E @0801CAF4: movs r4, 0x1E @@ -37252,14 +37252,14 @@ sub_801CA50: ; 801CA50 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r5, [sp, 0x4] movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] movs r5, 0x18 str r5, [sp, 0x4] @@ -37267,28 +37267,28 @@ sub_801CA50: ; 801CA50 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r5, [sp, 0x4] movs r0, 0x3 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0801CC0E @0801CB54: movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x2 - bl gpu_sync_bg_hide + bl HideBg ldr r4, =0x02022c78 ldr r0, [r4] movs r1, 0xE5 @@ -37308,11 +37308,11 @@ sub_801CA50: ; 801CA50 movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r4, =0x02022c78 ldr r0, [r4] ldr r2, =0x000001c1 @@ -37336,9 +37336,9 @@ sub_801CA50: ; 801CA50 movs r0, 0x3 bl sub_8018798 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 negs r0, r0 movs r1, 0 @@ -37840,22 +37840,22 @@ sub_801CFA4: ; 801CFA4 movs r0, 0x2 adds r1, r4, 0 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 adds r1, r4, 0 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY b @0801CFF8 .pool @0801CFE4: movs r0, 0x2 adds r1, r4, 0 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 adds r1, r4, 0 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY @0801CFF8: ldr r3, =0x02022c78 ldr r0, [r3] @@ -37928,7 +37928,7 @@ mevent_srv_init_wnews: ; 801D07C push {r4,lr} ldr r4, =0x02022c7c movs r0, 0x60 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, =gUnknown_082F298C movs r2, 0 @@ -37945,7 +37945,7 @@ mevent_srv_new_wcard: ; 801D0A0 push {r4,lr} ldr r4, =0x02022c7c movs r0, 0x60 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, =gUnknown_082F29EC movs r2, 0 @@ -37978,7 +37978,7 @@ sub_801D0C4: ; 801D0C4 strh r1, [r6] bl mevent_srv_free_resources ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] @0801D0F6: @@ -38004,18 +38004,18 @@ mevent_srv_init_common: ; 801D100 str r5, [r4, 0x8] movs r0, 0xA6 lsls r0, 1 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0x18] movs r0, 0xDE lsls r0, 1 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0x1C] movs r0, 0x80 lsls r0, 3 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0x14] movs r0, 0x64 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0x20] str r6, [r4, 0x10] str r5, [r4, 0xC] @@ -38037,13 +38037,13 @@ mevent_srv_free_resources: ; 801D158 push {r4,lr} adds r4, r0, 0 ldr r0, [r4, 0x18] - bl free + bl Free ldr r0, [r4, 0x1C] - bl free + bl Free ldr r0, [r4, 0x14] - bl free + bl Free ldr r0, [r4, 0x20] - bl free + bl Free pop {r4} pop {r0} bx r0 @@ -38455,7 +38455,7 @@ sub_801D484: ; 801D484 adds r5, r0, 0 ldr r4, =0x02022c80 movs r0, 0x50 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r1, 0x1 movs r2, 0 @@ -38489,7 +38489,7 @@ sub_801D4A8: ; 801D4A8 strh r1, [r6] bl sub_801D55C ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] @0801D4DA: @@ -38544,16 +38544,16 @@ mevent_srv_ish_init: ; 801D50C movs r5, 0x80 lsls r5, 3 adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0x14] adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0x18] adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0x1C] movs r0, 0x40 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0x20] adds r4, 0x24 adds r0, r4, 0 @@ -38572,13 +38572,13 @@ sub_801D55C: ; 801D55C push {r4,lr} adds r4, r0, 0 ldr r0, [r4, 0x14] - bl free + bl Free ldr r0, [r4, 0x18] - bl free + bl Free ldr r0, [r4, 0x1C] - bl free + bl Free ldr r0, [r4, 0x20] - bl free + bl Free pop {r4} pop {r0} bx r0 @@ -39683,7 +39683,7 @@ sub_801DD98: ; 801DD98 ldr r4, =0x02022c84 movs r0, 0xDE lsls r0, 1 - bl malloc + bl Alloc str r0, [r4] bl sub_801DDD0 ldr r1, =0x030022b0 @@ -39692,7 +39692,7 @@ sub_801DD98: ; 801DD98 movs r0, 0 bl SetVBlankCallback ldr r0, =c2_081284E0 - bl set_callback2 + bl SetMainCallback2 pop {r4} pop {r0} bx r0 @@ -39756,7 +39756,7 @@ sub_801DE30: ; 801DE30 ldrb r0, [r0, 0xF] bl remove_task ldr r0, [r4] - bl free + bl Free pop {r4} pop {r0} bx r0 @@ -39825,7 +39825,7 @@ c2_081284E0: ; 801DE54 cmp r0, 0 bne @0801DF04 ldr r0, =sub_801DF38 - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_801DF54 movs r1, 0x8 bl AddTask @@ -41348,7 +41348,7 @@ sub_801E978: ; 801E978 bl sub_801F544 bl sub_801DE30 ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 @0801EBC2: add sp, 0x4 pop {r4} @@ -42528,7 +42528,7 @@ sub_801F4D0: ; 801F4D0 push {r4,lr} ldr r4, =0x02022c88 ldr r0, =0x00002168 - bl malloc + bl Alloc str r0, [r4] cmp r0, 0 beq @0801F52C @@ -42536,11 +42536,11 @@ sub_801F4D0: ; 801F4D0 cmp r0, 0 beq @0801F52C movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_082F2C60 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_082F2C70 bl InitWindows bl reset_temp_tile_data_buffers @@ -42581,7 +42581,7 @@ sub_801F544: ; 801F544 ldr r0, [r4] cmp r0, 0 beq @0801F55A - bl free + bl Free movs r0, 0 str r0, [r4] @0801F55A: @@ -42772,7 +42772,7 @@ sub_801F658: ; 801F658 bl sub_80206E8 b @0801F6E8 @0801F6CC: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0801F6E8 @@ -42812,7 +42812,7 @@ sub_801F6F8: ; 801F6F8 bl CopyWindowToVram b @0801F720 @0801F716: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0801F728 @@ -42844,7 +42844,7 @@ sub_801F730: ; 801F730 bl CopyWindowToVram b @0801F758 @0801F74E: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0801F760 @@ -42887,7 +42887,7 @@ sub_801F768: ; 801F768 bl CopyWindowToVram b @0801F7C4 @0801F79E: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @0801F7C4 @@ -42949,7 +42949,7 @@ sub_801F7E0: ; 801F7E0 b @0801F81E .pool @0801F814: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0801F826 @@ -42978,10 +42978,10 @@ sub_801F82C: ; 801F82C bl sub_8020094 bl sub_801FEBC movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0801F862 @0801F84C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0801F868 @@ -43037,7 +43037,7 @@ sub_801F870: ; 801F870 bl CopyWindowToVram b @0801F8CC @0801F8BA: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0801F8D2 @@ -43102,7 +43102,7 @@ sub_801F8DC: ; 801F8DC bl CopyWindowToVram b @0801F972 @0801F938: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0801F978 @@ -43117,7 +43117,7 @@ sub_801F8DC: ; 801F8DC b @0801F972 .pool @0801F95C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0801F978 @@ -43185,7 +43185,7 @@ sub_801F984: ; 801F984 bl CopyWindowToVram b @0801FA1A @0801F9E0: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0801FA20 @@ -43198,7 +43198,7 @@ sub_801F984: ; 801F984 b @0801FA1A .pool @0801FA00: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0801FA20 @@ -43242,7 +43242,7 @@ sub_801FA2C: ; 801FA2C strb r0, [r4] b @0801FA5E @0801FA50: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0801FA5E @@ -43295,7 +43295,7 @@ sub_801FA68: ; 801FA68 b @0801FB34 .pool @0801FAC0: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 @@ -43336,7 +43336,7 @@ sub_801FA68: ; 801FA68 adds r0, 0x1 strb r0, [r6] @0801FB14: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0801FB3A @@ -43414,7 +43414,7 @@ sub_801FB70: ; 801FB70 b @0801FBAA .pool @0801FBA0: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0801FBAC @@ -43451,7 +43451,7 @@ sub_801FBB4: ; 801FBB4 b @0801FBEE .pool @0801FBE4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0801FBF0 @@ -43493,7 +43493,7 @@ sub_801FBF8: ; 801FBF8 b @0801FC42 .pool @0801FC38: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0801FC44 @@ -43534,7 +43534,7 @@ sub_801FC4C: ; 801FC4C b @0801FC92 .pool @0801FC88: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0801FC94 @@ -43575,7 +43575,7 @@ sub_801FC9C: ; 801FC9C b @0801FCE2 .pool @0801FCD8: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0801FCE4 @@ -43612,7 +43612,7 @@ sub_801FCEC: ; 801FCEC b @0801FD26 .pool @0801FD1C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0801FD28 @@ -43654,7 +43654,7 @@ sub_801FD30: ; 801FD30 b @0801FD7E .pool @0801FD74: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0801FD80 @@ -43695,7 +43695,7 @@ sub_801FD88: ; 801FD88 b @0801FDCE .pool @0801FDC4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0801FDD0 @@ -43956,7 +43956,7 @@ sub_801FF18: ; 801FF18 lsls r1, r0, 8 movs r0, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY mov r1, r8 lsls r0, r1, 24 lsrs r5, r0, 24 @@ -44055,7 +44055,7 @@ sub_8020094: ; 8020094 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY pop {r4} pop {r0} bx r0 @@ -44552,70 +44552,70 @@ sub_8020480: ; 8020480 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0xE0 lsls r1, 8 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r1, =0x000040f0 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0x90 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x3D - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -44630,22 +44630,22 @@ sub_8020538: ; 8020538 lsls r0, 1 adds r1, r0 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00000928 adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00001128 adds r1, r0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00001928 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap pop {r4} pop {r0} bx r0 @@ -44669,9 +44669,9 @@ sub_8020584: ; 8020584 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x8 pop {r0} bx r0 @@ -44700,9 +44700,9 @@ sub_80205B4: ; 80205B4 movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x4 pop {r0} bx r0 @@ -44749,9 +44749,9 @@ task_tutorial_story_unknown: ; 8020604 movs r0, 0x2 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x4 pop {r4,r5} pop {r0} @@ -44832,7 +44832,7 @@ sub_80206E8: ; 80206E8 str r0, [sp, 0x4] movs r0, 0x1 movs r3, 0 - bl BlitSurfaceToWindow + bl BlitBitmapToWindow adds r4, 0x1 cmp r4, 0xE ble @080206F8 @@ -45016,7 +45016,7 @@ sub_8020890: ; 8020890 bl gpu_pal_obj_alloc_tag_and_apply ldr r4, =0x02022c8c movs r0, 0x18 - bl malloc + bl Alloc str r0, [r4] cmp r0, 0 beq @080208C8 @@ -45038,7 +45038,7 @@ sub_80208D0: ; 80208D0 ldr r0, [r0] cmp r0, 0 beq @080208DE - bl free + bl Free @080208DE: pop {r0} bx r0 @@ -45468,11 +45468,11 @@ sub_8020C0C: ; 8020C0C ldrb r0, [r0, 0xA] bl remove_task ldr r0, [r5] - bl free + bl Free movs r0, 0 str r0, [r5] adds r0, r4, 0 - bl set_callback2 + bl SetMainCallback2 ldr r0, =c2_exit_to_overworld_2_switch cmp r4, r0 bne @08020C5A @@ -45514,7 +45514,7 @@ sub_8020C70: ; 8020C70 bne @08020CAC @08020C8E: adds r0, r4, 0 - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x03005000 mov r1, r8 strh r1, [r0, 0x10] @@ -45536,7 +45536,7 @@ sub_8020C70: ; 8020C70 bcc @08020CDC @08020CC8: adds r0, r4, 0 - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x03005000 movs r1, 0 strh r1, [r0, 0x10] @@ -45546,13 +45546,13 @@ sub_8020C70: ; 8020C70 @08020CDC: ldr r6, =0x02022c90 ldr r0, =0x000041c0 - bl malloc_and_clear + bl AllocZeroed adds r5, r0, 0 str r5, [r6] cmp r5, 0 bne @08020D10 adds r0, r4, 0 - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x03005000 strh r5, [r0, 0x10] strh r5, [r0, 0x12] @@ -45597,7 +45597,7 @@ sub_8020C70: ; 8020C70 movs r1, 0x1 bl sub_8022BEC ldr r0, =sub_8020F88 - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_8020FA0 movs r1, 0x8 bl AddTask @@ -45676,7 +45676,7 @@ sub_8020D8C: ; 8020D8C ldr r1, [r4] strb r0, [r1, 0xA] ldr r0, =sub_8020F88 - bl set_callback2 + bl SetMainCallback2 add sp, 0xC pop {r4} pop {r0} @@ -46016,7 +46016,7 @@ sub_802104C: ; 802104C bl SetHBlankCallback movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl remove_some_task bl reset_temp_tile_data_buffers b @080212FC @@ -46041,56 +46041,56 @@ sub_802104C: ; 802104C b @080212FC @080210F2: movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_082F32C8 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0xE0 lsls r0, 1 adds r1, r5, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0x87 lsls r0, 6 adds r1, r5, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0xC7 lsls r0, 6 adds r1, r5, r0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg b @080212FC .pool @08021178: @@ -46101,7 +46101,7 @@ sub_802104C: ; 802104C movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] movs r0, 0x40 str r0, [sp, 0x4] @@ -46109,31 +46109,31 @@ sub_802104C: ; 802104C movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x2 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x3 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 b @080212FC @080211BE: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r1, =gUnknown_08DE34B8 movs r0, 0 str r0, [sp] @@ -46173,25 +46173,25 @@ sub_802104C: ; 802104C movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r1, =gUnknown_082F3DBC movs r0, 0x2 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r1, =gUnknown_082F3F54 movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer adds r0, r5, 0 bl sub_80226D0 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080212FC .pool @08021278: @@ -46207,15 +46207,15 @@ sub_802104C: ; 802104C lsls r1, 16 lsrs r1, 16 movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY b @080212FC .pool @080212B4: @@ -46230,17 +46230,17 @@ sub_802104C: ; 802104C movs r2, 0 bl sub_80A2A20 movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits bl sub_8020E3C movs r0, 0 strb r0, [r5, 0xC] @@ -46325,59 +46325,59 @@ sub_802130C: ; 802130C movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x2 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x3 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0802143E @080213E6: bl FreeAllWindowBuffers movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x2 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x2 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x3 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits b @0802143E @08021426: bl sub_800E084 @@ -46416,7 +46416,7 @@ sub_8021450: ; 8021450 lsls r1, 16 lsrs r1, 16 movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0x12] cmp r0, 0x7 bne @0802147C @@ -48609,7 +48609,7 @@ sub_8022600: ; 8022600 bcc @08022616 @080226B6: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x14 pop {r3} mov r8, r3 @@ -48650,7 +48650,7 @@ sub_80226D0: ; 80226D0 movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x3 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @@ -48659,7 +48659,7 @@ sub_80226D0: ; 80226D0 cmp r5, r0 bcc @080226EC movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x8 pop {r4-r6} pop {r0} @@ -49679,7 +49679,7 @@ sub_8022F04: ; 8022F04 movs r1, 0 str r1, [r0, 0x4] ldr r0, =sub_8020E1C - bl set_callback2 + bl SetMainCallback2 movs r0, 0 pop {r1} bx r1 @@ -50075,19 +50075,19 @@ sub_80231B8: ; 80231B8 lsls r1, 16 lsrs r1, 16 movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2C] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2C] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg ldrb r0, [r6] adds r0, 0x1 strb r0, [r6] @@ -50119,13 +50119,13 @@ sub_80231B8: ; 80231B8 strh r0, [r4, 0x2C] movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl sub_8010434 b @080232DC @080232BE: @@ -50971,19 +50971,19 @@ sub_80238F0: ; 80238F0 lsls r1, 16 lsrs r1, 16 movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2C] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2C] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 adds r0, 0x25 ldrb r1, [r0] @@ -51051,19 +51051,19 @@ sub_8023998: ; 8023998 lsls r1, 16 lsrs r1, 16 movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2C] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2C] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 adds r0, 0x25 ldrb r1, [r0] @@ -51200,19 +51200,19 @@ sub_8023A30: ; 8023A30 lsls r1, 16 lsrs r1, 16 movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2C] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2C] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg ldrb r0, [r6] adds r0, 0x1 strb r0, [r6] @@ -51244,13 +51244,13 @@ sub_8023A30: ; 8023A30 strh r0, [r4, 0x2C] movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg b @08023BB2 @08023B7A: movs r2, 0x9C @@ -51358,13 +51358,13 @@ sub_8023BC0: ; 8023BC0 strh r0, [r5, 0x10] movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg b @08023C9C @08023C5C: bl sub_800A520 @@ -51900,7 +51900,7 @@ sub_8024048: ; 8024048 b @0802412A @0802408A: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x9C lsls r0, 1 adds r1, r5, r0 @@ -53047,7 +53047,7 @@ sub_802493C: ; 802493C beq @08024A10 ldr r4, =0x02022c98 ldr r0, =0x00003330 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] cmp r0, 0 beq @08024A10 @@ -53091,7 +53091,7 @@ sub_802493C: ; 802493C movs r1, 0x1 bl AddTask ldr r0, =sub_80261CC - bl set_callback2 + bl SetMainCallback2 bl sub_80273F0 ldr r2, [r4] adds r0, r2, 0 @@ -53108,7 +53108,7 @@ sub_802493C: ; 802493C .pool @08024A10: adds r0, r5, 0 - bl set_callback2 + bl SetMainCallback2 @08024A16: pop {r4-r6} pop {r0} @@ -54713,12 +54713,12 @@ sub_80256AC: ; 80256AC ldr r4, =0x02022c98 ldr r0, [r4] ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 ldr r0, [r4] ldrb r0, [r0, 0x4] bl remove_task ldr r0, [r4] - bl free + bl Free bl FreeAllWindowBuffers @0802574C: add sp, 0x4 @@ -54769,35 +54769,35 @@ sub_8025758: ; 8025758 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY b @08025848 @08025802: bl sub_80A2F30 @@ -56110,13 +56110,13 @@ sub_8026264: ; 8026264 lsls r4, r2, 3 adds r1, r4, 0 movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg negs r4, r4 lsls r4, 16 lsrs r4, 16 movs r0, 0x18 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg @080262B8: movs r0, 0 @080262BA: @@ -59353,7 +59353,7 @@ sub_8027ACC: ; 8027ACC b @08027BB6 .pool @08027B94: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @08027BE2 @@ -59378,7 +59378,7 @@ sub_8027ACC: ; 8027ACC b @08027BE2 .pool @08027BC8: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @08027BE2 @@ -60398,7 +60398,7 @@ sub_80283A8: ; 80283A8 movs r5, 0xC0 lsls r5, 6 adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed adds r4, r0, 0 ldr r0, =gUnknown_082FB2D8 ldr r1, [r0, 0x4] @@ -60420,7 +60420,7 @@ sub_80283A8: ; 80283A8 mov r0, sp bl gpu_tile_obj_alloc_tag_and_copy_to_vram adds r0, r4, 0 - bl free + bl Free @080283E8: add r0, sp, 0x8 bl gpu_pal_obj_alloc_tag_and_apply @@ -60470,7 +60470,7 @@ sub_8028408: ; 8028408 movs r2, 0x18 bl memcpy movs r0, 0x4 - bl malloc_and_clear + bl AllocZeroed ldr r1, =0x02022c9c mov r2, r8 lsls r4, r2, 2 @@ -60859,7 +60859,7 @@ sub_8028734: ; 8028734 movs r4, 0xC0 lsls r4, 1 adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r6, r0, 0 ldr r0, =gUnknown_082FB2E8 ldr r1, [r0, 0x4] @@ -60885,7 +60885,7 @@ sub_8028734: ; 8028734 stm r1!, {r2-r4} ldr r4, =0x02022cf4 movs r0, 0x40 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] adds r0, r5, 0 bl gpu_tile_obj_alloc_tag_and_copy_to_vram @@ -60923,7 +60923,7 @@ sub_8028734: ; 8028734 bls @0802878A @080287C4: adds r0, r6, 0 - bl free + bl Free add sp, 0x28 pop {r4-r6} pop {r0} @@ -60957,7 +60957,7 @@ sub_80287E4: ; 80287E4 cmp r4, 0x9 bls @080287E8 ldr r0, [r5] - bl free + bl Free movs r0, 0 str r0, [r5] pop {r4,r5} @@ -61236,7 +61236,7 @@ sub_8028A34: ; 8028A34 movs r5, 0x90 lsls r5, 3 adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed adds r4, r0, 0 ldr r0, =gUnknown_082FB314 ldr r1, [r0, 0x4] @@ -61259,7 +61259,7 @@ sub_8028A34: ; 8028A34 add r0, sp, 0x8 bl gpu_pal_obj_alloc_tag_and_apply adds r0, r4, 0 - bl free + bl Free add sp, 0x10 pop {r4,r5} pop {r0} @@ -61291,7 +61291,7 @@ sub_8028A88: ; 8028A88 mov r9, r2 @08028AB0: movs r0, 0x4 - bl malloc_and_clear + bl AllocZeroed ldr r1, =0x02022cb8 lsls r4, r5, 2 adds r4, r1 @@ -61321,7 +61321,7 @@ sub_8028A88: ; 8028A88 mov r8, r4 @08028AF0: movs r0, 0x4 - bl malloc_and_clear + bl AllocZeroed lsls r1, r5, 2 adds r4, r1, r7 str r0, [r4] @@ -61399,7 +61399,7 @@ sub_8028B80: ; 8028B80 bl obj_delete_and_free_tiles @08028BA0: ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] adds r0, r5, 0x1 @@ -61424,7 +61424,7 @@ sub_8028B80: ; 8028B80 bl obj_delete_and_free_tiles @08028BD2: ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] adds r0, r5, 0x1 @@ -61622,7 +61622,7 @@ sub_8028D44: ; 8028D44 movs r4, 0x80 lsls r4, 3 adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r6, r0, 0 ldr r0, =gUnknown_082FB360 ldr r1, [r0, 0x4] @@ -61657,7 +61657,7 @@ sub_8028D44: ; 8028D44 mov r8, r1 @08028D9E: movs r0, 0x4 - bl malloc_and_clear + bl AllocZeroed lsls r2, r5, 2 mov r3, r8 adds r4, r2, r3 @@ -61682,7 +61682,7 @@ sub_8028D44: ; 8028D44 bls @08028D9E @08028DD2: adds r0, r6, 0 - bl free + bl Free add sp, 0x28 pop {r3,r4} mov r8, r3 @@ -61782,7 +61782,7 @@ sub_8028E84: ; 8028E84 bl obj_delete_and_free_tiles @08028EA4: ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] adds r0, r5, 0x1 @@ -61975,7 +61975,7 @@ sub_8028FF8: ; 8028FF8 lsls r2, 1 movs r0, 0 movs r3, 0x1 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles adds r0, r4, 0 bl sub_8098758 ldr r0, [r0, 0x4] @@ -62046,7 +62046,7 @@ sub_8029074: ; 8029074 str r6, [sp, 0x8] movs r0, 0 movs r1, 0x1 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x1] ldrb r3, [r4, 0x2] subs r3, 0x1 @@ -62058,7 +62058,7 @@ sub_8029074: ; 8029074 str r6, [sp, 0x8] movs r0, 0 movs r1, 0x2 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x3] ldrb r0, [r4, 0x1] adds r2, r0 @@ -62073,7 +62073,7 @@ sub_8029074: ; 8029074 str r6, [sp, 0x8] movs r0, 0 movs r1, 0x3 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x1] subs r2, 0x1 lsls r2, 24 @@ -62085,7 +62085,7 @@ sub_8029074: ; 8029074 str r6, [sp, 0x8] movs r0, 0 movs r1, 0x4 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x3] ldrb r0, [r4, 0x1] adds r2, r0 @@ -62098,7 +62098,7 @@ sub_8029074: ; 8029074 str r6, [sp, 0x8] movs r0, 0 movs r1, 0x6 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x1] subs r2, 0x1 lsls r2, 24 @@ -62113,7 +62113,7 @@ sub_8029074: ; 8029074 str r6, [sp, 0x8] movs r0, 0 movs r1, 0x7 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x1] ldrb r3, [r4, 0x4] ldrb r0, [r4, 0x2] @@ -62126,7 +62126,7 @@ sub_8029074: ; 8029074 str r6, [sp, 0x8] movs r0, 0 movs r1, 0x8 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x3] ldrb r0, [r4, 0x1] adds r2, r0 @@ -62142,7 +62142,7 @@ sub_8029074: ; 8029074 str r6, [sp, 0x8] movs r0, 0 movs r1, 0x9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0xC pop {r4-r6} pop {r0} @@ -62169,7 +62169,7 @@ sub_8029174: ; 8029174 str r6, [sp, 0x8] movs r0, 0 movs r1, 0xA - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x1] ldrb r3, [r4, 0x2] subs r3, 0x1 @@ -62181,7 +62181,7 @@ sub_8029174: ; 8029174 str r6, [sp, 0x8] movs r0, 0 movs r1, 0xB - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x3] ldrb r0, [r4, 0x1] adds r2, r0 @@ -62196,7 +62196,7 @@ sub_8029174: ; 8029174 str r6, [sp, 0x8] movs r0, 0 movs r1, 0xC - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x1] subs r2, 0x1 lsls r2, 24 @@ -62208,7 +62208,7 @@ sub_8029174: ; 8029174 str r6, [sp, 0x8] movs r0, 0 movs r1, 0xD - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x3] ldrb r0, [r4, 0x1] adds r2, r0 @@ -62221,7 +62221,7 @@ sub_8029174: ; 8029174 str r6, [sp, 0x8] movs r0, 0 movs r1, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x1] subs r2, 0x1 lsls r2, 24 @@ -62236,7 +62236,7 @@ sub_8029174: ; 8029174 str r6, [sp, 0x8] movs r0, 0 movs r1, 0x10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x1] ldrb r3, [r4, 0x4] ldrb r0, [r4, 0x2] @@ -62249,7 +62249,7 @@ sub_8029174: ; 8029174 str r6, [sp, 0x8] movs r0, 0 movs r1, 0x11 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r2, [r4, 0x3] ldrb r0, [r4, 0x1] adds r2, r0 @@ -62265,7 +62265,7 @@ sub_8029174: ; 8029174 str r6, [sp, 0x8] movs r0, 0 movs r1, 0x12 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0xC pop {r4-r6} pop {r0} @@ -62408,34 +62408,34 @@ sub_8029338: ; 8029338 movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r1, =gUnknown_082FAF94 movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r1, =gUnknown_082FAD44 movs r0, 0x2 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @08029414 .pool @080293D8: movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =0x02022cf8 ldr r1, [r0] ldr r2, =0x00003014 @@ -62659,7 +62659,7 @@ sub_8029440: ; 8029440 b @0802962A .pool @080295EC: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802968E @@ -62683,7 +62683,7 @@ sub_8029440: ; 8029440 bcc @08029604 @0802961C: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =0x02022cf8 ldr r1, [r0] ldr r2, =0x00003014 @@ -62721,9 +62721,9 @@ sub_8029440: ; 8029440 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =0x02022cf8 ldr r0, [r0] movs r3, 0xC0 @@ -63272,7 +63272,7 @@ sub_802988C: ; 802988C b @08029F8E .pool @08029B6C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @08029B90 @@ -63289,7 +63289,7 @@ sub_802988C: ; 802988C bl PutWindowTileMap @08029B90: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 bl sub_8028C30 ldr r0, =0x02022cf8 @@ -63390,7 +63390,7 @@ sub_802988C: ; 802988C b @08029F8E .pool @08029C9C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @08029CC0 @@ -63407,7 +63407,7 @@ sub_802988C: ; 802988C bl PutWindowTileMap @08029CC0: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =0x02022cf8 ldr r1, [r0] ldr r0, =0x00003014 @@ -63468,7 +63468,7 @@ sub_802988C: ; 802988C movs r1, 0 movs r2, 0 movs r3, 0x5 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 ldr r5, =0x02022cf8 ldr r0, [r5] ldr r4, =0x00003009 @@ -63624,7 +63624,7 @@ sub_802988C: ; 802988C b @08029F8E .pool @08029F08: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @08029F2C @@ -63641,7 +63641,7 @@ sub_802988C: ; 802988C bl PutWindowTileMap @08029F2C: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =0x0000020b movs r1, 0x14 movs r2, 0xA @@ -63711,9 +63711,9 @@ sub_802988C: ; 802988C movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, [r6] movs r1, 0xC0 lsls r1, 6 @@ -63891,7 +63891,7 @@ sub_802A010: ; 802A010 b @0802A2EA .pool @0802A194: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802A1B6 @@ -63907,7 +63907,7 @@ sub_802A010: ; 802A010 bl PutWindowTileMap @0802A1B6: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r1, [r7] ldr r2, =0x00003014 adds r1, r2 @@ -64082,9 +64082,9 @@ sub_802A010: ; 802A010 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, [r7] movs r3, 0xC0 lsls r3, 6 @@ -64154,7 +64154,7 @@ sub_802A380: ; 802A380 b @0802A414 .pool @0802A3EC: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802A448 @@ -64187,9 +64187,9 @@ sub_802A380: ; 802A380 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =0x02022cf8 ldr r0, [r0] movs r1, 0xC0 @@ -64273,7 +64273,7 @@ sub_802A454: ; 802A454 b @0802A514 .pool @0802A4F4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802A50A @@ -64284,7 +64284,7 @@ sub_802A454: ; 802A454 bl PutWindowTileMap @0802A50A: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @0802A510: ldr r1, [r5] adds r1, r6 @@ -64330,9 +64330,9 @@ sub_802A534: ; 802A534 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, [r5] movs r1, 0xC0 lsls r1, 6 @@ -64433,7 +64433,7 @@ sub_802A588: ; 802A588 b @0802A678 .pool @0802A658: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802A66E @@ -64444,7 +64444,7 @@ sub_802A588: ; 802A588 bl PutWindowTileMap @0802A66E: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r1, [r6] adds r1, r7 @0802A678: @@ -64491,9 +64491,9 @@ sub_802A588: ; 802A588 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, [r6] movs r2, 0xC0 lsls r2, 6 @@ -64671,67 +64671,67 @@ sub_802A7A8: ; 802A7A8 ldr r0, [r2, 0x8] movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_082F7BA4 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY bl sub_81971D0 bl sub_8197200 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x02022cf8 ldr r1, [r4] movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] movs r2, 0x80 lsls r2, 5 adds r1, r2 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] movs r0, 0x80 lsls r0, 6 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap add sp, 0x8 pop {r3} mov r8, r3 @@ -64842,7 +64842,7 @@ sub_802A9A8: ; 802A9A8 beq @0802AA3C ldr r5, =0x02022cfc ldr r0, =0x000083b0 - bl malloc + bl Alloc str r0, [r5] cmp r0, 0 beq @0802AA3C @@ -64881,12 +64881,12 @@ sub_802A9A8: ; 802A9A8 movs r1, 0x2 bl set_word_task_arg ldr r0, =sub_802AC6C - bl set_callback2 + bl SetMainCallback2 b @0802AA42 .pool @0802AA3C: adds r0, r6, 0 - bl set_callback2 + bl SetMainCallback2 @0802AA42: pop {r4-r7} pop {r0} @@ -64899,7 +64899,7 @@ sub_802AA48: ; 802AA48 bl sub_802D0AC ldr r0, =0x02022cfc ldr r0, [r0] - bl free + bl Free pop {r0} bx r0 .pool @@ -66460,7 +66460,7 @@ sub_802B664: ; 802B664 bne @0802B6B0 ldr r0, [r4] ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 bl sub_802AA48 @0802B6B0: movs r0, 0x1 @@ -68975,11 +68975,11 @@ sub_802C9D4: ; 802C9D4 stm r1!, {r2-r4} movs r0, 0x80 lsls r0, 6 - bl malloc + bl Alloc mov r8, r0 movs r0, 0x80 lsls r0, 4 - bl malloc + bl Alloc mov r10, r0 bl sub_802C8BC lsls r0, 16 @@ -69031,9 +69031,9 @@ sub_802C9D4: ; 802C9D4 str r1, [r0, 0x4] bl gpu_pal_obj_decompress_and_apply mov r0, r8 - bl free + bl Free mov r0, r10 - bl free + bl Free mov r1, sp mov r0, sp ldrh r0, [r0] @@ -69946,11 +69946,11 @@ sub_802D150: ; 802D150 b @0802D2DA @0802D178: movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_082FE164 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_082FE174 bl InitWindows bl reset_temp_tile_data_buffers @@ -70015,7 +70015,7 @@ sub_802D150: ; 802D150 lsls r0, 1 adds r1, r0 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0x20 str r0, [sp] str r0, [sp, 0x4] @@ -70023,7 +70023,7 @@ sub_802D150: ; 802D150 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 bl sub_802DB8C movs r0, 0 bl sub_802DD64 @@ -70032,11 +70032,11 @@ sub_802D150: ; 802D150 movs r2, 0xE0 bl sub_8098C6C movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram bl sub_8199D98 b @0802D2CC .pool @@ -70052,13 +70052,13 @@ sub_802D150: ; 802D150 movs r1, 0x6 bl sub_802CF50 movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg @0802D2CC: ldr r1, [r6] ldrh r0, [r1, 0x4] @@ -70099,7 +70099,7 @@ sub_802D2E4: ; 802D2E4 bl sub_802DE1C b @0802D330 @0802D310: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D34A @@ -70107,7 +70107,7 @@ sub_802D2E4: ; 802D2E4 bl sub_802DF70 b @0802D330 @0802D322: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D34A @@ -70119,7 +70119,7 @@ sub_802D2E4: ; 802D2E4 strh r0, [r1, 0x4] b @0802D34A @0802D33A: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D34A @@ -70156,7 +70156,7 @@ sub_802D350: ; 802D350 bl sub_802DE1C b @0802D39C @0802D37C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D3B6 @@ -70164,7 +70164,7 @@ sub_802D350: ; 802D350 bl sub_802DF70 b @0802D39C @0802D38E: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D3B6 @@ -70176,7 +70176,7 @@ sub_802D350: ; 802D350 strh r0, [r1, 0x4] b @0802D3B6 @0802D3A6: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D3B6 @@ -70221,7 +70221,7 @@ sub_802D3BC: ; 802D3BC blt @0802D3E2 @0802D3F8: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =0x02022d00 ldr r1, [r0] ldrh r0, [r1, 0x4] @@ -70230,7 +70230,7 @@ sub_802D3BC: ; 802D3BC b @0802D43E .pool @0802D410: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D43E @@ -70305,7 +70305,7 @@ sub_802D448: ; 802D448 b @0802D4D2 .pool @0802D4A4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D4EC @@ -70322,7 +70322,7 @@ sub_802D448: ; 802D448 movs r2, 0 bl sub_802DB18 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @0802D4D2: ldr r1, [r5] ldrh r0, [r1, 0x4] @@ -70330,7 +70330,7 @@ sub_802D448: ; 802D448 strh r0, [r1, 0x4] b @0802D4EC @0802D4DC: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D4EC @@ -70389,7 +70389,7 @@ sub_802D4F4: ; 802D4F4 b @0802D574 .pool @0802D550: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D58E @@ -70402,7 +70402,7 @@ sub_802D4F4: ; 802D4F4 movs r2, 0xE bl sub_8098858 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @0802D574: ldr r1, [r5] ldrh r0, [r1, 0x4] @@ -70410,7 +70410,7 @@ sub_802D4F4: ; 802D4F4 strh r0, [r1, 0x4] b @0802D58E @0802D57E: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D58E @@ -70440,7 +70440,7 @@ sub_802D598: ; 802D598 bl sub_802DA14 bl sub_8198C78 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r1, [r5] ldrh r0, [r1, 0x4] adds r0, 0x1 @@ -70450,7 +70450,7 @@ sub_802D598: ; 802D598 bl sub_802DA44 cmp r0, 0 bne @0802D5DE - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D5DE @@ -70507,7 +70507,7 @@ sub_802D5E4: ; 802D5E4 b @0802D664 .pool @0802D640: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D67E @@ -70520,7 +70520,7 @@ sub_802D5E4: ; 802D5E4 movs r2, 0xE bl sub_8098858 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @0802D664: ldr r1, [r5] ldrh r0, [r1, 0x4] @@ -70528,7 +70528,7 @@ sub_802D5E4: ; 802D5E4 strh r0, [r1, 0x4] b @0802D67E @0802D66E: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D67E @@ -70587,7 +70587,7 @@ sub_802D688: ; 802D688 b @0802D708 .pool @0802D6E4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D722 @@ -70600,7 +70600,7 @@ sub_802D688: ; 802D688 movs r2, 0xE bl sub_8098858 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @0802D708: ldr r1, [r5] ldrh r0, [r1, 0x4] @@ -70608,7 +70608,7 @@ sub_802D688: ; 802D688 strh r0, [r1, 0x4] b @0802D722 @0802D712: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802D722 @@ -70921,7 +70921,7 @@ sub_802D974: ; 802D974 beq @0802DA02 b @0802DA0C @0802D99A: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802DA0C @@ -70934,14 +70934,14 @@ sub_802D974: ; 802D974 movs r2, 0xE bl sub_8098858 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r1, [r4] ldrb r0, [r1, 0xD] adds r0, 0x1 strb r0, [r1, 0xD] b @0802DA0C @0802D9C8: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802DA0C @@ -71023,7 +71023,7 @@ sub_802DA44: ; 802DA44 ldrb r0, [r1, 0xD] cmp r0, 0 bne @0802DA7E - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802DA82 @@ -71303,7 +71303,7 @@ sub_802DC9C: ; 802DC9C lsls r1, 13 movs r0, 0x2 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY pop {r4} pop {r0} bx r0 @@ -71567,7 +71567,7 @@ sub_802DE1C: ; 802DE1C blt @0802DE6A @0802DEAC: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x8 pop {r4-r7} pop {r0} @@ -71723,7 +71723,7 @@ sub_802DFD4: ; 802DFD4 blt @0802DFE4 @0802DFFA: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r4,r5} pop {r0} bx r0 @@ -71744,7 +71744,7 @@ sub_802E00C: ; 802E00C lsls r1, 16 movs r0, 0x1 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 ands r4, r0 lsls r4, 8 @@ -71752,9 +71752,9 @@ sub_802E00C: ; 802E00C lsls r4, 8 adds r1, r4, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =sub_802E090 movs r1, 0x4 bl AddTask @@ -71779,7 +71779,7 @@ sub_802E058: ; 802E058 movs r0, 0x1 movs r1, 0x80 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY ldr r1, [r4] ldr r0, [r1, 0x18] adds r0, 0x1 @@ -71787,7 +71787,7 @@ sub_802E058: ; 802E058 cmp r0, 0x1F bls @0802E088 movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg @0802E088: movs r0, 0x1 @0802E08A: @@ -72350,7 +72350,7 @@ sub_802E3E4: ; 802E3E4 b @0802E4CA .pool @0802E4A8: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802E4F6 @@ -72375,7 +72375,7 @@ sub_802E3E4: ; 802E3E4 b @0802E4F6 .pool @0802E4DC: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0802E4F6 @@ -78273,7 +78273,7 @@ gpu_tile_obj_decompress_and_load3: ; 8034988 ldr r0, [r4] ldr r0, [r0] lsrs r0, 8 - bl malloc_and_clear + bl AllocZeroed adds r5, r0, 0 ldr r0, [r4] adds r1, r5, 0 @@ -78287,7 +78287,7 @@ gpu_tile_obj_decompress_and_load3: ; 8034988 mov r0, sp bl gpu_tile_obj_alloc_tag_and_copy_to_vram adds r0, r5, 0 - bl free + bl Free movs r0, 0 add sp, 0x8 pop {r4,r5} @@ -78304,7 +78304,7 @@ gpu_pal_obj_decompress_and_apply3: ; 80349C4 ldr r0, [r4] ldr r0, [r0] lsrs r0, 8 - bl malloc_and_clear + bl AllocZeroed adds r5, r0, 0 ldr r0, [r4] adds r1, r5, 0 @@ -78319,7 +78319,7 @@ gpu_pal_obj_decompress_and_apply3: ; 80349C4 mov r0, sp bl gpu_pal_obj_alloc_tag_and_apply adds r0, r5, 0 - bl free + bl Free movs r0, 0 add sp, 0x8 pop {r4,r5} @@ -78654,7 +78654,7 @@ sub_8034C54: ; 8034C54 bl sub_8034CC8 @08034C64: movs r0, 0x8 - bl malloc + bl Alloc str r0, [r5] cmp r0, 0 bne @08034C78 @@ -78665,13 +78665,13 @@ sub_8034C54: ; 8034C54 lsls r0, r4, 3 subs r0, r4 lsls r0, 2 - bl malloc + bl Alloc ldr r1, [r5] str r0, [r1, 0x4] cmp r0, 0 bne @08034C94 adds r0, r1, 0 - bl free + bl Free movs r0, 0 b @08034CC0 @08034C94: @@ -78732,11 +78732,11 @@ sub_8034CC8: ; 8034CC8 ldr r0, =0x02022e10 ldr r0, [r0] ldr r0, [r0, 0x4] - bl free + bl Free @08034CFC: ldr r4, =0x02022e10 ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] @08034D08: @@ -79932,7 +79932,7 @@ sub_8035608: ; 8035608 orrs r0, r2 strb r0, [r1] ldr r0, =sub_8035648 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -79951,11 +79951,11 @@ sub_8035648: ; 8035648 trs_config: ; 8035658 push {r4,lr} movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0831AA08 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 @@ -79970,10 +79970,10 @@ trs_config: ; 8035658 ldr r4, =0x02023060 ldr r1, [r4] movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap b @080356AA .pool @080356A4: @@ -80000,22 +80000,22 @@ trs_config: ; 8035658 c2_berry_program_update_menu: ; 80356D0 push {lr} movs r0, 0x2 - bl disable_irqs + bl DisableInterrupts movs r0, 0xC5 - bl enable_irqs + bl EnableInterrupts bl trs_config movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000b040 movs r0, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -80316,9 +80316,9 @@ sub_8035AA4: ; 8035AA4 movs r0, 0 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =gUnknown_08C004E0 movs r1, 0 movs r2, 0x40 @@ -80449,9 +80449,9 @@ sub_8035AE4: ; 8035AE4 add r1, sp, 0xC mov r2, r12 mov r3, r9 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette mov r0, r8 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @08035C36 .pool @08035BCC: @@ -80503,9 +80503,9 @@ sub_8035AE4: ; 8035AE4 add r1, sp, 0xC mov r2, r12 mov r3, r9 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette mov r0, r8 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @08035C36: add sp, 0x18 pop {r3,r4} @@ -81117,31 +81117,31 @@ sub_8036154: ; 8036154 movs r0, 0x1 movs r1, 0x3 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r1, =0x00005c04 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg ldr r4, =gUnknown_08D779D8 movs r0, 0x1 adds r1, r4, 0 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x2 adds r1, r4, 0 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x48 movs r1, 0x36 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x36 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1a ldr r2, =0x0000ff5c adds r1, r2, 0 @@ -81178,25 +81178,25 @@ sub_8036154: ; 8036154 movs r0, 0x1 movs r1, 0x1 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 movs r1, 0x1 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r1, =gUnknown_08D857A8 movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r1, =gUnknown_08D85A1C movs r0, 0x2 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080363AC .pool @0803628C: @@ -81345,9 +81345,9 @@ sub_80363C4: ; 80363C4 movs r0, 0 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @08036758 .pool @08036424: @@ -81730,12 +81730,12 @@ sub_8036760: ; 8036760 bne @080367B4 bl battle_wireless_setup_if_required_maybe ldr r0, =sub_8037ADC - bl set_callback2 + bl SetMainCallback2 b @080367BA .pool @080367B4: ldr r0, =intro_end - bl set_callback2 + bl SetMainCallback2 @080367BA: ldr r1, =0x02024332 movs r0, 0 @@ -81766,19 +81766,19 @@ sub_80367D4: ; 80367D4 bl CpuSet movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0xF0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00005051 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e24 movs r2, 0xF0 strh r2, [r0] @@ -81902,7 +81902,7 @@ sub_80367D4: ; 80367D4 bne @08036994 @0803693E: ldr r0, =sub_8037458 - bl set_callback2 + bl SetMainCallback2 b @080369AE .pool @08036994: @@ -81911,12 +81911,12 @@ sub_80367D4: ; 80367D4 cmp r2, 0 beq @080369A8 ldr r0, =sub_8037DF4 - bl set_callback2 + bl SetMainCallback2 b @080369AE .pool @080369A8: ldr r0, =sub_8036FAC - bl set_callback2 + bl SetMainCallback2 @080369AE: ldr r5, =0x02022fec ldr r0, [r5] @@ -82712,18 +82712,18 @@ sub_8036FAC: ; 8036FAC .4byte @080373A0 .4byte @080373E0 @0803703C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @08037068 movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg bl sub_805EF14 ldr r1, =0x02024332 movs r0, 0x1 @@ -83094,7 +83094,7 @@ sub_8036FAC: ; 8036FAC ldr r0, =sub_8039EF0 str r0, [r1] ldr r0, =sub_8038420 - bl set_callback2 + bl SetMainCallback2 ldr r2, =0x02022fec ldr r1, [r2] movs r0, 0x2 @@ -83180,18 +83180,18 @@ sub_8037458: ; 8037458 .4byte @0803795C .4byte @080379A0 @080374E0: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0803750C movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg bl sub_805EF14 ldr r1, =0x02024332 movs r0, 0x1 @@ -83694,7 +83694,7 @@ sub_8037458: ; 8037458 ldr r0, =sub_8039EF0 str r0, [r1] ldr r0, =sub_8038420 - bl set_callback2 + bl SetMainCallback2 ldr r2, =0x02022fec ldr r1, [r2] movs r0, 0x2 @@ -83888,7 +83888,7 @@ sub_8037ADC: ; 8037ADC @08037B74: ldr r4, =0x02023058 movs r0, 0x60 - bl malloc + bl Alloc str r0, [r4] movs r0, 0 bl sub_80379F8 @@ -84030,10 +84030,10 @@ sub_8037ADC: ; 8037ADC ldr r0, [r2] str r0, [r1, 0x8] ldr r0, =sub_80367D4 - bl set_callback2 + bl SetMainCallback2 ldr r4, =0x02023058 ldr r0, [r4] - bl free + bl Free mov r0, r8 str r0, [r4] b @08037D0A @@ -84051,10 +84051,10 @@ sub_8037ADC: ; 8037ADC ldr r0, [r2] str r0, [r1, 0x8] ldr r0, =sub_80367D4 - bl set_callback2 + bl SetMainCallback2 ldr r4, =0x02023058 ldr r0, [r4] - bl free + bl Free str r5, [r4] @08037D0A: add sp, 0x4 @@ -84094,7 +84094,7 @@ intro_end: ; 8037D2C @08037D64: ldr r4, =0x02023058 movs r0, 0x60 - bl malloc + bl Alloc str r0, [r4] movs r0, 0x3 bl sub_80379F8 @@ -84132,10 +84132,10 @@ intro_end: ; 8037D2C ldr r0, [r2] str r0, [r1, 0x8] ldr r0, =sub_80367D4 - bl set_callback2 + bl SetMainCallback2 ldr r4, =0x02023058 ldr r0, [r4] - bl free + bl Free str r6, [r4] @08037DD6: pop {r3} @@ -84187,18 +84187,18 @@ sub_8037DF4: ; 8037DF4 .4byte @0803836C .4byte @080383BC @08037E64: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @08037E90 movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg bl sub_805EF14 ldr r1, =0x02024332 movs r0, 0x1 @@ -84825,7 +84825,7 @@ sub_8037DF4: ; 8037DF4 ldr r0, =sub_8039EF0 str r0, [r1] ldr r0, =sub_8038420 - bl set_callback2 + bl SetMainCallback2 ldr r3, =0x02022fec ldr r2, [r3] movs r0, 0x2 @@ -84891,7 +84891,7 @@ sub_8038420: ; 8038420 movs r3, 0x10 bl pal_fade_maybe ldr r0, =sub_80384E4 - bl set_callback2 + bl SetMainCallback2 @08038482: add sp, 0x4 pop {r0} @@ -84945,7 +84945,7 @@ sub_80384E4: ; 80384E4 bl FreeAllWindowBuffers ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 @08038512: pop {r0} bx r0 @@ -85046,7 +85046,7 @@ sub_8038538: ; 8038538 cmp r0, 0x14 bne @080385DC ldr r0, =sub_8036760 - bl set_callback2 + bl SetMainCallback2 @080385DC: pop {r4,r5} pop {r0} @@ -85593,7 +85593,7 @@ sub_8038A04: ; 8038A04 movs r1, 0x98 lsls r1, 8 movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg @08038A1E: pop {r0} bx r0 @@ -85614,51 +85614,51 @@ vblank_cb_08078BB4: ; 8038A28 ldr r0, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1c ldrh r1, [r0] movs r0, 0x18 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1e ldrh r1, [r0] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e20 ldrh r1, [r0] movs r0, 0x1C - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e22 ldrh r1, [r0] movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e24 ldrh r1, [r0] movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e26 ldrh r1, [r0] movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e28 ldrh r1, [r0] movs r0, 0x42 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e2a ldrh r1, [r0] movs r0, 0x46 - bl lcd_io_set + bl SetGpuReg bl copy_super_sprites_to_oam bl copy_queue_process bl copy_pal_bg_faded_to_pal_ram @@ -85995,7 +85995,7 @@ sub_8038D64: ; 8038D64 beq @08038DAC ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 bl sub_8057028 bl dp11_free bl sub_805F094 @@ -86010,20 +86010,20 @@ sub_8038D64: ; 8038D64 bl CpuSet movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0xF0 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x00005051 movs r0, 0x44 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x02022e24 movs r0, 0xF0 strh r0, [r1] @@ -86088,7 +86088,7 @@ sub_8038D64: ; 8038D64 bl sub_8036154 movs r0, 0x4A movs r1, 0x37 - bl lcd_io_set + bl SetGpuReg bl gpu_pal_allocator_reset ldr r1, =0x0300301c movs r0, 0x4 @@ -86114,7 +86114,7 @@ sub_8038D64: ; 8038D64 strh r2, [r1, 0x12] bl sub_8038B94 ldr r0, =sub_8038F14 - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x02024332 strb r4, [r0] @08038EB6: @@ -86169,11 +86169,11 @@ sub_8038F34: ; 8038F34 .4byte @08039184 @08038F80: movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x02024332 movs r0, 0xFF strb r0, [r1, 0x1] @@ -86266,7 +86266,7 @@ sub_8038F34: ; 8038F34 beq @08039074 bl FreeAllWindowBuffers ldr r0, =sub_80392A8 - bl set_callback2 + bl SetMainCallback2 b @080391C6 .pool @08039074: @@ -86295,7 +86295,7 @@ sub_8038F34: ; 8038F34 ldr r0, =0x030022c0 ldr r0, [r0, 0x8] @080390B0: - bl set_callback2 + bl SetMainCallback2 bl sub_8057028 bl dp11_free bl sub_805F094 @@ -86412,7 +86412,7 @@ sub_8038F34: ; 8038F34 ands r0, r1 strb r0, [r2] ldr r0, [r3, 0x8] - bl set_callback2 + bl SetMainCallback2 bl sub_8057028 bl dp11_free bl sub_805F094 @@ -86552,7 +86552,7 @@ sub_80392A8: ; 80392A8 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg bl sub_803570C @080392FE: lsls r0, r4, 24 @@ -86570,7 +86570,7 @@ sub_80392A8: ; 80392A8 ldr r0, =vblank_cb_08078BB4 bl SetVBlankCallback ldr r0, =sub_803937C - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 negs r0, r0 movs r4, 0 @@ -86635,11 +86635,11 @@ sub_803939C: ; 803939C .4byte @08039704 @080393F4: movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 @@ -86895,7 +86895,7 @@ sub_803939C: ; 803939C b @0803975E @08039650: ldr r0, [r3, 0x8] - bl set_callback2 + bl SetMainCallback2 bl sub_8057028 bl dp11_free bl sub_805F094 @@ -95243,7 +95243,7 @@ c4_overworld: ; 803DF70 bl m4aSongNumStop ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 @0803DFEC: pop {r4-r6} pop {r0} @@ -125809,9 +125809,9 @@ atk6C_8026208: ; 804EF04 movs r0, 0x2 movs r1, 0x7 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg bl sub_804F17C ldr r1, =0x02024474 movs r0, 0x2 @@ -125842,15 +125842,15 @@ atk6C_8026208: ; 804EF04 movs r0, 0 movs r1, 0x7 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x1 movs r1, 0x7 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x80 str r0, [sp] movs r0, 0x12 @@ -125872,7 +125872,7 @@ atk6C_8026208: ; 804EF04 bl CopyWindowToVram b @0804F06A @0804F014: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -125933,31 +125933,31 @@ atk6C_8026208: ; 804EF04 movs r0, 0x2 movs r1, 0x7 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x02024474 movs r0, 0xA strb r0, [r1, 0x1E] b @0804F0F2 .pool @0804F0C0: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0804F0F2 movs r0, 0 movs r1, 0x7 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x1 movs r1, 0x7 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 @@ -126060,7 +126060,7 @@ sub_804F17C: ; 804F17C thumb_func_start sub_804F1CC sub_804F1CC: ; 804F1CC push {r4,r5,lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @0804F1DC @@ -139860,7 +139860,7 @@ sub_80568CC: ; 80568CC b @08056A06 .pool @080569E0: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -139872,9 +139872,9 @@ sub_80568CC: ; 80568CC movs r3, 0 bl pal_fade_maybe movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg @08056A06: ldr r1, =0x02024332 @08056A08: @@ -140023,7 +140023,7 @@ sub_8056A3C: ; 8056A3C add r1, sp, 0xC mov r7, r9 lsrs r3, r7, 24 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette b @08056B50 .pool @08056B38: @@ -140037,7 +140037,7 @@ sub_8056A3C: ; 8056A3C add r1, sp, 0xC mov r7, r9 lsrs r3, r7, 24 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette @08056B50: adds r4, 0x1 ldr r0, [sp, 0x1C] @@ -140082,9 +140082,9 @@ sub_8056B74: ; 8056B74 movs r0, 0 add r1, sp, 0xC movs r2, 0x19 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x10 pop {r0} bx r0 @@ -140113,9 +140113,9 @@ sub_8056BAC: ; 8056BAC movs r0, 0 add r1, sp, 0xC movs r2, 0x19 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x10 pop {r0} bx r0 @@ -140499,61 +140499,61 @@ sub_8056F28: ; 8056F28 ldr r4, =0x0202449c movs r0, 0xA9 lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r0, 0x20 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] movs r0, 0xA0 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r5] str r0, [r1] movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r5] str r0, [r1, 0x4] movs r0, 0x24 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r5] str r0, [r1, 0x8] movs r0, 0x24 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r5] str r0, [r1, 0xC] movs r0, 0xC - bl malloc_and_clear + bl AllocZeroed ldr r1, [r5] str r0, [r1, 0x10] movs r0, 0x1C - bl malloc_and_clear + bl AllocZeroed ldr r1, [r5] str r0, [r1, 0x14] movs r0, 0x54 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r5] str r0, [r1, 0x18] movs r0, 0x24 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r5] str r0, [r1, 0x1C] ldr r4, =0x020244a0 movs r5, 0x80 lsls r5, 5 adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r4, =0x020244a4 adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r4, =0x0202305c movs r0, 0x80 lsls r0, 6 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r4, =0x02023060 adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r0, [r6] movs r1, 0x80 @@ -140599,59 +140599,59 @@ sub_8057028: ; 8057028 beq @080570D0 ldr r4, =0x0202449c ldr r0, [r4] - bl free + bl Free movs r5, 0 str r5, [r4] ldr r0, [r6] ldr r0, [r0] - bl free + bl Free ldr r0, [r6] str r5, [r0] ldr r0, [r0, 0x4] - bl free + bl Free ldr r0, [r6] str r5, [r0, 0x4] ldr r0, [r0, 0x8] - bl free + bl Free ldr r0, [r6] str r5, [r0, 0x8] ldr r0, [r0, 0xC] - bl free + bl Free ldr r0, [r6] str r5, [r0, 0xC] ldr r0, [r0, 0x10] - bl free + bl Free ldr r0, [r6] str r5, [r0, 0x10] ldr r0, [r0, 0x14] - bl free + bl Free ldr r0, [r6] str r5, [r0, 0x14] ldr r0, [r0, 0x18] - bl free + bl Free ldr r0, [r6] str r5, [r0, 0x18] ldr r0, [r0, 0x1C] - bl free + bl Free ldr r0, [r6] str r5, [r0, 0x1C] - bl free + bl Free str r5, [r6] ldr r4, =0x020244a0 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x020244a4 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0202305c ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x02023060 ldr r0, [r4] - bl free + bl Free str r5, [r4] @080570D0: pop {r4-r6} @@ -143191,7 +143191,7 @@ sub_80586F8: ; 80586F8 ldr r0, [r0] str r0, [r3] ldr r0, =sub_8038D64 - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x0202433a ldrb r0, [r0] cmp r0, 0x1 @@ -143220,7 +143220,7 @@ sub_80586F8: ; 80586F8 ldr r0, [r0] str r0, [r3] ldr r0, =sub_8038D64 - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x0202433a ldrb r0, [r0] cmp r0, 0x1 @@ -143287,7 +143287,7 @@ sub_80587B0: ; 80587B0 ldr r0, [r0] str r0, [r2] ldr r0, [r2, 0x8] - bl set_callback2 + bl SetMainCallback2 @08058832: pop {r0} bx r0 @@ -145568,9 +145568,9 @@ battle_menu_cursor_related_2: ; 8059C28 str r0, [sp, 0x8] movs r0, 0 add r1, sp, 0xC - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x10 pop {r0} bx r0 @@ -145602,9 +145602,9 @@ battle_menu_cursor_related: ; 8059C70 str r0, [sp, 0x8] movs r0, 0 add r1, sp, 0xC - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x10 pop {r0} bx r0 @@ -145638,9 +145638,9 @@ sub_8059CB4: ; 8059CB4 str r0, [sp, 0x8] movs r0, 0 add r1, sp, 0xC - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x10 pop {r4} pop {r0} @@ -145675,9 +145675,9 @@ sub_8059CF8: ; 8059CF8 str r0, [sp, 0x8] movs r0, 0 add r1, sp, 0xC - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x10 pop {r0} bx r0 @@ -145688,7 +145688,7 @@ sub_8059CF8: ; 8059CF8 sub_8059D40: ; 8059D40 push {lr} ldr r0, =sub_80A92F8 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -145698,7 +145698,7 @@ sub_8059D40: ; 8059D40 sub_8059D50: ; 8059D50 push {lr} ldr r0, =sub_80A92F8 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -149548,7 +149548,7 @@ dp01t_11_1_message_for_player_only: ; 805BFE0 thumb_func_start sub_805C004 sub_805C004: ; 805C004 push {lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -149656,7 +149656,7 @@ sub_805C0B0: ; 805C0B0 thumb_func_start sub_805C114 sub_805C114: ; 805C114 push {lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -151471,22 +151471,22 @@ dp11_init: ; 805D118 push {r4,lr} ldr r4, =0x020244d0 movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1] movs r0, 0x30 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x4] movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x8] movs r0, 0x50 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0xC] pop {r4} @@ -151503,23 +151503,23 @@ dp11_free: ; 805D158 cmp r0, 0 beq @0805D192 ldr r0, [r0, 0xC] - bl free + bl Free ldr r0, [r5] movs r4, 0 str r4, [r0, 0xC] ldr r0, [r0, 0x8] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x8] ldr r0, [r0, 0x4] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x4] ldr r0, [r0] - bl free + bl Free ldr r0, [r5] str r4, [r0] - bl free + bl Free str r4, [r5] @0805D192: pop {r4,r5} @@ -155073,11 +155073,11 @@ init_uns_table_pokemon_copy: ; 805EFBC str r6, [r4] movs r0, 0xC0 lsls r0, 1 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r0, 0x80 lsls r0, 8 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1] @0805EFE2: @@ -155152,7 +155152,7 @@ init_uns_table_pokemon_copy: ; 805EFBC bls @0805EFE2 movs r0, 0x80 lsls r0, 5 - bl malloc_and_clear + bl AllocZeroed ldr r1, =0x020244d4 ldr r1, [r1] movs r2, 0xBA @@ -155182,7 +155182,7 @@ sub_805F094: ; 805F094 ldr r0, [r0] cmp r0, 0 beq @0805F0BA - bl free + bl Free ldr r0, [r6] movs r1, 0xBE lsls r1, 1 @@ -155197,7 +155197,7 @@ sub_805F094: ; 805F094 ldr r0, [r0] cmp r0, 0 beq @0805F0D8 - bl free + bl Free ldr r0, [r6] movs r1, 0xBC lsls r1, 1 @@ -155210,20 +155210,20 @@ sub_805F094: ; 805F094 lsls r5, 1 adds r0, r5 ldr r0, [r0] - bl free + bl Free ldr r0, [r6] adds r5, r0, r5 movs r4, 0 str r4, [r5] ldr r0, [r0] - bl free + bl Free ldr r0, [r6] str r4, [r0] str r4, [r0, 0x4] str r4, [r0, 0x8] str r4, [r0, 0xC] str r4, [r0, 0x10] - bl free + bl Free str r4, [r6] @0805F106: pop {r4-r6} @@ -161926,7 +161926,7 @@ sub_8062BB0: ; 8062BB0 ldr r0, [r0] str r0, [r2] ldr r0, [r2, 0x8] - bl set_callback2 + bl SetMainCallback2 @08062BDA: bl dp01_tbl7_exec_completed pop {r0} @@ -173102,7 +173102,7 @@ sub_8068B48: ; 8068B48 lsls r2, 1 adds r2, r0 ldrh r0, [r2] - bl sub_806EFF0 + bl TrainerClassToTrainerPic lsls r0, 16 lsrs r0, 16 pop {r1} @@ -185706,8 +185706,9 @@ sub_806EF84: ; 806EF84 bx r1 thumb_func_end sub_806EF84 - thumb_func_start sub_806EFF0 -sub_806EFF0: ; 806EFF0 + thumb_func_start TrainerClassToTrainerPic +; u8 TrainerClassToTrainerPic(u16 trainerClassId) +TrainerClassToTrainerPic: ; 806EFF0 lsls r0, 16 lsrs r0, 16 ldr r1, =gTrainerPicIndices @@ -185715,7 +185716,7 @@ sub_806EFF0: ; 806EFF0 ldrb r0, [r0] bx lr .pool - thumb_func_end sub_806EFF0 + thumb_func_end TrainerClassToTrainerPic thumb_func_start sub_806F000 sub_806F000: ; 806F000 @@ -185728,7 +185729,7 @@ sub_806F000: ; 806F000 @0806F00C: movs r0, 0x3F @0806F00E: - bl sub_806EFF0 + bl TrainerClassToTrainerPic lsls r0, 16 lsrs r0, 16 pop {r1} @@ -186091,7 +186092,7 @@ sub_806F2AC: ; 806F2AC movs r0, 0x1 ands r6, r0 movs r0, 0x14 - bl malloc_and_clear + bl AllocZeroed adds r4, r0, 0 cmp r4, 0 bne @0806F2D0 @@ -186138,12 +186139,12 @@ sub_806F2AC: ; 806F2AC lsls r0, 28 lsrs r0, 15 muls r0, r1 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0x4] ldrb r0, [r4] lsls r0, 28 lsrs r0, 23 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 str r1, [r4, 0x8] ldr r2, [r4, 0x4] @@ -186192,7 +186193,7 @@ sub_806F2AC: ; 806F2AC lsls r0, r1, 1 adds r0, r1 lsls r0, 3 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0xC] ldrb r1, [r4] lsls r1, 28 @@ -186200,7 +186201,7 @@ sub_806F2AC: ; 806F2AC ldrb r0, [r4, 0x1] lsls r0, 3 muls r0, r1 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 str r1, [r4, 0x10] ldr r0, [r4, 0xC] @@ -186263,14 +186264,14 @@ sub_806F2AC: ; 806F2AC ldr r0, [r4, 0x10] cmp r0, 0 beq @0806F416 - bl free + bl Free movs r0, 0 str r0, [r4, 0x10] @0806F416: ldr r0, [r4, 0xC] cmp r0, 0 beq @0806F424 - bl free + bl Free movs r0, 0 str r0, [r4, 0xC] @0806F424: @@ -186281,14 +186282,14 @@ sub_806F2AC: ; 806F2AC ldr r0, [r4, 0x8] cmp r0, 0 beq @0806F43A - bl free + bl Free movs r0, 0 str r0, [r4, 0x8] @0806F43A: ldr r0, [r4, 0x4] cmp r0, 0 beq @0806F448 - bl free + bl Free movs r0, 0 str r0, [r4, 0x4] @0806F448: @@ -186299,7 +186300,7 @@ sub_806F2AC: ; 806F2AC movs r2, 0x14 bl memset adds r0, r4, 0 - bl free + bl Free b @0806F468 @0806F45E: movs r0, 0xA3 @@ -186346,28 +186347,28 @@ sub_806F47C: ; 806F47C ldr r0, [r4, 0x10] cmp r0, 0 beq @0806F4B6 - bl free + bl Free movs r0, 0 str r0, [r4, 0x10] @0806F4B6: ldr r0, [r4, 0xC] cmp r0, 0 beq @0806F4C4 - bl free + bl Free movs r0, 0 str r0, [r4, 0xC] @0806F4C4: ldr r0, [r4, 0x8] cmp r0, 0 beq @0806F4D2 - bl free + bl Free movs r0, 0 str r0, [r4, 0x8] @0806F4D2: ldr r0, [r4, 0x4] cmp r0, 0 beq @0806F4E0 - bl free + bl Free movs r0, 0 str r0, [r4, 0x4] @0806F4E0: @@ -186376,7 +186377,7 @@ sub_806F47C: ; 806F47C movs r2, 0x14 bl memset adds r0, r4, 0 - bl free + bl Free @0806F4F0: pop {r4} pop {r0} @@ -190776,7 +190777,7 @@ sub_8071760: ; 8071760 bne @08071788 bl overworld_free_bg_tilemaps ldr r0, =c1_hatching_egg - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x03005dac ldr r0, =sub_80AF168 str r0, [r1] @@ -190822,10 +190823,10 @@ c1_hatching_egg: ; 80717A0 @080717EC: movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x03000de0 movs r0, 0x14 - bl malloc + bl Alloc str r0, [r4] bl init_uns_table_pokemon_copy ldr r2, [r4] @@ -190842,43 +190843,43 @@ c1_hatching_egg: ; 80717A0 strh r0, [r1] bl reset_temp_tile_data_buffers movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0832C064 movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0x7 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x80 lsls r0, 5 - bl malloc + bl Alloc adds r1, r0, 0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0x80 lsls r0, 6 - bl malloc + bl Alloc adds r1, r0, 0 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap bl DeactivateAllTextPrinters bl sub_80A1A74 bl gpu_pal_allocator_reset @@ -190908,7 +190909,7 @@ c1_hatching_egg: ; 80717A0 movs r0, 0 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r0, =gUnknown_08C004E0 movs r1, 0 movs r2, 0x20 @@ -190926,7 +190927,7 @@ c1_hatching_egg: ; 80717A0 .pool @08071924: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =0x03000de0 ldr r0, [r0] ldrb r0, [r0, 0x4] @@ -190959,7 +190960,7 @@ c1_hatching_egg: ; 80717A0 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_08DD7300 movs r1, 0x10 movs r2, 0xA0 @@ -190969,15 +190970,15 @@ c1_hatching_egg: ; 80717A0 lsls r2, 5 movs r0, 0x1 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, =gUnknown_08331F60 movs r2, 0x80 lsls r2, 5 movs r0, 0x1 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @080719A6: ldr r1, =0x030022c0 movs r0, 0x87 @@ -190990,7 +190991,7 @@ c1_hatching_egg: ; 80717A0 .pool @080719C8: ldr r0, =sub_8071A94 - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x03000de0 ldr r1, [r0] movs r0, 0 @@ -191023,9 +191024,9 @@ sub_80719FC: ; 80719FC bl sub_805F094 ldr r0, =0x03000de0 ldr r0, [r0] - bl free + bl Free ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -191127,9 +191128,9 @@ sub_8071A94: ; 8071A94 ldr r1, [r4] strb r0, [r1] movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg ldr r1, [r4] ldrb r0, [r1, 0x2] adds r0, 0x1 @@ -191439,13 +191440,13 @@ sub_8071A94: ; 8071A94 ldrb r0, [r0, 0x8] bl RemoveWindow movs r0, 0 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap ldr r0, [r4] - bl free + bl Free ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 @08071E06: bl run_active_tasks bl RunTextPrinters @@ -195132,10 +195133,10 @@ sub_8073C30: ; 8073C30 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x03005e00 ldr r0, [sp, 0xC] add r0, r8 @@ -195349,7 +195350,7 @@ task_battle_throw_own_ball: ; 8073E08 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @08073E48: movs r1, 0x26 ldrsh r0, [r4, r1] @@ -195496,10 +195497,10 @@ sub_8073E64: ; 8073E64 strb r0, [r1] movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl remove_task @08073F8A: @@ -195537,7 +195538,7 @@ sub_8073F98: ; 8073F98 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @0807406A .pool @08073FD4: @@ -195606,10 +195607,10 @@ sub_8073F98: ; 8073F98 strb r0, [r1] movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl remove_task @0807406A: @@ -200866,9 +200867,9 @@ sub_8076B14: ; 8076B14 .pool 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 + thumb_func_start CheckForFlashMemory +; void CheckForFlashMemory() +CheckForFlashMemory: ; 8076B68 push {lr} bl IdentifyFlash lsls r0, 16 @@ -200877,7 +200878,7 @@ flash_timeout_start_on_timer_2_when_flash_present: ; 8076B68 ldr r1, =0x03005d88 movs r0, 0x1 str r0, [r1] - bl flash_timeout_start_on_timer_2 + bl StartFlashMemoryTimer b @08076B8A .pool @08076B84: @@ -200888,7 +200889,7 @@ flash_timeout_start_on_timer_2_when_flash_present: ; 8076B68 pop {r0} bx r0 .pool - thumb_func_end flash_timeout_start_on_timer_2_when_flash_present + thumb_func_end CheckForFlashMemory thumb_func_start memclr_stdsav2 memclr_stdsav2: ; 8076B94 @@ -201020,7 +201021,7 @@ saveblock_randomize_and_relocate: ; 8076C2C movs r1, 0xE0 lsls r1, 9 adds r0, r4, 0 - bl init_malloc + bl InitHeap ldr r0, [sp, 0x4] str r0, [r5, 0x10] ldr r1, [sp] @@ -201805,18 +201806,18 @@ sub_80772A4: ; 80772A4 movs r2, 0x14 bl gpu_pal_apply movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0832DEE4 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =0x0203229c ldr r1, [r0] movs r0, 0x8F lsls r0, 4 adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r0, =gUnknown_0832DEF4 bl InitWindows lsls r0, 16 @@ -201845,7 +201846,7 @@ sub_80772A4: ; 80772A4 movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0 movs r1, 0x14 movs r2, 0xC0 @@ -201893,7 +201894,7 @@ sub_80772A4: ; 80772A4 sub_80773AC: ; 80773AC push {lr} ldr r0, =sub_80773D0 - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x030022c0 movs r1, 0 str r1, [r0] @@ -201954,13 +201955,13 @@ sub_80773D0: ; 80773D0 @08077458: ldr r4, =0x0203229c ldr r0, =0x000010f0 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] bl sub_80772A4 ldr r4, =0x02032184 movs r0, 0xE0 lsls r0, 4 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r6, 0 ldr r2, =0x02032188 @@ -202005,7 +202006,7 @@ sub_80773D0: ; 80773D0 movs r0, 0 bl sub_807A19C movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =0x03003124 ldrb r2, [r0] cmp r2, 0 @@ -202198,10 +202199,10 @@ sub_80773D0: ; 80773D0 bl calc_enemy_party_count movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r2, =0x0203229c ldr r0, [r2] ldr r1, =0x020244e9 @@ -202653,7 +202654,7 @@ sub_80773D0: ; 80773D0 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x2 bl sub_80782B8 ldr r1, =0x030022c0 @@ -202696,7 +202697,7 @@ sub_80773D0: ; 80773D0 ldr r0, =sub_8078C34 str r0, [r3] ldr r0, =sub_807825C - bl set_callback2 + bl SetMainCallback2 @08077B46: bl RunTextPrinters bl run_active_tasks @@ -203276,7 +203277,7 @@ sub_8077B74: ; 8077B74 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x2 bl sub_80782B8 ldr r1, =0x030022c0 @@ -203311,7 +203312,7 @@ sub_8077B74: ; 8077B74 cmp r0, 0 bne @080780F6 ldr r0, =sub_807825C - bl set_callback2 + bl SetMainCallback2 @080780F6: bl run_active_tasks bl call_obj_callbacks @@ -203428,16 +203429,16 @@ sub_80781C8: ; 80781C8 beq @08078244 ldr r0, =0x02032184 ldr r0, [r0] - bl free + bl Free bl FreeAllWindowBuffers ldr r0, =0x0203229c ldr r0, [r0] - bl free + bl Free movs r0, 0 str r0, [r5] bl sub_800E084 ldr r0, =sub_807AE50 - bl set_callback2 + bl SetMainCallback2 b @08078244 .pool @08078220: @@ -203447,14 +203448,14 @@ sub_80781C8: ; 80781C8 bne @08078244 ldr r0, =0x02032184 ldr r0, [r0] - bl free + bl Free bl FreeAllWindowBuffers ldr r0, =0x0203229c ldr r0, [r0] - bl free + bl Free str r4, [r5] ldr r0, =sub_807AE50 - bl set_callback2 + bl SetMainCallback2 @08078244: pop {r4,r5} pop {r0} @@ -203479,7 +203480,7 @@ sub_807825C: ; 807825C lsls r1, 24 lsrs r1, 24 movs r0, 0x18 - bl lcd_io_set + bl SetGpuReg ldr r2, [r4] ldrb r1, [r2, 0x1] adds r0, r1, 0 @@ -203488,7 +203489,7 @@ sub_807825C: ; 807825C lsls r1, 24 lsrs r1, 24 movs r0, 0x1C - bl lcd_io_set + bl SetGpuReg bl sub_8197224 bl run_active_tasks bl call_obj_callbacks @@ -203527,7 +203528,7 @@ sub_80782B8: ; 80782B8 lsls r2, 5 movs r0, 0x1 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, =gUnknown_08DDCF04 movs r0, 0x20 str r0, [sp] @@ -203537,13 +203538,13 @@ sub_80782B8: ; 80782B8 movs r0, 0x1 movs r2, 0 movs r3, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette ldr r1, =gUnknown_0832CABC movs r2, 0x80 lsls r2, 4 movs r0, 0x2 movs r3, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap b @0807837E .pool @08078324: @@ -203552,13 +203553,13 @@ sub_80782B8: ; 80782B8 lsls r2, 4 movs r0, 0x3 movs r3, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap movs r0, 0 bl sub_8079E44 movs r0, 0x1 bl sub_8079E44 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0807837E .pool @0807834C: @@ -203568,7 +203569,7 @@ sub_80782B8: ; 80782B8 @08078352: lsrs r0, r5, 24 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x80 lsls r0, 18 adds r5, r0 @@ -203576,13 +203577,13 @@ sub_80782B8: ; 80782B8 cmp r4, 0 bge @08078352 movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg @0807837E: add sp, 0xC pop {r4,r5} @@ -205650,14 +205651,14 @@ sub_80794CC: ; 80794CC bne @0807953A ldr r0, =0x02032184 ldr r0, [r0] - bl free + bl Free ldr r0, =0x0203229c ldr r0, [r0] - bl free + bl Free bl FreeAllWindowBuffers bl sub_800E084 ldr r0, =c2_8056854 - bl set_callback2 + bl SetMainCallback2 b @0807953A .pool @08079518: @@ -205667,13 +205668,13 @@ sub_80794CC: ; 80794CC bne @0807953A ldr r0, =0x02032184 ldr r0, [r0] - bl free + bl Free ldr r0, =0x0203229c ldr r0, [r0] - bl free + bl Free bl FreeAllWindowBuffers ldr r0, =c2_8056854 - bl set_callback2 + bl SetMainCallback2 @0807953A: pop {r0} bx r0 @@ -206058,11 +206059,11 @@ sub_80796B4: ; 80796B4 str r0, [sp, 0x8] movs r0, 0x1 movs r3, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r1, [sp, 0x60] cmp r1, 0 beq @08079868 @@ -206112,9 +206113,9 @@ sub_80796B4: ; 80796B4 str r0, [sp, 0x8] movs r0, 0x1 movs r3, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r6, =0x02020630 ldr r1, =0x0203229c ldr r4, [r1] @@ -206555,9 +206556,9 @@ sub_8079C4C: ; 8079C4C movs r0, 0x1 adds r2, r4, 0 adds r3, r5, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram mov r0, r8 cmp r0, 0 bne @08079CB0 @@ -206946,9 +206947,9 @@ sub_8079F88: ; 8079F88 str r6, [sp, 0x8] movs r0, 0x1 movs r3, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram adds r0, r4, 0 bl sub_8079E44 adds r0, r4, 0 @@ -206989,9 +206990,9 @@ sub_807A000: ; 807A000 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x8 pop {r0} bx r0 @@ -207009,9 +207010,9 @@ sub_807A024: ; 807A024 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x8 pop {r0} bx r0 @@ -208485,37 +208486,37 @@ sub_807AB28: ; 807AB28 add r0, sp, 0x10 ldrh r1, [r0] movs r0, 0x20 - bl lcd_io_set + bl SetGpuReg add r0, sp, 0x10 ldrh r1, [r0, 0x2] movs r0, 0x22 - bl lcd_io_set + bl SetGpuReg add r0, sp, 0x10 ldrh r1, [r0, 0x4] movs r0, 0x24 - bl lcd_io_set + bl SetGpuReg add r0, sp, 0x10 ldrh r1, [r0, 0x6] movs r0, 0x26 - bl lcd_io_set + bl SetGpuReg ldr r1, [sp, 0x18] lsls r1, 16 lsrs r1, 16 movs r0, 0x28 - bl lcd_io_set + bl SetGpuReg ldr r1, [sp, 0x18] lsrs r1, 16 movs r0, 0x2A - bl lcd_io_set + bl SetGpuReg ldr r1, [sp, 0x1C] lsls r1, 16 lsrs r1, 16 movs r0, 0x2C - bl lcd_io_set + bl SetGpuReg ldr r1, [sp, 0x1C] lsrs r1, 16 movs r0, 0x2E - bl lcd_io_set + bl SetGpuReg add sp, 0x20 pop {r4,r5} pop {r0} @@ -208531,14 +208532,14 @@ sub_807ABCC: ; 807ABCC adds r0, 0xE0 ldrh r1, [r0] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] adds r0, 0xE2 ldrh r1, [r0] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl lcd_io_get + bl GetGpuReg lsls r0, 16 movs r1, 0xE0 lsls r1, 11 @@ -208549,12 +208550,12 @@ sub_807ABCC: ; 807ABCC adds r0, 0xE4 ldrh r1, [r0] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] adds r0, 0xE6 ldrh r1, [r0] movs r0, 0x18 - bl lcd_io_set + bl SetGpuReg b @0807AC1C .pool @0807AC18: @@ -208635,7 +208636,7 @@ sub_807AC64: ; 807AC64 bls @0807ACC4 bl sub_80097E8 ldr r0, =c2_800ACD4 - bl set_callback2 + bl SetMainCallback2 ldr r1, [r4] adds r3, r1, 0 adds r3, 0x8A @@ -208877,7 +208878,7 @@ sub_807AE50: ; 807AE50 movs r5, 0x80 lsls r5, 1 adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] bl init_uns_table_pokemon_copy bl clear_tasks @@ -209088,7 +209089,7 @@ sub_807AE50: ; 807AE50 movs r3, 0 bl pal_fade_maybe movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 @@ -209126,7 +209127,7 @@ sub_807AE50: ; 807AE50 bl sub_800DFB4 @0807B110: ldr r0, =sub_807EA2C - bl set_callback2 + bl SetMainCallback2 @0807B116: bl run_active_tasks bl RunTextPrinters @@ -209176,38 +209177,38 @@ sub_807B170: ; 807B170 sub sp, 0x4 movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_08339014 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r5, 0x80 lsls r5, 4 adds r0, r5, 0 - bl malloc + bl Alloc adds r1, r0, 0 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r5, 0 - bl malloc + bl Alloc adds r1, r0, 0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r5, 0 - bl malloc + bl Alloc adds r1, r0, 0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap bl DeactivateAllTextPrinters ldr r0, =gUnknown_08C00000 mov r10, r0 @@ -209227,7 +209228,7 @@ sub_807B170: ; 807B170 adds r1, r4, 0 adds r2, r5, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r6, =gUnknown_08C004E0 adds r0, r6, 0 movs r1, 0 @@ -209249,7 +209250,7 @@ sub_807B170: ; 807B170 adds r1, r4, 0 adds r2, r5, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer adds r0, r6, 0 movs r1, 0 movs r2, 0x20 @@ -209336,7 +209337,7 @@ sub_807B270: ; 807B270 movs r5, 0x80 lsls r5, 1 adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] bl init_uns_table_pokemon_copy bl clear_tasks @@ -209400,7 +209401,7 @@ sub_807B270: ; 807B270 movs r1, 0 bl sub_807ACFC movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg b @0807B424 @0807B3D0: movs r0, 0x1 @@ -209425,7 +209426,7 @@ sub_807B270: ; 807B270 .pool @0807B40C: movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg b @0807B424 @0807B414: movs r0, 0x5 @@ -209445,7 +209446,7 @@ sub_807B270: ; 807B270 .pool @0807B438: ldr r0, =sub_807B60C - bl set_callback2 + bl SetMainCallback2 @0807B43E: bl run_active_tasks bl RunTextPrinters @@ -209708,10 +209709,10 @@ sub_807B62C: ; 807B62C movs r1, 0xAA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00005206 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_08DD7300 movs r1, 0x10 movs r2, 0x60 @@ -209750,13 +209751,13 @@ sub_807B62C: ; 807B62C lsls r1, 1 strh r1, [r2] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00008502 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00009206 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] adds r0, 0xFA ldrb r0, [r0] @@ -209821,7 +209822,7 @@ sub_807B62C: ; 807B62C bne @0807B7C0 ldr r1, =0x00001241 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_083379A0 ldr r1, =0x06002800 bl LZ77UnCompVram @@ -209831,7 +209832,7 @@ sub_807B62C: ; 807B62C @0807B7C0: ldr r1, =0x00001241 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =gUnknown_0832FFC0 ldr r2, =0x06002800 ldr r0, =0x040000d4 @@ -209867,16 +209868,16 @@ sub_807B62C: ; 807B62C lsls r1, 5 @0807B820: movs r0, 0 - bl lcd_io_set + bl SetGpuReg b @0807BA68 .pool @0807B840: ldr r1, =0x00001441 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001287 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r0, =0x020322a0 ldr r3, [r0] adds r1, r3, 0 @@ -209960,10 +209961,10 @@ sub_807B62C: ; 807B62C @0807B924: ldr r1, =0x00001441 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001287 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r0, =0x020322a0 ldr r3, [r0] adds r1, r3, 0 @@ -210049,10 +210050,10 @@ sub_807B62C: ; 807B62C strh r2, [r0] movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00005206 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_08DD7300 movs r1, 0x10 movs r2, 0x60 @@ -210868,10 +210869,10 @@ sub_807BBEC: ; 807BBEC movs r1, 0xC8 lsls r1, 3 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000040c movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r1, [r7] bl @0807CF4C .pool @@ -210961,7 +210962,7 @@ sub_807BBEC: ; 807BBEC @0807C44E: ldr r1, =0x00001241 movs r0, 0 - bl lcd_io_set + bl SetGpuReg bl @0807CFB4 .pool @0807C460: @@ -211555,7 +211556,7 @@ sub_807BBEC: ; 807BBEC movs r1, 0x92 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 @@ -211850,7 +211851,7 @@ sub_807BBEC: ; 807BBEC movs r1, 0xA2 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 @@ -212078,7 +212079,7 @@ sub_807BBEC: ; 807BBEC movs r1, 0xAA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE966 adds r0, r4, 0 @@ -212264,21 +212265,21 @@ sub_807BBEC: ; 807BBEC beq @0807CFAA bl FreeAllWindowBuffers movs r0, 0x3 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free movs r0, 0x1 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free movs r0, 0 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free bl sub_805F094 ldr r0, [r7] - bl free + bl Free str r4, [r7] @0807CFAA: ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 bl sub_807E784 @0807CFB4: movs r0, 0 @@ -212929,11 +212930,11 @@ sub_807CFC8: ; 807CFC8 bl obj_delete_and_free_tiles ldr r1, =0x00000452 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x82 lsls r1, 3 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r0, =c3_08054588 movs r1, 0x5 bl AddTask @@ -213030,7 +213031,7 @@ sub_807CFC8: ; 807CFC8 @0807D84A: ldr r1, =0x00001241 movs r0, 0 - bl lcd_io_set + bl SetGpuReg bl @0807E400 .pool @0807D85C: @@ -213647,7 +213648,7 @@ sub_807CFC8: ; 807CFC8 movs r1, 0x92 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 @@ -213707,7 +213708,7 @@ sub_807CFC8: ; 807CFC8 movs r1, 0xB2 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x020322a0 ldr r2, [r4] adds r1, r2, 0 @@ -213955,7 +213956,7 @@ sub_807CFC8: ; 807CFC8 movs r1, 0xA2 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 @@ -214183,7 +214184,7 @@ sub_807CFC8: ; 807CFC8 movs r1, 0xAA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE966 adds r0, r4, 0 @@ -214369,21 +214370,21 @@ sub_807CFC8: ; 807CFC8 beq @0807E3F6 bl FreeAllWindowBuffers movs r0, 0x3 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free movs r0, 0x1 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free movs r0, 0 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free bl sub_805F094 ldr r0, [r7] - bl free + bl Free str r4, [r7] @0807E3F6: ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 bl sub_807E784 @0807E400: movs r0, 0 @@ -214453,12 +214454,12 @@ c2_08053788: ; 807E414 cmp r0, 0 beq @0807E4A8 ldr r0, =sub_807F464 - bl set_callback2 + bl SetMainCallback2 b @0807E4AE .pool @0807E4A8: mov r0, r8 - bl set_callback2 + bl SetMainCallback2 @0807E4AE: ldr r1, =0x02032298 movs r0, 0xFF @@ -214500,7 +214501,7 @@ sub_807E4DC: ; 807E4DC cmp r1, r0 bne @0807E504 ldr r0, =c2_08053788 - bl set_callback2 + bl SetMainCallback2 @0807E504: ldrh r1, [r4] ldr r0, =0x0000abcd @@ -215159,7 +215160,7 @@ sub_807EA2C: ; 807EA2C strb r6, [r0] @0807EA90: ldr r0, =sub_807EACC - bl set_callback2 + bl SetMainCallback2 @0807EA96: bl sub_807B5B8 bl sub_807E4DC @@ -215184,7 +215185,7 @@ sub_807EACC: ; 807EACC cmp r0, 0 beq @0807EAEC ldr r0, =c2_08053788 - bl set_callback2 + bl SetMainCallback2 b @0807EB2C .pool @0807EAEC: @@ -215695,7 +215696,7 @@ sub_807EB50: ; 807EB50 movs r1, 0 strb r1, [r0] ldr r0, =c2_080543C4 - bl set_callback2 + bl SetMainCallback2 b @0807F03A .pool @0807F028: @@ -215706,7 +215707,7 @@ sub_807EB50: ; 807EB50 ldr r0, =0x03002700 strb r1, [r0] ldr r0, =c2_080543C4 - bl set_callback2 + bl SetMainCallback2 @0807F03A: bl sub_800B33C lsls r0, 24 @@ -215737,18 +215738,18 @@ c2_080543C4: ; 807F068 bne @0807F0BE bl FreeAllWindowBuffers movs r0, 0x3 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free movs r0, 0x1 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free movs r0, 0 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free bl sub_805F094 ldr r4, =0x020322a0 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r0, =0x030030fc ldrb r0, [r0] @@ -215758,7 +215759,7 @@ c2_080543C4: ; 807F068 @0807F0B6: ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 @0807F0BE: bl run_active_tasks bl call_obj_callbacks @@ -215803,7 +215804,7 @@ sub_807F110: ; 807F110 cmp r0, 0 bne @0807F134 ldr r0, =sub_807B270 - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x03005dac ldr r0, =sub_80AF168 str r0, [r1] @@ -216051,13 +216052,13 @@ c3_0805465C: ; 807F2E4 movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0x4A movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x13 - bl lcd_io_set + bl SetGpuReg @0807F336: ldr r4, =0x020322a0 ldr r0, [r4] @@ -216069,7 +216070,7 @@ c3_0805465C: ; 807F2E4 lsls r0, 8 orrs r1, r0 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] adds r1, r0, 0 adds r1, 0xFE @@ -216079,7 +216080,7 @@ c3_0805465C: ; 807F2E4 lsls r0, 8 orrs r1, r0 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] @@ -216133,10 +216134,10 @@ sub_807F39C: ; 807F39C strb r1, [r0] movs r0, 0x4A movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x13 - bl lcd_io_set + bl SetGpuReg @0807F3D8: ldr r4, =0x020322a0 ldr r0, [r4] @@ -216148,7 +216149,7 @@ sub_807F39C: ; 807F39C lsls r0, 8 orrs r1, r0 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] adds r1, r0, 0 adds r1, 0xFE @@ -216158,7 +216159,7 @@ sub_807F39C: ; 807F39C lsls r0, 8 orrs r1, r0 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] adds r0, 0xFB ldrb r0, [r0] @@ -216192,7 +216193,7 @@ sub_807F39C: ; 807F39C movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits adds r0, r6, 0 bl remove_task @0807F45C: @@ -216490,7 +216491,7 @@ sub_807F464: ; 807F464 movs r1, 0 strb r1, [r0] ldr r0, =c2_080543C4 - bl set_callback2 + bl SetMainCallback2 @0807F70C: bl sub_800B33C lsls r0, 24 @@ -216572,7 +216573,7 @@ sub_807F764: ; 807F764 ldrh r0, [r0] str r0, [sp, 0xC] movs r0, 0x2 - bl call_gpu_bg_affine_set + bl SetBgAffine bl copy_super_sprites_to_oam bl copy_queue_process bl copy_pal_bg_faded_to_pal_ram @@ -216617,7 +216618,7 @@ sub_807F7D8: ; 807F7D8 adds r0, r5, 0 bl sub_8034974 adds r0, 0x64 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 ldr r4, =0x020322a4 ldr r0, [r4] @@ -216635,9 +216636,9 @@ sub_807F7D8: ; 807F7D8 lsls r2, 3 movs r0, 0x2 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =gUnknown_083390D4 movs r2, 0x80 lsls r2, 1 @@ -216658,7 +216659,7 @@ sub_807F7D8: ; 807F7D8 movs r0, 0x2 adds r1, r4, 0 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, [r5] b @0807F966 .pool @@ -216685,7 +216686,7 @@ sub_807F7D8: ; 807F7D8 movs r0, 0x1 adds r1, r4, 0 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, [r5] b @0807F966 .pool @@ -216712,9 +216713,9 @@ sub_807F7D8: ; 807F7D8 movs r0, 0x1 adds r1, r4, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r1, [r5] b @0807F966 .pool @@ -216755,7 +216756,7 @@ sub_807F7D8: ; 807F7D8 ldr r2, =0x000011bc adds r0, r2 ldr r0, [r0] - bl free + bl Free ldr r1, [r4] movs r0, 0 strb r0, [r1, 0x1] @@ -216782,33 +216783,33 @@ sub_807F9D0: ; 807F9D0 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY add sp, 0x8 pop {r0} bx r0 @@ -216841,7 +216842,7 @@ sub_807FA34: ; 807FA34 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0xE0 bl sub_81978B0 @0807FA74: @@ -216861,7 +216862,7 @@ sub_807FA80: ; 807FA80 bne @0807FA94 movs r0, 0x8F lsls r0, 5 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] @0807FA94: ldr r0, [r4] @@ -216877,7 +216878,7 @@ sub_807FA80: ; 807FA80 ldrb r0, [r0] bl sub_807FE54 ldr r0, =sub_807FAC8 - bl set_callback2 + bl SetMainCallback2 pop {r4} pop {r0} bx r0 @@ -216914,29 +216915,29 @@ sub_807FAC8: ; 807FAC8 @0807FB08: movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl reset_all_obj_data bl gpu_pal_allocator_reset movs r0, 0 bl SetVBlankCallback movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_08339974 movs r0, 0x1 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x020322a4 ldr r1, [r4] movs r0, 0xDC lsls r0, 1 adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x000009b8 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0 movs r1, 0x1 movs r2, 0xD0 @@ -217097,9 +217098,9 @@ sub_807FAC8: ; 807FAC8 bne @0807FCE2 bl FreeAllWindowBuffers movs r0, 0x2 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0 bl SetVBlankCallback ldr r0, =sub_807FFA4 @@ -217431,14 +217432,14 @@ sub_807FFA4: ; 807FFA4 push {r4,r5,lr} movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x020322a4 ldr r0, [r4] cmp r0, 0 bne @0807FFC0 movs r0, 0x8F lsls r0, 5 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] @0807FFC0: ldr r0, [r4] @@ -217467,12 +217468,12 @@ sub_807FFA4: ; 807FFA4 cmp r0, 0 bne @08080008 ldr r0, =sub_8080018 - bl set_callback2 + bl SetMainCallback2 b @0808000E .pool @08080008: ldr r0, =sub_80808D4 - bl set_callback2 + bl SetMainCallback2 @0808000E: pop {r4,r5} pop {r0} @@ -217918,14 +217919,14 @@ sub_8080018: ; 8080018 movs r0, 0x2B bl audio_play movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg b @08080546 .pool @08080408: movs r1, 0x80 lsls r1, 3 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r4, =0x020322a4 ldr r2, [r4] adds r1, r2, 0 @@ -217948,7 +217949,7 @@ sub_8080018: ; 8080018 bls @0808048C movs r0, 0xC movs r1, 0x2 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r1, [r4] ldrb r0, [r1] adds r0, 0x1 @@ -218052,7 +218053,7 @@ sub_8080018: ; 8080018 adds r0, r3, r1 str r2, [r0] ldr r0, =sub_8081898 - bl set_callback2 + bl SetMainCallback2 bl current_map_music_get lsls r0, 16 lsrs r0, 16 @@ -218098,30 +218099,30 @@ sub_8080588: ; 8080588 push {r4,lr} movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl reset_all_obj_data bl gpu_pal_allocator_reset bl clear_tasks ldr r0, =sub_807F764 bl SetVBlankCallback movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_08339974 movs r0, 0x1 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x020322a4 ldr r1, [r4] movs r0, 0xDC lsls r0, 1 adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r3, =0x000009b8 adds r1, r3 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0 movs r1, 0x1 movs r2, 0xD0 @@ -218835,14 +218836,14 @@ sub_80808D4: ; 80808D4 adds r0, r5 bl sub_8082CB4 movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg b @08080DAE .pool @08080BDC: movs r1, 0x80 lsls r1, 3 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r4, =0x020322a4 ldr r2, [r4] adds r1, r2, 0 @@ -218889,7 +218890,7 @@ sub_80808D4: ; 80808D4 strh r1, [r0] movs r0, 0xC movs r1, 0x2 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r0, [r4] movs r3, 0x84 lsls r3, 1 @@ -218963,7 +218964,7 @@ sub_80808D4: ; 80808D4 adds r0, 0x72 strb r3, [r0] ldr r0, =sub_8081898 - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x020375e0 ldrh r0, [r0] cmp r0, 0x1 @@ -220340,7 +220341,7 @@ sub_8081898: ; 8081898 movs r0, 0x1 strb r0, [r3] ldr r0, =sub_8081FC8 - bl set_callback2 + bl SetMainCallback2 @0808191A: ldr r0, =0x020322a4 ldr r1, [r0] @@ -221741,7 +221742,7 @@ sub_8081FC8: ; 8081FC8 cmp r0, 0 beq @08082458 ldr r0, =sub_8082924 - bl set_callback2 + bl SetMainCallback2 ldr r2, =0x020322a4 ldr r0, [r2] adds r0, 0x63 @@ -221777,7 +221778,7 @@ sub_8081FC8: ; 8081FC8 cmp r0, 0 beq @0808249E ldr r0, =sub_8082644 - bl set_callback2 + bl SetMainCallback2 ldr r0, [r6] adds r0, 0x63 movs r1, 0 @@ -222214,14 +222215,14 @@ sub_8082644: ; 8082644 bne @08082898 bl FreeAllWindowBuffers movs r0, 0x2 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap ldr r0, [r6] - bl free + bl Free str r4, [r6] ldr r0, =sub_807FA80 - bl set_callback2 + bl SetMainCallback2 b @080828DC .pool @08082898: @@ -222256,10 +222257,10 @@ sub_8082644: ; 8082644 cmp r4, 0 bne @080828DC ldr r0, [r6] - bl free + bl Free str r4, [r6] ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 @080828DC: bl sub_8082AD4 ldr r0, =0x020322a4 @@ -222423,21 +222424,21 @@ sub_8082924: ; 8082924 cmp r0, 0 bne @08082A70 ldr r0, =sub_807FA80 - bl set_callback2 + bl SetMainCallback2 b @08082A76 .pool @08082A70: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 @08082A76: bl FreeAllWindowBuffers movs r0, 0x2 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap ldr r4, =0x020322a4 ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] @08082A92: @@ -222845,24 +222846,24 @@ sub_8082DF4: ; 8082DF4 adds r0, r6 ldrh r1, [r0] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] movs r5, 0x8F lsls r5, 1 adds r0, r5 ldrh r1, [r0] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] adds r0, r6 ldrh r1, [r0] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] adds r0, r5 ldrh r1, [r0] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg pop {r4-r6} pop {r0} bx r0 @@ -225457,7 +225458,7 @@ set_player_trainer_id: ; 8084310 push {r4,lr} bl GenerateRandomNumber adds r4, r0, 0 - bl get_trainer_id_hi + bl GetTrainerId lsls r4, 16 lsls r0, 16 lsrs r0, 16 @@ -227531,7 +227532,7 @@ sub_808538C: ; 808538C beq @08085446 @08085434: lsrs r0, r4, 24 - bl is_tile_x61_warp + bl MetatileBehavior_IsLadder lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -228653,45 +228654,45 @@ overworld_bg_setup: ; 8085CA8 ldr r1, =gUnknown_08339DAC movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0x1 movs r1, 0x5 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 movs r1, 0x5 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x3 movs r1, 0x5 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r0, =0x03005da0 mov r8, r0 movs r4, 0x80 lsls r4, 4 adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed mov r1, r8 str r0, [r1] ldr r6, =0x03005d9c adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r6] ldr r5, =0x03005da4 adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] mov r0, r8 ldr r1, [r0] movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r6] movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r5] movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap bl sub_81971D0 pop {r3} mov r8, r3 @@ -228710,7 +228711,7 @@ overworld_free_bg_tilemaps: ; 8085D34 ldr r0, [r4] cmp r0, 0 beq @08085D4E - bl free + bl Free movs r0, 0 str r0, [r4] @08085D4E: @@ -228718,7 +228719,7 @@ overworld_free_bg_tilemaps: ; 8085D34 ldr r0, [r4] cmp r0, 0 beq @08085D5E - bl free + bl Free movs r0, 0 str r0, [r4] @08085D5E: @@ -228726,7 +228727,7 @@ overworld_free_bg_tilemaps: ; 8085D34 ldr r0, [r4] cmp r0, 0 beq @08085D6E - bl free + bl Free movs r0, 0 str r0, [r4] @08085D6E: @@ -228952,7 +228953,7 @@ c2_new_game: ; 8085EF8 ldr r0, =c1_overworld bl set_callback1 ldr r0, =c2_overworld - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -228992,7 +228993,7 @@ c2_whiteout: ; 8085F58 ldr r0, =c1_overworld bl set_callback1 ldr r0, =c2_overworld - bl set_callback2 + bl SetMainCallback2 @08085FB0: add sp, 0x4 pop {r0} @@ -229009,7 +229010,7 @@ c2_load_new_map: ; 8085FCC movs r0, 0 bl set_callback1 ldr r0, =c2_change_map - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x030022c0 ldr r0, =c2_load_new_map_2 str r0, [r1, 0x8] @@ -229027,7 +229028,7 @@ c2_load_new_map_2: ; 8085FFC ldr r0, =c1_overworld bl set_callback1 ldr r0, =c2_overworld - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -229058,7 +229059,7 @@ sub_8086024: ; 8086024 ldr r0, =c1_overworld bl set_callback1 ldr r0, =c2_overworld - bl set_callback2 + bl SetMainCallback2 @08086062: pop {r4} pop {r0} @@ -229074,7 +229075,7 @@ sub_8086074: ; 8086074 ldr r1, =sub_80AF314 str r1, [r0] ldr r0, =c2_80567AC - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -229092,7 +229093,7 @@ c2_80567AC: ; 8086098 bl set_callback1 bl sub_8086C2C ldr r0, =c2_overworld - bl set_callback2 + bl SetMainCallback2 @080860B8: pop {r0} bx r0 @@ -229106,13 +229107,13 @@ c2_exit_to_overworld_2_switch: ; 80860C8 cmp r0, 0x1 bne @080860E0 ldr r0, =c2_exit_to_overworld_2_link - bl set_callback2 + bl SetMainCallback2 b @080860EA .pool @080860E0: bl sub_808631C ldr r0, =c2_exit_to_overworld_2_local - bl set_callback2 + bl SetMainCallback2 @080860EA: pop {r0} bx r0 @@ -229128,7 +229129,7 @@ c2_exit_to_overworld_2_local: ; 80860F4 beq @0808610A bl set_vblank_callback_8086390 ldr r0, =c2_overworld - bl set_callback2 + bl SetMainCallback2 @0808610A: pop {r0} bx r0 @@ -229146,7 +229147,7 @@ c2_exit_to_overworld_2_link: ; 8086118 cmp r0, 0 beq @08086132 ldr r0, =c2_overworld - bl set_callback2 + bl SetMainCallback2 @08086132: pop {r0} bx r0 @@ -229323,7 +229324,7 @@ sub_8086230: ; 8086230 bl warp_in bl sub_80EDB44 ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 b @08086308 .pool @080862F4: @@ -229357,9 +229358,9 @@ sub_808631C: ; 808631C cmp r0, 0 beq @08086348 movs r0, 0xC5 - bl enable_irqs + bl EnableInterrupts movs r0, 0x2 - bl disable_irqs + bl DisableInterrupts b @08086362 .pool @08086348: @@ -229886,7 +229887,7 @@ sub_80867D8: ; 80867D8 sub sp, 0x4 movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl remove_some_task ldr r2, =0x05000002 mov r1, sp @@ -229960,26 +229961,26 @@ map_loading_lcd_reset: ; 8086878 bl reset_temp_tile_data_buffers movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001f1f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000101 movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0xFF - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0xFF - bl lcd_io_set + bl SetGpuReg ldr r4, =0x0000ffff movs r0, 0x42 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_82EC7C4 ldrh r1, [r0, 0x2] ldrh r2, [r0, 0x4] @@ -229991,10 +229992,10 @@ map_loading_lcd_reset: ; 8086878 adds r0, r2, 0 orrs r1, r0 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000070d movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg bl overworld_bg_setup movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram @@ -230005,46 +230006,46 @@ map_loading_lcd_reset: ; 8086878 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r1, =0x00007060 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg bl sub_8098128 pop {r4} pop {r0} @@ -234614,7 +234615,7 @@ copy_tileset_patterns_to_vram: ; 8088C34 lsrs r2, 16 movs r0, 0x2 adds r3, r5, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @08088C70 @08088C60: ldr r1, [r3, 0x4] @@ -234653,7 +234654,7 @@ copy_tileset_patterns_to_vram2: ; 8088C78 lsrs r2, 16 movs r0, 0x2 adds r3, r5, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @08088CB4 @08088CA4: ldr r1, [r3, 0x4] @@ -235076,8 +235077,8 @@ sub_8088EFC: ; 8088EFC bx r1 thumb_func_end sub_8088EFC - thumb_func_start is_tile_TODO -is_tile_TODO: ; 8088F14 + thumb_func_start MetatileBehavior_IsEscalator +MetatileBehavior_IsEscalator: ; 8088F14 push {lr} lsls r0, 24 movs r1, 0x96 @@ -235093,7 +235094,7 @@ is_tile_TODO: ; 8088F14 @08088F2A: pop {r1} bx r1 - thumb_func_end is_tile_TODO + thumb_func_end MetatileBehavior_IsEscalator thumb_func_start sub_8088F30 sub_8088F30: ; 8088F30 @@ -235111,8 +235112,8 @@ sub_8088F30: ; 8088F30 bx r1 thumb_func_end sub_8088F30 - thumb_func_start is_tile_x61_warp -is_tile_x61_warp: ; 8088F44 + thumb_func_start MetatileBehavior_IsLadder +MetatileBehavior_IsLadder: ; 8088F44 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235125,7 +235126,7 @@ is_tile_x61_warp: ; 8088F44 @08088F54: pop {r1} bx r1 - thumb_func_end is_tile_x61_warp + thumb_func_end MetatileBehavior_IsLadder thumb_func_start sub_8088F58 sub_8088F58: ; 8088F58 @@ -235572,8 +235573,8 @@ is_tile_x44_slide_right: ; 80891A4 bx r1 thumb_func_end is_tile_x44_slide_right - thumb_func_start is_tile_x80 -is_tile_x80: ; 80891B8 + thumb_func_start MetatileBehavior_IsCounter +MetatileBehavior_IsCounter: ; 80891B8 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235586,7 +235587,7 @@ is_tile_x80: ; 80891B8 @080891C8: pop {r1} bx r1 - thumb_func_end is_tile_x80 + thumb_func_end MetatileBehavior_IsCounter thumb_func_start is_tile_x86_and_npcunk2_is_x2 is_tile_x86_and_npcunk2_is_x2: ; 80891CC @@ -237507,24 +237508,24 @@ sub_8089BA4: ; 8089BA4 lsrs r5, 16 movs r0, 0x14 adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg lsls r4, 16 lsrs r4, 16 movs r0, 0x16 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg pop {r4,r5} pop {r0} bx r0 @@ -245981,7 +245982,7 @@ sub_808DD68: ; 808DD68 lsrs r0, 24 mov r9, r0 movs r0, 0x18 - bl malloc + bl Alloc adds r6, r0, 0 adds r0, r4, 0 adds r1, r5, 0 @@ -246006,7 +246007,7 @@ sub_808DD68: ; 808DD68 lsls r0, 24 lsrs r5, r0, 24 adds r0, r6, 0 - bl free + bl Free cmp r5, 0x40 beq @0808DDF2 ldr r1, [sp] @@ -268135,7 +268136,7 @@ sub_8097E50: ; 8097E50 cmp r1, 0 bne @08097E80 movs r0, 0x14 - bl malloc_and_clear + bl AllocZeroed str r0, [r6] ldrb r1, [r4, 0x8] strb r1, [r0] @@ -268244,7 +268245,7 @@ sub_8097EF0: ; 8097EF0 ldrb r4, [r0, 0x10] cmp r4, 0 bne @08097F36 - bl free + bl Free str r4, [r5] @08097F36: cmp r7, 0x1 @@ -269354,7 +269355,7 @@ copy_textbox_border_tile_patterns_to_vram: ; 809877C movs r2, 0xE0 lsls r2, 1 adds r3, r4, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles bl sub_8098C64 adds r1, r5, 0 movs r2, 0x20 @@ -269408,7 +269409,7 @@ sub_80987D4: ; 80987D4 movs r2, 0x90 lsls r2, 1 adds r3, r6, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles adds r5, 0x4 adds r4, r5 ldr r0, [r4] @@ -269513,7 +269514,7 @@ sub_8098858: ; 8098858 adds r1, r5, 0 ldr r2, [sp, 0x14] adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r1, r5, 0x1 lsls r1, 16 lsrs r1, 16 @@ -269533,7 +269534,7 @@ sub_8098858: ; 8098858 adds r0, r7, 0 ldr r2, [sp, 0x18] adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r1, r5, 0x2 lsls r1, 16 lsrs r1, 16 @@ -269550,7 +269551,7 @@ sub_8098858: ; 8098858 adds r0, r7, 0 mov r2, r8 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r1, r5, 0x3 lsls r1, 16 lsrs r1, 16 @@ -269568,7 +269569,7 @@ sub_8098858: ; 8098858 adds r0, r7, 0 ldr r2, [sp, 0x14] mov r3, r9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r1, r5, 0x5 lsls r1, 16 lsrs r1, 16 @@ -269580,7 +269581,7 @@ sub_8098858: ; 8098858 adds r0, r7, 0 mov r2, r8 mov r3, r9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r1, r5, 0x6 lsls r1, 16 lsrs r1, 16 @@ -269596,7 +269597,7 @@ sub_8098858: ; 8098858 adds r0, r7, 0 ldr r2, [sp, 0x14] adds r3, r6, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r1, r5, 0x7 lsls r1, 16 lsrs r1, 16 @@ -269609,7 +269610,7 @@ sub_8098858: ; 8098858 adds r0, r7, 0 ldr r2, [sp, 0x18] adds r3, r6, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r5, 0x8 lsls r5, 16 lsrs r5, 16 @@ -269622,7 +269623,7 @@ sub_8098858: ; 8098858 adds r1, r5, 0 mov r2, r8 adds r3, r6, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0x20 pop {r3-r5} mov r8, r3 @@ -269696,7 +269697,7 @@ sub_80989E0: ; 80989E0 adds r0, r7, 0 mov r1, r9 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r1, r9 adds r1, 0x1 lsls r1, 16 @@ -269717,7 +269718,7 @@ sub_80989E0: ; 80989E0 str r0, [sp, 0x8] adds r0, r7, 0 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r1, r9 adds r1, 0x2 lsls r1, 16 @@ -269738,7 +269739,7 @@ sub_80989E0: ; 80989E0 adds r0, r7, 0 mov r2, r8 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r1, r9 adds r1, 0x3 lsls r1, 16 @@ -269758,7 +269759,7 @@ sub_80989E0: ; 80989E0 adds r0, r7, 0 ldr r2, [sp, 0x10] adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r1, r9 adds r1, 0x5 lsls r1, 16 @@ -269771,7 +269772,7 @@ sub_80989E0: ; 80989E0 adds r0, r7, 0 mov r2, r8 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r1, r9 adds r1, 0x6 lsls r1, 16 @@ -269789,7 +269790,7 @@ sub_80989E0: ; 80989E0 adds r0, r7, 0 ldr r2, [sp, 0x10] adds r3, r6, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r1, r9 adds r1, 0x7 lsls r1, 16 @@ -269803,7 +269804,7 @@ sub_80989E0: ; 80989E0 adds r0, r7, 0 ldr r2, [sp, 0x14] adds r3, r6, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0x8 add r9, r0 mov r0, r9 @@ -269819,7 +269820,7 @@ sub_80989E0: ; 80989E0 mov r1, r9 mov r2, r8 adds r3, r6, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0x1C pop {r3-r5} mov r8, r3 @@ -269896,7 +269897,7 @@ rbox_fill_rectangle: ; 8098B7C movs r1, 0 mov r2, r8 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0xC pop {r3,r4} mov r8, r3 @@ -269977,7 +269978,7 @@ sub_8098C6C: ; 8098C6C ldr r1, [r1] movs r2, 0x90 lsls r2, 1 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r0, [r5] ldrb r0, [r0, 0x14] lsrs r0, 3 @@ -277112,7 +277113,7 @@ sub_809C2C8: ; 809C2C8 bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl is_tile_x80 + bl MetatileBehavior_IsCounter lsls r0, 24 cmp r0, 0 bne @0809C2F0 @@ -277216,7 +277217,7 @@ TryGetMapObjectScript: ; 809C384 bne @0809C40C @0809C3B4: adds r0, r6, 0 - bl is_tile_x80 + bl MetatileBehavior_IsCounter lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -278297,7 +278298,7 @@ sub_809CC9C: ; 809CC9C lsls r0, r5, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl is_tile_TODO + bl MetatileBehavior_IsEscalator lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -278393,13 +278394,13 @@ is_warp_tile: ; 809CD94 cmp r0, 0x1 beq @0809CE2A adds r0, r4, 0 - bl is_tile_x61_warp + bl MetatileBehavior_IsLadder lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809CE2A adds r0, r4, 0 - bl is_tile_TODO + bl MetatileBehavior_IsEscalator lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -281864,7 +281865,7 @@ sub_809E8B4: ; 809E8B4 push {lr} bl sub_809E778 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -281874,7 +281875,7 @@ sub_809E8B4: ; 809E8B4 Special_StartWallClock: ; 809E8C8 push {lr} ldr r0, =Cb2_StartWallClock - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x030022c0 ldr r0, =sub_809E8B4 str r0, [r1, 0x8] @@ -282714,7 +282715,7 @@ sub_809EF88: ; 809EF88 sub sp, 0x4 movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 bl SetVBlankCallback movs r2, 0xA0 @@ -282774,7 +282775,7 @@ sub_809EF88: ; 809EF88 ldr r0, =sub_809F0AC bl SetVBlankCallback ldr r0, =sub_809F090 - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_809F200 movs r1, 0x50 bl AddTask @@ -282790,19 +282791,19 @@ sub_809F048: ; 809F048 push {lr} bl clear_scheduled_bg_copies_to_vram movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_08510404 movs r0, 0 movs r2, 0x1 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0 bl schedule_bg_copy_tilemap_to_vram movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =gUnknown_08510408 bl InitWindows bl DeactivateAllTextPrinters @@ -282959,7 +282960,7 @@ sub_809F0F8: ; 809F0F8 beq @0809F1E4 adds r0, r7, 0 bl remove_task - bl do_reset + bl Reset b @0809F1F8 .pool @0809F1E4: @@ -283193,7 +283194,7 @@ sub_809F200: ; 809F200 adds r0, r4, 0 bl remove_task bl FreeAllWindowBuffers - bl do_reset + bl Reset @0809F404: add sp, 0x4 pop {r4,r5} @@ -284080,7 +284081,7 @@ sm_pokedex: ; 809FBB4 bl sub_809F774 bl overworld_free_bg_tilemaps ldr r0, =sub_80BB534 - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 @0809FBE6: pop {r1} @@ -284105,7 +284106,7 @@ sub_809FBF0: ; 809FBF0 bl sub_809F774 bl overworld_free_bg_tilemaps ldr r0, =sub_81B7F34 - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 @0809FC1C: pop {r1} @@ -284130,7 +284131,7 @@ sub_809FC24: ; 809FC24 bl sub_809F774 bl overworld_free_bg_tilemaps ldr r0, =c2_bag - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 @0809FC50: pop {r1} @@ -284155,7 +284156,7 @@ sub_809FC58: ; 809FC58 bl sub_809F774 bl overworld_free_bg_tilemaps ldr r0, =sub_81C7250 - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 @0809FC84: pop {r1} @@ -284245,7 +284246,7 @@ sub_809FD20: ; 809FD20 bl sub_809F774 bl overworld_free_bg_tilemaps ldr r0, =c2_options_menu - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x030022c0 ldr r0, =sub_8086194 str r0, [r1, 0x8] @@ -284345,7 +284346,7 @@ sub_809FDF4: ; 809FDF4 bl sub_809F774 bl overworld_free_bg_tilemaps ldr r0, =sub_81C4EFC - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 @0809FE20: pop {r1} @@ -285098,7 +285099,7 @@ sub_80A03E4: ; 80A03E4 @080A0418: movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 bl SetVBlankCallback bl remove_some_task @@ -285156,11 +285157,11 @@ sub_80A03E4: ; 80A03E4 b @080A04FC @080A04A2: movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085105A8 movs r0, 0 movs r2, 0x1 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_085105AC bl InitWindows movs r0, 0 @@ -285173,7 +285174,7 @@ sub_80A03E4: ; 80A03E4 .pool @080A04D4: movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 negs r0, r0 movs r1, 0x10 @@ -285182,7 +285183,7 @@ sub_80A03E4: ; 80A03E4 ldr r0, =sub_80A03D8 bl SetVBlankCallback movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts b @080A04FC .pool @080A04F8: @@ -285214,7 +285215,7 @@ sub_80A0514: ; 80A0514 movs r1, 0x50 bl AddTask ldr r0, =sub_80A0540 - bl set_callback2 + bl SetMainCallback2 @080A052E: pop {r0} bx r0 @@ -285358,7 +285359,7 @@ sub_80A0550: ; 80A0550 bl FreeAllWindowBuffers ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task b @080A06A8 @@ -287830,12 +287831,12 @@ sub_80A2968: ; 80A2968 ldr r4, =0x02037fd4 ldrh r1, [r4] movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x4] lsls r1, 21 lsrs r1, 27 movs r0, 0x54 - bl lcd_io_set + bl SetGpuReg ldrb r1, [r4, 0x9] movs r0, 0x8 ands r0, r1 @@ -291137,10 +291138,10 @@ sub_80A438C: ; 80A438C ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r5] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg lsls r4, r6, 5 ldr r0, =0x02037914 adds r4, r0 @@ -291278,10 +291279,10 @@ sub_80A438C: ; 80A438C @080A460E: ldrh r1, [r5] movs r0, 0x18 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg lsls r4, r6, 5 ldr r0, =0x02037914 adds r4, r0 @@ -292049,11 +292050,11 @@ ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument: ; 80A4C48 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg orrs r5, r4 movs r0, 0x52 adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg pop {r4,r5} pop {r0} bx r0 @@ -292076,7 +292077,7 @@ ma1E_set_BLDCNT: ; 80A4C80 str r0, [r3] orrs r1, r2 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -292091,10 +292092,10 @@ ma0D_reset_BLDCNT_and_BLDALPHA: ; 80A4CA8 str r0, [r1] movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -295522,10 +295523,10 @@ sub_80A67F4: ; 80A67F4 adds r4, r0, 0 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl move_anim_8072740 pop {r4} @@ -295541,10 +295542,10 @@ sub_80A6814: ; 80A6814 lsrs r4, 24 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl move_anim_task_del pop {r4} @@ -296120,7 +296121,7 @@ sub_80A6C68: ; 80A6C68 lsls r2, 6 add r3, sp, 0xC ldrh r3, [r3, 0xA] - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles add r0, sp, 0xC ldrb r0, [r0, 0x9] movs r1, 0x20 @@ -296132,10 +296133,10 @@ sub_80A6C68: ; 80A6C68 movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add r0, sp, 0xC ldrb r0, [r0, 0x9] - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x20 pop {r0} bx r0 @@ -296170,7 +296171,7 @@ sub_80A6CC0: ; 80A6CC0 lsrs r6, 16 adds r0, r5, 0 adds r3, r6, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles add sp, 0x4 pop {r3} mov r8, r3 @@ -296198,12 +296199,12 @@ sub_80A6D10: ; 80A6D10 movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r0, r4, 0 adds r1, r5, 0 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer add sp, 0xC pop {r4,r5} pop {r0} @@ -296218,7 +296219,7 @@ sub_80A6D48: ; 80A6D48 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r4} pop {r0} bx r0 @@ -296244,7 +296245,7 @@ sub_80A6D60: ; 80A6D60 bl sub_80A4720 @080A6D86: ldrb r0, [r4, 0x9] - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r4,r5} pop {r0} bx r0 @@ -297997,7 +297998,7 @@ sub_80A7A74: ; 80A7A74 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_80A7AFC str r0, [r4] pop {r4-r6} @@ -298065,7 +298066,7 @@ sub_80A7AFC: ; 80A7AFC lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0xE ldrsh r1, [r4, r0] movs r2, 0x16 @@ -299176,7 +299177,7 @@ sub_80A8394: ; 80A8394 bne @080A8412 movs r0, 0x80 lsls r0, 6 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] movs r2, 0xBE lsls r2, 1 @@ -299331,7 +299332,7 @@ sub_80A8394: ; 80A8394 ldr r0, [r5] adds r0, r4 ldr r0, [r0] - bl free + bl Free ldr r0, [r5] adds r0, r4 movs r1, 0 @@ -300553,7 +300554,7 @@ sub_80A92F8: ; 80A92F8 bl SetVBlankCallback movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02024474 adds r2, r0, 0 adds r2, 0x21 @@ -300562,7 +300563,7 @@ sub_80A92F8: ; 80A92F8 adds r0, 0x22 strb r1, [r0] ldr r0, =c2_80777E8 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -300613,19 +300614,19 @@ c2_80777E8: ; 80A933C movs r0, 0x1 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg bl sub_80A1A74 ldr r0, =0x02022e14 movs r1, 0 @@ -300831,7 +300832,7 @@ c2_80777E8: ; 80A933C ands r0, r1 strb r0, [r2, 0x8] ldr r0, =sub_8038420 - bl set_callback2 + bl SetMainCallback2 bl sub_805EF14 @080A95D2: ldr r1, =0x02024474 @@ -301920,11 +301921,11 @@ sub_80A9EF4: ; 80A9EF4 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_0853EF48 lsls r1, r5, 16 asrs r1, 16 @@ -302006,7 +302007,7 @@ sub_80A9FD0: ; 80A9FD0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @080AA01A: pop {r0} bx r0 @@ -302128,7 +302129,7 @@ sub_80AA0D0: ; 80AA0D0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @080AA11E: pop {r0} bx r0 @@ -302171,10 +302172,10 @@ sub_80AA124: ; 80AA124 bne @080AA186 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl move_anim_task_del @080AA186: @@ -302535,7 +302536,7 @@ sub_80AA40C: ; 80AA40C adds r1, r0 ldrh r1, [r1] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @080AA46A: pop {r0} bx r0 @@ -302953,7 +302954,7 @@ title_screen_vblank_callback: ; 80AA780 ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -302990,13 +302991,13 @@ c2_title_screen_1: ; 80AA7A4 bl SetVBlankCallback movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0xA0 lsls r1, 19 ldr r2, =0x00007fff @@ -303004,34 +303005,34 @@ c2_title_screen_1: ; 80AA7A4 strh r0, [r1] movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg add r1, sp, 0xC movs r0, 0 strh r0, [r1] @@ -303181,59 +303182,59 @@ c2_title_screen_1: ; 80AA7A4 movs r1, 0xE3 lsls r1, 8 movs r0, 0x28 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x0000ffff movs r0, 0x2A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0xE0 lsls r1, 8 movs r0, 0x2C - bl lcd_io_set + bl SetGpuReg movs r0, 0x2E adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x42 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001f1f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f1f movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0x84 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0xC - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001a0b movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001b0e movs r0, 0xA - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00004981 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts ldr r1, =0x0000b441 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x0000019d bl m4aSongNumStart ldr r0, =0x030022c0 @@ -303263,7 +303264,7 @@ c2_title_screen_1: ; 80AA7A4 movs r3, 0x4 bl sub_80BA384 ldr r0, =c2_title_screen_2 - bl set_callback2 + bl SetMainCallback2 @080AAB1E: add sp, 0x14 pop {r4} @@ -303349,22 +303350,22 @@ task_title_screen_1: ; 80AAB44 @080AABC0: ldr r1, =0x00001441 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f50 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_08540018 movs r1, 0x62 movs r2, 0x2 @@ -303454,16 +303455,16 @@ task_title_screen_2: ; 80AAC50 strh r0, [r5, 0xA] ldr r1, =0x00002142 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000f06 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001741 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x80 movs r1, 0x6C bl sub_80AA4EC @@ -303516,11 +303517,11 @@ task_title_screen_2: ; 80AAC50 lsls r1, 24 lsrs r1, 16 movs r0, 0x2C - bl lcd_io_set + bl SetGpuReg lsrs r5, 16 movs r0, 0x2E adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xF strh r0, [r4, 0x12] movs r0, 0x6 @@ -303562,7 +303563,7 @@ task_title_screen_3: ; 80AAD64 movs r3, 0x10 bl pal_fade_maybe ldr r0, =Cb2_GoToMainMenu - bl set_callback2 + bl SetMainCallback2 b @080AAE98 .pool @080AADB0: @@ -303572,7 +303573,7 @@ task_title_screen_3: ; 80AAD64 cmp r0, 0x46 bne @080AADC8 ldr r0, =c2_clear_save_data_screen_1 - bl set_callback2 + bl SetMainCallback2 b @080AAE98 .pool @080AADC8: @@ -303593,7 +303594,7 @@ task_title_screen_3: ; 80AAD64 movs r3, 0x10 bl pal_fade_maybe ldr r0, =c2_reset_rtc_screen_1 - bl set_callback2 + bl SetMainCallback2 b @080AAE98 .pool @080AADFC: @@ -303613,16 +303614,16 @@ task_title_screen_3: ; 80AAD64 movs r3, 0x10 bl pal_fade_maybe ldr r0, =c2_berry_program_update_screen_1 - bl set_callback2 + bl SetMainCallback2 b @080AAE98 .pool @080AAE30: movs r0, 0x2C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x2E movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 @@ -303664,7 +303665,7 @@ task_title_screen_3: ; 80AAD64 movs r3, 0x10 bl pal_fade_maybe ldr r0, =c2_show_copyright_and_intro_again_1 - bl set_callback2 + bl SetMainCallback2 @080AAE98: add sp, 0x4 pop {r4,r5} @@ -303681,7 +303682,7 @@ Cb2_GoToMainMenu: ; 80AAEB8 cmp r0, 0 bne @080AAECA ldr r0, =CB2_InitMainMenu - bl set_callback2 + bl SetMainCallback2 @080AAECA: pop {r0} bx r0 @@ -303696,7 +303697,7 @@ c2_show_copyright_and_intro_again_1: ; 80AAED4 cmp r0, 0 bne @080AAEE6 ldr r0, =c2_show_copyright_and_intro_again_2 - bl set_callback2 + bl SetMainCallback2 @080AAEE6: pop {r0} bx r0 @@ -303711,7 +303712,7 @@ c2_clear_save_data_screen_1: ; 80AAEF0 cmp r0, 0 bne @080AAF02 ldr r0, =c2_clear_save_data_screen_2 - bl set_callback2 + bl SetMainCallback2 @080AAF02: pop {r0} bx r0 @@ -303726,7 +303727,7 @@ c2_reset_rtc_screen_1: ; 80AAF0C cmp r0, 0 bne @080AAF1E ldr r0, =sub_809EF88 - bl set_callback2 + bl SetMainCallback2 @080AAF1E: pop {r0} bx r0 @@ -303742,7 +303743,7 @@ c2_berry_program_update_screen_1: ; 80AAF28 bne @080AAF3E bl m4aMPlayAllStop ldr r0, =sub_81BF384 - bl set_callback2 + bl SetMainCallback2 @080AAF3E: pop {r0} bx r0 @@ -305972,7 +305973,7 @@ sub_80AC124: ; 80AC124 lsls r1, 8 orrs r1, r0 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -306088,7 +306089,7 @@ sub_80AC1A8: ; 80AC1A8 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r1, [r4] ldr r2, =0x00000734 adds r0, r5, r2 @@ -306851,13 +306852,13 @@ task50_0807B6D4: ; 80AC830 strh r0, [r4, 0xE] ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0x9E - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -306874,7 +306875,7 @@ task50_0807B6D4: ; 80AC830 @080AC8AC: ldrh r1, [r4, 0xA] movs r0, 0x54 - bl lcd_io_set + bl SetGpuReg movs r1, 0xA ldrsh r0, [r4, r1] cmp r0, 0xF @@ -306904,18 +306905,18 @@ task50_0807B6D4: ; 80AC830 @080AC8EE: ldrh r1, [r4, 0xA] movs r0, 0x54 - bl lcd_io_set + bl SetGpuReg b @080AC922 @080AC8F8: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xE] movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg @080AC910: ldrh r0, [r4, 0x8] adds r0, 0x1 @@ -309396,7 +309397,7 @@ sub_80ADDBC: ; 80ADDBC movs r1, 0xFD lsls r1, 6 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @080ADE04: pop {r0} bx r0 @@ -309549,7 +309550,7 @@ sub_80ADEF4: ; 80ADEF4 @080ADF40: movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] @@ -312731,7 +312732,7 @@ sub_80AF8E0: ; 80AF8E0 @080AF92E: bl warp_in ldr r0, =sub_8086074 - bl set_callback2 + bl SetMainCallback2 adds r0, r5, 0 bl remove_task @080AF93E: @@ -312811,7 +312812,7 @@ sub_80AF96C: ; 80AF96C bne @080AF9E8 bl warp_in ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 adds r0, r5, 0 bl remove_task @080AF9E8: @@ -312883,7 +312884,7 @@ sub_80AFA0C: ; 80AFA0C @080AFA6C: bl warp_in ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 adds r0, r6, 0 bl remove_task @080AFA7C: @@ -313104,7 +313105,7 @@ task0A_fade_n_map_maybe: ; 80AFBF4 @080AFC46: bl warp_in ldr r0, =sub_8086024 - bl set_callback2 + bl SetMainCallback2 adds r0, r5, 0 bl remove_task @080AFC56: @@ -313856,7 +313857,7 @@ sub_80B01BC: ; 80B01BC @080B022A: bl warp_in ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 adds r0, r5, 0 bl remove_task @080B023A: @@ -313963,7 +313964,7 @@ sub_80B02C8: ; 80B02C8 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg cmp r5, 0 bne @080B0310 cmp r4, 0x10 @@ -314031,20 +314032,20 @@ sub_80B0318: ; 80B0318 movs r1, 0x80 lsls r1, 7 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits ldr r0, =gUnknown_82EC7CC ldrh r1, [r0] movs r0, 0x50 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r1, =0x0000070c movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x1E - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 str r0, [sp] movs r0, 0xF @@ -314180,22 +314181,22 @@ sub_80B0318: ; 80B0318 @080B04F2: movs r0, 0x40 movs r1, 0xFF - bl lcd_io_set + bl SetGpuReg ldrh r1, [r5, 0xC] movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r5, 0xE] movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r5, 0x10] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r5, 0x12] movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r5, 0x14] movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg bl script_env_2_enable_and_set_ctx_running adds r0, r4, 0 bl remove_task @@ -314338,7 +314339,7 @@ task01_battle_start: ; 80B05F0 bne @080B0652 bl overworld_free_bg_tilemaps ldr r0, =sub_8036760 - bl set_callback2 + bl SetMainCallback2 bl prev_quest_postbuffer_cursor_backup_reset bl overworld_poison_timer_set adds r0, r5, 0 @@ -314875,12 +314876,12 @@ sub_80B0AF8: ; 80B0AF8 cmp r0, 0 bne @080B0B4C ldr r0, =c2_whiteout - bl set_callback2 + bl SetMainCallback2 b @080B0B58 .pool @080B0B4C: ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x03005dac ldr r0, =sub_80AF6F0 str r0, [r1] @@ -314916,17 +314917,17 @@ sub_80B0B6C: ; 80B0B6C cmp r0, 0 beq @080B0BB4 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 b @080B0BC6 .pool @080B0BB4: ldr r0, =c2_whiteout - bl set_callback2 + bl SetMainCallback2 b @080B0BC6 .pool @080B0BC0: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 @080B0BC6: add sp, 0x4 pop {r0} @@ -315625,7 +315626,7 @@ sub_80B100C: ; 80B100C sub_80B1138: ; 80B1138 push {lr} ldr r0, =set_256color_bg_bg0 - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x030022c0 ldr r0, =sub_80B1158 str r0, [r1, 0x8] @@ -315657,7 +315658,7 @@ sub_80B1158: ; 80B1158 bl clear_tasks bl sub_806E64C ldr r0, =sub_80B11A8 - bl set_callback2 + bl SetMainCallback2 movs r0, 0 bl sub_8145F10 add sp, 0x8 @@ -315684,7 +315685,7 @@ sub_80B11A8: ; 80B11A8 str r0, [r1, 0x8] bl FreeAllWindowBuffers ldr r0, =sub_8036760 - bl set_callback2 + bl SetMainCallback2 bl prev_quest_postbuffer_cursor_backup_reset bl overworld_poison_timer_set movs r0, 0x7 @@ -315704,7 +315705,7 @@ sub_80B1204: ; 80B1204 push {lr} bl sav1_reset_x2C ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -316529,17 +316530,17 @@ sub_80B1918: ; 80B1918 beq @080B195C @080B1946: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 b @080B198A .pool @080B195C: ldr r0, =c2_whiteout - bl set_callback2 + bl SetMainCallback2 b @080B198A .pool @080B1968: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 bl sub_81A9E40 lsls r0, 24 cmp r0, 0 @@ -316566,7 +316567,7 @@ sub_80B1994: ; 80B1994 cmp r1, r0 bne @080B19B4 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 b @080B19E2 .pool @080B19B4: @@ -316576,12 +316577,12 @@ sub_80B1994: ; 80B1994 cmp r0, 0x1 bne @080B19D0 ldr r0, =c2_whiteout - bl set_callback2 + bl SetMainCallback2 b @080B19E2 .pool @080B19D0: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 bl sub_80B20BC bl rom_npc_set_flag_for_script_id bl sub_80B22BC @@ -319699,7 +319700,7 @@ sub_80B32B4: ; 80B32B4 adds r0, r2, 0 strh r0, [r1] ldr r0, =sub_8036760 - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x030022c0 ldr r0, =sub_80B360C str r0, [r1, 0x8] @@ -319872,7 +319873,7 @@ sub_80B33BC: ; 80B33BC adds r0, r3, 0 strh r0, [r1] ldr r0, =sub_8036760 - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x030022c0 ldr r0, =sub_80B360C str r0, [r1, 0x8] @@ -319959,12 +319960,12 @@ sub_80B3554: ; 80B3554 cmp r0, 0 bne @080B35FE ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 b @080B35FE .pool @080B35F8: ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 @080B35FE: bl run_active_tasks pop {r4} @@ -320054,7 +320055,7 @@ sub_80B360C: ; 80B360C @080B36D0: str r0, [r1, 0x8] ldr r0, =sub_80A0514 - bl set_callback2 + bl SetMainCallback2 pop {r4,r5} pop {r0} bx r0 @@ -320256,7 +320257,7 @@ sub_80B37FC: ; 80B37FC cmp r0, 0 bne @080B3884 ldr r0, =sub_80773AC - bl set_callback2 + bl SetMainCallback2 adds r0, r5, 0 bl remove_task @080B3884: @@ -320479,7 +320480,7 @@ task00_08081A90: ; 80B3A30 ble @080B3A62 bl sub_80097E8 ldr r0, =c2_800ACD4 - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task @080B3A62: @@ -320497,7 +320498,7 @@ task00_08081A90: ; 80B3A30 bne @080B3A86 bl sub_80097E8 ldr r0, =c2_800ACD4 - bl set_callback2 + bl SetMainCallback2 @080B3A86: adds r0, r4, 0 bl remove_task @@ -324675,9 +324676,9 @@ FieldEffectStart: ; 80B5B18 .pool thumb_func_end FieldEffectStart - thumb_func_start FieldEffectCmd00_loadtiles -; BOOL FieldEffectCmd00_loadtiles(u8 **script, u8 *returnValue) -FieldEffectCmd00_loadtiles: ; 80B5B60 + thumb_func_start FieldEffectCmd_loadtiles +; BOOL FieldEffectCmd_loadtiles(u8 **script, u8 *returnValue) +FieldEffectCmd_loadtiles: ; 80B5B60 push {lr} ldr r1, [r0] adds r1, 0x1 @@ -324686,11 +324687,11 @@ FieldEffectCmd00_loadtiles: ; 80B5B60 movs r0, 0x1 pop {r1} bx r1 - thumb_func_end FieldEffectCmd00_loadtiles + thumb_func_end FieldEffectCmd_loadtiles - thumb_func_start FieldEffectCmd01_loadfadedpal -; BOOL FieldEffectCmd01_loadfadedpal(u8 **script, u8 *returnValue) -FieldEffectCmd01_loadfadedpal: ; 80B5B74 + thumb_func_start FieldEffectCmd_loadfadedpal +; BOOL FieldEffectCmd_loadfadedpal(u8 **script, u8 *returnValue) +FieldEffectCmd_loadfadedpal: ; 80B5B74 push {lr} ldr r1, [r0] adds r1, 0x1 @@ -324699,11 +324700,11 @@ FieldEffectCmd01_loadfadedpal: ; 80B5B74 movs r0, 0x1 pop {r1} bx r1 - thumb_func_end FieldEffectCmd01_loadfadedpal + thumb_func_end FieldEffectCmd_loadfadedpal - thumb_func_start FieldEffectCmd02_loadpal -; BOOL FieldEffectCmd02_loadpal(u8 **script, u8 *returnValue) -FieldEffectCmd02_loadpal: ; 80B5B88 + thumb_func_start FieldEffectCmd_loadpal +; BOOL FieldEffectCmd_loadpal(u8 **script, u8 *returnValue) +FieldEffectCmd_loadpal: ; 80B5B88 push {lr} ldr r1, [r0] adds r1, 0x1 @@ -324712,11 +324713,11 @@ FieldEffectCmd02_loadpal: ; 80B5B88 movs r0, 0x1 pop {r1} bx r1 - thumb_func_end FieldEffectCmd02_loadpal + thumb_func_end FieldEffectCmd_loadpal - thumb_func_start FieldEffectCmd03_callnative -; BOOL FieldEffectCmd03_callnative(u8 **script, u8 *returnValue) -FieldEffectCmd03_callnative: ; 80B5B9C + thumb_func_start FieldEffectCmd_callnative +; BOOL FieldEffectCmd_callnative(u8 **script, u8 *returnValue) +FieldEffectCmd_callnative: ; 80B5B9C push {lr} ldr r2, [r0] adds r2, 0x1 @@ -324725,18 +324726,18 @@ FieldEffectCmd03_callnative: ; 80B5B9C movs r0, 0x1 pop {r1} bx r1 - thumb_func_end FieldEffectCmd03_callnative + thumb_func_end FieldEffectCmd_callnative - thumb_func_start FieldEffectCmd04_end -; BOOL FieldEffectCmd04_end(u8 **script, u8 *returnValue) -FieldEffectCmd04_end: ; 80B5BB0 + thumb_func_start FieldEffectCmd_end +; BOOL FieldEffectCmd_end(u8 **script, u8 *returnValue) +FieldEffectCmd_end: ; 80B5BB0 movs r0, 0 bx lr - thumb_func_end FieldEffectCmd04_end + thumb_func_end FieldEffectCmd_end - thumb_func_start FieldEffectCmd05_loadgfx_callnative -; BOOL FieldEffectCmd05_loadgfx_callnative(u8 **script, u8 *returnValue) -FieldEffectCmd05_loadgfx_callnative: ; 80B5BB4 + thumb_func_start FieldEffectCmd_loadgfx_callnative +; BOOL FieldEffectCmd_loadgfx_callnative(u8 **script, u8 *returnValue) +FieldEffectCmd_loadgfx_callnative: ; 80B5BB4 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -324754,11 +324755,11 @@ FieldEffectCmd05_loadgfx_callnative: ; 80B5BB4 pop {r4,r5} pop {r1} bx r1 - thumb_func_end FieldEffectCmd05_loadgfx_callnative + thumb_func_end FieldEffectCmd_loadgfx_callnative - thumb_func_start FieldEffectCmd06_loadtiles_callnative -; BOOL FieldEffectCmd06_loadtiles_callnative(u8 **script, u8 *returnValue) -FieldEffectCmd06_loadtiles_callnative: ; 80B5BDC + thumb_func_start FieldEffectCmd_loadtiles_callnative +; BOOL FieldEffectCmd_loadtiles_callnative(u8 **script, u8 *returnValue) +FieldEffectCmd_loadtiles_callnative: ; 80B5BDC push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -324774,11 +324775,11 @@ FieldEffectCmd06_loadtiles_callnative: ; 80B5BDC pop {r4,r5} pop {r1} bx r1 - thumb_func_end FieldEffectCmd06_loadtiles_callnative + thumb_func_end FieldEffectCmd_loadtiles_callnative - thumb_func_start FieldEffectCmd07_loadfadedpal_callnative -; BOOL FieldEffectCmd07_loadfadedpal_callnative(u8 **script, u8 *returnValue) -FieldEffectCmd07_loadfadedpal_callnative: ; 80B5C00 + thumb_func_start FieldEffectCmd_loadfadedpal_callnative +; BOOL FieldEffectCmd_loadfadedpal_callnative(u8 **script, u8 *returnValue) +FieldEffectCmd_loadfadedpal_callnative: ; 80B5C00 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -324794,7 +324795,7 @@ FieldEffectCmd07_loadfadedpal_callnative: ; 80B5C00 pop {r4,r5} pop {r1} bx r1 - thumb_func_end FieldEffectCmd07_loadfadedpal_callnative + thumb_func_end FieldEffectCmd_loadfadedpal_callnative thumb_func_start FieldEffectScript_ReadWord ; u32 FieldEffectScript_ReadWord(u8 **script) @@ -325227,8 +325228,8 @@ sub_80B5F0C: ; 80B5F0C .pool thumb_func_end sub_80B5F0C - thumb_func_start sub_80B5F44 -sub_80B5F44: ; 80B5F44 + thumb_func_start AddNewGameBirchObject +AddNewGameBirchObject: ; 80B5F44 push {r4-r6,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -325256,7 +325257,7 @@ sub_80B5F44: ; 80B5F44 pop {r1} bx r1 .pool - thumb_func_end sub_80B5F44 + thumb_func_end AddNewGameBirchObject thumb_func_start sub_80B5F84 sub_80B5F84: ; 80B5F84 @@ -326577,7 +326578,7 @@ sub_80B6970: ; 80B6970 sub_80B69DC: ; 80B69DC push {lr} ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x03005dac ldr r0, =mapldr_080842E8 str r0, [r1] @@ -326644,7 +326645,7 @@ task00_8084310: ; 80B6A24 bl flag_var_implications_of_teleport_ bl warp_in ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x03005dac ldr r0, =mapldr_08084390 str r0, [r1] @@ -327398,7 +327399,7 @@ sub_80B7060: ; 80B7060 ldr r0, =sub_80B70B4 str r0, [r1] ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_80B6E88 bl get_task_id_by_function lsls r0, 24 @@ -328364,7 +328365,7 @@ sub_80B7814: ; 80B7814 ldr r0, =mapldr_080851BC str r0, [r1] ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_80B75F0 bl get_task_id_by_function lsls r0, 24 @@ -328839,7 +328840,7 @@ sub_80B7BF4: ; 80B7BF4 ldr r0, =sub_80B6B68 str r0, [r1] ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_80B7A8C bl get_task_id_by_function lsls r0, 24 @@ -329036,7 +329037,7 @@ sub_80B7D34: ; 80B7D34 ldr r0, =mapldr_080859D4 str r0, [r1] ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_80B7CE4 bl get_task_id_by_function lsls r0, 24 @@ -329517,7 +329518,7 @@ sub_80B8198: ; 80B8198 bl copy_saved_warp3_bank_and_enter_x_to_warp1 bl warp_in ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x03005dac ldr r0, =mapldr_08085D88 str r0, [r1] @@ -329970,16 +329971,16 @@ sub_80B8584: ; 80B8584 movs r0, 0x3E strh r0, [r4, 0x10] movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xC] movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xE] movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x10] movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_80B880C bl SetVBlankCallback ldrh r0, [r4, 0x8] @@ -330278,22 +330279,22 @@ sub_80B880C: ; 80B880C bl _call_via_r0 ldrh r1, [r4, 0xA] movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xC] movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xE] movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x10] movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x12] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x14] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg add sp, 0x4 pop {r4} pop {r0} @@ -330361,10 +330362,10 @@ sub_80B88E4: ; 80B88E4 adds r4, r0, 0 ldrh r1, [r4, 0xA] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xC] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 adds r0, 0x22 ldr r1, =0x030022c0 @@ -330439,10 +330440,10 @@ sub_80B898C: ; 80B898C beq @080B89C4 movs r0, 0x42 movs r1, 0xF0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00002878 movs r0, 0x46 - bl lcd_io_set + bl SetGpuReg ldr r2, =0x02020630 movs r0, 0x26 ldrsh r1, [r4, r0] @@ -330505,10 +330506,10 @@ sub_80B8A0C: ; 80B8A0C ldr r5, =0x0000ffff movs r0, 0x42 adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -330608,10 +330609,10 @@ sub_80B8AE0: ; 80B8AE0 bl _call_via_r0 ldrh r1, [r4, 0xA] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xC] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg add sp, 0x4 pop {r4} pop {r0} @@ -331219,20 +331220,20 @@ sub_80B8F98: ; 80B8F98 strh r2, [r1, 0x38] ldr r1, =0x00003e41 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000e0e movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_0855B610 movs r1, 0xC0 movs r2, 0x20 bl gpu_pal_apply movs r0, 0x12 movs r1, 0x78 - bl lcd_io_set + bl SetGpuReg movs r4, 0x3 ldr r7, =0x0600f800 ldr r0, =0x0000bff4 @@ -333878,77 +333879,77 @@ c2_options_menu: ; 80BA4DC ldr r0, [r2, 0x8] movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0855C698 movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r0, =gUnknown_0855C680 bl InitWindows bl DeactivateAllTextPrinters movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x1 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x23 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0xC1 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0x4 - bl lcd_io_set + bl SetGpuReg movs r1, 0xC1 lsls r1, 6 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg b @080BA7EC .pool @080BA69C: @@ -333974,7 +333975,7 @@ c2_options_menu: ; 80BA4DC movs r3, 0xD1 lsls r3, 1 movs r0, 0x1 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @080BA7EC .pool @080BA6E0: @@ -334112,7 +334113,7 @@ c2_options_menu: ; 80BA4DC ldr r0, =sub_80BA4C8 bl SetVBlankCallback ldr r0, =sub_80BA4B0 - bl set_callback2 + bl SetMainCallback2 @080BA828: add sp, 0xC pop {r3} @@ -334487,7 +334488,7 @@ sub_80BAB08: ; 80BAB08 bl FreeAllWindowBuffers ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 @080BAB2C: pop {r0} bx r0 @@ -334503,7 +334504,7 @@ sub_80BAB38: ; 80BAB38 movs r1, 0x87 lsls r1, 5 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg lsls r4, 4 adds r1, r4, 0 adds r1, 0x28 @@ -334513,7 +334514,7 @@ sub_80BAB38: ; 80BAB38 lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -334923,7 +334924,7 @@ sub_80BAE5C: ; 80BAE5C movs r3, 0xD1 lsls r3, 1 movs r0, 0x1 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles adds r0, r4, 0 bl sub_8098758 ldr r0, [r0, 0x4] @@ -334958,7 +334959,7 @@ sub_80BAE5C: ; 80BAE5C movs r3, 0xD1 lsls r3, 1 movs r0, 0x1 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles adds r0, r4, 0 bl sub_8098758 ldr r0, [r0, 0x4] @@ -335282,7 +335283,7 @@ sub_80BB154: ; 80BB154 lsls r1, 1 movs r2, 0x1 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0x1B mov r8, r0 str r0, [sp] @@ -335292,7 +335293,7 @@ sub_80BB154: ; 80BB154 ldr r1, =0x000001a3 movs r2, 0x2 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -335301,7 +335302,7 @@ sub_80BB154: ; 80BB154 lsls r1, 1 movs r2, 0x1C movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] movs r6, 0x2 str r6, [sp, 0x4] @@ -335310,7 +335311,7 @@ sub_80BB154: ; 80BB154 ldr r1, =0x000001a5 movs r2, 0x1 movs r3, 0x1 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r6, [sp, 0x4] str r5, [sp, 0x8] @@ -335318,7 +335319,7 @@ sub_80BB154: ; 80BB154 ldr r1, =0x000001a7 movs r2, 0x1C movs r3, 0x1 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r7, 0xD4 lsls r7, 1 str r4, [sp] @@ -335328,7 +335329,7 @@ sub_80BB154: ; 80BB154 adds r1, r7, 0 movs r2, 0x1 movs r3, 0x3 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, =0x000001a9 mov r10, r0 mov r0, r8 @@ -335339,7 +335340,7 @@ sub_80BB154: ; 80BB154 mov r1, r10 movs r2, 0x2 movs r3, 0x3 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0xD5 lsls r0, 1 mov r9, r0 @@ -335350,7 +335351,7 @@ sub_80BB154: ; 80BB154 mov r1, r9 movs r2, 0x1C movs r3, 0x3 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -335359,7 +335360,7 @@ sub_80BB154: ; 80BB154 lsls r1, 1 movs r2, 0x1 movs r3, 0x4 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0x1A mov r8, r0 str r0, [sp] @@ -335369,7 +335370,7 @@ sub_80BB154: ; 80BB154 ldr r1, =0x000001a3 movs r2, 0x2 movs r3, 0x4 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -335378,7 +335379,7 @@ sub_80BB154: ; 80BB154 lsls r1, 1 movs r2, 0x1C movs r3, 0x4 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] movs r6, 0x12 str r6, [sp, 0x4] @@ -335387,7 +335388,7 @@ sub_80BB154: ; 80BB154 ldr r1, =0x000001a5 movs r2, 0x1 movs r3, 0x5 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r6, [sp, 0x4] str r5, [sp, 0x8] @@ -335395,7 +335396,7 @@ sub_80BB154: ; 80BB154 ldr r1, =0x000001a7 movs r2, 0x1C movs r3, 0x5 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -335403,7 +335404,7 @@ sub_80BB154: ; 80BB154 adds r1, r7, 0 movs r2, 0x1 movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r0, r8 str r0, [sp] str r4, [sp, 0x4] @@ -335412,7 +335413,7 @@ sub_80BB154: ; 80BB154 mov r1, r10 movs r2, 0x2 movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -335420,9 +335421,9 @@ sub_80BB154: ; 80BB154 mov r1, r9 movs r2, 0x1C movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0xC pop {r3-r5} mov r8, r3 @@ -335825,7 +335826,7 @@ sub_80BB534: ; 80BB534 @080BB628: ldr r4, =0x02039b4c ldr r0, =0x00000664 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] bl sub_80BB384 ldr r0, =sub_80BB78C @@ -335912,11 +335913,11 @@ sub_80BB534: ; 80BB534 .pool @080BB71C: movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_80BB370 bl SetVBlankCallback ldr r0, =sub_80BB774 - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x02039b4c ldr r1, [r0] ldr r3, =0x00000612 @@ -335999,7 +336000,7 @@ sub_80BB7D4: ; 80BB7D4 adds r0, r4 ldrh r1, [r0] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r3, [r7] adds r1, r3, r4 ldrh r0, [r1] @@ -336272,7 +336273,7 @@ sub_80BBA78: ; 80BBA78 adds r0, r4 ldrh r1, [r0] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r3, [r6] adds r1, r3, r4 ldrh r2, [r1] @@ -336674,14 +336675,14 @@ sub_80BBDE8: ; 80BBDE8 adds r0, r6, 0 bl remove_task ldr r0, =sub_8086194 - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl ldr r0, [r5] - bl free + bl Free @080BBE4A: pop {r4-r6} pop {r0} @@ -336733,7 +336734,7 @@ sub_80BBEB8: ; 80BBEB8 adds r0, r4 ldrh r1, [r0] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r3, [r5] adds r1, r3, r4 ldrh r0, [r1] @@ -336968,7 +336969,7 @@ sub_80BC0F8: ; 80BC0F8 adds r0, r4 ldrh r1, [r0] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r5, [r5] adds r1, r5, r4 ldrh r2, [r1] @@ -337454,35 +337455,35 @@ sub_80BC514: ; 80BC514 adds r0, r2 ldrb r1, [r0] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0855D298 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates movs r4, 0x80 lsls r4, 4 adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, =gUnknown_08DC1934 movs r2, 0x80 lsls r2, 6 @@ -337494,12 +337495,12 @@ sub_80BC514: ; 80BC514 movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r1, =gUnknown_08DC2DAC movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer cmp r5, 0 bne @080BC640 ldr r1, =gUnknown_08DC2A08 @@ -337507,7 +337508,7 @@ sub_80BC514: ; 80BC514 lsls r3, 2 movs r0, 0 movs r2, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer b @080BC64E .pool @080BC640: @@ -337516,7 +337517,7 @@ sub_80BC514: ; 80BC514 lsls r3, 2 movs r0, 0 movs r2, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer @080BC64E: bl sub_80A1A74 cmp r5, 0 @@ -337613,13 +337614,13 @@ sub_80BC514: ; 80BC514 adds r0, r2 strh r1, [r0] movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080BC7F8 .pool @080BC768: @@ -337641,42 +337642,42 @@ sub_80BC514: ; 80BC514 @080BC790: ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001d3f movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x42 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00009040 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg @080BC7F8: ldr r1, =0x030022c0 movs r0, 0x87 @@ -337754,28 +337755,28 @@ sub_80BC890: ; 80BC890 push {lr} bl FreeAllWindowBuffers movs r0, 0 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080BC8A4 - bl free + bl Free @080BC8A4: movs r0, 0x1 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080BC8B2 - bl free + bl Free @080BC8B2: movs r0, 0x2 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080BC8C0 - bl free + bl Free @080BC8C0: movs r0, 0x3 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080BC8CE - bl free + bl Free @080BC8CE: pop {r0} bx r0 @@ -338905,7 +338906,7 @@ sub_80BD1F4: ; 80BD1F4 movs r0, 0x10 str r0, [sp, 0x4] movs r0, 0 - bl BlitSurfaceToWindow + bl BlitBitmapToWindow b @080BD234 .pool @080BD220: @@ -339112,7 +339113,7 @@ sub_80BD2B4: ; 80BD2B4 adds r0, r2 ldrb r1, [r0] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldr r0, [r7] movs r2, 0xC6 lsls r2, 3 @@ -339216,7 +339217,7 @@ sub_80BD404: ; 80BD404 lsls r1, 16 lsrs r1, 16 movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldr r0, [r7] ldr r4, =0x0000062c adds r2, r0, r4 @@ -339281,7 +339282,7 @@ sub_80BD404: ; 80BD404 lsls r1, 16 lsrs r1, 16 movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldr r0, [r7] ldr r4, =0x0000062c adds r1, r0, r4 @@ -339310,7 +339311,7 @@ sub_80BD404: ; 80BD404 lsls r1, 16 lsrs r1, 16 movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 @080BD598: pop {r3} @@ -341627,33 +341628,33 @@ sub_80BE91C: ; 80BE91C movs r1, 0xFF strh r1, [r0, 0x12] movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0856E630 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates movs r4, 0x80 lsls r4, 4 adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r0, =gUnknown_0856E640 bl InitWindows bl DeactivateAllTextPrinters @@ -341810,7 +341811,7 @@ sub_80BEA24: ; 80BEA24 movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0 movs r1, 0 bl FillWindowPixelBuffer @@ -341892,11 +341893,11 @@ sub_80BEA24: ; 80BEA24 movs r1, 0x3 bl CopyWindowToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 @@ -341985,25 +341986,25 @@ sub_80BEA24: ; 80BEA24 @080BECBC: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 @@ -342097,28 +342098,28 @@ sub_80BEDB0: ; 80BEDB0 push {lr} bl FreeAllWindowBuffers movs r0, 0 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080BEDC4 - bl free + bl Free @080BEDC4: movs r0, 0x1 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080BEDD2 - bl free + bl Free @080BEDD2: movs r0, 0x2 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080BEDE0 - bl free + bl Free @080BEDE0: movs r0, 0x3 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080BEDEE - bl free + bl Free @080BEDEE: pop {r0} bx r0 @@ -342506,7 +342507,7 @@ sub_80BF0AC: ; 80BF0AC movs r1, 0xD0 lsls r1, 4 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg ldrb r0, [r7] adds r0, 0x1 strb r0, [r7] @@ -342698,7 +342699,7 @@ sub_80BF250: ; 80BF250 movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0 movs r1, 0 bl FillWindowPixelBuffer @@ -342875,13 +342876,13 @@ sub_80BF250: ; 80BF250 movs r1, 0x3 bl CopyWindowToVram movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080BF5B2 .pool @080BF514: @@ -342904,25 +342905,25 @@ sub_80BF250: ; 80BF250 @080BF540: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg @080BF57A: ldr r1, =0x030022c0 movs r0, 0x87 @@ -343297,7 +343298,7 @@ sub_80BF82C: ; 80BF82C movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0 movs r1, 0 bl FillWindowPixelBuffer @@ -343488,11 +343489,11 @@ sub_80BF82C: ; 80BF82C movs r1, 0x3 bl CopyWindowToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080BFB4E .pool @080BFAE8: @@ -343515,25 +343516,25 @@ sub_80BF82C: ; 80BF82C @080BFB14: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg @080BFB4E: ldr r1, =0x030022c0 movs r2, 0x87 @@ -343714,7 +343715,7 @@ sub_80BFCDC: ; 80BFCDC movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer pop {r0} bx r0 .pool @@ -343727,7 +343728,7 @@ sub_80BFCF4: ; 80BFCF4 movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer pop {r0} bx r0 .pool @@ -343742,7 +343743,7 @@ sub_80BFD0C: ; 80BFD0C lsrs r0, 24 mov r8, r0 movs r0, 0x1 - bl bg_get_tilemap + bl GetBgTileMap adds r7, r0, 0 movs r1, 0 @080BFD22: @@ -343784,7 +343785,7 @@ sub_80BFD0C: ; 80BFD0C cmp r1, 0x3 bls @080BFD22 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r3} mov r8, r3 pop {r4-r7} @@ -343802,7 +343803,7 @@ sub_80BFD7C: ; 80BFD7C lsrs r0, 24 mov r8, r0 movs r0, 0x1 - bl bg_get_tilemap + bl GetBgTileMap adds r7, r0, 0 movs r1, 0 @080BFD92: @@ -343849,7 +343850,7 @@ sub_80BFD7C: ; 80BFD7C cmp r1, 0x3 bls @080BFD92 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r3} mov r8, r3 pop {r4-r7} @@ -343942,23 +343943,23 @@ sub_80BFE38: ; 80BFE38 lsls r0, 1 bl sub_80C09B0 movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0856E668 movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates movs r4, 0x80 lsls r4, 4 adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r0, =gUnknown_0856E670 bl InitWindows bl DeactivateAllTextPrinters @@ -343984,7 +343985,7 @@ sub_80BFE38: ; 80BFE38 movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0 movs r1, 0 bl FillWindowPixelBuffer @@ -344028,9 +344029,9 @@ sub_80BFE38: ; 80BFE38 movs r1, 0x3 bl CopyWindowToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080C002E @080BFFA8: adds r0, r4, 0 @@ -344072,21 +344073,21 @@ sub_80BFE38: ; 80BFE38 @080C0000: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg @080C002E: ldr r1, =0x03005e00 lsls r0, r5, 2 @@ -344213,19 +344214,19 @@ blockset_load_palette_to_gpu: ; 80C012C movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg bl FreeAllWindowBuffers movs r0, 0x2 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080C015A - bl free + bl Free @080C015A: movs r0, 0x3 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080C0168 - bl free + bl Free @080C0168: ldr r0, =0x03005e00 lsls r4, r6, 2 @@ -345293,16 +345294,16 @@ sub_80C09B0: ; 80C09B0 cmp r0, 0 bne @080C09E2 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg @080C09E2: movs r1, 0x80 lsls r1, 2 @@ -345311,16 +345312,16 @@ sub_80C09B0: ; 80C09B0 cmp r0, 0 bne @080C0A0C movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg @080C0A0C: movs r1, 0x80 lsls r1, 3 @@ -345329,16 +345330,16 @@ sub_80C09B0: ; 80C09B0 cmp r0, 0 bne @080C0A36 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg @080C0A36: movs r1, 0x80 lsls r1, 4 @@ -345347,16 +345348,16 @@ sub_80C09B0: ; 80C09B0 cmp r0, 0 bne @080C0A60 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits movs r0, 0xE movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg @080C0A60: movs r1, 0x80 lsls r1, 5 @@ -345364,7 +345365,7 @@ sub_80C09B0: ; 80C09B0 cmp r5, 0 bne @080C0A7E movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits bl reset_all_obj_data bl gpu_pal_allocator_reset ldr r1, =0x0300301c @@ -346531,33 +346532,33 @@ sub_80C12E0: ; 80C12E0 movs r0, 0 bl sub_80C09B0 movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0856EFF8 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates movs r4, 0x80 lsls r4, 4 adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r0, =gUnknown_0856F008 bl InitWindows bl DeactivateAllTextPrinters @@ -346577,7 +346578,7 @@ sub_80C12E0: ; 80C12E0 movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer b @080C13F0 .pool @080C13E4: @@ -346585,7 +346586,7 @@ sub_80C12E0: ; 80C12E0 movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer @080C13F0: ldr r0, =gUnknown_08DC3286 movs r1, 0x1 @@ -346632,11 +346633,11 @@ sub_80C12E0: ; 80C12E0 movs r1, 0x3 bl CopyWindowToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080C14DA .pool @080C1480: @@ -346656,25 +346657,25 @@ sub_80C12E0: ; 80C12E0 @080C14A0: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg @080C14DA: ldr r1, =0x030022c0 movs r0, 0x87 @@ -346719,28 +346720,28 @@ sub_80C152C: ; 80C152C push {lr} bl FreeAllWindowBuffers movs r0, 0 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080C1540 - bl free + bl Free @080C1540: movs r0, 0x1 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080C154E - bl free + bl Free @080C154E: movs r0, 0x2 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080C155C - bl free + bl Free @080C155C: movs r0, 0x3 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080C156A - bl free + bl Free @080C156A: pop {r0} bx r0 @@ -346765,7 +346766,7 @@ sub_80C1570: ; 80C1570 movs r1, 0x2 bl CopyWindowToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =sub_80C15B0 str r0, [r5] pop {r4,r5} @@ -346868,7 +346869,7 @@ sub_80C15B0: ; 80C15B0 movs r1, 0x2 bl CopyWindowToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @080C167C: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] @@ -346897,7 +346898,7 @@ sub_80C15B0: ; 80C15B0 movs r1, 0x2 bl CopyWindowToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @080C16BC: pop {r4,r5} pop {r0} @@ -346925,7 +346926,7 @@ sub_80C16CC: ; 80C16CC movs r1, 0x2 bl CopyWindowToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =sub_80C170C str r0, [r5] pop {r4,r5} @@ -347103,7 +347104,7 @@ sub_80C170C: ; 80C170C movs r1, 0x2 bl CopyWindowToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @080C18B6: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] @@ -347137,7 +347138,7 @@ sub_80C170C: ; 80C170C movs r1, 0x2 bl CopyWindowToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @080C1900: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] @@ -347171,7 +347172,7 @@ sub_80C170C: ; 80C170C movs r1, 0x2 bl CopyWindowToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @080C194A: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] @@ -347205,7 +347206,7 @@ sub_80C170C: ; 80C170C movs r1, 0x2 bl CopyWindowToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @080C1994: pop {r4-r7} pop {r0} @@ -347443,7 +347444,7 @@ sub_80C1B64: ; 80C1B64 movs r1, 0x2 bl CopyWindowToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r4-r6} pop {r0} bx r0 @@ -347515,7 +347516,7 @@ sub_80C1BCC: ; 80C1BCC movs r1, 0x2 bl CopyWindowToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080C1D2E .pool @080C1C68: @@ -347684,7 +347685,7 @@ sub_80C1D98: ; 80C1D98 lsls r4, 24 lsrs r4, 24 movs r0, 0x3 - bl bg_get_tilemap + bl GetBgTileMap adds r2, r0, 0 movs r3, 0 cmp r3, r4 @@ -348179,7 +348180,7 @@ sub_80C21D4: ; 80C21D4 lsls r4, 24 lsrs r4, 24 movs r0, 0x3 - bl bg_get_tilemap + bl GetBgTileMap adds r5, r0, 0 cmp r4, 0 bne @080C2268 @@ -348875,10 +348876,10 @@ sub_80C2728: ; 80C2728 lsls r1, 3 adds r0, r1 ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 bl FreeAllWindowBuffers ldr r0, [r5] - bl free + bl Free movs r0, 0 str r0, [r5] adds r0, r4, 0 @@ -348929,7 +348930,7 @@ sub_80C2760: ; 80C2760 .4byte @080C2A2C .4byte @080C2A68 @080C27CC: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @080C27D8 @@ -349023,7 +349024,7 @@ sub_80C2760: ; 80C2760 beq @080C28A8 b @080C2ACA @080C28A8: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @080C28B4 @@ -350168,44 +350169,44 @@ sub_80C3278: ; 80C3278 movs r1, 0xC1 lsls r1, 6 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0xC1 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x1E - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0xA0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0xF0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080C32E0 movs r0, 0xC7 - bl enable_irqs + bl EnableInterrupts b @080C32E6 .pool @080C32E0: movs r0, 0x3 - bl enable_irqs + bl EnableInterrupts @080C32E6: pop {r0} bx r0 @@ -350239,7 +350240,7 @@ sub_80C32EC: ; 80C32EC lsls r1, 16 lsrs r1, 16 movs r0, 0x54 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldr r1, =0x00007ca8 adds r0, r1 @@ -350251,7 +350252,7 @@ sub_80C32EC: ; 80C32EC lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -350267,19 +350268,19 @@ sub_80C334C: ; 80C334C bl SetHBlankCallback movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xE movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 thumb_func_end sub_80C334C @@ -350288,43 +350289,43 @@ sub_80C334C: ; 80C334C sub_80C3388: ; 80C3388 push {lr} movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0856FAB4 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r0, =gUnknown_0856FAC4 bl InitWindows bl DeactivateAllTextPrinters @@ -350338,7 +350339,7 @@ sub_80C3388: ; 80C3388 sub_80C3404: ; 80C3404 push {lr} ldr r0, =sub_80C2710 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -351824,7 +351825,7 @@ sub_80C4140: ; 80C4140 str r0, [sp, 0xC] movs r0, 0x3 movs r3, 0xF - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer @080C41B6: adds r0, r4, 0x1 lsls r0, 24 @@ -351924,7 +351925,7 @@ sub_80C41D8: ; 80C41D8 movs r0, 0x3 movs r2, 0x80 lsls r2, 2 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles @080C428E: adds r0, r4, 0x1 lsls r0, 24 @@ -351990,7 +351991,7 @@ sub_80C42A4: ; 80C42A4 str r0, [sp, 0xC] movs r0, 0x3 movs r3, 0x2 - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer @080C430C: adds r0, r4, 0x1 lsls r0, 24 @@ -352032,7 +352033,7 @@ sub_80C4330: ; 80C4330 lsls r2, 3 movs r0, 0x3 movs r3, 0x80 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles pop {r0} bx r0 .pool @@ -352098,7 +352099,7 @@ sub_80C43A8: ; 80C43A8 movs r0, 0 @080C4406: movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @080C4536 .pool @080C4418: @@ -352173,12 +352174,12 @@ sub_80C43A8: ; 80C43A8 ldr r3, =0x00003ca8 adds r1, r3 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00005ca8 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap b @080C4536 .pool @080C4500: @@ -352189,21 +352190,21 @@ sub_80C43A8: ; 80C43A8 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x2 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x3 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 @080C4532: movs r0, 0x1 b @080C4542 @@ -352274,7 +352275,7 @@ sub_80C4550: ; 80C4550 cmp r0, 0x13 ble @080C455E movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r4-r7} pop {r0} bx r0 @@ -352332,7 +352333,7 @@ sub_80C45C0: ; 80C45C0 cmp r0, 0x13 ble @080C45CE movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r4-r7} pop {r0} bx r0 @@ -352369,7 +352370,7 @@ sub_80C4630: ; 80C4630 movs r0, 0x3 movs r1, 0x8F movs r2, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, [r4] ldrb r0, [r0, 0x5] cmp r0, 0 @@ -352399,7 +352400,7 @@ sub_80C4630: ; 80C4630 mov r1, r8 adds r2, r5, 0 movs r3, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r1, r8 adds r1, 0x1 lsls r1, 16 @@ -352415,7 +352416,7 @@ sub_80C4630: ; 80C4630 movs r0, 0x3 adds r2, r4, 0 movs r3, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r1, r8 adds r1, 0x10 lsls r1, 16 @@ -352427,7 +352428,7 @@ sub_80C4630: ; 80C4630 movs r0, 0x3 adds r2, r5, 0 movs r3, 0x10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r1, r8 adds r1, 0x11 lsls r1, 16 @@ -352439,7 +352440,7 @@ sub_80C4630: ; 80C4630 movs r0, 0x3 adds r2, r4, 0 movs r3, 0x10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @080C4700: adds r0, r7, 0x1 lsls r0, 16 @@ -352461,7 +352462,7 @@ sub_80C4630: ; 80C4630 ble @080C467E @080C4724: movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0xC pop {r3-r5} mov r8, r3 @@ -352495,7 +352496,7 @@ sub_80C474C: ; 80C474C movs r1, 0x8D movs r2, 0x1B movs r3, 0x9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r4, [sp, 0x8] @@ -352503,7 +352504,7 @@ sub_80C474C: ; 80C474C movs r1, 0x9D movs r2, 0x1B movs r3, 0xA - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @080C478A: ldr r0, [r6] movs r1, 0xAE @@ -352520,7 +352521,7 @@ sub_80C474C: ; 80C474C movs r1, 0x8D movs r2, 0x15 movs r3, 0xD - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r4, [sp, 0x8] @@ -352528,7 +352529,7 @@ sub_80C474C: ; 80C474C movs r1, 0x9D movs r2, 0x15 movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @080C47BE: ldr r0, [r6] ldr r2, =0x00000574 @@ -352544,7 +352545,7 @@ sub_80C474C: ; 80C474C movs r1, 0x8D movs r2, 0x1B movs r3, 0xB - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r4, [sp, 0x8] @@ -352552,7 +352553,7 @@ sub_80C474C: ; 80C474C movs r1, 0x9D movs r2, 0x1B movs r3, 0xC - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect b @080C48B8 .pool @080C4800: @@ -352568,7 +352569,7 @@ sub_80C474C: ; 80C474C movs r1, 0x8D movs r2, 0x1B movs r3, 0x9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -352576,7 +352577,7 @@ sub_80C474C: ; 80C474C movs r1, 0x9D movs r2, 0x1B movs r3, 0xA - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @080C482E: ldr r0, [r6] movs r1, 0xAA @@ -352594,7 +352595,7 @@ sub_80C474C: ; 80C474C movs r1, 0x8D movs r2, 0x1B movs r3, 0xD - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -352602,7 +352603,7 @@ sub_80C474C: ; 80C474C movs r1, 0x9D movs r2, 0x1B movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @080C4864: ldr r0, [r6] ldrb r0, [r0, 0xD] @@ -352617,7 +352618,7 @@ sub_80C474C: ; 80C474C movs r1, 0x8D movs r2, 0x11 movs r3, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -352625,7 +352626,7 @@ sub_80C474C: ; 80C474C movs r1, 0x9D movs r2, 0x11 movs r3, 0x10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -352633,7 +352634,7 @@ sub_80C474C: ; 80C474C movs r1, 0x8C movs r2, 0x1B movs r3, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -352641,10 +352642,10 @@ sub_80C474C: ; 80C474C movs r1, 0x9C movs r2, 0x1B movs r3, 0x10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @080C48B8: movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0xC pop {r4-r6} pop {r0} @@ -352765,9 +352766,9 @@ sub_80C4998: ; 80C4998 push {r4,lr} adds r4, r0, 0 movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg bl remove_some_task bl dp12_8087EA4 movs r1, 0 @@ -352987,7 +352988,7 @@ sub_80C4B08: ; 80C4B08 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 b @080C4BF6 @080C4B6C: ldr r0, [r2] @@ -353274,9 +353275,9 @@ sub_80C4C84: ; 80C4C84 sub_80C4DB0: ; 80C4DB0 push {lr} movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0 bl SetHBlankCallback ldr r0, =sub_80C4960 @@ -353296,7 +353297,7 @@ sub_80C4DDC: ; 80C4DDC adds r5, r0, 0 ldr r4, =0x02039ce8 ldr r0, =0x00007cac - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 str r1, [r4] movs r2, 0xA6 @@ -353343,7 +353344,7 @@ sub_80C4DDC: ; 80C4DDC adds r0, r2 bl sub_80C3020 ldr r0, =sub_80C2C80 - bl set_callback2 + bl SetMainCallback2 pop {r4,r5} pop {r0} bx r0 @@ -353359,7 +353360,7 @@ sub_80C4E74: ; 80C4E74 lsrs r4, 24 ldr r5, =0x02039ce8 ldr r0, =0x00007cac - bl malloc_and_clear + bl AllocZeroed str r0, [r5] movs r2, 0xA6 lsls r2, 3 @@ -353387,7 +353388,7 @@ sub_80C4E74: ; 80C4E74 adds r1, r2 strb r0, [r1] ldr r0, =sub_80C2C80 - bl set_callback2 + bl SetMainCallback2 pop {r4-r6} pop {r0} bx r0 @@ -353546,7 +353547,7 @@ sub_80C4FF0: ; 80C4FF0 ldr r1, =0x00000583 adds r0, r1 ldrb r0, [r0] - bl sub_806EFF0 + bl TrainerClassToTrainerPic lsls r0, 16 lsrs r0, 16 ldr r4, =gUnknown_0856FB18 @@ -353587,7 +353588,7 @@ sub_80C4FF0: ; 80C4FF0 adds r0, r1 adds r0, r2 ldrb r0, [r0] - bl sub_806EFF0 + bl TrainerClassToTrainerPic lsls r0, 16 lsrs r0, 16 ldr r4, =gUnknown_0856FB18 @@ -353625,78 +353626,78 @@ sub_80C50D0: ; 80C50D0 sub sp, 0x8 movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xE movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x42 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg mov r1, sp movs r0, 0 strh r0, [r1] @@ -353723,7 +353724,7 @@ sub_80C51C4: ; 80C51C4 push {lr} bl sub_80C51F0 ldr r0, =sub_80C544C - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -353735,7 +353736,7 @@ sub_80C51D8: ; 80C51D8 ldr r0, =0x02039cec ldr r0, [r0] ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 bl sub_80C52E4 pop {r0} bx r0 @@ -353755,7 +353756,7 @@ sub_80C51F0: ; 80C51F0 .pool @080C5204: movs r0, 0x18 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] cmp r0, 0 bne @080C5214 @@ -353870,7 +353871,7 @@ sub_80C52E4: ; 80C52E4 movs r2, 0x18 bl memset ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] b @080C530A @@ -353895,7 +353896,7 @@ sub_80C5310: ; 80C5310 .pool @080C5324: ldr r0, =0x00002434 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] cmp r0, 0 beq @080C5338 @@ -353925,7 +353926,7 @@ sub_80C5340: ; 80C5340 ldr r0, [r0, 0x28] cmp r0, 0 beq @080C5368 - bl free + bl Free ldr r1, [r4] movs r0, 0 str r0, [r1, 0x28] @@ -353934,7 +353935,7 @@ sub_80C5340: ; 80C5340 ldr r0, [r0, 0x24] cmp r0, 0 beq @080C537A - bl free + bl Free ldr r1, [r4] movs r0, 0 str r0, [r1, 0x24] @@ -353943,7 +353944,7 @@ sub_80C5340: ; 80C5340 ldr r0, [r0, 0x20] cmp r0, 0 beq @080C538C - bl free + bl Free ldr r1, [r4] movs r0, 0 str r0, [r1, 0x20] @@ -353953,7 +353954,7 @@ sub_80C5340: ; 80C5340 movs r1, 0 bl memset ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] @080C53A0: @@ -354016,7 +354017,7 @@ pokemon_details: ; 80C53AC movs r0, 0 str r0, [sp, 0xC] movs r0, 0x2 - bl call_gpu_bg_affine_set + bl SetBgAffine @080C5416: bl copy_super_sprites_to_oam bl copy_queue_process @@ -354048,7 +354049,7 @@ sub_80C544C: ; 80C544C movs r1, 0 bl AddTask ldr r0, =sub_80C5438 - bl set_callback2 + bl SetMainCallback2 @080C5464: pop {r0} bx r0 @@ -354105,7 +354106,7 @@ sub_80C5484: ; 80C5484 bl remove_some_task bl vblank_hblank_handler_set_zero movs r0, 0x2 - bl disable_irqs + bl DisableInterrupts b @080C56F4 @080C54EE: bl sub_80C50D0 @@ -354122,30 +354123,30 @@ sub_80C5484: ; 80C5484 b @080C56F4 @080C5510: movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085713E8 movs r0, 0x1 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x02039cf0 ldr r1, [r4] adds r1, 0x32 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00001032 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00002032 adds r1, r0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0x2 movs r1, 0x6 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute b @080C56F4 .pool @080C5560: @@ -354201,27 +354202,27 @@ sub_80C5484: ; 80C5484 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r5, [sp] str r4, [sp, 0x4] movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r5, [sp] str r4, [sp, 0x4] movs r0, 0x2 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080C56F4 @080C5624: ldr r4, =gUnknown_08DE07C8 @@ -354268,13 +354269,13 @@ sub_80C5484: ; 80C5484 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg bl sub_80C62DC ldr r0, =pokemon_details bl SetVBlankCallback @@ -354377,13 +354378,13 @@ sub_80C570C: ; 80C570C @080C577C: movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x2 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0 bl SetVBlankCallback bl remove_some_task @@ -354400,11 +354401,11 @@ sub_80C570C: ; 80C570C b @080C57E4 @080C57BE: movs r0, 0 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x2 - bl bg_unset_tilemap + bl UnsetBgTileMap bl sub_80C5340 ldr r0, =0x02039cec ldr r1, [r0] @@ -354528,7 +354529,7 @@ sub_80C5868: ; 80C5868 bl AddTask @080C58C0: ldr r0, =sub_80C5438 - bl set_callback2 + bl SetMainCallback2 @080C58C6: pop {r0} bx r0 @@ -354572,7 +354573,7 @@ sub_80C58D4: ; 80C58D4 bl song_play_for_text @080C5924: ldr r0, =sub_80C5868 - bl set_callback2 + bl SetMainCallback2 pop {r4} pop {r0} bx r0 @@ -354665,7 +354666,7 @@ sub_80C59A4: ; 80C59A4 adds r0, r3, 0 bl remove_task ldr r0, =sub_80C5934 - bl set_callback2 + bl SetMainCallback2 b @080C5A1A .pool @080C59F4: @@ -354844,7 +354845,7 @@ sub_80C5A48: ; 80C5A48 movs r0, 0x3 bl audio_play ldr r0, =sub_80C5470 - bl set_callback2 + bl SetMainCallback2 adds r0, r6, 0 bl remove_task @080C5B5E: @@ -354857,7 +354858,7 @@ sub_80C5A48: ; 80C5A48 movs r0, 0x3 bl audio_play ldr r0, =sub_80C5470 - bl set_callback2 + bl SetMainCallback2 adds r0, r6, 0 bl remove_task b @080C5BCA @@ -354971,13 +354972,13 @@ sub_80C5BD8: ; 80C5BD8 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg bl sub_80C62DC ldr r0, =pokemon_details bl SetVBlankCallback @@ -355075,7 +355076,7 @@ sub_80C5BD8: ; 80C5BD8 adds r0, r4, 0 bl remove_task ldr r0, =sub_80C5934 - bl set_callback2 + bl SetMainCallback2 b @080C5D82 .pool @080C5D64: @@ -355097,7 +355098,7 @@ sub_80C5BD8: ; 80C5BD8 movs r0, 0x2 movs r1, 0x6 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r0, =0x02039cec ldr r1, [r0] movs r0, 0 @@ -355230,7 +355231,7 @@ sub_80C5DB8: ; 80C5DB8 cmp r4, 0x4 bls @080C5E92 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0xC pop {r3} mov r8, r3 @@ -355293,7 +355294,7 @@ sub_80C5ED0: ; 80C5ED0 movs r1, 0x3 bl CopyWindowToVram movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0xC pop {r4} pop {r0} @@ -355337,7 +355338,7 @@ sub_80C5F58: ; 80C5F58 movs r0, 0x2 movs r2, 0x10 movs r3, 0x3 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette b @080C6004 .pool @080C5FA8: @@ -355351,7 +355352,7 @@ sub_80C5F58: ; 80C5F58 movs r1, 0 movs r2, 0x10 movs r3, 0x3 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect b @080C6004 @080C5FC2: cmp r2, 0 @@ -355369,7 +355370,7 @@ sub_80C5F58: ; 80C5F58 movs r0, 0x2 movs r2, 0x10 movs r3, 0xA - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette b @080C6004 .pool @080C5FEC: @@ -355383,10 +355384,10 @@ sub_80C5F58: ; 80C5F58 movs r1, 0 movs r2, 0x10 movs r3, 0xA - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @080C6004: movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram cmp r7, 0 beq @080C6084 movs r4, 0xFE @@ -355439,7 +355440,7 @@ sub_80C5F58: ; 80C5F58 movs r0, 0 str r0, [sp, 0xC] movs r0, 0x2 - bl call_gpu_bg_affine_set + bl SetBgAffine b @080C60EE .pool @080C6084: @@ -355492,7 +355493,7 @@ sub_80C5F58: ; 80C5F58 str r0, [sp, 0x8] str r7, [sp, 0xC] movs r0, 0x2 - bl call_gpu_bg_affine_set + bl SetBgAffine @080C60EE: add sp, 0x10 pop {r3} @@ -355537,7 +355538,7 @@ sub_80C6104: ; 80C6104 movs r0, 0x1 movs r2, 0x10 movs r3, 0x3 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette b @080C61CE .pool @080C614C: @@ -355577,7 +355578,7 @@ sub_80C6104: ; 80C6104 movs r2, 0x2 @080C6192: movs r3, 0xA - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette b @080C61CE .pool @080C61A4: @@ -355591,7 +355592,7 @@ sub_80C6104: ; 80C6104 movs r0, 0x1 movs r2, 0x15 movs r3, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette b @080C61CE .pool @080C61C4: @@ -355628,7 +355629,7 @@ sub_80C6104: ; 80C6104 movs r0, 0x1 movs r2, 0x10 movs r3, 0x3 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette b @080C628E .pool @080C620C: @@ -355669,7 +355670,7 @@ sub_80C6104: ; 80C6104 movs r2, 0x2 @080C6254: movs r3, 0xA - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette b @080C628E .pool @080C6264: @@ -355683,7 +355684,7 @@ sub_80C6104: ; 80C6104 movs r0, 0x1 movs r2, 0x15 movs r3, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette b @080C628E .pool @080C6284: @@ -355694,7 +355695,7 @@ sub_80C6104: ; 80C6104 bhi @080C6294 @080C628E: movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @080C6294: add sp, 0xC pop {r4,r5} @@ -355709,7 +355710,7 @@ sub_80C629C: ; 80C629C movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r4, =0x02039cec ldr r1, [r4] ldrb r0, [r1, 0xC] @@ -355723,7 +355724,7 @@ sub_80C629C: ; 80C629C bl sub_80C5F58 bl sub_80C5DB8 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r4} pop {r0} bx r0 @@ -355911,10 +355912,10 @@ sub_80C6454: ; 80C6454 cmp r0, 0 beq @080C6466 adds r0, r4, 0 - bl set_callback2 + bl SetMainCallback2 @080C6466: ldr r0, =0x00003014 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] str r4, [r0] bl clear_tasks @@ -355922,7 +355923,7 @@ sub_80C6454: ; 80C6454 movs r1, 0 bl AddTask ldr r0, =sub_80C5438 - bl set_callback2 + bl SetMainCallback2 pop {r4,r5} pop {r0} bx r0 @@ -355936,13 +355937,13 @@ sub_80C6498: ; 80C6498 ldr r4, =0x02039cf4 ldr r0, [r4] ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 ldr r0, [r4] ldr r2, =0x00003014 movs r1, 0 bl memset ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] pop {r4} @@ -355995,26 +355996,26 @@ sub_80C64CC: ; 80C64CC b @080C6694 @080C6538: movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085713F4 movs r0, 0 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x02039cf4 ldr r1, [r4] adds r1, 0x12 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00001012 adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00002012 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap movs r5, 0x1E str r5, [sp] movs r4, 0x14 @@ -356023,25 +356024,25 @@ sub_80C64CC: ; 80C64CC movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r5, [sp] str r4, [sp, 0x4] movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r5, [sp] str r4, [sp, 0x4] movs r0, 0x2 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080C6618 .pool @080C65C0: @@ -356077,23 +356078,23 @@ sub_80C64CC: ; 80C64CC movs r0, 0x2 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer @080C6618: movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080C6694 .pool @080C6628: movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg bl sub_80C6974 ldr r0, =pokemon_details bl SetVBlankCallback @@ -356181,13 +356182,13 @@ sub_80C66AC: ; 80C66AC bne @080C67AE movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x2 - bl gpu_sync_bg_hide + bl HideBg b @080C67A4 @080C6722: movs r0, 0 @@ -356231,11 +356232,11 @@ sub_80C66AC: ; 80C66AC b @080C67A4 @080C6782: movs r0, 0 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x2 - bl bg_unset_tilemap + bl UnsetBgTileMap ldr r0, =0x02039cec ldr r1, [r0] movs r0, 0 @@ -356828,7 +356829,7 @@ sub_80C6B94: ; 80C6B94 cmp r4, 0x2 bls @080C6C40 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0xC pop {r4-r6} pop {r0} @@ -356952,7 +356953,7 @@ sub_80C6C70: ; 80C6C70 cmp r4, 0x2 bls @080C6D4A movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x6C bl audio_play add sp, 0xC @@ -358096,7 +358097,7 @@ sub_80C7678: ; 80C7678 ldr r0, =mapldr_0808C6D8 str r0, [r1] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -358933,7 +358934,7 @@ sub_80C7D28: ; 80C7D28 adds r0, r1 ldrh r1, [r0] movs r0, 0x18 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -358962,12 +358963,12 @@ sub_80C7D74: ; 80C7D74 strb r5, [r0] ldr r4, =0x02039d08 ldr r0, =0x000062c4 - bl malloc + bl Alloc str r0, [r4] cmp r0, 0 bne @080C7DA8 ldr r0, =sub_80C7678 - bl set_callback2 + bl SetMainCallback2 b @080C7DD4 .pool @080C7DA8: @@ -358989,7 +358990,7 @@ sub_80C7D74: ; 80C7D74 ldr r1, =0x02039d10 strb r0, [r1] ldr r0, =c2_Box - bl set_callback2 + bl SetMainCallback2 @080C7DD4: pop {r4,r5} pop {r0} @@ -359003,13 +359004,13 @@ c2_808CE60: ; 80C7DEC bl clear_tasks ldr r4, =0x02039d08 ldr r0, =0x000062c4 - bl malloc + bl Alloc adds r1, r0, 0 str r1, [r4] cmp r1, 0 bne @080C7E18 ldr r0, =sub_80C7678 - bl set_callback2 + bl SetMainCallback2 b @080C7E3C .pool @080C7E18: @@ -359028,7 +359029,7 @@ c2_808CE60: ; 80C7DEC ldr r1, [r4] strb r0, [r1, 0x4] ldr r0, =c2_Box - bl set_callback2 + bl SetMainCallback2 @080C7E3C: pop {r4} pop {r0} @@ -359041,28 +359042,28 @@ sub_80C7E50: ; 80C7E50 push {lr} movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 thumb_func_end sub_80C7E50 @@ -359150,15 +359151,15 @@ sub_80C7F4C: ; 80C7F4C movs r1, 0xFC lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000b07 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @080C7F6A: movs r1, 0xFA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -359219,7 +359220,7 @@ task_box_related_3: ; 80C7FA8 bl SetVBlankCallback movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl sub_80C7E98 ldr r0, =0x02039d08 ldr r0, [r0] @@ -359488,7 +359489,7 @@ box_related_2: ; 80C81F8 b @080C82A0 .pool @080C8268: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C82A0 @@ -359507,7 +359508,7 @@ box_related_2: ; 80C81F8 b @080C82A0 .pool @080C8290: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C82A0 @@ -361144,7 +361145,7 @@ sub_80C9128: ; 80C9128 strb r0, [r1] b @080C91D2 @080C91C2: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C91D2 @@ -361224,7 +361225,7 @@ sub_80C91DC: ; 80C91DC b @080C928C .pool @080C927C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C928C @@ -361329,7 +361330,7 @@ sub_80C9298: ; 80C9298 b @080C93A2 .pool @080C9374: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C93A2 @@ -361440,7 +361441,7 @@ sub_80C93B0: ; 80C93B0 b @080C948C .pool @080C947C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C948C @@ -361480,7 +361481,7 @@ sub_80C9498: ; 80C9498 bl sub_80CADC4 b @080C9522 @080C94DA: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C9544 @@ -361493,7 +361494,7 @@ sub_80C9498: ; 80C9498 bl sub_80D184C b @080C951C @080C94FA: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy b @080C951C @080C9500: ldr r0, =0x030022c0 @@ -361521,7 +361522,7 @@ sub_80C9498: ; 80C9498 b @080C9544 .pool @080C9534: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C9544 @@ -361649,7 +361650,7 @@ sub_80C954C: ; 80C954C b @080C9664 .pool @080C9654: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C9664 @@ -361722,7 +361723,7 @@ sub_80C96B8: ; 80C96B8 bl sub_80CAC58 b @080C9702 @080C96E6: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C9720 @@ -361743,7 +361744,7 @@ sub_80C96B8: ; 80C96B8 b @080C9720 .pool @080C9710: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C9720 @@ -361959,7 +361960,7 @@ sub_80C9824: ; 80C9824 movs r0, 0x6 b @080C99CA @080C990C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C99CC @@ -362027,7 +362028,7 @@ sub_80C9824: ; 80C9824 b @080C99CC .pool @080C99AC: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080C99CC @@ -362598,7 +362599,7 @@ sub_80C9E50: ; 80C9E50 @080C9E9E: bl sub_80C9FC8 ldr r0, =sub_80C7678 - bl set_callback2 + bl SetMainCallback2 b @080C9F56 .pool @080C9EB4: @@ -362725,7 +362726,7 @@ sub_80C9FC8: ; 80C9FC8 bl sub_80D01B8 ldr r4, =0x02039d08 ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] bl FreeAllWindowBuffers @@ -362741,7 +362742,7 @@ sub_80C9FEC: ; 80C9FEC sub sp, 0x4 ldr r1, =0x00001f0f movs r0, 0xE - bl lcd_io_set + bl SetGpuReg ldr r1, =gUnknown_085720DC movs r0, 0 str r0, [sp] @@ -362764,11 +362765,11 @@ sub_80CA028: ; 80CA028 movs r0, 0x3 movs r1, 0x80 movs r2, 0x1 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0x80 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY pop {r0} bx r0 thumb_func_end sub_80CA028 @@ -362780,7 +362781,7 @@ sub_80CA044: ; 80CA044 ldr r1, =gUnknown_08572734 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r1, =gUnknown_08DD2FE8 movs r0, 0 str r0, [sp] @@ -362797,9 +362798,9 @@ sub_80CA044: ; 80CA044 ldr r1, [r5] adds r1, r4 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram add sp, 0x4 @@ -362872,7 +362873,7 @@ sub_80CA0D8: ; 80CA0D8 @080CA12E: ldr r1, =0x00001e05 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg bl sub_80CA318 bl sub_80CA154 bl sub_80CA1C4 @@ -363038,7 +363039,7 @@ BoxSetMosaic: ; 80CA260 lsls r1, 16 lsrs r1, 16 movs r0, 0x4C - bl lcd_io_set + bl SetGpuReg @080CA2AC: pop {r0} bx r0 @@ -363081,7 +363082,7 @@ BoxSetMosaic2: ; 80CA2D0 lsls r1, 16 lsrs r1, 16 movs r0, 0x4C - bl lcd_io_set + bl SetGpuReg movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0 @@ -363765,7 +363766,7 @@ sub_80CA8C8: ; 80CA8C8 movs r0, 0x1 str r0, [sp, 0x4] movs r2, 0xA - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0x8 negs r0, r0 bl sub_80CBAF0 @@ -364146,7 +364147,7 @@ sub_80CAC1C: ; 80CAC1C movs r1, 0xE8 lsls r1, 5 movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x2 movs r2, 0xD0 @@ -364161,9 +364162,9 @@ sub_80CAC1C: ; 80CAC1C movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0xC pop {r0} bx r0 @@ -367097,9 +367098,9 @@ sub_80CC370: ; 80CC370 ldr r2, =0x00004ac4 adds r1, r2 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg b @080CC458 .pool @080CC41C: @@ -367118,7 +367119,7 @@ sub_80CC370: ; 80CC370 bl sub_80CB028 ldr r1, =0x00005b0a movs r0, 0xC - bl lcd_io_set + bl SetGpuReg b @080CC458 .pool @080CC44C: @@ -367639,7 +367640,7 @@ sub_80CC7A0: ; 80CC7A0 ldrb r3, [r3] lsls r3, 8 movs r0, 0x2 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @080CC9DA .pool @080CC8C4: @@ -367744,7 +367745,7 @@ sub_80CC7A0: ; 80CC7A0 adds r0, r4, 0 bl CpuSet adds r0, r4, 0 - bl free + bl Free ldr r0, [r6] adds r5, r0, r5 ldr r1, [r5] @@ -367756,10 +367757,10 @@ sub_80CC7A0: ; 80CC7A0 ldrb r3, [r0] lsls r3, 8 movs r0, 0x2 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles @080CC9DA: movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x8 pop {r4-r7} pop {r0} @@ -367770,7 +367771,7 @@ sub_80CC7A0: ; 80CC7A0 thumb_func_start sub_80CCA00 sub_80CCA00: ; 80CCA00 push {r4,r5,lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 @@ -367785,7 +367786,7 @@ sub_80CCA00: ; 80CCA00 ldr r0, [r0] cmp r0, 0 beq @080CCA2C - bl free + bl Free ldr r0, [r5] ldr r1, =0x00000a68 adds r0, r1 @@ -367846,7 +367847,7 @@ sub_80CCA3C: ; 80CCA3C adds r1, r5, 0 movs r2, 0 movs r3, 0 - bl bg_copy_tilemap_rect + bl CopyRectToBgTileMapBufferRect cmp r7, 0 beq @080CCAD2 cmp r7, 0 @@ -367874,7 +367875,7 @@ sub_80CCA3C: ; 80CCA3C movs r0, 0x2 movs r1, 0 movs r3, 0x2 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @080CCAD2: add sp, 0x24 pop {r4-r7} @@ -374298,7 +374299,7 @@ sub_80D0164: ; 80D0164 push {r4,lr} ldr r4, =0x02039d80 ldr r0, =0x00000974 - bl malloc + bl Alloc str r0, [r4] cmp r0, 0 beq @080D01B0 @@ -374337,7 +374338,7 @@ sub_80D01B8: ; 80D01B8 ldr r0, [r0] cmp r0, 0 beq @080D01C6 - bl free + bl Free @080D01C6: pop {r0} bx r0 @@ -374427,7 +374428,7 @@ sub_80D024C: ; 80D024C b @080D0338 @080D026E: movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x80 bl sub_80D304C b @080D030E @@ -374445,11 +374446,11 @@ sub_80D024C: ; 80D024C movs r0, 0 adds r1, r4, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 adds r1, r4, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x20 str r0, [sp] str r0, [sp, 0x4] @@ -374457,7 +374458,7 @@ sub_80D024C: ; 80D024C movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 ldr r5, =0x02039d08 ldr r0, [r5] movs r4, 0x88 @@ -374473,7 +374474,7 @@ sub_80D024C: ; 80D024C movs r0, 0 movs r1, 0x4 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r0, [r5] adds r0, r4 ldrb r0, [r0] @@ -374492,7 +374493,7 @@ sub_80D024C: ; 80D024C bl sub_80CFE54 movs r0, 0x8 movs r1, 0x80 - bl lcd_io_set_bits + bl SetGpuRegBits @080D030E: ldr r1, [r6] ldrb r0, [r1, 0x1] @@ -374501,12 +374502,12 @@ sub_80D024C: ; 80D024C b @080D0338 .pool @080D0324: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080D0338 movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0 b @080D033A @080D0338: @@ -374538,7 +374539,7 @@ sub_80D0344: ; 80D0344 b @080D03A8 @080D0366: movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg b @080D0378 @080D036E: bl sub_80D0B5C @@ -374551,7 +374552,7 @@ sub_80D0344: ; 80D0344 strb r0, [r1, 0x1] b @080D03A8 @080D0382: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080D03A8 @@ -374562,7 +374563,7 @@ sub_80D0344: ; 80D0344 movs r2, 0x20 bl gpu_pal_apply movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0 b @080D03AA @080D03A8: @@ -374616,7 +374617,7 @@ sub_80D03B0: ; 80D03B0 b @080D0416 .pool @080D040C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @080D0418 @@ -374762,7 +374763,7 @@ sub_80D04C8: ; 80D04C8 movs r0, 0x1 bl sub_80CDC64 movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg b @080D0546 @080D0532: bl sub_80CDCAC @@ -374779,7 +374780,7 @@ sub_80D04C8: ; 80D04C8 strb r0, [r1, 0x1] b @080D0576 @080D0550: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @080D0576 @@ -374790,7 +374791,7 @@ sub_80D04C8: ; 80D04C8 bl gpu_pal_apply bl sub_80CFE84 movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0 b @080D0578 @080D0576: @@ -375161,7 +375162,7 @@ sub_80D07B0: ; 80D07B0 adds r1, r4, 0 movs r2, 0 movs r3, 0 - bl BlitSurfaceRectToWindow4BitTo8Bit + bl BlitBitmapRectToWindow4BitTo8Bit @080D0828: add sp, 0x1C pop {r4-r7} @@ -375234,12 +375235,12 @@ sub_80D0894: ; 80D0894 ldrh r1, [r1, 0xC] movs r0, 0 movs r2, 0x1 - bl bg_change_x_offset + bl ChangeBgX ldr r0, [r4] ldrh r1, [r0, 0xE] movs r0, 0 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY ldr r1, [r4] ldrh r0, [r1, 0x10] subs r0, 0x1 @@ -375608,18 +375609,18 @@ sub_80D0B5C: ; 80D0B5C movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0 movs r1, 0x4 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x8 movs r1, 0x80 - bl lcd_io_clear_bits + bl ResetGpuRegBits movs r0, 0x20 str r0, [sp] str r0, [sp, 0x4] @@ -375627,9 +375628,9 @@ sub_80D0B5C: ; 80D0B5C movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x8 pop {r0} bx r0 @@ -377154,7 +377155,7 @@ sub_80D1818: ; 80D1818 lsls r3, 1 movs r0, 0 movs r2, 0x80 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles movs r0, 0 bl sub_80D19B4 pop {r0} @@ -377188,7 +377189,7 @@ sub_80D184C: ; 80D184C @080D187C: movs r0, 0 movs r1, 0xA - bl bg_get_field + bl GetBgAttribute adds r1, r0, 0 ldr r0, =0x02039d08 ldr r0, [r0] @@ -377212,7 +377213,7 @@ sub_80D184C: ; 80D184C str r0, [sp, 0xC] movs r0, 0 movs r3, 0xD - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer adds r4, 0x1 cmp r4, r5 blt @080D187C @@ -377262,7 +377263,7 @@ sub_80D18E4: ; 80D18E4 movs r1, 0 movs r2, 0x15 movs r3, 0xC - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @080D1920: ldr r1, [r5] adds r1, r4 @@ -377278,7 +377279,7 @@ sub_80D18E4: ; 80D18E4 @080D1936: movs r0, 0 movs r1, 0xA - bl bg_get_field + bl GetBgAttribute adds r1, r0, 0 ldr r0, =0x02039d08 ldr r0, [r0] @@ -377302,7 +377303,7 @@ sub_80D18E4: ; 80D18E4 str r0, [sp, 0xC] movs r0, 0 movs r3, 0xD - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer adds r4, 0x1 cmp r4, r5 blt @080D1936 @@ -377324,7 +377325,7 @@ sub_80D18E4: ; 80D18E4 movs r0, 0 movs r1, 0 movs r3, 0xC - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0 bl schedule_bg_copy_tilemap_to_vram movs r0, 0x1 @@ -377355,7 +377356,7 @@ sub_80D19B4: ; 80D19B4 movs r0, 0 movs r2, 0 movs r3, 0xC - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x0000093a str r4, [sp] str r6, [sp, 0x4] @@ -377363,7 +377364,7 @@ sub_80D19B4: ; 80D19B4 movs r0, 0 movs r2, 0 movs r3, 0x14 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @080D19EC: ldr r1, =0x0000013b lsls r5, r7, 24 @@ -377377,7 +377378,7 @@ sub_80D19B4: ; 80D19B4 movs r0, 0 adds r2, r5, 0 movs r3, 0xD - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r1, 0x9E lsls r1, 1 str r4, [sp] @@ -377386,7 +377387,7 @@ sub_80D19B4: ; 80D19B4 movs r0, 0 adds r2, r5, 0 movs r3, 0xC - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x0000013d str r4, [sp] str r4, [sp, 0x4] @@ -377394,7 +377395,7 @@ sub_80D19B4: ; 80D19B4 movs r0, 0 adds r2, r5, 0 movs r3, 0x14 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0 bl schedule_bg_copy_tilemap_to_vram add sp, 0xC @@ -378958,7 +378959,7 @@ sub_80D259C: ; 80D259C lsls r0, r4, 1 adds r0, r4 lsls r0, 4 - bl malloc + bl Alloc str r0, [r6] ldr r5, =0x02039d88 movs r1, 0 @@ -378999,7 +379000,7 @@ sub_80D25F0: ; 80D25F0 push {lr} ldr r0, =0x02039d84 ldr r0, [r0] - bl free + bl Free pop {r0} bx r0 .pool @@ -379086,13 +379087,13 @@ sub_80D2644: ; 80D2644 strh r1, [r0, 0x26] adds r0, r7, 0 movs r1, 0x3 - bl bg_get_field + bl GetBgAttribute adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r7, 0 movs r1, 0x9 - bl bg_get_field + bl GetBgAttribute lsls r0, 16 lsrs r0, 16 mov r2, r9 @@ -379502,7 +379503,7 @@ sub_80D2960: ; 80D2960 movs r1, 0x1 str r1, [sp, 0x4] adds r1, r7, 0 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect add r7, r9 adds r6, 0x1 mov r1, r10 @@ -379582,7 +379583,7 @@ sub_80D29F8: ; 80D29F8 movs r1, 0x1 str r1, [sp, 0x4] adds r1, r7, 0 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect add r7, r9 adds r6, 0x1 mov r1, r10 @@ -381814,7 +381815,7 @@ sub_80D3B00: ; 80D3B00 bl cur_mapdata_full_redraw ldr r4, =0x02039dd0 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r6, 0 ldr r5, =0x02020630 @@ -382590,7 +382591,7 @@ sub_80D41D0: ; 80D41D0 movs r1, 0x3A bl FieldEffectStop ldr r0, [r6] - bl free + bl Free movs r0, 0 str r0, [r6] bl sub_80984F4 @@ -383374,7 +383375,7 @@ sub_80D47E4: ; 80D47E4 strb r0, [r4] movs r0, 0x12 movs r1, 0x28 - bl lcd_io_set + bl SetGpuReg ldr r2, =0x03005e00 ldrb r1, [r4] lsls r0, r1, 2 @@ -383536,7 +383537,7 @@ sub_80D487C: ; 80D487C @080D4966: ldrh r1, [r4, 0xC] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg @080D496E: pop {r4} pop {r0} @@ -383559,7 +383560,7 @@ call_203AE8C: ; 80D4974 bl sub_8197A80 movs r0, 0x12 movs r1, 0 - bl lcd_io_set_forced_blank + bl SetGpuReg_ScreenOff ldr r0, =0x02039dd4 ldrb r0, [r0] bl remove_task @@ -383704,7 +383705,7 @@ sub_80D4A78: ; 80D4A78 adds r0, r7, 0 mov r6, r8 lsrs r3, r6, 24 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r4, 0x1 adds r5, 0x1 cmp r5, 0xB @@ -383724,7 +383725,7 @@ sub_80D4A78: ; 80D4A78 adds r0, r7, 0 mov r2, r8 ldr r3, [sp, 0xC] - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x0000022a ldr r6, [sp, 0x10] add r6, r10 @@ -383737,7 +383738,7 @@ sub_80D4A78: ; 80D4A78 adds r0, r7, 0 adds r2, r6, 0 ldr r3, [sp, 0xC] - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x0000022b ldr r4, [sp, 0xC] adds r4, 0x1 @@ -383750,7 +383751,7 @@ sub_80D4A78: ; 80D4A78 adds r0, r7, 0 mov r2, r8 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r1, 0x8B lsls r1, 2 str r5, [sp] @@ -383760,7 +383761,7 @@ sub_80D4A78: ; 80D4A78 adds r0, r7, 0 adds r2, r6, 0 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x0000022d ldr r4, [sp, 0xC] adds r4, 0x2 @@ -383773,7 +383774,7 @@ sub_80D4A78: ; 80D4A78 adds r0, r7, 0 mov r2, r8 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x0000022e str r5, [sp] str r5, [sp, 0x4] @@ -383782,7 +383783,7 @@ sub_80D4A78: ; 80D4A78 adds r0, r7, 0 adds r2, r6, 0 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r5, 0 ldr r1, [sp, 0xC] ldr r2, [sp, 0x14] @@ -383806,7 +383807,7 @@ sub_80D4A78: ; 80D4A78 str r0, [sp, 0x8] adds r0, r7, 0 lsrs r3, r4, 24 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r5, 0x1 cmp r5, 0xB ble @080D4B8A @@ -383859,7 +383860,7 @@ sub_80D4BE0: ; 80D4BE0 movs r2, 0x80 lsls r2, 3 ldr r3, =0x0000021d - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, =sub_80D4A78 adds r0, r5, 0 bl CallWindowFunction @@ -383895,7 +383896,7 @@ sub_80D4BE0: ; 80D4BE0 adds r0, r5, 0 movs r2, 0 movs r3, 0 - bl BlitSurfaceToWindow + bl BlitBitmapToWindow add sp, 0x8 pop {r4,r5} pop {r0} @@ -387537,7 +387538,7 @@ bag_add_item: ; 80D6928 adds r7, r1, r0 ldrb r0, [r7, 0x4] lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed mov r8, r0 ldr r1, [r7] ldrb r2, [r7, 0x4] @@ -387651,7 +387652,7 @@ bag_add_item: ; 80D6928 b @080D6A7E @080D6A74: mov r0, r8 - bl free + bl Free movs r0, 0 b @080D6A92 @080D6A7E: @@ -387661,7 +387662,7 @@ bag_add_item: ; 80D6928 mov r1, r8 bl memcpy mov r0, r8 - bl free + bl Free movs r0, 0x1 @080D6A92: add sp, 0x8 @@ -388058,7 +388059,7 @@ sub_80D6D70: ; 80D6D70 lsls r1, 16 lsrs r5, r1, 16 movs r0, 0xC8 - bl malloc_and_clear + bl AllocZeroed adds r7, r0, 0 ldr r0, =0x03005d8c ldr r1, [r0] @@ -388110,7 +388111,7 @@ sub_80D6D70: ; 80D6D70 cmp r1, r0 bne @080D6E10 adds r0, r7, 0 - bl free + bl Free movs r0, 0 b @080D6E3A .pool @@ -388138,7 +388139,7 @@ sub_80D6D70: ; 80D6D70 movs r2, 0xC8 bl memcpy adds r0, r7, 0 - bl free + bl Free movs r0, 0x1 @080D6E3A: pop {r3} @@ -388703,10 +388704,10 @@ sub_80D7204: ; 80D7204 adds r3, r0 mov r8, r3 movs r0, 0x14 - bl malloc + bl Alloc adds r5, r0, 0 movs r0, 0xA - bl malloc + bl Alloc adds r6, r0, 0 adds r0, r5, 0 mov r1, r9 @@ -388789,9 +388790,9 @@ sub_80D7204: ; 80D7204 cmp r4, 0 beq @080D7304 adds r0, r5, 0 - bl free + bl Free adds r0, r6, 0 - bl free + bl Free movs r0, 0 b @080D7326 @080D7304: @@ -388804,9 +388805,9 @@ sub_80D7204: ; 80D7204 movs r2, 0xA bl memcpy adds r0, r5, 0 - bl free + bl Free adds r0, r6, 0 - bl free + bl Free movs r0, 0x1 @080D7326: pop {r3,r4} @@ -388876,10 +388877,10 @@ sub_80D7334: ; 80D7334 .pool @080D73B4: movs r0, 0x14 - bl malloc + bl Alloc adds r5, r0, 0 movs r0, 0xA - bl malloc + bl Alloc adds r6, r0, 0 adds r0, r5, 0 mov r1, r8 @@ -388928,9 +388929,9 @@ sub_80D7334: ; 80D7334 cmp r4, 0 beq @080D742C adds r0, r5, 0 - bl free + bl Free adds r0, r6, 0 - bl free + bl Free movs r0, 0 b @080D744E @080D742C: @@ -388943,9 +388944,9 @@ sub_80D7334: ; 80D7334 movs r2, 0xA bl memcpy adds r0, r5, 0 - bl free + bl Free adds r0, r6, 0 - bl free + bl Free @080D744C: movs r0, 0x1 @080D744E: @@ -389264,27 +389265,27 @@ sub_80D7678: ; 80D7678 push {r4,lr} movs r0, 0 movs r1, 0x40 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x00003f3f movs r0, 0x48 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0xFE lsls r1, 7 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] @@ -389330,9 +389331,9 @@ sub_80D7724: ; 80D7724 movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =gUnknown_08C16E90 movs r2, 0x80 lsls r2, 2 @@ -389365,15 +389366,15 @@ sub_80D7724: ; 80D7724 sub_80D779C: ; 80D779C push {r4,lr} movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_08587F34 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0x3 movs r1, 0x6 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r4, 0 @080D77BA: lsls r0, r4, 24 @@ -389384,7 +389385,7 @@ sub_80D779C: ; 80D779C adds r1, 0x24 adds r1, r2 ldr r1, [r1] - bl bg_set_tilemap + bl SetBgTileMap adds r4, 0x1 cmp r4, 0x3 ble @080D77BA @@ -389596,75 +389597,75 @@ sub_80D7988: ; 80D7988 push {r4,r5,lr} ldr r4, =0x02039f34 movs r0, 0x40 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r0, 0x5C - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1] movs r0, 0x70 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x4] movs r0, 0x14 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x8] movs r0, 0x44 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0xC] movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x10] movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x14] movs r0, 0x14 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x18] movs r0, 0x40 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x1C] movs r0, 0xC - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x20] movs r5, 0x80 lsls r5, 5 adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x24] adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x28] adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x2C] adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x30] movs r5, 0x80 lsls r5, 4 adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x34] adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x38] movs r0, 0x80 lsls r0, 6 - bl malloc_and_clear + bl AllocZeroed ldr r2, [r4] str r0, [r2, 0x3C] ldr r1, =0x0202305c @@ -389684,71 +389685,71 @@ sub_80D7A5C: ; 80D7A5C ldr r5, =0x02039f34 ldr r0, [r5] ldr r0, [r0] - bl free + bl Free ldr r0, [r5] movs r4, 0 str r4, [r0] ldr r0, [r0, 0x4] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x4] ldr r0, [r0, 0x8] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x8] ldr r0, [r0, 0xC] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0xC] ldr r0, [r0, 0x10] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x10] ldr r0, [r0, 0x14] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x14] ldr r0, [r0, 0x18] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x18] ldr r0, [r0, 0x1C] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x1C] ldr r0, [r0, 0x20] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x20] ldr r0, [r0, 0x24] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x24] ldr r0, [r0, 0x28] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x28] ldr r0, [r0, 0x2C] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x2C] ldr r0, [r0, 0x30] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x30] ldr r0, [r0, 0x34] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x34] ldr r0, [r0, 0x38] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x38] ldr r0, [r0, 0x3C] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x3C] - bl free + bl Free str r4, [r5] ldr r0, =0x0202305c str r4, [r0] @@ -389790,12 +389791,12 @@ sub_80D7B24: ; 80D7B24 ldr r4, =0x020244d4 ldr r0, [r4] ldr r0, [r0] - bl free + bl Free ldr r0, [r4] str r5, [r0] movs r0, 0x80 lsls r0, 7 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1] movs r0, 0 @@ -389873,7 +389874,7 @@ sub_80D7B24: ; 80D7B24 ldr r1, [r1] strb r0, [r1, 0x8] ldr r0, =sub_80D823C - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x2 @@ -390200,9 +390201,9 @@ sub_80D7E44: ; 80D7E44 movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080D80AE .pool @080D7F40: @@ -390210,9 +390211,9 @@ sub_80D7E44: ; 80D7E44 movs r0, 0x2 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =0x02039f34 ldr r0, [r0] ldr r1, [r0, 0x2C] @@ -390309,19 +390310,19 @@ sub_80D7E44: ; 80D7E44 strb r0, [r1] bl sub_80DEA20 movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg b @080D80AE .pool @080D80A4: @@ -390458,11 +390459,11 @@ sub_80D8108: ; 80D8108 .pool @080D81B0: movs r0, 0x8 - bl lcd_io_get + bl GetGpuReg mov r1, sp strh r0, [r1] movs r0, 0xC - bl lcd_io_get + bl GetGpuReg mov r4, sp adds r4, 0x2 strh r0, [r4] @@ -390479,10 +390480,10 @@ sub_80D8108: ; 80D8108 mov r0, sp ldrh r1, [r0] movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0xC - bl lcd_io_set + bl SetGpuReg bl sub_80DDB0C ldr r1, =0x03005e00 lsls r0, r5, 2 @@ -390540,7 +390541,7 @@ sub_80D823C: ; 80D823C beq @080D8266 lsls r0, r4, 24 lsrs r0, 24 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @080D8266: adds r4, 0x1 cmp r4, 0x3 @@ -390559,51 +390560,51 @@ vblank_cb_battle: ; 80D827C ldr r0, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1c ldrh r1, [r0] movs r0, 0x18 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1e ldrh r1, [r0] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e20 ldrh r1, [r0] movs r0, 0x1C - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e22 ldrh r1, [r0] movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e24 ldrh r1, [r0] movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e26 ldrh r1, [r0] movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e28 ldrh r1, [r0] movs r0, 0x42 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e2a ldrh r1, [r0] movs r0, 0x46 - bl lcd_io_set + bl SetGpuReg bl copy_pal_bg_faded_to_pal_ram bl copy_super_sprites_to_oam bl copy_queue_process @@ -394470,11 +394471,11 @@ sub_80DA51C: ; 80DA51C lsls r0, 24 lsrs r5, r0, 24 movs r0, 0x8 - bl lcd_io_get + bl GetGpuReg mov r1, sp strh r0, [r1] movs r0, 0xC - bl lcd_io_get + bl GetGpuReg mov r4, sp adds r4, 0x2 strh r0, [r4] @@ -394491,10 +394492,10 @@ sub_80DA51C: ; 80DA51C mov r0, sp ldrh r1, [r0] movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r2, =0x02039f34 ldr r0, [r2] ldr r1, [r0] @@ -394829,7 +394830,7 @@ sub_80DA830: ; 80DA830 bl sub_80D7A5C bl sub_805F094 ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 @080DA860: pop {r0} bx r0 @@ -399286,10 +399287,10 @@ sub_80DCBB4: ; 80DCBB4 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000907 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -399300,10 +399301,10 @@ sub_80DCBD0: ; 80DCBD0 push {lr} movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 thumb_func_end sub_80DCBD0 @@ -402065,7 +402066,7 @@ sub_80DE224: ; 80DE224 push {r7} sub sp, 0xC movs r0, 0xA - bl lcd_io_get + bl GetGpuReg mov r1, sp strh r0, [r1] mov r2, sp @@ -402095,14 +402096,14 @@ sub_80DE224: ; 80DE224 mov r0, sp ldrh r1, [r0] movs r0, 0xA - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 - bl lcd_io_get + bl GetGpuReg mov r6, sp adds r6, 0x2 strh r0, [r6] movs r0, 0xC - bl lcd_io_get + bl GetGpuReg add r5, sp, 0x4 strh r0, [r5] ldrb r1, [r6] @@ -402117,10 +402118,10 @@ sub_80DE224: ; 80DE224 strb r4, [r5] ldrh r1, [r6] movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r5] movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r1, =0x02022e18 movs r0, 0xF0 strh r0, [r1] @@ -402129,10 +402130,10 @@ sub_80DE224: ; 80DE224 strh r0, [r4] movs r0, 0x14 movs r1, 0xF0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg movs r0, 0 str r0, [sp, 0x8] add r0, sp, 0x8 @@ -402145,7 +402146,7 @@ sub_80DE224: ; 80DE224 movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x1 bl sub_80DED60 movs r5, 0 @@ -402212,7 +402213,7 @@ sub_80DE350: ; 80DE350 movs r0, 0x1 bl sub_80DED60 movs r0, 0xA - bl lcd_io_get + bl GetGpuReg add r3, sp, 0x4 strh r0, [r3] ldrb r1, [r3] @@ -402243,7 +402244,7 @@ sub_80DE350: ; 80DE350 strb r0, [r3] ldrh r1, [r3] movs r0, 0xA - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e18 strh r5, [r0] ldr r0, =0x02022e1a @@ -403359,7 +403360,7 @@ sub_80DECB8: ; 80DECB8 asrs r6, 16 str r6, [sp, 0xC] mov r0, r8 - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer mov r0, r8 bl sub_80DED60 add sp, 0x10 @@ -405331,7 +405332,7 @@ sub_80DFC48: ; 80DFC48 ldr r1, =sub_80DFCE0 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -405386,7 +405387,7 @@ sub_80DFCA4: ; 80DFCA4 lsls r0, 16 ldrh r1, [r4, 0x12] orrs r0, r1 - bl set_callback2 + bl SetMainCallback2 @080DFCD2: pop {r4} pop {r0} @@ -405529,7 +405530,7 @@ sub_80DFD94: ; 80DFD94 ldr r0, =sub_80DFD80 bl SetVBlankCallback ldr r0, =sub_80DFD64 - bl set_callback2 + bl SetMainCallback2 b @080DFEF4 .pool @080DFE20: @@ -405549,7 +405550,7 @@ sub_80DFD94: ; 80DFD94 bl clear_scheduled_bg_copies_to_vram ldr r4, =0x02039f70 ldr r0, =0x000020b0 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, =0x0000200b adds r0, r1 @@ -405576,28 +405577,28 @@ sub_80DFD94: ; 80DFD94 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x2 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x3 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 bl sub_80E0468 bl sub_80E0424 b @080DFEEE @@ -405623,13 +405624,13 @@ FreeShopItemNames: ; 80DFEFC push {lr} ldr r0, =0x02039f70 ldr r0, [r0] - bl free + bl Free ldr r0, =0x02039f74 ldr r0, [r0] - bl free + bl Free ldr r0, =0x02039f78 ldr r0, [r0] - bl free + bl Free bl FreeAllWindowBuffers pop {r0} bx r0 @@ -405644,13 +405645,13 @@ GetShopItemNames: ; 80DFF2C ldrh r0, [r4, 0xC] adds r0, 0x1 lsls r0, 3 - bl malloc + bl Alloc str r0, [r7] ldr r5, =0x02039f78 ldrh r0, [r4, 0xC] adds r0, 0x1 lsls r0, 4 - bl malloc + bl Alloc str r0, [r5] movs r6, 0 ldrh r0, [r4, 0xC] @@ -406133,69 +406134,69 @@ sub_80E031C: ; 80E031C sub_80E036C: ; 80E036C push {r4,lr} movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_08589A60 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x02039f70 ldr r1, [r4] movs r0, 0x80 lsls r0, 4 adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] movs r0, 0xC0 lsls r0, 5 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] movs r0, 0x80 lsls r0, 5 adds r1, r0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg pop {r4} pop {r0} bx r0 @@ -407764,7 +407765,7 @@ sub_80E11B0: ; 80E11B0 bl sub_80E53F4 bl FreeShopItemNames ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task @080E11D6: @@ -409171,7 +409172,7 @@ sub_80E1C54: ; 80E1C54 sub_80E1C94: ; 80E1C94 push {lr} ldr r0, =c2_810A554 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -411238,12 +411239,12 @@ do_choose_name_or_words_screen: ; 80E2D78 ldr r4, =0x02039f94 movs r0, 0xF2 lsls r0, 5 - bl malloc + bl Alloc str r0, [r4] cmp r0, 0 bne @080E2DA8 ldr r0, [sp, 0x1C] - bl set_callback2 + bl SetMainCallback2 b @080E2DE2 .pool @080E2DA8: @@ -411271,10 +411272,10 @@ do_choose_name_or_words_screen: ; 80E2D78 str r2, [r0] cmp r7, 0 bne @080E2DDC - bl start_timer1 + bl StartTimer1 @080E2DDC: ldr r0, =c2_choose_name_or_words_screen - bl set_callback2 + bl SetMainCallback2 @080E2DE2: pop {r3} mov r8, r3 @@ -411566,45 +411567,45 @@ choose_name_or_words_screen_init_bgs: ; 80E2FE4 ldr r0, [r2, 0x8] movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0858BE00 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY bl sub_81971D0 bl sub_8197200 @080E30D8: @@ -411626,29 +411627,29 @@ choose_name_or_words_screen_init_bgs: ; 80E2FE4 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0xC8 lsls r1, 3 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000080c movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r1, [r5] movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r5] movs r0, 0x80 lsls r0, 4 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r5] movs r2, 0x80 lsls r2, 5 adds r1, r2 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap movs r4, 0x20 str r4, [sp] str r4, [sp, 0x4] @@ -411656,21 +411657,21 @@ choose_name_or_words_screen_init_bgs: ; 80E2FE4 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x2 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x3 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 add sp, 0x10 pop {r3} mov r8, r3 @@ -411687,7 +411688,7 @@ sub_80E3194: ; 80E3194 movs r1, 0x2 bl AddTask ldr r0, =sub_80E4F58 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -411837,11 +411838,11 @@ sub_80E3294: ; 80E3294 bl sub_80E4964 bl sub_80E4EF0 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r4, 0x1 negs r4, r4 adds r0, r4, 0 @@ -412019,13 +412020,13 @@ sub_80E347C: ; 80E347C ldrb r0, [r0] cmp r0, 0 bne @080E34A0 - bl set_rand_seed_and_trainer_id_hi + bl SetRngAndSetTrainerId @080E34A0: ldr r0, [r4] ldr r1, =0x00001e3c adds r0, r1 ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_80E31B0 bl get_task_id_by_function lsls r0, 24 @@ -412033,7 +412034,7 @@ sub_80E347C: ; 80E347C bl remove_task bl FreeAllWindowBuffers ldr r0, [r4] - bl free + bl Free str r5, [r4] @080E34C6: movs r0, 0 @@ -414774,7 +414775,7 @@ sub_80E4AF8: ; 80E4AF8 strb r1, [r0] bl sub_80E4D10 movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, [r6] adds r0, r5 adds r0, r4 @@ -414821,7 +414822,7 @@ sub_80E4B54: ; 80E4B54 bl sub_80E4BBC bl sub_80E4D10 movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x5 bl audio_play bl sub_80E4AB4 @@ -414942,19 +414943,19 @@ choose_name_or_words_screen_load_bg_tile_patterns: ; 80E4C54 movs r0, 0x1 adds r2, r5, 0 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, [r6] adds r1, r4 movs r0, 0x2 adds r2, r5, 0 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, [r6] adds r1, r4 movs r0, 0x3 adds r2, r5, 0 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r0, =gUnknown_0858C1C8 bl gpu_tile_obj_alloc_and_load_multiple ldr r0, =gUnknown_0858C230 @@ -415002,7 +415003,7 @@ sub_80E4CF8: ; 80E4CF8 lsrs r0, 24 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer pop {r0} bx r0 thumb_func_end sub_80E4CF8 @@ -415172,12 +415173,12 @@ sub_80E4DE4: ; 80E4DE4 sub_80E4E5C: ; 80E4E5C push {r4-r6,lr} movs r0, 0xA - bl lcd_io_get + bl GetGpuReg adds r4, r0, 0 movs r5, 0x3 ands r4, r5 movs r0, 0xC - bl lcd_io_get + bl GetGpuReg ands r0, r5 cmp r4, r0 bls @080E4E8C @@ -415221,7 +415222,7 @@ sub_80E4E5C: ; 80E4E5C adds r0, r5, 0 bl nullsub_10 adds r0, r6, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r4-r6} pop {r0} bx r0 @@ -415316,38 +415317,38 @@ sub_80E4F94: ; 80E4F94 adds r0, r1 ldrh r1, [r0] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r0, [r5] ldr r1, =0x00001e1a adds r0, r1 ldrh r1, [r0] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg movs r0, 0xA - bl lcd_io_get + bl GetGpuReg ldr r4, =0x0000fffc adds r1, r4, 0 ands r1, r0 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg ldr r0, [r5] ldr r1, =0x00001e1c adds r0, r1 ldrh r1, [r0] movs r0, 0xA - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0xC - bl lcd_io_get + bl GetGpuReg ands r4, r0 movs r0, 0xC adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, [r5] ldr r1, =0x00001e1e adds r0, r1 ldrh r1, [r0] movs r0, 0xC - bl lcd_io_set_bits + bl SetGpuRegBits pop {r4,r5} pop {r0} bx r0 @@ -415358,13 +415359,13 @@ sub_80E4F94: ; 80E4F94 sub_80E501C: ; 80E501C push {lr} movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg pop {r0} bx r0 thumb_func_end sub_80E501C @@ -419578,11 +419579,11 @@ sub_80E715C: ; 80E715C @080E71A0: ldr r4, =0x0203a018 ldr r0, =0x00001444 - bl malloc + bl Alloc str r0, [r4] ldr r4, =0x0203a014 ldr r0, =0x00005110 - bl malloc + bl Alloc str r0, [r4] ldr r0, =0x020375e2 ldrb r0, [r0] @@ -419696,10 +419697,10 @@ sub_80E715C: ; 80E715C bne @080E730A ldr r0, =0x0203a014 ldr r0, [r0] - bl free + bl Free ldr r0, =0x0203a018 ldr r0, [r0] - bl free + bl Free bl sub_808729C ldr r0, =0x030030fc ldrb r0, [r0] @@ -420609,7 +420610,7 @@ sub_80E7A14: ; 80E7A14 cmp r0, 0 bne @080E7A60 movs r0, 0x40 - bl malloc + bl Alloc adds r4, r0, 0 cmp r4, 0 beq @080E7A8A @@ -420636,7 +420637,7 @@ sub_80E7A14: ; 80E7A14 adds r0, r4, 0 bl sub_818E570 adds r0, r4, 0 - bl free + bl Free @080E7A8A: add sp, 0x10 pop {r3} @@ -422600,7 +422601,7 @@ sub_80E89AC: ; 80E89AC lsrs r4, 24 movs r0, 0x81 lsls r0, 4 - bl malloc_and_clear + bl AllocZeroed adds r5, r0, 0 str r4, [sp] adds r1, r6, 0 @@ -422610,7 +422611,7 @@ sub_80E89AC: ; 80E89AC adds r0, r5, 0 bl sub_80E8924 adds r0, r5, 0 - bl free + bl Free add sp, 0x4 pop {r3,r4} mov r8, r3 @@ -423430,7 +423431,7 @@ sub_80E8FD0: ; 80E8FD0 ldr r1, =sub_80AF168 str r1, [r0] ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task @080E904A: @@ -423607,7 +423608,7 @@ sub_80E916C: ; 80E916C ldr r0, =sub_80E9108 str r0, [r1] ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 adds r0, r6, 0 bl remove_task @080E91D4: @@ -424230,7 +424231,7 @@ sub_80E96A4: ; 80E96A4 ldr r1, =mapldr_default str r1, [r0] ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 bl script_env_2_disable adds r0, r5, 0 bl remove_task @@ -424927,7 +424928,7 @@ sub_80E9C9C: ; 80E9C9C ldr r4, =0x0203a020 movs r0, 0xDC lsls r0, 1 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r0, =gUnknown_0858D06C bl AddWindow @@ -425179,7 +425180,7 @@ sub_80E9E90: ; 80E9E90 bl schedule_bg_copy_tilemap_to_vram ldr r0, =0x0203a020 ldr r0, [r0] - bl free + bl Free adds r0, r6, 0 bl task_pc_turn_off b @080E9F1A @@ -436528,7 +436529,7 @@ sub_80F01E8: ; 80F01E8 lsrs r6, r2, 24 movs r0, 0xE1 lsls r0, 4 - bl malloc + bl Alloc mov r8, r0 cmp r0, 0 bne @080F0206 @@ -436676,7 +436677,7 @@ sub_80F01E8: ; 80F01E8 bl sub_80F0708 bl sub_80F0B64 mov r0, r8 - bl free + bl Free @080F0344: pop {r3} mov r8, r3 @@ -437815,7 +437816,7 @@ sub_80F0C7C: ; 80F0C7C lsrs r6, r2, 24 movs r0, 0x80 lsls r0, 1 - bl malloc + bl Alloc adds r5, r0, 0 cmp r5, 0 beq @080F0D4C @@ -437898,7 +437899,7 @@ sub_80F0C7C: ; 80F0C7C bl sub_80F0EEC bl sub_80F0F24 adds r0, r5, 0 - bl free + bl Free @080F0D4C: pop {r3} mov r8, r3 @@ -438181,7 +438182,7 @@ sub_80F0F64: ; 80F0F64 adds r6, r0, 0 adds r5, r1, 0 movs r0, 0x2C - bl malloc_and_clear + bl AllocZeroed adds r4, r0, 0 movs r7, 0 @080F0F74: @@ -438491,7 +438492,7 @@ sub_80F0F64: ; 80F0F64 b @080F0F74 @080F11FC: adds r0, r4, 0 - bl free + bl Free pop {r4-r7} pop {r0} bx r0 @@ -445539,13 +445540,13 @@ sub_80F57C4: ; 80F57C4 push {r4,lr} movs r0, 0 movs r1, 0x40 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0858D888 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates movs r4, 0 @080F57E0: lsls r0, r4, 24 @@ -445556,7 +445557,7 @@ sub_80F57C4: ; 80F57C4 adds r1, 0xC adds r1, r2 ldr r1, [r1] - bl bg_set_tilemap + bl SetBgTileMap adds r4, 0x1 cmp r4, 0x3 ble @080F57E0 @@ -445565,62 +445566,62 @@ sub_80F57C4: ; 80F57C4 bl DeactivateAllTextPrinters movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f2e movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x42 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0xFF lsls r1, 8 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] @@ -445668,17 +445669,17 @@ sub_80F591C: ; 80F591C movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r1, =gUnknown_08C1A000 movs r0, 0x2 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r1, =gUnknown_08C19EEC movs r0, 0 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer bl sub_80F71C8 ldr r0, =gUnknown_08C1A2B4 movs r2, 0x80 @@ -445755,7 +445756,7 @@ sub_80F591C: ; 80F591C movs r0, 0x1 adds r2, r4, 0 lsrs r3, r7, 24 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 mov r2, r8 str r2, [sp] str r2, [sp, 0x4] @@ -445764,7 +445765,7 @@ sub_80F591C: ; 80F591C adds r2, r4, 0 mov r4, r9 lsrs r3, r4, 24 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 adds r6, 0x1 cmp r6, 0x9 ble @080F59B0 @@ -445772,21 +445773,21 @@ sub_80F591C: ; 80F591C cmp r7, 0x3 ble @080F5976 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg add sp, 0x10 pop {r3-r5} mov r8, r3 @@ -445854,7 +445855,7 @@ sub_80F5AE0: ; 80F5AE0 cmp r4, 0x3 ble @080F5AE4 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r4} pop {r0} bx r0 @@ -445915,7 +445916,7 @@ sub_80F5B00: ; 80F5B00 ldr r1, [r1] strb r0, [r1, 0x2] ldr r0, =sub_80F5C00 - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x02022e28 movs r0, 0xF0 strh r0, [r1] @@ -445960,9 +445961,9 @@ sub_80F5C00: ; 80F5C00 bl run_active_tasks bl fade_and_return_progress_probably movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r0} bx r0 thumb_func_end sub_80F5C00 @@ -445973,51 +445974,51 @@ sub_80F5C24: ; 80F5C24 ldr r0, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1c ldrh r1, [r0] movs r0, 0x18 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1e ldrh r1, [r0] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e20 ldrh r1, [r0] movs r0, 0x1C - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e22 ldrh r1, [r0] movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e24 ldrh r1, [r0] movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e26 ldrh r1, [r0] movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e28 ldrh r1, [r0] movs r0, 0x42 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e2a ldrh r1, [r0] movs r0, 0x46 - bl lcd_io_set + bl SetGpuReg bl copy_super_sprites_to_oam bl copy_queue_process bl copy_pal_bg_faded_to_pal_ram @@ -447347,15 +447348,15 @@ sub_80F6820: ; 80F6820 @080F6884: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl remove_task bl FreeAllWindowBuffers ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 bl sub_80F7E64 @080F68A8: pop {r4,r5} @@ -447556,7 +447557,7 @@ sub_80F69B8: ; 80F69B8 movs r0, 0x1 str r0, [sp, 0xC] movs r2, 0x3 - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer b @080F6A54 .pool @080F6A40: @@ -448412,7 +448413,7 @@ sub_80F707C: ; 80F707C strh r0, [r2] ldr r1, =0x00003f3e movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg pop {r4-r7} pop {r0} bx r0 @@ -448465,13 +448466,13 @@ sub_80F7144: ; 80F7144 strh r0, [r6] movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r6] movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg pop {r4-r7} pop {r0} bx r0 @@ -448496,7 +448497,7 @@ sub_80F71C8: ; 80F71C8 str r0, [sp, 0x4] movs r2, 0x5 movs r3, 0x1 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect movs r5, 0xA b @080F7240 .pool @@ -448534,7 +448535,7 @@ sub_80F71C8: ; 80F71C8 @080F7236: movs r2, 0x5 movs r3, 0x1 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect movs r5, 0xF @080F7240: ldr r0, =0x02039f2c @@ -448565,7 +448566,7 @@ sub_80F71C8: ; 80F71C8 str r0, [sp] str r6, [sp, 0x4] movs r0, 0x2 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect b @080F72CC .pool @080F7290: @@ -448582,7 +448583,7 @@ sub_80F71C8: ; 80F71C8 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect b @080F72CC .pool @080F72B4: @@ -448596,7 +448597,7 @@ sub_80F71C8: ; 80F71C8 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect @080F72CC: adds r5, 0x5 ldr r1, =gUnknown_08DC6510 @@ -448607,7 +448608,7 @@ sub_80F71C8: ; 80F71C8 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect ldr r0, =0x0203a034 ldr r0, [r0] ldr r1, [r0, 0x14] @@ -448619,7 +448620,7 @@ sub_80F71C8: ; 80F71C8 movs r0, 0x2 movs r2, 0 movs r3, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette add sp, 0xC pop {r4-r6} pop {r0} @@ -448803,7 +448804,7 @@ sub_80F73DC: ; 80F73DC movs r0, 0x2 adds r1, r4, 0 movs r2, 0x1 - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer adds r4, 0x10 lsls r4, 16 lsrs r4, 16 @@ -448822,7 +448823,7 @@ sub_80F73DC: ; 80F73DC movs r0, 0x2 adds r1, r4, 0 movs r2, 0x1 - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer ldr r0, =0x0203a034 ldr r0, [r0] ldr r1, [r0] @@ -448885,7 +448886,7 @@ sub_80F74BC: ; 80F74BC str r0, [sp, 0x8] movs r0, 0x2 movs r2, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 @@ -449618,7 +449619,7 @@ sub_80F7A80: ; 80F7A80 str r0, [sp] str r0, [sp, 0x4] ldr r1, =0x000060b3 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 ldr r0, =sub_80F7CA8 movs r1, 0xA bl AddTask @@ -449712,7 +449713,7 @@ sub_80F7A80: ; 80F7A80 str r7, [sp] str r7, [sp, 0x4] movs r0, 0x1 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 ldr r0, =sub_80F7CA8 movs r1, 0xA bl AddTask @@ -449981,7 +449982,7 @@ sub_80F7CA8: ; 80F7CA8 str r0, [sp, 0x4] movs r0, 0x2 lsrs r3, 24 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 adds r2, r4, 0 cmp r2, 0xA ble @080F7D56 @@ -450014,41 +450015,41 @@ sub_80F7DF4: ; 80F7DF4 push {r4,r5,lr} ldr r4, =0x0203a034 movs r0, 0x20 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r0, 0x18 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1] movs r0, 0x50 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x4] movs r5, 0x80 lsls r5, 4 adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x8] adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0xC] adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x10] adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x14] adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x18] movs r0, 0x80 lsls r0, 5 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x1C] bl init_uns_table_pokemon_copy @@ -450064,39 +450065,39 @@ sub_80F7E64: ; 80F7E64 ldr r5, =0x0203a034 ldr r0, [r5] ldr r0, [r0] - bl free + bl Free ldr r0, [r5] movs r4, 0 str r4, [r0] ldr r0, [r0, 0x4] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x4] ldr r0, [r0, 0x8] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x8] ldr r0, [r0, 0xC] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0xC] ldr r0, [r0, 0x10] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x10] ldr r0, [r0, 0x14] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x14] ldr r0, [r0, 0x18] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x18] ldr r0, [r0, 0x1C] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x1C] - bl free + bl Free str r4, [r5] bl sub_805F094 pop {r4,r5} @@ -450694,7 +450695,7 @@ sub_80F8390: ; 80F8390 sub_80F83D0: ; 80F83D0 push {lr} ldr r0, =sub_80D7B24 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -450714,7 +450715,7 @@ sub_80F83E0: ; 80F83E0 adds r0, r2, 0 bl remove_task ldr r0, =sub_80F83D0 - bl set_callback2 + bl SetMainCallback2 @080F83FE: pop {r0} bx r0 @@ -450770,7 +450771,7 @@ sub_80F8458: ; 80F8458 adds r0, r2, 0 bl remove_task ldr r0, =sub_80F5B00 - bl set_callback2 + bl SetMainCallback2 @080F8476: pop {r0} bx r0 @@ -451562,7 +451563,7 @@ sub_80F8970: ; 80F8970 sub_80F8ACC: ; 80F8ACC push {lr} ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -451572,7 +451573,7 @@ sub_80F8ACC: ; 80F8ACC sub_80F8ADC: ; 80F8ADC push {lr} ldr r0, =sub_812FDEC - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x030022c0 ldr r0, =sub_80F8ACC str r0, [r1, 0x8] @@ -452731,7 +452732,7 @@ sub_80F9460: ; 80F9460 strh r0, [r1] @080F947E: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -452771,7 +452772,7 @@ sub_80F94B8: ; 80F94B8 strh r0, [r1] @080F94D6: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -453777,7 +453778,7 @@ sub_80F9C90: ; 80F9C90 movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldrh r1, [r4, 0xE] lsls r1, 8 ldrh r0, [r4, 0x10] @@ -453785,7 +453786,7 @@ sub_80F9C90: ; 80F9C90 lsls r1, 16 lsrs r1, 16 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x12] lsls r1, 8 ldrh r0, [r4, 0x14] @@ -453793,27 +453794,27 @@ sub_80F9C90: ; 80F9C90 lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg b @080F9DEE @080F9D10: movs r0, 0x50 - bl lcd_io_get + bl GetGpuReg strh r0, [r4, 0x16] movs r0, 0x54 - bl lcd_io_get + bl GetGpuReg strh r0, [r4, 0x18] movs r0, 0x50 movs r1, 0xBF - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg b @080F9DEE @080F9D32: ldrh r0, [r4, 0xE] @@ -453837,10 +453838,10 @@ sub_80F9C90: ; 80F9C90 strh r0, [r4, 0x10] movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x16] movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 negs r0, r0 movs r1, 0 @@ -453856,7 +453857,7 @@ sub_80F9C90: ; 80F9C90 lsls r1, 16 lsrs r1, 16 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg movs r1, 0xE ldrsh r0, [r4, r1] b @080F9DD8 @@ -453884,7 +453885,7 @@ sub_80F9C90: ; 80F9C90 movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits @080F9DC2: ldrh r1, [r4, 0x12] lsls r1, 8 @@ -453893,7 +453894,7 @@ sub_80F9C90: ; 80F9C90 lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r1, 0x12 ldrsh r0, [r4, r1] @080F9DD8: @@ -453903,7 +453904,7 @@ sub_80F9C90: ; 80F9C90 @080F9DDE: ldrh r1, [r4, 0x16] movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl remove_task b @080F9DF4 @@ -453959,7 +453960,7 @@ sub_80F9DFC: ; 80F9DFC movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldrh r1, [r4, 0xE] lsls r1, 8 ldrh r0, [r4, 0x10] @@ -453967,7 +453968,7 @@ sub_80F9DFC: ; 80F9DFC lsls r1, 16 lsrs r1, 16 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x12] lsls r1, 8 ldrh r0, [r4, 0x14] @@ -453975,13 +453976,13 @@ sub_80F9DFC: ; 80F9DFC lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg b @080F9F4E @080F9E86: ldrh r0, [r4, 0xC] @@ -454006,10 +454007,10 @@ sub_80F9DFC: ; 80F9DFC strh r0, [r4, 0x14] movs r0, 0x50 movs r1, 0xBF - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg @080F9EBC: ldrh r1, [r4, 0x12] lsls r1, 8 @@ -454018,7 +454019,7 @@ sub_80F9DFC: ; 80F9DFC lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r1, 0x12 ldrsh r0, [r4, r1] cmp r0, 0x50 @@ -454059,7 +454060,7 @@ sub_80F9DFC: ; 80F9DFC lsls r1, 16 lsrs r1, 16 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg movs r1, 0xE ldrsh r0, [r4, r1] cmp r0, 0x78 @@ -454070,13 +454071,13 @@ sub_80F9DFC: ; 80F9DFC movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl remove_task b @080F9F54 @@ -455882,7 +455883,7 @@ task50_overworld_posion_effect: ; 80FAE38 lsls r1, 16 lsrs r1, 16 movs r0, 0x4C - bl lcd_io_set + bl SetGpuReg @080FAEA2: pop {r0} bx r0 @@ -458274,7 +458275,7 @@ sub_80FC190: ; 80FC190 cmp r0, 0 beq @080FC1D8 ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 b @080FC21C .pool @080FC1D8: @@ -458288,7 +458289,7 @@ sub_80FC190: ; 80FC190 ldr r0, =sub_80AF6F0 str r0, [r1] ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 b @080FC21C .pool @080FC208: @@ -458298,7 +458299,7 @@ sub_80FC190: ; 80FC190 bl script_env_1_execute_new_script bl script_env_2_set_ctx_paused ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 @080FC21C: pop {r0} bx r0 @@ -467783,7 +467784,7 @@ sub_8100EF0: ; 8100EF0 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r5, 0x3C] lsls r1, r0, 8 subs r4, r0 @@ -467791,7 +467792,7 @@ sub_8100EF0: ; 8100EF0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_8100FD4 str r0, [r5, 0x1C] pop {r4-r6} @@ -467878,7 +467879,7 @@ sub_8100FD4: ; 8100FD4 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @0810106C: ldrh r1, [r4, 0x2E] movs r2, 0x2E @@ -467909,7 +467910,7 @@ sub_8100FD4: ; 8100FD4 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x3C ldrsh r0, [r4, r1] cmp r0, 0x10 @@ -467960,7 +467961,7 @@ sub_81010CC: ; 81010CC movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x3C] lsls r1, 8 ldrh r0, [r4, 0x3A] @@ -467968,7 +467969,7 @@ sub_81010CC: ; 81010CC lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_8101138 str r0, [r4, 0x1C] pop {r4-r6} @@ -468042,7 +468043,7 @@ sub_8101138: ; 8101138 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x3A ldrsh r0, [r4, r1] cmp r0, 0x10 @@ -468120,7 +468121,7 @@ sub_8101138: ; 8101138 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x3A ldrsh r1, [r4, r0] cmp r1, 0 @@ -468147,10 +468148,10 @@ sub_8101138: ; 8101138 @0810127A: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl move_anim_8072740 @08101290: @@ -470248,7 +470249,7 @@ sub_81022D4: ; 81022D4 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0xA ldrsh r0, [r4, r1] cmp r0, 0x10 @@ -470362,7 +470363,7 @@ sub_81023E0: ; 81023E0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0xA ldrsh r0, [r4, r1] cmp r0, 0x10 @@ -471186,14 +471187,14 @@ sub_81029B4: ; 81029B4 movs r1, 0x80 lsls r1, 2 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits b @08102AD2 .pool @08102AC8: movs r1, 0x80 lsls r1, 3 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits @08102AD2: pop {r3,r4} mov r8, r3 @@ -471227,14 +471228,14 @@ sub_8102AE0: ; 8102AE0 movs r1, 0x80 lsls r1, 2 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits b @08102B26 .pool @08102B1C: movs r1, 0x80 lsls r1, 3 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits @08102B26: ldr r0, =0x00002771 bl gpu_pal_free_tag @@ -476605,10 +476606,10 @@ sub_8105694: ; 8105694 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2E] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_81056D4 str r0, [r4, 0x1C] @081056CA: @@ -476642,7 +476643,7 @@ sub_81056D4: ; 81056D4 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0 @@ -476694,10 +476695,10 @@ sub_810575C: ; 810575C adds r4, r0, 0 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl move_anim_8072740 pop {r4} @@ -477402,7 +477403,7 @@ sub_8105CB4: ; 8105CB4 ble @08105CCC movs r0, 0x80 lsls r0, 6 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 ldr r0, =0x020244d4 ldr r0, [r0] @@ -477440,7 +477441,7 @@ sub_8105CB4: ; 8105CB4 lsls r4, 1 adds r0, r4 ldr r0, [r0] - bl free + bl Free ldr r0, [r5] adds r0, r4 movs r1, 0 @@ -477635,22 +477636,22 @@ sub_8105EB0: ; 8105EB0 strh r0, [r4] ldrh r1, [r1] movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f1f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f3f movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0xC8 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 @@ -477731,7 +477732,7 @@ sub_8105F84: ; 8105F84 strh r0, [r1, 0x1E] movs r0, 0x50 movs r1, 0x88 - bl lcd_io_set + bl SetGpuReg str r4, [sp] str r4, [sp, 0x4] str r4, [sp, 0x8] @@ -477755,16 +477756,16 @@ sub_8105F84: ; 8105F84 ldr r4, =0x00003f3f movs r0, 0x48 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl move_anim_task_del @0810600C: @@ -478126,11 +478127,11 @@ sub_81062E8: ; 81062E8 lsrs r5, r0, 24 ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0x3 @@ -478155,10 +478156,10 @@ sub_81062E8: ; 81062E8 strh r1, [r4] movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg mov r0, sp bl sub_80A6B30 mov r0, sp @@ -478246,7 +478247,7 @@ sub_81063A8: ; 81063A8 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x1E ldrsh r0, [r4, r1] cmp r0, 0x10 @@ -478298,7 +478299,7 @@ sub_81063A8: ; 81063A8 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r2, 0x1E ldrsh r1, [r4, r2] cmp r1, 0 @@ -478336,10 +478337,10 @@ sub_81063A8: ; 81063A8 @081064D0: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 @@ -478361,11 +478362,11 @@ sub_81064F8: ; 81064F8 lsrs r5, r0, 24 ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 @@ -478390,10 +478391,10 @@ sub_81064F8: ; 81064F8 strh r1, [r4] movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg mov r0, sp bl sub_80A6B30 bl sub_80A4DF0 @@ -478505,7 +478506,7 @@ sub_81065EC: ; 81065EC lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x1E ldrsh r0, [r4, r1] cmp r0, 0xE @@ -478557,7 +478558,7 @@ sub_81065EC: ; 81065EC lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r2, 0x1E ldrsh r1, [r4, r2] cmp r1, 0 @@ -478594,10 +478595,10 @@ sub_81065EC: ; 81065EC @08106710: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 @@ -480889,11 +480890,11 @@ sub_8107954: ; 8107954 mov r10, r0 ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 @@ -481056,11 +481057,11 @@ sub_8107954: ; 8107954 ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r2, =0x02022e1a ldrh r1, [r2] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x03005e00 mov r2, r8 lsls r0, r2, 2 @@ -481305,10 +481306,10 @@ sub_8107CC4: ; 8107CC4 strh r0, [r1] movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x26 ldrsh r1, [r4, r0] lsls r0, r1, 2 @@ -489769,11 +489770,11 @@ sub_810C0A0: ; 810C0A0 lsrs r5, r0, 24 ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 @@ -489798,10 +489799,10 @@ sub_810C0A0: ; 810C0A0 strh r1, [r4] movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg mov r0, sp bl sub_80A6B30 mov r0, sp @@ -489811,7 +489812,7 @@ sub_810C0A0: ; 810C0A0 lsls r2, 4 mov r3, sp ldrh r3, [r3, 0xA] - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, =gUnknown_08D932E0 mov r0, sp movs r2, 0 @@ -489905,7 +489906,7 @@ sub_810C164: ; 810C164 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x1E ldrsh r0, [r4, r1] cmp r0, 0x9 @@ -489958,7 +489959,7 @@ sub_810C164: ; 810C164 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r2, 0x1E ldrsh r1, [r4, r2] cmp r1, 0 @@ -490000,10 +490001,10 @@ sub_810C164: ; 810C164 strh r1, [r0] movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 @@ -490051,11 +490052,11 @@ sub_810C324: ; 810C324 lsrs r5, r0, 24 ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 @@ -490080,10 +490081,10 @@ sub_810C324: ; 810C324 strh r1, [r4] movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg mov r0, sp bl sub_80A6B30 mov r0, sp @@ -490093,7 +490094,7 @@ sub_810C324: ; 810C324 lsls r2, 4 mov r3, sp ldrh r3, [r3, 0xA] - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, =gUnknown_08D932E0 mov r0, sp movs r2, 0 @@ -490176,7 +490177,7 @@ sub_810C3F0: ; 810C3F0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x1E ldrsh r0, [r4, r1] cmp r0, 0x5 @@ -490230,7 +490231,7 @@ sub_810C3F0: ; 810C3F0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r2, 0x1E ldrsh r1, [r4, r2] cmp r1, 0 @@ -490272,10 +490273,10 @@ sub_810C3F0: ; 810C3F0 strh r1, [r0] movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 @@ -492435,7 +492436,7 @@ sub_810D6A8: ; 810D6A8 bne @0810D704 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 strh r0, [r4, 0x2E] ldrh r0, [r4, 0x20] @@ -496110,7 +496111,7 @@ sub_810F3C8: ; 810F3C8 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x34] movs r2, 0x34 ldrsh r0, [r4, r2] @@ -496198,7 +496199,7 @@ sub_810F46C: ; 810F46C lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r5, 0x34] subs r0, 0x1 strh r0, [r5, 0x34] @@ -496835,10 +496836,10 @@ sub_810F940: ; 810F940 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_810F9D4 str r0, [r5] pop {r4-r6} @@ -497001,7 +497002,7 @@ sub_810F9D4: ; 810F9D4 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] @@ -497041,10 +497042,10 @@ sub_810F9D4: ; 810F9D4 @0810FB44: movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl move_anim_task_del @0810FB5A: @@ -497931,7 +497932,7 @@ sub_8110240: ; 8110240 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r5, 0x30] movs r1, 0x10 subs r1, r0 @@ -497940,7 +497941,7 @@ sub_8110240: ; 8110240 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @081102E2 .pool @081102B8: @@ -497987,7 +497988,7 @@ sub_8110240: ; 8110240 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x30 ldrsh r0, [r5, r1] cmp r0, 0 @@ -498019,10 +498020,10 @@ sub_8110240: ; 8110240 @0811034A: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl move_anim_8072740 @08110360: @@ -498401,10 +498402,10 @@ sub_811067C: ; 811067C movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 strh r0, [r4, 0x2E] ldr r0, =sub_81106A4 @@ -498445,7 +498446,7 @@ sub_81106A4: ; 81106A4 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0 @@ -498471,10 +498472,10 @@ sub_8110700: ; 8110700 adds r4, r0, 0 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl move_anim_8072740 pop {r4} @@ -499042,11 +499043,11 @@ sub_8110BCC: ; 8110BCC movs r5, 0 ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 @@ -499070,10 +499071,10 @@ sub_8110BCC: ; 8110BCC strh r5, [r4] movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg mov r0, sp bl sub_80A6B30 mov r0, sp @@ -499202,7 +499203,7 @@ sub_8110CB0: ; 8110CB0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x1E ldrsh r0, [r4, r1] cmp r0, 0x7 @@ -499249,7 +499250,7 @@ sub_8110CB0: ; 8110CB0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r2, 0x1E ldrsh r1, [r4, r2] cmp r1, 0 @@ -499292,10 +499293,10 @@ sub_8110CB0: ; 8110CB0 strh r1, [r0] movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 @@ -500310,10 +500311,10 @@ sub_811160C: ; 811160C movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x3A] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg pop {r4,r5} pop {r0} bx r0 @@ -500490,7 +500491,7 @@ sub_8111764: ; 8111764 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r2, 0x3A ldrsh r0, [r4, r2] cmp r0, 0 @@ -500607,11 +500608,11 @@ sub_811188C: ; 811188C movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0 bl obj_id_for_side_relative_to_move adds r4, r0, 0 @@ -500688,7 +500689,7 @@ sub_8111914: ; 8111914 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0xC ldrsh r0, [r4, r1] cmp r0, 0x9 @@ -500748,10 +500749,10 @@ sub_811196C: ; 811196C bl move_anim_task_del movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg @081119D8: pop {r4,r5} pop {r0} @@ -501110,7 +501111,7 @@ sub_8111C50: ; 8111C50 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r5, 0xE] lsls r1, 8 ldrh r0, [r5, 0xC] @@ -501118,7 +501119,7 @@ sub_8111C50: ; 8111C50 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x02020630 movs r0, 0x8 ldrsh r1, [r5, r0] @@ -501271,7 +501272,7 @@ sub_8111D78: ; 8111D78 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r1, [r4, 0xC] movs r0, 0x80 lsls r0, 13 @@ -501303,10 +501304,10 @@ sub_8111D78: ; 8111D78 ble @08111E48 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0x10] adds r0, 0x1 strh r0, [r4, 0x10] @@ -501495,7 +501496,7 @@ sub_8111E78: ; 8111E78 lsls r1, 3 @08111FC8: movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits b @081120C6 @08111FD0: movs r1, 0x24 @@ -501581,18 +501582,18 @@ sub_8111E78: ; 8111E78 bne @08112090 ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg b @08112098 .pool @08112090: ldr r1, =0x00003f44 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg @08112098: movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @081120C6 .pool @081120A8: @@ -501601,13 +501602,13 @@ sub_8111E78: ; 8111E78 movs r1, 0x80 lsls r1, 2 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits b @081120C2 @081120B8: movs r1, 0x80 lsls r1, 3 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits @081120C2: ldr r0, =sub_81120DC str r0, [r5] @@ -501679,7 +501680,7 @@ sub_81120DC: ; 81120DC lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r2, 0xA ldrsh r0, [r4, r2] cmp r0, 0x80 @@ -501746,7 +501747,7 @@ sub_8112170: ; 8112170 lsls r1, 3 @081121D4: movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits b @08112258 @081121DC: ldrh r0, [r4, 0x10] @@ -501780,23 +501781,23 @@ sub_8112170: ; 8112170 bl gpu_pal_free_tag movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg cmp r6, 0x1 bne @08112248 movs r1, 0x80 lsls r1, 2 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits b @08112252 .pool @08112248: movs r1, 0x80 lsls r1, 3 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits @08112252: adds r0, r5, 0 bl move_anim_task_del @@ -501993,11 +501994,11 @@ sub_81123C4: ; 81123C4 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0 ldr r1, [sp] strh r0, [r1, 0x12] @@ -502290,7 +502291,7 @@ sub_81125E0: ; 81125E0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x16 ldrsh r0, [r4, r1] cmp r0, 0x17 @@ -502355,7 +502356,7 @@ sub_81125E0: ; 81125E0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r1, [r4, 0x18] movs r0, 0x80 lsls r0, 13 @@ -502403,10 +502404,10 @@ sub_81125E0: ; 81125E0 @0811273C: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl move_anim_task_del @08112752: @@ -502427,16 +502428,16 @@ sub_8112758: ; 8112758 strh r1, [r0] ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f1f movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0xC8 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner @@ -502675,16 +502676,16 @@ sub_8112994: ; 8112994 ldr r4, =0x00003f3f movs r0, 0x48 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl move_anim_task_del @081129DA: @@ -502811,10 +502812,10 @@ sub_8112ACC: ; 8112ACC movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] @@ -502843,7 +502844,7 @@ sub_8112ACC: ; 8112ACC lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x32 ldrsh r0, [r4, r1] cmp r0, 0x10 @@ -502869,10 +502870,10 @@ sub_8112B44: ; 8112B44 adds r4, r0, 0 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e24 movs r1, 0 strh r1, [r0] @@ -502932,10 +502933,10 @@ sub_8112B78: ; 8112B78 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r5, 0x3A] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @08112C40 .pool @08112BE8: @@ -502970,7 +502971,7 @@ sub_8112B78: ; 8112B78 lsls r1, r4, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg strh r4, [r5, 0x3A] cmp r7, 0x10 bne @08112C40 @@ -502997,10 +502998,10 @@ sub_8112C4C: ; 8112C4C adds r4, r0, 0 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl move_anim_8072740 pop {r4} @@ -503066,11 +503067,11 @@ sub_8112C6C: ; 8112C6C movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg strh r6, [r4, 0x18] ldr r0, =sub_8112D10 str r0, [r4] @@ -503256,7 +503257,7 @@ sub_8112D10: ; 8112D10 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @08112E96 @08112E70: movs r2, 0x16 @@ -503271,10 +503272,10 @@ sub_8112D10: ; 8112D10 @08112E80: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r7, 0 bl move_anim_task_del @08112E96: @@ -504309,7 +504310,7 @@ sub_81136E8: ; 81136E8 movs r1, 0x10 strh r1, [r0, 0xA] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl battle_get_per_side_status_permutated lsls r0, 24 @@ -504318,13 +504319,13 @@ sub_81136E8: ; 81136E8 bne @08113734 ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg b @0811373C .pool @08113734: ldr r1, =0x00003f44 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg @0811373C: ldr r0, =0x03005e00 lsls r1, r5, 2 @@ -504370,7 +504371,7 @@ sub_811375C: ; 811375C strh r1, [r6, 0xA] ldrh r1, [r6, 0xA] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg strh r5, [r6, 0xC] cmp r4, 0x10 bne @081137DE @@ -504422,7 +504423,7 @@ sub_81137E4: ; 81137E4 ldr r0, =sub_811381C str r0, [r2] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -504459,16 +504460,16 @@ sub_811381C: ; 811381C strh r1, [r6, 0xA] ldrh r1, [r6, 0xA] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg strh r5, [r6, 0xC] cmp r4, 0 bne @08113882 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r7, 0 bl move_anim_task_del b @08113882 @@ -504491,7 +504492,7 @@ sub_8113888: ; 8113888 movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02038436 ldrb r0, [r0] bl battle_get_per_side_status_permutated @@ -504501,13 +504502,13 @@ sub_8113888: ; 8113888 bne @081138BC ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg b @081138C4 .pool @081138BC: ldr r1, =0x00003f44 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg @081138C4: adds r0, r4, 0 bl move_anim_task_del @@ -504943,7 +504944,7 @@ sub_8113BAC: ; 8113BAC strh r0, [r5, 0x1C] ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldrb r1, [r4, 0x8] lsls r1, 4 movs r0, 0 @@ -504965,7 +504966,7 @@ sub_8113BAC: ; 8113BAC strh r0, [r5, 0x1C] ldr r1, =0x00003f44 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0 movs r1, 0x90 movs r2, 0x20 @@ -505029,10 +505030,10 @@ sub_8113BAC: ; 8113BAC orrs r7, r0 movs r0, 0x4A adds r1, r7, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r2, =0x02022e24 ldrh r0, [r5, 0x24] lsls r0, 8 @@ -505121,7 +505122,7 @@ sub_8113D60: ; 8113D60 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x1E ldrsh r0, [r4, r1] cmp r0, 0xC @@ -505237,10 +505238,10 @@ sub_8113E78: ; 8113E78 ldr r4, =0x00003f3f movs r0, 0x48 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r6, 0 bl move_anim_task_del b @081140A6 @@ -505256,14 +505257,14 @@ sub_8113E78: ; 8113E78 bne @08113F24 ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x02022e1c b @08113F2E .pool @08113F24: ldr r1, =0x00003f44 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x02022e18 @08113F2E: ldrh r0, [r1] @@ -505408,17 +505409,17 @@ sub_8113E78: ; 8113E78 bne @08114070 ldr r1, =0x00003f3d movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg b @08114078 .pool @08114070: ldr r1, =0x00003f3b movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg @08114078: ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r2, =0x02022e24 ldrh r0, [r5, 0x24] lsls r0, 8 @@ -505434,7 +505435,7 @@ sub_8113E78: ; 8113E78 strh r0, [r5, 0xC] ldr r1, =0x0000080c movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_81140C8 str r0, [r5] @081140A6: @@ -505592,7 +505593,7 @@ sub_81140C8: ; 81140C8 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x1E ldrsh r0, [r4, r1] cmp r0, 0 @@ -505621,10 +505622,10 @@ sub_81140C8: ; 81140C8 ldr r4, =0x00003f3f movs r0, 0x48 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl move_anim_task_del @08114232: @@ -505994,20 +505995,20 @@ sub_81144F8: ; 81144F8 strh r6, [r0] ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f3d movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 8 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000c08 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0 @@ -506323,10 +506324,10 @@ sub_8114748: ; 8114748 ldr r4, =0x00003f3f movs r0, 0x48 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 @@ -506337,7 +506338,7 @@ sub_8114748: ; 8114748 bl lcd_bg_operations @08114856: movs r0, 0 - bl lcd_io_get + bl GetGpuReg adds r1, r0, 0 movs r2, 0x80 lsls r2, 8 @@ -506346,13 +506347,13 @@ sub_8114748: ; 8114748 lsls r1, 16 lsrs r1, 16 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r6, 0 bl move_anim_task_del @08114886: @@ -510642,22 +510643,22 @@ sub_8116B14: ; 8116B14 strh r7, [r0] ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f3d movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 8 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000c08 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA - bl lcd_io_get + bl GetGpuReg add r4, sp, 0x10 strh r0, [r4] ldrb r1, [r4] @@ -510674,7 +510675,7 @@ sub_8116B14: ; 8116B14 strb r0, [r2] ldrh r1, [r4] movs r0, 0xA - bl lcd_io_set + bl SetGpuReg bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 @@ -510688,7 +510689,7 @@ sub_8116B14: ; 8116B14 strb r0, [r4] ldrh r1, [r4] movs r0, 0xA - bl lcd_io_set + bl SetGpuReg @08116BA2: bl battle_type_is_double lsls r0, 24 @@ -510749,7 +510750,7 @@ sub_8116B14: ; 8116B14 strb r0, [r4] ldrh r1, [r4] movs r0, 0xA - bl lcd_io_set + bl SetGpuReg movs r7, 0x1 @08116C26: bl sub_80A4DF0 @@ -510911,16 +510912,16 @@ sub_8116D64: ; 8116D64 ldr r4, =0x00003f3f movs r0, 0x48 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @08116DF6 movs r0, 0xA - bl lcd_io_get + bl GetGpuReg add r1, sp, 0x10 strh r0, [r1] ldrb r2, [r1] @@ -510930,10 +510931,10 @@ sub_8116D64: ; 8116D64 strb r0, [r1] ldrh r1, [r1] movs r0, 0xA - bl lcd_io_set + bl SetGpuReg @08116DF6: movs r0, 0 - bl lcd_io_get + bl GetGpuReg adds r1, r0, 0 movs r2, 0x80 lsls r2, 8 @@ -510942,13 +510943,13 @@ sub_8116D64: ; 8116D64 lsls r1, 16 lsrs r1, 16 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 bl obj_id_for_side_relative_to_move ldr r4, =0x02020630 @@ -511013,7 +511014,7 @@ sub_8116EB4: ; 8116EB4 lsrs r5, r0, 24 ldr r4, =0x0203a110 movs r0, 0x18 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r2, 0 ldr r3, =0x0203841e @@ -511094,21 +511095,21 @@ sub_8116F04: ; 8116F04 strh r1, [r0] ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f3d movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 8 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0 @@ -511522,7 +511523,7 @@ sub_81172EC: ; 81172EC lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r2, 0x20 ldrsh r1, [r5, r2] movs r2, 0x10 @@ -511564,7 +511565,7 @@ sub_81172EC: ; 81172EC lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x20 ldrsh r0, [r5, r1] cmp r0, 0 @@ -511585,10 +511586,10 @@ sub_81172EC: ; 81172EC ldr r4, =0x00003f3f movs r0, 0x48 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 @@ -511599,7 +511600,7 @@ sub_81172EC: ; 81172EC bl lcd_bg_operations @081173E6: movs r0, 0 - bl lcd_io_get + bl GetGpuReg adds r1, r0, 0 movs r2, 0x80 lsls r2, 8 @@ -511608,13 +511609,13 @@ sub_81172EC: ; 81172EC lsls r1, 16 lsrs r1, 16 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 ldrsh r1, [r5, r0] lsls r0, r1, 4 @@ -511660,7 +511661,7 @@ sub_81172EC: ; 81172EC @08117466: ldr r4, =0x0203a110 ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] adds r0, r6, 0 @@ -512201,23 +512202,23 @@ sub_8117854: ; 8117854 strh r1, [r0] ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f3d movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 8 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA - bl lcd_io_get + bl GetGpuReg add r4, sp, 0x10 strh r0, [r4] ldrb r1, [r4] @@ -512249,7 +512250,7 @@ sub_8117854: ; 8117854 @08117930: ldrh r1, [r4] movs r0, 0xA - bl lcd_io_set + bl SetGpuReg bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 @@ -512456,7 +512457,7 @@ sub_8117A60: ; 8117A60 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x20 ldrsh r1, [r5, r0] movs r2, 0x10 @@ -512500,7 +512501,7 @@ sub_8117A60: ; 8117A60 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x20 ldrsh r4, [r5, r0] cmp r4, 0 @@ -512514,16 +512515,16 @@ sub_8117A60: ; 8117A60 ldr r4, =0x00003f3f movs r0, 0x48 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @08117BB2 movs r0, 0xA - bl lcd_io_get + bl GetGpuReg mov r1, sp strh r0, [r1] mov r2, sp @@ -512535,10 +512536,10 @@ sub_8117A60: ; 8117A60 mov r0, sp ldrh r1, [r0] movs r0, 0xA - bl lcd_io_set + bl SetGpuReg @08117BB2: movs r0, 0 - bl lcd_io_get + bl GetGpuReg adds r1, r0, 0 movs r2, 0x80 lsls r2, 8 @@ -512547,13 +512548,13 @@ sub_8117A60: ; 8117A60 lsls r1, 16 lsrs r1, 16 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r3, 0x8 ldrsh r1, [r5, r3] lsls r0, r1, 4 @@ -512607,7 +512608,7 @@ sub_8117C44: ; 8117C44 lsrs r4, 24 movs r0, 0x80 lsls r0, 6 - bl malloc_and_clear + bl AllocZeroed ldr r1, =0x020244d4 ldr r1, [r1] movs r2, 0xBE @@ -512634,7 +512635,7 @@ sub_8117C70: ; 8117C70 lsls r5, 1 adds r0, r5 ldr r0, [r0] - bl free + bl Free ldr r0, [r6] adds r0, r5 movs r1, 0 @@ -513084,7 +513085,7 @@ lcd_bg_operations: ; 811802C ldr r0, =gUnknown_0859741A adds r0, r6, r0 ldrb r0, [r0] - bl lcd_io_get + bl GetGpuReg ldr r1, =0x0203a114 strh r0, [r1] cmp r5, 0x6 @@ -513189,7 +513190,7 @@ lcd_bg_operations: ; 811802C ldrb r0, [r0] ldr r1, =0x0203a114 ldrh r1, [r1] - bl lcd_io_set + bl SetGpuReg @08118132: pop {r4-r6} pop {r0} @@ -513210,7 +513211,7 @@ sub_8118140: ; 8118140 ldr r0, =gUnknown_0859741E adds r0, r2, r0 ldrb r0, [r0] - bl lcd_io_get + bl GetGpuReg mov r1, sp strh r0, [r1] cmp r4, 0x6 @@ -513371,20 +513372,20 @@ sub_811828C: ; 811828C strh r1, [r0] movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x00003f3f movs r0, 0x48 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -513474,7 +513475,7 @@ task_battle_intro_80BC47C: ; 81182EC strh r0, [r1, 0x8] movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg b @0811852A @0811839C: ldr r1, =0x02022e26 @@ -513636,19 +513637,19 @@ task_battle_intro_80BC47C: ; 81182EC movs r0, 0x1 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r1, 0x9C lsls r1, 8 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg movs r1, 0xBC lsls r1, 7 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg b @0811852A .pool @08118524: @@ -513815,7 +513816,7 @@ task00_battle_intro_80BC6C8: ; 8118538 strh r0, [r1, 0x8] movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg b @0811881A .pool @08118678: @@ -513869,13 +513870,13 @@ task00_battle_intro_80BC6C8: ; 8118538 bne @08118728 ldr r1, =0x00001842 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0xF - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg b @08118728 .pool @08118708: @@ -513985,19 +513986,19 @@ task00_battle_intro_80BC6C8: ; 8118538 movs r0, 0x1 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r1, 0x9C lsls r1, 8 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg movs r1, 0xBC lsls r1, 7 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg b @0811881A .pool @08118814: @@ -514014,7 +514015,7 @@ task00_battle_intro_80BC6C8: ; 8118538 beq @08118832 ldrh r1, [r1, 0x10] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @08118832: add sp, 0x4 pop {r3} @@ -514065,14 +514066,14 @@ task_battle_intro_anim: ; 8118844 @08118898: ldr r1, =0x00001842 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x00000808 movs r0, 0x52 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 @@ -514115,7 +514116,7 @@ task_battle_intro_anim: ; 8118844 strh r0, [r1, 0x8] movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg b @08118A96 .pool @0811891C: @@ -514273,19 +514274,19 @@ task_battle_intro_anim: ; 8118844 movs r0, 0x1 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r1, 0x9C lsls r1, 8 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg movs r1, 0xBC lsls r1, 7 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg b @08118A96 .pool @08118A90: @@ -514303,7 +514304,7 @@ task_battle_intro_anim: ; 8118844 beq @08118AB0 ldrh r1, [r1, 0x10] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @08118AB0: add sp, 0x4 pop {r3} @@ -514476,10 +514477,10 @@ task00_battle_intro_wireless: ; 8118AC0 str r6, [r0] movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f06 movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg b @08118D5A .pool @08118C38: @@ -514598,19 +514599,19 @@ task00_battle_intro_wireless: ; 8118AC0 movs r0, 0x1 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r1, 0x9C lsls r1, 8 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg movs r1, 0xBC lsls r1, 7 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg b @08118D5A .pool @08118D54: @@ -514684,12 +514685,12 @@ sub_8118D68: ; 8118D68 strh r0, [r1, 0x8] ldr r1, =0x00005c0a movs r0, 0xA - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00005e0a movs r0, 0xC - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl lcd_io_get + bl GetGpuReg adds r1, r0, 0 ldr r2, =0x0000f040 adds r0, r2, 0 @@ -514697,14 +514698,14 @@ sub_8118D68: ; 8118D68 lsls r1, 16 lsrs r1, 16 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0xF8 lsls r1, 6 movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f3f movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg ldr r1, =0x02022e16 ldr r2, =0x0000ffd0 adds r0, r2, 0 @@ -514835,27 +514836,27 @@ sub_8118D68: ; 8118D68 mov r0, sp bl CpuSet movs r0, 0 - bl lcd_io_get + bl GetGpuReg ldr r1, =0x0000bfff ands r1, r0 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r1, 0x9C lsls r1, 8 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg movs r1, 0xBC lsls r1, 7 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r1, =0x02039b28 movs r0, 0x3 strb r0, [r1, 0x15] @@ -514934,7 +514935,7 @@ sub_8118FBC: ; 8118FBC lsls r2, 5 adds r1, r7, 0 adds r3, r5, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles adds r0, r6, 0 adds r0, 0x8 cmp r6, r0 @@ -514976,7 +514977,7 @@ sub_8118FBC: ; 8118FBC lsls r2, 4 mov r1, r9 movs r3, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap add sp, 0x4 pop {r3-r5} mov r8, r3 @@ -517320,7 +517321,7 @@ sub_811A20C: ; 811A20C mov r2, r9 bl set_word_task_arg ldr r0, =sub_811A278 - bl set_callback2 + bl SetMainCallback2 pop {r3,r4} mov r8, r3 mov r9, r4 @@ -517628,7 +517629,7 @@ sub_811A4D0: ; 811A4D0 bl sub_811F2B8 bl FreeAllWindowBuffers adds r0, r4, 0 - bl set_callback2 + bl SetMainCallback2 pop {r4} pop {r0} bx r0 @@ -517967,7 +517968,7 @@ sub_811A7E4: ; 811A7E4 sub_811A858: ; 811A858 push {lr} ldr r0, =sub_811A7E4 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -518107,7 +518108,7 @@ sub_811A95C: ; 811A95C lsrs r6, r2, 24 ldr r4, =0x0203a118 movs r0, 0x50 - bl malloc + bl Alloc str r0, [r4] cmp r0, 0 bne @0811A984 @@ -518255,7 +518256,7 @@ sub_811AA90: ; 811AA90 ldr r0, [r4] cmp r0, 0 beq @0811AAA2 - bl free + bl Free movs r0, 0 str r0, [r4] @0811AAA2: @@ -521211,24 +521212,24 @@ sub_811BFA4: ; 811BFA4 .4byte @0811C0D4 @0811BFE0: movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_08597C54 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x0203a11c ldr r1, [r4] movs r0, 0xB0 lsls r0, 4 adds r1, r0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] movs r0, 0xC0 lsls r0, 2 adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r0, =gUnknown_08597C64 bl InitWindows bl DeactivateAllTextPrinters @@ -521255,7 +521256,7 @@ sub_811BFA4: ; 811BFA4 movs r0, 0x3 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer bl sub_811D60C ldr r0, =0x0203a11c ldr r0, [r0] @@ -521266,7 +521267,7 @@ sub_811BFA4: ; 811BFA4 bl sub_811D230 bl sub_811E948 movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0811C124 .pool @0811C090: @@ -521278,7 +521279,7 @@ sub_811BFA4: ; 811BFA4 movs r3, 0 bl copy_decompressed_tile_data_to_vram_autofree movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0811C124 .pool @0811C0AC: @@ -521297,7 +521298,7 @@ sub_811BFA4: ; 811BFA4 bl sub_811DEC4 b @0811C124 @0811C0D4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811C12E @@ -521308,18 +521309,18 @@ sub_811BFA4: ; 811BFA4 bl sub_811DE5C movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x3B - bl lcd_io_set + bl SetGpuReg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg bl sub_811E5D4 bl sub_811E720 bl sub_811E828 @@ -521350,7 +521351,7 @@ sub_811C13C: ; 811C13C ldr r0, [r4] cmp r0, 0 beq @0811C14E - bl free + bl Free movs r0, 0 str r0, [r4] @0811C14E: @@ -521544,7 +521545,7 @@ sub_811C2D4: ; 811C2D4 strh r0, [r1] b @0811C304 @0811C2FA: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0811C306 @@ -521699,7 +521700,7 @@ sub_811C404: ; 811C404 strh r0, [r1] b @0811C440 @0811C436: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0811C442 @@ -521735,7 +521736,7 @@ sub_811C448: ; 811C448 strh r0, [r1] b @0811C484 @0811C47A: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0811C486 @@ -521771,7 +521772,7 @@ sub_811C48C: ; 811C48C strh r0, [r1] b @0811C4C8 @0811C4BE: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0811C4CA @@ -521801,14 +521802,14 @@ sub_811C4D0: ; 811C4D0 bl sub_811D104 bl sub_811D2C8 movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg ldr r1, [r4] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @0811C510 @0811C506: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0811C512 @@ -521843,7 +521844,7 @@ sub_811C518: ; 811C518 adds r0, 0x1 strh r0, [r1] @0811C546: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 @0811C54E: @@ -521876,7 +521877,7 @@ sub_811C554: ; 811C554 @0811C588: bl sub_811DF90 movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0 movs r1, 0 movs r2, 0 @@ -521885,7 +521886,7 @@ sub_811C554: ; 811C554 bl sub_811D6D4 b @0811C5DA @0811C5A4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811C618 @@ -521893,7 +521894,7 @@ sub_811C554: ; 811C554 bl sub_811D9CC b @0811C5DA @0811C5B6: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811C618 @@ -521903,7 +521904,7 @@ sub_811C554: ; 811C554 bne @0811C618 b @0811C5DA @0811C5CC: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811C618 @@ -521988,13 +521989,13 @@ sub_811C620: ; 811C620 b @0811C6A4 .pool @0811C690: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811C6B8 bl sub_811DFB0 movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg @0811C6A4: ldr r0, =0x0203a11c ldr r1, [r0] @@ -522053,7 +522054,7 @@ sub_811C6C0: ; 811C6C0 bl sub_811D6D4 b @0811C736 @0811C722: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811C778 @@ -522226,7 +522227,7 @@ sub_811C830: ; 811C830 bl sub_811D9B4 b @0811C8A8 @0811C886: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811C8E8 @@ -522249,7 +522250,7 @@ sub_811C830: ; 811C830 b @0811C8E8 .pool @0811C8B8: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811C8E8 @@ -522306,7 +522307,7 @@ sub_811C8F0: ; 811C8F0 bl sub_811D9B4 b @0811C962 @0811C940: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811C994 @@ -522319,7 +522320,7 @@ sub_811C8F0: ; 811C8F0 cmp r0, 0 bne @0811C994 movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg @0811C962: ldr r0, =0x0203a11c ldr r1, [r0] @@ -522329,7 +522330,7 @@ sub_811C8F0: ; 811C8F0 b @0811C994 .pool @0811C974: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811C994 @@ -522383,7 +522384,7 @@ sub_811C99C: ; 811C99C bl sub_811D9B4 b @0811CA24 @0811C9F0: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811CA54 @@ -522399,12 +522400,12 @@ sub_811C99C: ; 811C99C bl sub_811D104 b @0811CA24 @0811CA14: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811CA54 movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg @0811CA24: ldr r0, =0x0203a11c ldr r1, [r0] @@ -522414,7 +522415,7 @@ sub_811C99C: ; 811C99C b @0811CA54 .pool @0811CA34: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811CA54 @@ -522463,7 +522464,7 @@ sub_811CA5C: ; 811CA5C bl sub_811D9B4 b @0811CAD2 @0811CAA2: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811CB10 @@ -522478,7 +522479,7 @@ sub_811CA5C: ; 811CA5C bl sub_811D6D4 b @0811CAD2 @0811CAC4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811CB10 @@ -522548,7 +522549,7 @@ sub_811CB24: ; 811CB24 bl sub_811D7A4 b @0811CB62 @0811CB50: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811CB8E @@ -522608,7 +522609,7 @@ sub_811CB98: ; 811CB98 bl sub_811D7C8 b @0811CBD8 @0811CBC4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811CC00 @@ -522668,7 +522669,7 @@ sub_811CC08: ; 811CC08 bl sub_811D7EC b @0811CC5A @0811CC34: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811CC86 @@ -522736,7 +522737,7 @@ sub_811CC90: ; 811CC90 bl sub_811D830 b @0811CCE2 @0811CCBC: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0811CD0A @@ -522801,7 +522802,7 @@ sub_811CD14: ; 811CD14 strh r0, [r1] b @0811CD4A @0811CD40: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0811CD4C @@ -522835,7 +522836,7 @@ sub_811CD54: ; 811CD54 strh r0, [r1] b @0811CD8A @0811CD80: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0811CD8C @@ -522869,7 +522870,7 @@ sub_811CD94: ; 811CD94 strh r0, [r1] b @0811CDCA @0811CDC0: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0811CDCC @@ -522903,7 +522904,7 @@ sub_811CDD4: ; 811CDD4 strh r0, [r1] b @0811CE0A @0811CE00: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0811CE0C @@ -522937,7 +522938,7 @@ sub_811CE14: ; 811CE14 strh r0, [r1] b @0811CE4A @0811CE40: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0811CE4C @@ -522971,7 +522972,7 @@ sub_811CE54: ; 811CE54 strh r0, [r1] b @0811CE8A @0811CE80: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 b @0811CE8C @@ -522989,7 +522990,7 @@ sub_811CE94: ; 811CE94 ldr r4, =0x0203a11c movs r0, 0x98 lsls r0, 5 - bl malloc + bl Alloc adds r2, r0, 0 str r2, [r4] cmp r2, 0 @@ -523047,39 +523048,39 @@ sub_811CF04: ; 811CF04 movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r1, 0xC1 lsls r1, 6 movs r0, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 thumb_func_end sub_811CF04 @@ -523262,7 +523263,7 @@ sub_811D0BC: ; 811D0BC movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0x1 movs r1, 0x1 movs r2, 0xE0 @@ -523276,7 +523277,7 @@ sub_811D0BC: ; 811D0BC movs r0, 0x1 bl PutWindowTileMap movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0xC pop {r0} bx r0 @@ -523893,7 +523894,7 @@ sub_811D60C: ; 811D60C push {r4,lr} sub sp, 0x8 movs r0, 0x3 - bl bg_get_tilemap + bl GetBgTileMap adds r4, r0, 0 bl sub_811BA68 lsls r0, 24 @@ -523934,7 +523935,7 @@ sub_811D60C: ; 811D60C adds r1, r4, 0 movs r2, 0 movs r3, 0xB - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect b @0811D67C @0811D668: movs r0, 0x20 @@ -523945,7 +523946,7 @@ sub_811D60C: ; 811D60C adds r1, r4, 0 movs r2, 0 movs r3, 0xA - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect @0811D67C: add sp, 0x8 pop {r4} @@ -523959,7 +523960,7 @@ sub_811D684: ; 811D684 movs r0, 0x2 bl PutWindowTileMap movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r0} bx r0 thumb_func_end sub_811D684 @@ -524535,7 +524536,7 @@ sub_811DADC: ; 811DADC movs r1, 0 movs r2, 0 movs r3, 0xA - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 cmp r4, 0x16 bls @0811DAFE b @0811DC1A @@ -524676,7 +524677,7 @@ sub_811DADC: ; 811DADC bl sub_811DC28 @0811DC1A: movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x8 pop {r4} pop {r0} @@ -524857,7 +524858,7 @@ sub_811DD84: ; 811DD84 lsls r1, 4 movs r0, 0x2 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r0, =0x0203a11c ldr r0, [r0] ldr r1, =0x000002ce @@ -524878,7 +524879,7 @@ sub_811DDAC: ; 811DDAC lsls r1, 24 lsrs r5, r1, 24 movs r0, 0x2 - bl bg_get_y_offset + bl GetBgY adds r2, r0, 0 ldr r0, =0x0203a11c ldr r3, [r0] @@ -524912,7 +524913,7 @@ sub_811DDAC: ; 811DDAC movs r0, 0x2 adds r1, r2, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY @0811DE0A: pop {r4,r5} pop {r0} @@ -524923,7 +524924,7 @@ sub_811DDAC: ; 811DDAC sub_811DE10: ; 811DE10 push {lr} movs r0, 0x2 - bl bg_get_y_offset + bl GetBgY ldr r1, =0x0203a11c ldr r2, [r1] movs r3, 0xB4 @@ -524938,7 +524939,7 @@ sub_811DE10: ; 811DE10 ldr r1, [r0] movs r0, 0x2 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 b @0811DE42 .pool @@ -524979,10 +524980,10 @@ sub_811DE5C: ; 811DE5C orrs r5, r1 movs r0, 0x40 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg pop {r4,r5} pop {r0} bx r0 @@ -527605,7 +527606,7 @@ sub_811F28C: ; 811F28C push {r4,lr} ldr r4, =0x0203a120 ldr r0, =0x00003ba4 - bl malloc + bl Alloc str r0, [r4] cmp r0, 0 beq @0811F2B0 @@ -527629,7 +527630,7 @@ sub_811F2B8: ; 811F2B8 ldr r0, [r4] cmp r0, 0 beq @0811F2CA - bl free + bl Free movs r0, 0 str r0, [r4] @0811F2CA: @@ -531917,7 +531918,7 @@ sub_8121478: ; 8121478 lsrs r6, r2, 24 ldr r4, =0x0203a134 ldr r0, =0x0000222c - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, =0x0000021d adds r0, r1 @@ -532057,7 +532058,7 @@ sub_8121478: ; 8121478 adds r0, r1, r3 strb r6, [r0] ldr r0, =sub_81219F0 - bl set_callback2 + bl SetMainCallback2 add sp, 0x4 pop {r4-r7} pop {r0} @@ -532136,55 +532137,55 @@ sub_81215EC: ; 81215EC bl reset_temp_tile_data_buffers movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 @081216EC: movs r1, 0 - bl lcd_io_set + bl SetGpuReg b @081219D4 @081216F4: movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0859F290 movs r0, 0 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x0203a134 ldr r1, [r4] movs r2, 0x8B lsls r2, 2 adds r1, r2 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x0000122c adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap b @081219D4 .pool @08121730: @@ -532231,14 +532232,14 @@ sub_81215EC: ; 81215EC movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r5, [sp] str r4, [sp, 0x4] movs r0, 0x2 movs r1, 0x1 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 ldr r2, =gUnknown_0859F2B8 ldr r0, =0x0203a134 ldr r0, [r0] @@ -532254,16 +532255,16 @@ sub_81215EC: ; 81215EC movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer b @081219D4 .pool @081217D8: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @081219D4 @081217EC: bl sub_8098C64 @@ -532446,13 +532447,13 @@ sub_81215EC: ; 81215EC movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 negs r0, r0 movs r1, 0 @@ -532503,7 +532504,7 @@ sub_81219F0: ; 81219F0 cmp r0, 0x1 bne @08121A0C ldr r0, =sub_8121C64 - bl set_callback2 + bl SetMainCallback2 b @08121A18 .pool @08121A0C: @@ -532881,7 +532882,7 @@ sub_8121D00: ; 8121D00 lsls r1, 2 adds r0, r1 ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 ldr r1, [r4] ldr r2, =0x0000021b adds r0, r1, r2 @@ -532917,14 +532918,14 @@ sub_8121D00: ; 8121D00 bl memset bl sub_80A1A74 movs r0, 0 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags bl FreeAllWindowBuffers ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] @08121D88: @@ -532940,19 +532941,19 @@ sub_8121DA0: ; 8121DA0 sub sp, 0xC movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xE movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg mov r1, sp movs r0, 0 strh r0, [r1] @@ -532987,35 +532988,35 @@ sub_8121E10: ; 8121E10 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY pop {r0} bx r0 thumb_func_end sub_8121E10 @@ -534379,17 +534380,17 @@ sub_812287C: ; 812287C movs r4, 0x80 lsls r4, 1 adds r0, r4, 0 - bl malloc + bl Alloc mov r10, r0 cmp r0, 0 beq @08122980 adds r0, r4, 0 - bl malloc + bl Alloc adds r7, r0, 0 cmp r7, 0 bne @081228B0 mov r0, r10 - bl free + bl Free b @08122980 @081228B0: bl sub_8009FCC @@ -534495,9 +534496,9 @@ sub_812287C: ; 812287C cmp r5, 0x4 bls @0812295E mov r0, r10 - bl free + bl Free adds r0, r7, 0 - bl free + bl Free @08122980: add sp, 0x4 pop {r3-r5} @@ -535285,7 +535286,7 @@ sub_8122DB0: ; 8122DB0 ldrb r0, [r0] movs r1, 0x3 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r1, [r4] adds r0, r1, 0 adds r0, 0x80 @@ -535293,7 +535294,7 @@ sub_8122DB0: ; 8122DB0 adds r1, 0x81 ldrb r2, [r1] movs r1, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r1, [r4] adds r0, r1, 0 adds r0, 0x80 @@ -535301,19 +535302,19 @@ sub_8122DB0: ; 8122DB0 adds r1, 0x82 ldrb r2, [r1] movs r1, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r0, [r4] adds r0, 0x80 ldrb r0, [r0] movs r1, 0x6 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r0, [r4] adds r0, 0x80 ldrb r0, [r0] movs r1, 0x4 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute @08123002: ldr r1, [r4] adds r1, 0x79 @@ -536342,35 +536343,35 @@ sub_81237B4: ; 81237B4 beq @0812381A ldrh r1, [r1, 0x2C] movs r0, 0x20 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrh r1, [r0, 0x34] movs r0, 0x22 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrh r1, [r0, 0x30] movs r0, 0x24 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrh r1, [r0, 0x38] movs r0, 0x26 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrh r1, [r0, 0x24] movs r0, 0x28 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrh r1, [r0, 0x26] movs r0, 0x2A - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrh r1, [r0, 0x28] movs r0, 0x2C - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrh r1, [r0, 0x2A] movs r0, 0x2E - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] adds r0, 0x7D movs r1, 0 @@ -538282,39 +538283,39 @@ sub_8124690: ; 8124690 bl SetVBlankCallback movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x0203a148 ldr r0, =0x00000a74 - bl malloc + bl Alloc str r0, [r4] cmp r0, 0 bne @08124754 ldr r0, =sub_8086194 - bl set_callback2 + bl SetMainCallback2 b @081248AA .pool @08124754: @@ -538325,11 +538326,11 @@ sub_8124690: ; 8124690 b @0812489C @08124766: movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085A1EE4 movs r0, 0x1 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates b @0812489C .pool @0812477C: @@ -538423,21 +538424,21 @@ sub_8124690: ; 8124690 @0812486C: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =sub_8124D14 bl sub_81248F4 ldr r0, =sub_81248D4 - bl set_callback2 + bl SetMainCallback2 @0812489C: ldr r1, =0x030022c0 movs r0, 0x87 @@ -539207,13 +539208,13 @@ sub_8124E0C: ; 8124E0C b @08124F06 @08124F00: ldr r0, =sub_81B58A8 - bl set_callback2 + bl SetMainCallback2 @08124F06: ldr r4, =0x0203a148 ldr r0, [r4] cmp r0, 0 beq @08124F16 - bl free + bl Free movs r0, 0 str r0, [r4] @08124F16: @@ -543984,7 +543985,7 @@ sub_812759C: ; 812759C bl sub_8127718 ldr r6, =0x0203a18c ldr r0, =0x00000524 - bl malloc_and_clear + bl AllocZeroed str r0, [r6] ldr r1, =0x00000522 adds r0, r1 @@ -544098,7 +544099,7 @@ sub_812764C: ; 812764C bl sub_81277A8 ldr r0, =0x0203a18c ldr r0, [r0] - bl free + bl Free ldr r1, =gUnknown_085A6B78 movs r2, 0x16 ldrsh r0, [r5, r2] @@ -544574,7 +544575,7 @@ sub_8127A8C: ; 8127A8C bl sub_81AE6C8 ldr r0, =0x0203a18c ldr r0, [r0] - bl free + bl Free adds r0, r5, 0 bl sub_8126E44 pop {r4,r5} @@ -546697,7 +546698,7 @@ c1_overworld_prev_quest: ; 8128BEC ldr r0, =sub_8128CD4 str r0, [r1] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task @08128C4C: @@ -547721,7 +547722,7 @@ sub_81293D8: ; 81293D8 str r1, [r0, 0x4] bl gpu_pal_obj_decompress_and_apply movs r0, 0x18 - bl malloc + bl Alloc adds r5, r0, 0 adds r1, r5, 0 ldr r0, =gUnknown_08614FF4 @@ -547741,7 +547742,7 @@ sub_81293D8: ; 81293D8 lsrs r4, 24 bl sub_81AFE24 adds r0, r5, 0 - bl free + bl Free adds r0, r4, 0 b @08129492 .pool @@ -547847,7 +547848,7 @@ sub_81294C0: ; 81294C0 str r1, [r0, 0x4] bl gpu_pal_obj_alloc_tag_and_apply movs r0, 0x18 - bl malloc + bl Alloc adds r4, r0, 0 adds r1, r4, 0 ldr r0, =gUnknown_085A72A4 @@ -547866,7 +547867,7 @@ sub_81294C0: ; 81294C0 lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 - bl free + bl Free b @081295BA .pool @081295A4: @@ -549451,7 +549452,7 @@ sub_812A25C: ; 812A25C ldr r1, =sub_812A334 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task @0812A2B2: @@ -549743,7 +549744,7 @@ sub_812A4DC: ; 812A4DC cmp r0, 0 bne @0812A530 ldr r0, =sub_812A588 - bl set_callback2 + bl SetMainCallback2 adds r0, r5, 0 bl remove_task @0812A530: @@ -549763,7 +549764,7 @@ sub_812A540: ; 812A540 lsrs r4, 24 ldr r5, =0x0203ab34 movs r0, 0x68 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] adds r0, r4, 0 adds r1, r6, 0 @@ -549849,13 +549850,13 @@ sub_812A588: ; 812A588 movs r3, 0 bl pal_fade_maybe movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg b @0812A64C @0812A638: bl sub_812FBC4 @@ -549878,7 +549879,7 @@ sub_812A588: ; 812A588 .pool @0812A660: ldr r0, =sub_812A670 - bl set_callback2 + bl SetMainCallback2 @0812A666: add sp, 0x4 pop {r0} @@ -549908,22 +549909,22 @@ sub_812A688: ; 812A688 adds r0, 0x58 ldrh r1, [r0] movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] adds r0, 0x5A ldrh r1, [r0] movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] adds r0, 0x5C ldrh r1, [r0] movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] adds r0, 0x5E ldrh r1, [r0] movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -550005,11 +550006,11 @@ sub_812A750: ; 812A750 mov r0, sp bl CpuSet movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085A7424 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_085A7434 bl InitWindows bl DeactivateAllTextPrinters @@ -550025,11 +550026,11 @@ sub_812A79C: ; 812A79C ldr r0, =sub_812A688 bl SetVBlankCallback movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts movs r1, 0xC1 lsls r1, 6 movs r0, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -550103,52 +550104,52 @@ sub_812A834: ; 812A834 push {lr} movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xE movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001048 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000809 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -550284,15 +550285,15 @@ sub_812A9CC: ; 812A9CC push {r4,r5,lr} ldr r4, =0x0203aacc movs r0, 0x8 - bl malloc + bl Alloc str r0, [r4] ldr r4, =0x0203aad0 movs r0, 0xE - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r5, =0x0203aadc movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] ldr r1, [r4] ldr r2, =0x00002051 @@ -551479,129 +551480,129 @@ sub_812B32C: ; 812B32C ldr r6, =0x0203ab34 ldr r0, [r6] ldr r0, [r0, 0x64] - bl set_callback2 + bl SetMainCallback2 ldr r4, =0x0203aaf4 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203aaf8 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203aafc ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab00 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab04 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab08 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab0c ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab10 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab14 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab18 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab1c ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab20 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab24 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab28 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203aae4 ldr r0, [r4] cmp r0, 0 beq @0812B3E4 - bl free + bl Free str r5, [r4] @0812B3E4: ldr r4, =0x0203aae8 ldr r0, [r4] cmp r0, 0 beq @0812B3F2 - bl free + bl Free str r5, [r4] @0812B3F2: ldr r4, =0x0203aaec ldr r0, [r4] cmp r0, 0 beq @0812B400 - bl free + bl Free str r5, [r4] @0812B400: ldr r4, =0x0203aaf0 ldr r0, [r4] cmp r0, 0 beq @0812B40E - bl free + bl Free str r5, [r4] @0812B40E: ldr r4, =0x0203aac8 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203aacc ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203aad0 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203aad4 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203aad8 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203aadc ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203aae0 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab2c ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ab30 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r0, [r6] - bl free + bl Free str r5, [r6] @0812B470: movs r0, 0 @@ -555581,7 +555582,7 @@ sub_812D28C: ; 812D28C lsrs r3, 16 movs r0, 0x2 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap ldrb r0, [r4, 0xC] bl sub_812EF6C movs r0, 0 @@ -555638,7 +555639,7 @@ sub_812D30C: ; 812D30C lsrs r3, 16 movs r0, 0x2 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap ldrh r0, [r4, 0xA] subs r0, 0x1 strh r0, [r4, 0xA] @@ -555729,7 +555730,7 @@ sub_812D3B4: ; 812D3B4 lsrs r3, 16 movs r0, 0x2 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap lsls r0, r5, 16 movs r1, 0x80 lsls r1, 9 @@ -555779,7 +555780,7 @@ sub_812D3B4: ; 812D3B4 lsrs r3, 16 movs r0, 0x2 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap lsls r0, r5, 16 movs r1, 0x80 lsls r1, 9 @@ -555892,10 +555893,10 @@ sub_812D51C: ; 812D51C strh r2, [r0] movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 bl sub_812DC08 @@ -555934,7 +555935,7 @@ sub_812D594: ; 812D594 ldr r0, =0x000001ff ands r1, r0 movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg adds r2, r5, 0 movs r1, 0xC ldrsh r0, [r4, r1] @@ -556406,7 +556407,7 @@ sub_812D950: ; 812D950 ldr r0, =0x000001ff ands r1, r0 movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0xE] lsls r0, 16 asrs r0, 19 @@ -556441,7 +556442,7 @@ sub_812D9A4: ; 812D9A4 strh r6, [r0] movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, [r4] movs r0, 0x8 strh r0, [r1, 0x1A] @@ -556597,7 +556598,7 @@ sub_812DB04: ; 812DB04 strh r0, [r1] ldrh r1, [r4, 0x10] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x12] movs r0, 0x1 ands r0, r1 @@ -556662,7 +556663,7 @@ sub_812DB8C: ; 812DB8C strh r0, [r1] movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl sub_812EEA8 lsls r0, 24 cmp r0, 0 @@ -556686,7 +556687,7 @@ sub_812DBBC: ; 812DBBC strh r0, [r1] movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x60 @@ -556731,7 +556732,7 @@ sub_812DC08: ; 812DC08 lsrs r3, 16 movs r0, 0x1 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap adds r4, 0x1 lsls r4, 16 lsrs r2, r4, 16 @@ -556758,7 +556759,7 @@ sub_812DC50: ; 812DC50 movs r0, 0x1 ldr r1, =gUnknown_085A9898 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @@ -556980,7 +556981,7 @@ sub_812DE14: ; 812DE14 adds r4, r0, 0 bl sub_812F968 movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -557638,7 +557639,7 @@ sub_812E33C: ; 812E33C cmp r0, 0 bne @0812E350 movs r0, 0x28 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] @0812E350: ldr r2, [r4] @@ -557726,7 +557727,7 @@ sub_812E3E8: ; 812E3E8 ldr r0, [r4] cmp r0, 0 beq @0812E410 - bl free + bl Free movs r0, 0 str r0, [r4] @0812E410: @@ -557794,7 +557795,7 @@ sub_812E474: ; 812E474 cmp r0, 0 bne @0812E490 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] @0812E490: ldr r2, [r4] @@ -557856,7 +557857,7 @@ sub_812E474: ; 812E474 cmp r0, 0 bne @0812E510 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] @0812E510: ldr r2, [r4] @@ -557926,7 +557927,7 @@ sub_812E5A8: ; 812E5A8 cmp r0, 0 bne @0812E5BC movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] @0812E5BC: ldr r2, [r4] @@ -558246,7 +558247,7 @@ sub_812E82C: ; 812E82C ldr r0, [r4] cmp r0, 0 beq @0812E878 - bl free + bl Free movs r0, 0 str r0, [r4] @0812E878: @@ -558254,7 +558255,7 @@ sub_812E82C: ; 812E82C ldr r0, [r4] cmp r0, 0 beq @0812E888 - bl free + bl Free movs r0, 0 str r0, [r4] @0812E888: @@ -558326,7 +558327,7 @@ sub_812E8F8: ; 812E8F8 ldr r0, [r4] cmp r0, 0 beq @0812E920 - bl free + bl Free movs r0, 0 str r0, [r4] @0812E920: @@ -559765,7 +559766,7 @@ sub_812F3B4: ; 812F3B4 lsls r1, 24 lsrs r1, 16 movs r0, 0x4C - bl lcd_io_set + bl SetGpuReg b @0812F468 @0812F416: ldrh r1, [r4, 0x32] @@ -559786,7 +559787,7 @@ sub_812F3B4: ; 812F3B4 lsls r1, 24 lsrs r1, 16 movs r0, 0x4C - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x32] movs r0, 0xFF ands r0, r1 @@ -560228,7 +560229,7 @@ sub_812F784: ; 812F784 push {lr} movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 thumb_func_end sub_812F784 @@ -560284,7 +560285,7 @@ sub_812F7E4: ; 812F7E4 ldr r4, =0x0203aad4 movs r0, 0xC8 lsls r0, 6 - bl malloc + bl Alloc adds r1, r0, 0 str r1, [r4] ldr r0, =gUnknown_08DD0050 @@ -560292,14 +560293,14 @@ sub_812F7E4: ; 812F7E4 ldr r4, =0x0203aad8 movs r0, 0xD8 lsls r0, 6 - bl malloc + bl Alloc adds r1, r0, 0 str r1, [r4] ldr r0, =gUnknown_085A858C bl call_LZZUnCompWram ldr r4, =0x0203ab30 movs r0, 0xB0 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r3, 0 ldr r5, =gUnknown_085A8334 @@ -560360,12 +560361,12 @@ sub_812F8A0: ; 812F8A0 push {r4-r6,lr} ldr r5, =0x0203ab2c movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] ldr r4, =0x0203aae0 movs r0, 0x80 lsls r0, 6 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] adds r3, r0, 0 movs r1, 0 @@ -560411,7 +560412,7 @@ sub_812F908: ; 812F908 movs r5, 0x88 lsls r5, 6 adds r0, r5, 0 - bl malloc + bl Alloc adds r1, r0, 0 str r1, [r4] ldr r0, =gUnknown_08DCDB30 @@ -560420,7 +560421,7 @@ sub_812F908: ; 812F908 movs r0, 0x2 adds r2, r5, 0 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r0, =gUnknown_08DCDA90 movs r1, 0 movs r2, 0xA0 @@ -560452,7 +560453,7 @@ sub_812F968: ; 812F968 lsls r2, 3 movs r0, 0x2 movs r3, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap pop {r0} bx r0 .pool @@ -560485,7 +560486,7 @@ sub_812F980: ; 812F980 lsrs r3, 16 movs r0, 0x3 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap mov r0, r8 ldr r1, [r0] adds r1, 0x2 @@ -560496,7 +560497,7 @@ sub_812F980: ; 812F980 lsrs r3, 16 movs r0, 0x3 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap mov r0, r8 ldr r1, [r0] adds r1, 0x4 @@ -560506,7 +560507,7 @@ sub_812F980: ; 812F980 lsrs r3, 16 movs r0, 0x3 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap mov r2, r8 ldr r1, [r2] adds r1, 0x6 @@ -560518,7 +560519,7 @@ sub_812F980: ; 812F980 lsrs r3, 16 movs r0, 0x3 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap adds r4, 0x1 lsls r4, 16 lsrs r0, r4, 16 @@ -560534,7 +560535,7 @@ sub_812F980: ; 812F980 lsrs r3, 16 movs r0, 0x3 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap mov r0, r8 ldr r1, [r0] adds r1, 0xA @@ -560543,7 +560544,7 @@ sub_812F980: ; 812F980 lsrs r3, 16 movs r0, 0x3 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap movs r0, 0x7 @0812FA32: mov r2, r8 @@ -560559,7 +560560,7 @@ sub_812F980: ; 812F980 lsrs r3, 16 movs r0, 0x3 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap adds r4, 0x1 lsls r4, 16 lsrs r0, r4, 16 @@ -560602,7 +560603,7 @@ sub_812FA78: ; 812FA78 movs r0, 0x2 movs r2, 0x2 adds r3, r4, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap ldr r1, [r6] adds r1, 0x2 ldr r0, =0x000001e1 @@ -560611,7 +560612,7 @@ sub_812FA78: ; 812FA78 lsrs r3, 16 movs r0, 0x2 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap ldr r1, [r6] adds r1, 0x4 movs r0, 0x80 @@ -560621,7 +560622,7 @@ sub_812FA78: ; 812FA78 lsrs r3, 16 movs r0, 0x2 movs r2, 0x2 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap ldr r1, [r6] adds r1, 0x6 ldr r0, =0x00000201 @@ -560631,7 +560632,7 @@ sub_812FA78: ; 812FA78 movs r0, 0x2 movs r2, 0x2 adds r3, r5, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap pop {r4-r6} pop {r0} bx r0 @@ -560646,9 +560647,9 @@ sub_812FAF4: ; 812FAF4 lsls r2, 3 movs r0, 0x2 movs r3, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg pop {r0} bx r0 .pool @@ -560723,7 +560724,7 @@ sub_812FBC4: ; 812FBC4 push {r6} ldr r4, =0x0203aaf4 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r6, =0x0203aad4 ldr r1, [r6] @@ -560733,7 +560734,7 @@ sub_812FBC4: ; 812FBC4 strh r5, [r0, 0x4] ldr r4, =0x0203aaf8 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, [r6] adds r1, r5 @@ -560745,7 +560746,7 @@ sub_812FBC4: ; 812FBC4 strh r2, [r0, 0x4] ldr r4, =0x0203aafc movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, [r6] movs r3, 0x80 @@ -560756,7 +560757,7 @@ sub_812FBC4: ; 812FBC4 strh r4, [r0, 0x4] ldr r4, =0x0203ab00 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, [r6] movs r2, 0xA0 @@ -560767,7 +560768,7 @@ sub_812FBC4: ; 812FBC4 strh r3, [r0, 0x4] ldr r4, =0x0203ab04 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, [r6] movs r4, 0xC0 @@ -560779,7 +560780,7 @@ sub_812FBC4: ; 812FBC4 strh r5, [r0, 0x4] ldr r4, =0x0203ab08 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, [r6] movs r2, 0x80 @@ -560791,7 +560792,7 @@ sub_812FBC4: ; 812FBC4 strh r1, [r0, 0x4] ldr r4, =0x0203ab0c movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, [r6] movs r3, 0xA0 @@ -560802,7 +560803,7 @@ sub_812FBC4: ; 812FBC4 strh r4, [r0, 0x4] ldr r4, =0x0203ab10 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, [r6] movs r2, 0xB0 @@ -560812,7 +560813,7 @@ sub_812FBC4: ; 812FBC4 strh r5, [r0, 0x4] ldr r4, =0x0203ab14 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, [r6] movs r3, 0xC8 @@ -560822,7 +560823,7 @@ sub_812FBC4: ; 812FBC4 strh r5, [r0, 0x4] ldr r4, =0x0203ab18 movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, [r6] movs r4, 0xE0 @@ -560838,7 +560839,7 @@ sub_812FBC4: ; 812FBC4 strh r2, [r0, 0xC] ldr r4, =0x0203ab1c movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, [r6] movs r4, 0x80 @@ -560850,7 +560851,7 @@ sub_812FBC4: ; 812FBC4 strh r1, [r0, 0x4] ldr r4, =0x0203ab20 movs r0, 0x28 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r2, [r6] movs r3, 0x8A @@ -560879,7 +560880,7 @@ sub_812FBC4: ; 812FBC4 strh r3, [r0, 0x24] ldr r4, =0x0203ab24 movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r2, [r6] movs r3, 0x98 @@ -560896,7 +560897,7 @@ sub_812FBC4: ; 812FBC4 strh r1, [r0, 0xC] ldr r4, =0x0203ab28 movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r2, [r6] movs r3, 0xBC @@ -560970,22 +560971,22 @@ sub_812FE0C: ; 812FE0C push {r4,r5,lr} ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 ldr r4, =0x030061c4 ldr r0, [r4] - bl free + bl Free movs r5, 0 str r5, [r4] ldr r4, =0x03006190 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r0, =0x030011f7 ldrb r0, [r0] bl RemoveWindow movs r0, 0x1 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free bl sub_805F094 pop {r4,r5} pop {r0} @@ -561075,7 +561076,7 @@ sub_812FE58: ; 812FE58 @0812FF14: ldrh r0, [r4, 0x20] bl SeedRng - bl init_keypad_data + bl InitKeypadData bl sub_8130098 movs r0, 0x87 lsls r0, 3 @@ -561128,9 +561129,9 @@ sub_812FE58: ; 812FE58 movs r1, 0x9A lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_812FDF8 - bl set_callback2 + bl SetMainCallback2 @0812FFA0: add sp, 0x4 pop {r4-r7} @@ -561214,7 +561215,7 @@ sub_812FFC8: ; 812FFC8 cmp r0, 0 bne @0813006E ldr r0, =sub_812FE0C - bl set_callback2 + bl SetMainCallback2 @0813006E: ldr r0, =0x030011f6 ldrb r0, [r0] @@ -561238,25 +561239,25 @@ sub_812FFC8: ; 812FFC8 sub_8130098: ; 8130098 push {r4,lr} movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085B07E8 movs r0, 0 movs r2, 0x1 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x80 lsls r0, 4 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r4, =0x030011f7 ldr r0, =gUnknown_085B07EC bl AddWindow @@ -561271,7 +561272,7 @@ sub_8130098: ; 8130098 movs r1, 0x3 bl CopyWindowToVram movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg pop {r4} pop {r0} bx r0 @@ -561354,7 +561355,7 @@ sub_813010C: ; 813010C adds r2, r4, 0 bl Print movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @081301D4: add sp, 0xC pop {r4-r6} @@ -561368,7 +561369,7 @@ sub_81301EC: ; 81301EC push {lr} movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r2, =0x04000200 ldrh r0, [r2] movs r1, 0x1 @@ -561376,19 +561377,19 @@ sub_81301EC: ; 81301EC strh r0, [r2] ldr r1, =0x00000c42 movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000a45 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -561434,13 +561435,13 @@ sub_8130280: ; 8130280 bne @08130298 movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg b @081302C0 .pool @08130298: ldr r1, =0x00000a45 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg ldr r1, =0x030011f2 ldr r0, =0x030011f4 ldrh r0, [r0] @@ -561455,7 +561456,7 @@ sub_8130280: ; 8130280 lsls r1, 16 lsrs r1, 16 movs r0, 0x4C - bl lcd_io_set + bl SetGpuReg @081302C0: pop {r0} bx r0 @@ -561961,12 +561962,12 @@ sub_8130738: ; 8130738 ldr r4, =0x030061c4 movs r0, 0x80 lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r4, =0x03006190 movs r0, 0x80 lsls r0, 6 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] pop {r4} pop {r0} @@ -568894,51 +568895,51 @@ set_256color_bg_bg0: ; 8133F0C bl SetVBlankCallback movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xE movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY add r1, sp, 0x4 movs r0, 0 strh r0, [r1] @@ -568980,11 +568981,11 @@ set_256color_bg_bg0: ; 8133F0C ldr r1, =0x06003800 bl LZ77UnCompVram movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085B1E00 movs r0, 0 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_085B1DCC bl InitWindows bl DeactivateAllTextPrinters @@ -569023,42 +569024,42 @@ set_256color_bg_bg0: ; 8133F0C movs r3, 0 bl pal_fade_maybe movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_8133EF8 bl SetVBlankCallback ldr r0, =sub_81341E0 - bl set_callback2 + bl SetMainCallback2 movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x1F - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0xFE - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0x7 - bl lcd_io_set + bl SetGpuReg movs r1, 0xC1 lsls r1, 6 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =sub_81341FC movs r1, 0 bl AddTask @@ -569415,7 +569416,7 @@ sub_8134400: ; 8134400 bl dp13_810BB8C ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 b @0813449A .pool @08134450: @@ -569591,12 +569592,12 @@ sub_81344C8: ; 81344C8 orrs r1, r0 lsrs r1, 16 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg lsls r5, 8 orrs r5, r4 movs r0, 0x44 adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg add sp, 0x34 pop {r3-r5} mov r8, r3 @@ -569623,10 +569624,10 @@ sub_8134604: ; 8134604 strh r0, [r4] movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 bl schedule_bg_copy_tilemap_to_vram pop {r4} @@ -569851,51 +569852,51 @@ LoadWallClockGraphics: ; 81347C8 bl SetVBlankCallback movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xE movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r3, 0xC0 lsls r3, 19 movs r4, 0xC0 @@ -569988,11 +569989,11 @@ LoadWallClockGraphics: ; 81347C8 movs r2, 0x8 bl gpu_pal_apply movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085B21FC movs r0, 0 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_085B21DC bl InitWindows bl DeactivateAllTextPrinters @@ -570032,30 +570033,30 @@ sub_813498C: ; 813498C movs r3, 0 bl pal_fade_maybe movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_81347B4 bl SetVBlankCallback ldr r0, =sub_8134C9C - bl set_callback2 + bl SetMainCallback2 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg add sp, 0x4 pop {r0} bx r0 @@ -570640,7 +570641,7 @@ c2_080111BC: ; 8134EE8 bl FreeAllWindowBuffers ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 @08134F02: pop {r0} bx r0 @@ -570737,7 +570738,7 @@ sub_8134FB0: ; 8134FB0 bne @08134FC6 ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 @08134FC6: pop {r0} bx r0 @@ -571790,7 +571791,7 @@ sub_81357FC: ; 81357FC lsrs r4, 24 ldr r5, =0x0203ab50 ldr r0, =0x00000e88 - bl malloc + bl Alloc str r0, [r5] ldr r2, =0x00000809 adds r0, r2 @@ -571870,7 +571871,7 @@ sub_81357FC: ; 81357FC strb r0, [r1] @081358D4: ldr r0, =sub_813594C - bl set_callback2 + bl SetMainCallback2 pop {r4-r6} pop {r0} bx r0 @@ -572176,7 +572177,7 @@ sub_8135978: ; 8135978 ldr r0, =sub_8135938 bl SetVBlankCallback ldr r0, =sub_813591C - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 b @08135BD2 .pool @@ -572194,31 +572195,31 @@ sub_8135BDC: ; 8135BDC push {lr} bl sub_8121DA0 movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085B2620 movs r0, 0 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =0x0203ab50 ldr r1, [r0] movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap bl sub_8121E10 movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -572690,7 +572691,7 @@ sub_8135FCC: ; 8135FCC str r0, [sp, 0x4] add r1, sp, 0x8 adds r2, r4, 0 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect lsls r0, r7, 24 lsrs r5, r0, 24 cmp r5, 0x4 @@ -572744,7 +572745,7 @@ sub_8135FCC: ; 8135FCC str r0, [sp, 0x4] add r1, sp, 0x8 adds r2, r4, 0 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @@ -572783,7 +572784,7 @@ sub_8136110: ; 8136110 movs r0, 0x2 str r0, [sp, 0x4] movs r2, 0xF - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram add sp, 0x8 @@ -572864,7 +572865,7 @@ sub_81361B0: ; 81361B0 cmp r4, r5 beq @08136246 movs r0, 0x8 - bl malloc + bl Alloc adds r7, r0, 0 lsls r0, r4, 3 adds r0, r6 @@ -572926,7 +572927,7 @@ sub_81361B0: ; 81361B0 str r0, [r2] str r1, [r2, 0x4] adds r0, r7, 0 - bl free + bl Free @08136246: pop {r4-r7} pop {r0} @@ -573336,18 +573337,18 @@ sub_8136524: ; 8136524 ldr r0, [r0] cmp r0, 0 beq @081365A4 - bl set_callback2 + bl SetMainCallback2 b @081365AC .pool @081365A4: subs r0, r4, 0x6 ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 @081365AC: bl FreeAllWindowBuffers ldr r0, =0x0203ab50 ldr r0, [r0] - bl free + bl Free adds r0, r5, 0 bl remove_task @081365BE: @@ -574776,34 +574777,34 @@ c2_change_map: ; 8137200 bl SetVBlankCallback movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg mov r1, sp movs r0, 0 strh r0, [r1] @@ -574849,14 +574850,14 @@ c2_change_map: ; 8137200 ldr r0, =sub_81371EC bl SetVBlankCallback ldr r0, =sub_81371D4 - bl set_callback2 + bl SetMainCallback2 bl sub_8137304 lsls r0, 24 cmp r0, 0 bne @081372D2 ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 @081372D2: add sp, 0x8 pop {r4} @@ -575033,7 +575034,7 @@ sub_8137420: ; 8137420 lsrs r4, 24 movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_085B2A90 ldr r1, =0x0600c000 bl LZ77UnCompVram @@ -575050,20 +575051,20 @@ sub_8137420: ; 8137420 bl gpu_pal_apply ldr r1, =0x00003e41 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001f0c movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg movs r1, 0x8A lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -575098,7 +575099,7 @@ sub_81374C4: ; 81374C4 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg cmp r4, 0x10 bhi @081374F8 ldrh r0, [r5, 0xA] @@ -575126,7 +575127,7 @@ sub_813750C: ; 813750C lsrs r4, 24 ldr r1, =0x00001010 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -575186,7 +575187,7 @@ sub_8137574: ; 8137574 @08137598: ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 @081375A0: pop {r0} bx r0 @@ -575227,7 +575228,7 @@ sub_81375D8: ; 81375D8 lsrs r4, 24 movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_085B2A90 ldr r1, =0x0600c000 bl LZ77UnCompVram @@ -575236,20 +575237,20 @@ sub_81375D8: ; 81375D8 bl LZ77UnCompVram movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001f0c movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg movs r1, 0x8A lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_085B2850 movs r1, 0xE0 movs r2, 0x20 @@ -575306,10 +575307,10 @@ sub_8137678: ; 8137678 @081376B4: ldr r1, =0x00001010 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003e41 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_81376DC str r0, [r4] @081376C8: @@ -575339,7 +575340,7 @@ sub_81376DC: ; 81376DC adds r1, r0 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg cmp r4, 0 beq @08137714 ldrh r0, [r5, 0xA] @@ -575354,7 +575355,7 @@ sub_81376DC: ; 81376DC bl gpu_pal_apply ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 @08137726: pop {r4,r5} pop {r0} @@ -575499,7 +575500,7 @@ sub_8137734: ; 8137734 bl sub_80EE4DC @0813785A: ldr r0, =sub_8173694 - bl set_callback2 + bl SetMainCallback2 movs r0, 0 add sp, 0x1C pop {r3} @@ -575514,7 +575515,7 @@ sub_8137734: ; 8137734 sp0C8_whiteout_maybe: ; 813787C push {lr} ldr r0, =c2_whiteout - bl set_callback2 + bl SetMainCallback2 movs r0, 0 pop {r1} bx r1 @@ -575972,7 +575973,7 @@ sub_8137C10: ; 8137C10 sub_8137C28: ; 8137C28 push {lr} ldr r0, =sub_8174194 - bl set_callback2 + bl SetMainCallback2 bl script_env_2_enable pop {r0} bx r0 @@ -575983,7 +575984,7 @@ sub_8137C28: ; 8137C28 sub_8137C3C: ; 8137C3C push {lr} ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x03005dac ldr r0, =mapldr_080CA5C0 str r0, [r1] @@ -576039,7 +576040,7 @@ sub_8137C94: ; 8137C94 sub_8137CB4: ; 8137CB4 push {lr} ldr r0, =sub_8177888 - bl set_callback2 + bl SetMainCallback2 bl script_env_2_enable pop {r0} bx r0 @@ -576053,7 +576054,7 @@ Special_ViewWallClock: ; 8137CC8 ldr r1, =c2_exit_to_overworld_2_switch str r1, [r0, 0x8] ldr r0, =Cb2_ViewWallClock - bl set_callback2 + bl SetMainCallback2 bl script_env_2_enable pop {r0} bx r0 @@ -577947,7 +577948,7 @@ sub_8138C84: ; 8138C84 sub_8138C94: ; 8138C94 push {lr} ldr r0, =sub_8138C84 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -580756,7 +580757,7 @@ sub_813A2DC: ; 813A2DC movs r1, 0xA ldrsh r0, [r6, r1] lsls r0, 3 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r0, =0x0203ab6a strh r5, [r0] @@ -581052,7 +581053,7 @@ sub_813A570: ; 813A570 bl sub_81AE6C8 ldr r0, =0x0203ab64 ldr r0, [r0] - bl free + bl Free ldrh r0, [r4, 0x22] lsls r0, 24 lsrs r0, 24 @@ -582206,7 +582207,7 @@ sub_813AF48: ; 813AF48 bl sub_81AE6C8 ldr r0, =0x0203ab64 ldr r0, [r0] - bl free + bl Free ldrh r0, [r4, 0x22] lsls r0, 24 lsrs r0, 24 @@ -584953,10 +584954,10 @@ sub_813C664: ; 813C664 cmp r0, 0 bne @0813C694 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x0203ab78 ldr r0, [r0] - bl free + bl Free movs r0, 0 bl sub_813C6A8 bl FreeAllWindowBuffers @@ -585061,64 +585062,64 @@ sub_813C6D4: ; 813C6D4 ldr r0, [r2, 0x8] movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xE movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg add sp, 0x8 pop {r3} mov r8, r3 @@ -585146,35 +585147,35 @@ sub_813C828: ; 813C828 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY pop {r0} bx r0 thumb_func_end sub_813C828 @@ -585185,7 +585186,7 @@ sub_813C880: ; 813C880 movs r1, 0x94 lsls r1, 4 movs r0, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 thumb_func_end sub_813C880 @@ -585201,7 +585202,7 @@ sub_813C890: ; 813C890 adds r0, r4, 0 movs r2, 0xC0 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, =gUnknown_085B3564 movs r0, 0x20 str r0, [sp] @@ -585209,7 +585210,7 @@ sub_813C890: ; 813C890 adds r0, r4, 0 movs r2, 0 movs r3, 0 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect ldr r0, =gUnknown_085B3544 movs r1, 0 movs r2, 0x20 @@ -585248,7 +585249,7 @@ sub_813C904: ; 813C904 movs r0, 0 bl SetVBlankCallback ldr r0, =sub_813C91C - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -585295,17 +585296,17 @@ sub_813C91C: ; 813C91C ldr r4, =0x0203ab78 movs r0, 0x80 lsls r0, 4 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085B3D64 movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r1, [r4] movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap bl sub_813C828 b @0813CA00 .pool @@ -585319,17 +585320,17 @@ sub_813C91C: ; 813C91C bl gpu_pal_apply b @0813CA00 @0813C9BE: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0813CA3C movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0813CA00 @0813C9DE: ldr r0, =gUnknown_085B3D6C @@ -585364,7 +585365,7 @@ sub_813C91C: ; 813C91C movs r1, 0x8 bl AddTask ldr r0, =sub_813C8EC - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 @@ -585444,7 +585445,7 @@ sub_813CA68: ; 813CA68 lsls r2, 3 movs r0, 0x2 movs r3, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap b @0813CB24 .pool @0813CAEC: @@ -585462,7 +585463,7 @@ sub_813CA68: ; 813CA68 ldr r1, =0xfffff800 movs r0, 0x2 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY b @0813CB24 .pool @0813CB20: @@ -586392,11 +586393,11 @@ sub_813D1C8: ; 813D1C8 strb r0, [r1] ldr r1, =0x00003f44 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg bl sub_813D25C pop {r0} bx r0 @@ -586467,7 +586468,7 @@ sub_813D25C: ; 813D25C orrs r1, r2 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r1, [r7] ldr r2, =0x00000616 adds r0, r1, r2 @@ -586595,7 +586596,7 @@ sub_813D3D8: ; 813D3D8 lsrs r4, 16 ldr r5, =0x0203ab7c ldr r0, =0x000015bc - bl malloc_and_clear + bl AllocZeroed str r0, [r5] movs r1, 0 movs r5, 0 @@ -586664,17 +586665,17 @@ sub_813D42C: ; 813D42C bl reset_all_obj_data bl gpu_pal_allocator_reset movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x2 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg b @0813D584 @0813D4A8: movs r0, 0x3 movs r1, 0x1 movs r2, 0x3 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r0, =gUnknown_085B4018 bl sub_81C4D70 ldr r0, =0x0203ab7c @@ -586740,16 +586741,16 @@ sub_813D42C: ; 813D42C @0813D544: ldr r1, =0x00003f41 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg bl sub_813D1C8 movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r1, 0x80 lsls r1, 5 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits b @0813D584 .pool @0813D56C: @@ -586890,7 +586891,7 @@ sub_813D5A0: ; 813D5A0 bl remove_task bl sub_81C4EB4 ldr r0, [r4] - bl free + bl Free str r7, [r4] b @0813D6A8 .pool @@ -586917,11 +586918,11 @@ sub_813D6B4: ; 813D6B4 movs r0, 0x3 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x3 movs r1, 0x4 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute pop {r0} bx r0 thumb_func_end sub_813D6B4 @@ -587363,7 +587364,7 @@ sub_813DA40: ; 813DA40 strh r5, [r1, 0xE] strh r6, [r1, 0x1C] ldr r0, =sub_813D9B0 - bl set_callback2 + bl SetMainCallback2 pop {r4-r6} pop {r0} bx r0 @@ -587403,25 +587404,25 @@ evolution_cutscene: ; 813DA8C bl CpuSet movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x42 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl sub_80A1A74 ldr r0, =0x02022e14 movs r2, 0 @@ -587457,7 +587458,7 @@ evolution_cutscene: ; 813DA8C movs r2, 0x4 strb r2, [r0] movs r0, 0x64 - bl malloc_and_clear + bl AllocZeroed ldr r1, =0x0203ab80 str r0, [r1] bl init_uns_table_pokemon_copy @@ -587634,14 +587635,14 @@ evolution_cutscene: ; 813DA8C movs r1, 0xFA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =nullsub_83 bl SetHBlankCallback ldr r0, =sub_813FCDC bl SetVBlankCallback bl m4aMPlayAllStop ldr r0, =sub_813E3A4 - bl set_callback2 + bl SetMainCallback2 add sp, 0x24 pop {r3-r5} mov r8, r3 @@ -587698,25 +587699,25 @@ sub_813DD7C: ; 813DD7C bl CpuSet movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x42 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl sub_80A1A74 ldr r0, =0x02022e14 strh r4, [r0] @@ -587798,13 +587799,13 @@ sub_813DD7C: ; 813DD7C movs r1, 0xFA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =nullsub_83 bl SetHBlankCallback ldr r0, =sub_813FCDC bl SetVBlankCallback ldr r0, =sub_813E3A4 - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 negs r0, r0 str r4, [sp] @@ -587813,13 +587814,13 @@ sub_813DD7C: ; 813DD7C movs r3, 0 bl pal_fade_maybe movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg add sp, 0x8 pop {r3,r4} mov r8, r3 @@ -587877,7 +587878,7 @@ sub_813DF70: ; 813DF70 @0813DFE0: movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 bl SetHBlankCallback movs r0, 0 @@ -587934,9 +587935,9 @@ sub_813DF70: ; 813DF70 movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 @@ -588049,15 +588050,15 @@ sub_813DF70: ; 813DF70 bl pal_fade_maybe bl sub_807B140 movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =sub_813E3C0 - bl set_callback2 + bl SetMainCallback2 movs r1, 0x9A lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg @0813E1C8: add sp, 0xC pop {r4-r6} @@ -588117,7 +588118,7 @@ sub_813E1D4: ; 813E1D4 ldr r1, =0x0203ab80 mov r9, r1 movs r0, 0x64 - bl malloc_and_clear + bl AllocZeroed mov r2, r9 str r0, [r2] movs r4, 0 @@ -588226,7 +588227,7 @@ sub_813E1D4: ; 813E1D4 ldr r0, =sub_813FD64 bl SetVBlankCallback ldr r0, =sub_813E3C0 - bl set_callback2 + bl SetMainCallback2 add sp, 0x18 pop {r3-r5} mov r8, r3 @@ -588572,13 +588573,13 @@ sub_813E570: ; 813E570 adds r0, 0x1 strh r0, [r1, 0x8] movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg bl @0813F1A4 .pool @0813E6D4: @@ -589036,12 +589037,12 @@ sub_813E570: ; 813E570 bl sub_805F094 ldr r4, =0x0203ab80 ldr r0, [r4] - bl free + bl Free str r6, [r4] bl FreeAllWindowBuffers ldr r0, =0x030061e8 ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 b @0813F1A4 .pool @0813EB34: @@ -589902,7 +589903,7 @@ sub_813F1B8: ; 813F1B8 strh r1, [r0, 0x8] ldr r1, =0x00000603 movs r0, 0xE - bl lcd_io_set + bl SetGpuReg bl @0813FCC4 .pool @0813F380: @@ -590036,7 +590037,7 @@ sub_813F1B8: ; 813F1B8 @0813F4A6: ldr r0, =0x0203ab84 ldr r0, [r0] - bl free + bl Free ldr r5, =0x0203ab80 ldr r0, [r5] ldrb r0, [r0, 0x1] @@ -590195,7 +590196,7 @@ sub_813F1B8: ; 813F1B8 bl remove_task ldr r4, =0x0203ab80 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r2, =0x03003014 ldrb r1, [r2] @@ -590205,7 +590206,7 @@ sub_813F1B8: ; 813F1B8 strb r0, [r2] ldr r0, =0x030061e8 ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 b @0813FCC4 .pool @0813F668: @@ -590624,14 +590625,14 @@ sub_813F1B8: ; 813F1B8 bl sub_800E084 @0813FA3E: movs r0, 0x3 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free movs r0, 0x1 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free movs r0, 0 - bl bg_get_tilemap - bl free + bl GetBgTileMap + bl Free bl FreeAllWindowBuffers ldr r0, =0x020244ec ldr r1, =0x03005e00 @@ -590891,35 +590892,35 @@ sub_813FCDC: ; 813FCDC ldr r0, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1c ldrh r1, [r0] movs r0, 0x18 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1e ldrh r1, [r0] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e20 ldrh r1, [r0] movs r0, 0x1C - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e22 ldrh r1, [r0] movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg bl copy_super_sprites_to_oam bl copy_queue_process bl copy_pal_bg_faded_to_pal_ram @@ -590935,35 +590936,35 @@ sub_813FD64: ; 813FD64 ldr r0, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1c ldrh r1, [r0] movs r0, 0x18 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1e ldrh r1, [r0] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e20 ldrh r1, [r0] movs r0, 0x1C - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e22 ldrh r1, [r0] movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg bl copy_super_sprites_to_oam bl copy_queue_process bl copy_pal_bg_faded_to_pal_ram @@ -591239,7 +591240,7 @@ sub_8140000: ; 8140000 ldr r4, =0x0203ab84 movs r0, 0xC8 lsls r0, 3 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] bl sub_813FFC0 cmp r5, 0 @@ -591267,53 +591268,53 @@ sub_8140000: ; 8140000 movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r1, =gUnknown_085B4D10 adds r0, r4, 0 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram adds r0, r4, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram cmp r5, 0 bne @081400C4 ldr r1, =0x00000442 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000808 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0xBA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r6, 0 movs r1, 0x7 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute adds r0, r4, 0 movs r1, 0x7 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg b @081400DE .pool @081400C4: ldr r1, =0x00000842 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000808 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0xDA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg @081400DE: ldr r0, =sub_813FDEC movs r1, 0x5 @@ -591387,7 +591388,7 @@ sub_8140174: ; 8140174 push {lr} movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e18 movs r1, 0 strh r1, [r0] @@ -591403,7 +591404,7 @@ sub_8140174: ; 8140174 lsrs r2, 24 movs r0, 0x1 movs r1, 0x7 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 movs r1, 0x5 bl sub_80391E0 @@ -591412,14 +591413,14 @@ sub_8140174: ; 8140174 lsrs r2, 24 movs r0, 0x2 movs r1, 0x7 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r1, 0xCA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x0203ab84 ldr r0, [r0] - bl free + bl Free pop {r0} bx r0 .pool @@ -591510,14 +591511,14 @@ sub_8140264: ; 8140264 lsls r1, 16 lsrs r1, 16 movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r1, [r4] ldrb r0, [r1, 0x1] cmp r0, 0 beq @081402A0 ldrh r1, [r1, 0x34] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @081402A0: ldr r2, [r4] movs r3, 0x2A @@ -591553,9 +591554,9 @@ sub_8140264: ; 8140264 movs r0, 0 movs r1, 0x1 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x040000d4 ldr r2, [r4] movs r3, 0xCF @@ -591588,9 +591589,9 @@ sub_8140264: ; 8140264 movs r0, 0 movs r1, 0x1 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg mov r1, sp movs r0, 0 strh r0, [r1] @@ -591622,30 +591623,30 @@ sub_8140388: ; 8140388 ldr r4, =0x0203ab88 movs r0, 0xE6 lsls r0, 6 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085B6140 movs r0, 0x1 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r1, [r4] movs r0, 0xBE lsls r0, 1 adds r1, r0 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r2, =0x0000117c adds r1, r2 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x0000317c adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r0, =gUnknown_085B614C bl InitWindows bl sub_8197200 @@ -591673,27 +591674,27 @@ sub_8140418: ; 8140418 ldr r4, =0x0000397c adds r0, r4 ldr r0, [r0] - bl free + bl Free ldr r0, [r5] adds r0, r4 movs r4, 0 str r4, [r0] bl FreeAllWindowBuffers movs r0, 0 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x2 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r0, [r5] movs r2, 0xE6 lsls r2, 6 movs r1, 0 bl memset ldr r0, [r5] - bl free + bl Free str r4, [r5] pop {r4,r5} pop {r0} @@ -591900,10 +591901,10 @@ sub_81405CC: ; 81405CC movs r1, 0x90 lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000060a movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @081407F8 .pool @08140650: @@ -591945,7 +591946,7 @@ sub_81405CC: ; 81405CC movs r0, 0x2 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer b @081407F8 .pool @081406C0: @@ -592002,21 +592003,21 @@ sub_81405CC: ; 81405CC movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg b @081407F8 @0814077A: movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_8140264 bl SetVBlankCallback movs r0, 0x1 @@ -592055,7 +592056,7 @@ sub_81405CC: ; 81405CC adds r1, 0xA5 strb r0, [r1] ldr r0, =sub_8140238 - bl set_callback2 + bl SetMainCallback2 b @08140806 .pool @081407F8: @@ -592165,10 +592166,10 @@ sub_81408A8: ; 81408A8 movs r1, 0x90 lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000808 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -594706,13 +594707,13 @@ sub_8141E7C: ; 8141E7C bl sub_8121E10 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl gpu_pal_allocator_reset bl sub_80A1A74 bl reset_all_obj_data @@ -594721,7 +594722,7 @@ sub_8141E7C: ; 8141E7C ldr r0, =sub_80AF168 str r0, [r1] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 adds r0, r5, 0 bl remove_task @08141EDE: @@ -595871,19 +595872,19 @@ sub_8142814: ; 8142814 ldr r0, [r4] ldrh r1, [r0, 0x2C] movs r0, 0x20 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrh r1, [r0, 0x2E] movs r0, 0x22 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrh r1, [r0, 0x30] movs r0, 0x24 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrh r1, [r0, 0x32] movs r0, 0x26 - bl lcd_io_set + bl SetGpuReg ldr r3, [r4] movs r0, 0x2E ldrsh r1, [r3, r0] @@ -595918,22 +595919,22 @@ sub_8142814: ; 8142814 lsls r1, r4, 16 lsrs r1, 16 movs r0, 0x28 - bl lcd_io_set + bl SetGpuReg ldr r6, =0x0fff0000 ands r4, r6 lsrs r4, 16 movs r0, 0x2A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg lsls r1, r5, 16 lsrs r1, 16 movs r0, 0x2C - bl lcd_io_set + bl SetGpuReg ands r5, r6 lsrs r5, 16 movs r0, 0x2E adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg pop {r4-r6} pop {r0} bx r0 @@ -595970,7 +595971,7 @@ sub_81428E4: ; 81428E4 movs r0, 0 bl SetVBlankCallback ldr r0, =sub_81405CC - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task @08142908: @@ -601036,7 +601037,7 @@ sub_8145354: ; 8145354 cmp r0, 0 bne @0814539E movs r0, 0x1C - bl malloc_and_clear + bl AllocZeroed str r0, [r5] ldr r4, =0x0203ab94 adds r0, r7, 0 @@ -601626,7 +601627,7 @@ sub_8145824: ; 8145824 lsls r1, r4, 16 asrs r1, 8 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX @08145848: pop {r4} pop {r0} @@ -601657,7 +601658,7 @@ sub_8145850: ; 8145850 cmp r0, 0 bne @08145884 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] @08145884: ldr r1, =gUnknown_085B8438 @@ -601745,11 +601746,11 @@ sub_8145914: ; 8145914 bl obj_delete_and_free_tiles ldr r4, =0x0203ab90 ldr r0, [r4] - bl free + bl Free movs r5, 0 str r5, [r4] ldr r0, [r6] - bl free + bl Free str r5, [r6] pop {r4-r6} pop {r0} @@ -602440,7 +602441,7 @@ sub_8145E84: ; 8145E84 movs r0, 0 strb r0, [r4] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 @08145EC0: bl run_active_tasks bl call_obj_callbacks @@ -602458,7 +602459,7 @@ sub_8145EDC: ; 8145EDC ldr r1, =0x0300120a strb r0, [r1] ldr r0, =sub_8145E84 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -602512,7 +602513,7 @@ sub_8145F20: ; 8145F20 bl remove_task ldr r4, =0x0203aba0 ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] movs r0, 0x1 @@ -602542,7 +602543,7 @@ sub_8145F6C: ; 8145F6C strh r4, [r1, 0xA] ldr r4, =0x0203aba0 movs r0, 0x3C - bl malloc_and_clear + bl AllocZeroed str r0, [r4] pop {r4} pop {r0} @@ -602767,16 +602768,16 @@ sub_8146144: ; 8146144 adds r4, r0, 0 movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0x40 - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0xC movs r1, 0x40 - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0xE movs r1, 0x40 - bl lcd_io_set_bits + bl SetGpuRegBits ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -602823,7 +602824,7 @@ sub_8146178: ; 8146178 lsls r1, r0, 4 orrs r1, r0 movs r0, 0x4C - bl lcd_io_set + bl SetGpuReg movs r1, 0xC ldrsh r0, [r4, r1] cmp r0, 0xE @@ -602919,7 +602920,7 @@ sub_814623C: ; 814623C ldr r0, =sub_8146358 bl SetHBlankCallback movs r0, 0x3 - bl enable_irqs + bl EnableInterrupts ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -603087,7 +603088,7 @@ sub_81463BC: ; 81463BC ldr r0, =sub_81464E8 bl SetHBlankCallback movs r0, 0x3 - bl enable_irqs + bl EnableInterrupts ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -605452,7 +605453,7 @@ sub_8147750: ; 8147750 ldr r0, =sub_81478C0 bl SetHBlankCallback movs r0, 0x2 - bl enable_irqs + bl EnableInterrupts ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -606076,7 +606077,7 @@ sub_8147C24: ; 8147C24 cmp r0, 0x13 ble @08147C78 movs r0, 0x2 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_81481E0 bl SetHBlankCallback mov r2, r8 @@ -606364,10 +606365,10 @@ sub_8147E88: ; 8147E88 bl memset movs r0, 0x40 movs r1, 0xF0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r6, 0x8] adds r0, 0x1 strh r0, [r6, 0x8] @@ -607141,10 +607142,10 @@ sub_8148508: ; 8148508 cmp r3, 0x9F bls @0814853A movs r0, 0x2 - bl enable_irqs + bl EnableInterrupts movs r0, 0x4 movs r1, 0x10 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r0, =sub_814869C bl SetVBlankCallback ldr r0, =sub_8148728 @@ -607475,7 +607476,7 @@ sub_8148798: ; 8148798 movs r0, 0x7 strh r0, [r6, 0x14] movs r0, 0x2 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_814869C bl SetVBlankCallback ldr r0, =sub_8148728 @@ -608785,7 +608786,7 @@ sub_81492B4: ; 81492B4 bl dp12_8087EA4 ldr r1, =0x00009a08 movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg add r0, sp, 0x4 add r1, sp, 0x8 bl sub_8149F58 @@ -609050,7 +609051,7 @@ sub_814946C: ; 814946C strh r1, [r4, 0xC] strh r2, [r4, 0x16] movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits @081494F0: movs r0, 0 pop {r4,r5} @@ -609167,7 +609168,7 @@ sub_81495B0: ; 81495B0 cmp r1, 0x9F bls @081495DC movs r0, 0x2 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_8149840 bl SetHBlankCallback ldr r0, =sub_8149774 @@ -610984,7 +610985,7 @@ sub_814A42C: ; 814A42C movs r1, 0xC0 lsls r1, 7 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits movs r5, 0 movs r0, 0x80 lsls r0, 6 @@ -611085,7 +611086,7 @@ sub_814A500: ; 814A500 ldr r0, =sub_814A6CC bl SetHBlankCallback movs r0, 0x2 - bl enable_irqs + bl EnableInterrupts ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -611399,7 +611400,7 @@ sub_814A798: ; 814A798 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r6, 0x1 str r6, [sp] str r4, [sp, 0x4] @@ -611409,7 +611410,7 @@ sub_814A798: ; 814A798 movs r1, 0x1 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r6, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -611417,9 +611418,9 @@ sub_814A798: ; 814A798 movs r1, 0x1 movs r2, 0x1D movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =gUnknown_085C8578 movs r1, 0xF0 movs r2, 0x20 @@ -611467,9 +611468,9 @@ sub_814A828: ; 814A828 movs r0, 0 movs r2, 0 movs r3, 0 - bl bg_copy_tilemap_rect + bl CopyRectToBgTileMapBufferRect movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldrh r0, [r4, 0xC] adds r0, 0x4 strh r0, [r4, 0xC] @@ -611579,9 +611580,9 @@ sub_814A898: ; 814A898 movs r1, 0x1 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -611620,7 +611621,7 @@ sub_814A960: ; 814A960 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r6, 0x1 str r6, [sp] str r4, [sp, 0x4] @@ -611630,7 +611631,7 @@ sub_814A960: ; 814A960 movs r1, 0x1 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r6, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -611638,9 +611639,9 @@ sub_814A960: ; 814A960 movs r1, 0x1 movs r2, 0x1D movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r4, =gUnknown_085C8578 adds r0, r4, 0 movs r1, 0xE0 @@ -611713,9 +611714,9 @@ sub_814AA04: ; 814AA04 str r0, [sp, 0x20] movs r2, 0 movs r3, 0 - bl bg_copy_tilemap_rect + bl CopyRectToBgTileMapBufferRect movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldrh r0, [r6, 0xC] subs r0, 0x1 strh r0, [r6, 0xC] @@ -611811,7 +611812,7 @@ sub_814AAB8: ; 814AAB8 mov r1, r8 movs r2, 0 movs r3, 0 - bl bg_copy_tilemap_rect + bl CopyRectToBgTileMapBufferRect b @0814AB78 .pool @0814AB2C: @@ -611846,7 +611847,7 @@ sub_814AAB8: ; 814AAB8 movs r0, 0 movs r1, 0x1 adds r2, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @0814AB72: ldrh r0, [r7, 0xC] adds r0, 0x1 @@ -611861,7 +611862,7 @@ sub_814AAB8: ; 814AAB8 strh r0, [r7, 0x8] @0814AB86: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 add sp, 0x24 pop {r3} @@ -611884,9 +611885,9 @@ sub_814ABA0: ; 814ABA0 movs r1, 0x1 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 negs r0, r0 movs r1, 0x10 @@ -611923,11 +611924,11 @@ sub_814ABE4: ; 814ABE4 ldr r5, =0x02022e14 ldrh r1, [r5] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x02022e16 ldrh r1, [r4] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r6, 0x8] ldrh r1, [r5] adds r0, r1 @@ -611962,9 +611963,9 @@ sub_814AC38: ; 814AC38 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =gUnknown_085C8578 movs r1, 0xF0 movs r2, 0x20 @@ -611975,10 +611976,10 @@ sub_814AC38: ; 814AC38 strh r5, [r4] movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg strh r5, [r6, 0xC] ldr r0, =sub_814ABE4 movs r1, 0x1 @@ -612091,9 +612092,9 @@ sub_814AD48: ; 814AD48 str r0, [sp, 0x20] movs r2, 0 movs r3, 0 - bl bg_copy_tilemap_rect + bl CopyRectToBgTileMapBufferRect movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldrh r0, [r4, 0xC] adds r0, 0x1 strh r0, [r4, 0xC] @@ -612156,9 +612157,9 @@ sub_814ADD8: ; 814ADD8 str r0, [sp, 0x8] movs r0, 0 movs r1, 0x1 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldrh r0, [r4, 0xC] adds r0, 0x1 strh r0, [r4, 0xC] @@ -612195,10 +612196,10 @@ sub_814AE40: ; 814AE40 strh r1, [r4] movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg movs r0, 0x20 str r0, [sp] str r0, [sp, 0x4] @@ -612206,9 +612207,9 @@ sub_814AE40: ; 814AE40 movs r1, 0x1 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 negs r0, r0 movs r1, 0x10 @@ -620962,7 +620963,7 @@ sub_814FC70: ; 814FC70 cmp r0, 0 bne @0814FC8E ldr r0, =sub_814FCC8 - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task @0814FC8E: @@ -621099,7 +621100,7 @@ sub_814FCC8: ; 814FCC8 ldr r0, [r2, 0x8] ldr r4, =0x0203abac ldr r0, =0x00004110 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, =0x030022c0 movs r2, 0x87 @@ -621134,31 +621135,31 @@ sub_814FCC8: ; 814FCC8 bl sound_sources_off bl map_music_set_to_zero movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085CD66C movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x0203abac ldr r1, [r4] adds r1, 0xFC movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r3, =0x000010fc adds r1, r3 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x000020fc adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r2, =0x000030fc adds r1, r2 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap ldr r2, =0x02021bbc ldr r1, =0x02021bbe movs r0, 0 @@ -621331,7 +621332,7 @@ sub_814FCC8: ; 814FCC8 movs r0, 0x1 movs r2, 0 movs r3, 0x11 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette ldr r0, [r6] ldr r2, =0x00004104 adds r0, r2 @@ -621345,7 +621346,7 @@ sub_814FCC8: ; 814FCC8 movs r0, 0x2 movs r2, 0 movs r3, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette ldr r0, [r6] ldr r1, =0x00004108 adds r0, r1 @@ -621358,7 +621359,7 @@ sub_814FCC8: ; 814FCC8 movs r0, 0x3 movs r2, 0 movs r3, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette ldr r0, [r6] ldr r2, =0x0000410c adds r0, r2 @@ -621370,7 +621371,7 @@ sub_814FCC8: ; 814FCC8 movs r0, 0x3 movs r2, 0 movs r3, 0x2 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 @@ -621400,7 +621401,7 @@ sub_814FCC8: ; 814FCC8 movs r0, 0 movs r2, 0 movs r3, 0xE - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette mov r3, r9 ldr r0, [r3] add r0, r8 @@ -621412,7 +621413,7 @@ sub_814FCC8: ; 814FCC8 movs r0, 0 movs r2, 0xC movs r3, 0x11 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette mov r1, r9 ldr r0, [r1] add r0, r8 @@ -621426,7 +621427,7 @@ sub_814FCC8: ; 814FCC8 movs r0, 0 movs r2, 0x18 movs r3, 0x14 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette mov r3, r9 ldr r0, [r3] add r0, r8 @@ -621437,7 +621438,7 @@ sub_814FCC8: ; 814FCC8 movs r0, 0 movs r2, 0 movs r3, 0x11 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette mov r1, r9 ldr r0, [r1] add r0, r8 @@ -621449,7 +621450,7 @@ sub_814FCC8: ; 814FCC8 movs r0, 0 movs r2, 0 movs r3, 0x14 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette mov r2, r9 ldr r0, [r2] add r0, r8 @@ -621460,7 +621461,7 @@ sub_814FCC8: ; 814FCC8 movs r0, 0 movs r2, 0xC movs r3, 0x14 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette mov r3, r9 ldr r0, [r3] add r0, r8 @@ -621472,7 +621473,7 @@ sub_814FCC8: ; 814FCC8 movs r0, 0 movs r2, 0xC movs r3, 0x17 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette mov r1, r9 ldr r0, [r1] add r0, r8 @@ -621483,7 +621484,7 @@ sub_814FCC8: ; 814FCC8 movs r0, 0 movs r2, 0x18 movs r3, 0x17 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 @@ -621528,7 +621529,7 @@ sub_814FCC8: ; 814FCC8 ldr r0, =sub_8150800 bl SetVBlankCallback ldr r0, =mainloop - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_81503E4 movs r1, 0 bl AddTask @@ -621579,13 +621580,13 @@ c2_8011A1C: ; 8150258 sub sp, 0x8 movs r4, 0 movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x2 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0 bl sub_8150B6C ldr r0, =0x02021bbc @@ -621612,15 +621613,15 @@ c2_8011A1C: ; 8150258 bl reset_all_obj_data bl sub_80A1A74 movs r0, 0 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x2 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x3 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r6, =0x0203abac ldr r0, [r6] ldr r2, =0x00004108 @@ -621630,14 +621631,14 @@ c2_8011A1C: ; 8150258 ldr r4, =0x0000410c adds r0, r4 ldr r0, [r0] - bl free + bl Free ldr r0, [r6] adds r4, r0, r4 str r5, [r4] ldr r4, =0x00004104 adds r0, r4 ldr r0, [r0] - bl free + bl Free ldr r0, [r6] adds r4, r0, r4 str r5, [r4] @@ -621645,18 +621646,18 @@ c2_8011A1C: ; 8150258 lsls r4, 7 adds r0, r4 ldr r0, [r0] - bl free + bl Free ldr r0, [r6] adds r4, r0, r4 str r5, [r4] ldr r4, =0x000040fc adds r0, r4 ldr r0, [r0] - bl free + bl Free ldr r0, [r6] adds r4, r0, r4 str r5, [r4] - bl free + bl Free str r5, [r6] movs r2, 0xC0 lsls r2, 19 @@ -621723,7 +621724,7 @@ c2_8011A1C: ; 8150258 ldr r0, =0x03005dac str r4, [r0] ldr r0, =c2_load_new_map - bl set_callback2 + bl SetMainCallback2 add sp, 0x8 pop {r3} mov r8, r3 @@ -621910,7 +621911,7 @@ sub_81503E4: ; 81503E4 ldrb r0, [r0] bl remove_task ldr r0, =c2_8011A1C - bl set_callback2 + bl SetMainCallback2 @08150542: add sp, 0x4 pop {r4-r7} @@ -621980,7 +621981,7 @@ sub_8150550: ; 8150550 movs r1, 0 movs r2, 0 movs r3, 0x16 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect b @08150630 @081505CA: movs r0, 0x2 @@ -622003,7 +622004,7 @@ sub_8150550: ; 8150550 movs r2, 0x2 @081505EC: movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect b @08150630 @081505F4: ldr r1, =0x00004108 @@ -622018,7 +622019,7 @@ sub_8150550: ; 8150550 movs r0, 0x3 movs r2, 0 movs r3, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette ldr r0, [r6] ldr r1, =0x0000410c adds r0, r1 @@ -622030,7 +622031,7 @@ sub_8150550: ; 8150550 movs r0, 0x3 movs r2, 0 movs r3, 0x2 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette ldr r1, [r6] movs r0, 0x40 strb r0, [r1, 0x15] @@ -622122,7 +622123,7 @@ sub_8150664: ; 8150664 movs r0, 0x3 movs r2, 0 movs r3, 0x2 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette b @081507B6 .pool @081506E8: @@ -622135,7 +622136,7 @@ sub_8150664: ; 8150664 movs r1, 0 movs r2, 0x2 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] movs r0, 0xA str r0, [sp, 0x4] @@ -622144,7 +622145,7 @@ sub_8150664: ; 8150664 movs r1, 0 movs r2, 0 movs r3, 0x16 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, [r7] movs r0, 0xC0 strb r0, [r1, 0x15] @@ -622161,7 +622162,7 @@ sub_8150664: ; 8150664 movs r0, 0x3 movs r2, 0x2 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, [r7] adds r0, r5 ldr r0, [r0] @@ -622172,7 +622173,7 @@ sub_8150664: ; 8150664 movs r0, 0x3 movs r2, 0x3 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, [r7] adds r0, r5 ldr r0, [r0] @@ -622183,7 +622184,7 @@ sub_8150664: ; 8150664 movs r0, 0x3 movs r2, 0x2 movs r3, 0x1 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, [r7] adds r0, r5 ldr r0, [r0] @@ -622194,7 +622195,7 @@ sub_8150664: ; 8150664 movs r0, 0x3 movs r2, 0x3 movs r3, 0x1 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect b @081507B6 .pool @08150784: @@ -622209,7 +622210,7 @@ sub_8150664: ; 8150664 movs r0, 0x3 movs r2, 0x4 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, [r7] adds r0, r5 ldr r0, [r0] @@ -622220,7 +622221,7 @@ sub_8150664: ; 8150664 movs r0, 0x3 movs r2, 0x4 movs r3, 0x1 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @081507B6: bl sub_81511B8 ldr r0, =0x0203abac @@ -622256,34 +622257,34 @@ sub_8150664: ; 8150664 sub_8150800: ; 8150800 push {r4,lr} movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r4, =0x0203abac ldr r0, [r4] ldrb r1, [r0, 0x14] movs r0, 0x1C - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrb r1, [r0, 0x15] movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrb r1, [r0, 0xC] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrb r1, [r0, 0xD] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrb r1, [r0, 0x8] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrb r1, [r0, 0x9] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg bl copy_super_sprites_to_oam bl copy_queue_process bl copy_pal_bg_faded_to_pal_ram @@ -622673,84 +622674,84 @@ sub_8150B6C: ; 8150B6C @08150B7A: movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x42 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xE movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg b @08150D1C @08150C1C: movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x42 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x020375e0 ldrh r3, [r0] cmp r3, 0 @@ -622791,53 +622792,53 @@ sub_8150B6C: ; 8150B6C ldr r0, [r4] ldrb r1, [r0, 0x14] movs r0, 0x1C - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrb r1, [r0, 0x15] movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrb r1, [r0, 0xC] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrb r1, [r0, 0xD] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrb r1, [r0, 0x8] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrb r1, [r0, 0x9] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r1, 0xFC lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg @08150D1C: pop {r4} pop {r0} @@ -622995,7 +622996,7 @@ sub_8150D28: ; 8150D28 movs r0, 0 movs r2, 0x18 movs r3, 0x1A - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] @@ -623518,7 +623519,7 @@ sub_8151214: ; 8151214 mov r10, r0 str r0, [sp, 0x8] movs r0, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r1, [r6] adds r2, r1, 0x1 adds r0, r2, 0 @@ -623543,7 +623544,7 @@ sub_8151214: ; 8151214 mov r0, r10 str r0, [sp, 0x8] movs r0, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 @@ -623570,7 +623571,7 @@ sub_8151214: ; 8151214 movs r0, 0 movs r1, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, [r4] ldrb r0, [r1, 0x18] cmp r0, 0 @@ -623604,7 +623605,7 @@ sub_8151214: ; 8151214 movs r0, 0 movs r1, 0 movs r2, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect @08151368: add sp, 0xC pop {r3-r5} @@ -623691,7 +623692,7 @@ sub_8151388: ; 8151388 mov r8, r0 str r0, [sp, 0x8] movs r0, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r1, [r6] adds r2, r1, 0x1 adds r0, r2, 0 @@ -623716,7 +623717,7 @@ sub_8151388: ; 8151388 mov r0, r8 str r0, [sp, 0x8] movs r0, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 @@ -623743,7 +623744,7 @@ sub_8151388: ; 8151388 str r1, [sp, 0x8] movs r0, 0 movs r1, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, [r5] ldrb r0, [r1, 0x18] cmp r0, 0xA @@ -625611,20 +625612,20 @@ sub_81521C0: ; 81521C0 @081521D6: ldr r6, =0x0203abb8 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed str r0, [r6] cmp r0, 0 beq @081521FE lsls r0, r4, 1 adds r0, r4 lsls r0, 4 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r6] str r0, [r1, 0x4] cmp r0, 0 bne @08152208 adds r0, r1, 0 - bl free + bl Free str r5, [r6] @081521FE: movs r0, 0 @@ -625716,7 +625717,7 @@ sub_8152254: ; 8152254 bl memset ldr r0, [r5] ldr r0, [r0, 0x4] - bl free + bl Free ldr r0, [r5] movs r4, 0 str r4, [r0, 0x4] @@ -625724,7 +625725,7 @@ sub_8152254: ; 8152254 movs r2, 0x8 bl memset ldr r0, [r5] - bl free + bl Free str r4, [r5] movs r0, 0x1 @081522C4: @@ -633233,7 +633234,7 @@ sub_8155EA8: ; 8155EA8 lsls r1, 16 lsrs r1, 16 movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r5, 0x3A] adds r0, 0x1 movs r1, 0 @@ -633298,7 +633299,7 @@ sub_8155F80: ; 8155F80 lsls r1, 16 lsrs r1, 16 movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg movs r3, 0x2E ldrsh r0, [r5, r3] cmp r0, 0x60 @@ -633492,7 +633493,7 @@ sub_8155F80: ; 8155F80 bls @08156126 movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 movs r1, 0x40 bl FieldEffectStop @@ -640275,7 +640276,7 @@ sub_81595E4: ; 81595E4 ldr r0, [r0] str r0, [r2] ldr r0, [r2, 0x8] - bl set_callback2 + bl SetMainCallback2 @0815960E: pop {r0} bx r0 @@ -640780,7 +640781,7 @@ dp01t_11_6_message_for_player_only: ; 8159A30 thumb_func_start sub_8159A54 sub_8159A54: ; 8159A54 push {lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -641702,7 +641703,7 @@ sub_815A1B0: ; 815A1B0 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0x30] movs r1, 0x10 subs r1, r0 @@ -641711,7 +641712,7 @@ sub_815A1B0: ; 815A1B0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -641730,7 +641731,7 @@ sub_815A1F4: ; 815A1F4 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0x30] subs r0, 0x1 strh r0, [r4, 0x30] @@ -641758,10 +641759,10 @@ sub_815A234: ; 815A234 adds r4, r0, 0 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl move_anim_8072740 pop {r4} @@ -641845,11 +641846,11 @@ sub_815A2F0: ; 815A2F0 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4 strh r0, [r4, 0x2E] ldr r0, =sub_815A31C @@ -641872,7 +641873,7 @@ sub_815A31C: ; 815A31C lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x30 ldrsh r0, [r4, r1] cmp r0, 0 @@ -641906,10 +641907,10 @@ sub_815A31C: ; 815A31C ble @0815A3A0 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 movs r1, 0x1 bl sub_8008258 @@ -642043,10 +642044,10 @@ sub_815A3F0: ; 815A3F0 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2E] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_815A49C str r0, [r4, 0x1C] @0815A48C: @@ -642068,7 +642069,7 @@ sub_815A49C: ; 815A49C lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0x30] adds r1, r0, 0x1 strh r1, [r4, 0x30] @@ -642099,10 +642100,10 @@ sub_815A49C: ; 815A49C bge @0815A4FE movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl move_anim_8072740 @0815A4FE: @@ -642639,11 +642640,11 @@ sub_815A934: ; 815A934 adds r5, r0, 0 ldr r1, =0x00001f3f movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 8 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r0, =0x02022e24 movs r1, 0 strh r1, [r0] @@ -642651,10 +642652,10 @@ sub_815A934: ; 815A934 strh r1, [r4] movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 movs r1, 0 bl sub_80A6980 @@ -642789,9 +642790,9 @@ sub_815AA6C: ; 815AA6C adds r4, r0, 0 ldr r1, =0x00003f3f movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl lcd_io_get + bl GetGpuReg adds r1, r0, 0 movs r2, 0x80 lsls r2, 8 @@ -642800,7 +642801,7 @@ sub_815AA6C: ; 815AA6C lsls r1, 16 lsrs r1, 16 movs r0, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl move_anim_8072740 pop {r4} @@ -642982,7 +642983,7 @@ sub_815ABEC: ; 815ABEC beq @0815AC40 ldr r1, =0x00001f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x02022e28 ldr r2, =0x000098f0 adds r0, r2, 0 @@ -642993,17 +642994,17 @@ sub_815ABEC: ; 815ABEC ldr r0, =0x02022e24 ldrh r1, [r0] movs r0, 0x42 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e26 ldrh r1, [r0] movs r0, 0x46 - bl lcd_io_set + bl SetGpuReg b @0815AC70 .pool @0815AC40: ldr r1, =0x00001f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x02022e28 movs r0, 0xF0 strh r0, [r1] @@ -643013,14 +643014,14 @@ sub_815ABEC: ; 815ABEC strh r0, [r4] movs r0, 0x42 movs r1, 0xF0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x46 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 7 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits @0815AC70: adds r0, r5, 0 bl move_anim_task_del @@ -643037,7 +643038,7 @@ sub_815AC8C: ; 815AC8C lsrs r4, r0, 24 ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e28 movs r1, 0 strh r1, [r0] @@ -643050,7 +643051,7 @@ sub_815AC8C: ; 815AC8C movs r1, 0x80 lsls r1, 7 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits @0815ACB8: adds r0, r4, 0 bl move_anim_task_del @@ -644499,7 +644500,7 @@ sub_815B7D0: ; 815B7D0 @0815B81C: movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02038436 ldrb r0, [r0] bl battle_get_per_side_status_permutated @@ -644556,7 +644557,7 @@ sub_815B7D0: ; 815B7D0 lsls r1, 16 lsrs r1, 16 movs r0, 0x4C - bl lcd_io_set + bl SetGpuReg cmp r5, 0xF beq @0815B8A6 b @0815BAFC @@ -644613,7 +644614,7 @@ sub_815B7D0: ; 815B7D0 mov r0, sp ldrh r3, [r0, 0xA] movs r0, 0x1 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 @@ -644764,7 +644765,7 @@ sub_815B7D0: ; 815B7D0 lsls r1, 16 lsrs r1, 16 movs r0, 0x4C - bl lcd_io_set + bl SetGpuReg cmp r5, 0 bne @0815BAFC @0815BA7A: @@ -644775,7 +644776,7 @@ sub_815B7D0: ; 815B7D0 @0815BA82: movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02038436 ldrb r0, [r0] bl battle_get_per_side_status_permutated @@ -644920,11 +644921,11 @@ sub_815BB84: ; 815BB84 @0815BBC8: ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0 movs r2, 0 @@ -645038,7 +645039,7 @@ sub_815BB84: ; 815BB84 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0xA ldrsh r0, [r4, r1] cmp r0, 0xC @@ -645069,7 +645070,7 @@ sub_815BB84: ; 815BB84 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r2, 0xA ldrsh r0, [r4, r2] cmp r0, 0 @@ -645151,10 +645152,10 @@ sub_815BB84: ; 815BB84 strh r1, [r0] movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl move_anim_task_del @0815BDF2: @@ -645526,10 +645527,10 @@ sub_815C0A4: ; 815C0A4 @0815C0EC: ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000d03 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0 movs r2, 0 @@ -645724,7 +645725,7 @@ sub_815C0A4: ; 815C0A4 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0xA ldrsh r0, [r4, r1] cmp r0, 0x5 @@ -645775,7 +645776,7 @@ sub_815C0A4: ; 815C0A4 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0xA ldrsh r0, [r4, r1] cmp r0, 0xD @@ -645809,10 +645810,10 @@ sub_815C0A4: ; 815C0A4 strh r1, [r0] movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r6, 0 bl move_anim_task_del @0815C396: @@ -646959,11 +646960,11 @@ sub_815CC94: ; 815CC94 adds r5, r0, 0 ldr r1, =0x00001f3f movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 8 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r0, =0x02022e24 movs r1, 0 strh r1, [r0] @@ -646971,10 +646972,10 @@ sub_815CC94: ; 815CC94 strh r1, [r4] movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x0203841e ldrh r0, [r0, 0x4] strh r0, [r5, 0x2E] @@ -647070,9 +647071,9 @@ sub_815CD0C: ; 815CD0C @0815CD82: ldr r1, =0x00003f3f movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl lcd_io_get + bl GetGpuReg adds r1, r0, 0 movs r2, 0x80 lsls r2, 8 @@ -647081,7 +647082,7 @@ sub_815CD0C: ; 815CD0C lsls r1, 16 lsrs r1, 16 movs r0, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl move_anim_8072740 @0815CDAA: @@ -647484,7 +647485,7 @@ sub_815CED8: ; 815CED8 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x03005e00 ldr r1, [sp, 0x18] lsls r4, r1, 2 @@ -647499,7 +647500,7 @@ sub_815CED8: ; 815CED8 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg strh r6, [r4, 0x8] ldr r0, =sub_815D160 str r0, [r4] @@ -647543,7 +647544,7 @@ sub_815D160: ; 815D160 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0xA ldrsh r0, [r4, r1] cmp r0, 0xA @@ -647699,7 +647700,7 @@ sub_815D240: ; 815D240 str r0, [sp] ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e18 ldrh r5, [r0] ldr r0, =0x02022e1a @@ -647710,7 +647711,7 @@ sub_815D240: ; 815D240 str r0, [sp] ldr r1, =0x00003f44 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1c ldrh r5, [r0] ldr r0, =0x02022e1e @@ -648028,7 +648029,7 @@ sub_815D398: ; 815D398 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r2, 0xE ldrsh r1, [r6, r2] cmp r1, 0 @@ -648085,7 +648086,7 @@ sub_815D398: ; 815D398 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0xE ldrsh r0, [r6, r1] cmp r0, 0x10 @@ -651461,7 +651462,7 @@ sub_815EF08: ; 815EF08 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] @@ -653759,7 +653760,7 @@ sub_81603A8: ; 81603A8 str r0, [r5, 0x1C] lsls r1, 8 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg pop {r4,r5} pop {r0} bx r0 @@ -653825,7 +653826,7 @@ sub_81603F4: ; 81603F4 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x3C ldrsh r0, [r4, r1] cmp r0, 0 @@ -653884,7 +653885,7 @@ sub_81603F4: ; 81603F4 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x3C ldrsh r0, [r4, r1] cmp r0, 0x10 @@ -654095,7 +654096,7 @@ sub_8160664: ; 8160664 cmp r0, 0 bne @08160688 ldr r0, =sub_81606A0 - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x03005dac ldr r0, =sub_80AF168 str r0, [r1] @@ -654118,7 +654119,7 @@ sub_81606A0: ; 81606A0 ldr r6, =0x0203bc34 movs r0, 0x8C lsls r0, 1 - bl malloc_and_clear + bl AllocZeroed str r0, [r6] ldr r1, =0x020375e0 ldrh r1, [r1] @@ -654155,7 +654156,7 @@ sub_81606A0: ; 81606A0 movs r2, 0x2 bl rboxid_80040B8 ldr r0, =sub_816082C - bl set_callback2 + bl SetMainCallback2 pop {r4-r6} pop {r0} bx r0 @@ -654172,7 +654173,7 @@ sub_8160740: ; 8160740 ldr r5, =0x0203bc34 movs r0, 0x8C lsls r0, 1 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] movs r1, 0x1C strb r1, [r0] @@ -654212,7 +654213,7 @@ sub_8160740: ; 8160740 movs r2, 0x2 bl rboxid_80040B8 ldr r0, =sub_816082C - bl set_callback2 + bl SetMainCallback2 pop {r4,r5} pop {r0} bx r0 @@ -654224,23 +654225,23 @@ sub_81607EC: ; 81607EC push {lr} bl sub_8121DA0 movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085CEC28 movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates bl sub_8121E10 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -654761,7 +654762,7 @@ sub_8160868: ; 8160868 @08160CE6: bl sub_8160EA0 ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 b @08160E8A .pool @08160CFC: @@ -654953,7 +654954,7 @@ sub_8160EA0: ; 8160EA0 bl sub_81AE6C8 bl FreeAllWindowBuffers ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] bl reset_all_obj_data @@ -660130,7 +660131,7 @@ sub_81639AC: ; 81639AC bl sub_816537C @08163A78: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 add sp, 0x4 pop {r4-r6} pop {r0} @@ -660152,7 +660153,7 @@ sub_8163A8C: ; 8163A8C ldr r1, =sub_81639AC str r1, [r0, 0x8] ldr r0, =sub_8036760 - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task @08163AB0: @@ -664766,7 +664767,7 @@ sub_8166204: ; 8166204 adds r6, r1, 0 ldr r4, =0x0203bcac ldr r0, =0x0000806c - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, =0x0203bc90 ldr r2, =0x00007fd0 @@ -664777,7 +664778,7 @@ sub_8166204: ; 8166204 ldr r0, =sub_8166380 bl launch_c3_walk_stairs_and_run_once ldr r0, =sub_816631C - bl set_callback2 + bl SetMainCallback2 pop {r4-r6} pop {r0} bx r0 @@ -664789,7 +664790,7 @@ sub_816624C: ; 816624C push {r4,r5,lr} ldr r4, =0x0203bcac ldr r0, =0x0000806c - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r5, =0x0203bc90 ldr r1, =0x00007fd0 @@ -664819,7 +664820,7 @@ sub_816624C: ; 816624C ldr r0, =sub_8166380 bl launch_c3_walk_stairs_and_run_once ldr r0, =sub_81662C0 - bl set_callback2 + bl SetMainCallback2 pop {r4,r5} pop {r0} bx r0 @@ -664846,7 +664847,7 @@ sub_81662C0: ; 81662C0 movs r1, 0 strb r1, [r0] ldr r0, =sub_8166304 - bl set_callback2 + bl SetMainCallback2 @081662F0: pop {r4} pop {r0} @@ -664978,11 +664979,11 @@ sub_8166380: ; 8166380 .pool @08166434: movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085DFCCC movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_085DFCDC bl InitWindows bl DeactivateAllTextPrinters @@ -665126,13 +665127,13 @@ map_warp_consider_1_to_outside_or_stair_or_dive: ; 8166564 ldr r0, =sub_8166340 bl SetVBlankCallback movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg ldr r1, [r4] adds r1, 0x50 ldrb r0, [r1] @@ -665446,19 +665447,19 @@ sub_816681C: ; 816681C bl SetVBlankCallback ldr r4, =0x0203bca0 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203bca4 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203bca8 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203bcac ldr r0, [r4] - bl free + bl Free str r5, [r4] bl FreeAllWindowBuffers ldr r1, =0x030022c0 @@ -665550,13 +665551,13 @@ sub_81668F8: ; 81668F8 b @081669DE @081669AE: movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg b @081669DE @081669C8: ldr r0, =sub_8166340 @@ -665593,7 +665594,7 @@ sub_81668F8: ; 81668F8 ldr r0, =sub_8166A34 bl launch_c3_walk_stairs_and_run_once ldr r0, =sub_816631C - bl set_callback2 + bl SetMainCallback2 @08166A18: add sp, 0x4 pop {r4} @@ -665840,7 +665841,7 @@ sub_8166BEC: ; 8166BEC .pool @08166C5C: ldr r0, [r0, 0x4] - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x0203bcac ldr r0, [r0] ldr r1, =0x00007b1c @@ -665906,19 +665907,19 @@ sub_8166BEC: ; 8166BEC bl SetVBlankCallback ldr r4, =0x0203bca0 ldr r0, [r4] - bl free + bl Free movs r5, 0 str r5, [r4] ldr r4, =0x0203bca4 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203bca8 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r0, [r6] - bl free + bl Free str r5, [r6] bl FreeAllWindowBuffers @08166D18: @@ -667394,63 +667395,63 @@ sub_8167930: ; 8167930 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r1, 0x88 lsls r1, 6 movs r0, 0x3 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r1, =0x00007040 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x91 lsls r1, 2 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000040b movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @08167B7E .pool @08167A04: ldr r4, =0x0203bca4 movs r0, 0xD0 lsls r0, 5 - bl malloc + bl Alloc str r0, [r4] ldr r5, =0x0203bca0 movs r4, 0xA0 lsls r4, 3 adds r0, r4, 0 - bl malloc + bl Alloc str r0, [r5] ldr r5, =0x0203bca8 adds r0, r4, 0 - bl malloc + bl Alloc str r0, [r5] b @08167B7E .pool @@ -667464,7 +667465,7 @@ sub_8167930: ; 8167930 movs r0, 0x3 movs r2, 0xE0 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @08167B7E .pool @08167A5C: @@ -667474,7 +667475,7 @@ sub_8167930: ; 8167930 lsls r2, 3 movs r0, 0x3 movs r3, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap b @08167B7E .pool @08167A74: @@ -667517,14 +667518,14 @@ sub_8167930: ; 8167930 movs r3, 0xA0 lsls r3, 2 movs r0, 0x1 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @08167B7E .pool @08167AEC: ldr r0, =0x0203bca0 ldr r1, [r0] movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, =gUnknown_08DCDA30 movs r0, 0xC str r0, [sp] @@ -667533,9 +667534,9 @@ sub_8167930: ; 8167930 movs r0, 0x1 movs r2, 0 movs r3, 0xD - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @08167B7E .pool @08167B1C: @@ -667556,7 +667557,7 @@ sub_8167930: ; 8167930 lsls r2, 3 movs r0, 0x2 movs r3, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap ldr r0, =gUnknown_086231E8 movs r1, 0x30 movs r2, 0x20 @@ -672157,7 +672158,7 @@ dp01t_11_5_message_for_player_only: ; 816A40C thumb_func_start sub_816A430 sub_816A430: ; 816A430 push {lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -672260,7 +672261,7 @@ sub_816A4E4: ; 816A4E4 strb r1, [r0] b @0816A574 @0816A522: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -673881,7 +673882,7 @@ sub_816B31C: ; 816B31C ldr r1, =mapldr_080EBC0C str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -674574,7 +674575,7 @@ sub_816B900: ; 816B900 ldr r1, =pal_fill_for_maplights_or_black str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -674833,7 +674834,7 @@ sub_816BB28: ; 816BB28 ldr r1, =sub_816BB48 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -674937,7 +674938,7 @@ sub_816BC14: ; 816BC14 ldr r4, =0x0203bcc4 movs r0, 0xCE lsls r0, 3 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r1, 0xCC lsls r1, 3 @@ -674975,7 +674976,7 @@ sub_816BC58: ; 816BC58 bls @0816BC5C ldr r0, =0x0203bcc4 ldr r0, [r0] - bl free + bl Free pop {r4} pop {r0} bx r0 @@ -675828,7 +675829,7 @@ bx_battle_menu_t3: ; 816C3A4 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @0816C3F2 @@ -676756,7 +676757,7 @@ sub_816CC00: ; 816CC00 cmp r0, 0 bne @0816CC3C ldr r0, =sub_816CC54 - bl set_callback2 + bl SetMainCallback2 b @0816CC4C .pool @0816CC3C: @@ -676782,7 +676783,7 @@ sub_816CC54: ; 816CC54 cmp r0, 0 bne @0816CC66 ldr r0, =c2_title_screen_1 - bl set_callback2 + bl SetMainCallback2 @0816CC66: pop {r0} bx r0 @@ -676862,13 +676863,13 @@ do_copyright_screen: ; 816CCC8 bl SetVBlankCallback movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0xA0 lsls r1, 19 ldr r2, =0x00007fff @@ -676876,13 +676877,13 @@ do_copyright_screen: ; 816CCC8 strh r0, [r1] movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg str r4, [sp, 0x4] movs r1, 0xC0 lsls r1, 19 @@ -676921,9 +676922,9 @@ do_copyright_screen: ; 816CCC8 movs r1, 0xE0 lsls r1, 3 movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_816CBE8 bl SetVBlankCallback movs r1, 0x80 @@ -676933,7 +676934,7 @@ do_copyright_screen: ; 816CCC8 adds r0, r2, 0 strh r0, [r1] ldr r0, =SerialCb_CopyrightScreen - bl set_serial_callback + bl SetSerialCallback ldr r0, =0x030062b0 bl GameCubeMultiBoot_Init @0816CDBC: @@ -676977,7 +676978,7 @@ do_copyright_screen: ; 816CCC8 movs r1, 0 bl AddTask ldr r0, =sub_816CC00 - bl set_callback2 + bl SetMainCallback2 ldr r5, =0x030062b0 ldrb r0, [r5, 0x2] cmp r0, 0 @@ -677005,7 +677006,7 @@ do_copyright_screen: ; 816CCC8 @0816CE8C: bl GameCubeMultiBoot_Quit ldr r0, =sub_800BA38 - bl set_serial_callback + bl SetSerialCallback @0816CE96: movs r0, 0 b @0816CEA2 @@ -677052,7 +677053,7 @@ c2_copyright_1: ; 816CEAC ldr r0, =0x02000000 movs r1, 0xE0 lsls r1, 9 - bl init_malloc + bl InitHeap @0816CEFA: pop {r0} bx r0 @@ -677088,16 +677089,16 @@ task_intro_1: ; 816CF18 bl intro_reset_and_hide_bgs movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0x18 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0x28 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_085E13B4 movs r1, 0xC0 lsls r1, 19 @@ -677153,17 +677154,17 @@ task_intro_1: ; 816CF18 bl gpu_pal_apply ldr r1, =0x00009603 movs r0, 0xE - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00009402 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00009201 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg movs r1, 0x90 lsls r1, 8 movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_085E4FDC bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085E4FEC @@ -677271,7 +677272,7 @@ task_intro_2: ; 816D12C movs r1, 0xFA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -677546,7 +677547,7 @@ task_intro_4: ; 816D354 strh r1, [r4, 0xC] ldrh r1, [r4, 0xA] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg movs r1, 0xE ldrsh r0, [r4, r1] lsls r0, 16 @@ -677559,7 +677560,7 @@ task_intro_4: ; 816D354 strh r1, [r4, 0x10] ldrh r1, [r4, 0xE] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg movs r1, 0x12 ldrsh r0, [r4, r1] lsls r0, 16 @@ -677572,7 +677573,7 @@ task_intro_4: ; 816D354 strh r1, [r4, 0x14] ldrh r1, [r4, 0x12] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r1, [r5] movs r0, 0xD0 lsls r0, 2 @@ -678540,10 +678541,10 @@ task_intro_10: ; 816DBAC bl pal_fade_maybe ldr r1, =0x00004883 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001441 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =task_intro_11 str r0, [r4] ldr r0, =0x030062a0 @@ -678712,25 +678713,25 @@ task_intro_14: ; 816DDD8 lsrs r5, 24 movs r0, 0x40 movs r1, 0xF0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0xA0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000b880 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001c05 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003641 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 negs r0, r0 ldr r1, =0x0000ffff @@ -678790,14 +678791,14 @@ task_intro_15: ; 816DE7C lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg b @0816DEC6 .pool @0816DEB8: movs r1, 0x82 lsls r1, 6 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldr r0, =task_intro_16 str r0, [r4] @0816DEC6: @@ -680002,45 +680003,45 @@ task_intro_21: ; 816E888 lsrs r5, 24 movs r0, 0x50 movs r1, 0x87 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001f1f movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0x1F - bl lcd_io_set + bl SetGpuReg movs r1, 0xB0 lsls r1, 7 movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00005a04 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001c06 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg movs r1, 0xDD lsls r1, 6 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000ffb0 movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r4, =gUnknown_08D8AA54 movs r1, 0xC0 lsls r1, 19 @@ -680098,13 +680099,13 @@ task_intro_23: ; 816E998 lsrs r4, 24 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -680139,7 +680140,7 @@ task_intro_24: ; 816E9DC lsls r1, 16 lsrs r1, 16 movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xC] lsls r1, 16 asrs r1, 24 @@ -680147,7 +680148,7 @@ task_intro_24: ; 816E9DC lsls r1, 16 lsrs r1, 16 movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0 @@ -680247,7 +680248,7 @@ task_intro_25: ; 816EAB8 movs r1, 0xD5 lsls r1, 6 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -680515,7 +680516,7 @@ task_intro_27: ; 816ED20 movs r1, 0xD5 lsls r1, 6 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r6, =0x03005e00 lsls r4, r5, 2 adds r4, r5 @@ -680680,7 +680681,7 @@ task_intro_29: ; 816EE90 lsrs r0, 24 bl remove_task ldr r0, =sub_816CC54 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -680939,40 +680940,40 @@ intro_reset_and_hide_bgs: ; 816F0C0 push {lr} movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 thumb_func_end intro_reset_and_hide_bgs @@ -680999,14 +681000,14 @@ task_intro_3_1: ; 816F128 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_0853FF70 ldrh r1, [r0, 0x3E] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 b @0816F1AC .pool @@ -681029,14 +681030,14 @@ task_intro_3_1: ; 816F128 adds r0, r2 ldrh r1, [r0] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @0816F1DA .pool @0816F1A0: ldr r0, =gUnknown_0853FF70 ldrh r1, [r0] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 @0816F1AC: strh r0, [r4, 0xA] @@ -681048,13 +681049,13 @@ task_intro_3_1: ; 816F128 @0816F1BC: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl remove_task @0816F1DA: @@ -681085,14 +681086,14 @@ task_intro_3_2: ; 816F1E0 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_0853FF70 ldrh r1, [r0] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 b @0816F264 .pool @@ -681115,14 +681116,14 @@ task_intro_3_2: ; 816F1E0 adds r0, r2 ldrh r1, [r0] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @0816F2A2 .pool @0816F258: ldr r0, =gUnknown_0853FF70 ldrh r1, [r0, 0x3E] movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 @0816F264: strh r0, [r4, 0xA] @@ -681143,13 +681144,13 @@ task_intro_3_2: ; 816F1E0 @0816F284: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl remove_task @0816F2A2: @@ -681181,28 +681182,28 @@ sub_816F2A8: ; 816F2A8 bl BgAffineSet ldrh r1, [r4] movs r0, 0x20 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2] movs r0, 0x22 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x4] movs r0, 0x24 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x6] movs r0, 0x26 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x8] movs r0, 0x28 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xA] movs r0, 0x2A - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xC] movs r0, 0x2C - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xE] movs r0, 0x2E - bl lcd_io_set + bl SetGpuReg add sp, 0x24 pop {r4} pop {r0} @@ -683000,7 +683001,7 @@ sub_81700F8: ; 81700F8 bl RegisterRamReset movs r0, 0 movs r1, 0x80 - bl lcd_io_clear_bits + bl ResetGpuRegBits strh r4, [r5] ldr r1, =0x030022c0 ldr r0, =0x00000439 @@ -683036,9 +683037,9 @@ sub_81700F8: ; 81700F8 ldr r0, =0x02000000 movs r1, 0xE0 lsls r1, 9 - bl init_malloc + bl InitHeap ldr r0, =sub_8086230 - bl set_callback2 + bl SetMainCallback2 pop {r4,r5} pop {r0} bx r0 @@ -683054,7 +683055,7 @@ sub_817018C: ; 817018C ldr r4, =0x0203bcd0 movs r0, 0x89 lsls r0, 4 - bl malloc + bl Alloc str r0, [r4] ldr r1, =0x0000088c adds r2, r0, r1 @@ -683062,7 +683063,7 @@ sub_817018C: ; 817018C strh r1, [r2] str r5, [r0] ldr r0, =sub_81701C4 - bl set_callback2 + bl SetMainCallback2 pop {r4,r5} pop {r0} bx r0 @@ -683074,39 +683075,39 @@ sub_81701C4: ; 81701C4 push {lr} movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl reset_all_obj_data bl gpu_pal_allocator_reset movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085E5068 movs r0, 0x1 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_085E5070 bl InitWindows bl DeactivateAllTextPrinters @@ -683116,7 +683117,7 @@ sub_81701C4: ; 81701C4 bl sub_809882C bl clear_scheduled_bg_copies_to_vram ldr r0, =sub_8170274 - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_8170260 bl SetVBlankCallback pop {r0} @@ -683233,11 +683234,11 @@ sub_8170290: ; 8170290 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =0x0203bcd0 ldr r1, [r0] ldr r0, =0x0000088c @@ -683306,11 +683307,11 @@ sub_8170290: ; 8170290 ldr r4, =0x0203bcd0 ldr r0, [r4] ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 ldr r0, [r4] cmp r0, 0 beq @08170412 - bl free + bl Free str r5, [r4] @08170412: bl FreeAllWindowBuffers @@ -683382,21 +683383,21 @@ sub_8170478: ; 8170478 strh r1, [r0] ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f3d movs r0, 0x4A - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 8 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 movs r1, 0x4 movs r2, 0 @@ -683626,7 +683627,7 @@ sub_8170660: ; 8170660 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r2, 0x20 ldrsh r0, [r5, r2] cmp r0, 0x8 @@ -683667,7 +683668,7 @@ sub_8170660: ; 8170660 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x20 ldrsh r4, [r5, r0] cmp r4, 0 @@ -683681,10 +683682,10 @@ sub_8170660: ; 8170660 ldr r4, =0x00003f3f movs r0, 0x48 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 @@ -683695,7 +683696,7 @@ sub_8170660: ; 8170660 bl lcd_bg_operations @0817076C: movs r0, 0 - bl lcd_io_get + bl GetGpuReg adds r1, r0, 0 movs r2, 0x80 lsls r2, 8 @@ -683704,13 +683705,13 @@ sub_8170660: ; 8170660 lsls r1, 16 lsrs r1, 16 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r4, 0x8 ldrsh r1, [r5, r4] lsls r0, r1, 4 @@ -685812,10 +685813,10 @@ sub_81718D8: ; 81718D8 movs r1, 0xFD lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4, 0x14] ldrh r0, [r0, 0x2] bl gpu_pal_tags_index_of @@ -685852,7 +685853,7 @@ sub_81718D8: ; 81718D8 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x32 ldrsh r0, [r4, r1] cmp r0, 0x10 @@ -685881,10 +685882,10 @@ sub_81718D8: ; 81718D8 bne @081719B0 movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg strh r5, [r4, 0x2E] ldr r0, =sub_81719C0 str r0, [r4, 0x1C] @@ -688315,17 +688316,17 @@ sub_8172D98: ; 8172D98 bne @08172DE8 ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg b @08172DF0 .pool @08172DE8: ldr r1, =0x00003f44 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg @08172DF0: movs r0, 0x52 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 @@ -688356,7 +688357,7 @@ sub_8172D98: ; 8172D98 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x10 @@ -689240,7 +689241,7 @@ sub_817357C: ; 817357C bl sub_8174EC4 ldr r4, =0x0203bcdc ldr r0, =0x00002014 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r0, =0x030022c0 movs r1, 0x87 @@ -689256,14 +689257,14 @@ sub_817357C: ; 817357C @081735EE: ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0xE2 lsls r1, 3 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl sub_8174FAC ldr r0, =0x0203bcdc ldr r1, [r0] @@ -689305,7 +689306,7 @@ sub_817357C: ; 817357C cmp r0, 0 bne @08173688 ldr r0, =sub_8173560 - bl set_callback2 + bl SetMainCallback2 movs r0, 0xDA lsls r0, 1 bl song_play_for_text @@ -689342,7 +689343,7 @@ sub_8173694: ; 8173694 strh r4, [r1, 0x8] ldr r4, =0x0203bcd8 movs r0, 0x78 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] @081736C4: pop {r4} @@ -689372,7 +689373,7 @@ sub_81736D8: ; 81736D8 strh r0, [r1, 0x8] ldr r4, =0x0203bcd8 movs r0, 0x78 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] @08173708: pop {r4} @@ -689714,15 +689715,15 @@ sub_81739C4: ; 81739C4 cmp r0, 0 beq @08173A34 movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x3 - bl bg_unset_tilemap + bl UnsetBgTileMap bl FreeAllWindowBuffers ldr r5, =0x0203bcdc ldr r0, [r5] cmp r0, 0 beq @08173A06 - bl free + bl Free movs r0, 0 str r0, [r5] @08173A06: @@ -689730,7 +689731,7 @@ sub_81739C4: ; 81739C4 ldr r0, [r5] cmp r0, 0 beq @08173A16 - bl free + bl Free movs r0, 0 str r0, [r5] @08173A16: @@ -690295,7 +690296,7 @@ sub_8173EA4: ; 8173EA4 lsls r1, 24 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @08173EDE: pop {r0} bx r0 @@ -690311,13 +690312,13 @@ sub_8173EE4: ; 8173EE4 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldr r6, =0x03005d90 ldr r0, [r6] ldrb r0, [r0, 0x8] @@ -690409,7 +690410,7 @@ sub_8173F84: ; 8173F84 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0x1 movs r1, 0x2 bl sub_8174C98 @@ -690553,25 +690554,25 @@ sub_81740B0: ; 81740B0 ldrh r0, [r1, 0x10] bl sub_818D8F0 movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg bl FreeAllWindowBuffers movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x3 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags adds r0, r7, 0 bl remove_task ldr r4, =0x0203bcdc ldr r0, [r4] cmp r0, 0 beq @08174150 - bl free + bl Free movs r0, 0 str r0, [r4] @08174150: @@ -690579,7 +690580,7 @@ sub_81740B0: ; 81740B0 ldr r0, [r4] cmp r0, 0 beq @08174160 - bl free + bl Free movs r0, 0 str r0, [r4] @08174160: @@ -690598,7 +690599,7 @@ sub_81740B0: ; 81740B0 sub_8174184: ; 8174184 push {lr} ldr r0, =sub_8175620 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -690634,7 +690635,7 @@ sub_8174194: ; 8174194 bl sub_8174EC4 ldr r4, =0x0203bcdc ldr r0, =0x00002014 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r0, =0x030022c0 movs r2, 0x87 @@ -690655,13 +690656,13 @@ sub_8174194: ; 8174194 @08174214: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl sub_8174FAC ldr r1, =0x030022c0 movs r4, 0x87 @@ -690714,14 +690715,14 @@ sub_8174194: ; 8174194 @081742B0: ldr r1, =0x00003f42 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0xE2 lsls r1, 3 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_8174324 movs r1, 0 bl AddTask @@ -690747,10 +690748,10 @@ sub_8174194: ; 8174194 ldr r4, =0x0203bcd8 movs r0, 0x80 lsls r0, 6 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r0, =sub_8173560 - bl set_callback2 + bl SetMainCallback2 @08174308: pop {r4} pop {r0} @@ -691454,26 +691455,26 @@ sub_81748F0: ; 81748F0 cmp r5, 0x5 bls @08174910 movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg bl sub_8198314 bl FreeAllWindowBuffers movs r0, 0x1 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0x3 - bl bg_unset_tilemap + bl UnsetBgTileMap movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags adds r0, r6, 0 bl remove_task ldr r4, =0x0203bcdc ldr r0, [r4] cmp r0, 0 beq @08174974 - bl free + bl Free movs r0, 0 str r0, [r4] @08174974: @@ -691481,7 +691482,7 @@ sub_81748F0: ; 81748F0 ldr r0, [r4] cmp r0, 0 beq @08174984 - bl free + bl Free movs r0, 0 str r0, [r4] @08174984: @@ -692178,45 +692179,45 @@ sub_8174F70: ; 8174F70 sub_8174FAC: ; 8174FAC push {r4,lr} movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085E5374 movs r0, 0 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x0203bcdc ldr r1, [r4] adds r1, 0x12 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00001012 adds r1, r0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY pop {r4} pop {r0} bx r0 @@ -692270,7 +692271,7 @@ sub_8175024: ; 8175024 movs r1, 0x1 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] movs r0, 0xB str r0, [sp, 0x4] @@ -692278,7 +692279,7 @@ sub_8175024: ; 8175024 movs r1, 0 movs r2, 0 movs r3, 0x3 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] movs r0, 0x6 str r0, [sp, 0x4] @@ -692286,18 +692287,18 @@ sub_8175024: ; 8175024 movs r1, 0x1 movs r2, 0 movs r3, 0xE - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 str r4, [sp] str r4, [sp, 0x4] movs r0, 0x3 movs r1, 0x2 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @08175108 @081750D2: bl sub_81971D0 @@ -692307,13 +692308,13 @@ sub_8175024: ; 8175024 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =0x0203bcdc ldr r1, [r0] movs r0, 0 @@ -692835,17 +692836,17 @@ sub_81754DC: ; 81754DC sub_8175548: ; 8175548 push {lr} movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085E6F68 movs r0, 0 movs r2, 0x1 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0x80 lsls r0, 4 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r0, =gUnknown_085E56F0 movs r1, 0x80 movs r2, 0x40 @@ -692859,7 +692860,7 @@ sub_8175548: ; 8175548 movs r1, 0x3 bl CopyWindowToVram movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg pop {r0} bx r0 .pool @@ -692870,10 +692871,10 @@ sub_81755A4: ; 81755A4 push {lr} bl FreeAllWindowBuffers movs r0, 0 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @081755B8 - bl free + bl Free @081755B8: pop {r0} bx r0 @@ -692944,7 +692945,7 @@ sub_8175620: ; 8175620 ldr r0, =0x02000000 movs r1, 0xE0 lsls r1, 9 - bl init_malloc + bl InitHeap bl sub_80A1A74 bl clear_tasks bl sub_8175548 @@ -692989,7 +692990,7 @@ sub_8175620: ; 8175620 strh r1, [r0, 0x8] ldr r1, =0x0000fffc movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_8175DA0 movs r1, 0 bl AddTask @@ -693009,20 +693010,20 @@ sub_8175620: ; 8175620 movs r3, 0 bl pal_fade_maybe movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_81754C8 bl SetVBlankCallback ldr r0, =0x000001c7 bl m4aSongNumStart ldr r0, =sub_81754DC - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x0203bce5 mov r1, r8 strb r1, [r0] ldr r4, =0x0203bce8 movs r0, 0xEB lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] bl sub_8177388 ldr r1, [r4] @@ -693153,7 +693154,7 @@ sub_8175808: ; 8175808 bne @08175836 movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl sub_8176CA0 ldr r0, =0x03005e00 @@ -693198,7 +693199,7 @@ c2_080C9BFC: ; 8175848 movs r3, 0 bl pal_fade_maybe movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_81754C8 bl SetVBlankCallback ldr r0, =sub_8175744 @@ -693224,7 +693225,7 @@ sub_81758A4: ; 81758A4 bne @081758D2 movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl sub_8176CA0 ldr r0, =0x03005e00 @@ -693387,17 +693388,17 @@ sub_81758E4: ; 81758E4 bl pal_fade_maybe movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0x20 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000703 movs r0, 0xE - bl lcd_io_set + bl SetGpuReg movs r1, 0xCA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg mov r0, r9 mov r1, r8 strb r0, [r1] @@ -693508,13 +693509,13 @@ sub_8175B1C: ; 8175B1C movs r1, 0xE0 lsls r1, 3 movs r0, 0x8 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts movs r1, 0xA0 lsls r1, 1 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -693702,40 +693703,40 @@ sub_8175CE4: ; 8175CE4 sub sp, 0x8 movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg mov r1, sp movs r0, 0 strh r0, [r1] @@ -694074,7 +694075,7 @@ sub_8175DA0: ; 8175DA0 bl sub_81755A4 ldr r4, =0x0203bce8 ldr r0, [r4] - bl free + bl Free str r5, [r4] @0817602A: add sp, 0x4 @@ -695393,31 +695394,31 @@ sub_8176AB0: ; 8176AB0 @08176AD6: movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0x8 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl reset_all_obj_data bl gpu_pal_allocator_reset movs r0, 0x1 @@ -696200,10 +696201,10 @@ sub_8177050: ; 8177050 movs r1, 0xF4 lsls r1, 4 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg ldrb r1, [r5, 0x1] movs r0, 0xD negs r0, r0 @@ -696231,7 +696232,7 @@ sub_8177050: ; 8177050 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @0817721C @081771EC: adds r2, r5, 0 @@ -696251,10 +696252,10 @@ sub_8177050: ; 8177050 @08177206: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r5, 0x3A] bl sub_818D820 @0817721C: @@ -697067,43 +697068,43 @@ sub_8177888: ; 8177888 bl SetVBlankCallback movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xE movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg add r1, sp, 0x4 movs r0, 0 strh r0, [r1] @@ -697147,7 +697148,7 @@ sub_8177888: ; 8177888 ldr r4, =0x0203bcf0 movs r0, 0x80 lsls r0, 5 - bl malloc + bl Alloc str r0, [r4] bl sub_8177B44 bl sub_8177B9C @@ -697169,7 +697170,7 @@ sub_8177888: ; 8177888 ldr r1, [r1] bl call_LZZUnCompWram movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram bl pokedex_diploma_something movs r4, 0x1 negs r4, r4 @@ -697184,11 +697185,11 @@ sub_8177888: ; 8177888 movs r3, 0 bl pal_fade_maybe movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_8177874 bl SetVBlankCallback ldr r0, =sub_8177A08 - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_8177A20 movs r1, 0 bl AddTask @@ -697281,12 +697282,12 @@ sub_8177A98: ; 8177A98 bne @08177AC2 ldr r0, =0x0203bcf0 ldr r0, [r0] - bl free + bl Free bl FreeAllWindowBuffers adds r0, r4, 0 bl remove_task ldr r0, =sub_80861E8 - bl set_callback2 + bl SetMainCallback2 @08177AC2: pop {r4} pop {r0} @@ -697304,7 +697305,7 @@ pokedex_diploma_something: ; 8177AD4 movs r1, 0x80 lsls r1, 1 movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EE855 bl CopyString @@ -697313,7 +697314,7 @@ pokedex_diploma_something: ; 8177AD4 @08177AFC: movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EE84F bl CopyString @@ -697341,32 +697342,32 @@ pokedex_diploma_something: ; 8177AD4 sub_8177B44: ; 8177B44 push {lr} movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085E81FC movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =0x0203bcf0 ldr r1, [r0] movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -697433,7 +697434,7 @@ sub_8177C14: ; 8177C14 push {r4,lr} ldr r4, =0x0203bcf4 ldr r0, =0x0000180c - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r0, =0x0203ce7c ldrh r0, [r0] @@ -697446,7 +697447,7 @@ sub_8177C14: ; 8177C14 adds r1, r2 strh r0, [r1] ldr r0, =sub_8177C84 - bl set_callback2 + bl SetMainCallback2 pop {r4} pop {r0} bx r0 @@ -697638,7 +697639,7 @@ sub_8177CB0: ; 8177CB0 ldr r0, =sub_8177C70 bl SetVBlankCallback ldr r0, =sub_8177C54 - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 b @08177E0E .pool @@ -697654,21 +697655,21 @@ sub_8177CB0: ; 8177CB0 sub_8177E14: ; 8177E14 push {r4,lr} movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085EFCF0 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x0203bcf4 ldr r1, [r4] movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] movs r0, 0x80 lsls r0, 4 adds r1, r0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap bl sub_8121E10 movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram @@ -697677,18 +697678,18 @@ sub_8177E14: ; 8177E14 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg pop {r4} pop {r0} bx r0 @@ -697922,7 +697923,7 @@ sub_8178090: ; 8178090 push {r4,lr} sub sp, 0x8 movs r0, 0 - bl bg_get_tilemap + bl GetBgTileMap ldr r1, =0x0203bcf4 ldr r1, [r1] movs r2, 0x80 @@ -698562,10 +698563,10 @@ sub_8178610: ; 8178610 bl sub_8178594 ldr r0, =0x0203bcf4 ldr r0, [r0] - bl free + bl Free bl FreeAllWindowBuffers ldr r0, =sub_81AD40C - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task @08178642: @@ -698932,11 +698933,11 @@ sub_81787AC: ; 81787AC ldrb r2, [r6, 0x2] movs r0, 0x1 adds r1, r4, 0 - bl bg_change_y_offset + bl ChangeBgY ldrb r2, [r6, 0x2] movs r0, 0x2 adds r1, r4, 0 - bl bg_change_y_offset + bl ChangeBgY movs r2, 0 ldrsh r0, [r6, r2] cmp r0, 0 @@ -698995,11 +698996,11 @@ sub_8178974: ; 8178974 ldr r0, =sub_8178944 bl SetVBlankCallback movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085EFD64 movs r0, 0 movs r2, 0x1 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_085EFD68 bl InitWindows lsls r0, 16 @@ -699023,7 +699024,7 @@ sub_8178974: ; 8178974 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0 movs r1, 0x1 movs r2, 0xD0 @@ -699033,10 +699034,10 @@ sub_8178974: ; 8178974 movs r1, 0xA0 lsls r1, 1 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_8009404 movs r1, 0 bl AddTask @@ -699051,7 +699052,7 @@ sub_8178974: ; 8178974 movs r2, 0x2 bl rboxid_80040B8 ldr r0, =sub_8178A78 - bl set_callback2 + bl SetMainCallback2 @08178A22: add sp, 0x8 pop {r4} @@ -699140,7 +699141,7 @@ sub_8178A78: ; 8178A78 movs r1, 0x3 bl CopyWindowToVram movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 negs r0, r0 movs r1, 0 @@ -699511,7 +699512,7 @@ sub_8178A78: ; 8178A78 ands r0, r1 cmp r0, 0 bne @08178E58 - bl do_reset + bl Reset @08178E58: ldr r0, =0x030030e0 ldr r0, [r0] @@ -699665,7 +699666,7 @@ fullscreen_save_activate: ; 8178F90 lsls r4, 24 lsrs r4, 24 ldr r0, =sub_8178FDC - bl set_callback2 + bl SetMainCallback2 ldr r0, =0x0203bcfc strh r4, [r0] ldr r1, =0x0203bcfe @@ -699713,43 +699714,43 @@ sub_8178FDC: ; 8178FDC bl SetVBlankCallback movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xE movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg add r1, sp, 0x4 movs r0, 0 strh r0, [r1] @@ -699794,15 +699795,15 @@ sub_8178FDC: ; 8178FDC ldr r1, =0x06010020 bl LZ77UnCompVram movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085EFD88 movs r0, 0 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r5, =0x0201e000 movs r0, 0 adds r1, r5, 0 - bl bg_set_tilemap + bl SetBgTileMap mov r0, r8 str r0, [sp, 0x8] ldr r2, =0x05000200 @@ -699816,7 +699817,7 @@ sub_8178FDC: ; 8178FDC lsls r6, 2 movs r0, 0 adds r3, r6, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r0, =gUnknown_085EFD94 bl InitWindows ldr r0, =gUnknown_085EFD9C @@ -699895,19 +699896,19 @@ sub_8178FDC: ; 8178FDC movs r3, 0 bl pal_fade_maybe movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_8178FC8 bl SetVBlankCallback movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldrb r0, [r7] adds r0, 0x1 strb r0, [r7] @@ -699919,7 +699920,7 @@ sub_8178FDC: ; 8178FDC cmp r0, 0 bne @08179272 ldr r0, =sub_8179288 - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_8179454 bl SetVBlankCallback @08179272: @@ -700016,7 +700017,7 @@ sub_8179288: ; 8179288 movs r2, 0 bl sub_8178F44 ldr r0, =sub_8179390 - bl set_callback2 + bl SetMainCallback2 b @08179380 .pool @08179370: @@ -700026,7 +700027,7 @@ sub_8179288: ; 8179288 bl sub_8178F44 @0817937A: ldr r0, =sub_81793E0 - bl set_callback2 + bl SetMainCallback2 @08179380: pop {r4-r6} pop {r0} @@ -700057,7 +700058,7 @@ sub_8179390: ; 8179390 ldr r0, =sub_8178FC8 bl SetVBlankCallback ldr r0, =sub_81793E0 - bl set_callback2 + bl SetMainCallback2 @081793C4: pop {r0} bx r0 @@ -700086,7 +700087,7 @@ sub_81793E0: ; 81793E0 ldr r0, =sub_8178FC8 bl SetVBlankCallback ldr r0, =sub_8179428 - bl set_callback2 + bl SetMainCallback2 @08179410: add sp, 0x4 pop {r0} @@ -700106,11 +700107,11 @@ sub_8179428: ; 8179428 ldr r0, [r5] cmp r0, 0 bne @08179448 - bl do_reset + bl Reset b @0817944E .pool @08179448: - bl set_callback2 + bl SetMainCallback2 str r4, [r5] @0817944E: pop {r4,r5} @@ -700997,7 +700998,7 @@ sub_8179B98: ; 8179B98 @08179BF8: ldr r4, =0x0203bd18 ldr r0, =0x00001084 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] bl vblank_hblank_handler_set_zero bl clear_scheduled_bg_copies_to_vram @@ -701138,7 +701139,7 @@ sub_8179B98: ; 8179B98 ldr r0, =sub_8179B84 bl SetVBlankCallback ldr r0, =sub_8179B68 - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 b @08179D66 .pool @@ -701180,30 +701181,30 @@ sub_8179D9C: ; 8179D9C push {lr} bl sub_8121DA0 movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085F0550 movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =0x0203bd18 ldr r1, [r0] adds r1, 0x48 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap bl sub_8121E10 movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -701722,13 +701723,13 @@ sub_817A2C0: ; 817A2C0 bl MPlayVolumeControl ldr r0, =0x030022c0 ldr r0, [r0, 0x8] - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task bl FreeAllWindowBuffers ldr r0, =0x0203bd18 ldr r0, [r0] - bl free + bl Free bl sub_805F094 @0817A304: pop {r4} @@ -702908,7 +702909,7 @@ sub_817AD40: ; 817AD40 adds r0, r5, 0 bl remove_task ldr r0, =sub_817AFD4 - bl set_callback2 + bl SetMainCallback2 @0817ADB2: add sp, 0xC pop {r4,r5} @@ -702927,7 +702928,7 @@ sub_817ADC0: ; 817ADC0 adds r0, r4, 0 bl remove_task ldr r0, =sub_817AFD4 - bl set_callback2 + bl SetMainCallback2 pop {r4} pop {r0} bx r0 @@ -702970,40 +702971,40 @@ sub_817AE00: ; 817AE00 bl SetVBlankCallback movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1E movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg add r0, sp, 0x4 movs r4, 0 strh r4, [r0] @@ -703071,22 +703072,22 @@ sub_817AE00: ; 817AE00 bl clear_tasks bl reset_all_obj_data movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085F06C0 movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg bl sub_817B02C ldr r0, =0x0000ffff str r0, [sp] @@ -703095,7 +703096,7 @@ sub_817AE00: ; 817AE00 movs r3, 0 bl pal_fade_maybe movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts ldr r0, =sub_817ADF4 bl SetVBlankCallback ldr r0, =0x030022c0 @@ -703115,7 +703116,7 @@ sub_817AE00: ; 817AE00 cmp r0, 0 bne @0817AFC8 ldr r0, =sub_817ADE4 - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 b @0817AFCA .pool @@ -703161,7 +703162,7 @@ sub_817AFD4: ; 817AFD4 cmp r0, 0 bne @0817B020 bl FreeAllWindowBuffers - bl do_reset + bl Reset @0817B020: add sp, 0x4 pop {r4} @@ -703281,33 +703282,33 @@ sub_817B150: ; 817B150 @0817B162: ldr r1, =0x00000603 movs r0, 0xE - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000702 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000f05 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg movs r1, 0xF2 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg b @0817B1B6 .pool @0817B194: ldr r1, =0x00000603 movs r0, 0xE - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000702 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000f05 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg movs r1, 0xF2 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg @0817B1B6: pop {r0} bx r0 @@ -703463,17 +703464,17 @@ sub_817B3A8: ; 817B3A8 push {lr} ldr r1, =0x00000603 movs r0, 0xE - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000702 movs r0, 0xC - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000f05 movs r0, 0xA - bl lcd_io_set + bl SetGpuReg movs r1, 0xFA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -703566,7 +703567,7 @@ sub_817B458: ; 817B458 strh r1, [r4, 0xE] ldrh r1, [r4, 0xC] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r2, =0x0203bd24 ldr r0, =0x0203bd26 ldrh r1, [r0] @@ -703575,7 +703576,7 @@ sub_817B458: ; 817B458 lsls r1, 16 lsrs r1, 16 movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg @0817B4A0: ldrh r0, [r4, 0x10] lsls r2, r0, 16 @@ -703593,7 +703594,7 @@ sub_817B458: ; 817B458 strh r1, [r4, 0x14] ldrh r1, [r4, 0x12] movs r0, 0x18 - bl lcd_io_set + bl SetGpuReg movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 @@ -703606,14 +703607,14 @@ sub_817B458: ; 817B458 lsls r1, 16 lsrs r1, 16 movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg b @0817B4FA .pool @0817B4F0: ldr r0, =0x0203bd24 ldrh r1, [r0] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg @0817B4FA: ldr r0, =0x03005e00 lsls r1, r5, 2 @@ -703636,11 +703637,11 @@ sub_817B458: ; 817B458 strh r1, [r2, 0x1A] ldrh r1, [r2, 0x18] movs r0, 0x1C - bl lcd_io_set + bl SetGpuReg ldr r0, =0x0203bd24 ldrh r1, [r0] movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg @0817B532: pop {r4,r5} pop {r0} @@ -723203,7 +723204,7 @@ sub_8185054: ; 8185054 movs r3, 0x10 bl pal_fade_maybe ldr r0, =sub_80384E4 - bl set_callback2 + bl SetMainCallback2 movs r0, 0xFF b @081850C6 .pool @@ -723454,12 +723455,12 @@ sub_8185290: ; 8185290 push {r4,r5,lr} movs r0, 0xF8 lsls r0, 4 - bl malloc_and_clear + bl AllocZeroed adds r4, r0, 0 bl start_ov_to_battle_anim adds r5, r0, 0 adds r0, r4, 0 - bl free + bl Free adds r0, r5, 0 pop {r4,r5} pop {r1} @@ -723547,11 +723548,11 @@ sub_8185338: ; 8185338 str r0, [sp, 0x4] movs r0, 0xF8 lsls r0, 4 - bl malloc_and_clear + bl AllocZeroed adds r7, r0, 0 movs r0, 0x80 lsls r0, 5 - bl malloc_and_clear + bl AllocZeroed str r0, [sp] movs r6, 0 @0818535E: @@ -724310,9 +724311,9 @@ sub_8185338: ; 8185338 bls @081859F8 @08185A14: adds r0, r7, 0 - bl free + bl Free ldr r0, [sp] - bl free + bl Free adds r0, r4, 0 add sp, 0xC pop {r3-r5} @@ -724359,14 +724360,14 @@ start_ov_to_battle_anim: ; 8185A88 adds r4, r0, 0 movs r0, 0x80 lsls r0, 5 - bl malloc_and_clear + bl AllocZeroed adds r5, r0, 0 adds r0, r4, 0 adds r1, r5, 0 bl sub_8185A54 adds r4, r0, 0 adds r0, r5, 0 - bl free + bl Free adds r0, r4, 0 pop {r4,r5} pop {r1} @@ -724405,7 +724406,7 @@ sub_8185AB0: ; 8185AB0 bl sub_8185EFC ldr r0, =0x0203c7b0 ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -724431,7 +724432,7 @@ sub_8185B1C: ; 8185B1C ldr r1, =sub_8185AB0 str r1, [r0, 0x8] ldr r0, =sub_8036760 - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task @08185B4A: @@ -724736,7 +724737,7 @@ sub_8185E24: ; 8185E24 adds r5, r0, 0 movs r0, 0xF8 lsls r0, 4 - bl malloc_and_clear + bl AllocZeroed adds r4, r0, 0 bl start_ov_to_battle_anim cmp r0, 0x1 @@ -724761,10 +724762,10 @@ sub_8185E24: ; 8185E24 movs r0, 0 bl current_map_music_set__default_for_battle ldr r0, =sub_8185E8C - bl set_callback2 + bl SetMainCallback2 @08185E6E: adds r0, r4, 0 - bl free + bl Free pop {r4,r5} pop {r0} bx r0 @@ -738036,17 +738037,17 @@ oamt_spawn_poke_or_trainer_picture: ; 818D1EC beq @0818D280 movs r0, 0x80 lsls r0, 6 - bl malloc + bl Alloc adds r7, r0, 0 cmp r7, 0 beq @0818D280 movs r0, 0x20 - bl malloc + bl Alloc mov r8, r0 cmp r0, 0 bne @0818D28C adds r0, r7, 0 - bl free + bl Free @0818D280: ldr r0, =0x0000ffff b @0818D356 @@ -738268,7 +738269,7 @@ sub_818D3E4: ; 818D3E4 beq @0818D47C movs r0, 0x80 lsls r0, 6 - bl malloc + bl Alloc adds r7, r0, 0 cmp r7, 0 beq @0818D47C @@ -738286,12 +738287,12 @@ sub_818D3E4: ; 818D3E4 mov r9, r6 @0818D46A: movs r0, 0x20 - bl malloc + bl Alloc mov r8, r0 cmp r0, 0 bne @0818D484 adds r0, r7, 0 - bl free + bl Free @0818D47C: ldr r0, =0x0000ffff b @0818D588 @@ -738497,9 +738498,9 @@ sub_818D5B0: ; 818D5B0 adds r0, r1 bl obj_delete_and_free_tiles mov r0, r8 - bl free + bl Free adds r0, r7, 0 - bl free + bl Free adds r1, r5, 0 ldr r0, =gUnknown_0860B058 ldm r0!, {r2-r4} @@ -738607,7 +738608,7 @@ sub_818D6CC: ; 818D6CC lsrs r6, 24 movs r0, 0x80 lsls r0, 6 - bl malloc + bl Alloc adds r4, r0, 0 cmp r4, 0 beq @0818D762 @@ -738633,7 +738634,7 @@ sub_818D6CC: ; 818D6CC adds r1, r4, 0 movs r2, 0 movs r3, 0 - bl BlitSurfaceRectToWindow + bl BlitBitmapRectToWindow str r6, [sp] mov r0, r9 ldr r1, [sp, 0x18] @@ -738641,7 +738642,7 @@ sub_818D6CC: ; 818D6CC ldr r3, [sp, 0x20] bl sub_818D180 adds r0, r4, 0 - bl free + bl Free movs r0, 0 b @0818D764 @0818D762: @@ -741546,10 +741547,10 @@ sub_818F02C: ; 818F02C str r0, [sp, 0xC] str r0, [sp, 0x10] movs r0, 0x20 - bl malloc_and_clear + bl AllocZeroed str r0, [sp, 0x18] movs r0, 0x18 - bl malloc_and_clear + bl AllocZeroed str r0, [sp, 0x1C] ldr r4, =0x03005d90 ldr r1, [r4] @@ -742341,9 +742342,9 @@ sub_818F02C: ; 818F02C ble @0818F6CC @0818F6EE: ldr r0, [sp, 0x18] - bl free + bl Free ldr r0, [sp, 0x1C] - bl free + bl Free add sp, 0x3C pop {r3-r5} mov r8, r3 @@ -743972,7 +743973,7 @@ sub_81903B8: ; 81903B8 strh r5, [r4, 0xC] strh r5, [r4, 0xE] ldr r0, =sub_8194B54 - bl set_callback2 + bl SetMainCallback2 pop {r4,r5} pop {r0} bx r0 @@ -744028,7 +744029,7 @@ sub_8190400: ; 8190400 movs r0, 0 bl SetVBlankCallback movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts str r4, [sp, 0x4] movs r1, 0xC0 lsls r1, 19 @@ -744036,11 +744037,11 @@ sub_8190400: ; 8190400 add r0, sp, 0x4 bl CpuSet movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0860CE84 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_0860CEB4 bl InitWindows bl DeactivateAllTextPrinters @@ -744086,34 +744087,34 @@ sub_8190400: ; 8190400 @08190508: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x42 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg bl sub_80A1A74 bl reset_all_obj_data bl gpu_pal_allocator_reset @@ -744177,13 +744178,13 @@ sub_8190400: ; 8190400 ldr r2, =0x05000100 bl CpuSet movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg @08190602: ldrh r0, [r6, 0x8] adds r0, 0x1 @@ -744195,7 +744196,7 @@ sub_8190400: ; 8190400 bl SetVBlankCallback ldr r4, =0x0203cd78 movs r0, 0x14 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r6, 0 lsls r5, 24 @@ -744246,7 +744247,7 @@ sub_8190400: ; 8190400 movs r1, 0xFA lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg mov r0, r9 cmp r0, 0 beq @0819076C @@ -747357,7 +747358,7 @@ sub_8190CD4: ; 8190CD4 bl sub_80D2F9C ldr r4, =0x0203cd78 ldr r0, [r4] - bl free + bl Free movs r5, 0 str r5, [r4] bl FreeAllWindowBuffers @@ -747365,7 +747366,7 @@ sub_8190CD4: ; 8190CD4 cmp r0, 0 bne @081921C4 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 b @081921FC .pool @081921C4: @@ -747777,7 +747778,7 @@ sub_81924E0: ; 81924E0 str r2, [sp, 0x30] movs r4, 0 movs r0, 0x24 - bl malloc_and_clear + bl AllocZeroed mov r8, r0 ldr r0, =0x03005d90 ldr r1, [r0] @@ -748966,7 +748967,7 @@ sub_81924E0: ; 81924E0 movs r2, 0 bl AddTextPrinter mov r0, r8 - bl free + bl Free add sp, 0x58 pop {r3-r5} mov r8, r3 @@ -750111,7 +750112,7 @@ sub_81938A4: ; 81938A4 strh r0, [r1, 0xC] strh r2, [r1, 0x10] ldr r0, =sub_8194B54 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -750160,7 +750161,7 @@ sub_81938E0: ; 81938E0 movs r0, 0x1 strh r0, [r1, 0x10] ldr r0, =sub_8194B54 - bl set_callback2 + bl SetMainCallback2 pop {r4} pop {r0} bx r0 @@ -750335,7 +750336,7 @@ sub_819395C: ; 819395C bl remove_some_task ldr r4, =0x0203cd7c ldr r0, [r4] - bl free + bl Free str r6, [r4] ldr r0, =sub_8190400 movs r1, 0 @@ -750380,7 +750381,7 @@ sub_819395C: ; 819395C bl remove_some_task ldr r4, =0x0203cd7c ldr r0, [r4] - bl free + bl Free str r6, [r4] ldr r0, =sub_8190400 movs r1, 0 @@ -750420,10 +750421,10 @@ sub_819395C: ; 819395C bl remove_some_task ldr r4, =0x0203cd7c ldr r0, [r4] - bl free + bl Free str r6, [r4] ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 @@ -750632,7 +750633,7 @@ sub_8193D40: ; 8193D40 strh r0, [r1, 0xC] strh r2, [r1, 0x10] ldr r0, =sub_8194B54 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -751266,7 +751267,7 @@ sub_8194220: ; 8194220 movs r0, 0 bl SetVBlankCallback movs r0, 0x3 - bl enable_irqs + bl EnableInterrupts movs r4, 0 str r4, [sp, 0x14] add r0, sp, 0x14 @@ -751275,11 +751276,11 @@ sub_8194220: ; 8194220 ldr r2, =0x05006000 bl CpuSet movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0860CE74 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_0860CE94 bl InitWindows bl DeactivateAllTextPrinters @@ -751294,20 +751295,20 @@ sub_8194220: ; 8194220 movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r1, 0xB0 lsls r1, 4 movs r0, 0x3 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r1, =0x03005e00 mov r2, r8 lsls r0, r2, 2 @@ -751316,34 +751317,34 @@ sub_8194220: ; 8194220 @0819431C: movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00005860 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0x9F - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00009098 movs r0, 0x42 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 movs r1, 0x9F - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg bl sub_80A1A74 bl reset_all_obj_data bl gpu_pal_allocator_reset @@ -751356,16 +751357,16 @@ sub_8194220: ; 8194220 ldr r4, =0x0203cd7c movs r0, 0x80 lsls r0, 4 - bl malloc_and_clear + bl AllocZeroed adds r1, r0, 0 str r1, [r4] ldr r0, =gUnknown_08D83900 bl call_LZZUnCompWram ldr r1, [r4] movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r1, =gUnknown_08D82F10 movs r5, 0x80 lsls r5, 6 @@ -751415,13 +751416,13 @@ sub_8194220: ; 8194220 ldr r2, =0x05000100 bl CpuSet movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x03005e00 mov r4, r8 lsls r0, r4, 2 @@ -751480,7 +751481,7 @@ sub_8194220: ; 8194220 @081944E8: ldr r1, =0x00007f40 movs r0, 0 - bl lcd_io_set + bl SetGpuReg b @081947A6 .pool @081944FC: @@ -751965,7 +751966,7 @@ sub_81948EC: ; 81948EC str r0, [sp, 0x8] movs r0, 0x1 adds r1, r5, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette adds r4, 0x4 adds r5, 0x4 subs r6, 0x1 @@ -751973,7 +751974,7 @@ sub_81948EC: ; 81948EC bne @0819491A @08194938: movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0xC pop {r4-r7} pop {r0} @@ -752204,7 +752205,7 @@ sub_8194950: ; 8194950 cmp r0, 0 bne @08194B3C ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task @08194B3C: @@ -752236,35 +752237,35 @@ sub_8194B70: ; 8194B70 movs r0, 0x3 movs r1, 0x80 movs r2, 0x1 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0x80 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY ldr r0, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1c ldrh r1, [r0] movs r0, 0x18 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1e ldrh r1, [r0] movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg bl copy_super_sprites_to_oam bl copy_queue_process bl copy_pal_bg_faded_to_pal_ram @@ -752372,27 +752373,27 @@ sub_8194CE4: ; 8194CE4 ldr r0, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg movs r0, 0x2 movs r1, 0x80 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0x80 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY bl copy_super_sprites_to_oam bl copy_queue_process bl copy_pal_bg_faded_to_pal_ram @@ -752680,10 +752681,10 @@ sub_8194F58: ; 8194F58 b @0819533E @08194F8C: movs r0, 0x20 - bl malloc_and_clear + bl AllocZeroed str r0, [sp, 0x18] movs r0, 0x18 - bl malloc_and_clear + bl AllocZeroed str r0, [sp, 0x1C] ldr r1, [r4] ldr r2, =0x00000ca9 @@ -753102,9 +753103,9 @@ sub_8194F58: ; 8194F58 cmp r5, 0xE ble @08195276 ldr r0, [sp, 0x18] - bl free + bl Free ldr r0, [sp, 0x1C] - bl free + bl Free movs r0, 0 mov r10, r0 @08195314: @@ -754851,7 +754852,7 @@ sub_819612C: ; 819612C movs r3, 0x9C lsls r3, 2 movs r0, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles lsls r0, 16 ldr r1, =0xffff0000 cmp r0, r1 @@ -754884,7 +754885,7 @@ sub_819612C: ; 819612C ldr r1, =0xffffe000 movs r0, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 b @081961E6 .pool @@ -754936,7 +754937,7 @@ sub_81961F0: ; 81961F0 movs r0, 0 movs r2, 0x1 movs r3, 0xF - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer ldr r0, =sub_8196694 movs r1, 0xA bl AddTask @@ -754947,7 +754948,7 @@ sub_81961F0: ; 81961F0 movs r1, 0x2 bl CopyWindowToVram movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 b @0819626A .pool @@ -754970,7 +754971,7 @@ sub_8196274: ; 8196274 lsls r1, 3 ldr r0, =0x03005e08 adds r4, r1, r0 - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @08196298 @@ -754997,7 +754998,7 @@ sub_81962B0: ; 81962B0 lsls r1, 3 movs r0, 0 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY cmp r0, 0 bge @081962C6 movs r0, 0 @@ -755006,7 +755007,7 @@ sub_81962B0: ; 81962B0 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 @081962D2: pop {r1} @@ -755114,7 +755115,7 @@ sub_8196390: ; 8196390 lsls r1, 3 movs r0, 0 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY ldr r1, =0xffffe000 cmp r0, r1 ble @081963C0 @@ -755130,13 +755131,13 @@ sub_8196390: ; 8196390 movs r1, 0 movs r2, 0 movs r3, 0xE - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 ldrb r0, [r4, 0xA] bl remove_task ldrb r0, [r4, 0x4] bl RemoveWindow movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 @081963E8: add sp, 0x8 @@ -755148,7 +755149,7 @@ sub_8196390: ; 8196390 thumb_func_start sub_81963F0 sub_81963F0: ; 81963F0 push {lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @08196454 @@ -755159,7 +755160,7 @@ sub_81963F0: ; 81963F0 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r0, =0x0203cd80 ldrb r0, [r0, 0x7] cmp r0, 0 @@ -755230,7 +755231,7 @@ sub_819645C: ; 819645C lsrs r0, 24 mov r9, r0 movs r1, 0xA - bl bg_get_field + bl GetBgAttribute lsls r0, 16 lsrs r0, 16 adds r5, r0 @@ -755258,7 +755259,7 @@ sub_819645C: ; 819645C str r3, [sp, 0x4] mov r0, r9 adds r3, r4, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 adds r1, r5, 0x1 orrs r1, r7 lsls r1, 16 @@ -755276,7 +755277,7 @@ sub_819645C: ; 819645C mov r0, r9 ldr r2, [sp, 0x14] adds r3, r4, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 adds r1, r5, 0x2 orrs r1, r7 lsls r1, 16 @@ -755292,7 +755293,7 @@ sub_819645C: ; 819645C mov r0, r9 ldr r2, [sp, 0x1C] adds r3, r4, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 adds r1, r5, 0x3 orrs r1, r7 lsls r1, 16 @@ -755309,7 +755310,7 @@ sub_819645C: ; 819645C mov r0, r9 mov r2, r10 adds r3, r6, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 adds r1, r5, 0x4 orrs r1, r7 lsls r1, 16 @@ -755320,7 +755321,7 @@ sub_819645C: ; 819645C mov r0, r9 ldr r2, [sp, 0x1C] adds r3, r6, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 adds r1, r5, 0x5 orrs r1, r7 lsls r1, 16 @@ -755336,7 +755337,7 @@ sub_819645C: ; 819645C mov r0, r9 mov r2, r10 adds r3, r4, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 adds r1, r5, 0x6 orrs r1, r7 lsls r1, 16 @@ -755348,7 +755349,7 @@ sub_819645C: ; 819645C mov r0, r9 ldr r2, [sp, 0x14] adds r3, r4, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 adds r5, 0x7 orrs r5, r7 lsls r5, 16 @@ -755360,7 +755361,7 @@ sub_819645C: ; 819645C adds r1, r5, 0 ldr r2, [sp, 0x1C] adds r3, r4, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 add sp, 0x20 pop {r3-r5} mov r8, r3 @@ -755514,9 +755515,9 @@ sub_8196694: ; 8196694 movs r0, 0 movs r2, 0x1 movs r3, 0xF - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @081966FC: add sp, 0x10 pop {r0} @@ -756796,7 +756797,7 @@ sub_8197080: ; 8197080 mov r8, r0 movs r0, 0xFA lsls r0, 2 - bl malloc + bl Alloc adds r7, r0, 0 cmp r7, 0 bne @081970A2 @@ -756882,7 +756883,7 @@ sub_8197080: ; 8197080 bl ExpandStringRefs @08197156: adds r0, r7, 0 - bl free + bl Free @0819715C: pop {r3-r5} mov r8, r3 @@ -756911,7 +756912,7 @@ sub_8197184: ; 8197184 lsls r4, 16 lsrs r4, 16 adds r3, r4, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r0, =gUnknown_0860EA4C lsls r5, 20 lsrs r5, 16 @@ -756961,11 +756962,11 @@ sub_8197200: ; 8197200 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY bl DeactivateAllTextPrinters bl sub_81973A4 pop {r0} @@ -757338,7 +757339,7 @@ sub_81974A4: ; 81974A4 adds r0, r7, 0 adds r1, r3, 0 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000215 ldr r2, [sp, 0x10] str r2, [sp] @@ -757347,7 +757348,7 @@ sub_81974A4: ; 81974A4 adds r0, r7, 0 ldr r2, [sp, 0xC] adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000216 ldr r3, [sp, 0xC] ldr r2, [sp, 0x10] @@ -757360,7 +757361,7 @@ sub_81974A4: ; 81974A4 str r6, [sp, 0x8] adds r0, r7, 0 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r5, r9 ldr r0, [sp, 0x14] add r0, r9 @@ -757383,7 +757384,7 @@ sub_81974A4: ; 81974A4 ldr r3, [sp, 0x18] lsrs r2, r3, 24 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r6, [sp] str r6, [sp, 0x4] mov r0, r8 @@ -757393,7 +757394,7 @@ sub_81974A4: ; 81974A4 mov r3, r10 lsrs r2, r3, 24 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect adds r5, 0x1 ldr r0, [sp, 0x14] add r0, r9 @@ -757416,7 +757417,7 @@ sub_81974A4: ; 81974A4 str r6, [sp, 0x8] adds r0, r7, 0 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x0000021b ldr r0, [sp, 0x10] str r0, [sp] @@ -757425,7 +757426,7 @@ sub_81974A4: ; 81974A4 adds r0, r7, 0 ldr r2, [sp, 0xC] adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r1, 0x87 lsls r1, 2 ldr r3, [sp, 0xC] @@ -757438,7 +757439,7 @@ sub_81974A4: ; 81974A4 str r6, [sp, 0x8] adds r0, r7, 0 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0x1C pop {r3-r5} mov r8, r3 @@ -757496,7 +757497,7 @@ sub_81975F4: ; 81975F4 adds r0, r6, 0 ldr r2, [sp, 0x14] adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000203 ldr r0, [sp, 0xC] subs r0, 0x1 @@ -757509,7 +757510,7 @@ sub_81975F4: ; 81975F4 str r0, [sp, 0x8] adds r0, r6, 0 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r1, 0x81 lsls r1, 2 mov r0, r8 @@ -757524,7 +757525,7 @@ sub_81975F4: ; 81975F4 adds r0, r6, 0 ldr r2, [sp, 0xC] adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000205 ldr r7, [sp, 0xC] add r7, r8 @@ -757538,7 +757539,7 @@ sub_81975F4: ; 81975F4 str r3, [sp, 0x8] adds r0, r6, 0 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000206 lsls r2, r7, 24 lsrs r7, r2, 24 @@ -757549,7 +757550,7 @@ sub_81975F4: ; 81975F4 adds r0, r6, 0 adds r2, r7, 0 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000207 str r4, [sp] movs r5, 0x5 @@ -757559,7 +757560,7 @@ sub_81975F4: ; 81975F4 adds r0, r6, 0 ldr r2, [sp, 0x14] mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000209 add r8, r4 mov r3, r8 @@ -757572,7 +757573,7 @@ sub_81975F4: ; 81975F4 adds r0, r6, 0 ldr r2, [sp, 0x18] mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x0000020a str r4, [sp] str r5, [sp, 0x4] @@ -757581,7 +757582,7 @@ sub_81975F4: ; 81975F4 adds r0, r6, 0 adds r2, r7, 0 mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000a01 ldr r3, [sp, 0x10] add r10, r3 @@ -757596,7 +757597,7 @@ sub_81975F4: ; 81975F4 adds r0, r6, 0 ldr r2, [sp, 0x14] mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000a03 str r4, [sp] str r4, [sp, 0x4] @@ -757605,7 +757606,7 @@ sub_81975F4: ; 81975F4 adds r0, r6, 0 ldr r2, [sp, 0x18] mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000a04 ldr r0, [sp, 0x1C] str r0, [sp] @@ -757615,7 +757616,7 @@ sub_81975F4: ; 81975F4 adds r0, r6, 0 ldr r2, [sp, 0xC] mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000a05 str r4, [sp] str r4, [sp, 0x4] @@ -757624,7 +757625,7 @@ sub_81975F4: ; 81975F4 adds r0, r6, 0 ldr r2, [sp, 0x20] mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000a06 str r4, [sp] str r4, [sp, 0x4] @@ -757633,7 +757634,7 @@ sub_81975F4: ; 81975F4 adds r0, r6, 0 adds r2, r7, 0 mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0x24 pop {r3-r5} mov r8, r3 @@ -757677,7 +757678,7 @@ sub_81977BC: ; 81977BC movs r1, 0 adds r2, r4, 0 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0xC pop {r4,r5} pop {r0} @@ -757720,7 +757721,7 @@ sub_8197804: ; 8197804 movs r1, 0 adds r2, r4, 0 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0xC pop {r4,r5} pop {r0} @@ -758112,11 +758113,11 @@ sub_8197AE8: ; 8197AE8 movs r1, 0 movs r2, 0 movs r3, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect cmp r4, 0x1 bne @08197B12 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @08197B12: add sp, 0xC pop {r4} @@ -758241,7 +758242,7 @@ sub_8197BB4: ; 8197BB4 mov r0, r8 ldr r2, [sp, 0x14] adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, =0x0203cd9c ldrh r1, [r0] adds r1, 0x3 @@ -758260,7 +758261,7 @@ sub_8197BB4: ; 8197BB4 mov r0, r8 ldr r2, [sp, 0x18] adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r3, =0x0203cd9c ldrh r1, [r3] adds r1, 0x4 @@ -758278,7 +758279,7 @@ sub_8197BB4: ; 8197BB4 mov r0, r8 ldr r2, [sp, 0xC] adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r3, =0x0203cd9c ldrh r1, [r3] adds r1, 0x5 @@ -758298,7 +758299,7 @@ sub_8197BB4: ; 8197BB4 mov r0, r8 ldr r2, [sp, 0x20] adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r3, =0x0203cd9c ldrh r1, [r3] adds r1, 0x6 @@ -758314,7 +758315,7 @@ sub_8197BB4: ; 8197BB4 mov r0, r8 adds r2, r7, 0 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r3, =0x0203cd9c ldrh r1, [r3] adds r1, 0x7 @@ -758329,7 +758330,7 @@ sub_8197BB4: ; 8197BB4 mov r0, r8 ldr r2, [sp, 0x14] mov r3, r9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r3, =0x0203cd9c ldrh r1, [r3] adds r1, 0x9 @@ -758346,7 +758347,7 @@ sub_8197BB4: ; 8197BB4 mov r0, r8 ldr r2, [sp, 0x18] mov r3, r9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r3, =0x0203cd9c ldrh r1, [r3] adds r1, 0xA @@ -758360,7 +758361,7 @@ sub_8197BB4: ; 8197BB4 mov r0, r8 adds r2, r7, 0 mov r3, r9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r3, =0x00000801 adds r1, r3, 0 ldr r0, =0x0203cd9c @@ -758381,7 +758382,7 @@ sub_8197BB4: ; 8197BB4 str r0, [sp, 0x8] mov r0, r8 ldr r2, [sp, 0x14] - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r3, =0x00000803 adds r1, r3, 0 ldr r0, =0x0203cd9c @@ -758397,7 +758398,7 @@ sub_8197BB4: ; 8197BB4 mov r0, r8 ldr r2, [sp, 0x18] mov r3, r9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r3, =0x00000804 adds r1, r3, 0 ldr r0, =0x0203cd9c @@ -758414,7 +758415,7 @@ sub_8197BB4: ; 8197BB4 mov r0, r8 ldr r2, [sp, 0xC] mov r3, r9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, =0x00000805 adds r1, r0, 0 ldr r2, =0x0203cd9c @@ -758430,7 +758431,7 @@ sub_8197BB4: ; 8197BB4 mov r0, r8 ldr r2, [sp, 0x20] mov r3, r9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, =0x00000806 adds r1, r0, 0 ldr r2, =0x0203cd9c @@ -758446,7 +758447,7 @@ sub_8197BB4: ; 8197BB4 mov r0, r8 adds r2, r7, 0 mov r3, r9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0x24 pop {r3-r5} mov r8, r3 @@ -758521,7 +758522,7 @@ sub_8197E30: ; 8197E30 str r1, [sp, 0x8] adds r2, r4, 0 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0xC pop {r4,r5} pop {r0} @@ -758641,7 +758642,7 @@ DrawWindowBorder: ; 8197F18 mov r0, r9 adds r2, r6, 0 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r2, =0x0203cd9c ldrh r1, [r2] adds r1, 0x1 @@ -758655,7 +758656,7 @@ DrawWindowBorder: ; 8197F18 mov r0, r9 ldr r2, [sp, 0xC] adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r2, =0x0203cd9c ldrh r1, [r2] adds r1, 0x2 @@ -758674,7 +758675,7 @@ DrawWindowBorder: ; 8197F18 mov r0, r9 mov r2, r10 adds r3, r4, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, =0x0203cd9c ldrh r1, [r0] adds r1, 0x3 @@ -758688,7 +758689,7 @@ DrawWindowBorder: ; 8197F18 mov r0, r9 adds r2, r6, 0 mov r3, r8 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, =0x0203cd9c ldrh r1, [r0] adds r1, 0x5 @@ -758702,7 +758703,7 @@ DrawWindowBorder: ; 8197F18 mov r0, r9 mov r2, r10 mov r3, r8 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, =0x0203cd9c ldrh r1, [r0] adds r1, 0x6 @@ -758721,7 +758722,7 @@ DrawWindowBorder: ; 8197F18 mov r0, r9 adds r2, r6, 0 mov r3, r8 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r2, =0x0203cd9c ldrh r1, [r2] adds r1, 0x7 @@ -758735,7 +758736,7 @@ DrawWindowBorder: ; 8197F18 mov r0, r9 ldr r2, [sp, 0xC] mov r3, r8 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r2, =0x0203cd9c ldrh r1, [r2] adds r1, 0x8 @@ -758748,7 +758749,7 @@ DrawWindowBorder: ; 8197F18 mov r0, r9 mov r2, r10 mov r3, r8 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0x18 pop {r3-r5} mov r8, r3 @@ -758819,7 +758820,7 @@ sub_81980A8: ; 81980A8 str r1, [sp, 0x8] adds r2, r4, 0 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0xC pop {r4,r5} pop {r0} @@ -762105,7 +762106,7 @@ do_scheduled_bg_tilemap_copies_to_vram: ; 81999D0 cmp r0, 0x1 bne @081999E4 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 strb r0, [r4] @081999E4: @@ -762113,7 +762114,7 @@ do_scheduled_bg_tilemap_copies_to_vram: ; 81999D0 cmp r0, 0x1 bne @081999F4 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 strb r0, [r4, 0x1] @081999F4: @@ -762121,7 +762122,7 @@ do_scheduled_bg_tilemap_copies_to_vram: ; 81999D0 cmp r0, 0x1 bne @08199A04 movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 strb r0, [r4, 0x2] @08199A04: @@ -762129,7 +762130,7 @@ do_scheduled_bg_tilemap_copies_to_vram: ; 81999D0 cmp r0, 0x1 bne @08199A14 movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 strb r0, [r4, 0x3] @08199A14: @@ -762163,7 +762164,7 @@ reset_temp_tile_data_buffers: ; 8199A20 thumb_func_start free_temp_tile_data_buffers_if_possible free_temp_tile_data_buffers_if_possible: ; 8199A44 push {r4-r6,lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @08199A88 @@ -762179,7 +762180,7 @@ free_temp_tile_data_buffers_if_possible: ; 8199A44 movs r6, 0 @08199A64: ldr r0, [r5] - bl free + bl Free stm r5!, {r6} adds r4, 0x1 ldr r0, =0x0203cda8 @@ -762348,7 +762349,7 @@ task_free_buf_after_copying_tile_data_to_vram: ; 8199B84 adds r0, r4, 0 movs r1, 0x1 bl get_word_task_arg - bl free + bl Free adds r0, r4, 0 bl remove_task @08199BB4: @@ -762372,7 +762373,7 @@ malloc_and_decompress: ; 8199BC0 movs r0, 0 strb r0, [r1, 0x3] ldr r0, [r1] - bl malloc + bl Alloc adds r4, r0, 0 cmp r4, 0 beq @08199BE8 @@ -762409,11 +762410,11 @@ copy_decompressed_tile_data_to_vram: ; 8199BF0 .pool @08199C18: adds r1, r4, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @08199C26 @08199C20: adds r1, r4, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap @08199C26: lsls r0, 16 lsrs r0, 16 @@ -762449,7 +762450,7 @@ sub_8199C30: ; 8199C30 lsls r2, 24 lsrs r2, 24 mov r10, r2 - bl bg_get_tilemap + bl GetBgTileMap mov r8, r0 adds r0, r5, r4 cmp r5, r0 @@ -762523,7 +762524,7 @@ sub_8199CBC: ; 8199CBC lsls r4, 24 lsrs r4, 24 mov r8, r4 - bl bg_get_tilemap + bl GetBgTileMap adds r7, r0, 0 movs r0, 0 cmp r0, r8 @@ -762627,35 +762628,35 @@ sub_8199D98: ; 8199D98 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY pop {r0} bx r0 thumb_func_end sub_8199D98 @@ -762674,7 +762675,7 @@ sub_8199DF0: ; 8199DF0 lsrs r5, r0, 24 adds r0, r5, 0 movs r1, 0x4 - bl bg_get_field + bl GetBgAttribute lsls r0, 16 movs r7, 0x40 cmp r0, 0 @@ -762683,11 +762684,11 @@ sub_8199DF0: ; 8199DF0 @08199E16: adds r0, r5, 0 movs r1, 0x1 - bl bg_get_field + bl GetBgAttribute adds r4, r0, 0 adds r0, r5, 0 movs r1, 0xA - bl bg_get_field + bl GetBgAttribute lsls r4, 16 lsrs r4, 2 lsls r0, 16 @@ -763287,7 +763288,7 @@ sub_819A27C: ; 819A27C adds r0, r6, 0 adds r2, r4, 0 adds r3, r5, 0 - bl BlitSurfaceToWindow + bl BlitBitmapToWindow add sp, 0x8 pop {r4-r6} pop {r0} @@ -763356,7 +763357,7 @@ sub_819A2F8: ; 819A2F8 adds r1, r5, 0 movs r2, 0 movs r3, 0 - bl BlitSurfaceRectToWindow + bl BlitBitmapRectToWindow add sp, 0x18 pop {r4,r5} pop {r0} @@ -763581,7 +763582,7 @@ sub_819A4F8: ; 819A4F8 movs r1, 0 str r1, [r0] ldr r0, =sub_819A514 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -763624,7 +763625,7 @@ sub_819A514: ; 819A514 ldr r0, [r4] cmp r0, 0 beq @0819A578 - bl free + bl Free movs r0, 0 str r0, [r4] @0819A578: @@ -763640,11 +763641,11 @@ sub_819A514: ; 819A514 add r0, sp, 0x8 bl CpuSet movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_08610428 movs r0, 0 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_08610434 bl InitWindows bl DeactivateAllTextPrinters @@ -763655,76 +763656,76 @@ sub_819A514: ; 819A514 movs r4, 0x88 lsls r4, 3 adds r0, r4, 0 - bl malloc + bl Alloc str r0, [r5] ldr r5, =0x0203ce30 adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] ldr r5, =0x0203ce34 movs r4, 0x80 lsls r4, 4 adds r0, r4, 0 - bl malloc + bl Alloc str r0, [r5] ldr r5, =0x0203ce38 adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x42 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 @@ -763752,12 +763753,12 @@ sub_819A514: ; 819A514 lsls r2, 3 movs r0, 0x1 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, [r4] movs r0, 0x3 movs r2, 0x60 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r0, =gUnknown_08DC0B94 ldr r4, =0x0203ce34 ldr r1, [r4] @@ -763769,7 +763770,7 @@ sub_819A514: ; 819A514 lsls r2, 4 movs r0, 0x1 movs r3, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap ldr r0, =gUnknown_08DC0714 movs r1, 0 movs r2, 0x40 @@ -763812,7 +763813,7 @@ sub_819A514: ; 819A514 ldr r0, =0x0203ce38 ldr r1, [r0] movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap ldr r5, =gUnknown_0861023C movs r4, 0x8 str r4, [sp] @@ -763821,23 +763822,23 @@ sub_819A514: ; 819A514 adds r1, r5, 0 movs r2, 0xB movs r3, 0x4 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] movs r0, 0x3 adds r1, r5, 0 movs r2, 0x2 movs r3, 0x4 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] movs r0, 0x3 adds r1, r5, 0 movs r2, 0x14 movs r3, 0x4 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0819A8E6 .pool @0819A7CC: @@ -763848,9 +763849,9 @@ sub_819A514: ; 819A514 ldr r0, =gUnknown_086103E4 bl gpu_tile_obj_decompress_and_load movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =sub_819A4E4 bl SetVBlankCallback movs r0, 0x1 @@ -763863,7 +763864,7 @@ sub_819A514: ; 819A514 movs r1, 0x9A lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x0300127c ldr r0, [r0] ldrb r0, [r0, 0x6] @@ -763875,18 +763876,18 @@ sub_819A514: ; 819A514 movs r3, 0x60 bl sub_819C5D0 movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x00001248 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000040b movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @0819A85A .pool @0819A854: movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg @0819A85A: ldr r1, =0x030022c0 movs r3, 0x87 @@ -764020,7 +764021,7 @@ sub_819A514: ; 819A514 strh r1, [r0, 0x8] @0819A988: ldr r0, =sub_819A4C8 - bl set_callback2 + bl SetMainCallback2 @0819A98E: add sp, 0xC pop {r4,r5} @@ -764038,7 +764039,7 @@ sub_819A9AC: ; 819A9AC bne @0819AA12 movs r0, 0xAB lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] strb r4, [r0, 0x3] ldr r1, [r5] @@ -764659,19 +764660,19 @@ sub_819AE08: ; 819AE08 bl sub_819AB40 ldr r4, =0x0203ce2c ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ce30 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ce34 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ce38 ldr r0, [r4] - bl free + bl Free str r5, [r4] bl FreeAllWindowBuffers movs r0, 0x8 @@ -764699,7 +764700,7 @@ sub_819AE08: ; 819AE08 ldr r4, =0x0203ce3c movs r0, 0x96 lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r4, 0 @0819AF1A: @@ -764790,22 +764791,22 @@ bc_exit_to_overworld: ; 819AF68 bl sub_819AB40 ldr r4, =0x0203ce2c ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ce34 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ce38 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r0, [r7] - bl free + bl Free str r5, [r7] bl FreeAllWindowBuffers ldr r0, =sub_80861B0 - bl set_callback2 + bl SetMainCallback2 adds r0, r6, 0 bl remove_task @0819B00E: @@ -766934,7 +766935,7 @@ sub_819C1D0: ; 819C1D0 movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldrh r1, [r4, 0xE] lsls r1, 8 ldrh r0, [r4, 0x38] @@ -766942,7 +766943,7 @@ sub_819C1D0: ; 819C1D0 lsls r1, 16 lsrs r1, 16 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x12] lsls r1, 8 ldrh r0, [r4, 0x18] @@ -766950,23 +766951,23 @@ sub_819C1D0: ; 819C1D0 lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x37 - bl lcd_io_set + bl SetGpuReg b @0819C2C6 @0819C24E: movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x00001248 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000040b movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @0819C2C6 .pool @0819C270: @@ -766992,7 +766993,7 @@ sub_819C1D0: ; 819C1D0 movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits @0819C29E: ldrh r1, [r4, 0x12] lsls r1, 8 @@ -767001,7 +767002,7 @@ sub_819C1D0: ; 819C1D0 lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r1, 0x12 ldrsh r0, [r4, r1] cmp r0, 0x20 @@ -767047,7 +767048,7 @@ sub_819C2D4: ; 819C2D4 b @0819C460 @0819C2FC: movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg ldr r4, =0x02020630 ldr r0, =0x0300127c mov r8, r0 @@ -767157,7 +767158,7 @@ sub_819C2D4: ; 819C2D4 movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits adds r0, r7, 0 bl remove_task b @0819C4A4 @@ -767174,7 +767175,7 @@ sub_819C2D4: ; 819C2D4 movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldrh r1, [r4, 0xE] lsls r1, 8 ldrh r0, [r4, 0x38] @@ -767182,7 +767183,7 @@ sub_819C2D4: ; 819C2D4 lsls r1, 16 lsrs r1, 16 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x12] lsls r1, 8 ldrh r0, [r4, 0x18] @@ -767190,13 +767191,13 @@ sub_819C2D4: ; 819C2D4 lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x37 - bl lcd_io_set + bl SetGpuReg b @0819C49E @0819C460: ldrh r0, [r4, 0x12] @@ -767226,7 +767227,7 @@ sub_819C2D4: ; 819C2D4 lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r1, 0x12 ldrsh r0, [r4, r1] cmp r0, 0x40 @@ -767388,26 +767389,26 @@ sub_819C5D0: ; 819C5D0 movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits lsls r4, 24 lsrs r4, 16 orrs r4, r6 movs r0, 0x40 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg lsls r5, 24 lsrs r5, 16 mov r0, r8 orrs r5, r0 movs r0, 0x44 adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x37 - bl lcd_io_set + bl SetGpuReg pop {r3} mov r8, r3 pop {r4-r6} @@ -767817,19 +767818,19 @@ sub_819C90C: ; 819C90C bl sub_819E538 ldr r4, =0x0203ce40 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ce44 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ce48 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ce4c ldr r0, [r4] - bl free + bl Free str r5, [r4] bl FreeAllWindowBuffers movs r0, 0x8 @@ -767956,26 +767957,26 @@ sub_819CA08: ; 819CA08 bl sub_819E538 ldr r4, =0x0203ce40 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ce44 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ce48 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203ce4c ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r0, [r7] - bl free + bl Free str r5, [r7] bl FreeAllWindowBuffers ldr r0, =sub_80861B0 - bl set_callback2 + bl SetMainCallback2 adds r0, r6, 0 bl remove_task @0819CAFE: @@ -770015,7 +770016,7 @@ sub_819DBD8: ; 819DBD8 cmp r4, 0 bne @0819DBF6 movs r0, 0x34 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] strb r4, [r0, 0x3] ldr r0, [r5] @@ -770037,7 +770038,7 @@ sub_819DC00: ; 819DC00 movs r1, 0 str r1, [r0] ldr r0, =sub_819DC1C - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -770094,11 +770095,11 @@ sub_819DC1C: ; 819DC1C add r0, sp, 0x8 bl CpuSet movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_086108B8 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_086108C8 bl InitWindows bl DeactivateAllTextPrinters @@ -770113,78 +770114,78 @@ sub_819DC1C: ; 819DC1C movs r4, 0x88 lsls r4, 3 adds r0, r4, 0 - bl malloc + bl Alloc str r0, [r5] ldr r5, =0x0203ce44 adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] ldr r5, =0x0203ce48 movs r4, 0x80 lsls r4, 4 adds r0, r4, 0 - bl malloc + bl Alloc str r0, [r5] ldr r5, =0x0203ce4c adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed str r0, [r5] movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4C movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x42 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg b @0819E006 .pool @0819DDA8: @@ -770209,12 +770210,12 @@ sub_819DC1C: ; 819DC1C lsls r2, 3 movs r0, 0x1 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r1, [r4] movs r0, 0x3 movs r2, 0x60 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r0, =gUnknown_08DC0B94 ldr r4, =0x0203ce48 ldr r1, [r4] @@ -770226,7 +770227,7 @@ sub_819DC1C: ; 819DC1C lsls r2, 4 movs r0, 0x1 movs r3, 0 - bl gpu_copy_bg_tile_map_to_vram + bl LoadBgTileMap ldr r0, =gUnknown_08DC0714 movs r1, 0 movs r2, 0x40 @@ -770254,7 +770255,7 @@ sub_819DC1C: ; 819DC1C ldr r0, =0x0203ce4c ldr r1, [r0] movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, =gUnknown_0861023C movs r0, 0x8 str r0, [sp] @@ -770262,9 +770263,9 @@ sub_819DC1C: ; 819DC1C movs r0, 0x3 movs r2, 0xB movs r3, 0x4 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @0819E006 .pool @0819DE94: @@ -770383,31 +770384,31 @@ sub_819DC1C: ; 819DC1C movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =0x03001284 ldr r0, [r0] ldrb r0, [r0, 0x15] cmp r0, 0x1 bne @0819E000 movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x00001248 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000040b movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @0819E006 .pool @0819E000: movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg @0819E006: ldr r1, =0x030022c0 movs r2, 0x87 @@ -770480,7 +770481,7 @@ sub_819DC1C: ; 819DC1C strh r1, [r0, 0x8] @0819E0A4: ldr r0, =sub_819C7E0 - bl set_callback2 + bl SetMainCallback2 @0819E0AA: add sp, 0xC pop {r4-r6} @@ -773188,7 +773189,7 @@ sub_819F69C: ; 819F69C movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldrh r1, [r4, 0xE] lsls r1, 8 ldrh r0, [r4, 0x38] @@ -773196,7 +773197,7 @@ sub_819F69C: ; 819F69C lsls r1, 16 lsrs r1, 16 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x12] lsls r1, 8 ldrh r0, [r4, 0x18] @@ -773204,23 +773205,23 @@ sub_819F69C: ; 819F69C lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x37 - bl lcd_io_set + bl SetGpuReg b @0819F7A6 @0819F71A: movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldr r1, =0x00001248 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000040b movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg b @0819F7A6 .pool @0819F73C: @@ -773251,7 +773252,7 @@ sub_819F69C: ; 819F69C lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r2, 0x12 ldrsh r0, [r4, r2] cmp r0, 0x20 @@ -773302,7 +773303,7 @@ sub_819F7B4: ; 819F7B4 cmp r0, 0x1 beq @0819F894 movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg ldr r3, =0x02020630 movs r0, 0x14 ldrsh r1, [r4, r0] @@ -773345,7 +773346,7 @@ sub_819F7B4: ; 819F7B4 movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits adds r0, r5, 0 bl remove_task b @0819F8D8 @@ -773362,7 +773363,7 @@ sub_819F7B4: ; 819F7B4 movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits ldrh r1, [r4, 0xE] lsls r1, 8 ldrh r0, [r4, 0x38] @@ -773370,7 +773371,7 @@ sub_819F7B4: ; 819F7B4 lsls r1, 16 lsrs r1, 16 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x12] lsls r1, 8 ldrh r0, [r4, 0x18] @@ -773378,13 +773379,13 @@ sub_819F7B4: ; 819F7B4 lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x37 - bl lcd_io_set + bl SetGpuReg b @0819F8D2 @0819F894: ldrh r0, [r4, 0x12] @@ -773414,7 +773415,7 @@ sub_819F7B4: ; 819F7B4 lsls r1, 16 lsrs r1, 16 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg movs r1, 0x12 ldrsh r0, [r4, r1] cmp r0, 0x40 @@ -774098,7 +774099,7 @@ sub_819FD64: ; 819FD64 bls @0819FDE6 ldr r4, =0x030062ec movs r0, 0x30 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r1, 0 strb r1, [r0] @@ -774268,7 +774269,7 @@ sub_819FD64: ; 819FD64 @0819FF6E: ldr r4, =0x030062ec ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] add sp, 0x20 @@ -776115,7 +776116,7 @@ sub_81A0DD4: ; 81A0DD4 @081A0E14: mov r4, r9 movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed adds r7, r0, 0 str r7, [r4] ldr r0, =0x020375e2 @@ -776343,7 +776344,7 @@ sub_81A0FE4: ; 81A0FE4 push {r4,lr} ldr r4, =0x030062f0 ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] pop {r4} @@ -777671,7 +777672,7 @@ sub_81A1AD4: ; 81A1AD4 thumb_func_start sub_81A1B1C sub_81A1B1C: ; 81A1B1C push {lr} - bl do_reset + bl Reset pop {r0} bx r0 thumb_func_end sub_81A1B1C @@ -782779,7 +782780,7 @@ sub_81A47E0: ; 81A47E0 str r2, [sp, 0x40] movs r0, 0xAC lsls r0, 1 - bl malloc_and_clear + bl AllocZeroed mov r8, r0 bl sub_80E8260 add r0, sp, 0x30 @@ -782864,7 +782865,7 @@ sub_81A47E0: ; 81A47E0 cmp r2, 0x2 ble @081A4852 mov r0, r8 - bl free + bl Free add sp, 0x44 pop {r3-r5} mov r8, r3 @@ -782888,7 +782889,7 @@ sub_81A48B4: ; 81A48B4 mov r10, r1 movs r0, 0xAC lsls r0, 1 - bl malloc_and_clear + bl AllocZeroed mov r8, r0 bl sub_80E8260 mov r0, sp @@ -782981,7 +782982,7 @@ sub_81A48B4: ; 81A48B4 cmp r4, 0x2 ble @081A492A mov r0, r8 - bl free + bl Free add sp, 0x74 pop {r3-r5} mov r8, r3 @@ -783303,7 +783304,7 @@ sub_81A4C30: ; 81A4C30 push {r7} movs r0, 0x96 lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed adds r7, r0, 0 adds r4, r7, 0 movs r5, 0 @@ -783345,7 +783346,7 @@ sub_81A4C30: ; 81A4C30 cmp r4, r6 ble @081A4C84 adds r0, r7, 0 - bl free + bl Free pop {r3} mov r8, r3 pop {r4-r7} @@ -784072,7 +784073,7 @@ sub_81A5258: ; 81A5258 bl pal_fade_maybe ldr r1, =0x00003f3e movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_08611F74 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08D855E8 @@ -784108,7 +784109,7 @@ sub_81A5258: ; 81A5258 b @081A553E .pool @081A531C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081A5328 @@ -784155,7 +784156,7 @@ sub_81A5258: ; 81A5258 b @081A553E .pool @081A53B4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081A53C0 @@ -784163,7 +784164,7 @@ sub_81A5258: ; 81A5258 @081A53C0: ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg movs r6, 0x80 lsls r6, 15 movs r4, 0x7 @@ -784273,7 +784274,7 @@ sub_81A5258: ; 81A5258 @081A54D4: ldr r1, =0x00003f3e movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 str r0, [sp] movs r0, 0x5 @@ -784282,7 +784283,7 @@ sub_81A5258: ; 81A5258 movs r3, 0xD bl sub_8056A3C movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 @@ -784306,7 +784307,7 @@ sub_81A5258: ; 81A5258 bne @081A5544 ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg movs r0, 0xFA lsls r0, 2 bl gpu_tile_obj_free_by_tag @@ -785142,7 +785143,7 @@ sub_81A5BF8: ; 81A5BF8 movs r1, 0 movs r2, 0xFE movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r6, [sp, 0x4] str r5, [sp, 0x8] @@ -785150,7 +785151,7 @@ sub_81A5BF8: ; 81A5BF8 movs r1, 0 movs r2, 0x20 movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -785158,7 +785159,7 @@ sub_81A5BF8: ; 81A5BF8 movs r1, 0x31 movs r2, 0 movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -785166,7 +785167,7 @@ sub_81A5BF8: ; 81A5BF8 movs r1, 0x33 movs r2, 0x1 movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r0, r8 str r0, [sp] str r4, [sp, 0x4] @@ -785175,7 +785176,7 @@ sub_81A5BF8: ; 81A5BF8 movs r1, 0x34 movs r2, 0x2 movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0x1C mov r8, r0 str r4, [sp] @@ -785185,7 +785186,7 @@ sub_81A5BF8: ; 81A5BF8 movs r1, 0x35 movs r2, 0x1C movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -785193,7 +785194,7 @@ sub_81A5BF8: ; 81A5BF8 movs r1, 0x36 movs r2, 0x1D movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] movs r6, 0x5 str r6, [sp, 0x4] @@ -785202,7 +785203,7 @@ sub_81A5BF8: ; 81A5BF8 movs r1, 0x37 movs r2, 0 movs r3, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r0, r8 str r0, [sp] str r6, [sp, 0x4] @@ -785211,7 +785212,7 @@ sub_81A5BF8: ; 81A5BF8 movs r1, 0x39 movs r2, 0x1 movs r3, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r6, [sp, 0x4] str r5, [sp, 0x8] @@ -785219,7 +785220,7 @@ sub_81A5BF8: ; 81A5BF8 movs r1, 0x3A movs r2, 0x1D movs r3, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000831 str r4, [sp] str r4, [sp, 0x4] @@ -785227,7 +785228,7 @@ sub_81A5BF8: ; 81A5BF8 movs r0, 0 movs r2, 0 movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000833 str r4, [sp] str r4, [sp, 0x4] @@ -785235,7 +785236,7 @@ sub_81A5BF8: ; 81A5BF8 movs r0, 0 movs r2, 0x1 movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000834 movs r0, 0x1A str r0, [sp] @@ -785244,7 +785245,7 @@ sub_81A5BF8: ; 81A5BF8 movs r0, 0 movs r2, 0x2 movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000835 str r4, [sp] str r4, [sp, 0x4] @@ -785252,7 +785253,7 @@ sub_81A5BF8: ; 81A5BF8 movs r0, 0 movs r2, 0x1C movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000836 str r4, [sp] str r4, [sp, 0x4] @@ -785260,7 +785261,7 @@ sub_81A5BF8: ; 81A5BF8 movs r0, 0 movs r2, 0x1D movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0xC pop {r3} mov r8, r3 @@ -785285,7 +785286,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0x3 movs r2, 0 movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r6, 0x4 str r4, [sp] str r4, [sp, 0x4] @@ -785294,7 +785295,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0x4 movs r2, 0x1 movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0x1B mov r8, r0 str r0, [sp] @@ -785304,7 +785305,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0x5 movs r2, 0x2 movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -785312,7 +785313,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0x6 movs r2, 0x1C movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -785320,7 +785321,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0x7 movs r2, 0x1D movs r3, 0xE - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r6, [sp, 0x4] str r5, [sp, 0x8] @@ -785328,7 +785329,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0x8 movs r2, 0 movs r3, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r6, [sp, 0x4] str r5, [sp, 0x8] @@ -785336,7 +785337,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0x9 movs r2, 0x1 movs r3, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r0, r8 str r0, [sp] str r6, [sp, 0x4] @@ -785345,7 +785346,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0xA movs r2, 0x2 movs r3, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r6, [sp, 0x4] str r5, [sp, 0x8] @@ -785353,7 +785354,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0xB movs r2, 0x1C movs r3, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r6, [sp, 0x4] str r5, [sp, 0x8] @@ -785361,7 +785362,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0xC movs r2, 0x1D movs r3, 0xF - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -785369,7 +785370,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0xD movs r2, 0 movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -785377,7 +785378,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0xE movs r2, 0x1 movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect mov r0, r8 str r0, [sp] str r4, [sp, 0x4] @@ -785386,7 +785387,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0xF movs r2, 0x2 movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -785394,7 +785395,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0x10 movs r2, 0x1C movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] @@ -785402,7 +785403,7 @@ sub_81A5D44: ; 81A5D44 movs r1, 0x11 movs r2, 0x1D movs r3, 0x13 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0xC pop {r3} mov r8, r3 @@ -788900,7 +788901,7 @@ sub_81A79EC: ; 81A79EC lsrs r4, r0, 24 @081A7AFA: adds r0, r4, 0 - bl malloc_and_clear + bl AllocZeroed adds r5, r0, 0 movs r3, 0 movs r2, 0 @@ -788930,7 +788931,7 @@ sub_81A79EC: ; 81A79EC adds r0, r5, r0 ldrb r4, [r0] adds r0, r5, 0 - bl free + bl Free cmp r4, 0x3 bne @081A7B46 bl sub_81A7728 @@ -789724,7 +789725,7 @@ sub_81A80DC: ; 81A80DC movs r6, 0x6 @081A8172: adds r0, r6, 0 - bl malloc_and_clear + bl AllocZeroed adds r5, r0, 0 movs r2, 0 movs r3, 0 @@ -789786,7 +789787,7 @@ sub_81A80DC: ; 81A80DC orrs r0, r1 strb r0, [r4] adds r0, r5, 0 - bl free + bl Free ldr r0, [r7] adds r0, r6 ldrb r1, [r0] @@ -790669,7 +790670,7 @@ sub_81A8934: ; 81A8934 cmp r0, 0 bne @081A894A movs r0, 0x44 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] @081A894A: ldr r0, [r4] @@ -790688,7 +790689,7 @@ sub_81A895C: ; 81A895C ldr r0, [r4] cmp r0, 0 beq @081A896E - bl free + bl Free movs r0, 0 str r0, [r4] @081A896E: @@ -793266,7 +793267,7 @@ sub_81A9EC8: ; 81A9EC8 lsls r0, 24 cmp r0, 0 beq @081A9ED8 - bl do_reset + bl Reset @081A9ED8: pop {r0} bx r0 @@ -793492,7 +793493,7 @@ sub_81AA078: ; 81AA078 lsrs r1, 24 str r1, [sp, 0x8] movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed str r0, [sp, 0xC] bl sub_81AA96C mov r4, sp @@ -793641,7 +793642,7 @@ sub_81AA078: ; 81AA078 @081AA1BE: bl mapheader_run_script_with_tag_x1 ldr r0, [sp, 0xC] - bl free + bl Free add sp, 0x1C pop {r3-r5} mov r8, r3 @@ -793878,7 +793879,7 @@ sub_81AA398: ; 81AA398 lsls r0, 24 lsrs r6, r0, 24 movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed str r0, [sp, 0x8] bl sub_81AA96C ldr r0, =0x03005d90 @@ -794009,7 +794010,7 @@ sub_81AA398: ; 81AA398 blt @081AA406 @081AA4C0: ldr r0, [sp, 0x8] - bl free + bl Free add sp, 0xC pop {r3-r5} mov r8, r3 @@ -794042,7 +794043,7 @@ sub_81AA4D8: ; 81AA4D8 lsls r0, 24 lsrs r4, r0, 24 movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed str r0, [sp, 0x14] bl sub_81AA96C ldr r1, [sp] @@ -794233,7 +794234,7 @@ sub_81AA648: ; 81AA648 lsls r0, 24 lsrs r5, r0, 24 movs r0, 0x10 - bl malloc_and_clear + bl AllocZeroed str r0, [sp, 0x8] bl sub_81AA96C ldr r1, [sp] @@ -795041,12 +795042,12 @@ sub_81AAC90: ; 81AAC90 lsrs r7, r1, 24 ldr r6, =0x0203ce54 ldr r0, =0x00000c48 - bl malloc_and_clear + bl AllocZeroed str r0, [r6] cmp r0, 0 bne @081AACBC adds r0, r4, 0 - bl set_callback2 + bl SetMainCallback2 b @081AAD3A .pool @081AACBC: @@ -795113,7 +795114,7 @@ sub_81AAC90: ; 81AAC90 movs r2, 0xA bl memset ldr r0, =c2_bag_2 - bl set_callback2 + bl SetMainCallback2 @081AAD3A: pop {r4-r7} pop {r0} @@ -795424,7 +795425,7 @@ setup_bag_menu: ; 81AADB8 ldr r0, =vblank_cb_bag_menu bl SetVBlankCallback ldr r0, =c2_bag_3 - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 b @081AB046 .pool @@ -795449,31 +795450,31 @@ bag_menu_init_bgs: ; 81AB050 movs r1, 0 bl memset movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_08613F90 movs r0, 0 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r1, [r4] adds r1, 0x4 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap bl sub_8121E10 movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -795637,12 +795638,12 @@ allocate_bag_item_list_buffers: ; 81AB218 ldr r4, =0x0203ce74 movs r0, 0x82 lsls r0, 2 - bl malloc + bl Alloc str r0, [r4] ldr r4, =0x0203ce78 movs r0, 0xC3 lsls r0, 3 - bl malloc + bl Alloc str r0, [r4] pop {r4} pop {r0} @@ -796045,7 +796046,7 @@ sub_81AB520: ; 81AB520 str r0, [sp, 0x4] mov r0, r8 movs r2, 0x8 - bl BlitSurfaceToWindow + bl BlitBitmapToWindow @081AB5BE: ldrb r0, [r5, 0x5] cmp r0, 0x3 @@ -796131,7 +796132,7 @@ sub_81AB520: ; 81AB520 str r0, [sp, 0x4] mov r0, r8 movs r2, 0x60 - bl BlitSurfaceToWindow + bl BlitBitmapToWindow @081AB696: add sp, 0x14 pop {r3,r4} @@ -796400,14 +796401,14 @@ free_bag_item_list_buffers: ; 81AB8C8 push {lr} ldr r0, =0x0203ce78 ldr r0, [r0] - bl free + bl Free ldr r0, =0x0203ce74 ldr r0, [r0] - bl free + bl Free bl FreeAllWindowBuffers ldr r0, =0x0203ce54 ldr r0, [r0] - bl free + bl Free pop {r0} bx r0 .pool @@ -796473,12 +796474,12 @@ task_close_bag_menu_2: ; 81AB930 ldr r0, [r0] cmp r0, 0 beq @081AB984 - bl set_callback2 + bl SetMainCallback2 b @081AB98A .pool @081AB984: ldr r0, [r4] - bl set_callback2 + bl SetMainCallback2 @081AB98A: bl sub_81AB824 bl reset_all_obj_data @@ -797338,7 +797339,7 @@ sub_81ABFA8: ; 81ABFA8 movs r1, 0xB movs r2, 0xE movs r3, 0x2 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram add r0, sp, 0x8 @@ -797520,7 +797521,7 @@ sub_81AC23C: ; 81AC23C movs r0, 0x2 movs r1, 0x11 movs r2, 0xE - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram add sp, 0x8 @@ -797547,7 +797548,7 @@ bag_menu_draw_pocket_indicator_square: ; 81AC26C str r0, [sp, 0x4] movs r0, 0x2 movs r3, 0x3 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 b @081AC2AE .pool @081AC298: @@ -797560,7 +797561,7 @@ bag_menu_draw_pocket_indicator_square: ; 81AC26C str r0, [sp, 0x4] movs r0, 0x2 movs r3, 0x3 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 @081AC2AE: movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram @@ -799599,7 +799600,7 @@ sub_81AD520: ; 81AD520 movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset_to_copy_queue + bl ChangeBgY_ScreenOff ldr r4, =0x03005d8c ldr r0, [r4] ldr r5, =0x00000496 @@ -800372,7 +800373,7 @@ sub_81ADC70: ; 81ADC70 push {r4-r6,lr} ldr r4, =0x0203ce80 movs r0, 0xD0 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r5, =0x03005d8c ldr r1, [r5] @@ -800479,7 +800480,7 @@ sub_81ADD00: ; 81ADD00 cmp r5, 0x4 bls @081ADD3A ldr r0, [r6] - bl free + bl Free pop {r4-r6} pop {r0} bx r0 @@ -800609,7 +800610,7 @@ sub_81ADE6C: ; 81ADE6C ldr r1, =sub_819FA50 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -800644,7 +800645,7 @@ sub_81ADEBC: ; 81ADEBC ldr r1, =sub_818DEF4 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -800675,7 +800676,7 @@ sub_81ADF00: ; 81ADF00 ldr r1, =sub_818E564 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -803986,7 +803987,7 @@ sub_81AF828: ; 81AF828 strb r0, [r5] ldrb r0, [r5] lsls r0, 2 - bl malloc + bl Alloc adds r2, r0, 0 str r2, [r5, 0x8] str r2, [r5, 0x4] @@ -804123,7 +804124,7 @@ sub_81AF9D8: ; 81AF9D8 ldr r1, =0x03005e08 adds r4, r0, r1 ldr r0, [r4, 0x8] - bl free + bl Free ldrh r0, [r4, 0xE] ldr r6, =0x0000ffff cmp r0, r6 @@ -804655,14 +804656,14 @@ sub_81AFDE4: ; 81AFDE4 ldr r5, =0x0203cebc movs r0, 0x90 lsls r0, 1 - bl malloc + bl Alloc str r0, [r5] cmp r0, 0 beq @081AFE1A ldr r4, =0x0203cec0 movs r0, 0x80 lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] cmp r0, 0 beq @081AFE14 @@ -804671,7 +804672,7 @@ sub_81AFDE4: ; 81AFDE4 .pool @081AFE14: ldr r0, [r5] - bl free + bl Free @081AFE1A: movs r0, 0 @081AFE1C: @@ -804685,10 +804686,10 @@ sub_81AFE24: ; 81AFE24 push {lr} ldr r0, =0x0203cebc ldr r0, [r0] - bl free + bl Free ldr r0, =0x0203cec0 ldr r0, [r0] - bl free + bl Free pop {r0} bx r0 .pool @@ -804769,7 +804770,7 @@ AddItemIconObject: ; 81AFE70 str r1, [r0, 0x4] bl gpu_pal_obj_decompress_and_apply movs r0, 0x18 - bl malloc + bl Alloc adds r5, r0, 0 ldr r0, =gUnknown_08614FF4 adds r1, r5, 0 @@ -804787,7 +804788,7 @@ AddItemIconObject: ; 81AFE70 lsrs r4, 24 bl sub_81AFE24 adds r0, r5, 0 - bl free + bl Free adds r0, r4, 0 b @081AFF2A .pool @@ -804853,7 +804854,7 @@ sub_81AFF34: ; 81AFF34 str r1, [r0, 0x4] bl gpu_pal_obj_decompress_and_apply movs r0, 0x18 - bl malloc + bl Alloc adds r5, r0, 0 mov r0, r8 adds r1, r5, 0 @@ -804871,7 +804872,7 @@ sub_81AFF34: ; 81AFF34 lsrs r4, 24 bl sub_81AFE24 adds r0, r5, 0 - bl free + bl Free adds r0, r4, 0 b @081AFFEE .pool @@ -804944,14 +804945,14 @@ sub_81B0038: ; 81B0038 mov r10, r0 movs r0, 0x8E lsls r0, 2 - bl malloc + bl Alloc adds r5, r0, 0 mov r1, r10 str r5, [r1] cmp r5, 0 bne @081B0088 ldr r0, [sp, 0x2C] - bl set_callback2 + bl SetMainCallback2 b @081B0194 .pool @081B0088: @@ -805090,7 +805091,7 @@ sub_81B0038: ; 81B0038 strb r0, [r2] bl calc_player_party_count ldr r0, =c2_811EBD0 - bl set_callback2 + bl SetMainCallback2 @081B0194: add sp, 0x4 pop {r3-r5} @@ -805428,7 +805429,7 @@ sub_81B020C: ; 81B020C ldr r0, =sub_81B01CC bl SetVBlankCallback ldr r0, =sub_81B01B0 - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 b @081B04B2 .pool @@ -805458,7 +805459,7 @@ sub_81B04BC: ; 81B04BC ldr r0, =sub_81B01CC bl SetVBlankCallback ldr r0, =sub_81B01B0 - bl set_callback2 + bl SetMainCallback2 add sp, 0x4 pop {r0} bx r0 @@ -805478,7 +805479,7 @@ sub_81B04F8: ; 81B04F8 bne @081B051C ldr r0, =0x0203cec8 ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 bl sub_81B06F4 adds r0, r4, 0 bl remove_task @@ -805511,7 +805512,7 @@ sub_81B0550: ; 81B0550 movs r4, 0x80 lsls r4, 4 adds r0, r4, 0 - bl malloc + bl Alloc str r0, [r5] cmp r0, 0 beq @081B05C0 @@ -805519,30 +805520,30 @@ sub_81B0550: ; 81B0550 adds r2, r4, 0 bl memset movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_086156B8 movs r0, 0 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r1, [r5] movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap bl sub_8121E10 movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 b @081B05C2 .pool @@ -805595,11 +805596,11 @@ sub_81B05C8: ; 81B05C8 lsrs r2, 16 movs r0, 0x1 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @081B069A .pool @081B0638: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @081B06B4 @@ -805696,25 +805697,25 @@ sub_81B06F4: ; 81B06F4 ldr r0, [r0] cmp r0, 0 beq @081B0702 - bl free + bl Free @081B0702: ldr r0, =0x0203cee4 ldr r0, [r0] cmp r0, 0 beq @081B070E - bl free + bl Free @081B070E: ldr r0, =0x0203cee0 ldr r0, [r0] cmp r0, 0 beq @081B071A - bl free + bl Free @081B071A: ldr r0, =0x0203cedc ldr r0, [r0] cmp r0, 0 beq @081B0726 - bl free + bl Free @081B0726: bl FreeAllWindowBuffers pop {r0} @@ -805732,7 +805733,7 @@ sub_81B0740: ; 81B0740 lsrs r7, r0, 24 ldr r4, =0x0203cedc movs r0, 0x60 - bl malloc + bl Alloc str r0, [r4] movs r5, 0 lsls r0, r7, 1 @@ -806710,7 +806711,7 @@ sub_81B0F28: ; 81B0F28 movs r1, 0xE movs r2, 0x17 movs r3, 0x11 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect b @081B0FBC .pool @081B0F54: @@ -807069,7 +807070,7 @@ sub_81B120C: ; 81B120C movs r0, 0x1 movs r2, 0x17 movs r3, 0x10 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette ldr r1, =gUnknown_086157E0 str r6, [sp] str r5, [sp, 0x4] @@ -807077,7 +807078,7 @@ sub_81B120C: ; 81B120C movs r0, 0x1 movs r2, 0x17 movs r3, 0x12 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram add sp, 0xC @@ -807120,7 +807121,7 @@ sub_81B1288: ; 81B1288 adds r4, r0, 0 adds r6, r1, 0 movs r0, 0x64 - bl malloc + bl Alloc adds r5, r0, 0 adds r1, r4, 0 movs r2, 0x64 @@ -807134,7 +807135,7 @@ sub_81B1288: ; 81B1288 movs r2, 0x64 bl memcpy adds r0, r5, 0 - bl free + bl Free pop {r4-r6} pop {r0} bx r0 @@ -807192,12 +807193,12 @@ c3_0811FAB4: ; 81B12F8 ldr r0, [r0, 0x4] cmp r0, 0 beq @081B1338 - bl set_callback2 + bl SetMainCallback2 b @081B133E .pool @081B1338: ldr r0, [r4] - bl set_callback2 + bl SetMainCallback2 @081B133E: bl reset_all_obj_data bl sub_81B06F4 @@ -809497,7 +809498,7 @@ sub_81B2578: ; 81B2578 mov r0, r10 muls r0, r6 lsls r0, 5 - bl malloc_and_clear + bl AllocZeroed mov r9, r0 cmp r0, 0 beq @081B2646 @@ -809566,9 +809567,9 @@ sub_81B2578: ; 81B2578 str r0, [sp, 0x4] ldr r0, [sp, 0x8] mov r1, r9 - bl BlitSurfaceToWindow + bl BlitBitmapToWindow mov r0, r9 - bl free + bl Free @081B2646: add sp, 0x2C pop {r3-r5} @@ -811919,7 +811920,7 @@ sub_81B3938: ; 81B3938 ldrsh r0, [r6, r2] lsls r0, 1 muls r0, r1 - bl malloc + bl Alloc str r0, [r4] ldr r5, =0x0203cef4 movs r0, 0xC @@ -811928,7 +811929,7 @@ sub_81B3938: ; 81B3938 ldrsh r0, [r6, r2] lsls r0, 1 muls r0, r1 - bl malloc + bl Alloc str r0, [r5] ldr r1, [r4] ldrb r2, [r6] @@ -812095,7 +812096,7 @@ sub_81B3B40: ; 81B3B40 movs r0, 0 movs r1, 0 mov r3, r9 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 ldr r1, [sp, 0x30] lsls r0, r1, 16 asrs r0, 16 @@ -812131,7 +812132,7 @@ sub_81B3B40: ; 81B3B40 str r0, [sp, 0x20] ldr r1, [sp, 0x28] movs r3, 0 - bl bg_copy_tilemap_rect + bl CopyRectToBgTileMapBufferRect @081B3BFA: add sp, 0x34 pop {r3-r5} @@ -812463,10 +812464,10 @@ sub_81B3E60: ; 81B3E60 bl schedule_bg_copy_tilemap_to_vram ldr r0, =0x0203cef0 ldr r0, [r0] - bl free + bl Free ldr r0, =0x0203cef4 ldr r0, [r0] - bl free + bl Free adds r0, r6, 0 bl sub_81B407C b @081B3F08 @@ -812628,7 +812629,7 @@ swap_pokemon_and_oams: ; 81B3FDC muls r5, r1 adds r5, r0 movs r0, 0x64 - bl malloc + bl Alloc adds r6, r0, 0 adds r1, r4, 0 movs r2, 0x64 @@ -812642,7 +812643,7 @@ swap_pokemon_and_oams: ; 81B3FDC movs r2, 0x64 bl memcpy adds r0, r6, 0 - bl free + bl Free ldr r0, [sp] adds r0, 0xB ldr r1, [sp, 0x4] @@ -820036,7 +820037,7 @@ sub_81B81A8: ; 81B81A8 adds r0, r7, 0 bl sub_81B841C ldr r0, [r6] - bl set_callback2 + bl SetMainCallback2 b @081B8224 .pool @081B8208: @@ -821783,7 +821784,7 @@ pokemon_change_order: ; 81B9030 movs r4, 0x96 lsls r4, 2 adds r0, r4, 0 - bl malloc + bl Alloc adds r5, r0, 0 ldr r1, =0x020244ec adds r2, r4, 0 @@ -821809,7 +821810,7 @@ pokemon_change_order: ; 81B9030 cmp r4, 0x5 bls @081B904A adds r0, r5, 0 - bl free + bl Free pop {r4-r6} pop {r0} bx r0 @@ -821822,7 +821823,7 @@ sub_81B9080: ; 81B9080 movs r4, 0x96 lsls r4, 2 adds r0, r4, 0 - bl malloc + bl Alloc adds r5, r0, 0 ldr r1, =0x020244ec adds r2, r4, 0 @@ -821848,7 +821849,7 @@ sub_81B9080: ; 81B9080 cmp r4, 0x5 bls @081B909A adds r0, r5, 0 - bl free + bl Free pop {r4-r6} pop {r0} bx r0 @@ -821915,7 +821916,7 @@ sub_81B90D0: ; 81B90D0 sub_81B9140: ; 81B9140 push {lr} ldr r0, =sub_8059D40 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -821961,7 +821962,7 @@ sub_81B917C: ; 81B917C lsls r1, 9 movs r0, 0x2 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX ldr r0, =sub_81B91B4 str r0, [r4] pop {r4} @@ -822142,7 +822143,7 @@ sub_81B9294: ; 81B9294 lsls r1, 4 movs r0, 0x2 movs r2, 0x1 - bl bg_change_x_offset + bl ChangeBgX pop {r4-r7} pop {r0} bx r0 @@ -822212,7 +822213,7 @@ sub_81B9390: ; 81B9390 ldr r1, =hm_add_c3_without_phase_2 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r4} pop {r0} bx r0 @@ -822321,7 +822322,7 @@ sub_81B9470: ; 81B9470 ldr r0, =hm_add_c3_without_phase_2 str r0, [r1] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -822457,7 +822458,7 @@ sub_81B9588: ; 81B9588 ldr r1, =hm_add_c3_without_phase_2 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r4,r5} pop {r0} bx r0 @@ -830965,7 +830966,7 @@ sub_81BE6B8: ; 81BE6B8 cmp r0, 0 beq @081BE718 movs r0, 0xC8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] adds r0, 0x4 bl sub_8151B3C @@ -831030,7 +831031,7 @@ sub_81BE72C: ; 81BE72C movs r2, 0x1 bl sub_8151C50 ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] @081BE788: @@ -831548,11 +831549,11 @@ sub_81BEB90: ; 81BEB90 ldr r0, [r4] ldrh r1, [r0] movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, [r4] ldrh r1, [r0, 0x2] movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -831629,27 +831630,27 @@ sub_81BEBF4: ; 81BEBF4 movs r0, 0 movs r1, 0x7 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute b @081BED04 @081BEC50: ldr r4, =0x0203cf04 movs r0, 0x92 lsls r0, 4 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r4, =0x0203cf08 movs r0, 0x80 lsls r0, 4 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY b @081BECD8 .pool @081BEC88: @@ -831664,14 +831665,14 @@ sub_81BEBF4: ; 81BEBF4 lsls r2, 4 movs r0, 0 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @081BECD8 .pool @081BECB0: ldr r0, =0x0203cf08 ldr r1, [r0] movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, =gUnknown_08617B94 movs r0, 0x6 str r0, [sp] @@ -831682,9 +831683,9 @@ sub_81BEBF4: ; 81BEBF4 movs r0, 0 movs r2, 0xC movs r3, 0x1D - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @081BECD8: ldr r1, =0x03005e00 lsls r0, r5, 2 @@ -831698,7 +831699,7 @@ sub_81BEBF4: ; 81BEBF4 .pool @081BECF8: movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg b @081BED04 @081BED00: bl sub_81BEB24 @@ -831716,7 +831717,7 @@ sub_81BEBF4: ; 81BEBF4 @081BED1C: ldr r4, =0x0203cf14 movs r0, 0x4 - bl malloc + bl Alloc str r0, [r4] movs r2, 0 movs r1, 0x2 @@ -831781,7 +831782,7 @@ sub_81BED50: ; 81BED50 ldr r4, =0x0203cf10 movs r0, 0xC0 lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] b @081BF002 .pool @@ -831804,7 +831805,7 @@ sub_81BED50: ; 81BED50 lsls r0, r3, 24 lsrs r4, r0, 24 movs r0, 0x30 - bl malloc + bl Alloc ldr r3, =0x0203cf10 ldr r1, [r3] lsls r2, r4, 3 @@ -831940,7 +831941,7 @@ sub_81BED50: ; 81BED50 cmp r0, 0x2F bls @081BEF24 ldr r0, [r1] - bl free + bl Free ldr r0, [r7] adds r0, r4, r0 movs r1, 0 @@ -831977,7 +831978,7 @@ sub_81BED50: ; 81BED50 lsls r2, 4 movs r0, 0 movs r3, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r0, =0x0203cf10 ldr r0, [r0] movs r4, 0xBE @@ -831990,7 +831991,7 @@ sub_81BED50: ; 81BED50 .pool @081BEF64: movs r0, 0 - bl bg_unset_tilemap + bl UnsetBgTileMap ldr r0, =sub_81BEBB4 bl get_task_id_by_function lsls r0, 24 @@ -832010,39 +832011,39 @@ sub_81BED50: ; 81BED50 @081BEF94: ldr r4, =0x0203cf14 ldr r0, [r4] - bl free + bl Free movs r5, 0 str r5, [r4] ldr r4, =0x0203cf10 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203cf04 ldr r0, [r4] - bl free + bl Free str r5, [r4] ldr r4, =0x0203cf08 ldr r0, [r4] - bl free + bl Free str r5, [r4] b @081BF002 .pool @081BEFD0: movs r0, 0xC movs r1, 0x2 - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0x8 movs r1, 0 - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0 movs r1, 0x7 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute bl sub_81971D0 b @081BF002 @081BEFF0: movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg b @081BF002 @081BEFF8: mov r0, r10 @@ -832110,19 +832111,19 @@ sub_81BF028: ; 81BF028 @081BF080: ldr r4, =0x0203cf0c movs r0, 0x14 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r0, 0x80 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1] movs r0, 0x8 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0x4] movs r0, 0x80 lsls r0, 2 - bl malloc_and_clear + bl AllocZeroed ldr r1, [r4] str r0, [r1, 0xC] movs r0, 0 @@ -832275,19 +832276,19 @@ sub_81BF028: ; 81BF028 bl obj_delete_and_free_tiles ldr r0, [r5] ldr r0, [r0, 0xC] - bl free + bl Free ldr r0, [r5] movs r4, 0 str r4, [r0, 0xC] ldr r0, [r0, 0x4] - bl free + bl Free ldr r0, [r5] str r4, [r0, 0x4] ldr r0, [r0] - bl free + bl Free ldr r0, [r5] str r4, [r0] - bl free + bl Free str r4, [r5] b @081BF228 .pool @@ -832476,9 +832477,9 @@ sub_81BF2B8: ; 81BF2B8 sub_81BF384: ; 81BF384 push {r4,lr} ldr r0, =0x0000ffff - bl disable_irqs + bl DisableInterrupts movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts bl SoundVSyncOff_rev01 movs r0, 0 bl SetVBlankCallback @@ -832487,10 +832488,10 @@ sub_81BF384: ; 81BF384 bl remove_some_task movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r4, =0x030012b8 movs r0, 0x50 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r1, 0 strb r1, [r0] @@ -832498,7 +832499,7 @@ sub_81BF384: ; 81BF384 movs r0, 0x6 strb r0, [r1, 0x1] ldr r0, =sub_81BF3DC - bl set_callback2 + bl SetMainCallback2 pop {r4} pop {r0} bx r0 @@ -832681,7 +832682,7 @@ sub_81BF3DC: ; 81BF3DC ands r0, r1 cmp r0, 0 beq @081BF592 - bl do_reset + bl Reset b @081BF592 .pool @081BF574: @@ -832716,25 +832717,25 @@ sub_81BF5A4: ; 81BF5A4 sub sp, 0x10 movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0 str r1, [sp, 0xC] ldr r4, =0x040000d4 @@ -832764,27 +832765,27 @@ sub_81BF5A4: ; 81BF5A4 str r2, [r4, 0x8] ldr r0, [r4, 0x8] movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_08618108 movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r0, =gUnknown_08618110 bl InitWindows bl DeactivateAllTextPrinters @@ -832797,7 +832798,7 @@ sub_81BF5A4: ; 81BF5A4 ldr r0, [r4, 0x8] movs r0, 0 movs r1, 0x40 - bl lcd_io_set + bl SetGpuReg movs r0, 0x2 movs r1, 0 bl FillWindowPixelBuffer @@ -832961,7 +832962,7 @@ sub_81BF7E8: ; 81BF7E8 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0x1 movs r1, 0xAA bl FillWindowPixelBuffer @@ -833013,7 +833014,7 @@ sub_81BF7E8: ; 81BF7E8 bl PutWindowTileMap @081BF87E: movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r5, =gUnknown_08618178 lsls r4, r6, 1 adds r4, r6 @@ -833035,9 +833036,9 @@ sub_81BF7E8: ; 81BF7E8 ldr r2, =0x04000040 bl CpuSet movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg add sp, 0xC pop {r4-r6} pop {r0} @@ -833049,9 +833050,9 @@ sub_81BF7E8: ; 81BF7E8 sub_81BF8D8: ; 81BF8D8 push {lr} movs r0, 0 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg pop {r0} bx r0 thumb_func_end sub_81BF8D8 @@ -833072,7 +833073,7 @@ sub_81BF8EC: ; 81BF8EC lsrs r6, 24 ldr r4, =0x0203cf1c ldr r0, =0x000040f8 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, =0x000040bc adds r0, r1 @@ -833187,7 +833188,7 @@ sub_81BF8EC: ; 81BF8EC bl sub_806F2AC @081BFA12: ldr r0, =sub_81BFAE4 - bl set_callback2 + bl SetMainCallback2 pop {r3} mov r8, r3 pop {r4-r7} @@ -833606,7 +833607,7 @@ sub_81BFB10: ; 81BFB10 ldr r0, =sub_81BFAD0 bl SetVBlankCallback ldr r0, =sub_81BFAB4 - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 b @081BFE1A .pool @@ -833623,26 +833624,26 @@ sub_81BFB10: ; 81BFB10 sub_81BFE24: ; 81BFE24 push {r4,lr} movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0861CBB4 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x0203cf1c ldr r1, [r4] ldr r0, =0x000020bc adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x000010bc adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] adds r1, 0xBC movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap bl sub_8121E10 movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram @@ -833653,18 +833654,18 @@ sub_81BFE24: ; 81BFE24 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg pop {r4} pop {r0} bx r0 @@ -834210,16 +834211,16 @@ sub_81C0348: ; 81C0348 ldr r1, [r6] adds r1, r4 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r6] adds r1, r5 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap movs r1, 0x80 lsls r1, 9 movs r0, 0x2 movs r2, 0x1 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x13 bl ClearWindowTileMap movs r0, 0xD @@ -834266,7 +834267,7 @@ sub_81C0434: ; 81C0434 bl FreeAllWindowBuffers ldr r0, =0x0203cf1c ldr r0, [r0] - bl free + bl Free pop {r0} bx r0 .pool @@ -834319,7 +834320,7 @@ sub_81C0484: ; 81C0484 ldr r4, =0x0203cf1c ldr r0, [r4] ldr r0, [r0, 0x4] - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x0203cf20 ldr r0, [r4] ldr r2, =0x000040be @@ -835131,11 +835132,11 @@ sub_81C0B8C: ; 81C0B8C movs r0, 0x1 movs r1, 0x7 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 movs r1, 0x7 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram b @081C0BFE @@ -835146,18 +835147,18 @@ sub_81C0B8C: ; 81C0B8C movs r0, 0x2 movs r1, 0x7 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x1 movs r1, 0x7 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram @081C0BFE: ldrb r0, [r4, 0x2] movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX ldrb r0, [r4, 0x2] ldr r1, =0x0203cf1c ldr r1, [r1] @@ -835167,17 +835168,17 @@ sub_81C0B8C: ; 81C0B8C lsls r2, 12 adds r2, 0xBC adds r1, r2 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg @081C0C2A: ldrb r0, [r4, 0x2] movs r1, 0x80 lsls r1, 6 movs r2, 0x1 - bl bg_change_x_offset + bl ChangeBgX ldrh r0, [r4] adds r0, 0x20 strh r0, [r4] @@ -835269,13 +835270,13 @@ sub_81C0CC4: ; 81C0CC4 movs r1, 0x80 lsls r1, 9 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX @081C0D0C: ldrb r0, [r4, 0x2] movs r1, 0x80 lsls r1, 6 movs r2, 0x2 - bl bg_change_x_offset + bl ChangeBgX ldrh r0, [r4] adds r0, 0x20 strh r0, [r4] @@ -835317,11 +835318,11 @@ sub_81C0D44: ; 81C0D44 movs r0, 0x1 movs r1, 0x7 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 movs r1, 0x7 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram b @081C0DA6 @@ -835330,11 +835331,11 @@ sub_81C0D44: ; 81C0D44 movs r0, 0x2 movs r1, 0x7 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x1 movs r1, 0x7 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram @081C0DA6: @@ -835351,17 +835352,17 @@ sub_81C0D44: ; 81C0D44 ldr r3, =0xfffff0bc adds r1, r3 adds r1, r2, r1 - bl bg_set_tilemap + bl SetBgTileMap ldrb r0, [r4, 0x2] movs r1, 0x80 lsls r1, 9 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX @081C0DD0: movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg ldr r2, [r6] ldr r0, =0x000040c9 adds r2, r0 @@ -836920,7 +836921,7 @@ sub_81C1BA0: ; 81C1BA0 push {r4-r7,lr} sub sp, 0xC movs r0, 0x20 - bl malloc + bl Alloc adds r4, r0, 0 movs r5, 0 @081C1BAE: @@ -837043,11 +837044,11 @@ sub_81C1BA0: ; 81C1BA0 adds r1, r4, 0 movs r2, 0xB movs r3, 0 - bl bg_copy_tilemap_rect_simple + bl CopyToBgTileMapBufferRect_ChangePalette movs r0, 0x3 bl schedule_bg_copy_tilemap_to_vram adds r0, r4, 0 - bl free + bl Free add sp, 0xC pop {r4-r7} pop {r0} @@ -837070,7 +837071,7 @@ sub_81C1CB0: ; 81C1CB0 ldrb r0, [r4, 0x7] lsls r0, 1 muls r0, r1 - bl malloc + bl Alloc adds r7, r0, 0 mov r1, sp ldrh r0, [r4, 0x4] @@ -837167,7 +837168,7 @@ sub_81C1CB0: ; 81C1CB0 cmp r5, r0 bcc @081C1D68 adds r0, r7, 0 - bl free + bl Free add sp, 0x4 pop {r3} mov r8, r3 @@ -837919,7 +837920,7 @@ sub_81C22CC: ; 81C22CC cmp r0, 0x7 bls @081C2356 movs r0, 0x1 - bl bg_get_tilemap + bl GetBgTileMap ldr r1, =0x0203cf1c ldr r1, [r1] ldr r2, =0x000010bc @@ -838090,14 +838091,14 @@ sub_81C2524: ; 81C2524 lsls r1, 9 movs r0, 0x3 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX b @081C254E .pool @081C2544: movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX @081C254E: pop {r0} bx r0 @@ -838452,7 +838453,7 @@ sub_81C2838: ; 81C2838 adds r0, r4, 0 adds r1, r3, 0 movs r3, 0 - bl BlitSurfaceToWindow + bl BlitBitmapToWindow add sp, 0x8 pop {r4} pop {r0} @@ -839392,10 +839393,10 @@ sub_81C307C: ; 81C307C .pool @081C30E0: movs r0, 0x20 - bl malloc + bl Alloc adds r6, r0, 0 movs r0, 0x20 - bl malloc + bl Alloc adds r5, r0, 0 adds r0, r6, 0 bl sub_81C31F0 @@ -839456,9 +839457,9 @@ sub_81C307C: ; 81C307C ldr r0, =0x02021fc4 bl sub_81AFC28 adds r0, r6, 0 - bl free + bl Free adds r0, r5, 0 - bl free + bl Free @081C3182: pop {r4-r6} pop {r0} @@ -840111,16 +840112,16 @@ sub_81C3710: ; 81C3710 mov r5, r8 push {r5,r6} movs r0, 0x8 - bl malloc + bl Alloc mov r9, r0 movs r0, 0x8 - bl malloc + bl Alloc mov r8, r0 movs r0, 0x8 - bl malloc + bl Alloc adds r6, r0, 0 movs r0, 0x8 - bl malloc + bl Alloc adds r5, r0, 0 ldr r4, =0x0203cf1c ldr r0, [r4] @@ -840168,13 +840169,13 @@ sub_81C3710: ; 81C3710 ldr r1, =gUnknown_0861CE82 bl sub_81AFC28 mov r0, r9 - bl free + bl Free mov r0, r8 - bl free + bl Free adds r0, r6, 0 - bl free + bl Free adds r0, r5, 0 - bl free + bl Free pop {r3,r4} mov r8, r3 mov r9, r4 @@ -842723,7 +842724,7 @@ sub_81C4D70: ; 81C4D70 adds r5, r0, 0 ldr r4, =0x0203cf28 movs r0, 0x4 - bl malloc + bl Alloc str r0, [r4] ldr r1, [r5] lsls r0, r1, 20 @@ -842734,7 +842735,7 @@ sub_81C4D70: ; 81C4D70 lsrs r0, 30 movs r1, 0x8 movs r2, 0 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r3, [r5] lsls r0, r3, 30 lsrs r0, 30 @@ -842767,13 +842768,13 @@ sub_81C4D70: ; 81C4D70 lsrs r0, 30 movs r1, 0x8 movs r2, 0x2 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r0, [r5] lsls r0, 30 lsrs r0, 30 movs r1, 0x9 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r3, [r5] lsls r0, r3, 30 lsrs r0, 30 @@ -842805,19 +842806,19 @@ sub_81C4D70: ; 81C4D70 lsrs r0, 30 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX ldr r0, [r5] lsls r0, 30 lsrs r0, 30 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r0, [r5] lsls r0, 30 lsrs r0, 30 movs r1, 0x4 movs r2, 0x1 - bl gpu_bg_config_set_field + bl SetBgAttribute ldr r0, =gUnknown_0861D140 ldr r1, =0x020377f4 ldr r2, =0x04000018 @@ -842848,7 +842849,7 @@ sub_81C4E90: ; 81C4E90 ldr r0, =0x0203cf28 ldr r0, [r0] ldrb r0, [r0] - bl gpu_sync_bg_show + bl ShowBg movs r0, 0 @081C4EAC: pop {r1} @@ -842863,7 +842864,7 @@ sub_81C4EB4: ; 81C4EB4 ldr r0, [r4] cmp r0, 0 beq @081C4EC6 - bl free + bl Free movs r0, 0 str r0, [r4] @081C4EC6: @@ -842882,7 +842883,7 @@ sub_81C4ED0: ; 81C4ED0 ldrb r0, [r0] lsls r1, 8 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY pop {r0} bx r0 .pool @@ -842982,7 +842983,7 @@ sub_81C4F98: ; 81C4F98 lsrs r4, r0, 24 ldr r6, =0x0203cf2c ldr r0, =0x0000098c - bl malloc_and_clear + bl AllocZeroed str r0, [r6] cmp r4, 0x4 beq @081C4FB2 @@ -843020,7 +843021,7 @@ sub_81C4F98: ; 81C4F98 movs r2, 0x5 bl memset ldr r0, =sub_81C504C - bl set_callback2 + bl SetMainCallback2 pop {r4-r6} pop {r0} bx r0 @@ -843213,7 +843214,7 @@ sub_81C5078: ; 81C5078 ldr r0, =sub_81C5038 bl SetVBlankCallback ldr r0, =sub_81C501C - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 b @081C51D6 .pool @@ -843230,32 +843231,32 @@ sub_81C51DC: ; 81C51DC push {lr} bl sub_8121DA0 movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0861F2B4 movs r0, 0 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =0x0203cf2c ldr r1, [r0] adds r1, 0x4 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap bl sub_8121E10 movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool @@ -844352,14 +844353,14 @@ sub_81C5B4C: ; 81C5B4C ldr r0, [r0] cmp r0, 0 beq @081C5B94 - bl set_callback2 + bl SetMainCallback2 b @081C5B9E .pool @081C5B94: adds r0, r4, 0 subs r0, 0x8 ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 @081C5B9E: bl sub_81C56CC bl reset_all_obj_data @@ -844367,7 +844368,7 @@ sub_81C5B4C: ; 81C5B4C bl FreeAllWindowBuffers ldr r0, =0x0203cf2c ldr r0, [r0] - bl free + bl Free adds r0, r5, 0 bl remove_task @081C5BBC: @@ -846026,10 +846027,10 @@ sub_81C6A94: ; 81C6A94 ldr r0, =0x020244ec mov r9, r0 movs r0, 0x14 - bl malloc + bl Alloc adds r7, r0, 0 movs r0, 0xA - bl malloc + bl Alloc adds r5, r0, 0 ldr r1, =0x03005d90 mov r8, r1 @@ -846112,9 +846113,9 @@ sub_81C6A94: ; 81C6A94 movs r2, 0xA bl memcpy adds r0, r7, 0 - bl free + bl Free adds r0, r5, 0 - bl free + bl Free ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] @@ -846147,9 +846148,9 @@ sub_81C6A94: ; 81C6A94 movs r0, 0 strh r0, [r1] adds r0, r7, 0 - bl free + bl Free adds r0, r5, 0 - bl free + bl Free @081C6BC6: add sp, 0x4 pop {r3,r4} @@ -846504,7 +846505,7 @@ sub_81C6E98: ; 81C6E98 push {r4,lr} sub sp, 0x8 movs r0, 0x40 - bl malloc + bl Alloc adds r4, r0, 0 ldr r0, =gUnknown_08D9ADD0 adds r1, r4, 0 @@ -846527,7 +846528,7 @@ sub_81C6E98: ; 81C6E98 mov r0, sp bl gpu_pal_obj_alloc_tag_and_apply adds r0, r4, 0 - bl free + bl Free add sp, 0x8 pop {r4} pop {r0} @@ -846956,12 +846957,12 @@ sub_81C7250: ; 81C7250 push {r4,lr} ldr r4, =0x0203cf40 movs r0, 0x5C - bl malloc + bl Alloc str r0, [r4] cmp r0, 0 bne @081C7270 ldr r0, =sub_8086194 - bl set_callback2 + bl SetMainCallback2 b @081C7292 .pool @081C7270: @@ -846973,7 +846974,7 @@ sub_81C7250: ; 81C7250 movs r1, 0 bl AddTask ldr r0, =sub_81C7400 - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_81C7418 bl SetVBlankCallback @081C7292: @@ -846987,7 +846988,7 @@ sub_81C7250: ; 81C7250 sub_81C72A4: ; 81C72A4 push {lr} ldr r0, =sub_81C72BC - bl set_callback2 + bl SetMainCallback2 movs r0, 0x1 movs r1, 0 bl fade_screen @@ -847008,12 +847009,12 @@ sub_81C72BC: ; 81C72BC bne @081C7320 ldr r4, =0x0203cf40 movs r0, 0x5C - bl malloc + bl Alloc str r0, [r4] cmp r0, 0 bne @081C72F0 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 b @081C7320 .pool @081C72F0: @@ -847030,7 +847031,7 @@ sub_81C72BC: ; 81C72BC movs r1, 0 bl AddTask ldr r0, =sub_81C7400 - bl set_callback2 + bl SetMainCallback2 ldr r0, =sub_81C7418 bl SetVBlankCallback @081C7320: @@ -847052,10 +847053,10 @@ sub_81C7334: ; 81C7334 ble @081C7338 ldr r4, =0x0203cf40 ldr r0, [r4] - bl free + bl Free movs r0, 0 str r0, [r4] - bl init_keypad_data + bl InitKeypadData pop {r4} pop {r0} bx r0 @@ -847298,12 +847299,12 @@ sub_81C742C: ; 81C742C cmp r4, 0 beq @081C755C ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl set_callback2 + bl SetMainCallback2 b @081C7562 .pool @081C755C: ldr r0, =sub_8086194 - bl set_callback2 + bl SetMainCallback2 @081C7562: pop {r4-r7} pop {r0} @@ -847383,7 +847384,7 @@ sub_81C75E0: ; 81C75E0 thumb_func_start sub_81C75F4 sub_81C75F4: ; 81C75F4 push {lr} - bl init_keypad_data + bl InitKeypadData pop {r0} bx r0 thumb_func_end sub_81C75F4 @@ -847411,7 +847412,7 @@ sub_81C761C: ; 81C761C push {r4,lr} adds r4, r0, 0 adds r0, r1, 0 - bl malloc + bl Alloc ldr r1, =0x0203cf40 ldr r1, [r1] lsls r4, 2 @@ -847447,7 +847448,7 @@ sub_81C7650: ; 81C7650 ldr r0, [r1] cmp r0, 0 beq @081C7670 - bl free + bl Free ldr r0, [r5] adds r0, 0x10 adds r0, r4 @@ -847612,14 +847613,14 @@ sub_81C7764: ; 81C7764 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg bl FreeAllWindowBuffers movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0861FA04 movs r0, 0 movs r2, 0x1 - bl bg_vram_setup + bl InitBgsFromTemplates bl sub_8199D98 bl reset_temp_tile_data_buffers movs r0, 0x1 @@ -847638,18 +847639,18 @@ sub_81C7764: ; 81C7764 adds r4, 0x2C movs r0, 0 adds r1, r4, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, =gUnknown_08DC7D84 movs r0, 0 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r0, =gUnknown_08DC7B60 movs r1, 0 movs r2, 0x20 bl sub_81C7944 movs r0, 0 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 b @081C782C .pool @@ -847662,7 +847663,7 @@ sub_81C7764: ; 81C7764 movs r0, 0 b @081C782C @081C780E: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081C781C @@ -847673,7 +847674,7 @@ sub_81C7764: ; 81C7764 bl sub_81C7C28 bl sub_81C7D28 movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg @081C782A: movs r0, 0x4 @081C782C: @@ -847791,7 +847792,7 @@ atk47_cmd47: ; 81C78D4 lsls r1, 1 movs r0, 0 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY ldr r1, =0x00001fff cmp r0, r1 bhi @081C7908 @@ -847803,7 +847804,7 @@ atk47_cmd47: ; 81C78D4 lsls r1, 6 movs r0, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY @081C7914: movs r0, 0x4 @081C7916: @@ -847818,7 +847819,7 @@ sub_81C791C: ; 81C791C lsls r1, 1 movs r0, 0 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY cmp r0, 0 ble @081C7932 movs r0, 0x2 @@ -847827,7 +847828,7 @@ sub_81C791C: ; 81C791C movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x4 @081C793E: pop {r1} @@ -848129,7 +848130,7 @@ sub_81C7B54: ; 81C7B54 @081C7B5E: adds r0, r5, 0 adds r5, 0x4 - bl bg_init_bg_config_2_from_bg_config_3 + bl InitBgFromTemplate subs r4, 0x1 cmp r4, 0 bne @081C7B5E @@ -848195,7 +848196,7 @@ sub_81C7BA4: ; 81C7BA4 thumb_func_start sub_81C7BE8 sub_81C7BE8: ; 81C7BE8 push {lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 pop {r1} @@ -848294,7 +848295,7 @@ sub_81C7CB4: ; 81C7CB4 push {r4,lr} adds r4, r0, 0 movs r0, 0 - bl bg_get_y_offset + bl GetBgY lsrs r0, 8 negs r0, r0 strh r0, [r4, 0x26] @@ -849023,7 +849024,7 @@ sub_81C8234: ; 81C8234 sub_81C8254: ; 81C8254 push {r4,lr} adds r4, r0, 0 - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @081C82C0 @@ -849113,7 +849114,7 @@ sub_81C82E4: ; 81C82E4 ldrb r0, [r5] adds r1, r5, 0 adds r1, 0x88 - bl bg_set_tilemap + bl SetBgTileMap ldrb r0, [r5] movs r1, 0x20 str r1, [sp] @@ -849121,22 +849122,22 @@ sub_81C82E4: ; 81C82E4 adds r1, r4, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 ldrb r0, [r5] movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldrb r0, [r5] movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX ldrb r0, [r5] ldrb r1, [r5, 0x3] lsls r1, 11 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY ldrb r0, [r5] - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x8 pop {r4,r5} pop {r0} @@ -849306,7 +849307,7 @@ sub_81C83F0: ; 81C83F0 movs r0, 0x3 b @081C849C @081C848C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081C849A @@ -849431,7 +849432,7 @@ sub_81C8568: ; 81C8568 adds r5, r0, 0 adds r4, r1, 0 ldrb r0, [r4] - bl bg_get_y_offset + bl GetBgY str r0, [r4, 0x20] lsls r1, r5, 12 adds r0, r1 @@ -849477,7 +849478,7 @@ sub_81C85A0: ; 81C85A0 @081C85C4: movs r6, 0 ldrb r0, [r4] - bl bg_get_y_offset + bl GetBgY adds r5, r0, 0 ldrb r0, [r4] movs r1, 0x80 @@ -849485,7 +849486,7 @@ sub_81C85A0: ; 81C85A0 ldr r2, [r4, 0x30] lsls r2, 24 lsrs r2, 24 - bl bg_change_y_offset + bl ChangeBgY adds r1, r0, 0 ldr r0, [r4, 0x30] cmp r0, 0x2 @@ -849524,7 +849525,7 @@ sub_81C85A0: ; 81C85A0 ldrb r0, [r4] adds r1, r2, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x4 b @081C862A @081C8628: @@ -849895,7 +849896,7 @@ sub_81C8870: ; 81C8870 b @081C894E .pool @081C88D8: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @081C8942 @@ -849923,7 +849924,7 @@ sub_81C8870: ; 81C8870 b @081C88CA .pool @081C8918: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @081C8942 @@ -849964,7 +849965,7 @@ sub_81C8958: ; 81C8958 movs r0, 0x11 bl sub_81C763C adds r4, r0, 0 - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081C8972 @@ -850059,7 +850060,7 @@ sub_81C8A28: ; 81C8A28 push {r4-r7,lr} sub sp, 0x8 adds r5, r0, 0 - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @081C8AA6 @@ -850336,7 +850337,7 @@ sub_81C8C64: ; 81C8C64 bl GetWindowAttribute lsls r0, 24 lsrs r0, 24 - bl bg_get_tilemap + bl GetBgTileMap adds r2, r0, 0 ldrh r0, [r5, 0xA] lsls r0, 6 @@ -852154,14 +852155,14 @@ sub_81C9A10: ; 81C9A10 adds r1, r5, 0 adds r1, 0x8C movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, =gUnknown_08DC9130 movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =gUnknown_08DC90C0 movs r1, 0x10 movs r2, 0x20 @@ -852169,27 +852170,27 @@ sub_81C9A10: ; 81C9A10 movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY @081C9AD6: movs r0, 0 b @081C9C62 @@ -852282,11 +852283,11 @@ sub_81C9A10: ; 81C9A10 b @081C9B9A @081C9BC0: movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg ldrb r0, [r5, 0xD] cmp r0, 0 beq @081C9BE0 @@ -852674,7 +852675,7 @@ sub_81C9EC8: ; 81C9EC8 movs r0, 0 b @081C9EF2 @081C9EE2: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081C9EF0 @@ -852702,7 +852703,7 @@ sub_81C9EF8: ; 81C9EF8 movs r0, 0 b @081C9F22 @081C9F12: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081C9F20 @@ -853358,7 +853359,7 @@ sub_81CA3B4: ; 81CA3B4 ble @081CA3C8 movs r0, 0x52 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg ldr r0, =sub_81CA580 movs r1, 0x3 bl AddTask @@ -853584,10 +853585,10 @@ sub_81CA580: ; 81CA580 movs r1, 0xFC lsls r1, 6 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0x2] adds r0, 0x1 strh r0, [r4, 0x2] @@ -853623,7 +853624,7 @@ sub_81CA580: ; 81CA580 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -853639,7 +853640,7 @@ sub_81CA580: ; 81CA580 movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg adds r0, r5, 0 bl remove_task b @081CA638 @@ -853840,7 +853841,7 @@ sub_81CA770: ; 81CA770 thumb_func_start sub_81CA7C4 sub_81CA7C4: ; 81CA7C4 push {lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 pop {r1} @@ -853880,7 +853881,7 @@ sub_81CA808: ; 81CA808 movs r0, 0x3 movs r1, 0x80 movs r2, 0x1 - bl bg_change_x_offset + bl ChangeBgX pop {r0} bx r0 thumb_func_end sub_81CA808 @@ -854024,23 +854025,23 @@ titlescreen_0: ; 81CA92C push {lr} movs r0, 0x50 movs r1, 0x90 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0x4A movs r1, 0x1F - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0x44 movs r1, 0xA0 - bl lcd_io_set_bits + bl SetGpuRegBits bl remove_some_task bl sub_81CAA3C ldr r2, =gUnknown_08620384 @@ -854063,11 +854064,11 @@ sub_81CA994: ; 81CA994 push {lr} movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits bl remove_some_task ldr r0, =sub_81CA9EC bl get_task_id_by_function @@ -854085,7 +854086,7 @@ sub_81CA9C8: ; 81CA9C8 push {lr} movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 thumb_func_end sub_81CA9C8 @@ -854096,7 +854097,7 @@ sub_81CA9D8: ; 81CA9D8 bl sub_81CAA3C movs r0, 0x50 movs r1, 0x90 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 thumb_func_end sub_81CA9D8 @@ -854135,7 +854136,7 @@ sub_81CA9EC: ; 81CA9EC lsls r1, 16 lsrs r1, 16 movs r0, 0x54 - bl lcd_io_set + bl SetGpuReg @081CAA30: pop {r0} bx r0 @@ -855374,11 +855375,11 @@ sub_81CB324: ; 81CB324 movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r1, =gUnknown_08622530 movs r0, 0 str r0, [sp] @@ -855389,14 +855390,14 @@ sub_81CB324: ; 81CB324 ldr r0, =0x00001024 adds r1, r5, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, =gUnknown_086225D4 movs r0, 0x2 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =gUnknown_08622510 movs r1, 0x20 movs r2, 0x20 @@ -855419,7 +855420,7 @@ sub_81CB324: ; 81CB324 adds r1, r5, 0 adds r1, 0x24 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap movs r1, 0x80 lsls r1, 5 movs r0, 0x20 @@ -855429,14 +855430,14 @@ sub_81CB324: ; 81CB324 movs r0, 0x1 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 ldr r0, =gUnknown_086226E0 movs r1, 0x10 movs r2, 0x20 bl sub_81C7944 movs r0, 0x1 @081CB418: - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 b @081CB506 .pool @@ -855496,17 +855497,17 @@ sub_81CB324: ; 81CB324 movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg bl sub_81CC214 movs r0, 0x3 bl sub_81C7DFC @@ -855594,7 +855595,7 @@ sub_81CB510: ; 81CB510 movs r0, 0 b @081CB582 @081CB572: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081CB580 @@ -855663,7 +855664,7 @@ sub_81CB588: ; 81CB588 movs r0, 0 b @081CB5FA @081CB5EA: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081CB5F8 @@ -855732,7 +855733,7 @@ sub_81CB600: ; 81CB600 movs r0, 0 b @081CB672 @081CB662: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081CB670 @@ -855801,7 +855802,7 @@ sub_81CB678: ; 81CB678 movs r0, 0 b @081CB6EA @081CB6DA: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081CB6E8 @@ -856101,7 +856102,7 @@ sub_81CB888: ; 81CB888 movs r6, 0x1 b @081CB934 @081CB922: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @081CB8EC @@ -856302,7 +856303,7 @@ sub_81CBA68: ; 81CBA68 movs r0, 0 b @081CBACE @081CBABE: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081CBACC @@ -856578,7 +856579,7 @@ sub_81CBCEC: ; 81CBCEC bl GetWindowAttribute lsls r0, 24 lsrs r0, 24 - bl bg_get_tilemap + bl GetBgTileMap adds r6, r0, 0 lsls r4, 7 adds r4, 0x3A @@ -856622,7 +856623,7 @@ sub_81CBD48: ; 81CBD48 bl GetWindowAttribute lsls r0, 24 lsrs r0, 24 - bl bg_get_tilemap + bl GetBgTileMap lsls r4, 7 adds r4, 0x3A adds r0, r4 @@ -856932,7 +856933,7 @@ sub_81CBF60: ; 81CBF60 sub_81CBFC4: ; 81CBFC4 push {r4,lr} adds r4, r0, 0 - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081CBFD6 @@ -856967,7 +856968,7 @@ sub_81CBFF0: ; 81CBFF0 thumb_func_start sub_81CC004 sub_81CC004: ; 81CC004 push {lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 pop {r1} @@ -857068,7 +857069,7 @@ sub_81CC09C: ; 81CC09C thumb_func_start sub_81CC0D0 sub_81CC0D0: ; 81CC0D0 push {lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 pop {r1} @@ -857221,9 +857222,9 @@ sub_81CC1DC: ; 81CC1DC movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x8 pop {r0} bx r0 @@ -857232,7 +857233,7 @@ sub_81CC1DC: ; 81CC1DC thumb_func_start sub_81CC204 sub_81CC204: ; 81CC204 push {lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 pop {r1} @@ -857820,7 +857821,7 @@ sub_81CC670: ; 81CC670 bl sub_81C7650 bl sub_81C760C movs r0, 0 - bl call_gpu_set_bg_mode + bl SetBgMode pop {r4} pop {r0} bx r0 @@ -857900,13 +857901,13 @@ sub_81CC6F4: ; 81CC6F4 movs r0, 0 bl c3args_set_0toR1_1to0 movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x2 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 - bl call_gpu_set_bg_mode + bl SetBgMode ldr r4, =gUnknown_086230D8 adds r0, r4, 0 movs r1, 0x2 @@ -857974,9 +857975,9 @@ sub_81CC6F4: ; 81CC6F4 cmp r0, 0 bne @081CC83A movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg ldr r0, =sub_81CC6A4 bl c3args_set_0toR1_1to0 b @081CC77C @@ -858201,11 +858202,11 @@ sub_81CC95C: ; 81CC95C b @081CC9BA @081CC9A2: movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x2 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0 b @081CC9BA @081CC9B8: @@ -858288,7 +858289,7 @@ sub_81CCA1C: ; 81CCA1C bl CpuSet movs r0, 0x1 adds r1, r4, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r0, =gUnknown_08623110 bl AddWindow movs r4, 0 @@ -858331,19 +858332,19 @@ sub_81CCA1C: ; 81CCA1C ldr r1, =0xffffa000 movs r0, 0x1 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY b @081CCAEA .pool @081CCAE0: movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY @081CCAEA: movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX add sp, 0x8 pop {r4,r5} pop {r0} @@ -858450,7 +858451,7 @@ sub_81CCB0C: ; 81CCB0C movs r0, 0x1 movs r2, 0x11 movs r3, 0x6 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect b @081CCC0C .pool @081CCBDC: @@ -858492,9 +858493,9 @@ sub_81CCB0C: ; 81CCB0C movs r0, 0x1 movs r2, 0x11 movs r3, 0x4 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0x1 bl sub_81CCFA4 @081CCC40: @@ -858508,7 +858509,7 @@ sub_81CCB0C: ; 81CCB0C thumb_func_start sub_81CCC4C sub_81CCC4C: ; 81CCC4C push {lr} - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 lsrs r0, 24 pop {r1} @@ -858567,13 +858568,13 @@ sub_81CCC9C: ; 81CCC9C lsls r1, 3 movs r0, 0x1 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY cmp r0, 0 blt @081CCCD6 movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY adds r0, r4, 0 bl remove_task @081CCCD6: @@ -858585,13 +858586,13 @@ sub_81CCC9C: ; 81CCC9C lsls r1, 3 movs r0, 0x1 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY ldr r1, =0xffffa000 cmp r0, r1 bgt @081CCD00 movs r0, 0x1 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY adds r0, r5, 0 bl remove_task @081CCD00: @@ -858693,7 +858694,7 @@ sub_81CCD70: ; 81CCD70 movs r0, 0x1 movs r2, 0x11 movs r3, 0x6 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r0, 0xC8 adds r1, r4, 0 muls r1, r0 @@ -858706,7 +858707,7 @@ sub_81CCD70: ; 81CCD70 movs r0, 0x1 movs r2, 0x12 movs r3, 0x6 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect @081CCDD4: add sp, 0x8 pop {r4-r6} @@ -858926,7 +858927,7 @@ sub_81CCF78: ; 81CCF78 bl sub_81C763C adds r4, r0, 0 movs r0, 0x1 - bl bg_get_y_offset + bl GetBgY asrs r0, 8 movs r1, 0x84 subs r1, r0 @@ -860857,36 +860858,36 @@ sub_81CDE94: ; 81CDE94 movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x3 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r1, =0x00007940 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000844 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000040b movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldr r1, =gUnknown_08DC6548 movs r0, 0 str r0, [sp] @@ -860925,7 +860926,7 @@ sub_81CDE94: ; 81CDE94 bl LZ77UnCompVram movs r0, 0x3 adds r1, r4, 0 - bl bg_set_tilemap + bl SetBgTileMap bl sub_81CDD5C cmp r0, 0x1 bne @081CDFF2 @@ -860937,10 +860938,10 @@ sub_81CDE94: ; 81CDE94 movs r0, 0x3 movs r2, 0 movs r3, 0x5 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect @081CDFF2: movs r0, 0x3 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =gUnknown_08DC6528 movs r1, 0x10 movs r2, 0x20 @@ -860969,9 +860970,9 @@ sub_81CDE94: ; 81CDE94 bl LZ77UnCompVram movs r0, 0x2 adds r1, r4, 0 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0x2 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =gUnknown_086231E8 movs r1, 0x30 movs r2, 0x20 @@ -861001,7 +861002,7 @@ sub_81CDE94: ; 81CDE94 bl CpuSet movs r0, 0x1 adds r1, r4, 0 - bl bg_set_tilemap + bl SetBgTileMap b @081CDFB0 .pool @081CE0B0: @@ -861120,11 +861121,11 @@ sub_81CDE94: ; 81CDE94 .pool @081CE1C8: movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg bl sub_81CDD5C cmp r0, 0x1 beq @081CE1E4 @@ -861296,11 +861297,11 @@ sub_81CE2D0: ; 81CE2D0 adds r0, r5, r1 bl sub_81D354C movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x2 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 b @081CE376 .pool @@ -862442,7 +862443,7 @@ sub_81CECA0: ; 81CECA0 movs r1, 0x8A lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg adds r0, r4, 0 bl sub_81CEBF4 bl sub_81CEE68 @@ -862614,11 +862615,11 @@ sub_81CEE74: ; 81CEE74 cmp r0, 0 beq @081CEE84 movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg b @081CEE8A @081CEE84: movs r0, 0x2 - bl gpu_sync_bg_hide + bl HideBg @081CEE8A: pop {r0} bx r0 @@ -863412,20 +863413,20 @@ sub_81CF418: ; 81CF418 adds r1, r5, 0 adds r1, 0x10 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, =gUnknown_086234AC movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram ldr r0, =gUnknown_086233C4 movs r1, 0x10 movs r2, 0x20 bl sub_81C7944 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @081CF498: movs r0, 0 b @081CF570 @@ -863468,17 +863469,17 @@ sub_81CF418: ; 81CF418 movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg ldr r0, [r5, 0xC] cmp r0, 0 bne @081CF552 @@ -863573,7 +863574,7 @@ sub_81CF578: ; 81CF578 movs r0, 0 b @081CF5E8 @081CF5D8: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081CF5E6 @@ -863641,7 +863642,7 @@ sub_81CF5F0: ; 81CF5F0 movs r0, 0 b @081CF660 @081CF650: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081CF65E @@ -863709,7 +863710,7 @@ sub_81CF668: ; 81CF668 movs r0, 0 b @081CF6D8 @081CF6C8: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081CF6D6 @@ -863777,7 +863778,7 @@ sub_81CF6E0: ; 81CF6E0 movs r0, 0 b @081CF750 @081CF740: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081CF74E @@ -864798,18 +864799,18 @@ sub_81CFEB8: ; 81CFEB8 adds r1, r5, 0 adds r1, 0x10 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, =gUnknown_086236CC movs r0, 0x1 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r0, =gUnknown_086235E4 movs r1, 0x10 movs r2, 0x20 bl sub_81C7944 movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @081CFF32: movs r0, 0 b @081CFFF4 @@ -864825,13 +864826,13 @@ sub_81CFEB8: ; 81CFEB8 movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg b @081CFF32 @081CFF76: bl free_temp_tile_data_buffers_if_possible @@ -864858,9 +864859,9 @@ sub_81CFEB8: ; 81CFEB8 cmp r0, 0 bne @081CFFEE movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x9 bl sub_81C7BA4 movs r0, 0x1 @@ -864947,7 +864948,7 @@ sub_81CFFFC: ; 81CFFFC movs r0, 0 b @081D006C @081D005C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081D006A @@ -865015,7 +865016,7 @@ sub_81D0074: ; 81D0074 movs r0, 0 b @081D00E4 @081D00D4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081D00E2 @@ -865083,7 +865084,7 @@ sub_81D00EC: ; 81D00EC movs r0, 0 b @081D015C @081D014C: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081D015A @@ -865151,7 +865152,7 @@ sub_81D0164: ; 81D0164 movs r0, 0 b @081D01D4 @081D01C4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081D01D2 @@ -866335,12 +866336,12 @@ sub_81D0A6C: ; 81D0A6C adds r1, r5, 0 adds r1, 0x1C movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, =gUnknown_08DDE12C movs r0, 0x2 movs r2, 0 movs r3, 0 - bl gpu_copy_to_wram_bg_tile_map + bl CopyToBgTileMapBuffer ldr r0, =gUnknown_08DDE010 movs r1, 0x10 movs r2, 0x20 @@ -866369,7 +866370,7 @@ sub_81D0A6C: ; 81D0A6C ldr r0, =0x0000081c adds r1, r5, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap movs r0, 0x20 str r0, [sp] movs r0, 0x14 @@ -866378,7 +866379,7 @@ sub_81D0A6C: ; 81D0A6C movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 ldr r0, =gUnknown_08623FF8 movs r1, 0x20 movs r2, 0xA0 @@ -866418,18 +866419,18 @@ sub_81D0A6C: ; 81D0A6C movs r0, 0 b @081D0C4A @081D0BB0: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @081D0C44 @081D0BBA: movs r0, 0x2 @081D0BBC: - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram movs r0, 0 b @081D0C4A @081D0BC4: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @081D0C44 @@ -866445,7 +866446,7 @@ sub_81D0A6C: ; 81D0A6C movs r0, 0 b @081D0C4A @081D0BE8: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @081D0C44 @@ -866454,25 +866455,25 @@ sub_81D0A6C: ; 81D0A6C movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_hide + bl HideBg movs r0, 0x1 bl sub_81C7AC0 movs r0, 0 @@ -866577,7 +866578,7 @@ sub_81D0C84: ; 81D0C84 movs r0, 0x1 b @081D0D26 @081D0D02: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 bne @081D0D20 @@ -866638,7 +866639,7 @@ sub_81D0D2C: ; 81D0D2C movs r0, 0 b @081D0D86 @081D0D76: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081D0D84 @@ -866699,7 +866700,7 @@ sub_81D0D8C: ; 81D0D8C movs r0, 0 b @081D0DF8 @081D0DE8: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081D0DF6 @@ -866751,7 +866752,7 @@ sub_81D0E00: ; 81D0E00 movs r0, 0 b @081D0E5A @081D0E4A: - bl is_dma3_queue_busy_with_gpu_copy + bl IsDma3ManagerBusyWithBgCopy lsls r0, 24 cmp r0, 0 beq @081D0E58 @@ -867367,7 +867368,7 @@ sub_81D12D8: ; 81D12D8 bcc @081D1322 @081D133A: movs r0, 0x1 - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram pop {r4-r6} pop {r0} bx r0 @@ -867386,7 +867387,7 @@ sub_81D1350: ; 81D1350 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 add sp, 0x8 pop {r0} bx r0 @@ -867423,7 +867424,7 @@ sub_81D1370: ; 81D1370 add r1, sp, 0x8 adds r2, r5, 0 adds r3, r4, 0 - bl gpu_copy_to_iwram_tile_map_rect + bl CopyToBgTileMapBufferRect add sp, 0x10 pop {r4-r6} pop {r0} @@ -868679,7 +868680,7 @@ sub_81D1C44: ; 81D1C44 ldr r4, =0x0203cf4c lsrs r0, 21 adds r0, 0x8 - bl malloc + bl Alloc str r0, [r4] cmp r0, 0 bne @081D1C60 @@ -868987,7 +868988,7 @@ sub_81D1EC0: ; 81D1EC0 push {lr} ldr r0, =0x0203cf4c ldr r0, [r0] - bl free + bl Free pop {r0} bx r0 .pool @@ -869411,23 +869412,23 @@ sub_81D21DC: ; 81D21DC bics r5, r0 movs r0, 0x40 movs r1, 0xF0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x42 movs r1, 0x9B - bl lcd_io_set + bl SetGpuReg ldr r4, =0x00003879 movs r0, 0x44 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x46 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00003f3f movs r0, 0x48 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg pop {r4,r5} pop {r0} bx r0 @@ -872648,14 +872649,14 @@ sub_81D3AB0: ; 81D3AB0 adds r4, r0, 0 movs r0, 0x80 lsls r0, 5 - bl malloc_and_clear + bl AllocZeroed adds r5, r0, 0 adds r0, r4, 0 adds r1, r5, 0 bl sub_81D3998 adds r4, r0, 0 adds r0, r5, 0 - bl free + bl Free adds r0, r4, 0 pop {r4,r5} pop {r1} @@ -872696,14 +872697,14 @@ sub_81D3B0C: ; 81D3B0C adds r4, r0, 0 movs r0, 0x80 lsls r0, 5 - bl malloc_and_clear + bl AllocZeroed adds r5, r0, 0 adds r0, r4, 0 adds r1, r5, 0 bl sub_81D3AD8 adds r4, r0, 0 adds r0, r5, 0 - bl free + bl Free adds r0, r4, 0 pop {r4,r5} pop {r1} @@ -872715,12 +872716,12 @@ sub_81D3B34: ; 81D3B34 push {r4,r5,lr} movs r0, 0x80 lsls r0, 5 - bl malloc_and_clear + bl AllocZeroed adds r4, r0, 0 bl sub_81D3B0C adds r5, r0, 0 adds r0, r4, 0 - bl free + bl Free adds r0, r5, 0 pop {r4,r5} pop {r1} @@ -874955,7 +874956,7 @@ sub_81D4DB8: ; 81D4DB8 strh r0, [r4] bl sub_81D4238 bl sub_81D41F4 - bl restore_serial_timer3_irq_handlers + bl RestoreSerialTimer3IntrHandlers mov r0, sp ldrh r0, [r0] strh r0, [r4] @@ -875269,7 +875270,7 @@ sub_81D5014: ; 81D5014 strh r0, [r4, 0x6] strb r1, [r4, 0xE] movs r0, 0x40 - bl malloc_and_clear + bl AllocZeroed str r0, [r4, 0x10] pop {r4} pop {r0} @@ -875737,11 +875738,11 @@ sub_81D5084: ; 81D5084 .pool @081D5478: ldr r0, [r4, 0x10] - bl free + bl Free adds r0, r5, 0 bl remove_task ldr r0, =sub_80186A4 - bl set_callback2 + bl SetMainCallback2 @081D548A: pop {r4,r5} pop {r0} @@ -875912,7 +875913,7 @@ sub_81D55D0: ; 81D55D0 bl sub_81D56B0 ldr r4, =0x0203cf58 movs r0, 0x18 - bl malloc_and_clear + bl AllocZeroed str r0, [r4] movs r6, 0 ldr r0, =0x0203cf54 @@ -876001,7 +876002,7 @@ sub_81D5694: ; 81D5694 ldr r0, [r4] cmp r0, 0 beq @081D56A6 - bl free + bl Free movs r0, 0 str r0, [r4] @081D56A6: @@ -876019,7 +876020,7 @@ sub_81D56B0: ; 81D56B0 cmp r0, 0 bne @081D56EC ldr r0, =0x00000eec - bl malloc_and_clear + bl AllocZeroed str r0, [r4] ldr r1, =0x02037318 ldrb r1, [r1, 0x12] @@ -876054,7 +876055,7 @@ sub_81D5710: ; 81D5710 ldr r0, [r4] cmp r0, 0 beq @081D5722 - bl free + bl Free movs r0, 0 str r0, [r4] @081D5722: @@ -878009,7 +878010,7 @@ sub_81D6720: ; 81D6720 lsrs r5, 24 ldr r6, =0x0203cf60 ldr r0, =0x00002018 - bl malloc_and_clear + bl AllocZeroed str r0, [r6] ldr r1, =0x00002006 adds r0, r1 @@ -878021,7 +878022,7 @@ sub_81D6720: ; 81D6720 adds r0, r1 strb r5, [r0] ldr r0, =sub_81D6774 - bl set_callback2 + bl SetMainCallback2 pop {r3} mov r8, r3 pop {r4-r6} @@ -878056,7 +878057,7 @@ sub_81D6774: ; 81D6774 movs r1, 0 bl AddTask ldr r0, =sub_81D67D0 - bl set_callback2 + bl SetMainCallback2 pop {r0} bx r0 .pool @@ -878100,9 +878101,9 @@ sub_81D6800: ; 81D6800 ldr r4, =0x0203cf60 ldr r0, [r4] ldr r0, [r0] - bl set_callback2 + bl SetMainCallback2 ldr r0, [r4] - bl free + bl Free adds r0, r5, 0 bl remove_task @081D6830: @@ -878176,16 +878177,16 @@ sub_81D68C8: ; 81D68C8 push {lr} movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x40 movs r1, 0xF0 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00001888 movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x02037714 movs r1, 0 strh r1, [r0] @@ -878201,10 +878202,10 @@ sub_81D6904: ; 81D6904 push {lr} movs r0, 0x48 movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x3F - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 thumb_func_end sub_81D6904 @@ -879058,26 +879059,26 @@ sub_81D6FE0: ; 81D6FE0 push {r4,lr} bl sub_8121DA0 movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0862A888 movs r0, 0 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00000804 adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00001004 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap bl sub_8121E10 movs r0, 0 bl schedule_bg_copy_tilemap_to_vram @@ -879088,16 +879089,16 @@ sub_81D6FE0: ; 81D6FE0 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -879478,7 +879479,7 @@ sub_81D736C: ; 81D736C movs r1, 0x91 lsls r1, 2 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg adds r2, r7, 0 subs r2, 0x8 movs r0, 0x2 @@ -879625,12 +879626,12 @@ sub_81D750C: ; 81D750C lsls r1, 3 movs r0, 0x2 movs r2, 0x1 - bl bg_change_x_offset + bl ChangeBgX movs r1, 0x80 lsls r1, 4 movs r0, 0x2 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY pop {r0} bx r0 thumb_func_end sub_81D750C @@ -879661,11 +879662,11 @@ sub_81D752C: ; 81D752C adds r0, r4 bl sub_81D7D14 movs r0, 0x1 - bl bg_get_y_offset + bl GetBgY lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x1 - bl bg_get_y_offset + bl GetBgY cmp r0, 0 beq @081D757A movs r0, 0x80 @@ -879677,7 +879678,7 @@ sub_81D752C: ; 81D752C lsls r1, 3 movs r0, 0x1 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY @081D7586: ldrh r2, [r5] movs r1, 0 @@ -879693,7 +879694,7 @@ sub_81D752C: ; 81D752C lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @081D75A6: pop {r4,r5} pop {r0} @@ -879761,7 +879762,7 @@ sub_81D7600: ; 81D7600 movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0 bl SetVBlankCallback bl remove_some_task @@ -880750,26 +880751,26 @@ sub_81D7E10: ; 81D7E10 push {r4,lr} bl sub_8121DA0 movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0862AA54 movs r0, 0x1 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00000804 adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00001004 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap bl sub_8121E10 movs r0, 0 bl schedule_bg_copy_tilemap_to_vram @@ -880780,16 +880781,16 @@ sub_81D7E10: ; 81D7E10 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -880873,10 +880874,10 @@ sub_81D7F4C: ; 81D7F4C movs r1, 0x94 lsls r1, 2 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000808 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 negs r0, r0 movs r1, 0x10 @@ -881019,7 +881020,7 @@ sub_81D7FC0: ; 81D7FC0 str r0, [sp, 0xC] movs r0, 0x2 movs r3, 0x78 - bl call_gpu_bg_affine_set + bl SetBgAffine b @081D815A @081D80A4: ldrh r0, [r4, 0x2] @@ -881048,7 +881049,7 @@ sub_81D7FC0: ; 81D7FC0 str r5, [sp, 0xC] movs r0, 0x2 movs r3, 0x78 - bl call_gpu_bg_affine_set + bl SetBgAffine ldrh r0, [r4, 0xE] ldrh r1, [r4, 0xC] adds r0, r1 @@ -881106,7 +881107,7 @@ sub_81D7FC0: ; 81D7FC0 str r0, [sp, 0xC] movs r0, 0x2 movs r3, 0x78 - bl call_gpu_bg_affine_set + bl SetBgAffine adds r0, r6, 0 bl sub_81D8164 @081D815A: @@ -881284,31 +881285,31 @@ sub_81D82B0: ; 81D82B0 push {r4,lr} bl sub_8121DA0 movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0862AACC movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00000804 adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00001004 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00001804 adds r1, r0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap bl sub_8121E10 movs r0, 0 bl schedule_bg_copy_tilemap_to_vram @@ -881321,18 +881322,18 @@ sub_81D82B0: ; 81D82B0 movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -881422,7 +881423,7 @@ sub_81D8358: ; 81D8358 sub_81D844C: ; 81D844C push {r4,r5,lr} movs r0, 0x6 - bl lcd_io_get + bl GetGpuReg lsls r0, 16 lsrs r2, r0, 16 adds r1, r2, 0 @@ -881507,13 +881508,13 @@ sub_81D84EC: ; 81D84EC bl sub_81D8358 ldr r1, =0x00001e41 movs r0, 0x50 - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0x80 lsls r0, 5 mov r8, r0 movs r0, 0x52 mov r1, r8 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 negs r0, r0 movs r1, 0x10 @@ -881613,7 +881614,7 @@ sub_81D857C: ; 81D857C ldr r0, =sub_81D844C bl SetHBlankCallback movs r0, 0x3 - bl enable_irqs + bl EnableInterrupts b @081D8674 .pool @081D8614: @@ -881891,31 +881892,31 @@ sub_81D8828: ; 81D8828 push {r4,lr} bl sub_8121DA0 movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0862AB44 movs r0, 0 movs r2, 0x4 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00000804 adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00001004 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00001804 adds r1, r0 movs r0, 0x3 - bl bg_set_tilemap + bl SetBgTileMap bl sub_8121E10 movs r0, 0 bl schedule_bg_copy_tilemap_to_vram @@ -881928,18 +881929,18 @@ sub_81D8828: ; 81D8828 movs r1, 0xC1 lsls r1, 6 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x3 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -882192,7 +882193,7 @@ sub_81D8AD8: ; 81D8AD8 lsls r1, 8 movs r0, 0x1 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX bl GenerateRandomNumber ands r4, r0 subs r4, 0x4 @@ -882200,7 +882201,7 @@ sub_81D8AD8: ; 81D8AD8 movs r0, 0x1 adds r1, r4, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY @081D8B1C: ldrh r0, [r5, 0x1E] adds r0, 0x1 @@ -882228,11 +882229,11 @@ sub_81D8B2C: ; 81D8B2C movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] @@ -882251,13 +882252,13 @@ sub_81D8B2C: ; 81D8B2C lsls r1, 8 movs r0, 0x1 movs r2, 0x2 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 ldrsh r1, [r4, r0] lsls r1, 8 movs r0, 0x1 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY ldrh r0, [r4, 0x4] ldrh r1, [r4, 0x2] adds r0, r1 @@ -882287,21 +882288,21 @@ sub_81D8BB4: ; 81D8BB4 movs r0, 0x2 adds r1, r4, 0 movs r2, 0x2 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x2 adds r1, r4, 0 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY movs r4, 0x80 lsls r4, 4 movs r0, 0 adds r1, r4, 0 movs r2, 0x2 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 adds r1, r4, 0 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY pop {r4} pop {r0} bx r0 @@ -882346,26 +882347,26 @@ sub_81D8C38: ; 81D8C38 push {r4,lr} bl sub_8121DA0 movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0862AD08 movs r0, 0x1 movs r2, 0x3 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 movs r0, 0 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00000804 adds r1, r0 movs r0, 0x1 - bl bg_set_tilemap + bl SetBgTileMap ldr r1, [r4] ldr r0, =0x00001004 adds r1, r0 movs r0, 0x2 - bl bg_set_tilemap + bl SetBgTileMap bl sub_8121E10 movs r0, 0 bl schedule_bg_copy_tilemap_to_vram @@ -882376,16 +882377,16 @@ sub_81D8C38: ; 81D8C38 movs r1, 0xC1 lsls r1, 6 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x2 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg pop {r4} pop {r0} bx r0 @@ -882477,13 +882478,13 @@ sub_81D8DB4: ; 81D8DB4 movs r1, 0x80 lsls r1, 3 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits ldr r1, =0x00000241 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x00000e09 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 negs r0, r0 movs r1, 0x10 @@ -882721,7 +882722,7 @@ sub_81D8FB0: ; 81D8FB0 ands r0, r2 orrs r1, r0 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2] ldrh r0, [r4, 0x6] subs r1, r0 @@ -883858,11 +883859,11 @@ sub_81D98B4: ; 81D98B4 movs r0, 0x2 adds r1, r2, 0 movs r3, 0x78 - bl call_gpu_bg_affine_set + bl SetBgAffine movs r1, 0x80 lsls r1, 3 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits movs r0, 0x10 strh r0, [r4, 0x8] b @081D9922 @@ -883930,7 +883931,7 @@ sub_81D98B4: ; 81D98B4 movs r0, 0x2 adds r1, r2, 0 movs r3, 0x78 - bl call_gpu_bg_affine_set + bl SetBgAffine movs r1, 0x2 ldrsh r0, [r4, r1] cmp r0, 0xFF @@ -883948,7 +883949,7 @@ sub_81D98B4: ; 81D98B4 movs r1, 0x80 lsls r1, 3 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits adds r0, r5, 0 bl remove_task @081D99B4: @@ -884049,7 +884050,7 @@ sub_81D9A1C: ; 81D9A1C ldr r0, =sub_80AF168 str r0, [r1] ldr r0, =c2_exit_to_overworld_2_switch - bl set_callback2 + bl SetMainCallback2 pop {r4,r5} pop {r0} bx r0 @@ -886085,24 +886086,24 @@ sub_81DAACC: ; 81DAACC bl sub_81DA700 ldr r1, =0x00003f41 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r1, 0xA0 lsls r1, 3 movs r0, 0 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0 strh r0, [r4, 0xA] ldrh r0, [r4, 0x8] @@ -886115,15 +886116,15 @@ sub_81DAACC: ; 81DAACC movs r1, 0x80 lsls r1, 6 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits movs r1, 0x80 lsls r1, 7 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits movs r1, 0x80 lsls r1, 1 movs r0, 0 - bl lcd_io_clear_bits + bl ResetGpuRegBits ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] @@ -886146,7 +886147,7 @@ sub_81DAB4C: ; 81DAB4C movs r1, 0x80 lsls r1, 1 movs r0, 0 - bl lcd_io_set_bits + bl SetGpuRegBits @081DAB64: ldrh r1, [r4, 0xC] movs r2, 0xC @@ -886185,7 +886186,7 @@ sub_81DAB4C: ; 81DAB4C lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @081DABB0: movs r0, 0 add sp, 0x4 diff --git a/asm/gpu_bg.s b/asm/gpu_bg.s index 909381c98..c2d963058 100644 --- a/asm/gpu_bg.s +++ b/asm/gpu_bg.s @@ -1,20 +1,20 @@ - thumb_func_start gpu_init_bgs -; void gpu_init_bgs() -gpu_init_bgs: ; 80012F0 + thumb_func_start ResetBgs +; void ResetBgs() +ResetBgs: ; 80012F0 push {lr} - bl gpu_reset_bg_configs + bl ResetWramBgControlStructs ldr r1, =0x030008e0 movs r0, 0 strh r0, [r1, 0x10] - bl gpu_sync_text_mode_and_hide_bgs + bl SetTextModeAndHideBgs pop {r0} bx r0 .pool - thumb_func_end gpu_init_bgs + thumb_func_end ResetBgs - thumb_func_start gpu_set_bg_mode -; void gpu_set_bg_mode(u8 bg_mode) -gpu_set_bg_mode: ; 8001308 + thumb_func_start SetBgModeInternal +; void SetBgModeInternal(u8 bgMode) +SetBgModeInternal: ; 8001308 lsls r0, 24 lsrs r0, 24 ldr r3, =0x030008e0 @@ -25,22 +25,22 @@ gpu_set_bg_mode: ; 8001308 strh r1, [r3, 0x10] bx lr .pool - thumb_func_end gpu_set_bg_mode + thumb_func_end SetBgModeInternal - thumb_func_start gpu_get_bg_mode -; u8 gpu_get_bg_mode() -gpu_get_bg_mode: ; 8001324 + thumb_func_start GetBgMode +; u8 GetBgMode() +GetBgMode: ; 8001324 ldr r0, =0x030008e0 ldrb r1, [r0, 0x10] movs r0, 0x7 ands r0, r1 bx lr .pool - thumb_func_end gpu_get_bg_mode + thumb_func_end GetBgMode - thumb_func_start gpu_reset_bg_configs -; void gpu_reset_bg_configs() -gpu_reset_bg_configs: ; 8001334 + thumb_func_start ResetWramBgControlStructs +; void ResetWramBgControlStructs() +ResetWramBgControlStructs: ; 8001334 push {lr} ldr r2, =0x030008e0 ldr r0, =gBgConfigZeroValue @@ -55,15 +55,16 @@ gpu_reset_bg_configs: ; 8001334 pop {r0} bx r0 .pool - thumb_func_end gpu_reset_bg_configs + thumb_func_end ResetWramBgControlStructs - thumb_func_start sub_8001354 -sub_8001354: ; 8001354 + thumb_func_start Unused_ResetWramBgControlStruct +; void Unused_ResetWramBgControlStruct(u8 bg) +Unused_ResetWramBgControlStruct: ; 8001354 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl is_invalid_bg_id + bl IsInvalidBg lsls r0, 24 cmp r0, 0 bne @08001372 @@ -78,11 +79,11 @@ sub_8001354: ; 8001354 pop {r0} bx r0 .pool - thumb_func_end sub_8001354 + thumb_func_end Unused_ResetWramBgControlStruct - 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 + thumb_func_start SetBgControlAttributes +; void SetBgControlAttributes(u8 bg, u8 tilesBaseBlock, u8 tileMapBaseBlock, u8 screenSize, u8 paletteMode, u8 priority, u8 mosaic, u8 wraparound) +SetBgControlAttributes: ; 8001380 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -119,7 +120,7 @@ gpu_bg_config_set_fields: ; 8001380 lsrs r1, 24 str r1, [sp, 0xC] adds r0, r7, 0 - bl is_invalid_bg_id + bl IsInvalidBg lsls r0, 24 lsrs r0, 24 mov r12, r0 @@ -239,18 +240,18 @@ gpu_bg_config_set_fields: ; 8001380 pop {r0} bx r0 .pool - thumb_func_end gpu_bg_config_set_fields + thumb_func_end SetBgControlAttributes - 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 + thumb_func_start GetBgControlAttribute +; u8 GetBgControlAttribute(u8 bg, u8 attributeId) +GetBgControlAttribute: ; 80014AC push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 lsls r1, 24 lsrs r5, r1, 24 adds r0, r4, 0 - bl is_invalid_bg_id + bl IsInvalidBg lsls r0, 24 cmp r0, 0 bne @08001558 @@ -333,11 +334,11 @@ gpu_bg_config_get_field: ; 80014AC pop {r4,r5} pop {r1} bx r1 - thumb_func_end gpu_bg_config_get_field + thumb_func_end GetBgControlAttribute - 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 + thumb_func_start LoadBgVram +; u8 LoadBgVram(u8, void *src, u16 size, u16 destOffset, u8 mode) +LoadBgVram: ; 8001560 push {r4-r7,lr} mov r7, r8 push {r7} @@ -352,7 +353,7 @@ gpu_copy_to_vram_by_bg_id: ; 8001560 lsls r1, 24 lsrs r5, r1, 24 adds r0, r4, 0 - bl is_invalid_bg_id + bl IsInvalidBg lsls r0, 24 cmp r0, 0 bne @080015D8 @@ -409,16 +410,16 @@ gpu_copy_to_vram_by_bg_id: ; 8001560 pop {r4-r7} pop {r1} bx r1 - thumb_func_end gpu_copy_to_vram_by_bg_id + thumb_func_end LoadBgVram - thumb_func_start gpu_bg_show -; void gpu_bg_show(u8 bg_id) -gpu_bg_show: ; 80015E8 + thumb_func_start ShowBgInternal +; void ShowBgInternal(u8 bg) +ShowBgInternal: ; 80015E8 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl is_invalid_bg_id + bl IsInvalidBg lsls r0, 24 cmp r0, 0 bne @08001656 @@ -457,7 +458,7 @@ gpu_bg_show: ; 80015E8 lsls r2, 20 adds r0, r2 lsrs r0, 24 - bl lcd_io_set + bl SetGpuReg adds r1, r4, 0 adds r1, 0x8 movs r0, 0x1 @@ -472,16 +473,16 @@ gpu_bg_show: ; 80015E8 pop {r0} bx r0 .pool - thumb_func_end gpu_bg_show + thumb_func_end ShowBgInternal - thumb_func_start gpu_bg_hide -; void gpu_bg_hide(u8 bg_id) -gpu_bg_hide: ; 8001664 + thumb_func_start HideBgInternal +; void HideBgInternal(u8 bg) +HideBgInternal: ; 8001664 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl is_invalid_bg_id + bl IsInvalidBg lsls r0, 24 cmp r0, 0 bne @0800168A @@ -500,44 +501,44 @@ gpu_bg_hide: ; 8001664 pop {r0} bx r0 .pool - thumb_func_end gpu_bg_hide + thumb_func_end HideBgInternal - thumb_func_start gpu_sync_bg_visibility_and_mode -; void gpu_sync_bg_visibility_and_mode() -gpu_sync_bg_visibility_and_mode: ; 8001698 + thumb_func_start SyncBgVisibilityAndMode +; void SyncBgVisibilityAndMode() +SyncBgVisibilityAndMode: ; 8001698 push {lr} movs r0, 0 - bl lcd_io_get + bl GetGpuReg ldr r1, =0x0000f0f8 ands r1, r0 ldr r0, =0x030008e0 ldrh r0, [r0, 0x10] orrs r1, r0 movs r0, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool - thumb_func_end gpu_sync_bg_visibility_and_mode + thumb_func_end SyncBgVisibilityAndMode - 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 + thumb_func_start SetTextModeAndHideBgs +; void SetTextModeAndHideBgs() +SetTextModeAndHideBgs: ; 80016BC push {lr} movs r0, 0 - bl lcd_io_get + bl GetGpuReg ldr r1, =0x0000f0f8 ands r1, r0 movs r0, 0 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool - thumb_func_end gpu_sync_text_mode_and_hide_bgs + thumb_func_end SetTextModeAndHideBgs - 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 + thumb_func_start SetBgAffineInternal +; void SetBgAffineInternal(u8 bg, u16 srcCenterX, u16 srcCenterY, u16 dispCenterX, u16 dispCenterY, u16 scaleX, u16 scaleY, u16 rotationAngle) +SetBgAffineInternal: ; 80016D8 push {r4-r7,lr} mov r7, r8 push {r7} @@ -599,31 +600,31 @@ gpu_bg_affine_set: ; 80016D8 bl BgAffineSet ldrh r1, [r4] movs r0, 0x20 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x2] movs r0, 0x22 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x4] movs r0, 0x24 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x6] movs r0, 0x26 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4] movs r0, 0x20 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0x8] movs r0, 0x28 - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xA] movs r0, 0x2A - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xC] movs r0, 0x2C - bl lcd_io_set + bl SetGpuReg ldrh r1, [r4, 0xE] movs r0, 0x2E - bl lcd_io_set + bl SetGpuReg @08001796: add sp, 0x24 pop {r3} @@ -631,11 +632,11 @@ gpu_bg_affine_set: ; 80016D8 pop {r4-r7} pop {r0} bx r0 - thumb_func_end gpu_bg_affine_set + thumb_func_end SetBgAffineInternal - thumb_func_start is_invalid_bg_id -; _BOOL1 is_invalid_bg_id(u8 bg_id) -is_invalid_bg_id: ; 80017A4 + thumb_func_start IsInvalidBg +; BOOL IsInvalidBg(u8 bg) +IsInvalidBg: ; 80017A4 push {lr} lsls r0, 24 lsrs r0, 24 @@ -648,21 +649,21 @@ is_invalid_bg_id: ; 80017A4 @080017B4: pop {r1} bx r1 - thumb_func_end is_invalid_bg_id + thumb_func_end IsInvalidBg - thumb_func_start do_nothing -; int do_nothing() -do_nothing: ; 80017B8 + thumb_func_start DummiedOutFireRedLeafGreenTileAllocFunc +; int DummiedOutFireRedLeafGreenTileAllocFunc() +DummiedOutFireRedLeafGreenTileAllocFunc: ; 80017B8 movs r0, 0 bx lr - thumb_func_end do_nothing + thumb_func_end DummiedOutFireRedLeafGreenTileAllocFunc - 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 + thumb_func_start ResetBgsAndClearDma3BusyFlags +; void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable) +ResetBgsAndClearDma3BusyFlags: ; 80017BC push {r4,lr} adds r4, r0, 0 - bl gpu_init_bgs + bl ResetBgs ldr r1, =0x03000938 movs r2, 0 adds r0, r1, 0 @@ -678,11 +679,11 @@ gpu_reset_bgs_and_dma3_busy_flags: ; 80017BC pop {r0} bx r0 .pool - thumb_func_end gpu_reset_bgs_and_dma3_busy_flags + thumb_func_end ResetBgsAndClearDma3BusyFlags - 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 + thumb_func_start InitBgsFromTemplates +; void InitBgsFromTemplates(u8 bgMode, struct BgTemplate *templates, u8 numTemplates) +InitBgsFromTemplates: ; 80017E8 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -694,8 +695,8 @@ bg_vram_setup: ; 80017E8 lsrs r0, 24 lsls r2, 24 lsrs r4, r2, 24 - bl gpu_set_bg_mode - bl gpu_reset_bg_configs + bl SetBgModeInternal + bl ResetWramBgControlStructs cmp r4, 0 beq @08001894 movs r7, 0 @@ -727,7 +728,7 @@ bg_vram_setup: ; 80017E8 str r7, [sp, 0x8] str r7, [sp, 0xC] adds r0, r5, 0 - bl gpu_bg_config_set_fields + bl SetBgControlAttributes lsls r4, r5, 4 mov r5, r9 adds r3, r4, r5 @@ -778,11 +779,11 @@ bg_vram_setup: ; 80017E8 pop {r0} bx r0 .pool - thumb_func_end bg_vram_setup + thumb_func_end InitBgsFromTemplates - 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 + thumb_func_start InitBgFromTemplate +; void InitBgFromTemplate(struct BgTemplate *templates) +InitBgFromTemplate: ; 80018B0 push {r4-r7,lr} sub sp, 0x10 adds r7, r0, 0 @@ -807,7 +808,7 @@ bg_init_bg_config_2_from_bg_config_3: ; 80018B0 str r6, [sp, 0x8] str r6, [sp, 0xC] adds r0, r5, 0 - bl gpu_bg_config_set_fields + bl SetBgControlAttributes ldr r4, =0x030008f8 lsls r5, 4 adds r3, r5, r4 @@ -844,22 +845,22 @@ bg_init_bg_config_2_from_bg_config_3: ; 80018B0 pop {r0} bx r0 .pool - thumb_func_end bg_init_bg_config_2_from_bg_config_3 + thumb_func_end InitBgFromTemplate - thumb_func_start call_gpu_set_bg_mode -; void call_gpu_set_bg_mode(u8 bg_id) -call_gpu_set_bg_mode: ; 8001934 + thumb_func_start SetBgMode +; void SetBgMode(u8 bgMode) +SetBgMode: ; 8001934 push {lr} lsls r0, 24 lsrs r0, 24 - bl gpu_set_bg_mode + bl SetBgModeInternal pop {r0} bx r0 - thumb_func_end call_gpu_set_bg_mode + thumb_func_end SetBgMode - 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 + thumb_func_start LoadBgTiles +; u8 LoadBgTiles(u8 bg, void *src, u16 size, u16 destOffset) +LoadBgTiles: ; 8001944 push {r4-r7,lr} mov r7, r8 push {r7} @@ -874,7 +875,7 @@ gpu_copy_bg_tile_pattern_data_to_vram: ; 8001944 lsrs r4, r3, 16 adds r0, r5, 0 movs r1, 0x5 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 16 cmp r0, 0 bne @08001980 @@ -905,7 +906,7 @@ gpu_copy_bg_tile_pattern_data_to_vram: ; 8001944 adds r1, r7, 0 mov r2, r8 adds r3, r4, 0 - bl gpu_copy_to_vram_by_bg_id + bl LoadBgVram lsls r2, r0, 24 lsrs r1, r2, 24 adds r7, r1, 0 @@ -935,7 +936,7 @@ gpu_copy_bg_tile_pattern_data_to_vram: ; 8001944 lsrs r2, r0, 5 adds r0, r5, 0 movs r3, 0x1 - bl do_nothing + bl DummiedOutFireRedLeafGreenTileAllocFunc @080019E4: adds r0, r7, 0 @080019E6: @@ -946,10 +947,11 @@ gpu_copy_bg_tile_pattern_data_to_vram: ; 8001944 pop {r1} bx r1 .pool - thumb_func_end gpu_copy_bg_tile_pattern_data_to_vram + thumb_func_end LoadBgTiles - thumb_func_start gpu_copy_bg_tile_map_to_vram -gpu_copy_bg_tile_map_to_vram: ; 80019FC + thumb_func_start LoadBgTileMap +; u8 LoadBgTileMap(u8 bg, void *src, u16 size, u16 destOffset) +LoadBgTileMap: ; 80019FC push {r4,lr} sub sp, 0x4 lsls r0, 24 @@ -960,7 +962,7 @@ gpu_copy_bg_tile_map_to_vram: ; 80019FC lsrs r3, 16 movs r4, 0x2 str r4, [sp] - bl gpu_copy_to_vram_by_bg_id + bl LoadBgVram lsls r2, r0, 24 lsrs r3, r2, 24 cmp r3, 0xFF @@ -987,10 +989,11 @@ gpu_copy_bg_tile_map_to_vram: ; 80019FC pop {r1} bx r1 .pool - thumb_func_end gpu_copy_bg_tile_map_to_vram + thumb_func_end LoadBgTileMap - thumb_func_start unused_copy_palette -unused_copy_palette: ; 8001A4C + thumb_func_start Unused_LoadBgPalette +; u8 Unused_LoadBgPalette(u8 bg, void *src, u16 size, u16 destOffset) +Unused_LoadBgPalette: ; 8001A4C push {r4-r7,lr} adds r7, r1, 0 lsls r0, 24 @@ -1000,7 +1003,7 @@ unused_copy_palette: ; 8001A4C lsls r3, 16 lsrs r5, r3, 16 adds r0, r4, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 bne @08001A98 ldr r1, =0x030008f8 @@ -1056,11 +1059,11 @@ unused_copy_palette: ; 8001A4C pop {r1} bx r1 .pool - thumb_func_end unused_copy_palette + thumb_func_end Unused_LoadBgPalette - 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 + thumb_func_start IsDma3ManagerBusyWithBgCopy +; BOOL IsDma3ManagerBusyWithBgCopy() +IsDma3ManagerBusyWithBgCopy: ; 8001AD4 push {r4-r7,lr} movs r5, 0 movs r7, 0x1 @@ -1109,35 +1112,35 @@ is_dma3_queue_busy_with_gpu_copy: ; 8001AD4 pop {r4-r7} pop {r1} bx r1 - thumb_func_end is_dma3_queue_busy_with_gpu_copy + thumb_func_end IsDma3ManagerBusyWithBgCopy - thumb_func_start gpu_sync_bg_show -; void gpu_sync_bg_show(u8 bg_id) -gpu_sync_bg_show: ; 8001B30 + thumb_func_start ShowBg +; void ShowBg(u8 bg) +ShowBg: ; 8001B30 push {lr} lsls r0, 24 lsrs r0, 24 - bl gpu_bg_show - bl gpu_sync_bg_visibility_and_mode + bl ShowBgInternal + bl SyncBgVisibilityAndMode pop {r0} bx r0 - thumb_func_end gpu_sync_bg_show + thumb_func_end ShowBg - thumb_func_start gpu_sync_bg_hide -; void gpu_sync_bg_hide(u8 bg_id) -gpu_sync_bg_hide: ; 8001B44 + thumb_func_start HideBg +; void HideBg(u8 bg) +HideBg: ; 8001B44 push {lr} lsls r0, 24 lsrs r0, 24 - bl gpu_bg_hide - bl gpu_sync_bg_visibility_and_mode + bl HideBgInternal + bl SyncBgVisibilityAndMode pop {r0} bx r0 - thumb_func_end gpu_sync_bg_hide + thumb_func_end HideBg - 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 + thumb_func_start SetBgAttribute +; void SetBgAttribute(u8 bg, u8 attributeId, u8 value) +SetBgAttribute: ; 8001B58 push {r4,lr} sub sp, 0x10 lsls r0, 24 @@ -1192,7 +1195,7 @@ gpu_bg_config_set_field: ; 8001B58 adds r0, r4, 0 movs r1, 0xFF movs r2, 0xFF - bl gpu_bg_config_set_fields + bl SetBgControlAttributes b @08001C12 @08001BD0: str r3, [sp] @@ -1219,7 +1222,7 @@ gpu_bg_config_set_field: ; 8001B58 movs r2, 0xFF @08001BF4: movs r3, 0xFF - bl gpu_bg_config_set_fields + bl SetBgControlAttributes b @08001C12 @08001BFC: movs r0, 0xFF @@ -1231,16 +1234,17 @@ gpu_bg_config_set_field: ; 8001B58 movs r1, 0xFF movs r2, 0xFF movs r3, 0xFF - bl gpu_bg_config_set_fields + bl SetBgControlAttributes @08001C12: add sp, 0x10 pop {r4} pop {r0} bx r0 - thumb_func_end gpu_bg_config_set_field + thumb_func_end SetBgAttribute - thumb_func_start bg_get_field -bg_get_field: ; 8001C1C + thumb_func_start GetBgAttribute +; u8 GetBgAttribute(u8 bg, u8 attributeId) +GetBgAttribute: ; 8001C1C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -1270,41 +1274,41 @@ bg_get_field: ; 8001C1C @08001C64: adds r0, r4, 0 movs r1, 0x2 - bl gpu_bg_config_get_field + bl GetBgControlAttribute b @08001CDE @08001C6E: adds r0, r4, 0 movs r1, 0x3 - bl gpu_bg_config_get_field + bl GetBgControlAttribute b @08001CDE @08001C78: adds r0, r4, 0 movs r1, 0x4 - bl gpu_bg_config_get_field + bl GetBgControlAttribute b @08001CDE @08001C82: adds r0, r4, 0 movs r1, 0x5 - bl gpu_bg_config_get_field + bl GetBgControlAttribute b @08001CDE @08001C8C: adds r0, r4, 0 movs r1, 0x6 - bl gpu_bg_config_get_field + bl GetBgControlAttribute b @08001CDE @08001C96: adds r0, r4, 0 movs r1, 0x7 - bl gpu_bg_config_get_field + bl GetBgControlAttribute b @08001CDE @08001CA0: adds r0, r4, 0 movs r1, 0x8 - bl gpu_bg_config_get_field + bl GetBgControlAttribute b @08001CDE @08001CAA: adds r0, r4, 0 - bl bg_get_type_by_bg_id + bl GetBgType cmp r0, 0 beq @08001CBC cmp r0, 0x1 @@ -1314,20 +1318,20 @@ bg_get_field: ; 8001C1C @08001CBC: adds r0, r4, 0 movs r1, 0 - bl bg_get_screen_size_in_regular_mode + bl GetBgMetricTextMode lsls r0, 27 lsrs r0, 16 b @08001CFA @08001CCA: adds r0, r4, 0 movs r1, 0 - bl bg_get_screen_size_in_affine_mode + bl GetBgMetricAffineMode lsls r0, 24 lsrs r0, 16 b @08001CFA @08001CD8: adds r0, r4, 0 - bl bg_get_type_by_bg_id + bl GetBgType @08001CDE: lsls r0, 16 lsrs r0, 16 @@ -1348,11 +1352,11 @@ bg_get_field: ; 8001C1C pop {r1} bx r1 .pool - thumb_func_end bg_get_field + thumb_func_end GetBgAttribute - thumb_func_start bg_change_x_offset -; int bg_change_x_offset(u8 bg_id, int offset, u8 operation) -bg_change_x_offset: ; 8001D04 + thumb_func_start ChangeBgX +; u32 ChangeBgX(u8 bg, u32 value, u8 op) +ChangeBgX: ; 8001D04 push {r4-r6,lr} adds r6, r1, 0 lsls r0, 24 @@ -1360,12 +1364,12 @@ bg_change_x_offset: ; 8001D04 lsls r2, 24 lsrs r5, r2, 24 adds r0, r4, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 bne @08001D28 adds r0, r4, 0 movs r1, 0x1 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 16 cmp r0, 0 bne @08001D2E @@ -1409,7 +1413,7 @@ bg_change_x_offset: ; 8001D04 str r1, [r0] adds r5, r2, 0 @08001D70: - bl gpu_get_bg_mode + bl GetBgMode lsls r0, 24 lsrs r0, 24 cmp r4, 0x1 @@ -1432,7 +1436,7 @@ bg_change_x_offset: ; 8001D04 lsls r0, 8 lsrs r1, r0, 16 movs r0, 0x10 - bl lcd_io_set + bl SetGpuReg b @08001E2C .pool @08001DAC: @@ -1441,7 +1445,7 @@ bg_change_x_offset: ; 8001D04 lsls r0, 8 lsrs r1, r0, 16 movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg b @08001E2C .pool @08001DC0: @@ -1452,7 +1456,7 @@ bg_change_x_offset: ; 8001D04 lsls r0, 8 lsrs r1, r0, 16 movs r0, 0x18 - bl lcd_io_set + bl SetGpuReg b @08001E2C .pool @08001DD8: @@ -1462,10 +1466,10 @@ bg_change_x_offset: ; 8001D04 lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x2A - bl lcd_io_set + bl SetGpuReg movs r0, 0x28 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg b @08001E2C .pool @08001DF8: @@ -1476,7 +1480,7 @@ bg_change_x_offset: ; 8001D04 lsls r0, 8 lsrs r1, r0, 16 movs r0, 0x1C - bl lcd_io_set + bl SetGpuReg b @08001E2C .pool @08001E10: @@ -1488,10 +1492,10 @@ bg_change_x_offset: ; 8001D04 lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x3A - bl lcd_io_set + bl SetGpuReg movs r0, 0x38 adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg @08001E2C: ldr r0, =0x030008f8 adds r0, 0x8 @@ -1502,21 +1506,21 @@ bg_change_x_offset: ; 8001D04 pop {r1} bx r1 .pool - thumb_func_end bg_change_x_offset + thumb_func_end ChangeBgX - thumb_func_start bg_get_x_offset -; int bg_get_x_offset(u8 bg_id) -bg_get_x_offset: ; 8001E40 + thumb_func_start GetBgX +; u32 GetBgX(u8 bg) +GetBgX: ; 8001E40 push {r4,lr} lsls r0, 24 lsrs r0, 24 adds r4, r0, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 bne @08001E70 adds r0, r4, 0 movs r1, 0x1 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 16 cmp r0, 0 beq @08001E70 @@ -1534,11 +1538,11 @@ bg_get_x_offset: ; 8001E40 pop {r4} pop {r1} bx r1 - thumb_func_end bg_get_x_offset + thumb_func_end GetBgX - thumb_func_start bg_change_y_offset -; int bg_change_y_offset(u8 bg_id, int offset, u8 operation) -bg_change_y_offset: ; 8001E7C + thumb_func_start ChangeBgY +; u32 ChangeBgY(u8 bg, u32 value, u8 op) +ChangeBgY: ; 8001E7C push {r4-r6,lr} adds r6, r1, 0 lsls r0, 24 @@ -1546,12 +1550,12 @@ bg_change_y_offset: ; 8001E7C lsls r2, 24 lsrs r5, r2, 24 adds r0, r4, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 bne @08001EA0 adds r0, r4, 0 movs r1, 0x1 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 16 cmp r0, 0 bne @08001EA6 @@ -1595,7 +1599,7 @@ bg_change_y_offset: ; 8001E7C str r1, [r0] adds r5, r2, 0 @08001EE8: - bl gpu_get_bg_mode + bl GetBgMode lsls r0, 24 lsrs r0, 24 cmp r4, 0x1 @@ -1618,7 +1622,7 @@ bg_change_y_offset: ; 8001E7C lsls r0, 8 lsrs r1, r0, 16 movs r0, 0x12 - bl lcd_io_set + bl SetGpuReg b @08001FA4 .pool @08001F24: @@ -1627,7 +1631,7 @@ bg_change_y_offset: ; 8001E7C lsls r0, 8 lsrs r1, r0, 16 movs r0, 0x16 - bl lcd_io_set + bl SetGpuReg b @08001FA4 .pool @08001F38: @@ -1638,7 +1642,7 @@ bg_change_y_offset: ; 8001E7C lsls r0, 8 lsrs r1, r0, 16 movs r0, 0x1A - bl lcd_io_set + bl SetGpuReg b @08001FA4 .pool @08001F50: @@ -1648,10 +1652,10 @@ bg_change_y_offset: ; 8001E7C lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x2E - bl lcd_io_set + bl SetGpuReg movs r0, 0x2C adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg b @08001FA4 .pool @08001F70: @@ -1662,7 +1666,7 @@ bg_change_y_offset: ; 8001E7C lsls r0, 8 lsrs r1, r0, 16 movs r0, 0x1E - bl lcd_io_set + bl SetGpuReg b @08001FA4 .pool @08001F88: @@ -1674,10 +1678,10 @@ bg_change_y_offset: ; 8001E7C lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x3E - bl lcd_io_set + bl SetGpuReg movs r0, 0x3C adds r1, r4, 0 - bl lcd_io_set + bl SetGpuReg @08001FA4: ldr r0, =0x030008f8 adds r0, 0xC @@ -1688,11 +1692,11 @@ bg_change_y_offset: ; 8001E7C pop {r1} bx r1 .pool - thumb_func_end bg_change_y_offset + thumb_func_end ChangeBgY - 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 + thumb_func_start ChangeBgY_ScreenOff +; u32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op) +ChangeBgY_ScreenOff: ; 8001FB8 push {r4-r6,lr} adds r6, r1, 0 lsls r0, 24 @@ -1700,12 +1704,12 @@ bg_change_y_offset_to_copy_queue: ; 8001FB8 lsls r2, 24 lsrs r5, r2, 24 adds r0, r4, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 bne @08001FDC adds r0, r4, 0 movs r1, 0x1 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 16 cmp r0, 0 bne @08001FE2 @@ -1749,7 +1753,7 @@ bg_change_y_offset_to_copy_queue: ; 8001FB8 str r1, [r0] adds r5, r2, 0 @08002024: - bl gpu_get_bg_mode + bl GetBgMode lsls r0, 24 lsrs r0, 24 cmp r4, 0x1 @@ -1772,7 +1776,7 @@ bg_change_y_offset_to_copy_queue: ; 8001FB8 lsls r0, 8 lsrs r1, r0, 16 movs r0, 0x12 - bl lcd_io_set_forced_blank + bl SetGpuReg_ScreenOff b @080020E0 .pool @08002060: @@ -1781,7 +1785,7 @@ bg_change_y_offset_to_copy_queue: ; 8001FB8 lsls r0, 8 lsrs r1, r0, 16 movs r0, 0x16 - bl lcd_io_set_forced_blank + bl SetGpuReg_ScreenOff b @080020E0 .pool @08002074: @@ -1792,7 +1796,7 @@ bg_change_y_offset_to_copy_queue: ; 8001FB8 lsls r0, 8 lsrs r1, r0, 16 movs r0, 0x1A - bl lcd_io_set_forced_blank + bl SetGpuReg_ScreenOff b @080020E0 .pool @0800208C: @@ -1802,10 +1806,10 @@ bg_change_y_offset_to_copy_queue: ; 8001FB8 lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x2E - bl lcd_io_set_forced_blank + bl SetGpuReg_ScreenOff movs r0, 0x2C adds r1, r4, 0 - bl lcd_io_set_forced_blank + bl SetGpuReg_ScreenOff b @080020E0 .pool @080020AC: @@ -1816,7 +1820,7 @@ bg_change_y_offset_to_copy_queue: ; 8001FB8 lsls r0, 8 lsrs r1, r0, 16 movs r0, 0x1E - bl lcd_io_set_forced_blank + bl SetGpuReg_ScreenOff b @080020E0 .pool @080020C4: @@ -1828,10 +1832,10 @@ bg_change_y_offset_to_copy_queue: ; 8001FB8 lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x3E - bl lcd_io_set_forced_blank + bl SetGpuReg_ScreenOff movs r0, 0x3C adds r1, r4, 0 - bl lcd_io_set_forced_blank + bl SetGpuReg_ScreenOff @080020E0: ldr r0, =0x030008f8 adds r0, 0xC @@ -1842,21 +1846,21 @@ bg_change_y_offset_to_copy_queue: ; 8001FB8 pop {r1} bx r1 .pool - thumb_func_end bg_change_y_offset_to_copy_queue + thumb_func_end ChangeBgY_ScreenOff - thumb_func_start bg_get_y_offset -; int bg_get_y_offset(u8 bg_id) -bg_get_y_offset: ; 80020F4 + thumb_func_start GetBgY +; u32 GetBgY(u8 bg) +GetBgY: ; 80020F4 push {r4,lr} lsls r0, 24 lsrs r0, 24 adds r4, r0, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 bne @08002124 adds r0, r4, 0 movs r1, 0x1 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 16 cmp r0, 0 beq @08002124 @@ -1874,11 +1878,11 @@ bg_get_y_offset: ; 80020F4 pop {r4} pop {r1} bx r1 - thumb_func_end bg_get_y_offset + thumb_func_end GetBgY - 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 + thumb_func_start SetBgAffine +; void SetBgAffine(u8 bg, u16 srcCenterX, u16 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) +SetBgAffine: ; 8002130 push {r4-r7,lr} mov r7, r8 push {r7} @@ -1903,24 +1907,25 @@ call_gpu_bg_affine_set: ; 8002130 asrs r6, 16 str r6, [sp, 0x8] str r7, [sp, 0xC] - bl gpu_bg_affine_set + bl SetBgAffineInternal add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 - thumb_func_end call_gpu_bg_affine_set + thumb_func_end SetBgAffine - thumb_func_start mosaic_something -mosaic_something: ; 8002170 + thumb_func_start Unused_AdjustBgMosaic +; u8 Unused_AdjustBgMosaic(u8 a1, u8 a2) +Unused_AdjustBgMosaic: ; 8002170 push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 lsls r1, 24 lsrs r6, r1, 24 movs r0, 0x4C - bl lcd_io_get + bl GetGpuReg lsls r0, 16 lsrs r5, r0, 16 movs r1, 0xF @@ -2025,28 +2030,28 @@ mosaic_something: ; 8002170 lsrs r5, r0, 16 movs r0, 0x4C adds r1, r5, 0 - bl lcd_io_set + bl SetGpuReg lsls r0, r5, 24 lsrs r0, 24 pop {r4-r6} pop {r1} bx r1 - thumb_func_end mosaic_something + thumb_func_end Unused_AdjustBgMosaic - thumb_func_start bg_set_tilemap -; void bg_set_tilemap(u8 bg_id, int tilemap) -bg_set_tilemap: ; 8002250 + thumb_func_start SetBgTileMap +; void SetBgTileMap(u8 bg, void *tileMap) +SetBgTileMap: ; 8002250 push {r4,r5,lr} adds r5, r1, 0 lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 bne @0800227A adds r0, r4, 0 movs r1, 0x1 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 16 cmp r0, 0 beq @0800227A @@ -2060,22 +2065,22 @@ bg_set_tilemap: ; 8002250 pop {r0} bx r0 .pool - thumb_func_end bg_set_tilemap + thumb_func_end SetBgTileMap - thumb_func_start bg_unset_tilemap -; void bg_unset_tilemap(u8 bg_id) -bg_unset_tilemap: ; 8002284 + thumb_func_start UnsetBgTileMap +; void UnsetBgTileMap(u8 bg) +UnsetBgTileMap: ; 8002284 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ adds r5, r0, 0 cmp r5, 0 bne @080022AE adds r0, r4, 0 movs r1, 0x1 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 16 cmp r0, 0 beq @080022AE @@ -2089,21 +2094,21 @@ bg_unset_tilemap: ; 8002284 pop {r0} bx r0 .pool - thumb_func_end bg_unset_tilemap + thumb_func_end UnsetBgTileMap - thumb_func_start bg_get_tilemap -; int bg_get_tilemap(u8 bg_id) -bg_get_tilemap: ; 80022B8 + thumb_func_start GetBgTileMap +; void *GetBgTileMap(u8 bg) +GetBgTileMap: ; 80022B8 push {r4,lr} lsls r0, 24 lsrs r0, 24 adds r4, r0, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 bne @080022E8 adds r0, r4, 0 movs r1, 0x1 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 16 cmp r0, 0 beq @080022E8 @@ -2120,11 +2125,11 @@ bg_get_tilemap: ; 80022B8 pop {r4} pop {r1} bx r1 - thumb_func_end bg_get_tilemap + thumb_func_end GetBgTileMap - 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 + thumb_func_start CopyToBgTileMapBuffer +; void CopyToBgTileMapBuffer(u8 bg, void *src, u16 mode, u16 destOffset) +CopyToBgTileMapBuffer: ; 80022F0 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -2140,7 +2145,7 @@ gpu_copy_to_wram_bg_tile_map: ; 80022F0 lsrs r5, r3, 16 mov r8, r5 adds r0, r4, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 bne @08002358 adds r0, r4, 0 @@ -2182,17 +2187,17 @@ gpu_copy_to_wram_bg_tile_map: ; 80022F0 pop {r0} bx r0 .pool - thumb_func_end gpu_copy_to_wram_bg_tile_map + thumb_func_end CopyToBgTileMapBuffer - 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 + thumb_func_start CopyBgTileMapBufferToVram +; void CopyBgTileMapBufferToVram(u8 bg) +CopyBgTileMapBufferToVram: ; 800236C push {r4,lr} sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 bne @080023C8 adds r0, r4, 0 @@ -2200,7 +2205,7 @@ gpu_copy_wram_bg_tilemap_to_vram: ; 800236C cmp r0, 0 bne @080023C8 adds r0, r4, 0 - bl bg_get_type_by_bg_id + bl GetBgType cmp r0, 0 beq @0800239A cmp r0, 0x1 @@ -2210,13 +2215,13 @@ gpu_copy_wram_bg_tilemap_to_vram: ; 800236C @0800239A: adds r0, r4, 0 movs r1, 0 - bl bg_get_screen_size_in_regular_mode + bl GetBgMetricTextMode lsls r0, 27 b @080023B0 @080023A6: adds r0, r4, 0 movs r1, 0 - bl bg_get_screen_size_in_affine_mode + bl GetBgMetricAffineMode lsls r0, 24 @080023B0: lsrs r2, r0, 16 @@ -2230,18 +2235,18 @@ gpu_copy_wram_bg_tilemap_to_vram: ; 800236C str r0, [sp] adds r0, r4, 0 movs r3, 0 - bl gpu_copy_to_vram_by_bg_id + bl LoadBgVram @080023C8: add sp, 0x4 pop {r4} pop {r0} bx r0 .pool - thumb_func_end gpu_copy_wram_bg_tilemap_to_vram + thumb_func_end CopyBgTileMapBufferToVram - 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 + thumb_func_start CopyToBgTileMapBufferRect +; void CopyToBgTileMapBufferRect(u8 bg, void *src, u8 destX, u8 destY, u8 width, u8 height) +CopyToBgTileMapBufferRect: ; 80023D4 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -2264,7 +2269,7 @@ gpu_copy_to_iwram_tile_map_rect: ; 80023D4 lsls r4, 24 lsrs r6, r4, 24 adds r0, r5, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 bne @080024C4 adds r0, r5, 0 @@ -2272,7 +2277,7 @@ gpu_copy_to_iwram_tile_map_rect: ; 80023D4 cmp r0, 0 bne @080024C4 adds r0, r5, 0 - bl bg_get_type_by_bg_id + bl GetBgType cmp r0, 0 beq @08002422 cmp r0, 0x1 @@ -2323,7 +2328,7 @@ gpu_copy_to_iwram_tile_map_rect: ; 80023D4 mov r4, r8 adds r0, r5, 0 movs r1, 0x1 - bl bg_get_screen_size_in_affine_mode + bl GetBgMetricAffineMode lsls r0, 16 lsrs r0, 16 str r0, [sp] @@ -2374,11 +2379,11 @@ gpu_copy_to_iwram_tile_map_rect: ; 80023D4 pop {r0} bx r0 .pool - thumb_func_end gpu_copy_to_iwram_tile_map_rect + thumb_func_end CopyToBgTileMapBufferRect - 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 + thumb_func_start CopyToBgTileMapBufferRect_ChangePalette +; void CopyToBgTileMapBufferRect_ChangePalette(u8 bg, void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette) +CopyToBgTileMapBufferRect_ChangePalette: ; 80024D8 push {r4-r6,lr} sub sp, 0x24 ldr r4, [sp, 0x34] @@ -2407,16 +2412,16 @@ bg_copy_tilemap_rect_simple: ; 80024D8 str r2, [sp, 0x1C] str r2, [sp, 0x20] movs r3, 0 - bl bg_copy_tilemap_rect + bl CopyRectToBgTileMapBufferRect add sp, 0x24 pop {r4-r6} pop {r0} bx r0 - thumb_func_end bg_copy_tilemap_rect_simple + thumb_func_end CopyToBgTileMapBufferRect_ChangePalette - 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 + thumb_func_start CopyRectToBgTileMapBufferRect +; void CopyRectToBgTileMapBufferRect(u8 bg, void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, u16 tileOffset, u16 palette2) +CopyRectToBgTileMapBufferRect: ; 800251C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -2471,7 +2476,7 @@ bg_copy_tilemap_rect: ; 800251C lsrs r0, 16 str r0, [sp, 0x24] ldr r0, [sp, 0x4] - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 beq @08002592 b @080026EE @@ -2484,24 +2489,24 @@ bg_copy_tilemap_rect: ; 800251C @0800259E: ldr r0, [sp, 0x4] movs r1, 0x4 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x30] ldr r0, [sp, 0x4] movs r1, 0x1 - bl bg_get_screen_size_in_regular_mode + bl GetBgMetricTextMode lsls r0, 21 lsrs r0, 16 str r0, [sp, 0x28] ldr r0, [sp, 0x4] movs r1, 0x2 - bl bg_get_screen_size_in_regular_mode + bl GetBgMetricTextMode lsls r0, 21 lsrs r0, 16 str r0, [sp, 0x2C] ldr r0, [sp, 0x4] - bl bg_get_type_by_bg_id + bl GetBgType cmp r0, 0 beq @080025D8 cmp r0, 0x1 @@ -2552,7 +2557,7 @@ bg_copy_tilemap_rect: ; 800251C adds r1, r5, 0 ldr r2, [sp, 0x30] ldr r3, [sp, 0x28] - bl bg_get_index_from_tile_coords + bl GetTileMapIndexFromCoords lsls r0, 16 lsrs r0, 15 mov r7, r10 @@ -2564,7 +2569,7 @@ bg_copy_tilemap_rect: ; 800251C ldr r2, [sp, 0x1C] mov r7, r9 asrs r3, r7, 16 - bl bg_copy_tilemap_entry_not_rotscale_mode + bl CopyTileMapEntry adds r6, 0x2 adds r0, r4, 0x1 lsls r0, 16 @@ -2596,7 +2601,7 @@ bg_copy_tilemap_rect: ; 800251C adds r6, r1, r0 ldr r0, [sp, 0x4] movs r1, 0x1 - bl bg_get_screen_size_in_affine_mode + bl GetBgMetricAffineMode lsls r0, 16 lsrs r0, 16 mov r9, r0 @@ -2660,11 +2665,11 @@ bg_copy_tilemap_rect: ; 800251C pop {r0} bx r0 .pool - thumb_func_end bg_copy_tilemap_rect + thumb_func_end CopyRectToBgTileMapBufferRect - 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 + thumb_func_start FillBgTileMapBufferRect_Palette0 +; void FillBgTileMapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height) +FillBgTileMapBufferRect_Palette0: ; 8002704 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -2689,7 +2694,7 @@ bg_fill_tilemap_rect: ; 8002704 lsls r5, 24 lsrs r5, 24 adds r0, r6, 0 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 bne @080027F0 adds r0, r6, 0 @@ -2697,7 +2702,7 @@ bg_fill_tilemap_rect: ; 8002704 cmp r0, 0 bne @080027F0 adds r0, r6, 0 - bl bg_get_type_by_bg_id + bl GetBgType cmp r0, 0 beq @08002756 cmp r0, 0x1 @@ -2745,7 +2750,7 @@ bg_fill_tilemap_rect: ; 8002704 @080027A0: adds r0, r6, 0 movs r1, 0x1 - bl bg_get_screen_size_in_affine_mode + bl GetBgMetricAffineMode lsls r0, 16 lsrs r0, 16 str r0, [sp] @@ -2795,11 +2800,11 @@ bg_fill_tilemap_rect: ; 8002704 pop {r0} bx r0 .pool - thumb_func_end bg_fill_tilemap_rect + thumb_func_end FillBgTileMapBufferRect_Palette0 - 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 + thumb_func_start FillBgTileMapBufferRect +; void FillBgTileMapBufferRect(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height, u8 palette) +FillBgTileMapBufferRect: ; 8002804 push {r4-r6,lr} sub sp, 0x10 ldr r4, [sp, 0x20] @@ -2824,16 +2829,16 @@ Bg_FillWramTileMapRectWithTileAndPalette: ; 8002804 str r6, [sp, 0x8] movs r4, 0 str r4, [sp, 0xC] - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer add sp, 0x10 pop {r4-r6} pop {r0} bx r0 - thumb_func_end Bg_FillWramTileMapRectWithTileAndPalette + thumb_func_end FillBgTileMapBufferRect - 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 + thumb_func_start WriteSequenceToBgTileMapBuffer +; void WriteSequenceToBgTileMapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot, u16 tileNumDelta) +WriteSequenceToBgTileMapBuffer: ; 8002840 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -2868,7 +2873,7 @@ bg_write_sequence_to_wram_tile_map_rect: ; 8002840 lsrs r0, 16 str r0, [sp, 0x10] mov r0, r9 - bl is_invalid_bg_id_2 + bl IsInvalidBg_ cmp r0, 0 beq @0800288E b @080029D4 @@ -2881,24 +2886,24 @@ bg_write_sequence_to_wram_tile_map_rect: ; 8002840 @0800289A: mov r0, r9 movs r1, 0x4 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x1C] mov r0, r9 movs r1, 0x1 - bl bg_get_screen_size_in_regular_mode + bl GetBgMetricTextMode lsls r0, 21 lsrs r0, 16 str r0, [sp, 0x14] mov r0, r9 movs r1, 0x2 - bl bg_get_screen_size_in_regular_mode + bl GetBgMetricTextMode lsls r0, 21 lsrs r0, 16 str r0, [sp, 0x18] mov r0, r9 - bl bg_get_type_by_bg_id + bl GetBgType cmp r0, 0 beq @080028D4 cmp r0, 0x1 @@ -2930,7 +2935,7 @@ bg_write_sequence_to_wram_tile_map_rect: ; 8002840 adds r1, r5, 0 ldr r2, [sp, 0x1C] ldr r3, [sp, 0x14] - bl bg_get_index_from_tile_coords + bl GetTileMapIndexFromCoords lsls r0, 16 lsrs r0, 15 ldr r1, [r6] @@ -2940,7 +2945,7 @@ bg_write_sequence_to_wram_tile_map_rect: ; 8002840 add r0, sp, 0x4 ldr r2, [sp, 0xC] movs r3, 0 - bl bg_copy_tilemap_entry_not_rotscale_mode + bl CopyTileMapEntry ldrh r0, [r7] movs r2, 0xFC lsls r2, 8 @@ -2973,7 +2978,7 @@ bg_write_sequence_to_wram_tile_map_rect: ; 8002840 @0800295C: mov r0, r9 movs r1, 0x1 - bl bg_get_screen_size_in_affine_mode + bl GetBgMetricAffineMode lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x20] @@ -3043,11 +3048,11 @@ bg_write_sequence_to_wram_tile_map_rect: ; 8002840 pop {r0} bx r0 .pool - thumb_func_end bg_write_sequence_to_wram_tile_map_rect + thumb_func_end WriteSequenceToBgTileMapBuffer - 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 + thumb_func_start GetBgMetricTextMode +; u16 GetBgMetricTextMode(u8 bg, u8 whichMetric) +GetBgMetricTextMode: ; 80029EC push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 @@ -3055,7 +3060,7 @@ bg_get_screen_size_in_regular_mode: ; 80029EC lsrs r4, r1, 24 adds r5, r4, 0 movs r1, 0x4 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 24 lsrs r0, 24 cmp r4, 0x1 @@ -3113,18 +3118,18 @@ bg_get_screen_size_in_regular_mode: ; 80029EC pop {r4,r5} pop {r1} bx r1 - thumb_func_end bg_get_screen_size_in_regular_mode + thumb_func_end GetBgMetricTextMode - 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 + thumb_func_start GetBgMetricAffineMode +; u16 GetBgMetricAffineMode(u8 bg, u8 whichMetric) +GetBgMetricAffineMode: ; 8002A5C push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r4, r1, 24 movs r1, 0x4 - bl gpu_bg_config_get_field + bl GetBgControlAttribute lsls r0, 24 lsrs r1, r0, 24 adds r0, r1, 0 @@ -3169,11 +3174,11 @@ bg_get_screen_size_in_affine_mode: ; 8002A5C pop {r4} pop {r1} bx r1 - thumb_func_end bg_get_screen_size_in_affine_mode + thumb_func_end GetBgMetricAffineMode - 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 + thumb_func_start GetTileMapIndexFromCoords +; u32 GetTileMapIndexFromCoords(u32 x, u32 y, u32 screenSize, u32 screenWidth, u32 screenHeight) +GetTileMapIndexFromCoords: ; 8002AB4 push {r4,lr} adds r4, r0, 0 ldr r0, [sp, 0x8] @@ -3203,11 +3208,11 @@ bg_get_index_from_tile_coords: ; 8002AB4 pop {r4} pop {r1} bx r1 - thumb_func_end bg_get_index_from_tile_coords + thumb_func_end GetTileMapIndexFromCoords - 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 + thumb_func_start CopyTileMapEntry +; void CopyTileMapEntry(u16 *src, u16 *dest, s32 palette1, u16 tileOffset, u32 palette2) +CopyTileMapEntry: ; 8002AEC push {r4-r6,lr} adds r4, r0, 0 adds r6, r1, 0 @@ -3255,16 +3260,16 @@ bg_copy_tilemap_entry_not_rotscale_mode: ; 8002AEC pop {r4-r6} pop {r0} bx r0 - thumb_func_end bg_copy_tilemap_entry_not_rotscale_mode + thumb_func_end CopyTileMapEntry - 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 + thumb_func_start GetBgType +; u16 GetBgType(u8 bg) +GetBgType: ; 8002B48 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 - bl gpu_get_bg_mode + bl GetBgMode lsls r0, 24 lsrs r0, 24 cmp r4, 0x2 @@ -3306,11 +3311,11 @@ bg_get_type_by_bg_id: ; 8002B48 pop {r1} bx r1 .pool - thumb_func_end bg_get_type_by_bg_id + thumb_func_end GetBgType - thumb_func_start is_invalid_bg_id_2 -; int is_invalid_bg_id_2(u8 bg_id) -is_invalid_bg_id_2: ; 8002B9C + thumb_func_start IsInvalidBg_ +; BOOL IsInvalidBg_(u8 bg) +IsInvalidBg_: ; 8002B9C push {lr} lsls r0, 24 lsrs r0, 24 @@ -3323,10 +3328,10 @@ is_invalid_bg_id_2: ; 8002B9C @08002BAC: pop {r1} bx r1 - thumb_func_end is_invalid_bg_id_2 + thumb_func_end IsInvalidBg_ thumb_func_start IsTileMapOutsideWram -; bool IsTileMapOutsideWram(u8 bg_id) +; BOOL IsTileMapOutsideWram(u8 bg) IsTileMapOutsideWram: ; 8002BB0 push {lr} lsls r0, 24 diff --git a/asm/gpu_reg_manager.s b/asm/gpu_reg_manager.s index bcbd73a8a..cb4b9b6d9 100644 --- a/asm/gpu_reg_manager.s +++ b/asm/gpu_reg_manager.s @@ -1,6 +1,6 @@ - thumb_func_start lcd_io_copy_queue_clean -; void lcd_io_copy_queue_clean() -lcd_io_copy_queue_clean: ; 8000FE4 + thumb_func_start InitGpuRegManager +; void InitGpuRegManager() +InitGpuRegManager: ; 8000FE4 push {r4-r7,lr} mov r7, r8 push {r7} @@ -37,11 +37,11 @@ lcd_io_copy_queue_clean: ; 8000FE4 pop {r0} bx r0 .pool - thumb_func_end lcd_io_copy_queue_clean + thumb_func_end InitGpuRegManager - thumb_func_start lcd_io_buffer_to_hardware -; void lcd_io_buffer_to_hardware(u8 reg) -lcd_io_buffer_to_hardware: ; 800103C + thumb_func_start CopyBufferedValueToGpuReg +; void CopyBufferedValueToGpuReg(u8 reg) +CopyBufferedValueToGpuReg: ; 800103C push {lr} lsls r0, 24 lsrs r2, r0, 24 @@ -71,11 +71,11 @@ lcd_io_buffer_to_hardware: ; 800103C pop {r0} bx r0 .pool - thumb_func_end lcd_io_buffer_to_hardware + thumb_func_end CopyBufferedValueToGpuReg - thumb_func_start lcd_io_copy_queue_process -; void lcd_io_copy_queue_process() -lcd_io_copy_queue_process: ; 8001080 + thumb_func_start CopyBufferedValuesToGpuRegs +; void CopyBufferedValuesToGpuRegs() +CopyBufferedValuesToGpuRegs: ; 8001080 push {r4,r5,lr} ldr r0, =0x030008d8 ldrb r0, [r0] @@ -88,7 +88,7 @@ lcd_io_copy_queue_process: ; 8001080 ldrb r0, [r4] cmp r0, 0xFF beq @080010A4 - bl lcd_io_buffer_to_hardware + bl CopyBufferedValueToGpuReg movs r0, 0xFF strb r0, [r4] adds r5, 0x1 @@ -99,11 +99,11 @@ lcd_io_copy_queue_process: ; 8001080 pop {r0} bx r0 .pool - thumb_func_end lcd_io_copy_queue_process + thumb_func_end CopyBufferedValuesToGpuRegs - thumb_func_start lcd_io_set -; void lcd_io_set(u8 reg, u16 value) -lcd_io_set: ; 80010B4 + thumb_func_start SetGpuReg +; void SetGpuReg(u8 reg, u16 value) +SetGpuReg: ; 80010B4 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -132,7 +132,7 @@ lcd_io_set: ; 80010B4 beq @080010FE @080010E8: adds r0, r4, 0 - bl lcd_io_buffer_to_hardware + bl CopyBufferedValueToGpuReg b @08001130 .pool @080010F8: @@ -172,11 +172,11 @@ lcd_io_set: ; 80010B4 pop {r0} bx r0 .pool - thumb_func_end lcd_io_set + thumb_func_end SetGpuReg - thumb_func_start lcd_io_set_forced_blank -; void lcd_io_set_forced_blank(u8 reg, u16 value) -lcd_io_set_forced_blank: ; 8001140 + thumb_func_start SetGpuReg_ScreenOff +; void SetGpuReg_ScreenOff(u8 reg, u16 value) +SetGpuReg_ScreenOff: ; 8001140 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -195,7 +195,7 @@ lcd_io_set_forced_blank: ; 8001140 cmp r0, 0 beq @08001176 adds r0, r4, 0 - bl lcd_io_buffer_to_hardware + bl CopyBufferedValueToGpuReg b @080011A8 .pool @08001170: @@ -235,11 +235,11 @@ lcd_io_set_forced_blank: ; 8001140 pop {r0} bx r0 .pool - thumb_func_end lcd_io_set_forced_blank + thumb_func_end SetGpuReg_ScreenOff - thumb_func_start lcd_io_get -; u16 lcd_io_get(u8 reg) -lcd_io_get: ; 80011B8 + thumb_func_start GetGpuReg +; u16 GetGpuReg(u8 reg) +GetGpuReg: ; 80011B8 push {lr} lsls r0, 24 lsrs r0, 24 @@ -265,11 +265,11 @@ lcd_io_get: ; 80011B8 pop {r1} bx r1 .pool - thumb_func_end lcd_io_get + thumb_func_end GetGpuReg - thumb_func_start lcd_io_set_bits -; void lcd_io_set_bits(u8 reg, u16 mask) -lcd_io_set_bits: ; 80011E8 + thumb_func_start SetGpuRegBits +; void SetGpuRegBits(u8 reg, u16 mask) +SetGpuRegBits: ; 80011E8 push {lr} adds r2, r1, 0 lsls r0, 24 @@ -280,15 +280,15 @@ lcd_io_set_bits: ; 80011E8 orrs r1, r2 lsls r1, 16 lsrs r1, 16 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool - thumb_func_end lcd_io_set_bits + thumb_func_end SetGpuRegBits - thumb_func_start lcd_io_clear_bits -; void lcd_io_clear_bits(u8 reg, u16 mask) -lcd_io_clear_bits: ; 8001208 + thumb_func_start ResetGpuRegBits +; void ResetGpuRegBits(u8 reg, u16 mask) +ResetGpuRegBits: ; 8001208 push {lr} adds r2, r1, 0 lsls r0, 24 @@ -299,15 +299,15 @@ lcd_io_clear_bits: ; 8001208 ldrh r1, [r1] lsrs r2, 16 bics r1, r2 - bl lcd_io_set + bl SetGpuReg pop {r0} bx r0 .pool - thumb_func_end lcd_io_clear_bits + thumb_func_end ResetGpuRegBits - thumb_func_start update_hardware_IE -; void update_hardware_IE() -update_hardware_IE: ; 8001228 + thumb_func_start SyncIEReg +; void SyncIEReg() +SyncIEReg: ; 8001228 push {r4,r5,lr} ldr r5, =0x030008d9 ldrb r0, [r5] @@ -328,11 +328,11 @@ update_hardware_IE: ; 8001228 pop {r0} bx r0 .pool - thumb_func_end update_hardware_IE + thumb_func_end SyncIEReg - thumb_func_start enable_irqs -; void enable_irqs(u16 value) -enable_irqs: ; 800125C + thumb_func_start EnableInterrupts +; void EnableInterrupts(u16 mask) +EnableInterrupts: ; 800125C push {r4,lr} lsls r0, 16 lsrs r0, 16 @@ -343,18 +343,18 @@ enable_irqs: ; 800125C ldr r1, =0x030008d9 movs r0, 0x1 strb r0, [r1] - bl update_hardware_IE + bl SyncIEReg ldrh r0, [r4] - bl dispstat_set_vblank_hblank_irqs + bl SetDispstatVBlankHBlankInterrupts pop {r4} pop {r0} bx r0 .pool - thumb_func_end enable_irqs + thumb_func_end EnableInterrupts - thumb_func_start disable_irqs -; void disable_irqs(u16 value) -disable_irqs: ; 8001288 + thumb_func_start DisableInterrupts +; void DisableInterrupts(u16 mask) +DisableInterrupts: ; 8001288 push {r4,lr} lsls r0, 16 lsrs r0, 16 @@ -365,24 +365,24 @@ disable_irqs: ; 8001288 ldr r1, =0x030008d9 movs r0, 0x1 strb r0, [r1] - bl update_hardware_IE + bl SyncIEReg ldrh r0, [r4] - bl dispstat_set_vblank_hblank_irqs + bl SetDispstatVBlankHBlankInterrupts pop {r4} pop {r0} bx r0 .pool - thumb_func_end disable_irqs + thumb_func_end DisableInterrupts - thumb_func_start dispstat_set_vblank_hblank_irqs -; void dispstat_set_vblank_hblank_irqs(u16 value) -dispstat_set_vblank_hblank_irqs: ; 80012B4 + thumb_func_start SetDispstatVBlankHBlankInterrupts +; void SetDispstatVBlankHBlankInterrupts(u16 mask) +SetDispstatVBlankHBlankInterrupts: ; 80012B4 push {r4,lr} adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 movs r0, 0x4 - bl lcd_io_get + bl GetGpuReg movs r2, 0x18 ands r2, r0 movs r1, 0x1 @@ -402,9 +402,9 @@ dispstat_set_vblank_hblank_irqs: ; 80012B4 cmp r2, r1 beq @080012EA movs r0, 0x4 - bl lcd_io_set + bl SetGpuReg @080012EA: pop {r4} pop {r0} bx r0 - thumb_func_end dispstat_set_vblank_hblank_irqs + thumb_func_end SetDispstatVBlankHBlankInterrupts diff --git a/asm/main.s b/asm/main.s index cbbf4a291..de7c59d37 100644 --- a/asm/main.s +++ b/asm/main.s @@ -10,27 +10,27 @@ Main: ldr r2, =0x00007fff adds r0, r2, 0 strh r0, [r1] - bl lcd_io_copy_queue_clean + bl InitGpuRegManager ldr r1, =0x04000204 ldr r3, =0x00004014 adds r0, r3, 0 strh r0, [r1] - bl init_keypad_data - bl init_irq_handler + bl InitKeypadData + bl InitIntrHandlers bl m4aSoundInit - bl lcd_enable_vcount_irq_at_150px + bl EnableVCountIntrAtLine150 bl sub_800E6D0 bl GameFreakRTC_Init - bl flash_timeout_start_on_timer_2_when_flash_present - bl init_saveblock_ptrs_and_set_copyright_callback2 + bl CheckForFlashMemory + bl InitVariablesAndSetCopyrightScreenCallback bl sound_sources_off bl ClearDma3Requests - bl gpu_init_bgs + bl ResetBgs bl SetDefaultFontsPointer ldr r0, =0x02000000 movs r1, 0xE0 lsls r1, 9 - bl init_malloc + bl InitHeap ldr r0, =0x03002700 movs r4, 0 strb r4, [r0] @@ -39,7 +39,7 @@ Main: cmp r0, 0x1 beq @08000414 movs r0, 0 - bl set_callback2 + bl SetMainCallback2 @08000414: ldr r2, =0x030022b4 strb r4, [r2] @@ -53,7 +53,7 @@ Main: mov r8, r0 adds r6, r2, 0 @0800042A: - bl load_keys + bl ReadKeypad ldr r0, =0x03002700 ldrb r0, [r0] cmp r0, 0 @@ -69,13 +69,13 @@ Main: bne @08000454 bl rfu_REQ_stopMode bl rfu_waitREQComplete - bl do_reset + bl Reset @08000454: bl sub_8087634 cmp r0, 0x1 bne @0800048C strb r0, [r6] - bl call_callbacks_wrapper + bl HandleLinkConnectionAndCallMainCallbacks movs r0, 0 strb r0, [r6] b @080004B2 @@ -84,7 +84,7 @@ Main: ldr r5, =0x030022b4 movs r0, 0 strb r0, [r5] - bl call_callbacks_wrapper + bl HandleLinkConnectionAndCallMainCallbacks bl sub_80875C8 adds r4, r0, 0 cmp r4, 0x1 @@ -93,34 +93,34 @@ Main: strh r0, [r7, 0x2E] bl copy_queue_clear strb r4, [r5] - bl call_callbacks_wrapper + bl HandleLinkConnectionAndCallMainCallbacks mov r2, r8 strb r2, [r5] @080004B2: bl gametime_increment bl sound_something - bl wait_for_vblank + bl WaitForVBlankIntr b @0800042A .pool thumb_func_end Main - thumb_func_start call_callbacks_wrapper -; void call_callbacks_wrapper() -call_callbacks_wrapper: ; 80004C4 + thumb_func_start HandleLinkConnectionAndCallMainCallbacks +; void HandleLinkConnectionAndCallMainCallbacks() +HandleLinkConnectionAndCallMainCallbacks: ; 80004C4 push {lr} - bl sub_800B40C + bl HandleLinkConnection lsls r0, 24 cmp r0, 0 bne @080004D4 - bl call_callbacks + bl CallMainCallbacks @080004D4: pop {r0} bx r0 - thumb_func_end call_callbacks_wrapper + thumb_func_end HandleLinkConnectionAndCallMainCallbacks - 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 + thumb_func_start InitVariablesAndSetCopyrightScreenCallback +; void InitVariablesAndSetCopyrightScreenCallback() +InitVariablesAndSetCopyrightScreenCallback: ; 80004D8 push {lr} ldr r2, =0x030022c0 movs r0, 0 @@ -130,7 +130,7 @@ init_saveblock_ptrs_and_set_copyright_callback2: ; 80004D8 str r0, [r2, 0x24] str r0, [r2] ldr r0, =c2_copyright_1 - bl set_callback2 + bl SetMainCallback2 ldr r1, =0x03005d90 ldr r0, =0x02024a54 str r0, [r1] @@ -140,11 +140,11 @@ init_saveblock_ptrs_and_set_copyright_callback2: ; 80004D8 pop {r0} bx r0 .pool - thumb_func_end init_saveblock_ptrs_and_set_copyright_callback2 + thumb_func_end InitVariablesAndSetCopyrightScreenCallback - thumb_func_start call_callbacks -; void call_callbacks() -call_callbacks: ; 800051C + thumb_func_start CallMainCallbacks +; void CallMainCallbacks() +CallMainCallbacks: ; 800051C push {r4,lr} ldr r4, =0x030022c0 ldr r0, [r4] @@ -161,11 +161,11 @@ call_callbacks: ; 800051C pop {r0} bx r0 .pool - thumb_func_end call_callbacks + thumb_func_end CallMainCallbacks - thumb_func_start set_callback2 -; void set_callback2(void ( *func)()) -set_callback2: ; 8000540 + thumb_func_start SetMainCallback2 +; void SetMainCallback2(void ( *func)()) +SetMainCallback2: ; 8000540 ldr r1, =0x030022c0 str r0, [r1, 0x4] movs r0, 0x87 @@ -175,21 +175,21 @@ set_callback2: ; 8000540 strb r0, [r1] bx lr .pool - thumb_func_end set_callback2 + thumb_func_end SetMainCallback2 - thumb_func_start start_timer1 -; void start_timer1() -start_timer1: ; 8000554 + thumb_func_start StartTimer1 +; void StartTimer1() +StartTimer1: ; 8000554 ldr r1, =0x04000106 movs r0, 0x80 strh r0, [r1] bx lr .pool - thumb_func_end start_timer1 + thumb_func_end StartTimer1 - 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 + thumb_func_start SetRngAndSetTrainerId +; void SetRngAndSetTrainerId() +SetRngAndSetTrainerId: ; 8000560 push {r4,lr} ldr r0, =0x04000104 ldrh r4, [r0] @@ -204,23 +204,23 @@ set_rand_seed_and_trainer_id_hi: ; 8000560 pop {r0} bx r0 .pool - thumb_func_end set_rand_seed_and_trainer_id_hi + thumb_func_end SetRngAndSetTrainerId - thumb_func_start get_trainer_id_hi -; u16 get_trainer_id_hi() -get_trainer_id_hi: ; 8000588 + thumb_func_start GetTrainerId +; u16 GetTrainerId() +GetTrainerId: ; 8000588 ldr r0, =0x02020000 ldrh r0, [r0] bx lr .pool - thumb_func_end get_trainer_id_hi + thumb_func_end GetTrainerId - thumb_func_start lcd_enable_vcount_irq_at_150px -; void lcd_enable_vcount_irq_at_150px() -lcd_enable_vcount_irq_at_150px: ; 8000594 + thumb_func_start EnableVCountIntrAtLine150 +; void EnableVCountIntrAtLine150() +EnableVCountIntrAtLine150: ; 8000594 push {lr} movs r0, 0x4 - bl lcd_io_get + bl GetGpuReg movs r1, 0xFF ands r1, r0 movs r2, 0x96 @@ -230,16 +230,16 @@ lcd_enable_vcount_irq_at_150px: ; 8000594 movs r0, 0x20 orrs r1, r0 movs r0, 0x4 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4 - bl enable_irqs + bl EnableInterrupts pop {r0} bx r0 - thumb_func_end lcd_enable_vcount_irq_at_150px + thumb_func_end EnableVCountIntrAtLine150 - thumb_func_start init_keypad_data -; void init_keypad_data() -init_keypad_data: ; 80005BC + thumb_func_start InitKeypadData +; void InitKeypadData() +InitKeypadData: ; 80005BC ldr r1, =0x030026fc movs r0, 0x5 strh r0, [r1] @@ -255,11 +255,11 @@ init_keypad_data: ; 80005BC strh r0, [r1, 0x2A] bx lr .pool - thumb_func_end init_keypad_data + thumb_func_end InitKeypadData - thumb_func_start load_keys -; void load_keys() -load_keys: ; 80005E4 + thumb_func_start ReadKeypad +; void ReadKeypad() +ReadKeypad: ; 80005E4 push {lr} ldr r0, =0x04000130 ldrh r1, [r0] @@ -334,11 +334,11 @@ load_keys: ; 80005E4 pop {r0} bx r0 .pool - thumb_func_end load_keys + thumb_func_end ReadKeypad - thumb_func_start init_irq_handler -; void init_irq_handler() -init_irq_handler: ; 8000684 + thumb_func_start InitIntrHandlers +; void InitIntrHandlers() +InitIntrHandlers: ; 8000684 push {r4,r5,lr} ldr r5, =InterruptMain ldr r4, =0x03002750 @@ -364,17 +364,17 @@ init_irq_handler: ; 8000684 movs r0, 0 bl SetHBlankCallback movs r0, 0 - bl set_serial_callback + bl SetSerialCallback ldr r1, =0x04000208 movs r0, 0x1 strh r0, [r1] movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end init_irq_handler + thumb_func_end InitIntrHandlers thumb_func_start SetVBlankCallback ; void SetVBlankCallback(void ( *func)()) @@ -395,6 +395,7 @@ SetHBlankCallback: ; 80006FC thumb_func_end SetHBlankCallback thumb_func_start SetVCountCallback +; void SetVCountCallback(void ( *func)()) SetVCountCallback: ; 8000708 ldr r1, =0x030022c0 str r0, [r1, 0x14] @@ -402,30 +403,30 @@ SetVCountCallback: ; 8000708 .pool thumb_func_end SetVCountCallback - thumb_func_start restore_serial_timer3_irq_handlers -; void restore_serial_timer3_irq_handlers() -restore_serial_timer3_irq_handlers: ; 8000714 + thumb_func_start RestoreSerialTimer3IntrHandlers +; void RestoreSerialTimer3IntrHandlers() +RestoreSerialTimer3IntrHandlers: ; 8000714 ldr r0, =0x03002710 - ldr r1, =irq_serial + ldr r1, =SerialIntr str r1, [r0, 0x4] - ldr r1, =irq_timer3 + ldr r1, =Timer3Intr str r1, [r0, 0x8] bx lr .pool - thumb_func_end restore_serial_timer3_irq_handlers + thumb_func_end RestoreSerialTimer3IntrHandlers - thumb_func_start set_serial_callback -; void set_serial_callback(void ( *func)()) -set_serial_callback: ; 800072C + thumb_func_start SetSerialCallback +; void SetSerialCallback(void ( *func)()) +SetSerialCallback: ; 800072C ldr r1, =0x030022c0 str r0, [r1, 0x18] bx lr .pool - thumb_func_end set_serial_callback + thumb_func_end SetSerialCallback - thumb_func_start irq_vblank -; void irq_vblank() -irq_vblank: ; 8000738 + thumb_func_start VBlankIntr +; void VBlankIntr() +VBlankIntr: ; 8000738 push {r4,lr} ldr r0, =0x030030fc ldrb r0, [r0] @@ -466,7 +467,7 @@ irq_vblank: ; 8000738 ldr r0, [r4, 0x24] adds r0, 0x1 str r0, [r4, 0x24] - bl lcd_io_copy_queue_process + bl CopyBufferedValuesToGpuRegs bl ProcessDma3Requests ldr r1, =0x03002f50 ldr r0, =0x03006380 @@ -505,11 +506,11 @@ irq_vblank: ; 8000738 pop {r0} bx r0 .pool - thumb_func_end irq_vblank + thumb_func_end VBlankIntr - thumb_func_start flash_timeout_start_on_timer_2 -; void flash_timeout_start_on_timer_2() -flash_timeout_start_on_timer_2: ; 8000800 + thumb_func_start StartFlashMemoryTimer +; void StartFlashMemoryTimer() +StartFlashMemoryTimer: ; 8000800 push {lr} ldr r1, =0x0300272c movs r0, 0x2 @@ -517,11 +518,11 @@ flash_timeout_start_on_timer_2: ; 8000800 pop {r0} bx r0 .pool - thumb_func_end flash_timeout_start_on_timer_2 + thumb_func_end StartFlashMemoryTimer - thumb_func_start irq_hblank -; void irq_hblank() -irq_hblank: ; 8000814 + thumb_func_start HBlankIntr +; void HBlankIntr() +HBlankIntr: ; 8000814 push {r4,lr} ldr r4, =0x030022c0 ldr r0, [r4, 0x10] @@ -542,11 +543,11 @@ irq_hblank: ; 8000814 pop {r0} bx r0 .pool - thumb_func_end irq_hblank + thumb_func_end HBlankIntr - thumb_func_start irq_vcount -; void irq_vcount() -irq_vcount: ; 8000844 + thumb_func_start VCountIntr +; void VCountIntr() +VCountIntr: ; 8000844 push {r4,lr} ldr r4, =0x030022c0 ldr r0, [r4, 0x14] @@ -568,11 +569,11 @@ irq_vcount: ; 8000844 pop {r0} bx r0 .pool - thumb_func_end irq_vcount + thumb_func_end VCountIntr - thumb_func_start irq_serial -; void irq_serial() -irq_serial: ; 8000878 + thumb_func_start SerialIntr +; void SerialIntr() +SerialIntr: ; 8000878 push {r4,lr} ldr r4, =0x030022c0 ldr r0, [r4, 0x18] @@ -593,17 +594,17 @@ irq_serial: ; 8000878 pop {r0} bx r0 .pool - thumb_func_end irq_serial + thumb_func_end SerialIntr - thumb_func_start irq_other -; void irq_other() -irq_other: ; 80008A8 + thumb_func_start DummyIntrHandler +; void DummyIntrHandler() +DummyIntrHandler: ; 80008A8 bx lr - thumb_func_end irq_other + thumb_func_end DummyIntrHandler - thumb_func_start wait_for_vblank -; void wait_for_vblank() -wait_for_vblank: ; 80008AC + thumb_func_start WaitForVBlankIntr +; void WaitForVBlankIntr() +WaitForVBlankIntr: ; 80008AC push {lr} ldr r2, =0x030022c0 ldrh r1, [r2, 0x1C] @@ -627,7 +628,7 @@ wait_for_vblank: ; 80008AC pop {r0} bx r0 .pool - thumb_func_end wait_for_vblank + thumb_func_end WaitForVBlankIntr thumb_func_start sub_80008DC sub_80008DC: ; 80008DC @@ -646,9 +647,9 @@ sub_80008E8: ; 80008E8 .pool thumb_func_end sub_80008E8 - thumb_func_start do_reset -; void do_reset() -do_reset: ; 80008F4 + thumb_func_start Reset +; void Reset() +Reset: ; 80008F4 push {r4,lr} ldr r1, =0x04000208 movs r0, 0 @@ -692,7 +693,7 @@ do_reset: ; 80008F4 pop {r0} bx r0 .pool - thumb_func_end do_reset + thumb_func_end Reset thumb_func_start sub_8000964 sub_8000964: ; 8000964 diff --git a/asm/main_menu.s b/asm/main_menu.s index a998d24b6..4e78d9e50 100644 --- a/asm/main_menu.s +++ b/asm/main_menu.s @@ -53,34 +53,34 @@ InitMainMenu: ; 802F6F4 bl SetVBlankCallback movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg add r1, sp, 0x4 movs r0, 0 strh r0, [r1] @@ -146,27 +146,27 @@ InitMainMenu: ; 802F6F4 bl pal_fade_maybe @0802F7FE: movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_082FF0E8 movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_x_offset + bl ChangeBgX movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY ldr r0, =gUnknown_082FF038 bl InitWindows bl DeactivateAllTextPrinters @@ -175,39 +175,39 @@ InitMainMenu: ; 802F6F4 bl LoadMainMenuWindowFrameTiles movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 - bl enable_irqs + bl EnableInterrupts ldr r0, =VBlankCB_MainMenu bl SetVBlankCallback ldr r0, =CB2_MainMenu - bl set_callback2 + bl SetMainCallback2 movs r1, 0xC1 lsls r1, 6 movs r0, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_hide + bl HideBg ldr r0, =Task_MainMenuCheckSaveFile movs r1, 0 bl AddTask @@ -245,25 +245,25 @@ Task_MainMenuCheckSaveFile: ; 802F8D8 @0802F900: movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x11 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x31 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0xC1 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0x7 - bl lcd_io_set + bl SetGpuReg bl sub_80093CC lsls r0, 24 cmp r0, 0 @@ -453,25 +453,25 @@ Task_MainMenuCheckBattery: ; 802FAB0 bne @0802FB3C movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x11 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x31 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0xC1 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0x7 - bl lcd_io_set + bl SetGpuReg bl GameFreakRTC_GetErrorFlags movs r1, 0xFF lsls r1, 4 @@ -567,25 +567,25 @@ Task_DisplayMainMenu: ; 802FBA4 @0802FBCE: movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0x11 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0x31 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0xC1 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0x7 - bl lcd_io_set + bl SetGpuReg add r0, sp, 0xC strh r4, [r0] movs r1, 0xFE @@ -1001,11 +1001,11 @@ Task_DisplayMainMenu: ; 802FBA4 movs r0, 0 adds r1, r4, 0 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 adds r1, r4, 0 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 strh r0, [r6, 0x1C] movs r2, 0x1A @@ -1113,10 +1113,10 @@ HandleMainMenuInput: ; 80300E0 bl pal_fade_maybe movs r0, 0x40 movs r1, 0xF0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0xA0 - bl lcd_io_set + bl SetGpuReg adds r0, r7, 0 subs r0, 0x8 adds r0, r4, r0 @@ -1148,11 +1148,11 @@ HandleMainMenuInput: ; 80300E0 movs r0, 0 adds r1, r4, 0 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 adds r1, r4, 0 movs r2, 0x2 - bl bg_change_y_offset + bl ChangeBgY movs r2, 0x1A ldrsh r1, [r5, r2] lsls r0, r1, 2 @@ -1195,11 +1195,11 @@ HandleMainMenuInput: ; 80300E0 movs r0, 0 adds r1, r4, 0 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 adds r1, r4, 0 movs r2, 0x1 - bl bg_change_y_offset + bl ChangeBgY ldr r2, =0x03005e00 movs r0, 0x1A ldrsh r1, [r5, r0] @@ -1431,11 +1431,11 @@ Task_HandleMainMenuAPressed: ; 803027C movs r0, 0 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY movs r0, 0x1 movs r1, 0 movs r2, 0 - bl bg_change_y_offset + bl ChangeBgY cmp r5, 0x6 bhi @0803041C lsls r0, r5, 2 @@ -1494,7 +1494,7 @@ Task_HandleMainMenuAPressed: ; 803027C @08030488: ldr r0, =sub_801867C @0803048A: - bl set_callback2 + bl SetMainCallback2 adds r0, r6, 0 bl remove_task b @08030514 @@ -1519,22 +1519,22 @@ Task_HandleMainMenuAPressed: ; 803027C strh r1, [r0] movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 negs r0, r0 str r4, [sp] @@ -1602,7 +1602,7 @@ Task_HandleMainMenuBPressed: ; 8030544 strh r4, [r0] bl FreeAllWindowBuffers ldr r0, =c2_title_screen_1 - bl set_callback2 + bl SetMainCallback2 adds r0, r5, 0 bl remove_task @0803058C: @@ -1649,7 +1649,7 @@ Task_DisplayMainMenuInvalidActionError: ; 80305A4 movs r1, 0 movs r2, 0 movs r3, 0 - bl bg_fill_tilemap_rect + bl FillBgTileMapBufferRect_Palette0 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x1 @@ -1743,7 +1743,7 @@ HighlightSelectedMainMenuItem: ; 8030698 lsrs r6, r2, 16 ldr r1, =0x000009e7 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg cmp r5, 0x1 beq @080306DC cmp r5, 0x1 @@ -1855,13 +1855,13 @@ HighlightSelectedMainMenuItem: ; 8030698 ldr r1, =0x0000819f @0803078E: movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg b @080307A4 .pool @0803079C: ldr r1, =0x0000819f movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg @080307A4: pop {r4-r6} pop {r0} @@ -1879,34 +1879,34 @@ task_new_game_prof_birch_speech_1: ; 80307B0 lsrs r4, 24 movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_082FF0F0 - bl bg_init_bg_config_2_from_bg_config_3 + bl InitBgFromTemplate movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =gUnknown_082FED3C movs r1, 0xC0 lsls r1, 19 @@ -1927,7 +1927,7 @@ task_new_game_prof_birch_speech_1: ; 80307B0 bl gpu_pal_allocator_reset bl dp13_810BB8C adds r0, r4, 0 - bl sub_803192C + bl AddBirchSpeechObjects movs r0, 0x1 negs r0, r0 movs r5, 0 @@ -1953,9 +1953,9 @@ task_new_game_prof_birch_speech_1: ; 80307B0 lsls r0, 1 bl song_play_for_text movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg add sp, 0x4 pop {r4,r5} pop {r0} @@ -2430,7 +2430,7 @@ task_new_game_prof_birch_speech_8: ; 8030C90 strh r0, [r2, 0x10] ldrh r1, [r2, 0x10] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg b @08030CC8 .pool @08030CC0: @@ -3102,7 +3102,7 @@ task_new_game_prof_birch_speech_part2_5: ; 8031220 strh r0, [r1, 0x10] ldrh r1, [r1, 0x10] movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg b @08031250 .pool @0803124C: @@ -3544,7 +3544,7 @@ task_new_game_prof_birch_speech_part2_11: ; 80315BC movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0xffff0000 ldr r1, =0x0000ffff str r1, [sp] @@ -3583,7 +3583,7 @@ task_new_game_prof_birch_speech_part2_12: ; 8031630 bl sub_818D820 bl dp13_810BB8C ldr r0, =c2_new_game - bl set_callback2 + bl SetMainCallback2 adds r0, r4, 0 bl remove_task @08031666: @@ -3598,49 +3598,49 @@ new_game_prof_birch_speech_part2_start: ; 8031678 push {r4,r5,lr} sub sp, 0xC movs r0, 0 - bl gpu_reset_bgs_and_dma3_busy_flags + bl ResetBgsAndClearDma3BusyFlags movs r0, 0 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r1, 0x82 lsls r1, 5 movs r0, 0 - bl lcd_io_set + bl SetGpuReg ldr r1, =gUnknown_082FF0E8 movs r0, 0 movs r2, 0x2 - bl bg_vram_setup + bl InitBgsFromTemplates ldr r0, =gUnknown_082FF0F0 - bl bg_init_bg_config_2_from_bg_config_3 + bl InitBgFromTemplate movs r0, 0 bl SetVBlankCallback movs r0, 0xC movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0xA movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x8 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x18 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x14 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x16 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x10 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x12 movs r1, 0 - bl lcd_io_set + bl SetGpuReg add r0, sp, 0x4 movs r4, 0 strh r4, [r0] @@ -3706,7 +3706,7 @@ new_game_prof_birch_speech_part2_start: ; 8031678 bl gpu_pal_allocator_reset bl dp13_810BB8C adds r0, r5, 0 - bl sub_803192C + bl AddBirchSpeechObjects ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] @@ -3744,7 +3744,7 @@ new_game_prof_birch_speech_part2_start: ; 8031678 strh r3, [r0, 0xC] ldr r1, =0x0000ffc4 movs r0, 0x14 - bl lcd_io_set + bl SetGpuReg movs r0, 0x1 negs r0, r0 str r4, [sp] @@ -3754,29 +3754,29 @@ new_game_prof_birch_speech_part2_start: ; 8031678 bl pal_fade_maybe movs r0, 0x40 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x44 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x48 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x4A movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x50 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg movs r0, 0 - bl gpu_sync_bg_show + bl ShowBg movs r0, 0x1 - bl gpu_sync_bg_show + bl ShowBg ldr r3, =0x04000208 ldrh r2, [r3] strh r4, [r3] @@ -3789,7 +3789,7 @@ new_game_prof_birch_speech_part2_start: ; 8031678 ldr r0, =VBlankCB_MainMenu bl SetVBlankCallback ldr r0, =CB2_MainMenu - bl set_callback2 + bl SetMainCallback2 ldr r0, =gUnknown_082FF080 bl InitWindows movs r0, 0 @@ -3861,8 +3861,9 @@ sub_80318F4: ; 80318F4 .pool thumb_func_end sub_80318F4 - thumb_func_start sub_803192C -sub_803192C: ; 803192C + thumb_func_start AddBirchSpeechObjects +; void AddBirchSpeechObjects(u8 taskId) +AddBirchSpeechObjects: ; 803192C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -3875,7 +3876,7 @@ sub_803192C: ; 803192C movs r0, 0x88 movs r1, 0x3C movs r2, 0x1 - bl sub_80B5F44 + bl AddNewGameBirchObject lsls r0, 24 lsrs r0, 24 ldr r1, =0x02020630 @@ -3932,7 +3933,7 @@ sub_803192C: ; 803192C strb r1, [r2] strh r0, [r5, 0x1A] movs r0, 0x3C - bl sub_806EFF0 + bl TrainerClassToTrainerPic lsls r0, 24 lsrs r0, 24 ldr r4, =0x0201c000 @@ -3962,7 +3963,7 @@ sub_803192C: ; 803192C strb r1, [r2, 0x5] strh r0, [r5, 0x1C] movs r0, 0x3F - bl sub_806EFF0 + bl TrainerClassToTrainerPic lsls r0, 24 lsrs r0, 24 ldr r1, =0x0201c000 @@ -4002,10 +4003,10 @@ sub_803192C: ; 803192C pop {r0} bx r0 .pool - thumb_func_end sub_803192C + thumb_func_end AddBirchSpeechObjects - thumb_func_start waterfall_4_check_if_can_continue -waterfall_4_check_if_can_continue: ; 8031A5C + thumb_func_start sub_8031A5C +sub_8031A5C: ; 8031A5C push {r4,r5,lr} lsls r0, 24 lsrs r3, r0, 24 @@ -4055,12 +4056,12 @@ waterfall_4_check_if_can_continue: ; 8031A5C lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @08031AC4: pop {r4,r5} pop {r0} bx r0 - thumb_func_end waterfall_4_check_if_can_continue + thumb_func_end sub_8031A5C thumb_func_start sub_8031ACC sub_8031ACC: ; 8031ACC @@ -4076,13 +4077,13 @@ sub_8031ACC: ; 8031ACC movs r1, 0x94 lsls r1, 2 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r0, 0x52 movs r1, 0x10 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x03005e00 mov r8, r0 lsls r0, r4, 2 @@ -4091,7 +4092,7 @@ sub_8031ACC: ; 8031ACC add r0, r8 movs r6, 0 strh r6, [r0, 0x12] - ldr r0, =waterfall_4_check_if_can_continue + ldr r0, =sub_8031A5C movs r1, 0 bl AddTask lsls r0, 24 @@ -4165,7 +4166,7 @@ sub_8031B3C: ; 8031B3C lsls r1, 16 lsrs r1, 16 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg @08031BA4: pop {r4,r5} pop {r0} @@ -4186,14 +4187,14 @@ sub_8031BAC: ; 8031BAC movs r1, 0x94 lsls r1, 2 movs r0, 0x50 - bl lcd_io_set + bl SetGpuReg movs r1, 0x80 lsls r1, 5 movs r0, 0x52 - bl lcd_io_set + bl SetGpuReg movs r0, 0x54 movs r1, 0 - bl lcd_io_set + bl SetGpuReg ldr r0, =0x03005e00 mov r8, r0 lsls r0, r4, 2 @@ -4512,10 +4513,10 @@ CreateMainMenuErrorWindow: ; 8031E18 bl DrawMainMenuWindowFrame ldr r1, =0x000009e7 movs r0, 0x40 - bl lcd_io_set + bl SetGpuReg ldr r1, =0x0000719f movs r0, 0x44 - bl lcd_io_set + bl SetGpuReg add sp, 0xC pop {r4} pop {r0} @@ -4781,7 +4782,7 @@ LoadMainMenuWindowFrameTiles: ; 80320A4 lsls r2, 1 adds r0, r4, 0 adds r3, r5, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r0, [r6] ldrb r0, [r0, 0x14] lsrs r0, 3 @@ -4857,7 +4858,7 @@ DrawMainMenuWindowFrame: ; 80320EC movs r7, 0x2 mov r8, r7 str r7, [sp, 0x8] - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r0, [r4] ldrb r2, [r4, 0x1] ldrb r3, [r4, 0x2] @@ -4869,7 +4870,7 @@ DrawMainMenuWindowFrame: ; 80320EC str r5, [sp, 0x4] str r7, [sp, 0x8] mov r1, r9 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r0, [r4] ldrb r2, [r4, 0x3] ldrb r1, [r4, 0x1] @@ -4884,7 +4885,7 @@ DrawMainMenuWindowFrame: ; 80320EC str r5, [sp, 0x4] str r7, [sp, 0x8] mov r1, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r0, [r4] ldrb r2, [r4, 0x1] subs r2, 0x1 @@ -4896,7 +4897,7 @@ DrawMainMenuWindowFrame: ; 80320EC str r1, [sp, 0x4] str r7, [sp, 0x8] ldr r1, [sp, 0x18] - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r0, [r4] ldrb r2, [r4, 0x3] ldrb r7, [r4, 0x1] @@ -4910,7 +4911,7 @@ DrawMainMenuWindowFrame: ; 80320EC mov r1, r8 str r1, [sp, 0x8] ldr r1, [sp, 0xC] - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r0, [r4] ldrb r2, [r4, 0x1] subs r2, 0x1 @@ -4926,7 +4927,7 @@ DrawMainMenuWindowFrame: ; 80320EC mov r1, r8 str r1, [sp, 0x8] ldr r1, [sp, 0x10] - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r0, [r4] ldrb r2, [r4, 0x1] ldrb r3, [r4, 0x4] @@ -4940,7 +4941,7 @@ DrawMainMenuWindowFrame: ; 80320EC mov r1, r8 str r1, [sp, 0x8] ldr r1, [sp, 0x14] - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r0, [r4] ldrb r2, [r4, 0x3] ldrb r7, [r4, 0x1] @@ -4957,9 +4958,9 @@ DrawMainMenuWindowFrame: ; 80320EC mov r7, r8 str r7, [sp, 0x8] adds r1, r6, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r0, [r4] - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0x1C pop {r3-r5} mov r8, r3 @@ -4999,9 +5000,9 @@ sub_8032250: ; 8032250 movs r1, 0x2 str r1, [sp, 0x8] movs r1, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldrb r0, [r6] - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram add sp, 0xC pop {r4-r6} pop {r0} @@ -5040,7 +5041,7 @@ sub_8032298: ; 8032298 movs r1, 0 adds r2, r4, 0 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0xC pop {r4,r5} pop {r0} @@ -5297,7 +5298,7 @@ sub_8032474: ; 8032474 movs r1, 0xFD ldr r2, [sp, 0x14] adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r0, [sp, 0xC] subs r0, 0x1 lsls r2, r0, 24 @@ -5309,7 +5310,7 @@ sub_8032474: ; 8032474 mov r0, r8 movs r1, 0xFF adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r1, 0x80 lsls r1, 1 mov r0, r9 @@ -5319,7 +5320,7 @@ sub_8032474: ; 8032474 mov r0, r8 ldr r2, [sp, 0xC] adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000101 ldr r7, [sp, 0xC] add r7, r9 @@ -5332,7 +5333,7 @@ sub_8032474: ; 8032474 str r6, [sp, 0x8] mov r0, r8 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r1, 0x81 lsls r1, 1 lsls r2, r7, 24 @@ -5343,7 +5344,7 @@ sub_8032474: ; 8032474 mov r0, r8 adds r2, r7, 0 adds r3, r5, 0 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000103 str r4, [sp] movs r5, 0x5 @@ -5352,7 +5353,7 @@ sub_8032474: ; 8032474 mov r0, r8 ldr r2, [sp, 0x14] mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000105 mov r0, r9 adds r0, 0x1 @@ -5364,7 +5365,7 @@ sub_8032474: ; 8032474 mov r0, r8 ldr r2, [sp, 0x18] mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r1, 0x83 lsls r1, 1 str r4, [sp] @@ -5373,7 +5374,7 @@ sub_8032474: ; 8032474 mov r0, r8 adds r2, r7, 0 mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x000008fd ldr r2, [sp, 0x10] add r10, r2 @@ -5387,7 +5388,7 @@ sub_8032474: ; 8032474 mov r0, r8 ldr r2, [sp, 0x14] mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x000008ff str r4, [sp] str r4, [sp, 0x4] @@ -5395,7 +5396,7 @@ sub_8032474: ; 8032474 mov r0, r8 ldr r2, [sp, 0x18] mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect movs r1, 0x90 lsls r1, 4 movs r2, 0x1 @@ -5410,7 +5411,7 @@ sub_8032474: ; 8032474 mov r0, r8 ldr r2, [sp, 0xC] mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000901 str r4, [sp] str r4, [sp, 0x4] @@ -5418,7 +5419,7 @@ sub_8032474: ; 8032474 mov r0, r8 ldr r2, [sp, 0x1C] mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect ldr r1, =0x00000902 str r4, [sp] str r4, [sp, 0x4] @@ -5426,7 +5427,7 @@ sub_8032474: ; 8032474 mov r0, r8 adds r2, r7, 0 mov r3, r10 - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0x20 pop {r3-r5} mov r8, r3 diff --git a/asm/malloc.s b/asm/malloc.s index 70cf24ea3..c30f5285f 100644 --- a/asm/malloc.s +++ b/asm/malloc.s @@ -1,6 +1,6 @@ - thumb_func_start malloc_header -; void malloc_header(struct memblk *blk, struct memblk *prev, struct memblk *next, u32 size) -malloc_header: ; 8000988 + thumb_func_start PutMemBlockHeader +; void PutMemBlockHeader(struct MemBlock *block, struct MemBlock *prev, struct MemBlock *next, u32 size) +PutMemBlockHeader: ; 8000988 push {r4,lr} movs r4, 0 strh r4, [r0] @@ -13,24 +13,24 @@ malloc_header: ; 8000988 pop {r0} bx r0 .pool - thumb_func_end malloc_header + thumb_func_end PutMemBlockHeader - thumb_func_start malloc_unlinked_header -; void malloc_unlinked_header(struct memblk *blk, u32 size) -malloc_unlinked_header: ; 80009A4 + thumb_func_start PutFirstMemBlockHeader +; void PutFirstMemBlockHeader(struct MemBlock *block, u32 size) +PutFirstMemBlockHeader: ; 80009A4 push {lr} adds r2, r0, 0 adds r3, r1, 0 subs r3, 0x10 adds r1, r2, 0 - bl malloc_header + bl PutMemBlockHeader pop {r0} bx r0 - thumb_func_end malloc_unlinked_header + thumb_func_end PutFirstMemBlockHeader - thumb_func_start malloc_core -; void *malloc_core(struct memblk *head, u32 size) -malloc_core: ; 80009B8 + thumb_func_start AllocInternal +; void *AllocInternal(struct MemBlock *head, u32 size) +AllocInternal: ; 80009B8 push {r4-r6,lr} adds r4, r0, 0 adds r6, r4, 0 @@ -66,7 +66,7 @@ malloc_core: ; 80009B8 ldr r2, [r4, 0xC] adds r0, r5, 0 adds r1, r4, 0 - bl malloc_header + bl PutMemBlockHeader str r5, [r4, 0xC] ldr r0, [r5, 0xC] cmp r0, r6 @@ -88,11 +88,11 @@ malloc_core: ; 80009B8 pop {r4-r6} pop {r1} bx r1 - thumb_func_end malloc_core + thumb_func_end AllocInternal - thumb_func_start free_core -; void free_core(struct memblk *head, struct memblk *node) -free_core: ; 8000A20 + thumb_func_start FreeInternal +; void FreeInternal(struct MemBlock *head, struct MemBlock *node) +FreeInternal: ; 8000A20 push {r4,r5,lr} cmp r1, 0 beq @08000A7C @@ -145,15 +145,15 @@ free_core: ; 8000A20 pop {r4,r5} pop {r0} bx r0 - thumb_func_end free_core + thumb_func_end FreeInternal - thumb_func_start malloc_core_and_clear -; void *malloc_core_and_clear(struct memblk *head, unsigned int size) -malloc_core_and_clear: ; 8000A84 + thumb_func_start AllocZeroedInternal +; void *AllocZeroedInternal(struct MemBlock *head, u32 size) +AllocZeroedInternal: ; 8000A84 push {r4,r5,lr} sub sp, 0x4 adds r4, r1, 0 - bl malloc_core + bl AllocInternal adds r5, r0, 0 cmp r5, 0 beq @08000AB8 @@ -181,11 +181,11 @@ malloc_core_and_clear: ; 8000A84 pop {r4,r5} pop {r1} bx r1 - thumb_func_end malloc_core_and_clear + thumb_func_end AllocZeroedInternal - thumb_func_start check_memblk_core -; _BOOL4 check_memblk_core(struct memblk *head, struct memblk *node) -check_memblk_core: ; 8000AC4 + thumb_func_start CheckMemBlockInternal +; BOOL CheckMemBlockInternal(struct MemBlock *head, struct MemBlock *node) +CheckMemBlockInternal: ; 8000AC4 push {r4,r5,lr} adds r5, r0, 0 adds r3, r1, 0 @@ -233,77 +233,77 @@ check_memblk_core: ; 8000AC4 pop {r4,r5} pop {r1} bx r1 - thumb_func_end check_memblk_core + thumb_func_end CheckMemBlockInternal - thumb_func_start init_malloc -; void init_malloc(u32 heapStart, u32 heapSize) -init_malloc: ; 8000B1C + thumb_func_start InitHeap +; void InitHeap(void *heapStart, u32 heapSize) +InitHeap: ; 8000B1C push {lr} ldr r2, =0x03000004 str r0, [r2] ldr r2, =0x03000008 str r1, [r2] - bl malloc_unlinked_header + bl PutFirstMemBlockHeader pop {r0} bx r0 .pool - thumb_func_end init_malloc + thumb_func_end InitHeap - thumb_func_start malloc -; void *malloc(u32 size) -malloc: ; 8000B38 + thumb_func_start Alloc +; void *Alloc(u32 size) +Alloc: ; 8000B38 push {lr} adds r1, r0, 0 ldr r0, =0x03000004 ldr r0, [r0] - bl malloc_core + bl AllocInternal pop {r1} bx r1 .pool - thumb_func_end malloc + thumb_func_end Alloc - thumb_func_start malloc_and_clear -; void *malloc_and_clear(u32 size) -malloc_and_clear: ; 8000B4C + thumb_func_start AllocZeroed +; void *AllocZeroed(u32 size) +AllocZeroed: ; 8000B4C push {lr} adds r1, r0, 0 ldr r0, =0x03000004 ldr r0, [r0] - bl malloc_core_and_clear + bl AllocZeroedInternal pop {r1} bx r1 .pool - thumb_func_end malloc_and_clear + thumb_func_end AllocZeroed - thumb_func_start free -; void free(void *ptr) -free: ; 8000B60 + thumb_func_start Free +; void Free(void *pointer) +Free: ; 8000B60 push {lr} adds r1, r0, 0 ldr r0, =0x03000004 ldr r0, [r0] - bl free_core + bl FreeInternal pop {r0} bx r0 .pool - thumb_func_end free + thumb_func_end Free - thumb_func_start check_memblk -; _BOOL4 check_memblk(struct memblk *node) -check_memblk: ; 8000B74 + thumb_func_start CheckMemBlock +; BOOL CheckMemBlock(struct MemBlock *node) +CheckMemBlock: ; 8000B74 push {lr} adds r1, r0, 0 ldr r0, =0x03000004 ldr r0, [r0] - bl check_memblk_core + bl CheckMemBlockInternal pop {r1} bx r1 .pool - thumb_func_end check_memblk + thumb_func_end CheckMemBlock - thumb_func_start check_all_memblks -; _BOOL4 check_all_memblks() -check_all_memblks: ; 8000B88 + thumb_func_start CheckHeap +; BOOL CheckHeap() +CheckHeap: ; 8000B88 push {r4,r5,lr} ldr r0, =0x03000004 ldr r4, [r0] @@ -312,7 +312,7 @@ check_all_memblks: ; 8000B88 ldr r0, [r5] adds r1, r4, 0 adds r1, 0x10 - bl check_memblk_core + bl CheckMemBlockInternal cmp r0, 0 beq @08000BB0 ldr r4, [r4, 0xC] @@ -328,4 +328,4 @@ check_all_memblks: ; 8000B88 pop {r4,r5} pop {r1} bx r1 - thumb_func_end check_all_memblks + thumb_func_end CheckHeap diff --git a/asm/pixel_buffer.s b/asm/pixel_buffer.s index 199c748bb..7f866010c 100644 --- a/asm/pixel_buffer.s +++ b/asm/pixel_buffer.s @@ -1,6 +1,6 @@ - thumb_func_start BlitSurface4BitWithoutColorKey -; void BlitSurface4BitWithoutColorKey(struct Surface *src, struct Surface *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height) -BlitSurface4BitWithoutColorKey: ; 8002BDC + thumb_func_start BlitBitmapRect4BitWithoutColorKey +; void BlitBitmapRect4BitWithoutColorKey(struct Bitmap *src, struct Bitmap *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height) +BlitBitmapRect4BitWithoutColorKey: ; 8002BDC push {r4-r7,lr} mov r7, r8 push {r7} @@ -27,18 +27,18 @@ BlitSurface4BitWithoutColorKey: ; 8002BDC str r7, [sp, 0xC] movs r4, 0xFF str r4, [sp, 0x10] - bl BlitSurface4Bit + bl BlitBitmapRect4Bit add sp, 0x14 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 - thumb_func_end BlitSurface4BitWithoutColorKey + thumb_func_end BlitBitmapRect4BitWithoutColorKey - thumb_func_start BlitSurface4Bit -; void BlitSurface4Bit(struct Surface *src, struct Surface *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height, u8 colorKey) -BlitSurface4Bit: ; 8002C20 + thumb_func_start BlitBitmapRect4Bit +; void BlitBitmapRect4Bit(struct Bitmap *src, struct Bitmap *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height, u8 colorKey) +BlitBitmapRect4Bit: ; 8002C20 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -289,11 +289,11 @@ BlitSurface4Bit: ; 8002C20 pop {r4-r7} pop {r0} bx r0 - thumb_func_end BlitSurface4Bit + thumb_func_end BlitBitmapRect4Bit - thumb_func_start FillSurfaceRect4Bit -; void FillSurfaceRect4Bit(struct Surface *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue) -FillSurfaceRect4Bit: ; 8002E00 + thumb_func_start FillBitmapRect4Bit +; void FillBitmapRect4Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue) +FillBitmapRect4Bit: ; 8002E00 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -401,11 +401,11 @@ FillSurfaceRect4Bit: ; 8002E00 pop {r4-r7} pop {r0} bx r0 - thumb_func_end FillSurfaceRect4Bit + thumb_func_end FillBitmapRect4Bit - thumb_func_start BlitSurface4BitTo8Bit -; void BlitSurface4BitTo8Bit(struct Surface *src, struct Surface *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height, u8 colorKey, u8 paletteOffset) -BlitSurface4BitTo8Bit: ; 8002EC8 + thumb_func_start BlitBitmapRect4BitTo8Bit +; void BlitBitmapRect4BitTo8Bit(struct Bitmap *src, struct Bitmap *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height, u8 colorKey, u8 paletteOffset) +BlitBitmapRect4BitTo8Bit: ; 8002EC8 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -718,11 +718,11 @@ BlitSurface4BitTo8Bit: ; 8002EC8 pop {r4-r7} pop {r0} bx r0 - thumb_func_end BlitSurface4BitTo8Bit + thumb_func_end BlitBitmapRect4BitTo8Bit - thumb_func_start FillSurfaceRect8Bit -; void FillSurfaceRect8Bit(struct Surface *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue) -FillSurfaceRect8Bit: ; 8003118 + thumb_func_start FillBitmapRect8Bit +; void FillBitmapRect8Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue) +FillBitmapRect8Bit: ; 8003118 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -811,4 +811,4 @@ FillSurfaceRect8Bit: ; 8003118 pop {r4-r7} pop {r0} bx r0 - thumb_func_end FillSurfaceRect8Bit + thumb_func_end FillBitmapRect8Bit diff --git a/asm/text_renderer.s b/asm/text_renderer.s index 8b43a5bd4..e94a21895 100644 --- a/asm/text_renderer.s +++ b/asm/text_renderer.s @@ -1789,7 +1789,7 @@ ClearTextSpan: ; 80052C8 lsrs r0, 24 str r0, [sp, 0x4] add r0, sp, 0x8 - bl FillSurfaceRect4Bit + bl FillBitmapRect4Bit @0800531E: add sp, 0x10 pop {r4-r6} @@ -2158,7 +2158,7 @@ TextPrinterDrawDownArrow: ; 8005528 str r2, [sp, 0x14] adds r1, r7, 0 movs r2, 0 - bl BlitSurfaceRectToWindow + bl BlitBitmapRectToWindow ldrb r0, [r5, 0x4] movs r1, 0x2 bl CopyWindowToVram @@ -2396,7 +2396,7 @@ DrawDownArrow: ; 80056E0 adds r0, r5, 0 adds r1, r6, 0 movs r2, 0 - bl BlitSurfaceRectToWindow + bl BlitBitmapRectToWindow adds r0, r5, 0 movs r1, 0x2 bl CopyWindowToVram @@ -3849,7 +3849,7 @@ DrawKeypadIcon: ; 80062E8 adds r1, r5, 0 movs r2, 0 movs r3, 0 - bl BlitSurfaceRectToWindow + bl BlitBitmapRectToWindow adds r0, r4, 0 add sp, 0x18 pop {r4,r5} diff --git a/asm/window.s b/asm/window.s index 2bf67e269..26ad6eded 100644 --- a/asm/window.s +++ b/asm/window.s @@ -20,7 +20,7 @@ InitWindows: ; 80031C0 mov r1, r8 lsls r0, r1, 24 lsrs r0, 24 - bl bg_get_tilemap + bl GetBgTileMap cmp r0, 0 beq @080031E4 ldr r0, =nullsub_8 @@ -74,7 +74,7 @@ InitWindows: ; 80031C0 adds r0, r7, 0 movs r1, 0 movs r3, 0 - bl do_nothing + bl DummiedOutFireRedLeafGreenTileAllocFunc str r0, [sp] movs r0, 0x1 negs r0, r0 @@ -97,14 +97,14 @@ InitWindows: ; 80031C0 bne @080032CA adds r0, r7, 0 movs r1, 0x8 - bl bg_get_field + bl GetBgAttribute lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x0000ffff cmp r5, r0 beq @080032CA adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed adds r4, r0, 0 cmp r4, 0 bne @080032A8 @@ -129,14 +129,14 @@ InitWindows: ; 80031C0 str r4, [r0] adds r0, r7, 0 adds r1, r4, 0 - bl bg_set_tilemap + bl SetBgTileMap @080032CA: ldrb r1, [r6, 0x3] ldrb r0, [r6, 0x4] muls r0, r1 lsls r0, 21 lsrs r0, 16 - bl malloc_and_clear + bl AllocZeroed adds r4, r0, 0 cmp r4, 0 bne @0800330C @@ -153,7 +153,7 @@ InitWindows: ; 80031C0 cmp r1, r0 beq @08003250 adds r0, r1, 0 - bl free + bl Free str r4, [r5] b @08003250 .pool @@ -183,7 +183,7 @@ InitWindows: ; 80031C0 adds r0, r7, 0 ldr r1, [sp] movs r3, 0x1 - bl do_nothing + bl DummiedOutFireRedLeafGreenTileAllocFunc @08003342: adds r6, 0x8 ldr r0, [sp, 0x4] @@ -262,7 +262,7 @@ AddWindow: ; 8003380 adds r0, r7, 0 movs r1, 0 movs r3, 0 - bl do_nothing + bl DummiedOutFireRedLeafGreenTileAllocFunc mov r9, r0 movs r0, 0x1 negs r0, r0 @@ -279,14 +279,14 @@ AddWindow: ; 8003380 bne @08003432 adds r0, r7, 0 movs r1, 0x8 - bl bg_get_field + bl GetBgAttribute lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x0000ffff cmp r5, r0 beq @08003432 adds r0, r5, 0 - bl malloc_and_clear + bl AllocZeroed adds r4, r0, 0 cmp r4, 0 beq @0800346A @@ -307,7 +307,7 @@ AddWindow: ; 8003380 str r4, [r0] adds r0, r7, 0 adds r1, r4, 0 - bl bg_set_tilemap + bl SetBgTileMap @08003432: mov r2, r8 ldrb r1, [r2, 0x3] @@ -315,7 +315,7 @@ AddWindow: ; 8003380 muls r0, r1 lsls r0, 21 lsrs r0, 16 - bl malloc_and_clear + bl AllocZeroed adds r4, r0, 0 cmp r4, 0 bne @08003484 @@ -332,7 +332,7 @@ AddWindow: ; 8003380 cmp r1, r0 beq @0800346A adds r0, r1, 0 - bl free + bl Free str r4, [r5] @0800346A: movs r0, 0xFF @@ -366,7 +366,7 @@ AddWindow: ; 8003380 adds r0, r7, 0 mov r1, r9 movs r3, 0x1 - bl do_nothing + bl DummiedOutFireRedLeafGreenTileAllocFunc @080034BE: adds r0, r6, 0 @080034C0: @@ -419,7 +419,7 @@ AddWindowWithoutTileMap: ; 80034D8 muls r2, r0 adds r0, r6, 0 movs r1, 0 - bl do_nothing + bl DummiedOutFireRedLeafGreenTileAllocFunc adds r3, r0, 0 movs r0, 0x1 negs r0, r0 @@ -451,7 +451,7 @@ AddWindowWithoutTileMap: ; 80034D8 adds r0, r6, 0 adds r1, r3, 0 movs r3, 0x1 - bl do_nothing + bl DummiedOutFireRedLeafGreenTileAllocFunc @08003562: adds r0, r4, 0 @08003564: @@ -484,7 +484,7 @@ RemoveWindow: ; 8003574 muls r2, r0 adds r0, r3, 0 movs r3, 0x2 - bl do_nothing + bl DummiedOutFireRedLeafGreenTileAllocFunc @080035A0: ldr r0, =gDummyWindowTemplate ldr r1, [r0, 0x4] @@ -505,7 +505,7 @@ RemoveWindow: ; 8003574 cmp r1, r0 beq @080035CE adds r0, r1, 0 - bl free + bl Free str r5, [r4] @080035CE: ldr r1, =0x02020004 @@ -517,7 +517,7 @@ RemoveWindow: ; 8003574 ldr r0, [r4] cmp r0, 0 beq @080035E8 - bl free + bl Free movs r0, 0 str r0, [r4] @080035E8: @@ -541,7 +541,7 @@ FreeAllWindowBuffers: ; 8003604 cmp r1, r0 beq @08003620 adds r0, r1, 0 - bl free + bl Free movs r0, 0 str r0, [r4] @08003620: @@ -558,7 +558,7 @@ FreeAllWindowBuffers: ; 8003604 ldr r0, [r4] cmp r0, 0 beq @0800363E - bl free + bl Free str r6, [r4] @0800363E: adds r4, 0xC @@ -610,7 +610,7 @@ CopyWindowToVram: ; 8003658 @0800369A: mov r0, sp ldrb r0, [r0] - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @080036CE @080036A4: mov r0, sp @@ -619,7 +619,7 @@ CopyWindowToVram: ; 8003658 mov r2, sp ldrh r3, [r2, 0x6] adds r2, r4, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @080036CE @080036B6: mov r0, sp @@ -628,10 +628,10 @@ CopyWindowToVram: ; 8003658 mov r2, sp ldrh r3, [r2, 0x6] adds r2, r4, 0 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles mov r0, sp ldrb r0, [r0] - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @080036CE: add sp, 0xC pop {r4-r6} @@ -692,7 +692,7 @@ CopyWindowRectToVram: ; 80036D8 @08003736: mov r0, sp ldrb r0, [r0] - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @08003782 @08003740: mov r0, sp @@ -707,7 +707,7 @@ CopyWindowRectToVram: ; 80036D8 adds r3, r4 lsls r3, 16 lsrs r3, 16 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @08003782 @0800375E: mov r0, sp @@ -722,10 +722,10 @@ CopyWindowRectToVram: ; 80036D8 adds r3, r4 lsls r3, 16 lsrs r3, 16 - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles mov r0, sp ldrb r0, [r0] - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @08003782: add sp, 0xC pop {r4-r7} @@ -751,7 +751,7 @@ PutWindowTileMap: ; 800378C add r0, sp, 0x10 ldrb r0, [r0] movs r1, 0xA - bl bg_get_field + bl GetBgAttribute adds r1, r0, 0 add r0, sp, 0x10 ldrh r0, [r0, 0x6] @@ -775,7 +775,7 @@ PutWindowTileMap: ; 800378C str r4, [sp, 0x8] movs r4, 0x1 str r4, [sp, 0xC] - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer add sp, 0x1C pop {r4} pop {r0} @@ -784,7 +784,7 @@ PutWindowTileMap: ; 800378C thumb_func_end PutWindowTileMap thumb_func_start PutWindowRectTileMapOverridePalette -; void PutWindowRectTileMapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot) +; void PutWindowRectTileMapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 palette) PutWindowRectTileMapOverridePalette: ; 80037EC push {r4-r7,lr} mov r7, r10 @@ -822,7 +822,7 @@ PutWindowRectTileMapOverridePalette: ; 80037EC add r0, sp, 0x10 ldrb r0, [r0] movs r1, 0xA - bl bg_get_field + bl GetBgAttribute add r2, sp, 0x10 adds r1, r2, 0 ldrb r1, [r1, 0x3] @@ -858,7 +858,7 @@ PutWindowRectTileMapOverridePalette: ; 80037EC str r1, [sp, 0x8] str r7, [sp, 0xC] adds r1, r6, 0 - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer ldrb r0, [r4, 0x3] adds r0, r6, r0 lsls r0, 16 @@ -910,7 +910,7 @@ ClearWindowTileMap: ; 80038A4 add r4, sp, 0xC ldrb r4, [r4, 0x5] str r4, [sp, 0x8] - bl Bg_FillWramTileMapRectWithTileAndPalette + bl FillBgTileMapBufferRect add sp, 0x18 pop {r4} pop {r0} @@ -953,7 +953,7 @@ PutWindowRectTileMap: ; 80038F4 add r0, sp, 0x10 ldrb r0, [r0] movs r1, 0xA - bl bg_get_field + bl GetBgAttribute add r2, sp, 0x10 adds r1, r2, 0 ldrb r1, [r1, 0x3] @@ -989,7 +989,7 @@ PutWindowRectTileMap: ; 80038F4 str r1, [sp, 0x8] str r7, [sp, 0xC] adds r1, r6, 0 - bl bg_write_sequence_to_wram_tile_map_rect + bl WriteSequenceToBgTileMapBuffer ldrb r0, [r4, 0x3] adds r0, r6, r0 lsls r0, 16 @@ -1009,9 +1009,9 @@ PutWindowRectTileMap: ; 80038F4 .pool thumb_func_end PutWindowRectTileMap - thumb_func_start BlitSurfaceToWindow -; void BlitSurfaceToWindow(u8 windowId, u8 *pixels, u16 x, u16 y, u16 width, u16 height) -BlitSurfaceToWindow: ; 80039A4 + thumb_func_start BlitBitmapToWindow +; void BlitBitmapToWindow(u8 windowId, u8 *pixels, u16 x, u16 y, u16 width, u16 height) +BlitBitmapToWindow: ; 80039A4 push {r4,r5,lr} sub sp, 0x18 ldr r4, [sp, 0x24] @@ -1034,16 +1034,16 @@ BlitSurfaceToWindow: ; 80039A4 str r5, [sp, 0x14] movs r2, 0 movs r3, 0 - bl BlitSurfaceRectToWindow + bl BlitBitmapRectToWindow add sp, 0x18 pop {r4,r5} pop {r0} bx r0 - thumb_func_end BlitSurfaceToWindow + thumb_func_end BlitBitmapToWindow - thumb_func_start BlitSurfaceRectToWindow -; void BlitSurfaceRectToWindow(u8 rbox_id, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight) -BlitSurfaceRectToWindow: ; 80039DC + thumb_func_start BlitBitmapRectToWindow +; void BlitBitmapRectToWindow(u8 rbox_id, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight) +BlitBitmapRectToWindow: ; 80039DC push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -1123,7 +1123,7 @@ BlitSurfaceRectToWindow: ; 80039DC movs r0, 0 str r0, [sp, 0x10] add r0, sp, 0x14 - bl BlitSurface4Bit + bl BlitBitmapRect4Bit add sp, 0x24 pop {r3-r5} mov r8, r3 @@ -1133,11 +1133,11 @@ BlitSurfaceRectToWindow: ; 80039DC pop {r0} bx r0 .pool - thumb_func_end BlitSurfaceRectToWindow + thumb_func_end BlitBitmapRectToWindow - thumb_func_start BlitSurfaceRectToWindowWithColorKey -; void BlitSurfaceRectToWindowWithColorKey(u8 rbox_id, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 colorKey) -BlitSurfaceRectToWindowWithColorKey: ; 8003A9C + thumb_func_start BlitBitmapRectToWindowWithColorKey +; void BlitBitmapRectToWindowWithColorKey(u8 rbox_id, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 colorKey) +BlitBitmapRectToWindowWithColorKey: ; 8003A9C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -1221,7 +1221,7 @@ BlitSurfaceRectToWindowWithColorKey: ; 8003A9C ldr r6, [sp, 0x24] str r6, [sp, 0x10] add r0, sp, 0x14 - bl BlitSurface4Bit + bl BlitBitmapRect4Bit add sp, 0x28 pop {r3-r5} mov r8, r3 @@ -1231,7 +1231,7 @@ BlitSurfaceRectToWindowWithColorKey: ; 8003A9C pop {r0} bx r0 .pool - thumb_func_end BlitSurfaceRectToWindowWithColorKey + thumb_func_end BlitBitmapRectToWindowWithColorKey thumb_func_start FillWindowPixelRect ; void FillWindowPixelRect(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height) @@ -1290,7 +1290,7 @@ FillWindowPixelRect: ; 8003B64 add r0, sp, 0x8 adds r1, r2, 0 mov r2, r9 - bl FillSurfaceRect4Bit + bl FillBitmapRect4Bit add sp, 0x10 pop {r3,r4} mov r8, r3 @@ -2218,14 +2218,14 @@ AddWindow8Bit: ; 8004260 bne @080042EA adds r0, r7, 0 movs r1, 0x8 - bl bg_get_field + bl GetBgAttribute lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x0000ffff cmp r5, r0 beq @080042EA adds r0, r5, 0 - bl malloc + bl Alloc adds r4, r0, 0 cmp r4, 0 beq @08004322 @@ -2247,7 +2247,7 @@ AddWindow8Bit: ; 8004260 str r4, [r0] adds r0, r7, 0 adds r1, r4, 0 - bl bg_set_tilemap + bl SetBgTileMap @080042EA: mov r2, r9 ldrb r1, [r2, 0x3] @@ -2255,7 +2255,7 @@ AddWindow8Bit: ; 8004260 muls r0, r1 lsls r0, 22 lsrs r0, 16 - bl malloc + bl Alloc adds r4, r0, 0 cmp r4, 0 bne @08004338 @@ -2272,7 +2272,7 @@ AddWindow8Bit: ; 8004260 cmp r1, r0 beq @08004322 adds r0, r1, 0 - bl free + bl Free str r4, [r5] @08004322: movs r0, 0xFF @@ -2400,7 +2400,7 @@ FillWindowPixelRect8Bit: ; 80043A8 add r0, sp, 0x8 adds r1, r2, 0 mov r2, r9 - bl FillSurfaceRect8Bit + bl FillBitmapRect8Bit add sp, 0x10 pop {r3,r4} mov r8, r3 @@ -2411,9 +2411,9 @@ FillWindowPixelRect8Bit: ; 80043A8 .pool thumb_func_end FillWindowPixelRect8Bit - thumb_func_start BlitSurfaceRectToWindow4BitTo8Bit -; void BlitSurfaceRectToWindow4BitTo8Bit(u8 rbox_id, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteOffset) -BlitSurfaceRectToWindow4BitTo8Bit: ; 8004434 + thumb_func_start BlitBitmapRectToWindow4BitTo8Bit +; void BlitBitmapRectToWindow4BitTo8Bit(u8 rbox_id, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteOffset) +BlitBitmapRectToWindow4BitTo8Bit: ; 8004434 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -2499,7 +2499,7 @@ BlitSurfaceRectToWindow4BitTo8Bit: ; 8004434 ldr r6, [sp, 0x28] str r6, [sp, 0x14] add r0, sp, 0x18 - bl BlitSurface4BitTo8Bit + bl BlitBitmapRect4BitTo8Bit add sp, 0x2C pop {r3-r5} mov r8, r3 @@ -2509,7 +2509,7 @@ BlitSurfaceRectToWindow4BitTo8Bit: ; 8004434 pop {r0} bx r0 .pool - thumb_func_end BlitSurfaceRectToWindow4BitTo8Bit + thumb_func_end BlitBitmapRectToWindow4BitTo8Bit thumb_func_start CopyWindowToVram8Bit ; void CopyWindowToVram8Bit(u8 windowId, u8 mode) @@ -2547,24 +2547,24 @@ CopyWindowToVram8Bit: ; 8004500 b @08004570 @08004546: ldrb r0, [r3] - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram b @08004570 @0800454E: ldrb r0, [r3] ldr r1, [r3, 0x8] ldrh r2, [r4] ldrh r3, [r3, 0x6] - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles b @08004570 @0800455C: ldrb r0, [r3] ldr r1, [r3, 0x8] ldrh r2, [r4] ldrh r3, [r3, 0x6] - bl gpu_copy_bg_tile_pattern_data_to_vram + bl LoadBgTiles ldr r0, [r6] ldrb r0, [r0] - bl gpu_copy_wram_bg_tilemap_to_vram + bl CopyBgTileMapBufferToVram @08004570: pop {r4-r6} pop {r0} diff --git a/data/data2.s b/data/data2.s index dabe217fc..32e772da8 100644 --- a/data/data2.s +++ b/data/data2.s @@ -16,20 +16,20 @@ gUnknown_82E9531: ; 82E9531 .align 2, 0 gRomInterruptTable: ; 82E9548 - .4byte irq_vcount+1 - .4byte irq_serial+1 - .4byte irq_timer3+1 - .4byte irq_hblank+1 - .4byte irq_vblank+1 - .4byte irq_other+1 - .4byte irq_other+1 - .4byte irq_other+1 - .4byte irq_other+1 - .4byte irq_other+1 - .4byte irq_other+1 - .4byte irq_other+1 - .4byte irq_other+1 - .4byte irq_other+1 + .4byte VCountIntr + .4byte SerialIntr + .4byte Timer3Intr + .4byte HBlankIntr + .4byte VBlankIntr + .4byte DummyIntrHandler + .4byte DummyIntrHandler + .4byte DummyIntrHandler + .4byte DummyIntrHandler + .4byte DummyIntrHandler + .4byte DummyIntrHandler + .4byte DummyIntrHandler + .4byte DummyIntrHandler + .4byte DummyIntrHandler gBgConfigZeroValue: ; 82E9580 .4byte 0