MacOS 9.0.4 support. ;-)

This commit is contained in:
gbeauche 2004-06-20 19:10:02 +00:00
parent cb46ffe97a
commit 2224cc63d0
3 changed files with 30 additions and 2 deletions

View File

@ -435,6 +435,14 @@ void EmulOp(M68kRegisters *r, uint32 pc, int selector)
PatchNativeResourceManager();
break;
case OP_NTRB_17_PATCH4:
r->d[0] = ReadMacInt16(r->a[7]);
r->a[7] += 2;
D(bug("%d %d\n", ReadMacInt16(r->a[2]), ReadMacInt16(r->a[2] + 6)));
if (ReadMacInt16(r->a[2]) == 11 && ReadMacInt16(r->a[2] + 6) == 17)
PatchNativeResourceManager();
break;
case OP_CHECKLOAD: { // vCheckLoad() patch
uint32 type = ReadMacInt32(r->a[7]);
r->a[7] += 4;

View File

@ -47,7 +47,7 @@ enum { // Selectors for EMUL_OP opcodes
OP_ADBOP, OP_INSTIME, OP_RMVTIME, OP_PRIMETIME, OP_MICROSECONDS, OP_PUT_SCRAP, OP_GET_SCRAP,
OP_DEBUG_STR, OP_INSTALL_DRIVERS, OP_NAME_REGISTRY, OP_RESET, OP_IRQ,
OP_SCSI_DISPATCH, OP_SCSI_ATOMIC,
OP_NTRB_17_PATCH, OP_NTRB_17_PATCH2, OP_NTRB_17_PATCH3, OP_CHECKLOAD,
OP_NTRB_17_PATCH, OP_NTRB_17_PATCH2, OP_NTRB_17_PATCH3, OP_NTRB_17_PATCH4, OP_CHECKLOAD,
OP_EXTFS_COMM, OP_EXTFS_HFS, OP_IDLE_TIME, OP_IDLE_TIME_2,
OP_MAX
};
@ -99,6 +99,7 @@ const uint16 M68K_EMUL_OP_SCSI_ATOMIC = M68K_EMUL_BREAK + OP_SCSI_ATOMIC;
const uint16 M68K_EMUL_OP_NTRB_17_PATCH = M68K_EMUL_BREAK + OP_NTRB_17_PATCH;
const uint16 M68K_EMUL_OP_NTRB_17_PATCH2 = M68K_EMUL_BREAK + OP_NTRB_17_PATCH2;
const uint16 M68K_EMUL_OP_NTRB_17_PATCH3 = M68K_EMUL_BREAK + OP_NTRB_17_PATCH3;
const uint16 M68K_EMUL_OP_NTRB_17_PATCH4 = M68K_EMUL_BREAK + OP_NTRB_17_PATCH4;
const uint16 M68K_EMUL_OP_CHECKLOAD = M68K_EMUL_BREAK + OP_CHECKLOAD;
const uint16 M68K_EMUL_OP_EXTFS_COMM = M68K_EMUL_BREAK + OP_EXTFS_COMM;
const uint16 M68K_EMUL_OP_EXTFS_HFS = M68K_EMUL_BREAK + OP_EXTFS_HFS;

View File

@ -136,10 +136,15 @@ void CheckLoad(uint32 type, int16 id, uint16 *p, uint32 size)
// Check when ntrb 17 is installed (for native Resource Manager patch) (7.6, 7.6.1, 8.0, 8.1)
p[7] = htons(M68K_EMUL_OP_NTRB_17_PATCH);
D(bug(" patch 3 applied\n"));
} else if (PM(0,0x3f2a) && PM(1,0x0006) && PM(2,0x3f2a) && PM(3,0x0002) && PM(4,0x61ff)) {
} else if (PM(0,0x3f2a) && PM(1,0x0006) && PM(2,0x3f2a) && PM(3,0x0002) && PM(4,0x61ff) && PM(8,0x245f)) {
// Check when ntrb 17 is installed (for native Resource Manager patch) (8.5, 8.6)
p[8] = htons(M68K_EMUL_OP_NTRB_17_PATCH);
D(bug(" patch 4 applied\n"));
} else if (PM(0,0x3f2a) && PM(1,0x0006) && PM(2,0x3f2a) && PM(3,0x0002) && PM(4,0x61ff) && PM(7,0x301f)) {
// Check when ntrb 17 is installed (for native Resource Manager patch) (9.0)
p[7] = htons(M68K_EMUL_OP_NTRB_17_PATCH4);
p[8] = htons(ntohs(p[8]) & 0xf0ff); // bra
D(bug(" patch 8 applied\n"));
} else if (PM(0,0x0c39) && PM(1,0x0001) && PM(2,0xf800) && PM(3,0x0008) && PM(4,0x6f00)) {
// Don't read from 0xf8000008 (8.5 with Zanzibar ROM, 8.6)
p[0] = htons(M68K_NOP);
@ -179,6 +184,20 @@ void CheckLoad(uint32 type, int16 id, uint16 *p, uint32 size)
D(bug(" patch 1 applied\n"));
}
} else if (type == FOURCC('p','t','c','h') && id == 156) {
D(bug("ptch 156 found\n"));
size >>= 1;
while (size--) {
if (PM(0,0x4e56) && PM(1,0xfffa) && PM(2,0x48e7) && PM(3,0x1f18) && PM(4,0x7800) && PM(5,0x267c) && PM(6,0x6900) && PM(7,0x0000)) {
// Don't call FE0A opcode (9.0)
p[0] = htons(0x7000); // moveq #0,d0
p[1] = htons(M68K_RTS);
D(bug(" patch 1 applied\n"));
break;
}
p++;
}
} else if (type == FOURCC('p','t','c','h') && id == 420) {
D(bug("ptch 420 found\n"));
size >>= 1;