00001
00002
00003
00004
00005
00006
00007 #ifndef _1541T64_H
00008 #define _1541T64_H
00009
00010 #include "IEC.h"
00011
00012
00013
00014 typedef struct {
00015 char name[17];
00016 uint8 type;
00017 uint8 sa_lo, sa_hi;
00018 int offset;
00019 int length;
00020 } FileInfo;
00021
00022
00023 class T64Drive : public Drive {
00024 public:
00025 T64Drive(IEC *iec, char *filepath);
00026 virtual ~T64Drive();
00027 virtual uint8 Open(int channel, char *filename);
00028 virtual uint8 Close(int channel);
00029 virtual uint8 Read(int channel, uint8 *byte);
00030 virtual uint8 Write(int channel, uint8 byte, bool eoi);
00031 virtual void Reset(void);
00032
00033 private:
00034 void open_close_t64_file(char *t64name);
00035 bool parse_t64_file(void);
00036 bool parse_lynx_file(void);
00037 uint8 open_file(int channel, char *filename);
00038 uint8 open_directory(int channel, char *filename);
00039 void convert_filename(char *srcname, char *destname, int *filemode, int *filetype);
00040 bool find_first_file(char *name, int type, int *num);
00041 void close_all_channels(void);
00042 void execute_command(char *command);
00043 void cht64_cmd(char *t64path);
00044 uint8 conv_from_64(uint8 c, bool map_slash);
00045
00046 FILE *the_file;
00047 bool is_lynx;
00048
00049 char orig_t64_name[256];
00050 char dir_title[16];
00051 FILE *file[16];
00052
00053 int num_files;
00054 FileInfo *file_info;
00055
00056 char cmd_buffer[44];
00057 int cmd_len;
00058
00059 uint8 read_char[16];
00060 };
00061
00062 #endif