summaryrefslogtreecommitdiff
path: root/apps/plugins/chip8.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/chip8.c')
-rw-r--r--apps/plugins/chip8.c14
1 files changed, 7 insertions, 7 deletions
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];
1185static unsigned long starttimer; /* Timer value at the beginning */ 1185static unsigned long starttimer; /* Timer value at the beginning */
1186static unsigned long cycles; /* Number of update cycles (50Hz) */ 1186static unsigned long cycles; /* Number of update cycles (50Hz) */
1187 1187
1188#ifndef SIMULATOR 1188#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
1189static bool is_playing; 1189static 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/****************************************************************************/
1216static void chip8_sound_on (void) 1216static 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/****************************************************************************/
1227static void chip8_sound_off (void) 1227static 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 */