--- BasiliskII/src/rom_patches.cpp 2001/02/10 11:37:42 1.20 +++ BasiliskII/src/rom_patches.cpp 2004/11/15 23:27:43 1.24 @@ -1,7 +1,7 @@ /* * rom_patches.cpp - ROM patches * - * Basilisk II (C) 1997-2001 Christian Bauer + * Basilisk II (C) 1997-2004 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,6 +41,7 @@ // Global variables uint32 UniversalInfo; // ROM offset of UniversalInfo uint32 PutScrapPatch; // Mac address of PutScrap() patch +uint32 GetScrapPatch = 0; // Mac address of GetScrap() patch uint32 ROMBreakpoint = 0; // ROM offset of breakpoint (0 = disabled, 0x2310 = CritError) bool PrintROMInfo = false; // Flag: print ROM information in PatchROM() bool PatchHWBases = true; // Flag: patch hardware base addresses @@ -998,7 +999,9 @@ static bool patch_rom_classic(void) *wp++ = htons(M68K_NOP); *wp = htons(M68K_NOP); - wp = (uint16 *)(ROMBaseHost + 0x2be8); // 60Hz handler (handles everything) + wp = (uint16 *)(ROMBaseHost + 0x2be4); // 60Hz handler (handles everything) + *wp++ = htons(M68K_NOP); + *wp++ = htons(M68K_NOP); *wp++ = htons(M68K_EMUL_OP_IRQ); *wp++ = htons(0x4a80); // tst.l d0 *wp = htons(0x67f4); // beq 0x402be2 @@ -1623,6 +1626,15 @@ static bool patch_rom_32(void) *wp++ = htons(base >> 16); *wp = htons(base & 0xffff); + // Install GetScrap() patch for clipboard data exchange (the patch is activated by EMUL_OP_INSTALL_DRIVERS) + GetScrapPatch = ROMBaseMac + sony_offset + 0xd00; + base = ROMBaseMac + find_rom_trap(0xa9fd); + wp = (uint16 *)(ROMBaseHost + sony_offset + 0xd00); + *wp++ = htons(M68K_EMUL_OP_GET_SCRAP); + *wp++ = htons(M68K_JMP); + *wp++ = htons(base >> 16); + *wp = htons(base & 0xffff); + // Look for double PACK 4 resources if ((base = find_rom_resource(FOURCC('P','A','C','K'), 4)) == 0) return false; if ((base = find_rom_resource(FOURCC('P','A','C','K'), 4, true)) == 0 && FPUType == 0) @@ -1636,7 +1648,9 @@ static bool patch_rom_32(void) *wp++ = htons(M68K_NOP); *wp = htons(M68K_NOP); - wp = (uint16 *)(ROMBaseHost + 0xa29a); // 60Hz handler (handles everything) + wp = (uint16 *)(ROMBaseHost + 0xa296); // 60Hz handler (handles everything) + *wp++ = htons(M68K_NOP); + *wp++ = htons(M68K_NOP); *wp++ = htons(M68K_EMUL_OP_IRQ); *wp++ = htons(0x4a80); // tst.l d0 *wp = htons(0x67f4); // beq 0x4080a294