fix ROM85 bug fix for AppleShare extension

This commit is contained in:
gbeauche
2006-02-19 14:18:29 +00:00
parent 294664b726
commit c374d519a3

View File

@@ -306,28 +306,21 @@ void CheckLoad(uint32 type, int16 id, uint8 *p, uint32 size)
*p16 = htons(M68K_RTS);
FlushCodeCache(p, 6);
D(bug(" patch 1 applied\n"));
}
#if REAL_ADDRESSING && !defined(AMIGA)
else if (type == FOURCC('D','R','V','R') && id == 41) {
} else if (type == FOURCC('D','R','V','R') && id == 41) {
D(bug(" DRVR 41 found\n"));
// gb-- [0x28E (ROM85)] contains 0x3fff that will be placed into a0
// Seems to be caused by the AppleShare extension from MacOS 8.1 (3.7.4)
// .AFPTranslator (DRVR addr 0x2372)
// Don't access ROM85 as it it was a pointer to a ROM version number (8.0, 8.1)
static const uint8 dat[] = {0x3a, 0x2e, 0x00, 0x0a, 0x55, 0x4f, 0x3e, 0xb8, 0x02, 0x8e, 0x30, 0x1f, 0x48, 0xc0, 0x24, 0x40, 0x20, 0x40};
base = find_rsrc_data(p, size, dat, sizeof(dat));
if (base) {
p16 = (uint16 *)(p + base + 4);
*p16++ = htons(0x3078); // movea.w ROM85,%a0
*p16++ = htons(0x303c); // move.l #ROM85,%d0
*p16++ = htons(0x028e);
*p16++ = htons(0xd1fc); // adda.l #RAMBaseMac,%a0
*p16++ = htons((RAMBaseMac >> 16) & 0xffff);
*p16++ = htons(RAMBaseMac & 0xffff);
*p16++ = htons(0x2448); // movea.l %a0,%a2
*p16++ = htons(M68K_NOP);
FlushCodeCache(p + base + 4, 14);
*p16++ = htons(M68K_NOP);
FlushCodeCache(p + base + 4, 8);
D(bug(" patch 1 applied\n"));
}
}
#endif
}