Compare commits

...

10 Commits

Author SHA1 Message Date
734f2aff85 Add custom vscode settings for windows. 2025-01-23 19:24:48 -05:00
73982aace6 Fix my fast loader to fully bypass the intro screen. 2025-01-23 01:09:23 -05:00
ea3529eb8d Add an option to bypass the mario startup screen. 2025-01-23 00:47:22 -05:00
9cbfa1a818 Update add menus guide a bit. 2025-01-23 00:28:24 -05:00
550e055be5 Add define for debug level selector, add defines for disabling menu music.
Disable the start intro when loading in a new game.
2025-01-23 00:26:05 -05:00
b5738c5a91 Add test menu to this decomp.
Add guide to creating menus with this code.
2025-01-23 00:23:29 -05:00
AndratVA
12f70c2201
Merge pull request #103 from beaswag/build-error-fix 2024-05-12 11:07:15 -05:00
bekzii
411fe954c1 Fixed compile errors caused by certain warnings being treated as errors 2024-05-12 16:31:08 +01:00
AndratVA
fea03fc82d
Merge pull request #91 from MisterSheeple/patch-2
Update Dockerfile to Ubuntu 22.04 as 18.04 is EOL
2023-11-20 14:57:01 -05:00
MisterSheeple
325e836afe
Update Dockerfile to Ubuntu 22.04 as 18.04 is EOL
also:

- fix some things that probably broke building before because it was made for the original decomp
2023-11-15 08:26:51 +00:00
12 changed files with 278 additions and 28 deletions

2
.gitignore vendored
View File

