diff --git a/firmware/SOURCES b/firmware/SOURCES index 0806666915..eb8ff78900 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -74,7 +74,7 @@ target/hosted/sdl/lcd-bitmap.c target/hosted/sdl/lcd-remote-bitmap.c #endif target/hosted/sdl/lcd-sdl.c -#ifndef RG_NANO +#if !defined(RG_NANO) || defined(SIMULATOR) target/hosted/sdl/window-sdl.c #endif target/hosted/sdl/system-sdl.c @@ -226,7 +226,7 @@ target/hosted/samsungypr/ypr1/wmcodec-ypr1.c target/hosted/maemo/maemo-thread.c #endif -#ifdef RG_NANO +#if defined(RG_NANO) && !defined(SIMULATOR) target/hosted/sysfs.c target/hosted/power-linux.c target/hosted/backlight-unix.c diff --git a/firmware/export/config/rgnano.h b/firmware/export/config/rgnano.h index 0d743107c4..40c3621f83 100644 --- a/firmware/export/config/rgnano.h +++ b/firmware/export/config/rgnano.h @@ -3,8 +3,11 @@ */ /* We don't run on hardware directly */ +#ifndef SIMULATOR #define CONFIG_PLATFORM (PLATFORM_HOSTED) #define PIVOT_ROOT "/mnt" +#endif + #define HAVE_FPU /* For Rolo and boot loader */ @@ -12,7 +15,9 @@ #define MODEL_NAME "RG Nano" +#ifndef SIMULATOR #define USB_NONE +#endif /* define this if you have a colour LCD */ #define HAVE_LCD_COLOR diff --git a/firmware/target/hosted/sdl/sim-ui-defines.h b/firmware/target/hosted/sdl/sim-ui-defines.h index b8a97411ce..3148abec67 100644 --- a/firmware/target/hosted/sdl/sim-ui-defines.h +++ b/firmware/target/hosted/sdl/sim-ui-defines.h @@ -536,6 +536,13 @@ #define UI_LCD_POSX 46 #define UI_LCD_POSY 61 +#elif defined(RG_NANO) +#define UI_TITLE "Anbernic RG Nano" +#define UI_WIDTH 370 +#define UI_HEIGHT 604 +#define UI_LCD_POSX 64 +#define UI_LCD_POSY 78 + #elif defined(SIMULATOR) #error no UI defines diff --git a/tools/configure b/tools/configure index b66a015564..3fbceb7dd1 100755 --- a/tools/configure +++ b/tools/configure @@ -283,6 +283,11 @@ simcc () { LDOPTS="$LDOPTS -fsanitize=undefined" fi + # Clear FUNKEY_SDK SDL1.2 path from LDOPTS + if [ "$modelname" = "rgnano" ]; then + LDOPTS="" + fi + # Some linux setups like to warn about unused results. They are correct, # but cleaning this up is a lot of work. GCCOPTS="$GCCOPTS -Wno-unused-result" @@ -3667,7 +3672,6 @@ fi t_cpu="hosted" t_manufacturer="anbernic" t_model="rgnano" - extradefines="$extradefines -DOS_USE_BYTESWAP_H" ;; 210|hifietma9) diff --git a/uisimulator/bitmaps/UI-rgnano.bmp b/uisimulator/bitmaps/UI-rgnano.bmp new file mode 100644 index 0000000000..c53c207fa8 Binary files /dev/null and b/uisimulator/bitmaps/UI-rgnano.bmp differ diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES index cb0d876e9d..39c5488289 100644 --- a/uisimulator/buttonmap/SOURCES +++ b/uisimulator/buttonmap/SOURCES @@ -89,5 +89,7 @@ erosq.c fiio-m3k.c #elif CONFIG_KEYPAD == SHANLING_Q1_PAD shanling-q1.c +#elif CONFIG_KEYPAD == RG_NANO_PAD +rg-nano.c #endif #endif /* SIMULATOR */ diff --git a/uisimulator/buttonmap/rg-nano.c b/uisimulator/buttonmap/rg-nano.c new file mode 100644 index 0000000000..b128ca5576 --- /dev/null +++ b/uisimulator/buttonmap/rg-nano.c @@ -0,0 +1,81 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2010 Szymon Dziok + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + + +#include +#include "button.h" +#include "buttonmap.h" + +int key_to_button(int keyboard_button) +{ + int new_btn = BUTTON_NONE; + switch (keyboard_button) + { + case SDLK_KP_4: + case SDLK_LEFT: + new_btn = BUTTON_LEFT; + break; + case SDLK_KP_6: + case SDLK_RIGHT: + new_btn = BUTTON_RIGHT; + break; + case SDLK_KP_8: + case SDLK_UP: + new_btn = BUTTON_UP; + break; + case SDLK_KP_2: + case SDLK_DOWN: + new_btn = BUTTON_DOWN; + break; + case SDLK_KP_5: + case SDLK_RETURN: + case SDLK_x: + new_btn = BUTTON_A; + break; + case SDLK_ESCAPE: + case SDLK_z: + new_btn = BUTTON_B; + break; + case SDLK_s: + new_btn = BUTTON_X; + break; + case SDLK_a: + new_btn = BUTTON_Y; + break; + case SDLK_q: + new_btn = BUTTON_L; + break; + case SDLK_w: + new_btn = BUTTON_R; + break; + case SDLK_n: + new_btn = BUTTON_FN; + break; + case SDLK_m: + new_btn = BUTTON_START; + break; + } + return new_btn; +} + +struct button_map bm[] = { + { 0, 0, 0, 0, "None" } +};