1 |
|
/* |
2 |
|
* 1541t64.h - 1541 emulation in .t64/LYNX file |
3 |
|
* |
4 |
< |
* Frodo (C) 1994-1997,2002 Christian Bauer |
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 |
26 |
|
|
27 |
|
// Information for file inside a .t64 file |
28 |
|
typedef struct { |
29 |
< |
char name[17]; // File name, PETSCII |
29 |
> |
uint8 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 |
38 |
|
public: |
39 |
|
T64Drive(IEC *iec, char *filepath); |
40 |
|
virtual ~T64Drive(); |
41 |
< |
virtual uint8 Open(int channel, char *filename); |
41 |
> |
virtual uint8 Open(int channel, const uint8 *name, int name_len); |
42 |
|
virtual uint8 Close(int channel); |
43 |
|
virtual uint8 Read(int channel, uint8 *byte); |
44 |
|
virtual uint8 Write(int channel, uint8 byte, bool eoi); |
48 |
|
void open_close_t64_file(char *t64name); |
49 |
|
bool parse_t64_file(void); |
50 |
|
bool parse_lynx_file(void); |
51 |
< |
uint8 open_file(int channel, char *filename); |
52 |
< |
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 |
> |
|
52 |
> |
uint8 open_file(int channel, const uint8 *name, int name_len); |
53 |
> |
uint8 open_directory(int channel, const uint8 *pattern, int pattern_len); |
54 |
> |
bool find_first_file(const uint8 *pattern, int pattern_len, int &num); |
55 |
|
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); |
56 |
> |
|
57 |
> |
virtual void rename_cmd(const uint8 *new_file, int new_file_len, const uint8 *old_file, int old_file_len); |
58 |
> |
virtual void initialize_cmd(void); |
59 |
> |
virtual void validate_cmd(void); |
60 |
|
|
61 |
|
FILE *the_file; // File pointer for .t64 file |
62 |
|
bool is_lynx; // Flag: .t64 file is really a LYNX archive |
68 |
|
int num_files; // Number of files in .t64 file and in file_info array |
69 |
|
FileInfo *file_info; // Pointer to array of file information structs for each file |
70 |
|
|
70 |
– |
char cmd_buffer[44]; // Buffer for incoming command strings |
71 |
– |
int cmd_len; // Length of received command |
72 |
– |
|
71 |
|
uint8 read_char[16]; // Buffers for one-byte read-ahead |
72 |
|
}; |
73 |
|
|