]> Chaos Git - corbenik/corbenik.git/commitdiff
Font loading is working...
authorroot <chaos.kagami@gmail.com>
Wed, 15 Jun 2016 20:16:47 +0000 (16:16 -0400)
committerroot <chaos.kagami@gmail.com>
Wed, 15 Jun 2016 20:16:47 +0000 (16:16 -0400)
but there's a slight problem. I didn't expect to hit the menus' max size so
I neglected to implement a window size to display. This needs to be fixed
before any of this code can be used.

13 files changed:
Makefile
host/conv-font-bin.sh [new file with mode: 0755]
host/font-emit.c [new file with mode: 0644]
source/common.h
source/firm/fcram.h
source/firm/firm.c
source/main.c
source/menu.c
source/std/abort.h
source/std/draw.c
source/std/draw.h
source/std/font.h [deleted file]
source/std/fs.c

index e2e1880c7e2c2da78770004083b4a5a146ed06bd..371d4a3b7b1689fa3cc0993e90d959d323f2db96 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,11 +34,18 @@ objects_cfw = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
                          $(call rwildcard, $(dir_source), *.s *.c)))
 
 .PHONY: all
-all: hosttools a9lh patch external
+all: hosttools font a9lh patch external
 
 .PHONY: hosttools
+hosttools:
        make -C host/bdfe
 
+.PHONY: font
+font: hosttools
+       ./host/conv-font-bin.sh
+       mkdir -p out/corbenik/bits
+       cp host/termfont.bin out/corbenik/bits/
+
 .PHONY: full
 full: all contrib out/corbenik/locale
        cp README.md LICENSE.txt out/
@@ -73,7 +80,7 @@ out/corbenik/locale: all
 
 .PHONY: clean
 clean:
-       rm -f host/langemu.conf
+       rm -f host/{font-emit,font.h,font_prop.h,termfont.bin}
        make -C external clean
        make -C patch clean
        rm -rf $(dir_out) $(dir_build)
diff --git a/host/conv-font-bin.sh b/host/conv-font-bin.sh
new file mode 100755 (executable)
index 0000000..c99b0d9
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+if [ "${CC}" == "" ]; then
+       CC=gcc
+fi
+
+set -e
+
+./host/bdfe/bdfe native header verbose all external/tewi-font/tewi-medium-11.bdf > host/font.h
+grep "// Converted Font Size" host/font.h | sed -e 's|.* ||g' \
+       -e 's|^|const int font_width = |g' \
+       -e 's|x|;\nconst int font_height = |g' \
+       -e 's|$|;|g' > host/font_prop.h
+${CC} ${CFLAGS} -o host/font-emit host/font-emit.c
+./host/font-emit
diff --git a/host/font-emit.c b/host/font-emit.c
new file mode 100644 (file)
index 0000000..8a6a64a
--- /dev/null
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static const unsigned char font_data[] = {
+#include "font.h"
+};
+#include "font_prop.h"
+
+int main() {
+       FILE* f = fopen("host/termfont.bin", "wb");
+    fwrite(&font_width, 1, 4, f);
+    fwrite(&font_height, 1, 4, f);
+    fwrite(font_data, 1, sizeof(font_data), f);
+    fclose(f);
+    return 0;
+}
index b582b6127b976be451b6308cee5e92631080fcfb..7c0845e09905ead7e271b192459e177e5d0ee5ac 100644 (file)
@@ -3,7 +3,6 @@
 
 #include "std/types.h"
 #include "std/draw.h"
-#include "std/font.h"
 #include "std/fs.h"
 #include "std/memory.h"
 #include "std/abort.h"
index 5c7afac8744a20c42f39a7f32eb4683a0c475da0..6c4395fab8c0f08e42a171d5a05d250509553829 100644 (file)
@@ -33,4 +33,7 @@ extern void *fcram_temp;
 // Path that the patch enable list is located at.
 #define FCRAM_PATCHLIST_LOC (FCRAM_MENU_LOC + (FCRAM_SPACING / 2))
 
+// Path that the font will be loaded at.
+#define FCRAM_FONT_LOC (FCRAM_PATCHLIST_LOC + (FCRAM_SPACING / 2))
+
 #endif
index b46e50659fb885f1778867e4cc285f82af7a49f8..729e8ae2cd08357c4766405378b222ed05b26651 100644 (file)
@@ -335,6 +335,8 @@ boot_firm()
     clear_disp(BOTTOM_SCREEN);
     set_cursor(BOTTOM_SCREEN, 0, 0);
 
+    fflush(stderr); // Flush logs if need be before unmount.
+
     fumount(); // Unmount SD. No longer needed.
 
     // No fprintf will work from here on out.
index 0034e127c5bf7402771c1758332485351e9a94f6..9600741b494623995542fa6e13738982884b972d 100644 (file)
@@ -21,6 +21,8 @@ main()
     int c = fmount();
     screen_init();
 
