69 |
|
uint16 *p16; |
70 |
|
uint32 base; |
71 |
|
D(bug("vCheckLoad %c%c%c%c (%08x) ID %d, data %08x, size %d\n", (char)(type >> 24), (char)((type >> 16) & 0xff), (char )((type >> 8) & 0xff), (char )(type & 0xff), type, id, p, size)); |
72 |
< |
|
72 |
> |
|
73 |
|
if (type == FOURCC('b','o','o','t') && id == 3) { |
74 |
|
D(bug(" boot 3 found\n")); |
75 |
|
|
90 |
|
if (base) { |
91 |
|
p16 = (uint16 *)(p + base); |
92 |
|
|
93 |
< |
#if defined(AMIGA) || defined(__NetBSD__) |
93 |
> |
#if defined(AMIGA) || defined(__NetBSD__) || defined(USE_SCRATCHMEM_SUBTERFUGE) |
94 |
|
// Set 0x0000 to scratch memory area |
95 |
< |
extern uint32 ScratchMem; |
95 |
> |
extern uint8 *ScratchMem; |
96 |
> |
const uint32 ScratchMemBase = Host2MacAddr(ScratchMem); |
97 |
|
*p16++ = htons(0x207c); // move.l #ScratchMem,a0 |
98 |
< |
*p16++ = htons(ScratchMem >> 16); |
99 |
< |
*p16++ = htons(ScratchMem); |
98 |
> |
*p16++ = htons(ScratchMemBase >> 16); |
99 |
> |
*p16++ = htons(ScratchMemBase); |
100 |
|
*p16++ = htons(M68K_NOP); |
101 |
|
*p16 = htons(M68K_NOP); |
102 |
|
#else |
115 |
|
if (base) { |
116 |
|
p16 = (uint16 *)(p + base); |
117 |
|
|
118 |
< |
#if defined(AMIGA) || defined(__NetBSD__) |
118 |
> |
#if defined(AMIGA) || defined(__NetBSD__) || defined(USE_SCRATCHMEM_SUBTERFUGE) |
119 |
|
// Set 0x0000 to scratch memory area |
120 |
< |
extern uint32 ScratchMem; |
120 |
> |
extern uint8 *ScratchMem; |
121 |
> |
const uint32 ScratchMemBase = Host2MacAddr(ScratchMem); |
122 |
|
*p16++ = htons(0x207c); // move.l #ScratchMem,a0 |
123 |
< |
*p16++ = htons(ScratchMem >> 16); |
124 |
< |
*p16++ = htons(ScratchMem); |
123 |
> |
*p16++ = htons(ScratchMemBase >> 16); |
124 |
> |
*p16++ = htons(ScratchMemBase); |
125 |
|
*p16++ = htons(M68K_NOP); |
126 |
|
*p16 = htons(M68K_NOP); |
127 |
|
#else |
461 |
|
D(bug(" gpch 750 found\n")); |
462 |
|
|
463 |
|
// Don't use PTEST instruction in BlockMove() (7.5, 7.6, 7.6.1, 8.0) |
464 |
< |
static const uint8 dat[] = {0xa0, 0x8d, 0x0c, 0x81, 0x00, 0x00, 0x0c, 0x00, 0x65, 0x06, 0x4e, 0x71, 0xf4, 0xf8}; |
464 |
> |
static const uint8 dat[] = {0x20, 0x5f, 0x22, 0x5f, 0x0c, 0x38, 0x00, 0x04, 0x01, 0x2f}; |
465 |
|
base = find_rsrc_data(p, size, dat, sizeof(dat)); |
466 |
|
if (base) { |
467 |
< |
p16 = (uint16 *)(p + base + 8); |
468 |
< |
*p16 = htons(M68K_NOP); |
469 |
< |
FlushCodeCache(p + base + 8, 2); |
467 |
> |
p16 = (uint16 *)(p + base + 4); |
468 |
> |
*p16++ = htons(M68K_EMUL_OP_BLOCK_MOVE); |
469 |
> |
*p16++ = htons(0x7000); |
470 |
> |
*p16 = htons(M68K_RTS); |
471 |
> |
FlushCodeCache(p + base + 4, 6); |
472 |
|
D(bug(" patch 1 applied\n")); |
473 |
|
} |
474 |
|
|
604 |
|
FlushCodeCache(p, 6); |
605 |
|
D(bug(" patch 1 applied\n")); |
606 |
|
} |
607 |
+ |
#if REAL_ADDRESSING && !defined(AMIGA) |
608 |
+ |
else if (type == FOURCC('D','R','V','R') && id == 41) { |
609 |
+ |
D(bug(" DRVR 41 found\n")); |
610 |
+ |
|
611 |
+ |
// gb-- [0x28E (ROM85)] contains 0x3fff that will be placed into a0 |
612 |
+ |
// Seems to be caused by the AppleShare extension from MacOS 8.1 (3.7.4) |
613 |
+ |
// .AFPTranslator (DRVR addr 0x2372) |
614 |
+ |
static const uint8 dat[] = {0x3a, 0x2e, 0x00, 0x0a, 0x55, 0x4f, 0x3e, 0xb8, 0x02, 0x8e, 0x30, 0x1f, 0x48, 0xc0, 0x24, 0x40, 0x20, 0x40}; |
615 |
+ |
base = find_rsrc_data(p, size, dat, sizeof(dat)); |
616 |
+ |
if (base) { |
617 |
+ |
p16 = (uint16 *)(p + base + 4); |
618 |
+ |
*p16++ = htons(0x3078); // movea.w ROM85,%a0 |
619 |
+ |
*p16++ = htons(0x028e); |
620 |
+ |
*p16++ = htons(0xd1fc); // adda.l #RAMBaseMac,%a0 |
621 |
+ |
*p16++ = htons((RAMBaseMac >> 16) & 0xffff); |
622 |
+ |
*p16++ = htons(RAMBaseMac & 0xffff); |
623 |
+ |
*p16++ = htons(0x2448); // movea.l %a0,%a2 |
624 |
+ |
*p16++ = htons(M68K_NOP); |
625 |
+ |
FlushCodeCache(p + base + 4, 14); |
626 |
+ |
D(bug(" patch 1 applied\n")); |
627 |
+ |
} |
628 |
+ |
} |
629 |
+ |
#endif |
630 |
|
} |