From 6e9e6a7571275f1942630e0383d3fdf912178c8d Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Sun, 27 Feb 2011 23:42:37 +0000 Subject: RaaA: Add initial Pandora support More information: www.openpandora.org Possible things to implement: - Special button mappings - Battery monitoring - ALSA audio backend - Automate creation of "pnd" (=binary) file git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29451 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/filefuncs.c | 2 +- firmware/common/rbpaths.c | 2 +- firmware/export/config.h | 6 +- firmware/export/config/pandora.h | 96 ++++++++++++++++++++++ firmware/export/debug.h | 2 +- firmware/include/dir_uncached.h | 2 +- firmware/include/file.h | 2 +- .../target/hosted/sdl/app/button-application.c | 2 +- firmware/target/hosted/sdl/system-sdl.c | 4 +- 9 files changed, 109 insertions(+), 9 deletions(-) create mode 100644 firmware/export/config/pandora.h (limited to 'firmware') diff --git a/firmware/common/filefuncs.c b/firmware/common/filefuncs.c index 3811f06ec9..6eb2bafa40 100644 --- a/firmware/common/filefuncs.c +++ b/firmware/common/filefuncs.c @@ -91,7 +91,7 @@ bool dir_exists(const char *path) #endif /* __PCTOOL__ */ -#if (CONFIG_PLATFORM & (PLATFORM_NATIVE|PLATFORM_SDL|PLATFORM_MAEMO)) +#if (CONFIG_PLATFORM & (PLATFORM_NATIVE|PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) struct dirinfo dir_get_info(DIR* parent, struct dirent *entry) { (void)parent; diff --git a/firmware/common/rbpaths.c b/firmware/common/rbpaths.c index 10fceb69d9..cb56ab4845 100644 --- a/firmware/common/rbpaths.c +++ b/firmware/common/rbpaths.c @@ -43,7 +43,7 @@ #define opendir opendir_android #define mkdir mkdir_android #define rmdir rmdir_android -#elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO)) +#elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) #define open sim_open #define remove sim_remove #define rename sim_rename diff --git a/firmware/export/config.h b/firmware/export/config.h index 1783cc137d..d00958a71d 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -86,6 +86,7 @@ #define PLATFORM_MAEMO4 (1<<4) #define PLATFORM_MAEMO5 (1<<5) #define PLATFORM_MAEMO (PLATFORM_MAEMO4|PLATFORM_MAEMO5) +#define PLATFORM_PANDORA (1<<6) /* CONFIG_KEYPAD */ #define PLAYER_PAD 1 @@ -448,6 +449,8 @@ Lyre prototype 1 */ #include "config/nokian8xx.h" #elif defined(NOKIAN900) #include "config/nokian900.h" +#elif defined(PANDORA) +#include "config/pandora.h" #else /* no known platform */ #endif @@ -511,7 +514,8 @@ Lyre prototype 1 */ #endif /* define for all cpus from ARM family */ -#if (CONFIG_PLATFORM & PLATFORM_MAEMO5) && defined(MAEMO_ARM_BUILD) +#if ((CONFIG_PLATFORM & PLATFORM_MAEMO5) && defined(MAEMO_ARM_BUILD)) \ + || (CONFIG_PLATFORM & PLATFORM_PANDORA) #define CPU_ARM #define ARM_ARCH 7 /* ARMv7 */ diff --git a/firmware/export/config/pandora.h b/firmware/export/config/pandora.h new file mode 100644 index 0000000000..81dd75b975 --- /dev/null +++ b/firmware/export/config/pandora.h @@ -0,0 +1,96 @@ +/* + * This config file is for Rockbox as an application on the Nokia N8xx + */ +#define TARGET_TREE /* this target is using the target tree system */ + +/* We don't run on hardware directly */ +#define CONFIG_PLATFORM (PLATFORM_HOSTED|PLATFORM_PANDORA) + +/* For Rolo and boot loader */ +#define MODEL_NUMBER 100 + +#define MODEL_NAME "Rockbox" + +#define USB_NONE + +/* define this if you have a bitmap LCD display */ +#define HAVE_LCD_BITMAP + +/* define this if you have a colour LCD */ +#define HAVE_LCD_COLOR + +/* define this if you want album art for this target */ +#define HAVE_ALBUMART + +/* define this to enable bitmap scaling */ +#define HAVE_BMP_SCALING + +/* define this to enable JPEG decoding */ +#define HAVE_JPEG + +/* define this if you have access to the quickscreen */ +#define HAVE_QUICKSCREEN +/* define this if you have access to the pitchscreen */ +#define HAVE_PITCHSCREEN + +/* define this if you would like tagcache to build on this target */ +#define HAVE_TAGCACHE + +/* LCD dimensions */ +#define LCD_WIDTH 800 +#define LCD_HEIGHT 480 +#define LCD_DEPTH 16 +#define LCD_PIXELFORMAT 565 + +/* define this to indicate your device's keypad */ +#define HAVE_TOUCHSCREEN +#define HAVE_BUTTON_DATA + +/* define this if you have RTC RAM available for settings */ +//#define HAVE_RTC_RAM + +/* The number of bytes reserved for loadable codecs */ +#define CODEC_SIZE 0x100000 + +/* The number of bytes reserved for loadable plugins */ +#define PLUGIN_BUFFER_SIZE 0x80000 + +#define AB_REPEAT_ENABLE + +/* Define this if you do software codec */ +#define CONFIG_CODEC SWCODEC + +/* Work around debug macro expansion of strncmp in scratchbox */ +#define _HAVE_STRING_ARCH_strncmp + +#define HAVE_SCROLLWHEEL +#define CONFIG_KEYPAD SDL_PAD + +/* Use SDL audio/pcm in a SDL app build */ +#define HAVE_SDL +#define HAVE_SDL_AUDIO + +#define HAVE_SW_TONE_CONTROLS + +/* Define current usage levels. */ +#define CURRENT_NORMAL 88 /* 18 hours from a 1600 mAh battery */ +#define CURRENT_BACKLIGHT 30 /* TBD */ +#define CURRENT_RECORD 0 /* no recording yet */ + +/* Define this to the CPU frequency */ +/* +#define CPU_FREQ 48000000 +*/ + +/* Offset ( in the firmware file's header ) to the file CRC */ +#define FIRMWARE_OFFSET_FILE_CRC 0 + +/* Offset ( in the firmware file's header ) to the real data */ +#define FIRMWARE_OFFSET_FILE_DATA 8 + +#define CONFIG_LCD LCD_COWOND2 + +/* Define this if a programmable hotkey is mapped */ +//#define HAVE_HOTKEY + +#define BOOTDIR "/.rockbox" diff --git a/firmware/export/debug.h b/firmware/export/debug.h index 99cdf42c05..b5458af487 100644 --- a/firmware/export/debug.h +++ b/firmware/export/debug.h @@ -34,7 +34,7 @@ extern void ldebugf(const char* file, int line, const char *fmt, ...) /* */ #if defined(SIMULATOR) && !defined(__PCTOOL__) \ - || ((CONFIG_PLATFORM & (PLATFORM_ANDROID|PLATFORM_MAEMO)) && defined(DEBUG)) + || ((CONFIG_PLATFORM & (PLATFORM_ANDROID|PLATFORM_MAEMO|PLATFORM_PANDORA)) && defined(DEBUG)) #define DEBUGF debugf #define LDEBUGF(...) ldebugf(__FILE__, __LINE__, __VA_ARGS__) #else diff --git a/firmware/include/dir_uncached.h b/firmware/include/dir_uncached.h index 19bed9af5d..d9a29fbada 100644 --- a/firmware/include/dir_uncached.h +++ b/firmware/include/dir_uncached.h @@ -33,7 +33,7 @@ struct dirinfo { #include #include "file.h" -#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO)) +#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) # define dirent_uncached sim_dirent # define DIR_UNCACHED SIM_DIR # define opendir_uncached sim_opendir diff --git a/firmware/include/file.h b/firmware/include/file.h index 69ed394828..48354505f5 100644 --- a/firmware/include/file.h +++ b/firmware/include/file.h @@ -46,7 +46,7 @@ extern int app_open(const char *name, int o, ...); extern int app_creat(const char *name, mode_t mode); extern int app_remove(const char* pathname); extern int app_rename(const char* path, const char* newname); -# if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO)) +# if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) # define filesize(x) sim_filesize(x) # define fsync(x) sim_fsync(x) # define ftruncate(x,y) sim_ftruncate(x,y) diff --git a/firmware/target/hosted/sdl/app/button-application.c b/firmware/target/hosted/sdl/app/button-application.c index 72f4a1770d..bb43d904ed 100644 --- a/firmware/target/hosted/sdl/app/button-application.c +++ b/firmware/target/hosted/sdl/app/button-application.c @@ -50,7 +50,7 @@ int key_to_button(int keyboard_key) case SDLK_LEFT: new_btn = BUTTON_MIDLEFT; break; -#if (CONFIG_PLATFORM & PLATFORM_MAEMO) +#if (CONFIG_PLATFORM & PLATFORM_MAEMO|PLATFORM_PANDORA) case SDLK_RETURN: case SDLK_KP_ENTER: #endif diff --git a/firmware/target/hosted/sdl/system-sdl.c b/firmware/target/hosted/sdl/system-sdl.c index 1cc9b2c919..4dc5509397 100644 --- a/firmware/target/hosted/sdl/system-sdl.c +++ b/firmware/target/hosted/sdl/system-sdl.c @@ -133,7 +133,7 @@ static int sdl_event_thread(void * param) depth = 16; flags = SDL_HWSURFACE|SDL_DOUBLEBUF; -#if (CONFIG_PLATFORM & PLATFORM_MAEMO) +#if (CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_PANDORA)) /* Fullscreen mode for maemo app */ flags |= SDL_FULLSCREEN; #endif @@ -142,7 +142,7 @@ static int sdl_event_thread(void * param) panicf("%s", SDL_GetError()); } -#if (CONFIG_PLATFORM & PLATFORM_MAEMO) +#if (CONFIG_PLATFORM & PLATFORM_MAEMO|PLATFORM_PANDORA) /* Hide mouse cursor on real touchscreen device */ SDL_ShowCursor(SDL_DISABLE); #endif -- cgit v1.2.3