From 9cb2da2dd712c7a3d4f14347b5635cd4047e93c9 Mon Sep 17 00:00:00 2001 From: Flavius Date: Tue, 10 Nov 2026 23:47:04 -0600 Subject: [PATCH] fix(levels): Yeedil's spawner gets the link words through a pointer func_L20_0039DCF8 passed a 12-byte struct by value to func_L02_002EF388, whose fourth parameter is a pointer at every other call. The PS2 compiler passes such a struct by a pointer to a copy, so the bytes matched; on the PC port the words went in registers and the routine read them as an address and crashed. It now passes &arg; same bytes (tools/check.py: 20_yeedil OK). --- src/levels/20_yeedil/L20_0039DCF8.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/levels/20_yeedil/L20_0039DCF8.c b/src/levels/20_yeedil/L20_0039DCF8.c index 1b4d68ba7..324855797 100644 --- a/src/levels/20_yeedil/L20_0039DCF8.c +++ b/src/levels/20_yeedil/L20_0039DCF8.c @@ -1,7 +1,7 @@ #include "include_asm.h" #include "common.h" -/* Three words handed to the spawner by value. */ +/* Three words handed to the spawner through a pointer to a copy, as the other callers pass their block. */ typedef struct { s32 a; s32 b; @@ -14,7 +14,7 @@ extern int func_002A7820(int, int); extern void func_002A0F48(void *); extern int func_L20_0039DF18(char *, int); extern void func_L20_0039DE88(char *); -extern void func_L02_002EF388(void *, void *, void *, L20_0039DCF8_Args, int); +extern void func_L02_002EF388(void *, void *, void *, L20_0039DCF8_Args *, int); /* Sets up a spawned object at pos/rot; if it finds its slot it passes the three link words on. */ int func_L20_0039DCF8(char *obj, char *pos, char *rot) @@ -50,7 +50,7 @@ int func_L20_0039DCF8(char *obj, char *pos, char *rot) st.b = *(s32 *)(vars + 0x258); st.c = *(s32 *)(vars + 0x25C); arg = st; - func_L02_002EF388(obj, pos, rot, arg, 3); + func_L02_002EF388(obj, pos, rot, &arg, 3); ret = 1; } return ret;