summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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];
1299static unsigned long starttimer; /* Timer value at the beginning */ 1299static unsigned long starttimer; /* Timer value at the beginning */
1300static unsigned long cycles; /* Number of update cycles (50Hz) */ 1300static unsigned long cycles; /* Number of update cycles (50Hz) */
1301 1301
1302#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 1302#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
1303static bool is_playing; 1303static bool is_playing;
1304 1304
1305/* one frame of bitswapped mp3 data */ 1305/* one frame of bitswapped mp3 data */
@@ -1315,14 +1315,12 @@ static unsigned char beep[]={255,
1315 20,100, 18, 96, 41, 96, 78,102, 7,201,122, 76,119, 20,137, 37,177, 15,132,224, 1315 20,100, 18, 96, 41, 96, 78,102, 7,201,122, 76,119, 20,137, 37,177, 15,132,224,
1316 20, 17,191, 67,147,187,116,211, 41,169, 63,172,182,186,217,155,111,140,104,254, 1316 20, 17,191, 67,147,187,116,211, 41,169, 63,172,182,186,217,155,111,140,104,254,
1317111,181,184,144, 17,148, 21,101,166,227,100, 86, 85, 85, 85}; 1317111,181,184,144, 17,148, 21,101,166,227,100, 86, 85, 85, 85};
1318#if (CONFIG_CODEC != SWCODEC)
1319/* callback to request more mp3 data */ 1318/* callback to request more mp3 data */
1320static void callback(const void** start, size_t* size) 1319static void callback(const void** start, size_t* size)
1321{ 1320{
1322 *start = beep; /* give it the same frame again */ 1321 *start = beep; /* give it the same frame again */
1323 *size = sizeof(beep); 1322 *size = sizeof(beep);
1324} 1323}
1325#endif /* CONFIG_CODEC == HWCODEC */
1326#endif /* PLATFORM_NATIVE */ 1324#endif /* PLATFORM_NATIVE */
1327 1325
1328/****************************************************************************/ 1326/****************************************************************************/
@@ -1330,7 +1328,7 @@ static void callback(const void** start, size_t* size)
1330/****************************************************************************/ 1328/****************************************************************************/
1331static void chip8_sound_on (void) 1329static void chip8_sound_on (void)
1332{ 1330{
1333#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 1331#if(CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
1334 if (!is_playing) 1332 if (!is_playing)
1335 rb->mp3_play_pause(true); /* kickoff audio */ 1333 rb->mp3_play_pause(true); /* kickoff audio */
1336#endif 1334#endif
@@ -1341,7 +1339,7 @@ static void chip8_sound_on (void)
1341/****************************************************************************/ 1339/****************************************************************************/
1342static void chip8_sound_off (void) 1340static void chip8_sound_off (void)
1343{ 1341{
1344#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 1342#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
1345 if (!is_playing) 1343 if (!is_playing)
1346 rb->mp3_play_pause(false); /* pause audio */ 1344 rb->mp3_play_pause(false); /* pause audio */
1347#endif 1345#endif
@@ -1556,7 +1554,7 @@ static bool chip8_run(const char* file)
1556 cycles = 0; 1554 cycles = 0;
1557 chip8(); 1555 chip8();
1558 1556
1559#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 1557#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
1560 if (!is_playing) 1558 if (!is_playing)
1561 { /* stop it if we used audio */ 1559 { /* stop it if we used audio */
1562 rb->mp3_play_stop(); /* Stop audio playback */ 1560 rb->mp3_play_stop(); /* Stop audio playback */