ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/Frodo4/Src/1541t64.h
Revision: 1.7
Committed: 2005-06-27T19:55:48Z (17 years, 5 months ago) by cebix
Content type: text/plain
Branch: MAIN
CVS Tags: VERSION_4_2, HEAD
Changes since 1.6: +1 -1 lines
Log Message:
updated copyright dates

File Contents

# Content
1 /*
2 * 1541t64.h - 1541 emulation in archive-type files (.t64/LYNX/.p00)
3 *
4 * Frodo (C) 1994-1997,2002-2005 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
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #ifndef _1541T64_H
22 #define _1541T64_H
23
24 #include "IEC.h"
25
26
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 // Archive file drive class
39 class ArchDrive : public Drive {
40 public:
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);
47 virtual uint8 Write(int channel, uint8 byte, bool eoi);
48 virtual void Reset(void);
49
50 private:
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);
57
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
66 char dir_title[16]; // Directory title
67 FILE *file[16]; // File pointers for each of the 16 channels (all temporary files)
68
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