From 853ab259f4594f66be8fd7e1d53d5c01130d0763 Mon Sep 17 00:00:00 2001 From: Carson Coder Date: Sat, 21 Jun 2025 22:34:20 -0400 Subject: [PATCH] Add startup delay option --- CMakeLists.txt | 6 ++++++ ISLE/isleapp.cpp | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 461e8378..e3ecce53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ endif() find_program(SDL_SHADERCROSS_BIN NAMES "shadercross") find_package(Python3 3.11 COMPONENTS Interpreter) +option(ISLE_STARTUP_DELAY "Enable startup delay" ON) option(ISLE_BUILD_APP "Build isle application" ON) option(ISLE_ASAN "Enable Address Sanitizer" OFF) option(ISLE_UBSAN "Enable Undefined Behavior Sanitizer" OFF) @@ -44,6 +45,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" CACHE PATH "Directory w set(ISLE_EMSCRIPTEN_HOST "" CACHE STRING "Host URL for Emscripten streaming (e.g., https://test.com)") cmake_dependent_option(BUILD_SHARED_LIBS "Build lego1 as a shared library" ON "NOT EMSCRIPTEN" OFF) +message(STATUS "Startup delay: ${ISLE_STARTUP_DELAY}") message(STATUS "Isle app: ${ISLE_BUILD_APP}") message(STATUS "Config app: ${ISLE_BUILD_CONFIG}") message(STATUS "Internal DirectX5 SDK: ${ISLE_USE_DX5}") @@ -553,6 +555,10 @@ if (ISLE_BUILD_CONFIG) endif() endif() +if (ISLE_STARTUP_DELAY) + target_compile_definitions(STARTUP_DELAY); +endif() + if (ISLE_MINIWIN) set_property(TARGET ${isle_targets} APPEND PROPERTY LINK_LIBRARIES "miniwin") endif() diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index 6c4c8e2f..053fdc98 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -908,8 +908,13 @@ inline bool IsleApp::Tick() // GLOBAL: ISLE 0x4101c0 static MxLong g_lastFrameTime = 0; +#ifdef STARTUP_DELAY // GLOBAL: ISLE 0x4101bc static MxS32 g_startupDelay = 200; +#else + // GLOBAL: ISLE 0x4101bc + static MxS32 g_startupDelay = 1; +#endif if (IsleDebug_Paused() && IsleDebug_StepModeEnabled()) { IsleDebug_SetPaused(false);