summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2018-10-10 11:25:05 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2018-10-10 11:25:05 -0400
commit572929c3523aeb2f563821f07724f5356df61d76 (patch)
treebfb41a278649b70a5677d08ade65fa1f18fda738
parenta7a6457014c93b3314c6fc8bfe9be1b3c6e946d5 (diff)
sub_8110BB0
-rw-r--r--asm/quest_log.s31
-rw-r--r--include/global.h10
-rw-r--r--src/quest_log.c16
3 files changed, 21 insertions, 36 deletions
diff --git a/asm/quest_log.s b/asm/quest_log.s
index 40689ba5e..3a4b5eb8e 100644
--- a/asm/quest_log.s
+++ b/asm/quest_log.s
@@ -5,37 +5,6 @@
.text
- thumb_func_start sub_8110BB0
-sub_8110BB0: @ 8110BB0
- lsls r0, 24
- lsrs r0, 24
- ldr r2, _08110BE4 @ =gSaveBlock1Ptr
- movs r1, 0xCD
- lsls r1, 3
- muls r1, r0
- movs r0, 0x98
- lsls r0, 5
- adds r1, r0
- ldr r0, [r2]
- adds r1, r0, r1
- ldrb r0, [r0, 0x4]
- strb r0, [r1, 0x1]
- ldr r0, [r2]
- ldrb r0, [r0, 0x5]
- strb r0, [r1, 0x2]
- ldr r0, [r2]
- ldrb r0, [r0, 0x6]
- strb r0, [r1, 0x3]
- ldr r2, [r2]
- ldrh r0, [r2]
- strh r0, [r1, 0x4]
- ldrh r0, [r2, 0x2]
- strh r0, [r1, 0x6]
- bx lr
- .align 2, 0
-_08110BE4: .4byte gSaveBlock1Ptr
- thumb_func_end sub_8110BB0
-
thumb_func_start sub_8110BE8
sub_8110BE8: @ 8110BE8
push {r4-r7,lr}
diff --git a/include/global.h b/include/global.h
index 907dc7eaa..4efd21e48 100644
--- a/include/global.h
+++ b/include/global.h
@@ -476,7 +476,13 @@ struct MysteryEventStruct
struct QuestLog
{
- /*0x0000*/ u8 filler_000[0x568];
+ /*0x0000*/ u8 unk_000;
+ /*0x0001*/ s8 unk_001;
+ /*0x0002*/ s8 unk_002;
+ /*0x0003*/ s8 unk_003;
+ /*0x0004*/ s16 unk_004;
+ /*0x0006*/ s16 unk_006;
+ /*0x0008*/ u8 filler_008[0x560];
/*0x0568*/ u8 filler_568[0x100];
/*0x0668*/ u8 end[0];
};
@@ -489,7 +495,7 @@ struct QuestLog
struct SaveBlock1
{
- /*0x0000*/ u8 filler[0x4];
+ /*0x0000*/ struct Coords16 pos;
/*0x0004*/ struct WarpData location;
/*0x0C*/ struct WarpData warp1;
/*0x14*/ struct WarpData warp2;
diff --git a/src/quest_log.c b/src/quest_log.c
index 3a5ca7b30..900194040 100644
--- a/src/quest_log.c
+++ b/src/quest_log.c
@@ -154,7 +154,7 @@ void sub_8110AB4(void)
u8 sub_8110AC8(void)
{
- return gSaveBlock1Ptr->questLog[gUnknown_203ADF8].filler_000[0];
+ return gSaveBlock1Ptr->questLog[gUnknown_203ADF8].unk_000;
}
void sub_8110AEC(u16 a0)
@@ -166,9 +166,9 @@ void sub_8110AEC(u16 a0)
sub_8113B88();
gUnknown_203AE08 = gSaveBlock1Ptr->questLog[gUnknown_203ADF8].filler_568;
if ((a0 >= 12 && a0 < 20) || a0 == 35)
- gSaveBlock1Ptr->questLog[gUnknown_203ADF8].filler_000[0] = 2;
+ gSaveBlock1Ptr->questLog[gUnknown_203ADF8].unk_000 = 2;
else
- gSaveBlock1Ptr->questLog[gUnknown_203ADF8].filler_000[0] = 1;
+ gSaveBlock1Ptr->questLog[gUnknown_203ADF8].unk_000 = 1;
sub_81115E8();
sub_8110BB0(gUnknown_203ADF8);
sub_8110BE8(gUnknown_203ADF8);
@@ -180,3 +180,13 @@ void sub_8110AEC(u16 a0)
sub_8110E68(gUnknown_203AE98);
sub_81109CC(1);
}
+
+void sub_8110BB0(u8 a0)
+{
+ struct QuestLog * questLog = &gSaveBlock1Ptr->questLog[a0];
+ questLog->unk_001 = gSaveBlock1Ptr->location.mapGroup;
+ questLog->unk_002 = gSaveBlock1Ptr->location.mapNum;
+ questLog->unk_003 = gSaveBlock1Ptr->location.warpId;
+ questLog->unk_004 = gSaveBlock1Ptr->pos.x;
+ questLog->unk_006 = gSaveBlock1Ptr->pos.y;
+}