From df32deb2e40c1bddf2441d4681486b8b2e3fc004 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Mon, 7 Jun 2021 19:27:34 +0200 Subject: Change font used to a custom mixed font --- src/text/font.h | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/text/text.h | 4 +- 2 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 src/text/font.h (limited to 'src/text') diff --git a/src/text/font.h b/src/text/font.h new file mode 100644 index 0000000..65579b8 --- /dev/null +++ b/src/text/font.h @@ -0,0 +1,137 @@ +static const u32 font[] = { + 0x00000000, 0x00000000, 0x00002400, 0x423c0000, + 0x00002400, 0x3c420000, 0x0000363e, 0x3e1c0800, + 0x00081c3e, 0x3e1c0800, 0x001c1c3e, 0x363e081c, + 0x00081c3e, 0x3e3e081c, 0x00000018, 0x18000000, + 0x7e7e7e66, 0x667e7e7e, 0x00001824, 0x24180000, + 0x7e7e665a, 0x5a667e7e, 0x00081c3e, 0x081c221c, + 0x001c221c, 0x08083e08, 0x00183828, 0x08080c0c, + 0x003c2424, 0x24343606, 0x00082208, 0x1c082208, + 0x040c1c3c, 0x1c0c0400, 0x2030383c, 0x38302000, + 0x081c3e08, 0x083e1c08, 0x00141414, 0x14001400, + 0x003c2a2a, 0x2c282828, 0x0038043c, 0x423c201e, + 0x00000000, 0x7e000000, 0x081c3e08, 0x3e1c083e, + 0x00081c3e, 0x08080800, 0x00080808, 0x3e1c0800, + 0x00001030, 0x7e301000, 0x0000080c, 0x7e0c0800, + 0x00000000, 0x0002023e, 0x00001436, 0x7f361400, + 0x0008081c, 0x1c3e3e00, 0x003e3e1c, 0x1c080800, + 0x00000000, 0x00000000, 0x00080808, 0x08000800, + 0x00141414, 0x00000000, 0x0000143e, 0x143e1400, + 0x00081c02, 0x1c201e08, 0x00002616, 0x08343200, + 0x00081408, 0x34122c00, 0x00080808, 0x00000000, + 0x00000804, 0x04040800, 0x00000810, 0x10100800, + 0x00001408, 0x3e081400, 0x00000808, 0x3e080800, + 0x00000000, 0x000c0804, 0x00000000, 0x3e000000, + 0x00000000, 0x000c0c00, 0x00203018, 0x0c060200, + 0x00001c22, 0x2a221c00, 0x00000c0a, 0x08083e00, + 0x00001c20, 0x1c023e00, 0x00001c22, 0x18221c00, + 0x00001212, 0x123e1000, 0x00003e02, 0x1e201e00, + 0x00001c02, 0x1e221c00, 0x00003e20, 0x10080400, + 0x00001c22, 0x1c221c00, 0x00001c22, 0x3c201c00, + 0x00000c0c, 0x000c0c00, 0x00000c0c, 0x000c0804, + 0x00001008, 0x04081000, 0x0000003e, 0x003e0000, + 0x00000408, 0x10080400, 0x001c2210, 0x08000800, + 0x00001c2a, 0x3a021c00, 0x00001c22, 0x223e2200, + 0x00001e22, 0x1e221e00, 0x00001c22, 0x02221c00, + 0x00001e22, 0x22221e00, 0x00003e02, 0x1e023e00, + 0x00003e02, 0x1e020200, 0x00001c02, 0x32221c00, + 0x00002222, 0x3e222200, 0x00003e08, 0x08083e00, + 0x00002020, 0x20221c00, 0x00002212, 0x0e122200, + 0x00000202, 0x02023e00, 0x00002236, 0x2a222200, + 0x0000262a, 0x32222200, 0x00001c22, 0x22221c00, + 0x00001e22, 0x221e0200, 0x00001c22, 0x22122c00, + 0x00001e22, 0x221e2200, 0x00001c02, 0x1c201e00, + 0x00003e08, 0x08080800, 0x00002222, 0x22221c00, + 0x00002222, 0x22140800, 0x0000222a, 0x2a2a1400, + 0x00002214, 0x08142200, 0x00002222, 0x14080800, + 0x00003e10, 0x08043e00, 0x00001c04, 0x04041c00, + 0x0002060c, 0x18302000, 0x00001c10, 0x10101c00, + 0x00081422, 0x00000000, 0x00000000, 0x00003e00, + 0x00040810, 0x00000000, 0x00001c20, 0x3c223c00, + 0x0002021e, 0x22221e00, 0x00001c02, 0x02021c00, + 0x0020203c, 0x22223c00, 0x00001c22, 0x1e021c00, + 0x00003c02, 0x1e020200, 0x00003c22, 0x223c201c, + 0x0002021e, 0x22222200, 0x0008000c, 0x08083e00, + 0x00200020, 0x2020221c, 0x0002120a, 0x060a3200, + 0x000c0808, 0x08083e00, 0x0000162a, 0x2a2a2a00, + 0x00000e32, 0x22222200, 0x00001c22, 0x22221c00, + 0x00001e22, 0x221e0202, 0x00003c22, 0x223c2070, + 0x00001a26, 0x02020200, 0x00001c02, 0x1c201e00, + 0x00043e04, 0x04041800, 0x00002222, 0x22221c00, + 0x00002222, 0x22140800, 0x00002222, 0x2a2a1400, + 0x00002214, 0x08142200, 0x00002222, 0x223c201c, + 0x00003e10, 0x08043e00, 0x00001c04, 0x06041c00, + 0x00000808, 0x08080800, 0x00001c10, 0x30101c00, + 0x00002c1a, 0x00000000, 0x00000814, 0x22223e00, + 0x00001c14, 0x14141c00, 0x0000080c, 0x08081c00, + 0x00001c10, 0x1c041c00, 0x00001c10, 0x18101c00, + 0x00001414, 0x1c101000, 0x00001c04, 0x1c101c00, + 0x00001c04, 0x1c141c00, 0x00001c10, 0x08040400, + 0x00001c14, 0x1c141c00, 0x00001c14, 0x1c101000, + 0x00001c14, 0x141c1400, 0x00001c14, 0x0c141c00, + 0x00001c04, 0x04041c00, 0x00000c14, 0x14140c00, + 0x00001c04, 0x0c041c00, 0x00001c04, 0x0c040400, + 0x00001c04, 0x14141c00, 0x00001414, 0x1c141400, + 0x00001c08, 0x08081c00, 0x00001010, 0x10141c00, + 0x00001414, 0x0c141400, 0x00000404, 0x04041c00, + 0x0000141c, 0x14141400, 0x00000c14, 0x14141400, + 0x00000c14, 0x14141c00, 0x00001c14, 0x1c040400, + 0x00001c14, 0x141c1000, 0x00001c14, 0x0c141400, + 0x00001804, 0x1c100c00, 0x00001c08, 0x08080800, + 0x00001414, 0x14141c00, 0x00001414, 0x14141800, + 0x00001414, 0x141c1400, 0x00001414, 0x08141400, + 0x00001414, 0x1c080800, 0x00001c10, 0x08041c00, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x3e323232, 0x32323e00, 0x18181818, 0x18181800, + 0x3e30303e, 0x06063e00, 0x3e30303c, 0x30303e00, + 0x32323232, 0x3e303000, 0x3e06063e, 0x30303e00, + 0x3e06063e, 0x26263e00, 0x3e303018, 0x0c060600, + 0x3e32323e, 0x32323e00, 0x3e32323e, 0x30303e00, + 0x00000000, 0x00060600, 0x00263618, 0x0c363200, + 0x1c3e3232, 0x3e323200, 0x1e26261e, 0x26261e00, + 0x3c060606, 0x06063c00, 0x1e323232, 0x32321e00, + 0x3e06061e, 0x06063e00, 0x3e06061e, 0x06060600, + 0x3c060636, 0x26261c00, 0x3232323e, 0x32323200, + 0x1e0c0c0c, 0x0c0c1e00, 0x30303030, 0x32323e00, + 0x2626160e, 0x16262600, 0x06060606, 0x06063e00, + 0x62767e6a, 0x62626200, 0x363e3a32, 0x32323200, + 0x1c323232, 0x32321c00, 0x3e32323e, 0x02020200, + 0x1c323232, 0x3a1a2c00, 0x1e26261e, 0x26262600, + 0x3c06061e, 0x30301e00, 0x7e181818, 0x18181800, + 0x32323232, 0x32323e00, 0x32323232, 0x32341800, + 0x32323232, 0x323a1400, 0x3232320c, 0x32323200, + 0x32323232, 0x3c201e00, 0x3e30301c, 0x06063e00, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +u16 palette[16] = { + 0x7fff, 0x0000, 0x7fff, 0x7fff, + 0x7fff, 0x7fff, 0x7fff, 0x7fff, + 0x7fff, 0x7fff, 0x7fff, 0x7fff, + 0x7fff, 0x7fff, 0x7fff, 0x7fff, +}; diff --git a/src/text/text.h b/src/text/text.h index 3b7921d..01dddb0 100644 --- a/src/text/text.h +++ b/src/text/text.h @@ -4,7 +4,7 @@ #include "posprintf.h" #include "renderer.h" -#include "bd-font.c" +#include "font.h" typedef struct TextEngine { // Cursor for tiled text mode The X and Y positions correspond to the tile @@ -30,7 +30,7 @@ static inline void txt_init(u32 *font_data, u16 *font_tilemap, u16 font_offset) { // Load font data into VRAM. - unpack_tiles(&bd_font, font_data, 256); + unpack_tiles(&font, font_data, 256); // Initialize the font map translation table. That way we can write // a character on the text background layer with: -- cgit v1.2.1