diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2025-04-26 02:50:50 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2025-04-26 02:50:50 +0200 |
commit | 57db102b3d034ece373d8e953dfd0c0524a6a08c (patch) | |
tree | fd238acb34aee8ae35baea9c46b14b1d46959cd6 | |
parent | 22d045066fdcd8a27e76102102d966cf46abd422 (diff) | |
download | reduced_system_layer-57db102b3d034ece373d8e953dfd0c0524a6a08c.zip |
Cleanup
-rw-r--r-- | graphics.c | 162 |
1 files changed, 31 insertions, 131 deletions
@@ -921,110 +921,39 @@ void fill_line_to_buffer(Pixel_Buffer dst, vec4_f32 color, vec2 vertices[2], f64 // // ================================================================ -static u64 _lcd_bits[] = { - 0x10001010101ull, - 0x505ull, - 0xa1f0a0a1f0a00ull, - 0x40e140e050e04ull, - 0x814081f020502ull, - 0x7090503060506ull, - 0x101ull, - 0x2010101010102ull, - 0x1020202020201ull, - 0x120c3f0c12ull, - 0x4041f040400ull, - 0x1020000000000ull, - 0x1f000000ull, - 0x10000000000ull, - 0x1010202020404ull, - 0x70505050700ull, - 0x70202020300ull, - 0x70102040700ull, - 0x70402040700ull, - 0x40407050500ull, - 0x30407010700ull, - 0x70507010600ull, - 0x20202040700ull, - 0x70507050700ull, - 0x30407050700ull, - 0x10000010000ull, - 0x1020000020000ull, - 0x40201020400ull, - 0x1f001f0000ull, - 0x10204020100ull, - 0x20002040502ull, - 0xe01191519110eull, - 0x9090f090906ull, - 0x70909070907ull, - 0x60901010906ull, - 0x70909090907ull, - 0xf010107010full, - 0x1010107010full, - 0x6090d010906ull, - 0x909090f0909ull, - 0x70202020207ull, - 0x20504040407ull, - 0x90905030509ull, - 0x70101010101ull, - 0x1111151f1b11ull, - 0x111119151311ull, - 0x60909090906ull, - 0x10107090907ull, - 0x8060909090906ull, - 0x90907090907ull, - 0x60908060106ull, - 0x4040404041full, - 0x60909090909ull, - 0x40a11111111ull, - 0xa1f15151111ull, - 0x11110a040a11ull, - 0x102040a1111ull, - 0xf010204080full, - 0x3010101010103ull, - 0x4040202020101ull, - 0x3020202020203ull, - 0x110a04ull, - 0x3f000000000000ull, - 0x201ull, - 0x6090f080600ull, - 0x70909070100ull, - 0x60901090600ull, - 0xe09090e0800ull, - 0x6010f090600ull, - 0x20207020600ull, - 0x6080e09090600ull, - 0x90907010100ull, - 0x70203000200ull, - 0x1020203000200ull, - 0x50503050500ull, - 0x20101010101ull, - 0x151515150f00ull, - 0x90909090700ull, - 0x60909090600ull, - 0x10709090700ull, - 0x80e09090e00ull, - 0x10101030500ull, - 0x60806010600ull, - 0x20202020700ull, - 0xe0909090900ull, - 0x40a11111100ull, - 0xa1f15111100ull, - 0x110a040a1100ull, - 0x102040a1100ull, - 0xf0106080f00ull, - 0x4020201020204ull, - 0x1010101010101ull, - 0x1020204020201ull, - 0x1926ull, +enum { + LCD_Width = 6, + LCD_Height = 7, + LCD_First = 33, + LCD_Space = 4, + LCD_Len = 94, }; -enum { - LCD_Width = 6, - LCD_Height = 7, - LCD_Num_Bits = LCD_Width * LCD_Height, - LCD_First = 33, - LCD_Space = 4, - LCD_Len = sizeof(_lcd_bits) / sizeof(*_lcd_bits), +static u64 _lcd_bits[LCD_Len] = { + 0x10001010101ull, 0x505ull, 0xa1f0a0a1f0a00ull, 0x40e140e050e04ull, + 0x814081f020502ull, 0x7090503060506ull, 0x101ull, 0x2010101010102ull, + 0x1020202020201ull, 0x120c3f0c12ull, 0x4041f040400ull, 0x1020000000000ull, + 0x1f000000ull, 0x10000000000ull, 0x1010202020404ull, 0x70505050700ull, + 0x70202020300ull, 0x70102040700ull, 0x70402040700ull, 0x40407050500ull, + 0x30407010700ull, 0x70507010600ull, 0x20202040700ull, 0x70507050700ull, + 0x30407050700ull, 0x10000010000ull, 0x1020000020000ull, 0x40201020400ull, + 0x1f001f0000ull, 0x10204020100ull, 0x20002040502ull, 0xe01191519110eull, + 0x9090f090906ull, 0x70909070907ull, 0x60901010906ull, 0x70909090907ull, + 0xf010107010full, 0x1010107010full, 0x6090d010906ull, 0x909090f0909ull, + 0x70202020207ull, 0x20504040407ull, 0x90905030509ull, 0x70101010101ull, + 0x1111151f1b11ull, 0x111119151311ull, 0x60909090906ull, 0x10107090907ull, + 0x8060909090906ull, 0x90907090907ull, 0x60908060106ull, 0x4040404041full, + 0x60909090909ull, 0x40a11111111ull, 0xa1f15151111ull, 0x11110a040a11ull, + 0x102040a1111ull, 0xf010204080full, 0x3010101010103ull, 0x4040202020101ull, + 0x3020202020203ull, 0x110a04ull, 0x3f000000000000ull, 0x201ull, + 0x6090f080600ull, 0x70909070100ull, 0x60901090600ull, 0xe09090e0800ull, + 0x6010f090600ull, 0x20207020600ull, 0x6080e09090600ull, 0x90907010100ull, + 0x70203000200ull, 0x1020203000200ull, 0x50503050500ull, 0x20101010101ull, + 0x151515150f00ull, 0x90909090700ull, 0x60909090600ull, 0x10709090700ull, + 0x80e09090e00ull, 0x10101030500ull, 0x60806010600ull, 0x20202020700ull, + 0xe0909090900ull, 0x40a11111100ull, 0xa1f15111100ull, 0x110a040a1100ull, + 0x102040a1100ull, 0xf0106080f00ull, 0x4020201020204ull, 0x1010101010101ull, + 0x1020204020201ull, 0x1926ull, }; u8 _lcd_widths[LCD_Len] = { @@ -1132,35 +1061,6 @@ u64 _lcd_kerning[LCD_Len * 2] = { 0x9fffffffe1df81f3ull, 0x3bfabc82ull, }; -static u64 lcd_column_convolved_(c32 c, i64 column_index) { - if (column_index < 0 || column_index >= LCD_Width) - return 0; - - i64 index = c - LCD_First; - if (index < 0 || index >= LCD_Len) - return 0; - - u64 column = 0; - for (i64 y = 0; y < LCD_Height; ++y) - if ((_lcd_bits[index] & (1ull << (y * 8 + column_index))) != 0) - column |= 3ull << y; - return column; -} - -static b8 lcd_column_empty_(c32 c, i64 column_index) { - if (column_index < 0 || column_index >= LCD_Width) - return 1; - - i64 index = c - LCD_First; - if (index < 0 || index >= LCD_Len) - return 1; - - for (i64 y = 0; y < LCD_Height; ++y) - if ((_lcd_bits[index] & (1ull << (y * 8 + column_index))) != 0) - return 0; - return 1; -} - static i64 lcd_char_width_(c32 c) { i64 index = c - LCD_First; if (index < -1) |