+    set_font(PATH_BITS "/termfont.bin");
+
     if (c) {
         // Failed to mount SD. Bomb out.
         abort("Failed to mount SD card.\n");
index 4e27199435b73e403e67cf4d2044d79f02a788c3..8dd2344a76ebaeeb56eadd8aa41241b6c22a6d36 100644 (file)
@@ -258,8 +258,6 @@ menu_help()
                     "  @d0k3, @TuxSH, @Steveice10, @delebile,\n"
                     "  @Normmatt, @b1l1s, @dark-samus, @TiniVi, etc\n"
                     "\n"
-                    "[PROTECT BREAK] DATA DRAIN: OK\n"
-                    "\n"
                     " <https://github.com/chaoskagami/corbenik>\n"
                     "\n");
 
@@ -272,6 +270,8 @@ menu_help()
 void
 reset()
 {
+    fflush(stderr);
+
     fumount(); // Unmount SD.
 
     // Reboot.
@@ -284,6 +284,8 @@ reset()
 void
 poweroff()
 {
+    fflush(stderr);
+
     fumount(); // Unmount SD.
 
     // Reboot.
index 1d03ab78c92b74e879d3bb7181673541c2480ffa..b0e0bca9e7b6ce362951cba0091c84382cc44dcd 100644 (file)
@@ -9,7 +9,7 @@ uint32_t wait_key(int sleep);
 #define abort(x...)                                                                                                                                            \
     {                                                                                                                                                          \
         fprintf(stderr, x);                                                                                                                                    \
-        wait_key(1);                                                                                                                                            \
+        wait_key(1);                                                                                                                                           \
         clear_disp(stderr);                                                                                                                                    \
         set_cursor(stderr, 0, 0);                                                                                                                              \
         poweroff();                                                                                                                                            \
index 7901e1f775f4e37d3bbe1a8315f46cb81c76679b..425d6f319c573bdeb7f35839dfd5041bafe27e38 100644 (file)
@@ -4,8 +4,8 @@
 #include <assert.h>
 #include <stdarg.h>
 #include "memory.h"
-#include "font.h"
 #include "../fatfs/ff.h"
+#include "../firm/fcram.h"
 #include "fs.h"
 #include "unused.h"
 #include "../config.h"
 static unsigned int top_cursor_x = 0, top_cursor_y = 0;
 static unsigned int bottom_cursor_x = 0, bottom_cursor_y = 0;
 
-static char text_buffer_bottom[TEXT_BOTTOM_HEIGHT * TEXT_BOTTOM_WIDTH + 1];
+static size_t  log_size = 0;
+static char    log_buffer[4096]; // Log buffer.
 
-#ifdef BUFFER
-static char text_buffer_top[TEXT_TOP_HEIGHT * TEXT_TOP_WIDTH + 1];
-static char color_buffer_top[TEXT_TOP_HEIGHT * TEXT_TOP_WIDTH + 1];
-static char color_buffer_bottom[TEXT_BOTTOM_HEIGHT * TEXT_BOTTOM_WIDTH + 1];
-#endif
+static unsigned int font_w = 8;
+static unsigned int font_h = 8;
+static unsigned int font_kern = 0;
+
+static unsigned int text_top_width = 20;
+static unsigned int text_top_height = 10;
+
+static unsigned int text_bottom_width = 20;
+static unsigned int text_bottom_height = 10;
+
+void set_font(const char* filename) {
+    // TODO - Unicode support. Right now, we only load 32
+
+    FILE* f = fopen(filename, "r");
+
+    if (!f) return;
+
+    unsigned int new_w, new_h;
+
+    fread(&new_w, 1, 4, f);
+    fread(&new_h, 1, 4, f);
+
+    if (new_w == 0 || new_h == 0) {
+        fprintf(stderr, "Invalid font file: w/h is 0 - not loaded\n");
+        return;
+    }
+
+    unsigned int c_font_w = (new_w / 8) + (new_w % 8 ? 1 : 0);
+
+    fread((void*)FCRAM_FONT_LOC, 1, c_font_w * new_h * (256 - ' '), f); // Skip non-printing chars.
+
+    fclose(f);
+
+    font_w = new_w;
+    font_h = new_h;
+
+    text_top_width  = TOP_WIDTH  / (font_w + font_kern);
+    text_top_height = TOP_HEIGHT / font_h;
+
+    text_bottom_width  = BOTTOM_WIDTH / (font_w + font_kern);
+    text_bottom_height = BOTTOM_HEIGHT / font_h;
+}
 
 static uint32_t colors[16] = {
     0x000000, // Black
@@ -39,44 +77,29 @@ static uint32_t colors[16] = {
     0xff55ff, // Bright megenta
     0x55ffff, // Yellow
     0xffffff  // White
-};
+}; // VGA color table.
 
-void
-clear_disp(uint8_t *screen)
-{
-    // There's a reason the logging code is here rather than putc:
-    // writing a batch is faster.
-    if (screen == BOTTOM_SCREEN && config.options[OPTION_SAVE_LOGS]) {
-        FILE *f = fopen(PATH_CFW "/boot.log", "w");
-        fseek(f, 0, SEEK_END);
-        for (int i = 0; i < TEXT_BOTTOM_HEIGHT - 1; i++) {
-            char *text = &text_buffer_bottom[TEXT_BOTTOM_WIDTH * i];
-            for (int j = 0; j < TEXT_BOTTOM_WIDTH; j++) {
-                if (text[j] == 0)
-                    text[j] = ' ';
-            }
-            fwrite(text, 1, strnlen(text, TEXT_BOTTOM_WIDTH), f);
-            fwrite("\n", 1, 1, f);
-        }
-        fclose(f);
-        memset(text_buffer_bottom, 0, TEXT_BOTTOM_WIDTH * TEXT_BOTTOM_HEIGHT);
-    }
+void dump_log(unsigned int force) {
+    if(!config.options[OPTION_SAVE_LOGS])
+        return;
 
-    if (screen == TOP_SCREEN)
-        screen = framebuffers->top_left;
-    else if (screen == BOTTOM_SCREEN)
-        screen = framebuffers->bottom;
+    if (force == 0 && log_size < sizeof(log_buffer)-1)
+        return;
 
-    if (screen == framebuffers->top_left || screen == framebuffers->top_right) {
-        memset(screen, 0, SCREEN_TOP_SIZE);
-    } else if (screen == framebuffers->bottom) {
-        memset(screen, 0, SCREEN_BOTTOM_SIZE);
-    }
+    if (log_size == 0)
+        return;
+
+    FILE *f = fopen(PATH_CFW "/boot.log", "w");
+    fseek(f, 0, SEEK_END);
+
+    fwrite(log_buffer, 1, log_size, f);
+
+    fclose(f);
+    log_size = 0;
 }
 
-#ifdef BUFFER
 void
-clear_text(uint8_t *screen)
+clear_disp(uint8_t *screen)
 {
     if (screen == TOP_SCREEN)
         screen = framebuffers->top_left;
@@ -84,26 +107,16 @@ clear_text(uint8_t *screen)
         screen = framebuffers->bottom;
 
     if (screen == framebuffers->top_left || screen == framebuffers->top_right) {
-        for (int i = 0; i < TEXT_TOP_HEIGHT; i++) {
-            text_buffer_top[i * TEXT_TOP_WIDTH] = 0;
-            color_buffer_top[i * TEXT_TOP_WIDTH] = 0;
-        }
+        memset(screen, 0, TOP_SIZE);
     } else if (screen == framebuffers->bottom) {
-        for (int i = 0; i < TEXT_BOTTOM_HEIGHT; i++) {
-            text_buffer_bottom[i * TEXT_BOTTOM_WIDTH] = 0;
-            color_buffer_bottom[i * TEXT_BOTTOM_WIDTH] = 0;
-        }
+        memset(screen, 0, BOTTOM_SIZE);
     }
 }
-#endif
 
 void
 clear_screen(uint8_t *screen)
 {
     clear_disp(screen);
-#ifdef BUFFER
-    clear_text(screen);
-#endif
 }
 
 void
@@ -126,7 +139,7 @@ clear_screens()
 }
 
 void
-draw_character(uint8_t *screen, const char character, const unsigned int buf_x, const unsigned int buf_y, const uint32_t color_fg, const uint32_t color_bg)
+draw_character(uint8_t *screen, const uint32_t character, int ch_x, int ch_y, const uint32_t color_fg, const uint32_t color_bg)
 {
     if (!isprint(character))
         return; // Don't output non-printables.
@@ -134,35 +147,43 @@ draw_character(uint8_t *screen, const char character, const unsigned int buf_x,
     _UNUSED int width = 0;
     int height = 0;
     if (screen == framebuffers->top_left || screen == framebuffers->top_right) {
-        width = SCREEN_TOP_WIDTH;
-        height = SCREEN_TOP_HEIGHT;
+        width = TOP_WIDTH;
+        height = TOP_HEIGHT;
     } else if (screen == framebuffers->bottom) {
-        width = SCREEN_BOTTOM_WIDTH;
-        height = SCREEN_BOTTOM_HEIGHT;
+        width = BOTTOM_WIDTH;
+        height = BOTTOM_HEIGHT;
     } else {
         return; // Invalid buffer.
     }
 
-    unsigned int pos_x = buf_x * 8;
-    unsigned int pos_y = buf_y * 8;
+    int x = (font_w + font_kern) * ch_x;
+    int y = font_h * ch_y;
 
-    for (int y = 0; y < 8; y++) {
-        unsigned char char_pos = font[character * 8 + y];
+    if (x >= width || y >= height)
+        return; // OOB
 
-        for (int x = 7; x >= 0; x--) {
-            int screen_pos = (pos_x * height * 3 + (height - y - pos_y - 1) * 3) + (7 - x) * 3 * height;
+    unsigned int c_font_w = (font_w / 8) + (font_w % 8 ? 1 : 0);
 
-            screen[screen_pos] = color_bg >> 16;
-            screen[screen_pos + 1] = color_bg >> 8;
-            screen[screen_pos + 2] = color_bg;
+       for (unsigned int yy = 0; yy < font_h; yy++) {
+               int xDisplacement = (x * SCREEN_DEPTH * height);
+               int yDisplacement = ((height - (y + yy) - 1) * SCREEN_DEPTH);
+               unsigned int pos = xDisplacement + yDisplacement;
+        unsigned char char_dat = ((char*)FCRAM_FONT_LOC)[(character - ' ') * (c_font_w * font_h) + yy];
+        for(unsigned int i=0; i < font_w + font_kern; i++) {
+            screen[pos]     = color_bg >> 16;
+            screen[pos + 1] = color_bg >> 8;
+            screen[pos + 2] = color_bg;
 
-            if ((char_pos >> x) & 1) {
-                screen[screen_pos] = color_fg >> 16;
-                screen[screen_pos + 1] = color_fg >> 8;
-                screen[screen_pos + 2] = color_fg;
-            }
+                       if (char_dat & 0x80) {
+                screen[pos]     = color_fg >> 16;
+                screen[pos + 1] = color_fg >> 8;
+                screen[pos + 2] = color_fg;
+                       }
+
+            char_dat <<= 1;
+                       pos += SCREEN_DEPTH * height;
         }
-    }
+       }
 }
 
 unsigned char color_top = 0xf0;
@@ -186,35 +207,20 @@ putc(void *buf, const int c)
         _UNUSED unsigned int height = 0;
         unsigned int *cursor_x = NULL;
         unsigned int *cursor_y = NULL;
-#ifdef BUFFER
-        char *colorbuf = NULL;
-        char *strbuf = NULL;
-#else
         uint8_t *screen = NULL;
-#endif
         unsigned char *color = NULL;
 
         if (buf == TOP_SCREEN) {
-            width = TEXT_TOP_WIDTH;
-            height = TEXT_TOP_HEIGHT;
-#ifdef BUFFER
-            colorbuf = color_buffer_top;
-            strbuf = text_buffer_top;
-#else
+            width = text_top_width;
+            height = text_top_height;
             screen = framebuffers->top_left;
-#endif
             cursor_x = &top_cursor_x;
             cursor_y = &top_cursor_y;
             color = &color_top;
         } else if (buf == BOTTOM_SCREEN) {
-            width = TEXT_BOTTOM_WIDTH;
-            height = TEXT_BOTTOM_HEIGHT;
-#ifdef BUFFER
-            colorbuf = color_buffer_bottom;
-            strbuf = text_buffer_bottom;
-#else
+            width = text_bottom_width;
+            height = text_bottom_height;
             screen = framebuffers->bottom;
-#endif
             cursor_x = &bottom_cursor_x;
             cursor_y = &bottom_cursor_y;
             color = &color_bottom;
@@ -226,21 +232,6 @@ putc(void *buf, const int c)
         }
 
         while (cursor_y[0] >= height - 1) {
-#ifdef BUFFER
-            // Scroll.
-            for (unsigned int y = 0; y < height - 1; y++) {
-                memset(&strbuf[y * width], 0, width);
-                memset(&colorbuf[y * width], 0, width);
-                strncpy(&strbuf[y * width], &strbuf[(y + 1) * width], width);
-                strncpy(&colorbuf[y * width], &colorbuf[(y + 1) * width], width);
-            }
-            memset(&strbuf[(height - 1) * width], 0, width);
-            memset(&colorbuf[(height - 1) * width], 0, width);
-
-            clear_disp(buf); // Clear screen.
-
-            cursor_y[0]--;
-#else
             clear_disp(buf);
             cursor_x[0] = 0;
             cursor_y[0] = 0;
@@ -250,35 +241,23 @@ putc(void *buf, const int c)
             for (unsigned int x = 0; x < width * 8; x++) {
                 memmove(&screen[x * col + one_c], &screen[x * col + one_c], col - one_c);
             } */
-#endif
+        }
+
+        if (isprint(c) && buf == BOTTOM_SCREEN) {
+            log_buffer[log_size] = c;
+            log_size++;
+            dump_log(0);
         }
 
         switch (c) {
             case '\n':
-#ifdef BUFFER
-                strbuf[cursor_y[0] * width + cursor_x[0]] = 0;
-                colorbuf[cursor_y[0] * width + cursor_x[0]] = 0;
-#endif
                 cursor_y[0]++;
             // Fall through intentional.
             case '\r':
                 cursor_x[0] = 0; // Reset to beginning of line.
                 break;
             default:
-#ifdef BUFFER
-                strbuf[cursor_y[0] * width + cursor_x[0]] = c;
-                colorbuf[cursor_y[0] * width + cursor_x[0]] = *color;
-
-                if (cursor_x[0] + 1 < width) {
-                    strbuf[cursor_y[0] * width + cursor_x[0] + 1] = 0; // Terminate.
-                    colorbuf[cursor_y[0] * width + cursor_x[0] + 1] = 0;
-                }
-
-#else
-                if (buf == BOTTOM_SCREEN)
-                    text_buffer_bottom[cursor_y[0] * width + cursor_x[0]] = c;
                 draw_character(screen, c, cursor_x[0], cursor_y[0], colors[(color[0] >> 4) & 0xF], colors[color[0] & 0xF]);
-#endif
 
                 cursor_x[0]++;
 
@@ -385,39 +364,9 @@ put_int(void *channel, int n, int length)
 void
 fflush(void *channel)
 {
-    if (channel == TOP_SCREEN) {
-#ifdef BUFFER
-        if (kill_output)
-            return;
-
-        for (int y = 0; y < TEXT_TOP_HEIGHT; y++) {
-            for (int x = 0; x < TEXT_TOP_WIDTH; x++) {
-                char c = text_buffer_top[y * TEXT_TOP_WIDTH + x];
-                if (c == 0)
-                    break;
-                uint32_t color_fg = colors[((color_buffer_top[y * TEXT_TOP_WIDTH + x] >> 4) & 0x0f)];
-                uint32_t color_bg = colors[(color_buffer_top[y * TEXT_TOP_WIDTH + x] & 0x0f)];
-                draw_character(framebuffers->top_left, c, x, y, color_fg, color_bg);
-            }
-        }
-#endif
-    } else if (channel == BOTTOM_SCREEN) {
-#ifdef BUFFER
-        if (kill_output)
-            return;
-
-        for (int y = 0; y < TEXT_BOTTOM_HEIGHT; y++) {
-            for (int x = 0; x < TEXT_BOTTOM_WIDTH; x++) {
-                char c = text_buffer_bottom[y * TEXT_BOTTOM_WIDTH + x];
-                if (c == 0)
-                    break;
-                uint32_t color_fg = colors[((color_buffer_bottom[y * TEXT_BOTTOM_WIDTH + x] >> 4) & 0x0f)];
-                uint32_t color_bg = colors[(color_buffer_bottom[y * TEXT_BOTTOM_WIDTH + x] & 0x0f)];
-                draw_character(framebuffers->bottom, c, x, y, color_fg, color_bg);
-            }
-        }
-#endif
-    } else {
+    if (channel == BOTTOM_SCREEN) {
+        dump_log(1);
+    } if (channel != TOP_SCREEN && channel != BOTTOM_SCREEN) {
         f_sync(&(((FILE *)channel)->handle)); // Sync to disk.
     }
 }
@@ -537,8 +486,6 @@ vfprintf(void *channel, const char *format, va_list ap)
         }
         ++ref;
     }
-
-    fflush(channel);
 }
 
 void
index bc5d864ab067933a439eef76b8dc940c41e1aed3..a066ff908d2d8c4d09e4b7e4f8be6e5394631479 100644 (file)
@@ -6,28 +6,16 @@
 
 #include <stdint.h>
 
-#define SCREEN_TOP_WIDTH 400
-#define SCREEN_TOP_HEIGHT 240
+#define TOP_WIDTH 400
+#define TOP_HEIGHT 240
 
-#define SCREEN_BOTTOM_WIDTH 320
-#define SCREEN_BOTTOM_HEIGHT 240
+#define BOTTOM_WIDTH 320
+#define BOTTOM_HEIGHT 240
 
 #define SCREEN_DEPTH 3
 
-#define SCREEN_TOP_SIZE (SCREEN_TOP_WIDTH * SCREEN_TOP_HEIGHT * SCREEN_DEPTH)
-#define SCREEN_BOTTOM_SIZE (SCREEN_BOTTOM_WIDTH * SCREEN_BOTTOM_HEIGHT * SCREEN_DEPTH)
-
-#define CHARA_HEIGHT 8
-#define CHARA_WIDTH 8
-
-#define TEXT_TOP_WIDTH (SCREEN_TOP_WIDTH / CHARA_WIDTH)
-#define TEXT_TOP_HEIGHT (SCREEN_TOP_HEIGHT / CHARA_HEIGHT)
-
-#define TEXT_BOTTOM_WIDTH (SCREEN_BOTTOM_WIDTH / CHARA_WIDTH)
-#define TEXT_BOTTOM_HEIGHT (SCREEN_BOTTOM_HEIGHT / CHARA_HEIGHT)
-
-#define TEXT_TOP_SIZE (TEXT_TOP_WIDTH * TEXT_TOP_HEIGHT)
-#define TEXT_BOTTOM_SIZE (TEXT_BOTTOM_WIDTH * TEXT_BOTTOM_HEIGHT)
+#define TOP_SIZE (TOP_WIDTH * TOP_HEIGHT * SCREEN_DEPTH)
+#define BOTTOM_SIZE (BOTTOM_WIDTH * BOTTOM_HEIGHT * SCREEN_DEPTH)
 
 enum screen
 {
@@ -51,8 +39,9 @@ _UNUSED static struct framebuffers
 
 void clear_screen(uint8_t *screen);
 void clear_screens();
-void draw_character(uint8_t *screen, const char character, const unsigned int pos_x, const unsigned int pos_y, const uint32_t color_fg,
-                    const uint32_t color_bg);
+void draw_character(uint8_t *screen, const uint32_t character, int ch_x, int ch_y, const uint32_t color_fg, const uint32_t color_bg);
+
+void set_font(const char* filename);
 
 #define TOP_SCREEN ((void *)0)
 #define BOTTOM_SCREEN ((void *)2)
diff --git a/source/std/font.h b/source/std/font.h
deleted file mode 100644 (file)
index 7b2cfa7..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef __STD_FONT_H
-#define __STD_FONT_H
-
-static const unsigned char font[] = {
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e, 0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7, 0xff, 0x7e, 0x6c, 0xfe,
-    0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x3c, 0x3c, 0x18, 0xff, 0xe7, 0x18, 0x3c, 0x00, 0x10, 0x38, 0x7c, 0xfe,
-    0xee, 0x10, 0x38, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66,
-    0x3c, 0x00, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0x0f, 0x07, 0x0f, 0x7d, 0xcc, 0xcc, 0xcc, 0x78, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18,
-    0x08, 0x0c, 0x0a, 0x0a, 0x08, 0x78, 0xf0, 0x00, 0x18, 0x14, 0x1a, 0x16, 0x72, 0xe2, 0x0e, 0x1c, 0x10, 0x54, 0x38, 0xee, 0x38, 0x54, 0x10, 0x00, 0x80, 0xe0,
-    0xf8, 0xfe, 0xf8, 0xe0, 0x80, 0x00, 0x02, 0x0e, 0x3e, 0xfe, 0x3e, 0x0e, 0x02, 0x00, 0x18, 0x3c, 0x5a, 0x18, 0x5a, 0x3c, 0x18, 0x00, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x00, 0x66, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x00, 0x1c, 0x22, 0x38, 0x44, 0x44, 0x38, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e,
-    0x7e, 0x00, 0x18, 0x3c, 0x5a, 0x18, 0x5a, 0x3c, 0x18, 0x7e, 0x18, 0x3c, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x5a, 0x3c, 0x18, 0x00,
-    0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x24,
-    0x42, 0xff, 0x42, 0x24, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x18, 0x00, 0x18, 0x00, 0x6c, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0xfe, 0x6c,
-    0x6c, 0x00, 0x10, 0x7c, 0xd0, 0x7c, 0x16, 0xfc, 0x10, 0x00, 0x00, 0x66, 0xac, 0xd8, 0x36, 0x6a, 0xcc, 0x00, 0x38, 0x4c, 0x38, 0x78, 0xce, 0xcc, 0x7a, 0x00,
-    0x30, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x60, 0x60, 0x30, 0x18, 0x00, 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00, 0x00, 0x66,
-    0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x20, 0x00, 0x00, 0x00, 0xfc,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x00, 0x7c, 0xce, 0xde, 0xf6, 0xe6, 0xe6,
-    0x7c, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 0x7e, 0x00, 0x7c, 0xc6, 0x06, 0x1c, 0x70, 0xc6, 0xfe, 0x00, 0x7c, 0xc6, 0x06, 0x3c, 0x06, 0xc6, 0x7c, 0x00,
-    0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 0x0c, 0x1e, 0x00, 0xfe, 0xc0, 0xfc, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x7c, 0xc6, 0xc0, 0xfc, 0xc6, 0xc6, 0x7c, 0x00, 0xfe, 0xc6,
-    0x0c, 0x18, 0x30, 0x30, 0x30, 0x00, 0x7c, 0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0x7c, 0x00, 0x7c, 0xc6, 0xc6, 0x7e, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x30, 0x00, 0x00,
-    0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x10, 0x20, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7e,
-    0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x78, 0xcc, 0x0c, 0x18, 0x30, 0x00, 0x30, 0x00, 0x7c, 0x82, 0x9e, 0xa6, 0x9e, 0x80, 0x7c, 0x00,
-    0x7c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0xfc, 0x66, 0x66, 0x7c, 0x66, 0x66, 0xfc, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0xfc, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0xfe, 0x62, 0x68, 0x78, 0x68, 0x62, 0xfe, 0x00, 0xfe, 0x62, 0x68, 0x78, 0x68, 0x60, 0xf0, 0x00, 0x7c, 0xc6, 0xc6, 0xc0,
-    0xce, 0xc6, 0x7e, 0x00, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc,
-    0x78, 0x00, 0xe6, 0x66, 0x6c, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x82, 0xc6, 0xee, 0xfe, 0xd6, 0xc6, 0xc6, 0x00,
-    0xc6, 0xe6, 0xf6, 0xde, 0xce, 0xc6, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0xfc, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x7c, 0xc6,
-    0xc6, 0xc6, 0xd6, 0xde, 0x7c, 0x06, 0xfc, 0x66, 0x66, 0x7c, 0x66, 0x66, 0xe6, 0x00, 0x7c, 0xc6, 0xc0, 0x7c, 0x06, 0xc6, 0x7c, 0x00, 0x7e, 0x5a, 0x5a, 0x18,
-    0x18, 0x18, 0x3c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x10, 0x00, 0xc6, 0xc6, 0xd6, 0xfe, 0xee, 0xc6,
-    0x82, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc6, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x3c, 0x00, 0xfe, 0xc6, 0x8c, 0x18, 0x32, 0x66, 0xfe, 0x00,
-    0x78, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 0x00, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x02, 0x00, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00, 0x10, 0x38,
-    0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x30, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c,
-    0x7c, 0xcc, 0x76, 0x00, 0xe0, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc6, 0x7c, 0x00, 0x1c, 0x0c, 0x0c, 0x7c, 0xcc, 0xcc,
-    0x76, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0x7c, 0x00, 0x1c, 0x36, 0x30, 0x78, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0x7c, 0x0c, 0x78,
-    0xe0, 0x60, 0x6c, 0x76, 0x66, 0x66, 0xe6, 0x00, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x0c, 0x00, 0x1c, 0x0c, 0x0c, 0xcc, 0x78, 0xe0, 0x60,
-    0x66, 0x6c, 0x78, 0x6c, 0xe6, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0xcc, 0xfe, 0xd6, 0xd6, 0xd6, 0x00, 0x00, 0x00, 0xdc, 0x66,
-    0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x7c, 0x60, 0xf0, 0x00, 0x00, 0x7c, 0xcc, 0xcc, 0x7c,
-    0x0c, 0x1e, 0x00, 0x00, 0xde, 0x76, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x7c, 0xc0, 0x7c, 0x06, 0x7c, 0x00, 0x10, 0x30, 0xfc, 0x30, 0x30, 0x34, 0x18, 0x00,
-    0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0xc6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00,
-    0xc6, 0x6c, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xf8, 0x00, 0x00, 0xfc, 0x98, 0x30, 0x64, 0xfc, 0x00, 0x0e, 0x18, 0x18, 0x30,
-    0x18, 0x18, 0x0e, 0x00, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, 0xe0, 0x30, 0x30, 0x18, 0x30, 0x30, 0xe0, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc6, 0x7c, 0x18, 0x70, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00,
-    0x0e, 0x10, 0x7c, 0xc6, 0xfe, 0xc0, 0x7c, 0x00, 0x7c, 0x82, 0x38, 0x0c, 0x7c, 0xcc, 0x76, 0x00, 0xcc, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0x76, 0x00, 0xe0, 0x10,
-    0x78, 0x0c, 0x7c, 0xcc, 0x76, 0x00, 0x30, 0x30, 0x78, 0x0c, 0x7c, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x7c, 0xc0, 0xc0, 0x7c, 0x18, 0x70, 0x7c, 0x82, 0x7c, 0xc6,
-    0xfe, 0xc0, 0x7c, 0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0x7c, 0x00, 0xe0, 0x10, 0x7c, 0xc6, 0xfe, 0xc0, 0x7c, 0x00, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18,
-    0x3c, 0x00, 0x7c, 0x82, 0x38, 0x18, 0x18, 0x18, 0x3c, 0x00, 0xe0, 0x10, 0x38, 0x18, 0x18, 0x18, 0x3c, 0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xfe, 0xc6, 0xc6, 0x00,
-    0x38, 0x38, 0x7c, 0xc6, 0xfe, 0xc6, 0xc6, 0x00, 0x0e, 0x10, 0xfe, 0x60, 0x78, 0x60, 0xfe, 0x00, 0x00, 0x00, 0x7c, 0x12, 0x7e, 0xd0, 0x7e, 0x00, 0x7e, 0xc8,
-    0xc8, 0xfe, 0xc8, 0xc8, 0xce, 0x00, 0x7c, 0x82, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0xe0, 0x10, 0x7c, 0xc6,
-    0xc6, 0xc6, 0x7c, 0x00, 0x7c, 0x82, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0xe0, 0x10, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0x7c,
-    0x0c, 0xf8, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x18, 0x7c, 0xd6, 0xd0, 0xd6, 0x7c, 0x18, 0x00,
-    0x38, 0x6c, 0x60, 0xf0, 0x60, 0xf2, 0xdc, 0x00, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x7e, 0x18, 0x00, 0xf8, 0xcc, 0xf8, 0xc4, 0xcc, 0xde, 0xcc, 0x06, 0x0e, 0x1b,
-    0x18, 0x3c, 0x18, 0x18, 0xd8, 0x70, 0x0e, 0x10, 0x78, 0x0c, 0x7c, 0xcc, 0x76, 0x00, 0x0e, 0x10, 0x38, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x0e, 0x10, 0x7c, 0xc6,
-    0xc6, 0xc6, 0x7c, 0x00, 0x0e, 0x10, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x66, 0x98, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x98, 0xe6, 0xf6, 0xde, 0xce,
-    0xc6, 0x00, 0x38, 0x0c, 0x3c, 0x34, 0x00, 0x7e, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x7c, 0x00, 0x00, 0x30, 0x00, 0x30, 0x60, 0xc6, 0xc6, 0x7c, 0x00,
-    0x00, 0x00, 0x00, 0xfc, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x0c, 0x0c, 0x00, 0x00, 0xc0, 0xc8, 0xd0, 0xfe, 0x46, 0x8c, 0x1e, 0x00, 0xc0, 0xc8,
-    0xd0, 0xec, 0x5c, 0xbe, 0x0c, 0x00, 0x18, 0x00, 0x18, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36,
-    0x6c, 0xd8, 0x00, 0x00, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0xdb, 0x77, 0xdb, 0xee, 0xdb, 0x77,
-    0xdb, 0xee, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18,
-    0x36, 0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x00, 0x00, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x36, 0x36,
-    0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0xfe, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06,
-    0xfe, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18,
-    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18,
-    0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18,
-    0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30,
-    0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36,
-    0x36, 0x36, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x36, 0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
-    0x36, 0x36, 0x36, 0x36, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36,
-    0x36, 0x36, 0x3f, 0x00, 0x00, 0x00, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
-    0x3f, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
-    0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x74, 0xcc, 0xc8, 0xdc, 0x76, 0x00, 0x78, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xdc, 0x40, 0xfe, 0x62, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x02, 0x7e, 0xec,
-    0x6c, 0x6c, 0x48, 0x00, 0xfe, 0x62, 0x30, 0x18, 0x30, 0x62, 0xfe, 0x00, 0x00, 0x00, 0x7e, 0xd0, 0xc8, 0xc8, 0x70, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc,
-    0xf8, 0x80, 0x00, 0x00, 0x7e, 0xd8, 0x18, 0x18, 0x10, 0x00, 0x38, 0x10, 0x7c, 0xd6, 0xd6, 0x7c, 0x10, 0x38, 0x7c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x7c, 0x00,
-    0x7c, 0xc6, 0xc6, 0xc6, 0x6c, 0x28, 0xee, 0x00, 0x3c, 0x22, 0x18, 0x7c, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x66, 0x99, 0x99, 0x66, 0x00, 0x00, 0x00, 0x06,
-    0x7c, 0x9e, 0xf2, 0x7c, 0xc0, 0x00, 0x00, 0x00, 0x7c, 0xc0, 0xf8, 0xc0, 0x7c, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0xfe, 0x00, 0xfe,
-    0x00, 0xfe, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x30, 0x18, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0x00, 0x18, 0x30, 0x60, 0x30, 0x18, 0x00,
-    0x7c, 0x00, 0x0e, 0x1b, 0x1b, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0x70, 0x00, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x00, 0x00,
-    0x00, 0x76, 0xdc, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x3c, 0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x30, 0xc0, 0xf0,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-
-};
-
-static const int font_size = sizeof(font);
-
-#endif
index 079c0545c8165b0149b3eadb24f01be2ae71f370..22d26667e65e57700fe3c288229f87bcdd8ce69e 100644 (file)
@@ -4,6 +4,7 @@
 #include "../fatfs/ff.h"
 #include "draw.h"
 #include "memory.h"
+#include "../config.h"
 
 static FATFS fs;
 
@@ -80,6 +81,8 @@ fumount(void)
     if (f_mount(NULL, "0:", 1))
         return 1;
 
+    config.options[OPTION_SAVE_LOGS] = 0; // FS unmounted, can't log anymore
+
     return 0;
 }