@ -44,7 +44,7 @@
# Text editor remnants # Text editor remnants
*.swp *.swp
.vscode/* # vscode/*
.idea/* .idea/*
# General project-specific ignores # General project-specific ignores

29
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,29 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/include",
"${workspaceFolder}/include/**",
"${workspaceFolder}/include/dxsdk",
"${workspaceFolder}/include/GL",
"${workspaceFolder}/include/libc",
"${workspaceFolder}/include/PR",
"${workspaceFolder}/include/stb"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.22621.0",
"compilerPath": "cl.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64",
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}

42
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,42 @@
{
"files.associations": {
"sm64.h": "c",
"gfx_dimensions.h": "c",
"gbi.h": "c",
"options_menu.h": "c",
"*.in": "cpp",
"chrono": "cpp",
"functional": "cpp"
},
// https://stackoverflow.com/questions/45836650/how-do-i-integrate-msys2-shell-into-visual-studio-code-on-window
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
},
"MSYS2": {
"path": "C:\\msys64\\usr\\bin\\bash.exe",
"args": [
"--login",
"-i"
],
"env": {
"MSYSTEM": "MINGW64",
"CHERE_INVOKING": "1"
}
}
},
}

View File

@ -1,24 +1,16 @@
FROM ubuntu:18.04 as build FROM ubuntu:22.04 as build
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y \ apt-get install -y \
binutils-mips-linux-gnu \
bsdmainutils \
build-essential \ build-essential \
libaudiofile-dev \ git \
python3 \ libglew-dev \
wget libsdl2-dev \
python3
RUN wget \ RUN mkdir /render96ex
https://github.com/n64decomp/qemu-irix/releases/download/v2.11-deb/qemu-irix-2.11.0-2169-g32ab296eef_amd64.deb \ WORKDIR /render96ex
-O qemu.deb && \ ENV PATH="/render96ex/tools:${PATH}"
echo 8170f37cf03a08cc2d7c1c58f10d650ea0d158f711f6916da9364f6d8c85f741 qemu.deb | sha256sum --check && \
dpkg -i qemu.deb && \
rm qemu.deb
RUN mkdir /sm64 CMD echo 'Usage: docker run --rm -v ${PWD}:/render96ex render96ex make VERSION=${VERSION:-us} -j4\n' \
WORKDIR /sm64 'See https://github.com/Render96/Render96ex/blob/master/README.md for more information'
ENV PATH="/sm64/tools:${PATH}"
CMD echo 'usage: docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 sm64 make VERSION=${VERSION:-us} -j4\n' \
'see https://github.com/n64decomp/sm64/blob/master/README.md for advanced usage'

View File

@ -576,17 +576,17 @@ ifeq ($(SDL_USED),2)
endif endif
ifeq ($(WINDOWS_BUILD),1) ifeq ($(WINDOWS_BUILD),1)
CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security -fpermissive $(VERSION_CFLAGS) $(GRUCODE_CFLAGS)
CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv -fpermissive
else ifeq ($(TARGET_WEB),1) else ifeq ($(TARGET_WEB),1)
CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -s USE_SDL=2 CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security -fpermissive $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -s USE_SDL=2
CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv -s USE_SDL=2 CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv -fpermissive -s USE_SDL=2
# Linux / Other builds below # Linux / Other builds below
else else
CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security -fpermissive $(VERSION_CFLAGS) $(GRUCODE_CFLAGS)
CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv -fpermissive
endif endif

75
guides/Add-Menus.md Normal file
View File

@ -0,0 +1,75 @@
# Adding menus to this decomp
1. Go into the charmap.txt to get a list of characters needed.
2. Add a menu into options_menu.c:
### To enable the below features:
Add my custom code define under s32 l_counter = 0 in options_menu.c, example:
```
// Enable my custom menus, and other features in this file.
// kelson8
#define _CUSTOM_CODE
```
### To add a menu into options_menu.c:
1. Define a string using the charmap.txt into text_options_strings.h, for example to make the word "Test" add this into that file (0xFF is needed at the end):
```
#define TEXT_OPT_TEST 0x1D,0x0E,0x1C,0x1D,0xFF
```
2. Add a string for the menu in menuStr, and define that in the text_options_strings.h, for example if the menu OPT is test add this into there
```
#ifdef _CUSTOM_CODE
{ TEXT_OPT_TEST },
#endif //_CUSTOM_CODE
```
3. Add a string for the option under bindStr in options_menu.c, example:
```
#ifdef _CUSTOM_CODE
static const u8 testStr[][8] = {
{ TEXT_OPT_TEST }
};
#endif //_CUSTOM_CODE
```
4. Add a new option in options_menu.c, example:
```
#ifdef _CUSTOM_CODE
static struct Option optsTest[] = {
// TODO Fix this to do something else.
// First option is the value of the testStr defined
DEF_OPT_SCROLL( testStr[0], &configMasterVolume, 0, MAX_VOLUME, 1 )
};
#endif //_CUSTOM_CODE
```
5. Add the menu to the SubMenu struct under menuAudio in options_menu.c, example:
```
#ifdef _CUSTOM_CODE
// Get the value from the menuStr
static struct SubMenu menuTest = DEF_SUBMENU( menuStr[9], optsTest );
static struct SubMenu menuCheats = DEF_SUBMENU( menuStr[10], optsCheats );
#else
static struct SubMenu menuCheats = DEF_SUBMENU( menuStr[9], optsCheats );
#endif //_CUSTOM_CODE
```
6. Finally, add this under optmenu_act_exit within optsMain in options_menu.c, example:
```
#ifdef _CUSTOM_CODE
DEF_OPT_SUBMENU( menuStr[9], &menuTest ),
DEF_OPT_SUBMENU( menuStr[10], &menuCheats )
#else
DEF_OPT_SUBMENU( menuStr[9], &menuCheats )
#endif //_CUSTOM_CODE
```
### To add a title for the menu:
1. Go into include/text_options_strings.h.in
2. Add this into that file under cheats or wherever:
```
// Add the text for the test menu
#define TEXT_OPT_TEST _("TEST")
```

View File

@ -11,6 +11,10 @@
#define TEXT_OPT_VIDEO _("DISPLAY") #define TEXT_OPT_VIDEO _("DISPLAY")
#define TEXT_OPT_AUDIO _("SOUND") #define TEXT_OPT_AUDIO _("SOUND")
#define TEXT_OPT_CHEATS _("CHEATS") #define TEXT_OPT_CHEATS _("CHEATS")
// Add the text for the test menu
// #ifdef _CUSTOM_CODE
#define TEXT_OPT_TEST _("TEST")
// #endif //_CUSTOM_CODE
// Markers // Markers

View File

@ -18,6 +18,14 @@
#include "make_const_nonconst.h" #include "make_const_nonconst.h"
#include "levels/intro/header.h" #include "levels/intro/header.h"
// Enable the debug level selector.
// TODO Figure out how to add to the games menu and switch to this, it should be possible.
// #define _LEVEL_SELECTOR
// Bypass the mario startup screen and make the game show the saves without pressing start.
// TODO Make this auto load save slot 1 for testing.
#define _FAST_LOADER
const LevelScript level_intro_entry_1[] = { const LevelScript level_intro_entry_1[] = {
INIT_LEVEL(), INIT_LEVEL(),
FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd), FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
@ -25,19 +33,37 @@ const LevelScript level_intro_entry_1[] = {
LOAD_MIO0(/*seg*/ 0x07, _intro_segment_7SegmentRomStart, _intro_segment_7SegmentRomEnd), LOAD_MIO0(/*seg*/ 0x07, _intro_segment_7SegmentRomStart, _intro_segment_7SegmentRomEnd),
ALLOC_LEVEL_POOL(), ALLOC_LEVEL_POOL(),
#ifndef _FAST_LOADER
AREA(/*index*/ 1, intro_geo_0002D0), AREA(/*index*/ 1, intro_geo_0002D0),
END_AREA(), END_AREA(),
#endif //!_FAST_LOADER
FREE_LEVEL_POOL(), FREE_LEVEL_POOL(),
LOAD_AREA(/*area*/ 1), LOAD_AREA(/*area*/ 1),
#ifndef _FAST_LOADER
CALL(/*arg*/ 0, /*func*/ lvl_intro_update), CALL(/*arg*/ 0, /*func*/ lvl_intro_update),
SLEEP(/*frames*/ 75), SLEEP(/*frames*/ 75),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0x00, 0x00, 0x00), TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0x00, 0x00, 0x00),
SLEEP(/*frames*/ 16), SLEEP(/*frames*/ 16),
#endif //!_FAST_LOADER
CMD2A(/*unk2*/ 1), CMD2A(/*unk2*/ 1),
CLEAR_LEVEL(), CLEAR_LEVEL(),
SLEEP(/*frames*/ 2), SLEEP(/*frames*/ 2),
#ifdef _LEVEL_SELECTOR //Level selector patch
EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_4),
#elif defined(_FAST_LOADER)
// This bypasses the mario startup where it says to press start by enabling this.
EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_main_menu_entry_1),
#else
// Normal load screen
EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_2), EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_2),
#endif //_LEVEL_SELECTOR
}; };
const LevelScript level_intro_entry_2[] = { const LevelScript level_intro_entry_2[] = {
@ -56,13 +82,20 @@ const LevelScript level_intro_entry_2[] = {
SLEEP(/*frames*/ 2), SLEEP(/*frames*/ 2),
BLACKOUT(/*active*/ FALSE), BLACKOUT(/*active*/ FALSE),
LOAD_AREA(/*area*/ 1), LOAD_AREA(/*area*/ 1),
// Toggle the intro music by commenting this out.
SET_MENU_MUSIC(/*seq*/ 0x0002), SET_MENU_MUSIC(/*seq*/ 0x0002),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00), TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00),
SLEEP(/*frames*/ 20), SLEEP(/*frames*/ 20),
CALL_LOOP(/*arg*/ 1, /*func*/ lvl_intro_update), CALL_LOOP(/*arg*/ 1, /*func*/ lvl_intro_update),
// Original code
JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L1), JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L1),
JUMP_IF(/*op*/ OP_EQ, /*arg*/ 101, script_intro_L2), JUMP_IF(/*op*/ OP_EQ, /*arg*/ 101, script_intro_L2),
JUMP(script_intro_L4), JUMP(script_intro_L4),
// This somewhat makes it load faster after going into the main menu and hitting start
// JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, level_main_menu_entry_1),
// JUMP_IF(/*op*/ OP_EQ, /*arg*/ 101, level_main_menu_entry_1),
// JUMP(level_main_menu_entry_1),
}; };
const LevelScript level_intro_entry_3[] = { const LevelScript level_intro_entry_3[] = {
@ -81,6 +114,7 @@ const LevelScript level_intro_entry_3[] = {
SLEEP(/*frames*/ 2), SLEEP(/*frames*/ 2),
BLACKOUT(/*active*/ FALSE), BLACKOUT(/*active*/ FALSE),
LOAD_AREA(/*area*/ 1), LOAD_AREA(/*area*/ 1),
// Toggle the intro music by commenting this out.
SET_MENU_MUSIC(/*seq*/ 0x0082), SET_MENU_MUSIC(/*seq*/ 0x0082),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00), TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00),
SLEEP(/*frames*/ 20), SLEEP(/*frames*/ 20),
@ -103,6 +137,7 @@ const LevelScript level_intro_entry_4[] = {
FREE_LEVEL_POOL(), FREE_LEVEL_POOL(),
LOAD_AREA(/*area*/ 1), LOAD_AREA(/*area*/ 1),
// Toggle the intro music by commenting this out.
SET_MENU_MUSIC(/*seq*/ 0x0002), SET_MENU_MUSIC(/*seq*/ 0x0002),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF), TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF),
SLEEP(/*frames*/ 16), SLEEP(/*frames*/ 16),

