summaryrefslogtreecommitdiff
path: root/include/z64font.h
blob: 481c69d578f7fdd562b1446d4671f4cf7c32ec95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef Z64FONT_H
#define Z64FONT_H

#include "PR/ultratypes.h"
#include "stdint.h"

struct PlayState;

#define FONT_CHAR_TEX_WIDTH 16
#define FONT_CHAR_TEX_HEIGHT 16
//! TODO: Make this use `sizeof(AnyFontTextureSymbol)`
#define FONT_CHAR_TEX_SIZE ((16 * 16) / 2) // 16x16 I4 texture

// Font textures are loaded into here
typedef struct Font {
    /* 0x00000 */ union {
        u8 charBuf[2][FONT_CHAR_TEX_SIZE * 120];
        u64 force_structure_alignment_charTex;
    };
    /* 0x07800 */ union {
        u8 iconBuf[FONT_CHAR_TEX_SIZE];
        u64 force_structure_alignment_icon;
    };
    /* 0x07880 */ union {
        u8 fontBuf[FONT_CHAR_TEX_SIZE * 320];
        u64 force_structure_alignment_font;
    };
    /* 0x11880 */ union {
        char schar[1280]; // msgBuf
        u16 wchar[640];   // msgBufWide
        u64 force_structure_alignment_msg;
    } msgBuf;
    /* 0x11D80 */ uintptr_t messageStart;
    /* 0x11D84 */ uintptr_t messageEnd;
    /* 0x11D88 */ u8 unk_11D88; // current Char Buffer ?
} Font; // size = 0x11D90

void Font_LoadChar(struct PlayState* play, u16 codePointIndex, s32 offset);
void Font_LoadCharNES(struct PlayState* play, u8 codePointIndex, s32 offset);
void Font_LoadMessageBoxEndIcon(Font* font, u16 icon);
void Font_LoadOrderedFont(Font* font);

#endif