diff --git a/src/game/game_0b63b0.c b/src/game/game_0b63b0.c index f6fa3e518..4d1e3d3cb 100644 --- a/src/game/game_0b63b0.c +++ b/src/game/game_0b63b0.c @@ -1322,22 +1322,10 @@ glabel func0f0b69d0 /* f0b72a4: 46001006 */ mov.s $f0,$f2 ); -GLOBAL_ASM( -glabel func0f0b72a8 -/* f0b72a8: 3c0f800a */ lui $t7,%hi(g_NumSpawnPoints) -/* f0b72ac: 8defde68 */ lw $t7,%lo(g_NumSpawnPoints)($t7) -/* f0b72b0: 27bdffe0 */ addiu $sp,$sp,-32 -/* f0b72b4: 3c0e800a */ lui $t6,%hi(g_SpawnPoints) -/* f0b72b8: afbf001c */ sw $ra,0x1c($sp) -/* f0b72bc: 25cede38 */ addiu $t6,$t6,%lo(g_SpawnPoints) -/* f0b72c0: afae0010 */ sw $t6,0x10($sp) -/* f0b72c4: 0fc2da74 */ jal func0f0b69d0 -/* f0b72c8: afaf0014 */ sw $t7,0x14($sp) -/* f0b72cc: 8fbf001c */ lw $ra,0x1c($sp) -/* f0b72d0: 27bd0020 */ addiu $sp,$sp,0x20 -/* f0b72d4: 03e00008 */ jr $ra -/* f0b72d8: 00000000 */ nop -); +f32 func0f0b72a8(f32 arg0, struct coord *pos, s16 *rooms, struct prop *prop) +{ + return func0f0b69d0(arg0, pos, rooms, prop, g_SpawnPoints, g_NumSpawnPoints); +} GLOBAL_ASM( glabel func0f0b72dc diff --git a/src/game/game_17f930.c b/src/game/game_17f930.c index de5a6c65e..716a0d6e8 100644 --- a/src/game/game_17f930.c +++ b/src/game/game_17f930.c @@ -1045,17 +1045,17 @@ void scenarioCtcInit(void) for (i = 0; i < 4; i++) { s32 j; - g_ScenarioData.ctc.unk18[i].unk00 = i; - g_ScenarioData.ctc.unk18[i].unk02 = 0; + g_ScenarioData.ctc.spawnpadsperteam[i].teamindex = i; + g_ScenarioData.ctc.spawnpadsperteam[i].numspawnpads = 0; for (j = 0; j < 6; j++) { - g_ScenarioData.ctc.unk18[i].unk04[j] = -1; + g_ScenarioData.ctc.spawnpadsperteam[i].spawnpads[j] = -1; } } for (i = 0; i != 4; i++) { g_ScenarioData.ctc.unk00[i] = 0; - g_ScenarioData.ctc.unk08[i] = -1; + g_ScenarioData.ctc.teamindexes[i] = -1; } for (k = 0; k < MAX_MPCHRS; k++) { @@ -1669,15 +1669,15 @@ glabel func0f181800 /* f181898: 00000000 */ nop ); -bool scenarioCtcCallback2c(f32 arg0, struct coord *pos, s16 *arg2, struct prop *prop, f32 *arg4) +bool scenarioCtcCallback2c(f32 arg0, struct coord *pos, s16 *rooms, struct prop *prop, f32 *arg4) { struct chrdata *chr = prop->chr; s32 index = teamGetIndex(chr->team); - if (g_ScenarioData.ctc.unk18[g_ScenarioData.ctc.unk08[index]].unk02 > 0) { - *arg4 = func0f0b69d0(arg0, pos, arg2, prop, - &g_ScenarioData.ctc.unk18[g_ScenarioData.ctc.unk08[index]].unk04[0], - g_ScenarioData.ctc.unk18[g_ScenarioData.ctc.unk08[index]].unk02); + if (g_ScenarioData.ctc.spawnpadsperteam[g_ScenarioData.ctc.teamindexes[index]].numspawnpads > 0) { + *arg4 = func0f0b69d0(arg0, pos, rooms, prop, + g_ScenarioData.ctc.spawnpadsperteam[g_ScenarioData.ctc.teamindexes[index]].spawnpads, + g_ScenarioData.ctc.spawnpadsperteam[g_ScenarioData.ctc.teamindexes[index]].numspawnpads); return true; } @@ -1694,7 +1694,7 @@ bool scenarioCtcIsRoomHighlighted(s16 room) s32 i; for (i = 0; i < 4; i++) { - if (g_ScenarioData.ctc.baserooms[i] == room && g_ScenarioData.ctc.unk08[i] != -1) { + if (g_ScenarioData.ctc.baserooms[i] == room && g_ScenarioData.ctc.teamindexes[i] != -1) { return true; } } @@ -6289,16 +6289,16 @@ glabel var7f1b89b8 /* f186178: 00000000 */ nop ); -f32 scenarioCallback2c(f32 arg0, struct coord *pos, s16 *arg2, struct prop *prop) +f32 scenarioCallback2c(f32 arg0, struct coord *pos, s16 *rooms, struct prop *prop) { f32 result; if (g_Vars.normmplayerisrunning && g_MpScenarios[g_MpSetup.scenario].unk2c && - g_MpScenarios[g_MpSetup.scenario].unk2c(arg0, pos, arg2, prop, &result)) { + g_MpScenarios[g_MpSetup.scenario].unk2c(arg0, pos, rooms, prop, &result)) { return result; } - return func0f0b72a8(arg0, pos, arg2, prop); + return func0f0b72a8(arg0, pos, rooms, prop); } GLOBAL_ASM( diff --git a/src/gvars/gvars.c b/src/gvars/gvars.c index 365f124a5..0ecd709d0 100644 --- a/src/gvars/gvars.c +++ b/src/gvars/gvars.c @@ -16078,7 +16078,7 @@ f32 var8009de28 = 0; s32 var8009de2c = 0; u32 var8009de30 = 0; u32 var8009de34 = 0; -u16 g_SpawnPoints[MAX_SPAWNPOINTS] = {0}; +s16 g_SpawnPoints[MAX_SPAWNPOINTS] = {0}; s32 g_NumSpawnPoints = 0; u32 var8009de6c = 0; u32 var8009de70 = 0; diff --git a/src/include/game/game_0b63b0.h b/src/include/game/game_0b63b0.h index 2b6308f90..4a88e37c7 100644 --- a/src/include/game/game_0b63b0.h +++ b/src/include/game/game_0b63b0.h @@ -10,8 +10,8 @@ u32 func0f0b656c(void); u32 func0f0b65a8(void); void func0f0b65f8(void); void func0f0b6764(void); -f32 func0f0b69d0(f32 arg0, struct coord *pos, s16 *arg2, struct prop *prop, s16 *arg4, s16 arg5); -f32 func0f0b72a8(f32 arg0, struct coord *pos, s16 *arg2, struct prop *prop); +f32 func0f0b69d0(f32 arg0, struct coord *pos, s16 *rooms, struct prop *prop, s16 *spawnpads, s16 numspawnpads); +f32 func0f0b72a8(f32 arg0, struct coord *pos, s16 *rooms, struct prop *prop); u32 func0f0b72dc(void); void func0f0b77cc(void); u32 func0f0b7c60(void); diff --git a/src/include/game/game_17f930.h b/src/include/game/game_17f930.h index fd5dfb3e8..97217cd71 100644 --- a/src/include/game/game_17f930.h +++ b/src/include/game/game_17f930.h @@ -23,7 +23,7 @@ void scenarioCtcCallback14(); void scenarioCtcKill(struct mpchr *mpchr, s32 arg1, s32 *score, s32 *arg3); Gfx *scenarioCtcRadar(Gfx *gdl); bool scenarioCtcRadar2(Gfx **gdl, struct prop *prop); -bool scenarioCtcCallback2c(f32 arg0, struct coord *pos, s16 *arg2, struct prop *prop, f32 *arg4); +bool scenarioCtcCallback2c(f32 arg0, struct coord *pos, s16 *rooms, struct prop *prop, f32 *arg4); s32 scenarioCtcGetMaxTeams(void); bool scenarioCtcIsRoomHighlighted(s16 room); s32 menuhandlerMpHillTime(u32 operation, struct menuitem *item, struct numandtext *value); @@ -54,7 +54,7 @@ void scenarioCallback10(void); void scenarioCallback14(struct chrdata *chr); Gfx *scenarioRadar(Gfx *gdl); bool scenarioRadar2(Gfx **gdl, struct prop *prop); -f32 scenarioCallback2c(f32 arg0, struct coord *pos, s16 *arg2, struct prop *prop); +f32 scenarioCallback2c(f32 arg0, struct coord *pos, s16 *rooms, struct prop *prop); s32 scenarioGetMaxTeams(void); void scenarioCallback38(s16 arg0, s32 *arg1, s32 *arg2, s32 *arg3); diff --git a/src/include/gvars/gvars.h b/src/include/gvars/gvars.h index ce38b0dbe..9353ef156 100644 --- a/src/include/gvars/gvars.h +++ b/src/include/gvars/gvars.h @@ -627,7 +627,7 @@ extern s32 var8009de24; extern f32 var8009de28; extern s32 var8009de2c; extern u32 var8009de30; -extern u16 g_SpawnPoints[MAX_SPAWNPOINTS]; +extern s16 g_SpawnPoints[MAX_SPAWNPOINTS]; extern s32 g_NumSpawnPoints; extern u32 var8009de78; extern u32 var8009de98; diff --git a/src/include/types.h b/src/include/types.h index a24b02d20..cf5e7e3e1 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -4315,7 +4315,7 @@ struct mpscenario { Gfx *(*radarfunc)(Gfx *gdl); bool (*radar2func)(Gfx **gdl, struct prop *prop); bool (*highlightfunc)(struct prop *prop, u32 *colour); - bool (*unk2c)(f32 arg0, struct coord *pos, s16 *arg2, struct prop *prop, f32 *arg4); + bool (*unk2c)(f32 arg0, struct coord *pos, s16 *rooms, struct prop *prop, f32 *arg4); s32 (*maxteamsfunc)(void); bool (*isroomhighlightedfunc)(s16 room); void (*unk38)(s16 arg0, s32 *arg1, s32 *arg2, s32 *arg3); @@ -4690,17 +4690,17 @@ struct scenariodata_koh { /*0x800ac148*/ f32 unk38; }; -struct ctcthing { - s16 unk00; - s16 unk02; - s16 unk04[6]; +struct ctcspawnpadsperteam { + s16 teamindex; + s16 numspawnpads; + s16 spawnpads[6]; }; struct scenariodata_ctc { - /*0x00*/ s16 unk00[4]; - /*0x08*/ s16 unk08[4]; + /*0x00*/ s16 unk00[4]; // teams enabled? + /*0x08*/ s16 teamindexes[4]; /*0x10*/ s16 baserooms[4]; - /*0x18*/ struct ctcthing unk18[4]; + /*0x18*/ struct ctcspawnpadsperteam spawnpadsperteam[4]; /*0x58*/ struct prop *tokens[4]; };