remaining lilycove lady functions

This commit is contained in:
PikalaxALT 2017-09-20 20:48:32 -04:00
parent faf844f332
commit d263750f19
4 changed files with 61 additions and 116 deletions

View file

@ -5,121 +5,5 @@
.text
thumb_func_start sub_818E8B4
sub_818E8B4: @ 818E8B4
push {lr}
ldr r1, =gUnknown_0203CD6C
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r2, =0x00003b58
adds r0, r2
str r0, [r1]
ldrb r0, [r0, 0x1]
cmp r0, 0x1
beq _0818E8D8
movs r0, 0
b _0818E8DA
.pool
_0818E8D8:
movs r0, 0x1
_0818E8DA:
pop {r1}
bx r1
thumb_func_end sub_818E8B4
thumb_func_start sub_818E8E0
sub_818E8E0: @ 818E8E0
push {r4,lr}
movs r3, 0
ldr r1, =gUnknown_0203CD6C
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r4, =0x00003b58
adds r2, r0, r4
str r2, [r1]
ldrb r0, [r2, 0x2]
cmp r0, 0x4
bhi _0818E8FC
ldrb r0, [r2, 0x3]
cmp r0, 0x4
bls _0818E8FE
_0818E8FC:
movs r3, 0x1
_0818E8FE:
adds r0, r3, 0
pop {r4}
pop {r1}
bx r1
.pool
thumb_func_end sub_818E8E0
thumb_func_start sub_818E914
sub_818E914: @ 818E914
push {lr}
ldr r0, =gStringVar2
ldr r1, =gStringVar1
bl sub_818E794
pop {r0}
bx r0
.pool
thumb_func_end sub_818E914
thumb_func_start sub_818E92C
sub_818E92C: @ 818E92C
push {lr}
ldr r1, =c2_exit_to_overworld_2_switch
movs r0, 0x3
bl sub_81357FC
pop {r0}
bx r0
.pool
thumb_func_end sub_818E92C
thumb_func_start sub_818E940
sub_818E940: @ 818E940
ldr r1, =gUnknown_0203CD6C
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r2, =0x00003b58
adds r0, r2
str r0, [r1]
movs r1, 0x1
strb r1, [r0, 0x1]
bx lr
.pool
thumb_func_end sub_818E940
thumb_func_start sub_818E960
sub_818E960: @ 818E960
ldr r1, =gUnknown_0203CD6C
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r2, =0x00003b58
adds r0, r2
str r0, [r1]
ldr r2, =gSpecialVar_0x8005
ldr r1, =gUnknown_0860B34C
ldrb r0, [r0, 0xD]
lsls r0, 1
adds r0, r1
ldrh r0, [r0]
strh r0, [r2]
bx lr
.pool
thumb_func_end sub_818E960
thumb_func_start sub_818E990
sub_818E990: @ 818E990
ldr r1, =gUnknown_0203CD6C
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r2, =0x00003b58
adds r0, r2
str r0, [r1]
ldrb r0, [r0, 0xD]
bx lr
.pool
thumb_func_end sub_818E990
.align 2, 0 @ Don't pad with nop.

View file

@ -28,5 +28,6 @@ void strange_npc_table_clear(void);
const struct MapHeader *get_mapheader_by_bank_and_number(u8, u8);
void FieldObjectMoveDestCoords(struct MapObject *, u32, s16 *, s16 *);
void sub_8086230(void);
void c2_exit_to_overworld_2_switch(void);
#endif //GUARD_ROM4_H

6
include/rom6.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef GUARD_ROM6_H
#define GUARD_ROM6_H
void sub_81357FC(u8, void(void));
#endif //GUARD_ROM6_H

View file

@ -4,6 +4,8 @@
#include "global.h"
#include "main.h"
#include "rom4.h"
#include "rom6.h"
#include "event_data.h"
#include "script.h"
#include "rng.h"
@ -38,6 +40,7 @@ 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];
extern const u16 gUnknown_0860B34C[5];
EWRAM_DATA struct LilycoveLadyFavour *gUnknown_0203CD64 = NULL;
EWRAM_DATA struct LilycoveLadyQuiz *gUnknown_0203CD68 = NULL;
@ -865,3 +868,54 @@ u8 sub_818E880(void)
return 0;
}
}
bool8 sub_818E8B4(void)
{
gUnknown_0203CD6C = &gSaveBlock1Ptr->lilycoveLady.contest;
if (gUnknown_0203CD6C->phase == 1)
{
return TRUE;
}
return FALSE;
}
bool8 sub_818E8E0(void)
{
bool8 response;
response = FALSE;
gUnknown_0203CD6C = &gSaveBlock1Ptr->lilycoveLady.contest;
if (gUnknown_0203CD6C->fave_pkblk >= 5 || gUnknown_0203CD6C->other_pkblk >= 5)
{
response = TRUE;
}
return response;
}
void sub_818E914(void)
{
sub_818E794(gStringVar2, gStringVar1);
}
void sub_818E92C(void)
{
sub_81357FC(3, c2_exit_to_overworld_2_switch);
}
void sub_818E940(void)
{
gUnknown_0203CD6C = &gSaveBlock1Ptr->lilycoveLady.contest;
gUnknown_0203CD6C->phase = 1;
}
void sub_818E960(void)
{
gUnknown_0203CD6C = &gSaveBlock1Ptr->lilycoveLady.contest;
gSpecialVar_0x8005 = gUnknown_0860B34C[gUnknown_0203CD6C->category];
}
u8 sub_818E990(void)
{
gUnknown_0203CD6C = &gSaveBlock1Ptr->lilycoveLady.contest;
return gUnknown_0203CD6C->category;
}