diff --git a/asm/secret_base.s b/asm/secret_base.s index 2446d9a8b..c51eeb6d1 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -5,130 +5,6 @@ .text - thumb_func_start sub_80E9FFC -sub_80E9FFC: @ 80E9FFC - 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 - ldrb r0, [r4, 0xC] - movs r1, 0 - bl sub_819746C - ldrb r0, [r4, 0xE] - movs r1, 0 - bl sub_819746C - ldrb r0, [r4, 0xC] - bl ClearWindowTilemap - ldrb r0, [r4, 0xE] - bl ClearWindowTilemap - ldrb r0, [r4, 0xE] - bl RemoveWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gStringVar1 - ldrb r1, [r4, 0x8] - bl sub_80E9780 - ldr r4, =gStringVar4 - ldr r1, =gText_OkayToDeleteFromRegistry - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, =sub_80EA06C - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9FFC - - thumb_func_start sub_80EA06C -sub_80EA06C: @ 80EA06C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_0858D058 - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EA06C - - thumb_func_start sub_80EA08C -sub_80EA08C: @ 80EA08C - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - ldr r0, =gTasks + 0x8 - mov r8, r0 - adds r6, r5, r0 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - ldrb r0, [r6, 0xA] - adds r1, r6, 0x4 - mov r9, r1 - adds r1, r6, 0x2 - mov r10, r1 - mov r1, r9 - mov r2, r10 - bl sub_81AE6C8 - ldr r0, =gSaveBlock1Ptr - ldr r2, [r0] - movs r0, 0x8 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 5 - adds r2, r0 - ldr r1, =0x00001a9d - adds r2, r1 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - bl game_continue - ldrb r2, [r6, 0x6] - ldrb r3, [r6] - mov r0, r9 - mov r1, r10 - bl sub_812225C - adds r0, r4, 0 - bl sub_80E9E00 - movs r0, 0x8 - negs r0, r0 - add r8, r0 - add r5, r8 - ldr r0, =sub_80E9E90 - str r0, [r5] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EA08C - thumb_func_start sub_80EA120 sub_80EA120: @ 80EA120 push {lr} diff --git a/include/event_scripts.h b/include/event_scripts.h index 84067516a..bc942bec3 100755 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -361,7 +361,4 @@ extern const u8 gPokeNewsTextLilycove_Ending[]; extern const u8 gPokeNewsTextBlendMaster_Upcoming[]; extern const u8 gPokeNewsTextBlendMaster_Ongoing[]; extern const u8 gPokeNewsTextBlendMaster_Ending[]; -extern const u8 gText_ApostropheSBase[]; -extern const u8 gText_NoRegistry[]; - #endif //GUARD_EVENT_SCRIPTS_H diff --git a/include/strings.h b/include/strings.h index 191b1809a..abbbb1edc 100644 --- a/include/strings.h +++ b/include/strings.h @@ -70,5 +70,8 @@ extern const u8 gText_Cushion[]; extern const u8 gText_Decorate[]; extern const u8 gText_PutAway[]; extern const u8 gText_Toss2[]; +extern const u8 gText_ApostropheSBase[]; +extern const u8 gText_NoRegistry[]; +extern const u8 gText_OkayToDeleteFromRegistry[]; #endif //GUARD_STRINGS_H diff --git a/src/secret_base.c b/src/secret_base.c index 9876c7ade..78647f8a0 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -7,6 +7,7 @@ #include "list_menu.h" #include "window.h" #include "menu.h" +#include "menu_helpers.h" #include "new_menu_helpers.h" #include "menu_indicators.h" #include "map_constants.h" @@ -53,6 +54,7 @@ void sub_80E9E44(u8 taskId); void sub_80E9E90(u8 taskId); void sub_80E9F20(u8 taskId); void sub_80E9FB0(u8 taskId); +void sub_80EA06C(u8 taskId); void task_pc_turn_off(u8 taskId); u8 sub_80EA18C(u8 sbId); u8 sub_80EA20C(u8 sbId); @@ -69,6 +71,7 @@ extern const u8 gUnknown_0858D060[]; extern const struct WindowTemplate gUnknown_0858D06C[]; extern const struct ListMenuTemplate gUnknown_0858D07C; extern const struct MenuAction gUnknown_0858D048[]; +extern const struct YesNoFuncTable gUnknown_0858D058; // .text @@ -1125,3 +1128,39 @@ void sub_80E9FB0(u8 taskId) break; } } + +void sub_80E9FFC(u8 taskId) +{ + s16 *data; + + data = gTasks[taskId].data; + sub_819746C(data[6], FALSE); + sub_819746C(data[7], FALSE); + ClearWindowTilemap(data[6]); + ClearWindowTilemap(data[7]); + RemoveWindow(data[7]); + schedule_bg_copy_tilemap_to_vram(0); + sub_80E9780(gStringVar1, data[4]); + StringExpandPlaceholders(gStringVar4, gText_OkayToDeleteFromRegistry); + DisplayItemMessageOnField(taskId, gStringVar4, sub_80EA06C); +} + +void sub_80EA06C(u8 taskId) +{ + sub_8197930(); + sub_8121F68(taskId, &gUnknown_0858D058); +} + +void sub_80EA08C(u8 taskId) +{ + s16 *data; + + data = gTasks[taskId].data; + sub_8197434(0, 0); + sub_81AE6C8(data[5], &data[2], &data[1]); + gSaveBlock1Ptr->secretBases[data[4]].sbr_field_1_6 = 0; + game_continue(taskId); + sub_812225C(&data[2], &data[1], data[3], data[0]); + sub_80E9E00(taskId); + gTasks[taskId].func = sub_80E9E90; +}