diff --git a/CMakeLists.txt b/CMakeLists.txt index a46d30a..3adb271 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ set(ASSETS ) set(ASSETS_fx + assets-fx/kenney_mini.png ) set(ASSETS_cg diff --git a/assets-fx/fxconv-metadata.txt b/assets-fx/fxconv-metadata.txt new file mode 100644 index 0000000..4b4d74f --- /dev/null +++ b/assets-fx/fxconv-metadata.txt @@ -0,0 +1,6 @@ +kenney_mini.png: + name: font_kenney_mini + type: font + charset: print + grid.size: 6x9 + proportional: true diff --git a/assets-fx/kenney_mini.png b/assets-fx/kenney_mini.png new file mode 100644 index 0000000..392cbf6 Binary files /dev/null and b/assets-fx/kenney_mini.png differ diff --git a/src/disp/display.c b/src/disp/display.c index 9f3c02f..3ea228b 100644 --- a/src/disp/display.c +++ b/src/disp/display.c @@ -1,27 +1,41 @@ #include "disp.h" #include -#include + +#ifdef FX9860G +extern font_t font_kenney_mini; +#endif + +static int line_height = 0; static void draw_line(int x, int y, char *buffer, int len); void disp_display(void) { - static int line_height = 0; const int x = 2; +#ifdef FX9860G + int y = -2; +#else int y = 2; +#endif char *buffer_cursor = disp_buffer; int line_length = 0; - if (!line_height) + if (!line_height) { +#ifdef FX9860G + dfont(&font_kenney_mini); + line_height = 6; +#else line_height = dfont_default()->line_height; +#endif + } while (buffer_cursor[line_length] != '\0') { if (buffer_cursor[line_length] == '\n') { draw_line(x, y, buffer_cursor, line_length); buffer_cursor += line_length + 1; line_length = 0; - y += line_height; + y += line_height + 1; } else line_length += 1; }