From ab32731f4dce3175106ff6fea6f54e1fd6de180f Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Mon, 28 Jul 2025 09:39:13 +0200 Subject: [PATCH] dump --- Firmware/.gitignore | 1 + Firmware/.vscode/c_cpp_properties.json | 23 + Firmware/.vscode/launch.json | 15 + Firmware/.vscode/settings.json | 4 + Firmware/components/sdk-esp/CMakeLists.txt | 5 + Firmware/main/CMakeLists.txt | 2 +- Firmware/main/include/disp_tools.hpp | 28 +- Firmware/main/include/display.hpp | 26 + Firmware/main/src/disp_tools.cpp | 10 - Firmware/main/src/display.cpp | 23 + Firmware/main/src/hello_world_main.cpp | 100 +- Firmware/sdk/.clang-format | 76 + Firmware/sdk/CMakeLists.txt | 11 + Firmware/sdk/examples/CMakeLists.txt | 0 Firmware/sdk/library/CMakeLists.txt | 22 + Firmware/sdk/library/include_public/Event.hpp | 137 + Firmware/sdk/library/include_public/Fonts.hpp | 4878 +++++++++++++++++ .../sdk/library/include_public/GridWindow.hpp | 120 + Firmware/sdk/library/include_public/Pixel.hpp | 21 + .../library/include_public/StandardEvents.hpp | 163 + .../sdk/library/include_public/SubSurface.hpp | 60 + .../sdk/library/include_public/Surface.hpp | 75 + .../sdk/library/include_public/TextWindow.hpp | 70 + .../sdk/library/include_public/Window.hpp | 39 + Firmware/sdk/library/include_public/utils.hpp | 14 + Firmware/sdk/library/src/Event.cpp | 5 + Firmware/sdk/library/src/TextWindow.cpp | 8 + Firmware/sdk/library/src/Window.cpp | 5 + Firmware/sdk/library/test/CMakeLists.txt | 23 + Firmware/sdk/library/test/src/EventTests.cpp | 44 + Firmware/sdk/sfml-port/CMakeLists.txt | 43 + .../sfml-port/include_public/SfmlWindow.hpp | 41 + Firmware/sdk/sfml-port/src/SfmlWindow.cpp | 39 + Firmware/sdk/sfml-port/src/main.cpp | 66 + Firmware/sdkconfig.old | 170 +- 35 files changed, 6157 insertions(+), 210 deletions(-) create mode 100644 Firmware/.vscode/c_cpp_properties.json create mode 100644 Firmware/.vscode/launch.json create mode 100644 Firmware/.vscode/settings.json create mode 100644 Firmware/components/sdk-esp/CMakeLists.txt create mode 100644 Firmware/sdk/.clang-format create mode 100644 Firmware/sdk/CMakeLists.txt create mode 100644 Firmware/sdk/examples/CMakeLists.txt create mode 100644 Firmware/sdk/library/CMakeLists.txt create mode 100644 Firmware/sdk/library/include_public/Event.hpp create mode 100644 Firmware/sdk/library/include_public/Fonts.hpp create mode 100644 Firmware/sdk/library/include_public/GridWindow.hpp create mode 100644 Firmware/sdk/library/include_public/Pixel.hpp create mode 100644 Firmware/sdk/library/include_public/StandardEvents.hpp create mode 100644 Firmware/sdk/library/include_public/SubSurface.hpp create mode 100644 Firmware/sdk/library/include_public/Surface.hpp create mode 100644 Firmware/sdk/library/include_public/TextWindow.hpp create mode 100644 Firmware/sdk/library/include_public/Window.hpp create mode 100644 Firmware/sdk/library/include_public/utils.hpp create mode 100644 Firmware/sdk/library/src/Event.cpp create mode 100644 Firmware/sdk/library/src/TextWindow.cpp create mode 100644 Firmware/sdk/library/src/Window.cpp create mode 100644 Firmware/sdk/library/test/CMakeLists.txt create mode 100644 Firmware/sdk/library/test/src/EventTests.cpp create mode 100644 Firmware/sdk/sfml-port/CMakeLists.txt create mode 100644 Firmware/sdk/sfml-port/include_public/SfmlWindow.hpp create mode 100644 Firmware/sdk/sfml-port/src/SfmlWindow.cpp create mode 100644 Firmware/sdk/sfml-port/src/main.cpp diff --git a/Firmware/.gitignore b/Firmware/.gitignore index 1c008f7..20eed54 100644 --- a/Firmware/.gitignore +++ b/Firmware/.gitignore @@ -1,3 +1,4 @@ build cmake-build* .idea +.cache diff --git a/Firmware/.vscode/c_cpp_properties.json b/Firmware/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..9c471ea --- /dev/null +++ b/Firmware/.vscode/c_cpp_properties.json @@ -0,0 +1,23 @@ +{ + "configurations": [ + { + "name": "ESP-IDF", + "compilerPath": "${config:idf.toolsPath}/tools/riscv32-esp-elf/esp-14.2.0_20241119/riscv32-esp-elf/bin/riscv32-esp-elf-gcc", + "compileCommands": "${config:idf.buildPath}/compile_commands.json", + "includePath": [ + "${config:idf.espIdfPath}/components/**", + "${config:idf.espIdfPathWin}/components/**", + "${workspaceFolder}/**" + ], + "browse": { + "path": [ + "${config:idf.espIdfPath}/components", + "${config:idf.espIdfPathWin}/components", + "${workspaceFolder}" + ], + "limitSymbolsToIncludedHeaders": true + } + } + ], + "version": 4 +} diff --git a/Firmware/.vscode/launch.json b/Firmware/.vscode/launch.json new file mode 100644 index 0000000..2511a38 --- /dev/null +++ b/Firmware/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "gdbtarget", + "request": "attach", + "name": "Eclipse CDT GDB Adapter" + }, + { + "type": "espidf", + "name": "Launch", + "request": "launch" + } + ] +} \ No newline at end of file diff --git a/Firmware/.vscode/settings.json b/Firmware/.vscode/settings.json new file mode 100644 index 0000000..dd28fb0 --- /dev/null +++ b/Firmware/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "idf.flashType": "JTAG", + "idf.port": "/dev/tty.usbmodem12401" +} diff --git a/Firmware/components/sdk-esp/CMakeLists.txt b/Firmware/components/sdk-esp/CMakeLists.txt new file mode 100644 index 0000000..bd9fc90 --- /dev/null +++ b/Firmware/components/sdk-esp/CMakeLists.txt @@ -0,0 +1,5 @@ +idf_component_register() + +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../../sdk" cb-sdk-build) + +target_link_libraries(${COMPONENT_LIB} INTERFACE cbsdk) \ No newline at end of file diff --git a/Firmware/main/CMakeLists.txt b/Firmware/main/CMakeLists.txt index beaa9c3..f0dd86d 100644 --- a/Firmware/main/CMakeLists.txt +++ b/Firmware/main/CMakeLists.txt @@ -9,5 +9,5 @@ idf_component_register(SRCS src/shutdowner.cpp src/buttons.cpp src/power_helper.cpp - PRIV_REQUIRES spi_flash esp_driver_i2c driver + PRIV_REQUIRES spi_flash esp_driver_i2c driver sdk-esp INCLUDE_DIRS "include") diff --git a/Firmware/main/include/disp_tools.hpp b/Firmware/main/include/disp_tools.hpp index eb7d1a1..a8f67a5 100644 --- a/Firmware/main/include/disp_tools.hpp +++ b/Firmware/main/include/disp_tools.hpp @@ -11,10 +11,30 @@ class DispTools { public: static DispTools& get(); - void clear(); - bool get_pixel(int x, int y); - void set_pixel(int x, int y); - void reset_pixel(int x, int y); + void clear() { + for (int y = 0; y < DISP_HEIGHT; y++) { + for (int x = 0; x < DISP_WIDTH; x++) { + disp_frame[y][x] = 1; + } + } + } + bool get_pixel(int x, int y) { + // if (x < 0 || x >= DISP_WIDTH || y < 0 || y >= DISP_HEIGHT) + // assert(false); + return disp_frame[y][x]; + } + void reset_pixel(int x, int y) { + // if (x < 0 || x >= DISP_WIDTH || y < 0 || y >= DISP_HEIGHT) + // assert(false); + + disp_frame[y][x] = true; + } + void set_pixel(int x, int y) { + // if (x < 0 || x >= DISP_WIDTH || y < 0 || y >= DISP_HEIGHT) + // assert(false); + // + disp_frame[y][x] = false; + } void draw_rectangle(int x1, int y1, int x2, int y2); void draw_line(int x1, int y1, int x2, int y2); void draw_circle(int x, int y, int r); diff --git a/Firmware/main/include/display.hpp b/Firmware/main/include/display.hpp index 402e761..a9f85b7 100644 --- a/Firmware/main/include/display.hpp +++ b/Firmware/main/include/display.hpp @@ -12,6 +12,9 @@ #include #include +#include "Surface.hpp" +#include "Window.hpp" + class SMD { public: using disp_line_t = std::bitset<400>; @@ -41,4 +44,27 @@ private: std::array prep_line(const SMD::disp_line_t& line); }; +class SMDSurface : public Surface, public StandardEventQueue { +public: + SMDSurface(EventLoop* loop); + + ~SMDSurface() override; + + void draw_pixel_impl(unsigned x, unsigned y, const BwPixel& pixel); + + void clear_impl(); + + int get_width_impl() const; + + int get_height_impl() const; + + template + EventHandlingResult handle(const T& event) { + return _window->handle(event); + } + + EventHandlingResult handle(SurfaceResizeEvent event); +}; + + #endif // DISPLAY_HPP diff --git a/Firmware/main/src/disp_tools.cpp b/Firmware/main/src/disp_tools.cpp index fa6a69d..ddd6a19 100644 --- a/Firmware/main/src/disp_tools.cpp +++ b/Firmware/main/src/disp_tools.cpp @@ -13,16 +13,6 @@ DispTools& DispTools::get() { return disp_tools; } -void DispTools::clear() { - for (int y = 0; y < DISP_HEIGHT; y++) { - for (int x = 0; x < DISP_WIDTH; x++) { - disp_frame[y][x] = 1; - } - } -} -bool DispTools::get_pixel(int x, int y) { return disp_frame[y][x]; } -void DispTools::reset_pixel(int x, int y) { disp_frame[y][x] = true; } -void DispTools::set_pixel(int x, int y) { disp_frame[y][x] = false; } void DispTools::draw_rectangle(int x1, int y1, int x2, int y2) { int dy = y2 - y1; while (std::abs(dy) > 0) { diff --git a/Firmware/main/src/display.cpp b/Firmware/main/src/display.cpp index 9dd8eaf..dda679e 100644 --- a/Firmware/main/src/display.cpp +++ b/Firmware/main/src/display.cpp @@ -9,6 +9,8 @@ #include #include "driver/spi_master.h" +#include "disp_tools.hpp" + // This solution is attributed to Rich Schroeppel in the Programming Hacks section // TODO: Why does the device flag not work? unsigned char reverse_bits3(unsigned char b) { return (b * 0x0202020202ULL & 0x010884422010ULL) % 0x3ff; } @@ -68,3 +70,24 @@ void SMD::draw(const disp_frame_t& frame) { ESP_ERROR_CHECK(spi_device_transmit(_spi, &t)); } } + +void SMDSurface::draw_pixel_impl(unsigned x, unsigned y, const BwPixel& pixel) { + if (pixel.on) + DispTools::get().set_pixel(x, y); + else + DispTools::get().reset_pixel(x, y); +} + +void SMDSurface::clear_impl() { DispTools::get().clear(); } + +int SMDSurface::get_width_impl() const { return DISP_WIDTH; } + +int SMDSurface::get_height_impl() const { return DISP_HEIGHT; } + +EventHandlingResult SMDSurface::handle(SurfaceResizeEvent event) { return _window->handle(event); } + +SMDSurface::SMDSurface(EventLoop* loop) : + Surface(), + EventQueue(loop, this) {} + +SMDSurface::~SMDSurface() {} diff --git a/Firmware/main/src/hello_world_main.cpp b/Firmware/main/src/hello_world_main.cpp index f4d8998..ba665e6 100644 --- a/Firmware/main/src/hello_world_main.cpp +++ b/Firmware/main/src/hello_world_main.cpp @@ -33,13 +33,19 @@ #include #include +#include + +#include "GridWindow.hpp" +#include "TextWindow.hpp" +#include "display.hpp" + FbTty tty; extern "C" void app_main() { esp_pm_config_t pm_config = { .max_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ, .min_freq_mhz = 16, .light_sleep_enable = true}; - // ESP_ERROR_CHECK(esp_pm_configure(&pm_config)); + ESP_ERROR_CHECK(esp_pm_configure(&pm_config)); printf("Hello world!\n"); // TODO: Where to put that? ESP_ERROR_CHECK(esp_sleep_enable_gpio_wakeup()); @@ -58,7 +64,7 @@ extern "C" void app_main() { SMD::get(); SMD::get().clear(); DispTools::get().clear(); - DispTools::get().draw_line(0, 0, 400, 240); + DispTools::get().draw_line(0, 0, 399, 239); DispTools::get().draw_circle(100, 100, 20); DispTools::get().draw_to_display(); tty.putstr("Hello\nworld!"); @@ -68,21 +74,59 @@ extern "C" void app_main() { int lastmove = 0; + EventLoop loop; + SMDSurface surface(&loop); + + surface.set_window>(); + + GridWindow* window = + static_cast*>(surface.get_window()); + window->set_window, BwPixel, std::string>>(0, 0, &loop, "hello"); + window->set_window, BwPixel, std::string>>(0, 1, &loop, "hello1"); + window->set_window, BwPixel, 2, 2>>(1, 0); + GridWindow, BwPixel, 2, 2>* window2 = + static_cast, BwPixel, 2, 2>*>( + window->get_subsurface(1, 0).get_window()); + window->set_window, BwPixel, std::string>>(1, 1, &loop, "hello3"); + + window2->set_window, BwPixel>, BwPixel, std::string>>( + 0, 0, &loop, "hello2"); + window2->set_window, BwPixel>, BwPixel, std::string>>( + 0, 1, &loop, "hello4"); + window2->set_window, BwPixel>, BwPixel, std::string>>( + 1, 0, &loop, "hello5"); + window2->set_window, BwPixel>, BwPixel, std::string>>( + 1, 1, &loop, "hello6"); + + auto* tl_text = static_cast, BwPixel, std::string>*>( + window->get_subsurface(0, 0).get_window()); + + surface.handle(SurfaceResizeEvent{DISP_WIDTH, DISP_HEIGHT}); + std::thread loop_thread{[&] { loop.run([&] { DispTools::get().draw_to_display(); }); }}; + + uint8_t old_pressed = 0; + while (true) { // SMD::clear(); // printf("Voltage: %f\n", BatMon::get_voltage()); - DispTools::get().clear(); - tty.reset(); + // DispTools::get().clear(); + // tty.reset(); uint8_t pressed = Buttons::get().get_pressed(); - if (pressed & BTN_LEFT) - rx -= 5; - if (pressed & BTN_DOWN) - ry += 5; - if (pressed & BTN_UP) - ry -= 5; - if (pressed & BTN_RIGHT) - rx += 5; + if ((pressed & BTN_LEFT) && !(old_pressed & BTN_LEFT)) + surface.push(KeyboardEvent{Key::Left}); + if ((pressed & BTN_DOWN) && !(old_pressed & BTN_DOWN)) + surface.push(KeyboardEvent{Key::Down}); + if ((pressed & BTN_UP) && !(old_pressed & BTN_UP)) + surface.push(KeyboardEvent{Key::Up}); + if ((pressed & BTN_RIGHT) && !(old_pressed & BTN_RIGHT)) + surface.push(KeyboardEvent{Key::Right}); + if ((pressed & BTN_SELECT) && !(old_pressed & BTN_SELECT)) + surface.push(KeyboardEvent{Key::Escape}); + if ((pressed & BTN_START) && !(old_pressed & BTN_START)) + surface.push(KeyboardEvent{Key::Enter}); + + old_pressed = pressed; if (pressed == 0 && !PowerHelper::get().is_slow()) lastmove++; @@ -97,26 +141,26 @@ extern "C" void app_main() { } bool slow = PowerHelper::get().is_slow(); - tty.fmt("{:.1f}mA {:.1f}V {:.1f}mAh {}", BatMon::get().get_current(), BatMon::get().get_voltage(), - BatMon::get().get_charge(), slow ? "S" : ""); + tl_text->push(TextUpdateEvent(std::format("{:.1f}mA {:.1f}V {:.1f}mAh {}\n Buttons: {:08b}", + BatMon::get().get_current(), BatMon::get().get_voltage(), + BatMon::get().get_charge(), slow ? "S" : "", pressed))); - tty.fmt("Buttons: {:08b}", pressed); - - if (rx < 30) - rx = 30; - if (rx > 370) - rx = 370; - if (ry < 30) - ry = 30; - if (ry > 210) - ry = 210; - // tty.fmt("Button: {}", pressed); - DispTools::get().draw_circle(rx, ry, 20); - // printf("Restarting in %d seconds...\n", i); - DispTools::get().draw_to_display(); + // if (rx < 30) + // rx = 30; + // if (rx > 370) + // rx = 370; + // if (ry < 30) + // ry = 30; + // if (ry > 210) + // ry = 210; + // // tty.fmt("Button: {}", pressed); + // DispTools::get().draw_circle(rx, ry, 20); + // // printf("Restarting in %d seconds...\n", i); + // DispTools::get().draw_to_display(); PowerHelper::get().delay(10000, 30); } // printf("Restarting now.\n"); // fflush(stdout); // esp_restart(); + loop_thread.join(); } diff --git a/Firmware/sdk/.clang-format b/Firmware/sdk/.clang-format new file mode 100644 index 0000000..c700749 --- /dev/null +++ b/Firmware/sdk/.clang-format @@ -0,0 +1,76 @@ +# Generated from CLion C/C++ Code Style settings +--- +Language: Cpp +BasedOnStyle: LLVM +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false +AlignConsecutiveBitFields: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false +AlignConsecutiveDeclarations: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false +AlignConsecutiveMacros: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false +AlignTrailingComments: + Kind: Always + OverEmptyLines: 2 +SpacesBeforeTrailingComments: 1 +AlignOperands: Align +AlignEscapedNewlines: Right +AlwaysBreakTemplateDeclarations: Yes +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBraces: Custom +BreakConstructorInitializers: AfterColon +BreakConstructorInitializersBeforeComma: false +ColumnLimit: 120 +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ContinuationIndentWidth: 8 +IncludeCategories: + - Regex: '^<.*' + Priority: 1 + - Regex: '^".*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IncludeIsMainRegex: '([-_](test|unittest))?$' +IndentCaseLabels: true +IndentWidth: 4 +InsertNewlineAtEOF: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 2 +PointerAlignment: Left +SpaceAfterCStyleCast: true +SpaceAfterTemplateKeyword: false +SpaceBeforeRangeBasedForLoopColon: false +SpaceInEmptyParentheses: false +SpacesInAngles: false +SpacesInConditionalStatement: false +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +... diff --git a/Firmware/sdk/CMakeLists.txt b/Firmware/sdk/CMakeLists.txt new file mode 100644 index 0000000..d8611bf --- /dev/null +++ b/Firmware/sdk/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.10) +project(sdk-top) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED YES) + +add_subdirectory(library) +if (NOT CMAKE_CROSSCOMPILING) + add_subdirectory(sfml-port) + add_subdirectory(examples) +endif () diff --git a/Firmware/sdk/examples/CMakeLists.txt b/Firmware/sdk/examples/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/Firmware/sdk/library/CMakeLists.txt b/Firmware/sdk/library/CMakeLists.txt new file mode 100644 index 0000000..1eac6a5 --- /dev/null +++ b/Firmware/sdk/library/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.10) + +add_library(cbsdk + src/Window.cpp + include_public/Window.hpp + include_public/Pixel.hpp + src/Event.cpp + include_public/Event.hpp + include_public/StandardEvents.hpp + include_public/Surface.hpp + include_public/Fonts.hpp + src/TextWindow.cpp + include_public/TextWindow.hpp + include_public/utils.hpp + include_public/SubSurface.hpp) + +target_include_directories(cbsdk PUBLIC include_public) +target_include_directories(cbsdk PRIVATE include) + +if (NOT CMAKE_CROSSCOMPILING) + add_subdirectory(test) +endif () \ No newline at end of file diff --git a/Firmware/sdk/library/include_public/Event.hpp b/Firmware/sdk/library/include_public/Event.hpp new file mode 100644 index 0000000..b633fe0 --- /dev/null +++ b/Firmware/sdk/library/include_public/Event.hpp @@ -0,0 +1,137 @@ +// +// Created by Stepan Usatiuk on 26.07.2025. +// + +#ifndef EVENT_HPP +#define EVENT_HPP + +#include +#include +#include +#include +#include +#include +#include + +enum class EventHandlingResult { DONE, IGNORE, CONTINUE }; + +class Event {}; + +struct LoopQuitEvent : public Event {}; + +template +concept IsEvent = std::is_base_of_v; + +template +concept HasHandleFor = requires(H h, E e) { + { h.handle(e) } -> std::same_as; +}; + +template +concept HandlesAll = (HasHandleFor && ...); + +template + requires(IsEvent && ...) +class EventHandler { +public: + EventHandler() { static_assert(HandlesAll); } +}; + +class EventLoop; + +class EventQueueBase { +public: + virtual void process_events() = 0; + + virtual ~EventQueueBase() = default; +}; + +template +class EventQueue : public EventQueueBase { +public: + EventQueue(EventLoop* loop, HandlerType* handler) : _loop(loop), _handler(handler) {}; + + std::optional> poll(); + + void process_events() override { + while (auto event = poll()) { + std::visit([this](auto&& e) { _handler->handle(e); }, *event); + } + } + + template + requires std::disjunction_v...> + void push(T&& event); + +private: + EventLoop* _loop; + HandlerType* _handler; + std::list> _events; +}; + +class EventLoop : EventHandler, public EventQueue { +public: + EventLoop() : EventQueue(this, this) {} + + template + void notify_pending(EventQueue* queue) { + std::lock_guard lock(_mutex); + // TODO: + if (std::find(_events.begin(), _events.end(), queue) != _events.end()) { + return; // Already registered + } + _events.push_back(queue); + _condition.notify_all(); + } + + void run(std::function after_callback) { + while (_running) { + std::list new_events; + + { + std::unique_lock lock(_mutex); + _condition.wait(lock, [this] { return !_events.empty() || !_running; }); + std::swap(new_events, _events); + } + + for (auto queue: new_events) { + queue->process_events(); + } + + after_callback(); + } + } + + EventHandlingResult handle(LoopQuitEvent event) { + _running = false; + _condition.notify_all(); + return EventHandlingResult::DONE; + } + +private: + std::list _events; + std::mutex _mutex; + std::condition_variable _condition; + bool _running = true; +}; + +template +std::optional> EventQueue::poll() { + if (_events.empty()) { + return std::nullopt; + } + + auto event = std::move(_events.front()); + _events.pop_front(); + return event; +} + +template +template + requires std::disjunction_v...> +void EventQueue::push(T&& event) { + _events.emplace_back(std::forward(event)); + _loop->notify_pending(static_cast(this)); +} + +#endif // EVENT_HPP diff --git a/Firmware/sdk/library/include_public/Fonts.hpp b/Firmware/sdk/library/include_public/Fonts.hpp new file mode 100644 index 0000000..d732279 --- /dev/null +++ b/Firmware/sdk/library/include_public/Fonts.hpp @@ -0,0 +1,4878 @@ +// +// Created by Stepan Usatiuk on 26.04.2024. +// + +#ifndef CB_SDK_FONTS_HPP +#define CB_SDK_FONTS_HPP + +#include + +// Terminess Powerline +static constexpr std::array, 256> fonts_Terminess_Powerline{ + std::array{ + // ++---000-0x00----- + 0b00000000, + 0b00000000, + 0b00110000, + 0b01001000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---001-0x01----- + 0b00000000, + 0b00000000, + 0b01001000, + 0b01001000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---002-0x02----- + 0b00000000, + 0b00000000, + 0b00101000, + 0b00010000, + 0b00101000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---003-0x03----- + 0b00000000, + 0b00000000, + 0b00110010, + 0b01001100, + 0b00000000, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---004-0x04----- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00001000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---005-0x05----- + 0b00000000, + 0b00000000, + 0b00001000, + 0b00010000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---006-0x06----- + 0b00000000, + 0b00000000, + 0b00011000, + 0b00100100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---007-0x07----- + 0b00000000, + 0b00000000, + 0b00110010, + 0b01001100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---008-0x08----- + 0b00000000, + 0b00000000, + 0b00100100, + 0b00100100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---009-0x09----- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b01111100, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---010-0x0a----- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000010, + 0b00111100, + 0b01000110, + 0b01001010, + 0b01010010, + 0b01100010, + 0b01000010, + 0b10111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---011-0x0b----- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00001000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---012-0x0c----- + 0b00000000, + 0b00000000, + 0b00001000, + 0b00010000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---013-0x0d----- + 0b00000000, + 0b00000000, + 0b00011000, + 0b00100100, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---014-0x0e----- + 0b00000000, + 0b00000000, + 0b00100100, + 0b00100100, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---015-0x0f----- + 0b00000000, + 0b00000000, + 0b00001000, + 0b00010000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000010, + 0b00000010, + 0b00111100, + 0b00000000, + }, + std::array{ + // ++---016-0x10----- + 0b00000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111100, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + std::array{ + // ++---017-0x11----- + 0b00000000, + 0b00000000, + 0b00100100, + 0b00100100, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000010, + 0b00000010, + 0b00111100, + 0b00000000, + }, + std::array{ + // ++---018-0x12----- + 0b00111100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---019-0x13----- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111100, + 0b00000000, + 0b00111100, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---020-0x14----- + 0b00100100, + 0b00011000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---021-0x15----- + 0b00000000, + 0b00000000, + 0b00100100, + 0b00011000, + 0b00000000, + 0b00111100, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---022-0x16----- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000010, + 0b00000100, + 0b00000011, + 0b00000000, + }, + std::array{ + // ++---023-0x17----- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111100, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000010, + 0b00000100, + 0b00000011, + 0b00000000, + }, + std::array{ + // ++---024-0x18----- + 0b00001000, + 0b00010000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---025-0x19----- + 0b00000000, + 0b00000000, + 0b00001000, + 0b00010000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---026-0x1a----- + 0b00100100, + 0b00011000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---027-0x1b----- + 0b00000000, + 0b00000000, + 0b00100100, + 0b00011000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---028-0x1c----- + 0b00100100, + 0b00011000, + 0b00000000, + 0b01111000, + 0b01000100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000100, + 0b01111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---029-0x1d----- + 0b00100100, + 0b00011000, + 0b00000010, + 0b00000010, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---030-0x1e----- + 0b00000000, + 0b00000000, + 0b00000010, + 0b00001111, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---031-0x1f----- + 0b00111100, + 0b00000000, + 0b01111110, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---032-0x20-' '- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---033-0x21-'!'- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---034-0x22-'"'- + 0b00000000, + 0b00100100, + 0b00100100, + 0b00100100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---035-0x23-'#'- + 0b00000000, + 0b00000000, + 0b00100100, + 0b00100100, + 0b00100100, + 0b01111110, + 0b00100100, + 0b00100100, + 0b01111110, + 0b00100100, + 0b00100100, + 0b00100100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---036-0x24-'$'- + 0b00000000, + 0b00010000, + 0b00010000, + 0b01111100, + 0b10010010, + 0b10010000, + 0b10010000, + 0b01111100, + 0b00010010, + 0b00010010, + 0b10010010, + 0b01111100, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---037-0x25-'%'- + 0b00000000, + 0b00000000, + 0b01100100, + 0b10010100, + 0b01101000, + 0b00001000, + 0b00010000, + 0b00010000, + 0b00100000, + 0b00101100, + 0b01010010, + 0b01001100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---038-0x26-'&'- + 0b00000000, + 0b00000000, + 0b00011000, + 0b00100100, + 0b00100100, + 0b00011000, + 0b00110000, + 0b01001010, + 0b01000100, + 0b01000100, + 0b01000100, + 0b00111010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---039-0x27-'''- + 0b00000000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---040-0x28-'('- + 0b00000000, + 0b00000000, + 0b00001000, + 0b00010000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00010000, + 0b00001000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---041-0x29-')'- + 0b00000000, + 0b00000000, + 0b00100000, + 0b00010000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00010000, + 0b00100000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---042-0x2a-'*'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00100100, + 0b00011000, + 0b01111110, + 0b00011000, + 0b00100100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---043-0x2b-'+'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b01111100, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---044-0x2c-','- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00100000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---045-0x2d-'-'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---046-0x2e-'.'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---047-0x2f-'/'- + 0b00000000, + 0b00000000, + 0b00000100, + 0b00000100, + 0b00001000, + 0b00001000, + 0b00010000, + 0b00010000, + 0b00100000, + 0b00100000, + 0b01000000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---048-0x30-'0'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000110, + 0b01001010, + 0b01010010, + 0b01100010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---049-0x31-'1'- + 0b00000000, + 0b00000000, + 0b00001000, + 0b00011000, + 0b00101000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---050-0x32-'2'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b00000010, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---051-0x33-'3'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b00000010, + 0b00011100, + 0b00000010, + 0b00000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---052-0x34-'4'- + 0b00000000, + 0b00000000, + 0b00000010, + 0b00000110, + 0b00001010, + 0b00010010, + 0b00100010, + 0b01000010, + 0b01111110, + 0b00000010, + 0b00000010, + 0b00000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---053-0x35-'5'- + 0b00000000, + 0b00000000, + 0b01111110, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111100, + 0b00000010, + 0b00000010, + 0b00000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---054-0x36-'6'- + 0b00000000, + 0b00000000, + 0b00011100, + 0b00100000, + 0b01000000, + 0b01000000, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---055-0x37-'7'- + 0b00000000, + 0b00000000, + 0b01111110, + 0b00000010, + 0b00000010, + 0b00000100, + 0b00000100, + 0b00001000, + 0b00001000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---056-0x38-'8'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---057-0x39-'9'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000010, + 0b00000010, + 0b00000100, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---058-0x3a-':'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---059-0x3b-';'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00100000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---060-0x3c-'<'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b00100000, + 0b00010000, + 0b00001000, + 0b00000100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---061-0x3d-'='- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---062-0x3e-'>'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b01000000, + 0b00100000, + 0b00010000, + 0b00001000, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---063-0x3f-'?'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000100, + 0b00001000, + 0b00001000, + 0b00000000, + 0b00001000, + 0b00001000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---064-0x40-'@'- + 0b00000000, + 0b00000000, + 0b01111100, + 0b10000010, + 0b10011110, + 0b10100010, + 0b10100010, + 0b10100010, + 0b10100110, + 0b10011010, + 0b10000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---065-0x41-'A'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---066-0x42-'B'- + 0b00000000, + 0b00000000, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---067-0x43-'C'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---068-0x44-'D'- + 0b00000000, + 0b00000000, + 0b01111000, + 0b01000100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000100, + 0b01111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---069-0x45-'E'- + 0b00000000, + 0b00000000, + 0b01111110, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---070-0x46-'F'- + 0b00000000, + 0b00000000, + 0b01111110, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---071-0x47-'G'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000000, + 0b01000000, + 0b01001110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---072-0x48-'H'- + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---073-0x49-'I'- + 0b00000000, + 0b00000000, + 0b00111000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---074-0x4a-'J'- + 0b00000000, + 0b00000000, + 0b00001110, + 0b00000100, + 0b00000100, + 0b00000100, + 0b00000100, + 0b00000100, + 0b00000100, + 0b01000100, + 0b01000100, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---075-0x4b-'K'- + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000100, + 0b01001000, + 0b01010000, + 0b01100000, + 0b01100000, + 0b01010000, + 0b01001000, + 0b01000100, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---076-0x4c-'L'- + 0b00000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---077-0x4d-'M'- + 0b00000000, + 0b00000000, + 0b10000010, + 0b11000110, + 0b10101010, + 0b10010010, + 0b10010010, + 0b10000010, + 0b10000010, + 0b10000010, + 0b10000010, + 0b10000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---078-0x4e-'N'- + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01100010, + 0b01010010, + 0b01001010, + 0b01000110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---079-0x4f-'O'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---080-0x50-'P'- + 0b00000000, + 0b00000000, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111100, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---081-0x51-'Q'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01001010, + 0b00111100, + 0b00000010, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---082-0x52-'R'- + 0b00000000, + 0b00000000, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111100, + 0b01010000, + 0b01001000, + 0b01000100, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---083-0x53-'S'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000000, + 0b01000000, + 0b00111100, + 0b00000010, + 0b00000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---084-0x54-'T'- + 0b00000000, + 0b00000000, + 0b11111110, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---085-0x55-'U'- + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---086-0x56-'V'- + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00100100, + 0b00100100, + 0b00100100, + 0b00011000, + 0b00011000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---087-0x57-'W'- + 0b00000000, + 0b00000000, + 0b10000010, + 0b10000010, + 0b10000010, + 0b10000010, + 0b10000010, + 0b10010010, + 0b10010010, + 0b10101010, + 0b11000110, + 0b10000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---088-0x58-'X'- + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b00100100, + 0b00100100, + 0b00011000, + 0b00011000, + 0b00100100, + 0b00100100, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---089-0x59-'Y'- + 0b00000000, + 0b00000000, + 0b10000010, + 0b10000010, + 0b01000100, + 0b01000100, + 0b00101000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---090-0x5a-'Z'- + 0b00000000, + 0b00000000, + 0b01111110, + 0b00000010, + 0b00000010, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---091-0x5b-'['- + 0b00000000, + 0b00000000, + 0b00111000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---092-0x5c-'\'- + 0b00000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b00100000, + 0b00100000, + 0b00010000, + 0b00010000, + 0b00001000, + 0b00001000, + 0b00000100, + 0b00000100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---093-0x5d-']'- + 0b00000000, + 0b00000000, + 0b00111000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---094-0x5e-'^'- + 0b00000000, + 0b00010000, + 0b00101000, + 0b01000100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---095-0x5f-'_'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01111110, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---096-0x60-'`'- + 0b00010000, + 0b00001000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---097-0x61-'a'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111100, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---098-0x62-'b'- + 0b00000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---099-0x63-'c'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---100-0x64-'d'- + 0b00000000, + 0b00000000, + 0b00000010, + 0b00000010, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---101-0x65-'e'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000000, + 0b01000000, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---102-0x66-'f'- + 0b00000000, + 0b00000000, + 0b00001110, + 0b00010000, + 0b00010000, + 0b01111100, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---103-0x67-'g'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000010, + 0b00000010, + 0b00111100, + 0b00000000, + }, + std::array{ + // ++---104-0x68-'h'- + 0b00000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---105-0x69-'i'- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---106-0x6a-'j'- + 0b00000000, + 0b00000000, + 0b00000100, + 0b00000100, + 0b00000000, + 0b00001100, + 0b00000100, + 0b00000100, + 0b00000100, + 0b00000100, + 0b00000100, + 0b00000100, + 0b01000100, + 0b01000100, + 0b00111000, + 0b00000000, + }, + std::array{ + // ++---107-0x6b-'k'- + 0b00000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000010, + 0b01000100, + 0b01001000, + 0b01110000, + 0b01001000, + 0b01000100, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---108-0x6c-'l'- + 0b00000000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---109-0x6d-'m'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b11111100, + 0b10010010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---110-0x6e-'n'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---111-0x6f-'o'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---112-0x70-'p'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111100, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + std::array{ + // ++---113-0x71-'q'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000010, + 0b00000010, + 0b00000010, + 0b00000000, + }, + std::array{ + // ++---114-0x72-'r'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01011110, + 0b01100000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---115-0x73-'s'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111110, + 0b01000000, + 0b01000000, + 0b00111100, + 0b00000010, + 0b00000010, + 0b01111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---116-0x74-'t'- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b01111100, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00001110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---117-0x75-'u'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---118-0x76-'v'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00100100, + 0b00100100, + 0b00011000, + 0b00011000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---119-0x77-'w'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b10000010, + 0b10000010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b01111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---120-0x78-'x'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b00100100, + 0b00011000, + 0b00100100, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---121-0x79-'y'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000010, + 0b00000010, + 0b00111100, + 0b00000000, + }, + std::array{ + // ++---122-0x7a-'z'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01111110, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---123-0x7b-'{'- + 0b00000000, + 0b00000000, + 0b00001100, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00100000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00001100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---124-0x7c-'|'- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---125-0x7d-'}'- + 0b00000000, + 0b00000000, + 0b00110000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00000100, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00110000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---126-0x7e-'~'- + 0b00000000, + 0b01100010, + 0b10010010, + 0b10001100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---127-0x7f-''- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---128-0x80-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b01111100, + 0b10010010, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010010, + 0b01111100, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---129-0x81-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01000100, + 0b00111000, + 0b01000100, + 0b01000100, + 0b01000100, + 0b00111000, + 0b01000100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---130-0x82-'�'- + 0b00000000, + 0b00000000, + 0b10000010, + 0b10000010, + 0b01000100, + 0b00101000, + 0b00010000, + 0b01111100, + 0b00010000, + 0b01111100, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---131-0x83-'�'- + 0b00000000, + 0b00111000, + 0b01000100, + 0b01000000, + 0b00110000, + 0b01001000, + 0b01000100, + 0b01000100, + 0b00100100, + 0b00011000, + 0b00000100, + 0b01000100, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---132-0x84-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b01111110, + 0b10000001, + 0b10011001, + 0b10100101, + 0b10100001, + 0b10100101, + 0b10011001, + 0b10000001, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---133-0x85-'�'- + 0b00000000, + 0b00111000, + 0b00000100, + 0b00111100, + 0b01000100, + 0b00111100, + 0b00000000, + 0b01111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---134-0x86-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00010010, + 0b00100100, + 0b01001000, + 0b10010000, + 0b01001000, + 0b00100100, + 0b00010010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---135-0x87-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b01111110, + 0b10000001, + 0b10111001, + 0b10100101, + 0b10111001, + 0b10101001, + 0b10100101, + 0b10000001, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---136-0x88-'�'- + 0b00000000, + 0b00011000, + 0b00100100, + 0b00001000, + 0b00010000, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---137-0x89-'�'- + 0b10000000, + 0b01000000, + 0b00100000, + 0b00010000, + 0b00001000, + 0b00000100, + 0b00000010, + 0b00000001, + 0b00000001, + 0b00000010, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + }, + std::array{ + // ++---138-0x8a-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000110, + 0b01111010, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + std::array{ + // ++---139-0x8b-'�'- + 0b00000000, + 0b00000000, + 0b01111110, + 0b10010010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b01110010, + 0b00010010, + 0b00010010, + 0b00010010, + 0b00010010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---140-0x8c-'�'- + 0b00000000, + 0b00111000, + 0b01000100, + 0b01000100, + 0b01000100, + 0b00111000, + 0b00000000, + 0b01111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---141-0x8d-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b10010000, + 0b01001000, + 0b00100100, + 0b00010010, + 0b00100100, + 0b01001000, + 0b10010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---142-0x8e-'�'- + 0b00000000, + 0b00100000, + 0b01100000, + 0b00100000, + 0b00100010, + 0b00100100, + 0b00001000, + 0b00010000, + 0b00100010, + 0b01000110, + 0b10001010, + 0b00011110, + 0b00000010, + 0b00000010, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---143-0x8f-'�'- + 0b00000000, + 0b00100000, + 0b01100000, + 0b00100000, + 0b00100010, + 0b00100100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01001100, + 0b10010010, + 0b00000100, + 0b00001000, + 0b00011110, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---144-0x90-'�'- + 0b00000001, + 0b00000010, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b10000000, + 0b01000000, + 0b00100000, + 0b00010000, + 0b00001000, + 0b00000100, + 0b00000010, + 0b00000001, + }, + std::array{ + // ++---145-0x91-'�'- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00100000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---146-0x92-'�'- + 0b00010000, + 0b00001000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---147-0x93-'�'- + 0b00001000, + 0b00010000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---148-0x94-'�'- + 0b00011000, + 0b00100100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---149-0x95-'�'- + 0b00110010, + 0b01001100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---150-0x96-'�'- + 0b00100100, + 0b00100100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---151-0x97-'�'- + 0b00011000, + 0b00100100, + 0b00011000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---152-0x98-'�'- + 0b00000000, + 0b00000000, + 0b01111110, + 0b10010000, + 0b10010000, + 0b10010000, + 0b11111100, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10011110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---153-0x99-'�'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00010000, + 0b00010000, + 0b00100000, + 0b00000000, + }, + std::array{ + // ++---154-0x9a-'�'- + 0b00010000, + 0b00001000, + 0b00000000, + 0b01111110, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---155-0x9b-'�'- + 0b00001000, + 0b00010000, + 0b00000000, + 0b01111110, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---156-0x9c-'�'- + 0b00011000, + 0b00100100, + 0b00000000, + 0b01111110, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---157-0x9d-'�'- + 0b00100100, + 0b00100100, + 0b00000000, + 0b01111110, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---158-0x9e-'�'- + 0b00100000, + 0b00010000, + 0b00000000, + 0b00111000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---159-0x9f-'�'- + 0b00001000, + 0b00010000, + 0b00000000, + 0b00111000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---160-0xa0-'�'- + 0b00011000, + 0b00100100, + 0b00000000, + 0b00111000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---161-0xa1-'�'- + 0b01000100, + 0b01000100, + 0b00000000, + 0b00111000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---162-0xa2-'�'- + 0b00000000, + 0b00000000, + 0b01111000, + 0b01000100, + 0b01000010, + 0b01000010, + 0b11110010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000100, + 0b01111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---163-0xa3-'�'- + 0b00110010, + 0b01001100, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01100010, + 0b01010010, + 0b01001010, + 0b01000110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---164-0xa4-'�'- + 0b00010000, + 0b00001000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---165-0xa5-'�'- + 0b00001000, + 0b00010000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---166-0xa6-'�'- + 0b00011000, + 0b00100100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---167-0xa7-'�'- + 0b00110010, + 0b01001100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---168-0xa8-'�'- + 0b00100100, + 0b00100100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---169-0xa9-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01000010, + 0b00100100, + 0b00011000, + 0b00011000, + 0b00100100, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---170-0xaa-'�'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000011, + 0b01000010, + 0b01000110, + 0b01001010, + 0b01010010, + 0b01100010, + 0b01000010, + 0b11000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---171-0xab-'�'- + 0b00010000, + 0b00001000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---172-0xac-'�'- + 0b00001000, + 0b00010000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---173-0xad-'�'- + 0b00011000, + 0b00100100, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---174-0xae-'�'- + 0b00100100, + 0b00100100, + 0b00000000, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---175-0xaf-'�'- + 0b00001000, + 0b00010000, + 0b10000010, + 0b10000010, + 0b01000100, + 0b01000100, + 0b00101000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---176-0xb0-'�'- + 0b00000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01111100, + 0b01000000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---177-0xb1-'�'- + 0b00000000, + 0b00000000, + 0b00111000, + 0b01000100, + 0b01000100, + 0b01001000, + 0b01111100, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01100010, + 0b01011100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---178-0xb2-'�'- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00001000, + 0b00000000, + 0b00111100, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---179-0xb3-'�'- + 0b00000000, + 0b00000000, + 0b00001000, + 0b00010000, + 0b00000000, + 0b00111100, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---180-0xb4-'�'- + 0b00000000, + 0b00000000, + 0b00011000, + 0b00100100, + 0b00000000, + 0b00111100, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---181-0xb5-'�'- + 0b00000000, + 0b00000000, + 0b00110010, + 0b01001100, + 0b00000000, + 0b00111100, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---182-0xb6-'�'- + 0b00000000, + 0b00000000, + 0b00100100, + 0b00100100, + 0b00000000, + 0b00111100, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---183-0xb7-'�'- + 0b00000000, + 0b00000000, + 0b00011000, + 0b00100100, + 0b00011000, + 0b00111100, + 0b00000010, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---184-0xb8-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01101100, + 0b00010010, + 0b01110010, + 0b10011110, + 0b10010000, + 0b10010000, + 0b01101100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---185-0xb9-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000010, + 0b00111100, + 0b00010000, + 0b00010000, + 0b00100000, + 0b00000000, + }, + std::array{ + // ++---186-0xba-'�'- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00001000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000000, + 0b01000000, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---187-0xbb-'�'- + 0b00000000, + 0b00000000, + 0b00001000, + 0b00010000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000000, + 0b01000000, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---188-0xbc-'�'- + 0b00000000, + 0b00000000, + 0b00011000, + 0b00100100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000000, + 0b01000000, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---189-0xbd-'�'- + 0b00000000, + 0b00000000, + 0b00100100, + 0b00100100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000000, + 0b01000000, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---190-0xbe-'�'- + 0b00000000, + 0b00000000, + 0b00100000, + 0b00010000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---191-0xbf-'�'- + 0b00000000, + 0b00000000, + 0b00001000, + 0b00010000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---192-0xc0-'�'- + 0b00000000, + 0b00000000, + 0b00011000, + 0b00100100, + 0b00100000, + 0b00100000, + 0b01111000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100010, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---193-0xc1-'�'- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b01010100, + 0b00111000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---194-0xc2-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000011, + 0b00001111, + 0b00111111, + 0b11111111, + 0b00111111, + 0b00001111, + 0b00000011, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---195-0xc3-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b11000000, + 0b11110000, + 0b11111100, + 0b11111111, + 0b11111100, + 0b11110000, + 0b11000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---196-0xc4-'�'- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00111000, + 0b01010100, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---197-0xc5-'�'- + 0b10001000, + 0b00100010, + 0b10001000, + 0b00100010, + 0b10001000, + 0b00100010, + 0b10001000, + 0b00100010, + 0b10001000, + 0b00100010, + 0b10001000, + 0b00100010, + 0b10001000, + 0b00100010, + 0b10001000, + 0b00100010, + }, + std::array{ + // ++---198-0xc6-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111100, + 0b00111100, + 0b00111100, + 0b00111100, + 0b00111100, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---199-0xc7-'�'- + 0b10101010, + 0b01010101, + 0b10101010, + 0b01010101, + 0b10101010, + 0b01010101, + 0b10101010, + 0b01010101, + 0b10101010, + 0b01010101, + 0b10101010, + 0b01010101, + 0b10101010, + 0b01010101, + 0b10101010, + 0b01010101, + }, + std::array{ + // ++---200-0xc8-'�'- + 0b00000000, + 0b00011000, + 0b00100100, + 0b00100100, + 0b00011000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---201-0xc9-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00010000, + 0b00111000, + 0b01111100, + 0b11111110, + 0b01111100, + 0b00111000, + 0b00010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---202-0xca-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00100000, + 0b00010000, + 0b00001000, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b00000000, + 0b01111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---203-0xcb-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---204-0xcc-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b11111111, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---205-0xcd-'�'- + 0b00101000, + 0b00101000, + 0b00101000, + 0b00101000, + 0b00101000, + 0b00101000, + 0b11101111, + 0b00000000, + 0b11101111, + 0b00101000, + 0b00101000, + 0b00101000, + 0b00101000, + 0b00101000, + 0b00101000, + 0b00101000, + }, + std::array{ + // ++---206-0xce-'�'- + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b11111111, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + }, + std::array{ + // ++---207-0xcf-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b00010000, + 0b00001000, + 0b00000100, + 0b00000000, + 0b00111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---208-0xd0-'�'- + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00011111, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---209-0xd1-'�'- + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b11110000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---210-0xd2-'�'- + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b11111111, + 0b00010000, + 0b11111111, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + }, + std::array{ + // ++---211-0xd3-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b01111100, + 0b00010000, + 0b00010000, + 0b00000000, + 0b01111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---212-0xd4-'�'- + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---213-0xd5-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---214-0xd6-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b11111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---215-0xd7-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---216-0xd8-'�'- + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + 0b11111111, + }, + std::array{ + // ++---217-0xd9-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b11111111, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + }, + std::array{ + // ++---218-0xda-'�'- + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b11110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + }, + std::array{ + // ++---219-0xdb-'�'- + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00011111, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + }, + std::array{ + // ++---220-0xdc-'�'- + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b11111111, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---221-0xdd-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00011111, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + }, + std::array{ + // ++---222-0xde-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b11110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + }, + std::array{ + // ++---223-0xdf-'�'- + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + }, + std::array{ + // ++---224-0xe0-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111100, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000000, + 0b01000000, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---225-0xe1-'�'- + 0b00010000, + 0b00010000, + 0b00000000, + 0b01111110, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---226-0xe2-'�'- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000000, + 0b01000000, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---227-0xe3-'�'- + 0b00000000, + 0b00000000, + 0b01111110, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000010, + 0b00000100, + 0b00000011, + 0b00000000, + }, + std::array{ + // ++---228-0xe4-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000000, + 0b01000000, + 0b00111100, + 0b00001000, + 0b00010000, + 0b00001100, + 0b00000000, + }, + std::array{ + // ++---229-0xe5-'�'- + 0b00100100, + 0b00011000, + 0b00000000, + 0b01111110, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---230-0xe6-'�'- + 0b00000000, + 0b00000000, + 0b00100100, + 0b00011000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01111110, + 0b01000000, + 0b01000000, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---231-0xe7-'�'- + 0b00100100, + 0b00011000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000000, + 0b01001110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---232-0xe8-'�'- + 0b00000000, + 0b00000000, + 0b00100100, + 0b00011000, + 0b00000000, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000010, + 0b00000010, + 0b00111100, + 0b00000000, + }, + std::array{ + // ++---233-0xe9-'�'- + 0b00000000, + 0b00000000, + 0b00111100, + 0b01000010, + 0b01000010, + 0b01000000, + 0b01000000, + 0b01001110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111100, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00100000, + }, + std::array{ + // ++---234-0xea-'�'- + 0b00000000, + 0b00000100, + 0b00001000, + 0b00001000, + 0b00000000, + 0b00111110, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b01000010, + 0b00111110, + 0b00000010, + 0b00000010, + 0b00111100, + 0b00000000, + }, + std::array{ + // ++---235-0xeb-'�'- + 0b00110010, + 0b01001100, + 0b00000000, + 0b00111000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---236-0xec-'�'- + 0b00000000, + 0b00000000, + 0b00110100, + 0b01011000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---237-0xed-'�'- + 0b01111100, + 0b00000000, + 0b00111000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---238-0xee-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b01111000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---239-0xef-'�'- + 0b00000000, + 0b00000000, + 0b00111000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00010000, + 0b00100000, + 0b00011000, + 0b00000000, + }, + std::array{ + // ++---240-0xf0-'�'- + 0b00000000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00010000, + 0b00100000, + 0b00011000, + 0b00000000, + }, + std::array{ + // ++---241-0xf1-'�'- + 0b00010000, + 0b00010000, + 0b00000000, + 0b00111000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---242-0xf2-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---243-0xf3-'�'- + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000100, + 0b01001000, + 0b01010000, + 0b01100000, + 0b01100000, + 0b01010000, + 0b01001000, + 0b01000100, + 0b01000010, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00100000, + }, + std::array{ + // ++---244-0xf4-'�'- + 0b00000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000010, + 0b01000100, + 0b01001000, + 0b01110000, + 0b01001000, + 0b01000100, + 0b01000010, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00100000, + }, + std::array{ + // ++---245-0xf5-'�'- + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01000010, + 0b01000100, + 0b01001000, + 0b01110000, + 0b01001000, + 0b01000100, + 0b01000010, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---246-0xf6-'�'- + 0b00100000, + 0b01000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---247-0xf7-'�'- + 0b00001000, + 0b00010000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---248-0xf8-'�'- + 0b00000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00100000, + }, + std::array{ + // ++---249-0xf9-'�'- + 0b00000000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00100000, + }, + std::array{ + // ++---250-0xfa-'�'- + 0b00100100, + 0b00011000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---251-0xfb-'�'- + 0b01001000, + 0b00110000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---252-0xfc-'�'- + 0b00000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000100, + 0b01000100, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---253-0xfd-'�'- + 0b00000000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010001, + 0b00010001, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---254-0xfe-'�'- + 0b00000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01100000, + 0b11000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01111110, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + std::array{ + // ++---255-0xff-'�'- + 0b00000000, + 0b00000000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00011000, + 0b00110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }}; + + +#endif //FONTS_HPP diff --git a/Firmware/sdk/library/include_public/GridWindow.hpp b/Firmware/sdk/library/include_public/GridWindow.hpp new file mode 100644 index 0000000..eb166bf --- /dev/null +++ b/Firmware/sdk/library/include_public/GridWindow.hpp @@ -0,0 +1,120 @@ +// +// Created by Stepan Usatiuk on 26.07.2025. +// + +#ifndef GRIDWINDOW_HPP +#define GRIDWINDOW_HPP +#include + +#include "Fonts.hpp" +#include "SubSurface.hpp" +#include "Window.hpp" +#include "utils.hpp" + +template +class GridWindow : public Window { +public: + explicit GridWindow(SurfaceType* owner) : Window(owner) { + for (int i = 0; i < nWidth; ++i) { + for (int j = 0; j < nHeight; ++j) { + _grid[i][j].emplace(owner); + } + } + } + + EventHandlingResult handle(KeyboardEvent keyboardEvent) override { + if (keyboardEvent.key_code == Key::Escape) { + if (!_has_focus) { + return EventHandlingResult::CONTINUE; + } else { + auto res = _grid[_current_focus_x][_current_focus_y]->get_window()->handle(keyboardEvent); + if (res == EventHandlingResult::DONE) { + return EventHandlingResult::DONE; + } else { + _has_focus = false; + } + } + } else if (keyboardEvent.key_code == Key::Enter) { + if (!_has_focus) { + _has_focus = true; + } else { + return _grid[_current_focus_x][_current_focus_y]->get_window()->handle(keyboardEvent); + } + } else { + if (_has_focus) { + return _grid[_current_focus_x][_current_focus_y]->get_window()->handle(keyboardEvent); + } + + if (keyboardEvent.key_code == Key::Left) { + if (_current_focus_x > 0) { + _current_focus_x--; + } + } else if (keyboardEvent.key_code == Key::Right) { + if (_current_focus_x < nWidth - 1) { + _current_focus_x++; + } + } else if (keyboardEvent.key_code == Key::Up) { + if (_current_focus_y > 0) { + _current_focus_y--; + } + } else if (keyboardEvent.key_code == Key::Down) { + if (_current_focus_y < nHeight - 1) { + _current_focus_y++; + } + } + } + refresh(); + return EventHandlingResult::DONE; + } + + EventHandlingResult handle(SurfaceResizeEvent resize) override { + _cell_width = this->_owner->get_width() / nWidth; + _cell_height = this->_owner->get_height() / nHeight; + for (int i = 0; i < nWidth; ++i) { + for (int j = 0; j < nHeight; ++j) { + _grid[i][j]->set_pos(i * _cell_width + 1, j * _cell_height + 1, _cell_width - 1, _cell_height - 1); + } + } + refresh(); + return EventHandlingResult::DONE; + } + + template + void set_window(unsigned x, unsigned y, Args&&... args) { + _grid[x][y]->template set_window(std::forward(args)...); + } + + SubSurface& get_subsurface(unsigned x, unsigned y) { + // assert(x >= nWidth && y >= nHeight); + return *_grid[x][y]; + } + + void refresh() override { + for (int i = 0; i < nWidth; ++i) { + for (int j = 0; j < nHeight; ++j) { + if (_grid[i][j]->has_window()) { + _grid[i][j]->get_window()->refresh(); + } + if (i == _current_focus_x && j == _current_focus_y) { + this->_owner->draw_rect(i * _cell_width, j * _cell_height, _cell_width, _cell_height, + PixelType(true)); + } else { + this->_owner->draw_rect(i * _cell_width, j * _cell_height, _cell_width, _cell_height, + PixelType(false)); + } + } + } + } + +private: + std::array>, nWidth>, nHeight> _grid; + + unsigned _cell_width = 0; + unsigned _cell_height = 0; + + unsigned _current_focus_x = 0; + unsigned _current_focus_y = 0; + bool _has_focus = false; +}; + +#endif // TEXTWINDOW_HPP diff --git a/Firmware/sdk/library/include_public/Pixel.hpp b/Firmware/sdk/library/include_public/Pixel.hpp new file mode 100644 index 0000000..60a297c --- /dev/null +++ b/Firmware/sdk/library/include_public/Pixel.hpp @@ -0,0 +1,21 @@ +// +// Created by Stepan Usatiuk on 26.07.2025. +// + +#ifndef PIXEL_HPP +#define PIXEL_HPP + +class Pixel { +}; + +struct BwPixel : public Pixel { + bool on = false; + + BwPixel() = default; + BwPixel(bool on) : on(on) {} + + bool operator==(const BwPixel& other) const { return on == other.on; } + bool operator!=(const BwPixel& other) const { return !(*this == other); } +}; + +#endif //PIXEL_HPP diff --git a/Firmware/sdk/library/include_public/StandardEvents.hpp b/Firmware/sdk/library/include_public/StandardEvents.hpp new file mode 100644 index 0000000..bcb1a5c --- /dev/null +++ b/Firmware/sdk/library/include_public/StandardEvents.hpp @@ -0,0 +1,163 @@ +// +// Created by Stepan Usatiuk on 26.07.2025. +// + +#ifndef STANDARDEVENTS_HPP +#define STANDARDEVENTS_HPP + +#include "Event.hpp" + +// TODO: rewrite this +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2025 Laurent Gomila (laurent@sfml-dev.org) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// +enum class Key { + Unknown = -1, //!< Unhandled key + A = 0, //!< The A key + B, //!< The B key + C, //!< The C key + D, //!< The D key + E, //!< The E key + F, //!< The F key + G, //!< The G key + H, //!< The H key + I, //!< The I key + J, //!< The J key + K, //!< The K key + L, //!< The L key + M, //!< The M key + N, //!< The N key + O, //!< The O key + P, //!< The P key + Q, //!< The Q key + R, //!< The R key + S, //!< The S key + T, //!< The T key + U, //!< The U key + V, //!< The V key + W, //!< The W key + X, //!< The X key + Y, //!< The Y key + Z, //!< The Z key + Num0, //!< The 0 key + Num1, //!< The 1 key + Num2, //!< The 2 key + Num3, //!< The 3 key + Num4, //!< The 4 key + Num5, //!< The 5 key + Num6, //!< The 6 key + Num7, //!< The 7 key + Num8, //!< The 8 key + Num9, //!< The 9 key + Escape, //!< The Escape key + LControl, //!< The left Control key + LShift, //!< The left Shift key + LAlt, //!< The left Alt key + LSystem, //!< The left OS specific key: window (Windows and Linux), apple (macOS), ... + RControl, //!< The right Control key + RShift, //!< The right Shift key + RAlt, //!< The right Alt key + RSystem, //!< The right OS specific key: window (Windows and Linux), apple (macOS), ... + Menu, //!< The Menu key + LBracket, //!< The [ key + RBracket, //!< The ] key + Semicolon, //!< The ; key + Comma, //!< The , key + Period, //!< The . key + Apostrophe, //!< The ' key + Slash, //!< The / key + Backslash, //!< The \ key + Grave, //!< The ` key + Equal, //!< The = key + Hyphen, //!< The - key (hyphen) + Space, //!< The Space key + Enter, //!< The Enter/Return keys + Backspace, //!< The Backspace key + Tab, //!< The Tabulation key + PageUp, //!< The Page up key + PageDown, //!< The Page down key + End, //!< The End key + Home, //!< The Home key + Insert, //!< The Insert key + Delete, //!< The Delete key + Add, //!< The + key + Subtract, //!< The - key (minus, usually from numpad) + Multiply, //!< The * key + Divide, //!< The / key + Left, //!< Left arrow + Right, //!< Right arrow + Up, //!< Up arrow + Down, //!< Down arrow + Numpad0, //!< The numpad 0 key + Numpad1, //!< The numpad 1 key + Numpad2, //!< The numpad 2 key + Numpad3, //!< The numpad 3 key + Numpad4, //!< The numpad 4 key + Numpad5, //!< The numpad 5 key + Numpad6, //!< The numpad 6 key + Numpad7, //!< The numpad 7 key + Numpad8, //!< The numpad 8 key + Numpad9, //!< The numpad 9 key + F1, //!< The F1 key + F2, //!< The F2 key + F3, //!< The F3 key + F4, //!< The F4 key + F5, //!< The F5 key + F6, //!< The F6 key + F7, //!< The F7 key + F8, //!< The F8 key + F9, //!< The F9 key + F10, //!< The F10 key + F11, //!< The F11 key + F12, //!< The F12 key + F13, //!< The F13 key + F14, //!< The F14 key + F15, //!< The F15 key + Pause, //!< The Pause key +}; + + +struct KeyboardEvent : public Event { + KeyboardEvent(Key key_code) : key_code(key_code) {} + Key key_code; +}; + +struct SurfaceEvent : public Event { + enum class EventType { CLOSED, OPENED }; + + EventType type; +}; + +struct SurfaceResizeEvent : public Event { + SurfaceResizeEvent(unsigned int width, unsigned int height) : width(width), height(height) {} + unsigned width; + unsigned height; +}; + +template +using StandardEventHandler = EventHandler; + +template +using StandardEventQueue = EventQueue; + +#endif // STANDARDEVENTS_HPP diff --git a/Firmware/sdk/library/include_public/SubSurface.hpp b/Firmware/sdk/library/include_public/SubSurface.hpp new file mode 100644 index 0000000..67510cb --- /dev/null +++ b/Firmware/sdk/library/include_public/SubSurface.hpp @@ -0,0 +1,60 @@ +// +// Created by Stepan Usatiuk on 27.07.2025. +// + +#ifndef SUBSURFACE_HPP +#define SUBSURFACE_HPP + +#include +#include + +#include "Pixel.hpp" +#include "StandardEvents.hpp" +#include "Surface.hpp" +#include "Window.hpp" +#include "utils.hpp" + +template + requires std::is_base_of_v +class SubSurface : public Surface, PixelType> { +public: + SubSurface(SurfaceParent* parent) : _parent(parent) {} + + void draw_pixel_impl(unsigned x, unsigned y, const PixelType& pixel) { + if (x >= _x_size || y >= _y_size) { + return; // Out of bounds + } + + _parent->draw_pixel(x + _x_offset, y + _y_offset, pixel); + } + + void clear_impl() { + for (unsigned y = 0; y < _y_size; y++) { + for (unsigned x = 0; x < _x_size; x++) { + _parent->draw_pixel(x + _x_offset, y + _y_offset, PixelType()); + } + } + } + + unsigned get_width_impl() const { return _x_size; } + + unsigned get_height_impl() const { return _y_size; } + + void set_pos(unsigned x_offset, unsigned y_offset, unsigned x_size, unsigned y_size) { + _x_offset = x_offset; + _y_offset = y_offset; + _x_size = x_size; + _y_size = y_size; + this->handle(SurfaceResizeEvent(x_size, y_size)); + } + +private: + unsigned _x_offset = 0; + unsigned _y_offset = 0; + unsigned _x_size = 0; + unsigned _y_size = 0; + + SurfaceParent* _parent; +}; + +#endif // SUBSURFACE_HPP diff --git a/Firmware/sdk/library/include_public/Surface.hpp b/Firmware/sdk/library/include_public/Surface.hpp new file mode 100644 index 0000000..82f1636 --- /dev/null +++ b/Firmware/sdk/library/include_public/Surface.hpp @@ -0,0 +1,75 @@ +// +// Created by Stepan Usatiuk on 26.07.2025. +// + +#ifndef SURFACE_HPP +#define SURFACE_HPP + +#include +#include + +#include "Pixel.hpp" +#include "StandardEvents.hpp" +#include "Window.hpp" +#include "utils.hpp" + +template + requires std::is_base_of_v +class Surface : public StandardEventHandler { +public: + Surface() = default; + + void draw_pixel(unsigned x, unsigned y, const BwPixel& pixel) { + static_cast(this)->draw_pixel_impl(x, y, pixel); + } + + void draw_rect(unsigned x, unsigned y, unsigned width, unsigned height, const BwPixel& pixel) { + for (unsigned i = 0; i < width; ++i) { + draw_pixel(x + i, y, pixel); + draw_pixel(x + i, y + height - 1, pixel); + } + for (unsigned i = 0; i < height; ++i) { + draw_pixel(x, y + i, pixel); + draw_pixel(x + width - 1, y + i, pixel); + } + } + + void clear() { static_cast(this)->clear_impl(); } + + int get_width() const { return static_cast(this)->get_width_impl(); } + + int get_height() const { return static_cast(this)->get_height_impl(); } + + template + EventHandlingResult handle(const T& event) { + if (_window.get()) + return _window->handle(event); + return EventHandlingResult::CONTINUE; + } + + template + void set_window(Args&&... args) { + _window = std::make_unique(static_cast(this), std::forward(args)...); + _window->refresh(); + } + + Surface(const Surface& other) = delete; + + Surface(Surface&& other) noexcept = delete; + + Surface& operator=(const Surface& other) = delete; + + Surface& operator=(Surface&& other) noexcept = delete; + + bool has_window() const { return _window != nullptr; } + + Window* get_window() { + assert(has_window()); + return _window.get(); + } + +protected: + std::unique_ptr> _window = nullptr; +}; + +#endif // SURFACE_HPP diff --git a/Firmware/sdk/library/include_public/TextWindow.hpp b/Firmware/sdk/library/include_public/TextWindow.hpp new file mode 100644 index 0000000..d334099 --- /dev/null +++ b/Firmware/sdk/library/include_public/TextWindow.hpp @@ -0,0 +1,70 @@ +// +// Created by Stepan Usatiuk on 26.07.2025. +// + +#ifndef TEXTWINDOW_HPP +#define TEXTWINDOW_HPP +#include + +#include "Fonts.hpp" +#include "Window.hpp" +#include "utils.hpp" + +template +struct TextUpdateEvent : public Event { + TextUpdateEvent(StringType text) : new_text(std::move(text)) {} + StringType new_text; +}; + +template +class TextWindow : public Window, + public EventHandler>, + public EventQueue, TextUpdateEvent> { +public: + explicit TextWindow(SurfaceType* owner, EventLoop* loop, StringType text = "") : + Window(owner), EventQueue>(loop, this), + _text(std::move(text)) {} + + EventHandlingResult handle(SurfaceResizeEvent resize) override { + refresh(); + return EventHandlingResult::DONE; + } + + EventHandlingResult handle(TextUpdateEvent event) { + _text = std::move(event.new_text); + refresh(); + return EventHandlingResult::DONE; + } + + void refresh() override { + this->_owner->clear(); + size_t _max_col = this->_owner->get_width() / 8; + size_t _max_row = this->_owner->get_height() / 16; + int col = 0, row = 0; + for (char c: _text) { + if (c == '\n' || col >= _max_col) { + row++; + col = 0; + if (c == '\n') + continue; + } + + if (row >= _max_row) { + break; + } + + for (int x = 0; x < 8; x++) { + for (int y = 0; y < 16; y++) { + bool color = fonts_Terminess_Powerline[c][y] & (1 << (8 - x)); + this->_owner->draw_pixel(col * 8 + x, row * 16 + y, PixelType(color)); + } + } + col++; + } + } + +private: + StringType _text; +}; + +#endif // TEXTWINDOW_HPP diff --git a/Firmware/sdk/library/include_public/Window.hpp b/Firmware/sdk/library/include_public/Window.hpp new file mode 100644 index 0000000..3a57387 --- /dev/null +++ b/Firmware/sdk/library/include_public/Window.hpp @@ -0,0 +1,39 @@ +// +// Created by Stepan Usatiuk on 26.07.2025. +// + +#ifndef WINDOW_HPP +#define WINDOW_HPP + +#include + +#include "Event.hpp" +#include "Pixel.hpp" +#include "StandardEvents.hpp" +#include "utils.hpp" + +template + requires std::is_base_of_v +class Surface; + +template + requires std::is_base_of_v +class Window : StandardEventHandler> { +public: + explicit Window(SurfaceType* owner) : _owner(owner) { + // static_assert(is_specialization_of::value); + } + + virtual void refresh() = 0; + + virtual ~Window() = default; + + virtual EventHandlingResult handle(KeyboardEvent) { return EventHandlingResult::CONTINUE; } + virtual EventHandlingResult handle(SurfaceEvent) { return EventHandlingResult::CONTINUE; } + virtual EventHandlingResult handle(SurfaceResizeEvent) { return EventHandlingResult::CONTINUE; } + +protected: + SurfaceType* _owner = nullptr; +}; + +#endif // SURFACE_HPP diff --git a/Firmware/sdk/library/include_public/utils.hpp b/Firmware/sdk/library/include_public/utils.hpp new file mode 100644 index 0000000..e83ee0c --- /dev/null +++ b/Firmware/sdk/library/include_public/utils.hpp @@ -0,0 +1,14 @@ +// +// Created by Stepan Usatiuk on 27.07.2025. +// + +#ifndef UTILS_HPP +#define UTILS_HPP + +template