From 8894215a4bcc56d13efe717b4dfc5a0eb9ed1e70 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Sun, 28 Jan 2024 23:36:40 +0000 Subject: [PATCH] Add/adjust some 2S2H comments (#116) --- mm/2s2h/DeveloperTools/BetterMapSelect.c | 2 ++ mm/2s2h/z_scene_2SH.cpp | 4 +++- mm/include/tables/scene_table.h | 1 + mm/include/z64interface.h | 2 +- mm/include/z64scene.h | 1 + mm/src/code/sys_matrix.c | 2 +- mm/src/code/z_parameter.c | 1 + mm/src/code/z_scene_table.c | 2 +- mm/src/code/z_skin_matrix.c | 2 +- mm/src/code/z_sram_NES.c | 1 + 10 files changed, 13 insertions(+), 5 deletions(-) diff --git a/mm/2s2h/DeveloperTools/BetterMapSelect.c b/mm/2s2h/DeveloperTools/BetterMapSelect.c index df194a5a1..898235014 100644 --- a/mm/2s2h/DeveloperTools/BetterMapSelect.c +++ b/mm/2s2h/DeveloperTools/BetterMapSelect.c @@ -12,6 +12,7 @@ void MapSelect_LoadFileSelect(MapSelectState* mapSelectState) { SET_NEXT_GAMESTATE(&mapSelectState->state, FileSelect_Init, sizeof(FileSelectState)); } +// 2S2H Added columns to scene table: humanName #define DEFINE_SCENE(_name, _enumValue, _textId, _drawConfig, _restrictionFlags, _persistentCycleFlags, entranceSceneId, humanName) \ { humanName, MapSelect_LoadGame, ENTRANCE(entranceSceneId, 0) }, #define DEFINE_SCENE_UNSET(_enumValue) @@ -25,6 +26,7 @@ static SceneSelectEntry sBetterScenes[] = { #undef DEFINE_SCENE #undef DEFINE_SCENE_UNSET +// 2S2H Added columns to scene table: humanName #define DEFINE_SCENE(_name, enumValue, _textId, _drawConfig, _restrictionFlags, _persistentCycleFlags, entranceSceneId, humanName) \ { enumValue }, #define DEFINE_SCENE_UNSET(_enumValue) diff --git a/mm/2s2h/z_scene_2SH.cpp b/mm/2s2h/z_scene_2SH.cpp index 99ef829c9..e10710038 100644 --- a/mm/2s2h/z_scene_2SH.cpp +++ b/mm/2s2h/z_scene_2SH.cpp @@ -165,7 +165,7 @@ void Scene_CommandObjectList(PlayState* play, LUS::ISceneCommand* cmd) { s32 j; s32 k; - // #Region 2S2H [Port] Cleaner version of decomps loops for nicer presentation + // #region 2S2H [Port] Cleaner version of decomps loops for nicer presentation // Loop until a mismatch in the object lists // Then clear all object ids past that in the context object list and kill actors for those objects @@ -184,6 +184,8 @@ void Scene_CommandObjectList(PlayState* play, LUS::ISceneCommand* cmd) { play->objectCtx.slots[play->objectCtx.numEntries++].id = -objList->objects[k]; } + // #endregion + // Original Compatible Code Commented // s32 i; diff --git a/mm/include/tables/scene_table.h b/mm/include/tables/scene_table.h index f748eddc6..97dde465a 100644 --- a/mm/include/tables/scene_table.h +++ b/mm/include/tables/scene_table.h @@ -9,6 +9,7 @@ * - Argument 4: Restriction flags. See `RESTRICTIONS_SET` on z_parameter.c * - Argument 5: Persistent cycle flag set: bitwise flags which won't be turned off on a cycle reset (will persist between cycles) * - Argument 6: EntranceSceneId + * 2S2H The following columns were added to the scene table: * - Argument 7: Human readable name * * DEFINE_SCENE_UNSET is needed to define empty entries from the original game diff --git a/mm/include/z64interface.h b/mm/include/z64interface.h index abc508587..e87378cd6 100644 --- a/mm/include/z64interface.h +++ b/mm/include/z64interface.h @@ -23,7 +23,7 @@ typedef enum { } AButtonState; typedef enum { - /* -1 */ DO_ACTION_UNDEFINED = -1, // #Region [2s2h] DO_ACTION_UNDEFINED added so comparisons between the enum type and -1 would work on all systems + /* -1 */ DO_ACTION_UNDEFINED = -1, // 2S2H [Port] DO_ACTION_UNDEFINED added so comparisons between the enum type and -1 would work on all systems /* 0x00 */ DO_ACTION_ATTACK = 0, /* 0x01 */ DO_ACTION_CHECK, /* 0x02 */ DO_ACTION_ENTER, diff --git a/mm/include/z64scene.h b/mm/include/z64scene.h index 462edfd24..5248ce4cb 100644 --- a/mm/include/z64scene.h +++ b/mm/include/z64scene.h @@ -620,6 +620,7 @@ typedef enum { /* 6 */ TINGLE_MAP_MAX } TingleMapId; +// 2S2H Added columns to scene table: humanName #define DEFINE_SCENE(_name, enumValue, _textId, _drawConfig, _restrictionFlags, _persistentCycleFlags, _entranceSceneId, _humanName) enumValue, #define DEFINE_SCENE_UNSET(enumValue) enumValue, diff --git a/mm/src/code/sys_matrix.c b/mm/src/code/sys_matrix.c index 1521e21d5..a00e6c341 100644 --- a/mm/src/code/sys_matrix.c +++ b/mm/src/code/sys_matrix.c @@ -1183,7 +1183,7 @@ void Matrix_SetTranslateRotateYXZ(f32 x, f32 y, f32 z, Vec3s* rot) { */ Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) { FrameInterpolation_RecordMatrixMtxFToMtx(src, dest); - // #Region 2S2H [Port] For compatibility with modern systems this has been changed to use guMtxF2L + // 2S2H [Port] For compatibility with modern systems this has been changed to use guMtxF2L guMtxF2L(src, dest); return dest; } diff --git a/mm/src/code/z_parameter.c b/mm/src/code/z_parameter.c index a3d2a872e..25aab35c3 100644 --- a/mm/src/code/z_parameter.c +++ b/mm/src/code/z_parameter.c @@ -127,6 +127,7 @@ Input sPostmanTimerInput[MAXCONTROLLERS]; #define RESTRICTIONS_MOON RESTRICTIONS_SET(0, 0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0) #define RESTRICTIONS_NO_DOUBLE_TIME RESTRICTIONS_SET(0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0) +// 2S2H Added columns to scene table: humanName #define DEFINE_SCENE(_name, enumValue, _textId, _drawConfig, restrictionFlags, _persistentCycleFlags, _entranceSceneId, _humanName) \ { enumValue, restrictionFlags }, diff --git a/mm/src/code/z_scene_table.c b/mm/src/code/z_scene_table.c index 0d37621df..17c0bb66b 100644 --- a/mm/src/code/z_scene_table.c +++ b/mm/src/code/z_scene_table.c @@ -12,7 +12,7 @@ #undef DEFINE_SCENE_UNSET #endif - +// 2S2H Added columns to scene table: humanName #define DEFINE_SCENE(name, _enumValue, textId, drawConfig, _restrictionFlags, _persistentCycleFlags, _entranceSceneId, _humanName) \ { { 0, 0, #name }, textId, 0, drawConfig, 0, 0 }, diff --git a/mm/src/code/z_skin_matrix.c b/mm/src/code/z_skin_matrix.c index f24697708..1845286b2 100644 --- a/mm/src/code/z_skin_matrix.c +++ b/mm/src/code/z_skin_matrix.c @@ -507,8 +507,8 @@ void SkinMatrix_Vec3sToVec3f(Vec3s* src, Vec3f* dest) { } void SkinMatrix_MtxFToMtx(MtxF* src, Mtx* dest) { - // #Region 2S2H [Port] For compatibility with modern systems this has been changed to use guMtxF2L FrameInterpolation_RecordSkinMatrixMtxFToMtx(src, dest); + // 2S2H [Port] For compatibility with modern systems this has been changed to use guMtxF2L guMtxF2L(src, dest); } diff --git a/mm/src/code/z_sram_NES.c b/mm/src/code/z_sram_NES.c index ec24524a5..ca35153e0 100644 --- a/mm/src/code/z_sram_NES.c +++ b/mm/src/code/z_sram_NES.c @@ -22,6 +22,7 @@ typedef struct PersistentCycleSceneFlags { #define PERSISTENT_CYCLE_FLAGS_SET(switch0, switch1, chest, collectible) { switch0, switch1, chest, collectible }, #define PERSISTENT_CYCLE_FLAGS_NONE PERSISTENT_CYCLE_FLAGS_SET(0, 0, 0, 0) +// 2S2H Added columns to scene table: humanName #define DEFINE_SCENE(_name, _enumValue, _textId, _drawConfig, _restrictionFlags, persistentCycleFlags, _entranceSceneId, _humanName) \ persistentCycleFlags #define DEFINE_SCENE_UNSET(_enumValue) PERSISTENT_CYCLE_FLAGS_NONE