Index: tools/configure =================================================================== --- tools/configure (revision 18139) +++ tools/configure (working copy) @@ -667,7 +667,7 @@ ################################################################## # Figure out target platform # - +uname=`uname` if [ "1" != `parse_args --target` ]; then buildfor=`parse_args --target`; else @@ -700,6 +700,10 @@ ==Onda== 120) VX747 + + ==Rockbox As an App== + 200) SDL Application + EOF buildfor=`input`; @@ -1689,6 +1693,35 @@ t_manufacturer="tatung" t_model="tpj1022" ;; + + 200) + target_id=42 + modelname="sdl" + target="-DSDL" # The #define used in firmware/export/config.h for conditional compilation + memory=16 # how many megabytes of RAM + simcc # Which compiler to use, see the beginning of the file + tool="" #"$rootdir/tools/scramble -add=iax5" # Which command to use for creating a rockbox binary to be loaded by the boot loader + bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" # How to create a monochrome bitmap + bmp2rb_native="$rootdir/tools/bmp2rb -f 4" # How to create a native bitmap + bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0" # How to create a monochrome bitmap for the remote lcd + bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0" # How to create a native bitmap for the remote lcd + bootoutput="rockbox.bin" + output="rockbox" # The name of the Rockbox binary file + appextra="recorder:gui" # What directories in the apps/ tree to include in compilation + archosrom="" # The name of the binary file if the device supports running directly from flash (mostly Archos related) + flash="" # The name of the Rockbox binary file if the device supports having the binary in flash (mostly Archos related) + swcodec="yes" + codecs="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a" # What codecs it supports + # toolset is the tools within the tools directory that we build for this particular target. + toolset="$genericbitmaptools" + # architecture, manufacturer and model for the target-tree build + t_cpu="generic" + t_manufacturer="sdl" + #t_model="" + boottool="cp" + USE_ELF="yes" + buildsdl="yes" + ;; 100|sa9200) target_id=41 @@ -2118,10 +2151,14 @@ GCCOPTS="$GCCOPTS" fi -if test "$simulator" = "yes"; then +if test "$simulator" = "yes"] ; then # add simul make stuff on the #SIMUL# line simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim," simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim," +elif test "$buildsdl" = "yes"; then + # add simul make stuff on the #SIMUL# line + simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim," + simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim," else # delete the lines that match simmagic1='/@SIMUL1@/D' Index: apps/codecs.c =================================================================== --- apps/codecs.c (revision 18139) +++ apps/codecs.c (working copy) @@ -55,7 +55,7 @@ #define LOGF_ENABLE #include "logf.h" -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(HAVE_SHARED_LIBS) #if CONFIG_CODEC == SWCODEC unsigned char codecbuf[CODEC_SIZE]; #endif @@ -177,7 +177,7 @@ { struct codec_header *hdr; int status; -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(HAVE_SHARED_LIBS) hdr = (struct codec_header *)codecbuf; if (size <= (signed)sizeof(struct codec_header) @@ -211,7 +211,7 @@ sim_codec_close(pd); return CODEC_ERROR; } -#endif /* SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(HAVE_SHARED_LIBS) */ if (hdr->api_version > CODEC_API_VERSION || hdr->api_version < CODEC_MIN_API_VERSION) { sim_codec_close(pd); Index: apps/playlist.c =================================================================== --- apps/playlist.c (revision 18139) +++ apps/playlist.c (working copy) @@ -1354,7 +1354,7 @@ dirty_pointers = false; break ; -#ifndef SIMULATOR +#ifdef HAVE_DISK_MODE case SYS_USB_CONNECTED: usb_acknowledge(SYS_USB_CONNECTED_ACK); usb_wait_for_disconnect(&playlist_queue); Index: apps/screens.c =================================================================== --- apps/screens.c (revision 18139) +++ apps/screens.c (working copy) @@ -139,7 +139,7 @@ } gui_syncstatusbar_draw(&statusbars, true); -#ifdef SIMULATOR +#ifndef HAVE_DISK_MODE while (button_get(true) & BUTTON_REL); #else usb_acknowledge(SYS_USB_CONNECTED_ACK); @@ -151,7 +151,7 @@ gui_syncstatusbar_draw(&statusbars, false); } } -#endif /* SIMULATOR */ +#endif /* HAVE_DISK_MODE */ #ifdef HAVE_LCD_CHARCELLS status_set_usb(false); #endif /* HAVE_LCD_CHARCELLS */ Index: apps/codecs.h =================================================================== --- apps/codecs.h (revision 18139) +++ apps/codecs.h (working copy) @@ -70,7 +70,7 @@ #endif -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #define PREFIX(_x_) sim_ ## _x_ #else #define PREFIX(_x_) _x_ Index: apps/Makefile =================================================================== --- apps/Makefile (revision 18139) +++ apps/Makefile (working copy) @@ -141,8 +141,21 @@ $(OBJDIR)/rombox.elf : $(OBJS) $(LINKROM) $(DEPFILE) $(LIBROCKBOX) $(VOICE) $(BITMAPLIBS) $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lrockbox -lgcc $(LINKVOICE) $(LINKBITMAPS) -L$(BUILDDIR)/firmware -T$(LINKROM) -Wl,-Map,$(OBJDIR)/rombox.map -ifndef SIMVER +#hack to test if its a sim or an SDL builds +temp=0 +ifdef SIMVER +temp=1 +endif +ifdef SDL +temp=1 +endif +ifeq "$(temp)" "0" + +#if (!defined(SIMVER) && !defined(SDL)) + +#ifndef SIMVER + $(OBJDIR)/rockbox.elf : $(OBJS) $(LINKFILE) $(DEPFILE) $(LIBROCKBOX) $(VOICE) $(BITMAPLIBS) $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR)/firmware -L$(BUILDDIR) -lrockbox $(LINKVOICE) $(LINKBITMAPS) -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockbox.map @@ -175,12 +188,6 @@ else # this is a simulator build -ifeq ($(SIMVER), win32) -# OK, this is ugly but we need it on the link line to make it do right -EXTRAOBJ = $(BUILDDIR)/sim/uisw32-res.o -LDOPTS += -lwinmm -endif - # OS X's ld does not support -Map ifeq ($(UNAME), Darwin) SIMULATOR_MAP= Index: apps/plugins/Makefile =================================================================== --- apps/plugins/Makefile (revision 18139) +++ apps/plugins/Makefile (working copy) @@ -87,30 +87,15 @@ $(BITMAPLIBS): $(BUILDDIR)/libplugin%.a: build-% -ifndef SIMVER -$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(BUILDDIR)/libplugin.a $(BITMAPLIBS) - $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -lgcc \ - -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/$*.map +#ifndef SIMVER +#$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(BUILDDIR)/libplugin.a $(BITMAPLIBS) +# $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -lgcc \ +# -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/$*.map +# +#$(OBJDIR)/%.rock : $(OBJDIR)/%.elf +# $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@ +#else -$(OBJDIR)/%.rock : $(OBJDIR)/%.elf - $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@ -else - -ifeq ($(SIMVER), x11) -################################################### -# This is the X11 simulator version - -$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a $(BITMAPLIBS) - $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@ -ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) -# 'x' must be kept or you'll have "Win32 error 5" -# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 -# #define ERROR_ACCESS_DENIED 5L -else - $(SILENT)chmod -x $@ -endif - -else # end of x11-simulator ifeq ($(SIMVER), sdl) ################################################### # This is the SDL simulator version @@ -125,27 +110,9 @@ $(SILENT)chmod -x $@ endif -else # end of sdl-simulator -################################################### -# This is the win32 simulator version -DLLTOOLFLAGS = --export-all -DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin - -$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a $(BITMAPLIBS) - $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $< - $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(BUILDDIR)/libplugin.a $(BITMAPLIBS) \ - $(patsubst -l%,$(BUILDDIR)/lib%.a,$(CODECLIBS)) -o $@ -ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) -# 'x' must be kept or you'll have "Win32 error 5" -# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 -# #define ERROR_ACCESS_DENIED 5L -else - $(SILENT)chmod -x $@ endif -endif # end of win32-simulator -endif -endif # end of simulator section +#endif # end of simulator section include $(TOOLSDIR)/make.inc Index: apps/plugins/lib/pluginlib_actions.c =================================================================== --- apps/plugins/lib/pluginlib_actions.c (revision 18139) +++ apps/plugins/lib/pluginlib_actions.c (working copy) @@ -39,7 +39,8 @@ { PLA_RIGHT_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE}, #elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) || \ (CONFIG_KEYPAD == IRIVER_H10_PAD) || \ - (CONFIG_KEYPAD == GIGABEAT_PAD) + (CONFIG_KEYPAD == GIGABEAT_PAD) ||\ + (CONFIG_KEYPAD == SDL_PAD) ||\ { PLA_UP, BUTTON_RC_FF, BUTTON_NONE}, { PLA_DOWN, BUTTON_RC_REW, BUTTON_NONE}, { PLA_LEFT, BUTTON_RC_VOL_DOWN, BUTTON_NONE}, @@ -81,6 +82,7 @@ || (CONFIG_KEYPAD == IRIVER_H300_PAD) \ || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \ || (CONFIG_KEYPAD == GIGABEAT_PAD) \ + || (CONFIG_KEYPAD == SDL_PAD) \ || (CONFIG_KEYPAD == RECORDER_PAD) \ || (CONFIG_KEYPAD == ARCHOS_AV300_PAD) \ || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \ @@ -174,6 +176,7 @@ || (CONFIG_KEYPAD == IRIVER_H300_PAD) \ || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \ || (CONFIG_KEYPAD == GIGABEAT_PAD) \ + || (CONFIG_KEYPAD == SDL_PAD) \ || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \ || (CONFIG_KEYPAD == GIGABEAT_S_PAD) \ || (CONFIG_KEYPAD == MROBE100_PAD) \ @@ -301,7 +304,7 @@ {PLA_FIRE, BUTTON_RC_MODE, BUTTON_NONE}, {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE}, {PLA_FIRE_REPEAT, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_NONE}, -#elif CONFIG_KEYPAD == GIGABEAT_PAD +#elif CONFIG_KEYPAD == GIGABEAT_PAD || CONFIG_KEYPAD == SDL_PAD {PLA_QUIT, BUTTON_POWER, BUTTON_NONE}, {PLA_START, BUTTON_A, BUTTON_NONE}, {PLA_MENU, BUTTON_MENU, BUTTON_NONE}, @@ -409,6 +412,7 @@ || (CONFIG_KEYPAD == IRIVER_H300_PAD) \ || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \ || (CONFIG_KEYPAD == GIGABEAT_PAD) \ + || (CONFIG_KEYPAD == SDL_PAD) \ || (CONFIG_KEYPAD == RECORDER_PAD) \ || (CONFIG_KEYPAD == ARCHOS_AV300_PAD) \ || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \ Index: apps/plugins/lib/overlay.c =================================================================== --- apps/plugins/lib/overlay.c (revision 18139) +++ apps/plugins/lib/overlay.c (working copy) @@ -21,7 +21,7 @@ * ****************************************************************************/ -#ifndef SIMULATOR +#if !defined(SIMULATOR ) || !defined(HAVE_SHARED_LIBS) #include "plugin.h" #include "overlay.h" Index: apps/plugins/lib/overlay.h =================================================================== --- apps/plugins/lib/overlay.h (revision 18139) +++ apps/plugins/lib/overlay.h (working copy) @@ -24,7 +24,7 @@ #ifndef __OVERLAY_H__ #define __OVERLAY_H__ -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #include "plugin.h" /* load and run a plugin linked as an overlay. */ Index: apps/settings.h =================================================================== --- apps/settings.h (revision 18139) +++ apps/settings.h (working copy) @@ -171,7 +171,7 @@ This helps to save space for menus and options. */ #define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */ -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(HAVE_SHARED_LIBS) /* a space which is defined in stubs.c */ extern unsigned char vp_dummy[VIRT_SIZE]; #define VIRT_PTR vp_dummy Index: apps/menus/main_menu.c =================================================================== --- apps/menus/main_menu.c (revision 18139) +++ apps/menus/main_menu.c (working copy) @@ -405,7 +405,7 @@ #endif ) { -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) struct info_data *info = (struct info_data *)lists->data; info->new_data = true; gui_syncsplash(0, ID2P(LANG_SCANNING_DISK)); Index: apps/filetree.c =================================================================== --- apps/filetree.c (revision 18139) +++ apps/filetree.c (working copy) @@ -520,7 +520,7 @@ break; #endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) /* firmware file */ case FILE_ATTR_MOD: gui_syncsplash(0, ID2P(LANG_WAIT)); Index: apps/tagcache.c =================================================================== --- apps/tagcache.c (revision 18139) +++ apps/tagcache.c (working copy) @@ -4373,7 +4373,7 @@ case SYS_POWEROFF: break ; -#ifndef SIMULATOR +#ifdef HAVE_DISK_MODE case SYS_USB_CONNECTED: logf("USB: TagCache"); usb_acknowledge(SYS_USB_CONNECTED_ACK); Index: apps/playback.c =================================================================== --- apps/playback.c (revision 18139) +++ apps/playback.c (working copy) @@ -504,7 +504,7 @@ bool audio_load_encoder(int afmt) { -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(HAVE_SHARED_LIBS) const char *enc_fn = get_codec_filename(afmt | CODEC_TYPE_ENCODER); if (!enc_fn) return false; @@ -529,7 +529,7 @@ void audio_remove_encoder(void) { -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(HAVE_SHARED_LIBS) /* force encoder codec unload (if currently loaded) */ if (ci.enc_codec_loaded <= 0) return; @@ -2459,7 +2459,7 @@ audio_finalise_track_change(); break; -#ifndef SIMULATOR +#ifdef HAVE_DISK_MODE case SYS_USB_CONNECTED: LOGFQUEUE("audio < SYS_USB_CONNECTED"); if (playing) Index: apps/status.h =================================================================== --- apps/status.h (revision 18139) +++ apps/status.h (working copy) @@ -46,7 +46,7 @@ enum playmode status_get_ffmode(void); int current_playmode(void); -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #include #endif #ifdef HAVE_LCD_CHARCELLS Index: apps/plugin.c =================================================================== --- apps/plugin.c (revision 18139) +++ apps/plugin.c (working copy) @@ -49,7 +49,7 @@ #include "bidi.h" #endif -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(HAVE_SHARED_LIBS) static unsigned char pluginbuf[PLUGIN_BUFFER_SIZE]; void *sim_plugin_load(char *plugin, void **pd); void sim_plugin_close(void *pd); @@ -123,7 +123,7 @@ || defined(IRIVER_H10) || defined(COWON_D2) lcd_yuv_set_options, #endif -#elif (LCD_DEPTH < 4) && !defined(SIMULATOR) +#elif (LCD_DEPTH < 4) && !defined(SIMULATOR) && !defined(SDL) lcd_blit_mono, lcd_blit_grey_phase, #endif /* LCD_DEPTH */ @@ -296,7 +296,7 @@ #endif reset_poweroff_timer, -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) system_memory_guard, &cpu_frequency, @@ -307,7 +307,7 @@ cpu_boost, #endif #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ -#endif /* !SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ #ifdef HAVE_SCHEDULER_BOOSTCTRL trigger_cpu_boost, cancel_cpu_boost, @@ -339,7 +339,7 @@ profile_func_exit, #endif -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) /* special simulator hooks */ #if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8 sim_lcd_ex_init, @@ -385,7 +385,7 @@ sound_max, sound_unit, sound_val2phys, -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) mp3_play_data, mp3_play_pause, mp3_play_stop, @@ -494,7 +494,7 @@ battery_level, battery_level_safe, battery_time, -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) battery_voltage, #endif #if CONFIG_CHARGING @@ -613,7 +613,7 @@ { int rc; struct plugin_header *hdr; -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) void *pd; #else /* !SIMULATOR */ int fd; @@ -641,7 +641,7 @@ gui_syncsplash(0, ID2P(LANG_WAIT)); strcpy(current_plugin, plugin); -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(HAVE_SHARED_LIBS) hdr = sim_plugin_load((char *)plugin, &pd); if (pd == NULL) { gui_syncsplash(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin); Index: apps/SOURCES =================================================================== --- apps/SOURCES (revision 18139) +++ apps/SOURCES (working copy) @@ -198,4 +198,6 @@ keymaps/keymap-sa9200.c #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD keymaps/keymap-hdd1630.c +#elif CONFIG_KEYPAD == SLD_PAD +keymaps/keymap-sdl.c #endif Index: apps/plugin.h =================================================================== --- apps/plugin.h (revision 18139) +++ apps/plugin.h (working copy) @@ -119,7 +119,7 @@ #endif -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #define PREFIX(_x_) sim_ ## _x_ #else #define PREFIX(_x_) _x_ @@ -209,7 +209,7 @@ || defined(IRIVER_H10) || defined(COWON_D2) void (*lcd_yuv_set_options)(unsigned options); #endif -#elif (LCD_DEPTH < 4) && !defined(SIMULATOR) +#elif (LCD_DEPTH < 4) && !defined(SIMULATOR) && !defined(SDL) void (*lcd_blit_mono)(const unsigned char *data, int x, int by, int width, int bheight, int stride); void (*lcd_blit_grey_phase)(unsigned char *values, unsigned char *phases, @@ -406,7 +406,7 @@ #endif void (*reset_poweroff_timer)(void); -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) int (*system_memory_guard)(int newmode); long *cpu_frequency; #ifdef HAVE_ADJUSTABLE_CPU_FREQ @@ -416,7 +416,7 @@ void (*cpu_boost)(bool on_off); #endif #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ -#endif /* !SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ #ifdef HAVE_SCHEDULER_BOOSTCTRL void (*trigger_cpu_boost)(void); void (*cancel_cpu_boost)(void); @@ -455,7 +455,7 @@ void (*profile_func_exit)(void *this_fn, void *call_site); #endif -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) /* special simulator hooks */ #if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8 void (*sim_lcd_ex_init)(int shades, unsigned long (*getpixel)(int, int)); @@ -502,7 +502,7 @@ int (*sound_max)(int setting); const char * (*sound_unit)(int setting); int (*sound_val2phys)(int setting, int value); -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) void (*mp3_play_data)(const unsigned char* start, int size, void (*get_more)(unsigned char** start, size_t* size)); void (*mp3_play_pause)(bool play); void (*mp3_play_stop)(void); @@ -510,7 +510,7 @@ #if CONFIG_CODEC != SWCODEC void (*bitswap)(unsigned char *data, int length); #endif -#endif /* !SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ #if CONFIG_CODEC == SWCODEC const unsigned long *audio_master_sampr_list; const unsigned long *hw_freq_sampr; @@ -630,7 +630,7 @@ int (*battery_level)(void); bool (*battery_level_safe)(void); int (*battery_time)(void); -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) unsigned int (*battery_voltage)(void); #endif #if CONFIG_CHARGING @@ -784,6 +784,7 @@ __attribute__ ((section (".header")))= { \ PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \ plugin_start_addr, plugin_end_addr, plugin_start }; + #else /* SIMULATOR */ #define PLUGIN_HEADER \ const struct plugin_header __header \ Index: apps/buffering.c =================================================================== --- apps/buffering.c (revision 18139) +++ apps/buffering.c (working copy) @@ -65,7 +65,7 @@ /* macros to enable logf for queues logging on SYS_TIMEOUT can be disabled */ -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) /* Define this for logf output of all queuing except SYS_TIMEOUT */ #define BUFFERING_LOGQUEUES /* Define this to logf SYS_TIMEOUT messages */ @@ -1385,7 +1385,7 @@ } break; -#ifndef SIMULATOR +#ifdef HAVE_DISK_MODE case SYS_USB_CONNECTED: LOGFQUEUE("buffering < SYS_USB_CONNECTED"); usb_acknowledge(SYS_USB_CONNECTED_ACK); Index: apps/debug_menu.c =================================================================== --- apps/debug_menu.c (revision 18139) +++ apps/debug_menu.c (working copy) @@ -53,7 +53,7 @@ #include "lcd-remote.h" #include "crc32.h" #include "logf.h" -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #include "disk.h" #include "adc.h" #include "power.h" @@ -222,7 +222,7 @@ #ifdef HAVE_LCD_BITMAP #if CONFIG_CODEC != SWCODEC -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) static bool dbg_audio_thread(void) { char buf[32]; @@ -268,7 +268,7 @@ } return false; } -#endif /* !SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ #else /* CONFIG_CODEC == SWCODEC */ extern size_t filebuflen; /* This is a size_t, but call it a long so it puts a - when it's bad. */ @@ -277,7 +277,7 @@ static void dbg_audio_task(void) { -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) if(FREQ > CPUFREQ_NORMAL) boost_ticks++; freq_sum += FREQ/1000000; /* in MHz */ @@ -368,7 +368,7 @@ snprintf(buf, sizeof(buf), "handle count: %d", (int)d.num_handles); lcd_puts(0, line++, buf); -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) snprintf(buf, sizeof(buf), "cpu freq: %3dMHz", (int)((FREQ + 500000) / 1000000)); lcd_puts(0, line++, buf); @@ -454,7 +454,7 @@ } #endif /* (CONFIG_CPU == SH7034 || CPU_COLDFIRE) */ -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #ifdef CPU_PP static int perfcheck(void) { @@ -770,9 +770,9 @@ return false; } #endif /* !HAVE_LCD_BITMAP */ -#endif /* !SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) static char* dbg_partitions_getname(int selected_item, void *data, char *buffer, size_t buffer_len) { @@ -955,7 +955,7 @@ lcd_puts(0, line++, buf); line++; -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) snprintf(buf, sizeof(buf), "Measured freq: %ldHz", spdif_measure_frequency()); lcd_puts(0, line++, buf); @@ -977,7 +977,7 @@ } #endif /* CPU_COLDFIRE */ -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #ifdef HAVE_LCD_BITMAP /* button definitions */ #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ @@ -1357,9 +1357,9 @@ return false; } #endif /* !HAVE_LCD_BITMAP */ -#endif /* !SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ -#if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR) +#if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR) && !defined(SDL) static bool dbg_pcf(void) { char buf[128]; @@ -1462,7 +1462,7 @@ } #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ -#if defined(HAVE_TSC2100) && !defined(SIMULATOR) +#if defined(HAVE_TSC2100) && !defined(SIMULATOR) && !defined(SDL) #include "tsc2100.h" char *itob(int n, int len) { @@ -1531,7 +1531,7 @@ return simplelist_show_list(&info); } #endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #ifdef HAVE_LCD_BITMAP /* * view_battery() shows a automatically scaled graph of the battery voltage @@ -1727,7 +1727,7 @@ #endif /* HAVE_LCD_BITMAP */ #endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #if defined(HAVE_MMC) || defined(HAVE_ATA_SD) #if defined(HAVE_MMC) #define CARDTYPE "MMC" @@ -1979,7 +1979,7 @@ info.scroll_all = true; return simplelist_show_list(&info); } -#endif /* !SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ #ifdef HAVE_DIRCACHE static int dircache_callback(int btn, struct gui_synclist *lists) @@ -2164,7 +2164,7 @@ } #endif /* CPU */ -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #if CONFIG_TUNER static int radio_callback(int btn, struct gui_synclist *lists) { @@ -2225,7 +2225,7 @@ return simplelist_show_list(&info); } #endif /* CONFIG_TUNER */ -#endif /* !SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ #ifdef HAVE_LCD_BITMAP extern bool do_screendump_instead_of_usb; @@ -2344,7 +2344,7 @@ } #endif -#if (defined(HAVE_SCROLLWHEEL) && (CONFIG_KEYPAD==IPOD_4G_PAD) && !defined(SIMULATOR)) +#if (defined(HAVE_SCROLLWHEEL) && (CONFIG_KEYPAD==IPOD_4G_PAD) && !defined(SIMULATOR) && !defined(SDL)) extern bool wheel_is_touched; extern int old_wheel_value; extern int new_wheel_value; @@ -2436,7 +2436,7 @@ } #endif -#if defined(CREATIVE_ZVx) && !defined(SIMULATOR) +#if defined(CREATIVE_ZVx) && !defined(SIMULATOR) && !defined(SDL) extern int pic_dbg_num_items(void); extern char* pic_dbg_item(int selected_item, void *data, char *buffer, size_t buffer_len); @@ -2476,16 +2476,16 @@ || CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L { "View I/O ports", dbg_ports }, #endif - #if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR) + #if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR) && !defined(SDL) { "View PCF registers", dbg_pcf }, #endif -#if defined(HAVE_TSC2100) && !defined(SIMULATOR) +#if defined(HAVE_TSC2100) && !defined(SIMULATOR) && !defined(SDL) { "TSC2100 debug", tsc2100_debug }, #endif #ifdef HAVE_ADJUSTABLE_CPU_FREQ { "CPU frequency", dbg_cpufreq }, #endif -#if defined(IRIVER_H100_SERIES) && !defined(SIMULATOR) +#if defined(IRIVER_H100_SERIES) && !defined(SIMULATOR) && !defined(SDL) { "S/PDIF analyzer", dbg_spdif }, #endif #if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) @@ -2493,18 +2493,18 @@ #endif { "View OS stacks", dbg_os }, #ifdef HAVE_LCD_BITMAP -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) { "View battery", view_battery }, #endif { "Screendump", dbg_screendump }, #endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) { "View HW info", dbg_hw_info }, #endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) { "View partitions", dbg_partitions }, #endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) { "View disk info", dbg_disk_info }, #if !defined(HAVE_MMC) && !defined(HAVE_ATA_SD) { "Dump ATA identify info", dbg_identify_info}, @@ -2519,14 +2519,14 @@ #ifdef HAVE_LCD_BITMAP #if CONFIG_CODEC == SWCODEC { "View buffering thread", dbg_buffering_thread }, -#elif !defined(SIMULATOR) +#elif !defined(SIMULATOR) && !defined(SDL) { "View audio thread", dbg_audio_thread }, #endif #ifdef PM_DEBUG { "pm histogram", peak_meter_histogram}, #endif /* PM_DEBUG */ #endif /* HAVE_LCD_BITMAP */ -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #if CONFIG_TUNER { "FM Radio", dbg_fm_radio }, #endif @@ -2537,7 +2537,7 @@ #if CONFIG_USBOTG == USBOTG_ISP1583 { "View ISP1583 info", dbg_isp1583 }, #endif -#if defined(CREATIVE_ZVx) && !defined(SIMULATOR) +#if defined(CREATIVE_ZVx) && !defined(SIMULATOR) && !defined(SDL) { "View PIC info", dbg_pic }, #endif #ifdef ROCKBOX_HAS_LOGF @@ -2553,7 +2553,7 @@ #ifdef CPU_BOOST_LOGGING {"cpu_boost log",cpu_boost_log}, #endif -#if (defined(HAVE_SCROLLWHEEL) && (CONFIG_KEYPAD==IPOD_4G_PAD) && !defined(SIMULATOR)) +#if (defined(HAVE_SCROLLWHEEL) && (CONFIG_KEYPAD==IPOD_4G_PAD) && !defined(SIMULATOR) && !defined(SDL)) {"Debug scrollwheel", dbg_scrollwheel}, #endif }; Index: apps/codecs/codec_crt0.c =================================================================== --- apps/codecs/codec_crt0.c (revision 18139) +++ apps/codecs/codec_crt0.c (working copy) @@ -38,7 +38,7 @@ enum codec_status codec_start(struct codec_api *api) { -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #ifdef USE_IRAM api->memcpy(iramstart, iramcopy, iramend - iramstart); api->memset(iedata, 0, iend - iedata); Index: apps/debug_menu.h =================================================================== --- apps/debug_menu.h (revision 18139) +++ apps/debug_menu.h (working copy) @@ -23,7 +23,7 @@ bool debug_menu(void); -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) extern bool dbg_ports(void); extern bool dbg_partitions(void); #endif Index: apps/main.c =================================================================== --- apps/main.c (revision 18139) +++ apps/main.c (working copy) @@ -107,7 +107,7 @@ #include "cuesheet.h" -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #include "system-sdl.h" #endif @@ -117,7 +117,7 @@ static void init(void); -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) void app_main(void) #else static void app_main(void) @@ -268,7 +268,7 @@ } #endif -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) static void init(void) { Index: apps/misc.c =================================================================== --- apps/misc.c (revision 18139) +++ apps/misc.c (working copy) @@ -647,7 +647,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter) { -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) (void)callback; (void)parameter; bookmark_autobookmark(); Index: firmware/export/kernel.h =================================================================== --- firmware/export/kernel.h (revision 18139) +++ firmware/export/kernel.h (working copy) @@ -206,7 +206,7 @@ extern volatile long current_tick; #endif -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #define sleep(x) sim_sleep(x) #endif Index: firmware/export/backlight.h =================================================================== --- firmware/export/backlight.h (revision 18139) +++ firmware/export/backlight.h (working copy) @@ -70,7 +70,7 @@ #endif #endif /* HAVE_REMOTE_LCD */ -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) void sim_backlight(int value); void sim_remote_backlight(int value); #endif Index: firmware/export/audio.h =================================================================== --- firmware/export/audio.h (revision 18139) +++ firmware/export/audio.h (working copy) @@ -37,7 +37,7 @@ #endif /* CONFIG_CODEC == SWCODEC */ -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #define audio_play(x) sim_audio_play(x) #endif Index: firmware/export/thread.h =================================================================== --- firmware/export/thread.h (revision 18139) +++ firmware/export/thread.h (working copy) @@ -81,7 +81,7 @@ #define DEFAULT_STACK_SIZE 0x400 /* Bytes */ -#ifndef SIMULATOR +#if(!defined(SIMULATOR) && !defined(SDL)) /* Need to keep structures inside the header file because debug_menu * needs them. */ #ifdef CPU_COLDFIRE @@ -125,7 +125,7 @@ void *s; /* Semaphore for blocking and wakeup */ void (*start)(void); /* Start function */ }; -#endif /* !SIMULATOR */ +#endif /* !SIMULATOR && !SDL */ /* NOTE: The use of the word "queue" may also refer to a linked list of threads being maintained that are normally dealt with in FIFO order Index: firmware/export/buffer.h =================================================================== --- firmware/export/buffer.h (revision 18139) +++ firmware/export/buffer.h (working copy) @@ -22,7 +22,7 @@ #define BUFFER_H /* defined in linker script */ -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(HAVE_SHARED_LIBS) extern unsigned char *audiobufend; #else extern unsigned char audiobufend[]; Index: firmware/export/powermgmt.h =================================================================== --- firmware/export/powermgmt.h (revision 18139) +++ firmware/export/powermgmt.h (working copy) @@ -58,7 +58,7 @@ extern charger_input_state_type charger_input_state; #endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #if CONFIG_CHARGING == CHARGING_CONTROL #define START_TOPOFF_CHG 85 /* Battery % to start at top-off */ @@ -159,7 +159,7 @@ /* Start up power management thread */ void powermgmt_init(void); -#endif /* SIMULATOR */ +#endif /* !SIMULATOR && !SDL */ /* Returns battery statust */ int battery_level(void); /* percent */ Index: firmware/export/config.h =================================================================== --- firmware/export/config.h (revision 18139) +++ firmware/export/config.h (working copy) @@ -291,6 +291,8 @@ #include "config-meizu-m6sl.h" #elif defined(ONDA_VX747) #include "config-ondavx747.h" +#elif defined(SDL) +#include "config-sdl.h" #else /* no known platform */ #endif @@ -381,7 +383,7 @@ #define HAVE_EXTENDED_MESSAGING_AND_NAME -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #define HAVE_PRIORITY_SCHEDULING #define HAVE_SCHEDULER_BOOSTCTRL #endif /* SIMULATOR */ @@ -473,7 +475,7 @@ #endif /* IRAM usage */ -#if !defined(SIMULATOR) && /* Not for simulators */ \ +#if !defined(SIMULATOR) && !defined(SDL) && /* Not for simulators */ \ (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \ defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \ defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \ Index: firmware/export/lcd.h =================================================================== --- firmware/export/lcd.h (revision 18139) +++ firmware/export/lcd.h (working copy) @@ -62,7 +62,7 @@ #define NUMLN_UNPACK(x) ((unsigned char)((x) & STYLE_MAXLN_MASK)) #endif -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #ifndef MAX_PATH #define MAX_PATH 260 #endif @@ -95,12 +95,12 @@ extern void lcd_write_data(const fb_data* p_bytes, int count); extern void lcd_init(void); -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) /* Define a dummy device specific init for the sims */ #define lcd_init_device() #else extern void lcd_init_device(void); -#endif /* SIMULATOR */ +#endif /* SIMULATOR || SDL*/ extern void lcd_backlight(bool on); extern int lcd_default_contrast(void); Index: firmware/export/ata_idle_notify.h =================================================================== --- firmware/export/ata_idle_notify.h (revision 18139) +++ firmware/export/ata_idle_notify.h (working copy) @@ -43,7 +43,7 @@ DISK_EVENT_SPINUP = (EVENT_CLASS_DISK|1), }; -#define USING_ATA_CALLBACK !defined(SIMULATOR) \ +#define USING_ATA_CALLBACK (!defined(SIMULATOR) || !defined(SDL)) \ && !defined(HAVE_FLASH_DISK) typedef bool (*ata_idle_notify)(void); Index: firmware/export/power.h =================================================================== --- firmware/export/power.h (revision 18139) +++ firmware/export/power.h (working copy) @@ -37,7 +37,7 @@ bool charging_state(void); # endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) void power_init(void); Index: firmware/export/timer.h =================================================================== --- firmware/export/timer.h (revision 18139) +++ firmware/export/timer.h (working copy) @@ -36,7 +36,7 @@ #elif CONFIG_CPU == S3C2440 || CONFIG_CPU == DM320 || CONFIG_CPU == TCC7801 \ || defined(CPU_TCC77X) #include "timer-target.h" -#elif defined(SIMULATOR) +#elif defined(SIMULATOR) || defined(SDL) #define TIMER_FREQ 1000000 #else #define TIMER_FREQ CPU_FREQ Index: firmware/kernel.c =================================================================== --- firmware/kernel.c (revision 18139) +++ firmware/kernel.c (working copy) @@ -22,7 +22,7 @@ #include #include "config.h" #include "kernel.h" -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #include "system-sdl.h" #include "debug.h" #endif @@ -39,7 +39,7 @@ #endif #if KERNEL_OBJECT_CHECKS -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #define KERNEL_ASSERT(exp, msg...) \ ({ if (!({ exp; })) { DEBUGF(msg); exit(-1); } }) #else Index: firmware/debug.c =================================================================== --- firmware/debug.c (revision 18139) +++ firmware/debug.c (working copy) @@ -35,7 +35,7 @@ #endif #endif -#ifndef SIMULATOR /* allow non archos platforms to display output */ +#if !defined(SIMULATOR) && !defined(SDL) /* allow non archos platforms to display output */ #include "kernel.h" #include "system.h" #include "debug.h" Index: firmware/backlight.c =================================================================== --- firmware/backlight.c (revision 18139) +++ firmware/backlight.c (working copy) @@ -37,7 +37,7 @@ #ifdef HAVE_REMOTE_LCD #include "lcd-remote.h" #endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #include "backlight-target.h" #endif @@ -46,7 +46,7 @@ #define BACKLIGHT_FULL_INIT #endif -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) /* TODO: find a better way to do it but we need a kernel thread somewhere to handle this */ extern void screen_dump(void); @@ -221,7 +221,7 @@ } #endif /* HAVE_LCD_SLEEP */ -#if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) +#if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) && !defined(SDL) /* backlight fading */ #define BL_PWM_INTERVAL 5 /* Cycle interval in ms */ #define BL_PWM_BITS 8 @@ -492,7 +492,7 @@ break; #endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) /* Here for now or else the aggressive init messes up scrolling */ #ifdef HAVE_REMOTE_LCD case SYS_REMOTE_PLUGGED: @@ -513,8 +513,8 @@ lcd_off(); break; #endif /* HAVE_REMOTE_LCD/ HAVE_REMOTE_LCD_AS_MAIN */ -#endif /* !SIMULATOR */ -#ifdef SIMULATOR +#endif /* !SIMULATOR && !SDL */ +#if defined(SIMULATOR) || defined(SDL) /* This one here too for lack of a better place */ case SYS_SCREENDUMP: screen_dump(); @@ -641,7 +641,7 @@ { queue_init(&backlight_queue, true); -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) if (_backlight_init()) { # ifdef HAVE_BACKLIGHT_PWM_FADING Index: firmware/sound.c =================================================================== --- firmware/sound.c (revision 18139) +++ firmware/sound.c (working copy) @@ -35,7 +35,7 @@ #if CONFIG_CODEC == SWCODEC #include "pcm.h" #endif -#endif +#endif /* SIMULATOR */ /* TODO * find a nice way to handle 1.5db steps -> see wm8751 ifdef in sound_set_bass/treble @@ -50,16 +50,16 @@ /* volume/balance/treble/bass interdependency main part */ #define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN) -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) extern bool audio_is_initialized; #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) extern unsigned long shadow_io_control_main; extern unsigned shadow_codec_reg0; #endif -#endif /* SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) /* dummy for sim */ const struct sound_settings_info audiohw_settings[] = { [SOUND_VOLUME] = {"dB", 0, 1, VOLUME_MIN / 10, VOLUME_MAX / 10, -25}, @@ -219,7 +219,7 @@ } #endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #if CONFIG_CODEC == MAS3507D /* convert tenth of dB volume (-780..+180) to dac3550 register value */ static int tenthdb2reg(int db) @@ -312,7 +312,7 @@ #endif } #endif /* (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 */ -#endif /* !SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ #ifndef SIMULATOR Index: firmware/panic.c =================================================================== --- firmware/panic.c (revision 18139) +++ firmware/panic.c (working copy) @@ -40,7 +40,7 @@ { va_list ap; -#ifndef SIMULATOR +#if (!defined(SIMULATOR) && !defined(SDL)) #if (CONFIG_LED == LED_REAL) bool state = false; int i = 0; @@ -52,7 +52,7 @@ #endif set_irq_level(DISABLE_INTERRUPTS); -#endif /* SIMULATOR */ +#endif /* !SIMULATOR || !SDL*/ va_start( ap, fmt ); vsnprintf( panic_buf, sizeof(panic_buf), fmt, ap ); @@ -90,7 +90,7 @@ while (1) { -#ifndef SIMULATOR +#if (!defined(SIMULATOR) && !defined(SDL)) #if (CONFIG_LED == LED_REAL) if (--i <= 0) { @@ -131,6 +131,6 @@ if(false) #endif /* CPU */ system_reboot(); -#endif /* !SIMULATOR */ +#endif /* !SIMULATOR !SDL*/ } } Index: firmware/include/dbgcheck.h =================================================================== --- firmware/include/dbgcheck.h (revision 18139) +++ firmware/include/dbgcheck.h (working copy) @@ -4,7 +4,7 @@ #include #ifdef DEBUG - #ifndef SIMULATOR + #if !defined(SIMULATOR) && !defined(SDL) /* check whether a function is inside the valid memory location */ #define IS_FUNCPTR(fp) ({/ extern char _text[];/ Index: firmware/include/dircache.h =================================================================== --- firmware/include/dircache.h (revision 18139) +++ firmware/include/dircache.h (working copy) @@ -37,7 +37,7 @@ struct dircache_entry *first; struct dircache_entry *ce; struct dircache_entry *down_entry; -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) DIR_UNCACHED *dir, *newdir; struct dirent_uncached *entry; #else Index: firmware/include/dir_uncached.h =================================================================== --- firmware/include/dir_uncached.h (revision 18139) +++ firmware/include/dir_uncached.h (working copy) @@ -32,7 +32,7 @@ #define ATTR_ARCHIVE 0x20 #define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */ -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #define dirent_uncached sim_dirent #define DIR_UNCACHED SIM_DIR #define opendir_uncached sim_opendir @@ -57,7 +57,7 @@ #include "fat.h" typedef struct { -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) bool busy; long startcluster; struct fat_dir fatdir; Index: firmware/include/file.h =================================================================== --- firmware/include/file.h (revision 18139) +++ firmware/include/file.h (working copy) @@ -48,7 +48,7 @@ #define O_TRUNC 0x10 #endif -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #define open(x,y) sim_open(x,y) #define creat(x) sim_creat(x) #define remove(x) sim_remove(x) Index: firmware/include/stdlib.h =================================================================== --- firmware/include/stdlib.h (revision 18139) +++ firmware/include/stdlib.h (working copy) @@ -38,7 +38,7 @@ #define abs(x) ((x)>0?(x):-(x)) #define labs(x) abs(x) -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) void exit(int status); #endif Index: firmware/include/stdio.h =================================================================== --- firmware/include/stdio.h (revision 18139) +++ firmware/include/stdio.h (working copy) @@ -36,7 +36,7 @@ int snprintf (char *buf, size_t size, const char *fmt, ...); int vsnprintf (char *buf, int size, const char *fmt, __VALIST ap); -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) typedef void FILE; int vfprintf(FILE *stream, const char *format, __VALIST ap); #ifdef WIN32 Index: firmware/include/errno.h =================================================================== --- firmware/include/errno.h (revision 18139) +++ firmware/include/errno.h (working copy) @@ -2,7 +2,7 @@ non-reentrant. Instead, its address is returned by the function __errno. */ -#if defined(SIMULATOR) && !defined(__MINGW32__) && !defined(__CYGWIN__) +#if (defined(SIMULATOR) || defined(SDL)) && !defined(__MINGW32__) && !defined(__CYGWIN__) #include "/usr/include/errno.h" /* use the host system implementation */ Index: firmware/SOURCES =================================================================== --- firmware/SOURCES (revision 18139) +++ firmware/SOURCES (working copy) @@ -14,10 +14,12 @@ #ifdef RB_PROFILE profile.c #endif /* RB_PROFILE */ +#ifndef SDL rolo.c thread.c timer.c #endif /* SIMULATOR */ +#endif /* SDL */ panic.c debug.c @@ -28,10 +30,10 @@ common/crc32-mi4.c #endif common/ctype.c -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) common/dir_uncached.c common/file.c -#endif /* SIMULATOR */ +#endif /* !SIMULATOR && !SDL */ #ifdef HAVE_DIRCACHE common/dircache.c #endif /* HAVE_DIRCACHE */ @@ -163,7 +165,7 @@ /* Tuner */ #if CONFIG_TUNER tuner.c -#ifndef SIMULATOR +#if !def(SIMULATOR) && !def(SDL) #if (CONFIG_TUNER & LV24020LP) drivers/tuner/lv24020lp.c #endif /* (CONFIG_TUNER & LV24020LP) */ @@ -193,7 +195,7 @@ pcm.c #ifdef HAVE_RECORDING enc_base.c -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) pcm_record.c #endif /* SIMULATOR */ #endif /* HAVE_RECORDING */ @@ -203,7 +205,7 @@ #ifndef BOOTLOADER mpeg.c -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) drivers/mas.c #endif /* SIMULATOR */ #endif /* BOOTLOADER */ @@ -238,7 +240,7 @@ #endif /* !defined(SIMULATOR) && !defined(BOOTLOADER) */ /* USB Stack */ -#if !defined(SIMULATOR) +#if !defined(SIMULATOR) && !defined(SDL) #ifdef HAVE_USBSTACK usbstack/usb_core.c usbstack/usb_storage.c @@ -256,7 +258,7 @@ drivers/m5636.c #endif #endif /* !defined(HAVE_USBSTACK) */ -#endif /* !defined(SIMULATOR) */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ /* Other Random Hardware */ #ifdef HAVE_TSC2100 @@ -391,7 +393,7 @@ common/memset.c common/memset16.c common/strlen.c -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) crt0.S drivers/i2c.c #endif /* SIMULATOR */ Index: firmware/target/generic/sdl/ata-target.h =================================================================== --- firmware/target/generic/sdl/ata-target.h (revision 0) +++ firmware/target/generic/sdl/ata-target.h (revision 0) @@ -0,0 +1,22 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: ata-target.h 14624 2007-09-06 03:01:41Z lowlight $ + * + * Copyright (C) 2006 by Daniel Ankers + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef ATA_TARGET_H +#define ATA_TARGET_H + +#endif Index: firmware/target/generic/sdl/adc-target.h =================================================================== --- firmware/target/generic/sdl/adc-target.h (revision 0) +++ firmware/target/generic/sdl/adc-target.h (revision 0) @@ -0,0 +1,23 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: adc-target.h 14624 2007-09-06 03:01:41Z lowlight $ + * + * Copyright (C) 2006 by Barry Wardell + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * 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 Property changes on: firmware/target/generic/sdl/adc-target.h ___________________________________________________________________ Name: svn:executable + * Index: firmware/target/generic/sdl/backlight-target.h =================================================================== --- firmware/target/generic/sdl/backlight-target.h (revision 0) +++ firmware/target/generic/sdl/backlight-target.h (revision 0) @@ -0,0 +1,30 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: backlight-target.h 15599 2007-11-12 18:49:53Z amiconn $ + * + * Copyright (C) 2006 by Barry Wardell + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * 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 + +#define _backlight_init() true +void _backlight_on(void); +void _backlight_off(void); +void _backlight_set_brightness(int brightness); +int __backlight_is_on(void); + +void _buttonlight_on(void); +void _buttonlight_off(void); +#endif Index: firmware/target/generic/sdl/usb-target.h =================================================================== --- firmware/target/generic/sdl/usb-target.h (revision 0) +++ firmware/target/generic/sdl/usb-target.h (revision 0) @@ -0,0 +1,24 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: usb-target.h 12198 2007-02-04 21:46:01Z dave $ + * + * Copyright (C) 2006 by Barry Wardelll + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * 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 + +//void usb_init_device(void); + +#endif Index: firmware/target/generic/sdl/button-target.h =================================================================== --- firmware/target/generic/sdl/button-target.h (revision 0) +++ firmware/target/generic/sdl/button-target.h (revision 0) @@ -0,0 +1,100 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: button-target.h 13442 2007-05-20 11:42:04Z markun $ + * + * Copyright (C) 2006 by Linus Nielsen Feltzing + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * 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_ + +/*taken from the gigabeat*/ + +#include +#include "config.h" + +#define HAS_BUTTON_HOLD + +bool button_hold(void); +void button_init_device(void); +int button_read_device(void); + +/* Toshiba Gigabeat specific button codes */ + +#define BUTTON_POWER 0x00000001 +#define BUTTON_MENU 0x00000002 + +#define BUTTON_LEFT 0x00000004 +#define BUTTON_RIGHT 0x00000008 +#define BUTTON_UP 0x00000010 +#define BUTTON_DOWN 0x00000020 + +#define BUTTON_VOL_UP 0x00000040 +#define BUTTON_VOL_DOWN 0x00000080 + +#define BUTTON_SELECT 0x00000100 +#define BUTTON_A 0x00000200 + +/* Remote control buttons */ + +#define BUTTON_RC_VOL_UP 0x00000400 +#define BUTTON_RC_VOL_DOWN 0x00000800 +#define BUTTON_RC_FF 0x00001000 +#define BUTTON_RC_REW 0x00002000 + +#define BUTTON_RC_PLAY 0x00004000 +#define BUTTON_RC_DSP 0x00008000 + +/* Toshiba Gigabeat specific remote button ADC values */ +/* The remote control uses ADC 1 to emulate button pushes + Reading (approx) Button HP plugged in? Remote plugged in? + 0 N/A Yes No + 125 Play/Pause Cant tell Yes + 241 Speaker+ Cant tell Yes + 369 Rewind Cant tell Yes + 492 Fast Fwd Cant tell Yes + 616 Vol + Cant tell Yes + 742 Vol - Cant tell Yes + 864 None Cant tell Yes + 1023 N/A No No +*/ + +/* + Notes: + + Buttons on the remote are translated into equivalent button presses just + as if you were pressing them on the Gigabeat itself. + + We cannot tell if the hold is asserted on the remote. The Hold function on + the remote is to block the output of the buttons changing. + + Only one button can be sensed at a time. If another is pressed, the button + with the lowest reading is dominant. So, if Rewind and Vol + are pressed + at the same time, Rewind value is the one that is read. +*/ + + + + +#define BUTTON_MAIN (BUTTON_POWER|BUTTON_MENU|BUTTON_LEFT|BUTTON_RIGHT\ + |BUTTON_UP|BUTTON_DOWN|BUTTON_VOL_UP|BUTTON_VOL_DOWN\ + |BUTTON_SELECT|BUTTON_A) + +#define BUTTON_REMOTE (BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN|BUTTON_RC_FF\ + |BUTTON_RC_REW|BUTTON_RC_PLAY|BUTTON_RC_DSP) + +#define POWEROFF_BUTTON BUTTON_POWER +#define POWEROFF_COUNT 10 + +#endif /* _BUTTON_TARGET_H_ */ Property changes on: firmware/target/generic/sdl/button-target.h ___________________________________________________________________ Name: svn:executable + * Index: firmware/target/generic/system-generic.h =================================================================== --- firmware/target/generic/system-generic.h (revision 0) +++ firmware/target/generic/system-generic.h (revision 0) @@ -0,0 +1,59 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: system-arm.h 17148 2008-04-16 20:44:10Z jethead71 $ + * + * Copyright (C) 2002 by Alan Korr + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef SYSTEM_GENERIC_H +#define SYSTEM_GENERIC_H + +#define nop \ + asm volatile ("nop") + +static inline uint16_t swap16(uint16_t value) + /* + result[15..8] = value[ 7..0]; + result[ 7..0] = value[15..8]; + */ +{ + return (value >> 8) | (value << 8); +} + +static inline uint32_t swap32(uint32_t value) + /* + result[31..24] = value[ 7.. 0]; + result[23..16] = value[15.. 8]; + result[15.. 8] = value[23..16]; + result[ 7.. 0] = value[31..24]; + */ +{ + uint32_t hi = swap16(value >> 16); + uint32_t lo = swap16(value & 0xffff); + return (lo << 16) | hi; +} + +static inline uint32_t swap_odd_even32(uint32_t value) +{ + /* + result[31..24],[15.. 8] = value[23..16],[ 7.. 0] + result[23..16],[ 7.. 0] = value[31..24],[15.. 8] + */ + uint32_t t = value & 0xff00ff00; + return (t >> 8) | ((t ^ value) << 8); +} + + + +#endif /* SYSTEM_GENERIC_H */ Property changes on: firmware/target/generic/system-generic.h ___________________________________________________________________ Name: svn:executable + * Index: firmware/target/generic/system-target.h =================================================================== --- firmware/target/generic/system-target.h (revision 0) +++ firmware/target/generic/system-target.h (revision 0) @@ -0,0 +1,26 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: system-target.h 17192 2008-04-20 17:53:05Z amiconn $ + * + * Copyright (C) 2002 by Alan Korr + * Copyright (C) 2007 by Michael Sevakis + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef SYSTEM_TARGET_H +#define SYSTEM_TARGET_H + +#include "system-generic.h" + + +#endif /* SYSTEM_TARGET_H */ Property changes on: firmware/target/generic/system-target.h ___________________________________________________________________ Name: svn:executable + * Index: firmware/common/timefuncs.c =================================================================== --- firmware/common/timefuncs.c (revision 18139) +++ firmware/common/timefuncs.c (working copy) @@ -27,7 +27,7 @@ #include "timefuncs.h" #include "debug.h" -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) static struct tm tm; #endif @@ -47,7 +47,7 @@ struct tm *get_time(void) { -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #if CONFIG_RTC static long timeout = 0; Index: firmware/common/dircache.c =================================================================== --- firmware/common/dircache.c (revision 18139) +++ firmware/common/dircache.c (working copy) @@ -177,13 +177,13 @@ */ static int dircache_scan(IF_MV2(int volume,) struct travel_data *td) { -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) while ( ( td->entry = readdir_uncached(td->dir) ) ) #else while ( (fat_getnext(td->dir, &td->entry) >= 0) && (td->entry.name[0])) #endif { -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) if (!strcmp(".", td->entry->d_name) || !strcmp("..", td->entry->d_name)) { @@ -216,7 +216,7 @@ dircache_size += td->ce->name_len; entry_count++; -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) if (td->entry->attribute & ATTR_DIRECTORY) #else if (td->entry.attr & FAT_ATTR_DIRECTORY) @@ -230,7 +230,7 @@ td->pathpos = strlen(dircache_cur_path); strncpy(&dircache_cur_path[td->pathpos], "/", sizeof(dircache_cur_path) - td->pathpos - 1); -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) strncpy(&dircache_cur_path[td->pathpos+1], td->entry->d_name, sizeof(dircache_cur_path) - td->pathpos - 2); @@ -281,7 +281,7 @@ /** * Recursively scan the hard disk and build the cache. */ -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) static int dircache_travel(IF_MV2(int volume,) DIR_UNCACHED *dir, struct dircache_entry *ce) #else static int dircache_travel(IF_MV2(int volume,) struct fat_dir *dir, struct dircache_entry *ce) @@ -292,7 +292,7 @@ memset(ce, 0, sizeof(struct dircache_entry)); -#if defined(HAVE_MULTIVOLUME) && !defined(SIMULATOR) +#if defined(HAVE_MULTIVOLUME) && !defined(SIMULATOR) && !defined(SDL) if (volume > 0) { ce->d_name = ((char *)dircache_root+dircache_size); @@ -319,7 +319,7 @@ ce = dir_recursion[depth].ce; ce->d_name = "."; ce->name_len = 2; -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) closedir_uncached(dir_recursion[depth].dir); ce->attribute = ATTR_DIRECTORY; #else @@ -341,7 +341,7 @@ logf("memory allocation error"); return -3; } -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) ce->attribute = ATTR_DIRECTORY; #else ce->attribute = FAT_ATTR_DIRECTORY; @@ -362,7 +362,7 @@ return -2; } -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) dir_recursion[depth].dir = dir_recursion[depth-1].newdir; #else dir_recursion[depth].dir = &dir_recursion[depth-1].newdir; @@ -548,7 +548,7 @@ */ static int dircache_do_rebuild(void) { -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) DIR_UNCACHED *pdir; #else struct fat_dir dir, *pdir; @@ -573,7 +573,7 @@ if (fat_ismounted(i)) { #endif -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) pdir = opendir_uncached("/"); if (pdir == NULL) { @@ -671,7 +671,7 @@ dircache_initialized = false; break ; -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) case SYS_USB_CONNECTED: usb_acknowledge(SYS_USB_CONNECTED_ACK); usb_wait_for_disconnect(&dircache_queue); Index: firmware/buffer.c =================================================================== --- firmware/buffer.c (revision 18139) +++ firmware/buffer.c (working copy) @@ -21,7 +21,7 @@ #include #include "buffer.h" -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(HAVE_SHARED_LIBS) unsigned char audiobuffer[(MEM*1024-256)*1024]; unsigned char *audiobufend = audiobuffer + sizeof(audiobuffer); #else Index: firmware/pcm.c =================================================================== --- firmware/pcm.c (revision 18139) +++ firmware/pcm.c (working copy) @@ -302,7 +302,7 @@ void pcm_mute(bool mute) { -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) audiohw_mute(mute); #endif Index: firmware/powermgmt.c =================================================================== --- firmware/powermgmt.c (revision 18139) +++ firmware/powermgmt.c (working copy) @@ -51,7 +51,7 @@ #endif #include "logf.h" #include "lcd-remote.h" -#ifdef SIMULATOR +#if defined( SIMULATOR) || defined(SDL) #include #endif @@ -89,7 +89,7 @@ charger_input_state_type charger_input_state IDATA_ATTR; #endif -#ifdef SIMULATOR /***********************************************************/ +#if defined(SIMULATOR) || defined(SDL) /***********************************************************/ #define BATT_MINMVOLT 2500 /* minimum millivolts of battery */ #define BATT_MAXMVOLT 4500 /* maximum millivolts of battery */ @@ -1148,7 +1148,7 @@ /* Various hardware housekeeping tasks relating to shutting down the jukebox */ void shutdown_hw(void) { -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) charging_algorithm_close(); audio_stop(); if (battery_level_safe()) { /* do not save on critical battery */ Index: firmware/scroll_engine.c =================================================================== --- firmware/scroll_engine.c (revision 18139) +++ firmware/scroll_engine.c (working copy) @@ -240,7 +240,7 @@ usb_wait_for_disconnect(&scroll_queue); sync_display_ticks(); return true; -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) case SYS_REMOTE_PLUGGED: if (!remote_initialized) sync_display_ticks(); @@ -278,7 +278,7 @@ delay = current_tick; if ( -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) !remote_initialized || #endif (tick_remote = lcd_remote_scroll_info.last_scroll + Index: firmware/usb.c =================================================================== --- firmware/usb.c (revision 18139) +++ firmware/usb.c (working copy) @@ -65,7 +65,7 @@ #endif #endif -#if !defined(SIMULATOR) && !defined(USB_NONE) +#if !defined(SIMULATOR) && !defined(USB_NONE) && !defined(SDL) #define NUM_POLL_READINGS (HZ/5) static int countdown; Index: firmware/drivers/button.c =================================================================== --- firmware/drivers/button.c (revision 18139) +++ firmware/drivers/button.c (working copy) @@ -39,7 +39,7 @@ #include "lcd-remote.h" #endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #if 0 /* Older than MAX_EVENT_AGE button events are going to be ignored. * Used to prevent for example volume going up uncontrollable when events Index: firmware/drivers/fat.c =================================================================== --- firmware/drivers/fat.c (revision 18139) +++ firmware/drivers/fat.c (working copy) @@ -238,6 +238,7 @@ + fat_bpb->firstdatasector; } +#ifndef SDL void fat_size(IF_MV2(int volume,) unsigned long* size, unsigned long* free) { #ifndef HAVE_MULTIVOLUME @@ -249,6 +250,7 @@ if (free) *free = fat_bpb->fsinfo.freecount * fat_bpb->bpb_secperclus / 2; } +#endif void fat_init(void) { Index: uisimulator/sdl/button.c =================================================================== --- uisimulator/sdl/button.c (revision 18139) +++ uisimulator/sdl/button.c (working copy) @@ -924,6 +924,40 @@ case SDLK_SPACE: new_btn = BUTTON_SELECT; break; +#elif CONFIG_KEYPAD == SLD_PAD + case SDLK_KP4: + case SDLK_LEFT: + new_btn = BUTTON_LEFT; + break; + case SDLK_KP6: + case SDLK_RIGHT: + new_btn = BUTTON_RIGHT; + break; + case SDLK_KP8: + case SDLK_UP: + new_btn = BUTTON_UP; + break; + case SDLK_KP2: + case SDLK_DOWN: + new_btn = BUTTON_DOWN; + break; + case SDLK_KP_PLUS: + case SDLK_F8: + new_btn = BUTTON_POWER; + break; + case SDLK_ESCAPE: + new_btn = BUTTON_POWER; + break; + case SDLK_KP_ENTER: + case SDLK_RETURN: + case SDLK_KP5: + case SDLK_SPACE: + new_btn = BUTTON_SELECT; + break; + case SDLK_KP_PERIOD: + case SDLK_INSERT: + new_btn = BUTTON_MENU; + break; #else #error No keymap defined! #endif /* CONFIG_KEYPAD */ Index: uisimulator/sdl/uisdl.h =================================================================== --- uisimulator/sdl/uisdl.h (revision 18139) +++ uisimulator/sdl/uisdl.h (working copy) @@ -419,6 +419,16 @@ #define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ #define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ +#elif defined(SDL) +#define UI_TITLE "SDL Rockbox" +#define UI_WIDTH 401 /* width of GUI window */ +#define UI_HEIGHT 655 /* height of GUI window */ +/* high-colour */ +#define UI_LCD_POSX 48 /* x position of lcd */ +#define UI_LCD_POSY 60 /* y position of lcd */ +#define UI_LCD_WIDTH 240 +#define UI_LCD_HEIGHT 320 + #endif extern SDL_Surface *gui_surface; extern bool background; /* True if the background image is enabled */ Index: uisimulator/common/SOURCES =================================================================== --- uisimulator/common/SOURCES (revision 18139) +++ uisimulator/common/SOURCES (working copy) @@ -7,3 +7,4 @@ #endif sim_icons.c stubs.c +../sdl/uisdl.c Index: firmware/export/config-c100.h =================================================================== --- firmware/export/config-c100.h (revision 18139) +++ firmware/export/config-c100.h (working copy) @@ -118,4 +118,7 @@ #define BOOTFILE "rockbox." BOOTFILE_EXT #define BOOTDIR "/" +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #endif /* SIMULATOR */ Index: firmware/export/config-c200.h =================================================================== --- firmware/export/config-c200.h (revision 18139) +++ firmware/export/config-c200.h (working copy) @@ -186,6 +186,9 @@ #define INCLUDE_TIMEOUT_API +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #endif /* SIMULATOR */ /** Port-specific settings **/ Index: firmware/export/config-creativezvm60gb.h =================================================================== --- firmware/export/config-creativezvm60gb.h (revision 18139) +++ firmware/export/config-creativezvm60gb.h (working copy) @@ -166,4 +166,7 @@ #define USB_VENDOR_ID 0x041e #define USB_PRODUCT_ID 0x4133 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #endif /* SIMULATOR */ Index: firmware/export/config-creativezvm.h =================================================================== --- firmware/export/config-creativezvm.h (revision 18139) +++ firmware/export/config-creativezvm.h (working copy) @@ -165,6 +165,9 @@ #define USB_VENDOR_ID 0x041e #define USB_PRODUCT_ID 0x4133 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /*DEBUGGING!*/ #ifdef BOOTLOADER #define THREAD_EXTRA_CHECKS 1 Index: firmware/export/config-e200.h =================================================================== --- firmware/export/config-e200.h (revision 18139) +++ firmware/export/config-e200.h (working copy) @@ -184,6 +184,9 @@ #define INCLUDE_TIMEOUT_API +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #endif /* SIMULATOR */ /** Port-specific settings **/ Index: firmware/export/config-fmrecorder.h =================================================================== --- firmware/export/config-fmrecorder.h (revision 18139) +++ firmware/export/config-fmrecorder.h (working copy) @@ -113,6 +113,9 @@ #define BOOTFILE "ajbrec." BOOTFILE_EXT #define BOOTDIR "/" +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #endif /* SIMULATOR */ #define HAVE_LCD_CONTRAST Index: firmware/export/config-gigabeat.h =================================================================== --- firmware/export/config-gigabeat.h (revision 18139) +++ firmware/export/config-gigabeat.h (working copy) @@ -161,6 +161,9 @@ /* Define this if you have adjustable CPU frequency */ /* #define HAVE_ADJUSTABLE_CPU_FREQ */ +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #define BOOTFILE_EXT "gigabeat" #define BOOTFILE "rockbox." BOOTFILE_EXT #define BOOTDIR "/.rockbox" Index: firmware/export/config-gigabeat-s.h =================================================================== --- firmware/export/config-gigabeat-s.h (revision 18139) +++ firmware/export/config-gigabeat-s.h (working copy) @@ -157,6 +157,9 @@ #define HAVE_SERIAL #define HAVE_VOLUME_IN_LIST +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /*Remove Comments from UART_INT to enable the UART interrupts,*/ /*otherwise iterrupts will be disabled. For now we will test */ /*UART state by polling the registers, and if necessary update this */ Index: firmware/export/config-h100.h =================================================================== --- firmware/export/config-h100.h (revision 18139) +++ firmware/export/config-h100.h (working copy) @@ -157,6 +157,9 @@ /* Define this if the EEPROM chip is used */ #define HAVE_EEPROM_SETTINGS +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #endif /* !SIMULATOR */ /* Define bitmask of input sources - recordable bitmask can be defined Index: firmware/export/config-h10_5gb.h =================================================================== --- firmware/export/config-h10_5gb.h (revision 18139) +++ firmware/export/config-h10_5gb.h (working copy) @@ -149,6 +149,9 @@ /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #define MI4_FORMAT #define BOOTFILE_EXT "mi4" #define BOOTFILE "rockbox." BOOTFILE_EXT Index: firmware/export/config-h10.h =================================================================== --- firmware/export/config-h10.h (revision 18139) +++ firmware/export/config-h10.h (working copy) @@ -169,6 +169,9 @@ /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #define MI4_FORMAT #define BOOTFILE_EXT "mi4" #define BOOTFILE "rockbox." BOOTFILE_EXT Index: firmware/export/config-h120.h =================================================================== --- firmware/export/config-h120.h (revision 18139) +++ firmware/export/config-h120.h (working copy) @@ -156,6 +156,9 @@ /* Define this if the EEPROM chip is used */ #define HAVE_EEPROM_SETTINGS +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #endif /* !SIMULATOR */ /* Define this for S/PDIF output available */ Index: firmware/export/config-h300.h =================================================================== --- firmware/export/config-h300.h (revision 18139) +++ firmware/export/config-h300.h (working copy) @@ -154,6 +154,9 @@ /* Define this if there is an EEPROM chip */ #define HAVE_EEPROM +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #endif /* SIMULATOR */ /* Define this for FM radio input available */ Index: firmware/export/config-hdd1630.h =================================================================== --- firmware/export/config-hdd1630.h (revision 18139) +++ firmware/export/config-hdd1630.h (working copy) @@ -173,6 +173,9 @@ #define USB_VENDOR_ID 0x0471 #define USB_PRODUCT_ID 0x014C +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-iaudiom3.h =================================================================== --- firmware/export/config-iaudiom3.h (revision 18139) +++ firmware/export/config-iaudiom3.h (working copy) @@ -139,6 +139,9 @@ #define FLASH_ENTRYPOINT 0x00001000 #define FLASH_MAGIC 0xfbfbfbf1 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #endif /* SIMULATOR */ /* Define this for FM radio input available */ Index: firmware/export/config-iaudiom5.h =================================================================== --- firmware/export/config-iaudiom5.h (revision 18139) +++ firmware/export/config-iaudiom5.h (working copy) @@ -134,6 +134,9 @@ /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #define BOOTFILE_EXT "iaudio" #define BOOTFILE "rockbox." BOOTFILE_EXT #define BOOTDIR "/.rockbox" Index: firmware/export/config-iaudiox5.h =================================================================== --- firmware/export/config-iaudiox5.h (revision 18139) +++ firmware/export/config-iaudiox5.h (working copy) @@ -154,6 +154,9 @@ /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #define BOOTFILE_EXT "iaudio" #define BOOTFILE "rockbox." BOOTFILE_EXT #define BOOTDIR "/.rockbox" Index: firmware/export/config-ifp7xx.h =================================================================== --- firmware/export/config-ifp7xx.h (revision 18139) +++ firmware/export/config-ifp7xx.h (working copy) @@ -103,6 +103,9 @@ #define HAVE_GDB_API +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ Index: firmware/export/config-ipod1g2g.h =================================================================== --- firmware/export/config-ipod1g2g.h (revision 18139) +++ firmware/export/config-ipod1g2g.h (working copy) @@ -129,6 +129,9 @@ #define USB_IPODSTYLE /* actually firewire only, but handled like USB */ +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-ipod3g.h =================================================================== --- firmware/export/config-ipod3g.h (revision 18139) +++ firmware/export/config-ipod3g.h (working copy) @@ -133,6 +133,9 @@ #define USB_IPODSTYLE /* actually both firewire and USB, USB isn't handled yet */ +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-ipod4g.h =================================================================== --- firmware/export/config-ipod4g.h (revision 18139) +++ firmware/export/config-ipod4g.h (working copy) @@ -158,6 +158,9 @@ #define USB_VENDOR_ID 0x05ac #define USB_PRODUCT_ID 0x1203 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-ipodcolor.h =================================================================== --- firmware/export/config-ipodcolor.h (revision 18139) +++ firmware/export/config-ipodcolor.h (working copy) @@ -145,6 +145,9 @@ #define USB_VENDOR_ID 0x05ac #define USB_PRODUCT_ID 0x1204 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-ipodmini2g.h =================================================================== --- firmware/export/config-ipodmini2g.h (revision 18139) +++ firmware/export/config-ipodmini2g.h (working copy) @@ -155,6 +155,8 @@ #define USB_VENDOR_ID 0x05ac #define USB_PRODUCT_ID 0x1205 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-ipodmini.h =================================================================== --- firmware/export/config-ipodmini.h (revision 18139) +++ firmware/export/config-ipodmini.h (working copy) @@ -148,6 +148,9 @@ #define USB_VENDOR_ID 0x05ac #define USB_PRODUCT_ID 0x1205 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-ipodnano.h =================================================================== --- firmware/export/config-ipodnano.h (revision 18139) +++ firmware/export/config-ipodnano.h (working copy) @@ -154,6 +154,9 @@ #define USB_VENDOR_ID 0x05ac #define USB_PRODUCT_ID 0x120a +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-ipodvideo.h =================================================================== --- firmware/export/config-ipodvideo.h (revision 18139) +++ firmware/export/config-ipodvideo.h (working copy) @@ -161,6 +161,9 @@ #define USB_VENDOR_ID 0x05ac #define USB_PRODUCT_ID 0x1209 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-meizu-m6sl.h =================================================================== --- firmware/export/config-meizu-m6sl.h (revision 18139) +++ firmware/export/config-meizu-m6sl.h (working copy) @@ -142,6 +142,9 @@ /* USB On-the-go */ //#define CONFIG_USBOTG USBOTG_M5636 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ Index: firmware/export/config-mrobe100.h =================================================================== --- firmware/export/config-mrobe100.h (revision 18139) +++ firmware/export/config-mrobe100.h (working copy) @@ -144,6 +144,9 @@ #define USB_VENDOR_ID 0x07B4 #define USB_PRODUCT_ID 0x0280 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-mrobe500.h =================================================================== --- firmware/export/config-mrobe500.h (revision 18139) +++ firmware/export/config-mrobe500.h (working copy) @@ -169,6 +169,9 @@ /* Offset ( in the firmware file's header ) to the real data */ #define FIRMWARE_OFFSET_FILE_DATA 8 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Define this if you have adjustable CPU frequency */ /* #define HAVE_ADJUSTABLE_CPU_FREQ */ Index: firmware/export/config-ondavx747.h =================================================================== --- firmware/export/config-ondavx747.h (revision 18139) +++ firmware/export/config-ondavx747.h (working copy) @@ -153,6 +153,9 @@ #define USB_VENDOR_ID 0x041e #define USB_PRODUCT_ID 0x4133*/ +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /*DEBUGGING!*/ #ifdef BOOTLOADER #define THREAD_EXTRA_CHECKS 1 Index: firmware/export/config-ondiofm.h =================================================================== --- firmware/export/config-ondiofm.h (revision 18139) +++ firmware/export/config-ondiofm.h (working copy) @@ -115,6 +115,9 @@ /* define this if media can be exchanged on the fly */ #define HAVE_HOTSWAP +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-ondiosp.h =================================================================== --- firmware/export/config-ondiosp.h (revision 18139) +++ firmware/export/config-ondiosp.h (working copy) @@ -98,6 +98,9 @@ /* define this if media can be exchanged on the fly */ #define HAVE_HOTSWAP +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-player.h =================================================================== --- firmware/export/config-player.h (revision 18139) +++ firmware/export/config-player.h (working copy) @@ -81,6 +81,9 @@ /* Software controlled LED */ #define CONFIG_LED LED_REAL +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #define CONFIG_LCD LCD_SSD1801 #define BOOTFILE_EXT "mod" Index: firmware/export/config-recorder.h =================================================================== --- firmware/export/config-recorder.h (revision 18139) +++ firmware/export/config-recorder.h (working copy) @@ -100,6 +100,9 @@ #define CONFIG_LCD LCD_SSD1815 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #define BOOTFILE_EXT "ajz" #define BOOTFILE "ajbrec." BOOTFILE_EXT #define BOOTDIR "/" Index: firmware/export/config-recorderv2.h =================================================================== --- firmware/export/config-recorderv2.h (revision 18139) +++ firmware/export/config-recorderv2.h (working copy) @@ -109,6 +109,9 @@ #define CONFIG_LCD LCD_SSD1815 +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + #define BOOTFILE_EXT "ajz" #define BOOTFILE "ajbrec." BOOTFILE_EXT #define BOOTDIR "/" Index: firmware/export/config-sa9200.h =================================================================== --- firmware/export/config-sa9200.h (revision 18139) +++ firmware/export/config-sa9200.h (working copy) @@ -145,6 +145,9 @@ #define USE_ROCKBOX_USB #endif +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: firmware/export/config-sdl.h =================================================================== --- firmware/export/config-sdl.h (revision 0) +++ firmware/export/config-sdl.h (revision 0) @@ -0,0 +1,206 @@ +/* + * This config file is for SDL targets + */ +#define TARGET_TREE /* this target is using the target tree system */ + +/* For Rolo and boot loader */ +#define MODEL_NUMBER 200 +#define MODEL_NAME "SDL" + +/* Taken from other targets*/ +#define VOLUME_MIN -730 +#define VOLUME_MAX 0 + +/*if the target uses shared libraries (codecs, plugins) instead of 'binary blobs'*/ +#define HAVE_SHARED_LIBS + +//#define HW_SAMPR_CAPS (SAMPR_CAP_44) + +/* define this if you have recording possibility */ +//#define HAVE_RECORDING + +//#define REC_SAMPR_CAPS (SAMPR_CAP_22) +//#define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */ +//#define REC_SAMPR_DEFAULT SAMPR_22 + +/* Define bitmask of input sources - recordable bitmask can be defined + explicitly if different */ +//#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) + +/* 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 if you have a light associated with the buttons */ +//#define HAVE_BUTTON_LIGHT + +/* 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 240 +#define LCD_HEIGHT 320 +#define LCD_DEPTH 16 /* 65536 colours */ +#define LCD_PIXELFORMAT RGB565 /* rgb565 */ + +#ifndef BOOTLOADER +/* define this if you have LCD enable function */ +#define HAVE_LCD_ENABLE + +/* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE + should be defined as well. */ +#define HAVE_LCD_SLEEP +#define HAVE_LCD_SLEEP_SETTING +#endif + +/* define this if you can flip your LCD */ +//#define HAVE_LCD_FLIP + +/* define this if you can invert the colours on your LCD */ +//#define HAVE_LCD_INVERT + +/* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */ + +#define CONFIG_KEYPAD SLD_PAD + +/* Define this if you do software codec */ +#define CONFIG_CODEC SWCODEC +/* There is no hardware tone control */ +#define HAVE_SW_TONE_CONTROLS +/* The PP5024 has a built-in AustriaMicrosystems AS3514 */ +//#define HAVE_AS3514 + +/* define this if you have a real-time clock */ +#ifndef BOOTLOADER +//#define CONFIG_RTC RTC_AS3514 +#endif + +/* Define this if you have a software controlled poweroff */ +#define HAVE_SW_POWEROFF + +/* Some Sansa E200s seem to be FAT16 formatted */ +//#define HAVE_FAT16SUPPORT + +/* The number of bytes reserved for loadable codecs */ +#define CODEC_SIZE 0x80000 + +/* The number of bytes reserved for loadable plugins */ +#define PLUGIN_BUFFER_SIZE 0x80000 + +#define AB_REPEAT_ENABLE 1 + +/* FM Tuner */ + + +/* Define this for LCD backlight available */ +#define HAVE_BACKLIGHT +#define HAVE_BACKLIGHT_BRIGHTNESS + +/* define this if the unit uses a scrollwheel for navigation */ +//#define HAVE_SCROLLWHEEL +/* define from which rotation speed [degree/sec] on the acceleration starts */ +//#define WHEEL_ACCEL_START 540 +/* define type of acceleration (1 = ^2, 2 = ^3, 3 = ^4) */ +//#define WHEEL_ACCELERATION 1 + +/* define this if you have a flash memory storage */ +#define HAVE_FLASH_STORAGE + +/* define this if the flash memory uses the SecureDigital Memory Card protocol */ +//#define HAVE_ATA_SD + +#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */ +#define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */ +#define BATTERY_CAPACITY_MAX 750 /* max. capacity selectable */ +#define BATTERY_CAPACITY_INC 0 /* capacity increment */ +#define BATTERY_TYPES_COUNT 1 /* only one type */ + +/* Hardware controlled charging? FIXME */ +//#define CONFIG_CHARGING CHARGING_SIMPLE + +/* define this if the unit can be powered or charged via USB */ +//#define HAVE_USB_POWER + +/** Non-simulator section **/ +#ifndef SIMULATOR + +/* Define this if you have a PortalPlayer PP5024 */ +#define CONFIG_CPU X86 + +/* Define this if you want to use the PP5024 i2c interface */ +#define CONFIG_I2C I2C_PP5024 + +/* define this if the hardware can be powered off while charging */ +/* Sansa can't be powered off while charging */ +/* #define HAVE_POWEROFF_WHILE_CHARGING */ + +/* The start address index for ROM builds */ +#define ROM_START 0x00000000 + +/* Define this to the CPU frequency */ +#define CPU_FREQ 75000000 + +/* Type of LCD TODO: hopefully the same as the x5 but check this*/ +#define CONFIG_LCD LCD_X5 + +/* Offset ( in the firmware file's header ) to the file CRC and data. These are + only used when loading the old format rockbox.e200 file */ +#define FIRMWARE_OFFSET_FILE_CRC 0x0 +#define FIRMWARE_OFFSET_FILE_DATA 0x8 + +#ifndef BOOTLOADER +//#define HAVE_MULTIVOLUME +//#define HAVE_HOTSWAP +#endif + +/* #define USB_IPODSTYLE */ + +/* USB On-the-go */ +//#define CONFIG_USBOTG USBOTG_ARC + +/* enable these for the experimental usb stack */ +//#define HAVE_USBSTACK +//#define USB_VENDOR_ID 0x0781 +//#define USB_PRODUCT_ID 0x7421 + +/* Virtual LED (icon) */ +#define CONFIG_LED LED_VIRTUAL + +/* Define this if you have adjustable CPU frequency */ +//#define HAVE_ADJUSTABLE_CPU_FREQ + +/* +#define MI4_FORMAT +#define BOOTFILE_EXT "mi4" +#define BOOTFILE "rockbox." BOOTFILE_EXT +#define OLD_BOOTFILE "rockbox.e200" + +#define BOOTDIR "/.rockbox" + +#define ICODE_ATTR_TREMOR_NOT_MDCT + +#define INCLUDE_TIMEOUT_API +*/ +#endif /* SIMULATOR */ + +/** Port-specific settings **/ + +/* Main LCD backlight brightness range and defaults */ +#define MIN_BRIGHTNESS_SETTING 1 +#define MAX_BRIGHTNESS_SETTING 12 +#define DEFAULT_BRIGHTNESS_SETTING 6 + + + + Index: firmware/export/config-tpj1022.h =================================================================== --- firmware/export/config-tpj1022.h (revision 18139) +++ firmware/export/config-tpj1022.h (working copy) @@ -112,6 +112,9 @@ /* USB On-the-go */ #define CONFIG_USBOTG USBOTG_ARC +/* USB/Firewire disk mode available*/ +#define HAVE_DISK_MODE + /* Virtual LED (icon) */ #define CONFIG_LED LED_VIRTUAL Index: apps/keymaps/keymap-sdl.c =================================================================== --- apps/keymaps/keymap-sdl.c (revision 0) +++ apps/keymaps/keymap-sdl.c (revision 0) @@ -0,0 +1,380 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: keymap-gigabeat.c 15866 2007-12-02 12:07:01Z roolku $ + * + * Copyright (C) 2006 Jonathan Gordon + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +/* Button Code Definitions for the toshiba gigabeat target */ +#include +#include +#include + +#include "config.h" +#include "action.h" +#include "button.h" +#include "settings.h" + +/* + * The format of the list is as follows + * { Action Code, Button code, Prereq button code } + * if there's no need to check the previous button's value, use BUTTON_NONE + * Insert LAST_ITEM_IN_LIST at the end of each mapping + */ + +/* CONTEXT_CUSTOM's used in this file... + +CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) +CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens + i.e where up/down is inc/dec + CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec + +*/ + + +static const struct button_mapping button_context_standard[] = { + { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, + { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + + { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, + + { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT }, + + { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, + { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, + + { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, + { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, + + LAST_ITEM_IN_LIST +}; /* button_context_standard */ + + +static const struct button_mapping button_context_wps[] = { + { ACTION_WPS_PLAY, BUTTON_A|BUTTON_REL, BUTTON_A }, + { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, + + { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, + { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, + + { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, + { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, + + { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_A|BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_WPS_ABSETA_PREVDIR, BUTTON_A|BUTTON_LEFT, BUTTON_NONE }, + { ACTION_WPS_ABRESET, BUTTON_A|BUTTON_SELECT, BUTTON_NONE }, + + { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, + { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE }, + { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, + + { ACTION_WPS_PITCHSCREEN, BUTTON_A|BUTTON_UP, BUTTON_A }, + { ACTION_WPS_PITCHSCREEN, BUTTON_A|BUTTON_DOWN, BUTTON_A }, + + { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, + { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, + { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, + + { ACTION_WPS_ID3SCREEN, BUTTON_A|BUTTON_MENU, BUTTON_NONE }, + { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, + + LAST_ITEM_IN_LIST +}; /* button_context_wps */ + +static const struct button_mapping button_context_list[] = { + { ACTION_LISTTREE_PGUP, BUTTON_A|BUTTON_UP, BUTTON_A }, + { ACTION_LISTTREE_PGUP, BUTTON_UP|BUTTON_REL, BUTTON_A|BUTTON_UP }, + { ACTION_LISTTREE_PGUP, BUTTON_A|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_LISTTREE_PGDOWN, BUTTON_A|BUTTON_DOWN, BUTTON_A }, + { ACTION_LISTTREE_PGDOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_A|BUTTON_DOWN }, + { ACTION_LISTTREE_PGDOWN, BUTTON_A|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, +#ifdef HAVE_VOLUME_IN_LIST + { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_LIST_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, + { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, + { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, +#endif + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_list */ + +static const struct button_mapping button_context_tree[] = { + { ACTION_TREE_WPS, BUTTON_A|BUTTON_REL, BUTTON_A }, + { ACTION_TREE_STOP, BUTTON_POWER, BUTTON_NONE }, + { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, + { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST) +}; /* button_context_tree */ + +static const struct button_mapping button_context_listtree_scroll_with_combo[] = { + { ACTION_NONE, BUTTON_A, BUTTON_NONE }, + { ACTION_TREE_PGLEFT, BUTTON_A|BUTTON_LEFT, BUTTON_A }, + { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_A|BUTTON_LEFT }, + { ACTION_TREE_PGLEFT, BUTTON_A|BUTTON_LEFT, BUTTON_LEFT|BUTTON_REL }, + { ACTION_TREE_ROOT_INIT, BUTTON_A|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_A|BUTTON_LEFT }, + { ACTION_TREE_PGLEFT, BUTTON_A|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_TREE_PGRIGHT, BUTTON_A|BUTTON_RIGHT, BUTTON_A }, + { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_A|BUTTON_RIGHT }, + { ACTION_TREE_PGRIGHT, BUTTON_A|BUTTON_RIGHT, BUTTON_RIGHT|BUTTON_REL }, + { ACTION_TREE_PGRIGHT, BUTTON_A|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), +}; + +static const struct button_mapping button_context_listtree_scroll_without_combo[] = { + { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, + { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, + { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, + { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, + { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), +}; + +static const struct button_mapping button_context_settings[] = { + { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, + { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_RESET, BUTTON_A, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_settings */ + +static const struct button_mapping button_context_settings_right_is_inc[] = { + { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, + { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_RESET, BUTTON_A, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_settingsgraphical */ + +static const struct button_mapping button_context_yesno[] = { + { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_settings_yesno */ + +static const struct button_mapping button_context_colorchooser[] = { + { ACTION_STD_OK, BUTTON_A|BUTTON_REL, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), +}; /* button_context_colorchooser */ + +static const struct button_mapping button_context_eq[] = { + { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), +}; /* button_context_eq */ + +/** Bookmark Screen **/ +static const struct button_mapping button_context_bmark[] = { + { ACTION_BMS_DELETE, BUTTON_A, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), +}; /* button_context_bmark */ + +static const struct button_mapping button_context_time[] = { + { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, + { ACTION_STD_OK, BUTTON_A, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), +}; /* button_context_time */ + +static const struct button_mapping button_context_quickscreen[] = { + { ACTION_QS_DOWNINV, BUTTON_UP, BUTTON_NONE }, + { ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_quickscreen */ + +static const struct button_mapping button_context_pitchscreen[] = { + { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE }, + { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE }, + { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE }, + { ACTION_PS_TOGGLE_MODE, BUTTON_MENU, BUTTON_NONE }, + { ACTION_PS_RESET, BUTTON_A, BUTTON_NONE }, + { ACTION_PS_EXIT, BUTTON_POWER, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_pitchcreen */ + +static const struct button_mapping button_context_keyboard[] = { + { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_CURSOR_LEFT, BUTTON_A|BUTTON_LEFT, BUTTON_NONE }, + { ACTION_KBD_CURSOR_LEFT, BUTTON_A|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_CURSOR_RIGHT, BUTTON_A|BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_KBD_CURSOR_RIGHT, BUTTON_A|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE }, + { ACTION_KBD_PAGE_FLIP, BUTTON_A|BUTTON_MENU, BUTTON_NONE }, + { ACTION_KBD_DONE, BUTTON_A|BUTTON_REL, BUTTON_A }, + { ACTION_KBD_ABORT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, + { ACTION_KBD_BACKSPACE, BUTTON_MENU, BUTTON_NONE }, + { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE }, + { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_MORSE_INPUT, BUTTON_A|BUTTON_POWER, BUTTON_NONE }, + { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, + + LAST_ITEM_IN_LIST +}; /* button_context_keyboard */ + +/***************************************************************************** + * Remote control mappings + *****************************************************************************/ + +static const struct button_mapping remote_button_context_standard[] = { + { ACTION_STD_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE }, + { ACTION_STD_PREVREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, + { ACTION_STD_NEXTREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_RC_REW, BUTTON_NONE }, + { ACTION_STD_OK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF }, + { ACTION_STD_CONTEXT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF }, + { ACTION_STD_MENU, BUTTON_RC_DSP, BUTTON_NONE }, + + LAST_ITEM_IN_LIST +}; + +static const struct button_mapping remote_button_context_wps[] = { + { ACTION_WPS_PLAY, BUTTON_RC_PLAY, BUTTON_NONE }, + + { ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF }, + { ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW }, + + { ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT }, + { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT }, + + { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY }, + { ACTION_WPS_MENU, BUTTON_RC_DSP, BUTTON_NONE }, + + { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, + { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; + +static const struct button_mapping remote_button_context_tree[] = { + { ACTION_TREE_WPS, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY }, + { ACTION_TREE_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY }, + { ACTION_STD_CANCEL, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; + +static const struct button_mapping* get_context_mapping_remote( int context ) +{ + context ^= CONTEXT_REMOTE; + + switch (context) + { + case CONTEXT_WPS: + return remote_button_context_wps; + case CONTEXT_MAINMENU: + case CONTEXT_TREE: + return remote_button_context_tree; + } + return remote_button_context_standard; +} + +const struct button_mapping* get_context_mapping(int context) +{ + if (context&CONTEXT_REMOTE) + return get_context_mapping_remote(context); + + switch (context) + { + case CONTEXT_STD: + return button_context_standard; + case CONTEXT_WPS: + return button_context_wps; + + case CONTEXT_LIST: + return button_context_list; + case CONTEXT_MAINMENU: + case CONTEXT_TREE: + if (global_settings.hold_lr_for_scroll_in_list) + return button_context_listtree_scroll_without_combo; + else + return button_context_listtree_scroll_with_combo; + case CONTEXT_CUSTOM|CONTEXT_TREE: + return button_context_tree; + + case CONTEXT_SETTINGS: + return button_context_settings; + case CONTEXT_CUSTOM|CONTEXT_SETTINGS: + return button_context_settings_right_is_inc; + + case CONTEXT_SETTINGS_COLOURCHOOSER: + return button_context_colorchooser; + case CONTEXT_SETTINGS_EQ: + return button_context_eq; + + case CONTEXT_SETTINGS_TIME: + return button_context_time; + + case CONTEXT_YESNOSCREEN: + return button_context_yesno; + case CONTEXT_BOOKMARKSCREEN: + return button_context_bmark; + case CONTEXT_QUICKSCREEN: + return button_context_quickscreen; + case CONTEXT_PITCHSCREEN: + return button_context_pitchscreen; + case CONTEXT_KEYBOARD: + return button_context_keyboard; + } + return button_context_standard; +}