Improved splash screen

o including release / hourly links
o new SafeMode9 splash based on @Ordim3n's work
This commit is contained in:
d0k3 2017-03-10 13:47:16 +01:00
parent d1ab7602b9
commit 8957d74016
5 changed files with 18 additions and 16 deletions

BIN
data/sm9_splash_baby.qlz Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -40,15 +40,20 @@
#define ENTRY_BRAHMA (1)
#define ENTRY_GATEWAY (2)
// GodMode9 / SafeMode9 ("flavor")
// GodMode9 / SafeMode9 ("flavor" / splash screen)
#ifndef SAFEMODE
#define FLAVOR "GodMode9"
#define QLZ_SPLASH_H "gm9_splash_qlz.h"
#define QLZ_SPLASH gm9_splash_qlz
#else
#define FLAVOR "SafeMode9"
#define QLZ_SPLASH_H "sm9_splash_baby_qlz.h"
#define QLZ_SPLASH sm9_splash_baby_qlz
#endif
// GodMode9 version
#define VERSION "1.0.4"
#define VERSION "1.0.5"
// Maximum payload size (arbitrary value!)
#define SELF_MAX_SIZE (320 * 1024) // 320kB

View File

@ -71,7 +71,9 @@ void DrawCharacter(u8* screen, int character, int x, int y, int color, int bgcol
void DrawString(u8* screen, const char *str, int x, int y, int color, int bgcolor)
{
for (size_t i = 0; i < strlen(str); i++)
size_t max_len = (((screen == TOP_SCREEN) ? SCREEN_WIDTH_TOP : SCREEN_WIDTH_BOT) - x) / FONT_WIDTH;
size_t len = (strlen(str) > max_len) ? max_len : strlen(str);
for (size_t i = 0; i < len; i++)
DrawCharacter(screen, str[i], x + i * FONT_WIDTH, y, color, bgcolor);
}

View File

@ -19,14 +19,7 @@
#include "chainload.h"
#include "qlzcomp.h"
#include "timer.h"
#ifndef SAFEMODE
#include "gm9_splash_qlz.h"
#define QLZ_SPLASH gm9_splash_qlz
#else
#include "sm9_splash_qlz.h"
#define QLZ_SPLASH sm9_splash_qlz
#endif
#include QLZ_SPLASH_H
#define N_PANES 2
@ -1139,8 +1132,11 @@ u32 SplashInit() {
ClearScreenF(true, true, COLOR_STD_BG);
QlzDecompress(TOP_SCREEN, QLZ_SPLASH, 0);
DrawStringF(BOT_SCREEN, pos_xb, pos_yb, COLOR_STD_FONT, COLOR_STD_BG, "%s\n%*.*s\n%s", namestr, strnlen(namestr, 64), strnlen(namestr, 64),
"------------------------------", "https://github.com/d0k3/GodMode9");
DrawStringF(BOT_SCREEN, pos_xb, pos_yb, COLOR_STD_FONT, COLOR_STD_BG, "%s\n%*.*s\n%s\n \n%s\n%s\n \n%s\n%s",
namestr, strnlen(namestr, 64), strnlen(namestr, 64),
"------------------------------", "https://github.com/d0k3/GodMode9",
"Releases:", "https://github.com/d0k3/GodMode9/releases/", // this won't fit with a 8px width font
"Hourlies:", "https://d0k3.secretalgorithm.com/");
DrawStringF(BOT_SCREEN, pos_xu, pos_yu, COLOR_STD_FONT, COLOR_STD_BG, loadstr);
return 0;
@ -1176,9 +1172,8 @@ u32 GodMode() {
InitNandCrypto();
InitExtFS();
// do this now so we don't have to do it later
// this takes long - do it while splash is displayed
GetFreeSpace("0:");
InitVCartDrive();
// could also check for a9lh via this: ((*(vu32*) 0x101401C0) == 0)
if ((!IS_O3DS) && !CheckSlot0x05Crypto()) {