mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-08-10 03:25:05 +00:00
Refresh video after CPU pause
- Fixes rendering if new video mode selected
This commit is contained in:
@@ -41,6 +41,7 @@ bool alt_speed_enabled = false;
|
|||||||
static bool emul_reinitialize_audio = false;
|
static bool emul_reinitialize_audio = false;
|
||||||
static bool emul_pause_audio = false;
|
static bool emul_pause_audio = false;
|
||||||
static bool emul_resume_audio = false;
|
static bool emul_resume_audio = false;
|
||||||
|
static bool emul_video_dirty = false;
|
||||||
static bool cpu_shutting_down = false;
|
static bool cpu_shutting_down = false;
|
||||||
pthread_t cpu_thread_id = 0;
|
pthread_t cpu_thread_id = 0;
|
||||||
pthread_mutex_t interface_mutex = PTHREAD_MUTEX_INITIALIZER;
|
pthread_mutex_t interface_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
@@ -157,6 +158,7 @@ static void timing_reinitializeAudio(void) {
|
|||||||
emul_reinitialize_audio = true;
|
emul_reinitialize_audio = true;
|
||||||
emul_pause_audio = false;
|
emul_pause_audio = false;
|
||||||
emul_resume_audio = false;
|
emul_resume_audio = false;
|
||||||
|
emul_video_dirty = false;
|
||||||
SPINLOCK_RELINQUISH(&_pause_spinLock);
|
SPINLOCK_RELINQUISH(&_pause_spinLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,10 +194,11 @@ void cpu_resume(void) {
|
|||||||
// CPU thread will be unblocked to acquire interface_mutex
|
// CPU thread will be unblocked to acquire interface_mutex
|
||||||
if (!emul_reinitialize_audio) {
|
if (!emul_reinitialize_audio) {
|
||||||
emul_resume_audio = true;
|
emul_resume_audio = true;
|
||||||
|
emul_video_dirty = true;
|
||||||
}
|
}
|
||||||
LOG("RESUMING CPU...");
|
LOG("RESUMING CPU...");
|
||||||
pthread_mutex_unlock(&interface_mutex);
|
|
||||||
is_paused = false;
|
is_paused = false;
|
||||||
|
pthread_mutex_unlock(&interface_mutex);
|
||||||
} while (0);
|
} while (0);
|
||||||
SPINLOCK_RELINQUISH(&_pause_spinLock);
|
SPINLOCK_RELINQUISH(&_pause_spinLock);
|
||||||
}
|
}
|
||||||
@@ -280,6 +283,10 @@ cpu_runloop:
|
|||||||
emul_resume_audio = false;
|
emul_resume_audio = false;
|
||||||
audio_resume();
|
audio_resume();
|
||||||
}
|
}
|
||||||
|
if (UNLIKELY(emul_video_dirty)) {
|
||||||
|
emul_video_dirty = false;
|
||||||
|
video_setDirty(A2_DIRTY_FLAG);
|
||||||
|
}
|
||||||
clock_gettime(CLOCK_MONOTONIC, &ti);
|
clock_gettime(CLOCK_MONOTONIC, &ti);
|
||||||
|
|
||||||
deltat = timespec_diff(t0, ti, &negative);
|
deltat = timespec_diff(t0, ti, &negative);
|
||||||
|
Reference in New Issue
Block a user