diff --git a/src/190B20.c b/src/190B20.c index 11833043f5..05f4f54c37 100644 --- a/src/190B20.c +++ b/src/190B20.c @@ -1997,29 +1997,32 @@ void remove_player_buffs(s32 buffs) { INCLUDE_ASM(s32, "190B20", btl_update_ko_status); +#ifdef NON_EQUIVALENT +extern s32 D_80293970; + +void btl_appendGfx_prim_quad(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7) { + gDPPipeSync(gMasterGfxPos++); + gSPDisplayList(gMasterGfxPos++, &D_80293970); + + if ((arg3 & 0xFF) == 0xFF) { + gDPSetRenderMode(gMasterGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2); + gDPSetCombineLERP(gMasterGfxPos++, 0, 0, 0, PRIMITIVE, 0, 0, 0, 1, 0, 0, 0, PRIMITIVE, 0, 0, 0, 1); + } else { + gDPSetRenderMode(gMasterGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + gDPSetCombineMode(gMasterGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); + } + + gDPSetPrimColor(gMasterGfxPos++, 0, 0, arg0, arg1, arg2, arg3); + gDPFillRectangle(gMasterGfxPos++, arg4, arg5, arg6, arg7); + gDPPipeSync(gMasterGfxPos++); + + gDPSetRenderMode(gMasterGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2); + gDPSetCombineMode(gMasterGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA); +} +#else void btl_appendGfx_prim_quad(u8 arg0, u8 arg1, u8 arg2, u8 arg3, u16 arg4, u16 arg5, u16 arg6, u16 arg7); INCLUDE_ASM(s32, "190B20", btl_appendGfx_prim_quad, u8 arg0, u8 arg1, u8 arg2, u8 arg3, u16 arg4, u16 arg5, u16 arg6, u16 arg7); -// extern s32 D_80293970; - -// void btl_appendGfx_prim_quad(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7) { -// gDPPipeSync(gMasterGfxPos++); -// gSPDisplayList(gMasterGfxPos++, &D_80293970); - -// if ((arg3 & 0xFF) == 0xFF) { -// gDPSetRenderMode(gMasterGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2); -// gDPSetCombineLERP(gMasterGfxPos++, 0, 0, 0, PRIMITIVE, 0, 0, 0, 1, 0, 0, 0, PRIMITIVE, 0, 0, 0, 1); -// } else { -// gDPSetRenderMode(gMasterGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2); -// gDPSetCombineMode(gMasterGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); -// } - -// gDPSetPrimColor(gMasterGfxPos++, 0, 0, arg0, arg1, arg2, arg3); -// gDPFillRectangle(gMasterGfxPos++, arg4, arg5, arg6, arg7); -// gDPPipeSync(gMasterGfxPos++); - -// gDPSetRenderMode(gMasterGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2); -// gDPSetCombineMode(gMasterGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA); -// } +#endif void btl_draw_prim_quad(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7) { u16 new_var = arg4 + arg6; diff --git a/src/sprite.c b/src/sprite.c index cd98f33b90..f15d10fdae 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -84,21 +84,23 @@ PlayerSpriteSet spr_playerSpriteSets[] = { /* Peach */ { 6, 0x900, 0x00003C00 }, }; +#ifdef NON_EQUIVALENT +extern s32* gSpriteHeapPtr; +extern s32** D_802DFE44; +extern s32* D_802DFE9C; + +void spr_init_quad_cache(void) { + s32 i; + s32* phi_v0; + D_802DFE44 = _heap_malloc(&gSpriteHeapPtr, 0x580); + + for (i = 21; i >= 0; i--) { + D_802DFE44[i] = -1; + } +} +#else INCLUDE_ASM(s32, "sprite", spr_init_quad_cache); - -// extern s32* gSpriteHeapPtr; -// extern s32** D_802DFE44; -// extern s32* D_802DFE9C; - -// void spr_init_quad_cache(void) { -// s32 i; -// s32* phi_v0; -// D_802DFE44 = _heap_malloc(&gSpriteHeapPtr, 0x580); - -// for (i = 21; i >= 0; i--) { -// D_802DFE44[i] = -1; -// } -// } +#endif INCLUDE_ASM(s32, "sprite", spr_get_cached_quad); diff --git a/src/world/area_hos/hos_00/A0C4E0.c b/src/world/area_hos/hos_00/A0C4E0.c index 68ea02b637..729bbca589 100644 --- a/src/world/area_hos/hos_00/A0C4E0.c +++ b/src/world/area_hos/hos_00/A0C4E0.c @@ -1,25 +1,6 @@ #include "hos_00.h" INCLUDE_ASM(s32, "world/area_hos/hos_00/A0C4E0", func_802407F0_A0C4E0); -/* -ApiStatus N(func_802407F0_A0C4E0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80242970_A0E660) == NULL) { - N(D_80242970_A0E660) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80242970_A0E660)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80242970_A0E660)[i]; - } - heap_free(N(D_80242970_A0E660)); - N(D_80242970_A0E660) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_hos/hos_02/A17210.c b/src/world/area_hos/hos_02/A17210.c index 3a05a401f1..70aa4b233a 100644 --- a/src/world/area_hos/hos_02/A17210.c +++ b/src/world/area_hos/hos_02/A17210.c @@ -11,17 +11,6 @@ INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_802411A0_A173C0); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_80241C44_A17E64); -/* -void N(func_80241C44_A17E64)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80244490_A1A6B0)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -32,67 +21,6 @@ void N(func_80241C44_A17E64)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_802422FC_A1851C); -/* -ApiStatus N(func_802422FC_A1851C)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_802421D8_A183F8)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: - N(hos_02_UnkNpcAIFunc23)(script, aiSettings, territoryPtr); - case 1: - N(func_802411A0_A173C0)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_80241888_A17AA8)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_80241C44_A17E64)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_80241E48_A18068)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkNpcAIFunc13.inc.c" diff --git a/src/world/area_hos/hos_04/A27AA0.c b/src/world/area_hos/hos_04/A27AA0.c index c8cd7d629b..33b51a8aee 100644 --- a/src/world/area_hos/hos_04/A27AA0.c +++ b/src/world/area_hos/hos_04/A27AA0.c @@ -3,11 +3,5 @@ INCLUDE_ASM(s32, "world/area_hos/hos_04/A27AA0", func_80240BD0_A27AA0); INCLUDE_ASM(s32, "world/area_hos/hos_04/A27AA0", func_80240E40_A27D10); -/* -ApiStatus N(func_80240E40_A27D10)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_hos/hos_04/A27AA0", func_80240E6C_A27D3C); diff --git a/src/world/area_hos/hos_05/A2EC30.c b/src/world/area_hos/hos_05/A2EC30.c index 14f7d305c5..c95d022108 100644 --- a/src/world/area_hos/hos_05/A2EC30.c +++ b/src/world/area_hos/hos_05/A2EC30.c @@ -3,11 +3,5 @@ INCLUDE_ASM(s32, "world/area_hos/hos_05/A2EC30", func_802449F0_A2EC30); INCLUDE_ASM(s32, "world/area_hos/hos_05/A2EC30", func_80244C60_A2EEA0); -/* -ApiStatus N(func_80244C60_A2EEA0)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_hos/hos_05/A2EC30", func_80244C8C_A2EECC); diff --git a/src/world/area_hos/hos_06/A397F0.c b/src/world/area_hos/hos_06/A397F0.c index bcefe7fd78..990f9df5e8 100644 --- a/src/world/area_hos/hos_06/A397F0.c +++ b/src/world/area_hos/hos_06/A397F0.c @@ -1,25 +1,6 @@ #include "hos_06.h" INCLUDE_ASM(s32, "world/area_hos/hos_06/A397F0", func_80240310_A397F0); -/* -ApiStatus N(func_80240310_A397F0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80242C08_A3C0E8) == NULL) { - N(D_80242C08_A3C0E8) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80242C08_A3C0E8)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80242C08_A3C0E8)[i]; - } - heap_free(N(D_80242C08_A3C0E8)); - N(D_80242C08_A3C0E8) = NULL; - } - return ApiStatus_DONE2; -} -*/ #define NAMESPACE dup2_hos_06 #include "world/common/GetItemName.inc.c" @@ -32,79 +13,18 @@ ApiStatus N(func_80240310_A397F0)(Evt* script, s32 isInitialCall) { #define NAMESPACE hos_06 INCLUDE_ASM(s32, "world/area_hos/hos_06/A397F0", func_80240654_A39B34); -/* -ApiStatus N(func_80240654_A39B34)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80242C6C_A3C14C) = FALSE; - } - - if (N(D_80242C6C_A3C14C)) { - N(D_80242C6C_A3C14C) = FALSE; - evt_set_variable(script, *args, N(D_80242C70_A3C150)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_hos/hos_06/A397F0", func_802406A8_A39B88); -/* -ApiStatus N(func_802406A8_A39B88)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80242C70_A3C150) = evt_get_variable(script, *args); - N(D_80242C6C_A3C14C) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_hos/hos_06/A397F0", func_802406E0_A39BC0); -/* -ApiStatus N(func_802406E0_A39BC0)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_hos/hos_06/A397F0", func_802409F8_A39ED8); -/* -ApiStatus N(func_802409F8_A39ED8)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_hos/hos_06/A397F0", func_80240A3C_A39F1C); -/* -ApiStatus N(func_80240A3C_A39F1C)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_hos/hos_06/A397F0", func_80240A68_A39F48); diff --git a/src/world/area_hos/hos_06/A3A230.c b/src/world/area_hos/hos_06/A3A230.c index e2b20bc96f..1a13df4fce 100644 --- a/src/world/area_hos/hos_06/A3A230.c +++ b/src/world/area_hos/hos_06/A3A230.c @@ -5,77 +5,12 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_hos/hos_06/A3A230", func_80240F7C_A3A45C); -/* -ApiStatus N(func_80240F7C_A3A45C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_802445D0_A3DAB0) = FALSE; - } - - if (N(D_802445D0_A3DAB0)) { - N(D_802445D0_A3DAB0) = FALSE; - evt_set_variable(script, *args, N(D_802445D4_A3DAB4)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_hos/hos_06/A3A230", func_80240FD0_A3A4B0); -/* -ApiStatus N(func_80240FD0_A3A4B0)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_802445D4_A3DAB4) = evt_get_variable(script, *args); - N(D_802445D0_A3DAB0) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_hos/hos_06/A3A230", func_80241008_A3A4E8); -/* -ApiStatus N(func_80241008_A3A4E8)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_hos/hos_06/A3A230", func_802410A4_A3A584); -/* -ApiStatus N(func_802410A4_A3A584)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_8024476C_A3DC4C) == NULL) { - N(D_8024476C_A3DC4C) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_8024476C_A3DC4C)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_8024476C_A3DC4C)[i]; - } - heap_free(N(D_8024476C_A3DC4C)); - N(D_8024476C_A3DC4C) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_hos/hos_06/A3B4B0.c b/src/world/area_hos/hos_06/A3B4B0.c index 9413c09767..2fa2810520 100644 --- a/src/world/area_hos/hos_06/A3B4B0.c +++ b/src/world/area_hos/hos_06/A3B4B0.c @@ -1,25 +1,6 @@ #include "hos_06.h" INCLUDE_ASM(s32, "world/area_hos/hos_06/A3B4B0", func_80241FD0_A3B4B0); -/* -ApiStatus N(func_80241FD0_A3B4B0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80245E80_A3F360) == NULL) { - N(D_80245E80_A3F360) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80245E80_A3F360)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80245E80_A3F360)[i]; - } - heap_free(N(D_80245E80_A3F360)); - N(D_80245E80_A3F360) = NULL; - } - return ApiStatus_DONE2; -} -*/ #define NAMESPACE dup_hos_06 #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_isk/isk_09/9864E0.c b/src/world/area_isk/isk_09/9864E0.c index 3cf06dae28..18848b5b34 100644 --- a/src/world/area_isk/isk_09/9864E0.c +++ b/src/world/area_isk/isk_09/9864E0.c @@ -4,25 +4,6 @@ static char* N(exit_str_0) = "isk_08"; static char* N(exit_str_1) = ""; INCLUDE_ASM(s32, "world/area_isk/isk_09/9864E0", func_80240000_9864E0); -/* -ApiStatus N(func_80240000_9864E0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802406F0_986BD0) == NULL) { - N(D_802406F0_986BD0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802406F0_986BD0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802406F0_986BD0)[i]; - } - heap_free(N(D_802406F0_986BD0)); - N(D_802406F0_986BD0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_isk/isk_10/988B60.c b/src/world/area_isk/isk_10/988B60.c index cb7f0cb793..3901a2ef3f 100644 --- a/src/world/area_isk/isk_10/988B60.c +++ b/src/world/area_isk/isk_10/988B60.c @@ -10,12 +10,6 @@ static char* N(exit_str_3) = ""; #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_8024003C_988B9C); -/* -ApiStatus N(func_8024003C_988B9C)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -34,134 +28,6 @@ INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_802401CC_988D2C); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_80240600_989160); -/* -ApiStatus N(func_80240600_989160)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80241158_989CB8)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80241158_989CB8)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80241158_989CB8)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_iwa/iwa_00/90CC40.c b/src/world/area_iwa/iwa_00/90CC40.c index 61ced1ebc1..252ba65d90 100644 --- a/src/world/area_iwa/iwa_00/90CC40.c +++ b/src/world/area_iwa/iwa_00/90CC40.c @@ -4,25 +4,6 @@ static char* N(exit_str_0) = "iwa_10"; static char* N(exit_str_1) = "iwa_01"; INCLUDE_ASM(s32, "world/area_iwa/iwa_00/90CC40", func_80240000_90CC40); -/* -ApiStatus N(func_80240000_90CC40)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80240FF8_90DC38) == NULL) { - N(D_80240FF8_90DC38) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80240FF8_90DC38)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80240FF8_90DC38)[i]; - } - heap_free(N(D_80240FF8_90DC38)); - N(D_80240FF8_90DC38) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_iwa/iwa_01/90FBD0.c b/src/world/area_iwa/iwa_01/90FBD0.c index 6ea28ab522..0f8278b394 100644 --- a/src/world/area_iwa/iwa_01/90FBD0.c +++ b/src/world/area_iwa/iwa_01/90FBD0.c @@ -45,26 +45,6 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_802422C4_911974); #include "world/common/UnkNpcAIFunc18.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80242498_911B48); -/* -void N(func_80242498_911B48)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - s32 var; - - if (script->functionTemp[1] <= 0) { - script->functionTemp[1] = aiSettings->unk_14; - if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { - npc->currentAnim = enemy->animList[9]; - fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); - ai_enemy_play_sound(npc, 0x2F4, 0x200000); - npc->duration = 12; - script->functionTemp[0] = 2; - } - } - - script->functionTemp[1]--; -} -*/ #include "world/common/UnkNpcAIFunc21.inc.c" @@ -77,55 +57,10 @@ void N(func_80242498_911B48)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkNpcAIFunc16.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80242958_912008); -/* -void N(func_80242958_912008)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - PlayerStatus** playerStatus = &gPlayerStatusPtr; - - npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); - if (npc->duration % 3 == 0) { - fx_walk(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0); - } - - npc->duration--; - if (npc->duration <= 0) { - playerStatus = &gPlayerStatusPtr; - - enemy->unk_10.x = npc->pos.x; - enemy->unk_10.y = npc->pos.y; - enemy->unk_10.z = npc->pos.z; - enemy->unk_07 = 1; - npc->moveSpeed = aiSettings->chaseSpeed; - npc->duration = dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) / npc->moveSpeed + 0.9; - if (npc->duration < 15) { - npc->duration = 15; - } - script->functionTemp[0] = 0x16; - } -} -*/ #include "world/common/UnkFunc10.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80242C48_9122F8); -/* -void N(func_80242C48_9122F8)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - - npc->duration--; - if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[1]; - if (enemy->territory->wander.moveSpeedOverride < 0) { - npc->moveSpeed = aiSettings->moveSpeed; - } else { - npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; - } - script->functionTemp[0] = 0x29; - } -} -*/ #include "world/common/UnkFunc9.inc.c" diff --git a/src/world/area_iwa/iwa_02/915D70.c b/src/world/area_iwa/iwa_02/915D70.c index 5c59156a67..3043f85b42 100644 --- a/src/world/area_iwa/iwa_02/915D70.c +++ b/src/world/area_iwa/iwa_02/915D70.c @@ -8,26 +8,6 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240000_915D70); #include "world/common/UnkNpcAIFunc18.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_802401D4_915F44); -/* -void N(func_802401D4_915F44)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - s32 var; - - if (script->functionTemp[1] <= 0) { - script->functionTemp[1] = aiSettings->unk_14; - if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { - npc->currentAnim = enemy->animList[9]; - fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); - ai_enemy_play_sound(npc, 0x2F4, 0x200000); - npc->duration = 12; - script->functionTemp[0] = 2; - } - } - - script->functionTemp[1]--; -} -*/ #include "world/common/UnkNpcAIFunc21.inc.c" @@ -40,55 +20,10 @@ void N(func_802401D4_915F44)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkNpcAIFunc16.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240694_916404); -/* -void N(func_80240694_916404)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - PlayerStatus** playerStatus = &gPlayerStatusPtr; - - npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); - if (npc->duration % 3 == 0) { - fx_walk(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0); - } - - npc->duration--; - if (npc->duration <= 0) { - playerStatus = &gPlayerStatusPtr; - - enemy->unk_10.x = npc->pos.x; - enemy->unk_10.y = npc->pos.y; - enemy->unk_10.z = npc->pos.z; - enemy->unk_07 = 1; - npc->moveSpeed = aiSettings->chaseSpeed; - npc->duration = dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) / npc->moveSpeed + 0.9; - if (npc->duration < 15) { - npc->duration = 15; - } - script->functionTemp[0] = 0x16; - } -} -*/ #include "world/common/UnkFunc10.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240984_9166F4); -/* -void N(func_80240984_9166F4)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - - npc->duration--; - if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[1]; - if (enemy->territory->wander.moveSpeedOverride < 0) { - npc->moveSpeed = aiSettings->moveSpeed; - } else { - npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; - } - script->functionTemp[0] = 0x29; - } -} -*/ #include "world/common/UnkFunc9.inc.c" @@ -101,24 +36,5 @@ void N(func_80240984_9166F4)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240C90_916A00); INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240FE0_916D50); -/* -ApiStatus N(func_80240FE0_916D50)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241DA8_917B18) == NULL) { - N(D_80241DA8_917B18) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241DA8_917B18)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241DA8_917B18)[i]; - } - heap_free(N(D_80241DA8_917B18)); - N(D_80241DA8_917B18) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_iwa/iwa_03/918BB0.c b/src/world/area_iwa/iwa_03/918BB0.c index 6ac2314905..b9cf3d9f12 100644 --- a/src/world/area_iwa/iwa_03/918BB0.c +++ b/src/world/area_iwa/iwa_03/918BB0.c @@ -4,25 +4,6 @@ static char* N(exit_str_0) = "iwa_01"; static char* N(exit_str_1) = ""; INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918BB0", func_80240000_918BB0); -/* -ApiStatus N(func_80240000_918BB0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241530_91A0E0) == NULL) { - N(D_80241530_91A0E0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241530_91A0E0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241530_91A0E0)[i]; - } - heap_free(N(D_80241530_91A0E0)); - N(D_80241530_91A0E0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_iwa/iwa_03/918EF0.c b/src/world/area_iwa/iwa_03/918EF0.c index 0caa316167..577632dc85 100644 --- a/src/world/area_iwa/iwa_03/918EF0.c +++ b/src/world/area_iwa/iwa_03/918EF0.c @@ -5,26 +5,6 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918EF0", func_80240340_918EF0); #include "world/common/UnkNpcAIFunc18.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918EF0", func_80240514_9190C4); -/* -void N(func_80240514_9190C4)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - s32 var; - - if (script->functionTemp[1] <= 0) { - script->functionTemp[1] = aiSettings->unk_14; - if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { - npc->currentAnim = enemy->animList[9]; - fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); - ai_enemy_play_sound(npc, 0x2F4, 0x200000); - npc->duration = 12; - script->functionTemp[0] = 2; - } - } - - script->functionTemp[1]--; -} -*/ #include "world/common/UnkNpcAIFunc21.inc.c" @@ -37,55 +17,10 @@ void N(func_80240514_9190C4)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkNpcAIFunc16.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918EF0", func_802409D4_919584); -/* -void N(func_802409D4_919584)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - PlayerStatus** playerStatus = &gPlayerStatusPtr; - - npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); - if (npc->duration % 3 == 0) { - fx_walk(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0); - } - - npc->duration--; - if (npc->duration <= 0) { - playerStatus = &gPlayerStatusPtr; - - enemy->unk_10.x = npc->pos.x; - enemy->unk_10.y = npc->pos.y; - enemy->unk_10.z = npc->pos.z; - enemy->unk_07 = 1; - npc->moveSpeed = aiSettings->chaseSpeed; - npc->duration = dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) / npc->moveSpeed + 0.9; - if (npc->duration < 15) { - npc->duration = 15; - } - script->functionTemp[0] = 0x16; - } -} -*/ #include "world/common/UnkFunc10.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918EF0", func_80240CC4_919874); -/* -void N(func_80240CC4_919874)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - - npc->duration--; - if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[1]; - if (enemy->territory->wander.moveSpeedOverride < 0) { - npc->moveSpeed = aiSettings->moveSpeed; - } else { - npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; - } - script->functionTemp[0] = 0x29; - } -} -*/ #include "world/common/UnkFunc9.inc.c" diff --git a/src/world/area_iwa/iwa_04/91B8E0.c b/src/world/area_iwa/iwa_04/91B8E0.c index 874d094abd..aa9ffe5d1b 100644 --- a/src/world/area_iwa/iwa_04/91B8E0.c +++ b/src/world/area_iwa/iwa_04/91B8E0.c @@ -10,26 +10,6 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_04/91B8E0", func_80240080_91B960); #include "world/common/UnkNpcAIFunc18.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_04/91B8E0", func_80240254_91BB34); -/* -void N(func_80240254_91BB34)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - s32 var; - - if (script->functionTemp[1] <= 0) { - script->functionTemp[1] = aiSettings->unk_14; - if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { - npc->currentAnim = enemy->animList[9]; - fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); - ai_enemy_play_sound(npc, 0x2F4, 0x200000); - npc->duration = 12; - script->functionTemp[0] = 2; - } - } - - script->functionTemp[1]--; -} -*/ #include "world/common/UnkNpcAIFunc21.inc.c" @@ -42,55 +22,10 @@ void N(func_80240254_91BB34)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkNpcAIFunc16.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_04/91B8E0", func_80240714_91BFF4); -/* -void N(func_80240714_91BFF4)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - PlayerStatus** playerStatus = &gPlayerStatusPtr; - - npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); - if (npc->duration % 3 == 0) { - fx_walk(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0); - } - - npc->duration--; - if (npc->duration <= 0) { - playerStatus = &gPlayerStatusPtr; - - enemy->unk_10.x = npc->pos.x; - enemy->unk_10.y = npc->pos.y; - enemy->unk_10.z = npc->pos.z; - enemy->unk_07 = 1; - npc->moveSpeed = aiSettings->chaseSpeed; - npc->duration = dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) / npc->moveSpeed + 0.9; - if (npc->duration < 15) { - npc->duration = 15; - } - script->functionTemp[0] = 0x16; - } -} -*/ #include "world/common/UnkFunc10.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_04/91B8E0", func_80240A04_91C2E4); -/* -void N(func_80240A04_91C2E4)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - - npc->duration--; - if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[1]; - if (enemy->territory->wander.moveSpeedOverride < 0) { - npc->moveSpeed = aiSettings->moveSpeed; - } else { - npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; - } - script->functionTemp[0] = 0x29; - } -} -*/ #include "world/common/UnkFunc9.inc.c" diff --git a/src/world/area_iwa/iwa_10/91E5B0.c b/src/world/area_iwa/iwa_10/91E5B0.c index b091e936cf..d16d6121ca 100644 --- a/src/world/area_iwa/iwa_10/91E5B0.c +++ b/src/world/area_iwa/iwa_10/91E5B0.c @@ -1,24 +1,5 @@ #include "iwa_10.h" INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E5B0", func_80240040_91E5B0); -/* -ApiStatus N(func_80240040_91E5B0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241DD0_920340) == NULL) { - N(D_80241DD0_920340) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241DD0_920340)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241DD0_920340)[i]; - } - heap_free(N(D_80241DD0_920340)); - N(D_80241DD0_920340) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_iwa/iwa_10/91E6D0.c b/src/world/area_iwa/iwa_10/91E6D0.c index 613f5a14a8..96339ada2b 100644 --- a/src/world/area_iwa/iwa_10/91E6D0.c +++ b/src/world/area_iwa/iwa_10/91E6D0.c @@ -7,12 +7,6 @@ #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_8024032C_91E89C); -/* -ApiStatus N(func_8024032C_91E89C)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -31,134 +25,6 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_802404BC_91EA2C); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_802408F0_91EE60); -/* -ApiStatus N(func_802408F0_91EE60)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80245AB8_924028)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80245AB8_924028)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80245AB8_924028)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_iwa/iwa_10/91F5A0.c b/src/world/area_iwa/iwa_10/91F5A0.c index 8e11fde9da..dca19c43ce 100644 --- a/src/world/area_iwa/iwa_10/91F5A0.c +++ b/src/world/area_iwa/iwa_10/91F5A0.c @@ -7,53 +7,7 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91F5A0", func_802413E0_91F950); -/* -ApiStatus N(func_802413E0_91F950)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_8024626C_9247DC) = FALSE; - } - - if (N(D_8024626C_9247DC)) { - N(D_8024626C_9247DC) = FALSE; - evt_set_variable(script, *args, N(D_80246270_9247E0)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91F5A0", func_80241434_91F9A4); -/* -ApiStatus N(func_80241434_91F9A4)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80246270_9247E0) = evt_get_variable(script, *args); - N(D_8024626C_9247DC) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91F5A0", func_8024146C_91F9DC); -/* -ApiStatus N(func_8024146C_91F9DC)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_jan/jan_00/B20540.c b/src/world/area_jan/jan_00/B20540.c index 9013972cd5..da8005b2c0 100644 --- a/src/world/area_jan/jan_00/B20540.c +++ b/src/world/area_jan/jan_00/B20540.c @@ -10,25 +10,6 @@ INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_8024030C_B2084C); INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_80240340_B20880); INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_802403F4_B20934); -/* -ApiStatus N(func_802403F4_B20934)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802423C8_B22908) == NULL) { - N(D_802423C8_B22908) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802423C8_B22908)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802423C8_B22908)[i]; - } - heap_free(N(D_802423C8_B22908)); - N(D_802423C8_B22908) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -37,79 +18,18 @@ ApiStatus N(func_802403F4_B20934)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_80240738_B20C78); -/* -ApiStatus N(func_80240738_B20C78)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_8024242C_B2296C) = FALSE; - } - - if (N(D_8024242C_B2296C)) { - N(D_8024242C_B2296C) = FALSE; - evt_set_variable(script, *args, N(D_80242430_B22970)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_8024078C_B20CCC); -/* -ApiStatus N(func_8024078C_B20CCC)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80242430_B22970) = evt_get_variable(script, *args); - N(D_8024242C_B2296C) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_802407C4_B20D04); -/* -ApiStatus N(func_802407C4_B20D04)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_80240ADC_B2101C); -/* -ApiStatus N(func_80240ADC_B2101C)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_80240B20_B21060); -/* -ApiStatus N(func_80240B20_B21060)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_80240B4C_B2108C); diff --git a/src/world/area_jan/jan_04/B44AC0.c b/src/world/area_jan/jan_04/B44AC0.c index b9b866637b..26bb0f5f45 100644 --- a/src/world/area_jan/jan_04/B44AC0.c +++ b/src/world/area_jan/jan_04/B44AC0.c @@ -1,25 +1,6 @@ #include "jan_04.h" INCLUDE_ASM(s32, "world/area_jan/jan_04/B44AC0", func_80240350_B44AC0); -/* -ApiStatus N(func_80240350_B44AC0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241800_B45F70) == NULL) { - N(D_80241800_B45F70) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241800_B45F70)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241800_B45F70)[i]; - } - heap_free(N(D_80241800_B45F70)); - N(D_80241800_B45F70) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_jan/jan_04/B451F0.c b/src/world/area_jan/jan_04/B451F0.c index f74eaefd9d..3e5da596db 100644 --- a/src/world/area_jan/jan_04/B451F0.c +++ b/src/world/area_jan/jan_04/B451F0.c @@ -6,9 +6,8 @@ #include "world/common/GetEntityPosition.inc.c" -INCLUDE_ASM(s32, "world/area_jan/jan_04/B451F0", func_80240BE8_B45358); // Can't get this to match because the const array above is in "discarded section .data" -/* +#ifdef NON_EQUIVALENT ApiStatus func_80240BE8_B45358(Evt* script, s32 isInitialCall) { Entity* entity = get_entity_by_index(script->varTable[10]); @@ -28,7 +27,10 @@ ApiStatus func_80240BE8_B45358(Evt* script, s32 isInitialCall) { } return ApiStatus_BLOCK; } -*/ +#else +INCLUDE_ASM(s32, "world/area_jan/jan_04/B451F0", func_80240BE8_B45358); +#endif + INCLUDE_ASM(s32, "world/area_jan/jan_04/B451F0", func_80240D0C_B4547C); #define NAMESPACE dup_jan_04 diff --git a/src/world/area_jan/jan_06/B52B40.c b/src/world/area_jan/jan_06/B52B40.c index ef46ab2ddb..52b8cd4ac6 100644 --- a/src/world/area_jan/jan_06/B52B40.c +++ b/src/world/area_jan/jan_06/B52B40.c @@ -1,14 +1,3 @@ #include "jan_06.h" INCLUDE_ASM(s32, "world/area_jan/jan_06/B52B40", func_80240310_B52B40); -/* -ApiStatus N(func_80240310_B52B40)(Evt *script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - script->functionTemp[0] = evt_get_variable(script, *args++); - script->functionTemp[1] = evt_get_variable(script, *args++); - script->functionTemp[2] = evt_get_variable(script, *args++); - sfx_adjust_env_sound_pos(0x194, 0, script->functionTemp[0], script->functionTemp[1], script->functionTemp[2]); - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_jan/jan_08/B5E910.c b/src/world/area_jan/jan_08/B5E910.c index a462e6da89..5b5a131202 100644 --- a/src/world/area_jan/jan_08/B5E910.c +++ b/src/world/area_jan/jan_08/B5E910.c @@ -5,12 +5,6 @@ #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_8024069C_B5E94C); -/* -ApiStatus N(func_8024069C_B5E94C)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -29,134 +23,6 @@ INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_8024082C_B5EADC); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_80240C60_B5EF10); -/* -ApiStatus N(func_80240C60_B5EF10)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80243E58_B62108)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80243E58_B62108)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80243E58_B62108)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_jan/jan_22/B84180.c b/src/world/area_jan/jan_22/B84180.c index b7dde41327..8da7765788 100644 --- a/src/world/area_jan/jan_22/B84180.c +++ b/src/world/area_jan/jan_22/B84180.c @@ -28,112 +28,8 @@ static char* N(exit_str_3) = ""; #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_22/B84180", func_80240B94_B84D14); -/* -ApiStatus N(func_80240B94_B84D14)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_80240158_B842D8)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_802404C0_B84640)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_8024094C_B84ACC)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_80240AD4_B84C54)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_jan/jan_22/B84180", func_80240E90_B85010); -/* -ApiStatus N(func_80240E90_B85010)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802425BC_B8673C) == NULL) { - N(D_802425BC_B8673C) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802425BC_B8673C)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802425BC_B8673C)[i]; - } - heap_free(N(D_802425BC_B8673C)); - N(D_802425BC_B8673C) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kkj/kkj_00/ABB340.c b/src/world/area_kkj/kkj_00/ABB340.c index 08f5d17567..058ac25c59 100644 --- a/src/world/area_kkj/kkj_00/ABB340.c +++ b/src/world/area_kkj/kkj_00/ABB340.c @@ -23,91 +23,6 @@ #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_kkj/kkj_00/ABB340", func_80240C44_ABBED4); -/* -ApiStatus N(func_80240C44_ABBED4)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_80240208_ABB498)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_80240570_ABB800)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_802409FC_ABBC8C)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_80240B84_ABBE14)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ static char* N(exit_str) = "end_00"; diff --git a/src/world/area_kkj/kkj_01/AC5170.c b/src/world/area_kkj/kkj_01/AC5170.c index 7f4c9a17b2..bd0db7177a 100644 --- a/src/world/area_kkj/kkj_01/AC5170.c +++ b/src/world/area_kkj/kkj_01/AC5170.c @@ -28,88 +28,3 @@ static char* N(exit_str_3) = ""; #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_kkj/kkj_01/AC5170", func_80240B94_AC5D04); -/* -ApiStatus N(func_80240B94_AC5D04)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_80240158_AC52C8)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_802404C0_AC5630)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_8024094C_AC5ABC)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_80240AD4_AC5C44)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ diff --git a/src/world/area_kkj/kkj_17/AF1C60.c b/src/world/area_kkj/kkj_17/AF1C60.c index 21c4be8fc7..90ed5a20c1 100644 --- a/src/world/area_kkj/kkj_17/AF1C60.c +++ b/src/world/area_kkj/kkj_17/AF1C60.c @@ -4,25 +4,6 @@ static char* N(exit_str_0) = "kkj_11"; static char* N(exit_str_1) = ""; INCLUDE_ASM(s32, "world/area_kkj/kkj_17/AF1C60", func_80240000_AF1C60); -/* -ApiStatus N(func_80240000_AF1C60)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802408C0_AF2520) == NULL) { - N(D_802408C0_AF2520) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802408C0_AF2520)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802408C0_AF2520)[i]; - } - heap_free(N(D_802408C0_AF2520)); - N(D_802408C0_AF2520) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kkj/kkj_18/AF2FE0.c b/src/world/area_kkj/kkj_18/AF2FE0.c index b5ebc76803..361e77dc07 100644 --- a/src/world/area_kkj/kkj_18/AF2FE0.c +++ b/src/world/area_kkj/kkj_18/AF2FE0.c @@ -5,78 +5,12 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_kkj/kkj_18/AF2FE0", func_8024056C_AF320C); -/* -ApiStatus N(func_8024056C_AF320C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80241F10_AF4BB0) = FALSE; - } - - if (N(D_80241F10_AF4BB0)) { - N(D_80241F10_AF4BB0) = FALSE; - evt_set_variable(script, *args, N(D_80241F14_AF4BB4)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_18/AF2FE0", func_802405C0_AF3260); -/* -ApiStatus N(func_802405C0_AF3260)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80241F14_AF4BB4) = evt_get_variable(script, *args); - N(D_80241F10_AF4BB0) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_18/AF2FE0", func_802405F8_AF3298); -/* -ApiStatus N(func_802405F8_AF3298)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_18/AF2FE0", func_80240694_AF3334); -/* -ApiStatus N(func_80240694_AF3334)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_18/AF2FE0", func_80240730_AF33D0); diff --git a/src/world/area_kkj/kkj_19/AF7C00.c b/src/world/area_kkj/kkj_19/AF7C00.c index 0bb7bd5691..a208d73a40 100644 --- a/src/world/area_kkj/kkj_19/AF7C00.c +++ b/src/world/area_kkj/kkj_19/AF7C00.c @@ -5,78 +5,12 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_kkj/kkj_19/AF7C00", func_802404DC_AF7E2C); -/* -ApiStatus N(func_802404DC_AF7E2C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80241B10_AF9460) = FALSE; - } - - if (N(D_80241B10_AF9460)) { - N(D_80241B10_AF9460) = FALSE; - evt_set_variable(script, *args, N(D_80241B14_AF9464)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_19/AF7C00", func_80240530_AF7E80); -/* -ApiStatus N(func_80240530_AF7E80)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80241B14_AF9464) = evt_get_variable(script, *args); - N(D_80241B10_AF9460) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_19/AF7C00", func_80240568_AF7EB8); -/* -ApiStatus N(func_80240568_AF7EB8)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_19/AF7C00", func_80240604_AF7F54); -/* -ApiStatus N(func_80240604_AF7F54)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_19/AF7C00", func_802406A0_AF7FF0); diff --git a/src/world/area_kkj/kkj_20/AFDB40.c b/src/world/area_kkj/kkj_20/AFDB40.c index d0983ee7b9..7f45d3b00b 100644 --- a/src/world/area_kkj/kkj_20/AFDB40.c +++ b/src/world/area_kkj/kkj_20/AFDB40.c @@ -4,25 +4,6 @@ static char* N(exit_str_0) = "kkj_10"; static char* N(exit_str_1) = ""; INCLUDE_ASM(s32, "world/area_kkj/kkj_20/AFDB40", func_80240000_AFDB40); -/* -ApiStatus N(func_80240000_AFDB40)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80240880_AFE3C0) == NULL) { - N(D_80240880_AFE3C0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80240880_AFE3C0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80240880_AFE3C0)[i]; - } - heap_free(N(D_80240880_AFE3C0)); - N(D_80240880_AFE3C0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kmr/kmr_02/8B3A10.c b/src/world/area_kmr/kmr_02/8B3A10.c index cb5e6c0141..09bcdde105 100644 --- a/src/world/area_kmr/kmr_02/8B3A10.c +++ b/src/world/area_kmr/kmr_02/8B3A10.c @@ -1,21 +1,3 @@ #include "kmr_02.h" INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B3A10", func_802439A0_8B3A10); -/* -ApiStatus N(func_802439A0_8B3A10)(Evt *script, s32 isInitialCall) { - s32 var; - void* temp_s0 = load_asset_by_name("party_pokopi", &var); - - decode_yay0(temp_s0, N(D_80247B00)); - general_heap_free(temp_s0); - - N(D_8024BA90).unk_00 = N(D_80247D00); - N(D_8024BA90).unk_08 = 0x96; - N(D_8024BA90).unk_0A = 0x69; - N(D_8024BA90).unk_0C = 2; - N(D_8024BA90).unk_04 = N(D_80247B00); - N(D_8024BA90).unk_10 = 1; - set_message_images(&N(D_8024BA90)); - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_kmr/kmr_04/8CA960.c b/src/world/area_kmr/kmr_04/8CA960.c index 1c36e23391..2e710bdca2 100644 --- a/src/world/area_kmr/kmr_04/8CA960.c +++ b/src/world/area_kmr/kmr_04/8CA960.c @@ -7,25 +7,6 @@ #define NAMESPACE kmr_04 INCLUDE_ASM(s32, "world/area_kmr/kmr_04/8CA960", func_802402C8_8CABC8); -/* -ApiStatus N(func_802402C8_8CABC8)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802429F4_8CD2F4) == NULL) { - N(D_802429F4_8CD2F4) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802429F4_8CD2F4)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802429F4_8CD2F4)[i]; - } - heap_free(N(D_802429F4_8CD2F4)); - N(D_802429F4_8CD2F4) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kmr/kmr_05/8CE070.c b/src/world/area_kmr/kmr_05/8CE070.c index 0401b000d1..8595f6d027 100644 --- a/src/world/area_kmr/kmr_05/8CE070.c +++ b/src/world/area_kmr/kmr_05/8CE070.c @@ -14,17 +14,6 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CE070", func_802401B0_8CE220); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CE070", func_80240C54_8CECC4); -/* -void N(func_80240C54_8CECC4)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80241B2C_8CFB9C)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" diff --git a/src/world/area_kmr/kmr_06/8D1510.c b/src/world/area_kmr/kmr_06/8D1510.c index 0b0bb83eac..f3b36bc3a9 100644 --- a/src/world/area_kmr/kmr_06/8D1510.c +++ b/src/world/area_kmr/kmr_06/8D1510.c @@ -14,17 +14,6 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D1510", func_802401B0_8D16C0); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D1510", func_80240C54_8D2164); -/* -void N(func_80240C54_8D2164)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_802420BC_8D35CC)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" diff --git a/src/world/area_kmr/kmr_07/8D3DC0.c b/src/world/area_kmr/kmr_07/8D3DC0.c index b736d8ee15..9b3d8c5c01 100644 --- a/src/world/area_kmr/kmr_07/8D3DC0.c +++ b/src/world/area_kmr/kmr_07/8D3DC0.c @@ -37,17 +37,4 @@ ApiStatus func_80240A6C_8D482C(Evt* script, s32 isInitialCall) { } #else INCLUDE_ASM(s32, "world/area_kmr/kmr_07/8D3DC0", func_80240A6C_8D482C); -/* -ApiStatus N(func_80240A6C_8D482C)(void) { - Entity* entity = get_entity_by_index(evt_get_variable(NULL, 0xFD050F80)); - - if (entity == NULL) { - return ApiStatus_BLOCK; - } - - play_model_animation(entity->virtualModelIndex, &D_000001E4); - - return ApiStatus_DONE2; -} -*/ #endif diff --git a/src/world/area_kmr/kmr_09/8D5E00.c b/src/world/area_kmr/kmr_09/8D5E00.c index fde6d827ba..242dcc483b 100644 --- a/src/world/area_kmr/kmr_09/8D5E00.c +++ b/src/world/area_kmr/kmr_09/8D5E00.c @@ -14,17 +14,6 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_802401B0_8D5FB0); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_80240C54_8D6A54); -/* -void N(func_80240C54_8D6A54)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_8024186C_8D766C)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -35,67 +24,6 @@ void N(func_80240C54_8D6A54)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_8024130C_8D710C); -/* -ApiStatus N(func_8024130C_8D710C)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_802411E8_8D6FE8)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_802401B0_8D5FB0)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_80240898_8D6698)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_80240C54_8D6A54)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_80240E58_8D6C58)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ ApiStatus func_802414F8_8D72F8(Evt* script, s32 isInitialCall) { script->varTable[0] = get_enemy_safe(2); diff --git a/src/world/area_kmr/kmr_10/8D84D0.c b/src/world/area_kmr/kmr_10/8D84D0.c index b4892be9c5..89c9ea3212 100644 --- a/src/world/area_kmr/kmr_10/8D84D0.c +++ b/src/world/area_kmr/kmr_10/8D84D0.c @@ -4,25 +4,6 @@ static char* N(exit_str_0) = "kmr_11"; static char* N(exit_str_1) = "mac_00"; INCLUDE_ASM(s32, "world/area_kmr/kmr_10/8D84D0", func_80240000_8D84D0); -/* -ApiStatus N(func_80240000_8D84D0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80240C20_8D90F0) == NULL) { - N(D_80240C20_8D90F0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80240C20_8D90F0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80240C20_8D90F0)[i]; - } - heap_free(N(D_80240C20_8D90F0)); - N(D_80240C20_8D90F0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kmr/kmr_20/8ED440.c b/src/world/area_kmr/kmr_20/8ED440.c index 9a64f8a0ed..4ed9ae7291 100644 --- a/src/world/area_kmr/kmr_20/8ED440.c +++ b/src/world/area_kmr/kmr_20/8ED440.c @@ -1,25 +1,6 @@ #include "kmr_20.h" INCLUDE_ASM(s32, "world/area_kmr/kmr_20/8ED440", func_80241620_8ED440); -/* -ApiStatus N(func_80241620_8ED440)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_8024A908_8F6728) == NULL) { - N(D_8024A908_8F6728) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_8024A908_8F6728)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_8024A908_8F6728)[i]; - } - heap_free(N(D_8024A908_8F6728)); - N(D_8024A908_8F6728) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kpa/kpa_14/A57830.c b/src/world/area_kpa/kpa_14/A57830.c index d340314c50..b0ff0cfebd 100644 --- a/src/world/area_kpa/kpa_14/A57830.c +++ b/src/world/area_kpa/kpa_14/A57830.c @@ -1,25 +1,6 @@ #include "kpa_14.h" INCLUDE_ASM(s32, "world/area_kpa/kpa_14/A57830", func_80240380_A57830); -/* -ApiStatus N(func_80240380_A57830)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241900_A58DB0) == NULL) { - N(D_80241900_A58DB0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241900_A58DB0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241900_A58DB0)[i]; - } - heap_free(N(D_80241900_A58DB0)); - N(D_80241900_A58DB0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kpa/kpa_15/A596A0.c b/src/world/area_kpa/kpa_15/A596A0.c index 9f7caf7190..d311dc3f57 100644 --- a/src/world/area_kpa/kpa_15/A596A0.c +++ b/src/world/area_kpa/kpa_15/A596A0.c @@ -1,25 +1,6 @@ #include "kpa_15.h" INCLUDE_ASM(s32, "world/area_kpa/kpa_15/A596A0", func_80240310_A596A0); -/* -ApiStatus N(func_80240310_A596A0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80240AA0_A59E30) == NULL) { - N(D_80240AA0_A59E30) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80240AA0_A59E30)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80240AA0_A59E30)[i]; - } - heap_free(N(D_80240AA0_A59E30)); - N(D_80240AA0_A59E30) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kpa/kpa_81/A78510.c b/src/world/area_kpa/kpa_81/A78510.c index 7af748d1d2..a03fcfe231 100644 --- a/src/world/area_kpa/kpa_81/A78510.c +++ b/src/world/area_kpa/kpa_81/A78510.c @@ -5,75 +5,9 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_kpa/kpa_81/A78510", func_8024027C_A7873C); -/* -ApiStatus N(func_8024027C_A7873C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80240D98_A79258) = FALSE; - } - - if (N(D_80240D98_A79258)) { - N(D_80240D98_A79258) = FALSE; - evt_set_variable(script, *args, N(D_80240D9C_A7925C)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_81/A78510", func_802402D0_A78790); -/* -ApiStatus N(func_802402D0_A78790)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80240D9C_A7925C) = evt_get_variable(script, *args); - N(D_80240D98_A79258) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_81/A78510", func_80240308_A787C8); -/* -ApiStatus N(func_80240308_A787C8)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_81/A78510", func_802403A4_A78864); -/* -ApiStatus N(func_802403A4_A78864)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_kpa/kpa_82/A7A550.c b/src/world/area_kpa/kpa_82/A7A550.c index 50a8814c6d..5dce2b45e3 100644 --- a/src/world/area_kpa/kpa_82/A7A550.c +++ b/src/world/area_kpa/kpa_82/A7A550.c @@ -5,75 +5,9 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_kpa/kpa_82/A7A550", func_8024027C_A7A77C); -/* -ApiStatus N(func_8024027C_A7A77C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80240C20_A7B120) = FALSE; - } - - if (N(D_80240C20_A7B120)) { - N(D_80240C20_A7B120) = FALSE; - evt_set_variable(script, *args, N(D_80240C24_A7B124)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_82/A7A550", func_802402D0_A7A7D0); -/* -ApiStatus N(func_802402D0_A7A7D0)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80240C24_A7B124) = evt_get_variable(script, *args); - N(D_80240C20_A7B120) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_82/A7A550", func_80240308_A7A808); -/* -ApiStatus N(func_80240308_A7A808)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_82/A7A550", func_802403A4_A7A8A4); -/* -ApiStatus N(func_802403A4_A7A8A4)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_kpa/kpa_91/A86A50.c b/src/world/area_kpa/kpa_91/A86A50.c index dcec04fc42..1457a4ecb9 100644 --- a/src/world/area_kpa/kpa_91/A86A50.c +++ b/src/world/area_kpa/kpa_91/A86A50.c @@ -26,91 +26,6 @@ static char* N(exit_str_1) = ""; #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_kpa/kpa_91/A86A50", func_80240B94_A875E4); -/* -ApiStatus N(func_80240B94_A875E4)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_80240158_A86BA8)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_802404C0_A86F10)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_8024094C_A8739C)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_80240AD4_A87524)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ #include "world/common/set_script_owner_npc_anim.inc.c" diff --git a/src/world/area_kpa/kpa_95/A8CB60.c b/src/world/area_kpa/kpa_95/A8CB60.c index 8600bf1019..126fee3b06 100644 --- a/src/world/area_kpa/kpa_95/A8CB60.c +++ b/src/world/area_kpa/kpa_95/A8CB60.c @@ -23,91 +23,6 @@ #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_kpa/kpa_95/A8CB60", func_80240C74_A8D6F4); -/* -ApiStatus N(func_80240C74_A8D6F4)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_80240238_A8CCB8)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_802405A0_A8D020)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_80240A2C_A8D4AC)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_80240BB4_A8D634)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ #include "world/common/set_script_owner_npc_anim.inc.c" diff --git a/src/world/area_kzn/kzn_02/C5AC20.c b/src/world/area_kzn/kzn_02/C5AC20.c index ad3b4b17dd..6d83a7341d 100644 --- a/src/world/area_kzn/kzn_02/C5AC20.c +++ b/src/world/area_kzn/kzn_02/C5AC20.c @@ -11,17 +11,6 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80240690_C5ADD0); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80241134_C5B874); -/* -void N(func_80241134_C5B874)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80244900_C5F040)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -32,67 +21,6 @@ void N(func_80241134_C5B874)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_802417EC_C5BF2C); -/* -ApiStatus N(func_802417EC_C5BF2C)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_802416C8_C5BE08)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240690_C5ADD0)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_80240D78_C5B4B8)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_80241134_C5B874)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_80241338_C5BA78)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkNpcAIFunc13.inc.c" @@ -102,90 +30,10 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80241B08_C5C248); #include "world/common/UnkFunc45.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80241DE4_C5C524); -/* -ApiStatus N(func_80241DE4_C5C524)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_802416C8_C5BE08)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240690_C5ADD0)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_80240D78_C5B4B8)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_80241134_C5B874)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, aiSettings, territoryPtr); - break; - case 13: - N(func_80241B08_C5C248)(script, aiSettings, territoryPtr); - break; - case 14: - N(UnkFunc45)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ static char* N(exit_str_0) = "kzn_02"; INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80241FCC_C5C70C); -/* -ApiStatus N(func_80241FCC_C5C70C)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80244A10_C5F150) == NULL) { - N(D_80244A10_C5F150) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80244A10_C5F150)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80244A10_C5F150)[i]; - } - heap_free(N(D_80244A10_C5F150)); - N(D_80244A10_C5F150) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -194,76 +42,15 @@ ApiStatus N(func_80241FCC_C5C70C)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80242310_C5CA50); -/* -ApiStatus N(func_80242310_C5CA50)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80244A74_C5F1B4) = FALSE; - } - - if (N(D_80244A74_C5F1B4)) { - N(D_80244A74_C5F1B4) = FALSE; - evt_set_variable(script, *args, N(D_80244A78_C5F1B8)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80242364_C5CAA4); -/* -ApiStatus N(func_80242364_C5CAA4)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80244A78_C5F1B8) = evt_get_variable(script, *args); - N(D_80244A74_C5F1B4) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_8024239C_C5CADC); -/* -ApiStatus N(func_8024239C_C5CADC)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_802426B4_C5CDF4); -/* -ApiStatus N(func_802426B4_C5CDF4)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_802426F8_C5CE38); -/* -ApiStatus N(func_802426F8_C5CE38)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_kzn/kzn_03/C61020.c b/src/world/area_kzn/kzn_03/C61020.c index de1db402c4..18a09d47e2 100644 --- a/src/world/area_kzn/kzn_03/C61020.c +++ b/src/world/area_kzn/kzn_03/C61020.c @@ -43,25 +43,6 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_80241630_C62340); INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_8024234C_C6305C); INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_8024259C_C632AC); -/* -ApiStatus N(func_8024259C_C632AC)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802441A0_C64EB0) == NULL) { - N(D_802441A0_C64EB0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802441A0_C64EB0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802441A0_C64EB0)[i]; - } - heap_free(N(D_802441A0_C64EB0)); - N(D_802441A0_C64EB0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -70,76 +51,15 @@ ApiStatus N(func_8024259C_C632AC)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_802428E0_C635F0); -/* -ApiStatus N(func_802428E0_C635F0)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80244204_C64F14) = FALSE; - } - - if (N(D_80244204_C64F14)) { - N(D_80244204_C64F14) = FALSE; - evt_set_variable(script, *args, N(D_80244208_C64F18)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_80242934_C63644); -/* -ApiStatus N(func_80242934_C63644)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80244208_C64F18) = evt_get_variable(script, *args); - N(D_80244204_C64F14) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_8024296C_C6367C); -/* -ApiStatus N(func_8024296C_C6367C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_80242C84_C63994); -/* -ApiStatus N(func_80242C84_C63994)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_80242CC8_C639D8); -/* -ApiStatus N(func_80242CC8_C639D8)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_kzn/kzn_04/C68440.c b/src/world/area_kzn/kzn_04/C68440.c index 1cc113f6c5..f057650c77 100644 --- a/src/world/area_kzn/kzn_04/C68440.c +++ b/src/world/area_kzn/kzn_04/C68440.c @@ -5,12 +5,6 @@ #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_8024034C_C6847C); -/* -ApiStatus N(func_8024034C_C6847C)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -29,134 +23,6 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_802404DC_C6860C); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_80240910_C68A40); -/* -ApiStatus N(func_80240910_C68A40)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80241C98_C69DC8)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80241C98_C69DC8)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80241C98_C69DC8)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_kzn/kzn_07/C6EA50.c b/src/world/area_kzn/kzn_07/C6EA50.c index d37abdc7c2..2063fb3d05 100644 --- a/src/world/area_kzn/kzn_07/C6EA50.c +++ b/src/world/area_kzn/kzn_07/C6EA50.c @@ -15,17 +15,6 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_802409D0_C6ED00); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_80241474_C6F7A4); -/* -void N(func_80241474_C6F7A4)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80242B90_C70EC0)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -36,67 +25,6 @@ void N(func_80241474_C6F7A4)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_80241B2C_C6FE5C); -/* -ApiStatus N(func_80241B2C_C6FE5C)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80241A08_C6FD38)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_802409D0_C6ED00)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_802410B8_C6F3E8)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_80241474_C6F7A4)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_80241678_C6F9A8)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkNpcAIFunc13.inc.c" diff --git a/src/world/area_kzn/kzn_08/C71C10.c b/src/world/area_kzn/kzn_08/C71C10.c index 95407575ad..df32b34791 100644 --- a/src/world/area_kzn/kzn_08/C71C10.c +++ b/src/world/area_kzn/kzn_08/C71C10.c @@ -1,25 +1,6 @@ #include "kzn_08.h" INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71C10", func_80240790_C71C10); -/* -ApiStatus N(func_80240790_C71C10)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80244BB0_C76030) == NULL) { - N(D_80244BB0_C76030) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80244BB0_C76030)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80244BB0_C76030)[i]; - } - heap_free(N(D_80244BB0_C76030)); - N(D_80244BB0_C76030) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kzn/kzn_08/C71ED0.c b/src/world/area_kzn/kzn_08/C71ED0.c index 4fb90b03ec..253bd9ba4d 100644 --- a/src/world/area_kzn/kzn_08/C71ED0.c +++ b/src/world/area_kzn/kzn_08/C71ED0.c @@ -11,17 +11,6 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_80240C00_C72080); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_802416A4_C72B24); -/* -void N(func_802416A4_C72B24)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80244DA0_C76220)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -32,67 +21,6 @@ void N(func_802416A4_C72B24)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_80241D5C_C731DC); -/* -ApiStatus N(func_80241D5C_C731DC)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80241C38_C730B8)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240C00_C72080)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_802412E8_C72768)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_802416A4_C72B24)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_802418A8_C72D28)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkNpcAIFunc13.inc.c" @@ -102,67 +30,6 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_80242078_C734F8); #include "world/common/UnkFunc45.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_80242354_C737D4); -/* -ApiStatus N(func_80242354_C737D4)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80241C38_C730B8)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240C00_C72080)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_802412E8_C72768)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_802416A4_C72B24)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, aiSettings, territoryPtr); - break; - case 13: - N(func_80242078_C734F8)(script, aiSettings, territoryPtr); - break; - case 14: - N(UnkFunc45)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkNpcAIFunc6.inc.c" diff --git a/src/world/area_kzn/kzn_09/C76CE0.c b/src/world/area_kzn/kzn_09/C76CE0.c index 0bfeede86c..9f85ed0322 100644 --- a/src/world/area_kzn/kzn_09/C76CE0.c +++ b/src/world/area_kzn/kzn_09/C76CE0.c @@ -8,12 +8,6 @@ static char* N(exit_str_1) = "kzn_10"; #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_8024003C_C76D1C); -/* -ApiStatus N(func_8024003C_C76D1C)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -32,134 +26,6 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_802401CC_C76EAC); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_80240600_C772E0); -/* -ApiStatus N(func_80240600_C772E0)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80243D58_C7AA38)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80243D58_C7AA38)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80243D58_C7AA38)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_kzn/kzn_09/C77D00.c b/src/world/area_kzn/kzn_09/C77D00.c index 478c44de14..f5036554ab 100644 --- a/src/world/area_kzn/kzn_09/C77D00.c +++ b/src/world/area_kzn/kzn_09/C77D00.c @@ -43,25 +43,6 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_80242D58_C79A38); #include "world/common/AwaitPlayerNearNpc.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_802432AC_C79F8C); -/* -ApiStatus N(func_802432AC_C79F8C)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80245250_C7BF30) == NULL) { - N(D_80245250_C7BF30) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80245250_C7BF30)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80245250_C7BF30)[i]; - } - heap_free(N(D_80245250_C7BF30)); - N(D_80245250_C7BF30) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -70,76 +51,15 @@ ApiStatus N(func_802432AC_C79F8C)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_802435F0_C7A2D0); -/* -ApiStatus N(func_802435F0_C7A2D0)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_802452B4_C7BF94) = FALSE; - } - - if (N(D_802452B4_C7BF94)) { - N(D_802452B4_C7BF94) = FALSE; - evt_set_variable(script, *args, N(D_802452B8_C7BF98)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_80243644_C7A324); -/* -ApiStatus N(func_80243644_C7A324)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_802452B8_C7BF98) = evt_get_variable(script, *args); - N(D_802452B4_C7BF94) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_8024367C_C7A35C); -/* -ApiStatus N(func_8024367C_C7A35C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_80243994_C7A674); -/* -ApiStatus N(func_80243994_C7A674)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_802439D8_C7A6B8); -/* -ApiStatus N(func_802439D8_C7A6B8)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_kzn/kzn_11/C80600.c b/src/world/area_kzn/kzn_11/C80600.c index a83b577034..6efcdaffef 100644 --- a/src/world/area_kzn/kzn_11/C80600.c +++ b/src/world/area_kzn/kzn_11/C80600.c @@ -11,17 +11,6 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_80240610_C807B0); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_802410B4_C81254); -/* -void N(func_802410B4_C81254)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_802436D0_C83870)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -32,67 +21,6 @@ void N(func_802410B4_C81254)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_8024176C_C8190C); -/* -ApiStatus N(func_8024176C_C8190C)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80241648_C817E8)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240610_C807B0)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_80240CF8_C80E98)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_802410B4_C81254)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_802412B8_C81458)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkNpcAIFunc13.inc.c" @@ -102,67 +30,6 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_80241A88_C81C28); #include "world/common/UnkFunc45.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_80241D64_C81F04); -/* -ApiStatus N(func_80241D64_C81F04)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80241648_C817E8)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240610_C807B0)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_80240CF8_C80E98)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_802410B4_C81254)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, aiSettings, territoryPtr); - break; - case 13: - N(func_80241A88_C81C28)(script, aiSettings, territoryPtr); - break; - case 14: - N(UnkFunc45)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_80241F4C_C820EC); diff --git a/src/world/area_kzn/kzn_17/C85DC0.c b/src/world/area_kzn/kzn_17/C85DC0.c index 6fb44cc94a..8a9cc51b7c 100644 --- a/src/world/area_kzn/kzn_17/C85DC0.c +++ b/src/world/area_kzn/kzn_17/C85DC0.c @@ -43,25 +43,6 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_80242048_C87AF8); #include "world/common/AwaitPlayerNearNpc.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_8024259C_C8804C); -/* -ApiStatus N(func_8024259C_C8804C)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80244074_C89B24) == NULL) { - N(D_80244074_C89B24) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80244074_C89B24)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80244074_C89B24)[i]; - } - heap_free(N(D_80244074_C89B24)); - N(D_80244074_C89B24) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -70,76 +51,15 @@ ApiStatus N(func_8024259C_C8804C)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_802428E0_C88390); -/* -ApiStatus N(func_802428E0_C88390)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_802440D8_C89B88) = FALSE; - } - - if (N(D_802440D8_C89B88)) { - N(D_802440D8_C89B88) = FALSE; - evt_set_variable(script, *args, N(D_802440DC_C89B8C)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_80242934_C883E4); -/* -ApiStatus N(func_80242934_C883E4)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_802440DC_C89B8C) = evt_get_variable(script, *args); - N(D_802440D8_C89B88) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_8024296C_C8841C); -/* -ApiStatus N(func_8024296C_C8841C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_80242C84_C88734); -/* -ApiStatus N(func_80242C84_C88734)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_80242CC8_C88778); -/* -ApiStatus N(func_80242CC8_C88778)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_kzn/kzn_19/C8DBB0.c b/src/world/area_kzn/kzn_19/C8DBB0.c index e6972d65b4..e05e73dabd 100644 --- a/src/world/area_kzn/kzn_19/C8DBB0.c +++ b/src/world/area_kzn/kzn_19/C8DBB0.c @@ -27,25 +27,6 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_802413FC_C8EFAC); INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_8024140C_C8EFBC); INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80241468_C8F018); -/* -ApiStatus N(func_80241468_C8F018)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80243D74_C91924) == NULL) { - N(D_80243D74_C91924) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80243D74_C91924)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80243D74_C91924)[i]; - } - heap_free(N(D_80243D74_C91924)); - N(D_80243D74_C91924) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -54,78 +35,17 @@ ApiStatus N(func_80241468_C8F018)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_802417AC_C8F35C); -/* -ApiStatus N(func_802417AC_C8F35C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80243DD8_C91988) = FALSE; - } - - if (N(D_80243DD8_C91988)) { - N(D_80243DD8_C91988) = FALSE; - evt_set_variable(script, *args, N(D_80243DDC_C9198C)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80241800_C8F3B0); -/* -ApiStatus N(func_80241800_C8F3B0)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80243DDC_C9198C) = evt_get_variable(script, *args); - N(D_80243DD8_C91988) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80241838_C8F3E8); -/* -ApiStatus N(func_80241838_C8F3E8)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80241B50_C8F700); -/* -ApiStatus N(func_80241B50_C8F700)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80241B94_C8F744); -/* -ApiStatus N(func_80241B94_C8F744)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80241BC0_C8F770); diff --git a/src/world/area_kzn/kzn_20/C96240.c b/src/world/area_kzn/kzn_20/C96240.c index a6418f8bff..3fc8047f19 100644 --- a/src/world/area_kzn/kzn_20/C96240.c +++ b/src/world/area_kzn/kzn_20/C96240.c @@ -1,25 +1,6 @@ #include "kzn_20.h" INCLUDE_ASM(s32, "world/area_kzn/kzn_20/C96240", func_80240310_C96240); -/* -ApiStatus N(func_80240310_C96240)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241780_C976B0) == NULL) { - N(D_80241780_C976B0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241780_C976B0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241780_C976B0)[i]; - } - heap_free(N(D_80241780_C976B0)); - N(D_80241780_C976B0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -28,79 +9,18 @@ ApiStatus N(func_80240310_C96240)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_20/C96240", func_80240654_C96584); -/* -ApiStatus N(func_80240654_C96584)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_802417E4_C97714) = FALSE; - } - - if (N(D_802417E4_C97714)) { - N(D_802417E4_C97714) = FALSE; - evt_set_variable(script, *args, N(D_802417E8_C97718)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_20/C96240", func_802406A8_C965D8); -/* -ApiStatus N(func_802406A8_C965D8)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_802417E8_C97718) = evt_get_variable(script, *args); - N(D_802417E4_C97714) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_20/C96240", func_802406E0_C96610); -/* -ApiStatus N(func_802406E0_C96610)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_20/C96240", func_802409F8_C96928); -/* -ApiStatus N(func_802409F8_C96928)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_20/C96240", func_80240A3C_C9696C); -/* -ApiStatus N(func_80240A3C_C9696C)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_20/C96240", func_80240A68_C96998); diff --git a/src/world/area_mac/mac_00/7ED280.c b/src/world/area_mac/mac_00/7ED280.c index dfffa856f3..81fc45fb49 100644 --- a/src/world/area_mac/mac_00/7ED280.c +++ b/src/world/area_mac/mac_00/7ED280.c @@ -23,114 +23,10 @@ #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80243104_7EDE14); -/* -ApiStatus N(func_80243104_7EDE14)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_802426C8_7ED3D8)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_80242A30_7ED740)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_80242EBC_7EDBCC)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_80243044_7EDD54)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ static char* N(exit_str_0) = "mac_01"; INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80243400_7EE110); -/* -ApiStatus N(func_80243400_7EE110)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_8024ECE8_7F99F8) == NULL) { - N(D_8024ECE8_7F99F8) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_8024ECE8_7F99F8)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_8024ECE8_7F99F8)[i]; - } - heap_free(N(D_8024ECE8_7F99F8)); - N(D_8024ECE8_7F99F8) = NULL; - } - return ApiStatus_DONE2; -} -*/ #define NAMESPACE dup_mac_00 #include "world/common/GetItemName.inc.c" @@ -145,56 +41,10 @@ ApiStatus N(func_80243400_7EE110)(Evt* script, s32 isInitialCall) { #define NAMESPACE mac_00 INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80243744_7EE454); -/* -ApiStatus N(func_80243744_7EE454)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_8024ED4C_7F9A5C) = FALSE; - } - - if (N(D_8024ED4C_7F9A5C)) { - N(D_8024ED4C_7F9A5C) = FALSE; - evt_set_variable(script, *args, N(D_8024ED50_7F9A60)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80243798_7EE4A8); -/* -ApiStatus N(func_80243798_7EE4A8)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_8024ED50_7F9A60) = evt_get_variable(script, *args); - N(D_8024ED4C_7F9A5C) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_802437D0_7EE4E0); -/* -ApiStatus N(func_802437D0_7EE4E0)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #define NAMESPACE dup_mac_00 #include "world/common/SetManyVars.inc.c" @@ -205,20 +55,5 @@ ApiStatus N(func_802437D0_7EE4E0)(Evt* script, s32 isInitialCall) { #define NAMESPACE mac_00 INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80243AE8_7EE7F8); -/* -ApiStatus N(func_80243AE8_7EE7F8)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80243B2C_7EE83C); -/* -ApiStatus N(func_80243B2C_7EE83C)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_mac/machi/7E73A0.c b/src/world/area_mac/machi/7E73A0.c index ab0adb1f40..361f5f1690 100644 --- a/src/world/area_mac/machi/7E73A0.c +++ b/src/world/area_mac/machi/7E73A0.c @@ -76,11 +76,6 @@ INCLUDE_ASM(s32, "world/area_mac/machi/7E73A0", func_80240000_7E73A0); #include "world/common/UnkFunc36.inc.c" INCLUDE_ASM(s32, "world/area_mac/machi/7E73A0", func_80240038_7E73D8); -/* -ApiStatus N(func_80240038_7E73D8)(Evt *script, s32 isInitialCall) { - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_mac/machi/7E73A0", func_80240040_7E73E0); diff --git a/src/world/area_mgm/mgm_00/E0E7A0.c b/src/world/area_mgm/mgm_00/E0E7A0.c index e1b01d71e0..6c4963a0f2 100644 --- a/src/world/area_mgm/mgm_00/E0E7A0.c +++ b/src/world/area_mgm/mgm_00/E0E7A0.c @@ -40,90 +40,5 @@ static char* N(exit_str_3) = ""; #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_mgm/mgm_00/E0E7A0", func_80240E74_E0F614); -/* -ApiStatus N(func_80240E74_E0F614)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_80240438_E0EBD8)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_802407A0_E0EF40)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_80240C2C_E0F3CC)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_80240DB4_E0F554)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_mgm/mgm_00/E0E7A0", func_80241170_E0F910); diff --git a/src/world/area_mim/mim_02/B97C70.c b/src/world/area_mim/mim_02/B97C70.c index 529c7e36a8..a4e54a3f88 100644 --- a/src/world/area_mim/mim_02/B97C70.c +++ b/src/world/area_mim/mim_02/B97C70.c @@ -21,53 +21,7 @@ INCLUDE_ASM(s32, "world/area_mim/mim_02/B97C70", func_80240C60_B98860); #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_mim/mim_02/B97C70", func_802410B0_B98CB0); -/* -ApiStatus N(func_802410B0_B98CB0)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_802416AC_B992AC) = FALSE; - } - - if (N(D_802416AC_B992AC)) { - N(D_802416AC_B992AC) = FALSE; - evt_set_variable(script, *args, N(D_802416B0_B992B0)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_mim/mim_02/B97C70", func_80241104_B98D04); -/* -ApiStatus N(func_80241104_B98D04)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_802416B0_B992B0) = evt_get_variable(script, *args); - N(D_802416AC_B992AC) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_mim/mim_02/B97C70", func_8024113C_B98D3C); -/* -ApiStatus N(func_8024113C_B98D3C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_mim/mim_04/B9DB60.c b/src/world/area_mim/mim_04/B9DB60.c index 034bab0d2d..2353199354 100644 --- a/src/world/area_mim/mim_04/B9DB60.c +++ b/src/world/area_mim/mim_04/B9DB60.c @@ -17,24 +17,5 @@ INCLUDE_ASM(s32, "world/area_mim/mim_04/B9DB60", func_80240AAC_B9E40C); INCLUDE_ASM(s32, "world/area_mim/mim_04/B9DB60", func_80240DF0_B9E750); INCLUDE_ASM(s32, "world/area_mim/mim_04/B9DB60", func_80241014_B9E974); -/* -ApiStatus N(func_80241014_B9E974)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80242614_B9FF74) == NULL) { - N(D_80242614_B9FF74) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80242614_B9FF74)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80242614_B9FF74)[i]; - } - heap_free(N(D_80242614_B9FF74)); - N(D_80242614_B9FF74) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_mim/mim_08/BAD940.c b/src/world/area_mim/mim_08/BAD940.c index e067ca02bd..573f14e38a 100644 --- a/src/world/area_mim/mim_08/BAD940.c +++ b/src/world/area_mim/mim_08/BAD940.c @@ -18,17 +18,6 @@ INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240250_BADB90); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240CF4_BAE634); -/* -void N(func_80240CF4_BAE634)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_802443C0_BB1D00)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -39,67 +28,6 @@ void N(func_80240CF4_BAE634)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_802413AC_BAECEC); -/* -ApiStatus N(func_802413AC_BAECEC)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80241288_BAEBC8)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240250_BADB90)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_80240938_BAE278)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_80240CF4_BAE634)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_80240EF8_BAE838)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkNpcAIFunc6.inc.c" diff --git a/src/world/area_mim/mim_10/BB59E0.c b/src/world/area_mim/mim_10/BB59E0.c index 079da0ccfa..e9a2ebd4dc 100644 --- a/src/world/area_mim/mim_10/BB59E0.c +++ b/src/world/area_mim/mim_10/BB59E0.c @@ -6,14 +6,6 @@ static char* N(exit_str_2) = "kmr_22"; static char* N(exit_str_3) = ""; INCLUDE_ASM(s32, "world/area_mim/mim_10/BB59E0", func_80240000_BB59E0); -/* -ApiStatus N(func_80240000_BB59E0)(Evt *script, s32 isInitialCall) { - if (gPlayerStatus.position.y >= -210.0f) { - return ApiStatus_BLOCK; - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_mim/mim_10/BB59E0", func_80240030_BB5A10); diff --git a/src/world/area_nok/nok_02/9D7020.c b/src/world/area_nok/nok_02/9D7020.c index e6d33a668c..fa8809a4a7 100644 --- a/src/world/area_nok/nok_02/9D7020.c +++ b/src/world/area_nok/nok_02/9D7020.c @@ -18,25 +18,6 @@ static char* N(exit_str_3) = ""; #include "world/common/SomeXYZFunc2.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7020", func_802402E0_9D7300); -/* -ApiStatus N(func_802402E0_9D7300)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802453D0_9DC3F0) == NULL) { - N(D_802453D0_9DC3F0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802453D0_9DC3F0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802453D0_9DC3F0)[i]; - } - heap_free(N(D_802453D0_9DC3F0)); - N(D_802453D0_9DC3F0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #define NAMESPACE dup_nok_02 #include "world/common/GetItemName.inc.c" @@ -51,53 +32,7 @@ ApiStatus N(func_802402E0_9D7300)(Evt* script, s32 isInitialCall) { #define NAMESPACE nok_02 INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7020", func_80240624_9D7644); -/* -ApiStatus N(func_80240624_9D7644)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80245434_9DC454) = FALSE; - } - - if (N(D_80245434_9DC454)) { - N(D_80245434_9DC454) = FALSE; - evt_set_variable(script, *args, N(D_80245438_9DC458)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7020", func_80240678_9D7698); -/* -ApiStatus N(func_80240678_9D7698)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80245438_9DC458) = evt_get_variable(script, *args); - N(D_80245434_9DC454) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7020", func_802406B0_9D76D0); -/* -ApiStatus N(func_802406B0_9D76D0)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_nok/nok_02/9DA8F0.c b/src/world/area_nok/nok_02/9DA8F0.c index 0aaf2ce9c7..8d29441813 100644 --- a/src/world/area_nok/nok_02/9DA8F0.c +++ b/src/world/area_nok/nok_02/9DA8F0.c @@ -11,99 +11,14 @@ INCLUDE_ASM(s32, "world/area_nok/nok_02/9DA8F0", func_802438D0_9DA8F0); #define NAMESPACE nok_02 INCLUDE_ASM(s32, "world/area_nok/nok_02/9DA8F0", func_80243BEC_9DAC0C); -/* -ApiStatus N(func_80243BEC_9DAC0C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80252400_9E9420) = FALSE; - } - - if (N(D_80252400_9E9420)) { - N(D_80252400_9E9420) = FALSE; - evt_set_variable(script, *args, N(D_80252404_9E9424)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9DA8F0", func_80243C40_9DAC60); -/* -ApiStatus N(func_80243C40_9DAC60)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80252404_9E9424) = evt_get_variable(script, *args); - N(D_80252400_9E9420) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9DA8F0", func_80243C78_9DAC98); -/* -ApiStatus N(func_80243C78_9DAC98)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9DA8F0", func_80243D14_9DAD34); -/* -ApiStatus N(func_80243D14_9DAD34)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9DA8F0", func_80243DB0_9DADD0); -/* -ApiStatus N(func_80243DB0_9DADD0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80252720_9E9740) == NULL) { - N(D_80252720_9E9740) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80252720_9E9740)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80252720_9E9740)[i]; - } - heap_free(N(D_80252720_9E9740)); - N(D_80252720_9E9740) = NULL; - } - return ApiStatus_DONE2; -} -*/ #define NAMESPACE dup2_nok_02 #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_nok/nok_11/9F4A40.c b/src/world/area_nok/nok_11/9F4A40.c index fa04233084..3a643f543a 100644 --- a/src/world/area_nok/nok_11/9F4A40.c +++ b/src/world/area_nok/nok_11/9F4A40.c @@ -24,17 +24,6 @@ INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_80240984_9F53C4); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_80241428_9F5E68); -/* -void N(func_80241428_9F5E68)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80242888_9F72C8)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -45,67 +34,6 @@ void N(func_80241428_9F5E68)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_80241AE0_9F6520); -/* -ApiStatus N(func_80241AE0_9F6520)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_802419BC_9F63FC)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240984_9F53C4)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_8024106C_9F5AAC)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_80241428_9F5E68)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_8024162C_9F606C)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/foliage.inc.c" diff --git a/src/world/area_nok/nok_12/9FAD60.c b/src/world/area_nok/nok_12/9FAD60.c index dcabe9ac28..77a61211d6 100644 --- a/src/world/area_nok/nok_12/9FAD60.c +++ b/src/world/area_nok/nok_12/9FAD60.c @@ -33,91 +33,6 @@ INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_80240904_9FB0F4); #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_802418D8_9FC0C8); -/* -ApiStatus N(func_802418D8_9FC0C8)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_80240E9C_9FB68C)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_80241204_9FB9F4)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_80241690_9FBE80)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_80241818_9FC008)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_80241BD4_9FC3C4); diff --git a/src/world/area_nok/nok_14/A02A00.c b/src/world/area_nok/nok_14/A02A00.c index 999a91b31e..a756cacf5e 100644 --- a/src/world/area_nok/nok_14/A02A00.c +++ b/src/world/area_nok/nok_14/A02A00.c @@ -21,17 +21,6 @@ INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80240B44_A03384); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_802415E8_A03E28); -/* -void N(func_802415E8_A03E28)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80243A18_A06258)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -42,67 +31,6 @@ void N(func_802415E8_A03E28)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80241CA0_A044E0); -/* -ApiStatus N(func_80241CA0_A044E0)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80241B7C_A043BC)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240B44_A03384)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_8024122C_A03A6C)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_802415E8_A03E28)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_802417EC_A0402C)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80241E8C_A046CC); diff --git a/src/world/area_nok/nok_15/A06F00.c b/src/world/area_nok/nok_15/A06F00.c index b736e048ce..96af57e299 100644 --- a/src/world/area_nok/nok_15/A06F00.c +++ b/src/world/area_nok/nok_15/A06F00.c @@ -38,17 +38,6 @@ INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80240C64_A07B64); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80241708_A08608); -/* -void N(func_80241708_A08608)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80243D5C_A0AC5C)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -59,67 +48,6 @@ void N(func_80241708_A08608)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80241DC0_A08CC0); -/* -ApiStatus N(func_80241DC0_A08CC0)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80241C9C_A08B9C)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240C64_A07B64)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_8024134C_A0824C)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_80241708_A08608)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_8024190C_A0880C)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80241FAC_A08EAC); diff --git a/src/world/area_obk/obk_01/BBD980.c b/src/world/area_obk/obk_01/BBD980.c index c9df0602f6..5babc39abf 100644 --- a/src/world/area_obk/obk_01/BBD980.c +++ b/src/world/area_obk/obk_01/BBD980.c @@ -1,25 +1,6 @@ #include "obk_01.h" INCLUDE_ASM(s32, "world/area_obk/obk_01/BBD980", func_802407E0_BBD980); -/* -ApiStatus N(func_802407E0_BBD980)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802440F0_BC1290) == NULL) { - N(D_802440F0_BC1290) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802440F0_BC1290)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802440F0_BC1290)[i]; - } - heap_free(N(D_802440F0_BC1290)); - N(D_802440F0_BC1290) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -28,79 +9,18 @@ ApiStatus N(func_802407E0_BBD980)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_obk/obk_01/BBD980", func_80240B24_BBDCC4); -/* -ApiStatus N(func_80240B24_BBDCC4)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80244154_BC12F4) = FALSE; - } - - if (N(D_80244154_BC12F4)) { - N(D_80244154_BC12F4) = FALSE; - evt_set_variable(script, *args, N(D_80244158_BC12F8)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_obk/obk_01/BBD980", func_80240B78_BBDD18); -/* -ApiStatus N(func_80240B78_BBDD18)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80244158_BC12F8) = evt_get_variable(script, *args); - N(D_80244154_BC12F4) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_obk/obk_01/BBD980", func_80240BB0_BBDD50); -/* -ApiStatus N(func_80240BB0_BBDD50)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_obk/obk_01/BBD980", func_80240EC8_BBE068); -/* -ApiStatus N(func_80240EC8_BBE068)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_obk/obk_01/BBD980", func_80240F0C_BBE0AC); -/* -ApiStatus N(func_80240F0C_BBE0AC)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_obk/obk_01/BBD980", func_80240F38_BBE0D8); diff --git a/src/world/area_obk/obk_03/BC43F0.c b/src/world/area_obk/obk_03/BC43F0.c index 60eefdf903..57865a8193 100644 --- a/src/world/area_obk/obk_03/BC43F0.c +++ b/src/world/area_obk/obk_03/BC43F0.c @@ -1,25 +1,6 @@ #include "obk_03.h" INCLUDE_ASM(s32, "world/area_obk/obk_03/BC43F0", func_80240170_BC43F0); -/* -ApiStatus N(func_80240170_BC43F0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80242ECC_BC714C) == NULL) { - N(D_80242ECC_BC714C) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80242ECC_BC714C)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80242ECC_BC714C)[i]; - } - heap_free(N(D_80242ECC_BC714C)); - N(D_80242ECC_BC714C) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -28,76 +9,15 @@ ApiStatus N(func_80240170_BC43F0)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_obk/obk_03/BC43F0", func_802404B4_BC4734); -/* -ApiStatus N(func_802404B4_BC4734)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80242F30_BC71B0) = FALSE; - } - - if (N(D_80242F30_BC71B0)) { - N(D_80242F30_BC71B0) = FALSE; - evt_set_variable(script, *args, N(D_80242F34_BC71B4)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_obk/obk_03/BC43F0", func_80240508_BC4788); -/* -ApiStatus N(func_80240508_BC4788)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80242F34_BC71B4) = evt_get_variable(script, *args); - N(D_80242F30_BC71B0) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_obk/obk_03/BC43F0", func_80240540_BC47C0); -/* -ApiStatus N(func_80240540_BC47C0)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_obk/obk_03/BC43F0", func_80240858_BC4AD8); -/* -ApiStatus N(func_80240858_BC4AD8)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_obk/obk_03/BC43F0", func_8024089C_BC4B1C); -/* -ApiStatus N(func_8024089C_BC4B1C)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_obk/obk_04/BC7EB0.c b/src/world/area_obk/obk_04/BC7EB0.c index caa651f4db..61bfaf6be4 100644 --- a/src/world/area_obk/obk_04/BC7EB0.c +++ b/src/world/area_obk/obk_04/BC7EB0.c @@ -21,25 +21,6 @@ INCLUDE_ASM(s32, "world/area_obk/obk_04/BC7EB0", func_80240624_BC8484); INCLUDE_ASM(s32, "world/area_obk/obk_04/BC7EB0", func_80240910_BC8770); INCLUDE_ASM(s32, "world/area_obk/obk_04/BC7EB0", func_80240940_BC87A0); -/* -ApiStatus N(func_80240940_BC87A0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80243A10_BCB870) == NULL) { - N(D_80243A10_BCB870) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80243A10_BCB870)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80243A10_BCB870)[i]; - } - heap_free(N(D_80243A10_BCB870)); - N(D_80243A10_BCB870) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_obk/obk_07/BCEBF0.c b/src/world/area_obk/obk_07/BCEBF0.c index 9feb5770c1..d7c058e7a0 100644 --- a/src/world/area_obk/obk_07/BCEBF0.c +++ b/src/world/area_obk/obk_07/BCEBF0.c @@ -4,25 +4,6 @@ static char* N(exit_str_0) = "obk_01"; static char* N(exit_str_1) = ""; INCLUDE_ASM(s32, "world/area_obk/obk_07/BCEBF0", func_80240000_BCEBF0); -/* -ApiStatus N(func_80240000_BCEBF0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241FB0_BD0BA0) == NULL) { - N(D_80241FB0_BD0BA0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241FB0_BD0BA0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241FB0_BD0BA0)[i]; - } - heap_free(N(D_80241FB0_BD0BA0)); - N(D_80241FB0_BD0BA0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_obk/obk_09/BDAB00.c b/src/world/area_obk/obk_09/BDAB00.c index 5dbd979160..3baad94dd2 100644 --- a/src/world/area_obk/obk_09/BDAB00.c +++ b/src/world/area_obk/obk_09/BDAB00.c @@ -3,21 +3,3 @@ static char* N(exit_str_0) = "obk_01\0"; INCLUDE_ASM(s32, "world/area_obk/obk_09/BDAB00", func_80240350_BDAB00); -/* -ApiStatus N(func_80240350_BDAB00)(Evt *script, s32 isInitialCall) { - s32 var; - void* temp_s0 = load_asset_by_name("party_pokopi", &var); - - decode_yay0(temp_s0, N(D_80247B00)); - general_heap_free(temp_s0); - - N(D_8024BA90).unk_00 = N(D_80247D00); - N(D_8024BA90).unk_08 = 0x96; - N(D_8024BA90).unk_0A = 0x69; - N(D_8024BA90).unk_0C = 2; - N(D_8024BA90).unk_04 = N(D_80247B00); - N(D_8024BA90).unk_10 = 1; - set_message_images(&N(D_8024BA90)); - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_omo/omo_01/D9B150.c b/src/world/area_omo/omo_01/D9B150.c index c087697c26..72691e2955 100644 --- a/src/world/area_omo/omo_01/D9B150.c +++ b/src/world/area_omo/omo_01/D9B150.c @@ -3,159 +3,9 @@ static char* N(exit_str_0) = "omo_13"; INCLUDE_ASM(s32, "world/area_omo/omo_01/D9B150", func_80240260_D9B150); -/* -void N(func_80240260_D9B150)(Evt *script, NpcAISettings *npcAISettings, EnemyTerritoryThing *territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - f32 temp_f0; - f32 temp_f20; - f64 temp_f2; - f32 phi_f22; - f32 phi_f24; - f32 phi_f26; - s32 phi_s3; - - f32 subroutine_arg8; - f32 subroutine_arg9; - f32 subroutine_argA; - f32 subroutine_argB; - f32 subroutine_argC; - f32 subroutine_argD; - f32 subroutine_argE; - f32 subroutine_argF; - f32 subroutine_arg10; - - npc->duration = npcAISettings->unk_20 / 2 + rand_int(npcAISettings->unk_20 / 2 + 1); - npc->currentAnim = enemy->animList[3]; - npc->moveSpeed = npcAISettings->chaseSpeed; - phi_s3 = FALSE; - - temp_f20 = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) + 180.0f); - temp_f0 = get_clamped_angle_diff(npc->yaw, temp_f20); - if (npcAISettings->unk_1C.s < fabsf(temp_f0)) { - temp_f20 = npc->yaw; - if (temp_f0 < 0.0f) { - temp_f20 += -npcAISettings->unk_1C.s; - } else { - temp_f20 += npcAISettings->unk_1C.s; - } - } - - npc->yaw = clamp_angle(temp_f20); - - subroutine_arg8 = npc->pos.x; - subroutine_arg9 = npc->pos.y; - subroutine_argA = npc->pos.z; - - temp_f20 = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) + 180.0f); - phi_f22 = 0.0f; - phi_f24 = 0.0f; - phi_f26 = 0.0f; - - if (npc_test_move_simple_without_slipping(npc->unk_80, &subroutine_arg8, &subroutine_arg9, &subroutine_argA, npc->moveSpeed * 4.5, temp_f20, npc->collisionHeight, npc->collisionRadius) != 0) { - phi_f22 = dist2D(npc->pos.x, npc->pos.z, subroutine_arg8, subroutine_argA); - - subroutine_argB = npc->pos.x; - subroutine_argC = npc->pos.y; - subroutine_argD = npc->pos.z; - - if (npc_test_move_simple_without_slipping(npc->unk_80, &subroutine_argB, &subroutine_argC, &subroutine_argD, npc->moveSpeed * 4.5, clamp_angle(temp_f20 + 35.0f), npc->collisionHeight, npc->collisionRadius) != 0) { - phi_f24 = dist2D(npc->pos.x, npc->pos.z, subroutine_argB, subroutine_argD); - } - - subroutine_argE = npc->pos.x; - subroutine_argF = npc->pos.y; - subroutine_arg10 = npc->pos.z; - - if (npc_test_move_simple_without_slipping(npc->unk_80, &subroutine_argE, &subroutine_argF, &subroutine_arg10, npc->moveSpeed * 4.5, clamp_angle(temp_f20 - 35.0f), npc->collisionHeight, npc->collisionRadius) != 0) { - phi_f26 = dist2D(npc->pos.x, npc->pos.z, subroutine_argE, subroutine_arg10); - } - - dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - - if ((phi_f22 < npc->moveSpeed * 1.5) && (phi_f24 < npc->moveSpeed * 1.5) && (phi_f26 < npc->moveSpeed * 1.5) && - (func_800490B4(territory, enemy, npcAISettings->alertRadius, npcAISettings->unk_10.f, 0) != 0)) { - phi_s3 = TRUE; - } - - if (!phi_s3) { - if ((phi_f24 < phi_f22) && (phi_f26 < phi_f24)) { - temp_f20 = atan2(npc->pos.x, npc->pos.z, subroutine_arg8, subroutine_argA); - } else if ((phi_f24 < phi_f22) && (phi_f24 < phi_f26)) { - temp_f20 = atan2(npc->pos.x, npc->pos.z, subroutine_arg8, subroutine_argA); - } else if ((phi_f22 < phi_f24) && (phi_f26 < phi_f22)) { - temp_f20 = atan2(npc->pos.x, npc->pos.z, subroutine_argB, subroutine_argD); - } else if ((phi_f26 < phi_f24) && (phi_f22 < phi_f26)) { - temp_f20 = atan2(npc->pos.x, npc->pos.z, subroutine_argB, subroutine_argD); - } else if ((phi_f22 < phi_f26) && (phi_f24 < phi_f22)) { - temp_f20 = atan2(npc->pos.x, npc->pos.z, subroutine_argE, subroutine_arg10); - } else if ((phi_f24 < phi_f26) && (phi_f22 < phi_f24)) { - temp_f20 = atan2(npc->pos.x, npc->pos.z, subroutine_argE, subroutine_arg10); - } - - temp_f0 = get_clamped_angle_diff(npc->yaw, temp_f20); - if (npcAISettings->unk_1C.s < fabsf(temp_f0)) { - temp_f20 = npc->yaw; - if (temp_f0 < 0.0f) { - temp_f20 += -npcAISettings->unk_1C.s; - } else { - temp_f20 += npcAISettings->unk_1C.s; - } - } - npc->yaw = clamp_angle(temp_f20); - } - } - if (phi_s3) { - npc->duration = 0xA; - npc->currentAnim = enemy->animList[8]; - } - script->functionTemp[0] = 0xD; -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_01/D9B150", func_80240844_D9B734); -/* -void N(func_80240844_D9B734)(Evt *script, NpcAISettings *npcAISettings, EnemyTerritoryThing *territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - s32 var; - - if (func_800490B4(territory, enemy, npcAISettings->chaseRadius, npcAISettings->unk_28.f, 1) == 0) { - fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); - npc->currentAnim = enemy->animList[0]; - npc->duration = 25; - script->functionTemp[0] = 14; - } else { - if (npc->currentAnim != enemy->animList[8]) { - if (npc->moveSpeed < 4.0) { - func_8003D660(npc, 0); - } else { - func_8003D660(npc, 1); - } - npc_move_heading(npc, npc->moveSpeed, npc->yaw); - } - if (npc->duration > 0) { - npc->duration--; - return; - } else { - script->functionTemp[0] = 12; - } - } -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_01/D9B150", func_802409A8_D9B898); -/* -void N(func_802409A8_D9B898)(Evt *script, NpcAISettings *npcAISettings, EnemyTerritoryThing *territory) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - - npc->duration--; - if (npc->duration == 0) { - script->functionTemp[0] = NULL; - } -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_01/D9B150", func_802409EC_D9B8DC); diff --git a/src/world/area_omo/omo_04/DAD400.c b/src/world/area_omo/omo_04/DAD400.c index d52f99c374..73d60b44f7 100644 --- a/src/world/area_omo/omo_04/DAD400.c +++ b/src/world/area_omo/omo_04/DAD400.c @@ -4,25 +4,6 @@ static char* N(exit_str_0) = "omo_03"; static char* N(exit_str_1) = ""; INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_80240000_DAD400); -/* -ApiStatus N(func_80240000_DAD400)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80242630_DAFA30) == NULL) { - N(D_80242630_DAFA30) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80242630_DAFA30)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80242630_DAFA30)[i]; - } - heap_free(N(D_80242630_DAFA30)); - N(D_80242630_DAFA30) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -47,17 +28,6 @@ INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_80240550_DAD950); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_80240FF4_DAE3F4); -/* -void N(func_80240FF4_DAE3F4)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80242EF0_DB02F0)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -68,67 +38,6 @@ void N(func_80240FF4_DAE3F4)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_802416AC_DAEAAC); -/* -ApiStatus N(func_802416AC_DAEAAC)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80241588_DAE988)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240550_DAD950)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_80240C38_DAE038)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_80240FF4_DAE3F4)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_802411F8_DAE5F8)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_80241898_DAEC98); diff --git a/src/world/area_omo/omo_05/DB22C0.c b/src/world/area_omo/omo_05/DB22C0.c index 49b08d35cd..fca3bcc1e7 100644 --- a/src/world/area_omo/omo_05/DB22C0.c +++ b/src/world/area_omo/omo_05/DB22C0.c @@ -30,17 +30,6 @@ INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80240C04_DB2EC4); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_802416A8_DB3968); -/* -void N(func_802416A8_DB3968)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80242F88_DB5248)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -51,138 +40,19 @@ void N(func_802416A8_DB3968)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80241D60_DB4020); -/* -ApiStatus N(func_80241D60_DB4020)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80241C3C_DB3EFC)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240C04_DB2EC4)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_802412EC_DB35AC)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_802416A8_DB3968)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_802418AC_DB3B6C)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/GetNpcCollisionHeight.inc.c" #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80242178_DB4438); -/* -ApiStatus N(func_80242178_DB4438)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80243098_DB5358) = FALSE; - } - - if (N(D_80243098_DB5358)) { - N(D_80243098_DB5358) = FALSE; - evt_set_variable(script, *args, N(D_8024309C_DB535C)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_802421CC_DB448C); -/* -ApiStatus N(func_802421CC_DB448C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_8024309C_DB535C) = evt_get_variable(script, *args); - N(D_80243098_DB5358) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80242204_DB44C4); -/* -ApiStatus N(func_80242204_DB44C4)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_802422A0_DB4560); INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80242328_DB45E8); INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_802423C8_DB4688); -/* -ApiStatus N(func_802423C8_DB4688)(Evt *script, s32 isInitialCall) { - s32 i; - - for (i = 0; i <= 90; i++) { - N(D_802457C0)[i] = 128 + i; - } - - N(D_8024592C) = 0; - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_omo/omo_06/DB8180.c b/src/world/area_omo/omo_06/DB8180.c index ff025ed027..fa7b3fb67c 100644 --- a/src/world/area_omo/omo_06/DB8180.c +++ b/src/world/area_omo/omo_06/DB8180.c @@ -1,25 +1,6 @@ #include "omo_06.h" INCLUDE_ASM(s32, "world/area_omo/omo_06/DB8180", func_80240870_DB8180); -/* -ApiStatus N(func_80240870_DB8180)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802456C0_DBCFD0) == NULL) { - N(D_802456C0_DBCFD0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802456C0_DBCFD0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802456C0_DBCFD0)[i]; - } - heap_free(N(D_802456C0_DBCFD0)); - N(D_802456C0_DBCFD0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_omo/omo_07/DBD2B0.c b/src/world/area_omo/omo_07/DBD2B0.c index dcd63305f2..a54fc3ccc7 100644 --- a/src/world/area_omo/omo_07/DBD2B0.c +++ b/src/world/area_omo/omo_07/DBD2B0.c @@ -36,91 +36,6 @@ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80240238_DBD4E8); #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241100_DBE3B0); -/* -ApiStatus N(func_80241100_DBE3B0)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_802406C4_DBD974)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_80240A2C_DBDCDC)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_80240EB8_DBE168)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_80241040_DBE2F0)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_802413FC_DBE6AC); @@ -147,17 +62,6 @@ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241B28_DBEDD8); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_802425CC_DBF87C); -/* -void N(func_802425CC_DBF87C)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80243A14_DC0CC4)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -168,67 +72,6 @@ void N(func_802425CC_DBF87C)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80242C84_DBFF34); -/* -ApiStatus N(func_80242C84_DBFF34)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80242B60_DBFE10)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80241B28_DBEDD8)(script, aiSettings, territoryPtr); - break; - case 2: - dup_UnkNpcAIFunc1(script, aiSettings, territoryPtr); - case 3: - N(func_80242210_DBF4C0)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_802425CC_DBF87C)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_802427D0_DBFA80)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ static char* N(exit_str_2) = "omo_07"; diff --git a/src/world/area_omo/omo_07/DC01D0.c b/src/world/area_omo/omo_07/DC01D0.c index b14a406acb..b0f70af2c5 100644 --- a/src/world/area_omo/omo_07/DC01D0.c +++ b/src/world/area_omo/omo_07/DC01D0.c @@ -1,25 +1,6 @@ #include "omo_07.h" INCLUDE_ASM(s32, "world/area_omo/omo_07/DC01D0", func_80242F20_DC01D0); -/* -ApiStatus N(func_80242F20_DC01D0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80245E00_DC30B0) == NULL) { - N(D_80245E00_DC30B0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80245E00_DC30B0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80245E00_DC30B0)[i]; - } - heap_free(N(D_80245E00_DC30B0)); - N(D_80245E00_DC30B0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_omo/omo_09/DCD3F0.c b/src/world/area_omo/omo_09/DCD3F0.c index bba5620b18..2c926ed605 100644 --- a/src/world/area_omo/omo_09/DCD3F0.c +++ b/src/world/area_omo/omo_09/DCD3F0.c @@ -1,25 +1,6 @@ #include "omo_09.h" INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD3F0", func_80240720_DCD3F0); -/* -ApiStatus N(func_80240720_DCD3F0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80247010_DD3CE0) == NULL) { - N(D_80247010_DD3CE0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80247010_DD3CE0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80247010_DD3CE0)[i]; - } - heap_free(N(D_80247010_DD3CE0)); - N(D_80247010_DD3CE0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_omo/omo_09/DCD6B0.c b/src/world/area_omo/omo_09/DCD6B0.c index e5136d0d48..fdd5cb7e89 100644 --- a/src/world/area_omo/omo_09/DCD6B0.c +++ b/src/world/area_omo/omo_09/DCD6B0.c @@ -33,91 +33,6 @@ INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80240C18_DCD8E8); #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80241AE0_DCE7B0); -/* -ApiStatus N(func_80241AE0_DCE7B0)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_802410A4_DCDD74)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_8024140C_DCE0DC)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_80241898_DCE568)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_80241A20_DCE6F0)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80241DDC_DCEAAC); diff --git a/src/world/area_omo/omo_11/DDCFC0.c b/src/world/area_omo/omo_11/DDCFC0.c index 249d351330..eab67520e0 100644 --- a/src/world/area_omo/omo_11/DDCFC0.c +++ b/src/world/area_omo/omo_11/DDCFC0.c @@ -5,12 +5,6 @@ #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_802407CC_DDCFFC); -/* -ApiStatus N(func_802407CC_DDCFFC)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -29,134 +23,6 @@ INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_8024095C_DDD18C); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_80240D90_DDD5C0); -/* -ApiStatus N(func_80240D90_DDD5C0)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80241E98_DDE6C8)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80241E98_DDE6C8)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80241E98_DDE6C8)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_omo/omo_13/DE2710.c b/src/world/area_omo/omo_13/DE2710.c index 8a28dbd542..153685f802 100644 --- a/src/world/area_omo/omo_13/DE2710.c +++ b/src/world/area_omo/omo_13/DE2710.c @@ -21,55 +21,9 @@ INCLUDE_ASM(s32, "world/area_omo/omo_13/DE2710", func_80240A00_DE2E90); #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_13/DE2710", func_80240F00_DE3390); -/* -ApiStatus N(func_80240F00_DE3390)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80241C04_DE4094) = FALSE; - } - - if (N(D_80241C04_DE4094)) { - N(D_80241C04_DE4094) = FALSE; - evt_set_variable(script, *args, N(D_80241C08_DE4098)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_13/DE2710", func_80240F54_DE33E4); -/* -ApiStatus N(func_80240F54_DE33E4)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80241C08_DE4098) = evt_get_variable(script, *args); - N(D_80241C04_DE4094) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_13/DE2710", func_80240F8C_DE341C); -/* -ApiStatus N(func_80240F8C_DE341C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_13/DE2710", func_80241028_DE34B8); diff --git a/src/world/area_omo/omo_13/DE36C0.c b/src/world/area_omo/omo_13/DE36C0.c index e08a9c0682..81b3f5db67 100644 --- a/src/world/area_omo/omo_13/DE36C0.c +++ b/src/world/area_omo/omo_13/DE36C0.c @@ -1,25 +1,6 @@ #include "omo_13.h" INCLUDE_ASM(s32, "world/area_omo/omo_13/DE36C0", func_80241230_DE36C0); -/* -ApiStatus N(func_80241230_DE36C0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80242C70_DE5100) == NULL) { - N(D_80242C70_DE5100) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80242C70_DE5100)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80242C70_DE5100)[i]; - } - heap_free(N(D_80242C70_DE5100)); - N(D_80242C70_DE5100) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_omo/omo_17/DEF400.c b/src/world/area_omo/omo_17/DEF400.c index 5b2540e6ba..aac963bab4 100644 --- a/src/world/area_omo/omo_17/DEF400.c +++ b/src/world/area_omo/omo_17/DEF400.c @@ -27,17 +27,6 @@ INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80241164_DF0004); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80241C08_DF0AA8); -/* -void N(func_80241C08_DF0AA8)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80246184_DF5024)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -48,67 +37,6 @@ void N(func_80241C08_DF0AA8)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_802422C0_DF1160); -/* -ApiStatus N(func_802422C0_DF1160)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_8024219C_DF103C)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80241164_DF0004)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_8024184C_DF06EC)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_80241C08_DF0AA8)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_80241E0C_DF0CAC)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_802424AC_DF134C); diff --git a/src/world/area_osr/osr_01/AB0350.c b/src/world/area_osr/osr_01/AB0350.c index 54ed6e962b..dc9f2bb6c1 100644 --- a/src/world/area_osr/osr_01/AB0350.c +++ b/src/world/area_osr/osr_01/AB0350.c @@ -1,25 +1,6 @@ #include "osr_01.h" INCLUDE_ASM(s32, "world/area_osr/osr_01/AB0350", func_80240360_AB0350); -/* -ApiStatus N(func_80240360_AB0350)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802411B8_AB11A8) == NULL) { - N(D_802411B8_AB11A8) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802411B8_AB11A8)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802411B8_AB11A8)[i]; - } - heap_free(N(D_802411B8_AB11A8)); - N(D_802411B8_AB11A8) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -28,76 +9,15 @@ ApiStatus N(func_80240360_AB0350)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_osr/osr_01/AB0350", func_802406A4_AB0694); -/* -ApiStatus N(func_802406A4_AB0694)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_8024121C_AB120C) = FALSE; - } - - if (N(D_8024121C_AB120C)) { - N(D_8024121C_AB120C) = FALSE; - evt_set_variable(script, *args, N(D_80241220_AB1210)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_osr/osr_01/AB0350", func_802406F8_AB06E8); -/* -ApiStatus N(func_802406F8_AB06E8)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80241220_AB1210) = evt_get_variable(script, *args); - N(D_8024121C_AB120C) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_osr/osr_01/AB0350", func_80240730_AB0720); -/* -ApiStatus N(func_80240730_AB0720)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_osr/osr_01/AB0350", func_80240A48_AB0A38); -/* -ApiStatus N(func_80240A48_AB0A38)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_osr/osr_01/AB0350", func_80240A8C_AB0A7C); -/* -ApiStatus N(func_80240A8C_AB0A7C)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_pra/pra_01/D4D060.c b/src/world/area_pra/pra_01/D4D060.c index bc38d5723a..5b7c77eb51 100644 --- a/src/world/area_pra/pra_01/D4D060.c +++ b/src/world/area_pra/pra_01/D4D060.c @@ -14,78 +14,12 @@ ApiStatus func_80240F60_D4DFA0(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_01/D4D060", func_802411AC_D4E1EC); -/* -ApiStatus N(func_802411AC_D4E1EC)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80241F94_D4EFD4) = FALSE; - } - - if (N(D_80241F94_D4EFD4)) { - N(D_80241F94_D4EFD4) = FALSE; - evt_set_variable(script, *args, N(D_80241F98_D4EFD8)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_01/D4D060", func_80241200_D4E240); -/* -ApiStatus N(func_80241200_D4E240)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80241F98_D4EFD8) = evt_get_variable(script, *args); - N(D_80241F94_D4EFD4) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_01/D4D060", func_80241238_D4E278); -/* -ApiStatus N(func_80241238_D4E278)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_01/D4D060", func_802412D4_D4E314); -/* -ApiStatus N(func_802412D4_D4E314)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ ApiStatus PostChapter7StatUpdate(Evt* script, s32 isInitialCall) { PlayerData* playerData = &gPlayerData; diff --git a/src/world/area_pra/pra_02/D50010.c b/src/world/area_pra/pra_02/D50010.c index 432b4b944b..a4e09aa9b1 100644 --- a/src/world/area_pra/pra_02/D50010.c +++ b/src/world/area_pra/pra_02/D50010.c @@ -7,78 +7,12 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_02/D50010", func_8024114C_D5113C); -/* -ApiStatus N(func_8024114C_D5113C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80242ACC_D52ABC) = FALSE; - } - - if (N(D_80242ACC_D52ABC)) { - N(D_80242ACC_D52ABC) = FALSE; - evt_set_variable(script, *args, N(D_80242AD0_D52AC0)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_02/D50010", func_802411A0_D51190); -/* -ApiStatus N(func_802411A0_D51190)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80242AD0_D52AC0) = evt_get_variable(script, *args); - N(D_80242ACC_D52ABC) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_02/D50010", func_802411D8_D511C8); -/* -ApiStatus N(func_802411D8_D511C8)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_02/D50010", func_80241274_D51264); -/* -ApiStatus N(func_80241274_D51264)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetEntityPositionF.inc.c" diff --git a/src/world/area_pra/pra_05/D55BD0.c b/src/world/area_pra/pra_05/D55BD0.c index aeaa317d07..5e29ef8034 100644 --- a/src/world/area_pra/pra_05/D55BD0.c +++ b/src/world/area_pra/pra_05/D55BD0.c @@ -3,25 +3,6 @@ #include "world/common/reflection.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_05/D55BD0", func_80240F20_D56AD0); -/* -ApiStatus N(func_80240F20_D56AD0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241680_D57230) == NULL) { - N(D_80241680_D57230) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241680_D57230)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241680_D57230)[i]; - } - heap_free(N(D_80241680_D57230)); - N(D_80241680_D57230) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_pra/pra_09/D588B0.c b/src/world/area_pra/pra_09/D588B0.c index aae4b27f89..69461cc700 100644 --- a/src/world/area_pra/pra_09/D588B0.c +++ b/src/world/area_pra/pra_09/D588B0.c @@ -7,78 +7,12 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_09/D588B0", func_8024114C_D599DC); -/* -ApiStatus N(func_8024114C_D599DC)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80241D98_D5A628) = FALSE; - } - - if (N(D_80241D98_D5A628)) { - N(D_80241D98_D5A628) = FALSE; - evt_set_variable(script, *args, N(D_80241D9C_D5A62C)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_09/D588B0", func_802411A0_D59A30); -/* -ApiStatus N(func_802411A0_D59A30)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80241D9C_D5A62C) = evt_get_variable(script, *args); - N(D_80241D98_D5A628) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_09/D588B0", func_802411D8_D59A68); -/* -ApiStatus N(func_802411D8_D59A68)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_09/D588B0", func_80241274_D59B04); -/* -ApiStatus N(func_80241274_D59B04)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_09/D588B0", func_80241310_D59BA0); diff --git a/src/world/area_pra/pra_11/D61520.c b/src/world/area_pra/pra_11/D61520.c index 9b75c87ce5..ff54374da0 100644 --- a/src/world/area_pra/pra_11/D61520.c +++ b/src/world/area_pra/pra_11/D61520.c @@ -3,25 +3,6 @@ #include "world/common/reflection.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_11/D61520", func_80240F20_D62420); -/* -ApiStatus N(func_80240F20_D62420)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241610_D62B10) == NULL) { - N(D_80241610_D62B10) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241610_D62B10)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241610_D62B10)[i]; - } - heap_free(N(D_80241610_D62B10)); - N(D_80241610_D62B10) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_pra/pra_12/D62D10.c b/src/world/area_pra/pra_12/D62D10.c index 4652dc7713..d39d4fc472 100644 --- a/src/world/area_pra/pra_12/D62D10.c +++ b/src/world/area_pra/pra_12/D62D10.c @@ -5,25 +5,6 @@ INCLUDE_ASM(s32, "world/area_pra/pra_12/D62D10", func_80240000_D62D10); #include "world/common/reflection.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_12/D62D10", func_80240F50_D63C60); -/* -ApiStatus N(func_80240F50_D63C60)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802416B0_D643C0) == NULL) { - N(D_802416B0_D643C0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802416B0_D643C0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802416B0_D643C0)[i]; - } - heap_free(N(D_802416B0_D643C0)); - N(D_802416B0_D643C0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_pra/pra_13/D64600.c b/src/world/area_pra/pra_13/D64600.c index 08a96bb5f5..ea6c7a073d 100644 --- a/src/world/area_pra/pra_13/D64600.c +++ b/src/world/area_pra/pra_13/D64600.c @@ -7,88 +7,16 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_8024114C_D6572C); -/* -ApiStatus N(func_8024114C_D6572C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_802422CC_D668AC) = FALSE; - } - - if (N(D_802422CC_D668AC)) { - N(D_802422CC_D668AC) = FALSE; - evt_set_variable(script, *args, N(D_802422D0_D668B0)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_802411A0_D65780); -/* -ApiStatus N(func_802411A0_D65780)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_802422D0_D668B0) = evt_get_variable(script, *args); - N(D_802422CC_D668AC) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_802411D8_D657B8); -/* -ApiStatus N(func_802411D8_D657B8)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_80241274_D65854); -/* -ApiStatus N(func_80241274_D65854)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_80241310_D658F0); INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_802413A4_D65984); -/* -ApiStatus N(func_802413A4_D65984)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_802413D0_D659B0); diff --git a/src/world/area_pra/pra_14/D67D20.c b/src/world/area_pra/pra_14/D67D20.c index 629dd331db..a836e0aa82 100644 --- a/src/world/area_pra/pra_14/D67D20.c +++ b/src/world/area_pra/pra_14/D67D20.c @@ -3,25 +3,6 @@ #include "world/common/reflection.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_14/D67D20", func_80240F20_D68C20); -/* -ApiStatus N(func_80240F20_D68C20)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241930_D69630) == NULL) { - N(D_80241930_D69630) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241930_D69630)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241930_D69630)[i]; - } - heap_free(N(D_80241930_D69630)); - N(D_80241930_D69630) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_pra/pra_19/D6E9D0.c b/src/world/area_pra/pra_19/D6E9D0.c index b9dc71ade5..a96745f449 100644 --- a/src/world/area_pra/pra_19/D6E9D0.c +++ b/src/world/area_pra/pra_19/D6E9D0.c @@ -7,78 +7,12 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_19/D6E9D0", func_8024114C_D6FAFC); -/* -ApiStatus N(func_8024114C_D6FAFC)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_8024219C_D70B4C) = FALSE; - } - - if (N(D_8024219C_D70B4C)) { - N(D_8024219C_D70B4C) = FALSE; - evt_set_variable(script, *args, N(D_802421A0_D70B50)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_19/D6E9D0", func_802411A0_D6FB50); -/* -ApiStatus N(func_802411A0_D6FB50)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_802421A0_D70B50) = evt_get_variable(script, *args); - N(D_8024219C_D70B4C) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_19/D6E9D0", func_802411D8_D6FB88); -/* -ApiStatus N(func_802411D8_D6FB88)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_19/D6E9D0", func_80241274_D6FC24); -/* -ApiStatus N(func_80241274_D6FC24)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_19/D6E9D0", func_80241310_D6FCC0); diff --git a/src/world/area_pra/pra_27/D799F0.c b/src/world/area_pra/pra_27/D799F0.c index 4e140779ab..2f02dcf212 100644 --- a/src/world/area_pra/pra_27/D799F0.c +++ b/src/world/area_pra/pra_27/D799F0.c @@ -5,25 +5,6 @@ INCLUDE_ASM(s32, "world/area_pra/pra_27/D799F0", func_80240000_D799F0); #include "world/common/reflection.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_27/D799F0", func_80240F50_D7A940); -/* -ApiStatus N(func_80240F50_D7A940)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241690_D7B080) == NULL) { - N(D_80241690_D7B080) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241690_D7B080)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241690_D7B080)[i]; - } - heap_free(N(D_80241690_D7B080)); - N(D_80241690_D7B080) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_pra/pra_28/D7B2A0.c b/src/world/area_pra/pra_28/D7B2A0.c index bacc1c35c0..08af1d632e 100644 --- a/src/world/area_pra/pra_28/D7B2A0.c +++ b/src/world/area_pra/pra_28/D7B2A0.c @@ -5,25 +5,6 @@ INCLUDE_ASM(s32, "world/area_pra/pra_28/D7B2A0", func_80240000_D7B2A0); #include "world/common/reflection.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_28/D7B2A0", func_80240F50_D7C1F0); -/* -ApiStatus N(func_80240F50_D7C1F0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241690_D7C930) == NULL) { - N(D_80241690_D7C930) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241690_D7C930)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241690_D7C930)[i]; - } - heap_free(N(D_80241690_D7C930)); - N(D_80241690_D7C930) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_pra/pra_31/D7ED80.c b/src/world/area_pra/pra_31/D7ED80.c index db8f6e6375..699ae48b4c 100644 --- a/src/world/area_pra/pra_31/D7ED80.c +++ b/src/world/area_pra/pra_31/D7ED80.c @@ -5,78 +5,12 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_31/D7ED80", func_8024024C_D7EFAC); -/* -ApiStatus N(func_8024024C_D7EFAC)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_8024119C_D7FEFC) = FALSE; - } - - if (N(D_8024119C_D7FEFC)) { - N(D_8024119C_D7FEFC) = FALSE; - evt_set_variable(script, *args, N(D_802411A0_D7FF00)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_31/D7ED80", func_802402A0_D7F000); -/* -ApiStatus N(func_802402A0_D7F000)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_802411A0_D7FF00) = evt_get_variable(script, *args); - N(D_8024119C_D7FEFC) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_31/D7ED80", func_802402D8_D7F038); -/* -ApiStatus N(func_802402D8_D7F038)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_31/D7ED80", func_80240374_D7F0D4); -/* -ApiStatus N(func_80240374_D7F0D4)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_pra/pra_31/D7ED80", func_80240410_D7F170); diff --git a/src/world/area_pra/pra_35/D8D270.c b/src/world/area_pra/pra_35/D8D270.c index 15bbb8d3c7..16cfdc3550 100644 --- a/src/world/area_pra/pra_35/D8D270.c +++ b/src/world/area_pra/pra_35/D8D270.c @@ -25,91 +25,6 @@ #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_80241AB4_D8ED04); -/* -ApiStatus N(func_80241AB4_D8ED04)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_80241078_D8E2C8)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_802413E0_D8E630)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_8024186C_D8EABC)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_802419F4_D8EC44)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkNpcAIFunc6.inc.c" @@ -128,89 +43,3 @@ ApiStatus N(func_80241AB4_D8ED04)(Evt* script, s32 isInitialCall) { INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_802423CC_D8F61C); INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_80242698_D8F8E8); -/* -ApiStatus N(func_80242698_D8F8E8)(Evt *script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || (enemy->unk_B0 & 4)) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->wander.isFlying) { - npc->flags = (npc->flags | 0x200) & ~0x8; - } else { - npc->flags = (npc->flags & ~0x200) | 0x8; - } - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } - enemy->varTable[0] = 0; - } - - if ((script->functionTemp[0] < 30) && (enemy->varTable[0] == 0) && N(UnkNpcAIFunc26)(script)) { - script->functionTemp[0] = 30; - } - - switch (script->functionTemp[0]) { - case 0: - func_800495A0(script, npcAISettings, territoryPtr); - case 1: - func_800496B8(script, npcAISettings, territoryPtr); - break; - case 2: - base_UnkNpcAIFunc1(script, npcAISettings, territoryPtr); - case 3: - func_80049C04(script, npcAISettings, territoryPtr); - break; - case 10: - func_80049E3C(script, npcAISettings, territoryPtr); - case 11: - func_80049ECC(script, npcAISettings, territoryPtr); - break; - case 12: - func_80049F7C(script, npcAISettings, territoryPtr); - case 13: - func_8004A124(script, npcAISettings, territoryPtr); - break; - case 14: - func_8004A3E8(script, npcAISettings, territoryPtr); - break; - case 30: - N(UnkNpcAIFunc6)(script); - case 31: - N(UnkNpcAIFunc7)(script); - if (script->functionTemp[0] != 32) { - break; - } - case 32: - N(UnkNpcAIFunc8)(script); - if (script->functionTemp[0] != 33) { - break; - } - case 33: - N(UnkNpcAIFunc5)(script); - break; - case 99: - func_8004A73C(script); - } - - return ApiStatus_BLOCK; -} -*/ diff --git a/src/world/area_pra/pra_35/D8FBA0.c b/src/world/area_pra/pra_35/D8FBA0.c index e210b9c6e8..ad243b6b9f 100644 --- a/src/world/area_pra/pra_35/D8FBA0.c +++ b/src/world/area_pra/pra_35/D8FBA0.c @@ -1,25 +1,6 @@ #include "pra_35.h" INCLUDE_ASM(s32, "world/area_pra/pra_35/D8FBA0", func_80242950_D8FBA0); -/* -ApiStatus N(func_80242950_D8FBA0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80243DE0_D91030) == NULL) { - N(D_80243DE0_D91030) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80243DE0_D91030)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80243DE0_D91030)[i]; - } - heap_free(N(D_80243DE0_D91030)); - N(D_80243DE0_D91030) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_sam/sam_04/D138E0.c b/src/world/area_sam/sam_04/D138E0.c index 9a378baf92..ca31a682fc 100644 --- a/src/world/area_sam/sam_04/D138E0.c +++ b/src/world/area_sam/sam_04/D138E0.c @@ -5,75 +5,9 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_04/D138E0", func_8024053C_D13B0C); -/* -ApiStatus N(func_8024053C_D13B0C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_8024387C_D16E4C) = FALSE; - } - - if (N(D_8024387C_D16E4C)) { - N(D_8024387C_D16E4C) = FALSE; - evt_set_variable(script, *args, N(D_80243880_D16E50)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_sam/sam_04/D138E0", func_80240590_D13B60); -/* -ApiStatus N(func_80240590_D13B60)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80243880_D16E50) = evt_get_variable(script, *args); - N(D_8024387C_D16E4C) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sam/sam_04/D138E0", func_802405C8_D13B98); -/* -ApiStatus N(func_802405C8_D13B98)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sam/sam_04/D138E0", func_80240664_D13C34); -/* -ApiStatus N(func_80240664_D13C34)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_sam/sam_06/D203E0.c b/src/world/area_sam/sam_06/D203E0.c index c45cada364..e666a9fc83 100644 --- a/src/world/area_sam/sam_06/D203E0.c +++ b/src/world/area_sam/sam_06/D203E0.c @@ -11,17 +11,6 @@ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80240700_D20590); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_802411A4_D21034); -/* -void N(func_802411A4_D21034)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_802441B8_D24048)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -32,88 +21,8 @@ void N(func_802411A4_D21034)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_8024185C_D216EC); -/* -ApiStatus N(func_8024185C_D216EC)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80241738_D215C8)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240700_D20590)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_80240DE8_D20C78)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_802411A4_D21034)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_802413A8_D21238)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80241A48_D218D8); -/* -ApiStatus N(func_80241A48_D218D8)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802443D0_D24260) == NULL) { - N(D_802443D0_D24260) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802443D0_D24260)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802443D0_D24260)[i]; - } - heap_free(N(D_802443D0_D24260)); - N(D_802443D0_D24260) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -122,78 +31,12 @@ ApiStatus N(func_80241A48_D218D8)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80241D8C_D21C1C); -/* -ApiStatus N(func_80241D8C_D21C1C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80244434_D242C4) = FALSE; - } - - if (N(D_80244434_D242C4)) { - N(D_80244434_D242C4) = FALSE; - evt_set_variable(script, *args, N(D_80244438_D242C8)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80241DE0_D21C70); -/* -ApiStatus N(func_80241DE0_D21C70)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80244438_D242C8) = evt_get_variable(script, *args); - N(D_80244434_D242C4) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80241E18_D21CA8); -/* -ApiStatus N(func_80241E18_D21CA8)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80241EB4_D21D44); -/* -ApiStatus N(func_80241EB4_D21D44)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/Call800E9894.inc.c" @@ -220,22 +63,7 @@ ApiStatus N(func_80241EB4_D21D44)(Evt* script, s32 isInitialCall) { #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_802424C8_D22358); -/* -ApiStatus N(func_802424C8_D22358)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_8024250C_D2239C); -/* -ApiStatus N(func_8024250C_D2239C)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80242538_D223C8); diff --git a/src/world/area_sam/sam_08/D2FC80.c b/src/world/area_sam/sam_08/D2FC80.c index f2ba20a00a..1b6d081e02 100644 --- a/src/world/area_sam/sam_08/D2FC80.c +++ b/src/world/area_sam/sam_08/D2FC80.c @@ -8,12 +8,6 @@ static char* N(exit_str_1) = "sam_09"; #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_8024003C_D2FCBC); -/* -ApiStatus N(func_8024003C_D2FCBC)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -32,134 +26,6 @@ INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_802401CC_D2FE4C); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_80240600_D30280); -/* -ApiStatus N(func_80240600_D30280)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80241B38_D317B8)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80241B38_D317B8)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80241B38_D317B8)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_sam/sam_09/D362F0.c b/src/world/area_sam/sam_09/D362F0.c index 86bd1e6dab..181b0cd8f9 100644 --- a/src/world/area_sam/sam_09/D362F0.c +++ b/src/world/area_sam/sam_09/D362F0.c @@ -4,25 +4,6 @@ static char* N(exit_str_0) = "sam_08"; static char* N(exit_str_1) = "sam_10"; INCLUDE_ASM(s32, "world/area_sam/sam_09/D362F0", func_80240000_D362F0); -/* -ApiStatus N(func_80240000_D362F0)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802406C0_D369B0) == NULL) { - N(D_802406C0_D369B0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802406C0_D369B0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802406C0_D369B0)[i]; - } - heap_free(N(D_802406C0_D369B0)); - N(D_802406C0_D369B0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_sam/sam_10/D37800.c b/src/world/area_sam/sam_10/D37800.c index 824cf38ee2..3a05a0634e 100644 --- a/src/world/area_sam/sam_10/D37800.c +++ b/src/world/area_sam/sam_10/D37800.c @@ -6,25 +6,6 @@ static char* N(exit_str_2) = "sam_12"; static char* N(exit_str_3) = ""; INCLUDE_ASM(s32, "world/area_sam/sam_10/D37800", func_80240000_D37800); -/* -ApiStatus N(func_80240000_D37800)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241040_D38840) == NULL) { - N(D_80241040_D38840) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241040_D38840)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241040_D38840)[i]; - } - heap_free(N(D_80241040_D38840)); - N(D_80241040_D38840) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_sbk/sbk_02/92A9A0.c b/src/world/area_sbk/sbk_02/92A9A0.c index d68953d252..87feb4a94d 100644 --- a/src/world/area_sbk/sbk_02/92A9A0.c +++ b/src/world/area_sbk/sbk_02/92A9A0.c @@ -5,77 +5,12 @@ #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_sbk/sbk_02/92A9A0", func_8024091C_92ABCC); -/* -ApiStatus N(func_8024091C_92ABCC)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_8024404C_92E2FC) = FALSE; - } - - if (N(D_8024404C_92E2FC)) { - N(D_8024404C_92E2FC) = FALSE; - evt_set_variable(script, *args, N(D_80244050_92E300)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_02/92A9A0", func_80240970_92AC20); -/* -ApiStatus N(func_80240970_92AC20)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80244050_92E300) = evt_get_variable(script, *args); - N(D_8024404C_92E2FC) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_02/92A9A0", func_802409A8_92AC58); -/* -ApiStatus N(func_802409A8_92AC58)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_02/92A9A0", func_80240A44_92ACF4); -/* -ApiStatus N(func_80240A44_92ACF4)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802441D8_92E488) == NULL) { - N(D_802441D8_92E488) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802441D8_92E488)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802441D8_92E488)[i]; - } - heap_free(N(D_802441D8_92E488)); - N(D_802441D8_92E488) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_sbk/sbk_30/93F5B0.c b/src/world/area_sbk/sbk_30/93F5B0.c index 918b02107d..0eadfd4079 100644 --- a/src/world/area_sbk/sbk_30/93F5B0.c +++ b/src/world/area_sbk/sbk_30/93F5B0.c @@ -36,25 +36,6 @@ INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_8024095C_93FF0C); INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80240B64_940114); INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80240DDC_94038C); -/* -ApiStatus N(func_80240DDC_94038C)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241FF4_9415A4) == NULL) { - N(D_80241FF4_9415A4) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241FF4_9415A4)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241FF4_9415A4)[i]; - } - heap_free(N(D_80241FF4_9415A4)); - N(D_80241FF4_9415A4) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -63,100 +44,19 @@ ApiStatus N(func_80240DDC_94038C)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80241120_9406D0); -/* -ApiStatus N(func_80241120_9406D0)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80242058_941608) = FALSE; - } - - if (N(D_80242058_941608)) { - N(D_80242058_941608) = FALSE; - evt_set_variable(script, *args, N(D_8024205C_94160C)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80241174_940724); -/* -ApiStatus N(func_80241174_940724)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_8024205C_94160C) = evt_get_variable(script, *args); - N(D_80242058_941608) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_802411AC_94075C); -/* -ApiStatus N(func_802411AC_94075C)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80241248_9407F8); -/* -ApiStatus N(func_80241248_9407F8)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80241560_940B10); -/* -ApiStatus N(func_80241560_940B10)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_802415A4_940B54); -/* -ApiStatus N(func_802415A4_940B54)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ #include "world/common/foliage.inc.c" diff --git a/src/world/area_sbk/sbk_34/945F10.c b/src/world/area_sbk/sbk_34/945F10.c index 4520e7924f..db8b351ef5 100644 --- a/src/world/area_sbk/sbk_34/945F10.c +++ b/src/world/area_sbk/sbk_34/945F10.c @@ -1,25 +1,6 @@ #include "sbk_34.h" INCLUDE_ASM(s32, "world/area_sbk/sbk_34/945F10", func_80240040_945F10); -/* -ApiStatus N(func_80240040_945F10)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80240D9C_946C6C) == NULL) { - N(D_80240D9C_946C6C) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80240D9C_946C6C)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80240D9C_946C6C)[i]; - } - heap_free(N(D_80240D9C_946C6C)); - N(D_80240D9C_946C6C) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -28,76 +9,15 @@ ApiStatus N(func_80240040_945F10)(Evt* script, s32 isInitialCall) { #include "world/common/AddPlayerHandsOffset.inc.c" INCLUDE_ASM(s32, "world/area_sbk/sbk_34/945F10", func_80240384_946254); -/* -ApiStatus N(func_80240384_946254)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - if (isInitialCall) { - N(D_80240E00_946CD0) = FALSE; - } - - if (N(D_80240E00_946CD0)) { - N(D_80240E00_946CD0) = FALSE; - evt_set_variable(script, *args, N(D_80240E04_946CD4)); - return ApiStatus_DONE2; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_34/945F10", func_802403D8_9462A8); -/* -ApiStatus N(func_802403D8_9462A8)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(D_80240E04_946CD4) = evt_get_variable(script, *args); - N(D_80240E00_946CD0) = TRUE; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_34/945F10", func_80240410_9462E0); -/* -ApiStatus N(func_80240410_9462E0)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - N(D_80244A20)[i] = ptr[i]; - } - N(D_80244A20)[i] = 0; - } else { - for (i = 0; i < 0x70; i++) { - N(D_80244A20)[i] = i + 16; - N(D_80244A20)[112] = 0; - } - } - return ApiStatus_DONE2; -} -*/ #include "world/common/SetManyVars.inc.c" #include "world/common/UnkYawFunc.inc.c" INCLUDE_ASM(s32, "world/area_sbk/sbk_34/945F10", func_80240728_9465F8); -/* -ApiStatus N(func_80240728_9465F8)(Evt *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); - - D_8024E1B4 = npc->currentAnim; - npc->currentAnim = script->varTable[4]; - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_34/945F10", func_8024076C_94663C); -/* -ApiStatus N(func_8024076C_94663C)(Evt *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = D_8024E1B4; - return ApiStatus_DONE2; -} -*/ diff --git a/src/world/area_sbk/sbk_56/953FC0.c b/src/world/area_sbk/sbk_56/953FC0.c index fa8940b73e..b085015f2b 100644 --- a/src/world/area_sbk/sbk_56/953FC0.c +++ b/src/world/area_sbk/sbk_56/953FC0.c @@ -16,12 +16,6 @@ INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_8024005C_95401C); #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_802400BC_95407C); -/* -ApiStatus N(func_802400BC_95407C)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -40,134 +34,6 @@ INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_8024024C_95420C); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_80240680_954640); -/* -ApiStatus N(func_80240680_954640)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80241488_955448)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80241488_955448)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80241488_955448)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_tik/tik_02/86CA50.c b/src/world/area_tik/tik_02/86CA50.c index 2b621565b0..ae8715539d 100644 --- a/src/world/area_tik/tik_02/86CA50.c +++ b/src/world/area_tik/tik_02/86CA50.c @@ -1,25 +1,6 @@ #include "tik_02.h" INCLUDE_ASM(s32, "world/area_tik/tik_02/86CA50", func_80240310_86CA50); -/* -ApiStatus N(func_80240310_86CA50)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_802410C0_86D800) == NULL) { - N(D_802410C0_86D800) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_802410C0_86D800)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_802410C0_86D800)[i]; - } - heap_free(N(D_802410C0_86D800)); - N(D_802410C0_86D800) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_tik/tik_05/8750D0.c b/src/world/area_tik/tik_05/8750D0.c index e4fd01530b..8cb8d387b6 100644 --- a/src/world/area_tik/tik_05/8750D0.c +++ b/src/world/area_tik/tik_05/8750D0.c @@ -3,25 +3,6 @@ INCLUDE_ASM(s32, "world/area_tik/tik_05/8750D0", func_80240310_8750D0); INCLUDE_ASM(s32, "world/area_tik/tik_05/8750D0", func_80240680_875440); -/* -ApiStatus N(func_80240680_875440)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241800_8765C0) == NULL) { - N(D_80241800_8765C0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241800_8765C0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241800_8765C0)[i]; - } - heap_free(N(D_80241800_8765C0)); - N(D_80241800_8765C0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_tik/tik_07/879BE0.c b/src/world/area_tik/tik_07/879BE0.c index e5cca7b8cb..3079b16700 100644 --- a/src/world/area_tik/tik_07/879BE0.c +++ b/src/world/area_tik/tik_07/879BE0.c @@ -20,12 +20,6 @@ static char* N(exit_str_1) = "tik_07"; #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_8024031C_879EFC); -/* -ApiStatus N(func_8024031C_879EFC)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -44,134 +38,6 @@ INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_802404AC_87A08C); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_802408E0_87A4C0); -/* -ApiStatus N(func_802408E0_87A4C0)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80243A48_87D628)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80243A48_87D628)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80243A48_87D628)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_tik/tik_07/87AC00.c b/src/world/area_tik/tik_07/87AC00.c index cd6d21e01e..9d134e3e29 100644 --- a/src/world/area_tik/tik_07/87AC00.c +++ b/src/world/area_tik/tik_07/87AC00.c @@ -15,17 +15,6 @@ INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_802415A0_87B180); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_80242044_87BC24); -/* -void N(func_80242044_87BC24)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80244CB0_87E890)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" diff --git a/src/world/area_tik/tik_10/8866D0.c b/src/world/area_tik/tik_10/8866D0.c index e47c5ad9ed..8f650323af 100644 --- a/src/world/area_tik/tik_10/8866D0.c +++ b/src/world/area_tik/tik_10/8866D0.c @@ -7,12 +7,6 @@ INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_80240310_8866D0); #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_802406BC_886A7C); -/* -ApiStatus N(func_802406BC_886A7C)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -31,134 +25,6 @@ INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_8024084C_886C0C); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_80240C80_887040); -/* -ApiStatus N(func_80240C80_887040)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80242088_888448)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80242088_888448)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80242088_888448)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_tik/tik_12/8891C0.c b/src/world/area_tik/tik_12/8891C0.c index 901dee978d..9ee8aa1279 100644 --- a/src/world/area_tik/tik_12/8891C0.c +++ b/src/world/area_tik/tik_12/8891C0.c @@ -3,25 +3,6 @@ INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_802405F0_8891C0); INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80240960_889530); -/* -ApiStatus N(func_80240960_889530)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80243C40_88C810) == NULL) { - N(D_80243C40_88C810) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80243C40_88C810)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80243C40_88C810)[i]; - } - heap_free(N(D_80243C40_88C810)); - N(D_80243C40_88C810) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" @@ -34,12 +15,6 @@ ApiStatus N(func_80240960_889530)(Evt* script, s32 isInitialCall) { #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80240C58_889828); -/* -ApiStatus N(func_80240C58_889828)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -58,134 +33,6 @@ INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80240DE8_8899B8); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_8024121C_889DEC); -/* -ApiStatus N(func_8024121C_889DEC)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80243D04_88C8D4)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80243D04_88C8D4)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80243D04_88C8D4)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_tik/tik_15/890190.c b/src/world/area_tik/tik_15/890190.c index 6b9e37922b..591062a7a9 100644 --- a/src/world/area_tik/tik_15/890190.c +++ b/src/world/area_tik/tik_15/890190.c @@ -3,25 +3,6 @@ INCLUDE_ASM(s32, "world/area_tik/tik_15/890190", func_802405F0_890190); INCLUDE_ASM(s32, "world/area_tik/tik_15/890190", func_80240960_890500); -/* -ApiStatus N(func_80240960_890500)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80242758_8922F8) == NULL) { - N(D_80242758_8922F8) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80242758_8922F8)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80242758_8922F8)[i]; - } - heap_free(N(D_80242758_8922F8)); - N(D_80242758_8922F8) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_tik/tik_17/892A50.c b/src/world/area_tik/tik_17/892A50.c index e383c0a4df..4795030e48 100644 --- a/src/world/area_tik/tik_17/892A50.c +++ b/src/world/area_tik/tik_17/892A50.c @@ -5,12 +5,6 @@ #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_8024006C_892A8C); -/* -ApiStatus N(func_8024006C_892A8C)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -29,134 +23,6 @@ INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_802401FC_892C1C); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_80240630_893050); -/* -ApiStatus N(func_80240630_893050)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80241478_893E98)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80241478_893E98)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80241478_893E98)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_tik/tik_19/897BD0.c b/src/world/area_tik/tik_19/897BD0.c index 252c7440a8..04de52cbfa 100644 --- a/src/world/area_tik/tik_19/897BD0.c +++ b/src/world/area_tik/tik_19/897BD0.c @@ -5,12 +5,6 @@ #include "world/common/UnkFunc17.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_8024062C_897C0C); -/* -ApiStatus N(func_8024062C_897C0C)(Evt* script, s32 isInitialCall) { - switch_to_partner(evt_get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} -*/ #include "world/common/UnkFunc18.inc.c" @@ -29,134 +23,6 @@ INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_802407BC_897D9C); #include "world/common/UnkFunc22.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_80240BF0_8981D0); -/* -ApiStatus N(func_80240BF0_8981D0)(Evt *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; - Npc* npc = get_npc_safe(-4); - f32 sinTheta, cosTheta; - s32 i; - f32 var; - N(UserData)* userDataPtr; - N(UserData)* scriptPtr; - f32 save, save2; - - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); - - if (isInitialCall) { - script->userData = (N(UserData)*)general_heap_malloc(0x68); - scriptPtr = (N(UserData)*)script->userData; - - scriptPtr->unk_5C = get_entity_by_index(evt_get_variable(script, *args)); - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = playFX_51(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); - save = 0.0f; - userDataPtr->unk_2C[i] = save; - userDataPtr->unk_20[i] = save; - userDataPtr->unk_14[i] = save; - userDataPtr->unk_50[i] = save; - userDataPtr->unk_44[i] = save; - userDataPtr->unk_38[i] = save; - } - - scriptPtr->unk_00 = 0; - scriptPtr->unk_04 = 0; - scriptPtr->unk_60 = 0; - scriptPtr->unk_64 = 0; - - userDataPtr = scriptPtr; - for (i = 0, save = 50.0f; i < 3; i++) { - var = 0; - add_vec2D_polar(&var, &scriptPtr->unk_44[i], save, N(D_80242708_899CE8)[i]); - userDataPtr->unk_38[i] = cosTheta * var; - userDataPtr->unk_50[i] = sinTheta * var; - userDataPtr->unk_38[i] = npc->pos.x - (scriptPtr->unk_5C->position.x + userDataPtr->unk_38[i]); - userDataPtr->unk_44[i] = npc->pos.y - (scriptPtr->unk_5C->position.y + userDataPtr->unk_44[i]); - userDataPtr->unk_50[i] = npc->pos.z - (scriptPtr->unk_5C->position.z + userDataPtr->unk_50[i]); - } - } - - scriptPtr = (N(UserData)*)script->userData; - switch (scriptPtr->unk_00) { - case 0: - save = update_lerp(5, 0.0f, 50.0f, scriptPtr->unk_60, 0x14); - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80242708_899CE8)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x15) { - scriptPtr->unk_00 = 1; - scriptPtr->unk_60 = 0; - } - break; - - case 1: - save = 50.0f; - save2 = 0.0f; - for (i = 0; i < 3; i++) { - scriptPtr->unk_20[i] = save2; - var = save2; - add_vec2D_polar(&var, &scriptPtr->unk_20[i], save, N(D_80242708_899CE8)[i]); - scriptPtr->unk_14[i] = cosTheta * var; - scriptPtr->unk_2C[i] = sinTheta * var; - } - - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x10) { - scriptPtr->unk_60 = 0xF; - scriptPtr->unk_00 = 2; - } - break; - - case 2: - scriptPtr->unk_60++; - if (scriptPtr->unk_60 >= 0x1F) { - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i]->flags |= 0x10; - } - return ApiStatus_DONE2; - } - } - - switch (scriptPtr->unk_04) { - case 0: - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x10) { - scriptPtr->unk_04 = 1; - scriptPtr->unk_64 = 0; - } - break; - - case 1: - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_14[i] = userDataPtr->unk_14[i] + update_lerp(1, 0.0f, userDataPtr->unk_38[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_20[i] = userDataPtr->unk_20[i] + update_lerp(1, 0.0f, userDataPtr->unk_44[i], scriptPtr->unk_64, 0x14); - userDataPtr->unk_2C[i] = userDataPtr->unk_2C[i] + update_lerp(1, 0.0f, userDataPtr->unk_50[i], scriptPtr->unk_64, 0x14); - } - - scriptPtr->unk_64++; - if (scriptPtr->unk_64 >= 0x15) { - scriptPtr->unk_04 = 2; - scriptPtr->unk_64 = 0; - } - break; - } - - for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.x = userDataPtr->unk_14[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.y = userDataPtr->unk_20[i]; - ((EffectInstanceData*)userDataPtr->unk_08[i]->unk_0C)->rotation.z = userDataPtr->unk_2C[i]; - } - - return ApiStatus_BLOCK; -} -*/ #include "world/common/UnkFunc23.inc.c" diff --git a/src/world/area_trd/trd_00/999F80.c b/src/world/area_trd/trd_00/999F80.c index e2c37c81f6..19386980cc 100644 --- a/src/world/area_trd/trd_00/999F80.c +++ b/src/world/area_trd/trd_00/999F80.c @@ -1,25 +1,6 @@ #include "trd_00.h" INCLUDE_ASM(s32, "world/area_trd/trd_00/999F80", func_80240310_999F80); -/* -ApiStatus N(func_80240310_999F80)(Evt* script, s32 isInitialCall) { - s32 i; - - if (N(D_80241340_99AFB0) == NULL) { - N(D_80241340_99AFB0) = heap_malloc(16 * sizeof(s32)); - for (i = 0; i < 16; i++) { - N(D_80241340_99AFB0)[i] = script->varTable[i]; - } - } else { - for (i = 0; i < 16; i++) { - script->varTable[i] = N(D_80241340_99AFB0)[i]; - } - heap_free(N(D_80241340_99AFB0)); - N(D_80241340_99AFB0) = NULL; - } - return ApiStatus_DONE2; -} -*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_trd/trd_02/9A10C0.c b/src/world/area_trd/trd_02/9A10C0.c index db04759e83..06f4685a34 100644 --- a/src/world/area_trd/trd_02/9A10C0.c +++ b/src/world/area_trd/trd_02/9A10C0.c @@ -33,90 +33,5 @@ INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80240474_9A1454); #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80241448_9A2428); -/* -ApiStatus N(func_80241448_9A2428)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_80240A0C_9A19EC)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_80240D74_9A1D54)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_80241200_9A21E0)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_80241388_9A2368)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80241744_9A2724); diff --git a/src/world/area_trd/trd_04/9A88A0.c b/src/world/area_trd/trd_04/9A88A0.c index 7826048173..29979cf00f 100644 --- a/src/world/area_trd/trd_04/9A88A0.c +++ b/src/world/area_trd/trd_04/9A88A0.c @@ -33,91 +33,6 @@ INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80240844_9A8C34); #include "world/common/UnkFunc16.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80241818_9A9C08); -/* -ApiStatus N(func_80241818_9A9C08)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - Bytecode* args = script->ptrReadPos; - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* npcAISettings = (NpcAISettings*)evt_get_variable(script, *args++); - f32 posX, posY, posZ, posW; - - territory.unk_00 = 0; - territory.shape = enemy->territory->patrol.detectShape; - territory.pointX = enemy->territory->patrol.detect.x; - territory.pointZ = enemy->territory->patrol.detect.z; - territory.sizeX = enemy->territory->patrol.detectSizeX; - territory.sizeZ = enemy->territory->patrol.detectSizeZ; - territory.unk_18 = 65.0f; - territory.unk_1C = 0; - - if (isInitialCall || enemy->unk_B0 & 4) { - script->functionTemp[0] = 0; - npc->duration = 0; - npc->currentAnim = enemy->animList[0]; - npc->flags &= ~0x800; - if (!enemy->territory->patrol.isFlying) { - npc->flags = (npc->flags | 0x200) & ~8; - } else { - npc->flags = (npc->flags & ~0x200) | 8; - } - - if (enemy->unk_B0 & 4) { - script->functionTemp[0] = 99; - script->functionTemp[1] = 0; - enemy->unk_B0 &= ~4; - } else if (enemy->flags & ENEMY_FLAGS_40000000) { - script->functionTemp[0] = 12; - enemy->flags &= ~ENEMY_FLAGS_40000000; - } - - posX = npc->pos.x; - posY = npc->pos.y + npc->collisionHeight; - posZ = npc->pos.z; - posW = 100.0f; - - if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) { - npc->pos.y = posY; - } - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc24.inc.c" - case 1: - N(func_80240DDC_9A91CC)(script, npcAISettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); - case 3: - N(func_80241144_9A9534)(script, npcAISettings, territoryPtr); - break; - case 4: -#include "world/common/UnkNpcAIFunc25.inc.c" - break; - case 10: - N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); - case 11: - N(NpcJumpFunc)(script, npcAISettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); - case 13: - N(func_802415D0_9A99C0)(script, npcAISettings, territoryPtr); - break; - case 14: - N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); - break; - case 15: - N(func_80241758_9A9B48)(script, npcAISettings, territoryPtr); - break; - case 99: - func_8004A73C(script); - } - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80241B14_9A9F04); @@ -134,17 +49,6 @@ INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80241FC8_9AA3B8); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80242A6C_9AAE5C); -/* -void N(func_80242A6C_9AAE5C)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_802456F4_9ADAE4)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -155,67 +59,6 @@ void N(func_80242A6C_9AAE5C)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80243124_9AB514); -/* -ApiStatus N(func_80243124_9AB514)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80243000_9AB3F0)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80241FC8_9AA3B8)(script, aiSettings, territoryPtr); - break; - case 2: - dup_UnkNpcAIFunc1(script, aiSettings, territoryPtr); - case 3: - N(func_802426B0_9AAAA0)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_80242A6C_9AAE5C)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_80242C70_9AB060)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80243310_9AB700); diff --git a/src/world/area_trd/trd_07/9B6C90.c b/src/world/area_trd/trd_07/9B6C90.c index ab1ae7d3c8..492d2a79eb 100644 --- a/src/world/area_trd/trd_07/9B6C90.c +++ b/src/world/area_trd/trd_07/9B6C90.c @@ -21,17 +21,6 @@ INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_80240C94_9B7614); #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_80241738_9B80B8); -/* -void N(func_80241738_9B80B8)(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { - Enemy* enemy = script->owner1.enemy; - Npc* npc = get_npc_unsafe(enemy->npcID); - - npc->pos.y += N(D_80242EAC_9B982C)[npc->duration++]; - if (npc->duration >= 5) { - script->functionTemp[0] = 12; - } -} -*/ #include "world/common/UnkNpcAIFunc14.inc.c" @@ -42,67 +31,6 @@ void N(func_80241738_9B80B8)(Evt* script, NpcAISettings* aiSettings, EnemyTerrit #include "world/common/UnkFunc5.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_80241DF0_9B8770); -/* -ApiStatus N(func_80241DF0_9B8770)(Evt* script, s32 isInitialCall) { - Enemy* enemy = script->owner1.enemy; - Bytecode* args = script->ptrReadPos; - Npc* npc = get_npc_unsafe(enemy->npcID); - EnemyTerritoryThing territory; - EnemyTerritoryThing* territoryPtr = &territory; - NpcAISettings* aiSettings = evt_get_variable(script, *args); - - territory.unk_00 = 0; - territory.shape = enemy->territory->wander.detectShape; - territory.pointX = enemy->territory->wander.detect.x; - territory.pointZ = enemy->territory->wander.detect.z; - territory.sizeX = enemy->territory->wander.detectSizeX; - territory.sizeZ = enemy->territory->wander.detectSizeZ; - territory.unk_18 = 120.0f; - territory.unk_1C = 0; - - if (isInitialCall) { - N(func_80241CCC_9B864C)(npc, enemy, script, aiSettings); - } - - npc->unk_AB = -2; - - if (enemy->unk_B0 & 4) { - if (enemy->unk_B4 != 0) { - return ApiStatus_BLOCK; - } - enemy->unk_B0 &= ~4; - } - - switch (script->functionTemp[0]) { - case 0: -#include "world/common/UnkNpcAIFunc23.inc.c" - case 1: - N(func_80240C94_9B7614)(script, aiSettings, territoryPtr); - break; - case 2: - N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); - case 3: - N(func_8024137C_9B7CFC)(script, aiSettings, territoryPtr); - break; - case 10: - N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); - case 11: - N(func_80241738_9B80B8)(script, aiSettings, territoryPtr); - break; - case 12: - N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); - break; - case 13: - N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); - break; - case 14: - N(func_8024193C_9B82BC)(script, aiSettings, territoryPtr); - break; - } - - return ApiStatus_BLOCK; -} -*/ INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_80241FDC_9B895C); diff --git a/src/world/area_tst/tst_13/B1D760.c b/src/world/area_tst/tst_13/B1D760.c index ed447065d4..bacd1e5e81 100644 --- a/src/world/area_tst/tst_13/B1D760.c +++ b/src/world/area_tst/tst_13/B1D760.c @@ -1,42 +1,7 @@ #include "tst_13.h" INCLUDE_ASM(s32, "world/area_tst/tst_13/B1D760", func_80240000_B1D760); -/* -ApiStatus N(func_80240000_B1D760)(Evt *script, s32 isInitialCall) { - PlayerStatus* playerStatus = &gPlayerStatus; - s32 *array = script->array; - f32 distance = dist2D(playerStatus->position.x, playerStatus->position.z, array[2], array[3]); - - script->varTable[0] = 1; - if ((playerStatus->actionState != 14) && (playerStatus->actionState != 16)) { - script->varTable[0] = 0; - } - if (script->array[4] <= distance) { - script->varTable[0] = 0; - } - - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_tst/tst_13/B1D760", func_802400A0_B1D800); -/* -ApiStatus N(func_802400A0_B1D800)(Evt *script, s32 isInitialCall) { - PlayerStatus* playerStatus = &gPlayerStatus; - f32 distance; - s32 *array = script->array; - - distance = dist2D(playerStatus->position.x, playerStatus->position.z, array[2], array[4]); - script->varTable[0] = 0; - if (distance < 112.5f) { - script->varTable[0] = 2; - } - if (distance < 37.5f) { - script->varTable[0] = 1; - } - - return ApiStatus_DONE2; -} -*/ INCLUDE_ASM(s32, "world/area_tst/tst_13/B1D760", func_8024013C_B1D89C);