From f3ba2f0d64f1bfcda28b842c486f02d2eb228e35 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Wed, 3 May 2006 21:53:33 +0000 Subject: [PATCH] Don't access ROM85 as it it was a pointer to a ROM version number (8.0, 8.1) aka. fix bogus AppleShare extension, it was trying to dereference 0x3fff. XXX: why is this code called in the first place? --- SheepShaver/src/rsrc_patches.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/SheepShaver/src/rsrc_patches.cpp b/SheepShaver/src/rsrc_patches.cpp index 6f012b65..a48840e3 100644 --- a/SheepShaver/src/rsrc_patches.cpp +++ b/SheepShaver/src/rsrc_patches.cpp @@ -593,6 +593,22 @@ void CheckLoad(uint32 type, const char *name, uint8 *p, uint32 size) // Don't modify resources in ROM if ((uintptr)p >= (uintptr)ROMBaseHost && (uintptr)p <= (uintptr)(ROMBaseHost + ROM_SIZE)) return; + + if (type == FOURCC('D','R','V','R') && strncmp(&name[1], ".AFPTranslator", name[0]) == 0) { + D(bug(" DRVR .AFPTranslator found\n")); + + // 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(0x303c); // move.l #ROM85,%d0 + *p16++ = htons(0x028e); + *p16++ = htons(M68K_NOP); + *p16++ = htons(M68K_NOP); + D(bug(" patch 1 applied\n")); + } + } }