30 |
|
#include "disk.h" |
31 |
|
#include "cdrom.h" |
32 |
|
#include "video.h" |
33 |
+ |
#include "extfs.h" |
34 |
|
#include "prefs.h" |
35 |
|
#include "rom_patches.h" |
36 |
|
|
46 |
|
uint32 UniversalInfo; // ROM offset of UniversalInfo |
47 |
|
uint32 PutScrapPatch; // Mac address of PutScrap() patch |
48 |
|
|
49 |
< |
static uint32 sony_offset; // ROM offset of .Sony driver |
50 |
< |
static uint32 serd_offset; // ROM offset of SERD resource (serial drivers) |
51 |
< |
static uint32 microseconds_offset; // ROM offset of Microseconds() replacement routine |
49 |
> |
static uint32 sony_offset; // ROM offset of .Sony driver |
50 |
> |
static uint32 serd_offset; // ROM offset of SERD resource (serial drivers) |
51 |
> |
static uint32 microseconds_offset; // ROM offset of Microseconds() replacement routine |
52 |
|
static uint32 memory_dispatch_offset; // ROM offset of MemoryDispatch() replacement routine |
53 |
|
|
54 |
|
// Prototypes |
147 |
|
|
148 |
|
static const uint8 sony_driver[] = { // Replacement for .Sony driver |
149 |
|
// Driver header |
150 |
< |
SonyDriverFlags >> 8, SonyDriverFlags & 0xff, SonyDriverDelay >> 8, SonyDriverDelay & 0xff, 0x00, 0x00, 0x00, 0x00, |
150 |
> |
SonyDriverFlags >> 8, SonyDriverFlags & 0xff, 0, 0, 0, 0, 0, 0, |
151 |
|
0x00, 0x18, // Open() offset |
152 |
|
0x00, 0x1c, // Prime() offset |
153 |
|
0x00, 0x20, // Control() offset |
195 |
|
|
196 |
|
static const uint8 disk_driver[] = { // Generic disk driver |
197 |
|
// Driver header |
198 |
< |
DiskDriverFlags >> 8, DiskDriverFlags & 0xff, DiskDriverDelay >> 8, DiskDriverDelay & 0xff, 0x00, 0x00, 0x00, 0x00, |
198 |
> |
DiskDriverFlags >> 8, DiskDriverFlags & 0xff, 0, 0, 0, 0, 0, 0, |
199 |
|
0x00, 0x18, // Open() offset |
200 |
|
0x00, 0x1c, // Prime() offset |
201 |
|
0x00, 0x20, // Control() offset |
243 |
|
|
244 |
|
static const uint8 cdrom_driver[] = { // CD-ROM driver |
245 |
|
// Driver header |
246 |
< |
CDROMDriverFlags >> 8, CDROMDriverFlags & 0xff, CDROMDriverDelay >> 8, CDROMDriverDelay & 0xff, 0x00, 0x00, 0x00, 0x00, |
246 |
> |
CDROMDriverFlags >> 8, CDROMDriverFlags & 0xff, 0, 0, 0, 0, 0, 0, |
247 |
|
0x00, 0x1c, // Open() offset |
248 |
|
0x00, 0x20, // Prime() offset |
249 |
|
0x00, 0x24, // Control() offset |
556 |
|
uint32 dce = ReadMacInt32(r.a[0]); |
557 |
|
WriteMacInt32(dce + dCtlDriver, ROMBaseMac + sony_offset + 0x100); |
558 |
|
WriteMacInt16(dce + dCtlFlags, DiskDriverFlags); |
558 |
– |
WriteMacInt16(dce + dCtlDelay, DiskDriverDelay); |
559 |
|
|
560 |
|
// Open disk driver |
561 |
|
WriteMacInt32(pb + ioNamePtr, ROMBaseMac + sony_offset + 0x112); |
574 |
|
dce = ReadMacInt32(r.a[0]); |
575 |
|
WriteMacInt32(dce + dCtlDriver, ROMBaseMac + sony_offset + 0x200); |
576 |
|
WriteMacInt16(dce + dCtlFlags, CDROMDriverFlags); |
577 |
– |
WriteMacInt16(dce + dCtlDelay, CDROMDriverDelay); |
577 |
|
|
578 |
|
// Open CD-ROM driver |
579 |
|
WriteMacInt32(pb + ioNamePtr, ROMBaseMac + sony_offset + 0x212); |
647 |
|
r.a[0] = ROMBaseMac + memory_dispatch_offset; |
648 |
|
r.d[0] = 0xa05c; |
649 |
|
Execute68kTrap(0xa247, &r); // SetOSTrapAddress() |
650 |
+ |
|
651 |
+ |
// Install external file system |
652 |
+ |
InstallExtFS(); |
653 |
|
} |
654 |
|
|
655 |
|
|