--- SheepShaver/src/emul_op.cpp 2005/03/05 19:07:35 1.19 +++ SheepShaver/src/emul_op.cpp 2008/01/01 09:47:38 1.23 @@ -1,7 +1,7 @@ /* * emul_op.cpp - 68k opcodes for ROM patches * - * SheepShaver (C) 1997-2005 Christian Bauer and Marc Hellwig + * SheepShaver (C) 1997-2008 Christian Bauer and Marc Hellwig * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -282,8 +282,8 @@ void EmulOp(M68kRegisters *r, uint32 pc, MacOSUtilReset(); AudioReset(); - // Enable DR emulator - if (PrefsFindBool("jit68k")) { + // Enable DR emulator (disabled for now) + if (PrefsFindBool("jit68k") && 0) { D(bug("DR activated\n")); WriteMacInt32(KernelDataAddr + 0x17a0, 3); // Prepare for DR emulator activation WriteMacInt32(KernelDataAddr + 0x17c0, DR_CACHE_BASE); @@ -409,6 +409,16 @@ void EmulOp(M68kRegisters *r, uint32 pc, r->d[0] = (uint32)-7887; break; + case OP_CHECK_SYSV: { // Check we are not using MacOS < 8.1 with a NewWorld ROM + r->a[1] = r->d[1]; + r->a[0] = ReadMacInt32(r->d[1]); + uint32 sysv = ReadMacInt16(r->a[0]); + D(bug("Detected MacOS version %d.%d.%d\n", (sysv >> 8) & 0xf, (sysv >> 4) & 0xf, sysv & 0xf)); + if (ROMType == ROMTYPE_NEWWORLD && sysv < 0x0801) + r->d[1] = 0; + break; + } + case OP_NTRB_17_PATCH: r->a[2] = ReadMacInt32(r->a[7]); r->a[7] += 4; @@ -463,14 +473,14 @@ void EmulOp(M68kRegisters *r, uint32 pc, case OP_IDLE_TIME: // Sleep if no events pending if (ReadMacInt32(0x14c) == 0) - Delay_usec(16667); + idle_wait(); r->a[0] = ReadMacInt32(0x2b6); break; case OP_IDLE_TIME_2: // Sleep if no events pending if (ReadMacInt32(0x14c) == 0) - Delay_usec(16667); + idle_wait(); r->d[0] = (uint32)-2; break;