mirror of
https://github.com/garrettsworkshop/MacIIROMDiskDriver.git
synced 2025-01-13 11:30:03 +00:00
...
This commit is contained in:
parent
b4bc1d6f21
commit
3679761214
Binary file not shown.
BIN
bin/rom8M.bin
BIN
bin/rom8M.bin
Binary file not shown.
11
rdisk.c
11
rdisk.c
@ -53,12 +53,11 @@ void C24(Ptr sourcePtr, Ptr destPtr, unsigned long byteCount) {
|
||||
}
|
||||
|
||||
// Switch to 32-bit mode and patch
|
||||
#pragma parameter P24(__A0, __A1)
|
||||
void __attribute__ ((noinline)) P24(Ptr ptr, Ptr patch) {
|
||||
#pragma parameter P24(__A2, __D3)
|
||||
void __attribute__ ((noinline)) P24(Ptr ptr, char patch) {
|
||||
signed char mode = true32b;
|
||||
SwapMMUMode(&mode);
|
||||
if (*patch == 0x44) { Debugger(); }
|
||||
//*ptr = *patch; // Patch byte
|
||||
*ptr = patch; // Patch byte
|
||||
SwapMMUMode(&mode);
|
||||
}
|
||||
|
||||
@ -165,8 +164,8 @@ static void RDInit(IOParamPtr p, DCtlPtr d, RDiskStorage_t *c) {
|
||||
|
||||
// Patch debug and CD-ROM enable bytes
|
||||
if (c->ramdisk) {
|
||||
if (!dbgEN /*&& *RDiskDBGDisPos >= 0*/) { patch24(c->ramdisk + 0x00000031UL, RDiskDBGDisByte); }
|
||||
if (!cdrEN /*&& *RDiskCDRDisPos >= 0*/) { patch24(c->ramdisk + 0x00012CAFUL, RDiskCDRDisByte); }
|
||||
if (!dbgEN /*&& *RDiskDBGDisPos >= 0*/) { patch24(c->ramdisk + 0x00000031UL, 0x44); }
|
||||
if (!cdrEN /*&& *RDiskCDRDisPos >= 0*/) { patch24(c->ramdisk + 0x00012CAFUL, 0x44); }
|
||||
}
|
||||
|
||||
// Unmount if not booting from ROM disk
|
||||
|
4
rdisk.h
4
rdisk.h
@ -37,8 +37,8 @@ typedef struct RDiskStorage_s {
|
||||
typedef void (*RDiskCopy_t)(Ptr, Ptr, unsigned long);
|
||||
#define copy24(s, d, b) { RDiskCopy_t f = C24; f(s, d, b); }
|
||||
|
||||
typedef void (*RDiskPatch_t)(Ptr, Ptr);
|
||||
#define patch24(d, s) { RDiskPatch_t f = P24; f(d, s); }
|
||||
typedef void (*RDiskPatch_t)(Ptr, char);
|
||||
#define patch24(a, d) { RDiskPatch_t f = P24; f(a, d); }
|
||||
|
||||
#define PackBits_Repeat(count) (-1 * (count - 1))
|
||||
#define PackBits_Literal(count) (count - 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user