diff options
-rw-r--r-- | asm/quest_log.s | 73 | ||||
-rw-r--r-- | src/quest_log.c | 23 |
2 files changed, 23 insertions, 73 deletions
diff --git a/asm/quest_log.s b/asm/quest_log.s index ddde56738..a28cba2dc 100644 --- a/asm/quest_log.s +++ b/asm/quest_log.s @@ -5,79 +5,6 @@ .text - thumb_func_start sub_8114DE8 -sub_8114DE8: @ 8114DE8 - push {r4-r6,lr} - adds r6, r1, 0 - adds r4, r0, 0 - adds r5, r4, 0 - adds r5, 0x8 - ldr r0, _08114E08 @ =gUnknown_8456AA0 - ldrb r1, [r0, 0x1F] - adds r0, r4, 0 - bl sub_8110944 - lsls r0, 24 - cmp r0, 0 - bne _08114E0C - movs r0, 0 - b _08114E5E - .align 2, 0 -_08114E08: .4byte gUnknown_8456AA0 -_08114E0C: - ldrb r0, [r4, 0x8] - cmp r0, 0 - bne _08114E22 - ldrb r0, [r5, 0x1] - cmp r0, 0 - bne _08114E22 - movs r0, 0x1F - strh r0, [r4] - ldr r0, _08114E64 @ =gUnknown_203AF98 - ldrh r0, [r0] - strh r0, [r4, 0x2] -_08114E22: - ldrh r0, [r6] - adds r2, r0, 0 - cmp r2, 0 - beq _08114E2C - strh r0, [r4, 0x4] -_08114E2C: - ldrh r0, [r6, 0x2] - adds r1, r0, 0 - cmp r1, 0 - beq _08114E36 - strh r1, [r4, 0x6] -_08114E36: - cmp r2, 0 - beq _08114E46 - ldrb r2, [r5] - adds r0, r2, 0 - cmp r0, 0xFF - beq _08114E46 - adds r0, r2, 0x1 - strb r0, [r5] -_08114E46: - lsls r0, r1, 16 - cmp r0, 0 - beq _08114E58 - ldrb r1, [r5, 0x1] - adds r0, r1, 0 - cmp r0, 0xFF - beq _08114E58 - adds r0, r1, 0x1 - strb r0, [r5, 0x1] -_08114E58: - ldrb r0, [r6, 0x4] - strb r0, [r5, 0x2] - adds r0, r5, 0x4 -_08114E5E: - pop {r4-r6} - pop {r1} - bx r1 - .align 2, 0 -_08114E64: .4byte gUnknown_203AF98 - thumb_func_end sub_8114DE8 - thumb_func_start sub_8114E68 sub_8114E68: @ 8114E68 push {r4-r6,lr} diff --git a/src/quest_log.c b/src/quest_log.c index d43027e57..593585aac 100644 --- a/src/quest_log.c +++ b/src/quest_log.c @@ -4367,3 +4367,26 @@ const u16 * sub_8114D68(const u16 * a0) UnkTextUtil_StringExpandPlaceholders(gStringVar4, gUnknown_841AF0C); return a0 + 4; } + +u16 * sub_8114DE8(u16 * a0, const u16 * a1) +{ + u16 * r4 = a0; + u8 * r5 = (u8 *)a0 + 8; + if (!sub_8110944(r4, gUnknown_8456AA0[31])) + return NULL; + if (r5[0] == 0 && r5[1] == 0) + { + r4[0] = 31; + r4[1] = gUnknown_203AF98; + } + if (a1[0]) + r4[2] = a1[0]; + if (a1[1]) + r4[3] = a1[1]; + if (a1[0] && r5[0] != 0xFF) + r5[0]++; + if (a1[1] && r5[1] != 0xFF) + r5[1]++; + r5[2] = *((const u8 *)a1 + 4); + return (u16 *)(r5 + 4); +} |