From b210d5f86b4c949b8e98c9117bc19b62fe0ed352 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 24 Nov 2017 21:06:46 -0500 Subject: [PATCH] through c3_80BF560 --- asm/wallclock.s | 101 ---------------------------------------------- include/strings.h | 1 + src/wallclock.c | 38 +++++++++++++++-- 3 files changed, 36 insertions(+), 104 deletions(-) diff --git a/asm/wallclock.s b/asm/wallclock.s index 626021067..5c36ae9c7 100644 --- a/asm/wallclock.s +++ b/asm/wallclock.s @@ -5,107 +5,6 @@ .text - thumb_func_start sub_8134DC4 -sub_8134DC4: @ 8134DC4 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r5, 0x94 - lsls r5, 2 - movs r0, 0 - movs r1, 0 - adds r2, r5, 0 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r2, =gText_IsThisTheCorrectTime - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl PrintTextOnWindow - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gUnknown_085B21F4 - adds r1, r5, 0 - movs r2, 0xD - movs r3, 0x1 - bl CreateYesNoMenu - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =c3_80BF560 - str r1, [r0] - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134DC4 - - thumb_func_start c3_80BF560 -c3_80BF560: @ 8134E30 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _08134E56 - cmp r1, 0 - bgt _08134E50 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08134E74 - b _08134E96 -_08134E50: - cmp r1, 0x1 - beq _08134E74 - b _08134E96 -_08134E56: - movs r0, 0x5 - bl PlaySE - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8134EA4 - b _08134E94 - .pool -_08134E74: - movs r0, 0x5 - bl PlaySE - movs r0, 0 - movs r1, 0 - bl sub_8198070 - movs r0, 0 - bl ClearWindowTilemap - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8134CE8 -_08134E94: - str r0, [r1] -_08134E96: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c3_80BF560 - thumb_func_start sub_8134EA4 sub_8134EA4: @ 8134EA4 push {r4,lr} diff --git a/include/strings.h b/include/strings.h index b54c68c6e..030f46330 100644 --- a/include/strings.h +++ b/include/strings.h @@ -84,5 +84,6 @@ extern const u8 gText_RegisteredDataDeleted[]; extern const u8 gUnknown_085EA79D[]; extern const u8 gText_Confirm3[]; extern const u8 gText_Cancel4[]; +extern const u8 gText_IsThisTheCorrectTime[]; #endif //GUARD_STRINGS_H diff --git a/src/wallclock.c b/src/wallclock.c index b6e4096f9..1b11b3137 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -15,6 +15,8 @@ #include "unknown_task.h" #include "task.h" #include "strings.h" +#include "sound.h" +#include "songs.h" #include "decompress.h" // static types @@ -23,8 +25,10 @@ static void sub_8134C9C(void); static void sub_8134CB8(u8 taskId); -void sub_8134DC4(u8 taskId); -void sub_8134CE8(u8 taskId); +static void sub_8134CE8(u8 taskId); +static void sub_8134DC4(u8 taskId); +static void c3_80BF560(u8 taskId); +void sub_8134EA4(u8 taskId); void sub_8134F10(u8 taskId); u16 sub_8134FFC(u16 a0, u8 a1, u8 a2); void sub_813504C(u8 taskId, u8 a1); @@ -674,7 +678,7 @@ static void sub_8134CB8(u8 taskId) } } -void sub_8134CE8(u8 taskId) +static void sub_8134CE8(u8 taskId) { if (gTasks[taskId].data[0] % 6) { @@ -715,3 +719,31 @@ void sub_8134CE8(u8 taskId) } } } + +static void sub_8134DC4(u8 taskId) +{ + SetWindowBorderStyle(0, FALSE, 0x250, 0x0d); + PrintTextOnWindow(0, 1, gText_IsThisTheCorrectTime, 0, 1, 0, NULL); + PutWindowTilemap(0); + schedule_bg_copy_tilemap_to_vram(0); + CreateYesNoMenu(&gUnknown_085B21F4, 0x250, 0x0d, 1); + gTasks[taskId].func = c3_80BF560; +} + +static void c3_80BF560(u8 taskId) +{ + switch (sub_8198C58()) + { + case 0: + PlaySE(SE_SELECT); + gTasks[taskId].func = sub_8134EA4; + break; + case 1: + case -1: + PlaySE(SE_SELECT); + sub_8198070(0, FALSE); + ClearWindowTilemap(0); + gTasks[taskId].func = sub_8134CE8; + break; + } +}