From 356eb34e3213c95a7ce072bdfc860601dbf464fe Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 23 Oct 2017 14:40:22 +0200 Subject: [PATCH] undo revert --- Makefile | 4 +- asm/decoration.s | 7167 --------------- asm/decoration_inventory.s | 459 - asm/pokemon_summary_screen.s | 7826 ----------------- asm/secret_base.s | 2 +- asm/trader.s | 10 +- data/cute_sketch.s | 2 +- data/decoration.s | 86 - data/graphics.s | 5 +- .../decorations/decoration_graphics.inc | 252 + data/pokemon_summary_screen.s | 5 +- data/strings.s | 28 +- graphics/decorations/decor_attract_mat.pal | 19 + graphics/decorations/decor_attract_mat.png | Bin 0 -> 307 bytes graphics/decorations/decor_big_plant.pal | 19 + graphics/decorations/decor_big_plant.png | Bin 0 -> 310 bytes graphics/decorations/decor_blastoise_doll.pal | 19 + graphics/decorations/decor_blastoise_doll.png | Bin 0 -> 371 bytes graphics/decorations/decor_blue_brick.pal | 19 + graphics/decorations/decor_blue_brick.png | Bin 0 -> 226 bytes graphics/decorations/decor_blue_tent.pal | 19 + graphics/decorations/decor_blue_tent.png | Bin 0 -> 321 bytes graphics/decorations/decor_breakable_door.pal | 19 + graphics/decorations/decor_breakable_door.png | Bin 0 -> 274 bytes graphics/decorations/decor_brick_desk.pal | 19 + graphics/decorations/decor_brick_desk.png | Bin 0 -> 270 bytes graphics/decorations/decor_camp_desk.pal | 19 + graphics/decorations/decor_camp_desk.png | Bin 0 -> 265 bytes graphics/decorations/decor_charizard_doll.pal | 19 + graphics/decorations/decor_charizard_doll.png | Bin 0 -> 349 bytes graphics/decorations/decor_colorful_plant.pal | 19 + graphics/decorations/decor_colorful_plant.png | Bin 0 -> 371 bytes graphics/decorations/decor_comfort_desk.pal | 19 + graphics/decorations/decor_comfort_desk.png | Bin 0 -> 320 bytes graphics/decorations/decor_fire_blast_mat.pal | 19 + graphics/decorations/decor_fire_blast_mat.png | Bin 0 -> 287 bytes graphics/decorations/decor_fissure_mat.pal | 19 + graphics/decorations/decor_fissure_mat.png | Bin 0 -> 290 bytes graphics/decorations/decor_glass_ornament.pal | 19 + graphics/decorations/decor_glass_ornament.png | Bin 0 -> 292 bytes graphics/decorations/decor_gorgeous_plant.pal | 19 + graphics/decorations/decor_gorgeous_plant.png | Bin 0 -> 332 bytes graphics/decorations/decor_hard_desk.pal | 19 + graphics/decorations/decor_hard_desk.png | Bin 0 -> 325 bytes graphics/decorations/decor_heavy_desk.pal | 19 + graphics/decorations/decor_heavy_desk.png | Bin 0 -> 268 bytes graphics/decorations/decor_lapras_doll.pal | 19 + graphics/decorations/decor_lapras_doll.png | Bin 0 -> 349 bytes .../decorations/decor_powder_snow_mat.pal | 19 + .../decorations/decor_powder_snow_mat.png | Bin 0 -> 302 bytes graphics/decorations/decor_pretty_desk.pal | 19 + graphics/decorations/decor_pretty_desk.png | Bin 0 -> 296 bytes graphics/decorations/decor_pretty_flowers.pal | 19 + graphics/decorations/decor_pretty_flowers.png | Bin 0 -> 318 bytes graphics/decorations/decor_ragged_desk.pal | 19 + graphics/decorations/decor_ragged_desk.png | Bin 0 -> 257 bytes graphics/decorations/decor_red_brick.pal | 19 + graphics/decorations/decor_red_brick.png | Bin 0 -> 226 bytes graphics/decorations/decor_red_plant.pal | 19 + graphics/decorations/decor_red_plant.png | Bin 0 -> 300 bytes graphics/decorations/decor_red_tent.pal | 19 + graphics/decorations/decor_red_tent.png | Bin 0 -> 317 bytes graphics/decorations/decor_regice_doll.pal | 19 + graphics/decorations/decor_regice_doll.png | Bin 0 -> 346 bytes graphics/decorations/decor_regirock_doll.pal | 19 + graphics/decorations/decor_regirock_doll.png | Bin 0 -> 331 bytes graphics/decorations/decor_registeel_doll.pal | 19 + graphics/decorations/decor_registeel_doll.png | Bin 0 -> 351 bytes graphics/decorations/decor_rhydon_doll.pal | 19 + graphics/decorations/decor_rhydon_doll.png | Bin 0 -> 367 bytes graphics/decorations/decor_sand_ornament.pal | 19 + graphics/decorations/decor_sand_ornament.png | Bin 0 -> 286 bytes graphics/decorations/decor_slide.pal | 19 + graphics/decorations/decor_slide.png | Bin 0 -> 293 bytes graphics/decorations/decor_snorlax_doll.pal | 19 + graphics/decorations/decor_snorlax_doll.png | Bin 0 -> 337 bytes graphics/decorations/decor_solid_board.pal | 19 + graphics/decorations/decor_solid_board.png | Bin 0 -> 221 bytes graphics/decorations/decor_spikes_mat.pal | 19 + graphics/decorations/decor_spikes_mat.png | Bin 0 -> 302 bytes graphics/decorations/decor_stand.pal | 19 + graphics/decorations/decor_stand.png | Bin 0 -> 264 bytes graphics/decorations/decor_surf_mat.pal | 19 + graphics/decorations/decor_surf_mat.png | Bin 0 -> 298 bytes graphics/decorations/decor_thunder_mat.pal | 19 + graphics/decorations/decor_thunder_mat.png | Bin 0 -> 315 bytes graphics/decorations/decor_tire.pal | 19 + graphics/decorations/decor_tire.png | Bin 0 -> 303 bytes graphics/decorations/decor_tropical_plant.pal | 19 + graphics/decorations/decor_tropical_plant.png | Bin 0 -> 307 bytes graphics/decorations/decor_venusaur_doll.pal | 19 + graphics/decorations/decor_venusaur_doll.png | Bin 0 -> 393 bytes graphics/decorations/decor_wailmer_doll.pal | 19 + graphics/decorations/decor_wailmer_doll.png | Bin 0 -> 320 bytes graphics/decorations/decor_yellow_brick.pal | 19 + graphics/decorations/decor_yellow_brick.png | Bin 0 -> 226 bytes graphics/decorations/unk_85a6bb0.pal | 19 + graphics/decorations/unk_85a7308.pal | 19 + graphics/decorations/unk_85a7328.pal | 19 + graphics/misc/decoration_unk_85a7358.png | Bin 0 -> 87 bytes include/battle.h | 22 + include/data/decoration/description.h | 581 ++ include/data/decoration/header.h | 1100 +++ include/data/decoration/icon.h | 132 + include/data/decoration/tilemaps.h | 239 + include/data/decoration/tiles.h | 646 ++ include/decoration.h | 53 + include/decoration_inventory.h | 10 + include/event_scripts.h | 4 + include/field_map_obj.h | 1 + include/field_screen.h | 12 + include/fieldmap.h | 3 + include/global.h | 6 +- include/graphics.h | 95 + include/international_string_util.h | 8 +- include/item_icon.h | 17 + include/list_menu.h | 54 + include/map_object_constants.h | 239 + include/menu.h | 17 +- include/menu_helpers.h | 9 + include/menu_indicators.h | 12 + include/new_menu_helpers.h | 7 + include/overworld.h | 4 + include/player_pc.h | 12 + include/secret_base.h | 1 + include/strings.h | 34 + include/tilesets.h | 13 + include/trader.h | 11 + include/tv.h | 1 + ld_script.txt | 7 +- src/decoration.c | 2781 ++++++ src/decoration_inventory.c | 189 + src/international_string_util.c | 8 +- src/pokemon_summary_screen.c | 3679 ++++++++ src/start_menu.c | 2 +- src/tv.c | 2 +- sym_ewram.txt | 68 +- 137 files changed, 11131 insertions(+), 15649 deletions(-) delete mode 100644 asm/decoration.s delete mode 100644 asm/decoration_inventory.s delete mode 100644 data/decoration.s create mode 100644 data/graphics/decorations/decoration_graphics.inc create mode 100644 graphics/decorations/decor_attract_mat.pal create mode 100644 graphics/decorations/decor_attract_mat.png create mode 100644 graphics/decorations/decor_big_plant.pal create mode 100644 graphics/decorations/decor_big_plant.png create mode 100644 graphics/decorations/decor_blastoise_doll.pal create mode 100644 graphics/decorations/decor_blastoise_doll.png create mode 100644 graphics/decorations/decor_blue_brick.pal create mode 100644 graphics/decorations/decor_blue_brick.png create mode 100644 graphics/decorations/decor_blue_tent.pal create mode 100644 graphics/decorations/decor_blue_tent.png create mode 100644 graphics/decorations/decor_breakable_door.pal create mode 100644 graphics/decorations/decor_breakable_door.png create mode 100644 graphics/decorations/decor_brick_desk.pal create mode 100644 graphics/decorations/decor_brick_desk.png create mode 100644 graphics/decorations/decor_camp_desk.pal create mode 100644 graphics/decorations/decor_camp_desk.png create mode 100644 graphics/decorations/decor_charizard_doll.pal create mode 100644 graphics/decorations/decor_charizard_doll.png create mode 100644 graphics/decorations/decor_colorful_plant.pal create mode 100644 graphics/decorations/decor_colorful_plant.png create mode 100644 graphics/decorations/decor_comfort_desk.pal create mode 100644 graphics/decorations/decor_comfort_desk.png create mode 100644 graphics/decorations/decor_fire_blast_mat.pal create mode 100644 graphics/decorations/decor_fire_blast_mat.png create mode 100644 graphics/decorations/decor_fissure_mat.pal create mode 100644 graphics/decorations/decor_fissure_mat.png create mode 100644 graphics/decorations/decor_glass_ornament.pal create mode 100644 graphics/decorations/decor_glass_ornament.png create mode 100644 graphics/decorations/decor_gorgeous_plant.pal create mode 100644 graphics/decorations/decor_gorgeous_plant.png create mode 100644 graphics/decorations/decor_hard_desk.pal create mode 100644 graphics/decorations/decor_hard_desk.png create mode 100644 graphics/decorations/decor_heavy_desk.pal create mode 100644 graphics/decorations/decor_heavy_desk.png create mode 100644 graphics/decorations/decor_lapras_doll.pal create mode 100644 graphics/decorations/decor_lapras_doll.png create mode 100644 graphics/decorations/decor_powder_snow_mat.pal create mode 100644 graphics/decorations/decor_powder_snow_mat.png create mode 100644 graphics/decorations/decor_pretty_desk.pal create mode 100644 graphics/decorations/decor_pretty_desk.png create mode 100644 graphics/decorations/decor_pretty_flowers.pal create mode 100644 graphics/decorations/decor_pretty_flowers.png create mode 100644 graphics/decorations/decor_ragged_desk.pal create mode 100644 graphics/decorations/decor_ragged_desk.png create mode 100644 graphics/decorations/decor_red_brick.pal create mode 100644 graphics/decorations/decor_red_brick.png create mode 100644 graphics/decorations/decor_red_plant.pal create mode 100644 graphics/decorations/decor_red_plant.png create mode 100644 graphics/decorations/decor_red_tent.pal create mode 100644 graphics/decorations/decor_red_tent.png create mode 100644 graphics/decorations/decor_regice_doll.pal create mode 100644 graphics/decorations/decor_regice_doll.png create mode 100644 graphics/decorations/decor_regirock_doll.pal create mode 100644 graphics/decorations/decor_regirock_doll.png create mode 100644 graphics/decorations/decor_registeel_doll.pal create mode 100644 graphics/decorations/decor_registeel_doll.png create mode 100644 graphics/decorations/decor_rhydon_doll.pal create mode 100644 graphics/decorations/decor_rhydon_doll.png create mode 100644 graphics/decorations/decor_sand_ornament.pal create mode 100644 graphics/decorations/decor_sand_ornament.png create mode 100644 graphics/decorations/decor_slide.pal create mode 100644 graphics/decorations/decor_slide.png create mode 100644 graphics/decorations/decor_snorlax_doll.pal create mode 100644 graphics/decorations/decor_snorlax_doll.png create mode 100644 graphics/decorations/decor_solid_board.pal create mode 100644 graphics/decorations/decor_solid_board.png create mode 100644 graphics/decorations/decor_spikes_mat.pal create mode 100644 graphics/decorations/decor_spikes_mat.png create mode 100644 graphics/decorations/decor_stand.pal create mode 100644 graphics/decorations/decor_stand.png create mode 100644 graphics/decorations/decor_surf_mat.pal create mode 100644 graphics/decorations/decor_surf_mat.png create mode 100644 graphics/decorations/decor_thunder_mat.pal create mode 100644 graphics/decorations/decor_thunder_mat.png create mode 100644 graphics/decorations/decor_tire.pal create mode 100644 graphics/decorations/decor_tire.png create mode 100644 graphics/decorations/decor_tropical_plant.pal create mode 100644 graphics/decorations/decor_tropical_plant.png create mode 100644 graphics/decorations/decor_venusaur_doll.pal create mode 100644 graphics/decorations/decor_venusaur_doll.png create mode 100644 graphics/decorations/decor_wailmer_doll.pal create mode 100644 graphics/decorations/decor_wailmer_doll.png create mode 100644 graphics/decorations/decor_yellow_brick.pal create mode 100644 graphics/decorations/decor_yellow_brick.png create mode 100644 graphics/decorations/unk_85a6bb0.pal create mode 100644 graphics/decorations/unk_85a7308.pal create mode 100644 graphics/decorations/unk_85a7328.pal create mode 100644 graphics/misc/decoration_unk_85a7358.png create mode 100644 include/data/decoration/description.h create mode 100644 include/data/decoration/header.h create mode 100644 include/data/decoration/icon.h create mode 100644 include/data/decoration/tilemaps.h create mode 100644 include/data/decoration/tiles.h create mode 100644 include/field_screen.h create mode 100644 include/graphics.h create mode 100644 include/item_icon.h create mode 100644 include/list_menu.h create mode 100644 include/map_object_constants.h create mode 100644 include/menu_indicators.h create mode 100644 include/player_pc.h create mode 100644 include/tilesets.h create mode 100644 include/trader.h create mode 100644 src/decoration.c create mode 100644 src/decoration_inventory.c create mode 100755 src/pokemon_summary_screen.c diff --git a/Makefile b/Makefile index ca8348f68..4a1f94352 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ CPP := $(DEVKITARM)/bin/arm-none-eabi-cpp CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef LD := $(DEVKITARM)/bin/arm-none-eabi-ld -LDFLAGS = -Map $(MAP) +LDFLAGS = -Map ../../$(MAP) OBJCOPY := $(DEVKITARM)/bin/arm-none-eabi-objcopy @@ -102,7 +102,7 @@ $(C_BUILDDIR)/m4a_2.o: CC1 := tools/agbcc/bin/old_agbcc $(C_BUILDDIR)/m4a_4.o: CC1 := tools/agbcc/bin/old_agbcc ifeq ($(NODEP),) -$(C_BUILDDIR)/%.o: c_dep = $(shell $(SCANINC) $(C_SUBDIR)/$*.c) +$(C_BUILDDIR)/%.o: c_dep = $(shell $(SCANINC) -I include $(C_SUBDIR)/$*.c) else $(C_BUILDDIR)/%.o: c_dep := endif diff --git a/asm/decoration.s b/asm/decoration.s deleted file mode 100644 index 0798e3165..000000000 --- a/asm/decoration.s +++ /dev/null @@ -1,7167 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_8126968 -sub_8126968: @ 8126968 - push {lr} - ldr r3, =gUnknown_0203A173 - ldrb r0, [r3] - cmp r0, 0x7 - bhi _0812697E - ldr r2, =gUnknown_0203A14C - ldr r1, =gDecorationInventories - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] -_0812697E: - ldr r2, =gUnknown_0203A17C - ldrb r0, [r2, 0x9] - cmp r0, 0 - bne _08126996 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x00001aae - adds r1, r0, r3 - str r1, [r2] - ldr r1, =0x00001abe - adds r0, r1 - str r0, [r2, 0x4] -_08126996: - ldrb r0, [r2, 0x9] - cmp r0, 0x1 - bne _081269AC - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x0000271c - adds r1, r0, r3 - str r1, [r2] - ldr r1, =0x00002728 - adds r0, r1 - str r0, [r2, 0x4] -_081269AC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126968 - - thumb_func_start sub_81269D4 -sub_81269D4: @ 81269D4 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =gUnknown_0203A188 - adds r4, r1, r0 - cmp r1, 0 - bne _08126A28 - ldr r0, =gUnknown_085A6B90 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, =gUnknown_085A6B48 - movs r1, 0x4 - bl GetMaxWidthInMenuTable - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - lsrs r0, r1, 24 - cmp r0, 0x12 - bls _08126A14 - adds r0, r2, 0 - ands r0, r1 - movs r1, 0x90 - lsls r1, 21 - orrs r0, r1 - str r0, [sp] -_08126A14: - mov r0, sp - b _08126A2E - .pool -_08126A28: - lsls r0, r1, 3 - ldr r1, =gUnknown_085A6B90 - adds r0, r1 -_08126A2E: - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r2, 0x85 - lsls r2, 2 - movs r1, 0 - movs r3, 0xE - bl SetWindowBorderStyle - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldrb r0, [r4] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81269D4 - - thumb_func_start sub_8126A58 -sub_8126A58: @ 8126A58 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203A188 - adds r4, r0 - ldrb r0, [r4] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126A58 - - thumb_func_start sub_8126A88 -sub_8126A88: @ 8126A88 - push {r4,lr} - movs r0, 0 - bl sub_81269D4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r2, =gUnknown_085A6B48 - adds r0, r4, 0 - movs r1, 0x4 - bl PrintMenuTable - ldr r0, =gUnknown_0203A150 - ldrb r2, [r0] - adds r0, r4, 0 - movs r1, 0x4 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126A88 - - thumb_func_start sub_8126ABC -sub_8126ABC: @ 8126ABC - push {lr} - ldr r1, =gUnknown_0203A150 - movs r0, 0 - strb r0, [r1] - bl ScriptContext2_Enable - bl sub_8126A88 - bl sub_8126C08 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126ABC - - thumb_func_start sub_8126AD8 -sub_8126AD8: @ 8126AD8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8126ABC - ldr r2, =gUnknown_0203A17C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x00001aae - adds r1, r0, r3 - str r1, [r2] - ldr r1, =0x00001abe - adds r0, r1 - str r0, [r2, 0x4] - movs r1, 0 - movs r0, 0x10 - strb r0, [r2, 0x8] - strb r1, [r2, 0x9] - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8126B80 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126AD8 - - thumb_func_start sub_8126B2C -sub_8126B2C: @ 8126B2C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8126ABC - ldr r2, =gUnknown_0203A17C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x0000271c - adds r1, r0, r3 - str r1, [r2] - ldr r1, =0x00002728 - adds r0, r1 - str r0, [r2, 0x4] - movs r0, 0xC - strb r0, [r2, 0x8] - movs r0, 0x1 - strb r0, [r2, 0x9] - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8126B80 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126B2C - - thumb_func_start sub_8126B80 -sub_8126B80: @ 8126B80 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08126C00 - bl GetMenuCursorPos - lsls r0, 24 - lsrs r4, r0, 24 - bl ProcessMenuInput - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _08126BD8 - adds r0, 0x1 - cmp r1, r0 - beq _08126BF4 - movs r0, 0x5 - bl PlaySE - ldr r1, =gUnknown_085A6B48 - ldr r0, =gUnknown_0203A150 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 - b _08126C00 - .pool -_08126BD8: - bl GetMenuCursorPos - ldr r1, =gUnknown_0203A150 - strb r0, [r1] - lsls r0, r4, 24 - asrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - beq _08126C00 - bl sub_8126C08 - b _08126C00 - .pool -_08126BF4: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_8126D6C -_08126C00: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8126B80 - - thumb_func_start sub_8126C08 -sub_8126C08: @ 8126C08 - push {lr} - sub sp, 0x10 - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r1, =gUnknown_085A6B68 - ldr r0, =gUnknown_0203A150 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126C08 - - thumb_func_start sub_8126C48 -sub_8126C48: @ 8126C48 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8161B10 - lsls r0, 24 - cmp r0, 0 - bne _08126C7C - ldr r4, =gStringVar4 - ldr r1, =gText_NoDecorations - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_8126DA4 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _08126C96 - .pool -_08126C7C: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0 - strh r1, [r0, 0x1E] - ldr r0, =gUnknown_0203A173 - strb r2, [r0] - adds r0, r5, 0 - bl sub_8126DCC -_08126C96: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126C48 - - thumb_func_start sub_8126CA4 -sub_8126CA4: @ 8126CA4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl sub_81299AC - lsls r0, 24 - cmp r0, 0 - bne _08126CD8 - ldr r4, =gStringVar4 - ldr r1, =gText_NoDecorationsInUse - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_8126DA4 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _08126D00 - .pool -_08126CD8: - movs r0, 0 - bl sub_8126A58 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - ldr r1, =sub_8129ABC - str r1, [r0] -_08126D00: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126CA4 - - thumb_func_start sub_8126D10 -sub_8126D10: @ 8126D10 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8161B10 - lsls r0, 24 - cmp r0, 0 - bne _08126D44 - ldr r4, =gStringVar4 - ldr r1, =gText_NoDecorations - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_8126DA4 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _08126D5E - .pool -_08126D44: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x1 - strh r1, [r0, 0x1E] - ldr r0, =gUnknown_0203A173 - strb r2, [r0] - adds r0, r5, 0 - bl sub_8126DCC -_08126D5E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126D10 - - thumb_func_start sub_8126D6C -sub_8126D6C: @ 8126D6C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - bl sub_8126A58 - ldr r0, =gUnknown_0203A17C - ldrb r0, [r0, 0x9] - cmp r0, 0 - bne _08126D98 - ldr r0, =gUnknown_0823B4E8 - bl ScriptContext1_SetupScript - adds r0, r4, 0 - bl DestroyTask - b _08126D9E - .pool -_08126D98: - adds r0, r4, 0 - bl sub_816B060 -_08126D9E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8126D6C - - thumb_func_start sub_8126DA4 -sub_8126DA4: @ 8126DA4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8126C08 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8126B80 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126DA4 - - thumb_func_start sub_8126DCC -sub_8126DCC: @ 8126DCC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085A6BB0 - movs r1, 0xD0 - movs r2, 0x20 - bl LoadPalette - movs r0, 0 - movs r1, 0 - bl sub_8197434 - movs r0, 0 - bl sub_8126A58 - adds r0, r4, 0 - bl sub_8126DFC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126DCC - - thumb_func_start sub_8126DFC -sub_8126DFC: @ 8126DFC - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x1 - bl sub_81269D4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl sub_8126E8C - ldr r0, =gUnknown_0203A173 - ldrb r2, [r0] - adds r0, r4, 0 - movs r1, 0x9 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8127088 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126DFC - - thumb_func_start sub_8126E44 -sub_8126E44: @ 8126E44 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gUnknown_0203A188 - ldrb r0, [r5, 0x1] - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r4, 0 - bl sub_8126E8C - ldrb r0, [r5, 0x1] - ldr r1, =gUnknown_0203A173 - ldrb r2, [r1] - movs r1, 0x9 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8127088 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126E44 - - thumb_func_start sub_8126E8C -sub_8126E8C: @ 8126E8C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r1, r0, r1 - ldr r0, =gUnknown_0203A188 - ldrb r5, [r0, 0x1] - ldr r0, =gUnknown_0203A17C - ldrb r0, [r0, 0x9] - movs r2, 0 - mov r8, r2 - cmp r0, 0x1 - bne _08126EC0 - movs r2, 0x16 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08126EC0 - movs r0, 0x1 - mov r8, r0 -_08126EC0: - movs r4, 0 - lsls r2, r6, 2 - mov r9, r2 - movs r7, 0xFF -_08126EC8: - mov r0, r8 - cmp r0, 0x1 - bne _08126EF8 - cmp r4, 0x6 - beq _08126EF8 - cmp r4, 0x7 - beq _08126EF8 - lsls r3, r4, 28 - lsrs r3, 24 - str r0, [sp] - str r7, [sp, 0x4] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x8 - bl sub_8126F68 - b _08126F0C - .pool -_08126EF8: - lsls r3, r4, 28 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - str r7, [sp, 0x4] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x8 - bl sub_8126F68 -_08126F0C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _08126EC8 - ldr r0, =gTasks - mov r2, r9 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - movs r2, 0x1E - ldrsh r0, [r1, r2] - ldr r2, =gText_Cancel - cmp r0, 0x2 - bne _08126F2C - ldr r2, =gText_Exit -_08126F2C: - lsls r0, r4, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - movs r3, 0x8 - bl PrintTextOnWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126E8C - - thumb_func_start sub_8126F68 -sub_8126F68: @ 8126F68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - ldr r4, [sp, 0x38] - ldr r6, [sp, 0x3C] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r5, r3, 24 - lsls r4, 24 - lsrs r1, r4, 24 - lsls r6, 24 - lsrs r6, 24 - mov r9, r6 - movs r0, 0x60 - str r0, [sp, 0x14] - cmp r7, 0x8 - bne _08126FA2 - movs r2, 0x68 - str r2, [sp, 0x14] -_08126FA2: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gStringVar4 - adds r0, r4, 0 - bl sub_8127058 - adds r0, r4, 0 - bl StringLength - lsls r0, 16 - lsrs r0, 16 - adds r6, r0, r4 - ldr r1, =gUnknown_085A6B28 - mov r2, r8 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - bl StringCopy - str r5, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r2, 0 - mov r10, r2 - str r2, [sp, 0x8] - ldr r0, [sp, 0xC] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r7, 0 - bl PrintTextOnWindow - mov r0, r8 - bl sub_8161AD0 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - adds r6, r0, 0 - movs r0, 0xBA - strb r0, [r6] - adds r6, 0x1 - ldr r1, =gDecorationInventories - mov r2, r8 - lsls r0, r2, 3 - adds r0, r1 - ldrb r1, [r0, 0x4] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - adds r1, r4, 0 - ldr r2, [sp, 0x14] - bl GetStringRightAlignXOffset - lsls r0, 24 - lsrs r7, r0, 24 - str r5, [sp] - mov r0, r9 - str r0, [sp, 0x4] - mov r2, r10 - str r2, [sp, 0x8] - ldr r0, [sp, 0xC] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r7, 0 - bl PrintTextOnWindow - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126F68 - - thumb_func_start sub_8127058 -sub_8127058: @ 8127058 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r4, r1, 24 - lsrs r4, 24 - ldr r1, =gText_Color161Shadow161 - bl StringCopy - cmp r4, 0x1 - bne _08127078 - movs r0, 0x4 - strb r0, [r5, 0x2] - movs r0, 0x5 - b _0812707E - .pool -_08127078: - movs r0, 0x2 - strb r0, [r5, 0x2] - movs r0, 0x3 -_0812707E: - strb r0, [r5, 0x5] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8127058 - - thumb_func_start sub_8127088 -sub_8127088: @ 8127088 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081270DE - bl ProcessMenuInput - lsls r0, 24 - lsrs r4, r0, 24 - asrs r1, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081270C0 - cmp r1, r0 - bgt _081270BC - subs r0, 0x1 - cmp r1, r0 - beq _081270DE - b _081270CE - .pool -_081270BC: - cmp r1, 0x8 - bne _081270CE -_081270C0: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_812719C - b _081270DE -_081270CE: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203A173 - strb r4, [r0] - adds r0, r5, 0 - bl sub_81270E8 -_081270DE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127088 - - thumb_func_start sub_81270E8 -sub_81270E8: @ 81270E8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_0203A173 - ldrb r0, [r4] - bl sub_8161AD0 - ldr r1, =gUnknown_0203A151 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - beq _08127154 - ldrb r0, [r4] - bl sub_8161A38 - ldr r2, =gUnknown_0203A14C - ldr r1, =gDecorationInventories - ldrb r0, [r4] - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - adds r0, r5, 0 - bl sub_81279B4 - ldr r0, =gUnknown_0203A170 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_0203A16E - strh r1, [r0] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8127620 - str r1, [r0] - b _0812716E - .pool -_08127154: - movs r0, 0x1 - bl sub_8126A58 - ldr r4, =gStringVar4 - ldr r1, =gText_NoDecorations - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_8127180 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField -_0812716E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81270E8 - - thumb_func_start sub_8127180 -sub_8127180: @ 8127180 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - adds r0, r4, 0 - bl sub_8126DFC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127180 - - thumb_func_start sub_812719C -sub_812719C: @ 812719C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1E - ldrsh r0, [r0, r1] - cmp r0, 0x2 - beq _081271C0 - adds r0, r2, 0 - bl sub_81271CC - b _081271C6 - .pool -_081271C0: - adds r0, r2, 0 - bl sub_8127268 -_081271C6: - pop {r0} - bx r0 - thumb_func_end sub_812719C - - thumb_func_start sub_81271CC -sub_81271CC: @ 81271CC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_8126A58 - bl sub_8126A88 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - bl sub_8126C08 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8126B80 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81271CC - - thumb_func_start sub_8127208 -sub_8127208: @ 8127208 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085A6BB0 - movs r1, 0xD0 - movs r2, 0x20 - bl LoadPalette - movs r0, 0 - movs r1, 0 - bl sub_8197434 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x2 - strh r1, [r0, 0x1E] - ldr r0, =gUnknown_0203A173 - strb r2, [r0] - adds r0, r4, 0 - bl sub_8126DFC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127208 - - thumb_func_start sub_8127250 -sub_8127250: @ 8127250 - push {lr} - lsls r1, 24 - ldr r2, =gUnknown_085A6B28 - lsrs r1, 22 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127250 - - thumb_func_start sub_8127268 -sub_8127268: @ 8127268 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_8126A58 - adds r0, r4, 0 - bl sub_8133E1C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127268 - - thumb_func_start sub_8127284 -sub_8127284: @ 8127284 - push {lr} - ldr r3, =gUnknown_0203A18C - ldr r2, [r3] - ldr r0, =gUnknown_0203A151 - ldrb r0, [r0] - adds r0, 0x1 - movs r1, 0xA4 - lsls r1, 3 - adds r2, r1 - strb r0, [r2] - ldr r0, [r3] - adds r1, r0, r1 - ldrb r1, [r1] - cmp r1, 0x8 - bls _081272B8 - ldr r2, =0x00000521 - adds r1, r0, r2 - movs r0, 0x8 - strb r0, [r1] - b _081272BE - .pool -_081272B8: - ldr r2, =0x00000521 - adds r0, r2 - strb r1, [r0] -_081272BE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127284 - - thumb_func_start sub_81272C8 -sub_81272C8: @ 81272C8 - push {r4,lr} - ldr r0, =gUnknown_0203A170 - ldr r1, =gUnknown_0203A16E - ldr r2, =gUnknown_0203A18C - ldr r3, [r2] - ldr r4, =0x00000521 - adds r2, r3, r4 - ldrb r2, [r2] - subs r4, 0x1 - adds r3, r4 - ldrb r3, [r3] - bl sub_812225C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81272C8 - - thumb_func_start sub_81272F8 -sub_81272F8: @ 81272F8 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gUnknown_0203A170 - ldr r1, =gUnknown_0203A16E - ldr r2, =gUnknown_0203A18C - ldr r3, [r2] - ldr r4, =0x00000521 - adds r2, r3, r4 - ldrb r2, [r2] - subs r4, 0x1 - adds r3, r4 - ldrb r3, [r3] - movs r4, 0x8 - str r4, [sp] - bl sub_8122298 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81272F8 - - thumb_func_start sub_8127330 -sub_8127330: @ 8127330 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r1, r0 - ldr r0, =gUnknown_0203A173 - ldrb r0, [r0] - subs r0, 0x6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08127378 - ldr r0, =gUnknown_0203A17C - ldrb r0, [r0, 0x9] - cmp r0, 0x1 - bne _08127378 - movs r2, 0x16 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08127378 - ldr r0, =gStringVar1 - movs r1, 0x1 - bl sub_8127058 - b _08127380 - .pool -_08127378: - ldr r0, =gStringVar1 - movs r1, 0 - bl sub_8127058 -_08127380: - movs r6, 0 - ldr r1, =gUnknown_0203A18C - ldr r0, [r1] - movs r3, 0xA4 - lsls r3, 3 - adds r0, r3 - ldrb r0, [r0] - subs r0, 0x1 - cmp r6, r0 - bge _081273D6 - adds r5, r1, 0 -_08127396: - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - movs r0, 0xA4 - lsls r0, 1 - adds r4, r0 - ldr r0, [r5] - adds r0, r4 - ldr r1, =gUnknown_0203A14C - ldr r1, [r1] - adds r1, r6 - ldrb r1, [r1] - bl sub_8127454 - ldr r1, [r5] - lsls r2, r6, 3 - adds r0, r1, r2 - adds r4, r1, r4 - str r4, [r0] - adds r0, r1, 0x4 - adds r0, r2 - str r6, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - movs r2, 0xA4 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - subs r0, 0x1 - cmp r6, r0 - blt _08127396 -_081273D6: - ldr r5, =gUnknown_0203A18C - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - movs r3, 0xA4 - lsls r3, 1 - adds r4, r3 - ldr r0, [r5] - adds r0, r4 - ldr r1, =gText_Cancel - bl StringCopy - ldr r0, [r5] - lsls r2, r6, 3 - adds r1, r0, r2 - adds r4, r0, r4 - str r4, [r1] - adds r0, 0x4 - adds r0, r2 - movs r1, 0x2 - negs r1, r1 - str r1, [r0] - ldr r2, =gUnknown_03006310 - adds r1, r2, 0 - ldr r0, =gUnknown_085A6BD0 - ldm r0!, {r3,r4,r6} - stm r1!, {r3,r4,r6} - ldm r0!, {r3,r4,r6} - stm r1!, {r3,r4,r6} - ldr r0, =gUnknown_0203A188 - ldrb r0, [r0, 0x1] - strb r0, [r2, 0x10] - ldr r0, [r5] - movs r4, 0xA4 - lsls r4, 3 - adds r1, r0, r4 - ldrb r1, [r1] - strh r1, [r2, 0xC] - str r0, [r2] - ldr r6, =0x00000521 - adds r0, r6 - ldrb r0, [r0] - strh r0, [r2, 0xE] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127330 - - thumb_func_start sub_8127454 -sub_8127454: @ 8127454 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r4, r1, 16 - lsrs r4, 16 - ldr r1, =gStringVar1 - bl StringCopy - lsls r4, 5 - ldr r0, =gDecorations + 1 - adds r4, r0 - adds r0, r5, 0 - adds r1, r4, 0 - bl StringAppend - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127454 - - thumb_func_start sub_8127480 -sub_8127480: @ 8127480 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _08127492 - movs r0, 0x5 - bl PlaySE -_08127492: - adds r0, r4, 0 - bl sub_8127744 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127480 - - thumb_func_start sub_81274A0 -sub_81274A0: @ 81274A0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - mov r8, r6 - lsls r2, 24 - lsrs r5, r2, 24 - adds r7, r5, 0 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _081274F6 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_81277BC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081274DC - adds r3, r5, 0x2 - adds r0, r6, 0 - movs r1, 0x18 - movs r2, 0x5C - bl blit_move_info_icon - b _081274F6 -_081274DC: - adds r0, r4, 0 - bl sub_81277E8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081274F6 - adds r3, r7, 0x2 - mov r0, r8 - movs r1, 0x19 - movs r2, 0x5C - bl blit_move_info_icon -_081274F6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81274A0 - - thumb_func_start sub_8127500 -sub_8127500: @ 8127500 - push {r4,lr} - sub sp, 0x10 - ldr r4, =gUnknown_0203A18C - ldr r1, [r4] - ldr r2, =0x00000522 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08127540 - subs r2, 0x2 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - subs r0, r1 - str r0, [sp] - movs r0, 0x6E - str r0, [sp, 0x4] - str r0, [sp, 0x8] - ldr r0, =gUnknown_0203A170 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0x3C - movs r2, 0xC - movs r3, 0x94 - bl AddScrollIndicatorArrowPairParametrized - ldr r1, [r4] - ldr r2, =0x00000522 - adds r1, r2 - strb r0, [r1] -_08127540: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127500 - - thumb_func_start sub_8127554 -sub_8127554: @ 8127554 - push {r4,lr} - ldr r4, =gUnknown_0203A18C - ldr r0, [r4] - ldr r2, =0x00000522 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08127572 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r1, =0x00000522 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_08127572: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127554 - - thumb_func_start sub_8127580 -sub_8127580: @ 8127580 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_81269D4 - adds r0, r4, 0 - bl sub_812759C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127580 - - thumb_func_start sub_812759C -sub_812759C: @ 812759C - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - ldr r0, =gTasks + 0x8 - adds r5, r0 - movs r0, 0x3 - bl sub_81269D4 - ldr r0, =gUnknown_0203A173 - ldrb r0, [r0] - bl sub_8127718 - ldr r6, =gUnknown_0203A18C - ldr r0, =0x00000524 - bl AllocZeroed - str r0, [r6] - ldr r1, =0x00000522 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - bl sub_8127284 - bl sub_81272C8 - bl sub_81272F8 - adds r0, r4, 0 - bl sub_8127330 - ldr r0, =gUnknown_03006310 - ldr r1, =gUnknown_0203A170 - ldrh r1, [r1] - ldr r2, =gUnknown_0203A16E - ldrh r2, [r2] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x1A] - bl sub_8127500 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812759C - - thumb_func_start sub_8127620 -sub_8127620: @ 8127620 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_812759C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_812764C - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127620 - - thumb_func_start sub_812764C -sub_812764C: @ 812764C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08127700 - ldrb r0, [r5, 0x1A] - bl ListMenuHandleInput - adds r4, r0, 0 - ldrb r0, [r5, 0x1A] - ldr r7, =gUnknown_0203A170 - ldr r1, =gUnknown_0203A16E - mov r8, r1 - adds r1, r7, 0 - mov r2, r8 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081276A4 - adds r0, 0x1 - cmp r4, r0 - bne _081276C4 - b _08127700 - .pool -_081276A4: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_085A6B78 - movs r2, 0x16 - ldrsh r1, [r5, r2] - lsls r1, 3 - adds r0, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r6, 0 - bl _call_via_r1 - b _08127700 - .pool -_081276C4: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203A172 - strb r4, [r0] - bl sub_8127554 - ldrb r0, [r5, 0x1A] - adds r1, r7, 0 - mov r2, r8 - bl sub_81AE6C8 - movs r0, 0x1 - bl sub_8126A58 - bl sub_81277A8 - ldr r0, =gUnknown_0203A18C - ldr r0, [r0] - bl Free - ldr r1, =gUnknown_085A6B78 - movs r2, 0x16 - ldrsh r0, [r5, r2] - lsls r0, 3 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 -_08127700: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812764C - - thumb_func_start sub_8127718 -sub_8127718: @ 8127718 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x2 - bl sub_81269D4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl sub_8126F68 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127718 - - thumb_func_start sub_8127744 -sub_8127744: @ 8127744 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - ldr r0, =gUnknown_0203A188 - ldrb r5, [r0, 0x3] - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0203A151 - ldrb r0, [r0] - cmp r4, r0 - bcc _08127770 - ldr r2, =gText_GoBackPrevMenu - b _08127782 - .pool -_08127770: - ldr r1, =gDecorations - ldr r0, =gUnknown_0203A14C - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0] - lsls r0, 5 - adds r1, 0x18 - adds r0, r1 - ldr r2, [r0] -_08127782: - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - movs r3, 0 - bl PrintTextOnWindow - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127744 - - thumb_func_start sub_81277A8 -sub_81277A8: @ 81277A8 - push {lr} - movs r0, 0x3 - bl sub_8126A58 - movs r0, 0x2 - bl sub_8126A58 - pop {r0} - bx r0 - thumb_func_end sub_81277A8 - - thumb_func_start sub_81277BC -sub_81277BC: @ 81277BC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =gUnknown_0203A152 -_081277C6: - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081277D8 - movs r0, 0x1 - b _081277E4 - .pool -_081277D8: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _081277C6 - movs r0, 0 -_081277E4: - pop {r1} - bx r1 - thumb_func_end sub_81277BC - - thumb_func_start sub_81277E8 -sub_81277E8: @ 81277E8 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =gUnknown_0203A162 -_081277F2: - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _08127804 - movs r0, 0x1 - b _08127810 - .pool -_08127804: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xB - bls _081277F2 - movs r0, 0 -_08127810: - pop {r1} - bx r1 - thumb_func_end sub_81277E8 - - thumb_func_start sub_8127814 -sub_8127814: @ 8127814 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r5, 0 - ldr r0, =gUnknown_0203A152 - movs r1, 0 - movs r2, 0x10 - bl memset - ldr r0, =gUnknown_0203A162 - movs r1, 0 - movs r2, 0xC - bl memset - movs r6, 0 - ldr r0, =gSaveBlock1Ptr - mov r10, r0 - ldr r1, =0x00001aae - mov r9, r1 - ldr r3, =gUnknown_0203A173 - mov r8, r3 -_08127842: - mov r1, r10 - ldr r0, [r1] - add r0, r9 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - beq _081278E2 - movs r2, 0 - mov r3, r8 - ldrb r0, [r3] - lsls r0, 3 - ldr r1, =gDecorationInventories - adds r0, r1 - ldrb r0, [r0, 0x4] - cmp r2, r0 - bcs _081278E2 - ldr r7, =gUnknown_0203A152 - adds r3, r1, 0 - mov r12, r3 -_08127868: - ldr r0, =gUnknown_0203A14C - ldr r1, [r0] - adds r1, r2 - mov r3, r10 - ldr r0, [r3] - add r0, r9 - adds r0, r6 - ldrb r1, [r1] - adds r4, r2, 0x1 - ldrb r0, [r0] - cmp r1, r0 - bne _081278D0 - movs r1, 0 - cmp r1, r5 - bcs _081278A2 - ldrb r0, [r7] - cmp r0, r4 - beq _081278A2 - ldr r3, =gUnknown_0203A152 - adds r2, r4, 0 -_08127890: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r5 - bcs _081278A2 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _08127890 -_081278A2: - cmp r1, r5 - bne _081278D0 - adds r0, r5, r7 - strb r4, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - b _081278E2 - .pool -_081278D0: - lsls r0, r4, 16 - lsrs r2, r0, 16 - mov r1, r8 - ldrb r0, [r1] - lsls r0, 3 - add r0, r12 - ldrb r0, [r0, 0x4] - cmp r2, r0 - bcc _08127868 -_081278E2: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0xF - bls _08127842 - movs r5, 0 - movs r6, 0 - ldr r3, =gDecorationInventories - mov r8, r3 -_081278F4: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x0000271c - adds r0, r1 - adds r0, r6 - ldrb r0, [r0] - adds r7, r6, 0x1 - cmp r0, 0 - beq _0812799A - movs r2, 0 - b _0812798C - .pool -_08127918: - ldr r0, =gUnknown_0203A14C - ldr r1, [r0] - adds r1, r2 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x0000271c - adds r0, r3 - adds r0, r6 - ldrb r1, [r1] - adds r4, r2, 0x1 - ldrb r0, [r0] - cmp r1, r0 - bne _08127988 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_81277BC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08127988 - movs r1, 0 - cmp r1, r5 - bcs _08127966 - ldr r2, =gUnknown_0203A162 - ldrb r0, [r2] - cmp r0, r4 - beq _08127966 - adds r3, r2, 0 - adds r2, r4, 0 -_08127954: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r5 - bcs _08127966 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _08127954 -_08127966: - cmp r1, r5 - bne _08127988 - ldr r0, =gUnknown_0203A162 - adds r0, r5, r0 - strb r4, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - b _0812799A - .pool -_08127988: - lsls r0, r4, 16 - lsrs r2, r0, 16 -_0812798C: - ldr r0, =gUnknown_0203A173 - ldrb r0, [r0] - lsls r0, 3 - add r0, r8 - ldrb r0, [r0, 0x4] - cmp r2, r0 - bcc _08127918 -_0812799A: - lsls r0, r7, 16 - lsrs r6, r0, 16 - cmp r6, 0xB - bls _081278F4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127814 - - thumb_func_start sub_81279B4 -sub_81279B4: @ 81279B4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_8127814 - pop {r0} - bx r0 - thumb_func_end sub_81279B4 - - thumb_func_start sub_81279C4 -sub_81279C4: @ 81279C4 - push {r4,lr} - movs r2, 0 - ldr r0, =gUnknown_0203A170 - ldrh r0, [r0] - ldr r1, =gUnknown_0203A16E - ldrh r1, [r1] - adds r0, r1 - adds r1, r0, 0x1 - ldr r4, =gUnknown_0203A152 - ldr r3, =gUnknown_0203A162 -_081279D8: - adds r0, r2, r4 - ldrb r0, [r0] - cmp r0, r1 - beq _081279EC - cmp r2, 0xB - bhi _08127A00 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r0, r1 - bne _08127A00 -_081279EC: - movs r0, 0 - b _08127A0C - .pool -_08127A00: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0xF - bls _081279D8 - movs r0, 0x1 -_08127A0C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81279C4 - - thumb_func_start sub_8127A14 -sub_8127A14: @ 8127A14 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_81269D4 - adds r0, r4, 0 - bl sub_8127620 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127A14 - - thumb_func_start sub_8127A30 -sub_8127A30: @ 8127A30 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8127A14 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127A30 - - thumb_func_start sub_8127A5C -sub_8127A5C: @ 8127A5C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08127A82 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - movs r0, 0x1 - bl sub_81269D4 - adds r0, r4, 0 - bl sub_8127620 -_08127A82: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127A5C - - thumb_func_start sub_8127A8C -sub_8127A8C: @ 8127A8C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - bl sub_8127554 - bl sub_81277A8 - ldrb r0, [r4, 0x1A] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldr r0, =gUnknown_0203A18C - ldr r0, [r0] - bl Free - adds r0, r5, 0 - bl sub_8126E44 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127A8C - - thumb_func_start sub_8127ACC -sub_8127ACC: @ 8127ACC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gTasks - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r4, r2, r3 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldrh r0, [r1] - strh r0, [r4, 0xE] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x10] - adds r3, 0x8 - adds r2, r3 - adds r1, r2, 0x2 - adds r0, r2, 0 - bl PlayerGetDestCoords - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127ACC - - thumb_func_start sub_8127B04 -sub_8127B04: @ 8127B04 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - bl DrawWholeMapView - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - movs r2, 0x1 - negs r2, r2 - ldr r3, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r3 - movs r3, 0xE - ldrsb r3, [r4, r3] - ldrb r4, [r4, 0x10] - lsls r4, 24 - asrs r4, 24 - str r4, [sp] - bl Overworld_SetWarpDestination - bl warp_in - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127B04 - - thumb_func_start sub_8127B54 -sub_8127B54: @ 8127B54 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x0000ffff - cmp r2, 0x22 - beq _08127B7C - cmp r2, 0x26 - bne _08127B86 - ldr r0, =gUnknown_085A72E4 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 28 - lsrs r0, 16 - b _08127B86 - .pool -_08127B7C: - ldr r0, =gUnknown_085A72EC - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 28 - lsrs r0, 16 -_08127B86: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8127B54 - - thumb_func_start sub_8127B90 -sub_8127B90: @ 8127B90 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - ldr r4, [sp, 0x54] - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x4] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x8] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r4, 16 - lsrs r4, 16 - str r4, [sp, 0x10] - movs r2, 0 - lsls r0, r3, 16 - cmp r2, r3 - bcc _08127BC6 - b _08127D28 -_08127BC6: - ldr r1, [sp, 0x8] - str r1, [sp, 0x28] - str r0, [sp, 0x2C] -_08127BCC: - ldr r3, [sp, 0x4] - ldr r4, [sp, 0xC] - subs r1, r3, r4 - lsls r0, r2, 16 - asrs r0, 16 - adds r0, 0x1 - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x14] - movs r0, 0 - mov r10, r0 - adds r1, r2, 0x1 - str r1, [sp, 0x30] - ldr r3, [sp, 0x28] - cmp r10, r3 - bcc _08127BF0 - b _08127D18 -_08127BF0: - ldr r4, [sp, 0x10] - lsls r4, 5 - str r4, [sp, 0x18] - ldr r0, =gUnknown_085A5C24 - adds r0, r4, r0 - str r0, [sp, 0x1C] - ldr r0, =gDecorations - adds r0, r4, r0 - str r0, [sp, 0x24] - ldr r3, [sp, 0x8] - adds r1, r2, 0 - muls r1, r3 - str r1, [sp, 0x20] -_08127C0A: - ldr r0, [sp] - add r0, r10 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r1, [sp, 0x20] - add r1, r10 - ldr r4, [sp, 0x1C] - ldr r0, [r4] - lsls r1, 1 - adds r1, r0 - movs r2, 0x80 - lsls r2, 2 - adds r0, r2, 0 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl GetBehaviorByMetatileId - lsls r4, r0, 16 - lsls r0, r4, 8 - lsrs r0, 24 - bl MetatileBehavior_IsMB_B9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08127C50 - ldr r3, [sp, 0x24] - ldrb r0, [r3, 0x11] - cmp r0, 0x1 - beq _08127C60 - lsrs r0, r4, 28 - cmp r0, 0 - beq _08127C60 -_08127C50: - movs r4, 0xC0 - lsls r4, 4 - mov r8, r4 - b _08127C64 - .pool -_08127C60: - movs r0, 0 - mov r8, r0 -_08127C64: - ldr r1, [sp, 0x24] - ldrb r0, [r1, 0x11] - lsls r7, r5, 16 - ldr r2, [sp, 0x14] - lsls r2, 16 - mov r9, r2 - cmp r0, 0x3 - beq _08127C8E - asrs r0, r7, 16 - asrs r1, r2, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsMB_B7 - lsls r0, 24 - lsrs r0, 24 - movs r6, 0x1 - cmp r0, 0x1 - beq _08127C90 -_08127C8E: - movs r6, 0 -_08127C90: - ldr r3, [sp, 0x18] - ldr r4, =gDecorations - adds r0, r3, r4 - ldrb r0, [r0] - ldr r4, [sp, 0x20] - add r4, r10 - lsls r1, r4, 24 - lsrs r1, 24 - bl sub_8127B54 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _08127CE0 - asrs r0, r7, 16 - mov r2, r9 - asrs r1, r2, 16 - ldr r3, [sp, 0x1C] - ldr r2, [r3] - lsls r3, r4, 1 - adds r3, r2 - movs r4, 0x80 - lsls r4, 2 - adds r2, r4, 0 - orrs r6, r2 - ldrh r3, [r3] - adds r2, r6, r3 - mov r3, r8 - orrs r3, r2 - orrs r3, r5 - lsls r2, r3, 16 - lsrs r2, 16 - bl MapGridSetMetatileEntryAt - b _08127D06 - .pool -_08127CE0: - asrs r0, r7, 16 - mov r2, r9 - asrs r1, r2, 16 - ldr r3, [sp, 0x1C] - ldr r2, [r3] - lsls r3, r4, 1 - adds r3, r2 - movs r4, 0x80 - lsls r4, 2 - adds r2, r4, 0 - orrs r6, r2 - ldrh r3, [r3] - adds r2, r6, r3 - mov r3, r8 - orrs r3, r2 - lsls r2, r3, 16 - lsrs r2, 16 - bl MapGridSetMetatileIdAt -_08127D06: - mov r0, r10 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - ldr r4, [sp, 0x28] - cmp r10, r4 - bcs _08127D18 - b _08127C0A -_08127D18: - ldr r1, [sp, 0x30] - lsls r0, r1, 16 - lsrs r2, r0, 16 - ldr r3, [sp, 0x2C] - lsrs r0, r3, 16 - cmp r2, r0 - bcs _08127D28 - b _08127BCC -_08127D28: - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8127B90 - - thumb_func_start sub_8127D38 -sub_8127D38: @ 8127D38 - push {r4,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =gDecorations - lsls r0, r2, 5 - adds r0, r1 - ldrb r0, [r0, 0x12] - cmp r0, 0x9 - bhi _08127E10 - lsls r0, 2 - ldr r1, =_08127D68 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08127D68: - .4byte _08127D90 - .4byte _08127D9A - .4byte _08127DA4 - .4byte _08127DB4 - .4byte _08127DBE - .4byte _08127DC8 - .4byte _08127DD8 - .4byte _08127DE2 - .4byte _08127DF2 - .4byte _08127E02 -_08127D90: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x1 - b _08127DAC -_08127D9A: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x2 - b _08127DAC -_08127DA4: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x3 -_08127DAC: - movs r3, 0x1 - bl sub_8127B90 - b _08127E10 -_08127DB4: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x4 - b _08127DD0 -_08127DBE: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x2 - b _08127DD0 -_08127DC8: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x1 -_08127DD0: - movs r3, 0x2 - bl sub_8127B90 - b _08127E10 -_08127DD8: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x1 - b _08127DFA -_08127DE2: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x2 - movs r3, 0x4 - bl sub_8127B90 - b _08127E10 -_08127DF2: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x3 -_08127DFA: - movs r3, 0x3 - bl sub_8127B90 - b _08127E10 -_08127E02: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x3 - movs r3, 0x2 - bl sub_8127B90 -_08127E10: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127D38 - - thumb_func_start sub_8127E18 -sub_8127E18: @ 8127E18 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r6, 0 - ldr r7, =gMapHeader - ldr r0, =gSpecialVar_0x8005 - mov r8, r0 - ldr r1, =gSpecialVar_0x8006 - mov r10, r1 - ldr r2, =gSaveBlock1Ptr - mov r9, r2 -_08127E34: - adds r5, r6, 0 - adds r5, 0xAE - adds r4, r5, 0 - adds r0, r4, 0 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08127F1C - adds r0, r4, 0 - bl FlagClear - movs r2, 0 - ldr r0, [r7, 0x4] - ldrb r4, [r0] - cmp r2, r4 - bcs _08127E82 - ldr r0, [r0, 0x4] - ldrh r0, [r0, 0x14] - cmp r0, r5 - beq _08127E82 - ldr r0, =gMapHeader - ldr r3, [r0, 0x4] - ldrb r6, [r3] - adds r4, r5, 0 -_08127E68: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r6 - bcs _08127E82 - ldr r0, [r3, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - cmp r0, r4 - bne _08127E68 -_08127E82: - ldr r0, [r7, 0x4] - ldr r1, [r0, 0x4] - lsls r4, r2, 1 - adds r4, r2 - lsls r4, 3 - adds r1, r4, r1 - ldr r5, =0x00003f20 - adds r0, r5, 0 - ldrb r1, [r1, 0x1] - adds r0, r1 - ldr r1, =gUnknown_0203A190 - ldr r1, [r1] - ldr r1, [r1, 0x1C] - ldrh r1, [r1] - bl VarSet - ldr r0, [r7, 0x4] - ldr r0, [r0, 0x4] - adds r4, r0 - ldrb r0, [r4] - mov r6, r8 - strh r0, [r6] - ldr r1, =gUnknown_0203AA34 - ldrh r1, [r1] - mov r2, r10 - strh r1, [r2] - ldr r1, =gUnknown_0203AA36 - ldrh r1, [r1] - ldr r4, =gSpecialVar_0x8007 - strh r1, [r4] - mov r5, r9 - ldr r2, [r5] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl show_sprite - ldrb r0, [r6] - ldr r2, [r5] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - mov r6, r10 - movs r4, 0 - ldrsh r3, [r6, r4] - ldr r5, =gSpecialVar_0x8007 - movs r6, 0 - ldrsh r4, [r5, r6] - str r4, [sp] - bl sub_808EBA8 - mov r1, r8 - ldrb r0, [r1] - mov r4, r9 - ldr r2, [r4] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl sub_808F254 - b _08127F26 - .pool -_08127F1C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xD - bls _08127E34 -_08127F26: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8127E18 - - thumb_func_start sub_8127F38 -sub_8127F38: @ 8127F38 - push {lr} - movs r1, 0 - ldr r0, =gUnknown_0203A17C - ldrb r2, [r0, 0x8] - cmp r1, r2 - bcs _08127F62 - ldr r3, [r0] -_08127F46: - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08127F58 - movs r0, 0x1 - b _08127F64 - .pool -_08127F58: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r2 - bcc _08127F46 -_08127F62: - movs r0, 0 -_08127F64: - pop {r1} - bx r1 - thumb_func_end sub_8127F38 - - thumb_func_start sub_8127F68 -sub_8127F68: @ 8127F68 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_0203A17C - ldrb r0, [r0, 0x9] - cmp r0, 0x1 - bne _08127FAC - ldr r0, =gUnknown_0203A173 - ldrb r0, [r0] - cmp r0, 0x6 - beq _08127FAC - cmp r0, 0x7 - beq _08127FAC - ldr r4, =gStringVar4 - ldr r1, =gText_CantPlaceInRoom - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_8127A5C - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _0812804C - .pool -_08127FAC: - bl sub_81279C4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08128038 - bl sub_8127F38 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08127FE8 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - ldr r1, =sub_8128060 - str r1, [r0] - b _0812804C - .pool -_08127FE8: - ldr r0, =gStringVar1 - ldr r4, =gUnknown_0203A17C - ldrb r1, [r4, 0x8] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldrb r0, [r4, 0x9] - cmp r0, 0 - bne _08128018 - ldr r0, =gStringVar4 - ldr r1, =gText_NoMoreDecorations - bl StringExpandPlaceholders - b _08128020 - .pool -_08128018: - ldr r0, =gStringVar4 - ldr r1, =gText_NoMoreDecorations2 - bl StringExpandPlaceholders -_08128020: - ldr r1, =gStringVar4 - ldr r2, =sub_8127A5C - adds r0, r5, 0 - bl DisplayItemMessageOnField - b _0812804C - .pool -_08128038: - ldr r4, =gStringVar4 - ldr r1, =gText_InUseAlready - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_8127A5C - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField -_0812804C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127F68 - - thumb_func_start sub_8128060 -sub_8128060: @ 8128060 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r7, r0, r1 - movs r1, 0xC - ldrsh r0, [r7, r1] - cmp r0, 0x1 - beq _081280AC - cmp r0, 0x1 - bgt _08128088 - cmp r0, 0 - beq _0812808E - b _08128112 - .pool -_08128088: - cmp r0, 0x2 - beq _081280FC - b _08128112 -_0812808E: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08128112 - adds r0, r6, 0 - bl sub_8127ACC - movs r0, 0x1 - strh r0, [r7, 0xC] - b _08128112 - .pool -_081280AC: - ldr r4, =gPaletteFade - ldrb r0, [r4, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4, 0x8] - ldr r5, =gUnknown_0203A190 - ldr r0, =gUnknown_0203A172 - ldrb r1, [r0] - ldr r0, =gUnknown_0203A14C - ldr r0, [r0] - adds r0, r1 - ldrb r1, [r0] - adds r0, r5, 0 - bl ConfigureCameraObjectForPlacingDecoration - adds r0, r6, 0 - bl sub_812826C - adds r0, r6, 0 - adds r1, r5, 0 - bl SetUpPlacingDecorationPlayerAvatar - bl pal_fill_black - ldrb r1, [r4, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r4, 0x8] - movs r0, 0x2 - strh r0, [r7, 0xC] - b _08128112 - .pool -_081280FC: - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08128112 - movs r0, 0 - strh r0, [r7, 0x20] - adds r0, r6, 0 - bl sub_8128FD8 -_08128112: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8128060 - - thumb_func_start ConfigureCameraObjectForPlacingDecoration -ConfigureCameraObjectForPlacingDecoration: @ 8128118 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0203AA38 - ldr r4, =gSprites - ldr r5, =gUnknown_03005DD0 - ldr r2, [r5, 0x4] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x2E] - strb r0, [r3] - adds r0, r6, 0 - bl gpu_pal_decompress_alloc_tag_and_upload - lsls r0, 24 - lsrs r0, 24 - str r0, [r5, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r0, r4, 0 - adds r0, 0x1C - adds r0, r2, r0 - ldr r1, =sub_81292D0 - str r1, [r0] - adds r2, r4 - ldr r3, =gUnknown_085A7250 - ldr r0, [r6] - ldrb r0, [r0, 0x12] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x2] - strh r0, [r2, 0x20] - ldr r0, [r5, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldr r0, [r6] - ldrb r0, [r0, 0x12] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x3] - strh r0, [r1, 0x22] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ConfigureCameraObjectForPlacingDecoration - - thumb_func_start SetUpPlacingDecorationPlayerAvatar -SetUpPlacingDecorationPlayerAvatar: @ 81281A8 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gTasks - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r3 - ldrb r2, [r2, 0x12] - ldr r3, =gUnknown_085A7250 - ldr r0, [r1] - ldrb r4, [r0, 0x12] - lsls r1, r4, 2 - adds r1, r3 - lsls r0, r2, 4 - ldrb r1, [r1, 0x2] - adds r0, r1 - subs r2, 0x1 - lsls r2, 3 - subs r0, r2 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r4, 0x2 - beq _081281E2 - cmp r4, 0x8 - beq _081281E2 - cmp r4, 0x9 - bne _081281EA -_081281E2: - adds r0, r2, 0 - subs r0, 0x8 - lsls r0, 24 - lsrs r2, r0, 24 -_081281EA: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _0812820C - ldr r1, =SpriteCallbackDummy - str r0, [sp] - movs r0, 0xC1 - b _08128214 - .pool -_0812820C: - ldr r1, =SpriteCallbackDummy - movs r0, 0 - str r0, [sp] - movs r0, 0xC2 -_08128214: - movs r3, 0x48 - bl AddPseudoFieldObject - ldr r1, =gUnknown_0203AA39 - strb r0, [r1] - ldr r3, =gSprites - ldr r0, =gUnknown_0203AA39 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r4, =gUnknown_0203AA38 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - bl DestroySprite - ldr r0, =gUnknown_03005DD0 - ldr r0, [r0, 0x4] - strb r0, [r4] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end SetUpPlacingDecorationPlayerAvatar - - thumb_func_start sub_812826C -sub_812826C: @ 812826C - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gDecorations - ldr r0, =gUnknown_0203A172 - ldrb r1, [r0] - ldr r0, =gUnknown_0203A14C - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 5 - adds r0, r2 - ldrb r0, [r0, 0x12] - cmp r0, 0x9 - bls _0812828C - b _081283B2 -_0812828C: - lsls r0, 2 - ldr r1, =_081282A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081282A8: - .4byte _081282D0 - .4byte _081282E4 - .4byte _081282FC - .4byte _08128314 - .4byte _08128328 - .4byte _0812833C - .4byte _08128350 - .4byte _08128370 - .4byte _08128388 - .4byte _081283A0 -_081282D0: - ldr r0, =gTasks - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - b _08128394 - .pool -_081282E4: - ldr r1, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x12] - movs r1, 0x1 - b _081283B0 - .pool -_081282FC: - ldr r1, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r1, 0x3 - strh r1, [r0, 0x12] - movs r1, 0x1 - b _081283B0 - .pool -_08128314: - ldr r1, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r1, 0x4 - b _081283AC - .pool -_08128328: - ldr r0, =gTasks - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - movs r0, 0x2 - b _08128394 - .pool -_0812833C: - ldr r1, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - b _081283AC - .pool -_08128350: - ldr r0, =gTasks - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x12] - movs r0, 0x3 - strh r0, [r1, 0x14] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _081283B2 - .pool -_08128370: - ldr r1, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x12] - movs r1, 0x4 - b _081283B0 - .pool -_08128388: - ldr r0, =gTasks - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - movs r0, 0x3 -_08128394: - strh r0, [r1, 0x12] - strh r0, [r1, 0x14] - b _081283B2 - .pool -_081283A0: - ldr r1, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r1, 0x3 -_081283AC: - strh r1, [r0, 0x12] - movs r1, 0x2 -_081283B0: - strh r1, [r0, 0x14] -_081283B2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_812826C - - thumb_func_start sub_81283BC -sub_81283BC: @ 81283BC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x1C] - ldr r3, =gSprites - ldr r0, =gUnknown_0203AA38 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r2, 0x1 - strh r2, [r0, 0x3C] - ldr r0, =gUnknown_0203AA39 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x3C] - bl sub_8128DE0 - adds r0, r4, 0 - bl sub_8128950 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81283BC - - thumb_func_start sub_8128414 -sub_8128414: @ 8128414 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x1C] - ldr r3, =gSprites - ldr r0, =gUnknown_0203AA38 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r2, 0x1 - strh r2, [r0, 0x3C] - ldr r0, =gUnknown_0203AA39 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x3C] - bl sub_8128DE0 - ldr r5, =gStringVar4 - ldr r1, =gText_CancelDecorating - adds r0, r5, 0 - bl StringExpandPlaceholders - ldr r2, =sub_8128B80 - adds r0, r4, 0 - adds r1, r5, 0 - bl DisplayItemMessageOnField - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128414 - - thumb_func_start sub_8128484 -sub_8128484: @ 8128484 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - bl MetatileBehavior_IsMB_B3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0812849E - cmp r4, 0 - beq _081284A2 -_0812849E: - movs r0, 0 - b _081284A4 -_081284A2: - movs r0, 0x1 -_081284A4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8128484 - - thumb_func_start sub_81284AC -sub_81284AC: @ 81284AC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r4, r2, 16 - lsls r3, 16 - lsrs r5, r3, 16 - lsls r1, 16 - asrs r1, 16 - ldr r3, =gTasks - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r3 - movs r3, 0xE - ldrsh r0, [r2, r3] - adds r0, 0x7 - cmp r1, r0 - bne _081284EC - lsls r1, r4, 16 - asrs r1, 16 - movs r3, 0x10 - ldrsh r0, [r2, r3] - adds r0, 0x7 - cmp r1, r0 - bne _081284EC - cmp r5, 0 - beq _081284EC - movs r0, 0 - b _081284EE - .pool -_081284EC: - movs r0, 0x1 -_081284EE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81284AC - - thumb_func_start sub_81284F4 -sub_81284F4: @ 81284F4 - push {r4-r6,lr} - adds r5, r1, 0 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r0, r6, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsMB_B3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08128534 - ldrb r0, [r5] - cmp r0, 0x21 - bne _08128522 - adds r0, r4, 0 - bl MetatileBehavior_IsMB_C2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08128530 -_08128522: - lsls r0, r6, 24 - lsrs r0, 24 - bl MetatileBehavior_IsNormal - lsls r0, 24 - cmp r0, 0 - beq _08128534 -_08128530: - movs r0, 0x1 - b _08128536 -_08128534: - movs r0, 0 -_08128536: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81284F4 - - thumb_func_start sub_812853C -sub_812853C: @ 812853C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - str r1, [sp] - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r10 - lsls r0, 3 - adds r0, r1 - ldrb r2, [r0, 0x14] - str r2, [sp, 0x4] - ldrb r0, [r0, 0x12] - str r0, [sp, 0x8] - ldr r3, [sp] - ldrb r0, [r3, 0x11] - adds r2, r1, 0 - cmp r0, 0x4 - bls _0812856E - b _0812893C -_0812856E: - lsls r0, 2 - ldr r1, =_08128580 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08128580: - .4byte _08128594 - .4byte _08128594 - .4byte _08128680 - .4byte _08128834 - .4byte _081288B8 -_08128594: - movs r6, 0 - ldr r0, [sp, 0x4] - cmp r6, r0 - bcc _0812859E - b _0812893C -_0812859E: - mov r1, r10 - lsls r1, 2 - str r1, [sp, 0x1C] -_081285A4: - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - ldrh r0, [r0, 0xA] - subs r0, r6 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r7, 0 - adds r6, 0x1 - str r6, [sp, 0x14] - ldr r0, [sp, 0x8] - cmp r7, r0 - bcs _0812866E - mov r1, r9 - lsls r1, 16 - str r1, [sp, 0xC] - asrs r1, 16 - mov r9, r1 -_081285D0: - ldr r0, [sp, 0x1C] - add r0, r10 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - ldrh r0, [r0, 0x8] - adds r0, r7 - lsls r0, 16 - mov r8, r0 - asrs r6, r0, 16 - adds r0, r6, 0 - mov r1, r9 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, [sp, 0x4] - ldr r1, [sp, 0x14] - subs r0, r3, r1 - ldr r2, [sp, 0x8] - adds r1, r0, 0 - muls r1, r2 - adds r1, r7 - ldr r3, [sp] - ldr r0, [r3, 0x1C] - lsls r1, 1 - adds r1, r0 - movs r2, 0x80 - lsls r2, 2 - adds r0, r2, 0 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl GetBehaviorByMetatileId - movs r3, 0xF0 - lsls r3, 8 - adds r1, r3, 0 - adds r5, r1, 0 - ands r5, r0 - adds r0, r4, 0 - ldr r1, [sp] - bl sub_81284F4 - lsls r0, 24 - cmp r0, 0 - bne _08128632 - b _0812890C -_08128632: - mov r0, r10 - adds r1, r6, 0 - mov r2, r9 - adds r3, r5, 0 - bl sub_81284AC - lsls r0, 24 - cmp r0, 0 - bne _08128646 - b _0812890C -_08128646: - mov r1, r8 - lsrs r0, r1, 16 - ldr r2, [sp, 0xC] - lsrs r1, r2, 16 - movs r2, 0 - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08128662 - cmp r4, 0x10 - beq _08128662 - b _0812890C -_08128662: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcc _081285D0 -_0812866E: - ldr r1, [sp, 0x14] - lsls r0, r1, 24 - lsrs r6, r0, 24 - ldr r2, [sp, 0x4] - cmp r6, r2 - bcc _081285A4 - b _0812893C - .pool -_08128680: - movs r6, 0 - mov r3, r10 - lsls r3, 2 - str r3, [sp, 0x1C] - ldr r0, [sp, 0x4] - subs r0, 0x1 - str r0, [sp, 0x18] - cmp r6, r0 - bge _0812876C - adds r0, r3, 0 - add r0, r10 - lsls r0, 3 - str r0, [sp, 0x10] -_0812869A: - ldr r1, [sp, 0x10] - adds r0, r1, r2 - ldrh r0, [r0, 0xA] - subs r0, r6 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r7, 0 - adds r6, 0x1 - str r6, [sp, 0x14] - ldr r3, [sp, 0x8] - cmp r7, r3 - bcs _08128760 - lsls r0, 16 - str r0, [sp, 0x20] -_081286B8: - ldr r1, [sp, 0x10] - adds r0, r1, r2 - ldrh r0, [r0, 0x8] - adds r0, r7 - lsls r0, 16 - mov r8, r0 - asrs r6, r0, 16 - mov r2, r9 - lsls r1, r2, 16 - adds r0, r6, 0 - asrs r1, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, [sp, 0x4] - ldr r1, [sp, 0x14] - subs r0, r3, r1 - ldr r2, [sp, 0x8] - adds r1, r0, 0 - muls r1, r2 - adds r1, r7 - ldr r3, [sp] - ldr r0, [r3, 0x1C] - lsls r1, 1 - adds r1, r0 - movs r2, 0x80 - lsls r2, 2 - adds r0, r2, 0 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl GetBehaviorByMetatileId - movs r3, 0xF0 - lsls r3, 8 - adds r1, r3, 0 - adds r5, r1, 0 - ands r5, r0 - adds r0, r4, 0 - bl MetatileBehavior_IsNormal - lsls r0, 24 - cmp r0, 0 - bne _08128724 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8128484 - lsls r0, 24 - cmp r0, 0 - bne _08128724 - b _0812890C -_08128724: - mov r0, r10 - adds r1, r6, 0 - ldr r3, [sp, 0x20] - asrs r2, r3, 16 - adds r3, r5, 0 - bl sub_81284AC - lsls r0, 24 - cmp r0, 0 - bne _0812873A - b _0812890C -_0812873A: - mov r1, r8 - lsrs r0, r1, 16 - ldr r2, [sp, 0x20] - lsrs r1, r2, 16 - movs r2, 0 - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _08128752 - b _0812890C -_08128752: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =gTasks - ldr r3, [sp, 0x8] - cmp r7, r3 - bcc _081286B8 -_08128760: - ldr r1, [sp, 0x14] - lsls r0, r1, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x18] - cmp r6, r3 - blt _0812869A -_0812876C: - ldr r0, [sp, 0x1C] - add r0, r10 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0xA] - ldr r1, [sp, 0x4] - subs r0, r1 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r7, 0 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcc _0812878C - b _0812893C -_0812878C: - lsls r0, 16 - str r0, [sp, 0x20] -_08128790: - ldr r0, [sp, 0x1C] - add r0, r10 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - ldrh r0, [r0, 0x8] - adds r0, r7 - lsls r0, 16 - mov r8, r0 - asrs r6, r0, 16 - mov r2, r9 - lsls r1, r2, 16 - adds r0, r6, 0 - asrs r1, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, [sp] - ldr r0, [r3, 0x1C] - lsls r1, r7, 1 - adds r1, r0 - movs r2, 0x80 - lsls r2, 2 - adds r0, r2, 0 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl GetBehaviorByMetatileId - movs r3, 0xF0 - lsls r3, 8 - adds r1, r3, 0 - adds r5, r1, 0 - ands r5, r0 - adds r0, r4, 0 - bl MetatileBehavior_IsNormal - lsls r0, 24 - cmp r0, 0 - bne _081287F2 - adds r0, r4, 0 - bl MetatileBehavior_IsMB_B7 - lsls r0, 24 - cmp r0, 0 - bne _081287F2 - b _0812890C -_081287F2: - mov r0, r10 - adds r1, r6, 0 - ldr r3, [sp, 0x20] - asrs r2, r3, 16 - adds r3, r5, 0 - bl sub_81284AC - lsls r0, 24 - cmp r0, 0 - bne _08128808 - b _0812890C -_08128808: - mov r1, r8 - lsrs r0, r1, 16 - ldr r2, [sp, 0x20] - lsrs r1, r2, 16 - movs r2, 0 - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08128822 - cmp r4, 0x10 - bne _0812890C -_08128822: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcc _08128790 - b _0812893C - .pool -_08128834: - movs r6, 0 - ldr r0, [sp, 0x4] - cmp r6, r0 - bcc _0812883E - b _0812893C -_0812883E: - mov r1, r10 - lsls r0, r1, 2 - add r0, r10 - lsls r1, r0, 3 - ldr r2, =gTasks - adds r0, r1, r2 - ldrh r0, [r0, 0xA] - subs r0, r6 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r7, 0 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcs _081288A4 - adds r0, r2, 0 - adds r1, r0 - mov r8, r1 - mov r1, r9 - lsls r0, r1, 16 - asrs r5, r0, 16 -_08128868: - mov r2, r8 - ldrh r0, [r2, 0x8] - adds r0, r7 - lsls r0, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsMB_B7 - lsls r0, 24 - cmp r0, 0 - beq _0812890C - adds r0, r4, 0 - adds r1, r5, 0x1 - bl MapGridGetMetatileIdAt - movs r1, 0xA3 - lsls r1, 2 - cmp r0, r1 - beq _0812890C - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcc _08128868 -_081288A4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [sp, 0x4] - cmp r6, r0 - bcc _0812883E - b _0812893C - .pool -_081288B8: - mov r3, r10 - lsls r1, r3, 2 - adds r0, r1, r3 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0xA] - mov r9, r0 - movs r7, 0 - str r1, [sp, 0x1C] - ldr r0, [sp, 0x8] - cmp r7, r0 - bcs _0812893C - adds r6, r2, 0 - mov r1, r9 - lsls r1, 16 - str r1, [sp, 0x20] -_081288D8: - ldr r0, [sp, 0x1C] - add r0, r10 - lsls r0, 3 - adds r0, r6 - ldrh r0, [r0, 0x8] - adds r0, r7 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, [sp] - ldrb r0, [r3, 0x12] - cmp r0, 0x5 - bne _08128910 -_08128900: - adds r0, r4, 0 - bl MetatileBehavior_IsMB_C3 - lsls r0, 24 - cmp r0, 0 - bne _0812891C -_0812890C: - movs r0, 0 - b _0812893E -_08128910: - adds r0, r4, 0 - bl MetatileBehavior_IsMB_B5 - lsls r0, 24 - cmp r0, 0 - beq _08128900 -_0812891C: - adds r0, r5, 0 - ldr r2, [sp, 0x20] - lsrs r1, r2, 16 - movs r2, 0 - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - bne _0812890C - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcc _081288D8 -_0812893C: - movs r0, 0x1 -_0812893E: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_812853C - - thumb_func_start sub_8128950 -sub_8128950: @ 8128950 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_0203A172 - ldrb r1, [r0] - ldr r0, =gUnknown_0203A14C - ldr r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r1, 5 - ldr r0, =gDecorations - adds r1, r0 - adds r0, r5, 0 - bl sub_812853C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081289A4 - ldr r4, =gStringVar4 - ldr r1, =gText_PlaceItHere - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_81289D0 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _081289BE - .pool -_081289A4: - movs r0, 0x20 - bl PlaySE - ldr r4, =gStringVar4 - ldr r1, =gText_CantBePlacedHere - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_8129020 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField -_081289BE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128950 - - thumb_func_start sub_81289D0 -sub_81289D0: @ 81289D0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_085A72C4 - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81289D0 - - thumb_func_start sub_81289F0 -sub_81289F0: @ 81289F0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - adds r0, r4, 0 - bl sub_8128AAC - ldr r2, =gDecorations - ldr r0, =gUnknown_0203A172 - ldrb r1, [r0] - ldr r0, =gUnknown_0203A14C - ldr r0, [r0] - adds r0, r1 - ldrb r3, [r0] - lsls r0, r3, 5 - adds r0, r2 - ldrb r0, [r0, 0x11] - cmp r0, 0x4 - beq _08128A44 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - ldrh r1, [r1, 0xA] - adds r2, r3, 0 - bl sub_8127D38 - b _08128A64 - .pool -_08128A44: - ldr r2, =gUnknown_0203AA34 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - subs r0, 0x7 - strh r0, [r2] - ldr r2, =gUnknown_0203AA36 - ldrh r0, [r1, 0xA] - subs r0, 0x7 - strh r0, [r2] - ldr r0, =gUnknown_08275D1F - bl ScriptContext1_SetupScript -_08128A64: - ldr r2, =gSprites - ldr r0, =gUnknown_0203AA38 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x2 - strh r1, [r0, 0x22] - ldr r0, =gMapHeader - ldrb r0, [r0, 0x14] - cmp r0, 0x56 - bne _08128A84 - bl sub_80EE104 -_08128A84: - adds r0, r4, 0 - bl sub_8128BBC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81289F0 - - thumb_func_start sub_8128AAC -sub_8128AAC: @ 8128AAC - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r3, 0 - ldr r0, =gUnknown_0203A17C - ldrb r1, [r0, 0x8] - adds r5, r0, 0 - cmp r3, r1 - bcs _08128AD2 - ldr r4, [r5] -_08128AC0: - adds r2, r4, r3 - ldrb r0, [r2] - cmp r0, 0 - beq _08128AF0 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r1 - bcc _08128AC0 -_08128AD2: - ldrb r0, [r5, 0x9] - cmp r0, 0 - bne _08128B3C - movs r3, 0 - ldr r0, =gUnknown_0203A152 - ldrb r1, [r0] - adds r2, r0, 0 - cmp r1, 0 - bne _08128B28 - b _08128B48 - .pool -_08128AF0: - ldr r0, =gUnknown_0203A172 - ldrb r1, [r0] - ldr r0, =gUnknown_0203A14C - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r2, [r5, 0x4] - adds r2, r3 - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldrb r0, [r1, 0x8] - subs r0, 0x7 - lsls r0, 4 - ldrb r1, [r1, 0xA] - subs r1, 0x7 - adds r0, r1 - strb r0, [r2] - b _08128AD2 - .pool -_08128B28: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0xF - bhi _08128B76 - adds r1, r3, r2 - ldrb r0, [r1] - cmp r0, 0 - bne _08128B28 - b _08128B6E -_08128B3C: - movs r3, 0 - ldr r0, =gUnknown_0203A162 - ldrb r1, [r0] - adds r2, r0, 0 - cmp r1, 0 - bne _08128B5C -_08128B48: - ldr r0, =gUnknown_0203A172 - ldrb r0, [r0] - adds r0, 0x1 - strb r0, [r2] - b _08128B76 - .pool -_08128B5C: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0xB - bhi _08128B76 - adds r1, r3, r2 - ldrb r0, [r1] - cmp r0, 0 - bne _08128B5C -_08128B6E: - ldr r0, =gUnknown_0203A172 - ldrb r0, [r0] - adds r0, 0x1 - strb r0, [r1] -_08128B76: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128AAC - - thumb_func_start sub_8128B80 -sub_8128B80: @ 8128B80 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_085A72CC - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128B80 - - thumb_func_start sub_8128BA0 -sub_8128BA0: @ 8128BA0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - adds r0, r4, 0 - bl sub_8128BBC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8128BA0 - - thumb_func_start sub_8128BBC -sub_8128BBC: @ 8128BBC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - ldr r1, =c1_overworld_prev_quest - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128BBC - - thumb_func_start c1_overworld_prev_quest -c1_overworld_prev_quest: @ 8128BEC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0xC - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08128C10 - cmp r0, 0x1 - beq _08128C30 - b _08128C4C - .pool -_08128C10: - bl ScriptContext2_Enable - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08128C4C - adds r0, r4, 0 - bl sub_8127B04 - movs r0, 0x1 - strh r0, [r5, 0xC] - b _08128C4C - .pool -_08128C30: - bl sub_812A3C8 - ldr r0, =0x00000be5 - bl FreeSpritePaletteByTag - ldr r1, =gFieldCallback - ldr r0, =sub_8128CD4 - str r0, [r1] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_08128C4C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c1_overworld_prev_quest - - thumb_func_start sub_8128C64 -sub_8128C64: @ 8128C64 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r5, r1, 3 - ldr r6, =gTasks + 0x8 - adds r4, r5, r6 - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08128C9C - cmp r0, 0x1 - bgt _08128C8C - cmp r0, 0 - beq _08128C96 - b _08128CCA - .pool -_08128C8C: - cmp r0, 0x2 - beq _08128CA8 - cmp r0, 0x3 - beq _08128CB4 - b _08128CCA -_08128C96: - bl sub_80E9578 - b _08128CAC -_08128C9C: - ldr r0, =gUnknown_08275D0C - bl ScriptContext1_SetupScript - b _08128CAC - .pool -_08128CA8: - bl ScriptContext2_Enable -_08128CAC: - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] - b _08128CCA -_08128CB4: - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08128CCA - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =sub_812764C - str r1, [r0] -_08128CCA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128C64 - - thumb_func_start sub_8128CD4 -sub_8128CD4: @ 8128CD4 - push {r4,lr} - bl ScriptContext2_Enable - bl pal_fill_black - ldr r0, =sub_8128C64 - movs r1, 0x8 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_8127580 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128CD4 - - thumb_func_start sub_8128D10 -sub_8128D10: @ 8128D10 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r2, r1, r0 - ldr r0, =gUnknown_0203AA3A - ldrb r1, [r0] - adds r3, r0, 0 - cmp r1, 0x1 - bne _08128D48 - movs r1, 0x2 - ldrsh r0, [r2, r1] - movs r4, 0xC - ldrsh r1, [r2, r4] - subs r0, r1 - subs r0, 0x6 - cmp r0, 0 - bge _08128D48 - ldrh r0, [r2, 0x2] - adds r0, 0x1 - b _08128D62 - .pool -_08128D48: - ldrb r0, [r3] - cmp r0, 0x2 - bne _08128D6C - movs r0, 0x2 - ldrsh r1, [r2, r0] - subs r1, 0x7 - ldr r0, =gMapHeader - ldr r0, [r0] - ldr r0, [r0, 0x4] - cmp r1, r0 - blt _08128D6C - ldrh r0, [r2, 0x2] - subs r0, 0x1 -_08128D62: - strh r0, [r2, 0x2] - movs r0, 0 - b _08128DAE - .pool -_08128D6C: - ldrb r0, [r3] - cmp r0, 0x3 - bne _08128D82 - movs r1, 0 - ldrsh r0, [r2, r1] - subs r0, 0x7 - cmp r0, 0 - bge _08128D82 - ldrh r0, [r2] - adds r0, 0x1 - b _08128DA2 -_08128D82: - ldrb r0, [r3] - cmp r0, 0x4 - bne _08128DAC - movs r3, 0 - ldrsh r1, [r2, r3] - movs r4, 0xA - ldrsh r0, [r2, r4] - adds r1, r0 - subs r1, 0x8 - ldr r0, =gMapHeader - ldr r0, [r0] - ldr r0, [r0] - cmp r1, r0 - blt _08128DAC - ldrh r0, [r2] - subs r0, 0x1 -_08128DA2: - strh r0, [r2] - movs r0, 0 - b _08128DAE - .pool -_08128DAC: - movs r0, 0x1 -_08128DAE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8128D10 - - thumb_func_start sub_8128DB4 -sub_8128DB4: @ 8128DB4 - push {lr} - ldr r0, =gMain - ldrh r0, [r0, 0x2C] - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0x40 - beq _08128DD8 - cmp r1, 0x80 - beq _08128DD8 - cmp r1, 0x20 - beq _08128DD8 - cmp r1, 0x10 - beq _08128DD8 - movs r0, 0 - b _08128DDA - .pool -_08128DD8: - movs r0, 0x1 -_08128DDA: - pop {r1} - bx r1 - thumb_func_end sub_8128DB4 - - thumb_func_start sub_8128DE0 -sub_8128DE0: @ 8128DE0 - push {r4,lr} - ldr r1, =gUnknown_0203AA3A - movs r0, 0 - strb r0, [r1] - ldr r4, =gSprites - ldr r3, =gUnknown_0203AA38 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r2, 0 - strh r2, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x34] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128DE0 - - thumb_func_start sub_8128E18 -sub_8128E18: @ 8128E18 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r2, r0, 24 - mov r8, r2 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r5, =gSprites - ldr r3, =gUnknown_0203AA38 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x36 - ldrsh r6, [r0, r1] - cmp r6, 0 - beq _08128E46 - b _08128F66 -_08128E46: - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08128E68 - ldr r0, =gUnknown_085A72D4 - movs r3, 0x18 - ldrsh r1, [r4, r3] - lsls r1, 3 - b _08128E76 - .pool -_08128E68: - cmp r0, 0x2 - bne _08128E88 - ldr r0, =gUnknown_085A72D4 - movs r3, 0x18 - ldrsh r1, [r4, r3] - lsls r1, 3 - adds r0, 0x4 -_08128E76: - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - bl _call_via_r1 - b _08128FBA - .pool -_08128E88: - ldr r2, =gMain - ldrh r1, [r2, 0x2C] - movs r7, 0xF0 - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0x40 - bne _08128EBC - ldr r1, =gUnknown_0203AA3A - movs r0, 0x1 - strb r0, [r1] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000fffe - strh r1, [r0, 0x34] - ldrh r0, [r4, 0x2] - subs r0, 0x1 - strh r0, [r4, 0x2] -_08128EBC: - ldrh r1, [r2, 0x2C] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0x80 - bne _08128EEC - ldr r1, =gUnknown_0203AA3A - movs r0, 0x2 - strb r0, [r1] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x2 - strh r1, [r0, 0x34] - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] -_08128EEC: - ldrh r1, [r2, 0x2C] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0x20 - bne _08128F1C - ldr r1, =gUnknown_0203AA3A - movs r0, 0x3 - strb r0, [r1] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000fffe - strh r1, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x34] - ldrh r0, [r4] - subs r0, 0x1 - strh r0, [r4] -_08128F1C: - ldrh r1, [r2, 0x2C] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0x10 - bne _08128F4C - ldr r1, =gUnknown_0203AA3A - movs r0, 0x4 - strb r0, [r1] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x2 - strh r1, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x34] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_08128F4C: - bl sub_8128DB4 - lsls r0, 24 - cmp r0, 0 - beq _08128F62 - mov r0, r8 - bl sub_8128D10 - lsls r0, 24 - cmp r0, 0 - bne _08128F66 -_08128F62: - bl sub_8128DE0 -_08128F66: - ldr r0, =gUnknown_0203AA3A - ldrb r0, [r0] - cmp r0, 0 - beq _08128F94 - ldr r3, =gSprites - ldr r2, =gUnknown_0203AA38 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x36] - adds r1, 0x1 - strh r1, [r0, 0x36] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r2, [r1, 0x36] - movs r0, 0x7 - ands r0, r2 - strh r0, [r1, 0x36] -_08128F94: - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08128FBA - ldr r3, =gMain - ldrh r1, [r3, 0x2E] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08128FAC - strh r2, [r4, 0x14] -_08128FAC: - ldrh r1, [r3, 0x2E] - movs r2, 0x2 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08128FBA - strh r2, [r4, 0x14] -_08128FBA: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128E18 - - thumb_func_start sub_8128FD8 -sub_8128FD8: @ 8128FD8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - ldr r2, =gSprites - ldr r0, =gUnknown_0203AA38 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r2, 0 - strh r2, [r0, 0x3C] - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r2, [r0, 0x1C] - ldr r1, =sub_8128E18 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128FD8 - - thumb_func_start sub_8129020 -sub_8129020: @ 8129020 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0812903A - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08129040 -_0812903A: - adds r0, r2, 0 - bl sub_8128FD8 -_08129040: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129020 - - thumb_func_start sub_8129048 -sub_8129048: @ 8129048 - push {lr} - sub sp, 0x4 - adds r1, r0, 0 - mov r2, sp - movs r0, 0 - strh r0, [r2] - ldr r2, =0x01000452 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129048 - - thumb_func_start sub_8129068 -sub_8129068: @ 8129068 - push {lr} - adds r2, r0, 0 - lsls r1, 16 - ldr r0, =gTilesetPointer_SecretBase - ldr r0, [r0] - lsrs r1, 11 - ldr r0, [r0, 0x8] - adds r0, r1 - adds r1, r2, 0 - movs r2, 0x8 - bl CpuFastSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129068 - - thumb_func_start sub_8129088 -sub_8129088: @ 8129088 - push {r4-r7,lr} - sub sp, 0x20 - adds r7, r0, 0 - lsls r1, 16 - lsrs r2, r1, 16 - lsrs r4, r1, 26 - adds r5, r4, 0 - cmp r2, 0 - beq _0812909E - ldr r0, =0x000003ff - ands r2, r0 -_0812909E: - ldr r0, =gTilesetPointer_SecretBase - ldr r0, [r0] - lsls r1, r2, 5 - ldr r0, [r0, 0x4] - adds r0, r1 - mov r1, sp - movs r2, 0x8 - bl CpuFastSet - cmp r4, 0x1 - beq _081290DE - cmp r4, 0x1 - bgt _081290C8 - cmp r4, 0 - beq _081290D2 - b _0812919A - .pool -_081290C8: - cmp r5, 0x2 - beq _0812913E - cmp r5, 0x3 - beq _08129176 - b _0812919A -_081290D2: - mov r0, sp - adds r1, r7, 0 - movs r2, 0x8 - bl CpuFastSet - b _0812919A -_081290DE: - movs r5, 0 - movs r6, 0xF -_081290E2: - lsls r4, r5, 2 - adds r4, r7 - adds r5, 0x1 - lsls r3, r5, 2 - subs r0, r3, 0x1 - add r0, sp - ldrb r2, [r0] - lsrs r1, r2, 4 - adds r0, r6, 0 - ands r0, r2 - lsls r0, 4 - adds r1, r0 - strb r1, [r4] - subs r0, r3, 0x2 - add r0, sp - ldrb r2, [r0] - lsrs r1, r2, 4 - adds r0, r6, 0 - ands r0, r2 - lsls r0, 4 - adds r1, r0 - strb r1, [r4, 0x1] - subs r0, r3, 0x3 - add r0, sp - ldrb r2, [r0] - lsrs r1, r2, 4 - adds r0, r6, 0 - ands r0, r2 - lsls r0, 4 - adds r1, r0 - strb r1, [r4, 0x2] - subs r3, 0x4 - mov r1, sp - adds r0, r1, r3 - ldrb r2, [r0] - lsrs r1, r2, 4 - adds r0, r6, 0 - ands r0, r2 - lsls r0, 4 - adds r1, r0 - strb r1, [r4, 0x3] - lsls r5, 16 - lsrs r5, 16 - cmp r5, 0x7 - bls _081290E2 - b _0812919A -_0812913E: - movs r5, 0 - movs r3, 0x7 -_08129142: - lsls r2, r5, 2 - adds r2, r7 - subs r1, r3, r5 - lsls r1, 2 - mov r4, sp - adds r0, r4, r1 - ldrb r0, [r0] - strb r0, [r2] - adds r0, r1, 0x1 - add r0, sp - ldrb r0, [r0] - strb r0, [r2, 0x1] - adds r0, r1, 0x2 - add r0, sp - ldrb r0, [r0] - strb r0, [r2, 0x2] - adds r1, 0x3 - adds r0, r4, r1 - ldrb r0, [r0] - strb r0, [r2, 0x3] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x7 - bls _08129142 - b _0812919A -_08129176: - movs r5, 0 - movs r4, 0x1F - movs r6, 0xF -_0812917C: - adds r3, r7, r5 - subs r0, r4, r5 - add r0, sp - ldrb r2, [r0] - lsrs r1, r2, 4 - adds r0, r6, 0 - ands r0, r2 - lsls r0, 4 - adds r1, r0 - strb r1, [r3] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x1F - bls _0812917C -_0812919A: - add sp, 0x20 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8129088 - - thumb_func_start sub_81291A4 -sub_81291A4: @ 81291A4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r4, 0 -_081291AA: - lsls r0, r4, 5 - adds r0, 0x84 - adds r0, r5, r0 - lsls r2, r4, 1 - adds r1, r5, 0x4 - adds r1, r2 - ldrh r1, [r1] - bl sub_8129088 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3F - bls _081291AA - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81291A4 - - thumb_func_start sub_81291CC -sub_81291CC: @ 81291CC - lsls r0, 16 - ldr r1, =gTilesetPointer_SecretBaseRedCave - ldr r1, [r1] - ldr r1, [r1, 0xC] - lsrs r0, 15 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x00000fff - ands r0, r1 - bx lr - .pool - thumb_func_end sub_81291CC - - thumb_func_start sub_81291E8 -sub_81291E8: @ 81291E8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - ldr r0, [r0] - ldrb r0, [r0, 0x12] - movs r6, 0 - ldr r1, =gUnknown_085A71B0 - lsls r5, r0, 4 - adds r0, r5, r1 - ldrb r0, [r0, 0xC] - cmp r6, r0 - bcs _0812924C - adds r7, r1, 0 -_08129204: - mov r4, r8 - ldm r4!, {r1} - adds r0, r7, 0x4 - adds r0, r5, r0 - ldr r0, [r0] - adds r0, r6 - ldrb r0, [r0] - ldr r1, [r1, 0x1C] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - adds r1, r7, 0 - adds r1, 0x8 - adds r1, r5, r1 - ldr r1, [r1] - adds r1, r6 - lsls r0, 3 - ldrb r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl sub_81291CC - adds r2, r5, r7 - ldr r1, [r2] - adds r1, r6 - ldrb r1, [r1] - lsls r1, 1 - adds r4, r1 - strh r0, [r4] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r2, [r2, 0xC] - cmp r6, r2 - bcc _08129204 -_0812924C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81291E8 - - thumb_func_start sub_812925C -sub_812925C: @ 812925C - push {r4,r5,lr} - lsls r0, 24 - ldr r3, =gUnknown_0203AA3C - movs r1, 0 - strb r1, [r3] - ldrb r2, [r3, 0x1] - subs r1, 0x4 - ands r1, r2 - movs r5, 0xD - negs r5, r5 - ands r1, r5 - movs r2, 0x11 - negs r2, r2 - ands r1, r2 - subs r2, 0x10 - ands r1, r2 - strb r1, [r3, 0x1] - ldr r1, =gUnknown_085A7250 - lsrs r0, 22 - adds r0, r1 - ldrb r1, [r0] - movs r4, 0x3F - lsls r1, 6 - strb r1, [r3, 0x1] - ldrh r2, [r3, 0x2] - ldr r1, =0xfffffe00 - ands r1, r2 - strh r1, [r3, 0x2] - ldrb r2, [r3, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r2 - strb r1, [r3, 0x3] - ldrb r0, [r0, 0x1] - lsls r0, 6 - ands r4, r1 - orrs r4, r0 - strb r4, [r3, 0x3] - ldrh r1, [r3, 0x4] - ldr r0, =0xfffffc00 - ands r0, r1 - strh r0, [r3, 0x4] - ldrb r0, [r3, 0x5] - ands r5, r0 - movs r0, 0xF - ands r5, r0 - strb r5, [r3, 0x5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812925C - - thumb_func_start sub_81292D0 -sub_81292D0: @ 81292D0 - movs r1, 0 - strh r1, [r0, 0x32] - strh r1, [r0, 0x34] - strh r1, [r0, 0x36] - strh r1, [r0, 0x38] - strh r1, [r0, 0x3A] - strh r1, [r0, 0x3C] - ldr r1, =sub_81292E8 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_81292D0 - - thumb_func_start sub_81292E8 -sub_81292E8: @ 81292E8 - push {lr} - adds r2, r0, 0 - movs r1, 0x3C - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _08129322 - movs r1, 0x3A - ldrsh r0, [r2, r1] - cmp r0, 0xE - bgt _0812930A - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - b _08129314 -_0812930A: - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 -_08129314: - strb r0, [r3] - ldrh r0, [r2, 0x3A] - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - strh r0, [r2, 0x3A] - b _0812932E -_08129322: - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0812932E: - pop {r0} - bx r0 - thumb_func_end sub_81292E8 - - thumb_func_start gpu_pal_decompress_alloc_tag_and_upload -gpu_pal_decompress_alloc_tag_and_upload: @ 8129334 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r4, r1, 24 - lsrs r4, 24 - bl sub_8129048 - lsls r4, 5 - ldr r0, =gDecorations - adds r4, r0 - str r4, [r5] - ldrb r0, [r4, 0x11] - cmp r0, 0x4 - beq _081293B4 - ldr r0, =0x00000be5 - bl FreeSpritePaletteByTag - adds r0, r5, 0 - bl sub_81291E8 - ldr r0, [r5] - ldrb r0, [r0, 0x12] - bl sub_812925C - adds r0, r5, 0 - bl sub_81291A4 - ldr r1, =0x00000884 - adds r0, r5, r1 - ldr r1, =gTilesetPointer_SecretBaseRedCave - ldr r2, [r1] - ldr r1, [r5] - ldr r1, [r1, 0x1C] - ldrh r1, [r1] - ldr r2, [r2, 0xC] - lsls r1, 4 - adds r1, r2 - ldrh r1, [r1, 0xE] - lsrs r1, 12 - bl sub_8129068 - ldr r0, =gUnknown_085A72BC - bl LoadSpritePalette - ldr r0, =gUnknown_085A728C - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl CreateSprite - b _081293C6 - .pool -_081293B4: - ldr r0, [r4, 0x1C] - ldrh r0, [r0] - ldr r1, =SpriteCallbackDummy - movs r2, 0x1 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl AddPseudoFieldObject -_081293C6: - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end gpu_pal_decompress_alloc_tag_and_upload - - thumb_func_start AddDecorationIconObjectFromIconTable -@ u8 AddDecorationIconObjectFromIconTable(u16 tilesTag, u16 paletteTag, u8 decorationId) -AddDecorationIconObjectFromIconTable: @ 81293D8 - push {r4-r7,lr} - sub sp, 0x10 - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 24 - lsrs r5, r2, 24 - bl AllocItemIconTemporaryBuffers - lsls r0, 24 - cmp r0, 0 - beq _08129490 - adds r0, r5, 0 - movs r1, 0 - bl GetDecorationIconPicOrPalette - ldr r4, =gUnknown_0203CEBC - ldr r1, [r4] - bl LZDecompressWram - ldr r0, [r4] - ldr r4, =gUnknown_0203CEC0 - ldr r1, [r4] - bl CopyItemIconPicTo4x4Buffer - ldr r0, [r4] - str r0, [sp] - ldr r4, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r4 - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - lsls r2, r7, 16 - ldr r1, =0x0000ffff - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - mov r0, sp - bl LoadSpriteSheet - adds r0, r5, 0 - movs r1, 0x1 - bl GetDecorationIconPicOrPalette - str r0, [sp, 0x8] - add r0, sp, 0x8 - ldr r1, [r0, 0x4] - ands r1, r4 - orrs r1, r6 - str r1, [r0, 0x4] - bl LoadCompressedObjectPalette - movs r0, 0x18 - bl Alloc - adds r5, r0, 0 - adds r1, r5, 0 - ldr r0, =gUnknown_08614FF4 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - strh r7, [r5] - strh r6, [r5, 0x2] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl CreateSprite - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl FreeItemIconTemporaryBuffers - adds r0, r5, 0 - bl Free - adds r0, r4, 0 - b _08129492 - .pool -_08129490: - movs r0, 0x40 -_08129492: - add sp, 0x10 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end AddDecorationIconObjectFromIconTable - - thumb_func_start GetDecorationIconPicOrPalette -@ u32 GetDecorationIconPicOrPalette(u16 decorationId, u8 which) -GetDecorationIconPicOrPalette: @ 812949C - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 24 - lsrs r0, r1, 24 - cmp r3, 0x78 - bls _081294AC - movs r3, 0 -_081294AC: - ldr r2, =gUnknown_085A6BE8 - lsls r0, 2 - lsls r1, r3, 3 - adds r0, r1 - adds r0, r2 - ldr r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end GetDecorationIconPicOrPalette - - thumb_func_start AddDecorationIconObjectFromFieldObject -@ u8 AddDecorationIconObjectFromFieldObject(u16 tilesTag, u16 paletteTag, u8 decorationId) -AddDecorationIconObjectFromFieldObject: @ 81294C0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r4, r2, 0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =gUnknown_0203A190 - adds r0, r6, 0 - bl sub_8129048 - lsls r4, 5 - ldr r0, =gDecorations - adds r4, r0 - str r4, [r6] - ldrb r0, [r4, 0x11] - cmp r0, 0x4 - beq _081295A4 - adds r0, r6, 0 - bl sub_81291E8 - ldr r0, [r6] - ldrb r0, [r0, 0x12] - bl sub_812925C - adds r0, r6, 0 - bl sub_81291A4 - ldr r0, =0x00000884 - adds r5, r6, r0 - ldr r0, =gTilesetPointer_SecretBaseRedCave - ldr r1, [r0] - ldr r0, [r6] - ldr r0, [r0, 0x1C] - ldrh r0, [r0] - ldr r1, [r1, 0xC] - lsls r0, 4 - adds r0, r1 - ldrh r1, [r0, 0xE] - lsrs r1, 12 - adds r0, r5, 0 - bl sub_8129068 - adds r0, r6, 0 - adds r0, 0x84 - str r0, [sp, 0x4] - ldr r1, =gUnknown_085A72F4 - ldr r0, [r6] - ldrb r0, [r0, 0x12] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 21 - ldr r4, =0xffff0000 - mov r2, r8 - lsls r1, r2, 16 - lsrs r0, 16 - orrs r0, r1 - str r0, [sp, 0x8] - add r0, sp, 0x4 - bl LoadSpriteSheet - str r5, [sp, 0xC] - add r0, sp, 0xC - ldr r1, [r0, 0x4] - ands r1, r4 - orrs r1, r7 - str r1, [r0, 0x4] - bl LoadSpritePalette - movs r0, 0x18 - bl Alloc - adds r4, r0, 0 - adds r1, r4, 0 - ldr r0, =gUnknown_085A72A4 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r3, r8 - strh r3, [r4] - strh r7, [r4, 0x2] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl Free - b _081295BA - .pool -_081295A4: - ldr r0, [r4, 0x1C] - ldrh r0, [r0] - ldr r1, =SpriteCallbackDummy - movs r2, 0x1 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl AddPseudoFieldObject - lsls r0, 24 - lsrs r5, r0, 24 -_081295BA: - adds r0, r5, 0 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddDecorationIconObjectFromFieldObject - - thumb_func_start AddDecorationIconObject -@ u8 AddDecorationIconObject(u8 decorationId, u16 x, u16 y, u8 priority, u16 tilesTag, u16 paletteTag) -AddDecorationIconObject: @ 81295CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r0, 24 - lsrs r6, r0, 24 - mov r12, r6 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - mov r9, r8 - lsls r2, 16 - lsrs r7, r2, 16 - mov r10, r7 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - lsls r4, 16 - lsrs r4, 16 - adds r3, r4, 0 - lsls r5, 16 - lsrs r5, 16 - adds r2, r5, 0 - cmp r6, 0x78 - bls _08129634 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl AddDecorationIconObjectFromIconTable - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x40 - beq _08129696 - ldr r2, =gSprites - lsls r3, r4, 4 - adds r1, r3, r4 - lsls r1, 2 - adds r1, r2 - mov r5, r8 - lsls r0, r5, 16 - asrs r0, 16 - adds r0, 0x4 - strh r0, [r1, 0x24] - lsls r0, r7, 16 - b _081296B2 - .pool -_08129634: - ldr r0, =gUnknown_085A6BE8 - lsls r1, r6, 3 - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - bne _08129684 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl AddDecorationIconObjectFromFieldObject - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x40 - beq _08129696 - ldr r1, =gSprites - lsls r2, r4, 4 - adds r0, r2, r4 - lsls r0, 2 - adds r5, r0, r1 - mov r0, r8 - strh r0, [r5, 0x24] - adds r0, r6, 0 - subs r0, 0x2A - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08129680 - lsls r0, r7, 16 - asrs r0, 16 - subs r0, 0x4 - strh r0, [r5, 0x26] - b _081296BC - .pool -_08129680: - strh r7, [r5, 0x26] - b _081296BC -_08129684: - adds r0, r3, 0 - adds r1, r2, 0 - mov r2, r12 - bl AddDecorationIconObjectFromIconTable - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x40 - bne _0812969A -_08129696: - movs r0, 0x40 - b _081296D8 -_0812969A: - ldr r2, =gSprites - lsls r3, r4, 4 - adds r1, r3, r4 - lsls r1, 2 - adds r1, r2 - mov r5, r9 - lsls r0, r5, 16 - asrs r0, 16 - adds r0, 0x4 - strh r0, [r1, 0x24] - mov r5, r10 - lsls r0, r5, 16 -_081296B2: - asrs r0, 16 - adds r0, 0x4 - strh r0, [r1, 0x26] - adds r1, r2, 0 - adds r2, r3, 0 -_081296BC: - adds r2, r4 - lsls r2, 2 - adds r2, r1 - movs r0, 0x3 - ldr r1, [sp] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - adds r0, r4, 0 -_081296D8: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddDecorationIconObject - - thumb_func_start sub_81296EC -sub_81296EC: @ 81296EC - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_0203A17C - ldr r1, [r3] - adds r1, r0 - movs r2, 0 - strb r2, [r1] - ldr r1, [r3, 0x4] - adds r1, r0 - strb r2, [r1] - bx lr - .pool - thumb_func_end sub_81296EC - - thumb_func_start sub_8129708 -sub_8129708: @ 8129708 - push {r4-r6,lr} - ldr r6, =gSpecialVar_0x8005 - movs r0, 0 - strh r0, [r6] - ldr r2, =gScriptResult - strh r0, [r2] - ldr r4, =gSpecialVar_0x8004 - ldr r1, =gUnknown_0203AAC4 - ldrh r0, [r4] - ldrb r1, [r1] - cmp r0, r1 - bne _08129744 - movs r0, 0x1 - strh r0, [r2] - b _08129796 - .pool -_08129738: - ldr r1, =gSpecialVar_0x8006 - ldrb r0, [r2] - strh r0, [r1] - b _08129796 - .pool -_08129744: - ldr r3, =gDecorations - ldr r2, =gUnknown_0203A17C - ldr r1, =gUnknown_0203AA44 - ldrh r0, [r4] - lsls r0, 3 - adds r4, r0, r1 - ldrb r1, [r4] - ldr r0, [r2] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 5 - adds r0, r3 - ldrb r0, [r0, 0x11] - cmp r0, 0x4 - bne _08129796 - ldrh r0, [r4, 0x4] - strh r0, [r6] - ldrb r0, [r4] - bl sub_81296EC - movs r1, 0 - ldr r0, =gMapHeader - ldr r0, [r0, 0x4] - ldrb r2, [r0] - cmp r1, r2 - bcs _08129796 - ldr r5, [r0, 0x4] - ldrh r4, [r6] - adds r3, r2, 0 -_0812977E: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r2, r0, r5 - ldrh r0, [r2, 0x14] - cmp r0, r4 - beq _08129738 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r3 - bcc _0812977E -_08129796: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129708 - - thumb_func_start sub_81297AC -sub_81297AC: @ 81297AC - push {r4-r6,lr} - movs r2, 0 - ldr r0, =gMapHeader - ldr r0, [r0, 0x4] - ldrb r1, [r0] - cmp r2, r1 - bcs _081297F0 - adds r3, r0, 0 - ldr r5, [r3, 0x4] - ldr r0, =gSpecialVar_0x8004 - ldrh r4, [r0] - ldr r6, =gSpecialVar_0x8005 -_081297C4: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r5 - ldrh r0, [r1, 0x14] - cmp r0, r4 - bne _081297E4 - ldrb r0, [r1] - strh r0, [r6] - b _081297F0 - .pool -_081297E4: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - ldrb r0, [r3] - cmp r2, r0 - bcc _081297C4 -_081297F0: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81297AC - - thumb_func_start sub_81297F8 -sub_81297F8: @ 81297F8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r6, 0 - b _081298BE -_08129808: - ldr r3, =gUnknown_0203AA44 - lsls r5, r6, 3 - adds r4, r5, r3 - ldrb r1, [r4] - ldr r2, =gUnknown_0203A17C - ldr r0, [r2] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 5 - ldr r7, =gDecorations - adds r0, r7 - ldrb r2, [r0, 0x11] - ldr r7, =gUnknown_0203A17C - ldr r0, [r7, 0x4] - adds r0, r1 - ldrb r0, [r0] - lsrs r1, r0, 4 - mov r8, r1 - movs r7, 0xF - adds r1, r7, 0 - ands r1, r0 - str r1, [sp] - adds r7, r5, 0 - adds r6, 0x1 - str r6, [sp, 0x4] - cmp r2, 0x4 - beq _081298B8 - movs r6, 0 - ldrb r4, [r4, 0x2] - cmp r6, r4 - bcs _081298AE -_08129846: - movs r4, 0 - adds r0, r5, r3 - adds r2, r6, 0x1 - mov r10, r2 - ldrb r0, [r0, 0x1] - cmp r4, r0 - bcs _0812989C - ldr r3, =gUnknown_0203AA44 - adds r3, r7 - mov r9, r3 - subs r5, r6, 0x7 - str r5, [sp, 0x8] -_0812985E: - adds r0, r4, 0x7 - add r0, r8 - ldr r1, =gMapHeader - ldr r3, [r1] - ldr r1, [sp] - subs r2, r1, r6 - ldr r1, [r3] - muls r2, r1 - mov r5, r8 - adds r1, r5, r4 - adds r1, r2 - ldr r2, [r3, 0xC] - lsls r1, 1 - adds r1, r2 - ldrh r1, [r1] - movs r3, 0xC0 - lsls r3, 6 - adds r2, r3, 0 - orrs r2, r1 - ldr r5, [sp] - ldr r3, [sp, 0x8] - subs r1, r5, r3 - bl MapGridSetMetatileEntryAt - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - mov r5, r9 - ldrb r5, [r5, 0x1] - cmp r4, r5 - bcc _0812985E -_0812989C: - mov r1, r10 - lsls r0, r1, 24 - lsrs r6, r0, 24 - ldr r3, =gUnknown_0203AA44 - adds r5, r7, 0 - adds r0, r7, r3 - ldrb r0, [r0, 0x2] - cmp r6, r0 - bcc _08129846 -_081298AE: - ldr r2, =gUnknown_0203AA44 - adds r0, r7, r2 - ldrb r0, [r0] - bl sub_81296EC -_081298B8: - ldr r3, [sp, 0x4] - lsls r0, r3, 24 - lsrs r6, r0, 24 -_081298BE: - ldr r0, =gUnknown_0203AAC4 - ldrb r0, [r0] - cmp r6, r0 - bcc _08129808 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81297F8 - - thumb_func_start sub_81298EC -sub_81298EC: @ 81298EC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08129928 - cmp r0, 0x1 - bgt _08129914 - cmp r0, 0 - beq _0812991E - b _08129994 - .pool -_08129914: - cmp r0, 0x2 - beq _08129954 - cmp r0, 0x3 - beq _08129968 - b _08129994 -_0812991E: - bl sub_81297F8 - movs r0, 0x1 - strh r0, [r4, 0xC] - b _08129994 -_08129928: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08129994 - bl DrawWholeMapView - ldr r0, =gUnknown_08275D2E - bl ScriptContext1_SetupScript - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - movs r0, 0x2 - strh r0, [r4, 0xC] - b _08129994 - .pool -_08129954: - bl ScriptContext2_Enable - adds r0, r5, 0 - bl sub_8127814 - bl pal_fill_black - movs r0, 0x3 - strh r0, [r4, 0xC] - b _08129994 -_08129968: - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08129994 - ldr r4, =gStringVar4 - ldr r1, =gText_DecorationReturnedToPC - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_8129D64 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - ldr r0, =gMapHeader - ldrb r0, [r0, 0x14] - cmp r0, 0x56 - bne _08129994 - bl sub_80EE104 -_08129994: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81298EC - - thumb_func_start sub_81299AC -sub_81299AC: @ 81299AC - push {lr} - movs r1, 0 - ldr r0, =gUnknown_0203A17C - ldrb r2, [r0, 0x8] - cmp r1, r2 - bcs _081299D6 - ldr r3, [r0] -_081299BA: - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081299CC - movs r0, 0x1 - b _081299D8 - .pool -_081299CC: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r2 - bcc _081299BA -_081299D6: - movs r0, 0 -_081299D8: - pop {r1} - bx r1 - thumb_func_end sub_81299AC - - thumb_func_start SetUpPuttingAwayDecorationPlayerAvatar -SetUpPuttingAwayDecorationPlayerAvatar: @ 81299DC - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - bl player_get_direction_lower_nybble - ldr r3, =gUnknown_0203AA38 - ldr r2, =gSprites - ldr r4, =gUnknown_03005DD0 - ldr r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x2E] - strb r0, [r3] - bl sub_812A39C - ldr r0, =gUnknown_085A7404 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - str r0, [r4, 0x4] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _08129A3C - ldr r1, =SpriteCallbackDummy - str r0, [sp] - movs r0, 0xC1 - b _08129A44 - .pool -_08129A3C: - ldr r1, =SpriteCallbackDummy - movs r0, 0 - str r0, [sp] - movs r0, 0xC2 -_08129A44: - movs r2, 0x88 - movs r3, 0x48 - bl AddPseudoFieldObject - ldr r1, =gUnknown_0203AA39 - strb r0, [r1] - ldr r6, =gSprites - ldr r0, =gUnknown_0203AA39 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r2, [r1, 0x5] - movs r4, 0xD - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - movs r2, 0x4 - mov r8, r2 - mov r2, r8 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r5, =gUnknown_0203AA38 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl DestroySprite - ldr r0, =gUnknown_03005DD0 - ldr r0, [r0, 0x4] - strb r0, [r5] - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0, 0x5] - ands r4, r1 - mov r1, r8 - orrs r4, r1 - strb r4, [r0, 0x5] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end SetUpPuttingAwayDecorationPlayerAvatar - - thumb_func_start sub_8129ABC -sub_8129ABC: @ 8129ABC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08129B0C - cmp r0, 0x1 - bgt _08129AE4 - cmp r0, 0 - beq _08129AEA - b _08129B2E - .pool -_08129AE4: - cmp r0, 0x2 - beq _08129B1A - b _08129B2E -_08129AEA: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08129B2E - adds r0, r5, 0 - bl sub_8127ACC - movs r0, 0x1 - strh r0, [r4, 0x4] - strh r0, [r4, 0xC] - strh r0, [r4, 0xA] - b _08129B2E - .pool -_08129B0C: - bl SetUpPuttingAwayDecorationPlayerAvatar - bl pal_fill_black - movs r0, 0x2 - strh r0, [r4, 0x4] - b _08129B2E -_08129B1A: - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08129B2E - strh r0, [r4, 0x18] - adds r0, r5, 0 - bl sub_8129B34 -_08129B2E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8129ABC - - thumb_func_start sub_8129B34 -sub_8129B34: @ 8129B34 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - ldr r4, =gSprites - ldr r3, =gUnknown_0203AA38 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r6, 0 - strh r6, [r0, 0x3C] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_812A36C - str r1, [r0] - ldr r2, =gUnknown_0203AA39 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x88 - strh r1, [r0, 0x20] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x48 - strh r1, [r0, 0x22] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x1C] - ldr r1, =sub_8128E18 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129B34 - - thumb_func_start sub_8129BCC -sub_8129BCC: @ 8129BCC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x1C] - bl sub_8128DE0 - adds r0, r4, 0 - bl sub_8129C74 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129BCC - - thumb_func_start sub_8129BF8 -sub_8129BF8: @ 8129BF8 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x1C] - bl sub_8128DE0 - ldr r3, =gSprites - ldr r5, =gUnknown_0203AA38 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, 0x1C - adds r0, r3 - ldr r1, =SpriteCallbackDummy - str r1, [r0] - ldr r5, =gStringVar4 - ldr r1, =gText_StopPuttingAwayDecorations - adds r0, r5, 0 - bl StringExpandPlaceholders - ldr r2, =sub_812A1F0 - adds r0, r4, 0 - adds r1, r5, 0 - bl DisplayItemMessageOnField - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129BF8 - - thumb_func_start sub_8129C74 -sub_8129C74: @ 8129C74 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl sub_812A0E8 - ldr r0, =gUnknown_0203AAC4 - ldrb r0, [r0] - cmp r0, 0 - beq _08129CA8 - ldr r4, =gStringVar4 - ldr r1, =gText_ReturnDecorationToPC - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_812A1A0 - b _08129D14 - .pool -_08129CA8: - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r1, r0 - movs r2, 0 - ldrsh r0, [r1, r2] - movs r2, 0x2 - ldrsh r1, [r1, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsSecretBasePC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08129CDE - adds r0, r4, 0 - bl MetatileBehavior_IsMB_C5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08129D3C -_08129CDE: - ldr r3, =gSprites - ldr r4, =gUnknown_0203AA38 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, 0x1C - adds r0, r3 - ldr r1, =SpriteCallbackDummy - str r1, [r0] - ldr r4, =gStringVar4 - ldr r1, =gText_StopPuttingAwayDecorations - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_812A1F0 -_08129D14: - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _08129D50 - .pool -_08129D3C: - ldr r4, =gStringVar4 - ldr r1, =gText_NoDecorationHere - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_8129D64 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField -_08129D50: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129C74 - - thumb_func_start sub_8129D64 -sub_8129D64: @ 8129D64 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08129D7E - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08129D84 -_08129D7E: - adds r0, r2, 0 - bl sub_8129B34 -_08129D84: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129D64 - - thumb_func_start sub_8129D8C -sub_8129D8C: @ 8129D8C - push {lr} - adds r2, r1, 0 - lsls r0, 24 - ldr r1, =gDecorations - lsrs r0, 19 - adds r0, r1 - ldrb r1, [r0, 0x12] - cmp r1, 0 - bne _08129DA8 - movs r0, 0x1 - strb r0, [r2, 0x1] - b _08129E06 - .pool -_08129DA8: - cmp r1, 0x1 - bne _08129DB4 - movs r0, 0x2 - strb r0, [r2, 0x1] - strb r1, [r2, 0x2] - b _08129E08 -_08129DB4: - cmp r1, 0x2 - bne _08129DC0 - movs r0, 0x3 - strb r0, [r2, 0x1] - movs r0, 0x1 - b _08129E06 -_08129DC0: - cmp r1, 0x3 - bne _08129DC8 - movs r0, 0x4 - b _08129E02 -_08129DC8: - cmp r1, 0x4 - bne _08129DD2 - movs r0, 0x2 - strb r0, [r2, 0x1] - b _08129E06 -_08129DD2: - cmp r1, 0x5 - bne _08129DDA - movs r0, 0x1 - b _08129E02 -_08129DDA: - cmp r1, 0x6 - bne _08129DE6 - movs r0, 0x1 - strb r0, [r2, 0x1] - movs r0, 0x3 - b _08129E06 -_08129DE6: - cmp r1, 0x7 - bne _08129DF2 - movs r0, 0x2 - strb r0, [r2, 0x1] - movs r0, 0x4 - b _08129E06 -_08129DF2: - cmp r1, 0x8 - bne _08129DFC - movs r0, 0x3 - strb r0, [r2, 0x1] - b _08129E06 -_08129DFC: - cmp r1, 0x9 - bne _08129E08 - movs r0, 0x3 -_08129E02: - strb r0, [r2, 0x1] - movs r0, 0x2 -_08129E06: - strb r0, [r2, 0x2] -_08129E08: - pop {r0} - bx r0 - thumb_func_end sub_8129D8C - - thumb_func_start sub_8129E0C -sub_8129E0C: @ 8129E0C - push {r4-r6,lr} - lsls r0, 24 - lsls r1, 24 - ldr r5, =gSprites - ldr r6, =gUnknown_0203AA38 - ldrb r3, [r6] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r5 - adds r2, 0x3E - ldrb r3, [r2] - movs r4, 0x4 - orrs r3, r4 - strb r3, [r2] - ldrb r3, [r6] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r3, r5, 0 - adds r3, 0x1C - adds r2, r3 - ldr r3, =SpriteCallbackDummy - str r3, [r2] - ldr r4, =gUnknown_0203AA39 - ldrb r3, [r4] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r5 - lsrs r0, 20 - adds r0, 0x88 - strh r0, [r2, 0x20] - ldrb r2, [r4] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - lsrs r1, 20 - adds r1, 0x48 - strh r1, [r0, 0x22] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129E0C - - thumb_func_start sub_8129E74 -sub_8129E74: @ 8129E74 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r2 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gTasks - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r3 - ldrb r0, [r2, 0x8] - subs r0, 0x7 - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r2, 0xA] - subs r0, 0x7 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r2, =gUnknown_0203A17C - ldr r0, [r2, 0x4] - adds r0, r1 - ldrb r0, [r0] - lsrs r5, r0, 4 - movs r6, 0xF - ands r6, r0 - mov r0, r9 - ldrb r4, [r0, 0x2] - ldr r0, [r2] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x29 - bne _08129ED4 - adds r0, r5, 0x7 - adds r1, r6, 0x7 - bl MapGridGetMetatileIdAt - movs r1, 0xA3 - lsls r1, 2 - cmp r0, r1 - bne _08129ED4 - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_08129ED4: - cmp r7, r5 - bcc _08129F10 - mov r0, r9 - ldrb r2, [r0, 0x1] - adds r0, r5, r2 - cmp r7, r0 - bge _08129F10 - subs r0, r6, r4 - cmp r8, r0 - ble _08129F10 - cmp r8, r6 - bhi _08129F10 - subs r0, r7, r5 - adds r0, 0x1 - subs r0, r2, r0 - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - subs r1, r6, r2 - lsls r1, 24 - lsrs r1, 24 - bl sub_8129E0C - movs r0, 0x1 - b _08129F12 - .pool -_08129F10: - movs r0, 0 -_08129F12: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8129E74 - - thumb_func_start sub_8129F20 -sub_8129F20: @ 8129F20 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r2, =gUnknown_0203A17C - ldr r3, =gUnknown_0203AA44 - ldr r0, =gUnknown_0203AAC4 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r3 - ldrb r1, [r0] - ldr r0, [r2, 0x4] - adds r0, r1 - ldrb r0, [r0] - lsrs r1, r0, 4 - mov r8, r1 - movs r6, 0xF - ands r6, r0 - movs r4, 0 - ldr r7, =gSaveBlock1Ptr - mov r9, r3 -_08129F4A: - ldr r1, [r7] - lsls r0, r4, 1 - adds r0, r4 - lsls r5, r0, 3 - adds r1, r5 - ldr r2, =0x00000c74 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, r8 - bne _08129FB0 - ldr r2, =0x00000c76 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, r6 - bne _08129FB0 - ldr r2, =0x00000c84 - adds r0, r1, r2 - ldrh r0, [r0] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08129FB0 - ldr r0, =gUnknown_0203AAC4 - ldrb r1, [r0] - lsls r1, 3 - add r1, r9 - ldr r0, [r7] - adds r0, r5 - ldr r2, =0x00000c84 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1, 0x4] - b _08129FBA - .pool -_08129FB0: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3F - bls _08129F4A -_08129FBA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8129F20 - - thumb_func_start sub_8129FC8 -sub_8129FC8: @ 8129FC8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - movs r6, 0 - b _0812A02A -_08129FD2: - ldr r0, [r0] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0 - beq _0812A024 - ldr r0, =gDecorations - ldrb r2, [r1] - lsls r1, r2, 5 - adds r1, r0 - ldrb r0, [r1, 0x11] - cmp r0, 0x4 - bne _0812A024 - ldr r5, =gUnknown_0203AA44 - adds r0, r2, 0 - adds r1, r5, 0 - bl sub_8129D8C - lsls r1, r6, 24 - lsrs r1, 24 - adds r0, r7, 0 - adds r2, r5, 0 - bl sub_8129E74 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _0812A024 - strb r6, [r5] - bl sub_8129F20 - ldr r0, =gUnknown_0203AAC4 - strb r4, [r0] - movs r0, 0x1 - b _0812A034 - .pool -_0812A024: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_0812A02A: - ldr r0, =gUnknown_0203A17C - ldrb r1, [r0, 0x8] - cmp r6, r1 - bcc _08129FD2 - movs r0, 0 -_0812A034: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8129FC8 - - thumb_func_start sub_812A040 -sub_812A040: @ 812A040 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - movs r4, 0 - ldr r7, =gUnknown_0203A17C - ldrb r0, [r7, 0x8] - cmp r4, r0 - bcs _0812A0C6 - adds r6, r7, 0 - ldr r5, =gUnknown_0203AAC4 -_0812A072: - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - ldr r0, [r6, 0x4] - adds r0, r4 - ldrb r0, [r0] - lsrs r3, r0, 4 - movs r2, 0xF - ands r2, r0 - cmp r1, 0 - beq _0812A0BA - ldr r0, =gDecorations - lsls r1, 5 - adds r1, r0 - ldrb r0, [r1, 0x11] - cmp r0, 0x4 - bne _0812A0BA - ldr r0, [sp] - cmp r0, r3 - bhi _0812A0BA - cmp r10, r2 - bhi _0812A0BA - cmp r9, r3 - bcc _0812A0BA - cmp r8, r2 - bcc _0812A0BA - ldr r0, =gUnknown_0203AA44 - ldrb r1, [r5] - lsls r1, 3 - adds r1, r0 - strb r4, [r1] - bl sub_8129F20 - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] -_0812A0BA: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r7, 0x8] - cmp r4, r0 - bcc _0812A072 -_0812A0C6: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A040 - - thumb_func_start sub_812A0E8 -sub_812A0E8: @ 812A0E8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =gUnknown_0203AAC4 - movs r0, 0 - strb r0, [r4] - adds r0, r6, 0 - bl sub_8129FC8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0812A18C - movs r5, 0 - ldr r0, =gUnknown_0203A17C - ldrb r1, [r0, 0x8] - cmp r5, r1 - bcs _0812A15A - adds r7, r4, 0 -_0812A10E: - ldr r0, [r0] - adds r0, r5 - ldrb r1, [r0] - cmp r1, 0 - beq _0812A14C - ldr r4, =gUnknown_0203AA44 - adds r0, r1, 0 - adds r1, r4, 0 - bl sub_8129D8C - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_8129E74 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0812A14C - strb r5, [r4] - ldrb r0, [r7] - adds r0, 0x1 - strb r0, [r7] - b _0812A15A - .pool -_0812A14C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_0203A17C - ldrb r1, [r0, 0x8] - cmp r5, r1 - bcc _0812A10E -_0812A15A: - ldr r0, =gUnknown_0203AAC4 - ldrb r0, [r0] - cmp r0, 0 - beq _0812A18C - ldr r0, =gUnknown_0203A17C - ldr r2, =gUnknown_0203AA44 - ldrb r1, [r2] - ldr r0, [r0, 0x4] - adds r0, r1 - ldrb r1, [r0] - lsrs r0, r1, 4 - movs r3, 0xF - ands r3, r1 - ldrb r1, [r2, 0x2] - subs r1, r3, r1 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r2, 0x1] - adds r2, r0 - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - bl sub_812A040 -_0812A18C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A0E8 - - thumb_func_start sub_812A1A0 -sub_812A1A0: @ 812A1A0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_085A7348 - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A1A0 - - thumb_func_start sub_812A1C0 -sub_812A1C0: @ 812A1C0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - ldr r1, =sub_81298EC - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A1C0 - - thumb_func_start sub_812A1F0 -sub_812A1F0: @ 812A1F0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_085A7350 - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A1F0 - - thumb_func_start sub_812A210 -sub_812A210: @ 812A210 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - adds r0, r4, 0 - bl sub_812A22C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812A210 - - thumb_func_start sub_812A22C -sub_812A22C: @ 812A22C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - ldr r1, =sub_812A25C - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A22C - - thumb_func_start sub_812A25C -sub_812A25C: @ 812A25C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0xC - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _0812A280 - cmp r0, 0x1 - beq _0812A29C - b _0812A2B2 - .pool -_0812A280: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812A2B2 - adds r0, r4, 0 - bl sub_8127B04 - movs r0, 0x1 - strh r0, [r5, 0xC] - b _0812A2B2 - .pool -_0812A29C: - bl sub_812A3C8 - ldr r0, =gFieldCallback - ldr r1, =sub_812A334 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_0812A2B2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A25C - - thumb_func_start sub_812A2C4 -sub_812A2C4: @ 812A2C4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r5, r1, 3 - ldr r6, =gTasks + 0x8 - adds r4, r5, r6 - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0812A2FC - cmp r0, 0x1 - bgt _0812A2EC - cmp r0, 0 - beq _0812A2F6 - b _0812A32A - .pool -_0812A2EC: - cmp r0, 0x2 - beq _0812A308 - cmp r0, 0x3 - beq _0812A314 - b _0812A32A -_0812A2F6: - bl sub_80E9578 - b _0812A30C -_0812A2FC: - ldr r0, =gUnknown_08275D0C - bl ScriptContext1_SetupScript - b _0812A30C - .pool -_0812A308: - bl ScriptContext2_Enable -_0812A30C: - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] - b _0812A32A -_0812A314: - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0812A32A - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =sub_8126B80 - str r1, [r0] -_0812A32A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A2C4 - - thumb_func_start sub_812A334 -sub_812A334: @ 812A334 - push {lr} - bl pal_fill_black - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 - bl sub_8126ABC - ldr r0, =sub_812A2C4 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0xC] - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A334 - - thumb_func_start sub_812A36C -sub_812A36C: @ 812A36C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - strh r0, [r2, 0x2E] - cmp r0, 0xF - ble _0812A38C - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _0812A398 -_0812A38C: - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0812A398: - pop {r0} - bx r0 - thumb_func_end sub_812A36C - - thumb_func_start sub_812A39C -sub_812A39C: @ 812A39C - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _0812A3B8 - ldr r0, =gUnknown_085A73D8 - bl LoadSpritePalette - b _0812A3BE - .pool -_0812A3B8: - ldr r0, =gUnknown_085A73E0 - bl LoadSpritePalette -_0812A3BE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A39C - - thumb_func_start sub_812A3C8 -sub_812A3C8: @ 812A3C8 - push {lr} - movs r0, 0x8 - bl FreeSpritePaletteByTag - pop {r0} - bx r0 - thumb_func_end sub_812A3C8 - - thumb_func_start sub_812A3D4 -sub_812A3D4: @ 812A3D4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81279C4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0812A430 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_0203A172 - ldrb r2, [r1] - ldr r1, =gUnknown_0203A14C - ldr r1, [r1] - adds r1, r2 - ldrb r1, [r1] - lsls r1, 5 - ldr r2, =gDecorations + 1 - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gText_DecorationWillBeDiscarded - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_812A458 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _0812A444 - .pool -_0812A430: - ldr r4, =gStringVar4 - ldr r1, =gText_CantThrowAwayInUse - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_8127A5C - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField -_0812A444: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A3D4 - - thumb_func_start sub_812A458 -sub_812A458: @ 812A458 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_085A741C - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A458 - - thumb_func_start sub_812A478 -sub_812A478: @ 812A478 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203A172 - ldrb r1, [r0] - ldr r0, =gUnknown_0203A14C - ldr r0, [r0] - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r5, =gUnknown_0203A173 - ldrb r0, [r5] - bl sub_8161AD0 - ldr r1, =gUnknown_0203A151 - strb r0, [r1] - ldrb r0, [r5] - bl sub_8161A38 - adds r0, r4, 0 - bl sub_8127814 - ldr r5, =gStringVar4 - ldr r1, =gText_DecorationThrownAway - adds r0, r5, 0 - bl StringExpandPlaceholders - ldr r2, =sub_8127A5C - adds r0, r4, 0 - adds r1, r5, 0 - bl DisplayItemMessageOnField - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A478 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/decoration_inventory.s b/asm/decoration_inventory.s deleted file mode 100644 index 7a909f585..000000000 --- a/asm/decoration_inventory.s +++ /dev/null @@ -1,459 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start SetDecorationInventoriesPointers -SetDecorationInventoriesPointers: @ 81617F4 - push {r4,lr} - ldr r0, =gDecorationInventories - mov r12, r0 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r2, =0x00002734 - adds r0, r1, r2 - mov r4, r12 - str r0, [r4] - movs r3, 0xA - strb r3, [r4, 0x4] - adds r2, 0xA - adds r0, r1, r2 - str r0, [r4, 0x8] - strb r3, [r4, 0xC] - ldr r4, =0x00002748 - adds r0, r1, r4 - mov r2, r12 - str r0, [r2, 0x10] - strb r3, [r2, 0x14] - adds r4, 0xA - adds r0, r1, r4 - str r0, [r2, 0x18] - movs r2, 0x1E - mov r0, r12 - strb r2, [r0, 0x1C] - adds r4, 0x1E - adds r0, r1, r4 - mov r4, r12 - str r0, [r4, 0x20] - mov r0, r12 - adds r0, 0x24 - strb r2, [r0] - ldr r2, =0x0000278e - adds r0, r1, r2 - str r0, [r4, 0x28] - mov r0, r12 - adds r0, 0x2C - strb r3, [r0] - ldr r4, =0x00002798 - adds r0, r1, r4 - mov r2, r12 - str r0, [r2, 0x30] - adds r2, 0x34 - movs r0, 0x28 - strb r0, [r2] - adds r4, 0x28 - adds r1, r4 - mov r0, r12 - str r1, [r0, 0x38] - adds r0, 0x3C - strb r3, [r0] - bl sub_8126968 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end SetDecorationInventoriesPointers - - thumb_func_start ClearDecorationInventory -ClearDecorationInventory: @ 8161880 - push {r4,r5,lr} - lsls r0, 24 - movs r3, 0 - ldr r1, =gDecorationInventories - lsrs r2, r0, 21 - adds r0, r2, r1 - ldrb r0, [r0, 0x4] - cmp r3, r0 - bcs _081618AA - adds r5, r1, 0 - movs r4, 0 -_08161896: - adds r0, r2, r5 - ldr r1, [r0] - adds r1, r3 - strb r4, [r1] - adds r1, r3, 0x1 - lsls r1, 24 - lsrs r3, r1, 24 - ldrb r0, [r0, 0x4] - cmp r3, r0 - bcc _08161896 -_081618AA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ClearDecorationInventory - - thumb_func_start ClearDecorationInventories -ClearDecorationInventories: @ 81618B4 - push {r4,lr} - movs r4, 0 -_081618B8: - adds r0, r4, 0 - bl ClearDecorationInventory - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081618B8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end ClearDecorationInventories - - thumb_func_start sub_81618D0 -sub_81618D0: @ 81618D0 - push {r4,lr} - lsls r0, 24 - movs r2, 0 - ldr r1, =gDecorationInventories - lsrs r0, 21 - adds r0, r1 - movs r1, 0x4 - ldrsb r1, [r0, r1] - cmp r2, r1 - bge _0816190C - adds r4, r0, 0 - adds r3, r1, 0 -_081618E8: - lsls r0, r2, 24 - asrs r1, r0, 24 - ldr r0, [r4] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08161900 - adds r0, r1, 0 - b _08161910 - .pool -_08161900: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, r3 - blt _081618E8 -_0816190C: - movs r0, 0x1 - negs r0, r0 -_08161910: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81618D0 - - thumb_func_start CheckHasDecoration -CheckHasDecoration: @ 8161918 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =gDecorations - lsls r0, r3, 5 - adds r0, r1 - ldrb r0, [r0, 0x13] - movs r2, 0 - ldr r1, =gDecorationInventories - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x4] - cmp r2, r1 - bcs _08161956 - ldr r4, [r0] -_08161936: - adds r0, r4, r2 - ldrb r0, [r0] - cmp r0, r3 - bne _0816194C - movs r0, 0x1 - b _08161958 - .pool -_0816194C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r1 - bcc _08161936 -_08161956: - movs r0, 0 -_08161958: - pop {r4} - pop {r1} - bx r1 - thumb_func_end CheckHasDecoration - - thumb_func_start DecorationAdd -DecorationAdd: @ 8161960 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - cmp r4, 0 - beq _081619A0 - ldr r1, =gDecorations - lsls r0, r4, 5 - adds r0, r1 - ldrb r5, [r0, 0x13] - adds r0, r5, 0 - bl sub_81618D0 - lsls r0, 24 - asrs r2, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - beq _081619A0 - ldr r0, =gDecorationInventories - lsls r1, r5, 3 - adds r1, r0 - ldr r0, [r1] - adds r0, r2 - strb r4, [r0] - movs r0, 0x1 - b _081619A2 - .pool -_081619A0: - movs r0, 0 -_081619A2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end DecorationAdd - - thumb_func_start DecorationCheckSpace -DecorationCheckSpace: @ 81619A8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081619D4 - ldr r1, =gDecorations - lsls r0, 5 - adds r0, r1 - ldrb r0, [r0, 0x13] - bl sub_81618D0 - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _081619D4 - movs r0, 0x1 - b _081619D6 - .pool -_081619D4: - movs r0, 0 -_081619D6: - pop {r1} - bx r1 - thumb_func_end DecorationCheckSpace - - thumb_func_start DecorationRemove -DecorationRemove: @ 81619DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - cmp r5, 0 - bne _081619F8 - b _08161A26 -_081619EA: - movs r0, 0 - strb r0, [r1] - adds r0, r6, 0 - bl sub_8161A38 - movs r0, 0x1 - b _08161A28 -_081619F8: - ldr r2, =gDecorationInventories - ldr r1, =gDecorations - lsls r0, r5, 5 - adds r0, r1 - ldrb r4, [r0, 0x13] - lsls r0, r4, 3 - adds r0, r2 - ldrb r1, [r0, 0x4] - cmp r3, r1 - bcs _08161A26 - adds r6, r4, 0 - adds r4, r0, 0 - adds r2, r1, 0 -_08161A12: - ldr r0, [r4] - adds r1, r0, r3 - ldrb r0, [r1] - cmp r0, r5 - beq _081619EA - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r2 - bcc _08161A12 -_08161A26: - movs r0, 0 -_08161A28: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end DecorationRemove - - thumb_func_start sub_8161A38 -sub_8161A38: @ 8161A38 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - movs r6, 0 - ldr r2, =gDecorationInventories - lsrs r0, 21 - adds r1, r0, r2 - ldrb r3, [r1, 0x4] - cmp r6, r3 - bcs _08161ABC - adds r7, r0, 0 - mov r10, r1 - mov r0, r10 - str r0, [sp] -_08161A5C: - adds r1, r6, 0x1 - lsls r0, r1, 24 - lsrs r3, r0, 24 - adds r2, r7, 0 - mov r12, r1 - mov r1, r10 - ldrb r1, [r1, 0x4] - cmp r3, r1 - bcs _08161AAE - ldr r0, =gDecorationInventories - mov r9, r0 - adds r1, r0, 0 - mov r8, r1 -_08161A76: - mov r0, r9 - adds r5, r2, r0 - ldr r1, [r5] - adds r0, r1, r3 - ldrb r4, [r0] - adds r2, r4, 0 - cmp r2, 0 - beq _08161A9C - adds r0, r1, r6 - ldrb r1, [r0] - cmp r1, 0 - beq _08161A92 - cmp r1, r2 - bls _08161A9C -_08161A92: - ldrb r1, [r0] - strb r4, [r0] - ldr r0, [r5] - adds r0, r3 - strb r1, [r0] -_08161A9C: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r2, r7, 0 - mov r1, r8 - adds r0, r2, r1 - ldrb r0, [r0, 0x4] - cmp r3, r0 - bcc _08161A76 -_08161AAE: - mov r3, r12 - lsls r0, r3, 24 - lsrs r6, r0, 24 - ldr r0, [sp] - ldrb r0, [r0, 0x4] - cmp r6, r0 - bcc _08161A5C -_08161ABC: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161A38 - - thumb_func_start sub_8161AD0 -sub_8161AD0: @ 8161AD0 - push {r4,r5,lr} - lsls r0, 24 - movs r4, 0 - movs r3, 0 - ldr r2, =gDecorationInventories - lsrs r1, r0, 21 - adds r0, r1, r2 - ldrb r0, [r0, 0x4] - cmp r4, r0 - bcs _08161B04 - adds r5, r2, 0 -_08161AE6: - adds r2, r1, r5 - ldr r0, [r2] - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - beq _08161AF8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_08161AF8: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r2, [r2, 0x4] - cmp r3, r2 - bcc _08161AE6 -_08161B04: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8161AD0 - - thumb_func_start sub_8161B10 -sub_8161B10: @ 8161B10 - push {r4,r5,lr} - movs r5, 0 - movs r4, 0 -_08161B16: - adds r0, r4, 0 - bl sub_8161AD0 - adds r0, r5, r0 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _08161B16 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8161B10 - - .align 2, 0 @ Don't pad with nop. - \ No newline at end of file diff --git a/asm/pokemon_summary_screen.s b/asm/pokemon_summary_screen.s index 50018de9c..03f6b11d1 100755 --- a/asm/pokemon_summary_screen.s +++ b/asm/pokemon_summary_screen.s @@ -5,7832 +5,6 @@ .text - thumb_func_start sub_81BF8EC -sub_81BF8EC: @ 81BF8EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - adds r5, r2, 0 - adds r6, r3, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r4, =gUnknown_0203CF1C - ldr r0, =0x000040f8 - bl AllocZeroed - str r0, [r4] - ldr r1, =0x000040bc - adds r0, r1 - strb r7, [r0] - ldr r0, [r4] - mov r2, r8 - str r2, [r0] - adds r1, 0x2 - adds r0, r1 - strb r5, [r0] - ldr r0, [r4] - ldr r2, =0x000040bf - adds r0, r2 - strb r6, [r0] - ldr r1, [r4] - ldr r0, [sp, 0x18] - str r0, [r1, 0x4] - cmp r7, 0x2 - bne _081BF94C - subs r2, 0x2 - adds r1, r2 - movs r0, 0x1 - b _081BF952 - .pool -_081BF94C: - ldr r0, =0x000040bd - adds r1, r0 - movs r0, 0 -_081BF952: - strb r0, [r1] - cmp r7, 0x1 - beq _081BF9A0 - cmp r7, 0x1 - bgt _081BF96C - cmp r7, 0 - beq _081BF97C - ldr r2, =gUnknown_0203CF1C - b _081BF9EE - .pool -_081BF96C: - cmp r7, 0x2 - beq _081BF97C - cmp r7, 0x3 - beq _081BF9D0 - ldr r2, =gUnknown_0203CF1C - b _081BF9EE - .pool -_081BF97C: - ldr r2, =gUnknown_0203CF1C - ldr r0, [r2] - ldr r1, =0x000040c1 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000040c2 - adds r0, r1 - movs r1, 0x3 - b _081BF9EC - .pool -_081BF9A0: - ldr r2, =gUnknown_0203CF1C - ldr r0, [r2] - ldr r1, =0x000040c1 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000040c2 - adds r0, r1 - movs r1, 0x3 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000040c8 - adds r0, r1 - strb r7, [r0] - b _081BF9EE - .pool -_081BF9D0: - ldr r2, =gUnknown_0203CF1C - ldr r0, [r2] - ldr r1, =0x000040c1 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000040c2 - adds r0, r1 - strb r7, [r0] - ldr r0, [r2] - adds r1, 0x1 - adds r0, r1 - movs r1, 0x1 -_081BF9EC: - strb r1, [r0] -_081BF9EE: - ldr r0, [r2] - ldr r2, =0x000040c1 - adds r1, r0, r2 - ldrb r1, [r1] - subs r2, 0x1 - adds r0, r2 - strb r1, [r0] - movs r0, 0xFF - bl sub_81C488C - ldr r0, =gMonSpritesGfxPtr - ldr r0, [r0] - cmp r0, 0 - bne _081BFA12 - movs r0, 0 - movs r1, 0 - bl sub_806F2AC -_081BFA12: - ldr r0, =sub_81BFAE4 - bl SetMainCallback2 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BF8EC - - thumb_func_start sub_81BFA38 -sub_81BFA38: @ 81BFA38 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - mov r8, r0 - adds r4, r1, 0 - adds r5, r2, 0 - ldr r6, [sp, 0x18] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 16 - lsrs r6, 16 - str r3, [sp] - movs r0, 0x3 - mov r1, r8 - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_81BF8EC - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - strh r6, [r0] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BFA38 - - thumb_func_start sub_81BFA80 -sub_81BFA80: @ 81BFA80 - push {r4,lr} - sub sp, 0x4 - ldr r4, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r4, [sp] - bl sub_81BF8EC - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040ef - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BFA80 - - thumb_func_start sub_81BFAB4 -sub_81BFAB4: @ 81BFAB4 - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_81BFAB4 - - thumb_func_start sub_81BFAD0 -sub_81BFAD0: @ 81BFAD0 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_81BFAD0 - - thumb_func_start sub_81BFAE4 -sub_81BFAE4: @ 81BFAE4 - push {lr} -_081BFAE6: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081BFB0A - bl sub_81BFB10 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081BFB0A - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081BFAE6 -_081BFB0A: - pop {r0} - bx r0 - thumb_func_end sub_81BFAE4 - - thumb_func_start sub_81BFB10 -sub_81BFB10: @ 81BFB10 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x18 - bls _081BFB24 - b _081BFE00 -_081BFB24: - lsls r0, 2 - ldr r1, =_081BFB38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BFB38: - .4byte _081BFB9C - .4byte _081BFBAA - .4byte _081BFBBC - .4byte _081BFBD0 - .4byte _081BFBE4 - .4byte _081BFBEA - .4byte _081BFC04 - .4byte _081BFC20 - .4byte _081BFC26 - .4byte _081BFC38 - .4byte _081BFC58 - .4byte _081BFC7C - .4byte _081BFC82 - .4byte _081BFC94 - .4byte _081BFCAC - .4byte _081BFCC0 - .4byte _081BFCD8 - .4byte _081BFCF8 - .4byte _081BFD34 - .4byte _081BFD50 - .4byte _081BFD60 - .4byte _081BFD74 - .4byte _081BFD7A - .4byte _081BFDB0 - .4byte _081BFDCC -_081BFB9C: - bl SetVBlankHBlankCallbacksToNull - bl sub_8121DA0 - bl clear_scheduled_bg_copies_to_vram - b _081BFDE6 -_081BFBAA: - bl remove_some_task - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFBBC: - bl ResetPaletteFade - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - b _081BFDE4 - .pool -_081BFBD0: - bl ResetSpriteData - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFBE4: - bl FreeAllSpritePalettes - b _081BFDE6 -_081BFBEA: - bl sub_81BFE24 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081BFDE6 - .pool -_081BFC04: - bl sub_81BFEB0 - lsls r0, 24 - cmp r0, 0 - bne _081BFC10 - b _081BFE18 -_081BFC10: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFC20: - bl sub_81C2554 - b _081BFDE6 -_081BFC26: - bl sub_81C1BA0 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFC38: - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0xC - bl sub_81C0098 - ldr r0, [r4] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081BFDE6 - .pool -_081BFC58: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C00F0 - lsls r0, 24 - cmp r0, 0 - bne _081BFC6A - b _081BFE18 -_081BFC6A: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFC7C: - bl sub_81C25E8 - b _081BFDE6 -_081BFC82: - bl sub_81C286C - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFC94: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C2D9C - b _081BFDE6 - .pool -_081BFCAC: - bl sub_81C0348 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFCC0: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C2AFC - b _081BFDE6 - .pool -_081BFCD8: - bl sub_81C4190 - bl sub_81C42C8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081BFDE6 - .pool -_081BFCF8: - ldr r4, =gUnknown_0203CF1C - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0xC - ldr r2, =0x000040f0 - adds r1, r2 - bl sub_81C45F4 - ldr r1, [r4] - ldr r2, =0x000040d3 - adds r1, r2 - strb r0, [r1] - ldr r1, [r4] - adds r2, r1, r2 - ldrb r0, [r2] - cmp r0, 0xFF - bne _081BFD1C - b _081BFE18 -_081BFD1C: - ldr r0, =0x000040f0 - adds r1, r0 - movs r0, 0 - strh r0, [r1] - b _081BFDE6 - .pool -_081BFD34: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C4984 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFD50: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C4A08 - b _081BFDE6 - .pool -_081BFD60: - bl sub_81C4A88 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFD74: - bl sub_81C4280 - b _081BFDE6 -_081BFD7A: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - beq _081BFDA0 - ldr r0, =sub_81C0510 - movs r1, 0 - bl CreateTask - b _081BFDE6 - .pool -_081BFDA0: - ldr r0, =sub_81C171C - movs r1, 0 - bl CreateTask - b _081BFDE6 - .pool -_081BFDB0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFDCC: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r2, =gPaletteFade - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 -_081BFDE4: - strb r0, [r2, 0x8] -_081BFDE6: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_081BFDEE: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081BFE18 - .pool -_081BFE00: - ldr r0, =sub_81BFAD0 - bl SetVBlankCallback - ldr r0, =sub_81BFAB4 - bl SetMainCallback2 - movs r0, 0x1 - b _081BFE1A - .pool -_081BFE18: - movs r0, 0 -_081BFE1A: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81BFB10 - - thumb_func_start sub_81BFE24 -sub_81BFE24: @ 81BFE24 - push {r4,lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0861CBB4 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r4, =gUnknown_0203CF1C - ldr r1, [r4] - ldr r0, =0x000020bc - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x000010bc - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - adds r1, 0xBC - movs r0, 0x3 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BFE24 - - thumb_func_start sub_81BFEB0 -sub_81BFEB0: @ 81BFEB0 - push {r4,lr} - sub sp, 0x4 - ldr r1, =gUnknown_0203CF1C - ldr r0, [r1] - ldr r2, =0x000040f0 - adds r0, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - adds r4, r1, 0 - cmp r0, 0xC - bls _081BFEC8 - b _081C008C -_081BFEC8: - lsls r0, 2 - ldr r1, =_081BFEE0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BFEE0: - .4byte _081BFF14 - .4byte _081BFF30 - .4byte _081BFF60 - .4byte _081BFF78 - .4byte _081BFF90 - .4byte _081BFFA8 - .4byte _081BFFC0 - .4byte _081BFFF0 - .4byte _081BFFFC - .4byte _081C0018 - .4byte _081C0024 - .4byte _081C0040 - .4byte _081C0064 -_081BFF14: - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08D97D0C - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _081C0046 - .pool -_081BFF30: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081BFF3E - b _081C008C -_081BFF3E: - ldr r0, =gUnknown_08D9862C - ldr r4, =gUnknown_0203CF1C - ldr r1, [r4] - adds r1, 0xBC - bl LZDecompressWram - ldr r1, [r4] - ldr r2, =0x000040f0 - adds r1, r2 - b _081C004E - .pool -_081BFF60: - ldr r0, =gUnknown_08D98CC8 - ldr r1, [r4] - ldr r2, =0x000008bc - adds r1, r2 - bl LZDecompressWram - ldr r1, [r4] - b _081C004A - .pool -_081BFF78: - ldr r0, =gUnknown_08D987FC - ldr r1, [r4] - ldr r2, =0x000018bc - adds r1, r2 - bl LZDecompressWram - ldr r1, [r4] - b _081C004A - .pool -_081BFF90: - ldr r0, =gUnknown_08D9898C - ldr r1, [r4] - ldr r2, =0x000028bc - adds r1, r2 - bl LZDecompressWram - ldr r1, [r4] - b _081C004A - .pool -_081BFFA8: - ldr r0, =gUnknown_08D98B28 - ldr r1, [r4] - ldr r2, =0x000038bc - adds r1, r2 - bl LZDecompressWram - ldr r1, [r4] - b _081C004A - .pool -_081BFFC0: - ldr r0, =gUnknown_08D9853C - movs r2, 0x80 - lsls r2, 1 - movs r1, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85620 - movs r1, 0x81 - movs r2, 0x1E - bl LoadPalette - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040f0 - adds r1, r2 - b _081C004E - .pool -_081BFFF0: - ldr r0, =gUnknown_0861CFBC - bl LoadCompressedObjectPic - b _081C0046 - .pool -_081BFFFC: - ldr r0, =gUnknown_0861D074 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040f0 - adds r1, r2 - b _081C004E - .pool -_081C0018: - ldr r0, =gUnknown_0861D0F8 - bl LoadCompressedObjectPic - b _081C0046 - .pool -_081C0024: - ldr r0, =gUnknown_0861D100 - bl LoadCompressedObjectPalette - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040f0 - adds r1, r2 - b _081C004E - .pool -_081C0040: - ldr r0, =gUnknown_0861D07C - bl LoadCompressedObjectPalette -_081C0046: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] -_081C004A: - ldr r0, =0x000040f0 - adds r1, r0 -_081C004E: - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081C008C - .pool -_081C0064: - ldr r0, =gUnknown_08D97B84 - movs r1, 0xE8 - lsls r1, 1 - movs r2, 0x60 - bl LoadCompressedPalette - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - movs r0, 0x1 - b _081C008E - .pool -_081C008C: - movs r0, 0 -_081C008E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81BFEB0 - - thumb_func_start sub_81C0098 -sub_81C0098: @ 81C0098 - push {r4,lr} - adds r3, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bd - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _081C00D0 - ldr r2, [r1] - ldr r4, =0x000040be - adds r0, r1, r4 - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - adds r1, r2 - adds r0, r3, 0 - movs r2, 0x64 - bl memcpy - b _081C00E6 - .pool -_081C00D0: - ldr r0, [r1] - ldr r2, =0x000040be - adds r1, r2 - ldrb r2, [r1] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 4 - adds r0, r1 - adds r1, r3, 0 - bl sub_8069004 -_081C00E6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0098 - - thumb_func_start sub_81C00F0 -sub_81C00F0: @ 81C00F0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r7, [r0] - adds r6, r7, 0 - adds r6, 0x70 - ldr r1, =0x000040f0 - adds r0, r7, r1 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0x1 - beq _081C0198 - cmp r0, 0x1 - bgt _081C0120 - cmp r0, 0 - beq _081C012C - b _081C0314 - .pool -_081C0120: - cmp r0, 0x2 - beq _081C01DC - cmp r0, 0x3 - bne _081C012A - b _081C02A8 -_081C012A: - b _081C0314 -_081C012C: - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - strh r0, [r6] - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - strh r0, [r6, 0x2] - adds r0, r5, 0 - movs r1, 0x19 - bl GetMonData - str r0, [r6, 0x10] - adds r0, r5, 0 - movs r1, 0x38 - bl GetMonData - strb r0, [r6, 0x5] - adds r0, r5, 0 - movs r1, 0x2E - bl GetMonData - strb r0, [r6, 0x8] - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - strh r0, [r6, 0x2E] - adds r0, r5, 0 - movs r1, 0 - bl GetMonData - str r0, [r6, 0xC] - adds r0, r5, 0 - movs r1, 0x4 - bl GetMonData - adds r1, r7, 0 - adds r1, 0xA5 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - beq _081C018C - movs r0, 0x1 - strb r0, [r6, 0x4] - b _081C0322 -_081C018C: - adds r0, r5, 0 - movs r1, 0x2D - bl GetMonData - strb r0, [r6, 0x4] - b _081C0322 -_081C0198: - movs r4, 0 - movs r0, 0x8C - adds r0, r7 - mov r8, r0 - movs r1, 0xA4 - adds r1, r7 - mov r9, r1 - adds r6, r7, 0 - adds r6, 0x84 -_081C01AA: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, 0 - bl GetMonData - strh r0, [r6] - adds r1, r4, 0 - adds r1, 0x11 - adds r0, r5, 0 - bl GetMonData - mov r2, r8 - adds r1, r2, r4 - strb r0, [r1] - adds r6, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - bls _081C01AA - adds r0, r5, 0 - movs r1, 0x15 - bl GetMonData - mov r1, r9 - strb r0, [r1] - b _081C0322 -_081C01DC: - ldr r1, [r7] - ldr r0, =gPlayerParty - cmp r1, r0 - beq _081C01F8 - ldr r2, =0x000040bc - adds r0, r7, r2 - ldrb r0, [r0] - cmp r0, 0x2 - beq _081C01F8 - ldr r1, =0x000040ef - adds r0, r7, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C0254 -_081C01F8: - adds r0, r5, 0 - bl GetNature - adds r1, r6, 0 - adds r1, 0x33 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - strh r0, [r6, 0x20] - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - strh r0, [r6, 0x22] - adds r0, r5, 0 - movs r1, 0x3B - bl GetMonData - strh r0, [r6, 0x24] - adds r0, r5, 0 - movs r1, 0x3C - bl GetMonData - strh r0, [r6, 0x26] - adds r0, r5, 0 - movs r1, 0x3E - bl GetMonData - strh r0, [r6, 0x28] - adds r0, r5, 0 - movs r1, 0x3F - bl GetMonData - strh r0, [r6, 0x2A] - adds r0, r5, 0 - movs r1, 0x3D - b _081C02A0 - .pool -_081C0254: - adds r0, r5, 0 - bl GetNature - adds r1, r7, 0 - adds r1, 0xA3 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - strh r0, [r6, 0x20] - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - strh r0, [r6, 0x22] - adds r0, r5, 0 - movs r1, 0x54 - bl GetMonData - strh r0, [r6, 0x24] - adds r0, r5, 0 - movs r1, 0x55 - bl GetMonData - strh r0, [r6, 0x26] - adds r0, r5, 0 - movs r1, 0x57 - bl GetMonData - strh r0, [r6, 0x28] - adds r0, r5, 0 - movs r1, 0x58 - bl GetMonData - strh r0, [r6, 0x2A] - adds r0, r5, 0 - movs r1, 0x56 -_081C02A0: - bl GetMonData - strh r0, [r6, 0x2C] - b _081C0322 -_081C02A8: - adds r4, r7, 0 - adds r4, 0xA6 - adds r0, r5, 0 - movs r1, 0x7 - adds r2, r4, 0 - bl GetMonData - adds r0, r5, 0 - movs r1, 0x3 - bl GetMonData - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl ConvertInternationalString - adds r0, r5, 0 - bl sub_81B205C - strb r0, [r6, 0x7] - adds r0, r5, 0 - movs r1, 0x31 - bl GetMonData - adds r1, r7, 0 - adds r1, 0xA2 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x1 - bl GetMonData - str r0, [r6, 0x48] - adds r0, r5, 0 - movs r1, 0x23 - bl GetMonData - strb r0, [r6, 0x9] - adds r0, r5, 0 - movs r1, 0x24 - bl GetMonData - strb r0, [r6, 0xA] - adds r0, r5, 0 - movs r1, 0x25 - bl GetMonData - strb r0, [r6, 0xB] - adds r0, r5, 0 - movs r1, 0x20 - bl GetMonData - strh r0, [r6, 0x30] - b _081C0322 -_081C0314: - adds r0, r5, 0 - movs r1, 0x52 - bl GetMonData - strb r0, [r6, 0x6] - movs r0, 0x1 - b _081C0332 -_081C0322: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040f0 - adds r1, r2 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0 -_081C0332: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C00F0 - - thumb_func_start sub_81C0348 -sub_81C0348: @ 81C0348 - push {r4-r6,lr} - ldr r6, =gUnknown_0203CF1C - ldr r2, [r6] - ldr r1, =0x000040c0 - adds r0, r2, r1 - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _081C037C - movs r0, 0 - movs r1, 0xFF - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0xFF - movs r2, 0 - bl sub_81C1EFC - b _081C03D8 - .pool -_081C037C: - ldr r1, =0x000040c6 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 1 - adds r0, r2, 0 - adds r0, 0x84 - adds r0, r1 - ldrh r0, [r0] - bl sub_81C240C - ldr r0, [r6] - ldr r5, =0x000020bc - adds r0, r5 - movs r1, 0x3 - movs r2, 0 - bl sub_81C2194 - ldr r0, [r6] - ldr r4, =0x000030bc - adds r0, r4 - movs r1, 0x1 - movs r2, 0 - bl sub_81C2194 - ldr r1, [r6] - adds r1, r4 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r6] - adds r1, r5 - movs r0, 0x2 - bl SetBgTilemapBuffer - movs r1, 0x80 - lsls r1, 9 - movs r0, 0x2 - movs r2, 0x1 - bl ChangeBgX - movs r0, 0x13 - bl ClearWindowTilemap - movs r0, 0xD - bl ClearWindowTilemap -_081C03D8: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x77 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0400 - movs r0, 0 - movs r1, 0xFF - bl sub_81C2074 - b _081C0416 - .pool -_081C0400: - ldr r2, =0x000040c0 - adds r0, r1, r2 - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _081C0416 - movs r0, 0xD - bl PutWindowTilemap -_081C0416: - bl sub_81C2524 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C2228 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0348 - - thumb_func_start sub_81C0434 -sub_81C0434: @ 81C0434 - push {lr} - bl FreeAllWindowBuffers - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - bl Free - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0434 - - thumb_func_start sub_81C044C -sub_81C044C: @ 81C044C - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C0484 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C044C - - thumb_func_start sub_81C0484 -sub_81C0484: @ 81C0484 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C04EC - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081C04EC - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r0, [r0, 0x4] - bl SetMainCallback2 - ldr r1, =gUnknown_0203CF20 - ldr r0, [r4] - ldr r2, =0x000040be - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - bl sub_81C4898 - bl ResetSpriteData - bl FreeAllSpritePalettes - bl StopCryAndClearCrySongs - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl - ldr r0, =gMonSpritesGfxPtr - ldr r0, [r0] - cmp r0, 0 - bne _081C04E2 - movs r0, 0 - bl sub_806F47C -_081C04E2: - bl sub_81C0434 - adds r0, r5, 0 - bl DestroyTask -_081C04EC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0484 - - thumb_func_start sub_81C0510 -sub_81C0510: @ 81C0510 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C05FE - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r2, 0x80 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _081C05FE - ldr r5, =gMain - ldrh r1, [r5, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C0550 - movs r1, 0x1 - negs r1, r1 - adds r0, r4, 0 - bl sub_81C0604 - b _081C05FE - .pool -_081C0550: - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081C0562 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C0604 - b _081C05FE -_081C0562: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081C0576 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C0582 -_081C0576: - movs r1, 0x1 - negs r1, r1 - adds r0, r4, 0 - bl sub_81C0A8C - b _081C05FE -_081C0582: - ldrh r1, [r5, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081C0598 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081C05A2 -_081C0598: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C0A8C - b _081C05FE -_081C05A2: - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C05E6 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C05FE - cmp r0, 0 - bne _081C05D8 - bl sub_81C48F0 - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81C044C - b _081C05FE - .pool -_081C05D8: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81C0E48 - b _081C05FE -_081C05E6: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C05FE - bl sub_81C48F0 - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81C044C -_081C05FE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C0510 - - thumb_func_start sub_81C0604 -sub_81C0604: @ 81C0604 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - adds r4, r5, 0 - ldr r1, =gUnknown_0203CF1C - ldr r3, [r1] - ldr r2, =0x000040c3 - adds r0, r3, r2 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0 - bne _081C06EE - ldr r1, =0x000040bd - adds r0, r3, r1 - ldrb r2, [r0] - cmp r2, 0x1 - bne _081C0678 - adds r1, 0x3 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081C0654 - lsls r1, r5, 24 - asrs r1, 24 - movs r4, 0x2 - eors r1, r2 - negs r0, r1 - orrs r0, r1 - asrs r0, 31 - ands r4, r0 - b _081C065C - .pool -_081C0654: - movs r4, 0x3 - cmp r5, 0x1 - bne _081C065C - movs r4, 0x1 -_081C065C: - ldr r2, [r6] - ldr r0, [r2] - ldr r3, =0x000040be - adds r1, r2, r3 - ldrb r1, [r1] - adds r3, 0x1 - adds r2, r3 - ldrb r2, [r2] - adds r3, r4, 0 - bl sub_80D214C - b _081C0696 - .pool -_081C0678: - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C068E - lsls r0, r5, 24 - asrs r0, 24 - bl sub_81C09B4 - b _081C0696 -_081C068E: - lsls r0, r4, 24 - asrs r0, 24 - bl sub_81C08F8 -_081C0696: - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _081C06EE - movs r0, 0x5 - bl PlaySE - ldr r5, =gUnknown_0203CF1C - ldr r0, [r5] - adds r0, 0x77 - ldrb r0, [r0] - cmp r0, 0 - beq _081C06D4 - movs r0, 0x2 - movs r1, 0x1 - bl sub_81C4204 - movs r0, 0xD - bl ClearWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0x2 - bl sub_81C2074 -_081C06D4: - ldr r0, [r5] - ldr r1, =0x000040be - adds r0, r1 - movs r2, 0 - strb r4, [r0] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r2, [r0, 0x8] - ldr r1, =sub_81C0704 - str r1, [r0] -_081C06EE: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0604 - - thumb_func_start sub_81C0704 -sub_81C0704: @ 81C0704 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r4, r1, 3 - ldr r6, =gTasks + 0x8 - adds r5, r4, r6 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0xC - bls _081C071E - b _081C08BC -_081C071E: - lsls r0, 2 - ldr r1, =_081C0730 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C0730: - .4byte _081C0764 - .4byte _081C076A - .4byte _081C0780 - .4byte _081C07A8 - .4byte _081C07C8 - .4byte _081C07E0 - .4byte _081C07F0 - .4byte _081C0800 - .4byte _081C0828 - .4byte _081C086C - .4byte _081C0872 - .4byte _081C0878 - .4byte _081C0894 -_081C0764: - bl StopCryAndClearCrySongs - b _081C08EC -_081C076A: - bl sub_81C4898 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d3 - b _081C0786 - .pool -_081C0780: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d4 -_081C0786: - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySpriteAndFreeResources - b _081C08EC - .pool -_081C07A8: - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0xC - bl sub_81C0098 - ldr r0, [r4] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081C08EC - .pool -_081C07C8: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C00F0 - lsls r0, 24 - cmp r0, 0 - bne _081C07DA - b _081C08F2 -_081C07DA: - b _081C08EC - .pool -_081C07E0: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C49E0 - b _081C08EC - .pool -_081C07F0: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C4A08 - b _081C08EC - .pool -_081C0800: - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0x77 - ldrb r0, [r0] - cmp r0, 0 - beq _081C0816 - movs r1, 0x2 - negs r1, r1 - movs r0, 0xA - bl sub_81C2074 -_081C0816: - ldr r0, [r4] - adds r0, 0xC - bl sub_81C2228 - movs r0, 0 - strh r0, [r5, 0x2] - b _081C08EC - .pool -_081C0828: - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0xC - adds r1, r5, 0x2 - bl sub_81C45F4 - ldr r1, [r4] - ldr r2, =0x000040d3 - adds r1, r2 - strb r0, [r1] - ldr r0, [r4] - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081C08F2 - ldr r2, =gSprites - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x32] - bl sub_81C0E24 - movs r0, 0 - strh r0, [r5, 0x2] - b _081C08EC - .pool -_081C086C: - bl sub_81C4280 - b _081C08EC -_081C0872: - bl sub_81C25E8 - b _081C08EC -_081C0878: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C2D9C - bl sub_81C2524 - b _081C08EC - .pool -_081C0894: - ldr r2, =gSprites - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d3 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x32] - b _081C08EC - .pool -_081C08BC: - bl sub_81221EC - lsls r0, 24 - cmp r0, 0 - bne _081C08F2 - ldr r0, =sub_81C20F0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081C08F2 - strh r0, [r5] - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r4, r0 - ldr r1, =sub_81C0510 - str r1, [r0] - b _081C08F2 - .pool -_081C08EC: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_081C08F2: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C0704 - - thumb_func_start sub_81C08F8 -sub_81C08F8: @ 81C08F8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0203CF1C - ldr r2, [r1] - ldr r7, [r2] - ldr r3, =0x000040c0 - adds r0, r2, r3 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0 - bne _081C0960 - lsls r0, r4, 24 - asrs r3, r0, 24 - movs r1, 0x1 - negs r1, r1 - adds r6, r0, 0 - cmp r3, r1 - bne _081C0928 - ldr r1, =0x000040be - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081C0988 -_081C0928: - asrs r0, r6, 24 - cmp r0, 0x1 - bne _081C0940 - ldr r0, [r5] - ldr r2, =0x000040be - adds r1, r0, r2 - ldr r3, =0x000040bf - adds r0, r3 - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bcs _081C0988 -_081C0940: - ldr r0, [r5] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - adds r0, r4 - lsls r0, 24 - asrs r0, 24 - b _081C09AE - .pool -_081C0960: - ldr r3, =0x000040be - adds r0, r2, r3 - ldrb r5, [r0] - lsls r6, r4, 24 -_081C0968: - lsls r0, r5, 24 - asrs r0, 24 - asrs r1, r6, 24 - adds r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - asrs r4, r0, 24 - cmp r4, 0 - blt _081C0988 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040bf - adds r0, r1 - ldrb r0, [r0] - cmp r4, r0 - ble _081C099C -_081C0988: - movs r0, 0x1 - negs r0, r0 - b _081C09AE - .pool -_081C099C: - movs r0, 0x64 - muls r0, r4 - adds r0, r7, r0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081C0968 - adds r0, r4, 0 -_081C09AE: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C08F8 - - thumb_func_start sub_81C09B4 -sub_81C09B4: @ 81C09B4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - ldr r6, =gUnknown_0203CF1C - ldr r0, [r6] - ldr r1, [r0] - mov r8, r1 - movs r5, 0 - movs r2, 0 - ldr r3, =gUnknown_0861CC1C - movs r1, 0 - ldrsb r1, [r3, r1] - ldr r4, =0x000040be - adds r0, r4 - ldrb r0, [r0] - cmp r1, r0 - beq _081C09FC - adds r7, r3, 0 - adds r3, r4, 0 -_081C09E0: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bhi _081C09FC - adds r0, r2, r7 - movs r1, 0 - ldrsb r1, [r0, r1] - ldr r0, [r6] - adds r0, r3 - ldrb r0, [r0] - cmp r1, r0 - bne _081C09E0 - adds r5, r2, 0 -_081C09FC: - mov r0, r12 - lsls r6, r0, 24 - ldr r7, =gUnknown_0861CC1C -_081C0A02: - lsls r0, r5, 24 - asrs r0, 24 - asrs r1, r6, 24 - adds r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, r5, 24 - lsrs r0, r1, 24 - cmp r0, 0x5 - bhi _081C0A40 - asrs r0, r1, 24 - adds r0, r7 - movs r4, 0 - ldrsb r4, [r0, r4] - movs r0, 0x64 - muls r0, r4 - add r0, r8 - bl sub_81C0A50 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C0A02 - adds r0, r4, 0 - b _081C0A44 - .pool -_081C0A40: - movs r0, 0x1 - negs r0, r0 -_081C0A44: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C09B4 - - thumb_func_start sub_81C0A50 -sub_81C0A50: @ 81C0A50 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081C0A84 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0A78 - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081C0A84 -_081C0A78: - movs r0, 0x1 - b _081C0A86 - .pool -_081C0A84: - movs r0, 0 -_081C0A86: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C0A50 - - thumb_func_start sub_81C0A8C -sub_81C0A8C: @ 81C0A8C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - str r6, [sp] - lsls r1, 24 - lsrs r3, r1, 24 - str r3, [sp, 0x4] - ldr r0, =gUnknown_0203CF1C - mov r8, r0 - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0x70 - lsls r0, r6, 2 - adds r0, r6 - lsls r7, r0, 3 - ldr r0, =gTasks + 0x8 - mov r9, r0 - adds r0, r7, r0 - str r0, [sp, 0x8] - ldrb r1, [r1, 0x4] - mov r10, r1 - cmp r1, 0 - bne _081C0B6E - lsls r0, r3, 24 - asrs r5, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - bne _081C0AE0 - ldr r1, =0x000040c0 - adds r0, r2, r1 - ldr r3, =0x000040c1 - adds r1, r2, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _081C0B6E -_081C0AE0: - cmp r5, 0x1 - bne _081C0AF4 - ldr r1, =0x000040c0 - adds r0, r2, r1 - ldr r3, =0x000040c2 - adds r1, r2, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _081C0B6E -_081C0AF4: - movs r0, 0x5 - bl PlaySE - mov r1, r8 - ldr r0, [r1] - ldr r4, =0x000040c0 - adds r0, r4 - ldrb r0, [r0] - bl sub_81C2C38 - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldrb r0, [r1] - ldr r3, [sp, 0x4] - adds r0, r3 - strb r0, [r1] - mov r1, r10 - ldr r0, [sp, 0x8] - strh r1, [r0] - cmp r5, 0x1 - bne _081C0B4C - ldr r1, =sub_81C0B8C - mov r0, r9 - subs r0, 0x8 - adds r0, r7, r0 - ldr r2, [r0] - adds r0, r6, 0 - bl SetTaskFuncWithFollowupFunc - b _081C0B5C - .pool -_081C0B4C: - ldr r1, =sub_81C0CC4 - mov r0, r9 - subs r0, 0x8 - adds r0, r7, r0 - ldr r2, [r0] - ldr r0, [sp] - bl SetTaskFuncWithFollowupFunc -_081C0B5C: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r2, =0x000040c0 - adds r0, r2 - ldrb r0, [r0] - bl sub_81C2DE4 - bl sub_81C424C -_081C0B6E: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0A8C - - thumb_func_start sub_81C0B8C -sub_81C0B8C: @ 81C0B8C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081C0C2A - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r3, =0x000040c9 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0BE0 - movs r0, 0x1 - strh r0, [r4, 0x2] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - b _081C0BFE - .pool -_081C0BE0: - movs r0, 0x2 - strh r0, [r4, 0x2] - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081C0BFE: - ldrb r0, [r4, 0x2] - movs r1, 0 - movs r2, 0 - bl ChangeBgX - ldrb r0, [r4, 0x2] - ldr r1, =gUnknown_0203CF1C - ldr r1, [r1] - ldr r3, =0x000040c0 - adds r2, r1, r3 - ldrb r2, [r2] - lsls r2, 12 - adds r2, 0xBC - adds r1, r2 - bl SetBgTilemapBuffer - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg -_081C0C2A: - ldrb r0, [r4, 0x2] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x1 - bl ChangeBgX - ldrh r0, [r4] - adds r0, 0x20 - strh r0, [r4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _081C0C52 - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C0C68 - str r0, [r1] -_081C0C52: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0B8C - - thumb_func_start sub_81C0C68 -sub_81C0C68: @ 81C0C68 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 3 - ldr r0, =gTasks + 0x8 - adds r2, r0 - ldr r5, =gUnknown_0203CF1C - ldr r3, [r5] - ldr r0, =0x000040c9 - adds r3, r0 - ldrb r0, [r3] - movs r1, 0x1 - eors r0, r1 - movs r1, 0 - strb r0, [r3] - strh r1, [r2, 0x2] - strh r1, [r2] - bl sub_81C1BA0 - ldr r0, [r5] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C2AFC - bl sub_81C4280 - bl sub_81C0E24 - adds r0, r4, 0 - bl SwitchTaskToFollowupFunc - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0C68 - - thumb_func_start sub_81C0CC4 -sub_81C0CC4: @ 81C0CC4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081C0D0C - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c9 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0CFC - movs r0, 0x2 - b _081C0CFE - .pool -_081C0CFC: - movs r0, 0x1 -_081C0CFE: - strh r0, [r4, 0x2] - ldrb r0, [r4, 0x2] - movs r1, 0x80 - lsls r1, 9 - movs r2, 0 - bl ChangeBgX -_081C0D0C: - ldrb r0, [r4, 0x2] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x2 - bl ChangeBgX - ldrh r0, [r4] - adds r0, 0x20 - strh r0, [r4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _081C0D34 - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C0D44 - str r0, [r1] -_081C0D34: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0CC4 - - thumb_func_start sub_81C0D44 -sub_81C0D44: @ 81C0D44 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c9 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0D8C - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - b _081C0DA6 - .pool -_081C0D8C: - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram -_081C0DA6: - ldr r6, =gUnknown_0203CF1C - ldr r2, [r6] - ldr r7, =0x000040c0 - adds r1, r2, r7 - ldrb r0, [r1] - cmp r0, 0x1 - bls _081C0DD0 - ldrb r0, [r4, 0x2] - ldrb r1, [r1] - lsls r1, 12 - ldr r3, =0xfffff0bc - adds r1, r3 - adds r1, r2, r1 - bl SetBgTilemapBuffer - ldrb r0, [r4, 0x2] - movs r1, 0x80 - lsls r1, 9 - movs r2, 0 - bl ChangeBgX -_081C0DD0: - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r2, [r6] - ldr r0, =0x000040c9 - adds r2, r0 - ldrb r0, [r2] - movs r1, 0x1 - eors r0, r1 - movs r1, 0 - strb r0, [r2] - strh r1, [r4, 0x2] - strh r1, [r4] - bl sub_81C1BA0 - ldr r0, [r6] - adds r0, r7 - ldrb r0, [r0] - bl sub_81C2AFC - bl sub_81C4280 - bl sub_81C0E24 - adds r0, r5, 0 - bl SwitchTaskToFollowupFunc - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0D44 - - thumb_func_start sub_81C0E24 -sub_81C0E24: @ 81C0E24 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040c0 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C0E3C - adds r0, r1, 0 - adds r0, 0xC - bl sub_81C22CC -_081C0E3C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0E24 - - thumb_func_start sub_81C0E48 -sub_81C0E48: @ 81C0E48 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =gUnknown_0203CF1C - ldr r0, [r5] - ldr r2, =0x000040c6 - adds r0, r2 - movs r1, 0 - strb r1, [r0] - ldr r1, [r5] - adds r2, r1, r2 - ldrb r0, [r2] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r6, [r1] - mov r8, r6 - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =gSprites - ldr r0, [r5] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C0E96 - movs r0, 0xD - bl ClearWindowTilemap -_081C0E96: - movs r4, 0x3 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_81C1EFC - ldr r0, [r5] - ldr r1, =0x000040c8 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0EC4 - movs r0, 0x5 - bl ClearWindowTilemap - movs r0, 0x6 - bl PutWindowTilemap -_081C0EC4: - ldr r0, [r5] - ldr r1, =0x000020bc - adds r0, r1 - movs r1, 0x3 - movs r2, 0 - bl sub_81C2194 - ldr r0, [r5] - ldr r1, =0x000030bc - adds r0, r1 - movs r1, 0x1 - movs r2, 0 - bl sub_81C2194 - mov r0, r8 - bl sub_81C3E9C - bl sub_81C3F44 - bl sub_81C44F0 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x8 - bl sub_81C4AF8 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C0F44 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0E48 - - thumb_func_start sub_81C0F44 -sub_81C0F44: @ 81C0F44 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C103A - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C0F98 - movs r0, 0x4 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - b _081C103A - .pool -_081C0F98: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C0FC0 - movs r0, 0x4 - strh r0, [r4] - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - b _081C103A - .pool -_081C0FC0: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C1026 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040c8 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C0FE8 - subs r2, 0x4 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - bne _081C1004 -_081C0FE8: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81C11F4 - b _081C103A - .pool -_081C1004: - bl sub_81C1040 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C101E - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81C129C - b _081C103A -_081C101E: - movs r0, 0x20 - bl PlaySE - b _081C103A -_081C1026: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C103A - movs r0, 0x5 - bl PlaySE - adds r0, r6, 0 - bl sub_81C11F4 -_081C103A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C0F44 - - thumb_func_start sub_81C1040 -sub_81C1040: @ 81C1040 - push {lr} - movs r1, 0x1 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r2, r0, 0 - adds r2, 0x84 -_081C104C: - lsls r0, r1, 1 - adds r0, r2, r0 - ldrh r0, [r0] - cmp r0, 0 - beq _081C1060 - movs r0, 0x1 - b _081C106C - .pool -_081C1060: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _081C104C - movs r0, 0 -_081C106C: - pop {r1} - bx r1 - thumb_func_end sub_81C1040 - - thumb_func_start sub_81C1070 -sub_81C1070: @ 81C1070 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - adds r4, r1, 0 - mov r8, r2 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - mov r0, r8 - ldrb r6, [r0] - movs r2, 0 - lsls r4, 24 - asrs r4, 24 - mov r12, r4 - movs r1, 0 - ldrsh r4, [r7, r1] - ldrb r0, [r7] - lsls r3, r0, 24 -_081C109C: - lsls r0, r6, 24 - asrs r0, 24 - add r0, r12 - lsls r0, 24 - lsrs r6, r0, 24 - asrs r0, 24 - cmp r0, r4 - ble _081C10B0 - movs r6, 0 - b _081C10B6 -_081C10B0: - cmp r0, 0 - bge _081C10B6 - lsrs r6, r3, 24 -_081C10B6: - lsls r0, r6, 24 - asrs r1, r0, 24 - mov r9, r0 - cmp r1, 0x4 - bne _081C10C2 - b _081C11CC -_081C10C2: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - lsls r1, 1 - adds r0, 0x84 - adds r0, r1 - ldrh r5, [r0] - cmp r5, 0 - bne _081C10E2 - lsls r0, r2, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _081C109C -_081C10E2: - adds r0, r5, 0 - bl sub_81C240C - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r5, 0 - bl sub_81C3E9C - mov r1, r8 - ldrb r0, [r1] - cmp r0, 0x4 - bne _081C1110 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _081C1118 -_081C1110: - movs r1, 0x2 - ldrsh r0, [r7, r1] - cmp r0, 0x1 - bne _081C115E -_081C1118: - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =gSprites - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1142 - movs r0, 0xD - bl ClearWindowTilemap -_081C1142: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r4, 0x3 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81C1EFC -_081C115E: - mov r1, r8 - ldrb r0, [r1] - cmp r0, 0x4 - beq _081C11A0 - mov r1, r9 - asrs r0, r1, 24 - cmp r0, 0x4 - bne _081C11A0 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _081C11A0 - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xF - bl ClearWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0x3 - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - bl sub_81C1EFC -_081C11A0: - mov r0, r8 - strb r6, [r0] - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c6 - adds r0, r1 - cmp r8, r0 - bne _081C11E0 - movs r0, 0x8 - bl sub_81C4D18 - b _081C11E6 - .pool -_081C11CC: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - ldrh r5, [r0] - b _081C10E2 - .pool -_081C11E0: - movs r0, 0x12 - bl sub_81C4D18 -_081C11E6: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C1070 - - thumb_func_start sub_81C11F4 -sub_81C11F4: @ 81C11F4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x8 - bl sub_81C4C60 - movs r0, 0x6 - bl ClearWindowTilemap - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0 - bl sub_81C3E9C - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000020bc - adds r0, r1 - movs r1, 0x3 - movs r2, 0x1 - bl sub_81C2194 - ldr r0, [r4] - ldr r1, =0x000030bc - adds r0, r1 - movs r1, 0x1 - movs r2, 0x1 - bl sub_81C2194 - bl sub_81C4064 - ldr r0, [r4] - ldr r1, =0x000040c6 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - beq _081C125E - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xF - bl ClearWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - bl sub_81C1EFC -_081C125E: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C0510 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C11F4 - - thumb_func_start sub_81C129C -sub_81C129C: @ 81C129C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r2, =0x000040c6 - adds r1, r0, r2 - ldrb r1, [r1] - adds r2, 0x1 - adds r0, r2 - strb r1, [r0] - movs r0, 0x1 - bl sub_81C4C84 - movs r0, 0x12 - bl sub_81C4AF8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C12E4 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C129C - - thumb_func_start sub_81C12E4 -sub_81C12E4: @ 81C12E4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C13AA - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C1338 - movs r0, 0x3 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c7 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - b _081C13AA - .pool -_081C1338: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C1360 - movs r0, 0x3 - strh r0, [r4] - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c7 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - b _081C13AA - .pool -_081C1360: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C139A - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r2, =0x000040c6 - adds r1, r0, r2 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bne _081C1390 - adds r0, r5, 0 - movs r1, 0 - bl sub_81C13B0 - b _081C13AA - .pool -_081C1390: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81C13B0 - b _081C13AA -_081C139A: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C13AA - adds r0, r6, 0 - movs r1, 0 - bl sub_81C13B0 -_081C13AA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C12E4 - - thumb_func_start sub_81C13B0 -sub_81C13B0: @ 81C13B0 - push {r4-r7,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - bl sub_81C4C84 - movs r0, 0x12 - bl sub_81C4C60 - cmp r4, 0x1 - bne _081C1464 - ldr r0, =gUnknown_0203CF1C - ldr r3, [r0] - ldr r1, =0x000040bd - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C1410 - ldr r0, [r3] - ldr r2, =0x000040be - adds r1, r3, r2 - ldrb r2, [r1] - movs r1, 0x64 - muls r1, r2 - adds r0, r1 - ldr r4, =0x000040c6 - adds r1, r3, r4 - ldrb r1, [r1] - adds r4, 0x1 - adds r2, r3, r4 - ldrb r2, [r2] - bl sub_81C14BC - b _081C1430 - .pool -_081C1410: - ldr r0, [r3] - ldr r2, =0x000040be - adds r1, r3, r2 - ldrb r2, [r1] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 4 - adds r0, r1 - ldr r4, =0x000040c6 - adds r1, r3, r4 - ldrb r1, [r1] - adds r4, 0x1 - adds r2, r3, r4 - ldrb r2, [r2] - bl sub_81C15EC -_081C1430: - ldr r5, =gUnknown_0203CF1C - ldr r0, [r5] - adds r0, 0xC - bl sub_81C0098 - ldr r1, [r5] - ldr r6, =0x000040c6 - adds r0, r1, r6 - ldrb r0, [r0] - ldr r4, =0x000040c7 - adds r1, r4 - ldrb r1, [r1] - bl sub_81C40A0 - ldr r1, [r5] - adds r0, r1, r6 - ldrb r0, [r0] - adds r1, r4 - ldrb r1, [r1] - bl sub_81C4568 - ldr r0, [r5] - adds r4, r0, r4 - ldrb r1, [r4] - adds r0, r6 - strb r1, [r0] -_081C1464: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r4, [r1] - adds r0, r4, 0 - bl sub_81C3E9C - adds r0, r4, 0 - bl sub_81C240C - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C0F44 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C13B0 - - thumb_func_start sub_81C14BC -sub_81C14BC: @ 81C14BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - adds r7, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - lsls r0, r4, 1 - mov r10, r0 - adds r1, r2, 0 - adds r1, 0x84 - adds r0, r1, r0 - str r0, [sp, 0x8] - ldrh r0, [r0] - mov r3, sp - adds r3, 0x2 - str r3, [sp, 0x1C] - strh r0, [r3] - lsls r0, r6, 1 - mov r9, r0 - add r1, r9 - str r1, [sp, 0xC] - ldrh r1, [r1] - mov r0, sp - strh r1, [r0] - adds r1, r2, 0 - adds r1, 0x8C - adds r3, r1, r4 - str r3, [sp, 0x10] - ldrb r0, [r3] - mov r3, sp - adds r3, 0x5 - str r3, [sp, 0x24] - strb r0, [r3] - adds r1, r6 - str r1, [sp, 0x14] - ldrb r0, [r1] - mov r1, sp - adds r1, 0x4 - str r1, [sp, 0x20] - strb r0, [r1] - adds r2, 0xA4 - str r2, [sp, 0x18] - ldrb r0, [r2] - mov r5, sp - adds r5, 0x6 - strb r0, [r5] - ldr r1, =gUnknown_08329D22 - adds r0, r4, r1 - ldrb r0, [r0] - mov r8, r0 - ldrb r0, [r5] - adds r2, r0, 0 - mov r3, r8 - ands r2, r3 - mov r3, r10 - asrs r2, r3 - lsls r2, 24 - lsrs r2, 24 - adds r1, r6, r1 - ldrb r1, [r1] - mov r12, r1 - adds r1, r0, 0 - mov r3, r12 - ands r1, r3 - mov r3, r9 - asrs r1, r3 - lsls r1, 24 - lsrs r1, 24 - mov r3, r8 - bics r0, r3 - strb r0, [r5] - ldrb r0, [r5] - mov r3, r12 - bics r0, r3 - strb r0, [r5] - mov r0, r9 - lsls r2, r0 - mov r3, r10 - lsls r1, r3 - adds r2, r1 - ldrb r0, [r5] - orrs r0, r2 - strb r0, [r5] - adds r1, r4, 0 - adds r1, 0xD - adds r0, r7, 0 - mov r2, sp - bl SetMonData - adds r1, r6, 0 - adds r1, 0xD - adds r0, r7, 0 - ldr r2, [sp, 0x1C] - bl SetMonData - adds r4, 0x11 - adds r0, r7, 0 - adds r1, r4, 0 - ldr r2, [sp, 0x20] - bl SetMonData - adds r6, 0x11 - adds r0, r7, 0 - adds r1, r6, 0 - ldr r2, [sp, 0x24] - bl SetMonData - adds r0, r7, 0 - movs r1, 0x15 - adds r2, r5, 0 - bl SetMonData - mov r0, sp - ldrh r0, [r0] - ldr r1, [sp, 0x8] - strh r0, [r1] - ldr r3, [sp, 0x1C] - ldrh r0, [r3] - ldr r1, [sp, 0xC] - strh r0, [r1] - ldr r3, [sp, 0x20] - ldrb r0, [r3] - ldr r1, [sp, 0x10] - strb r0, [r1] - ldr r3, [sp, 0x24] - ldrb r0, [r3] - ldr r1, [sp, 0x14] - strb r0, [r1] - ldrb r0, [r5] - ldr r3, [sp, 0x18] - strb r0, [r3] - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C14BC - - thumb_func_start sub_81C15EC -sub_81C15EC: @ 81C15EC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - adds r7, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - lsls r0, r4, 1 - mov r10, r0 - adds r1, r2, 0 - adds r1, 0x84 - adds r0, r1, r0 - str r0, [sp, 0x8] - ldrh r0, [r0] - mov r3, sp - adds r3, 0x2 - str r3, [sp, 0x1C] - strh r0, [r3] - lsls r0, r6, 1 - mov r9, r0 - add r1, r9 - str r1, [sp, 0xC] - ldrh r1, [r1] - mov r0, sp - strh r1, [r0] - adds r1, r2, 0 - adds r1, 0x8C - adds r3, r1, r4 - str r3, [sp, 0x10] - ldrb r0, [r3] - mov r3, sp - adds r3, 0x5 - str r3, [sp, 0x24] - strb r0, [r3] - adds r1, r6 - str r1, [sp, 0x14] - ldrb r0, [r1] - mov r1, sp - adds r1, 0x4 - str r1, [sp, 0x20] - strb r0, [r1] - adds r2, 0xA4 - str r2, [sp, 0x18] - ldrb r0, [r2] - mov r5, sp - adds r5, 0x6 - strb r0, [r5] - ldr r1, =gUnknown_08329D22 - adds r0, r4, r1 - ldrb r0, [r0] - mov r8, r0 - ldrb r0, [r5] - adds r2, r0, 0 - mov r3, r8 - ands r2, r3 - mov r3, r10 - asrs r2, r3 - lsls r2, 24 - lsrs r2, 24 - adds r1, r6, r1 - ldrb r1, [r1] - mov r12, r1 - adds r1, r0, 0 - mov r3, r12 - ands r1, r3 - mov r3, r9 - asrs r1, r3 - lsls r1, 24 - lsrs r1, 24 - mov r3, r8 - bics r0, r3 - strb r0, [r5] - ldrb r0, [r5] - mov r3, r12 - bics r0, r3 - strb r0, [r5] - mov r0, r9 - lsls r2, r0 - mov r3, r10 - lsls r1, r3 - adds r2, r1 - ldrb r0, [r5] - orrs r0, r2 - strb r0, [r5] - adds r1, r4, 0 - adds r1, 0xD - adds r0, r7, 0 - mov r2, sp - bl SetBoxMonData - adds r1, r6, 0 - adds r1, 0xD - adds r0, r7, 0 - ldr r2, [sp, 0x1C] - bl SetBoxMonData - adds r4, 0x11 - adds r0, r7, 0 - adds r1, r4, 0 - ldr r2, [sp, 0x20] - bl SetBoxMonData - adds r6, 0x11 - adds r0, r7, 0 - adds r1, r6, 0 - ldr r2, [sp, 0x24] - bl SetBoxMonData - adds r0, r7, 0 - movs r1, 0x15 - adds r2, r5, 0 - bl SetBoxMonData - mov r0, sp - ldrh r0, [r0] - ldr r1, [sp, 0x8] - strh r0, [r1] - ldr r3, [sp, 0x1C] - ldrh r0, [r3] - ldr r1, [sp, 0xC] - strh r0, [r1] - ldr r3, [sp, 0x20] - ldrb r0, [r3] - ldr r1, [sp, 0x10] - strb r0, [r1] - ldr r3, [sp, 0x24] - ldrb r0, [r3] - ldr r1, [sp, 0x14] - strb r0, [r1] - ldrb r0, [r5] - ldr r3, [sp, 0x18] - strb r0, [r3] - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C15EC - - thumb_func_start sub_81C171C -sub_81C171C: @ 81C171C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81C44F0 - movs r0, 0x8 - bl sub_81C4AF8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C174C - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C171C - - thumb_func_start sub_81C174C -sub_81C174C: @ 81C174C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C176A - b _081C189A -_081C176A: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r2, 0x80 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081C177A - b _081C189A -_081C177A: - ldr r6, =gMain - ldrh r1, [r6, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C17B4 - movs r0, 0x4 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - b _081C189A - .pool -_081C17B4: - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081C17DC - movs r0, 0x4 - strh r0, [r4] - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r1, =0x000040c6 - adds r2, r1 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - b _081C189A - .pool -_081C17DC: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081C17F0 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C17FC -_081C17F0: - movs r1, 0x1 - negs r1, r1 - adds r0, r5, 0 - bl sub_81C0A8C - b _081C189A -_081C17FC: - ldrh r1, [r6, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081C1812 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081C181C -_081C1812: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81C0A8C - b _081C189A -_081C181C: - ldrh r1, [r6, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C1876 - bl sub_81C18A8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C1868 - bl sub_81C48F0 - movs r0, 0x5 - bl PlaySE - ldr r2, =gUnknown_0203CF21 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c6 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r1, =gSpecialVar_0x8005 - ldrb r0, [r2] - strh r0, [r1] - adds r0, r5, 0 - bl sub_81C044C - b _081C189A - .pool -_081C1868: - movs r0, 0x20 - bl PlaySE - adds r0, r5, 0 - bl sub_81C18F4 - b _081C189A -_081C1876: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C189A - bl sub_81C48F0 - movs r0, 0x5 - bl PlaySE - ldr r1, =gUnknown_0203CF21 - movs r0, 0x4 - strb r0, [r1] - ldr r1, =gSpecialVar_0x8005 - movs r0, 0x4 - strh r0, [r1] - adds r0, r5, 0 - bl sub_81C044C -_081C189A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C174C - - thumb_func_start sub_81C18A8 -sub_81C18A8: @ 81C18A8 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r1, r2, r0 - ldrb r0, [r1] - cmp r0, 0x4 - beq _081C18DA - ldr r3, =0x000040c4 - adds r0, r2, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _081C18DA - ldrb r1, [r1] - lsls r1, 1 - adds r0, r2, 0 - adds r0, 0x84 - adds r0, r1 - ldrh r0, [r0] - bl sub_81B6D14 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C18EC -_081C18DA: - movs r0, 0x1 - b _081C18EE - .pool -_081C18EC: - movs r0, 0 -_081C18EE: - pop {r1} - bx r1 - thumb_func_end sub_81C18A8 - - thumb_func_start sub_81C18F4 -sub_81C18F4: @ 81C18F4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xF - bl ClearWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0x3 - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - bl sub_81C1EFC - bl sub_81C4154 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C1940 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C18F4 - - thumb_func_start sub_81C1940 -sub_81C1940: @ 81C1940 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - mov r8, r0 - ldr r0, =gTasks + 0x8 - mov r9, r0 - mov r4, r8 - add r4, r9 - ldr r0, =sub_81C1E20 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C196C - b _081C1B74 -_081C196C: - ldr r6, =gMain - ldrh r1, [r6, 0x2E] - movs r0, 0x40 - ands r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _081C19B0 - movs r0, 0x1 - strh r0, [r4, 0x2] - movs r0, 0x4 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - movs r0, 0 - strh r0, [r4, 0x2] - b _081C1B6A - .pool -_081C19B0: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C19DC - movs r0, 0x1 - strh r0, [r4, 0x2] - movs r0, 0x4 - strh r0, [r4] - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r1, =0x000040c6 - adds r2, r1 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - strh r5, [r4, 0x2] - b _081C1B6A - .pool -_081C19DC: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081C19F0 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C1A64 -_081C19F0: - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r2, =0x000040c0 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081C1A00 - b _081C1B74 -_081C1A00: - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =gSprites - ldr r0, [r4] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1A28 - movs r0, 0xD - bl ClearWindowTilemap -_081C1A28: - ldr r1, [r4] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r5, [r1] - mov r0, r9 - subs r0, 0x8 - add r0, r8 - ldr r1, =sub_81C174C - str r1, [r0] - movs r1, 0x1 - negs r1, r1 - adds r0, r7, 0 - b _081C1ACE - .pool -_081C1A64: - ldrh r1, [r6, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081C1A7A - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081C1B04 -_081C1A7A: - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - beq _081C1B74 - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =gSprites - ldr r0, [r4] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1AB0 - movs r0, 0xD - bl ClearWindowTilemap -_081C1AB0: - ldr r1, [r4] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r5, [r1] - mov r0, r9 - subs r0, 0x8 - add r0, r8 - ldr r1, =sub_81C174C - str r1, [r0] - adds r0, r7, 0 - movs r1, 0x1 -_081C1ACE: - bl sub_81C0A8C - movs r4, 0x2 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81C1EFC - b _081C1B74 - .pool -_081C1B04: - ldrh r1, [r6, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081C1B74 - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =gSprites - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1B38 - movs r0, 0xD - bl ClearWindowTilemap -_081C1B38: - ldr r1, [r4] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r5, [r1] - adds r0, r5, 0 - bl sub_81C3E9C - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r4, 0x3 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81C1EFC -_081C1B6A: - mov r0, r9 - subs r0, 0x8 - add r0, r8 - ldr r1, =sub_81C174C - str r1, [r0] -_081C1B74: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1940 - - thumb_func_start sub_81C1B94 -sub_81C1B94: @ 81C1B94 - ldr r0, =gUnknown_0203CF21 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81C1B94 - - thumb_func_start sub_81C1BA0 -sub_81C1BA0: @ 81C1BA0 - push {r4-r7,lr} - sub sp, 0xC - movs r0, 0x20 - bl Alloc - adds r4, r0, 0 - movs r5, 0 -_081C1BAE: - lsls r0, r5, 25 - lsrs r1, r0, 24 - adds r6, r1, 0 - ldr r0, =gUnknown_0203CF1C - ldr r3, [r0] - ldr r2, =0x000040c1 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r5, r0 - bcs _081C1BD8 - lsls r0, r1, 1 - adds r0, r4 - movs r1, 0x40 - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x50 - b _081C1BEE - .pool -_081C1BD8: - ldr r7, =0x000040c2 - adds r0, r3, r7 - ldrb r2, [r0] - cmp r5, r2 - bls _081C1BF8 - lsls r0, r1, 1 - adds r0, r4 - movs r1, 0x4A - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x5A -_081C1BEE: - strh r1, [r0, 0x10] - strh r1, [r0, 0x12] - b _081C1C78 - .pool -_081C1BF8: - ldr r7, =0x000040c0 - adds r0, r3, r7 - ldrb r0, [r0] - cmp r5, r0 - bcs _081C1C1C - lsls r1, 1 - adds r1, r4 - movs r0, 0x46 - strh r0, [r1] - movs r0, 0x47 - strh r0, [r1, 0x2] - movs r0, 0x56 - strh r0, [r1, 0x10] - movs r0, 0x57 - b _081C1C76 - .pool -_081C1C1C: - cmp r5, r0 - bne _081C1C4C - cmp r5, r2 - beq _081C1C38 - lsls r1, 1 - adds r1, r4 - movs r0, 0x41 - strh r0, [r1] - movs r0, 0x42 - strh r0, [r1, 0x2] - movs r0, 0x51 - strh r0, [r1, 0x10] - movs r0, 0x52 - b _081C1C76 -_081C1C38: - lsls r1, 1 - adds r1, r4 - movs r0, 0x4B - strh r0, [r1] - movs r0, 0x4C - strh r0, [r1, 0x2] - movs r0, 0x5B - strh r0, [r1, 0x10] - movs r0, 0x5C - b _081C1C76 -_081C1C4C: - cmp r5, r2 - beq _081C1C64 - lsls r1, 1 - adds r1, r4 - movs r0, 0x43 - strh r0, [r1] - movs r0, 0x44 - strh r0, [r1, 0x2] - movs r0, 0x53 - strh r0, [r1, 0x10] - movs r0, 0x54 - b _081C1C76 -_081C1C64: - lsls r1, r6, 1 - adds r1, r4 - movs r0, 0x48 - strh r0, [r1] - movs r0, 0x49 - strh r0, [r1, 0x2] - movs r0, 0x58 - strh r0, [r1, 0x10] - movs r0, 0x59 -_081C1C76: - strh r0, [r1, 0x12] -_081C1C78: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _081C1BAE - movs r0, 0x8 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x3 - adds r1, r4, 0 - movs r2, 0xB - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r4, 0 - bl Free - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C1BA0 - - thumb_func_start sub_81C1CB0 -sub_81C1CB0: @ 81C1CB0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - mov r8, r1 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r5, r3, 24 - ldrb r1, [r4, 0x6] - ldrb r0, [r4, 0x7] - lsls r0, 1 - muls r0, r1 - bl Alloc - adds r7, r0, 0 - mov r1, sp - ldrh r0, [r4, 0x4] - strh r0, [r1] - ldrb r1, [r4, 0x7] - ldrb r0, [r4, 0x6] - adds r2, r1, 0 - muls r2, r0 - movs r0, 0x80 - lsls r0, 17 - orrs r2, r0 - mov r0, sp - adds r1, r7, 0 - bl CpuSet - ldrb r0, [r4, 0x6] - cmp r0, r6 - beq _081C1D60 - cmp r5, 0 - bne _081C1D30 - movs r5, 0 - ldrb r0, [r4, 0x7] - cmp r5, r0 - bcs _081C1D60 -_081C1D00: - ldrb r2, [r4, 0x6] - adds r1, r2, 0 - muls r1, r5 - adds r3, r6, r1 - lsls r3, 1 - ldr r0, [r4] - adds r0, r3 - lsls r1, 1 - adds r1, r7, r1 - subs r2, r6 - ldr r3, =0x001fffff - ands r2, r3 - bl CpuSet - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r3, [r4, 0x7] - cmp r5, r3 - bcc _081C1D00 - b _081C1D60 - .pool -_081C1D30: - movs r5, 0 - ldrb r0, [r4, 0x7] - cmp r5, r0 - bcs _081C1D60 -_081C1D38: - ldrb r2, [r4, 0x6] - adds r1, r2, 0 - muls r1, r5 - lsls r3, r1, 1 - ldr r0, [r4] - adds r0, r3 - adds r1, r6, r1 - lsls r1, 1 - adds r1, r7, r1 - subs r2, r6 - ldr r3, =0x001fffff - ands r2, r3 - bl CpuSet - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r3, [r4, 0x7] - cmp r5, r3 - bcc _081C1D38 -_081C1D60: - movs r5, 0 - b _081C1D8A - .pool -_081C1D68: - ldrb r2, [r4, 0x6] - adds r0, r2, 0 - muls r0, r5 - lsls r0, 1 - adds r0, r7, r0 - ldrb r1, [r4, 0x9] - adds r1, r5 - lsls r1, 5 - ldrb r3, [r4, 0x8] - adds r1, r3 - lsls r1, 1 - add r1, r8 - bl CpuSet - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_081C1D8A: - ldrb r0, [r4, 0x7] - cmp r5, r0 - bcc _081C1D68 - adds r0, r7, 0 - bl Free - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C1CB0 - - thumb_func_start sub_81C1DA4 -sub_81C1DA4: @ 81C1DA4 - push {r4-r6,lr} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - asrs r1, 16 - ldr r3, =gUnknown_0861CC04 - ldrb r2, [r3, 0x6] - cmp r1, r2 - ble _081C1DBA - adds r4, r2, 0 -_081C1DBA: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - beq _081C1DC6 - cmp r0, r2 - bne _081C1DE8 -_081C1DC6: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r0, =0x000020bc - adds r1, r0 - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r3, 0 - movs r3, 0x1 - bl sub_81C1CB0 - b _081C1E12 - .pool -_081C1DE8: - ldr r5, =sub_81C1E20 - adds r0, r5, 0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _081C1E04 - adds r0, r5, 0 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 -_081C1E04: - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - strh r6, [r0, 0xA] -_081C1E12: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1DA4 - - thumb_func_start sub_81C1E20 -sub_81C1E20: @ 81C1E20 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r4, 0x2] - lsls r0, 16 - cmp r0, 0 - bge _081C1E50 - movs r0, 0 - strh r0, [r4, 0x2] - ldr r7, =gUnknown_0861CC04 - b _081C1E60 - .pool -_081C1E50: - movs r0, 0x2 - ldrsh r1, [r4, r0] - ldr r0, =gUnknown_0861CC04 - ldrb r2, [r0, 0x6] - adds r7, r0, 0 - cmp r1, r2 - ble _081C1E60 - strh r2, [r4, 0x2] -_081C1E60: - ldr r5, =gUnknown_0203CF1C - ldr r1, [r5] - ldr r0, =0x000020bc - adds r1, r0 - ldrb r2, [r4, 0x2] - adds r0, r7, 0 - movs r3, 0x1 - bl sub_81C1CB0 - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - ble _081C1E80 - ldrb r7, [r7, 0x6] - cmp r0, r7 - blt _081C1EE0 -_081C1E80: - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _081C1EAC - ldr r0, [r5] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081C1ED4 - movs r0, 0xE - bl PutWindowTilemap - b _081C1ED4 - .pool -_081C1EAC: - ldr r2, =gSprites - ldr r0, [r5] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1ECE - movs r0, 0xD - bl PutWindowTilemap -_081C1ECE: - movs r0, 0x13 - bl PutWindowTilemap -_081C1ED4: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl DestroyTask -_081C1EE0: - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1E20 - - thumb_func_start sub_81C1EFC -sub_81C1EFC: @ 81C1EFC - push {r4-r7,lr} - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - lsrs r4, r1, 16 - asrs r1, 16 - ldr r3, =gUnknown_0861CC10 - ldrb r2, [r3, 0x6] - cmp r1, r2 - ble _081C1F16 - adds r4, r2, 0 -_081C1F16: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - beq _081C1F22 - cmp r0, r2 - bne _081C1F44 -_081C1F22: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r0, =0x000030bc - adds r1, r0 - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r3, 0 - movs r3, 0x1 - bl sub_81C1CB0 - b _081C1F70 - .pool -_081C1F44: - ldr r5, =sub_81C1F80 - adds r0, r5, 0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _081C1F60 - adds r0, r5, 0 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 -_081C1F60: - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - strh r7, [r0, 0xA] - strh r6, [r0, 0xC] -_081C1F70: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1EFC - - thumb_func_start sub_81C1F80 -sub_81C1F80: @ 81C1F80 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r4, 0x2] - lsls r0, 16 - cmp r0, 0 - bge _081C1FB0 - movs r0, 0 - strh r0, [r4, 0x2] - ldr r7, =gUnknown_0861CC10 - b _081C1FC0 - .pool -_081C1FB0: - movs r0, 0x2 - ldrsh r1, [r4, r0] - ldr r0, =gUnknown_0861CC10 - ldrb r2, [r0, 0x6] - adds r7, r0, 0 - cmp r1, r2 - ble _081C1FC0 - strh r2, [r4, 0x2] -_081C1FC0: - ldr r5, =gUnknown_0203CF1C - ldr r1, [r5] - ldr r0, =0x000030bc - adds r1, r0 - ldrb r2, [r4, 0x2] - adds r0, r7, 0 - movs r3, 0x1 - bl sub_81C1CB0 - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - ble _081C1FE0 - ldrb r7, [r7, 0x6] - cmp r0, r7 - blt _081C2058 -_081C1FE0: - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _081C2024 - ldr r0, [r5] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2006 - ldr r0, =sub_81C0B8C - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _081C2006 - movs r0, 0xF - bl PutWindowTilemap -_081C2006: - ldrh r0, [r4, 0x4] - bl sub_81C240C - b _081C204C - .pool -_081C2024: - ldr r2, =gSprites - ldr r0, [r5] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C2046 - movs r0, 0xD - bl PutWindowTilemap -_081C2046: - movs r0, 0x13 - bl PutWindowTilemap -_081C204C: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl DestroyTask -_081C2058: - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1F80 - - thumb_func_start sub_81C2074 -sub_81C2074: @ 81C2074 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - asrs r1, 16 - ldr r3, =gUnknown_0861CBEC - ldrb r2, [r3, 0x6] - cmp r1, r2 - ble _081C208A - adds r4, r2, 0 -_081C208A: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - beq _081C2096 - cmp r0, r2 - bne _081C20C8 -_081C2096: - ldr r5, =gUnknown_0203CF1C - ldr r1, [r5] - adds r1, 0xBC - lsls r4, 24 - lsrs r4, 24 - adds r0, r3, 0 - adds r2, r4, 0 - movs r3, 0 - bl sub_81C1CB0 - ldr r0, =gUnknown_0861CBF8 - ldr r1, [r5] - adds r1, 0xBC - adds r2, r4, 0 - movs r3, 0 - bl sub_81C1CB0 - b _081C20E2 - .pool -_081C20C8: - ldr r0, =sub_81C20F0 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - strh r5, [r1, 0xA] -_081C20E2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2074 - - thumb_func_start sub_81C20F0 -sub_81C20F0: @ 81C20F0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldrh r0, [r5] - ldrh r1, [r5, 0x2] - adds r0, r1 - strh r0, [r5, 0x2] - lsls r0, 16 - cmp r0, 0 - bge _081C2120 - movs r0, 0 - strh r0, [r5, 0x2] - ldr r7, =gUnknown_0861CBEC - b _081C2130 - .pool -_081C2120: - movs r0, 0x2 - ldrsh r1, [r5, r0] - ldr r0, =gUnknown_0861CBEC - ldrb r2, [r0, 0x6] - adds r7, r0, 0 - cmp r1, r2 - ble _081C2130 - strh r2, [r5, 0x2] -_081C2130: - ldr r4, =gUnknown_0203CF1C - ldr r1, [r4] - adds r1, 0xBC - ldrb r2, [r5, 0x2] - adds r0, r7, 0 - movs r3, 0 - bl sub_81C1CB0 - ldr r0, =gUnknown_0861CBF8 - ldr r1, [r4] - adds r1, 0xBC - ldrb r2, [r5, 0x2] - movs r3, 0 - bl sub_81C1CB0 - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0 - ble _081C2162 - ldrb r7, [r7, 0x6] - cmp r0, r7 - blt _081C2180 -_081C2162: - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bge _081C217A - bl sub_81C4A88 - movs r0, 0xD - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram -_081C217A: - adds r0, r6, 0 - bl DestroyTask -_081C2180: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C20F0 - - thumb_func_start sub_81C2194 -sub_81C2194: @ 81C2194 - push {r4-r7,lr} - adds r6, r0, 0 - lsls r2, 24 - lsls r1, 28 - lsrs r4, r1, 16 - ldr r7, =0x0000056a - cmp r2, 0 - bne _081C21E4 - movs r3, 0 - ldr r5, =gUnknown_08DC3CD4 -_081C21A8: - adds r2, r7, r3 - lsls r2, 1 - adds r2, r6 - lsls r0, r3, 1 - adds r0, r5 - ldrh r1, [r0] - adds r1, r4, r1 - strh r1, [r2] - adds r0, r2, 0 - adds r0, 0x40 - strh r1, [r0] - adds r2, 0x80 - adds r0, r3, 0 - adds r0, 0x14 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - adds r0, r4, r0 - strh r0, [r2] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x13 - bls _081C21A8 - b _081C221C - .pool -_081C21E4: - movs r3, 0 - ldr r5, =gUnknown_08DC3CD4 -_081C21E8: - adds r1, r7, r3 - lsls r1, 1 - adds r1, r6 - adds r0, r3, 0 - adds r0, 0x14 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - adds r0, r4, r0 - strh r0, [r1] - adds r2, r1, 0 - adds r2, 0x40 - adds r0, r3, 0 - adds r0, 0x28 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - adds r0, r4, r0 - strh r0, [r2] - adds r1, 0x80 - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x13 - bls _081C21E8 -_081C221C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2194 - - thumb_func_start sub_81C2228 -sub_81C2228: @ 81C2228 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl CheckPartyPokerus - lsls r0, 24 - cmp r0, 0 - bne _081C225C - adds r0, r4, 0 - movs r1, 0 - bl CheckPartyHasHadPokerus - lsls r0, 24 - cmp r0, 0 - beq _081C225C - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r2, =0x00000502 - adds r1, r0, r2 - movs r2, 0x2C - b _081C2266 - .pool -_081C225C: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r2, =0x00000502 - adds r1, r0, r2 - ldr r2, =0x0000081a -_081C2266: - strh r2, [r1] - ldr r1, =0x00000d02 - adds r0, r1 - strh r2, [r0] - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2228 - - thumb_func_start sub_81C228C -sub_81C228C: @ 81C228C - push {lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081C22AC - movs r0, 0x8 - str r0, [sp] - str r1, [sp, 0x4] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0x8 - bl sub_8199C30 - b _081C22C0 -_081C22AC: - movs r0, 0x8 - str r0, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0x8 - bl sub_8199C30 -_081C22C0: - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_81C228C - - thumb_func_start sub_81C22CC -sub_81C22CC: @ 81C22CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r6, r1, 0 - adds r6, 0x70 - ldrb r1, [r6, 0x5] - mov r8, r0 - cmp r1, 0x63 - bhi _081C2340 - ldr r5, =gExperienceTables - adds r2, r1, 0 - adds r1, r2, 0x1 - lsls r1, 2 - ldr r4, =gBaseStats - ldrh r3, [r6] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r4 - ldrb r3, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r3 - adds r1, r0 - adds r1, r5 - lsls r2, 2 - adds r2, r0 - adds r2, r5 - ldr r1, [r1] - ldr r2, [r2] - subs r1, r2 - ldr r0, [r6, 0x10] - subs r4, r0, r2 - lsls r0, r4, 6 - bl __udivsi3 - adds r6, r0, 0 - movs r7, 0 - adds r0, r7, 0 - orrs r0, r6 - cmp r0, 0 - bne _081C2344 - cmp r4, 0 - beq _081C2344 - movs r6, 0x1 - movs r7, 0 - b _081C2344 - .pool -_081C2340: - movs r6, 0 - movs r7, 0 -_081C2344: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00001d66 - adds r2, r0 - mov r9, r2 - movs r0, 0 - mov r12, r0 - ldr r1, =0x00002062 - mov r10, r1 -_081C2356: - cmp r7, 0 - bgt _081C2362 - cmp r7, 0 - bne _081C237C - cmp r6, 0x7 - bls _081C237C -_081C2362: - mov r2, r12 - lsls r0, r2, 1 - add r0, r9 - ldr r2, =0x0000206a - adds r1, r2, 0 - strh r1, [r0] - b _081C23B6 - .pool -_081C237C: - mov r1, r12 - lsls r0, r1, 1 - add r0, r9 - mov r8, r0 - adds r5, r7, 0 - adds r4, r6, 0 - cmp r7, 0 - bge _081C2394 - movs r4, 0x7 - movs r5, 0 - adds r4, r6 - adcs r5, r7 -_081C2394: - lsls r3, r5, 29 - lsrs r2, r4, 3 - adds r0, r3, 0 - orrs r0, r2 - asrs r1, r5, 3 - lsrs r5, r0, 29 - lsls r4, r1, 3 - adds r3, r5, 0 - orrs r3, r4 - lsls r2, r0, 3 - adds r1, r7, 0 - adds r0, r6, 0 - subs r0, r2 - sbcs r1, r3 - add r0, r10 - mov r2, r8 - strh r0, [r2] -_081C23B6: - movs r0, 0x8 - negs r0, r0 - asrs r1, r0, 31 - adds r6, r0 - adcs r7, r1 - cmp r7, 0 - bge _081C23C8 - movs r6, 0 - movs r7, 0 -_081C23C8: - mov r0, r12 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - cmp r0, 0x7 - bls _081C2356 - movs r0, 0x1 - bl GetBgTilemapBuffer - ldr r1, =gUnknown_0203CF1C - ldr r1, [r1] - ldr r2, =0x000010bc - adds r1, r2 - cmp r0, r1 - bne _081C23F8 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - b _081C23FE - .pool -_081C23F8: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081C23FE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C22CC - - thumb_func_start sub_81C240C -sub_81C240C: @ 81C240C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000038bc - adds r5, r0, r1 - cmp r3, 0 - beq _081C2510 - ldr r1, =gContestEffects - ldr r2, =gContestMoves - lsls r3, 3 - adds r0, r3, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x1] - mov r9, r1 - mov r8, r2 - mov r10, r3 - cmp r4, 0xFF - beq _081C244C - adds r0, r4, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r4, r0, 24 -_081C244C: - movs r2, 0 - movs r6, 0x3 - movs r3, 0xF3 - lsls r3, 2 -_081C2454: - cmp r4, 0xFF - beq _081C2484 - cmp r2, r4 - bcs _081C2484 - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x0000103a - b _081C2496 - .pool -_081C2484: - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x00001039 -_081C2496: - adds r1, r7, 0 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081C2454 - mov r0, r10 - add r0, r8 - ldrb r0, [r0] - lsls r0, 2 - add r0, r9 - ldrb r4, [r0, 0x2] - cmp r4, 0xFF - beq _081C24C0 - adds r0, r4, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r4, r0, 24 -_081C24C0: - movs r2, 0 - movs r6, 0x3 - ldr r3, =0x0000044c -_081C24C6: - cmp r4, 0xFF - beq _081C24F0 - cmp r2, r4 - bcs _081C24F0 - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x0000103c - b _081C2502 - .pool -_081C24F0: - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x0000103d -_081C2502: - adds r1, r7, 0 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081C24C6 -_081C2510: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C240C - - thumb_func_start sub_81C2524 -sub_81C2524: @ 81C2524 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x74 - ldrb r0, [r0] - cmp r0, 0 - beq _081C2544 - movs r1, 0x80 - lsls r1, 9 - movs r0, 0x3 - movs r2, 0 - bl ChangeBgX - b _081C254E - .pool -_081C2544: - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX -_081C254E: - pop {r0} - bx r0 - thumb_func_end sub_81C2524 - - thumb_func_start sub_81C2554 -sub_81C2554: @ 81C2554 - push {r4,r5,lr} - ldr r0, =gUnknown_0861CC24 - bl InitWindows - bl DeactivateAllTextPrinters - movs r4, 0 -_081C2562: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x13 - bls _081C2562 - movs r4, 0 - ldr r5, =gUnknown_0203CF1C - ldr r3, =0x000040cb - movs r2, 0xFF -_081C257C: - ldr r0, [r5] - adds r0, r3 - adds r0, r4 - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C257C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2554 - - thumb_func_start sub_81C25A4 -sub_81C25A4: @ 81C25A4 - push {r4-r6,lr} - sub sp, 0x14 - ldr r4, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r6, 0 - str r6, [sp] - str r4, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_0861CD2C - adds r4, r5 - str r4, [sp, 0x8] - str r6, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C25A4 - - thumb_func_start sub_81C25E8 -sub_81C25E8: @ 81C25E8 - push {lr} - movs r0, 0x11 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x12 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x13 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x74 - ldrb r0, [r0] - cmp r0, 0 - bne _081C2618 - bl sub_81C2628 - b _081C261C - .pool -_081C2618: - bl sub_81C2794 -_081C261C: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r0} - bx r0 - thumb_func_end sub_81C25E8 - - thumb_func_start sub_81C2628 -sub_81C2628: @ 81C2628 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - movs r1, 0xC - adds r1, r0 - mov r8, r1 - adds r7, r0, 0 - adds r7, 0x70 - ldrh r0, [r7] - bl SpeciesToPokedexNum - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _081C26CE - ldr r6, =gStringVar1 - ldr r1, =gText_UnkCtrlF908Clear01 - adds r0, r6, 0 - bl StringCopy - ldr r4, =gStringVar2 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r0, r6, 0 - adds r1, r4, 0 - bl StringAppend - mov r0, r8 - bl IsMonShiny - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081C26AC - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x11 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0 - bl sub_81C228C - b _081C26C6 - .pool -_081C26AC: - movs r0, 0 - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0x1 - bl sub_81C228C -_081C26C6: - movs r0, 0x11 - bl PutWindowTilemap - b _081C26EE -_081C26CE: - movs r0, 0x11 - bl ClearWindowTilemap - mov r0, r8 - bl IsMonShiny - lsls r0, 24 - cmp r0, 0 - bne _081C26E8 - movs r0, 0 - bl sub_81C228C - b _081C26EE -_081C26E8: - movs r0, 0x1 - bl sub_81C228C -_081C26EE: - ldr r4, =gStringVar1 - ldr r1, =gText_LevelSymbol - adds r0, r4, 0 - bl StringCopy - ldr r5, =gStringVar2 - ldrb r1, [r7, 0x5] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r0, r4, 0 - adds r1, r5, 0 - bl StringAppend - movs r6, 0 - str r6, [sp] - movs r5, 0x1 - str r5, [sp, 0x4] - movs r0, 0x13 - adds r1, r4, 0 - movs r2, 0x18 - movs r3, 0x11 - bl sub_81C25A4 - mov r0, r8 - adds r1, r4, 0 - bl GetMonNickname - str r6, [sp] - str r5, [sp, 0x4] - movs r0, 0x12 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add r1, sp, 0x8 - movs r0, 0xBA - strb r0, [r1] - mov r0, sp - adds r0, 0x9 - ldrh r2, [r7, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - str r6, [sp] - str r5, [sp, 0x4] - movs r0, 0x13 - add r1, sp, 0x8 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldrh r1, [r7, 0x2] - mov r0, r8 - bl sub_81C27DC - movs r0, 0x12 - bl PutWindowTilemap - movs r0, 0x13 - bl PutWindowTilemap - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2628 - - thumb_func_start sub_81C2794 -sub_81C2794: @ 81C2794 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - ldr r4, =gStringVar1 - adds r1, r4, 0 - bl GetMonNickname - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x12 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0x12 - bl PutWindowTilemap - movs r0, 0x11 - bl ClearWindowTilemap - movs r0, 0x13 - bl ClearWindowTilemap - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2794 - - thumb_func_start sub_81C27DC -sub_81C27DC: @ 81C27DC - push {lr} - sub sp, 0x8 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0x20 - beq _081C282C - cmp r1, 0x1D - beq _081C282C - bl GetMonGender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081C27FE - cmp r0, 0xFE - beq _081C2818 - b _081C282C -_081C27FE: - ldr r1, =gText_MaleSymbol - str r0, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - movs r0, 0x13 - movs r2, 0x39 - movs r3, 0x11 - bl sub_81C25A4 - b _081C282C - .pool -_081C2818: - ldr r1, =gText_FemaleSymbol - movs r0, 0 - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - movs r0, 0x13 - movs r2, 0x39 - movs r3, 0x11 - bl sub_81C25A4 -_081C282C: - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C27DC - - thumb_func_start sub_81C2838 -sub_81C2838: @ 81C2838 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - ldr r3, =gUnknown_0861CDD3 - cmp r1, 0 - bne _081C284A - subs r3, 0x80 -_081C284A: - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x10 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r1, r3, 0 - movs r3, 0 - bl BlitBitmapToWindow - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2838 - - thumb_func_start sub_81C286C -sub_81C286C: @ 81C286C - push {r4-r7,lr} - sub sp, 0x8 - ldr r1, =gText_PkmnInfo - movs r5, 0 - str r5, [sp] - movs r6, 0x1 - str r6, [sp, 0x4] - movs r0, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_PkmnSkills - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x1 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_BattleMoves - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x2 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_ContestMoves - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x3 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r7, =gText_Cancel2 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x3E - bl GetStringRightAlignXOffset - adds r4, r0, 0 - adds r2, r4, 0 - subs r2, 0x10 - cmp r2, 0 - bge _081C28CC - movs r2, 0 -_081C28CC: - movs r0, 0x4 - movs r1, 0 - bl sub_81C2838 - lsls r2, r4, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x4 - adds r1, r7, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r7, =gText_Info - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x3E - bl GetStringRightAlignXOffset - adds r4, r0, 0 - adds r2, r4, 0 - subs r2, 0x10 - cmp r2, 0 - bge _081C28FE - movs r2, 0 -_081C28FE: - movs r0, 0x5 - movs r1, 0 - bl sub_81C2838 - lsls r2, r4, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x5 - adds r1, r7, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r7, =gText_Switch - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x3E - bl GetStringRightAlignXOffset - adds r4, r0, 0 - adds r2, r4, 0 - subs r2, 0x10 - cmp r2, 0 - bge _081C2930 - movs r2, 0 -_081C2930: - movs r0, 0x6 - movs r1, 0 - bl sub_81C2838 - lsls r2, r4, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x6 - adds r1, r7, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_RentalPkmn - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x8 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_TypeSlash - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x9 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r4, =gText_HP4 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringCenterAlignXOffset - adds r0, 0x6 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xA - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r4, =gText_Attack3 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringCenterAlignXOffset - adds r0, 0x6 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xA - adds r1, r4, 0 - movs r3, 0x11 - bl sub_81C25A4 - ldr r4, =gText_Defense3 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringCenterAlignXOffset - adds r0, 0x6 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xA - adds r1, r4, 0 - movs r3, 0x21 - bl sub_81C25A4 - ldr r4, =gText_SpAtk4 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x24 - bl GetStringCenterAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xB - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r4, =gText_SpDef4 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x24 - bl GetStringCenterAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xB - adds r1, r4, 0 - movs r3, 0x11 - bl sub_81C25A4 - ldr r4, =gText_Speed2 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x24 - bl GetStringCenterAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xB - adds r1, r4, 0 - movs r3, 0x21 - bl sub_81C25A4 - ldr r1, =gText_ExpPoints - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xC - movs r2, 0x6 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_NextLv - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xC - movs r2, 0x6 - movs r3, 0x11 - bl sub_81C25A4 - ldr r1, =gText_Status - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xD - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_Power - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xE - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_Accuracy2 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xE - movs r2, 0 - movs r3, 0x11 - bl sub_81C25A4 - ldr r1, =gText_Appeal - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xF - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_Jam - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xF - movs r2, 0 - movs r3, 0x11 - bl sub_81C25A4 - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C286C - - thumb_func_start sub_81C2AFC -sub_81C2AFC: @ 81C2AFC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - movs r0, 0 - bl ClearWindowTilemap - movs r0, 0x1 - bl ClearWindowTilemap - movs r0, 0x2 - bl ClearWindowTilemap - movs r0, 0x3 - bl ClearWindowTilemap - cmp r4, 0x1 - beq _081C2B66 - cmp r4, 0x1 - bgt _081C2B2A - cmp r4, 0 - beq _081C2B34 - b _081C2C06 -_081C2B2A: - cmp r5, 0x2 - beq _081C2B80 - cmp r5, 0x3 - beq _081C2BC4 - b _081C2C06 -_081C2B34: - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x4 - bl PutWindowTilemap - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2B58 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C2B5E -_081C2B58: - movs r0, 0x8 - bl PutWindowTilemap -_081C2B5E: - movs r0, 0x9 - bl PutWindowTilemap - b _081C2C06 -_081C2B66: - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0xA - bl PutWindowTilemap - movs r0, 0xB - bl PutWindowTilemap - movs r0, 0xC - bl PutWindowTilemap - b _081C2C06 -_081C2B80: - movs r0, 0x2 - bl PutWindowTilemap - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2BBC - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2C06 - movs r0, 0xE - bl PutWindowTilemap - b _081C2C06 - .pool -_081C2BBC: - movs r0, 0x5 - bl PutWindowTilemap - b _081C2C06 -_081C2BC4: - movs r0, 0x3 - bl PutWindowTilemap - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2C00 - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2C06 - movs r0, 0xF - bl PutWindowTilemap - b _081C2C06 - .pool -_081C2C00: - movs r0, 0x5 - bl PutWindowTilemap -_081C2C06: - movs r4, 0 - ldr r5, =gUnknown_0203CF1C -_081C2C0A: - ldr r0, [r5] - ldr r1, =0x000040cb - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - bl PutWindowTilemap - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C2C0A - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2AFC - - thumb_func_start sub_81C2C38 -sub_81C2C38: @ 81C2C38 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - beq _081C2C84 - cmp r0, 0x1 - bgt _081C2C4E - cmp r0, 0 - beq _081C2C58 - b _081C2D0E -_081C2C4E: - cmp r1, 0x2 - beq _081C2C98 - cmp r1, 0x3 - beq _081C2CD4 - b _081C2D0E -_081C2C58: - movs r0, 0x4 - bl ClearWindowTilemap - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2C76 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C2C7C -_081C2C76: - movs r0, 0x8 - bl ClearWindowTilemap -_081C2C7C: - movs r0, 0x9 - bl ClearWindowTilemap - b _081C2D0E -_081C2C84: - movs r0, 0xA - bl ClearWindowTilemap - movs r0, 0xB - bl ClearWindowTilemap - movs r0, 0xC - bl ClearWindowTilemap - b _081C2D0E -_081C2C98: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2CCC - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2D0E - movs r0, 0xE - bl ClearWindowTilemap - b _081C2D0E - .pool -_081C2CCC: - movs r0, 0x5 - bl ClearWindowTilemap - b _081C2D0E -_081C2CD4: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2D08 - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2D0E - movs r0, 0xF - bl ClearWindowTilemap - b _081C2D0E - .pool -_081C2D08: - movs r0, 0x5 - bl ClearWindowTilemap -_081C2D0E: - movs r4, 0 -_081C2D10: - adds r0, r4, 0 - bl sub_81C2D68 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C2D10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C2C38 - - thumb_func_start sub_81C2D2C -sub_81C2D2C: @ 81C2D2C - push {r4,lr} - adds r3, r0, 0 - lsls r1, 24 - lsrs r2, r1, 24 - ldr r0, =gUnknown_0203CF1C - ldr r4, =0x000040cb - adds r1, r2, r4 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081C2D56 - lsls r0, r2, 3 - adds r0, r3, r0 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl FillWindowPixelBuffer -_081C2D56: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C2D2C - - thumb_func_start sub_81C2D68 -sub_81C2D68: @ 81C2D68 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CF1C - ldr r2, =0x000040cb - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081C2D8C - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_081C2D8C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2D68 - - thumb_func_start sub_81C2D9C -sub_81C2D9C: @ 81C2D9C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 -_081C2DA4: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040cb - adds r0, r1 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081C2DBA - movs r1, 0 - bl FillWindowPixelBuffer -_081C2DBA: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x7 - bls _081C2DA4 - ldr r0, =gUnknown_0861CE54 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2D9C - - thumb_func_start sub_81C2DE4 -sub_81C2DE4: @ 81C2DE4 - push {lr} - lsls r0, 24 - ldr r1, =gUnknown_0861CE64 - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x10 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2DE4 - - thumb_func_start sub_81C2E00 -sub_81C2E00: @ 81C2E00 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x74 - ldrb r0, [r0] - cmp r0, 0 - beq _081C2E24 - bl sub_81C335C - bl sub_81C33CC - bl sub_81C3428 - bl sub_81C349C - b _081C2E3C - .pool -_081C2E24: - bl sub_81C2EC4 - bl sub_81C2F5C - bl sub_81C2FD8 - bl sub_81C302C - bl sub_81C307C - bl sub_81C3194 -_081C2E3C: - pop {r0} - bx r0 - thumb_func_end sub_81C2E00 - - thumb_func_start sub_81C2E40 -sub_81C2E40: @ 81C2E40 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bhi _081C2EB8 - lsls r0, 2 - ldr r1, =_081C2E70 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C2E70: - .4byte _081C2E8C - .4byte _081C2E92 - .4byte _081C2E98 - .4byte _081C2E9E - .4byte _081C2EA4 - .4byte _081C2EAA - .4byte _081C2EB0 -_081C2E8C: - bl sub_81C2EC4 - b _081C2EB8 -_081C2E92: - bl sub_81C2F5C - b _081C2EB8 -_081C2E98: - bl sub_81C2FD8 - b _081C2EB8 -_081C2E9E: - bl sub_81C302C - b _081C2EB8 -_081C2EA4: - bl sub_81C307C - b _081C2EB8 -_081C2EAA: - bl sub_81C3194 - b _081C2EB8 -_081C2EB0: - adds r0, r2, 0 - bl DestroyTask - b _081C2EBE -_081C2EB8: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C2EBE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C2E40 - - thumb_func_start sub_81C2EC4 -sub_81C2EC4: @ 81C2EC4 - push {r4-r6,lr} - sub sp, 0x8 - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2F54 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2F54 - ldr r0, =gUnknown_0861CCCC - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gText_OTSlash - movs r6, 0 - str r6, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - bl GetStringWidth - adds r2, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xA2 - ldrb r0, [r0] - cmp r0, 0 - bne _081C2F40 - adds r1, 0xA6 - lsls r2, 24 - lsrs r2, 24 - str r6, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r3, 0x1 - bl sub_81C25A4 - b _081C2F54 - .pool -_081C2F40: - adds r1, 0xA6 - lsls r2, 24 - lsrs r2, 24 - str r6, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r3, 0x1 - bl sub_81C25A4 -_081C2F54: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C2EC4 - - thumb_func_start sub_81C2F5C -sub_81C2F5C: @ 81C2F5C - push {r4,r5,lr} - sub sp, 0x8 - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2FC0 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2FC0 - ldr r5, =gStringVar1 - ldr r1, =gText_UnkCtrlF907F908 - adds r0, r5, 0 - bl StringCopy - ldr r1, =gUnknown_0203CF1C - ldr r1, [r1] - adds r1, 0xB8 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x38 - bl GetStringRightAlignXOffset - adds r4, r0, 0 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 -_081C2FC0: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2F5C - - thumb_func_start sub_81C2FD8 -sub_81C2FD8: @ 81C2FD8 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x70 - ldrh r0, [r0] - adds r1, 0x78 - ldrb r1, [r1] - bl GetAbilityBySpecies - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xD - muls r1, r4 - ldr r2, =gAbilityNames - adds r1, r2 - movs r2, 0 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2FD8 - - thumb_func_start sub_81C302C -sub_81C302C: @ 81C302C - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x70 - ldrh r0, [r0] - adds r1, 0x78 - ldrb r1, [r1] - bl GetAbilityBySpecies - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gAbilityDescriptionPointers - lsls r4, 2 - adds r4, r1 - ldr r1, [r4] - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r3, 0x11 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C302C - - thumb_func_start sub_81C307C -sub_81C307C: @ 81C307C - push {r4-r6,lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r4, r0, 0 - adds r4, 0x70 - bl sub_81AFBF0 - ldr r1, =gUnknown_0861CE74 - movs r0, 0 - bl sub_81AFC0C - ldr r1, =gUnknown_0861CE7B - movs r0, 0x1 - bl sub_81AFC0C - bl sub_81C31C0 - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C30C2 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C30C2 - bl sub_81C3304 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C30E0 -_081C30C2: - ldr r0, =gStringVar4 - ldr r1, =gText_XNature - bl sub_81AFC28 - b _081C3182 - .pool -_081C30E0: - movs r0, 0x20 - bl Alloc - adds r6, r0, 0 - movs r0, 0x20 - bl Alloc - adds r5, r0, 0 - adds r0, r6, 0 - bl sub_81C31F0 - ldrb r0, [r4, 0x9] - cmp r0, 0xD4 - bhi _081C310C - adds r1, r0, 0 - adds r0, r5, 0 - bl sub_8124610 - movs r0, 0x4 - adds r1, r5, 0 - bl sub_81AFC0C -_081C310C: - bl sub_81C3220 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C3148 - ldrb r0, [r4, 0xA] - cmp r0, 0 - bne _081C3134 - ldrb r0, [r4, 0x9] - ldr r1, =gText_XNatureHatchedAtYZ - cmp r0, 0xD4 - bls _081C3170 - ldr r1, =gText_XNatureHatchedSomewhereAt - b _081C3170 - .pool -_081C3134: - ldrb r0, [r4, 0x9] - ldr r1, =gText_XNatureMetAtYZ - cmp r0, 0xD4 - bls _081C3170 - ldr r1, =gText_XNatureMetSomewhereAt - b _081C3170 - .pool -_081C3148: - ldrb r0, [r4, 0x9] - cmp r0, 0xFF - bne _081C3158 - ldr r1, =gText_XNatureFatefulEncounter - b _081C3170 - .pool -_081C3158: - cmp r0, 0xFE - beq _081C316E - bl sub_81C32BC - lsls r0, 24 - cmp r0, 0 - beq _081C316E - ldrb r0, [r4, 0x9] - ldr r1, =gText_XNatureProbablyMetAt - cmp r0, 0xD4 - bls _081C3170 -_081C316E: - ldr r1, =gText_XNatureObtainedInTrade -_081C3170: - ldr r0, =gStringVar4 - bl sub_81AFC28 - adds r0, r6, 0 - bl Free - adds r0, r5, 0 - bl Free -_081C3182: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C307C - - thumb_func_start sub_81C3194 -sub_81C3194: @ 81C3194 - push {lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x3 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gStringVar4 - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3194 - - thumb_func_start sub_81C31C0 -sub_81C31C0: @ 81C31C0 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =gNatureNamePointers - adds r0, 0xA3 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x2 - bl sub_81AFC0C - ldr r1, =gText_EmptyString5 - movs r0, 0x5 - bl sub_81AFC0C - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C31C0 - - thumb_func_start sub_81C31F0 -sub_81C31F0: @ 81C31F0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x7A - ldrb r1, [r0] - cmp r1, 0 - bne _081C3202 - movs r1, 0x5 -_081C3202: - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - movs r0, 0x3 - adds r1, r4, 0 - bl sub_81AFC0C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C31F0 - - thumb_func_start sub_81C3220 -sub_81C3220: @ 81C3220 - push {r4-r6,lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r6, r0, 0 - adds r6, 0x70 - ldr r1, [r0] - ldr r0, =gEnemyParty - cmp r1, r0 - bne _081C326C - bl GetMultiplayerId - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gLinkPlayers - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r0, r2, 0x4 - adds r0, r1, r0 - ldrh r4, [r0] - adds r0, r1, r2 - ldrb r5, [r0, 0x13] - ldr r0, =gStringVar1 - adds r2, 0x8 - adds r1, r2 - bl StringCopy - b _081C3282 - .pool -_081C326C: - bl GetPlayerIDAsU32 - adds r4, r0, 0 - ldr r0, =0x0000ffff - ands r4, r0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldrb r5, [r1, 0x8] - ldr r0, =gStringVar1 - bl StringCopy -_081C3282: - adds r0, r6, 0 - adds r0, 0x32 - ldrb r0, [r0] - cmp r5, r0 - bne _081C32A4 - ldr r0, [r6, 0x48] - ldr r1, =0x0000ffff - ands r0, r1 - cmp r4, r0 - bne _081C32A4 - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x36 - bl StringCompareWithoutExtCtrlCodes - cmp r0, 0 - beq _081C32B4 -_081C32A4: - movs r0, 0 - b _081C32B6 - .pool -_081C32B4: - movs r0, 0x1 -_081C32B6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C3220 - - thumb_func_start sub_81C32BC -sub_81C32BC: @ 81C32BC - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x70 - ldrb r0, [r0, 0xB] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _081C32D8 - movs r0, 0 - b _081C32DA - .pool -_081C32D8: - movs r0, 0x1 -_081C32DA: - pop {r1} - bx r1 - thumb_func_end sub_81C32BC - - thumb_func_start sub_81C32E0 -sub_81C32E0: @ 81C32E0 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x70 - ldrb r0, [r0, 0xB] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bls _081C32FC - movs r0, 0 - b _081C32FE - .pool -_081C32FC: - movs r0, 0x1 -_081C32FE: - pop {r1} - bx r1 - thumb_func_end sub_81C32E0 - - thumb_func_start sub_81C3304 -sub_81C3304: @ 81C3304 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _081C3354 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C3354 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C333A - cmp r0, 0x4 - beq _081C333A - cmp r0, 0x5 - bne _081C3354 -_081C333A: - movs r0, 0x1 - b _081C3356 - .pool -_081C3354: - movs r0, 0 -_081C3356: - pop {r1} - bx r1 - thumb_func_end sub_81C3304 - - thumb_func_start sub_81C335C -sub_81C335C: @ 81C335C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCCC - movs r1, 0 - bl sub_81C2D2C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gText_OTSlash - mov r8, r0 - movs r0, 0x1 - mov r1, r8 - movs r2, 0 - bl GetStringWidth - adds r5, r0, 0 - movs r0, 0 - mov r9, r0 - str r0, [sp] - movs r6, 0x1 - str r6, [sp, 0x4] - adds r0, r4, 0 - mov r1, r8 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_FiveMarks - lsls r5, 24 - lsrs r5, 24 - mov r0, r9 - str r0, [sp] - str r6, [sp, 0x4] - adds r0, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C335C - - thumb_func_start sub_81C33CC -sub_81C33CC: @ 81C33CC - push {r4,r5,lr} - sub sp, 0x8 - ldr r5, =gStringVar1 - ldr r1, =gText_UnkCtrlF907F908 - adds r0, r5, 0 - bl StringCopy - ldr r1, =gText_FiveMarks - adds r0, r5, 0 - bl StringAppend - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x38 - bl GetStringRightAlignXOffset - adds r4, r0, 0 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C33CC - - thumb_func_start sub_81C3428 -sub_81C3428: @ 81C3428 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x70 - adds r0, 0xA5 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C3448 - ldr r4, =gText_EggWillTakeALongTime - b _081C346C - .pool -_081C3448: - ldrh r0, [r1, 0x30] - cmp r0, 0x5 - bhi _081C3458 - ldr r4, =gText_EggAboutToHatch - b _081C346C - .pool -_081C3458: - cmp r0, 0xA - bhi _081C3464 - ldr r4, =gText_EggWillHatchSoon - b _081C346C - .pool -_081C3464: - ldr r4, =gText_EggWillTakeALongTime - cmp r0, 0x28 - bhi _081C346C - ldr r4, =gText_EggWillTakeSomeTime -_081C346C: - ldr r0, =gUnknown_0861CCCC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3428 - - thumb_func_start sub_81C349C -sub_81C349C: @ 81C349C - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r4, r0, 0 - adds r4, 0x70 - adds r0, 0xA5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C3500 - ldrb r0, [r4, 0x9] - cmp r0, 0xFF - bne _081C34C4 - ldr r4, =gText_PeculiarEggNicePlace - b _081C3502 - .pool -_081C34C4: - bl sub_81C32BC - lsls r0, 24 - cmp r0, 0 - beq _081C34D8 - bl sub_81C3220 - lsls r0, 24 - cmp r0, 0 - bne _081C34E0 -_081C34D8: - ldr r4, =gText_PeculiarEggTrade - b _081C3502 - .pool -_081C34E0: - ldrb r0, [r4, 0x9] - cmp r0, 0xFD - bne _081C3500 - bl sub_81C32E0 - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gText_EggFromTraveler - cmp r0, 0x1 - bne _081C3502 - ldr r4, =gText_EggFromHotSprings - b _081C3502 - .pool -_081C3500: - ldr r4, =gText_OddEggFoundByCouple -_081C3502: - ldr r0, =gUnknown_0861CCCC - movs r1, 0x3 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C349C - - thumb_func_start sub_81C3530 -sub_81C3530: @ 81C3530 - push {lr} - bl sub_81C35E4 - bl sub_81C3690 - bl sub_81C3710 - bl sub_81C37D8 - bl sub_81C3808 - bl sub_81C3890 - bl sub_81C38C0 - pop {r0} - bx r0 - thumb_func_end sub_81C3530 - - thumb_func_start sub_81C3554 -sub_81C3554: @ 81C3554 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bhi _081C35D6 - lsls r0, 2 - ldr r1, =_081C3584 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C3584: - .4byte _081C35A4 - .4byte _081C35AA - .4byte _081C35B0 - .4byte _081C35B6 - .4byte _081C35BC - .4byte _081C35C2 - .4byte _081C35C8 - .4byte _081C35CE -_081C35A4: - bl sub_81C35E4 - b _081C35D6 -_081C35AA: - bl sub_81C3690 - b _081C35D6 -_081C35B0: - bl sub_81C3710 - b _081C35D6 -_081C35B6: - bl sub_81C37D8 - b _081C35D6 -_081C35BC: - bl sub_81C3808 - b _081C35D6 -_081C35C2: - bl sub_81C3890 - b _081C35D6 -_081C35C8: - bl sub_81C38C0 - b _081C35D6 -_081C35CE: - adds r0, r2, 0 - bl DestroyTask - b _081C35DC -_081C35D6: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C35DC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C3554 - - thumb_func_start sub_81C35E4 -sub_81C35E4: @ 81C35E4 - push {r4,r5,lr} - sub sp, 0x8 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0x9E - ldrh r0, [r0] - cmp r0, 0xAF - bne _081C3628 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C3628 - ldr r0, [r4] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C3614 - cmp r0, 0x4 - beq _081C3614 - cmp r0, 0x5 - bne _081C3628 -_081C3614: - movs r0, 0xAF - bl ItemId_GetItem - adds r5, r0, 0 - b _081C3650 - .pool -_081C3628: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x9E - ldrh r0, [r1] - cmp r0, 0 - bne _081C3644 - ldr r5, =gText_None - b _081C3650 - .pool -_081C3644: - ldrh r0, [r1] - ldr r4, =gStringVar1 - adds r1, r4, 0 - bl CopyItemName - adds r5, r4, 0 -_081C3650: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x48 - bl GetStringCenterAlignXOffset - adds r4, r0, 0 - adds r4, 0x6 - ldr r0, =gUnknown_0861CCEC - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C35E4 - - thumb_func_start sub_81C3690 -sub_81C3690: @ 81C3690 - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x76 - ldrb r0, [r1] - cmp r0, 0 - bne _081C36B0 - ldr r5, =gText_None - b _081C36C8 - .pool -_081C36B0: - ldr r0, =gStringVar1 - ldrb r1, [r1] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gText_RibbonsVar1 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r5, r4, 0 -_081C36C8: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x46 - bl GetStringCenterAlignXOffset - adds r4, r0, 0 - adds r4, 0x6 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3690 - - thumb_func_start sub_81C3710 -sub_81C3710: @ 81C3710 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - movs r0, 0x8 - bl Alloc - mov r9, r0 - movs r0, 0x8 - bl Alloc - mov r8, r0 - movs r0, 0x8 - bl Alloc - adds r6, r0, 0 - movs r0, 0x8 - bl Alloc - adds r5, r0, 0 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0x90 - ldrh r1, [r0] - mov r0, r9 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - adds r0, 0x92 - ldrh r1, [r0] - mov r0, r8 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - adds r0, 0x94 - ldrh r1, [r0] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x7 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - adds r0, 0x96 - ldrh r1, [r0] - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x7 - bl ConvertIntToDecimalStringN - bl sub_81AFBF0 - movs r0, 0 - mov r1, r9 - bl sub_81AFC0C - movs r0, 0x1 - mov r1, r8 - bl sub_81AFC0C - movs r0, 0x2 - adds r1, r6, 0 - bl sub_81AFC0C - movs r0, 0x3 - adds r1, r5, 0 - bl sub_81AFC0C - ldr r0, =gStringVar4 - ldr r1, =gUnknown_0861CE82 - bl sub_81AFC28 - mov r0, r9 - bl Free - mov r0, r8 - bl Free - adds r0, r6, 0 - bl Free - adds r0, r5, 0 - bl Free - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3710 - - thumb_func_start sub_81C37D8 -sub_81C37D8: @ 81C37D8 - push {lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gStringVar4 - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r2, 0x4 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C37D8 - - thumb_func_start sub_81C3808 -sub_81C3808: @ 81C3808 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gStringVar1 - mov r8, r0 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0x98 - ldrh r1, [r0] - mov r0, r8 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r6, =gStringVar2 - ldr r0, [r4] - adds r0, 0x9A - ldrh r1, [r0] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar3 - ldr r0, [r4] - adds r0, 0x9C - ldrh r1, [r0] - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - bl sub_81AFBF0 - movs r0, 0 - mov r1, r8 - bl sub_81AFC0C - movs r0, 0x1 - adds r1, r6, 0 - bl sub_81AFC0C - movs r0, 0x2 - adds r1, r5, 0 - bl sub_81AFC0C - ldr r0, =gStringVar4 - ldr r1, =gUnknown_0861CE8E - bl sub_81AFC28 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3808 - - thumb_func_start sub_81C3890 -sub_81C3890: @ 81C3890 - push {lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x3 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gStringVar4 - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3890 - - thumb_func_start sub_81C38C0 -sub_81C38C0: @ 81C38C0 - push {r4-r6,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x4 - bl sub_81C2D2C - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =gStringVar1 - ldr r1, [r5, 0x10] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x7 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringRightAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldrb r0, [r5, 0x5] - cmp r0, 0x63 - bhi _081C3948 - ldr r4, =gExperienceTables - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 2 - ldr r3, =gBaseStats - ldrh r2, [r5] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r2, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r2 - adds r1, r0 - adds r1, r4 - ldr r1, [r1] - ldr r0, [r5, 0x10] - subs r1, r0 - b _081C394A - .pool -_081C3948: - movs r1, 0 -_081C394A: - ldr r4, =gStringVar1 - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x6 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringRightAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - adds r1, r4, 0 - movs r3, 0x11 - bl sub_81C25A4 - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C38C0 - - thumb_func_start sub_81C3984 -sub_81C3984: @ 81C3984 - push {r4,lr} - movs r0, 0 - bl sub_81C3B08 - movs r0, 0x1 - bl sub_81C3B08 - movs r0, 0x2 - bl sub_81C3B08 - movs r0, 0x3 - bl sub_81C3B08 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C39EA - bl sub_81C3F44 - ldr r1, [r4] - ldr r0, =0x000040c6 - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0x4 - bne _081C39DC - ldr r0, =0x000040c4 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _081C39EA - bl sub_81C3E9C - b _081C39EA - .pool -_081C39DC: - ldrb r0, [r2] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r0, [r1] - bl sub_81C3E9C -_081C39EA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C3984 - - thumb_func_start sub_81C39F0 -sub_81C39F0: @ 81C39F0 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bhi _081C3AFC - lsls r0, 2 - ldr r1, =_081C3A20 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C3A20: - .4byte _081C3A40 - .4byte _081C3A48 - .4byte _081C3A50 - .4byte _081C3A58 - .4byte _081C3A60 - .4byte _081C3A7C - .4byte _081C3ABE - .4byte _081C3AF4 -_081C3A40: - movs r0, 0 - bl sub_81C3B08 - b _081C3AFC -_081C3A48: - movs r0, 0x1 - bl sub_81C3B08 - b _081C3AFC -_081C3A50: - movs r0, 0x2 - bl sub_81C3B08 - b _081C3AFC -_081C3A58: - movs r0, 0x3 - bl sub_81C3B08 - b _081C3AFC -_081C3A60: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3AFC - bl sub_81C3F44 - b _081C3AFC - .pool -_081C3A7C: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3AFC - ldr r0, =0x000040c6 - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0x4 - bne _081C3AB0 - ldr r2, =0x000040c4 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r4, 0x2] - b _081C3AFC - .pool -_081C3AB0: - ldrb r0, [r2] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r0, [r1] - strh r0, [r4, 0x2] - b _081C3AFC -_081C3ABE: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3AFC - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C3AFC - ldrh r0, [r4, 0x2] - bl sub_81C3E9C - b _081C3AFC - .pool -_081C3AF4: - adds r0, r2, 0 - bl DestroyTask - b _081C3B02 -_081C3AFC: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C3B02: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C39F0 - - thumb_func_start sub_81C3B08 -sub_81C3B08: @ 81C3B08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - mov r10, r0 - ldr r4, =gUnknown_0861CD14 - adds r0, r4, 0 - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r1, r7, 1 - mov r0, r10 - adds r0, 0x84 - adds r0, r1 - ldrh r5, [r0] - cmp r5, 0 - beq _081C3C00 - mov r0, r10 - adds r0, 0xA4 - ldrb r1, [r0] - adds r0, r5, 0 - adds r2, r7, 0 - bl CalculatePPWithBonus - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0xD - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - lsls r0, r7, 4 - mov r9, r0 - mov r3, r9 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0 - bl sub_81C25A4 - ldr r0, =gStringVar1 - mov r8, r0 - mov r5, r10 - adds r5, 0x8C - adds r5, r7 - ldrb r1, [r5] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar2 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - bl sub_81AFBF0 - movs r0, 0 - mov r1, r8 - bl sub_81AFC0C - movs r0, 0x1 - adds r1, r4, 0 - bl sub_81AFC0C - ldr r4, =gStringVar4 - ldr r1, =gUnknown_0861CE97 - adds r0, r4, 0 - bl sub_81AFC28 - adds r7, r4, 0 - ldrb r0, [r5] - adds r1, r6, 0 - bl GetCurrentPpToMaxPpState - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - adds r5, 0x9 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x2C - bl GetStringRightAlignXOffset - mov r4, r9 - b _081C3C26 - .pool -_081C3C00: - ldr r1, =gText_OneDash - lsls r4, r7, 4 - adds r3, r4, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0 - bl sub_81C25A4 - ldr r7, =gText_TwoDashes - movs r5, 0xC - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x2C - bl GetStringCenterAlignXOffset -_081C3C26: - lsls r2, r0, 24 - lsrs r2, 24 - adds r3, r4, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - lsls r0, r5, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldr r0, [sp, 0x8] - adds r1, r7, 0 - bl sub_81C25A4 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3B08 - - thumb_func_start sub_81C3C5C -sub_81C3C5C: @ 81C3C5C - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _081C3CFC - movs r0, 0x13 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xE - movs r1, 0 - movs r2, 0x35 - movs r3, 0 - bl FillWindowPixelRect - ldr r2, =gBattleMoves - lsls r1, r5, 1 - adds r0, r1, r5 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x1] - adds r6, r1, 0 - cmp r0, 0x1 - bhi _081C3C9C - ldr r1, =gText_ThreeDashes - b _081C3CAC - .pool -_081C3C9C: - ldr r4, =gStringVar1 - ldrb r1, [r2, 0x1] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r1, r4, 0 -_081C3CAC: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0xE - movs r2, 0x35 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gBattleMoves - adds r0, r6, r5 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x3] - cmp r0, 0 - bne _081C3CDC - ldr r1, =gText_ThreeDashes - b _081C3CEC - .pool -_081C3CDC: - ldr r4, =gStringVar1 - ldrb r1, [r1, 0x3] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r1, r4, 0 -_081C3CEC: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0xE - movs r2, 0x35 - movs r3, 0x11 - bl sub_81C25A4 -_081C3CFC: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3C5C - - thumb_func_start sub_81C3D08 -sub_81C3D08: @ 81C3D08 - push {r4,lr} - movs r0, 0 - bl sub_81C3B08 - movs r0, 0x1 - bl sub_81C3B08 - movs r0, 0x2 - bl sub_81C3B08 - movs r0, 0x3 - bl sub_81C3B08 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3D40 - bl sub_81C3F44 - ldr r0, [r4] - ldr r1, =0x000040c6 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C3E2C -_081C3D40: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3D08 - - thumb_func_start sub_81C3D54 -sub_81C3D54: @ 81C3D54 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bhi _081C3E20 - lsls r0, 2 - ldr r1, =_081C3D84 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C3D84: - .4byte _081C3DA0 - .4byte _081C3DA8 - .4byte _081C3DB0 - .4byte _081C3DB8 - .4byte _081C3DC0 - .4byte _081C3DDC - .4byte _081C3E18 -_081C3DA0: - movs r0, 0 - bl sub_81C3B08 - b _081C3E20 -_081C3DA8: - movs r0, 0x1 - bl sub_81C3B08 - b _081C3E20 -_081C3DB0: - movs r0, 0x2 - bl sub_81C3B08 - b _081C3E20 -_081C3DB8: - movs r0, 0x3 - bl sub_81C3B08 - b _081C3E20 -_081C3DC0: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3E20 - bl sub_81C3F44 - b _081C3E20 - .pool -_081C3DDC: - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r1, =0x000040bc - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3E20 - adds r1, 0x8 - adds r0, r2, r1 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C3E20 - ldr r1, =0x000040c6 - adds r0, r2, r1 - ldrb r0, [r0] - bl sub_81C3E2C - b _081C3E20 - .pool -_081C3E18: - adds r0, r2, 0 - bl DestroyTask - b _081C3E26 -_081C3E20: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C3E26: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C3D54 - thumb_func_start sub_81C3E2C sub_81C3E2C: @ 81C3E2C push {r4,lr} diff --git a/asm/secret_base.s b/asm/secret_base.s index d433f5df2..69cfff512 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -1192,7 +1192,7 @@ _080E9462: mov r3, r10 ldrb r1, [r3] lsls r1, 5 - ldr r2, =gUnknown_085A5C24 + ldr r2, =gDecorations + 0x1c adds r1, r2 ldr r1, [r1] ldrh r1, [r1] diff --git a/asm/trader.s b/asm/trader.s index 8c21648fc..8e0b17905 100644 --- a/asm/trader.s +++ b/asm/trader.s @@ -351,7 +351,7 @@ sub_8133CF4: @ 8133CF4 ldr r5, =gScriptResult _08133CFA: adds r0, r4, 0 - bl sub_8161AD0 + bl CountDecorationCategoryN lsls r0, 24 cmp r0, 0 beq _08133D10 @@ -395,7 +395,7 @@ sub_8133D2C: @ 8133D2C cmp r1, r0 beq _08133D72 adds r0, r1, 0 - bl sub_81618D0 + bl GetFirstEmptyDecorSlot lsls r0, 24 asrs r0, 24 movs r1, 0x1 @@ -433,15 +433,15 @@ sub_8133DA0: @ 8133DA0 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 - bl sub_81279C4 + bl IsSelectedDecorInThePC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne _08133DFC ldr r5, =gSpecialVar_0x8006 - ldr r0, =gUnknown_0203A172 + ldr r0, =gCurDecorationIndex ldrb r1, [r0] - ldr r0, =gUnknown_0203A14C + ldr r0, =gCurDecorInventoryItems ldr r0, [r0] adds r0, r1 ldrb r0, [r0] diff --git a/data/cute_sketch.s b/data/cute_sketch.s index ebdf1e39d..8a8ee1481 100644 --- a/data/cute_sketch.s +++ b/data/cute_sketch.s @@ -5,4 +5,4 @@ .align 2, 0 gUnknown_085A1F94:: @ 85A1F94 - .incbin "baserom.gba", 0x5a1f94, 0x3c74 + .incbin "baserom.gba", 0x5a1f94, 0x2580 diff --git a/data/decoration.s b/data/decoration.s deleted file mode 100644 index de4478f8d..000000000 --- a/data/decoration.s +++ /dev/null @@ -1,86 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2, 0 - -gDecorations:: @ 85A5C08 - .incbin "baserom.gba", 0x5a5c08, 0x1c - -gUnknown_085A5C24:: @ 85A5C24 - .incbin "baserom.gba", 0x5a5c24, 0xf04 - -gUnknown_085A6B28:: @ 85A6B28 - .incbin "baserom.gba", 0x5a6b28, 0x20 - -gUnknown_085A6B48:: @ 85A6B48 - .incbin "baserom.gba", 0x5a6b48, 0x20 - -gUnknown_085A6B68:: @ 85A6B68 - .incbin "baserom.gba", 0x5a6b68, 0x10 - -gUnknown_085A6B78:: @ 85A6B78 - .incbin "baserom.gba", 0x5a6b78, 0x18 - -gUnknown_085A6B90:: @ 85A6B90 - .incbin "baserom.gba", 0x5a6b90, 0x20 - -gUnknown_085A6BB0:: @ 85A6BB0 - .incbin "baserom.gba", 0x5a6bb0, 0x20 - -gUnknown_085A6BD0:: @ 85A6BD0 - .incbin "baserom.gba", 0x5a6bd0, 0x18 - -gUnknown_085A6BE8:: @ 85A6BE8 - .incbin "baserom.gba", 0x5a6be8, 0x5c8 - -gUnknown_085A71B0:: @ 85A71B0 - .incbin "baserom.gba", 0x5a71b0, 0xa0 - -gUnknown_085A7250:: @ 85A7250 - .incbin "baserom.gba", 0x5a7250, 0x3c - -gUnknown_085A728C:: @ 85A728C - .incbin "baserom.gba", 0x5a728c, 0x18 - -gUnknown_085A72A4:: @ 85A72A4 - .incbin "baserom.gba", 0x5a72a4, 0x18 - -gUnknown_085A72BC:: @ 85A72BC - .incbin "baserom.gba", 0x5a72bc, 0x8 - -gUnknown_085A72C4:: @ 85A72C4 - .incbin "baserom.gba", 0x5a72c4, 0x8 - -gUnknown_085A72CC:: @ 85A72CC - .incbin "baserom.gba", 0x5a72cc, 0x8 - -gUnknown_085A72D4:: @ 85A72D4 - .incbin "baserom.gba", 0x5a72d4, 0x10 - -gUnknown_085A72E4:: @ 85A72E4 - .incbin "baserom.gba", 0x5a72e4, 0x8 - -gUnknown_085A72EC:: @ 85A72EC - .incbin "baserom.gba", 0x5a72ec, 0x8 - -gUnknown_085A72F4:: @ 85A72F4 - .incbin "baserom.gba", 0x5a72f4, 0x54 - -gUnknown_085A7348:: @ 85A7348 - .incbin "baserom.gba", 0x5a7348, 0x8 - -gUnknown_085A7350:: @ 85A7350 - .incbin "baserom.gba", 0x5a7350, 0x88 - -gUnknown_085A73D8:: @ 85A73D8 - .incbin "baserom.gba", 0x5a73d8, 0x8 - -gUnknown_085A73E0:: @ 85A73E0 - .incbin "baserom.gba", 0x5a73e0, 0x24 - -gUnknown_085A7404:: @ 85A7404 - .incbin "baserom.gba", 0x5a7404, 0x18 - -gUnknown_085A741C:: @ 85A741C - .incbin "baserom.gba", 0x5a741c, 0x8 diff --git a/data/graphics.s b/data/graphics.s index bf0e3173b..e89177a1d 100644 --- a/data/graphics.s +++ b/data/graphics.s @@ -881,7 +881,10 @@ gUnknown_08DAAFEC:: @ 8DAAFEC .include "data/graphics/items/item_graphics.inc" @ 8DB7AA0 - .incbin "baserom.gba", 0xdb7aa0, 0x2a78 + .include "data/graphics/decorations/decoration_graphics.inc" + +@ 8DBA14C + .incbin "baserom.gba", 0xdba14c, 0x3cc gUnknown_08DBA518:: @ 8DBA518 .incbin "baserom.gba", 0xdba518, 0x80 diff --git a/data/graphics/decorations/decoration_graphics.inc b/data/graphics/decorations/decoration_graphics.inc new file mode 100644 index 000000000..c7ea9be70 --- /dev/null +++ b/data/graphics/decorations/decoration_graphics.inc @@ -0,0 +1,252 @@ +gUnknown_08DB7AA0:: + .incbin "graphics/decorations/decor_heavy_desk.4bpp.lz" + +gUnknown_08DB7B34:: + .incbin "graphics/decorations/decor_heavy_desk.gbapal.lz" + +gUnknown_08DB7B5C:: + .incbin "graphics/decorations/decor_ragged_desk.4bpp.lz" + +gUnknown_08DB7BEC:: + .incbin "graphics/decorations/decor_ragged_desk.gbapal.lz" + +gUnknown_08DB7C08:: + .incbin "graphics/decorations/decor_comfort_desk.4bpp.lz" + +gUnknown_08DB7CE8:: + .incbin "graphics/decorations/decor_comfort_desk.gbapal.lz" + +gUnknown_08DB7D08:: + .incbin "graphics/decorations/decor_pretty_desk.4bpp.lz" + +gUnknown_08DB7DCC:: + .incbin "graphics/decorations/decor_pretty_desk.gbapal.lz" + +gUnknown_08DB7DF4:: + .incbin "graphics/decorations/decor_brick_desk.4bpp.lz" + +gUnknown_08DB7EA0:: + .incbin "graphics/decorations/decor_brick_desk.gbapal.lz" + +gUnknown_08DB7EC4:: + .incbin "graphics/decorations/decor_camp_desk.4bpp.lz" + +gUnknown_08DB7F60:: + .incbin "graphics/decorations/decor_camp_desk.gbapal.lz" + +gUnknown_08DB7F7C:: + .incbin "graphics/decorations/decor_hard_desk.4bpp.lz" + +gUnknown_08DB8070:: + .incbin "graphics/decorations/decor_hard_desk.gbapal.lz" + +gUnknown_08DB808C:: + .incbin "graphics/decorations/decor_red_plant.4bpp.lz" + +gUnknown_08DB8138:: + .incbin "graphics/decorations/decor_red_plant.gbapal.lz" + +gUnknown_08DB8160:: + .incbin "graphics/decorations/decor_tropical_plant.4bpp.lz" + +gUnknown_08DB8218:: + .incbin "graphics/decorations/decor_tropical_plant.gbapal.lz" + +gUnknown_08DB823C:: + .incbin "graphics/decorations/decor_pretty_flowers.4bpp.lz" + +gUnknown_08DB8300:: + .incbin "graphics/decorations/decor_pretty_flowers.gbapal.lz" + +gUnknown_08DB8328:: + .incbin "graphics/decorations/decor_colorful_plant.4bpp.lz" + +gUnknown_08DB8430:: + .incbin "graphics/decorations/decor_colorful_plant.gbapal.lz" + +gUnknown_08DB8458:: + .incbin "graphics/decorations/decor_big_plant.4bpp.lz" + +gUnknown_08DB8528:: + .incbin "graphics/decorations/decor_big_plant.gbapal.lz" + +gUnknown_08DB854C:: + .incbin "graphics/decorations/decor_gorgeous_plant.4bpp.lz" + +gUnknown_08DB862C:: + .incbin "graphics/decorations/decor_gorgeous_plant.gbapal.lz" + +gUnknown_08DB8654:: + .incbin "graphics/decorations/decor_red_brick.4bpp.lz" + +gUnknown_08DB86C4:: + .incbin "graphics/decorations/decor_red_brick.gbapal.lz" + +gUnknown_08DB86E0:: + .incbin "graphics/decorations/decor_yellow_brick.4bpp.lz" + +gUnknown_08DB8750:: + .incbin "graphics/decorations/decor_yellow_brick.gbapal.lz" + +gUnknown_08DB876C:: + .incbin "graphics/decorations/decor_blue_brick.4bpp.lz" + +gUnknown_08DB87DC:: + .incbin "graphics/decorations/decor_blue_brick.gbapal.lz" + +gUnknown_08DB87F8:: + .incbin "graphics/decorations/decor_red_tent.4bpp.lz" + +gUnknown_08DB88D8:: + .incbin "graphics/decorations/decor_red_tent.gbapal.lz" + +gUnknown_08DB8900:: + .incbin "graphics/decorations/decor_blue_tent.4bpp.lz" + +gUnknown_08DB89E0:: + .incbin "graphics/decorations/decor_blue_tent.gbapal.lz" + +gUnknown_08DB8A08:: + .incbin "graphics/decorations/decor_solid_board.4bpp.lz" + +gUnknown_08DB8A68:: + .incbin "graphics/decorations/decor_solid_board.gbapal.lz" + +gUnknown_08DB8A84:: + .incbin "graphics/decorations/decor_slide.4bpp.lz" + +gUnknown_08DB8B40:: + .incbin "graphics/decorations/decor_slide.gbapal.lz" + +gUnknown_08DB8B68:: + .incbin "graphics/decorations/decor_tire.4bpp.lz" + +gUnknown_08DB8C40:: + .incbin "graphics/decorations/decor_tire.gbapal.lz" + +gUnknown_08DB8C5C:: + .incbin "graphics/decorations/decor_stand.4bpp.lz" + +gUnknown_08DB8CF4:: + .incbin "graphics/decorations/decor_stand.gbapal.lz" + +gUnknown_08DB8D18:: + .incbin "graphics/decorations/decor_breakable_door.4bpp.lz" + +gUnknown_08DB8DB0:: + .incbin "graphics/decorations/decor_breakable_door.gbapal.lz" + +gUnknown_08DB8DD4:: + .incbin "graphics/decorations/decor_sand_ornament.4bpp.lz" + +gUnknown_08DB8E80:: + .incbin "graphics/decorations/decor_sand_ornament.gbapal.lz" + +gUnknown_08DB8EA0:: + .incbin "graphics/decorations/decor_glass_ornament.4bpp.lz" + +gUnknown_08DB8F58:: + .incbin "graphics/decorations/decor_glass_ornament.gbapal.lz" + +gUnknown_08DB8F7C:: + .incbin "graphics/decorations/decor_surf_mat.4bpp.lz" + +gUnknown_08DB9038:: + .incbin "graphics/decorations/decor_surf_mat.gbapal.lz" + +gUnknown_08DB9058:: + .incbin "graphics/decorations/decor_thunder_mat.4bpp.lz" + +gUnknown_08DB9130:: + .incbin "graphics/decorations/decor_thunder_mat.gbapal.lz" + +gUnknown_08DB9154:: + .incbin "graphics/decorations/decor_fire_blast_mat.4bpp.lz" + +gUnknown_08DB9218:: + .incbin "graphics/decorations/decor_fire_blast_mat.gbapal.lz" + +gUnknown_08DB9234:: + .incbin "graphics/decorations/decor_powder_snow_mat.4bpp.lz" + +gUnknown_08DB92FC:: + .incbin "graphics/decorations/decor_powder_snow_mat.gbapal.lz" + +gUnknown_08DB931C:: + .incbin "graphics/decorations/decor_attract_mat.4bpp.lz" + +gUnknown_08DB93E8:: + .incbin "graphics/decorations/decor_attract_mat.gbapal.lz" + +gUnknown_08DB940C:: + .incbin "graphics/decorations/decor_fissure_mat.4bpp.lz" + +gUnknown_08DB94CC:: + .incbin "graphics/decorations/decor_fissure_mat.gbapal.lz" + +gUnknown_08DB94E8:: + .incbin "graphics/decorations/decor_spikes_mat.4bpp.lz" + +gUnknown_08DB95AC:: + .incbin "graphics/decorations/decor_spikes_mat.gbapal.lz" + +gUnknown_08DB95D0:: + .incbin "graphics/decorations/decor_snorlax_doll.4bpp.lz" + +gUnknown_08DB96C4:: + .incbin "graphics/decorations/decor_snorlax_doll.gbapal.lz" + +gUnknown_08DB96EC:: + .incbin "graphics/decorations/decor_rhydon_doll.4bpp.lz" + +gUnknown_08DB97F4:: + .incbin "graphics/decorations/decor_rhydon_doll.gbapal.lz" + +gUnknown_08DB981C:: + .incbin "graphics/decorations/decor_lapras_doll.4bpp.lz" + +gUnknown_08DB9908:: + .incbin "graphics/decorations/decor_lapras_doll.gbapal.lz" + +gUnknown_08DB9930:: + .incbin "graphics/decorations/decor_venusaur_doll.4bpp.lz" + +gUnknown_08DB9A54:: + .incbin "graphics/decorations/decor_venusaur_doll.gbapal.lz" + +gUnknown_08DB9A7C:: + .incbin "graphics/decorations/decor_charizard_doll.4bpp.lz" + +gUnknown_08DB9B7C:: + .incbin "graphics/decorations/decor_charizard_doll.gbapal.lz" + +gUnknown_08DB9BA4:: + .incbin "graphics/decorations/decor_blastoise_doll.4bpp.lz" + +gUnknown_08DB9CB0:: + .incbin "graphics/decorations/decor_blastoise_doll.gbapal.lz" + +gUnknown_08DB9CD8:: + .incbin "graphics/decorations/decor_wailmer_doll.4bpp.lz" + +gUnknown_08DB9DAC:: + .incbin "graphics/decorations/decor_wailmer_doll.gbapal.lz" + +gUnknown_08DB9DD4:: + .incbin "graphics/decorations/decor_regice_doll.4bpp.lz" + +gUnknown_08DB9EE4:: + .incbin "graphics/decorations/decor_regice_doll.gbapal.lz" + +gUnknown_08DB9F08:: + .incbin "graphics/decorations/decor_regirock_doll.4bpp.lz" + +gUnknown_08DB9FFC:: + .incbin "graphics/decorations/decor_regirock_doll.gbapal.lz" + +gUnknown_08DBA020:: + .incbin "graphics/decorations/decor_registeel_doll.4bpp.lz" + +gUnknown_08DBA12C:: + .incbin "graphics/decorations/decor_registeel_doll.gbapal.lz" + diff --git a/data/pokemon_summary_screen.s b/data/pokemon_summary_screen.s index ac28d47c5..fc1c79096 100644 --- a/data/pokemon_summary_screen.s +++ b/data/pokemon_summary_screen.s @@ -40,7 +40,10 @@ gUnknown_0861CD14:: @ 861CD14 .incbin "baserom.gba", 0x61cd14, 0x18 gUnknown_0861CD2C:: @ 861CD2C - .incbin "baserom.gba", 0x61cd2c, 0xa7 + .incbin "baserom.gba", 0x61cd2c, 0x27 + +gUnknown_0861CD53:: @ 861CD53 + .incbin "baserom.gba", 0x61cd53, 0x80 gUnknown_0861CDD3:: @ 861CDD3 .incbin "baserom.gba", 0x61cdd3, 0x81 diff --git a/data/strings.s b/data/strings.s index 90ccad90f..2b88c6d03 100644 --- a/data/strings.s +++ b/data/strings.s @@ -1517,52 +1517,52 @@ gUnknown_085EA79D:: @ 85EA79D gUnknown_085EA7A9:: @ 85EA7A9 .string "{STR_VAR_3}{STR_VAR_1}/{STR_VAR_2}$" -gUnknown_085EA7B1:: @ 85EA7B1 +gText_Decorate:: @ 85EA7B1 .string "DECORATE$" -gUnknown_085EA7BA:: @ 85EA7BA +gText_PutAway:: @ 85EA7BA .string "PUT AWAY$" -gUnknown_085EA7C3:: @ 85EA7C3 +gText_Toss2:: @ 85EA7C3 .string "TOSS$" gText_Color161Shadow161:: @ 85EA7C8 .string "{COLOR 161}{SHADOW 161}$" -gUnknown_085EA7CF:: @ 85EA7CF +gText_PutOutSelectedDecorItem:: @ 85EA7CF .string "Put out the selected decoration item.$" -gUnknown_085EA7F5:: @ 85EA7F5 +gText_StoreChosenDecorInPC:: @ 85EA7F5 .string "Store the chosen decoration in the PC.$" -gUnknown_085EA81C:: @ 85EA81C +gText_ThrowAwayUnwantedDecors:: @ 85EA81C .string "Throw away unwanted decorations.$" gText_NoDecorations:: @ 85EA83D .string "There are no decorations.{PAUSE_UNTIL_PRESS}$" -gUnknown_085EA859:: @ 85EA859 +gText_Desk:: @ 85EA859 .string "DESK$" -gUnknown_085EA85E:: @ 85EA85E +gText_Chair:: @ 85EA85E .string "CHAIR$" -gUnknown_085EA864:: @ 85EA864 +gText_Plant:: @ 85EA864 .string "PLANT$" -gUnknown_085EA86A:: @ 85EA86A +gText_Ornament:: @ 85EA86A .string "ORNAMENT$" -gUnknown_085EA873:: @ 85EA873 +gText_Mat:: @ 85EA873 .string "MAT$" -gUnknown_085EA877:: @ 85EA877 +gText_Poster:: @ 85EA877 .string "POSTER$" -gUnknown_085EA87E:: @ 85EA87E +gText_Doll:: @ 85EA87E .string "DOLL$" -gUnknown_085EA883:: @ 85EA883 +gText_Cushion:: @ 85EA883 .string "CUSHION$" gText_Gold:: @ 85EA88B diff --git a/graphics/decorations/decor_attract_mat.pal b/graphics/decorations/decor_attract_mat.pal new file mode 100644 index 000000000..6f188b725 --- /dev/null +++ b/graphics/decorations/decor_attract_mat.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +255 230 222 +255 197 197 +246 156 156 +213 115 172 +197 189 131 +246 148 205 +123 82 74 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +246 246 246 +0 0 0 diff --git a/graphics/decorations/decor_attract_mat.png b/graphics/decorations/decor_attract_mat.png new file mode 100644 index 0000000000000000000000000000000000000000..16528d9f393ad2658efd5f61b6796e524b731885 GIT binary patch literal 307 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?FfxQ3E?)^V{ z^xK>{SBuvi-P`-VpAIN&13a-`TY$KkHrw zyF5J-Q2DmYc6*4G-_GmD{;Vj|k~rhmbIUh7>A2?is4B*1at*&GZ+twZI$UYf#GsB!VDxWD_33tQU(D&A+AYBlMD?FfxNxXvZ~j3 zMRhw`CTU*XlC`Bfs5{9p$Wj3)g$#TOX2%2hj3q&S!3+-1ZlnP@TRdGHLnNk__Sy0s zGT>>A&%40m*pY2w-f=RHGu_>*irsD7Ay$Q)oD0E8pN&OMP5yMU?`=A>{iaW6+#Yx| zsT9nyH`R=i*I}CI{^4Nrt!Vm=E>>aFRSI%_g7a=m8t zQ|I+)@t6|m<&|)eTXQN?dT#scznc#2%4wW;bl%l@lXLvehy1(vlJ)FwHRGdu`W{yt s&Xg##xL$Q&(>2?kt!K;QjgQ*fGCU2|kiBqV2_wjJp00i_>zopr0C^U30ssI2 literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_blastoise_doll.pal b/graphics/decorations/decor_blastoise_doll.pal new file mode 100644 index 000000000..a4ad56936 --- /dev/null +++ b/graphics/decorations/decor_blastoise_doll.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +197 222 255 +131 189 255 +90 139 213 +57 90 131 +213 156 90 +230 189 131 +156 131 90 +98 82 41 +139 90 74 +0 0 0 +0 0 0 +0 0 0 +246 246 246 +0 0 0 diff --git a/graphics/decorations/decor_blastoise_doll.png b/graphics/decorations/decor_blastoise_doll.png new file mode 100644 index 0000000000000000000000000000000000000000..00c55f229e4b92e8f120c578cb39af78c3fe081b GIT binary patch literal 371 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?FkKX&=y!U@p z_f^ZN=Bsm}p6zX((;Sr)q}d(i1yl$D-@bhVGFp{6YJe1DNswPKgTu2MX+X|LPZ!4! ziK(F%_WB(*kZ65q&dfY}u1VmjfKEm6hL~$!s(lf^&8Mgau^AaC7`pb{JakP#(RBNS z-Ao5-KkV!bv6wXfq}{i4iN&d#ffuKU+EeqH({^)qwgv;)_kXa`N!e$)9Ta$-h2+Xt~vCuT-EBm~ch zuzqxN>2G$^o&c{7nef{C!sfn*w`8VF2$Q#1F7bNG>fm*mPwMaL|5{^}s%aV{1PU2X LS3j3^P6B!VDxWD_33tQU(D&A+AYBlMD?F=WO{F)cnjc zX|IH1b5>TCmzNh%9xD)=|2Z8f!B`UH7tG-B>_!@pli=y%7$Pw>Il+OgN5P3hoRPK3 z;lKhG79O`_Zf+hr290bi1%f|xn1l~0II-NVFsbfsY&giuQ4rmdxt^m#pj|krz)-M4 y!oYz?S5sfJT|hHaGgH9OfRT^+k6g=5Hbw?lX^~4OUHD#uT;%EM=d#Wzp$Py>;yDBW literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_blue_tent.pal b/graphics/decorations/decor_blue_tent.pal new file mode 100644 index 000000000..e38cb56af --- /dev/null +++ b/graphics/decorations/decor_blue_tent.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +148 172 255 +115 139 238 +65 90 189 +49 57 123 +0 0 0 +197 205 230 +164 164 164 +131 131 131 +90 82 74 +0 0 0 +0 0 0 +0 0 0 +246 246 246 +0 0 0 diff --git a/graphics/decorations/decor_blue_tent.png b/graphics/decorations/decor_blue_tent.png new file mode 100644 index 0000000000000000000000000000000000000000..575b352410675d85ddb97ad49f62c1765868765e GIT binary patch literal 321 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?Fr>yy3-2Kim zYOkSXHBjd0*=I|ZENO0TjtcSuav|W`w{Jj(V*ddhAjMb`IGe(rTTq4?z1wTruT=9k<*mVPO7;qp?UFYXWYd{k%l z+Ny1`PgB13tftFo!iRXz_-~BsgM%L|Ij0y3@~5Y( KpUXO@geCw*tbV%y literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_breakable_door.pal b/graphics/decorations/decor_breakable_door.pal new file mode 100644 index 000000000..85ece26dc --- /dev/null +++ b/graphics/decorations/decor_breakable_door.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +139 189 255 +106 156 213 +213 189 115 +156 131 41 +123 98 8 +90 74 57 +189 164 74 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +246 246 246 +197 197 197 diff --git a/graphics/decorations/decor_breakable_door.png b/graphics/decorations/decor_breakable_door.png new file mode 100644 index 0000000000000000000000000000000000000000..01ba82d28a09d169f52be1765db7262dfc46372e GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?FfxPa$|Fh;? zy}Gw}PP1lp5=WGm<=!P;Kyf(u_U+rzqeodpM0J5ej3q&S!3+-1ZlnP@6FglULnNl= zp5M#cV!*?iu>L{Y<+Be(BNT<+nhGjkIPAG)%FPd2mzF90aA$kk((ONS(sb;TM zXw&=_yTDuF!utDv`t?n7+rlNaD&ysm>Ip5cwLxz8 MboFyt=akR{06ej44*&oF literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_brick_desk.pal b/graphics/decorations/decor_brick_desk.pal new file mode 100644 index 000000000..16b581470 --- /dev/null +++ b/graphics/decorations/decor_brick_desk.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +255 180 82 +230 139 49 +189 90 16 +0 0 0 +0 0 0 +0 0 0 +197 197 197 +148 148 156 +106 106 98 +74 74 74 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_brick_desk.png b/graphics/decorations/decor_brick_desk.png new file mode 100644 index 0000000000000000000000000000000000000000..829e453497ddbd2e0b7d9ad95c5380ef81c1e4d6 GIT binary patch literal 270 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?FfxQ1)f}V97 z?u`-vvLWE;(W6tQ%*o11^78V6i7`aT1nmWK7)yfuf*Bm1-ADs+dOTemLnNlw_U{&K zG2n5zZrLasFX?h_YCwbVt)?Ta0Sp@_Ydg5!je1smhCzDI$G&U77?$r6U{E)nSX}FC zy~_pyqa+&l$~Dr>%?Mo2bsviD8Z@0>)*mnAQyYO`njxgN@xNA D;RRo; literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_camp_desk.pal b/graphics/decorations/decor_camp_desk.pal new file mode 100644 index 000000000..0ac362c8a --- /dev/null +++ b/graphics/decorations/decor_camp_desk.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +205 189 123 +172 156 90 +148 131 65 +123 98 32 +82 57 41 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_camp_desk.png b/graphics/decorations/decor_camp_desk.png new file mode 100644 index 0000000000000000000000000000000000000000..b40429229a2b1b6377837b0d8b768d397c482166 GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?F&+e^WGbd_F zvtxCVLXf2wUQtVc^uvO%NQJ6w(>ke&0>5rddTAM;vJ`mPm zU0fD-Uz%g*-o{@i8uoESZ?69Nx>d4KJhdfmLgBpAYIeV-%wu2hg-dtw*Vxc>o;2c0gB_YLuFAYU2y(lptDnm{r-UW|$MIYF literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_charizard_doll.pal b/graphics/decorations/decor_charizard_doll.pal new file mode 100644 index 000000000..3e3e6bb79 --- /dev/null +++ b/graphics/decorations/decor_charizard_doll.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +238 172 98 +255 205 74 +222 156 41 +115 74 24 +164 98 24 +0 0 0 +230 82 65 +180 49 32 +0 0 0 +0 0 0 +0 0 0 +246 246 246 +255 238 197 diff --git a/graphics/decorations/decor_charizard_doll.png b/graphics/decorations/decor_charizard_doll.png new file mode 100644 index 0000000000000000000000000000000000000000..ffc3dfcef7b512e93dd7104f91e717dbfdd76a82 GIT binary patch literal 349 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?FfxLHXlK!9d zx;IC&*h^wbk_1rXS&-uvLj@oM0=|9w_W#{cUuBu+Kt5whkY6x^!?PP{K+bJX7sn8Z zsk!G3vzQG9STC$k%g!}ivYB7;1ZT=p6Xt(LI}ErdhAiPe(!SAJTyswJ(i4n4mJV)Z zK0y%++EtdUmwfQAz)U^agK3J!{^j>7J+!z20}b4oRr{s*6XI5AQhgG~4v>4eOs~&rDM44}aA?_FC7@UWi|D&m);bGEz+n?Ew#?i~mbP0l+XkKQxJx= literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_colorful_plant.pal b/graphics/decorations/decor_colorful_plant.pal new file mode 100644 index 000000000..996b183d2 --- /dev/null +++ b/graphics/decorations/decor_colorful_plant.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +205 180 115 +180 139 98 +131 90 57 +156 222 90 +139 189 139 +98 148 98 +41 90 57 +106 189 255 +255 123 172 +255 213 74 +0 0 0 +238 238 238 +0 0 0 diff --git a/graphics/decorations/decor_colorful_plant.png b/graphics/decorations/decor_colorful_plant.png new file mode 100644 index 0000000000000000000000000000000000000000..cc0efecc7461945f36207b1333691ed8fcecfb2e GIT binary patch literal 371 zcmV-(0gV2MP)>w2NYcS~;BFT8q7lVw7SjS~+UH|Nnce|J6zW008dp?f?J)fCl?%00001 zbW%=J06^y0W&i*H@kvBMR2Y?AkTGt;FcgM=k8F-qxo{3nPzi3p1+uh4Oe}R;x-iAw zUl(x!rdS)Jm{my!sOB!VDxWD_33tQU(D&A+AYBlMD?Fx7_RQ-rF73 z9ib~XgS6>JD)YH|^Wt~$(69C-{ Bd-4DP literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_fire_blast_mat.pal b/graphics/decorations/decor_fire_blast_mat.pal new file mode 100644 index 000000000..ea2301df2 --- /dev/null +++ b/graphics/decorations/decor_fire_blast_mat.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +255 180 82 +238 148 41 +213 98 24 +139 65 41 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_fire_blast_mat.png b/graphics/decorations/decor_fire_blast_mat.png new file mode 100644 index 0000000000000000000000000000000000000000..510675ee62365ac87e8c4f3e242318fc9a7b7db5 GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?FfxQ1)g5FKh zyqYA@?WhUl;sSG*m(~I07)yfuf*Bm1-ADs+=6bp~hDb~eop6x1#ej#!m;J*7smSF` zFxop*lcM!$XacMIElwgbFB zxmP=EZVFk}zg95arT>+^n{7mKB=ccu7nSH$&5U=}R!T(|vNPKpKVW_7Mpv|Opqv0Z zb4Api%VBpCRm>y#;%Dx6b1M>d-e+{(e#W`hiFZ;e?Vi2=$=t9(BTghVbUnyNp00i_ I>zopr01)G1-2eap literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_fissure_mat.pal b/graphics/decorations/decor_fissure_mat.pal new file mode 100644 index 000000000..d2a4efb6d --- /dev/null +++ b/graphics/decorations/decor_fissure_mat.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +205 189 131 +189 172 106 +156 139 74 +123 106 41 +98 74 32 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_fissure_mat.png b/graphics/decorations/decor_fissure_mat.png new file mode 100644 index 0000000000000000000000000000000000000000..6de66ef9d6b8a03746a29b989a64a1f5e75294d7 GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?F&+cvByC!Q+ zw^wzRW|EfzP!bpL{oR}llw&Lj@(X5gcy=QV$XVd&;us<^HFUy3-a`gFuJ!tJRvux= zi%<|_ez1dC#C6W;#=qeQe!Au+Yx-~8FY=nz;=1~|0A}-U?~@0%XOt}ZUn3J9@|{)f zk-^z*iPNebi{|_FujTb_j%WUrGb4Fc@R#YY+72#ZGb!zm41VW3iDk2$%w)H!2IFOS zUjJi@6Y^emrxD2BEqSqb+HC!^yBA$l^oXDJnZIw5;N6U!Z=TiuW%zMSts*PH`!>i^ Mp00i_>zopr08^%Ed;kCd literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_glass_ornament.pal b/graphics/decorations/decor_glass_ornament.pal new file mode 100644 index 000000000..1027a9501 --- /dev/null +++ b/graphics/decorations/decor_glass_ornament.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +0 0 0 +189 230 255 +156 197 255 +115 164 238 +82 139 189 +57 98 131 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +238 246 246 +0 0 0 diff --git a/graphics/decorations/decor_glass_ornament.png b/graphics/decorations/decor_glass_ornament.png new file mode 100644 index 0000000000000000000000000000000000000000..fcc895eb9f0b622bdd5f0bf63de4ba3f4b279dca GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?Ffjl7C`|SUm zqyLMSybJ2yYnjvx5rmWPzI_9-BPO5Q52P4Ng8YIR9G=}s19BF5x;TbNOwH{-$aTm- zz-764KkpTOA+ri$uDe%Ow>MpvOIpVz_Isi2cj-I1B^O^g+~YfGi%Tw-}D$wh9 z&c|Fv?b8e!^A9zNTMF+VbbVABktrd%WLy1S(fX?CyW2za0uAI1e@Fxbp3Ydot5Evn zXl0+QMXOzTjA**+T8o+5_TAHd9JJffblO{UX`G;{ooSFKi&&~f;JxT$@1(aL+-p5w Whf#g1yiRN>$Tyy@elF{r5}E)d=VuWB literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_gorgeous_plant.pal b/graphics/decorations/decor_gorgeous_plant.pal new file mode 100644 index 000000000..782b82eef --- /dev/null +++ b/graphics/decorations/decor_gorgeous_plant.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +180 222 139 +139 180 139 +90 139 106 +49 82 41 +0 0 0 +148 115 82 +115 82 24 +0 0 0 +230 230 230 +164 164 164 +106 106 106 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_gorgeous_plant.png b/graphics/decorations/decor_gorgeous_plant.png new file mode 100644 index 0000000000000000000000000000000000000000..dc8639c65719314c01888a632ea76484553f2fbc GIT binary patch literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?Fx7_RQ-qIb_ zon;uL36z;q98?@60c1RT_H4(f%)3^gO_b^{s^5Ear3)wrewzGN{PkVH1Yu=q#OXoO8TJy57D)LRmE04Q;+{=6G1lH(r zYK9+*k)0;AFrqOs({}qeagN6pJUaZdMYnGCs;ktVa#rzj%$ok)rg!!oS{1cKtaM4G z%hlUCmX|&;Wu2dDare_hsfS5=$LD@1+`j+0`;)o%FTd>e7muE(`&W8dbY1*oBc6W@ XH~ck^{j)2d1@f$?tDnm{r-UW|7@LZd literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_hard_desk.pal b/graphics/decorations/decor_hard_desk.pal new file mode 100644 index 000000000..7aa8154ab --- /dev/null +++ b/graphics/decorations/decor_hard_desk.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +197 197 197 +156 156 156 +115 115 115 +98 98 98 +74 74 74 +139 139 139 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_hard_desk.png b/graphics/decorations/decor_hard_desk.png new file mode 100644 index 0000000000000000000000000000000000000000..aa0c7feeacea2b5796fb4adb9e3876d9c0625b8f GIT binary patch literal 325 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?Fj~+cbXU?4B z;^L&FBrh+o?(S}&JXUab=}ZTp1Y=2%UoeBivm0qZ&S6g%#}J9BvHb`6nhXS7+MDO8 zy4fvod2ggz!yvIH?RKKHKQfk(p*W$&1CKguDVrQ zR_H$8q-I+alc#(~TaaJWrrxz^;ZQ54B!VDxWD_33tQU(D&A+AYBlMD?Fw`@5&Wy+kW zsHp#2f}V979*yFN(gdlmuC8`;bj->s2C^X_)A{FnAd9gi$S;_|;n|HeAg9aI#W6%; zYI4E>CJ9znR!NE8=}Q?qj~?Uc(K~kR#uP)2rYlPs8Ji6S95`fNu}ECn)Wa&#v(}+y zV>bhHvRHs&7*mewjiRMX7ka2AD<7EF&crxjw-19g<0he;%8V&O7w%oYeOgi?rHq?t z?@L_<<%W08%ugK{J}T4&#O-x&a4h)lxIi(QC4psGA;Yl-?TNyl>p=fS?83{ F1OPY{SLXl# literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_lapras_doll.pal b/graphics/decorations/decor_lapras_doll.pal new file mode 100644 index 000000000..c7d2fe61a --- /dev/null +++ b/graphics/decorations/decor_lapras_doll.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +189 230 255 +115 180 246 +74 139 189 +32 90 139 +0 0 0 +0 0 0 +246 197 131 +222 156 98 +197 156 123 +106 74 41 +0 0 0 +246 246 246 +0 0 0 diff --git a/graphics/decorations/decor_lapras_doll.png b/graphics/decorations/decor_lapras_doll.png new file mode 100644 index 0000000000000000000000000000000000000000..517553a4a9fdda370ac01ffc620164080ff1fddb GIT binary patch literal 349 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?FfxNxX{ugig z=GDDdA*vh51%hu!oA1p@Iy$F1%S#i){q_w=a$SlA>18Yl@(X5gcy=QV$hqz5;us<^ zHMD@~o&f)4a4g-3V!PC{xWt~$(695!GlzadH literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_powder_snow_mat.pal b/graphics/decorations/decor_powder_snow_mat.pal new file mode 100644 index 000000000..9f365a3da --- /dev/null +++ b/graphics/decorations/decor_powder_snow_mat.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +238 238 246 +180 205 255 +131 164 205 +197 222 255 +213 238 255 +98 131 172 +148 180 222 +49 82 123 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_powder_snow_mat.png b/graphics/decorations/decor_powder_snow_mat.png new file mode 100644 index 0000000000000000000000000000000000000000..82dbbfa668a651dde56af7e89fa09088815347ef GIT binary patch literal 302 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?F-@W^`vM*W2R1?m|Ik97-hf9gGe%iRas`{8IcBrA< zuq$Vtx^Td=*zKo`d_5VyB&{uF;`i8)&hd^v%AWzV2T7EA8_i k{#DgkPuluZf6bDA&HJKL%lW@uX*zopr0M34Sr2qf` literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_pretty_desk.pal b/graphics/decorations/decor_pretty_desk.pal new file mode 100644 index 000000000..7681a17cc --- /dev/null +++ b/graphics/decorations/decor_pretty_desk.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +189 222 255 +156 197 255 +0 0 0 +131 164 246 +49 82 123 +0 0 0 +0 0 0 +0 0 0 +180 180 180 +131 131 131 +90 90 90 +246 246 246 +0 0 0 diff --git a/graphics/decorations/decor_pretty_desk.png b/graphics/decorations/decor_pretty_desk.png new file mode 100644 index 0000000000000000000000000000000000000000..5be05ebcbfb8e625a5b9a0f97281a7265f12b91e GIT binary patch literal 296 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?FfxNx<{?9r3 zAINB4^35=)8pwcvEnBuUH#bK`MSc7B4JfieqnaN`F_r}R1v5B2yO9RuEc0}643U_c zJHe2T$&iP|oWEnr>xZIlQ!+c&JrQ0o<hdqdReP*&2$p%)V==eTFVvb3I2>08ah^PN9ScYSKrvS zo;xRl{dQXQTc*=DFUT4GiD6i-S1V{+toFynX5Eoji=JN4nQ_|dqv@8zYYy9crg|!^ jJy)Zs##S-!cV+}bPKHyJ-A<9eAb)wf`njxgN@xNAK1guQ literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_pretty_flowers.pal b/graphics/decorations/decor_pretty_flowers.pal new file mode 100644 index 000000000..c3b0ffce9 --- /dev/null +++ b/graphics/decorations/decor_pretty_flowers.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +0 0 0 +205 180 74 +156 139 32 +90 74 49 +123 106 41 +115 180 98 +74 123 57 +41 82 32 +255 205 180 +123 74 49 +238 156 139 +246 246 246 +222 197 197 diff --git a/graphics/decorations/decor_pretty_flowers.png b/graphics/decorations/decor_pretty_flowers.png new file mode 100644 index 0000000000000000000000000000000000000000..b9fc0f5de24e131df4f635e4bf2d3d4f01b3a0f2 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?Ffjl5MyTxlx zw?dScVRe>f@s=d7YD>)^h5u)_RC^h|o74U6+qZj1kN#LTX){nMV@Z%-FoVOh8)-n! z9#0p?5Q(X|{kD8f4k9h>_ma#nzVP~>7j{i#wfcm6F8m4Gv)#9s8{Ru`fK{R8p2Hi@ zFu709&x^$0%ei;vG}Bs{L#y1AW1Fr=H++=(Ih8Rr>TnpJbC`?eq#t>Lwt0sCI)fI7 zXtX{*?-aaWfupD^;hve+WeMSE)q>4QocbG?(hrJm31YjI(Hzji#A+ISEq1qnQ_~{z zvsTtM%Vx7#UwdQl-O%>!wHtEg)h84t%B!VDxWD_33tQU(D&A+AYhlMD?F-`!ht^=S8& zC0SFNy{eN8gB%rr@>s#F@B6!f5{xB5e!&b5&u*jvIrW|{jv*3LYy0=|wi@uX=wHo# z+r@Z~t%dglS0b|yH}9JBs)Ai2b?YqVKKZOJT`_6ZAzsA;fA{LYT)K=y#3uBTbl>H` z8?Tox@yffL!X}=4B!5|G(c~T{pS?L#@2G69^qrb=nd?oAbNL6Q?I%*T-kz15FaKxS j%|q<{y%S>fc0cy}SE`==bK|sWAP0N8`njxgN@xNA!I)f9 literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_red_brick.pal b/graphics/decorations/decor_red_brick.pal new file mode 100644 index 000000000..f9d647dda --- /dev/null +++ b/graphics/decorations/decor_red_brick.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +238 123 123 +189 74 65 +148 32 32 +123 16 16 +106 106 106 +74 74 74 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_red_brick.png b/graphics/decorations/decor_red_brick.png new file mode 100644 index 0000000000000000000000000000000000000000..3481044ddeca9ad4ae0660ce7ac760dd2097dd07 GIT binary patch literal 226 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?F-&I%d^>Un| zpinI!kd>9?<>dvG#|lD|!#aQxj3q&S!3+-1ZlnP@37#&FAre!Q6CBuj6r4E38Cjbg z4lH0{;c+|W=H{Ve(8$J8AoxRvN%)Y06U*HSlj`2ahJ&me1<@^;>p40E+J%z}3B!VDxWD_33tQU(D&A+AYBlMD?F?-f_?^$O}% zPzX{G0Lm0E$#Sf=lnBxUvd^wbno}K=6=Vry1A*_%_8&lsu_VYZn8D%MjWi%haGCC+|Ipd<2=CW zF0hb8iD#m2lLYspsm&3S3OG4CS|)c*=4$T9?$ADb#kiVD(ki*{T*8VOn>Wu*bbH_H z*Y>HeuZXSl<j!OyQ<{GWKb&TMNHxHwgI#8ihW6ot^zZLB^E8#e=Q27m&$4); p~!F%@Dq?%JYD@<);T3K0RRHaXrKT9 literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_red_tent.pal b/graphics/decorations/decor_red_tent.pal new file mode 100644 index 000000000..61951623b --- /dev/null +++ b/graphics/decorations/decor_red_tent.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +246 123 123 +222 90 90 +180 49 49 +115 49 57 +0 0 0 +197 205 230 +164 164 164 +131 131 131 +90 82 74 +0 0 0 +0 0 0 +0 0 0 +246 246 246 +0 0 0 diff --git a/graphics/decorations/decor_red_tent.png b/graphics/decorations/decor_red_tent.png new file mode 100644 index 0000000000000000000000000000000000000000..22e435691ce33c3c507181063a2833dec72d321e GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?Fzg1V?i;CJ} zXjp7$36wc{_SuppOPZUTqk_DETnPB~?HiC0_Kmp_NHLZK`2{mLJiCzwyUv6+k@!~tDCEstaoNsG2Wi?Dr_Mme~`vI-6KmUFNl?qsou2f3D3XvjGBJ` z4!g^>{BIRFtE3W9`rwU$tiu7FnfWSCe2Uk<_uVV~yQF$foX69tv+i>rtYBJ~I%|UF z4BKa{UaqHB#9I|?N%*WVH~iLh|L$c|>nxK6`?I&*k!g20D=Ascd|g~XOUmQTBc6;2 zlFp7T!c%)DT-smf@S>lG)9Z8zuZh93C&58KtSoDpJ~28?4vIWKjT;m!44$rjF6*2U FngAV#cjf>9 literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_regice_doll.pal b/graphics/decorations/decor_regice_doll.pal new file mode 100644 index 000000000..39404f681 --- /dev/null +++ b/graphics/decorations/decor_regice_doll.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +238 238 255 +180 189 205 +139 148 172 +82 98 115 +115 123 139 +0 0 0 +0 0 0 +246 180 65 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_regice_doll.png b/graphics/decorations/decor_regice_doll.png new file mode 100644 index 0000000000000000000000000000000000000000..88a28df6ddea203dffeb5ed6beb6c31aacb3cab3 GIT binary patch literal 346 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?FfxLI`{%_fP zwtLE&prqpB>TaM25PaL>2w}iU$-Vi$Kn`O`kY6x^!?PP{K+X+M7sn8Zsi6~m^I8me z-1g^0s7oEPb@RNb%u}s$#!A^k?}AtH!iV$z25I@eJ~~t^ezIsuu(?`A>Sj{OAgB!VDxWD_33tQU(D&A+AYBlMD?Ffjl7CvLvax z*f7Wo#64RaG{q65ZLgOENDc-jUrvkwvKdQ){DK)Ap4~_Ta!z`>IEF|}jqP{jYBmsX zt0p3gcHe^*{8Res{_2h}|}T<>uxeSGt5)$L!Ku4dkRs}pnY#`e|AuP&NnK4s=S{rT^XTwpj@ zF0#BM#H(?`0#~l0NphC`!k>zR&Ik)m$<3-%DdUlH-<9qEx1?Kaad5Zep45Gf!i$~H zmMS;>JNRPW4-UC6c8jGy3$L7Mdu3-qLl*Pz-w(FlI=OY;mHId7`?}@5kC=QtZD{-j OB!VDxWD_33tQU(D&A+AYBlMD?FfxLI`-W@%9 zbjgw>)z!^GK~X>vWUwa45yD-!r))Bi#aI&L7tG-B>_!@pbJx?wF+^gjZ~xh@W(R?m z)85~*7WbVORGYB*OoRRg`}CVR)m$30W(LPy-g7R@z06bIPHNYRS4?rw&u+LO)S)EA zTbNO@U;dfW!`~Wm|7?Ujr_28RYLyfs8-Hfr?)f~ng|9j!ydCQ29NkgAV48H`$B-pc zHE@FK0Hh0*DZF%PcY@$#7`zuxBlAgKotf?NGXrY9L%g_5oX1fcvB!VDxWD_33tQU(D&A+AYBlMD?F@7=q%WXY1f zd-ryCcV}f~1qB5?J6gPVidS=z7f>MteEaqd$e1b0_!&qsmIV0)GdMiEkp|?v^>lFz zk(lZ`VPoDQ0}Nz{C0C;G_Ok2T=hA)%xSjZ<B!VDxWD_33tQU(D&A+AYBlMD?FfxN3n=j>e) zHKp1x%1fd-OJU6vFQ6bMuEak7F*Wy`Enl+%59>6ysdTZUgi~YU-?+Xh%PpUYcpZUN^rgGg*)pz&yFP!VGu!_t2YLD?Tg;evi zteVr=bWVC~wY#jk{f_XZMQ0yQiWlAK!8djGnTe;kd5WE7pVsYutNws_*DaOsQ*|jI PFEV(#`njxgN@xNAPh4lH literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_slide.pal b/graphics/decorations/decor_slide.pal new file mode 100644 index 000000000..395694fa3 --- /dev/null +++ b/graphics/decorations/decor_slide.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +148 189 238 +106 148 205 +65 115 172 +180 222 255 +0 0 0 +0 0 0 +0 0 0 +213 213 213 +189 189 189 +156 156 156 +106 106 106 +0 0 0 +246 246 246 +0 0 0 diff --git a/graphics/decorations/decor_slide.png b/graphics/decorations/decor_slide.png new file mode 100644 index 0000000000000000000000000000000000000000..8a5dbada5b0a905c0efc85f4eee3bdfaa6c73b51 GIT binary patch literal 293 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?Fr|f-~HRY^h z@tQ67{sUzo;Of<@d-v|0GiOd#Ru)j?+qZ8(Qpjt?B_PFE666=m;PC858j!Qt)5S4F zVruIIL%u@>Jg#T&HJ-Wa6{#Hhl*wdfvH39$zX{R`Vqq>v6)$aCIH&Rbu@I+*ABQh@ zr`{~;P+@(1%*f!Fzk;n3r($=??(nO#lDsB9N|^k`@RFnff5IOoo~O?aon6-0n*Ju; z`ibnVSZ1CAsSo>jO01?O{blvAF?sWk$ys;t-^3-KI4?KOUbiVFeA%(hVzaZjChpU{ jV5V<;HriMBY4v>3u7C%tmL1;%bS{IZtDnm{r-UW|Oy6|$ literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_snorlax_doll.pal b/graphics/decorations/decor_snorlax_doll.pal new file mode 100644 index 000000000..21026b10d --- /dev/null +++ b/graphics/decorations/decor_snorlax_doll.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +0 0 0 +131 139 164 +82 90 115 +0 0 0 +255 238 222 +255 197 148 +222 156 90 +139 90 49 +172 106 49 +230 172 123 +0 0 0 +238 238 238 +189 189 197 diff --git a/graphics/decorations/decor_snorlax_doll.png b/graphics/decorations/decor_snorlax_doll.png new file mode 100644 index 0000000000000000000000000000000000000000..6ff891c13674fac1bcf1df2debc864ca6c90a1fe GIT binary patch literal 337 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?Ffjl5+?p_iU zRSabOe|PWy(JA-lM0H0QuE{cdwx${=`0m}iy?c*7YB^L7>5`2{mLJiCzwjr1sapoV7 zelh><>i6V`H#(qxZh~ad>P3lJSNYFKyjUPGQ^DYZfXE`P3s(ad`WQdwb#~6|2-Cl( zv7e#EI_5=j_CYr}%lZ9mZ#*AmyLEi|u;R70->QDM|Hu7GJCB%jI6YM?@U&Z~*B!VDxWD_33tQU(D&A+AYBlMD?FfxNv-lIAo! zR!3=OMR@_axPZf}cXmKI#*!evUP>5#xAnMr37Cgn6aI$UYw5NA{nWK#0kAn-%SNo~W;#;FHV1v$TU9bj%^TrHd6 q-@KQfkE6p%r>w!2_uD=NoeIXkI~2@$f1BB!VDxWD_33tQU(D&A+AYRlMD?FfxIb4r(~@u z4w@3xJtyhj+3qb%lFsgJHcYYvN+AQ`)RneCK4VFcUoeBivm0qZ&Kge_#}J9Bp%V=G z4jBlrOrO@}@#o1I<_nP>W?kA*Qgs6M3WxqV2DLTS7sV-egnv49Z*ra~+qSBkH(56? zzTqlbv3ud3JLUIEwVS@%y66N8wpNJ7dq2s z5}ySnPb)li&vH3yVUJ+uOyNl@@69MY6?av-KwNufRPr&+YHh)r9+8!v_c~lsR!?c2 l{^U>deh(M3y!Z7_*4jNWv^te#B4-Bjl&7no%Q~loCICiybp`+c literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_stand.pal b/graphics/decorations/decor_stand.pal new file mode 100644 index 000000000..a85f0b7b2 --- /dev/null +++ b/graphics/decorations/decor_stand.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +255 180 156 +238 115 106 +197 65 65 +0 0 0 +0 0 0 +0 0 0 +197 197 197 +172 172 172 +131 131 131 +106 106 106 +0 0 0 +0 0 0 +246 246 246 +0 0 0 diff --git a/graphics/decorations/decor_stand.png b/graphics/decorations/decor_stand.png new file mode 100644 index 0000000000000000000000000000000000000000..86b1e4d1fea56b15a539b02b2bb4cef01a293da1 GIT binary patch literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?F|8JS|t~l$c zqa#ol0*)R%x@OIq=H}+CtSpGgw{PEo48zu2Q9z2ZB*-tA!Qt7BG$5zV)5S4FVrp-% zAs3UO2&;POtO~Yj?#s_>82uN_OW5wUlEtP+v$dY>{yQa|NlL-CCsORbeAs&EG*78bmC zjoBNQ##ioDT)V)-Vd949you}_58P~?9%}f;`g>B~XCXC~NRV?qUHx3vIVCg!05Te6 Aw*UYD literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_surf_mat.pal b/graphics/decorations/decor_surf_mat.pal new file mode 100644 index 000000000..17be591b7 --- /dev/null +++ b/graphics/decorations/decor_surf_mat.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +205 238 255 +164 205 255 +148 180 255 +115 148 222 +57 90 156 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +246 246 255 +0 0 0 diff --git a/graphics/decorations/decor_surf_mat.png b/graphics/decorations/decor_surf_mat.png new file mode 100644 index 0000000000000000000000000000000000000000..d74cb97bb951238e731ba18577f5230c92fdbd93 GIT binary patch literal 298 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?FfxNTt{x3QE zf6A8s#Z&HCM$G|=pn-4S{sTpvKScTiDaMi@zhDN3XE)M-oE4rfjv*3Lb0;`*9WoGc zS#F-;@YYpm`c0G4o4(%}9e3-nEEQkpx&Gmk=&i2oMn0dM+r$%ekB0Va*_*nf%;Bl> zhS_h7!dD%+@tyJTV&54$?8}U0Yo6HNtP4%!z8Tc_%;&T5AfI`<`njxgN@xNAheUJ= literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_thunder_mat.pal b/graphics/decorations/decor_thunder_mat.pal new file mode 100644 index 000000000..fbe488860 --- /dev/null +++ b/graphics/decorations/decor_thunder_mat.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +0 0 0 +189 222 255 +172 205 238 +139 172 205 +139 156 164 +255 230 123 +90 106 115 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +238 246 255 +0 0 0 diff --git a/graphics/decorations/decor_thunder_mat.png b/graphics/decorations/decor_thunder_mat.png new file mode 100644 index 0000000000000000000000000000000000000000..1c5c56e332eb5f415a253384250666829a8fddfe GIT binary patch literal 315 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?Ffjl7Cd+-06 zv+ugsob8^oAF^Gfz+d^yEg+8u17A{MJ*= zW4c5qGo3fO?fW@B?z-}yO*|T_xaU~8`WPm@+ATTPi_GrCwFRx2z2~m~ zJ>L~xZ+PBiUDyzQ?eUcA%^oh=HwBs;bS6w-wcNtnw59O2^>6D7s?nELE53}|cwF;) zo?FS{r_a1UJ7>6`!w%h{YHGIr-k+2a%3zOoSHzJ;C7V>gTe~DWM4f@ZNtl literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_tire.pal b/graphics/decorations/decor_tire.pal new file mode 100644 index 000000000..18a3279fc --- /dev/null +++ b/graphics/decorations/decor_tire.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +0 0 0 +238 238 238 +189 189 189 +164 164 164 +131 131 131 +98 98 98 +74 74 74 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_tire.png b/graphics/decorations/decor_tire.png new file mode 100644 index 0000000000000000000000000000000000000000..e394ebbd401f02ba167b8d4e970bd9c1d01898fb GIT binary patch literal 303 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlYq>3@80d*yLZWw zCC$yvNl8gwUS2>!tl-1jCDlL)#*!evUmY~R!a|FW}55rNy%gV{r}rSmv~2N zdTK}spZGF)VMeaSG|dFo%UUP8U#PCU^^eW&0MiLm*@lYtjWJz)IrfoV*V7lAyfu%j z_~yH?JHfL$_a^UJ_@6OFA=Krd3=7X^#`4)ZXRlahY=3W?o*=jFS=QY0$J_o098dm_UTRq-6UiWg_+lSjh-t%B!VDxWD_33tQU(D&A+AYBlMD?FkFE(?(rwtB zB@pB&0F(iODfgnXwitRfODIH1Ktv$qbfGyiKo(<3kY6x^!?PP{K+Z-_7sn8ZslENS zd`%7lt@5p+XY&?yZYf|^Vps6UXNsdCXH+RGCm#8H z&$Wl+m=t%uZ~wWSEJ-|9EcR=72YX++y3zIGHD0Fv@}9(dyE{Jqy}c$s?)8F@RyAMl sH&Z6vcvjh|ar%Vwsrx%G+ov61zmTi$_kFjdQKoCSnm5VgDU~GIb`3nDl@!Epa7OD;A(%K+J zWm>6prQ!SNC}juoqw`A@?i`R-9|*b;F300000NkvXXu0mjfB!VDxWD_33tQU(D&A+AYBlMD?Ffjl6{nzF{L zc#36GwWVX$vn^R?rvz>3wk-D21WH}KdiC44Z%dXe(e3@C4dgSH1o;IsI6S+N2ITDX zba4!kn3_Amkc-Jsz_nhBdp3)UfWLCjN2Wzzo#t#2d-u*#NBkpSRMnKVHizaNIBMU0 zbWz<2<;iFM%w+kYpT1h@8Rv`@f9|wD2<%MZFg;{n>1=kaNx+uxozJ}4pM8YqxU}BR z<1lnNoVfp=#d3>x3zfK*MyzKoTgBe-lUvy(mT}e*XaDTO8@%Oi7d?M?YSwwK?s>{K z>yB*M_;T8PWB%TvvrqQDw~C2BFUH&I(EF+A?6JEu-QTt*7AwEoAOC@E>Ut}`OP$-} QfIeaHboFyt=akR{0CfU`Jpcdz literal 0 HcmV?d00001 diff --git a/graphics/decorations/decor_yellow_brick.pal b/graphics/decorations/decor_yellow_brick.pal new file mode 100644 index 000000000..cfdd874ad --- /dev/null +++ b/graphics/decorations/decor_yellow_brick.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +255 230 106 +222 197 49 +180 156 8 +148 123 0 +106 106 106 +74 74 74 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_yellow_brick.png b/graphics/decorations/decor_yellow_brick.png new file mode 100644 index 0000000000000000000000000000000000000000..cb865760ca9c5d2c013db4008a76d769a7dd1fde GIT binary patch literal 226 zcmeAS@N?(olHy`uVBq!ia0vp^96;>B!VDxWD_33tQU(D&A+AYBlMD?F|3AyRchqpp z9F8f~3|U!OUS3{6d90xQ%JxE_1Y=2%UoeBivm0qZPJ*Y4V~E7mb^*;y%}fD914cgPKXNTM*%%pIrA02Cbm4mqa*?O2pUXO@geCyTemTtm literal 0 HcmV?d00001 diff --git a/graphics/decorations/unk_85a6bb0.pal b/graphics/decorations/unk_85a6bb0.pal new file mode 100644 index 000000000..4239a1f5e --- /dev/null +++ b/graphics/decorations/unk_85a6bb0.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 205 164 +255 255 255 +98 98 98 +213 213 205 +230 230 230 +197 197 197 +0 0 0 +238 238 238 +197 197 197 +148 148 148 +255 0 0 +180 0 0 +255 197 197 +82 82 255 +49 49 180 +197 197 255 diff --git a/graphics/decorations/unk_85a7308.pal b/graphics/decorations/unk_85a7308.pal new file mode 100644 index 000000000..e7717d74e --- /dev/null +++ b/graphics/decorations/unk_85a7308.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +255 213 180 +255 197 148 +222 148 115 +123 65 65 +57 74 123 +41 57 98 +24 41 82 +16 32 57 +222 230 238 +255 197 90 +189 156 90 +255 98 90 +197 65 65 +255 255 255 +0 0 0 diff --git a/graphics/decorations/unk_85a7328.pal b/graphics/decorations/unk_85a7328.pal new file mode 100644 index 000000000..e106ce693 --- /dev/null +++ b/graphics/decorations/unk_85a7328.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +255 222 205 +222 164 148 +205 131 115 +123 90 82 +98 98 115 +41 57 65 +164 106 82 +74 49 57 +205 205 222 +255 197 90 +189 156 90 +255 98 90 +197 65 65 +255 255 255 +0 0 0 diff --git a/graphics/misc/decoration_unk_85a7358.png b/graphics/misc/decoration_unk_85a7358.png new file mode 100644 index 0000000000000000000000000000000000000000..2dc8ed60474f2fc987469d3c40fd34f6cac9a227 GIT binary patch literal 87 zcmeAS@N?(olHy`uVBq!ia0vp^0wBx+BpCi@`0fExa-J@ZAsjQ4e`s*9ed1~Qf6!rq jquik%9{g-~f@T;qy!20=JAwc05|9p0S3j3^P6secretBases[0].decorations; + gUnknown_0203A17C.pos = gSaveBlock1Ptr->secretBases[0].decorationPos; + } + if (gUnknown_0203A17C.isPlayerRoom == TRUE) + { + gUnknown_0203A17C.items = gSaveBlock1Ptr->playerRoomDecor; + gUnknown_0203A17C.pos = gSaveBlock1Ptr->playerRoomDecorPos; + } +} + +u8 sub_81269D4(u8 idx) +{ + u8 *winidx; + struct WindowTemplate template; + + winidx = &sDecorMenuWindowIndices[idx]; + if (idx == 0) + { + template = gUnknown_085A6B90[0]; + template.width = GetMaxWidthInMenuTable(sSecretBasePCMenuActions, 4); + if (template.width > 18) + { + template.width = 18; + } + *winidx = AddWindow(&template); + } + else + { + *winidx = AddWindow(&gUnknown_085A6B90[idx]); + } + SetWindowBorderStyle(*winidx, 0, 0x214, 0xe); + schedule_bg_copy_tilemap_to_vram(0); + return *winidx; +} + +void sub_8126A58(u8 idx) +{ + sub_8198070(sDecorMenuWindowIndices[idx], FALSE); + ClearWindowTilemap(sDecorMenuWindowIndices[idx]); + RemoveWindow(sDecorMenuWindowIndices[idx]); + schedule_bg_copy_tilemap_to_vram(0); +} + +void sub_8126A88(void) +{ + u8 idx; + + idx = sub_81269D4(0); + PrintMenuTable(idx, 4, sSecretBasePCMenuActions); + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(idx, 4, sSecretBasePCMenuCursorPos); +} + +void sub_8126ABC(void) +{ + sSecretBasePCMenuCursorPos = 0; + ScriptContext2_Enable(); + sub_8126A88(); + sub_8126C08(); +} + +void sub_8126AD8(u8 taskId) +{ + sub_8126ABC(); + gUnknown_0203A17C.items = gSaveBlock1Ptr->secretBases[0].decorations; + gUnknown_0203A17C.pos = gSaveBlock1Ptr->secretBases[0].decorationPos; + gUnknown_0203A17C.size = sizeof(gSaveBlock1Ptr->secretBases[0].decorations); + gUnknown_0203A17C.isPlayerRoom = FALSE; + gTasks[taskId].func = sub_8126B80; +} + +void sub_8126B2C(u8 taskId) +{ + sub_8126ABC(); + gUnknown_0203A17C.items = gSaveBlock1Ptr->playerRoomDecor; + gUnknown_0203A17C.pos = gSaveBlock1Ptr->playerRoomDecorPos; + gUnknown_0203A17C.size = sizeof(gSaveBlock1Ptr->playerRoomDecor); + gUnknown_0203A17C.isPlayerRoom = TRUE; + gTasks[taskId].func = sub_8126B80; +} + +void sub_8126B80(u8 taskId) +{ + u8 menuPos; + + if (!gPaletteFade.active) + { + menuPos = GetMenuCursorPos(); + switch (ProcessMenuInput()) + { + default: + PlaySE(SE_SELECT); + sSecretBasePCMenuActions[sSecretBasePCMenuCursorPos].func.void_u8(taskId); + break; + case -2: + sSecretBasePCMenuCursorPos = GetMenuCursorPos(); + if ((s8)menuPos != sSecretBasePCMenuCursorPos) + { + sub_8126C08(); + } + break; + case -1: + PlaySE(SE_SELECT); + SecretBasePC_Cancel(taskId); + break; + } + } +} + +void sub_8126C08(void) +{ + FillWindowPixelBuffer(0, 0x11); + AddTextPrinterParametrized(0, 1, sSecretBasePCMenuItemDescriptions[sSecretBasePCMenuCursorPos], 0, 0, 2, 1, 3); +} + +void SecretBasePC_Decorate(u8 taskId) +{ + if (CountDecorations() == 0) + { + StringExpandPlaceholders(gStringVar4, gText_NoDecorations); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8126DA4); + } + else + { + gTasks[taskId].data[11] = 0; + sCurDecorationCategory = DECORCAT_DESK; + SecretBasePC_PrepMenuForSelectingStoredDecors(taskId); + } +} + +void SecretBasePC_PutAway(u8 taskId) +{ + if (!sub_81299AC(taskId)) + { + StringExpandPlaceholders(gStringVar4, gText_NoDecorationsInUse); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8126DA4); + } + else + { + sub_8126A58(0); + sub_8197434(0, 0); + fade_screen(1, 0); + gTasks[taskId].data[2] = 0; + gTasks[taskId].func = sub_8129ABC; + } +} + +void SecretBasePC_Toss(u8 taskId) +{ + if (CountDecorations() == 0) + { + StringExpandPlaceholders(gStringVar4, gText_NoDecorations); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8126DA4); + } + else + { + gTasks[taskId].data[11] = 1; + sCurDecorationCategory = DECORCAT_DESK; + SecretBasePC_PrepMenuForSelectingStoredDecors(taskId); + } +} + +void SecretBasePC_Cancel(u8 taskId) +{ + sub_8126A58(0); + if (!gUnknown_0203A17C.isPlayerRoom) + { + ScriptContext1_SetupScript(gUnknown_0823B4E8); + DestroyTask(taskId); + } + else + { + sub_816B060(taskId); + } +} + +void sub_8126DA4(u8 taskId) +{ + sub_8126C08(); + gTasks[taskId].func = sub_8126B80; +} + +void SecretBasePC_PrepMenuForSelectingStoredDecors(u8 taskId) +{ + LoadPalette(gUnknown_085A6BB0, 0xd0, 0x20); + sub_8197434(0, 0); + sub_8126A58(0); + sub_8126DFC(taskId); +} + +void sub_8126DFC(u8 taskId) +{ + u8 winIdx; + + winIdx = sub_81269D4(1); + sub_8126E8C(taskId); + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(winIdx, 9, sCurDecorationCategory); + gTasks[taskId].func = sub_8127088; +} + +void sub_8126E44(u8 taskId) +{ + FillWindowPixelBuffer(sDecorMenuWindowIndices[1], 0x11); + sub_8126E8C(taskId); + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sDecorMenuWindowIndices[1], 9, sCurDecorationCategory); + gTasks[taskId].func = sub_8127088; +} + +void sub_8126E8C(u8 taskId) +{ + s16 *data; + u8 r5; + bool8 r8; + u8 i; + bool8 fl; + + data = gTasks[taskId].data; + r5 = sDecorMenuWindowIndices[1]; + fl = gUnknown_0203A17C.isPlayerRoom; + r8 = FALSE; + if (fl == TRUE && data[11] == 0) + { + r8 = TRUE; + } + for (i = 0; i < 8; i ++) + { + if (r8 == TRUE && i != DECORCAT_DOLL && i != DECORCAT_CUSHION) + { + sub_8126F68(r5, i, 8, i << 4, TRUE, 0xFF); + } + else + { + sub_8126F68(r5, i, 8, i << 4, FALSE, 0xFF); + } + } + PrintTextOnWindow(r5, 1, gTasks[taskId].data[11] == 2 ? gText_Exit : gText_Cancel, 8, (i << 4) + 1, 0, 0); + schedule_bg_copy_tilemap_to_vram(0); +} + +void sub_8126F68(u8 winid, u8 decorCat, u8 x, u8 y, bool8 flag, u8 speed) +{ + u8 width; + u8 *strbuf; + + width = x == 8 ? 0x68 : 0x60; + y ++; + sub_8127058(gStringVar4, flag); + strbuf = StringLength(gStringVar4) + gStringVar4; + StringCopy(strbuf, sDecorCatNames[decorCat]); + PrintTextOnWindow(winid, 1, gStringVar4, x, y, speed, NULL); + strbuf = ConvertIntToDecimalStringN(strbuf, CountDecorationCategoryN(decorCat), STR_CONV_MODE_RIGHT_ALIGN, 2); + *strbuf++ = CHAR_SLASH; + ConvertIntToDecimalStringN(strbuf, gDecorationInventories[decorCat].size, STR_CONV_MODE_RIGHT_ALIGN, 2); + x = GetStringRightAlignXOffset(1, gStringVar4, width); + PrintTextOnWindow(winid, 1, gStringVar4, x, y, speed, NULL); +} + +void sub_8127058(u8 *str, bool8 flag) +{ + StringCopy(str, gText_Color161Shadow161); + if (flag == TRUE) + { + str[2] = 0x04; // RED + str[5] = 0x05; // LIGHT_RED + } + else + { + str[2] = 0x02; // DARK_GREY + str[5] = 0x03; // LIGHT_GREY + } +} + +void sub_8127088(u8 taskId) +{ + s8 input; + + if (!gPaletteFade.active) + { + input = ProcessMenuInput(); + switch (input) + { + case -1: + case 8: + PlaySE(SE_SELECT); + sub_812719C(taskId); + break; + case -2: + break; + default: + PlaySE(SE_SELECT); + sCurDecorationCategory = input; + sub_81270E8(taskId); + break; + } + } +} + +void sub_81270E8(u8 taskId) +{ + sCurDecorCatCount = CountDecorationCategoryN(sCurDecorationCategory); + if (sCurDecorCatCount != 0) + { + CondenseDecorationCategoryN(sCurDecorationCategory); + gCurDecorInventoryItems = gDecorationInventories[sCurDecorationCategory].items; + IdentifyOwnedDecorationsCurrentlyInUse(taskId); + sSecretBasePCSelectDecorPageNo = 0; + sSecretBasePCSelectDecorLineNo = 0; + gTasks[taskId].func = sub_8127620; + } + else + { + sub_8126A58(1); + StringExpandPlaceholders(gStringVar4, gText_NoDecorations); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8127180); + } +} + +void sub_8127180(u8 taskId) +{ + sub_8197434(0, 0); + sub_8126DFC(taskId); +} + +void sub_812719C(u8 taskId) +{ + if (gTasks[taskId].data[11] != 2) + { + sub_81271CC(taskId); + } + else + { + sub_8127268(taskId); + } +} + +void sub_81271CC(u8 taskId) +{ + sub_8126A58(1); + sub_8126A88(); + sub_81973C4(0, 0); + sub_8126C08(); + gTasks[taskId].func = sub_8126B80; +} + +void sub_8127208(u8 taskId) +{ + LoadPalette(gUnknown_085A6BB0, 0xd0, 0x20); + sub_8197434(0, 0); + gTasks[taskId].data[11] = 2; + sCurDecorationCategory = DECORCAT_DESK; + sub_8126DFC(taskId); +} + +void sub_8127250(u8 *dest, u8 decorCat) +{ + StringCopy(dest, sDecorCatNames[decorCat]); +} + +void sub_8127268(u8 taskId) +{ + sub_8126A58(1); + sub_8133E1C(taskId); +} + +void sub_8127284(void) +{ + sDecorPCBuffer->unk_520 = sCurDecorCatCount + 1; + if (sDecorPCBuffer->unk_520 > 8) + { + sDecorPCBuffer->unk_521 = 8; + } + else + { + sDecorPCBuffer->unk_521 = sDecorPCBuffer->unk_520; + } +} + +void sub_81272C8(void) +{ + sub_812225C(&sSecretBasePCSelectDecorPageNo, &sSecretBasePCSelectDecorLineNo, sDecorPCBuffer->unk_521, sDecorPCBuffer->unk_520); +} + +void sub_81272F8(void) +{ + sub_8122298(&sSecretBasePCSelectDecorPageNo, &sSecretBasePCSelectDecorLineNo, sDecorPCBuffer->unk_521, sDecorPCBuffer->unk_520, 8); +} + +void sub_8127330(u8 taskId) +{ + s16 *data; + u16 i; + + data = gTasks[taskId].data; + if ((sCurDecorationCategory < DECORCAT_DOLL || sCurDecorationCategory > DECORCAT_CUSHION) && gUnknown_0203A17C.isPlayerRoom == TRUE && data[11] == 0) + { + sub_8127058(gStringVar1, TRUE); + } + else + { + sub_8127058(gStringVar1, FALSE); + } + for (i = 0; i < sDecorPCBuffer->unk_520 - 1; i ++) + { + sub_8127454(sDecorPCBuffer->names[i], gCurDecorInventoryItems[i]); + sDecorPCBuffer->items[i].unk_00 = sDecorPCBuffer->names[i]; + sDecorPCBuffer->items[i].unk_04 = i; + } + StringCopy(sDecorPCBuffer->names[i], gText_Cancel); + sDecorPCBuffer->items[i].unk_00 = sDecorPCBuffer->names[i]; + sDecorPCBuffer->items[i].unk_04 = -2; + gUnknown_03006310 = gUnknown_085A6BD0; + gUnknown_03006310.unk_10 = sDecorMenuWindowIndices[1]; + gUnknown_03006310.unk_0c = sDecorPCBuffer->unk_520; + gUnknown_03006310.unk_00 = sDecorPCBuffer->items; + gUnknown_03006310.unk_0e = sDecorPCBuffer->unk_521; +} + +void sub_8127454(u8 *dest, u16 decorId) +{ + StringCopy(dest, gStringVar1); + StringAppend(dest, gDecorations[decorId].name); +} + +void sub_8127480(u32 a0, bool8 flag, struct ListMenu *menu) +{ + if (flag != TRUE) + { + PlaySE(SE_SELECT); + } + sub_8127744(a0); +} + +void sub_81274A0(u8 a0, s32 a1, u8 a2) +{ + if (a1 != -2) + { + if (sub_81277BC(a1 + 1) == TRUE) + { + blit_move_info_icon(a0, 0x18, 0x5c, a2 + 2); + } + else if (sub_81277E8(a1 + 1) == TRUE) + { + blit_move_info_icon(a0, 0x19, 0x5c, a2 + 2); + } + } +} + +void sub_8127500(void) +{ + if (sDecorPCBuffer->unk_522 == 0xFF) + { + sDecorPCBuffer->unk_522 = AddScrollIndicatorArrowPairParametrized(0x02, 0x3c, 0x0c, 0x94, sDecorPCBuffer->unk_520 - sDecorPCBuffer->unk_521, 0x6e, 0x6e, &sSecretBasePCSelectDecorPageNo); + } +} + +void sub_8127554(void) +{ + if (sDecorPCBuffer->unk_522 != 0xFF) + { + RemoveScrollIndicatorArrowPair(sDecorPCBuffer->unk_522); + sDecorPCBuffer->unk_522 = 0xFF; + } +} + +void sub_8127580(u8 taskId) +{ + sub_81269D4(1); + sub_812759C(taskId); +} + +void sub_812759C(u8 taskId) +{ + s16 *data; + + data = gTasks[taskId].data; + sub_81269D4(3); + sub_8127718(sCurDecorationCategory); + sDecorPCBuffer = calloc(1, sizeof(struct DecorPCBuffer)); + sDecorPCBuffer->unk_522 = 0xFF; + sub_8127284(); + sub_81272C8(); + sub_81272F8(); + sub_8127330(taskId); + data[13] = ListMenuInit(&gUnknown_03006310, sSecretBasePCSelectDecorPageNo, sSecretBasePCSelectDecorLineNo); + sub_8127500(); +} + +void sub_8127620(u8 taskId) +{ + sub_812759C(taskId); + gTasks[taskId].func = sub_812764C; +} + +void sub_812764C(u8 taskId) +{ + s16 *data; + s32 input; + + data = gTasks[taskId].data; + if (!gPaletteFade.active) + { + input = ListMenuHandleInput(data[13]); + get_coro_args_x18_x1A(data[13], &sSecretBasePCSelectDecorPageNo, &sSecretBasePCSelectDecorLineNo); + switch (input) + { + case -1: + break; + case -2: + PlaySE(SE_SELECT); + SecretBasePC_SelectedDecorActions[data[11]][1](taskId); + break; + default: + PlaySE(SE_SELECT); + gCurDecorationIndex = input; + sub_8127554(); + sub_81AE6C8(data[13], &sSecretBasePCSelectDecorPageNo, &sSecretBasePCSelectDecorLineNo); + sub_8126A58(1); + sub_81277A8(); + free(sDecorPCBuffer); + SecretBasePC_SelectedDecorActions[data[11]][0](taskId); + break; + } + } +} + +void sub_8127718(u8 decorCat) +{ + sub_8126F68(sub_81269D4(2), decorCat, 0, 0, 0, 0); +} + +void sub_8127744(u32 a0) +{ + u8 winidx; + const u8 *txt; + + winidx = sDecorMenuWindowIndices[3]; + FillWindowPixelBuffer(winidx, 0x11); + if (a0 >= sCurDecorCatCount) + { + txt = gText_GoBackPrevMenu; + } + else + { + txt = gDecorations[gCurDecorInventoryItems[a0]].description; + } + PrintTextOnWindow(winidx, 1, txt, 0, 1, 0, 0); +} + +void sub_81277A8(void) +{ + sub_8126A58(3); + sub_8126A58(2); +} + +bool8 sub_81277BC(u8 idx) +{ + u8 i; + + for (i = 0; i < 16; i ++) + { + if (sSecretBaseItemsIndicesBuffer[i] == idx) + { + return TRUE; + } + } + return FALSE; +} + +bool8 sub_81277E8(u8 idx) +{ + u8 i; + + for (i = 0; i < 12; i ++) + { + if (sPlayerRoomItemsIndicesBuffer[i] == idx) + { + return TRUE; + } + } + return FALSE; +} + +void IdentifyOwnedDecorationsCurrentlyInUseInternal(u8 taskId) +{ + u16 i; + u16 j; + u16 k; + u16 cnt; + + cnt = 0; + memset(sSecretBaseItemsIndicesBuffer, 0, 16); + memset(sPlayerRoomItemsIndicesBuffer, 0, 12); + for (i = 0; i < 16; i ++) + { + if (gSaveBlock1Ptr->secretBases[0].decorations[i] != DECOR_NONE) + { + for (j = 0; j < gDecorationInventories[sCurDecorationCategory].size; j ++) + { + if (gCurDecorInventoryItems[j] == gSaveBlock1Ptr->secretBases[0].decorations[i]) + { + for (k = 0; k < cnt && sSecretBaseItemsIndicesBuffer[k] != j + 1; k ++); + if (k == cnt) + { + sSecretBaseItemsIndicesBuffer[cnt] = j + 1; + cnt ++; + break; + } + } + } + } + } + cnt = 0; + for (i = 0; i < 12; i ++) + { + if (gSaveBlock1Ptr->playerRoomDecor[i] != DECOR_NONE) + { + for (j = 0; j < gDecorationInventories[sCurDecorationCategory].size; j ++) + { + if (gCurDecorInventoryItems[j] == gSaveBlock1Ptr->playerRoomDecor[i] && sub_81277BC(j + 1) != TRUE) + { + for (k = 0; k < cnt && sPlayerRoomItemsIndicesBuffer[k] != j + 1; k ++); + if (k == cnt) + { + sPlayerRoomItemsIndicesBuffer[cnt] = j + 1; + cnt ++; + break; + } + } + } + } + } +} + +void IdentifyOwnedDecorationsCurrentlyInUse(u8 taskId) +{ + IdentifyOwnedDecorationsCurrentlyInUseInternal(taskId); +} + +bool8 IsSelectedDecorInThePC(void) +{ + u16 i; + for (i = 0; i < 16; i ++) + { + if (sSecretBaseItemsIndicesBuffer[i] == sSecretBasePCSelectDecorPageNo + sSecretBasePCSelectDecorLineNo + 1) + { + return FALSE; + } + if (i < 12 && sPlayerRoomItemsIndicesBuffer[i] == sSecretBasePCSelectDecorPageNo + sSecretBasePCSelectDecorLineNo + 1) + { + return FALSE; + } + } + return TRUE; +} + +void sub_8127A14(u8 taskId) +{ + sub_81269D4(1); + sub_8127620(taskId); +} + +void sub_8127A30(u8 taskId) +{ + sub_8197434(0, 0); + gTasks[taskId].func = sub_8127A14; +} + +void sub_8127A5C(u8 taskId) +{ + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + { + sub_8197434(0, 0); + sub_81269D4(1); + sub_8127620(taskId); + } +} + +void sub_8127A8C(u8 taskId) +{ + s16 *data; + + data = gTasks[taskId].data; + sub_8127554(); + sub_81277A8(); + sub_81AE6C8(data[13], NULL, NULL); + free(sDecorPCBuffer); + sub_8126E44(taskId); +} + +void sub_8127ACC(u8 taskId) +{ + gTasks[taskId].data[3] = gSaveBlock1Ptr->pos.x; + gTasks[taskId].data[4] = gSaveBlock1Ptr->pos.y; + PlayerGetDestCoords(&gTasks[taskId].data[0], &gTasks[taskId].data[1]); +} + +void sub_8127B04(u8 taskId) +{ + DrawWholeMapView(); + Overworld_SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, gTasks[taskId].data[3], gTasks[taskId].data[4]); + warp_in(); +} + +u16 sub_8127B54(u8 decor, u8 a1) +{ + u16 resp; + + resp = -1; + switch (decor) + { + case DECOR_STAND: + resp = gUnknown_085A72E4[a1] << 12; + return resp; + case DECOR_SLIDE: + resp = gUnknown_085A72EC[a1] << 12; + return resp; + default: + return resp; + } +} + +void sub_8127B90(u16 mapX, u16 mapY, u8 decWidth, u8 decHeight, u16 decor) +{ + u16 i; + u16 j; + u16 behavior; + u16 flags; + u16 v0; + u16 v1; + s16 decLeft; + s16 decBottom; + + for (i = 0; i < decHeight; i ++) + { + decBottom = mapY - decHeight + 1 + i; + for (j = 0; j < decWidth; j ++) + { + decLeft = mapX + j; + behavior = GetBehaviorByMetatileId(0x200 + gDecorations[decor].tiles[i * decWidth + j]); + if (MetatileBehavior_IsMB_B9(behavior) == TRUE || (gDecorations[decor].permission != DECORPERM_PASS_FLOOR && (behavior >> 12))) + { + flags = 0xc00; + } + else + { + flags = 0x000; + } + if (gDecorations[decor].permission != DECORPERM_NA_WALL && MetatileBehavior_IsMB_B7(MapGridGetMetatileBehaviorAt(decLeft, decBottom)) == TRUE) + { + v0 = 1; + } + else + { + v0 = 0; + } + v1 = sub_8127B54(gDecorations[decor].id, i * decWidth + j); + if (v1 != 0xFFFF) + { + MapGridSetMetatileEntryAt(decLeft, decBottom, (gDecorations[decor].tiles[i * decWidth + j] + (0x200 | v0)) | flags | v1); + } + else + { + MapGridSetMetatileIdAt(decLeft, decBottom, (gDecorations[decor].tiles[i * decWidth + j] + (0x200 | v0)) | flags); + } + } + } +} + +void sub_8127D38(u16 mapX, u16 mapY, u16 decor) +{ + switch (gDecorations[decor].shape) + { + case DECORSHAPE_1x1: + sub_8127B90(mapX, mapY, 1, 1, decor); + break; + case DECORSHAPE_2x1: + sub_8127B90(mapX, mapY, 2, 1, decor); + break; + case DECORSHAPE_3x1: // unused + sub_8127B90(mapX, mapY, 3, 1, decor); + break; + case DECORSHAPE_4x2: + sub_8127B90(mapX, mapY, 4, 2, decor); + break; + case DECORSHAPE_2x2: + sub_8127B90(mapX, mapY, 2, 2, decor); + break; + case DECORSHAPE_1x2: + sub_8127B90(mapX, mapY, 1, 2, decor); + break; + case DECORSHAPE_1x3: // unused + sub_8127B90(mapX, mapY, 1, 3, decor); + break; + case DECORSHAPE_2x4: + sub_8127B90(mapX, mapY, 2, 4, decor); + break; + case DECORSHAPE_3x3: + sub_8127B90(mapX, mapY, 3, 3, decor); + break; + case DECORSHAPE_3x2: + sub_8127B90(mapX, mapY, 3, 2, decor); + break; + } +} + +void sub_8127E18(void) +{ + u8 i; + u8 j; + + for (i = 0; i < 14; i ++) + { + if (FlagGet(0xAE + i) == TRUE) + { + FlagClear(0xAE + i); + for (j = 0; j < gMapHeader.events->mapObjectCount; j ++) + { + if (gMapHeader.events->mapObjects[j].flagId == 0xAE + i) + { + break; + } + } + VarSet(0x3F20 + gMapHeader.events->mapObjects[j].graphicsId, sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0]); + gSpecialVar_0x8005 = gMapHeader.events->mapObjects[j].localId; + gSpecialVar_0x8006 = sCurDecorMapX; + gSpecialVar_0x8007 = sCurDecorMapY; + show_sprite(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); + sub_808EBA8(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gSpecialVar_0x8006, gSpecialVar_0x8007); + sub_808F254(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); + break; + } + } +} + +bool8 sub_8127F38(void) +{ + u16 i; + + for (i = 0; i < gUnknown_0203A17C.size; i ++) + { + if (gUnknown_0203A17C.items[i] == DECOR_NONE) + { + return TRUE; + } + } + return FALSE; +} + +void sub_8127F68(u8 taskId) +{ + if (gUnknown_0203A17C.isPlayerRoom == TRUE && sCurDecorationCategory != DECORCAT_DOLL && sCurDecorationCategory != DECORCAT_CUSHION) + { + StringExpandPlaceholders(gStringVar4, gText_CantPlaceInRoom); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8127A5C); + } + else if (IsSelectedDecorInThePC() == TRUE) + { + if (sub_8127F38() == TRUE) + { + fade_screen(1, 0); + gTasks[taskId].data[2] = 0; + gTasks[taskId].func = sub_8128060; + } + else + { + ConvertIntToDecimalStringN(gStringVar1, gUnknown_0203A17C.size, STR_CONV_MODE_RIGHT_ALIGN, 2); + if (gUnknown_0203A17C.isPlayerRoom == FALSE) { + StringExpandPlaceholders(gStringVar4, gText_NoMoreDecorations); + } + else + { + StringExpandPlaceholders(gStringVar4, gText_NoMoreDecorations2); + } + DisplayItemMessageOnField(taskId, gStringVar4, sub_8127A5C); + } + } + else + { + StringExpandPlaceholders(gStringVar4, gText_InUseAlready); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8127A5C); + } +} + +void sub_8128060(u8 taskId) +{ + switch (gTasks[taskId].data[2]) + { + case 0: + if (!gPaletteFade.active) + { + sub_8127ACC(taskId); + gTasks[taskId].data[2] = 1; + } + break; + case 1: + gPaletteFade.bufferTransferDisabled = TRUE; + ConfigureCameraObjectForPlacingDecoration(&sPlaceDecorationGraphicsDataBuffer, gCurDecorInventoryItems[gCurDecorationIndex]); + sub_812826C(taskId); + SetUpPlacingDecorationPlayerAvatar(taskId, &sPlaceDecorationGraphicsDataBuffer); + pal_fill_black(); + gPaletteFade.bufferTransferDisabled = FALSE; + gTasks[taskId].data[2] = 2; + break; + case 2: + if (sub_80ABDFC() == TRUE) + { + gTasks[taskId].data[12] = 0; + sub_8128FD8(taskId); + } + break; + } +} + +void ConfigureCameraObjectForPlacingDecoration(struct PlaceDecorationGraphicsDataBuffer *data, u8 decor) +{ + sDecor_CameraSpriteObjectIdx1 = gSprites[gUnknown_03005DD0.unk4].data0; + gUnknown_03005DD0.unk4 = gpu_pal_decompress_alloc_tag_and_upload(data, decor); + gSprites[gUnknown_03005DD0.unk4].oam.priority = 1; + gSprites[gUnknown_03005DD0.unk4].callback = sub_81292D0; + gSprites[gUnknown_03005DD0.unk4].pos1.x = gUnknown_085A7250[data->decoration->shape].x; + gSprites[gUnknown_03005DD0.unk4].pos1.y = gUnknown_085A7250[data->decoration->shape].y; +} + +void SetUpPlacingDecorationPlayerAvatar(u8 taskId, struct PlaceDecorationGraphicsDataBuffer *data) +{ + u8 v0; + + v0 = 16 * (u8)gTasks[taskId].data[5] + gUnknown_085A7250[data->decoration->shape].x - 8 * ((u8)gTasks[taskId].data[5] - 1); + if (data->decoration->shape == DECORSHAPE_3x1 || data->decoration->shape == DECORSHAPE_3x3 || data->decoration->shape == DECORSHAPE_3x2) + { + v0 -= 8; + } + if (gSaveBlock2Ptr->playerGender == MALE) + { + sDecor_CameraSpriteObjectIdx2 = AddPseudoFieldObject(0xC1, SpriteCallbackDummy, v0, 0x48, 0); + } + else + { + sDecor_CameraSpriteObjectIdx2 = AddPseudoFieldObject(0xC2, SpriteCallbackDummy, v0, 0x48, 0); + } + gSprites[sDecor_CameraSpriteObjectIdx2].oam.priority = 1; + DestroySprite(&gSprites[sDecor_CameraSpriteObjectIdx1]); + sDecor_CameraSpriteObjectIdx1 = gUnknown_03005DD0.unk4; +} + +void sub_812826C(u8 taskId) +{ + switch (gDecorations[gCurDecorInventoryItems[gCurDecorationIndex]].shape) + { + case DECORSHAPE_1x1: + gTasks[taskId].data[5] = 1; + gTasks[taskId].data[6] = 1; + break; + case DECORSHAPE_2x1: + gTasks[taskId].data[5] = 2; + gTasks[taskId].data[6] = 1; + break; + case DECORSHAPE_3x1: + gTasks[taskId].data[5] = 3; + gTasks[taskId].data[6] = 1; + break; + case DECORSHAPE_4x2: + gTasks[taskId].data[5] = 4; + gTasks[taskId].data[6] = 2; + break; + case DECORSHAPE_2x2: + gTasks[taskId].data[5] = 2; + gTasks[taskId].data[6] = 2; + break; + case DECORSHAPE_1x2: + gTasks[taskId].data[5] = 1; + gTasks[taskId].data[6] = 2; + break; + case DECORSHAPE_1x3: + gTasks[taskId].data[5] = 1; + gTasks[taskId].data[6] = 3; + gTasks[taskId].data[1]++; + break; + case DECORSHAPE_2x4: + gTasks[taskId].data[5] = 2; + gTasks[taskId].data[6] = 4; + break; + case DECORSHAPE_3x3: + gTasks[taskId].data[5] = 3; + gTasks[taskId].data[6] = 3; + break; + case DECORSHAPE_3x2: + gTasks[taskId].data[5] = 3; + gTasks[taskId].data[6] = 2; + break; + } +} + +void sub_81283BC(u8 taskId) +{ + gTasks[taskId].data[10] = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data7 = 1; + gSprites[sDecor_CameraSpriteObjectIdx2].data7 = 1; + sub_8128DE0(); + sub_8128950(taskId); +} + +void sub_8128414(u8 taskId) +{ + gTasks[taskId].data[10] = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data7 = 1; + gSprites[sDecor_CameraSpriteObjectIdx2].data7 = 1; + sub_8128DE0(); + StringExpandPlaceholders(gStringVar4, gText_CancelDecorating); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8128B80); +} + +bool8 sub_8128484(u8 behaviorAt, u16 behaviorBy) +{ + if (MetatileBehavior_IsMB_B3(behaviorAt) != TRUE || behaviorBy != 0) + { + return FALSE; + } + return TRUE; +} + +bool8 sub_81284AC(u8 taskId, s16 x, s16 y, u16 decor) +{ + if (x == gTasks[taskId].data[3] + 7 && y == gTasks[taskId].data[4] + 7 && decor != DECOR_NONE) + { + return FALSE; + } + return TRUE; +} + +bool8 sub_81284F4(u16 behaviorAt, const struct Decoration *decoration) +{ + if (MetatileBehavior_IsMB_B3(behaviorAt) != TRUE) + { + if (decoration->id == DECOR_SOLID_BOARD && MetatileBehavior_IsMB_C2(behaviorAt) == TRUE) + { + return TRUE; + } + if (MetatileBehavior_IsNormal(behaviorAt)) + { + return TRUE; + } + } + return FALSE; +} + +bool8 sub_812853C(u8 taskId, const struct Decoration *decoration) +{ + u8 i; + u8 j; + u8 behaviorAt; + u16 behaviorBy; + u8 mapY; + u8 mapX; + s16 curY; + s16 curX; + mapY = gTasks[taskId].data[6]; + mapX = gTasks[taskId].data[5]; + + switch (decoration->permission) + { + case DECORPERM_SOLID_FLOOR: + case DECORPERM_PASS_FLOOR: + for (i=0; itiles[(mapY - 1 - i) * mapX + j]) & 0xf000; + if (!sub_81284F4(behaviorAt, decoration)) + { + return FALSE; + } + if (!sub_81284AC(taskId, curX, curY, behaviorBy)) + { + return FALSE; + } + behaviorAt = GetFieldObjectIdByXYZ(curX, curY, 0); + if (behaviorAt != 0 && behaviorAt != 16) + { + return FALSE; + } + } + } + break; + case DECORPERM_BEHIND_FLOOR: + for (i=0; itiles[(mapY - 1 - i) * mapX + j]) & 0xf000; + if (!MetatileBehavior_IsNormal(behaviorAt) && !sub_8128484(behaviorAt, behaviorBy)) + { + return FALSE; + } + if (!sub_81284AC(taskId, curX, curY, behaviorBy)) + { + return FALSE; + } + if (GetFieldObjectIdByXYZ(curX, curY, 0) != 16) + { + return FALSE; + } + } + } + curY = gTasks[taskId].data[1] - mapY + 1; + for (j=0; jtiles[j]) & 0xf000; + if (!MetatileBehavior_IsNormal(behaviorAt) && !MetatileBehavior_IsMB_B7(behaviorAt)) + { + return FALSE; + } + if (!sub_81284AC(taskId, curX, curY, behaviorBy)) + { + return FALSE; + } + behaviorAt = GetFieldObjectIdByXYZ(curX, curY, 0); + if (behaviorAt != 0 && behaviorAt != 16) + { + return FALSE; + } + } + break; + case DECORPERM_NA_WALL: + for (i=0; ishape == DECORSHAPE_1x2) + { + if (!MetatileBehavior_IsMB_C3(behaviorAt)) + { + return FALSE; + } + } + else if (!MetatileBehavior_IsMB_B5(behaviorAt)) + { + if (!MetatileBehavior_IsMB_C3(behaviorAt)) + { + return FALSE; + } + } + if (GetFieldObjectIdByXYZ(curX, curY, 0) != 16) + { + return FALSE; + } + } + break; + } + return TRUE; +} + +void sub_8128950(u8 taskId) +{ + if (sub_812853C(taskId, &gDecorations[gCurDecorInventoryItems[gCurDecorationIndex]]) == TRUE) + { + StringExpandPlaceholders(gStringVar4, gText_PlaceItHere); + DisplayItemMessageOnField(taskId, gStringVar4, sub_81289D0); + } + else + { + PlaySE(SE_HAZURE); + StringExpandPlaceholders(gStringVar4, gText_CantBePlacedHere); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8129020); + } +} + +void sub_81289D0(u8 taskId) +{ + sub_8197930(); + sub_8121F68(taskId, &gUnknown_085A72C4); +} + +void sub_81289F0(u8 taskId) +{ + sub_8197434(0, 0); + sub_8128AAC(taskId); + if (gDecorations[gCurDecorInventoryItems[gCurDecorationIndex]].permission != DECORPERM_SOLID_MAT) + { + sub_8127D38(gTasks[taskId].data[0], gTasks[taskId].data[1], gCurDecorInventoryItems[gCurDecorationIndex]); + } + else + { + sCurDecorMapX = gTasks[taskId].data[0] - 7; + sCurDecorMapY = gTasks[taskId].data[1] - 7; + ScriptContext1_SetupScript(gUnknown_08275D1F); + } + gSprites[sDecor_CameraSpriteObjectIdx1].pos1.y += 2; + if (gMapHeader.regionMapSectionId == REGION_MAP_SECRET_BASE) + { + TV_PutSecretBaseVisitOnTheAir(); + } + sub_8128BBC(taskId); +} + +void sub_8128AAC(u8 taskId) +{ + u16 i; + + for (i = 0; i < gUnknown_0203A17C.size; i ++) + { + if (gUnknown_0203A17C.items[i] == DECOR_NONE) + { + gUnknown_0203A17C.items[i] = gCurDecorInventoryItems[gCurDecorationIndex]; + gUnknown_0203A17C.pos[i] = ((gTasks[taskId].data[0] - 7) << 4) + (gTasks[taskId].data[1] - 7); + break; + } + } + if (!gUnknown_0203A17C.isPlayerRoom) + { + for (i = 0; i < 16; i ++) + { + if (sSecretBaseItemsIndicesBuffer[i] == 0) + { + sSecretBaseItemsIndicesBuffer[i] = gCurDecorationIndex + 1; + break; + } + } + } + else + { + for (i = 0; i < 12; i ++) + { + if (sPlayerRoomItemsIndicesBuffer[i] == 0) + { + sPlayerRoomItemsIndicesBuffer[i] = gCurDecorationIndex + 1; + break; + } + } + } +} + +void sub_8128B80(u8 taskId) +{ + sub_8197930(); + sub_8121F68(taskId, &gUnknown_085A72CC); +} + +void sub_8128BA0(u8 taskId) +{ + sub_8197434(0, 0); + sub_8128BBC(taskId); +} + +void sub_8128BBC(u8 taskId) +{ + fade_screen(1, 0); + gTasks[taskId].data[2] = 0; + gTasks[taskId].func = c1_overworld_prev_quest; +} + +void c1_overworld_prev_quest(u8 taskId) +{ + switch (gTasks[taskId].data[2]) + { + case 0: + ScriptContext2_Enable(); + if (!gPaletteFade.active) + { + sub_8127B04(taskId); + gTasks[taskId].data[2] = 1; + } + break; + case 1: + sub_812A3C8(); + FreeSpritePaletteByTag(OVERWORLD_PLACE_DECOR_SELECTOR_PAL_TAG); + gFieldCallback = sub_8128CD4; + SetMainCallback2(c2_exit_to_overworld_2_switch); + DestroyTask(taskId); + break; + } +} + +void sub_8128C64(u8 taskId) +{ + s16 *data; + + data = gTasks[taskId].data; + switch (data[2]) + { + case 0: + sub_80E9578(); + data[2] ++; + break; + case 1: + ScriptContext1_SetupScript(gUnknown_08275D0C); + data[2] ++; + break; + case 2: + ScriptContext2_Enable(); + data[2] ++; + break; + case 3: + if (sub_80ABDFC() == TRUE) + { + gTasks[taskId].func = sub_812764C; + } + break; + } +} + +void sub_8128CD4(void) +{ + u8 taskId; + + ScriptContext2_Enable(); + pal_fill_black(); + taskId = CreateTask(sub_8128C64, 8); + sub_8127580(taskId); + gTasks[taskId].data[2] = 0; +} + +bool8 sub_8128D10(u8 taskId) +{ + s16 *data; + + data = gTasks[taskId].data; + if (sDecorationLastDirectionMoved == DIR_SOUTH && data[1] - data[6] - 6 < 0) + { + data[1] ++; + return FALSE; + } + if (sDecorationLastDirectionMoved == DIR_NORTH && data[1] - 7 >= gMapHeader.mapData->height) + { + data[1] --; + return FALSE; + } + if (sDecorationLastDirectionMoved == DIR_WEST && data[0] - 7 < 0) + { + data[0] ++; + return FALSE; + } + if (sDecorationLastDirectionMoved == DIR_EAST && data[0] + data[5] - 8 >= gMapHeader.mapData->width) + { + data[0] --; + return FALSE; + } + return TRUE; +} + +bool8 sub_8128DB4(void) +{ + u16 heldKeys; + + heldKeys = gMain.heldKeys & 0x0F0; + if (heldKeys != DPAD_UP && heldKeys != DPAD_DOWN && heldKeys != DPAD_LEFT && heldKeys != DPAD_RIGHT) + { + return FALSE; + } + return TRUE; +} + +void sub_8128DE0(void) +{ + sDecorationLastDirectionMoved = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data2 = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data3 = 0; +} + +void sub_8128E18(u8 taskId) +{ + s16 *data; + + data = gTasks[taskId].data; + if (!gSprites[sDecor_CameraSpriteObjectIdx1].data4) + { + if (data[10] == 1) + { + gUnknown_085A72D4[data[12]].yesFunc(taskId); + return; + } else if (data[10] == 2) + { + gUnknown_085A72D4[data[12]].noFunc(taskId); + return; + } + if ((gMain.heldKeys & 0x0F0) == DPAD_UP) + { + sDecorationLastDirectionMoved = DIR_SOUTH; + gSprites[sDecor_CameraSpriteObjectIdx1].data2 = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data3 = -2; + data[1]--; + } + if ((gMain.heldKeys & 0x0F0) == DPAD_DOWN) + { + sDecorationLastDirectionMoved = DIR_NORTH; + gSprites[sDecor_CameraSpriteObjectIdx1].data2 = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data3 = 2; + data[1]++; + } + if ((gMain.heldKeys & 0x0F0) == DPAD_LEFT) + { + sDecorationLastDirectionMoved = DIR_WEST; + gSprites[sDecor_CameraSpriteObjectIdx1].data2 = -2; + gSprites[sDecor_CameraSpriteObjectIdx1].data3 = 0; + data[0]--; + } + if ((gMain.heldKeys & 0x0F0) == DPAD_RIGHT) + { + sDecorationLastDirectionMoved = DIR_EAST; + gSprites[sDecor_CameraSpriteObjectIdx1].data2 = 2; + gSprites[sDecor_CameraSpriteObjectIdx1].data3 = 0; + data[0]++; + } + if (!sub_8128DB4() || !sub_8128D10(taskId)) + { + sub_8128DE0(); + } + } + if (sDecorationLastDirectionMoved) + { + gSprites[sDecor_CameraSpriteObjectIdx1].data4++; + gSprites[sDecor_CameraSpriteObjectIdx1].data4 &= 7; + } + if (!data[10]) + { + if (gMain.newKeys & A_BUTTON) + { + data[10] = A_BUTTON; + } + if (gMain.newKeys & B_BUTTON) + { + data[10] = B_BUTTON; + } + } +} + +void sub_8128FD8(u8 taskId) +{ + sub_8197434(0, 1); + gSprites[sDecor_CameraSpriteObjectIdx1].data7 = 0; + gTasks[taskId].data[10] = 0; + gTasks[taskId].func = sub_8128E18; +} + +void sub_8129020(u8 taskId) +{ + if (gMain.newKeys & A_BUTTON || gMain.newKeys & B_BUTTON) + { + sub_8128FD8(taskId); + } +} + +void sub_8129048(struct PlaceDecorationGraphicsDataBuffer *data) +{ + CpuFill16(0, data, sizeof(*data)); +} + +void sub_8129068(u16 *dest, u16 pal) +{ + CpuFastCopy(&((u16 *)gTilesetPointer_SecretBase->palettes)[pal << 4], dest, 32); +} + +void sub_8129088(u8 *dest, u16 tile) +{ + u8 buffer[32]; + u16 mode; + u16 i; + + mode = tile >> 10; + if (tile != 0) + { + tile &= 0x03FF; + } + CpuFastCopy(&((u8 *)gTilesetPointer_SecretBase->tiles)[tile << 5], buffer, 32); + switch (mode) + { + case 0: + CpuFastCopy(buffer, dest, 32); + break; + case 1: + for (i = 0; i < 8; i ++) + { + dest[4 * i] = (buffer[4 * (i + 1) - 1] >> 4) + ((buffer[4 * (i + 1) - 1] & 0x0F) << 4); + dest[4 * i + 1] = (buffer[4 * (i + 1) - 2] >> 4) + ((buffer[4 * (i + 1) - 2] & 0x0F) << 4); + dest[4 * i + 2] = (buffer[4 * (i + 1) - 3] >> 4) + ((buffer[4 * (i + 1) - 3] & 0x0F) << 4); + dest[4 * i + 3] = (buffer[4 * (i + 1) - 4] >> 4) + ((buffer[4 * (i + 1) - 4] & 0x0F) << 4); + } + break; + case 2: + for (i = 0; i < 8; i ++) + { + dest[4 * i] = buffer[4 * (7 - i)]; + dest[4 * i + 1] = buffer[4 * (7 - i) + 1]; + dest[4 * i + 2] = buffer[4 * (7 - i) + 2]; + dest[4 * i + 3] = buffer[4 * (7 - i) + 3]; + } + break; + case 3: + for (i = 0; i < 32; i ++) + { + dest[i] = (buffer[31 - i] >> 4) + ((buffer[31 - i] & 0x0F) << 4); + } + break; + } +} + +void sub_81291A4(struct PlaceDecorationGraphicsDataBuffer *data) +{ + u16 i; + for (i = 0; i < 64; i ++) + { + sub_8129088(&data->image[i * 32], data->tiles[i]); + } +} + +u16 sub_81291CC(u16 tile) +{ + return ((u16 *)gTilesetPointer_SecretBaseRedCave->metatiles)[tile] & 0xFFF; +} + +void sub_81291E8(struct PlaceDecorationGraphicsDataBuffer *data) +{ + u8 i; + u8 shape; + + shape = data->decoration->shape; + for (i = 0; i < gUnknown_085A71B0[shape].size; i ++) + { + data->tiles[gUnknown_085A71B0[shape].tiles[i]] = sub_81291CC(data->decoration->tiles[gUnknown_085A71B0[shape].y[i]] * 8 + gUnknown_085A71B0[shape].x[i]); + } +} + +void SetDecorSelectionBoxOamAttributes(u8 decorShape) +{ + sDecorSelectorOam.y = 0; + sDecorSelectorOam.affineMode = ST_OAM_AFFINE_OFF; + sDecorSelectorOam.objMode = ST_OAM_OBJ_NORMAL; + sDecorSelectorOam.mosaic = 0; + sDecorSelectorOam.bpp = ST_OAM_4BPP; + sDecorSelectorOam.shape = gUnknown_085A7250[decorShape].shape; + sDecorSelectorOam.x = 0; + sDecorSelectorOam.matrixNum = 0; + sDecorSelectorOam.size = gUnknown_085A7250[decorShape].size; + sDecorSelectorOam.tileNum = 0; + sDecorSelectorOam.priority = 0; + sDecorSelectorOam.paletteNum = 0; +} + +void sub_81292D0(struct Sprite *sprite) +{ + sprite->data2 = 0; + sprite->data3 = 0; + sprite->data4 = 0; + sprite->data5 = 0; + sprite->data6 = 0; + sprite->data7 = 0; + sprite->callback = sub_81292E8; +} + +void sub_81292E8(struct Sprite *sprite) +{ + if (sprite->data7 == 0) + { + if (sprite->data6 < 15) + { + sprite->invisible = FALSE; + } + else + { + sprite->invisible = TRUE; + } + sprite->data6 ++; + sprite->data6 &= 0x1F; + } + else + { + sprite->invisible = FALSE; + } +} + +u8 gpu_pal_decompress_alloc_tag_and_upload(struct PlaceDecorationGraphicsDataBuffer *data, u8 decor) +{ + sub_8129048(data); + data->decoration = &gDecorations[decor]; + if (data->decoration->permission == DECORPERM_SOLID_MAT) + { + return AddPseudoFieldObject(data->decoration->tiles[0], SpriteCallbackDummy, 0, 0, 1); + } + FreeSpritePaletteByTag(OVERWORLD_PLACE_DECOR_SELECTOR_PAL_TAG); + sub_81291E8(data); + SetDecorSelectionBoxOamAttributes(data->decoration->shape); + sub_81291A4(data); + sub_8129068(data->palette, ((u16 *)gTilesetPointer_SecretBaseRedCave->metatiles)[(data->decoration->tiles[0] * 8) + 7] >> 12); + LoadSpritePalette(&gUnknown_085A72BC); + return CreateSprite(&sDecorSelectorSpriteTemplate, 0, 0, 0); +} + +u8 AddDecorationIconObjectFromIconTable(u16 tilesTag, u16 paletteTag, u8 decor) +{ + struct SpriteSheet sheet; + struct CompressedSpritePalette palette; + struct SpriteTemplate *template; + u8 spriteId; + + if (!AllocItemIconTemporaryBuffers()) + { + return MAX_SPRITES; + } + LZDecompressWram(GetDecorationIconPicOrPalette(decor, 0), gUnknown_0203CEBC); + CopyItemIconPicTo4x4Buffer(gUnknown_0203CEBC, gUnknown_0203CEC0); + sheet.data = gUnknown_0203CEC0; + sheet.size = 0x200; + sheet.tag = tilesTag; + LoadSpriteSheet(&sheet); + palette.data = GetDecorationIconPicOrPalette(decor, 1); + palette.tag = paletteTag; + LoadCompressedObjectPalette(&palette); + template = malloc(sizeof(struct SpriteTemplate)); + *template = gUnknown_08614FF4; + template->tileTag = tilesTag; + template->paletteTag = paletteTag; + spriteId = CreateSprite(template, 0, 0, 0); + FreeItemIconTemporaryBuffers(); + free(template); + return spriteId; +} + +const u8 *GetDecorationIconPicOrPalette(u16 decor, u8 mode) +{ + if (decor > 120) + { + decor = DECOR_NONE; + } + return gUnknown_085A6BE8[decor][mode]; +} + +u8 AddDecorationIconObjectFromFieldObject(u16 tilesTag, u16 paletteTag, u8 decor) +{ + u8 spriteId; + struct SpriteSheet sheet; + struct SpritePalette palette; + struct SpriteTemplate *template; + + sub_8129048(&sPlaceDecorationGraphicsDataBuffer); + sPlaceDecorationGraphicsDataBuffer.decoration = &gDecorations[decor]; + if (sPlaceDecorationGraphicsDataBuffer.decoration->permission != DECORPERM_SOLID_MAT) + { + sub_81291E8(&sPlaceDecorationGraphicsDataBuffer); + SetDecorSelectionBoxOamAttributes(sPlaceDecorationGraphicsDataBuffer.decoration->shape); + sub_81291A4(&sPlaceDecorationGraphicsDataBuffer); + sub_8129068(sPlaceDecorationGraphicsDataBuffer.palette, ((u16 *)gTilesetPointer_SecretBaseRedCave->metatiles)[(sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0] * 8) + 7] >> 12); + sheet.data = sPlaceDecorationGraphicsDataBuffer.image; + sheet.size = gUnknown_085A72F4[sPlaceDecorationGraphicsDataBuffer.decoration->shape] << 5; + sheet.tag = tilesTag; + LoadSpriteSheet(&sheet); + palette.data = sPlaceDecorationGraphicsDataBuffer.palette; + palette.tag = paletteTag; + LoadSpritePalette(&palette); + template = Alloc(sizeof(struct SpriteTemplate)); + *template = sDecorWhilePlacingSpriteTemplate; + template->tileTag = tilesTag; + template->paletteTag = paletteTag; + spriteId = CreateSprite(template, 0, 0, 0); + free(template); + } + else + { + spriteId = AddPseudoFieldObject(sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0], SpriteCallbackDummy, 0, 0, 1); + } + return spriteId; +} + +u8 AddDecorationIconObject(u8 decor, s16 x, s16 y, u8 priority, u16 tilesTag, u16 paletteTag) +{ + u8 spriteId; + + if (decor > 120) + { + spriteId = AddDecorationIconObjectFromIconTable(tilesTag, paletteTag, DECOR_NONE); + if (spriteId == MAX_SPRITES) + { + return MAX_SPRITES; + } + gSprites[spriteId].pos2.x = x + 4; + gSprites[spriteId].pos2.y = y + 4; + } + else if (gUnknown_085A6BE8[decor][0] == NULL) + { + spriteId = AddDecorationIconObjectFromFieldObject(tilesTag, paletteTag, decor); + if (spriteId == MAX_SPRITES) + { + return MAX_SPRITES; + } + gSprites[spriteId].pos2.x = x; + if (decor == DECOR_SILVER_SHIELD || decor == DECOR_GOLD_SHIELD) + { + gSprites[spriteId].pos2.y = y - 4; + } + else + { + gSprites[spriteId].pos2.y = y; + } + } + else + { + spriteId = AddDecorationIconObjectFromIconTable(tilesTag, paletteTag, decor); + if (spriteId == MAX_SPRITES) + { + return MAX_SPRITES; + } + gSprites[spriteId].pos2.x = x + 4; + gSprites[spriteId].pos2.y = y + 4; + } + gSprites[spriteId].oam.priority = priority; + return spriteId; +} + +void sub_81296EC(u8 idx) +{ + gUnknown_0203A17C.items[idx] = 0; + gUnknown_0203A17C.pos[idx] = 0; +} + +void sub_8129708(void) +{ + u16 i; + + gSpecialVar_0x8005 = 0; + gScriptResult = 0; + if (gSpecialVar_0x8004 == sCurDecorSelectedInRearrangement) + { + gScriptResult = 1; + } + else if (gDecorations[gUnknown_0203A17C.items[sDecorRearrangementDataBuffer[gSpecialVar_0x8004].idx]].permission == DECORPERM_SOLID_MAT) + { + gSpecialVar_0x8005 = sDecorRearrangementDataBuffer[gSpecialVar_0x8004].flagId; + sub_81296EC(sDecorRearrangementDataBuffer[gSpecialVar_0x8004].idx); + for (i = 0; i < gMapHeader.events->mapObjectCount; i ++) + { + if (gMapHeader.events->mapObjects[i].flagId == gSpecialVar_0x8005) + { + gSpecialVar_0x8006 = gMapHeader.events->mapObjects[i].localId; + break; + } + } + } +} + +void sub_81297AC(void) +{ + u8 i; + + for (i = 0; i < gMapHeader.events->mapObjectCount; i ++) + { + if (gMapHeader.events->mapObjects[i].flagId == gSpecialVar_0x8004) + { + gSpecialVar_0x8005 = gMapHeader.events->mapObjects[i].localId; + break; + } + } +} + +void sub_81297F8(void) +{ + u8 i; + u8 y; + u8 x; + int posX; + int posY; + u8 perm; + + for (i = 0; i < sCurDecorSelectedInRearrangement; i ++) + { + perm = gDecorations[gUnknown_0203A17C.items[sDecorRearrangementDataBuffer[i].idx]].permission; + posX = gUnknown_0203A17C.pos[sDecorRearrangementDataBuffer[i].idx] >> 4; + posY = gUnknown_0203A17C.pos[sDecorRearrangementDataBuffer[i].idx] & 0x0F; + if (perm != DECORPERM_SOLID_MAT) + { + for (y = 0; y < sDecorRearrangementDataBuffer[i].height; y ++) + { + for (x = 0; x < sDecorRearrangementDataBuffer[i].width; x ++) + { + MapGridSetMetatileEntryAt(posX + 7 + x, posY + 7 - y, gMapHeader.mapData->map[posX + x + gMapHeader.mapData->width * (posY - y)] | 0x3000); + } + } + sub_81296EC(sDecorRearrangementDataBuffer[i].idx); + } + } +} + +void sub_81298EC(u8 taskId) +{ + switch (gTasks[taskId].data[2]) + { + case 0: + sub_81297F8(); + gTasks[taskId].data[2] = 1; + break; + case 1: + if (!gPaletteFade.active) { + DrawWholeMapView(); + ScriptContext1_SetupScript(gUnknown_08275D2E); + sub_8197434(0, 1); + gTasks[taskId].data[2] = 2; + } + break; + case 2: + ScriptContext2_Enable(); + IdentifyOwnedDecorationsCurrentlyInUseInternal(taskId); + pal_fill_black(); + gTasks[taskId].data[2] = 3; + break; + case 3: + if (sub_80ABDFC() == TRUE) + { + StringExpandPlaceholders(gStringVar4, gText_DecorationReturnedToPC); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8129D64); + if (gMapHeader.regionMapSectionId == REGION_MAP_SECRET_BASE) + { + TV_PutSecretBaseVisitOnTheAir(); + } + } + break; + } +} + + +bool8 sub_81299AC(u8 taskId) +{ + u16 i; + + for (i = 0; i < gUnknown_0203A17C.size; i ++) + { + if (gUnknown_0203A17C.items[i] != DECOR_NONE) + { + return TRUE; + } + } + return FALSE; +} + +void SetUpPuttingAwayDecorationPlayerAvatar(void) +{ + player_get_direction_lower_nybble(); + sDecor_CameraSpriteObjectIdx1 = gSprites[gUnknown_03005DD0.unk4].data0; + sub_812A39C(); + gUnknown_03005DD0.unk4 = CreateSprite(&gUnknown_085A7404, 0x78, 0x50, 0); + if (gSaveBlock2Ptr->playerGender == MALE) + { + sDecor_CameraSpriteObjectIdx2 = AddPseudoFieldObject(0xC1, SpriteCallbackDummy, 0x88, 0x48, 0); + } + else + { + sDecor_CameraSpriteObjectIdx2 = AddPseudoFieldObject(0xC2, SpriteCallbackDummy, 0x88, 0x48, 0); + } + gSprites[sDecor_CameraSpriteObjectIdx2].oam.priority = 1; + DestroySprite(&gSprites[sDecor_CameraSpriteObjectIdx1]); + sDecor_CameraSpriteObjectIdx1 = gUnknown_03005DD0.unk4; + gSprites[sDecor_CameraSpriteObjectIdx1].oam.priority = 1; +} + +void sub_8129ABC(u8 taskId) +{ + s16 *data; + + data = gTasks[taskId].data; + switch (data[2]) + { + case 0: + if (!gPaletteFade.active) + { + sub_8127ACC(taskId); + data[2] = 1; + data[6] = 1; + data[5] = 1; + } + break; + case 1: + SetUpPuttingAwayDecorationPlayerAvatar(); + pal_fill_black(); + data[2] = 2; + break; + case 2: + if (sub_80ABDFC() == TRUE) + { + data[12] = 1; + sub_8129B34(taskId); + } + break; + } +} + +void sub_8129B34(u8 taskId) +{ + sub_8197434(0, 1); + gSprites[sDecor_CameraSpriteObjectIdx1].data7 = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].invisible = FALSE; + gSprites[sDecor_CameraSpriteObjectIdx1].callback = sub_812A36C; + gSprites[sDecor_CameraSpriteObjectIdx2].pos1.x = 0x88; + gSprites[sDecor_CameraSpriteObjectIdx2].pos1.y = 0x48; + gTasks[taskId].data[10] = 0; + gTasks[taskId].func = sub_8128E18; +} + +void sub_8129BCC(u8 taskId) +{ + gTasks[taskId].data[10] = 0; + sub_8128DE0(); + sub_8129C74(taskId); +} + +void sub_8129BF8(u8 taskId) +{ + gTasks[taskId].data[10] = 0; + sub_8128DE0(); + gSprites[sDecor_CameraSpriteObjectIdx1].invisible = FALSE; + gSprites[sDecor_CameraSpriteObjectIdx1].callback = SpriteCallbackDummy; + StringExpandPlaceholders(gStringVar4, gText_StopPuttingAwayDecorations); + DisplayItemMessageOnField(taskId, gStringVar4, sub_812A1F0); +} + +void sub_8129C74(u8 taskId) +{ + s16 *data; + u8 behavior; + + sub_812A0E8(taskId); + if (sCurDecorSelectedInRearrangement != 0) + { + StringExpandPlaceholders(gStringVar4, gText_ReturnDecorationToPC); + DisplayItemMessageOnField(taskId, gStringVar4, sub_812A1A0); + } + else + { + data = gTasks[taskId].data; + behavior = MapGridGetMetatileBehaviorAt(data[0], data[1]); + if (MetatileBehavior_IsSecretBasePC(behavior) == TRUE || MetatileBehavior_IsMB_C5(behavior) == TRUE) + { + gSprites[sDecor_CameraSpriteObjectIdx1].invisible = FALSE; + gSprites[sDecor_CameraSpriteObjectIdx1].callback = SpriteCallbackDummy; + StringExpandPlaceholders(gStringVar4, gText_StopPuttingAwayDecorations); + DisplayItemMessageOnField(taskId, gStringVar4, sub_812A1F0); + } + else + { + StringExpandPlaceholders(gStringVar4, gText_NoDecorationHere); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8129D64); + } + } +} + +void sub_8129D64(u8 taskId) +{ + if (gMain.newKeys & A_BUTTON || gMain.newKeys & B_BUTTON) + { + sub_8129B34(taskId); + } +} + +void sub_8129D8C(u8 decor, struct DecorRearrangementDataBuffer *data) +{ + if (gDecorations[decor].shape == DECORSHAPE_1x1) + { + data->width = 1; + data->height = 1; + } else if (gDecorations[decor].shape == DECORSHAPE_2x1) + { + data->width = 2; + data->height = 1; + } else if (gDecorations[decor].shape == DECORSHAPE_3x1) + { + data->width = 3; + data->height = 1; + } else if (gDecorations[decor].shape == DECORSHAPE_4x2) + { + data->width = 4; + data->height = 2; + } else if (gDecorations[decor].shape == DECORSHAPE_2x2) + { + data->width = 2; + data->height = 2; + } else if (gDecorations[decor].shape == DECORSHAPE_1x2) + { + data->width = 1; + data->height = 2; + } else if (gDecorations[decor].shape == DECORSHAPE_1x3) + { + data->width = 1; + data->height = 3; + } else if (gDecorations[decor].shape == DECORSHAPE_2x4) + { + data->width = 2; + data->height = 4; + } else if (gDecorations[decor].shape == DECORSHAPE_3x3) + { + data->width = 3; + data->height = 3; + } else if (gDecorations[decor].shape == DECORSHAPE_3x2) + { + data->width = 3; + data->height = 2; + } +} + +void sub_8129E0C(u8 x, u8 y) +{ + gSprites[sDecor_CameraSpriteObjectIdx1].invisible = TRUE; + gSprites[sDecor_CameraSpriteObjectIdx1].callback = SpriteCallbackDummy; + gSprites[sDecor_CameraSpriteObjectIdx2].pos1.x = (x << 4) + 0x88; + gSprites[sDecor_CameraSpriteObjectIdx2].pos1.y = (y << 4) + 0x48; +} + +bool8 sub_8129E74(u8 taskId, u8 idx, struct DecorRearrangementDataBuffer *data) +{ + u8 x; + u8 y; + u8 xOff; + u8 yOff; + u8 ht; + + x = gTasks[taskId].data[0] - 7; + y = gTasks[taskId].data[1] - 7; + xOff = gUnknown_0203A17C.pos[idx] >> 4; + yOff = gUnknown_0203A17C.pos[idx] & 0x0F; + ht = data->height; + if (gUnknown_0203A17C.items[idx] == DECOR_SAND_ORNAMENT && MapGridGetMetatileIdAt(xOff + 7, yOff + 7) == 0x28C) + { + ht --; + } + if (x >= xOff && x < xOff + data->width && y > yOff - ht && y <= yOff) + { + sub_8129E0C(data->width - (x - xOff + 1), yOff - y); + return TRUE; + } + return FALSE; +} + +void sub_8129F20(void) +{ + u8 xOff; + u8 yOff; + u16 i; + + xOff = gUnknown_0203A17C.pos[sDecorRearrangementDataBuffer[sCurDecorSelectedInRearrangement].idx] >> 4; + yOff = gUnknown_0203A17C.pos[sDecorRearrangementDataBuffer[sCurDecorSelectedInRearrangement].idx] & 0x0F; + for (i = 0; i < 0x40; i ++) + { + if (gSaveBlock1Ptr->mapObjectTemplates[i].x == xOff && gSaveBlock1Ptr->mapObjectTemplates[i].y == yOff && !FlagGet(gSaveBlock1Ptr->mapObjectTemplates[i].flagId)) + { + sDecorRearrangementDataBuffer[sCurDecorSelectedInRearrangement].flagId = gSaveBlock1Ptr->mapObjectTemplates[i].flagId; + break; + } + } +} + +bool8 sub_8129FC8(u8 taskId) +{ + u16 i; + + for (i = 0; i < gUnknown_0203A17C.size; i ++) + { + if (gUnknown_0203A17C.items[i] != 0) + { + if (gDecorations[gUnknown_0203A17C.items[i]].permission == DECORPERM_SOLID_MAT) + { + sub_8129D8C(gUnknown_0203A17C.items[i], sDecorRearrangementDataBuffer); + if (sub_8129E74(taskId, i, sDecorRearrangementDataBuffer) == TRUE) + { + sDecorRearrangementDataBuffer->idx = i; + sub_8129F20(); + sCurDecorSelectedInRearrangement = 1; + return TRUE; + } + } + } + } + return FALSE; +} + +void sub_812A040(u8 left, u8 top, u8 right, u8 bottom) +{ + u8 i; + u8 xOff; + u8 yOff; + u8 decorIdx; + + for (i = 0; i < gUnknown_0203A17C.size; i ++) + { + decorIdx = gUnknown_0203A17C.items[i]; + xOff = gUnknown_0203A17C.pos[i] >> 4; + yOff = gUnknown_0203A17C.pos[i] & 0x0F; + if (decorIdx != 0 && gDecorations[decorIdx].permission == DECORPERM_SOLID_MAT && left <= xOff && top <= yOff && right >= xOff && bottom >= yOff) + { + sDecorRearrangementDataBuffer[sCurDecorSelectedInRearrangement].idx = i; + sub_8129F20(); + sCurDecorSelectedInRearrangement++; + } + } +} + +#ifdef NONMATCHING +void sub_812A0E8(u8 taskId) +{ + u8 i; + u8 xOff; + u8 yOff; + u8 decor; + register u8 decor asm("r1"); + struct DecorRearrangementDataBuffer *data; + + sCurDecorSelectedInRearrangement = 0; + if (sub_8129FC8(taskId) != TRUE) + { + for (i = 0; i < gUnknown_0203A17C.size; i ++) + { + decor = gUnknown_0203A17C.items[i]; + if (decor != DECOR_NONE) + { + data = &sDecorRearrangementDataBuffer[0]; + sub_8129D8C(decor, data); + if (sub_8129E74(taskId, i, data) == TRUE) + { + data->idx = i; + sCurDecorSelectedInRearrangement ++; + break; + } + } + } + if (sCurDecorSelectedInRearrangement != 0) + { + xOff = gUnknown_0203A17C.pos[sDecorRearrangementDataBuffer[0].idx] >> 4; + yOff = gUnknown_0203A17C.pos[sDecorRearrangementDataBuffer[0].idx] & 0x0F; + sub_812A040(xOff, yOff - sDecorRearrangementDataBuffer[0].height + 1, xOff + sDecorRearrangementDataBuffer[0].width - 1, yOff); // Arithmetic register swap at the r2 argument: `add r2, r0, r2` instead of `add r2, r2, r0` + } + } +} +#else +__attribute__((naked)) void sub_812A0E8(u8 taskId) +{ + asm_unified("\tpush {r4-r7,lr}\n" + "\tlsls r0, 24\n" + "\tlsrs r6, r0, 24\n" + "\tldr r4, =sCurDecorSelectedInRearrangement\n" + "\tmovs r0, 0\n" + "\tstrb r0, [r4]\n" + "\tadds r0, r6, 0\n" + "\tbl sub_8129FC8\n" + "\tlsls r0, 24\n" + "\tlsrs r0, 24\n" + "\tcmp r0, 0x1\n" + "\tbeq _0812A18C\n" + "\tmovs r5, 0\n" + "\tldr r0, =gUnknown_0203A17C\n" + "\tldrb r1, [r0, 0x8]\n" + "\tcmp r5, r1\n" + "\tbcs _0812A15A\n" + "\tadds r7, r4, 0\n" + "_0812A10E:\n" + "\tldr r0, [r0]\n" + "\tadds r0, r5\n" + "\tldrb r1, [r0]\n" + "\tcmp r1, 0\n" + "\tbeq _0812A14C\n" + "\tldr r4, =sDecorRearrangementDataBuffer\n" + "\tadds r0, r1, 0\n" + "\tadds r1, r4, 0\n" + "\tbl sub_8129D8C\n" + "\tadds r0, r6, 0\n" + "\tadds r1, r5, 0\n" + "\tadds r2, r4, 0\n" + "\tbl sub_8129E74\n" + "\tlsls r0, 24\n" + "\tlsrs r0, 24\n" + "\tcmp r0, 0x1\n" + "\tbne _0812A14C\n" + "\tstrb r5, [r4]\n" + "\tldrb r0, [r7]\n" + "\tadds r0, 0x1\n" + "\tstrb r0, [r7]\n" + "\tb _0812A15A\n" + "\t.pool\n" + "_0812A14C:\n" + "\tadds r0, r5, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r5, r0, 24\n" + "\tldr r0, =gUnknown_0203A17C\n" + "\tldrb r1, [r0, 0x8]\n" + "\tcmp r5, r1\n" + "\tbcc _0812A10E\n" + "_0812A15A:\n" + "\tldr r0, =sCurDecorSelectedInRearrangement\n" + "\tldrb r0, [r0]\n" + "\tcmp r0, 0\n" + "\tbeq _0812A18C\n" + "\tldr r0, =gUnknown_0203A17C\n" + "\tldr r2, =sDecorRearrangementDataBuffer\n" + "\tldrb r1, [r2]\n" + "\tldr r0, [r0, 0x4]\n" + "\tadds r0, r1\n" + "\tldrb r1, [r0]\n" + "\tlsrs r0, r1, 4\n" + "\tmovs r3, 0xF\n" + "\tands r3, r1\n" + "\tldrb r1, [r2, 0x2]\n" + "\tsubs r1, r3, r1\n" + "\tadds r1, 0x1\n" + "\tlsls r1, 24\n" + "\tlsrs r1, 24\n" + "\tldrb r2, [r2, 0x1]\n" + "\tadds r2, r0\n" + "\tsubs r2, 0x1\n" + "\tlsls r2, 24\n" + "\tlsrs r2, 24\n" + "\tbl sub_812A040\n" + "_0812A18C:\n" + "\tpop {r4-r7}\n" + "\tpop {r0}\n" + "\tbx r0\n" + "\t.pool"); +} +#endif + +void sub_812A1A0(u8 taskId) +{ + sub_8197930(); + sub_8121F68(taskId, &gUnknown_085A7348); +} + +void sub_812A1C0(u8 taskId) +{ + fade_screen(1, 0); + gTasks[taskId].data[2] = 0; + gTasks[taskId].func = sub_81298EC; +} + +void sub_812A1F0(u8 taskId) +{ + sub_8197930(); + sub_8121F68(taskId, &gUnknown_085A7350); +} + +void sub_812A210(u8 taskId) +{ + sub_8197434(0, 0); + sub_812A22C(taskId); +} + +void sub_812A22C(u8 taskId) +{ + fade_screen(1, 0); + gTasks[taskId].data[2] = 0; + gTasks[taskId].func = sub_812A25C; +} + +void sub_812A25C(u8 taskId) +{ + switch (gTasks[taskId].data[2]) + { + case 0: + if (!gPaletteFade.active) + { + sub_8127B04(taskId); + gTasks[taskId].data[2] = 1; + } + break; + case 1: + sub_812A3C8(); + gFieldCallback = sub_812A334; + SetMainCallback2(c2_exit_to_overworld_2_switch); + DestroyTask(taskId); + break; + } +} + +void sub_812A2C4(u8 taskId) +{ + s16 *data; + + data = gTasks[taskId].data; + switch (data[2]) + { + case 0: + sub_80E9578(); + data[2] ++; + break; + case 1: + ScriptContext1_SetupScript(gUnknown_08275D0C); + data[2] ++; + break; + case 2: + ScriptContext2_Enable(); + data[2] ++; + break; + case 3: + if (sub_80ABDFC() == TRUE) + { + gTasks[taskId].func = sub_8126B80; + } + break; + } +} + +void sub_812A334(void) +{ + u8 taskId; + + pal_fill_black(); + sub_81973C4(0, 1); + sub_8126ABC(); + taskId = CreateTask(sub_812A2C4, 8); + gTasks[taskId].data[2] = 0; +} + +void sub_812A36C(struct Sprite *sprite) +{ + sprite->data0 ++; + sprite->data0 &= 0x1F; + if (sprite->data0 > 15) + { + sprite->invisible = TRUE; + } + else + { + sprite->invisible = FALSE; + } +} + +void sub_812A39C(void) +{ + if (gSaveBlock2Ptr->playerGender == MALE) + { + LoadSpritePalette(&gUnknown_085A73D8); + } + else + { + LoadSpritePalette(&gUnknown_085A73E0); + } +} + +void sub_812A3C8(void) +{ + FreeSpritePaletteByTag(OVERWORLD_PLACE_DECOR_PLAYER_PAL_TAG); +} + +void sub_812A3D4(u8 taskId) +{ + if (IsSelectedDecorInThePC() == TRUE) + { + StringCopy(gStringVar1, gDecorations[gCurDecorInventoryItems[gCurDecorationIndex]].name); + StringExpandPlaceholders(gStringVar4, gText_DecorationWillBeDiscarded); + DisplayItemMessageOnField(taskId, gStringVar4, sub_812A458); + } + else + { + StringExpandPlaceholders(gStringVar4, gText_CantThrowAwayInUse); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8127A5C); + } +} + +void sub_812A458(u8 taskId) +{ + sub_8197930(); + sub_8121F68(taskId, &gUnknown_085A741C); +} + +void sub_812A478(u8 taskId) +{ + gCurDecorInventoryItems[gCurDecorationIndex] = DECOR_NONE; + sCurDecorCatCount = CountDecorationCategoryN(sCurDecorationCategory); + CondenseDecorationCategoryN(sCurDecorationCategory); + IdentifyOwnedDecorationsCurrentlyInUseInternal(taskId); + StringExpandPlaceholders(gStringVar4, gText_DecorationThrownAway); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8127A5C); +} diff --git a/src/decoration_inventory.c b/src/decoration_inventory.c new file mode 100644 index 000000000..03ab6c00c --- /dev/null +++ b/src/decoration_inventory.c @@ -0,0 +1,189 @@ + +// Includes +#include "global.h" +#include "decoration.h" +#include "decoration_inventory.h" + +// Static type declarations + +// Static RAM declarations + +EWRAM_DATA struct DecorationInventory gDecorationInventories[8] = {}; + +// Static ROM declarations + +// .rodata + +// .text + +#define SET_DECOR_INV(i, ptr) {\ + gDecorationInventories[i].items = ptr;\ + gDecorationInventories[i].size = sizeof(ptr);\ +} + +void SetDecorationInventoriesPointers(void) +{ + SET_DECOR_INV(0, gSaveBlock1Ptr->decorDesk); + SET_DECOR_INV(1, gSaveBlock1Ptr->decorChair); + SET_DECOR_INV(2, gSaveBlock1Ptr->decorPlant); + SET_DECOR_INV(3, gSaveBlock1Ptr->decorOrnament); + SET_DECOR_INV(4, gSaveBlock1Ptr->decorMat); + SET_DECOR_INV(5, gSaveBlock1Ptr->decorPoster); + SET_DECOR_INV(6, gSaveBlock1Ptr->decorDoll); + SET_DECOR_INV(7, gSaveBlock1Ptr->decorCushion); + sub_8126968(); +} + +static void ClearDecorationInventory(u8 idx) +{ + u8 i; + + for (i = 0; i < gDecorationInventories[idx].size; i ++) + { + gDecorationInventories[idx].items[i] = DECOR_NONE; + } +} + +void ClearDecorationInventories(void) +{ + u8 idx; + + for (idx = 0; idx < 8; idx ++) + { + ClearDecorationInventory(idx); + } +} + +s8 GetFirstEmptyDecorSlot(u8 idx) +{ + s8 i; + + for (i = 0; i < (s8)gDecorationInventories[idx].size; i ++) + { + if (gDecorationInventories[idx].items[i] == DECOR_NONE) + { + return i; + } + } + return -1; +} + +bool8 CheckHasDecoration(u8 decor) +{ + u8 i; + u8 category; + + category = gDecorations[decor].category; + for (i = 0; i < gDecorationInventories[category].size; i ++) + { + if (gDecorationInventories[category].items[i] == decor) + { + return TRUE; + } + } + return FALSE; +} + +bool8 DecorationAdd(u8 decor) +{ + u8 category; + s8 idx; + + if (decor == DECOR_NONE) + { + return FALSE; + } + category = gDecorations[decor].category; + idx = GetFirstEmptyDecorSlot(category); + if (idx == -1) + { + return FALSE; + } + gDecorationInventories[category].items[idx] = decor; + return TRUE; +} + +bool8 DecorationCheckSpace(u8 decor) +{ + if (decor == DECOR_NONE) + { + return FALSE; + } + if (GetFirstEmptyDecorSlot(gDecorations[decor].category) == -1) + { + return FALSE; + } + return TRUE; +} + +s8 DecorationRemove(u8 decor) +{ + u8 i; + u8 idx; + + i = 0; + if (decor == DECOR_NONE) + { + return 0; + } + for (i = 0; i < gDecorationInventories[gDecorations[decor].category].size; i ++) + { + idx = gDecorations[decor].category; + if (gDecorationInventories[idx].items[i] == decor) + { + gDecorationInventories[idx].items[i] = DECOR_NONE; + CondenseDecorationCategoryN(idx); + return 1; + } + } + return 0; +} + +void CondenseDecorationCategoryN(u8 idx) +{ + u8 i; + u8 j; + u8 tmp; + + for (i = 0; i < gDecorationInventories[idx].size; i ++) + { + for (j = i + 1; j < gDecorationInventories[idx].size; j ++) + { + if (gDecorationInventories[idx].items[j] != DECOR_NONE && (gDecorationInventories[idx].items[i] == DECOR_NONE || gDecorationInventories[idx].items[i] > gDecorationInventories[idx].items[j])) + { + tmp = gDecorationInventories[idx].items[i]; + gDecorationInventories[idx].items[i] = gDecorationInventories[idx].items[j]; + gDecorationInventories[idx].items[j] = tmp; + } + } + } +} + +u8 CountDecorationCategoryN(u8 idx) +{ + u8 i; + u8 ct; + + ct = 0; + for (i = 0; i < gDecorationInventories[idx].size; i ++) + { + if (gDecorationInventories[idx].items[i] != DECOR_NONE) + { + ct ++; + } + } + return ct; +} + +u8 CountDecorations(void) +{ + u8 idx; + u8 ct; + + ct = 0; + for (idx = 0; idx < 8; idx ++) + { + ct += CountDecorationCategoryN(idx); + } + return ct; +} diff --git a/src/international_string_util.c b/src/international_string_util.c index c77b4f8ff..81985d614 100644 --- a/src/international_string_util.c +++ b/src/international_string_util.c @@ -28,13 +28,13 @@ s32 GetStringWidthDifference(s32 fontId, const u8 *str, s32 totalWidth, s32 lett return 0; } -s32 GetMaxWidthInMenuTable(const u8 **str, s32 arg1) +s32 GetMaxWidthInMenuTable(const struct MenuAction *str, s32 arg1) { s32 i, var; for (var = 0, i = 0; i < arg1; i++) { - s32 stringWidth = GetStringWidth(1, str[i * 2], 0); + s32 stringWidth = GetStringWidth(1, str[i].text, 0); if (stringWidth > var) var = stringWidth; } @@ -42,13 +42,13 @@ s32 GetMaxWidthInMenuTable(const u8 **str, s32 arg1) return convert_pixel_width_to_tile_width(var); } -s32 sub_81DB3D8(const u8 **str, u8* arg1, s32 arg2) +s32 sub_81DB3D8(const struct MenuAction *str, u8* arg1, s32 arg2) { s32 i, var; for (var = 0, i = 0; i < arg2; i++) { - s32 stringWidth = GetStringWidth(1, str[arg1[i] * 2], 0); + s32 stringWidth = GetStringWidth(1, str[arg1[i]].text, 0); if (stringWidth > var) var = stringWidth; } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c new file mode 100755 index 000000000..37ecdc982 --- /dev/null +++ b/src/pokemon_summary_screen.c @@ -0,0 +1,3679 @@ +#include "global.h" +#include "battle.h" +#include "bg.h" +#include "decompress.h" +#include "item.h" +#include "items.h" +#include "link.h" +#include "m4a.h" +#include "main.h" +#include "malloc.h" +#include "moves.h" +#include "palette.h" +#include "pokemon.h" +#include "songs.h" +#include "sound.h" +#include "species.h" +#include "sprite.h" +#include "string_util.h" +#include "task.h" +#include "text.h" +#include "window.h" + +struct ContestMove +{ + u8 effect; + u8 type; + u8 comboID; + u8 combo[4]; +}; + +struct ContestEffect +{ + u8 type; + u8 appeal; + u8 jam; +}; + + + +extern struct UnkSummaryStruct* gUnknown_0203CF1C; +extern struct BgTemplate gUnknown_0861CBB4; +extern u8 gUnknown_0203CF20; +extern struct MusicPlayerInfo gMPlay_BGM; +extern s8 gUnknown_0861CC1C[]; +extern u8 gUnknown_08329D22[]; +extern u8 gUnknown_0203CF21; +extern u16 gSpecialVar_0x8005; +extern struct UnkStruct_61CC04 gUnknown_0861CC04; +extern struct UnkStruct_61CC04 gUnknown_0861CC10; +extern struct UnkStruct_61CC04 gUnknown_0861CBEC; +extern struct UnkStruct_61CC04 gUnknown_0861CBF8; +extern u16 gUnknown_08DC3CD4[]; +extern struct ContestMove gContestMoves[]; +extern struct ContestEffect gContestEffects[]; +extern struct WindowTemplate gUnknown_0861CC24; +extern struct TextColor gUnknown_0861CD2C[]; +extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1]; +extern u8 gText_MaleSymbol[]; +extern u8 gText_FemaleSymbol[]; +extern u8 gUnknown_0861CDD3[]; +extern void (*const gUnknown_0861CE54[])(); +extern void (*const gUnknown_0861CE64[])(u8 taskId); +extern struct WindowTemplate gUnknown_0861CCCC; +extern u8 gUnknown_0861CE74[]; +extern u8 gUnknown_0861CE7B[]; +extern struct WindowTemplate gUnknown_0861CCEC; +extern struct WindowTemplate gUnknown_0861CD14; + +extern void sub_806F2AC(u8 a, u8 b); +void sub_81C488C(u8 a); +extern void do_scheduled_bg_tilemap_copies_to_vram(void); +extern u8 sub_81221EC(); +extern u8 sub_81221AC(); +extern void SetVBlankHBlankCallbacksToNull(); +extern void sub_8121DA0(); +extern void clear_scheduled_bg_copies_to_vram(); +extern void remove_some_task(); +extern void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable); +extern void ShowBg(u8 a); +extern void SetGpuReg(u8 regOffset, u16 value); +extern void schedule_bg_copy_tilemap_to_vram(u8 a); +extern void SetBgTilemapBuffer(u8 bg, void *tilemap); +extern u8 gUnknown_08D9862C; +extern u8 gUnknown_08D98CC8; +extern u8 gUnknown_08D987FC; +extern u8 gUnknown_08D9898C; +extern u8 gUnknown_08D98B28; +extern u8 gUnknown_08D9853C; +extern u8 gUnknown_08D85620; +extern struct CompressedSpriteSheet gUnknown_0861CFBC; +extern struct CompressedSpriteSheet gUnknown_0861D074; +extern struct CompressedSpriteSheet gUnknown_0861D0F8; +extern struct CompressedSpritePalette gUnknown_0861D100; +extern struct CompressedSpritePalette gUnknown_0861D07C; +extern u8 gUnknown_08D97B84; +extern u8 gUnknown_08D97D0C; +extern void reset_temp_tile_data_buffers(); +extern void decompress_and_copy_tile_data_to_vram(u8 a, void* tiledata, u8 b, u8 c, u8 d); +extern u8 free_temp_tile_data_buffers_if_possible(); +extern void sub_8069004(struct BoxPokemon* a, void* b); +extern void sub_81C1E20(u8 taskId); +extern u8 *GetMonNickname(struct Pokemon *mon, u8 *dest); +extern u16 SpeciesToPokedexNum(u16 species); +extern u8 gText_UnkCtrlF908Clear01[]; +extern u8 gText_LevelSymbol[]; +extern u8 gText_PkmnInfo[]; +extern u8 gText_PkmnSkills[]; +extern u8 gText_BattleMoves[]; +extern u8 gText_ContestMoves[]; +extern u8 gText_Cancel2[]; +extern u8 gText_Info[]; +extern u8 gText_Switch[]; +extern u8 gText_RentalPkmn[]; +extern u8 gText_TypeSlash[]; +extern u8 gText_HP4[]; +extern u8 gText_Attack3[]; +extern u8 gText_Defense3[]; +extern u8 gText_SpAtk4[]; +extern u8 gText_SpDef4[]; +extern u8 gText_Speed2[]; +extern u8 gText_ExpPoints[]; +extern u8 gText_NextLv[]; +extern u8 gText_Status[]; +extern u8 gText_Power[]; +extern u8 gText_Accuracy2[]; +extern u8 gText_Appeal[]; +extern u8 gText_Jam[]; +extern u8 gText_OTSlash[]; +extern u8 gText_UnkCtrlF907F908[]; +extern u8 gAbilityNames[][13]; +extern u8 *gAbilityDescriptionPointers[]; +extern u8 gText_XNature[]; +extern u8 gText_XNatureHatchedAtYZ[]; +extern u8 gText_XNatureHatchedSomewhereAt[]; +extern u8 gText_XNatureMetAtYZ[]; +extern u8 gText_XNatureMetSomewhereAt[]; +extern u8 gText_XNatureFatefulEncounter[]; +extern u8 gText_XNatureProbablyMetAt[]; +extern u8 gText_XNatureObtainedInTrade[]; +extern u8 *gNatureNamePointers[]; +extern u8 gText_EmptyString5[]; +extern u32 gBattleTypeFlags; +extern u8 gText_FiveMarks[]; +extern u8 gText_EggWillTakeALongTime[]; +extern u8 gText_EggAboutToHatch[]; +extern u8 gText_EggWillHatchSoon[]; +extern u8 gText_EggWillTakeSomeTime[]; +extern u8 gText_PeculiarEggNicePlace[]; +extern u8 gText_PeculiarEggTrade[]; +extern u8 gText_EggFromTraveler[]; +extern u8 gText_EggFromHotSprings[]; +extern u8 gText_OddEggFoundByCouple[]; +extern u8 gText_None[]; +extern u8 gText_RibbonsVar1[]; +extern u8 gUnknown_0861CE82[]; +extern u8 gUnknown_0861CE8E[]; +extern u8 gText_OneDash[]; +extern u8 gText_TwoDashes[]; +extern u8 gText_ThreeDashes[]; +extern u8 gUnknown_0861CE97[]; +extern struct BattleMove gBattleMoves[]; + +extern u32 ChangeBgX(u8 bg, u32 value, u8 op); +extern void sub_8199C30(u8 a, u8 b, u8 c, u8 d, u8 e, u8 f); +extern void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, struct TextColor* colors, s8 speed, u8 *str); +extern s32 GetStringCenterAlignXOffset(u8 fontId, u8 *str, s32 totalWidth); +extern s32 GetStringRightAlignXOffset(u8 fontId, u8 *str, s32 totalWidth); +extern bool8 sub_81A6BF4(); +extern bool8 sub_81B9E94(); +extern void sub_81AFBF0(); +extern u8 sub_81AFC0C(u8 a, u8 *b); +extern void sub_81AFC28(u8 *a, u8 *b); +extern void sub_8124610(u8 *a, u8 b); +extern int GetPlayerIDAsU32(); +extern u8 GetCurrentPpToMaxPpState(u8 a, u8 b); + +void sub_81BFAE4(void); +void sub_81BFE24(); +u8 sub_81BFEB0(); +void sub_81C2554(); +void sub_81C1BA0(); +void sub_81C0098(struct Pokemon* a); +bool8 sub_81C00F0(struct Pokemon* a); +void sub_81C25E8(); +void sub_81C286C(); +void sub_81C2D9C(u8 a); +void sub_81C0348(); +void sub_81C2AFC(u8 a); +void sub_81C4190(); +void sub_81C42C8(); +u8 sub_81C45F4(void* a, u16* b); +void sub_81C4984(); +void sub_81C4A08(); +void sub_81C4A88(); +void sub_81C4280(); +void sub_81C0510(u8 taskId); +void sub_81C171C(u8 taskId); +void sub_8121E10(); +u8 sub_81B205C(struct Pokemon* a); +void sub_81C1DA4(u16 a, s16 b); +void sub_81C1EFC(u16 a, s16 b, u16 c); +void sub_81C240C(u16 a); +void sub_81C2194(u16 *a, u16 b, u8 c); +void sub_81C2074(u16 a, s16 b); +void sub_81C2524(); +void sub_81C2228(struct Pokemon* mon); +void sub_81C0484(u8 taskId); +void sub_81C4898(); +void sub_806F47C(u8 a); +u8 GetLRKeysState(); +void sub_81C0604(u8 taskId, s8 a); +void sub_81C0A8C(u8 taskId, s8 a); +void sub_81C48F0(); +void sub_81C0E48(u8 taskId); +void sub_81C0704(u8 taskId); +s8 sub_81C09B4(s8 a); +s8 sub_81C08F8(s8 a); +void sub_81C4204(u8 a, u8 b); +void sub_81C20F0(u8 taskId); +bool8 sub_81C0A50(struct Pokemon* mon); +void sub_81C49E0(); +void sub_81C0E24(); +void sub_81C2C38(u8 a); +void sub_81C0B8C(u8 taskId); +void sub_81C0CC4(u8 taskId); +void sub_81C2DE4(u8 a); +void sub_81C424C(); +void sub_81C0C68(u8 taskId); +void sub_81C0D44(u8 taskId); +void sub_81C22CC(struct Pokemon* mon); +void sub_81C0F44(u8 taskId); +void sub_81C3E9C(u16 a); +void sub_81C3F44(); +void sub_81C44F0(); +void sub_81C4AF8(u8 a); +void sub_81C1070(s16* a, s8 b, u8* c); +void sub_81C11F4(u8 a); +void sub_81C129C(u8 a); +bool8 sub_81C1040(); +void sub_81C4064(); +void sub_81C4C60(u8 a); +void sub_81C12E4(u8 taskId); +void sub_81C4C84(u8 a); +void sub_81C13B0(u8 a, u8 b); +void sub_81C14BC(struct Pokemon *mon, u8 a, u8 b); +void sub_81C15EC(struct BoxPokemon *mon, u8 a, u8 b); +void sub_81C40A0(u8 a, u8 b); +void sub_81C4568(u8 a, u8 b); +void sub_81C174C(u8 taskId); +bool8 sub_81C18A8(); +void sub_81C18F4(u8 a); +u8 sub_81B6D14(u16 a); +void sub_81C1940(u8 taskId); +void sub_81C4154(); +void sub_81C1F80(u8 taskId); +void sub_81C2628(); +void sub_81C2794(); +void sub_81C27DC(struct Pokemon *mon, u16 a); +void sub_81C2D68(u8 a); +void sub_81C335C(); +void sub_81C33CC(); +void sub_81C3428(); +void sub_81C349C(); +void sub_81C2EC4(); +void sub_81C2F5C(); +void sub_81C2FD8(); +void sub_81C302C(); +void sub_81C307C(); +void sub_81C3194(); +void sub_81C31C0(); +bool8 sub_81C3304(); +void sub_81C31F0(u8 *a); +u8 sub_81C3220(); +bool8 sub_81C32BC(); +void sub_81C35E4(); +void sub_81C3690(); +void sub_81C3710(); +void sub_81C37D8(); +void sub_81C3808(); +void sub_81C3890(); +void sub_81C38C0(); +void sub_81C3B08(u8 a); +void sub_81C3E2C(u8 a); +void sub_81C4D18(); + +void SetBgAttribute(u8 bg, u8 attributeId, u8 value); + +bool8 sub_81BFB10(); +u8 sub_81B1250(); + +union UnkUnion +{ + struct Pokemon mon[6]; + struct BoxPokemon boxMon[6]; +}; + + +u8 sub_80D214C(union UnkUnion* a, u8 b, u8 c, u8 d); + +struct PokeSummary +{ + u16 species; // 0x0 + u16 species2; // 0x2 + u8 isEgg; // 0x4 + u8 level; // 0x5 + u8 ribbons; // 0x6 + u8 unk7; // 0x7 + u8 altAbility; // 0x8 + u8 metLocation; // 0x9 + u8 metLevel; // 0xA + u8 metGame; // 0xB + u32 pid; // 0xC + u32 exp; // 0x10 + u16 moves[4]; // 0x14 + u8 pp[4]; // 0x1C + u16 currentHP; // 0x20 + u16 maxHP; // 0x22 + u16 atk; // 0x24 + u16 def; // 0x26 + u16 spatk; // 0x28 + u16 spdef; // 0x2A + u16 speed; // 0x2C + u16 item; // 0x2E + u16 friendship; // 0x30 + u8 OTGender; // 0x32 + u8 nature; // 0x33 + u8 ppBonuses; // 0x34 + u8 sanity; // 0x35 + u8 OTName[8]; // 0x36 + u8 unk3E[9]; // 0x3E + u32 OTID; // 0x48 +}; + +struct UnkSummaryStruct +{ + /*0x00*/ union UnkUnion *unk0; + /*0x04*/ void *unk4; + /*0x08*/ void *unk8; + /*0x0C*/ struct Pokemon currentMon; + /*0x70*/ struct PokeSummary summary; + u16 unkTilemap0[0x400]; + u16 unkTilemap0_1[0x400]; + u16 unkTilemap1[0x400]; + u16 unkTilemap1_1[0x400]; + u16 unkTilemap2[0x400]; + u16 unkTilemap2_1[0x400]; + u16 unkTilemap3[0x400]; + u16 unkTilemap3_1[0x400]; + u8 unk40BC; + u8 unk40BD; + u8 unk40BE; + u8 unk40BF; + u8 unk40C0; + u8 unk40C1; + u8 unk40C2; + u8 unk40C3; + u16 unk40C4; + u8 unk40C6; + u8 unk40C7; + u8 unk40C8; + u8 unk40C9; + u8 unk40CA; + u8 unk40CB[8]; + u8 unk40D3; + u8 unk40D4; + u8 unk40D5; + u8 unk_filler5[0x19]; + u8 unk40EF; + s16 unk40F0; + u8 unk_filler4[6]; +}; + +void sub_81BF8EC(u8 a, void *b, u8 c, u8 d, void *e) +{ + u8 byte; + gUnknown_0203CF1C = AllocZeroed(sizeof(struct UnkSummaryStruct)); + gUnknown_0203CF1C->unk40BC = a; + gUnknown_0203CF1C->unk0 = b; + gUnknown_0203CF1C->unk40BE = c; + gUnknown_0203CF1C->unk40BF = d; + gUnknown_0203CF1C->unk4 = e; + if (a == 2) + gUnknown_0203CF1C->unk40BD = 1; + else + gUnknown_0203CF1C->unk40BD = 0; + switch (a) + { + case 0: + case 2: + gUnknown_0203CF1C->unk40C1 = 0; + gUnknown_0203CF1C->unk40C2 = 3; + break; + case 1: + gUnknown_0203CF1C->unk40C1 = 0; + gUnknown_0203CF1C->unk40C2 = 3; + gUnknown_0203CF1C->unk40C8 = 1; + break; + case 3: + gUnknown_0203CF1C->unk40C1 = 2; + gUnknown_0203CF1C->unk40C2 = 3; + gUnknown_0203CF1C->unk40C3 = 1; + break; + } + byte = gUnknown_0203CF1C->unk40C1; + gUnknown_0203CF1C->unk40C0 = byte; + sub_81C488C(0xFF); + if (gMonSpritesGfxPtr == 0) + sub_806F2AC(0, 0); + SetMainCallback2(sub_81BFAE4); +} + +void sub_81BFA38(void *a, u8 b, u8 c, void *d, u16 e) +{ + sub_81BF8EC(3, a, b, c, d); + gUnknown_0203CF1C->unk40C4 = e; +} + +void sub_81BFA80(u8 a, void *b, u8 c, u8 d, void *e) +{ + sub_81BF8EC(a, b, c, d, e); + gUnknown_0203CF1C->unk40EF = 1; +} + +void sub_81BFAB4(void) +{ + RunTasks(); + AnimateSprites(); + BuildOamBuffer(); + do_scheduled_bg_tilemap_copies_to_vram(); + UpdatePaletteFade(); +} + +void sub_81BFAD0(void) +{ + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); +} + +void sub_81BFAE4() +{ + while (1) + { + if (sub_81221EC() == 1 || sub_81BFB10() == TRUE || sub_81221AC() == 1) + break; + } +} + +bool8 sub_81BFB10(void) +{ + switch (gMain.state) + { + case 0: + SetVBlankHBlankCallbacksToNull(); + sub_8121DA0(); + clear_scheduled_bg_copies_to_vram(); + gMain.state++; + break; + case 1: + remove_some_task(); + gMain.state++; + break; + case 2: + ResetPaletteFade(); + gPaletteFade.bufferTransferDisabled = 1; + gMain.state++; + break; + case 3: + ResetSpriteData(); + gMain.state++; + break; + case 4: + FreeAllSpritePalettes(); + gMain.state++; + break; + case 5: + sub_81BFE24(); + gUnknown_0203CF1C->unk40F0 = 0; + gMain.state++; + break; + case 6: + if (sub_81BFEB0() != 0) + gMain.state++; + break; + case 7: + sub_81C2554(); + gMain.state++; + break; + case 8: + sub_81C1BA0(); + gMain.state++; + break; + case 9: + sub_81C0098(&gUnknown_0203CF1C->currentMon); + gUnknown_0203CF1C->unk40F0 = 0; + gMain.state++; + break; + case 10: + if (sub_81C00F0(&gUnknown_0203CF1C->currentMon) != 0) + gMain.state++; + break; + case 11: + sub_81C25E8(); + gMain.state++; + break; + case 12: + sub_81C286C(); + gMain.state++; + break; + case 13: + sub_81C2D9C(gUnknown_0203CF1C->unk40C0); + gMain.state++; + break; + case 14: + sub_81C0348(); + gMain.state++; + break; + case 15: + sub_81C2AFC(gUnknown_0203CF1C->unk40C0); + gMain.state++; + break; + case 16: + sub_81C4190(); + sub_81C42C8(); + gUnknown_0203CF1C->unk40F0 = 0; + gMain.state++; + break; + case 17: + gUnknown_0203CF1C->unk40D3 = sub_81C45F4(&gUnknown_0203CF1C->currentMon, &gUnknown_0203CF1C->unk40F0); + if (gUnknown_0203CF1C->unk40D3 != 0xFF) + { + gUnknown_0203CF1C->unk40F0 = 0; + gMain.state++; + } + break; + case 18: + sub_81C4984(&gUnknown_0203CF1C->currentMon); + gMain.state++; + break; + case 19: + sub_81C4A08(&gUnknown_0203CF1C->currentMon); + gMain.state++; + break; + case 20: + sub_81C4A88(); + gMain.state++; + break; + case 21: + sub_81C4280(); + gMain.state++; + break; + case 22: + if (gUnknown_0203CF1C->unk40BC != 3) + CreateTask(sub_81C0510, 0); + else + CreateTask(sub_81C171C, 0); + gMain.state++; + break; + case 23: + BlendPalettes(-1, 16, 0); + gMain.state++; + break; + case 24: + BeginNormalPaletteFade(-1, 0, 16, 0, 0); + gPaletteFade.bufferTransferDisabled = 0; + gMain.state++; + break; + default: + SetVBlankCallback(sub_81BFAD0); + SetMainCallback2(sub_81BFAB4); + return TRUE; + } + return FALSE; +} + +void sub_81BFE24() +{ + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, &gUnknown_0861CBB4, 4); + SetBgTilemapBuffer(1, &gUnknown_0203CF1C->unkTilemap2); + SetBgTilemapBuffer(2, &gUnknown_0203CF1C->unkTilemap1); + SetBgTilemapBuffer(3, &gUnknown_0203CF1C->unkTilemap0); + sub_8121E10(); + schedule_bg_copy_tilemap_to_vram(1); + schedule_bg_copy_tilemap_to_vram(2); + schedule_bg_copy_tilemap_to_vram(3); + SetGpuReg(REG_OFFSET_DISPCNT, 0x1040); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + ShowBg(0); + ShowBg(1); + ShowBg(2); + ShowBg(3); +} + +u8 sub_81BFEB0() +{ + switch (gUnknown_0203CF1C->unk40F0) + { + case 0: + reset_temp_tile_data_buffers(); + decompress_and_copy_tile_data_to_vram(1, &gUnknown_08D97D0C, 0, 0, 0); + gUnknown_0203CF1C->unk40F0++; + break; + case 1: + if (free_temp_tile_data_buffers_if_possible() != 1) + { + LZDecompressWram(&gUnknown_08D9862C, gUnknown_0203CF1C->unkTilemap0); + gUnknown_0203CF1C->unk40F0++; + } + break; + case 2: + LZDecompressWram(&gUnknown_08D98CC8, gUnknown_0203CF1C->unkTilemap0_1); + gUnknown_0203CF1C->unk40F0++; + break; + case 3: + LZDecompressWram(&gUnknown_08D987FC, gUnknown_0203CF1C->unkTilemap1_1); + gUnknown_0203CF1C->unk40F0++; + break; + case 4: + LZDecompressWram(&gUnknown_08D9898C, gUnknown_0203CF1C->unkTilemap2_1); + gUnknown_0203CF1C->unk40F0++; + break; + case 5: + LZDecompressWram(&gUnknown_08D98B28, gUnknown_0203CF1C->unkTilemap3_1); + gUnknown_0203CF1C->unk40F0++; + break; + case 6: + LoadCompressedPalette(&gUnknown_08D9853C, 0, 0x100); + LoadPalette(&gUnknown_08D85620, 0x81, 0x1E); + gUnknown_0203CF1C->unk40F0++; + break; + case 7: + LoadCompressedObjectPic(&gUnknown_0861CFBC); + gUnknown_0203CF1C->unk40F0++; + break; + case 8: + LoadCompressedObjectPic(&gUnknown_0861D074); + gUnknown_0203CF1C->unk40F0++; + break; + case 9: + LoadCompressedObjectPic(&gUnknown_0861D0F8); + gUnknown_0203CF1C->unk40F0++; + break; + case 10: + LoadCompressedObjectPalette(&gUnknown_0861D100); + gUnknown_0203CF1C->unk40F0++; + break; + case 11: + LoadCompressedObjectPalette(&gUnknown_0861D07C); + gUnknown_0203CF1C->unk40F0++; + break; + case 12: + LoadCompressedPalette(&gUnknown_08D97B84, 0x1D0, 0x60); + gUnknown_0203CF1C->unk40F0 = 0; + return 1; + } + return 0; +} + +void sub_81C0098(struct Pokemon *mon) +{ + if (gUnknown_0203CF1C->unk40BD == 0) + { + struct Pokemon *partyMon = gUnknown_0203CF1C->unk0->mon; + *mon = partyMon[gUnknown_0203CF1C->unk40BE]; + } + else + { + struct BoxPokemon *boxMon = gUnknown_0203CF1C->unk0->boxMon; + sub_8069004(&boxMon[gUnknown_0203CF1C->unk40BE], mon); + } +} + +bool8 sub_81C00F0(struct Pokemon *a) +{ + u32 i; + struct PokeSummary *sum = &gUnknown_0203CF1C->summary; + switch (gUnknown_0203CF1C->unk40F0) + { + case 0: + sum->species = GetMonData(a, MON_DATA_SPECIES); + sum->species2 = GetMonData(a, MON_DATA_SPECIES2); + sum->exp = GetMonData(a, MON_DATA_EXP); + sum->level = GetMonData(a, MON_DATA_LEVEL); + sum->altAbility = GetMonData(a, MON_DATA_ALT_ABILITY); + sum->item = GetMonData(a, MON_DATA_HELD_ITEM); + sum->pid = GetMonData(a, MON_DATA_PERSONALITY); + sum->sanity = GetMonData(a, MON_DATA_SANITY_BIT1); + if (sum->sanity != 0) + sum->isEgg = 1; + else + sum->isEgg = GetMonData(a, MON_DATA_IS_EGG); + break; + case 1: + for (i = 0; i < 4; i++) + { + sum->moves[i] = GetMonData(a, MON_DATA_MOVE1+i); + sum->pp[i] = GetMonData(a, MON_DATA_PP1+i); + } + sum->ppBonuses = GetMonData(a, MON_DATA_PP_BONUSES); + break; + case 2: + if ((struct Pokemon*)gUnknown_0203CF1C->unk0 == gPlayerParty || gUnknown_0203CF1C->unk40BC == 2 || gUnknown_0203CF1C->unk40EF == 1) + { + sum->nature = GetNature(a); + sum->currentHP = GetMonData(a, MON_DATA_HP); + sum->maxHP = GetMonData(a, MON_DATA_MAX_HP); + sum->atk = GetMonData(a, MON_DATA_ATK); + sum->def = GetMonData(a, MON_DATA_DEF); + sum->spatk = GetMonData(a, MON_DATA_SPATK); + sum->spdef = GetMonData(a, MON_DATA_SPDEF); + sum->speed = GetMonData(a, MON_DATA_SPD); + } + else + { + sum->nature = GetNature(a); + sum->currentHP = GetMonData(a, MON_DATA_HP); + sum->maxHP = GetMonData(a, MON_DATA_MAX_HP); + sum->atk = GetMonData(a, MON_DATA_ATK2); + sum->def = GetMonData(a, MON_DATA_DEF2); + sum->spatk = GetMonData(a, MON_DATA_SPATK2); + sum->spdef = GetMonData(a, MON_DATA_SPDEF2); + sum->speed = GetMonData(a, MON_DATA_SPD2); + } + break; + case 3: + GetMonData(a, MON_DATA_OT_NAME, &sum->OTName); + ConvertInternationalString((u8*)&sum->OTName, GetMonData(a, MON_DATA_LANGUAGE)); + sum->unk7 = sub_81B205C(a); + sum->OTGender = GetMonData(a, MON_DATA_OT_GENDER); + sum->OTID = GetMonData(a, MON_DATA_OT_ID); + sum->metLocation = GetMonData(a, MON_DATA_MET_LOCATION); + sum->metLevel = GetMonData(a, MON_DATA_MET_LEVEL); + sum->metGame = GetMonData(a, MON_DATA_MET_GAME); + sum->friendship = GetMonData(a, MON_DATA_FRIENDSHIP); + break; + default: + sum->ribbons = GetMonData(a, MON_DATA_RIBBON_COUNT); + return TRUE; + } + gUnknown_0203CF1C->unk40F0++; + return FALSE; +} + +void sub_81C0348(void) +{ + if (gUnknown_0203CF1C->unk40C0 != 2 && gUnknown_0203CF1C->unk40C0 != 3) + { + sub_81C1DA4(0, 255); + sub_81C1EFC(0, 255, 0); + } + else + { + sub_81C240C(gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]); + sub_81C2194(&gUnknown_0203CF1C->unkTilemap2[0], 3, 0); + sub_81C2194(&gUnknown_0203CF1C->unkTilemap3[0], 1, 0); + SetBgTilemapBuffer(1, &gUnknown_0203CF1C->unkTilemap3); + SetBgTilemapBuffer(2, &gUnknown_0203CF1C->unkTilemap2); + ChangeBgX(2, 0x10000, 1); + ClearWindowTilemap(0x13); + ClearWindowTilemap(0xD); + } + if (gUnknown_0203CF1C->summary.unk7 == 0) + { + sub_81C2074(0, 0xFF); + } + else + { + if (gUnknown_0203CF1C->unk40C0 != 2 && gUnknown_0203CF1C->unk40C0 != 3) + PutWindowTilemap(0xD); + } + sub_81C2524(); + sub_81C2228(&gUnknown_0203CF1C->currentMon); +} + +void sub_81C0434() +{ + FreeAllWindowBuffers(); + Free(gUnknown_0203CF1C); +} + +void sub_81C044C(u8 taskId) +{ + BeginNormalPaletteFade(-1, 0, 0, 16, 0); + gTasks[taskId].func = sub_81C0484; +} + +void sub_81C0484(u8 taskId) +{ + if (sub_81221EC() != 1 && !gPaletteFade.active) + { + SetMainCallback2(gUnknown_0203CF1C->unk4); + gUnknown_0203CF20 = gUnknown_0203CF1C->unk40BE; + sub_81C4898(); + ResetSpriteData(); + FreeAllSpritePalettes(); + StopCryAndClearCrySongs(); + m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + if (gMonSpritesGfxPtr == 0) + sub_806F47C(0); + sub_81C0434(); + DestroyTask(taskId); + } +} + +void sub_81C0510(u8 taskId) +{ + if (sub_81221EC() != 1 && !gPaletteFade.active) + { + if (gMain.newKeys & DPAD_UP) + { + sub_81C0604(taskId, -1); + } + else if (gMain.newKeys & DPAD_DOWN) + { + sub_81C0604(taskId, 1); + } + else if ((gMain.newKeys & DPAD_LEFT) || GetLRKeysState() == 1) + { + sub_81C0A8C(taskId, -1); + } + else if ((gMain.newKeys & DPAD_RIGHT) || GetLRKeysState() == 2) + { + sub_81C0A8C(taskId, 1); + } + else if (gMain.newKeys & A_BUTTON) + { + if (gUnknown_0203CF1C->unk40C0 != 1) + { + if (gUnknown_0203CF1C->unk40C0 == 0) + { + sub_81C48F0(); + PlaySE(SE_SELECT); + sub_81C044C(taskId); + } + else + { + PlaySE(SE_SELECT); + sub_81C0E48(taskId); + } + } + } + else if (gMain.newKeys & B_BUTTON) + { + sub_81C48F0(); + PlaySE(SE_SELECT); + sub_81C044C(taskId); + } + } +} + +void sub_81C0604(u8 taskId, s8 a) +{ + s8 r4_2; + + if (gUnknown_0203CF1C->unk40C3 == 0) + { + if (gUnknown_0203CF1C->unk40BD == 1) + { + if (gUnknown_0203CF1C->unk40C0 != 0) + { + if (a == 1) + a = 0; + else + a = 2; + } + else + { + if (a == 1) + a = 1; + else + a = 3; + } + r4_2 = sub_80D214C(gUnknown_0203CF1C->unk0, gUnknown_0203CF1C->unk40BE, gUnknown_0203CF1C->unk40BF, a); + } + else if (sub_81B1250() == 1) + { + r4_2 = sub_81C09B4(a); + } + else + { + r4_2 = sub_81C08F8(a); + } + + if (r4_2 != -1) + { + PlaySE(SE_SELECT); + if (gUnknown_0203CF1C->summary.unk7 != 0) + { + sub_81C4204(2, 1); + ClearWindowTilemap(0xD); + schedule_bg_copy_tilemap_to_vram(0); + sub_81C2074(0, 2); + } + gUnknown_0203CF1C->unk40BE = r4_2; + gTasks[taskId].data[0] = 0; + gTasks[taskId].func = sub_81C0704; + } + } +} + +void sub_81C0704(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + switch (data[0]) + { + case 0: + StopCryAndClearCrySongs(); + break; + case 1: + sub_81C4898(); + DestroySpriteAndFreeResources(&gSprites[gUnknown_0203CF1C->unk40D3]); + break; + case 2: + DestroySpriteAndFreeResources(&gSprites[gUnknown_0203CF1C->unk40D4]); + break; + case 3: + sub_81C0098(&gUnknown_0203CF1C->currentMon); + gUnknown_0203CF1C->unk40F0 = 0; + break; + case 4: + if (sub_81C00F0(&gUnknown_0203CF1C->currentMon) == FALSE) + return; + break; + case 5: + sub_81C49E0(&gUnknown_0203CF1C->currentMon); + break; + case 6: + sub_81C4A08(&gUnknown_0203CF1C->currentMon); + break; + case 7: + if (gUnknown_0203CF1C->summary.unk7) + sub_81C2074(10, -2); + sub_81C2228(&gUnknown_0203CF1C->currentMon); + data[1] = 0; + break; + case 8: + gUnknown_0203CF1C->unk40D3 = sub_81C45F4(&gUnknown_0203CF1C->currentMon, &data[1]); + if (gUnknown_0203CF1C->unk40D3 == 0xFF) + return; + gSprites[gUnknown_0203CF1C->unk40D3].data2 = 1; + sub_81C0E24(); + data[1] = 0; + break; + case 9: + sub_81C4280(); + break; + case 10: + sub_81C25E8(); + break; + case 11: + sub_81C2D9C(gUnknown_0203CF1C->unk40C0); + sub_81C2524(); + break; + case 12: + gSprites[gUnknown_0203CF1C->unk40D3].data2 = 0; + break; + default: + if (sub_81221EC() == 0 && FuncIsActiveTask(sub_81C20F0) == 0) + { + data[0] = 0; + gTasks[taskId].func = sub_81C0510; + } + return; + } + data[0]++; +} + +s8 sub_81C08F8(s8 a) +{ + struct Pokemon *mon = gUnknown_0203CF1C->unk0->mon; + + if (gUnknown_0203CF1C->unk40C0 == 0) + { + if (a == -1 && gUnknown_0203CF1C->unk40BE == 0) + return -1; + if (a == 1 && gUnknown_0203CF1C->unk40BE >= gUnknown_0203CF1C->unk40BF) + return -1; + return gUnknown_0203CF1C->unk40BE + a; + } + else + { + s8 index = gUnknown_0203CF1C->unk40BE; + + do + { + index += a; + if (index < 0 || index > gUnknown_0203CF1C->unk40BF) + return -1; + } while (GetMonData(&mon[index], MON_DATA_IS_EGG) != 0); + return index; + } +} + +s8 sub_81C09B4(s8 a) +{ + struct Pokemon *mon = gUnknown_0203CF1C->unk0->mon; + s8 r5 = 0; + u8 i; + + for (i = 0; i < 6; i++) + { + if (gUnknown_0861CC1C[i] == gUnknown_0203CF1C->unk40BE) + { + r5 = i; + break; + } + } + + while (1) + { + int b; + s8* c = &gUnknown_0861CC1C[0]; + + r5 += a; + if (r5 < 0 || r5 >= 6) + return -1; + b = c[r5]; + if (sub_81C0A50(&mon[b]) == TRUE) + return b; + } +} + +bool8 sub_81C0A50(struct Pokemon* mon) +{ + if (GetMonData(mon, MON_DATA_SPECIES) == 0) + return FALSE; + else if (gUnknown_0203CF1C->unk40BE != 0 || GetMonData(mon, MON_DATA_IS_EGG) == 0) + return TRUE; + else + return FALSE; +} + +void sub_81C0A8C(u8 taskId, s8 b) +{ + struct PokeSummary *summary = &gUnknown_0203CF1C->summary; + s16 *data = gTasks[taskId].data; + + if (summary->isEgg) + return; + if (b == -1 && gUnknown_0203CF1C->unk40C0 == gUnknown_0203CF1C->unk40C1) + return; + if (b == 1 && gUnknown_0203CF1C->unk40C0 == gUnknown_0203CF1C->unk40C2) + return; + PlaySE(SE_SELECT); + sub_81C2C38(gUnknown_0203CF1C->unk40C0); + gUnknown_0203CF1C->unk40C0 += b; + data[0] = 0; + if (b == 1) + SetTaskFuncWithFollowupFunc(taskId, sub_81C0B8C, gTasks[taskId].func); + else + SetTaskFuncWithFollowupFunc(taskId, sub_81C0CC4, gTasks[taskId].func); + sub_81C2DE4(gUnknown_0203CF1C->unk40C0); + sub_81C424C(); +} + +void sub_81C0B8C(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + if (data[0] == 0) + { + if (gUnknown_0203CF1C->unk40C9 == 0) + { + data[1] = 1; + SetBgAttribute(1, 7, 1); + SetBgAttribute(2, 7, 2); + schedule_bg_copy_tilemap_to_vram(1); + } + else + { + data[1] = 2; + SetBgAttribute(2, 7, 1); + SetBgAttribute(1, 7, 2); + schedule_bg_copy_tilemap_to_vram(2); + } + ChangeBgX(data[1], 0, 0); + SetBgTilemapBuffer(data[1], (u8*)gUnknown_0203CF1C + ((gUnknown_0203CF1C->unk40C0 << 12) + 0xBC)); + ShowBg(1); + ShowBg(2); + } + ChangeBgX(data[1], 0x2000, 1); + data[0] += 32; + if (data[0] > 0xFF) + gTasks[taskId].func = sub_81C0C68; +} + +void sub_81C0C68(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + gUnknown_0203CF1C->unk40C9 ^= 1; + data[1] = 0; + data[0] = 0; + sub_81C1BA0(); + sub_81C2AFC(gUnknown_0203CF1C->unk40C0); + sub_81C4280(); + sub_81C0E24(); + SwitchTaskToFollowupFunc(taskId); +} + +void sub_81C0CC4(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + if (data[0] == 0) + { + if (gUnknown_0203CF1C->unk40C9 == 0) + data[1] = 2; + else + data[1] = 1; + ChangeBgX(data[1], 0x10000, 0); + } + ChangeBgX(data[1], 0x2000, 2); + data[0] += 32; + if (data[0] > 0xFF) + gTasks[taskId].func = sub_81C0D44; +} + +void sub_81C0D44(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + if (gUnknown_0203CF1C->unk40C9 == 0) + { + SetBgAttribute(1, 7, 1); + SetBgAttribute(2, 7, 2); + schedule_bg_copy_tilemap_to_vram(2); + } + else + { + SetBgAttribute(2, 7, 1); + SetBgAttribute(1, 7, 2); + schedule_bg_copy_tilemap_to_vram(1); + } + if (gUnknown_0203CF1C->unk40C0 > 1) + { + SetBgTilemapBuffer(data[1], (u8*)gUnknown_0203CF1C + ((gUnknown_0203CF1C->unk40C0 << 12) + 0xFFFFF0BC)); + ChangeBgX(data[1], 0x10000, 0); + } + ShowBg(1); + ShowBg(2); + gUnknown_0203CF1C->unk40C9 ^= 1; + data[1] = 0; + data[0] = 0; + sub_81C1BA0(); + sub_81C2AFC(gUnknown_0203CF1C->unk40C0); + sub_81C4280(); + sub_81C0E24(); + SwitchTaskToFollowupFunc(taskId); +} + +void sub_81C0E24() +{ + if (gUnknown_0203CF1C->unk40C0 == 1) + sub_81C22CC(&gUnknown_0203CF1C->currentMon); +} + +void sub_81C0E48(u8 taskId) +{ + u16 move; + gUnknown_0203CF1C->unk40C6 = 0; + move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + ClearWindowTilemap(0x13); + if (gSprites[gUnknown_0203CF1C->unk40D5].invisible == 0) + ClearWindowTilemap(0xD); + sub_81C1DA4(9, -3); + sub_81C1EFC(9, -3, move); + if (gUnknown_0203CF1C->unk40C8 == 0) + { + ClearWindowTilemap(5); + PutWindowTilemap(6); + } + sub_81C2194(&gUnknown_0203CF1C->unkTilemap2[0], 3, 0); + sub_81C2194(&gUnknown_0203CF1C->unkTilemap3[0], 1, 0); + sub_81C3E9C(move); + sub_81C3F44(); + sub_81C44F0(); + schedule_bg_copy_tilemap_to_vram(0); + schedule_bg_copy_tilemap_to_vram(1); + schedule_bg_copy_tilemap_to_vram(2); + sub_81C4AF8(8); + gTasks[taskId].func = sub_81C0F44; +} + +void sub_81C0F44(u8 taskId) +{ + u8 id = taskId; + s16 *data = gTasks[taskId].data; + + if (sub_81221EC() != 1) + { + if (gMain.newKeys & DPAD_UP) + { + data[0] = 4; + sub_81C1070(data, -1, &gUnknown_0203CF1C->unk40C6); + } + else if (gMain.newKeys & DPAD_DOWN) + { + data[0] = 4; + sub_81C1070(data, 1, &gUnknown_0203CF1C->unk40C6); + } + else if (gMain.newKeys & A_BUTTON) + { + if (gUnknown_0203CF1C->unk40C8 == 1 + || (gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + { + PlaySE(SE_SELECT); + sub_81C11F4(taskId); + } + else if (sub_81C1040() == TRUE) + { + PlaySE(SE_SELECT); + sub_81C129C(taskId); + } + else + { + PlaySE(SE_HAZURE); + } + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + sub_81C11F4(id); + } + } +} + +bool8 sub_81C1040(void) +{ + u8 i; + for (i = 1; i < 4; i++) + { + if (gUnknown_0203CF1C->summary.moves[i] != 0) + return TRUE; + } + return FALSE; +} + +void sub_81C1070(s16 *a, s8 b, u8 *c) +{ + s8 i; + s8 moveIndex; + u16 move; + + PlaySE(SE_SELECT); + moveIndex = *c; + for (i = 0; i < 4; i++) + { + moveIndex += b; + if (moveIndex > a[0]) + moveIndex = 0; + else if (moveIndex < 0) + moveIndex = a[0]; + if (moveIndex == 4) + { + move = gUnknown_0203CF1C->unk40C4; + break; + } + move = gUnknown_0203CF1C->summary.moves[moveIndex]; + if (move != 0) + break; + } + sub_81C240C(move); + schedule_bg_copy_tilemap_to_vram(1); + schedule_bg_copy_tilemap_to_vram(2); + sub_81C3E9C(move); + if ((*c == 4 && gUnknown_0203CF1C->unk40C4 == 0) || a[1] == 1) + { + ClearWindowTilemap(19); + if (!gSprites[gUnknown_0203CF1C->unk40D5].invisible) + ClearWindowTilemap(13); + schedule_bg_copy_tilemap_to_vram(0); + sub_81C1DA4(9, -3); + sub_81C1EFC(9, -3, move); + } + if (*c != 4 && moveIndex == 4 && gUnknown_0203CF1C->unk40C4 == 0) + { + ClearWindowTilemap(14); + ClearWindowTilemap(15); + schedule_bg_copy_tilemap_to_vram(0); + sub_81C1DA4(0, 3); + sub_81C1EFC(0, 3, 0); + } + *c = moveIndex; + if (c == &gUnknown_0203CF1C->unk40C6) + sub_81C4D18(8); + else + sub_81C4D18(18); +} + +void sub_81C11F4(u8 taskId) +{ + sub_81C4C60(8); + ClearWindowTilemap(6); + PutWindowTilemap(5); + sub_81C3E9C(0); + sub_81C2194(&gUnknown_0203CF1C->unkTilemap2[0], 3, 1); + sub_81C2194(&gUnknown_0203CF1C->unkTilemap3[0], 1, 1); + sub_81C4064(); + if (gUnknown_0203CF1C->unk40C6 != 4) + { + ClearWindowTilemap(14); + ClearWindowTilemap(15); + sub_81C1DA4(0, 3); + sub_81C1EFC(0, 3, 0); + } + schedule_bg_copy_tilemap_to_vram(0); + schedule_bg_copy_tilemap_to_vram(1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81C0510; +} + +void sub_81C129C(u8 taskId) +{ + gUnknown_0203CF1C->unk40C7 = gUnknown_0203CF1C->unk40C6; + sub_81C4C84(1); + sub_81C4AF8(18); + gTasks[taskId].func = sub_81C12E4; +} + +void sub_81C12E4(u8 taskId) +{ + u8 a = taskId; + s16* data = gTasks[taskId].data; + if (sub_81221EC() != 1) + { + if (gMain.newKeys & DPAD_UP) + { + data[0] = 3; + sub_81C1070(&data[0], -1, &gUnknown_0203CF1C->unk40C7); + } + else if (gMain.newKeys & DPAD_DOWN) + { + data[0] = 3; + sub_81C1070(&data[0], 1, &gUnknown_0203CF1C->unk40C7); + } + else if (gMain.newKeys & A_BUTTON) + { + if (gUnknown_0203CF1C->unk40C6 == gUnknown_0203CF1C->unk40C7) + { + sub_81C13B0(taskId, 0); + } + else + sub_81C13B0(taskId, 1); + } + else if (gMain.newKeys & B_BUTTON) + sub_81C13B0(a, 0); + } +} + +void sub_81C13B0(u8 taskId, u8 b) +{ + u16 move; + PlaySE(SE_SELECT); + sub_81C4C84(0); + sub_81C4C60(18); + if (b == 1) + { + if (gUnknown_0203CF1C->unk40BD == 0) + { + struct Pokemon *why = gUnknown_0203CF1C->unk0->mon; + sub_81C14BC(&why[gUnknown_0203CF1C->unk40BE], gUnknown_0203CF1C->unk40C6, gUnknown_0203CF1C->unk40C7); + } + else + { + struct BoxPokemon *why = gUnknown_0203CF1C->unk0->boxMon; + sub_81C15EC(&why[gUnknown_0203CF1C->unk40BE], gUnknown_0203CF1C->unk40C6, gUnknown_0203CF1C->unk40C7); + } + sub_81C0098(&gUnknown_0203CF1C->currentMon); + sub_81C40A0(gUnknown_0203CF1C->unk40C6, gUnknown_0203CF1C->unk40C7); + sub_81C4568(gUnknown_0203CF1C->unk40C6, gUnknown_0203CF1C->unk40C7); + gUnknown_0203CF1C->unk40C6 = gUnknown_0203CF1C->unk40C7; + } + move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + sub_81C3E9C(move); + sub_81C240C(move); + schedule_bg_copy_tilemap_to_vram(1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81C0F44; +} + + +#ifdef NONMATCHING +void sub_81C14BC(struct Pokemon *mon, u8 swappingFromId, u8 swappingToId) +{ + u16 localMoveTo; + u16 localMoveFrom; + u8 localPpTo; + u8 localPpFrom; + u8 localPpBonuses; + u16* moveFromPtr; + u16* moveToPtr; + u8* ppFromPtr; + u8* ppToPtr; + u8* ppBonusesPtr; + + moveFromPtr = &gUnknown_0203CF1C->summary.moves[swappingFromId]; + localMoveFrom = *moveFromPtr; + + moveToPtr = &gUnknown_0203CF1C->summary.moves[swappingToId]; + localMoveTo = *moveToPtr; + + ppFromPtr = &gUnknown_0203CF1C->summary.pp[swappingFromId]; + localPpFrom = *ppFromPtr; + + ppToPtr = &gUnknown_0203CF1C->summary.pp[swappingToId]; + localPpTo = *ppToPtr; + + ppBonusesPtr = &gUnknown_0203CF1C->summary.ppBonuses; + localPpBonuses = *ppBonusesPtr; + +{ + u8 bitsFrom, bitsTo; + + bitsFrom = (localPpBonuses & gUnknown_08329D22[swappingFromId]) >> (swappingFromId << 1); + bitsTo = (localPpBonuses & gUnknown_08329D22[swappingToId]) >> (swappingToId << 1); + + + localPpBonuses &= ~(gUnknown_08329D22[swappingFromId]); + localPpBonuses &= ~(gUnknown_08329D22[swappingToId]); + + localPpBonuses |= ((bitsFrom << (swappingToId << 1)) + (bitsTo << (swappingToId << 1))); +} + + SetMonData(mon, swappingFromId + MON_DATA_MOVE1, &localMoveTo); + SetMonData(mon, swappingToId + MON_DATA_MOVE1, &localMoveFrom); + + SetMonData(mon, swappingFromId + MON_DATA_PP1, &localPpTo); + SetMonData(mon, swappingToId + MON_DATA_PP1, &localPpFrom); + + SetMonData(mon, MON_DATA_PP_BONUSES, &localPpBonuses); + + *moveFromPtr = localMoveTo; + *moveToPtr = localMoveFrom; + + *ppFromPtr = localPpTo; + *ppToPtr = localPpFrom; + + *ppBonusesPtr = localPpBonuses; +} +#else +__attribute__((naked)) +void sub_81C14BC(struct Pokemon *mon, u8 swappingFromId, u8 swappingToId) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x28\n\ + adds r7, r0, 0\n\ + adds r4, r1, 0\n\ + adds r6, r2, 0\n\ + lsls r4, 24\n\ + lsrs r4, 24\n\ + lsls r6, 24\n\ + lsrs r6, 24\n\ + ldr r0, =gUnknown_0203CF1C\n\ + ldr r2, [r0]\n\ + lsls r0, r4, 1\n\ + mov r10, r0\n\ + adds r1, r2, 0\n\ + adds r1, 0x84\n\ + adds r0, r1, r0\n\ + str r0, [sp, 0x8]\n\ + ldrh r0, [r0]\n\ + mov r3, sp\n\ + adds r3, 0x2\n\ + str r3, [sp, 0x1C]\n\ + strh r0, [r3]\n\ + lsls r0, r6, 1\n\ + mov r9, r0\n\ + add r1, r9\n\ + str r1, [sp, 0xC]\n\ + ldrh r1, [r1]\n\ + mov r0, sp\n\ + strh r1, [r0]\n\ + adds r1, r2, 0\n\ + adds r1, 0x8C\n\ + adds r3, r1, r4\n\ + str r3, [sp, 0x10]\n\ + ldrb r0, [r3]\n\ + mov r3, sp\n\ + adds r3, 0x5\n\ + str r3, [sp, 0x24]\n\ + strb r0, [r3]\n\ + adds r1, r6\n\ + str r1, [sp, 0x14]\n\ + ldrb r0, [r1]\n\ + mov r1, sp\n\ + adds r1, 0x4\n\ + str r1, [sp, 0x20]\n\ + strb r0, [r1]\n\ + adds r2, 0xA4\n\ + str r2, [sp, 0x18]\n\ + ldrb r0, [r2]\n\ + mov r5, sp\n\ + adds r5, 0x6\n\ + strb r0, [r5]\n\ + ldr r1, =gUnknown_08329D22\n\ + adds r0, r4, r1\n\ + ldrb r0, [r0]\n\ + mov r8, r0\n\ + ldrb r0, [r5]\n\ + adds r2, r0, 0\n\ + mov r3, r8\n\ + ands r2, r3\n\ + mov r3, r10\n\ + asrs r2, r3\n\ + lsls r2, 24\n\ + lsrs r2, 24\n\ + adds r1, r6, r1\n\ + ldrb r1, [r1]\n\ + mov r12, r1\n\ + adds r1, r0, 0\n\ + mov r3, r12\n\ + ands r1, r3\n\ + mov r3, r9\n\ + asrs r1, r3\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + mov r3, r8\n\ + bics r0, r3\n\ + strb r0, [r5]\n\ + ldrb r0, [r5]\n\ + mov r3, r12\n\ + bics r0, r3\n\ + strb r0, [r5]\n\ + mov r0, r9\n\ + lsls r2, r0\n\ + mov r3, r10\n\ + lsls r1, r3\n\ + adds r2, r1\n\ + ldrb r0, [r5]\n\ + orrs r0, r2\n\ + strb r0, [r5]\n\ + adds r1, r4, 0\n\ + adds r1, 0xD\n\ + adds r0, r7, 0\n\ + mov r2, sp\n\ + bl SetMonData\n\ + adds r1, r6, 0\n\ + adds r1, 0xD\n\ + adds r0, r7, 0\n\ + ldr r2, [sp, 0x1C]\n\ + bl SetMonData\n\ + adds r4, 0x11\n\ + adds r0, r7, 0\n\ + adds r1, r4, 0\n\ + ldr r2, [sp, 0x20]\n\ + bl SetMonData\n\ + adds r6, 0x11\n\ + adds r0, r7, 0\n\ + adds r1, r6, 0\n\ + ldr r2, [sp, 0x24]\n\ + bl SetMonData\n\ + adds r0, r7, 0\n\ + movs r1, 0x15\n\ + adds r2, r5, 0\n\ + bl SetMonData\n\ + mov r0, sp\n\ + ldrh r0, [r0]\n\ + ldr r1, [sp, 0x8]\n\ + strh r0, [r1]\n\ + ldr r3, [sp, 0x1C]\n\ + ldrh r0, [r3]\n\ + ldr r1, [sp, 0xC]\n\ + strh r0, [r1]\n\ + ldr r3, [sp, 0x20]\n\ + ldrb r0, [r3]\n\ + ldr r1, [sp, 0x10]\n\ + strb r0, [r1]\n\ + ldr r3, [sp, 0x24]\n\ + ldrb r0, [r3]\n\ + ldr r1, [sp, 0x14]\n\ + strb r0, [r1]\n\ + ldrb r0, [r5]\n\ + ldr r3, [sp, 0x18]\n\ + strb r0, [r3]\n\ + add sp, 0x28\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +#ifdef NONMATCHING +void sub_81C15EC(struct BoxPokemon *mon, u8 swappingFromId, u8 swappingToId) +{ + u16 localMoveTo; + u16 localMoveFrom; + u8 localPpTo; + u8 localPpFrom; + u8 localPpBonuses; + u16* moveFromPtr; + u16* moveToPtr; + u8* ppFromPtr; + u8* ppToPtr; + u8* ppBonusesPtr; + + moveFromPtr = &gUnknown_0203CF1C->summary.moves[swappingFromId]; + localMoveFrom = *moveFromPtr; + + moveToPtr = &gUnknown_0203CF1C->summary.moves[swappingToId]; + localMoveTo = *moveToPtr; + + ppFromPtr = &gUnknown_0203CF1C->summary.pp[swappingFromId]; + localPpFrom = *ppFromPtr; + + ppToPtr = &gUnknown_0203CF1C->summary.pp[swappingToId]; + localPpTo = *ppToPtr; + + ppBonusesPtr = &gUnknown_0203CF1C->summary.ppBonuses; + localPpBonuses = *ppBonusesPtr; + +{ + u8 bitsFrom, bitsTo; + + bitsFrom = (localPpBonuses & gUnknown_08329D22[swappingFromId]) >> (swappingFromId << 1); + bitsTo = (localPpBonuses & gUnknown_08329D22[swappingToId]) >> (swappingToId << 1); + + + localPpBonuses &= ~(gUnknown_08329D22[swappingFromId]); + localPpBonuses &= ~(gUnknown_08329D22[swappingToId]); + + localPpBonuses |= ((bitsFrom << (swappingToId << 1)) + (bitsTo << (swappingToId << 1))); +} + + SetBoxMonData(mon, swappingFromId + MON_DATA_MOVE1, &localMoveTo); + SetBoxMonData(mon, swappingToId + MON_DATA_MOVE1, &localMoveFrom); + + SetBoxMonData(mon, swappingFromId + MON_DATA_PP1, &localPpTo); + SetBoxMonData(mon, swappingToId + MON_DATA_PP1, &localPpFrom); + + SetBoxMonData(mon, MON_DATA_PP_BONUSES, &localPpBonuses); + + *moveFromPtr = localMoveTo; + *moveToPtr = localMoveFrom; + + *ppFromPtr = localPpTo; + *ppToPtr = localPpFrom; + + *ppBonusesPtr = localPpBonuses; +} +#else +__attribute__((naked)) +void sub_81C15EC(struct BoxPokemon *mon, u8 swappingFromId, u8 swappingToId) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x28\n\ + adds r7, r0, 0\n\ + adds r4, r1, 0\n\ + adds r6, r2, 0\n\ + lsls r4, 24\n\ + lsrs r4, 24\n\ + lsls r6, 24\n\ + lsrs r6, 24\n\ + ldr r0, =gUnknown_0203CF1C\n\ + ldr r2, [r0]\n\ + lsls r0, r4, 1\n\ + mov r10, r0\n\ + adds r1, r2, 0\n\ + adds r1, 0x84\n\ + adds r0, r1, r0\n\ + str r0, [sp, 0x8]\n\ + ldrh r0, [r0]\n\ + mov r3, sp\n\ + adds r3, 0x2\n\ + str r3, [sp, 0x1C]\n\ + strh r0, [r3]\n\ + lsls r0, r6, 1\n\ + mov r9, r0\n\ + add r1, r9\n\ + str r1, [sp, 0xC]\n\ + ldrh r1, [r1]\n\ + mov r0, sp\n\ + strh r1, [r0]\n\ + adds r1, r2, 0\n\ + adds r1, 0x8C\n\ + adds r3, r1, r4\n\ + str r3, [sp, 0x10]\n\ + ldrb r0, [r3]\n\ + mov r3, sp\n\ + adds r3, 0x5\n\ + str r3, [sp, 0x24]\n\ + strb r0, [r3]\n\ + adds r1, r6\n\ + str r1, [sp, 0x14]\n\ + ldrb r0, [r1]\n\ + mov r1, sp\n\ + adds r1, 0x4\n\ + str r1, [sp, 0x20]\n\ + strb r0, [r1]\n\ + adds r2, 0xA4\n\ + str r2, [sp, 0x18]\n\ + ldrb r0, [r2]\n\ + mov r5, sp\n\ + adds r5, 0x6\n\ + strb r0, [r5]\n\ + ldr r1, =gUnknown_08329D22\n\ + adds r0, r4, r1\n\ + ldrb r0, [r0]\n\ + mov r8, r0\n\ + ldrb r0, [r5]\n\ + adds r2, r0, 0\n\ + mov r3, r8\n\ + ands r2, r3\n\ + mov r3, r10\n\ + asrs r2, r3\n\ + lsls r2, 24\n\ + lsrs r2, 24\n\ + adds r1, r6, r1\n\ + ldrb r1, [r1]\n\ + mov r12, r1\n\ + adds r1, r0, 0\n\ + mov r3, r12\n\ + ands r1, r3\n\ + mov r3, r9\n\ + asrs r1, r3\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + mov r3, r8\n\ + bics r0, r3\n\ + strb r0, [r5]\n\ + ldrb r0, [r5]\n\ + mov r3, r12\n\ + bics r0, r3\n\ + strb r0, [r5]\n\ + mov r0, r9\n\ + lsls r2, r0\n\ + mov r3, r10\n\ + lsls r1, r3\n\ + adds r2, r1\n\ + ldrb r0, [r5]\n\ + orrs r0, r2\n\ + strb r0, [r5]\n\ + adds r1, r4, 0\n\ + adds r1, 0xD\n\ + adds r0, r7, 0\n\ + mov r2, sp\n\ + bl SetBoxMonData\n\ + adds r1, r6, 0\n\ + adds r1, 0xD\n\ + adds r0, r7, 0\n\ + ldr r2, [sp, 0x1C]\n\ + bl SetBoxMonData\n\ + adds r4, 0x11\n\ + adds r0, r7, 0\n\ + adds r1, r4, 0\n\ + ldr r2, [sp, 0x20]\n\ + bl SetBoxMonData\n\ + adds r6, 0x11\n\ + adds r0, r7, 0\n\ + adds r1, r6, 0\n\ + ldr r2, [sp, 0x24]\n\ + bl SetBoxMonData\n\ + adds r0, r7, 0\n\ + movs r1, 0x15\n\ + adds r2, r5, 0\n\ + bl SetBoxMonData\n\ + mov r0, sp\n\ + ldrh r0, [r0]\n\ + ldr r1, [sp, 0x8]\n\ + strh r0, [r1]\n\ + ldr r3, [sp, 0x1C]\n\ + ldrh r0, [r3]\n\ + ldr r1, [sp, 0xC]\n\ + strh r0, [r1]\n\ + ldr r3, [sp, 0x20]\n\ + ldrb r0, [r3]\n\ + ldr r1, [sp, 0x10]\n\ + strb r0, [r1]\n\ + ldr r3, [sp, 0x24]\n\ + ldrb r0, [r3]\n\ + ldr r1, [sp, 0x14]\n\ + strb r0, [r1]\n\ + ldrb r0, [r5]\n\ + ldr r3, [sp, 0x18]\n\ + strb r0, [r3]\n\ + add sp, 0x28\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +void sub_81C171C(u8 taskId) +{ + sub_81C44F0(); + sub_81C4AF8(8); + gTasks[taskId].func = sub_81C174C; +} + +void sub_81C174C(u8 taskId) +{ + s16* data = gTasks[taskId].data; + + if (sub_81221EC() != 1) + { + if (gPaletteFade.active != 1) + { + if (gMain.newKeys & DPAD_UP) + { + data[0] = 4; + sub_81C1070(data, -1, &gUnknown_0203CF1C->unk40C6); + } + else if (gMain.newKeys & DPAD_DOWN) + { + data[0] = 4; + sub_81C1070(data, 1, &gUnknown_0203CF1C->unk40C6); + } + else if (gMain.newKeys & DPAD_LEFT || GetLRKeysState() == 1) + { + sub_81C0A8C(taskId, -1); + } + else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysState() == 2) + { + sub_81C0A8C(taskId, 1); + } + else if (gMain.newKeys & A_BUTTON) + { + if (sub_81C18A8() == TRUE) + { + sub_81C48F0(); + PlaySE(SE_SELECT); + gUnknown_0203CF21 = gUnknown_0203CF1C->unk40C6; + gSpecialVar_0x8005 = gUnknown_0203CF21; + sub_81C044C(taskId); + } + else + { + PlaySE(0x20); + sub_81C18F4(taskId); + } + } + else if (gMain.newKeys & B_BUTTON) + { + u32 var1; + sub_81C48F0(); + PlaySE(SE_SELECT); + gUnknown_0203CF21 = 4; + gSpecialVar_0x8005 = 4; + sub_81C044C(taskId); + } + } + } +} + +bool8 sub_81C18A8() +{ + if (gUnknown_0203CF1C->unk40C6 == 4 || gUnknown_0203CF1C->unk40C4 == 0 || sub_81B6D14(gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]) != 1) + return TRUE; + else + return FALSE; +} + +void sub_81C18F4(u8 taskId) +{ + ClearWindowTilemap(14); + ClearWindowTilemap(15); + schedule_bg_copy_tilemap_to_vram(0); + sub_81C1DA4(0, 3); + sub_81C1EFC(0, 3, 0); + sub_81C4154(); + gTasks[taskId].func = sub_81C1940; +} + +void sub_81C1940(u8 taskId) +{ + s16* data = gTasks[taskId].data; + u16 move; + if (FuncIsActiveTask(sub_81C1E20) != 1) + { + if (gMain.newKeys & DPAD_UP) + { + data[1] = 1; + data[0] = 4; + sub_81C1070(&data[0], -1, &gUnknown_0203CF1C->unk40C6); + data[1] = 0; + gTasks[taskId].func = sub_81C174C; + } + else if (gMain.newKeys & DPAD_DOWN) + { + data[1] = 1; + data[0] = 4; + sub_81C1070(&data[0], 1, &gUnknown_0203CF1C->unk40C6); + data[1] = 0; + gTasks[taskId].func = sub_81C174C; + } + else if (gMain.newKeys & DPAD_LEFT || GetLRKeysState() == 1) + { + if (gUnknown_0203CF1C->unk40C0 != 2) + { + + ClearWindowTilemap(19); + if (!gSprites[gUnknown_0203CF1C->unk40D5].invisible) + ClearWindowTilemap(13); + move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + gTasks[taskId].func = sub_81C174C; + sub_81C0A8C(taskId, -1); + sub_81C1DA4(9, -2); + sub_81C1EFC(9, -2, move); + } + } + else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysState() == 2) + { + if (gUnknown_0203CF1C->unk40C0 != 3) + { + ClearWindowTilemap(19); + if (!gSprites[gUnknown_0203CF1C->unk40D5].invisible) + ClearWindowTilemap(13); + move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + gTasks[taskId].func = sub_81C174C; + sub_81C0A8C(taskId, 1); + sub_81C1DA4(9, -2); + sub_81C1EFC(9, -2, move); + } + } + else if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + { + ClearWindowTilemap(19); + if (!gSprites[gUnknown_0203CF1C->unk40D5].invisible) + ClearWindowTilemap(13); + move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + sub_81C3E9C(move); + schedule_bg_copy_tilemap_to_vram(0); + sub_81C1DA4(9, -3); + sub_81C1EFC(9, -3, move); + gTasks[taskId].func = sub_81C174C; + } + } +} + +u8 sub_81C1B94() +{ + return gUnknown_0203CF21; +} + +void sub_81C1BA0() +{ + u16 *alloced = Alloc(32); + u8 i; + for (i = 0; i < 4; i++) + { + u8 j = i << 1; + if (i < gUnknown_0203CF1C->unk40C1) + { + alloced[j+0] = 0x40; + alloced[j+1] = 0x40; + alloced[j+8] = 0x50; + alloced[j+9] = 0x50; + } + else if (i > gUnknown_0203CF1C->unk40C2) + { + alloced[j+0] = 0x4A; + alloced[j+1] = 0x4A; + alloced[j+8] = 0x5A; + alloced[j+9] = 0x5A; + } + else if (i < gUnknown_0203CF1C->unk40C0) + { + alloced[j+0] = 0x46; + alloced[j+1] = 0x47; + alloced[j+8] = 0x56; + alloced[j+9] = 0x57; + } + else if (i == gUnknown_0203CF1C->unk40C0) + { + if (i != gUnknown_0203CF1C->unk40C2) + { + alloced[j+0] = 0x41; + alloced[j+1] = 0x42; + alloced[j+8] = 0x51; + alloced[j+9] = 0x52; + } + else + { + alloced[j+0] = 0x4B; + alloced[j+1] = 0x4C; + alloced[j+8] = 0x5B; + alloced[j+9] = 0x5C; + } + } + else if (i != gUnknown_0203CF1C->unk40C2) + { + alloced[j+0] = 0x43; + alloced[j+1] = 0x44; + alloced[j+8] = 0x53; + alloced[j+9] = 0x54; + } + else + { + alloced[j+0] = 0x48; + alloced[j+1] = 0x49; + alloced[j+8] = 0x58; + alloced[j+9] = 0x59; + } + } + CopyToBgTilemapBufferRect_ChangePalette(3, alloced, 11, 0, 8, 2, 16); + schedule_bg_copy_tilemap_to_vram(3); + Free(alloced); +} + +struct UnkStruct_61CC04 +{ + u8 *ptr; + u8 field_4; + u8 field_5; + u8 field_6; + u8 field_7; + u8 field_8; + u8 field_9; +}; + +#ifdef NONMATCHING +void sub_81C1CB0(struct UnkStruct_61CC04 *a, u16 *b, u8 c, u8 d) +{ + u8 *alloced = Alloc(a->field_6 * (a->field_7 << 1)); + CpuFill16(a->field_4, alloced, a->field_7*a->field_6); + if (a->field_6 != c) + { + if (!d) + { + for (d;d < a->field_7; d++) + { + CpuCopy16(&a->ptr + ((c + a->field_6*d)), alloced + ((a->field_6*d) << 1), (a->field_6 - c) * 2); + } + } + else + { + for (d = 0;d < a->field_7; d++) + { + CpuCopy16(&a->ptr + (a->field_6*d), alloced + ((c + a->field_6*d) << 1), (a->field_6 - c) * 2); + } + } + } + d = 0; + while (d < a->field_7) + { + CpuCopy16(alloced + ((a->field_6*d) << 1), b + ((((a->field_9 + d) << 5) + a->field_8) << 1), a->field_6 * 2); + d++; + } + Free(alloced); +} +#else +__attribute__((naked)) +void sub_81C1CB0(struct UnkStruct_61CC04 *a, u16 *b, u8 c, u8 d) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + mov r7, r8\n\ + push {r7}\n\ + sub sp, 0x4\n\ + adds r4, r0, 0\n\ + mov r8, r1\n\ + lsls r2, 24\n\ + lsrs r6, r2, 24\n\ + lsls r3, 24\n\ + lsrs r5, r3, 24\n\ + ldrb r1, [r4, 0x6]\n\ + ldrb r0, [r4, 0x7]\n\ + lsls r0, 1\n\ + muls r0, r1\n\ + bl Alloc\n\ + adds r7, r0, 0\n\ + mov r1, sp\n\ + ldrh r0, [r4, 0x4]\n\ + strh r0, [r1]\n\ + ldrb r1, [r4, 0x7]\n\ + ldrb r0, [r4, 0x6]\n\ + adds r2, r1, 0\n\ + muls r2, r0\n\ + movs r0, 0x80\n\ + lsls r0, 17\n\ + orrs r2, r0\n\ + mov r0, sp\n\ + adds r1, r7, 0\n\ + bl CpuSet\n\ + ldrb r0, [r4, 0x6]\n\ + cmp r0, r6\n\ + beq _081C1D60\n\ + cmp r5, 0\n\ + bne _081C1D30\n\ + movs r5, 0\n\ + ldrb r0, [r4, 0x7]\n\ + cmp r5, r0\n\ + bcs _081C1D60\n\ +_081C1D00:\n\ + ldrb r2, [r4, 0x6]\n\ + adds r1, r2, 0\n\ + muls r1, r5\n\ + adds r3, r6, r1\n\ + lsls r3, 1\n\ + ldr r0, [r4]\n\ + adds r0, r3\n\ + lsls r1, 1\n\ + adds r1, r7, r1\n\ + subs r2, r6\n\ + ldr r3, =0x001fffff\n\ + ands r2, r3\n\ + bl CpuSet\n\ + adds r0, r5, 0x1\n\ + lsls r0, 16\n\ + lsrs r5, r0, 16\n\ + ldrb r3, [r4, 0x7]\n\ + cmp r5, r3\n\ + bcc _081C1D00\n\ + b _081C1D60\n\ + .pool\n\ +_081C1D30:\n\ + movs r5, 0\n\ + ldrb r0, [r4, 0x7]\n\ + cmp r5, r0\n\ + bcs _081C1D60\n\ +_081C1D38:\n\ + ldrb r2, [r4, 0x6]\n\ + adds r1, r2, 0\n\ + muls r1, r5\n\ + lsls r3, r1, 1\n\ + ldr r0, [r4]\n\ + adds r0, r3\n\ + adds r1, r6, r1\n\ + lsls r1, 1\n\ + adds r1, r7, r1\n\ + subs r2, r6\n\ + ldr r3, =0x001fffff\n\ + ands r2, r3\n\ + bl CpuSet\n\ + adds r0, r5, 0x1\n\ + lsls r0, 16\n\ + lsrs r5, r0, 16\n\ + ldrb r3, [r4, 0x7]\n\ + cmp r5, r3\n\ + bcc _081C1D38\n\ +_081C1D60:\n\ + movs r5, 0\n\ + b _081C1D8A\n\ + .pool\n\ +_081C1D68:\n\ + ldrb r2, [r4, 0x6]\n\ + adds r0, r2, 0\n\ + muls r0, r5\n\ + lsls r0, 1\n\ + adds r0, r7, r0\n\ + ldrb r1, [r4, 0x9]\n\ + adds r1, r5\n\ + lsls r1, 5\n\ + ldrb r3, [r4, 0x8]\n\ + adds r1, r3\n\ + lsls r1, 1\n\ + add r1, r8\n\ + bl CpuSet\n\ + adds r0, r5, 0x1\n\ + lsls r0, 16\n\ + lsrs r5, r0, 16\n\ +_081C1D8A:\n\ + ldrb r0, [r4, 0x7]\n\ + cmp r5, r0\n\ + bcc _081C1D68\n\ + adds r0, r7, 0\n\ + bl Free\n\ + add sp, 0x4\n\ + pop {r3}\n\ + mov r8, r3\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .syntax divided\n"); +} +#endif + +void sub_81C1DA4(u16 a, s16 b) +{ + if (b > gUnknown_0861CC04.field_6) + b = gUnknown_0861CC04.field_6; + if (b == 0 || b == gUnknown_0861CC04.field_6) + { + sub_81C1CB0(&gUnknown_0861CC04, &gUnknown_0203CF1C->unkTilemap2[0], b, 1); + } + else + { + u8 taskId = FindTaskIdByFunc(sub_81C1E20); + if (taskId == 0xFF) + { + taskId = CreateTask(sub_81C1E20, 8); + } + gTasks[taskId].data[0] = b; + gTasks[taskId].data[1] = a; + } +} + +void sub_81C1E20(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + data[1] += data[0]; + if (data[1] < 0) + { + data[1] = 0; + } + else if (data[1] > gUnknown_0861CC04.field_6) + { + data[1] = gUnknown_0861CC04.field_6; + } + sub_81C1CB0(&gUnknown_0861CC04, &gUnknown_0203CF1C->unkTilemap2[0], data[1], 1); + if (data[1] <= 0 || data[1] >= gUnknown_0861CC04.field_6) + { + if (data[0] < 0) + { + if (gUnknown_0203CF1C->unk40C0 == 2) + PutWindowTilemap(14); + + } + else + { + if (!gSprites[gUnknown_0203CF1C->unk40D5].invisible) + PutWindowTilemap(13); + PutWindowTilemap(19); + } + schedule_bg_copy_tilemap_to_vram(0); + DestroyTask(taskId); + } + schedule_bg_copy_tilemap_to_vram(1); + schedule_bg_copy_tilemap_to_vram(2); +} + +void sub_81C1EFC(u16 a, s16 b, u16 move) +{ + if (b > gUnknown_0861CC10.field_6) + b = gUnknown_0861CC10.field_6; + if (b == 0 || b == gUnknown_0861CC10.field_6) + sub_81C1CB0(&gUnknown_0861CC10, &gUnknown_0203CF1C->unkTilemap3[0], b, 1); + else + { + u8 taskId = FindTaskIdByFunc(sub_81C1F80); + if (taskId == 0xFF) + taskId = CreateTask(sub_81C1F80, 8); + gTasks[taskId].data[0] = b; + gTasks[taskId].data[1] = a; + gTasks[taskId].data[2] = move; + } +} + +void sub_81C1F80(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + data[1] += data[0]; + if (data[1] < 0) + { + data[1] = 0; + } + else if (data[1] > gUnknown_0861CC10.field_6) + { + data[1] = gUnknown_0861CC10.field_6; + } + sub_81C1CB0(&gUnknown_0861CC10, &gUnknown_0203CF1C->unkTilemap3[0], data[1], 1); + if (data[1] <= 0 || data[1] >= gUnknown_0861CC10.field_6) + { + if (data[0] < 0) + { + if (gUnknown_0203CF1C->unk40C0 == 3 && FuncIsActiveTask(sub_81C0B8C) == 0) + PutWindowTilemap(15); + sub_81C240C(data[2]); + } + else + { + if (!gSprites[gUnknown_0203CF1C->unk40D5].invisible) + { + PutWindowTilemap(13); + } + PutWindowTilemap(19); + } + schedule_bg_copy_tilemap_to_vram(0); + DestroyTask(taskId); + } + schedule_bg_copy_tilemap_to_vram(1); + schedule_bg_copy_tilemap_to_vram(2); +} + +void sub_81C2074(u16 a, s16 b) +{ + if (b > gUnknown_0861CBEC.field_6) + b = gUnknown_0861CBEC.field_6; + if (b == 0 || b == gUnknown_0861CBEC.field_6) + { + sub_81C1CB0(&gUnknown_0861CBEC, &gUnknown_0203CF1C->unkTilemap0[0], b, 0); + sub_81C1CB0(&gUnknown_0861CBF8, &gUnknown_0203CF1C->unkTilemap0[0], b, 0); + } + else + { + u8 taskId = CreateTask(sub_81C20F0, 8); + gTasks[taskId].data[0] = b; + gTasks[taskId].data[1] = a; + } +} + +void sub_81C20F0(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + data[1] += data[0]; + if (data[1] < 0) + data[1] = 0; + else if (data[1] > gUnknown_0861CBEC.field_6) + data[1] = gUnknown_0861CBEC.field_6; + sub_81C1CB0(&gUnknown_0861CBEC, &gUnknown_0203CF1C->unkTilemap0[0], data[1], 0); + sub_81C1CB0(&gUnknown_0861CBF8, &gUnknown_0203CF1C->unkTilemap0[0], data[1], 0); + schedule_bg_copy_tilemap_to_vram(3); + if (data[1] <= 0 || data[1] >= gUnknown_0861CBEC.field_6) + { + if (data[0] < 0) + { + sub_81C4A88(); + PutWindowTilemap(13); + schedule_bg_copy_tilemap_to_vram(0); + } + DestroyTask(taskId); + } +} + +// somebody send help this is a complete fucking mess +#ifdef NONMATCHING +void sub_81C2194(u16 *a, u16 b, u8 c) +{ + u16 i; + int var; + b *= 0x1000; + var = 0x56A; + + if (c == 0) + { + for (i = 0; i < 20; i++) + { + a[(i + var) << 1] = gUnknown_08DC3CD4[i] + b; + a[((i + var) << 1) + 0x40] = gUnknown_08DC3CD4[i] + b; + a[((i + var) << 1) + 0x80] = gUnknown_08DC3CD4[i + 20] + b; + } + } + else + { + for (i = 0; i < 20; i++) + { + a[(i + var)] = gUnknown_08DC3CD4[i + 20] + b; + a[((i + var)) + 0x40] = gUnknown_08DC3CD4[i + 40] + b; + a[((i + var)) + 0x80] = gUnknown_08DC3CD4[i + 40] + b; + } + } +} +#else +__attribute__((naked)) +void sub_81C2194(u16 *a, u16 b, u8 c) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + adds r6, r0, 0\n\ + lsls r2, 24\n\ + lsls r1, 28\n\ + lsrs r4, r1, 16\n\ + ldr r7, =0x0000056a\n\ + cmp r2, 0\n\ + bne _081C21E4\n\ + movs r3, 0\n\ + ldr r5, =gUnknown_08DC3CD4\n\ +_081C21A8:\n\ + adds r2, r7, r3\n\ + lsls r2, 1\n\ + adds r2, r6\n\ + lsls r0, r3, 1\n\ + adds r0, r5\n\ + ldrh r1, [r0]\n\ + adds r1, r4, r1\n\ + strh r1, [r2]\n\ + adds r0, r2, 0\n\ + adds r0, 0x40\n\ + strh r1, [r0]\n\ + adds r2, 0x80\n\ + adds r0, r3, 0\n\ + adds r0, 0x14\n\ + lsls r0, 1\n\ + adds r0, r5\n\ + ldrh r0, [r0]\n\ + adds r0, r4, r0\n\ + strh r0, [r2]\n\ + adds r0, r3, 0x1\n\ + lsls r0, 16\n\ + lsrs r3, r0, 16\n\ + cmp r3, 0x13\n\ + bls _081C21A8\n\ + b _081C221C\n\ + .pool\n\ +_081C21E4:\n\ + movs r3, 0\n\ + ldr r5, =gUnknown_08DC3CD4\n\ +_081C21E8:\n\ + adds r1, r7, r3\n\ + lsls r1, 1\n\ + adds r1, r6\n\ + adds r0, r3, 0\n\ + adds r0, 0x14\n\ + lsls r0, 1\n\ + adds r0, r5\n\ + ldrh r0, [r0]\n\ + adds r0, r4, r0\n\ + strh r0, [r1]\n\ + adds r2, r1, 0\n\ + adds r2, 0x40\n\ + adds r0, r3, 0\n\ + adds r0, 0x28\n\ + lsls r0, 1\n\ + adds r0, r5\n\ + ldrh r0, [r0]\n\ + adds r0, r4, r0\n\ + strh r0, [r2]\n\ + adds r1, 0x80\n\ + strh r0, [r1]\n\ + adds r0, r3, 0x1\n\ + lsls r0, 16\n\ + lsrs r3, r0, 16\n\ + cmp r3, 0x13\n\ + bls _081C21E8\n\ +_081C221C:\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +void sub_81C2228(struct Pokemon *mon) +{ + if (!CheckPartyPokerus(mon, 0) && CheckPartyHasHadPokerus(mon, 0)) + { + gUnknown_0203CF1C->unkTilemap0[0x223] = 0x2C; + gUnknown_0203CF1C->unkTilemap0_1[0x223] = 0x2C; + } + else + { + gUnknown_0203CF1C->unkTilemap0[0x223] = 0x81A; + gUnknown_0203CF1C->unkTilemap0_1[0x223] = 0x81A; + } + schedule_bg_copy_tilemap_to_vram(3); +} + +void sub_81C228C(u8 a) +{ + if (a == 0) + sub_8199C30(3, 1, 4, 8, 8, 0); + else + sub_8199C30(3, 1, 4, 8, 8, 5); + schedule_bg_copy_tilemap_to_vram(3); +} + +void sub_81C22CC(struct Pokemon *unused) +{ + s64 r6r7; + struct PokeSummary *summary = &gUnknown_0203CF1C->summary; + u16 *r9; + u8 i; + + if (summary->level < MAX_MON_LEVEL) + { + u32 r1 = gExperienceTables[gBaseStats[summary->species].growthRate][summary->level + 1] - gExperienceTables[gBaseStats[summary->species].growthRate][summary->level]; + u32 r4 = summary->exp - gExperienceTables[gBaseStats[summary->species].growthRate][summary->level]; + + r6r7 = r4 * 64 / r1; + if (r6r7 == 0 && r4 != 0) + r6r7 = 1; + } + else + { + r6r7 = 0; + } + + r9 = &gUnknown_0203CF1C->unkTilemap1_1[0x255]; + for (i = 0; i < 8; i++) + { + if (r6r7 > 7) + r9[i] = 0x206A; + else + r9[i] = 0x2062 + (r6r7 % 8); + r6r7 -= 8; + if (r6r7 < 0) + r6r7 = 0; + } + + if (GetBgTilemapBuffer(1) == gUnknown_0203CF1C->unkTilemap1) + schedule_bg_copy_tilemap_to_vram(1); + else + schedule_bg_copy_tilemap_to_vram(2); +} + +void sub_81C240C(u16 move) +{ + u16* r5 = &gUnknown_0203CF1C->unkTilemap3_1[0]; + u8 i; + u8 r4; + if (move != MOVE_NONE) + { + r4 = gContestEffects[gContestMoves[move].effect].appeal; + if (r4 != 0xFF) + r4 /= 10; + for (i = 0;i < 8; i++) + { + if (r4 != 0xFF && i < r4) + { + r5[((i>>2)*32)+(i&3)+0x1E6] = 0x103A; + } + else + r5[((i>>2)*32)+(i&3)+0x1E6] = 0x1039; + } + r4 = gContestEffects[gContestMoves[move].effect].jam; + if (r4 != 0xFF) + r4 /= 10; + for (i = 0;i < 8; i++) + { + if (r4 != 0xFF && i < r4) + { + r5[((i>>2)*32)+(i&3)+0x226] = 0x103C; + } + else + r5[((i>>2)*32)+(i&3)+0x226] = 0x103D; + } + } +} + +void sub_81C2524() +{ + if (gUnknown_0203CF1C->summary.isEgg != 0) + ChangeBgX(3, 0x10000, 0); + else + ChangeBgX(3, 0, 0); +} + +void sub_81C2554() +{ + u8 i; + InitWindows(&gUnknown_0861CC24); + DeactivateAllTextPrinters(); + for (i = 0; i < 20; i++) + FillWindowPixelBuffer(i, 0); + for (i = 0; i < 8; i++) + gUnknown_0203CF1C->unk40CB[i] |= 0xFF; +} + +void sub_81C25A4(u8 a, u8 *b, u8 c, u8 d, u8 e, u8 f) +{ + AddTextPrinterParametrized2(a, 1, c, d, 0, e, &gUnknown_0861CD2C[f], 0, b); +} + +void sub_81C25E8() +{ + FillWindowPixelBuffer(17, 0); + FillWindowPixelBuffer(18, 0); + FillWindowPixelBuffer(19, 0); + if (gUnknown_0203CF1C->summary.isEgg == 0) + sub_81C2628(); + else + sub_81C2794(); + schedule_bg_copy_tilemap_to_vram(0); +} + +void sub_81C2628() +{ + u8 strArray[16]; + struct Pokemon *mon = &gUnknown_0203CF1C->currentMon; + struct PokeSummary *summary = &gUnknown_0203CF1C->summary; + u16 r5 = SpeciesToPokedexNum(summary->species); + if (r5 != 0xFFFF) + { + StringCopy(gStringVar1, &gText_UnkCtrlF908Clear01[0]); + ConvertIntToDecimalStringN(gStringVar2, r5, 2, 3); + StringAppend(gStringVar1, gStringVar2); + if (IsMonShiny(mon) == 0) + { + sub_81C25A4(17, gStringVar1, 0, 1, 0, 1); + sub_81C228C(0); + } + else + { + sub_81C25A4(17, gStringVar1, 0, 1, 0, 7); + sub_81C228C(1); + } + PutWindowTilemap(17); + } + else + { + ClearWindowTilemap(17); + if (IsMonShiny(mon) == 0) + sub_81C228C(0); + else + sub_81C228C(1); + } + StringCopy(gStringVar1, &gText_LevelSymbol[0]); + ConvertIntToDecimalStringN(gStringVar2, summary->level, 0, 3); + StringAppend(gStringVar1, gStringVar2); + sub_81C25A4(19, gStringVar1, 0x18, 17, 0, 1); + GetMonNickname(mon, gStringVar1); + sub_81C25A4(18, gStringVar1, 0, 1, 0, 1); + strArray[0] = CHAR_SLASH; + StringCopy(&strArray[1], &gSpeciesNames[summary->species2][0]); + sub_81C25A4(19, &strArray[0], 0, 1, 0, 1); + sub_81C27DC(mon, summary->species2); + PutWindowTilemap(18); + PutWindowTilemap(19); +} + +void sub_81C2794() +{ + GetMonNickname(&gUnknown_0203CF1C->currentMon, gStringVar1); + sub_81C25A4(18, gStringVar1, 0, 1, 0, 1); + PutWindowTilemap(18); + ClearWindowTilemap(17); + ClearWindowTilemap(19); +} + +void sub_81C27DC(struct Pokemon *mon, u16 a) +{ + if (a != SPECIES_NIDORAN_M && a != SPECIES_NIDORAN_F) + { + u8 gender = GetMonGender(mon); + switch (gender) + { + case 0: + sub_81C25A4(0x13, &gText_MaleSymbol[0], 0x39, 17, 0, 3); + break; + case 0xFE: + sub_81C25A4(0x13, &gText_FemaleSymbol[0], 0x39, 17, 0, 4); + break; + } + } +} + +void sub_81C2838(u8 a, bool8 b, u32 c) +{ + BlitBitmapToWindow(a, (b) ? &gUnknown_0861CDD3[0] : &gUnknown_0861CDD3[0] - 0x80, c, 0, 16, 16); +} + +void sub_81C286C() +{ + int r4; + int r2; + int temp; + sub_81C25A4(0, gText_PkmnInfo, 2, 1, 0, 1); + sub_81C25A4(1, gText_PkmnSkills, 2, 1, 0, 1); + sub_81C25A4(2, gText_BattleMoves, 2, 1, 0, 1); + sub_81C25A4(3, gText_ContestMoves, 2, 1, 0, 1); + r4 = GetStringRightAlignXOffset(1, gText_Cancel2, 0x3E); + r2 = r4 - 16; + if (r2 < 0) + r2 = 0; + sub_81C2838(4, 0, r2); + sub_81C25A4(4, gText_Cancel2, r4, 1, 0, 0); + r4 = GetStringRightAlignXOffset(1, gText_Info, 0x3E); + r2 = r4 - 16; + if (r2 < 0) + r2 = 0; + sub_81C2838(5, 0, r2); + sub_81C25A4(5, gText_Info, r4, 1, 0, 0); + r4 = GetStringRightAlignXOffset(1, gText_Switch, 0x3E); + r2 = r4 - 16; + if (r2 < 0) + r2 = 0; + sub_81C2838(6, 0, r2); + sub_81C25A4(6, gText_Switch, r4, 1, 0, 0); + sub_81C25A4(8, gText_RentalPkmn, 0, 1, 0, 1); + sub_81C25A4(9, gText_TypeSlash, 0, 1, 0, 0); + temp = 6; + temp += GetStringCenterAlignXOffset(1, gText_HP4, 42); + sub_81C25A4(10, gText_HP4, temp, 1, 0, 1); + temp = 6; + temp += GetStringCenterAlignXOffset(1, gText_Attack3, 42); + sub_81C25A4(10, gText_Attack3, temp, 17, 0, 1); + temp = 6; + temp += GetStringCenterAlignXOffset(1, gText_Defense3, 42); + sub_81C25A4(10, gText_Defense3, temp, 33, 0, 1); + temp = 2; + temp += GetStringCenterAlignXOffset(1, gText_SpAtk4, 36); + sub_81C25A4(11, gText_SpAtk4, temp, 1, 0, 1); + temp = 2; + temp += GetStringCenterAlignXOffset(1, gText_SpDef4, 36); + sub_81C25A4(11, gText_SpDef4, temp, 17, 0, 1); + temp = 2; + temp += GetStringCenterAlignXOffset(1, gText_Speed2, 36); + sub_81C25A4(11, gText_Speed2, temp, 33, 0, 1); + sub_81C25A4(12, gText_ExpPoints, 6, 1, 0, 1); + sub_81C25A4(12, gText_NextLv, 6, 17, 0, 1); + sub_81C25A4(13, gText_Status, 2, 1, 0, 1); + sub_81C25A4(14, gText_Power, 0, 1, 0, 1); + sub_81C25A4(14, gText_Accuracy2, 0, 17, 0, 1); + sub_81C25A4(15, gText_Appeal, 0, 1, 0, 1); + sub_81C25A4(15, gText_Jam, 0, 17, 0, 1); +} + +void sub_81C2AFC(u8 a) +{ + u8 i; + ClearWindowTilemap(0); + ClearWindowTilemap(1); + ClearWindowTilemap(2); + ClearWindowTilemap(3); + switch (a) + { + case 0: + PutWindowTilemap(0); + PutWindowTilemap(4); + if (sub_81A6BF4() == TRUE || sub_81B9E94() == TRUE) + PutWindowTilemap(8); + PutWindowTilemap(9); + break; + case 1: + PutWindowTilemap(1); + PutWindowTilemap(10); + PutWindowTilemap(11); + PutWindowTilemap(12); + break; + case 2: + PutWindowTilemap(2); + if (gUnknown_0203CF1C->unk40BC == 3) + { + if(!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + PutWindowTilemap(14); + } + else + PutWindowTilemap(5); + break; + case 3: + PutWindowTilemap(3); + if (gUnknown_0203CF1C->unk40BC == 3) + { + if(!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + PutWindowTilemap(15); + } + else + PutWindowTilemap(5); + break; + } + for (i = 0; i < 8; i++) + { + PutWindowTilemap(gUnknown_0203CF1C->unk40CB[i]); + } + schedule_bg_copy_tilemap_to_vram(0); +} + +void sub_81C2C38(u8 a) +{ + u8 i; + switch (a) + { + case 0: + ClearWindowTilemap(4); + if (sub_81A6BF4() == TRUE || sub_81B9E94() == TRUE) + ClearWindowTilemap(8); + ClearWindowTilemap(9); + break; + case 1: + ClearWindowTilemap(10); + ClearWindowTilemap(11); + ClearWindowTilemap(12); + break; + case 2: + if (gUnknown_0203CF1C->unk40BC == 3) + { + if(!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + ClearWindowTilemap(14); + } + else + ClearWindowTilemap(5); + break; + case 3: + if (gUnknown_0203CF1C->unk40BC == 3) + { + if(!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + ClearWindowTilemap(15); + } + else + ClearWindowTilemap(5); + break; + } + for (i = 0; i < 8; i++) + sub_81C2D68(i); + schedule_bg_copy_tilemap_to_vram(0); +} + + + +#ifdef NONMATCHING +u8 sub_81C2D2C(struct WindowTemplate *template, u8 a) +{ + u8 *r4 = gUnknown_0203CF1C->unk40CB; + if (r4[a] == 0xFF) + { + r4[a] = AddWindow(&template[a]); + FillWindowPixelBuffer(r4[a], 0); + } + return r4[a]; +} +#else +__attribute__((naked)) +u8 sub_81C2D2C(struct WindowTemplate *template, u8 a) +{ + asm(".syntax unified\n\ + push {r4,lr}\n\ + adds r3, r0, 0\n\ + lsls r1, 24\n\ + lsrs r2, r1, 24\n\ + ldr r0, =gUnknown_0203CF1C\n\ + ldr r4, =0x000040cb\n\ + adds r1, r2, r4\n\ + ldr r0, [r0]\n\ + adds r4, r0, r1\n\ + ldrb r0, [r4]\n\ + cmp r0, 0xFF\n\ + bne _081C2D56\n\ + lsls r0, r2, 3\n\ + adds r0, r3, r0\n\ + bl AddWindow\n\ + strb r0, [r4]\n\ + ldrb r0, [r4]\n\ + movs r1, 0\n\ + bl FillWindowPixelBuffer\n\ +_081C2D56:\n\ + ldrb r0, [r4]\n\ + pop {r4}\n\ + pop {r1}\n\ + bx r1\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +#ifdef NONMATCHING +void sub_81C2D68(u8 a) +{ + u8 *r4 = gUnknown_0203CF1C->unk40CB; + if (r4[a] != 0xFF) + { + ClearWindowTilemap(r4[a]); + RemoveWindow(r4[a]); + r4[a] = 0xFF; + } +} +#else +__attribute__((naked)) +void sub_81C2D68(u8 a) +{ + asm(".syntax unified\n\ + push {r4,lr}\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + ldr r1, =gUnknown_0203CF1C\n\ + ldr r2, =0x000040cb\n\ + adds r0, r2\n\ + ldr r1, [r1]\n\ + adds r4, r1, r0\n\ + ldrb r0, [r4]\n\ + cmp r0, 0xFF\n\ + beq _081C2D8C\n\ + bl ClearWindowTilemap\n\ + ldrb r0, [r4]\n\ + bl RemoveWindow\n\ + movs r0, 0xFF\n\ + strb r0, [r4]\n\ +_081C2D8C:\n\ + pop {r4}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +void sub_81C2D9C(u8 a) +{ + u16 i; + for (i = 0; i < 8; i++) + { + if (gUnknown_0203CF1C->unk40CB[i] != 0xFF) + FillWindowPixelBuffer(gUnknown_0203CF1C->unk40CB[i], 0); + } + gUnknown_0861CE54[a](); +} + +void sub_81C2DE4(u8 a) +{ + CreateTask(gUnknown_0861CE64[a], 16); +} + +void sub_81C2E00() +{ + if (gUnknown_0203CF1C->summary.isEgg) + { + sub_81C335C(); + sub_81C33CC(); + sub_81C3428(); + sub_81C349C(); + } + else + { + sub_81C2EC4(); + sub_81C2F5C(); + sub_81C2FD8(); + sub_81C302C(); + sub_81C307C(); + sub_81C3194(); + } +} + +void sub_81C2E40(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + s16 dataa = data[0] - 1; + switch (dataa) + { + case 0: + sub_81C2EC4(); + break; + case 1: + sub_81C2F5C(); + break; + case 2: + sub_81C2FD8(); + break; + case 3: + sub_81C302C(); + break; + case 4: + sub_81C307C(); + break; + case 5: + sub_81C3194(); + break; + case 6: + DestroyTask(taskId); + return; + } + data[0]++; +} + +void sub_81C2EC4() +{ + u8 r5; + int r2; + if (sub_81A6BF4() != 1 && sub_81B9E94() != 1) + { + r5 = sub_81C2D2C(&gUnknown_0861CCCC, 0); + sub_81C25A4(r5, gText_OTSlash, 0, 1, 0, 1); + r2 = GetStringWidth(1, gText_OTSlash, 0); + if (gUnknown_0203CF1C->summary.OTGender == 0) + sub_81C25A4(r5, gUnknown_0203CF1C->summary.OTName, r2, 1, 0, 5); + else + sub_81C25A4(r5, gUnknown_0203CF1C->summary.OTName, r2, 1, 0, 6); + } +} + +void sub_81C2F5C() +{ + int r4; + if (sub_81A6BF4() != TRUE && sub_81B9E94() != TRUE) + { + ConvertIntToDecimalStringN(StringCopy(gStringVar1, gText_UnkCtrlF907F908), (u16)gUnknown_0203CF1C->summary.OTID, 2, 5); + r4 = GetStringRightAlignXOffset(1, gStringVar1, 0x38); + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 1), gStringVar1, r4, 1, 0, 1); + } +} + +void sub_81C2FD8() +{ + u8 ability = GetAbilityBySpecies(gUnknown_0203CF1C->summary.species, gUnknown_0203CF1C->summary.altAbility); + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 2), gAbilityNames[ability], 0, 1, 0, 1); +} + +void sub_81C302C() +{ + u8 ability = GetAbilityBySpecies(gUnknown_0203CF1C->summary.species, gUnknown_0203CF1C->summary.altAbility); + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 2), gAbilityDescriptionPointers[ability], 0, 17, 0, 0); +} + +void sub_81C307C() +{ + struct PokeSummary *sum = &gUnknown_0203CF1C->summary; + u8 *text; + sub_81AFBF0(); + sub_81AFC0C(0, gUnknown_0861CE74); + sub_81AFC0C(1, gUnknown_0861CE7B); + sub_81C31C0(); + if (sub_81A6BF4() == TRUE || sub_81B9E94() == TRUE || sub_81C3304() == TRUE) + sub_81AFC28(gStringVar4, gText_XNature); + else + { + u8 *alloced1 = Alloc(32); + u8 *alloced2 = Alloc(32); + sub_81C31F0(alloced1); + if (sum->metLocation <= 0xD4) + { + sub_8124610(alloced2, sum->metLocation); + sub_81AFC0C(4, alloced2); + } + if (sub_81C3220() == 1) + { + if (sum->metLevel == 0) + text = (sum->metLocation > 0xD4) ? gText_XNatureHatchedSomewhereAt : gText_XNatureHatchedAtYZ; + else + text = (sum->metLocation > 0xD4) ? gText_XNatureMetSomewhereAt : gText_XNatureMetAtYZ; + } + else if (sum->metLocation == 0xFF) + text = gText_XNatureFatefulEncounter; + else if (sum->metLocation != 0xFE && sub_81C32BC()) + text = (sum->metLocation > 0xD4) ? gText_XNatureObtainedInTrade : gText_XNatureProbablyMetAt; + else + text = gText_XNatureObtainedInTrade; + sub_81AFC28(gStringVar4, text); + Free(alloced1); + Free(alloced2); + } +} + +void sub_81C3194() +{ + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 3), gStringVar4, 0, 1, 0, 0); +} + +void sub_81C31C0() +{ + struct UnkSummaryStruct *sumStruct = gUnknown_0203CF1C; + sub_81AFC0C(2, gNatureNamePointers[sumStruct->summary.nature]); + sub_81AFC0C(5, gText_EmptyString5); +} + +void sub_81C31F0(u8 *a) +{ + u8 level = gUnknown_0203CF1C->summary.metLevel; + if (level == 0) + level = 5; + ConvertIntToDecimalStringN(a, level, 0, 3); + sub_81AFC0C(3, a); +} + +u8 sub_81C3220() +{ + struct PokeSummary *sum = &gUnknown_0203CF1C->summary; + u32 r4; + u8 r5; + if (gUnknown_0203CF1C->unk0 == (union UnkUnion *)&gEnemyParty) + { + u8 multiID = GetMultiplayerId()^1; + r4 = (u16)gLinkPlayers[multiID].trainerId; + r5 = gLinkPlayers[multiID].gender; + StringCopy(gStringVar1, gLinkPlayers[multiID].name); + } + else + { + r4 = GetPlayerIDAsU32() & 0xFFFF; + r5 = gSaveBlock2Ptr->playerGender; + StringCopy(gStringVar1, gSaveBlock2Ptr->playerName); + } + if (r5 != sum->OTGender || r4 != (sum->OTID & 0xFFFF) || StringCompareWithoutExtCtrlCodes(gStringVar1, sum->OTName)) + { + return 0; + } + return 1; +} + +bool8 sub_81C32BC() +{ + struct PokeSummary *sum = &gUnknown_0203CF1C->summary; + u8 r0 = sum->metGame - 1; + if (r0 <= 4) + return TRUE; + return FALSE; +} + +bool8 sub_81C32E0() +{ + struct PokeSummary *sum = &gUnknown_0203CF1C->summary; + u8 r0 = sum->metGame - 1; + if (r0 <= 2) + return TRUE; + return FALSE; +} + +bool8 sub_81C3304() +{ + if ((gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) && gMain.inBattle) + { + if (gUnknown_0203CF1C->unk40BE == 1 || gUnknown_0203CF1C->unk40BE == 4 || gUnknown_0203CF1C->unk40BE == 5) + return TRUE; + } + return FALSE; +} + +#ifdef NONMATCHING +void sub_81C335C() +{ + u8 r4 = sub_81C2D2C(&gUnknown_0861CCCC, 0); + u32 r5 = GetStringWidth(1, gText_OTSlash, 0); + sub_81C25A4(r4, gText_OTSlash, 0, 1, 0, 1); + sub_81C25A4(r4, gText_FiveMarks, r5, 1, 0, 1); +} +#else +__attribute__((naked)) +void sub_81C335C() +{ + asm(".syntax unified\n\ + push {r4-r6,lr}\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5,r6}\n\ + sub sp, 0x8\n\ + ldr r0, =gUnknown_0861CCCC\n\ + movs r1, 0\n\ + bl sub_81C2D2C\n\ + adds r4, r0, 0\n\ + lsls r4, 24\n\ + lsrs r4, 24\n\ + ldr r0, =gText_OTSlash\n\ + mov r8, r0\n\ + movs r0, 0x1\n\ + mov r1, r8\n\ + movs r2, 0\n\ + bl GetStringWidth\n\ + adds r5, r0, 0\n\ + movs r0, 0\n\ + mov r9, r0\n\ + str r0, [sp]\n\ + movs r6, 0x1\n\ + str r6, [sp, 0x4]\n\ + adds r0, r4, 0\n\ + mov r1, r8\n\ + movs r2, 0\n\ + movs r3, 0x1\n\ + bl sub_81C25A4\n\ + ldr r1, =gText_FiveMarks\n\ + lsls r5, 24\n\ + lsrs r5, 24\n\ + mov r0, r9\n\ + str r0, [sp]\n\ + str r6, [sp, 0x4]\n\ + adds r0, r4, 0\n\ + adds r2, r5, 0\n\ + movs r3, 0x1\n\ + bl sub_81C25A4\n\ + add sp, 0x8\n\ + pop {r3,r4}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + pop {r4-r6}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +void sub_81C33CC() +{ + int r4; + StringCopy(gStringVar1, gText_UnkCtrlF907F908); + StringAppend(gStringVar1, gText_FiveMarks); + r4 = GetStringRightAlignXOffset(1, gStringVar1, 0x38); + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 1), gStringVar1, r4, 1, 0, 1); +} + +void sub_81C3428() +{ + u8 *text; + struct PokeSummary *sum = &gUnknown_0203CF1C->summary; + if (gUnknown_0203CF1C->summary.sanity == 1) + text = gText_EggWillTakeALongTime; + else if (sum->friendship <= 5) + text = gText_EggAboutToHatch; + else if (sum->friendship <= 10) + text = gText_EggWillHatchSoon; + else if (sum->friendship <= 40) + text = gText_EggWillTakeSomeTime; + else + text = gText_EggWillTakeALongTime; + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 2), text, 0, 1, 0, 0); +} + +void sub_81C349C() +{ + u8 *text; + struct PokeSummary *sum = &gUnknown_0203CF1C->summary; + if (gUnknown_0203CF1C->summary.sanity != 1) + { + if (sum->metLocation == 0xFF) + text = gText_PeculiarEggNicePlace; + else if (sub_81C32BC() == 0 || sub_81C3220() == 0) + text = gText_PeculiarEggTrade; + else if (sum->metLocation == 0xFD) + text = (sub_81C32E0() == TRUE) ? gText_EggFromHotSprings : gText_EggFromTraveler; + else + text = gText_OddEggFoundByCouple; + } + else + text = gText_OddEggFoundByCouple; + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 3), text, 0, 1, 0, 0); +} + +void sub_81C3530() +{ + sub_81C35E4(); + sub_81C3690(); + sub_81C3710(); + sub_81C37D8(); + sub_81C3808(); + sub_81C3890(); + sub_81C38C0(); +} + +void sub_81C3554(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + s16 dataa = data[0] - 1; + switch (dataa) + { + case 0: + sub_81C35E4(); + break; + case 1: + sub_81C3690(); + break; + case 2: + sub_81C3710(); + break; + case 3: + sub_81C37D8(); + break; + case 4: + sub_81C3808(); + break; + case 5: + sub_81C3890(); + break; + case 6: + sub_81C38C0(); + break; + case 7: + DestroyTask(taskId); + return; + } + data[0]++; +} + +void sub_81C35E4() +{ + u8 *text; + int offset; + if (gUnknown_0203CF1C->summary.item == ITEM_ENIGMA_BERRY && sub_81B1250() == 1 && (gUnknown_0203CF1C->unk40BE == 1 || gUnknown_0203CF1C->unk40BE == 4 || gUnknown_0203CF1C->unk40BE == 5)) + { + text = (u8*)ItemId_GetItem(ITEM_ENIGMA_BERRY); + } + else if (gUnknown_0203CF1C->summary.item == ITEM_NONE) + text = gText_None; + else + { + CopyItemName(gUnknown_0203CF1C->summary.item, gStringVar1); + text = gStringVar1; + } + offset = GetStringCenterAlignXOffset(1, text, 0x48) + 6; + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCEC, 0), text, offset, 1, 0, 0); +} + +void sub_81C3690() +{ + u8 *text; + int offset; + if (gUnknown_0203CF1C->summary.ribbons == 0) + text = gText_None; + else + { + ConvertIntToDecimalStringN(gStringVar1, gUnknown_0203CF1C->summary.ribbons, 1, 2); + StringExpandPlaceholders(gStringVar4, gText_RibbonsVar1); + text = gStringVar4; + } + offset = GetStringCenterAlignXOffset(1, text, 0x46) + 6; + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCEC, 1), text, offset, 1, 0, 0); +} + +void sub_81C3710() +{ + u8 *alloced1 = Alloc(8); + u8 *alloced2 = Alloc(8); + u8 *alloced3 = Alloc(8); + u8 *alloced4 = Alloc(8); + ConvertIntToDecimalStringN(alloced1, gUnknown_0203CF1C->summary.currentHP, 1, 3); + ConvertIntToDecimalStringN(alloced2, gUnknown_0203CF1C->summary.maxHP, 1, 3); + ConvertIntToDecimalStringN(alloced3, gUnknown_0203CF1C->summary.atk, 1, 7); + ConvertIntToDecimalStringN(alloced4, gUnknown_0203CF1C->summary.def, 1, 7); + sub_81AFBF0(); + sub_81AFC0C(0, alloced1); + sub_81AFC0C(1, alloced2); + sub_81AFC0C(2, alloced3); + sub_81AFC0C(3, alloced4); + sub_81AFC28(gStringVar4, gUnknown_0861CE82); + Free(alloced1); + Free(alloced2); + Free(alloced3); + Free(alloced4); +} + +void sub_81C37D8() +{ + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCEC, 2), gStringVar4, 4, 1, 0, 0); +} + +void sub_81C3808() +{ + ConvertIntToDecimalStringN(gStringVar1, gUnknown_0203CF1C->summary.spatk, 1, 3); + ConvertIntToDecimalStringN(gStringVar2, gUnknown_0203CF1C->summary.spdef, 1, 3); + ConvertIntToDecimalStringN(gStringVar3, gUnknown_0203CF1C->summary.speed, 1, 3); + sub_81AFBF0(); + sub_81AFC0C(0, gStringVar1); + sub_81AFC0C(1, gStringVar2); + sub_81AFC0C(2, gStringVar3); + sub_81AFC28(gStringVar4, gUnknown_0861CE8E); +} + +void sub_81C3890() +{ + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCEC, 3), gStringVar4, 2, 1, 0, 0); +} + +void sub_81C38C0() +{ + struct PokeSummary *sum = &gUnknown_0203CF1C->summary; + u8 r6 = sub_81C2D2C(&gUnknown_0861CCEC, 4); + int offset; + u32 expToNextLevel; + ConvertIntToDecimalStringN(gStringVar1, sum->exp, 1, 7); + offset = GetStringRightAlignXOffset(1, gStringVar1, 0x2A) + 2; + sub_81C25A4(r6, gStringVar1, offset, 1, 0, 0); + if (sum->level < MAX_MON_LEVEL) + expToNextLevel = gExperienceTables[gBaseStats[sum->species].growthRate][sum->level + 1] - sum->exp; + else + expToNextLevel = 0; + ConvertIntToDecimalStringN(gStringVar1, expToNextLevel, 1, 6); + offset = GetStringRightAlignXOffset(1, gStringVar1, 0x2A) + 2; + sub_81C25A4(r6, gStringVar1, offset, 17, 0, 0); +} + +void sub_81C3984() +{ + sub_81C3B08(0); + sub_81C3B08(1); + sub_81C3B08(2); + sub_81C3B08(3); + if (gUnknown_0203CF1C->unk40BC == 3) + { + sub_81C3F44(); + if (gUnknown_0203CF1C->unk40C6 == 4) + { + if (gUnknown_0203CF1C->unk40C4 != 0) + sub_81C3E9C(gUnknown_0203CF1C->unk40C4); + } + else + sub_81C3E9C(gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]); + } +} + +void sub_81C39F0(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + s16 dataa = data[0] - 1; + + switch (dataa) + { + case 0: + sub_81C3B08(0); + break; + case 1: + sub_81C3B08(1); + break; + case 2: + sub_81C3B08(2); + break; + case 3: + sub_81C3B08(3); + break; + case 4: + if (gUnknown_0203CF1C->unk40BC == 3) + sub_81C3F44(); + break; + case 5: + if (gUnknown_0203CF1C->unk40BC == 3) + { + if (gUnknown_0203CF1C->unk40C6 == 4) + data[1] = gUnknown_0203CF1C->unk40C4; + else + data[1] = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + } + break; + case 6: + if (gUnknown_0203CF1C->unk40BC == 3) + { + if (!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + sub_81C3E9C(data[1]); + } + break; + case 7: + DestroyTask(taskId); + return; + } + data[0]++; +} + +#ifdef NONMATCHING +void sub_81C3B08(u8 a) +{ + struct UnkSummaryStruct *r10 = gUnknown_0203CF1C; + u8 r8 = sub_81C2D2C(&gUnknown_0861CD14, 0); + u8 sp = sub_81C2D2C(&gUnknown_0861CD14, 1); + u8 r6; + u8 r5; + u8 *text; + int offset; + u16 move; + if (r10->summary.moves[a] != 0) + { + move = r10->summary.moves[a]; + r6 = CalculatePPWithBonus(move, r10->summary.ppBonuses, a); + sub_81C25A4(r8, gMoveNames[move], 0, (a<<4) + 1, 0, 1); + ConvertIntToDecimalStringN(gStringVar1, r10->summary.pp[a], 1, 2); + ConvertIntToDecimalStringN(gStringVar2, r6, 1, 2); + sub_81AFBF0(); + sub_81AFC0C(0, gStringVar1); + sub_81AFC0C(1, gStringVar2); + sub_81AFC28(gStringVar4, gUnknown_0861CE97); + text = gStringVar4; + r5 = GetCurrentPpToMaxPpState(r10->summary.pp[a], r6) + 9; + offset = GetStringRightAlignXOffset(1, text, 0x2C); + } + else + { + sub_81C25A4(r8, gText_OneDash, 0, (a<<4) + 1, 0, 1); + text = gText_TwoDashes; + r5 = 12; + offset = GetStringCenterAlignXOffset(1, text, 0x2C); + } + sub_81C25A4(sp, text, offset, (a<<4), 0, r5); +} +#else +__attribute__((naked)) +void sub_81C3B08(u8 a) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0xC\n\ + lsls r0, 24\n\ + lsrs r7, r0, 24\n\ + ldr r0, =gUnknown_0203CF1C\n\ + ldr r0, [r0]\n\ + mov r10, r0\n\ + ldr r4, =gUnknown_0861CD14\n\ + adds r0, r4, 0\n\ + movs r1, 0\n\ + bl sub_81C2D2C\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r8, r0\n\ + adds r0, r4, 0\n\ + movs r1, 0x1\n\ + bl sub_81C2D2C\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + str r0, [sp, 0x8]\n\ + lsls r1, r7, 1\n\ + mov r0, r10\n\ + adds r0, 0x84\n\ + adds r0, r1\n\ + ldrh r5, [r0]\n\ + cmp r5, 0\n\ + beq _081C3C00\n\ + mov r0, r10\n\ + adds r0, 0xA4\n\ + ldrb r1, [r0]\n\ + adds r0, r5, 0\n\ + adds r2, r7, 0\n\ + bl CalculatePPWithBonus\n\ + adds r6, r0, 0\n\ + lsls r6, 24\n\ + lsrs r6, 24\n\ + movs r0, 0xD\n\ + adds r1, r5, 0\n\ + muls r1, r0\n\ + ldr r0, =gMoveNames\n\ + adds r1, r0\n\ + lsls r0, r7, 4\n\ + mov r9, r0\n\ + mov r3, r9\n\ + adds r3, 0x1\n\ + lsls r3, 24\n\ + lsrs r3, 24\n\ + movs r0, 0\n\ + str r0, [sp]\n\ + movs r0, 0x1\n\ + str r0, [sp, 0x4]\n\ + mov r0, r8\n\ + movs r2, 0\n\ + bl sub_81C25A4\n\ + ldr r0, =gStringVar1\n\ + mov r8, r0\n\ + mov r5, r10\n\ + adds r5, 0x8C\n\ + adds r5, r7\n\ + ldrb r1, [r5]\n\ + movs r2, 0x1\n\ + movs r3, 0x2\n\ + bl ConvertIntToDecimalStringN\n\ + ldr r4, =gStringVar2\n\ + adds r0, r4, 0\n\ + adds r1, r6, 0\n\ + movs r2, 0x1\n\ + movs r3, 0x2\n\ + bl ConvertIntToDecimalStringN\n\ + bl sub_81AFBF0\n\ + movs r0, 0\n\ + mov r1, r8\n\ + bl sub_81AFC0C\n\ + movs r0, 0x1\n\ + adds r1, r4, 0\n\ + bl sub_81AFC0C\n\ + ldr r4, =gStringVar4\n\ + ldr r1, =gUnknown_0861CE97\n\ + adds r0, r4, 0\n\ + bl sub_81AFC28\n\ + adds r7, r4, 0\n\ + ldrb r0, [r5]\n\ + adds r1, r6, 0\n\ + bl GetCurrentPpToMaxPpState\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + adds r5, r0, 0\n\ + adds r5, 0x9\n\ + movs r0, 0x1\n\ + adds r1, r7, 0\n\ + movs r2, 0x2C\n\ + bl GetStringRightAlignXOffset\n\ + mov r4, r9\n\ + b _081C3C26\n\ + .pool\n\ +_081C3C00:\n\ + ldr r1, =gText_OneDash\n\ + lsls r4, r7, 4\n\ + adds r3, r4, 0x1\n\ + lsls r3, 24\n\ + lsrs r3, 24\n\ + str r5, [sp]\n\ + movs r0, 0x1\n\ + str r0, [sp, 0x4]\n\ + mov r0, r8\n\ + movs r2, 0\n\ + bl sub_81C25A4\n\ + ldr r7, =gText_TwoDashes\n\ + movs r5, 0xC\n\ + movs r0, 0x1\n\ + adds r1, r7, 0\n\ + movs r2, 0x2C\n\ + bl GetStringCenterAlignXOffset\n\ +_081C3C26:\n\ + lsls r2, r0, 24\n\ + lsrs r2, 24\n\ + adds r3, r4, 0x1\n\ + lsls r3, 24\n\ + lsrs r3, 24\n\ + movs r0, 0\n\ + str r0, [sp]\n\ + lsls r0, r5, 24\n\ + lsrs r0, 24\n\ + str r0, [sp, 0x4]\n\ + ldr r0, [sp, 0x8]\n\ + adds r1, r7, 0\n\ + bl sub_81C25A4\n\ + add sp, 0xC\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +void sub_81C3C5C(u16 move) +{ + u8 *text; + if (move != 0) + { + FillWindowPixelRect(14, 0, 0x35, 0, 0x13, 0x20); + if (gBattleMoves[move].power <= 1) + text = gText_ThreeDashes; + else + { + ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].power, 1, 3); + text = gStringVar1; + } + sub_81C25A4(14, text, 0x35, 1, 0, 0); + if (gBattleMoves[move].accuracy == 0) + text = gText_ThreeDashes; + else + { + ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].accuracy, 1, 3); + text = gStringVar1; + } + sub_81C25A4(14, text, 0x35, 17, 0, 0); + } +} + +void sub_81C3D08() +{ + sub_81C3B08(0); + sub_81C3B08(1); + sub_81C3B08(2); + sub_81C3B08(3); + if (gUnknown_0203CF1C->unk40BC == 3) + { + sub_81C3F44(); + sub_81C3E2C(gUnknown_0203CF1C->unk40C6); + } +} + +void sub_81C3D54(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + s16 dataa = data[0] - 1; + + switch (dataa) + { + case 0: + sub_81C3B08(0); + break; + case 1: + sub_81C3B08(1); + break; + case 2: + sub_81C3B08(2); + break; + case 3: + sub_81C3B08(3); + break; + case 4: + if (gUnknown_0203CF1C->unk40BC == 3) + sub_81C3F44(); + break; + case 5: + if (gUnknown_0203CF1C->unk40BC == 3) + { + if (!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + sub_81C3E2C(gUnknown_0203CF1C->unk40C6); + } + break; + case 6: + DestroyTask(taskId); + return; + } + data[0]++; +} \ No newline at end of file diff --git a/src/start_menu.c b/src/start_menu.c index be30d0e53..37331a922 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -207,7 +207,7 @@ static bool32 PrintStartMenuItemsMultistep(s16 *index, u32 n) do { - if (sStartMenuItems[sCurrentStartMenuActions[_index]].func == StartMenu_PlayerName) + if (sStartMenuItems[sCurrentStartMenuActions[_index]].func.u8_void == StartMenu_PlayerName) { } diff --git a/src/tv.c b/src/tv.c index 7f64b46ac..3c822b394 100644 --- a/src/tv.c +++ b/src/tv.c @@ -2353,7 +2353,7 @@ void sub_80EDFB4(TVShow *show) show->secretBaseVisit.move = sTV_SecretBaseVisitMonsTemp[j].move; } -void sub_80EE104(void) +void TV_PutSecretBaseVisitOnTheAir(void) { TVShow *show; diff --git a/sym_ewram.txt b/sym_ewram.txt index 2ae20d3d3..f64bb98b8 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -1119,68 +1119,10 @@ gUnknown_0203A144: @ 203A144 gUnknown_0203A148: @ 203A148 .space 0x4 -gUnknown_0203A14C: @ 203A14C - .space 0x4 + .include "src/decoration.o" + .align 2 -gUnknown_0203A150: @ 203A150 - .space 0x1 - -gUnknown_0203A151: @ 203A151 - .space 0x1 - -gUnknown_0203A152: @ 203A152 - .space 0x10 - -gUnknown_0203A162: @ 203A162 - .space 0xC - -gUnknown_0203A16E: @ 203A16E - .space 0x2 - -gUnknown_0203A170: @ 203A170 - .space 0x2 - -gUnknown_0203A172: @ 203A172 - .space 0x1 - -gUnknown_0203A173: @ 203A173 - .space 0x9 - -gUnknown_0203A17C: @ 203A17C - .space 0xC - -gUnknown_0203A188: @ 203A188 - .space 0x4 - -gUnknown_0203A18C: @ 203A18C - .space 0x4 - -gUnknown_0203A190: @ 203A190 - .space 0x8A4 - -gUnknown_0203AA34: @ 203AA34 - .space 0x2 - -gUnknown_0203AA36: @ 203AA36 - .space 0x2 - -gUnknown_0203AA38: @ 203AA38 - .space 0x1 - -gUnknown_0203AA39: @ 203AA39 - .space 0x1 - -gUnknown_0203AA3A: @ 203AA3A - .space 0x2 - -gUnknown_0203AA3C: @ 203AA3C - .space 0x8 - -gUnknown_0203AA44: @ 203AA44 - .space 0x80 - -gUnknown_0203AAC4: @ 203AAC4 - .space 0x4 +@ slot_machine gUnknown_0203AAC8: @ 203AAC8 .space 0x4 @@ -1408,9 +1350,7 @@ gUnknown_0203BC34: @ 203BC34 gUnknown_0203BC38: @ 203BC38 .space 0x8 -gDecorationInventories: @ 203BC40 - .space 0x40 - + .include "src/decoration_inventory.o" .include "src/roamer.o" gUnknown_0203BC88: @ 203BC88