summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2014-08-22 18:23:37 -0400
committerFrank Gevaerts <frank@gevaerts.be>2014-08-23 00:25:12 +0200
commite1c09cd5bdb450de5410d52e80f4c4225c5332f1 (patch)
tree8bec6ab4a2dadcd64aa82871e794428cd03e92ed
parent7e46440e4d949fae8049c07968d6766b3634e2c6 (diff)
downloadrockbox-e1c09cd.tar.gz
rockbox-e1c09cd.tar.bz2
rockbox-e1c09cd.zip
Hope this works...
Change-Id: I8a94f0be82f63ed1e81433beb41ff2d60a1e6eef Reviewed-on: http://gerrit.rockbox.org/926 Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
-rw-r--r--apps/plugins/chip8.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c
index aebae6580c..43dd7f933e 100644
--- a/apps/plugins/chip8.c
+++ b/apps/plugins/chip8.c
@@ -1299,7 +1299,7 @@ static byte chip8_keymap[16];
static unsigned long starttimer; /* Timer value at the beginning */
static unsigned long cycles; /* Number of update cycles (50Hz) */
-#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
+#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
static bool is_playing;
/* one frame of bitswapped mp3 data */
@@ -1315,14 +1315,12 @@ static unsigned char beep[]={255,
20,100, 18, 96, 41, 96, 78,102, 7,201,122, 76,119, 20,137, 37,177, 15,132,224,
20, 17,191, 67,147,187,116,211, 41,169, 63,172,182,186,217,155,111,140,104,254,
111,181,184,144, 17,148, 21,101,166,227,100, 86, 85, 85, 85};
-#if (CONFIG_CODEC != SWCODEC)
/* callback to request more mp3 data */
static void callback(const void** start, size_t* size)
{
*start = beep; /* give it the same frame again */
*size = sizeof(beep);
}
-#endif /* CONFIG_CODEC == HWCODEC */
#endif /* PLATFORM_NATIVE */
/****************************************************************************/
@@ -1330,7 +1328,7 @@ static void callback(const void** start, size_t* size)
/****************************************************************************/
static void chip8_sound_on (void)
{
-#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
+#if(CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
if (!is_playing)
rb->mp3_play_pause(true); /* kickoff audio */
#endif
@@ -1341,7 +1339,7 @@ static void chip8_sound_on (void)
/****************************************************************************/
static void chip8_sound_off (void)
{
-#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
+#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
if (!is_playing)
rb->mp3_play_pause(false); /* pause audio */
#endif
@@ -1556,7 +1554,7 @@ static bool chip8_run(const char* file)
cycles = 0;
chip8();
-#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
+#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
if (!is_playing)
{ /* stop it if we used audio */
rb->mp3_play_stop(); /* Stop audio playback */