diff --git a/Assets/retro-esp32/icons/icons.gif b/Assets/retro-esp32/icons/icons.gif index c2558a83..24a8c528 100755 Binary files a/Assets/retro-esp32/icons/icons.gif and b/Assets/retro-esp32/icons/icons.gif differ diff --git a/Assets/retro-esp32/logos/logo3d.gif b/Assets/retro-esp32/logos/logo3d.gif new file mode 100644 index 00000000..12f0ecd7 Binary files /dev/null and b/Assets/retro-esp32/logos/logo3d.gif differ diff --git a/Components/odroid-go-handy/odroid-go-common/components/odroid/odroid_hud.c b/Components/odroid-go-handy/odroid-go-common/components/odroid/odroid_hud.c index 07c99933..af426e32 100755 --- a/Components/odroid-go-handy/odroid-go-common/components/odroid/odroid_hud.c +++ b/Components/odroid-go-handy/odroid-go-common/components/odroid/odroid_hud.c @@ -63,6 +63,11 @@ bool INIT = false; bool SAVED = false; bool forceConsoleReset; + + int32_t VOLUME = 0; + int32_t BRIGHTNESS = 0; + const int32_t BRIGHTNESS_COUNT = 10; + const int32_t BRIGHTNESS_LEVELS[10] = {10,20,30,40,50,60,70,80,90,100}; //}#pragma endregion Globals //{#pragma region Structs @@ -79,20 +84,23 @@ int action; int offset; } STATES; - STATES WITHSAVE[6] = { + STATES WITHSAVE[5] = { {"Resume Game",0, 0}, {"Restart Game",1, 10}, {"Reload Game",2, 5}, {"Overwrite Game",4, 25}, - {"Delete Save",5, 15}, - {"Exit Game",6, 20} + {"Delete Save",5, 15} }; - STATES WITHOUTSAVE[4] = { + STATES WITHOUTSAVE[3] = { {"Resume Game",0, 0}, {"Restart Game",1, 10}, - {"Save Game",3, 25}, - {"Exit Game",6, 20} + {"Save Game",3, 25} }; + STATES EXTRAS[3] = { + {"Volume",8, 45}, + {"Brightness",9, 50}, + {"Quit Game",6, 20} + }; STATES STATE; // THEME @@ -140,43 +148,62 @@ const uint16_t FONT_5x7[7][250] = { {65535,0,0,0,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,65535,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,0,0,0,0,0,65535,65535,65535,0,65535,0,0,0,65535,65535,65535,65535,65535,65535,0,65535,65535,0,0,65535,0,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,0,65535,65535,0,0,0,65535,0,65535,65535,65535,0,65535,0,0,0,0,0,0,0,0,65535,65535,0,0,0,65535,0,65535,65535,65535,0,0,0,65535,0,0,0,65535,65535,65535,0,0,0,65535,0,0,0,65535,0,65535,0,65535,0,0,0,65535,0,0,65535,0,0,65535,65535,65535,65535,65535,0,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,65535,65535,65535,0,0,0,0,0,65535,0,65535,65535,65535,0,0,65535,65535,65535,0,65535,0,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,0,65535,0,0,0,0,65535,0,0,0,0,65535,0,0,65535,0,0,0,0,0,0,0,65535,0,0,65535,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0}, }; - const uint16_t icons[35][5] = { - {0,65535,65535,0,0}, - {0,65535,65535,65535,0}, - {0,65535,65535,65535,65535}, - {0,65535,65535,65535,0}, - {0,65535,65535,0,0}, - {65535,0,65535,0,0}, - {65535,0,65535,65535,0}, - {65535,0,65535,65535,65535}, - {65535,0,65535,65535,0}, - {65535,0,65535,0,0}, - {0,65535,65535,0,65535}, - {65535,0,0,65535,65535}, - {65535,0,0,0,65535}, - {65535,65535,0,0,65535}, - {65535,0,65535,65535,0}, - {0,65535,65535,65535,0}, - {65535,0,65535,0,65535}, - {65535,65535,0,65535,65535}, - {65535,0,65535,0,65535}, - {0,65535,65535,65535,0}, - {65535,0,0,0,65535}, - {0,65535,0,65535,0}, - {0,0,65535,0,0}, - {0,65535,0,65535,0}, - {65535,0,0,0,65535}, - {0,0,0,0,0}, - {0,0,0,0,65535}, - {0,0,0,65535,0}, - {65535,0,65535,0,0}, - {0,65535,0,0,0}, - {0,65535,65535,65535,0}, - {65535,0,65535,0,65535}, - {65535,0,65535,65535,65535}, - {65535,0,0,0,65535}, - {0,65535,65535,65535,0}, - +const uint16_t icons[55][5] = { + {0,65535,65535,0,0}, + {0,65535,65535,65535,0}, + {0,65535,65535,65535,65535}, + {0,65535,65535,65535,0}, + {0,65535,65535,0,0}, + {65535,0,65535,0,0}, + {65535,0,65535,65535,0}, + {65535,0,65535,65535,65535}, + {65535,0,65535,65535,0}, + {65535,0,65535,0,0}, + {0,65535,65535,0,65535}, + {65535,0,0,65535,65535}, + {65535,0,0,0,65535}, + {65535,65535,0,0,65535}, + {65535,0,65535,65535,0}, + {0,65535,65535,65535,0}, + {65535,0,65535,0,65535}, + {65535,65535,0,65535,65535}, + {65535,0,65535,0,65535}, + {0,65535,65535,65535,0}, + {65535,0,0,0,65535}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {65535,0,0,0,65535}, + {0,0,0,0,0}, + {0,0,0,0,65535}, + {0,0,0,65535,0}, + {65535,0,65535,0,0}, + {0,65535,0,0,0}, + {0,65535,65535,65535,0}, + {65535,0,65535,0,65535}, + {65535,0,65535,65535,65535}, + {65535,0,0,0,65535}, + {0,65535,65535,65535,0}, + {0,65535,0,65535,0}, + {65535,65535,65535,65535,65535}, + {65535,65535,65535,65535,65535}, + {0,65535,65535,65535,0}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {65535,0,65535,0,65535}, + {65535,0,0,0,65535}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {0,0,0,65535,0}, + {0,65535,0,0,65535}, + {0,0,65535,0,65535}, + {0,65535,0,0,65535}, + {0,0,0,65535,0}, + {65535,0,0,0,65535}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {65535,0,0,0,65535}, }; const uint16_t logo[12][64] = { @@ -404,8 +431,49 @@ const uint16_t FONT_5x7[7][250] = { usleep(15000); } } + } + + void hud_bar(int x, int y, int percent, bool active) { + int w, h; + + int i = 0; + for(h = 0; h < 7; h++) { + for(w = 0; w < 100; w++) { + buffer[i] = (w+h)%2 == 0 ? GUI.fg : GUI.bg; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, 100, 7, buffer); + + if(percent > 0) { + i = 0; + for(h = 0; h < 7; h++) { + for(w = 0; w < percent; w++) { + buffer[i] = active ? GUI.hl : GUI.fg; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, percent, 7, buffer); + } } + void hud_volume() { + // y=176; + int32_t VOLUME = odroid_settings_Volume_get(); + int LIMIT = OPTIONS - 3; + bool active = OPTION == LIMIT ? true : false; + hud_bar((SCREEN.w - 120), 176, VOLUME * 12.5, active); + } + + void hud_brightness() { + // y=176; + int LIMIT = OPTIONS - 2; + bool active = OPTION == LIMIT ? true : false; + BRIGHTNESS = odroid_settings_Backlight_get(); + + hud_bar((SCREEN.w - 120), 196, (BRIGHTNESS_COUNT * BRIGHTNESS)+BRIGHTNESS+1, active); + } + void hud_options() { x = 16; y = 28; @@ -413,33 +481,52 @@ const uint16_t FONT_5x7[7][250] = { h = 5; i = 0; int n; - if(OPTIONS == 6) { - for(n = 0; n < OPTIONS; n++) { + if(OPTIONS == 8) { + for(n = 0; n < 5; n++) { STATE = WITHSAVE[n]; y+=20; for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { buffer[i] = icons[r+STATE.offset][c] == WHITE ? OPTION == n ? GUI.hl : GUI.fg : GUI.bg;i++; }} - if(n == OPTIONS-1) {y = 216;} ili9341_write_frame_rectangleLE(x, y, w, h, buffer); hud_text(x+10,y,STATE.label,false,OPTION == n?true:false); i = 0; } - STATE = WITHSAVE[OPTION]; } else { - for(n = 0; n < OPTIONS; n++) { + for(n = 0; n < 3; n++) { STATE = WITHOUTSAVE[n]; y+=20; for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { buffer[i] = icons[r+STATE.offset][c] == WHITE ? OPTION == n ? GUI.hl : GUI.fg : GUI.bg;i++; }} - if(n == OPTIONS-1) {y = 216;} ili9341_write_frame_rectangleLE(x, y, w, h, buffer); hud_text(x+10,y,STATE.label,false,OPTION == n?true:false); i = 0; } - STATE = WITHOUTSAVE[OPTION]; } + + y=156; + for(n = 0; n < 3; n++) { + STATE = EXTRAS[n]; + y+=20; + for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { + buffer[i] = icons[r+STATE.offset][c] == WHITE ? OPTION == (n+OPTIONS-3) ? GUI.hl : GUI.fg : GUI.bg;i++; + }} + ili9341_write_frame_rectangleLE(x, y, w, h, buffer); + hud_text(x+10,y,STATE.label,false,OPTION == (n+OPTIONS-3)?true:false); + i = 0; + } + + int LIMIT = OPTIONS - 3; + if(OPTION < LIMIT) { + STATE = OPTIONS == 8 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; + } else { + STATE = EXTRAS[OPTION-LIMIT]; + } + printf("\n**********\n%s - %d:%d\n**********\n", STATE.label, OPTION, LIMIT); + + hud_volume(); + hud_brightness(); } //}#pragma endregion Display @@ -450,10 +537,10 @@ const uint16_t FONT_5x7[7][250] = { buffer = (uint16_t *)malloc(size); if (!buffer) abort(); OPTION = 0; - OPTIONS = SAVED ? 6 : 4; + OPTIONS = SAVED ? 8 : 6; hud_theme(); GUI = THEMES[USER]; - STATE = OPTIONS == 6 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; + STATE = OPTIONS == 8 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; INIT = true; } } @@ -468,9 +555,9 @@ const uint16_t FONT_5x7[7][250] = { //{#pragma region Menu void hud_menu(void) { - int volume = odroid_audio_volume_get(); + VOLUME = odroid_audio_volume_get(); #ifdef CONFIG_LCD_DRIVER_CHIP_RETRO_ESP32 - volume = 8; + //volume = 8; #endif odroid_audio_terminate(); hud_init(); @@ -501,6 +588,49 @@ const uint16_t FONT_5x7[7][250] = { usleep(200000); //debounce(ODROID_INPUT_DOWN); } + /* + LEFT + */ + if(gamepad.values[ODROID_INPUT_LEFT]) { + if(OPTION == OPTIONS - 3) { + if(VOLUME > 0) { + VOLUME--; + odroid_settings_Volume_set(VOLUME); + hud_options(); + usleep(200000); + } + } + if(OPTION == OPTIONS - 3 + 1) { + if(BRIGHTNESS > 0) { + BRIGHTNESS--; + odroid_settings_Backlight_set(BRIGHTNESS); + hud_options(); + usleep(200000); + } + } + } + + /* + RIGHT + */ + if(gamepad.values[ODROID_INPUT_RIGHT]) { + if(OPTION == OPTIONS - 3) { + if(VOLUME < 8) { + VOLUME++; + odroid_settings_Volume_set(VOLUME); + hud_options(); + usleep(200000); + } + } + if(OPTION == OPTIONS - 3 + 1) { + if(BRIGHTNESS < (BRIGHTNESS_COUNT-1)) { + BRIGHTNESS++; + odroid_settings_Backlight_set(BRIGHTNESS); + hud_options(); + usleep(200000); + } + } + } /* BUTTON B */ @@ -513,7 +643,7 @@ const uint16_t FONT_5x7[7][250] = { BUTTON A */ if (gamepad.values[ODROID_INPUT_A]) { - odroid_audio_volume_set(volume); + odroid_audio_volume_set(VOLUME); hud_debug(STATE.label); ACTION = STATE.action; switch(ACTION) { diff --git a/Components/odroid-go-handy/odroid-go-common/components/odroid/odroid_hud.h b/Components/odroid-go-handy/odroid-go-common/components/odroid/odroid_hud.h index a347f0d0..c1222ea0 100755 --- a/Components/odroid-go-handy/odroid-go-common/components/odroid/odroid_hud.h +++ b/Components/odroid-go-handy/odroid-go-common/components/odroid/odroid_hud.h @@ -48,4 +48,7 @@ void hud_menu(); */ void hud_logo(void); void hud_progress(char *string, bool bar); +void hud_bar(int x, int y, int percent, bool active); +void hud_volume(); +void hud_brightness(); void hud_options(); \ No newline at end of file diff --git a/Components/odroid-go-pcengine-huexpress/odroid-go-common/components/odroid/odroid_hud.c b/Components/odroid-go-pcengine-huexpress/odroid-go-common/components/odroid/odroid_hud.c index c634769d..5f478117 100755 --- a/Components/odroid-go-pcengine-huexpress/odroid-go-common/components/odroid/odroid_hud.c +++ b/Components/odroid-go-pcengine-huexpress/odroid-go-common/components/odroid/odroid_hud.c @@ -55,7 +55,7 @@ #define BLACK 0 int OPTION = 0; extern int ACTION = 0; - int OPTIONS = 4; + int OPTIONS = 0; int8_t USER; int8_t DELETE_SAVE; int x, y, w, h, i, size; @@ -65,6 +65,11 @@ bool SAVED = false; bool forceConsoleReset; extern uint8_t frameskip; + + int32_t VOLUME = 0; + int32_t BRIGHTNESS = 0; + const int32_t BRIGHTNESS_COUNT = 10; + const int32_t BRIGHTNESS_LEVELS[10] = {10,20,30,40,50,60,70,80,90,100}; //}#pragma endregion Globals //{#pragma region Structs @@ -81,21 +86,24 @@ int action; int offset; } STATES; - STATES WITHSAVE[7] = { + STATES WITHSAVE[5] = { {"Resume Game",0, 0}, {"Restart Game",1, 10}, {"Reload Game",2, 5}, {"Overwrite Game",4, 25}, - {"Delete Save",5, 15}, - {"Frame Skip",6, 30}, - {"Exit Game",7, 20} + {"Delete Save",5, 15} }; - STATES WITHOUTSAVE[4] = { + STATES WITHOUTSAVE[2] = { {"Resume Game",0, 0}, - {"Restart Game",1, 10}, - {"Frame Skip",6, 30}, - {"Exit Game",7, 20} + {"Restart Game",1, 10} }; + + STATES EXTRAS[4] = { + {"Frame Skip",6, 30}, + {"Volume",8, 45}, + {"Brightness",9, 50}, + {"Quit Game",7, 20} + }; STATES STATE; // THEME @@ -143,44 +151,63 @@ THEME GUI; {65535,0,0,0,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,65535,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,0,0,0,0,0,65535,65535,65535,0,65535,0,0,0,65535,65535,65535,65535,65535,65535,0,65535,65535,0,0,65535,0,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,0,65535,65535,0,0,0,65535,0,65535,65535,65535,0,65535,0,0,0,0,0,0,0,0,65535,65535,0,0,0,65535,0,65535,65535,65535,0,0,0,65535,0,0,0,65535,65535,65535,0,0,0,65535,0,0,0,65535,0,65535,0,65535,0,0,0,65535,0,0,65535,0,0,65535,65535,65535,65535,65535,0,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,65535,65535,65535,0,0,0,0,0,65535,0,65535,65535,65535,0,0,65535,65535,65535,0,65535,0,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,0,65535,0,0,0,0,65535,0,0,0,0,65535,0,0,65535,0,0,0,0,0,0,0,65535,0,0,65535,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0}, }; - const uint16_t icons[35][5] = { - {0,65535,65535,0,0}, - {0,65535,65535,65535,0}, - {0,65535,65535,65535,65535}, - {0,65535,65535,65535,0}, - {0,65535,65535,0,0}, - {65535,0,65535,0,0}, - {65535,0,65535,65535,0}, - {65535,0,65535,65535,65535}, - {65535,0,65535,65535,0}, - {65535,0,65535,0,0}, - {0,65535,65535,0,65535}, - {65535,0,0,65535,65535}, - {65535,0,0,0,65535}, - {65535,65535,0,0,65535}, - {65535,0,65535,65535,0}, - {0,65535,65535,65535,0}, - {65535,0,65535,0,65535}, - {65535,65535,0,65535,65535}, - {65535,0,65535,0,65535}, - {0,65535,65535,65535,0}, - {65535,0,0,0,65535}, - {0,65535,0,65535,0}, - {0,0,65535,0,0}, - {0,65535,0,65535,0}, - {65535,0,0,0,65535}, - {0,0,0,0,0}, - {0,0,0,0,65535}, - {0,0,0,65535,0}, - {65535,0,65535,0,0}, - {0,65535,0,0,0}, - {0,65535,65535,65535,0}, - {65535,0,65535,0,65535}, - {65535,0,65535,65535,65535}, - {65535,0,0,0,65535}, - {0,65535,65535,65535,0}, - - }; + const uint16_t icons[55][5] = { + {0,65535,65535,0,0}, + {0,65535,65535,65535,0}, + {0,65535,65535,65535,65535}, + {0,65535,65535,65535,0}, + {0,65535,65535,0,0}, + {65535,0,65535,0,0}, + {65535,0,65535,65535,0}, + {65535,0,65535,65535,65535}, + {65535,0,65535,65535,0}, + {65535,0,65535,0,0}, + {0,65535,65535,0,65535}, + {65535,0,0,65535,65535}, + {65535,0,0,0,65535}, + {65535,65535,0,0,65535}, + {65535,0,65535,65535,0}, + {0,65535,65535,65535,0}, + {65535,0,65535,0,65535}, + {65535,65535,0,65535,65535}, + {65535,0,65535,0,65535}, + {0,65535,65535,65535,0}, + {65535,0,0,0,65535}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {65535,0,0,0,65535}, + {0,0,0,0,0}, + {0,0,0,0,65535}, + {0,0,0,65535,0}, + {65535,0,65535,0,0}, + {0,65535,0,0,0}, + {0,65535,65535,65535,0}, + {65535,0,65535,0,65535}, + {65535,0,65535,65535,65535}, + {65535,0,0,0,65535}, + {0,65535,65535,65535,0}, + {0,65535,0,65535,0}, + {65535,65535,65535,65535,65535}, + {65535,65535,65535,65535,65535}, + {0,65535,65535,65535,0}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {65535,0,65535,0,65535}, + {65535,0,0,0,65535}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {0,0,0,65535,0}, + {0,65535,0,0,65535}, + {0,0,65535,0,65535}, + {0,65535,0,0,65535}, + {0,0,0,65535,0}, + {65535,0,0,0,65535}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {65535,0,0,0,65535}, +}; const uint16_t logo[12][64] = { {0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0}, @@ -409,6 +436,47 @@ THEME GUI; } } + void hud_bar(int x, int y, int percent, bool active) { + int w, h; + + int i = 0; + for(h = 0; h < 7; h++) { + for(w = 0; w < 100; w++) { + buffer[i] = (w+h)%2 == 0 ? GUI.fg : GUI.bg; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, 100, 7, buffer); + + if(percent > 0) { + i = 0; + for(h = 0; h < 7; h++) { + for(w = 0; w < percent; w++) { + buffer[i] = active ? GUI.hl : GUI.fg; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, percent, 7, buffer); + } + } + + void hud_volume() { + // y=176; + int32_t VOLUME = odroid_settings_Volume_get(); + int LIMIT = OPTIONS - 3; + bool active = OPTION == LIMIT ? true : false; + hud_bar((SCREEN.w - 120), 176, VOLUME * 12.5, active); + } + + void hud_brightness() { + // y=176; + int LIMIT = OPTIONS - 2; + bool active = OPTION == LIMIT ? true : false; + BRIGHTNESS = odroid_settings_Backlight_get(); + + hud_bar((SCREEN.w - 120), 196, (BRIGHTNESS_COUNT * BRIGHTNESS)+BRIGHTNESS+1, active); + } + void hud_frameskip() { int dx = 288; char number[2]; @@ -426,8 +494,8 @@ THEME GUI; h = 5; i = 0; int n; - if(OPTIONS == 7) { - for(n = 0; n < OPTIONS; n++) { + if(OPTIONS == 9) { + for(n = 0; n < 5; n++) { STATE = WITHSAVE[n]; y+=20; for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { @@ -438,9 +506,8 @@ THEME GUI; hud_text(x+10,y,STATE.label,false,OPTION == n?true:false); i = 0; } - STATE = WITHSAVE[OPTION]; } else { - for(n = 0; n < OPTIONS; n++) { + for(n = 0; n < 2; n++) { STATE = WITHOUTSAVE[n]; y+=20; for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { @@ -449,14 +516,35 @@ THEME GUI; if(n == OPTIONS-1) {y = 216;} ili9341_write_frame_rectangleLE(x, y, w, h, buffer); hud_text(x+10,y,STATE.label,false,OPTION == n?true:false); - if(STATE.action == 6) { - fsy = y; - } + //if(STATE.action == 6) {fsy = y;} i = 0; } - STATE = WITHOUTSAVE[OPTION]; } + + y=136; + for(n = 0; n < 4; n++) { + STATE = EXTRAS[n]; + y+=20; + for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { + buffer[i] = icons[r+STATE.offset][c] == WHITE ? OPTION == (n+OPTIONS-4) ? GUI.hl : GUI.fg : GUI.bg;i++; + }} + ili9341_write_frame_rectangleLE(x, y, w, h, buffer); + hud_text(x+10,y,STATE.label,false,OPTION == (n+OPTIONS-4)?true:false); + i = 0; + } + + int LIMIT = OPTIONS - 4; + if(OPTION < LIMIT) { + STATE = OPTIONS == 9 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; + } else { + STATE = EXTRAS[OPTION-LIMIT]; + } + printf("\n**********\n%s - OPTIONS:%d OPTION:%d LIMIT:%d\n**********\n", STATE.label, OPTIONS, OPTION, LIMIT); + + fsy = 156; hud_frameskip(); + hud_volume(); + hud_brightness(); } //}#pragma endregion Display @@ -467,10 +555,10 @@ THEME GUI; buffer = (uint16_t *)malloc(size); if (!buffer) abort(); OPTION = 0; - OPTIONS = SAVED ? 7 : 4; + OPTIONS = SAVED ? 9 : 6; hud_theme(); GUI = THEMES[USER]; - STATE = OPTIONS == 7 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; + STATE = OPTIONS == 9 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; INIT = true; } } @@ -485,9 +573,9 @@ THEME GUI; //{#pragma region Menu void hud_menu(void) { - int volume = odroid_audio_volume_get(); + VOLUME = odroid_settings_Volume_get(); #ifdef CONFIG_LCD_DRIVER_CHIP_RETRO_ESP32 - volume = 8; + //volume = 8; #endif odroid_audio_terminate(); hud_init(); @@ -518,23 +606,59 @@ THEME GUI; usleep(200000); //debounce(ODROID_INPUT_DOWN); } - if(STATE.action == 6) { - /* - LEFT - */ - if(gamepad.values[ODROID_INPUT_LEFT]) { + /* + LEFT + */ + if(gamepad.values[ODROID_INPUT_LEFT]) { + if(STATE.action == 6) { if(frameskip > 2) {frameskip--;} hud_options(); - usleep(200000); } - /* - RIGHT - */ - if(gamepad.values[ODROID_INPUT_RIGHT]) { + if(OPTION == OPTIONS - 3) { + if(VOLUME > 0) { + VOLUME--; + odroid_audio_volume_set(VOLUME); + odroid_settings_Volume_set(VOLUME); + hud_options(); + usleep(200000); + } + } + if(OPTION == OPTIONS - 3 + 1) { + if(BRIGHTNESS > 0) { + BRIGHTNESS--; + odroid_settings_Backlight_set(BRIGHTNESS); + hud_options(); + usleep(200000); + } + } + usleep(200000); + } + /* + RIGHT + */ + if(gamepad.values[ODROID_INPUT_RIGHT]) { + if(STATE.action == 6) { if(frameskip < 10) {frameskip++;} hud_options(); - usleep(200000); + } + if(OPTION == OPTIONS - 3) { + if(VOLUME < 8) { + VOLUME++; + odroid_audio_volume_set(VOLUME); + odroid_settings_Volume_set(VOLUME); + hud_options(); + usleep(200000); + } } + if(OPTION == OPTIONS - 3 + 1) { + if(BRIGHTNESS < (BRIGHTNESS_COUNT-1)) { + BRIGHTNESS++; + odroid_settings_Backlight_set(BRIGHTNESS); + hud_options(); + usleep(200000); + } + } + usleep(200000); } /* BUTTON B @@ -548,7 +672,7 @@ THEME GUI; BUTTON A */ if (gamepad.values[ODROID_INPUT_A]) { - odroid_audio_volume_set(volume); + odroid_settings_Volume_set(VOLUME); hud_debug(STATE.label); ACTION = STATE.action; switch(ACTION) { diff --git a/Components/odroid-go-pcengine-huexpress/odroid-go-common/components/odroid/odroid_hud.h b/Components/odroid-go-pcengine-huexpress/odroid-go-common/components/odroid/odroid_hud.h index ea78eafa..f9115bde 100755 --- a/Components/odroid-go-pcengine-huexpress/odroid-go-common/components/odroid/odroid_hud.h +++ b/Components/odroid-go-pcengine-huexpress/odroid-go-common/components/odroid/odroid_hud.h @@ -48,5 +48,8 @@ void hud_menu(); */ void hud_logo(void); void hud_progress(char *string, bool bar); +void hud_bar(int x, int y, int percent, bool active); +void hud_volume(); +void hud_brightness(); void hud_frameskip(); void hud_options(); \ No newline at end of file diff --git a/Components/odroid-go-spectrum-emulator/components/odroid/odroid_hud.c b/Components/odroid-go-spectrum-emulator/components/odroid/odroid_hud.c index 54a0d631..ff6a74ca 100755 --- a/Components/odroid-go-spectrum-emulator/components/odroid/odroid_hud.c +++ b/Components/odroid-go-spectrum-emulator/components/odroid/odroid_hud.c @@ -63,6 +63,11 @@ bool INIT = false; bool SAVED = false; bool forceConsoleReset; + + int32_t VOLUME = 0; + int32_t BRIGHTNESS = 0; + const int32_t BRIGHTNESS_COUNT = 10; + const int32_t BRIGHTNESS_LEVELS[10] = {10,20,30,40,50,60,70,80,90,100}; //}#pragma endregion Globals //{#pragma region Structs @@ -79,20 +84,23 @@ int action; int offset; } STATES; - STATES WITHSAVE[6] = { + STATES WITHSAVE[5] = { {"Resume Game",0, 0}, {"Restart Game",1, 10}, {"Reload Game",2, 5}, {"Overwrite Game",4, 25}, - {"Delete Save",5, 15}, - {"Exit Game",6, 20} + {"Delete Save",5, 15} }; - STATES WITHOUTSAVE[4] = { + STATES WITHOUTSAVE[3] = { {"Resume Game",0, 0}, {"Restart Game",1, 10}, - {"Save Game",3, 25}, - {"Exit Game",6, 20} + {"Save Game",3, 25} }; + STATES EXTRAS[3] = { + {"Volume",8, 45}, + {"Brightness",9, 50}, + {"Quit Game",6, 20} + }; STATES STATE; // THEME @@ -140,43 +148,62 @@ const uint16_t FONT_5x7[7][250] = { {65535,0,0,0,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,65535,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,0,0,0,0,0,65535,65535,65535,0,65535,0,0,0,65535,65535,65535,65535,65535,65535,0,65535,65535,0,0,65535,0,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,0,65535,65535,0,0,0,65535,0,65535,65535,65535,0,65535,0,0,0,0,0,0,0,0,65535,65535,0,0,0,65535,0,65535,65535,65535,0,0,0,65535,0,0,0,65535,65535,65535,0,0,0,65535,0,0,0,65535,0,65535,0,65535,0,0,0,65535,0,0,65535,0,0,65535,65535,65535,65535,65535,0,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,65535,65535,65535,0,0,0,0,0,65535,0,65535,65535,65535,0,0,65535,65535,65535,0,65535,0,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,0,65535,0,0,0,0,65535,0,0,0,0,65535,0,0,65535,0,0,0,0,0,0,0,65535,0,0,65535,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0}, }; - const uint16_t icons[35][5] = { - {0,65535,65535,0,0}, - {0,65535,65535,65535,0}, - {0,65535,65535,65535,65535}, - {0,65535,65535,65535,0}, - {0,65535,65535,0,0}, - {65535,0,65535,0,0}, - {65535,0,65535,65535,0}, - {65535,0,65535,65535,65535}, - {65535,0,65535,65535,0}, - {65535,0,65535,0,0}, - {0,65535,65535,0,65535}, - {65535,0,0,65535,65535}, - {65535,0,0,0,65535}, - {65535,65535,0,0,65535}, - {65535,0,65535,65535,0}, - {0,65535,65535,65535,0}, - {65535,0,65535,0,65535}, - {65535,65535,0,65535,65535}, - {65535,0,65535,0,65535}, - {0,65535,65535,65535,0}, - {65535,0,0,0,65535}, - {0,65535,0,65535,0}, - {0,0,65535,0,0}, - {0,65535,0,65535,0}, - {65535,0,0,0,65535}, - {0,0,0,0,0}, - {0,0,0,0,65535}, - {0,0,0,65535,0}, - {65535,0,65535,0,0}, - {0,65535,0,0,0}, - {0,65535,65535,65535,0}, - {65535,0,65535,0,65535}, - {65535,0,65535,65535,65535}, - {65535,0,0,0,65535}, - {0,65535,65535,65535,0}, - +const uint16_t icons[55][5] = { + {0,65535,65535,0,0}, + {0,65535,65535,65535,0}, + {0,65535,65535,65535,65535}, + {0,65535,65535,65535,0}, + {0,65535,65535,0,0}, + {65535,0,65535,0,0}, + {65535,0,65535,65535,0}, + {65535,0,65535,65535,65535}, + {65535,0,65535,65535,0}, + {65535,0,65535,0,0}, + {0,65535,65535,0,65535}, + {65535,0,0,65535,65535}, + {65535,0,0,0,65535}, + {65535,65535,0,0,65535}, + {65535,0,65535,65535,0}, + {0,65535,65535,65535,0}, + {65535,0,65535,0,65535}, + {65535,65535,0,65535,65535}, + {65535,0,65535,0,65535}, + {0,65535,65535,65535,0}, + {65535,0,0,0,65535}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {65535,0,0,0,65535}, + {0,0,0,0,0}, + {0,0,0,0,65535}, + {0,0,0,65535,0}, + {65535,0,65535,0,0}, + {0,65535,0,0,0}, + {0,65535,65535,65535,0}, + {65535,0,65535,0,65535}, + {65535,0,65535,65535,65535}, + {65535,0,0,0,65535}, + {0,65535,65535,65535,0}, + {0,65535,0,65535,0}, + {65535,65535,65535,65535,65535}, + {65535,65535,65535,65535,65535}, + {0,65535,65535,65535,0}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {65535,0,65535,0,65535}, + {65535,0,0,0,65535}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {0,0,0,65535,0}, + {0,65535,0,0,65535}, + {0,0,65535,0,65535}, + {0,65535,0,0,65535}, + {0,0,0,65535,0}, + {65535,0,0,0,65535}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {65535,0,0,0,65535}, }; const uint16_t logo[12][64] = { @@ -406,6 +433,47 @@ const uint16_t FONT_5x7[7][250] = { } } + void hud_bar(int x, int y, int percent, bool active) { + int w, h; + + int i = 0; + for(h = 0; h < 7; h++) { + for(w = 0; w < 100; w++) { + buffer[i] = (w+h)%2 == 0 ? GUI.fg : GUI.bg; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, 100, 7, buffer); + + if(percent > 0) { + i = 0; + for(h = 0; h < 7; h++) { + for(w = 0; w < percent; w++) { + buffer[i] = active ? GUI.hl : GUI.fg; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, percent, 7, buffer); + } + } + + void hud_volume() { + // y=176; + int32_t VOLUME = odroid_settings_Volume_get(); + int LIMIT = OPTIONS - 3; + bool active = OPTION == LIMIT ? true : false; + hud_bar((SCREEN.w - 120), 176, VOLUME * 12.5, active); + } + + void hud_brightness() { + // y=176; + int LIMIT = OPTIONS - 2; + bool active = OPTION == LIMIT ? true : false; + BRIGHTNESS = odroid_settings_Backlight_get(); + + hud_bar((SCREEN.w - 120), 196, (BRIGHTNESS_COUNT * BRIGHTNESS)+BRIGHTNESS+1, active); + } + void hud_options() { x = 16; y = 28; @@ -413,33 +481,52 @@ const uint16_t FONT_5x7[7][250] = { h = 5; i = 0; int n; - if(OPTIONS == 6) { - for(n = 0; n < OPTIONS; n++) { + if(OPTIONS == 8) { + for(n = 0; n < 5; n++) { STATE = WITHSAVE[n]; y+=20; for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { buffer[i] = icons[r+STATE.offset][c] == WHITE ? OPTION == n ? GUI.hl : GUI.fg : GUI.bg;i++; }} - if(n == OPTIONS-1) {y = 216;} ili9341_write_frame_rectangleLE(x, y, w, h, buffer); hud_text(x+10,y,STATE.label,false,OPTION == n?true:false); i = 0; } - STATE = WITHSAVE[OPTION]; } else { - for(n = 0; n < OPTIONS; n++) { + for(n = 0; n < 3; n++) { STATE = WITHOUTSAVE[n]; y+=20; for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { buffer[i] = icons[r+STATE.offset][c] == WHITE ? OPTION == n ? GUI.hl : GUI.fg : GUI.bg;i++; }} - if(n == OPTIONS-1) {y = 216;} ili9341_write_frame_rectangleLE(x, y, w, h, buffer); hud_text(x+10,y,STATE.label,false,OPTION == n?true:false); i = 0; } - STATE = WITHOUTSAVE[OPTION]; } + + y=156; + for(n = 0; n < 3; n++) { + STATE = EXTRAS[n]; + y+=20; + for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { + buffer[i] = icons[r+STATE.offset][c] == WHITE ? OPTION == (n+OPTIONS-3) ? GUI.hl : GUI.fg : GUI.bg;i++; + }} + ili9341_write_frame_rectangleLE(x, y, w, h, buffer); + hud_text(x+10,y,STATE.label,false,OPTION == (n+OPTIONS-3)?true:false); + i = 0; + } + + int LIMIT = OPTIONS - 3; + if(OPTION < LIMIT) { + STATE = OPTIONS == 8 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; + } else { + STATE = EXTRAS[OPTION-LIMIT]; + } + printf("\n**********\n%s - %d:%d\n**********\n", STATE.label, OPTION, LIMIT); + + hud_volume(); + hud_brightness(); } //}#pragma endregion Display @@ -450,10 +537,10 @@ const uint16_t FONT_5x7[7][250] = { buffer = (uint16_t *)malloc(size); if (!buffer) abort(); OPTION = 0; - OPTIONS = SAVED ? 6 : 4; + OPTIONS = SAVED ? 8 : 6; hud_theme(); GUI = THEMES[USER]; - STATE = OPTIONS == 6 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; + STATE = OPTIONS == 8 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; INIT = true; } } @@ -468,9 +555,9 @@ const uint16_t FONT_5x7[7][250] = { //{#pragma region Menu void hud_menu(void) { - int volume = odroid_audio_volume_get(); + VOLUME = odroid_settings_Volume_get(); #ifdef CONFIG_LCD_DRIVER_CHIP_RETRO_ESP32 - volume = 8; + //volume = 8; #endif odroid_audio_terminate(); hud_init(); @@ -501,6 +588,49 @@ const uint16_t FONT_5x7[7][250] = { usleep(200000); //hud_debounce(ODROID_INPUT_DOWN); } + /* + LEFT + */ + if(gamepad.values[ODROID_INPUT_LEFT]) { + if(OPTION == OPTIONS - 3) { + if(VOLUME > 0) { + VOLUME--; + odroid_settings_Volume_set(VOLUME); + hud_options(); + usleep(200000); + } + } + if(OPTION == OPTIONS - 3 + 1) { + if(BRIGHTNESS > 0) { + BRIGHTNESS--; + odroid_settings_Backlight_set(BRIGHTNESS); + hud_options(); + usleep(200000); + } + } + } + + /* + RIGHT + */ + if(gamepad.values[ODROID_INPUT_RIGHT]) { + if(OPTION == OPTIONS - 3) { + if(VOLUME < 8) { + VOLUME++; + odroid_settings_Volume_set(VOLUME); + hud_options(); + usleep(200000); + } + } + if(OPTION == OPTIONS - 3 + 1) { + if(BRIGHTNESS < (BRIGHTNESS_COUNT-1)) { + BRIGHTNESS++; + odroid_settings_Backlight_set(BRIGHTNESS); + hud_options(); + usleep(200000); + } + } + } /* BUTTON B */ @@ -513,7 +643,7 @@ const uint16_t FONT_5x7[7][250] = { BUTTON A */ if (gamepad.values[ODROID_INPUT_A]) { - odroid_audio_volume_set(volume); + odroid_audio_volume_set(VOLUME); hud_debug(STATE.label); ACTION = STATE.action; switch(ACTION) { diff --git a/Components/odroid-go-spectrum-emulator/components/odroid/odroid_hud.h b/Components/odroid-go-spectrum-emulator/components/odroid/odroid_hud.h index 273049f7..4c584496 100755 --- a/Components/odroid-go-spectrum-emulator/components/odroid/odroid_hud.h +++ b/Components/odroid-go-spectrum-emulator/components/odroid/odroid_hud.h @@ -48,4 +48,7 @@ void hud_menu(); */ void hud_logo(void); void hud_progress(char *string, bool bar); +void hud_bar(int x, int y, int percent, bool active); +void hud_volume(); +void hud_brightness(); void hud_options(); \ No newline at end of file diff --git a/Components/prosystem-odroid-go/components/odroid/odroid_hud.c b/Components/prosystem-odroid-go/components/odroid/odroid_hud.c index e66cb4fc..eab20857 100755 --- a/Components/prosystem-odroid-go/components/odroid/odroid_hud.c +++ b/Components/prosystem-odroid-go/components/odroid/odroid_hud.c @@ -63,6 +63,11 @@ bool INIT = false; bool SAVED = false; bool forceConsoleReset; + + int32_t VOLUME = 0; + int32_t BRIGHTNESS = 0; + const int32_t BRIGHTNESS_COUNT = 10; + const int32_t BRIGHTNESS_LEVELS[10] = {10,20,30,40,50,60,70,80,90,100}; //}#pragma endregion Globals //{#pragma region Structs @@ -79,19 +84,22 @@ int action; int offset; } STATES; - STATES WITHSAVE[6] = { + STATES WITHSAVE[5] = { {"Resume Game",0, 0}, {"Restart Game",1, 10}, {"Reload Game",2, 5}, {"Overwrite Game",4, 25}, - {"Delete Save",5, 15}, - {"Exit Game",6, 20} + {"Delete Save",5, 15} }; - STATES WITHOUTSAVE[3] = { + STATES WITHOUTSAVE[2] = { {"Resume Game",0, 0}, - {"Restart Game",1, 10}, - {"Exit Game",6, 20} + {"Restart Game",1, 10} }; + STATES EXTRAS[3] = { + {"Volume",8, 45}, + {"Brightness",9, 50}, + {"Quit Game",6, 20} + }; STATES STATE; // THEME @@ -139,43 +147,62 @@ const uint16_t FONT_5x7[7][250] = { {65535,0,0,0,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,65535,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,0,0,0,0,0,65535,65535,65535,0,65535,0,0,0,65535,65535,65535,65535,65535,65535,0,65535,65535,0,0,65535,0,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,0,65535,65535,0,0,0,65535,0,65535,65535,65535,0,65535,0,0,0,0,0,0,0,0,65535,65535,0,0,0,65535,0,65535,65535,65535,0,0,0,65535,0,0,0,65535,65535,65535,0,0,0,65535,0,0,0,65535,0,65535,0,65535,0,0,0,65535,0,0,65535,0,0,65535,65535,65535,65535,65535,0,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,65535,65535,65535,0,0,0,0,0,65535,0,65535,65535,65535,0,0,65535,65535,65535,0,65535,0,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,0,65535,0,0,0,0,65535,0,0,0,0,65535,0,0,65535,0,0,0,0,0,0,0,65535,0,0,65535,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0}, }; - const uint16_t icons[35][5] = { - {0,65535,65535,0,0}, - {0,65535,65535,65535,0}, - {0,65535,65535,65535,65535}, - {0,65535,65535,65535,0}, - {0,65535,65535,0,0}, - {65535,0,65535,0,0}, - {65535,0,65535,65535,0}, - {65535,0,65535,65535,65535}, - {65535,0,65535,65535,0}, - {65535,0,65535,0,0}, - {0,65535,65535,0,65535}, - {65535,0,0,65535,65535}, - {65535,0,0,0,65535}, - {65535,65535,0,0,65535}, - {65535,0,65535,65535,0}, - {0,65535,65535,65535,0}, - {65535,0,65535,0,65535}, - {65535,65535,0,65535,65535}, - {65535,0,65535,0,65535}, - {0,65535,65535,65535,0}, - {65535,0,0,0,65535}, - {0,65535,0,65535,0}, - {0,0,65535,0,0}, - {0,65535,0,65535,0}, - {65535,0,0,0,65535}, - {0,0,0,0,0}, - {0,0,0,0,65535}, - {0,0,0,65535,0}, - {65535,0,65535,0,0}, - {0,65535,0,0,0}, - {0,65535,65535,65535,0}, - {65535,0,65535,0,65535}, - {65535,0,65535,65535,65535}, - {65535,0,0,0,65535}, - {0,65535,65535,65535,0}, - +const uint16_t icons[55][5] = { + {0,65535,65535,0,0}, + {0,65535,65535,65535,0}, + {0,65535,65535,65535,65535}, + {0,65535,65535,65535,0}, + {0,65535,65535,0,0}, + {65535,0,65535,0,0}, + {65535,0,65535,65535,0}, + {65535,0,65535,65535,65535}, + {65535,0,65535,65535,0}, + {65535,0,65535,0,0}, + {0,65535,65535,0,65535}, + {65535,0,0,65535,65535}, + {65535,0,0,0,65535}, + {65535,65535,0,0,65535}, + {65535,0,65535,65535,0}, + {0,65535,65535,65535,0}, + {65535,0,65535,0,65535}, + {65535,65535,0,65535,65535}, + {65535,0,65535,0,65535}, + {0,65535,65535,65535,0}, + {65535,0,0,0,65535}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {65535,0,0,0,65535}, + {0,0,0,0,0}, + {0,0,0,0,65535}, + {0,0,0,65535,0}, + {65535,0,65535,0,0}, + {0,65535,0,0,0}, + {0,65535,65535,65535,0}, + {65535,0,65535,0,65535}, + {65535,0,65535,65535,65535}, + {65535,0,0,0,65535}, + {0,65535,65535,65535,0}, + {0,65535,0,65535,0}, + {65535,65535,65535,65535,65535}, + {65535,65535,65535,65535,65535}, + {0,65535,65535,65535,0}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {65535,0,65535,0,65535}, + {65535,0,0,0,65535}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {0,0,0,65535,0}, + {0,65535,0,0,65535}, + {0,0,65535,0,65535}, + {0,65535,0,0,65535}, + {0,0,0,65535,0}, + {65535,0,0,0,65535}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {65535,0,0,0,65535}, }; const uint16_t logo[12][64] = { @@ -405,6 +432,47 @@ const uint16_t FONT_5x7[7][250] = { } } +void hud_bar(int x, int y, int percent, bool active) { + int w, h; + + int i = 0; + for(h = 0; h < 7; h++) { + for(w = 0; w < 100; w++) { + buffer[i] = (w+h)%2 == 0 ? GUI.fg : GUI.bg; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, 100, 7, buffer); + + if(percent > 0) { + i = 0; + for(h = 0; h < 7; h++) { + for(w = 0; w < percent; w++) { + buffer[i] = active ? GUI.hl : GUI.fg; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, percent, 7, buffer); + } + } + + void hud_volume() { + // y=176; + int32_t VOLUME = odroid_settings_Volume_get(); + int LIMIT = OPTIONS - 3; + bool active = OPTION == LIMIT ? true : false; + hud_bar((SCREEN.w - 120), 176, VOLUME * 12.5, active); + } + + void hud_brightness() { + // y=176; + int LIMIT = OPTIONS - 2; + bool active = OPTION == LIMIT ? true : false; + BRIGHTNESS = odroid_settings_Backlight_get(); + + hud_bar((SCREEN.w - 120), 196, (BRIGHTNESS_COUNT * BRIGHTNESS)+BRIGHTNESS+1, active); + } + void hud_options() { x = 16; y = 28; @@ -412,7 +480,7 @@ const uint16_t FONT_5x7[7][250] = { h = 5; i = 0; int n; - if(OPTIONS == 6) { + if(OPTIONS == 7) { for(n = 0; n < OPTIONS; n++) { STATE = WITHSAVE[n]; y+=20; @@ -426,7 +494,7 @@ const uint16_t FONT_5x7[7][250] = { } STATE = WITHSAVE[OPTION]; } else { - for(n = 0; n < OPTIONS; n++) { + for(n = 0; n < 2; n++) { STATE = WITHOUTSAVE[n]; y+=20; for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { @@ -439,6 +507,29 @@ const uint16_t FONT_5x7[7][250] = { } STATE = WITHOUTSAVE[OPTION]; } + + y=156; + for(n = 0; n < 3; n++) { + STATE = EXTRAS[n]; + y+=20; + for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { + buffer[i] = icons[r+STATE.offset][c] == WHITE ? OPTION == (n+OPTIONS-3) ? GUI.hl : GUI.fg : GUI.bg;i++; + }} + ili9341_write_frame_rectangleLE(x, y, w, h, buffer); + hud_text(x+10,y,STATE.label,false,OPTION == (n+OPTIONS-3)?true:false); + i = 0; + } + + int LIMIT = OPTIONS - 3; + if(OPTION < LIMIT) { + STATE = OPTIONS == 7 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; + } else { + STATE = EXTRAS[OPTION-LIMIT]; + } + printf("\n**********\n%s - %d:%d\n**********\n", STATE.label, OPTION, LIMIT); + + hud_volume(); + hud_brightness(); } //}#pragma endregion Display @@ -449,10 +540,10 @@ const uint16_t FONT_5x7[7][250] = { buffer = (uint16_t *)malloc(size); if (!buffer) abort(); OPTION = 0; - OPTIONS = SAVED ? 6 : 3; + OPTIONS = SAVED ? 8 : 5; hud_theme(); GUI = THEMES[USER]; - STATE = OPTIONS == 6 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; + STATE = OPTIONS == 8 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; INIT = true; hud_debug("HUD - INIT"); } @@ -469,9 +560,9 @@ const uint16_t FONT_5x7[7][250] = { //{#pragma region Menu void hud_menu(void) { - int volume = odroid_audio_volume_get(); + VOLUME = odroid_audio_volume_get(); #ifdef CONFIG_LCD_DRIVER_CHIP_RETRO_ESP32 - volume = 8; + //volume = 8; #endif odroid_audio_terminate(); hud_init(); @@ -505,6 +596,49 @@ const uint16_t FONT_5x7[7][250] = { usleep(200000); //debounce(ODROID_INPUT_DOWN); } + /* + LEFT + */ + if(gamepad.values[ODROID_INPUT_LEFT]) { + if(OPTION == OPTIONS - 3) { + if(VOLUME > 0) { + VOLUME--; + odroid_settings_Volume_set(VOLUME); + hud_options(); + usleep(200000); + } + } + if(OPTION == OPTIONS - 3 + 1) { + if(BRIGHTNESS > 0) { + BRIGHTNESS--; + odroid_settings_Backlight_set(BRIGHTNESS); + hud_options(); + usleep(200000); + } + } + } + + /* + RIGHT + */ + if(gamepad.values[ODROID_INPUT_RIGHT]) { + if(OPTION == OPTIONS - 3) { + if(VOLUME < 8) { + VOLUME++; + odroid_settings_Volume_set(VOLUME); + hud_options(); + usleep(200000); + } + } + if(OPTION == OPTIONS - 3 + 1) { + if(BRIGHTNESS < (BRIGHTNESS_COUNT-1)) { + BRIGHTNESS++; + odroid_settings_Backlight_set(BRIGHTNESS); + hud_options(); + usleep(200000); + } + } + } /* BUTTON B */ @@ -518,7 +652,7 @@ const uint16_t FONT_5x7[7][250] = { BUTTON A */ if (gamepad.values[ODROID_INPUT_A]) { - odroid_audio_volume_set(volume); + odroid_audio_volume_set(VOLUME); hud_debug(STATE.label); ACTION = STATE.action; switch(ACTION) { diff --git a/Components/prosystem-odroid-go/components/odroid/odroid_hud.h b/Components/prosystem-odroid-go/components/odroid/odroid_hud.h index a347f0d0..c1222ea0 100755 --- a/Components/prosystem-odroid-go/components/odroid/odroid_hud.h +++ b/Components/prosystem-odroid-go/components/odroid/odroid_hud.h @@ -48,4 +48,7 @@ void hud_menu(); */ void hud_logo(void); void hud_progress(char *string, bool bar); +void hud_bar(int x, int y, int percent, bool active); +void hud_volume(); +void hud_brightness(); void hud_options(); \ No newline at end of file diff --git a/Components/retro-go/components/odroid/odroid_hud.c b/Components/retro-go/components/odroid/odroid_hud.c index 45a4b74f..b73afe6f 100755 --- a/Components/retro-go/components/odroid/odroid_hud.c +++ b/Components/retro-go/components/odroid/odroid_hud.c @@ -63,6 +63,11 @@ bool INIT = false; bool SAVED = false; bool forceConsoleReset; + + int32_t VOLUME = 0; + int32_t BRIGHTNESS = 0; + const int32_t BRIGHTNESS_COUNT = 10; + const int32_t BRIGHTNESS_LEVELS[10] = {10,20,30,40,50,60,70,80,90,100}; //}#pragma endregion Globals //{#pragma region Structs @@ -79,20 +84,23 @@ int action; int offset; } STATES; - STATES WITHSAVE[6] = { + STATES WITHSAVE[5] = { {"Resume Game",0, 0}, {"Restart Game",1, 10}, {"Reload Game",2, 5}, {"Overwrite Game",4, 25}, - {"Delete Save",5, 15}, - {"Exit Game",6, 20} + {"Delete Save",5, 15} }; - STATES WITHOUTSAVE[4] = { + STATES WITHOUTSAVE[3] = { {"Resume Game",0, 0}, {"Restart Game",1, 10}, - {"Save Game",3, 25}, - {"Exit Game",6, 20} + {"Save Game",3, 25} }; + STATES EXTRAS[3] = { + {"Volume",8, 45}, + {"Brightness",9, 50}, + {"Quit Game",6, 20} + }; STATES STATE; // THEME @@ -140,43 +148,62 @@ const uint16_t FONT_5x7[7][250] = { {65535,0,0,0,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,65535,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,0,0,0,0,0,65535,65535,65535,0,65535,0,0,0,65535,65535,65535,65535,65535,65535,0,65535,65535,0,0,65535,0,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,0,65535,65535,0,0,0,65535,0,65535,65535,65535,0,65535,0,0,0,0,0,0,0,0,65535,65535,0,0,0,65535,0,65535,65535,65535,0,0,0,65535,0,0,0,65535,65535,65535,0,0,0,65535,0,0,0,65535,0,65535,0,65535,0,0,0,65535,0,0,65535,0,0,65535,65535,65535,65535,65535,0,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,65535,65535,65535,0,0,0,0,0,65535,0,65535,65535,65535,0,0,65535,65535,65535,0,65535,0,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,0,65535,0,0,0,0,65535,0,0,0,0,65535,0,0,65535,0,0,0,0,0,0,0,65535,0,0,65535,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0}, }; - const uint16_t icons[35][5] = { - {0,65535,65535,0,0}, - {0,65535,65535,65535,0}, - {0,65535,65535,65535,65535}, - {0,65535,65535,65535,0}, - {0,65535,65535,0,0}, - {65535,0,65535,0,0}, - {65535,0,65535,65535,0}, - {65535,0,65535,65535,65535}, - {65535,0,65535,65535,0}, - {65535,0,65535,0,0}, - {0,65535,65535,0,65535}, - {65535,0,0,65535,65535}, - {65535,0,0,0,65535}, - {65535,65535,0,0,65535}, - {65535,0,65535,65535,0}, - {0,65535,65535,65535,0}, - {65535,0,65535,0,65535}, - {65535,65535,0,65535,65535}, - {65535,0,65535,0,65535}, - {0,65535,65535,65535,0}, - {65535,0,0,0,65535}, - {0,65535,0,65535,0}, - {0,0,65535,0,0}, - {0,65535,0,65535,0}, - {65535,0,0,0,65535}, - {0,0,0,0,0}, - {0,0,0,0,65535}, - {0,0,0,65535,0}, - {65535,0,65535,0,0}, - {0,65535,0,0,0}, - {0,65535,65535,65535,0}, - {65535,0,65535,0,65535}, - {65535,0,65535,65535,65535}, - {65535,0,0,0,65535}, - {0,65535,65535,65535,0}, - +const uint16_t icons[55][5] = { + {0,65535,65535,0,0}, + {0,65535,65535,65535,0}, + {0,65535,65535,65535,65535}, + {0,65535,65535,65535,0}, + {0,65535,65535,0,0}, + {65535,0,65535,0,0}, + {65535,0,65535,65535,0}, + {65535,0,65535,65535,65535}, + {65535,0,65535,65535,0}, + {65535,0,65535,0,0}, + {0,65535,65535,0,65535}, + {65535,0,0,65535,65535}, + {65535,0,0,0,65535}, + {65535,65535,0,0,65535}, + {65535,0,65535,65535,0}, + {0,65535,65535,65535,0}, + {65535,0,65535,0,65535}, + {65535,65535,0,65535,65535}, + {65535,0,65535,0,65535}, + {0,65535,65535,65535,0}, + {65535,0,0,0,65535}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {65535,0,0,0,65535}, + {0,0,0,0,0}, + {0,0,0,0,65535}, + {0,0,0,65535,0}, + {65535,0,65535,0,0}, + {0,65535,0,0,0}, + {0,65535,65535,65535,0}, + {65535,0,65535,0,65535}, + {65535,0,65535,65535,65535}, + {65535,0,0,0,65535}, + {0,65535,65535,65535,0}, + {0,65535,0,65535,0}, + {65535,65535,65535,65535,65535}, + {65535,65535,65535,65535,65535}, + {0,65535,65535,65535,0}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {65535,0,65535,0,65535}, + {65535,0,0,0,65535}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {0,0,0,65535,0}, + {0,65535,0,0,65535}, + {0,0,65535,0,65535}, + {0,65535,0,0,65535}, + {0,0,0,65535,0}, + {65535,0,0,0,65535}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {65535,0,0,0,65535}, }; const uint16_t logo[12][64] = { @@ -280,7 +307,7 @@ const uint16_t FONT_5x7[7][250] = { gets(tmp); if(strcmp(save_name, tmp) == 0) { SAVED = true; - printf("\n******\nfile_to_delete:%s\nsave_name:%s\ntmp%s\n******\n", file_to_delete, save_name, tmp); + //printf("\n******\nfile_to_delete:%s\nsave_name:%s\ntmp%s\n******\n", file_to_delete, save_name, tmp); hud_delete_save(file_to_delete); } } @@ -403,6 +430,48 @@ const uint16_t FONT_5x7[7][250] = { } } + + void hud_bar(int x, int y, int percent, bool active) { + int w, h; + + int i = 0; + for(h = 0; h < 7; h++) { + for(w = 0; w < 100; w++) { + buffer[i] = (w+h)%2 == 0 ? GUI.fg : GUI.bg; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, 100, 7, buffer); + + if(percent > 0) { + i = 0; + for(h = 0; h < 7; h++) { + for(w = 0; w < percent; w++) { + buffer[i] = active ? GUI.hl : GUI.fg; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, percent, 7, buffer); + } + } + + void hud_volume() { + // y=176; + int32_t VOLUME = odroid_audio_volume_get(); + int LIMIT = OPTIONS - 3; + bool active = OPTION == LIMIT ? true : false; + hud_bar((SCREEN.w - 120), 176, VOLUME * 12.5, active); + } + + void hud_brightness() { + // y=176; + int LIMIT = OPTIONS - 2; + bool active = OPTION == LIMIT ? true : false; + BRIGHTNESS = odroid_display_backlight_get(); + + hud_bar((SCREEN.w - 120), 196, (BRIGHTNESS_COUNT * BRIGHTNESS)+BRIGHTNESS+1, active); + } + void hud_options() { x = 16; y = 28; @@ -410,33 +479,52 @@ const uint16_t FONT_5x7[7][250] = { h = 5; i = 0; int n; - if(OPTIONS == 6) { - for(n = 0; n < OPTIONS; n++) { + if(OPTIONS == 8) { + for(n = 0; n < 5; n++) { STATE = WITHSAVE[n]; y+=20; for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { buffer[i] = icons[r+STATE.offset][c] == WHITE ? OPTION == n ? GUI.hl : GUI.fg : GUI.bg;i++; }} - if(n == OPTIONS-1) {y = 216;} ili9341_write_frame_rectangleLE(x, y, w, h, buffer); hud_text(x+10,y,STATE.label,false,OPTION == n?true:false); i = 0; } - STATE = WITHSAVE[OPTION]; } else { - for(n = 0; n < OPTIONS; n++) { + for(n = 0; n < 3; n++) { STATE = WITHOUTSAVE[n]; y+=20; for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { buffer[i] = icons[r+STATE.offset][c] == WHITE ? OPTION == n ? GUI.hl : GUI.fg : GUI.bg;i++; }} - if(n == OPTIONS-1) {y = 216;} ili9341_write_frame_rectangleLE(x, y, w, h, buffer); hud_text(x+10,y,STATE.label,false,OPTION == n?true:false); i = 0; } - STATE = WITHOUTSAVE[OPTION]; } + + y=156; + for(n = 0; n < 3; n++) { + STATE = EXTRAS[n]; + y+=20; + for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { + buffer[i] = icons[r+STATE.offset][c] == WHITE ? OPTION == (n+OPTIONS-3) ? GUI.hl : GUI.fg : GUI.bg;i++; + }} + ili9341_write_frame_rectangleLE(x, y, w, h, buffer); + hud_text(x+10,y,STATE.label,false,OPTION == (n+OPTIONS-3)?true:false); + i = 0; + } + + int LIMIT = OPTIONS - 3; + if(OPTION < LIMIT) { + STATE = OPTIONS == 8 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; + } else { + STATE = EXTRAS[OPTION-LIMIT]; + } + printf("\n**********\n%s - %d:%d\n**********\n", STATE.label, OPTION, LIMIT); + + hud_volume(); + hud_brightness(); } //}#pragma endregion Display @@ -447,10 +535,10 @@ const uint16_t FONT_5x7[7][250] = { buffer = (uint16_t *)malloc(size); if (!buffer) abort(); OPTION = 0; - OPTIONS = SAVED ? 6 : 4; + OPTIONS = SAVED ? 8 : 6; hud_theme(); GUI = THEMES[USER]; - STATE = OPTIONS == 6 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; + STATE = OPTIONS == 8 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; INIT = true; } } @@ -465,9 +553,9 @@ const uint16_t FONT_5x7[7][250] = { //{#pragma region Menu void hud_menu(void) { - int volume = odroid_audio_volume_get(); + VOLUME = odroid_audio_volume_get(); #ifdef CONFIG_LCD_DRIVER_CHIP_RETRO_ESP32 - volume = 8; + //volume = 8; #endif odroid_audio_terminate(); hud_init(); @@ -498,12 +586,57 @@ const uint16_t FONT_5x7[7][250] = { usleep(200000); //debounce(ODROID_INPUT_DOWN); } + + /* + LEFT + */ + if(gamepad.values[ODROID_INPUT_LEFT]) { + if(OPTION == OPTIONS - 3) { + if(VOLUME > 0) { + VOLUME--; + odroid_audio_volume_set(VOLUME); + hud_options(); + usleep(200000); + } + } + if(OPTION == OPTIONS - 3 + 1) { + if(BRIGHTNESS > 0) { + BRIGHTNESS--; + odroid_display_backlight_set(BRIGHTNESS); + hud_options(); + usleep(200000); + } + } + } + + /* + RIGHT + */ + if(gamepad.values[ODROID_INPUT_RIGHT]) { + if(OPTION == OPTIONS - 3) { + if(VOLUME < 8) { + VOLUME++; + odroid_audio_volume_set(VOLUME); + hud_options(); + usleep(200000); + } + } + if(OPTION == OPTIONS - 3 + 1) { + if(BRIGHTNESS < (BRIGHTNESS_COUNT-1)) { + BRIGHTNESS++; + odroid_display_backlight_set(BRIGHTNESS); + hud_options(); + usleep(200000); + } + } + } + /* BUTTON B */ if (gamepad.values[ODROID_INPUT_B]) { ACTION = 0; - odroid_audio_volume_set(volume); + odroid_audio_volume_set(VOLUME); int sink = odroid_settings_AudioSink_get(); odroid_settings_AudioSink_set(sink); @@ -515,7 +648,7 @@ const uint16_t FONT_5x7[7][250] = { BUTTON A */ if (gamepad.values[ODROID_INPUT_A]) { - odroid_audio_volume_set(volume); + odroid_audio_volume_set(VOLUME); int sink = odroid_settings_AudioSink_get(); odroid_settings_AudioSink_set(sink); @@ -550,6 +683,10 @@ const uint16_t FONT_5x7[7][250] = { odroid_system_application_set(0); esp_restart(); break; + case 7: + case 8: + // do nothing + break; } debounce(ODROID_INPUT_A); } diff --git a/Components/retro-go/components/odroid/odroid_hud.h b/Components/retro-go/components/odroid/odroid_hud.h index a347f0d0..c1222ea0 100755 --- a/Components/retro-go/components/odroid/odroid_hud.h +++ b/Components/retro-go/components/odroid/odroid_hud.h @@ -48,4 +48,7 @@ void hud_menu(); */ void hud_logo(void); void hud_progress(char *string, bool bar); +void hud_bar(int x, int y, int percent, bool active); +void hud_volume(); +void hud_brightness(); void hud_options(); \ No newline at end of file diff --git a/Components/stella-odroid-go/components/odroid/odroid_hud.c b/Components/stella-odroid-go/components/odroid/odroid_hud.c index 8e87270d..cafec230 100755 --- a/Components/stella-odroid-go/components/odroid/odroid_hud.c +++ b/Components/stella-odroid-go/components/odroid/odroid_hud.c @@ -63,6 +63,12 @@ bool INIT = false; bool SAVED = false; bool forceConsoleReset; + + + int32_t VOLUME = 0; + int32_t BRIGHTNESS = 0; + const int32_t BRIGHTNESS_COUNT = 10; + const int32_t BRIGHTNESS_LEVELS[10] = {10,20,30,40,50,60,70,80,90,100}; //}#pragma endregion Globals //{#pragma region Structs @@ -79,19 +85,22 @@ int action; int offset; } STATES; - STATES WITHSAVE[6] = { + STATES WITHSAVE[5] = { {"Resume Game",0, 0}, {"Restart Game",1, 10}, {"Reload Game",2, 5}, {"Overwrite Game",4, 25}, - {"Delete Save",5, 15}, - {"Exit Game",6, 20} + {"Delete Save",5, 15} }; - STATES WITHOUTSAVE[3] = { + STATES WITHOUTSAVE[2] = { {"Resume Game",0, 0}, - {"Restart Game",1, 10}, - {"Exit Game",6, 20} + {"Restart Game",1, 10} }; + STATES EXTRAS[3] = { + {"Volume",8, 45}, + {"Brightness",9, 50}, + {"Quit Game",6, 20} + }; STATES STATE; // THEME @@ -139,43 +148,62 @@ const uint16_t FONT_5x7[7][250] = { {65535,0,0,0,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,65535,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,0,0,0,0,0,65535,65535,65535,0,65535,0,0,0,65535,65535,65535,65535,65535,65535,0,65535,65535,0,0,65535,0,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,0,65535,65535,0,0,0,65535,0,65535,65535,65535,0,65535,0,0,0,0,0,0,0,0,65535,65535,0,0,0,65535,0,65535,65535,65535,0,0,0,65535,0,0,0,65535,65535,65535,0,0,0,65535,0,0,0,65535,0,65535,0,65535,0,0,0,65535,0,0,65535,0,0,65535,65535,65535,65535,65535,0,65535,65535,65535,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,65535,65535,65535,0,0,0,0,0,65535,0,65535,65535,65535,0,0,65535,65535,65535,0,65535,0,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,0,65535,0,0,0,0,65535,0,0,0,0,65535,0,0,65535,0,0,0,0,0,0,0,65535,0,0,65535,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0}, }; - const uint16_t icons[35][5] = { - {0,65535,65535,0,0}, - {0,65535,65535,65535,0}, - {0,65535,65535,65535,65535}, - {0,65535,65535,65535,0}, - {0,65535,65535,0,0}, - {65535,0,65535,0,0}, - {65535,0,65535,65535,0}, - {65535,0,65535,65535,65535}, - {65535,0,65535,65535,0}, - {65535,0,65535,0,0}, - {0,65535,65535,0,65535}, - {65535,0,0,65535,65535}, - {65535,0,0,0,65535}, - {65535,65535,0,0,65535}, - {65535,0,65535,65535,0}, - {0,65535,65535,65535,0}, - {65535,0,65535,0,65535}, - {65535,65535,0,65535,65535}, - {65535,0,65535,0,65535}, - {0,65535,65535,65535,0}, - {65535,0,0,0,65535}, - {0,65535,0,65535,0}, - {0,0,65535,0,0}, - {0,65535,0,65535,0}, - {65535,0,0,0,65535}, - {0,0,0,0,0}, - {0,0,0,0,65535}, - {0,0,0,65535,0}, - {65535,0,65535,0,0}, - {0,65535,0,0,0}, - {0,65535,65535,65535,0}, - {65535,0,65535,0,65535}, - {65535,0,65535,65535,65535}, - {65535,0,0,0,65535}, - {0,65535,65535,65535,0}, - +const uint16_t icons[55][5] = { + {0,65535,65535,0,0}, + {0,65535,65535,65535,0}, + {0,65535,65535,65535,65535}, + {0,65535,65535,65535,0}, + {0,65535,65535,0,0}, + {65535,0,65535,0,0}, + {65535,0,65535,65535,0}, + {65535,0,65535,65535,65535}, + {65535,0,65535,65535,0}, + {65535,0,65535,0,0}, + {0,65535,65535,0,65535}, + {65535,0,0,65535,65535}, + {65535,0,0,0,65535}, + {65535,65535,0,0,65535}, + {65535,0,65535,65535,0}, + {0,65535,65535,65535,0}, + {65535,0,65535,0,65535}, + {65535,65535,0,65535,65535}, + {65535,0,65535,0,65535}, + {0,65535,65535,65535,0}, + {65535,0,0,0,65535}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {65535,0,0,0,65535}, + {0,0,0,0,0}, + {0,0,0,0,65535}, + {0,0,0,65535,0}, + {65535,0,65535,0,0}, + {0,65535,0,0,0}, + {0,65535,65535,65535,0}, + {65535,0,65535,0,65535}, + {65535,0,65535,65535,65535}, + {65535,0,0,0,65535}, + {0,65535,65535,65535,0}, + {0,65535,0,65535,0}, + {65535,65535,65535,65535,65535}, + {65535,65535,65535,65535,65535}, + {0,65535,65535,65535,0}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {65535,0,65535,0,65535}, + {65535,0,0,0,65535}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {0,0,0,65535,0}, + {0,65535,0,0,65535}, + {0,0,65535,0,65535}, + {0,65535,0,0,65535}, + {0,0,0,65535,0}, + {65535,0,0,0,65535}, + {0,0,65535,0,0}, + {0,65535,0,65535,0}, + {0,0,65535,0,0}, + {65535,0,0,0,65535}, }; const uint16_t logo[12][64] = { @@ -405,6 +433,47 @@ const uint16_t FONT_5x7[7][250] = { } } + void hud_bar(int x, int y, int percent, bool active) { + int w, h; + + int i = 0; + for(h = 0; h < 7; h++) { + for(w = 0; w < 100; w++) { + buffer[i] = (w+h)%2 == 0 ? GUI.fg : GUI.bg; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, 100, 7, buffer); + + if(percent > 0) { + i = 0; + for(h = 0; h < 7; h++) { + for(w = 0; w < percent; w++) { + buffer[i] = active ? GUI.hl : GUI.fg; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, percent, 7, buffer); + } + } + + void hud_volume() { + // y=176; + int32_t VOLUME = odroid_settings_Volume_get(); + int LIMIT = OPTIONS - 3; + bool active = OPTION == LIMIT ? true : false; + hud_bar((SCREEN.w - 120), 176, VOLUME * 12.5, active); + } + + void hud_brightness() { + // y=176; + int LIMIT = OPTIONS - 2; + bool active = OPTION == LIMIT ? true : false; + BRIGHTNESS = odroid_settings_Backlight_get(); + + hud_bar((SCREEN.w - 120), 196, (BRIGHTNESS_COUNT * BRIGHTNESS)+BRIGHTNESS+1, active); + } + void hud_options() { x = 16; y = 28; @@ -412,7 +481,7 @@ const uint16_t FONT_5x7[7][250] = { h = 5; i = 0; int n; - if(OPTIONS == 6) { + if(OPTIONS == 7) { for(n = 0; n < OPTIONS; n++) { STATE = WITHSAVE[n]; y+=20; @@ -426,7 +495,7 @@ const uint16_t FONT_5x7[7][250] = { } STATE = WITHSAVE[OPTION]; } else { - for(n = 0; n < OPTIONS; n++) { + for(n = 0; n < 2; n++) { STATE = WITHOUTSAVE[n]; y+=20; for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { @@ -439,6 +508,29 @@ const uint16_t FONT_5x7[7][250] = { } STATE = WITHOUTSAVE[OPTION]; } + + y=156; + for(n = 0; n < 3; n++) { + STATE = EXTRAS[n]; + y+=20; + for(int r = 0; r < 5; r++){for(int c = 0; c < 5; c++) { + buffer[i] = icons[r+STATE.offset][c] == WHITE ? OPTION == (n+OPTIONS-3) ? GUI.hl : GUI.fg : GUI.bg;i++; + }} + ili9341_write_frame_rectangleLE(x, y, w, h, buffer); + hud_text(x+10,y,STATE.label,false,OPTION == (n+OPTIONS-3)?true:false); + i = 0; + } + + int LIMIT = OPTIONS - 3; + if(OPTION < LIMIT) { + STATE = OPTIONS == 7 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; + } else { + STATE = EXTRAS[OPTION-LIMIT]; + } + printf("\n**********\n%s - %d:%d\n**********\n", STATE.label, OPTION, LIMIT); + + hud_volume(); + hud_brightness(); } //}#pragma endregion Display @@ -449,10 +541,10 @@ const uint16_t FONT_5x7[7][250] = { buffer = (uint16_t *)malloc(size); if (!buffer) abort(); OPTION = 0; - OPTIONS = SAVED ? 6 : 3; + OPTIONS = SAVED ? 8 : 5; hud_theme(); GUI = THEMES[USER]; - STATE = OPTIONS == 6 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; + STATE = OPTIONS == 8 ? WITHSAVE[OPTION] : WITHOUTSAVE[OPTION]; INIT = true; hud_debug("HUD - INIT"); } @@ -469,9 +561,9 @@ const uint16_t FONT_5x7[7][250] = { //{#pragma region Menu void hud_menu(void) { - int volume = odroid_audio_volume_get(); + VOLUME = odroid_audio_volume_get(); #ifdef CONFIG_LCD_DRIVER_CHIP_RETRO_ESP32 - volume = 8; + //volume = 8; #endif odroid_audio_terminate(); hud_init(); @@ -505,6 +597,50 @@ const uint16_t FONT_5x7[7][250] = { usleep(200000); //debounce(ODROID_INPUT_DOWN); } + + /* + LEFT + */ + if(gamepad.values[ODROID_INPUT_LEFT]) { + if(OPTION == OPTIONS - 3) { + if(VOLUME > 0) { + VOLUME--; + odroid_settings_Volume_set(VOLUME); + hud_options(); + usleep(200000); + } + } + if(OPTION == OPTIONS - 3 + 1) { + if(BRIGHTNESS > 0) { + BRIGHTNESS--; + odroid_settings_Backlight_set(BRIGHTNESS); + hud_options(); + usleep(200000); + } + } + } + + /* + RIGHT + */ + if(gamepad.values[ODROID_INPUT_RIGHT]) { + if(OPTION == OPTIONS - 3) { + if(VOLUME < 8) { + VOLUME++; + odroid_settings_Volume_set(VOLUME); + hud_options(); + usleep(200000); + } + } + if(OPTION == OPTIONS - 3 + 1) { + if(BRIGHTNESS < (BRIGHTNESS_COUNT-1)) { + BRIGHTNESS++; + odroid_settings_Backlight_set(BRIGHTNESS); + hud_options(); + usleep(200000); + } + } + } /* BUTTON B */ @@ -518,7 +654,7 @@ const uint16_t FONT_5x7[7][250] = { BUTTON A */ if (gamepad.values[ODROID_INPUT_A]) { - odroid_audio_volume_set(volume); + odroid_settings_Volume_set(VOLUME); hud_debug(STATE.label); ACTION = STATE.action; switch(ACTION) { diff --git a/Components/stella-odroid-go/components/odroid/odroid_hud.h b/Components/stella-odroid-go/components/odroid/odroid_hud.h index a347f0d0..c1222ea0 100755 --- a/Components/stella-odroid-go/components/odroid/odroid_hud.h +++ b/Components/stella-odroid-go/components/odroid/odroid_hud.h @@ -48,4 +48,7 @@ void hud_menu(); */ void hud_logo(void); void hud_progress(char *string, bool bar); +void hud_bar(int x, int y, int percent, bool active); +void hud_volume(); +void hud_brightness(); void hud_options(); \ No newline at end of file diff --git a/Firmware/Releases/odroid-go.zip b/Firmware/Releases/odroid-go.zip index c55989ba..6e950129 100755 Binary files a/Firmware/Releases/odroid-go.zip and b/Firmware/Releases/odroid-go.zip differ diff --git a/Firmware/Releases/odroid-go/Retro ESP32.fw b/Firmware/Releases/odroid-go/Retro ESP32.fw index 879b5929..1404ee93 100644 Binary files a/Firmware/Releases/odroid-go/Retro ESP32.fw and b/Firmware/Releases/odroid-go/Retro ESP32.fw differ diff --git a/Firmware/Releases/retro-esp.zip b/Firmware/Releases/retro-esp.zip index 9134e94a..c5f64f65 100755 Binary files a/Firmware/Releases/retro-esp.zip and b/Firmware/Releases/retro-esp.zip differ diff --git a/Firmware/Releases/retro-esp/Retro ESP32.fw b/Firmware/Releases/retro-esp/Retro ESP32.fw old mode 100755 new mode 100644 index 20e87677..c8e9feab Binary files a/Firmware/Releases/retro-esp/Retro ESP32.fw and b/Firmware/Releases/retro-esp/Retro ESP32.fw differ diff --git a/Launchers/.DS_Store b/Launchers/.DS_Store index df36c425..b95c6cbb 100755 Binary files a/Launchers/.DS_Store and b/Launchers/.DS_Store differ diff --git a/Launchers/retro-esp32/main/includes/core.h b/Launchers/retro-esp32/main/includes/core.h index ffc37dcc..26e97afb 100755 --- a/Launchers/retro-esp32/main/includes/core.h +++ b/Launchers/retro-esp32/main/includes/core.h @@ -66,6 +66,7 @@ #include "../sprites/folder.h" #include "../sprites/icons.h" #include "../sprites/logo.h" +#include "../sprites/logo3d.h" #include "../sprites/media.h" #include "../sprites/speaker.h" #include "../sprites/toggle.h" diff --git a/Launchers/retro-esp32/main/includes/definitions.h b/Launchers/retro-esp32/main/includes/definitions.h index 241cfb6f..99a56c90 100755 --- a/Launchers/retro-esp32/main/includes/definitions.h +++ b/Launchers/retro-esp32/main/includes/definitions.h @@ -42,7 +42,7 @@ /* */ -#define BUILD "Version 2 Build 4 (v.2.4)" +#define BUILD "Version 2 Build 5 (v.2.5)" #define _GNU_SOURCE diff --git a/Launchers/retro-esp32/main/main.c b/Launchers/retro-esp32/main/main.c index b86099bf..4840a280 100755 --- a/Launchers/retro-esp32/main/main.c +++ b/Launchers/retro-esp32/main/main.c @@ -2107,6 +2107,7 @@ //{#pragma region Boot Screens void splash() { draw_background(); + /* int w = 128; int h = 18; int x = (SCREEN.w/2)-(w/2); @@ -2119,6 +2120,19 @@ } } ili9341_write_frame_rectangleLE(x, y, w, h, buffer); + */ + int w = 155; + int h = 38; + int x = 96;//(SCREEN.w/2)-(w/2); + int y = (SCREEN.h/2)-(h/2); + int i = 0; + for(int r = 0; r < h; r++) { + for(int c = 0; c < w; c++) { + buffer[i] = logo3d[r][c] == 0 ? GUI.bg : logo3d[r][c]; + i++; + } + } + ili9341_write_frame_rectangleLE(x, y, w, h, buffer); /* BUILD @@ -2151,6 +2165,7 @@ } } + void restart() { draw_background(); diff --git a/Launchers/retro-esp32/main/sprites/logo3d.h b/Launchers/retro-esp32/main/sprites/logo3d.h new file mode 100644 index 00000000..f03af8d2 --- /dev/null +++ b/Launchers/retro-esp32/main/sprites/logo3d.h @@ -0,0 +1,41 @@ +const uint16_t logo3d[38][155] = { + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,65535,65535}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,0,0,65535,65535}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,0,0,0,0,65535,65535}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535,65535,65535}, + {0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,0,0,0,0,65535,65535,65535,65535,0,0,65535,65535}, + {0,0,0,0,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,0,0,0,0,65535,65535,0,0,0,0,65535,65535}, + {0,0,0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,65535,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,0,0,0,0,0,0,0,0,0,0,65535,65535}, + {0,0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,65535,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,0,0,0,0,0,0,0,0,0,0,65535,65535}, + {0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,0,0,16904,16904,16904,16904,16904,16904,65535,65535,0,0,0,0,65535,65535,0,0,0,0,65535,65535}, + {0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,65535,0,0,0,0,0,0,65535,65535,65535,0,0,0,0,0,65535,65535,0,0,0,0,0,0,65535,65535,65535,65535,0,0,0,0,0,65535,65535,65535,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,0,0,16904,16904,16904,16904,16904,16904,65535,65535,0,0,65535,65535,65535,65535,0,0,0,0,65535,65535}, + {65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,0,0,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,0,65535,0,0,65535,65535,65535,0,0,65535,65535,0,0,65535,65535,65535,0,0,65535,0,0,65535,65535,65535,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,65535,65535,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535}, + {65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,0,0,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,0,65535,0,0,65535,65535,65535,0,0,65535,65535,0,0,65535,65535,65535,0,0,65535,0,0,65535,65535,65535,0,0,65535,65535,65535,65535,65535,65535,65535,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,0,0,65535,65535,33808,33808,33808,33808,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535,65535,65535}, + {65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,65535,65535,65535,65535,65535,0,0,0,65535,65535,65535,0,0,0,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,0,0,0,0,0,65535,65535,65535,65535,0,0,0,65535,65535,65535,65535,0,0,65535,65535,65535,0,0,65535,65535,65535,65535,65535,0,0,0,65535,65535,65535,65535,65535,0,0,0,65535,65535,65535,65535,65535,65535,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,0,0,0,0,65535,65535,33808,33808,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535}, + {65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,0,65535,65535,65535,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,65535,65535,65535,65535,0,0,0,65535,65535,65535,0,65535,65535,65535,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,65535,65535,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,0,0,65535,65535,0,0,0,65535,65535,65535,65535,65535,65535,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,65535,0,0,65535,65535,65535,65535,65535,65535,65535,65535,0,0}, + {65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,65535,0,0,65535,65535,65535,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,0,65535,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,0,65535,0,0,65535,65535,65535,65535,65535,65535,65535,65535,16904,16904,16904,16904,16904,16904,65535,65535,65535,65535,0,0,0,0,0,0,0,0,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0}, + {65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,0,0,0,65535,65535,65535,0,0,0,65535,65535,65535,0,0,0,0,65535,65535,65535,0,65535,65535,65535,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,0,65535,0,0,65535,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,0,65535,0,0,65535,65535,65535,65535,65535,65535,65535,65535,16904,16904,16904,16904,16904,16904,65535,65535,0,0,0,0,65535,65535,0,0,0,0,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0}, + {0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,0,0,65535,65535,65535,0,0,0,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,0,0,0,65535,65535,65535,0,0,0,0,0,65535,65535,65535,65535,65535,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,65535,65535,65535,0,0,0,0,0,65535,65535,0,0,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,65535,65535,0,0,0,0,0,0,0,65535,65535,65535,16904,16904,16904,16904,16904,16904,65535,65535,0,0,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0}, + {0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,0,0,65535,65535,0,0,0,0,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0}, + {0,0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,65535,65535,0,0,65535,65535,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,65535,65535,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,0,0,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33808,33808,33808,33808,33808,33808,33808,33808,65535,65535,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,65535,65535,0,0,65535,65535,0,0,0,0,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,0,0,0,0,65535,65535,0,0,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,0,0,0,0,65535,65535,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,0,0,0,0,0,0,0,0,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,0,0,0,0,0,0,65535,65535,65535,65535,16904,16904,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,65535,65535,0,0,0,0,65535,65535,65535,65535,16904,16904,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,65535,65535,65535,65535,0,0,65535,65535,65535,65535,16904,16904,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,65535,65535,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16904,16904,16904,16904,16904,16904,65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + +}; \ No newline at end of file diff --git a/Launchers/retro-esp32/sdkconfig.old b/Launchers/retro-esp32/sdkconfig.old index 16d332e4..1d6df2a4 100644 --- a/Launchers/retro-esp32/sdkconfig.old +++ b/Launchers/retro-esp32/sdkconfig.old @@ -83,10 +83,10 @@ CONFIG_MONITOR_BAUD=115200 # # Retro ESP32 Configuration # -CONFIG_LCD_DRIVER_CHIP_ODROID_GO=y -CONFIG_LCD_DRIVER_CHIP_RETRO_ESP32= -CONFIG_DEFAULT_MENU_KEY=y -CONFIG_COMBO_MENU_KEY= +CONFIG_LCD_DRIVER_CHIP_ODROID_GO= +CONFIG_LCD_DRIVER_CHIP_RETRO_ESP32=y +CONFIG_DEFAULT_MENU_KEY= +CONFIG_COMBO_MENU_KEY=y # # Partition Table @@ -174,16 +174,15 @@ CONFIG_SPIRAM_IGNORE_NOTFOUND= CONFIG_SPIRAM_USE_MEMMAP= CONFIG_SPIRAM_USE_CAPS_ALLOC=y CONFIG_SPIRAM_USE_MALLOC= -CONFIG_SPIRAM_TYPE_AUTO= -CONFIG_SPIRAM_TYPE_ESPPSRAM32=y +CONFIG_SPIRAM_TYPE_AUTO=y +CONFIG_SPIRAM_TYPE_ESPPSRAM32= CONFIG_SPIRAM_TYPE_ESPPSRAM64= -CONFIG_SPIRAM_SIZE=4194304 +CONFIG_SPIRAM_SIZE=-1 CONFIG_SPIRAM_SPEED_40M= CONFIG_SPIRAM_SPEED_80M=y CONFIG_SPIRAM_MEMTEST= CONFIG_SPIRAM_CACHE_WORKAROUND= -CONFIG_SPIRAM_BANKSWITCH_ENABLE=y -CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 +CONFIG_SPIRAM_BANKSWITCH_ENABLE= CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST= CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY= CONFIG_MEMMAP_TRACEMEM= diff --git a/Tools/.DS_Store b/Tools/.DS_Store index 611d7ab4..9fdb5fb3 100755 Binary files a/Tools/.DS_Store and b/Tools/.DS_Store differ