Assert CPU paused when switching disk images

This commit is contained in:
Aaron Culliney 2016-09-17 12:24:47 -07:00
parent 88ca414f80
commit 781cc60d8c
3 changed files with 11 additions and 2 deletions

View File

@ -740,6 +740,10 @@ void disk6_init(void) {
const char *disk6_eject(int drive) {
#if !TESTING
assert(cpu_isPaused() && "CPU must be paused for disk ejection");
#endif
const char *err = NULL;
if (disk6.disk[drive].fd > 0) {
@ -799,6 +803,10 @@ const char *disk6_eject(int drive) {
const char *disk6_insert(int drive, const char * const raw_file_name, int readonly) {
#if !TESTING
assert(cpu_isPaused() && "CPU must be paused for disk insertion");
#endif
disk6_eject(drive);
disk6.disk[drive].file_name = STRDUP(raw_file_name);

View File

@ -298,8 +298,6 @@ void emulator_start(void) {
void emulator_shutdown(void) {
emulatorShuttingDown = true;
disk6_eject(0);
disk6_eject(1);
video_shutdown();
prefs_shutdown();
timing_stopCPU();

View File

@ -509,6 +509,9 @@ static void *cpu_thread(void *dummyptr) {
cpu_thread_id = 0;
cpu_pause();
disk6_eject(0);
disk6_eject(1);
return NULL;
}