Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Rockbox for the HiBy R3 Pro II/R1

Original author Melissa Autumn (https://codeberg.org/oopsallnaps/rockbox-hibyos) with contributions from Marc Aarts.

Adaptation to Rockbox standards by Marc Aarts

Change-Id: I09e5af7ba0a75c648e4b9fd424badc2d3665c943

authored by

Marc Aarts and committed by
Solomon Peachy
1183b1ab eee6c31b

+2858 -107
+2
.gitignore
··· 8 8 *.o 9 9 *.a 10 10 *~ 11 + .cache 12 + 11 13 __pycache__ 12 14 .DS_STORE 13 15
+2
apps/SOURCES
··· 310 310 keymaps/keymap-rgnano.c 311 311 #elif CONFIG_KEYPAD == CTRU_PAD 312 312 keymaps/keymap-ctru.c 313 + #elif CONFIG_KEYPAD == HIBY_R3PROII_PAD 314 + keymaps/keymap-hibyr3proii.c 313 315 #endif
+1 -1
apps/bitmaps/native/SOURCES
··· 46 46 hibyicon.70x70x16.bmp 47 47 rockboxicon.70x70x16.bmp 48 48 toolsicon.70x70x16.bmp 49 - #elif (defined(XDUOO_X3II) || defined(XDUOO_X20) || defined(EROS_Q) || defined(SURFANS_F28)) 49 + #elif (defined(XDUOO_X3II) || defined(XDUOO_X20) || defined(EROS_Q) || defined(SURFANS_F28) || defined(HIBY_R3PROII) || defined(HIBY_R1)) 50 50 hibyicon.130x130x16.bmp 51 51 rockboxicon.130x130x16.bmp 52 52 toolsicon.130x130x16.bmp
+1 -1
apps/debug_menu.c
··· 2842 2842 { "Screendump", dbg_screendump }, 2843 2843 #endif 2844 2844 { "Skin Engine RAM usage", dbg_skin_engine }, 2845 - #if ((CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX)) && !defined(SIMULATOR) 2845 + #if ((CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SONY_NWZ_LINUX) || (defined(HIBY_LINUX) && !defined(HIBY_R3PROII) && !defined(HIBY_R1)) || defined(FIIO_M3K_LINUX)) && !defined(SIMULATOR) 2846 2846 { "View HW info", dbg_hw_info }, 2847 2847 #endif 2848 2848 #if (CONFIG_PLATFORM & PLATFORM_NATIVE)
+5 -1
apps/features.txt
··· 20 20 backlight_brightness 21 21 #endif 22 22 23 + #if defined(HAVE_GENERAL_PURPOSE_LED) 24 + general_purpose_led 25 + #endif 26 + 23 27 #if defined(HAVE_BUTTON_LIGHT) 24 28 button_light 25 29 #endif ··· 182 186 #endif 183 187 184 188 /* This should be AUDIOHW_HAVE_FILTER_ROLL_OFF but that is only defined later */ 185 - #if defined(DX50) || defined(HAVE_DF1704_CODEC) || defined(HAVE_PCM1792_CODEC) || defined(HAVE_CS4398) || defined(HAVE_WM8740) || defined(HAVE_ES9018)|| defined(HAVE_EROS_QN_CODEC) || defined(HAVE_XDUOO_LINUX_CODEC) || defined(HAVE_FIIO_LINUX_CODEC) || defined(HAVE_AK4376) || defined(HAVE_ES9218) || defined(HAVE_SURFANS_LINUX_CODEC) 189 + #if defined(DX50) || defined(HAVE_DF1704_CODEC) || defined(HAVE_PCM1792_CODEC) || defined(HAVE_CS4398) || defined(HAVE_WM8740) || defined(HAVE_ES9018)|| defined(HAVE_EROS_QN_CODEC) || defined(HAVE_XDUOO_LINUX_CODEC) || defined(HAVE_FIIO_LINUX_CODEC) || defined(HAVE_AK4376) || defined(HAVE_ES9218) || defined(HAVE_SURFANS_LINUX_CODEC) || defined(HAVE_HIBY_LINUX_CODEC) 186 190 filter_roll_off 187 191 #endif 188 192
+233
apps/keymaps/keymap-hibyr3proii.c
··· 1 + /*************************************************************************** 2 + * __________ __ ___ 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2025 Solomon Peachy 10 + * 11 + * This program is free software; you can redistribute it and/or 12 + * modify it under the terms of the GNU General Public License 13 + * as published by the Free Software Foundation; either version 2 14 + * of the License, or (at your option) any later version. 15 + * 16 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 17 + * KIND, either express or implied. 18 + * 19 + ****************************************************************************/ 20 + 21 + #include <stdio.h> 22 + #include <string.h> 23 + #include <stdlib.h> 24 + 25 + #include "config.h" 26 + #include "action.h" 27 + #include "button.h" 28 + #include "settings.h" 29 + 30 + static const struct button_mapping button_context_standard[] = 31 + { 32 + { ACTION_STD_PREV, BUTTON_PREV, BUTTON_NONE }, 33 + { ACTION_STD_PREVREPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, 34 + { ACTION_STD_NEXT, BUTTON_NEXT, BUTTON_NONE }, 35 + { ACTION_STD_NEXTREPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, 36 + { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, 37 + { ACTION_STD_CONTEXT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, 38 + { ACTION_STD_CANCEL, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, 39 + 40 + { ACTION_STD_KEYLOCK, BUTTON_POWER|BUTTON_VOL_UP, BUTTON_POWER }, 41 + 42 + LAST_ITEM_IN_LIST 43 + }; 44 + 45 + 46 + static const struct button_mapping button_context_wps[] = 47 + { 48 + { ACTION_WPS_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, 49 + { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, 50 + { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, 51 + { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_NONE }, 52 + { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_NONE }, 53 + { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, 54 + { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, 55 + { ACTION_WPS_SKIPNEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT }, 56 + { ACTION_WPS_SKIPPREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV }, 57 + { ACTION_WPS_SEEKFWD, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, 58 + { ACTION_WPS_STOPSEEK, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT|BUTTON_REPEAT }, 59 + { ACTION_WPS_SEEKBACK, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, 60 + { ACTION_WPS_STOPSEEK, BUTTON_PREV|BUTTON_REL, BUTTON_PREV|BUTTON_REPEAT }, 61 + 62 + { ACTION_STD_KEYLOCK, BUTTON_POWER|BUTTON_VOL_UP, BUTTON_POWER }, 63 + 64 + LAST_ITEM_IN_LIST 65 + }; 66 + 67 + 68 + static const struct button_mapping button_context_list[] = 69 + { 70 + { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_NONE }, 71 + { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_NONE }, 72 + 73 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), 74 + }; 75 + 76 + 77 + static const struct button_mapping button_context_tree[] = 78 + { 79 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), 80 + }; 81 + 82 + 83 + static const struct button_mapping button_context_listtree_scroll_with_combo[] = 84 + { 85 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM | CONTEXT_TREE), 86 + }; 87 + 88 + 89 + static const struct button_mapping button_context_listtree_scroll_without_combo[] = 90 + { 91 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM | CONTEXT_TREE), 92 + }; 93 + 94 + 95 + static const struct button_mapping button_context_settings[] = 96 + { 97 + { ACTION_SETTINGS_INC, BUTTON_VOL_UP, BUTTON_NONE }, 98 + { ACTION_SETTINGS_DEC, BUTTON_VOL_DOWN, BUTTON_NONE }, 99 + 100 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), 101 + }; 102 + 103 + 104 + static const struct button_mapping button_context_settings_right_is_inc[] = 105 + { 106 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), 107 + }; 108 + 109 + 110 + static const struct button_mapping button_context_mainmenu[] = 111 + { 112 + { ACTION_TREE_WPS, BUTTON_POWER|BUTTON_REL, BUTTON_NONE }, 113 + 114 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_TREE), 115 + }; 116 + 117 + 118 + static const struct button_mapping button_context_yesno[] = 119 + { 120 + { ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE }, 121 + { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, 122 + 123 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), 124 + }; 125 + 126 + 127 + static const struct button_mapping button_context_colorchooser[] = 128 + { 129 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), 130 + }; 131 + 132 + 133 + static const struct button_mapping button_context_eq[] = 134 + { 135 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), 136 + }; 137 + 138 + 139 + static const struct button_mapping button_context_keyboard[] = 140 + { 141 + { ACTION_KBD_LEFT, BUTTON_VOL_DOWN, BUTTON_NONE }, 142 + { ACTION_KBD_RIGHT, BUTTON_VOL_UP, BUTTON_NONE }, 143 + { ACTION_KBD_CURSOR_LEFT, BUTTON_PLAY | BUTTON_VOL_DOWN, BUTTON_NONE }, 144 + { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLAY | BUTTON_VOL_UP, BUTTON_NONE }, 145 + { ACTION_KBD_DONE, BUTTON_PLAY | BUTTON_REPEAT, BUTTON_NONE }, 146 + { ACTION_KBD_SELECT, BUTTON_PLAY | BUTTON_REL, BUTTON_NONE }, 147 + { ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE }, 148 + { ACTION_KBD_UP, BUTTON_NEXT, BUTTON_NONE }, 149 + { ACTION_KBD_UP, BUTTON_NEXT | BUTTON_REPEAT, BUTTON_NONE }, 150 + { ACTION_KBD_DOWN, BUTTON_PREV, BUTTON_NONE }, 151 + { ACTION_KBD_DOWN, BUTTON_PREV | BUTTON_REPEAT, BUTTON_NONE }, 152 + 153 + LAST_ITEM_IN_LIST 154 + }; 155 + 156 + 157 + 158 + static const struct button_mapping button_context_bmark[] = 159 + { 160 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), 161 + }; 162 + 163 + 164 + static const struct button_mapping button_context_time[] = 165 + { 166 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), 167 + }; 168 + 169 + 170 + static const struct button_mapping button_context_quickscreen[] = 171 + { 172 + { ACTION_QS_TOP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_NONE }, 173 + { ACTION_QS_TOP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, 174 + { ACTION_QS_DOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_NONE }, 175 + { ACTION_QS_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, 176 + { ACTION_QS_LEFT, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE }, 177 + { ACTION_QS_LEFT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, 178 + { ACTION_QS_RIGHT, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE }, 179 + { ACTION_QS_RIGHT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, 180 + 181 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) 182 + }; 183 + 184 + 185 + static const struct button_mapping button_context_pitchscreen[] = 186 + { 187 + { ACTION_PS_INC_SMALL, BUTTON_VOL_UP, BUTTON_NONE }, 188 + { ACTION_PS_DEC_SMALL, BUTTON_VOL_DOWN, BUTTON_NONE }, 189 + { ACTION_PS_EXIT, BUTTON_POWER, BUTTON_NONE }, 190 + 191 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) 192 + }; 193 + 194 + 195 + static const struct button_mapping button_context_radio[] = 196 + { 197 + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) 198 + }; 199 + 200 + 201 + const struct button_mapping* target_get_context_mapping(int context) 202 + { 203 + switch (context & ~CONTEXT_LOCKED) 204 + { 205 + case CONTEXT_STD: { return button_context_standard; } 206 + case CONTEXT_WPS: { return button_context_wps; } 207 + case CONTEXT_LIST: { return button_context_list; } 208 + case CONTEXT_MAINMENU: { return button_context_mainmenu; } 209 + case CONTEXT_CUSTOM | CONTEXT_TREE: { return button_context_tree; } 210 + case CONTEXT_SETTINGS: { return button_context_settings; } 211 + case CONTEXT_SETTINGS_COLOURCHOOSER: { return button_context_colorchooser; } 212 + case CONTEXT_SETTINGS_EQ: { return button_context_eq; } 213 + case CONTEXT_SETTINGS_TIME: { return button_context_time; } 214 + case CONTEXT_YESNOSCREEN: { return button_context_yesno; } 215 + case CONTEXT_KEYBOARD: { return button_context_keyboard; } 216 + case CONTEXT_FM: { return button_context_radio; } 217 + case CONTEXT_BOOKMARKSCREEN: { return button_context_bmark; } 218 + case CONTEXT_QUICKSCREEN: { return button_context_quickscreen; } 219 + case CONTEXT_PITCHSCREEN: { return button_context_pitchscreen; } 220 + case CONTEXT_CUSTOM | CONTEXT_SETTINGS: 221 + case CONTEXT_SETTINGS_RECTRIGGER: { return button_context_settings_right_is_inc; } 222 + case CONTEXT_TREE: 223 + { 224 + if(global_settings.hold_lr_for_scroll_in_list) 225 + { 226 + return button_context_listtree_scroll_without_combo; 227 + } 228 + return button_context_listtree_scroll_with_combo; 229 + } 230 + } 231 + 232 + return button_context_standard; 233 + }
+17
apps/lang/english.lang
··· 16998 16998 *: "sort playlists" 16999 16999 </voice> 17000 17000 </phrase> 17001 + <phrase> 17002 + id: LANG_USE_LED_INDICATORS 17003 + desc: LED indicators setting 17004 + user: core 17005 + <source> 17006 + *: none 17007 + general_purpose_led: "Use LED indicators" 17008 + </source> 17009 + <dest> 17010 + *: none 17011 + general_purpose_led: "Use LED indicators" 17012 + </dest> 17013 + <voice> 17014 + *: none 17015 + general_purpose_led: "Use LED indicators" 17016 + </voice> 17017 + </phrase>
+8 -2
apps/menus/settings_menu.c
··· 272 272 #if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR)) 273 273 MENUITEM_SETTING(usb_mode, &global_settings.usb_mode, NULL); 274 274 #endif 275 + #if defined(HAVE_GENERAL_PURPOSE_LED) 276 + MENUITEM_SETTING(use_led_indicators, &global_settings.use_led_indicators, NULL); 277 + #endif 275 278 /* Disk */ 276 279 #ifdef HAVE_DISK_STORAGE 277 280 MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL); ··· 395 398 &global_settings.bt_selective_softlock_actions, 396 399 selectivesoftlock_callback); 397 400 MENUITEM_FUNCTION(sel_softlock_mask, 0, ID2P(LANG_SETTINGS), 398 - selectivesoftlock_set_mask, selectivesoftlock_callback, 399 - Icon_Menu_setting); 401 + selectivesoftlock_set_mask, selectivesoftlock_callback, 402 + Icon_Menu_setting); 400 403 401 404 MAKE_MENU(sel_softlock, ID2P(LANG_SOFTLOCK_SELECTIVE), 402 405 NULL, Icon_Menu_setting, &bt_selective_actions, &sel_softlock_mask); ··· 469 472 #endif 470 473 #if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR)) 471 474 &usb_mode, 475 + #endif 476 + #if defined(HAVE_GENERAL_PURPOSE_LED) 477 + &use_led_indicators, 472 478 #endif 473 479 ); 474 480
+1 -1
apps/plugins/SOURCES.app_build
··· 1 - #if !defined(HAVE_TOUCHSCREEN) || defined(DX50) || defined(DX90) 1 + #if !defined(HAVE_TOUCHSCREEN) || defined(DX50) || defined(DX90) || defined(HIBY_R3PROII) || defined(HIBY_R1) 2 2 /* In devices running RockBox as an application, but having a keypad */ 3 3 #include "SOURCES" 4 4 #else
+1 -1
apps/plugins/SUBDIRS.app_build
··· 1 - #if !defined(HAVE_TOUCHSCREEN) || defined(DX50) || defined(DX90) 1 + #if !defined(HAVE_TOUCHSCREEN) || defined(DX50) || defined(DX90) || defined(HIBY_R3PROII) || defined(HIBY_R1) 2 2 /* This is for devices having a keypad, running RockBox as an application */ 3 3 #include "SUBDIRS" 4 4
+1 -1
apps/plugins/battery_bench.c
··· 250 250 #define BATTERY_ON_TXT "Play" 251 251 #define BATTERY_OFF_TXT "Power" 252 252 253 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 253 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 254 254 /* use touchscreen */ 255 255 256 256 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/bitmaps/mono/SOURCES
··· 24 24 ((LCD_WIDTH == 360) && (LCD_HEIGHT == 400)) 25 25 bubbles_bubble.320x240x1.bmp 26 26 #elif ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \ 27 - ((LCD_WIDTH == 480) && (LCD_HEIGHT == 640)) 27 + ((LCD_WIDTH == 480) && (LCD_HEIGHT >= 640)) 28 28 bubbles_bubble.640x480x1.bmp 29 29 #endif 30 30
+8 -6
apps/plugins/bitmaps/native/SOURCES
··· 436 436 invadrox_ufo.16x7x16.bmp 437 437 invadrox_ufo_explode.21x8x16.bmp 438 438 invadrox_numbers.50x7x16.bmp 439 - #if LCD_WIDTH == 360 && LCD_HEIGHT == 400 439 + #if LCD_WIDTH == 480 440 + invadrox_background.480x640x16.bmp 441 + #elif LCD_WIDTH == 360 && LCD_HEIGHT == 400 440 442 invadrox_background.360x400x16.bmp 441 443 #elif LCD_WIDTH == 320 442 444 invadrox_background.320x240x16.bmp ··· 513 515 jewels.320x240x16.bmp 514 516 #elif (LCD_WIDTH == 360) && (LCD_HEIGHT == 400) 515 517 jewels.360x400x16.bmp 516 - #elif ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \ 517 - ((LCD_WIDTH == 480) && (LCD_HEIGHT == 640)) 518 + #elif ((LCD_WIDTH >= 480) && (LCD_HEIGHT >= 640)) || \ 519 + ((LCD_WIDTH >= 640) && (LCD_HEIGHT >= 480)) 518 520 jewels.640x480x16.bmp 519 521 #endif 520 522 ··· 947 949 ((LCD_WIDTH == 240) && (LCD_HEIGHT == 400)) || \ 948 950 ((LCD_WIDTH == 360) && (LCD_HEIGHT == 400)) 949 951 superdom_boarditems.240x320x16.bmp 950 - #elif (LCD_WIDTH == 480 && LCD_HEIGHT == 640) 952 + #elif (LCD_WIDTH >= 480 && LCD_HEIGHT >= 640) 951 953 superdom_boarditems.480x640x16.bmp 952 - #elif (LCD_WIDTH == 640 && LCD_HEIGHT == 480) 954 + #elif (LCD_WIDTH >= 640 && LCD_HEIGHT >= 480) 953 955 superdom_boarditems.640x480x16.bmp 954 956 #endif 955 957 #endif ··· 984 986 sliding_puzzle.240x240x16.bmp 985 987 #elif SMALLER_DIMENSION <= 360 986 988 sliding_puzzle.360x360x16.bmp 987 - #elif SMALLER_DIMENSION <= 480 989 + #else 988 990 sliding_puzzle.480x480x16.bmp 989 991 #endif 990 992 #elif (LCD_DEPTH > 1)
+1 -1
apps/plugins/blackjack.c
··· 608 608 #define BJACK_LEFT BUTTON_LEFT 609 609 610 610 611 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 611 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 612 612 #define BJACK_QUIT BUTTON_POWER 613 613 #define BJACK_QUIT_NAME "QUIT" 614 614
+1 -1
apps/plugins/brickmania.c
··· 362 362 #define UP BUTTON_UP 363 363 #define DOWN BUTTON_DOWN 364 364 365 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 365 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 366 366 #define QUIT BUTTON_POWER 367 367 368 368 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/bubbles.c
··· 135 135 #define NEXT_BB_WIDTH 32 136 136 #define NEXT_BB_Y 402 137 137 138 - #elif (LCD_WIDTH == 480) && (LCD_HEIGHT == 640) 138 + #elif (LCD_WIDTH == 480) && (LCD_HEIGHT >= 640) 139 139 #define XOFS 128 140 140 #define MAX_FPS 40 141 141
+1 -1
apps/plugins/calculator.c
··· 533 533 #define CALCULATOR_CALC BUTTON_MENU 534 534 #define CALCULATOR_CLEAR BUTTON_BACK 535 535 536 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 536 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 537 537 #define CALCULATOR_QUIT BUTTON_POWER 538 538 539 539 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/calendar.c
··· 419 419 #define CALENDAR_NEXT_MONTH BUTTON_VOL_UP 420 420 #define CALENDAR_PREV_MONTH BUTTON_VOL_DOWN 421 421 422 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 422 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 423 423 /* use touchscreen */ 424 424 425 425 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/chessbox/chessbox_pgn.h
··· 581 581 #define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT) 582 582 #define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT) 583 583 584 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 584 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 585 585 /* use touchscreen */ 586 586 587 587 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/chessclock.c
··· 395 395 #define CHC_SETTINGS_OK BUTTON_SELECT 396 396 #define CHC_SETTINGS_CANCEL BUTTON_POWER 397 397 398 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 398 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 399 399 #define CHC_QUIT BUTTON_POWER 400 400 401 401 #elif (CONFIG_KEYPAD == MA_PAD)
+1 -1
apps/plugins/chip8.c
··· 1312 1312 #define CHIP8_KEY9 BUTTON_R 1313 1313 #define CHIP8_KEY0 BUTTON_L 1314 1314 1315 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 1315 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 1316 1316 /* use touchscreen */ 1317 1317 1318 1318 #else
+1 -1
apps/plugins/clix.c
··· 314 314 #define CLIX_BUTTON_RIGHT BUTTON_RIGHT 315 315 #define CLIX_BUTTON_CLICK BUTTON_SELECT 316 316 317 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 317 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 318 318 #define CLIX_BUTTON_QUIT BUTTON_POWER 319 319 320 320 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/cube.c
··· 402 402 #define CUBE_PAUSE BUTTON_PLAY 403 403 #define CUBE_HIGHSPEED BUTTON_BACK 404 404 405 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 405 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 406 406 /* use touchscreen */ 407 407 408 408 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/doom/i_video.c
··· 629 629 #define DOOMBUTTON_WEAPON BUTTON_BACK 630 630 #define DOOMBUTTON_MAP (BUTTON_BACK|BUTTON_REPEAT) 631 631 632 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 632 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 633 633 #define DOOMBUTTON_ESC BUTTON_POWER 634 634 #define DOOMBUTTON_MAP BUTTON_PREV 635 635
+1 -1
apps/plugins/flipit.c
··· 494 494 #define FLIPIT_STEP_BY_STEP BUTTON_VOL_UP 495 495 #define FLIPIT_TOGGLE BUTTON_SELECT 496 496 497 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 497 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 498 498 /* use touchscreen */ 499 499 500 500 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/fractals/fractal.h
··· 504 504 #define FRACTAL_PRECISION_DEC BUTTON_BACK 505 505 #define FRACTAL_RESET BUTTON_PLAY 506 506 507 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 507 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 508 508 #define FRACTAL_QUIT BUTTON_POWER 509 509 510 510 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/imageviewer/imageviewer_button.h
··· 557 557 #define IMGVIEW_MENU (BUTTON_PLAY|BUTTON_REPEAT) 558 558 #define IMGVIEW_SLIDE_SHOW BUTTON_PLAY 559 559 560 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 560 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 561 561 /* use touchscreen */ 562 562 563 563 #elif CONFIG_KEYPAD == RG_NANO_PAD
+2 -2
apps/plugins/invadrox.c
··· 288 288 #define RIGHT BUTTON_RIGHT 289 289 #define FIRE BUTTON_SELECT 290 290 291 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 291 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 292 292 /* use touchscreen */ 293 293 294 294 #elif CONFIG_KEYPAD == MA_PAD ··· 369 369 370 370 /* m:robe 500 defines */ 371 371 #if ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \ 372 - ((LCD_WIDTH == 480) && (LCD_HEIGHT == 640)) 372 + ((LCD_WIDTH == 480) && (LCD_HEIGHT >= 640)) 373 373 374 374 /* Original arcade game size 224x240, 1bpp with 375 375 * red overlay at top and green overlay at bottom.
+1 -1
apps/plugins/jewels.c
··· 377 377 #define HK_SELECT "SELECT" 378 378 #define HK_CANCEL "BACK" 379 379 380 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 380 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 381 381 /* use touchscreen */ 382 382 383 383 #elif CONFIG_KEYPAD == MA_PAD
+3 -2
apps/plugins/lib/keymaps.h
··· 255 255 #define BTN_FIRE BUTTON_SELECT 256 256 #define BTN_PAUSE BUTTON_POWER 257 257 258 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 258 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 259 259 #define BTN_FIRE BUTTON_CENTER 260 260 #define BTN_PAUSE BUTTON_POWER 261 261 #define BTN_HAVE_DIAGONAL ··· 298 298 (CONFIG_KEYPAD != DX50_PAD) && \ 299 299 (CONFIG_KEYPAD != ONDAVX777_PAD) && \ 300 300 (CONFIG_KEYPAD != CREATIVE_ZENXFI2_PAD) && \ 301 - (CONFIG_KEYPAD != SHANLING_Q1_PAD) 301 + (CONFIG_KEYPAD != SHANLING_Q1_PAD) && \ 302 + (CONFIG_KEYPAD != HIBY_R3PROII_PAD) 302 303 #define BTN_FIRE BUTTON_BOTTOMLEFT 303 304 #define BTN_PAUSE BUTTON_TOPLEFT 304 305 #endif
+1 -1
apps/plugins/lib/pluginlib_actions.c
··· 517 517 {PLA_SELECT, BUTTON_SELECT, BUTTON_NONE}, 518 518 {PLA_SELECT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT}, 519 519 {PLA_SELECT_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE}, 520 - #elif (CONFIG_KEYPAD == SHANLING_Q1_PAD) 520 + #elif (CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD) 521 521 {PLA_EXIT, BUTTON_POWER, BUTTON_NONE}, 522 522 #elif (CONFIG_KEYPAD == MA_PAD) 523 523 {PLA_CANCEL, BUTTON_BACK|BUTTON_REL, BUTTON_BACK},
+1 -1
apps/plugins/midi/midiplay.c
··· 325 325 #define MIDI_VOL_DOWN BUTTON_VOL_DOWN 326 326 #define MIDI_PLAYPAUSE BUTTON_PLAY 327 327 328 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 328 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 329 329 /* use touchscreen */ 330 330 331 331 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/minesweeper.c
··· 452 452 # define MINESWP_DISCOVER (BUTTON_MENU|BUTTON_REPEAT) 453 453 # define MINESWP_INFO BUTTON_MENU 454 454 455 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 455 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 456 456 /* use touchscreen */ 457 457 458 458 #elif CONFIG_KEYPAD == RG_NANO_PAD
+1 -1
apps/plugins/mp3_encoder.c
··· 2583 2583 #define MP3ENC_DONE BUTTON_POWER 2584 2584 #define MP3ENC_SELECT BUTTON_SELECT 2585 2585 2586 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 2586 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 2587 2587 /* use touchscreen */ 2588 2588 2589 2589 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/mpegplayer/mpeg_settings.c
··· 362 362 #define MPEG_START_TIME_DOWN BUTTON_DOWN 363 363 #define MPEG_START_TIME_EXIT BUTTON_BACK 364 364 365 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 365 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 366 366 #define MPEG_START_TIME_EXIT BUTTON_POWER 367 367 368 368 #elif CONFIG_KEYPAD == RG_NANO_PAD
+1 -1
apps/plugins/mpegplayer/mpegplayer.c
··· 495 495 #define MPEG_RW BUTTON_LEFT 496 496 #define MPEG_FF BUTTON_RIGHT 497 497 498 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 498 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 499 499 /* use touchscreen */ 500 500 501 501 #elif CONFIG_KEYPAD == RG_NANO_PAD
+1 -1
apps/plugins/oscilloscope.c
··· 564 564 #define OSCILLOSCOPE_VOL_UP BUTTON_UP 565 565 #define OSCILLOSCOPE_VOL_DOWN BUTTON_DOWN 566 566 567 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 567 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 568 568 /* use touchscreen */ 569 569 570 570 #elif CONFIG_KEYPAD == RG_NANO_PAD
+1 -1
apps/plugins/pacbox/pacbox.h
··· 398 398 #define PACMAN_1UP BUTTON_VOL_UP 399 399 #define PACMAN_COIN BUTTON_PLAY 400 400 401 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 401 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 402 402 #define PACMAN_UP BUTTON_TOPMIDDLE 403 403 #define PACMAN_DOWN BUTTON_BOTTOMMIDDLE 404 404 #define PACMAN_LEFT BUTTON_MIDLEFT
+1 -1
apps/plugins/pegbox.c
··· 728 728 #define LVL_UP_TEXT "UP+MENU" 729 729 #define LVL_DOWN_TEXT "DOWN+MENU" 730 730 731 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 731 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 732 732 /* use touchscreen */ 733 733 734 734 #elif CONFIG_KEYPAD == RG_NANO_PAD
+1 -1
apps/plugins/pong.c
··· 325 325 #define PONG_RIGHT_UP BUTTON_BACK 326 326 #define PONG_RIGHT_DOWN BUTTON_RIGHT 327 327 328 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 328 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 329 329 /* use touchscreen */ 330 330 331 331 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/reversi/reversi-gui.h
··· 361 361 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT 362 362 #define REVERSI_BUTTON_MENU BUTTON_MENU 363 363 364 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 364 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 365 365 /* use touchscreen */ 366 366 367 367 #elif (CONFIG_KEYPAD == MA_PAD)
+2 -2
apps/plugins/rockblox.c
··· 468 468 #define ROCKBLOX_RESTART BUTTON_BACK 469 469 #define ROCKBLOX_SCROLL_ENABLED 1 470 470 471 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 471 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 472 472 /* use touchscreen */ 473 473 474 474 #elif CONFIG_KEYPAD == MA_PAD ··· 549 549 #define LEVEL_Y 140 550 550 #define LINES_Y 210 551 551 552 - #elif (LCD_WIDTH == 480) && (LCD_HEIGHT == 640) 552 + #elif (LCD_WIDTH == 480) && (LCD_HEIGHT >= 640) 553 553 554 554 #define BLOCK_WIDTH 30 555 555 #define BLOCK_HEIGHT 30
+1 -1
apps/plugins/rockboy/rockboy.c
··· 468 468 options.SELECT = BUTTON_VOL_UP; 469 469 options.MENU = BUTTON_POWER; 470 470 471 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 471 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 472 472 /* use touchscreen */ 473 473 474 474 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/rockpaint.c
··· 404 404 #define ROCKPAINT_LEFT BUTTON_LEFT 405 405 #define ROCKPAINT_RIGHT BUTTON_RIGHT 406 406 407 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 407 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 408 408 /* use touchscreen */ 409 409 410 410 #elif CONFIG_KEYPAD == EROSQ_PAD
+1 -1
apps/plugins/sliding_puzzle.c
··· 357 357 #define PUZZLE_SHUFFLE BUTTON_BACK 358 358 #define PUZZLE_PICTURE BUTTON_PLAY 359 359 360 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 360 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 361 361 /* use touchscreen */ 362 362 363 363 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/snake.c
··· 313 313 #define SNAKE_DOWN BUTTON_DOWN 314 314 #define SNAKE_PLAYPAUSE BUTTON_PLAY 315 315 316 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 316 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 317 317 /* use touchscreen */ 318 318 319 319 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/snake2.c
··· 458 458 #define SNAKE2_PLAYPAUSE BUTTON_PLAY 459 459 #define SNAKE2_PLAYPAUSE_TEXT "PLAY" 460 460 461 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 461 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 462 462 /* use touchscreen */ 463 463 464 464 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/sokoban.c
··· 696 696 #define BUTTON_SAVE BUTTON_BACK 697 697 #define BUTTON_SAVE_NAME "BACK" 698 698 699 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 699 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 700 700 /* use touchscreen */ 701 701 702 702 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/solitaire.c
··· 741 741 # define HK_CUR2STACK "HOLD SELECT" 742 742 # define HK_REM2STACK "VOL+" 743 743 744 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 744 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 745 745 # define SOL_QUIT BUTTON_POWER 746 746 747 747 #elif CONFIG_KEYPAD == RG_NANO_PAD
+1 -1
apps/plugins/spacerocks.c
··· 372 372 #define AST_RIGHT BUTTON_RIGHT 373 373 #define AST_FIRE BUTTON_PLAY 374 374 375 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 375 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 376 376 /* use touchscreen */ 377 377 378 378 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/star.c
··· 668 668 #define STAR_LEVEL_DOWN_NAME "VOL-" 669 669 #define STAR_LEVEL_REPEAT_NAME "BACK" 670 670 671 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 671 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 672 672 #define STAR_QUIT BUTTON_POWER 673 673 #define STAR_QUIT_NAME "POWER" 674 674
+1 -1
apps/plugins/sudoku/sudoku.h
··· 469 469 #define SUDOKU_BUTTON_TOGGLE BUTTON_PLAY 470 470 #define SUDOKU_BUTTON_POSSIBLE BUTTON_BACK 471 471 472 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 472 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 473 473 /* use touchscreen */ 474 474 475 475 #elif CONFIG_KEYPAD == RG_NANO_PAD
+1 -1
apps/plugins/test_touchscreen.c
··· 37 37 #elif CONFIG_KEYPAD == CREATIVE_ZENXFI2_PAD 38 38 #define TOUCHSCREEN_QUIT BUTTON_POWER 39 39 #define TOUCHSCREEN_TOGGLE BUTTON_MENU 40 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 40 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 41 41 #define TOUCHSCREEN_QUIT BUTTON_POWER 42 42 #define TOUCHSCREEN_TOGGLE BUTTON_PLAY 43 43 #elif (CONFIG_KEYPAD == ANDROID_PAD)
+1 -1
apps/plugins/text_viewer/tv_button.h
··· 572 572 #define TV_LINE_DOWN BUTTON_SCROLL_FWD 573 573 #define TV_BOOKMARK BUTTON_PLAY 574 574 575 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 575 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 576 576 #define TV_BOOKMARK BUTTON_PLAY 577 577 578 578 #elif CONFIG_KEYPAD == MA_PAD
+1 -1
apps/plugins/vu_meter.c
··· 454 454 #define LABEL_MENU "MENU" 455 455 #define LABEL_VOLUME "VOL+/VOL-" 456 456 457 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 457 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 458 458 /* use touchscreen */ 459 459 460 460 #elif CONFIG_KEYPAD == MA_PAD
+2 -2
apps/plugins/wormlet.c
··· 407 407 #define BTN_QUIT BUTTON_POWER 408 408 #define BTN_STOPRESET BUTTON_BACK 409 409 410 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 410 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 411 411 /* use touchscreen */ 412 412 413 413 #elif CONFIG_KEYPAD == MA_PAD ··· 522 522 #define SPEED 4 523 523 #define MAX_WORM_SEGMENTS 512 524 524 #elif ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \ 525 - ((LCD_WIDTH == 480) && (LCD_HEIGHT == 640)) 525 + ((LCD_WIDTH == 480) && (LCD_HEIGHT >= 640)) 526 526 #define FOOD_SIZE 14 527 527 #define ARGH_SIZE 16 528 528 #define SPEED 4
+1 -1
apps/plugins/xobox.c
··· 360 360 #define DOWN BUTTON_DOWN 361 361 #define PAUSE BUTTON_PLAY 362 362 363 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 363 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 364 364 /* use touchscreen */ 365 365 366 366 #elif CONFIG_KEYPAD == RG_NANO_PAD
+1 -1
apps/plugins/zxbox/keymaps.h
··· 290 290 #define ZX_UP BUTTON_UP 291 291 #define ZX_DOWN BUTTON_DOWN 292 292 293 - #elif CONFIG_KEYPAD == SHANLING_Q1_PAD 293 + #elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD 294 294 /* use touchscreen */ 295 295 296 296 #elif CONFIG_KEYPAD == MA_PAD
+8 -1
apps/settings.c
··· 75 75 #include "statusbar-skinned.h" 76 76 #include "bootchart.h" 77 77 #include "scroll_engine.h" 78 + #ifdef HAVE_GENERAL_PURPOSE_LED 79 + #include "led-general-purpose.h" 80 + #endif 78 81 79 82 #ifndef __PCTOOL__ 80 83 struct user_settings global_settings; ··· 1093 1096 1094 1097 #if defined(DX50) || defined(DX90) 1095 1098 ibasso_set_usb_mode(global_settings.usb_mode); 1099 + #elif (defined(HIBY_R3PROII) || defined(HIBY_R1)) && !defined(SIMULATOR) 1100 + hiby_set_usb_mode(global_settings.usb_mode); 1096 1101 #elif defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR) 1097 1102 usb_set_mode(global_settings.usb_mode); 1098 1103 #endif 1099 - 1104 + #if defined(HAVE_GENERAL_PURPOSE_LED) 1105 + led_hw_on(); 1106 + #endif 1100 1107 #if defined(DX50) || defined(DX90) 1101 1108 ibasso_set_governor(global_settings.governor); 1102 1109 #endif
+3
apps/settings.h
··· 935 935 int hp_lo_select; /* indicates automatic, headphone-only, or lineout-only operation */ 936 936 #endif 937 937 bool playback_log; /* ROCKBOX_DIR/playback.log for tracks played */ 938 + #if defined(HAVE_GENERAL_PURPOSE_LED) 939 + bool use_led_indicators; 940 + #endif 938 941 }; 939 942 940 943 /* global settings */
+10 -3
apps/settings_list.c
··· 2399 2399 USBMODE_DEFAULT, 2400 2400 "usb mode", 2401 2401 "mass storage,charge" 2402 - #if defined(DX50) || defined(DX90) 2402 + #if defined(DX50) || defined(DX90) || defined(HIBY_R3PROII) || defined(HIBY_R1) 2403 2403 ",adb" 2404 2404 #endif 2405 2405 , ··· 2408 2408 3, 2409 2409 #else 2410 2410 usb_set_mode, 2411 + #if defined(HIBY_R3PROII) || defined(HIBY_R1) 2412 + 3, 2413 + #else 2411 2414 2, 2415 + #endif 2412 2416 #endif 2413 2417 ID2P(LANG_USB_MODE_MASS_STORAGE), 2414 2418 ID2P(LANG_USB_MODE_CHARGE) 2415 - #if defined(DX50) || defined(DX90) 2419 + #if defined(DX50) || defined(DX90) || defined(HIBY_R3PROII) || defined(HIBY_R1) 2416 2420 ,ID2P(LANG_USB_MODE_ADB) 2417 2421 #endif 2418 - ), 2422 + ), 2419 2423 #endif 2420 2424 #if defined(BUTTON_REC) || \ 2421 2425 (CONFIG_KEYPAD == GIGABEAT_PAD) || \ ··· 2430 2434 ID2P(LANG_AUTO), ID2P(LANG_HEADPHONE), ID2P(LANG_LINEOUT)), 2431 2435 #endif 2432 2436 OFFON_SETTING(0, playback_log, LANG_LOGGING, false, "play log", NULL), 2437 + #if defined(HAVE_GENERAL_PURPOSE_LED) 2438 + OFFON_SETTING(0, use_led_indicators, LANG_USE_LED_INDICATORS, false, "LED indicators", NULL), 2439 + #endif 2433 2440 }; 2434 2441 2435 2442 const int nb_settings = sizeof(settings)/sizeof(*settings);
backdrops/cabbiev2.480x720x16.bmp

This is a binary file and will not be displayed.

+56 -4
bootloader/hibyos_linux.c
··· 47 47 #include <stdarg.h> 48 48 #include "version.h" 49 49 50 + //#define ENABLE_LOGGING 51 + //#define AUTO_ENABLE_ADB 52 + 50 53 /* Basic configuration */ 51 54 #if defined(AGPTEK_ROCKER) 52 55 #define ICON_WIDTH 70 ··· 101 104 #define BUTTON_LEFT BUTTON_SCROLL_BACK 102 105 #define BUTTON_RIGHT BUTTON_SCROLL_FWD 103 106 #include "bitmaps/hibyicon.h" 107 + #elif defined(HIBY_R3PROII) 108 + #define ICON_WIDTH 130 109 + #define ICON_HEIGHT 130 110 + #define ICON_NAME bm_hibyicon 111 + #define OF_NAME "HIBY PLAYER" 112 + #define BUTTON_UP BUTTON_PREV 113 + #define BUTTON_DOWN BUTTON_NEXT 114 + #define BUTTON_SELECT BUTTON_PLAY 115 + #define BUTTON_LEFT BUTTON_VOL_DOWN 116 + #define BUTTON_RIGHT BUTTON_VOL_UP 117 + #include "bitmaps/hibyicon.h" 118 + #elif defined(HIBY_R1) 119 + #define ICON_WIDTH 130 120 + #define ICON_HEIGHT 130 121 + #define ICON_NAME bm_hibyicon 122 + #define OF_NAME "HIBY PLAYER" 123 + #define BUTTON_UP BUTTON_PREV 124 + #define BUTTON_DOWN BUTTON_NEXT 125 + #define BUTTON_SELECT BUTTON_PLAY 126 + #define BUTTON_LEFT BUTTON_VOL_DOWN 127 + #define BUTTON_RIGHT BUTTON_VOL_UP 128 + #include "bitmaps/hibyicon.h" 104 129 #else 105 130 #error "must define ICON_WIDTH/HEIGHT" 106 131 #endif ··· 254 279 while(true) 255 280 { 256 281 /* on usb detect, immediately boot with last choice */ 282 + #if !defined(HIBY_R3PROII) && !defined(HIBY_R1) 257 283 if(!adb_running && power_input_status() & POWER_INPUT_USB_CHARGER) 258 284 { 259 285 /* save last choice */ 260 286 save_boot_mode(mode); 261 287 return mode; 262 288 } 289 + #endif 263 290 /* inactivity detection */ 264 291 int timeout = last_activity + get_inactivity_tmo(init_mode == mode); 265 292 if(TIME_AFTER(current_tick, timeout)) ··· 499 526 pid_t pid = fork(); 500 527 if(pid == 0) 501 528 { 529 + #if defined(HIBY_R3PROII) || defined(HIBY_R1) 530 + execlp("/etc/init.d/T90adb", "T90adb", start ? "start" : "stop", NULL); 531 + #else 502 532 execlp("/etc/init.d/K90adb", "K90adb", start ? "start" : "stop", NULL); 533 + #endif 503 534 _exit(42); 504 535 } 505 536 int status; ··· 572 603 } 573 604 } 574 605 575 - #if 0 606 + #ifdef ENABLE_LOGGING 576 607 /* open log file */ 577 608 static int open_log(void) 578 609 { ··· 597 628 { 598 629 (void) argc; 599 630 (void) argv; 600 - #if 0 631 + 632 + #ifdef AUTO_ENABLE_ADB 633 + // Boot with adb for debugging 634 + adb(1); 635 + #endif 636 + 637 + #ifdef ENABLE_LOGGING 601 638 /* redirect stdout and stderr to have error messages logged somewhere on the 602 639 * user partition */ 603 640 int fd = open_log(); ··· 611 648 printf("Rockbox boot loader\n"); 612 649 printf("Version: %s\n", rbversion); 613 650 printf("%s\n", MODEL_NAME); 614 - #endif 651 + #endif 615 652 616 653 system_init(); 617 654 core_allocator_init(); ··· 635 672 enum boot_mode mode = get_boot_mode(); 636 673 if (mode == BOOT_OF) 637 674 { 638 - #if 0 675 + #ifdef ENABLE_LOGGING 639 676 fflush(stdout); 640 677 fflush(stderr); 641 678 close(fileno(stdout)); ··· 657 694 } 658 695 else if(mode == BOOT_ROCKBOX) 659 696 { 697 + #if defined(HIBY_R3PROII) || defined(HIBY_R1) 698 + /* Suspend bluetooth as it's not currently supported */ 699 + system("/usr/bin/bt_suspend"); 700 + #endif 660 701 fflush(stdout); 661 702 mount_storage(true); 662 703 system("/bin/cp " BASE_DIR "/.rockbox/" BOOTFILE " /tmp"); 663 704 system("/bin/chmod +x /tmp/" BOOTFILE); 705 + #ifdef HIBY_R1 706 + /* Load libasound from Rockbox directory */ 707 + char *argvr1[] = { "/tmp/" BOOTFILE, 0 }; 708 + char *envpr1[] = 709 + { 710 + "LD_LIBRARY_PATH=/data/mnt/sd_0/.rockbox", 711 + 0 712 + }; 713 + execve(argvr1[0], &argvr1[0], envpr1); 714 + #else 664 715 execl("/tmp/" BOOTFILE, BOOTFILE, NULL); 716 + #endif 665 717 printf("execvp failed: %s\n", strerror(errno)); 666 718 error_screen("Cannot boot Rockbox!"); 667 719 mode = BOOT_TOOLS;
+1
docs/CREDITS
··· 750 750 Ivan Romaniuk-Mikhailovsky 751 751 Matthieu BACHELIER 752 752 Petr Mikhalitsyn 753 + Melissa Autumn 753 754 754 755 The libmad team 755 756 The wavpack team
+24 -1
firmware/SOURCES
··· 156 156 target/hosted/power-linux.c 157 157 #endif 158 158 159 + #if defined(HIBY_R3PROII) && !defined(SIMULATOR) 160 + target/hosted/hiby/usb-hiby-gadget.c 161 + target/hosted/hiby/r3proii/button-r3proii.c 162 + target/hosted/hiby/r3proii/powermgmt-r3proii.c 163 + #ifndef BOOTLOADER 164 + target/hosted/hiby/r3proii/led-r3proii.c 165 + target/hosted/hiby/hibylinux_codec.c 166 + #endif 167 + #endif 168 + 169 + #if defined(HIBY_R1) && !defined(SIMULATOR) 170 + target/hosted/hiby/usb-hiby-gadget.c 171 + target/hosted/hiby/r1/button-r1.c 172 + target/hosted/hiby/r1/powermgmt-r1.c 173 + #ifndef BOOTLOADER 174 + target/hosted/hiby/r1/led-r1.c 175 + target/hosted/hiby/hibylinux_codec.c 176 + #endif 177 + #endif 178 + 159 179 #if defined(AGPTEK_ROCKER) && !defined(SIMULATOR) 160 180 target/hosted/agptek/button-agptek.c 161 181 target/hosted/agptek/debug-agptek.c ··· 184 204 #endif 185 205 186 206 #if defined(HIBY_LINUX) && !defined(SIMULATOR) 207 + target/hosted/button-devinput.c 208 + #endif 209 + 210 + #if defined(HIBY_LINUX) && !defined(HIBY_R3PROII) && !defined(HIBY_R1) && !defined(SIMULATOR) 187 211 target/hosted/usb-hiby.c 188 - target/hosted/button-devinput.c 189 212 #endif 190 213 191 214 #if defined(FIIO_M3K_LINUX) && !defined(SIMULATOR)
+2
firmware/export/audiohw.h
··· 243 243 #include "erosqlinux_codec.h" 244 244 #elif defined(HAVE_TLV320AIC3104) 245 245 #include "tlv320aic3104_codec.h" 246 + #elif defined(HAVE_HIBY_LINUX_CODEC) 247 + #include "hibylinux_codec.h" 246 248 #endif 247 249 248 250 #if defined(HAVE_X1000_ICODEC_REC) && !defined(HAVE_X1000_ICODEC_PLAY)
+5
firmware/export/config.h
··· 166 166 #define SURFANS_F28_PAD 76 167 167 #define RG_NANO_PAD 77 168 168 #define CTRU_PAD 78 169 + #define HIBY_R3PROII_PAD 79 169 170 170 171 /* CONFIG_REMOTE_KEYPAD */ 171 172 #define H100_REMOTE 1 ··· 618 619 #include "config/rgnano.h" 619 620 #elif defined(CTRU) 620 621 #include "config/ctru.h" 622 + #elif defined(HIBY_R3PROII) 623 + #include "config/hibyr3proii.h" 624 + #elif defined(HIBY_R1) 625 + #include "config/hibyr1.h" 621 626 #else 622 627 #error "unknown hardware platform!" 623 628 #endif
+22
firmware/export/config/hibylinux.h
··· 5 5 6 6 #ifndef SIMULATOR 7 7 #define CONFIG_PLATFORM (PLATFORM_HOSTED) 8 + #ifndef PIVOT_ROOT 8 9 #define PIVOT_ROOT "/mnt/sd_0" 10 + #endif 9 11 #endif 10 12 11 13 #define HAVE_FPU ··· 41 43 42 44 #define CONFIG_LCD LCD_INGENIC_LINUX 43 45 46 + #ifndef LCD_DEPTH 44 47 #define LCD_DEPTH 32 48 + #endif 49 + #ifndef LCD_PIXELFORMAT 45 50 /* Check that but should not matter */ 46 51 #define LCD_PIXELFORMAT XRGB8888 52 + #endif 47 53 48 54 #define HAVE_BACKLIGHT 49 55 #define HAVE_BACKLIGHT_BRIGHTNESS ··· 51 57 /* Main LCD backlight brightness range and defaults: the backlight driver 52 58 * has levels from 0 to 255. But 0 is off so start at 1. 53 59 */ 60 + #ifndef MIN_BRIGHTNESS_SETTING 54 61 #define MIN_BRIGHTNESS_SETTING 1 62 + #endif 63 + #ifndef MAX_BRIGHTNESS_SETTING 55 64 #define MAX_BRIGHTNESS_SETTING 255 65 + #endif 66 + #ifndef BRIGHTNESS_STEP 56 67 #define BRIGHTNESS_STEP 5 68 + #endif 69 + #ifndef DEFAULT_BRIGHTNESS_SETTING 57 70 #define DEFAULT_BRIGHTNESS_SETTING 255 71 + #endif 58 72 59 73 /* Which backlight fading type? */ 74 + #if !defined(CONFIG_BACKLIGHT_FADING) 60 75 #define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING 76 + #endif 61 77 62 78 /* define this if you have a real-time clock */ 63 79 #define CONFIG_RTC RTC_HOSTED ··· 81 97 #define NUM_DRIVES 2 82 98 #define HAVE_HOTSWAP 83 99 #define HAVE_HOTSWAP_STORAGE_AS_MAIN 100 + #ifndef MULTIDRIVE_DIR 84 101 #define MULTIDRIVE_DIR "/mnt/usb" 102 + #endif 85 103 #define MULTIDRIVE_DEV "/sys/block/sda" 86 104 #define ROOTDRIVE_DEV "/sys/block/mmcblk0" 87 105 88 106 /* More common stuff */ 107 + #ifndef BATTERY_DEV_NAME 89 108 #ifndef EROS_Q 90 109 #define BATTERY_DEV_NAME "battery" 91 110 #endif 111 + #endif 112 + #ifndef POWER_DEV_NAME 92 113 #define POWER_DEV_NAME "usb" 114 + #endif
+90
firmware/export/config/hibyr1.h
··· 1 + /* 2 + * This config file is for the HiBy R1 3 + */ 4 + 5 + /* For Rolo and boot loader */ 6 + #define MODEL_NUMBER 124 7 + #define MODEL_NAME "HIBY R1" 8 + 9 + #define PIVOT_ROOT "/data/mnt/sd_0" 10 + #define MULTIDRIVE_DIR "/data/mnt/usb" 11 + 12 + /* LCD dimensions */ 13 + /* sqrt(width^2 + height^2) / 4 = 233 */ 14 + #define LCD_WIDTH 480 15 + #define LCD_HEIGHT 800 16 + #define LCD_DPI 233 17 + 18 + #define HAVE_LCD_SLEEP 19 + #define LCD_SLEEP_TIMEOUT (2*HZ) 20 + 21 + #define LCD_DEPTH 16 /* 65536 colours */ 22 + #define LCD_PIXELFORMAT RGB565 /* rgb565 */ 23 + 24 + #define CPU_FREQ 1008000000 25 + 26 + #ifndef SIMULATOR 27 + #define HAVE_GENERAL_PURPOSE_LED 28 + #endif 29 + 30 + /* define this if you have access to the quickscreen */ 31 + #define HAVE_QUICKSCREEN 32 + #define HAVE_HOTKEY 33 + 34 + #define HAVE_HEADPHONE_DETECTION 35 + #define NO_BUTTON_LR 36 + 37 + #ifndef BOOTLOADER 38 + #define HAVE_BUTTON_DATA 39 + #define HAVE_TOUCHSCREEN 40 + #endif 41 + 42 + #ifndef CONFIG_BACKLIGHT_FADING 43 + #undef CONFIG_BACKLIGHT_FADING 44 + #endif 45 + 46 + /* KeyPad configuration for plugins */ 47 + #define CONFIG_KEYPAD HIBY_R3PROII_PAD 48 + 49 + /* define this if the target has volume keys which can be used in the lists */ 50 + #define HAVE_VOLUME_IN_LIST 51 + 52 + /* Battery */ 53 + #define BATTERY_TYPES_COUNT 1 54 + 55 + /* Audio codec */ 56 + #define HAVE_HIBY_LINUX_CODEC 57 + 58 + /* We don't have hardware controls */ 59 + #define HAVE_SW_TONE_CONTROLS 60 + 61 + /* HW codec is flexible */ 62 + #define HW_SAMPR_CAPS SAMPR_CAP_ALL_192 63 + 64 + /* Battery */ 65 + #define CONFIG_BATTERY_MEASURE (VOLTAGE_MEASURE|PERCENTAGE_MEASURE|TIME_MEASURE) 66 + 67 + #define BATTERY_CAPACITY_DEFAULT 100 /* default battery capacity */ 68 + #define BATTERY_CAPACITY_MIN 100 /* min. capacity selectable */ 69 + #define BATTERY_CAPACITY_MAX 100 /* max. capacity selectable */ 70 + #define BATTERY_CAPACITY_INC 0 /* capacity increment */ 71 + 72 + /* Special backlight paths */ 73 + #define BACKLIGHT_HIBY 74 + 75 + #define MIN_BRIGHTNESS_SETTING 1 76 + #define MAX_BRIGHTNESS_SETTING 100 77 + #define BRIGHTNESS_STEP 5 78 + #define DEFAULT_BRIGHTNESS_SETTING 100 79 + 80 + /* ROLO */ 81 + #define BOOTFILE_EXT "r1" 82 + #define BOOTFILE "rockbox." BOOTFILE_EXT 83 + #define BOOTDIR "/.rockbox" 84 + 85 + /* USB */ 86 + #define USB_VID_STR "32BB" 87 + #define USB_PID_STR "0101" 88 + 89 + /* Generic HiBy stuff */ 90 + #include "hibylinux.h"
+94
firmware/export/config/hibyr3proii.h
··· 1 + /* 2 + * This config file is for the HiBy R3 Pro II based on the x1600E soc 3 + */ 4 + 5 + /* For Rolo and boot loader */ 6 + #define MODEL_NUMBER 123 7 + #define MODEL_NAME "HIBY R3 PRO II" 8 + 9 + #define PIVOT_ROOT "/data/mnt/sd_0" 10 + #define MULTIDRIVE_DIR "/data/mnt/usb" 11 + 12 + /* LCD dimensions */ 13 + /* sqrt(width^2 + height^2) / 4 = 216 */ 14 + #define LCD_WIDTH 480 15 + #define LCD_HEIGHT 720 16 + #define LCD_DPI 216 17 + 18 + #define HAVE_LCD_SLEEP 19 + #define LCD_SLEEP_TIMEOUT (2*HZ) 20 + 21 + #define LCD_DEPTH 16 /* 65536 colours */ 22 + #define LCD_PIXELFORMAT RGB565 /* rgb565 */ 23 + 24 + #define CPU_FREQ 1008000000 25 + 26 + #ifndef SIMULATOR 27 + #define HAVE_GENERAL_PURPOSE_LED 28 + #endif 29 + 30 + /* define this if you have access to the quickscreen */ 31 + #define HAVE_QUICKSCREEN 32 + #define HAVE_HOTKEY 33 + 34 + #define HAVE_HEADPHONE_DETECTION 35 + #define NO_BUTTON_LR 36 + 37 + #ifndef BOOTLOADER 38 + #define HAVE_BUTTON_DATA 39 + #define HAVE_TOUCHSCREEN 40 + #endif 41 + 42 + #ifndef CONFIG_BACKLIGHT_FADING 43 + #undef CONFIG_BACKLIGHT_FADING 44 + #endif 45 + 46 + /* KeyPad configuration for plugins */ 47 + #define CONFIG_KEYPAD HIBY_R3PROII_PAD 48 + 49 + /* define this if the target has volume keys which can be used in the lists */ 50 + #define HAVE_VOLUME_IN_LIST 51 + 52 + /* Battery doesn't update its charging status, but the charger does. */ 53 + #define POWER_DEV_NAME "mp2731-charger" 54 + #define BATTERY_DEV_NAME "mp2731-charger" 55 + 56 + /* Battery */ 57 + #define BATTERY_TYPES_COUNT 1 58 + 59 + /* Audio codec */ 60 + #define HAVE_HIBY_LINUX_CODEC 61 + 62 + /* We don't have hardware controls */ 63 + #define HAVE_SW_TONE_CONTROLS 64 + 65 + /* HW codec is flexible */ 66 + #define HW_SAMPR_CAPS SAMPR_CAP_ALL_192 67 + 68 + /* Battery */ 69 + #define CONFIG_BATTERY_MEASURE (VOLTAGE_MEASURE|PERCENTAGE_MEASURE|TIME_MEASURE) 70 + 71 + #define BATTERY_CAPACITY_DEFAULT 100 /* default battery capacity */ 72 + #define BATTERY_CAPACITY_MIN 100 /* min. capacity selectable */ 73 + #define BATTERY_CAPACITY_MAX 100 /* max. capacity selectable */ 74 + #define BATTERY_CAPACITY_INC 0 /* capacity increment */ 75 + 76 + /* Special backlight paths */ 77 + #define BACKLIGHT_HIBY 78 + 79 + #define MIN_BRIGHTNESS_SETTING 1 80 + #define MAX_BRIGHTNESS_SETTING 100 81 + #define BRIGHTNESS_STEP 5 82 + #define DEFAULT_BRIGHTNESS_SETTING 100 83 + 84 + /* ROLO */ 85 + #define BOOTFILE_EXT "r3proii" 86 + #define BOOTFILE "rockbox." BOOTFILE_EXT 87 + #define BOOTDIR "/.rockbox" 88 + 89 + /* USB */ 90 + #define USB_VID_STR "32BB" 91 + #define USB_PID_STR "0101" 92 + 93 + /* Generic HiBy stuff */ 94 + #include "hibylinux.h"
+17
firmware/export/hibylinux_codec.h
··· 1 + #ifndef __HIBYLINUX_CODEC__ 2 + #define __HIBYLINUX_CODEC__ 3 + 4 + #define AUDIOHW_CAPS (FILTER_ROLL_OFF_CAP) 5 + AUDIOHW_SETTING(VOLUME, "dB", 1, 5, -102*10, 0, -30*10) 6 + #endif 7 + 8 + //#define AUDIOHW_MUTE_ON_STOP 9 + #define AUDIOHW_MUTE_ON_SRATE_CHANGE 10 + //#define AUDIOHW_NEEDS_INITIAL_UNMUTE 11 + 12 + AUDIOHW_SETTING(FILTER_ROLL_OFF, "", 0, 1, 0, 4, 0) 13 + #define AUDIOHW_HAVE_SHORT2_ROLL_OFF 14 + 15 + void audiohw_mute(int mute); 16 + void hiby_set_output(int ps); 17 + int hiby_get_outputs(void);
+35
firmware/export/led-general-purpose.h
··· 1 + /*************************************************************************** 2 + * __________ __ ___ 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2025 Melissa Autumn 10 + * 11 + * This program is free software; you can redistribute it and/or 12 + * modify it under the terms of the GNU General Public License 13 + * as published by the Free Software Foundation; either version 2 14 + * of the License, or (at your option) any later version. 15 + * 16 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 17 + * KIND, either express or implied. 18 + * 19 + ****************************************************************************/ 20 + #ifndef __LED_GENERAL_PURPOSE_H__ 21 + #define __LED_GENERAL_PURPOSE_H__ 22 + 23 + #ifdef HAVE_GENERAL_PURPOSE_LED 24 + 25 + extern void led_hw_set_mode(bool mode); 26 + extern void led_hw_brightness(int brightness); 27 + extern void led_hw_on(void); 28 + extern void led_hw_off(void); 29 + extern void led_hw_charging(void); 30 + extern void led_hw_charged(void); 31 + 32 + #endif /* HAVE_GENERAL_PURPOSE_LED */ 33 + 34 + #endif 35 +
+2 -1
firmware/export/rbpaths.h
··· 87 87 88 88 #if defined(APPLICATION) && \ 89 89 !(defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) || \ 90 - defined(DX50) || defined(DX90) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX) || defined(CTRU)) 90 + defined(DX50) || defined(DX90) || defined(SONY_NWZ_LINUX) || \ 91 + defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX) || defined(CTRU)) 91 92 92 93 #define PLUGIN_DATA_DIR ROCKBOX_DIR "/rocks.data" 93 94 #define PLUGIN_GAMES_DATA_DIR PLUGIN_DATA_DIR
+5
firmware/kernel/include/queue.h
··· 76 76 #define IS_SYSEVENT(ev) ((ev & SYS_EVENT) == SYS_EVENT) 77 77 78 78 #define MAX_NUM_QUEUES 32 79 + #if defined(HAVE_TOUCHSCREEN) /* Multitouch generates more events */ 80 + #define QUEUE_LENGTH 32 /* MUST be a power of 2 */ 81 + #else 79 82 #define QUEUE_LENGTH 16 /* MUST be a power of 2 */ 83 + #endif 80 84 #define QUEUE_LENGTH_MASK (QUEUE_LENGTH - 1) 85 + 81 86 82 87 struct queue_event 83 88 {
+37 -7
firmware/target/hosted/backlight-unix.c
··· 8 8 * 9 9 * Copyright (C) 2017 Marcin Bukat 10 10 * Copyright (C) 2019 by Roman Stolyarov 11 + * Copyright (C) 2025 by Melissa Autumn 11 12 * 12 13 * This program is free software; you can redistribute it and/or 13 14 * modify it under the terms of the GNU General Public License ··· 31 32 #include "panic.h" 32 33 #include "lcd.h" 33 34 34 - #ifdef BACKLIGHT_RG_NANO 35 + #if defined(BACKLIGHT_RG_NANO) 35 36 static const char * const sysfs_bl_brightness = 36 37 "/sys/class/backlight/backlight/brightness"; 37 38 38 39 static const char * const sysfs_bl_power = 39 40 "/sys/class/backlight/backlight/bl_power"; 41 + #elif defined(BACKLIGHT_HIBY) 42 + static const char * const sysfs_bl_brightness = 43 + "/sys/class/backlight/backlight_pwm0/brightness"; 44 + 45 + static const char * const sysfs_bl_power = 46 + "/sys/class/backlight/backlight_pwm0/bl_power"; 40 47 #else 41 48 static const char * const sysfs_bl_brightness = 42 49 "/sys/class/backlight/pwm-backlight.0/brightness"; ··· 60 67 61 68 static int last_bl = -1; 62 69 70 + /* Ref: https://www.kernel.org/doc/html/latest/gpu/backlight.html#c.backlight_properties */ 71 + #define BACKLIGHT_POWER_ON 0 72 + #define BACKLIGHT_POWER_REDUCED 1 73 + #define BACKLIGHT_POWER_OFF 4 74 + 63 75 void backlight_hw_on(void) 64 76 { 65 - if (last_bl != 1) { 77 + if (last_bl != BACKLIGHT_POWER_ON) { 66 78 #ifdef HAVE_LCD_ENABLE 67 79 lcd_enable(true); 68 80 #endif 69 - sysfs_set_int(sysfs_bl_power, 0); 70 - last_bl = 1; 81 + last_bl = BACKLIGHT_POWER_ON; 82 + sysfs_set_int(sysfs_bl_power, last_bl); 71 83 } 72 84 } 73 85 74 86 void backlight_hw_off(void) 75 87 { 76 - if (last_bl != 0) { 77 - sysfs_set_int(sysfs_bl_power, 1); 88 + if (last_bl != BACKLIGHT_POWER_REDUCED) { 89 + last_bl = BACKLIGHT_POWER_REDUCED; 90 + sysfs_set_int(sysfs_bl_power, last_bl); 78 91 #ifdef HAVE_LCD_ENABLE 79 92 lcd_enable(false); 80 93 #endif 81 - last_bl = 0; 82 94 } 83 95 } 84 96 ··· 92 104 93 105 sysfs_set_int(sysfs_bl_brightness, brightness); 94 106 } 107 + 108 + #ifdef HAVE_LCD_SLEEP 109 + void lcd_awake(void) 110 + { 111 + /* Nothing to do */ 112 + } 113 + 114 + void lcd_sleep(void) 115 + { 116 + if (last_bl != BACKLIGHT_POWER_OFF) { 117 + last_bl = BACKLIGHT_POWER_OFF; 118 + sysfs_set_int(sysfs_bl_power, last_bl); 119 + #ifdef HAVE_LCD_ENABLE 120 + lcd_enable(false); 121 + #endif 122 + } 123 + } 124 + #endif
+6 -17
firmware/target/hosted/button-devinput.c
··· 109 109 #define EVENT_VALUE_TOUCHSCREEN_PRESS 1 110 110 #define EVENT_VALUE_TOUCHSCREEN_RELEASE -1 111 111 112 - static int ts_enabled = 0; 112 + static int ts_enabled = 1; 113 113 114 114 void touchscreen_enable_device(bool en) 115 115 { 116 116 ts_enabled = en; 117 117 } 118 118 119 - static bool handle_touchscreen_event(__u16 code, __s32 value) 119 + static void handle_touchscreen_event(__u16 code, __s32 value) 120 120 { 121 - bool read_more = false; 122 - 123 121 switch(code) 124 122 { 125 123 case ABS_X: 126 124 case ABS_MT_POSITION_X: 127 125 { 128 126 _last_x = value; 129 - 130 - /* x -> next will be y. */ 131 - read_more = true; 132 - 133 127 break; 134 128 } 135 129 ··· 142 136 143 137 case ABS_MT_TRACKING_ID: 144 138 { 145 - if(value == EVENT_VALUE_TOUCHSCREEN_PRESS) 139 + if(value == EVENT_VALUE_TOUCHSCREEN_RELEASE) 146 140 { 147 - _last_touch_state = TOUCHSCREEN_STATE_DOWN; 148 - 149 - /* Press -> next will be x. */ 150 - read_more = true; 141 + _last_touch_state = TOUCHSCREEN_STATE_UP; 151 142 } 152 143 else 153 144 { 154 - _last_touch_state = TOUCHSCREEN_STATE_UP; 145 + _last_touch_state = TOUCHSCREEN_STATE_DOWN; 155 146 } 156 147 break; 157 148 } 158 149 } 159 - 160 - return read_more; 161 150 } 162 151 #endif 163 152 ··· 227 216 #if defined(HAVE_TOUCHSCREEN) && defined(BUTTON_TOUCH) 228 217 /* Some touchscreens give us actual touch/untouch as a "key" */ 229 218 if (bmap & BUTTON_TOUCH) { 230 - handle_touchscreen_event(ABS_MT_TRACKING_ID, 0); 219 + handle_touchscreen_event(ABS_MT_TRACKING_ID, EVENT_VALUE_TOUCHSCREEN_RELEASE); 231 220 bmap &= ~BUTTON_TOUCH; 232 221 } 233 222 #endif
firmware/target/hosted/hiby/adc-target.h

This is a binary file and will not be displayed.

+158
firmware/target/hosted/hiby/hibylinux_codec.c
··· 1 + /*************************************************************************** 2 + * __________ __ ___. 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * $Id$ 9 + * 10 + * 11 + * Copyright (c) 2018 Marcin Bukat 12 + * Copyright (c) 2025 Solomon Peachy 13 + * 14 + * This program is free software; you can redistribute it and/or 15 + * modify it under the terms of the GNU General Public License 16 + * as published by the Free Software Foundation; either version 2 17 + * of the License, or (at your option) any later version. 18 + * 19 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 20 + * KIND, either express or implied. 21 + * 22 + ****************************************************************************/ 23 + 24 + //#define LOGF_ENABLE 25 + 26 + #include "config.h" 27 + #include "audio.h" 28 + #include "audiohw.h" 29 + #include "button.h" 30 + #include "system.h" 31 + #include "kernel.h" 32 + #include "panic.h" 33 + #include "sysfs.h" 34 + #include "alsa-controls.h" 35 + #include "pcm-alsa.h" 36 + 37 + #include "logf.h" 38 + 39 + int hiby_has_valid_output(void); 40 + 41 + static int hw_init = 0; 42 + 43 + static long int vol_l_hw = 255; 44 + static long int vol_r_hw = 255; 45 + static long int last_ps = -1; 46 + 47 + static int muted = -1; 48 + 49 + void audiohw_mute(int mute) 50 + { 51 + if (hw_init < 0 || muted == mute) 52 + return; 53 + 54 + muted = mute; 55 + 56 + alsa_controls_set_bool("Mute Output", !!mute); 57 + } 58 + 59 + int hiby_has_valid_output(void) { 60 + long int ps = 0; // Muted, if nothing is plugged in! 61 + 62 + int status = 0; 63 + 64 + if (!hw_init) return ps; 65 + 66 + const char * const sysfs_hs_switch = "/sys/class/switch/headset/state"; 67 + const char * const sysfs_bal_switch = "/sys/class/switch/balance/state"; 68 + 69 + sysfs_get_int(sysfs_hs_switch, &status); 70 + if (status) ps = 2; // headset 71 + 72 + sysfs_get_int(sysfs_bal_switch, &status); 73 + if (status) ps = 3; // balanced output 74 + 75 + return ps; 76 + } 77 + 78 + int hiby_get_outputs(void){ 79 + long int ps = hiby_has_valid_output(); 80 + 81 + hiby_set_output(ps); 82 + 83 + return ps; 84 + } 85 + 86 + void hiby_set_output(int ps) 87 + { 88 + if (!hw_init || muted) return; 89 + 90 + if (last_ps != ps) 91 + { 92 + logf("set out %d/%d", ps, last_ps); 93 + /* Output port switch */ 94 + last_ps = ps; 95 + alsa_controls_set_ints("Output Port Switch", 1, &last_ps); 96 + audiohw_set_volume(vol_l_hw, vol_r_hw); 97 + } 98 + } 99 + 100 + void audiohw_preinit(void) 101 + { 102 + logf("hw preinit"); 103 + alsa_controls_init("default"); 104 + hw_init = 1; 105 + 106 + audiohw_mute(false); /* No need ? */ 107 + alsa_controls_set_bool("DOP_EN", 0); //isDSD 108 + } 109 + 110 + void audiohw_postinit(void) 111 + { 112 + logf("hw postinit"); 113 + } 114 + 115 + void audiohw_close(void) 116 + { 117 + logf("hw close"); 118 + hw_init = 0; 119 + alsa_controls_close(); 120 + } 121 + 122 + void audiohw_set_frequency(int fsel) 123 + { 124 + (void)fsel; 125 + } 126 + 127 + void audiohw_set_volume(int vol_l, int vol_r) 128 + { 129 + logf("hw vol %d %d", vol_l, vol_r); 130 + 131 + long l,r; 132 + 133 + vol_l_hw = vol_l; 134 + vol_r_hw = vol_r; 135 + 136 + l = -vol_l/5; 137 + r = -vol_r/5; 138 + 139 + if (!hw_init) 140 + return; 141 + 142 + alsa_controls_set_ints("Left Playback Volume", 1, &l); 143 + alsa_controls_set_ints("Right Playback Volume", 1, &r); 144 + } 145 + 146 + void audiohw_set_filter_roll_off(int value) 147 + { 148 + logf("rolloff %d", value); 149 + /* 0 = Sharp; 150 + * 1 = Slow; 151 + * 2 = Short Sharp 152 + * 3 = Short Slow 153 + * 4 = Super Slow */ 154 + long int value_hw = value; 155 + alsa_controls_set_ints("Digital Filter", 1, &value_hw); 156 + 157 + } 158 +
+32
firmware/target/hosted/hiby/lcd-target.h
··· 1 + /*************************************************************************** 2 + * __________ __ ___. 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2016 Amaury Pouly 10 + * 11 + * This program is free software; you can redistribute it and/or 12 + * modify it under the terms of the GNU General Public License 13 + * as published by the Free Software Foundation; either version 2 14 + * of the License, or (at your option) any later version. 15 + * 16 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 17 + * KIND, either express or implied. 18 + * 19 + ****************************************************************************/ 20 + 21 + #ifndef __LCD_TARGET_H__ 22 + #define __LCD_TARGET_H__ 23 + 24 + /* hibyos needs special ioctl() to redraw updated framebuffer content */ 25 + #define LCD_OPTIMIZED_UPDATE 26 + #define LCD_OPTIMIZED_UPDATE_RECT 27 + 28 + extern fb_data *framebuffer; 29 + #define LCD_FRAMEBUF_ADDR(col, row) (framebuffer + (row)*LCD_WIDTH + (col)) 30 + 31 + extern void lcd_set_active(bool active); 32 + #endif /* __LCD_TARGET_H__ */
+81
firmware/target/hosted/hiby/r1/button-r1.c
··· 1 + /*************************************************************************** 2 + * __________ __ ___ 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2017 Marcin Bukat 10 + * Copyright (C) 2025 by Melissa Autumn/Marc Aarts 11 + * 12 + * This program is free software; you can redistribute it and/or 13 + * modify it under the terms of the GNU General Public License 14 + * as published by the Free Software Foundation; either version 2 15 + * of the License, or (at your option) any later version. 16 + * 17 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 18 + * KIND, either express or implied. 19 + * 20 + ****************************************************************************/ 21 + #include <linux/input.h> 22 + 23 + #include "sysfs.h" 24 + #include "button.h" 25 + #include "button-target.h" 26 + #include "hibylinux_codec.h" 27 + #include "touchscreen.h" 28 + #ifdef HAVE_BACKLIGHT 29 + #include "backlight.h" 30 + #endif /* HAVE_BACKLIGHT */ 31 + 32 + /* 33 + * /dev/input/event0: md-gpio-keys (power/next) 34 + * /dev/input/event1: hyn_ts (touchscreen) 35 + * /dev/input/event2: jz adc keyboard (play/volume+/volume-) 36 + * /dev/input/event3: earpods_adc 37 + */ 38 + 39 + int button_map(int keycode) 40 + { 41 + switch(keycode) 42 + { 43 + case KEY_VOLUMEDOWN: 44 + return BUTTON_VOL_DOWN; 45 + case KEY_VOLUMEUP: 46 + return BUTTON_VOL_UP; 47 + case KEY_PLAYPAUSE: 48 + return BUTTON_PLAY; 49 + case KEY_NEXTSONG: 50 + return BUTTON_NEXT; 51 + case KEY_PREVIOUSSONG: 52 + return BUTTON_PREV; 53 + case KEY_POWER: 54 + return BUTTON_POWER; 55 + case BTN_TOUCH: 56 + { 57 + #ifdef HAVE_BACKLIGHT 58 + if (is_backlight_on(true)) { 59 + return BUTTON_TOUCH; 60 + } 61 + // Ignore 62 + return 0; 63 + #else 64 + return BUTTON_TOUCH 65 + #endif 66 + } 67 + default: 68 + return 0; 69 + } 70 + } 71 + 72 + bool headphones_inserted(void) 73 + { 74 + #ifdef BOOTLOADER 75 + int ps = 0; 76 + #else 77 + int ps = hiby_get_outputs(); 78 + #endif 79 + 80 + return (ps == 2); 81 + }
+60
firmware/target/hosted/hiby/r1/button-target.h
··· 1 + /*************************************************************************** 2 + * __________ __ ___. 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2025 by Melissa Autumn 10 + * 11 + * This program is free software; you can redistribute it and/or 12 + * modify it under the terms of the GNU General Public License 13 + * as published by the Free Software Foundation; either version 2 14 + * of the License, or (at your option) any later version. 15 + * 16 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 17 + * KIND, either express or implied. 18 + * 19 + ****************************************************************************/ 20 + #ifndef _BUTTON_TARGET_H_ 21 + #define _BUTTON_TARGET_H_ 22 + 23 + #include <stdbool.h> 24 + #include "config.h" 25 + 26 + /* Main unit's buttons */ 27 + #define BUTTON_POWER 0x00000001 28 + #define BUTTON_PREV 0x00000002 /* there is no PREV */ 29 + #define BUTTON_NEXT 0x00000004 30 + #define BUTTON_PLAY 0x00000008 31 + #define BUTTON_VOL_UP 0x00000010 32 + #define BUTTON_VOL_DOWN 0x00000020 33 + #define BUTTON_MAIN 0x0000003f 34 + 35 + #define BUTTON_TOUCH 0x00000040 36 + 37 + /* Touchscreen virtual buttons */ 38 + #define BUTTON_TOPLEFT 0x00001000 39 + #define BUTTON_TOPMIDDLE 0x00002000 40 + #define BUTTON_TOPRIGHT 0x00004000 41 + #define BUTTON_MIDLEFT 0x00008000 42 + #define BUTTON_CENTER 0x00010000 43 + #define BUTTON_MIDRIGHT 0x00020000 44 + #define BUTTON_BOTTOMLEFT 0x00040000 45 + #define BUTTON_BOTTOMMIDDLE 0x00080000 46 + #define BUTTON_BOTTOMRIGHT 0x00100000 47 + 48 + /* Software power-off */ 49 + #define POWEROFF_BUTTON BUTTON_POWER 50 + #define POWEROFF_COUNT 25 51 + 52 + /* For the simulator/sdl plugins/xworld */ 53 + #ifndef BOOTLOADER 54 + #define BUTTON_LEFT BUTTON_NEXT 55 + #define BUTTON_RIGHT BUTTON_PREV 56 + #endif 57 + 58 + int button_map(int keycode); 59 + 60 + #endif /* _BUTTON_TARGET_H_ */
+140
firmware/target/hosted/hiby/r1/led-r1.c
··· 1 + /*************************************************************************** 2 + * __________ __ ___ 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2025 Melissa Autumn 10 + * 11 + * This program is free software; you can redistribute it and/or 12 + * modify it under the terms of the GNU General Public License 13 + * as published by the Free Software Foundation; either version 2 14 + * of the License, or (at your option) any later version. 15 + * 16 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 17 + * KIND, either express or implied. 18 + * 19 + ****************************************************************************/ 20 + #include <sys/types.h> 21 + #include <sys/stat.h> 22 + #include <fcntl.h> 23 + #include <stdbool.h> 24 + #include <unistd.h> 25 + #include <string.h> 26 + #include <stdio.h> 27 + #include "config.h" 28 + #include "backlight-target.h" 29 + #include "sysfs.h" 30 + #include "panic.h" 31 + #include "lcd.h" 32 + #include "settings.h" 33 + #include "power.h" 34 + 35 + static const char * const sysfs_blue_led = 36 + "/sys/class/leds/blue/brightness"; 37 + static const char * const sysfs_red_led = 38 + "/sys/class/leds/red/brightness"; 39 + static const char * const sysfs_red_trigger = 40 + "/sys/class/leds/red/trigger"; 41 + 42 + /* Ref: https://guide.hiby.com/en/docs/products/audio_player/hiby_r1/guide#led-indicator 43 + 44 + Note: The red breathing effect seems to be just the "breathing" led trigger. 45 + By default red is turned off and blue is set to 50 brightness. 46 + */ 47 + enum R1_LEDS { 48 + LED_INVALID = -1, 49 + LED_OFF = 0, 50 + LED_BLUE, 51 + LED_RED, 52 + }; 53 + 54 + #define DEFAULT_BRIGHTNESS 50 55 + 56 + int _last_brightness = DEFAULT_BRIGHTNESS; 57 + int _last_led = LED_INVALID; 58 + 59 + void _set_led(enum R1_LEDS led) { 60 + if (_last_led != led) { 61 + _last_led = led; 62 + 63 + if (_last_brightness == 0) { 64 + _last_brightness = DEFAULT_BRIGHTNESS; 65 + } 66 + 67 + switch(led) { 68 + case LED_OFF: 69 + sysfs_set_int(sysfs_blue_led, 0); 70 + sysfs_set_int(sysfs_red_led, 0); 71 + break; 72 + case LED_BLUE: 73 + sysfs_set_int(sysfs_blue_led, _last_brightness); 74 + sysfs_set_int(sysfs_red_led, 0); 75 + break; 76 + case LED_RED: 77 + sysfs_set_int(sysfs_blue_led, 0); 78 + sysfs_set_int(sysfs_red_led, _last_brightness); 79 + sysfs_set_string(sysfs_red_trigger, "breathing"); 80 + break; 81 + default: 82 + break; 83 + } 84 + } 85 + } 86 + 87 + #ifdef HAVE_GENERAL_PURPOSE_LED 88 + void led_hw_brightness(int brightness) 89 + { 90 + if (brightness != _last_brightness) { 91 + _last_brightness = brightness; 92 + _set_led(_last_led); 93 + } 94 + } 95 + 96 + void led_hw_charged(void) 97 + { 98 + if (global_settings.use_led_indicators) { 99 + _set_led(LED_BLUE); 100 + } 101 + } 102 + 103 + void led_hw_charging(void) 104 + { 105 + _set_led(LED_RED); 106 + } 107 + 108 + void led_hw_off(void) 109 + { 110 + // Don't turn off led if charging 111 + if (!charging_state()) { 112 + _set_led(LED_OFF); 113 + } 114 + } 115 + 116 + void led_hw_on(void) 117 + { 118 + if (charging_state()) { 119 + led_hw_charging(); 120 + } else { 121 + if (global_settings.use_led_indicators) { 122 + _set_led(LED_BLUE); 123 + } 124 + else { 125 + led_hw_off(); 126 + } 127 + } 128 + } 129 + 130 + void led_hw_set_mode(bool mode) 131 + { 132 + if (mode) { 133 + led_hw_on(); 134 + } 135 + else { 136 + led_hw_off(); 137 + } 138 + } 139 + #endif 140 +
+39
firmware/target/hosted/hiby/r1/powermgmt-r1.c
··· 1 + /*************************************************************************** 2 + * __________ __ ___. 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2017 Marcin Bukat 10 + * Copyright (C) 2025 by Melissa Autumn 11 + * 12 + * This program is free software; you can redistribute it and/or 13 + * modify it under the terms of the GNU General Public License 14 + * as published by the Free Software Foundation; either version 2 15 + * of the License, or (at your option) any later version. 16 + * 17 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 18 + * KIND, either express or implied. 19 + * 20 + ****************************************************************************/ 21 + #include "powermgmt.h" 22 + #include "power.h" 23 + 24 + unsigned short battery_level_disksafe = 3470; 25 + 26 + /* the OF shuts down at this voltage */ 27 + unsigned short battery_level_shutoff = 3400; 28 + 29 + /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ 30 + unsigned short percent_to_volt_discharge[11] = 31 + { 32 + 3400, 3675, 3715, 3750, 3775, 3810, 3850, 4028, 4125, 4237, 4376 33 + }; 34 + 35 + /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ 36 + unsigned short percent_to_volt_charge[11] = 37 + { 38 + 3485, 3780, 3836, 3857, 3890, 3930, 3986, 4028, 4125, 4237, 4376 39 + };
+81
firmware/target/hosted/hiby/r3proii/button-r3proii.c
··· 1 + /*************************************************************************** 2 + * __________ __ ___ 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2017 Marcin Bukat 10 + * Copyright (C) 2025 by Melissa Autumn 11 + * 12 + * This program is free software; you can redistribute it and/or 13 + * modify it under the terms of the GNU General Public License 14 + * as published by the Free Software Foundation; either version 2 15 + * of the License, or (at your option) any later version. 16 + * 17 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 18 + * KIND, either express or implied. 19 + * 20 + ****************************************************************************/ 21 + #include <linux/input.h> 22 + 23 + #include "sysfs.h" 24 + #include "button.h" 25 + #include "button-target.h" 26 + #include "hibylinux_codec.h" 27 + #include "touchscreen.h" 28 + #ifdef HAVE_BACKLIGHT 29 + #include "backlight.h" 30 + #endif /* HAVE_BACKLIGHT */ 31 + /* 32 + * /dev/input/event0: gpios (power/next) 33 + * /dev/input/event1: touchscreen 34 + * /dev/input/event2: adc (prev/play/left/right) 35 + * /dev/input/event3: ???? 36 + */ 37 + 38 + 39 + int button_map(int keycode) 40 + { 41 + switch(keycode) 42 + { 43 + case KEY_VOLUMEDOWN: 44 + return BUTTON_VOL_DOWN; 45 + case KEY_VOLUMEUP: 46 + return BUTTON_VOL_UP; 47 + case KEY_PLAYPAUSE: 48 + return BUTTON_PLAY; 49 + case KEY_NEXTSONG: 50 + return BUTTON_NEXT; 51 + case KEY_PREVIOUSSONG: 52 + return BUTTON_PREV; 53 + case KEY_POWER: 54 + return BUTTON_POWER; 55 + case BTN_TOUCH: 56 + { 57 + #ifdef HAVE_BACKLIGHT 58 + if (is_backlight_on(true)) { 59 + return BUTTON_TOUCH; 60 + } 61 + // Ignore 62 + return 0; 63 + #else 64 + return BUTTON_TOUCH 65 + #endif 66 + } 67 + default: 68 + return 0; 69 + } 70 + } 71 + 72 + bool headphones_inserted(void) 73 + { 74 + #ifdef BOOTLOADER 75 + int ps = 0; 76 + #else 77 + int ps = hiby_get_outputs(); 78 + #endif 79 + 80 + return (ps == 2 || ps == 3); 81 + }
+60
firmware/target/hosted/hiby/r3proii/button-target.h
··· 1 + /*************************************************************************** 2 + * __________ __ ___. 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2025 by Melissa Autumn 10 + * 11 + * This program is free software; you can redistribute it and/or 12 + * modify it under the terms of the GNU General Public License 13 + * as published by the Free Software Foundation; either version 2 14 + * of the License, or (at your option) any later version. 15 + * 16 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 17 + * KIND, either express or implied. 18 + * 19 + ****************************************************************************/ 20 + #ifndef _BUTTON_TARGET_H_ 21 + #define _BUTTON_TARGET_H_ 22 + 23 + #include <stdbool.h> 24 + #include "config.h" 25 + 26 + /* Main unit's buttons */ 27 + #define BUTTON_POWER 0x00000001 28 + #define BUTTON_PREV 0x00000002 29 + #define BUTTON_NEXT 0x00000004 30 + #define BUTTON_PLAY 0x00000008 31 + #define BUTTON_VOL_UP 0x00000010 32 + #define BUTTON_VOL_DOWN 0x00000020 33 + #define BUTTON_MAIN 0x0000003f 34 + 35 + #define BUTTON_TOUCH 0x00000040 36 + 37 + /* Touchscreen virtual buttons */ 38 + #define BUTTON_TOPLEFT 0x00001000 39 + #define BUTTON_TOPMIDDLE 0x00002000 40 + #define BUTTON_TOPRIGHT 0x00004000 41 + #define BUTTON_MIDLEFT 0x00008000 42 + #define BUTTON_CENTER 0x00010000 43 + #define BUTTON_MIDRIGHT 0x00020000 44 + #define BUTTON_BOTTOMLEFT 0x00040000 45 + #define BUTTON_BOTTOMMIDDLE 0x00080000 46 + #define BUTTON_BOTTOMRIGHT 0x00100000 47 + 48 + /* Software power-off */ 49 + #define POWEROFF_BUTTON BUTTON_POWER 50 + #define POWEROFF_COUNT 25 51 + 52 + /* For the simulator/sdl plugins/xworld */ 53 + #ifndef BOOTLOADER 54 + #define BUTTON_LEFT BUTTON_NEXT 55 + #define BUTTON_RIGHT BUTTON_PREV 56 + #endif 57 + 58 + int button_map(int keycode); 59 + 60 + #endif /* _BUTTON_TARGET_H_ */
+132
firmware/target/hosted/hiby/r3proii/led-r3proii.c
··· 1 + /*************************************************************************** 2 + * __________ __ ___ 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2025 Melissa Autumn 10 + * 11 + * This program is free software; you can redistribute it and/or 12 + * modify it under the terms of the GNU General Public License 13 + * as published by the Free Software Foundation; either version 2 14 + * of the License, or (at your option) any later version. 15 + * 16 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 17 + * KIND, either express or implied. 18 + * 19 + ****************************************************************************/ 20 + #include <sys/types.h> 21 + #include <sys/stat.h> 22 + #include <fcntl.h> 23 + #include <stdbool.h> 24 + #include <unistd.h> 25 + #include <string.h> 26 + #include <stdio.h> 27 + #include "config.h" 28 + #include "backlight-target.h" 29 + #include "sysfs.h" 30 + #include "panic.h" 31 + #include "lcd.h" 32 + #include "settings.h" 33 + #include "power.h" 34 + 35 + static const char * const sysfs_led_type = 36 + "/sys/class/leds/sgm31324-leds/led_pattern"; 37 + 38 + /* Ref: https://guide.hiby.com/en/docs/products/audio_player/hiby_r3proii/guide#led-indicator-light 39 + 40 + Defined in leds_sgm31324_add.sh (off is defined in driver) 41 + 42 + ... 43 + echo regs="00000000540001010706" > sgm31324 44 + echo regs="000000004500380B0000" > sgm31324 45 + echo regs="00000000540000060600" > sgm31324 46 + echo regs="00000000450040040000" > sgm31324 47 + echo regs="00000000000000000006" > sgm31324 48 + echo regs="001E7D0042BB2F000006" > sgm31324 49 + echo regs="000E7D0042663F000006" > sgm31324 50 + echo regs="00000000440000050006" > sgm31324 51 + echo regs="00000000540000000D06" > sgm31324 52 + echo regs="0000000051001C000506" > sgm31324 53 + echo regs="00000000000000000006" > sgm31324 54 + ... 55 + 56 + */ 57 + enum R3PROII_LED_PATTERNS { 58 + LED_PATTERN_INVALID = -1, 59 + LED_PATTERN_OFF = 0, 60 + LED_PATTERN_LIGHT_BLUE, 61 + LED_PATTERN_YELLOW, 62 + LED_PATTERN_CYAN, 63 + LED_PATTERN_ORANGE, 64 + LED_PATTERN_UNK_1, /* This might do something, but it seems to just be off */ 65 + LED_PATTERN_NORMAL_RED_BLINK, 66 + LED_PATTERN_FAST_RED_BLINK, 67 + LED_PATTERN_GREEN, 68 + LED_PATTERN_BLUE, /* A slightly more blue blue */ 69 + LED_PATTERN_PINK, 70 + LED_PATTERN_WHITE, 71 + }; 72 + 73 + int _last_buttonlight = LED_PATTERN_INVALID; 74 + 75 + void _set_pattern(enum R3PROII_LED_PATTERNS pattern) { 76 + if (_last_buttonlight != pattern) { 77 + _last_buttonlight = pattern; 78 + sysfs_set_int(sysfs_led_type, _last_buttonlight); 79 + } 80 + } 81 + 82 + #ifdef HAVE_GENERAL_PURPOSE_LED 83 + void led_hw_brightness(int brightness) 84 + { 85 + (void)brightness; 86 + } 87 + 88 + void led_hw_charged(void) 89 + { 90 + if (global_settings.use_led_indicators) { 91 + _set_pattern(LED_PATTERN_GREEN); 92 + } 93 + } 94 + 95 + void led_hw_charging(void) 96 + { 97 + _set_pattern(LED_PATTERN_NORMAL_RED_BLINK); 98 + } 99 + 100 + void led_hw_off(void) 101 + { 102 + // Don't turn off led if charging 103 + if (_last_buttonlight != LED_PATTERN_NORMAL_RED_BLINK) { 104 + _set_pattern(LED_PATTERN_OFF); 105 + } 106 + } 107 + 108 + void led_hw_on(void) 109 + { 110 + if (charging_state()) { 111 + led_hw_charging(); 112 + } else { 113 + if (global_settings.use_led_indicators) { 114 + _set_pattern(LED_PATTERN_LIGHT_BLUE); 115 + } 116 + else { 117 + led_hw_off(); 118 + } 119 + } 120 + } 121 + 122 + void led_hw_set_mode(bool mode) 123 + { 124 + if (mode) { 125 + led_hw_on(); 126 + } 127 + else { 128 + led_hw_off(); 129 + } 130 + } 131 + #endif 132 +
+42
firmware/target/hosted/hiby/r3proii/powermgmt-r3proii.c
··· 1 + /*************************************************************************** 2 + * __________ __ ___. 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2017 Marcin Bukat 10 + * Copyright (C) 2025 by Melissa Autumn 11 + * 12 + * This program is free software; you can redistribute it and/or 13 + * modify it under the terms of the GNU General Public License 14 + * as published by the Free Software Foundation; either version 2 15 + * of the License, or (at your option) any later version. 16 + * 17 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 18 + * KIND, either express or implied. 19 + * 20 + ****************************************************************************/ 21 + #include "powermgmt.h" 22 + #include "power.h" 23 + 24 + /* FIXME: Haven't adjusted these values besides max voltage */ 25 + // max voltage is 4370 26 + 27 + unsigned short battery_level_disksafe = 3470; 28 + 29 + /* the OF shuts down at this voltage */ 30 + unsigned short battery_level_shutoff = 3400; 31 + 32 + /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ 33 + unsigned short percent_to_volt_discharge[11] = 34 + { 35 + 3400, 3675, 3715, 3750, 3775, 3810, 3850, 4028, 4125, 4237, 4376 36 + }; 37 + 38 + /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ 39 + unsigned short percent_to_volt_charge[11] = 40 + { 41 + 3485, 3780, 3836, 3857, 3890, 3930, 3986, 4028, 4125, 4237, 4376 42 + };
+29
firmware/target/hosted/hiby/system-target.h
··· 1 + /*************************************************************************** 2 + * __________ __ ___. 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2017 Marcin Bukat 10 + * Copyright (C) 2016 Amaury Pouly 11 + * Copyright (C) 2025 by Melissa Autumn 12 + * 13 + * This program is free software; you can redistribute it and/or 14 + * modify it under the terms of the GNU General Public License 15 + * as published by the Free Software Foundation; either version 2 16 + * of the License, or (at your option) any later version. 17 + * 18 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 + * KIND, either express or implied. 20 + * 21 + ****************************************************************************/ 22 + #ifndef __SYSTEM_TARGET_H__ 23 + #define __SYSTEM_TARGET_H__ 24 + 25 + #include "kernel-unix.h" 26 + #include "system-hosted.h" 27 + 28 + #define NEED_GENERIC_BYTESWAPS 29 + #endif /* __SYSTEM_TARGET_H__ */
+323
firmware/target/hosted/hiby/usb-hiby-gadget.c
··· 1 + /*************************************************************************** 2 + * __________ __ ___ 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2018 by Marcin Bukat 10 + * Copyright (C) 2025 by Melissa Autumn 11 + * 12 + * This program is free software; you can redistribute it and/or 13 + * modify it under the terms of the GNU General Public License 14 + * as published by the Free Software Foundation; either version 2 15 + * of the License, or (at your option) any later version. 16 + * 17 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 18 + * KIND, either express or implied. 19 + * 20 + ****************************************************************************/ 21 + 22 + #include <dirent.h> 23 + #include <stdlib.h> 24 + #include <sys/mount.h> 25 + #include <string.h> 26 + #include <unistd.h> 27 + #include "config.h" 28 + #include "dir.h" 29 + #include "disk.h" 30 + #include "usb.h" 31 + #include "sysfs.h" 32 + #include "power.h" 33 + #include "usb-hiby-gadget.h" 34 + 35 + #ifdef HAVE_GENERAL_PURPOSE_LED 36 + #include "led-general-purpose.h" 37 + #endif 38 + 39 + #define LOGF_ENABLE 40 + #include "logf.h" 41 + #include <stdio.h> 42 + 43 + static int _usb_mode = -1; 44 + static bool _usb_init = false; 45 + static bool is_adb_running = false; 46 + 47 + void enable_adb(void); 48 + void enable_mass_storage(void); 49 + void enable_charging(void); 50 + void enable_usb_audio(void); 51 + 52 + void disable_adb(void); 53 + void disable_mass_storage(void); 54 + void disable_usb_audio(void); 55 + 56 + #ifdef HAVE_MULTIDRIVE 57 + void cleanup_rbhome(void); 58 + void startup_rbhome(void); 59 + #endif 60 + 61 + void hiby_set_usb_mode(int mode) { 62 + logf(">>>>>>>>>>>>>>>>> hiby_set_usb_mode(%d)\n", mode); 63 + if (!_usb_init) { 64 + logf("Need to init usb!\n"); 65 + usb_init_device(); 66 + } 67 + 68 + switch(mode) { 69 + case USB_MODE_MASS_STORAGE: 70 + logf("Enabling Mass Storage\n"); 71 + enable_mass_storage(); 72 + break; 73 + case USB_MODE_CHARGE: 74 + logf("Enabling Charge\n"); 75 + enable_charging(); 76 + break; 77 + default: 78 + break; 79 + } 80 + 81 + _usb_mode = mode; 82 + } 83 + 84 + /* TODO: implement usb detection properly */ 85 + int usb_detect(void) 86 + { 87 + #ifdef HAVE_GENERAL_PURPOSE_LED 88 + led_hw_on(); 89 + #endif 90 + return power_input_status() == POWER_INPUT_USB_CHARGER ? USB_INSERTED : USB_EXTRACTED; 91 + } 92 + 93 + void usb_enable(bool on) 94 + { 95 + logf(">>>>>>>>>>>>>>>>> usb_enable(%d)\n", on); 96 + logf("usb enable %d %d\n", on, _usb_mode); 97 + 98 + /* Ignore usb enable/disable when ADB is enabled so we can fireup adb shell 99 + * without entering ums mode 100 + */ 101 + //if (_usb_mode != USB_MODE_ADB) { 102 + sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/UDC", on ? "13500000.otg_new" : ""); 103 + //} 104 + } 105 + 106 + /* This is called by usb thread after usb extract in order to return 107 + * regular FS access 108 + * 109 + * returns the # of successful mounts 110 + */ 111 + int disk_mount_all(void) 112 + { 113 + logf(">>>>>>>>>>>>>>>>> disk_mount_all()\n"); 114 + 115 + #ifdef HAVE_MULTIDRIVE 116 + startup_rbhome(); 117 + #endif 118 + return 1; 119 + } 120 + 121 + /* This is called by usb thread after all threads ACKs usb inserted message 122 + * 123 + * returns the # of successful unmounts 124 + */ 125 + int disk_unmount_all(void) 126 + { 127 + // We're always mounted as rockbox lives on the sdcard 128 + logf(">>>>>>>>>>>>>>>>> disk_unmount_all()\n"); 129 + 130 + #ifdef HAVE_MULTIDRIVE 131 + cleanup_rbhome(); 132 + #endif 133 + 134 + #ifdef HAVE_MULTIDRIVE 135 + startup_rbhome(); 136 + #endif 137 + 138 + return 1; 139 + } 140 + 141 + void enable_charging(void) { 142 + logf(">>>>>>>>>>>>>>>>> enable_charging()\n"); 143 + 144 + disable_mass_storage(); 145 + disable_adb(); 146 + } 147 + 148 + #if 1 149 + void enable_adb(void) { 150 + logf(">>>>>>>>>>>>>>>>> set_adb()\n"); 151 + 152 + // Disable mass storage if it was running 153 + disable_mass_storage(); 154 + 155 + // Remove any lingering adb daemon 156 + system("killall -9 adbd"); 157 + 158 + system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409"); 159 + system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo/functions/ffs.adb"); 160 + 161 + // Now we'll override configuration and MaxPower 162 + sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", "adb"); 163 + sysfs_set_int("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/MaxPower", 120); 164 + 165 + // And link up the adb function to the usb gadget config 166 + system("ln -s /sys/kernel/config/usb_gadget/adb_demo/functions/ffs.adb /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/"); 167 + 168 + int is_mounted = !system("mountpoint -q /dev/usb-ffs/adb"); 169 + 170 + if (!is_mounted) { 171 + system("mkdir -p /dev/usb-ffs/adb"); 172 + /* This seems to fail, but adb will still work and then it will be mounted. Not sure what's up here... */ 173 + system("mount -t functionfs adb /dev/usb-ffs/adb"); 174 + } 175 + 176 + // Boot adb daemon 177 + system("/usr/bin/adbd &"); 178 + } 179 + 180 + 181 + void disable_adb(void) { 182 + // Remove any lingering adb daemon 183 + system("killall -9 adbd"); 184 + 185 + // Remove the adb link to config 186 + if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/ffs.adb", F_OK) == 0) { 187 + system("rm /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/ffs.adb"); 188 + } 189 + 190 + // Remove the adb function 191 + if (access("/sys/kernel/config/usb_gadget/adb_demo/functions/ffs.adb", F_OK) == 0) { 192 + system("rm -rf /sys/kernel/config/usb_gadget/adb_demo/functions/ffs.adb"); 193 + } 194 + 195 + // Reset the MaxPower to its default value 196 + if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/MaxPower", F_OK) == 0) { 197 + sysfs_set_int("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/MaxPower", 120); 198 + } 199 + 200 + // Disable storage or adb configs 201 + if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", F_OK) == 0) { 202 + sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", ""); 203 + } 204 + 205 + // Unmount adb 206 + if (!system("mountpoint -q /dev/usb-ffs/adb")) { 207 + system("unmount /dev/usb-ffs/adb"); 208 + } 209 + } 210 + #else 211 + void enable_adb(void) {} 212 + void disable_adb(void) {} 213 + #endif 214 + 215 + void enable_mass_storage(void) { 216 + logf(">>>>>>>>>>>>>>>>> set_mass_storage()\n"); 217 + 218 + // Disable adb if it's running 219 + disable_adb(); 220 + 221 + system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo/functions/mass_storage.0/lun.0"); 222 + system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409"); 223 + 224 + if (is_adb_running) { 225 + sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", "adb,storage"); 226 + } else { 227 + sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", "storage"); 228 + } 229 + sysfs_set_int("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/MaxPower", 120); 230 + 231 + system("ln -s /sys/kernel/config/usb_gadget/adb_demo/functions/mass_storage.0 /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/"); 232 + 233 + char mount_device[32] = "/dev/mmcblk0p1"; 234 + 235 + // If partition 1 doesn't exist we'll try the main device 236 + if (access(mount_device, F_OK) != 0) { 237 + memset(mount_device, 0, sizeof(mount_device)); 238 + strcpy(mount_device, "/dev/mmcblk0"); 239 + } 240 + 241 + sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/functions/mass_storage.0/lun.0/file", mount_device); 242 + } 243 + 244 + void disable_mass_storage(void) { 245 + // Remove the mass_storage.0 link to config 246 + if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/mass_storage.0", F_OK) == 0) { 247 + system("rm /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/mass_storage.0"); 248 + } 249 + 250 + // Remove the mass_storage.0 function 251 + if (access("/sys/kernel/config/usb_gadget/adb_demo/functions/mass_storage.0", F_OK) == 0) { 252 + system("rm -rf /sys/kernel/config/usb_gadget/adb_demo/functions/mass_storage.0"); 253 + } 254 + 255 + // Reset the MaxPower to its default value 256 + if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/MaxPower", F_OK) == 0) { 257 + sysfs_set_int("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/MaxPower", 120); 258 + } 259 + 260 + // Disable storage or adb configs 261 + if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", F_OK) == 0) { 262 + sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", ""); 263 + } 264 + } 265 + 266 + #if defined(HAVE_USB_AUDIO) 267 + void enable_usb_audio(void) { 268 + 269 + } 270 + 271 + void disable_usb_audio(void) { 272 + 273 + } 274 + #else 275 + void enable_usb_audio(void) {} 276 + void disable_usb_audio(void) {} 277 + #endif 278 + 279 + void usb_init_device(void) 280 + { 281 + logf(">>>>>>>>>>>>>>>>> usb_init_device()\n"); 282 + if (_usb_init) { 283 + logf("usb is already init, skipping!\n"); 284 + return; 285 + } 286 + 287 + char functions[128] = {0}; 288 + 289 + /* Before we can do anything here we need to mount configfs */ 290 + int is_mounted = !system("mountpoint -q /sys/kernel/config"); 291 + 292 + if (!is_mounted && system("mount -t configfs none /sys/kernel/config")) { 293 + logf("mount configfs failed, can't do usb functionality! ErrNo: %d\n", errno); 294 + return; 295 + } 296 + 297 + _usb_init = true; 298 + 299 + system("ls -la /sys/kernel/config/usb_gadget"); 300 + 301 + /* os_mkdir doesn't seem to work here for whatever reason */ 302 + system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo"); 303 + system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo/strings/0x409"); 304 + 305 + system("ls -la /sys/kernel/config/usb_gadget/adb_demo"); 306 + system("ls -la /sys/kernel/config/usb_gadget/adb_demo/configs/"); 307 + 308 + system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409"); 309 + 310 + /* Check if ADB was activated in bootloader */ 311 + logf("checking if adb is already on\n"); 312 + 313 + if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", F_OK) == 0) { 314 + logf("found usb config string!\n"); 315 + 316 + sysfs_get_string("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", functions, sizeof(functions)); 317 + is_adb_running = (strstr(functions, "adb") == NULL) ? false : true; 318 + } 319 + 320 + sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/strings/0x409/manufacturer", "Rockbox.org"); 321 + sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/strings/0x409/product", "Rockbox media player"); 322 + sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/strings/0x409/serialnumber", "0123456789ABCDEF"); 323 + }
+30
firmware/target/hosted/hiby/usb-hiby-gadget.h
··· 1 + /*************************************************************************** 2 + * __________ __ ___ 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * 9 + * Copyright (C) 2025 by Melissa Autumn 10 + * 11 + * This program is free software; you can redistribute it and/or 12 + * modify it under the terms of the GNU General Public License 13 + * as published by the Free Software Foundation; either version 2 14 + * of the License, or (at your option) any later version. 15 + * 16 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 17 + * KIND, either express or implied. 18 + * 19 + ****************************************************************************/ 20 + #ifndef __USB_HIBY_H__ 21 + #define __USB_HIBY_H__ 22 + 23 + #include <stdbool.h> 24 + 25 + /** 26 + * Handle the setting and unsetting of adb usb mode 27 + */ 28 + void hiby_set_usb_mode(int mode); 29 + 30 + #endif /* __USB_HIBY_H__ */
+11
firmware/target/hosted/power-linux.c
··· 39 39 # define BATTERY_VOLTAGE_PATH BATTERY_SYSFS_PATH "/voltage_now" 40 40 # define BATTERY_CURRENT_PATH BATTERY_SYSFS_PATH "/current_now" 41 41 # define BATTERY_LEVEL_PATH BATTERY_SYSFS_PATH "/capacity" 42 + # define BATTERY_TTE_PATH BATTERY_SYSFS_PATH "/time_to_empty_now" 42 43 #endif 43 44 44 45 /* Voltage is normally in microvolts */ ··· 114 115 sysfs_get_int(BATTERY_LEVEL_PATH, &level); 115 116 116 117 return (level * BATTERY_LEVEL_SCALE_MUL) / BATTERY_LEVEL_SCALE_DIV; 118 + } 119 + #endif 120 + 121 + #if (CONFIG_BATTERY_MEASURE & TIME_MEASURE) 122 + int _battery_time(void) 123 + { 124 + int battery_tte = 0; 125 + sysfs_get_int(BATTERY_TTE_PATH, &battery_tte); 126 + 127 + return battery_tte; 117 128 } 118 129 #endif 119 130 #endif
+14
firmware/target/hosted/sdl/sim-ui-defines.h
··· 544 544 #define UI_LCD_POSY 78 545 545 546 546 547 + #elif defined(HIBY_R3PROII) 548 + #define UI_TITLE "Hiby R3 Pro II" 549 + #define UI_WIDTH 645 550 + #define UI_HEIGHT 924 551 + #define UI_LCD_POSX 79 552 + #define UI_LCD_POSY 63 553 + 554 + #elif defined(HIBY_R1) 555 + #define UI_TITLE "Hiby R1" 556 + #define UI_WIDTH 634 557 + #define UI_HEIGHT 1016 558 + #define UI_LCD_POSX 77 559 + #define UI_LCD_POSY 74 560 + 547 561 #elif defined(SIMULATOR) 548 562 #error no UI defines 549 563 #endif
+15 -5
firmware/target/hosted/system-hosted.c
··· 62 62 unsigned long pc = uc->uc_mcontext.pc; 63 63 unsigned long sp = uc->uc_mcontext.gregs[29]; 64 64 65 - lcd_putsf(0, line++, "%s at %08x", strsignal(sig), pc); 65 + lcd_putsf(0, line++, "%s at %08lx", strsignal(sig), pc); 66 66 67 - if(sig == SIGILL || sig == SIGFPE || sig == SIGSEGV || sig == SIGBUS || sig == SIGTRAP) 67 + if(sig == SIGILL || sig == SIGFPE || sig == SIGSEGV || sig == SIGBUS || sig == SIGTRAP) { 68 68 lcd_putsf(0, line++, "address %p", siginfo->si_addr); 69 + } 69 70 70 71 if(!triggered) 71 72 { ··· 82 83 83 84 system_exception_wait(); /* If this returns, try to reboot */ 84 85 system_reboot(); 85 - while (1); /* halt */ 86 + while (1) { 87 + // Make sure we're not throttling the cpu 88 + usleep(1000); 89 + } 86 90 } 87 91 88 92 void power_off(void) ··· 90 94 backlight_hw_off(); 91 95 sync(); 92 96 system("/sbin/poweroff"); 93 - while (1); /* halt */ 97 + while (1) { 98 + // Make sure we're not throttling the cpu 99 + usleep(1000); 100 + } 94 101 } 95 102 96 103 void system_init(void) ··· 117 124 { 118 125 backlight_hw_off(); 119 126 system("/sbin/reboot"); 120 - while (1); /* halt */ 127 + while (1) { 128 + // Make sure we're not throttling the cpu 129 + usleep(1000); 130 + } 121 131 } 122 132 123 133 void system_exception_wait(void)
+6
firmware/usb.c
··· 51 51 #include "gui/skin_engine/skin_engine.h" 52 52 #endif 53 53 54 + #if defined(HIBY_R3PROII) || defined(HIBY_R1) 55 + #include "usb-hiby-gadget.h" 56 + #endif 57 + 54 58 #if defined(IPOD_ACCESSORY_PROTOCOL) 55 59 #include "iap.h" 56 60 #endif ··· 161 165 usb_mode = mode; 162 166 #if defined(DX50) || defined(DX90) 163 167 ibasso_set_usb_mode(mode); 168 + #elif defined(HIBY_R3PROII) || defined(HIBY_R1) 169 + hiby_set_usb_mode(mode); 164 170 #endif 165 171 } 166 172 #endif
+3 -1
tools/buildzip.pl
··· 660 660 # until buildwps.pl is fixed, manually copy the classic_statusbar theme across 661 661 mkdir "$temp_dir/wps/classic_statusbar", 0777; 662 662 glob_copy("$ROOT/wps/classic_statusbar/*.bmp", "$temp_dir/wps/classic_statusbar"); 663 - if ($depth == 16) { 663 + if ($depth >= 16 && $height > 480) { 664 + copy("$ROOT/wps/classic_statusbar.24.sbs", "$temp_dir/wps/classic_statusbar.sbs"); 665 + } elsif ($depth == 16) { 664 666 copy("$ROOT/wps/classic_statusbar.sbs", "$temp_dir/wps"); 665 667 } elsif ($depth > 1) { 666 668 copy("$ROOT/wps/classic_statusbar.grey.sbs", "$temp_dir/wps/classic_statusbar.sbs");
+58 -3
tools/configure
··· 1736 1736 244) M3K Linux 249) Eros Q / K native 1737 1737 246) M3K baremetal ==xDuoo== (hw4 bl only) 1738 1738 241) X3 1739 - ==Shanling== 242) X3II ==Nintendo== 1740 - 260) Q1 243) X20 290) Nintendo 3DS (WIP) 1741 - 1739 + ==Shanling== 242) X3II ==HiBy== 1740 + 260) Q1 243) X20 300) R3 Pro II 1741 + 301) R1 1742 1742 ==Echo project== ==Surfans== 1743 1743 270) Echo R1 (WIP) 280) F28 (WIP) 1744 + 1745 + ==Nintendo== 1746 + 290) Nintendo 3DS (WIP) 1747 + 1744 1748 EOF 1745 1749 1746 1750 buildfor=`input`; ··· 4388 4392 t_manufacturer="ctru" 4389 4393 t_model="app" 4390 4394 ;; 4395 + 4396 + 300|hibyr3proii) 4397 + target_id=123 4398 + application=yes 4399 + app_type="hibyos" 4400 + modelname="hibyr3proii" 4401 + target="HIBY_R3PROII" 4402 + memory=16 # The device has 64mb but let's make sure it still boots with things in the background 4403 + mipsellinuxcc 4404 + tool="cp " 4405 + boottool="cp " 4406 + bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" 4407 + bmp2rb_native="$rootdir/tools/bmp2rb -f 4" 4408 + output="rockbox.r3proii" 4409 + bootoutput="bootloader.r3proii" 4410 + appextra="recorder:gui:hosted" 4411 + plugins="yes" 4412 + # architecture, manufacturer and model for the target-tree build 4413 + # These align with 4414 + t_cpu="hosted" 4415 + t_manufacturer="hiby" 4416 + t_model="r3proii" 4417 + sysfontbl="24-Terminus" 4418 + sysfont="20-Terminus" 4419 + ;; 4420 + 4421 + 301|hibyr1) 4422 + target_id=124 4423 + application=yes 4424 + app_type="hibyos" 4425 + modelname="hibyr1" 4426 + target="HIBY_R1" 4427 + memory=16 # The device has 64mb but let's make sure it still boots with things in the background 4428 + mipsellinuxcc 4429 + tool="cp " 4430 + boottool="cp " 4431 + bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" 4432 + bmp2rb_native="$rootdir/tools/bmp2rb -f 4" 4433 + output="rockbox.r1" 4434 + bootoutput="bootloader.r1" 4435 + appextra="recorder:gui:hosted" 4436 + plugins="yes" 4437 + # architecture, manufacturer and model for the target-tree build 4438 + # These align with 4439 + t_cpu="hosted" 4440 + t_manufacturer="hiby" 4441 + t_model="r1" 4442 + sysfontbl="24-Terminus" 4443 + sysfont="20-Terminus" 4444 + ;; 4445 + 4391 4446 4392 4447 *) 4393 4448 echo "Please select a supported target platform!"
+10
tools/r1_patcher/hiby_player.sh
··· 1 + #!/bin/sh 2 + 3 + killall hiby_player &>/dev/null 4 + killall -9 hiby_player &>/dev/null 5 + 6 + killall bootloader.r1 &>/dev/null 7 + killall -9 bootloader.r1 &>/dev/null 8 + 9 + /usr/bin/bootloader.r1 10 + sleep 1s
+133
tools/r1_patcher/r1_patcher.sh
··· 1 + #!/bin/bash 2 + 3 + if [[ $# -ne 2 ]]; then 4 + echo 'usage: ./r1_patcher.sh r1.upt bootloader.r1' >&2 5 + exit 1 6 + fi 7 + 8 + ################################################################################ 9 + ### init 10 + ################################################################################ 11 + 12 + currentdir=$(pwd) 13 + updatefile="$(basename $1)" 14 + updatefile_rb="${updatefile%.*}_rb.upt" 15 + 16 + workingdir=$(realpath ./working_dir) 17 + workingdir_in=$workingdir"/in" 18 + workingdir_out=$workingdir"/out" 19 + 20 + rm -rf $workingdir 21 + 22 + mkdir $workingdir 23 + mkdir $workingdir_in 24 + mkdir $workingdir_out 25 + 26 + ################################################################################ 27 + ### extract 28 + ################################################################################ 29 + 30 + # extract iso 31 + mkdir -p $workingdir_in/image_contents 32 + 7z -o$workingdir_in/image_contents x $updatefile 33 + 34 + # create xImage (unchanged) 35 + mkdir -p $workingdir_out/xImage 36 + cat $workingdir_in/image_contents/ota_v0/xImage.* > $workingdir_out/xImage/xImage 37 + 38 + # create rootfs 39 + mkdir -p $workingdir_in/rootfs 40 + mkdir -p $workingdir_in/rootfs/extracted 41 + cat $workingdir_in/image_contents/ota_v0/rootfs.squashfs.* > $workingdir_in/rootfs/rootfs.squashfs 42 + 43 + # extract rootfs 44 + unsquashfs -f -d $workingdir_in/rootfs/extracted $workingdir_in/rootfs/rootfs.squashfs 45 + 46 + ################################################################################ 47 + ### update 48 + ################################################################################ 49 + 50 + # copy 'bootloader' 51 + cp $2 $workingdir_in/rootfs/extracted/usr/bin/ 52 + 53 + # copy modified 'hibyplayer.sh' script 54 + cp hiby_player.sh $workingdir_in/rootfs/extracted/usr/bin/ 55 + chmod 0755 $workingdir_in/rootfs/extracted/usr/bin/hiby_player.sh 56 + 57 + ################################################################################ 58 + ### rebuild 59 + ################################################################################ 60 + 61 + mkdir "$workingdir_out/image_contents" 62 + mkdir "$workingdir_out/image_contents/ota_v0" 63 + 64 + mksquashfs $workingdir_in/rootfs/extracted $workingdir_out/rootfs.squashfs -comp lzo 65 + 66 + cd "$workingdir_out/image_contents/ota_v0" 67 + 68 + # rootfs.squashfs 69 + split -b 512k $workingdir_out/rootfs.squashfs --numeric-suffixes=0 -a 4 rootfs.squashfs. 70 + 71 + rootfs_md5=($(md5sum $workingdir_out/rootfs.squashfs)) 72 + rootfs_size=$(stat -c%s "$workingdir_out/rootfs.squashfs") 73 + md5=$rootfs_md5 74 + 75 + ota_md5_rootfs="ota_md5_rootfs.squashfs.$md5" 76 + 77 + parts=`find . -name 'rootfs.squashfs.*'` 78 + for part in $parts; do 79 + md5next=($(md5sum $part)) 80 + echo $md5next >> $ota_md5_rootfs 81 + mv $part "$part.$md5" 82 + md5=$md5next 83 + done 84 + 85 + # xImage 86 + split -b 512k $workingdir_out/xImage/xImage --numeric-suffixes=0 -a 4 xImage. 87 + 88 + ximage_md5=($(md5sum $workingdir_out/xImage/xImage)) 89 + ximage_size=$(stat -c%s "$workingdir_out/xImage/xImage") 90 + md5=$ximage_md5 91 + 92 + ota_md5_xImage="ota_md5_xImage.$md5" 93 + 94 + parts=`find . -name 'xImage.*'` 95 + for part in $parts; do 96 + md5next=($(md5sum $part)) 97 + echo $md5next >> $ota_md5_xImage 98 + mv $part "$part.$md5" 99 + md5=$md5next 100 + done 101 + 102 + # ota_update.in 103 + 104 + echo "ota_version=0 105 + 106 + img_type=kernel 107 + img_name=xImage 108 + img_size=$ximage_size 109 + img_md5=$ximage_md5 110 + 111 + img_type=rootfs 112 + img_name=rootfs.squashfs 113 + img_size=$rootfs_size 114 + img_md5=$rootfs_md5 115 + " > ota_update.in 116 + 117 + echo > ota_v0.ok 118 + 119 + # ota_config.in 120 + cd "$workingdir_out/image_contents" 121 + 122 + echo "current_version=0" > ota_config.in 123 + 124 + # iso 125 + genisoimage -f -U -J -joliet-long -r -allow-lowercase -allow-multidot -o $currentdir/$updatefile_rb $workingdir_out/image_contents/ 126 + 127 + ################################################################################ 128 + ### cleanup 129 + ################################################################################ 130 + 131 + rm -rf $workingdir 132 + 133 + exit 0
+6
tools/root.make
··· 105 105 ifneq (,$(findstring bootloader,$(APPSDIR))) 106 106 ifneq (,$(findstring sonynwz,$(APP_TYPE))) 107 107 include $(ROOTDIR)/firmware/target/hosted/sonynwz/sonynwz.make 108 + else ifneq (,$(findstring hiby_x1600,$(APP_TYPE))) 109 + include $(ROOTDIR)/firmware/target/hosted/hiby/hiby.make 108 110 else ifneq (,$(findstring hibyos,$(APP_TYPE))) 109 111 include $(ROOTDIR)/firmware/target/hosted/hibyos.make 110 112 else ifneq (,$(findstring fiio,$(APP_TYPE))) ··· 147 149 148 150 ifneq (,$(findstring sonynwz,$(APP_TYPE))) 149 151 include $(ROOTDIR)/firmware/target/hosted/sonynwz/sonynwz.make 152 + endif 153 + 154 + ifneq (,$(findstring hiby_x1600,$(APP_TYPE))) 155 + include $(ROOTDIR)/firmware/target/hosted/hiby/hiby.make 150 156 endif 151 157 152 158 ifneq (,$(findstring hibyos,$(APP_TYPE)))
uisimulator/bitmaps/UI-hibyr1.bmp

