From 6b5883f1f55248cc033c8b045df146a3f9aa2fc3 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Mon, 8 Jan 2024 16:42:34 +0000 Subject: [PATCH] Assetify crash font (#1140) * assetify crash font * bump pigment64 version * bump pigment ver * maybe fix * 2 * move to new img asset inclusion --------- Co-authored-by: Ethan --- src/crash_screen.c | 8 ++++++-- tools/build/configure.py | 2 +- ver/us/splat.yaml | 7 ++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/crash_screen.c b/src/crash_screen.c index 5b0c9bf8cb..6c6278d91f 100644 --- a/src/crash_screen.c +++ b/src/crash_screen.c @@ -3,6 +3,7 @@ #include "PR/os_internal_thread.h" #include "libc/xstdio.h" #include "gcc/string.h" +#include "include_asset.h" typedef struct { /* 0x000 */ OSThread thread; @@ -25,7 +26,9 @@ u8 gCrashScreencharToGlyph[128] = { 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, }; -// TODO extract? +#if VERSION_US +INCLUDE_IMG("crash_screen/font.png", gCrashScreenFont); +#else u32 gCrashScreenFont[] = { 0x70871C30, 0x8988A250, 0x88808290, 0x88831C90, 0x888402F8, 0x88882210, 0x71CF9C10, 0xF9CF9C70, 0x8228A288, 0xF200A288, 0x0BC11C78, 0x0A222208, 0x8A222288, 0x71C21C70, 0x23C738F8, 0x5228A480, 0x8A282280, 0x8BC822F0, @@ -36,6 +39,7 @@ u32 gCrashScreenFont[] = { 0x80020800, 0xF8011000, 0x70800000, 0x88822200, 0x08820400, 0x108F8800, 0x20821000, 0x00022200, 0x20800020, 0x00000000, }; +#endif const char* gFaultCauses[18] = { "Interrupt", @@ -104,7 +108,7 @@ void crash_screen_draw_rect(s32 x, s32 y, s32 width, s32 height) { void crash_screen_draw_glyph(s32 x, s32 y, s32 glyph) { s32 shift = ((glyph % 5) * 6); u16 width = gCrashScreen.width; - const u32* data = &gCrashScreenFont[glyph / 5 * 7]; + const u32* data = &((u32*)gCrashScreenFont)[glyph / 5 * 7]; s32 i; s32 j; diff --git a/tools/build/configure.py b/tools/build/configure.py index cc1a8a719f..1a846fc726 100755 --- a/tools/build/configure.py +++ b/tools/build/configure.py @@ -24,7 +24,7 @@ YAY0_COMPRESS_TOOL = f"{BUILD_TOOLS}/yay0/Yay0compress" CRC_TOOL = f"{BUILD_TOOLS}/rom/n64crc" PIGMENT = "pigment64" -PIGMENT_REQ_VERSION = "0.3.0" +PIGMENT_REQ_VERSION = "0.4.2" def exec_shell(command: List[str]) -> str: diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index ffc8cdc1e2..be632d7a05 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -369,7 +369,12 @@ segments: - [0x511E0, vtx, theater/wall_shadows_vtx] - [0x51260] - [0x51540, ia8, ui/no_controller, 128, 32] - - [auto, .data, crash_screen] + - start: auto + type: .data + name: crash_screen + subsegments: + - [0x52690, i1, crash_screen/font, 32, 64] + - [0x52790] - [auto, .data, os/nusys/nugfxtaskmgr] - [auto, .data, os/nusys/nusimgr] - [auto, .data, cam_math]