2525static struct flanterm_context * ft_ctx ;
2626static spinlock_t term_lock ;
2727
28+ static uint32_t ft_ansi_colours [8 ] = {
29+ 0x00282828 , /* black - dark0 (#282828) */
30+ 0x00cc241d , /* red - neutral_red (#cc241d) */
31+ 0x0098971a , /* green - neutral_green (#98971a) */
32+ 0x00d79921 , /* yellow - neutral_yellow (#d79921) */
33+ 0x00458588 , /* blue - neutral_blue (#458588) */
34+ 0x00b16286 , /* magenta - neutral_purple (#b16286) */
35+ 0x00689d6a , /* cyan - neutral_aqua (#689d6a) */
36+ 0x00a89984 , /* white - light4 (#a89984) */
37+ };
38+
39+ static uint32_t ft_ansi_bright_colours [8 ] = {
40+ 0x00928374 , /* bright black - gray_245 (#928374) */
41+ 0x00fb4934 , /* bright red - bright_red (#fb4934) */
42+ 0x00b8bb26 , /* bright green - bright_green (#b8bb26) */
43+ 0x00fabd2f , /* bright yellow- bright_yellow (#fabd2f) */
44+ 0x0083a598 , /* bright blue - bright_blue (#83a598) */
45+ 0x00d3869b , /* bright magenta- bright_purple (#d3869b) */
46+ 0x008ec07c , /* bright cyan - bright_aqua (#8ec07c) */
47+ 0x00fbf1c7 , /* bright white - light0 (#fbf1c7) */
48+ };
49+
50+ static uint32_t ft_default_bg = 0x00282828 ; /* dark0 (#282828) */
51+ static uint32_t ft_default_fg = 0x00ebdbb2 ; /* light1 (#ebdbb2) */
52+ static uint32_t ft_default_bg_bright = 0x003c3836 ; /* dark1 (#3c3836) */
53+ static uint32_t ft_default_fg_bright = 0x00fbf1c7 ; /* light0 (#fbf1c7) */
54+
2855void term_init (volatile struct limine_framebuffer_request * framebuffer_request )
2956{
3057 spinlock_init (& term_lock );
@@ -37,10 +64,11 @@ void term_init(volatile struct limine_framebuffer_request *framebuffer_request)
3764
3865 struct limine_framebuffer * fb = framebuffer_request -> response -> framebuffers [0 ];
3966
40- ft_ctx = flanterm_fb_init (NULL , NULL , fb -> address , fb -> width , fb -> height , fb -> pitch ,
41- fb -> red_mask_size , fb -> red_mask_shift , fb -> green_mask_size ,
42- fb -> green_mask_shift , fb -> blue_mask_size , fb -> blue_mask_shift , NULL ,
43- NULL , NULL , NULL , NULL , NULL , NULL , NULL , 0 , 0 , 1 , 0 , 0 , 0 , 0 );
67+ ft_ctx = flanterm_fb_init (
68+ NULL , NULL , fb -> address , fb -> width , fb -> height , fb -> pitch , fb -> red_mask_size ,
69+ fb -> red_mask_shift , fb -> green_mask_size , fb -> green_mask_shift , fb -> blue_mask_size ,
70+ fb -> blue_mask_shift , NULL , ft_ansi_colours , ft_ansi_bright_colours , & ft_default_bg ,
71+ & ft_default_fg , & ft_default_bg_bright , & ft_default_fg_bright , NULL , 0 , 0 , 1 , 0 , 0 , 0 , 0 );
4472}
4573
4674void term_write (const char * buf , size_t len )
0 commit comments