From f8b724f598843360b3ead3f2b6e3ec63917ffcb5 Mon Sep 17 00:00:00 2001 From: Bl00D4NGEL Date: Thu, 10 Oct 2024 22:33:07 +0200 Subject: [PATCH] document the rest of ttc --- level_symbols.us.v10.txt | 2 +- src/CC/code_1F70.c | 2 +- src/CC/code_BF0.c | 2 +- src/TTC/ch/lockup.c | 2 +- src/TTC/code_26D0.c | 41 ++++++++++++++++++++-------------------- src/TTC/code_3040.c | 13 ++++++++----- src/TTC/code_3E30.c | 20 ++++++++++---------- src/core2/code_4C020.c | 2 ++ src/core2/code_956B0.c | 5 +++-- src/core2/spawnqueue.c | 2 +- 10 files changed, 49 insertions(+), 42 deletions(-) diff --git a/level_symbols.us.v10.txt b/level_symbols.us.v10.txt index 0b659fc5..a8d4da4f 100644 --- a/level_symbols.us.v10.txt +++ b/level_symbols.us.v10.txt @@ -1,6 +1,6 @@ sm_func_80386810 = 0x80386810; mm_func_803888B0 = 0x803888B0; -TTC_resetSpawnableActors = 0x80388AC0; +code26D0_resetSpawnableActorsForTTC = 0x80388AC0; code_3E30_isSecretCheatCodeRelatedValueEqualToScrambledAddressValue = 0x8038BF8C; cc_func_803870E0 = 0x803870E0; cc_func_80387DA0 = 0x80387DA0; diff --git a/src/CC/code_1F70.c b/src/CC/code_1F70.c index 38176809..a039910c 100644 --- a/src/CC/code_1F70.c +++ b/src/CC/code_1F70.c @@ -382,7 +382,7 @@ void CC_func_80388F4C(void){ if(D_80389FA0.unk21 == 3){ func_8034A174(D_80389FA0.unk34, 6, sp48); if(ml_distance_vec3f(sp48, sp6C) <= 130.0f && sp6C[1] - sp48[1] < 50.0f){ - func_8031D04C(0x21, 1); + func_8031D04C(MAP_21_CC_WITCH_SWITCH_ROOM, 1); } }//L80389260 diff --git a/src/CC/code_BF0.c b/src/CC/code_BF0.c index 980bff2b..eda3acbd 100644 --- a/src/CC/code_BF0.c +++ b/src/CC/code_BF0.c @@ -137,7 +137,7 @@ void func_803870F8(Actor *this){ sp3C[1] = this->position_y + 100; sp3C[2] = this->position_z; if(ml_distance_vec3f(&sp3C, &sp70) < 120.0f){ - func_8031D04C(0x22, (local->unk0 == 1)? 7 : 6); + func_8031D04C(MAP_22_CC_INSIDE_CLANKER, (local->unk0 == 1)? 7 : 6); } }//L80387500 } diff --git a/src/TTC/ch/lockup.c b/src/TTC/ch/lockup.c index 574ae5d6..3ead4eb2 100644 --- a/src/TTC/ch/lockup.c +++ b/src/TTC/ch/lockup.c @@ -70,7 +70,7 @@ static void __chLockup_close(Actor *this){ } static void __chLockup_open(Actor *this){ - func_80389468(); + code3040_func_80389468(); subaddie_set_state_with_direction(this, CH_LOCKUP_STATE_OPENING, 0.2f, 1); this->unk38_31 = 1; FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500); diff --git a/src/TTC/code_26D0.c b/src/TTC/code_26D0.c index 55759d90..a7e484dc 100644 --- a/src/TTC/code_26D0.c +++ b/src/TTC/code_26D0.c @@ -25,11 +25,12 @@ extern ActorInfo gChTreasurehuntRedQuestionMark; extern ActorInfo gChTreasurehuntRedX; extern ActorInfo gChTreasure; -void code26D0_genericUpdateFunc(Actor *this); -void code26D0_palmTreeUpdateFunc(Actor *this); -void code26D0_lighthouseAUpdateFunc(Actor *this); -void func_802D3D54(Actor *this); -void code26D0_sharkfoodIslandUpdateFunc(Actor *this); +extern void func_802D3D54(Actor *this); + +static void __code26D0_genericUpdateFunc(Actor *this); +static void __code26D0_palmTreeUpdateFunc(Actor *this); +static void __code26D0_lighthouseAUpdateFunc(Actor *this); +static void __code26D0_sharkfoodIslandUpdateFunc(Actor *this); /* .data */ ActorInfo gBlubberShipTopHatch = { @@ -49,47 +50,47 @@ ActorInfo gLighthouseDoor = { ActorInfo gSharkfoodIsland = { MARKER_167_SHARKFOOD_ISLAND, ACTOR_25C_SHARKFOOD_ISLAND, ASSET_50A_MODEL_SHARKFOOD_ISLAND, 0x1, NULL, - code26D0_sharkfoodIslandUpdateFunc, actor_update_func_80326224, actor_drawFullDepth, + __code26D0_sharkfoodIslandUpdateFunc, actor_update_func_80326224, actor_drawFullDepth, 0, 0, 0.0f, 0 }; ActorInfo gLighthouseA = { MARKER_267_LIGHTHOUSE_A, ACTOR_2E2_LIGHTHOUSE_A, ASSET_3BD_MODEL_LIGHTHOUSE_A, 0x1, NULL, - code26D0_lighthouseAUpdateFunc, actor_update_func_80326224, actor_drawFullDepth, + __code26D0_lighthouseAUpdateFunc, actor_update_func_80326224, actor_drawFullDepth, 0, 0, 0.0f, 0 }; ActorInfo gLighthouseB = { MARKER_26A_LIGHTHOUSE_B, ACTOR_2DF_LIGHTHOUSE_B, ASSET_3BE_MODEL_LIGHTHOUSE_B, 0x1, NULL, - code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth, + __code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth, 0, 0, 0.0f, 0 }; ActorInfo gStairs1 = { MARKER_268_STAIRS_1, ACTOR_2E0_TTC_STAIRS_1, ASSET_3B6_MODEL_TTC_STAIRS_1, 0x1, NULL, - code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth, + __code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth, 0, 0, 0.0f, 0 }; ActorInfo gStairs2 = { MARKER_269_STAIRS_2, ACTOR_2E1_TTC_STAIRS_2, ASSET_3B7_MODEL_TTC_STAIRS_1, 0x1, NULL, - code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth, + __code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth, 0, 0, 0.0f, 0 }; ActorInfo gPalmTree = { MARKER_1D5_PALM_TREE, ACTOR_31E_PALM_TREE, ASSET_3A9_MODEL_PALM_TREE, 0x1, NULL, - code26D0_palmTreeUpdateFunc, actor_update_func_80326224, actor_drawFullDepth, + __code26D0_palmTreeUpdateFunc, actor_update_func_80326224, actor_drawFullDepth, 0, 0, 0.0f, 0 }; /* .code */ -void TTC_resetSpawnableActors(void) +void code26D0_resetSpawnableActorsForTTC(void) { spawnableActorList_add(&gBlubberShipTopHatch, actor_new, ACTOR_FLAG_NONE); spawnableActorList_add(&gLighthouseDoor, actor_new, ACTOR_FLAG_NONE); @@ -112,14 +113,14 @@ void TTC_resetSpawnableActors(void) spawnableActorList_add(&gChClam, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_25); } -void code26D0_genericUpdateFunc(Actor *this){ +static void __code26D0_genericUpdateFunc(Actor *this){ if(!this->initialized){ func_802D3D74(this); this->initialized = TRUE; } } -void code26D0_palmTreeUpdateFunc(Actor *this){ +static void __code26D0_palmTreeUpdateFunc(Actor *this){ if(!this->initialized){ func_802D3D74(this); this->initialized = TRUE; @@ -127,21 +128,21 @@ void code26D0_palmTreeUpdateFunc(Actor *this){ } } -void code26D0_spawnLighthouseB(s32 arg0){ +static void __code26D0_spawnLighthouseB(s32 arg0){ ActorMarker *marker = reinterpret_cast(ActorMarker *, arg0); Actor *this = marker_getActor(marker); spawn_child_actor(ACTOR_2DF_LIGHTHOUSE_B, &this); } -void code26D0_lighthouseAUpdateFunc(Actor *this){ - code26D0_genericUpdateFunc(this); +static void __code26D0_lighthouseAUpdateFunc(Actor *this){ + __code26D0_genericUpdateFunc(this); if(!this->volatile_initialized){ - __spawnQueue_add_1((GenFunction_1)code26D0_spawnLighthouseB, (s32)this->marker); + __spawnQueue_add_1((GenFunction_1)__code26D0_spawnLighthouseB, (s32)this->marker); this->volatile_initialized = TRUE; } } -void code26D0_sharkfoodIslandUpdateFunc(Actor *this){ +static void __code26D0_sharkfoodIslandUpdateFunc(Actor *this){ f32 player_position[3]; if(!this->initialized){ @@ -160,7 +161,7 @@ void code26D0_sharkfoodIslandUpdateFunc(Actor *this){ else{ this->position_y = -1000.0f; } - }//L80388E7C + } if(this->position_y == 700.0f){ player_getPosition(player_position); diff --git a/src/TTC/code_3040.c b/src/TTC/code_3040.c index 942a7198..c0c6a292 100644 --- a/src/TTC/code_3040.c +++ b/src/TTC/code_3040.c @@ -5,8 +5,11 @@ extern s32 D_80276CB0; /* .data */ +// code crc0 s32 D_8038C750 = 0x0016D2FD; +// code crc1 s32 D_8038C754 = 0xFB70B01D; +// data crc s32 D_8038C758 = 0x0004EFAC; /* .bss */ @@ -15,17 +18,17 @@ struct { s32 unk4; u8 pad8[4]; s32 unkC; -}D_8038D6F0; +} sD_8038D6F0; /* .code */ -void func_80389430(void){ +void __code3040_func_80389430(){ if(getGameMode() != GAME_MODE_7_ATTRACT_DEMO){ func_8029CF48(2, 1, 0.0f); } } -void func_80389468(void){ - if(D_8038D6F0.unk4 != D_8038C754 || D_8038D6F0.unkC != D_80276CB0){ - func_80389430(); +void code3040_func_80389468(void){ + if(sD_8038D6F0.unk4 != D_8038C754 || sD_8038D6F0.unkC != D_80276CB0){ + __code3040_func_80389430(); } } diff --git a/src/TTC/code_3E30.c b/src/TTC/code_3E30.c index 54eb046b..dfaec3c0 100644 --- a/src/TTC/code_3E30.c +++ b/src/TTC/code_3E30.c @@ -196,7 +196,7 @@ static void __code3E30_initFloorTiles(void) for (i_ptr = sLetterFloorTiles; i_ptr->meshId != 0; i_ptr++) { i_ptr->state = 2; - i_ptr->time_delta_sum = 0.0f; + i_ptr->timeDeltaSum = 0.0f; } mapSpecificFlags_set(TTC_SPECIFIC_FLAG_1_UNKNOWN, FALSE); @@ -207,9 +207,9 @@ static void __code3E30_meshCallbackFloorTileState_1(s32 arg0, BKVtxRef *ref, Vtx LetterFloorTile *ptr = (LetterFloorTile *)arg3; f32 temp_f2; - if (ptr->time_delta_sum < 0.5) + if (ptr->timeDeltaSum < 0.5) { - temp_f2 = (ptr->time_delta_sum / 0.5); + temp_f2 = (ptr->timeDeltaSum / 0.5); dst->v.cn[0] = (ref->v.v.cn[0] - 0xFF) * temp_f2 + 255.0f; dst->v.cn[1] = ref->v.v.cn[1] * temp_f2; dst->v.cn[2] = ref->v.v.cn[2] * temp_f2; @@ -229,7 +229,7 @@ static void __code3E30_setLetterFloorTileState(LetterFloorTile *arg0, s32 arg1) temp_v0 = arg0->state; arg0->state = arg1; - arg0->time_delta_sum = 0.0f; + arg0->timeDeltaSum = 0.0f; if ((arg1 == 1) && (temp_v0 != arg1)) { func_8025A6EC(COMUSIC_2C_BUZZER, 32000); @@ -241,14 +241,14 @@ static void __code3E30_meshCallbackFloorTileState_3(s32 arg0, BKVtxRef *ref, Vtx LetterFloorTile *ptr = (LetterFloorTile *)arg3; f32 temp_f12; - if (ptr->time_delta_sum <= 0.5) + if (ptr->timeDeltaSum <= 0.5) { - temp_f12 = (ptr->time_delta_sum / 0.5); + temp_f12 = (ptr->timeDeltaSum / 0.5); dst->v.cn[0] = ref->v.v.cn[0] * (1.0f - temp_f12); dst->v.cn[1] = 0xFF; dst->v.cn[2] = ref->v.v.cn[2] * (1.0f - temp_f12); } - if (ptr->time_delta_sum >= 0.5) + if (ptr->timeDeltaSum >= 0.5) { ptr->state = 4; } @@ -259,9 +259,9 @@ static void __code3E30_meshCallbackFloorTileState_5(s32 arg0, BKVtxRef *ref, Vtx LetterFloorTile *ptr = (LetterFloorTile *)arg3; f32 temp_f2; - if (ptr->time_delta_sum < 0.5) + if (ptr->timeDeltaSum < 0.5) { - temp_f2 = (ptr->time_delta_sum / 0.5); + temp_f2 = (ptr->timeDeltaSum / 0.5); dst->v.cn[0] = (ref->v.v.cn[0] - 0xFF) * temp_f2 + 255.0f; dst->v.cn[1] = (ref->v.v.cn[1] - 0xFF) * temp_f2 + 255.0f; dst->v.cn[2] = ref->v.v.cn[2] * temp_f2; @@ -283,7 +283,7 @@ static void __code3E30_updateTimeDeltaSumForFloorTiles() time_delta = time_getDelta(); for (floor_tile = sLetterFloorTiles; floor_tile->meshId != 0; floor_tile++) { - floor_tile->time_delta_sum += time_delta; + floor_tile->timeDeltaSum += time_delta; if (floor_tile->state == 1) { BKModel_transformMesh(sMapState.model1, floor_tile->meshId, __code3E30_meshCallbackFloorTileState_1, (s32)floor_tile); diff --git a/src/core2/code_4C020.c b/src/core2/code_4C020.c index 5db33954..7f972afd 100644 --- a/src/core2/code_4C020.c +++ b/src/core2/code_4C020.c @@ -361,6 +361,7 @@ void func_802D3CC8(ActorMarker *marker){ func_802D31AC(marker, NULL); } +// used as init function void func_802D3CE8(Actor *this){ if(!this->initialized){ marker_setCollisionScripts(this->marker, NULL, func_802D3138, func_802D31AC); @@ -373,6 +374,7 @@ void func_802D3D54(Actor *this){ func_802D3CE8(this); } +// used as init function void func_802D3D74(Actor *this){ this->marker->propPtr->unk8_3 = TRUE; actor_collisionOff(this); diff --git a/src/core2/code_956B0.c b/src/core2/code_956B0.c index 161a6d96..1b547460 100644 --- a/src/core2/code_956B0.c +++ b/src/core2/code_956B0.c @@ -231,8 +231,9 @@ void func_8031CE70(f32 *arg0, enum map_e arg1, s32 arg2) { } } -void func_8031D04C(enum map_e arg0, s32 arg1) { - func_8031CB50(arg0, arg1, 0); +// set map and exit id? +void func_8031D04C(enum map_e arg0, s32 exit_id) { + func_8031CB50(arg0, exit_id, 0); } void func_8031D06C(enum map_e arg0, s32 arg1) { diff --git a/src/core2/spawnqueue.c b/src/core2/spawnqueue.c index 7b1b9859..aad84102 100644 --- a/src/core2/spawnqueue.c +++ b/src/core2/spawnqueue.c @@ -374,7 +374,7 @@ void spawnQueue_reset(void){ GV_func_8038F154(); break; case OVERLAY_5_BEACH: - TTC_resetSpawnableActors(); + code26D0_resetSpawnableActorsForTTC(); break; case OVERLAY_6_JUNGLE: MM_func_803888B0();