ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/Frodo4/Src/IEC.h
(Generate patch)

Comparing Frodo4/Src/IEC.h (file contents):
Revision 1.6 by cebix, 2004-01-14T16:54:46Z vs.
Revision 1.7 by cebix, 2004-01-14T17:26:29Z

# Line 22 | Line 22
22   #define _IEC_H
23  
24  
25 + /*
26 + *  Definitions
27 + */
28 +
29   // Maximum length of file names
30   const int NAMEBUF_LENGTH = 256;
31  
28
32   // C64 status codes
33   enum {
34          ST_OK = 0,                              // No error
# Line 35 | Line 38 | enum {
38          ST_NOTPRESENT = 0x80    // Device not present
39   };
40  
38
41   // 1541 error codes
42   enum {
43          ERR_OK,                         // 00 OK
# Line 70 | Line 72 | enum {
72          ERR_NOTREADY            // 74 DRIVE NOT READY
73   };
74  
75 + // Mountable file types
76 + enum {
77 +        FILE_IMAGE,                     // Disk image, handled by ImageDrive
78 +        FILE_ARCH                       // Archive file, handled by ArchDrive
79 + };
80  
81   // 1541 file types
82   enum {
# Line 83 | Line 90 | enum {
90  
91   static const char ftype_char[9] = "DSPUL   ";
92  
86
93   // 1541 file access modes
94   enum {
95          FMODE_READ,                     // Read
# Line 92 | Line 98 | enum {
98          FMODE_M                         // Read open file
99   };
100  
95
96 // IEC command codes
97 enum {
98        CMD_DATA = 0x60,        // Data transfer
99        CMD_CLOSE = 0xe0,       // Close channel
100        CMD_OPEN = 0xf0         // Open channel
101 };
102
103
104 // IEC ATN codes
105 enum {
106        ATN_LISTEN = 0x20,
107        ATN_UNLISTEN = 0x30,
108        ATN_TALK = 0x40,
109        ATN_UNTALK = 0x50
110 };
111
112
101   // Drive LED states
102   enum {
103          DRVLED_OFF,             // Inactive, LED off
# Line 117 | Line 105 | enum {
105          DRVLED_ERROR    // Error, blink LED
106   };
107  
120
108   // Information about file in disk image/archive file
109   struct c64_dir_entry {
110          c64_dir_entry(const uint8 *n, int t, bool o, bool p, size_t s, off_t ofs = 0, uint8 sal = 0, uint8 sah = 0)
# Line 139 | Line 126 | struct c64_dir_entry {
126          uint8 sa_lo, sa_hi;     // C64 start address
127   };
128  
142
129   class Drive;
130   class C64Display;
131   class Prefs;
# Line 164 | Line 150 | public:
150          void Release(void);
151  
152   private:
153 +        Drive *create_drive(const char *path);
154 +
155          uint8 listen(int device);
156          uint8 talk(int device);
157          uint8 unlisten(void);
# Line 193 | Line 181 | private:
181          uint8 sec_addr;                 // Received secondary address ($0x)
182   };
183  
196
184   // Abstract superclass for individual drives
185   class Drive {
186   public:
# Line 246 | Line 233 | private:
233   };
234  
235  
236 + /*
237 + *  Functions
238 + */
239 +
240   // Convert ASCII character to PETSCII character
241   extern uint8 ascii2petscii(char c);
242  
# Line 258 | Line 249 | extern char petscii2ascii(uint8 c);
249   // Convert PETSCII string to ASCII string
250   extern void petscii2ascii(char *dest, const uint8 *src, int max);
251  
252 + // Check whether file is a mountable disk image or archive file, return type
253 + extern bool IsMountableFile(const char *path, int &type);
254 +
255 + // Read directory of mountable disk image or archive file into c64_dir_entry vector
256 + extern bool ReadDirectory(const char *path, int type, vector<c64_dir_entry> &vec);
257 +
258   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines