From faf844f332e95d39660db3f76f78ed480d4845bf Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 20 Sep 2017 20:32:22 -0400 Subject: [PATCH] through sub_818E880 --- asm/lilycove_lady.s | 98 --------------------------------------------- src/lilycove_lady.c | 52 +++++++++++++++++++++--- 2 files changed, 47 insertions(+), 103 deletions(-) diff --git a/asm/lilycove_lady.s b/asm/lilycove_lady.s index a3f455065..835d2959c 100644 --- a/asm/lilycove_lady.s +++ b/asm/lilycove_lady.s @@ -5,104 +5,6 @@ .text - thumb_func_start sub_818E7E0 -sub_818E7E0: @ 818E7E0 - push {r4,lr} - adds r3, r1, 0 - ldr r2, =gUnknown_0203CD6C - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r4, =0x00003b58 - adds r1, r4 - str r1, [r2] - ldrb r2, [r1, 0xD] - strb r2, [r0] - ldr r2, =gUnknown_0860B310 - ldrb r0, [r1, 0xD] - lsls r0, 2 - adds r0, r2 - ldr r1, [r0] - adds r0, r3, 0 - bl StringCopy - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E7E0 - - thumb_func_start sub_818E81C -sub_818E81C: @ 818E81C - push {r4,lr} - ldr r3, =gUnknown_0203CD6C - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r4, =0x00003b58 - adds r2, r1, r4 - str r2, [r3] - ldr r2, =0x00003b5c - adds r1, r2 - bl StringCopy - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E81C - - thumb_func_start sub_818E848 -sub_818E848: @ 818E848 - ldr r2, =gUnknown_0203CD6C - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r3, =0x00003b58 - adds r1, r3 - str r1, [r2] - ldrb r1, [r1, 0xE] - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_818E848 - - thumb_func_start sub_818E868 -sub_818E868: @ 818E868 - push {lr} - lsls r1, 24 - ldr r2, =gUnknown_0860B338 - lsrs r1, 22 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E868 - - thumb_func_start sub_818E880 -sub_818E880: @ 818E880 - push {lr} - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0x2] - cmp r0, 0x4 - bls _0818E8A4 - movs r0, 0x1 - b _0818E8AE - .pool -_0818E8A4: - cmp r0, 0 - beq _0818E8AC - movs r0, 0 - b _0818E8AE -_0818E8AC: - movs r0, 0x2 -_0818E8AE: - pop {r1} - bx r1 - thumb_func_end sub_818E880 - thumb_func_start sub_818E8B4 sub_818E8B4: @ 818E8B4 push {lr} diff --git a/src/lilycove_lady.c b/src/lilycove_lady.c index efbc791e8..d142323c4 100644 --- a/src/lilycove_lady.c +++ b/src/lilycove_lady.c @@ -26,17 +26,18 @@ u8 sub_818E13C(void); bool8 sub_818E1F4(void); u8 sub_818E258(const u8 *); +extern const u8 gUnknown_085EEB7E[8]; extern const u16 gUnknown_0860B074[5]; extern const u16 gUnknown_0860B07E[3]; -extern const u8 *const gUnknown_0860B224[]; -extern const u16 *const gUnknown_0860B2EC[6]; -extern const u16 gUnknown_0860B304[6]; extern const u16 *const gUnknown_0860B1A4[16]; extern const u16 gUnknown_0860B1E4[16]; extern const u16 gUnknown_0860B204[16]; -extern const u8 gUnknown_085EEB7E[8]; -extern const u8 *const gUnknown_0860B324[5]; +extern const u8 *const gUnknown_0860B224[]; +extern const u16 *const gUnknown_0860B2EC[6]; +extern const u16 gUnknown_0860B304[6]; extern const u8 *const gUnknown_0860B310[5]; +extern const u8 *const gUnknown_0860B324[5]; +extern const u8 *const gUnknown_0860B338[5]; EWRAM_DATA struct LilycoveLadyFavour *gUnknown_0203CD64 = NULL; EWRAM_DATA struct LilycoveLadyQuiz *gUnknown_0203CD68 = NULL; @@ -823,3 +824,44 @@ void sub_818E794(u8 *dest1, u8 *dest2) StringCopy(dest1, gUnknown_0860B324[gUnknown_0203CD6C->category]); StringCopy10(dest2, gUnknown_0860B310[gUnknown_0203CD6C->category]); } + +void sub_818E7E0(u8 *dest1, u8 *dest2) +{ + gUnknown_0203CD6C = &gSaveBlock1Ptr->lilycoveLady.contest; + *dest1 = gUnknown_0203CD6C->category; + StringCopy(dest2, gUnknown_0860B310[gUnknown_0203CD6C->category]); +} + +void sub_818E81C(u8 *dest) +{ + gUnknown_0203CD6C = &gSaveBlock1Ptr->lilycoveLady.contest; + StringCopy(dest, gUnknown_0203CD6C->playerName); +} + +void sub_818E848(u8 *dest) +{ + gUnknown_0203CD6C = &gSaveBlock1Ptr->lilycoveLady.contest; + *dest = gUnknown_0203CD6C->language; +} + +void sub_818E868(u8 *dest, u8 category) +{ + StringCopy(dest, gUnknown_0860B338[category]); +} + +u8 sub_818E880(void) +{ + gUnknown_0203CD6C = &gSaveBlock1Ptr->lilycoveLady.contest; + if (gUnknown_0203CD6C->fave_pkblk >= 5) + { + return 1; + } + else if (gUnknown_0203CD6C->fave_pkblk == 0) + { + return 2; + } + else + { + return 0; + } +}