mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-04 00:20:10 -04:00
chore(decomp): commit in-tree banked work before the serial lane
This commit is contained in:
@@ -297,7 +297,87 @@ INCLUDE_RODATA("asm/md_SC03_076/nonmatchings/md_SC03_076", D_801EF540);
|
||||
|
||||
INCLUDE_ASM("asm/md_SC03_076/nonmatchings/md_SC03_076", func_801EFBB4);
|
||||
|
||||
INCLUDE_ASM("asm/md_SC03_076/nonmatchings/md_SC03_076", func_801F0210);
|
||||
void func_801F0210(void) {
|
||||
typedef struct { u32 *ot; u32 pad[4]; } Env_801F1520; /* 0x14 stride */
|
||||
typedef struct { u16 f0; u16 f2; } Prim4_801F1520;
|
||||
typedef struct {
|
||||
s16 f0; /* 0x00 */
|
||||
s16 f2; /* 0x02 */
|
||||
void *f4; /* 0x04 */
|
||||
void *f8; /* 0x08 */
|
||||
s16 fC; /* 0x0C */
|
||||
s16 fE; /* 0x0E */
|
||||
s16 f10; /* 0x10 */
|
||||
s16 f12; /* 0x12 */
|
||||
void *f14; /* 0x14 */
|
||||
Prim4_801F1520 *f18; /* 0x18 */
|
||||
void *f1C; /* 0x1C */
|
||||
} Panel_801F1520; /* 0x20 stride */
|
||||
|
||||
extern Env_801F1520 D_800AE7BC[];
|
||||
extern s16 D_8011512C;
|
||||
extern Panel_801F1520 *D_80115134;
|
||||
extern s32 D_801151D0;
|
||||
extern s16 D_800B9A02;
|
||||
|
||||
extern s32 *func_801F1520(s32 *out);
|
||||
extern s32 func_801F03C0(s32 ot, u8 *s, s16 c);
|
||||
extern s32 func_8005A600(s32, s32, s32, s32, s32);
|
||||
|
||||
s32 ot;
|
||||
Panel_801F1520 *s2;
|
||||
s16 n;
|
||||
s16 i;
|
||||
|
||||
ot = D_801151D0;
|
||||
s2 = D_80115134;
|
||||
|
||||
if (D_8011512C == 1 || D_8011512C == 2) {
|
||||
ot = (s32)func_801F1520((s32 *)ot);
|
||||
}
|
||||
|
||||
switch (D_8011512C) {
|
||||
case 0:
|
||||
case 5:
|
||||
case 8:
|
||||
case 9:
|
||||
n = 1;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
n = 5;
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 10:
|
||||
case 11:
|
||||
n = 5;
|
||||
goto CALL;
|
||||
case 6:
|
||||
case 7:
|
||||
case 12:
|
||||
n = 1;
|
||||
CALL:
|
||||
ot = func_801F03C0(ot, (u8 *)(s2 + 5), 0);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
ot = func_801F03C0(ot, (u8 *)s2, i);
|
||||
s2 += 1;
|
||||
}
|
||||
|
||||
func_8005A600(ot, 0, 0, 0x15, 0);
|
||||
|
||||
*(s32 *)ot = 0x02000000;
|
||||
*(s32 *)ot = (D_800AE7BC[*(u16 *)&D_800B9A02].ot[2] & 0xFFFFFF) | 0x02000000;
|
||||
D_800AE7BC[*(u16 *)&D_800B9A02].ot[2] =
|
||||
(D_800AE7BC[*(u16 *)&D_800B9A02].ot[2] & 0xFF000000) | ((u32)ot & 0xFFFFFF);
|
||||
|
||||
ot += 0x28;
|
||||
((struct { s32 f; } *)&D_801151D0)->f = ot;
|
||||
}
|
||||
|
||||
|
||||
typedef struct { s8 c[8]; } Blk8_8012C890_8017C348_801F03C0;
|
||||
typedef struct { s16 m[3][3]; s32 t[3]; } MTX_C974_801F03C0;
|
||||
|
||||
@@ -440,7 +440,157 @@ INCLUDE_ASM("asm/md_SC03_135/nonmatchings/md_SC03_135", func_801E38B4);
|
||||
|
||||
INCLUDE_ASM("asm/md_SC03_135/nonmatchings/md_SC03_135", func_801E3C1C);
|
||||
|
||||
INCLUDE_ASM("asm/md_SC03_135/nonmatchings/md_SC03_135", func_801E40A8);
|
||||
typedef struct {
|
||||
char c[3];
|
||||
} Blk3_801E40A8;
|
||||
|
||||
extern char *strcpy(char *, const char *);
|
||||
extern u32 func_801E45C0(s32 a0, s32 a1);
|
||||
extern void func_801E4628(val, n, dst, flag);
|
||||
|
||||
extern void *D_801EAC58[]; /* status ptr per slot */
|
||||
extern void *D_801E6424[]; /* HUD prim ptr array per slot */
|
||||
extern char *D_801E632C[]; /* label strings */
|
||||
extern s32 D_801E65B8[]; /* level thresholds */
|
||||
extern u16 *D_801E6390[]; /* icon tables */
|
||||
extern char *D_801E634C;
|
||||
extern Blk3_801E40A8 D_801E26C0;
|
||||
|
||||
void func_801E40A8(void) {
|
||||
s16 k;
|
||||
s16 i;
|
||||
s16 j;
|
||||
u8 *p;
|
||||
void **arr;
|
||||
u32 a;
|
||||
u32 b;
|
||||
s32 r;
|
||||
s32 n;
|
||||
u16 *ico;
|
||||
|
||||
for (k = 0; k < 4; k++) {
|
||||
p = (u8 *)D_801EAC58[k];
|
||||
arr = (void **)D_801E6424[k];
|
||||
if (p != NULL) {
|
||||
for (i = 0; i < 7; i++) {
|
||||
strcpy((char *)arr[i], D_801E632C[i]);
|
||||
switch (i) {
|
||||
case 0:
|
||||
for (j = 0; j < 5; j++) {
|
||||
if (*(s16 *)(p + 8) < D_801E65B8[j]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (p[0x4E] != 0) {
|
||||
j = (*(s32 *)p == 0) ? 0x1A : 0x1C;
|
||||
}
|
||||
*(s32 *)arr = j + 4;
|
||||
break;
|
||||
case 1:
|
||||
a = p[7];
|
||||
if (a >= 100) {
|
||||
a = 99;
|
||||
}
|
||||
b = p[6];
|
||||
if (b >= 60) {
|
||||
b = 59;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)((func_801E45C0((u16)a, 0x18) | 0xB00000) |
|
||||
func_801E45C0(b, 0xC),
|
||||
5, (u8 *)arr[1] + 0x12, 0);
|
||||
break;
|
||||
case 2:
|
||||
a = *(u16 *)(p + 0x34);
|
||||
if (a >= 1000) {
|
||||
a = 999;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)(func_801E45C0((u16)a, 0x14), 3, (u8 *)arr[2] + 8, 1);
|
||||
n = p[0x42];
|
||||
if (n >= 7) {
|
||||
n = 6;
|
||||
}
|
||||
ico = D_801E6390[n];
|
||||
*(u16 *)((u8 *)arr[2] + 0x10) = *ico++;
|
||||
*(u16 *)((u8 *)arr[2] + 0x12) = ico[0];
|
||||
*(u16 *)((u8 *)arr[2] + 0x14) = ico[1];
|
||||
a = p[0x39];
|
||||
if (a >= 0x18) {
|
||||
a = 0x17;
|
||||
}
|
||||
b = p[0x38];
|
||||
if (b >= 0x3C) {
|
||||
b = 0x3B;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)((func_801E45C0((u16)a, 0x18) | 0xB00000) |
|
||||
func_801E45C0(b, 0xC),
|
||||
5, (u8 *)arr[2] + 0x18, 0);
|
||||
break;
|
||||
case 3:
|
||||
a = *(u16 *)(p + 0x3C);
|
||||
if (a >= 1000) {
|
||||
a = 999;
|
||||
}
|
||||
b = *(u16 *)(p + 0x3A);
|
||||
if (b >= 1000) {
|
||||
b = 999;
|
||||
}
|
||||
r = func_801E45C0((u16)a, 0x14);
|
||||
if (r == 0) {
|
||||
r = 0xD00000;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)(r | (func_801E45C0(b, 4) | 0xC0000), 7, (u8 *)arr[3] + 6, 1);
|
||||
break;
|
||||
case 4:
|
||||
a = *(u16 *)(p + 0x40);
|
||||
if (a >= 1000) {
|
||||
a = 999;
|
||||
}
|
||||
b = *(u16 *)(p + 0x3E);
|
||||
if (b >= 1000) {
|
||||
b = 999;
|
||||
}
|
||||
r = func_801E45C0((u16)a, 0x14);
|
||||
if (r == 0) {
|
||||
r = 0xD00000;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)(r | (func_801E45C0(b, 4) | 0xC0000), 7, (u8 *)arr[4] + 6, 1);
|
||||
break;
|
||||
case 5:
|
||||
a = *(u32 *)(p + 0x14);
|
||||
if (a > 99999) {
|
||||
a = 99999;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)(func_801E45C0(a, 0xC), 5, (u8 *)arr[5] + 2, 1);
|
||||
break;
|
||||
case 6:
|
||||
a = *(u16 *)(p + 0xC);
|
||||
if (a >= 0x24) {
|
||||
a = 0x23;
|
||||
}
|
||||
r = func_801E45C0((u16)a, 0x18);
|
||||
if (r == 0) {
|
||||
r = 0xD000000;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)(r, 2, (u8 *)arr[6] + 0x10, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 7; i++) {
|
||||
if (i == 0) {
|
||||
*(s32 *)arr = 4;
|
||||
} else if (i == 1) {
|
||||
strcpy((char *)arr[i], D_801E632C[i]);
|
||||
} else if (i == 4) {
|
||||
strcpy((char *)arr[i], D_801E634C);
|
||||
} else {
|
||||
*(Blk3_801E40A8 *)arr[i] = D_801E26C0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
u32 func_801E45C0(s32 a0, s32 a1) {
|
||||
s32 t0;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user