This is a binary file and will not be displayed.

uisimulator/bitmaps/UI-hibyr3proii.bmp

This is a binary file and will not be displayed.

+2
uisimulator/buttonmap/SOURCES
··· 91 91 shanling-q1.c 92 92 #elif CONFIG_KEYPAD == RG_NANO_PAD 93 93 rg-nano.c 94 + #elif CONFIG_KEYPAD == HIBY_R3PROII_PAD 95 + hiby-r3proii.c 94 96 #endif 95 97 #endif /* SIMULATOR */
+34
uisimulator/buttonmap/hiby-r3proii.c
··· 1 + /*************************************************************************** 2 + * __________ __ ___. 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 + * $Id$ 9 + * 10 + * Copyright (C) 2021 by Solomon Peachy 11 + * 12 + * This program is free software; you can redistribute it and/or 13 + * modify it under the terms of the GNU General Public License 14 + * as published by the Free Software Foundation; either version 2 15 + * of the License, or (at your option) any later version. 16 + * 17 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 18 + * KIND, either express or implied. 19 + * 20 + ****************************************************************************/ 21 + 22 + 23 + #include <SDL.h> 24 + #include "button.h" 25 + #include "buttonmap.h" 26 + 27 + int key_to_button(int keyboard_button) 28 + { 29 + return BUTTON_NONE; 30 + } 31 + 32 + struct button_map bm[] = { 33 + { 0, 0, 0, 0, "None" } 34 + };
+12
wps/WPSLIST
··· 78 78 79 79 <main> 80 80 81 + # touch override 82 + wps.480x720x(16|24|32): cabbiev2.480x720x16.touch.wps 83 + 84 + 81 85 # override implicit .wps filename 82 86 wps.800x480x(16|24|32): cabbiev2.800x480x16.wps 83 87 wps.480x800x(16|24|32): cabbiev2.480x800x16.wps ··· 110 114 fms.128x128x2: cabbiev2-128x128x2.fms 111 115 112 116 # Preferred font (including .fnt extension - leave blank for player): 117 + Font.480x720x(16|24|32): 35-Adobe-Helvetica.fnt 118 + 113 119 Font.800x480x(16|24|32): 35-Adobe-Helvetica.fnt 114 120 Font.480x800x(16|24|32): 35-Adobe-Helvetica.fnt 115 121 Font.400x240x(16|24|32): 15-Adobe-Helvetica.fnt ··· 145 151 filetype colours: - 146 152 147 153 #backdrop - remember this is the source file name in your SVN folder, not dest name! 154 + backdrop.480x720x(16|24|32): backdrops/cabbiev2.480x720x16.bmp 155 + 148 156 backdrop.800x480x(16|24|32): backdrops/cabbiev2.800x480x16.bmp 149 157 backdrop.480x800x(16|24|32): backdrops/cabbiev2.480x800x16.bmp 150 158 backdrop.400x240x(16|24|32): backdrops/cabbiev2.400x240x16.bmp ··· 173 181 selector type..+x(16|24|32): bar (gradient) 174 182 175 183 #icons 184 + iconset.480x720x(16|24|32): icons/tango_icons.32x32.bmp 185 + 176 186 iconset.800x480x(16|24|32): icons/tango_icons.32x32.bmp 177 187 iconset.480x800x(16|24|32): icons/tango_icons.32x32.bmp 178 188 iconset.400x240x(16|24|32): icons/tango_icons.16x16.bmp ··· 194 204 iconset..+x2: icons/tango_small_mono.bmp 195 205 196 206 #viewer icons 207 + viewers iconset.480x720x(16|24|32): icons/tango_icons_viewers.32x32.bmp 208 + 197 209 viewers iconset.800x480x(16|24|32): icons/tango_icons_viewers.32x32.bmp 198 210 viewers iconset.480x800x(16|24|32): icons/tango_icons_viewers.32x32.bmp 199 211 viewers iconset.400x240x(16|24|32): icons/tango_icons_viewers.16x16.bmp
+119
wps/cabbiev2.480x720x16.touch.wps
··· 1 + # Cabbie v2.0 2 + # (C) 2007-2012 The Authors (see /rockbox/wps/AUTHORS) 3 + # Derived from "cabbie" (C) Yohann Misquitta 4 + # 5 + # TODO: 6 + # * images for battery, hold button 7 + %wd 8 + %X(wpsbackdrop-480x720x16.bmp) 9 + 10 + #%xl(A,lock-240x320x16.bmp,11,0,2) 11 + #%xl(B,battery-240x320x16.bmp,46,0,10) 12 + %xl(C,volume-480x800x16.bmp,145,125,10) 13 + %xl(D,shuffle-480x800x16.bmp,240,133) 14 + %xl(E,repeat-480x800x16.bmp,343,121,4) 15 + %xl(F,playmode-480x800x16.bmp,403,119,5) 16 + %xl(G,popup-480x800x16.bmp,0,0) 17 + %xl(H,rew-480x800x16.bmp,0,5) 18 + %xl(I,ff-480x800x16.bmp,70,5) 19 + %xl(vol,volumebar-480x800x16.bmp,0,0) 20 + %xl(volbd,volumebar-backdrop-480x800x16.bmp,0,0) 21 + 22 + %Cl(0,0,275,275,c,c) 23 + %?C<%Vd(c)|%Vd(a)> 24 + %?vg(show_vol)<%?C<%Vd(d)|%Vd(b)>|%Vd(t)|%Vd(vol)> 25 + 26 + # now playing text bar 27 + %V(0,28,-,42,-) 28 + %ac%Sx(Now Playing) 29 + 30 + # track & next track info - no AA 31 + %Vl(a,0,102,-,180,-) 32 + # tap on current title info for playlist (ie. where albumart would normally be) 33 + %T(0,0,275,275,playlist) 34 + 35 + %s%ac%?id<%id|%?d(1)<%d(1)|%(root%)>> 36 + %s%ac%?it<%it|%fn> 37 + %s%ac%?ia<%ia|%?iA<%iA|%?d(2)<%d(2)|%(root%)>>> 38 + %ac%?iy<%iy|> 39 + %Vl(b,0,320,-,180,-) 40 + %ac%?ig<%ig|> 41 + %ac%?fv<%(vbr%) |>%fb kbit/s %fc 42 + %s%ac%?Ia<%Ia|%?IA<%IA|%?D(2)<%D(2)|%(root%)>>> 43 + %ac%Sx(Next Track:) 44 + %ac%s%?It<%It|%Fn> 45 + # 46 + # album art viewport 47 + # 48 + %Vl(c,102,75,275,275,-) 49 + # tap on the cover art for playlist 50 + %T(0,0,275,275,playlist) 51 + %Cd 52 + 53 + # current track info - AA 54 + %Vl(d,0,370,-,-200,-) 55 + %s%ac%?id<%id|%?d(1)<%d(1)|%(root%)>> 56 + %s%ac%?it<%it|%fn> 57 + %s%ac%?ia<%ia|%?iA<%iA|%?d(2)<%d(2)|%(root%)>>> 58 + 59 + # next track info - AA 60 + %Vl(d,0,470,-,-200,-) 61 + %?C<%s%ac%Sx(Next:) %?Ia<%Ia|%?IA<%IA|%?D(2)<%D(2)|%(root%)>>> - %?It<%It|%Fn>|%s%ac%?Id<%Id|%?D(1)<%D(1)|%(root%)>>> 62 + 63 + # playtime 64 + %V(20,580,440,36,-) 65 + %pc%ac%?Sr<%pe %Sx(of) %pp|%pp %Sx(of) %pe>%ar%pr 66 + 67 + # progressbar and bottom icons 68 + %V(0,520,-,-,-) 69 + %pb(25,11,430,-,pb-480x800x16.bmp) 70 + %T(25,0,430,50,progressbar) 71 + 72 + #%?mh<%xd(Aa)|%xd(Ab)> 73 + #%?bp<%?bc<%xd(Ba)|%xd(Bb)>|%?bl<|%xd(Bc)|%xd(Bd)|%xd(Be)|%xd(Bf)|%xd(Bg)|%xd(Bh)|%xd(Bi)|%xd(Bj)>> 74 + # volume 75 + %?pv<%xd(Ca)|%xd(Cb)|%xd(Cc)|%xd(Cd)|%xd(Ce)|%xd(Cf)|%xd(Cg)|%xd(Ch)|%xd(Ci)|%xd(Cj)> 76 + %T(small_vol,145,125,88,60,none) 77 + # 78 + # shuffle 79 + %?ps<%xd(D)> 80 + %T(237,130,100,50,shuffle) 81 + # 82 + # repeat 83 + %xd(E, %mm, -1) 84 + %T(340,121,50,70,repmode) 85 + # 86 + # playmode 87 + %?Tp<%?mp<%xd(F, 1)|%xd(F, 3)|%xd(F, 2)|%xd(F, 4)|%xd(F, 5)||||>|%xd(F, %mp)> 88 + %T(400,119,70,75,play) 89 + %T(400,119,70,75,stop, repeat_press) 90 + 91 + # 92 + # volume slider 93 + # 94 + %Vl(vol,14,295,452,205,-) 95 + %pv(0,0,452,205,image,vol,backdrop,volbd) 96 + %T(0,0,452,205,volume) 97 + 98 + # 99 + # popup osd menu 100 + # 101 + %Vl(t,14,295,452,205,-) 102 + %xd(G) 103 + %T(26,26,160,148,browse) 104 + %T(186,26,144,148,quickscreen) 105 + %T(304,26,123,148,contextmenu) 106 + 107 + # 108 + # ff/rewind button 109 + # 110 + %V(0,640,150,75,-) 111 + %xd(H)%xd(I) 112 + %T(0,0,70,75,rwd, repeat_press) 113 + %T(0,0,70,75,prev) 114 + %T(70,0,70,75,ffwd, repeat_press) 115 + %T(70,0,70,75,next) 116 + 117 + # needs to be at the end since touch regions need to be declared 118 + # before %Tl can be used 119 + %?Tl(small_vol,2.0)<%vs(show_vol,set,3)|%?mv(2.0)<%vs(show_vol,set,3)|%?Tl<%vs(show_vol,set,2)|%vs(show_vol,set,1)>>>
wps/cabbiev2/wpsbackdrop-480x720x16.bmp

