#ifndef RDTRAPS_H #define RDTRAPS_H #define RDiskSize (0x00180000L) #define RDiskBuf ((char*)0x40880000) #define BufPtr ((Ptr*)0x10C) #define MemTop ((Ptr*)0x108) #define MMU32bit ((char*)0xCB2) #define JIODone ((char*)0x8FC) #pragma parameter __D0 RDiskReadXPRAM(__D0, __D1, __A0) OSErr RDiskReadXPRAM(short numBytes, short whichByte, void *dest) = {0x4840, 0x3001, 0xA051}; // Other definition of RDiskAddDrive with register calling convention //#pragma parameter __D0 RDiskAddDrive(__D1, __D0, __A0) //OSErr RDiskAddDrive(short numBytes, short whichByte, void *dest) = {0x4840, 0x3001, 0xA04E}; OSErr RDiskAddDrive(short drvrRefNum, short drvNum, DrvQElPtr dq) { __asm__ __volatile__ ( "clr.l %%D0 \n\t" "move.w %1,%%D0 \n\t" "swap %%D0 \n\t" "move.w %0,%%D0 \n\t" "movea.l %2,%%A0 \n\t" ".word 0xA04E \n\t" : /* outputs */ : "g"(drvrRefNum), "g"(drvNum), "g"(dq) /* inputs */ : /* clobbered */); } inline char RDiskIsRPressed() { return *((char*)0x175) & 0x80; } inline char RDiskIsAPressed() { return *((char*)0x174) & 0x01; } void RDiskBreak() = { 0xA9FF }; typedef void (*RDiskCopy_t)(Ptr, Ptr, unsigned long); //#define RDISK_COMPRESS_ICON_ENABLE typedef struct RDiskStorage_s { DrvSts2 status; char initialized; char installed; char postBoot; Ptr ramdisk; #ifdef RDISK_COMPRESS_ICON_ENABLE char icon[285]; #endif } RDiskStorage_t; #define copy24(s, d, b) { RDiskCopy_t copy24 = (RDiskCopy_t)RDiskCopy24; copy24(s, d, b); } #define PackBits_Repeat(count) ((-1) * (count - 1)) #define PackBits_Literal(count) (count - 1) #ifdef RDISK_COMPRESS_ICON_ENABLE #include const char const RDiskIconCompressed[92] = { 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, */ PackBits_Literal(40), 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, 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, */ PackBits_Literal(8), 0b01111111, 0b11111111, 0b11111111, 0b11111111, 0b01111111, 0b11111111, 0b11111111, 0b11111111, PackBits_Repeat(12), 0b00000000, /* 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, */ (29 - 1), 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 const char const RDiskIcon[285] = { // 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 #endif