summaryrefslogtreecommitdiff
path: root/kernel/io/psf2.h
blob: e8dda444d2073270a70c5d715719f107e05a4f00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef HOS_IO_PSF2_H
#define HOS_IO_PSF2_H

#include <cstdint>
#include <io/font.h>

#define PSF2_MAGIC0 0x72
#define PSF2_MAGIC1 0xb5
#define PSF2_MAGIC2 0x4a
#define PSF2_MAGIC3 0x86

#define PSF2_HAS_UNICODE_TABLE 0x01

#define PSF2_SEPARATOR 0xff
#define PSF2_STARTSEQ 0xfe

namespace hos::io
{
    class psf2 : public font
    {
    public:
        psf2            (void *font_start_addr);

        void    write   (unsigned char character, void *fb_addr, std::uint16_t bpp);
    private:
        unsigned char   magic[4];
        unsigned int    version;
        unsigned int    header_size;
        unsigned int    flags;
        unsigned int    length;
        unsigned int    charsize;
        unsigned int    height;
        unsigned int    width;
    };
}

#endif