diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2017-06-04 17:47:55 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2017-06-04 17:47:55 -0400 |
commit | 7e8308fbd3fb19e096ca5072c5c5591e096fadd8 (patch) | |
tree | 9659af91c2d5248f16fa7b31bed3038012ff7c94 | |
parent | be3833002afbd5e38bbcd11a5d410af400783173 (diff) |
sub_8100C88
-rwxr-xr-x | asm/decoration.s | 84 | ||||
-rwxr-xr-x | include/decoration.h | 2 | ||||
-rwxr-xr-x | src/decoration.c | 33 |
3 files changed, 35 insertions, 84 deletions
diff --git a/asm/decoration.s b/asm/decoration.s index 09b374b6d..159b2eb03 100755 --- a/asm/decoration.s +++ b/asm/decoration.s @@ -8,90 +8,6 @@ .equiv ewram_1f000, 0x0201f000 - thumb_func_start sub_8100C88 -sub_8100C88: @ 8100C88 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, _08100CAC @ =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0xC - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _08100CC4 - cmp r0, 0x1 - bgt _08100CB0 - cmp r0, 0 - beq _08100CBA - b _08100D24 - .align 2, 0 -_08100CAC: .4byte gTasks -_08100CB0: - cmp r0, 0x2 - beq _08100CF4 - cmp r0, 0x3 - beq _08100D08 - b _08100D24 -_08100CBA: - bl sub_8100B6C - movs r0, 0x1 - strh r0, [r5, 0xC] - b _08100D24 -_08100CC4: - ldr r0, _08100CEC @ =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08100D24 - bl DrawWholeMapView - ldr r0, _08100CF0 @ =gUnknown_081A2F8A - bl ScriptContext1_SetupScript - movs r0, 0 - movs r1, 0 - movs r2, 0x1D - movs r3, 0x13 - bl MenuZeroFillWindowRect - movs r0, 0x2 - strh r0, [r5, 0xC] - b _08100D24 - .align 2, 0 -_08100CEC: .4byte gPaletteFade -_08100CF0: .4byte gUnknown_081A2F8A -_08100CF4: - bl ScriptContext2_Enable - adds r0, r4, 0 - bl sub_80FED90 - bl pal_fill_black - movs r0, 0x3 - strh r0, [r5, 0xC] - b _08100D24 -_08100D08: - bl sub_807D770 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08100D24 - ldr r0, _08100D2C @ =0x0000ffff - strh r0, [r5, 0x22] - ldr r1, _08100D30 @ =gSecretBaseText_DecorReturned - ldr r2, _08100D34 @ =sub_81010F0 - adds r0, r4, 0 - movs r3, 0 - bl DisplayItemMessageOnField -_08100D24: - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_08100D2C: .4byte 0x0000ffff -_08100D30: .4byte gSecretBaseText_DecorReturned -_08100D34: .4byte sub_81010F0 - thumb_func_end sub_8100C88 - thumb_func_start sub_8100D38 sub_8100D38: @ 8100D38 push {r4,r5,lr} diff --git a/include/decoration.h b/include/decoration.h index 606f99108..594f7ef11 100755 --- a/include/decoration.h +++ b/include/decoration.h @@ -209,6 +209,7 @@ extern struct Decoration gDecorations[0x77]; extern struct UnkStruct_02038900 gUnknown_02038900; extern u8 *gUnknown_020388D0; extern Script gUnknown_081A2F7B; +extern Script gUnknown_081A2F8A; extern struct OamData gUnknown_020391AC; extern u8 gUnknown_020388D4; @@ -304,6 +305,7 @@ void sub_81009A8(struct Sprite *); void sub_81009C0(struct Sprite *); bool8 sub_8100D38(u8); void sub_8100E70(u8); +void sub_81010F0(u8); void sub_81016F4(void); #endif // GUARD_DECORATION_H diff --git a/src/decoration.c b/src/decoration.c index c5c9b6b6d..6e8ba51e3 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -2114,3 +2114,36 @@ void sub_8100B6C(void) } } } + +void sub_8100C88(u8 taskId) +{ + switch (gTasks[taskId].data[2]) + { + case 0: + sub_8100B6C(); + gTasks[taskId].data[2] = 1; + break; + case 1: + if (!gPaletteFade.active) + { + DrawWholeMapView(); + ScriptContext1_SetupScript(gUnknown_081A2F8A); + MenuZeroFillWindowRect(0, 0, 29, 19); + gTasks[taskId].data[2] = 2; + } + break; + case 2: + ScriptContext2_Enable(); + sub_80FED90(taskId); + pal_fill_black(); + gTasks[taskId].data[2] = 3; + break; + case 3: + if (sub_807D770() == 1) + { + gTasks[taskId].data[13] = -1; + DisplayItemMessageOnField(taskId, gSecretBaseText_DecorReturned, sub_81010F0, 0); + } + break; + } +} |