From 4c60bc9e681865fcfc149775a1ed7ccd2613d5bf Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sun, 23 May 2021 17:30:58 +0100 Subject: New port: Shanling Q1 native - Audio playback works - Touchscreen and buttons work - Bootloader works and is capable of dual boot - Plugins are working - Cabbiev2 theme has been ported - Stable for general usage Thanks to Marc Aarts for porting Cabbiev2 and plugin bitmaps. There's a few minor known issues: - Bootloader must be installed manually using 'usbboot' as there is no support in jztool yet. - Keymaps may be lacking, need further testing and feedback. - Some plugins may not be fully adapted to the screen size and could benefit from further tweaking. - LCD shows abnormal effects under some circumstances: for example, after viewing a mostly black screen an afterimage appears briefly when going back to a brightly-lit screen. Sudden power-off without proper shutdown of the backlight causes a "dissolving" effect. - CW2015 battery reporting driver is buggy, and disabled for now. Battery reporting is currently voltage-based using the AXP192. Change-Id: I635e83f02a880192c5a82cb0861ad3a61c137c3a --- apps/plugins/battery_bench.c | 3 +++ apps/plugins/bitmaps/mono/SOURCES | 3 ++- apps/plugins/bitmaps/native/SOURCES | 22 +++++++++++++++++++-- .../native/bubbles_background.360x400x16.bmp | Bin 0 -> 432054 bytes .../bitmaps/native/bubbles_emblem.360x400x16.bmp | Bin 0 -> 12022 bytes .../native/invadrox_background.360x400x16.bmp | Bin 0 -> 144634 bytes apps/plugins/bitmaps/native/jewels.360x400x16.bmp | Bin 0 -> 140814 bytes .../native/rockblox_background.360x400x16.bmp | Bin 0 -> 432054 bytes .../bitmaps/native/sliding_puzzle.360x360x16.bmp | Bin 0 -> 388854 bytes .../bitmaps/native/snake2_bottom.360x400x16.bmp | Bin 0 -> 10854 bytes .../bitmaps/native/snake2_header1.360x400x16.bmp | Bin 0 -> 41094 bytes .../bitmaps/native/snake2_header2.360x400x16.bmp | Bin 0 -> 41094 bytes .../bitmaps/native/snake2_left.360x400x16.bmp | Bin 0 -> 6326 bytes .../bitmaps/native/snake2_right.360x400x16.bmp | Bin 0 -> 6326 bytes apps/plugins/blackjack.c | 4 ++++ apps/plugins/brickmania.c | 3 +++ apps/plugins/bubbles.c | 11 +++++++++++ apps/plugins/calculator.c | 3 +++ apps/plugins/calendar.c | 3 +++ apps/plugins/chessbox/chessbox_pgn.h | 3 +++ apps/plugins/chessclock.c | 3 +++ apps/plugins/chip8.c | 3 +++ apps/plugins/clix.c | 3 +++ apps/plugins/cube.c | 3 +++ apps/plugins/doom/i_video.c | 4 ++++ apps/plugins/flipit.c | 3 +++ apps/plugins/fractals/fractal.h | 3 +++ apps/plugins/imageviewer/imageviewer_button.h | 3 +++ apps/plugins/invadrox.c | 20 +++++++++++++++++++ apps/plugins/jewels.c | 3 +++ apps/plugins/lib/keymaps.h | 12 ++++++++++- apps/plugins/lib/pluginlib_actions.c | 2 ++ apps/plugins/midi/midiplay.c | 3 +++ apps/plugins/minesweeper.c | 3 +++ apps/plugins/mp3_encoder.c | 3 +++ apps/plugins/mpegplayer/mpeg_settings.c | 3 +++ apps/plugins/mpegplayer/mpegplayer.c | 3 +++ apps/plugins/oscilloscope.c | 3 +++ apps/plugins/pacbox/pacbox.h | 10 ++++++++++ apps/plugins/pegbox.c | 3 +++ apps/plugins/pong.c | 3 +++ apps/plugins/reversi/reversi-gui.h | 3 +++ apps/plugins/rockblox.c | 19 ++++++++++++++++++ apps/plugins/rockboy/rockboy.c | 3 +++ apps/plugins/rockpaint.c | 3 +++ apps/plugins/sliding_puzzle.c | 3 +++ apps/plugins/snake.c | 3 +++ apps/plugins/snake2.c | 15 ++++++++++++++ apps/plugins/sokoban.c | 3 +++ apps/plugins/solitaire.c | 3 +++ apps/plugins/spacerocks.c | 3 +++ apps/plugins/star.c | 4 ++++ apps/plugins/stopwatch.lua | 2 +- apps/plugins/sudoku/sudoku.h | 3 +++ apps/plugins/test_touchscreen.c | 5 +++++ apps/plugins/text_viewer/tv_button.h | 3 +++ apps/plugins/vu_meter.c | 3 +++ apps/plugins/wormlet.c | 6 +++++- apps/plugins/xobox.c | 3 +++ apps/plugins/zxbox/keymaps.h | 3 +++ 60 files changed, 235 insertions(+), 6 deletions(-) create mode 100644 apps/plugins/bitmaps/native/bubbles_background.360x400x16.bmp create mode 100644 apps/plugins/bitmaps/native/bubbles_emblem.360x400x16.bmp create mode 100644 apps/plugins/bitmaps/native/invadrox_background.360x400x16.bmp create mode 100644 apps/plugins/bitmaps/native/jewels.360x400x16.bmp create mode 100644 apps/plugins/bitmaps/native/rockblox_background.360x400x16.bmp create mode 100644 apps/plugins/bitmaps/native/sliding_puzzle.360x360x16.bmp create mode 100644 apps/plugins/bitmaps/native/snake2_bottom.360x400x16.bmp create mode 100644 apps/plugins/bitmaps/native/snake2_header1.360x400x16.bmp create mode 100644 apps/plugins/bitmaps/native/snake2_header2.360x400x16.bmp create mode 100644 apps/plugins/bitmaps/native/snake2_left.360x400x16.bmp create mode 100644 apps/plugins/bitmaps/native/snake2_right.360x400x16.bmp (limited to 'apps/plugins') diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index 2534e3bebe..6c477cbd09 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c @@ -234,6 +234,9 @@ #define BATTERY_ON_TXT "Play" #define BATTERY_OFF_TXT "Power" +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error "No keymap defined!" #endif diff --git a/apps/plugins/bitmaps/mono/SOURCES b/apps/plugins/bitmaps/mono/SOURCES index e6a24b2bc5..eb00bd9e8a 100644 --- a/apps/plugins/bitmaps/mono/SOURCES +++ b/apps/plugins/bitmaps/mono/SOURCES @@ -19,7 +19,8 @@ bubbles_bubble.138x110x1.bmp ((LCD_WIDTH == 176) && (LCD_HEIGHT == 220)) bubbles_bubble.220x176x1.bmp #elif ((LCD_WIDTH == 320) && (LCD_HEIGHT == 240)) || \ - ((LCD_WIDTH == 240) && (LCD_HEIGHT >= 320)) + ((LCD_WIDTH == 240) && (LCD_HEIGHT >= 320)) || \ + ((LCD_WIDTH == 360) && (LCD_HEIGHT == 400)) bubbles_bubble.320x240x1.bmp #elif ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \ ((LCD_WIDTH == 480) && (LCD_HEIGHT == 640)) diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index 48eb18dfa4..37d0060213 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES @@ -158,6 +158,9 @@ jackpot_slots.30x420x1.bmp ((LCD_WIDTH >= 480) && (LCD_HEIGHT >= 640)) bubbles_emblem.640x480x16.bmp bubbles_background.640x480x16.bmp +#elif (LCD_WIDTH >= 360) && (LCD_HEIGHT >= 400) +bubbles_emblem.360x400x16.bmp +bubbles_background.360x400x16.bmp #elif (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) bubbles_emblem.320x240x16.bmp bubbles_background.320x240x16.bmp @@ -388,7 +391,9 @@ invadrox_shield.22x16x16.bmp invadrox_ufo.16x7x16.bmp invadrox_ufo_explode.21x8x16.bmp invadrox_numbers.50x7x16.bmp -#if LCD_WIDTH == 320 +#if LCD_WIDTH == 360 && LCD_HEIGHT == 400 +invadrox_background.360x400x16.bmp +#elif LCD_WIDTH == 320 invadrox_background.320x240x16.bmp #elif LCD_WIDTH == 240 invadrox_background.240x320x16.bmp @@ -457,6 +462,8 @@ jewels.220x176x16.bmp jewels.320x240x16.bmp #elif (LCD_WIDTH == 320) && (LCD_HEIGHT == 240) jewels.320x240x16.bmp +#elif (LCD_WIDTH == 360) && (LCD_HEIGHT == 400) +jewels.360x400x16.bmp #elif ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \ ((LCD_WIDTH == 480) && (LCD_HEIGHT == 640)) jewels.640x480x16.bmp @@ -546,6 +553,8 @@ puzzles_cursor.11x16x24.bmp #if LCD_DEPTH >= 16 /* colour versions*/ #if (LCD_WIDTH == 640) && (LCD_HEIGHT == 480) rockblox_background.640x480x16.bmp +#elif (LCD_WIDTH == 360) && (LCD_HEIGHT == 400) +rockblox_background.360x400x16.bmp #elif (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) rockblox_background.320x240x16.bmp #elif (LCD_WIDTH == 240) && (LCD_HEIGHT >= 320) @@ -603,6 +612,12 @@ snake2_header2.640x480x16.bmp snake2_left.640x480x16.bmp snake2_right.640x480x16.bmp snake2_bottom.640x480x16.bmp +#elif (LCD_WIDTH >= 360) && (LCD_HEIGHT >= 400) && (LCD_DEPTH >= 16) +snake2_header1.360x400x16.bmp +snake2_header2.360x400x16.bmp +snake2_left.360x400x16.bmp +snake2_right.360x400x16.bmp +snake2_bottom.360x400x16.bmp #elif (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) && (LCD_DEPTH >= 16) snake2_header1.320x240x16.bmp snake2_header2.320x240x16.bmp @@ -874,7 +889,8 @@ superdom_boarditems.176x132x16.bmp #elif (LCD_WIDTH == 320 && LCD_HEIGHT == 240) superdom_boarditems.320x240x16.bmp #elif ((LCD_WIDTH == 240) && (LCD_HEIGHT == 320)) || \ - ((LCD_WIDTH == 240) && (LCD_HEIGHT == 400)) + ((LCD_WIDTH == 240) && (LCD_HEIGHT == 400)) || \ + ((LCD_WIDTH == 360) && (LCD_HEIGHT == 400)) superdom_boarditems.240x320x16.bmp #elif (LCD_WIDTH == 480 && LCD_HEIGHT == 640) superdom_boarditems.480x640x16.bmp @@ -911,6 +927,8 @@ sliding_puzzle.132x132x16.bmp sliding_puzzle.176x176x16.bmp #elif SMALLER_DIMENSION <= 240 sliding_puzzle.240x240x16.bmp +#elif SMALLER_DIMENSION <= 360 +sliding_puzzle.360x360x16.bmp #elif SMALLER_DIMENSION <= 480 sliding_puzzle.480x480x16.bmp #endif diff --git a/apps/plugins/bitmaps/native/bubbles_background.360x400x16.bmp b/apps/plugins/bitmaps/native/bubbles_background.360x400x16.bmp new file mode 100644 index 0000000000..46d8133911 Binary files /dev/null and b/apps/plugins/bitmaps/native/bubbles_background.360x400x16.bmp differ diff --git a/apps/plugins/bitmaps/native/bubbles_emblem.360x400x16.bmp b/apps/plugins/bitmaps/native/bubbles_emblem.360x400x16.bmp new file mode 100644 index 0000000000..d34e466749 Binary files /dev/null and b/apps/plugins/bitmaps/native/bubbles_emblem.360x400x16.bmp differ diff --git a/apps/plugins/bitmaps/native/invadrox_background.360x400x16.bmp b/apps/plugins/bitmaps/native/invadrox_background.360x400x16.bmp new file mode 100644 index 0000000000..14c687a940 Binary files /dev/null and b/apps/plugins/bitmaps/native/invadrox_background.360x400x16.bmp differ diff --git a/apps/plugins/bitmaps/native/jewels.360x400x16.bmp b/apps/plugins/bitmaps/native/jewels.360x400x16.bmp new file mode 100644 index 0000000000..5cd35f2162 Binary files /dev/null and b/apps/plugins/bitmaps/native/jewels.360x400x16.bmp differ diff --git a/apps/plugins/bitmaps/native/rockblox_background.360x400x16.bmp b/apps/plugins/bitmaps/native/rockblox_background.360x400x16.bmp new file mode 100644 index 0000000000..b2b1289045 Binary files /dev/null and b/apps/plugins/bitmaps/native/rockblox_background.360x400x16.bmp differ diff --git a/apps/plugins/bitmaps/native/sliding_puzzle.360x360x16.bmp b/apps/plugins/bitmaps/native/sliding_puzzle.360x360x16.bmp new file mode 100644 index 0000000000..e74e3ecb6f Binary files /dev/null and b/apps/plugins/bitmaps/native/sliding_puzzle.360x360x16.bmp differ diff --git a/apps/plugins/bitmaps/native/snake2_bottom.360x400x16.bmp b/apps/plugins/bitmaps/native/snake2_bottom.360x400x16.bmp new file mode 100644 index 0000000000..f6da503ab3 Binary files /dev/null and b/apps/plugins/bitmaps/native/snake2_bottom.360x400x16.bmp differ diff --git a/apps/plugins/bitmaps/native/snake2_header1.360x400x16.bmp b/apps/plugins/bitmaps/native/snake2_header1.360x400x16.bmp new file mode 100644 index 0000000000..f88acf2571 Binary files /dev/null and b/apps/plugins/bitmaps/native/snake2_header1.360x400x16.bmp differ diff --git a/apps/plugins/bitmaps/native/snake2_header2.360x400x16.bmp b/apps/plugins/bitmaps/native/snake2_header2.360x400x16.bmp new file mode 100644 index 0000000000..2acccd36b4 Binary files /dev/null and b/apps/plugins/bitmaps/native/snake2_header2.360x400x16.bmp differ diff --git a/apps/plugins/bitmaps/native/snake2_left.360x400x16.bmp b/apps/plugins/bitmaps/native/snake2_left.360x400x16.bmp new file mode 100644 index 0000000000..eac0c8e601 Binary files /dev/null and b/apps/plugins/bitmaps/native/snake2_left.360x400x16.bmp differ diff --git a/apps/plugins/bitmaps/native/snake2_right.360x400x16.bmp b/apps/plugins/bitmaps/native/snake2_right.360x400x16.bmp new file mode 100644 index 0000000000..316f40cb4c Binary files /dev/null and b/apps/plugins/bitmaps/native/snake2_right.360x400x16.bmp differ diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c index 4242f5a89f..24cfbe583c 100644 --- a/apps/plugins/blackjack.c +++ b/apps/plugins/blackjack.c @@ -607,6 +607,10 @@ enum { #define BJACK_RIGHT BUTTON_RIGHT #define BJACK_LEFT BUTTON_LEFT +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define BJACK_QUIT BUTTON_POWER +#define BJACK_QUIT_NAME "QUIT" + #else #error No keymap defined! #endif diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 92f8d4d161..4983d5a417 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -350,6 +350,9 @@ CONFIG_KEYPAD == SANSA_CONNECT_PAD #define UP BUTTON_UP #define DOWN BUTTON_DOWN +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define QUIT BUTTON_POWER + #else #error No keymap defined! #endif diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c index 50de10fa23..ffc814e7a0 100644 --- a/apps/plugins/bubbles.c +++ b/apps/plugins/bubbles.c @@ -120,6 +120,17 @@ enum { #define XOFS 128 #define MAX_FPS 40 +#elif (LCD_WIDTH == 360) && (LCD_HEIGHT == 400) +#define XOFS 86 +#define YOFS 100 +#define SCORE_TXT_X 28 +#define SCORE_TXT_WIDTH 32 +#define SCORE_TXT_Y 48 +#define LEVEL_TXT_X 27 +#define LEVEL_TXT_WIDTH 32 +#define LEVEL_TXT_Y 5 +#define MAX_FPS 40 + /* 22x22 bubbles (iPod Video) */ #elif (LCD_HEIGHT == 240) && (LCD_WIDTH == 320) #define XOFS 72 diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c index cbaea8aa7e..bd09330529 100644 --- a/apps/plugins/calculator.c +++ b/apps/plugins/calculator.c @@ -533,6 +533,9 @@ F3: equal to "=" #define CALCULATOR_CALC BUTTON_MENU #define CALCULATOR_CLEAR BUTTON_BACK +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define CALCULATOR_QUIT BUTTON_POWER + #else #error No keymap defined! #endif diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c index e7f221a3c9..3299a81273 100644 --- a/apps/plugins/calendar.c +++ b/apps/plugins/calendar.c @@ -421,6 +421,9 @@ #define CALENDAR_NEXT_MONTH BUTTON_VOL_UP #define CALENDAR_PREV_MONTH BUTTON_VOL_DOWN +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error "No keypad setting." #endif diff --git a/apps/plugins/chessbox/chessbox_pgn.h b/apps/plugins/chessbox/chessbox_pgn.h index 827f045a4b..9d4f369ecc 100644 --- a/apps/plugins/chessbox/chessbox_pgn.h +++ b/apps/plugins/chessbox/chessbox_pgn.h @@ -581,6 +581,9 @@ #define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT) #define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT) +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c index 91b04e713a..3d03cb9f6a 100644 --- a/apps/plugins/chessclock.c +++ b/apps/plugins/chessclock.c @@ -395,6 +395,9 @@ #define CHC_SETTINGS_OK BUTTON_SELECT #define CHC_SETTINGS_CANCEL BUTTON_POWER +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define CHC_QUIT BUTTON_POWER + #else #error No keymap defined! #endif diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c index 31866acd10..ac7f998690 100644 --- a/apps/plugins/chip8.c +++ b/apps/plugins/chip8.c @@ -1291,6 +1291,9 @@ CONFIG_KEYPAD == MROBE500_PAD #define CHIP8_KEY6 BUTTON_RIGHT #define CHIP8_KEY8 BUTTON_BACK +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/clix.c b/apps/plugins/clix.c index c127a300f2..9cd66a8034 100644 --- a/apps/plugins/clix.c +++ b/apps/plugins/clix.c @@ -316,6 +316,9 @@ #define CLIX_BUTTON_RIGHT BUTTON_RIGHT #define CLIX_BUTTON_CLICK BUTTON_SELECT +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define CLIX_BUTTON_QUIT BUTTON_POWER + #else #error "no keymap" #endif diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index 857f2415d4..dfd7df8951 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -400,6 +400,9 @@ #define CUBE_PAUSE BUTTON_PLAY #define CUBE_HIGHSPEED BUTTON_BACK +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c index 2381a7614d..f5d07a8354 100644 --- a/apps/plugins/doom/i_video.c +++ b/apps/plugins/doom/i_video.c @@ -614,6 +614,10 @@ void I_ShutdownGraphics(void) #define DOOMBUTTON_WEAPON BUTTON_VOL_UP #define DOOMBUTTON_MAP BUTTON_VOL_DOWN +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define DOOMBUTTON_ESC BUTTON_POWER +#define DOOMBUTTON_MAP BUTTON_PREV + #else #error Keymap not defined! #endif diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c index f6fb059f91..c659cf5ba5 100644 --- a/apps/plugins/flipit.c +++ b/apps/plugins/flipit.c @@ -496,6 +496,9 @@ #define FLIPIT_STEP_BY_STEP BUTTON_VOL_UP #define FLIPIT_TOGGLE BUTTON_SELECT +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/fractals/fractal.h b/apps/plugins/fractals/fractal.h index b64bf942fe..8e9446df0d 100644 --- a/apps/plugins/fractals/fractal.h +++ b/apps/plugins/fractals/fractal.h @@ -504,6 +504,9 @@ #define FRACTAL_PRECISION_DEC BUTTON_BACK #define FRACTAL_RESET BUTTON_PLAY +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define FRACTAL_QUIT BUTTON_POWER + #else #error No keymap defined! #endif diff --git a/apps/plugins/imageviewer/imageviewer_button.h b/apps/plugins/imageviewer/imageviewer_button.h index d588de95ca..e6cd2ac089 100644 --- a/apps/plugins/imageviewer/imageviewer_button.h +++ b/apps/plugins/imageviewer/imageviewer_button.h @@ -539,6 +539,9 @@ #define IMGVIEW_MENU BUTTON_POWER #define IMGVIEW_SLIDE_SHOW BUTTON_PLAY +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c index c28ab7e830..5eedb6ffc5 100644 --- a/apps/plugins/invadrox.c +++ b/apps/plugins/invadrox.c @@ -296,6 +296,9 @@ CONFIG_KEYPAD == MROBE500_PAD #define RIGHT BUTTON_RIGHT #define FIRE BUTTON_SELECT +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error INVADROX: Unsupported keypad #endif @@ -648,6 +651,23 @@ CONFIG_KEYPAD == MROBE500_PAD #define LIVES_X 8 #define MAX_Y 15 +#elif (LCD_WIDTH == 360) && (LCD_HEIGHT == 400) + +/* Shanling Q1 + */ +#define ARCADISH_GRAPHICS +#define PLAYFIELD_X 32 +#define SHIP_Y (PLAYFIELD_Y - 3 * SHIP_HEIGHT) +#define ALIEN_START_Y (UFO_Y + 3 * ALIEN_HEIGHT) +/* Redefine SCORE_Y */ +#undef SCORE_Y +#define SCORE_Y 80 +#define SCORENUM_X (PLAYFIELD_X + NUMBERS_WIDTH) +#define SCORENUM_Y SCORE_Y + (2 * (FONT_HEIGHT + 1) + 1) +#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING) +#define SHIELD_Y (PLAYFIELD_Y - 6 * SHIP_HEIGHT) +#define LIVES_X 10 +#define MAX_Y 18 #else #error INVADROX: Unsupported LCD type diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c index 7f7965b07d..3f209ae556 100644 --- a/apps/plugins/jewels.c +++ b/apps/plugins/jewels.c @@ -377,6 +377,9 @@ CONFIG_KEYPAD == MROBE500_PAD #define HK_SELECT "SELECT" #define HK_CANCEL "BACK" +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/lib/keymaps.h b/apps/plugins/lib/keymaps.h index b660d4d85e..2cbca9e5ad 100644 --- a/apps/plugins/lib/keymaps.h +++ b/apps/plugins/lib/keymaps.h @@ -255,6 +255,15 @@ #define BTN_FIRE BUTTON_SELECT #define BTN_PAUSE BUTTON_POWER +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define BTN_FIRE BUTTON_CENTER +#define BTN_PAUSE BUTTON_POWER +#define BTN_HAVE_DIAGONAL +#define BTN_DOWN_LEFT BUTTON_BOTTOMLEFT +#define BTN_DOWN_RIGHT BUTTON_BOTTOMRIGHT +#define BTN_UP_LEFT BUTTON_TOPLEFT +#define BTN_UP_RIGHT BUTTON_TOPRIGHT + #else #error Unsupported keypad #endif @@ -272,7 +281,8 @@ #elif (CONFIG_KEYPAD != COWON_D2_PAD) && \ (CONFIG_KEYPAD != DX50_PAD) && \ (CONFIG_KEYPAD != ONDAVX777_PAD) && \ - (CONFIG_KEYPAD != CREATIVE_ZENXFI2_PAD) + (CONFIG_KEYPAD != CREATIVE_ZENXFI2_PAD) && \ + (CONFIG_KEYPAD != SHANLING_Q1_PAD) #define BTN_FIRE BUTTON_BOTTOMLEFT #define BTN_PAUSE BUTTON_TOPLEFT #endif diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c index 028472d9a8..4115177eaa 100644 --- a/apps/plugins/lib/pluginlib_actions.c +++ b/apps/plugins/lib/pluginlib_actions.c @@ -499,6 +499,8 @@ const struct button_mapping pla_main_ctx[] = {PLA_SELECT, BUTTON_SELECT, BUTTON_NONE}, {PLA_SELECT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT}, {PLA_SELECT_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE}, +#elif (CONFIG_KEYPAD == SHANLING_Q1_PAD) + {PLA_EXIT, BUTTON_POWER, BUTTON_NONE}, #else # ifndef HAVE_TOUCHSCREEN # error pluginlib_actions: No actions defined diff --git a/apps/plugins/midi/midiplay.c b/apps/plugins/midi/midiplay.c index a28d1d3862..6345d3c741 100644 --- a/apps/plugins/midi/midiplay.c +++ b/apps/plugins/midi/midiplay.c @@ -325,6 +325,9 @@ #define MIDI_VOL_DOWN BUTTON_VOL_DOWN #define MIDI_PLAYPAUSE BUTTON_PLAY +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index 19a6b99f12..a3c718d79f 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c @@ -443,6 +443,9 @@ CONFIG_KEYPAD == MROBE500_PAD # define MINESWP_DISCOVER (BUTTON_SELECT|BUTTON_REPEAT) # define MINESWP_INFO BUTTON_MENU +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c index db10185c91..99671815ca 100644 --- a/apps/plugins/mp3_encoder.c +++ b/apps/plugins/mp3_encoder.c @@ -2580,6 +2580,9 @@ CONFIG_KEYPAD == MROBE500_PAD #define MP3ENC_DONE BUTTON_POWER #define MP3ENC_SELECT BUTTON_SELECT +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c index 505f3aa33d..b1445781d0 100644 --- a/apps/plugins/mpegplayer/mpeg_settings.c +++ b/apps/plugins/mpegplayer/mpeg_settings.c @@ -354,6 +354,9 @@ struct mpeg_settings settings; #define MPEG_START_TIME_DOWN BUTTON_DOWN #define MPEG_START_TIME_EXIT BUTTON_POWER +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define MPEG_START_TIME_EXIT BUTTON_POWER + #else #error No keymap defined! #endif diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 34eafd5d9c..e66b4df146 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c @@ -486,6 +486,9 @@ CONFIG_KEYPAD == SANSA_M200_PAD #define MPEG_RW BUTTON_LEFT #define MPEG_FF BUTTON_RIGHT +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index 881295d6ab..ae84e14f7f 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -548,6 +548,9 @@ #define OSCILLOSCOPE_VOL_UP BUTTON_VOL_UP #define OSCILLOSCOPE_VOL_DOWN BUTTON_VOL_DOWN +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/pacbox/pacbox.h b/apps/plugins/pacbox/pacbox.h index a3d42b099c..aa8c41fa95 100644 --- a/apps/plugins/pacbox/pacbox.h +++ b/apps/plugins/pacbox/pacbox.h @@ -398,6 +398,16 @@ #define PACMAN_1UP BUTTON_VOL_UP #define PACMAN_COIN BUTTON_PLAY +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define PACMAN_UP BUTTON_TOPMIDDLE +#define PACMAN_DOWN BUTTON_BOTTOMMIDDLE +#define PACMAN_LEFT BUTTON_MIDLEFT +#define PACMAN_RIGHT BUTTON_MIDRIGHT +#define PACMAN_MENU BUTTON_TOPLEFT +#define PACMAN_1UP BUTTON_BOTTOMLEFT +#define PACMAN_2UP BUTTON_BOTTOMRIGHT +#define PACMAN_COIN BUTTON_CENTER + #else #error Keymap not defined! diff --git a/apps/plugins/pegbox.c b/apps/plugins/pegbox.c index f089c38023..cb6361547d 100644 --- a/apps/plugins/pegbox.c +++ b/apps/plugins/pegbox.c @@ -711,6 +711,9 @@ CONFIG_KEYPAD == MROBE500_PAD #define LVL_UP_TEXT "VOL+" #define LVL_DOWN_TEXT "VOL-" +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error "Unsupported keymap!" #endif diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c index 22484d0bc9..4a2c48e94c 100644 --- a/apps/plugins/pong.c +++ b/apps/plugins/pong.c @@ -325,6 +325,9 @@ CONFIG_KEYPAD == MROBE500_PAD #define PONG_RIGHT_UP BUTTON_BACK #define PONG_RIGHT_DOWN BUTTON_RIGHT +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/reversi/reversi-gui.h b/apps/plugins/reversi/reversi-gui.h index 7e031e6103..926a71e1a2 100644 --- a/apps/plugins/reversi/reversi-gui.h +++ b/apps/plugins/reversi/reversi-gui.h @@ -361,6 +361,9 @@ #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT #define REVERSI_BUTTON_MENU BUTTON_MENU +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index 07a15bfb62..927710b37b 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c @@ -465,6 +465,9 @@ #define ROCKBLOX_DROP BUTTON_PLAY #define ROCKBLOX_RESTART BUTTON_BACK +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif @@ -534,6 +537,22 @@ #define LEVEL_Y 142 #define LINES_Y 218 +#elif (LCD_WIDTH == 360) && (LCD_HEIGHT == 400) + +#define BLOCK_WIDTH 19 +#define BLOCK_HEIGHT 19 +#define BOARD_X 27 +#define BOARD_Y 0 +#define LABEL_X 258 +#define SCORE_Y 40 +#define LEVEL_Y 92 +#define LINES_Y 140 +#define HIGH_LABEL_X 258 +#define HIGH_SCORE_Y 200 +#define HIGH_LEVEL_Y 258 +#define PREVIEW_X 258 +#define PREVIEW_Y 300 + #elif (LCD_WIDTH == 320) && (LCD_HEIGHT == 240) #define BLOCK_WIDTH 12 diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index d2c56ff6cc..2c5c6e4dbf 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c @@ -468,6 +468,9 @@ static void setoptions (void) options.SELECT = BUTTON_VOL_UP; options.MENU = BUTTON_POWER; +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD + /* use touchscreen */ + #else #error No Keymap Defined! #endif diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c index 0d3211d4d2..98fdb468d3 100644 --- a/apps/plugins/rockpaint.c +++ b/apps/plugins/rockpaint.c @@ -404,6 +404,9 @@ #define ROCKPAINT_LEFT BUTTON_LEFT #define ROCKPAINT_RIGHT BUTTON_RIGHT +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error "Please define keys for this keypad" #endif diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c index d1820b2f50..a34cb77669 100644 --- a/apps/plugins/sliding_puzzle.c +++ b/apps/plugins/sliding_puzzle.c @@ -357,6 +357,9 @@ CONFIG_KEYPAD == MROBE500_PAD #define PUZZLE_SHUFFLE BUTTON_BACK #define PUZZLE_PICTURE BUTTON_PLAY +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c index 459d345fa2..25c89b264b 100644 --- a/apps/plugins/snake.c +++ b/apps/plugins/snake.c @@ -313,6 +313,9 @@ dir is the current direction of the snake - 0=up, 1=right, 2=down, 3=left; #define SNAKE_DOWN BUTTON_DOWN #define SNAKE_PLAYPAUSE BUTTON_PLAY +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c index 1536840daf..094fd854eb 100644 --- a/apps/plugins/snake2.c +++ b/apps/plugins/snake2.c @@ -62,6 +62,18 @@ Head and Tail are stored #define TOP_X4 548 /* x-coord of the lowerright item (hi-score) */ #define TOP_Y1 8 /* y-coord of the top row of items */ #define TOP_Y2 50 /* y-coord of the bottom row of items */ +#elif (LCD_WIDTH >= 360) && (LCD_HEIGHT >= 400) + #define MULTIPLIER 12 /*Modifier for porting on other screens*/ + #define MODIFIER_1 12 + #define MODIFIER_2 10 + #define CENTER_X 12 + #define CENTER_Y 40 + #define TOP_X1 34 /* x-coord of the upperleft item (game type) */ + #define TOP_X2 320 /* x-coord of the upperright item (maze type) */ + #define TOP_X3 42 /* x-coord of the lowerleft item (speed) */ + #define TOP_X4 314 /* x-coord of the lowerright item (hi-score) */ + #define TOP_Y1 4 /* y-coord of the top row of items */ + #define TOP_Y2 25 /* y-coord of the bottom row of items */ #elif (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) #define MULTIPLIER 10 /*Modifier for porting on other screens*/ #define MODIFIER_1 10 @@ -446,6 +458,9 @@ CONFIG_KEYPAD == MROBE500_PAD #define SNAKE2_PLAYPAUSE BUTTON_PLAY #define SNAKE2_PLAYPAUSE_TEXT "PLAY" +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index 41c671a38c..247663a5c2 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c @@ -696,6 +696,9 @@ #define BUTTON_SAVE BUTTON_BACK #define BUTTON_SAVE_NAME "BACK" +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index 2d737df678..a48bfbc9be 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c @@ -741,6 +741,9 @@ CONFIG_KEYPAD == MROBE500_PAD # define HK_CUR2STACK "HOLD SELECT" # define HK_REM2STACK "VOL+" +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +# define SOL_QUIT BUTTON_POWER + #else #error No keymap defined! #endif diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c index 2d39c26b3d..8203fad612 100644 --- a/apps/plugins/spacerocks.c +++ b/apps/plugins/spacerocks.c @@ -372,6 +372,9 @@ #define AST_RIGHT BUTTON_RIGHT #define AST_FIRE BUTTON_PLAY +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/star.c b/apps/plugins/star.c index c186474ae3..874afc1cf1 100644 --- a/apps/plugins/star.c +++ b/apps/plugins/star.c @@ -668,6 +668,10 @@ #define STAR_LEVEL_DOWN_NAME "VOL-" #define STAR_LEVEL_REPEAT_NAME "BACK" +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define STAR_QUIT BUTTON_POWER +#define STAR_QUIT_NAME "POWER" + #else #error No keymap defined! #endif diff --git a/apps/plugins/stopwatch.lua b/apps/plugins/stopwatch.lua index 578ba7f42c..34a3c57d72 100644 --- a/apps/plugins/stopwatch.lua +++ b/apps/plugins/stopwatch.lua @@ -280,7 +280,7 @@ function arrangeButtons(btns) end end -rb.touchscreen_set_mode(rb.TOUCHSCREEN_POINT) +rb.touchscreen_mode(rb.TOUCHSCREEN_POINT) LapsView:init() diff --git a/apps/plugins/sudoku/sudoku.h b/apps/plugins/sudoku/sudoku.h index 1332a9a80f..e06581fdc9 100644 --- a/apps/plugins/sudoku/sudoku.h +++ b/apps/plugins/sudoku/sudoku.h @@ -460,6 +460,9 @@ #define SUDOKU_BUTTON_MENU BUTTON_MENU #define SUDOKU_BUTTON_POSSIBLE BUTTON_BACK +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/test_touchscreen.c b/apps/plugins/test_touchscreen.c index 120ca8ac34..0d8e91f6a9 100644 --- a/apps/plugins/test_touchscreen.c +++ b/apps/plugins/test_touchscreen.c @@ -37,12 +37,17 @@ #elif CONFIG_KEYPAD == CREATIVE_ZENXFI2_PAD #define TOUCHSCREEN_QUIT BUTTON_POWER #define TOUCHSCREEN_TOGGLE BUTTON_MENU +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define TOUCHSCREEN_QUIT BUTTON_POWER +#define TOUCHSCREEN_TOGGLE BUTTON_PLAY #elif (CONFIG_KEYPAD == ANDROID_PAD) #define TOUCHSCREEN_QUIT BUTTON_BACK #define TOUCHSCREEN_TOGGLE BUTTON_MENU #elif (CONFIG_KEYPAD == SDL_PAD) #define TOUCHSCREEN_QUIT BUTTON_MIDLEFT #define TOUCHSCREEN_TOGGLE BUTTON_CENTER +#else +# error "No keymap defined!" #endif /* plugin entry point */ diff --git a/apps/plugins/text_viewer/tv_button.h b/apps/plugins/text_viewer/tv_button.h index d9a57d114f..4d45fbba03 100644 --- a/apps/plugins/text_viewer/tv_button.h +++ b/apps/plugins/text_viewer/tv_button.h @@ -572,6 +572,9 @@ #define TV_LINE_DOWN BUTTON_SCROLL_FWD #define TV_BOOKMARK BUTTON_PLAY +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +#define TV_BOOKMARK BUTTON_PLAY + #else #error No keymap defined! #endif diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index e24ad8dcdc..356a7fdd93 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c @@ -452,6 +452,9 @@ #define LABEL_MENU "MENU" #define LABEL_VOLUME "VOL+/VOL-" +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c index d76f6a7d5a..162cea6208 100644 --- a/apps/plugins/wormlet.c +++ b/apps/plugins/wormlet.c @@ -407,6 +407,9 @@ CONFIG_KEYPAD == MROBE500_PAD #define BTN_QUIT BUTTON_POWER #define BTN_STOPRESET BUTTON_BACK +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error No keymap defined! #endif @@ -492,7 +495,8 @@ CONFIG_KEYPAD == MROBE500_PAD #define SPEED 4 #define MAX_WORM_SEGMENTS 512 #elif ((LCD_WIDTH == 320) && (LCD_HEIGHT == 240)) || \ - ((LCD_WIDTH == 240) && ((LCD_HEIGHT == 320) || (LCD_HEIGHT == 400))) + ((LCD_WIDTH == 240) && ((LCD_HEIGHT == 320) || (LCD_HEIGHT == 400))) || \ + ((LCD_WIDTH == 360) && (LCD_HEIGHT == 400)) #define FOOD_SIZE 7 #define ARGH_SIZE 8 #define SPEED 4 diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index cf959ad7f5..b8b1964db4 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c @@ -351,6 +351,9 @@ CONFIG_KEYPAD == MROBE500_PAD #define DOWN BUTTON_DOWN #define PAUSE BUTTON_PLAY +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error "No keymap defined!" #endif diff --git a/apps/plugins/zxbox/keymaps.h b/apps/plugins/zxbox/keymaps.h index e9316a301b..e95a1d8c94 100644 --- a/apps/plugins/zxbox/keymaps.h +++ b/apps/plugins/zxbox/keymaps.h @@ -290,6 +290,9 @@ #define ZX_UP BUTTON_UP #define ZX_DOWN BUTTON_DOWN +#elif CONFIG_KEYPAD == SHANLING_Q1_PAD +/* use touchscreen */ + #else #error Keymap not defined! -- cgit v1.2.3