2022-03-21 21:51:23 -04:00
|
|
|
#include "bootcommands.h"
|
|
|
|
#include "gameconsole.h"
|
|
|
|
#include <macros.h>
|
|
|
|
#include <z64.h>
|
2023-01-17 00:17:49 -05:00
|
|
|
#include <libultraship/libultra.h>
|
|
|
|
#include <libultraship/bridge.h>
|
2022-03-21 21:51:23 -04:00
|
|
|
#include <functions.h>
|
|
|
|
#include <variables.h>
|
2022-07-10 10:51:12 -04:00
|
|
|
#include <string.h>
|
2022-03-21 21:51:23 -04:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <z64.h>
|
|
|
|
|
|
|
|
uint8_t gLoadFileSelect = 0, gSkipLogoTest = 0;
|
|
|
|
|
|
|
|
extern BootCommandFunc BootCommands_Command_SkipLogo(char** argv, s32 argc);
|
|
|
|
extern BootCommandFunc BootCommands_Command_LoadFileSelect(char** argv, s32 argc);
|
|
|
|
|
|
|
|
static BootCommand sCommands[] = { { "--skiplogo", BootCommands_Command_SkipLogo },
|
|
|
|
{ "--loadfileselect", BootCommands_Command_LoadFileSelect } };
|
|
|
|
|
2022-07-13 23:12:11 -04:00
|
|
|
void BootCommands_Init()
|
2022-03-21 21:51:23 -04:00
|
|
|
{
|
2023-01-17 00:17:49 -05:00
|
|
|
CVarRegisterInteger("gDebugEnabled", 0);
|
|
|
|
CVarRegisterInteger("gLanguages", LANGUAGE_ENG);
|
2023-01-23 15:36:28 -05:00
|
|
|
CVarRegisterInteger("gDebugWarpScreenTranslation", 1);
|
2023-01-17 00:17:49 -05:00
|
|
|
CVarRegisterInteger("gInvertYAxis", 1);
|
|
|
|
CVarSetInteger("gRandoGenerating", 0); // Clear when a crash happened during rando seed generation
|
2022-08-19 20:03:28 -04:00
|
|
|
#if defined(__SWITCH__) || defined(__WIIU__)
|
2023-01-17 00:17:49 -05:00
|
|
|
CVarRegisterInteger("gControlNav", 1); // always enable controller nav on switch/wii u
|
2022-08-19 09:46:11 -04:00
|
|
|
#endif
|
2022-03-21 21:51:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
//void BootCommands_ParseBootArgs(char* str)
|
|
|
|
void BootCommands_ParseBootArgs(s32 argc, char** argv)
|
|
|
|
{
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
// Parse the commands
|
|
|
|
for (i = 0; i < argc; i++) {
|
|
|
|
s32 j;
|
|
|
|
|
|
|
|
for (j = 0; j < ARRAY_COUNT(sCommands); j++) {
|
|
|
|
if (!strcmp(argv[i], sCommands[j].name)) {
|
|
|
|
s32 numArgsProcessed = sCommands[j].func(&argv[i], argc - i);
|
|
|
|
i += numArgsProcessed;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Command Name: --skiplogo
|
|
|
|
* Description: Skips the N64 Logo Screen
|
|
|
|
* Arguments: None
|
|
|
|
*/
|
|
|
|
BootCommandFunc BootCommands_Command_SkipLogo(char** argv, s32 argc) {
|
|
|
|
gSkipLogoTest = 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Command Name: --loadfileselect
|
|
|
|
* Description: Loads the file select screen on bootup.
|
|
|
|
* Arguments: None
|
|
|
|
*/
|
|
|
|
BootCommandFunc BootCommands_Command_LoadFileSelect(char** argv, s32 argc) {
|
|
|
|
gLoadFileSelect = 1;
|
|
|
|
return 0;
|
|
|
|
}
|