(uichapterstatus) Decompile / extract help box config

This commit is contained in:
Eebit 2022-09-05 00:17:43 -04:00
parent d1ebb11fb1
commit 546d3dcdb6
6 changed files with 117 additions and 105 deletions

View File

@ -215,50 +215,4 @@ _0808DCA8: .4byte sub_808DBC8
THUMB_FUNC_END sub_808DC74
THUMB_FUNC_START sub_808DCAC
sub_808DCAC: @ 0x0808DCAC
push {r4, lr}
adds r4, r0, #0
ldr r0, _0808DCC8 @ 0x06015000
movs r1, #6
bl LoadDialogueBoxGfx
ldr r0, _0808DCCC @ gUnknown_08A01D18
adds r1, r4, #0
bl StartMovingHelpBox
pop {r4}
pop {r0}
bx r0
.align 2, 0
_0808DCC8: .4byte 0x06015000
_0808DCCC: .4byte gUnknown_08A01D18
THUMB_FUNC_END sub_808DCAC
THUMB_FUNC_START sub_808DCD0
sub_808DCD0: @ 0x0808DCD0
push {r4, lr}
movs r4, #1
_0808DCD4:
adds r0, r4, #0
bl GetUnit
adds r1, r0, #0
cmp r1, #0
beq _0808DCEA
ldr r0, [r1]
cmp r0, #0
beq _0808DCEA
adds r0, r1, #0
b _0808DCF2
_0808DCEA:
adds r4, #1
cmp r4, #0x3f
ble _0808DCD4
movs r0, #0
_0808DCF2:
pop {r4}
pop {r1}
bx r1
THUMB_FUNC_END sub_808DCD0
.align 2, 0

View File

@ -1,60 +1,5 @@
.section .data
@ Replacing .incbin "baserom.gba", 0xA01CC4, 0x54
.4byte gUnknown_08A01D18
.4byte gProcScr_08A01CA4 + 0x3c
.4byte 0x00000000
.4byte gUnknown_08A01D18 + 0x38
.4byte 0x06f14424
.4byte 0x00000000
.4byte 0x00000000
.4byte gProcScr_08A01CA4 + 0x20
.4byte gProcScr_08A01CA4 + 0x58
.4byte 0x00000000
.4byte gUnknown_08A01D18 + 0x54
.4byte 0x06f27410
.4byte 0x00000000
.4byte 0x00000000
.4byte gProcScr_08A01CA4 + 0x3c
.4byte gUnknown_08A01D18
.4byte 0x00000000
.4byte gUnknown_08A01D18 + 0x54
.4byte 0x06f38410
.4byte 0x00000000
.4byte 0x00000000
.global gUnknown_08A01D18
gUnknown_08A01D18: @ 0x08A01D18
@ Replacing .incbin "baserom.gba", 0xA01D18, 0x70
.4byte gProcScr_08A01CA4 + 0x58
.4byte gProcScr_08A01CA4 + 0x20
.4byte 0x00000000
.4byte gUnknown_08A01D18 + 0x1c
.4byte 0x06ed2b14
.4byte 0x00000000
.4byte 0x00000000
.4byte gProcScr_08A01CA4 + 0x58
.4byte gProcScr_08A01CA4 + 0x20
.4byte gUnknown_08A01D18
.4byte gUnknown_08A01D18 + 0x38
.4byte 0x06ee2b4c
.4byte 0x00000000
.4byte 0x00000000
.4byte gUnknown_08A01D18 + 0x54
.4byte gUnknown_08A01D18 + 0x54
.4byte gProcScr_08A01CA4 + 0x20
.4byte 0x00000000
.4byte 0x06ef3e88
.4byte 0x00000000
.4byte 0x00000000
.4byte gUnknown_08A01D18 + 0x38
.4byte gUnknown_08A01D18 + 0x38
.4byte gProcScr_08A01CA4 + 0x58
.4byte 0x00000000
.4byte 0x06f07f98
.4byte 0x00000000
.4byte 0x00000000
.global gUnknown_08A01D88
gUnknown_08A01D88: @ 0x08A01D88
.incbin "baserom.gba", 0xA01D88, 0x26

View File

@ -4233,8 +4233,6 @@ void sub_808BB74(void); // ??? (also text related)
// ??? sub_808DB34(???);
// ??? sub_808DBC8(???);
// ??? sub_808DC74(???);
void sub_808DCAC(ProcPtr);
// ??? sub_808DCD0(???);
void sub_808E9D8(int);
// ??? sub_808E9F0(???);
// ??? sub_808EA1C(???);

View File

@ -1,6 +1,8 @@
#ifndef GUARD_UICHAPTERSTATUS_H
#define GUARD_UICHAPTERSTATUS_H
void StartChapterStatusHelpBox(ProcPtr);
// ??? sub_808DCD0(???);
// ??? GetEnemyBossUnit(???);
// ??? CountEnemyBossUnits(???);
int CountUnitsByFaction(int faction);

