through sub_810C760
This commit is contained in:
-106
@@ -5,112 +5,6 @@
|
|||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
thumb_func_start sub_810C730
|
|
||||||
sub_810C730: @ 810C730
|
|
||||||
push {lr}
|
|
||||||
lsls r0, 24
|
|
||||||
lsrs r0, 24
|
|
||||||
ldr r2, _0810C758 @ =gTasks
|
|
||||||
lsls r1, r0, 2
|
|
||||||
adds r1, r0
|
|
||||||
lsls r1, 3
|
|
||||||
adds r1, r2
|
|
||||||
ldrh r0, [r1, 0x8]
|
|
||||||
subs r0, 0x1
|
|
||||||
strh r0, [r1, 0x8]
|
|
||||||
lsls r0, 16
|
|
||||||
cmp r0, 0
|
|
||||||
bne _0810C754
|
|
||||||
ldr r0, _0810C75C @ =sub_810C760
|
|
||||||
str r0, [r1]
|
|
||||||
movs r0, 0x10
|
|
||||||
strh r0, [r1, 0xA]
|
|
||||||
_0810C754:
|
|
||||||
pop {r0}
|
|
||||||
bx r0
|
|
||||||
.align 2, 0
|
|
||||||
_0810C758: .4byte gTasks
|
|
||||||
_0810C75C: .4byte sub_810C760
|
|
||||||
thumb_func_end sub_810C730
|
|
||||||
|
|
||||||
thumb_func_start sub_810C760
|
|
||||||
sub_810C760: @ 810C760
|
|
||||||
push {r4,r5,lr}
|
|
||||||
lsls r0, 24
|
|
||||||
lsrs r5, r0, 24
|
|
||||||
lsls r0, r5, 2
|
|
||||||
adds r0, r5
|
|
||||||
lsls r0, 3
|
|
||||||
ldr r1, _0810C7E8 @ =gTasks+0x8
|
|
||||||
adds r4, r0, r1
|
|
||||||
movs r1, 0x4
|
|
||||||
ldrsh r0, [r4, r1]
|
|
||||||
cmp r0, 0x2
|
|
||||||
beq _0810C794
|
|
||||||
ldrh r0, [r4, 0x2]
|
|
||||||
subs r0, 0x1
|
|
||||||
strh r0, [r4, 0x2]
|
|
||||||
lsls r0, 16
|
|
||||||
cmp r0, 0
|
|
||||||
bne _0810C794
|
|
||||||
movs r0, 0x5E
|
|
||||||
bl PlaySE
|
|
||||||
movs r0, 0xB
|
|
||||||
strh r0, [r4, 0x2]
|
|
||||||
ldrh r0, [r4, 0x4]
|
|
||||||
adds r0, 0x1
|
|
||||||
strh r0, [r4, 0x4]
|
|
||||||
_0810C794:
|
|
||||||
movs r0, 0x41
|
|
||||||
bl FieldEffectActiveListContains
|
|
||||||
lsls r0, 24
|
|
||||||
lsrs r0, 24
|
|
||||||
cmp r0, 0
|
|
||||||
bne _0810C7E2
|
|
||||||
strh r0, [r4, 0x2]
|
|
||||||
strh r0, [r4, 0x4]
|
|
||||||
bl sub_810C604
|
|
||||||
ldr r0, _0810C7EC @ =gUnknown_845318C
|
|
||||||
bl sub_810C9A8
|
|
||||||
ldr r1, _0810C7F0 @ =gUnknown_203ADB8
|
|
||||||
ldr r2, [r1]
|
|
||||||
ldr r1, _0810C7F4 @ =0x00000431
|
|
||||||
adds r2, r1
|
|
||||||
lsls r0, 3
|
|
||||||
ldrb r3, [r2]
|
|
||||||
movs r1, 0x7
|
|
||||||
ands r1, r3
|
|
||||||
orrs r1, r0
|
|
||||||
strb r1, [r2]
|
|
||||||
ldr r0, _0810C7F8 @ =gSaveBlock1Ptr
|
|
||||||
ldr r0, [r0]
|
|
||||||
ldrb r1, [r0, 0x5]
|
|
||||||
ldrb r2, [r0, 0x4]
|
|
||||||
ldr r3, _0810C7FC @ =gUnknown_8453F5C
|
|
||||||
movs r0, 0xFF
|
|
||||||
bl ScriptMovement_StartObjectMovementScript
|
|
||||||
ldr r1, _0810C800 @ =gTasks
|
|
||||||
lsls r0, r5, 2
|
|
||||||
adds r0, r5
|
|
||||||
lsls r0, 3
|
|
||||||
adds r0, r1
|
|
||||||
ldr r1, _0810C804 @ =sub_810C8EC
|
|
||||||
str r1, [r0]
|
|
||||||
_0810C7E2:
|
|
||||||
pop {r4,r5}
|
|
||||||
pop {r0}
|
|
||||||
bx r0
|
|
||||||
.align 2, 0
|
|
||||||
_0810C7E8: .4byte gTasks+0x8
|
|
||||||
_0810C7EC: .4byte gUnknown_845318C
|
|
||||||
_0810C7F0: .4byte gUnknown_203ADB8
|
|
||||||
_0810C7F4: .4byte 0x00000431
|
|
||||||
_0810C7F8: .4byte gSaveBlock1Ptr
|
|
||||||
_0810C7FC: .4byte gUnknown_8453F5C
|
|
||||||
_0810C800: .4byte gTasks
|
|
||||||
_0810C804: .4byte sub_810C8EC
|
|
||||||
thumb_func_end sub_810C760
|
|
||||||
|
|
||||||
thumb_func_start sub_810C808
|
thumb_func_start sub_810C808
|
||||||
sub_810C808: @ 810C808
|
sub_810C808: @ 810C808
|
||||||
push {r4-r7,lr}
|
push {r4-r7,lr}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#ifndef GUARD_ITEM_USE_H
|
||||||
|
#define GUARD_ITEM_USE_H
|
||||||
|
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
void sub_80A1E0C(u8);
|
||||||
|
void sub_80A2294(u8, u8, u16, u16);
|
||||||
|
|
||||||
|
#endif //GUARD_ITEM_USE_H
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#ifndef GUARD_VS_SEEKER_H
|
||||||
|
#define GUARD_VS_SEEKER_H
|
||||||
|
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
struct VsSeekerStruct
|
||||||
|
{
|
||||||
|
/*0x000*/ u8 filler_00[0x431];
|
||||||
|
/*0x431*/ u8 unk_431_0:3;
|
||||||
|
u8 unk_431_3:5;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //GUARD_VS_SEEKER_H
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "songs.h"
|
||||||
|
#include "sound.h"
|
||||||
|
#include "task.h"
|
||||||
|
#include "malloc.h"
|
||||||
|
#include "new_menu_helpers.h"
|
||||||
|
#include "item_use.h"
|
||||||
|
#include "event_scripts.h"
|
||||||
|
#include "item_menu.h"
|
||||||
|
#include "field_effect.h"
|
||||||
|
#include "script_movement.h"
|
||||||
|
#include "vs_seeker.h"
|
||||||
|
|
||||||
|
// static types
|
||||||
|
struct UnkStruct_845318C
|
||||||
|
{
|
||||||
|
// TODO: populate
|
||||||
|
};
|
||||||
|
|
||||||
|
// static declarations
|
||||||
|
EWRAM_DATA struct VsSeekerStruct *gUnknown_203ADB8;
|
||||||
|
void sub_810C730(u8 taskId);
|
||||||
|
void sub_810C760(u8 taskId);
|
||||||
|
void sub_810C8EC(u8 taskId);
|
||||||
|
void sub_810C808(void);
|
||||||
|
bool8 sub_810C96C(void);
|
||||||
|
void sub_810C604(void);
|
||||||
|
u8 sub_810C9A8(const void *);
|
||||||
|
|
||||||
|
// rodata
|
||||||
|
extern const struct UnkStruct_845318C gUnknown_845318C[];
|
||||||
|
extern const u8 gUnknown_8453F5C[];
|
||||||
|
|
||||||
|
// text
|
||||||
|
void sub_810C670(u8 taskId)
|
||||||
|
{
|
||||||
|
u8 i;
|
||||||
|
u8 respval;
|
||||||
|
|
||||||
|
for (i = 0; i < 16; i++)
|
||||||
|
gTasks[taskId].data[i] = 0;
|
||||||
|
|
||||||
|
gUnknown_203ADB8 = AllocZeroed(sizeof(struct VsSeekerStruct));
|
||||||
|
sub_810C808();
|
||||||
|
respval = sub_810C96C();
|
||||||
|
if (respval == 0)
|
||||||
|
{
|
||||||
|
Free(gUnknown_203ADB8);
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gUnknown_81C137C, sub_80A1E0C);
|
||||||
|
}
|
||||||
|
else if (respval == 1)
|
||||||
|
{
|
||||||
|
Free(gUnknown_203ADB8);
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gUnknown_81C13D6, sub_80A1E0C);
|
||||||
|
}
|
||||||
|
else if (respval == 2)
|
||||||
|
{
|
||||||
|
sub_80A2294(4, 0, gUnknown_203AD30, 0xffff);
|
||||||
|
FieldEffectStart(FLDEFF_UNK_41); // TODO: name this enum
|
||||||
|
gTasks[taskId].func = sub_810C730;
|
||||||
|
gTasks[taskId].data[0] = 15;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_810C730(u8 taskId)
|
||||||
|
{
|
||||||
|
if (--gTasks[taskId].data[0] == 0)
|
||||||
|
{
|
||||||
|
gTasks[taskId].func = sub_810C760;
|
||||||
|
gTasks[taskId].data[1] = 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_810C760(u8 taskId)
|
||||||
|
{
|
||||||
|
s16 * data = gTasks[taskId].data;
|
||||||
|
|
||||||
|
if (data[2] != 2 && --data[1] == 0)
|
||||||
|
{
|
||||||
|
PlaySE(SE_BASABASA);
|
||||||
|
data[1] = 11;
|
||||||
|
data[2]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!FieldEffectActiveListContains(FLDEFF_UNK_41))
|
||||||
|
{
|
||||||
|
data[1] = 0;
|
||||||
|
data[2] = 0;
|
||||||
|
sub_810C604();
|
||||||
|
gUnknown_203ADB8->unk_431_3 = sub_810C9A8(gUnknown_845318C);
|
||||||
|
ScriptMovement_StartObjectMovementScript(0xFF, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gUnknown_8453F5C);
|
||||||
|
gTasks[taskId].func = sub_810C8EC;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user