mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-12-25 17:29:19 +00:00
Issue a SysError(dsOldSystem) if we are trying to use MacOS < 8.1.0 with a
NewWorld ROM. That may be 8.1.0 included but original iMac had a NewWorld ROM compatible system. Otherwise we will crash because the boot routine is trying to execute code through unitialized descriptor that points to 0x13ff, which is obviously wrong (and unaligned on word-boundaries for 68k code).
This commit is contained in:
parent
2881c20813
commit
7cc1bbc7b8
@ -409,6 +409,16 @@ void EmulOp(M68kRegisters *r, uint32 pc, int selector)
|
|||||||
r->d[0] = (uint32)-7887;
|
r->d[0] = (uint32)-7887;
|
||||||
break;
|
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:
|
case OP_NTRB_17_PATCH:
|
||||||
r->a[2] = ReadMacInt32(r->a[7]);
|
r->a[2] = ReadMacInt32(r->a[7]);
|
||||||
r->a[7] += 4;
|
r->a[7] += 4;
|
||||||
|
@ -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_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_DEBUG_STR, OP_INSTALL_DRIVERS, OP_NAME_REGISTRY, OP_RESET, OP_IRQ,
|
||||||
OP_SCSI_DISPATCH, OP_SCSI_ATOMIC,
|
OP_SCSI_DISPATCH, OP_SCSI_ATOMIC,
|
||||||
OP_NTRB_17_PATCH, OP_NTRB_17_PATCH2, OP_NTRB_17_PATCH3, OP_NTRB_17_PATCH4, OP_CHECKLOAD,
|
OP_CHECK_SYSV, 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_EXTFS_COMM, OP_EXTFS_HFS, OP_IDLE_TIME, OP_IDLE_TIME_2,
|
||||||
OP_MAX
|
OP_MAX
|
||||||
};
|
};
|
||||||
@ -96,6 +96,7 @@ const uint16 M68K_EMUL_OP_RESET = M68K_EMUL_BREAK + OP_RESET;
|
|||||||
const uint16 M68K_EMUL_OP_IRQ = M68K_EMUL_BREAK + OP_IRQ;
|
const uint16 M68K_EMUL_OP_IRQ = M68K_EMUL_BREAK + OP_IRQ;
|
||||||
const uint16 M68K_EMUL_OP_SCSI_DISPATCH = M68K_EMUL_BREAK + OP_SCSI_DISPATCH;
|
const uint16 M68K_EMUL_OP_SCSI_DISPATCH = M68K_EMUL_BREAK + OP_SCSI_DISPATCH;
|
||||||
const uint16 M68K_EMUL_OP_SCSI_ATOMIC = M68K_EMUL_BREAK + OP_SCSI_ATOMIC;
|
const uint16 M68K_EMUL_OP_SCSI_ATOMIC = M68K_EMUL_BREAK + OP_SCSI_ATOMIC;
|
||||||
|
const uint16 M68K_EMUL_OP_CHECK_SYSV = M68K_EMUL_BREAK + OP_CHECK_SYSV;
|
||||||
const uint16 M68K_EMUL_OP_NTRB_17_PATCH = M68K_EMUL_BREAK + OP_NTRB_17_PATCH;
|
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_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_PATCH3 = M68K_EMUL_BREAK + OP_NTRB_17_PATCH3;
|
||||||
|
@ -168,6 +168,12 @@ void CheckLoad(uint32 type, int16 id, uint16 *p, uint32 size)
|
|||||||
p[5] = htons(0x6010); // bra
|
p[5] = htons(0x6010); // bra
|
||||||
D(bug(" patch 7 applied\n"));
|
D(bug(" patch 7 applied\n"));
|
||||||
}
|
}
|
||||||
|
} else if (PM(0,0x2f3c) && PM(1,0x7665) && PM(2,0x7273) && PM(3,0x3f3c) && PM(4,0x0001) && PM(10,0x2041) && PM(11,0x2248) && PM(12,0x2050) && PM(20,0x7066) && PM(21,0xa9c9)) {
|
||||||
|
// Check when vers 1 is installed (for safe abort if MacOS < 8.1 is used with a NewWorld ROM)
|
||||||
|
p[10] = htons(M68K_EMUL_OP_CHECK_SYSV);
|
||||||
|
p[11] = htons(0x4a81); // tst.l d1
|
||||||
|
p[12] = htons(0x670e); // beq.s <SysError #dsOldSystem>
|
||||||
|
D(bug(" patch 9 applied\n"));
|
||||||
}
|
}
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user