View File

@ -3,12 +3,22 @@
#include "types.h" #include "types.h"
// Enable my custom menus, I don't know how to use these yet.
// #define _CUSTOM_CODE
// Disables the menu music
// #define _DISABLE_MENU_MUSIC
// geo // geo
extern const GeoLayout geo_menu_mario_save_button[]; extern const GeoLayout geo_menu_mario_save_button[];
extern const GeoLayout geo_menu_mario_save_button_fade[]; extern const GeoLayout geo_menu_mario_save_button_fade[];
extern const GeoLayout geo_menu_mario_new_button[]; extern const GeoLayout geo_menu_mario_new_button[];
extern const GeoLayout geo_menu_mario_new_button_fade[]; extern const GeoLayout geo_menu_mario_new_button_fade[];
extern const GeoLayout geo_menu_erase_button[]; extern const GeoLayout geo_menu_erase_button[];
#ifdef _CUSTOM_CODE
extern const GeoLayout geo_menu_custom_button[];
#endif //_CUSTOM_CODE
extern const GeoLayout geo_menu_copy_button[]; extern const GeoLayout geo_menu_copy_button[];
extern const GeoLayout geo_menu_file_button[]; extern const GeoLayout geo_menu_file_button[];
extern const GeoLayout geo_menu_score_button[]; extern const GeoLayout geo_menu_score_button[];

