summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-06-21 16:53:00 +0000
committerThomas Martitz <kugel@rockbox.org>2010-06-21 16:53:00 +0000
commit35e8b1429a2cdcf6580f6d25890fed9865165d0b (patch)
tree084be19a29bffa879eee8e3cad92d8f3b342a337 /apps/plugins
parent02e04585bdf1fbd00cf84d2000f59ec198440cb3 (diff)
downloadrockbox-35e8b1429a2cdcf6580f6d25890fed9865165d0b.zip
rockbox-35e8b1429a2cdcf6580f6d25890fed9865165d0b.tar.gz
rockbox-35e8b1429a2cdcf6580f6d25890fed9865165d0b.tar.bz2
rockbox-35e8b1429a2cdcf6580f6d25890fed9865165d0b.tar.xz
Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently).
The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR). The new define is to (de-)select code to compile on hosted platforms generally. Should be no functional change to targets or the simulator. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/BUILD_OVERLAY2
-rw-r--r--apps/plugins/SOURCES4
-rw-r--r--apps/plugins/beatbox/beatbox.c2
-rw-r--r--apps/plugins/bitmaps/mono/SOURCES2
-rw-r--r--apps/plugins/bitmaps/remote_mono/SOURCES2
-rw-r--r--apps/plugins/bitmaps/remote_native/SOURCES2
-rw-r--r--apps/plugins/chip8.c14
-rw-r--r--apps/plugins/doom/rockdoom.c6
-rw-r--r--apps/plugins/doom/rockmacros.h2
-rw-r--r--apps/plugins/goban.c2
-rw-r--r--apps/plugins/imageviewer/imageviewer.h2
-rw-r--r--apps/plugins/lib/SOURCES6
-rw-r--r--apps/plugins/lib/pluginlib_exit.h2
-rw-r--r--apps/plugins/lua/rockaux.c2
-rw-r--r--apps/plugins/lua/rockconf.h2
-rw-r--r--apps/plugins/lua/rocklibc.h2
-rw-r--r--apps/plugins/midi/midiutil.h2
-rw-r--r--apps/plugins/pacbox/pacbox_lcd.c2
-rw-r--r--apps/plugins/rockboy/rockboy.c2
-rw-r--r--apps/plugins/test_codec.c2
-rw-r--r--apps/plugins/test_disk.c4
-rw-r--r--apps/plugins/test_fps.c6
-rw-r--r--apps/plugins/test_mem.c2
23 files changed, 38 insertions, 36 deletions
diff --git a/apps/plugins/BUILD_OVERLAY b/apps/plugins/BUILD_OVERLAY
index 0afcbfb..dd12933 100644
--- a/apps/plugins/BUILD_OVERLAY
+++ b/apps/plugins/BUILD_OVERLAY
@@ -4,6 +4,6 @@
* they will grep for "YES" to see if overlay plugins must be built
*/
-#if PLUGIN_BUFFER_SIZE <= 0x20000 && !defined(SIMULATOR)
+#if PLUGIN_BUFFER_SIZE <= 0x20000 && (CONFIG_PLATFORM & PLATFORM_NATIVE)
YES
#endif
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 9e4b66e..a63bb92 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -65,7 +65,7 @@ iriverify.c
-#ifndef SIMULATOR /* those plugins only run on hardware */
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE) /* those plugins only run on hardware */
/* Overlays loaders */
#if PLUGIN_BUFFER_SIZE <= 0x20000 && defined(HAVE_LCD_BITMAP)
@@ -132,7 +132,7 @@ wavplay.c
wavrecord.c
#endif
-#endif /* SIMULATOR */
+#endif /* PLATFORM_NATIVE */
diff --git a/apps/plugins/beatbox/beatbox.c b/apps/plugins/beatbox/beatbox.c
index 1a940e1..a51f738 100644
--- a/apps/plugins/beatbox/beatbox.c
+++ b/apps/plugins/beatbox/beatbox.c
@@ -125,7 +125,7 @@ PLUGIN_IRAM_DECLARE
#undef SYNC
-#ifdef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
#define SYNC
#endif
diff --git a/apps/plugins/bitmaps/mono/SOURCES b/apps/plugins/bitmaps/mono/SOURCES
index 0152e92..813ede3 100644
--- a/apps/plugins/bitmaps/mono/SOURCES
+++ b/apps/plugins/bitmaps/mono/SOURCES
@@ -61,6 +61,6 @@ superdom_boarditems.160x128x1.bmp
#endif
#endif /* HAVE_LCD_BITMAP */
-#if defined(SIMULATOR) && defined(__APPLE__)
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
osx.dummy.bmp
#endif
diff --git a/apps/plugins/bitmaps/remote_mono/SOURCES b/apps/plugins/bitmaps/remote_mono/SOURCES
index c59aab6..b6be513 100644
--- a/apps/plugins/bitmaps/remote_mono/SOURCES
+++ b/apps/plugins/bitmaps/remote_mono/SOURCES
@@ -1,3 +1,3 @@
-#if defined(SIMULATOR) && defined(__APPLE__)
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
osx.dummy.bmp
#endif
diff --git a/apps/plugins/bitmaps/remote_native/SOURCES b/apps/plugins/bitmaps/remote_native/SOURCES
index 2bc3d59..b3cc215 100644
--- a/apps/plugins/bitmaps/remote_native/SOURCES
+++ b/apps/plugins/bitmaps/remote_native/SOURCES
@@ -1,4 +1,4 @@
-#if defined(SIMULATOR) && defined(__APPLE__)
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
osx.dummy.bmp
#endif
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c
index be66d63..a1372cd 100644
--- a/apps/plugins/chip8.c
+++ b/apps/plugins/chip8.c
@@ -1185,7 +1185,7 @@ static byte chip8_keymap[16];
static unsigned long starttimer; /* Timer value at the beginning */
static unsigned long cycles; /* Number of update cycles (50Hz) */
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
static bool is_playing;
/* one frame of bitswapped mp3 data */
@@ -1208,14 +1208,14 @@ static void callback(unsigned char** start, size_t* size)
*start = beep; /* give it the same frame again */
*size = sizeof(beep);
}
-#endif /* !SIMULATOR */
+#endif /* PLATFORM_NATIVE */
/****************************************************************************/
/* Turn sound on */
/****************************************************************************/
static void chip8_sound_on (void)
{
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
if (!is_playing)
rb->mp3_play_pause(true); /* kickoff audio */
#endif
@@ -1226,7 +1226,7 @@ static void chip8_sound_on (void)
/****************************************************************************/
static void chip8_sound_off (void)
{
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
if (!is_playing)
rb->mp3_play_pause(false); /* pause audio */
#endif
@@ -1266,7 +1266,7 @@ static void chip8_update_display(void)
*row++ = w;
}
}
-#if defined(SIMULATOR) || (LCD_DEPTH > 1)
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || (LCD_DEPTH > 1)
rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_mono_bitmap(lcd_framebuf[0], CHIP8_X, CHIP8_Y, CHIP8_LCDWIDTH,
CHIP8_HEIGHT);
@@ -1428,7 +1428,7 @@ static bool chip8_run(const char* file)
#endif
rb->lcd_update();
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
/* init sound */
is_playing = rb->mp3_is_playing(); /* would we disturb playback? */
if (!is_playing) /* no? then we can make sound */
@@ -1442,7 +1442,7 @@ static bool chip8_run(const char* file)
cycles = 0;
chip8();
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
if (!is_playing)
{ /* stop it if we used audio */
rb->mp3_play_stop(); /* Stop audio playback */
diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c
index 26afdd9..0422128 100644
--- a/apps/plugins/doom/rockdoom.c
+++ b/apps/plugins/doom/rockdoom.c
@@ -62,7 +62,7 @@ int fileexists(const char * fname)
return -1;
}
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
int my_open(const char *file, int flags, ...)
{
if(fpoint==8)
@@ -111,7 +111,7 @@ int my_close(int id)
bool noprintf=0; // Variable disables printf lcd updates to protect grayscale lib/direct lcd updates
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
// Here is a hacked up printf command to get the output from the game.
int printf(const char *fmt, ...)
{
@@ -751,7 +751,7 @@ enum plugin_status plugin_start(const void* parameter)
printf("There were still: %d files open\n", fpoint);
while(fpoint>0)
{
-#ifdef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
close(filearray[fpoint]);
#else
rb->close(filearray[fpoint]);
diff --git a/apps/plugins/doom/rockmacros.h b/apps/plugins/doom/rockmacros.h
index 89c9436..3276aa1 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 );
#undef read_line
#define read_line(a,b,c) rb->read_line((a),(b),(c))
-#ifdef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
#define open(a, ...) rb->open((a), __VA_ARGS__)
#define close(a) rb->close((a))
#else
diff --git a/apps/plugins/goban.c b/apps/plugins/goban.c
index 8c8aa7a..7bb6744 100644
--- a/apps/plugins/goban.c
+++ b/apps/plugins/goban.c
@@ -20,7 +20,7 @@
****************************************************************************/
#include "plugin.h"
-#if PLUGIN_BUFFER_SIZE < 0x10000 && !defined(SIMULATOR)
+#if PLUGIN_BUFFER_SIZE < 0x10000 && (CONFIG_PLATFORM & PLATFORM_NATIVE)
#include "lib/overlay.h"
diff --git a/apps/plugins/imageviewer/imageviewer.h b/apps/plugins/imageviewer/imageviewer.h
index 5f22b03..79ac5ed 100644
--- a/apps/plugins/imageviewer/imageviewer.h
+++ b/apps/plugins/imageviewer/imageviewer.h
@@ -386,7 +386,7 @@
#define PLUGIN_ABORT 11
#define PLUGIN_OUTOFMEM 12
-#if !defined(SIMULATOR) && defined(HAVE_DISK_STORAGE)
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && defined(HAVE_DISK_STORAGE)
#define DISK_SPINDOWN
#endif
#if PLUGIN_BUFFER_SIZE >= MIN_MEM
diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES
index 2c4209b..fa12f94 100644
--- a/apps/plugins/lib/SOURCES
+++ b/apps/plugins/lib/SOURCES
@@ -28,7 +28,7 @@ grey_sh.S
#endif /* HAVE_LCD_BITMAP && LCD_DEPTH < 4 */
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
overlay.c
#endif
@@ -76,7 +76,7 @@ pluginlib_albumart.c
pluginlib_touchscreen.c
#endif
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
#ifdef CPU_ARM
../../codecs/lib/setjmp_arm.S
@@ -90,4 +90,4 @@ pluginlib_touchscreen.c
../../codecs/lib/setjmp_mips.S
#endif
-#endif /* !SIMULATOR */
+#endif /* PLATFORM_NATIVE */
diff --git a/apps/plugins/lib/pluginlib_exit.h b/apps/plugins/lib/pluginlib_exit.h
index 6cded9d..00cbc8d 100644
--- a/apps/plugins/lib/pluginlib_exit.h
+++ b/apps/plugins/lib/pluginlib_exit.h
@@ -23,7 +23,7 @@
#define __PLUGINLIB_EXIT_H__
#include "config.h"
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
#include "../../codecs/lib/setjmp.h"
#else
#include <setjmp.h>
diff --git a/apps/plugins/lua/rockaux.c b/apps/plugins/lua/rockaux.c
index 1f832d4..f10a1cb 100644
--- a/apps/plugins/lua/rockaux.c
+++ b/apps/plugins/lua/rockaux.c
@@ -24,7 +24,7 @@
#define _ROCKCONF_H_ /* Protect against unwanted include */
#include "lua.h"
-#if !defined(SIMULATOR)
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
int errno = 0;
#endif
diff --git a/apps/plugins/lua/rockconf.h b/apps/plugins/lua/rockconf.h
index 7fbc89f..dd7f98f 100644
--- a/apps/plugins/lua/rockconf.h
+++ b/apps/plugins/lua/rockconf.h
@@ -31,7 +31,7 @@
#undef LUA_PATH_DEFAULT
#define LUA_PATH_DEFAULT "$/?.lua;" "$/?/init.lua;" VIEWERS_DIR"/lua/?.lua;" VIEWERS_DIR"/lua/?/init.lua;"
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
#include "../../codecs/lib/setjmp.h"
#else
#include <setjmp.h>
diff --git a/apps/plugins/lua/rocklibc.h b/apps/plugins/lua/rocklibc.h
index 9b68f42..44f916f 100644
--- a/apps/plugins/lua/rocklibc.h
+++ b/apps/plugins/lua/rocklibc.h
@@ -26,7 +26,7 @@
#include <ctype.h>
#include "plugin.h"
-#ifdef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
#include <errno.h>
#define PREFIX(_x_) sim_ ## _x_
#else
diff --git a/apps/plugins/midi/midiutil.h b/apps/plugins/midi/midiutil.h
index b1ed656..d7a2520 100644
--- a/apps/plugins/midi/midiutil.h
+++ b/apps/plugins/midi/midiutil.h
@@ -39,6 +39,8 @@
improved to increase MAX_VOICES for targets that can do 22kHz */
#ifdef CPU_PP
#define MAX_VOICES 16
+#elif (CONFIG_PLATFORM & PLATFORM_HOSTED)
+#define MAX_VOICES 48
#else
#define MAX_VOICES 24 /* Note: 24 midi channels is the minimum general midi spec implementation */
#endif /* CPU_PP */
diff --git a/apps/plugins/pacbox/pacbox_lcd.c b/apps/plugins/pacbox/pacbox_lcd.c
index 64b12f0..c4df2fa 100644
--- a/apps/plugins/pacbox/pacbox_lcd.c
+++ b/apps/plugins/pacbox/pacbox_lcd.c
@@ -28,7 +28,7 @@
#include "arcade.h"
#include "hardware.h"
-#if defined(SIMULATOR) || !defined(IRIVER_H300_SERIES)
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) || !defined(IRIVER_H300_SERIES)
void blit_display(fb_data* lcd_framebuffer, unsigned char* vbuf)
{
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c
index b95cd6d..797971c 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)
= rb->plugin_get_audio_buffer(&audio_buffer_free);
plugbuf=false;
}
-#if MEM <= 8 && !defined(SIMULATOR)
+#if MEM <= 8 && (CONFIG_PLATFORM & PLATFORM_NATIVE)
/* loaded as an overlay plugin, protect from overwriting ourselves */
if ((unsigned)(plugin_start_addr - (unsigned char *)audio_bufferbase)
< audio_buffer_free)
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c
index 9598881..77ad9c9 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)
rb->snprintf(str,sizeof(str),"%d.%02d%% realtime",(int)speed/100,(int)speed%100);
log_text(str,true);
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
/* show effective clockrate in MHz needed for realtime decoding */
if (speed > 0)
{
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c
index 443e9eb..08e1a39 100644
--- a/apps/plugins/test_disk.c
+++ b/apps/plugins/test_disk.c
@@ -114,7 +114,7 @@ static bool test_fs(void)
log_init();
log_text("test_disk WRITE&VERIFY", true);
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
rb->snprintf(text_buf, sizeof(text_buf), "CPU clock: %ld Hz",
*rb->cpu_frequency);
log_text(text_buf, true);
@@ -304,7 +304,7 @@ static bool test_speed(void)
rb->memset(audiobuf, 'T', audiobuflen);
log_init();
log_text("test_disk SPEED TEST", true);
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
rb->snprintf(text_buf, sizeof(text_buf), "CPU clock: %ld Hz",
*rb->cpu_frequency);
log_text(text_buf, true);
diff --git a/apps/plugins/test_fps.c b/apps/plugins/test_fps.c
index 52a56d5..62e7f48 100644
--- a/apps/plugins/test_fps.c
+++ b/apps/plugins/test_fps.c
@@ -340,7 +340,7 @@ static void time_greyscale(void)
/* plugin entry point */
enum plugin_status plugin_start(const void* parameter)
{
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
char str[32];
int cpu_freq;
#endif
@@ -350,7 +350,7 @@ enum plugin_status plugin_start(const void* parameter)
(void)parameter;
log_init();
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
cpu_freq = *rb->cpu_frequency; /* remember CPU frequency */
#endif
backlight_force_on(); /* backlight control in lib/helper.c */
@@ -370,7 +370,7 @@ enum plugin_status plugin_start(const void* parameter)
time_remote_update();
#endif
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
if (*rb->cpu_frequency != cpu_freq)
rb->snprintf(str, sizeof(str), "CPU clock changed!");
else
diff --git a/apps/plugins/test_mem.c b/apps/plugins/test_mem.c
index 2a8582b..f648c00 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)
rb->screens[0]->clear_display();
rb->screens[0]->putsf(0, line++, "%s", boost?"boosted":"unboosted");
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
rb->screens[0]->putsf(0, line++, "clock: %d Hz", *rb->cpu_frequency);
#endif
rb->screens[0]->putsf(0, line++, "loop#: %d", ++count);