Index: webos/buildpkg.sh =================================================================== --- webos/buildpkg.sh (revision 0) +++ webos/buildpkg.sh (revision 0) @@ -0,0 +1,4 @@ +#!/bin/sh + +cp ../debian/maemo/rockbox.png ./package +palm-package package Index: webos/package/appinfo.json =================================================================== --- webos/package/appinfo.json (revision 0) +++ webos/package/appinfo.json (revision 0) @@ -0,0 +1,14 @@ +{ + "id": "org.rockbox.raap", + "version": "0.0.1", + "vendor": "The Rockbox Crew", + "vendor_email": "jasonayu@gmail.com", + "vendor_url": "http://www.rockbox.org/", + "type": "pdk", + "main": "rockbox", + "title": "Rockbox", + "icon": "rockbox.png", + "miniicon": "rockbox.png", + "requiredMemory" : 32 +} + Index: webos/package/package.properties =================================================================== --- webos/package/package.properties (revision 0) +++ webos/package/package.properties (revision 0) @@ -0,0 +1,2 @@ +filemode.755 = rockbox + Index: tools/configure =================================================================== --- tools/configure (revision 31467) +++ tools/configure (working copy) @@ -521,6 +521,22 @@ gccchoice="4.1.2" } +weboscc () { + PALMPDK="/opt/PalmPDK" + + prefixtools "$PALMPDK/arm-gcc/bin/arm-none-linux-gnueabi-" + + GCCOPTS=`echo $CCOPTS | sed -e s/-ffreestanding// -e s/-nostdlib// -e s/-Wundef// -e s/-O//` + GCCOPTS="$GCCOPTS -fno-builtin -g" + LDOPTS='-lm' # button-sdl.c uses sqrt() + GLOBAL_LDOPTS="-Wl,--allow-shlib-undefined" + + INCLUDEDIR="$PALMPDK/include" + LIBDIR="$PALMPDK/device/lib" + GCCOPTS="$GCCOPTS -I$INCLUDEDIR -I$INCLUDEDIR/SDL -D_GNU_SOURCE=1 -D_REENTRANT" + LDOPTS="$LDOPTS -L$LIBDIR -Wl,-rpath-link,$LIBDIR,-noinhibit-exec -lSDL -lpthread" +} + maemocc () { # Scratchbox sets up "gcc" based on the active target prefixtools "" @@ -1311,7 +1327,7 @@ 203) Nokia N900 ==ROCKCHIP== ==HiFiMAN== 204) Pandora 180) rk27xx generic 190) HM-60x 205) Samsung YP-R0 191) HM-801 - + 206) WebOS EOF buildfor=`input`; @@ -3272,6 +3288,32 @@ t_model="app" ;; + 206|WebOS) + application="yes" + target_id=78 + modelname="webos" + target="WEBOS" + rbdir="/media/cryptofs/apps/usr/palm/applications/org.rockbox.raap/app" + app_set_lcd_size + memory=32 + uname=`uname` + simcc "sdl-app" + weboscc + tool="cp " + boottool="cp " + bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" + bmp2rb_native="$rootdir/tools/bmp2rb -f 4" + output="rockbox" + bootoutput="rockbox" + appextra="recorder:gui:radio" + plugins="yes" + swcodec="yes" + # architecture, manufacturer and model for the target-tree build + t_cpu="hosted" + t_manufacturer="webos" + t_model="app" + ;; + *) echo "Please select a supported target platform!" exit 7 Index: tools/buildzip.pl =================================================================== --- tools/buildzip.pl (revision 31467) +++ tools/buildzip.pl (working copy) @@ -130,6 +130,12 @@ $bindir .= "/$rbdir"; $libdir = $userdir = $bindir; } + + if ($modelname =~ /webos/) { + $bindir = "./package"; + $libdir = $userdir = $bindir . "/app"; + } + if ($dest =~ /\/dev\/null/) { die "ERROR: No PREFIX given\n" } Index: firmware/export/rbpaths.h =================================================================== --- firmware/export/rbpaths.h (revision 31467) +++ firmware/export/rbpaths.h (working copy) @@ -66,6 +66,11 @@ #define HOME_DIR "" /* replaced at runtime */ #define HOME_DIR_LEN (sizeof(HOME_DIR)-1) +#if (CONFIG_PLATFORM & PLATFORM_WEBOS) +#define PLUGIN_DIR ROCKBOX_DIR "/rocks" +#define CODECS_DIR ROCKBOX_DIR "/codecs" +#else + #define PLUGIN_DIR ROCKBOX_LIBRARY_PATH "/rockbox/rocks" #if (CONFIG_PLATFORM & PLATFORM_ANDROID) #define CODECS_DIR ROCKBOX_BINARY_PATH @@ -73,6 +78,8 @@ #define CODECS_DIR ROCKBOX_LIBRARY_PATH "/rockbox/codecs" #endif +#endif + extern void paths_init(void); #endif /* !APPLICATION || SAMSUNG_YPR0 */ Index: firmware/export/config.h =================================================================== --- firmware/export/config.h (revision 31467) +++ firmware/export/config.h (working copy) @@ -89,6 +89,7 @@ #define PLATFORM_MAEMO5 (1<<5) #define PLATFORM_MAEMO (PLATFORM_MAEMO4|PLATFORM_MAEMO5) #define PLATFORM_PANDORA (1<<6) +#define PLATFORM_WEBOS (1<<7) /* CONFIG_KEYPAD */ #define PLAYER_PAD 1 @@ -487,6 +488,8 @@ #include "config/pandora.h" #elif defined(SAMSUNG_YPR0) #include "config/samsungypr0.h" +#elif defined(WEBOS) +#include "config/webos.h" #else /* no known platform */ #endif Index: firmware/export/config/webos.h =================================================================== --- firmware/export/config/webos.h (revision 0) +++ firmware/export/config/webos.h (revision 0) @@ -0,0 +1,107 @@ +/* + * This config file is for the SDL application + */ +#define TARGET_TREE /* this target is using the target tree system */ + +/* We don't run on hardware directly */ +#define CONFIG_PLATFORM (PLATFORM_HOSTED|PLATFORM_SDL|PLATFORM_WEBOS) + +/* 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 + * + * overriden by configure for application builds */ +#ifndef LCD_WIDTH +#define LCD_WIDTH 320 +#endif + +#ifndef LCD_HEIGHT +#define LCD_HEIGHT 480 +#endif + +#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 + +/* define this if you have a real-time clock */ +#define CONFIG_RTC APPLICATION + +/* 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 + +#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 this if the host platform can change volume outside of rockbox */ +#define PLATFORM_HAS_VOLUME_CHANGE + +#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" Index: firmware/target/hosted/webos/buttonmap.h =================================================================== --- firmware/target/hosted/webos/buttonmap.h (revision 0) +++ firmware/target/hosted/webos/buttonmap.h (revision 0) @@ -0,0 +1,43 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: buttonmap.h 29516 2011-03-05 15:31:52Z thomasjfox $ + * + * Copyright (C) 2010 by Fred Bauer + * + * 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. + * + ****************************************************************************/ + +#ifndef __BUTTONMAP_H__ +#define __BUTTONMAP_H__ +/* Button maps: simulated key, x, y, radius, name */ +/* Run sim with --mapping to get coordinates */ +/* or --debugbuttons to check */ +/* The First matching button is returned */ +struct button_map { + int button, x, y, radius; + char *description; +}; + +extern struct button_map bm[]; + +int xy2button( int x, int y); + +/* for the sim, these function is implemented in uisimulator/buttonmap/ *.c */ +int key_to_button(int keyboard_button); +#ifdef HAVE_TOUCHSCREEN +int key_to_touch(int keyboard_button, unsigned int mouse_coords); +#endif + +#endif /* __BUTTONMAP_H__ */ Index: firmware/target/hosted/webos/app/adc-target.h =================================================================== --- firmware/target/hosted/webos/app/adc-target.h (revision 0) +++ firmware/target/hosted/webos/app/adc-target.h (revision 0) @@ -0,0 +1,25 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: adc-target.h 29516 2011-03-05 15:31:52Z thomasjfox $ + * + * Copyright (C) 2010 by Thomas Martitz + * + * 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. + * + ****************************************************************************/ + +#ifndef __ADC_TARGET_H__ +#define __ADC_TARGET_H__ + +#endif /* __ADC_TARGET_H__ */ Index: firmware/target/hosted/webos/app/backlight-target.h =================================================================== --- firmware/target/hosted/webos/app/backlight-target.h (revision 0) +++ firmware/target/hosted/webos/app/backlight-target.h (revision 0) @@ -0,0 +1,25 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: backlight-target.h 29516 2011-03-05 15:31:52Z thomasjfox $ + * + * Copyright (C) 2010 by Thomas Martitz + * + * 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. + * + ****************************************************************************/ + +#ifndef __BACKLIGHT_TARGET_H__ +#define __BACKLIGHT_TARGET_H__ + +#endif /* __BACKLIGHT_TARGET_H__ */ Index: firmware/target/hosted/webos/app/usb-target.h =================================================================== --- firmware/target/hosted/webos/app/usb-target.h (revision 0) +++ firmware/target/hosted/webos/app/usb-target.h (revision 0) @@ -0,0 +1,25 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: usb-target.h 29516 2011-03-05 15:31:52Z thomasjfox $ + * + * Copyright (C) 2010 by Thomas Martitz + * + * 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. + * + ****************************************************************************/ + +#ifndef __USB_TARGET_H__ +#define __USB_TARGET_H__ + +#endif /* __USB_TARGET_H__ */ Index: firmware/target/hosted/webos/app/button-target.h =================================================================== --- firmware/target/hosted/webos/app/button-target.h (revision 0) +++ firmware/target/hosted/webos/app/button-target.h (revision 0) @@ -0,0 +1,71 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: button-target.h 29516 2011-03-05 15:31:52Z thomasjfox $ + * + * Copyright (C) 2007 by Rob Purchase + * + * 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. + * + ****************************************************************************/ + +#ifndef _BUTTON_TARGET_H_ +#define _BUTTON_TARGET_H_ + +#include +#include "config.h" +/* + +#define HAS_BUTTON_HOLD + +bool button_hold(void); +*/ +void button_init_device(void); +#ifdef HAVE_BUTTON_DATA +int button_read_device(int *data); +#else +int button_read_device(void); +#endif + +/* Main unit's buttons */ +#define BUTTON_UP 0x00000001 +#define BUTTON_DOWN 0x00000002 +#define BUTTON_LEFT 0x00000004 +#define BUTTON_RIGHT 0x00000008 +#define BUTTON_SELECT 0x00000010 +#define BUTTON_MENU 0x00000020 +#define BUTTON_BACK 0x00000040 +#define BUTTON_SCROLL_FWD 0x00000100 +#define BUTTON_SCROLL_BACK 0x00000200 + +/* Touch Screen Area Buttons */ +#define BUTTON_TOPLEFT 0x00001000 +#define BUTTON_TOPMIDDLE 0x00002000 +#define BUTTON_TOPRIGHT 0x00004000 +#define BUTTON_MIDLEFT 0x00008000 +#define BUTTON_CENTER 0x00010000 +#define BUTTON_MIDRIGHT 0x00020000 +#define BUTTON_BOTTOMLEFT 0x00040000 +#define BUTTON_BOTTOMMIDDLE 0x00080000 +#define BUTTON_BOTTOMRIGHT 0x00100000 + +#define BUTTON_MAIN 0x1FFF + +/* No remote */ +#define BUTTON_REMOTE 0 + +/* Software power-off */ +#define POWEROFF_BUTTON BUTTON_POWER +#define POWEROFF_COUNT 10 + +#endif /* _BUTTON_TARGET_H_ */ Index: firmware/target/hosted/webos/app/i2c-target.h =================================================================== --- firmware/target/hosted/webos/app/i2c-target.h (revision 0) +++ firmware/target/hosted/webos/app/i2c-target.h (revision 0) @@ -0,0 +1,25 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: i2c-target.h 29516 2011-03-05 15:31:52Z thomasjfox $ + * + * Copyright (C) 2010 by Thomas Martitz + * + * 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. + * + ****************************************************************************/ + +#ifndef __I2C_TARGET_H__ +#define __I2C_TARGET_H__ + +#endif /* __I2C_TARGET_H__ */ Index: firmware/target/hosted/webos/button-sdl.h =================================================================== --- firmware/target/hosted/webos/button-sdl.h (revision 0) +++ firmware/target/hosted/webos/button-sdl.h (revision 0) @@ -0,0 +1,40 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: button-sdl.h 29248 2011-02-08 20:05:25Z thomasjfox $ + * + * Copyright (C) 2009 by Thomas Martitz + * + * 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. + * + ****************************************************************************/ + + +#ifndef __BUTTON_SDL_H__ +#define __BUTTON_SDL_H__ + +#include +#include "config.h" + +extern int sdl_app_has_input_focus; + +bool button_hold(void); +#undef button_init_device +void button_init_device(void); +#ifdef HAVE_BUTTON_DATA +int button_read_device(int *data); +#else +int button_read_device(void); +#endif + +#endif /* __BUTTON_SDL_H__ */ Index: firmware/target/hosted/webos/system-sdl.h =================================================================== --- firmware/target/hosted/webos/system-sdl.h (revision 0) +++ firmware/target/hosted/webos/system-sdl.h (revision 0) @@ -0,0 +1,64 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: system-sdl.h 31339 2011-12-17 07:27:24Z jethead71 $ + * + * Copyright (C) 2007 by Michael Sevakis + * + * 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. + * + ****************************************************************************/ +#ifndef _SYSTEM_SDL_H_ +#define _SYSTEM_SDL_H_ + +#include +#include "config.h" +#include "gcc_extensions.h" + +#define HIGHEST_IRQ_LEVEL 1 + +int set_irq_level(int level); + +#define disable_irq() \ + ((void)set_irq_level(HIGHEST_IRQ_LEVEL)) + +#define enable_irq() \ + ((void)set_irq_level(0)) + +#define disable_irq_save() \ + set_irq_level(HIGHEST_IRQ_LEVEL) + +#define restore_irq(level) \ + ((void)set_irq_level(level)) + +void sim_enter_irq_handler(void); +void sim_exit_irq_handler(void); +void sim_kernel_shutdown(void); +void sys_poweroff(void); +void sys_handle_argv(int argc, char *argv[]); +void gui_message_loop(void); +void sim_do_exit(void) NORETURN_ATTR; +#ifndef HAVE_SDL_THREADS +void wait_for_interrupt(void); +#endif + +extern bool background; /* True if the background image is enabled */ +extern bool showremote; +extern int display_zoom; +extern long start_tick; + +static inline void commit_dcache(void) {} +static inline void commit_discard_dcache(void) {} +static inline void commit_discard_idcache(void) {} + +#endif /* _SYSTEM_SDL_H_ */ Index: firmware/target/hosted/webos/system-target.h =================================================================== --- firmware/target/hosted/webos/system-target.h (revision 0) +++ firmware/target/hosted/webos/system-target.h (revision 0) @@ -0,0 +1,4 @@ +#include "system-sdl.h" + +#define NEED_GENERIC_BYTESWAPS + Index: firmware/target/hosted/sdl/system-sdl.c =================================================================== --- firmware/target/hosted/sdl/system-sdl.c (revision 31467) +++ firmware/target/hosted/sdl/system-sdl.c (working copy) @@ -132,6 +132,9 @@ /* Fullscreen mode for maemo app */ flags |= SDL_FULLSCREEN; #endif +#if (CONFIG_PLATFORM & PLATFORM_WEBOS) + flags = SDL_SWSURFACE; +#endif if ((gui_surface = SDL_SetVideoMode(width * display_zoom, height * display_zoom, depth, flags)) == NULL) { panicf("%s", SDL_GetError()); @@ -244,7 +247,11 @@ g_type_init(); #endif +#if (CONFIG_PLATFORM & PLATFORM_WEBOS) + if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER)) +#else if (SDL_Init(SDL_INIT_TIMER)) +#endif panicf("%s", SDL_GetError()); s = SDL_CreateSemaphore(0); /* 0-count so it blocks */