This commit is contained in:
Zane Kaminski 2020-06-26 22:13:22 -04:00
parent a44f8668e9
commit 2181974aaf

80
rdisk.c
View File

@ -8,6 +8,76 @@
#include "rdisk.h" #include "rdisk.h"
const long RDiskIcon[65] = {
// Icon
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b11111111111111111111111111111111,
0b10000000000000000000000000000001,
0b10001111001111000001111001111001,
0b10001001001001000001001001001001,
0b10001001001001000001001001001001,
0b10001111001111000001111001111001,
0b11000000000000000000000000000001,
0b01010101010101011101010101010101,
0b01111111111111111111111111111111,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
// Mask
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0b11111111111111111111111111111111,
0b11111111111111111111111111111111,
0b11111111111111111111111111111111,
0b11111111111111111111111111111111,
0b11111111111111111111111111111111,
0b11111111111111111111111111111111,
0b11111111111111111111111111111111,
0b01111111111111111111111111111111,
0b01111111111111111111111111111111,
0b00000000000000000000000000000000,
0b00000000000000000000000000000000,
0
};
// Switch to 24-bit mode and copy. Call this with // Switch to 24-bit mode and copy. Call this with
// PC==0x408XXXXX, not PC==0x008XXXXX // PC==0x408XXXXX, not PC==0x008XXXXX
void RDiskCopy24(char *sourcePtr, char *destPtr, unsigned long byteCount) { void RDiskCopy24(char *sourcePtr, char *destPtr, unsigned long byteCount) {
@ -262,17 +332,21 @@ OSErr RDiskControl(CntrlParamPtr p, DCtlPtr d) {
c = *(RDiskStorage_t**)d->dCtlStorage; c = *(RDiskStorage_t**)d->dCtlStorage;
// Handle control request based on csCode // Handle control request based on csCode
switch (p->csCode) { switch (p->csCode) {
case accRun: case accRun: return noErr;
if (!d->dCtlStorage) { return noErr; } case 21: case 22:
return RDiskAccRun(p, d, c); *(Ptr*)&p->csParam = (Ptr)&RDiskIcon;
return noErr;
default: return controlErr; default: return controlErr;
} }
} }
#pragma parameter __D0 RDiskStatus(__A0, __A1) #pragma parameter __D0 RDiskStatus(__A0, __A1)
OSErr RDiskStatus(CntrlParamPtr p, DCtlPtr d) { OSErr RDiskStatus(CntrlParamPtr p, DCtlPtr d) {
RDiskStorage_t *c;
// Fail if dCtlStorage null // Fail if dCtlStorage null
if (!d->dCtlStorage) { return statusErr; } if (!d->dCtlStorage) { return statusErr; }
// Dereference dCtlStorage to get pointer to our context
c = *(RDiskStorage_t**)d->dCtlStorage;
// Handle status request based on csCode // Handle status request based on csCode
switch (p->csCode) { switch (p->csCode) {
case drvStsCode: case drvStsCode: