mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +01:00
through sub_80E9668
This commit is contained in:
parent
2dee40a23f
commit
835a04ada8
@ -5,92 +5,6 @@
|
|||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
thumb_func_start sub_80E95D4
|
|
||||||
sub_80E95D4: @ 80E95D4
|
|
||||||
push {r4,r5,lr}
|
|
||||||
ldr r5, =0x0000401f
|
|
||||||
ldr r4, =gUnknown_0858D060
|
|
||||||
ldr r0, =0x00004054
|
|
||||||
bl VarGet
|
|
||||||
lsls r0, 24
|
|
||||||
lsrs r0, 24
|
|
||||||
bl sub_80EA20C
|
|
||||||
lsls r0, 24
|
|
||||||
lsrs r0, 24
|
|
||||||
adds r0, r4
|
|
||||||
ldrb r1, [r0]
|
|
||||||
adds r0, r5, 0
|
|
||||||
bl VarSet
|
|
||||||
pop {r4,r5}
|
|
||||||
pop {r0}
|
|
||||||
bx r0
|
|
||||||
.pool
|
|
||||||
thumb_func_end sub_80E95D4
|
|
||||||
|
|
||||||
thumb_func_start sub_80E9608
|
|
||||||
sub_80E9608: @ 80E9608
|
|
||||||
push {r4-r6,lr}
|
|
||||||
adds r5, r0, 0
|
|
||||||
adds r4, r1, 0
|
|
||||||
movs r3, 0
|
|
||||||
ldrb r0, [r4, 0x3]
|
|
||||||
cmp r3, r0
|
|
||||||
bge _080E9660
|
|
||||||
ldr r6, =sCurSecretBaseId
|
|
||||||
_080E9618:
|
|
||||||
lsls r3, 16
|
|
||||||
asrs r1, r3, 16
|
|
||||||
ldr r2, [r4, 0x10]
|
|
||||||
lsls r0, r1, 1
|
|
||||||
adds r0, r1
|
|
||||||
lsls r0, 2
|
|
||||||
adds r2, r0, r2
|
|
||||||
ldrb r0, [r2, 0x5]
|
|
||||||
cmp r0, 0x8
|
|
||||||
bne _080E9650
|
|
||||||
movs r0, 0
|
|
||||||
ldrsh r1, [r5, r0]
|
|
||||||
ldrh r0, [r2]
|
|
||||||
adds r0, 0x7
|
|
||||||
cmp r1, r0
|
|
||||||
bne _080E9650
|
|
||||||
movs r0, 0x2
|
|
||||||
ldrsh r1, [r5, r0]
|
|
||||||
ldrh r0, [r2, 0x2]
|
|
||||||
adds r0, 0x7
|
|
||||||
cmp r1, r0
|
|
||||||
bne _080E9650
|
|
||||||
ldr r0, [r2, 0x8]
|
|
||||||
strb r0, [r6]
|
|
||||||
b _080E9660
|
|
||||||
.pool
|
|
||||||
_080E9650:
|
|
||||||
movs r1, 0x80
|
|
||||||
lsls r1, 9
|
|
||||||
adds r0, r3, r1
|
|
||||||
lsrs r3, r0, 16
|
|
||||||
asrs r0, 16
|
|
||||||
ldrb r1, [r4, 0x3]
|
|
||||||
cmp r0, r1
|
|
||||||
blt _080E9618
|
|
||||||
_080E9660:
|
|
||||||
pop {r4-r6}
|
|
||||||
pop {r0}
|
|
||||||
bx r0
|
|
||||||
thumb_func_end sub_80E9608
|
|
||||||
|
|
||||||
thumb_func_start sub_80E9668
|
|
||||||
sub_80E9668: @ 80E9668
|
|
||||||
push {lr}
|
|
||||||
bl sub_80E9608
|
|
||||||
bl sub_80E8B6C
|
|
||||||
ldr r0, =gUnknown_08275BB7
|
|
||||||
bl ScriptContext1_SetupScript
|
|
||||||
pop {r0}
|
|
||||||
bx r0
|
|
||||||
.pool
|
|
||||||
thumb_func_end sub_80E9668
|
|
||||||
|
|
||||||
thumb_func_start sub_80E9680
|
thumb_func_start sub_80E9680
|
||||||
sub_80E9680: @ 80E9680
|
sub_80E9680: @ 80E9680
|
||||||
push {lr}
|
push {lr}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#define GUARD_EVENT_SCRIPTS_H
|
#define GUARD_EVENT_SCRIPTS_H
|
||||||
|
|
||||||
extern const u8 gUnknown_0823B4E8[];
|
extern const u8 gUnknown_0823B4E8[];
|
||||||
|
extern const u8 gUnknown_08275BB7[];
|
||||||
extern const u8 gUnknown_08275D0C[];
|
extern const u8 gUnknown_08275D0C[];
|
||||||
extern const u8 gUnknown_08275D1F[];
|
extern const u8 gUnknown_08275D1F[];
|
||||||
extern const u8 gUnknown_08275D2E[];
|
extern const u8 gUnknown_08275D2E[];
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "text.h"
|
#include "text.h"
|
||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
#include "script.h"
|
#include "script.h"
|
||||||
|
#include "event_scripts.h"
|
||||||
#include "event_data.h"
|
#include "event_data.h"
|
||||||
#include "decoration.h"
|
#include "decoration.h"
|
||||||
#include "decoration_inventory.h"
|
#include "decoration_inventory.h"
|
||||||
@ -36,6 +37,8 @@ EWRAM_DATA struct SecretBaseListMenuBuffer *gUnknown_0203A020 = NULL;
|
|||||||
|
|
||||||
// Static ROM declarations
|
// Static ROM declarations
|
||||||
|
|
||||||
|
u8 sub_80EA20C(u8 sbId);
|
||||||
|
|
||||||
// .rodata
|
// .rodata
|
||||||
|
|
||||||
extern const struct {
|
extern const struct {
|
||||||
@ -44,6 +47,7 @@ extern const struct {
|
|||||||
} gUnknown_0858CFCC[7];
|
} gUnknown_0858CFCC[7];
|
||||||
|
|
||||||
extern const u8 gUnknown_0858CFE8[];
|
extern const u8 gUnknown_0858CFE8[];
|
||||||
|
extern const u8 gUnknown_0858D060[];
|
||||||
|
|
||||||
// .text
|
// .text
|
||||||
|
|
||||||
@ -486,3 +490,29 @@ void sub_80E9578(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sub_80E95D4(void)
|
||||||
|
{
|
||||||
|
VarSet(VAR_0x401F, gUnknown_0858D060[sub_80EA20C(VarGet(VAR_0x4054))]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_80E9608(struct Coords16 *coords, struct MapEvents *events)
|
||||||
|
{
|
||||||
|
s16 bgevtidx;
|
||||||
|
|
||||||
|
for (bgevtidx = 0; bgevtidx < events->bgEventCount; bgevtidx ++)
|
||||||
|
{
|
||||||
|
if (events->bgEvents[bgevtidx].kind == 8 && coords->x == events->bgEvents[bgevtidx].x + 7 && coords->y == events->bgEvents[bgevtidx].y + 7)
|
||||||
|
{
|
||||||
|
sCurSecretBaseId = events->bgEvents[bgevtidx].bgUnion.secretBaseId;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_80E9668(struct Coords16 *coords, struct MapEvents *events)
|
||||||
|
{
|
||||||
|
sub_80E9608(coords, events);
|
||||||
|
sub_80E8B6C();
|
||||||
|
ScriptContext1_SetupScript(gUnknown_08275BB7);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user