mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-09 22:56:35 +00:00
Add skeleton architecture for displaying custom splash screen
This commit is contained in:
parent
87605563d2
commit
9fadec60c5
6 changed files with 40 additions and 0 deletions
|
@ -136,6 +136,8 @@ static int loadlist_ini_handler(void *user, const char *section, const char *nam
|
|||
/* Read in entrypoint as a hex string. */
|
||||
sscanf(value, "%x", &x);
|
||||
loader_ctx->chainload_entrypoint = (entrypoint_t)x;
|
||||
} else if (strcmp(name, LOADER_CUSTOMSPLASH_KEY) == 0) {
|
||||
strncpy(loader_ctx->custom_splash_path, value, sizeof(loader_ctx->custom_splash_path));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -18,10 +18,12 @@ typedef struct {
|
|||
load_file_t exosphere_loadfile;
|
||||
load_file_t tsecfw_loadfile;
|
||||
load_file_t warmboot_loadfile;
|
||||
char custom_splash_path[0x300];
|
||||
} loader_ctx_t;
|
||||
|
||||
#define LOADER_ENTRYPOINT_KEY "entrypoint"
|
||||
#define LOADER_LOADLIST_KEY "loadlist"
|
||||
#define LOADER_CUSTOMSPLASH_KEY "custom_splash"
|
||||
|
||||
#define LOADER_PACKAGE2_KEY "package2"
|
||||
#define LOADER_EXOSPHERE_KEY "exosphere"
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
#include "utils.h"
|
||||
#include "nxboot.h"
|
||||
#include "loader.h"
|
||||
#include "splash_screen.h"
|
||||
|
||||
/* This is the main function responsible for booting Horizon. */
|
||||
void nxboot_main(void) {
|
||||
loader_ctx_t *loader_ctx = get_loader_ctx();
|
||||
|
||||
/* TODO: Implement this function. */
|
||||
|
||||
/* Display splash screen. */
|
||||
display_splash_screen_bmp(loader_ctx->custom_splash_path);
|
||||
}
|
17
fusee/fusee-secondary/src/splash_screen.c
Normal file
17
fusee/fusee-secondary/src/splash_screen.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include "utils.h"
|
||||
#include "splash_screen.h"
|
||||
#include "sd_utils.h"
|
||||
#include "lib/printk.h"
|
||||
#include "display/video_fb.h"
|
||||
|
||||
void display_splash_screen_bmp(const char *custom_splash_path) {
|
||||
unsigned char *splash_screen = g_default_splash_screen;
|
||||
if (custom_splash_path != NULL && custom_splash_path[0] != '\x00') {
|
||||
if (!read_sd_file(splash_screen, sizeof(g_default_splash_screen), custom_splash_path)) {
|
||||
printk("Error: Failed to read custom splash screen from %s!\n", custom_splash_path);
|
||||
generic_panic();
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: Display the splash screen. It should be a pointer to a BMP, at this point. */
|
||||
}
|
9
fusee/fusee-secondary/src/splash_screen.h
Normal file
9
fusee/fusee-secondary/src/splash_screen.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
#ifndef FUSEE_SPLASH_SCREEN_H
|
||||
#define FUSEE_SPLASH_SCREEN_H
|
||||
|
||||
/* TODO: Actually make this a real thing. */
|
||||
extern unsigned char g_default_splash_screen[1];
|
||||
|
||||
void display_splash_screen_bmp(const char *custom_splash_path);
|
||||
|
||||
#endif
|
3
fusee/fusee-secondary/src/splash_screen_default.c
Normal file
3
fusee/fusee-secondary/src/splash_screen_default.c
Normal file
|
@ -0,0 +1,3 @@
|
|||
#include "splash_screen.h"
|
||||
|
||||
unsigned char g_default_splash_screen[1] = {0};
|
Loading…
Reference in a new issue