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 000000000..16528d9f3 Binary files /dev/null and b/graphics/decorations/decor_attract_mat.png differ diff --git a/graphics/decorations/decor_big_plant.pal b/graphics/decorations/decor_big_plant.pal new file mode 100644 index 000000000..6e5a869f3 --- /dev/null +++ b/graphics/decorations/decor_big_plant.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +189 230 106 +123 172 74 +90 139 65 +57 98 41 +213 180 106 +180 139 82 +139 98 49 +82 57 32 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_big_plant.png b/graphics/decorations/decor_big_plant.png new file mode 100644 index 000000000..e5eedd859 Binary files /dev/null and b/graphics/decorations/decor_big_plant.png differ 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 000000000..00c55f229 Binary files /dev/null and b/graphics/decorations/decor_blastoise_doll.png differ diff --git a/graphics/decorations/decor_blue_brick.pal b/graphics/decorations/decor_blue_brick.pal new file mode 100644 index 000000000..e8720d82f --- /dev/null +++ b/graphics/decorations/decor_blue_brick.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +156 180 246 +82 131 230 +57 98 189 +24 65 131 +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_blue_brick.png b/graphics/decorations/decor_blue_brick.png new file mode 100644 index 000000000..88e058712 Binary files /dev/null and b/graphics/decorations/decor_blue_brick.png differ 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 000000000..575b35241 Binary files /dev/null and b/graphics/decorations/decor_blue_tent.png differ 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 000000000..01ba82d28 Binary files /dev/null and b/graphics/decorations/decor_breakable_door.png differ 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 000000000..829e45349 Binary files /dev/null and b/graphics/decorations/decor_brick_desk.png differ 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 000000000..b40429229 Binary files /dev/null and b/graphics/decorations/decor_camp_desk.png differ 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 000000000..ffc3dfcef Binary files /dev/null and b/graphics/decorations/decor_charizard_doll.png differ 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 000000000..cc0efecc7 Binary files /dev/null and b/graphics/decorations/decor_colorful_plant.png differ diff --git a/graphics/decorations/decor_comfort_desk.pal b/graphics/decorations/decor_comfort_desk.pal new file mode 100644 index 000000000..f686f4b5c --- /dev/null +++ b/graphics/decorations/decor_comfort_desk.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +180 222 139 +139 189 139 +90 139 90 +41 90 41 +115 164 115 +0 0 0 +164 131 65 +115 82 57 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_comfort_desk.png b/graphics/decorations/decor_comfort_desk.png new file mode 100644 index 000000000..e7a72ff08 Binary files /dev/null and b/graphics/decorations/decor_comfort_desk.png differ 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 000000000..510675ee6 Binary files /dev/null and b/graphics/decorations/decor_fire_blast_mat.png differ 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 000000000..6de66ef9d Binary files /dev/null and b/graphics/decorations/decor_fissure_mat.png differ 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 000000000..fcc895eb9 Binary files /dev/null and b/graphics/decorations/decor_glass_ornament.png differ 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 000000000..dc8639c65 Binary files /dev/null and b/graphics/decorations/decor_gorgeous_plant.png differ 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 000000000..aa0c7feea Binary files /dev/null and b/graphics/decorations/decor_hard_desk.png differ diff --git a/graphics/decorations/decor_heavy_desk.pal b/graphics/decorations/decor_heavy_desk.pal new file mode 100644 index 000000000..c0ec71f09 --- /dev/null +++ b/graphics/decorations/decor_heavy_desk.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +180 180 197 +148 148 156 +90 90 90 +255 180 82 +230 139 49 +197 90 8 +90 41 8 +0 0 0 +123 123 123 +65 65 65 +106 106 115 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_heavy_desk.png b/graphics/decorations/decor_heavy_desk.png new file mode 100644 index 000000000..141bcd831 Binary files /dev/null and b/graphics/decorations/decor_heavy_desk.png differ 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 000000000..517553a4a Binary files /dev/null and b/graphics/decorations/decor_lapras_doll.png differ 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 000000000..82dbbfa66 Binary files /dev/null and b/graphics/decorations/decor_powder_snow_mat.png differ 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 000000000..5be05ebcb Binary files /dev/null and b/graphics/decorations/decor_pretty_desk.png differ 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 000000000..b9fc0f5de Binary files /dev/null and b/graphics/decorations/decor_pretty_flowers.png differ diff --git a/graphics/decorations/decor_ragged_desk.pal b/graphics/decorations/decor_ragged_desk.pal new file mode 100644 index 000000000..bac2a7372 --- /dev/null +++ b/graphics/decorations/decor_ragged_desk.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 205 98 +49 49 49 +238 222 172 +213 197 139 +180 164 106 +148 131 74 +123 98 49 +82 65 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 diff --git a/graphics/decorations/decor_ragged_desk.png b/graphics/decorations/decor_ragged_desk.png new file mode 100644 index 000000000..953c1862f Binary files /dev/null and b/graphics/decorations/decor_ragged_desk.png differ 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 000000000..3481044dd Binary files /dev/null and b/graphics/decorations/decor_red_brick.png differ diff --git a/graphics/decorations/decor_red_plant.pal b/graphics/decorations/decor_red_plant.pal new file mode 100644 index 000000000..c3021eee5 --- /dev/null +++ b/graphics/decorations/decor_red_plant.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +222 115 123 +189 74 82 +139 32 32 +82 32 16 +0 0 0 +115 164 106 +65 123 57 +24 82 41 +0 0 0 +205 172 98 +156 123 82 +106 82 57 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_red_plant.png b/graphics/decorations/decor_red_plant.png new file mode 100644 index 000000000..c12e656f7 Binary files /dev/null and b/graphics/decorations/decor_red_plant.png differ 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 000000000..22e435691 Binary files /dev/null and b/graphics/decorations/decor_red_tent.png differ 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 000000000..88a28df6d Binary files /dev/null and b/graphics/decorations/decor_regice_doll.png differ diff --git a/graphics/decorations/decor_regirock_doll.pal b/graphics/decorations/decor_regirock_doll.pal new file mode 100644 index 000000000..5c39edb2f --- /dev/null +++ b/graphics/decorations/decor_regirock_doll.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +0 0 0 +180 164 98 +123 115 49 +82 74 49 +0 0 0 +205 115 82 +148 65 82 +0 0 0 +189 74 24 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_regirock_doll.png b/graphics/decorations/decor_regirock_doll.png new file mode 100644 index 000000000..16372281c Binary files /dev/null and b/graphics/decorations/decor_regirock_doll.png differ diff --git a/graphics/decorations/decor_registeel_doll.pal b/graphics/decorations/decor_registeel_doll.pal new file mode 100644 index 000000000..328f35a4f --- /dev/null +++ b/graphics/decorations/decor_registeel_doll.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +238 238 238 +197 197 197 +164 164 164 +123 123 131 +82 82 90 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +172 82 65 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_registeel_doll.png b/graphics/decorations/decor_registeel_doll.png new file mode 100644 index 000000000..f06de37ab Binary files /dev/null and b/graphics/decorations/decor_registeel_doll.png differ diff --git a/graphics/decorations/decor_rhydon_doll.pal b/graphics/decorations/decor_rhydon_doll.pal new file mode 100644 index 000000000..432dae5a9 --- /dev/null +++ b/graphics/decorations/decor_rhydon_doll.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +222 222 222 +164 164 164 +189 189 189 +139 139 139 +106 106 106 +82 82 82 +230 197 115 +189 148 74 +131 98 74 +0 0 0 +0 0 0 +0 0 0 +246 246 246 +0 0 0 diff --git a/graphics/decorations/decor_rhydon_doll.png b/graphics/decorations/decor_rhydon_doll.png new file mode 100644 index 000000000..ac4714c35 Binary files /dev/null and b/graphics/decorations/decor_rhydon_doll.png differ diff --git a/graphics/decorations/decor_sand_ornament.pal b/graphics/decorations/decor_sand_ornament.pal new file mode 100644 index 000000000..e2fca6e31 --- /dev/null +++ b/graphics/decorations/decor_sand_ornament.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +213 197 156 +189 164 90 +148 123 49 +90 74 24 +131 106 32 +172 148 74 +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_sand_ornament.png b/graphics/decorations/decor_sand_ornament.png new file mode 100644 index 000000000..9eafc8644 Binary files /dev/null and b/graphics/decorations/decor_sand_ornament.png differ 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 000000000..8a5dbada5 Binary files /dev/null and b/graphics/decorations/decor_slide.png differ 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 000000000..6ff891c13 Binary files /dev/null and b/graphics/decorations/decor_snorlax_doll.png differ diff --git a/graphics/decorations/decor_solid_board.pal b/graphics/decorations/decor_solid_board.pal new file mode 100644 index 000000000..9995483b4 --- /dev/null +++ b/graphics/decorations/decor_solid_board.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +189 164 98 +156 131 65 +123 90 41 +106 90 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 +0 0 0 diff --git a/graphics/decorations/decor_solid_board.png b/graphics/decorations/decor_solid_board.png new file mode 100644 index 000000000..d0251d847 Binary files /dev/null and b/graphics/decorations/decor_solid_board.png differ diff --git a/graphics/decorations/decor_spikes_mat.pal b/graphics/decorations/decor_spikes_mat.pal new file mode 100644 index 000000000..ec37e1fe0 --- /dev/null +++ b/graphics/decorations/decor_spikes_mat.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 213 98 +49 49 49 +0 0 0 +148 197 148 +106 172 115 +82 148 90 +139 156 98 +222 205 139 +180 164 98 +205 189 131 +49 98 57 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_spikes_mat.png b/graphics/decorations/decor_spikes_mat.png new file mode 100644 index 000000000..67f023a0a Binary files /dev/null and b/graphics/decorations/decor_spikes_mat.png differ 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 000000000..86b1e4d1f Binary files /dev/null and b/graphics/decorations/decor_stand.png differ 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 000000000..d74cb97bb Binary files /dev/null and b/graphics/decorations/decor_surf_mat.png differ 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 000000000..1c5c56e33 Binary files /dev/null and b/graphics/decorations/decor_thunder_mat.png differ 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 000000000..e394ebbd4 Binary files /dev/null and b/graphics/decorations/decor_tire.png differ diff --git a/graphics/decorations/decor_tropical_plant.pal b/graphics/decorations/decor_tropical_plant.pal new file mode 100644 index 000000000..4057e7cb2 --- /dev/null +++ b/graphics/decorations/decor_tropical_plant.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +197 172 82 +164 139 49 +131 106 16 +82 65 16 +0 0 0 +0 0 0 +148 222 90 +106 180 49 +74 131 24 +32 90 24 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/decorations/decor_tropical_plant.png b/graphics/decorations/decor_tropical_plant.png new file mode 100644 index 000000000..12e43df47 Binary files /dev/null and b/graphics/decorations/decor_tropical_plant.png differ diff --git a/graphics/decorations/decor_venusaur_doll.pal b/graphics/decorations/decor_venusaur_doll.pal new file mode 100644 index 000000000..dcd11bea2 --- /dev/null +++ b/graphics/decorations/decor_venusaur_doll.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +197 255 222 +123 189 57 +82 148 24 +74 115 24 +41 82 32 +238 156 139 +213 98 90 +164 74 74 +115 57 65 +230 189 65 +131 98 24 +82 32 41 +246 246 246 diff --git a/graphics/decorations/decor_venusaur_doll.png b/graphics/decorations/decor_venusaur_doll.png new file mode 100644 index 000000000..57fbdd93a Binary files /dev/null and b/graphics/decorations/decor_venusaur_doll.png differ diff --git a/graphics/decorations/decor_wailmer_doll.pal b/graphics/decorations/decor_wailmer_doll.pal new file mode 100644 index 000000000..99347748e --- /dev/null +++ b/graphics/decorations/decor_wailmer_doll.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 197 98 +49 49 49 +0 0 0 +0 0 0 +106 148 172 +74 115 148 +57 98 123 +57 65 106 +230 180 106 +205 148 82 +180 139 57 +115 74 41 +0 0 0 +213 213 213 +246 246 246 +164 164 164 diff --git a/graphics/decorations/decor_wailmer_doll.png b/graphics/decorations/decor_wailmer_doll.png new file mode 100644 index 000000000..ceedfa6fb Binary files /dev/null and b/graphics/decorations/decor_wailmer_doll.png differ 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 000000000..cb865760c Binary files /dev/null and b/graphics/decorations/decor_yellow_brick.png differ 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 000000000..2dc8ed604 Binary files /dev/null and b/graphics/misc/decoration_unk_85a7358.png differ diff --git a/include/battle.h b/include/battle.h index 855ff464e..f731168dd 100644 --- a/include/battle.h +++ b/include/battle.h @@ -256,6 +256,25 @@ #define TYPE_MUL_NORMAL 10 #define TYPE_MUL_SUPER_EFFECTIVE 20 +#define BS_GET_TARGET 0 +#define BS_GET_ATTACKER 1 +#define BS_GET_EFFECT_BANK 2 +#define BS_ATTACKER_WITH_PARTNER 4 // for atk98_status_icon_update +#define BS_GET_ATTACKER_SIDE 8 // for atk1E_jumpifability +#define BS_GET_NOT_ATTACKER_SIDE 9 // for atk1E_jumpifability +#define BS_GET_SCRIPTING_BANK 10 +#define BS_GET_OPPONENT1 12 +#define BS_GET_PLAYER2 13 +#define BS_GET_OPPONENT2 14 + +// for battle script commands +#define CMP_EQUAL 0x0 +#define CMP_NOT_EQUAL 0x1 +#define CMP_GREATER_THAN 0x2 +#define CMP_LESS_THAN 0x3 +#define CMP_COMMON_BITS 0x4 +#define CMP_NO_COMMON_BITS 0x5 + struct TrainerMonNoItemDefaultMoves { u16 iv; @@ -263,6 +282,9 @@ struct TrainerMonNoItemDefaultMoves u16 species; }; +u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg); +u8 GetBankSide(u8 bank); + struct TrainerMonItemDefaultMoves { u16 iv; diff --git a/include/data/decoration/description.h b/include/data/decoration/description.h new file mode 100644 index 000000000..ba4c3dd54 --- /dev/null +++ b/include/data/decoration/description.h @@ -0,0 +1,581 @@ +// +// Created by scott on 10/21/2017. +// + +#ifndef GUARD_DATA_DECORATION_DESCRIPTION_H +#define GUARD_DATA_DECORATION_DESCRIPTION_H + +const u8 DecorDesc_SMALL_DESK[] = _( + "A small desk built\n" + "for one."); + +const u8 DecorDesc_POKEMON_DESK[] = _( + "A small desk built in\n" + "the shape of a POKé\n" + "BALL."); + +const u8 DecorDesc_HEAVY_DESK[] = _( + "A large desk made\n" + "of steel. Put some\n" + "decorations on it."); + +const u8 DecorDesc_RAGGED_DESK[] = _( + "A large desk made\n" + "of wood. Put some\n" + "decorations on it."); + +const u8 DecorDesc_COMFORT_DESK[] = _( + "A large desk made\n" + "of leaves. Put some\n" + "decorations on it."); + +const u8 DecorDesc_PRETTY_DESK[] = _( + "A huge desk made\n" + "of glass. Holds lots\n" + "of decorations."); + +const u8 DecorDesc_BRICK_DESK[] = _( + "A huge desk made\n" + "of brick. Holds lots\n" + "of decorations."); + +const u8 DecorDesc_CAMP_DESK[] = _( + "A huge desk made\n" + "of logs. Put lots of\n" + "decorations on it."); + +const u8 DecorDesc_HARD_DESK[] = _( + "A huge desk made\n" + "of rocks. Holds\n" + "many decorations."); + +const u8 DecorDesc_SMALL_CHAIR[] = _( + "A small chair made\n" + "for one."); + +const u8 DecorDesc_POKEMON_CHAIR[] = _( + "A small chair built\n" + "in the shape of a\n" + "POKé BALL."); + +const u8 DecorDesc_HEAVY_CHAIR[] = _( + "A small chair made\n" + "of steel."); + +const u8 DecorDesc_PRETTY_CHAIR[] = _( + "A small chair made\n" + "of glass."); + +const u8 DecorDesc_COMFORT_CHAIR[] = _( + "A small chair made\n" + "of leaves."); + +const u8 DecorDesc_RAGGED_CHAIR[] = _( + "A small chair made\n" + "of wood."); + +const u8 DecorDesc_BRICK_CHAIR[] = _( + "A small chair made\n" + "of brick."); + +const u8 DecorDesc_CAMP_CHAIR[] = _( + "A small chair made\n" + "of logs."); + +const u8 DecorDesc_HARD_CHAIR[] = _( + "A small chair made\n" + "of rock."); + +const u8 DecorDesc_RED_PLANT[] = _( + "A vivid red potted\n" + "plant."); + +const u8 DecorDesc_TROPICAL_PLANT[] = _( + "A flowering tropical\n" + "plant in a pot."); + +const u8 DecorDesc_PRETTY_FLOWERS[] = _( + "A pot of cute\n" + "flowers."); + +const u8 DecorDesc_COLORFUL_PLANT[] = _( + "A large pot with\n" + "many colorful\n" + "flowers."); + +const u8 DecorDesc_BIG_PLANT[] = _( + "A large, umbrella-\n" + "shaped plant in a\n" + "big pot."); + +const u8 DecorDesc_GORGEOUS_PLANT[] = _( + "A large, impressive\n" + "plant in a big pot."); + +const u8 DecorDesc_RED_BRICK[] = _( + "A red-colored brick.\n" + "Decorations can be\n" + "placed on top."); + +const u8 DecorDesc_YELLOW_BRICK[] = _( + "A yellow-colored\n" + "brick. Put some\n" + "decorations on top."); + +const u8 DecorDesc_BLUE_BRICK[] = _( + "A blue-colored\n" + "brick. Put some\n" + "decorations on top."); + +const u8 DecorDesc_RED_BALLOON[] = _( + "A red balloon filled\n" + "with water. Bursts\n" + "if stepped on."); + +const u8 DecorDesc_BLUE_BALLOON[] = _( + "A blue balloon filled\n" + "with water. Bursts\n" + "if stepped on."); + +const u8 DecorDesc_YELLOW_BALLOON[] = _( + "A yellow balloon\n" + "filled with water.\n" + "Pops if stepped on."); + +const u8 DecorDesc_RED_TENT[] = _( + "A large red tent.\n" + "You can hide inside\n" + "it."); + +const u8 DecorDesc_BLUE_TENT[] = _( + "A large blue tent.\n" + "You can hide inside\n" + "it."); + +const u8 DecorDesc_SOLID_BOARD[] = _( + "Place over a hole to\n" + "cross to the other\n" + "side."); + +const u8 DecorDesc_SLIDE[] = _( + "Use to slide down\n" + "from the platform."); + +const u8 DecorDesc_FENCE_LENGTH[] = _( + "A small fence that\n" + "blocks passage."); + +const u8 DecorDesc_FENCE_WIDTH[] = _( + "A small fence that\n" + "blocks passage."); + +const u8 DecorDesc_TIRE[] = _( + "An old large tire.\n" + "Decorations can be\n" + "placed on top."); + +const u8 DecorDesc_STAND[] = _( + "A large pedestal\n" + "with steps."); + +const u8 DecorDesc_MUD_BALL[] = _( + "A large ball of mud.\n" + "Crumbles if stepped\n" + "on."); + +const u8 DecorDesc_BREAKABLE_DOOR[] = _( + "A weird door that\n" + "people can walk\n" + "right through."); + +const u8 DecorDesc_SAND_ORNAMENT[] = _( + "An ornament made\n" + "of sand. Crumbles if\n" + "touched."); + +const u8 DecorDesc_SILVER_SHIELD[] = _( + "Awarded for 50\n" + "straight wins at\n" + "the BATTLE TOWER."); + +const u8 DecorDesc_GOLD_SHIELD[] = _( + "Awarded for 100\n" + "straight wins at\n" + "the BATTLE TOWER."); + +const u8 DecorDesc_GLASS_ORNAMENT[] = _( + "A glass replica of\n" + "a famous sculpture\n" + "at the ART MUSEUM."); + +const u8 DecorDesc_TV[] = _( + "A small, gray-\n" + "colored toy TV."); + +const u8 DecorDesc_ROUND_TV[] = _( + "A toy TV modeled\n" + "in the image of a\n" + "SEEDOT."); + +const u8 DecorDesc_CUTE_TV[] = _( + "A toy TV modeled\n" + "in the image of a\n" + "SKITTY."); + +const u8 DecorDesc_GLITTER_MAT[] = _( + "An odd mat that\n" + "glitters if stepped\n" + "on."); + +const u8 DecorDesc_JUMP_MAT[] = _( + "A trick mat that\n" + "jumps when it is\n" + "stepped on."); + +const u8 DecorDesc_SPIN_MAT[] = _( + "A trick mat that\n" + "spins around when\n" + "stepped on."); + +const u8 DecorDesc_C_LOW_NOTE_MAT[] = _( + "A mat that plays\n" + "a low C note when\n" + "stepped on."); + +const u8 DecorDesc_D_NOTE_MAT[] = _( + "A mat that plays\n" + "a D note when\n" + "stepped on."); + +const u8 DecorDesc_E_NOTE_MAT[] = _( + "A mat that plays\n" + "an E note when\n" + "stepped on."); + +const u8 DecorDesc_F_NOTE_MAT[] = _( + "A mat that plays\n" + "an F note when\n" + "stepped on."); + +const u8 DecorDesc_G_NOTE_MAT[] = _( + "A mat that plays\n" + "a G note when\n" + "stepped on."); + +const u8 DecorDesc_A_NOTE_MAT[] = _( + "A mat that plays\n" + "an A note when\n" + "stepped on."); + +const u8 DecorDesc_B_NOTE_MAT[] = _( + "A mat that plays\n" + "a B note when\n" + "stepped on."); + +const u8 DecorDesc_C_HIGH_NOTE_MAT[] = _( + "A mat that plays\n" + "a high C note when\n" + "stepped on."); + +const u8 DecorDesc_SURF_MAT[] = _( + "A mat designed with\n" + "a SURF image.\n" + "Put items on top."); + +const u8 DecorDesc_THUNDER_MAT[] = _( + "A mat designed with\n" + "a THUNDER image.\n" + "Put items on top."); + +const u8 DecorDesc_FIRE_BLAST_MAT[] = _( + "A mat designed with\n" + "a FIRE BLAST image.\n" + "Put items on top."); + +const u8 DecorDesc_POWDER_SNOW_MAT[] = _( + "A mat with a POWDER\n" + "SNOW image design.\n" + "Put items on top."); + +const u8 DecorDesc_ATTRACT_MAT[] = _( + "A mat designed with\n" + "an ATTRACT image.\n" + "Put items on top."); + +const u8 DecorDesc_FISSURE_MAT[] = _( + "A mat designed with\n" + "a FISSURE image.\n" + "Put items on top."); + +const u8 DecorDesc_SPIKES_MAT[] = _( + "A mat designed with\n" + "a SPIKES image.\n" + "Put items on top."); + +const u8 DecorDesc_BALL_POSTER[] = _( + "A small poster\n" + "printed with POKé\n" + "BALLS."); + +const u8 DecorDesc_GREEN_POSTER[] = _( + "A small poster with\n" + "a TREECKO print."); + +const u8 DecorDesc_RED_POSTER[] = _( + "A small poster with\n" + "a TORCHIC print."); + +const u8 DecorDesc_BLUE_POSTER[] = _( + "A small poster with\n" + "a MUDKIP print."); + +const u8 DecorDesc_CUTE_POSTER[] = _( + "A small poster with\n" + "an AZURILL print."); + +const u8 DecorDesc_PIKA_POSTER[] = _( + "A large poster with\n" + "a PIKACHU and\n" + "PICHU print."); + +const u8 DecorDesc_LONG_POSTER[] = _( + "A large poster with\n" + "a SEVIPER print."); + +const u8 DecorDesc_SEA_POSTER[] = _( + "A large poster with\n" + "a RELICANTH print."); + +const u8 DecorDesc_SKY_POSTER[] = _( + "A large poster with\n" + "a WINGULL print."); + +const u8 DecorDesc_KISS_POSTER[] = _( + "A large poster with\n" + "a SMOOCHUM print."); + +const u8 DecorDesc_PICHU_DOLL[] = _( + "A PICHU doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_PIKACHU_DOLL[] = _( + "A PIKACHU doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_MARILL_DOLL[] = _( + "A MARILL doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_TOGEPI_DOLL[] = _( + "A TOGEPI doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_CYNDAQUIL_DOLL[] = _( + "A CYNDAQUIL doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_CHIKORITA_DOLL[] = _( + "A CHIKORITA doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_TOTODILE_DOLL[] = _( + "A TOTODILE doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_JIGGLYPUFF_DOLL[] = _( + "A JIGGLYPUFF doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_MEOWTH_DOLL[] = _( + "A MEOWTH doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_CLEFAIRY_DOLL[] = _( + "A CLEFAIRY doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_DITTO_DOLL[] = _( + "A DITTO doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_SMOOCHUM_DOLL[] = _( + "A SMOOCHUM doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_TREECKO_DOLL[] = _( + "A TREECKO doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_TORCHIC_DOLL[] = _( + "A TORCHIC doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_MUDKIP_DOLL[] = _( + "A MUDKIP doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_DUSKULL_DOLL[] = _( + "A DUSKULL doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_WYNAUT_DOLL[] = _( + "A WYNAUT doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_BALTOY_DOLL[] = _( + "A BALTOY doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_KECLEON_DOLL[] = _( + "A KECLEON doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_AZURILL_DOLL[] = _( + "An AZURILL doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_SKITTY_DOLL[] = _( + "A SKITTY doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_SWABLU_DOLL[] = _( + "A SWABLU doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_GULPIN_DOLL[] = _( + "A GULPIN doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_LOTAD_DOLL[] = _( + "A LOTAD doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_SEEDOT_DOLL[] = _( + "A SEEDOT doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_PIKA_CUSHION[] = _( + "A PIKACHU cushion.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_ROUND_CUSHION[] = _( + "A MARILL cushion.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_KISS_CUSHION[] = _( + "A SMOOCHUM\n" + "cushion. Place it on\n" + "a mat or a desk."); + +const u8 DecorDesc_ZIGZAG_CUSHION[] = _( + "A ZIGZAGOON\n" + "cushion. Place it on\n" + "a mat or a desk."); + +const u8 DecorDesc_SPIN_CUSHION[] = _( + "A SPINDA cushion.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_DIAMOND_CUSHION[] = _( + "A SABLEYE cushion.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_BALL_CUSHION[] = _( + "A BALL cushion.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_GRASS_CUSHION[] = _( + "A grass-mark\n" + "cushion. Place it on\n" + "a mat or a desk."); + +const u8 DecorDesc_FIRE_CUSHION[] = _( + "A fire-mark\n" + "cushion. Place it on\n" + "a mat or a desk."); + +const u8 DecorDesc_WATER_CUSHION[] = _( + "A water-mark\n" + "cushion. Place it on\n" + "a mat or a desk."); + +const u8 DecorDesc_SNORLAX_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_RHYDON_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_LAPRAS_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_VENUSAUR_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_CHARIZARD_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_BLASTOISE_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_WAILMER_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_REGIROCK_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_REGICE_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_REGISTEEL_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); +#endif //GUARD_DATA_DECORATION_DESCRIPTION_H diff --git a/include/data/decoration/header.h b/include/data/decoration/header.h new file mode 100644 index 000000000..64bed1c7e --- /dev/null +++ b/include/data/decoration/header.h @@ -0,0 +1,1100 @@ +// +// Created by scott on 10/21/2017. +// + +#ifndef GUARD_DATA_DECORATION_HEADER_H +#define GUARD_DATA_DECORATION_HEADER_H + +const struct Decoration gDecorations[] = { + { + DECOR_NONE, + _("SMALL DESK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_1x1, + DECORCAT_DESK, + 0, + DecorDesc_SMALL_DESK, + DecorGfx_SMALL_DESK + }, { + DECOR_SMALL_DESK, + _("SMALL DESK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_1x1, + DECORCAT_DESK, + 3000, + DecorDesc_SMALL_DESK, + DecorGfx_SMALL_DESK + }, { + DECOR_POKEMON_DESK, + _("POKéMON DESK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_1x1, + DECORCAT_DESK, + 3000, + DecorDesc_POKEMON_DESK, + DecorGfx_POKEMON_DESK + }, { + DECOR_HEAVY_DESK, + _("HEAVY DESK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_3x2, + DECORCAT_DESK, + 6000, + DecorDesc_HEAVY_DESK, + DecorGfx_HEAVY_DESK + }, { + DECOR_RAGGED_DESK, + _("RAGGED DESK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_3x2, + DECORCAT_DESK, + 6000, + DecorDesc_RAGGED_DESK, + DecorGfx_RAGGED_DESK + }, { + DECOR_COMFORT_DESK, + _("COMFORT DESK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_3x2, + DECORCAT_DESK, + 6000, + DecorDesc_COMFORT_DESK, + DecorGfx_COMFORT_DESK + }, { + DECOR_PRETTY_DESK, + _("PRETTY DESK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_3x3, + DECORCAT_DESK, + 9000, + DecorDesc_PRETTY_DESK, + DecorGfx_PRETTY_DESK + }, { + DECOR_BRICK_DESK, + _("BRICK DESK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_3x3, + DECORCAT_DESK, + 9000, + DecorDesc_BRICK_DESK, + DecorGfx_BRICK_DESK + }, { + DECOR_CAMP_DESK, + _("CAMP DESK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_3x3, + DECORCAT_DESK, + 9000, + DecorDesc_CAMP_DESK, + DecorGfx_CAMP_DESK + }, { + DECOR_HARD_DESK, + _("HARD DESK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_3x3, + DECORCAT_DESK, + 9000, + DecorDesc_HARD_DESK, + DecorGfx_HARD_DESK + }, { + DECOR_SMALL_CHAIR, + _("SMALL CHAIR"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_CHAIR, + 2000, + DecorDesc_SMALL_CHAIR, + DecorGfx_SMALL_CHAIR + }, { + DECOR_POKEMON_CHAIR, + _("POKéMON CHAIR"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_CHAIR, + 2000, + DecorDesc_POKEMON_CHAIR, + DecorGfx_POKEMON_CHAIR + }, { + DECOR_HEAVY_CHAIR, + _("HEAVY CHAIR"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_CHAIR, + 2000, + DecorDesc_HEAVY_CHAIR, + DecorGfx_HEAVY_CHAIR + }, { + DECOR_PRETTY_CHAIR, + _("PRETTY CHAIR"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_CHAIR, + 2000, + DecorDesc_PRETTY_CHAIR, + DecorGfx_PRETTY_CHAIR + }, { + DECOR_COMFORT_CHAIR, + _("COMFORT CHAIR"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_CHAIR, + 2000, + DecorDesc_COMFORT_CHAIR, + DecorGfx_COMFORT_CHAIR + }, { + DECOR_RAGGED_CHAIR, + _("RAGGED CHAIR"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_CHAIR, + 2000, + DecorDesc_RAGGED_CHAIR, + DecorGfx_RAGGED_CHAIR + }, { + DECOR_BRICK_CHAIR, + _("BRICK CHAIR"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_CHAIR, + 2000, + DecorDesc_BRICK_CHAIR, + DecorGfx_BRICK_CHAIR + }, { + DECOR_CAMP_CHAIR, + _("CAMP CHAIR"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_CHAIR, + 2000, + DecorDesc_CAMP_CHAIR, + DecorGfx_CAMP_CHAIR + }, { + DECOR_HARD_CHAIR, + _("HARD CHAIR"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_CHAIR, + 2000, + DecorDesc_HARD_CHAIR, + DecorGfx_HARD_CHAIR + }, { + DECOR_RED_PLANT, + _("RED PLANT"), + DECORPERM_BEHIND_FLOOR, + DECORSHAPE_1x2, + DECORCAT_PLANT, + 3000, + DecorDesc_RED_PLANT, + DecorGfx_RED_PLANT + }, { + DECOR_TROPICAL_PLANT, + _("TROPICAL PLANT"), + DECORPERM_BEHIND_FLOOR, + DECORSHAPE_1x2, + DECORCAT_PLANT, + 3000, + DecorDesc_TROPICAL_PLANT, + DecorGfx_TROPICAL_PLANT + }, { + DECOR_PRETTY_FLOWERS, + _("PRETTY FLOWERS"), + DECORPERM_BEHIND_FLOOR, + DECORSHAPE_1x2, + DECORCAT_PLANT, + 3000, + DecorDesc_PRETTY_FLOWERS, + DecorGfx_PRETTY_FLOWERS + }, { + DECOR_COLORFUL_PLANT, + _("COLORFUL PLANT"), + DECORPERM_BEHIND_FLOOR, + DECORSHAPE_2x2, + DECORCAT_PLANT, + 5000, + DecorDesc_COLORFUL_PLANT, + DecorGfx_COLORFUL_PLANT + }, { + DECOR_BIG_PLANT, + _("BIG PLANT"), + DECORPERM_BEHIND_FLOOR, + DECORSHAPE_2x2, + DECORCAT_PLANT, + 5000, + DecorDesc_BIG_PLANT, + DecorGfx_BIG_PLANT + }, { + DECOR_GORGEOUS_PLANT, + _("GORGEOUS PLANT"), + DECORPERM_BEHIND_FLOOR, + DECORSHAPE_2x2, + DECORCAT_PLANT, + 5000, + DecorDesc_GORGEOUS_PLANT, + DecorGfx_GORGEOUS_PLANT + }, { + DECOR_RED_BRICK, + _("RED BRICK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_1x2, + DECORCAT_ORNAMENT, + 500, + DecorDesc_RED_BRICK, + DecorGfx_RED_BRICK + }, { + DECOR_YELLOW_BRICK, + _("YELLOW BRICK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_1x2, + DECORCAT_ORNAMENT, + 500, + DecorDesc_YELLOW_BRICK, + DecorGfx_YELLOW_BRICK + }, { + DECOR_BLUE_BRICK, + _("BLUE BRICK"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_1x2, + DECORCAT_ORNAMENT, + 500, + DecorDesc_BLUE_BRICK, + DecorGfx_BLUE_BRICK + }, { + DECOR_RED_BALLOON, + _("RED BALLOON"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_ORNAMENT, + 500, + DecorDesc_RED_BALLOON, + DecorGfx_RED_BALLOON + }, { + DECOR_BLUE_BALLOON, + _("BLUE BALLOON"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_ORNAMENT, + 500, + DecorDesc_BLUE_BALLOON, + DecorGfx_BLUE_BALLOON + }, { + DECOR_YELLOW_BALLOON, + _("YELLOW BALLOON"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_ORNAMENT, + 500, + DecorDesc_YELLOW_BALLOON, + DecorGfx_YELLOW_BALLOON + }, { + DECOR_RED_TENT, + _("RED TENT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_3x3, + DECORCAT_ORNAMENT, + 10000, + DecorDesc_RED_TENT, + DecorGfx_RED_TENT + }, { + DECOR_BLUE_TENT, + _("BLUE TENT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_3x3, + DECORCAT_ORNAMENT, + 10000, + DecorDesc_BLUE_TENT, + DecorGfx_BLUE_TENT + }, { + DECOR_SOLID_BOARD, + _("SOLID BOARD"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x2, + DECORCAT_ORNAMENT, + 3000, + DecorDesc_SOLID_BOARD, + DecorGfx_SOLID_BOARD + }, { + DECOR_SLIDE, + _("SLIDE"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_2x4, + DECORCAT_ORNAMENT, + 8000, + DecorDesc_SLIDE, + DecorGfx_SLIDE + }, { + DECOR_FENCE_LENGTH, + _("FENCE LENGTH"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_1x1, + DECORCAT_ORNAMENT, + 500, + DecorDesc_FENCE_LENGTH, + DecorGfx_FENCE_LENGTH + }, { + DECOR_FENCE_WIDTH, + _("FENCE WIDTH"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_1x1, + DECORCAT_ORNAMENT, + 500, + DecorDesc_FENCE_WIDTH, + DecorGfx_FENCE_WIDTH + }, { + DECOR_TIRE, + _("TIRE"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_2x2, + DECORCAT_ORNAMENT, + 800, + DecorDesc_TIRE, + DecorGfx_TIRE + }, { + DECOR_STAND, + _("STAND"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_4x2, + DECORCAT_ORNAMENT, + 7000, + DecorDesc_STAND, + DecorGfx_STAND + }, { + DECOR_MUD_BALL, + _("MUD BALL"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_ORNAMENT, + 200, + DecorDesc_MUD_BALL, + DecorGfx_MUD_BALL + }, { + DECOR_BREAKABLE_DOOR, + _("BREAKABLE DOOR"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x2, + DECORCAT_ORNAMENT, + 3000, + DecorDesc_BREAKABLE_DOOR, + DecorGfx_BREAKABLE_DOOR + }, { + DECOR_SAND_ORNAMENT, + _("SAND ORNAMENT"), + DECORPERM_BEHIND_FLOOR, + DECORSHAPE_1x2, + DECORCAT_ORNAMENT, + 3000, + DecorDesc_SAND_ORNAMENT, + DecorGfx_SAND_ORNAMENT + }, { + DECOR_SILVER_SHIELD, + _("SILVER SHIELD"), + DECORPERM_BEHIND_FLOOR, + DECORSHAPE_1x2, + DECORCAT_ORNAMENT, + 0, + DecorDesc_SILVER_SHIELD, + DecorGfx_SILVER_SHIELD + }, { + DECOR_GOLD_SHIELD, + _("GOLD SHIELD"), + DECORPERM_BEHIND_FLOOR, + DECORSHAPE_1x2, + DECORCAT_ORNAMENT, + 0, + DecorDesc_GOLD_SHIELD, + DecorGfx_GOLD_SHIELD + }, { + DECOR_GLASS_ORNAMENT, + _("GLASS ORNAMENT"), + DECORPERM_BEHIND_FLOOR, + DECORSHAPE_1x2, + DECORCAT_ORNAMENT, + 0, + DecorDesc_GLASS_ORNAMENT, + DecorGfx_GLASS_ORNAMENT + }, { + DECOR_TV, + _("TV"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_1x1, + DECORCAT_ORNAMENT, + 3000, + DecorDesc_TV, + DecorGfx_TV + }, { + DECOR_ROUND_TV, + _("ROUND TV"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_1x1, + DECORCAT_ORNAMENT, + 4000, + DecorDesc_ROUND_TV, + DecorGfx_ROUND_TV + }, { + DECOR_CUTE_TV, + _("CUTE TV"), + DECORPERM_SOLID_FLOOR, + DECORSHAPE_1x1, + DECORCAT_ORNAMENT, + 4000, + DecorDesc_CUTE_TV, + DecorGfx_CUTE_TV + }, { + DECOR_GLITTER_MAT, + _("GLITTER MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_MAT, + 2000, + DecorDesc_GLITTER_MAT, + DecorGfx_GLITTER_MAT + }, { + DECOR_JUMP_MAT, + _("JUMP MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_MAT, + 2000, + DecorDesc_JUMP_MAT, + DecorGfx_JUMP_MAT + }, { + DECOR_SPIN_MAT, + _("SPIN MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_MAT, + 2000, + DecorDesc_SPIN_MAT, + DecorGfx_SPIN_MAT + }, { + DECOR_C_LOW_NOTE_MAT, + _("C Low NOTE MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_MAT, + 500, + DecorDesc_C_LOW_NOTE_MAT, + DecorGfx_C_LOW_NOTE_MAT + }, { + DECOR_D_NOTE_MAT, + _("D NOTE MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_MAT, + 500, + DecorDesc_D_NOTE_MAT, + DecorGfx_D_NOTE_MAT + }, { + DECOR_E_NOTE_MAT, + _("E NOTE MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_MAT, + 500, + DecorDesc_E_NOTE_MAT, + DecorGfx_E_NOTE_MAT + }, { + DECOR_F_NOTE_MAT, + _("F NOTE MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_MAT, + 500, + DecorDesc_F_NOTE_MAT, + DecorGfx_F_NOTE_MAT + }, { + DECOR_G_NOTE_MAT, + _("G NOTE MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_MAT, + 500, + DecorDesc_G_NOTE_MAT, + DecorGfx_G_NOTE_MAT + }, { + DECOR_A_NOTE_MAT, + _("A NOTE MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_MAT, + 500, + DecorDesc_A_NOTE_MAT, + DecorGfx_A_NOTE_MAT + }, { + DECOR_B_NOTE_MAT, + _("B NOTE MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_MAT, + 500, + DecorDesc_B_NOTE_MAT, + DecorGfx_B_NOTE_MAT + }, { + DECOR_C_HIGH_NOTE_MAT, + _("C High NOTE MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_1x1, + DECORCAT_MAT, + 500, + DecorDesc_C_HIGH_NOTE_MAT, + DecorGfx_C_HIGH_NOTE_MAT + }, { + DECOR_SURF_MAT, + _("SURF MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_3x3, + DECORCAT_MAT, + 4000, + DecorDesc_SURF_MAT, + DecorGfx_SURF_MAT + }, { + DECOR_THUNDER_MAT, + _("THUNDER MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_3x3, + DECORCAT_MAT, + 4000, + DecorDesc_THUNDER_MAT, + DecorGfx_THUNDER_MAT + }, { + DECOR_FIRE_BLAST_MAT, + _("FIRE BLAST MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_3x3, + DECORCAT_MAT, + 4000, + DecorDesc_FIRE_BLAST_MAT, + DecorGfx_FIRE_BLAST_MAT + }, { + DECOR_POWDER_SNOW_MAT, + _("POWDER SNOW MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_3x3, + DECORCAT_MAT, + 4000, + DecorDesc_POWDER_SNOW_MAT, + DecorGfx_POWDER_SNOW_MAT + }, { + DECOR_ATTRACT_MAT, + _("ATTRACT MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_3x3, + DECORCAT_MAT, + 4000, + DecorDesc_ATTRACT_MAT, + DecorGfx_ATTRACT_MAT + }, { + DECOR_FISSURE_MAT, + _("FISSURE MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_3x3, + DECORCAT_MAT, + 4000, + DecorDesc_FISSURE_MAT, + DecorGfx_FISSURE_MAT + }, { + DECOR_SPIKES_MAT, + _("SPIKES MAT"), + DECORPERM_PASS_FLOOR, + DECORSHAPE_3x3, + DECORCAT_MAT, + 4000, + DecorDesc_SPIKES_MAT, + DecorGfx_SPIKES_MAT + }, { + DECOR_BALL_POSTER, + _("BALL POSTER"), + DECORPERM_NA_WALL, + DECORSHAPE_1x1, + DECORCAT_POSTER, + 1000, + DecorDesc_BALL_POSTER, + DecorGfx_BALL_POSTER + }, { + DECOR_GREEN_POSTER, + _("GREEN POSTER"), + DECORPERM_NA_WALL, + DECORSHAPE_1x1, + DECORCAT_POSTER, + 1000, + DecorDesc_GREEN_POSTER, + DecorGfx_GREEN_POSTER + }, { + DECOR_RED_POSTER, + _("RED POSTER"), + DECORPERM_NA_WALL, + DECORSHAPE_1x1, + DECORCAT_POSTER, + 1000, + DecorDesc_RED_POSTER, + DecorGfx_RED_POSTER + }, { + DECOR_BLUE_POSTER, + _("BLUE POSTER"), + DECORPERM_NA_WALL, + DECORSHAPE_1x1, + DECORCAT_POSTER, + 1000, + DecorDesc_BLUE_POSTER, + DecorGfx_BLUE_POSTER + }, { + DECOR_CUTE_POSTER, + _("CUTE POSTER"), + DECORPERM_NA_WALL, + DECORSHAPE_1x1, + DECORCAT_POSTER, + 1000, + DecorDesc_CUTE_POSTER, + DecorGfx_CUTE_POSTER + }, { + DECOR_PIKA_POSTER, + _("PIKA POSTER"), + DECORPERM_NA_WALL, + DECORSHAPE_2x1, + DECORCAT_POSTER, + 1500, + DecorDesc_PIKA_POSTER, + DecorGfx_PIKA_POSTER + }, { + DECOR_LONG_POSTER, + _("LONG POSTER"), + DECORPERM_NA_WALL, + DECORSHAPE_2x1, + DECORCAT_POSTER, + 1500, + DecorDesc_LONG_POSTER, + DecorGfx_LONG_POSTER + }, { + DECOR_SEA_POSTER, + _("SEA POSTER"), + DECORPERM_NA_WALL, + DECORSHAPE_2x1, + DECORCAT_POSTER, + 1500, + DecorDesc_SEA_POSTER, + DecorGfx_SEA_POSTER + }, { + DECOR_SKY_POSTER, + _("SKY POSTER"), + DECORPERM_NA_WALL, + DECORSHAPE_2x1, + DECORCAT_POSTER, + 1500, + DecorDesc_SKY_POSTER, + DecorGfx_SKY_POSTER + }, { + DECOR_KISS_POSTER, + _("KISS POSTER"), + DECORPERM_NA_WALL, + DECORSHAPE_2x1, + DECORCAT_POSTER, + 1500, + DecorDesc_KISS_POSTER, + DecorGfx_KISS_POSTER + }, { + DECOR_PICHU_DOLL, + _("PICHU DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_PICHU_DOLL, + DecorGfx_PICHU_DOLL + }, { + DECOR_PIKACHU_DOLL, + _("PIKACHU DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_PIKACHU_DOLL, + DecorGfx_PIKACHU_DOLL + }, { + DECOR_MARILL_DOLL, + _("MARILL DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_MARILL_DOLL, + DecorGfx_MARILL_DOLL + }, { + DECOR_TOGEPI_DOLL, + _("TOGEPI DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_TOGEPI_DOLL, + DecorGfx_TOGEPI_DOLL + }, { + DECOR_CYNDAQUIL_DOLL, + _("CYNDAQUIL DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_CYNDAQUIL_DOLL, + DecorGfx_CYNDAQUIL_DOLL + }, { + DECOR_CHIKORITA_DOLL, + _("CHIKORITA DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_CHIKORITA_DOLL, + DecorGfx_CHIKORITA_DOLL + }, { + DECOR_TOTODILE_DOLL, + _("TOTODILE DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_TOTODILE_DOLL, + DecorGfx_TOTODILE_DOLL + }, { + DECOR_JIGGLYPUFF_DOLL, + _("JIGGLYPUFF DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_JIGGLYPUFF_DOLL, + DecorGfx_JIGGLYPUFF_DOLL + }, { + DECOR_MEOWTH_DOLL, + _("MEOWTH DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_MEOWTH_DOLL, + DecorGfx_MEOWTH_DOLL + }, { + DECOR_CLEFAIRY_DOLL, + _("CLEFAIRY DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_CLEFAIRY_DOLL, + DecorGfx_CLEFAIRY_DOLL + }, { + DECOR_DITTO_DOLL, + _("DITTO DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_DITTO_DOLL, + DecorGfx_DITTO_DOLL + }, { + DECOR_SMOOCHUM_DOLL, + _("SMOOCHUM DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_SMOOCHUM_DOLL, + DecorGfx_SMOOCHUM_DOLL + }, { + DECOR_TREECKO_DOLL, + _("TREECKO DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_TREECKO_DOLL, + DecorGfx_TREECKO_DOLL + }, { + DECOR_TORCHIC_DOLL, + _("TORCHIC DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_TORCHIC_DOLL, + DecorGfx_TORCHIC_DOLL + }, { + DECOR_MUDKIP_DOLL, + _("MUDKIP DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_MUDKIP_DOLL, + DecorGfx_MUDKIP_DOLL + }, { + DECOR_DUSKULL_DOLL, + _("DUSKULL DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_DUSKULL_DOLL, + DecorGfx_DUSKULL_DOLL + }, { + DECOR_WYNAUT_DOLL, + _("WYNAUT DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_WYNAUT_DOLL, + DecorGfx_WYNAUT_DOLL + }, { + DECOR_BALTOY_DOLL, + _("BALTOY DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_BALTOY_DOLL, + DecorGfx_BALTOY_DOLL + }, { + DECOR_KECLEON_DOLL, + _("KECLEON DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_KECLEON_DOLL, + DecorGfx_KECLEON_DOLL + }, { + DECOR_AZURILL_DOLL, + _("AZURILL DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_AZURILL_DOLL, + DecorGfx_AZURILL_DOLL + }, { + DECOR_SKITTY_DOLL, + _("SKITTY DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_SKITTY_DOLL, + DecorGfx_SKITTY_DOLL + }, { + DECOR_SWABLU_DOLL, + _("SWABLU DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_SWABLU_DOLL, + DecorGfx_SWABLU_DOLL + }, { + DECOR_GULPIN_DOLL, + _("GULPIN DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_GULPIN_DOLL, + DecorGfx_GULPIN_DOLL + }, { + DECOR_LOTAD_DOLL, + _("LOTAD DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_LOTAD_DOLL, + DecorGfx_LOTAD_DOLL + }, { + DECOR_SEEDOT_DOLL, + _("SEEDOT DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_DOLL, + 3000, + DecorDesc_SEEDOT_DOLL, + DecorGfx_SEEDOT_DOLL + }, { + DECOR_PIKA_CUSHION, + _("PIKA CUSHION"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_CUSHION, + 2000, + DecorDesc_PIKA_CUSHION, + DecorGfx_PIKA_CUSHION + }, { + DECOR_ROUND_CUSHION, + _("ROUND CUSHION"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_CUSHION, + 2000, + DecorDesc_ROUND_CUSHION, + DecorGfx_ROUND_CUSHION + }, { + DECOR_KISS_CUSHION, + _("KISS CUSHION"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_CUSHION, + 2000, + DecorDesc_KISS_CUSHION, + DecorGfx_KISS_CUSHION + }, { + DECOR_ZIGZAG_CUSHION, + _("ZIGZAG CUSHION"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_CUSHION, + 2000, + DecorDesc_ZIGZAG_CUSHION, + DecorGfx_ZIGZAG_CUSHION + }, { + DECOR_SPIN_CUSHION, + _("SPIN CUSHION"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_CUSHION, + 2000, + DecorDesc_SPIN_CUSHION, + DecorGfx_SPIN_CUSHION + }, { + DECOR_DIAMOND_CUSHION, + _("DIAMOND CUSHION"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_CUSHION, + 2000, + DecorDesc_DIAMOND_CUSHION, + DecorGfx_DIAMOND_CUSHION + }, { + DECOR_BALL_CUSHION, + _("BALL CUSHION"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_CUSHION, + 2000, + DecorDesc_BALL_CUSHION, + DecorGfx_BALL_CUSHION + }, { + DECOR_GRASS_CUSHION, + _("GRASS CUSHION"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_CUSHION, + 2000, + DecorDesc_GRASS_CUSHION, + DecorGfx_GRASS_CUSHION + }, { + DECOR_FIRE_CUSHION, + _("FIRE CUSHION"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_CUSHION, + 2000, + DecorDesc_FIRE_CUSHION, + DecorGfx_FIRE_CUSHION + }, { + DECOR_WATER_CUSHION, + _("WATER CUSHION"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x1, + DECORCAT_CUSHION, + 2000, + DecorDesc_WATER_CUSHION, + DecorGfx_WATER_CUSHION + }, { + DECOR_SNORLAX_DOLL, + _("SNORLAX DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x2, + DECORCAT_DOLL, + 10000, + DecorDesc_SNORLAX_DOLL, + DecorGfx_SNORLAX_DOLL + }, { + DECOR_RHYDON_DOLL, + _("RHYDON DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x2, + DECORCAT_DOLL, + 10000, + DecorDesc_RHYDON_DOLL, + DecorGfx_RHYDON_DOLL + }, { + DECOR_LAPRAS_DOLL, + _("LAPRAS DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x2, + DECORCAT_DOLL, + 10000, + DecorDesc_LAPRAS_DOLL, + DecorGfx_LAPRAS_DOLL + }, { + DECOR_VENUSAUR_DOLL, + _("VENUSAUR DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x2, + DECORCAT_DOLL, + 10000, + DecorDesc_VENUSAUR_DOLL, + DecorGfx_VENUSAUR_DOLL + }, { + DECOR_CHARIZARD_DOLL, + _("CHARIZARD DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x2, + DECORCAT_DOLL, + 10000, + DecorDesc_CHARIZARD_DOLL, + DecorGfx_CHARIZARD_DOLL + }, { + DECOR_BLASTOISE_DOLL, + _("BLASTOISE DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x2, + DECORCAT_DOLL, + 10000, + DecorDesc_BLASTOISE_DOLL, + DecorGfx_BLASTOISE_DOLL + }, { + DECOR_WAILMER_DOLL, + _("WAILMER DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x2, + DECORCAT_DOLL, + 10000, + DecorDesc_WAILMER_DOLL, + DecorGfx_WAILMER_DOLL + }, { + DECOR_REGIROCK_DOLL, + _("REGIROCK DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x2, + DECORCAT_DOLL, + 10000, + DecorDesc_REGIROCK_DOLL, + DecorGfx_REGIROCK_DOLL + }, { + DECOR_REGICE_DOLL, + _("REGICE DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x2, + DECORCAT_DOLL, + 10000, + DecorDesc_REGICE_DOLL, + DecorGfx_REGICE_DOLL + }, { + DECOR_REGISTEEL_DOLL, + _("REGISTEEL DOLL"), + DECORPERM_SOLID_MAT, + DECORSHAPE_1x2, + DECORCAT_DOLL, + 10000, + DecorDesc_REGISTEEL_DOLL, + DecorGfx_REGISTEEL_DOLL} +}; + +#endif //GUARD_DATA_DECORATION_HEADER_H diff --git a/include/data/decoration/icon.h b/include/data/decoration/icon.h new file mode 100644 index 000000000..1f11bc19f --- /dev/null +++ b/include/data/decoration/icon.h @@ -0,0 +1,132 @@ +// +// Created by scott on 10/21/2017. +// + +#ifndef GUARD_ICON_H +#define GUARD_ICON_H + +const u8 *const gUnknown_085A6BE8[][2] = { + {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, + {NULL, NULL}, + {NULL, NULL}, + {gUnknown_08DB7AA0, gUnknown_08DB7B34}, + {gUnknown_08DB7B5C, gUnknown_08DB7BEC}, + {gUnknown_08DB7C08, gUnknown_08DB7CE8}, + {gUnknown_08DB7D08, gUnknown_08DB7DCC}, + {gUnknown_08DB7DF4, gUnknown_08DB7EA0}, + {gUnknown_08DB7EC4, gUnknown_08DB7F60}, + {gUnknown_08DB7F7C, gUnknown_08DB8070}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {gUnknown_08DB808C, gUnknown_08DB8138}, + {gUnknown_08DB8160, gUnknown_08DB8218}, + {gUnknown_08DB823C, gUnknown_08DB8300}, + {gUnknown_08DB8328, gUnknown_08DB8430}, + {gUnknown_08DB8458, gUnknown_08DB8528}, + {gUnknown_08DB854C, gUnknown_08DB862C}, + {gUnknown_08DB8654, gUnknown_08DB86C4}, + {gUnknown_08DB86E0, gUnknown_08DB8750}, + {gUnknown_08DB876C, gUnknown_08DB87DC}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {gUnknown_08DB87F8, gUnknown_08DB88D8}, + {gUnknown_08DB8900, gUnknown_08DB89E0}, + {gUnknown_08DB8A08, gUnknown_08DB8A68}, + {gUnknown_08DB8A84, gUnknown_08DB8B40}, + {NULL, NULL}, + {NULL, NULL}, + {gUnknown_08DB8B68, gUnknown_08DB8C40}, + {gUnknown_08DB8C5C, gUnknown_08DB8CF4}, + {NULL, NULL}, + {gUnknown_08DB8D18, gUnknown_08DB8DB0}, + {gUnknown_08DB8DD4, gUnknown_08DB8E80}, + {NULL, NULL}, + {NULL, NULL}, + {gUnknown_08DB8EA0, gUnknown_08DB8F58}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {gUnknown_08DB8F7C, gUnknown_08DB9038}, + {gUnknown_08DB9058, gUnknown_08DB9130}, + {gUnknown_08DB9154, gUnknown_08DB9218}, + {gUnknown_08DB9234, gUnknown_08DB92FC}, + {gUnknown_08DB931C, gUnknown_08DB93E8}, + {gUnknown_08DB940C, gUnknown_08DB94CC}, + {gUnknown_08DB94E8, gUnknown_08DB95AC}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {gUnknown_08DB95D0, gUnknown_08DB96C4}, + {gUnknown_08DB96EC, gUnknown_08DB97F4}, + {gUnknown_08DB981C, gUnknown_08DB9908}, + {gUnknown_08DB9930, gUnknown_08DB9A54}, + {gUnknown_08DB9A7C, gUnknown_08DB9B7C}, + {gUnknown_08DB9BA4, gUnknown_08DB9CB0}, + {gUnknown_08DB9CD8, gUnknown_08DB9DAC}, + {gUnknown_08DB9F08, gUnknown_08DB9FFC}, + {gUnknown_08DB9DD4, gUnknown_08DB9EE4}, + {gUnknown_08DBA020, gUnknown_08DBA12C} +}; + +#endif //GUARD_ICON_H diff --git a/include/data/decoration/tilemaps.h b/include/data/decoration/tilemaps.h new file mode 100644 index 000000000..1cca7ae0b --- /dev/null +++ b/include/data/decoration/tilemaps.h @@ -0,0 +1,239 @@ +// +// Created by scott on 10/21/2017. +// + +#ifndef GUARD_TILEMAPS_H +#define GUARD_TILEMAPS_H + +const u8 Unknown_085A6FB0[] = { + 0x00, 0x01, 0x02, 0x03 +}; + +const u8 Unknown_085A6FB4[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d +}; + +const u8 Unknown_085A6FC0[] = { + 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f +}; + +const u8 Unknown_085A6FD0[] = { + 0x00, 0x01, 0x04, 0x05, + 0x08, 0x09, 0x0c, 0x0d, + 0x10, 0x11, 0x14, 0x15 +}; + +const u8 Unknown_085A6FDC[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 +}; + +const u8 Unknown_085A6FE4[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f +}; + +const u8 Unknown_085A7004[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d +}; + +const u8 Unknown_085A7028[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d +}; + +const u8 Unknown_085A7040[] = { + 0x00, 0x00, 0x00, 0x00 +}; + +const u8 Unknown_085A7044[] = { + 0x00, 0x00, 0x01, 0x01, + 0x00, 0x00, 0x01, 0x01 +}; + +const u8 Unknown_085A704C[] = { + 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, + 0x00, 0x00, 0x01, 0x01, 0x02, 0x02 +}; + +const u8 Unknown_085A7058[] = { + 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, + 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, + 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 0x07, 0x07 +}; + +const u8 Unknown_085A7078[] = { + 0x00, 0x00, 0x01, 0x01, + 0x00, 0x00, 0x01, 0x01, + 0x02, 0x02, 0x03, 0x03, + 0x02, 0x02, 0x03, 0x03 +}; + +const u8 Unknown_085A7088[] = { + 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, 0x01 +}; + +const u8 Unknown_085A7090[] = { + 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, 0x01, + 0x02, 0x02, 0x02, 0x02 +}; + +const u8 Unknown_085A709C[] = { + 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, + 0x02, 0x02, 0x03, 0x03, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x04, 0x05, 0x05, 0x04, 0x04, 0x05, 0x05, + 0x06, 0x06, 0x07, 0x07, 0x06, 0x06, 0x07, 0x07 +}; + +const u8 Unknown_085A70BC[] = { + 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, + 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, + 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, + 0x06, 0x06, 0x07, 0x07, 0x08, 0x08, + 0x06, 0x06, 0x07, 0x07, 0x08, 0x08 +}; + +const u8 Unknown_085A70E0[] = { + 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, + 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, + 0x03, 0x03, 0x04, 0x04, 0x05, 0x05 +}; + +const u8 Unknown_085A70F8[] = { + 0x04, 0x05, 0x06, 0x07 +}; + +const u8 Unknown_085A70FC[] = { + 0x04, 0x05, 0x04, 0x05, + 0x06, 0x07, 0x06, 0x07 +}; + +const u8 Unknown_085A7104[] = { + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07 +}; + +const u8 Unknown_085A7110[] = { + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07 +}; + +const u8 Unknown_085A7130[] = { + 0x04, 0x05, 0x04, 0x05, + 0x06, 0x07, 0x06, 0x07, + 0x04, 0x05, 0x04, 0x05, + 0x06, 0x07, 0x06, 0x07 +}; + +const u8 Unknown_085A7140[] = { + 0x04, 0x05, 0x06, 0x07, + 0x04, 0x05, 0x06, 0x07 +}; + +const u8 Unknown_085A7148[] = { + 0x04, 0x05, 0x06, 0x07, + 0x04, 0x05, 0x06, 0x07, + 0x04, 0x05, 0x06, 0x07 +}; + +const u8 Unknown_085A7154[] = { + 0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07, + 0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07, + 0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07, + 0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07 +}; + +const u8 Unknown_085A7174[] = { + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07 +}; + +const u8 Unknown_085A7198[] = { + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07 +}; + +const struct { + const u8 *tiles; + const u8 *y; + const u8 *x; + u8 size; +} gUnknown_085A71B0[] = { + { + Unknown_085A6FB0, + Unknown_085A7040, + Unknown_085A70F8, + 0x04 + }, { + Unknown_085A6FDC, + Unknown_085A7044, + Unknown_085A70FC, + 0x08 + }, { + Unknown_085A6FB4, + Unknown_085A704C, + Unknown_085A7104, + 0x0c + }, { + Unknown_085A6FE4, + Unknown_085A7058, + Unknown_085A7110, + 0x20 + }, { + Unknown_085A6FC0, + Unknown_085A7078, + Unknown_085A7130, + 0x10 + }, { + Unknown_085A6FDC, + Unknown_085A7088, + Unknown_085A7140, + 0x08 + }, { + Unknown_085A6FD0, + Unknown_085A7090, + Unknown_085A7148, + 0x0c + }, { + Unknown_085A6FE4, + Unknown_085A709C, + Unknown_085A7154, + 0x20 + }, { + Unknown_085A7004, + Unknown_085A70BC, + Unknown_085A7174, + 0x24 + }, { + Unknown_085A7028, + Unknown_085A70E0, + Unknown_085A7198, + 0x18 + }}; + +#endif //GUARD_TILEMAPS_H diff --git a/include/data/decoration/tiles.h b/include/data/decoration/tiles.h new file mode 100644 index 000000000..9a3f8a222 --- /dev/null +++ b/include/data/decoration/tiles.h @@ -0,0 +1,646 @@ +#ifndef GUARD_DATA_DECORATION_TILES +#define GUARD_DATA_DECORATION_TILES + +const u16 DecorGfx_SMALL_DESK[] = { + 0x87 +}; + +const u16 DecorGfx_POKEMON_DESK[] = { + 0x8F +}; + +const u16 DecorGfx_HEAVY_DESK[] = { + 0x90, + 0x91, + 0x92, + 0x98, + 0x99, + 0x9A +}; + +const u16 DecorGfx_RAGGED_DESK[] = { + 0x93, + 0x94, + 0x95, + 0x9B, + 0x9C, + 0x9D +}; + +const u16 DecorGfx_COMFORT_DESK[] = { + 0x96, + 0x97, + 0xA3, + 0x9E, + 0x9F, + 0xAB +}; + +const u16 DecorGfx_PRETTY_DESK[] = { + 0xBD, + 0xBE, + 0xBF, + 0xC5, + 0xC6, + 0xC7, + 0xCD, + 0xCE, + 0xCF +}; + +const u16 DecorGfx_BRICK_DESK[] = { + 0xA0, + 0xA1, + 0xA2, + 0xA8, + 0xA9, + 0xAA, + 0xB0, + 0xB1, + 0xB2 +}; + +const u16 DecorGfx_CAMP_DESK[] = { + 0xA4, + 0xA5, + 0xA6, + 0xAC, + 0xAD, + 0xAE, + 0xB4, + 0xB5, + 0xB6 +}; + +const u16 DecorGfx_HARD_DESK[] = { + 0xA7, + 0xBB, + 0xBC, + 0xAF, + 0xC3, + 0xC4, + 0xB7, + 0xCB, + 0xCC +}; + +const u16 DecorGfx_SMALL_CHAIR[] = { + 0xB8 +}; + +const u16 DecorGfx_POKEMON_CHAIR[] = { + 0xB9 +}; + +const u16 DecorGfx_HEAVY_CHAIR[] = { + 0xBA +}; + +const u16 DecorGfx_PRETTY_CHAIR[] = { + 0xC0 +}; + +const u16 DecorGfx_COMFORT_CHAIR[] = { + 0xC1 +}; + +const u16 DecorGfx_RAGGED_CHAIR[] = { + 0xC2 +}; + +const u16 DecorGfx_BRICK_CHAIR[] = { + 0xC8 +}; + +const u16 DecorGfx_CAMP_CHAIR[] = { + 0xC9 +}; + +const u16 DecorGfx_HARD_CHAIR[] = { + 0xCA +}; + +const u16 DecorGfx_RED_PLANT[] = { + 0xD0, + 0xD8 +}; + +const u16 DecorGfx_TROPICAL_PLANT[] = { + 0xD2, + 0xDA +}; + +const u16 DecorGfx_PRETTY_FLOWERS[] = { + 0xD4, + 0xDC +}; + +const u16 DecorGfx_COLORFUL_PLANT[] = { + 0xE0, + 0xE2, + 0xE8, + 0xE9 +}; + +const u16 DecorGfx_BIG_PLANT[] = { + 0xE4, + 0xE6, + 0xEC, + 0xED +}; + +const u16 DecorGfx_GORGEOUS_PLANT[] = { + 0xF0, + 0xF2, + 0xF8, + 0xF9 +}; + +const u16 DecorGfx_RED_BRICK[] = { + 0x25, + 0x2D +}; + +const u16 DecorGfx_YELLOW_BRICK[] = { + 0x26, + 0x2E +}; + +const u16 DecorGfx_BLUE_BRICK[] = { + 0x27, + 0x2F +}; + +const u16 DecorGfx_RED_BALLOON[] = { + 0x138 +}; + +const u16 DecorGfx_BLUE_BALLOON[] = { + 0x13C +}; + +const u16 DecorGfx_YELLOW_BALLOON[] = { + 0x140 +}; + +const u16 DecorGfx_RED_TENT[] = { + 0x30, + 0x31, + 0x32, + 0x38, + 0x39, + 0x3A, + 0x40, + 0x41, + 0x3B +}; + +const u16 DecorGfx_BLUE_TENT[] = { + 0x48, + 0x49, + 0x68, + 0x50, + 0x51, + 0x70, + 0x58, + 0x59, + 0x69 +}; + +const u16 DecorGfx_SOLID_BOARD[] = { + 0x34, + 0x3C +}; + +const u16 DecorGfx_SLIDE[] = { + 0x35, + 0x36, + 0x3D, + 0x3E, + 0x63, + 0x64, + 0x6F, + 0x77 +}; + +const u16 DecorGfx_FENCE_LENGTH[] = { + 0x33 +}; + +const u16 DecorGfx_FENCE_WIDTH[] = { + 0x2C +}; + +const u16 DecorGfx_TIRE[] = { + 0x80, + 0x81, + 0x88, + 0x89 +}; + +const u16 DecorGfx_STAND[] = { + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x72, + 0x73, + 0x74, + 0x75 +}; + +const u16 DecorGfx_MUD_BALL[] = { + 0x28 +}; + +const u16 DecorGfx_BREAKABLE_DOOR[] = { + 0x37, + 0x3F +}; + +const u16 DecorGfx_SAND_ORNAMENT[] = { + 0x85, + 0x8D +}; + +const u16 DecorGfx_SILVER_SHIELD[] = { + 0xD6, + 0xDE +}; + +const u16 DecorGfx_GOLD_SHIELD[] = { + 0x12E, + 0x136 +}; + +const u16 DecorGfx_GLASS_ORNAMENT[] = { + 0x82, + 0x8A +}; + +const u16 DecorGfx_TV[] = { + 0xF4 +}; + +const u16 DecorGfx_ROUND_TV[] = { + 0xF5 +}; + +const u16 DecorGfx_CUTE_TV[] = { + 0xF6 +}; + +const u16 DecorGfx_GLITTER_MAT[] = { + 0x60 +}; + +const u16 DecorGfx_JUMP_MAT[] = { + 0x61 +}; + +const u16 DecorGfx_SPIN_MAT[] = { + 0x62 +}; + +const u16 DecorGfx_C_LOW_NOTE_MAT[] = { + 0x78 +}; + +const u16 DecorGfx_D_NOTE_MAT[] = { + 0x79 +}; + +const u16 DecorGfx_E_NOTE_MAT[] = { + 0x7A +}; + +const u16 DecorGfx_F_NOTE_MAT[] = { + 0x7B +}; + +const u16 DecorGfx_G_NOTE_MAT[] = { + 0x7C +}; + +const u16 DecorGfx_A_NOTE_MAT[] = { + 0x7D +}; + +const u16 DecorGfx_B_NOTE_MAT[] = { + 0x7E +}; + +const u16 DecorGfx_C_HIGH_NOTE_MAT[] = { + 0xB3 +}; + +const u16 DecorGfx_SURF_MAT[] = { + 0x42, + 0x43, + 0x44, + 0x4A, + 0x4B, + 0x4C, + 0x52, + 0x53, + 0x54 +}; + +const u16 DecorGfx_THUNDER_MAT[] = { + 0x45, + 0x46, + 0x47, + 0x4D, + 0x4E, + 0x4F, + 0x55, + 0x56, + 0x57 +}; + +const u16 DecorGfx_FIRE_BLAST_MAT[] = { + 0x5A, + 0x5B, + 0x5C, + 0x5D, + 0x5E, + 0x5F, + 0x65, + 0x66, + 0x67 +}; + +const u16 DecorGfx_POWDER_SNOW_MAT[] = { + 0x100, + 0x101, + 0x102, + 0x108, + 0x109, + 0x10A, + 0x110, + 0x111, + 0x112 +}; + +const u16 DecorGfx_ATTRACT_MAT[] = { + 0x103, + 0x104, + 0x105, + 0x10B, + 0x10C, + 0x10D, + 0x113, + 0x114, + 0x115 +}; + +const u16 DecorGfx_FISSURE_MAT[] = { + 0x106, + 0x107, + 0x118, + 0x10E, + 0x10F, + 0x120, + 0x116, + 0x117, + 0x128 +}; + +const u16 DecorGfx_SPIKES_MAT[] = { + 0x119, + 0x11A, + 0x11B, + 0x121, + 0x122, + 0x123, + 0x129, + 0x12A, + 0x12B +}; + +const u16 DecorGfx_BALL_POSTER[] = { + 0x130 +}; + +const u16 DecorGfx_GREEN_POSTER[] = { + 0x131 +}; + +const u16 DecorGfx_RED_POSTER[] = { + 0x132 +}; + +const u16 DecorGfx_BLUE_POSTER[] = { + 0x133 +}; + +const u16 DecorGfx_CUTE_POSTER[] = { + 0x134 +}; + +const u16 DecorGfx_PIKA_POSTER[] = { + 0x11C, + 0x11D +}; + +const u16 DecorGfx_LONG_POSTER[] = { + 0x11E, + 0x11F +}; + +const u16 DecorGfx_SEA_POSTER[] = { + 0x124, + 0x125 +}; + +const u16 DecorGfx_SKY_POSTER[] = { + 0x126, + 0x127 +}; + +const u16 DecorGfx_KISS_POSTER[] = { + 0x12C, + 0x12D +}; + +const u16 DecorGfx_PICHU_DOLL[] = { + MAP_OBJ_GFX_PICHU_DOLL +}; + +const u16 DecorGfx_PIKACHU_DOLL[] = { + MAP_OBJ_GFX_PIKACHU_DOLL +}; + +const u16 DecorGfx_MARILL_DOLL[] = { + MAP_OBJ_GFX_MARILL_DOLL +}; + +const u16 DecorGfx_TOGEPI_DOLL[] = { + MAP_OBJ_GFX_TOGEPI_DOLL +}; + +const u16 DecorGfx_CYNDAQUIL_DOLL[] = { + MAP_OBJ_GFX_CYNDAQUIL_DOLL +}; + +const u16 DecorGfx_CHIKORITA_DOLL[] = { + MAP_OBJ_GFX_CHIKORITA_DOLL +}; + +const u16 DecorGfx_TOTODILE_DOLL[] = { + MAP_OBJ_GFX_TOTODILE_DOLL +}; + +const u16 DecorGfx_JIGGLYPUFF_DOLL[] = { + MAP_OBJ_GFX_JIGGLYPUFF_DOLL +}; + +const u16 DecorGfx_MEOWTH_DOLL[] = { + MAP_OBJ_GFX_MEOWTH_DOLL +}; + +const u16 DecorGfx_CLEFAIRY_DOLL[] = { + MAP_OBJ_GFX_CLEFAIRY_DOLL +}; + +const u16 DecorGfx_DITTO_DOLL[] = { + MAP_OBJ_GFX_DITTO_DOLL +}; + +const u16 DecorGfx_SMOOCHUM_DOLL[] = { + MAP_OBJ_GFX_SMOOCHUM_DOLL +}; + +const u16 DecorGfx_TREECKO_DOLL[] = { + MAP_OBJ_GFX_TREECKO_DOLL +}; + +const u16 DecorGfx_TORCHIC_DOLL[] = { + MAP_OBJ_GFX_TORCHIC_DOLL +}; + +const u16 DecorGfx_MUDKIP_DOLL[] = { + MAP_OBJ_GFX_MUDKIP_DOLL +}; + +const u16 DecorGfx_DUSKULL_DOLL[] = { + MAP_OBJ_GFX_DUSKULL_DOLL +}; + +const u16 DecorGfx_WYNAUT_DOLL[] = { + MAP_OBJ_GFX_WYNAUT_DOLL +}; + +const u16 DecorGfx_BALTOY_DOLL[] = { + MAP_OBJ_GFX_BALTOY_DOLL +}; + +const u16 DecorGfx_KECLEON_DOLL[] = { + MAP_OBJ_GFX_KECLEON_DOLL +}; + +const u16 DecorGfx_AZURILL_DOLL[] = { + MAP_OBJ_GFX_AZURILL_DOLL +}; + +const u16 DecorGfx_SKITTY_DOLL[] = { + MAP_OBJ_GFX_SKITTY_DOLL +}; + +const u16 DecorGfx_SWABLU_DOLL[] = { + MAP_OBJ_GFX_SWABLU_DOLL +}; + +const u16 DecorGfx_GULPIN_DOLL[] = { + MAP_OBJ_GFX_GULPIN_DOLL +}; + +const u16 DecorGfx_LOTAD_DOLL[] = { + MAP_OBJ_GFX_LOTAD_DOLL +}; + +const u16 DecorGfx_SEEDOT_DOLL[] = { + MAP_OBJ_GFX_SEEDOT_DOLL +}; + +const u16 DecorGfx_PIKA_CUSHION[] = { + MAP_OBJ_GFX_PIKA_CUSHION +}; + +const u16 DecorGfx_ROUND_CUSHION[] = { + MAP_OBJ_GFX_ROUND_CUSHION +}; + +const u16 DecorGfx_KISS_CUSHION[] = { + MAP_OBJ_GFX_KISS_CUSHION +}; + +const u16 DecorGfx_ZIGZAG_CUSHION[] = { + MAP_OBJ_GFX_ZIGZAG_CUSHION +}; + +const u16 DecorGfx_SPIN_CUSHION[] = { + MAP_OBJ_GFX_SPIN_CUSHION +}; + +const u16 DecorGfx_DIAMOND_CUSHION[] = { + MAP_OBJ_GFX_DIAMOND_CUSHION +}; + +const u16 DecorGfx_BALL_CUSHION[] = { + MAP_OBJ_GFX_BALL_CUSHION +}; + +const u16 DecorGfx_GRASS_CUSHION[] = { + MAP_OBJ_GFX_GRASS_CUSHION +}; + +const u16 DecorGfx_FIRE_CUSHION[] = { + MAP_OBJ_GFX_FIRE_CUSHION +}; + +const u16 DecorGfx_WATER_CUSHION[] = { + MAP_OBJ_GFX_WATER_CUSHION +}; + +const u16 DecorGfx_SNORLAX_DOLL[] = { + MAP_OBJ_GFX_BIG_SNORLAX_DOLL +}; + +const u16 DecorGfx_RHYDON_DOLL[] = { + MAP_OBJ_GFX_BIG_RHYDON_DOLL +}; + +const u16 DecorGfx_LAPRAS_DOLL[] = { + MAP_OBJ_GFX_BIG_LAPRAS_DOLL +}; + +const u16 DecorGfx_VENUSAUR_DOLL[] = { + MAP_OBJ_GFX_BIG_VENUSAUR_DOLL +}; + +const u16 DecorGfx_CHARIZARD_DOLL[] = { + MAP_OBJ_GFX_BIG_CHARIZARD_DOLL +}; + +const u16 DecorGfx_BLASTOISE_DOLL[] = { + MAP_OBJ_GFX_BIG_BLASTOISE_DOLL +}; + +const u16 DecorGfx_WAILMER_DOLL[] = { + MAP_OBJ_GFX_BIG_WAILMER_DOLL +}; + +const u16 DecorGfx_REGIROCK_DOLL[] = { + MAP_OBJ_GFX_BIG_REGIROCK_DOLL +}; + +const u16 DecorGfx_REGICE_DOLL[] = { + MAP_OBJ_GFX_BIG_REGICE_DOLL +}; + +const u16 DecorGfx_REGISTEEL_DOLL[] = { + MAP_OBJ_GFX_BIG_REGISTEEL_DOLL +}; + +#endif // GUARD_DATA_DECORATION_TILES diff --git a/include/decoration.h b/include/decoration.h index bbb77d127..adefb2fd1 100644 --- a/include/decoration.h +++ b/include/decoration.h @@ -125,6 +125,47 @@ enum DecoId { /*120*/ DECOR_REGISTEEL_DOLL }; +enum DecorPerm { + /* + * The nomenclature here describes collision and placement permissions, in that order. + */ + DECORPERM_SOLID_FLOOR, + DECORPERM_PASS_FLOOR, + DECORPERM_BEHIND_FLOOR, + DECORPERM_NA_WALL, + DECORPERM_SOLID_MAT +}; + +enum DecorShape { + /* + * Width-x-height + */ + DECORSHAPE_1x1, + DECORSHAPE_2x1, + DECORSHAPE_3x1, // unused + DECORSHAPE_4x2, + DECORSHAPE_2x2, + DECORSHAPE_1x2, + DECORSHAPE_1x3, // unused + DECORSHAPE_2x4, + DECORSHAPE_3x3, + DECORSHAPE_3x2 +}; + +enum DecorCat { + /* + * In which category you can find the decoration in the PC. + */ + /*0*/ DECORCAT_DESK, + /*1*/ DECORCAT_CHAIR, + /*2*/ DECORCAT_PLANT, + /*3*/ DECORCAT_ORNAMENT, + /*4*/ DECORCAT_MAT, + /*5*/ DECORCAT_POSTER, + /*6*/ DECORCAT_DOLL, + /*7*/ DECORCAT_CUSHION +}; + struct Decoration { /*0x00*/ u8 id; @@ -137,6 +178,18 @@ struct Decoration /*0x1c*/ const u16 *tiles; }; +struct DecorPCPointers +{ + /* 0x00 */ u8 *items; + /* 0x04 */ u8 *pos; + /* 0x08 */ u8 size; + /* 0x09 */ u8 isPlayerRoom; +}; + extern const struct Decoration gDecorations[]; +extern EWRAM_DATA u8 *gCurDecorInventoryItems; +extern EWRAM_DATA u8 gCurDecorationIndex; + +void sub_8126968(void); #endif //GUARD_DECORATION_H diff --git a/include/decoration_inventory.h b/include/decoration_inventory.h index 5ca345933..e1fec36ea 100644 --- a/include/decoration_inventory.h +++ b/include/decoration_inventory.h @@ -1,10 +1,20 @@ #ifndef GUARD_DECORATION_INVENTORY_H #define GUARD_DECORATION_INVENTORY_H +struct DecorationInventory { + u8 *items; + u8 size; +}; + +extern struct DecorationInventory gDecorationInventories[]; void ClearDecorationInventories(void); +s8 GetFirstEmptyDecorSlot(u8 idx); u8 CheckHasDecoration(u8); u8 DecorationAdd(u8); u8 DecorationCheckSpace(u8); s8 DecorationRemove(u8); +void CondenseDecorationCategoryN(u8); +u8 CountDecorationCategoryN(u8 idx); +u8 CountDecorations(void); #endif // GUARD_DECORATION_INVENTORY_H diff --git a/include/event_scripts.h b/include/event_scripts.h index bb0d6731b..ff02a110a 100755 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -5,6 +5,10 @@ #ifndef GUARD_EVENT_SCRIPTS_H #define GUARD_EVENT_SCRIPTS_H +extern const u8 gUnknown_0823B4E8[]; +extern const u8 gUnknown_08275D0C[]; +extern const u8 gUnknown_08275D1F[]; +extern const u8 gUnknown_08275D2E[]; extern const u8 gUnknown_082766A2[]; extern const u8 gUnknown_082766A6[]; diff --git a/include/field_map_obj.h b/include/field_map_obj.h index b18b6cfd3..038233fe6 100755 --- a/include/field_map_obj.h +++ b/include/field_map_obj.h @@ -74,6 +74,7 @@ u8 npc_block_way(struct MapObject *, s16, s16, u32); void MoveCoords(u8, s16 *, s16 *); bool8 FieldObjectIsSpecialAnimActive(struct MapObject *); u8 FieldObjectClearAnimIfSpecialAnimFinished(struct MapObject *); +u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z); // Exported data declarations diff --git a/include/field_screen.h b/include/field_screen.h new file mode 100644 index 000000000..b15fdba7d --- /dev/null +++ b/include/field_screen.h @@ -0,0 +1,12 @@ +#ifndef GUARD_FIELD_SCREEN_H +#define GUARD_FIELD_SCREEN_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +void pal_fill_black(void); +bool8 sub_80ABDFC(void); + +#endif //GUARD_FIELD_SCREEN_H diff --git a/include/fieldmap.h b/include/fieldmap.h index 3efc5e36f..06cb7cc77 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -6,11 +6,14 @@ extern struct MapCoords { int height; } gUnknown_03005DC0; +u32 MapGridGetMetatileIdAt(int, int); u32 MapGridGetMetatileBehaviorAt(int, int); void MapGridSetMetatileIdAt(int, int, u16); +void MapGridSetMetatileEntryAt(int, int, u16); void GetCameraCoords(u16*, u16*); bool8 MapGridIsImpassableAt(s16, s16); s32 GetMapBorderIdAt(s16, s16); bool32 CanCameraMoveInDirection(u8); +u16 GetBehaviorByMetatileId(u16 metatileId); #endif //GUARD_FIELDMAP_H diff --git a/include/global.h b/include/global.h index 4afe89de7..2e3a106eb 100644 --- a/include/global.h +++ b/include/global.h @@ -12,8 +12,10 @@ #define asm_unified(x) asm(".syntax unified\n" x "\n.syntax divided") #if defined (__APPLE__) || defined (__CYGWIN__) -void memset(void *, int, size_t); -void memcpy(void *, const void *, size_t); +void *memset(void *, int, size_t); +void *memcpy(void *, const void *, size_t); +int strcmp(const char *s1, const char *s2); +char* strcpy(char *dst0, const char *src0); #endif // __APPLE__ #define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) diff --git a/include/graphics.h b/include/graphics.h new file mode 100644 index 000000000..c50fdef3f --- /dev/null +++ b/include/graphics.h @@ -0,0 +1,95 @@ +// +// Created by scott on 10/21/2017. +// + +#ifndef GUARD_GRAPHICS_H +#define GUARD_GRAPHICS_H + +extern const u8 gItemIcon_QuestionMark[]; +extern const u8 gItemIconPalette_QuestionMark[]; +extern const u8 gUnknown_08DB7AA0[]; +extern const u8 gUnknown_08DB7B34[]; +extern const u8 gUnknown_08DB7B5C[]; +extern const u8 gUnknown_08DB7BEC[]; +extern const u8 gUnknown_08DB7C08[]; +extern const u8 gUnknown_08DB7CE8[]; +extern const u8 gUnknown_08DB7D08[]; +extern const u8 gUnknown_08DB7DCC[]; +extern const u8 gUnknown_08DB7DF4[]; +extern const u8 gUnknown_08DB7EA0[]; +extern const u8 gUnknown_08DB7EC4[]; +extern const u8 gUnknown_08DB7F60[]; +extern const u8 gUnknown_08DB7F7C[]; +extern const u8 gUnknown_08DB8070[]; +extern const u8 gUnknown_08DB808C[]; +extern const u8 gUnknown_08DB8138[]; +extern const u8 gUnknown_08DB8160[]; +extern const u8 gUnknown_08DB8218[]; +extern const u8 gUnknown_08DB823C[]; +extern const u8 gUnknown_08DB8300[]; +extern const u8 gUnknown_08DB8328[]; +extern const u8 gUnknown_08DB8430[]; +extern const u8 gUnknown_08DB8458[]; +extern const u8 gUnknown_08DB8528[]; +extern const u8 gUnknown_08DB854C[]; +extern const u8 gUnknown_08DB862C[]; +extern const u8 gUnknown_08DB8654[]; +extern const u8 gUnknown_08DB86C4[]; +extern const u8 gUnknown_08DB86E0[]; +extern const u8 gUnknown_08DB8750[]; +extern const u8 gUnknown_08DB876C[]; +extern const u8 gUnknown_08DB87DC[]; +extern const u8 gUnknown_08DB87F8[]; +extern const u8 gUnknown_08DB88D8[]; +extern const u8 gUnknown_08DB8900[]; +extern const u8 gUnknown_08DB89E0[]; +extern const u8 gUnknown_08DB8A08[]; +extern const u8 gUnknown_08DB8A68[]; +extern const u8 gUnknown_08DB8A84[]; +extern const u8 gUnknown_08DB8B40[]; +extern const u8 gUnknown_08DB8B68[]; +extern const u8 gUnknown_08DB8C40[]; +extern const u8 gUnknown_08DB8C5C[]; +extern const u8 gUnknown_08DB8CF4[]; +extern const u8 gUnknown_08DB8D18[]; +extern const u8 gUnknown_08DB8DB0[]; +extern const u8 gUnknown_08DB8DD4[]; +extern const u8 gUnknown_08DB8E80[]; +extern const u8 gUnknown_08DB8EA0[]; +extern const u8 gUnknown_08DB8F58[]; +extern const u8 gUnknown_08DB8F7C[]; +extern const u8 gUnknown_08DB9038[]; +extern const u8 gUnknown_08DB9058[]; +extern const u8 gUnknown_08DB9130[]; +extern const u8 gUnknown_08DB9154[]; +extern const u8 gUnknown_08DB9218[]; +extern const u8 gUnknown_08DB9234[]; +extern const u8 gUnknown_08DB92FC[]; +extern const u8 gUnknown_08DB931C[]; +extern const u8 gUnknown_08DB93E8[]; +extern const u8 gUnknown_08DB940C[]; +extern const u8 gUnknown_08DB94CC[]; +extern const u8 gUnknown_08DB94E8[]; +extern const u8 gUnknown_08DB95AC[]; +extern const u8 gUnknown_08DB95D0[]; +extern const u8 gUnknown_08DB96C4[]; +extern const u8 gUnknown_08DB96EC[]; +extern const u8 gUnknown_08DB97F4[]; +extern const u8 gUnknown_08DB981C[]; +extern const u8 gUnknown_08DB9908[]; +extern const u8 gUnknown_08DB9930[]; +extern const u8 gUnknown_08DB9A54[]; +extern const u8 gUnknown_08DB9A7C[]; +extern const u8 gUnknown_08DB9B7C[]; +extern const u8 gUnknown_08DB9BA4[]; +extern const u8 gUnknown_08DB9CB0[]; +extern const u8 gUnknown_08DB9CD8[]; +extern const u8 gUnknown_08DB9DAC[]; +extern const u8 gUnknown_08DB9DD4[]; +extern const u8 gUnknown_08DB9EE4[]; +extern const u8 gUnknown_08DB9F08[]; +extern const u8 gUnknown_08DB9FFC[]; +extern const u8 gUnknown_08DBA020[]; +extern const u8 gUnknown_08DBA12C[]; + +#endif //GUARD_GRAPHICS_H diff --git a/include/international_string_util.h b/include/international_string_util.h index 1c2836132..9d9735a52 100644 --- a/include/international_string_util.h +++ b/include/international_string_util.h @@ -1,20 +1,20 @@ #ifndef GUARD_INTERNATIONAL_STRING_UTIL_H #define GUARD_INTERNATIONAL_STRING_UTIL_H +#include "menu.h" + void sub_81DB52C(const u8 *src); void TVShowConvertInternationalString(u8 *dest, const u8 *src, u8 language); -u32 sub_81DB604(const u8 *); s32 GetStringCenterAlignXOffset(s32 fontId, const u8 *str, s32 totalWidth); s32 GetStringRightAlignXOffset(s32 fontId, const u8 *str, s32 totalWidth); s32 GetStringCenterAlignXOffsetWithLetterSpacing(s32 fontId, const u8 *str, s32 totalWidth, s32 letterSpacing); s32 GetStringWidthDifference(s32 fontId, const u8 *str, s32 totalWidth, s32 letterSpacing); -s32 GetMaxWidthInMenuTable(const u8 **str, s32 arg1); -s32 sub_81DB3D8(const u8 **str, u8* arg1, s32 arg2); +s32 GetMaxWidthInMenuTable(const struct MenuAction *str, s32 arg1); +s32 sub_81DB3D8(const struct MenuAction *str, u8* arg1, s32 arg2); // sub_81DB41C // sub_81DB468 // sub_81DB494 // sub_81DB4DC -// sub_81DB52C // sub_81DB554 // sub_81DB5AC u32 sub_81DB604(const u8 *); diff --git a/include/item_icon.h b/include/item_icon.h new file mode 100644 index 000000000..a43b72f39 --- /dev/null +++ b/include/item_icon.h @@ -0,0 +1,17 @@ +// +// Created by scott on 10/20/2017. +// + +#ifndef GUARD_ITEM_ICON_H +#define GUARD_ITEM_ICON_H + +extern EWRAM_DATA void *gUnknown_0203CEBC; +extern EWRAM_DATA void *gUnknown_0203CEC0; + +extern const struct SpriteTemplate gUnknown_08614FF4; + +bool8 AllocItemIconTemporaryBuffers(void); +void CopyItemIconPicTo4x4Buffer(void *src, void *dest); +void FreeItemIconTemporaryBuffers(void); + +#endif //GUARD_ITEM_ICON_H diff --git a/include/list_menu.h b/include/list_menu.h new file mode 100644 index 000000000..93005e482 --- /dev/null +++ b/include/list_menu.h @@ -0,0 +1,54 @@ +#ifndef GUARD_LIST_MENU_H +#define GUARD_LIST_MENU_H + +// Exported type declarations + +// Exported RAM declarations + +struct ListMenuItem { + const u8 *unk_00; + s32 unk_04; +}; + +struct ListMenu; + +struct ListMenuTemplate { + struct ListMenuItem *unk_00; + void (* unk_04)(u32, bool8, struct ListMenu *); + void (* unk_08)(u8, s32, u8); + u16 unk_0c; + u16 unk_0e; + u8 unk_10; + u8 unk_11; + u8 unk_12; + u8 unk_13; + u32 unk_14_0:4; + u32 unk_14_4:4; + u32 unk_15_0:4; + u32 unk_15_4:4; + u32 unk_16_0:1; + u32 unk_16_1:6; + u32 unk_16_7:1; + u32 unk_17_0:6; +}; + +struct ListMenu { + struct ListMenuTemplate _template; + u16 scrollOffset; + u16 selectedRow; + u8 unk_1C; + u8 unk_1D; + u8 unk_1E; + u8 unk_1F; +}; + +extern struct ListMenuTemplate gUnknown_03006310; + +// Exported ROM declarations + +u8 ListMenuInit(struct ListMenuTemplate *template, u16 a1, u16 a2); +s32 ListMenuHandleInput(u8 id); +void get_coro_args_x18_x1A(u8 a0, u16 *a1, u16 *a2); +void sub_81AE6C8(u8 a0, u16 *a1, u16 *a2); + +#endif //GUARD_LIST_MENU_H diff --git a/include/map_object_constants.h b/include/map_object_constants.h new file mode 100644 index 000000000..79482b54a --- /dev/null +++ b/include/map_object_constants.h @@ -0,0 +1,239 @@ +#ifndef GUARD_MAP_OBJECT_CONSTANTS_H +#define GUARD_MAP_OBJECT_CONSTANTS_H + +enum +{ + MAP_OBJ_GFX_BRENDAN_NORMAL, + MAP_OBJ_GFX_BRENDAN_MACH_BIKE, + MAP_OBJ_GFX_BRENDAN_SURFING, + MAP_OBJ_GFX_BRENDAN_FIELD_MOVE, + MAP_OBJ_GFX_QUINTY_PLUMP, + MAP_OBJ_GFX_LITTLE_BOY_1, + MAP_OBJ_GFX_LITTLE_GIRL_1, + MAP_OBJ_GFX_BOY_1, + MAP_OBJ_GFX_GIRL_1, + MAP_OBJ_GFX_BOY_2, + MAP_OBJ_GFX_GIRL_2, + MAP_OBJ_GFX_LITTLE_BOY_2, + MAP_OBJ_GFX_LITTLE_GIRL_2, + MAP_OBJ_GFX_BOY_3, + MAP_OBJ_GFX_GIRL_3, + MAP_OBJ_GFX_BOY_4, + MAP_OBJ_GFX_WOMAN_1, + MAP_OBJ_GFX_FAT_MAN, + MAP_OBJ_GFX_WOMAN_2, + MAP_OBJ_GFX_MAN_1, + MAP_OBJ_GFX_WOMAN_3, + MAP_OBJ_GFX_OLD_MAN_1, + MAP_OBJ_GFX_OLD_WOMAN_1, + MAP_OBJ_GFX_MAN_2, + MAP_OBJ_GFX_WOMAN_4, + MAP_OBJ_GFX_MAN_3, + MAP_OBJ_GFX_WOMAN_5, + MAP_OBJ_GFX_COOK, + MAP_OBJ_GFX_WOMAN_6, + MAP_OBJ_GFX_OLD_MAN_2, + MAP_OBJ_GFX_OLD_WOMAN_2, + MAP_OBJ_GFX_CAMPER, + MAP_OBJ_GFX_PICNICKER, + MAP_OBJ_GFX_MAN_4, + MAP_OBJ_GFX_WOMAN_7, + MAP_OBJ_GFX_YOUNGSTER, + MAP_OBJ_GFX_BUG_CATCHER, + MAP_OBJ_GFX_PSYCHIC_M, + MAP_OBJ_GFX_SCHOOL_KID_M, + MAP_OBJ_GFX_MANIAC, + MAP_OBJ_GFX_HEX_MANIAC, + MAP_OBJ_GFX_WOMAN_8, + MAP_OBJ_GFX_SWIMMER_M, + MAP_OBJ_GFX_SWIMMER_F, + MAP_OBJ_GFX_BLACK_BELT, + MAP_OBJ_GFX_BEAUTY, + MAP_OBJ_GFX_SCIENTIST_1, + MAP_OBJ_GFX_LASS, + MAP_OBJ_GFX_GENTLEMAN, + MAP_OBJ_GFX_SAILOR, + MAP_OBJ_GFX_FISHERMAN, + MAP_OBJ_GFX_RUNNING_TRIATHLETE_M, + MAP_OBJ_GFX_RUNNING_TRIATHLETE_F, + MAP_OBJ_GFX_TUBER_F, + MAP_OBJ_GFX_TUBER_M, + MAP_OBJ_GFX_HIKER, + MAP_OBJ_GFX_CYCLING_TRIATHLETE_M, + MAP_OBJ_GFX_CYCLING_TRIATHLETE_F, + MAP_OBJ_GFX_NURSE, + MAP_OBJ_GFX_ITEM_BALL, + MAP_OBJ_GFX_BERRY_TREE, + MAP_OBJ_GFX_BERRY_TREE_EARLY_STAGES, + MAP_OBJ_GFX_BERRY_TREE_LATE_STAGES, + MAP_OBJ_GFX_BRENDAN_ACRO_BIKE, + MAP_OBJ_GFX_PROF_BIRCH, + MAP_OBJ_GFX_MAN_5, + MAP_OBJ_GFX_MAN_6, + MAP_OBJ_GFX_REPORTER_M, + MAP_OBJ_GFX_REPORTER_F, + MAP_OBJ_GFX_BARD, + MAP_OBJ_GFX_HIPSTER, + MAP_OBJ_GFX_TRADER, + MAP_OBJ_GFX_STORYTELLER, + MAP_OBJ_GFX_GIDDY, + MAP_OBJ_GFX_UNUSED_MAUVILLE_OLD_MAN_1, + MAP_OBJ_GFX_UNUSED_MAUVILLE_OLD_MAN_2, + MAP_OBJ_GFX_UNUSED_NATU_DOLL, + MAP_OBJ_GFX_UNUSED_MAGNEMITE_DOLL, + MAP_OBJ_GFX_UNUSED_SQUIRTLE_DOLL, + MAP_OBJ_GFX_UNUSED_WOOPER_DOLL, + MAP_OBJ_GFX_UNUSED_PIKACHU_DOLL, + MAP_OBJ_GFX_UNUSED_PORYGON2_DOLL, + MAP_OBJ_GFX_CUTTABLE_TREE, + MAP_OBJ_GFX_MART_EMPLOYEE, + MAP_OBJ_GFX_ROOFTOP_SALE_WOMAN, + MAP_OBJ_GFX_TEALA, + MAP_OBJ_GFX_BREAKABLE_ROCK, + MAP_OBJ_GFX_PUSHABLE_BOULDER, + MAP_OBJ_GFX_MR_BRINEYS_BOAT, + MAP_OBJ_GFX_MAY_NORMAL, + MAP_OBJ_GFX_MAY_MACH_BIKE, + MAP_OBJ_GFX_MAY_ACRO_BIKE, + MAP_OBJ_GFX_MAY_SURFING, + MAP_OBJ_GFX_MAY_FIELD_MOVE, + MAP_OBJ_GFX_TRUCK, + MAP_OBJ_GFX_MACHOKE_CARRYING_BOX, + MAP_OBJ_GFX_MACHOKE_FACING_AWAY, + MAP_OBJ_GFX_BIRCHS_BAG, + MAP_OBJ_GFX_POOCHYENA, + MAP_OBJ_GFX_ARTIST, + MAP_OBJ_GFX_RIVAL_BRENDAN_NORMAL, + MAP_OBJ_GFX_RIVAL_BRENDAN_MACH_BIKE, + MAP_OBJ_GFX_RIVAL_BRENDAN_ACRO_BIKE, + MAP_OBJ_GFX_RIVAL_BRENDAN_SURFING, + MAP_OBJ_GFX_RIVAL_BRENDAN_FIELD_MOVE, + MAP_OBJ_GFX_RIVAL_MAY_NORMAL, + MAP_OBJ_GFX_RIVAL_MAY_MACH_BIKE, + MAP_OBJ_GFX_RIVAL_MAY_ACRO_BIKE, + MAP_OBJ_GFX_RIVAL_MAY_SURFING, + MAP_OBJ_GFX_RIVAL_MAY_FIELD_MOVE, + MAP_OBJ_GFX_CAMERAMAN, + MAP_OBJ_GFX_BRENDAN_UNDERWATER, + MAP_OBJ_GFX_MAY_UNDERWATER, + MAP_OBJ_GFX_MOVING_BOX, + MAP_OBJ_GFX_CABLE_CAR, + MAP_OBJ_GFX_SCIENTIST_2, + MAP_OBJ_GFX_MAN_7, + MAP_OBJ_GFX_AQUA_MEMBER_M, + MAP_OBJ_GFX_AQUA_MEMBER_F, + MAP_OBJ_GFX_MAGMA_MEMBER_M, + MAP_OBJ_GFX_MAGMA_MEMBER_F, + MAP_OBJ_GFX_SIDNEY, + MAP_OBJ_GFX_PHOEBE, + MAP_OBJ_GFX_GLACIA, + MAP_OBJ_GFX_DRAKE, + MAP_OBJ_GFX_ROXANNE, + MAP_OBJ_GFX_BRAWLY, + MAP_OBJ_GFX_WATTSON, + MAP_OBJ_GFX_FLANNERY, + MAP_OBJ_GFX_NORMAN, + MAP_OBJ_GFX_WINONA, + MAP_OBJ_GFX_LIZA, + MAP_OBJ_GFX_TATE, + MAP_OBJ_GFX_WALLACE, + MAP_OBJ_GFX_STEVEN, + MAP_OBJ_GFX_WALLY, + MAP_OBJ_GFX_LITTLE_BOY_3, + MAP_OBJ_GFX_BRENDAN_FISHING, + MAP_OBJ_GFX_MAY_FISHING, + MAP_OBJ_GFX_HOT_SPRINGS_OLD_WOMAN, + MAP_OBJ_GFX_SS_TIDAL, + MAP_OBJ_GFX_SUBMARINE_SHADOW, + MAP_OBJ_GFX_PICHU_DOLL, + MAP_OBJ_GFX_PIKACHU_DOLL, + MAP_OBJ_GFX_MARILL_DOLL, + MAP_OBJ_GFX_TOGEPI_DOLL, + MAP_OBJ_GFX_CYNDAQUIL_DOLL, + MAP_OBJ_GFX_CHIKORITA_DOLL, + MAP_OBJ_GFX_TOTODILE_DOLL, + MAP_OBJ_GFX_JIGGLYPUFF_DOLL, + MAP_OBJ_GFX_MEOWTH_DOLL, + MAP_OBJ_GFX_CLEFAIRY_DOLL, + MAP_OBJ_GFX_DITTO_DOLL, + MAP_OBJ_GFX_SMOOCHUM_DOLL, + MAP_OBJ_GFX_TREECKO_DOLL, + MAP_OBJ_GFX_TORCHIC_DOLL, + MAP_OBJ_GFX_MUDKIP_DOLL, + MAP_OBJ_GFX_DUSKULL_DOLL, + MAP_OBJ_GFX_WYNAUT_DOLL, + MAP_OBJ_GFX_BALTOY_DOLL, + MAP_OBJ_GFX_KECLEON_DOLL, + MAP_OBJ_GFX_AZURILL_DOLL, + MAP_OBJ_GFX_SKITTY_DOLL, + MAP_OBJ_GFX_SWABLU_DOLL, + MAP_OBJ_GFX_GULPIN_DOLL, + MAP_OBJ_GFX_LOTAD_DOLL, + MAP_OBJ_GFX_SEEDOT_DOLL, + MAP_OBJ_GFX_PIKA_CUSHION, + MAP_OBJ_GFX_ROUND_CUSHION, + MAP_OBJ_GFX_KISS_CUSHION, + MAP_OBJ_GFX_ZIGZAG_CUSHION, + MAP_OBJ_GFX_SPIN_CUSHION, + MAP_OBJ_GFX_DIAMOND_CUSHION, + MAP_OBJ_GFX_BALL_CUSHION, + MAP_OBJ_GFX_GRASS_CUSHION, + MAP_OBJ_GFX_FIRE_CUSHION, + MAP_OBJ_GFX_WATER_CUSHION, + MAP_OBJ_GFX_BIG_SNORLAX_DOLL, + MAP_OBJ_GFX_BIG_RHYDON_DOLL, + MAP_OBJ_GFX_BIG_LAPRAS_DOLL, + MAP_OBJ_GFX_BIG_VENUSAUR_DOLL, + MAP_OBJ_GFX_BIG_CHARIZARD_DOLL, + MAP_OBJ_GFX_BIG_BLASTOISE_DOLL, + MAP_OBJ_GFX_BIG_WAILMER_DOLL, + MAP_OBJ_GFX_BIG_REGIROCK_DOLL, + MAP_OBJ_GFX_BIG_REGICE_DOLL, + MAP_OBJ_GFX_BIG_REGISTEEL_DOLL, + MAP_OBJ_GFX_LATIAS, + MAP_OBJ_GFX_LATIOS, + MAP_OBJ_GFX_BOY_5, + MAP_OBJ_GFX_CONTEST_JUDGE, + MAP_OBJ_GFX_BRENDAN_WATERING, + MAP_OBJ_GFX_MAY_WATERING, + MAP_OBJ_GFX_BRENDAN_DECORATING, + MAP_OBJ_GFX_MAY_DECORATING, + MAP_OBJ_GFX_ARCHIE, + MAP_OBJ_GFX_MAXIE, + MAP_OBJ_GFX_KYOGRE_1, + MAP_OBJ_GFX_GROUDON_1, + MAP_OBJ_GFX_FOSSIL, + MAP_OBJ_GFX_REGIROCK, + MAP_OBJ_GFX_REGICE, + MAP_OBJ_GFX_REGISTEEL, + MAP_OBJ_GFX_SKITTY, + MAP_OBJ_GFX_KECLEON_1, + MAP_OBJ_GFX_KYOGRE_2, + MAP_OBJ_GFX_GROUDON_2, + MAP_OBJ_GFX_RAYQUAZA, + MAP_OBJ_GFX_ZIGZAGOON, + MAP_OBJ_GFX_PIKACHU, + MAP_OBJ_GFX_AZUMARILL, + MAP_OBJ_GFX_WINGULL, + MAP_OBJ_GFX_KECLEON_2, + MAP_OBJ_GFX_TUBER_M_SWIMMING, + MAP_OBJ_GFX_AZURILL, + MAP_OBJ_GFX_MOM, + MAP_OBJ_GFX_LINK_BRENDAN, + MAP_OBJ_GFX_LINK_MAY, +}; + +enum { + SHADOW_SIZE_S, + SHADOW_SIZE_M, + SHADOW_SIZE_L, + SHADOW_SIZE_XL +}; + +enum { + TRACKS_NONE, + TRACKS_FOOT, + TRACKS_BIKE_TIRE +}; + +#endif // GUARD_MAP_OBJECT_CONSTANTS_H diff --git a/include/menu.h b/include/menu.h index ce653274c..927c3d3d4 100644 --- a/include/menu.h +++ b/include/menu.h @@ -4,21 +4,24 @@ #include "window.h" struct MenuAction -{ - const u8 *text; - u8 (*func)(); -}; - -struct MenuAction2 { const u8 *text; - void (*func)(u8); + union { + void (*void_u8)(u8); + u8 (*u8_void)(void); + } func; }; void box_print(u8, u8, u8, u8, const void *, s8, const u8 *); void sub_8198070(u8 windowId, bool8 copyToVram); void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock); void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette); +void schedule_bg_copy_tilemap_to_vram(u8 bgNum); +void PrintMenuTable(u8 idx, u8 nstrs, const struct MenuAction *strs); +void InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 idx, u8 nstrs,u8); +u8 GetMenuCursorPos(void); +s8 ProcessMenuInput(void); +void blit_move_info_icon(u8 winId, u8 a2, u16 x, u16 y); void reset_temp_tile_data_buffers(void); int decompress_and_copy_tile_data_to_vram(u8 bg_id, const void *src, int size, u16 offset, u8 mode); bool8 free_temp_tile_data_buffers_if_possible(void); diff --git a/include/menu_helpers.h b/include/menu_helpers.h index 45ee95de5..f083a10e2 100644 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -3,9 +3,18 @@ // Exported type declarations +struct YesNoFuncTable { + TaskFunc yesFunc; + TaskFunc noFunc; +}; + // Exported RAM declarations // Exported ROM declarations + +void sub_812225C(u16 *, u16 *, u8, u8); +void sub_8122298(u16 *, u16 *, u8, u8, u8); +void sub_8121F68(u8 taskId, const struct YesNoFuncTable *data); bool8 sub_81221AC(void); #endif //GUARD_MENU_HELPERS_H diff --git a/include/menu_indicators.h b/include/menu_indicators.h new file mode 100644 index 000000000..5a3b2e5b8 --- /dev/null +++ b/include/menu_indicators.h @@ -0,0 +1,12 @@ +#ifndef GUARD_MENU_INDICATORS_H +#define GUARD_MENU_INDICATORS_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +u8 AddScrollIndicatorArrowPairParametrized(u8, u8, u8, u8, s32, u8, u8, u16 *); +void RemoveScrollIndicatorArrowPair(u8); + +#endif //GUARD_MENU_INDICATORS_H diff --git a/include/new_menu_helpers.h b/include/new_menu_helpers.h index 6377897d3..f588967bf 100644 --- a/include/new_menu_helpers.h +++ b/include/new_menu_helpers.h @@ -1,9 +1,16 @@ #ifndef GUARD_NEW_MENU_HELPERS_H #define GUARD_NEW_MENU_HELPERS_H +#include "text.h" +#include "task.h" + void sub_81973A4(void); void sub_81973C4(u8, u8); void sub_819746C(u8 windowId, bool8 copyToVram); void sub_81973FC(u8, u8); +u16 AddTextPrinterParametrized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor); +void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback); +void sub_8197434(u8 a0, u8 a1); +void sub_8197930(void); #endif // GUARD_NEW_MENU_HELPERS_H diff --git a/include/overworld.h b/include/overworld.h index 1869222b0..5ac4cad29 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -1,6 +1,8 @@ #ifndef GUARD_ROM4_H #define GUARD_ROM4_H +#include "main.h" + struct UnkPlayerStruct { u8 player_field_0; @@ -21,6 +23,7 @@ struct UCoords32 }; extern struct LinkPlayerMapObject gLinkPlayerMapObjects[4]; +extern MainCallback gFieldCallback; void IncrementGameStat(u8 index); @@ -55,5 +58,6 @@ void sub_8086230(void); void c2_exit_to_overworld_2_switch(void); bool32 sub_8087598(void); void c2_exit_to_overworld_1_continue_scripts_restart_music(void); +void warp_in(void); #endif //GUARD_ROM4_H diff --git a/include/player_pc.h b/include/player_pc.h new file mode 100644 index 000000000..b14d1ede3 --- /dev/null +++ b/include/player_pc.h @@ -0,0 +1,12 @@ +#ifndef GUARD_PLAYER_PC_H +#define GUARD_PLAYER_PC_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations + +void sub_816B060(u8 taskId); + +#endif //GUARD_PLAYER_PC_H diff --git a/include/secret_base.h b/include/secret_base.h index 4f7b411da..14defff26 100644 --- a/include/secret_base.h +++ b/include/secret_base.h @@ -6,6 +6,7 @@ // Exported RAM declarations // Exported ROM declarations +void sub_80E9578(void); void sub_80E980C(void); #endif //GUARD_SECRET_BASE_H diff --git a/include/strings.h b/include/strings.h index e45f3c87d..191b1809a 100644 --- a/include/strings.h +++ b/include/strings.h @@ -36,5 +36,39 @@ extern const u8 gText_Jackpot[]; extern const u8 gText_First[]; extern const u8 gText_Second[]; extern const u8 gText_Third[]; +extern const u8 gText_NoDecorations[]; +extern const u8 gText_NoDecorationsInUse[]; +extern const u8 gText_Exit[]; +extern const u8 gText_Cancel[]; +extern const u8 gText_Color161Shadow161[]; +extern const u8 gText_GoBackPrevMenu[]; +extern const u8 gText_CantPlaceInRoom[]; +extern const u8 gText_NoMoreDecorations[]; +extern const u8 gText_NoMoreDecorations2[]; +extern const u8 gText_InUseAlready[]; +extern const u8 gText_CancelDecorating[]; +extern const u8 gText_PlaceItHere[]; +extern const u8 gText_CantBePlacedHere[]; +extern const u8 gText_DecorationReturnedToPC[]; +extern const u8 gText_StopPuttingAwayDecorations[]; +extern const u8 gText_ReturnDecorationToPC[]; +extern const u8 gText_NoDecorationHere[]; +extern const u8 gText_DecorationWillBeDiscarded[]; +extern const u8 gText_CantThrowAwayInUse[]; +extern const u8 gText_DecorationThrownAway[]; +extern const u8 gText_Desk[]; +extern const u8 gText_Chair[]; +extern const u8 gText_Plant[]; +extern const u8 gText_Ornament[]; +extern const u8 gText_Mat[]; +extern const u8 gText_Poster[]; +extern const u8 gText_PutOutSelectedDecorItem[]; +extern const u8 gText_StoreChosenDecorInPC[]; +extern const u8 gText_ThrowAwayUnwantedDecors[]; +extern const u8 gText_Doll[]; +extern const u8 gText_Cushion[]; +extern const u8 gText_Decorate[]; +extern const u8 gText_PutAway[]; +extern const u8 gText_Toss2[]; #endif //GUARD_STRINGS_H diff --git a/include/tilesets.h b/include/tilesets.h new file mode 100644 index 000000000..70609c046 --- /dev/null +++ b/include/tilesets.h @@ -0,0 +1,13 @@ +#ifndef GUARD_tilesets_H +#define GUARD_tilesets_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations + +extern struct Tileset *gTilesetPointer_SecretBase; +extern struct Tileset *gTilesetPointer_SecretBaseRedCave; + +#endif //GUARD_tilesets_H diff --git a/include/trader.h b/include/trader.h new file mode 100644 index 000000000..71fd1f7c2 --- /dev/null +++ b/include/trader.h @@ -0,0 +1,11 @@ +// +// Created by scott on 10/21/2017. +// + +#ifndef GUARD_TRADER_H +#define GUARD_TRADER_H + +void sub_8133DA0(u8 taskId); +void sub_8133E1C(u8 taskId); + +#endif //GUARD_TRADER_H diff --git a/include/tv.h b/include/tv.h index 9495387ef..172754ae0 100644 --- a/include/tv.h +++ b/include/tv.h @@ -8,6 +8,7 @@ void PutPokemonTodayCaughtOnAir(void); u32 GetPlayerIDAsU32(void); bool8 GetPriceReduction(u8 newsKind); u8 GetRibbonCount(struct Pokemon *pokemon); +void TV_PutSecretBaseVisitOnTheAir(void); void sub_80EE184(void); void sub_80F14F8(TVShow *shows); size_t sub_80EF370(int value); diff --git a/ld_script.txt b/ld_script.txt index 53144817f..b28f822f7 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -172,7 +172,7 @@ SECTIONS { asm/heal_location.o(.text); asm/region_map.o(.text); asm/cute_sketch.o(.text); - asm/decoration.o(.text); + src/decoration.o(.text); asm/slot_machine.o(.text); asm/contest_painting.o(.text); src/battle_ai_script_commands.o(.text); @@ -207,7 +207,7 @@ SECTIONS { asm/battle_anim_815A0D4.o(.text); asm/learn_move.o(.text); asm/fldeff_softboiled.o(.text); - asm/decoration_inventory.o(.text); + src/decoration_inventory.o(.text); src/roamer.o(.text); asm/battle_tower.o(.text); asm/use_pokeblock.o(.text); @@ -258,6 +258,7 @@ SECTIONS { asm/fldeff_groundshake.o(.text); asm/fossil_specials.o(.text); src/berry_fix_program.o(.text); + src/pokemon_summary_screen.o(.text); asm/pokemon_summary_screen.o(.text); asm/pokenav.o(.text); asm/rayquaza_scene.o(.text); @@ -416,7 +417,7 @@ SECTIONS { data/heal_location.o(.rodata); data/region_map.o(.rodata); data/cute_sketch.o(.rodata); - data/decoration.o(.rodata); + src/decoration.o(.rodata); data/slot_machine.o(.rodata); data/contest_painting.o(.rodata); src/battle_ai_script_commands.o(.rodata); diff --git a/src/decoration.c b/src/decoration.c new file mode 100644 index 000000000..0179d36a1 --- /dev/null +++ b/src/decoration.c @@ -0,0 +1,2781 @@ + +// Includes +#include "global.h" +#include "decompress.h" +#include "malloc.h" +#include "string_util.h" +#include "international_string_util.h" +#include "script.h" +#include "task.h" +#include "main.h" +#include "palette.h" +#include "songs.h" +#include "overworld.h" +#include "fieldmap.h" +#include "metatile_behavior.h" +#include "field_weather.h" +#include "field_player_avatar.h" +#include "field_camera.h" +#include "field_screen.h" +#include "field_map_obj.h" +#include "list_menu.h" +#include "menu_helpers.h" +#include "new_menu_helpers.h" +#include "menu_indicators.h" +#include "sound.h" +#include "event_scripts.h" +#include "event_data.h" +#include "region_map.h" +#include "player_pc.h" +#include "strings.h" +#include "tv.h" +#include "secret_base.h" +#include "tilesets.h" +#include "item_icon.h" +#include "trader.h" +#include "map_object_constants.h" +#include "decoration_inventory.h" +#include "decoration.h" +#include "graphics.h" + +// Static type declarations + +#define OVERWORLD_PLACE_DECOR_SELECTOR_PAL_TAG 0xbe5 +#define OVERWORLD_PLACE_DECOR_PLAYER_PAL_TAG 0x008 + +struct DecorPCBuffer { + struct ListMenuItem items[41]; + u8 names[41][24]; + u8 unk_520; + u8 unk_521; + u8 unk_522; +}; + +struct PlaceDecorationGraphicsDataBuffer { + /*0x000; 0x0203a190*/ const struct Decoration *decoration; + /*0x004; 0x0203a194*/ u16 tiles[0x40]; + /*0x084; 0x0203a214*/ u8 image[0x800]; + /*0x884; 0x0203aa14*/ u16 palette[16]; +}; + +struct DecorRearrangementDataBuffer { + u8 idx; + u8 width; + u8 height; + u16 flagId; +}; + +// Static RAM declarations + +EWRAM_DATA u8 *gCurDecorInventoryItems = NULL; +EWRAM_DATA u8 sSecretBasePCMenuCursorPos = 0; +EWRAM_DATA u8 sCurDecorCatCount = 0; +EWRAM_DATA u8 sSecretBaseItemsIndicesBuffer[16] = {}; +EWRAM_DATA u8 sPlayerRoomItemsIndicesBuffer[12] = {}; +EWRAM_DATA u16 sSecretBasePCSelectDecorLineNo = 0; +EWRAM_DATA u16 sSecretBasePCSelectDecorPageNo = 0; +EWRAM_DATA u8 gCurDecorationIndex = 0; +EWRAM_DATA u8 sCurDecorationCategory = DECORCAT_DESK; +EWRAM_DATA u32 filler_0203a174[2] = {}; +EWRAM_DATA struct DecorPCPointers gUnknown_0203A17C = {}; +EWRAM_DATA u8 sDecorMenuWindowIndices[4] = {}; +EWRAM_DATA struct DecorPCBuffer *sDecorPCBuffer = NULL; +EWRAM_DATA struct PlaceDecorationGraphicsDataBuffer sPlaceDecorationGraphicsDataBuffer = {}; +EWRAM_DATA u16 sCurDecorMapX = 0; +EWRAM_DATA u16 sCurDecorMapY = 0; +EWRAM_DATA u8 sDecor_CameraSpriteObjectIdx1 = 0; +EWRAM_DATA u8 sDecor_CameraSpriteObjectIdx2 = 0; +EWRAM_DATA u8 sDecorationLastDirectionMoved = 0; +EWRAM_DATA struct OamData sDecorSelectorOam = {}; +EWRAM_DATA struct DecorRearrangementDataBuffer sDecorRearrangementDataBuffer[16] = {}; +EWRAM_DATA u8 sCurDecorSelectedInRearrangement = 0; + +// Static ROM declarations + +void sub_8126B80(u8 taskId); +void sub_8126C08(void); +void SecretBasePC_Decorate(u8 taskId); +void SecretBasePC_PutAway(u8 taskId); +void SecretBasePC_Toss(u8 taskId); +void sub_8126DA4(u8 taskId); +void SecretBasePC_Cancel(u8 taskId); +void SecretBasePC_PrepMenuForSelectingStoredDecors(u8 taskId); +void sub_8126DFC(u8 taskId); +void sub_8126E8C(u8 taskId); +void sub_8126F68(u8 winid, u8 decorCat, u8 x, u8 y, bool8 flag, u8 speed); +void sub_8127058(u8 *str, bool8 flag); +void sub_8127088(u8 taskId); +void sub_81270E8(u8 taskId); +void sub_8127180(u8 taskId); +void sub_812719C(u8 taskId); +void sub_81271CC(u8 taskId); +void sub_8127268(u8 taskId); +void sub_8127454(u8 *dest, u16 decorId); +void sub_8127480(u32 a0, bool8 flag, struct ListMenu *menu); +void sub_81274A0(u8 a0, s32 a1, u8 a2); +void sub_8127620(u8 taskId); +void sub_812764C(u8 taskId); +void sub_8127744(u32 a0); +void sub_81277A8(void); +bool8 sub_81277BC(u8 idx); +bool8 sub_81277E8(u8 idx); +void IdentifyOwnedDecorationsCurrentlyInUse(u8 taskId); +void sub_812759C(u8 taskId); +void sub_8127718(u8 decorCat); +void sub_8127A30(u8 taskId); +void sub_8127A8C(u8 taskId); +void sub_8127F68(u8 taskId); +void sub_8128060(u8 taskId); +void ConfigureCameraObjectForPlacingDecoration(struct PlaceDecorationGraphicsDataBuffer *data, u8 decor); +void SetUpPlacingDecorationPlayerAvatar(u8 taskId, struct PlaceDecorationGraphicsDataBuffer *data); +void sub_812826C(u8 taskId); +void sub_81283BC(u8 taskId); +void sub_8128414(u8 taskId); +void sub_8128950(u8 taskId); +void sub_81289D0(u8 taskId); +void sub_81289F0(u8 taskId); +void sub_8128AAC(u8 taskId); +void sub_8128B80(u8 taskId); +void sub_8128BA0(u8 taskId); +void sub_8128BBC(u8 taskId); +void c1_overworld_prev_quest(u8 taskId); +void sub_8128CD4(void); +void sub_8128DE0(void); +void sub_8128FD8(u8 taskId); +void sub_8129020(u8 taskId); +void sub_81292D0(struct Sprite *sprite); +void sub_81292E8(struct Sprite *sprite); +u8 gpu_pal_decompress_alloc_tag_and_upload(struct PlaceDecorationGraphicsDataBuffer *data, u8 decor); +const u8 *GetDecorationIconPicOrPalette(u16 decor, u8 mode); +bool8 sub_81299AC(u8 taskId); +void sub_8129ABC(u8 taskId); +void sub_8129B34(u8 taskId); +void sub_8129BCC(u8 taskId); +void sub_8129BF8(u8 taskId); +void sub_8129C74(u8 taskId); +void sub_8129D64(u8 taskId); +void sub_812A0E8(u8 taskId); +void sub_812A1A0(u8 taskId); +void sub_812A1C0(u8 taskId); +void sub_812A1F0(u8 taskId); +void sub_812A210(u8 taskId); +void sub_812A22C(u8 taskId); +void sub_812A25C(u8 taskId); +void sub_812A334(void); +void sub_812A36C(struct Sprite *sprite); +void sub_812A39C(void); +void sub_812A3C8(void); +void sub_812A3D4(u8 taskId); +void sub_812A458(u8 taskId); +void sub_812A478(u8 taskId); + +// .rodata + +#include "data/decoration/tiles.h" +#include "data/decoration/description.h" +#include "data/decoration/header.h" + +const u8 *const sDecorCatNames[] = { + gText_Desk, + gText_Chair, + gText_Plant, + gText_Ornament, + gText_Mat, + gText_Poster, + gText_Doll, + gText_Cushion +}; + +const struct MenuAction sSecretBasePCMenuActions[] = { + { + gText_Decorate, {.void_u8=SecretBasePC_Decorate} + }, { + gText_PutAway, {.void_u8=SecretBasePC_PutAway} + }, { + gText_Toss2, {.void_u8=SecretBasePC_Toss} + }, { + gText_Cancel, {.void_u8=SecretBasePC_Cancel} + } +}; + +const u8 *const sSecretBasePCMenuItemDescriptions[] = { + gText_PutOutSelectedDecorItem, + gText_StoreChosenDecorInPC, + gText_ThrowAwayUnwantedDecors, + gText_GoBackPrevMenu +}; + +void (*const SecretBasePC_SelectedDecorActions[][2])(u8 taskId) = { + { + sub_8127F68, sub_8127A8C + }, { + sub_812A3D4, sub_8127A8C + }, { + sub_8133DA0, sub_8127A8C + } +}; + +const struct WindowTemplate gUnknown_085A6B90[4] = { + { 0, 1, 1, 18, 8, 15, 0x0001 }, + { 0, 1, 1, 13, 18, 13, 0x0091 }, + { 0, 17, 1, 12, 2, 15, 0x017b }, + { 0, 16, 13, 13, 6, 15, 0x0193 } +}; + +const u16 gUnknown_085A6BB0[] = INCBIN_U16("graphics/decorations/unk_85a6bb0.gbapal"); + +const struct ListMenuTemplate gUnknown_085A6BD0 = { + NULL, + sub_8127480, + sub_81274A0, + 0, 0, + 0, 0, 8, 0, + 9, 2, 1, 3, FALSE, 0, FALSE, 7 +}; + +#include "data/decoration/icon.h" +#include "data/decoration/tilemaps.h" + +const struct { + u8 shape; + u8 size; + u8 x; + u8 y; +} gUnknown_085A7250[] = { + {0, 1, 0x78, 0x4e}, + {1, 2, 0x80, 0x4e}, + {1, 3, 0x90, 0x56}, + {1, 3, 0x90, 0x46}, + {0, 2, 0x80, 0x46}, + {2, 2, 0x78, 0x46}, + {2, 3, 0x80, 0x56}, + {2, 3, 0x80, 0x36}, + {0, 3, 0x90, 0x46}, + {1, 3, 0x90, 0x46} +}; + +const union AnimCmd gUnknown_085A7278[] = { + ANIMCMD_FRAME(0, 0, FALSE, FALSE), + ANIMCMD_END +}; + +const union AnimCmd *const sDecorSelectorAnims[] = { + gUnknown_085A7278 +}; + +const struct SpriteFrameImage sDecorSelectorSpriteFrameImages = { + (const u8 *)&sPlaceDecorationGraphicsDataBuffer.image, 0x800 +}; + +const struct SpriteTemplate sDecorSelectorSpriteTemplate = { + 0xffff, + OVERWORLD_PLACE_DECOR_SELECTOR_PAL_TAG, + &sDecorSelectorOam, + sDecorSelectorAnims, + &sDecorSelectorSpriteFrameImages, + gDummySpriteAffineAnimTable, + SpriteCallbackDummy +}; + +const struct SpriteTemplate sDecorWhilePlacingSpriteTemplate = { + 0x0000, + 0x0000, + &sDecorSelectorOam, + sDecorSelectorAnims, + NULL, + gDummySpriteAffineAnimTable, + SpriteCallbackDummy +}; + +const struct SpritePalette gUnknown_085A72BC = { + (const u16 *)&sPlaceDecorationGraphicsDataBuffer.palette, OVERWORLD_PLACE_DECOR_SELECTOR_PAL_TAG +}; + +const struct YesNoFuncTable gUnknown_085A72C4 = { + sub_81289F0, + sub_8128FD8 +}; + +const struct YesNoFuncTable gUnknown_085A72CC = { + sub_8128BA0, + sub_8128FD8 +}; + +const struct YesNoFuncTable gUnknown_085A72D4[] = { + { + sub_81283BC, + sub_8128414 + }, { + sub_8129BCC, + sub_8129BF8 + } +}; + +const u8 gUnknown_085A72E4[] = { + 0x04, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x00 +}; + +const u8 gUnknown_085A72EC[] = { + 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x03, 0x00 +}; + +const u16 gUnknown_085A72F4[] = { + 0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x10, 0x20, 0x40, 0x20 +}; + +const u16 Unknown_085A7308[] = INCBIN_U16("graphics/decorations/unk_85a7308.gbapal"); + +const u16 Unknown_085A7328[] = INCBIN_U16("graphics/decorations/unk_85a7328.gbapal"); + +const struct YesNoFuncTable gUnknown_085A7348 = { + sub_812A1C0, + sub_8129B34 +}; + +const struct YesNoFuncTable gUnknown_085A7350 = { + sub_812A210, + sub_8129B34 +}; + +const u8 Unknown_085A7358[] = INCBIN_U8("graphics/misc/decoration_unk_85a7358.4bpp"); + +const struct SpritePalette gUnknown_085A73D8 = { + Unknown_085A7308, OVERWORLD_PLACE_DECOR_PLAYER_PAL_TAG +}; + +const struct SpritePalette gUnknown_085A73E0 = { + Unknown_085A7328, OVERWORLD_PLACE_DECOR_PLAYER_PAL_TAG +}; + +const struct OamData Unknown_085A73E8 = { + .size = 1, .priority = 1 +}; + +const union AnimCmd Unknown_085A73F0[] = { + ANIMCMD_FRAME(0, 0, 0), + ANIMCMD_END +}; + +const union AnimCmd *const Unknown_085A73F8[] = { + Unknown_085A73F0 +}; + +const struct SpriteFrameImage Unknown_085A73FC = { + Unknown_085A7358, 0x80 +}; + +const struct SpriteTemplate gUnknown_085A7404 = { + 0xFFFF, + OVERWORLD_PLACE_DECOR_PLAYER_PAL_TAG, + &Unknown_085A73E8, + Unknown_085A73F8, + &Unknown_085A73FC, + gDummySpriteAffineAnimTable, + sub_812A36C +}; + +const struct YesNoFuncTable gUnknown_085A741C = { + sub_812A478, + sub_8127A30 +}; + +// .text + +void sub_8126968(void) +{ + if (sCurDecorationCategory < 8) + { + gCurDecorInventoryItems = gDecorationInventories[sCurDecorationCategory].items; + } + if (gUnknown_0203A17C.isPlayerRoom == FALSE) + { + gUnknown_0203A17C.items = gSaveBlock1Ptr->secretBases[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