sub_8123F30

This commit is contained in:
PikalaxALT 2017-10-30 21:47:37 -04:00
parent 7b6792230a
commit ccbeaccc9b
3 changed files with 31 additions and 57 deletions

View File

@ -5,61 +5,6 @@
.text
thumb_func_start sub_8123F04
sub_8123F04: @ 8123F04
push {lr}
ldr r0, =0x00004037
bl VarGet
subs r0, 0x1
lsls r0, 16
lsrs r1, r0, 16
cmp r1, 0xF
bls _08123F18
movs r1, 0
_08123F18:
ldr r0, =gUnknown_085A1B8A
lsls r1, 16
asrs r1, 15
adds r1, r0
ldrh r0, [r1]
pop {r1}
bx r1
.pool
thumb_func_end sub_8123F04
thumb_func_start sub_8123F30
sub_8123F30: @ 8123F30
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
ldr r0, =0x00004037
bl VarGet
lsls r0, 16
lsrs r1, r0, 16
ldr r2, =0xfff70000
adds r0, r2
lsrs r0, 16
cmp r0, 0x7
bls _08123F4C
movs r1, 0x9
_08123F4C:
subs r1, 0x9
lsls r1, 16
ldr r0, =gUnknown_085A1BAC
lsrs r1, 14
adds r1, r0
ldrh r0, [r1]
adds r0, 0x1
strh r0, [r4]
ldrh r0, [r1, 0x2]
adds r0, 0x2
strh r0, [r5]
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_8123F30
thumb_func_start sub_8123F74
sub_8123F74: @ 8123F74
push {lr}

View File

@ -27,13 +27,14 @@
#define VAR_POISON_STEP_COUNTER 0x402B
#define VAR_RESET_RTC_ENABLE 0x402C
#define VAR_0x4037 0x4037
#define VAR_DAYS 0x4040
#define VAR_DEPT_STORE_FLOOR 0x4043
#define VAR_STORAGE_UNKNOWN 0x4036
#define VAR_POKELOT_PRIZE 0x4045
#define VAR_NATIONAL_DEX 0x4046
#define VAR_SEEDOT_SIZE_RECORD 0x4047
#define VAR_SEEDOT_SIZE_RECORD 0x4047
#define VAR_ASH_GATHER_COUNT 0x4048
#define VAR_BIRCH_STATE 0x4049
#define VAR_CRUISE_STEP_COUNT 0x404A

View File

@ -69,8 +69,10 @@ extern const u8 gUnknown_0859F77C[];
extern const u8 gUnknown_085A04E0[];
extern const u8 gUnknown_085A096C[];
extern const struct RegionMapLocation gRegionMapEntries[];
extern const u16 gUnknown_085A1B84[];
extern const u16 gUnknown_085A1B24[][2];
extern const u16 gUnknown_085A1B84[];
extern const u16 gUnknown_085A1B8A[];
extern const struct UCoords16 gUnknown_085A1BAC[];
// .text
@ -841,3 +843,29 @@ u16 sub_8123EB4(u16 mapSecId)
}
return mapSecId;
}
u16 sub_8123F04(void)
{
s16 idx;
idx = VarGet(VAR_0x4037) - 1;
if (idx < 0 || idx > 15)
{
idx = 0;
}
return gUnknown_085A1B8A[idx];
}
void sub_8123F30(u16 *x, u16 *y)
{
u16 idx;
idx = VarGet(VAR_0x4037);
if (idx < 9 || idx > 16)
{
idx = 9;
}
idx -= 9;
*x = gUnknown_085A1BAC[idx].x + MAPCURSOR_X_MIN;
*y = gUnknown_085A1BAC[idx].y + MAPCURSOR_Y_MIN;
}