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(SDL) #if CONFIG_CODEC == SWCODEC unsigned char codecbuf[CODEC_SIZE]; #endif @@ -142,7 +142,7 @@ profile_func_exit, #endif -#if defined(HAVE_RECORDING) && !defined(SIMULATOR) +#if defined(HAVE_RECORDING) && !defined(SIMULATOR) && !defined(SDL) false, /* stop_encoder */ 0, /* enc_codec_loaded */ enc_get_inputs, @@ -177,7 +177,7 @@ { struct codec_header *hdr; int status; -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) 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(SDL) */ 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 +#if !defined(SIMULATOR) && !defined(SDL) 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 +#if defined(SIMULATOR) || defined(SDL) 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 /* SIMULATOR || SDL */ #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) @@ -43,7 +43,7 @@ #include "thread.h" #endif #if (CONFIG_CODEC == SWCODEC) -#if !defined(SIMULATOR) && defined(HAVE_RECORDING) +#if !defined(SIMULATOR) && !defined(SDL) && defined(HAVE_RECORDING) #include "pcm_record.h" #endif #include "dsp.h" @@ -70,7 +70,7 @@ #endif -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #define PREFIX(_x_) sim_ ## _x_ #else #define PREFIX(_x_) _x_ @@ -219,7 +219,7 @@ void (*profile_func_exit)(void *this_fn, void *call_site); #endif -#if defined(HAVE_RECORDING) && !defined(SIMULATOR) +#if defined(HAVE_RECORDING) && !defined(SIMULATOR) && !defined(SDL) volatile bool stop_encoder; volatile int enc_codec_loaded; /* <0=error, 0=pending, >0=ok */ void (*enc_get_inputs)(struct enc_inputs *inputs); @@ -257,10 +257,10 @@ }; #ifdef CODEC -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) /* plugin_* is correct, codecs use the plugin linker script */ -extern unsigned char plugin_start_addr[]; -extern unsigned char plugin_end_addr[]; +//extern unsigned char plugin_start_addr[]; +//extern unsigned char plugin_end_addr[]; /* decoders */ #define CODEC_HEADER \ const struct codec_header __header \ @@ -286,7 +286,7 @@ const struct codec_header __header = { \ CODEC_ENC_MAGIC, TARGET_ID, CODEC_API_VERSION, \ NULL, NULL, codec_start }; -#endif /* SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ #endif /* CODEC */ /* create full codec path from root filenames in audio_formats[] Index: apps/recorder/radio.c =================================================================== --- apps/recorder/radio.c (revision 18139) +++ apps/recorder/radio.c (working copy) @@ -494,7 +494,7 @@ if(radio_status == FMRADIO_OFF) audio_stop(); -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #if CONFIG_CODEC != SWCODEC if(rec_create_directory() > 0) @@ -516,7 +516,7 @@ sound_default(SOUND_RIGHT_GAIN), AUDIO_GAIN_LINEIN); #endif /* CONFIG_CODEC != SWCODEC */ -#endif /* ndef SIMULATOR */ +#endif /* # !defined(SIMULATOR) && !defined(SDL) */ /* turn on radio */ #if CONFIG_CODEC == SWCODEC @@ -587,7 +587,7 @@ switch(button) { case ACTION_FM_STOP: -#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) +#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) && !defined(SDL) if(audio_status() == AUDIO_STATUS_RECORD) { audio_stop(); @@ -626,7 +626,7 @@ break; } #endif /* FM_RECORD_DBLPRE */ -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) if(audio_status() == AUDIO_STATUS_RECORD) { rec_command(RECORDING_CMD_START_NEWFILE); @@ -638,7 +638,7 @@ rec_command(RECORDING_CMD_START); update_screen = true; } -#endif /* SIMULATOR */ +#endif /* #!defined(SIMULATOR) && !defined(SDL) */ last_seconds = 0; break; #endif /* #ifdef FM_RECORD */ @@ -888,7 +888,7 @@ } } -#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) +#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) && !defined(SDL) seconds = audio_recorded_time() / HZ; if (update_screen || seconds > last_seconds) { @@ -995,7 +995,7 @@ #endif } /*while(!done)*/ -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #if CONFIG_CODEC != SWCODEC if(audio_status() & AUDIO_STATUS_ERROR) { @@ -1021,12 +1021,12 @@ #endif /* CONFIG_CODEC != SWCODEC */ sound_settings_apply(); -#endif /* SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ if(keep_playing) { /* Catch FMRADIO_PLAYING status for the sim. */ -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #if CONFIG_CODEC != SWCODEC /* Enable the Left and right A/D Converter */ audio_set_recording_gain(sound_default(SOUND_LEFT_GAIN), @@ -1035,7 +1035,7 @@ mas_codec_writereg(6, 0x4000); #endif end_search(); -#endif /* SIMULATOR */ +#endif /* # !defined(SIMULATOR) && !defined(SDL) */ } else { Index: apps/plugins/plugin.lds =================================================================== --- apps/plugins/plugin.lds (revision 18139) +++ apps/plugins/plugin.lds (working copy) @@ -1,5 +1,5 @@ #include "config.h" - +#if !defined(SDL) /* These output formats should be in the config-files */ #ifdef CPU_COLDFIRE @@ -220,3 +220,4 @@ KEEP(*(.comment)) } } +#endif /* SDL */ \ No newline at end of file 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(SDL) #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/plugins/SOURCES =================================================================== --- apps/plugins/SOURCES (revision 18139) +++ apps/plugins/SOURCES (working copy) @@ -1,3 +1,4 @@ +#if !defined(SDL) /* plugins common to all models */ battery_bench.c chessclock.c @@ -156,5 +157,6 @@ superdom.c #endif #endif /* m:robe 500 */ ++#endif /* !SDL */ md5sum.c Index: apps/plugins/SUBDIRS =================================================================== --- apps/plugins/SUBDIRS (revision 18139) +++ apps/plugins/SUBDIRS (working copy) @@ -1,4 +1,4 @@ -#if !defined(IRIVER_IFP7XX_SERIES) +#if !defined(IRIVER_IFP7XX_SERIES) && !defined(SDL) /* For all targets */ shortcuts Index: apps/gui/statusbar.c =================================================================== --- apps/gui/statusbar.c (revision 18139) +++ apps/gui/statusbar.c (working copy) @@ -397,7 +397,7 @@ fill = endfill = (percent * (STATUSBAR_BATTERY_WIDTH-3) + 50) / 100; } -#if CONFIG_CHARGING == CHARGING_MONITOR && !defined(SIMULATOR) +#if CONFIG_CHARGING == CHARGING_MONITOR && !defined(SIMULATOR) && !defined(SDL) /* Certain charge controlled targets */ /* show graphical animation when charging instead of numbers */ if ((global_settings.battery_display) && @@ -683,7 +683,7 @@ unsigned long samprk; int xpos; -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) samprk = 44100; #else #ifdef HAVE_SPDIF_REC 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(SDL) /* a space which is defined in stubs.c */ extern unsigned char vp_dummy[VIRT_SIZE]; #define VIRT_PTR vp_dummy @@ -732,7 +732,7 @@ int list_accel_wait; /* ms between increases */ #endif #ifdef HAVE_USBSTACK - int usb_stack_mode; /* device or host */ + int usb_stack_mode; /* device or host */ unsigned char usb_stack_device_driver[32]; /* usb device driver to load */ #endif #if CONFIG_CODEC == SWCODEC Index: apps/menus/settings_menu.c =================================================================== --- apps/menus/settings_menu.c (revision 18139) +++ apps/menus/settings_menu.c (working copy) @@ -338,7 +338,7 @@ switch (action) { case ACTION_EXIT_MENUITEM: /* on exit */ -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) dac_line_in(global_settings.line_in); #endif break; 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/tagcache.c =================================================================== --- apps/tagcache.c (revision 18139) +++ apps/tagcache.c (working copy) @@ -3038,7 +3038,7 @@ int masterfd; mutex_lock(&command_queue_mutex); - + if ( (masterfd = open_master_fd(&myhdr, true)) < 0) return false; @@ -4373,7 +4373,7 @@ case SYS_POWEROFF: break ; -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) case SYS_USB_CONNECTED: logf("USB: TagCache"); usb_acknowledge(SYS_USB_CONNECTED_ACK); @@ -4487,7 +4487,7 @@ create_thread(tagcache_thread, tagcache_stack, sizeof(tagcache_stack), 0, tagcache_thread_name IF_PRIO(, PRIORITY_BACKGROUND) - IF_COP(, CPU)); + IF_COP(, CPU)); #else tc_stat.initialized = true; allocate_tempbuf(); 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/playback.c =================================================================== --- apps/playback.c (revision 18139) +++ apps/playback.c (working copy) @@ -116,7 +116,7 @@ /* Define one constant that includes recording related functionality */ -#if defined(HAVE_RECORDING) && !defined(SIMULATOR) +#if defined(HAVE_RECORDING) && !defined(SIMULATOR) && !defined(SDL) #define AUDIO_HAVE_RECORDING #endif @@ -504,7 +504,7 @@ bool audio_load_encoder(int afmt) { -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) 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(SDL) /* 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 +#if !defined(SIMULATOR) && !defined(SDL) 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(SDL) 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, @@ -446,7 +446,7 @@ audio_current_track, audio_flush_and_reload_tracks, audio_get_file_pos, -#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) +#if !defined(SIMULATOR) && !defined(SDL) && (CONFIG_CODEC != SWCODEC) mpeg_get_last_header, #endif #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || \ @@ -454,7 +454,7 @@ sound_set_pitch, #endif -#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) +#if !defined(SIMULATOR) && !defined(SDL) && (CONFIG_CODEC != SWCODEC) /* MAS communication */ mas_readmem, mas_writemem, @@ -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(SDL) 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; @@ -567,7 +567,7 @@ struct mp3entry* (*audio_current_track)(void); void (*audio_flush_and_reload_tracks)(void); int (*audio_get_file_pos)(void); -#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) +#if !defined(SIMULATOR) && !defined(SDL) && (CONFIG_CODEC != SWCODEC) unsigned long (*mpeg_get_last_header)(void); #endif #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || \ @@ -576,7 +576,7 @@ #endif /* MAS communication */ -#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) +#if !defined(SIMULATOR) && !defined(SDL) && (CONFIG_CODEC != SWCODEC) int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len); int (*mas_writemem)(int bank, int addr, const unsigned long* src, int len); int (*mas_readreg)(int reg); @@ -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 @@ -662,7 +662,7 @@ void (*plugin_iram_init)(char *iramstart, char *iramcopy, size_t iram_size, char *iedata, size_t iedata_size); #endif -#if defined(DEBUG) || defined(SIMULATOR) +#if defined(DEBUG) || defined(SIMULATOR) void (*debugf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2); #endif #ifdef ROCKBOX_HAS_LOGF @@ -776,14 +776,15 @@ }; #ifdef PLUGIN -#ifndef SIMULATOR -extern unsigned char plugin_start_addr[]; +#if !defined(SIMULATOR) && !defined(SDL) +/*extern unsigned char plugin_start_addr[]; extern unsigned char plugin_end_addr[]; #define PLUGIN_HEADER \ const struct plugin_header __header \ __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 +#if !defined(SIMULATOR) && !defined(SDL) 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/codecs/SOURCES =================================================================== --- apps/codecs/SOURCES (revision 18139) +++ apps/codecs/SOURCES (working copy) @@ -22,7 +22,7 @@ nsf.c spc.c asap.c -#if defined(HAVE_RECORDING) && !defined(SIMULATOR) +#if defined(HAVE_RECORDING) && !defined(SIMULATOR) && !defined(SDL) /* encoders */ aiff_enc.c mp3_enc.c 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) @@ -76,7 +76,7 @@ #if (CONFIG_CODEC == SWCODEC) #include "playback.h" #endif -#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && !defined(SIMULATOR) +#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && !defined(SIMULATOR) && !defined(SDL) #include "pcm_record.h" #endif @@ -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) { @@ -564,7 +564,7 @@ audio_init(); -#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && !defined(SIMULATOR) +#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && !defined(SIMULATOR) && !defined(SDL) pcm_rec_init(); #endif 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/system.h =================================================================== --- firmware/export/system.h (revision 18139) +++ firmware/export/system.h (working copy) @@ -193,7 +193,7 @@ MAXMEMGUARD }; -#ifndef SIMULATOR +#ifndef SIMULATOR // #include "system-target.h" #else /* SIMULATOR */ 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 @@ -479,7 +479,7 @@ create_thread(void (*function)(void), void* stack, size_t stack_size, unsigned flags, const char *name IF_PRIO(, int priority) - IF_COP(, unsigned int core)); + IF_COP(, unsigned int core)); /* Set and clear the CPU frequency boost flag for the calling thread */ #ifdef HAVE_SCHEDULER_BOOSTCTRL 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(SDL) 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 @@ -439,7 +439,7 @@ switch_thread(); #elif defined(CREATIVE_ZVx) && defined(BOOTLOADER) /* hacky.. */ - long sleep_ticks = current_tick + ticks + 1; + long sleep_ticks = current_tick + ticks + 1; while (sleep_ticks > current_tick) switch_thread(); #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/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,10 +312,10 @@ #endif } #endif /* (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 */ -#endif /* !SIMULATOR */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) unsigned long mdb_shape_shadow = 0; @@ -529,7 +529,7 @@ } #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */ -#else /* SIMULATOR */ +#else /* !defined(SIMULATOR) && !defined(SDL) */ int sim_volume; void sound_set_volume(int value) { @@ -710,7 +710,7 @@ #endif /* !defined(HAVE_AS3514) || defined(SIMULATOR) */ #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) /* This function works by telling the decoder that we have another crystal frequency than we actually have. It will adjust its internal parameters and the result is that the audio is played at another pitch. 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/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/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/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) @@ -23,7 +23,7 @@ #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 -_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, int(*_compar)(const _PTR, const _PTR))); +_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, int(*_compar)(const _PTR, const _PTR))); void *malloc(size_t); void *calloc (size_t nmemb, size_t size); @@ -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) @@ -1,5 +1,5 @@ #ifndef _STDIO_H_ -#define _STDIO_H_ +#define _STDIO_H_ #include <_ansi.h> @@ -10,22 +10,22 @@ #include #ifndef NULL -#define NULL 0 +#define NULL 0 #endif -#define EOF (-1) +#define EOF (-1) #ifndef SEEK_SET -#define SEEK_SET 0 /* set file offset to offset */ +#define SEEK_SET 0 /* set file offset to offset */ #endif #ifndef SEEK_CUR -#define SEEK_CUR 1 /* set file offset to current plus offset */ +#define SEEK_CUR 1 /* set file offset to current plus offset */ #endif #ifndef SEEK_END -#define SEEK_END 2 /* set file offset to EOF plus offset */ +#define SEEK_END 2 /* set file offset to EOF plus offset */ #endif -#define TMP_MAX 26 +#define TMP_MAX 26 #ifdef __GNUC__ #define __VALIST __gnuc_va_list @@ -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/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(SDL) 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,11 +51,11 @@ #endif #include "logf.h" #include "lcd-remote.h" -#ifdef SIMULATOR +#if defined( SIMULATOR) || defined(SDL) #include #endif -#if (defined(IAUDIO_X5) || defined(IAUDIO_M5)) && !defined (SIMULATOR) +#if (defined(IAUDIO_X5) || defined(IAUDIO_M5)) && !defined (SIMULATOR) && !defined(SDL) #include "pcf50606.h" #include "lcd-remote-target.h" #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 */ @@ -1119,7 +1119,7 @@ power off after an 20 second timeout - 28 seconds if recording */ if (shutdown_timeout == 0) { -#if (defined(IAUDIO_X5) || defined(IAUDIO_M5)) && !defined (SIMULATOR) +#if (defined(IAUDIO_X5) || defined(IAUDIO_M5)) && !defined (SIMULATOR) && !defined(SDL) pcf50606_reset_timeout(); /* Reset timer on first attempt only */ #endif #ifdef HAVE_RECORDING @@ -1136,7 +1136,7 @@ { logf("sys_cancel_shutdown()"); -#if (defined(IAUDIO_X5) || defined(IAUDIO_M5)) && !defined (SIMULATOR) +#if (defined(IAUDIO_X5) || defined(IAUDIO_M5)) && !defined (SIMULATOR) && !defined(SDL) /* TODO: Move some things to target/ tree */ if (shutdown_timeout) pcf50606_reset_timeout(); @@ -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) {