SetLilycoveContestLady

This commit is contained in:
PikalaxALT 2017-09-20 16:49:22 -04:00
parent 44e75e1f03
commit 7c8cbc6b88
3 changed files with 43 additions and 76 deletions

View file

@ -5,58 +5,6 @@
.text
thumb_func_start sub_818E604
sub_818E604: @ 818E604
push {r4,lr}
ldr r4, =gUnknown_0203CD6C
ldr r1, [r4]
movs r0, 0xFF
strb r0, [r1, 0x4]
ldr r0, [r4]
movs r1, 0
strb r1, [r0, 0x2]
ldr r0, [r4]
strb r1, [r0, 0x3]
ldr r0, [r4]
strb r1, [r0, 0xC]
bl Random
ldr r4, [r4]
lsls r0, 16
lsrs r0, 16
movs r1, 0x5
bl __umodsi3
strb r0, [r4, 0xD]
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_818E604
thumb_func_start SetLilycoveContestLady
SetLilycoveContestLady: @ 818E638
push {r4,lr}
ldr r4, =gUnknown_0203CD6C
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r1, =0x00003b58
adds r0, r1
str r0, [r4]
movs r2, 0
movs r1, 0x2
strb r1, [r0]
ldr r0, [r4]
strb r2, [r0, 0x1]
bl sub_818E604
ldr r1, [r4]
ldr r0, =gGameLanguage
ldrb r0, [r0]
strb r0, [r1, 0xE]
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end SetLilycoveContestLady
thumb_func_start sub_818E674
sub_818E674: @ 818E674
push {lr}

View file

