diff options
Diffstat (limited to 'code/fe310/eos/eve/screen/font.c')
-rw-r--r-- | code/fe310/eos/eve/screen/font.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/code/fe310/eos/eve/screen/font.c b/code/fe310/eos/eve/screen/font.c index 26e7cf0..1be462d 100644 --- a/code/fe310/eos/eve/screen/font.c +++ b/code/fe310/eos/eve/screen/font.c @@ -4,14 +4,21 @@ #include "font.h" void eve_font_init(EVEFont *font, uint8_t font_id) { + uint32_t p; + + p = eve_read32(EVE_ROM_FONT_ADDR); + p += (148 * (font_id - 16)); font->id = font_id; + font->w = eve_read32(p + 136); + font->h = eve_read32(p + 140); + eve_readb(p, font->w_ch, 128); } uint16_t eve_font_string_width(EVEFont *font, char *s) { uint16_t r = 0; while (*s) { - r += font->w[*s]; + r += font->w_ch[*s]; s++; } return r; |