This is a binary file and will not be displayed.

+96
wps/classic_statusbar.24.sbs
··· 1 + # Classic Statusbar 2 + # (C) 2007-2012 The Authors (see /rockbox/wps/AUTHORS) 3 + # 4 + # Classic statusbar adapted to skin engine 5 + # Standardized to a height of 24px for larger devices 6 + # 7 + # Status bar position can be changed from top to bottom by changing the y positions from 0 to -24 8 + # 9 + # Specify the UI area viewport... everything but a bar 24 pixels high at the top 10 + %Vi(-,0,24,-,-,1) 11 + 12 + # Conditional for showing volume as number or graphic 13 + %?if(%St(volume display), =, numeric)<%Vd(d)|%Vd(c)> 14 + 15 + # Conditional for showing battery as number or graphic 16 + %?if(%St(battery display), =, numeric)<%Vd(b)|%Vd(a)%Vd(e)> 17 + 18 + # Load some bitmaps 19 + %xl(B,battery.16.bmp,0,0,16) 20 + %xl(V,volume.16.bmp,2,0,17) 21 + %xl(S,status.16.bmp,0,0,15) 22 + %xl(D,access_disk.16.bmp,0,0) 23 + %xl(y,batter-y.16.bmp,0,0) 24 + 25 + %xl(m,rec_mpegbitrates.16.bmp,2,0,18) 26 + %xl(f,rec_frequencies.16.bmp,0,0,12) 27 + %xl(e,rec_encoders.16.bmp,0,0,3) 28 + %xl(c,rec_channels.16.bmp,26,0,2) 29 + 30 + # Enable the correct viewports 31 + %?cs<%Vd(c)%Vd(p)%Vd(r)%Vd(s)|%Vd(c)%Vd(p)%Vd(r)%Vd(s)|%Vd(z)|%Vd(c)%Vd(p)%Vd(r)%Vd(s)> 32 + 33 + # Charging animation viewports 34 + %t(2)%?bc<%Vd(x)|%Vd(a)>;%t(2)%Vd(a) 35 + 36 + # Battery area, Icons 37 + %Vl(a,4,6,34,14,0) 38 + %?bl<%xd(Ba)|%xd(Bb)|%xd(Bc)|%xd(Bd)|%xd(Be)|%xd(Bf)|%xd(Bg)|%xd(Bh)|%xd(Bi)|%xd(Bj)|%xd(Bk)|%xd(Bl)|%xd(Bm)|%xd(Bn)|%xd(Bo)> 39 + 40 + # Battery area, grey background viewport for charging animation 41 + %Vl(x,4,6,34,14,0)%Vb(555555) 42 + #%?bl<%xd(Ba)|%xd(Bb)|%xd(Bc)|%xd(Bd)|%xd(Be)|%xd(Bf)|%xd(Bg)|%xd(Bh)|%xd(Bi)|%xd(Bj)|%xd(Bk)|%xd(Bl)|%xd(Bm)|%xd(Bn)|%xd(Bo)> 43 + 44 + # end of battery symbol (to exclude it from animation) 45 + 46 + %Vl(e,38,6,6,14,0) 47 + %xd(y) 48 + 49 + # usb power or charger icon 50 + %V(44,6,16,16,0) 51 + %?bu<%xd(Sa)|%?bc<%xd(Sa)|%?bp<%xd(So)>>> 52 + 53 + # battery area, no icons 54 + %Vl(b,4,4,36,16,0) 55 + %ar%bl 56 + 57 + # Volume area 58 + %Vl(c,60,6,58,16,0) 59 + %?mv<%ac%?pv<%pv|%pv| %pv| %pv>|%?pv<%xd(Va)|%xd(Vb)|%xd(Vc)|%xd(Vd)|%xd(Ve)|%xd(Vf)|%xd(Vg)|%xd(Vh)|%xd(Vi)|%xd(Vj)|%xd(Vk)|%xd(Vl)|%xd(Vm)|%xd(Vn)|%xd(Vo)|%xd(Vp)|%xd(Vq)>> 60 + %Vl(d,60,4,58,16,0) 61 + %ac%?pv<%pv|%pv| %pv| %pv> 62 + 63 + # Icons, all in the same bmp strip, so need to use multiple viewports 64 + # Playback mode 65 + %Vl(p,118,6,18,16,0) 66 + %?mp<%xd(Sc)|%xd(Sb)|%xd(Sd)|%xd(Se)|%xd(Sf)|%xd(Sg)|%xd(Sh)|%xd(Si)|%xd(Sj)> 67 + 68 + # Repeat mode 69 + %Vl(r,136,6,18,16,0) 70 + %?mm<|%xd(Sk)|%xd(Sl)|%xd(Sm)|%xd(Sn)> 71 + 72 + # Shuffle mode 73 + %Vl(s,154,6,-,16,0) 74 + %?ps<%xd(Sm)|> 75 + 76 + 77 + # Recording section 78 + # encoder/mpeg bitrate 79 + %Vl(z,60,4,38,16,0) 80 + %?Rp<%?Re<%xd(ea)|%xd(eb)|%xd(ec)|%?Rb<%xd(ma)|%xd(mb)|%xd(mc)|%xd(md)|%xd(me)|%xd(mf)|%xd(mg)|%xd(mh)|%xd(mi)|%xd(mj)|%xd(mk)|%xd(ml)|%xd(mm)|%xd(mn)|%xd(mo)|%xd(mp)|%xd(mq)|%xd(mr)>>> 81 + # status icon 82 + %Vl(z,98,4,16,16,0) 83 + %?mp<%xd(Sc)|%xd(Sb)|%xd(Sd)|%xd(Se)|%xd(Sf)|%xd(Sg)|%xd(Sh)|%xd(Si)|%xd(Sj)> 84 + # frequency and channels 85 + %Vl(z,114,4,-,16,0) 86 + %?Rp<%?Rf<%xd(fa)|%xd(fb)|%xd(fc)|%xd(fd)|%xd(fe)|%xd(ff)|%xd(fg)|%xd(fh)|%xd(fi)|%xd(fj)|%xd(fk)|%xd(fl)>> 87 + %?Rm<%xd(ca)|%xd(cb)> 88 + 89 + # Clock on RTC able targets, and disk access 90 + # align on the right with room for 5 SYSFONT digits 91 + %V(-82,4,62,16,0) 92 + %?cc<%?ca<%?St(time format)<%cH|%cI>:%cM|--:-->|> 93 + 94 + # disk access icon 95 + %V(-20,6,-,16,0) 96 + %?lh<%xd(D)|>
wps/classic_statusbar/access_disk.16.bmp

