From 31e0b468c7f859e72e758f3f0fc1051ab887d9a5 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 20 Oct 2017 20:46:26 +0200 Subject: [PATCH] move from raq scene to walda phrase --- asm/rayquaza_scene.s | 21 --------------------- data/specials.inc | 2 +- include/walda_phrase.h | 1 + src/walda_phrase.c | 9 +++++++++ 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/asm/rayquaza_scene.s b/asm/rayquaza_scene.s index 1649f0131..f9936f1ca 100755 --- a/asm/rayquaza_scene.s +++ b/asm/rayquaza_scene.s @@ -5968,26 +5968,5 @@ _081D99B4: bx r0 thumb_func_end sub_81D98B4 - thumb_func_start sub_81D99BC -sub_81D99BC: @ 81D99BC - push {r4,lr} - bl IsWaldaPhraseEmpty - cmp r0, 0 - bne _081D99DC - ldr r4, =gStringVar1 - bl GetWaldaPhrasePtr - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - b _081D99DE - .pool -_081D99DC: - movs r0, 0 -_081D99DE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D99BC .align 2, 0 @ Don't pad with nop. diff --git a/data/specials.inc b/data/specials.inc index 7818d4825..49f6b91a0 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -519,7 +519,7 @@ gSpecials:: @ 81DBA64 def_special sub_813B80C def_special sub_81D4BEC def_special sub_80224D0 - def_special sub_81D99BC + def_special TryBufferWaldaPhrase def_special DoWaldaNamingScreen def_special TryGetWallpaperWithWaldaPhrase def_special sub_8139ED0 diff --git a/include/walda_phrase.h b/include/walda_phrase.h index 7a711a413..3d7701123 100644 --- a/include/walda_phrase.h +++ b/include/walda_phrase.h @@ -1,6 +1,7 @@ #ifndef GUARD_WALDA_PHRASE_H #define GUARD_WALDA_PHRASE_H +u16 TryBufferWaldaPhrase(void); void DoWaldaNamingScreen(void); u16 TryGetWallpaperWithWaldaPhrase(void); diff --git a/src/walda_phrase.c b/src/walda_phrase.c index 21f39f784..7e06d1319 100644 --- a/src/walda_phrase.c +++ b/src/walda_phrase.c @@ -44,6 +44,15 @@ enum PHRASE_FIRST_ATTEMPT }; +u16 TryBufferWaldaPhrase(void) +{ + if (IsWaldaPhraseEmpty()) + return FALSE; + + StringCopy(gStringVar1, GetWaldaPhrasePtr()); + return TRUE; +} + void DoWaldaNamingScreen(void) { StringCopy(gStringVar2, GetWaldaPhrasePtr());