From ff82a40b3f29d6d0cfe04913333c4143c2aa739d Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:36:35 -0500 Subject: [PATCH 1/2] Remove singleplayer pause --- src/engine/behavior_script.c | 4 ++-- src/game/level_update.c | 20 ++++---------------- src/game/object_helpers.c | 3 ++- src/pc/configfile.c | 2 -- src/pc/configfile.h | 1 - src/pc/djui/djui_panel_misc.c | 1 - 6 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/engine/behavior_script.c b/src/engine/behavior_script.c index 60c9c07a9..faefd977c 100644 --- a/src/engine/behavior_script.c +++ b/src/engine/behavior_script.c @@ -1287,7 +1287,7 @@ void cur_obj_update(void) { } // handle network area timer - if (gCurrentObject->areaTimerType != AREA_TIMER_TYPE_NONE && !(gMenuMode == -1 && configSingleplayerPause)) { + if (gCurrentObject->areaTimerType != AREA_TIMER_TYPE_NONE) { // make sure the area is valid if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) { goto cur_obj_update_end; @@ -1437,7 +1437,7 @@ cur_obj_update_begin:; } // update network area timer - if (gCurrentObject->areaTimerType != AREA_TIMER_TYPE_NONE && !(gMenuMode == -1 && configSingleplayerPause)) { + if (gCurrentObject->areaTimerType != AREA_TIMER_TYPE_NONE) { gCurrentObject->areaTimer++; if (gCurrentObject->areaTimer < gNetworkAreaTimer) { goto cur_obj_update_begin; diff --git a/src/game/level_update.c b/src/game/level_update.c index 31e01b662..0e3c95239 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -245,17 +245,10 @@ u16 level_control_timer(s32 timerOp) { } u32 pressed_pause(void) { - if (configSingleplayerPause && network_player_connected_count() == 1) { - // prevent softlock in singleplayer pause, by not allowing pause in transitions - if (gWarpTransition.isActive || sDelayedWarpOp != WARP_OP_NONE) { - return FALSE; - } - } - - u32 val4 = get_dialog_id() >= 0; + u32 dialogActive = get_dialog_id() >= 0; u32 intangible = (gMarioState->action & ACT_FLAG_INTANGIBLE) != 0; - if (!intangible && !val4 && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE + if (!intangible && !dialogActive && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE && (gPlayer1Controller->buttonPressed & START_BUTTON)) { return TRUE; } @@ -1672,13 +1665,8 @@ s32 update_level(void) { changeLevel = play_mode_normal(); break; case PLAY_MODE_PAUSED: - if (!(configSingleplayerPause && network_player_connected_count() == 1 && gActiveMods.entryCount == 0)) { - changeLevel = play_mode_normal(); - } - - if (sCurrPlayMode == PLAY_MODE_PAUSED) { - changeLevel = play_mode_paused(); - } + changeLevel = play_mode_normal(); + changeLevel = play_mode_paused(); break; case PLAY_MODE_CHANGE_AREA: changeLevel = play_mode_change_area(); diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index 4e81a57f8..a6654c926 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -30,6 +30,7 @@ #include "pc/network/network.h" #include "pc/lua/smlua_hooks.h" #include "pc/lua/utils/smlua_misc_utils.h" +#include "first_person_cam.h" u8 (*gContinueDialogFunction)(void) = NULL; struct Object* gContinueDialogFunctionObject = NULL; @@ -1944,7 +1945,7 @@ void obj_set_cylboard(struct Object *obj) { void cur_obj_set_billboard_if_vanilla_cam(void) { if (!o) { return; } - if (camera_config_is_free_cam_enabled()) { + if (camera_config_is_free_cam_enabled() || get_first_person_enabled()) { o->header.gfx.node.flags &= ~GRAPH_RENDER_BILLBOARD; o->header.gfx.node.flags |= GRAPH_RENDER_CYLBOARD; } else { diff --git a/src/pc/configfile.c b/src/pc/configfile.c index a8d250172..a9af42539 100644 --- a/src/pc/configfile.c +++ b/src/pc/configfile.c @@ -150,7 +150,6 @@ bool configCtxProfiler = false; unsigned int configInterpolationMode = 1; unsigned int configGamepadNumber = 0; bool configBackgroundGamepad = true; -bool configSingleplayerPause = false; bool configDebugPrint = false; bool configDebugInfo = false; bool configDebugError = false; @@ -260,7 +259,6 @@ static const struct ConfigOption options[] = { {.name = "coop_custom_palette_skin", .type = CONFIG_TYPE_COLOR , .colorValue = &configCustomPalette.parts[SKIN]}, {.name = "coop_custom_palette_cap", .type = CONFIG_TYPE_COLOR , .colorValue = &configCustomPalette.parts[CAP]}, {.name = "coop_stay_in_level_after_star", .type = CONFIG_TYPE_UINT , .uintValue = &configStayInLevelAfterStar}, - {.name = "coop_singleplayer_pause", .type = CONFIG_TYPE_BOOL , .boolValue = &configSingleplayerPause}, {.name = "coop_compatibility", .type = CONFIG_TYPE_BOOL , .boolValue = &configCoopCompatibility}, {.name = "disable_popups", .type = CONFIG_TYPE_BOOL , .boolValue = &configDisablePopups}, #if defined(DEVELOPMENT) diff --git a/src/pc/configfile.h b/src/pc/configfile.h index c60a8ef43..c41f3179a 100644 --- a/src/pc/configfile.h +++ b/src/pc/configfile.h @@ -107,7 +107,6 @@ extern bool configLuaProfiler; extern bool configCtxProfiler; #endif extern unsigned int configInterpolationMode; -extern bool configSingleplayerPause; extern bool configDebugPrint; extern bool configDebugInfo; extern bool configDebugError; diff --git a/src/pc/djui/djui_panel_misc.c b/src/pc/djui/djui_panel_misc.c index a847195c1..aeeeb13a9 100644 --- a/src/pc/djui/djui_panel_misc.c +++ b/src/pc/djui/djui_panel_misc.c @@ -48,7 +48,6 @@ void djui_panel_misc_create(struct DjuiBase* caller) { djui_themes_init(); { - djui_checkbox_create(body, DLANG(MISC, PAUSE_IN_SINGLEPLAYER), &configSingleplayerPause, NULL); djui_checkbox_create(body, DLANG(MISC, DISABLE_POPUPS), &configDisablePopups, NULL); djui_checkbox_create(body, DLANG(MISC, COOP_COMPATIBILITY), &configCoopCompatibility, djui_panel_compatibility_checkbox_on_value_change); From b08e30b415fc98e922b554a5cafddccb02eab8e5 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Fri, 8 Dec 2023 16:35:29 -0500 Subject: [PATCH 2/2] Add sm64coopdx version to crash screen --- src/pc/crash_handler.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pc/crash_handler.c b/src/pc/crash_handler.c index be2df7888..3df5e75c0 100644 --- a/src/pc/crash_handler.c +++ b/src/pc/crash_handler.c @@ -288,6 +288,13 @@ static void crash_handler_add_info_str(CrashHandlerText** pTextP, f32 x, f32 y, *pTextP = pText; } +static void crash_handler_add_version_str(CrashHandlerText** pTextP, f32 x, f32 y) { + CrashHandlerText* pText = *pTextP; + crash_handler_set_text(x, y, 0xFF, 0xFF, 0x00, "%s", "sm64coopdx "); + crash_handler_set_text(-1, y, 0x00, 0xFF, 0xFF, "%s", SM64COOPDX_VERSION); + *pTextP = pText; +} + static void crash_handler_add_info_int(CrashHandlerText** pTextP, f32 x, f32 y, const char* title, int value) { CrashHandlerText* pText = *pTextP; crash_handler_set_text(x, y, 0xFF, 0xFF, 0x00, "%s", title); @@ -637,7 +644,7 @@ static void crash_handler(const int signalNum, siginfo_t *info, ucontext_t *cont } } - crash_handler_add_info_str(&pText, 335, 208, "Version", get_version_local()); + crash_handler_add_version_str(&pText, 335, 208); crash_handler_add_info_str(&pText, 8, 208, "RemoteBhv", gLastRemoteBhv); // sounds