frodo-wii/Src/1541fs.h

58 lines
1.8 KiB
C
Raw Permalink Normal View History

2008-12-31 17:16:24 +01:00
/*
* 1541fs.h - 1541 emulation in host file system
*
2009-01-12 20:54:49 +01:00
* Frodo (C) 1994-1997,2002-2005 Christian Bauer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2008-12-31 17:16:24 +01:00
*/
#ifndef _1541FS_H
#define _1541FS_H
#include "IEC.h"
class FSDrive : public Drive {
public:
2009-01-12 20:54:49 +01:00
FSDrive(IEC *iec, const char *path);
2008-12-31 17:16:24 +01:00
virtual ~FSDrive();
2009-01-12 20:54:49 +01:00
virtual uint8 Open(int channel, const uint8 *name, int name_len);
2008-12-31 17:16:24 +01:00
virtual uint8 Close(int channel);
2009-01-12 20:54:49 +01:00
virtual uint8 Read(int channel, uint8 &byte);
2008-12-31 17:16:24 +01:00
virtual uint8 Write(int channel, uint8 byte, bool eoi);
virtual void Reset(void);
private:
bool change_dir(char *dirpath);
2009-01-12 20:54:49 +01:00
uint8 open_file(int channel, const uint8 *name, int name_len);
uint8 open_directory(int channel, const uint8 *pattern, int pattern_len);
void find_first_file(char *pattern);
2008-12-31 17:16:24 +01:00
void close_all_channels(void);
2009-01-12 20:54:49 +01:00
virtual void initialize_cmd(void);
virtual void validate_cmd(void);
2008-12-31 17:16:24 +01:00
char dir_path[256]; // Path to directory
char orig_dir_path[256]; // Original directory path
char dir_title[16]; // Directory title
FILE *file[16]; // File pointers for each of the 16 channels
uint8 read_char[16]; // Buffers for one-byte read-ahead
};
#endif