mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[fb] Add default hard-coded font
For the fb driver to have a font before loading from disk is available, create a hard-coded font as a byte array. To create this, added a new scripts/psf_to_cpp.py which also refactored out much of scripts/parse_font.py into a new shared module scripts/fontpsf.py.
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
|
||||
#include <j6libc/syscalls.h>
|
||||
|
||||
#include "font.h"
|
||||
|
||||
extern "C" {
|
||||
int main(int, const char **);
|
||||
void _get_init(size_t *initc, struct j6_init_value **initv);
|
||||
@@ -33,6 +35,14 @@ main(int argc, const char **argv)
|
||||
if (!fb)
|
||||
return 1;
|
||||
|
||||
size_t font_size = sizeof(font_glyph_data);
|
||||
if (font_size != (font_glyph_size*font_glyph_count)) {
|
||||
_syscall_system_log("fb driver has wrong font data, exiting");
|
||||
return 1;
|
||||
}
|
||||
|
||||
volatile uint8_t const * p = font_glyph_data;
|
||||
|
||||
uint32_t *fbp = reinterpret_cast<uint32_t*>(fb->addr);
|
||||
size_t size = fb->size;
|
||||
for (size_t i=0; i < size/4; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user