diff options
Diffstat (limited to 'apps')
51 files changed, 132 insertions, 126 deletions
diff --git a/apps/audio_path.c b/apps/audio_path.c index 0469d4412a..dab43ebf42 100644 --- a/apps/audio_path.c +++ b/apps/audio_path.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #endif | 42 | #endif |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | #ifndef SIMULATOR | 45 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
46 | 46 | ||
47 | #ifdef AUDIO_CPU_BOOST | 47 | #ifdef AUDIO_CPU_BOOST |
48 | static void audio_cpu_boost(bool state) | 48 | static void audio_cpu_boost(bool state) |
@@ -115,7 +115,7 @@ int audio_get_spdif_sample_rate(void) | |||
115 | } /* audio_get_spdif_sample_rate */ | 115 | } /* audio_get_spdif_sample_rate */ |
116 | #endif /* HAVE_SPDIF_IN */ | 116 | #endif /* HAVE_SPDIF_IN */ |
117 | 117 | ||
118 | #else /* SIMULATOR */ | 118 | #else /* PLATFORM_HOSTED */ |
119 | 119 | ||
120 | /** Sim stubs **/ | 120 | /** Sim stubs **/ |
121 | 121 | ||
@@ -153,4 +153,4 @@ int audio_get_spdif_sample_rate(void) | |||
153 | } /* audio_get_spdif_sample_rate */ | 153 | } /* audio_get_spdif_sample_rate */ |
154 | #endif /* HAVE_SPDIF_IN */ | 154 | #endif /* HAVE_SPDIF_IN */ |
155 | 155 | ||
156 | #endif /* !SIMULATOR */ | 156 | #endif /* PLATFORM_NATIVE */ |
diff --git a/apps/bitmaps/mono/SOURCES b/apps/bitmaps/mono/SOURCES index 4d9008e8a3..2dccf2ad4f 100644 --- a/apps/bitmaps/mono/SOURCES +++ b/apps/bitmaps/mono/SOURCES | |||
@@ -1,3 +1,3 @@ | |||
1 | #if defined(SIMULATOR) && defined(__APPLE__) | 1 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__) |
2 | osx_dummy.bmp | 2 | osx_dummy.bmp |
3 | #endif | 3 | #endif |
diff --git a/apps/bitmaps/remote_mono/SOURCES b/apps/bitmaps/remote_mono/SOURCES index 83b71c10b2..75f641fd95 100644 --- a/apps/bitmaps/remote_mono/SOURCES +++ b/apps/bitmaps/remote_mono/SOURCES | |||
@@ -1,3 +1,3 @@ | |||
1 | #if defined(SIMULATOR) && defined(__APPLE__) | 1 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__) |
2 | osx_remote_dummy.bmp | 2 | osx_remote_dummy.bmp |
3 | #endif | 3 | #endif |
diff --git a/apps/buffering.c b/apps/buffering.c index 8a6418fd22..c2cecddf03 100644 --- a/apps/buffering.c +++ b/apps/buffering.c | |||
@@ -1488,7 +1488,7 @@ void buffering_thread(void) | |||
1488 | base_handle_id = (int)ev.data; | 1488 | base_handle_id = (int)ev.data; |
1489 | break; | 1489 | break; |
1490 | 1490 | ||
1491 | #ifndef SIMULATOR | 1491 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
1492 | case SYS_USB_CONNECTED: | 1492 | case SYS_USB_CONNECTED: |
1493 | LOGFQUEUE("buffering < SYS_USB_CONNECTED"); | 1493 | LOGFQUEUE("buffering < SYS_USB_CONNECTED"); |
1494 | usb_acknowledge(SYS_USB_CONNECTED_ACK); | 1494 | usb_acknowledge(SYS_USB_CONNECTED_ACK); |
diff --git a/apps/codecs.c b/apps/codecs.c index 46d9223560..22e692c111 100644 --- a/apps/codecs.c +++ b/apps/codecs.c | |||
@@ -54,20 +54,20 @@ | |||
54 | #define LOGF_ENABLE | 54 | #define LOGF_ENABLE |
55 | #include "logf.h" | 55 | #include "logf.h" |
56 | 56 | ||
57 | #ifdef SIMULATOR | 57 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
58 | #define PREFIX(_x_) sim_ ## _x_ | ||
59 | #else | ||
60 | #define PREFIX | ||
61 | #endif | ||
62 | 58 | ||
63 | #ifdef SIMULATOR | 59 | #define PREFIX(_x_) sim_ ## _x_ |
64 | #if CONFIG_CODEC == SWCODEC | 60 | #if CONFIG_CODEC == SWCODEC |
65 | unsigned char codecbuf[CODEC_SIZE]; | 61 | unsigned char codecbuf[CODEC_SIZE]; |
66 | #endif | 62 | #endif |
67 | void *sim_codec_load_ram(char* codecptr, int size, void **pd); | 63 | void *sim_codec_load_ram(char* codecptr, int size, void **pd); |
68 | void sim_codec_close(void *pd); | 64 | void sim_codec_close(void *pd); |
69 | #else | 65 | |
66 | #else /* !PLATFORM_HOSTED */ | ||
67 | |||
68 | #define PREFIX | ||
70 | #define sim_codec_close(x) | 69 | #define sim_codec_close(x) |
70 | |||
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | size_t codec_size; | 73 | size_t codec_size; |
@@ -77,7 +77,7 @@ extern void* plugin_get_audio_buffer(size_t *buffer_size); | |||
77 | #undef open | 77 | #undef open |
78 | static int open(const char* pathname, int flags, ...) | 78 | static int open(const char* pathname, int flags, ...) |
79 | { | 79 | { |
80 | #ifdef SIMULATOR | 80 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
81 | int fd; | 81 | int fd; |
82 | if (flags & O_CREAT) | 82 | if (flags & O_CREAT) |
83 | { | 83 | { |
@@ -201,7 +201,7 @@ static int codec_load_ram(int size, struct codec_api *api) | |||
201 | { | 201 | { |
202 | struct codec_header *hdr; | 202 | struct codec_header *hdr; |
203 | int status; | 203 | int status; |
204 | #ifndef SIMULATOR | 204 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
205 | hdr = (struct codec_header *)codecbuf; | 205 | hdr = (struct codec_header *)codecbuf; |
206 | 206 | ||
207 | if (size <= (signed)sizeof(struct codec_header) | 207 | if (size <= (signed)sizeof(struct codec_header) |
@@ -220,7 +220,7 @@ static int codec_load_ram(int size, struct codec_api *api) | |||
220 | 220 | ||
221 | codec_size = hdr->end_addr - codecbuf; | 221 | codec_size = hdr->end_addr - codecbuf; |
222 | 222 | ||
223 | #else /* SIMULATOR */ | 223 | #elif (CONFIG_PLATFORM & PLATFORM_HOSTED) |
224 | void *pd; | 224 | void *pd; |
225 | 225 | ||
226 | hdr = sim_codec_load_ram(codecbuf, size, &pd); | 226 | hdr = sim_codec_load_ram(codecbuf, size, &pd); |
@@ -241,7 +241,7 @@ static int codec_load_ram(int size, struct codec_api *api) | |||
241 | 241 | ||
242 | codec_size = codecbuf - codecbuf; | 242 | codec_size = codecbuf - codecbuf; |
243 | 243 | ||
244 | #endif /* SIMULATOR */ | 244 | #endif /* CONFIG_PLATFORM */ |
245 | if (hdr->api_version > CODEC_API_VERSION | 245 | if (hdr->api_version > CODEC_API_VERSION |
246 | || hdr->api_version < CODEC_MIN_API_VERSION) { | 246 | || hdr->api_version < CODEC_MIN_API_VERSION) { |
247 | sim_codec_close(pd); | 247 | sim_codec_close(pd); |
diff --git a/apps/codecs.h b/apps/codecs.h index 27c9caba13..c3dbc4aaa3 100644 --- a/apps/codecs.h +++ b/apps/codecs.h | |||
@@ -254,7 +254,7 @@ extern unsigned char codecbuf[]; | |||
254 | extern size_t codec_size; | 254 | extern size_t codec_size; |
255 | 255 | ||
256 | #ifdef CODEC | 256 | #ifdef CODEC |
257 | #ifndef SIMULATOR | 257 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
258 | /* plugin_* is correct, codecs use the plugin linker script */ | 258 | /* plugin_* is correct, codecs use the plugin linker script */ |
259 | extern unsigned char plugin_start_addr[]; | 259 | extern unsigned char plugin_start_addr[]; |
260 | extern unsigned char plugin_end_addr[]; | 260 | extern unsigned char plugin_end_addr[]; |
diff --git a/apps/codecs/codec_crt0.c b/apps/codecs/codec_crt0.c index ed313634e3..dd0f99ffd8 100644 --- a/apps/codecs/codec_crt0.c +++ b/apps/codecs/codec_crt0.c | |||
@@ -36,7 +36,7 @@ extern enum codec_status codec_main(void); | |||
36 | 36 | ||
37 | enum codec_status codec_start(void) | 37 | enum codec_status codec_start(void) |
38 | { | 38 | { |
39 | #ifndef SIMULATOR | 39 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
40 | #ifdef USE_IRAM | 40 | #ifdef USE_IRAM |
41 | ci->memcpy(iramstart, iramcopy, iramend - iramstart); | 41 | ci->memcpy(iramstart, iramcopy, iramend - iramstart); |
42 | ci->memset(iedata, 0, iend - iedata); | 42 | ci->memset(iedata, 0, iend - iedata); |
diff --git a/apps/codecs/lib/SOURCES b/apps/codecs/lib/SOURCES index da77f97d30..49e744721d 100644 --- a/apps/codecs/lib/SOURCES +++ b/apps/codecs/lib/SOURCES | |||
@@ -24,6 +24,6 @@ setjmp_cf.S | |||
24 | setjmp_mips.S | 24 | setjmp_mips.S |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #elif defined(SIMULATOR) && defined(__APPLE__) | 27 | #elif (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__) |
28 | osx.dummy.c | 28 | osx.dummy.c |
29 | #endif | 29 | #endif |
diff --git a/apps/codecs/lib/tlsf/src/tlsf.c b/apps/codecs/lib/tlsf/src/tlsf.c index 570e472607..87f8d262ee 100644 --- a/apps/codecs/lib/tlsf/src/tlsf.c +++ b/apps/codecs/lib/tlsf/src/tlsf.c | |||
@@ -104,6 +104,7 @@ | |||
104 | #include <sys/mman.h> | 104 | #include <sys/mman.h> |
105 | #endif | 105 | #endif |
106 | 106 | ||
107 | #include "config.h" | ||
107 | #include "tlsf.h" | 108 | #include "tlsf.h" |
108 | 109 | ||
109 | #if !defined(__GNUC__) | 110 | #if !defined(__GNUC__) |
@@ -164,7 +165,8 @@ | |||
164 | #define PAGE_SIZE (getpagesize()) | 165 | #define PAGE_SIZE (getpagesize()) |
165 | #endif | 166 | #endif |
166 | 167 | ||
167 | #if defined(ROCKBOX) && defined(SIMULATOR) || !defined(ROCKBOX) | 168 | #if defined(ROCKBOX) && (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(DEBUG) \ |
169 | || !defined(ROCKBOX) | ||
168 | int printf(const char* fmt, ...); | 170 | int printf(const char* fmt, ...); |
169 | #define PRINT_MSG(fmt, args...) printf(fmt, ## args) | 171 | #define PRINT_MSG(fmt, args...) printf(fmt, ## args) |
170 | #define ERROR_MSG(fmt, args...) printf(fmt, ## args) | 172 | #define ERROR_MSG(fmt, args...) printf(fmt, ## args) |
diff --git a/apps/codecs/libm4a/demux.c b/apps/codecs/libm4a/demux.c index 8c7189e158..bde2238409 100644 --- a/apps/codecs/libm4a/demux.c +++ b/apps/codecs/libm4a/demux.c | |||
@@ -37,10 +37,8 @@ | |||
37 | 37 | ||
38 | #include "m4a.h" | 38 | #include "m4a.h" |
39 | 39 | ||
40 | #if defined(DEBUG) || defined(SIMULATOR) | ||
41 | #ifdef DEBUGF | ||
42 | #undef DEBUGF | 40 | #undef DEBUGF |
43 | #endif | 41 | #if defined(DEBUG) |
44 | #define DEBUGF qtmovie->stream->ci->debugf | 42 | #define DEBUGF qtmovie->stream->ci->debugf |
45 | #else | 43 | #else |
46 | #define DEBUGF(...) | 44 | #define DEBUGF(...) |
diff --git a/apps/codecs/libspc/spc_codec.h b/apps/codecs/libspc/spc_codec.h index 95d09fa091..b3a445c596 100644 --- a/apps/codecs/libspc/spc_codec.h +++ b/apps/codecs/libspc/spc_codec.h | |||
@@ -51,7 +51,7 @@ | |||
51 | /* TGB is the only target fast enough for gaussian and realtime BRR decode */ | 51 | /* TGB is the only target fast enough for gaussian and realtime BRR decode */ |
52 | /* echo is almost fast enough but not quite */ | 52 | /* echo is almost fast enough but not quite */ |
53 | #if defined(TOSHIBA_GIGABEAT_F) || defined(TOSHIBA_GIGABEAT_S) ||\ | 53 | #if defined(TOSHIBA_GIGABEAT_F) || defined(TOSHIBA_GIGABEAT_S) ||\ |
54 | defined(SIMULATOR) || MEMORYSIZE <= 2 | 54 | (CONFIG_PLATFORM & PLATFORM_HOSTED) || MEMORYSIZE <= 2 |
55 | /* Don't cache BRR waves */ | 55 | /* Don't cache BRR waves */ |
56 | #define SPC_BRRCACHE 0 | 56 | #define SPC_BRRCACHE 0 |
57 | 57 | ||
diff --git a/apps/codecs/libtremor/ctype.c b/apps/codecs/libtremor/ctype.c index 359be61e5a..9f22047675 100644 --- a/apps/codecs/libtremor/ctype.c +++ b/apps/codecs/libtremor/ctype.c | |||
@@ -1,3 +1,4 @@ | |||
1 | #ifndef SIMULATOR | 1 | #include "config.h" |
2 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) | ||
2 | #include "libc/ctype.c" | 3 | #include "libc/ctype.c" |
3 | #endif | 4 | #endif |
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 8da022453d..bd969df0c0 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -53,7 +53,7 @@ | |||
53 | #include "lcd-remote.h" | 53 | #include "lcd-remote.h" |
54 | #include "crc32.h" | 54 | #include "crc32.h" |
55 | #include "logf.h" | 55 | #include "logf.h" |
56 | #ifndef SIMULATOR | 56 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
57 | #include "disk.h" | 57 | #include "disk.h" |
58 | #include "adc.h" | 58 | #include "adc.h" |
59 | #include "power.h" | 59 | #include "power.h" |
@@ -276,7 +276,7 @@ static unsigned int ticks, boost_ticks, freq_sum; | |||
276 | 276 | ||
277 | static void dbg_audio_task(void) | 277 | static void dbg_audio_task(void) |
278 | { | 278 | { |
279 | #ifndef SIMULATOR | 279 | #ifdef CPUFREQ_NORMAL |
280 | if(FREQ > CPUFREQ_NORMAL) | 280 | if(FREQ > CPUFREQ_NORMAL) |
281 | boost_ticks++; | 281 | boost_ticks++; |
282 | freq_sum += FREQ/1000000; /* in MHz */ | 282 | freq_sum += FREQ/1000000; /* in MHz */ |
@@ -371,7 +371,7 @@ static bool dbg_buffering_thread(void) | |||
371 | 371 | ||
372 | screens[i].putsf(0, line++, "handle count: %d", (int)d.num_handles); | 372 | screens[i].putsf(0, line++, "handle count: %d", (int)d.num_handles); |
373 | 373 | ||
374 | #ifndef SIMULATOR | 374 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
375 | screens[i].putsf(0, line++, "cpu freq: %3dMHz", | 375 | screens[i].putsf(0, line++, "cpu freq: %3dMHz", |
376 | (int)((FREQ + 500000) / 1000000)); | 376 | (int)((FREQ + 500000) / 1000000)); |
377 | #endif | 377 | #endif |
@@ -758,7 +758,7 @@ static bool dbg_hw_info(void) | |||
758 | #endif /* !HAVE_LCD_BITMAP */ | 758 | #endif /* !HAVE_LCD_BITMAP */ |
759 | #endif /* !SIMULATOR */ | 759 | #endif /* !SIMULATOR */ |
760 | 760 | ||
761 | #ifndef SIMULATOR | 761 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
762 | static const char* dbg_partitions_getname(int selected_item, void *data, | 762 | static const char* dbg_partitions_getname(int selected_item, void *data, |
763 | char *buffer, size_t buffer_len) | 763 | char *buffer, size_t buffer_len) |
764 | { | 764 | { |
@@ -786,7 +786,7 @@ bool dbg_partitions(void) | |||
786 | info.get_name = dbg_partitions_getname; | 786 | info.get_name = dbg_partitions_getname; |
787 | return simplelist_show_list(&info); | 787 | return simplelist_show_list(&info); |
788 | } | 788 | } |
789 | #endif | 789 | #endif /* PLATFORM_NATIVE */ |
790 | 790 | ||
791 | #if defined(CPU_COLDFIRE) && defined(HAVE_SPDIF_OUT) | 791 | #if defined(CPU_COLDFIRE) && defined(HAVE_SPDIF_OUT) |
792 | static bool dbg_spdif(void) | 792 | static bool dbg_spdif(void) |
@@ -928,7 +928,7 @@ static bool dbg_spdif(void) | |||
928 | lcd_putsf(0, line++, "Clock accuracy: %d", x); | 928 | lcd_putsf(0, line++, "Clock accuracy: %d", x); |
929 | line++; | 929 | line++; |
930 | 930 | ||
931 | #ifndef SIMULATOR | 931 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
932 | lcd_putsf(0, line++, "Measured freq: %ldHz", | 932 | lcd_putsf(0, line++, "Measured freq: %ldHz", |
933 | spdif_measure_frequency()); | 933 | spdif_measure_frequency()); |
934 | #endif | 934 | #endif |
@@ -950,7 +950,7 @@ static bool dbg_spdif(void) | |||
950 | } | 950 | } |
951 | #endif /* CPU_COLDFIRE */ | 951 | #endif /* CPU_COLDFIRE */ |
952 | 952 | ||
953 | #ifndef SIMULATOR | 953 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
954 | #ifdef HAVE_LCD_BITMAP | 954 | #ifdef HAVE_LCD_BITMAP |
955 | /* button definitions */ | 955 | /* button definitions */ |
956 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ | 956 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ |
@@ -1334,9 +1334,9 @@ bool dbg_ports(void) | |||
1334 | return false; | 1334 | return false; |
1335 | } | 1335 | } |
1336 | #endif /* !HAVE_LCD_BITMAP */ | 1336 | #endif /* !HAVE_LCD_BITMAP */ |
1337 | #endif /* !SIMULATOR */ | 1337 | #endif /* PLATFORM_NATIVE */ |
1338 | 1338 | ||
1339 | #if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR) | 1339 | #if (CONFIG_RTC == RTC_PCF50605) && (CONFIG_PLATFORM & PLATFORM_NATIVE) |
1340 | static bool dbg_pcf(void) | 1340 | static bool dbg_pcf(void) |
1341 | { | 1341 | { |
1342 | int line; | 1342 | int line; |
@@ -1423,7 +1423,7 @@ static bool dbg_cpufreq(void) | |||
1423 | } | 1423 | } |
1424 | #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ | 1424 | #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ |
1425 | 1425 | ||
1426 | #if defined(HAVE_TSC2100) && !defined(SIMULATOR) | 1426 | #if defined(HAVE_TSC2100) && (CONFIG_PLATFORM & PLATFORM_NATIVE) |
1427 | #include "tsc2100.h" | 1427 | #include "tsc2100.h" |
1428 | static char *itob(int n, int len) | 1428 | static char *itob(int n, int len) |
1429 | { | 1429 | { |
@@ -1493,7 +1493,7 @@ static bool tsc2100_debug(void) | |||
1493 | return simplelist_show_list(&info); | 1493 | return simplelist_show_list(&info); |
1494 | } | 1494 | } |
1495 | #endif | 1495 | #endif |
1496 | #ifndef SIMULATOR | 1496 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
1497 | #ifdef HAVE_LCD_BITMAP | 1497 | #ifdef HAVE_LCD_BITMAP |
1498 | /* | 1498 | /* |
1499 | * view_battery() shows a automatically scaled graph of the battery voltage | 1499 | * view_battery() shows a automatically scaled graph of the battery voltage |
@@ -1785,7 +1785,7 @@ static bool view_battery(void) | |||
1785 | #endif /* HAVE_LCD_BITMAP */ | 1785 | #endif /* HAVE_LCD_BITMAP */ |
1786 | #endif | 1786 | #endif |
1787 | 1787 | ||
1788 | #ifndef SIMULATOR | 1788 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
1789 | #if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) | 1789 | #if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) |
1790 | 1790 | ||
1791 | #if (CONFIG_STORAGE & STORAGE_MMC) | 1791 | #if (CONFIG_STORAGE & STORAGE_MMC) |
@@ -2106,7 +2106,7 @@ static bool dbg_disk_info(void) | |||
2106 | info.scroll_all = true; | 2106 | info.scroll_all = true; |
2107 | return simplelist_show_list(&info); | 2107 | return simplelist_show_list(&info); |
2108 | } | 2108 | } |
2109 | #endif /* !SIMULATOR */ | 2109 | #endif /* PLATFORM_NATIVE */ |
2110 | 2110 | ||
2111 | #ifdef HAVE_DIRCACHE | 2111 | #ifdef HAVE_DIRCACHE |
2112 | static int dircache_callback(int btn, struct gui_synclist *lists) | 2112 | static int dircache_callback(int btn, struct gui_synclist *lists) |
@@ -2672,10 +2672,10 @@ static const struct the_menu_item menuitems[] = { | |||
2672 | || CONFIG_CPU == DM320 || defined(CPU_S5L870X) || CONFIG_CPU == AS3525v2 | 2672 | || CONFIG_CPU == DM320 || defined(CPU_S5L870X) || CONFIG_CPU == AS3525v2 |
2673 | { "View I/O ports", dbg_ports }, | 2673 | { "View I/O ports", dbg_ports }, |
2674 | #endif | 2674 | #endif |
2675 | #if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR) | 2675 | #if (CONFIG_RTC == RTC_PCF50605) && (CONFIG_PLATFORM & PLATFORM_NATIVE) |
2676 | { "View PCF registers", dbg_pcf }, | 2676 | { "View PCF registers", dbg_pcf }, |
2677 | #endif | 2677 | #endif |
2678 | #if defined(HAVE_TSC2100) && !defined(SIMULATOR) | 2678 | #if defined(HAVE_TSC2100) && (CONFIG_PLATFORM & PLATFORM_NATIVE) |
2679 | { "TSC2100 debug", tsc2100_debug }, | 2679 | { "TSC2100 debug", tsc2100_debug }, |
2680 | #endif | 2680 | #endif |
2681 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 2681 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
@@ -2689,18 +2689,18 @@ static const struct the_menu_item menuitems[] = { | |||
2689 | #endif | 2689 | #endif |
2690 | { "View OS stacks", dbg_os }, | 2690 | { "View OS stacks", dbg_os }, |
2691 | #ifdef HAVE_LCD_BITMAP | 2691 | #ifdef HAVE_LCD_BITMAP |
2692 | #ifndef SIMULATOR | 2692 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
2693 | { "View battery", view_battery }, | 2693 | { "View battery", view_battery }, |
2694 | #endif | 2694 | #endif |
2695 | { "Screendump", dbg_screendump }, | 2695 | { "Screendump", dbg_screendump }, |
2696 | #endif | 2696 | #endif |
2697 | #ifndef SIMULATOR | 2697 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
2698 | { "View HW info", dbg_hw_info }, | 2698 | { "View HW info", dbg_hw_info }, |
2699 | #endif | 2699 | #endif |
2700 | #ifndef SIMULATOR | 2700 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
2701 | { "View partitions", dbg_partitions }, | 2701 | { "View partitions", dbg_partitions }, |
2702 | #endif | 2702 | #endif |
2703 | #ifndef SIMULATOR | 2703 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
2704 | { "View disk info", dbg_disk_info }, | 2704 | { "View disk info", dbg_disk_info }, |
2705 | #if (CONFIG_STORAGE & STORAGE_ATA) | 2705 | #if (CONFIG_STORAGE & STORAGE_ATA) |
2706 | { "Dump ATA identify info", dbg_identify_info}, | 2706 | { "Dump ATA identify info", dbg_identify_info}, |
diff --git a/apps/filetree.c b/apps/filetree.c index 1faf4c987e..460ab9e453 100644 --- a/apps/filetree.c +++ b/apps/filetree.c | |||
@@ -597,7 +597,7 @@ int ft_enter(struct tree_context* c) | |||
597 | break; | 597 | break; |
598 | #endif | 598 | #endif |
599 | 599 | ||
600 | #ifndef SIMULATOR | 600 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
601 | /* firmware file */ | 601 | /* firmware file */ |
602 | case FILE_ATTR_MOD: | 602 | case FILE_ATTR_MOD: |
603 | splash(0, ID2P(LANG_WAIT)); | 603 | splash(0, ID2P(LANG_WAIT)); |
diff --git a/apps/main.c b/apps/main.c index 2555deb12f..19249241bb 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -115,6 +115,8 @@ | |||
115 | 115 | ||
116 | #ifdef SIMULATOR | 116 | #ifdef SIMULATOR |
117 | #include "sim_tasks.h" | 117 | #include "sim_tasks.h" |
118 | #endif | ||
119 | #ifdef HAVE_SDL | ||
118 | #include "system-sdl.h" | 120 | #include "system-sdl.h" |
119 | #endif | 121 | #endif |
120 | 122 | ||
@@ -313,7 +315,7 @@ static void init_tagcache(void) | |||
313 | } | 315 | } |
314 | #endif | 316 | #endif |
315 | 317 | ||
316 | #ifdef SIMULATOR | 318 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
317 | 319 | ||
318 | static void init(void) | 320 | static void init(void) |
319 | { | 321 | { |
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 3dd6348e57..32164ff3e0 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c | |||
@@ -347,7 +347,7 @@ static int info_action_callback(int action, struct gui_synclist *lists) | |||
347 | #endif | 347 | #endif |
348 | ) | 348 | ) |
349 | { | 349 | { |
350 | #ifndef SIMULATOR | 350 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
351 | struct info_data *info = (struct info_data *)lists->data; | 351 | struct info_data *info = (struct info_data *)lists->data; |
352 | int i; | 352 | int i; |
353 | info->new_data = true; | 353 | info->new_data = true; |
diff --git a/apps/misc.c b/apps/misc.c index 41988363ad..bae8dfbd07 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -251,7 +251,7 @@ static void system_restore(void) | |||
251 | 251 | ||
252 | static bool clean_shutdown(void (*callback)(void *), void *parameter) | 252 | static bool clean_shutdown(void (*callback)(void *), void *parameter) |
253 | { | 253 | { |
254 | #ifdef SIMULATOR | 254 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
255 | (void)callback; | 255 | (void)callback; |
256 | (void)parameter; | 256 | (void)parameter; |
257 | bookmark_autobookmark(false); | 257 | bookmark_autobookmark(false); |
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index e9102b2a73..ebc31fbb2e 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c | |||
@@ -30,7 +30,7 @@ | |||
30 | /* Define LOGF_ENABLE to enable logf output in this file */ | 30 | /* Define LOGF_ENABLE to enable logf output in this file */ |
31 | /*#define LOGF_ENABLE*/ | 31 | /*#define LOGF_ENABLE*/ |
32 | #include "logf.h" | 32 | #include "logf.h" |
33 | #ifndef SIMULATOR | 33 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
34 | #include "cpu.h" | 34 | #include "cpu.h" |
35 | #endif | 35 | #endif |
36 | #include <string.h> | 36 | #include <string.h> |
diff --git a/apps/playback.c b/apps/playback.c index 6be869f83a..4a28a9d008 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -468,7 +468,7 @@ unsigned char *audio_get_recording_buffer(size_t *buffer_size) | |||
468 | 468 | ||
469 | bool audio_load_encoder(int afmt) | 469 | bool audio_load_encoder(int afmt) |
470 | { | 470 | { |
471 | #ifndef SIMULATOR | 471 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
472 | const char *enc_fn = get_codec_filename(afmt | CODEC_TYPE_ENCODER); | 472 | const char *enc_fn = get_codec_filename(afmt | CODEC_TYPE_ENCODER); |
473 | if (!enc_fn) | 473 | if (!enc_fn) |
474 | return false; | 474 | return false; |
@@ -493,7 +493,7 @@ bool audio_load_encoder(int afmt) | |||
493 | 493 | ||
494 | void audio_remove_encoder(void) | 494 | void audio_remove_encoder(void) |
495 | { | 495 | { |
496 | #ifndef SIMULATOR | 496 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
497 | /* force encoder codec unload (if currently loaded) */ | 497 | /* force encoder codec unload (if currently loaded) */ |
498 | if (ci.enc_codec_loaded <= 0) | 498 | if (ci.enc_codec_loaded <= 0) |
499 | return; | 499 | return; |
@@ -2008,7 +2008,7 @@ static void audio_thread(void) | |||
2008 | LOGFQUEUE("audio < Q_AUDIO_TRACK_CHANGED"); | 2008 | LOGFQUEUE("audio < Q_AUDIO_TRACK_CHANGED"); |
2009 | audio_finalise_track_change(); | 2009 | audio_finalise_track_change(); |
2010 | break; | 2010 | break; |
2011 | #ifndef SIMULATOR | 2011 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
2012 | case SYS_USB_CONNECTED: | 2012 | case SYS_USB_CONNECTED: |
2013 | LOGFQUEUE("audio < SYS_USB_CONNECTED"); | 2013 | LOGFQUEUE("audio < SYS_USB_CONNECTED"); |
2014 | if (playing) | 2014 | if (playing) |
diff --git a/apps/playlist.c b/apps/playlist.c index 485601cd7e..4a6db883f7 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -1318,7 +1318,7 @@ static void playlist_thread(void) | |||
1318 | dirty_pointers = false; | 1318 | dirty_pointers = false; |
1319 | break ; | 1319 | break ; |
1320 | 1320 | ||
1321 | #ifndef SIMULATOR | 1321 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
1322 | case SYS_USB_CONNECTED: | 1322 | case SYS_USB_CONNECTED: |
1323 | usb_acknowledge(SYS_USB_CONNECTED_ACK); | 1323 | usb_acknowledge(SYS_USB_CONNECTED_ACK); |
1324 | usb_wait_for_disconnect(&playlist_queue); | 1324 | usb_wait_for_disconnect(&playlist_queue); |
diff --git a/apps/plugin.c b/apps/plugin.c index d626ef6488..56d2be9f40 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -57,7 +57,7 @@ | |||
57 | #include "usbstack/usb_hid.h" | 57 | #include "usbstack/usb_hid.h" |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #ifdef SIMULATOR | 60 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
61 | #define PREFIX(_x_) sim_ ## _x_ | 61 | #define PREFIX(_x_) sim_ ## _x_ |
62 | #else | 62 | #else |
63 | #define PREFIX | 63 | #define PREFIX |
@@ -72,7 +72,7 @@ | |||
72 | static unsigned int open_files; | 72 | static unsigned int open_files; |
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | #ifdef SIMULATOR | 75 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
76 | static unsigned char pluginbuf[PLUGIN_BUFFER_SIZE]; | 76 | static unsigned char pluginbuf[PLUGIN_BUFFER_SIZE]; |
77 | void *sim_plugin_load(char *plugin, void **pd); | 77 | void *sim_plugin_load(char *plugin, void **pd); |
78 | void sim_plugin_close(void *pd); | 78 | void sim_plugin_close(void *pd); |
@@ -157,7 +157,7 @@ static const struct plugin_api rockbox_api = { | |||
157 | lcd_yuv_set_options, | 157 | lcd_yuv_set_options, |
158 | #endif | 158 | #endif |
159 | #endif /* MEMORYSIZE > 2 */ | 159 | #endif /* MEMORYSIZE > 2 */ |
160 | #elif (LCD_DEPTH < 4) && !defined(SIMULATOR) | 160 | #elif (LCD_DEPTH < 4) && (CONFIG_PLATFORM & PLATFORM_NATIVE) |
161 | lcd_blit_mono, | 161 | lcd_blit_mono, |
162 | lcd_blit_grey_phase, | 162 | lcd_blit_grey_phase, |
163 | #endif /* LCD_DEPTH */ | 163 | #endif /* LCD_DEPTH */ |
@@ -366,7 +366,7 @@ static const struct plugin_api rockbox_api = { | |||
366 | #endif | 366 | #endif |
367 | 367 | ||
368 | reset_poweroff_timer, | 368 | reset_poweroff_timer, |
369 | #ifndef SIMULATOR | 369 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
370 | system_memory_guard, | 370 | system_memory_guard, |
371 | &cpu_frequency, | 371 | &cpu_frequency, |
372 | 372 | ||
@@ -377,7 +377,7 @@ static const struct plugin_api rockbox_api = { | |||
377 | cpu_boost, | 377 | cpu_boost, |
378 | #endif | 378 | #endif |
379 | #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ | 379 | #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ |
380 | #endif /* !SIMULATOR */ | 380 | #endif /* PLATFORM_NATIVE */ |
381 | #ifdef HAVE_SCHEDULER_BOOSTCTRL | 381 | #ifdef HAVE_SCHEDULER_BOOSTCTRL |
382 | trigger_cpu_boost, | 382 | trigger_cpu_boost, |
383 | cancel_cpu_boost, | 383 | cancel_cpu_boost, |
@@ -415,7 +415,7 @@ static const struct plugin_api rockbox_api = { | |||
415 | remove_event, | 415 | remove_event, |
416 | send_event, | 416 | send_event, |
417 | 417 | ||
418 | #ifdef SIMULATOR | 418 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
419 | /* special simulator hooks */ | 419 | /* special simulator hooks */ |
420 | #if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8 | 420 | #if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8 |
421 | sim_lcd_ex_init, | 421 | sim_lcd_ex_init, |
@@ -437,7 +437,7 @@ static const struct plugin_api rockbox_api = { | |||
437 | memset, | 437 | memset, |
438 | memcpy, | 438 | memcpy, |
439 | memmove, | 439 | memmove, |
440 | #ifndef SIMULATOR | 440 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
441 | _ctype_, | 441 | _ctype_, |
442 | #endif | 442 | #endif |
443 | atoi, | 443 | atoi, |
@@ -467,7 +467,7 @@ static const struct plugin_api rockbox_api = { | |||
467 | #ifdef AUDIOHW_HAVE_EQ | 467 | #ifdef AUDIOHW_HAVE_EQ |
468 | sound_enum_hw_eq_band_setting, | 468 | sound_enum_hw_eq_band_setting, |
469 | #endif | 469 | #endif |
470 | #ifndef SIMULATOR | 470 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
471 | mp3_play_data, | 471 | mp3_play_data, |
472 | mp3_play_pause, | 472 | mp3_play_pause, |
473 | mp3_play_stop, | 473 | mp3_play_stop, |
@@ -589,7 +589,7 @@ static const struct plugin_api rockbox_api = { | |||
589 | battery_level, | 589 | battery_level, |
590 | battery_level_safe, | 590 | battery_level_safe, |
591 | battery_time, | 591 | battery_time, |
592 | #ifndef SIMULATOR | 592 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
593 | battery_voltage, | 593 | battery_voltage, |
594 | #endif | 594 | #endif |
595 | #if CONFIG_CHARGING | 595 | #if CONFIG_CHARGING |
@@ -603,7 +603,7 @@ static const struct plugin_api rockbox_api = { | |||
603 | #endif | 603 | #endif |
604 | 604 | ||
605 | /* misc */ | 605 | /* misc */ |
606 | #if !defined(SIMULATOR) | 606 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
607 | &errno, | 607 | &errno, |
608 | #endif | 608 | #endif |
609 | srand, | 609 | srand, |
@@ -727,15 +727,15 @@ int plugin_load(const char* plugin, const void* parameter) | |||
727 | { | 727 | { |
728 | int rc, i; | 728 | int rc, i; |
729 | struct plugin_header *hdr; | 729 | struct plugin_header *hdr; |
730 | #ifdef SIMULATOR | 730 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
731 | void *pd; | 731 | void *pd; |
732 | #else /* !SIMULATOR */ | 732 | #else /* PLATFOR_NATIVE */ |
733 | int fd; | 733 | int fd; |
734 | ssize_t readsize; | 734 | ssize_t readsize; |
735 | #if NUM_CORES > 1 | 735 | #if NUM_CORES > 1 |
736 | unsigned my_core; | 736 | unsigned my_core; |
737 | #endif | 737 | #endif |
738 | #endif /* !SIMULATOR */ | 738 | #endif /* CONFIG_PLATFORM */ |
739 | 739 | ||
740 | #if LCD_DEPTH > 1 | 740 | #if LCD_DEPTH > 1 |
741 | fb_data* old_backdrop; | 741 | fb_data* old_backdrop; |
@@ -755,7 +755,7 @@ int plugin_load(const char* plugin, const void* parameter) | |||
755 | splash(0, ID2P(LANG_WAIT)); | 755 | splash(0, ID2P(LANG_WAIT)); |
756 | strcpy(current_plugin, plugin); | 756 | strcpy(current_plugin, plugin); |
757 | 757 | ||
758 | #ifdef SIMULATOR | 758 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
759 | hdr = sim_plugin_load((char *)plugin, &pd); | 759 | hdr = sim_plugin_load((char *)plugin, &pd); |
760 | if (pd == NULL) { | 760 | if (pd == NULL) { |
761 | splashf(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin); | 761 | splashf(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin); |
@@ -990,7 +990,7 @@ static int open_wrapper(const char* pathname, int flags, ...) | |||
990 | /* we don't have an 'open' function. it's a define. and we need | 990 | /* we don't have an 'open' function. it's a define. and we need |
991 | * the real file_open, hence PREFIX() doesn't work here */ | 991 | * the real file_open, hence PREFIX() doesn't work here */ |
992 | int fd; | 992 | int fd; |
993 | #ifdef SIMULATOR | 993 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
994 | if (flags & O_CREAT) | 994 | if (flags & O_CREAT) |
995 | { | 995 | { |
996 | va_list ap; | 996 | va_list ap; |
diff --git a/apps/plugin.h b/apps/plugin.h index a6b864ba44..b0f4e051c5 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -233,7 +233,7 @@ struct plugin_api { | |||
233 | void (*lcd_yuv_set_options)(unsigned options); | 233 | void (*lcd_yuv_set_options)(unsigned options); |
234 | #endif | 234 | #endif |
235 | #endif /* MEMORYSIZE > 2 */ | 235 | #endif /* MEMORYSIZE > 2 */ |
236 | #elif (LCD_DEPTH < 4) && !defined(SIMULATOR) | 236 | #elif (LCD_DEPTH < 4) && (CONFIG_PLATFORM & PLATFORM_NATIVE) |
237 | void (*lcd_blit_mono)(const unsigned char *data, int x, int by, int width, | 237 | void (*lcd_blit_mono)(const unsigned char *data, int x, int by, int width, |
238 | int bheight, int stride); | 238 | int bheight, int stride); |
239 | void (*lcd_blit_grey_phase)(unsigned char *values, unsigned char *phases, | 239 | void (*lcd_blit_grey_phase)(unsigned char *values, unsigned char *phases, |
@@ -474,7 +474,7 @@ struct plugin_api { | |||
474 | #endif | 474 | #endif |
475 | 475 | ||
476 | void (*reset_poweroff_timer)(void); | 476 | void (*reset_poweroff_timer)(void); |
477 | #ifndef SIMULATOR | 477 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
478 | int (*system_memory_guard)(int newmode); | 478 | int (*system_memory_guard)(int newmode); |
479 | long *cpu_frequency; | 479 | long *cpu_frequency; |
480 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 480 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
@@ -484,7 +484,7 @@ struct plugin_api { | |||
484 | void (*cpu_boost)(bool on_off); | 484 | void (*cpu_boost)(bool on_off); |
485 | #endif | 485 | #endif |
486 | #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ | 486 | #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ |
487 | #endif /* !SIMULATOR */ | 487 | #endif /* PLATFORM_NATIVE */ |
488 | #ifdef HAVE_SCHEDULER_BOOSTCTRL | 488 | #ifdef HAVE_SCHEDULER_BOOSTCTRL |
489 | void (*trigger_cpu_boost)(void); | 489 | void (*trigger_cpu_boost)(void); |
490 | void (*cancel_cpu_boost)(void); | 490 | void (*cancel_cpu_boost)(void); |
@@ -530,7 +530,7 @@ struct plugin_api { | |||
530 | void (*remove_event)(unsigned short id, void (*handler)(void *data)); | 530 | void (*remove_event)(unsigned short id, void (*handler)(void *data)); |
531 | void (*send_event)(unsigned short id, void *data); | 531 | void (*send_event)(unsigned short id, void *data); |
532 | 532 | ||
533 | #ifdef SIMULATOR | 533 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
534 | /* special simulator hooks */ | 534 | /* special simulator hooks */ |
535 | #if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8 | 535 | #if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8 |
536 | void (*sim_lcd_ex_init)(unsigned long (*getpixel)(int, int)); | 536 | void (*sim_lcd_ex_init)(unsigned long (*getpixel)(int, int)); |
@@ -553,7 +553,7 @@ struct plugin_api { | |||
553 | void* (*memset)(void *dst, int c, size_t length); | 553 | void* (*memset)(void *dst, int c, size_t length); |
554 | void* (*memcpy)(void *out, const void *in, size_t n); | 554 | void* (*memcpy)(void *out, const void *in, size_t n); |
555 | void* (*memmove)(void *out, const void *in, size_t n); | 555 | void* (*memmove)(void *out, const void *in, size_t n); |
556 | #ifndef SIMULATOR | 556 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
557 | const unsigned char *_rbctype_; | 557 | const unsigned char *_rbctype_; |
558 | #endif | 558 | #endif |
559 | int (*atoi)(const char *str); | 559 | int (*atoi)(const char *str); |
@@ -584,7 +584,7 @@ struct plugin_api { | |||
584 | int (*sound_enum_hw_eq_band_setting)(unsigned int band, | 584 | int (*sound_enum_hw_eq_band_setting)(unsigned int band, |
585 | unsigned int band_setting); | 585 | unsigned int band_setting); |
586 | #endif /* AUDIOHW_HAVE_EQ */ | 586 | #endif /* AUDIOHW_HAVE_EQ */ |
587 | #ifndef SIMULATOR | 587 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
588 | void (*mp3_play_data)(const unsigned char* start, int size, | 588 | void (*mp3_play_data)(const unsigned char* start, int size, |
589 | void (*get_more)(unsigned char** start, size_t* size)); | 589 | void (*get_more)(unsigned char** start, size_t* size)); |
590 | void (*mp3_play_pause)(bool play); | 590 | void (*mp3_play_pause)(bool play); |
@@ -593,7 +593,7 @@ struct plugin_api { | |||
593 | #if CONFIG_CODEC != SWCODEC | 593 | #if CONFIG_CODEC != SWCODEC |
594 | void (*bitswap)(unsigned char *data, int length); | 594 | void (*bitswap)(unsigned char *data, int length); |
595 | #endif | 595 | #endif |
596 | #endif /* !SIMULATOR */ | 596 | #endif /* PLATFORM_NATIVE */ |
597 | #if CONFIG_CODEC == SWCODEC | 597 | #if CONFIG_CODEC == SWCODEC |
598 | const unsigned long *audio_master_sampr_list; | 598 | const unsigned long *audio_master_sampr_list; |
599 | const unsigned long *hw_freq_sampr; | 599 | const unsigned long *hw_freq_sampr; |
@@ -731,7 +731,7 @@ struct plugin_api { | |||
731 | int (*battery_level)(void); | 731 | int (*battery_level)(void); |
732 | bool (*battery_level_safe)(void); | 732 | bool (*battery_level_safe)(void); |
733 | int (*battery_time)(void); | 733 | int (*battery_time)(void); |
734 | #ifndef SIMULATOR | 734 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
735 | unsigned int (*battery_voltage)(void); | 735 | unsigned int (*battery_voltage)(void); |
736 | #endif | 736 | #endif |
737 | #if CONFIG_CHARGING | 737 | #if CONFIG_CHARGING |
@@ -745,7 +745,7 @@ struct plugin_api { | |||
745 | #endif | 745 | #endif |
746 | 746 | ||
747 | /* misc */ | 747 | /* misc */ |
748 | #if !defined(SIMULATOR) | 748 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
749 | int* __errno; | 749 | int* __errno; |
750 | #endif | 750 | #endif |
751 | void (*srand)(unsigned int seed); | 751 | void (*srand)(unsigned int seed); |
@@ -902,7 +902,7 @@ struct plugin_header { | |||
902 | }; | 902 | }; |
903 | 903 | ||
904 | #ifdef PLUGIN | 904 | #ifdef PLUGIN |
905 | #ifndef SIMULATOR | 905 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
906 | extern unsigned char plugin_start_addr[]; | 906 | extern unsigned char plugin_start_addr[]; |
907 | extern unsigned char plugin_end_addr[]; | 907 | extern unsigned char plugin_end_addr[]; |
908 | #define PLUGIN_HEADER \ | 908 | #define PLUGIN_HEADER \ |
@@ -911,14 +911,14 @@ extern unsigned char plugin_end_addr[]; | |||
911 | __attribute__ ((section (".header")))= { \ | 911 | __attribute__ ((section (".header")))= { \ |
912 | PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \ | 912 | PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \ |
913 | plugin_start_addr, plugin_end_addr, plugin_start, &rb }; | 913 | plugin_start_addr, plugin_end_addr, plugin_start, &rb }; |
914 | #else /* SIMULATOR */ | 914 | #else /* PLATFORM_HOSTED */ |
915 | #define PLUGIN_HEADER \ | 915 | #define PLUGIN_HEADER \ |
916 | const struct plugin_api *rb DATA_ATTR; \ | 916 | const struct plugin_api *rb DATA_ATTR; \ |
917 | const struct plugin_header __header \ | 917 | const struct plugin_header __header \ |
918 | __attribute__((visibility("default"))) = { \ | 918 | __attribute__((visibility("default"))) = { \ |
919 | PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \ | 919 | PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \ |
920 | NULL, NULL, plugin_start, &rb }; | 920 | NULL, NULL, plugin_start, &rb }; |
921 | #endif /* SIMULATOR */ | 921 | #endif /* CONFIG_PLATFORM */ |
922 | 922 | ||
923 | #ifdef PLUGIN_USE_IRAM | 923 | #ifdef PLUGIN_USE_IRAM |
924 | /* Declare IRAM variables */ | 924 | /* Declare IRAM variables */ |
diff --git a/apps/plugins/BUILD_OVERLAY b/apps/plugins/BUILD_OVERLAY index 0afcbfbbf9..dd129333c2 100644 --- a/apps/plugins/BUILD_OVERLAY +++ b/apps/plugins/BUILD_OVERLAY | |||
@@ -4,6 +4,6 @@ | |||
4 | * they will grep for "YES" to see if overlay plugins must be built | 4 | * they will grep for "YES" to see if overlay plugins must be built |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #if PLUGIN_BUFFER_SIZE <= 0x20000 && !defined(SIMULATOR) | 7 | #if PLUGIN_BUFFER_SIZE <= 0x20000 && (CONFIG_PLATFORM & PLATFORM_NATIVE) |
8 | YES | 8 | YES |
9 | #endif | 9 | #endif |
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index 9e4b66ec14..a63bb922b6 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES | |||
@@ -65,7 +65,7 @@ iriverify.c | |||
65 | 65 | ||
66 | 66 | ||
67 | 67 | ||
68 | #ifndef SIMULATOR /* those plugins only run on hardware */ | 68 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) /* those plugins only run on hardware */ |
69 | 69 | ||
70 | /* Overlays loaders */ | 70 | /* Overlays loaders */ |
71 | #if PLUGIN_BUFFER_SIZE <= 0x20000 && defined(HAVE_LCD_BITMAP) | 71 | #if PLUGIN_BUFFER_SIZE <= 0x20000 && defined(HAVE_LCD_BITMAP) |
@@ -132,7 +132,7 @@ wavplay.c | |||
132 | wavrecord.c | 132 | wavrecord.c |
133 | #endif | 133 | #endif |
134 | 134 | ||
135 | #endif /* SIMULATOR */ | 135 | #endif /* PLATFORM_NATIVE */ |
136 | 136 | ||
137 | 137 | ||
138 | 138 | ||
diff --git a/apps/plugins/beatbox/beatbox.c b/apps/plugins/beatbox/beatbox.c index 1a940e1047..a51f738cd2 100644 --- a/apps/plugins/beatbox/beatbox.c +++ b/apps/plugins/beatbox/beatbox.c | |||
@@ -125,7 +125,7 @@ PLUGIN_IRAM_DECLARE | |||
125 | 125 | ||
126 | #undef SYNC | 126 | #undef SYNC |
127 | 127 | ||
128 | #ifdef SIMULATOR | 128 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
129 | #define SYNC | 129 | #define SYNC |
130 | #endif | 130 | #endif |
131 | 131 | ||
diff --git a/apps/plugins/bitmaps/mono/SOURCES b/apps/plugins/bitmaps/mono/SOURCES index 0152e92e0d..813ede362c 100644 --- a/apps/plugins/bitmaps/mono/SOURCES +++ b/apps/plugins/bitmaps/mono/SOURCES | |||
@@ -61,6 +61,6 @@ superdom_boarditems.160x128x1.bmp | |||
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | #endif /* HAVE_LCD_BITMAP */ | 63 | #endif /* HAVE_LCD_BITMAP */ |
64 | #if defined(SIMULATOR) && defined(__APPLE__) | 64 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__) |
65 | osx.dummy.bmp | 65 | osx.dummy.bmp |
66 | #endif | 66 | #endif |
diff --git a/apps/plugins/bitmaps/remote_mono/SOURCES b/apps/plugins/bitmaps/remote_mono/SOURCES index c59aab6107..b6be5138c9 100644 --- a/apps/plugins/bitmaps/remote_mono/SOURCES +++ b/apps/plugins/bitmaps/remote_mono/SOURCES | |||
@@ -1,3 +1,3 @@ | |||
1 | #if defined(SIMULATOR) && defined(__APPLE__) | 1 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__) |
2 | osx.dummy.bmp | 2 | osx.dummy.bmp |
3 | #endif | 3 | #endif |
diff --git a/apps/plugins/bitmaps/remote_native/SOURCES b/apps/plugins/bitmaps/remote_native/SOURCES index 2bc3d59c07..b3cc2157ff 100644 --- a/apps/plugins/bitmaps/remote_native/SOURCES +++ b/apps/plugins/bitmaps/remote_native/SOURCES | |||
@@ -1,4 +1,4 @@ | |||
1 | #if defined(SIMULATOR) && defined(__APPLE__) | 1 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__) |
2 | osx.dummy.bmp | 2 | osx.dummy.bmp |
3 | #endif | 3 | #endif |
4 | 4 | ||
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c index be66d6351f..a1372cd608 100644 --- a/apps/plugins/chip8.c +++ b/apps/plugins/chip8.c | |||
@@ -1185,7 +1185,7 @@ static byte chip8_keymap[16]; | |||
1185 | static unsigned long starttimer; /* Timer value at the beginning */ | 1185 | static unsigned long starttimer; /* Timer value at the beginning */ |
1186 | static unsigned long cycles; /* Number of update cycles (50Hz) */ | 1186 | static unsigned long cycles; /* Number of update cycles (50Hz) */ |
1187 | 1187 | ||
1188 | #ifndef SIMULATOR | 1188 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
1189 | static bool is_playing; | 1189 | static bool is_playing; |
1190 | 1190 | ||
1191 | /* one frame of bitswapped mp3 data */ | 1191 | /* one frame of bitswapped mp3 data */ |
@@ -1208,14 +1208,14 @@ static void callback(unsigned char** start, size_t* size) | |||
1208 | *start = beep; /* give it the same frame again */ | 1208 | *start = beep; /* give it the same frame again */ |
1209 | *size = sizeof(beep); | 1209 | *size = sizeof(beep); |
1210 | } | 1210 | } |
1211 | #endif /* !SIMULATOR */ | 1211 | #endif /* PLATFORM_NATIVE */ |
1212 | 1212 | ||
1213 | /****************************************************************************/ | 1213 | /****************************************************************************/ |
1214 | /* Turn sound on */ | 1214 | /* Turn sound on */ |
1215 | /****************************************************************************/ | 1215 | /****************************************************************************/ |
1216 | static void chip8_sound_on (void) | 1216 | static void chip8_sound_on (void) |
1217 | { | 1217 | { |
1218 | #ifndef SIMULATOR | 1218 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
1219 | if (!is_playing) | 1219 | if (!is_playing) |
1220 | rb->mp3_play_pause(true); /* kickoff audio */ | 1220 | rb->mp3_play_pause(true); /* kickoff audio */ |
1221 | #endif | 1221 | #endif |
@@ -1226,7 +1226,7 @@ static void chip8_sound_on (void) | |||
1226 | /****************************************************************************/ | 1226 | /****************************************************************************/ |
1227 | static void chip8_sound_off (void) | 1227 | static void chip8_sound_off (void) |
1228 | { | 1228 | { |
1229 | #ifndef SIMULATOR | 1229 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
1230 | if (!is_playing) | 1230 | if (!is_playing) |
1231 | rb->mp3_play_pause(false); /* pause audio */ | 1231 | rb->mp3_play_pause(false); /* pause audio */ |
1232 | #endif | 1232 | #endif |
@@ -1266,7 +1266,7 @@ static void chip8_update_display(void) | |||
1266 | *row++ = w; | 1266 | *row++ = w; |
1267 | } | 1267 | } |
1268 | } | 1268 | } |
1269 | #if defined(SIMULATOR) || (LCD_DEPTH > 1) | 1269 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) || (LCD_DEPTH > 1) |
1270 | rb->lcd_set_drawmode(DRMODE_SOLID); | 1270 | rb->lcd_set_drawmode(DRMODE_SOLID); |
1271 | rb->lcd_mono_bitmap(lcd_framebuf[0], CHIP8_X, CHIP8_Y, CHIP8_LCDWIDTH, | 1271 | rb->lcd_mono_bitmap(lcd_framebuf[0], CHIP8_X, CHIP8_Y, CHIP8_LCDWIDTH, |
1272 | CHIP8_HEIGHT); | 1272 | CHIP8_HEIGHT); |
@@ -1428,7 +1428,7 @@ static bool chip8_run(const char* file) | |||
1428 | #endif | 1428 | #endif |
1429 | rb->lcd_update(); | 1429 | rb->lcd_update(); |
1430 | 1430 | ||
1431 | #ifndef SIMULATOR | 1431 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
1432 | /* init sound */ | 1432 | /* init sound */ |
1433 | is_playing = rb->mp3_is_playing(); /* would we disturb playback? */ | 1433 | is_playing = rb->mp3_is_playing(); /* would we disturb playback? */ |
1434 | if (!is_playing) /* no? then we can make sound */ | 1434 | if (!is_playing) /* no? then we can make sound */ |
@@ -1442,7 +1442,7 @@ static bool chip8_run(const char* file) | |||
1442 | cycles = 0; | 1442 | cycles = 0; |
1443 | chip8(); | 1443 | chip8(); |
1444 | 1444 | ||
1445 | #ifndef SIMULATOR | 1445 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
1446 | if (!is_playing) | 1446 | if (!is_playing) |
1447 | { /* stop it if we used audio */ | 1447 | { /* stop it if we used audio */ |
1448 | rb->mp3_play_stop(); /* Stop audio playback */ | 1448 | rb->mp3_play_stop(); /* Stop audio playback */ |
diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c index 26afdd93db..042212812a 100644 --- a/apps/plugins/doom/rockdoom.c +++ b/apps/plugins/doom/rockdoom.c | |||
@@ -62,7 +62,7 @@ int fileexists(const char * fname) | |||
62 | return -1; | 62 | return -1; |
63 | } | 63 | } |
64 | 64 | ||
65 | #ifndef SIMULATOR | 65 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
66 | int my_open(const char *file, int flags, ...) | 66 | int my_open(const char *file, int flags, ...) |
67 | { | 67 | { |
68 | if(fpoint==8) | 68 | if(fpoint==8) |
@@ -111,7 +111,7 @@ int my_close(int id) | |||
111 | 111 | ||
112 | bool noprintf=0; // Variable disables printf lcd updates to protect grayscale lib/direct lcd updates | 112 | bool noprintf=0; // Variable disables printf lcd updates to protect grayscale lib/direct lcd updates |
113 | 113 | ||
114 | #ifndef SIMULATOR | 114 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
115 | // Here is a hacked up printf command to get the output from the game. | 115 | // Here is a hacked up printf command to get the output from the game. |
116 | int printf(const char *fmt, ...) | 116 | int printf(const char *fmt, ...) |
117 | { | 117 | { |
@@ -751,7 +751,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
751 | printf("There were still: %d files open\n", fpoint); | 751 | printf("There were still: %d files open\n", fpoint); |
752 | while(fpoint>0) | 752 | while(fpoint>0) |
753 | { | 753 | { |
754 | #ifdef SIMULATOR | 754 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
755 | close(filearray[fpoint]); | 755 | close(filearray[fpoint]); |
756 | #else | 756 | #else |
757 | rb->close(filearray[fpoint]); | 757 | rb->close(filearray[fpoint]); |
diff --git a/apps/plugins/doom/rockmacros.h b/apps/plugins/doom/rockmacros.h index 89c943622a..3276aa1539 100644 --- a/apps/plugins/doom/rockmacros.h +++ b/apps/plugins/doom/rockmacros.h | |||
@@ -42,7 +42,7 @@ char *my_strtok( char * s, const char * delim ); | |||
42 | #undef read_line | 42 | #undef read_line |
43 | #define read_line(a,b,c) rb->read_line((a),(b),(c)) | 43 | #define read_line(a,b,c) rb->read_line((a),(b),(c)) |
44 | 44 | ||
45 | #ifdef SIMULATOR | 45 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
46 | #define open(a, ...) rb->open((a), __VA_ARGS__) | 46 | #define open(a, ...) rb->open((a), __VA_ARGS__) |
47 | #define close(a) rb->close((a)) | 47 | #define close(a) rb->close((a)) |
48 | #else | 48 | #else |
diff --git a/apps/plugins/goban.c b/apps/plugins/goban.c index 8c8aa7a449..7bb6744dde 100644 --- a/apps/plugins/goban.c +++ b/apps/plugins/goban.c | |||
@@ -20,7 +20,7 @@ | |||
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | #include "plugin.h" | 21 | #include "plugin.h" |
22 | 22 | ||
23 | #if PLUGIN_BUFFER_SIZE < 0x10000 && !defined(SIMULATOR) | 23 | #if PLUGIN_BUFFER_SIZE < 0x10000 && (CONFIG_PLATFORM & PLATFORM_NATIVE) |
24 | 24 | ||
25 | #include "lib/overlay.h" | 25 | #include "lib/overlay.h" |
26 | 26 | ||
diff --git a/apps/plugins/imageviewer/imageviewer.h b/apps/plugins/imageviewer/imageviewer.h index 5f22b03e97..79ac5ed9f1 100644 --- a/apps/plugins/imageviewer/imageviewer.h +++ b/apps/plugins/imageviewer/imageviewer.h | |||
@@ -386,7 +386,7 @@ | |||
386 | #define PLUGIN_ABORT 11 | 386 | #define PLUGIN_ABORT 11 |
387 | #define PLUGIN_OUTOFMEM 12 | 387 | #define PLUGIN_OUTOFMEM 12 |
388 | 388 | ||
389 | #if !defined(SIMULATOR) && defined(HAVE_DISK_STORAGE) | 389 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) && defined(HAVE_DISK_STORAGE) |
390 | #define DISK_SPINDOWN | 390 | #define DISK_SPINDOWN |
391 | #endif | 391 | #endif |
392 | #if PLUGIN_BUFFER_SIZE >= MIN_MEM | 392 | #if PLUGIN_BUFFER_SIZE >= MIN_MEM |
diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES index 2c4209b6d2..fa12f94730 100644 --- a/apps/plugins/lib/SOURCES +++ b/apps/plugins/lib/SOURCES | |||
@@ -28,7 +28,7 @@ grey_sh.S | |||
28 | 28 | ||
29 | #endif /* HAVE_LCD_BITMAP && LCD_DEPTH < 4 */ | 29 | #endif /* HAVE_LCD_BITMAP && LCD_DEPTH < 4 */ |
30 | 30 | ||
31 | #ifndef SIMULATOR | 31 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
32 | overlay.c | 32 | overlay.c |
33 | #endif | 33 | #endif |
34 | 34 | ||
@@ -76,7 +76,7 @@ pluginlib_albumart.c | |||
76 | pluginlib_touchscreen.c | 76 | pluginlib_touchscreen.c |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #ifndef SIMULATOR | 79 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
80 | 80 | ||
81 | #ifdef CPU_ARM | 81 | #ifdef CPU_ARM |
82 | ../../codecs/lib/setjmp_arm.S | 82 | ../../codecs/lib/setjmp_arm.S |
@@ -90,4 +90,4 @@ pluginlib_touchscreen.c | |||
90 | ../../codecs/lib/setjmp_mips.S | 90 | ../../codecs/lib/setjmp_mips.S |
91 | #endif | 91 | #endif |
92 | 92 | ||
93 | #endif /* !SIMULATOR */ | 93 | #endif /* PLATFORM_NATIVE */ |
diff --git a/apps/plugins/lib/pluginlib_exit.h b/apps/plugins/lib/pluginlib_exit.h index 6cded9d56f..00cbc8dc7f 100644 --- a/apps/plugins/lib/pluginlib_exit.h +++ b/apps/plugins/lib/pluginlib_exit.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #define __PLUGINLIB_EXIT_H__ | 23 | #define __PLUGINLIB_EXIT_H__ |
24 | 24 | ||
25 | #include "config.h" | 25 | #include "config.h" |
26 | #ifndef SIMULATOR | 26 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
27 | #include "../../codecs/lib/setjmp.h" | 27 | #include "../../codecs/lib/setjmp.h" |
28 | #else | 28 | #else |
29 | #include <setjmp.h> | 29 | #include <setjmp.h> |
diff --git a/apps/plugins/lua/rockaux.c b/apps/plugins/lua/rockaux.c index 1f832d4cc7..f10a1cb021 100644 --- a/apps/plugins/lua/rockaux.c +++ b/apps/plugins/lua/rockaux.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #define _ROCKCONF_H_ /* Protect against unwanted include */ | 24 | #define _ROCKCONF_H_ /* Protect against unwanted include */ |
25 | #include "lua.h" | 25 | #include "lua.h" |
26 | 26 | ||
27 | #if !defined(SIMULATOR) | 27 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
28 | int errno = 0; | 28 | int errno = 0; |
29 | #endif | 29 | #endif |
30 | 30 | ||
diff --git a/apps/plugins/lua/rockconf.h b/apps/plugins/lua/rockconf.h index 7fbc89f166..dd7f98f1d7 100644 --- a/apps/plugins/lua/rockconf.h +++ b/apps/plugins/lua/rockconf.h | |||
@@ -31,7 +31,7 @@ | |||
31 | #undef LUA_PATH_DEFAULT | 31 | #undef LUA_PATH_DEFAULT |
32 | #define LUA_PATH_DEFAULT "$/?.lua;" "$/?/init.lua;" VIEWERS_DIR"/lua/?.lua;" VIEWERS_DIR"/lua/?/init.lua;" | 32 | #define LUA_PATH_DEFAULT "$/?.lua;" "$/?/init.lua;" VIEWERS_DIR"/lua/?.lua;" VIEWERS_DIR"/lua/?/init.lua;" |
33 | 33 | ||
34 | #ifndef SIMULATOR | 34 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
35 | #include "../../codecs/lib/setjmp.h" | 35 | #include "../../codecs/lib/setjmp.h" |
36 | #else | 36 | #else |
37 | #include <setjmp.h> | 37 | #include <setjmp.h> |
diff --git a/apps/plugins/lua/rocklibc.h b/apps/plugins/lua/rocklibc.h index 9b68f429d2..44f916fded 100644 --- a/apps/plugins/lua/rocklibc.h +++ b/apps/plugins/lua/rocklibc.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <ctype.h> | 26 | #include <ctype.h> |
27 | #include "plugin.h" | 27 | #include "plugin.h" |
28 | 28 | ||
29 | #ifdef SIMULATOR | 29 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
30 | #include <errno.h> | 30 | #include <errno.h> |
31 | #define PREFIX(_x_) sim_ ## _x_ | 31 | #define PREFIX(_x_) sim_ ## _x_ |
32 | #else | 32 | #else |
diff --git a/apps/plugins/midi/midiutil.h b/apps/plugins/midi/midiutil.h index b1ed6569b7..d7a252035d 100644 --- a/apps/plugins/midi/midiutil.h +++ b/apps/plugins/midi/midiutil.h | |||
@@ -39,6 +39,8 @@ | |||
39 | improved to increase MAX_VOICES for targets that can do 22kHz */ | 39 | improved to increase MAX_VOICES for targets that can do 22kHz */ |
40 | #ifdef CPU_PP | 40 | #ifdef CPU_PP |
41 | #define MAX_VOICES 16 | 41 | #define MAX_VOICES 16 |
42 | #elif (CONFIG_PLATFORM & PLATFORM_HOSTED) | ||
43 | #define MAX_VOICES 48 | ||
42 | #else | 44 | #else |
43 | #define MAX_VOICES 24 /* Note: 24 midi channels is the minimum general midi spec implementation */ | 45 | #define MAX_VOICES 24 /* Note: 24 midi channels is the minimum general midi spec implementation */ |
44 | #endif /* CPU_PP */ | 46 | #endif /* CPU_PP */ |
diff --git a/apps/plugins/pacbox/pacbox_lcd.c b/apps/plugins/pacbox/pacbox_lcd.c index 64b12f08eb..c4df2fa6cd 100644 --- a/apps/plugins/pacbox/pacbox_lcd.c +++ b/apps/plugins/pacbox/pacbox_lcd.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "arcade.h" | 28 | #include "arcade.h" |
29 | #include "hardware.h" | 29 | #include "hardware.h" |
30 | 30 | ||
31 | #if defined(SIMULATOR) || !defined(IRIVER_H300_SERIES) | 31 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) || !defined(IRIVER_H300_SERIES) |
32 | 32 | ||
33 | void blit_display(fb_data* lcd_framebuffer, unsigned char* vbuf) | 33 | void blit_display(fb_data* lcd_framebuffer, unsigned char* vbuf) |
34 | { | 34 | { |
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index b95cd6d0ff..797971c734 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c | |||
@@ -403,7 +403,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
403 | = rb->plugin_get_audio_buffer(&audio_buffer_free); | 403 | = rb->plugin_get_audio_buffer(&audio_buffer_free); |
404 | plugbuf=false; | 404 | plugbuf=false; |
405 | } | 405 | } |
406 | #if MEM <= 8 && !defined(SIMULATOR) | 406 | #if MEM <= 8 && (CONFIG_PLATFORM & PLATFORM_NATIVE) |
407 | /* loaded as an overlay plugin, protect from overwriting ourselves */ | 407 | /* loaded as an overlay plugin, protect from overwriting ourselves */ |
408 | if ((unsigned)(plugin_start_addr - (unsigned char *)audio_bufferbase) | 408 | if ((unsigned)(plugin_start_addr - (unsigned char *)audio_bufferbase) |
409 | < audio_buffer_free) | 409 | < audio_buffer_free) |
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index 9598881790..77ad9c9530 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c | |||
@@ -697,7 +697,7 @@ static enum plugin_status test_track(const char* filename) | |||
697 | rb->snprintf(str,sizeof(str),"%d.%02d%% realtime",(int)speed/100,(int)speed%100); | 697 | rb->snprintf(str,sizeof(str),"%d.%02d%% realtime",(int)speed/100,(int)speed%100); |
698 | log_text(str,true); | 698 | log_text(str,true); |
699 | 699 | ||
700 | #ifndef SIMULATOR | 700 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
701 | /* show effective clockrate in MHz needed for realtime decoding */ | 701 | /* show effective clockrate in MHz needed for realtime decoding */ |
702 | if (speed > 0) | 702 | if (speed > 0) |
703 | { | 703 | { |
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c index 443e9eb18b..08e1a39704 100644 --- a/apps/plugins/test_disk.c +++ b/apps/plugins/test_disk.c | |||
@@ -114,7 +114,7 @@ static bool test_fs(void) | |||
114 | 114 | ||
115 | log_init(); | 115 | log_init(); |
116 | log_text("test_disk WRITE&VERIFY", true); | 116 | log_text("test_disk WRITE&VERIFY", true); |
117 | #ifndef SIMULATOR | 117 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
118 | rb->snprintf(text_buf, sizeof(text_buf), "CPU clock: %ld Hz", | 118 | rb->snprintf(text_buf, sizeof(text_buf), "CPU clock: %ld Hz", |
119 | *rb->cpu_frequency); | 119 | *rb->cpu_frequency); |
120 | log_text(text_buf, true); | 120 | log_text(text_buf, true); |
@@ -304,7 +304,7 @@ static bool test_speed(void) | |||
304 | rb->memset(audiobuf, 'T', audiobuflen); | 304 | rb->memset(audiobuf, 'T', audiobuflen); |
305 | log_init(); | 305 | log_init(); |
306 | log_text("test_disk SPEED TEST", true); | 306 | log_text("test_disk SPEED TEST", true); |
307 | #ifndef SIMULATOR | 307 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
308 | rb->snprintf(text_buf, sizeof(text_buf), "CPU clock: %ld Hz", | 308 | rb->snprintf(text_buf, sizeof(text_buf), "CPU clock: %ld Hz", |
309 | *rb->cpu_frequency); | 309 | *rb->cpu_frequency); |
310 | log_text(text_buf, true); | 310 | log_text(text_buf, true); |
diff --git a/apps/plugins/test_fps.c b/apps/plugins/test_fps.c index 52a56d5954..62e7f489b0 100644 --- a/apps/plugins/test_fps.c +++ b/apps/plugins/test_fps.c | |||
@@ -340,7 +340,7 @@ static void time_greyscale(void) | |||
340 | /* plugin entry point */ | 340 | /* plugin entry point */ |
341 | enum plugin_status plugin_start(const void* parameter) | 341 | enum plugin_status plugin_start(const void* parameter) |
342 | { | 342 | { |
343 | #ifndef SIMULATOR | 343 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
344 | char str[32]; | 344 | char str[32]; |
345 | int cpu_freq; | 345 | int cpu_freq; |
346 | #endif | 346 | #endif |
@@ -350,7 +350,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
350 | (void)parameter; | 350 | (void)parameter; |
351 | 351 | ||
352 | log_init(); | 352 | log_init(); |
353 | #ifndef SIMULATOR | 353 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
354 | cpu_freq = *rb->cpu_frequency; /* remember CPU frequency */ | 354 | cpu_freq = *rb->cpu_frequency; /* remember CPU frequency */ |
355 | #endif | 355 | #endif |
356 | backlight_force_on(); /* backlight control in lib/helper.c */ | 356 | backlight_force_on(); /* backlight control in lib/helper.c */ |
@@ -370,7 +370,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
370 | time_remote_update(); | 370 | time_remote_update(); |
371 | #endif | 371 | #endif |
372 | 372 | ||
373 | #ifndef SIMULATOR | 373 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
374 | if (*rb->cpu_frequency != cpu_freq) | 374 | if (*rb->cpu_frequency != cpu_freq) |
375 | rb->snprintf(str, sizeof(str), "CPU clock changed!"); | 375 | rb->snprintf(str, sizeof(str), "CPU clock changed!"); |
376 | else | 376 | else |
diff --git a/apps/plugins/test_mem.c b/apps/plugins/test_mem.c index 2a8582bc45..f648c0073a 100644 --- a/apps/plugins/test_mem.c +++ b/apps/plugins/test_mem.c | |||
@@ -194,7 +194,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
194 | 194 | ||
195 | rb->screens[0]->clear_display(); | 195 | rb->screens[0]->clear_display(); |
196 | rb->screens[0]->putsf(0, line++, "%s", boost?"boosted":"unboosted"); | 196 | rb->screens[0]->putsf(0, line++, "%s", boost?"boosted":"unboosted"); |
197 | #ifndef SIMULATOR | 197 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
198 | rb->screens[0]->putsf(0, line++, "clock: %d Hz", *rb->cpu_frequency); | 198 | rb->screens[0]->putsf(0, line++, "clock: %d Hz", *rb->cpu_frequency); |
199 | #endif | 199 | #endif |
200 | rb->screens[0]->putsf(0, line++, "loop#: %d", ++count); | 200 | rb->screens[0]->putsf(0, line++, "loop#: %d", ++count); |
diff --git a/apps/radio/radio.c b/apps/radio/radio.c index 3dfa9a10f0..3728afc39c 100644 --- a/apps/radio/radio.c +++ b/apps/radio/radio.c | |||
@@ -420,10 +420,10 @@ int radio_screen(void) | |||
420 | bool have_recorded = false; | 420 | bool have_recorded = false; |
421 | int timeout = current_tick + HZ/10; | 421 | int timeout = current_tick + HZ/10; |
422 | unsigned int last_seconds = 0; | 422 | unsigned int last_seconds = 0; |
423 | #ifndef SIMULATOR | 423 | #if !defined(SIMULATOR) |
424 | unsigned int seconds = 0; | 424 | unsigned int seconds = 0; |
425 | struct audio_recording_options rec_options; | 425 | struct audio_recording_options rec_options; |
426 | #endif | 426 | #endif /* SIMULATOR */ |
427 | #endif /* CONFIG_CODEC != SWCODEC */ | 427 | #endif /* CONFIG_CODEC != SWCODEC */ |
428 | #ifndef HAVE_NOISY_IDLE_MODE | 428 | #ifndef HAVE_NOISY_IDLE_MODE |
429 | int button_timeout = current_tick + (2*HZ); | 429 | int button_timeout = current_tick + (2*HZ); |
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index 164b14b15c..9e93638717 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c | |||
@@ -18,7 +18,7 @@ | |||
18 | * KIND, either express or implied. | 18 | * KIND, either express or implied. |
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | #ifdef SIMULATOR | 21 | #if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) |
22 | #include <stdlib.h> /* sim uses rand for peakmeter simulation */ | 22 | #include <stdlib.h> /* sim uses rand for peakmeter simulation */ |
23 | #endif | 23 | #endif |
24 | #include "config.h" | 24 | #include "config.h" |
@@ -538,7 +538,7 @@ void pm_reset_clipcount(void) | |||
538 | void peak_meter_playback(bool playback) | 538 | void peak_meter_playback(bool playback) |
539 | { | 539 | { |
540 | int i; | 540 | int i; |
541 | #ifdef SIMULATOR | 541 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
542 | (void)playback; | 542 | (void)playback; |
543 | #elif CONFIG_CODEC == SWCODEC | 543 | #elif CONFIG_CODEC == SWCODEC |
544 | pm_playback = playback; | 544 | pm_playback = playback; |
@@ -595,7 +595,7 @@ void peak_meter_peek(void) | |||
595 | left = pm_cur_left; | 595 | left = pm_cur_left; |
596 | right = pm_cur_right; | 596 | right = pm_cur_right; |
597 | #else | 597 | #else |
598 | #ifndef SIMULATOR | 598 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
599 | pm_cur_left = left = mas_codec_readreg(pm_src_left); | 599 | pm_cur_left = left = mas_codec_readreg(pm_src_left); |
600 | pm_cur_right = right = mas_codec_readreg(pm_src_right); | 600 | pm_cur_right = right = mas_codec_readreg(pm_src_right); |
601 | #else | 601 | #else |
diff --git a/apps/scrobbler.c b/apps/scrobbler.c index 401f5b93b6..8d9f694ec2 100644 --- a/apps/scrobbler.c +++ b/apps/scrobbler.c | |||
@@ -24,6 +24,7 @@ http://www.audioscrobbler.net/wiki/Portable_Player_Logging | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <config.h> | ||
27 | #include "file.h" | 28 | #include "file.h" |
28 | #include "logf.h" | 29 | #include "logf.h" |
29 | #include "metadata.h" | 30 | #include "metadata.h" |
@@ -70,7 +71,7 @@ static unsigned long timestamp; | |||
70 | #endif | 71 | #endif |
71 | 72 | ||
72 | /* Crude work-around for Archos Sims - return a set amount */ | 73 | /* Crude work-around for Archos Sims - return a set amount */ |
73 | #if (CONFIG_CODEC != SWCODEC) && defined(SIMULATOR) | 74 | #if (CONFIG_CODEC != SWCODEC) && (CONFIG_PLATFORM & PLATFORM_HOSTED) |
74 | unsigned long audio_prev_elapsed(void) | 75 | unsigned long audio_prev_elapsed(void) |
75 | { | 76 | { |
76 | return 120000; | 77 | return 120000; |
diff --git a/apps/settings.c b/apps/settings.c index 12987c4746..2f6ce4cb92 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -837,7 +837,7 @@ void settings_apply(bool read_disk) | |||
837 | #ifdef HAVE_DISK_STORAGE | 837 | #ifdef HAVE_DISK_STORAGE |
838 | storage_spindown(global_settings.disk_spindown); | 838 | storage_spindown(global_settings.disk_spindown); |
839 | #endif | 839 | #endif |
840 | #if (CONFIG_CODEC == MAS3507D) && !defined(SIMULATOR) | 840 | #if (CONFIG_CODEC == MAS3507D) && (CONFIG_PLATFORM & PLATFORM_NATIVE) |
841 | dac_line_in(global_settings.line_in); | 841 | dac_line_in(global_settings.line_in); |
842 | #endif | 842 | #endif |
843 | set_poweroff_timeout(global_settings.poweroff); | 843 | set_poweroff_timeout(global_settings.poweroff); |
diff --git a/apps/status.h b/apps/status.h index 36b723ecb8..c8ec7bb354 100644 --- a/apps/status.h +++ b/apps/status.h | |||
@@ -45,7 +45,7 @@ void status_set_ffmode(enum playmode mode); | |||
45 | enum playmode status_get_ffmode(void); | 45 | enum playmode status_get_ffmode(void); |
46 | int current_playmode(void); | 46 | int current_playmode(void); |
47 | 47 | ||
48 | #ifdef SIMULATOR | 48 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
49 | #include <time.h> | 49 | #include <time.h> |
50 | #endif | 50 | #endif |
51 | #ifdef HAVE_LCD_CHARCELLS | 51 | #ifdef HAVE_LCD_CHARCELLS |
diff --git a/apps/tagcache.c b/apps/tagcache.c index f4d3753768..822a84870c 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c | |||
@@ -4442,7 +4442,7 @@ static void tagcache_thread(void) | |||
4442 | case SYS_POWEROFF: | 4442 | case SYS_POWEROFF: |
4443 | break ; | 4443 | break ; |
4444 | 4444 | ||
4445 | #ifndef SIMULATOR | 4445 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
4446 | case SYS_USB_CONNECTED: | 4446 | case SYS_USB_CONNECTED: |
4447 | logf("USB: TagCache"); | 4447 | logf("USB: TagCache"); |
4448 | usb_acknowledge(SYS_USB_CONNECTED_ACK); | 4448 | usb_acknowledge(SYS_USB_CONNECTED_ACK); |