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

Comparing Frodo4/Src/1541t64.h (file contents):
Revision 1.1 by cebix, 2003-07-01T17:09:43Z vs.
Revision 1.6 by cebix, 2004-01-14T16:54:46Z

# Line 1 | Line 1
1   /*
2 < *  1541t64.h - 1541 emulation in .t64/LYNX file
2 > *  1541t64.h - 1541 emulation in archive-type files (.t64/LYNX/.p00)
3   *
4 < *  Frodo (C) 1994-1997,2002 Christian Bauer
4 > *  Frodo (C) 1994-1997,2002-2004 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 24 | Line 24
24   #include "IEC.h"
25  
26  
27 < // Information for file inside a .t64 file
28 < typedef struct {
29 <        char name[17];          // File name, PETSCII
30 <        uint8 type;                     // File type
31 <        uint8 sa_lo, sa_hi;     // Start address
32 <        int offset;                     // Offset of first byte in .t64 file
33 <        int length;                     // Length of file
34 < } FileInfo;
27 > /*
28 > *  Definitions
29 > */
30  
31 + // Archive types
32 + enum {
33 +        TYPE_T64,                       // C64S tape file
34 +        TYPE_LYNX,                      // C64 LYNX archive
35 +        TYPE_P00                        // .p00 file
36 + };
37  
38 < class T64Drive : public Drive {
38 > // Archive file drive class
39 > class ArchDrive : public Drive {
40   public:
41 <        T64Drive(IEC *iec, char *filepath);
42 <        virtual ~T64Drive();
43 <        virtual uint8 Open(int channel, char *filename);
41 >        ArchDrive(IEC *iec, const char *filepath);
42 >        virtual ~ArchDrive();
43 >
44 >        virtual uint8 Open(int channel, const uint8 *name, int name_len);
45          virtual uint8 Close(int channel);
46 <        virtual uint8 Read(int channel, uint8 *byte);
46 >        virtual uint8 Read(int channel, uint8 &byte);
47          virtual uint8 Write(int channel, uint8 byte, bool eoi);
48          virtual void Reset(void);
49  
50   private:
51 <        void open_close_t64_file(char *t64name);
52 <        bool parse_t64_file(void);
53 <        bool parse_lynx_file(void);
54 <        uint8 open_file(int channel, char *filename);
55 <        uint8 open_directory(int channel, char *filename);
53 <        void convert_filename(char *srcname, char *destname, int *filemode, int *filetype);
54 <        bool find_first_file(char *name, int type, int *num);
51 >        bool change_arch(const char *path);
52 >
53 >        uint8 open_file(int channel, const uint8 *name, int name_len);
54 >        uint8 open_directory(int channel, const uint8 *pattern, int pattern_len);
55 >        bool find_first_file(const uint8 *pattern, int pattern_len, int &num);
56          void close_all_channels(void);
56        void execute_command(char *command);
57        void cht64_cmd(char *t64path);
58        uint8 conv_from_64(uint8 c, bool map_slash);
57  
58 <        FILE *the_file;                 // File pointer for .t64 file
59 <        bool is_lynx;                   // Flag: .t64 file is really a LYNX archive
58 >        virtual void rename_cmd(const uint8 *new_file, int new_file_len, const uint8 *old_file, int old_file_len);
59 >        virtual void initialize_cmd(void);
60 >        virtual void validate_cmd(void);
61 >
62 >        FILE *the_file;                 // File pointer for archive file
63 >        int archive_type;               // File/archive type (see defines above)
64 >        vector<c64_dir_entry> file_info;        // Vector of file information structs for all files in the archive
65  
63        char orig_t64_name[256]; // Original path of .t64 file
66          char dir_title[16];             // Directory title
67          FILE *file[16];                 // File pointers for each of the 16 channels (all temporary files)
68  
67        int num_files;                  // Number of files in .t64 file and in file_info array
68        FileInfo *file_info;    // Pointer to array of file information structs for each file
69
70        char cmd_buffer[44];    // Buffer for incoming command strings
71        int cmd_len;                    // Length of received command
72
69          uint8 read_char[16];    // Buffers for one-byte read-ahead
70   };
71  
72 +
73 + /*
74 + *  Functions
75 + */
76 +
77 + // Check whether file with given header (64 bytes) and size looks like one
78 + // of the file types supported by this module
79 + extern bool IsArchFile(const char *path, const uint8 *header, long size);
80 +
81 + // Read directory of archive file into (empty) c64_dir_entry vector
82 + extern bool ReadArchDirectory(const char *path, vector<c64_dir_entry> &vec);
83 +
84   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines