mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-06-02 09:16:49 +02:00
Changed the way API version 2 is exposed in picoLoader7.h
This commit is contained in:
@@ -11,5 +11,8 @@ pload_header7_t gLoaderHeader
|
||||
{
|
||||
.entryPoint = (void*)&_start,
|
||||
.apiVersion = PICO_LOADER_API_VERSION,
|
||||
.launcherPath = "/_picoboot.nds"
|
||||
.v2 =
|
||||
{
|
||||
.launcherPath = "/_picoboot.nds"
|
||||
}
|
||||
};
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user