From c13bc0c88e758d1ecf5eaa8534d92b7627370e0f Mon Sep 17 00:00:00 2001 From: Ryan Wendland Date: Wed, 21 Sep 2022 08:33:56 +0930 Subject: [PATCH] TFT: Use lvgl instead of guilite --- .gitmodules | 3 + platformio.ini | 17 +- src/lib/GuiLite.h | 4343 ---------------------------------- src/lib/lv_conf.h | 742 ++++++ src/lib/lvgl | 1 + src/main.cpp | 37 +- src/n64/n64_controller.h | 1 + src/port_teensy41/hal_t4.cpp | 1 + src/port_teensy41/tft_t4.cpp | 114 +- src/tft.cpp | 317 ++- src/tft.h | 17 +- src/tft/Arial_14.cpp | 269 --- src/tft/Arial_19.cpp | 269 --- 13 files changed, 971 insertions(+), 5160 deletions(-) delete mode 100644 src/lib/GuiLite.h create mode 100644 src/lib/lv_conf.h create mode 160000 src/lib/lvgl delete mode 100644 src/tft/Arial_14.cpp delete mode 100644 src/tft/Arial_19.cpp diff --git a/.gitmodules b/.gitmodules index 120470b5..d6a7ded5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "src/lib/tusb_xinput"] path = src/lib/tusb_xinput url = https://github.com/Ryzee119/tusb_xinput.git +[submodule "src/lib/lvgl"] + path = src/lib/lvgl + url = https://github.com/lvgl/lvgl.git diff --git a/platformio.ini b/platformio.ini index 47f52e4e..5fbf19a5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -36,6 +36,17 @@ src_filter = + + + + + + + + + + + + + + + + + + + + + + + build_flags = -O2 -Wall @@ -68,8 +79,12 @@ build_flags = ; Tinyalloc Configuration -DTA_DISABLE_COMPACT + ; LVGL Configuration + -Isrc/lib/lvgl + -DLV_LVGL_H_INCLUDE_SIMPLE + [env:teensy41] -platform = teensy@~4.13.1 +platform = teensy@~4.16.0 board = teensy41 framework = arduino diff --git a/src/lib/GuiLite.h b/src/lib/GuiLite.h deleted file mode 100644 index b6652636..00000000 --- a/src/lib/GuiLite.h +++ /dev/null @@ -1,4343 +0,0 @@ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wreorder" -#pragma GCC diagnostic ignored "-Wsign-compare" -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" - -#pragma once - -#define REAL_TIME_TASK_CYCLE_MS 50 -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) - -#define GL_ARGB(a, r, g, b) ((((unsigned int)(a)) << 24) | (((unsigned int)(r)) << 16) | (((unsigned int)(g)) << 8) | ((unsigned int)(b))) -#define GL_ARGB_A(rgb) ((((unsigned int)(rgb)) >> 24) & 0xFF) - -#define GL_RGB(r, g, b) ((0xFF << 24) | (((unsigned int)(r)) << 16) | (((unsigned int)(g)) << 8) | ((unsigned int)(b))) -#define GL_RGB_R(rgb) ((((unsigned int)(rgb)) >> 16) & 0xFF) -#define GL_RGB_G(rgb) ((((unsigned int)(rgb)) >> 8) & 0xFF) -#define GL_RGB_B(rgb) (((unsigned int)(rgb)) & 0xFF) -#define GL_RGB_32_to_16(rgb) (((((unsigned int)(rgb)) & 0xFF) >> 3) | ((((unsigned int)(rgb)) & 0xFC00) >> 5) | ((((unsigned int)(rgb)) & 0xF80000) >> 8)) -#define GL_RGB_16_to_32(rgb) ((0xFF << 24) | ((((unsigned int)(rgb)) & 0x1F) << 3) | ((((unsigned int)(rgb)) & 0x7E0) << 5) | ((((unsigned int)(rgb)) & 0xF800) << 8)) - -#define ALIGN_HCENTER 0x00000000L -#define ALIGN_LEFT 0x01000000L -#define ALIGN_RIGHT 0x02000000L -#define ALIGN_HMASK 0x03000000L - -#define ALIGN_VCENTER 0x00000000L -#define ALIGN_TOP 0x00100000L -#define ALIGN_BOTTOM 0x00200000L -#define ALIGN_VMASK 0x00300000L - -typedef struct -{ - unsigned short year; - unsigned short month; - unsigned short date; - unsigned short day; - unsigned short hour; - unsigned short minute; - unsigned short second; -}T_TIME; - -void register_debug_function(void(*my_assert)(const char* file, int line), void(*my_log_out)(const char* log)); -void _assert(const char* file, int line); -#define ASSERT(condition) \ - do{ \ - if(!(condition))_assert(__FILE__, __LINE__);\ - }while(0) -void log_out(const char* log); - -long get_time_in_second(); -T_TIME second_to_day(long second); -T_TIME get_time(); - -void start_real_timer(void (*func)(void* arg)); -void register_timer(int milli_second, void func(void* param), void* param); - -unsigned int get_cur_thread_id(); -void create_thread(unsigned long* thread_id, void* attr, void *(*start_routine) (void *), void* arg); -void thread_sleep(unsigned int milli_seconds); -int build_bmp(const char *filename, unsigned int width, unsigned int height, unsigned char *data); - -#define FIFO_BUFFER_LEN 1024 -class c_fifo -{ -public: - c_fifo(); - int read(void* buf, int len); - int write(void* buf, int len); -private: - unsigned char m_buf[FIFO_BUFFER_LEN]; - int m_head; - int m_tail; - void* m_read_sem; - void* m_write_mutex; -}; - -class c_rect -{ -public: - c_rect(){ m_left = m_top = m_right = m_bottom = -1; } - c_rect(int left, int top, int width, int height) - { - set_rect(left, top, width, height); - } - void set_rect(int left, int top, int width, int height) - { - ASSERT(width > 0 && height > 0); - m_left = left; - m_top = top; - m_right = left + width - 1; - m_bottom = top + height -1; - } - bool pt_in_rect(int x, int y) const - { - return x >= m_left && x <= m_right && y >= m_top && y <= m_bottom; - } - int operator==(const c_rect& rect) const - { - return (m_left == rect.m_left) && (m_top == rect.m_top) && (m_right == rect.m_right) && (m_bottom == rect.m_bottom); - } - int width() const { return m_right - m_left + 1; } - int height() const { return m_bottom - m_top + 1 ; } - - int m_left; - int m_top; - int m_right; - int m_bottom; -}; -//BITMAP -typedef struct struct_bitmap_info -{ - unsigned short width; - unsigned short height; - unsigned short color_bits;//support 16 bits only - const unsigned short* pixel_color_array; -} BITMAP_INFO; -//FONT -typedef struct struct_lattice -{ - unsigned int utf8_code; - unsigned char width; - const unsigned char* pixel_buffer; -} LATTICE; -typedef struct struct_lattice_font_info -{ - unsigned char height; - unsigned int count; - LATTICE* lattice_array; -} LATTICE_FONT_INFO; -//Rebuild gui library once you change this file -enum FONT_LIST -{ - FONT_NULL, - FONT_DEFAULT, - FONT_CUSTOM1, - FONT_CUSTOM2, - FONT_CUSTOM3, - FONT_CUSTOM4, - FONT_CUSTOM5, - FONT_CUSTOM6, - FONT_MAX -}; -enum IMAGE_LIST -{ - IMAGE_CUSTOM1, - IMAGE_CUSTOM2, - IMAGE_CUSTOM3, - IMAGE_CUSTOM4, - IMAGE_CUSTOM5, - IMAGE_CUSTOM6, - IMAGE_MAX -}; -enum COLOR_LIST -{ - COLOR_WND_FONT, - COLOR_WND_NORMAL, - COLOR_WND_PUSHED, - COLOR_WND_FOCUS, - COLOR_WND_BORDER, - COLOR_CUSTOME1, - COLOR_CUSTOME2, - COLOR_CUSTOME3, - COLOR_CUSTOME4, - COLOR_CUSTOME5, - COLOR_CUSTOME6, - COLOR_MAX -}; -class c_theme -{ -public: - static int add_font(FONT_LIST index, const void* font) - { - if (index >= FONT_MAX) - { - ASSERT(false); - return -1; - } - s_font_map[index] = font; - return 0; - } - static const void* get_font(FONT_LIST index) - { - if (index >= FONT_MAX) - { - ASSERT(false); - return 0; - } - return s_font_map[index]; - } - static int add_image(IMAGE_LIST index, const void* image_info) - { - if (index >= IMAGE_MAX) - { - ASSERT(false); - return -1; - } - s_image_map[index] = image_info; - return 0; - } - static const void* get_image(IMAGE_LIST index) - { - if (index >= IMAGE_MAX) - { - ASSERT(false); - return 0; - } - return s_image_map[index]; - } - - static int add_color(COLOR_LIST index, const unsigned int color) - { - if (index >= COLOR_MAX) - { - ASSERT(false); - return -1; - } - s_color_map[index] = color; - return 0; - } - static const unsigned int get_color(COLOR_LIST index) - { - if (index >= COLOR_MAX) - { - ASSERT(false); - return 0; - } - return s_color_map[index]; - } -private: - static const void* s_font_map[FONT_MAX]; - static const void* s_image_map[IMAGE_MAX]; - static unsigned int s_color_map[COLOR_MAX]; -}; -#include -#include -#include -#define SURFACE_CNT_MAX 6//root + pages -typedef enum -{ - Z_ORDER_LEVEL_0,//lowest graphic level - Z_ORDER_LEVEL_1,//middle graphic level - Z_ORDER_LEVEL_2,//highest graphic level - Z_ORDER_LEVEL_MAX -}Z_ORDER_LEVEL; -struct EXTERNAL_GFX_OP -{ - void(*draw_pixel)(int x, int y, unsigned int rgb); - void(*fill_rect)(int x0, int y0, int x1, int y1, unsigned int rgb); -}; -class c_surface; -class c_display { - friend class c_surface; -public: - inline c_display(void* phy_fb, int display_width, int display_height, int surface_width, int surface_height, unsigned int color_bytes, int surface_cnt, EXTERNAL_GFX_OP* gfx_op = 0);//multiple surface or surface_no_fb - inline c_display(void* phy_fb, int display_width, int display_height, c_surface* surface);//single custom surface - inline c_surface* alloc_surface(Z_ORDER_LEVEL max_zorder, c_rect layer_rect = c_rect());//for multiple surfaces - inline int swipe_surface(c_surface* s0, c_surface* s1, int x0, int x1, int y0, int y1, int offset); - int get_width() { return m_width; } - int get_height() { return m_height; } - void* get_updated_fb(int* width, int* height, bool force_update = false) - { - if (width && height) - { - *width = get_width(); - *height = get_height(); - } - if (force_update) - { - return m_phy_fb; - } - if (m_phy_read_index == m_phy_write_index) - {//No update - return 0; - } - m_phy_read_index = m_phy_write_index; - return m_phy_fb; - } - int snap_shot(const char* file_name) - { - if (!m_phy_fb || (m_color_bytes !=2 && m_color_bytes != 4)) - { - return -1; - } - int width = get_width(); - int height = get_height(); - //16 bits framebuffer - if (m_color_bytes == 2) - { - return build_bmp(file_name, width, height, (unsigned char*)m_phy_fb); - } - //32 bits framebuffer - unsigned short* p_bmp565_data = new unsigned short[width * height]; - unsigned int* p_raw_data = (unsigned int*)m_phy_fb; - for (int i = 0; i < width * height; i++) - { - unsigned int rgb = *p_raw_data++; - p_bmp565_data[i] = GL_RGB_32_to_16(rgb); - } - int ret = build_bmp(file_name, width, height, (unsigned char*)p_bmp565_data); - delete[]p_bmp565_data; - return ret; - } -private: - int m_width; //in pixels - int m_height; //in pixels - int m_color_bytes; //16 bits, 32 bits only - void* m_phy_fb; //physical framebuffer - int m_phy_read_index; - int m_phy_write_index; - c_surface* m_surface_group[SURFACE_CNT_MAX]; - int m_surface_cnt; //surface count - int m_surface_index; -}; -class c_layer -{ -public: - c_layer() { fb = 0; } - void* fb; //framebuffer - c_rect rect; //framebuffer area -}; -class c_surface { - friend class c_display; friend class c_bitmap_operator; -public: - c_surface(unsigned int width, unsigned int height, unsigned int color_bytes, Z_ORDER_LEVEL max_zorder = Z_ORDER_LEVEL_0, c_rect overlpa_rect = c_rect()) : m_width(width), m_height(height), m_color_bytes(color_bytes), m_fb(0), m_is_active(false), m_top_zorder(Z_ORDER_LEVEL_0), m_phy_fb(0), m_phy_write_index(0), m_display(0) - { - (overlpa_rect == c_rect()) ? set_surface(max_zorder, c_rect(0, 0, width - 1, height - 1)) : set_surface(max_zorder, overlpa_rect); - } - int get_width() { return m_width; } - int get_height() { return m_height; } - unsigned int get_pixel(int x, int y, unsigned int z_order) - { - if (x >= m_width || y >= m_height || x < 0 || y < 0 || z_order >= Z_ORDER_LEVEL_MAX) - { - ASSERT(false); - return 0; - } - if (m_layers[z_order].fb) - { - return (m_color_bytes == 4) ? ((unsigned int*)(m_layers[z_order].fb))[y * m_width + x] : GL_RGB_16_to_32(((unsigned short*)(m_layers[z_order].fb))[y * m_width + x]); - } - else if (m_fb) - { - return (m_color_bytes == 4) ? ((unsigned int*)m_fb)[y * m_width + x] : GL_RGB_16_to_32(((unsigned short*)m_fb)[y * m_width + x]); - } - else if (m_phy_fb) - { - return (m_color_bytes == 4) ? ((unsigned int*)m_phy_fb)[y * m_width + x] : GL_RGB_16_to_32(((unsigned short*)m_phy_fb)[y * m_width + x]); - } - return 0; - } - virtual void draw_pixel(int x, int y, unsigned int rgb, unsigned int z_order) - { - if (x >= m_width || y >= m_height || x < 0 || y < 0) - { - return; - } - if (z_order > (unsigned int)m_max_zorder) - { - ASSERT(false); - return; - } - if (z_order == m_max_zorder) - { - return draw_pixel_on_fb(x, y, rgb); - } - - if (z_order > (unsigned int)m_top_zorder) - { - m_top_zorder = (Z_ORDER_LEVEL)z_order; - } - if (m_layers[z_order].rect.pt_in_rect(x, y)) - { - c_rect layer_rect = m_layers[z_order].rect; - if (m_color_bytes == 4) - { - ((unsigned int*)(m_layers[z_order].fb))[(x - layer_rect.m_left) + (y - layer_rect.m_top) * layer_rect.width()] = rgb; - } - else - { - ((unsigned short*)(m_layers[z_order].fb))[(x - layer_rect.m_left) + (y - layer_rect.m_top) * layer_rect.width()] = GL_RGB_32_to_16(rgb); - } - } - - if (z_order == m_top_zorder) - { - return draw_pixel_on_fb(x, y, rgb); - } - bool be_overlapped = false; - for (unsigned int tmp_z_order = Z_ORDER_LEVEL_MAX - 1; tmp_z_order > z_order; tmp_z_order--) - { - if (m_layers[tmp_z_order].rect.pt_in_rect(x, y)) - { - be_overlapped = true; - break; - } - } - if (!be_overlapped) - { - draw_pixel_on_fb(x, y, rgb); - } - } - virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order) - { - x0 = (x0 < 0) ? 0 : x0; - y0 = (y0 < 0) ? 0 : y0; - x1 = (x1 > (m_width - 1)) ? (m_width - 1) : x1; - y1 = (y1 > (m_height - 1)) ? (m_height - 1) : y1; - if (z_order == m_max_zorder) - { - return fill_rect_on_fb(x0, y0, x1, y1, rgb); - } - if (z_order == m_top_zorder) - { - int x, y; - c_rect layer_rect = m_layers[z_order].rect; - unsigned int rgb_16 = GL_RGB_32_to_16(rgb); - for (y = y0; y <= y1; y++) - { - for (x = x0; x <= x1; x++) - { - if (layer_rect.pt_in_rect(x, y)) - { - if (m_color_bytes == 4) - { - ((unsigned int*)m_layers[z_order].fb)[(y - layer_rect.m_top) * layer_rect.width() + (x - layer_rect.m_left)] = rgb; - } - else - { - ((unsigned short*)m_layers[z_order].fb)[(y - layer_rect.m_top) * layer_rect.width() + (x - layer_rect.m_left)] = rgb_16; - } - } - } - } - return fill_rect_on_fb(x0, y0, x1, y1, rgb); - } - for (; y0 <= y1; y0++) - { - draw_hline(x0, x1, y0, rgb, z_order); - } - } - void draw_hline(int x0, int x1, int y, unsigned int rgb, unsigned int z_order) - { - for (; x0 <= x1; x0++) - { - draw_pixel(x0, y, rgb, z_order); - } - } - void draw_vline(int x, int y0, int y1, unsigned int rgb, unsigned int z_order) - { - for (; y0 <= y1; y0++) - { - draw_pixel(x, y0, rgb, z_order); - } - } - void draw_line(int x1, int y1, int x2, int y2, unsigned int rgb, unsigned int z_order) - { - int dx, dy, x, y, e; - (x1 > x2) ? (dx = x1 - x2) : (dx = x2 - x1); - (y1 > y2) ? (dy = y1 - y2) : (dy = y2 - y1); - if (((dx > dy) && (x1 > x2)) || ((dx <= dy) && (y1 > y2))) - { - x = x2; y = y2; - x2 = x1; y2 = y1; - x1 = x; y1 = y; - } - x = x1; y = y1; - if (dx > dy) - { - e = dy - dx / 2; - for (; x1 <= x2; ++x1, e += dy) - { - draw_pixel(x1, y1, rgb, z_order); - if (e > 0) { e -= dx; (y > y2) ? --y1 : ++y1; } - } - } - else - { - e = dx - dy / 2; - for (; y1 <= y2; ++y1, e += dx) - { - draw_pixel(x1, y1, rgb, z_order); - if (e > 0) { e -= dy; (x > x2) ? --x1 : ++x1; } - } - } - } - void draw_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order, unsigned int size = 1) - { - for (unsigned int offset = 0; offset < size; offset++) - { - draw_hline(x0 + offset, x1 - offset, y0 + offset, rgb, z_order); - draw_hline(x0 + offset, x1 - offset, y1 - offset, rgb, z_order); - draw_vline(x0 + offset, y0 + offset, y1 - offset, rgb, z_order); - draw_vline(x1 - offset, y0 + offset, y1 - offset, rgb, z_order); - } - } - void draw_rect(c_rect rect, unsigned int rgb, unsigned int size, unsigned int z_order) - { - draw_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, rgb, z_order, size); - } - void fill_rect(c_rect rect, unsigned int rgb, unsigned int z_order) - { - fill_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, rgb, z_order); - } - int flush_screen(int left, int top, int right, int bottom) - { - if (left < 0 || left >= m_width || right < 0 || right >= m_width || - top < 0 || top >= m_height || bottom < 0 || bottom >= m_height) - { - ASSERT(false); - } - if (!m_is_active || (0 == m_phy_fb) || (0 == m_fb)) - { - return -1; - } - int display_width = m_display->get_width(); - int display_height = m_display->get_height(); - left = (left >= display_width) ? (display_width - 1) : left; - right = (right >= display_width) ? (display_width - 1) : right; - top = (top >= display_height) ? (display_height - 1) : top; - bottom = (bottom >= display_height) ? (display_height - 1) : bottom; - for (int y = top; y < bottom; y++) - { - void* s_addr = (char*)m_fb + ((y * m_width + left) * m_color_bytes); - void* d_addr = (char*)m_phy_fb + ((y * display_width + left) * m_color_bytes); - memcpy(d_addr, s_addr, (right - left) * m_color_bytes); - } - *m_phy_write_index = *m_phy_write_index + 1; - return 0; - } - bool is_active() { return m_is_active; } - c_display* get_display() { return m_display; } - int show_layer(c_rect& rect, unsigned int z_order) - { - ASSERT(z_order >= Z_ORDER_LEVEL_0 && z_order < Z_ORDER_LEVEL_MAX); - c_rect layer_rect = m_layers[z_order].rect; - ASSERT(rect.m_left >= layer_rect.m_left && rect.m_right <= layer_rect.m_right && - rect.m_top >= layer_rect.m_top && rect.m_bottom <= layer_rect.m_bottom); - void* fb = m_layers[z_order].fb; - int width = layer_rect.width(); - for (int y = rect.m_top; y <= rect.m_bottom; y++) - { - for (int x = rect.m_left; x <= rect.m_right; x++) - { - unsigned int rgb = (m_color_bytes == 4) ? ((unsigned int*)fb)[(x - layer_rect.m_left) + (y - layer_rect.m_top) * width] : GL_RGB_16_to_32(((unsigned short*)fb)[(x - layer_rect.m_left) + (y - layer_rect.m_top) * width]); - draw_pixel_on_fb(x, y, rgb); - } - } - return 0; - } - void set_active(bool flag) { m_is_active = flag; } -protected: - virtual void fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb) - { - int display_width = m_display->get_width(); - int display_height = m_display->get_height(); - if (m_color_bytes == 4) - { - int x; - unsigned int* fb, * phy_fb; - for (; y0 <= y1; y0++) - { - x = x0; - fb = m_fb ? &((unsigned int*)m_fb)[y0 * m_width + x] : 0; - phy_fb = &((unsigned int*)m_phy_fb)[y0 * display_width + x]; - *m_phy_write_index = *m_phy_write_index + 1; - for (; x <= x1; x++) - { - if (fb) - { - *fb++ = rgb; - } - if (m_is_active && (x < display_width) && (y0 < display_height)) - { - *phy_fb++ = rgb; - } - } - } - } - else if (m_color_bytes == 2) - { - int x; - unsigned short* fb, * phy_fb; - rgb = GL_RGB_32_to_16(rgb); - for (; y0 <= y1; y0++) - { - x = x0; - fb = m_fb ? &((unsigned short*)m_fb)[y0 * m_width + x] : 0; - phy_fb = &((unsigned short*)m_phy_fb)[y0 * display_width + x]; - *m_phy_write_index = *m_phy_write_index + 1; - for (; x <= x1; x++) - { - if (fb) - { - *fb++ = rgb; - } - if (m_is_active && (x < display_width) && (y0 < display_height)) - { - *phy_fb++ = rgb; - } - } - } - } - } - virtual void draw_pixel_on_fb(int x, int y, unsigned int rgb) - { - if (m_fb) - { - (m_color_bytes == 4) ? ((unsigned int*)m_fb)[y * m_width + x] = rgb : ((unsigned short*)m_fb)[y * m_width + x] = GL_RGB_32_to_16(rgb); - } - if (m_is_active && (x < m_display->get_width()) && (y < m_display->get_height())) - { - if (m_color_bytes == 4) - { - ((unsigned int*)m_phy_fb)[y * (m_display->get_width()) + x] = rgb; - } - else - { - ((unsigned short*)m_phy_fb)[y * (m_display->get_width()) + x] = GL_RGB_32_to_16(rgb); - } - *m_phy_write_index = *m_phy_write_index + 1; - } - } - void attach_display(c_display* display) - { - ASSERT(display); - m_display = display; - m_phy_fb = display->m_phy_fb; - m_phy_write_index = &display->m_phy_write_index; - } - void set_surface(Z_ORDER_LEVEL max_z_order, c_rect layer_rect) - { - m_max_zorder = max_z_order; - if (m_display && (m_display->m_surface_cnt > 1)) - { - m_fb = calloc(m_width * m_height, m_color_bytes); - } - for (int i = Z_ORDER_LEVEL_0; i < m_max_zorder; i++) - {//Top layber fb always be 0 - ASSERT(m_layers[i].fb = calloc(layer_rect.width() * layer_rect.height(), m_color_bytes)); - m_layers[i].rect = layer_rect; - } - } - int m_width; //in pixels - int m_height; //in pixels - int m_color_bytes; //16 bits, 32 bits only - void* m_fb; //frame buffer you could see - c_layer m_layers[Z_ORDER_LEVEL_MAX];//all graphic layers - bool m_is_active; //active flag - Z_ORDER_LEVEL m_max_zorder; //the highest graphic layer the surface will have - Z_ORDER_LEVEL m_top_zorder; //the current highest graphic layer the surface have - void* m_phy_fb; //physical framebufer - int* m_phy_write_index; - c_display* m_display; -}; -class c_surface_no_fb : public c_surface {//No physical framebuffer, render with external graphic interface - friend class c_display; -public: - c_surface_no_fb(unsigned int width, unsigned int height, unsigned int color_bytes, struct EXTERNAL_GFX_OP* gfx_op, Z_ORDER_LEVEL max_zorder = Z_ORDER_LEVEL_0, c_rect overlpa_rect = c_rect()) : c_surface(width, height, color_bytes, max_zorder, overlpa_rect), m_gfx_op(gfx_op) {} -protected: - virtual void fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb) - { - if (!m_gfx_op) - { - return; - } - if (m_gfx_op->fill_rect) - { - return m_gfx_op->fill_rect(x0, y0, x1, y1, rgb); - } - if (m_gfx_op->draw_pixel && m_is_active) - { - for (int y = y0; y <= y1; y++) - { - for (int x = x0; x <= x1; x++) - { - m_gfx_op->draw_pixel(x, y, rgb); - } - } - } - if (!m_fb) { return; } - if (m_color_bytes == 4) - { - unsigned int* fb; - for (int y = y0; y <= y1; y++) - { - fb = &((unsigned int*)m_fb)[y0 * m_width + x0]; - for (int x = x0; x <= x1; x++) - { - *fb++ = rgb; - } - } - } - else if (m_color_bytes == 2) - { - unsigned short* fb; - rgb = GL_RGB_32_to_16(rgb); - for (int y = y0; y <= y1; y++) - { - fb = &((unsigned short*)m_fb)[y0 * m_width + x0]; - for (int x = x0; x <= x1; x++) - { - *fb++ = rgb; - } - } - } - } - virtual void draw_pixel_on_fb(int x, int y, unsigned int rgb) - { - if (m_gfx_op && m_gfx_op->draw_pixel && m_is_active) - { - m_gfx_op->draw_pixel(x, y, rgb); - } - if (!m_fb) { return; } - if (m_color_bytes == 4) - { - ((unsigned int*)m_fb)[y * m_width + x] = rgb; - } - else if (m_color_bytes == 2) - { - ((unsigned short*)m_fb)[y * m_width + x] = GL_RGB_32_to_16(rgb); - } - } - struct EXTERNAL_GFX_OP* m_gfx_op;//Rendering by external method -}; -inline c_display::c_display(void* phy_fb, int display_width, int display_height, int surface_width, int surface_height, unsigned int color_bytes, int surface_cnt, EXTERNAL_GFX_OP* gfx_op) : m_width(display_width), m_height(display_height), m_color_bytes(color_bytes), m_phy_fb(phy_fb), m_phy_read_index(0), m_phy_write_index(0), m_surface_cnt(surface_cnt), m_surface_index(0) -{ - ASSERT(color_bytes == 2 || color_bytes == 4); - ASSERT(m_surface_cnt <= SURFACE_CNT_MAX); - memset(m_surface_group, 0, sizeof(m_surface_group)); - - for (int i = 0; i < m_surface_cnt; i++) - { - m_surface_group[i] = (phy_fb) ? new c_surface(surface_width, surface_height, color_bytes) : new c_surface_no_fb(surface_width, surface_height, color_bytes, gfx_op); - m_surface_group[i]->attach_display(this); - } -} -inline c_display::c_display(void* phy_fb, int display_width, int display_height, c_surface* surface) : m_width(display_width), m_height(display_height), m_phy_fb(phy_fb), m_phy_read_index(0), m_phy_write_index(0), m_surface_cnt(1), m_surface_index(0) -{ - m_color_bytes = surface->m_color_bytes; - surface->m_is_active = true; - (m_surface_group[0] = surface)->attach_display(this); -} -inline c_surface* c_display::alloc_surface(Z_ORDER_LEVEL max_zorder, c_rect layer_rect) -{ - ASSERT(max_zorder < Z_ORDER_LEVEL_MAX && m_surface_index < m_surface_cnt); - (layer_rect == c_rect()) ? m_surface_group[m_surface_index]->set_surface(max_zorder, c_rect(0, 0, m_width - 1, m_height - 1)) : m_surface_group[m_surface_index]->set_surface(max_zorder, layer_rect); - return m_surface_group[m_surface_index++]; -} -inline int c_display::swipe_surface(c_surface* s0, c_surface* s1, int x0, int x1, int y0, int y1, int offset) -{ - int surface_width = s0->get_width(); - int surface_height = s0->get_height(); - if (offset < 0 || offset > surface_width || y0 < 0 || y0 >= surface_height || - y1 < 0 || y1 >= surface_height || x0 < 0 || x0 >= surface_width || x1 < 0 || x1 >= surface_width) - { - ASSERT(false); - return -1; - } - int width = (x1 - x0 + 1); - if (width < 0 || width > surface_width || width < offset) - { - ASSERT(false); - return -1; - } - x0 = (x0 >= m_width) ? (m_width - 1) : x0; - x1 = (x1 >= m_width) ? (m_width - 1) : x1; - y0 = (y0 >= m_height) ? (m_height - 1) : y0; - y1 = (y1 >= m_height) ? (m_height - 1) : y1; - if (m_phy_fb) - { - for (int y = y0; y <= y1; y++) - { - //Left surface - char* addr_s = ((char*)(s0->m_fb) + (y * (s0->get_width()) + x0 + offset) * m_color_bytes); - char* addr_d = ((char*)(m_phy_fb)+(y * m_width + x0) * m_color_bytes); - memcpy(addr_d, addr_s, (width - offset) * m_color_bytes); - //Right surface - addr_s = ((char*)(s1->m_fb) + (y * (s1->get_width()) + x0) * m_color_bytes); - addr_d = ((char*)(m_phy_fb)+(y * m_width + x0 + (width - offset)) * m_color_bytes); - memcpy(addr_d, addr_s, offset * m_color_bytes); - } - } - else if (m_color_bytes == 4) - { - void(*draw_pixel)(int x, int y, unsigned int rgb) = ((c_surface_no_fb*)s0)->m_gfx_op->draw_pixel; - for (int y = y0; y <= y1; y++) - { - //Left surface - for (int x = x0; x <= (x1 - offset); x++) - { - draw_pixel(x, y, ((unsigned int*)s0->m_fb)[y * m_width + x + offset]); - } - //Right surface - for (int x = x1 - offset; x <= x1; x++) - { - draw_pixel(x, y, ((unsigned int*)s1->m_fb)[y * m_width + x + offset - x1 + x0]); - } - } - } - else if (m_color_bytes == 2) - { - void(*draw_pixel)(int x, int y, unsigned int rgb) = ((c_surface_no_fb*)s0)->m_gfx_op->draw_pixel; - for (int y = y0; y <= y1; y++) - { - //Left surface - for (int x = x0; x <= (x1 - offset); x++) - { - draw_pixel(x, y, GL_RGB_16_to_32(((unsigned short*)s0->m_fb)[y * m_width + x + offset])); - } - //Right surface - for (int x = x1 - offset; x <= x1; x++) - { - draw_pixel(x, y, GL_RGB_16_to_32(((unsigned short*)s1->m_fb)[y * m_width + x + offset - x1 + x0])); - } - } - } - m_phy_write_index++; - return 0; -} -#include -#include -#define VALUE_STR_LEN 16 -class c_surface; -class c_font_operator -{ -public: - virtual void draw_string(c_surface* surface, int z_order, const void* string, int x, int y, const void* font, unsigned int font_color, unsigned int bg_color) = 0; - virtual void draw_string_in_rect(c_surface* surface, int z_order, const void* string, c_rect rect, const void* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT) = 0; - virtual void draw_value(c_surface* surface, int z_order, int value, int dot_position, int x, int y, const void* font, unsigned int font_color, unsigned int bg_color) = 0; - virtual void draw_value_in_rect(c_surface* surface, int z_order, int value, int dot_position, c_rect rect, const void* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT) = 0; - virtual int get_str_size(const void* string, const void* font, int& width, int& height) = 0; - void get_string_pos(const void* string, const void* font, c_rect rect, unsigned int align_type, int& x, int& y) - { - int x_size, y_size; - get_str_size(string, font, x_size, y_size); - int height = rect.m_bottom - rect.m_top + 1; - int width = rect.m_right - rect.m_left + 1; - x = y = 0; - switch (align_type & ALIGN_HMASK) - { - case ALIGN_HCENTER: - //m_text_org_x=0 - if (width > x_size) - { - x = (width - x_size) / 2; - } - break; - case ALIGN_LEFT: - x = 0; - break; - case ALIGN_RIGHT: - //m_text_org_x=0 - if (width > x_size) - { - x = width - x_size; - } - break; - default: - ASSERT(0); - break; - } - switch (align_type & ALIGN_VMASK) - { - case ALIGN_VCENTER: - //m_text_org_y=0 - if (height > y_size) - { - y = (height - y_size) / 2; - } - break; - case ALIGN_TOP: - y = 0; - break; - case ALIGN_BOTTOM: - //m_text_org_y=0 - if (height > y_size) - { - y = height - y_size; - } - break; - default: - ASSERT(0); - break; - } - } -}; -class c_lattice_font_op : public c_font_operator -{ -public: - void draw_string(c_surface* surface, int z_order, const void* string, int x, int y, const void* font, unsigned int font_color, unsigned int bg_color) - { - const char* s = (const char*)string; - if (0 == s) - { - return; - } - int offset = 0; - unsigned int utf8_code; - while (*s) - { - s += get_utf8_code(s, utf8_code); - offset += draw_single_char(surface, z_order, utf8_code, (x + offset), y, (const LATTICE_FONT_INFO*)font, font_color, bg_color); - } - } - void draw_string_in_rect(c_surface* surface, int z_order, const void* string, c_rect rect, const void* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT) - { - const char* s = (const char*)string; - if (0 == s) - { - return; - } - int x, y; - get_string_pos(s, (const LATTICE_FONT_INFO*)font, rect, align_type, x, y); - draw_string(surface, z_order, string, rect.m_left + x, rect.m_top + y, font, font_color, bg_color); - } - void draw_value(c_surface* surface, int z_order, int value, int dot_position, int x, int y, const void* font, unsigned int font_color, unsigned int bg_color) - { - char buf[VALUE_STR_LEN]; - value_2_string(value, dot_position, buf, VALUE_STR_LEN); - draw_string(surface, z_order, buf, x, y, (const LATTICE_FONT_INFO*)font, font_color, bg_color); - } - void draw_value_in_rect(c_surface* surface, int z_order, int value, int dot_position, c_rect rect, const void* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT) - { - char buf[VALUE_STR_LEN]; - value_2_string(value, dot_position, buf, VALUE_STR_LEN); - draw_string_in_rect(surface, z_order, buf, rect, (const LATTICE_FONT_INFO*)font, font_color, bg_color, align_type); - } - int get_str_size(const void *string, const void* font, int& width, int& height) - { - const char* s = (const char*)string; - if (0 == s || 0 == font) - { - width = height = 0; - return -1; - } - int lattice_width = 0; - unsigned int utf8_code; - int utf8_bytes; - while (*s) - { - utf8_bytes = get_utf8_code(s, utf8_code); - const LATTICE* p_lattice = get_lattice((const LATTICE_FONT_INFO*)font, utf8_code); - lattice_width += p_lattice ? p_lattice->width : ((const LATTICE_FONT_INFO*)font)->height; - s += utf8_bytes; - } - width = lattice_width; - height = ((const LATTICE_FONT_INFO*)font)->height; - return 0; - } -private: - void value_2_string(int value, int dot_position, char* buf, int len) - { - memset(buf, 0, len); - switch (dot_position) - { - case 0: - sprintf(buf, "%d", value); - break; - case 1: - sprintf(buf, "%.1f", value * 1.0 / 10); - break; - case 2: - sprintf(buf, "%.2f", value * 1.0 / 100); - break; - case 3: - sprintf(buf, "%.3f", value * 1.0 / 1000); - break; - default: - ASSERT(false); - break; - } - } - int draw_single_char(c_surface* surface, int z_order, unsigned int utf8_code, int x, int y, const LATTICE_FONT_INFO* font, unsigned int font_color, unsigned int bg_color) - { - unsigned int error_color = 0xFFFFFFFF; - if (font) - { - const LATTICE* p_lattice = get_lattice(font, utf8_code); - if (p_lattice) - { - draw_lattice(surface, z_order, x, y, p_lattice->width, font->height, p_lattice->pixel_buffer, font_color, bg_color); - return p_lattice->width; - } - } - else - { - error_color = GL_RGB(255, 0, 0); - } - //lattice/font not found, draw "X" - int len = 16; - for (int y_ = 0; y_ < len; y_++) - { - for (int x_ = 0; x_ < len; x_++) - { - int diff = (x_ - y_); - int sum = (x_ + y_); - (diff == 0 || diff == -1 || diff == 1 || sum == len || sum == (len - 1) || sum == (len + 1)) ? - surface->draw_pixel((x + x_), (y + y_), error_color, z_order) : surface->draw_pixel((x + x_), (y + y_), 0, z_order); - } - } - return len; - } - void draw_lattice(c_surface* surface, int z_order, int x, int y, int width, int height, const unsigned char* p_data, unsigned int font_color, unsigned int bg_color) - { - unsigned int r, g, b, rgb; - unsigned char blk_value = *p_data++; - unsigned char blk_cnt = *p_data++; - b = (GL_RGB_B(font_color) * blk_value + GL_RGB_B(bg_color) * (255 - blk_value)) >> 8; - g = (GL_RGB_G(font_color) * blk_value + GL_RGB_G(bg_color) * (255 - blk_value)) >> 8; - r = (GL_RGB_R(font_color) * blk_value + GL_RGB_R(bg_color) * (255 - blk_value)) >> 8; - rgb = GL_RGB(r, g, b); - for (int y_ = 0; y_ < height; y_++) - { - for (int x_ = 0; x_ < width; x_++) - { - ASSERT(blk_cnt); - if (0x00 == blk_value) - { - if (GL_ARGB_A(bg_color)) - { - surface->draw_pixel(x + x_, y + y_, bg_color, z_order); - } - } - else - { - surface->draw_pixel((x + x_), (y + y_), rgb, z_order); - } - if (--blk_cnt == 0) - {//reload new block - blk_value = *p_data++; - blk_cnt = *p_data++; - b = (GL_RGB_B(font_color) * blk_value + GL_RGB_B(bg_color) * (255 - blk_value)) >> 8; - g = (GL_RGB_G(font_color) * blk_value + GL_RGB_G(bg_color) * (255 - blk_value)) >> 8; - r = (GL_RGB_R(font_color) * blk_value + GL_RGB_R(bg_color) * (255 - blk_value)) >> 8; - rgb = GL_RGB(r, g, b); - } - } - } - } - - const LATTICE* get_lattice(const LATTICE_FONT_INFO* font, unsigned int utf8_code) - { - int first = 0; - int last = font->count - 1; - int middle = (first + last) / 2; - while (first <= last) - { - if (font->lattice_array[middle].utf8_code < utf8_code) - first = middle + 1; - else if (font->lattice_array[middle].utf8_code == utf8_code) - { - return &font->lattice_array[middle]; - } - else - { - last = middle - 1; - } - middle = (first + last) / 2; - } - return 0; - } - - static int get_utf8_code(const char* s, unsigned int& output_utf8_code) - { - static unsigned char s_utf8_length_table[256] = - { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1 - }; - unsigned char* us = (unsigned char*)s; - int utf8_bytes = s_utf8_length_table[*us]; - switch (utf8_bytes) - { - case 1: - output_utf8_code = *us; - break; - case 2: - output_utf8_code = (*us << 8) | (*(us + 1)); - break; - case 3: - output_utf8_code = (*us << 16) | ((*(us + 1)) << 8) | *(us + 2); - break; - case 4: - output_utf8_code = (*us << 24) | ((*(us + 1)) << 16) | (*(us + 2) << 8) | *(us + 3); - break; - default: - ASSERT(false); - break; - } - return utf8_bytes; - } -}; -class c_word -{ -public: - static void draw_string(c_surface* surface, int z_order, const void* string, int x, int y, const void* font, unsigned int font_color, unsigned int bg_color)//string: char or wchar_t - { - fontOperator->draw_string(surface, z_order, string, x, y, font, font_color, bg_color); - } - static void draw_string_in_rect(c_surface* surface, int z_order, const void* string, c_rect rect, const void* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT)//string: char or wchar_t - { - fontOperator->draw_string_in_rect(surface, z_order, string, rect, font, font_color, bg_color, align_type); - } - static void draw_value_in_rect(c_surface* surface, int z_order, int value, int dot_position, c_rect rect, const void* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT) - { - fontOperator->draw_value_in_rect(surface, z_order, value, dot_position, rect, font, font_color, bg_color, align_type); - } - static void draw_value(c_surface* surface, int z_order, int value, int dot_position, int x, int y, const void* font, unsigned int font_color, unsigned int bg_color) - { - fontOperator->draw_value(surface, z_order, value, dot_position, x, y, font, font_color, bg_color); - } - - static int get_str_size(const void* string, const void* font, int& width, int& height) - { - return fontOperator->get_str_size(string, font, width, height); - } - static c_font_operator* fontOperator; -}; -#define DEFAULT_MASK_COLOR 0xFF080408 -class c_surface; -class c_image_operator -{ -public: - virtual void draw_image(c_surface* surface, int z_order, const void* image_info, int x, int y, unsigned int mask_rgb = DEFAULT_MASK_COLOR) = 0; - virtual void draw_image(c_surface* surface, int z_order, const void* image_info, int x, int y, int src_x, int src_y, int width, int height, unsigned int mask_rgb = DEFAULT_MASK_COLOR) = 0; -}; -class c_bitmap_operator : public c_image_operator -{ -public: - virtual void draw_image(c_surface* surface, int z_order, const void* image_info, int x, int y, unsigned int mask_rgb = DEFAULT_MASK_COLOR) - { - ASSERT(image_info); - BITMAP_INFO* pBitmap = (BITMAP_INFO*)image_info; - unsigned short* lower_fb_16 = 0; - unsigned int* lower_fb_32 = 0; - int lower_fb_width = 0; - c_rect lower_fb_rect; - if (z_order >= Z_ORDER_LEVEL_1) - { - lower_fb_16 = (unsigned short*)surface->m_layers[z_order - 1].fb; - lower_fb_32 = (unsigned int*)surface->m_layers[z_order - 1].fb; - lower_fb_rect = surface->m_layers[z_order - 1].rect; - lower_fb_width = lower_fb_rect.width(); - } - unsigned int mask_rgb_16 = GL_RGB_32_to_16(mask_rgb); - int xsize = pBitmap->width; - int ysize = pBitmap->height; - const unsigned short* pData = (const unsigned short*)pBitmap->pixel_color_array; - int color_bytes = surface->m_color_bytes; - for (int y_ = y; y_ < y + ysize; y_++) - { - for (int x_ = x; x_ < x + xsize; x_++) - { - unsigned int rgb = *pData++; - if (mask_rgb_16 == rgb) - { - if (lower_fb_rect.pt_in_rect(x_, y_)) - {//show lower layer - surface->draw_pixel(x_, y_, (color_bytes == 4) ? lower_fb_32[(y_ - lower_fb_rect.m_top) * lower_fb_width + (x_ - lower_fb_rect.m_left)] : GL_RGB_16_to_32(lower_fb_16[(y_ - lower_fb_rect.m_top) * lower_fb_width + (x_ - lower_fb_rect.m_left)]), z_order); - } - } - else - { - surface->draw_pixel(x_, y_, GL_RGB_16_to_32(rgb), z_order); - } - } - } - } - virtual void draw_image(c_surface* surface, int z_order, const void* image_info, int x, int y, int src_x, int src_y, int width, int height, unsigned int mask_rgb = DEFAULT_MASK_COLOR) - { - ASSERT(image_info); - BITMAP_INFO* pBitmap = (BITMAP_INFO*)image_info; - if (0 == pBitmap || (src_x + width > pBitmap->width) || (src_y + height > pBitmap->height)) - { - return; - } - unsigned short* lower_fb_16 = 0; - unsigned int* lower_fb_32 = 0; - int lower_fb_width = 0; - c_rect lower_fb_rect; - if (z_order >= Z_ORDER_LEVEL_1) - { - lower_fb_16 = (unsigned short*)surface->m_layers[z_order - 1].fb; - lower_fb_32 = (unsigned int*)surface->m_layers[z_order - 1].fb; - lower_fb_rect = surface->m_layers[z_order - 1].rect; - lower_fb_width = lower_fb_rect.width(); - } - unsigned int mask_rgb_16 = GL_RGB_32_to_16(mask_rgb); - const unsigned short* pData = (const unsigned short*)pBitmap->pixel_color_array; - int color_bytes = surface->m_color_bytes; - for (int y_ = 0; y_ < height; y_++) - { - const unsigned short* p = &pData[src_x + (src_y + y_) * pBitmap->width]; - for (int x_ = 0; x_ < width; x_++) - { - unsigned int rgb = *p++; - if (mask_rgb_16 == rgb) - { - if (lower_fb_rect.pt_in_rect(x + x_, y + y_)) - {//show lower layer - surface->draw_pixel(x + x_, y + y_, (color_bytes == 4) ? lower_fb_32[(y + y_ - lower_fb_rect.m_top) * lower_fb_width + x + x_ - lower_fb_rect.m_left] : GL_RGB_16_to_32(lower_fb_16[(y + y_ - lower_fb_rect.m_top) * lower_fb_width + x + x_ - lower_fb_rect.m_left]), z_order); - } - } - else - { - surface->draw_pixel(x + x_, y + y_, GL_RGB_16_to_32(rgb), z_order); - } - } - } - } -}; -class c_image -{ -public: - static void draw_image(c_surface* surface, int z_order, const void* image_info, int x, int y, unsigned int mask_rgb = DEFAULT_MASK_COLOR) - { - image_operator->draw_image(surface, z_order, image_info, x, y, mask_rgb); - } - static void draw_image(c_surface* surface, int z_order, const void* image_info, int x, int y, int src_x, int src_y, int width, int height, unsigned int mask_rgb = DEFAULT_MASK_COLOR) - { - image_operator->draw_image(surface, z_order, image_info, x, y, src_x, src_y, width, height, mask_rgb); - } - - static c_image_operator* image_operator; -}; -class c_wnd; -class c_surface; -typedef enum -{ - ATTR_VISIBLE = 0x40000000L, - ATTR_FOCUS = 0x20000000L, - ATTR_PRIORITY = 0x10000000L// Handle touch action at high priority -}WND_ATTRIBUTION; -typedef enum -{ - STATUS_NORMAL, - STATUS_PUSHED, - STATUS_FOCUSED, - STATUS_DISABLED -}WND_STATUS; -typedef enum -{ - NAV_FORWARD, - NAV_BACKWARD, - NAV_ENTER -}NAVIGATION_KEY; -typedef enum -{ - TOUCH_DOWN, - TOUCH_UP -}TOUCH_ACTION; -typedef struct struct_wnd_tree -{ - c_wnd* p_wnd;//window instance - unsigned int resource_id;//ID - const char* str;//caption - short x;//position x - short y;//position y - short width; - short height; - struct struct_wnd_tree* p_child_tree;//sub tree -}WND_TREE; -typedef void (c_wnd::*WND_CALLBACK)(int, int); -class c_wnd -{ -public: - c_wnd() : m_status(STATUS_NORMAL), m_attr((WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS)), m_parent(0), m_top_child(0), m_prev_sibling(0), m_next_sibling(0), - m_str(0), m_font_color(0), m_bg_color(0), m_id(0), m_z_order(Z_ORDER_LEVEL_0), m_focus_child(0), m_surface(0) {}; - virtual ~c_wnd() {}; - virtual int connect(c_wnd *parent, unsigned short resource_id, const char* str, - short x, short y, short width, short height, WND_TREE* p_child_tree = 0) - { - if (0 == resource_id) - { - ASSERT(false); - return -1; - } - m_id = resource_id; - set_str(str); - m_parent = parent; - m_status = STATUS_NORMAL; - if (parent) - { - m_z_order = parent->m_z_order; - m_surface = parent->m_surface; - } - if (0 == m_surface) - { - ASSERT(false); - return -2; - } - /* (cs.x = x * 1024 / 768) for 1027*768=>800*600 quickly*/ - m_wnd_rect.m_left = x; - m_wnd_rect.m_top = y; - m_wnd_rect.m_right = (x + width - 1); - m_wnd_rect.m_bottom = (y + height - 1); - pre_create_wnd(); - if (0 != parent) - { - parent->add_child_2_tail(this); - } - if (load_child_wnd(p_child_tree) >= 0) - { - on_init_children(); - } - return 0; - } - void disconnect() - { - if (0 == m_id) - { - return; - } - if (0 != m_top_child) - { - c_wnd* child = m_top_child; - c_wnd* next_child = 0; - while (child) - { - next_child = child->m_next_sibling; - child->disconnect(); - child = next_child; - } - } - if (0 != m_parent) - { - m_parent->unlink_child(this); - } - m_focus_child = 0; - m_id = 0; - } - virtual void on_init_children() {} - virtual void on_paint() {} - virtual void show_window() - { - if (ATTR_VISIBLE == (m_attr & ATTR_VISIBLE)) - { - on_paint(); - c_wnd* child = m_top_child; - if (0 != child) - { - while (child) - { - child->show_window(); - child = child->m_next_sibling; - } - } - } - } - unsigned short get_id() const { return m_id; } - int get_z_order() { return m_z_order; } - c_wnd* get_wnd_ptr(unsigned short id) const - { - c_wnd* child = m_top_child; - while (child) - { - if (child->get_id() == id) - { - break; - } - child = child->m_next_sibling; - } - return child; - } - unsigned int get_attr() const { return m_attr; } - void set_str(const char* str) { m_str = str; } - void set_attr(WND_ATTRIBUTION attr) { m_attr = attr; } - bool is_focus_wnd() const - { - return ((m_attr & ATTR_VISIBLE) && (m_attr & ATTR_FOCUS)) ? true : false; - } - void set_font_color(unsigned int color) { m_font_color = color; } - unsigned int get_font_color() { return m_font_color; } - void set_bg_color(unsigned int color) { m_bg_color = color; } - unsigned int get_bg_color() { return m_bg_color; } - void set_font_type(const LATTICE_FONT_INFO *font_type) { m_font = font_type; } - const void* get_font_type() { return m_font; } - void set_wnd_pos(short x, short y, short width, short height) - { - m_wnd_rect.m_left = x; - m_wnd_rect.m_top = y; - m_wnd_rect.m_right = x + width - 1; - m_wnd_rect.m_bottom = y + height - 1; - } - void get_wnd_rect(c_rect &rect) const { rect = m_wnd_rect; } - void get_screen_rect(c_rect &rect) const - { - int l = 0; - int t = 0; - wnd2screen(l, t); - rect.set_rect(l, t, m_wnd_rect.width(), m_wnd_rect.height()); - } - c_wnd* set_child_focus(c_wnd *focus_child) - { - ASSERT(0 != focus_child); - ASSERT(focus_child->m_parent == this); - c_wnd* old_focus_child = m_focus_child; - if (focus_child->is_focus_wnd()) - { - if (focus_child != old_focus_child) - { - if (old_focus_child) - { - old_focus_child->on_kill_focus(); - } - m_focus_child = focus_child; - m_focus_child->on_focus(); - } - } - return m_focus_child; - } - c_wnd* get_parent() const { return m_parent; } - c_wnd* get_last_child() const - { - if (0 == m_top_child) - { - return 0; - } - c_wnd* child = m_top_child; - while (child->m_next_sibling) - { - child = child->m_next_sibling; - } - return child; - } - int unlink_child(c_wnd *child) - { - if ((0 == child) - || (this != child->m_parent)) - { - return -1; - } - if (0 == m_top_child) - { - return -2; - } - bool find = false; - c_wnd* tmp_child = m_top_child; - if (tmp_child == child) - { - m_top_child = child->m_next_sibling; - if (0 != child->m_next_sibling) - { - child->m_next_sibling->m_prev_sibling = 0; - } - find = true; - } - else - { - while (tmp_child->m_next_sibling) - { - if (child == tmp_child->m_next_sibling) - { - tmp_child->m_next_sibling = child->m_next_sibling; - if (0 != child->m_next_sibling) - { - child->m_next_sibling->m_prev_sibling = tmp_child; - } - find = true; - break; - } - tmp_child = tmp_child->m_next_sibling; - } - } - if (true == find) - { - if (m_focus_child == child) - { - m_focus_child = 0; - } - child->m_next_sibling = 0; - child->m_prev_sibling = 0; - return 1; - } - else - { - return 0; - } - } - c_wnd* get_prev_sibling() const { return m_prev_sibling; } - c_wnd* get_next_sibling() const { return m_next_sibling; } - virtual void on_touch(int x, int y, TOUCH_ACTION action) - { - x -= m_wnd_rect.m_left; - y -= m_wnd_rect.m_top; - c_wnd* priority_wnd = 0; - c_wnd* tmp_child = m_top_child; - while (tmp_child) - { - if ((tmp_child->m_attr & ATTR_PRIORITY) && (tmp_child->m_attr & ATTR_VISIBLE)) - { - priority_wnd = tmp_child; - break; - } - tmp_child = tmp_child->m_next_sibling; - } - if (priority_wnd) - { - return priority_wnd->on_touch(x, y, action); - } - c_wnd* child = m_top_child; - while (child) - { - if (child->is_focus_wnd()) - { - c_rect rect; - child->get_wnd_rect(rect); - if (true == rect.pt_in_rect(x, y)) - { - return child->on_touch(x, y, action); - } - } - child = child->m_next_sibling; - } - } - virtual void on_navigate(NAVIGATION_KEY key) - { - c_wnd* priority_wnd = 0; - c_wnd* tmp_child = m_top_child; - while (tmp_child) - { - if ((tmp_child->m_attr & ATTR_PRIORITY) && (tmp_child->m_attr & ATTR_VISIBLE)) - { - priority_wnd = tmp_child; - break; - } - tmp_child = tmp_child->m_next_sibling; - } - if (priority_wnd) - { - return priority_wnd->on_navigate(key); - } - if (!is_focus_wnd()) - { - return; - } - if (key != NAV_BACKWARD && key != NAV_FORWARD) - { - if (m_focus_child) - { - m_focus_child->on_navigate(key); - } - return; - } - // Move focus - c_wnd* old_focus_wnd = m_focus_child; - // No current focus wnd, new one. - if (!old_focus_wnd) - { - c_wnd* child = m_top_child; - c_wnd* new_focus_wnd = 0; - while (child) - { - if (child->is_focus_wnd()) - { - new_focus_wnd = child; - new_focus_wnd->m_parent->set_child_focus(new_focus_wnd); - child = child->m_top_child; - continue; - } - child = child->m_next_sibling; - } - return; - } - // Move focus from old wnd to next wnd - c_wnd* next_focus_wnd = (key == NAV_FORWARD) ? old_focus_wnd->m_next_sibling : old_focus_wnd->m_prev_sibling; - while (next_focus_wnd && (!next_focus_wnd->is_focus_wnd())) - {// Search neighbor of old focus wnd - next_focus_wnd = (key == NAV_FORWARD) ? next_focus_wnd->m_next_sibling : next_focus_wnd->m_prev_sibling; - } - if (!next_focus_wnd) - {// Search whole brother wnd - next_focus_wnd = (key == NAV_FORWARD) ? old_focus_wnd->m_parent->m_top_child : old_focus_wnd->m_parent->get_last_child(); - while (next_focus_wnd && (!next_focus_wnd->is_focus_wnd())) - { - next_focus_wnd = (key == NAV_FORWARD) ? next_focus_wnd->m_next_sibling : next_focus_wnd->m_prev_sibling; - } - } - if (next_focus_wnd) - { - next_focus_wnd->m_parent->set_child_focus(next_focus_wnd); - } - } - c_surface* get_surface() { return m_surface; } - void set_surface(c_surface* surface) { m_surface = surface; } -protected: - virtual void pre_create_wnd() {}; - void add_child_2_tail(c_wnd *child) - { - if (0 == child)return; - if (child == get_wnd_ptr(child->m_id))return; - if (0 == m_top_child) - { - m_top_child = child; - child->m_prev_sibling = 0; - child->m_next_sibling = 0; - } - else - { - c_wnd* last_child = get_last_child(); - if (0 == last_child) - { - ASSERT(false); - } - last_child->m_next_sibling = child; - child->m_prev_sibling = last_child; - child->m_next_sibling = 0; - } - } - void wnd2screen(int &x, int &y) const - { - c_wnd* parent = m_parent; - c_rect rect; - x += m_wnd_rect.m_left; - y += m_wnd_rect.m_top; - while (0 != parent) - { - parent->get_wnd_rect(rect); - x += rect.m_left; - y += rect.m_top; - parent = parent->m_parent; - } - } - int load_child_wnd(WND_TREE *p_child_tree) - { - if (0 == p_child_tree) - { - return 0; - } - int sum = 0; - WND_TREE* p_cur = p_child_tree; - while (p_cur->p_wnd) - { - if (0 != p_cur->p_wnd->m_id) - {//This wnd has been used! Do not share! - ASSERT(false); - return -1; - } - else - { - p_cur->p_wnd->connect(this, p_cur->resource_id, p_cur->str, - p_cur->x, p_cur->y, p_cur->width, p_cur->height, p_cur->p_child_tree); - } - p_cur++; - sum++; - } - return sum; - } - void set_active_child(c_wnd* child) { m_focus_child = child; } - virtual void on_focus() {}; - virtual void on_kill_focus() {}; -protected: - unsigned short m_id; - WND_STATUS m_status; - WND_ATTRIBUTION m_attr; - c_rect m_wnd_rect; //position relative to parent window. - c_wnd* m_parent; //parent window - c_wnd* m_top_child; //the first sub window would be navigated - c_wnd* m_prev_sibling; //previous brother - c_wnd* m_next_sibling; //next brother - c_wnd* m_focus_child; //current focused window - const char* m_str; //caption - const void* m_font; //font face - unsigned int m_font_color; - unsigned int m_bg_color; - int m_z_order; //the graphic level for rendering - c_surface* m_surface; -}; -class c_button : public c_wnd -{ -public: - void set_on_click(WND_CALLBACK on_click) { this->on_click = on_click; } -protected: - virtual void on_paint() - { - c_rect rect; - get_screen_rect(rect); - switch (m_status) - { - case STATUS_NORMAL: - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_NORMAL), m_z_order); - if (m_str) - { - c_word::draw_string_in_rect(m_surface, m_z_order, m_str, rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_NORMAL), ALIGN_HCENTER | ALIGN_VCENTER); - } - break; - case STATUS_FOCUSED: - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_FOCUS), m_z_order); - if (m_str) - { - c_word::draw_string_in_rect(m_surface, m_z_order, m_str, rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_FOCUS), ALIGN_HCENTER | ALIGN_VCENTER); - } - break; - case STATUS_PUSHED: - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_PUSHED), m_z_order); - m_surface->draw_rect(rect, c_theme::get_color(COLOR_WND_BORDER), 2, m_z_order); - if (m_str) - { - c_word::draw_string_in_rect(m_surface, m_z_order, m_str, rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_PUSHED), ALIGN_HCENTER | ALIGN_VCENTER); - } - break; - default: - ASSERT(false); - break; - } - } - virtual void on_focus() - { - m_status = STATUS_FOCUSED; - on_paint(); - } - virtual void on_kill_focus() - { - m_status = STATUS_NORMAL; - on_paint(); - } - virtual void pre_create_wnd() - { - on_click = 0; - m_attr = (WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS); - m_font = c_theme::get_font(FONT_DEFAULT); - m_font_color = c_theme::get_color(COLOR_WND_FONT); - } - virtual void on_touch(int x, int y, TOUCH_ACTION action) - { - if (action == TOUCH_DOWN) - { - m_parent->set_child_focus(this); - m_status = STATUS_PUSHED; - on_paint(); - } - else - { - m_status = STATUS_FOCUSED; - on_paint(); - if(on_click) - { - (m_parent->*(on_click))(m_id, 0); - } - } - } - virtual void on_navigate(NAVIGATION_KEY key) - { - switch (key) - { - case NAV_ENTER: - on_touch(m_wnd_rect.m_left, m_wnd_rect.m_top, TOUCH_DOWN); - on_touch(m_wnd_rect.m_left, m_wnd_rect.m_top, TOUCH_UP); - break; - case NAV_FORWARD: - case NAV_BACKWARD: - break; - } - return c_wnd::on_navigate(key); - } - WND_CALLBACK on_click; -}; -class c_surface; -class c_dialog; -typedef struct -{ - c_dialog* dialog; - c_surface* surface; -} DIALOG_ARRAY; -class c_dialog : public c_wnd -{ -public: - static int open_dialog(c_dialog* p_dlg, bool modal_mode = true) - { - if (0 == p_dlg) - { - ASSERT(false); - return 0; - } - c_dialog* cur_dlg = get_the_dialog(p_dlg->get_surface()); - if (cur_dlg == p_dlg) - { - return 1; - } - if (cur_dlg) - { - cur_dlg->set_attr(WND_ATTRIBUTION(0)); - } - p_dlg->set_attr(modal_mode ? (WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS | ATTR_PRIORITY) : (WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS)); - p_dlg->show_window(); - p_dlg->set_me_the_dialog(); - return 1; - } - static int close_dialog(c_surface* surface) - { - c_dialog* dlg = get_the_dialog(surface); - if (0 == dlg) - { - return 0; - } - c_rect rc; - dlg->get_screen_rect(rc); - dlg->set_attr(WND_ATTRIBUTION(0)); - surface->show_layer(rc, dlg->m_z_order - 1); - //clear the dialog - for (int i = 0; i < SURFACE_CNT_MAX; i++) - { - if (ms_the_dialogs[i].surface == surface) - { - ms_the_dialogs[i].dialog = 0; - return 1; - } - } - ASSERT(false); - return -1; - } - static c_dialog* get_the_dialog(c_surface* surface) - { - for (int i = 0; i < SURFACE_CNT_MAX; i++) - { - if (ms_the_dialogs[i].surface == surface) - { - return ms_the_dialogs[i].dialog; - } - } - return 0; - } -protected: - virtual void pre_create_wnd() - { - m_attr = WND_ATTRIBUTION(0);// no focus/visible - m_z_order = Z_ORDER_LEVEL_1; - m_bg_color = GL_RGB(33, 42, 53); - } - virtual void on_paint() - { - c_rect rect; - get_screen_rect(rect); - m_surface->fill_rect(rect, m_bg_color, m_z_order); - if (m_str) - { - c_word::draw_string(m_surface, m_z_order, m_str, rect.m_left + 35, rect.m_top, c_theme::get_font(FONT_DEFAULT), GL_RGB(255, 255, 255), GL_ARGB(0, 0, 0, 0)); - } - } -private: - int set_me_the_dialog() - { - c_surface* surface = get_surface(); - for (int i = 0; i < SURFACE_CNT_MAX; i++) - { - if (ms_the_dialogs[i].surface == surface) - { - ms_the_dialogs[i].dialog = this; - return 0; - } - } - for (int i = 0; i < SURFACE_CNT_MAX; i++) - { - if (ms_the_dialogs[i].surface == 0) - { - ms_the_dialogs[i].dialog = this; - ms_the_dialogs[i].surface = surface; - return 1; - } - } - ASSERT(false); - return -2; - } - static DIALOG_ARRAY ms_the_dialogs[SURFACE_CNT_MAX]; -}; -#include -//Changing key width/height will change the width/height of keyboard -#define KEY_WIDTH 65 -#define KEY_HEIGHT 38 -#define KEYBOARD_WIDTH ((KEY_WIDTH + 2) * 10) -#define KEYBOARD_HEIGHT ((KEY_HEIGHT + 2) * 4) -#define NUM_BOARD_WIDTH ((KEY_WIDTH + 2) * 4) -#define NUM_BOARD_HEIGHT ((KEY_HEIGHT + 2) * 4) -#define CAPS_WIDTH (KEY_WIDTH * 3 / 2) -#define DEL_WIDTH (KEY_WIDTH * 3 / 2 + 1) -#define ESC_WIDTH (KEY_WIDTH * 2 + 2) -#define SWITCH_WIDTH (KEY_WIDTH * 3 / 2 ) -#define SPACE_WIDTH (KEY_WIDTH * 3 + 2 * 2) -#define DOT_WIDTH (KEY_WIDTH * 3 / 2 + 3) -#define ENTER_WIDTH (KEY_WIDTH * 2 + 2) -#define POS_X(c) ((KEY_WIDTH * c) + (c + 1) * 2) -#define POS_Y(r) ((KEY_HEIGHT * r) + (r + 1) * 2) -#define KEYBORAD_CLICK 0x5014 -#define ON_KEYBORAD_UPDATE(func) \ -{MSG_TYPE_WND, KEYBORAD_CLICK, 0, msgCallback(&func)}, -typedef enum -{ - STATUS_UPPERCASE, - STATUS_LOWERCASE -}KEYBOARD_STATUS; -typedef enum -{ - STYLE_ALL_BOARD, - STYLE_NUM_BOARD -}KEYBOARD_STYLE; -typedef enum -{ - CLICK_CHAR, - CLICK_ENTER, - CLICK_ESC -}CLICK_STATUS; -extern WND_TREE g_key_board_children[]; -extern WND_TREE g_number_board_children[]; -class c_keyboard: public c_wnd -{ -public: - virtual int connect(c_wnd *user, unsigned short resource_id, KEYBOARD_STYLE style) - { - c_rect user_rect; - user->get_wnd_rect(user_rect); - if (style == STYLE_ALL_BOARD) - {//Place keyboard at the bottom of user's parent window. - c_rect user_parent_rect; - user->get_parent()->get_wnd_rect(user_parent_rect); - return c_wnd::connect(user, resource_id, 0, (0 - user_rect.m_left), (user_parent_rect.height() - user_rect.m_top - KEYBOARD_HEIGHT - 1), KEYBOARD_WIDTH, KEYBOARD_HEIGHT, g_key_board_children); - } - else if (style == STYLE_NUM_BOARD) - {//Place keyboard below the user window. - return c_wnd::connect(user, resource_id, 0, 0, user_rect.height(), NUM_BOARD_WIDTH, NUM_BOARD_HEIGHT, g_number_board_children); - } - else - { - ASSERT(false); - } - return -1; - } - virtual void on_init_children() - { - c_wnd* child = m_top_child; - if (0 != child) - { - while (child) - { - ((c_button*)child)->set_on_click(WND_CALLBACK(&c_keyboard::on_key_clicked)); - child = child->get_next_sibling(); - } - } - } - KEYBOARD_STATUS get_cap_status(){return m_cap_status;} - char* get_str() { return m_str; } - void set_on_click(WND_CALLBACK on_click) { this->on_click = on_click; } -protected: - virtual void pre_create_wnd() - { - m_attr = (WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS); - m_cap_status = STATUS_UPPERCASE; - memset(m_str, 0, sizeof(m_str)); - m_str_len = 0; - } - virtual void on_paint() - { - c_rect rect; - get_screen_rect(rect); - m_surface->fill_rect(rect, GL_RGB(0, 0, 0), m_z_order); - } - void on_key_clicked(int id, int param) - { - switch (id) - { - case 0x14: - on_caps_clicked(id, param); - break; - case '\n': - on_enter_clicked(id, param); - break; - case 0x1B: - on_esc_clicked(id, param); - break; - case 0x7F: - on_del_clicked(id, param); - break; - default: - on_char_clicked(id, param); - break; - } - } - void on_char_clicked(int id, int param) - {//id = char ascii code. - if (m_str_len >= sizeof(m_str)) - { - return; - } - if ((id >= '0' && id <= '9') || id == ' ' || id == '.') - { - goto InputChar; - } - if (id >= 'A' && id <= 'Z') - { - if (STATUS_LOWERCASE == m_cap_status) - { - id += 0x20; - } - goto InputChar; - } - ASSERT(false); - InputChar: - m_str[m_str_len++] = id; - (m_parent->*(on_click))(m_id, CLICK_CHAR); - } - void on_del_clicked(int id, int param) - { - if (m_str_len <= 0) - { - return; - } - m_str[--m_str_len] = 0; - (m_parent->*(on_click))(m_id, CLICK_CHAR); - } - void on_caps_clicked(int id, int param) - { - m_cap_status = (m_cap_status == STATUS_LOWERCASE) ? STATUS_UPPERCASE : STATUS_LOWERCASE; - show_window(); - } - void on_enter_clicked(int id, int param) - { - memset(m_str, 0, sizeof(m_str)); - (m_parent->*(on_click))(m_id, CLICK_ENTER); - } - void on_esc_clicked(int id, int param) - { - memset(m_str, 0, sizeof(m_str)); - (m_parent->*(on_click))(m_id, CLICK_ESC); - } -private: - char m_str[32]; - int m_str_len; - KEYBOARD_STATUS m_cap_status; - WND_CALLBACK on_click; -}; -class c_keyboard_button : public c_button -{ -protected: - virtual void on_paint() - { - c_rect rect; - get_screen_rect(rect); - switch (m_status) - { - case STATUS_NORMAL: - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_NORMAL), m_z_order); - break; - case STATUS_FOCUSED: - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_FOCUS), m_z_order); - break; - case STATUS_PUSHED: - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_PUSHED), m_z_order); - m_surface->draw_rect(rect, c_theme::get_color(COLOR_WND_BORDER), 2, m_z_order); - break; - default: - ASSERT(false); - break; - } - if (m_id == 0x14) - { - return c_word::draw_string_in_rect(m_surface, m_z_order, "Caps", rect, m_font, m_font_color, GL_ARGB(0, 0, 0, 0), m_attr); - } - else if (m_id == 0x1B) - { - return c_word::draw_string_in_rect(m_surface, m_z_order, "Esc", rect, m_font, m_font_color, GL_ARGB(0, 0, 0, 0), m_attr); - } - else if (m_id == ' ') - { - return c_word::draw_string_in_rect(m_surface, m_z_order, "Space", rect, m_font, m_font_color, GL_ARGB(0, 0, 0, 0), m_attr); - } - else if (m_id == '\n') - { - return c_word::draw_string_in_rect(m_surface, m_z_order, "Enter", rect, m_font, m_font_color, GL_ARGB(0, 0, 0, 0), m_attr); - } - else if (m_id == '.') - { - return c_word::draw_string_in_rect(m_surface, m_z_order, ".", rect, m_font, m_font_color, GL_ARGB(0, 0, 0, 0), m_attr); - } - else if (m_id == 0x7F) - { - return c_word::draw_string_in_rect(m_surface, m_z_order, "Back", rect, m_font, m_font_color, GL_ARGB(0, 0, 0, 0), m_attr); - } - else if (m_id == 0x90) - { - return c_word::draw_string_in_rect(m_surface, m_z_order, "?123", rect, m_font, m_font_color, GL_ARGB(0, 0, 0, 0), m_attr); - } - char letter[] = { 0, 0 }; - if (m_id >= 'A' && m_id <= 'Z') - { - letter[0] = (((c_keyboard*)m_parent)->get_cap_status() == STATUS_UPPERCASE) ? m_id : (m_id + 0x20); - } - else if (m_id >= '0' && m_id <= '9') - { - letter[0] = (char)m_id; - } - c_word::draw_string_in_rect(m_surface, m_z_order, letter, rect, m_font, m_font_color, GL_ARGB(0, 0, 0, 0), m_attr); - } -}; -#include -#define MAX_EDIT_STRLEN 32 -#define IDD_KEY_BOARD 0x1 -class c_edit : public c_wnd -{ - friend class c_keyboard; -public: - const char* get_text(){return m_str;} - void set_text(const char* str) - { - if (str != 0 && strlen(str) < sizeof(m_str)) - { - strcpy(m_str, str); - } - } - void set_keyboard_style(KEYBOARD_STYLE kb_sytle) { m_kb_style = kb_sytle; } - -protected: - virtual void pre_create_wnd() - { - m_attr = (WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS); - m_kb_style = STYLE_ALL_BOARD; - m_font = c_theme::get_font(FONT_DEFAULT); - m_font_color = c_theme::get_color(COLOR_WND_FONT); - memset(m_str_input, 0, sizeof(m_str_input)); - memset(m_str, 0, sizeof(m_str)); - set_text(c_wnd::m_str); - } - virtual void on_paint() - { - c_rect rect, kb_rect; - get_screen_rect(rect); - s_keyboard.get_screen_rect(kb_rect); - switch (m_status) - { - case STATUS_NORMAL: - if (m_z_order > m_parent->get_z_order()) - { - s_keyboard.disconnect(); - m_z_order = m_parent->get_z_order(); - m_surface->show_layer(kb_rect, m_z_order); - m_attr = (WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS); - } - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_NORMAL), m_z_order); - c_word::draw_string_in_rect(m_surface, m_parent->get_z_order(), m_str, rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_NORMAL), ALIGN_HCENTER | ALIGN_VCENTER); - break; - case STATUS_FOCUSED: - if (m_z_order > m_parent->get_z_order()) - { - s_keyboard.disconnect(); - m_z_order = m_parent->get_z_order(); - m_surface->show_layer(kb_rect, m_z_order); - m_attr = (WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS); - } - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_FOCUS), m_z_order); - c_word::draw_string_in_rect(m_surface, m_parent->get_z_order(), m_str, rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_FOCUS), ALIGN_HCENTER | ALIGN_VCENTER); - break; - case STATUS_PUSHED: - if (m_z_order == m_parent->get_z_order()) - { - m_z_order++; - m_attr = (WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS | ATTR_PRIORITY); - show_keyboard(); - } - m_surface->fill_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, c_theme::get_color(COLOR_WND_PUSHED), m_parent->get_z_order()); - m_surface->draw_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, c_theme::get_color(COLOR_WND_BORDER), m_parent->get_z_order(), 2); - strlen(m_str_input) ? c_word::draw_string_in_rect(m_surface, m_parent->get_z_order(), m_str_input, rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_PUSHED), ALIGN_HCENTER | ALIGN_VCENTER) : - c_word::draw_string_in_rect(m_surface, m_parent->get_z_order(), m_str, rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_PUSHED), ALIGN_HCENTER | ALIGN_VCENTER); - break; - default: - ASSERT(false); - } - } - virtual void on_focus() - { - m_status = STATUS_FOCUSED; - on_paint(); - } - virtual void on_kill_focus() - { - m_status = STATUS_NORMAL; - on_paint(); - } - virtual void on_navigate(NAVIGATION_KEY key) - { - switch (key) - { - case NAV_ENTER: - (m_status == STATUS_PUSHED) ? s_keyboard.on_navigate(key) : (on_touch(m_wnd_rect.m_left, m_wnd_rect.m_top, TOUCH_DOWN), on_touch(m_wnd_rect.m_left, m_wnd_rect.m_top, TOUCH_UP)); - return; - case NAV_BACKWARD: - case NAV_FORWARD: - return (m_status == STATUS_PUSHED) ? s_keyboard.on_navigate(key) : c_wnd::on_navigate(key); - } - } - virtual void on_touch(int x, int y, TOUCH_ACTION action) - { - (action == TOUCH_DOWN) ? on_touch_down(x, y) : on_touch_up(x, y); - } - void on_key_board_click(int id, int param) - { - switch (param) - { - case CLICK_CHAR: - strcpy(m_str_input, s_keyboard.get_str()); - on_paint(); - break; - case CLICK_ENTER: - if (strlen(m_str_input)) - { - memcpy(m_str, m_str_input, sizeof(m_str_input)); - } - m_status = STATUS_FOCUSED; - on_paint(); - break; - case CLICK_ESC: - memset(m_str_input, 0, sizeof(m_str_input)); - m_status = STATUS_FOCUSED; - on_paint(); - break; - default: - ASSERT(false); - break; - } - } -private: - void show_keyboard() - { - s_keyboard.connect(this, IDD_KEY_BOARD, m_kb_style); - s_keyboard.set_on_click(WND_CALLBACK(&c_edit::on_key_board_click)); - s_keyboard.show_window(); - } - void on_touch_down(int x, int y) - { - c_rect kb_rect_relate_2_edit_parent; - s_keyboard.get_wnd_rect(kb_rect_relate_2_edit_parent); - kb_rect_relate_2_edit_parent.m_left += m_wnd_rect.m_left; - kb_rect_relate_2_edit_parent.m_right += m_wnd_rect.m_left; - kb_rect_relate_2_edit_parent.m_top += m_wnd_rect.m_top; - kb_rect_relate_2_edit_parent.m_bottom += m_wnd_rect.m_top; - if (m_wnd_rect.pt_in_rect(x, y)) - {//click edit box - if (STATUS_NORMAL == m_status) - { - m_parent->set_child_focus(this); - } - } - else if (kb_rect_relate_2_edit_parent.pt_in_rect(x, y)) - {//click key board - c_wnd::on_touch(x, y, TOUCH_DOWN); - } - else - { - if (STATUS_PUSHED == m_status) - { - m_status = STATUS_FOCUSED; - on_paint(); - } - } - } - void on_touch_up(int x, int y) - { - if (STATUS_FOCUSED == m_status) - { - m_status = STATUS_PUSHED; - on_paint(); - } - else if (STATUS_PUSHED == m_status) - { - if (m_wnd_rect.pt_in_rect(x, y)) - {//click edit box - m_status = STATUS_FOCUSED; - on_paint(); - } - else - { - c_wnd::on_touch(x, y, TOUCH_UP); - } - } - } - static c_keyboard s_keyboard; - KEYBOARD_STYLE m_kb_style; - char m_str_input[MAX_EDIT_STRLEN]; - char m_str[MAX_EDIT_STRLEN]; -}; -class c_label : public c_wnd -{ -public: - virtual void on_paint() - { - c_rect rect; - unsigned int bg_color = m_bg_color ? m_bg_color : m_parent->get_bg_color(); - get_screen_rect(rect); - if (m_str) - { - m_surface->fill_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, bg_color, m_z_order); - c_word::draw_string_in_rect(m_surface, m_z_order, m_str, rect, m_font, m_font_color, bg_color, ALIGN_LEFT | ALIGN_VCENTER); - } - } -protected: - virtual void pre_create_wnd() - { - m_attr = ATTR_VISIBLE; - m_font_color = c_theme::get_color(COLOR_WND_FONT); - m_font = c_theme::get_font(FONT_DEFAULT); - } -}; -#include -#define MAX_ITEM_NUM 4 -#define ITEM_HEIGHT 45 -class c_list_box : public c_wnd -{ -public: - void set_on_change(WND_CALLBACK on_change) { this->on_change = on_change; } - short get_item_count() { return m_item_total; } - int add_item(char* str) - { - if (m_item_total >= MAX_ITEM_NUM) - { - ASSERT(false); - return -1; - } - m_item_array[m_item_total++] = str; - update_list_size(); - return 0; - } - void clear_item() - { - m_selected_item = m_item_total = 0; - memset(m_item_array, 0, sizeof(m_item_array)); - update_list_size(); - } - void select_item(short index) - { - if (index < 0 || index >= m_item_total) - { - ASSERT(false); - } - m_selected_item = index; - } - -protected: - virtual void pre_create_wnd() - { - m_attr = (WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS); - memset(m_item_array, 0, sizeof(m_item_array)); - m_item_total = 0; - m_selected_item = 0; - m_font = c_theme::get_font(FONT_DEFAULT); - m_font_color = c_theme::get_color(COLOR_WND_FONT); - } - virtual void on_paint() - { - c_rect rect; - get_screen_rect(rect); - switch (m_status) - { - case STATUS_NORMAL: - if (m_z_order > m_parent->get_z_order()) - { - m_z_order = m_parent->get_z_order(); - m_surface->show_layer(m_list_screen_rect, m_z_order); - m_attr = (WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS); - } - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_NORMAL), m_z_order); - c_word::draw_string_in_rect(m_surface, m_z_order, m_item_array[m_selected_item], rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_NORMAL), ALIGN_HCENTER | ALIGN_VCENTER); - break; - case STATUS_FOCUSED: - if (m_z_order > m_parent->get_z_order()) - { - m_z_order = m_parent->get_z_order(); - m_surface->show_layer(m_list_screen_rect, m_z_order); - m_attr = (WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS); - } - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_FOCUS), m_z_order); - c_word::draw_string_in_rect(m_surface, m_z_order, m_item_array[m_selected_item], rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_FOCUS), ALIGN_HCENTER | ALIGN_VCENTER); - break; - case STATUS_PUSHED: - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_PUSHED), m_z_order); - m_surface->draw_rect(rect, c_theme::get_color(COLOR_WND_BORDER), 2, m_z_order); - c_word::draw_string_in_rect(m_surface, m_z_order, m_item_array[m_selected_item], rect, m_font, GL_RGB(2, 124, 165), GL_ARGB(0, 0, 0, 0), ALIGN_HCENTER | ALIGN_VCENTER); - //draw list - if (m_item_total > 0) - { - if (m_z_order == m_parent->get_z_order()) - { - m_z_order++; - } - m_attr = (WND_ATTRIBUTION)(ATTR_VISIBLE | ATTR_FOCUS | ATTR_PRIORITY); - show_list(); - } - break; - default: - ASSERT(false); - } - } - virtual void on_focus() - { - m_status = STATUS_FOCUSED; - on_paint(); - } - virtual void on_kill_focus() - { - m_status = STATUS_NORMAL; - on_paint(); - } - virtual void on_navigate(NAVIGATION_KEY key) - { - switch (key) - { - case NAV_ENTER: - on_touch(m_wnd_rect.m_left, m_wnd_rect.m_top, TOUCH_DOWN); - on_touch(m_wnd_rect.m_left, m_wnd_rect.m_top, TOUCH_UP); - return; - case NAV_BACKWARD: - if (m_status != STATUS_PUSHED) - { - return c_wnd::on_navigate(key); - } - m_selected_item = (m_selected_item > 0) ? (m_selected_item - 1) : m_selected_item; - return show_list(); - case NAV_FORWARD: - if (m_status != STATUS_PUSHED) - { - return c_wnd::on_navigate(key); - } - m_selected_item = (m_selected_item < (m_item_total - 1)) ? (m_selected_item + 1) : m_selected_item; - return show_list(); - } - } - virtual void on_touch(int x, int y, TOUCH_ACTION action) - { - (action == TOUCH_DOWN) ? on_touch_down(x, y) : on_touch_up(x, y); - } - -private: - void update_list_size() - { - m_list_wnd_rect = m_wnd_rect; - m_list_wnd_rect.m_top = m_wnd_rect.m_bottom + 1; - m_list_wnd_rect.m_bottom = m_list_wnd_rect.m_top + m_item_total * ITEM_HEIGHT; - get_screen_rect(m_list_screen_rect); - m_list_screen_rect.m_top = m_list_screen_rect.m_bottom + 1; - m_list_screen_rect.m_bottom = m_list_screen_rect.m_top + m_item_total * ITEM_HEIGHT; - } - void show_list() - { - //draw all items - c_rect tmp_rect; - for (int i = 0; i < m_item_total; i++) - { - tmp_rect.m_left = m_list_screen_rect.m_left; - tmp_rect.m_right = m_list_screen_rect.m_right; - tmp_rect.m_top = m_list_screen_rect.m_top + i * ITEM_HEIGHT; - tmp_rect.m_bottom = tmp_rect.m_top + ITEM_HEIGHT; - if (m_selected_item == i) - { - m_surface->fill_rect(tmp_rect, c_theme::get_color(COLOR_WND_FOCUS), m_z_order); - c_word::draw_string_in_rect(m_surface, m_z_order, m_item_array[i], tmp_rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_FOCUS), ALIGN_HCENTER | ALIGN_VCENTER); - } - else - { - m_surface->fill_rect(tmp_rect, GL_RGB(17, 17, 17), m_z_order); - c_word::draw_string_in_rect(m_surface, m_z_order, m_item_array[i], tmp_rect, m_font, m_font_color, GL_RGB(17, 17, 17), ALIGN_HCENTER | ALIGN_VCENTER); - } - } - } - void on_touch_down(int x, int y) - { - if (m_wnd_rect.pt_in_rect(x, y)) - {//click base - if (STATUS_NORMAL == m_status) - { - m_parent->set_child_focus(this); - } - } - else if (m_list_wnd_rect.pt_in_rect(x, y)) - {//click extend list - c_wnd::on_touch(x, y, TOUCH_DOWN); - } - else - { - if (STATUS_PUSHED == m_status) - { - m_status = STATUS_FOCUSED; - on_paint(); - if(on_change) - { - (m_parent->*(on_change))(m_id, m_selected_item); - } - } - } - } - void on_touch_up(int x, int y) - { - if (STATUS_FOCUSED == m_status) - { - m_status = STATUS_PUSHED; - on_paint(); - } - else if (STATUS_PUSHED == m_status) - { - if (m_wnd_rect.pt_in_rect(x, y)) - {//click base - m_status = STATUS_FOCUSED; - on_paint(); - } - else if (m_list_wnd_rect.pt_in_rect(x, y)) - {//click extend list - m_status = STATUS_FOCUSED; - select_item((y - m_list_wnd_rect.m_top) / ITEM_HEIGHT); - on_paint(); - if(on_change) - { - (m_parent->*(on_change))(m_id, m_selected_item); - } - } - else - { - c_wnd::on_touch(x, y, TOUCH_UP); - } - } - } - short m_selected_item; - short m_item_total; - char* m_item_array[MAX_ITEM_NUM]; - c_rect m_list_wnd_rect; //rect relative to parent wnd. - c_rect m_list_screen_rect; //rect relative to physical screen(frame buffer) - WND_CALLBACK on_change; -}; -#include -#define MAX_PAGES 5 -class c_gesture; -class c_slide_group : public c_wnd { -public: - inline c_slide_group(); - int set_active_slide(int index, bool is_redraw = true) - { - if (index >= MAX_PAGES || index < 0) - { - return -1; - } - if (0 == m_slides[index]) - { - return -2; - } - m_active_slide_index = index; - for (int i = 0; i < MAX_PAGES; i++) - { - if (m_slides[i] == 0) - { - continue; - } - if (i == index) - { - m_slides[i]->get_surface()->set_active(true); - add_child_2_tail(m_slides[i]); - if (is_redraw) - { - c_rect rc; - get_screen_rect(rc); - m_slides[i]->get_surface()->flush_screen(rc.m_left, rc.m_top, rc.m_right, rc.m_bottom); - } - } - else - { - m_slides[i]->get_surface()->set_active(false); - } - } - return 0; - } - c_wnd* get_slide(int index){return m_slides[index];} - c_wnd* get_active_slide(){return m_slides[m_active_slide_index];} - int get_active_slide_index(){return m_active_slide_index;} - int add_slide(c_wnd* slide, unsigned short resource_id, short x, short y, short width, short height, WND_TREE* p_child_tree = 0, Z_ORDER_LEVEL max_zorder = Z_ORDER_LEVEL_0) - { - if (0 == slide) - { - return -1; - } - c_surface* old_surface = get_surface(); - c_surface* new_surface = old_surface->get_display()->alloc_surface(max_zorder); - new_surface->set_active(false); - set_surface(new_surface); - slide->connect(this, resource_id, 0, x, y, width, height, p_child_tree); - set_surface(old_surface); - int i = 0; - while (i < MAX_PAGES) - { - if (m_slides[i] == slide) - {//slide has lived - ASSERT(false); - return -2; - } - i++; - } - //new slide - i = 0; - while (i < MAX_PAGES) - { - if (m_slides[i] == 0) - { - m_slides[i] = slide; - slide->show_window(); - return 0; - } - i++; - } - //no more slide can be add - ASSERT(false); - return -3; - } - void disabel_all_slide() - { - for (int i = 0; i < MAX_PAGES; i++) - { - if (m_slides[i]) - { - m_slides[i]->get_surface()->set_active(false); - } - } - } - inline virtual void on_touch(int x, int y, TOUCH_ACTION action); - virtual void on_navigate(NAVIGATION_KEY key) - { - if (m_slides[m_active_slide_index]) - { - m_slides[m_active_slide_index]->on_navigate(key); - } - } -protected: - c_wnd* m_slides[MAX_PAGES]; - int m_active_slide_index; - c_gesture* m_gesture; -}; -//#define SWIPE_STEP 300//for arm -#define SWIPE_STEP 10//for PC & ANDROID -#define MOVE_THRESHOLD 10 -typedef enum { - TOUCH_MOVE, - TOUCH_IDLE -}TOUCH_STATE; -class c_slide_group; -class c_gesture { -public: - c_gesture(c_slide_group* group) - { - m_slide_group = group; - m_state = TOUCH_IDLE; - m_down_x = m_down_y = m_move_x = m_move_y = 0; - } - bool handle_swipe(int x, int y, TOUCH_ACTION action) - { - if (action == TOUCH_DOWN)//MOUSE_LBUTTONDOWN - { - if (m_state == TOUCH_IDLE) - { - m_state = TOUCH_MOVE; - m_move_x = m_down_x = x; - return true; - } - else//TOUCH_MOVE - { - return on_move(x); - } - } - else if (action == TOUCH_UP)//MOUSE_LBUTTONUP - { - if (m_state == TOUCH_MOVE) - { - m_state = TOUCH_IDLE; - return on_swipe(x); - } - else - { - return false; - //ASSERT(false); - } - } - return true; - } -private: - bool on_move(int x) - { - if (m_slide_group == 0) - { - return true; - } - if (abs(x - m_move_x) < MOVE_THRESHOLD) - { - return false; - } - m_slide_group->disabel_all_slide(); - m_move_x = x; - if ((m_move_x - m_down_x) > 0) - { - move_right(); - } - else - { - move_left(); - } - return false; - } - bool on_swipe(int x) - { - if (m_slide_group == 0) - { - return true; - } - if ((m_down_x == m_move_x) && (abs(x - m_down_x) < MOVE_THRESHOLD)) - { - return true; - } - m_slide_group->disabel_all_slide(); - int page = -1; - m_move_x = x; - if ((m_move_x - m_down_x) > 0) - { - page = swipe_right(); - } - else - { - page = swipe_left(); - } - if (page >= 0) - { - m_slide_group->set_active_slide(page); - } - else - { - m_slide_group->set_active_slide(m_slide_group->get_active_slide_index(), false); - } - return false; - } - int swipe_left() - { - if (m_slide_group == 0) - { - return -1; - } - int index = m_slide_group->get_active_slide_index(); - if ((index + 1) >= MAX_PAGES || - m_slide_group->get_slide(index + 1) == 0 || - m_slide_group->get_slide(index) == 0) - { - return -2; - } - c_surface* s1 = m_slide_group->get_slide(index + 1)->get_surface(); - c_surface * s2 = m_slide_group->get_slide(index)->get_surface(); - if (s1->get_display() != s2->get_display()) - { - return -3; - } - int step = m_down_x - m_move_x; - c_rect rc; - m_slide_group->get_screen_rect(rc); - while (step < rc.width()) - { - s1->get_display()->swipe_surface(s2, s1, rc.m_left, rc.m_right, rc.m_top, rc.m_bottom, step); - step += SWIPE_STEP; - } - if (step != rc.width()) - { - s1->get_display()->swipe_surface(s2, s1, rc.m_left, rc.m_right, rc.m_top, rc.m_bottom, rc.width()); - } - return (index + 1); - } - int swipe_right() - { - if (m_slide_group == 0) - { - return -1; - } - int index = m_slide_group->get_active_slide_index(); - if (index <= 0 || - m_slide_group->get_slide(index - 1) == 0 || - m_slide_group->get_slide(index) == 0) - { - return -2; - } - c_surface* s1 = m_slide_group->get_slide(index - 1)->get_surface(); - c_surface * s2 = m_slide_group->get_slide(index)->get_surface(); - if (s1->get_display() != s2->get_display()) - { - return -3; - } - c_rect rc; - m_slide_group->get_screen_rect(rc); - int step = rc.width() - (m_move_x - m_down_x); - while (step > 0) - { - s1->get_display()->swipe_surface(s1, s2, rc.m_left, rc.m_right, rc.m_top, rc.m_bottom, step); - step -= SWIPE_STEP; - } - if (step != 0) - { - s1->get_display()->swipe_surface(s1, s2, rc.m_left, rc.m_right, rc.m_top, rc.m_bottom, 0); - } - return (index - 1); - } - void move_left() - { - int index = m_slide_group->get_active_slide_index(); - if ((index + 1) >= MAX_PAGES || - m_slide_group->get_slide(index + 1) == 0 || - m_slide_group->get_slide(index) == 0) - { - return; - } - c_surface* s1 = m_slide_group->get_slide(index + 1)->get_surface(); - c_surface * s2 = m_slide_group->get_slide(index)->get_surface(); - c_rect rc; - m_slide_group->get_screen_rect(rc); - if (s1->get_display() == s2->get_display()) - { - s1->get_display()->swipe_surface(s2, s1, rc.m_left, rc.m_right, rc.m_top, rc.m_bottom, (m_down_x - m_move_x)); - } - } - void move_right() - { - int index = m_slide_group->get_active_slide_index(); - if (index <= 0 || - m_slide_group->get_slide(index - 1) == 0 || - m_slide_group->get_slide(index) == 0) - { - return; - } - c_surface* s1 = m_slide_group->get_slide(index - 1)->get_surface(); - c_surface * s2 = m_slide_group->get_slide(index)->get_surface(); - c_rect rc; - m_slide_group->get_screen_rect(rc); - if (s1->get_display() == s2->get_display()) - { - s1->get_display()->swipe_surface(s1, s2, rc.m_left, rc.m_right, rc.m_top, rc.m_bottom, (rc.width() - (m_move_x - m_down_x))); - } - } - int m_down_x; - int m_down_y; - int m_move_x; - int m_move_y; - TOUCH_STATE m_state; - c_slide_group* m_slide_group; -}; -inline c_slide_group::c_slide_group() -{ - m_gesture = new c_gesture(this); - for (int i = 0; i < MAX_PAGES; i++) - { - m_slides[i] = 0; - } - m_active_slide_index = 0; -} -inline void c_slide_group::on_touch(int x, int y, TOUCH_ACTION action) -{ - x -= m_wnd_rect.m_left; - y -= m_wnd_rect.m_top; - if (m_gesture->handle_swipe(x, y, action)) - { - if (m_slides[m_active_slide_index]) - { - m_slides[m_active_slide_index]->on_touch(x, y, action); - } - } -} -#define ID_BT_ARROW_UP 0x1111 -#define ID_BT_ARROW_DOWN 0x2222 -class c_spin_box; -class c_spin_button : public c_button -{ - friend class c_spin_box; - inline virtual void on_touch(int x, int y, TOUCH_ACTION action); - c_spin_box* m_spin_box; -}; -class c_spin_box : public c_wnd -{ - friend class c_spin_button; -public: - short get_value() { return m_value; } - void set_value(unsigned short value) { m_value = m_cur_value = value; } - void set_max_min(short max, short min) { m_max = max; m_min = min; } - void set_step(short step) { m_step = step; } - short get_min() { return m_min; } - short get_max() { return m_max; } - short get_step() { return m_step; } - void set_value_digit(short digit) { m_digit = digit; } - short get_value_digit() { return m_digit; } - void set_on_change(WND_CALLBACK on_change) { this->on_change = on_change; } -protected: - virtual void on_paint() - { - c_rect rect; - get_screen_rect(rect); - rect.m_right = rect.m_left + (rect.width() * 2 / 3); - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_NORMAL), m_z_order); - c_word::draw_value_in_rect(m_surface, m_parent->get_z_order(), m_cur_value, m_digit, rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_NORMAL), ALIGN_HCENTER | ALIGN_VCENTER); - } - virtual void pre_create_wnd() - { - m_attr = (WND_ATTRIBUTION)(ATTR_VISIBLE); - m_font = c_theme::get_font(FONT_DEFAULT); - m_font_color = c_theme::get_color(COLOR_WND_FONT); - m_max = 6; - m_min = 1; - m_digit = 0; - m_step = 1; - //link arrow button position. - c_rect rect; - get_wnd_rect(rect); - m_bt_down.m_spin_box = m_bt_up.m_spin_box = this; - m_bt_up.connect(m_parent, ID_BT_ARROW_UP, "+", (rect.m_left + rect.width() * 2 / 3), rect.m_top, (rect.width() / 3), (rect.height() / 2)); - m_bt_down.connect(m_parent, ID_BT_ARROW_DOWN, "-", (rect.m_left + rect.width() * 2 / 3), (rect.m_top + rect.height() / 2), (rect.width() / 3), (rect.height() / 2)); - } - void on_arrow_up_bt_click() - { - if (m_cur_value + m_step > m_max) - { - return; - } - m_cur_value += m_step; - if(on_change) - { - (m_parent->*(on_change))(m_id, m_cur_value); - } - on_paint(); - } - void on_arrow_down_bt_click() - { - if (m_cur_value - m_step < m_min) - { - return; - } - m_cur_value -= m_step; - if(on_change) - { - (m_parent->*(on_change))(m_id, m_cur_value); - } - on_paint(); - } - short m_cur_value; - short m_value; - short m_step; - short m_max; - short m_min; - short m_digit; - c_spin_button m_bt_up; - c_spin_button m_bt_down; - WND_CALLBACK on_change; -}; -inline void c_spin_button::on_touch(int x, int y, TOUCH_ACTION action) -{ - if (action == TOUCH_UP) - { - (m_id == ID_BT_ARROW_UP) ? m_spin_box->on_arrow_up_bt_click() : m_spin_box->on_arrow_down_bt_click(); - } - c_button::on_touch(x, y, action); -} -#define MAX_COL_NUM 30 -#define MAX_ROW_NUM 30 -class c_table: public c_wnd -{ -public: - void set_sheet_align(unsigned int align_type){ m_align_type = align_type;} - void set_row_num(unsigned int row_num){ m_row_num = row_num;} - void set_col_num(unsigned int col_num){ m_col_num = col_num;} - void set_row_height(unsigned int height) - { - for (unsigned int i = 0; i < m_row_num; i++) - { - m_row_height[i] = height; - } - } - void set_col_width(unsigned int width) - { - for (unsigned int i = 0; i < m_col_num; i++) - { - m_col_width[i] = width; - } - } - int set_row_height(unsigned int index, unsigned int height) - { - if (m_row_num > index) - { - m_row_height[index] = height; - return index; - } - return -1; - } - int set_col_width(unsigned int index, unsigned int width) - { - if (m_col_num > index) - { - m_col_width[index] = width; - return index; - } - return -1; - } - void set_item(int row, int col, char* str, unsigned int color) - { - draw_item(row, col, str, color); - } - unsigned int get_row_num(){ return m_row_num;} - unsigned int get_col_num(){ return m_col_num;} - c_rect get_item_rect(int row, int col) - { - static c_rect rect; - if (row >= MAX_ROW_NUM || col >= MAX_COL_NUM) - { - return rect; - } - unsigned int width = 0; - unsigned int height = 0; - for (int i = 0; i < col; i++) - { - width += m_col_width[i]; - } - for (int j = 0; j < row; j++) - { - height += m_row_height[j]; - } - c_rect wRect; - get_screen_rect(wRect); - rect.m_left = wRect.m_left + width; - rect.m_right = rect.m_left + m_col_width[col]; - if (rect.m_right > wRect.m_right) - { - rect.m_right = wRect.m_right; - } - rect.m_top = wRect.m_top + height; - rect.m_bottom = rect.m_top + m_row_height[row]; - if (rect.m_bottom > wRect.m_bottom) - { - rect.m_bottom = wRect.m_bottom; - } - return rect; - } -protected: - virtual void pre_create_wnd() - { - m_attr = (WND_ATTRIBUTION)(ATTR_VISIBLE); - m_font = c_theme::get_font(FONT_DEFAULT); - m_font_color = c_theme::get_color(COLOR_WND_FONT); - } - void draw_item(int row, int col, const char* str, unsigned int color) - { - c_rect rect = get_item_rect(row, col); - m_surface->fill_rect(rect.m_left + 1, rect.m_top + 1, rect.m_right - 1, rect.m_bottom - 1, color, m_z_order); - c_word::draw_string_in_rect(m_surface, m_z_order, str, rect, m_font, m_font_color, GL_ARGB(0, 0, 0, 0), m_align_type); - } - unsigned int m_align_type; - unsigned int m_row_num; - unsigned int m_col_num; - unsigned int m_row_height[MAX_ROW_NUM]; - unsigned int m_col_width[MAX_COL_NUM]; -}; -#include -#include -#define WAVE_BUFFER_LEN 1024 -#define WAVE_READ_CACHE_LEN 8 -#define BUFFER_EMPTY -1111 -#define BUFFER_FULL -2222; -class c_wave_buffer -{ -public: - c_wave_buffer() - { - m_head = m_tail = m_min_old = m_max_old = - m_min_older = m_max_older = m_last_data = m_read_cache_sum = m_refresh_sequence = 0; - memset(m_wave_buf, 0, sizeof(m_wave_buf)); - memset(m_read_cache_min, 0, sizeof(m_read_cache_min)); - memset(m_read_cache_mid, 0, sizeof(m_read_cache_mid)); - memset(m_read_cache_max, 0, sizeof(m_read_cache_max)); - } - int write_wave_data(short data) - { - if ((m_tail + 1) % WAVE_BUFFER_LEN == m_head) - {//full - //log_out("wave buf full\n"); - return BUFFER_FULL; - } - m_wave_buf[m_tail] = data; - m_tail = (m_tail + 1) % WAVE_BUFFER_LEN; - return 1; - } - int read_wave_data_by_frame(short &max, short &min, short frame_len, unsigned int sequence, short offset) - { - if (m_refresh_sequence != sequence) - { - m_refresh_sequence = sequence; - m_read_cache_sum = 0; - } - else if (offset < m_read_cache_sum)//(m_refresh_sequence == sequence && offset < m_fb_sum) - { - max = m_read_cache_max[offset]; - min = m_read_cache_min[offset]; - return m_read_cache_mid[offset]; - } - m_read_cache_sum++; - ASSERT(m_read_cache_sum <= WAVE_READ_CACHE_LEN); - int i, data; - int tmp_min = m_last_data; - int tmp_max = m_last_data; - int mid = (m_min_old + m_max_old) >> 1; - i = 0; - while (i++ < frame_len) - { - data = read_data(); - if (BUFFER_EMPTY == data) - { - break; - } - m_last_data = data; - if (data < tmp_min) { tmp_min = data; } - if (data > tmp_max) { tmp_max = data; } - } - min = m_read_cache_min[offset] = MIN(m_min_old, MIN(tmp_min, m_min_older)); - max = m_read_cache_max[offset] = MAX(m_max_old, MAX(tmp_max, m_max_older)); - m_min_older = m_min_old; - m_max_older = m_max_old; - m_min_old = tmp_min; - m_max_old = tmp_max; - return (m_read_cache_mid[offset] = mid); - } - void reset() - { - m_head = m_tail; - } - void clear_data() - { - m_head = m_tail = 0; - memset(m_wave_buf, 0, sizeof(m_wave_buf)); - } - short get_cnt() - { - return (m_tail >= m_head) ? (m_tail - m_head) : (m_tail - m_head + WAVE_BUFFER_LEN); - } -private: - int read_data() - { - if (m_head == m_tail) - {//empty - //log_out("wave buf empty\n"); - return BUFFER_EMPTY; - } - int ret = m_wave_buf[m_head]; - m_head = (m_head + 1) % WAVE_BUFFER_LEN; - return ret; - } - short m_wave_buf[WAVE_BUFFER_LEN]; - short m_head; - short m_tail; - int m_min_old; - int m_max_old; - int m_min_older; - int m_max_older; - int m_last_data; - short m_read_cache_min[WAVE_READ_CACHE_LEN]; - short m_read_cache_mid[WAVE_READ_CACHE_LEN]; - short m_read_cache_max[WAVE_READ_CACHE_LEN]; - short m_read_cache_sum; - unsigned int m_refresh_sequence; -}; -#include -#include -#define CORRECT(x, high_limit, low_limit) {\ - x = (x > high_limit) ? high_limit : x;\ - x = (x < low_limit) ? low_limit : x;\ -}while(0) -#define WAVE_CURSOR_WIDTH 8 -#define WAVE_LINE_WIDTH 1 -#define WAVE_MARGIN 5 -typedef enum -{ - FILL_MODE, - SCAN_MODE -}E_WAVE_DRAW_MODE; -class c_wave_buffer; -class c_wave_ctrl : public c_wnd -{ -public: - c_wave_ctrl() - { - m_wave = 0; - m_bg_fb = 0; - m_wave_name_font = m_wave_unit_font = 0; - m_wave_name = m_wave_unit = 0; - m_max_data = 500; - m_min_data = 0; - m_wave_speed = 1; - m_wave_data_rate = 0; - m_wave_refresh_rate = 1000; - m_frame_len_map_index = 0; - m_wave_name_color = m_wave_unit_color = m_wave_color = GL_RGB(255, 0, 0); - m_back_color = GL_RGB(0, 0, 0); - } - virtual void on_init_children()//should be pre_create - { - c_rect rect; - get_screen_rect(rect); - m_wave_left = rect.m_left + WAVE_MARGIN; - m_wave_right = rect.m_right - WAVE_MARGIN; - m_wave_top = rect.m_top + WAVE_MARGIN; - m_wave_bottom = rect.m_bottom - WAVE_MARGIN; - m_wave_cursor = m_wave_left; - m_bg_fb = (unsigned int*)calloc(rect.width() * rect.height(), 4); - } - virtual void on_paint() - { - c_rect rect; - get_screen_rect(rect); - m_surface->fill_rect(rect, m_back_color, m_z_order); - //show name - c_word::draw_string(m_surface, m_z_order, m_wave_name, m_wave_left + 10, rect.m_top, m_wave_name_font, m_wave_name_color, GL_ARGB(0, 0, 0, 0)); - //show unit - c_word::draw_string(m_surface, m_z_order, m_wave_unit, m_wave_left + 60, rect.m_top, m_wave_unit_font, m_wave_unit_color, GL_ARGB(0, 0, 0, 0)); - save_background(); - } - void set_wave_name(char* wave_name){ m_wave_name = wave_name;} - void set_wave_unit(char* wave_unit){ m_wave_unit = wave_unit;} - void set_wave_name_font(const LATTICE_FONT_INFO* wave_name_font_type){ m_wave_name_font = wave_name_font_type;} - void set_wave_unit_font(const LATTICE_FONT_INFO* wave_unit_font_type){ m_wave_unit_font = wave_unit_font_type;} - void set_wave_name_color(unsigned int wave_name_color){ m_wave_name_color = wave_name_color;} - void set_wave_unit_color(unsigned int wave_unit_color){ m_wave_unit_color = wave_unit_color;} - void set_wave_color(unsigned int color){ m_wave_color = color;} - void set_wave_in_out_rate(unsigned int data_rate, unsigned int refresh_rate) - { - m_wave_data_rate = data_rate; - m_wave_refresh_rate = refresh_rate; - int read_times_per_second = m_wave_speed * 1000 / m_wave_refresh_rate; - memset(m_frame_len_map, 0, sizeof(m_frame_len_map)); - for (unsigned int i = 1; i < sizeof(m_frame_len_map) + 1; i++) - { - m_frame_len_map[i - 1] = data_rate * i / read_times_per_second - data_rate * (i - 1) / read_times_per_second; - } - m_frame_len_map_index = 0; - } - void set_wave_speed(unsigned int speed) - { - m_wave_speed = speed; - set_wave_in_out_rate(m_wave_data_rate, m_wave_refresh_rate); - } - void set_max_min(short max_data, short min_data) - { - m_max_data = max_data; - m_min_data = min_data; - } - void set_wave(c_wave_buffer* wave){m_wave = wave;} - c_wave_buffer* get_wave(){return m_wave;} - void clear_data() - { - if (m_wave == 0) - { - ASSERT(false); - return; - } - m_wave->clear_data(); - } - bool is_data_enough() - { - if (m_wave == 0) - { - ASSERT(false); - return false; - } - return (m_wave->get_cnt() - m_frame_len_map[m_frame_len_map_index] * m_wave_speed); - } - void refresh_wave(unsigned char frame) - { - if (m_wave == 0) - { - ASSERT(false); - return; - } - short max, min, mid; - for (short offset = 0; offset < m_wave_speed; offset++) - { - //get wave value - mid = m_wave->read_wave_data_by_frame(max, min, - m_frame_len_map[m_frame_len_map_index++], - frame, offset); - m_frame_len_map_index %= sizeof(m_frame_len_map); - //map to wave ctrl - int y_min, y_max; - if (m_max_data == m_min_data) - { - ASSERT(false); - } - y_max = m_wave_bottom + WAVE_LINE_WIDTH - (m_wave_bottom - m_wave_top) * (min - m_min_data) / (m_max_data - m_min_data); - y_min = m_wave_bottom - WAVE_LINE_WIDTH - (m_wave_bottom - m_wave_top) * (max - m_min_data) / (m_max_data - m_min_data); - mid = m_wave_bottom - (m_wave_bottom - m_wave_top) * (mid - m_min_data) / (m_max_data - m_min_data); - CORRECT(y_min, m_wave_bottom, m_wave_top); - CORRECT(y_max, m_wave_bottom, m_wave_top); - CORRECT(mid, m_wave_bottom, m_wave_top); - if (m_wave_cursor > m_wave_right) - { - m_wave_cursor = m_wave_left; - } - draw_smooth_vline(y_min, y_max, mid, m_wave_color); - restore_background(); - m_wave_cursor++; - } - } - void clear_wave() - { - m_surface->fill_rect(m_wave_left, m_wave_top, m_wave_right, m_wave_bottom, m_back_color, m_z_order); - m_wave_cursor = m_wave_left; - } -protected: - void draw_smooth_vline(int y_min, int y_max, int mid, unsigned int rgb) - { - int dy = y_max - y_min; - short r = GL_RGB_R(rgb); - short g = GL_RGB_G(rgb); - short b = GL_RGB_B(rgb); - int index = (dy >> 1) + 2; - int y; - m_surface->draw_pixel(m_wave_cursor, mid, rgb, m_z_order); - if (dy < 1) - { - return; - } - unsigned char cur_r, cur_g, cur_b; - unsigned int cur_rgb; - for (int i = 1; i <= (dy >> 1) + 1; ++i) - { - if ((mid + i) <= y_max) - { - y = mid + i; - cur_r = r * (index - i) / index; - cur_g = g * (index - i) / index; - cur_b = b * (index - i) / index; - cur_rgb = GL_RGB(cur_r, cur_g, cur_b); - m_surface->draw_pixel(m_wave_cursor, y, cur_rgb, m_z_order); - } - if ((mid - i) >= y_min) - { - y = mid - i; - cur_r = r * (index - i) / index; - cur_g = g * (index - i) / index; - cur_b = b * (index - i) / index; - cur_rgb = GL_RGB(cur_r, cur_g, cur_b); - m_surface->draw_pixel(m_wave_cursor, y, cur_rgb, m_z_order); - } - } - } - void restore_background() - { - int x = m_wave_cursor + WAVE_CURSOR_WIDTH; - if (x > m_wave_right) - { - x -= (m_wave_right - m_wave_left + 1); - } - c_rect rect; - get_screen_rect(rect); - register int width = rect.width(); - register int top = rect.m_top; - register int left = rect.m_left; - for (int y_pos = (m_wave_top - 1); y_pos <= (m_wave_bottom + 1); y_pos++) - { - (m_bg_fb) ? m_surface->draw_pixel(x, y_pos, m_bg_fb[(y_pos - top) * width + (x - left)], m_z_order) : m_surface->draw_pixel(x, y_pos, 0, m_z_order); - } - } - void save_background() - { - if (!m_bg_fb) - { - return; - } - c_rect rect; - get_screen_rect(rect); - register unsigned int* p_des = m_bg_fb; - for (int y = rect.m_top; y <= rect.m_bottom; y++) - { - for (int x = rect.m_left; x <= rect.m_right; x++) - { - *p_des++ = m_surface->get_pixel(x, y, m_z_order); - } - } - } - char* m_wave_name; - char* m_wave_unit; - const LATTICE_FONT_INFO* m_wave_name_font; - const LATTICE_FONT_INFO* m_wave_unit_font; - unsigned int m_wave_name_color; - unsigned int m_wave_unit_color; - unsigned int m_wave_color; - unsigned int m_back_color; - int m_wave_left; - int m_wave_right; - int m_wave_top; - int m_wave_bottom; - short m_max_data; - short m_min_data; - -private: - c_wave_buffer* m_wave; - unsigned int* m_bg_fb; //background frame buffer, could be used to draw scale line. - int m_wave_cursor; - int m_wave_speed; //pixels per refresh - unsigned int m_wave_data_rate; //data sample rate - unsigned int m_wave_refresh_rate;//refresh cycle in millisecond - unsigned char m_frame_len_map[64]; - unsigned char m_frame_len_map_index; -}; -#ifdef GUILITE_ON -c_bitmap_operator the_bitmap_op = c_bitmap_operator(); -c_image_operator* c_image::image_operator = &the_bitmap_op; -#endif - -#ifdef GUILITE_ON - -const void* c_theme::s_font_map[FONT_MAX]; -const void* c_theme::s_image_map[IMAGE_MAX]; -unsigned int c_theme::s_color_map[COLOR_MAX]; - -#endif - -#ifdef GUILITE_ON - -c_lattice_font_op the_lattice_font_op = c_lattice_font_op(); -c_font_operator* c_word::fontOperator = &the_lattice_font_op; - -#endif -#ifdef GUILITE_ON -#if (defined __linux__) || (defined __APPLE__) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#define MAX_TIMER_CNT 10 -#define TIMER_UNIT 50//ms -static void(*do_assert)(const char* file, int line); -static void(*do_log_out)(const char* log); -void register_debug_function(void(*my_assert)(const char* file, int line), void(*my_log_out)(const char* log)) -{ - do_assert = my_assert; - do_log_out = my_log_out; -} -void _assert(const char* file, int line) -{ - if(do_assert) - { - do_assert(file, line); - } - else - { - printf("assert@ file:%s, line:%d, error no: %d\n", file, line, errno); - } -} -void log_out(const char* log) -{ - if (do_log_out) - { - do_log_out(log); - } - else - { - printf("%s", log); - fflush(stdout); - } -} -typedef struct _timer_manage -{ - struct _timer_info - { - int state; /* on or off */ - int interval; - int elapse; /* 0~interval */ - void (* timer_proc) (void* param); - void* param; - }timer_info[MAX_TIMER_CNT]; - void (* old_sigfunc)(int); - void (* new_sigfunc)(int); -}_timer_manage_t; -static struct _timer_manage timer_manage; -static void* timer_routine(void*) -{ - int i; - while(true) - { - for(i = 0; i < MAX_TIMER_CNT; i++) - { - if(timer_manage.timer_info[i].state == 0) - { - continue; - } - timer_manage.timer_info[i].elapse++; - if(timer_manage.timer_info[i].elapse == timer_manage.timer_info[i].interval) - { - timer_manage.timer_info[i].elapse = 0; - timer_manage.timer_info[i].timer_proc(timer_manage.timer_info[i].param); - } - } - usleep(1000 * TIMER_UNIT); - } - return NULL; -} -static int init_mul_timer() -{ - static bool s_is_init = false; - if(s_is_init == true) - { - return 0; - } - memset(&timer_manage, 0, sizeof(struct _timer_manage)); - pthread_t pid; - pthread_create(&pid, NULL, timer_routine, NULL); - s_is_init = true; - return 1; -} -static int set_a_timer(int interval, void (* timer_proc)(void* param), void* param) -{ - init_mul_timer(); - int i; - if(timer_proc == NULL || interval <= 0) - { - return (-1); - } - for(i = 0; i < MAX_TIMER_CNT; i++) - { - if(timer_manage.timer_info[i].state == 1) - { - continue; - } - memset(&timer_manage.timer_info[i], 0, sizeof(timer_manage.timer_info[i])); - timer_manage.timer_info[i].timer_proc = timer_proc; - timer_manage.timer_info[i].param = param; - timer_manage.timer_info[i].interval = interval; - timer_manage.timer_info[i].elapse = 0; - timer_manage.timer_info[i].state = 1; - break; - } - if(i >= MAX_TIMER_CNT) - { - ASSERT(false); - return (-1); - } - return (i); -} -typedef void (*EXPIRE_ROUTINE)(void* arg); -EXPIRE_ROUTINE s_expire_function; -static c_fifo s_real_timer_fifo; -static void* real_timer_routine(void*) -{ - char dummy; - while(1) - { - if(s_real_timer_fifo.read(&dummy, 1) > 0) - { - if(s_expire_function)s_expire_function(0); - } - else - { - ASSERT(false); - } - } - return 0; -} -static void expire_real_timer(int sigo) -{ - char dummy = 0x33; - if(s_real_timer_fifo.write(&dummy, 1) <= 0) - { - ASSERT(false); - } -} -void start_real_timer(void (*func)(void* arg)) -{ - if(NULL == func) - { - return; - } - s_expire_function = func; - signal(SIGALRM, expire_real_timer); - struct itimerval value, ovalue; - value.it_value.tv_sec = 0; - value.it_value.tv_usec = REAL_TIME_TASK_CYCLE_MS * 1000; - value.it_interval.tv_sec = 0; - value.it_interval.tv_usec = REAL_TIME_TASK_CYCLE_MS * 1000; - setitimer(ITIMER_REAL, &value, &ovalue); - static pthread_t s_pid; - if(s_pid == 0) - { - pthread_create(&s_pid, NULL, real_timer_routine, NULL); - } -} -unsigned int get_cur_thread_id() -{ - return (unsigned long)pthread_self(); -} -void register_timer(int milli_second,void func(void* param), void* param) -{ - set_a_timer(milli_second/TIMER_UNIT,func, param); -} -long get_time_in_second() -{ - return time(NULL); /* + 8*60*60*/ -} -T_TIME get_time() -{ - T_TIME ret = {0}; - struct tm *fmt; - time_t timer; - timer = get_time_in_second(); - fmt = localtime(&timer); - ret.year = fmt->tm_year + 1900; - ret.month = fmt->tm_mon + 1; - ret.day = fmt->tm_mday; - ret.hour = fmt->tm_hour; - ret.minute = fmt->tm_min; - ret.second = fmt->tm_sec; - return ret; -} -T_TIME second_to_day(long second) -{ - T_TIME ret = {0}; - struct tm *fmt; - fmt = localtime(&second); - ret.year = fmt->tm_year + 1900; - ret.month = fmt->tm_mon + 1; - ret.day = fmt->tm_mday; - ret.hour = fmt->tm_hour; - ret.minute = fmt->tm_min; - ret.second = fmt->tm_sec; - return ret; -} -void create_thread(unsigned long* thread_id, void* attr, void *(*start_routine) (void *), void* arg) -{ - pthread_create((pthread_t*)thread_id, (pthread_attr_t const*)attr, start_routine, arg); -} -void thread_sleep(unsigned int milli_seconds) -{ - usleep(milli_seconds * 1000); -} -typedef struct { - unsigned short bfType; - unsigned int bfSize; - unsigned short bfReserved1; - unsigned short bfReserved2; - unsigned int bfOffBits; -}__attribute__((packed))FileHead; -typedef struct{ - unsigned int biSize; - int biWidth; - int biHeight; - unsigned short biPlanes; - unsigned short biBitCount; - unsigned int biCompress; - unsigned int biSizeImage; - int biXPelsPerMeter; - int biYPelsPerMeter; - unsigned int biClrUsed; - unsigned int biClrImportant; - unsigned int biRedMask; - unsigned int biGreenMask; - unsigned int biBlueMask; -}__attribute__((packed))Infohead; -int build_bmp(const char *filename, unsigned int width, unsigned int height, unsigned char *data) -{ - FileHead bmp_head; - Infohead bmp_info; - int size = width * height * 2; - //initialize bmp head. - bmp_head.bfType = 0x4d42; - bmp_head.bfSize = size + sizeof(FileHead) + sizeof(Infohead); - bmp_head.bfReserved1 = bmp_head.bfReserved2 = 0; - bmp_head.bfOffBits = bmp_head.bfSize - size; - //initialize bmp info. - bmp_info.biSize = 40; - bmp_info.biWidth = width; - bmp_info.biHeight = height; - bmp_info.biPlanes = 1; - bmp_info.biBitCount = 16; - bmp_info.biCompress = 3; - bmp_info.biSizeImage = size; - bmp_info.biXPelsPerMeter = 0; - bmp_info.biYPelsPerMeter = 0; - bmp_info.biClrUsed = 0; - bmp_info.biClrImportant = 0; - //RGB565 - bmp_info.biRedMask = 0xF800; - bmp_info.biGreenMask = 0x07E0; - bmp_info.biBlueMask = 0x001F; - //copy the data - FILE *fp; - if(!(fp=fopen(filename,"wb"))) - { - return -1; - } - fwrite(&bmp_head, 1, sizeof(FileHead),fp); - fwrite(&bmp_info, 1, sizeof(Infohead),fp); - //fwrite(data, 1, size, fp);//top <-> bottom - for (int i = (height - 1); i >= 0; --i) - { - fwrite(&data[i * width * 2], 1, width * 2, fp); - } - - fclose(fp); - return 0; -} -c_fifo::c_fifo() -{ - m_head = m_tail = 0; - m_read_sem = malloc(sizeof(sem_t)); - m_write_mutex = malloc(sizeof(pthread_mutex_t)); - - sem_init((sem_t*)m_read_sem, 0, 0); - pthread_mutex_init((pthread_mutex_t*)m_write_mutex, 0); -} -int c_fifo::read(void* buf, int len) -{ - unsigned char* pbuf = (unsigned char*)buf; - int i = 0; - while(i < len) - { - if (m_tail == m_head) - {//empty - sem_wait((sem_t*)m_read_sem); - continue; - } - *pbuf++ = m_buf[m_head]; - m_head = (m_head + 1) % FIFO_BUFFER_LEN; - i++; - } - if(i != len) - { - ASSERT(false); - } - return i; -} -int c_fifo::write(void* buf, int len) -{ - unsigned char* pbuf = (unsigned char*)buf; - int i = 0; - int tail = m_tail; - pthread_mutex_lock((pthread_mutex_t*)m_write_mutex); - while(i < len) - { - if ((m_tail + 1) % FIFO_BUFFER_LEN == m_head) - {//full, clear data has been written; - m_tail = tail; - log_out("Warning: fifo full\n"); - pthread_mutex_unlock((pthread_mutex_t*)m_write_mutex); - return 0; - } - m_buf[m_tail] = *pbuf++; - m_tail = (m_tail + 1) % FIFO_BUFFER_LEN; - i++; - } - pthread_mutex_unlock((pthread_mutex_t*)m_write_mutex); - if(i != len) - { - ASSERT(false); - } - else - { - sem_post((sem_t*)m_read_sem); - } - return i; -} -#endif -#endif -#ifdef GUILITE_ON -#if (!defined _WIN32) && (!defined WIN32) && (!defined _WIN64) && (!defined WIN64) && (!defined __linux__) && (!defined __APPLE__) - -#include - -static void(*do_assert)(const char* file, int line); -static void(*do_log_out)(const char* log); -void register_debug_function(void(*my_assert)(const char* file, int line), void(*my_log_out)(const char* log)) -{ - do_assert = my_assert; - do_log_out = my_log_out; -} - -void _assert(const char* file, int line) -{ - if(do_assert) - { - do_assert(file, line); - } - while(1); -} - -void log_out(const char* log) -{ - if (do_log_out) - { - do_log_out(log); - } -} - -long get_time_in_second() -{ - return 0; -} - -T_TIME second_to_day(long second) -{ - T_TIME ret = {0}; - return ret; -} - -T_TIME get_time() -{ - T_TIME ret = {0}; - return ret; -} - -void start_real_timer(void (*func)(void* arg)) -{ - log_out("Not support now"); -} - -void register_timer(int milli_second, void func(void* ptmr, void* parg)) -{ - log_out("Not support now"); -} - -unsigned int get_cur_thread_id() -{ - log_out("Not support now"); - return 0; -} - -void create_thread(unsigned long* thread_id, void* attr, void *(*start_routine) (void *), void* arg) -{ - log_out("Not support now"); -} - -extern "C" void delay_ms(unsigned short nms); -void thread_sleep(unsigned int milli_seconds) -{//MCU alway implemnet driver code in APP. - delay_ms(milli_seconds); -} - -int build_bmp(const char *filename, unsigned int width, unsigned int height, unsigned char *data) -{ - log_out("Not support now"); - return 0; -} - -c_fifo::c_fifo() -{ - m_head = m_tail = 0; - m_read_sem = m_write_mutex = 0; -} - -int c_fifo::read(void* buf, int len) -{ - unsigned char* pbuf = (unsigned char*)buf; - int i = 0; - while(i < len) - { - if (m_tail == m_head) - {//empty - continue; - } - *pbuf++ = m_buf[m_head]; - m_head = (m_head + 1) % FIFO_BUFFER_LEN; - i++; - } - if(i != len) - { - ASSERT(false); - } - return i; -} - -int c_fifo::write(void* buf, int len) -{ - unsigned char* pbuf = (unsigned char*)buf; - int i = 0; - int tail = m_tail; - - while(i < len) - { - if ((m_tail + 1) % FIFO_BUFFER_LEN == m_head) - {//full, clear data has been written; - m_tail = tail; - log_out("Warning: fifo full\n"); - return 0; - } - m_buf[m_tail] = *pbuf++; - m_tail = (m_tail + 1) % FIFO_BUFFER_LEN; - i++; - } - - if(i != len) - { - ASSERT(false); - } - return i; -} - -#endif -#endif -#ifdef GUILITE_ON -#if (defined _WIN32) || (defined WIN32) || (defined _WIN64) || (defined WIN64) -#include -#include -#include -#include -#include -#include -#define MAX_TIMER_CNT 10 -#define TIMER_UNIT 50//ms -static void(*do_assert)(const char* file, int line); -static void(*do_log_out)(const char* log); -void register_debug_function(void(*my_assert)(const char* file, int line), void(*my_log_out)(const char* log)) -{ - do_assert = my_assert; - do_log_out = my_log_out; -} -void _assert(const char* file, int line) -{ - static char s_buf[192]; - if (do_assert) - { - do_assert(file, line); - } - else - { - memset(s_buf, 0, sizeof(s_buf)); - sprintf_s(s_buf, sizeof(s_buf), "vvvvvvvvvvvvvvvvvvvvvvvvvvvv\n\nAssert@ file = %s, line = %d\n\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", file, line); - OutputDebugStringA(s_buf); - printf("%s", s_buf); - fflush(stdout); - assert(false); - } -} -void log_out(const char* log) -{ - if (do_log_out) - { - do_log_out(log); - } - else - { - printf("%s", log); - fflush(stdout); - OutputDebugStringA(log); - } -} -typedef struct _timer_manage -{ - struct _timer_info - { - int state; /* on or off */ - int interval; - int elapse; /* 0~interval */ - void (* timer_proc) (void* param); - void* param; - }timer_info[MAX_TIMER_CNT]; - void (* old_sigfunc)(int); - void (* new_sigfunc)(int); -}_timer_manage_t; -static struct _timer_manage timer_manage; -DWORD WINAPI timer_routine(LPVOID lpParam) -{ - int i; - while(true) - { - for(i = 0; i < MAX_TIMER_CNT; i++) - { - if(timer_manage.timer_info[i].state == 0) - { - continue; - } - timer_manage.timer_info[i].elapse++; - if(timer_manage.timer_info[i].elapse == timer_manage.timer_info[i].interval) - { - timer_manage.timer_info[i].elapse = 0; - timer_manage.timer_info[i].timer_proc(timer_manage.timer_info[i].param); - } - } - Sleep(TIMER_UNIT); - } - return 0; -} -static int init_mul_timer() -{ - static bool s_is_init = false; - if(s_is_init == true) - { - return 0; - } - memset(&timer_manage, 0, sizeof(struct _timer_manage)); - DWORD pid; - CreateThread(0, 0, timer_routine, 0, 0, &pid); - s_is_init = true; - return 1; -} -static int set_a_timer(int interval, void (* timer_proc) (void* param), void* param) -{ - init_mul_timer(); - int i; - if(timer_proc == 0 || interval <= 0) - { - return (-1); - } - for(i = 0; i < MAX_TIMER_CNT; i++) - { - if(timer_manage.timer_info[i].state == 1) - { - continue; - } - memset(&timer_manage.timer_info[i], 0, sizeof(timer_manage.timer_info[i])); - timer_manage.timer_info[i].timer_proc = timer_proc; - timer_manage.timer_info[i].param = param; - timer_manage.timer_info[i].interval = interval; - timer_manage.timer_info[i].elapse = 0; - timer_manage.timer_info[i].state = 1; - break; - } - if(i >= MAX_TIMER_CNT) - { - ASSERT(false); - return (-1); - } - return (i); -} -typedef void (*EXPIRE_ROUTINE)(void* arg); -EXPIRE_ROUTINE s_expire_function; -static c_fifo s_real_timer_fifo; -static DWORD WINAPI fire_real_timer(LPVOID lpParam) -{ - char dummy; - while(1) - { - if(s_real_timer_fifo.read(&dummy, 1) > 0) - { - if(s_expire_function)s_expire_function(0); - } - else - { - ASSERT(false); - } - } - return 0; -} -/*Win32 desktop only -static void CALLBACK trigger_real_timer(UINT, UINT, DWORD_PTR, DWORD_PTR, DWORD_PTR) -{ - char dummy = 0x33; - s_real_timer_fifo.write(&dummy, 1); -} -*/ -static DWORD WINAPI trigger_real_timer(LPVOID lpParam) -{ - char dummy = 0x33; - while (1) - { - s_real_timer_fifo.write(&dummy, 1); - Sleep(REAL_TIME_TASK_CYCLE_MS); - } - return 0; -} -void start_real_timer(void (*func)(void* arg)) -{ - if(0 == func) - { - return; - } - s_expire_function = func; - //timeSetEvent(REAL_TIME_TASK_CYCLE_MS, 0, trigger_real_timer, 0, TIME_PERIODIC);//Win32 desktop only - static DWORD s_pid; - if(s_pid == 0) - { - CreateThread(0, 0, trigger_real_timer, 0, 0, &s_pid); - CreateThread(0, 0, fire_real_timer, 0, 0, &s_pid); - } -} -unsigned int get_cur_thread_id() -{ - return GetCurrentThreadId(); -} -void register_timer(int milli_second,void func(void* param), void* param) -{ - set_a_timer(milli_second/TIMER_UNIT,func, param); -} -long get_time_in_second() -{ - return (long)time(0); -} -T_TIME get_time() -{ - T_TIME ret = {0}; - - SYSTEMTIME time; - GetLocalTime(&time); - ret.year = time.wYear; - ret.month = time.wMonth; - ret.day = time.wDay; - ret.hour = time.wHour; - ret.minute = time.wMinute; - ret.second = time.wSecond; - return ret; -} -T_TIME second_to_day(long second) -{ - T_TIME ret; - ret.year = 1999; - ret.month = 10; - ret.date = 1; - ret.second = second % 60; - second /= 60; - ret.minute = second % 60; - second /= 60; - ret.hour = (second + 8) % 24;//China time zone. - return ret; -} -void create_thread(unsigned long* thread_id, void* attr, void *(*start_routine) (void *), void* arg) -{ - DWORD pid = 0; - CreateThread(0, 0, LPTHREAD_START_ROUTINE(start_routine), arg, 0, &pid); - *thread_id = pid; -} -void thread_sleep(unsigned int milli_seconds) -{ - Sleep(milli_seconds); -} -#pragma pack(push,1) -typedef struct { - unsigned short bfType; - unsigned int bfSize; - unsigned short bfReserved1; - unsigned short bfReserved2; - unsigned int bfOffBits; -}FileHead; -typedef struct { - unsigned int biSize; - int biWidth; - int biHeight; - unsigned short biPlanes; - unsigned short biBitCount; - unsigned int biCompress; - unsigned int biSizeImage; - int biXPelsPerMeter; - int biYPelsPerMeter; - unsigned int biClrUsed; - unsigned int biClrImportant; - unsigned int biRedMask; - unsigned int biGreenMask; - unsigned int biBlueMask; -}Infohead; -#pragma pack(pop) -int build_bmp(const char *filename, unsigned int width, unsigned int height, unsigned char *data) -{ - FileHead bmp_head; - Infohead bmp_info; - int size = width * height * 2; - //initialize bmp head. - bmp_head.bfType = 0x4d42; - bmp_head.bfSize = size + sizeof(FileHead) + sizeof(Infohead); - bmp_head.bfReserved1 = bmp_head.bfReserved2 = 0; - bmp_head.bfOffBits = bmp_head.bfSize - size; - //initialize bmp info. - bmp_info.biSize = 40; - bmp_info.biWidth = width; - bmp_info.biHeight = height; - bmp_info.biPlanes = 1; - bmp_info.biBitCount = 16; - bmp_info.biCompress = 3; - bmp_info.biSizeImage = size; - bmp_info.biXPelsPerMeter = 0; - bmp_info.biYPelsPerMeter = 0; - bmp_info.biClrUsed = 0; - bmp_info.biClrImportant = 0; - //RGB565 - bmp_info.biRedMask = 0xF800; - bmp_info.biGreenMask = 0x07E0; - bmp_info.biBlueMask = 0x001F; - //copy the data - FILE *fp; - if (!(fp = fopen(filename, "wb"))) - { - return -1; - } - fwrite(&bmp_head, 1, sizeof(FileHead), fp); - fwrite(&bmp_info, 1, sizeof(Infohead), fp); - //fwrite(data, 1, size, fp);//top <-> bottom - for (int i = (height - 1); i >= 0; --i) - { - fwrite(&data[i * width * 2], 1, width * 2, fp); - } - fclose(fp); - return 0; -} -c_fifo::c_fifo() -{ - m_head = m_tail = 0; - m_read_sem = CreateSemaphore(0, // default security attributes - 0, // initial count - 1, // maximum count - 0); // unnamed semaphore - m_write_mutex = CreateMutex(0, false, 0); -} -int c_fifo::read(void* buf, int len) -{ - unsigned char* pbuf = (unsigned char*)buf; - int i = 0; - while (i < len) - { - if (m_tail == m_head) - {//empty - WaitForSingleObject(m_read_sem, INFINITE); - continue; - } - *pbuf++ = m_buf[m_head]; - m_head = (m_head + 1) % FIFO_BUFFER_LEN; - i++; - } - if (i != len) - { - ASSERT(false); - } - return i; -} -int c_fifo::write(void* buf, int len) -{ - unsigned char* pbuf = (unsigned char*)buf; - int i = 0; - int tail = m_tail; - WaitForSingleObject(m_write_mutex, INFINITE); - while (i < len) - { - if ((m_tail + 1) % FIFO_BUFFER_LEN == m_head) - {//full, clear data has been written; - m_tail = tail; - log_out("Warning: fifo full\n"); - ReleaseMutex(m_write_mutex); - return 0; - } - m_buf[m_tail] = *pbuf++; - m_tail = (m_tail + 1) % FIFO_BUFFER_LEN; - i++; - } - ReleaseMutex(m_write_mutex); - if (i != len) - { - ASSERT(false); - } - else - { - ReleaseSemaphore(m_read_sem, 1, 0); - } - return i; -} -#endif -#endif -#ifdef GUILITE_ON -DIALOG_ARRAY c_dialog::ms_the_dialogs[SURFACE_CNT_MAX]; -#endif -#ifdef GUILITE_ON -c_keyboard c_edit::s_keyboard; -#endif -#ifdef GUILITE_ON -static c_keyboard_button s_key_0, s_key_1, s_key_2, s_key_3, s_key_4, s_key_5, s_key_6, s_key_7, s_key_8, s_key_9; -static c_keyboard_button s_key_A, s_key_B, s_key_C, s_key_D, s_key_E, s_key_F, s_key_G, s_key_H, s_key_I, s_key_J; -static c_keyboard_button s_key_K, s_key_L, s_key_M, s_key_N, s_key_O, s_key_P, s_key_Q, s_key_R, s_key_S, s_key_T; -static c_keyboard_button s_key_U, s_key_V, s_key_W, s_key_X, s_key_Y, s_key_Z; -static c_keyboard_button s_key_dot, s_key_caps, s_key_space, s_key_enter, s_key_del, s_key_esc, s_key_num_switch; -WND_TREE g_key_board_children[] = -{ - //Row 1 - {&s_key_Q, 'Q', 0, POS_X(0), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_W, 'W', 0, POS_X(1), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_E, 'E', 0, POS_X(2), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_R, 'R', 0, POS_X(3), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_T, 'T', 0, POS_X(4), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_Y, 'Y', 0, POS_X(5), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_U, 'U', 0, POS_X(6), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_I, 'I', 0, POS_X(7), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_O, 'O', 0, POS_X(8), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_P, 'P', 0, POS_X(9), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - //Row 2 - {&s_key_A, 'A', 0, ((KEY_WIDTH / 2) + POS_X(0)), POS_Y(1), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_S, 'S', 0, ((KEY_WIDTH / 2) + POS_X(1)), POS_Y(1), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_D, 'D', 0, ((KEY_WIDTH / 2) + POS_X(2)), POS_Y(1), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_F, 'F', 0, ((KEY_WIDTH / 2) + POS_X(3)), POS_Y(1), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_G, 'G', 0, ((KEY_WIDTH / 2) + POS_X(4)), POS_Y(1), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_H, 'H', 0, ((KEY_WIDTH / 2) + POS_X(5)), POS_Y(1), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_J, 'J', 0, ((KEY_WIDTH / 2) + POS_X(6)), POS_Y(1), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_K, 'K', 0, ((KEY_WIDTH / 2) + POS_X(7)), POS_Y(1), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_L, 'L', 0, ((KEY_WIDTH / 2) + POS_X(8)), POS_Y(1), KEY_WIDTH, KEY_HEIGHT}, - //Row 3 - {&s_key_caps, 0x14, 0, POS_X(0), POS_Y(2), CAPS_WIDTH, KEY_HEIGHT}, - {&s_key_Z, 'Z', 0, ((KEY_WIDTH / 2) + POS_X(1)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_X, 'X', 0, ((KEY_WIDTH / 2) + POS_X(2)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_C, 'C', 0, ((KEY_WIDTH / 2) + POS_X(3)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_V, 'V', 0, ((KEY_WIDTH / 2) + POS_X(4)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_B, 'B', 0, ((KEY_WIDTH / 2) + POS_X(5)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_N, 'N', 0, ((KEY_WIDTH / 2) + POS_X(6)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_M, 'M', 0, ((KEY_WIDTH / 2) + POS_X(7)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_del, 0x7F, 0, ((KEY_WIDTH / 2) + POS_X(8)), POS_Y(2), DEL_WIDTH, KEY_HEIGHT}, - //Row 4 - {&s_key_esc, 0x1B, 0, POS_X(0), POS_Y(3), ESC_WIDTH, KEY_HEIGHT}, - {&s_key_num_switch, 0x90, 0, POS_X(2), POS_Y(3), SWITCH_WIDTH, KEY_HEIGHT}, - {&s_key_space, ' ', 0, ((KEY_WIDTH / 2) + POS_X(3)), POS_Y(3), SPACE_WIDTH, KEY_HEIGHT}, - {&s_key_dot, '.', 0, ((KEY_WIDTH / 2) + POS_X(6)), POS_Y(3), DOT_WIDTH, KEY_HEIGHT}, - {&s_key_enter, '\n', 0, POS_X(8), POS_Y(3), ENTER_WIDTH, KEY_HEIGHT}, - {0,0,0,0,0,0,0} -}; -WND_TREE g_number_board_children[] = -{ - {&s_key_1, '1', 0, POS_X(0), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_2, '2', 0, POS_X(1), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_3, '3', 0, POS_X(2), POS_Y(0), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_4, '4', 0, POS_X(0), POS_Y(1), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_5, '5', 0, POS_X(1), POS_Y(1), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_6, '6', 0, POS_X(2), POS_Y(1), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_7, '7', 0, POS_X(0), POS_Y(2), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_8, '8', 0, POS_X(1), POS_Y(2), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_9, '9', 0, POS_X(2), POS_Y(2), KEY_WIDTH, KEY_HEIGHT}, - - {&s_key_esc, 0x1B, 0, POS_X(0), POS_Y(3), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_0, '0', 0, POS_X(1), POS_Y(3), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_dot, '.', 0, POS_X(2), POS_Y(3), KEY_WIDTH, KEY_HEIGHT}, - {&s_key_del, 0x7F, 0, POS_X(3), POS_Y(0), KEY_WIDTH, KEY_HEIGHT * 2 + 2}, - {&s_key_enter,'\n', 0, POS_X(3), POS_Y(2), KEY_WIDTH, KEY_HEIGHT * 2 + 2}, - {0,0,0,0,0,0,0} -}; -#endif -#pragma GCC diagnostic pop diff --git a/src/lib/lv_conf.h b/src/lib/lv_conf.h new file mode 100644 index 00000000..320f59b0 --- /dev/null +++ b/src/lib/lv_conf.h @@ -0,0 +1,742 @@ +/** + * @file lv_conf.h + * Configuration file for v9.0.0-dev + */ + +/* + * Copy this file as `lv_conf.h` + * 1. simply next to the `lvgl` folder + * 2. or any other places and + * - define `LV_CONF_INCLUDE_SIMPLE` + * - add the path as include path + */ + +/* clang-format off */ +#if 1 /*Set it to "1" to enable content*/ + +#ifndef LV_CONF_H +#define LV_CONF_H + +#include + +/*==================== + COLOR SETTINGS + *====================*/ + +/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ +#define LV_COLOR_DEPTH 16 + +#define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) + +/*========================= + STDLIB WRAPPER SETTINGS + *=========================*/ + +/*Enable and configure the built-in memory manager*/ +#define LV_USE_BUILTIN_MALLOC 0 +#if LV_USE_BUILTIN_MALLOC + /*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/ + #define LV_MEM_SIZE (4U * 1024U) /*[bytes]*/ + + /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ + #define LV_MEM_ADR 0 /*0: unused*/ + /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/ + #if LV_MEM_ADR == 0 + #undef LV_MEM_POOL_INCLUDE + #undef LV_MEM_POOL_ALLOC + #endif +#endif /*LV_USE_BUILTIN_MALLOC*/ + +/*Enable lv_memcpy_builtin, lv_memset_builtin, lv_strlen_builtin, lv_strncpy_builtin*/ +#define LV_USE_BUILTIN_MEMCPY 1 + +/*Enable and configure the built-in (v)snprintf */ +#define LV_USE_BUILTIN_SNPRINTF 1 +#if LV_USE_BUILTIN_SNPRINTF + #define LV_SPRINTF_USE_FLOAT 0 +#endif /*LV_USE_BUILTIN_SNPRINTF*/ + +#define LV_STDLIB_INCLUDE + +#define LV_MALLOC malloc +#define LV_REALLOC realloc +#define LV_FREE free +#define LV_MEMSET lv_memset_builtin +#define LV_MEMCPY lv_memcpy_builtin +#define LV_SNPRINTF lv_snprintf_builtin +#define LV_VSNPRINTF lv_vsnprintf_builtin +#define LV_STRLEN lv_strlen_builtin +#define LV_STRNCPY lv_strncpy_builtin + +/*==================== + HAL SETTINGS + *====================*/ + +/*Use a custom tick source that tells the elapsed time in milliseconds. + *It removes the need to manually update the tick with `lv_tick_inc()`)*/ +#define LV_TICK_CUSTOM 1 +#if LV_TICK_CUSTOM + #define LV_TICK_CUSTOM_INCLUDE "common.h" /*Header for the system time function*/ + #define LV_TICK_CUSTOM_SYS_TIME_EXPR (n64hal_millis()) /*Expression evaluating to current system time in ms*/ +#endif /*LV_TICK_CUSTOM*/ + +/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. + *(Not so important, you can adjust it to modify default sizes and spaces)*/ +#define LV_DPI_DEF 130 /*[px/inch]*/ + +/*======================== + * DRAW CONFIGURATION + *========================*/ + +/*Enable the built in mask engine. + *Required to draw shadow, rounded corners, circles, arc, skew lines, or any other masks*/ +#define LV_USE_DRAW_MASKS 0 + +#define LV_USE_DRAW_SW 1 +#if LV_USE_DRAW_SW + + /*Enable complex draw engine. + *Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/ + #define LV_DRAW_SW_COMPLEX 0 + + /* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode + * it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. + * "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers + * and can't be drawn in chunks. */ + + /*The target buffer size for simple layer chunks.*/ + #define LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ + + /*Used if `LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE` couldn't be allocated.*/ + #define LV_DRAW_SW_LAYER_SIMPLE_FALLBACK_BUF_SIZE (3 * 1024) /*[bytes]*/ + + /*Allow buffering some shadow calculation. + *LV_DRAW_SW_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` + *Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost*/ + #define LV_DRAW_SW_SHADOW_CACHE_SIZE 0 + + /* Set number of maximally cached circle data. + * The circumference of 1/4 circle are saved for anti-aliasing + * radius * 4 bytes are used per circle (the most often used radiuses are saved) + * 0: to disable caching */ + #define LV_DRAW_SW_CIRCLE_CACHE_SIZE 0 + + /*Default gradient buffer size. + *When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again. + *LV_DRAW_SW_GRADIENT_CACHE_DEF_SIZE sets the size of this cache in bytes. + *If the cache is too small the map will be allocated only while it's required for the drawing. + *0 mean no caching.*/ + #define LV_DRAW_SW_GRADIENT_CACHE_DEF_SIZE 0 + + /*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display) + *LV_DRAW_SW_GRADIENT_DITHER implies allocating one or two more lines of the object's rendering surface + *The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */ + #define LV_DRAW_SW_GRADIENT_DITHER 0 + #if LV_DRAW_SW_GRADIENT_DITHER + /*Add support for error diffusion dithering. + *Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing. + *The increase in memory consumption is (24 bits * object's width)*/ + #define LV_DRAW_SW_GRADIENT_DITHER_ERROR_DIFFUSION 0 + #endif + + /*Enable subpixel rendering*/ + #define LV_DRAW_SW_FONT_SUBPX 0 + #if LV_DRAW_SW_FONT_SUBPX + /*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ + #define LV_DRAW_SW_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/ + #endif +#endif + +/*Use SDL renderer API*/ +#define LV_USE_DRAW_SDL 0 +#if LV_USE_DRAW_SDL + #define LV_DRAW_SDL_INCLUDE_PATH + /*Texture cache size, 8MB by default*/ + #define LV_DRAW_SDL_LRU_SIZE (1024 * 1024 * 8) + /*Custom blend mode for mask drawing, disable if you need to link with older SDL2 lib*/ + #define LV_DRAW_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6)) +#endif + +/*===================== + * GPU CONFIGURATION + *=====================*/ + +/*Use Arm's 2D acceleration library Arm-2D */ +#define LV_USE_GPU_ARM2D 0 + +/*Use STM32's DMA2D (aka Chrom Art) GPU*/ +#define LV_USE_GPU_STM32_DMA2D 0 +#if LV_USE_GPU_STM32_DMA2D + /*Must be defined to include path of CMSIS header of target processor + e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ + #define LV_GPU_DMA2D_CMSIS_INCLUDE +#endif + +/*Use NXP's PXP GPU iMX RTxxx platforms*/ +#define LV_USE_GPU_NXP_PXP 0 +#if LV_USE_GPU_NXP_PXP + /*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) + * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol SDK_OS_FREE_RTOS + * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected. + *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() + */ + #define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 +#endif + +/*Use NXP's VG-Lite GPU iMX RTxxx platforms*/ +#define LV_USE_GPU_NXP_VG_LITE 0 + +/*Use SWM341's DMA2D GPU*/ +#define LV_USE_GPU_SWM341_DMA2D 0 +#if LV_USE_GPU_SWM341_DMA2D + #define LV_GPU_SWM341_DMA2D_INCLUDE "SWM341.h" +#endif + +/*======================= + * FEATURE CONFIGURATION + *=======================*/ + +/*------------- + * Logging + *-----------*/ + +/*Enable the log module*/ +#define LV_USE_LOG 1 +#if LV_USE_LOG + + /*How important log should be added: + *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information + *LV_LOG_LEVEL_INFO Log important events + *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem + *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail + *LV_LOG_LEVEL_USER Only logs added by the user + *LV_LOG_LEVEL_NONE Do not log anything*/ + #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN + + /*1: Print the log with 'printf'; + *0: User need to register a callback with `lv_log_register_print_cb()`*/ + #define LV_LOG_PRINTF 0 + + /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ + #define LV_LOG_TRACE_MEM 1 + #define LV_LOG_TRACE_TIMER 1 + #define LV_LOG_TRACE_INDEV 1 + #define LV_LOG_TRACE_DISP_REFR 1 + #define LV_LOG_TRACE_EVENT 1 + #define LV_LOG_TRACE_OBJ_CREATE 1 + #define LV_LOG_TRACE_LAYOUT 1 + #define LV_LOG_TRACE_ANIM 1 + +#endif /*LV_USE_LOG*/ + +/*------------- + * Asserts + *-----------*/ + +/*Enable asserts if an operation is failed or an invalid data is found. + *If LV_USE_LOG is enabled an error message will be printed on failure*/ +#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/ +#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/ +#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/ +#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/ +#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ + +/*Add a custom handler when assert happens e.g. to restart the MCU*/ +#define LV_ASSERT_HANDLER_INCLUDE +#define LV_ASSERT_HANDLER while(1); /*Halt by default*/ + +/*------------- + * Others + *-----------*/ + +/*1: Show CPU usage and FPS count*/ +#define LV_USE_PERF_MONITOR 0 +#if LV_USE_PERF_MONITOR + #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT +#endif + +/*1: Show the used memory and the memory fragmentation + * Requires `LV_USE_BUILTIN_MALLOC = 1`*/ +#define LV_USE_MEM_MONITOR 0 +#if LV_USE_MEM_MONITOR + #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT +#endif + +/*1: Draw random colored rectangles over the redrawn areas*/ +#define LV_USE_REFR_DEBUG 0 + +/*Maximum buffer size to allocate for rotation. + *Only used if software rotation is enabled in the display driver.*/ +#define LV_DISP_ROT_MAX_BUF (10*1024) + +#define LV_USE_USER_DATA 1 + +/*Garbage Collector settings + *Used if lvgl is bound to higher level language and the memory is managed by that language*/ +#define LV_ENABLE_GC 0 +#if LV_ENABLE_GC != 0 + #define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ +#endif /*LV_ENABLE_GC*/ + +/*Default image cache size. Image caching keeps some images opened. + *If only the built-in image formats are used there is no real advantage of caching. + *With other image decoders (e.g. PNG or JPG) caching save the continuous open/decode of images. + *However the opened images consume additional RAM. + *0: to disable caching*/ +#define LV_IMG_CACHE_DEF_SIZE 4 + + +/*Number of stops allowed per gradient. Increase this to allow more stops. + *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ +#define LV_GRADIENT_MAX_STOPS 2 + +/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. + * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ +#define LV_COLOR_MIX_ROUND_OFS 0 + +/*===================== + * COMPILER SETTINGS + *====================*/ + +/*For big endian systems set to 1*/ +#define LV_BIG_ENDIAN_SYSTEM 0 + +/*Define a custom attribute to `lv_tick_inc` function*/ +#define LV_ATTRIBUTE_TICK_INC + +/*Define a custom attribute to `lv_timer_handler` function*/ +#define LV_ATTRIBUTE_TIMER_HANDLER + +/*Define a custom attribute to `lv_disp_flush_ready` function*/ +#define LV_ATTRIBUTE_FLUSH_READY + +/*Required alignment size for buffers*/ +#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 + +/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). + * E.g. __attribute__((aligned(4)))*/ +#define LV_ATTRIBUTE_MEM_ALIGN + +/*Attribute to mark large constant arrays for example font's bitmaps*/ +#define LV_ATTRIBUTE_LARGE_CONST + +/*Compiler prefix for a big array declaration in RAM*/ +#define LV_ATTRIBUTE_LARGE_RAM_ARRAY + +/*Place performance critical functions into a faster memory (e.g RAM)*/ +#define LV_ATTRIBUTE_FAST_MEM + + +/*Export integer constant to binding. This macro is used with constants in the form of LV_ that + *should also appear on LVGL binding API such as Micropython.*/ +#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ + +/*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/ +#define LV_USE_LARGE_COORD 0 + +/*================== + * FONT USAGE + *===================*/ + +/*Montserrat fonts with ASCII range and some symbols using bpp = 4 + *https://fonts.google.com/specimen/Montserrat*/ +#define LV_FONT_MONTSERRAT_8 0 +#define LV_FONT_MONTSERRAT_10 1 +#define LV_FONT_MONTSERRAT_12 0 +#define LV_FONT_MONTSERRAT_14 0 +#define LV_FONT_MONTSERRAT_16 0 +#define LV_FONT_MONTSERRAT_18 1 +#define LV_FONT_MONTSERRAT_20 0 +#define LV_FONT_MONTSERRAT_22 0 +#define LV_FONT_MONTSERRAT_24 0 +#define LV_FONT_MONTSERRAT_26 0 +#define LV_FONT_MONTSERRAT_28 0 +#define LV_FONT_MONTSERRAT_30 0 +#define LV_FONT_MONTSERRAT_32 0 +#define LV_FONT_MONTSERRAT_34 0 +#define LV_FONT_MONTSERRAT_36 0 +#define LV_FONT_MONTSERRAT_38 0 +#define LV_FONT_MONTSERRAT_40 0 +#define LV_FONT_MONTSERRAT_42 0 +#define LV_FONT_MONTSERRAT_44 0 +#define LV_FONT_MONTSERRAT_46 0 +#define LV_FONT_MONTSERRAT_48 0 + +/*Demonstrate special features*/ +#define LV_FONT_MONTSERRAT_12_SUBPX 0 +#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/ +#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/ +#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/ + +/*Pixel perfect monospace fonts*/ +#define LV_FONT_UNSCII_8 0 +#define LV_FONT_UNSCII_16 0 + +/*Optionally declare custom fonts here. + *You can use these fonts as default font too and they will be available globally. + *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ +#define LV_FONT_CUSTOM_DECLARE + +/*Always set a default font*/ +#define LV_FONT_DEFAULT &lv_font_montserrat_10 + +/*Enable handling large font and/or fonts with a lot of characters. + *The limit depends on the font size, font face and bpp. + *Compiler error will be triggered if a font needs it.*/ +#define LV_FONT_FMT_TXT_LARGE 0 + +/*Enables/disables support for compressed fonts.*/ +#define LV_USE_FONT_COMPRESSED 0 + +/*Enable drawing placeholders when glyph dsc is not found*/ +#define LV_USE_FONT_PLACEHOLDER 1 + +/*================= + * TEXT SETTINGS + *=================*/ + +/** + * Select a character encoding for strings. + * Your IDE or editor should have the same character encoding + * - LV_TXT_ENC_UTF8 + * - LV_TXT_ENC_ASCII + */ +#define LV_TXT_ENC LV_TXT_ENC_UTF8 + +/*Can break (wrap) texts on these chars*/ +#define LV_TXT_BREAK_CHARS " ,.;:-_" + +/*If a word is at least this long, will break wherever "prettiest" + *To disable, set to a value <= 0*/ +#define LV_TXT_LINE_BREAK_LONG_LEN 0 + +/*Minimum number of characters in a long word to put on a line before a break. + *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ +#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 + +/*Minimum number of characters in a long word to put on a line after a break. + *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ +#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 + +/*The control character to use for signalling text recoloring.*/ +#define LV_TXT_COLOR_CMD "#" + +/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. + *The direction will be processed according to the Unicode Bidirectional Algorithm: + *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ +#define LV_USE_BIDI 0 +#if LV_USE_BIDI + /*Set the default direction. Supported values: + *`LV_BASE_DIR_LTR` Left-to-Right + *`LV_BASE_DIR_RTL` Right-to-Left + *`LV_BASE_DIR_AUTO` detect texts base direction*/ + #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO +#endif + +/*Enable Arabic/Persian processing + *In these languages characters should be replaced with an other form based on their position in the text*/ +#define LV_USE_ARABIC_PERSIAN_CHARS 0 + +/*================== + * WIDGETS + *================*/ + +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ + +#define LV_USE_ANIMIMG 0 + +#define LV_USE_ARC 0 + +#define LV_USE_BAR 0 + +#define LV_USE_BTN 0 + +#define LV_USE_BTNMATRIX 0 + +#define LV_USE_CALENDAR 0 +#if LV_USE_CALENDAR + #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 + #if LV_CALENDAR_WEEK_STARTS_MONDAY + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} + #else + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} + #endif + + #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} + #define LV_USE_CALENDAR_HEADER_ARROW 1 + #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 +#endif /*LV_USE_CALENDAR*/ + +#define LV_USE_CANVAS 1 + +#define LV_USE_CHART 0 + +#define LV_USE_CHECKBOX 0 + +#define LV_USE_COLORWHEEL 0 + +#define LV_USE_DROPDOWN 0 /*Requires: lv_label*/ + +#define LV_USE_IMG 1 /*Requires: lv_label*/ + +#define LV_USE_IMGBTN 0 + +#define LV_USE_KEYBOARD 0 + +#define LV_USE_LABEL 1 +#if LV_USE_LABEL + #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ + #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ +#endif + +#define LV_USE_LED 0 + +#define LV_USE_LINE 0 + +#define LV_USE_LIST 0 + +#define LV_USE_MENU 0 + +#define LV_USE_METER 0 + +#define LV_USE_MSGBOX 0 + +#define LV_USE_ROLLER 0 /*Requires: lv_label*/ +#if LV_USE_ROLLER + #define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/ +#endif + +#define LV_USE_SLIDER 0 /*Requires: lv_bar*/ + +#define LV_USE_SPAN 0 +#if LV_USE_SPAN + /*A line text can contain maximum num of span descriptor */ + #define LV_SPAN_SNIPPET_STACK_SIZE 64 +#endif + +#define LV_USE_SPINBOX 0 + +#define LV_USE_SPINNER 0 + +#define LV_USE_SWITCH 0 + +#define LV_USE_TEXTAREA 0 /*Requires: lv_label*/ +#if LV_USE_TEXTAREA != 0 + #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ +#endif + +#define LV_USE_TABLE 0 + +#define LV_USE_TABVIEW 0 + +#define LV_USE_TILEVIEW 0 + +#define LV_USE_WIN 0 + +/*================== + * THEMES + *==================*/ + +/*A simple, impressive and very complete theme*/ +#define LV_USE_THEME_DEFAULT 1 +#if LV_USE_THEME_DEFAULT + + /*0: Light mode; 1: Dark mode*/ + #define LV_THEME_DEFAULT_DARK 1 + + /*1: Enable grow on press*/ + #define LV_THEME_DEFAULT_GROW 1 + + /*Default transition time in [ms]*/ + #define LV_THEME_DEFAULT_TRANSITION_TIME 20 +#endif /*LV_USE_THEME_DEFAULT*/ + +/*A very simple theme that is a good starting point for a custom theme*/ +#define LV_USE_THEME_BASIC 0 + +/*A theme designed for monochrome displays*/ +#define LV_USE_THEME_MONO 0 + +/*================== + * LAYOUTS + *==================*/ + +/*A layout similar to Flexbox in CSS.*/ +#define LV_USE_FLEX 1 + +/*A layout similar to Grid in CSS.*/ +#define LV_USE_GRID 0 + +/*==================== + * 3RD PARTS LIBRARIES + *====================*/ + +/*File system interfaces for common APIs */ + +/*API for fopen, fread, etc*/ +#define LV_USE_FS_STDIO 0 +#if LV_USE_FS_STDIO + #define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for open, read, etc*/ +#define LV_USE_FS_POSIX 0 +#if LV_USE_FS_POSIX + #define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for CreateFile, ReadFile, etc*/ +#define LV_USE_FS_WIN32 0 +#if LV_USE_FS_WIN32 + #define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/ +#define LV_USE_FS_FATFS 0 +#if LV_USE_FS_FATFS + #define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*PNG decoder library*/ +#define LV_USE_PNG 0 + +/*BMP decoder library*/ +#define LV_USE_BMP 0 + +/* JPG + split JPG decoder library. + * Split JPG is a custom format optimized for embedded systems. */ +#define LV_USE_SJPG 0 + +/*GIF decoder library*/ +#define LV_USE_GIF 0 + +/*QR code library*/ +#define LV_USE_QRCODE 0 + +/*FreeType library*/ +#define LV_USE_FREETYPE 0 +#if LV_USE_FREETYPE + /*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/ + #define LV_FREETYPE_CACHE_SIZE (16 * 1024) + #if LV_FREETYPE_CACHE_SIZE >= 0 + /* 1: bitmap cache use the sbit cache, 0:bitmap cache use the image cache. */ + /* sbit cache:it is much more memory efficient for small bitmaps(font size < 256) */ + /* if font size >= 256, must be configured as image cache */ + #define LV_FREETYPE_SBIT_CACHE 0 + /* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */ + /* (0:use system defaults) */ + #define LV_FREETYPE_CACHE_FT_FACES 0 + #define LV_FREETYPE_CACHE_FT_SIZES 0 + #endif +#endif + +/*Rlottie library*/ +#define LV_USE_RLOTTIE 0 + +/*FFmpeg library for image decoding and playing videos + *Supports all major image formats so do not enable other image decoder with it*/ +#define LV_USE_FFMPEG 0 +#if LV_USE_FFMPEG + /*Dump input information to stderr*/ + #define LV_FFMPEG_DUMP_FORMAT 0 +#endif + +/*================== + * OTHERS + *==================*/ + +/*1: Enable API to take snapshot for object*/ +#define LV_USE_SNAPSHOT 0 + +/*1: Enable Monkey test*/ +#define LV_USE_MONKEY 0 + +/*1: Enable grid navigation*/ +#define LV_USE_GRIDNAV 0 + +/*1: Enable lv_obj fragment*/ +#define LV_USE_FRAGMENT 0 + +/*1: Support using images as font in label or span widgets */ +#define LV_USE_IMGFONT 0 +#if LV_USE_IMGFONT + /*Imgfont image file path maximum length*/ + #define LV_IMGFONT_PATH_MAX_LEN 64 + + /*1: Use img cache to buffer header information*/ + #define LV_IMGFONT_USE_IMG_CACHE_HEADER 0 +#endif + +/*1: Enable a published subscriber based messaging system */ +#define LV_USE_MSG 0 + +/*1: Enable Pinyin input method*/ +/*Requires: lv_keyboard*/ +#define LV_USE_IME_PINYIN 0 +#if LV_USE_IME_PINYIN + /*1: Use default thesaurus*/ + /*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/ + #define LV_IME_PINYIN_USE_DEFAULT_DICT 1 + /*Set the maximum number of candidate panels that can be displayed*/ + /*This needs to be adjusted according to the size of the screen*/ + #define LV_IME_PINYIN_CAND_TEXT_NUM 6 + + /*Use 9 key input(k9)*/ + #define LV_IME_PINYIN_USE_K9_MODE 1 + #if LV_IME_PINYIN_USE_K9_MODE == 1 + #define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3 + #endif // LV_IME_PINYIN_USE_K9_MODE +#endif + +/*================== +* EXAMPLES +*==================*/ + +/*Enable the examples to be built with the library*/ +#define LV_BUILD_EXAMPLES 0 + +/*=================== + * DEMO USAGE + ====================*/ + +/*Show some widget. It might be required to increase `LV_MEM_SIZE` */ +#define LV_USE_DEMO_WIDGETS 0 +#if LV_USE_DEMO_WIDGETS + #define LV_DEMO_WIDGETS_SLIDESHOW 0 +#endif + +/*Demonstrate the usage of encoder and keyboard*/ +#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0 + +/*Benchmark your system*/ +#define LV_USE_DEMO_BENCHMARK 0 +#if LV_USE_DEMO_BENCHMARK + /*Use RGB565A8 images with 16 bit color depth instead of ARGB8565*/ + #define LV_DEMO_BENCHMARK_RGB565A8 0 +#endif + +/*Stress test for LVGL*/ +#define LV_USE_DEMO_STRESS 0 + +/*Music player demo*/ +#define LV_USE_DEMO_MUSIC 0 +#if LV_USE_DEMO_MUSIC + #define LV_DEMO_MUSIC_SQUARE 0 + #define LV_DEMO_MUSIC_LANDSCAPE 0 + #define LV_DEMO_MUSIC_ROUND 0 + #define LV_DEMO_MUSIC_LARGE 0 + #define LV_DEMO_MUSIC_AUTO_PLAY 0 +#endif + +/*--END OF LV_CONF_H--*/ + +#endif /*LV_CONF_H*/ + +#endif /*End of "Content enable"*/ \ No newline at end of file diff --git a/src/lib/lvgl b/src/lib/lvgl new file mode 160000 index 00000000..dfd14fa7 --- /dev/null +++ b/src/lib/lvgl @@ -0,0 +1 @@ +Subproject commit dfd14fa778aef25d0db61748a58aa9989ce5e2c8 diff --git a/src/main.cpp b/src/main.cpp index 6098e4ee..3cc16e00 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -92,12 +92,18 @@ void loop() input_update_input_devices(); - tft_try_update(); + tft_update(); for (uint32_t c = 0; c < MAX_CONTROLLERS; c++) { if (input_is_connected(c)) { + if (n64_in_dev[c].connected == 0) + { + n64_in_dev[c].connected = 1; + tft_flag_update(c); + } + if (n64_is_on && !n64_in_dev[c].interrupt_attached) { switch (c) @@ -108,7 +114,7 @@ void loop() case 3: n64hal_attach_interrupt(n64_in_dev[c].pin, n64_controller4_clock_edge, N64_INTMODE_FALLING); break; } n64_in_dev[c].interrupt_attached = true; - tft_flag_update(); + tft_flag_update(c); } if (input_is(c, INPUT_GAMECONTROLLER)) { @@ -118,7 +124,7 @@ void loop() if(n64_in_dev[c].type != N64_CONTROLLER) { n64_in_dev[c].type = N64_CONTROLLER; - tft_flag_update(); + tft_flag_update(c); } n64_settings *settings = n64_settings_get(); float x, y, range; @@ -158,7 +164,7 @@ void loop() if(n64_in_dev[c].type != N64_MOUSE) { n64_in_dev[c].type = N64_MOUSE; - tft_flag_update(); + tft_flag_update(c); } n64_in_dev[c].b_state.dButtons = new_state->dButtons; n64_in_dev[c].b_state.x_axis = new_state->x_axis; @@ -177,18 +183,26 @@ void loop() if(n64_in_dev[c].type != N64_RANDNET) { n64_in_dev[c].type = N64_RANDNET; - tft_flag_update(); + tft_flag_update(c); } memcpy(&n64_in_dev[c].kb_state, new_state, sizeof(n64_randnet_kb)); } #endif } + else + { + if (n64_in_dev[c].connected == 1) + { + n64_in_dev[c].connected = 0; + tft_flag_update(c); + } + } if ((!input_is_connected(c) || !n64_is_on) && n64_in_dev[c].interrupt_attached) { n64_in_dev[c].interrupt_attached = false; n64hal_detach_interrupt(n64_in_dev[c].pin); - tft_flag_update(); + tft_flag_update(c); } //Get a copy of the latest n64 button presses to handle the below combos @@ -237,12 +251,12 @@ void loop() memory_flush_all(); debug_print_status("[MAIN] Flushed RAM to SD card as required\n"); flushing_toggle[c] = 1; - tft_flag_update(); + tft_flag_update(c); } } else { - if (flushing_toggle[c]) tft_flag_update(); + if (flushing_toggle[c]) tft_flag_update(c); flushing_toggle[c] = 0; } @@ -256,7 +270,7 @@ void loop() { tft_page = tft_change_page(++tft_page); tft_toggle[c] = 1; - tft_flag_update(); + tft_flag_update(c); } } else @@ -312,7 +326,7 @@ void loop() /* HANDLE NEXT PERIPHERAL */ n64_in_dev[c].current_peripheral = PERI_NONE; //Go to none whilst changing - tft_force_update(); + tft_update(); //Changing peripheral to RUMBLEPAK if (n64_buttons & N64_LB) @@ -435,7 +449,7 @@ void loop() if (n64_in_dev[c].current_peripheral == PERI_NONE && (n64hal_millis() - timer_peri_change[c]) > PERI_CHANGE_TIME) { n64_in_dev[c].current_peripheral = n64_in_dev[c].next_peripheral; - tft_flag_update(); + tft_flag_update(c); } //Update the virtual pak if required @@ -483,5 +497,6 @@ static void ring_buffer_flush() tft_add_log(ring_buffer[_print_cursor]); ring_buffer[_print_cursor] = 0xFF; _print_cursor = (_print_cursor + 1) % sizeof(ring_buffer); + tft_flag_update(0xFF); } } diff --git a/src/n64/n64_controller.h b/src/n64/n64_controller.h index ad5c99e8..f857b81e 100644 --- a/src/n64/n64_controller.h +++ b/src/n64/n64_controller.h @@ -61,6 +61,7 @@ typedef struct n64_rumblepak *rpak; //Pointer to installed rumblepak n64_controllerpak *cpak; //Pointer to installed controllerpak // + uint8_t connected; //Flag is set when this controller is connected uint32_t interrupt_attached; //Flag is set when this controller is connected to an ext int. uint32_t bus_idle_timer_clks; //Timer counter for bus idle timing usb64_pin_t pin; //What pin is this controller connected to diff --git a/src/port_teensy41/hal_t4.cpp b/src/port_teensy41/hal_t4.cpp index 11f1ca14..7cf569bc 100644 --- a/src/port_teensy41/hal_t4.cpp +++ b/src/port_teensy41/hal_t4.cpp @@ -15,6 +15,7 @@ void n64hal_system_init() void n64hal_debug_init() { serial_port.begin(256000); + serial_port.print(CrashReport); } void n64hal_gpio_init() diff --git a/src/port_teensy41/tft_t4.cpp b/src/port_teensy41/tft_t4.cpp index 4f641072..03ed57ae 100644 --- a/src/port_teensy41/tft_t4.cpp +++ b/src/port_teensy41/tft_t4.cpp @@ -3,84 +3,31 @@ #include #include "common.h" +#include "printf.h" #include "controller_icon.h" #include "usb64_logo.h" -#include "GuiLite.h" - -c_surface *psurface_guilite = NULL; -c_display *pdisplay_guilite = NULL; -#if TFT_USE_FRAMEBUFFER -static DMAMEM uint8_t _framebuffer[TFT_WIDTH * TFT_HEIGHT * TFT_PIXEL_SIZE]; -#else -struct EXTERNAL_GFX_OP my_gfx_op; -#endif +#include "lvgl.h" #include "ILI9341_t3n.h" -static ILI9341_t3n tft = ILI9341_t3n(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_SCK, TFT_MISO); - -static void _tft_assert(const char *file, int line) -{ - debug_print_error("[TFT] Error: Assert in %s on line %d\n", file, line); - while (1) - ; -} - -static void _tft_log_out(const char *log) -{ - debug_print_status(log); -} -#if TFT_USE_FRAMEBUFFER == 0 -/* - * Function: Draw a pixel to your display at a given coordinate. Required if NOT using a framebuffer - * ---------------------------- - * Returns: Void - * - * x: horizontal pixel position - * y: vertical pixel position - * rgb: RGB888 colour. You can use GL_RGB_32_to_16 to convert to RGB565 if needed. - */ -static void _draw_pixel(int x, int y, unsigned int rgb) -{ - tft.drawPixel(x, y, GL_RGB_32_to_16(rgb)); -} +static ILI9341_t3n tft = ILI9341_t3n(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_SCK, TFT_MISO); +static lv_disp_drv_t disp_drv; +static lv_disp_draw_buf_t draw_buf; +static DMAMEM uint8_t _framebuffer[TFT_WIDTH * TFT_HEIGHT * TFT_PIXEL_SIZE]; -/* - * Function: Fill a given rectangle area. Required if NOT using a framebuffer - * ---------------------------- - * Returns: Void - * - * x0,y0: Top left rectangle pixel position - * x1,y1: Bottom right pixel position - * rgb: RGB888 colour. You can use GL_RGB_32_to_16 to convert to RGB565 if needed. - */ -static void _fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb) +//LVGL Callback that should update the LCD +static void disp_flush(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p) { - tft.fillRect(x0, y0, x1 - x0, y1 - y0, GL_RGB_32_to_16(rgb)); + tft.updateScreenAsync(); } -#endif -/* - * Function: Start TFT draw. Required if using a framebuffer. This should draw the framebuffer to the screen using DMA or similar. - * ---------------------------- - * Returns: Void - * - * force: If force is true, you must wait for any previous screen updates to finished then update. - */ -void tft_dev_draw(bool force) +//LVGL Callback that will be called whilse the LCD is updating +static void disp_wait(lv_disp_drv_t *disp_drv) { -#if TFT_USE_FRAMEBUFFER - if (force) - { - while (tft.asyncUpdateActive()); - tft.updateScreenAsync(); - } - else if (tft.asyncUpdateActive()) + if (tft.asyncUpdateActive() == false) { - return; + lv_disp_flush_ready(disp_drv); } - -#endif } /* @@ -92,23 +39,24 @@ void tft_dev_init() { tft.begin(); tft.setRotation(TFT_ROTATION); -#if TFT_USE_FRAMEBUFFER - static c_surface surface(TFT_WIDTH, TFT_HEIGHT, 2, Z_ORDER_LEVEL_0); - static c_display display(_framebuffer, TFT_WIDTH, TFT_HEIGHT, &surface); tft.setFrameBuffer((uint16_t *)_framebuffer); tft.useFrameBuffer(true); -#else - static c_surface_no_fb surface(TFT_WIDTH, TFT_HEIGHT, 2, &my_gfx_op, Z_ORDER_LEVEL_0); - static c_display display(NULL, TFT_WIDTH, TFT_HEIGHT, &surface); - my_gfx_op.draw_pixel = _draw_pixel; - my_gfx_op.fill_rect = _fill_rect; -#endif - psurface_guilite = &surface; - pdisplay_guilite = &display; - register_debug_function(_tft_assert, _tft_log_out); -} - -bool tft_dev_is_busy() -{ - return tft.asyncUpdateActive(); + tft.fillScreen(0x10A2); + tft.updateScreen(); + + lv_disp_draw_buf_init(&draw_buf, _framebuffer, NULL, TFT_WIDTH * TFT_HEIGHT); + lv_disp_drv_init(&disp_drv); + + disp_drv.hor_res = TFT_WIDTH; + disp_drv.ver_res = TFT_HEIGHT; + disp_drv.flush_cb = disp_flush; + disp_drv.wait_cb = disp_wait; + disp_drv.draw_buf = &draw_buf; + disp_drv.direct_mode = 1; + disp_drv.antialiasing = 0; + + lv_disp_drv_register(&disp_drv); + lv_disp_t * disp = lv_disp_get_default(); + lv_timer_set_period(disp->refr_timer, 100); + return; } diff --git a/src/tft.cpp b/src/tft.cpp index 3b9d1551..73b508d0 100644 --- a/src/tft.cpp +++ b/src/tft.cpp @@ -8,39 +8,34 @@ #include "tft.h" #include "fileio.h" -#define GUILITE_ON -#include "GuiLite.h" - +#include "lvgl.h" #include "controller_icon.h" #include "usb64_logo.h" static const int WIDTH = TFT_FRAMEBUFFER_WIDTH; static const int HEIGHT = TFT_FRAMEBUFFER_HEIGHT; static uint8_t _tft_page = 0; -static uint8_t _tft_page_changed = 1; -static uint8_t _tft_max_pages = 2; -static uint8_t _tft_update_needed = 0; +static const uint8_t _tft_max_pages = 2; static const uint8_t _tft_log_max_lines = 15; static char *_tft_log_text_lines[_tft_log_max_lines]; extern n64_input_dev_t n64_in_dev[MAX_CONTROLLERS]; extern n64_transferpak n64_tpak[MAX_CONTROLLERS]; - extern n64_input_dev_t n64_in_dev[MAX_CONTROLLERS]; extern n64_transferpak n64_tpak[MAX_CONTROLLERS]; -static char text_buff[32]; - -extern const LATTICE_FONT_INFO Arial_14_GL; -extern const LATTICE_FONT_INFO Arial_19_GL; -extern c_surface *psurface_guilite; -static c_label n64_status; -static c_label fileio_status; -static c_label extram_size; -static c_label controller_status[4]; -static c_label controller_id[4]; -static c_label tft_log[_tft_log_max_lines]; +static bool input_dirty[MAX_CONTROLLERS]; +static bool log_dirty = true; +static bool n64_status; +static lv_obj_t *log_page; +static lv_obj_t *log_lines[_tft_log_max_lines]; +static lv_obj_t *main_page; +static lv_obj_t *ram_label; +static lv_obj_t *sd_label; +static lv_obj_t *n64_status_label; +static lv_obj_t *controller_status_label[4]; +static const char *NOT_CONNECTED = "NOT CONNECTED\n0x0000/0x0000"; static const char *n64_peri_to_string(n64_input_dev_t *c) { @@ -86,202 +81,179 @@ static const char *n64_peri_to_string(n64_input_dev_t *c) } } +void lvgl_putstring(const char *buf) +{ + usb64_printf("%s", buf); +} + FLASHMEM void tft_init() { + lv_init(); + lv_log_register_print_cb(lvgl_putstring); tft_dev_init(); - if (psurface_guilite == NULL) + lv_obj_t *scr = lv_scr_act(); + + lv_obj_t *usb64_image = lv_canvas_create(scr); + lv_canvas_set_buffer(usb64_image, (void *)usb64_logo, 120, 35, LV_IMG_CF_TRUE_COLOR); + lv_obj_update_layout(usb64_image); + + main_page = lv_obj_create(scr); + lv_obj_set_size(main_page, lv_obj_get_width(scr), lv_obj_get_height(scr) - lv_obj_get_height(usb64_image)); + lv_obj_set_style_pad_all(main_page, 0, LV_PART_MAIN); + lv_obj_set_style_border_width(main_page, 0, LV_PART_MAIN); + lv_obj_set_style_bg_color(main_page, LV_COLOR_MAKE(17,20,16), LV_PART_MAIN); + lv_obj_set_pos(main_page, 0, lv_obj_get_height(usb64_image)); + + log_page = lv_obj_create(scr); + lv_obj_set_size(log_page, lv_obj_get_width(scr), lv_obj_get_height(scr) - lv_obj_get_height(usb64_image)); + lv_obj_set_style_pad_all(log_page, 0, LV_PART_MAIN); + lv_obj_set_style_pad_row(log_page, 0, LV_PART_MAIN); + lv_obj_set_style_border_width(log_page, 0, LV_PART_MAIN); + lv_obj_set_style_bg_color(log_page, LV_COLOR_MAKE(17,20,16), LV_PART_MAIN); + lv_obj_set_pos(log_page, 0, lv_obj_get_height(usb64_image)); + lv_obj_add_flag(log_page, LV_OBJ_FLAG_HIDDEN); + + ram_label = lv_label_create(scr); + sd_label = lv_label_create(scr); + n64_status_label = lv_label_create(scr); + + lv_label_set_text_fmt(ram_label, "RAM: %uMB", memory_get_ext_ram_size()); + + if (fileio_detected()) { - return; + lv_label_set_text_fmt(sd_label, "SD: Detected"); + lv_obj_set_style_text_color(sd_label, LV_COLOR_MAKE(0,255,0), LV_PART_MAIN); } - - psurface_guilite->fill_rect(0, 0, WIDTH, HEIGHT, TFT_BG_COLOR, Z_ORDER_LEVEL_0); - - static c_image usb64_image; - memset(&usb64_image, 0, sizeof(c_image)); - BITMAP_INFO _image; - _image.color_bits = 16; - _image.height = 35; - _image.width = 120; - _image.pixel_color_array = usb64_logo; - usb64_image.draw_image(psurface_guilite, Z_ORDER_LEVEL_0, &_image, 0, 0, TFT_BG_COLOR); - - //Draw RAM status - snprintf(text_buff, sizeof(text_buff), "Detected RAM: %uMB", memory_get_ext_ram_size()); - extram_size.set_surface(psurface_guilite); - extram_size.set_bg_color(TFT_BG_COLOR); - extram_size.set_font_color(GL_RGB(255, 255, 255)); - extram_size.set_wnd_pos(125, 0, 1, Arial_14_GL.height); - extram_size.set_font_type(&Arial_14_GL); - extram_size.set_str(text_buff); - extram_size.show_window(); - - tft_force_update(); -} - -void tft_try_update() -{ -#if (0) - //Dump the framebuffer to a file on the SD Card, 10 seconds after power up. Assuming 16bit display. - //Convert to png with - //ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb565le -s 320x240 -i tft_dump.bin -f image2 -vcodec png tft_dump.png - if (n64hal_millis() > 10000) + else { - fileio_write_to_file("tft_dump.bin", (uint8_t *)tft_dev_get_fb(), WIDTH * HEIGHT * 2); - debug_print_status("TFT framebuffer dumped\n"); - while (1) yield(); + lv_label_set_text_fmt(sd_label, "SD: Not Detected"); + lv_obj_set_style_text_color(sd_label, LV_COLOR_MAKE(255,0,0), LV_PART_MAIN); } -#endif - if (_tft_update_needed == 0) + lv_label_set_text_fmt(n64_status_label, "N64 is OFF"); + lv_obj_set_style_text_color(n64_status_label, LV_COLOR_MAKE(255,0,0), LV_PART_MAIN); + + lv_obj_update_layout(ram_label); + lv_obj_update_layout(sd_label); + lv_obj_update_layout(n64_status_label); + + lv_obj_align(ram_label, LV_ALIGN_TOP_RIGHT, 0, 0); + lv_obj_align(sd_label, LV_ALIGN_TOP_RIGHT, 0, 10); + lv_obj_align(n64_status_label, LV_ALIGN_TOP_RIGHT, 0, 20); + + lv_obj_t *n64_icon[MAX_CONTROLLERS]; + for (int i = 0; i < MAX_CONTROLLERS; i++) { - return; + lv_coord_t h = lv_obj_get_height(main_page); + n64_icon[i] = lv_canvas_create(main_page); + lv_canvas_set_buffer(n64_icon[i], (void *)controller_icon, 48, 45, LV_IMG_CF_TRUE_COLOR); + lv_obj_align(n64_icon[i], LV_ALIGN_TOP_LEFT, 0, 0 + ((h - 0) * i / 4)); + + controller_status_label[i] = lv_label_create(main_page); + lv_obj_align(controller_status_label[i], LV_ALIGN_TOP_LEFT, 50, 0 + ((h - 0) * i / 4)); + lv_obj_set_style_text_font(controller_status_label[i], &lv_font_montserrat_18, LV_PART_MAIN); + lv_obj_set_style_text_color(controller_status_label[i], LV_COLOR_MAKE(255,255,255), LV_PART_MAIN); + lv_label_set_text(controller_status_label[i], NOT_CONNECTED); + input_dirty[i] = true; } - if (tft_dev_is_busy()) + lv_obj_set_layout(log_page, LV_LAYOUT_FLEX); + lv_obj_set_flex_flow(log_page, LV_FLEX_FLOW_COLUMN); + for (int i = 0; i < _tft_log_max_lines; i++) { - return; + log_lines[i] = lv_label_create(log_page); + lv_obj_set_style_pad_all(log_lines[i], 0, LV_PART_MAIN); + lv_obj_set_style_border_width(log_lines[i], 0, LV_PART_MAIN); + lv_obj_align(log_lines[i], LV_ALIGN_LEFT_MID, 0, 0); + lv_label_set_text(log_lines[i], ""); } - tft_force_update(); + n64_status = false; + + lv_obj_update_layout(scr); + tft_update(); } uint8_t tft_change_page(uint8_t page) { _tft_page = (_tft_page + 1) % _tft_max_pages; - _tft_page_changed = 1; + if (_tft_page == 0) + { + lv_obj_add_flag(log_page, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(main_page, LV_OBJ_FLAG_HIDDEN); + } + else + { + lv_obj_clear_flag(log_page, LV_OBJ_FLAG_HIDDEN); + lv_obj_add_flag(main_page, LV_OBJ_FLAG_HIDDEN); + } return _tft_page; } -void tft_force_update() +void tft_update() { - //These are drawn once when the TFT page has changed. - if (_tft_page_changed) + lv_task_handler(); + if (lv_obj_is_visible(main_page)) { - _tft_page_changed = 0; - if (_tft_page == 0) + for (int i = 0; i < MAX_CONTROLLERS; i++) { - psurface_guilite->fill_rect(0, 40, WIDTH, HEIGHT, TFT_BG_COLOR, Z_ORDER_LEVEL_0); - static c_image controller_image; - BITMAP_INFO _image; - memset(&controller_image, 0, sizeof(c_image)); - _image.color_bits = 16; - _image.height = 45; - _image.width = 48; - _image.pixel_color_array = controller_icon; - controller_image.draw_image(psurface_guilite, Z_ORDER_LEVEL_0, &_image, 0, 45 + ((HEIGHT - 45) * 0 / 4), TFT_BG_COLOR); - controller_image.draw_image(psurface_guilite, Z_ORDER_LEVEL_0, &_image, 0, 45 + ((HEIGHT - 45) * 1 / 4), TFT_BG_COLOR); - controller_image.draw_image(psurface_guilite, Z_ORDER_LEVEL_0, &_image, 0, 45 + ((HEIGHT - 45) * 2 / 4), TFT_BG_COLOR); - controller_image.draw_image(psurface_guilite, Z_ORDER_LEVEL_0, &_image, 0, 45 + ((HEIGHT - 45) * 3 / 4), TFT_BG_COLOR); + if (input_dirty[i] == false) + { + continue; + } + input_dirty[i] = false; + lv_color_t colour; + if (input_is_connected(i)) + colour = LV_COLOR_MAKE(0, 255, 0); + else + colour = LV_COLOR_MAKE(255, 255, 255); + const char *peri_str = n64_peri_to_string(&n64_in_dev[i]); + lv_obj_set_style_text_color(controller_status_label[i], colour, LV_PART_MAIN); + lv_label_set_text_fmt(controller_status_label[i], "%s\n0x%04x/0x%04x", peri_str, + input_get_id_vendor(i), input_get_id_product(i)); } - else if (_tft_page == 1) - { - psurface_guilite->fill_rect(0, 40, WIDTH, HEIGHT, TFT_BG_COLOR, Z_ORDER_LEVEL_0); - } - } - //Draw dynamic items here. There are drawn everytime a TFT update is flagged. - if (_tft_page == 0) - { - //Draw controller status and peripheral type - for (int i = 0; i < 4; i++) + if (n64_status != n64hal_input_read(N64_CONSOLE_SENSE_PIN)) { - uint32_t colour = input_is_connected(i) ? GL_RGB(0, 255, 0) : GL_RGB(255, 255, 255); - controller_status[i].set_surface(psurface_guilite); - controller_status[i].set_bg_color(TFT_BG_COLOR); - controller_status[i].set_font_color(colour); - controller_status[i].set_wnd_pos(50, (45 + 0) + ((HEIGHT - 45) * i / 4), WIDTH, Arial_19_GL.height); - controller_status[i].set_font_type(&Arial_19_GL); - controller_status[i].set_str(n64_peri_to_string(&n64_in_dev[i])); - controller_status[i].show_window(); - - snprintf(text_buff, sizeof(text_buff), "0x%04x/0x%04x", input_get_id_vendor(i), input_get_id_product(i)); - controller_id[i].set_surface(psurface_guilite); - controller_id[i].set_font_color(colour); - controller_id[i].set_bg_color(TFT_BG_COLOR); - controller_id[i].set_wnd_pos(50, (45 + 20) + ((HEIGHT - 45) * i / 4), WIDTH, Arial_19_GL.height); - controller_id[i].set_font_type(&Arial_19_GL); - controller_id[i].set_str(text_buff); - controller_id[i].show_window(); + lv_color_t colour; + const char *n64_status_text; + n64_status = n64hal_input_read(N64_CONSOLE_SENSE_PIN); + if (n64_status) + { + n64_status_text = "N64 is ON"; + colour = LV_COLOR_MAKE(0, 255, 0); + } + else + { + n64_status_text = "N64 is OFF"; + colour = LV_COLOR_MAKE(255, 0, 0); + } + lv_obj_set_style_text_color(n64_status_label, colour, LV_PART_MAIN); + lv_label_set_text(n64_status_label, n64_status_text); } } - else if (_tft_page == 1) + else if (lv_obj_is_visible(log_page) && log_dirty) { - psurface_guilite->fill_rect(0, 40, WIDTH, HEIGHT, TFT_BG_COLOR, Z_ORDER_LEVEL_0); + log_dirty = false; for (int i = 0; i < _tft_log_max_lines; i++) { - if (_tft_log_text_lines[i] == NULL) - break; - - tft_log[i].set_surface(psurface_guilite); - tft_log[i].set_bg_color(TFT_BG_COLOR); - tft_log[i].set_font_color(GL_RGB(255, 255, 255)); - tft_log[i].set_wnd_pos(0, 45 + i * Arial_14_GL.height, WIDTH, Arial_14_GL.height); - tft_log[i].set_font_type(&Arial_14_GL); - tft_log[i].set_str(_tft_log_text_lines[i]); - tft_log[i].show_window(); + if (_tft_log_text_lines[i] == NULL) break; + lv_label_set_text(log_lines[i], _tft_log_text_lines[i]); } } +} - //Draw N64 console status - uint32_t colour; - const char *n64_status_text; - if (n64hal_input_read(N64_CONSOLE_SENSE_PIN) == 0) - { - n64_status_text = "N64 is OFF"; - colour = GL_RGB(255, 0, 0); - } - else - { - n64_status_text = "N64 is ON"; - colour = GL_RGB(0, 255, 0); - } - n64_status.set_surface(psurface_guilite); - n64_status.set_bg_color(TFT_BG_COLOR); - n64_status.set_font_color(colour); - n64_status.set_wnd_pos(WIDTH - (10 * 8), 0, 100, Arial_14_GL.height); - n64_status.set_font_type(&Arial_14_GL); - n64_status.set_str(n64_status_text); - n64_status.show_window(); - - //Draw SD Card status - const char *fileio_status_text; - if (fileio_detected() == 0) +void tft_flag_update(uint8_t controller) +{ + if (controller >=0 && controller < sizeof(input_dirty)) { - fileio_status_text = "SD Not Detected"; - colour = GL_RGB(255, 0, 0); + input_dirty[controller] = true; } else { - fileio_status_text = "SD Detected"; - colour = GL_RGB(0, 255, 0); + log_dirty = true; } - n64_status.set_surface(psurface_guilite); - n64_status.set_bg_color(TFT_BG_COLOR); - n64_status.set_font_color(colour); - n64_status.set_wnd_pos(125, Arial_14_GL.height, 100, Arial_14_GL.height); - n64_status.set_font_type(&Arial_14_GL); - n64_status.set_str(fileio_status_text); - n64_status.show_window(); - - //Draw the current games name - n64_status_text = n64_get_current_game(); - n64_status.set_surface(psurface_guilite); - n64_status.set_bg_color(TFT_BG_COLOR); - n64_status.set_font_color(GL_RGB(255, 255, 255)); - n64_status.set_wnd_pos(125, Arial_14_GL.height * 2, 200, Arial_14_GL.height); - n64_status.set_font_type(&Arial_14_GL); - n64_status.set_str(n64_status_text); - n64_status.show_window(); - - tft_dev_draw(true); - - _tft_update_needed = 0; -} - -void tft_flag_update() -{ - _tft_update_needed = 1; } void tft_add_log(char c) @@ -304,7 +276,6 @@ void tft_add_log(char c) tft_log_line_num++; } tft_log_pos = 0; - tft_flag_update(); } else { diff --git a/src/tft.h b/src/tft.h index 63791969..70085647 100644 --- a/src/tft.h +++ b/src/tft.h @@ -4,19 +4,14 @@ #ifndef _TFT_H #define _TFT_H -#define TFT_BG_COLOR GL_RGB(16, 20, 16) - -//TFT API +// TFT API void tft_init(); -uint8_t tft_change_page(uint8_t page); -void tft_force_update(); //Will block until previous DMA complete. -void tft_try_update(); //Will return if DMA busy, or framebuffer hasnt changed -void tft_flag_update(); //Mark the framebuffer as dirty, draw at next update call -void tft_add_log(char c); +uint8_t tft_change_page(uint8_t page); // Change the active TFT page +void tft_update(); // Update the tft display +void tft_flag_update(uint8_t controller); // Mark the framebuffer as dirty, draw at next update call +void tft_add_log(char c); // Add a character to the TFT log screen. Each line should be ended with '\n' -//TFT device specific functions. +// TFT device specific functions. void tft_dev_init(); -void tft_dev_draw(bool force); -bool tft_dev_is_busy(); #endif \ No newline at end of file diff --git a/src/tft/Arial_14.cpp b/src/tft/Arial_14.cpp deleted file mode 100644 index dac9b14d..00000000 --- a/src/tft/Arial_14.cpp +++ /dev/null @@ -1,269 +0,0 @@ -#include "common.h" -#include "GuiLite.h" - -static const unsigned char _32[] PROGMEM = { -0, 42, }; -static const unsigned char _33[] PROGMEM = { -0, 6, 36, 1, 197, 1, 36, 1, 197, 1, 36, 1, 153, 1, 36, 1, 153, 1, 0, 1, 153, 1, 0, 1, 111, 1, 0, 2, 36, 1, 197, 1, 0, 6, }; -static const unsigned char _35[] PROGMEM = { -0, 20, 153, 1, 73, 2, 153, 1, 0, 2, 197, 1, 36, 1, 111, 1, 73, 1, 153, 1, 255, 5, 0, 1, 36, 1, 197, 1, 0, 1, 255, 1, 0, 2, 111, 2, 36, 1, 197, 1, 0, 1, 153, 1, 255, 5, 0, 1, 197, 1, 36, 1, 153, 1, 73, 1, 0, 2, 197, 1, 0, 1, 197, 1, 36, 1, 0, 19, }; -static const unsigned char _37[] PROGMEM = { -0, 31, 111, 1, 255, 2, 0, 2, 36, 1, 255, 1, 0, 3, 255, 1, 0, 1, 111, 2, 0, 1, 153, 1, 73, 1, 0, 3, 255, 1, 0, 1, 111, 2, 73, 1, 197, 1, 0, 4, 111, 1, 255, 2, 0, 1, 197, 1, 36, 1, 0, 7, 73, 1, 153, 1, 73, 1, 255, 2, 36, 1, 0, 4, 197, 1, 36, 1, 197, 1, 36, 1, 73, 1, 153, 1, 0, 3, 111, 2, 0, 1, 197, 1, 36, 1, 73, 1, 153, 1, 0, 3, 255, 1, 0, 2, 73, 1, 255, 2, 36, 1, 0, 30, }; -static const unsigned char _39[] PROGMEM = { -0, 6, 36, 1, 197, 1, 36, 1, 197, 1, 0, 1, 153, 1, 0, 16, }; -static const unsigned char _40[] PROGMEM = { -0, 14, 36, 1, 197, 1, 0, 2, 197, 1, 0, 2, 73, 1, 111, 1, 0, 2, 153, 1, 73, 1, 0, 2, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 2, 153, 1, 73, 1, 0, 2, 73, 1, 111, 1, 0, 3, 197, 1, 0, 3, 36, 1, 197, 1, 0, 4, }; -static const unsigned char _41[] PROGMEM = { -0, 13, 153, 1, 36, 1, 0, 3, 197, 1, 0, 3, 111, 1, 73, 1, 0, 2, 36, 1, 153, 1, 0, 2, 36, 1, 197, 1, 0, 2, 36, 1, 197, 1, 0, 2, 73, 1, 153, 1, 0, 2, 111, 1, 73, 1, 0, 2, 197, 1, 0, 2, 153, 1, 36, 1, 0, 5, }; -static const unsigned char _43[] PROGMEM = { -0, 33, 197, 1, 0, 5, 197, 1, 0, 3, 255, 5, 0, 3, 197, 1, 0, 5, 197, 1, 0, 26, }; -static const unsigned char _44[] PROGMEM = { -0, 31, 153, 1, 73, 1, 0, 1, 73, 2, 0, 1, 111, 1, 0, 4, }; -static const unsigned char _45[] PROGMEM = { -0, 32, 73, 1, 255, 3, 0, 20, }; -static const unsigned char _46[] PROGMEM = { -0, 31, 153, 1, 73, 1, 0, 9, }; -static const unsigned char _47[] PROGMEM = { -0, 11, 111, 1, 0, 2, 197, 1, 0, 1, 36, 1, 197, 1, 0, 1, 73, 1, 111, 1, 0, 1, 153, 1, 73, 1, 0, 1, 255, 1, 0, 1, 73, 1, 153, 1, 0, 1, 111, 2, 0, 10, }; -static const unsigned char _48[] PROGMEM = { -0, 20, 255, 2, 153, 1, 0, 2, 153, 1, 111, 1, 0, 1, 197, 1, 73, 1, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 1, 255, 1, 0, 2, 73, 1, 153, 1, 0, 1, 255, 1, 0, 2, 73, 1, 153, 1, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 1, 153, 1, 111, 1, 0, 1, 197, 1, 73, 1, 0, 2, 255, 2, 153, 1, 0, 19, }; -static const unsigned char _49[] PROGMEM = { -0, 21, 153, 1, 73, 1, 0, 3, 153, 1, 255, 1, 73, 1, 0, 2, 111, 1, 73, 1, 153, 1, 73, 1, 0, 4, 153, 1, 73, 1, 0, 4, 153, 1, 73, 1, 0, 4, 153, 1, 73, 1, 0, 4, 153, 1, 73, 1, 0, 4, 153, 1, 73, 1, 0, 19, }; -static const unsigned char _50[] PROGMEM = { -0, 19, 111, 1, 255, 3, 0, 1, 36, 1, 255, 1, 0, 2, 111, 1, 153, 1, 0, 4, 36, 1, 197, 1, 0, 4, 153, 1, 73, 1, 0, 3, 153, 1, 111, 1, 0, 3, 197, 1, 111, 1, 0, 3, 197, 1, 73, 1, 0, 3, 73, 1, 255, 4, 197, 1, 0, 18, }; -static const unsigned char _51[] PROGMEM = { -0, 19, 73, 1, 255, 2, 153, 1, 0, 2, 255, 1, 0, 2, 153, 1, 73, 1, 0, 4, 153, 1, 73, 1, 0, 2, 36, 1, 255, 1, 153, 1, 0, 5, 73, 1, 153, 1, 0, 4, 36, 1, 197, 1, 0, 1, 255, 1, 0, 2, 73, 1, 153, 1, 0, 1, 73, 1, 255, 2, 197, 1, 0, 19, }; -static const unsigned char _52[] PROGMEM = { -0, 21, 36, 1, 197, 1, 0, 4, 197, 2, 0, 3, 111, 1, 153, 1, 197, 1, 0, 2, 36, 1, 197, 1, 36, 1, 197, 1, 0, 2, 197, 1, 36, 2, 197, 1, 0, 1, 36, 1, 255, 4, 197, 1, 0, 3, 36, 1, 197, 1, 0, 4, 36, 1, 197, 1, 0, 19, }; -static const unsigned char _53[] PROGMEM = { -0, 19, 73, 1, 255, 3, 73, 1, 0, 1, 111, 2, 0, 4, 197, 1, 73, 1, 0, 4, 255, 1, 197, 1, 255, 2, 0, 3, 36, 1, 0, 1, 36, 1, 153, 1, 0, 4, 36, 1, 197, 1, 0, 1, 255, 1, 0, 2, 36, 1, 153, 1, 0, 1, 73, 1, 255, 2, 197, 1, 0, 19, }; -static const unsigned char _54[] PROGMEM = { -0, 19, 36, 1, 255, 3, 0, 2, 197, 1, 36, 1, 0, 1, 111, 1, 153, 1, 36, 1, 197, 1, 0, 4, 73, 1, 153, 1, 197, 1, 255, 2, 0, 1, 73, 1, 255, 1, 36, 1, 0, 1, 73, 1, 153, 1, 73, 1, 153, 1, 0, 2, 36, 1, 197, 1, 0, 1, 255, 1, 0, 2, 73, 1, 153, 1, 0, 1, 36, 1, 255, 2, 197, 1, 0, 19, }; -static const unsigned char _55[] PROGMEM = { -0, 18, 36, 1, 255, 4, 197, 1, 0, 4, 197, 1, 73, 1, 0, 3, 73, 1, 153, 1, 0, 4, 197, 1, 36, 1, 0, 3, 73, 1, 197, 1, 0, 4, 153, 1, 73, 1, 0, 4, 197, 1, 36, 1, 0, 4, 255, 1, 0, 21, }; -static const unsigned char _56[] PROGMEM = { -0, 19, 36, 1, 255, 3, 0, 2, 197, 1, 36, 1, 0, 1, 111, 1, 153, 1, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 2, 197, 1, 255, 1, 111, 1, 0, 2, 255, 1, 36, 1, 0, 1, 111, 1, 153, 1, 36, 1, 197, 1, 0, 3, 255, 1, 0, 1, 255, 1, 36, 1, 0, 1, 73, 1, 197, 1, 0, 1, 73, 1, 255, 3, 0, 19, }; -static const unsigned char _57[] PROGMEM = { -0, 19, 73, 1, 255, 2, 153, 1, 0, 2, 255, 1, 36, 1, 0, 1, 111, 2, 36, 1, 197, 1, 0, 2, 36, 1, 197, 1, 0, 1, 255, 1, 36, 1, 0, 1, 111, 1, 197, 1, 0, 1, 73, 1, 255, 2, 153, 1, 197, 1, 0, 4, 73, 1, 153, 1, 0, 1, 255, 1, 0, 2, 197, 1, 73, 1, 0, 1, 73, 1, 255, 2, 153, 1, 0, 19, }; -static const unsigned char _58[] PROGMEM = { -0, 16, 153, 1, 73, 1, 0, 13, 153, 1, 73, 1, 0, 9, }; -static const unsigned char _59[] PROGMEM = { -0, 16, 153, 1, 73, 1, 0, 13, 153, 1, 73, 1, 0, 1, 73, 2, 0, 1, 111, 1, 0, 4, }; -static const unsigned char _60[] PROGMEM = { -0, 34, 111, 1, 153, 1, 0, 2, 197, 1, 255, 1, 111, 1, 0, 1, 36, 1, 255, 1, 36, 1, 0, 5, 197, 1, 255, 1, 111, 1, 0, 5, 111, 1, 153, 1, 0, 24, }; -static const unsigned char _61[] PROGMEM = { -0, 37, 255, 4, 153, 1, 0, 7, 255, 4, 153, 1, 0, 30, }; -static const unsigned char _62[] PROGMEM = { -0, 31, 255, 1, 36, 1, 0, 5, 197, 1, 255, 1, 153, 1, 0, 5, 73, 1, 197, 1, 0, 2, 197, 1, 255, 1, 153, 1, 0, 2, 255, 1, 36, 1, 0, 27, }; -static const unsigned char _63[] PROGMEM = { -0, 19, 73, 1, 255, 3, 0, 2, 255, 1, 0, 2, 73, 1, 197, 1, 0, 4, 73, 1, 197, 1, 0, 3, 73, 1, 255, 1, 0, 3, 36, 1, 255, 1, 0, 4, 73, 1, 153, 1, 0, 10, 73, 1, 153, 1, 0, 20, }; -static const unsigned char _64[] PROGMEM = { -0, 36, 36, 1, 255, 4, 111, 1, 0, 4, 153, 1, 255, 1, 0, 4, 197, 1, 153, 1, 0, 2, 73, 1, 197, 1, 0, 1, 153, 1, 255, 1, 197, 1, 153, 1, 73, 1, 197, 1, 73, 1, 0, 1, 197, 1, 73, 1, 111, 1, 153, 1, 0, 1, 73, 1, 255, 1, 0, 1, 73, 1, 153, 1, 0, 1, 255, 1, 0, 1, 255, 1, 36, 1, 0, 1, 36, 1, 197, 1, 0, 1, 73, 1, 153, 1, 0, 1, 255, 1, 36, 1, 197, 1, 0, 2, 73, 1, 153, 1, 0, 1, 153, 1, 111, 1, 0, 1, 255, 1, 36, 1, 255, 1, 36, 1, 0, 1, 255, 1, 111, 1, 73, 1, 255, 1, 0, 2, 153, 2, 73, 1, 255, 2, 111, 1, 255, 2, 0, 4, 197, 2, 0, 5, 197, 2, 0, 3, 111, 1, 255, 5, 36, 1, 0, 12, }; -static const unsigned char _65[] PROGMEM = { -0, 27, 73, 1, 197, 1, 0, 6, 197, 1, 111, 1, 73, 1, 0, 4, 73, 1, 153, 1, 36, 1, 153, 1, 0, 4, 153, 1, 73, 1, 0, 1, 197, 1, 36, 1, 0, 2, 36, 1, 197, 1, 0, 2, 73, 1, 153, 1, 0, 2, 153, 1, 255, 5, 36, 1, 0, 1, 255, 1, 0, 4, 111, 3, 73, 1, 0, 5, 255, 1, 0, 24, }; -static const unsigned char _66[] PROGMEM = { -0, 22, 197, 1, 255, 3, 153, 1, 0, 2, 197, 1, 36, 1, 0, 2, 153, 1, 111, 1, 0, 1, 197, 1, 36, 1, 0, 2, 153, 1, 36, 1, 0, 1, 197, 1, 255, 4, 0, 2, 197, 1, 36, 1, 0, 2, 153, 1, 111, 1, 0, 1, 197, 1, 36, 1, 0, 2, 73, 1, 153, 1, 0, 1, 197, 1, 36, 1, 0, 2, 153, 1, 73, 1, 0, 1, 197, 1, 255, 3, 153, 1, 0, 22, }; -static const unsigned char _67[] PROGMEM = { -0, 23, 111, 1, 255, 2, 153, 1, 0, 2, 111, 1, 197, 1, 0, 2, 153, 1, 111, 1, 0, 1, 197, 1, 36, 1, 0, 2, 36, 2, 0, 1, 255, 1, 0, 6, 255, 1, 0, 6, 197, 1, 36, 1, 0, 5, 111, 1, 197, 1, 0, 2, 153, 1, 197, 1, 0, 2, 153, 1, 255, 2, 197, 1, 0, 22, }; -static const unsigned char _68[] PROGMEM = { -0, 22, 255, 4, 111, 1, 0, 2, 255, 1, 0, 3, 197, 1, 73, 1, 0, 1, 255, 1, 0, 3, 73, 1, 153, 1, 0, 1, 255, 1, 0, 3, 36, 1, 197, 1, 0, 1, 255, 1, 0, 3, 36, 1, 197, 1, 0, 1, 255, 1, 0, 3, 73, 1, 153, 1, 0, 1, 255, 1, 0, 3, 197, 1, 73, 1, 0, 1, 255, 4, 111, 1, 0, 22, }; -static const unsigned char _69[] PROGMEM = { -0, 19, 255, 4, 111, 1, 0, 1, 255, 1, 0, 5, 255, 1, 0, 5, 255, 4, 36, 1, 0, 1, 255, 1, 0, 5, 255, 1, 0, 5, 255, 1, 0, 5, 255, 4, 153, 1, 0, 18, }; -static const unsigned char _70[] PROGMEM = { -0, 19, 197, 1, 255, 3, 197, 1, 0, 1, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 197, 1, 255, 3, 36, 1, 0, 1, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 21, }; -static const unsigned char _71[] PROGMEM = { -0, 26, 111, 1, 255, 3, 111, 1, 0, 2, 111, 1, 197, 1, 0, 3, 255, 1, 73, 1, 0, 1, 255, 1, 36, 1, 0, 3, 73, 1, 111, 1, 36, 1, 197, 1, 0, 6, 36, 1, 197, 1, 0, 2, 73, 1, 255, 2, 153, 1, 0, 1, 255, 1, 36, 1, 0, 3, 73, 1, 153, 1, 0, 1, 111, 1, 197, 1, 0, 3, 153, 2, 0, 2, 73, 1, 255, 3, 153, 1, 0, 25, }; -static const unsigned char _72[] PROGMEM = { -0, 22, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 1, 197, 1, 255, 4, 36, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 21, }; -static const unsigned char _73[] PROGMEM = { -0, 7, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 6, }; -static const unsigned char _74[] PROGMEM = { -0, 18, 197, 1, 36, 1, 0, 3, 197, 1, 36, 1, 0, 3, 197, 1, 36, 1, 0, 3, 197, 1, 36, 1, 0, 3, 197, 1, 36, 1, 0, 3, 197, 1, 36, 1, 73, 1, 153, 1, 0, 1, 197, 1, 36, 1, 0, 1, 255, 2, 153, 1, 0, 16, }; -static const unsigned char _75[] PROGMEM = { -0, 22, 197, 1, 36, 1, 0, 2, 153, 1, 255, 1, 0, 1, 197, 1, 36, 1, 0, 1, 153, 2, 0, 2, 197, 1, 36, 1, 153, 2, 0, 3, 197, 2, 255, 1, 36, 1, 0, 3, 197, 1, 111, 2, 197, 1, 0, 3, 197, 1, 36, 1, 0, 1, 197, 1, 153, 1, 0, 2, 197, 1, 36, 1, 0, 2, 255, 1, 73, 1, 0, 1, 197, 1, 36, 1, 0, 2, 73, 1, 255, 1, 0, 21, }; -static const unsigned char _76[] PROGMEM = { -0, 19, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 197, 1, 255, 4, 0, 18, }; -static const unsigned char _77[] PROGMEM = { -0, 25, 197, 1, 153, 1, 0, 2, 36, 1, 255, 1, 73, 1, 0, 1, 197, 2, 0, 2, 111, 1, 197, 1, 73, 1, 0, 1, 197, 1, 111, 1, 36, 1, 0, 1, 153, 1, 111, 1, 73, 1, 0, 1, 197, 1, 73, 1, 111, 1, 0, 1, 197, 1, 111, 1, 73, 1, 0, 1, 197, 1, 36, 1, 153, 1, 36, 1, 111, 2, 73, 1, 0, 1, 197, 1, 36, 1, 153, 1, 111, 1, 73, 1, 111, 1, 73, 1, 0, 1, 197, 1, 36, 1, 111, 1, 197, 1, 0, 1, 111, 1, 73, 1, 0, 1, 197, 1, 36, 2, 197, 1, 0, 1, 111, 1, 73, 1, 0, 24, }; -static const unsigned char _78[] PROGMEM = { -0, 22, 197, 1, 111, 1, 0, 2, 111, 2, 0, 1, 197, 1, 255, 1, 0, 2, 111, 2, 0, 1, 197, 1, 111, 2, 0, 1, 111, 2, 0, 1, 197, 1, 36, 1, 197, 1, 0, 1, 111, 2, 0, 1, 197, 1, 36, 1, 73, 1, 111, 3, 0, 1, 197, 1, 36, 1, 0, 1, 197, 1, 111, 2, 0, 1, 197, 1, 36, 1, 0, 1, 73, 1, 255, 1, 111, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 111, 1, 0, 21, }; -static const unsigned char _79[] PROGMEM = { -0, 26, 111, 1, 255, 3, 0, 3, 111, 1, 197, 1, 0, 2, 73, 1, 255, 1, 0, 2, 197, 1, 36, 1, 0, 3, 153, 1, 73, 1, 0, 1, 255, 1, 0, 4, 111, 2, 0, 1, 255, 1, 0, 4, 111, 2, 0, 1, 197, 1, 36, 1, 0, 3, 153, 1, 73, 1, 0, 1, 111, 1, 197, 1, 0, 2, 73, 1, 255, 1, 0, 3, 111, 1, 255, 3, 0, 26, }; -static const unsigned char _80[] PROGMEM = { -0, 19, 197, 1, 255, 3, 111, 1, 0, 1, 197, 1, 36, 1, 0, 2, 255, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 0, 1, 197, 1, 36, 1, 0, 2, 255, 1, 0, 1, 197, 1, 255, 3, 111, 1, 0, 1, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 21, }; -static const unsigned char _81[] PROGMEM = { -0, 26, 73, 1, 255, 3, 0, 3, 73, 1, 255, 1, 0, 2, 73, 1, 255, 1, 0, 2, 153, 1, 73, 1, 0, 3, 153, 1, 73, 1, 0, 1, 197, 1, 36, 1, 0, 3, 111, 2, 0, 1, 197, 1, 36, 1, 0, 3, 111, 2, 0, 1, 153, 1, 73, 1, 0, 1, 73, 1, 0, 1, 153, 1, 73, 1, 0, 1, 73, 1, 255, 1, 0, 1, 73, 1, 255, 1, 197, 1, 0, 3, 73, 1, 255, 2, 153, 1, 197, 2, 0, 24, }; -static const unsigned char _82[] PROGMEM = { -0, 22, 197, 1, 255, 4, 0, 2, 197, 1, 36, 1, 0, 2, 153, 1, 111, 1, 0, 1, 197, 1, 36, 1, 0, 2, 73, 1, 153, 1, 0, 1, 197, 1, 36, 1, 0, 2, 153, 1, 111, 1, 0, 1, 197, 1, 255, 3, 197, 1, 0, 2, 197, 1, 36, 1, 0, 1, 153, 1, 111, 1, 0, 2, 197, 1, 36, 1, 0, 2, 197, 1, 73, 1, 0, 1, 197, 1, 36, 1, 0, 2, 73, 1, 255, 1, 0, 21, }; -static const unsigned char _83[] PROGMEM = { -0, 23, 255, 3, 153, 1, 0, 2, 197, 1, 73, 1, 0, 2, 197, 1, 111, 1, 0, 1, 197, 1, 36, 1, 0, 5, 73, 1, 255, 2, 73, 1, 0, 6, 153, 1, 255, 1, 73, 1, 0, 5, 36, 1, 197, 1, 0, 1, 255, 1, 73, 1, 0, 2, 111, 1, 153, 1, 0, 1, 36, 1, 255, 3, 197, 1, 0, 22, }; -static const unsigned char _84[] PROGMEM = { -0, 18, 197, 1, 255, 5, 0, 2, 36, 1, 197, 1, 0, 4, 36, 1, 197, 1, 0, 4, 36, 1, 197, 1, 0, 4, 36, 1, 197, 1, 0, 4, 36, 1, 197, 1, 0, 4, 36, 1, 197, 1, 0, 4, 36, 1, 197, 1, 0, 20, }; -static const unsigned char _85[] PROGMEM = { -0, 22, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 1, 153, 1, 111, 1, 0, 1, 36, 1, 255, 1, 0, 3, 255, 3, 36, 1, 0, 22, }; -static const unsigned char _86[] PROGMEM = { -0, 24, 111, 1, 197, 1, 0, 4, 36, 1, 255, 1, 0, 1, 255, 1, 36, 1, 0, 3, 111, 1, 153, 1, 0, 1, 111, 2, 0, 3, 197, 1, 36, 1, 0, 1, 36, 1, 255, 1, 0, 2, 73, 1, 197, 1, 0, 3, 153, 1, 73, 1, 0, 1, 153, 1, 73, 1, 0, 3, 73, 1, 153, 1, 36, 1, 255, 1, 0, 5, 197, 1, 153, 1, 111, 1, 0, 5, 111, 1, 255, 1, 36, 1, 0, 26, }; -static const unsigned char _87[] PROGMEM = { -0, 30, 73, 1, 153, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 197, 1, 36, 1, 197, 1, 0, 2, 153, 1, 111, 1, 73, 1, 0, 1, 36, 1, 197, 1, 0, 1, 197, 1, 0, 2, 153, 1, 36, 1, 153, 1, 0, 1, 73, 1, 111, 1, 0, 1, 153, 1, 73, 1, 36, 1, 153, 1, 0, 1, 197, 1, 0, 1, 153, 1, 73, 1, 0, 1, 73, 1, 111, 2, 73, 1, 0, 1, 153, 1, 36, 1, 197, 1, 0, 2, 36, 1, 153, 2, 36, 1, 0, 1, 111, 1, 73, 1, 197, 1, 0, 3, 153, 1, 197, 1, 0, 2, 36, 1, 255, 1, 111, 1, 0, 3, 153, 2, 0, 3, 255, 1, 73, 1, 0, 31, }; -static const unsigned char _88[] PROGMEM = { -0, 21, 36, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 0, 1, 73, 1, 197, 1, 0, 2, 255, 1, 0, 3, 153, 1, 73, 1, 111, 1, 73, 1, 0, 4, 255, 1, 153, 1, 0, 4, 36, 1, 153, 1, 255, 1, 0, 4, 197, 1, 36, 1, 111, 1, 153, 1, 0, 2, 111, 2, 0, 2, 197, 1, 73, 1, 111, 1, 197, 1, 0, 3, 36, 1, 255, 1, 0, 21, }; -static const unsigned char _89[] PROGMEM = { -0, 24, 111, 1, 153, 1, 0, 4, 73, 1, 197, 1, 0, 1, 111, 2, 0, 3, 255, 1, 0, 3, 197, 1, 36, 1, 0, 1, 153, 1, 36, 1, 0, 3, 36, 1, 197, 1, 73, 1, 111, 1, 0, 5, 73, 1, 197, 1, 0, 6, 73, 1, 153, 1, 0, 6, 73, 1, 153, 1, 0, 6, 73, 1, 153, 1, 0, 27, }; -static const unsigned char _90[] PROGMEM = { -0, 22, 255, 6, 0, 5, 197, 1, 111, 1, 0, 4, 153, 2, 0, 4, 111, 1, 197, 1, 0, 4, 73, 1, 255, 1, 0, 4, 36, 1, 255, 1, 36, 1, 0, 4, 255, 1, 73, 1, 0, 4, 111, 1, 255, 6, 0, 21, }; -static const unsigned char _91[] PROGMEM = { -0, 10, 255, 2, 0, 1, 255, 1, 0, 2, 255, 1, 0, 2, 255, 1, 0, 2, 255, 1, 0, 2, 255, 1, 0, 2, 255, 1, 0, 2, 255, 1, 0, 2, 255, 1, 0, 2, 255, 2, 0, 3, }; -static const unsigned char _93[] PROGMEM = { -0, 9, 111, 1, 255, 1, 153, 1, 0, 1, 73, 1, 153, 1, 0, 1, 73, 1, 153, 1, 0, 1, 73, 1, 153, 1, 0, 1, 73, 1, 153, 1, 0, 1, 73, 1, 153, 1, 0, 1, 73, 1, 153, 1, 0, 1, 73, 1, 153, 1, 0, 1, 73, 1, 153, 1, 111, 1, 255, 1, 153, 1, 0, 3, }; -static const unsigned char _95[] PROGMEM = { -0, 72, 197, 1, 255, 5, 0, 6, }; -static const unsigned char _97[] PROGMEM = { -0, 31, 36, 1, 255, 3, 0, 2, 197, 1, 36, 1, 0, 1, 153, 1, 73, 1, 0, 2, 197, 1, 255, 2, 111, 1, 0, 1, 255, 1, 73, 1, 0, 1, 153, 1, 111, 1, 0, 1, 255, 1, 0, 2, 255, 1, 111, 1, 0, 1, 153, 1, 255, 2, 153, 2, 0, 18, }; -static const unsigned char _98[] PROGMEM = { -0, 19, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 197, 1, 153, 1, 255, 2, 0, 2, 197, 1, 153, 1, 0, 1, 111, 1, 153, 1, 0, 1, 197, 1, 73, 1, 0, 1, 36, 1, 197, 1, 0, 1, 197, 1, 73, 1, 0, 1, 36, 1, 197, 1, 0, 1, 197, 1, 153, 1, 0, 1, 111, 1, 153, 1, 0, 1, 197, 1, 153, 1, 255, 2, 0, 19, }; -static const unsigned char _99[] PROGMEM = { -0, 32, 197, 1, 255, 2, 73, 1, 0, 1, 153, 1, 111, 1, 0, 1, 36, 1, 255, 1, 0, 1, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 153, 1, 111, 1, 0, 2, 255, 1, 0, 2, 197, 1, 255, 2, 73, 1, 0, 18, }; -static const unsigned char _100[] PROGMEM = { -0, 22, 111, 1, 153, 1, 0, 4, 111, 1, 153, 1, 0, 1, 36, 1, 255, 2, 153, 2, 0, 1, 197, 1, 73, 1, 0, 1, 197, 1, 153, 1, 36, 1, 197, 1, 0, 2, 73, 1, 153, 1, 36, 1, 197, 1, 0, 2, 73, 1, 153, 1, 0, 1, 197, 1, 73, 1, 0, 1, 153, 2, 0, 1, 36, 1, 255, 2, 197, 1, 153, 1, 0, 18, }; -static const unsigned char _101[] PROGMEM = { -0, 32, 255, 3, 0, 2, 197, 1, 36, 1, 0, 1, 73, 1, 153, 1, 0, 1, 255, 4, 197, 1, 0, 1, 255, 1, 0, 5, 197, 1, 111, 1, 0, 1, 111, 1, 153, 1, 0, 2, 255, 3, 0, 19, }; -static const unsigned char _102[] PROGMEM = { -0, 14, 111, 1, 255, 1, 0, 2, 197, 1, 36, 1, 0, 1, 153, 1, 255, 2, 0, 2, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 12, }; -static const unsigned char _103[] PROGMEM = { -0, 32, 255, 2, 111, 1, 153, 1, 0, 1, 153, 1, 111, 1, 0, 1, 153, 2, 0, 1, 197, 1, 36, 1, 0, 1, 73, 1, 153, 1, 0, 1, 197, 1, 36, 1, 0, 1, 73, 1, 153, 1, 0, 1, 153, 1, 111, 1, 0, 1, 153, 2, 0, 2, 255, 2, 153, 2, 0, 4, 111, 2, 0, 1, 153, 1, 255, 2, 197, 1, 0, 7, }; -static const unsigned char _104[] PROGMEM = { -0, 19, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 4, 197, 1, 153, 1, 255, 2, 0, 2, 197, 1, 111, 1, 0, 1, 153, 1, 73, 1, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 18, }; -static const unsigned char _105[] PROGMEM = { -0, 7, 197, 1, 0, 3, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 6, }; -static const unsigned char _106[] PROGMEM = { -0, 7, 197, 1, 0, 3, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 255, 2, 0, 2, }; -static const unsigned char _107[] PROGMEM = { -0, 16, 197, 1, 36, 1, 0, 3, 197, 1, 36, 1, 0, 3, 197, 1, 36, 2, 255, 1, 0, 1, 197, 1, 36, 1, 197, 1, 0, 2, 197, 1, 255, 1, 73, 1, 0, 2, 197, 1, 73, 1, 197, 1, 0, 2, 197, 1, 36, 1, 153, 1, 111, 1, 0, 1, 197, 1, 36, 1, 0, 1, 255, 1, 0, 15, }; -static const unsigned char _108[] PROGMEM = { -0, 7, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 1, 197, 1, 0, 6, }; -static const unsigned char _109[] PROGMEM = { -0, 41, 197, 1, 153, 1, 255, 1, 197, 1, 111, 1, 255, 1, 197, 1, 0, 1, 197, 1, 111, 1, 0, 1, 197, 1, 111, 1, 0, 1, 197, 1, 0, 1, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 1, 197, 1, 0, 1, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 1, 197, 1, 0, 1, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 1, 197, 1, 0, 1, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 1, 197, 1, 0, 24, }; -static const unsigned char _110[] PROGMEM = { -0, 31, 197, 1, 153, 1, 255, 2, 0, 2, 197, 1, 73, 1, 0, 1, 153, 1, 73, 1, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 18, }; -static const unsigned char _111[] PROGMEM = { -0, 31, 36, 1, 255, 2, 197, 1, 0, 2, 197, 1, 73, 1, 0, 1, 153, 1, 111, 1, 0, 1, 255, 1, 0, 2, 73, 1, 153, 1, 0, 1, 255, 1, 0, 2, 73, 1, 153, 1, 0, 1, 197, 1, 73, 1, 0, 1, 153, 1, 111, 1, 0, 1, 36, 1, 255, 2, 153, 1, 0, 19, }; -static const unsigned char _112[] PROGMEM = { -0, 31, 197, 1, 153, 1, 255, 2, 0, 2, 197, 1, 111, 1, 0, 1, 111, 1, 153, 1, 0, 1, 197, 1, 36, 1, 0, 1, 36, 1, 197, 1, 0, 1, 197, 1, 36, 1, 0, 1, 36, 1, 197, 1, 0, 1, 197, 1, 111, 1, 0, 1, 111, 1, 153, 1, 0, 1, 197, 1, 153, 1, 255, 2, 0, 2, 197, 1, 36, 1, 0, 4, 197, 1, 36, 1, 0, 9, }; -static const unsigned char _113[] PROGMEM = { -0, 31, 73, 1, 255, 2, 111, 1, 153, 1, 0, 1, 255, 1, 36, 1, 0, 1, 197, 1, 153, 1, 73, 1, 153, 1, 0, 2, 73, 1, 153, 1, 73, 1, 153, 1, 0, 2, 73, 1, 153, 1, 0, 1, 255, 1, 36, 1, 0, 1, 153, 2, 0, 1, 73, 1, 255, 2, 153, 2, 0, 4, 73, 1, 153, 1, 0, 4, 73, 1, 153, 1, 0, 6, }; -static const unsigned char _114[] PROGMEM = { -0, 21, 197, 1, 153, 1, 255, 1, 0, 1, 197, 1, 111, 1, 0, 2, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 2, 197, 1, 36, 1, 0, 13, }; -static const unsigned char _115[] PROGMEM = { -0, 31, 111, 1, 255, 2, 197, 1, 0, 2, 255, 1, 0, 2, 153, 1, 73, 1, 0, 1, 197, 1, 255, 2, 0, 5, 197, 1, 255, 1, 153, 1, 36, 1, 255, 1, 0, 2, 73, 1, 197, 1, 0, 1, 73, 1, 255, 3, 36, 1, 0, 18, }; -static const unsigned char _116[] PROGMEM = { -0, 10, 153, 1, 36, 1, 0, 1, 197, 1, 36, 1, 111, 1, 255, 2, 0, 1, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 1, 153, 1, 255, 1, 0, 9, }; -static const unsigned char _117[] PROGMEM = { -0, 31, 197, 1, 36, 1, 0, 1, 111, 2, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 1, 197, 1, 36, 1, 0, 1, 153, 1, 111, 1, 0, 1, 197, 1, 73, 1, 0, 1, 197, 1, 111, 1, 0, 1, 73, 1, 255, 2, 153, 1, 111, 1, 0, 18, }; -static const unsigned char _118[] PROGMEM = { -0, 30, 36, 1, 197, 1, 0, 2, 36, 1, 197, 1, 0, 1, 197, 1, 36, 1, 0, 1, 111, 2, 0, 1, 73, 1, 111, 1, 0, 1, 197, 1, 0, 3, 255, 1, 73, 1, 153, 1, 0, 3, 153, 2, 73, 1, 0, 3, 73, 1, 255, 1, 0, 20, }; -static const unsigned char _119[] PROGMEM = { -0, 51, 197, 1, 36, 1, 0, 1, 73, 1, 255, 1, 0, 2, 111, 2, 0, 1, 111, 2, 0, 1, 153, 1, 197, 1, 36, 1, 0, 1, 197, 1, 36, 1, 0, 1, 36, 1, 197, 1, 0, 1, 197, 1, 73, 1, 111, 1, 36, 1, 197, 1, 0, 3, 197, 1, 73, 1, 153, 1, 0, 1, 197, 1, 111, 2, 0, 3, 111, 1, 197, 1, 73, 1, 0, 1, 197, 1, 153, 1, 36, 1, 0, 3, 36, 1, 255, 1, 36, 1, 0, 1, 111, 1, 197, 1, 0, 32, }; -static const unsigned char _120[] PROGMEM = { -0, 30, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 197, 1, 0, 1, 73, 1, 197, 1, 73, 1, 255, 1, 0, 3, 111, 1, 255, 1, 36, 1, 0, 3, 197, 1, 255, 1, 111, 1, 0, 2, 111, 1, 153, 1, 0, 1, 255, 1, 36, 1, 111, 1, 255, 1, 0, 2, 73, 1, 255, 1, 0, 18, }; -static const unsigned char _121[] PROGMEM = { -0, 30, 73, 1, 197, 1, 0, 3, 255, 1, 0, 1, 197, 1, 73, 1, 0, 1, 111, 1, 153, 1, 0, 1, 111, 1, 153, 1, 0, 1, 197, 1, 36, 1, 0, 2, 255, 1, 36, 1, 197, 1, 0, 3, 153, 1, 197, 1, 73, 1, 0, 3, 36, 1, 255, 1, 0, 4, 111, 2, 0, 3, 255, 2, 0, 9, }; -static const unsigned char _122[] PROGMEM = { -0, 31, 153, 1, 255, 3, 197, 1, 0, 4, 153, 1, 36, 1, 0, 3, 153, 1, 73, 1, 0, 3, 111, 2, 0, 3, 73, 1, 153, 1, 0, 4, 255, 4, 197, 1, 0, 18, }; -static const unsigned char _14849714[] PROGMEM = { -0, 38, 36, 1, 0, 10, 197, 1, 73, 1, 0, 8, 73, 1, 255, 1, 197, 1, 0, 8, 197, 1, 255, 2, 73, 1, 0, 6, 73, 1, 255, 3, 197, 1, 0, 6, 197, 1, 255, 4, 73, 1, 0, 4, 73, 1, 255, 5, 197, 1, 0, 4, 197, 1, 255, 6, 111, 1, 0, 34, }; -static const unsigned char _14849724[] PROGMEM = { -0, 46, 197, 1, 255, 6, 111, 1, 0, 4, 255, 5, 153, 1, 0, 5, 111, 1, 255, 4, 36, 1, 0, 6, 255, 3, 153, 1, 0, 7, 111, 1, 255, 2, 36, 1, 0, 8, 255, 1, 153, 1, 0, 9, 111, 1, 36, 1, 0, 37, }; -static LATTICE lattice_array[] = { - {32, 3, _32}, - {33, 2, _33}, - {35, 6, _35}, - {37, 10, _37}, - {39, 2, _39}, - {40, 4, _40}, - {41, 4, _41}, - {43, 6, _43}, - {44, 3, _44}, - {45, 4, _45}, - {46, 3, _46}, - {47, 3, _47}, - {48, 6, _48}, - {49, 6, _49}, - {50, 6, _50}, - {51, 6, _51}, - {52, 6, _52}, - {53, 6, _53}, - {54, 6, _54}, - {55, 6, _55}, - {56, 6, _56}, - {57, 6, _57}, - {58, 3, _58}, - {59, 3, _59}, - {60, 6, _60}, - {61, 6, _61}, - {62, 6, _62}, - {63, 6, _63}, - {64, 11, _64}, - {65, 8, _65}, - {66, 7, _66}, - {67, 7, _67}, - {68, 7, _68}, - {69, 6, _69}, - {70, 6, _70}, - {71, 8, _71}, - {72, 7, _72}, - {73, 2, _73}, - {74, 5, _74}, - {75, 7, _75}, - {76, 6, _76}, - {77, 8, _77}, - {78, 7, _78}, - {79, 8, _79}, - {80, 6, _80}, - {81, 8, _81}, - {82, 7, _82}, - {83, 7, _83}, - {84, 6, _84}, - {85, 7, _85}, - {86, 8, _86}, - {87, 10, _87}, - {88, 7, _88}, - {89, 8, _89}, - {90, 7, _90}, - {91, 3, _91}, - {93, 3, _93}, - {95, 6, _95}, - {97, 6, _97}, - {98, 6, _98}, - {99, 6, _99}, - {100, 6, _100}, - {101, 6, _101}, - {102, 4, _102}, - {103, 6, _103}, - {104, 6, _104}, - {105, 2, _105}, - {106, 2, _106}, - {107, 5, _107}, - {108, 2, _108}, - {109, 8, _109}, - {110, 6, _110}, - {111, 6, _111}, - {112, 6, _112}, - {113, 6, _113}, - {114, 4, _114}, - {115, 6, _115}, - {116, 3, _116}, - {117, 6, _117}, - {118, 6, _118}, - {119, 10, _119}, - {120, 6, _120}, - {121, 6, _121}, - {122, 6, _122}, - {14849714, 11, _14849714}, - {14849724, 11, _14849724}, -}; -extern const LATTICE_FONT_INFO Arial_14_GL; -const LATTICE_FONT_INFO Arial_14_GL ={ - 14, - 86, - lattice_array -}; diff --git a/src/tft/Arial_19.cpp b/src/tft/Arial_19.cpp deleted file mode 100644 index df26c029..00000000 --- a/src/tft/Arial_19.cpp +++ /dev/null @@ -1,269 +0,0 @@ -#include "common.h" -#include "GuiLite.h" - -static const unsigned char _32[] PROGMEM = { -0, 95, }; -static const unsigned char _33[] PROGMEM = { -0, 17, 255, 1, 197, 1, 0, 3, 255, 1, 197, 1, 0, 3, 255, 1, 197, 1, 0, 3, 255, 1, 197, 1, 0, 3, 255, 1, 197, 1, 0, 3, 197, 1, 153, 1, 0, 3, 197, 1, 153, 1, 0, 3, 153, 1, 111, 1, 0, 3, 153, 1, 111, 1, 0, 3, 153, 1, 111, 1, 0, 8, 255, 1, 197, 1, 0, 21, }; -static const unsigned char _35[] PROGMEM = { -0, 30, 111, 2, 0, 2, 153, 1, 73, 1, 0, 3, 153, 1, 73, 1, 0, 2, 197, 1, 36, 1, 0, 3, 255, 1, 0, 2, 36, 1, 197, 1, 0, 3, 36, 1, 197, 1, 0, 2, 73, 1, 153, 1, 0, 1, 153, 1, 255, 8, 0, 2, 153, 1, 73, 1, 0, 2, 153, 1, 73, 1, 0, 3, 197, 1, 36, 1, 0, 2, 255, 1, 0, 4, 255, 1, 0, 2, 36, 1, 197, 1, 0, 2, 153, 1, 255, 8, 0, 1, 111, 2, 0, 2, 153, 1, 73, 1, 0, 3, 153, 1, 73, 1, 0, 2, 197, 1, 36, 1, 0, 3, 197, 1, 36, 1, 0, 2, 255, 1, 0, 39, }; -static const unsigned char _37[] PROGMEM = { -0, 47, 153, 1, 255, 2, 73, 1, 0, 4, 197, 1, 73, 1, 0, 4, 73, 1, 255, 1, 0, 1, 36, 1, 255, 1, 36, 1, 0, 2, 73, 1, 153, 1, 0, 5, 153, 1, 197, 1, 0, 2, 197, 1, 111, 1, 0, 2, 197, 1, 36, 1, 0, 5, 153, 2, 0, 2, 197, 1, 153, 1, 0, 1, 111, 2, 0, 6, 153, 2, 0, 2, 197, 1, 111, 1, 0, 1, 255, 1, 0, 7, 73, 1, 255, 1, 0, 1, 36, 1, 255, 1, 36, 1, 111, 2, 0, 1, 255, 3, 36, 1, 0, 3, 153, 1, 255, 2, 73, 1, 0, 1, 255, 1, 0, 1, 153, 1, 197, 1, 0, 1, 111, 1, 255, 1, 0, 7, 153, 1, 73, 1, 0, 1, 255, 1, 111, 1, 0, 1, 36, 1, 255, 1, 36, 1, 0, 5, 36, 1, 197, 1, 0, 2, 255, 1, 73, 1, 0, 1, 36, 1, 255, 1, 73, 1, 0, 5, 153, 1, 73, 1, 0, 2, 255, 1, 111, 1, 0, 1, 36, 1, 255, 1, 36, 1, 0, 4, 73, 1, 153, 1, 0, 3, 153, 1, 197, 1, 0, 1, 111, 1, 197, 1, 0, 5, 197, 1, 36, 1, 0, 4, 197, 1, 255, 2, 36, 1, 0, 61, }; -static const unsigned char _39[] PROGMEM = { -0, 10, 255, 1, 153, 1, 0, 1, 255, 1, 153, 1, 0, 1, 255, 1, 111, 1, 0, 1, 197, 1, 73, 1, 0, 36, }; -static const unsigned char _40[] PROGMEM = { -0, 22, 153, 2, 0, 3, 111, 1, 197, 1, 0, 4, 255, 1, 36, 1, 0, 3, 153, 1, 197, 1, 0, 4, 255, 1, 111, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 3, 111, 1, 255, 1, 36, 1, 0, 3, 111, 1, 255, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 3, 73, 1, 255, 1, 73, 1, 0, 4, 255, 1, 111, 1, 0, 4, 153, 1, 197, 1, 0, 5, 255, 1, 73, 1, 0, 4, 111, 1, 197, 1, 0, 5, 153, 2, 0, 6, }; -static const unsigned char _41[] PROGMEM = { -0, 19, 111, 1, 197, 1, 0, 5, 153, 2, 0, 4, 36, 1, 255, 1, 36, 1, 0, 4, 153, 1, 197, 1, 0, 4, 73, 1, 255, 1, 36, 1, 0, 3, 36, 1, 255, 1, 111, 1, 0, 4, 255, 1, 153, 1, 0, 4, 197, 1, 153, 1, 0, 4, 255, 1, 153, 1, 0, 3, 36, 1, 255, 1, 111, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 3, 153, 2, 0, 3, 36, 1, 255, 1, 36, 1, 0, 3, 153, 2, 0, 3, 111, 1, 197, 1, 0, 9, }; -static const unsigned char _43[] PROGMEM = { -0, 54, 73, 1, 255, 1, 36, 1, 0, 7, 73, 1, 255, 1, 36, 1, 0, 7, 73, 1, 255, 1, 36, 1, 0, 4, 153, 1, 255, 7, 111, 1, 0, 4, 73, 1, 255, 1, 36, 1, 0, 7, 73, 1, 255, 1, 36, 1, 0, 7, 73, 1, 255, 1, 36, 1, 0, 73, }; -static const unsigned char _44[] PROGMEM = { -0, 72, 255, 1, 153, 1, 0, 3, 36, 1, 153, 1, 0, 3, 111, 2, 0, 3, 197, 1, 0, 7, }; -static const unsigned char _45[] PROGMEM = { -0, 60, 36, 1, 255, 4, 197, 1, 0, 48, }; -static const unsigned char _46[] PROGMEM = { -0, 72, 255, 1, 153, 1, 0, 21, }; -static const unsigned char _47[] PROGMEM = { -0, 19, 255, 1, 0, 3, 73, 1, 153, 1, 0, 3, 153, 1, 73, 1, 0, 3, 255, 1, 0, 3, 73, 1, 153, 1, 0, 3, 153, 1, 111, 1, 0, 3, 197, 1, 36, 1, 0, 2, 36, 1, 197, 1, 0, 3, 111, 2, 0, 3, 197, 1, 36, 1, 0, 2, 36, 1, 197, 1, 0, 3, 111, 2, 0, 23, }; -static const unsigned char _48[] PROGMEM = { -0, 30, 255, 4, 0, 4, 255, 1, 153, 1, 0, 2, 153, 1, 255, 1, 0, 2, 111, 1, 255, 1, 0, 4, 255, 1, 111, 1, 0, 1, 197, 2, 0, 4, 197, 2, 0, 1, 197, 1, 153, 1, 0, 4, 153, 1, 197, 1, 0, 1, 255, 1, 153, 1, 0, 4, 153, 1, 255, 1, 0, 1, 255, 1, 153, 1, 0, 4, 153, 1, 255, 1, 0, 1, 197, 1, 153, 1, 0, 4, 153, 1, 197, 1, 0, 1, 197, 2, 0, 4, 197, 1, 153, 1, 0, 1, 111, 1, 255, 1, 0, 4, 255, 1, 111, 1, 0, 2, 255, 1, 153, 1, 0, 2, 153, 1, 255, 1, 0, 4, 255, 4, 0, 38, }; -static const unsigned char _49[] PROGMEM = { -0, 32, 197, 1, 73, 1, 0, 6, 153, 1, 255, 1, 73, 1, 0, 5, 255, 3, 73, 1, 0, 4, 197, 2, 36, 1, 255, 1, 73, 1, 0, 6, 36, 1, 255, 1, 73, 1, 0, 6, 36, 1, 255, 1, 73, 1, 0, 6, 36, 1, 255, 1, 73, 1, 0, 6, 36, 1, 255, 1, 73, 1, 0, 6, 36, 1, 255, 1, 73, 1, 0, 6, 36, 1, 255, 1, 73, 1, 0, 6, 36, 1, 255, 1, 73, 1, 0, 6, 36, 1, 255, 1, 73, 1, 0, 38, }; -static const unsigned char _50[] PROGMEM = { -0, 29, 36, 1, 255, 4, 0, 3, 36, 1, 255, 1, 197, 1, 0, 2, 255, 2, 0, 2, 153, 1, 255, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 1, 197, 1, 153, 1, 0, 3, 36, 1, 255, 1, 111, 1, 0, 6, 73, 1, 255, 1, 73, 1, 0, 5, 36, 1, 255, 1, 197, 1, 0, 6, 255, 2, 0, 5, 36, 1, 255, 1, 197, 1, 0, 5, 73, 1, 255, 1, 197, 1, 0, 5, 36, 1, 255, 1, 153, 1, 0, 6, 197, 2, 0, 6, 36, 1, 255, 7, 111, 1, 0, 36, }; -static const unsigned char _51[] PROGMEM = { -0, 29, 73, 1, 255, 3, 111, 1, 0, 3, 73, 1, 255, 1, 73, 1, 0, 2, 255, 1, 153, 1, 0, 2, 197, 1, 153, 1, 0, 3, 111, 1, 255, 1, 0, 7, 111, 1, 255, 1, 0, 6, 36, 1, 255, 1, 111, 1, 0, 5, 255, 2, 197, 1, 0, 8, 153, 1, 255, 1, 36, 1, 0, 6, 36, 1, 255, 1, 111, 1, 0, 7, 255, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 3, 36, 1, 255, 1, 111, 1, 0, 1, 111, 1, 255, 1, 0, 3, 153, 1, 197, 1, 0, 3, 73, 1, 255, 3, 197, 1, 0, 38, }; -static const unsigned char _52[] PROGMEM = { -0, 32, 73, 1, 255, 1, 36, 1, 0, 6, 255, 2, 36, 1, 0, 5, 153, 1, 255, 2, 36, 1, 0, 4, 36, 1, 255, 1, 111, 1, 255, 1, 36, 1, 0, 4, 197, 1, 111, 1, 73, 1, 255, 1, 36, 1, 0, 3, 111, 1, 197, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 2, 36, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 2, 197, 1, 111, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 1, 36, 1, 255, 7, 111, 1, 0, 5, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 37, }; -static const unsigned char _53[] PROGMEM = { -0, 29, 153, 1, 255, 5, 0, 3, 255, 1, 111, 1, 0, 6, 36, 1, 255, 1, 73, 1, 0, 6, 73, 1, 255, 1, 0, 7, 111, 1, 197, 1, 255, 3, 197, 1, 0, 3, 153, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 8, 255, 1, 111, 1, 0, 7, 255, 1, 153, 1, 0, 7, 255, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 1, 111, 1, 255, 1, 0, 3, 111, 1, 197, 1, 0, 3, 73, 1, 255, 3, 153, 1, 0, 38, }; -static const unsigned char _54[] PROGMEM = { -0, 30, 255, 4, 0, 4, 255, 1, 36, 1, 0, 2, 197, 1, 255, 1, 0, 2, 153, 1, 197, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 1, 255, 1, 111, 1, 0, 6, 36, 1, 255, 1, 73, 1, 153, 1, 255, 3, 0, 2, 36, 1, 255, 2, 111, 1, 0, 2, 111, 1, 255, 1, 0, 1, 36, 1, 255, 1, 197, 1, 0, 4, 255, 1, 111, 1, 36, 1, 255, 1, 111, 1, 0, 4, 255, 1, 153, 1, 0, 1, 255, 1, 111, 1, 0, 4, 255, 1, 153, 1, 0, 1, 197, 2, 0, 4, 255, 1, 73, 1, 0, 1, 36, 1, 255, 1, 73, 1, 0, 2, 111, 1, 197, 1, 0, 4, 255, 3, 197, 1, 0, 38, }; -static const unsigned char _55[] PROGMEM = { -0, 28, 197, 1, 255, 6, 153, 1, 0, 6, 153, 1, 255, 1, 36, 1, 0, 5, 73, 1, 255, 1, 111, 1, 0, 6, 197, 2, 0, 6, 73, 1, 255, 1, 73, 1, 0, 6, 153, 1, 255, 1, 0, 6, 36, 1, 255, 1, 111, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 153, 1, 255, 1, 0, 7, 197, 1, 153, 1, 0, 7, 255, 1, 111, 1, 0, 6, 36, 1, 255, 1, 111, 1, 0, 40, }; -static const unsigned char _56[] PROGMEM = { -0, 30, 255, 4, 0, 4, 255, 1, 153, 1, 0, 2, 153, 1, 255, 1, 0, 2, 111, 1, 255, 1, 36, 1, 0, 2, 36, 1, 255, 1, 111, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 2, 36, 1, 255, 1, 111, 1, 0, 2, 255, 1, 153, 1, 0, 2, 153, 1, 255, 1, 36, 1, 0, 3, 197, 1, 255, 2, 197, 1, 0, 3, 73, 1, 255, 1, 111, 1, 0, 2, 111, 1, 255, 1, 73, 1, 0, 1, 197, 2, 0, 4, 153, 1, 197, 1, 0, 1, 255, 1, 153, 1, 0, 4, 111, 1, 255, 1, 0, 1, 197, 2, 0, 4, 153, 1, 197, 1, 0, 1, 73, 1, 255, 1, 111, 1, 0, 2, 111, 1, 255, 1, 73, 1, 0, 2, 36, 1, 255, 4, 36, 1, 0, 37, }; -static const unsigned char _57[] PROGMEM = { -0, 29, 36, 1, 255, 3, 111, 1, 0, 3, 73, 1, 255, 1, 111, 1, 0, 2, 255, 1, 153, 1, 0, 2, 197, 2, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 255, 1, 153, 1, 0, 3, 36, 1, 255, 1, 111, 1, 0, 1, 255, 1, 111, 1, 0, 3, 36, 1, 255, 1, 111, 1, 0, 1, 197, 2, 0, 3, 73, 1, 255, 1, 153, 1, 0, 1, 73, 1, 255, 1, 111, 1, 0, 2, 255, 2, 153, 1, 0, 2, 73, 1, 255, 3, 36, 1, 197, 1, 111, 1, 0, 7, 255, 1, 73, 1, 0, 6, 73, 1, 255, 1, 0, 2, 153, 1, 255, 1, 0, 2, 36, 1, 255, 1, 111, 1, 0, 3, 197, 1, 255, 3, 73, 1, 0, 38, }; -static const unsigned char _58[] PROGMEM = { -0, 32, 255, 1, 153, 1, 0, 38, 255, 1, 153, 1, 0, 21, }; -static const unsigned char _59[] PROGMEM = { -0, 32, 255, 1, 153, 1, 0, 38, 255, 1, 153, 1, 0, 3, 36, 1, 153, 1, 0, 3, 111, 2, 0, 3, 197, 1, 0, 7, }; -static const unsigned char _60[] PROGMEM = { -0, 48, 153, 1, 73, 1, 0, 6, 153, 1, 255, 2, 73, 1, 0, 4, 153, 1, 255, 3, 36, 1, 0, 3, 153, 1, 255, 2, 111, 1, 0, 5, 153, 1, 255, 1, 0, 9, 153, 1, 255, 2, 111, 1, 0, 8, 153, 1, 255, 3, 36, 1, 0, 7, 153, 1, 255, 2, 73, 1, 0, 8, 153, 1, 73, 1, 0, 60, }; -static const unsigned char _61[] PROGMEM = { -0, 71, 153, 1, 255, 7, 73, 1, 0, 31, 153, 1, 255, 7, 73, 1, 0, 70, }; -static const unsigned char _62[] PROGMEM = { -0, 41, 153, 1, 73, 1, 0, 8, 153, 1, 255, 2, 73, 1, 0, 7, 111, 1, 255, 3, 73, 1, 0, 8, 197, 1, 255, 2, 73, 1, 0, 8, 73, 1, 255, 1, 73, 1, 0, 5, 197, 1, 255, 2, 73, 1, 0, 3, 111, 1, 255, 3, 73, 1, 0, 4, 153, 1, 255, 2, 73, 1, 0, 6, 153, 1, 73, 1, 0, 67, }; -static const unsigned char _63[] PROGMEM = { -0, 29, 36, 1, 255, 4, 0, 3, 36, 1, 255, 1, 111, 1, 0, 2, 197, 1, 255, 1, 0, 2, 153, 1, 197, 1, 0, 3, 36, 1, 255, 1, 111, 1, 0, 1, 255, 1, 153, 1, 0, 4, 255, 1, 153, 1, 0, 6, 36, 1, 255, 1, 111, 1, 0, 6, 197, 1, 255, 1, 0, 6, 197, 1, 255, 1, 36, 1, 0, 5, 153, 1, 255, 1, 36, 1, 0, 6, 255, 1, 153, 1, 0, 7, 255, 1, 111, 1, 0, 15, 73, 1, 255, 1, 111, 1, 0, 39, }; -static const unsigned char _64[] PROGMEM = { -0, 57, 153, 1, 255, 5, 73, 1, 0, 8, 111, 1, 255, 1, 153, 1, 0, 4, 36, 1, 255, 2, 36, 1, 0, 5, 153, 1, 255, 1, 0, 8, 111, 1, 255, 1, 0, 4, 73, 1, 255, 1, 0, 3, 255, 3, 36, 1, 197, 1, 153, 1, 0, 1, 153, 2, 0, 3, 197, 1, 111, 1, 0, 1, 36, 1, 255, 1, 111, 1, 0, 1, 36, 1, 255, 2, 111, 1, 0, 1, 36, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 0, 2, 197, 1, 153, 1, 0, 3, 111, 1, 255, 1, 73, 1, 0, 2, 255, 1, 73, 1, 0, 1, 111, 1, 153, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 3, 111, 1, 255, 1, 36, 1, 0, 2, 197, 1, 73, 1, 0, 1, 153, 1, 111, 1, 0, 1, 111, 1, 255, 1, 0, 4, 111, 1, 255, 1, 0, 3, 255, 1, 36, 1, 0, 1, 153, 1, 111, 1, 0, 1, 153, 1, 255, 1, 0, 4, 197, 1, 153, 1, 0, 2, 73, 1, 255, 1, 0, 2, 153, 1, 111, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 111, 1, 0, 2, 255, 1, 73, 1, 0, 2, 111, 1, 197, 1, 0, 2, 255, 1, 153, 1, 0, 1, 36, 1, 255, 2, 73, 1, 0, 1, 255, 1, 111, 1, 0, 3, 36, 1, 255, 1, 36, 1, 0, 1, 36, 1, 255, 2, 197, 1, 0, 1, 255, 3, 73, 1, 0, 5, 197, 1, 153, 1, 0, 10, 36, 1, 255, 1, 111, 1, 0, 3, 255, 1, 153, 1, 0, 9, 255, 1, 153, 1, 0, 5, 255, 2, 111, 1, 0, 5, 153, 1, 255, 1, 153, 1, 0, 8, 197, 1, 255, 5, 153, 1, 0, 4, }; -static const unsigned char _65[] PROGMEM = { -0, 37, 73, 1, 255, 2, 0, 8, 197, 1, 153, 1, 255, 1, 111, 1, 0, 6, 36, 1, 255, 1, 73, 1, 197, 2, 0, 6, 153, 1, 255, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 5, 255, 1, 153, 1, 0, 2, 255, 1, 153, 1, 0, 4, 73, 1, 255, 1, 73, 1, 0, 2, 153, 1, 255, 1, 0, 4, 197, 2, 0, 3, 73, 1, 255, 1, 73, 1, 0, 2, 36, 1, 255, 7, 197, 1, 0, 2, 153, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 255, 1, 153, 1, 0, 5, 36, 1, 255, 1, 153, 1, 73, 1, 255, 1, 73, 1, 0, 6, 153, 1, 255, 1, 197, 2, 0, 7, 73, 1, 255, 1, 0, 44, }; -static const unsigned char _66[] PROGMEM = { -0, 34, 73, 1, 255, 6, 153, 1, 0, 3, 73, 1, 255, 1, 73, 1, 0, 3, 36, 1, 255, 1, 153, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 4, 153, 1, 255, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 4, 153, 1, 197, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 3, 36, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 7, 73, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 4, 197, 1, 255, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 4, 73, 1, 255, 1, 73, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 4, 73, 1, 255, 1, 111, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 4, 73, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 4, 255, 1, 197, 1, 0, 2, 73, 1, 255, 6, 153, 1, 0, 46, }; -static const unsigned char _67[] PROGMEM = { -0, 40, 153, 1, 255, 4, 36, 1, 0, 4, 36, 1, 255, 1, 197, 1, 0, 3, 111, 1, 255, 1, 111, 1, 0, 3, 197, 2, 0, 5, 153, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 5, 36, 2, 0, 2, 153, 1, 255, 1, 36, 1, 0, 9, 153, 1, 255, 1, 0, 10, 153, 1, 255, 1, 0, 10, 111, 1, 255, 1, 36, 1, 0, 9, 73, 1, 255, 1, 73, 1, 0, 5, 36, 1, 255, 1, 153, 1, 0, 2, 197, 2, 0, 5, 111, 1, 255, 1, 36, 1, 0, 2, 36, 1, 255, 1, 197, 1, 0, 3, 111, 1, 255, 1, 111, 1, 0, 5, 197, 1, 255, 4, 36, 1, 0, 50, }; -static const unsigned char _68[] PROGMEM = { -0, 37, 73, 1, 255, 6, 197, 1, 0, 4, 73, 1, 255, 1, 73, 1, 0, 4, 197, 1, 255, 1, 0, 3, 73, 1, 255, 1, 73, 1, 0, 5, 255, 1, 153, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 5, 111, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 5, 73, 1, 255, 1, 73, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 5, 73, 1, 255, 1, 73, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 5, 73, 1, 255, 1, 73, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 5, 73, 1, 255, 1, 73, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 5, 153, 1, 255, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 5, 255, 1, 153, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 4, 255, 2, 0, 3, 73, 1, 255, 6, 153, 1, 0, 51, }; -static const unsigned char _69[] PROGMEM = { -0, 34, 73, 1, 255, 8, 36, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 7, 153, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 8, 111, 1, 0, 44, }; -static const unsigned char _70[] PROGMEM = { -0, 31, 73, 1, 255, 7, 73, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 7, 73, 1, 255, 1, 73, 1, 0, 7, 73, 1, 255, 1, 73, 1, 0, 7, 73, 1, 255, 1, 73, 1, 0, 7, 73, 1, 255, 6, 73, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 7, 73, 1, 255, 1, 73, 1, 0, 7, 73, 1, 255, 1, 73, 1, 0, 7, 73, 1, 255, 1, 73, 1, 0, 7, 73, 1, 255, 1, 73, 1, 0, 7, 73, 1, 255, 1, 73, 1, 0, 46, }; -static const unsigned char _71[] PROGMEM = { -0, 40, 197, 1, 255, 4, 36, 1, 0, 4, 36, 1, 255, 1, 197, 1, 0, 3, 111, 1, 255, 1, 111, 1, 0, 3, 255, 1, 197, 1, 0, 5, 111, 1, 255, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 5, 36, 1, 153, 1, 36, 1, 0, 1, 153, 1, 255, 1, 0, 10, 197, 2, 0, 10, 197, 2, 0, 3, 73, 1, 255, 4, 111, 1, 0, 1, 153, 1, 255, 1, 0, 6, 36, 1, 255, 1, 111, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 5, 36, 1, 255, 1, 111, 1, 0, 2, 255, 1, 153, 1, 0, 5, 36, 1, 255, 1, 111, 1, 0, 2, 36, 1, 255, 1, 197, 1, 0, 3, 73, 1, 255, 2, 36, 1, 0, 4, 153, 1, 255, 4, 73, 1, 0, 50, }; -static const unsigned char _72[] PROGMEM = { -0, 34, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 8, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 44, }; -static const unsigned char _73[] PROGMEM = { -0, 17, 255, 1, 153, 1, 0, 3, 255, 1, 153, 1, 0, 3, 255, 1, 153, 1, 0, 3, 255, 1, 153, 1, 0, 3, 255, 1, 153, 1, 0, 3, 255, 1, 153, 1, 0, 3, 255, 1, 153, 1, 0, 3, 255, 1, 153, 1, 0, 3, 255, 1, 153, 1, 0, 3, 255, 1, 153, 1, 0, 3, 255, 1, 153, 1, 0, 3, 255, 1, 153, 1, 0, 21, }; -static const unsigned char _74[] PROGMEM = { -0, 33, 197, 2, 0, 7, 197, 2, 0, 7, 197, 2, 0, 7, 197, 2, 0, 7, 197, 2, 0, 7, 197, 2, 0, 7, 197, 2, 0, 7, 197, 2, 0, 2, 255, 1, 111, 1, 0, 3, 197, 2, 0, 2, 255, 1, 153, 1, 0, 3, 197, 1, 153, 1, 0, 2, 111, 1, 255, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 3, 153, 1, 255, 3, 73, 1, 0, 38, }; -static const unsigned char _75[] PROGMEM = { -0, 34, 73, 1, 255, 1, 73, 1, 0, 4, 36, 1, 255, 2, 0, 1, 73, 1, 255, 1, 73, 1, 0, 3, 36, 1, 255, 1, 153, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 2, 36, 1, 255, 1, 111, 1, 0, 3, 73, 1, 255, 1, 73, 1, 0, 1, 36, 1, 255, 1, 111, 1, 0, 4, 73, 1, 255, 1, 73, 1, 0, 1, 255, 1, 111, 1, 0, 5, 73, 1, 255, 1, 73, 1, 255, 2, 197, 1, 0, 5, 73, 1, 255, 2, 111, 2, 255, 1, 153, 1, 0, 4, 73, 1, 255, 1, 153, 1, 0, 2, 197, 1, 255, 1, 73, 1, 0, 3, 73, 1, 255, 1, 73, 1, 0, 2, 36, 1, 255, 2, 0, 3, 73, 1, 255, 1, 73, 1, 0, 3, 111, 1, 255, 1, 153, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 4, 153, 1, 255, 1, 73, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 5, 255, 2, 0, 44, }; -static const unsigned char _76[] PROGMEM = { -0, 28, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 6, 197, 1, 0, 36, }; -static const unsigned char _77[] PROGMEM = { -0, 40, 153, 1, 255, 1, 197, 1, 0, 5, 36, 1, 255, 2, 0, 2, 153, 1, 255, 2, 36, 1, 0, 4, 73, 1, 255, 2, 0, 2, 153, 1, 255, 1, 153, 1, 73, 1, 0, 4, 153, 2, 255, 1, 0, 2, 153, 1, 255, 1, 73, 1, 153, 1, 0, 4, 255, 1, 73, 1, 255, 1, 0, 2, 153, 1, 255, 1, 0, 1, 255, 1, 0, 3, 73, 1, 153, 1, 73, 1, 255, 1, 0, 2, 153, 1, 255, 1, 0, 1, 197, 1, 73, 1, 0, 2, 153, 1, 111, 1, 73, 1, 255, 1, 0, 2, 153, 1, 255, 1, 0, 1, 111, 1, 153, 1, 0, 2, 255, 1, 36, 1, 73, 1, 255, 1, 0, 2, 153, 1, 255, 1, 0, 1, 36, 1, 255, 1, 0, 1, 73, 1, 197, 1, 0, 1, 73, 1, 255, 1, 0, 2, 153, 1, 255, 1, 0, 2, 197, 1, 73, 1, 153, 1, 111, 1, 0, 1, 73, 1, 255, 1, 0, 2, 153, 1, 255, 1, 0, 2, 153, 1, 111, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 0, 2, 153, 1, 255, 1, 0, 2, 73, 1, 255, 1, 197, 1, 0, 2, 73, 1, 255, 1, 0, 2, 153, 1, 255, 1, 0, 3, 255, 1, 153, 1, 0, 2, 73, 1, 255, 1, 0, 53, }; -static const unsigned char _78[] PROGMEM = { -0, 34, 111, 1, 255, 1, 111, 1, 0, 4, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 2, 0, 4, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 153, 1, 111, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 1, 153, 2, 0, 2, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 2, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 2, 111, 1, 197, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 255, 1, 73, 2, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 197, 1, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 4, 197, 2, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 4, 73, 1, 255, 2, 36, 1, 0, 1, 111, 1, 255, 1, 0, 5, 153, 1, 255, 1, 36, 1, 0, 44, }; -static const unsigned char _79[] PROGMEM = { -0, 40, 255, 4, 153, 1, 0, 5, 73, 1, 255, 1, 153, 1, 0, 3, 255, 2, 0, 4, 255, 1, 153, 1, 0, 5, 255, 1, 153, 1, 0, 2, 111, 1, 255, 1, 36, 1, 0, 5, 111, 1, 255, 1, 36, 1, 0, 1, 153, 1, 255, 1, 0, 6, 73, 1, 255, 1, 73, 1, 0, 1, 197, 2, 0, 6, 36, 1, 255, 1, 111, 1, 0, 1, 197, 2, 0, 6, 36, 1, 255, 1, 111, 1, 0, 1, 153, 1, 255, 1, 0, 6, 73, 1, 255, 1, 73, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 5, 111, 1, 255, 1, 36, 1, 0, 2, 255, 1, 153, 1, 0, 5, 255, 1, 153, 1, 0, 3, 36, 1, 255, 1, 153, 1, 0, 3, 255, 2, 0, 6, 197, 1, 255, 3, 111, 1, 0, 51, }; -static const unsigned char _80[] PROGMEM = { -0, 34, 73, 1, 255, 7, 36, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 4, 153, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 4, 36, 1, 255, 1, 111, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 5, 255, 1, 153, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 4, 36, 1, 255, 1, 111, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 4, 197, 1, 255, 1, 0, 2, 73, 1, 255, 7, 0, 3, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 1, 73, 1, 0, 8, 73, 1, 255, 1, 73, 1, 0, 51, }; -static const unsigned char _81[] PROGMEM = { -0, 40, 255, 4, 111, 1, 0, 5, 111, 1, 255, 1, 111, 1, 0, 3, 255, 2, 0, 3, 36, 1, 255, 1, 111, 1, 0, 5, 255, 1, 153, 1, 0, 2, 153, 1, 255, 1, 0, 6, 111, 1, 255, 1, 36, 1, 0, 1, 255, 1, 153, 1, 0, 6, 36, 1, 255, 1, 111, 1, 0, 1, 255, 1, 153, 1, 0, 6, 36, 1, 255, 1, 111, 1, 0, 1, 255, 1, 153, 1, 0, 6, 36, 1, 255, 1, 111, 1, 0, 1, 255, 1, 153, 1, 0, 6, 36, 1, 255, 1, 111, 1, 0, 1, 153, 1, 255, 1, 0, 6, 111, 1, 255, 1, 36, 1, 0, 1, 36, 1, 255, 1, 111, 1, 0, 2, 111, 1, 255, 1, 36, 1, 255, 1, 197, 1, 0, 3, 111, 1, 255, 1, 111, 1, 0, 2, 111, 1, 255, 2, 36, 1, 0, 5, 255, 7, 73, 1, 0, 10, 73, 1, 111, 1, 0, 36, }; -static const unsigned char _82[] PROGMEM = { -0, 34, 111, 1, 255, 6, 197, 1, 0, 3, 111, 1, 255, 1, 36, 1, 0, 3, 36, 1, 255, 1, 153, 1, 0, 2, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 153, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 3, 36, 1, 255, 1, 153, 1, 0, 2, 111, 1, 255, 6, 153, 1, 0, 3, 111, 1, 255, 1, 36, 1, 0, 2, 153, 1, 255, 1, 36, 1, 0, 3, 111, 1, 255, 1, 36, 1, 0, 3, 197, 1, 255, 1, 0, 3, 111, 1, 255, 1, 36, 1, 0, 3, 36, 1, 255, 1, 153, 1, 0, 2, 111, 1, 255, 1, 36, 1, 0, 4, 153, 1, 255, 1, 73, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 5, 255, 2, 0, 44, }; -static const unsigned char _83[] PROGMEM = { -0, 36, 153, 1, 255, 4, 73, 1, 0, 4, 255, 1, 197, 1, 0, 3, 73, 1, 255, 1, 111, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 4, 153, 1, 255, 1, 0, 2, 111, 1, 255, 1, 36, 1, 0, 9, 255, 2, 36, 1, 0, 9, 255, 4, 111, 1, 0, 9, 153, 1, 255, 2, 111, 1, 0, 9, 111, 1, 255, 1, 73, 1, 0, 1, 197, 1, 153, 1, 0, 6, 255, 1, 111, 1, 0, 1, 153, 1, 255, 1, 0, 5, 36, 1, 255, 1, 73, 1, 0, 2, 255, 2, 36, 1, 0, 3, 255, 1, 197, 1, 0, 4, 153, 1, 255, 4, 111, 1, 0, 46, }; -static const unsigned char _84[] PROGMEM = { -0, 27, 255, 9, 0, 4, 255, 1, 153, 1, 0, 7, 255, 1, 153, 1, 0, 7, 255, 1, 153, 1, 0, 7, 255, 1, 153, 1, 0, 7, 255, 1, 153, 1, 0, 7, 255, 1, 153, 1, 0, 7, 255, 1, 153, 1, 0, 7, 255, 1, 153, 1, 0, 7, 255, 1, 153, 1, 0, 7, 255, 1, 153, 1, 0, 7, 255, 1, 153, 1, 0, 39, }; -static const unsigned char _85[] PROGMEM = { -0, 34, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 4, 111, 1, 255, 1, 36, 1, 0, 1, 36, 1, 255, 1, 73, 1, 0, 4, 153, 1, 197, 1, 0, 3, 153, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 73, 1, 0, 4, 111, 1, 255, 4, 36, 1, 0, 46, }; -static const unsigned char _86[] PROGMEM = { -0, 33, 111, 1, 255, 1, 73, 1, 0, 6, 111, 1, 255, 1, 0, 1, 255, 1, 153, 1, 0, 6, 197, 1, 153, 1, 0, 1, 153, 1, 255, 1, 0, 5, 73, 1, 255, 1, 73, 1, 0, 1, 36, 1, 255, 1, 73, 1, 0, 4, 153, 1, 197, 1, 0, 3, 197, 1, 153, 1, 0, 4, 255, 1, 111, 1, 0, 3, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 2, 153, 2, 0, 5, 153, 2, 0, 1, 36, 1, 255, 1, 73, 1, 0, 5, 73, 1, 255, 1, 36, 1, 111, 1, 255, 1, 0, 7, 255, 1, 111, 1, 197, 1, 111, 1, 0, 7, 111, 1, 255, 2, 36, 1, 0, 7, 36, 1, 255, 1, 197, 1, 0, 48, }; -static const unsigned char _87[] PROGMEM = { -0, 51, 73, 1, 255, 1, 73, 1, 0, 4, 73, 1, 255, 2, 0, 5, 153, 1, 255, 1, 0, 1, 255, 1, 153, 1, 0, 4, 153, 1, 255, 2, 73, 1, 0, 4, 255, 1, 153, 1, 0, 1, 197, 2, 0, 4, 255, 1, 111, 1, 197, 1, 153, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 2, 36, 1, 255, 1, 73, 1, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 36, 1, 0, 1, 36, 1, 255, 1, 73, 1, 0, 2, 111, 1, 255, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 2, 197, 2, 0, 3, 197, 1, 153, 1, 0, 2, 197, 1, 153, 1, 0, 2, 255, 1, 111, 1, 0, 2, 255, 1, 111, 1, 0, 3, 153, 1, 197, 1, 0, 1, 36, 1, 255, 1, 73, 1, 0, 2, 153, 1, 197, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 3, 73, 1, 255, 1, 36, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 111, 1, 255, 1, 0, 5, 255, 1, 73, 1, 153, 1, 197, 1, 0, 4, 255, 1, 73, 1, 197, 1, 153, 1, 0, 5, 197, 1, 153, 1, 255, 1, 111, 1, 0, 4, 197, 1, 153, 1, 255, 1, 73, 1, 0, 5, 111, 1, 255, 2, 36, 1, 0, 4, 111, 1, 255, 2, 0, 6, 36, 1, 255, 1, 197, 1, 0, 5, 36, 1, 255, 1, 153, 1, 0, 71, }; -static const unsigned char _88[] PROGMEM = { -0, 34, 197, 1, 255, 1, 36, 1, 0, 4, 36, 1, 255, 1, 197, 1, 0, 2, 255, 1, 197, 1, 0, 4, 197, 2, 0, 3, 73, 1, 255, 1, 111, 1, 0, 2, 111, 1, 255, 1, 36, 1, 0, 4, 153, 1, 255, 1, 36, 2, 255, 1, 73, 1, 0, 6, 197, 1, 153, 1, 197, 1, 153, 1, 0, 7, 36, 1, 255, 1, 197, 1, 0, 8, 111, 1, 255, 2, 73, 1, 0, 6, 73, 1, 255, 1, 73, 1, 153, 1, 255, 1, 36, 1, 0, 5, 255, 1, 153, 1, 0, 2, 255, 1, 197, 1, 0, 4, 197, 1, 255, 1, 0, 3, 73, 1, 255, 1, 111, 1, 0, 2, 111, 1, 255, 1, 73, 1, 0, 4, 153, 1, 255, 1, 36, 1, 111, 1, 255, 1, 153, 1, 0, 6, 255, 2, 0, 44, }; -static const unsigned char _89[] PROGMEM = { -0, 33, 111, 1, 255, 1, 153, 1, 0, 5, 36, 1, 255, 2, 0, 1, 153, 1, 255, 1, 73, 1, 0, 4, 153, 1, 255, 1, 36, 1, 0, 2, 255, 2, 0, 3, 73, 1, 255, 1, 111, 1, 0, 3, 73, 1, 255, 1, 153, 1, 0, 2, 197, 2, 0, 5, 153, 1, 255, 1, 36, 1, 111, 1, 255, 1, 36, 1, 0, 6, 255, 3, 111, 1, 0, 7, 73, 1, 255, 1, 197, 1, 0, 8, 36, 1, 255, 1, 111, 1, 0, 8, 36, 1, 255, 1, 111, 1, 0, 8, 36, 1, 255, 1, 111, 1, 0, 8, 36, 1, 255, 1, 111, 1, 0, 8, 36, 1, 255, 1, 111, 1, 0, 48, }; -static const unsigned char _90[] PROGMEM = { -0, 28, 153, 1, 255, 6, 197, 1, 0, 6, 73, 1, 255, 1, 111, 1, 0, 6, 255, 1, 197, 1, 0, 6, 111, 1, 255, 1, 36, 1, 0, 5, 36, 1, 255, 1, 111, 1, 0, 6, 197, 2, 0, 6, 111, 1, 255, 1, 36, 1, 0, 5, 36, 1, 255, 1, 111, 1, 0, 6, 197, 2, 0, 6, 73, 1, 255, 1, 73, 1, 0, 6, 255, 1, 153, 1, 0, 6, 73, 1, 255, 8, 0, 36, }; -static const unsigned char _91[] PROGMEM = { -0, 16, 111, 1, 255, 2, 153, 1, 0, 1, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 3, 111, 1, 255, 2, 153, 1, 0, 5, }; -static const unsigned char _93[] PROGMEM = { -0, 16, 255, 3, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 1, 255, 3, 36, 1, 0, 5, }; -static const unsigned char _95[] PROGMEM = { -0, 153, 197, 1, 255, 8, 0, 9, }; -static const unsigned char _97[] PROGMEM = { -0, 56, 73, 1, 255, 4, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 111, 1, 255, 1, 0, 2, 197, 1, 153, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 4, 111, 1, 255, 3, 73, 1, 0, 1, 73, 1, 255, 3, 73, 1, 36, 1, 255, 1, 73, 1, 0, 1, 255, 1, 197, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 1, 255, 1, 111, 1, 0, 3, 111, 1, 255, 1, 73, 1, 0, 1, 197, 1, 255, 1, 0, 2, 36, 1, 255, 2, 73, 1, 0, 2, 255, 4, 36, 1, 255, 1, 111, 1, 0, 36, }; -static const unsigned char _98[] PROGMEM = { -0, 28, 153, 1, 197, 1, 0, 7, 153, 1, 197, 1, 0, 7, 153, 1, 197, 1, 0, 7, 153, 1, 197, 1, 153, 1, 255, 2, 197, 1, 0, 3, 153, 1, 255, 1, 153, 1, 0, 2, 197, 2, 0, 2, 153, 1, 255, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 1, 153, 2, 0, 4, 197, 1, 153, 1, 0, 1, 153, 2, 0, 4, 197, 1, 153, 1, 0, 1, 153, 2, 0, 4, 255, 1, 111, 1, 0, 1, 153, 1, 197, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 1, 153, 1, 255, 1, 111, 1, 0, 2, 197, 2, 0, 2, 153, 3, 255, 2, 197, 1, 0, 38, }; -static const unsigned char _99[] PROGMEM = { -0, 56, 36, 1, 255, 3, 111, 1, 0, 3, 36, 1, 255, 1, 111, 1, 0, 1, 36, 1, 255, 1, 73, 1, 0, 2, 153, 1, 255, 1, 0, 3, 153, 1, 197, 1, 0, 2, 197, 1, 153, 1, 0, 7, 197, 1, 153, 1, 0, 7, 197, 1, 153, 1, 0, 7, 153, 1, 255, 1, 0, 3, 111, 1, 255, 1, 0, 2, 36, 1, 255, 1, 111, 1, 0, 2, 255, 1, 111, 1, 0, 3, 36, 1, 255, 3, 111, 1, 0, 38, }; -static const unsigned char _100[] PROGMEM = { -0, 33, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 3, 111, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 1, 36, 1, 255, 2, 36, 1, 0, 1, 197, 1, 153, 1, 0, 3, 73, 1, 255, 1, 36, 2, 255, 1, 111, 1, 0, 3, 36, 1, 255, 1, 36, 2, 255, 1, 73, 1, 0, 3, 36, 1, 255, 1, 36, 2, 255, 1, 111, 1, 0, 3, 36, 1, 255, 1, 36, 1, 0, 1, 197, 1, 153, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 111, 1, 0, 2, 255, 2, 36, 1, 0, 2, 73, 1, 255, 3, 111, 1, 255, 1, 36, 1, 0, 36, }; -static const unsigned char _101[] PROGMEM = { -0, 56, 36, 1, 255, 3, 197, 1, 0, 3, 36, 1, 255, 1, 111, 1, 0, 2, 197, 2, 0, 2, 197, 2, 0, 3, 36, 1, 255, 1, 73, 1, 0, 1, 255, 1, 111, 1, 0, 4, 197, 1, 153, 1, 36, 1, 255, 7, 153, 1, 0, 1, 255, 1, 111, 1, 0, 7, 197, 2, 0, 4, 255, 1, 111, 1, 0, 1, 73, 1, 255, 1, 111, 1, 0, 2, 153, 1, 255, 1, 0, 3, 36, 1, 255, 4, 0, 38, }; -static const unsigned char _102[] PROGMEM = { -0, 17, 73, 1, 255, 2, 0, 2, 197, 1, 153, 1, 0, 3, 255, 1, 111, 1, 0, 1, 73, 1, 255, 4, 0, 2, 255, 1, 111, 1, 0, 3, 255, 1, 111, 1, 0, 3, 255, 1, 111, 1, 0, 3, 255, 1, 111, 1, 0, 3, 255, 1, 111, 1, 0, 3, 255, 1, 111, 1, 0, 3, 255, 1, 111, 1, 0, 3, 255, 1, 111, 1, 0, 21, }; -static const unsigned char _103[] PROGMEM = { -0, 56, 73, 1, 255, 3, 73, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 1, 36, 1, 255, 2, 36, 1, 0, 1, 197, 1, 153, 1, 0, 3, 111, 1, 255, 1, 36, 2, 255, 1, 111, 1, 0, 3, 73, 1, 255, 1, 36, 2, 255, 1, 73, 1, 0, 3, 36, 1, 255, 1, 36, 2, 255, 1, 111, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 197, 1, 153, 1, 0, 3, 111, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 1, 36, 1, 255, 2, 36, 1, 0, 2, 73, 1, 255, 3, 111, 1, 255, 1, 36, 1, 0, 6, 73, 1, 255, 1, 0, 2, 255, 1, 153, 1, 0, 3, 255, 1, 153, 1, 0, 2, 36, 1, 255, 4, 111, 1, 0, 11, }; -static const unsigned char _104[] PROGMEM = { -0, 28, 111, 1, 255, 1, 0, 7, 111, 1, 255, 1, 0, 7, 111, 1, 255, 1, 0, 7, 111, 1, 255, 1, 111, 1, 255, 3, 36, 1, 0, 2, 111, 1, 255, 1, 153, 1, 0, 2, 153, 1, 255, 1, 0, 2, 111, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 36, }; -static const unsigned char _105[] PROGMEM = { -0, 13, 73, 1, 255, 1, 36, 1, 0, 9, 73, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 16, }; -static const unsigned char _106[] PROGMEM = { -0, 10, 255, 1, 111, 1, 0, 7, 255, 1, 111, 1, 0, 1, 255, 1, 111, 1, 0, 1, 255, 1, 111, 1, 0, 1, 255, 1, 111, 1, 0, 1, 255, 1, 111, 1, 0, 1, 255, 1, 111, 1, 0, 1, 255, 1, 111, 1, 0, 1, 255, 1, 111, 1, 0, 1, 255, 1, 111, 1, 0, 1, 255, 1, 111, 1, 36, 1, 255, 1, 73, 1, 255, 1, 197, 1, 0, 4, }; -static const unsigned char _107[] PROGMEM = { -0, 25, 197, 1, 153, 1, 0, 6, 197, 1, 153, 1, 0, 6, 197, 1, 153, 1, 0, 6, 197, 1, 153, 1, 0, 2, 73, 1, 255, 1, 197, 1, 0, 1, 197, 1, 153, 1, 0, 2, 255, 1, 153, 1, 0, 2, 197, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 3, 197, 1, 153, 2, 255, 1, 0, 4, 197, 1, 255, 1, 111, 1, 255, 1, 111, 1, 0, 3, 197, 2, 0, 1, 153, 1, 255, 1, 36, 1, 0, 2, 197, 1, 153, 1, 0, 2, 255, 1, 153, 1, 0, 2, 197, 1, 153, 1, 0, 2, 111, 1, 255, 1, 73, 1, 0, 1, 197, 1, 153, 1, 0, 3, 197, 1, 255, 1, 0, 32, }; -static const unsigned char _108[] PROGMEM = { -0, 10, 197, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 1, 197, 1, 153, 1, 0, 12, }; -static const unsigned char _109[] PROGMEM = { -0, 79, 197, 1, 153, 2, 255, 2, 153, 1, 0, 1, 255, 3, 111, 1, 0, 2, 197, 1, 255, 1, 73, 1, 0, 1, 73, 1, 255, 2, 36, 1, 0, 1, 111, 1, 255, 1, 36, 1, 0, 1, 197, 2, 0, 3, 255, 1, 153, 1, 0, 2, 36, 1, 255, 1, 73, 1, 0, 1, 197, 1, 153, 1, 0, 3, 255, 1, 111, 1, 0, 2, 36, 1, 255, 1, 73, 1, 0, 1, 197, 1, 153, 1, 0, 3, 255, 1, 111, 1, 0, 2, 36, 1, 255, 1, 73, 1, 0, 1, 197, 1, 153, 1, 0, 3, 255, 1, 111, 1, 0, 2, 36, 1, 255, 1, 73, 1, 0, 1, 197, 1, 153, 1, 0, 3, 255, 1, 111, 1, 0, 2, 36, 1, 255, 1, 73, 1, 0, 1, 197, 1, 153, 1, 0, 3, 255, 1, 111, 1, 0, 2, 36, 1, 255, 1, 73, 1, 0, 1, 197, 1, 153, 1, 0, 3, 255, 1, 111, 1, 0, 2, 36, 1, 255, 1, 73, 1, 0, 52, }; -static const unsigned char _110[] PROGMEM = { -0, 55, 111, 1, 197, 1, 73, 1, 255, 3, 36, 1, 0, 2, 111, 1, 255, 1, 153, 1, 0, 2, 153, 1, 255, 1, 0, 2, 111, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 36, }; -static const unsigned char _111[] PROGMEM = { -0, 56, 36, 1, 255, 3, 197, 1, 0, 3, 73, 1, 255, 1, 111, 1, 0, 2, 197, 2, 0, 2, 197, 2, 0, 3, 36, 1, 255, 1, 111, 1, 0, 1, 255, 1, 111, 1, 0, 4, 197, 1, 153, 1, 0, 1, 255, 1, 111, 1, 0, 4, 197, 1, 153, 1, 0, 1, 255, 1, 111, 1, 0, 4, 255, 1, 153, 1, 0, 1, 197, 2, 0, 3, 36, 1, 255, 1, 111, 1, 0, 1, 73, 1, 255, 1, 111, 1, 0, 2, 197, 1, 255, 1, 0, 3, 36, 1, 255, 3, 197, 1, 0, 38, }; -static const unsigned char _112[] PROGMEM = { -0, 55, 153, 3, 255, 2, 197, 1, 0, 3, 153, 1, 255, 1, 153, 1, 0, 2, 197, 2, 0, 2, 153, 1, 255, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 1, 153, 2, 0, 4, 255, 1, 111, 1, 0, 1, 153, 2, 0, 4, 255, 1, 153, 1, 0, 1, 153, 2, 0, 4, 255, 1, 111, 1, 0, 1, 153, 1, 197, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 1, 153, 1, 255, 1, 111, 1, 0, 2, 255, 1, 197, 1, 0, 2, 153, 1, 197, 2, 255, 2, 153, 1, 0, 3, 153, 1, 197, 1, 0, 7, 153, 1, 197, 1, 0, 7, 153, 1, 197, 1, 0, 15, }; -static const unsigned char _113[] PROGMEM = { -0, 56, 73, 1, 255, 3, 73, 1, 255, 1, 73, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 1, 36, 1, 255, 2, 73, 1, 0, 1, 197, 1, 153, 1, 0, 3, 111, 1, 255, 1, 73, 1, 0, 1, 255, 1, 111, 1, 0, 3, 36, 1, 255, 1, 73, 1, 36, 1, 255, 1, 111, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 1, 255, 1, 111, 1, 0, 3, 36, 1, 255, 1, 73, 1, 0, 1, 197, 2, 0, 3, 111, 1, 255, 1, 73, 1, 0, 1, 36, 1, 255, 1, 111, 1, 0, 1, 36, 1, 255, 2, 73, 1, 0, 2, 36, 1, 255, 3, 111, 1, 255, 1, 73, 1, 0, 6, 36, 1, 255, 1, 73, 1, 0, 6, 36, 1, 255, 1, 73, 1, 0, 6, 36, 1, 255, 1, 73, 1, 0, 9, }; -static const unsigned char _114[] PROGMEM = { -0, 37, 73, 1, 255, 1, 111, 1, 255, 2, 0, 1, 73, 1, 255, 1, 197, 1, 0, 3, 73, 1, 255, 1, 73, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 26, }; -static const unsigned char _115[] PROGMEM = { -0, 50, 255, 4, 73, 1, 0, 2, 197, 1, 153, 1, 0, 2, 111, 1, 255, 1, 36, 1, 0, 1, 255, 1, 73, 1, 0, 6, 197, 1, 255, 1, 153, 1, 0, 6, 111, 1, 255, 3, 153, 1, 0, 6, 111, 1, 255, 1, 153, 1, 0, 6, 197, 1, 153, 1, 0, 1, 255, 1, 111, 1, 0, 2, 36, 1, 255, 1, 111, 1, 0, 1, 36, 1, 255, 4, 111, 1, 0, 33, }; -static const unsigned char _116[] PROGMEM = { -0, 13, 36, 1, 197, 1, 0, 2, 153, 1, 197, 1, 0, 2, 153, 1, 197, 1, 0, 1, 197, 1, 255, 3, 0, 1, 153, 1, 197, 1, 0, 2, 153, 1, 197, 1, 0, 2, 153, 1, 197, 1, 0, 2, 153, 1, 197, 1, 0, 2, 153, 1, 197, 1, 0, 2, 153, 1, 197, 1, 0, 2, 153, 1, 197, 1, 0, 2, 36, 1, 255, 2, 0, 16, }; -static const unsigned char _117[] PROGMEM = { -0, 55, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 73, 1, 255, 1, 36, 1, 0, 1, 111, 1, 255, 1, 0, 3, 111, 1, 255, 1, 36, 1, 0, 1, 73, 1, 255, 1, 73, 1, 0, 2, 255, 2, 36, 1, 0, 2, 111, 1, 255, 3, 36, 1, 255, 1, 36, 1, 0, 36, }; -static const unsigned char _118[] PROGMEM = { -0, 42, 255, 1, 111, 1, 0, 4, 197, 1, 153, 1, 255, 1, 0, 3, 36, 1, 255, 1, 36, 1, 255, 1, 73, 1, 0, 2, 111, 1, 255, 1, 0, 1, 197, 1, 153, 1, 0, 2, 197, 1, 153, 1, 0, 1, 111, 1, 255, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 1, 36, 1, 255, 1, 73, 1, 153, 1, 197, 1, 0, 3, 197, 1, 153, 1, 255, 1, 111, 1, 0, 3, 73, 1, 255, 2, 36, 1, 0, 4, 255, 1, 197, 1, 0, 30, }; -static const unsigned char _119[] PROGMEM = { -0, 66, 111, 1, 255, 1, 0, 3, 255, 1, 197, 1, 0, 2, 73, 1, 255, 1, 36, 1, 255, 1, 73, 1, 0, 1, 36, 1, 255, 2, 0, 2, 111, 1, 197, 1, 0, 1, 255, 1, 111, 1, 0, 1, 73, 1, 153, 1, 255, 1, 36, 1, 0, 1, 197, 1, 111, 1, 0, 1, 153, 1, 197, 1, 0, 1, 153, 1, 111, 1, 197, 1, 73, 1, 0, 1, 255, 1, 73, 1, 0, 1, 73, 1, 255, 1, 0, 1, 197, 1, 73, 1, 153, 2, 73, 1, 255, 1, 0, 2, 36, 1, 255, 1, 36, 1, 255, 1, 36, 1, 111, 1, 197, 1, 111, 1, 153, 1, 0, 3, 197, 3, 0, 1, 36, 1, 255, 1, 197, 1, 111, 1, 0, 3, 153, 1, 255, 1, 153, 1, 0, 2, 255, 2, 36, 1, 0, 3, 73, 1, 255, 1, 111, 1, 0, 2, 197, 1, 255, 1, 0, 46, }; -static const unsigned char _120[] PROGMEM = { -0, 42, 36, 1, 255, 1, 111, 1, 0, 2, 153, 1, 197, 1, 0, 1, 111, 1, 255, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 2, 255, 1, 111, 1, 197, 1, 111, 1, 0, 3, 73, 1, 255, 2, 0, 5, 255, 1, 153, 1, 0, 4, 111, 1, 255, 2, 73, 1, 0, 2, 36, 1, 255, 1, 73, 1, 153, 1, 197, 1, 0, 2, 153, 2, 0, 2, 255, 1, 73, 2, 255, 1, 36, 1, 0, 2, 111, 1, 255, 1, 0, 28, }; -static const unsigned char _121[] PROGMEM = { -0, 54, 36, 1, 255, 1, 111, 1, 0, 4, 153, 1, 255, 1, 0, 1, 197, 2, 0, 4, 255, 1, 111, 1, 0, 1, 73, 1, 255, 1, 36, 1, 0, 2, 73, 1, 255, 1, 36, 1, 0, 2, 255, 1, 153, 1, 0, 2, 153, 2, 0, 3, 111, 1, 255, 1, 0, 1, 36, 1, 255, 1, 73, 1, 0, 3, 36, 1, 255, 1, 73, 1, 111, 1, 197, 1, 0, 5, 197, 1, 153, 1, 197, 1, 111, 1, 0, 5, 73, 1, 255, 2, 36, 1, 0, 6, 255, 1, 153, 1, 0, 7, 255, 1, 73, 1, 0, 6, 111, 1, 197, 1, 0, 5, 153, 1, 255, 2, 0, 14, }; -static const unsigned char _122[] PROGMEM = { -0, 49, 255, 6, 153, 1, 0, 5, 111, 1, 255, 1, 36, 1, 0, 4, 73, 1, 255, 1, 111, 1, 0, 5, 255, 1, 153, 1, 0, 5, 197, 1, 255, 1, 0, 5, 111, 1, 255, 1, 73, 1, 0, 4, 73, 1, 255, 1, 111, 1, 0, 5, 255, 1, 197, 1, 0, 5, 111, 1, 255, 7, 0, 32, }; -static const unsigned char _14849714[] PROGMEM = { -0, 59, 36, 1, 0, 16, 197, 1, 73, 1, 0, 14, 73, 1, 255, 1, 197, 1, 0, 14, 197, 1, 255, 2, 73, 1, 0, 12, 73, 1, 255, 3, 197, 1, 0, 12, 197, 1, 255, 4, 73, 1, 0, 10, 73, 1, 255, 5, 197, 1, 0, 10, 197, 1, 255, 6, 73, 1, 0, 8, 73, 1, 255, 7, 197, 1, 0, 8, 197, 1, 255, 8, 73, 1, 0, 6, 73, 1, 255, 9, 197, 1, 0, 6, 255, 11, 111, 1, 0, 70, }; -static const unsigned char _14849724[] PROGMEM = { -0, 53, 36, 1, 255, 11, 153, 1, 0, 5, 153, 1, 255, 10, 36, 1, 0, 5, 36, 1, 255, 9, 153, 1, 0, 7, 153, 1, 255, 8, 36, 1, 0, 7, 36, 1, 255, 7, 153, 1, 0, 9, 153, 1, 255, 6, 36, 1, 0, 9, 36, 1, 255, 5, 153, 1, 0, 11, 153, 1, 255, 4, 36, 1, 0, 11, 36, 1, 255, 3, 153, 1, 0, 13, 153, 1, 255, 2, 36, 1, 0, 13, 36, 1, 255, 1, 153, 1, 0, 15, 153, 1, 36, 1, 0, 75, }; -static LATTICE lattice_array[] = { - {32, 5, _32}, - {33, 5, _33}, - {35, 9, _35}, - {37, 15, _37}, - {39, 3, _39}, - {40, 6, _40}, - {41, 6, _41}, - {43, 10, _43}, - {44, 5, _44}, - {45, 6, _45}, - {46, 5, _46}, - {47, 5, _47}, - {48, 9, _48}, - {49, 9, _49}, - {50, 9, _50}, - {51, 9, _51}, - {52, 9, _52}, - {53, 9, _53}, - {54, 9, _54}, - {55, 9, _55}, - {56, 9, _56}, - {57, 9, _57}, - {58, 5, _58}, - {59, 5, _59}, - {60, 10, _60}, - {61, 10, _61}, - {62, 10, _62}, - {63, 9, _63}, - {64, 17, _64}, - {65, 11, _65}, - {66, 11, _66}, - {67, 12, _67}, - {68, 12, _68}, - {69, 11, _69}, - {70, 10, _70}, - {71, 12, _71}, - {72, 11, _72}, - {73, 5, _73}, - {74, 9, _74}, - {75, 11, _75}, - {76, 9, _76}, - {77, 13, _77}, - {78, 11, _78}, - {79, 12, _79}, - {80, 11, _80}, - {81, 12, _81}, - {82, 11, _82}, - {83, 11, _83}, - {84, 9, _84}, - {85, 11, _85}, - {86, 11, _86}, - {87, 17, _87}, - {88, 11, _88}, - {89, 11, _89}, - {90, 9, _90}, - {91, 5, _91}, - {93, 5, _93}, - {95, 9, _95}, - {97, 9, _97}, - {98, 9, _98}, - {99, 9, _99}, - {100, 9, _100}, - {101, 9, _101}, - {102, 5, _102}, - {103, 9, _103}, - {104, 9, _104}, - {105, 4, _105}, - {106, 3, _106}, - {107, 8, _107}, - {108, 3, _108}, - {109, 13, _109}, - {110, 9, _110}, - {111, 9, _111}, - {112, 9, _112}, - {113, 9, _113}, - {114, 6, _114}, - {115, 8, _115}, - {116, 4, _116}, - {117, 9, _117}, - {118, 7, _118}, - {119, 11, _119}, - {120, 7, _120}, - {121, 9, _121}, - {122, 8, _122}, - {14849714, 17, _14849714}, - {14849724, 17, _14849724}, -}; -extern const LATTICE_FONT_INFO Arial_19_GL; -const LATTICE_FONT_INFO Arial_19_GL ={ - 19, - 86, - lattice_array -};