1 |
|
/* |
2 |
|
* rom_patches.cpp - ROM patches |
3 |
|
* |
4 |
< |
* SheepShaver (C) 1997-2004 Christian Bauer and Marc Hellwig |
4 |
> |
* SheepShaver (C) 1997-2005 Christian Bauer and Marc Hellwig |
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 |
1413 |
|
*lp = htonl(POWERPC_NOP); |
1414 |
|
|
1415 |
|
// Disable suspend (FE0F opcode) |
1416 |
< |
// TODO: really suspend SheepShaver |
1416 |
> |
// TODO: really suspend SheepShaver? |
1417 |
|
static const uint8 suspend_dat[] = {0x7c, 0x88, 0x68, 0x39, 0x41, 0x9d}; |
1418 |
|
if ((base = find_rom_data(0x315000, 0x316000, suspend_dat, sizeof(suspend_dat))) == 0) return false; |
1419 |
|
D(bug("suspend %08lx\n", base)); |
1420 |
< |
lp = (uint32 *)(ROMBaseHost + base + 8); |
1420 |
> |
lp = (uint32 *)(ROMBaseHost + base + 4); |
1421 |
|
*lp = htonl((ntohl(*lp) & 0xffff) | 0x48000000); // bgt -> b |
1422 |
|
|
1423 |
|
// Patch trap return routine |
2344 |
|
SheepArray<SIZEOF_IOParam> pb_var; |
2345 |
|
const uintptr pb = pb_var.addr(); |
2346 |
|
|
2347 |
+ |
#if DISABLE_SCSI |
2348 |
+ |
// Setup fake SCSI Globals |
2349 |
+ |
r.d[0] = 0x1000; |
2350 |
+ |
Execute68kTrap(0xa71e, &r); // NewPtrSysClear() |
2351 |
+ |
uint32 scsi_globals = r.a[0]; |
2352 |
+ |
D(bug("Fake SCSI globals at %08lx\n", scsi_globals)); |
2353 |
+ |
WriteMacInt32(0xc0c, scsi_globals); // Set SCSIGlobals |
2354 |
+ |
#endif |
2355 |
+ |
|
2356 |
|
// Install floppy driver |
2357 |
|
if (ROMType == ROMTYPE_NEWWORLD || ROMType == ROMTYPE_GOSSAMER) { |
2358 |
|
|
2367 |
|
WriteMacInt16(dce + dCtlFlags, SonyDriverFlags); |
2368 |
|
} |
2369 |
|
|
2361 |
– |
#if DISABLE_SCSI && HAVE_SIGSEGV_SKIP_INSTRUCTION |
2362 |
– |
// Fake SCSIGlobals |
2363 |
– |
WriteMacInt32(0xc0c, SheepMem::ZeroPage()); |
2364 |
– |
#endif |
2365 |
– |
|
2370 |
|
// Open .Sony driver |
2371 |
|
SheepString sony_str("\005.Sony"); |
2372 |
|
WriteMacInt8(pb + ioPermssn, 0); |