From db712faa94f8b121499ec5a058386a5f29c4e204 Mon Sep 17 00:00:00 2001 From: halkun <37340407+joshuanwalker@users.noreply.github.com> Date: Fri, 4 Sep 2026 18:50:05 -0500 Subject: [PATCH 1/2] WM functions block 1 --- config/sym_ovl_export.us.txt | 139 ++++++------ config/symbols.world.txt | 76 +++++++ src/world/world.c | 416 +++++++++++++++++------------------ src/world/world.h | 40 ++-- 4 files changed, 374 insertions(+), 297 deletions(-) diff --git a/config/sym_ovl_export.us.txt b/config/sym_ovl_export.us.txt index 522003ac..ec30d777 100644 --- a/config/sym_ovl_export.us.txt +++ b/config/sym_ovl_export.us.txt @@ -1886,26 +1886,26 @@ RestoreCharacterMateria = 0x801d3138; func_801D3260 = 0x801d3260; g_MateriaPriority = 0x801d3834; g_MateriaStealLoot = 0x801d3f60; -func_800A0B48 = 0x800a0b48; +WmSetRenderBuffers = 0x800a0b48; func_800A0BE4 = 0x800a0be4; -func_800A0C54 = 0x800a0c54; -func_800A0D2C = 0x800a0d2c; +WmLoadTxzFile = 0x800a0c54; +WmLoadTxzDataAndInit = 0x800a0d2c; func_800A12AC = 0x800a12ac; -func_800A1370 = 0x800a1370; -func_800A141C = 0x800a141c; +WmPrepareForRender = 0x800a1370; +WmRenderAll = 0x800a141c; func_800A16E0 = 0x800a16e0; -func_800A1710 = 0x800a1710; +WmIsTerrainPassableByModel = 0x800a1710; func_800A19FC = 0x800a19fc; -func_800A1D14 = 0x800a1d14; -func_800A1D38 = 0x800a1d38; +WmGetRealCamRot = 0x800a1d14; +WmSetCamRot = 0x800a1d38; func_800A1D54 = 0x800a1d54; func_800A1DF0 = 0x800a1df0; -func_800A1FAC = 0x800a1fac; +WmSetTranslationVectorInScreenSpace = 0x800a1fac; func_800A2040 = 0x800a2040; -func_800A2088 = 0x800a2088; +WmSetCamView = 0x800a2088; func_800A2108 = 0x800a2108; func_800A21A4 = 0x800a21a4; -func_800A21B4 = 0x800a21b4; +WmHandleButtons = 0x800a21b4; func_800A31C0 = 0x800a31c0; func_800A31E8 = 0x800a31e8; func_800A31F8 = 0x800a31f8; @@ -1917,12 +1917,12 @@ func_800A38C8 = 0x800a38c8; func_800A3908 = 0x800a3908; func_800A3964 = 0x800a3964; func_800A3C74 = 0x800a3c74; -func_800A3DFC = 0x800a3dfc; -func_800A3E4C = 0x800a3e4c; +WmSubmarineFloatToPlanet = 0x800a3dfc; +WmSubmarineSubmergeUnderwater = 0x800a3e4c; func_800A3E9C = 0x800a3e9c; func_800A3EC8 = 0x800a3ec8; func_800A3F4C = 0x800a3f4c; -func_800A4008 = 0x800a4008; +WmResetGame = 0x800a4008; func_800A4080 = 0x800a4080; func_800A40B8 = 0x800a40b8; func_800A40F0 = 0x800a40f0; @@ -1937,19 +1937,20 @@ func_800A45C4 = 0x800a45c4; func_800A45D4 = 0x800a45d4; func_800A45E4 = 0x800a45e4; func_800A45F4 = 0x800a45f4; -func_800A4DDC = 0x800a4ddc; -func_800A4F08 = 0x800a4f08; +WmMain = 0x800a460c; +WmInitLoadMapFileStruct = 0x800a4ddc; +WmGetBlockIdByXZForPlanet = 0x800a4f08; func_800A4F78 = 0x800a4f78; func_800A5208 = 0x800a5208; func_800A52A4 = 0x800a52a4; func_800A5348 = 0x800a5348; -func_800A53A8 = 0x800a53a8; -func_800A54F0 = 0x800a54f0; +WmLoadClosestMapFileBlock = 0x800a53a8; +WmStartLoadingMapFileBlock = 0x800a54f0; func_800A57C8 = 0x800a57c8; -func_800A5924 = 0x800a5924; -func_800A5970 = 0x800a5970; +WmMapLoadFinishedCallback = 0x800a5924; +WmGetNumberOfMapToLoad = 0x800a5970; func_800A59A0 = 0x800a59a0; -func_800A5A20 = 0x800a5a20; +WmGetElementWithBlockIdAndSetItFirst = 0x800a5a20; func_800A5A94 = 0x800a5a94; func_800A5AD8 = 0x800a5ad8; func_800A5B88 = 0x800a5b88; @@ -1962,8 +1963,8 @@ func_800A6168 = 0x800a6168; func_800A63FC = 0x800a63fc; func_800A64AC = 0x800a64ac; func_800A67A8 = 0x800a67a8; -func_800A6884 = 0x800a6884; -func_800A692C = 0x800a692c; +WmExtractLoopCoordsTopBottomParts = 0x800a6884; +WmLoopCoordsAroundWorld = 0x800a692c; func_800A6994 = 0x800a6994; func_800A6B8C = 0x800a6b8c; func_800A6BCC = 0x800a6bcc; @@ -1972,47 +1973,47 @@ func_800A6C3C = 0x800a6c3c; func_800A6FC0 = 0x800a6fc0; func_800A71E8 = 0x800a71e8; func_800A7EA4 = 0x800a7ea4; -func_800A7F18 = 0x800a7f18; -func_800A7F38 = 0x800a7f38; +WmAbortMapLoadingWrapper = 0x800a7f18; +WmAbortMapLoading = 0x800a7f38; func_800A806C = 0x800a806c; func_800A82F0 = 0x800a82f0; func_800A8300 = 0x800a8300; func_800A835C = 0x800a835c; func_800A86C4 = 0x800a86c4; func_800A886C = 0x800a886c; -func_800A8888 = 0x800a8888; +WmSetWorldProgress = 0x800a8888; func_800A8898 = 0x800a8898; -func_800A891C = 0x800a891c; -func_800A8A1C = 0x800a8a1c; +WmInitAllEntityStructs = 0x800a891c; +WmInsertInEntityStructList = 0x800a8a1c; func_800A8A88 = 0x800a8a88; -func_800A8ABC = 0x800a8abc; -func_800A8AF4 = 0x800a8af4; -func_800A8B30 = 0x800a8b30; -func_800A8C70 = 0x800a8c70; +WmCleanEntityStruct = 0x800a8abc; +WmUnlinkEntityAndInsertAsNew = 0x800a8af4; +WmUnlinkEntityFromAll = 0x800a8b30; +WmInsertStructInEntityStructList = 0x800a8c70; func_800A8CA4 = 0x800a8ca4; -func_800A8CE4 = 0x800a8ce4; +WmLinkPcToActiveEntity = 0x800a8ce4; func_800A8D58 = 0x800a8d58; func_800A8E50 = 0x800a8e50; func_800A8F48 = 0x800a8f48; -func_800A8F74 = 0x800a8f74; -func_800A8FA0 = 0x800a8fa0; -func_800A8FCC = 0x800a8fcc; +WmUnlinkPcEntityFromAll = 0x800a8f74; +WmUnlinkActiveEntityFromAll = 0x800a8fa0; +WmUnlinkPcLinkedEntityFromAll = 0x800a8fcc; func_800A9018 = 0x800a9018; func_800A9064 = 0x800a9064; -func_800A90EC = 0x800a90ec; -func_800A9110 = 0x800a9110; +WmSetPcEntityAsActiveEntity = 0x800a90ec; +WmSetActiveEntityAsPcEntity = 0x800a9110; func_800A9134 = 0x800a9134; -func_800A9154 = 0x800a9154; -func_800A9174 = 0x800a9174; +WmGetModelIdFromActiveEntity = 0x800a9154; +WmGetModelIdFromPcEntity = 0x800a9174; func_800A9194 = 0x800a9194; -func_800A91A4 = 0x800a91a4; +WmIsPcEntityModelInMask = 0x800a91a4; func_800A91E0 = 0x800a91e0; func_800A921C = 0x800a921c; func_800A9240 = 0x800a9240; func_800A929C = 0x800a929c; func_800A92F8 = 0x800a92f8; -func_800A9334 = 0x800a9334; -func_800A9480 = 0x800a9480; +WmInitActiveEntityStruct = 0x800a9334; +WmSetActiveEntityDirectionAndRot = 0x800a9480; func_800A94A8 = 0x800a94a8; func_800A94D0 = 0x800a94d0; func_800A94F4 = 0x800a94f4; @@ -2021,19 +2022,19 @@ func_800A9678 = 0x800a9678; func_800A96A4 = 0x800a96a4; func_800A96D0 = 0x800a96d0; func_800A97A8 = 0x800a97a8; -func_800A97E4 = 0x800a97e4; +WmGetPcEntityTotalRot = 0x800a97e4; func_800A9820 = 0x800a9820; func_800A984C = 0x800a984c; func_800A9878 = 0x800a9878; func_800A98A4 = 0x800a98a4; -func_800A98E4 = 0x800a98e4; -func_800A9910 = 0x800a9910; -func_800A993C = 0x800a993c; +WmIsPcEntityPosNeedRecalculation = 0x800a98e4; +WmGetPcEntityOriginalY = 0x800a9910; +WmSetActiveEntityWithModelId = 0x800a993c; func_800A9988 = 0x800a9988; func_800A99BC = 0x800a99bc; func_800A9A04 = 0x800a9a04; -func_800A9A24 = 0x800a9a24; -func_800A9A44 = 0x800a9a44; +WmSetPcEntityTerrainData = 0x800a9a24; +WmGetPcEntityTerrainId = 0x800a9a44; func_800A9A70 = 0x800a9a70; func_800A9AA4 = 0x800a9aa4; func_800A9AD0 = 0x800a9ad0; @@ -2043,10 +2044,10 @@ func_800A9D5C = 0x800a9d5c; func_800A9D88 = 0x800a9d88; func_800A9DB4 = 0x800a9db4; func_800A9E14 = 0x800a9e14; -func_800AA098 = 0x800aa098; -func_800AA0E0 = 0x800aa0e0; -func_800AA128 = 0x800aa128; -func_800AA170 = 0x800aa170; +WmGetPosFromActiveEntity = 0x800aa098; +WmGetPosFromPcEntity = 0x800aa0e0; +WmGetPos2FromActiveEntity = 0x800aa128; +WmGetPos2FromPcEntity = 0x800aa170; func_800AA1B8 = 0x800aa1b8; func_800AA238 = 0x800aa238; func_800AA2B8 = 0x800aa2b8; @@ -2056,36 +2057,36 @@ func_800AA640 = 0x800aa640; func_800AA684 = 0x800aa684; func_800AA6A4 = 0x800aa6a4; func_800AA6D0 = 0x800aa6d0; -func_800AA7DC = 0x800aa7dc; +WmMoveActiveEntity = 0x800aa7dc; func_800AA8D8 = 0x800aa8d8; func_800AA8F8 = 0x800aa8f8; -func_800AAA00 = 0x800aaa00; +WmGetBuggyMoveAnimationId = 0x800aaa00; func_800AAB18 = 0x800aab18; func_800AB36C = 0x800ab36c; func_800AB398 = 0x800ab398; func_800AB48C = 0x800ab48c; -func_800AB4F4 = 0x800ab4f4; +WmPrepareEntities = 0x800ab4f4; func_800AB570 = 0x800ab570; -func_800AB5E4 = 0x800ab5e4; -func_800AB6E4 = 0x800ab6e4; -func_800AB8EC = 0x800ab8ec; +WmScriptInitVariables = 0x800ab5e4; +WmScriptRunFunction = 0x800ab6e4; +WmScriptDisableForPcEntity = 0x800ab8ec; func_800AB92C = 0x800ab92c; func_800AB988 = 0x800ab988; func_800ABA18 = 0x800aba18; func_800ABA78 = 0x800aba78; -func_800ABB24 = 0x800abb24; -func_800ABE58 = 0x800abe58; -func_800ABFC0 = 0x800abfc0; -func_800AC3C0 = 0x800ac3c0; -func_800AC484 = 0x800ac484; -func_800AC700 = 0x800ac700; -func_800AD63C = 0x800ad63c; -func_800AD788 = 0x800ad788; +WmScriptPopStack = 0x800abb24; +WmScriptWriteBank = 0x800abe58; +WmScriptOpcode000Handle = 0x800abfc0; +WmScriptOpcode100Handle = 0x800ac3c0; +WmScriptOpcode200Handle = 0x800ac484; +WmScriptOpcode300Handle = 0x800ac700; +WmScriptRunOne = 0x800ad63c; +WmScriptRunAll = 0x800ad788; func_800AD804 = 0x800ad804; -func_800AD928 = 0x800ad928; +WmScriptIsAnyScriptRuns = 0x800ad928; func_800AD970 = 0x800ad970; func_800ADA08 = 0x800ada08; -func_800ADA64 = 0x800ada64; +WmRestoreEntityPosAndDirFromSavemap = 0x800ada64; func_800ADB30 = 0x800adb30; func_800ADC3C = 0x800adc3c; func_800ADC70 = 0x800adc70; diff --git a/config/symbols.world.txt b/config/symbols.world.txt index d565a6e4..9bf0a891 100644 --- a/config/symbols.world.txt +++ b/config/symbols.world.txt @@ -1 +1,77 @@ func_800BD124 = 0x800BD124; + +WmSetRenderBuffers = 0x800A0B48; +WmGetCurrRenderBufferId = 0x800A0BD4; +WmLoadTxzFile = 0x800A0C54; +WmLoadTxzDataAndInit = 0x800A0D2C; +WmPrepareForRender = 0x800A1370; +WmRenderAll = 0x800A141C; +WmSetShaking = 0x800A16D0; +WmIsTerrainPassableByModel = 0x800A1710; +WmGetRealCamRot = 0x800A1D14; +WmSetDesiredCamRot = 0x800A1D24; +WmSetCamRot = 0x800A1D38; +WmGetWmId = 0x800A1DE0; +WmSetTranslationVectorInScreenSpace = 0x800A1FAC; +WmSetCamView = 0x800A2088; +WmHandleButtons = 0x800A21B4; +WmSubmarineFloatToPlanet = 0x800A3DFC; +WmSubmarineSubmergeUnderwater = 0x800A3E4C; +WmResetGame = 0x800A4008; +WmMain = 0x800A460C; +WmInitLoadMapFileStruct = 0x800A4DDC; +WmGetBlockIdByXZForPlanet = 0x800A4F08; +WmLoadClosestMapFileBlock = 0x800A53A8; +WmStartLoadingMapFileBlock = 0x800A54F0; +WmMapLoadFinishedCallback = 0x800A5924; +WmGetNumberOfMapToLoad = 0x800A5970; +WmGetElementWithBlockIdAndSetItFirst = 0x800A5A20; +WmExtractLoopCoordsTopBottomParts = 0x800A6884; +WmLoopCoordsAroundWorld = 0x800A692C; +WmAbortMapLoadingWrapper = 0x800A7F18; +WmAbortMapLoading = 0x800A7F38; +WmSetWorldProgress = 0x800A8888; +WmInitAllEntityStructs = 0x800A891C; +WmInsertInEntityStructList = 0x800A8A1C; +WmCleanEntityStruct = 0x800A8ABC; +WmUnlinkEntityAndInsertAsNew = 0x800A8AF4; +WmUnlinkEntityFromAll = 0x800A8B30; +WmInsertStructInEntityStructList = 0x800A8C70; +WmLinkPcToActiveEntity = 0x800A8CE4; +WmUnlinkPcEntityFromAll = 0x800A8F74; +WmUnlinkActiveEntityFromAll = 0x800A8FA0; +WmUnlinkPcLinkedEntityFromAll = 0x800A8FCC; +WmSetPcEntityAsActiveEntity = 0x800A90EC; +WmSetActiveEntityAsPcEntity = 0x800A9110; +WmGetModelIdFromActiveEntity = 0x800A9154; +WmGetModelIdFromPcEntity = 0x800A9174; +WmIsPcEntityModelInMask = 0x800A91A4; +WmInitActiveEntityStruct = 0x800A9334; +WmSetActiveEntityDirectionAndRot = 0x800A9480; +WmGetPcEntityTotalRot = 0x800A97E4; +WmIsPcEntityPosNeedRecalculation = 0x800A98E4; +WmGetPcEntityOriginalY = 0x800A9910; +WmSetActiveEntityWithModelId = 0x800A993C; +WmSetPcEntityTerrainData = 0x800A9A24; +WmGetPcEntityTerrainId = 0x800A9A44; +WmGetPosFromActiveEntity = 0x800AA098; +WmGetPosFromPcEntity = 0x800AA0E0; +WmGetPos2FromActiveEntity = 0x800AA128; +WmGetPos2FromPcEntity = 0x800AA170; +WmMoveActiveEntity = 0x800AA7DC; +WmGetBuggyMoveAnimationId = 0x800AAA00; +WmPrepareEntities = 0x800AB4F4; +WmScriptInitVariables = 0x800AB5E4; +WmScriptRunFunction = 0x800AB6E4; +WmScriptDisableForPcEntity = 0x800AB8EC; +WmScriptPopStack = 0x800ABB24; +WmScriptWriteBank = 0x800ABE58; +WmScriptOpcode000Handle = 0x800ABFC0; +WmScriptOpcode100Handle = 0x800AC3C0; +WmScriptOpcode200Handle = 0x800AC484; +WmScriptOpcode300Handle = 0x800AC700; +WmScriptRunOne = 0x800AD63C; +WmScriptRunAll = 0x800AD788; +WmScriptIsAnyScriptRuns = 0x800AD928; +WmRestoreEntityPosAndDirFromSavemap = 0x800ADA64; + diff --git a/src/world/world.c b/src/world/world.c index 4217b2c5..37ae381d 100644 --- a/src/world/world.c +++ b/src/world/world.c @@ -2,9 +2,9 @@ #include "world.h" #include -void func_800A9480(s16 arg0); -void func_800AA0E0(VECTOR* arg0); -void func_800ADA64(WorldActor*); +void WmSetActiveEntityDirectionAndRot(s16 arg0); +void WmGetPosFromPcEntity(VECTOR* arg0); +void WmRestoreEntityPosAndDirFromSavemap(WorldActor*); s32 func_800ADFC0(void); static s32 func_800B0800(void); void func_800B58F8(u8*, RECT*); @@ -36,7 +36,7 @@ static const char D_800A0020[] = "SCR-H"; static void func_800A0B40(s32 arg) {} -void func_800A0B48(void) { +void WmSetRenderBuffers(void) { s32 flip; s32 off; u32* buf; @@ -52,24 +52,24 @@ void func_800A0B48(void) { D_800C752C = D_800D05E8; } -static s32 func_800A0BD4(void) { return D_800D05E8; } +static s32 WmGetCurrRenderBufferId(void) { return D_800D05E8; } INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A0BE4); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A0C54); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmLoadTxzFile); static void func_800A0D1C(void) { D_800E55EC = 0; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A0D2C); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmLoadTxzDataAndInit); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A12AC); -void func_800A1370(void) { +void WmPrepareForRender(void) { s32 temp_s0; s32 var_a0; s32 var_a1; - func_800A0B48(); + WmSetRenderBuffers(); SetGeomScreen(D_800C65EC); if (D_800E5630 != 0) { var_a0 = (func_800ADFC0() >> 6) + 0x9E; @@ -83,9 +83,9 @@ void func_800A1370(void) { ClearOTagR((OT_TYPE*)D_800BD130, 0x1000); } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A141C); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmRenderAll); -static void func_800A16D0(s32 arg0) { D_800E5630 = arg0; } +static void WmSetShaking(s32 arg0) { D_800E5630 = arg0; } s32 func_800A16E0(void) { if (D_800E55F4 == 0) { @@ -95,17 +95,17 @@ s32 func_800A16E0(void) { return (s32)D_800BD130 + 0x2710; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A1710); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmIsTerrainPassableByModel); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A19FC); static s32 func_800A1D04(void) { return D_800E5648; } -s32 func_800A1D14(void) { return D_800E560C & 0xFFF; } +s32 WmGetRealCamRot(void) { return D_800E560C & 0xFFF; } -static void func_800A1D24(s32 arg0) { D_800E5608 = arg0 & 0xFFF; } +static void WmSetDesiredCamRot(s32 arg0) { D_800E5608 = arg0 & 0xFFF; } -void func_800A1D38(s32 arg0) { D_800E560C = D_800E5608 = arg0 & 0xFFF; } +void WmSetCamRot(s32 arg0) { D_800E560C = D_800E5608 = arg0 & 0xFFF; } void func_800A1D54(s32 arg0) { D_800E5618 = arg0; @@ -121,11 +121,11 @@ static s32 func_800A1DC0(void) { return D_800E5654; } static void func_800A1DD0(s32 arg0) { D_800E5654 = arg0; } -static s32 func_800A1DE0(void) { return D_800E5634; } +static s32 WmGetWmId(void) { return D_800E5634; } INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A1DF0); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A1FAC); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmSetTranslationVectorInScreenSpace); void func_800A2040(void) { SetRotMatrix(&D_800E5698); @@ -134,7 +134,7 @@ void func_800A2040(void) { static s16 func_800A2078(void) { return D_800E56D8; } -void func_800A2088(s32 arg0) { +void WmSetCamView(s32 arg0) { s32 temp_v0; temp_v0 = D_800E5648; @@ -154,7 +154,7 @@ void func_800A2108(s32 arg0, s32 arg1) { if (arg0 != 0) { if (arg1 == D_800E5600 || D_800E5600 == 6) { D_800E55FC = 1; - func_800AA0E0(&sp10); + WmGetPosFromPcEntity(&sp10); func_800A6994(&sp10, arg1 != 3 || D_800E5600 == 6); } } else { @@ -165,7 +165,7 @@ void func_800A2108(s32 arg0, s32 arg1) { s32 func_800A21A4(void) { return D_800E55FC; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A21B4); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmHandleButtons); void func_800A31C0(s16 arg0) { D_800E5668 = arg0 - 0x800 + D_800E5608; } @@ -210,7 +210,7 @@ INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A3964); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A3C74); -void func_800A3DFC(void) { +void WmSubmarineFloatToPlanet(void) { D_800E566C = 5; D_800E5644 = 0x14; func_800B7714(0); @@ -218,7 +218,7 @@ void func_800A3DFC(void) { func_800B0098(0x10, 1); } -void func_800A3E4C(void) { +void WmSubmarineSubmergeUnderwater(void) { D_800E566C = 4; D_800E5644 = -0x14; func_800B7714(0); @@ -264,7 +264,7 @@ void func_800A3F4C(s32 arg0) { } } -void func_800A4008(void) { +void WmResetGame(void) { if (D_800E566C <= 0) { D_800E563C = 0; D_800E5638 = 0; @@ -281,7 +281,7 @@ void func_800A4008(void) { s32 func_800A4080(void) { return (D_800E5648 & 3) | ((func_800BCA38() * 4) & 0xC); } void func_800A40B8(s32 arg0) { - func_800A2088(arg0 & 3); + WmSetCamView(arg0 & 3); func_800BC9E8((arg0 >> 2) & 3); } @@ -360,12 +360,12 @@ s32 func_800A45F4(void) { return D_800E5674; } static void func_800A4604(void) {} // World Entry -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A460C); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmMain); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A4DDC); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmInitLoadMapFileStruct); // Converts x and y coords of megachunk into index -s16 func_800A4F08(s16 x, s16 y) { +s16 WmGetBlockIdByXZForPlanet(s16 x, s16 y) { s16 var_a2; s16 var_v1; @@ -396,27 +396,27 @@ void func_800A5348(void* arg0, void** arg1) { } else { D_800E5810 = *(s32*)arg0; } - func_800A54F0(arg0); + WmStartLoadingMapFileBlock(arg0); tmp = D_800E580C; D_800E580C = arg0; *(void**)arg0 = tmp; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A53A8); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmLoadClosestMapFileBlock); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A54F0); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmStartLoadingMapFileBlock); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A57C8); -void func_800A5924(void) { +void WmMapLoadFinishedCallback(void) { if (D_800E5820 >= 0) { D_800E5814 = (D_8011650C * 5) - 1; func_800ADD4C(0); } } -s16 func_800A5970(void) { +s16 WmGetNumberOfMapToLoad(void) { WorldListNode* p; s32 count; @@ -434,7 +434,7 @@ s16 func_800A5970(void) { INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A59A0); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A5A20); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmGetElementWithBlockIdAndSetItFirst); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A5A94); @@ -460,7 +460,7 @@ INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A64AC); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A67A8); -void func_800A6884(VECTOR* arg0, SVECTOR* arg1, s16* arg2, s16* arg3) { +void WmExtractLoopCoordsTopBottomParts(VECTOR* arg0, SVECTOR* arg1, s16* arg2, s16* arg3) { if (arg2 != NULL) { *arg2 = arg0->vx >> 0xD; if (*arg2 < 0) { @@ -484,7 +484,7 @@ void func_800A6884(VECTOR* arg0, SVECTOR* arg1, s16* arg2, s16* arg3) { } } -void func_800A692C(VECTOR* arg0) { +void WmLoopCoordsAroundWorld(VECTOR* arg0) { if (arg0 != NULL) { if (arg0->vx > 0x47FFF) { @@ -520,7 +520,7 @@ void func_800A6994(VECTOR* arg0, s32 arg1) { } D_80109D44.vx = ((D_80109D44.vx * 3) + arg0->vx) >> 2; D_80109D44.vz = ((D_80109D44.vz * 3) + arg0->vz) >> 2; - func_800A692C(&D_80109D44); + WmLoopCoordsAroundWorld(&D_80109D44); D_800E56F8 = ABS(arg0->vx - D_80109D44.vx) + ABS(arg0->vz - D_80109D44.vz) >= 0xB; return; } @@ -536,13 +536,13 @@ void func_800A6B8C(VECTOR* arg0) { void func_800A6BCC(SVECTOR* arg0) { if (arg0 != NULL) { - func_800A6884(&D_80109D44, arg0, NULL, NULL); + WmExtractLoopCoordsTopBottomParts(&D_80109D44, arg0, NULL, NULL); } } void func_800A6C00(s32 arg0) { if (func_800A1DB0() != 2) - func_800A1FAC(arg0); + WmSetTranslationVectorInScreenSpace(arg0); } INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A6C3C); @@ -559,9 +559,9 @@ static void func_800A7E9C(void) {} INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A7EA4); -void func_800A7F18(void) { func_800A7F38(); } +void WmAbortMapLoadingWrapper(void) { WmAbortMapLoading(); } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A7F38); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmAbortMapLoading); static void func_800A8048(void) { D_800E5828 = 1; } @@ -584,7 +584,7 @@ void func_800A886C(s32 arg0) { D_80109D68 = arg0; } -void func_800A8888(s32 arg0) { D_800E5824 = arg0; } +void WmSetWorldProgress(s32 arg0) { D_800E5824 = arg0; } void func_800A8898(VECTOR* out) { u8* idx; @@ -606,9 +606,9 @@ void func_800A8898(VECTOR* out) { out->vz = a->vz + b->vz + c->vz; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A891C); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmInitAllEntityStructs); -WorldActor* func_800A8A1C(void) { +WorldActor* WmInsertInEntityStructList(void) { WorldActor* temp_s0; WorldActor* temp_v1; WorldActor* next; @@ -622,7 +622,7 @@ WorldActor* func_800A8A1C(void) { D_8010AD38 = temp_s0; D_8010AD34 = next; temp_s0->next = temp_v1; - func_800A8ABC(temp_s0); + WmCleanEntityStruct(temp_s0); return temp_s0; } @@ -633,7 +633,7 @@ void func_800A8A88(void) { var_v0->unk5E = -1; } -void func_800A8ABC(WorldActor* arg0) { +void WmCleanEntityStruct(WorldActor* arg0) { WorldActor** var_v1; arg0->unk5E = -1; @@ -642,18 +642,18 @@ void func_800A8ABC(WorldActor* arg0) { *var_v1 = NULL; } -void func_800A8AF4(WorldActor* arg0) { +void WmUnlinkEntityAndInsertAsNew(WorldActor* arg0) { WorldActor* temp_v0; - func_800A8B30(arg0); + WmUnlinkEntityFromAll(arg0); temp_v0 = D_8010AD34; D_8010AD34 = arg0; arg0->next = temp_v0; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A8B30); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmUnlinkEntityFromAll); -void func_800A8C70(WorldActor* arg0) { +void WmInsertStructInEntityStructList(WorldActor* arg0) { WorldActor* temp_v0; if ((arg0 != NULL) && (arg0->next == NULL)) { @@ -670,12 +670,12 @@ s32 func_800A8CA4(void) { return var_v1 != NULL; } -void func_800A8CE4(void) { +void WmLinkPcToActiveEntity(void) { WorldActor* temp_s0; temp_s0 = D_8010AD40; if ((temp_s0 != NULL) && (D_8010AD3C != NULL) && (D_8010AD3C->riding == NULL)) { - func_800A8B30(temp_s0); + WmUnlinkEntityFromAll(temp_s0); D_8010AD3C->riding = temp_s0; D_8010AD40 = D_8010AD3C; } @@ -690,7 +690,7 @@ void func_800A8D58(void) { return; temp_s0 = D_8010AD40->riding; if (temp_s0 != NULL) { - func_800A8C70(temp_s0); + WmInsertStructInEntityStructList(temp_s0); temp_s0->collide = D_8010AD40; temp_s0->pos = D_8010AD40->pos; temp_s0->altPos = D_8010AD40->altPos; @@ -715,7 +715,7 @@ void func_800A8E50(void) { return; temp_s0 = D_8010AD3C->riding; if (temp_s0 != NULL) { - func_800A8C70(temp_s0); + WmInsertStructInEntityStructList(temp_s0); temp_s0->collide = D_8010AD3C; temp_s0->pos = D_8010AD3C->pos; temp_s0->altPos = D_8010AD3C->altPos; @@ -733,24 +733,24 @@ void func_800A8E50(void) { s32 func_800A8F48(void) { return D_8010AD3C == NULL ? 0 : D_8010AD3C->riding != NULL; } -void func_800A8F74(void) { +void WmUnlinkPcEntityFromAll(void) { if (D_8010AD40) - func_800A8AF4(D_8010AD40); + WmUnlinkEntityAndInsertAsNew(D_8010AD40); } -void func_800A8FA0(void) { +void WmUnlinkActiveEntityFromAll(void) { if (D_8010AD3C) - func_800A8AF4(D_8010AD3C); + WmUnlinkEntityAndInsertAsNew(D_8010AD3C); } -void func_800A8FCC(void) { +void WmUnlinkPcLinkedEntityFromAll(void) { WorldActor* temp_a0; if (D_8010AD40 == NULL) return; temp_a0 = D_8010AD40->riding; if (temp_a0 != NULL) { - func_800A8AF4(temp_a0); + WmUnlinkEntityAndInsertAsNew(temp_a0); D_8010AD40->riding = NULL; } } @@ -762,7 +762,7 @@ void func_800A9018(void) { return; temp_a0 = D_8010AD3C->riding; if (temp_a0 != NULL) { - func_800A8AF4(temp_a0); + WmUnlinkEntityAndInsertAsNew(temp_a0); D_8010AD3C->riding = NULL; } } @@ -777,25 +777,25 @@ void func_800A9064(s16 x, s16 z) { tri->tri = NULL; } -void func_800A90EC(void) { +void WmSetPcEntityAsActiveEntity(void) { if (D_8010AD40 != NULL) D_8010AD3C = D_8010AD40; } -void func_800A9110(void) { +void WmSetActiveEntityAsPcEntity(void) { if (D_8010AD3C != NULL) D_8010AD40 = D_8010AD3C; } WorldStoredTriangle* func_800A9134(void) { return D_8010AD40 != NULL ? D_8010AD40->storedTris : NULL; } -s32 func_800A9154(void) { return D_8010AD3C != NULL ? D_8010AD3C->actorType : NULL; } +s32 WmGetModelIdFromActiveEntity(void) { return D_8010AD3C != NULL ? D_8010AD3C->actorType : NULL; } -s32 func_800A9174(void) { return D_8010AD40 != NULL ? D_8010AD40->actorType : NULL; } +s32 WmGetModelIdFromPcEntity(void) { return D_8010AD40 != NULL ? D_8010AD40->actorType : NULL; } WorldActor* func_800A9194(void) { return D_8010AD3C; } -s32 func_800A91A4(s32 arg0) { +s32 WmIsPcEntityModelInMask(s32 arg0) { return D_8010AD40 != NULL && D_8010AD40->actorType < 0x20U ? (arg0 >> D_8010AD40->actorType) & 1 : 0; } @@ -840,7 +840,7 @@ static const s32 D_800A01E0[] = {0, 0}; static const s32 D_800A01E8[] = {0, 0, 0, 0}; // TODO: this -> 800b624c, 800b58f8, 800ada64 -void func_800A9334(s32 arg0) { +void WmInitActiveEntityStruct(s32 arg0) { RECT rect; if (D_8010AD3C != NULL) { @@ -884,11 +884,11 @@ void func_800A9334(s32 arg0) { D_8010AD3C->unk58 = 0x20; } func_800B58F8(D_8010AD3C->unk90, &rect); - func_800ADA64(D_8010AD3C); + WmRestoreEntityPosAndDirFromSavemap(D_8010AD3C); } } -void func_800A9480(s16 arg0) { +void WmSetActiveEntityDirectionAndRot(s16 arg0) { if (D_8010AD3C != NULL) { D_8010AD3C->direction = arg0; D_8010AD3C->facing = (s16)arg0; @@ -930,7 +930,7 @@ INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A96D0); s16 func_800A97A8(void) { return D_8010AD3C == NULL ? 0 : D_8010AD3C->unk3C + D_8010AD3C->unk3E; } -s16 func_800A97E4(void) { return D_8010AD40 == NULL ? 0 : D_8010AD40->unk3C + D_8010AD40->unk3E; } +s16 WmGetPcEntityTotalRot(void) { return D_8010AD40 == NULL ? 0 : D_8010AD40->unk3C + D_8010AD40->unk3E; } void func_800A9820(s32 arg0) { if (D_8010AD3C != NULL) @@ -956,11 +956,11 @@ void func_800A98A4(s32 arg0) { } } -s32 func_800A98E4(void) { return D_8010AD40 == NULL ? 0 : D_8010AD40->flags1 >> 7; } +s32 WmIsPcEntityPosNeedRecalculation(void) { return D_8010AD40 == NULL ? 0 : D_8010AD40->flags1 >> 7; } -s16 func_800A9910(void) { return D_8010AD40 == NULL ? 0 : D_8010AD40->unk42; } +s16 WmGetPcEntityOriginalY(void) { return D_8010AD40 == NULL ? 0 : D_8010AD40->unk42; } -s32 func_800A993C(s32 arg0) { +s32 WmSetActiveEntityWithModelId(s32 arg0) { WorldActor* var_v1; for (var_v1 = D_8010AD38; var_v1 != NULL && var_v1->actorType != arg0; var_v1 = var_v1->next) @@ -984,12 +984,12 @@ void func_800A9A04(s8 arg0) { D_8010AD40->actorType = arg0; } -void func_800A9A24(s16 arg0) { +void WmSetPcEntityTerrainData(s16 arg0) { if (D_8010AD40) D_8010AD40->walkmesh = arg0; } -s32 func_800A9A44(void) { return D_8010AD40 == NULL ? 0 : D_8010AD40->walkmesh & 0x1F; } +s32 WmGetPcEntityTerrainId(void) { return D_8010AD40 == NULL ? 0 : D_8010AD40->walkmesh & 0x1F; } s32 func_800A9A70(void) { return D_8010AD40 == NULL ? 0 : (D_8010AD40->walkmesh >> 9) & 0x1F; } @@ -1003,7 +1003,7 @@ void func_800A9C64(WorldActor* arg0, VECTOR* arg1) { u8 var_v0; if (arg1 != NULL && arg0 != NULL) { - func_800A692C(arg1); + WmLoopCoordsAroundWorld(arg1); if (arg0->flags1 & 0x80) { arg0->pos.vx = arg1->vx; arg0->pos.vz = arg1->vz; @@ -1046,22 +1046,22 @@ static void func_800AA078(s16 arg0) { D_8010AD40->unk4E = arg0; } -void func_800AA098(VECTOR* arg0) { +void WmGetPosFromActiveEntity(VECTOR* arg0) { if (arg0 != NULL && D_8010AD3C != NULL) *arg0 = D_8010AD3C->pos; } -void func_800AA0E0(VECTOR* arg0) { +void WmGetPosFromPcEntity(VECTOR* arg0) { if (arg0 != NULL && D_8010AD40 != NULL) *arg0 = D_8010AD40->pos; } -void func_800AA128(VECTOR* arg0) { +void WmGetPos2FromActiveEntity(VECTOR* arg0) { if (arg0 != NULL && D_8010AD3C != NULL) *arg0 = D_8010AD3C->altPos; } -void func_800AA170(VECTOR* arg0) { +void WmGetPos2FromPcEntity(VECTOR* arg0) { if (arg0 != NULL && D_8010AD40 != NULL) *arg0 = D_8010AD40->altPos; } @@ -1134,7 +1134,7 @@ void func_800AA6D0(WorldChunkHeader* arg0) { for (var_s0 = D_8010AD38; var_s0 != NULL; var_s0 = var_s0->next) { if (var_s0 != D_8010AD40) { - func_800A6884(&var_s0->pos, &sp20, &sp28, &sp2A); + WmExtractLoopCoordsTopBottomParts(&var_s0->pos, &sp20, &sp28, &sp2A); if ((sp28 == arg0->x) && (sp2A == arg0->z)) { func_800A19FC(arg0, &sp20, var_s0->storedTris, &var_s0->unk42, 0, &var_s0->walkmesh, var_s0->actorType); if (!(var_s0->flags1 & 0x80)) { @@ -1149,7 +1149,7 @@ void func_800AA6D0(WorldChunkHeader* arg0) { func_800B1C80(arg0); } -void func_800AA7DC(s32 arg0, s32 arg1) { +void WmMoveActiveEntity(s32 arg0, s32 arg1) { if ((D_8010AD3C != NULL) && ((arg0 != 0) || (arg1 != 0))) { D_8010AD3C->pos.vx += arg0; D_8010AD3C->pos.vz += arg1; @@ -1173,7 +1173,7 @@ void func_800AA8D8(s16 arg0, s16 arg1, s16 arg2) { INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AA8F8); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AAA00); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmGetBuggyMoveAnimationId); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AAB18); @@ -1210,7 +1210,7 @@ void func_800AB48C(WorldActor* arg0) { arg0->altPos = arg0->pos; } -void func_800AB4F4(void) { +void WmPrepareEntities(void) { WorldActor* var_s0; for (var_s0 = D_8010AD38; var_s0 != NULL; var_s0 = var_s0->next) @@ -1228,10 +1228,10 @@ void func_800AB570(void) { func_800AB398(var_s0); } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AB5E4); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmScriptInitVariables); // pushes execution of given script to player's execution stack -void func_800AB6E4(s32 arg0, s32 arg1) { +void WmScriptRunFunction(s32 arg0, s32 arg1) { WorldScriptBSTEntry* var_a0; WorldScriptFrame* temp_a1; s32 var_s2; @@ -1275,7 +1275,7 @@ void func_800AB6E4(s32 arg0, s32 arg1) { } } -void func_800AB8EC(s32 arg0) { +void WmScriptDisableForPcEntity(s32 arg0) { if (D_8010AD40 != NULL) { if (arg0 != 0) D_8010AD40->flags1 = D_8010AD40->flags1 | 0x10; @@ -1296,7 +1296,7 @@ void func_800AB92C(s32 arg0) { var_a1 = 0; if (var_a1 >= 4) var_a1 = 3; - func_800AB6E4(var_a0, var_a1); + WmScriptRunFunction(var_a0, var_a1); } } } @@ -1307,7 +1307,7 @@ void func_800AB988(s32 arg0, s32 arg1) { s32 tmp1; s32 tmp2; - func_800A993C(arg0); + WmSetActiveEntityWithModelId(arg0); if (D_8010AD3C != NULL) { var_a1 = arg1 - 2; if (!(D_8010AD3C->flags1 & 0x10)) { @@ -1318,7 +1318,7 @@ void func_800AB988(s32 arg0, s32 arg1) { var_a1 = 0; if (var_a1 >= 4) var_a1 = 3; - func_800AB6E4(tmp2, var_a1); + WmScriptRunFunction(tmp2, var_a1); } } } @@ -1336,7 +1336,7 @@ void func_800ABA18(s32 arg0) { var_a1 = 0; if (var_a1 >= 4) var_a1 = 3; - func_800AB6E4(var_a0, var_a1); + WmScriptRunFunction(var_a0, var_a1); } void func_800ABA78(s16 arg0, s16 arg1) { @@ -1346,15 +1346,15 @@ void func_800ABA78(s16 arg0, s16 arg1) { s32 tmp1; D_8010AD3C = D_80109D74; - func_800A6884(&D_8010AD40->pos, NULL, &sp10, &sp12); + WmExtractLoopCoordsTopBottomParts(&D_8010AD40->pos, NULL, &sp10, &sp12); tmp0 = ((((sp12 * 0x24) + sp10) * 0x10) & 0x3FF0); tmp1 = (((arg0 + (arg1 * 5)) & 0xF) | 0x8000); - func_800AB6E4(tmp0 | tmp1, 3); + WmScriptRunFunction(tmp0 | tmp1, 3); } static const s32 D_800A0260[] = {0, 0}; -s32 func_800ABB24(void) { +s32 WmScriptPopStack(void) { s32 var_s0; u8* temp_s0; @@ -1409,7 +1409,7 @@ s32 func_800ABB24(void) { var_s0 = func_800A4080(); break; case 8: // Model ID of the player actor - var_s0 = func_800A9174(); + var_s0 = WmGetModelIdFromPcEntity(); break; case 15: // Active Actor Model ID var_s0 = D_8010AD3C->actorType; @@ -1453,7 +1453,7 @@ s32 func_800ABB24(void) { } // executed during script opcode 0xE0 (write bank) -void func_800ABE58(s32 arg0) { +void WmScriptWriteBank(s32 arg0) { Unk8010AD70* temp_v1; s32 temp_a0; s32 var_v0; @@ -1500,7 +1500,7 @@ void func_800ABE58(s32 arg0) { */ // script opcode 0x0XX, arithmetic and writing to memory -void func_800ABFC0(u16 arg0) { +void WmScriptOpcode000Handle(u16 arg0) { VECTOR sp10; Unk8010AD70* temp_s0_17; WorldActor* temp_s0_16; @@ -1510,91 +1510,91 @@ void func_800ABFC0(u16 arg0) { switch (arg0) { case 0x15: // pop A push -A - D_8010AD90->unk0 = -func_800ABB24(); + D_8010AD90->unk0 = -WmScriptPopStack(); break; case 0x17: // pop A, push ~A - D_8010AD90->unk0 = func_800ABB24() == 0; + D_8010AD90->unk0 = WmScriptPopStack() == 0; break; case 0x30: // pop A, B, push B * A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = func_800ABB24() * temp_s0; + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = WmScriptPopStack() * temp_s0; break; case 0x40: // pop A, B, push B + A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = func_800ABB24() + temp_s0; + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = WmScriptPopStack() + temp_s0; break; case 0x41: // pop A, B, push B - A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = func_800ABB24() - temp_s0; + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = WmScriptPopStack() - temp_s0; break; case 0x60: // pop A, B, push B < A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = func_800ABB24() < temp_s0; + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = WmScriptPopStack() < temp_s0; break; case 0x61: // pop A, B, push B > A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = temp_s0 < func_800ABB24(); + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = temp_s0 < WmScriptPopStack(); break; case 0x62: // pop A, B, push B <= A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = temp_s0 >= func_800ABB24(); + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = temp_s0 >= WmScriptPopStack(); break; case 0x63: // pop A, B, push B >= A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = func_800ABB24() >= temp_s0; + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = WmScriptPopStack() >= temp_s0; break; case 0x70: // pop A, B, push B == A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = func_800ABB24() == temp_s0; + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = WmScriptPopStack() == temp_s0; break; case 0x71: // pop A, B, push B != A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = func_800ABB24() != temp_s0; + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = WmScriptPopStack() != temp_s0; break; case 0x50: // pop A, B, push B << A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = func_800ABB24() << temp_s0; + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = WmScriptPopStack() << temp_s0; break; case 0x51: // pop A, B, push B >> A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = func_800ABB24() >> temp_s0; + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = WmScriptPopStack() >> temp_s0; break; case 0x80: // pop A, B, push B & A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = func_800ABB24() & temp_s0; + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = WmScriptPopStack() & temp_s0; break; case 0xA0: // pop A, B, push B | A - temp_s0 = func_800ABB24(); - D_8010AD90->unk0 = func_800ABB24() | temp_s0; + temp_s0 = WmScriptPopStack(); + D_8010AD90->unk0 = WmScriptPopStack() | temp_s0; break; case 0xB0: // pop A, B, push B && A - temp_s0 = func_800ABB24(); - var_v0 = func_800ABB24(); + temp_s0 = WmScriptPopStack(); + var_v0 = WmScriptPopStack(); D_8010AD90->unk0 = var_v0 && temp_s0; break; case 0xC0: // pop A, B, push B || A - temp_s0 = func_800ABB24(); - var_v0 = func_800ABB24(); + temp_s0 = WmScriptPopStack(); + var_v0 = WmScriptPopStack(); D_8010AD90->unk0 = var_v0 || temp_s0; break; case 0xE0: // pop A, write bank - func_800ABE58(func_800ABB24()); + WmScriptWriteBank(WmScriptPopStack()); break; case 0x18: // "push distance from active entity to point" - func_800AF1A8(func_800ABB24(), -1); - func_800AA098(&sp10); + func_800AF1A8(WmScriptPopStack(), -1); + WmGetPosFromActiveEntity(&sp10); D_8010AD90->unk0 = func_800AF96C(&sp10) >> 5; break; case 0x19: // "push distance from active entity to entity by model id" temp_s0_16 = D_8010AD3C; D_8010AD90->unk0 = 0; - if (func_800A993C(func_800ABB24()) != 0) { + if (WmSetActiveEntityWithModelId(WmScriptPopStack()) != 0) { D_8010AD90->unk0 = func_800AE024(&D_8010AD3C->pos, &temp_s0_16->pos) >> 4; } D_8010AD3C = temp_s0_16; break; case 0x1A: // unused and undocumented - temp_v0 = func_800ABB24(); + temp_v0 = WmScriptPopStack(); temp_s0_17 = D_8010AD90; sp10 = D_8010AD3C->pos; sp10.vy = 0; @@ -1607,8 +1607,8 @@ void func_800ABFC0(u16 arg0) { } break; case 0x1B: // "push direction from active entity to point" - func_800AF1A8(func_800ABB24(), -1); - func_800AA098(&sp10); + func_800AF1A8(WmScriptPopStack(), -1); + WmGetPosFromActiveEntity(&sp10); D_8010AD90->unk0 = (func_800AF9A0(&sp10) << 0x10) >> 0x14; break; } @@ -1617,7 +1617,7 @@ void func_800ABFC0(u16 arg0) { } // script opcode 0x1XX, push value to stack -void func_800AC3C0(u16 arg0) { +void WmScriptOpcode100Handle(u16 arg0) { if (arg0 == 0x100) { // reset stack. unused? D_8010AD90 = D_8010AD70; return; @@ -1630,7 +1630,7 @@ void func_800AC3C0(u16 arg0) { } // script opcode 0x2XX, flow control -s32 func_800AC484(u16 arg0) { +s32 WmScriptOpcode200Handle(u16 arg0) { WorldActor* var_s0; WorldScriptFrame* temp_v0_4; s32 var_v0; @@ -1644,7 +1644,7 @@ s32 func_800AC484(u16 arg0) { break; case 0x201: // pop A, jump if ~A temp_s0 = D_8010AD6C[D_8010ADE4->scriptIdx++]; - if (func_800ABB24() == 0) { + if (WmScriptPopStack() == 0) { D_8010ADE4->scriptIdx = temp_s0; } break; @@ -1673,7 +1673,7 @@ s32 func_800AC484(u16 arg0) { var_v0 = 1; break; default: // run function number (opcode - 0x204) - D_8010ADE4->scriptCallModel = func_800ABB24(); + D_8010ADE4->scriptCallModel = WmScriptPopStack(); if (D_8010ADE4->scriptCallModel < 0x40) { func_800AB988(D_8010ADE4->scriptCallModel, arg0 - 0x204); } else { @@ -1686,9 +1686,9 @@ s32 func_800AC484(u16 arg0) { } // script opcode 0x3XX, system ops / misc -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AC700); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmScriptOpcode300Handle); -void func_800AD63C(WorldActor* arg0) { +void WmScriptRunOne(WorldActor* arg0) { s32 var_a1; s32 var_s0; u16 temp_a0; @@ -1700,13 +1700,13 @@ void func_800AD63C(WorldActor* arg0) { do { temp_a0 = D_8010AD6C[D_8010ADE4->scriptIdx++]; if (temp_a0 < 0x100) { - func_800ABFC0(temp_a0); + WmScriptOpcode000Handle(temp_a0); } else if (temp_a0 < 0x200) { - func_800AC3C0(temp_a0); + WmScriptOpcode100Handle(temp_a0); } else if (temp_a0 < 0x300) { - var_s0 = func_800AC484(temp_a0); + var_s0 = WmScriptOpcode200Handle(temp_a0); } else { - var_s0 = func_800AC700(temp_a0); + var_s0 = WmScriptOpcode300Handle(temp_a0); } } while (var_s0 == 0); } @@ -1715,17 +1715,17 @@ void func_800AD63C(WorldActor* arg0) { func_800AB988(arg0->collide->actorType, (InputReadPads() & PADRright) ? 4 : 3); } -void func_800AD788(void) { +void WmScriptRunAll(void) { WorldActor* var_s0; - func_800AD63C(D_8010AD3C = D_8010ADE4 = D_80109D74); + WmScriptRunOne(D_8010AD3C = D_8010ADE4 = D_80109D74); for (var_s0 = D_8010AD38; var_s0 != NULL; var_s0 = var_s0->next) - func_800AD63C(D_8010ADE4 = D_8010AD3C = var_s0); + WmScriptRunOne(D_8010ADE4 = D_8010AD3C = var_s0); } INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AD804); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AD928); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmScriptIsAnyScriptRuns); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AD970); @@ -1737,7 +1737,7 @@ void func_800ADA08(void) { func_800AD970(var_s0); } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800ADA64); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmRestoreEntityPosAndDirFromSavemap); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800ADB30); @@ -1855,9 +1855,9 @@ s16 func_800AE47C(VECTOR* arg0, VECTOR* arg1) { INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AE4B8); -void* func_800AE5B8(void) { return (func_800A0BD4() * 0x24) + &D_800C6770; } +void* func_800AE5B8(void) { return (WmGetCurrRenderBufferId() * 0x24) + &D_800C6770; } -void* func_800AE5F0(void) { return (func_800A0BD4() * 0xC) + D_8010B068; } +void* func_800AE5F0(void) { return (WmGetCurrRenderBufferId() * 0xC) + D_8010B068; } s32 func_800AE628(void) { return D_8010B080; } @@ -1988,7 +1988,7 @@ void func_800B0670(void) { VECTOR sp10; WorldZolomSegment* var_a0; - func_800AA0E0(&sp10); + WmGetPosFromPcEntity(&sp10); if (sp10.vz <= 0x23A97) for (var_a0 = D_8010C2AC; var_a0 < &D_8010C2AC[0x30]; var_a0++) { var_a0->x = 0x2008; @@ -2016,7 +2016,7 @@ void func_800B075C(void) { s32 func_800B0794(void) { VECTOR sp10; - func_800AA0E0(&sp10); + WmGetPosFromPcEntity(&sp10); return D_8010C804 != 0 && (sp10.vx - 0x30000) < 0x10000U && (sp10.vz - 0x1C000) < 0x10000U; } @@ -2076,22 +2076,22 @@ void func_800B28CC(s32 arg0) { param = 0x29; } else param = 4; - func_800A993C(param); + WmSetActiveEntityWithModelId(param); switch (D_8010CAF0) { case 3: - func_800A8FA0(); + WmUnlinkActiveEntityFromAll(); D_8010CAF0 = 0; break; case 1: if (func_800A8F48() != 0) { - func_800A9110(); + WmSetActiveEntityAsPcEntity(); func_800BBD0C(); } else - func_800AB988(func_800A9154(), 5); + func_800AB988(WmGetModelIdFromActiveEntity(), 5); break; case 2: func_800A9018(); - func_800A8FA0(); + WmUnlinkActiveEntityFromAll(); break; } } @@ -2338,11 +2338,11 @@ void func_800B76A8(void) { var_a0 = D_8009D685; if (var_a0 >= 3) { if (var_a0 >= 0x2B) { - func_800A993C(0x13); + WmSetActiveEntityWithModelId(0x13); func_800BBA5C(); var_a0 = 3; } - func_800A993C(var_a0); + WmSetActiveEntityWithModelId(var_a0); func_800BBA5C(); func_800A31C0(func_800A97A8()); } @@ -2486,12 +2486,12 @@ void func_800B832C(void) { s32 temp_v0; s32 temp_v0_2; - temp_a0 = func_800A1DE0(); + temp_a0 = WmGetWmId(); if ((D_8009AC2F == 0) && (temp_a0 != 2) && (func_800B2FD0() == 0) && (func_800A21A4() != 0)) { temp_s0 = func_800A9AD0(); - func_800AA0E0(&sp10); - func_800AA170(&sp20); - if ((func_800A91A4(0x47) != 0) && (D_80116280 != 0)) { + WmGetPosFromPcEntity(&sp10); + WmGetPos2FromPcEntity(&sp20); + if ((WmIsPcEntityModelInMask(0x47) != 0) && (D_80116280 != 0)) { if ((temp_s0 == 0) && ((sp10.vx != sp20.vx) || (sp10.vz != sp20.vz))) { if ((D_8011627C == 8) || (D_8011627C == 0x10)) func_800262D8(); @@ -3620,24 +3620,24 @@ static void func_800BBA5C(void) { s32 var_a1; s32 var_s0; - if (func_800A9174() == 5 && D_801163EC) { + if (WmGetModelIdFromPcEntity() == 5 && D_801163EC) { func_800A98A4(1); func_800A368C(1); return; } if (func_800A99BC()) { - func_800AA098(&sp10); - func_800A6994(&sp10, func_800A9154() == 3 ? -1 : 1); - func_800BB9A0(func_800A9174()); + WmGetPosFromActiveEntity(&sp10); + func_800A6994(&sp10, WmGetModelIdFromActiveEntity() == 3 ? -1 : 1); + func_800BB9A0(WmGetModelIdFromPcEntity()); if (func_800A929C()) { - func_800A8CE4(); + WmLinkPcToActiveEntity(); func_800B63F0(2); return; } - func_800A8FCC(); - func_800A8F74(); - func_800A9110(); - switch (func_800A9174()) { + WmUnlinkPcLinkedEntityFromAll(); + WmUnlinkPcEntityFromAll(); + WmSetActiveEntityAsPcEntity(); + switch (WmGetModelIdFromPcEntity()) { case 3: func_800A98A4(1); func_800A368C(1); @@ -3657,11 +3657,11 @@ static void func_800BBA5C(void) { s32 func_800BBBB0(void) { s32 temp_s0; - temp_s0 = func_800A9A44(); + temp_s0 = WmGetPcEntityTerrainId(); if (func_800A9240()) return (0x221B0F03 >> temp_s0) & 1; - switch (func_800A9174()) { + switch (WmGetModelIdFromPcEntity()) { case 3: return temp_s0 == 0; case 5: @@ -3677,18 +3677,18 @@ s32 func_800BBBB0(void) { void func_800BBC4C(void) { s32 temp_s0; - temp_s0 = func_800A9174(); + temp_s0 = WmGetModelIdFromPcEntity(); if (D_801163D4 == 0) { if (func_800BBBB0() != 0) { - if ((temp_s0 == 3) || ((temp_s0 == 5) && (func_800A98E4() != 0))) + if ((temp_s0 == 3) || ((temp_s0 == 5) && (WmIsPcEntityPosNeedRecalculation() != 0))) func_800A368C(-1); else func_800A2108(0, 2); D_801163D4 = 1; if (temp_s0 == 3 || temp_s0 == 4) - func_800AB8EC(1); + WmScriptDisableForPcEntity(1); } - if (func_800A9A44() == 0x1B) + if (WmGetPcEntityTerrainId() == 0x1B) func_800ABA18(9); } } @@ -3705,13 +3705,13 @@ void func_800BBD20(s32 arg0) { s32 temp_s4; s32 var_v0; - temp_s2 = func_800A9174() == 3; + temp_s2 = WmGetModelIdFromPcEntity() == 3; if (D_801163D8 != 0) { D_801163D8 -= 1; return; } - if ((func_800A369C() == 0) && (func_800A1DE0() != 3)) { + if ((func_800A369C() == 0) && (WmGetWmId() != 3)) { temp_s4 = InputReadPads(); if ((D_801163D4 == 0) && (arg0 == 1)) { func_800BBA5C(); @@ -3719,7 +3719,7 @@ void func_800BBD20(s32 arg0) { var_v0 = func_800A9240() == 0 ? temp_s4 & PADRdown : temp_s4 & (PADLup | PADLdown | PADLleft | PADLright | PADRdown); if ((var_v0 == 0) && D_801163DC > 0 && D_801163DC < 15 && - ((func_800A91A4(0x2000) == 0) || (func_800A9A44() == 0x12))) + ((WmIsPcEntityModelInMask(0x2000) == 0) || (WmGetPcEntityTerrainId() == 0x12))) func_800BBC4C(); else goto block_15; @@ -3729,60 +3729,60 @@ void func_800BBD20(s32 arg0) { D_801163D4 = 2; else if (D_801163D4 == 2) { D_801163D4 = 0; - func_800A90EC(); - temp_s1 = func_800A9154(); - func_800AA098(&sp10); - func_800AA128(&sp20); + WmSetPcEntityAsActiveEntity(); + temp_s1 = WmGetModelIdFromActiveEntity(); + WmGetPosFromActiveEntity(&sp10); + WmGetPos2FromActiveEntity(&sp20); func_800A2108(1, 2); if ((sp10.vx != sp20.vx) || (sp10.vz != sp20.vz)) { func_800B7C58(); if (temp_s2 != 0) { func_800A98A4(0); - func_800AB8EC(0); + WmScriptDisableForPcEntity(0); } func_800AA1B8(); func_800A1DD0(0); - if ((temp_s1 == 5) && (func_800A98E4() != 0)) + if ((temp_s1 == 5) && (WmIsPcEntityPosNeedRecalculation() != 0)) func_800A98A4(0); else { if (temp_s1 == 4) - func_800AB8EC(0); + WmScriptDisableForPcEntity(0); func_800AB988(temp_s1, 5); if (temp_s1 == 4) - func_800AB8EC(1); + WmScriptDisableForPcEntity(1); if (func_800A929C() != 0) { temp_v0 = func_800AE47C(&sp20, &sp10) - 0x400; - func_800A9480(temp_v0); + WmSetActiveEntityDirectionAndRot(temp_v0); func_800BB9D0(); func_800A8E50(); if (temp_s1 < 0x29) - func_800A9110(); + WmSetActiveEntityAsPcEntity(); func_800AA2E4(2); - func_800A9480(temp_v0); + WmSetActiveEntityDirectionAndRot(temp_v0); func_800B63F0(1); func_800A2108(0, 6); if (temp_s1 == 4) func_800A82DC(); else if (temp_s1 >= 0x29) { - func_800A993C(func_800B79B8()); - func_800A9110(); + WmSetActiveEntityWithModelId(func_800B79B8()); + WmSetActiveEntityAsPcEntity(); } func_800ADC3C(&sp10); } else { - func_800A8A1C(); + WmInsertInEntityStructList(); temp_s0 = func_800BB9D0() & 0xFF; if (func_800A92F8(temp_s0) != 0) { - func_800A9334(func_800BBA0C() & 0xFF); - func_800A9110(); - func_800A8A1C(); - func_800A9334(temp_s0); - func_800A8CE4(); + WmInitActiveEntityStruct(func_800BBA0C() & 0xFF); + WmSetActiveEntityAsPcEntity(); + WmInsertInEntityStructList(); + WmInitActiveEntityStruct(temp_s0); + WmLinkPcToActiveEntity(); } else { - func_800A9334(temp_s0); - func_800A9110(); + WmInitActiveEntityStruct(temp_s0); + WmSetActiveEntityAsPcEntity(); if (temp_s2 != 0) func_800BCA48(); } @@ -3801,10 +3801,10 @@ void func_800BBD20(s32 arg0) { } } } else { - if ((func_800A9174() == 3) || (func_800A9174() == 4)) - func_800AB8EC(0); + if ((WmGetModelIdFromPcEntity() == 3) || (WmGetModelIdFromPcEntity() == 4)) + WmScriptDisableForPcEntity(0); - if ((temp_s2 != 0) || ((func_800A9174() == 5) && (func_800A98E4() != 0))) + if ((temp_s2 != 0) || ((WmGetModelIdFromPcEntity() == 5) && (WmIsPcEntityPosNeedRecalculation() != 0))) func_800A368C(1); } } @@ -3827,7 +3827,7 @@ INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800BC420); void func_800BC9E8(s16 arg0) { D_801164F8 = arg0; - if (func_800A9174() != 3) + if (WmGetModelIdFromPcEntity() != 3) D_801164FC = D_801164F8; } diff --git a/src/world/world.h b/src/world/world.h index e8a8e184..8618ed01 100644 --- a/src/world/world.h +++ b/src/world/world.h @@ -126,28 +126,28 @@ typedef struct { /* 0x6 */ s16 unk6; } Unk8010AD70; -void func_800A0B48(); +void WmSetRenderBuffers(); void func_800A19FC(WorldChunkHeader*, SVECTOR*, WorldStoredTriangle*, s16*, s32, s16*, s32); void func_800A31C0(s16); void func_800A368C(s32); -void func_800A6884(VECTOR*, SVECTOR*, s16*, s16*); -void func_800A692C(VECTOR*); +void WmExtractLoopCoordsTopBottomParts(VECTOR*, SVECTOR*, s16*, s16*); +void WmLoopCoordsAroundWorld(VECTOR*); void func_800A6994(VECTOR*, s32); -void func_800A8ABC(WorldActor*); -void func_800A8B30(WorldActor*); -void func_800A8C70(WorldActor*); -void func_800A8CE4(); -void func_800A8F74(); -void func_800A8FCC(); -void func_800A9110(); -s32 func_800A9154(); -s32 func_800A9174(); +void WmCleanEntityStruct(WorldActor*); +void WmUnlinkEntityFromAll(WorldActor*); +void WmInsertStructInEntityStructList(WorldActor*); +void WmLinkPcToActiveEntity(); +void WmUnlinkPcEntityFromAll(); +void WmUnlinkPcLinkedEntityFromAll(); +void WmSetActiveEntityAsPcEntity(); +s32 WmGetModelIdFromActiveEntity(); +s32 WmGetModelIdFromPcEntity(); s32 func_800A929C(); s16 func_800A97A8(void); void func_800A98A4(s32); -s32 func_800A98E4(void); +s32 WmIsPcEntityPosNeedRecalculation(void); s32 func_800A99BC(); -s32 func_800A9A44(void); +s32 WmGetPcEntityTerrainId(void); s32 func_800A9B04(s16, u8); void func_800A9C64(WorldActor*, VECTOR*); s32 func_800AA304(WorldActor*, WorldActor*); @@ -155,13 +155,13 @@ s32 func_800AA580(WorldActor*); void func_800AAB18(WorldActor*); void func_800AB398(WorldActor*); void func_800AB48C(WorldActor*); -void func_800AB8EC(s32); +void WmScriptDisableForPcEntity(s32); void func_800ABA18(s32); -void func_800ABFC0(u16); -void func_800AC3C0(u16); -s32 func_800AC484(u16); -s32 func_800AC700(u16); -void func_800AD63C(WorldActor*); +void WmScriptOpcode000Handle(u16); +void WmScriptOpcode100Handle(u16); +s32 WmScriptOpcode200Handle(u16); +s32 WmScriptOpcode300Handle(u16); +void WmScriptRunOne(WorldActor*); void func_800AD970(WorldActor*); void func_800ADD4C(s16); s16 func_800AE180(s32, s32, s32); From 583f2a722495687a0a997aad705ee0fc44944a87 Mon Sep 17 00:00:00 2001 From: halkun <37340407+joshuanwalker@users.noreply.github.com> Date: Fri, 4 Sep 2026 18:55:33 -0500 Subject: [PATCH 2/2] WM functions block 2 --- config/sym_ovl_export.us.txt | 202 +++++++++---------- config/symbols.world.txt | 109 +++++++++- src/world/world.c | 375 ++++++++++++++++++----------------- src/world/world.h | 14 +- src/world/world2.c | 38 ++-- 5 files changed, 422 insertions(+), 316 deletions(-) diff --git a/config/sym_ovl_export.us.txt b/config/sym_ovl_export.us.txt index ec30d777..e976aa5c 100644 --- a/config/sym_ovl_export.us.txt +++ b/config/sym_ovl_export.us.txt @@ -2090,42 +2090,42 @@ WmRestoreEntityPosAndDirFromSavemap = 0x800ada64; func_800ADB30 = 0x800adb30; func_800ADC3C = 0x800adc3c; func_800ADC70 = 0x800adc70; -func_800ADC80 = 0x800adc80; -func_800ADD4C = 0x800add4c; -func_800ADE30 = 0x800ade30; -func_800ADEA8 = 0x800adea8; +WmAddMutexPriority = 0x800adc80; +WmRemoveMutexPriority = 0x800add4c; +WmRandomTwiddle = 0x800ade30; +WmRandomInit = 0x800adea8; func_800ADFC0 = 0x800adfc0; -func_800AE024 = 0x800ae024; -func_800AE0BC = 0x800ae0bc; -func_800AE180 = 0x800ae180; -func_800AE47C = 0x800ae47c; -func_800AE4B8 = 0x800ae4b8; -func_800AE5B8 = 0x800ae5b8; -func_800AE5F0 = 0x800ae5f0; +WmGetDistanceBetweenPoints = 0x800ae024; +WmRotateVectorByYAngle = 0x800ae0bc; +WmGetRotFromVector = 0x800ae180; +WmGetRotFromEntityToEntity = 0x800ae47c; +WmCreateSkyboxOverlayRenderBuffers = 0x800ae4b8; +WmGetSkyboxOverlayCurrRenderBuffer = 0x800ae5b8; +WmGetSkyboxOverlayCurrTextureSettingBuffer = 0x800ae5f0; func_800AE628 = 0x800ae628; -func_800AE638 = 0x800ae638; +WmUpdateSkyboxOverlayVertexes = 0x800ae638; func_800AE8AC = 0x800ae8ac; func_800AEA48 = 0x800aea48; func_800AF0A0 = 0x800af0a0; func_800AF0B0 = 0x800af0b0; -func_800AF110 = 0x800af110; +WmSetGteColourSettings = 0x800af110; func_800AF1A8 = 0x800af1a8; -func_800AF1E8 = 0x800af1e8; -func_800AF24C = 0x800af24c; -func_800AF2A4 = 0x800af2a4; -func_800AF324 = 0x800af324; +WmSetActivePointMeshCoords = 0x800af1e8; +WmSetActivePointCoordsInMesh = 0x800af24c; +WmSetActivePointColour = 0x800af2a4; +WmSetActivePointSkyColour = 0x800af324; func_800AF364 = 0x800af364; -func_800AF3A4 = 0x800af3a4; -func_800AF96C = 0x800af96c; +WmUpdateLightingFromPoints = 0x800af3a4; +WmGetDistanceToActivePoint = 0x800af96c; func_800AF9A0 = 0x800af9a0; -func_800AF9DC = 0x800af9dc; -func_800AFCC8 = 0x800afcc8; -func_800AFFBC = 0x800affbc; -func_800B0098 = 0x800b0098; -func_800B017C = 0x800b017c; -func_800B01C4 = 0x800b01c4; -func_800B0200 = 0x800b0200; -func_800B0240 = 0x800b0240; +WmFadeInit = 0x800af9dc; +WmFadeRender = 0x800afcc8; +WmSetFadeIn = 0x800affbc; +WmSetFadeOut = 0x800b0098; +WmFadeInSnow = 0x800b017c; +WmFadeOutSnow = 0x800b01c4; +WmFadeStartSnow = 0x800b0200; +WmFadeIsStopped = 0x800b0240; func_800B0250 = 0x800b0250; func_800B0334 = 0x800b0334; func_800B04AC = 0x800b04ac; @@ -2152,8 +2152,8 @@ func_800B2E90 = 0x800b2e90; func_800B2FA4 = 0x800b2fa4; func_800B2FD0 = 0x800b2fd0; func_800B3018 = 0x800b3018; -func_800B3044 = 0x800b3044; -func_800B307C = 0x800b307c; +WmSnowReset = 0x800b3044; +WmSnowUpdate = 0x800b307c; func_800B3300 = 0x800b3300; func_800B3350 = 0x800b3350; func_800B338C = 0x800b338c; @@ -2171,41 +2171,41 @@ func_800B5314 = 0x800b5314; func_800B579C = 0x800b579c; func_800B57C0 = 0x800b57c0; func_800B57DC = 0x800b57dc; -func_800B58F8 = 0x800b58f8; +WmCreateShadowPacket = 0x800b58f8; func_800B59F4 = 0x800b59f4; func_800B5C7C = 0x800b5c7c; -func_800B5DD8 = 0x800b5dd8; -func_800B5E28 = 0x800b5e28; +WmSetCalculateAllPartsLighting = 0x800b5dd8; +WmUpdateModelByAnimationFrame = 0x800b5e28; func_800B624C = 0x800b624c; func_800B6348 = 0x800b6348; func_800B63F0 = 0x800b63f0; func_800B64A0 = 0x800b64a0; func_800B64D8 = 0x800b64d8; func_800B650C = 0x800b650c; -func_800B6570 = 0x800b6570; +WmSetMusicVolume = 0x800b6570; func_800B65A4 = 0x800b65a4; func_800B65E0 = 0x800b65e0; -func_800B667C = 0x800b667c; -func_800B6724 = 0x800b6724; -func_800B69A4 = 0x800b69a4; -func_800B6A4C = 0x800b6a4c; -func_800B6AEC = 0x800b6aec; +WmInitModelVariablesAndArray = 0x800b667c; +WmCalculateBonesAndLighting = 0x800b6724; +WmLoadPcCharModelFile = 0x800b69a4; +WmLoadPcCharModelIntoMemory = 0x800b6a4c; +WmPcCharModelLoadFileCallback = 0x800b6aec; func_800B6B28 = 0x800b6b28; func_800B6C84 = 0x800b6c84; func_800B6D10 = 0x800b6d10; -func_800B6DCC = 0x800b6dcc; +WmPackModelLoadFileCallback = 0x800b6dcc; func_800B6E08 = 0x800b6e08; func_800B6E78 = 0x800b6e78; -func_800B6EFC = 0x800b6efc; +WmGetModelDataByModelId = 0x800b6efc; func_800B7104 = 0x800b7104; -func_800B7134 = 0x800b7134; +WmAbortModelLoading = 0x800b7134; func_800B717C = 0x800b717c; func_800B7200 = 0x800b7200; func_800B7228 = 0x800b7228; func_800B7480 = 0x800b7480; func_800B7620 = 0x800b7620; func_800B76A8 = 0x800b76a8; -func_800B7714 = 0x800b7714; +WmSetFieldToLoad = 0x800b7714; func_800B77A8 = 0x800b77a8; func_800B77F4 = 0x800b77f4; func_800B7820 = 0x800b7820; @@ -2213,7 +2213,7 @@ func_800B7838 = 0x800b7838; func_800B785C = 0x800b785c; func_800B786C = 0x800b786c; func_800B787C = 0x800b787c; -func_800B79B8 = 0x800b79b8; +WmGetPcCharModelIdFromParty = 0x800b79b8; func_800B7A40 = 0x800b7a40; func_800B7AC0 = 0x800b7ac0; func_800B7B1C = 0x800b7b1c; @@ -2226,77 +2226,77 @@ func_800B7BD8 = 0x800b7bd8; func_800B7C1C = 0x800b7c1c; func_800B7C7C = 0x800b7c7c; func_800B832C = 0x800b832c; -func_800B8488 = 0x800b8488; -func_800B84D8 = 0x800b84d8; -func_800B851C = 0x800b851c; -func_800B858C = 0x800b858c; -func_800B85D4 = 0x800b85d4; -func_800B86C4 = 0x800b86c4; -func_800B86E8 = 0x800b86e8; -func_800B8720 = 0x800b8720; -func_800B8760 = 0x800b8760; -func_800B87D8 = 0x800b87d8; -func_800B89C4 = 0x800b89c4; -func_800B8A5C = 0x800b8a5c; -func_800B8A98 = 0x800b8a98; -func_800B8B00 = 0x800b8b00; -func_800B8CBC = 0x800b8cbc; -func_800B8D20 = 0x800b8d20; -func_800B8D4C = 0x800b8d4c; -func_800B90C0 = 0x800b90c0; -func_800B95E8 = 0x800b95e8; -func_800B962C = 0x800b962c; -func_800B98F0 = 0x800b98f0; -func_800B9B2C = 0x800b9b2c; -func_800BA938 = 0x800ba938; -func_800BAA00 = 0x800baa00; -func_800BAB60 = 0x800bab60; -func_800BAC70 = 0x800bac70; +WmDialogsInit = 0x800b8488; +WmDialogSetMessageToShowForId0 = 0x800b84d8; +WmDialogSetAskToShowForId0 = 0x800b851c; +WmDialogSetWindowWithId0ToClose = 0x800b858c; +WmDialogUpdate = 0x800b85d4; +WmDialogGetAskResult = 0x800b86c4; +WmDialogSetPosAndSizeForId0 = 0x800b86e8; +WmDialogSetModeAndPermanencyForId0 = 0x800b8720; +WmDialog0ResetAndPointerInit = 0x800b8760; +WmDialogReset = 0x800b87d8; +WmDialogSetWindowToCloseIfPossible = 0x800b89c4; +WmDialogSetModeAndPermanency = 0x800b8a5c; +WmDialogsReset = 0x800b8a98; +WmDialogSetPosAndSize = 0x800b8b00; +WmDialogAddPos = 0x800b8cbc; +WmDialogSetHeight = 0x800b8d20; +WmDialogSetMessageToShow = 0x800b8d4c; +WmDialogSetAskToShow = 0x800b90c0; +WmDialogPlaySound = 0x800b95e8; +WmDialogInitWindow = 0x800b962c; +WmDialogInscreaseWindow = 0x800b98f0; +WmDialogStringOutput = 0x800b9b2c; +WmDialogTextScrollByRow = 0x800ba938; +WmDialogTextScrollDuringOk = 0x800baa00; +WmDialogStartText = 0x800bab60; +WmDialogDiscreaseWindow = 0x800bac70; func_800BAE60 = 0x800bae60; -func_800BB350 = 0x800bb350; -func_800BB450 = 0x800bb450; -func_800BB568 = 0x800bb568; +WmDialogAddDigitWithoutLeadingSpace = 0x800bb350; +WmDialogAddDigitWithLeadingSpace = 0x800bb450; +WmDialogAddHexDigitWithoutLeadingSpace = 0x800bb568; func_800BB650 = 0x800bb650; -func_800BB7DC = 0x800bb7dc; +WmDialogCopyStringIntoCharName = 0x800bb7dc; func_800BB8B0 = 0x800bb8b0; -func_800BB8E8 = 0x800bb8e8; -func_800BB9A0 = 0x800bb9a0; -func_800BB9D0 = 0x800bb9d0; -func_800BBA0C = 0x800bba0c; -func_800BBA44 = 0x800bba44; +WmMovePcEntityByDistance = 0x800bb8e8; +WmScriptPushToStoreStack = 0x800bb9a0; +WmScriptPopFromStoreStack = 0x800bb9d0; +WmScriptGetTopFromStoreStack = 0x800bba0c; +WmScriptIsDataInStoreStack = 0x800bba44; func_800BBBB0 = 0x800bbbb0; func_800BBC4C = 0x800bbc4c; func_800BBD20 = 0x800bbd20; -func_800BC1CC = 0x800bc1cc; -func_800BC420 = 0x800bc420; -func_800BC9E8 = 0x800bc9e8; -func_800BCA38 = 0x800bca38; +WmUiMapCreate = 0x800bc1cc; +WmUiMapUpdate = 0x800bc420; +WmSetCamMode = 0x800bc9e8; +WmGetCamMode = 0x800bca38; func_800BCA48 = 0x800bca48; func_800BCA78 = 0x800bca78; func_800BCB2C = 0x800bcb2c; func_800BCBE8 = 0x800bcbe8; func_800BCECC = 0x800bcecc; func_800BD124 = 0x800bd124; -func_800BFBF0 = 0x800bfbf0; -func_800BFCAC = 0x800bfcac; +WmLoadModelPacketAndScale = 0x800bfbf0; +WmCreatePacketForModelPart = 0x800bfcac; func_800C02F4 = 0x800c02f4; -func_800C0808 = 0x800c0808; -func_800C08A8 = 0x800c08a8; -func_800C0B48 = 0x800c0b48; -func_800C1490 = 0x800c1490; -func_800C1D58 = 0x800c1d58; -func_800C1FD8 = 0x800c1fd8; -func_800C2130 = 0x800c2130; -func_800C2450 = 0x800c2450; -func_800C2524 = 0x800c2524; -func_800C31F0 = 0x800c31f0; -func_800C3948 = 0x800c3948; -func_800C3DB0 = 0x800c3db0; -func_800C4148 = 0x800c4148; -func_800C4FB4 = 0x800c4fb4; -func_800C5CD4 = 0x800c5cd4; -func_800C6104 = 0x800c6104; -func_800C6598 = 0x800c6598; +WmLoadTexturesToVram = 0x800c0808; +WmUpdateModelPacket2 = 0x800c08a8; +WmUpdatePacketForModelPartWithoutMatrixes = 0x800c0b48; +WmCalculateBoneMatrixes = 0x800c1490; +WmScaleModelAll = 0x800c1d58; +WmScaleModelVertexes = 0x800c1fd8; +WmScaleModelAnimations = 0x800c2130; +WmApplyModelLightingToPacket = 0x800c2450; +WmApplyPolyLightingToPacket = 0x800c2524; +WmCalculateModelLighting = 0x800c31f0; +WmCalculatePartLighting = 0x800c3948; +WmUpdatePartTransparency = 0x800c3db0; +WmUpdateModelPacket = 0x800c4148; +WmUpdatePacketForModelPartWithMatrixes = 0x800c4fb4; +WmUpdateModelLighting = 0x800c5cd4; +WmUpdatePartLighting = 0x800c6104; +WmGetModelTotalRenderPacketSize = 0x800c6598; world_unk_s = 0x800c80c0; MAGIC_Barrier = 0x801b0000; BarrierBaseScale = 0x801b0cc0; diff --git a/config/symbols.world.txt b/config/symbols.world.txt index 9bf0a891..3808386d 100644 --- a/config/symbols.world.txt +++ b/config/symbols.world.txt @@ -1,5 +1,3 @@ -func_800BD124 = 0x800BD124; - WmSetRenderBuffers = 0x800A0B48; WmGetCurrRenderBufferId = 0x800A0BD4; WmLoadTxzFile = 0x800A0C54; @@ -74,4 +72,109 @@ WmScriptRunOne = 0x800AD63C; WmScriptRunAll = 0x800AD788; WmScriptIsAnyScriptRuns = 0x800AD928; WmRestoreEntityPosAndDirFromSavemap = 0x800ADA64; - +WmAddMutexPriority = 0x800ADC80; +WmRemoveMutexPriority = 0x800ADD4C; +WmRandomTwiddle = 0x800ADE30; +WmRandomInit = 0x800ADEA8; +WmGetDistanceBetweenPoints = 0x800AE024; +WmRotateVectorByYAngle = 0x800AE0BC; +WmGetRotFromVector = 0x800AE180; +WmGetRotFromEntityToEntity = 0x800AE47C; +WmCreateSkyboxOverlayRenderBuffers = 0x800AE4B8; +WmGetSkyboxOverlayCurrRenderBuffer = 0x800AE5B8; +WmGetSkyboxOverlayCurrTextureSettingBuffer = 0x800AE5F0; +WmUpdateSkyboxOverlayVertexes = 0x800AE638; +WmSetGteColourSettings = 0x800AF110; +WmSetActivePointMeshCoords = 0x800AF1E8; +WmSetActivePointCoordsInMesh = 0x800AF24C; +WmSetActivePointColour = 0x800AF2A4; +WmSetActivePointSkyColour = 0x800AF324; +WmUpdateLightingFromPoints = 0x800AF3A4; +WmGetDistanceToActivePoint = 0x800AF96C; +WmFadeInit = 0x800AF9DC; +WmFadeRender = 0x800AFCC8; +WmSetFadeIn = 0x800AFFBC; +WmSetFadeOut = 0x800B0098; +WmFadeInSnow = 0x800B017C; +WmFadeOutSnow = 0x800B01C4; +WmFadeStartSnow = 0x800B0200; +WmFadeIsStopped = 0x800B0240; +WmSnowReset = 0x800B3044; +WmSnowUpdate = 0x800B307C; +WmCreateShadowPacket = 0x800B58F8; +WmSetCalculateAllPartsLighting = 0x800B5DD8; +WmUpdateModelByAnimationFrame = 0x800B5E28; +WmSetMusicVolume = 0x800B6570; +WmInitModelVariablesAndArray = 0x800B667C; +WmCalculateBonesAndLighting = 0x800B6724; +WmLoadPcCharModelFile = 0x800B69A4; +WmLoadPcCharModelIntoMemory = 0x800B6A4C; +WmPcCharModelLoadFileCallback = 0x800B6AEC; +WmPackModelLoadFileCallback = 0x800B6DCC; +WmGetModelDataByModelId = 0x800B6EFC; +WmAbortModelLoading = 0x800B7134; +WmSetFieldToLoad = 0x800B7714; +WmGetPcCharModelIdFromParty = 0x800B79B8; +WmDialogsInit = 0x800B8488; +WmDialogSetMessageToShowForId0 = 0x800B84D8; +WmDialogSetAskToShowForId0 = 0x800B851C; +WmDialogIsWindowWithId0Showing = 0x800B857C; +WmDialogSetWindowWithId0ToClose = 0x800B858C; +WmDialogUpdate = 0x800B85D4; +WmDialogGetAskResult = 0x800B86C4; +WmDialogSetPosAndSizeForId0 = 0x800B86E8; +WmDialogSetModeAndPermanencyForId0 = 0x800B8720; +WmDialogPrintParam = 0x800B8750; +WmDialogPrintNoParam = 0x800B8758; +WmDialog0ResetAndPointerInit = 0x800B8760; +WmDialogReset = 0x800B87D8; +WmDialogSetWindowToCloseIfPossible = 0x800B89C4; +WmDialogSetModeAndPermanency = 0x800B8A5C; +WmDialogsReset = 0x800B8A98; +WmDialogSetPosAndSize = 0x800B8B00; +WmDialogAddPos = 0x800B8CBC; +WmDialogSetHeight = 0x800B8D20; +WmDialogSetMessageToShow = 0x800B8D4C; +WmDialogSetAskToShow = 0x800B90C0; +WmDialogPlaySound = 0x800B95E8; +WmDialogInitWindow = 0x800B962C; +WmDialogInscreaseWindow = 0x800B98F0; +WmDialogStringOutput = 0x800B9B2C; +WmDialogTextScrollByRow = 0x800BA938; +WmDialogTextScrollDuringOk = 0x800BAA00; +WmDialogStartText = 0x800BAB60; +WmDialogDiscreaseWindow = 0x800BAC70; +WmDialogAddDigitWithoutLeadingSpace = 0x800BB350; +WmDialogAddDigitWithLeadingSpace = 0x800BB450; +WmDialogAddHexDigitWithoutLeadingSpace = 0x800BB568; +WmDialogCopyStringIntoCharName = 0x800BB7DC; +WmMovePcEntityByDistance = 0x800BB8E8; +WmScriptPushToStoreStack = 0x800BB9A0; +WmScriptPopFromStoreStack = 0x800BB9D0; +WmScriptGetTopFromStoreStack = 0x800BBA0C; +WmScriptSetFirstToStoreStack = 0x800BBA34; +WmScriptIsDataInStoreStack = 0x800BBA44; +WmUiMapCreate = 0x800BC1CC; +WmUiMapUpdate = 0x800BC420; +WmSetCamMode = 0x800BC9E8; +WmGetCamMode = 0x800BCA38; +func_800BD124 = 0x800BD124; +WmLoadModelPacketAndScale = 0x800BFBF0; +WmCreatePacketForModelPart = 0x800BFCAC; +WmLoadTexturesToVram = 0x800C0808; +WmUpdateModelPacket2 = 0x800C08A8; +WmUpdatePacketForModelPartWithoutMatrixes = 0x800C0B48; +WmCalculateBoneMatrixes = 0x800C1490; +WmScaleModelAll = 0x800C1D58; +WmScaleModelVertexes = 0x800C1FD8; +WmScaleModelAnimations = 0x800C2130; +WmApplyModelLightingToPacket = 0x800C2450; +WmApplyPolyLightingToPacket = 0x800C2524; +WmCalculateModelLighting = 0x800C31F0; +WmCalculatePartLighting = 0x800C3948; +WmUpdatePartTransparency = 0x800C3DB0; +WmUpdateModelPacket = 0x800C4148; +WmUpdatePacketForModelPartWithMatrixes = 0x800C4FB4; +WmUpdateModelLighting = 0x800C5CD4; +WmUpdatePartLighting = 0x800C6104; +WmGetModelTotalRenderPacketSize = 0x800C6598; diff --git a/src/world/world.c b/src/world/world.c index 37ae381d..5807b752 100644 --- a/src/world/world.c +++ b/src/world/world.c @@ -7,25 +7,25 @@ void WmGetPosFromPcEntity(VECTOR* arg0); void WmRestoreEntityPosAndDirFromSavemap(WorldActor*); s32 func_800ADFC0(void); static s32 func_800B0800(void); -void func_800B58F8(u8*, RECT*); +void WmCreateShadowPacket(u8*, RECT*); static s32 func_800B716C(void); static s32 func_800B7B2C(void); s32 func_800B7B3C(void); -void func_800B87D8(s16 window); -void func_800B95E8(void); -s32 func_800B962C(s16 window, s16 stringId); -void func_800B98F0(s16 window); -void func_800B9B2C(s16 window); -void func_800BA938(s16 window); -void func_800BAA00(s16 window); -void func_800BAB60(s16 window); -s32 func_800BAC70(s16 window); +void WmDialogReset(s16 window); +void WmDialogPlaySound(void); +s32 WmDialogInitWindow(s16 window, s16 stringId); +void WmDialogInscreaseWindow(s16 window); +void WmDialogStringOutput(s16 window); +void WmDialogTextScrollByRow(s16 window); +void WmDialogTextScrollDuringOk(s16 window); +void WmDialogStartText(s16 window); +s32 WmDialogDiscreaseWindow(s16 window); u16 func_800BAE60(s16 window); -void func_800BB350(u16 value, u8* dst); -void func_800BB450(u16 value, u8* dst); -void func_800BB568(u16 value, u8* dst); -void func_800BC9E8(s16 arg0); -s16 func_800BCA38(void); +void WmDialogAddDigitWithoutLeadingSpace(u16 value, u8* dst); +void WmDialogAddDigitWithLeadingSpace(u16 value, u8* dst); +void WmDialogAddHexDigitWithoutLeadingSpace(u16 value, u8* dst); +void WmSetCamMode(s16 arg0); +s16 WmGetCamMode(void); void func_800BCA48(void); const char D_800A0000[] = "NEW "; @@ -213,21 +213,21 @@ INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A3C74); void WmSubmarineFloatToPlanet(void) { D_800E566C = 5; D_800E5644 = 0x14; - func_800B7714(0); + WmSetFieldToLoad(0); func_800A2108(0, 0); - func_800B0098(0x10, 1); + WmSetFadeOut(0x10, 1); } void WmSubmarineSubmergeUnderwater(void) { D_800E566C = 4; D_800E5644 = -0x14; - func_800B7714(0); + WmSetFieldToLoad(0); func_800A2108(0, 0); - func_800B0098(0x10, 1); + WmSetFadeOut(0x10, 1); } void func_800A3E9C(s32 arg0) { - func_800B7714(arg0); + WmSetFieldToLoad(arg0); D_800E566C = 8; } @@ -241,7 +241,7 @@ void func_800A3EC8(s32 arg0) { if (D_800E566C == 1) { D_800E566C = 3; func_800A2108(0, 0); - func_800B7714(arg0); + WmSetFieldToLoad(arg0); } } @@ -278,11 +278,11 @@ void WmResetGame(void) { } } -s32 func_800A4080(void) { return (D_800E5648 & 3) | ((func_800BCA38() * 4) & 0xC); } +s32 func_800A4080(void) { return (D_800E5648 & 3) | ((WmGetCamMode() * 4) & 0xC); } void func_800A40B8(s32 arg0) { WmSetCamView(arg0 & 3); - func_800BC9E8((arg0 >> 2) & 3); + WmSetCamMode((arg0 >> 2) & 3); } s32 func_800A40F0(s16 arg0) { @@ -302,11 +302,11 @@ void func_800A41E8(s32 arg0) { switch (arg0) { case 1: func_800A2108(0, 4); - func_800B0098(4, 1); + WmSetFadeOut(4, 1); break; case 4: func_800A2108(1, 4); - func_800AFFBC(0x10, 1); + WmSetFadeIn(0x10, 1); arg0 = 0; break; } @@ -412,7 +412,7 @@ INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800A57C8); void WmMapLoadFinishedCallback(void) { if (D_800E5820 >= 0) { D_800E5814 = (D_8011650C * 5) - 1; - func_800ADD4C(0); + WmRemoveMutexPriority(0); } } @@ -883,7 +883,7 @@ void WmInitActiveEntityStruct(s32 arg0) { rect.h = 0xF; D_8010AD3C->unk58 = 0x20; } - func_800B58F8(D_8010AD3C->unk90, &rect); + WmCreateShadowPacket(D_8010AD3C->unk90, &rect); WmRestoreEntityPosAndDirFromSavemap(D_8010AD3C); } } @@ -1425,13 +1425,13 @@ s32 WmScriptPopStack(void) { var_s0 = func_800B0800(); break; case 12: // Prompt window result - var_s0 = func_800B86C4(); + var_s0 = WmDialogGetAskResult(); break; case 13: // Script index of current mesh triangle of active actor var_s0 = ((D_8010AD3C->walkmesh) >> 5) & 7; break; case 14: // Player party member model ID (0=Cloud, 1=Tifa, 2=Cid) - var_s0 = func_800B79B8(); + var_s0 = WmGetPcCharModelIdFromParty(); break; case 16: // Random byte var_s0 = func_800ADFC0(); @@ -1583,13 +1583,13 @@ void WmScriptOpcode000Handle(u16 arg0) { case 0x18: // "push distance from active entity to point" func_800AF1A8(WmScriptPopStack(), -1); WmGetPosFromActiveEntity(&sp10); - D_8010AD90->unk0 = func_800AF96C(&sp10) >> 5; + D_8010AD90->unk0 = WmGetDistanceToActivePoint(&sp10) >> 5; break; case 0x19: // "push distance from active entity to entity by model id" temp_s0_16 = D_8010AD3C; D_8010AD90->unk0 = 0; if (WmSetActiveEntityWithModelId(WmScriptPopStack()) != 0) { - D_8010AD90->unk0 = func_800AE024(&D_8010AD3C->pos, &temp_s0_16->pos) >> 4; + D_8010AD90->unk0 = WmGetDistanceBetweenPoints(&D_8010AD3C->pos, &temp_s0_16->pos) >> 4; } D_8010AD3C = temp_s0_16; break; @@ -1601,7 +1601,7 @@ void WmScriptOpcode000Handle(u16 arg0) { if (temp_v0 >= 0 && temp_v0 < 3) { // not going to bother with the struct at 8010ADF4 yet, as it may be // unused - temp_s0_17->unk0 = func_800AE024(&sp10, (VECTOR*)((temp_v0 * 0x4) + &D_8010ADF4)) >> 4; + temp_s0_17->unk0 = WmGetDistanceBetweenPoints(&sp10, (VECTOR*)((temp_v0 * 0x4) + &D_8010ADF4)) >> 4; } else { temp_s0_17->unk0 = 0; } @@ -1745,9 +1745,9 @@ void func_800ADC3C(VECTOR* arg0) { D_8010AE34 = *arg0; } void func_800ADC70(void) { D_8010AE54 = 0; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800ADC80); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmAddMutexPriority); -void func_800ADD4C(s16 arg0) { +void WmRemoveMutexPriority(s16 arg0) { u32 var_v1; if (((-1 << (arg0 + 1)) & D_8010AE54) || !((D_8010AE54 >> arg0) & 1)) @@ -1763,7 +1763,7 @@ void func_800ADD4C(s16 arg0) { } // Shuffle World Map RNG Buffer -void func_800ADE30(void) { +void WmRandomTwiddle(void) { s32 i; for (i = 0; i < 0x20; i++) D_8010AE5C[i] ^= D_8010AE5C[0x1E9 + i]; @@ -1772,7 +1772,7 @@ void func_800ADE30(void) { } // seed RNG -void func_800ADEA8(s32 arg0) { +void WmRandomInit(s32 arg0) { s32 var_a1; s32 var_a2; u32 var_a3; @@ -1791,9 +1791,9 @@ void func_800ADEA8(s32 arg0) { arr[var_a2] = (arr[var_a2 - 0x11] << 0x17) ^ (arr[var_a2 - 0x10] >> 0x9) ^ (arr[var_a2 - 0x1]); for (var_a2 = 0; var_a2 <= 0x208; var_a2++) D_8010AE5C[var_a2] = arr[var_a2]; - func_800ADE30(); - func_800ADE30(); - func_800ADE30(); + WmRandomTwiddle(); + WmRandomTwiddle(); + WmRandomTwiddle(); D_8010AE58 = 0x208; } @@ -1801,13 +1801,13 @@ void func_800ADEA8(s32 arg0) { s32 func_800ADFC0(void) { D_8010AE58++; if (D_8010AE58 > 0x208) { - func_800ADE30(); + WmRandomTwiddle(); D_8010AE58 = 0; } return D_8010AE5C[D_8010AE58]; } -s32 func_800AE024(VECTOR* arg0, VECTOR* arg1) { +s32 WmGetDistanceBetweenPoints(VECTOR* arg0, VECTOR* arg1) { s32 temp_a0; s32 temp_a1; s32 temp_v0; @@ -1845,23 +1845,23 @@ s32 func_800AE024(VECTOR* arg0, VECTOR* arg1) { return var_a2 + var_a3 + var_v1; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AE0BC); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmRotateVectorByYAngle); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AE180); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmGetRotFromVector); -s16 func_800AE47C(VECTOR* arg0, VECTOR* arg1) { - return func_800AE180(arg1->vx - arg0->vx, arg1->vz - arg0->vz, arg1->vx); +s16 WmGetRotFromEntityToEntity(VECTOR* arg0, VECTOR* arg1) { + return WmGetRotFromVector(arg1->vx - arg0->vx, arg1->vz - arg0->vz, arg1->vx); } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AE4B8); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmCreateSkyboxOverlayRenderBuffers); -void* func_800AE5B8(void) { return (WmGetCurrRenderBufferId() * 0x24) + &D_800C6770; } +void* WmGetSkyboxOverlayCurrRenderBuffer(void) { return (WmGetCurrRenderBufferId() * 0x24) + &D_800C6770; } -void* func_800AE5F0(void) { return (WmGetCurrRenderBufferId() * 0xC) + D_8010B068; } +void* WmGetSkyboxOverlayCurrTextureSettingBuffer(void) { return (WmGetCurrRenderBufferId() * 0xC) + D_8010B068; } s32 func_800AE628(void) { return D_8010B080; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AE638); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmUpdateSkyboxOverlayVertexes); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AE8AC); @@ -1870,7 +1870,7 @@ INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AEA48); void func_800AF0A0(s32 arg0) { D_8010B174 = arg0; } void func_800AF0B0(void) { - void func_800AF110(void); + void WmSetGteColourSettings(void); s32 i; s32 offset; @@ -1883,10 +1883,10 @@ void func_800AF0B0(void) { } D_8010B3B8 = NULL; - func_800AF110(); + WmSetGteColourSettings(); } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AF110); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmSetGteColourSettings); void func_800AF1A8(u32 arg0, s32 arg1) { Unk8010B178* temp_v1; @@ -1900,7 +1900,7 @@ void func_800AF1A8(u32 arg0, s32 arg1) { } } -void func_800AF1E8(u32 arg0, u32 arg1) { +void WmSetActivePointMeshCoords(u32 arg0, u32 arg1) { if ((D_8010B3B8 != NULL) && (arg0 < 0x24) && (arg1 < 0x1C)) { D_8010B3B8->unk0.vx &= 0x1FFF; D_8010B3B8->unk0.vz &= 0x1FFF; @@ -1909,7 +1909,7 @@ void func_800AF1E8(u32 arg0, u32 arg1) { } } -void func_800AF24C(s32 arg0, s32 arg1) { +void WmSetActivePointCoordsInMesh(s32 arg0, s32 arg1) { if (D_8010B3B8 != NULL) { D_8010B3B8->unk0.vx &= -0x2000; D_8010B3B8->unk0.vz &= -0x2000; @@ -1918,7 +1918,7 @@ void func_800AF24C(s32 arg0, s32 arg1) { } } -void func_800AF2A4(u8 arg0, u8 arg1, u8 arg2) { +void WmSetActivePointColour(u8 arg0, u8 arg1, u8 arg2) { if (D_8010B3B8 != NULL) { D_8010B3B8->unk10 = arg0; D_8010B3B8->unk11 = arg1; @@ -1936,7 +1936,7 @@ static void func_800AF304(s32 arg0) { D_8010B3B8->unk20 = arg0; } -void func_800AF324(u8 arg0, u8 arg1, u8 arg2) { +void WmSetActivePointSkyColour(u8 arg0, u8 arg1, u8 arg2) { if (D_8010B3B8 != NULL) { D_8010B3B8->unk14 = arg0; D_8010B3B8->unk15 = arg1; @@ -1952,30 +1952,32 @@ void func_800AF364(u8 arg0, u8 arg1, u8 arg2) { } } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AF3A4); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmUpdateLightingFromPoints); -s32 func_800AF96C(VECTOR* v) { return D_8010B3B8 ? func_800AE024(v, &D_8010B3B8->unk0) : 0; } +s32 WmGetDistanceToActivePoint(VECTOR* v) { return D_8010B3B8 ? WmGetDistanceBetweenPoints(v, &D_8010B3B8->unk0) : 0; } -s16 func_800AF9A0(VECTOR* arg0) { return D_8010B3B8 == NULL ? 0 : func_800AE47C(arg0, (VECTOR*)D_8010B3B8); } +s16 func_800AF9A0(VECTOR* arg0) { + return D_8010B3B8 == NULL ? 0 : WmGetRotFromEntityToEntity(arg0, (VECTOR*)D_8010B3B8); +} -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AF9DC); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmFadeInit); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AFCC8); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmFadeRender); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800AFFBC); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmSetFadeIn); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B0098); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmSetFadeOut); -void func_800B017C(s32 arg0) { (&D_8010B47C)[arg0] = (D_8010B488[arg0] < D_8010B494[arg0]) << 4; } +void WmFadeInSnow(s32 arg0) { (&D_8010B47C)[arg0] = (D_8010B488[arg0] < D_8010B494[arg0]) << 4; } -void func_800B01C4(s32 arg0) { (&D_8010B47C)[arg0] = (D_8010B488[arg0] > 0) ? -0x10 : 0; } +void WmFadeOutSnow(s32 arg0) { (&D_8010B47C)[arg0] = (D_8010B488[arg0] > 0) ? -0x10 : 0; } -void func_800B0200(s32 arg0) { - func_800B017C(arg0); +void WmFadeStartSnow(s32 arg0) { + WmFadeInSnow(arg0); D_8010B4A0[arg0] = 0x64; } -s32 func_800B0240(void) { return !D_8010B47C; } +s32 WmFadeIsStopped(void) { return !D_8010B47C; } INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B0250); @@ -2112,7 +2114,7 @@ void func_800B3018(void) { D_8010CA8C = 0; } -void func_800B3044(s16 arg0) { +void WmSnowReset(s16 arg0) { D_8010CAFC = arg0; D_8010CB10 = 0; D_8010CB0C = 0; @@ -2121,7 +2123,7 @@ void func_800B3044(s16 arg0) { D_8010CB00 = 0; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B307C); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmSnowUpdate); static s16 func_800B32F0(void) { return D_8010CAFC; } @@ -2182,15 +2184,15 @@ void func_800B57C0(s32 arg0) { D_8010D9BA[arg0 * 4] = 0; } INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B57DC); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B58F8); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmCreateShadowPacket); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B59F4); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B5C7C); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B5DD8); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmSetCalculateAllPartsLighting); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B5E28); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmUpdateModelByAnimationFrame); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B624C); @@ -2212,7 +2214,7 @@ void func_800B64D8(u32 arg0) { INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B650C); -void func_800B6570(u32 arg0) { +void WmSetMusicVolume(u32 arg0) { D_8009A000[0] = 0xC0; D_8009A004[0] = arg0; SystemAkaoExecute(); @@ -2227,19 +2229,19 @@ void func_800B65A4(u32 arg0, s32 arg1) { INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B65E0); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B667C); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmInitModelVariablesAndArray); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B6724); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmCalculateBonesAndLighting); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B69A4); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmLoadPcCharModelFile); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B6A4C); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmLoadPcCharModelIntoMemory); -void func_800B6AEC(void) { +void WmPcCharModelLoadFileCallback(void) { if (D_80115A60 != 0) { D_80115A60 = 0; - func_800ADD4C(2); - func_800B6A4C(); + WmRemoveMutexPriority(2); + WmLoadPcCharModelIntoMemory(); } } @@ -2249,10 +2251,10 @@ INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B6C84); INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B6D10); -void func_800B6DCC(void) { +void WmPackModelLoadFileCallback(void) { if (D_80115A60 != 0) { D_80115A60 = 0; - func_800ADD4C(2); + WmRemoveMutexPriority(2); func_800B6D10(); } } @@ -2285,14 +2287,14 @@ void func_800B6E78(void) { func_800A8048(); } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B6EFC); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmGetModelDataByModelId); void func_800B7104(s16 arg0) { D_80115A58 = arg0; func_800B6B28(arg0); } -void func_800B7134(void) { +void WmAbortModelLoading(void) { SystemCdromAbortLoading(); D_80115A60 = 0; } @@ -2348,7 +2350,7 @@ void func_800B76A8(void) { } } -void func_800B7714(s32 arg0) { +void WmSetFieldToLoad(s32 arg0) { u8* p; s32 index; @@ -2365,10 +2367,10 @@ void func_800B7714(s32 arg0) { } void func_800B77A8(s32 arg0) { - void func_800B7714(s32); + void WmSetFieldToLoad(s32); if (arg0 & 0x40000000) { - func_800B7714(0x2100); + WmSetFieldToLoad(0x2100); } D_8011626C = 1; D_80116274 = arg0; @@ -2401,7 +2403,7 @@ extern u8 D_8009D392; extern u8 D_8009D393; // Player party member model ID (0=Cloud, 1=Tifa, 2=Cid) -s32 func_800B79B8(void) { +s32 WmGetPcCharModelIdFromParty(void) { if ((*D_8009D391 != 0) && (D_8009D392 != 0) && (D_8009D393 != 0)) { if ((*D_8009D391 != 2) && (D_8009D392 != 2) && (D_8009D393 != 2)) { if ((*D_8009D391 == 8) || (D_8009D392 == 8) || (D_8009D393 == 8)) { @@ -2512,59 +2514,59 @@ void func_800B832C(void) { } // type? -void func_800B8488(FieldScriptHeader* fieldScripts) { +void WmDialogsInit(FieldScriptHeader* fieldScripts) { D_8008326C[0] = 0xFF; g_CurrentEntity = 0xFF; g_FieldScripts = fieldScripts; fieldScripts->stringOffset = 8; - func_800B8760(); + WmDialog0ResetAndPointerInit(); g_pFieldState = &g_FieldState; } -void func_800B84D8(u8 arg0) { +void WmDialogSetMessageToShowForId0(u8 arg0) { if (g_WindowData[0].state == WSTATE_INIT) { D_8011628C = 0; D_80116288 = 0; - func_800B8D4C(0, arg0); + WmDialogSetMessageToShow(0, arg0); } } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B851C); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmDialogSetAskToShowForId0); -static s32 func_800B857C(void) { return g_WindowData[0].state != WSTATE_INIT; } +static s32 WmDialogIsWindowWithId0Showing(void) { return g_WindowData[0].state != WSTATE_INIT; } -s32 func_800B858C(void) { +s32 WmDialogSetWindowWithId0ToClose(void) { if ((g_WindowData[0].state != WSTATE_INIT) && (g_WindowData[0].state != WSTATE_CLOSING)) { - func_800B89C4(0); + WmDialogSetWindowToCloseIfPossible(0); } return g_WindowData[0].state != WSTATE_INIT; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B85D4); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmDialogUpdate); extern s16 D_80116290; -s16 func_800B86C4(void) { return g_WindowData[0].state == WSTATE_INIT ? D_80116290 : -1; } +s16 WmDialogGetAskResult(void) { return g_WindowData[0].state == WSTATE_INIT ? D_80116290 : -1; } -void func_800B86E8(SVECTOR* arg0) { +void WmDialogSetPosAndSizeForId0(SVECTOR* arg0) { if (arg0 != NULL) { - func_800B8B00(0, arg0->vx, arg0->vy, arg0->vz, arg0->pad); + WmDialogSetPosAndSize(0, arg0->vx, arg0->vy, arg0->vz, arg0->pad); } } -void func_800B8720(s16 arg0, s16 arg1) { func_800B8A5C(0, arg0, arg1); } +void WmDialogSetModeAndPermanencyForId0(s16 arg0, s16 arg1) { WmDialogSetModeAndPermanency(0, arg0, arg1); } -static void func_800B8750(const char* str, s32 val, s32 kind) {} +static void WmDialogPrintParam(const char* str, s32 val, s32 kind) {} -static void func_800B8758(const char* errmsg) {} +static void WmDialogPrintNoParam(const char* errmsg) {} -void func_800B8760(void) { +void WmDialog0ResetAndPointerInit(void) { s32 i; g_WindowCount = 0; for (i = 0; i < 1; i++) { - func_800B87D8(i); + WmDialogReset(i); } if (g_FieldScripts->stringOffset != 0) { D_80116298 = (u8*)g_FieldScripts + g_FieldScripts->stringOffset; @@ -2573,7 +2575,7 @@ void func_800B8760(void) { } } -void func_800B87D8(s16 window) { +void WmDialogReset(s16 window) { s32 i; if (window == 1) { @@ -2604,11 +2606,11 @@ void func_800B87D8(s16 window) { D_801163D0[window] = 0; if (g_DebugLevel & 3) { - func_800B8750("mes reset=", window, 1); + WmDialogPrintParam("mes reset=", window, 1); } } -s32 func_800B89C4(s16 window) { +s32 WmDialogSetWindowToCloseIfPossible(s16 window) { switch (g_WindowData[window].state) { case WSTATE_SHOW: return 0; @@ -2623,12 +2625,12 @@ s32 func_800B89C4(s16 window) { return 1; } -void func_800B8A5C(s16 window, s8 style, s16 preventClose) { +void WmDialogSetModeAndPermanency(s16 window, s8 style, s16 preventClose) { g_WindowData[window].style = style; g_WindowData[window].preventClose = preventClose; } -void func_800B8A98(void) { +void WmDialogsReset(void) { s32 i; for (i = 0; i < 1; i++) { @@ -2640,28 +2642,28 @@ void func_800B8A98(void) { g_WindowCount = 0; } -void func_800B8B00(s16 window, s16 x, s16 y, s16 width, s16 height) { +void WmDialogSetPosAndSize(s16 window, s16 x, s16 y, s16 width, s16 height) { if (x < 8) { if (g_DebugLevel & 3) { - func_800B8750("win limit x=", x, 2); + WmDialogPrintParam("win limit x=", x, 2); } x = 8; } if (x + width > 312) { if (g_DebugLevel & 3) { - func_800B8750("win limit x=", x + width, 3); + WmDialogPrintParam("win limit x=", x + width, 3); } x = 312 - width; } if (y < 8) { if (g_DebugLevel & 3) { - func_800B8750("win limit y=", y, 2); + WmDialogPrintParam("win limit y=", y, 2); } y = 8; } if (y + height > 224) { if (g_DebugLevel & 3) { - func_800B8750("win limit y=", y + height, 3); + WmDialogPrintParam("win limit y=", y + height, 3); } y = 224 - height; } @@ -2672,31 +2674,31 @@ void func_800B8B00(s16 window, s16 x, s16 y, s16 width, s16 height) { g_WindowData[window].height = height; } -void func_800B8CBC(s16 window, s16 dx, s16 dy) { +void WmDialogAddPos(s16 window, s16 dx, s16 dy) { g_WindowData[window].x += dx; g_WindowData[window].y += dy; } -void func_800B8D20(s16 window, s16 height) { g_WindowData[window].height = height; } +void WmDialogSetHeight(s16 window, s16 height) { g_WindowData[window].height = height; } -s32 func_800B8D4C(u8 window, u8 message) { +s32 WmDialogSetMessageToShow(u8 window, u8 message) { switch (g_WindowData[window].state) { case WSTATE_INIT: - if (func_800B962C(window, message)) { + if (WmDialogInitWindow(window, message)) { return 1; } break; case WSTATE_SHOW: - func_800B98F0(window); + WmDialogInscreaseWindow(window); break; case WSTATE_TXT: - func_800B9B2C(window); + WmDialogStringOutput(window); break; case WSTATE_SCROLL_ROW: - func_800BA938(window); + WmDialogTextScrollByRow(window); break; case WSTATE_SCROLL_TXT_WHILE_OK: - func_800BAA00(window); + WmDialogTextScrollDuringOk(window); break; case WSTATE_PAUSE_TXT_UNTIL_OK: if (g_pFieldState->pressedKeys & PADRright) { @@ -2722,12 +2724,12 @@ s32 func_800B8D4C(u8 window, u8 message) { case WSTATE_TXT_DONE: if (!(g_WindowData[window].preventClose & 1) && (g_pFieldState->pressedKeys & PADRright)) { g_WindowData[window].state = WSTATE_CLOSING; - func_800BAC70(window); + WmDialogDiscreaseWindow(window); } break; case WSTATE_WAIT_NEXT_WINDOW: if (g_pFieldState->pressedKeys & PADRright) { - func_800BAB60(window); + WmDialogStartText(window); } break; case WSTATE_PAUSE_TXT_SCROLL_UNTIL_OK: @@ -2738,11 +2740,11 @@ s32 func_800B8D4C(u8 window, u8 message) { } break; case WSTATE_INIT_NEXT: - func_800BAB60(window); + WmDialogStartText(window); break; case WSTATE_UNK5: case WSTATE_CLOSING: - if (func_800BAC70(window)) { + if (WmDialogDiscreaseWindow(window)) { return 1; } break; @@ -2751,24 +2753,24 @@ s32 func_800B8D4C(u8 window, u8 message) { return 0; } -s32 func_800B90C0(u8 window, u8 message, u8 first, u8 last, s16* selectedLine) { +s32 WmDialogSetAskToShow(u8 window, u8 message, u8 first, u8 last, s16* selectedLine) { switch (g_WindowData[window].state) { case WSTATE_INIT: - if (func_800B962C(window, message)) { + if (WmDialogInitWindow(window, message)) { return 1; } break; case WSTATE_SHOW: - func_800B98F0(window); + WmDialogInscreaseWindow(window); break; case WSTATE_TXT: - func_800B9B2C(window); + WmDialogStringOutput(window); break; case WSTATE_SCROLL_ROW: - func_800BA938(window); + WmDialogTextScrollByRow(window); break; case WSTATE_SCROLL_TXT_WHILE_OK: - func_800BAA00(window); + WmDialogTextScrollDuringOk(window); break; case WSTATE_PAUSE_TXT_UNTIL_OK: if (g_pFieldState->pressedKeys & PADRright) { @@ -2797,13 +2799,13 @@ s32 func_800B90C0(u8 window, u8 message, u8 first, u8 last, s16* selectedLine) { if (g_pFieldState->pressedKeysRaw & PADLup) { if (first < *selectedLine) { - func_800B95E8(); + WmDialogPlaySound(); } (*selectedLine)--; } if (g_pFieldState->pressedKeysRaw & PADLdown) { if (*selectedLine < last) { - func_800B95E8(); + WmDialogPlaySound(); } (*selectedLine)++; } @@ -2818,15 +2820,15 @@ s32 func_800B90C0(u8 window, u8 message, u8 first, u8 last, s16* selectedLine) { g_WindowData[window].pointerY = *selectedLine * 16 + 6; if (g_pFieldState->pressedKeys & PADRright) { - func_800B95E8(); + WmDialogPlaySound(); g_WindowData[window].state = WSTATE_CLOSING; - func_800BAC70(window); + WmDialogDiscreaseWindow(window); } } break; case WSTATE_WAIT_NEXT_WINDOW: if (g_pFieldState->pressedKeys & PADRright) { - func_800BAB60(window); + WmDialogStartText(window); } break; case WSTATE_PAUSE_TXT_SCROLL_UNTIL_OK: @@ -2837,11 +2839,11 @@ s32 func_800B90C0(u8 window, u8 message, u8 first, u8 last, s16* selectedLine) { } break; case WSTATE_INIT_NEXT: - func_800BAB60(window); + WmDialogStartText(window); break; case WSTATE_UNK5: case WSTATE_CLOSING: - if (func_800BAC70(window)) { + if (WmDialogDiscreaseWindow(window)) { g_WindowData[window].pointerEnabled = 0; return 1; } @@ -2852,22 +2854,22 @@ s32 func_800B90C0(u8 window, u8 message, u8 first, u8 last, s16* selectedLine) { return 0; } -void func_800B95E8(void) { +void WmDialogPlaySound(void) { *D_8009A000 = 0x30; *D_8009A004 = 1; *D_8009A008 = 0x40; SystemAkaoExecute(); } -s32 func_800B962C(s16 window, s16 stringId) { +s32 WmDialogInitWindow(s16 window, s16 stringId) { if (D_80116298 == NULL) { - func_800B8758("No mes data!"); + WmDialogPrintNoParam("No mes data!"); return 1; } if (g_WindowToEntity[window] != 0xFF) { if (g_DebugLevel & 3) { - func_800B8750("mes busy=", window, 1); + WmDialogPrintParam("mes busy=", window, 1); } return 0; } @@ -2905,10 +2907,10 @@ s32 func_800B962C(s16 window, s16 stringId) { return 0; } -void func_800B98F0(s16 window) { +void WmDialogInscreaseWindow(s16 window) { if (g_WindowToEntity[window] != g_CurrentEntity) { if (g_DebugLevel & 3) { - func_800B8750("mes busy=", window, 1); + WmDialogPrintParam("mes busy=", window, 1); } return; } @@ -2935,7 +2937,7 @@ void func_800B98F0(s16 window) { } } -void func_800B9B2C(s16 window) { +void WmDialogStringOutput(s16 window) { u8 opcode; u16 len; s16 i; @@ -2946,7 +2948,7 @@ void func_800B9B2C(s16 window) { if (g_WindowToEntity[window] != g_CurrentEntity) { if (g_DebugLevel & 3) { - func_800B8750("mes busy=", window, 1); + WmDialogPrintParam("mes busy=", window, 1); } return; } @@ -3118,21 +3120,21 @@ void func_800B9B2C(s16 window) { // First iteration. Fetch and convert the value. value = func_800BAE60(window); if (g_DebugLevel & 3) { - func_800B8750("mpara=", value, 4); + WmDialogPrintParam("mpara=", value, 4); } opcode = D_801162B0[window][1]; switch (opcode) { // Integer to decimal string. case 0xDE: - func_800BB350(value, D_801163C8[window]); + WmDialogAddDigitWithoutLeadingSpace(value, D_801163C8[window]); break; // Integer to decimal string with space fill. case 0xE1: - func_800BB450(value, D_801163C8[window]); + WmDialogAddDigitWithLeadingSpace(value, D_801163C8[window]); break; // Integer to hexadecimal string. case 0xDF: - func_800BB568(value, D_801163C8[window]); + WmDialogAddHexDigitWithoutLeadingSpace(value, D_801163C8[window]); break; } D_801163C4[window]++; @@ -3161,9 +3163,9 @@ void func_800B9B2C(s16 window) { len = D_801162B0[window][4]; len |= D_801162B0[window][5] << 8; if (g_DebugLevel & 3) { - func_800B8750("gstr=", value, 4); + WmDialogPrintParam("gstr=", value, 4); if (g_DebugLevel & 3) { - func_800B8750("glen=", len, 4); + WmDialogPrintParam("glen=", len, 4); } } for (i = 0; i < len; i++) { @@ -3249,10 +3251,10 @@ void func_800B9B2C(s16 window) { D_801162B4[window][g_WindowData[window].stringByteLength] = 0xFF; } -void func_800BA938(s16 window) { +void WmDialogTextScrollByRow(s16 window) { if (g_WindowToEntity[window] != g_CurrentEntity) { if (g_DebugLevel & 3) { - func_800B8750("mes busy=", window, 1); + WmDialogPrintParam("mes busy=", window, 1); } return; } @@ -3264,10 +3266,10 @@ void func_800BA938(s16 window) { } } -void func_800BAA00(s16 window) { +void WmDialogTextScrollDuringOk(s16 window) { if (g_WindowToEntity[window] != g_CurrentEntity) { if (g_DebugLevel & 3) { - func_800B8750("mes busy=", window, 1); + WmDialogPrintParam("mes busy=", window, 1); } return; } @@ -3290,10 +3292,10 @@ void func_800BAA00(s16 window) { } } -void func_800BAB60(s16 window) { +void WmDialogStartText(s16 window) { if (g_WindowToEntity[window] != g_CurrentEntity) { if (g_DebugLevel & 3) { - func_800B8750("mes busy=", window, 1); + WmDialogPrintParam("mes busy=", window, 1); } return; } @@ -3308,10 +3310,10 @@ void func_800BAB60(s16 window) { D_8011629C[window] = 1; } -s32 func_800BAC70(s16 window) { +s32 WmDialogDiscreaseWindow(s16 window) { if (g_WindowToEntity[window] != g_CurrentEntity) { if (g_DebugLevel & 3) { - func_800B8750("mes busy=", window, 1); + WmDialogPrintParam("mes busy=", window, 1); } return 1; } @@ -3408,7 +3410,7 @@ u16 func_800BAE60(s16 window) { return value; } -void func_800BB350(u16 value, u8* dst) { +void WmDialogAddDigitWithoutLeadingSpace(u16 value, u8* dst) { u32 foundDigit; s16 i; s16 divisor; @@ -3431,7 +3433,7 @@ void func_800BB350(u16 value, u8* dst) { dst[i + 1] = 0xFF; } -void func_800BB450(u16 value, u8* dst) { +void WmDialogAddDigitWithLeadingSpace(u16 value, u8* dst) { s32 foundDigit; s16 i; s16 divisor; @@ -3457,7 +3459,7 @@ void func_800BB450(u16 value, u8* dst) { dst[i + 1] = 0xFF; } -void func_800BB568(u16 value, u8* dst) { +void WmDialogAddHexDigitWithoutLeadingSpace(u16 value, u8* dst) { u32 foundDigit; s16 i; s16 divisor; @@ -3488,7 +3490,7 @@ s32 func_800BB650(s16 stringId) { u8 value; if (D_80116298 == NULL) { - func_800B8758("No mes data!"); + WmDialogPrintNoParam("No mes data!"); return 0; } @@ -3547,13 +3549,13 @@ s32 func_800BB650(s16 stringId) { return 1; } -void func_800BB7DC(s16 battleCharId, s16 stringId) { +void WmDialogCopyStringIntoCharName(s16 battleCharId, s16 stringId) { u8* newName; s16 len; u8* charName; if (D_80116298 == NULL) { - func_800B8758("No mes data!"); + WmDialogPrintNoParam("No mes data!"); return; } @@ -3581,9 +3583,9 @@ void func_800BB8B0(void) { D_801163DC = 0; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800BB8E8); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmMovePcEntityByDistance); -void func_800BB9A0(u8 arg0) { +void WmScriptPushToStoreStack(u8 arg0) { s8* temp_v1; temp_v1 = D_801163E8; @@ -3593,7 +3595,7 @@ void func_800BB9A0(u8 arg0) { } } -u8 func_800BB9D0(void) { +u8 WmScriptPopFromStoreStack(void) { if (&D_801163E0 >= D_801163E8) return 0; @@ -3601,7 +3603,7 @@ u8 func_800BB9D0(void) { return D_801163E8[0]; } -u8 func_800BBA0C(void) { +u8 WmScriptGetTopFromStoreStack(void) { u8 var_a0; var_a0 = 0; @@ -3611,9 +3613,9 @@ u8 func_800BBA0C(void) { return var_a0; } -static void func_800BBA34(s8 arg0) { D_801163E0 = arg0; } +static void WmScriptSetFirstToStoreStack(s8 arg0) { D_801163E0 = arg0; } -s32 func_800BBA44(void) { return &D_801163E0 < D_801163E8; } +s32 WmScriptIsDataInStoreStack(void) { return &D_801163E0 < D_801163E8; } static void func_800BBA5C(void) { VECTOR sp10; @@ -3628,7 +3630,7 @@ static void func_800BBA5C(void) { if (func_800A99BC()) { WmGetPosFromActiveEntity(&sp10); func_800A6994(&sp10, WmGetModelIdFromActiveEntity() == 3 ? -1 : 1); - func_800BB9A0(WmGetModelIdFromPcEntity()); + WmScriptPushToStoreStack(WmGetModelIdFromPcEntity()); if (func_800A929C()) { WmLinkPcToActiveEntity(); func_800B63F0(2); @@ -3753,9 +3755,9 @@ void func_800BBD20(s32 arg0) { WmScriptDisableForPcEntity(1); if (func_800A929C() != 0) { - temp_v0 = func_800AE47C(&sp20, &sp10) - 0x400; + temp_v0 = WmGetRotFromEntityToEntity(&sp20, &sp10) - 0x400; WmSetActiveEntityDirectionAndRot(temp_v0); - func_800BB9D0(); + WmScriptPopFromStoreStack(); func_800A8E50(); if (temp_s1 < 0x29) WmSetActiveEntityAsPcEntity(); @@ -3767,15 +3769,15 @@ void func_800BBD20(s32 arg0) { if (temp_s1 == 4) func_800A82DC(); else if (temp_s1 >= 0x29) { - WmSetActiveEntityWithModelId(func_800B79B8()); + WmSetActiveEntityWithModelId(WmGetPcCharModelIdFromParty()); WmSetActiveEntityAsPcEntity(); } func_800ADC3C(&sp10); } else { WmInsertInEntityStructList(); - temp_s0 = func_800BB9D0() & 0xFF; + temp_s0 = WmScriptPopFromStoreStack() & 0xFF; if (func_800A92F8(temp_s0) != 0) { - WmInitActiveEntityStruct(func_800BBA0C() & 0xFF); + WmInitActiveEntityStruct(WmScriptGetTopFromStoreStack() & 0xFF); WmSetActiveEntityAsPcEntity(); WmInsertInEntityStructList(); WmInitActiveEntityStruct(temp_s0); @@ -3804,7 +3806,8 @@ void func_800BBD20(s32 arg0) { if ((WmGetModelIdFromPcEntity() == 3) || (WmGetModelIdFromPcEntity() == 4)) WmScriptDisableForPcEntity(0); - if ((temp_s2 != 0) || ((WmGetModelIdFromPcEntity() == 5) && (WmIsPcEntityPosNeedRecalculation() != 0))) + if ((temp_s2 != 0) || + ((WmGetModelIdFromPcEntity() == 5) && (WmIsPcEntityPosNeedRecalculation() != 0))) func_800A368C(1); } } @@ -3821,17 +3824,17 @@ static s32 func_800BC1AC(void) { return D_801163D4; } static void func_800BC1BC(s32 arg0) { D_801163EC = arg0; } -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800BC1CC); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmUiMapCreate); -INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800BC420); +INCLUDE_ASM("asm/us/world/nonmatchings/world", WmUiMapUpdate); -void func_800BC9E8(s16 arg0) { +void WmSetCamMode(s16 arg0) { D_801164F8 = arg0; if (WmGetModelIdFromPcEntity() != 3) D_801164FC = D_801164F8; } -s16 func_800BCA38(void) { return D_801164F8; } +s16 WmGetCamMode(void) { return D_801164F8; } void func_800BCA48(void) { if (D_801164F8 == 1) diff --git a/src/world/world.h b/src/world/world.h index 8618ed01..122fcb73 100644 --- a/src/world/world.h +++ b/src/world/world.h @@ -163,8 +163,8 @@ s32 WmScriptOpcode200Handle(u16); s32 WmScriptOpcode300Handle(u16); void WmScriptRunOne(WorldActor*); void func_800AD970(WorldActor*); -void func_800ADD4C(s16); -s16 func_800AE180(s32, s32, s32); +void WmRemoveMutexPriority(s16); +s16 WmGetRotFromVector(s32, s32, s32); void func_800B0D98(WorldChunkHeader*); void func_800B1C80(WorldChunkHeader*); void func_800B5274(); @@ -175,15 +175,15 @@ void func_800B65E0(s32); void func_800B6B28(s16); void func_800B6E08(); s32 func_800B7200(); -void func_800B7714(s32); +void WmSetFieldToLoad(s32); void func_800B77A8(s32); -s32 func_800B79B8(); +s32 WmGetPcCharModelIdFromParty(); static void func_800B7C44(void); s32 func_800B7C7C(); void func_800B7838(); -s16 func_800B86C4(); -void func_800B8760(); -void func_800BB9A0(u8); +s16 WmDialogGetAskResult(); +void WmDialog0ResetAndPointerInit(); +void WmScriptPushToStoreStack(u8); static void func_800BBA5C(void); s32 func_800BBBB0(void); static void func_800BBD0C(void); diff --git a/src/world/world2.c b/src/world/world2.c index 60f230b9..0ab58664 100644 --- a/src/world/world2.c +++ b/src/world/world2.c @@ -1,41 +1,41 @@ #include "world.h" -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800BFBF0); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmLoadModelPacketAndScale); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800BFCAC); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmCreatePacketForModelPart); INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C02F4); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C0808); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmLoadTexturesToVram); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C08A8); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmUpdateModelPacket2); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C0B48); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmUpdatePacketForModelPartWithoutMatrixes); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C1490); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmCalculateBoneMatrixes); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C1D58); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmScaleModelAll); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C1FD8); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmScaleModelVertexes); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C2130); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmScaleModelAnimations); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C2450); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmApplyModelLightingToPacket); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C2524); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmApplyPolyLightingToPacket); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C31F0); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmCalculateModelLighting); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C3948); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmCalculatePartLighting); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C3DB0); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmUpdatePartTransparency); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C4148); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmUpdateModelPacket); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C4FB4); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmUpdatePacketForModelPartWithMatrixes); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C5CD4); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmUpdateModelLighting); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C6104); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmUpdatePartLighting); -INCLUDE_ASM("asm/us/world/nonmatchings/world2", func_800C6598); +INCLUDE_ASM("asm/us/world/nonmatchings/world2", WmGetModelTotalRenderPacketSize);