From 2d2dff664727a7143627427ce76f35851e59fb7f Mon Sep 17 00:00:00 2001 From: MysterD Date: Thu, 30 Jul 2020 20:42:39 -0700 Subject: [PATCH] Added IMMEDIATELOAD debug flag to skip all intro stuff --- Makefile | 8 ++++++++ compile.sh | 2 +- debug.sh | 2 +- levels/entry.c | 9 +++++++++ levels/menu/script.c | 4 ++++ src/menu/file_select.c | 9 +++++++++ 6 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bc82c2cb..ae83b953 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,8 @@ OSX_BUILD ?= 0 TARGET_ARCH ?= native TARGET_BITS ?= 0 +# Disable immediate load by default +IMMEDIATELOAD ?= 0 # Disable better camera by default BETTERCAMERA ?= 0 # Disable no drawing distance by default @@ -540,6 +542,12 @@ endif # Check for enhancement options +# Check for immediate load option +ifeq ($(IMMEDIATELOAD),1) + CC_CHECK += -DIMMEDIATELOAD + CFLAGS += -DIMMEDIATELOAD +endif + # Check for Puppycam option ifeq ($(BETTERCAMERA),1) CC_CHECK += -DBETTERCAMERA diff --git a/compile.sh b/compile.sh index abde8180..03993da5 100644 --- a/compile.sh +++ b/compile.sh @@ -1 +1 @@ -make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 && winpty cgdb ./build/us_pc/sm64.us.f3dex2e.exe -ex 'run' -ex 'quit' \ No newline at end of file +make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 IMMEDIATELOAD=1 && winpty cgdb ./build/us_pc/sm64.us.f3dex2e.exe -ex 'run' -ex 'quit' \ No newline at end of file diff --git a/debug.sh b/debug.sh index f79531be..82627c9f 100644 --- a/debug.sh +++ b/debug.sh @@ -1 +1 @@ -make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 && winpty cgdb ./build/us_pc/sm64.us.f3dex2e.exe -ex 'break render_pause_courses_and_castle' \ No newline at end of file +make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 IMMEDIATELOAD=1 && winpty cgdb ./build/us_pc/sm64.us.f3dex2e.exe -ex 'break render_pause_courses_and_castle' \ No newline at end of file diff --git a/levels/entry.c b/levels/entry.c index 015eeb6b..8d7de5df 100644 --- a/levels/entry.c +++ b/levels/entry.c @@ -3,7 +3,11 @@ #include "segment_symbols.h" #include "level_commands.h" +#ifdef IMMEDIATELOAD +#include "levels/menu/header.h" +#else #include "levels/intro/header.h" +#endif #include "make_const_nonconst.h" @@ -12,6 +16,11 @@ const LevelScript level_script_entry[] = { SLEEP(/*frames*/ 2), BLACKOUT(/*active*/ FALSE), SET_REG(/*value*/ 0), +#ifdef IMMEDIATELOAD + EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_main_menu_entry_1), + JUMP(/*target*/ level_main_menu_entry_1), +#else EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_entry_1), JUMP(/*target*/ level_script_entry), +#endif }; diff --git a/levels/menu/script.c b/levels/menu/script.c index 4e955c12..bb7d5e2f 100644 --- a/levels/menu/script.c +++ b/levels/menu/script.c @@ -44,13 +44,17 @@ const LevelScript level_main_menu_entry_1[] = { FREE_LEVEL_POOL(), LOAD_AREA(/*area*/ 1), SET_MENU_MUSIC(/*seq*/ 0x0021), +#ifndef IMMEDIATELOAD TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF), +#endif CALL(/*arg*/ 0, /*func*/ lvl_init_menu_values_and_cursor_pos), CALL_LOOP(/*arg*/ 0, /*func*/ lvl_update_obj_and_load_file_selected), GET_OR_SET(/*op*/ OP_SET, /*var*/ VAR_CURR_SAVE_FILE_NUM), STOP_MUSIC(/*fadeOutTime*/ 0x00BE), +#ifndef IMMEDIATELOAD TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF), SLEEP(/*frames*/ 16), +#endif CLEAR_LEVEL(), SLEEP_BEFORE_EXIT(/*frames*/ 1), SET_REG(/*value*/ LEVEL_CASTLE_GROUNDS), diff --git a/src/menu/file_select.c b/src/menu/file_select.c index df28306a..5d063b91 100644 --- a/src/menu/file_select.c +++ b/src/menu/file_select.c @@ -1115,9 +1115,13 @@ void check_sound_mode_menu_clicked_buttons(struct Object *soundModeButton) { * retuning sSelectedFileNum to a save value defined in fileNum. */ void load_main_menu_save_file(struct Object *fileButton, s32 fileNum) { +#ifdef IMMEDIATELOAD + sSelectedFileNum = fileNum; +#else if (fileButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { sSelectedFileNum = fileNum; } +#endif } /** @@ -1593,6 +1597,11 @@ void handle_cursor_button_input(void) { sClickPos[1] = sCursorPos[1]; sCursorClickingTimer = 1; } +#ifdef IMMEDIATELOAD + sClickPos[0] = sCursorPos[0]; + sClickPos[1] = sCursorPos[1]; + sCursorClickingTimer = 1; +#endif } }