├── README.md ├── launcher ├── CMakeLists.txt ├── launcher.h └── src │ ├── launcher.c │ ├── assets │ └── source │ │ ├── mouse.c │ │ ├── backhome.c │ │ └── mouse_gray.c │ └── lvgl_nes.c ├── patch ├── 0001-PNG-add-CMakeLists.txt-file.patch ├── 0001-fs_if-add-CMakeLists.txt-file.patch ├── 0001-QRCode-add-CMakeLists.txt-file.patch ├── 0001-NES-Add-CMakeLists.txt-file.patch ├── 0001-fix-drv-disp-driver-pointer-data.patch ├── 0001-Add-pthread_testcancel-function-for-back-to-menu.patch └── 0001-Modify-for-M5Pi-Launcher.patch ├── .gitignore ├── LICENSE ├── lv_demo_conf.h ├── main.c ├── CMakeLists.txt ├── lv_drv_conf.h └── lv_conf.h /README.md: -------------------------------------------------------------------------------- 1 | # M5Pi-Launcher 2 | Launcher for M5Pi. 3 | -------------------------------------------------------------------------------- /launcher/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB_RECURSE SOURCES src/*.c src/assets/source/*.c) 2 | add_library(launcher STATIC ${SOURCES}) 3 | -------------------------------------------------------------------------------- /patch/0001-PNG-add-CMakeLists.txt-file.patch: -------------------------------------------------------------------------------- 1 | From 7a4199cb41ca55e15a71b17f568e26ef99c4b40e Mon Sep 17 00:00:00 2001 2 | From: IAMLIUBO 3 | Date: Thu, 8 Jul 2021 18:12:23 +0800 4 | Subject: [PATCH] PNG add CMakeLists.txt file 5 | 6 | --- 7 | CMakeLists.txt | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | create mode 100644 CMakeLists.txt 10 | 11 | diff --git a/CMakeLists.txt b/CMakeLists.txt 12 | new file mode 100644 13 | index 0000000..ae54e79 14 | --- /dev/null 15 | +++ b/CMakeLists.txt 16 | @@ -0,0 +1,2 @@ 17 | +file(GLOB_RECURSE SOURCES ./*.c) 18 | +add_library(lv_lib_png STATIC ${SOURCES}) 19 | \ No newline at end of file 20 | -- 21 | 2.25.1 22 | 23 | -------------------------------------------------------------------------------- /patch/0001-fs_if-add-CMakeLists.txt-file.patch: -------------------------------------------------------------------------------- 1 | From 0cd9b05ac51f0bab287d362326c9067fe98c9e18 Mon Sep 17 00:00:00 2001 2 | From: IAMLIUBO 3 | Date: Thu, 8 Jul 2021 18:46:23 +0800 4 | Subject: [PATCH] fs_if add CMakeLists.txt file 5 | 6 | --- 7 | CMakeLists.txt | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | create mode 100644 CMakeLists.txt 10 | 11 | diff --git a/CMakeLists.txt b/CMakeLists.txt 12 | new file mode 100644 13 | index 0000000..3a22578 14 | --- /dev/null 15 | +++ b/CMakeLists.txt 16 | @@ -0,0 +1,2 @@ 17 | +file(GLOB_RECURSE SOURCES ./*.c) 18 | +add_library(lv_fs_if STATIC ${SOURCES}) 19 | \ No newline at end of file 20 | -- 21 | 2.25.1 22 | 23 | -------------------------------------------------------------------------------- /patch/0001-QRCode-add-CMakeLists.txt-file.patch: -------------------------------------------------------------------------------- 1 | From 69ef3fb10068f866cd3834d434a03aac86d9b4b7 Mon Sep 17 00:00:00 2001 2 | From: IAMLIUBO 3 | Date: Wed, 7 Jul 2021 21:35:44 +0800 4 | Subject: [PATCH] QRCode add CMakeLists.txt file 5 | 6 | --- 7 | CMakeLists.txt | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | create mode 100644 CMakeLists.txt 10 | 11 | diff --git a/CMakeLists.txt b/CMakeLists.txt 12 | new file mode 100644 13 | index 0000000..73f372e 14 | --- /dev/null 15 | +++ b/CMakeLists.txt 16 | @@ -0,0 +1,2 @@ 17 | +file(GLOB_RECURSE SOURCES ./*.c) 18 | +add_library(lv_lib_qrcode STATIC ${SOURCES}) 19 | \ No newline at end of file 20 | -- 21 | 2.25.1 22 | 23 | -------------------------------------------------------------------------------- /patch/0001-NES-Add-CMakeLists.txt-file.patch: -------------------------------------------------------------------------------- 1 | From e00546374f793d734b8fcd92894fc1b3beace883 Mon Sep 17 00:00:00 2001 2 | From: IAMLIUBO 3 | Date: Wed, 7 Jul 2021 21:09:33 +0800 4 | Subject: [PATCH] Add CMakeLists.txt file. 5 | 6 | --- 7 | CMakeLists.txt | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | create mode 100644 CMakeLists.txt 10 | 11 | diff --git a/CMakeLists.txt b/CMakeLists.txt 12 | new file mode 100644 13 | index 0000000..071cf07 14 | --- /dev/null 15 | +++ b/CMakeLists.txt 16 | @@ -0,0 +1,2 @@ 17 | +file(GLOB_RECURSE SOURCES InfoNES_Mapper.cpp InfoNES_pAPU.cpp InfoNES.cpp K6502.cpp linux/joypad_input.cpp) 18 | +add_library(nes STATIC ${SOURCES}) 19 | -- 20 | 2.25.1 21 | 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | 54 | # folder 55 | .vscode/ 56 | build/ 57 | lv_demos/ 58 | lv_drivers/ 59 | lv_fs_if/ 60 | lv_lib_png/ 61 | lv_lib_qrcode/ 62 | lvgl/ 63 | nes/ 64 | launcher/src/assets/images/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 IAMLIUBO 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /patch/0001-fix-drv-disp-driver-pointer-data.patch: -------------------------------------------------------------------------------- 1 | From 935c2131c8eeb9a39b294df59c4c78fbf66413f6 Mon Sep 17 00:00:00 2001 2 | From: IAMLIUBO 3 | Date: Thu, 8 Jul 2021 18:32:42 +0800 4 | Subject: [PATCH] fix drv->disp->driver pointer data 5 | 6 | --- 7 | indev/evdev.c | 4 ++-- 8 | 1 file changed, 2 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/indev/evdev.c b/indev/evdev.c 11 | index e85b7f4..d327d83 100644 12 | --- a/indev/evdev.c 13 | +++ b/indev/evdev.c 14 | @@ -212,8 +212,8 @@ bool evdev_read(lv_indev_drv_t * drv, lv_indev_data_t * data) 15 | /*Store the collected data*/ 16 | 17 | #if EVDEV_CALIBRATE 18 | - data->point.x = map(evdev_root_x, EVDEV_HOR_MIN, EVDEV_HOR_MAX, 0, drv->disp->driver.hor_res); 19 | - data->point.y = map(evdev_root_y, EVDEV_VER_MIN, EVDEV_VER_MAX, 0, drv->disp->driver.ver_res); 20 | + data->point.x = map(evdev_root_x, EVDEV_HOR_MIN, EVDEV_HOR_MAX, 0, drv->disp->driver->hor_res); 21 | + data->point.y = map(evdev_root_y, EVDEV_VER_MIN, EVDEV_VER_MAX, 0, drv->disp->driver->ver_res); 22 | #else 23 | data->point.x = evdev_root_x; 24 | data->point.y = evdev_root_y; 25 | -- 26 | 2.25.1 27 | 28 | -------------------------------------------------------------------------------- /patch/0001-Add-pthread_testcancel-function-for-back-to-menu.patch: -------------------------------------------------------------------------------- 1 | From d110a7bf4e9dbde077757f52bc9d6efadc712289 Mon Sep 17 00:00:00 2001 2 | From: IAMLIUBO 3 | Date: Thu, 8 Jul 2021 19:33:33 +0800 4 | Subject: [PATCH] Add pthread_testcancel function for back to menu 5 | 6 | --- 7 | InfoNES.cpp | 5 +++++ 8 | 1 file changed, 5 insertions(+) 9 | 10 | diff --git a/InfoNES.cpp b/InfoNES.cpp 11 | index beaf40f..cbb5ae9 100755 12 | --- a/InfoNES.cpp 13 | +++ b/InfoNES.cpp 14 | @@ -40,6 +40,7 @@ 15 | #include "InfoNES_Mapper.h" 16 | #include "InfoNES_pAPU.h" 17 | #include "K6502.h" 18 | +#include "pthread.h" 19 | 20 | /*-------------------------------------------------------------------*/ 21 | /* NES resources */ 22 | @@ -569,6 +570,8 @@ void InfoNES_Main() 23 | /* Start a NES emulation */ 24 | /*-------------------------------------------------------------------*/ 25 | InfoNES_Cycle(); 26 | + // Back to home menu 27 | + pthread_testcancel(); 28 | } 29 | 30 | // Completion treatment 31 | @@ -640,6 +643,8 @@ void InfoNES_Cycle() 32 | return; // To the menu screen 33 | // HSYNC Wait 34 | InfoNES_Wait(); 35 | + // Back to home menu 36 | + pthread_testcancel(); 37 | } 38 | } 39 | 40 | -- 41 | 2.25.1 42 | 43 | -------------------------------------------------------------------------------- /lv_demo_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_conf.h 3 | * Configuration file for v8.1.0-dev 4 | * 5 | */ 6 | /* 7 | * COPY THIS FILE AS lv_demo_conf.h 8 | */ 9 | 10 | #if 1 /*Set it to "1" to enable the content*/ 11 | 12 | #include "lvgl/lvgl.h" 13 | 14 | #ifndef LV_EX_CONF_H 15 | #define LV_EX_CONF_H 16 | 17 | // #define LV_LVGL_H_INCLUDE_SIMPLE 1 18 | 19 | /******************* 20 | * GENERAL SETTING 21 | *******************/ 22 | #define LV_EX_PRINTF 0 /*Enable printf-ing data in demoes and examples*/ 23 | #define LV_EX_KEYBOARD 0 /*Add PC keyboard support to some examples (`lv_drivers` repository is required)*/ 24 | #define LV_EX_MOUSEWHEEL 0 /*Add 'encoder' (mouse wheel) support to some examples (`lv_drivers` repository is required)*/ 25 | 26 | /********************* 27 | * DEMO USAGE 28 | *********************/ 29 | 30 | /*Show some widget*/ 31 | #define LV_USE_DEMO_WIDGETS 1 32 | #if LV_USE_DEMO_WIDGETS 33 | #define LV_DEMO_WIDGETS_SLIDESHOW 0 34 | #endif 35 | 36 | /*Printer demo, optimized for 800x480*/ 37 | #define LV_USE_DEMO_PRINTER 1 38 | 39 | /*Demonstrate the usage of encoder and keyboard*/ 40 | #define LV_USE_DEMO_KEYPAD_AND_ENCODER 1 41 | 42 | /*Benchmark your system*/ 43 | #define LV_USE_DEMO_BENCHMARK 1 44 | 45 | /*Stress test for LVGL*/ 46 | #define LV_USE_DEMO_STRESS 1 47 | 48 | /*Music player demo*/ 49 | #define LV_USE_DEMO_MUSIC 1 50 | #if LV_USE_DEMO_MUSIC 51 | # define LV_DEMO_MUSIC_LANDSCAPE 0 52 | # define LV_DEMO_MUSIC_LARGE 0 53 | #define LV_DEMO_MUSIC_AUTO_PLAY 0 54 | #endif 55 | 56 | #endif /*LV_EX_CONF_H*/ 57 | 58 | #endif /*End of "Content enable"*/ 59 | 60 | -------------------------------------------------------------------------------- /launcher/launcher.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file launcher.h 3 | * 4 | */ 5 | 6 | #ifndef LAUNCHER_H 7 | #define LAUNCHER_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #if defined(LV_LVGL_H_INCLUDE_SIMPLE) 17 | #include "lvgl.h" 18 | #else 19 | #include "../lvgl/lvgl.h" 20 | #endif 21 | 22 | #include 23 | #include 24 | #include "lv_lib_qrcode/lv_qrcode.h" 25 | #include "lv_demo_music/lv_demo_music.h" 26 | /********************* 27 | * DEFINES 28 | *********************/ 29 | /*Test lvgl version*/ 30 | #if LV_VERSION_CHECK(8, 0, 0) == 0 31 | #error "lv_demo: Wrong lvgl version" 32 | #endif 33 | 34 | #define M5PI_SCREEN_WIDTH 320 35 | #define M5PI_SCREEN_HEIGHT 240 36 | #define APPLICATION_ICON_SIZE 64 37 | /********************** 38 | * TYPEDEFS 39 | **********************/ 40 | typedef enum { 41 | PHOTOS = 0, 42 | SETTINGS, 43 | CAMERA, 44 | CALENDAR, 45 | MESSAGE, 46 | CALCULATOR, 47 | APP_STORE, 48 | MUSIC, 49 | CLOCK, 50 | HOME, 51 | NOTES, 52 | FACETIME, 53 | HEALTH, 54 | NES, 55 | MAIL, 56 | NEWS, 57 | MEASURE, 58 | SAFARI, 59 | WALLET, 60 | APPLE_TV, 61 | BOOKS, 62 | FILES, 63 | WEATHER, 64 | CLIPS, 65 | APP_LIST_CODE_MAX, 66 | LINUX = 97, 67 | PI, 68 | LIUBO, 69 | }app_list_code_t; 70 | /********************** 71 | * GLOBAL PROTOTYPES 72 | **********************/ 73 | void launcher_widgets(void); 74 | 75 | /********************** 76 | * MACROS 77 | **********************/ 78 | extern lv_obj_t *main_win; 79 | 80 | extern lv_canvas_t *nes_canvas; 81 | extern pthread_t nes_tid; 82 | extern int nes_init(char *nes_file); 83 | 84 | #ifdef __cplusplus 85 | } /* extern "C" */ 86 | #endif 87 | 88 | #endif /*LAUNCHER_H*/ 89 | -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- 1 | #include "lvgl/lvgl.h" 2 | #include "lv_drivers/display/fbdev.h" 3 | #include "lv_demos/lv_demo.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "lv_drivers/indev/evdev.h" 9 | #include "launcher/launcher.h" 10 | #include "lv_fs_if/lv_fs_if.h" 11 | #include "lv_lib_png/lv_png.h" 12 | 13 | #define DISP_BUF_SIZE (256 * 1024) 14 | 15 | int main(void) 16 | { 17 | /*LittlevGL init*/ 18 | lv_init(); 19 | 20 | /*file style interface init*/ 21 | lv_fs_if_init(); 22 | 23 | /*png decode init*/ 24 | lv_png_init(); 25 | 26 | /*Linux frame buffer device init*/ 27 | fbdev_init(); 28 | 29 | /*A small buffer for LittlevGL to draw the screen's content*/ 30 | static lv_color_t buf1[DISP_BUF_SIZE]; 31 | static lv_color_t buf2[DISP_BUF_SIZE]; 32 | 33 | /*Initialize a descriptor for the buffer*/ 34 | static lv_disp_draw_buf_t disp_buf; 35 | lv_disp_draw_buf_init(&disp_buf, buf1, buf2, DISP_BUF_SIZE * 2); 36 | 37 | /*Initialize and register a display driver*/ 38 | static lv_disp_drv_t disp_drv; 39 | lv_disp_drv_init(&disp_drv); 40 | disp_drv.draw_buf = &disp_buf; 41 | disp_drv.flush_cb = fbdev_flush; 42 | disp_drv.hor_res = 320; 43 | disp_drv.ver_res = 240; 44 | lv_disp_drv_register(&disp_drv); 45 | 46 | evdev_init(); 47 | lv_indev_drv_t indev_drv; 48 | lv_indev_drv_init(&indev_drv); 49 | indev_drv.type = LV_INDEV_TYPE_POINTER; 50 | indev_drv.read_cb = evdev_read; 51 | lv_indev_drv_register(&indev_drv); 52 | 53 | #if (LV_COLOR_DEPTH == 32) 54 | lv_indev_t *mouse_indev = lv_indev_get_next(NULL); 55 | lv_obj_t *cursor = lv_img_create(lv_scr_act()); 56 | LV_IMG_DECLARE(mouse_black); 57 | lv_img_set_src(cursor, &mouse_black); 58 | lv_indev_set_cursor(mouse_indev, cursor); 59 | #endif 60 | 61 | /*Create a Demo*/ 62 | launcher_widgets(); 63 | 64 | /*Handle LitlevGL tasks (tickless mode)*/ 65 | while(1) { 66 | lv_task_handler(); 67 | usleep(1000); 68 | } 69 | 70 | return 0; 71 | } 72 | 73 | /*Set in lv_conf.h as `LV_TICK_CUSTOM_SYS_TIME_EXPR`*/ 74 | uint32_t custom_tick_get(void) 75 | { 76 | static uint64_t start_ms = 0; 77 | if(start_ms == 0) { 78 | struct timeval tv_start; 79 | gettimeofday(&tv_start, NULL); 80 | start_ms = (tv_start.tv_sec * 1000000 + tv_start.tv_usec) / 1000; 81 | } 82 | 83 | struct timeval tv_now; 84 | gettimeofday(&tv_now, NULL); 85 | uint64_t now_ms; 86 | now_ms = (tv_now.tv_sec * 1000000 + tv_now.tv_usec) / 1000; 87 | 88 | uint32_t time_ms = now_ms - start_ms; 89 | return time_ms; 90 | } 91 | -------------------------------------------------------------------------------- /patch/0001-Modify-for-M5Pi-Launcher.patch: -------------------------------------------------------------------------------- 1 | From 8f94e7d276b61026ffa18276968b2417e36188f6 Mon Sep 17 00:00:00 2001 2 | From: IAMLIUBO 3 | Date: Wed, 7 Jul 2021 21:47:36 +0800 4 | Subject: [PATCH] Modify for M5Pi Launcher 5 | 6 | --- 7 | src/lv_demo_music/lv_demo_music.c | 8 ++++---- 8 | src/lv_demo_music/lv_demo_music.h | 2 +- 9 | src/lv_demo_music/lv_demo_music_list.c | 6 +++--- 10 | src/lv_demo_music/lv_demo_music_main.c | 8 ++++---- 11 | 4 files changed, 12 insertions(+), 12 deletions(-) 12 | 13 | diff --git a/src/lv_demo_music/lv_demo_music.c b/src/lv_demo_music/lv_demo_music.c 14 | index 0cbaaf4..bc83761 100644 15 | --- a/src/lv_demo_music/lv_demo_music.c 16 | +++ b/src/lv_demo_music/lv_demo_music.c 17 | @@ -111,12 +111,12 @@ static const uint32_t time_list[] = { 18 | * GLOBAL FUNCTIONS 19 | **********************/ 20 | 21 | -void lv_demo_music(void) 22 | +void lv_demo_music(lv_obj_t * parent) 23 | { 24 | - lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x343247), 0); 25 | + lv_obj_set_style_bg_color(parent, lv_color_hex(0x343247), 0); 26 | 27 | - list = _lv_demo_music_list_create(lv_scr_act()); 28 | - ctrl = _lv_demo_music_main_create(lv_scr_act()); 29 | + ctrl = _lv_demo_music_main_create(parent); 30 | + list = _lv_demo_music_list_create(parent); 31 | 32 | #if LV_DEMO_MUSIC_AUTO_PLAY 33 | lv_timer_create(auto_step_cb, 1000, NULL); 34 | diff --git a/src/lv_demo_music/lv_demo_music.h b/src/lv_demo_music/lv_demo_music.h 35 | index 77ae838..823ee70 100644 36 | --- a/src/lv_demo_music/lv_demo_music.h 37 | +++ b/src/lv_demo_music/lv_demo_music.h 38 | @@ -35,7 +35,7 @@ extern "C" { 39 | * GLOBAL PROTOTYPES 40 | **********************/ 41 | 42 | -void lv_demo_music(void); 43 | +void lv_demo_music(lv_obj_t * parent); 44 | const char * _lv_demo_music_get_title(uint32_t track_id); 45 | const char * _lv_demo_music_get_artist(uint32_t track_id); 46 | const char * _lv_demo_music_get_genre(uint32_t track_id); 47 | diff --git a/src/lv_demo_music/lv_demo_music_list.c b/src/lv_demo_music/lv_demo_music_list.c 48 | index 234d9fc..078f084 100644 49 | --- a/src/lv_demo_music/lv_demo_music_list.c 50 | +++ b/src/lv_demo_music/lv_demo_music_list.c 51 | @@ -74,7 +74,7 @@ lv_obj_t * _lv_demo_music_list_create(lv_obj_t * parent) 52 | static const lv_coord_t grid_rows[] = {22, 17, LV_GRID_TEMPLATE_LAST}; 53 | #endif 54 | lv_style_init(&style_btn); 55 | - lv_style_set_bg_opa(&style_btn, LV_OPA_TRANSP); 56 | + lv_style_set_bg_opa(&style_btn, LV_OPA_COVER); 57 | lv_style_set_grid_column_dsc_array(&style_btn, grid_cols); 58 | lv_style_set_grid_row_dsc_array(&style_btn, grid_rows); 59 | lv_style_set_grid_row_align(&style_btn, LV_GRID_ALIGN_CENTER); 60 | @@ -93,8 +93,8 @@ lv_obj_t * _lv_demo_music_list_create(lv_obj_t * parent) 61 | lv_style_set_bg_color(&style_btn_chk, lv_color_hex(0x4c4965)); 62 | 63 | lv_style_init(&style_btn_dis); 64 | - lv_style_set_text_opa(&style_btn_dis, LV_OPA_40); 65 | - lv_style_set_img_opa(&style_btn_dis, LV_OPA_40); 66 | + lv_style_set_text_opa(&style_btn_dis, LV_OPA_COVER); 67 | + lv_style_set_img_opa(&style_btn_dis, LV_OPA_COVER); 68 | 69 | lv_style_init(&style_title); 70 | lv_style_set_text_font(&style_title, font_medium); 71 | diff --git a/src/lv_demo_music/lv_demo_music_main.c b/src/lv_demo_music/lv_demo_music_main.c 72 | index a4b0a50..77bf975 100644 73 | --- a/src/lv_demo_music/lv_demo_music_main.c 74 | +++ b/src/lv_demo_music/lv_demo_music_main.c 75 | @@ -220,7 +220,7 @@ lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent) 76 | lv_obj_set_style_text_line_space(title, 8, 0); 77 | lv_obj_fade_out(title, 500, INTRO_TIME); 78 | lv_obj_align_to(logo, spectrum_obj, LV_ALIGN_CENTER, 0, 0); 79 | - lv_obj_align_to(title, logo, LV_ALIGN_OUT_LEFT_MID, -20, 0); 80 | + lv_obj_align_to(title, logo, LV_ALIGN_OUT_BOTTOM_MID, 0, 30); 81 | 82 | lv_anim_set_path_cb(&a, lv_anim_path_ease_in); 83 | lv_anim_set_var(&a, logo); 84 | @@ -313,7 +313,7 @@ static lv_obj_t * create_cont(lv_obj_t * parent) 85 | /*Create a container for the player*/ 86 | lv_obj_t * player = lv_obj_create(main_cont); 87 | lv_obj_set_y(player, - LV_DEMO_MUSIC_HANDLE_SIZE); 88 | - lv_obj_set_size(player, LV_HOR_RES, LV_VER_RES + LV_DEMO_MUSIC_HANDLE_SIZE * 2); 89 | + lv_obj_set_size(player, LV_HOR_RES, LV_VER_RES + 20); 90 | 91 | lv_obj_set_style_bg_color(player, lv_color_hex(0xffffff), 0); 92 | lv_obj_set_style_border_width(player, 0, 0); 93 | @@ -324,8 +324,8 @@ static lv_obj_t * create_cont(lv_obj_t * parent) 94 | * It is used only to snap it to center.*/ 95 | lv_obj_t * placeholder = lv_obj_create(main_cont); 96 | lv_obj_remove_style_all(placeholder); 97 | - lv_obj_set_size(placeholder, lv_pct(100), LV_VER_RES -2 * LV_DEMO_MUSIC_HANDLE_SIZE); 98 | - lv_obj_set_y(placeholder, LV_VER_RES + LV_DEMO_MUSIC_HANDLE_SIZE); 99 | + lv_obj_set_size(placeholder, lv_pct(100), 0); 100 | + lv_obj_set_y(placeholder, 0); 101 | lv_obj_clear_flag(placeholder, LV_OBJ_FLAG_CLICKABLE); 102 | 103 | lv_obj_update_layout(main_cont); 104 | -- 105 | 2.25.1 106 | 107 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.8) 2 | include(ExternalProject) 3 | 4 | project(M5Pi-Launcher) 5 | 6 | # SET(CROSS_COMPILE 1) 7 | # set(CMAKE_SYSTEM_NAME Linux) 8 | # set(CMAKE_C_COMPILER "/path/to/your/arm-linux-gcc") 9 | # set(CMAKE_CXX_COMPILER "/path/to/your/arm-linux-g++") 10 | SET(CMAKE_BUILD_TYPE "Debug") 11 | SET(CMAKE_C_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -w -fsigned-char") 12 | SET(CMAKE_C_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -w -fsigned-char") 13 | 14 | set(lvgl_dir "${CMAKE_SOURCE_DIR}/lvgl") 15 | ExternalProject_Add( 16 | lvgl 17 | URL https://github.com/lvgl/lvgl/archive/refs/tags/v8.0.1.zip 18 | SOURCE_DIR ${lvgl_dir} 19 | CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 20 | BUILD_COMMAND 21 | make 22 | C_INCLUDE_PATH=${CMAKE_CURRENT_SOURCE_DIR} 23 | UPDATE_COMMAND "" 24 | INSTALL_COMMAND "" 25 | ) 26 | ExternalProject_Get_property(lvgl INSTALL_DIR) 27 | set(lvgl_lib_dir ${INSTALL_DIR}/src/lvgl-build) 28 | 29 | 30 | set(lv_drivers_dir "${CMAKE_SOURCE_DIR}/lv_drivers") 31 | ExternalProject_Add( 32 | lv_drivers 33 | GIT_REPOSITORY https://github.com/lvgl/lv_drivers.git 34 | GIT_SHALLOW 1 35 | GIT_TAG 8510fcb4d4834fbca8ddcb259ec459d25f3ab270 36 | SOURCE_DIR ${lv_drivers_dir} 37 | PATCH_COMMAND git apply ${CMAKE_SOURCE_DIR}/patch/0001-fix-drv-disp-driver-pointer-data.patch 38 | CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 39 | BUILD_COMMAND 40 | make 41 | C_INCLUDE_PATH=${CMAKE_CURRENT_SOURCE_DIR} 42 | UPDATE_COMMAND "" 43 | INSTALL_COMMAND "" 44 | ) 45 | add_dependencies(lv_drivers lvgl) 46 | ExternalProject_Get_property(lv_drivers INSTALL_DIR) 47 | set(lv_drivers_lib_dir ${INSTALL_DIR}/src/lv_drivers-build) 48 | 49 | set(lv_demos_dir "${CMAKE_SOURCE_DIR}/lv_demos") 50 | ExternalProject_Add( 51 | lv_demos 52 | GIT_REPOSITORY https://github.com/lvgl/lv_demos.git 53 | GIT_SHALLOW 1 54 | GIT_TAG 137ee357c25111f8fbcdd0ad6125df026ea2099e 55 | SOURCE_DIR ${lv_demos_dir} 56 | PATCH_COMMAND git apply ${CMAKE_SOURCE_DIR}/patch/0001-Modify-for-M5Pi-Launcher.patch 57 | CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 58 | BUILD_COMMAND 59 | make 60 | C_INCLUDE_PATH=${CMAKE_CURRENT_SOURCE_DIR} 61 | UPDATE_COMMAND "" 62 | INSTALL_COMMAND "" 63 | ) 64 | add_dependencies(lv_demos lvgl) 65 | ExternalProject_Get_property(lv_demos INSTALL_DIR) 66 | set(lv_demos_lib_dir ${INSTALL_DIR}/src/lv_demos-build) 67 | 68 | set(lv_lib_qrcode_dir "${CMAKE_SOURCE_DIR}/lv_lib_qrcode") 69 | ExternalProject_Add( 70 | lib_qrcode 71 | GIT_REPOSITORY https://github.com/lvgl/lv_lib_qrcode.git 72 | GIT_SHALLOW 1 73 | GIT_TAG e194f27d975d199cea9eed18a46921e3631eae03 74 | SOURCE_DIR ${lv_lib_qrcode_dir} 75 | PATCH_COMMAND git apply ${CMAKE_SOURCE_DIR}/patch/0001-QRCode-add-CMakeLists.txt-file.patch 76 | CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 77 | BUILD_COMMAND 78 | make 79 | C_INCLUDE_PATH=${CMAKE_CURRENT_SOURCE_DIR} 80 | UPDATE_COMMAND "" 81 | INSTALL_COMMAND "" 82 | ) 83 | add_dependencies(lib_qrcode lvgl) 84 | ExternalProject_Get_property(lib_qrcode INSTALL_DIR) 85 | set(lib_qrcode_lib_dir ${INSTALL_DIR}/src/lib_qrcode-build) 86 | 87 | set(lv_lib_png_dir "${CMAKE_SOURCE_DIR}/lv_lib_png") 88 | ExternalProject_Add( 89 | lib_png 90 | GIT_REPOSITORY https://github.com/lvgl/lv_lib_png.git 91 | GIT_SHALLOW 1 92 | GIT_TAG c2e971193c4ea97e2b63a6f16fc6a324673d1565 93 | SOURCE_DIR ${lv_lib_png_dir} 94 | PATCH_COMMAND git apply ${CMAKE_SOURCE_DIR}/patch/0001-PNG-add-CMakeLists.txt-file.patch 95 | CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 96 | BUILD_COMMAND 97 | make 98 | C_INCLUDE_PATH=${CMAKE_CURRENT_SOURCE_DIR} 99 | UPDATE_COMMAND "" 100 | INSTALL_COMMAND "" 101 | ) 102 | add_dependencies(lib_png lvgl) 103 | ExternalProject_Get_property(lib_png INSTALL_DIR) 104 | set(lib_png_lib_dir ${INSTALL_DIR}/src/lib_png-build) 105 | 106 | set(lv_fs_dir "${CMAKE_SOURCE_DIR}/lv_fs_if") 107 | ExternalProject_Add( 108 | lib_fs 109 | GIT_REPOSITORY https://github.com/lvgl/lv_fs_if.git 110 | GIT_SHALLOW 1 111 | GIT_TAG 2cad463d99244822730171243f2646686b4cd14a 112 | SOURCE_DIR ${lv_fs_dir} 113 | PATCH_COMMAND git apply ${CMAKE_SOURCE_DIR}/patch/0001-fs_if-add-CMakeLists.txt-file.patch 114 | CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 115 | BUILD_COMMAND 116 | make 117 | C_INCLUDE_PATH=${CMAKE_CURRENT_SOURCE_DIR} 118 | UPDATE_COMMAND "" 119 | INSTALL_COMMAND "" 120 | ) 121 | add_dependencies(lib_fs lvgl) 122 | ExternalProject_Get_property(lib_fs INSTALL_DIR) 123 | set(lib_fs_lib_dir ${INSTALL_DIR}/src/lib_fs-build) 124 | 125 | set(nes_dir "${CMAKE_SOURCE_DIR}/nes") 126 | ExternalProject_Add( 127 | nes 128 | GIT_REPOSITORY https://github.com/nejidev/arm-NES-linux.git 129 | GIT_SHALLOW 1 130 | GIT_TAG e14ec579b3fb58f4c061ca38c103cc11d58d1673 131 | SOURCE_DIR ${nes_dir} 132 | PATCH_COMMAND git apply ${CMAKE_SOURCE_DIR}/patch/0001-NES-Add-CMakeLists.txt-file.patch ${CMAKE_SOURCE_DIR}/patch/0001-Add-pthread_testcancel-function-for-back-to-menu.patch 133 | CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 134 | BUILD_COMMAND 135 | make 136 | UPDATE_COMMAND "" 137 | INSTALL_COMMAND "" 138 | ) 139 | ExternalProject_Get_property(nes INSTALL_DIR) 140 | set(nes_lib_dir ${INSTALL_DIR}/src/nes-build) 141 | 142 | include_directories(${CMAKE_SOURCE_DIR}) 143 | include_directories(${CMAKE_SOURCE_DIR}/lv_demos/src/) 144 | include_directories(${CMAKE_SOURCE_DIR}/nes/) 145 | 146 | add_subdirectory(launcher) 147 | add_dependencies(launcher lvgl lv_demos lib_qrcode nes) 148 | 149 | find_package(Threads) 150 | 151 | if (UNIX) 152 | list(APPEND libs 153 | ${lv_drivers_lib_dir}/liblv_drivers.a 154 | ${lv_demos_lib_dir}/liblv_examples.a 155 | ${lvgl_lib_dir}/liblvgl.a 156 | ${lib_qrcode_lib_dir}/liblv_lib_qrcode.a 157 | ${lib_png_lib_dir}/liblv_lib_png.a 158 | ${lib_fs_lib_dir}/liblv_fs_if.a 159 | ${nes_lib_dir}/libnes.a 160 | -lz 161 | -lm 162 | -lpthread 163 | -lasound 164 | ) 165 | endif() 166 | 167 | add_executable(M5Pi-Launcher main.c) 168 | add_dependencies(M5Pi-Launcher lvgl lv_demos lv_drivers lib_qrcode lib_fs lib_qrcode lib_png nes) 169 | target_link_libraries(M5Pi-Launcher launcher ${libs}) -------------------------------------------------------------------------------- /lv_drv_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_drv_conf.h 3 | * Configuration file for v8.1.0-dev 4 | */ 5 | 6 | /* 7 | * COPY THIS FILE AS lv_drv_conf.h 8 | */ 9 | 10 | #if 1 /*Set it to "1" to enable the content*/ 11 | 12 | #ifndef LV_DRV_CONF_H 13 | #define LV_DRV_CONF_H 14 | 15 | #include "lv_conf.h" 16 | 17 | /********************* 18 | * DELAY INTERFACE 19 | *********************/ 20 | #define LV_DRV_DELAY_INCLUDE /*Dummy include by default*/ 21 | #define LV_DRV_DELAY_US(us) /*delay_us(us)*/ /*Delay the given number of microseconds*/ 22 | #define LV_DRV_DELAY_MS(ms) /*delay_ms(ms)*/ /*Delay the given number of milliseconds*/ 23 | 24 | /********************* 25 | * DISPLAY INTERFACE 26 | *********************/ 27 | 28 | /*------------ 29 | * Common 30 | *------------*/ 31 | #define LV_DRV_DISP_INCLUDE /*Dummy include by default*/ 32 | #define LV_DRV_DISP_CMD_DATA(val) /*pin_x_set(val)*/ /*Set the command/data pin to 'val'*/ 33 | #define LV_DRV_DISP_RST(val) /*pin_x_set(val)*/ /*Set the reset pin to 'val'*/ 34 | 35 | /*--------- 36 | * SPI 37 | *---------*/ 38 | #define LV_DRV_DISP_SPI_CS(val) /*spi_cs_set(val)*/ /*Set the SPI's Chip select to 'val'*/ 39 | #define LV_DRV_DISP_SPI_WR_BYTE(data) /*spi_wr(data)*/ /*Write a byte the SPI bus*/ 40 | #define LV_DRV_DISP_SPI_WR_ARRAY(adr, n) /*spi_wr_mem(adr, n)*/ /*Write 'n' bytes to SPI bus from 'adr'*/ 41 | 42 | /*------------------ 43 | * Parallel port 44 | *-----------------*/ 45 | #define LV_DRV_DISP_PAR_CS(val) /*par_cs_set(val)*/ /*Set the Parallel port's Chip select to 'val'*/ 46 | #define LV_DRV_DISP_PAR_SLOW /*par_slow()*/ /*Set low speed on the parallel port*/ 47 | #define LV_DRV_DISP_PAR_FAST /*par_fast()*/ /*Set high speed on the parallel port*/ 48 | #define LV_DRV_DISP_PAR_WR_WORD(data) /*par_wr(data)*/ /*Write a word to the parallel port*/ 49 | #define LV_DRV_DISP_PAR_WR_ARRAY(adr, n) /*par_wr_mem(adr,n)*/ /*Write 'n' bytes to Parallel ports from 'adr'*/ 50 | 51 | /*************************** 52 | * INPUT DEVICE INTERFACE 53 | ***************************/ 54 | 55 | /*---------- 56 | * Common 57 | *----------*/ 58 | #define LV_DRV_INDEV_INCLUDE /*Dummy include by default*/ 59 | #define LV_DRV_INDEV_RST(val) /*pin_x_set(val)*/ /*Set the reset pin to 'val'*/ 60 | #define LV_DRV_INDEV_IRQ_READ 0 /*pn_x_read()*/ /*Read the IRQ pin*/ 61 | 62 | /*--------- 63 | * SPI 64 | *---------*/ 65 | #define LV_DRV_INDEV_SPI_CS(val) /*spi_cs_set(val)*/ /*Set the SPI's Chip select to 'val'*/ 66 | #define LV_DRV_INDEV_SPI_XCHG_BYTE(data) 0 /*spi_xchg(val)*/ /*Write 'val' to SPI and give the read value*/ 67 | 68 | /*--------- 69 | * I2C 70 | *---------*/ 71 | #define LV_DRV_INDEV_I2C_START /*i2c_start()*/ /*Make an I2C start*/ 72 | #define LV_DRV_INDEV_I2C_STOP /*i2c_stop()*/ /*Make an I2C stop*/ 73 | #define LV_DRV_INDEV_I2C_RESTART /*i2c_restart()*/ /*Make an I2C restart*/ 74 | #define LV_DRV_INDEV_I2C_WR(data) /*i2c_wr(data)*/ /*Write a byte to the I1C bus*/ 75 | #define LV_DRV_INDEV_I2C_READ(last_read) 0 /*i2c_rd()*/ /*Read a byte from the I2C bud*/ 76 | 77 | 78 | /********************* 79 | * DISPLAY DRIVERS 80 | *********************/ 81 | 82 | /*------------------- 83 | * Monitor of PC 84 | *-------------------*/ 85 | #ifndef USE_MONITOR 86 | # define USE_MONITOR 0 87 | #endif 88 | 89 | #if USE_MONITOR 90 | # define MONITOR_HOR_RES 480 91 | # define MONITOR_VER_RES 320 92 | 93 | /* Scale window by this factor (useful when simulating small screens) */ 94 | # define MONITOR_ZOOM 1 95 | 96 | /* Used to test true double buffering with only address changing. 97 | * Use 2 draw buffers, bith with MONITOR_HOR_RES x MONITOR_VER_RES size*/ 98 | # define MONITOR_DOUBLE_BUFFERED 0 99 | 100 | /*Eclipse: Visual Studio: */ 101 | # define MONITOR_SDL_INCLUDE_PATH 102 | 103 | /*Open two windows to test multi display support*/ 104 | # define MONITOR_DUAL 0 105 | #endif 106 | 107 | /*----------------------------------- 108 | * Native Windows (including mouse) 109 | *----------------------------------*/ 110 | #ifndef USE_WINDOWS 111 | # define USE_WINDOWS 0 112 | #endif 113 | 114 | #if USE_WINDOWS 115 | # define WINDOW_HOR_RES 480 116 | # define WINDOW_VER_RES 320 117 | #endif 118 | 119 | /*---------------------------- 120 | * Native Windows (win32drv) 121 | *---------------------------*/ 122 | #ifndef USE_WIN32DRV 123 | # define USE_WIN32DRV 0 124 | #endif 125 | 126 | #if USE_WIN32DRV 127 | /* Scale window by this factor (useful when simulating small screens) */ 128 | # define WIN32DRV_MONITOR_ZOOM 1 129 | #endif 130 | 131 | /*---------------------------------------- 132 | * GTK drivers (monitor, mouse, keyboard 133 | *---------------------------------------*/ 134 | #ifndef USE_GTK 135 | # define USE_GTK 0 136 | #endif 137 | 138 | /*---------------------------------------- 139 | * Wayland drivers (monitor, mouse, keyboard, touchscreen) 140 | *---------------------------------------*/ 141 | #ifndef USE_WAYLAND 142 | # define USE_WAYLAND 0 143 | #endif 144 | 145 | #if USE_WAYLAND 146 | # define WAYLAND_HOR_RES 480 147 | # define WAYLAND_VER_RES 320 148 | # define WAYLAND_SURF_TITLE "LVGL" 149 | #endif 150 | 151 | /*---------------- 152 | * SSD1963 153 | *--------------*/ 154 | #ifndef USE_SSD1963 155 | # define USE_SSD1963 0 156 | #endif 157 | 158 | #if USE_SSD1963 159 | # define SSD1963_HOR_RES LV_HOR_RES 160 | # define SSD1963_VER_RES LV_VER_RES 161 | # define SSD1963_HT 531 162 | # define SSD1963_HPS 43 163 | # define SSD1963_LPS 8 164 | # define SSD1963_HPW 10 165 | # define SSD1963_VT 288 166 | # define SSD1963_VPS 12 167 | # define SSD1963_FPS 4 168 | # define SSD1963_VPW 10 169 | # define SSD1963_HS_NEG 0 /*Negative hsync*/ 170 | # define SSD1963_VS_NEG 0 /*Negative vsync*/ 171 | # define SSD1963_ORI 0 /*0, 90, 180, 270*/ 172 | # define SSD1963_COLOR_DEPTH 16 173 | #endif 174 | 175 | /*---------------- 176 | * R61581 177 | *--------------*/ 178 | #ifndef USE_R61581 179 | # define USE_R61581 0 180 | #endif 181 | 182 | #if USE_R61581 183 | # define R61581_HOR_RES LV_HOR_RES 184 | # define R61581_VER_RES LV_VER_RES 185 | # define R61581_HSPL 0 /*HSYNC signal polarity*/ 186 | # define R61581_HSL 10 /*HSYNC length (Not Implemented)*/ 187 | # define R61581_HFP 10 /*Horitontal Front poarch (Not Implemented)*/ 188 | # define R61581_HBP 10 /*Horitontal Back poarch (Not Implemented */ 189 | # define R61581_VSPL 0 /*VSYNC signal polarity*/ 190 | # define R61581_VSL 10 /*VSYNC length (Not Implemented)*/ 191 | # define R61581_VFP 8 /*Vertical Front poarch*/ 192 | # define R61581_VBP 8 /*Vertical Back poarch */ 193 | # define R61581_DPL 0 /*DCLK signal polarity*/ 194 | # define R61581_EPL 1 /*ENABLE signal polarity*/ 195 | # define R61581_ORI 0 /*0, 180*/ 196 | # define R61581_LV_COLOR_DEPTH 16 /*Fix 16 bit*/ 197 | #endif 198 | 199 | /*------------------------------ 200 | * ST7565 (Monochrome, low res.) 201 | *-----------------------------*/ 202 | #ifndef USE_ST7565 203 | # define USE_ST7565 0 204 | #endif 205 | 206 | #if USE_ST7565 207 | /*No settings*/ 208 | #endif /*USE_ST7565*/ 209 | 210 | /*------------------------------ 211 | * GC9A01 (color, low res.) 212 | *-----------------------------*/ 213 | #ifndef USE_GC9A01 214 | # define USE_GC9A01 0 215 | #endif 216 | 217 | #if USE_GC9A01 218 | /*No settings*/ 219 | #endif /*USE_GC9A01*/ 220 | 221 | /*------------------------------------------ 222 | * UC1610 (4 gray 160*[104|128]) 223 | * (EA DOGXL160 160x104 tested) 224 | *-----------------------------------------*/ 225 | #ifndef USE_UC1610 226 | # define USE_UC1610 0 227 | #endif 228 | 229 | #if USE_UC1610 230 | # define UC1610_HOR_RES LV_HOR_RES 231 | # define UC1610_VER_RES LV_VER_RES 232 | # define UC1610_INIT_CONTRAST 33 /* init contrast, values in [%] */ 233 | # define UC1610_INIT_HARD_RST 0 /* 1 : hardware reset at init, 0 : software reset */ 234 | # define UC1610_TOP_VIEW 0 /* 0 : Bottom View, 1 : Top View */ 235 | #endif /*USE_UC1610*/ 236 | 237 | /*------------------------------------------------- 238 | * SHARP memory in pixel monochrome display series 239 | * LS012B7DD01 (184x38 pixels.) 240 | * LS013B7DH03 (128x128 pixels.) 241 | * LS013B7DH05 (144x168 pixels.) 242 | * LS027B7DH01 (400x240 pixels.) (tested) 243 | * LS032B7DD02 (336x536 pixels.) 244 | * LS044Q7DH01 (320x240 pixels.) 245 | *------------------------------------------------*/ 246 | #ifndef USE_SHARP_MIP 247 | # define USE_SHARP_MIP 0 248 | #endif 249 | 250 | #if USE_SHARP_MIP 251 | # define SHARP_MIP_HOR_RES LV_HOR_RES 252 | # define SHARP_MIP_VER_RES LV_VER_RES 253 | # define SHARP_MIP_SOFT_COM_INVERSION 0 254 | # define SHARP_MIP_REV_BYTE(b) /*((uint8_t) __REV(__RBIT(b)))*/ /*Architecture / compiler dependent byte bits order reverse*/ 255 | #endif /*USE_SHARP_MIP*/ 256 | 257 | /*------------------------------------------------- 258 | * ILI9341 240X320 TFT LCD 259 | *------------------------------------------------*/ 260 | #ifndef USE_ILI9341 261 | # define USE_ILI9341 0 262 | #endif 263 | 264 | #if USE_ILI9341 265 | # define ILI9341_HOR_RES LV_HOR_RES 266 | # define ILI9341_VER_RES LV_VER_RES 267 | # define ILI9341_GAMMA 1 268 | # define ILI9341_TEARING 0 269 | #endif /*USE_ILI9341*/ 270 | 271 | /*----------------------------------------- 272 | * Linux frame buffer device (/dev/fbx) 273 | *-----------------------------------------*/ 274 | #ifndef USE_FBDEV 275 | # define USE_FBDEV 1 276 | #endif 277 | 278 | #if USE_FBDEV 279 | # define FBDEV_PATH "/dev/fb0" 280 | #endif 281 | 282 | /*----------------------------------------- 283 | * FreeBSD frame buffer device (/dev/fbx) 284 | *.........................................*/ 285 | #ifndef USE_BSD_FBDEV 286 | # define USE_BSD_FBDEV 0 287 | #endif 288 | 289 | #if USE_BSD_FBDEV 290 | # define FBDEV_PATH "/dev/fb0" 291 | #endif 292 | 293 | /*----------------------------------------- 294 | * DRM/KMS device (/dev/dri/cardX) 295 | *-----------------------------------------*/ 296 | #ifndef USE_DRM 297 | # define USE_DRM 0 298 | #endif 299 | 300 | #if USE_DRM 301 | # define DRM_CARD "/dev/dri/card0" 302 | # define DRM_CONNECTOR_ID -1 /* -1 for the first connected one */ 303 | #endif 304 | 305 | /********************* 306 | * INPUT DEVICES 307 | *********************/ 308 | 309 | /*-------------- 310 | * XPT2046 311 | *--------------*/ 312 | #ifndef USE_XPT2046 313 | # define USE_XPT2046 0 314 | #endif 315 | 316 | #if USE_XPT2046 317 | # define XPT2046_HOR_RES 480 318 | # define XPT2046_VER_RES 320 319 | # define XPT2046_X_MIN 200 320 | # define XPT2046_Y_MIN 200 321 | # define XPT2046_X_MAX 3800 322 | # define XPT2046_Y_MAX 3800 323 | # define XPT2046_AVG 4 324 | # define XPT2046_X_INV 0 325 | # define XPT2046_Y_INV 0 326 | # define XPT2046_XY_SWAP 0 327 | #endif 328 | 329 | /*----------------- 330 | * FT5406EE8 331 | *-----------------*/ 332 | #ifndef USE_FT5406EE8 333 | # define USE_FT5406EE8 0 334 | #endif 335 | 336 | #if USE_FT5406EE8 337 | # define FT5406EE8_I2C_ADR 0x38 /*7 bit address*/ 338 | #endif 339 | 340 | /*--------------- 341 | * AD TOUCH 342 | *--------------*/ 343 | #ifndef USE_AD_TOUCH 344 | # define USE_AD_TOUCH 0 345 | #endif 346 | 347 | #if USE_AD_TOUCH 348 | /*No settings*/ 349 | #endif 350 | 351 | 352 | /*--------------------------------------- 353 | * Mouse or touchpad on PC (using SDL) 354 | *-------------------------------------*/ 355 | #ifndef USE_MOUSE 356 | # define USE_MOUSE 0 357 | #endif 358 | 359 | #if USE_MOUSE 360 | /*No settings*/ 361 | #endif 362 | 363 | /*------------------------------------------- 364 | * Mousewheel as encoder on PC (using SDL) 365 | *------------------------------------------*/ 366 | #ifndef USE_MOUSEWHEEL 367 | # define USE_MOUSEWHEEL 0 368 | #endif 369 | 370 | #if USE_MOUSEWHEEL 371 | /*No settings*/ 372 | #endif 373 | 374 | /*------------------------------------------------- 375 | * Touchscreen as libinput interface (for Linux based systems) 376 | *------------------------------------------------*/ 377 | #ifndef USE_LIBINPUT 378 | # define USE_LIBINPUT 0 379 | #endif 380 | 381 | #if USE_LIBINPUT 382 | # define LIBINPUT_NAME "/dev/input/event0" /*You can use the "evtest" Linux tool to get the list of devices and test them*/ 383 | #endif /*USE_LIBINPUT*/ 384 | 385 | /*------------------------------------------------- 386 | * Mouse or touchpad as evdev interface (for Linux based systems) 387 | *------------------------------------------------*/ 388 | #ifndef USE_EVDEV 389 | # define USE_EVDEV 1 390 | #endif 391 | 392 | #ifndef USE_BSD_EVDEV 393 | # define USE_BSD_EVDEV 0 394 | #endif 395 | 396 | #if USE_EVDEV || USE_BSD_EVDEV 397 | #if (LV_COLOR_DEPTH == 32) 398 | # define EVDEV_NAME "/dev/input/event7" /*You can use the "evtest" Linux tool to get the list of devices and test them*/ 399 | #else 400 | # define EVDEV_NAME "/dev/input/event0" /*You can use the "evtest" Linux tool to get the list of devices and test them*/ 401 | #endif 402 | # define EVDEV_SWAP_AXES 0 /*Swap the x and y axes of the touchscreen*/ 403 | 404 | # define EVDEV_CALIBRATE 1 /*Scale and offset the touchscreen coordinates by using maximum and minimum values for each axis*/ 405 | 406 | # if EVDEV_CALIBRATE 407 | # define EVDEV_HOR_MIN 0 /*to invert axis swap EVDEV_XXX_MIN by EVDEV_XXX_MAX*/ 408 | # define EVDEV_HOR_MAX 320 /*"evtest" Linux tool can help to get the correct calibraion values>*/ 409 | # define EVDEV_VER_MIN 0 410 | # define EVDEV_VER_MAX 240 411 | # endif /*EVDEV_CALIBRATE*/ 412 | #endif /*USE_EVDEV*/ 413 | 414 | /*------------------------------- 415 | * Keyboard of a PC (using SDL) 416 | *------------------------------*/ 417 | #ifndef USE_KEYBOARD 418 | # define USE_KEYBOARD 0 419 | #endif 420 | 421 | #if USE_KEYBOARD 422 | /*No settings*/ 423 | #endif 424 | 425 | #endif /*LV_DRV_CONF_H*/ 426 | 427 | #endif /*End of "Content enable"*/ 428 | -------------------------------------------------------------------------------- /launcher/src/launcher.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file launcher.c 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | #include "../launcher.h" 10 | 11 | /********************* 12 | * DEFINES 13 | *********************/ 14 | 15 | /********************** 16 | * TYPEDEFS 17 | **********************/ 18 | lv_obj_t * main_win; 19 | lv_canvas_t *nes_canvas; 20 | 21 | /********************** 22 | * STATIC PROTOTYPES 23 | **********************/ 24 | static void create_app_icon_list(void); 25 | 26 | static void dock_menu_event_handler(lv_event_t *e); 27 | static void desktop_tbv_event_handler(lv_event_t *e); 28 | static void back_btn_event_handler(lv_event_t *e); 29 | static void event_handler(lv_event_t *e); 30 | /********************** 31 | * STATIC VARIABLES 32 | **********************/ 33 | 34 | static lv_obj_t * desktop_tbv; 35 | static lv_style_t desktop_style; 36 | 37 | // desktop_tbv tabview 38 | static lv_obj_t *desktop_left; 39 | static lv_obj_t *desktop_main; 40 | static lv_obj_t *desktop_right; 41 | 42 | static lv_obj_t *desktop_tabview_list[] = { 43 | &desktop_left, &desktop_main, &desktop_right 44 | }; 45 | 46 | // application icon 47 | static lv_obj_t *photos_imgbtn; 48 | static lv_obj_t *setting_imgbtn; 49 | static lv_obj_t *camera_imgbtn; 50 | static lv_obj_t *calendar_imgbtn; 51 | static lv_obj_t *message_imgbtn; 52 | static lv_obj_t *calculator_imgbtn; 53 | static lv_obj_t *app_store_imgbtn; 54 | static lv_obj_t *music_imgbtn; 55 | 56 | static lv_obj_t *clock_imgbtn; 57 | static lv_obj_t *home_imgbtn; 58 | static lv_obj_t *notes_imgbtn; 59 | static lv_obj_t *facetime_imgbtn; 60 | static lv_obj_t *health_imgbtn; 61 | static lv_obj_t *shortcuts_imgbtn; 62 | static lv_obj_t *mail_imgbtn; 63 | static lv_obj_t *news_imgbtn; 64 | 65 | static lv_obj_t *measure_imgbtn; 66 | static lv_obj_t *safari_imgbtn; 67 | static lv_obj_t *wallet_imgbtn; 68 | static lv_obj_t *apple_tv_imgbtn; 69 | static lv_obj_t *books_imgbtn; 70 | static lv_obj_t *files_imgbtn; 71 | static lv_obj_t *weather_imgbtn; 72 | static lv_obj_t *clips_imgbtn; 73 | 74 | static lv_obj_t *app_wigets_list[] = { 75 | &photos_imgbtn, &setting_imgbtn, &camera_imgbtn, &calendar_imgbtn, 76 | &message_imgbtn, &calculator_imgbtn, &app_store_imgbtn, &music_imgbtn, 77 | 78 | &clock_imgbtn, &home_imgbtn, ¬es_imgbtn, &facetime_imgbtn, 79 | &health_imgbtn, &shortcuts_imgbtn, &mail_imgbtn, &news_imgbtn, 80 | 81 | &measure_imgbtn, &safari_imgbtn, &wallet_imgbtn, &apple_tv_imgbtn, 82 | &books_imgbtn, &files_imgbtn, &weather_imgbtn, &clips_imgbtn 83 | }; 84 | 85 | // dock menu 86 | static lv_obj_t *pi_menu_btn; 87 | static lv_obj_t *linux_menu_btn; 88 | static lv_obj_t *imliubo_menu_btn; 89 | 90 | static lv_obj_t *dock_menu_list[] = { 91 | &linux_menu_btn, &pi_menu_btn, &imliubo_menu_btn 92 | }; 93 | 94 | // tab pos led 95 | static lv_obj_t *tab_pos_0; 96 | static lv_obj_t *tab_pos_1; 97 | static lv_obj_t *tab_pos_2; 98 | static lv_style_t led_style; 99 | static lv_color_t led_color; 100 | 101 | static lv_obj_t *tab_pos_led_list[] = { 102 | &tab_pos_0, &tab_pos_1, &tab_pos_2 103 | }; 104 | 105 | static lv_obj_t * back_btn; 106 | 107 | // menu icons 108 | LV_IMG_DECLARE(photos); 109 | LV_IMG_DECLARE(settings); 110 | LV_IMG_DECLARE(camera); 111 | LV_IMG_DECLARE(calendar); 112 | LV_IMG_DECLARE(message); 113 | LV_IMG_DECLARE(calculator); 114 | LV_IMG_DECLARE(appstore); 115 | LV_IMG_DECLARE(music); 116 | LV_IMG_DECLARE(clocks); 117 | LV_IMG_DECLARE(home); 118 | LV_IMG_DECLARE(notes); 119 | LV_IMG_DECLARE(facetime); 120 | LV_IMG_DECLARE(health); 121 | LV_IMG_DECLARE(nes_menu); 122 | LV_IMG_DECLARE(mail); 123 | LV_IMG_DECLARE(news); 124 | LV_IMG_DECLARE(measure); 125 | LV_IMG_DECLARE(safari); 126 | LV_IMG_DECLARE(wallet); 127 | LV_IMG_DECLARE(appletv); 128 | LV_IMG_DECLARE(books); 129 | LV_IMG_DECLARE(files); 130 | LV_IMG_DECLARE(weather); 131 | LV_IMG_DECLARE(clips); 132 | 133 | static const lv_img_dsc_t *app_icon_list[] = { 134 | &photos, &settings, &camera, &calendar, 135 | &message, &calculator, &appstore, &music, 136 | 137 | &clocks, &home, ¬es, &facetime, 138 | &health, &nes_menu, &mail, &news, 139 | 140 | &measure, &safari, &wallet, &appletv, 141 | &books, &files, &weather, &clips 142 | }; 143 | 144 | LV_IMG_DECLARE(linux_menu); 145 | LV_IMG_DECLARE(pi_menu); 146 | LV_IMG_DECLARE(IAMLIUBO); 147 | static const lv_img_dsc_t *dock_icon_list[] = { 148 | &linux_menu, &pi_menu, &IAMLIUBO 149 | }; 150 | 151 | lv_obj_t * app_win; 152 | /********************** 153 | * MACROS 154 | **********************/ 155 | 156 | /********************** 157 | * GLOBAL FUNCTIONS 158 | **********************/ 159 | void launcher_widgets(void) 160 | { 161 | lv_style_init(&desktop_style); 162 | LV_IMG_DECLARE(background_dock); 163 | lv_style_set_bg_img_src(&desktop_style, &background_dock); 164 | lv_style_set_bg_opa(&desktop_style, 100); 165 | 166 | led_color.ch.red = 255; 167 | led_color.ch.green = 255; 168 | led_color.ch.blue = 255; 169 | #if (LV_COLOR_DEPTH == 32) 170 | led_color.ch.alpha = 0; 171 | #endif 172 | lv_style_init(&led_style); 173 | lv_style_set_shadow_opa(&led_style, 0); 174 | lv_style_set_bg_color(&led_style, led_color); 175 | lv_style_set_bg_opa(&led_style, 100); 176 | 177 | main_win = lv_scr_act(); 178 | desktop_tbv = lv_tabview_create(main_win, LV_DIR_TOP, 0); 179 | lv_obj_add_event_cb(desktop_tbv, desktop_tbv_event_handler, LV_EVENT_VALUE_CHANGED, NULL); 180 | lv_obj_set_size(desktop_tbv, 320, 240); 181 | lv_obj_add_style(desktop_tbv, &desktop_style, 0); // background 182 | 183 | create_app_icon_list(); 184 | } 185 | 186 | /********************** 187 | * STATIC FUNCTIONS 188 | **********************/ 189 | static void create_app_icon_list(void) 190 | { 191 | int16_t app_x_offset = 0, app_y_offset = 0, dock_offset = -76, led_offset = -15, count = 0; 192 | 193 | for (size_t pages = 0; pages < 3; pages++) { 194 | desktop_tabview_list[pages] = lv_tabview_add_tab(desktop_tbv, "tabview"); 195 | app_y_offset = -8; 196 | for (size_t y = 0; y < 2; y++) { 197 | app_x_offset = 0; 198 | for (size_t x = 0; x < 4; x ++) { 199 | app_wigets_list[count] = lv_imgbtn_create(desktop_tabview_list[pages]); 200 | lv_obj_set_width(app_wigets_list[count], APPLICATION_ICON_SIZE); 201 | lv_obj_set_height(app_wigets_list[count], APPLICATION_ICON_SIZE); 202 | lv_imgbtn_set_src(app_wigets_list[count], LV_IMGBTN_STATE_PRESSED, NULL, app_icon_list[count], NULL); 203 | lv_imgbtn_set_src(app_wigets_list[count], LV_IMGBTN_STATE_RELEASED, NULL, app_icon_list[count], NULL); 204 | lv_obj_align(app_wigets_list[count], LV_ALIGN_TOP_LEFT, app_x_offset, app_y_offset); 205 | lv_obj_set_user_data(app_wigets_list[count], (uint16_t)count); 206 | lv_obj_add_event_cb(app_wigets_list[count], event_handler, LV_EVENT_LONG_PRESSED, NULL); 207 | app_x_offset += 76; // 64 + 12 208 | count += 1; 209 | } 210 | app_y_offset += 76; // 64 + 12 211 | } 212 | 213 | tab_pos_led_list[pages] = lv_led_create(main_win); 214 | lv_led_set_color(tab_pos_led_list[pages], led_color); 215 | lv_obj_add_style(tab_pos_led_list[pages], &led_style, 0); 216 | lv_led_set_brightness(tab_pos_led_list[pages], 5); 217 | lv_obj_set_width(tab_pos_led_list[pages], 5); 218 | lv_obj_set_height(tab_pos_led_list[pages], 5); 219 | lv_obj_align(tab_pos_led_list[pages], LV_ALIGN_BOTTOM_MID, led_offset, -80); 220 | led_offset += 15; 221 | 222 | dock_menu_list[pages] = lv_imgbtn_create(main_win); 223 | lv_obj_set_width(dock_menu_list[pages], APPLICATION_ICON_SIZE); 224 | lv_obj_set_height(dock_menu_list[pages], APPLICATION_ICON_SIZE); 225 | lv_imgbtn_set_src(dock_menu_list[pages], LV_IMGBTN_STATE_PRESSED, NULL, dock_icon_list[pages], NULL); 226 | lv_imgbtn_set_src(dock_menu_list[pages], LV_IMGBTN_STATE_RELEASED, NULL, dock_icon_list[pages], NULL); 227 | lv_obj_add_event_cb(dock_menu_list[pages], dock_menu_event_handler, LV_EVENT_LONG_PRESSED, NULL); 228 | lv_obj_align(dock_menu_list[pages], LV_ALIGN_BOTTOM_MID, dock_offset, -5); 229 | dock_offset += 76; 230 | } 231 | lv_tabview_set_act(desktop_tbv, 0, LV_ANIM_OFF); 232 | lv_led_on(tab_pos_led_list[0]); 233 | } 234 | 235 | 236 | static void create_back_btn(lv_obj_t *win, lv_event_cb_t *event_cb, void *user_data) 237 | { 238 | back_btn = lv_imgbtn_create(win); 239 | lv_obj_set_width(back_btn, 25); 240 | lv_obj_set_height(back_btn, 25); 241 | lv_obj_set_user_data(back_btn, user_data); 242 | LV_IMG_DECLARE(backhome); 243 | lv_imgbtn_set_src(back_btn, LV_IMGBTN_STATE_PRESSED, NULL, &backhome, NULL); 244 | lv_imgbtn_set_src(back_btn, LV_IMGBTN_STATE_RELEASED, NULL, &backhome, NULL); 245 | lv_obj_align(back_btn, LV_ALIGN_TOP_LEFT, 0, 0); 246 | lv_obj_add_event_cb(back_btn, event_cb, LV_EVENT_PRESSED, NULL); 247 | } 248 | 249 | static void dock_menu_event_handler(lv_event_t *e) 250 | { 251 | lv_obj_t *obj = lv_event_get_target(e); 252 | if (obj == dock_menu_list[0]) 253 | { 254 | static lv_color_t cbuf[LV_CANVAS_BUF_SIZE_TRUE_COLOR(320, 240)]; 255 | app_win = lv_canvas_create(main_win); 256 | lv_obj_set_size(app_win, 320, 240); 257 | lv_canvas_set_buffer(app_win, cbuf, 320, 240, LV_IMG_CF_TRUE_COLOR); 258 | lv_canvas_fill_bg(app_win, lv_color_make(0xFF, 0xFF, 0xFF), 0); 259 | lv_obj_t * qr = lv_qrcode_create(app_win, 120, lv_color_make(255, 255, 255), lv_color_make(0, 0, 0)); 260 | lv_qrcode_update(qr, "https://www.kernel.org/", strlen("https://www.kernel.org/")); 261 | lv_obj_align(qr, LV_ALIGN_CENTER, 0, -20); 262 | 263 | lv_obj_t * label = lv_label_create(app_win); 264 | lv_label_set_text(label, "Linux Kernel"); 265 | lv_obj_align(label, LV_ALIGN_BOTTOM_MID, 0, -50); 266 | create_back_btn(main_win, back_btn_event_handler, LINUX); 267 | } 268 | else if (obj == dock_menu_list[1]) 269 | { 270 | static lv_color_t cbuf[LV_CANVAS_BUF_SIZE_TRUE_COLOR(320, 240)]; 271 | app_win = lv_canvas_create(main_win); 272 | lv_obj_set_size(app_win, 320, 240); 273 | lv_canvas_set_buffer(app_win, cbuf, 320, 240, LV_IMG_CF_TRUE_COLOR); 274 | lv_canvas_fill_bg(app_win, lv_color_make(0xFF, 0xFF, 0xFF), 0); 275 | lv_obj_t * qr = lv_qrcode_create(app_win, 150, lv_color_make(255, 255, 255), lv_color_make(0, 0, 0)); 276 | lv_qrcode_update(qr, "https://github.com/imliubo/M5Pi", strlen("https://github.com/imliubo/M5Pi")); 277 | lv_obj_align(qr, LV_ALIGN_CENTER, 0, 0); 278 | 279 | lv_obj_t * label = lv_label_create(app_win); 280 | lv_label_set_text(label, "M5Pi Project Github Repo"); 281 | lv_obj_align(label, LV_ALIGN_BOTTOM_MID, 0, -25); 282 | create_back_btn(main_win, back_btn_event_handler, PI); 283 | } 284 | else if (obj == dock_menu_list[2]) 285 | { 286 | static lv_color_t cbuf[LV_CANVAS_BUF_SIZE_TRUE_COLOR(320, 240)]; 287 | app_win = lv_canvas_create(main_win); 288 | lv_obj_set_size(app_win, 320, 240); 289 | lv_canvas_set_buffer(app_win, cbuf, 320, 240, LV_IMG_CF_TRUE_COLOR); 290 | lv_canvas_fill_bg(app_win, lv_color_make(0xFF, 0xFF, 0xFF), 0); 291 | lv_obj_t * qr = lv_qrcode_create(app_win, 150, lv_color_make(255, 255, 255), lv_color_make(0, 0, 0)); 292 | lv_qrcode_update(qr, "https://space.bilibili.com/31532108", strlen("https://space.bilibili.com/31532108")); 293 | lv_obj_align(qr, LV_ALIGN_CENTER, 0, 0); 294 | 295 | lv_obj_t * label = lv_label_create(app_win); 296 | lv_label_set_text(label, "Subscribe me!"); 297 | lv_obj_align(label, LV_ALIGN_BOTTOM_MID, 0, -25); 298 | create_back_btn(main_win, back_btn_event_handler, LIUBO); 299 | } 300 | } 301 | 302 | static void desktop_tbv_event_handler(lv_event_t *e) 303 | { 304 | lv_event_code_t code = lv_event_get_code(e); 305 | lv_obj_t *obj = lv_event_get_target(e); 306 | if(code == LV_EVENT_VALUE_CHANGED){ 307 | switch (lv_tabview_get_tab_act(obj)) 308 | { 309 | case 0: 310 | lv_led_on(tab_pos_led_list[0]); 311 | lv_led_off(tab_pos_led_list[1]); 312 | lv_led_off(tab_pos_led_list[2]); 313 | break; 314 | case 1: 315 | lv_led_on(tab_pos_led_list[1]); 316 | lv_led_off(tab_pos_led_list[0]); 317 | lv_led_off(tab_pos_led_list[2]); 318 | break; 319 | case 2: 320 | lv_led_on(tab_pos_led_list[2]); 321 | lv_led_off(tab_pos_led_list[0]); 322 | lv_led_off(tab_pos_led_list[1]); 323 | break; 324 | default: 325 | break; 326 | } 327 | } 328 | } 329 | 330 | static void back_btn_event_handler(lv_event_t *e) 331 | { 332 | // lv_event_code_t code = lv_event_get_code(e); 333 | lv_obj_t *obj = lv_event_get_current_target(e); 334 | 335 | switch ((app_list_code_t)obj->user_data) 336 | { 337 | case PHOTOS: 338 | case SETTINGS: 339 | case CAMERA: 340 | case CALENDAR: 341 | case MESSAGE: 342 | case CALCULATOR: 343 | case APP_STORE: 344 | case MUSIC: 345 | case CLOCK: 346 | case HOME: 347 | case NOTES: 348 | case FACETIME: 349 | case HEALTH: 350 | case MAIL: 351 | case NEWS: 352 | case MEASURE: 353 | case SAFARI: 354 | case WALLET: 355 | case APPLE_TV: 356 | case BOOKS: 357 | case FILES: 358 | case WEATHER: 359 | case CLIPS: 360 | case LINUX: 361 | case PI: 362 | case LIUBO: 363 | lv_obj_del(app_win); // delete app win 364 | lv_obj_del(obj); // delete back btn 365 | break; 366 | case NES: 367 | assert(nes_tid); 368 | pthread_cancel(nes_tid); // exit nes thread 369 | pthread_join(nes_tid, NULL); 370 | lv_obj_del(nes_canvas); // delete nes_canvas 371 | lv_obj_del(obj); 372 | break; 373 | default: 374 | break; 375 | } 376 | } 377 | 378 | static void event_handler(lv_event_t *e) 379 | { 380 | lv_obj_t *obj = lv_event_get_target(e); 381 | 382 | if((app_list_code_t)obj->user_data > APP_LIST_CODE_MAX) 383 | { 384 | return; 385 | } 386 | 387 | switch ((app_list_code_t)obj->user_data) { 388 | case PHOTOS: 389 | case SETTINGS: 390 | case CAMERA: 391 | case CALENDAR: 392 | case MESSAGE: 393 | case CALCULATOR: 394 | case APP_STORE: 395 | case CLOCK: 396 | case HOME: 397 | case NOTES: 398 | case FACETIME: 399 | case HEALTH: 400 | case MAIL: 401 | case NEWS: 402 | case MEASURE: 403 | case SAFARI: 404 | case WALLET: 405 | case APPLE_TV: 406 | case BOOKS: 407 | case FILES: 408 | case WEATHER: 409 | case CLIPS: 410 | { 411 | static lv_color_t cbuf[LV_CANVAS_BUF_SIZE_TRUE_COLOR(320, 240)]; 412 | app_win = lv_canvas_create(main_win); 413 | lv_obj_set_size(app_win, 320, 240); 414 | lv_canvas_set_buffer(app_win, cbuf, 320, 240, LV_IMG_CF_TRUE_COLOR); 415 | lv_canvas_fill_bg(app_win, lv_color_make(0xFF, 0xFF, 0xFF), 0); 416 | 417 | lv_obj_t * img = lv_img_create(app_win); 418 | LV_IMG_DECLARE(under_construction) 419 | lv_img_set_src(img, &under_construction); 420 | lv_obj_align(img, LV_ALIGN_CENTER, 0, -10); 421 | 422 | lv_obj_t * label = lv_label_create(app_win); 423 | lv_label_set_text(label, "Under construction"); 424 | lv_obj_align(label, LV_ALIGN_CENTER, 0, 40); 425 | create_back_btn(main_win, back_btn_event_handler, obj->user_data); 426 | } 427 | break; 428 | case MUSIC: 429 | app_win = lv_win_create(main_win, 0); 430 | lv_obj_set_size(app_win, 320, 240); 431 | lv_demo_music(app_win); 432 | 433 | create_back_btn(main_win, &back_btn_event_handler, obj->user_data); 434 | break; 435 | case NES: 436 | nes_canvas = lv_canvas_create(main_win); 437 | lv_obj_align(main_win, LV_ALIGN_TOP_MID, 0, 0); 438 | create_back_btn(main_win, &back_btn_event_handler, obj->user_data); 439 | nes_init("./SuperMario.nes"); // TODO 440 | break; 441 | default: break; 442 | } 443 | } 444 | -------------------------------------------------------------------------------- /lv_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_conf.h 3 | * Configuration file for v8.1.0-dev 4 | */ 5 | 6 | /* 7 | * COPY THIS FILE AS `lv_conf.h` NEXT TO the `lvgl` FOLDER 8 | */ 9 | 10 | #if 1 /*Set it to "1" to enable content*/ 11 | 12 | #ifndef LV_CONF_H 13 | #define LV_CONF_H 14 | /*clang-format off*/ 15 | 16 | #include 17 | 18 | 19 | /*==================== 20 | COLOR SETTINGS 21 | *====================*/ 22 | 23 | /*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ 24 | #define LV_COLOR_DEPTH 32 25 | 26 | /*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ 27 | #define LV_COLOR_16_SWAP 0 28 | 29 | /*Enable more complex drawing routines to manage screens transparency. 30 | *Can be used if the UI is above another layer, e.g. an OSD menu or video player. 31 | *Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to non LV_OPA_COVER value*/ 32 | #define LV_COLOR_SCREEN_TRANSP 0 33 | 34 | /*Images pixels with this color will not be drawn if they are chroma keyed)*/ 35 | #define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/ 36 | 37 | /*========================= 38 | MEMORY SETTINGS 39 | *=========================*/ 40 | 41 | /*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/ 42 | #define LV_MEM_CUSTOM 0 43 | #if LV_MEM_CUSTOM == 0 44 | /*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ 45 | # define LV_MEM_SIZE (1024 * 1024U) /*[bytes]*/ 46 | 47 | /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ 48 | # define LV_MEM_ADR 0 /*0: unused*/ 49 | #else /*LV_MEM_CUSTOM*/ 50 | # define LV_MEM_CUSTOM_INCLUDE /*Header for the dynamic memory function*/ 51 | # define LV_MEM_CUSTOM_ALLOC malloc 52 | # define LV_MEM_CUSTOM_FREE free 53 | # define LV_MEM_CUSTOM_REALLOC realloc 54 | #endif /*LV_MEM_CUSTOM*/ 55 | 56 | /*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/ 57 | #define LV_MEMCPY_MEMSET_STD 0 58 | 59 | /*==================== 60 | HAL SETTINGS 61 | *====================*/ 62 | 63 | /*Default display refresh period. LVG will redraw changed ares with this period time*/ 64 | #define LV_DISP_DEF_REFR_PERIOD 1 /*[ms]*/ 65 | 66 | /*Input device read period in milliseconds*/ 67 | #define LV_INDEV_DEF_READ_PERIOD 20 /*[ms]*/ 68 | 69 | /*Use a custom tick source that tells the elapsed time in milliseconds. 70 | *It removes the need to manually update the tick with `lv_tick_inc()`)*/ 71 | uint32_t custom_tick_get(void); 72 | #define LV_TICK_CUSTOM 1 73 | #if LV_TICK_CUSTOM 74 | #define LV_TICK_CUSTOM_INCLUDE /*Header for the system time function*/ 75 | #define LV_TICK_CUSTOM_SYS_TIME_EXPR (custom_tick_get()) /*Expression evaluating to current system time in ms*/ 76 | #endif /*LV_TICK_CUSTOM*/ 77 | 78 | /*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. 79 | *(Not so important, you can adjust it to modify default sizes and spaces)*/ 80 | #define LV_DPI_DEF 130 /*[px/inch]*/ 81 | 82 | /*======================= 83 | * FEATURE CONFIGURATION 84 | *=======================*/ 85 | 86 | /*------------- 87 | * Drawing 88 | *-----------*/ 89 | 90 | /*Enable complex draw engine. 91 | *Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/ 92 | #define LV_DRAW_COMPLEX 1 93 | #if LV_DRAW_COMPLEX != 0 94 | 95 | /*Allow buffering some shadow calculation. 96 | *LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` 97 | *Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/ 98 | #define LV_SHADOW_CACHE_SIZE 0 99 | #endif /*LV_DRAW_COMPLEX*/ 100 | 101 | /*Default image cache size. Image caching keeps the images opened. 102 | *If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added) 103 | *With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. 104 | *However the opened images might consume additional RAM. 105 | *0: to disable caching*/ 106 | #define LV_IMG_CACHE_DEF_SIZE 0 107 | 108 | /*Maximum buffer size to allocate for rotation. Only used if software rotation is enabled in the display driver.*/ 109 | #define LV_DISP_ROT_MAX_BUF (10*1024) 110 | /*------------- 111 | * GPU 112 | *-----------*/ 113 | 114 | /*Use STM32's DMA2D (aka Chrom Art) GPU*/ 115 | #define LV_USE_GPU_STM32_DMA2D 0 116 | #if LV_USE_GPU_STM32_DMA2D 117 | /*Must be defined to include path of CMSIS header of target processor 118 | e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ 119 | #define LV_GPU_DMA2D_CMSIS_INCLUDE 120 | #endif 121 | 122 | /*Use NXP's PXP GPU iMX RTxxx platforms*/ 123 | #define LV_USE_GPU_NXP_PXP 0 124 | #if LV_USE_GPU_NXP_PXP 125 | /*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) 126 | * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol FSL_RTOS_FREE_RTOS 127 | * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected. 128 | *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() 129 | */ 130 | #define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 131 | #endif 132 | 133 | /*Use NXP's VG-Lite GPU iMX RTxxx platforms*/ 134 | #define LV_USE_GPU_NXP_VG_LITE 0 135 | 136 | /*------------- 137 | * Logging 138 | *-----------*/ 139 | 140 | /*Enable the log module*/ 141 | #define LV_USE_LOG 1 142 | #if LV_USE_LOG 143 | 144 | /*How important log should be added: 145 | *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information 146 | *LV_LOG_LEVEL_INFO Log important events 147 | *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem 148 | *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail 149 | *LV_LOG_LEVEL_USER Only logs added by the user 150 | *LV_LOG_LEVEL_NONE Do not log anything*/ 151 | # define LV_LOG_LEVEL LV_LOG_LEVEL_ERROR 152 | 153 | /*1: Print the log with 'printf'; 154 | *0: User need to register a callback with `lv_log_register_print_cb()`*/ 155 | # define LV_LOG_PRINTF 1 156 | 157 | /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ 158 | # define LV_LOG_TRACE_MEM 1 159 | # define LV_LOG_TRACE_TIMER 1 160 | # define LV_LOG_TRACE_INDEV 1 161 | # define LV_LOG_TRACE_DISP_REFR 1 162 | # define LV_LOG_TRACE_EVENT 1 163 | # define LV_LOG_TRACE_OBJ_CREATE 1 164 | # define LV_LOG_TRACE_LAYOUT 1 165 | # define LV_LOG_TRACE_ANIM 1 166 | 167 | #endif /*LV_USE_LOG*/ 168 | 169 | /*------------- 170 | * Asserts 171 | *-----------*/ 172 | 173 | /*Enable asserts if an operation is failed or an invalid data is found. 174 | *If LV_USE_LOG is enabled an error message will be printed on failure*/ 175 | #define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/ 176 | #define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/ 177 | #define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/ 178 | #define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/ 179 | #define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ 180 | 181 | /*Add a custom handler when assert happens e.g. to restart the MCU*/ 182 | #define LV_ASSERT_HANDLER_INCLUDE 183 | #define LV_ASSERT_HANDLER while(1); /*Halt by default*/ 184 | 185 | /*------------- 186 | * Others 187 | *-----------*/ 188 | 189 | /*1: Show CPU usage and FPS count in the right bottom corner*/ 190 | #define LV_USE_PERF_MONITOR 0 191 | 192 | /*1: Show the used memory and the memory fragmentation in the left bottom corner 193 | * Requires LV_MEM_CUSTOM = 0*/ 194 | #define LV_USE_MEM_MONITOR 0 195 | 196 | /*1: Draw random colored rectangles over the redrawn areas*/ 197 | #define LV_USE_REFR_DEBUG 0 198 | 199 | /*Change the built in (v)snprintf functions*/ 200 | #define LV_SPRINTF_CUSTOM 0 201 | #if LV_SPRINTF_CUSTOM 202 | # define LV_SPRINTF_INCLUDE 203 | # define lv_snprintf snprintf 204 | # define lv_vsnprintf vsnprintf 205 | #else /*LV_SPRINTF_CUSTOM*/ 206 | # define LV_SPRINTF_USE_FLOAT 0 207 | #endif /*LV_SPRINTF_CUSTOM*/ 208 | 209 | #define LV_USE_USER_DATA 1 210 | 211 | /*Garbage Collector settings 212 | *Used if lvgl is binded to higher level language and the memory is managed by that language*/ 213 | #define LV_ENABLE_GC 0 214 | #if LV_ENABLE_GC != 0 215 | # define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ 216 | #endif /*LV_ENABLE_GC*/ 217 | 218 | /*===================== 219 | * COMPILER SETTINGS 220 | *====================*/ 221 | 222 | /*For big endian systems set to 1*/ 223 | #define LV_BIG_ENDIAN_SYSTEM 0 224 | 225 | /*Define a custom attribute to `lv_tick_inc` function*/ 226 | #define LV_ATTRIBUTE_TICK_INC 227 | 228 | /*Define a custom attribute to `lv_timer_handler` function*/ 229 | #define LV_ATTRIBUTE_TIMER_HANDLER 230 | 231 | /*Define a custom attribute to `lv_disp_flush_ready` function*/ 232 | #define LV_ATTRIBUTE_FLUSH_READY 233 | 234 | /*Required alignment size for buffers*/ 235 | #define LV_ATTRIBUTE_MEM_ALIGN_SIZE 236 | 237 | /*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). 238 | * E.g. __attribute__((aligned(4)))*/ 239 | #define LV_ATTRIBUTE_MEM_ALIGN 240 | 241 | /*Attribute to mark large constant arrays for example font's bitmaps*/ 242 | #define LV_ATTRIBUTE_LARGE_CONST 243 | 244 | /*Complier prefix for a big array declaration in RAM*/ 245 | #define LV_ATTRIBUTE_LARGE_RAM_ARRAY 246 | 247 | /*Place performance critical functions into a faster memory (e.g RAM)*/ 248 | #define LV_ATTRIBUTE_FAST_MEM 249 | 250 | /*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/ 251 | #define LV_ATTRIBUTE_DMA 252 | 253 | /*Export integer constant to binding. This macro is used with constants in the form of LV_ that 254 | *should also appear on LVGL binding API such as Micropython.*/ 255 | #define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ 256 | 257 | /*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/ 258 | #define LV_USE_LARGE_COORD 0 259 | 260 | /*================== 261 | * FONT USAGE 262 | *===================*/ 263 | 264 | /*Montserrat fonts with ASCII range and some symbols using bpp = 4 265 | *https://fonts.google.com/specimen/Montserrat*/ 266 | #define LV_FONT_MONTSERRAT_8 1 267 | #define LV_FONT_MONTSERRAT_10 1 268 | #define LV_FONT_MONTSERRAT_12 1 269 | #define LV_FONT_MONTSERRAT_14 1 270 | #define LV_FONT_MONTSERRAT_16 1 271 | #define LV_FONT_MONTSERRAT_18 1 272 | #define LV_FONT_MONTSERRAT_20 1 273 | #define LV_FONT_MONTSERRAT_22 1 274 | #define LV_FONT_MONTSERRAT_24 1 275 | #define LV_FONT_MONTSERRAT_26 1 276 | #define LV_FONT_MONTSERRAT_28 1 277 | #define LV_FONT_MONTSERRAT_30 1 278 | #define LV_FONT_MONTSERRAT_32 1 279 | #define LV_FONT_MONTSERRAT_34 1 280 | #define LV_FONT_MONTSERRAT_36 1 281 | #define LV_FONT_MONTSERRAT_38 1 282 | #define LV_FONT_MONTSERRAT_40 1 283 | #define LV_FONT_MONTSERRAT_42 1 284 | #define LV_FONT_MONTSERRAT_44 1 285 | #define LV_FONT_MONTSERRAT_46 1 286 | #define LV_FONT_MONTSERRAT_48 1 287 | 288 | /*Demonstrate special features*/ 289 | #define LV_FONT_MONTSERRAT_12_SUBPX 1 290 | #define LV_FONT_MONTSERRAT_28_COMPRESSED 1 /*bpp = 3*/ 291 | #define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 1 /*Hebrew, Arabic, Perisan letters and all their forms*/ 292 | #define LV_FONT_SIMSUN_16_CJK 1 /*1000 most common CJK radicals*/ 293 | 294 | /*Pixel perfect monospace fonts*/ 295 | #define LV_FONT_UNSCII_8 1 296 | #define LV_FONT_UNSCII_16 1 297 | 298 | /*Optionally declare custom fonts here. 299 | *You can use these fonts as default font too and they will be available globally. 300 | *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ 301 | #define LV_FONT_CUSTOM_DECLARE 302 | 303 | /*Always set a default font*/ 304 | #define LV_FONT_DEFAULT &lv_font_montserrat_14 305 | 306 | /*Enable handling large font and/or fonts with a lot of characters. 307 | *The limit depends on the font size, font face and bpp. 308 | *Compiler error will be triggered if a font needs it.*/ 309 | #define LV_FONT_FMT_TXT_LARGE 0 310 | 311 | /*Enables/disables support for compressed fonts.*/ 312 | #define LV_USE_FONT_COMPRESSED 0 313 | 314 | /*Enable subpixel rendering*/ 315 | #define LV_USE_FONT_SUBPX 0 316 | #if LV_USE_FONT_SUBPX 317 | /*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ 318 | #define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/ 319 | #endif 320 | 321 | /*================= 322 | * TEXT SETTINGS 323 | *=================*/ 324 | 325 | /** 326 | * Select a character encoding for strings. 327 | * Your IDE or editor should have the same character encoding 328 | * - LV_TXT_ENC_UTF8 329 | * - LV_TXT_ENC_ASCII 330 | */ 331 | #define LV_TXT_ENC LV_TXT_ENC_UTF8 332 | 333 | /*Can break (wrap) texts on these chars*/ 334 | #define LV_TXT_BREAK_CHARS " ,.;:-_" 335 | 336 | /*If a word is at least this long, will break wherever "prettiest" 337 | *To disable, set to a value <= 0*/ 338 | #define LV_TXT_LINE_BREAK_LONG_LEN 0 339 | 340 | /*Minimum number of characters in a long word to put on a line before a break. 341 | *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ 342 | #define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 343 | 344 | /*Minimum number of characters in a long word to put on a line after a break. 345 | *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ 346 | #define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 347 | 348 | /*The control character to use for signalling text recoloring.*/ 349 | #define LV_TXT_COLOR_CMD "#" 350 | 351 | /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. 352 | *The direction will be processed according to the Unicode Bidirectioanl Algorithm: 353 | *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ 354 | #define LV_USE_BIDI 0 355 | #if LV_USE_BIDI 356 | /*Set the default direction. Supported values: 357 | *`LV_BASE_DIR_LTR` Left-to-Right 358 | *`LV_BASE_DIR_RTL` Right-to-Left 359 | *`LV_BASE_DIR_AUTO` detect texts base direction*/ 360 | #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO 361 | #endif 362 | 363 | /*Enable Arabic/Persian processing 364 | *In these languages characters should be replaced with an other form based on their position in the text*/ 365 | #define LV_USE_ARABIC_PERSIAN_CHARS 0 366 | 367 | /*================== 368 | * WIDGET USAGE 369 | *================*/ 370 | 371 | /*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ 372 | 373 | #define LV_USE_ARC 1 374 | 375 | #define LV_USE_ANIMIMG 1 376 | 377 | #define LV_USE_BAR 1 378 | 379 | #define LV_USE_BTN 1 380 | 381 | #define LV_USE_BTNMATRIX 1 382 | 383 | #define LV_USE_CANVAS 1 384 | 385 | #define LV_USE_CHECKBOX 1 386 | 387 | 388 | #define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ 389 | 390 | #define LV_USE_IMG 1 /*Requires: lv_label*/ 391 | 392 | #define LV_USE_LABEL 1 393 | #if LV_USE_LABEL 394 | # define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ 395 | # define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ 396 | #endif 397 | 398 | #define LV_USE_LINE 1 399 | 400 | #define LV_USE_ROLLER 1 /*Requires: lv_label*/ 401 | #if LV_USE_ROLLER 402 | # define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/ 403 | #endif 404 | 405 | #define LV_USE_SLIDER 1 /*Requires: lv_bar*/ 406 | 407 | #define LV_USE_SWITCH 1 408 | 409 | #define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ 410 | #if LV_USE_TEXTAREA != 0 411 | # define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ 412 | #endif 413 | 414 | #define LV_USE_TABLE 1 415 | 416 | /*================== 417 | * EXTRA COMPONENTS 418 | *==================*/ 419 | 420 | /*----------- 421 | * Widgets 422 | *----------*/ 423 | #define LV_USE_CALENDAR 1 424 | #if LV_USE_CALENDAR 425 | # define LV_CALENDAR_WEEK_STARTS_MONDAY 0 426 | # if LV_CALENDAR_WEEK_STARTS_MONDAY 427 | # define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} 428 | # else 429 | # define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} 430 | # endif 431 | 432 | # define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} 433 | # define LV_USE_CALENDAR_HEADER_ARROW 1 434 | # define LV_USE_CALENDAR_HEADER_DROPDOWN 1 435 | #endif /*LV_USE_CALENDAR*/ 436 | 437 | #define LV_USE_CHART 1 438 | 439 | #define LV_USE_COLORWHEEL 1 440 | 441 | #define LV_USE_IMGBTN 1 442 | 443 | #define LV_USE_KEYBOARD 1 444 | 445 | #define LV_USE_LED 1 446 | 447 | #define LV_USE_LIST 1 448 | 449 | #define LV_USE_METER 1 450 | 451 | #define LV_USE_MSGBOX 1 452 | 453 | #define LV_USE_SPINBOX 1 454 | 455 | #define LV_USE_SPINNER 1 456 | 457 | #define LV_USE_TABVIEW 1 458 | 459 | #define LV_USE_TILEVIEW 1 460 | 461 | #define LV_USE_WIN 1 462 | 463 | #define LV_USE_SPAN 1 464 | #if LV_USE_SPAN 465 | /*A line text can contain maximum num of span descriptor */ 466 | # define LV_SPAN_SNIPPET_STACK_SIZE 64 467 | #endif 468 | 469 | /*----------- 470 | * Themes 471 | *----------*/ 472 | /*A simple, impressive and very complete theme*/ 473 | #define LV_USE_THEME_DEFAULT 1 474 | #if LV_USE_THEME_DEFAULT 475 | 476 | /*0: Light mode; 1: Dark mode*/ 477 | # define LV_THEME_DEFAULT_DARK 0 478 | 479 | /*1: Enable grow on press*/ 480 | # define LV_THEME_DEFAULT_GROW 1 481 | 482 | /*Default transition time in [ms]*/ 483 | # define LV_THEME_DEFAULT_TRANSITON_TIME 80 484 | #endif /*LV_USE_THEME_DEFAULT*/ 485 | 486 | /*An very simple them that is a good starting point for a custom theme*/ 487 | #define LV_USE_THEME_BASIC 1 488 | 489 | /*A theme designed for monochrome displays*/ 490 | #define LV_USE_THEME_MONO 1 491 | 492 | /*----------- 493 | * Layouts 494 | *----------*/ 495 | 496 | /*A layout similar to Flexbox in CSS.*/ 497 | #define LV_USE_FLEX 1 498 | 499 | /*A layout similar to Grid in CSS.*/ 500 | #define LV_USE_GRID 1 501 | 502 | /*================== 503 | * EXAMPLES 504 | *==================*/ 505 | 506 | /*Enable the examples to be built with the library*/ 507 | #define LV_BUILD_EXAMPLES 1 508 | 509 | /*File system interface*/ 510 | #define LV_USE_FS_IF 1 511 | #if LV_USE_FS_IF 512 | # define LV_FS_IF_FATFS '\0' 513 | # define LV_FS_IF_PC 'P' 514 | # define LV_FS_IF_POSIX '\0' 515 | #endif /*LV_USE_FS_IF*/ 516 | 517 | /*--END OF LV_CONF_H--*/ 518 | 519 | #endif /*LV_CONF_H*/ 520 | 521 | #endif /*End of "Content enable"*/ 522 | -------------------------------------------------------------------------------- /launcher/src/assets/source/mouse.c: -------------------------------------------------------------------------------- 1 | #if defined(LV_LVGL_H_INCLUDE_SIMPLE) 2 | #include "lvgl.h" 3 | #else 4 | #include "lvgl/lvgl.h" 5 | #endif 6 | 7 | 8 | #ifndef LV_ATTRIBUTE_MEM_ALIGN 9 | #define LV_ATTRIBUTE_MEM_ALIGN 10 | #endif 11 | 12 | #ifndef LV_ATTRIBUTE_IMG_MOUSE 13 | #define LV_ATTRIBUTE_IMG_MOUSE 14 | #endif 15 | 16 | const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_MOUSE uint8_t mouse_map[] = { 17 | #if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 18 | /*Pixel format: Blue: 2 bit, Green: 3 bit, Red: 3 bit, Alpha 8 bit */ 19 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 22 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 23 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x40, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 24 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x40, 0xff, 0xff, 0xff, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 25 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xe4, 0xff, 0xd3, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xab, 0xff, 0xff, 0xff, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x40, 0xff, 0xff, 0xff, 0xbc, 0xff, 0x43, 0xff, 0xfb, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x40, 0xff, 0xd0, 0xff, 0x14, 0x25, 0x00, 0xff, 0xa8, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x4c, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x9f, 0xff, 0x53, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | #endif 40 | #if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 0 41 | /*Pixel format: Blue: 5 bit, Green: 6 bit, Red: 5 bit, Alpha 8 bit*/ 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 53 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xe4, 0xff, 0xff, 0xd3, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xab, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x21, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0xff, 0xff, 0x43, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xd0, 0xff, 0xff, 0x14, 0x21, 0x08, 0x00, 0xff, 0xff, 0xa8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xff, 0xff, 0x53, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 62 | #endif 63 | #if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP != 0 64 | /*Pixel format: Blue: 5 bit Green: 6 bit, Red: 5 bit, Alpha 8 bit BUT the 2 color bytes are swapped*/ 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 76 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xe4, 0xff, 0xff, 0xd3, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xab, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0xff, 0xff, 0x43, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xff, 0xff, 0xd0, 0xff, 0xff, 0x14, 0x08, 0x21, 0x00, 0xff, 0xff, 0xa8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 80 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 81 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xff, 0xff, 0x53, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 82 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 83 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 84 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 85 | #endif 86 | #if LV_COLOR_DEPTH == 32 87 | /*Pixel format: Blue: 8 bit, Green: 8 bit, Red: 8 bit, Alpha: 8 bit*/ 88 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 89 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 90 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 91 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 92 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 93 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 94 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0xff, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 95 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 96 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 97 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 98 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 99 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xe4, 0xff, 0xff, 0xff, 0xd3, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 100 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xab, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 101 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0xff, 0xff, 0xff, 0x43, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 102 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0xd0, 0xff, 0xff, 0xff, 0x14, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xa8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 103 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x4c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 104 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 105 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 106 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 107 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 108 | #endif 109 | }; 110 | 111 | const lv_img_dsc_t mouse = { 112 | .header.always_zero = 0, 113 | .header.w = 20, 114 | .header.h = 20, 115 | .data_size = 400 * LV_IMG_PX_SIZE_ALPHA_BYTE, 116 | .header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA, 117 | .data = mouse_map, 118 | }; 119 | 120 | -------------------------------------------------------------------------------- /launcher/src/lvgl_nes.c: -------------------------------------------------------------------------------- 1 | /* */ 2 | /* lvgl_nes file : porting to lvgl */ 3 | /* */ 4 | /* 2001/05/18 InfoNES Project ( Sound is based on DarcNES ) */ 5 | /* */ 6 | /*===================================================================*/ 7 | 8 | /*-------------------------------------------------------------------*/ 9 | /* Include files */ 10 | /*-------------------------------------------------------------------*/ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include "InfoNES.h" 25 | #include "InfoNES_System.h" 26 | #include "InfoNES_pAPU.h" 27 | 28 | // bool define 29 | #define TRUE 1 30 | #define FALSE 0 31 | 32 | /* lcd 操作相关 头文件 */ 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include "lvgl/lvgl.h" 43 | #include "../launcher.h" 44 | 45 | #include 46 | 47 | static snd_pcm_t *playback_handle; 48 | 49 | static int fb_fd = 1; 50 | static int line_width; 51 | 52 | static int *zoom_x_tab; 53 | static int *zoom_y_tab; 54 | 55 | extern int InitJoypadInput(void); 56 | extern int GetJoypadInput(void); 57 | 58 | /*-------------------------------------------------------------------*/ 59 | /* ROM image file information */ 60 | /*-------------------------------------------------------------------*/ 61 | 62 | char szRomName[256]; 63 | char szSaveName[256]; 64 | int nSRAM_SaveFlag; 65 | 66 | /*-------------------------------------------------------------------*/ 67 | /* Constants ( Linux specific ) */ 68 | /*-------------------------------------------------------------------*/ 69 | 70 | #define VBOX_SIZE 7 71 | #define SOUND_DEVICE "/dev/dsp" 72 | #define VERSION "InfoNES v0.91J" 73 | 74 | /*-------------------------------------------------------------------*/ 75 | /* Global Variables ( Linux specific ) */ 76 | /*-------------------------------------------------------------------*/ 77 | 78 | /* Emulation thread */ 79 | pthread_t nes_tid; 80 | int bThread; 81 | 82 | /* Pad state */ 83 | DWORD dwKeyPad1; 84 | DWORD dwKeyPad2; 85 | DWORD dwKeySystem; 86 | 87 | /* For Sound Emulation */ 88 | BYTE final_wave[2048]; 89 | int waveptr; 90 | int wavflag; 91 | int sound_fd; 92 | 93 | /*-------------------------------------------------------------------*/ 94 | /* Function prototypes ( Linux specific ) */ 95 | /*-------------------------------------------------------------------*/ 96 | 97 | int make_zoom_tab(void); 98 | 99 | void *emulation_thread(void *args); 100 | 101 | void start_application(char *filename); 102 | 103 | int LoadSRAM(); 104 | 105 | int SaveSRAM(); 106 | 107 | /* Palette data */ 108 | #if (LV_COLOR_DEPTH == 16) 109 | WORD NesPalette[] = { 110 | 0xff000000 | ( 0x80 << 16 ) | (0x80 << 8) | ( 0x80 << 0), 111 | 0xff000000 | ( 0x00 << 16 ) | (0x00 << 8) | ( 0xBB << 0), 112 | 0xff000000 | ( 0x37 << 16 ) | (0x00 << 8) | ( 0xBF << 0), 113 | 0xff000000 | ( 0x84 << 16 ) | (0x00 << 8) | ( 0xA6 << 0), 114 | 0xff000000 | ( 0xBB << 16 ) | (0x00 << 8) | ( 0x6A << 0), 115 | 0xff000000 | ( 0xB7 << 16 ) | (0x00 << 8) | ( 0x1E << 0), 116 | 0xff000000 | ( 0xB3 << 16 ) | (0x00 << 8) | ( 0x00 << 0), 117 | 0xff000000 | ( 0x91 << 16 ) | (0x26 << 8) | ( 0x00 << 0), 118 | 0xff000000 | ( 0x7B << 16 ) | (0x2B << 8) | ( 0x00 << 0), 119 | 0xff000000 | ( 0x00 << 16 ) | (0x3E << 8) | ( 0x00 << 0), 120 | 0xff000000 | ( 0x00 << 16 ) | (0x48 << 8) | ( 0x0D << 0), 121 | 0xff000000 | ( 0x00 << 16 ) | (0x3C << 8) | ( 0x22 << 0), 122 | 0xff000000 | ( 0x00 << 16 ) | (0x2F << 8) | ( 0x66 << 0), 123 | 0xff000000 | ( 0x00 << 16 ) | (0x00 << 8) | ( 0x00 << 0), 124 | 0xff000000 | ( 0x05 << 16 ) | (0x05 << 8) | ( 0x05 << 0), 125 | 0xff000000 | ( 0x05 << 16 ) | (0x05 << 8) | ( 0x05 << 0), 126 | 0xff000000 | ( 0xC8 << 16 ) | (0xC8 << 8) | ( 0xC8 << 0), 127 | 0xff000000 | ( 0x00 << 16 ) | (0x59 << 8) | ( 0xFF << 0), 128 | 0xff000000 | ( 0x44 << 16 ) | (0x3C << 8) | ( 0xFF << 0), 129 | 0xff000000 | ( 0xB7 << 16 ) | (0x33 << 8) | ( 0xCC << 0), 130 | 0xff000000 | ( 0xFF << 16 ) | (0x33 << 8) | ( 0xAA << 0), 131 | 0xff000000 | ( 0xFF << 16 ) | (0x37 << 8) | ( 0x5E << 0), 132 | 0xff000000 | ( 0xFF << 16 ) | (0x37 << 8) | ( 0x1A << 0), 133 | 0xff000000 | ( 0xD5 << 16 ) | (0x4B << 8) | ( 0x00 << 0), 134 | 0xff000000 | ( 0xC4 << 16 ) | (0x62 << 8) | ( 0x00 << 0), 135 | 0xff000000 | ( 0x3C << 16 ) | (0x7B << 8) | ( 0x00 << 0), 136 | 0xff000000 | ( 0x1E << 16 ) | (0x84 << 8) | ( 0x15 << 0), 137 | 0xff000000 | ( 0x00 << 16 ) | (0x95 << 8) | ( 0x66 << 0), 138 | 0xff000000 | ( 0x00 << 16 ) | (0x84 << 8) | ( 0xC4 << 0), 139 | 0xff000000 | ( 0x11 << 16 ) | (0x11 << 8) | ( 0x11 << 0), 140 | 0xff000000 | ( 0x09 << 16 ) | (0x09 << 8) | ( 0x09 << 0), 141 | 0xff000000 | ( 0x09 << 16 ) | (0x09 << 8) | ( 0x09 << 0), 142 | 0xff000000 | ( 0xFF << 16 ) | (0xFF << 8) | ( 0xFF << 0), 143 | 0xff000000 | ( 0x00 << 16 ) | (0x95 << 8) | ( 0xFF << 0), 144 | 0xff000000 | ( 0x6F << 16 ) | (0x84 << 8) | ( 0xFF << 0), 145 | 0xff000000 | ( 0xD5 << 16 ) | (0x6F << 8) | ( 0xFF << 0), 146 | 0xff000000 | ( 0xFF << 16 ) | (0x77 << 8) | ( 0xCC << 0), 147 | 0xff000000 | ( 0xFF << 16 ) | (0x6F << 8) | ( 0x99 << 0), 148 | 0xff000000 | ( 0xFF << 16 ) | (0x7B << 8) | ( 0x59 << 0), 149 | 0xff000000 | ( 0xFF << 16 ) | (0x91 << 8) | ( 0x5F << 0), 150 | 0xff000000 | ( 0xFF << 16 ) | (0xA2 << 8) | ( 0x33 << 0), 151 | 0xff000000 | ( 0xA6 << 16 ) | (0xBF << 8) | ( 0x00 << 0), 152 | 0xff000000 | ( 0x51 << 16 ) | (0xD9 << 8) | ( 0x6A << 0), 153 | 0xff000000 | ( 0x4D << 16 ) | (0xD5 << 8) | ( 0xAE << 0), 154 | 0xff000000 | ( 0x00 << 16 ) | (0xD9 << 8) | ( 0xFF << 0), 155 | 0xff000000 | ( 0x66 << 16 ) | (0x66 << 8) | ( 0x66 << 0), 156 | 0xff000000 | ( 0x0D << 16 ) | (0x0D << 8) | ( 0x0D << 0), 157 | 0xff000000 | ( 0x0D << 16 ) | (0x0D << 8) | ( 0x0D << 0), 158 | 0xff000000 | ( 0xFF << 16 ) | (0xFF << 8) | ( 0xFF << 0), 159 | 0xff000000 | ( 0x84 << 16 ) | (0xBF << 8) | ( 0xFF << 0), 160 | 0xff000000 | ( 0xBB << 16 ) | (0xBB << 8) | ( 0xFF << 0), 161 | 0xff000000 | ( 0xD0 << 16 ) | (0xBB << 8) | ( 0xFF << 0), 162 | 0xff000000 | ( 0xFF << 16 ) | (0xBF << 8) | ( 0xEA << 0), 163 | 0xff000000 | ( 0xFF << 16 ) | (0xBF << 8) | ( 0xCC << 0), 164 | 0xff000000 | ( 0xFF << 16 ) | (0xC4 << 8) | ( 0xB7 << 0), 165 | 0xff000000 | ( 0xFF << 16 ) | (0xCC << 8) | ( 0xAE << 0), 166 | 0xff000000 | ( 0xFF << 16 ) | (0xD9 << 8) | ( 0xA2 << 0), 167 | 0xff000000 | ( 0xCC << 16 ) | (0xE1 << 8) | ( 0x99 << 0), 168 | 0xff000000 | ( 0xAE << 16 ) | (0xEE << 8) | ( 0xB7 << 0), 169 | 0xff000000 | ( 0xAA << 16 ) | (0xF7 << 8) | ( 0xEE << 0), 170 | 0xff000000 | ( 0xB3 << 16 ) | (0xEE << 8) | ( 0xFF << 0), 171 | 0xff000000 | ( 0xDD << 16 ) | (0xDD << 8) | ( 0xDD << 0), 172 | 0xff000000 | ( 0x11 << 16 ) | (0x11 << 8) | ( 0x11 << 0), 173 | 0xff000000 | ( 0x11 << 16 ) | (0x11 << 8) | ( 0x11 << 0) 174 | }; 175 | #else 176 | WORD NesPalette[] = { 177 | 0x738E, 0x88C4, 0xA800, 0x9808, 0x7011, 0x1015, 0x0014, 0x004F, 0x0148, 0x0200, 0x0280, 0x11C0, 0x59C3, 178 | 0x0000, 0x0000, 0x0000, 0xBDD7, 0xEB80, 0xE9C4, 0xF010, 0xB817, 0x581C, 0x015B, 0x0A59, 0x0391, 0x0480, 179 | 0x0540, 0x3C80, 0x8C00, 0x0000, 0x0000, 0x0000, 0xFFDF, 0xFDC7, 0xFC8B, 0xFC48, 0xFBDE, 0xB39F, 0x639F, 180 | 0x3CDF, 0x3DDE, 0x1690, 0x4EC9, 0x9FCB, 0xDF40, 0x0000, 0x0000, 0x0000, 0xFFDF, 0xFF15, 0xFE98, 0xFE5A, 181 | 0xFE1F, 0xDE1F, 0xB5DF, 0xAEDF, 0xA71F, 0xA7DC, 0xBF95, 0xCFD6, 0xF7D3, 0x0000, 0x0000, 0x0000, 182 | }; 183 | #endif 184 | 185 | /*===================================================================*/ 186 | /* */ 187 | /* main() : Application main */ 188 | /* */ 189 | /*===================================================================*/ 190 | /* Application main */ 191 | int nes_init(char *nes_file) 192 | { 193 | char cmd; 194 | 195 | /*-------------------------------------------------------------------*/ 196 | /* Pad Control */ 197 | /*-------------------------------------------------------------------*/ 198 | 199 | /* Initialize a pad state */ 200 | dwKeyPad1 = 0; 201 | dwKeyPad2 = 0; 202 | dwKeySystem = 0; 203 | 204 | /*-------------------------------------------------------------------*/ 205 | /* Load Cassette & Create Thread */ 206 | /*-------------------------------------------------------------------*/ 207 | 208 | /* Initialize thread state */ 209 | bThread = FALSE; 210 | 211 | int i; 212 | 213 | // InitJoypadInput(); 214 | 215 | //初始化 zoom 缩放表 216 | make_zoom_tab(); 217 | 218 | assert(nes_file); 219 | start_application(nes_file); 220 | return (0); 221 | } 222 | 223 | /** 224 | * 生成zoom 缩放表 225 | */ 226 | int make_zoom_tab(void) 227 | { 228 | int i; 229 | zoom_x_tab = (int *)malloc(sizeof(int) * M5PI_SCREEN_WIDTH); 230 | 231 | if (NULL == zoom_x_tab) { 232 | printf("make zoom_x_tab error\n"); 233 | return -1; 234 | } 235 | for (i = 0; i < M5PI_SCREEN_WIDTH; i++) { 236 | zoom_x_tab[i] = i * NES_DISP_WIDTH / M5PI_SCREEN_WIDTH; 237 | } 238 | zoom_y_tab = (int *)malloc(sizeof(int) * M5PI_SCREEN_HEIGHT ); 239 | if (NULL == zoom_y_tab) { 240 | printf("make zoom_y_tab error\n"); 241 | return -1; 242 | } 243 | for (i = 0; i < M5PI_SCREEN_HEIGHT ; i++) { 244 | zoom_y_tab[i] = i * NES_DISP_HEIGHT / M5PI_SCREEN_HEIGHT ; 245 | } 246 | return 1; 247 | } 248 | 249 | /*===================================================================*/ 250 | /* */ 251 | /* emulation_thread() : Thread Hooking Routine */ 252 | /* */ 253 | /*===================================================================*/ 254 | 255 | void *emulation_thread(void *args) 256 | { 257 | InfoNES_Main(); 258 | } 259 | 260 | /*===================================================================*/ 261 | /* */ 262 | /* start_application() : Start NES Hardware */ 263 | /* */ 264 | /*===================================================================*/ 265 | void start_application(char *filename) 266 | { 267 | /* Set a ROM image name */ 268 | strcpy(szRomName, filename); 269 | 270 | /* Load cassette */ 271 | if (InfoNES_Load(szRomName) == 0) { 272 | /* Load SRAM */ 273 | LoadSRAM(); 274 | 275 | /* Create Emulation Thread */ 276 | bThread = TRUE; 277 | pthread_create(&nes_tid, NULL, emulation_thread, NULL); 278 | }else{ 279 | assert(NULL); 280 | } 281 | } 282 | 283 | /*===================================================================*/ 284 | /* */ 285 | /* LoadSRAM() : Load a SRAM */ 286 | /* */ 287 | /*===================================================================*/ 288 | int LoadSRAM() 289 | { 290 | /* 291 | * Load a SRAM 292 | * 293 | * Return values 294 | * 0 : Normally 295 | * -1 : SRAM data couldn't be read 296 | */ 297 | 298 | FILE *fp; 299 | unsigned char pSrcBuf[SRAM_SIZE]; 300 | unsigned char chData; 301 | unsigned char chTag; 302 | int nRunLen; 303 | int nDecoded; 304 | int nDecLen; 305 | int nIdx; 306 | 307 | /* It doesn't need to save it */ 308 | nSRAM_SaveFlag = 0; 309 | 310 | /* It is finished if the ROM doesn't have SRAM */ 311 | if (!ROM_SRAM) { 312 | return (0); 313 | } 314 | 315 | /* There is necessity to save it */ 316 | nSRAM_SaveFlag = 1; 317 | 318 | /* The preparation of the SRAM file name */ 319 | strcpy(szSaveName, szRomName); 320 | strcpy(strrchr(szSaveName, '.') + 1, "srm"); 321 | 322 | /*-------------------------------------------------------------------*/ 323 | /* Read a SRAM data */ 324 | /*-------------------------------------------------------------------*/ 325 | 326 | /* Open SRAM file */ 327 | fp = fopen(szSaveName, "rb"); 328 | if (fp == NULL) { 329 | return (-1); 330 | } 331 | 332 | /* Read SRAM data */ 333 | fread(pSrcBuf, SRAM_SIZE, 1, fp); 334 | 335 | /* Close SRAM file */ 336 | fclose(fp); 337 | 338 | /*-------------------------------------------------------------------*/ 339 | /* Extract a SRAM data */ 340 | /*-------------------------------------------------------------------*/ 341 | 342 | nDecoded = 0; 343 | nDecLen = 0; 344 | 345 | chTag = pSrcBuf[nDecoded++]; 346 | 347 | while (nDecLen < 8192) { 348 | chData = pSrcBuf[nDecoded++]; 349 | 350 | if (chData == chTag) { 351 | chData = pSrcBuf[nDecoded++]; 352 | nRunLen = pSrcBuf[nDecoded++]; 353 | for (nIdx = 0; nIdx < nRunLen + 1; ++nIdx) { 354 | SRAM[nDecLen++] = chData; 355 | } 356 | } else { 357 | SRAM[nDecLen++] = chData; 358 | } 359 | } 360 | 361 | /* Successful */ 362 | return (0); 363 | } 364 | 365 | /*===================================================================*/ 366 | /* */ 367 | /* SaveSRAM() : Save a SRAM */ 368 | /* */ 369 | /*===================================================================*/ 370 | int SaveSRAM() 371 | { 372 | /* 373 | * Save a SRAM 374 | * 375 | * Return values 376 | * 0 : Normally 377 | * -1 : SRAM data couldn't be written 378 | */ 379 | 380 | FILE *fp; 381 | int nUsedTable[256]; 382 | unsigned char chData; 383 | unsigned char chPrevData; 384 | unsigned char chTag; 385 | int nIdx; 386 | int nEncoded; 387 | int nEncLen; 388 | int nRunLen; 389 | unsigned char pDstBuf[SRAM_SIZE]; 390 | 391 | if (!nSRAM_SaveFlag) { 392 | return (0); /* It doesn't need to save it */ 393 | } 394 | 395 | /*-------------------------------------------------------------------*/ 396 | /* Compress a SRAM data */ 397 | /*-------------------------------------------------------------------*/ 398 | 399 | memset(nUsedTable, 0, sizeof nUsedTable); 400 | 401 | for (nIdx = 0; nIdx < SRAM_SIZE; ++nIdx) { 402 | ++nUsedTable[SRAM[nIdx++]]; 403 | } 404 | for (nIdx = 1, chTag = 0; nIdx < 256; ++nIdx) { 405 | if (nUsedTable[nIdx] < nUsedTable[chTag]) { 406 | chTag = nIdx; 407 | } 408 | } 409 | 410 | nEncoded = 0; 411 | nEncLen = 0; 412 | nRunLen = 1; 413 | 414 | pDstBuf[nEncLen++] = chTag; 415 | 416 | chPrevData = SRAM[nEncoded++]; 417 | 418 | while (nEncoded < SRAM_SIZE && nEncLen < SRAM_SIZE - 133) { 419 | chData = SRAM[nEncoded++]; 420 | 421 | if (chPrevData == chData && nRunLen < 256) { 422 | ++nRunLen; 423 | } else { 424 | if (nRunLen >= 4 || chPrevData == chTag) { 425 | pDstBuf[nEncLen++] = chTag; 426 | pDstBuf[nEncLen++] = chPrevData; 427 | pDstBuf[nEncLen++] = nRunLen - 1; 428 | } else { 429 | for (nIdx = 0; nIdx < nRunLen; ++nIdx) { 430 | pDstBuf[nEncLen++] = chPrevData; 431 | } 432 | } 433 | 434 | chPrevData = chData; 435 | nRunLen = 1; 436 | } 437 | } 438 | if (nRunLen >= 4 || chPrevData == chTag) { 439 | pDstBuf[nEncLen++] = chTag; 440 | pDstBuf[nEncLen++] = chPrevData; 441 | pDstBuf[nEncLen++] = nRunLen - 1; 442 | } else { 443 | for (nIdx = 0; nIdx < nRunLen; ++nIdx) { 444 | pDstBuf[nEncLen++] = chPrevData; 445 | } 446 | } 447 | 448 | /*-------------------------------------------------------------------*/ 449 | /* Write a SRAM data */ 450 | /*-------------------------------------------------------------------*/ 451 | 452 | /* Open SRAM file */ 453 | fp = fopen(szSaveName, "wb"); 454 | if (fp == NULL) { 455 | return (-1); 456 | } 457 | 458 | /* Write SRAM data */ 459 | fwrite(pDstBuf, nEncLen, 1, fp); 460 | 461 | /* Close SRAM file */ 462 | fclose(fp); 463 | 464 | /* Successful */ 465 | return (0); 466 | } 467 | 468 | /*===================================================================*/ 469 | /* */ 470 | /* InfoNES_Menu() : Menu screen */ 471 | /* */ 472 | /*===================================================================*/ 473 | int InfoNES_Menu() 474 | { 475 | /* 476 | * Menu screen 477 | * 478 | * Return values 479 | * 0 : Normally 480 | * -1 : Exit InfoNES 481 | */ 482 | 483 | /* If terminated */ 484 | if (bThread == FALSE) { 485 | return (-1); 486 | } 487 | 488 | /* Nothing to do here */ 489 | return (0); 490 | } 491 | 492 | /*===================================================================*/ 493 | /* */ 494 | /* InfoNES_ReadRom() : Read ROM image file */ 495 | /* */ 496 | /*===================================================================*/ 497 | int InfoNES_ReadRom(const char *pszFileName) 498 | { 499 | /* 500 | * Read ROM image file 501 | * 502 | * Parameters 503 | * const char *pszFileName (Read) 504 | * 505 | * Return values 506 | * 0 : Normally 507 | * -1 : Error 508 | */ 509 | 510 | FILE *fp; 511 | 512 | /* Open ROM file */ 513 | fp = fopen(pszFileName, "rb"); 514 | if (fp == NULL) { 515 | return (-1); 516 | } 517 | 518 | /* Read ROM Header */ 519 | fread(&NesHeader, sizeof NesHeader, 1, fp); 520 | if (memcmp(NesHeader.byID, "NES\x1a", 4) != 0) { 521 | /* not .nes file */ 522 | fclose(fp); 523 | return (-1); 524 | } 525 | 526 | /* Clear SRAM */ 527 | memset(SRAM, 0, SRAM_SIZE); 528 | 529 | /* If trainer presents Read Triner at 0x7000-0x71ff */ 530 | if (NesHeader.byInfo1 & 4) { 531 | fread(&SRAM[0x1000], 512, 1, fp); 532 | } 533 | 534 | /* Allocate Memory for ROM Image */ 535 | ROM = (BYTE *)malloc(NesHeader.byRomSize * 0x4000); 536 | 537 | /* Read ROM Image */ 538 | fread(ROM, 0x4000, NesHeader.byRomSize, fp); 539 | 540 | if (NesHeader.byVRomSize > 0) { 541 | /* Allocate Memory for VROM Image */ 542 | VROM = (BYTE *)malloc(NesHeader.byVRomSize * 0x2000); 543 | 544 | /* Read VROM Image */ 545 | fread(VROM, 0x2000, NesHeader.byVRomSize, fp); 546 | } 547 | 548 | /* File close */ 549 | fclose(fp); 550 | 551 | /* Successful */ 552 | return (0); 553 | } 554 | 555 | /*===================================================================*/ 556 | /* */ 557 | /* InfoNES_ReleaseRom() : Release a memory for ROM */ 558 | /* */ 559 | /*===================================================================*/ 560 | void InfoNES_ReleaseRom() 561 | { 562 | /* 563 | * Release a memory for ROM 564 | * 565 | */ 566 | 567 | if (ROM) { 568 | free(ROM); 569 | ROM = NULL; 570 | } 571 | 572 | if (VROM) { 573 | free(VROM); 574 | VROM = NULL; 575 | } 576 | } 577 | 578 | /*===================================================================*/ 579 | /* */ 580 | /* InfoNES_MemoryCopy() : memcpy */ 581 | /* */ 582 | /*===================================================================*/ 583 | void *InfoNES_MemoryCopy(void *dest, const void *src, int count) 584 | { 585 | /* 586 | * memcpy 587 | * 588 | * Parameters 589 | * void *dest (Write) 590 | * Points to the starting address of the copied block's destination 591 | * 592 | * const void *src (Read) 593 | * Points to the starting address of the block of memory to copy 594 | * 595 | * int count (Read) 596 | * Specifies the size, in bytes, of the block of memory to copy 597 | * 598 | * Return values 599 | * Pointer of destination 600 | */ 601 | 602 | memcpy(dest, src, count); 603 | return (dest); 604 | } 605 | 606 | /*===================================================================*/ 607 | /* */ 608 | /* InfoNES_MemorySet() : memset */ 609 | /* */ 610 | /*===================================================================*/ 611 | void *InfoNES_MemorySet(void *dest, int c, int count) 612 | { 613 | /* 614 | * memset 615 | * 616 | * Parameters 617 | * void *dest (Write) 618 | * Points to the starting address of the block of memory to fill 619 | * 620 | * int c (Read) 621 | * Specifies the byte value with which to fill the memory block 622 | * 623 | * int count (Read) 624 | * Specifies the size, in bytes, of the block of memory to fill 625 | * 626 | * Return values 627 | * Pointer of destination 628 | */ 629 | 630 | memset(dest, c, count); 631 | return (dest); 632 | } 633 | 634 | /*===================================================================*/ 635 | /* */ 636 | /* InfoNES_LoadFrame() : */ 637 | /* Transfer the contents of work frame on the screen */ 638 | /* */ 639 | /*===================================================================*/ 640 | void InfoNES_LoadFrame() 641 | { 642 | int x, y; 643 | int line_width; 644 | WORD wColor; 645 | 646 | static lv_color_t cbuf_temp[LV_CANVAS_BUF_SIZE_TRUE_COLOR(M5PI_SCREEN_WIDTH, M5PI_SCREEN_HEIGHT)]; 647 | static lv_color_t pixel; 648 | //修正 即便没有 LCD 也可以出声 649 | int count = 0; 650 | if (0 < fb_fd) { 651 | for (y = 0; y < 240; y++) { 652 | line_width = zoom_y_tab[y] * NES_DISP_WIDTH; 653 | for (x = 0; x < 320; x++) { 654 | wColor = WorkFrame[line_width + zoom_x_tab[x]]; 655 | #if (LV_COLOR_DEPTH == 32) 656 | // pixel.ch.red = ((wColor >> 16) & 0xff); 657 | // pixel.ch.green = ((wColor >> 8) & 0xff); 658 | // pixel.ch.blue = ((wColor >> 0) & 0xff); 659 | pixel.ch.alpha = ((wColor >> 24) & 0xff); 660 | pixel.ch.red = ((wColor >> 16) & 0xff); 661 | pixel.ch.green = ((wColor >> 8) & 0xff); 662 | pixel.ch.blue = ((wColor >> 0) & 0xff); 663 | #else 664 | pixel.ch.blue = ((wColor >> 11) & 0x1f); 665 | pixel.ch.green = ((wColor >> 5) & 0x3f); 666 | pixel.ch.red = ((wColor >> 0) & 0x1f); 667 | #endif 668 | cbuf_temp[count] = pixel; 669 | count += 1; 670 | } 671 | } 672 | lv_canvas_set_buffer(nes_canvas, cbuf_temp, M5PI_SCREEN_WIDTH, M5PI_SCREEN_HEIGHT, LV_IMG_CF_TRUE_COLOR); 673 | } 674 | } 675 | 676 | /*===================================================================*/ 677 | /* */ 678 | /* InfoNES_PadState() : Get a joypad state */ 679 | /* */ 680 | /*===================================================================*/ 681 | void InfoNES_PadState(DWORD *pdwPad1, DWORD *pdwPad2, DWORD *pdwSystem) 682 | { 683 | /* 684 | * Get a joypad state 685 | * 686 | * Parameters 687 | * DWORD *pdwPad1 (Write) 688 | * Joypad 1 State 689 | * 690 | * DWORD *pdwPad2 (Write) 691 | * Joypad 2 State 692 | * 693 | * DWORD *pdwSystem (Write) 694 | * Input for InfoNES 695 | * 696 | */ 697 | 698 | /* Transfer joypad state */ 699 | *pdwPad1 = dwKeyPad1; 700 | *pdwPad2 = dwKeyPad2; 701 | *pdwSystem = dwKeySystem; 702 | 703 | //取消重置手柄 在 输入函数中自行处理 704 | // dwKeyPad1 = 0; 705 | } 706 | 707 | /*===================================================================*/ 708 | /* */ 709 | /* InfoNES_SoundInit() : Sound Emulation Initialize */ 710 | /* */ 711 | /*===================================================================*/ 712 | void InfoNES_SoundInit(void) 713 | {} 714 | 715 | /*===================================================================*/ 716 | /* */ 717 | /* InfoNES_SoundOpen() : Sound Open */ 718 | /* */ 719 | /*===================================================================*/ 720 | int InfoNES_SoundOpen(int samples_per_sync, int sample_rate) 721 | { 722 | // //sample_rate 采样率 44100 723 | // //samples_per_sync 735 724 | // unsigned int rate = sample_rate; 725 | // snd_pcm_hw_params_t *hw_params; 726 | 727 | // if(0 > snd_pcm_open(&playback_handle, "default", SND_PCM_STREAM_PLAYBACK, 0)) 728 | // { 729 | // printf("snd_pcm_open err\n"); 730 | // return -1; 731 | // } 732 | 733 | // if(0 > snd_pcm_hw_params_malloc(&hw_params)) 734 | // { 735 | // printf("snd_pcm_hw_params_malloc err\n"); 736 | // return -1; 737 | // } 738 | 739 | // if(0 > snd_pcm_hw_params_any(playback_handle, hw_params)) 740 | // { 741 | // printf("snd_pcm_hw_params_any err\n"); 742 | // return -1; 743 | // } 744 | // if(0 > snd_pcm_hw_params_set_access(playback_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)) 745 | // { 746 | // printf("snd_pcm_hw_params_any err\n"); 747 | // return -1; 748 | // } 749 | 750 | // //8bit PCM 数据 751 | // if(0 > snd_pcm_hw_params_set_format(playback_handle, hw_params, SND_PCM_FORMAT_U8)) 752 | // { 753 | // printf("snd_pcm_hw_params_set_format err\n"); 754 | // return -1; 755 | // } 756 | 757 | // if(0 > snd_pcm_hw_params_set_rate_near(playback_handle, hw_params, &rate, 0)) 758 | // { 759 | // printf("snd_pcm_hw_params_set_rate_near err\n"); 760 | // return -1; 761 | // } 762 | 763 | // //单声道 非立体声 764 | // if(0 > snd_pcm_hw_params_set_channels(playback_handle, hw_params, 1)) 765 | // { 766 | // printf("snd_pcm_hw_params_set_channels err\n"); 767 | // return -1; 768 | // } 769 | 770 | // if(0 > snd_pcm_hw_params(playback_handle, hw_params)) 771 | // { 772 | // printf("snd_pcm_hw_params err\n"); 773 | // return -1; 774 | // } 775 | 776 | // snd_pcm_hw_params_free(hw_params); 777 | 778 | // if(0 > snd_pcm_prepare(playback_handle)) 779 | // { 780 | // printf("snd_pcm_prepare err\n"); 781 | // return -1; 782 | // } 783 | return 1; 784 | } 785 | 786 | /*===================================================================*/ 787 | /* */ 788 | /* InfoNES_SoundClose() : Sound Close */ 789 | /* */ 790 | /*===================================================================*/ 791 | void InfoNES_SoundClose(void) 792 | { 793 | // snd_pcm_close(playback_handle); 794 | } 795 | 796 | /*===================================================================*/ 797 | /* */ 798 | /* InfoNES_SoundOutput() : Sound Output 5 Waves */ 799 | /* */ 800 | /*===================================================================*/ 801 | void InfoNES_SoundOutput(int samples, BYTE *wave1, BYTE *wave2, BYTE *wave3, BYTE *wave4, BYTE *wave5) 802 | { 803 | // int i; 804 | // int ret; 805 | // unsigned char wav; 806 | // unsigned char *pcmBuf = (unsigned char *)malloc(samples); 807 | 808 | // for (i=0; i