#
C3SRCS = devsys.c mm.c swap.c usermem.c timer.c audio.c level2.c devinput.c
CVIDEOSRCS = vt.c
-CFONTSRCS = font4x6.c font6x8.c font8x8.c
+CFONTSRCS = font4x6.c font6x8.c font8x8.c font8x8_exp2.c
ASRCS = lowlevel-$(CPU)$(BANKED)$(ASMEXT) usermem_std-$(CPU)$(BANKED)$(ASMEXT)
version.c: tools/makeversion
tools/makeversion $(VERSION) $(SUBVERSION) $(TARGET)
+font8x8_exp2.c: font8x8.c tools/fontexpand
+ tools/fontexpand <font8x8.c >font8x8_exp2.c
+
tools/makeversion: tools/makeversion.c
tools/filesizes: tools/filesizes.c
tools/trslabel: tools/trslabel.c
+tools/fontexpand: tools/fontexpand.c
+
font4x6.c: tools/make4x6
tools/make4x6 >font4x6.c
--- /dev/null
+#include <stdio.h>
+#include <stdint.h>
+
+#define CONFIG_FONT8X8
+#define GENERATOR
+
+#include "../font8x8.c"
+
+uint16_t widen(uint8_t n)
+{
+ unsigned int i;
+ uint16_t r = 0;
+ /* We don't need performance so do the simple way */
+ for (i = 0; i < 8; i++) {
+ if (n & 0x80)
+ r |= 0x03;
+ n <<= 1;
+ r <<= 2;
+ }
+ return r;
+}
+
+char *boolstr(uint8_t n)
+{
+ static char buf[9];
+ unsigned int i;
+ for (i = 0; i < 8; i++) {
+ buf[i] = (n & 0x80) ? '1' : '0';
+ n <<= 1;
+ }
+ buf[8] = 0;
+ return buf;
+}
+
+
+int main(int argc, char *argv[])
+{
+ const uint8_t *p = fontdata_8x8;
+ unsigned int i;
+
+ puts("#include <config.h>\n#include <kernel.h>\n");
+ puts("#ifdef CONFIG_FONT_8X8_EXP2\n");
+ puts("/* Automatically generated do not edit */\n");
+ printf("const uint16_t fontdata_8x8_exp2[%d] = {\n", FONTDATAMAX);
+ for (i = 0; i < FONTDATAMAX; i++) {
+ if (!(i & 7))
+ printf("\t/* Character %u */\n", i >> 3);
+ printf("\t0x%04X,\t/* %s */\n", widen(*p), boolstr(*p));
+ if ((i & 7) == 7)
+ putchar('\n');
+ p++;
+ }
+ puts("/* End of font */\n};\n\n#endif");
+ return 0;
+}