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

Comparing SheepShaver/src/rom_patches.cpp (file contents):
Revision 1.11 by gbeauche, 2003-10-05T23:05:03Z vs.
Revision 1.15 by gbeauche, 2003-10-06T21:01:22Z

# Line 725 | Line 725 | bool PatchROM(void)
725          else
726                  return false;
727  
728 +        // Check that other ROM addresses point to really free regions
729 +        if (ntohl(*(uint32 *)(ROM_BASE + CHECK_LOAD_PATCH_SPACE)) != 0x6b636b63)
730 +                return false;
731 +        if (ntohl(*(uint32 *)(ROM_BASE + PUT_SCRAP_PATCH_SPACE)) != 0x6b636b63)
732 +                return false;
733 +        if (ntohl(*(uint32 *)(ROM_BASE + GET_SCRAP_PATCH_SPACE)) != 0x6b636b63)
734 +                return false;
735 +        if (ntohl(*(uint32 *)(ROM_BASE + ADDR_MAP_PATCH_SPACE)) != 0x6b636b63)
736 +                return false;
737 +
738          // Apply patches
739          if (!patch_nanokernel_boot()) return false;
740          if (!patch_68k_emul()) return false;
# Line 1842 | Line 1852 | static bool patch_68k(void)
1852          *wp = htons(M68K_RTS);
1853  
1854          // Don't install Time Manager task for 60Hz interrupt (Enable60HzInts, via 0x2b8)
1855 <        if (ROMType == ROMTYPE_NEWWORLD) {
1855 >        if (ROMType == ROMTYPE_NEWWORLD || ROMType == ROMTYPE_GOSSAMER) {
1856                  static const uint8 tm_task_dat[] = {0x30, 0x3c, 0x4e, 0x2b, 0xa9, 0xc9};
1857 <                if ((base = find_rom_data(0x2e0, 0x320, tm_task_dat, sizeof(tm_task_dat))) == 0) return false;
1857 >                if ((base = find_rom_data(0x2a0, 0x320, tm_task_dat, sizeof(tm_task_dat))) == 0) return false;
1858                  D(bug("tm_task %08lx\n", base));
1859 <                wp = (uint16 *)(ROM_BASE + base + 28); // FIXME: this is not right for all nw ROMs
1859 >                wp = (uint16 *)(ROM_BASE + base + 28);
1860                  *wp++ = htons(M68K_NOP);
1861                  *wp++ = htons(M68K_NOP);
1862                  *wp++ = htons(M68K_NOP);
1863                  *wp++ = htons(M68K_NOP);
1864                  *wp++ = htons(M68K_NOP);
1865                  *wp = htons(M68K_NOP);
1856        } else if (ROMType == ROMTYPE_GOSSAMER) {
1857                static const uint8 tm_task_dat[] = {0x30, 0x3c, 0x4e, 0x2b, 0xa9, 0xc9};
1858                if ((base = find_rom_data(0x2a0, 0x2e0, tm_task_dat, sizeof(tm_task_dat))) == 0) return false;
1859                D(bug("tm_task %08lx\n", base));
1860                wp = (uint16 *)(ROM_BASE + base + 22);
1861                *wp++ = htons(M68K_NOP);
1862                *wp++ = htons(M68K_NOP);
1863                *wp++ = htons(M68K_NOP);
1866          } else {
1867                  static const uint8 tm_task_dat[] = {0x20, 0x3c, 0x73, 0x79, 0x73, 0x61};
1868                  if ((base = find_rom_data(0x280, 0x300, tm_task_dat, sizeof(tm_task_dat))) == 0) return false;
# Line 2238 | Line 2240 | void InstallDrivers(void)
2240          uint8 pb[SIZEOF_IOParam];
2241  
2242          // Install floppy driver
2243 <        if (ROMType == ROMTYPE_NEWWORLD) {
2243 >        if (ROMType == ROMTYPE_NEWWORLD || ROMType == ROMTYPE_GOSSAMER) {
2244  
2245 <                // Force installation of floppy driver with NewWorld ROMs
2245 >                // Force installation of floppy driver with NewWorld and Gossamer ROMs
2246                  r.a[0] = ROM_BASE + sony_offset;
2247                  r.d[0] = (uint32)SonyRefNum;
2248                  Execute68kTrap(0xa43d, &r);             // DrvrInstallRsrvMem()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines