changed font handling to support the entire unicode BMP. RTL will display LTR

This commit is contained in:
Morten Delenk 2016-07-23 18:13:26 +02:00
parent db923970b5
commit c9afbf876b
19 changed files with 86 additions and 296 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
mtgos
*.o
*anjuta*
mtgos.img

View file

@ -2,15 +2,15 @@
all: mtgos user
mtgos:
make -C kernel
$(MAKE) -C kernel
mv kernel/mtgos mtgos
user:
make -C user
$(MAKE) -C user
mv user/*.elf .
clean:
make -C kernel clean
$(MAKE) -C kernel clean
rm -rf mtgos
find . -name '*.o' -delete

16
buildcrosscompiler.sh Normal file → Executable file
View file

@ -7,26 +7,26 @@ function buildscript() {
mkdir build-binutils
cd build-binutils
../binutils-2.26/configure --prefix=$CROSSPATH --target=$1 --with-sysroot --disable-nls --disable-werror 2>&1 > /dev/null
make -j8 2>&1 > /dev/null
make install 2>&1 > /dev/null
gmake -j8 2>&1 > /dev/null
gmake install 2>&1 > /dev/null
cd ..
rm -rf build-binutils
echo "[$(date +%c)] Building gcc for $1." | tee -a buildlog
mkdir build-gcc
cd build-gcc
../gcc-6.1.0/configure --prefix=$CROSSPATH --target=$1 --disable-nls --enable-languages=c,c++ --without-headers 2>&1 > /dev/null
make all-gcc -j8 2>&1 > /dev/null
make all-target-libgcc -j8 2>&1 > /dev/null
make install-gcc 2>&1 > /dev/null
make install-target-libgcc 2>&1 > /dev/null
gmake all-gcc -j8 2>&1 > /dev/null
gmake all-target-libgcc -j8 2>&1 > /dev/null
gmake install-gcc 2>&1 > /dev/null
gmake install-target-libgcc 2>&1 > /dev/null
cd ..
rm -rf build-gcc
echo "[$(date +%c)] Building gdb for $1." | tee -a buildlog
mkdir build-gdb
cd build-gdb
../gdb-7.11/configure --prefix=$CROSSPATH --target=$1 --disable-nls 2>&1 > /dev/null
make -j8 2>&1 > /dev/null
make install 2>&1 > /dev/null
gmake -j8 2>&1 > /dev/null
gmake install 2>&1 > /dev/null
cd ..
rm -rf build-gdb
echo "[$(date +%c)] Cross-compiler for $1 was built." | tee -a buildlog

View file

@ -1,4 +1,4 @@
arch = 3ds
arch = x86
MODE = debug
#MODE = release # enables optimization

View file

@ -2,18 +2,18 @@ include ../kernel.settings
SRCS = $(shell find hal/$(arch) -name '*.cpp' -o -name '*.[cS]')
KERNSRCS = $(shell find kernel -name '*.cpp' -o -name '*.c')
#OBJS = $(addsuffix .o,$(basename $(SRCS)))
OBJS = #$(addsuffix .o,$(basename $(KERNSRCS)))
OBJS = $(addsuffix .o,$(basename $(KERNSRCS)))
LD = $(PREFIX)g++
LDFLAGS = -nostdlib -nodefaultlibs -nostdlib -fno-builtin $(ARCHFLAGS) -T kernel-$(arch).ld -z max-page-size=0x1000
all: hal #kernel #uncomment when done with 3ds
all: hal kernel #uncomment when done with 3ds
$(LD) $(LDFLAGS) -o mtgos $(OBJS) libhal.a -lgcc
hal:
make -C hal
$(MAKE) -C hal
kernel:
make -C kernel
$(MAKE) -C kernel
clean:
make -C hal clean
make -C kernel clean
$(MAKE) -C hal clean
$(MAKE) -C kernel clean
.PHONY: all hal kernel clean

View file

@ -11,7 +11,7 @@ _a11vectors_begin:
b _svc
b udi
start:
b =_start
// b _start
.extern handleINT11
data_abort:
sub lr, #8

View file

@ -2,10 +2,10 @@ include ../../kernel.settings
SRCS = $(shell find $(arch) -name '*.cpp' -o -name '*.[cS]')
OBJS = $(addsuffix .o,$(basename $(SRCS)))
all:
make -C $(arch)
$(MAKE) -C $(arch)
ar rcs ../libhal.a $(OBJS)
clean:
rm -rf hal.o
make -C $(arch) clean
$(MAKE) -C $(arch) clean
.PHONY: all clean

View file

@ -1,5 +1,5 @@
include ../../../kernel.settings
SRCS = $(shell find -name '*.cpp' -o -name '*.[cS]')
SRCS = $(shell find . -name '*.cpp' -o -name '*.[cS]')
OBJS = $(addsuffix .o,$(basename $(SRCS)))
CPP = $(PREFIX)g++

View file

@ -4,8 +4,8 @@
#include <stdint.h>
#include <output.hpp>
#include <multiboot.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 96
#define SCREEN_WIDTH 64
#define SCREEN_HEIGHT 48
namespace MTGosHAL {
enum class BG_color : uint32_t {
BLACK=0x000000,

View file

@ -26,12 +26,12 @@ namespace MTGosHAL {
case '\0':
break;
default:
for(int lx=0;lx<8;lx++) {
for(int ly=0;ly<8;ly++) {
if(font[(int)((uint8_t)c)][ly]&(1<<lx)) {
lfb[(x*8+lx)+(y*8+ly)*1024]=0xFFFFFF;//static_cast<uint32_t>(fg);
for(int lx=0;lx<16;lx++) {
for(int ly=0;ly<16;ly++) {
if(font[(int)((uint8_t)c)][ly]&(1<<(16-lx))) {
lfb[(x*16+lx)+(y*16+ly)*1024]=0xFFFFFF;//static_cast<uint32_t>(fg);
} else {
lfb[(x*8+lx)+(y*8+ly)*1024]=0x000000;//static_cast<uint32_t>(bg);
lfb[(x*16+lx)+(y*16+ly)*1024]=0x000000;//static_cast<uint32_t>(bg);
}
}
}
@ -51,12 +51,12 @@ namespace MTGosHAL {
x=y=0;
}
auto Screen::scroll() -> void {
for(int ly=0;ly<786-8;ly++) {
for(int ly=0;ly<786-16;ly++) {
for(int lx=0;lx<1024;lx++) {
lfb[lx+ly*1024]=lfb[lx+(ly+8)*1024];
lfb[lx+ly*1024]=lfb[lx+(ly+16)*1024];
}
}
for(int ly=786-8;ly<786;ly++) {
for(int ly=786-16;ly<786;ly++) {
for(int lx=0;lx<1024;lx++) {
lfb[lx+ly*1024]=0x000000;//static_cast<uint32_t>(bg);
}
@ -87,6 +87,34 @@ namespace MTGosHAL {
auto Screen::init(struct multiboot_info* mb_info) -> void {
lfb=(uint32_t*)((uintptr_t)mb_info->framebuffer_addr);
//Load font
multiboot_mod_list *mods = (multiboot_mod_list*) mb_info->mods_addr;
for(int i=0;i<65536;i++)
for(int j=0;j<16;j++)
font[i][j]=0;
for(uint32_t i=0;i<mb_info->mods_count;i++) {
fontfile* font=(fontfile*)(mods[i].mod_start);
if((font->magic[0]!='F')||(font->magic[1]!='O')||(font->magic[2]!='N')||(font->magic[3]!='T')) //Is it a font file?
continue;
charmap* map=(charmap*)((char*)font+font->charmap_off);
charwidth* width=(charwidth*)((char*)font+font->charwidth_off);
CHR8* chr_begin=(CHR8*)((char*)font+font->chr_off);
uint32_t hwcount=0;
for(uint32_t i=0;i<font->no_char;i++) {
uint16_t char_num=map[i].charnumber;
bool wide_char=width[i].width==0x10;
if(wide_char) {
CHR16* chr=(CHR16*)((char*)(&chr_begin[hwcount]));
for(int j=0;j<16;j++)
::font[i][j]=chr->rows[j];
hwcount+=2;
} else {
for(int j=0;j<16;j++)
::font[i][j]=(uint16_t)(((uint16_t)chr_begin[hwcount].rows[j])<<8);
hwcount++;
}
}
}
//clrscr();
//Render '\001' character
for(int tx=0;tx<16;tx++) {

View file

@ -1,5 +1,5 @@
include ../../kernel.settings
SRCS = $(shell find -name '*.cpp' -o -name '*.c')
SRCS = $(shell find . -name '*.cpp' -o -name '*.c')
OBJS = $(addsuffix .o,$(basename $(SRCS)))
CPP = $(PREFIX)g++
CC = $(PREFIX)gcc

View file

@ -8,7 +8,6 @@ typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long int uint64_t;
typedef unsigned int uintptr_t;
typedef unsigned int size_t;
#else
typedef signed char int8_t;
typedef signed short int16_t;
@ -19,5 +18,5 @@ typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long int uint64_t;
typedef unsigned long int uintptr_t;
typedef unsigned long int size_t;
#endif
typedef unsigned long int size_t;

View file

@ -1,260 +1,22 @@
//Thanks to masterq32 for this font!
//You should check out his OS project (https://github.com/MasterQ32/DasOS)
static uint8_t font[256][8] = {
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // ?
{ 0x00, 0x00, 0x0D, 0x12, 0x12, 0x09, 0x09, 0x00 }, // ?
{ 0x00, 0x00, 0x11, 0x11, 0x11, 0x19, 0x16, 0x00 }, // ?
{ 0x00, 0x00, 0x11, 0x11, 0x0A, 0x0A, 0x04, 0x00 }, // ?
{ 0x00, 0x00, 0x11, 0x11, 0x15, 0x15, 0x0A, 0x00 }, // ?
{ 0x00, 0x02, 0x06, 0x0E, 0x06, 0x02, 0x00, 0x00 }, // ?
{ 0x04, 0x0E, 0x1F, 0x0E, 0x0E, 0x00, 0x00, 0x00 }, // ?
{ 0x00, 0x00, 0x0E, 0x0E, 0x1F, 0x0E, 0x04, 0x00 }, // ?
{ 0x08, 0x14, 0x04, 0x04, 0x04, 0x05, 0x02, 0x00 }, // ?
{ 0x00, 0x11, 0x0A, 0x04, 0x0A, 0x11, 0x00, 0x00 }, // ?
{ 0x00, 0x00, 0x00, 0x0E, 0x0A, 0x0E, 0x00, 0x00 }, // ?
{ 0x00, 0x00, 0x00, 0x04, 0x0E, 0x04, 0x00, 0x00 }, // ?
{ 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00 }, // ?
{ 0x00, 0x00, 0x00, 0x07, 0x02, 0x02, 0x02, 0x00 }, // ?
{ 0x06, 0x08, 0x06, 0x08, 0x06, 0x00, 0x00, 0x00 }, // ?
{ 0x1F, 0x03, 0x03, 0x0F, 0x03, 0x03, 0x03, 0x00 }, // ?
{ 0x1C, 0x04, 0x04, 0x04, 0x05, 0x06, 0x04, 0x00 }, // ?
{ 0x18, 0x10, 0x13, 0x10, 0x10, 0x00, 0x00, 0x00 }, // ?
{ 0x06, 0x08, 0x04, 0x02, 0x0E, 0x00, 0x00, 0x00 }, // ?
{ 0x00, 0x00, 0x10, 0x08, 0x04, 0x02, 0x1F, 0x00 }, // ?
{ 0x06, 0x09, 0x09, 0x06, 0x00, 0x00, 0x00, 0x00 }, // ?
{ 0x0D, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 }, // ?
{ 0x0E, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00 }, // ?
{ 0x10, 0x0C, 0x03, 0x0C, 0x10, 0x00, 0x1F, 0x00 }, // ?
{ 0x08, 0x08, 0x1F, 0x04, 0x1F, 0x02, 0x02, 0x00 }, // ?
{ 0x01, 0x06, 0x18, 0x06, 0x01, 0x00, 0x1F, 0x00 }, // ?
{ 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00 }, // ?
{ 0x00, 0x00, 0x1E, 0x02, 0x0E, 0x02, 0x1E, 0x00 }, // ?
{ 0x00, 0x04, 0x08, 0x1F, 0x08, 0x04, 0x00, 0x00 }, // ?
{ 0x00, 0x00, 0x1D, 0x15, 0x15, 0x15, 0x1D, 0x00 }, // ?
{ 0x04, 0x0E, 0x15, 0x04, 0x04, 0x04, 0x04, 0x00 }, // ?
{ 0x04, 0x04, 0x04, 0x04, 0x15, 0x0E, 0x04, 0x00 }, // ?
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, //
{ 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x04, 0x00 }, // !
{ 0x0A, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00 }, // "
{ 0x0A, 0x0A, 0x1F, 0x0A, 0x1F, 0x0A, 0x0A, 0x00 }, // #
{ 0x02, 0x0A, 0x0E, 0x08, 0x08, 0x00, 0x00, 0x00 }, // $
{ 0x03, 0x13, 0x08, 0x04, 0x02, 0x19, 0x18, 0x00 }, // %
{ 0x02, 0x05, 0x05, 0x02, 0x15, 0x09, 0x16, 0x00 }, // &
{ 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 }, // '
{ 0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, 0x00 }, // (
{ 0x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x02, 0x00 }, // )
{ 0x00, 0x04, 0x15, 0x0E, 0x15, 0x04, 0x00, 0x00 }, // *
{ 0x00, 0x04, 0x04, 0x1F, 0x04, 0x04, 0x00, 0x00 }, // +
{ 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x02, 0x00 }, // ,
{ 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00 }, // -
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00 }, // .
{ 0x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x00 }, // /
{ 0x0E, 0x11, 0x19, 0x15, 0x13, 0x11, 0x0E, 0x00 }, // 0
{ 0x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x0E, 0x00 }, // 1
{ 0x0E, 0x11, 0x10, 0x08, 0x04, 0x02, 0x1F, 0x00 }, // 2
{ 0x1F, 0x08, 0x04, 0x08, 0x10, 0x11, 0x0E, 0x00 }, // 3
{ 0x08, 0x0C, 0x0A, 0x09, 0x1F, 0x08, 0x08, 0x00 }, // 4
{ 0x1F, 0x01, 0x0F, 0x10, 0x10, 0x11, 0x0E, 0x00 }, // 5
{ 0x0C, 0x02, 0x01, 0x0F, 0x11, 0x11, 0x0E, 0x00 }, // 6
{ 0x1F, 0x10, 0x08, 0x04, 0x02, 0x02, 0x02, 0x00 }, // 7
{ 0x0E, 0x11, 0x11, 0x0E, 0x11, 0x11, 0x0E, 0x00 }, // 8
{ 0x0E, 0x11, 0x11, 0x1E, 0x10, 0x08, 0x06, 0x00 }, // 9
{ 0x00, 0x06, 0x06, 0x00, 0x06, 0x06, 0x00, 0x00 }, // :
{ 0x00, 0x06, 0x06, 0x00, 0x06, 0x04, 0x02, 0x00 }, // ;
{ 0x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08, 0x00 }, // <
{ 0x00, 0x00, 0x1F, 0x00, 0x1F, 0x00, 0x00, 0x00 }, // =
{ 0x02, 0x04, 0x08, 0x10, 0x08, 0x04, 0x02, 0x00 }, // >
{ 0x0E, 0x11, 0x10, 0x08, 0x04, 0x00, 0x04, 0x00 }, // ?
{ 0x0E, 0x11, 0x15, 0x1D, 0x05, 0x01, 0x1E, 0x00 }, // @
{ 0x0E, 0x11, 0x11, 0x1F, 0x11, 0x11, 0x11, 0x00 }, // A
{ 0x0F, 0x11, 0x11, 0x0F, 0x11, 0x11, 0x0F, 0x00 }, // B
{ 0x0E, 0x11, 0x01, 0x01, 0x01, 0x11, 0x0E, 0x00 }, // C
{ 0x0F, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0F, 0x00 }, // D
{ 0x1F, 0x01, 0x01, 0x0F, 0x01, 0x01, 0x1F, 0x00 }, // E
{ 0x1F, 0x01, 0x01, 0x0F, 0x01, 0x01, 0x01, 0x00 }, // F
{ 0x0E, 0x11, 0x01, 0x1D, 0x11, 0x11, 0x1E, 0x00 }, // G
{ 0x11, 0x11, 0x11, 0x1F, 0x11, 0x11, 0x11, 0x00 }, // H
{ 0x0E, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0E, 0x00 }, // I
{ 0x1C, 0x08, 0x08, 0x08, 0x08, 0x09, 0x06, 0x00 }, // J
{ 0x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11, 0x00 }, // K
{ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1F, 0x00 }, // L
{ 0x11, 0x1B, 0x15, 0x15, 0x11, 0x11, 0x11, 0x00 }, // M
{ 0x11, 0x11, 0x13, 0x15, 0x19, 0x11, 0x11, 0x00 }, // N
{ 0x0E, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0E, 0x00 }, // O
{ 0x0F, 0x11, 0x11, 0x0F, 0x01, 0x01, 0x01, 0x00 }, // P
{ 0x0E, 0x11, 0x11, 0x11, 0x15, 0x09, 0x16, 0x00 }, // Q
{ 0x0F, 0x11, 0x11, 0x0F, 0x05, 0x09, 0x11, 0x00 }, // R
{ 0x1E, 0x01, 0x01, 0x0E, 0x10, 0x10, 0x0F, 0x00 }, // S
{ 0x1F, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00 }, // T
{ 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0E, 0x00 }, // U
{ 0x11, 0x11, 0x11, 0x11, 0x0A, 0x0A, 0x04, 0x00 }, // V
{ 0x11, 0x11, 0x11, 0x15, 0x15, 0x15, 0x0A, 0x00 }, // W
{ 0x11, 0x11, 0x0A, 0x04, 0x0A, 0x11, 0x11, 0x00 }, // X
{ 0x11, 0x11, 0x11, 0x0A, 0x04, 0x04, 0x04, 0x00 }, // Y
{ 0x1F, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1F, 0x00 }, // Z
{ 0x0C, 0x12, 0x11, 0x1F, 0x11, 0x09, 0x06, 0x00 }, // [
{ 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00 }, // \d
{ 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x00 }, // ]
{ 0x04, 0x0A, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00 }, // ^
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00 }, // _
{ 0x04, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 }, // `
{ 0x00, 0x00, 0x0E, 0x10, 0x1E, 0x11, 0x1E, 0x00 }, // a
{ 0x01, 0x01, 0x0D, 0x13, 0x11, 0x11, 0x0F, 0x00 }, // b
{ 0x00, 0x00, 0x0E, 0x01, 0x01, 0x11, 0x0E, 0x00 }, // c
{ 0x10, 0x10, 0x16, 0x19, 0x11, 0x11, 0x1E, 0x00 }, // d
{ 0x00, 0x00, 0x0E, 0x11, 0x1F, 0x01, 0x0E, 0x00 }, // e
{ 0x0C, 0x12, 0x02, 0x07, 0x02, 0x02, 0x02, 0x00 }, // f
{ 0x00, 0x1E, 0x11, 0x11, 0x1E, 0x10, 0x0E, 0x00 }, // g
{ 0x01, 0x01, 0x0D, 0x13, 0x11, 0x11, 0x11, 0x00 }, // h
{ 0x04, 0x00, 0x06, 0x04, 0x04, 0x04, 0x0E, 0x00 }, // i
{ 0x08, 0x00, 0x0C, 0x08, 0x08, 0x09, 0x06, 0x00 }, // j
{ 0x02, 0x02, 0x12, 0x0A, 0x06, 0x0A, 0x12, 0x00 }, // k
{ 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0E, 0x00 }, // l
{ 0x00, 0x00, 0x0B, 0x15, 0x15, 0x11, 0x11, 0x00 }, // m
{ 0x00, 0x00, 0x0D, 0x13, 0x11, 0x11, 0x11, 0x00 }, // n
{ 0x00, 0x00, 0x0E, 0x11, 0x11, 0x11, 0x0E, 0x00 }, // o
{ 0x00, 0x00, 0x0F, 0x11, 0x0F, 0x01, 0x01, 0x00 }, // p
{ 0x00, 0x00, 0x16, 0x19, 0x1E, 0x10, 0x10, 0x00 }, // q
{ 0x00, 0x00, 0x0D, 0x13, 0x01, 0x01, 0x01, 0x00 }, // r
{ 0x00, 0x00, 0x0E, 0x01, 0x0E, 0x10, 0x0F, 0x00 }, // s
{ 0x02, 0x02, 0x07, 0x02, 0x02, 0x12, 0x0C, 0x00 }, // t
{ 0x00, 0x00, 0x11, 0x11, 0x11, 0x19, 0x16, 0x00 }, // u
{ 0x00, 0x00, 0x11, 0x11, 0x11, 0x0A, 0x04, 0x00 }, // v
{ 0x00, 0x00, 0x11, 0x11, 0x15, 0x15, 0x0A, 0x00 }, // w
{ 0x00, 0x00, 0x11, 0x0A, 0x04, 0x0A, 0x11, 0x00 }, // x
{ 0x00, 0x00, 0x11, 0x11, 0x1E, 0x10, 0x0E, 0x00 }, // y
{ 0x00, 0x00, 0x1F, 0x08, 0x04, 0x02, 0x1F, 0x00 }, // z
{ 0x18, 0x04, 0x04, 0x02, 0x04, 0x04, 0x18, 0x00 }, // {
{ 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00 }, // |
{ 0x03, 0x04, 0x04, 0x08, 0x04, 0x04, 0x03, 0x00 }, // }
{ 0x00, 0x02, 0x15, 0x08, 0x00, 0x00, 0x00, 0x00 }, // ~
{ 0x1F, 0x1F, 0x11, 0x1F, 0x11, 0x1F, 0x1F, 0x00 }, // ?
{ 0x00, 0x00, 0x0E, 0x0A, 0x0A, 0x0A, 0x0E, 0x00 }, // ?
{ 0x00, 0x00, 0x04, 0x06, 0x04, 0x04, 0x04, 0x00 }, // ?
{ 0x00, 0x00, 0x06, 0x08, 0x04, 0x02, 0x0E, 0x00 }, // ?
{ 0x00, 0x00, 0x06, 0x08, 0x04, 0x08, 0x06, 0x00 }, // ?
{ 0x00, 0x00, 0x02, 0x0A, 0x0E, 0x08, 0x08, 0x00 }, // ?
{ 0x00, 0x00, 0x0E, 0x02, 0x06, 0x08, 0x06, 0x00 }, // ?
{ 0x00, 0x00, 0x0C, 0x02, 0x0E, 0x0A, 0x0E, 0x00 }, // ?
{ 0x00, 0x00, 0x0E, 0x08, 0x04, 0x02, 0x02, 0x00 }, // ?
{ 0x00, 0x00, 0x0E, 0x0A, 0x0E, 0x0A, 0x0E, 0x00 }, // ?
{ 0x00, 0x00, 0x0E, 0x0A, 0x0E, 0x08, 0x06, 0x00 }, // ?
{ 0x08, 0x04, 0x0E, 0x11, 0x11, 0x1F, 0x11, 0x00 }, // ?
{ 0x02, 0x04, 0x0E, 0x11, 0x11, 0x1F, 0x11, 0x00 }, // ?
{ 0x04, 0x0A, 0x00, 0x0E, 0x11, 0x1F, 0x11, 0x00 }, // ?
{ 0x0A, 0x00, 0x0E, 0x11, 0x11, 0x1F, 0x11, 0x00 }, // ?
{ 0x08, 0x04, 0x0E, 0x10, 0x1E, 0x11, 0x1E, 0x00 }, // ?
{ 0x02, 0x04, 0x0E, 0x10, 0x1E, 0x11, 0x1E, 0x00 }, // ?
{ 0x04, 0x0A, 0x0E, 0x10, 0x1E, 0x11, 0x1E, 0x00 }, // ?
{ 0x0A, 0x00, 0x0E, 0x10, 0x1E, 0x11, 0x1E, 0x00 }, // ?
{ 0x08, 0x04, 0x1F, 0x01, 0x0F, 0x01, 0x1F, 0x00 }, // ?
{ 0x02, 0x04, 0x1F, 0x01, 0x0F, 0x01, 0x1F, 0x00 }, // ?
{ 0x04, 0x0A, 0x1F, 0x01, 0x0F, 0x01, 0x1F, 0x00 }, // ?
{ 0x0A, 0x00, 0x1F, 0x01, 0x0F, 0x01, 0x1F, 0x00 }, // ?
{ 0x08, 0x04, 0x0E, 0x11, 0x1F, 0x01, 0x0E, 0x00 }, // ?
{ 0x02, 0x04, 0x0E, 0x11, 0x1F, 0x01, 0x0E, 0x00 }, // ?
{ 0x04, 0x0A, 0x0E, 0x11, 0x1F, 0x01, 0x0E, 0x00 }, // ?
{ 0x0A, 0x00, 0x0E, 0x11, 0x1F, 0x01, 0x0E, 0x00 }, // ?
{ 0x08, 0x04, 0x0E, 0x04, 0x04, 0x04, 0x0E, 0x00 }, // ?
{ 0x02, 0x04, 0x0E, 0x04, 0x04, 0x04, 0x0E, 0x00 }, // ?
{ 0x04, 0x0A, 0x0E, 0x04, 0x04, 0x04, 0x0E, 0x00 }, // ?
{ 0x0A, 0x00, 0x0E, 0x04, 0x04, 0x04, 0x0E, 0x00 }, // ?
{ 0x08, 0x04, 0x00, 0x06, 0x04, 0x04, 0x0E, 0x00 }, // ?
{ 0x02, 0x04, 0x00, 0x06, 0x04, 0x04, 0x0E, 0x00 }, // ?
{ 0x04, 0x0A, 0x00, 0x06, 0x04, 0x04, 0x0E, 0x00 }, //
{ 0x0A, 0x00, 0x00, 0x06, 0x04, 0x04, 0x0E, 0x00 }, // ¡
{ 0x08, 0x04, 0x0E, 0x11, 0x11, 0x11, 0x0E, 0x00 }, // ¢
{ 0x02, 0x04, 0x0E, 0x11, 0x11, 0x11, 0x0E, 0x00 }, // £
{ 0x04, 0x0A, 0x0E, 0x11, 0x11, 0x11, 0x0E, 0x00 }, // ¤
{ 0x0A, 0x00, 0x0E, 0x11, 0x11, 0x11, 0x0E, 0x00 }, // ¥
{ 0x08, 0x04, 0x00, 0x0E, 0x11, 0x11, 0x0E, 0x00 }, // ¦
{ 0x02, 0x04, 0x00, 0x0E, 0x11, 0x11, 0x0E, 0x00 }, // §
{ 0x04, 0x0A, 0x00, 0x0E, 0x11, 0x11, 0x0E, 0x00 }, // ¨
{ 0x0A, 0x00, 0x00, 0x0E, 0x11, 0x11, 0x0E, 0x00 }, // ©
{ 0x08, 0x04, 0x11, 0x11, 0x11, 0x11, 0x0E, 0x00 }, // ª
{ 0x02, 0x04, 0x11, 0x11, 0x11, 0x11, 0x0E, 0x00 }, // «
{ 0x04, 0x0A, 0x00, 0x11, 0x11, 0x11, 0x0E, 0x00 }, // ¬
{ 0x0A, 0x00, 0x11, 0x11, 0x11, 0x11, 0x0E, 0x00 }, // ­
{ 0x08, 0x04, 0x11, 0x11, 0x11, 0x19, 0x16, 0x00 }, // ®
{ 0x02, 0x04, 0x11, 0x11, 0x11, 0x19, 0x16, 0x00 }, // ¯
{ 0x04, 0x0A, 0x00, 0x11, 0x11, 0x19, 0x16, 0x00 }, // °
{ 0x0A, 0x00, 0x11, 0x11, 0x11, 0x19, 0x16, 0x00 }, // ±
{ 0x0E, 0x11, 0x01, 0x11, 0x0E, 0x04, 0x07, 0x00 }, // ²
{ 0x00, 0x00, 0x0E, 0x01, 0x11, 0x0E, 0x07, 0x00 }, // ³
{ 0x14, 0x0A, 0x11, 0x13, 0x15, 0x19, 0x11, 0x00 }, // ´
{ 0x14, 0x0A, 0x00, 0x0D, 0x13, 0x11, 0x11, 0x00 }, // µ
{ 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 }, // ¶
{ 0x01, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 }, // ·
{ 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // ¸
{ 0x04, 0x00, 0x04, 0x02, 0x01, 0x11, 0x0E, 0x00 }, // ¹
{ 0x04, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x00 }, // º
{ 0x00, 0x00, 0x16, 0x09, 0x09, 0x09, 0x16, 0x00 }, // »
{ 0x0C, 0x12, 0x12, 0x0E, 0x12, 0x12, 0x0D, 0x00 }, // ¼
{ 0x00, 0x00, 0x12, 0x15, 0x08, 0x08, 0x08, 0x00 }, // ½
{ 0x00, 0x00, 0x00, 0x04, 0x0A, 0x11, 0x1F, 0x00 }, // ¾
{ 0x0C, 0x02, 0x04, 0x08, 0x1E, 0x11, 0x0E, 0x00 }, // ¿
{ 0x00, 0x00, 0x0E, 0x01, 0x0F, 0x01, 0x0E, 0x00 }, // À
{ 0x0C, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0C, 0x00 }, // Á
{ 0x00, 0x02, 0x04, 0x08, 0x0C, 0x12, 0x11, 0x00 }, // Â
{ 0x00, 0x00, 0x09, 0x09, 0x09, 0x17, 0x01, 0x00 }, // Ã
{ 0x00, 0x00, 0x1F, 0x0A, 0x0A, 0x0A, 0x19, 0x00 }, // Ä
{ 0x00, 0x0C, 0x12, 0x12, 0x0E, 0x02, 0x01, 0x00 }, // Å
{ 0x1F, 0x02, 0x04, 0x08, 0x04, 0x02, 0x1F, 0x00 }, // Æ
{ 0x00, 0x00, 0x1E, 0x09, 0x09, 0x09, 0x06, 0x00 }, // Ç
{ 0x00, 0x00, 0x1E, 0x05, 0x04, 0x14, 0x08, 0x00 }, // È
{ 0x04, 0x04, 0x0E, 0x15, 0x0E, 0x04, 0x04, 0x00 }, // É
{ 0x0E, 0x11, 0x11, 0x11, 0x0A, 0x0A, 0x1B, 0x00 }, // Ê
{ 0x1F, 0x00, 0x11, 0x0A, 0x04, 0x0A, 0x11, 0x00 }, // Ë
{ 0x1F, 0x00, 0x11, 0x11, 0x1E, 0x10, 0x0E, 0x00 }, // Ì
{ 0x14, 0x08, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, // Í
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00 }, // Î
{ 0x00, 0x08, 0x0C, 0x0E, 0x0C, 0x08, 0x00, 0x00 }, // Ï
{ 0x00, 0x00, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00 }, // Ð
{ 0x08, 0x08, 0x08, 0x04, 0x02, 0x02, 0x02, 0x00 }, // Ñ
{ 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00 }, // Ò
{ 0x0E, 0x08, 0x0E, 0x02, 0x0E, 0x00, 0x00, 0x00 }, // Ó
{ 0x0E, 0x0A, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, // Ô
{ 0x06, 0x08, 0x04, 0x08, 0x06, 0x00, 0x00, 0x00 }, // Õ
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // Ö
{ 0x02, 0x00, 0x03, 0x02, 0x02, 0x0A, 0x04, 0x00 }, // ×
{ 0x04, 0x0A, 0x0F, 0x11, 0x0F, 0x01, 0x01, 0x00 }, // Ø
{ 0x01, 0x12, 0x0A, 0x04, 0x0A, 0x09, 0x10, 0x00 }, // Ù
{ 0x1F, 0x11, 0x05, 0x07, 0x05, 0x01, 0x01, 0x00 }, // Ú
{ 0x00, 0x00, 0x0E, 0x11, 0x0F, 0x01, 0x06, 0x00 }, // Û
{ 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x1C, 0x00 }, // Ü
{ 0x11, 0x13, 0x17, 0x1F, 0x1D, 0x19, 0x11, 0x00 }, // Ý
{ 0x05, 0x0A, 0x14, 0x14, 0x14, 0x0A, 0x05, 0x00 }, // Þ
{ 0x00, 0x02, 0x07, 0x0F, 0x07, 0x02, 0x00, 0x00 }, // ß
{ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00 }, // à
{ 0x1F, 0x1B, 0x11, 0x0A, 0x1B, 0x1B, 0x1B, 0x00 }, // á
{ 0x1F, 0x1B, 0x15, 0x11, 0x15, 0x15, 0x1F, 0x00 }, // â
{ 0x1F, 0x1B, 0x17, 0x13, 0x15, 0x13, 0x1F, 0x00 }, // ã
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00 }, // ä
{ 0x04, 0x0E, 0x15, 0x04, 0x04, 0x00, 0x1F, 0x00 }, // å
{ 0x04, 0x0A, 0x0E, 0x0A, 0x0A, 0x00, 0x1F, 0x00 }, // æ
{ 0x04, 0x08, 0x0C, 0x0A, 0x0C, 0x00, 0x1F, 0x00 }, // ç
{ 0x00, 0x00, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00 }, // è
{ 0x03, 0x07, 0x0E, 0x1C, 0x18, 0x10, 0x00, 0x00 }, // é
{ 0x1F, 0x1E, 0x1C, 0x18, 0x10, 0x00, 0x00, 0x00 }, // ê
{ 0x00, 0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x00 }, // ë
{ 0x00, 0x08, 0x14, 0x17, 0x14, 0x08, 0x00, 0x00 }, // ì
{ 0x00, 0x04, 0x0A, 0x0A, 0x0A, 0x04, 0x00, 0x00 }, // í
{ 0x00, 0x01, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00 }, // î
{ 0x04, 0x0E, 0x1F, 0x0E, 0x0E, 0x0E, 0x00, 0x00 }, // ï
{ 0x00, 0x0E, 0x0E, 0x0E, 0x1F, 0x0E, 0x04, 0x00 }, // ð
{ 0x15, 0x0A, 0x15, 0x0A, 0x15, 0x0A, 0x15, 0x00 }, // ñ
{ 0x04, 0x1E, 0x05, 0x0E, 0x14, 0x0F, 0x04, 0x00 }, // ò
{ 0x04, 0x0E, 0x1F, 0x0E, 0x0E, 0x00, 0x00, 0x00 }, // ó
{ 0x06, 0x09, 0x09, 0x0D, 0x11, 0x11, 0x0D, 0x00 }, // ô
{ 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x1F, 0x00 }, // õ
{ 0x00, 0x10, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x00 }, // ö
{ 0x15, 0x00, 0x11, 0x00, 0x11, 0x00, 0x15, 0x00 }, // ÷
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // ø
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // ù
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // ú
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // û
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // ü
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // ý
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // þ
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } // ÿ
};
static uint16_t font[65536][16] ={};
struct fontfile {
char magic[4];
uint32_t no_char;
uint32_t charmap_off; //Should be 0x20
uint32_t charwidth_off;
uint32_t chr_off;
char reserved[12];
}__attribute__((packed));
struct charmap {
short charnumber;
char seperator;
}__attribute__((packed));
struct charwidth {
char width; //either 8 or 16
}__attribute__((packed));
struct CHR8 {
uint8_t rows[16];
}__attribute__((packed));
struct CHR16 {
uint16_t rows[16];
}__attribute__((packed));

Binary file not shown.

BIN
mtgos.fnt Executable file

Binary file not shown.

BIN
test.elf

Binary file not shown.

View file

@ -1,5 +1,5 @@
include ../kernel.settings
SRCS = $(shell find -name '*.cpp')
SRCS = $(shell find . -name '*.cpp')
OBJS = $(addsuffix .o,$(basename $(SRCS)))
AS = $(PREFIX)gcc
CPP = $(PREFIX)g++