View File

@ -35,6 +35,13 @@ const LevelScript level_main_menu_entry_1[] = {
LOAD_MODEL_FROM_GEO(MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON, geo_menu_sound_button), LOAD_MODEL_FROM_GEO(MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON, geo_menu_sound_button),
LOAD_MODEL_FROM_GEO(MODEL_MAIN_MENU_GENERIC_BUTTON, geo_menu_generic_button), LOAD_MODEL_FROM_GEO(MODEL_MAIN_MENU_GENERIC_BUTTON, geo_menu_generic_button),
// TODO Figure out how to add to the main menu, enable this in header.h
#ifdef _CUSTOM_CODE
LOAD_MODEL_FROM_GEO(MODEL_MAIN_MENU_GENERIC_BUTTON, geo_menu_custom_button),
#endif //_CUSTOM_CODE
AREA(/*index*/ 1, geo_menu_file_select_strings_and_menu_cursor), AREA(/*index*/ 1, geo_menu_file_select_strings_and_menu_cursor),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 0, 0, -19000, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvMenuButtonManager), OBJECT(/*model*/ MODEL_NONE, /*pos*/ 0, 0, -19000, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvMenuButtonManager),
OBJECT(/*model*/ MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, /*pos*/ 0, 0, -19000, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvYellowBackgroundInMenu), OBJECT(/*model*/ MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, /*pos*/ 0, 0, -19000, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvYellowBackgroundInMenu),
@ -43,7 +50,13 @@ const LevelScript level_main_menu_entry_1[] = {
FREE_LEVEL_POOL(), FREE_LEVEL_POOL(),
LOAD_AREA(/*area*/ 1), LOAD_AREA(/*area*/ 1),
#ifdef _DISABLE_MENU_MUSIC
// Make this do nothing if enabled
#else
SET_MENU_MUSIC(/*seq*/ 0x0021), SET_MENU_MUSIC(/*seq*/ 0x0021),
#endif //_DISABLE_MENU_MUSIC
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF), TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF),
CALL(/*arg*/ 0, /*func*/ lvl_init_menu_values_and_cursor_pos), CALL(/*arg*/ 0, /*func*/ lvl_init_menu_values_and_cursor_pos),
CALL_LOOP(/*arg*/ 0, /*func*/ lvl_update_obj_and_load_file_selected), CALL_LOOP(/*arg*/ 0, /*func*/ lvl_update_obj_and_load_file_selected),

