59 |
|
|
60 |
|
|
61 |
|
// TVector of MakeExecutable |
62 |
< |
static uint32 *MakeExecutableTvec; |
62 |
> |
static uint32 MakeExecutableTvec; |
63 |
|
|
64 |
|
|
65 |
|
/* |
259 |
|
InstallDrivers(); |
260 |
|
|
261 |
|
// Patch MakeExecutable() |
262 |
< |
MakeExecutableTvec = (uint32 *)FindLibSymbol("\023PrivateInterfaceLib", "\016MakeExecutable"); |
263 |
< |
D(bug("MakeExecutable TVECT at %p\n", MakeExecutableTvec)); |
264 |
< |
MakeExecutableTvec[0] = htonl(NativeFunction(NATIVE_MAKE_EXECUTABLE)); |
262 |
> |
MakeExecutableTvec = (uint32)FindLibSymbol("\023PrivateInterfaceLib", "\016MakeExecutable"); |
263 |
> |
D(bug("MakeExecutable TVECT at %08x\n", MakeExecutableTvec)); |
264 |
> |
WriteMacInt32(MakeExecutableTvec, NativeFunction(NATIVE_MAKE_EXECUTABLE)); |
265 |
|
#if !EMULATED_PPC |
266 |
< |
MakeExecutableTvec[1] = (uint32)TOC; |
266 |
> |
WriteMacInt32(MakeExecutableTvec + 4, (uint32)TOC); |
267 |
|
#endif |
268 |
|
|
269 |
|
// Patch DebugStr() |
270 |
< |
static const uint16 proc[] = { |
271 |
< |
PW(M68K_EMUL_OP_DEBUG_STR), |
272 |
< |
PW(0x4e74), // rtd #4 |
273 |
< |
PW(0x0004) |
270 |
> |
static const uint8 proc_template[] = { |
271 |
> |
M68K_EMUL_OP_DEBUG_STR >> 8, M68K_EMUL_OP_DEBUG_STR, |
272 |
> |
0x4e, 0x74, // rtd #4 |
273 |
> |
0x00, 0x04 |
274 |
|
}; |
275 |
< |
WriteMacInt32(0x1dfc, (uint32)proc); |
275 |
> |
BUILD_SHEEPSHAVER_PROCEDURE(proc); |
276 |
> |
WriteMacInt32(0x1dfc, proc); |
277 |
|
break; |
278 |
|
} |
279 |
|
|
289 |
|
MacOSUtilReset(); |
290 |
|
AudioReset(); |
291 |
|
|
292 |
< |
// Enable DR emulator from NewWorld ROMs |
293 |
< |
if (ROMType == ROMTYPE_NEWWORLD) { |
292 |
> |
// Enable DR emulator |
293 |
> |
if (PrefsFindBool("jit68k")) { |
294 |
|
D(bug("DR activated\n")); |
295 |
|
WriteMacInt32(KernelDataAddr + 0x17a0, 3); // Prepare for DR emulator activation |
296 |
|
WriteMacInt32(KernelDataAddr + 0x17c0, DR_CACHE_BASE); |
298 |
|
WriteMacInt32(KernelDataAddr + 0x1b04, DR_CACHE_BASE); |
299 |
|
WriteMacInt32(KernelDataAddr + 0x1b00, DR_EMULATOR_BASE); |
300 |
|
memcpy((void *)DR_EMULATOR_BASE, (void *)(ROM_BASE + 0x370000), DR_EMULATOR_SIZE); |
301 |
< |
MakeExecutable(0, (void *)DR_EMULATOR_BASE, DR_EMULATOR_SIZE); |
301 |
> |
MakeExecutable(0, DR_EMULATOR_BASE, DR_EMULATOR_SIZE); |
302 |
|
} |
303 |
|
break; |
304 |
|
|
434 |
|
D(bug("%d %d\n", ReadMacInt16(r->a[2]), ReadMacInt16(r->a[2] + 6))); |
435 |
|
if (ReadMacInt16(r->a[2]) == 11 && ReadMacInt16(r->a[2] + 6) == 17) |
436 |
|
PatchNativeResourceManager(); |
437 |
+ |
break; |
438 |
+ |
|
439 |
+ |
case OP_NTRB_17_PATCH4: |
440 |
+ |
r->d[0] = ReadMacInt16(r->a[7]); |
441 |
+ |
r->a[7] += 2; |
442 |
+ |
D(bug("%d %d\n", ReadMacInt16(r->a[2]), ReadMacInt16(r->a[2] + 6))); |
443 |
+ |
if (ReadMacInt16(r->a[2]) == 11 && ReadMacInt16(r->a[2] + 6) == 17) |
444 |
+ |
PatchNativeResourceManager(); |
445 |
|
break; |
446 |
|
|
447 |
|
case OP_CHECKLOAD: { // vCheckLoad() patch |