From ac38209289d22e47d602d116ff50b68008be186b Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 16 Feb 2024 14:45:44 +0100 Subject: [PATCH] start moving data to all.c --- payload/data/all.s | 23 +---------------------- payload/ld_script.txt | 1 + payload/src/all.c | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/payload/data/all.s b/payload/data/all.s index b1592f6..1b442db 100644 --- a/payload/data/all.s +++ b/payload/data/all.s @@ -13,28 +13,7 @@ .endm .section .rodata - .align 2, 0 -gFont0LatinInfo:: - .byte 2 @ bg - .byte 4 @ left - .byte 15 @ top - .byte 22 @ width - .byte 4 @ height - .align 1 - .2byte 0x0020 @ base block - .byte 0x0F @ bg color - .byte 0x10 @ glyph size - .align 2 - .4byte 0x06008400 @ char addr - .4byte gFont0LatinGfx @ gfx - .4byte gFont0LatinWidths @ glyph widths - .byte 0 @ fg color - .byte 0 @ shadow color - .byte 0 @ current X - .byte 0 @ current Y - .byte 0 @ glyph fixed width - .byte 0 @ start X - .byte 0 @ start Y + .align 2, 0 gFont0LatinGfx:: diff --git a/payload/ld_script.txt b/payload/ld_script.txt index bdbd4fa..05463f4 100644 --- a/payload/ld_script.txt +++ b/payload/ld_script.txt @@ -54,6 +54,7 @@ SECTIONS { .rodata : ALIGN(4) { + src/all.o(.rodata); data/all.o(.rodata); src/strings.o(.rodata); src/graphics.o(.rodata); diff --git a/payload/src/all.c b/payload/src/all.c index 8734cd4..37f212f 100644 --- a/payload/src/all.c +++ b/payload/src/all.c @@ -145,6 +145,29 @@ u32 sub_020064B0(void); bool32 sub_02005704(u32); bool32 IsMonFainted(u32 monId); +// const data +const struct Window gFont0LatinInfo = +{ + .bg = 2, + .left = 4, + .top = 15, + .width = 22, + .height = 4, + .baseBlock = 0x20, + .fillValue = 0xF, + .glyphSize = 0x10, + .vramCharBase = (void *) VRAM + 0x08400, + .glyphGfx = gFont0LatinGfx, + .glyphWidths = gFont0LatinWidths, + .fgColor = 0, + .shadowColor = 0, + .currentX = 0, + .currentY = 0, + .glyphWidth = 0, + .startX = 0, + .startY = 0, +}; + // This file's functions. void RenderText(struct Window *win, const u8 *str) {