diff --git a/arm7/source/header.cpp b/arm7/source/header.cpp index 0af66c7..8bac928 100644 --- a/arm7/source/header.cpp +++ b/arm7/source/header.cpp @@ -11,5 +11,8 @@ pload_header7_t gLoaderHeader { .entryPoint = (void*)&_start, .apiVersion = PICO_LOADER_API_VERSION, - .launcherPath = "/_picoboot.nds" + .v2 = + { + .launcherPath = "/_picoboot.nds" + } }; \ No newline at end of file diff --git a/arm7/source/main.cpp b/arm7/source/main.cpp index 3f0c8ce..be03045 100644 --- a/arm7/source/main.cpp +++ b/arm7/source/main.cpp @@ -222,7 +222,7 @@ extern "C" void loaderMain() sLoader.SetRomPath(gLoaderHeader.loadParams.romPath); handleSavePath(); sLoader.SetArguments(gLoaderHeader.loadParams.arguments, gLoaderHeader.loadParams.argumentsLength); - sLoader.SetLauncherPath(gLoaderHeader.launcherPath); + sLoader.SetLauncherPath(gLoaderHeader.v2.launcherPath); sLoader.Load(BootMode::Normal); } diff --git a/include/picoLoader7.h b/include/picoLoader7.h index 11877c2..0ad350b 100644 --- a/include/picoLoader7.h +++ b/include/picoLoader7.h @@ -3,9 +3,6 @@ /// @brief The Pico Loader API version supported by this header file. #define PICO_LOADER_API_VERSION 2 -/// @brief The minimum Pico Loader API version that supports the launcherPath setting. -#define PICO_LOADER_LAUNCHER_PATH_MIN_API_VERSION 2 - /// @brief Enum to specify the drive to boot from. typedef enum { @@ -38,6 +35,13 @@ typedef struct char arguments[256]; } pload_params_t; +/// @brief Struct representing the API version 2 part of the header of picoLoader7.bin. +typedef struct +{ + /// @brief The path of the rom to return to when exiting an application. + char launcherPath[256]; +} pload_header7_v2_t; + /// @brief Struct representing the header of picoLoader7.bin. typedef struct { @@ -56,21 +60,6 @@ typedef struct /// @brief The load params, see \see pload_params_t. pload_params_t loadParams; - // === api version 2 === - - /// @brief The path of the rom to return to when exiting an application. - char launcherPath[256]; + /// @brief The API version 2 part of the header. Only access this when \see apiVersion >= 2. + pload_header7_v2_t v2; } pload_header7_t; - -#ifdef __cplusplus -extern "C" { -#endif - -static inline bool pload_supportsLauncherPath(const pload_header7_t* header) -{ - return header->apiVersion >= PICO_LOADER_LAUNCHER_PATH_MIN_API_VERSION; -} - -#ifdef __cplusplus -} -#endif