From 2ff7320409d1f6340bed2ea37b7ceb3a49a57525 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Wed, 22 Sep 2021 22:50:35 -0300 Subject: `ovl_daytelop` OK (#277) * eeeee * nonequivalents * draw * Import data * Match Daytelop_LoadGraphics * draw kinda better * extract daytelops and gameover * SEGMENT_ROM macros * Use extracted symbols for daytelop * match Daytelop_Draw * Fix bss * draw cleanup * Daytelop_Update from non equivalent to non matching * Some renames and spec * Run formatter * enum * sfx * Use SEGMENT_ROM_START macros everywhere * more macros * run formatter * Add description * update variables.txt * Remove extra stuff in gbi.h * Would this fix it? * and again * whoops * Apply suggestions from code review Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> * Tharo's suggestions * match Daytelop_Update * run formatter * fix merge issues Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> --- src/code/z_kanfont.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/code/z_kanfont.c') diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c index f85911fc6..b678642b1 100644 --- a/src/code/z_kanfont.c +++ b/src/code/z_kanfont.c @@ -9,12 +9,13 @@ void Font_LoadCharNES(GlobalContext* globalCtx, u8 codePointIndex, s32 offset) { Font* font = &msgCtx->font; DmaMgr_SendRequest0(&font->charBuf[font->unk_11D88][offset], - &_nes_font_staticSegmentRomStart[(codePointIndex - ' ') * FONT_CHAR_TEX_SIZE], + &((u8*)SEGMENT_ROM_START(nes_font_static))[(codePointIndex - ' ') * FONT_CHAR_TEX_SIZE], FONT_CHAR_TEX_SIZE); } void Font_LoadMessageBoxEndIcon(Font* font, u16 icon) { - DmaMgr_SendRequest0(&font->iconBuf, &_message_staticSegmentRomStart[5 * 0x1000 + icon * FONT_CHAR_TEX_SIZE], + DmaMgr_SendRequest0(&font->iconBuf, + &((u8*)SEGMENT_ROM_START(message_static))[5 * 0x1000 + icon * FONT_CHAR_TEX_SIZE], FONT_CHAR_TEX_SIZE); } @@ -36,7 +37,8 @@ void Font_LoadOrderedFont(Font* font) { loadOffset = 0; } // UB to convert pointer to u32 - DmaMgr_SendRequest0(writeLocation, (u32)_nes_font_staticSegmentRomStart + loadOffset, FONT_CHAR_TEX_SIZE); + DmaMgr_SendRequest0(writeLocation, (uintptr_t)SEGMENT_ROM_START(nes_font_static) + loadOffset, + FONT_CHAR_TEX_SIZE); if (sFontOrdering[codePointIndex] == 0x8C) { break; } -- cgit v1.2.3