diff --git a/data/sm9_splash_baby.qlz b/data/sm9_splash_baby.qlz new file mode 100644 index 0000000..d2503e0 Binary files /dev/null and b/data/sm9_splash_baby.qlz differ diff --git a/resources/sm9_splash_baby.png b/resources/sm9_splash_baby.png new file mode 100644 index 0000000..19e8bd7 Binary files /dev/null and b/resources/sm9_splash_baby.png differ diff --git a/source/common/common.h b/source/common/common.h index c3d745a..56051b2 100644 --- a/source/common/common.h +++ b/source/common/common.h @@ -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 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 diff --git a/source/common/ui.c b/source/common/ui.c index ca4ff3a..21aedf3 100644 --- a/source/common/ui.c +++ b/source/common/ui.c @@ -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); } diff --git a/source/godmode.c b/source/godmode.c index cd06691..915363c 100644 --- a/source/godmode.c +++ b/source/godmode.c @@ -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()) {