From bf85d9f9d5de33c3168625b0f1687e2c8293fd0c Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Sat, 26 Apr 2025 23:29:21 -0400 Subject: [PATCH] Lay some groundwork for more documentation, fix compilation error, put backgrounds into enum --- autogen/lua_definitions/constants.lua | 54 ++++++++++++--------------- autogen/lua_definitions/functions.lua | 10 ++++- docs/lua/constants.md | 27 ++++++++------ docs/lua/functions-4.md | 18 +++++++++ docs/lua/functions-6.md | 6 +-- docs/lua/functions.md | 6 +-- include/geo_commands.h | 24 ++++++------ levels/rr/areas/1/13/geo.inc.c | 2 +- levels/rr/areas/1/18/geo.inc.c | 2 +- levels/rr/areas/1/19/geo.inc.c | 2 +- levels/rr/areas/1/20/geo.inc.c | 2 +- levels/thi/areas/1/geo.inc.c | 2 +- src/game/area.c | 2 +- src/game/area.h | 2 +- src/game/level_update.c | 2 +- src/game/mario_actions_moving.c | 9 ++--- src/game/mario_actions_object.c | 13 ++++++- src/game/mario_actions_stationary.c | 8 ++++ src/pc/crash_handler.c | 1 + src/pc/crash_handler.h | 2 +- src/pc/lua/utils/smlua_gfx_utils.c | 2 +- src/pc/lua/utils/smlua_gfx_utils.h | 3 +- 22 files changed, 121 insertions(+), 78 deletions(-) diff --git a/autogen/lua_definitions/constants.lua b/autogen/lua_definitions/constants.lua index e2bd806b2..5af5f7745 100644 --- a/autogen/lua_definitions/constants.lua +++ b/autogen/lua_definitions/constants.lua @@ -2721,38 +2721,30 @@ G_TEXRECTFLIP = 0xe5 --- @type integer G_TEXRECT = 0xe4 ---- @type integer -BACKGROUND_OCEAN_SKY = 0 +BACKGROUND_OCEAN_SKY = 0 --- @type SkyBackgroundParams +BACKGROUND_FLAMING_SKY = 1 --- @type SkyBackgroundParams +BACKGROUND_UNDERWATER_CITY = 2 --- @type SkyBackgroundParams +BACKGROUND_BELOW_CLOUDS = 3 --- @type SkyBackgroundParams +BACKGROUND_SNOW_MOUNTAINS = 4 --- @type SkyBackgroundParams +BACKGROUND_DESERT = 5 --- @type SkyBackgroundParams +BACKGROUND_HAUNTED = 6 --- @type SkyBackgroundParams +BACKGROUND_GREEN_SKY = 7 --- @type SkyBackgroundParams +BACKGROUND_ABOVE_CLOUDS = 8 --- @type SkyBackgroundParams +BACKGROUND_PURPLE_SKY = 9 --- @type SkyBackgroundParams +BACKGROUND_CUSTOM = 10 --- @type SkyBackgroundParams ---- @type integer -BACKGROUND_FLAMING_SKY = 1 - ---- @type integer -BACKGROUND_UNDERWATER_CITY = 2 - ---- @type integer -BACKGROUND_BELOW_CLOUDS = 3 - ---- @type integer -BACKGROUND_SNOW_MOUNTAINS = 4 - ---- @type integer -BACKGROUND_DESERT = 5 - ---- @type integer -BACKGROUND_HAUNTED = 6 - ---- @type integer -BACKGROUND_GREEN_SKY = 7 - ---- @type integer -BACKGROUND_ABOVE_CLOUDS = 8 - ---- @type integer -BACKGROUND_PURPLE_SKY = 9 - ---- @type integer -BACKGROUND_CUSTOM = 10 +--- @alias SkyBackgroundParams +--- | `BACKGROUND_OCEAN_SKY` +--- | `BACKGROUND_FLAMING_SKY` +--- | `BACKGROUND_UNDERWATER_CITY` +--- | `BACKGROUND_BELOW_CLOUDS` +--- | `BACKGROUND_SNOW_MOUNTAINS` +--- | `BACKGROUND_DESERT` +--- | `BACKGROUND_HAUNTED` +--- | `BACKGROUND_GREEN_SKY` +--- | `BACKGROUND_ABOVE_CLOUDS` +--- | `BACKGROUND_PURPLE_SKY` +--- | `BACKGROUND_CUSTOM` --- @type integer GRAPH_RENDER_ACTIVE = (1 << 0) diff --git a/autogen/lua_definitions/functions.lua b/autogen/lua_definitions/functions.lua index 2a95f7906..1c726fe8a 100644 --- a/autogen/lua_definitions/functions.lua +++ b/autogen/lua_definitions/functions.lua @@ -1,7 +1,7 @@ -- AUTOGENERATED FOR CODE EDITORS -- --- @param o Object ---- @return MarioSpawnType +--- @return integer --- Derives a `MARIO_SPAWN_*` constant from `o` function get_mario_spawn_type(o) -- ... @@ -5945,6 +5945,7 @@ end --- @param airAction integer --- @param animation integer --- @return integer +--- Builds on `common_slide_action` by also allowing Mario to jump out of a slide if A is pressed after a short delay. If the sliding slows enough, Mario transitions to a specified stopping action function common_slide_action_with_jump(m, stopAction, jumpAction, airAction, animation) -- ... end @@ -5985,6 +5986,7 @@ end --- @param endAction integer --- @param airAction integer --- @return integer +--- Handles a special landing in quicksand after a jump. Over several frames, Mario emerges from the quicksand. First part of the animation reduces his quicksand depth. Ends with a normal landing action or transitions back to air if he leaves the ground function quicksand_jump_land_action(m, animation1, animation2, endAction, airAction) -- ... end @@ -6006,24 +6008,28 @@ end --- @param m MarioState --- @param animation integer --- @param endAction integer +--- Performs a stationary step, sets `m`'s animation and sets action to `endAction` once the animation finishes function animated_stationary_ground_step(m, animation, endAction) -- ... end --- @param m MarioState --- @return integer +--- Updates Mario's punching state function mario_update_punch_sequence(m) -- ... end --- @param m MarioState --- @return integer +--- Checks for and handles common conditions that would cancel Mario's current object action. This includes transitioning to a water plunge if below the water level, becoming squished if appropriate, or switching to standing death action if Mario is dead function check_common_object_cancels(m) -- ... end --- @param m MarioState --- @return integer +--- Executes Mario's current object action by first checking common object cancels, then updating quicksand state. Dispatches to the appropriate action function, such as punching, throwing, picking up Bowser, etc function mario_execute_object_action(m) -- ... end @@ -9757,7 +9763,7 @@ function set_fog_intensity(intensity) -- ... end ---- @return integer +--- @return SkyBackgroundParams --- Gets the current skybox function get_skybox() -- ... diff --git a/docs/lua/constants.md b/docs/lua/constants.md index ecaff1332..99c25891d 100644 --- a/docs/lua/constants.md +++ b/docs/lua/constants.md @@ -27,6 +27,7 @@ - [first_person_cam.h](#first_person_camh) - [gbi.h](#gbih) - [geo_commands.h](#geo_commandsh) + - [enum SkyBackgroundParams](#enum-SkyBackgroundParams) - [graph_node.h](#graph_nodeh) - [interaction.c](#interactionc) - [interaction.h](#interactionh) @@ -1286,17 +1287,21 @@
## [geo_commands.h](#geo_commands.h) -- BACKGROUND_OCEAN_SKY -- BACKGROUND_FLAMING_SKY -- BACKGROUND_UNDERWATER_CITY -- BACKGROUND_BELOW_CLOUDS -- BACKGROUND_SNOW_MOUNTAINS -- BACKGROUND_DESERT -- BACKGROUND_HAUNTED -- BACKGROUND_GREEN_SKY -- BACKGROUND_ABOVE_CLOUDS -- BACKGROUND_PURPLE_SKY -- BACKGROUND_CUSTOM + +### [enum SkyBackgroundParams](#SkyBackgroundParams) +| Identifier | Value | +| :--------- | :---- | +| BACKGROUND_OCEAN_SKY | 0 | +| BACKGROUND_FLAMING_SKY | 1 | +| BACKGROUND_UNDERWATER_CITY | 2 | +| BACKGROUND_BELOW_CLOUDS | 3 | +| BACKGROUND_SNOW_MOUNTAINS | 4 | +| BACKGROUND_DESERT | 5 | +| BACKGROUND_HAUNTED | 6 | +| BACKGROUND_GREEN_SKY | 7 | +| BACKGROUND_ABOVE_CLOUDS | 8 | +| BACKGROUND_PURPLE_SKY | 9 | +| BACKGROUND_CUSTOM | 10 | [:arrow_up_small:](#) diff --git a/docs/lua/functions-4.md b/docs/lua/functions-4.md index 437360288..2d0948d0f 100644 --- a/docs/lua/functions-4.md +++ b/docs/lua/functions-4.md @@ -3052,6 +3052,9 @@ Applies shared logic for sliding-related actions while playing sliding sounds, m ## [common_slide_action_with_jump](#common_slide_action_with_jump) +### Description +Builds on `common_slide_action` by also allowing Mario to jump out of a slide if A is pressed after a short delay. If the sliding slows enough, Mario transitions to a specified stopping action + ### Lua Example `local integerValue = common_slide_action_with_jump(m, stopAction, jumpAction, airAction, animation)` @@ -3154,6 +3157,9 @@ Applies movement upon landing from a jump or fall. Adjusts velocity based on slo ## [quicksand_jump_land_action](#quicksand_jump_land_action) +### Description +Handles a special landing in quicksand after a jump. Over several frames, Mario emerges from the quicksand. First part of the animation reduces his quicksand depth. Ends with a normal landing action or transitions back to air if he leaves the ground + ### Lua Example `local integerValue = quicksand_jump_land_action(m, animation1, animation2, endAction, airAction)` @@ -3230,6 +3236,9 @@ Executes Mario's current moving actions by: checking common cancellations (e.g., ## [animated_stationary_ground_step](#animated_stationary_ground_step) +### Description +Performs a stationary step, sets `m`'s animation and sets action to `endAction` once the animation finishes + ### Lua Example `animated_stationary_ground_step(m, animation, endAction)` @@ -3252,6 +3261,9 @@ Executes Mario's current moving actions by: checking common cancellations (e.g., ## [mario_update_punch_sequence](#mario_update_punch_sequence) +### Description +Updates Mario's punching state + ### Lua Example `local integerValue = mario_update_punch_sequence(m)` @@ -3272,6 +3284,9 @@ Executes Mario's current moving actions by: checking common cancellations (e.g., ## [check_common_object_cancels](#check_common_object_cancels) +### Description +Checks for and handles common conditions that would cancel Mario's current object action. This includes transitioning to a water plunge if below the water level, becoming squished if appropriate, or switching to standing death action if Mario is dead + ### Lua Example `local integerValue = check_common_object_cancels(m)` @@ -3292,6 +3307,9 @@ Executes Mario's current moving actions by: checking common cancellations (e.g., ## [mario_execute_object_action](#mario_execute_object_action) +### Description +Executes Mario's current object action by first checking common object cancels, then updating quicksand state. Dispatches to the appropriate action function, such as punching, throwing, picking up Bowser, etc + ### Lua Example `local integerValue = mario_execute_object_action(m)` diff --git a/docs/lua/functions-6.md b/docs/lua/functions-6.md index ad3622094..4198ccaa2 100644 --- a/docs/lua/functions-6.md +++ b/docs/lua/functions-6.md @@ -1709,16 +1709,16 @@ Sets the intensity of the fog (this value scales very quickly, 1.0 to 1.1 is a d Gets the current skybox ### Lua Example -`local integerValue = get_skybox()` +`local enumValue = get_skybox()` ### Parameters - None ### Returns -- `integer` +[enum SkyBackgroundParams](constants.md#enum-SkyBackgroundParams) ### C Prototype -`s8 get_skybox(void);` +`enum SkyBackgroundParams get_skybox(void);` [:arrow_up_small:](#) diff --git a/docs/lua/functions.md b/docs/lua/functions.md index cfdf90c29..baafdc554 100644 --- a/docs/lua/functions.md +++ b/docs/lua/functions.md @@ -2634,7 +2634,7 @@ N/A Derives a `MARIO_SPAWN_*` constant from `o` ### Lua Example -`local enumValue = get_mario_spawn_type(o)` +`local integerValue = get_mario_spawn_type(o)` ### Parameters | Field | Type | @@ -2642,10 +2642,10 @@ Derives a `MARIO_SPAWN_*` constant from `o` | o | [Object](structs.md#Object) | ### Returns -[enum MarioSpawnType](constants.md#enum-MarioSpawnType) +- `integer` ### C Prototype -`enum MarioSpawnType get_mario_spawn_type(struct Object *o);` +`u32 get_mario_spawn_type(struct Object *o);` [:arrow_up_small:](#) diff --git a/include/geo_commands.h b/include/geo_commands.h index ae6392a35..602e694da 100644 --- a/include/geo_commands.h +++ b/include/geo_commands.h @@ -11,17 +11,19 @@ #include "game/mario_actions_cutscene.h" // sky background params -#define BACKGROUND_OCEAN_SKY 0 -#define BACKGROUND_FLAMING_SKY 1 -#define BACKGROUND_UNDERWATER_CITY 2 -#define BACKGROUND_BELOW_CLOUDS 3 -#define BACKGROUND_SNOW_MOUNTAINS 4 -#define BACKGROUND_DESERT 5 -#define BACKGROUND_HAUNTED 6 -#define BACKGROUND_GREEN_SKY 7 -#define BACKGROUND_ABOVE_CLOUDS 8 -#define BACKGROUND_PURPLE_SKY 9 -#define BACKGROUND_CUSTOM 10 +enum SkyBackgroundParams { + BACKGROUND_OCEAN_SKY, + BACKGROUND_FLAMING_SKY, + BACKGROUND_UNDERWATER_CITY, + BACKGROUND_BELOW_CLOUDS, + BACKGROUND_SNOW_MOUNTAINS, + BACKGROUND_DESERT, + BACKGROUND_HAUNTED, + BACKGROUND_GREEN_SKY, + BACKGROUND_ABOVE_CLOUDS, + BACKGROUND_PURPLE_SKY, + BACKGROUND_CUSTOM +}; // geo layout macros diff --git a/levels/rr/areas/1/13/geo.inc.c b/levels/rr/areas/1/13/geo.inc.c index 8f13231f0..945372c1f 100644 --- a/levels/rr/areas/1/13/geo.inc.c +++ b/levels/rr/areas/1/13/geo.inc.c @@ -2,7 +2,7 @@ const GeoLayout rr_geo_000770[] = { GEO_CULLING_RADIUS(1500), GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_TRANSPARENT, rr_seg7_dl_0700E830), + GEO_DISPLAY_LIST(LAYER_TRANSPARENT_DECAL, rr_seg7_dl_0700E830), GEO_CLOSE_NODE(), GEO_END(), }; diff --git a/levels/rr/areas/1/18/geo.inc.c b/levels/rr/areas/1/18/geo.inc.c index bd0ef7535..665738070 100644 --- a/levels/rr/areas/1/18/geo.inc.c +++ b/levels/rr/areas/1/18/geo.inc.c @@ -2,7 +2,7 @@ const GeoLayout rr_geo_0007E8[] = { GEO_CULLING_RADIUS(2500), GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_TRANSPARENT, rr_seg7_dl_07015C68), + GEO_DISPLAY_LIST(LAYER_TRANSPARENT_DECAL, rr_seg7_dl_07015C68), GEO_CLOSE_NODE(), GEO_END(), }; diff --git a/levels/rr/areas/1/19/geo.inc.c b/levels/rr/areas/1/19/geo.inc.c index adafe1816..de1d5f44f 100644 --- a/levels/rr/areas/1/19/geo.inc.c +++ b/levels/rr/areas/1/19/geo.inc.c @@ -2,7 +2,7 @@ const GeoLayout rr_geo_000800[] = { GEO_CULLING_RADIUS(4500), GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_TRANSPARENT, rr_seg7_dl_07017530), + GEO_DISPLAY_LIST(LAYER_TRANSPARENT_DECAL, rr_seg7_dl_07017530), GEO_CLOSE_NODE(), GEO_END(), }; diff --git a/levels/rr/areas/1/20/geo.inc.c b/levels/rr/areas/1/20/geo.inc.c index e733ef1ac..a7de13979 100644 --- a/levels/rr/areas/1/20/geo.inc.c +++ b/levels/rr/areas/1/20/geo.inc.c @@ -2,7 +2,7 @@ const GeoLayout rr_geo_000818[] = { GEO_CULLING_RADIUS(5000), GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_TRANSPARENT, rr_seg7_dl_07018B58), + GEO_DISPLAY_LIST(LAYER_TRANSPARENT_DECAL, rr_seg7_dl_07018B58), GEO_CLOSE_NODE(), GEO_END(), }; diff --git a/levels/thi/areas/1/geo.inc.c b/levels/thi/areas/1/geo.inc.c index d08e130b0..2ab400656 100644 --- a/levels/thi/areas/1/geo.inc.c +++ b/levels/thi/areas/1/geo.inc.c @@ -18,7 +18,7 @@ const GeoLayout thi_geo_000608[] = { GEO_DISPLAY_LIST(LAYER_OPAQUE, thi_seg7_dl_07005260), GEO_DISPLAY_LIST(LAYER_OPAQUE, thi_seg7_dl_07006968), GEO_DISPLAY_LIST(LAYER_ALPHA, thi_seg7_dl_07007008), - GEO_DISPLAY_LIST(LAYER_TRANSPARENT, thi_seg7_dl_070072E8), + GEO_DISPLAY_LIST(LAYER_TRANSPARENT_DECAL, thi_seg7_dl_070072E8), GEO_DISPLAY_LIST(LAYER_TRANSPARENT_DECAL, thi_seg7_dl_070073C0), GEO_ASM( 0, geo_movtex_pause_control), GEO_ASM(0x1301, geo_movtex_draw_water_regions), diff --git a/src/game/area.c b/src/game/area.c index 095ea1603..7a8922029 100644 --- a/src/game/area.c +++ b/src/game/area.c @@ -147,7 +147,7 @@ void print_intro_text(void) { } } -enum MarioSpawnType get_mario_spawn_type(struct Object *o) { +u32 get_mario_spawn_type(struct Object *o) { if (o == NULL || o->behavior == NULL) { return MARIO_SPAWN_NONE; } const BehaviorScript *behavior = virtual_to_segmented(0x13, o->behavior); diff --git a/src/game/area.h b/src/game/area.h index d7c4b1928..c7243b1fe 100644 --- a/src/game/area.h +++ b/src/game/area.h @@ -158,7 +158,7 @@ extern u8 gSpawnedStarHiddenCount; void override_viewport_and_clip(Vp *a, Vp *b, u8 c, u8 d, u8 e); void print_intro_text(void); /* |description|Derives a `MARIO_SPAWN_*` constant from `o`|descriptionEnd| */ -enum MarioSpawnType get_mario_spawn_type(struct Object *o); +u32 get_mario_spawn_type(struct Object *o); /* |description| Finds a warp node in the current area by its ID. The warp node must exist in the list of warp nodes for the current area. diff --git a/src/game/level_update.c b/src/game/level_update.c index 0f59b5457..e8ca64d7a 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -419,7 +419,7 @@ void init_mario_after_warp(void) { if (spawnNode == NULL || spawnNode->object == NULL) { spawnNode = area_get_any_warp_node(); } if (spawnNode == NULL || spawnNode->object == NULL) { return; } - enum MarioSpawnType marioSpawnType = get_mario_spawn_type(spawnNode->object); + u32 marioSpawnType = get_mario_spawn_type(spawnNode->object); if (gMarioState && gMarioState->action != ACT_UNINITIALIZED) { for (s32 i = 0; i < MAX_PLAYERS; i++) { diff --git a/src/game/mario_actions_moving.c b/src/game/mario_actions_moving.c index c3fe4aa19..6b159a5ad 100644 --- a/src/game/mario_actions_moving.c +++ b/src/game/mario_actions_moving.c @@ -1574,8 +1574,7 @@ void common_slide_action(struct MarioState *m, u32 endAction, u32 airAction, s32 Builds on `common_slide_action` by also allowing Mario to jump out of a slide if A is pressed after a short delay. If the sliding slows enough, Mario transitions to a specified stopping action |descriptionEnd| */ -s32 common_slide_action_with_jump(struct MarioState *m, u32 stopAction, u32 jumpAction, u32 airAction, - s32 animation) { +s32 common_slide_action_with_jump(struct MarioState *m, u32 stopAction, u32 jumpAction, u32 airAction, s32 animation) { if (!m) { return FALSE; } if (m->actionTimer == 5) { if (m->input & INPUT_A_PRESSED) { @@ -2124,10 +2123,10 @@ s32 act_backflip_land(struct MarioState *m) { } /* |description| -Handles a special landing in quicksand after a jump. Over several frames, Mario emerges from the quicksand. First part of the animation reduces his quicksand depth. Ends with a normal landing action or transitions back to air if he leaves the ground +Handles a special landing in quicksand after a jump. Over several frames, Mario emerges from the quicksand. +First part of the animation reduces his quicksand depth. Ends with a normal landing action or transitions back to air if he leaves the ground |descriptionEnd| */ -s32 quicksand_jump_land_action(struct MarioState *m, s32 animation1, s32 animation2, u32 endAction, - u32 airAction) { +s32 quicksand_jump_land_action(struct MarioState *m, s32 animation1, s32 animation2, u32 endAction, u32 airAction) { if (!m) { return FALSE; } if (m->actionTimer++ < 6) { m->quicksandDepth -= (7 - m->actionTimer) * 0.8f; diff --git a/src/game/mario_actions_object.c b/src/game/mario_actions_object.c index bfd310239..6c890ebbe 100644 --- a/src/game/mario_actions_object.c +++ b/src/game/mario_actions_object.c @@ -22,6 +22,7 @@ */ s8 sPunchingForwardVelocities[8] = { 0, 1, 1, 2, 3, 5, 7, 10 }; +/* |description|Performs a stationary step, sets `m`'s animation and sets action to `endAction` once the animation finishes|descriptionEnd| */ void animated_stationary_ground_step(struct MarioState *m, s32 animation, u32 endAction) { stationary_ground_step(m); set_character_animation(m, animation); @@ -30,6 +31,7 @@ void animated_stationary_ground_step(struct MarioState *m, s32 animation, u32 en } } +/* |description|Updates Mario's punching state|descriptionEnd| */ s32 mario_update_punch_sequence(struct MarioState *m) { if (!m) { return 0; } u32 endAction, crouchEndAction; @@ -474,11 +476,16 @@ s32 act_releasing_bowser(struct MarioState *m) { return FALSE; } +/* |description| +Checks for and handles common conditions that would cancel Mario's current object action. This includes transitioning +to a water plunge if below the water level, becoming squished if appropriate, or switching to standing death action +if Mario is dead +|descriptionEnd| */ s32 check_common_object_cancels(struct MarioState *m) { if (!m) { return 0; } if (m->playerIndex != 0) { return FALSE; } - if (m->pos[1] < m->waterLevel - 100) { + if (m->pos[1] < m->waterLevel - 100) { bool allow = true; smlua_call_event_hooks_mario_param_and_bool_ret_bool(HOOK_ALLOW_FORCE_WATER_ACTION, m, false, &allow); if (allow) { @@ -497,6 +504,10 @@ s32 check_common_object_cancels(struct MarioState *m) { return FALSE; } +/* |description| +Executes Mario's current object action by first checking common object cancels, then updating quicksand state. +Dispatches to the appropriate action function, such as punching, throwing, picking up Bowser, etc +|descriptionEnd| */ s32 mario_execute_object_action(struct MarioState *m) { if (!m) { return FALSE; } s32 cancel; diff --git a/src/game/mario_actions_stationary.c b/src/game/mario_actions_stationary.c index 393b1c083..754d05bf0 100644 --- a/src/game/mario_actions_stationary.c +++ b/src/game/mario_actions_stationary.c @@ -22,6 +22,7 @@ #include "pc/lua/smlua.h" #include "hardcoded.h" +/* |description||descriptionEnd| */ s32 check_common_idle_cancels(struct MarioState *m) { if (!m) { return 0; } mario_drop_held_object(m); @@ -65,6 +66,7 @@ s32 check_common_idle_cancels(struct MarioState *m) { return FALSE; } +/* |description||descriptionEnd| */ s32 check_common_hold_idle_cancels(struct MarioState *m) { if (!m) { return 0; } if (m->floor && m->floor->normal.y < 0.29237169f) { @@ -186,6 +188,7 @@ s32 act_idle(struct MarioState *m) { return FALSE; } +/* |description||descriptionEnd| */ void play_anim_sound(struct MarioState *m, u32 actionState, s32 animFrame, u32 sound) { if (!m) { return; } if (!m->marioObj) { return; } @@ -653,6 +656,7 @@ s32 act_hold_panting_unused(struct MarioState *m) { return FALSE; } +/* |description||descriptionEnd| */ void stopping_step(struct MarioState *m, s32 animID, u32 action) { stationary_ground_step(m); set_character_animation(m, animID); @@ -876,6 +880,7 @@ s32 act_shockwave_bounce(struct MarioState *m) { return FALSE; } +/* |description||descriptionEnd| */ s32 landing_step(struct MarioState *m, s32 arg1, u32 action) { stationary_ground_step(m); set_character_animation(m, arg1); @@ -885,6 +890,7 @@ s32 landing_step(struct MarioState *m, s32 arg1, u32 action) { return FALSE; } +/* |description||descriptionEnd| */ s32 check_common_landing_cancels(struct MarioState *m, u32 action) { if (!m) { return 0; } if (m->input & INPUT_UNKNOWN_10) { @@ -1148,6 +1154,7 @@ s32 act_first_person(struct MarioState *m) { return FALSE; } +/* |description||descriptionEnd| */ s32 check_common_stationary_cancels(struct MarioState *m) { if (!m) { return 0; } if (m->playerIndex != 0) { return FALSE; } @@ -1179,6 +1186,7 @@ s32 check_common_stationary_cancels(struct MarioState *m) { return FALSE; } +/* |description||descriptionEnd| */ s32 mario_execute_stationary_action(struct MarioState *m) { if (!m) { return FALSE; } s32 cancel; diff --git a/src/pc/crash_handler.c b/src/pc/crash_handler.c index a6adb718e..8538defed 100644 --- a/src/pc/crash_handler.c +++ b/src/pc/crash_handler.c @@ -703,6 +703,7 @@ struct PcDebug gPcDebug = { 0x9A2269E87B26BE68, 0x0E76DE227D813019, 0x12ABA8362D430002, + 0x0BF8F9C076430007, }, .id = DEFAULT_ID, .bhvOffset = /* 0x12 */ 0, diff --git a/src/pc/crash_handler.h b/src/pc/crash_handler.h index 20118252f..604f2f166 100644 --- a/src/pc/crash_handler.h +++ b/src/pc/crash_handler.h @@ -7,7 +7,7 @@ #define MIXER 0x3DCE3B097C30006 struct PcDebug { - u64 tags[16]; + u64 tags[17]; u64 id; u64 bhvOffset; s64 debugId; diff --git a/src/pc/lua/utils/smlua_gfx_utils.c b/src/pc/lua/utils/smlua_gfx_utils.c index 1740e0744..15cd31d25 100644 --- a/src/pc/lua/utils/smlua_gfx_utils.c +++ b/src/pc/lua/utils/smlua_gfx_utils.c @@ -87,7 +87,7 @@ void set_fog_intensity(f32 intensity) { /// -s8 get_skybox(void) { +enum SkyBackgroundParams get_skybox(void) { if (gOverrideBackground != -1) { return gOverrideBackground; } return gReadOnlyBackground; } diff --git a/src/pc/lua/utils/smlua_gfx_utils.h b/src/pc/lua/utils/smlua_gfx_utils.h index 4369205ae..52d80a5fb 100644 --- a/src/pc/lua/utils/smlua_gfx_utils.h +++ b/src/pc/lua/utils/smlua_gfx_utils.h @@ -3,6 +3,7 @@ #include "pc/lua/smlua.h" #include "types.h" +#include "geo_commands.h" #define C0(cmd, pos, width) (((cmd)->words.w0 >> (pos)) & ((1U << width) - 1)) #define GFX_OP(cmd) C0(cmd, 24, 8) @@ -47,7 +48,7 @@ f32 get_fog_intensity(void); void set_fog_intensity(f32 intensity); /* |description|Gets the current skybox|descriptionEnd| */ -s8 get_skybox(void); +enum SkyBackgroundParams get_skybox(void); /* |description|Sets the override skybox|descriptionEnd| */ void set_override_skybox(s8 background); /* |description|Gets a value of the global skybox color|descriptionEnd| */