View File

@ -3255,7 +3255,6 @@ extern unsigned CONST_DATA gMid_Dark;
// extern ??? gUnknown_08A01760
// extern ??? gUnknown_08A01800
// extern ??? gUnknown_08A01818
// extern ??? gUnknown_08A01D18
// extern ??? gUnknown_08A01D88
// extern ??? gUnknown_08A01DAE
// extern ??? gUnknown_08A01DBC

View File

@ -204,6 +204,120 @@ struct ProcCmd CONST_DATA gProcScr_08A01CA4[] = {
PROC_END,
};
extern struct HelpBoxInfo sHelpInfo_ChapterStatus_TurnCount;
extern struct HelpBoxInfo sHelpInfo_ChapterStatus_Funds;
extern struct HelpBoxInfo sHelpInfo_ChapterStatus_AllyUnits;
extern struct HelpBoxInfo sHelpInfo_ChapterStatus_EnemyUnits;
extern struct HelpBoxInfo sHelpInfo_ChapterStatus_Leader;
extern struct HelpBoxInfo sHelpInfo_ChapterStatus_TimePlayed;
struct HelpBoxInfo sHelpInfo_ChapterStatus_Goal = {
&sHelpInfo_ChapterStatus_AllyUnits,
&sHelpInfo_ChapterStatus_TurnCount,
NULL,
&sHelpInfo_ChapterStatus_Leader,
36,
68,
0x6F1, // TODO: msgid "The goal of this chapter.[.]"
NULL,
NULL,
};
struct HelpBoxInfo sHelpInfo_ChapterStatus_TurnCount = {
&sHelpInfo_ChapterStatus_Goal,
&sHelpInfo_ChapterStatus_Funds,
NULL,
&sHelpInfo_ChapterStatus_TimePlayed,
16,
116,
0x6F2, // TODO: msgid "Number of turns played at this[NL]point in the current chapter.[.]"
NULL,
NULL,
};
struct HelpBoxInfo sHelpInfo_ChapterStatus_Funds = {
&sHelpInfo_ChapterStatus_TurnCount,
&sHelpInfo_ChapterStatus_AllyUnits,
NULL,
&sHelpInfo_ChapterStatus_TimePlayed,
16,
132,
0x6F3, // TODO: msgid "Money on hand."
NULL,
NULL,
};
struct HelpBoxInfo sHelpInfo_ChapterStatus_AllyUnits = {
&sHelpInfo_ChapterStatus_Funds,
&sHelpInfo_ChapterStatus_Goal,
NULL,
&sHelpInfo_ChapterStatus_EnemyUnits,
20,
43,
0x6ED, // TODO: msgid "Number of allied units.[.]"
NULL,
NULL,
};
struct HelpBoxInfo sHelpInfo_ChapterStatus_EnemyUnits = {
&sHelpInfo_ChapterStatus_Funds,
&sHelpInfo_ChapterStatus_Goal,
&sHelpInfo_ChapterStatus_AllyUnits,
&sHelpInfo_ChapterStatus_Leader,
76,
43,
0x6EE, // TODO: msgid "Number of enemy units."
NULL,
NULL,
};
struct HelpBoxInfo sHelpInfo_ChapterStatus_Leader = {
&sHelpInfo_ChapterStatus_TimePlayed,
&sHelpInfo_ChapterStatus_TimePlayed,
&sHelpInfo_ChapterStatus_Goal,
NULL,
136,
62,
0x6EF, // TODO: msgid "Name of the army commander.[.]"
NULL,
NULL,
};
struct HelpBoxInfo sHelpInfo_ChapterStatus_TimePlayed = {
&sHelpInfo_ChapterStatus_Leader,
&sHelpInfo_ChapterStatus_Leader,
&sHelpInfo_ChapterStatus_Funds,
NULL,
152,
127,
0x6F0, // TODO: msgid "Total time played."
NULL,
NULL,
};
void StartChapterStatusHelpBox(ProcPtr proc) {
LoadDialogueBoxGfx(OBJ_VRAM1 + 0x1000, 6);
StartMovingHelpBox(&sHelpInfo_ChapterStatus_AllyUnits, proc);
return;
}
struct Unit* sub_808DCD0() {
int i;
for (i = FACTION_BLUE + 1; i < FACTION_GREEN; i++) {
struct Unit* unit = GetUnit(i);
if (!UNIT_IS_VALID(unit)) {
continue;
}
return unit;
}
return NULL;
}
struct Unit* GetEnemyBossUnit() {
int i;
@ -679,7 +793,7 @@ void ChapterStatus_LoopKeyHandler(struct ChapterStatusProc* proc) {
if (gKeyStatusPtr->newKeys & R_BUTTON) {
proc->helpTextActive = 1;
sub_808DCAC(proc);
StartChapterStatusHelpBox(proc);
return;