summaryrefslogtreecommitdiff
path: root/src/code/z_kanfont.c
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2021-09-22 22:50:35 -0300
committerGitHub <noreply@github.com>2021-09-22 21:50:35 -0400
commit2ff7320409d1f6340bed2ea37b7ceb3a49a57525 (patch)
tree8cb503aa65a39dfc9b3318d07bd1e49b31da2ea7 /src/code/z_kanfont.c
parenta59943bc4aee376eca48cbee429af75153b28570 (diff)
`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>
Diffstat (limited to 'src/code/z_kanfont.c')
-rw-r--r--src/code/z_kanfont.c8
1 files changed, 5 insertions, 3 deletions
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;
}