Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

1541t64.h

Go to the documentation of this file.
00001 /*
00002  *  1541t64.h - 1541 emulation in .t64/LYNX file
00003  *
00004  *  Frodo (C) 1994-1997 Christian Bauer
00005  */
00006 
00007 #ifndef _1541T64_H
00008 #define _1541T64_H
00009 
00010 #include "IEC.h"
00011 
00012 
00013 // Information for file inside a .t64 file
00014 typedef struct {
00015         char name[17];          // File name, PETSCII
00016         uint8 type;                     // File type
00017         uint8 sa_lo, sa_hi;     // Start address
00018         int offset;                     // Offset of first byte in .t64 file
00019         int length;                     // Length of file
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;                 // File pointer for .t64 file
00047         bool is_lynx;                   // Flag: .t64 file is really a LYNX archive
00048 
00049         char orig_t64_name[256]; // Original path of .t64 file
00050         char dir_title[16];             // Directory title
00051         FILE *file[16];                 // File pointers for each of the 16 channels (all temporary files)
00052 
00053         int num_files;                  // Number of files in .t64 file and in file_info array
00054         FileInfo *file_info;    // Pointer to array of file information structs for each file
00055 
00056         char cmd_buffer[44];    // Buffer for incoming command strings
00057         int cmd_len;                    // Length of received command
00058 
00059         uint8 read_char[16];    // Buffers for one-byte read-ahead
00060 };
00061 
00062 #endif

Generated on Tue Feb 8 04:07:15 2005 for E32frodo by doxygen 1.3.3