1 |
/* |
2 |
* 1541fs.h - 1541 emulation in host file system |
3 |
* |
4 |
* Frodo (C) 1994-1997,2002-2003 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 _1541FS_H |
22 |
#define _1541FS_H |
23 |
|
24 |
#include "IEC.h" |
25 |
|
26 |
|
27 |
class FSDrive : public Drive { |
28 |
public: |
29 |
FSDrive(IEC *iec, char *path); |
30 |
virtual ~FSDrive(); |
31 |
virtual uint8 Open(int channel, char *filename); |
32 |
virtual uint8 Close(int channel); |
33 |
virtual uint8 Read(int channel, uint8 *byte); |
34 |
virtual uint8 Write(int channel, uint8 byte, bool eoi); |
35 |
virtual void Reset(void); |
36 |
|
37 |
private: |
38 |
bool change_dir(char *dirpath); |
39 |
uint8 open_file(int channel, char *filename); |
40 |
uint8 open_directory(int channel, char *filename); |
41 |
void convert_filename(char *srcname, char *destname, int *filemode, int *filetype, bool *wildflag); |
42 |
void find_first_file(char *name); |
43 |
void close_all_channels(void); |
44 |
void execute_command(char *command); |
45 |
void chdir_cmd(char *dirpath); |
46 |
uint8 conv_from_64(uint8 c, bool map_slash); |
47 |
uint8 conv_to_64(uint8 c, bool map_slash); |
48 |
|
49 |
char dir_path[256]; // Path to directory |
50 |
char orig_dir_path[256]; // Original directory path |
51 |
char dir_title[16]; // Directory title |
52 |
FILE *file[16]; // File pointers for each of the 16 channels |
53 |
|
54 |
char cmd_buffer[44]; // Buffer for incoming command strings |
55 |
int cmd_len; // Length of received command |
56 |
|
57 |
uint8 read_char[16]; // Buffers for one-byte read-ahead |
58 |
}; |
59 |
|
60 |
#endif |