1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-24 11:16:11 +00:00

Add skeleton architecture for displaying custom splash screen

This commit is contained in:
Michael Scire 2018-04-10 16:09:00 -06:00
parent 87605563d2
commit 9fadec60c5
6 changed files with 40 additions and 0 deletions

View file

@ -136,6 +136,8 @@ static int loadlist_ini_handler(void *user, const char *section, const char *nam
/* Read in entrypoint as a hex string. */ /* Read in entrypoint as a hex string. */
sscanf(value, "%x", &x); sscanf(value, "%x", &x);
loader_ctx->chainload_entrypoint = (entrypoint_t)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 { } else {
return 0; return 0;
} }

View file

@ -18,10 +18,12 @@ typedef struct {
load_file_t exosphere_loadfile; load_file_t exosphere_loadfile;
load_file_t tsecfw_loadfile; load_file_t tsecfw_loadfile;
load_file_t warmboot_loadfile; load_file_t warmboot_loadfile;
char custom_splash_path[0x300];
} loader_ctx_t; } loader_ctx_t;
#define LOADER_ENTRYPOINT_KEY "entrypoint" #define LOADER_ENTRYPOINT_KEY "entrypoint"
#define LOADER_LOADLIST_KEY "loadlist" #define LOADER_LOADLIST_KEY "loadlist"
#define LOADER_CUSTOMSPLASH_KEY "custom_splash"
#define LOADER_PACKAGE2_KEY "package2" #define LOADER_PACKAGE2_KEY "package2"
#define LOADER_EXOSPHERE_KEY "exosphere" #define LOADER_EXOSPHERE_KEY "exosphere"

View file

@ -1,7 +1,14 @@
#include "utils.h" #include "utils.h"
#include "nxboot.h" #include "nxboot.h"
#include "loader.h"
#include "splash_screen.h"
/* This is the main function responsible for booting Horizon. */ /* This is the main function responsible for booting Horizon. */
void nxboot_main(void) { void nxboot_main(void) {
loader_ctx_t *loader_ctx = get_loader_ctx();
/* TODO: Implement this function. */ /* TODO: Implement this function. */
/* Display splash screen. */
display_splash_screen_bmp(loader_ctx->custom_splash_path);
} }

View 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. */
}

View 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

View file

@ -0,0 +1,3 @@
#include "splash_screen.h"
unsigned char g_default_splash_screen[1] = {0};