--- BasiliskII/src/rom_patches.cpp 2004/01/12 15:29:22 1.23 +++ BasiliskII/src/rom_patches.cpp 2010/02/21 12:00:01 1.28 @@ -1,7 +1,7 @@ /* * rom_patches.cpp - ROM patches * - * Basilisk II (C) 1997-2004 Christian Bauer + * Basilisk II (C) 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 @@ -40,7 +40,8 @@ // Global variables uint32 UniversalInfo; // ROM offset of UniversalInfo -uint32 PutScrapPatch; // Mac address of PutScrap() patch +uint32 PutScrapPatch = 0; // 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 @@ -183,7 +184,7 @@ static void list_rom_resources(void) // Mapping of Model IDs to Model names struct mac_desc { - char *name; + const char *name; int32 id; }; @@ -257,7 +258,7 @@ static void print_universal_info(uint32 uint16 rom85 = ReadMacInt16(info + 20); // Find model name - char *name = "unknown"; + const char *name = "unknown"; for (int i=0; MacDesc[i].id >= 0; i++) if (MacDesc[i].id == id + 6) { name = MacDesc[i].name; @@ -1624,6 +1625,15 @@ static bool patch_rom_32(void) *wp++ = htons(M68K_JMP); *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;