From ea507b8d43d78a72c89d87ad0467758712a4a990 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 25 Oct 2017 08:41:25 -0400 Subject: [PATCH] sub_80E9780 --- asm/secret_base.s | 46 ----------------------------------------- include/event_scripts.h | 1 + src/secret_base.c | 7 +++++++ 3 files changed, 8 insertions(+), 46 deletions(-) diff --git a/asm/secret_base.s b/asm/secret_base.s index 1a3368e89c..e5aca7fdd5 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -5,52 +5,6 @@ .text - thumb_func_start sub_80E9780 -sub_80E9780: @ 80E9780 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =gSaveBlock1Ptr - mov r8, r0 - lsls r5, r1, 2 - adds r5, r1 - lsls r5, 5 - ldr r4, [r0] - adds r4, r5, r4 - ldr r1, =0x00001a9e - adds r4, r1 - adds r0, r4, 0 - bl sub_80E8DF4 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r6, 0 - adds r1, r4, 0 - bl StringCopyN - movs r1, 0xFF - strb r1, [r0] - mov r1, r8 - ldr r0, [r1] - adds r0, r5 - ldr r1, =0x00001aa9 - adds r0, r1 - ldrb r1, [r0] - adds r0, r6, 0 - bl ConvertInternationalString - ldr r1, =gText_ApostropheSBase - adds r0, r6, 0 - bl StringAppend - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E9780 - thumb_func_start GetSecretBaseMapName GetSecretBaseMapName: @ 80E97EC push {r4,lr} diff --git a/include/event_scripts.h b/include/event_scripts.h index 74502541b7..6e8c4719f5 100755 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -361,5 +361,6 @@ 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[]; #endif //GUARD_EVENT_SCRIPTS_H diff --git a/src/secret_base.c b/src/secret_base.c index 4260b15fe0..f8e2b1efd4 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -570,3 +570,10 @@ void sub_80E9744(void) gScriptResult = FALSE; } } + +u8 *sub_80E9780(u8 *dest, u8 sbId) +{ + *StringCopyN(dest, gSaveBlock1Ptr->secretBases[sbId].trainerName, sub_80E8DF4(gSaveBlock1Ptr->secretBases[sbId].trainerName)) = EOS; + ConvertInternationalString(dest, gSaveBlock1Ptr->secretBases[sbId].language); + return StringAppend(dest, gText_ApostropheSBase); +}