This is a binary file and will not be displayed.

wps/classic_statusbar/batter-y.16.bmp

This is a binary file and will not be displayed.

wps/classic_statusbar/battery.16.bmp

This is a binary file and will not be displayed.

wps/classic_statusbar/rec_channels.16.bmp

This is a binary file and will not be displayed.

wps/classic_statusbar/rec_encoders.16.bmp

This is a binary file and will not be displayed.

wps/classic_statusbar/rec_frequencies.16.bmp

This is a binary file and will not be displayed.

wps/classic_statusbar/rec_mpegbitrates.16.bmp

This is a binary file and will not be displayed.

wps/classic_statusbar/status.16.bmp

This is a binary file and will not be displayed.

wps/classic_statusbar/volume.16.bmp

This is a binary file and will not be displayed.

+288
wps/template_fill.py
··· 1 + """ 2 + Rough script to scale up the existing classic_statusbar 3 + It will scale up by scale_pixel_size_by, and add padding specificed by 4 + padding_x/y. 5 + 6 + The status bar size will be determined by main_viewport_size_by. 7 + So if you want zero padding just make sure those two numbers are the same. 8 + 9 + This is all based on the 8px tall classic_statusbar, but this script can 10 + be adapted for different sbs or wps file. Just need to create a template 11 + which is just jinja template syntax on top of a sbs or wps. 12 + 13 + The images were hacked together, you specify their real image path 14 + from the wps folder, but it will hack off the asset folder because 15 + rockbox automatically adds it. Oops. 16 + """ 17 + from jinja2 import Environment, PackageLoader, select_autoescape 18 + from PIL import Image 19 + import os 20 + 21 + env = Environment( 22 + loader=PackageLoader("template_fill"), 23 + autoescape=select_autoescape() 24 + ) 25 + 26 + template = env.get_template("classic_statusbar.sbs.j2") 27 + 28 + original_pixel_size = 8 29 + padding_x = 4 30 + padding_y = 4 31 + scale_pixel_size_by = 2 32 + main_viewport_size_by = 3 33 + scaled_pixel_size = original_pixel_size * scale_pixel_size_by 34 + main_viewport_size = original_pixel_size * main_viewport_size_by 35 + font_id = 0 36 + 37 + asset_folder = 'classic_statusbar' 38 + 39 + 40 + def upscale_element(element: dict) -> dict: 41 + if element.get('image'): 42 + element_img: str = element['image'] 43 + # Split off the last .bmp (and recombine if the filename contains periods) 44 + out_element_image = ( 45 + f'{'.'.join(element_img.split('.')[0:-1])}.{scaled_pixel_size}.bmp' 46 + ) 47 + 48 + try: 49 + if os.path.isfile(out_element_image): 50 + im = Image.open(out_element_image) 51 + else: 52 + im = Image.open(element_img) 53 + size = im.width * scale_pixel_size_by, im.height * scale_pixel_size_by 54 + im = im.resize(size, Image.Resampling.NEAREST) 55 + im.save(out_element_image, "BMP") 56 + 57 + # Bit of a hack really 58 + element['image'] = out_element_image.replace( 59 + f'{asset_folder}/', '') 60 + except IOError: 61 + print(f"cannot resize for <{element_img}>") 62 + 63 + if element.get('source_x') and element['source_x'] != '-': 64 + element['source_x'] *= scale_pixel_size_by 65 + if element.get('source_y') and element['source_y'] != '-': 66 + element['source_x'] *= scale_pixel_size_by 67 + 68 + if element.get('viewport'): 69 + if element['viewport']['x'] != '-': 70 + element['viewport']['x'] *= scale_pixel_size_by 71 + element['viewport']['x'] += padding_x 72 + 73 + if element['viewport']['y'] != '-': 74 + element['viewport']['y'] *= scale_pixel_size_by 75 + element['viewport']['y'] += padding_x 76 + 77 + if element['viewport']['width'] != '-': 78 + element['viewport']['width'] *= scale_pixel_size_by 79 + 80 + if element['viewport']['height'] != '-': 81 + element['viewport']['height'] *= scale_pixel_size_by 82 + 83 + return element 84 + 85 + 86 + # These are based on the original resolution, they're upscaled later 87 + battery = upscale_element({ 88 + 'image': 'classic_statusbar/battery.bmp', 89 + 'source_x': 0, 90 + 'source_y': 0, 91 + 'sub_image_count': 16, 92 + 'viewport': { 93 + 'x': 0, 94 + 'y': 0, 95 + 'width': 17, 96 + 'height': 7, 97 + 'font_id': font_id 98 + } 99 + }) 100 + 101 + battery_cap = upscale_element({ 102 + 'image': 'classic_statusbar/batter-y.bmp', 103 + 'source_x': 0, 104 + 'source_y': 0, 105 + 'sub_image_count': 0, 106 + 'viewport': { 107 + 'x': 17, 108 + 'y': 0, 109 + 'width': 3, 110 + 'height': 7, 111 + 'font_id': font_id 112 + } 113 + }) 114 + 115 + battery_no_icon = upscale_element({ 116 + 'viewport': { 117 + 'x': 0, 118 + 'y': 0, 119 + 'width': 18, 120 + 'height': 8, 121 + 'font_id': font_id 122 + } 123 + }) 124 + 125 + volume = upscale_element({ 126 + 'image': 'classic_statusbar/volume.bmp', 127 + 'source_x': 1, 128 + 'source_y': 0, 129 + 'sub_image_count': 17, 130 + 'viewport': { 131 + 'x': 28, 132 + 'y': 0, 133 + 'width': 19, 134 + 'height': 8, 135 + 'font_id': font_id 136 + } 137 + }) 138 + 139 + status = upscale_element({ 140 + 'image': 'classic_statusbar/status.bmp', 141 + 'source_x': 0, 142 + 'source_y': 0, 143 + 'sub_image_count': 15, 144 + 'viewport': { 145 + 'x': 47, 146 + 'y': 0, 147 + 'width': 8, 148 + 'height': 8, 149 + 'font_id': font_id 150 + } 151 + }) 152 + 153 + power = upscale_element({ 154 + 'viewport': { 155 + 'x': 20, 156 + 'y': 0, 157 + 'width': 8, 158 + 'height': 8, 159 + 'font_id': font_id 160 + } 161 + }) 162 + 163 + playback = upscale_element({ 164 + 'viewport': { 165 + 'x': 47, 166 + 'y': 0, 167 + 'width': 9, 168 + 'height': 8, 169 + 'font_id': font_id 170 + } 171 + }) 172 + 173 + repeat = upscale_element({ 174 + 'viewport': { 175 + 'x': 56, 176 + 'y': 0, 177 + 'width': 9, 178 + 'height': 8, 179 + 'font_id': font_id 180 + } 181 + }) 182 + 183 + shuffle = upscale_element({ 184 + 'viewport': { 185 + 'x': 65, 186 + 'y': 0, 187 + 'width': '-', 188 + 'height': 8, 189 + 'font_id': font_id 190 + } 191 + }) 192 + 193 + access_disk = upscale_element({ 194 + 'image': 'classic_statusbar/access_disk.bmp', 195 + 'source_x': 0, 196 + 'source_y': 0, 197 + 'sub_image_count': 0, 198 + 'viewport': { 199 + 'x': -12, 200 + 'y': 0, 201 + 'width': '-', 202 + 'height': 8, 203 + 'font_id': font_id 204 + } 205 + }) 206 + 207 + 208 + rec_bitrate = upscale_element({ 209 + 'image': 'classic_statusbar/rec_mpegbitrates.bmp', 210 + 'source_x': 1, 211 + 'source_y': 0, 212 + 'sub_image_count': 18, 213 + 'viewport': { 214 + 'x': 28, 215 + 'y': 0, 216 + 'width': 19, 217 + 'height': 8, 218 + 'font_id': font_id 219 + } 220 + }) 221 + 222 + rec_freq = upscale_element({ 223 + 'image': 'classic_statusbar/rec_frequencies.bmp', 224 + 'source_x': 0, 225 + 'source_y': 0, 226 + 'sub_image_count': 12, 227 + 'viewport': { 228 + 'x': 55, 229 + 'y': 0, 230 + 'width': '-', 231 + 'height': 8, 232 + 'font_id': font_id 233 + } 234 + }) 235 + 236 + rec_encoders = upscale_element({ 237 + 'image': 'classic_statusbar/rec_encoders.bmp', 238 + 'source_x': 0, 239 + 'source_y': 0, 240 + 'sub_image_count': 3, 241 + }) 242 + 243 + rec_channels = upscale_element({ 244 + 'image': 'classic_statusbar/rec_channels.bmp', 245 + 'source_x': 13, 246 + 'source_y': 0, 247 + 'sub_image_count': 2, 248 + }) 249 + 250 + rtc = upscale_element({ 251 + 'viewport': { 252 + 'x': -43, 253 + 'y': 0, 254 + 'width': 31, 255 + 'height': 8, 256 + 'font_id': font_id 257 + } 258 + }) 259 + 260 + 261 + rendered = template.render( 262 + viewport={ 263 + 'width': 0, 264 + 'height': main_viewport_size, 265 + 'font_id': 1 266 + }, 267 + options={}, 268 + battery=battery, 269 + battery_cap=battery_cap, 270 + battery_no_icon=battery_no_icon, 271 + volume=volume, 272 + status=status, 273 + access_disk=access_disk, 274 + rec_bitrate=rec_bitrate, 275 + rec_freq=rec_freq, 276 + rec_encoders=rec_encoders, 277 + rec_channels=rec_channels, 278 + power=power, 279 + playback=playback, 280 + repeat=repeat, 281 + shuffle=shuffle, 282 + rtc=rtc, 283 + ) 284 + 285 + print(rendered) 286 + 287 + with open('./classic_statusbar.sbs', 'w') as fh: 288 + fh.write(rendered)
+96
wps/templates/classic_statusbar.sbs.j2
··· 1 + # Classic Statusbar 2 + # (C) 2007-2012 The Authors (see /rockbox/wps/AUTHORS) 3 + # 4 + # Classic statusbar adapted to skin engine 5 + # Standardized to a height of {{ viewport.height }}px for larger devices 6 + # 7 + # Status bar position can be changed from top to bottom by changing the y positions from 0 to -{{ viewport.height }} 8 + # 9 + # Specify the UI area viewport... everything but a bar {{ viewport.height }} pixels high at the top 10 + %Vi(-,{{ viewport.width }},{{ viewport.height }},-,-,{{ viewport.font_id }}) 11 + 12 + # Conditional for showing volume as number or graphic 13 + %?if(%St(volume display), =, numeric)<%Vd(d)|%Vd(c)> 14 + 15 + # Conditional for showing battery as number or graphic 16 + %?if(%St(battery display), =, numeric)<%Vd(b)|%Vd(a)%Vd(e)> 17 + 18 + # Load some bitmaps 19 + %xl(B,{{ battery.image }},{{ battery.source_x }},{{ battery.source_y }},{{ battery.sub_image_count }}) 20 + %xl(V,{{ volume.image }},{{ volume.source_x }},{{ volume.source_y }},{{ volume.sub_image_count }}) 21 + %xl(S,{{ status.image }},{{ status.source_x }},{{ status.source_y }},{{ status.sub_image_count }}) 22 + %xl(D,{{ access_disk.image }},{{ access_disk.source_x }},{{ access_disk.source_y }}) 23 + %xl(y,{{ battery_cap.image }},{{ battery_cap.source_x }},{{ battery_cap.source_y }}) 24 + 25 + %xl(m,{{ rec_bitrate.image }},{{ rec_bitrate.source_x }},{{ rec_bitrate.source_y }},{{ rec_bitrate.sub_image_count }}) 26 + %xl(f,{{ rec_freq.image }},{{ rec_freq.source_x }},{{ rec_freq.source_y }},{{ rec_freq.sub_image_count }}) 27 + %xl(e,{{ rec_encoders.image }},{{ rec_encoders.source_x }},{{ rec_encoders.source_y }},{{ rec_encoders.sub_image_count }}) 28 + %xl(c,{{ rec_channels.image }},{{ rec_channels.source_x }},{{ rec_channels.source_y }},{{ rec_channels.sub_image_count }}) 29 + 30 + # Enable the correct viewports 31 + %?cs<%Vd(c)%Vd(p)%Vd(r)%Vd(s)|%Vd(c)%Vd(p)%Vd(r)%Vd(s)|%Vd(z)|%Vd(c)%Vd(p)%Vd(r)%Vd(s)> 32 + 33 + # Charging animation viewports 34 + %t(2)%?bc<%Vd(x)|%Vd(a)>;%t(2)%Vd(a) 35 + 36 + # Battery area, Icons 37 + %Vl(a, {{ battery.viewport.x }},{{ battery.viewport.y }},{{ battery.viewport.width }},{{ battery.viewport.height }},{{ battery.viewport.font_id }}) 38 + %?bl<%xd(Ba)|%xd(Bb)|%xd(Bc)|%xd(Bd)|%xd(Be)|%xd(Bf)|%xd(Bg)|%xd(Bh)|%xd(Bi)|%xd(Bj)|%xd(Bk)|%xd(Bl)|%xd(Bm)|%xd(Bn)|%xd(Bo)> 39 + 40 + # Battery area, grey background viewport for charging animation 41 + %Vl(x, {{ battery.viewport.x }},{{ battery.viewport.y }},{{ battery.viewport.width }},{{ battery.viewport.height }},{{ battery.viewport.font_id }})%Vb(555555) 42 + #%?bl<%xd(Ba)|%xd(Bb)|%xd(Bc)|%xd(Bd)|%xd(Be)|%xd(Bf)|%xd(Bg)|%xd(Bh)|%xd(Bi)|%xd(Bj)|%xd(Bk)|%xd(Bl)|%xd(Bm)|%xd(Bn)|%xd(Bo)> 43 + 44 + # end of battery symbol (to exclude it from animation) 45 + 46 + %Vl(e,{{ battery_cap.viewport.x }},{{ battery_cap.viewport.y }},{{ battery_cap.viewport.width }},{{ battery_cap.viewport.height }},{{ battery_cap.viewport.font_id }}) 47 + %xd(y) 48 + 49 + # usb power or charger icon 50 + %V({{ power.viewport.x }},{{ power.viewport.y }},{{ power.viewport.width }},{{ power.viewport.height }},{{ power.viewport.font_id }}) 51 + %?bu<%xd(Sa)|%?bc<%xd(Sa)|%?bp<%xd(So)>>> 52 + 53 + # battery area, no icons 54 + %Vl(b,{{ battery_no_icon.viewport.x }},{{ battery_no_icon.viewport.y }},{{ battery_no_icon.viewport.width }},{{ battery_no_icon.viewport.height }},{{ battery_no_icon.viewport.font_id }}) 55 + %ar%bl 56 + 57 + # Volume area 58 + %Vl(c,{{ volume.viewport.x }},{{ volume.viewport.y }},{{ volume.viewport.width }},{{ volume.viewport.height }},{{ volume.viewport.font_id }}) 59 + %?mv<%ac%?pv<%pv|%pv| %pv| %pv>|%?pv<%xd(Va)|%xd(Vb)|%xd(Vc)|%xd(Vd)|%xd(Ve)|%xd(Vf)|%xd(Vg)|%xd(Vh)|%xd(Vi)|%xd(Vj)|%xd(Vk)|%xd(Vl)|%xd(Vm)|%xd(Vn)|%xd(Vo)|%xd(Vp)|%xd(Vq)>> 60 + %Vl(d,{{ volume.viewport.x }},{{ volume.viewport.y }},{{ volume.viewport.width }},{{ volume.viewport.height }},{{ volume.viewport.font_id }}) 61 + %ac%?pv<%pv|%pv| %pv| %pv> 62 + 63 + # Icons, all in the same bmp strip, so need to use multiple viewports 64 + # Playback mode 65 + %Vl(p,{{ playback.viewport.x }},{{ playback.viewport.y }},{{ playback.viewport.width }},{{ playback.viewport.height }},{{ playback.viewport.font_id }}) 66 + %?mp<%xd(Sc)|%xd(Sb)|%xd(Sd)|%xd(Se)|%xd(Sf)|%xd(Sg)|%xd(Sh)|%xd(Si)|%xd(Sj)> 67 + 68 + # Repeat mode 69 + %Vl(r,{{ repeat.viewport.x }},{{ repeat.viewport.y }},{{ repeat.viewport.width }},{{ repeat.viewport.height }},{{ repeat.viewport.font_id }}) 70 + %?mm<|%xd(Sk)|%xd(Sl)|%xd(Sm)|%xd(Sn)> 71 + 72 + # Shuffle mode 73 + %Vl(s,{{ shuffle.viewport.x }},{{ shuffle.viewport.y }},{{ shuffle.viewport.width }},{{ shuffle.viewport.height }},{{ shuffle.viewport.font_id }}) 74 + %?ps<%xd(Sm)|> 75 + 76 + 77 + # Recording section 78 + # encoder/mpeg bitrate 79 + %Vl(z,{{ rec_bitrate.viewport.x }},{{ rec_bitrate.viewport.y }},{{ rec_bitrate.viewport.width }},{{ rec_bitrate.viewport.height }},{{ rec_bitrate.viewport.font_id }}) 80 + %?Rp<%?Re<%xd(ea)|%xd(eb)|%xd(ec)|%?Rb<%xd(ma)|%xd(mb)|%xd(mc)|%xd(md)|%xd(me)|%xd(mf)|%xd(mg)|%xd(mh)|%xd(mi)|%xd(mj)|%xd(mk)|%xd(ml)|%xd(mm)|%xd(mn)|%xd(mo)|%xd(mp)|%xd(mq)|%xd(mr)>>> 81 + # status icon 82 + %Vl(z,{{ status.viewport.x }},{{ status.viewport.y }},{{ status.viewport.width }},{{ status.viewport.height }},{{ status.viewport.font_id }}) 83 + %?mp<%xd(Sc)|%xd(Sb)|%xd(Sd)|%xd(Se)|%xd(Sf)|%xd(Sg)|%xd(Sh)|%xd(Si)|%xd(Sj)> 84 + # frequency and channels 85 + %Vl(z,{{ rec_freq.viewport.x }},{{ rec_freq.viewport.y }},{{ rec_freq.viewport.width }},{{ rec_freq.viewport.height }},{{ rec_freq.viewport.font_id }}) 86 + %?Rp<%?Rf<%xd(fa)|%xd(fb)|%xd(fc)|%xd(fd)|%xd(fe)|%xd(ff)|%xd(fg)|%xd(fh)|%xd(fi)|%xd(fj)|%xd(fk)|%xd(fl)>> 87 + %?Rm<%xd(ca)|%xd(cb)> 88 + 89 + # Clock on RTC able targets, and disk access 90 + # align on the right with room for 5 SYSFONT digits 91 + %V({{ rtc.viewport.x }},{{ rtc.viewport.y }},{{ rtc.viewport.width }},{{ rtc.viewport.height }},{{ rtc.viewport.font_id }}) 92 + %?cc<%?ca<%?St(time format)<%cH|%cI>:%cM|--:-->|> 93 + 94 + # disk access icon 95 + %V({{ access_disk.viewport.x }},{{ access_disk.viewport.y }},{{ access_disk.viewport.width }},{{ access_disk.viewport.height }},{{ access_disk.viewport.font_id }}) 96 + %?lh<%xd(D)|>