1240 |
|
#endif |
1241 |
|
|
1242 |
|
#if !ROM_IS_WRITE_PROTECTED |
1243 |
< |
#if defined(AMIGA) || defined(USE_SCRATCHMEM_SUBTERFUGE) |
1243 |
> |
#if defined(USE_SCRATCHMEM_SUBTERFUGE) |
1244 |
|
// Set fake handle at 0x0000 to scratch memory area (so broken Mac programs won't write into Mac ROM) |
1245 |
|
extern uint8 *ScratchMem; |
1246 |
|
const uint32 ScratchMemBase = Host2MacAddr(ScratchMem); |
1462 |
|
if (ROMSize > 0x80000) { |
1463 |
|
|
1464 |
|
// BlockMove() |
1465 |
< |
static const uint8 ptest_dat[] = {0xa0, 0x8d, 0x0c, 0x81, 0x00, 0x00, 0x0c, 0x00, 0x6d, 0x06, 0x4e, 0x71, 0xf4, 0xf8}; |
1466 |
< |
base = find_rom_data(0x87000, 0x87800, ptest_dat, sizeof(ptest_dat)); |
1467 |
< |
D(bug("ptest %08lx\n", base)); |
1465 |
> |
static const uint8 bmove_dat[] = {0x20, 0x5f, 0x22, 0x5f, 0x0c, 0x38, 0x00, 0x04, 0x01, 0x2f}; |
1466 |
> |
base = find_rom_data(0x87000, 0x87800, bmove_dat, sizeof(bmove_dat)); |
1467 |
> |
D(bug("block_move %08lx\n", base)); |
1468 |
|
if (base) { // ROM15/22/23/26/27/32 |
1469 |
< |
wp = (uint16 *)(ROMBaseHost + base + 8); |
1470 |
< |
*wp = htons(M68K_NOP); |
1469 |
> |
wp = (uint16 *)(ROMBaseHost + base + 4); |
1470 |
> |
*wp++ = htons(M68K_EMUL_OP_BLOCK_MOVE); |
1471 |
> |
*wp++ = htons(0x7000); |
1472 |
> |
*wp = htons(M68K_RTS); |
1473 |
|
} |
1474 |
|
|
1475 |
|
// SANE |
1601 |
|
*wp++ = htons(base >> 16); |
1602 |
|
*wp = htons(base & 0xffff); |
1603 |
|
|
1602 |
– |
#if EMULATED_68K |
1603 |
– |
// Replace BlockMove() |
1604 |
– |
wp = (uint16 *)(ROMBaseHost + find_rom_trap(0xa02e)); // BlockMove() |
1605 |
– |
*wp++ = htons(M68K_EMUL_OP_BLOCK_MOVE); |
1606 |
– |
*wp++ = htons(0x7000); |
1607 |
– |
*wp = htons(M68K_RTS); |
1608 |
– |
#endif |
1609 |
– |
|
1604 |
|
// Look for double PACK 4 resources |
1605 |
|
if ((base = find_rom_resource(FOURCC('P','A','C','K'), 4)) == 0) return false; |
1606 |
|
if ((base = find_rom_resource(FOURCC('P','A','C','K'), 4, true)) == 0 && FPUType == 0) |