287 |
|
TimerReset(); |
288 |
|
MacOSUtilReset(); |
289 |
|
AudioReset(); |
290 |
< |
#if 0 |
291 |
< |
printf("DR activated\n"); |
292 |
< |
WriteMacInt32(KernelDataAddr + 0x17a0, 3); // Prepare for DR emulator activation |
293 |
< |
WriteMacInt32(KernelDataAddr + 0x17c0, DR_CACHE_BASE); |
294 |
< |
WriteMacInt32(KernelDataAddr + 0x17c4, DR_CACHE_SIZE); |
295 |
< |
WriteMacInt32(KernelDataAddr + 0x1b00, DR_CACHE_BASE + 0x10000); |
296 |
< |
memcpy((void *)(DR_CACHE_BASE + 0x10000), (void *)(ROM_BASE + 0x370000), 0x10000); |
297 |
< |
clear_caches((void *)(DR_CACHE_BASE + 0x10000), 0x10000, B_INVALIDATE_ICACHE | B_FLUSH_DCACHE); |
298 |
< |
#endif |
290 |
> |
|
291 |
> |
// Enable DR emulator |
292 |
> |
if (PrefsFindBool("jit68k")) { |
293 |
> |
D(bug("DR activated\n")); |
294 |
> |
WriteMacInt32(KernelDataAddr + 0x17a0, 3); // Prepare for DR emulator activation |
295 |
> |
WriteMacInt32(KernelDataAddr + 0x17c0, DR_CACHE_BASE); |
296 |
> |
WriteMacInt32(KernelDataAddr + 0x17c4, DR_CACHE_SIZE); |
297 |
> |
WriteMacInt32(KernelDataAddr + 0x1b04, DR_CACHE_BASE); |
298 |
> |
WriteMacInt32(KernelDataAddr + 0x1b00, DR_EMULATOR_BASE); |
299 |
> |
memcpy((void *)DR_EMULATOR_BASE, (void *)(ROM_BASE + 0x370000), DR_EMULATOR_SIZE); |
300 |
> |
MakeExecutable(0, (void *)DR_EMULATOR_BASE, DR_EMULATOR_SIZE); |
301 |
> |
} |
302 |
|
break; |
303 |
|
|
304 |
|
case OP_IRQ: // Level 1 interrupt |
433 |
|
D(bug("%d %d\n", ReadMacInt16(r->a[2]), ReadMacInt16(r->a[2] + 6))); |
434 |
|
if (ReadMacInt16(r->a[2]) == 11 && ReadMacInt16(r->a[2] + 6) == 17) |
435 |
|
PatchNativeResourceManager(); |
436 |
+ |
break; |
437 |
+ |
|
438 |
+ |
case OP_NTRB_17_PATCH4: |
439 |
+ |
r->d[0] = ReadMacInt16(r->a[7]); |
440 |
+ |
r->a[7] += 2; |
441 |
+ |
D(bug("%d %d\n", ReadMacInt16(r->a[2]), ReadMacInt16(r->a[2] + 6))); |
442 |
+ |
if (ReadMacInt16(r->a[2]) == 11 && ReadMacInt16(r->a[2] + 6) == 17) |
443 |
+ |
PatchNativeResourceManager(); |
444 |
|
break; |
445 |
|
|
446 |
|
case OP_CHECKLOAD: { // vCheckLoad() patch |