From 2181974aaf372a158cfa4b7b890dfbd6b42e2ea2 Mon Sep 17 00:00:00 2001 From: Zane Kaminski Date: Fri, 26 Jun 2020 22:13:22 -0400 Subject: [PATCH] Add icon --- rdisk.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 77 insertions(+), 3 deletions(-) diff --git a/rdisk.c b/rdisk.c index 5c5a66c..36b50f3 100644 --- a/rdisk.c +++ b/rdisk.c @@ -8,6 +8,76 @@ #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 // PC==0x408XXXXX, not PC==0x008XXXXX void RDiskCopy24(char *sourcePtr, char *destPtr, unsigned long byteCount) { @@ -262,17 +332,21 @@ OSErr RDiskControl(CntrlParamPtr p, DCtlPtr d) { c = *(RDiskStorage_t**)d->dCtlStorage; // Handle control request based on csCode switch (p->csCode) { - case accRun: - if (!d->dCtlStorage) { return noErr; } - return RDiskAccRun(p, d, c); + case accRun: return noErr; + case 21: case 22: + *(Ptr*)&p->csParam = (Ptr)&RDiskIcon; + return noErr; default: return controlErr; } } #pragma parameter __D0 RDiskStatus(__A0, __A1) OSErr RDiskStatus(CntrlParamPtr p, DCtlPtr d) { + RDiskStorage_t *c; // Fail if dCtlStorage null if (!d->dCtlStorage) { return statusErr; } + // Dereference dCtlStorage to get pointer to our context + c = *(RDiskStorage_t**)d->dCtlStorage; // Handle status request based on csCode switch (p->csCode) { case drvStsCode: