Skip to content

Commit 4e6dcf9

Browse files
committed
Update emulator start/stop
1 parent f9b5843 commit 4e6dcf9

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

src/usbsid.c

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,13 @@ extern void auto_detect_routine(bool auto_config, bool with_delay);
111111

112112
/* SID player */
113113
#ifdef ONBOARD_EMULATOR
114-
extern bool sidplayer_init, sidplayer_playing;
115-
extern void run_emulator(void);
114+
extern bool emulator_running, starting_emulator, stopping_emulator;
115+
extern void start_emulator(void);
116+
#ifdef ONBOARD_SIDPLAYER
117+
extern bool sidplayer_init, sidplayer_playing, sidplayer_start;
118+
extern unsigned int run_emulator(void);
119+
extern void start_sidplayer(void);
120+
#endif
116121
#endif
117122

118123
/* Midi */
@@ -716,6 +721,22 @@ void core1_main(void)
716721
}
717722

718723
#ifdef ONBOARD_EMULATOR
724+
if (!emulator_running && starting_emulator) {
725+
starting_emulator = false;
726+
emulator_running = true;
727+
start_emulator();
728+
}
729+
#endif
730+
731+
#if defined(ONBOARD_EMULATOR) && defined(ONBOARD_SIDPLAYER)
732+
if (sidplayer_start) {
733+
sidplayer_start = false;
734+
start_sidplayer();
735+
sidplayer_playing = true;
736+
}
737+
#endif
738+
739+
#if defined(ONBOARD_EMULATOR) && defined(ONBOARD_SIDPLAYER)
719740
if (sidplayer_playing) {
720741
run_emulator();
721742
}
@@ -733,8 +754,6 @@ void core1_main(void)
733754
}
734755
}
735756
#endif
736-
737-
738757
}
739758
/* Point of no return, this should never be reached */
740759
return;

0 commit comments

Comments
 (0)