288 |
|
MacOSUtilReset(); |
289 |
|
AudioReset(); |
290 |
|
#if 0 |
291 |
< |
printf("DR activated\n"); |
291 |
> |
// Enable DR emulator |
292 |
> |
D(bug("DR activated\n")); |
293 |
|
WriteMacInt32(KernelDataAddr + 0x17a0, 3); // Prepare for DR emulator activation |
294 |
|
WriteMacInt32(KernelDataAddr + 0x17c0, DR_CACHE_BASE); |
295 |
|
WriteMacInt32(KernelDataAddr + 0x17c4, DR_CACHE_SIZE); |
296 |
< |
WriteMacInt32(KernelDataAddr + 0x1b00, DR_CACHE_BASE + 0x10000); |
297 |
< |
memcpy((void *)(DR_CACHE_BASE + 0x10000), (void *)(ROM_BASE + 0x370000), 0x10000); |
298 |
< |
clear_caches((void *)(DR_CACHE_BASE + 0x10000), 0x10000, B_INVALIDATE_ICACHE | B_FLUSH_DCACHE); |
296 |
> |
WriteMacInt32(KernelDataAddr + 0x1b04, DR_CACHE_BASE); |
297 |
> |
WriteMacInt32(KernelDataAddr + 0x1b00, DR_EMULATOR_BASE); |
298 |
> |
memcpy((void *)DR_EMULATOR_BASE, (void *)(ROM_BASE + 0x370000), DR_EMULATOR_SIZE); |
299 |
> |
MakeExecutable(0, (void *)DR_EMULATOR_BASE, DR_EMULATOR_SIZE); |
300 |
|
#endif |
301 |
|
break; |
302 |
|
|
458 |
|
break; |
459 |
|
|
460 |
|
case OP_IDLE_TIME: |
459 |
– |
#if __BEOS__ |
461 |
|
// Sleep if no events pending |
462 |
< |
if (ReadMacInt32(0x14c) == 0) { |
463 |
< |
sleep(16667); |
463 |
< |
} |
464 |
< |
#endif |
462 |
> |
if (ReadMacInt32(0x14c) == 0) |
463 |
> |
Delay_usec(16667); |
464 |
|
r->a[0] = ReadMacInt32(0x2b6); |
465 |
|
break; |
466 |
|
|
467 |
+ |
case OP_IDLE_TIME_2: |
468 |
+ |
// Sleep if no events pending |
469 |
+ |
if (ReadMacInt32(0x14c) == 0) |
470 |
+ |
Delay_usec(16667); |
471 |
+ |
r->d[0] = (uint32)-2; |
472 |
+ |
break; |
473 |
+ |
|
474 |
|
default: |
475 |
|
printf("FATAL: EMUL_OP called with bogus selector %08x\n", selector); |
476 |
|
QuitEmulator(); |