44 |
|
uint32 ROMBreakpoint = 0; // ROM offset of breakpoint (0 = disabled, 0x2310 = CritError) |
45 |
|
bool PrintROMInfo = false; // Flag: print ROM information in PatchROM() |
46 |
|
|
47 |
< |
static uint32 sony_offset; // ROM offset of .Sony driver |
48 |
< |
static uint32 serd_offset; // ROM offset of SERD resource (serial drivers) |
49 |
< |
static uint32 microseconds_offset; // ROM offset of Microseconds() replacement routine |
47 |
> |
static uint32 sony_offset; // ROM offset of .Sony driver |
48 |
> |
static uint32 serd_offset; // ROM offset of SERD resource (serial drivers) |
49 |
> |
static uint32 microseconds_offset; // ROM offset of Microseconds() replacement routine |
50 |
> |
static uint32 debugutil_offset; // ROM offset of DebugUtil() replacement routine |
51 |
|
|
52 |
|
// Prototypes |
53 |
|
uint16 ROMVersion; |
702 |
|
r.d[0] = 0xa093; |
703 |
|
Execute68kTrap(0xa247, &r); // SetOSTrapAddress() |
704 |
|
|
705 |
+ |
// Install DebugUtil() replacement routine |
706 |
+ |
r.a[0] = ROMBaseMac + debugutil_offset; |
707 |
+ |
r.d[0] = 0xa08d; |
708 |
+ |
Execute68kTrap(0xa247, &r); // SetOSTrapAddress() |
709 |
+ |
|
710 |
|
// Install disk driver |
711 |
|
r.a[0] = ROMBaseMac + sony_offset + 0x100; |
712 |
|
r.d[0] = (uint32)DiskRefNum; |
936 |
|
*wp++ = htons(M68K_RTS); |
937 |
|
microseconds_offset = (uint8 *)wp - ROMBaseHost; |
938 |
|
*wp++ = htons(M68K_EMUL_OP_MICROSECONDS); |
939 |
+ |
*wp++ = htons(M68K_RTS); |
940 |
+ |
|
941 |
+ |
// Replace DebugUtil |
942 |
+ |
debugutil_offset = (uint8 *)wp - ROMBaseHost; |
943 |
+ |
*wp++ = htons(M68K_EMUL_OP_DEBUGUTIL); |
944 |
|
*wp = htons(M68K_RTS); |
945 |
|
|
946 |
|
// Replace SCSIDispatch() |
1203 |
|
*wp = htons(M68K_RTS); |
1204 |
|
|
1205 |
|
// Fake CPU speed test (SetupTimeK) |
1206 |
+ |
// *** increased jl : MacsBug uses TimeDBRA for kbd repeat timing |
1207 |
|
wp = (uint16 *)(ROMBaseHost + 0x800); |
1208 |
|
*wp++ = htons(0x31fc); // move.w #xxx,TimeDBRA |
1209 |
< |
*wp++ = htons(100); |
1209 |
> |
*wp++ = htons(10000); |
1210 |
|
*wp++ = htons(0x0d00); |
1211 |
|
*wp++ = htons(0x31fc); // move.w #xxx,TimeSCCDBRA |
1212 |
< |
*wp++ = htons(100); |
1212 |
> |
*wp++ = htons(10000); |
1213 |
|
*wp++ = htons(0x0d02); |
1214 |
|
*wp++ = htons(0x31fc); // move.w #xxx,TimeSCSIDBRA |
1215 |
< |
*wp++ = htons(100); |
1215 |
> |
*wp++ = htons(10000); |
1216 |
|
*wp++ = htons(0x0b24); |
1217 |
|
*wp++ = htons(0x31fc); // move.w #xxx,TimeRAMDBRA |
1218 |
< |
*wp++ = htons(100); |
1218 |
> |
*wp++ = htons(10000); |
1219 |
|
*wp++ = htons(0x0cea); |
1220 |
|
*wp = htons(M68K_RTS); |
1221 |
|
|
1227 |
|
#endif |
1228 |
|
|
1229 |
|
#if !ROM_IS_WRITE_PROTECTED |
1230 |
< |
#if defined(AMIGA) || defined(__NetBSD__) |
1230 |
> |
#if defined(AMIGA) |
1231 |
|
// Set fake handle at 0x0000 to scratch memory area (so broken Mac programs won't write into Mac ROM) |
1232 |
|
extern uint32 ScratchMem; |
1233 |
|
wp = (uint16 *)(ROMBaseHost + 0xccaa); |
1538 |
|
*wp++ = htons(M68K_RTS); |
1539 |
|
microseconds_offset = (uint8 *)wp - ROMBaseHost; |
1540 |
|
*wp++ = htons(M68K_EMUL_OP_MICROSECONDS); |
1541 |
+ |
*wp++ = htons(M68K_RTS); |
1542 |
+ |
|
1543 |
+ |
// Replace DebugUtil |
1544 |
+ |
debugutil_offset = (uint8 *)wp - ROMBaseHost; |
1545 |
+ |
*wp++ = htons(M68K_EMUL_OP_DEBUGUTIL); |
1546 |
|
*wp = htons(M68K_RTS); |
1547 |
|
|
1548 |
|
// Replace SCSIDispatch() |