77 |
|
|
78 |
|
|
79 |
|
// Global variables |
80 |
< |
static uint8 last_xpram[XPRAM_SIZE]; // Buffer for monitoring XPRAM changes |
80 |
> |
HANDLE emul_thread = NULL; // Handle of MacOS emulation thread (main thread) |
81 |
|
|
82 |
+ |
static uint8 last_xpram[XPRAM_SIZE]; // Buffer for monitoring XPRAM changes |
83 |
|
static bool xpram_thread_active = false; // Flag: XPRAM watchdog installed |
84 |
|
static volatile bool xpram_thread_cancel = false; // Flag: Cancel XPRAM thread |
85 |
|
static SDL_Thread *xpram_thread = NULL; // XPRAM watchdog |
422 |
|
QuitEmulator(); |
423 |
|
D(bug("Initialization complete\n")); |
424 |
|
|
425 |
+ |
// Get handle of main thread |
426 |
+ |
emul_thread = GetCurrentThread(); |
427 |
+ |
|
428 |
|
// SDL threads available, start 60Hz thread |
429 |
|
tick_thread_active = ((tick_thread = SDL_CreateThread(tick_func, NULL)) != NULL); |
430 |
|
if (!tick_thread_active) { |