mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-08-10 03:25:05 +00:00
Assert CPU paused when switching disk images
This commit is contained in:
@@ -740,6 +740,10 @@ void disk6_init(void) {
|
|||||||
|
|
||||||
const char *disk6_eject(int drive) {
|
const char *disk6_eject(int drive) {
|
||||||
|
|
||||||
|
#if !TESTING
|
||||||
|
assert(cpu_isPaused() && "CPU must be paused for disk ejection");
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *err = NULL;
|
const char *err = NULL;
|
||||||
|
|
||||||
if (disk6.disk[drive].fd > 0) {
|
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) {
|
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_eject(drive);
|
||||||
|
|
||||||
disk6.disk[drive].file_name = STRDUP(raw_file_name);
|
disk6.disk[drive].file_name = STRDUP(raw_file_name);
|
||||||
|
@@ -298,8 +298,6 @@ void emulator_start(void) {
|
|||||||
|
|
||||||
void emulator_shutdown(void) {
|
void emulator_shutdown(void) {
|
||||||
emulatorShuttingDown = true;
|
emulatorShuttingDown = true;
|
||||||
disk6_eject(0);
|
|
||||||
disk6_eject(1);
|
|
||||||
video_shutdown();
|
video_shutdown();
|
||||||
prefs_shutdown();
|
prefs_shutdown();
|
||||||
timing_stopCPU();
|
timing_stopCPU();
|
||||||
|
@@ -509,6 +509,9 @@ static void *cpu_thread(void *dummyptr) {
|
|||||||
cpu_thread_id = 0;
|
cpu_thread_id = 0;
|
||||||
cpu_pause();
|
cpu_pause();
|
||||||
|
|
||||||
|
disk6_eject(0);
|
||||||
|
disk6_eject(1);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user