View File

@ -1160,6 +1160,8 @@ s32 update_level(void) {
return changeLevel; return changeLevel;
} }
#define _DISABLE_START_INTRO
s32 init_level(void) { s32 init_level(void) {
s32 val4 = 0; s32 val4 = 0;
@ -1198,9 +1200,11 @@ s32 init_level(void) {
if (gMarioState->action != ACT_UNINITIALIZED) { if (gMarioState->action != ACT_UNINITIALIZED) {
if (save_file_exists(gCurrSaveFileNum - 1)) { if (save_file_exists(gCurrSaveFileNum - 1)) {
set_mario_action(gMarioState, ACT_IDLE, 0); set_mario_action(gMarioState, ACT_IDLE, 0);
#ifndef _DISABLE_START_INTRO //Disable the starting intro when launching a new save.
} else if (gCLIOpts.SkipIntro == 0 && configSkipIntro == 0) { } else if (gCLIOpts.SkipIntro == 0 && configSkipIntro == 0) {
set_mario_action(gMarioState, ACT_INTRO_CUTSCENE, 0); set_mario_action(gMarioState, ACT_INTRO_CUTSCENE, 0);
val4 = 1; val4 = 1;
#endif //_DISABLE_START_INTRO
} }
} }
} }
@ -1246,6 +1250,8 @@ s32 lvl_init_or_update(s16 initOrUpdate, UNUSED s32 unused) {
return result; return result;
} }
#undef _LEVEL_SELECTOR
s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) { s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) {
#ifdef VERSION_EU #ifdef VERSION_EU
s16 var = eu_get_language(); s16 var = eu_get_language();
@ -1267,7 +1273,6 @@ s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) {
sWarpDest.type = WARP_TYPE_NOT_WARPING; sWarpDest.type = WARP_TYPE_NOT_WARPING;
sDelayedWarpOp = WARP_OP_NONE; sDelayedWarpOp = WARP_OP_NONE;
gShouldNotPlayCastleMusic = !save_file_exists(gCurrSaveFileNum - 1) && gCLIOpts.SkipIntro == 0 && configSkipIntro == 0; gShouldNotPlayCastleMusic = !save_file_exists(gCurrSaveFileNum - 1) && gCLIOpts.SkipIntro == 0 && configSkipIntro == 0;
gCurrLevelNum = levelNum; gCurrLevelNum = levelNum;
gCurrCourseNum = COURSE_NONE; gCurrCourseNum = COURSE_NONE;
gSavedCourseNum = COURSE_NONE; gSavedCourseNum = COURSE_NONE;

View File

@ -1,3 +1,7 @@
// Add this to enable intellisense in this file,
// it is already defined in the Makefile.
#define EXT_OPTIONS_MENU
#ifdef EXT_OPTIONS_MENU #ifdef EXT_OPTIONS_MENU
#include "sm64.h" #include "sm64.h"
@ -40,6 +44,10 @@ static s32 l_counter = 0;
// menus: add a new submenu definition and a new // menus: add a new submenu definition and a new
// option to the optsMain list // option to the optsMain list
// Enable my custom menus, and other features in this file.
// kelson8
#define _CUSTOM_CODE
static const u8 toggleStr[][16] = { static const u8 toggleStr[][16] = {
{ TEXT_OPT_DISABLED }, { TEXT_OPT_DISABLED },
{ TEXT_OPT_ENABLED }, { TEXT_OPT_ENABLED },
@ -55,7 +63,12 @@ static const u8 menuStr[][32] = {
{ TEXT_OPT_VIDEO }, { TEXT_OPT_VIDEO },
{ TEXT_OPT_AUDIO }, { TEXT_OPT_AUDIO },
{ TEXT_EXIT_GAME }, { TEXT_EXIT_GAME },
{ TEXT_OPT_CHEATS },
#ifdef _CUSTOM_CODE
{ TEXT_OPT_TEST },
#endif //_CUSTOM_CODE
{ TEXT_OPT_CHEATS }
}; };
@ -125,6 +138,12 @@ static const u8 bindStr[][32] = {
{ TEXT_OPT_RUMBLE } { TEXT_OPT_RUMBLE }
}; };
#ifdef _CUSTOM_CODE
static const u8 testStr[][8] = {
{ TEXT_OPT_TEST }
};
#endif //_CUSTOM_CODE
static const u8 *filterChoices[] = { static const u8 *filterChoices[] = {
optsVideoStr[2], optsVideoStr[2],
optsVideoStr[3], optsVideoStr[3],
@ -269,6 +288,13 @@ static struct Option optsAudio[] = {
DEF_OPT_SCROLL( optsAudioStr[3], &configEnvVolume, 0, MAX_VOLUME, 1), DEF_OPT_SCROLL( optsAudioStr[3], &configEnvVolume, 0, MAX_VOLUME, 1),
}; };
#ifdef _CUSTOM_CODE
static struct Option optsTest[] = {
// TODO Fix this to do something else.
DEF_OPT_SCROLL( testStr[0], &configMasterVolume, 0, MAX_VOLUME, 1 )
};
#endif //_CUSTOM_CODE
static struct Option optsCheats[] = { static struct Option optsCheats[] = {
DEF_OPT_TOGGLE( optsCheatsStr[0], &Cheats.EnableCheats ), DEF_OPT_TOGGLE( optsCheatsStr[0], &Cheats.EnableCheats ),
DEF_OPT_TOGGLE( optsCheatsStr[1], &Cheats.MoonJump ), DEF_OPT_TOGGLE( optsCheatsStr[1], &Cheats.MoonJump ),
@ -290,7 +316,17 @@ static struct SubMenu menuCamera = DEF_SUBMENU( menuStr[4], optsCamera );
static struct SubMenu menuControls = DEF_SUBMENU( menuStr[5], optsControls ); static struct SubMenu menuControls = DEF_SUBMENU( menuStr[5], optsControls );
static struct SubMenu menuVideo = DEF_SUBMENU( menuStr[6], optsVideo ); static struct SubMenu menuVideo = DEF_SUBMENU( menuStr[6], optsVideo );
static struct SubMenu menuAudio = DEF_SUBMENU( menuStr[7], optsAudio ); static struct SubMenu menuAudio = DEF_SUBMENU( menuStr[7], optsAudio );
// Test, this works!
#ifdef _CUSTOM_CODE
// Get the value from the menuStr
static struct SubMenu menuTest = DEF_SUBMENU( menuStr[9], optsTest );
static struct SubMenu menuCheats = DEF_SUBMENU( menuStr[10], optsCheats );
#else
static struct SubMenu menuCheats = DEF_SUBMENU( menuStr[9], optsCheats ); static struct SubMenu menuCheats = DEF_SUBMENU( menuStr[9], optsCheats );
#endif //_CUSTOM_CODE
/* main options menu definition */ /* main options menu definition */
@ -302,8 +338,17 @@ static struct Option optsMain[] = {
DEF_OPT_SUBMENU( menuStr[6], &menuVideo ), DEF_OPT_SUBMENU( menuStr[6], &menuVideo ),
DEF_OPT_SUBMENU( menuStr[7], &menuAudio ), DEF_OPT_SUBMENU( menuStr[7], &menuAudio ),
DEF_OPT_BUTTON ( menuStr[8], optmenu_act_exit ), DEF_OPT_BUTTON ( menuStr[8], optmenu_act_exit ),
// NOTE: always keep cheats the last option here because of the half-assed way I toggle them
// Test, this works!
#ifdef _CUSTOM_CODE
DEF_OPT_SUBMENU( menuStr[9], &menuTest ),
DEF_OPT_SUBMENU( menuStr[10], &menuCheats )
#else
DEF_OPT_SUBMENU( menuStr[9], &menuCheats ) DEF_OPT_SUBMENU( menuStr[9], &menuCheats )
#endif //_CUSTOM_CODE
// NOTE: always keep cheats the last option here because of the half-assed way I toggle them
// DEF_OPT_SUBMENU( menuStr[10], &menuCheats )
}; };
static struct SubMenu menuMain = DEF_SUBMENU( menuStr[3], optsMain ); static struct SubMenu menuMain = DEF_SUBMENU( menuStr[3], optsMain );