ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/rom_patches.cpp
(Generate patch)

Comparing BasiliskII/src/rom_patches.cpp (file contents):
Revision 1.20 by gbeauche, 2001-02-10T11:37:42Z vs.
Revision 1.28 by cebix, 2010-02-21T12:00:01Z

# Line 1 | Line 1
1   /*
2   *  rom_patches.cpp - ROM patches
3   *
4 < *  Basilisk II (C) 1997-2001 Christian Bauer
4 > *  Basilisk II (C) Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 40 | Line 40
40  
41   // Global variables
42   uint32 UniversalInfo;           // ROM offset of UniversalInfo
43 < uint32 PutScrapPatch;           // Mac address of PutScrap() patch
43 > uint32 PutScrapPatch = 0;       // Mac address of PutScrap() patch
44 > uint32 GetScrapPatch = 0;       // Mac address of GetScrap() patch
45   uint32 ROMBreakpoint = 0;       // ROM offset of breakpoint (0 = disabled, 0x2310 = CritError)
46   bool PrintROMInfo = false;      // Flag: print ROM information in PatchROM()
47   bool PatchHWBases = true;       // Flag: patch hardware base addresses
# Line 183 | Line 184 | static void list_rom_resources(void)
184  
185   // Mapping of Model IDs to Model names
186   struct mac_desc {
187 <        char *name;
187 >        const char *name;
188          int32 id;
189   };
190  
# Line 257 | Line 258 | static void print_universal_info(uint32
258          uint16 rom85 = ReadMacInt16(info + 20);
259  
260          // Find model name
261 <        char *name = "unknown";
261 >        const char *name = "unknown";
262          for (int i=0; MacDesc[i].id >= 0; i++)
263                  if (MacDesc[i].id == id + 6) {
264                          name = MacDesc[i].name;
# Line 998 | Line 999 | static bool patch_rom_classic(void)
999          *wp++ = htons(M68K_NOP);
1000          *wp = htons(M68K_NOP);
1001  
1002 <        wp = (uint16 *)(ROMBaseHost + 0x2be8);  // 60Hz handler (handles everything)
1002 >        wp = (uint16 *)(ROMBaseHost + 0x2be4);  // 60Hz handler (handles everything)
1003 >        *wp++ = htons(M68K_NOP);
1004 >        *wp++ = htons(M68K_NOP);
1005          *wp++ = htons(M68K_EMUL_OP_IRQ);
1006          *wp++ = htons(0x4a80);          // tst.l        d0
1007          *wp = htons(0x67f4);            // beq          0x402be2
# Line 1623 | Line 1626 | static bool patch_rom_32(void)
1626          *wp++ = htons(base >> 16);
1627          *wp = htons(base & 0xffff);
1628  
1629 +        // Install GetScrap() patch for clipboard data exchange (the patch is activated by EMUL_OP_INSTALL_DRIVERS)
1630 +        GetScrapPatch = ROMBaseMac + sony_offset + 0xd00;
1631 +        base = ROMBaseMac + find_rom_trap(0xa9fd);
1632 +        wp = (uint16 *)(ROMBaseHost + sony_offset + 0xd00);
1633 +        *wp++ = htons(M68K_EMUL_OP_GET_SCRAP);
1634 +        *wp++ = htons(M68K_JMP);
1635 +        *wp++ = htons(base >> 16);
1636 +        *wp = htons(base & 0xffff);
1637 +
1638          // Look for double PACK 4 resources
1639          if ((base = find_rom_resource(FOURCC('P','A','C','K'), 4)) == 0) return false;
1640          if ((base = find_rom_resource(FOURCC('P','A','C','K'), 4, true)) == 0 && FPUType == 0)
# Line 1636 | Line 1648 | static bool patch_rom_32(void)
1648          *wp++ = htons(M68K_NOP);
1649          *wp = htons(M68K_NOP);
1650  
1651 <        wp = (uint16 *)(ROMBaseHost + 0xa29a);  // 60Hz handler (handles everything)
1651 >        wp = (uint16 *)(ROMBaseHost + 0xa296);  // 60Hz handler (handles everything)
1652 >        *wp++ = htons(M68K_NOP);
1653 >        *wp++ = htons(M68K_NOP);
1654          *wp++ = htons(M68K_EMUL_OP_IRQ);
1655          *wp++ = htons(0x4a80);          // tst.l        d0
1656          *wp = htons(0x67f4);            // beq          0x4080a294

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines