2020-07-16 06:27:38 +00:00
|
|
|
#ifndef RDISK_H
|
|
|
|
#define RDISK_H
|
2020-06-24 17:10:44 +00:00
|
|
|
|
2020-06-26 07:12:08 +00:00
|
|
|
#define RDiskBuf ((char*)0x40880000)
|
|
|
|
#define BufPtr ((Ptr*)0x10C)
|
|
|
|
#define MemTop ((Ptr*)0x108)
|
|
|
|
#define MMU32bit ((char*)0xCB2)
|
|
|
|
|
2021-07-08 06:08:54 +00:00
|
|
|
#define RDiskDBGDisPos (*(const unsigned long*)0x40851D98)
|
|
|
|
#define RDiskCDRDisPos (*(const unsigned long*)0x40851D9C)
|
|
|
|
#define RDiskDBGDisByte (*(const char*)0x40851DA8)
|
|
|
|
#define RDiskCDRDisByte (*(const char*)0x40851DA9)
|
|
|
|
#define RDiskSize (*(const unsigned long*)0x40851DAC)
|
|
|
|
|
2021-04-02 03:24:19 +00:00
|
|
|
#define RDISK_COMPRESS_ICON_ENABLE
|
|
|
|
|
2021-08-16 22:06:03 +00:00
|
|
|
static inline char IsAPressed() { return *((volatile char*)0x174) & 0x01; }
|
|
|
|
static inline char IsRPressed() { return *((volatile char*)0x175) & 0x80; }
|
2020-06-26 07:12:08 +00:00
|
|
|
|
2020-07-16 06:27:38 +00:00
|
|
|
#define RDISK_ICON_SIZE (285)
|
2020-06-27 19:53:56 +00:00
|
|
|
typedef struct RDiskStorage_s {
|
|
|
|
DrvSts2 status;
|
2021-12-26 23:10:23 +00:00
|
|
|
|
2020-06-30 01:08:50 +00:00
|
|
|
char initialized;
|
2021-12-26 23:10:23 +00:00
|
|
|
|
|
|
|
char unmountEN;
|
|
|
|
char mountEN;
|
|
|
|
char ramEN;
|
|
|
|
char dbgEN;
|
|
|
|
char cdrEN;
|
|
|
|
|
2020-07-02 07:06:35 +00:00
|
|
|
Ptr ramdisk;
|
2021-12-26 23:10:23 +00:00
|
|
|
|
2021-04-02 07:51:40 +00:00
|
|
|
char dbgDisByte;
|
|
|
|
char cdrDisByte;
|
2021-12-26 23:10:23 +00:00
|
|
|
|
2020-07-15 06:24:45 +00:00
|
|
|
#ifdef RDISK_COMPRESS_ICON_ENABLE
|
2021-04-02 10:41:18 +00:00
|
|
|
char icon[RDISK_ICON_SIZE+8];
|
2020-07-12 02:41:51 +00:00
|
|
|
#endif
|
2020-07-02 07:06:35 +00:00
|
|
|
} RDiskStorage_t;
|
|
|
|
|
2021-04-01 07:46:40 +00:00
|
|
|
typedef void (*RDiskCopy_t)(Ptr, Ptr, unsigned long);
|
2021-04-02 05:16:47 +00:00
|
|
|
#define copy24(s, d, b) { RDiskCopy_t f = C24; f(s, d, b); }
|
|
|
|
|
2020-07-16 06:27:38 +00:00
|
|
|
#define PackBits_Repeat(count) (-1 * (count - 1))
|
2020-07-12 02:41:51 +00:00
|
|
|
#define PackBits_Literal(count) (count - 1)
|
2020-07-02 07:06:35 +00:00
|
|
|
|
2020-07-16 06:27:38 +00:00
|
|
|
#define RDISK_COMPRESSED_ICON_SIZE (87)
|
2020-07-15 06:26:28 +00:00
|
|
|
#ifdef RDISK_COMPRESS_ICON_ENABLE
|
|
|
|
#include <Quickdraw.h>
|
2021-04-02 04:42:33 +00:00
|
|
|
const char RDiskIconCompressed[RDISK_COMPRESSED_ICON_SIZE] = {
|
2020-07-15 06:26:28 +00:00
|
|
|
PackBits_Repeat(76), 0b00000000, /*
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000, */
|
|
|
|
PackBits_Repeat(4), 0b11111111, /*
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111, */
|
2020-07-16 06:27:38 +00:00
|
|
|
PackBits_Literal(36),
|
2020-07-15 06:26:28 +00:00
|
|
|
0b10000000, 0b00000000, 0b00000000, 0b00000001,
|
|
|
|
0b10001111, 0b00011110, 0b00111100, 0b01111001,
|
|
|
|
0b10001001, 0b00010010, 0b00100100, 0b01001001,
|
|
|
|
0b10001001, 0b00010010, 0b00100100, 0b01001001,
|
|
|
|
0b10001001, 0b00010010, 0b00100100, 0b01001001,
|
|
|
|
0b10001111, 0b00011110, 0b00111100, 0b01111001,
|
|
|
|
0b11000000, 0b00000000, 0b00000000, 0b00000001,
|
|
|
|
0b01010101, 0b01010101, 0b11010101, 0b01010101,
|
|
|
|
0b01111111, 0b11111111, 0b01111111, 0b11111111,
|
|
|
|
PackBits_Repeat(12), 0b00000000, /*
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000, */
|
|
|
|
|
|
|
|
PackBits_Repeat(76), 0b00000000, /*
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000, */
|
|
|
|
PackBits_Repeat(32), 0b11111111, /*
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111, */
|
2020-07-16 06:27:38 +00:00
|
|
|
PackBits_Literal(1), 0b01111111,
|
|
|
|
PackBits_Repeat(3), 0b11111111, /*
|
|
|
|
0b01111111, 0b11111111, 0b11111111, 0b11111111, */
|
|
|
|
PackBits_Literal(1), 0b01111111,
|
|
|
|
PackBits_Repeat(3), 0b11111111, /*
|
|
|
|
0b01111111, 0b11111111, 0b11111111, 0b11111111, */
|
2020-07-15 06:26:28 +00:00
|
|
|
PackBits_Repeat(12), 0b00000000, /*
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000, */
|
2020-07-16 06:27:38 +00:00
|
|
|
PackBits_Literal(29),
|
2020-07-15 06:26:28 +00:00
|
|
|
27, 'G', 'a', 'r', 'r', 'e', 't', 't', '\'', 's', ' ',
|
|
|
|
'W', 'o', 'r', 'k', 's', 'h', 'o', 'p', ' ',
|
|
|
|
'R', 'O', 'M', ' ', 'D', 'i', 's', 'k', 0
|
|
|
|
};
|
|
|
|
#else
|
2021-03-04 20:22:34 +00:00
|
|
|
const char RDiskIcon[RDISK_ICON_SIZE] = {
|
2020-07-15 06:26:28 +00:00
|
|
|
// Icon
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b10000000, 0b00000000, 0b00000000, 0b00000001,
|
|
|
|
0b10001111, 0b00011110, 0b00111100, 0b01111001,
|
|
|
|
0b10001001, 0b00010010, 0b00100100, 0b01001001,
|
|
|
|
0b10001001, 0b00010010, 0b00100100, 0b01001001,
|
|
|
|
0b10001001, 0b00010010, 0b00100100, 0b01001001,
|
|
|
|
0b10001111, 0b00011110, 0b00111100, 0b01111001,
|
|
|
|
0b11000000, 0b00000000, 0b00000000, 0b00000001,
|
|
|
|
0b01010101, 0b01010101, 0b11010101, 0b01010101,
|
|
|
|
0b01111111, 0b11111111, 0b01111111, 0b11111111,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
// Mask
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b11111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b01111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b01111111, 0b11111111, 0b11111111, 0b11111111,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
0b00000000, 0b00000000, 0b00000000, 0b00000000,
|
|
|
|
27, 'G', 'a', 'r', 'r', 'e', 't', 't', '\'', 's', ' ',
|
|
|
|
'W', 'o', 'r', 'k', 's', 'h', 'o', 'p', ' ',
|
|
|
|
'R', 'O', 'M', ' ', 'D', 'i', 's', 'k', 0
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2020-06-24 20:57:39 +00:00
|
|
|
#endif
|