347 |
|
|
348 |
|
void QuitEmulator(void) |
349 |
|
{ |
350 |
+ |
// Stop 60Hz thread |
351 |
+ |
if (tick_proc) { |
352 |
+ |
SetSignal(0, SIGF_SINGLE); |
353 |
+ |
tick_proc_active = false; |
354 |
+ |
Wait(SIGF_SINGLE); |
355 |
+ |
} |
356 |
+ |
|
357 |
|
// Restore stack |
358 |
|
if (stack_swapped) { |
359 |
|
stack_swapped = false; |
367 |
|
FreeSignal(IRQSig); |
368 |
|
} |
369 |
|
|
363 |
– |
// Stop 60Hz thread |
364 |
– |
if (tick_proc) { |
365 |
– |
SetSignal(0, SIGF_SINGLE); |
366 |
– |
tick_proc_active = false; |
367 |
– |
Wait(SIGF_SINGLE); |
368 |
– |
} |
369 |
– |
|
370 |
|
// Remove trap handler |
371 |
|
MainTask->tc_TrapCode = OldTrapHandler; |
372 |
|
|
495 |
|
if (++tick_counter > 60) { |
496 |
|
tick_counter = 0; |
497 |
|
WriteMacInt32(0x20c, TimerDateTime()); |
498 |
+ |
SetInterruptFlag(INTFLAG_1HZ); |
499 |
+ |
TriggerInterrupt(); |
500 |
|
} |
501 |
|
|
502 |
|
// Trigger 60Hz interrupt |
610 |
|
EmulatedSR |= 0x0700; |
611 |
|
|
612 |
|
// Call opcode routine |
613 |
< |
EmulOp(*(uint16 *)(r->pc), (M68kRegisters *)r); |
613 |
> |
EmulOp(opcode, (M68kRegisters *)r); |
614 |
|
r->pc += 2; |
615 |
|
|
616 |
|
// Restore interrupts |