feat(decomp): main/func_80036D58 — the narrow-param decl-sync completes the §378 chain

A no-proto decl is ILLEGAL against a definition whose parameter is affected by
the default argument promotions (s16 here): C89 requires the parameter types be
promotion-stable when one declaration has no prototype. So fix_arity_callers'
--any-proto cannot reach this case (it skips it as 'narrow-param').

With the call sites already cast (§378) the decls emit no code, so syncing them
to the draft's exact signature is byte-neutral: 3 decls in src/800.c rewritten to
extern void func_80036D58(s16). Byte-identical, main.
This commit is contained in:
Drew T
2026-08-31 23:51:19 -06:00
parent 779f3e2a19
commit c6f6f668ba
2 changed files with 75 additions and 6 deletions
+73 -4
View File
@@ -7512,7 +7512,7 @@ s32 func_8001B394(s32 a0) {
extern int func_8001A114(void);
extern void func_8001B710(void);
extern void func_8002D4C8(int arg0, int arg1);
extern void func_80036D58(int arg0);
extern void func_80036D58(s16);
extern int StreamLoadStateMachine(int arg0, void *loc, int n);
extern s32 CdQueueBusy(void); /* defined later in this file */
extern s32 ResourceGetCdLoc(s16 arg0); /* defined later in this file */
@@ -7616,7 +7616,7 @@ done:
extern int func_8001A114(void);
extern void func_8001B710(void);
extern void func_8002D4C8(int arg0, int arg1);
extern void func_80036D58(int arg0);
extern void func_80036D58(s16);
extern int StreamLoadStateMachine(int arg0, void *loc, int n);
extern s32 CdQueueBusy(void);
extern s32 ResourceGetCdLoc(s16 arg0);
@@ -17701,7 +17701,7 @@ void func_8002EB10(void) {
}
extern void func_80036D58(int arg0);
extern void func_80036D58(s16);
extern void func_80038308(s16 arg0);
extern u16 D_800A4E8E;
extern s16 D_800A4E86;
@@ -21690,7 +21690,76 @@ void func_80036D24(void) {
}
}
INCLUDE_ASM("asm/nonmatchings/800", func_80036D58);
extern s32 D_8006AEE8;
extern s32 D_80078F10;
extern s32 D_800C6D28;
extern u8 D_800A46BA;
extern u8 D_800A4F1A;
extern s16 D_800A4EF8;
extern s32 func_80034CF0(u8 *);
extern void func_80034DFC(s16);
extern s32 func_8003EDE8(s32, s32, s32);
extern void func_80035C4C(void);
extern void func_80036F98(void);
extern void func_8003602C(void);
extern void func_80036FB0(s32, s32);
void func_80036D58(s16 arg0)
{
CdReq req;
s32 pad[2];
s32 i;
s16 *p;
s32 r;
s32 n;
s32 cnt;
if (arg0 != 0 || D_800C6D28 != 0) {
D_800A46BA = 0;
if (D_8006AEE8 != 0) {
i = 0;
if (D_8006AEE8 > 0) {
p = (s16 *)&D_80078F10;
do {
func_80034DFC(*p);
i++;
cnt = D_8006AEE8;
*(s32 *)p = 0;
p += 2;
} while (i < cnt);
}
D_8006AEE8 = 0;
}
req.f08 = (s32)func_80035C4C;
req.f0c = arg0;
req.f1c = (s32)func_80036F98;
req.f20 = 0;
req.f24 = (s32)func_8003602C;
req.f28 = (s32)func_80036FB0;
r = func_80034CF0((u8 *)&req);
n = D_8006AEE8;
(&D_80078F10)[n] = r;
if (r != 0) {
D_8006AEE8 = n + 1;
}
D_800A4F1A = 0;
if (arg0 != 0) {
D_800C6D28 = 0;
}
func_8003EDE8(0, ((u32)D_800A4EF8 * 97) >> 7 & 0xFF, ((u32)D_800A4EF8 * 97) >> 7 & 0xFF);
}
}
extern u8 D_800A4F1A;
+2 -2
View File
@@ -62040,7 +62040,7 @@
#define DEFINE_func_80184A08() \
extern s32 D_801E8754; \
extern void func_80036D58(int arg0); \
extern void func_80036D58(); \
extern void func_8018623C(u16 arg0, u16 arg1); \
extern void func_80185E00(void); \
extern void func_8012A828(s32 a0, void *a1); \
@@ -190606,7 +190606,7 @@
#define DEFINE_func_80184A08() \
extern s32 D_801E8754; \
extern void func_80036D58(int arg0); \
extern void func_80036D58(); \
extern void func_8018623C(u16 arg0, u16 arg1); \
extern void func_80185E00(void); \
extern void func_8012A828(s32 a0, void *a1); \