@ -670,7 +670,7 @@ enum {
struct LilycoveLadyQuiz
{
/*0x000*/ u8 id;
/*0x001*/ u8 unk_001;
/*0x001*/ u8 phase;
/*0x002*/ u16 unk_002[9];
/*0x014*/ u16 unk_014;
/*0x016*/ u16 unk_016;
@ -686,7 +686,7 @@ struct LilycoveLadyQuiz
struct LilycoveLadyFavour
{
/*0x000*/ u8 id;
/*0x001*/ u8 unk_001;
/*0x001*/ u8 phase;
/*0x002*/ u8 unk_002;
/*0x003*/ u8 unk_003;
/*0x004*/ u8 playerName[8];
@ -699,8 +699,13 @@ struct LilycoveLadyFavour
struct LilycoveLadyContest
{
/*0x000*/ u8 id;
/*0x001*/ u8 filler_001[12];
/*0x00d*/ u8 category; // maybe?
/*0x001*/ u8 phase;
/*0x002*/ u8 fave_pkblk;
/*0x003*/ u8 other_pkblk;
/*0x004*/ u8 playerName[8];
/*0x00c*/ u8 max_sheen;
/*0x00d*/ u8 category;
/*0x00e*/ u8 language;
};
typedef union // TODO
@ -708,12 +713,7 @@ typedef union // TODO
struct LilycoveLadyQuiz quiz;
struct LilycoveLadyFavour favour;
struct LilycoveLadyContest contest;
struct
{
/*0x000*/ u8 id;
/*0x001*/ u8 filler_001[0x217];
} common;
u8 id;
} LilycoveLady;
struct SaveBlock1
@ -800,6 +800,7 @@ struct SaveBlock1
/*0x3B14*/ struct RecordMixingGift recordMixingGift;
/*0x3B24*/ u8 seen2[52];
/*0x3B58*/ LilycoveLady lilycoveLady;
/*0x3B88*/ u8 filler_3B88[0x1E8];
/*0x3D70*/ u8 babyPhrase[24]; // TODO: convert to a struct
// sizeof: 0x3D88
};

View file

@ -44,7 +44,7 @@ extern EWRAM_DATA u16 gScriptItemId;
u8 GetLilycoveLadyId(void)
{
return gSaveBlock1Ptr->lilycoveLady.common.id;
return gSaveBlock1Ptr->lilycoveLady.id;
}
void sub_818D9C0(void)
@ -148,7 +148,7 @@ void SetLilycoveFavourLady(void)
{
gUnknown_0203CD64 = &gSaveBlock1Ptr->lilycoveLady.favour;
gUnknown_0203CD64->id = LILYCOVE_LADY_FAVOUR;
gUnknown_0203CD64->unk_001 = 0;
gUnknown_0203CD64->phase = 0;
gUnknown_0203CD64->playerName[0] = EOS;
gUnknown_0203CD64->unk_002 = 0;
gUnknown_0203CD64->unk_003= 0;
@ -161,17 +161,17 @@ void sub_818DBC4(void)
{
gUnknown_0203CD64 = &gSaveBlock1Ptr->lilycoveLady.favour;
gUnknown_0203CD64->id = LILYCOVE_LADY_FAVOUR;
gUnknown_0203CD64->unk_001 = 0;
gUnknown_0203CD64->phase = 0;
}
u8 sub_818DBE8(void)
{
gUnknown_0203CD64 = &gSaveBlock1Ptr->lilycoveLady.favour;
if (gUnknown_0203CD64->unk_001 == 2)
if (gUnknown_0203CD64->phase == 2)
{
return 2;
}
else if (gUnknown_0203CD64->unk_001 == 1)
else if (gUnknown_0203CD64->phase == 1)
{
return 1;
}
@ -247,7 +247,7 @@ bool8 sub_818DD84(u16 itemId)
gUnknown_0203CD64 = &gSaveBlock1Ptr->lilycoveLady.favour;
len = sub_818DB04(gUnknown_0860B2EC[gUnknown_0203CD64->unk_00c]);
gUnknown_0203CD64->unk_001 = 1;
gUnknown_0203CD64->phase = 1;
sub_818DCAC(gStringVar2, itemId);
gUnknown_0203CD64->itemId = itemId;
sub_818DCF4(gSaveBlock2Ptr->playerName, gUnknown_0203CD64->playerName);
@ -297,14 +297,14 @@ u16 sub_818DEA0(void)
gUnknown_0203CD64 = &gSaveBlock1Ptr->lilycoveLady.favour;
itemId = gUnknown_0860B304[gUnknown_0203CD64->unk_00c];
sub_818DE88(itemId);
gUnknown_0203CD64->unk_001 = 2;
gUnknown_0203CD64->phase = 2;
return itemId;
}
void sub_818DEDC(void)
{
SetLilycoveFavourLady();
gUnknown_0203CD64->unk_001 = 1;
gUnknown_0203CD64->phase = 1;
}
void sub_818DEF4(void)
@ -334,7 +334,7 @@ void SetLilycoveQuizLady(void)
gUnknown_0203CD68 = &gSaveBlock1Ptr->lilycoveLady.quiz;
gUnknown_0203CD68->id = LILYCOVE_LADY_QUIZ;
gUnknown_0203CD68->unk_001 = 0;
gUnknown_0203CD68->phase = 0;
for (i = 0; i < 9; i ++)
{
gUnknown_0203CD68->unk_002[i] = -1;
@ -356,7 +356,7 @@ void sub_818E004(void)
{
gUnknown_0203CD68 = &gSaveBlock1Ptr->lilycoveLady.quiz;
gUnknown_0203CD68->id = LILYCOVE_LADY_QUIZ;
gUnknown_0203CD68->unk_001 = 0;
gUnknown_0203CD68->phase = 0;
gUnknown_0203CD68->unk_02a = 0;
gUnknown_0203CD68->unk_016 = -1;
}
@ -364,11 +364,11 @@ void sub_818E004(void)
u8 sub_818E038(void)
{
gUnknown_0203CD68 = &gSaveBlock1Ptr->lilycoveLady.quiz;
if (gUnknown_0203CD68->unk_001 == 2)
if (gUnknown_0203CD68->phase == 2)
{
return 2;
}
else if (gUnknown_0203CD68->unk_001 == 1)
else if (gUnknown_0203CD68->phase == 1)
{
return 1;
}
@ -605,13 +605,13 @@ void sub_818E358(void)
void sub_818E37C(void)
{
gUnknown_0203CD68 = &gSaveBlock1Ptr->lilycoveLady.quiz;
gUnknown_0203CD68->unk_001 = 1;
gUnknown_0203CD68->phase = 1;
}
void sub_818E39C(void)
{
gUnknown_0203CD68 = &gSaveBlock1Ptr->lilycoveLady.quiz;
gUnknown_0203CD68->unk_001 = 2;
gUnknown_0203CD68->phase = 2;
}
void sub_818E3BC(void)
@ -715,3 +715,21 @@ void sub_818E570(const struct LilycoveLadyQuiz *quiz)
gUnknown_0203CD68->unk_02c = quiz->unk_02c;
}
}
void sub_818E604(void)
{
gUnknown_0203CD6C->playerName[0] = EOS;
gUnknown_0203CD6C->fave_pkblk = 0;
gUnknown_0203CD6C->other_pkblk = 0;
gUnknown_0203CD6C->max_sheen = 0;
gUnknown_0203CD6C->category = Random() % 5;
}
void SetLilycoveContestLady(void)
{
gUnknown_0203CD6C = &gSaveBlock1Ptr->lilycoveLady.contest;
gUnknown_0203CD6C->id = LILYCOVE_LADY_CONTEST;
gUnknown_0203CD6C->phase = 0;
sub_818E604();
gUnknown_0203CD6C->language = gGameLanguage;
}