Index: tools/configure =================================================================== --- tools/configure (revision 29632) +++ tools/configure (working copy) @@ -1273,6 +1273,7 @@ 202) Nokia N8xx 203) Nokia N900 204) Pandora + 205) Zipit Z2 EOF @@ -3082,6 +3083,36 @@ t_model="app" ;; + 205|zipitz2) + application="yes" + target_id=78 + modelname="zipitz2" + app_type="sdl-app" + target="-DZIPIT_Z2" + #app_set_paths + sharedir="/usr/local/share/rockbox" + bindir="/usr/local/bin" + libdir="/usr/local/lib" + app_set_lcd_size 320 240 + memory=8 + uname=`uname` + simcc "sdl-app" #Should be zipitcc so I can decide if -DIZ2S + extradefines="$extradefines -DIZ2S" #Remove this when zipitcc works. + tool="cp " + boottool="cp " + bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" + bmp2rb_native="$rootdir/tools/bmp2rb -f 4" + output="rockbox.bin" + bootoutput="rockbox.bin" + appextra="recorder:gui:radio" + plugins= + swcodec="yes" + # architecture, manufacturer and model for the target-tree build + t_cpu="hosted" + t_manufacturer="zipit" + t_model="app" + ;; + *) echo "Please select a supported target platform!" exit 7 @@ -3543,6 +3574,10 @@ # Pandora needs the SDL port, too TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl/app" TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl" + elif [ "$t_cpu" = "hosted" ] && [ "$t_manufacturer" = "zipit" ]; then + # Zipit needs the SDL port, too + TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl/app" + TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl" elif [ "$simulator" = "yes" ]; then # a few more includes for the sim target tree TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl" TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted" Index: apps/codecs.c =================================================================== --- apps/codecs.c (revision 29632) +++ apps/codecs.c (working copy) @@ -54,7 +54,7 @@ #define LOGF_ENABLE #include "logf.h" -#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) +#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA|PLATFORM_ZIPIT_Z2)) #define PREFIX(_x_) sim_ ## _x_ #else #define PREFIX(_x_) _x_ Index: apps/SOURCES =================================================================== --- apps/SOURCES (revision 29632) +++ apps/SOURCES (working copy) @@ -312,6 +312,14 @@ keymaps/keymap-mpio-hd300.c #elif CONFIG_KEYPAD == ANDROID_PAD keymaps/keymap-android.c +#elif CONFIG_KEYPAD == ZIPIT_Z2_PAD +keymaps/keymap-sdl.c +#ifndef HAVE_TOUCHSCREEN +keymaps/keymap-touchscreen.c +#endif #elif CONFIG_KEYPAD == SDL_PAD keymaps/keymap-sdl.c +#ifndef HAVE_TOUCHSCREEN +keymaps/keymap-touchscreen.c #endif +#endif Index: apps/main.c =================================================================== --- apps/main.c (revision 29632) +++ apps/main.c (working copy) @@ -125,7 +125,7 @@ #define MAIN_NORETURN_ATTR #endif -#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) +#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA|PLATFORM_ZIPIT_Z2)) #include "sim_tasks.h" #include "system-sdl.h" #define HAVE_ARGV_MAIN @@ -352,7 +352,7 @@ button_init(); powermgmt_init(); backlight_init(); -#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) +#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA|PLATFORM_ZIPIT_Z2)) sim_tasks_init(); #endif #if (CONFIG_PLATFORM & PLATFORM_ANDROID) Index: firmware/export/config.h =================================================================== --- firmware/export/config.h (revision 29632) +++ firmware/export/config.h (working copy) @@ -87,6 +87,7 @@ #define PLATFORM_MAEMO5 (1<<5) #define PLATFORM_MAEMO (PLATFORM_MAEMO4|PLATFORM_MAEMO5) #define PLATFORM_PANDORA (1<<6) +#define PLATFORM_ZIPIT_Z2 (1<<7) /* CONFIG_KEYPAD */ #define PLAYER_PAD 1 @@ -451,6 +452,8 @@ #include "config/nokian900.h" #elif defined(PANDORA) #include "config/pandora.h" +#elif defined(ZIPIT_Z2) +#include "config/zipit_z2.h" #else /* no known platform */ #endif @@ -525,6 +528,7 @@ #define ARM_ARCH 6 /* ARMv6 */ #elif defined(CPU_TCC77X) || defined(CPU_TCC780X) || (CONFIG_CPU == DM320) \ + || (CONFIG_PLATFORM & PLATFORM_ZIPIT_Z2) \ || (CONFIG_CPU == AT91SAM9260) || (CONFIG_CPU == AS3525v2) \ || (CONFIG_CPU == S5L8702) || (CONFIG_PLATFORM & PLATFORM_ANDROID) #define CPU_ARM Index: firmware/include/dir_uncached.h =================================================================== --- firmware/include/dir_uncached.h (revision 29632) +++ firmware/include/dir_uncached.h (working copy) @@ -33,7 +33,7 @@ #include #include "file.h" -#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) +#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA|PLATFORM_ZIPIT_Z2)) # define dirent_uncached sim_dirent # define DIR_UNCACHED SIM_DIR # define opendir_uncached sim_opendir Index: firmware/include/file.h =================================================================== --- firmware/include/file.h (revision 29632) +++ firmware/include/file.h (working copy) @@ -46,7 +46,7 @@ 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|PLATFORM_PANDORA)) +# if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA|PLATFORM_ZIPIT_Z2)) # define filesize(x) sim_filesize(x) # define fsync(x) sim_fsync(x) # define ftruncate(x,y) sim_ftruncate(x,y) Index: firmware/SOURCES =================================================================== --- firmware/SOURCES (revision 29632) +++ firmware/SOURCES (working copy) @@ -1802,3 +1802,7 @@ drivers/audio/android.c thread.c #endif + +#if (CONFIG_PLATFORM & PLATFORM_ZIPIT_Z2) +target/hosted/zipit/powermgmt-zipit-z2.c +#endif Index: firmware/target/hosted/sdl/app/button-application.c =================================================================== --- firmware/target/hosted/sdl/app/button-application.c (revision 29632) +++ firmware/target/hosted/sdl/app/button-application.c (working copy) @@ -17,7 +17,7 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - ***************************************************9*************************/ + ****************************************************************************/ #include @@ -50,8 +50,50 @@ case SDLK_LEFT: new_btn = BUTTON_MIDLEFT; break; -#if (CONFIG_PLATFORM & PLATFORM_MAEMO|PLATFORM_PANDORA) +#if (CONFIG_PLATFORM & PLATFORM_ZIPIT_Z2) + case SDLK_HOME: /* Maybe switch home/end (prev/next on zipit z2) */ + case SDLK_TAB: + case SDLK_o: + case SDLK_9: + /* new_btn = BUTTON_MENU; */ + new_btn = BUTTON_TOPLEFT; + break; + case SDLK_END: /* Maybe switch home/end (prev/next on zipit z2) */ + case SDLK_p: + case SDLK_0: + /* new_btn = BUTTON_BACK; */ + new_btn = BUTTON_TOPRIGHT; + break; + case SDLK_KP_PLUS: + case SDLK_PAGEUP: + /* new_btn = BUTTON_VOL_UP (not in sdl button_target.h) */ + /* No BUTTON_VOL_UP defined in SDL application. Add it? */ + new_btn = BUTTON_TOPMIDDLE; + break; + case SDLK_KP_MINUS: + case SDLK_PAGEDOWN: + /* new_btn = BUTTON_VOL_DOWN (not in sdl button_target.h) */ + new_btn = BUTTON_BOTTOMMIDDLE; + break; + case SDLK_COMMA: + new_btn = BUTTON_MIDLEFT; + break; + case SDLK_l: + new_btn = BUTTON_BOTTOMLEFT; + break; + case SDLK_PERIOD: + case SDLK_KP_PERIOD: + new_btn = BUTTON_MIDRIGHT; + break; + case SDLK_BACKSPACE: + new_btn = BUTTON_BOTTOMRIGHT; + break; + case SDLK_KP_ENTER: case SDLK_RETURN: + case SDLK_SPACE: +#endif /* ZIPIT_Z2 */ +#if (CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_PANDORA)) + case SDLK_RETURN: case SDLK_KP_ENTER: #endif case SDLK_KP5: Index: firmware/target/hosted/sdl/system-sdl.c =================================================================== --- firmware/target/hosted/sdl/system-sdl.c (revision 29632) +++ firmware/target/hosted/sdl/system-sdl.c (working copy) @@ -128,7 +128,7 @@ depth = 16; flags = SDL_HWSURFACE|SDL_DOUBLEBUF; -#if (CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_PANDORA)) +#if (CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_PANDORA|PLATFORM_ZIPIT_Z2)) /* Fullscreen mode for maemo app */ flags |= SDL_FULLSCREEN; #endif @@ -137,7 +137,7 @@ panicf("%s", SDL_GetError()); } -#if (CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_PANDORA)) +#if (CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_PANDORA|PLATFORM_ZIPIT_Z2)) /* Hide mouse cursor on real touchscreen device */ SDL_ShowCursor(SDL_DISABLE); #endif Index: firmware/target/hosted/sdl/button-sdl.c =================================================================== --- firmware/target/hosted/sdl/button-sdl.c (revision 29632) +++ firmware/target/hosted/sdl/button-sdl.c (working copy) @@ -322,6 +322,12 @@ } return; +#if (CONFIG_PLATFORM & PLATFORM_ZIPIT_Z2) + case SDLK_ESCAPE: + /* Will post SDL_USEREVENT in shutdown_hw() if successful. */ + sys_poweroff(); + break; +#endif #if (CONFIG_PLATFORM & PLATFORM_PANDORA) case SDLK_LCTRL: /* Will post SDL_USEREVENT in shutdown_hw() if successful. */ Index: firmware/common/rbpaths.c =================================================================== --- firmware/common/rbpaths.c (revision 29632) +++ firmware/common/rbpaths.c (working copy) @@ -43,7 +43,7 @@ #define opendir opendir_android #define mkdir mkdir_android #define rmdir rmdir_android -#elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) +#elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA|PLATFORM_ZIPIT_Z2)) #define open sim_open #define remove sim_remove #define rename sim_rename Index: firmware/common/filefuncs.c =================================================================== --- firmware/common/filefuncs.c (revision 29632) +++ firmware/common/filefuncs.c (working copy) @@ -91,7 +91,7 @@ #endif /* __PCTOOL__ */ -#if (CONFIG_PLATFORM & (PLATFORM_NATIVE|PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) +#if (CONFIG_PLATFORM & (PLATFORM_NATIVE|PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA|PLATFORM_ZIPIT_Z2)) struct dirinfo dir_get_info(DIR* parent, struct dirent *entry) { (void)parent; Index: firmware/drivers/lcd-16bit.c =================================================================== --- firmware/drivers/lcd-16bit.c (revision 29632) +++ firmware/drivers/lcd-16bit.c (working copy) @@ -855,10 +855,10 @@ #ifdef CPU_ARM { int w, px; - asm volatile ( - ".rowstart: \n" + asm volatile ( + ".rowstart%=: \n" "mov %[w], %[width] \n" /* Load width for inner loop */ - ".nextpixel: \n" + ".nextpixel%=: \n" "ldrh %[px], [%[s]], #2 \n" /* Load src pixel */ "add %[d], %[d], #2 \n" /* Uncoditionally increment dst */ /* done here for better pipelining */ @@ -867,11 +867,11 @@ "cmpne %[px], %[transcolor] \n" /* Compare to transparent color */ "strneh %[px], [%[d], #-2] \n" /* Store dst if not transparent */ "subs %[w], %[w], #1 \n" /* Width counter has run down? */ - "bgt .nextpixel \n" /* More in this row? */ + "bgt .nextpixel%= \n" /* More in this row? */ "add %[s], %[s], %[sstp], lsl #1 \n" /* Skip over to start of next line */ "add %[d], %[d], %[dstp], lsl #1 \n" "subs %[h], %[h], #1 \n" /* Height counter has run down? */ - "bgt .rowstart \n" /* More rows? */ + "bgt .rowstart%= \n" /* More rows? */ : [w]"=&r"(w), [h]"+&r"(height), [px]"=&r"(px), [s]"+&r"(src), [d]"+&r"(dst) : [width]"r"(width), Index: uisimulator/common/SOURCES =================================================================== --- uisimulator/common/SOURCES (revision 29632) +++ uisimulator/common/SOURCES (working copy) @@ -12,7 +12,7 @@ io.c sim_tasks.c /* this is still needed for application since it has some stubs */ -#if !(CONFIG_PLATFORM & PLATFORM_MAEMO) +#if !(CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_ZIPIT_Z2)) powermgmt-sim.c #endif stubs.c