through sub_818DD14

This commit is contained in:
PikalaxALT 2017-09-19 21:28:01 -04:00
parent f43de6e582
commit 316f9f4d83
3 changed files with 28 additions and 75 deletions

View File

@ -5,79 +5,6 @@
.text
thumb_func_start sub_818DCAC
sub_818DCAC: @ 818DCAC
push {r4,lr}
adds r4, r0, 0
lsls r0, r1, 16
lsrs r0, 16
bl ItemId_GetItem
adds r1, r0, 0
adds r0, r4, 0
bl StringCopy
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_818DCAC
thumb_func_start sub_818DCC8
sub_818DCC8: @ 818DCC8
push {lr}
ldr r2, =gUnknown_0203CD64
ldr r0, =gSaveBlock1Ptr
ldr r1, [r0]
ldr r0, =0x00003b58
adds r1, r0
str r1, [r2]
ldr r0, =gStringVar2
ldrh r1, [r1, 0xE]
bl sub_818DCAC
pop {r0}
bx r0
.pool
thumb_func_end sub_818DCC8
thumb_func_start sub_818DCF4
sub_818DCF4: @ 818DCF4
push {r4,r5,lr}
adds r5, r0, 0
adds r4, r1, 0
adds r0, r4, 0
movs r1, 0xFF
movs r2, 0x8
bl memset
adds r0, r4, 0
adds r1, r5, 0
bl StringCopy7
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_818DCF4
thumb_func_start sub_818DD14
sub_818DD14: @ 818DD14
push {r4,r5,lr}
ldr r5, =gUnknown_0203CD64
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r2, =0x00003b58
adds r1, r0, r2
str r1, [r5]
ldr r1, =0x00003b5c
adds r0, r1
ldr r4, =gStringVar3
adds r1, r4, 0
bl sub_818DCF4
ldr r0, [r5]
ldrb r1, [r0, 0x12]
adds r0, r4, 0
bl ConvertInternationalString
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_818DD14
thumb_func_start sub_818DD54
sub_818DD54: @ 818DD54
ldr r1, =gUnknown_0203CD64

View File

@ -684,7 +684,7 @@ typedef union // TODO
/*0x004*/ u8 unk_004[8];
/*0x00c*/ u8 unk_00c;
/*0x00d*/ u8 filler_00d;
/*0x00e*/ u16 unk_00e;
/*0x00e*/ u16 itemId;
/*0x010*/ u16 unk_010;
/*0x012*/ u8 language;
} favour;

View File

@ -7,6 +7,8 @@
#include "event_data.h"
#include "rng.h"
#include "string_util.h"
#include "item.h"
#include "items.h"
#include "text.h"
#include "lilycove_lady.h"
@ -134,7 +136,7 @@ void SetLilycoveFavourLady(void)
gUnknown_0203CD64->favour.unk_004[0] = EOS;
gUnknown_0203CD64->favour.unk_002 = 0;
gUnknown_0203CD64->favour.unk_003= 0;
gUnknown_0203CD64->favour.unk_00e = 0;
gUnknown_0203CD64->favour.itemId = ITEM_NONE;
gUnknown_0203CD64->favour.language = gGameLanguage;
sub_818DB20();
}
@ -185,3 +187,27 @@ bool8 sub_818DC60(void)
}
return FALSE;
}
void sub_818DCAC(u8 *dest, u16 itemId)
{
StringCopy(dest, ItemId_GetItem(itemId)->name);
}
void sub_818DCC8(void)
{
gUnknown_0203CD64 = &gSaveBlock1Ptr->lilycoveLady;
sub_818DCAC(gStringVar2, gUnknown_0203CD64->favour.itemId);
}
void sub_818DCF4(const u8 *src, u8 *dest)
{
memset(dest, 0xFF, 8);
StringCopy7(dest, src);
}
void sub_818DD14(void)
{
gUnknown_0203CD64 = &gSaveBlock1Ptr->lilycoveLady;
sub_818DCF4(gSaveBlock1Ptr->lilycoveLady.favour.unk_004, gStringVar3);
ConvertInternationalString(gStringVar3, gUnknown_0203CD64->favour.language);
}