From 84bfac6a1b1b7a8d8f53ac5c3756b29a11a3023f Mon Sep 17 00:00:00 2001 From: d0k3 Date: Tue, 27 Feb 2018 00:00:57 +0100 Subject: [PATCH] Allow overriding the default font via gm9/support/font.pbm --- arm9/source/godmode.c | 12 +++++++++++- arm9/source/system/vram0.h | 2 +- data/{font.pbm => font_default.pbm} | Bin 3 files changed, 12 insertions(+), 2 deletions(-) rename data/{font.pbm => font_default.pbm} (100%) diff --git a/arm9/source/godmode.c b/arm9/source/godmode.c index e43fb26..4078760 100644 --- a/arm9/source/godmode.c +++ b/arm9/source/godmode.c @@ -1946,6 +1946,16 @@ u32 GodMode(int entrypoint) { InitNandCrypto(entrypoint != ENTRY_B9S); InitExtFS(); + // custom font handling + if (CheckSupportFile("font.pbm")) { + u8* pbm = (u8*) malloc(0x10000); // arbitrary, should be enough by far + if (pbm) { + u32 pbm_size = LoadSupportFile("font.pbm", pbm, 0x10000); + if (pbm_size) SetFontFromPbm(pbm, pbm_size); + free(pbm); + } + } + // check for embedded essential backup if (((entrypoint == ENTRY_NANDBOOT) || (entrypoint == ENTRY_B9S)) && !PathExist("S:/essential.exefs") && CheckGenuineNandNcsd() && @@ -2310,7 +2320,7 @@ u32 GodMode(int entrypoint) { ShowPrompt(false, "Not allowed in XORpad drive"); } else if ((curr_drvtype & DRV_CART) && (pad_state & BUTTON_Y)) { ShowPrompt(false, "Not allowed in gamecart drive"); - }else if (pad_state & BUTTON_Y) { // paste files + } else if (pad_state & BUTTON_Y) { // paste files const char* optionstr[2] = { "Copy path(s)", "Move path(s)" }; char promptstr[64]; u32 flags = 0; diff --git a/arm9/source/system/vram0.h b/arm9/source/system/vram0.h index 4c4697a..90e07a9 100644 --- a/arm9/source/system/vram0.h +++ b/arm9/source/system/vram0.h @@ -6,7 +6,7 @@ // known file names inside VRAM0 TAR #define VRAM0_AUTORUN_GM9 "autorun.gm9" -#define VRAM0_FONT_PBM "font.pbm" +#define VRAM0_FONT_PBM "font_default.pbm" #define VRAM0_SCRIPTS "scripts" #define VRAM0_README_MD "README.md" #define VRAM0_SPLASH_PCX FLAVOR "_splash.pcx" diff --git a/data/font.pbm b/data/font_default.pbm similarity index 100% rename from data/font.pbm rename to data/font_default.pbm