Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

T64Drive Class Reference

#include <1541t64.h>

Inheritance diagram for T64Drive:

Inheritance graph
[legend]
Collaboration diagram for T64Drive:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 T64Drive (IEC *iec, char *filepath)
virtual ~T64Drive ()
virtual uint8 Open (int channel, char *filename)
virtual uint8 Close (int channel)
virtual uint8 Read (int channel, uint8 *byte)
virtual uint8 Write (int channel, uint8 byte, bool eoi)
virtual void Reset (void)

Private Member Functions

void open_close_t64_file (char *t64name)
bool parse_t64_file (void)
bool parse_lynx_file (void)
uint8 open_file (int channel, char *filename)
uint8 open_directory (int channel, char *filename)
void convert_filename (char *srcname, char *destname, int *filemode, int *filetype)
bool find_first_file (char *name, int type, int *num)
void close_all_channels (void)
void execute_command (char *command)
void cht64_cmd (char *t64path)
uint8 conv_from_64 (uint8 c, bool map_slash)

Private Attributes

FILE * the_file
bool is_lynx
char orig_t64_name [256]
char dir_title [16]
FILE * file [16]
int num_files
FileInfofile_info
char cmd_buffer [44]
int cmd_len
uint8 read_char [16]

Constructor & Destructor Documentation

T64Drive::T64Drive IEC iec,
char *  filepath
 

Definition at line 49 of file 1541t64.cpp.

References __CHECK_NULL, CTOR, file, file_info, open_close_t64_file(), orig_t64_name, Drive::Ready, Reset(), strcpy, and the_file.

T64Drive::~T64Drive  )  [virtual]
 

Definition at line 77 of file 1541t64.cpp.

References DTOR, open_close_t64_file(), and Drive::Ready.


Member Function Documentation

void T64Drive::cht64_cmd char *  t64path  )  [private]
 

Definition at line 676 of file 1541t64.cpp.

References close_all_channels(), conv_from_64(), ERR_NOTREADY, NAMEBUF_LENGTH, open_close_t64_file(), orig_t64_name, Drive::set_error(), and the_file.

Referenced by execute_command().

uint8 T64Drive::Close int  channel  )  [virtual]
 

Implements Drive.

Definition at line 547 of file 1541t64.cpp.

References close_all_channels(), fclose, file, ST_OK, and uint8.

Referenced by close_all_channels().

void T64Drive::close_all_channels void   )  [private]
 

Definition at line 567 of file 1541t64.cpp.

References Close(), and cmd_len.

Referenced by cht64_cmd(), Close(), execute_command(), open_close_t64_file(), and Reset().

uint8 T64Drive::conv_from_64 uint8  c,
bool  map_slash
[private]
 

Todo:
use prefs

Definition at line 715 of file 1541t64.cpp.

References uint8.

Referenced by cht64_cmd().

void T64Drive::convert_filename char *  srcname,
char *  destname,
int *  filemode,
int *  filetype
[private]
 

Definition at line 351 of file 1541t64.cpp.

References FMODE_APPEND, FMODE_READ, FMODE_WRITE, FTYPE_PRG, FTYPE_REL, FTYPE_SEQ, FTYPE_USR, NAMEBUF_LENGTH, strchr(), and strncpy.

Referenced by open_directory(), and open_file().

void T64Drive::execute_command char *  command  )  [private]
 

Definition at line 644 of file 1541t64.cpp.

References cht64_cmd(), close_all_channels(), ERR_OK, ERR_SYNTAX30, Reset(), and Drive::set_error().

Referenced by Open(), and Write().

bool T64Drive::find_first_file char *  name,
int  type,
int *  num
[private]
 

Definition at line 423 of file 1541t64.cpp.

References file_info, match(), num_files, and FileInfo::type.

Referenced by open_file().

uint8 T64Drive::Open int  channel,
char *  filename
[virtual]
 

Implements Drive.

Definition at line 255 of file 1541t64.cpp.

References ERR_NOCHANNEL, ERR_NOTREADY, ERR_OK, execute_command(), fclose, file, open_directory(), open_file(), Drive::set_error(), ST_OK, the_file, and uint8.

void T64Drive::open_close_t64_file char *  t64name  )  [private]
 

Definition at line 92 of file 1541t64.cpp.

References close_all_channels(), fclose, file_info, fopen, fread, is_lynx, parse_lynx_file(), parse_t64_file(), the_file, and uint8.

Referenced by cht64_cmd(), T64Drive(), and ~T64Drive().

uint8 T64Drive::open_directory int  channel,
char *  filename
[private]
 

Definition at line 439 of file 1541t64.cpp.

References convert_filename(), dir_title, fgetc, file, file_info, FTYPE_PRG, FTYPE_REL, FTYPE_SEQ, FTYPE_USR, fwrite, FileInfo::length, match(), memset, NAMEBUF_LENGTH, num_files, read_char, rewind, ST_OK, strcpy, strlen, tmpfile, and uint8.

Referenced by Open().

uint8 T64Drive::open_file int  channel,
char *  filename
[private]
 

Definition at line 292 of file 1541t64.cpp.

References convert_filename(), ERR_FILENOTFOUND, ERR_WRITEPROTECT, fgetc, file, file_info, find_first_file(), FMODE_READ, FMODE_WRITE, fread, fseek, FTYPE_PRG, fwrite, is_lynx, FileInfo::length, NAMEBUF_LENGTH, read_char, rewind, Drive::set_error(), ST_OK, the_file, tmpfile, and uint8.

Referenced by Open().

bool T64Drive::parse_lynx_file void   )  [private]
 

Definition at line 191 of file 1541t64.cpp.

References dir_title, feof, fgetc, file_info, fread, fseek, FTYPE_PRG, FTYPE_REL, FTYPE_SEQ, FTYPE_USR, FileInfo::length, FileInfo::name, num_files, FileInfo::offset, FileInfo::sa_hi, FileInfo::sa_lo, strcpy, the_file, FileInfo::type, and uint8.

Referenced by open_close_t64_file().

bool T64Drive::parse_t64_file void   )  [private]
 

Definition at line 136 of file 1541t64.cpp.

References dir_title, file_info, fread, fseek, FTYPE_PRG, memcpy, FileInfo::name, num_files, the_file, and uint8.

Referenced by open_close_t64_file().

uint8 T64Drive::Read int  channel,
uint8 byte
[virtual]
 

Implements Drive.

Definition at line 580 of file 1541t64.cpp.

References EOF, ERR_OK, Drive::error_ptr, fgetc, file, read_char, Drive::set_error(), ST_EOF, ST_OK, ST_READ_TIMEOUT, and uint8.

void T64Drive::Reset void   )  [virtual]
 

Implements Drive.

Definition at line 701 of file 1541t64.cpp.

References close_all_channels(), cmd_len, ELOG1, ERR_STARTUP, and Drive::set_error().

Referenced by execute_command(), and T64Drive().

uint8 T64Drive::Write int  channel,
uint8  byte,
bool  eoi
[virtual]
 

Implements Drive.

Definition at line 614 of file 1541t64.cpp.

References cmd_buffer, cmd_len, ERR_FILENOTOPEN, ERR_WRITEPROTECT, execute_command(), file, Drive::set_error(), ST_OK, ST_TIMEOUT, and uint8.


Member Data Documentation

char T64Drive::cmd_buffer[44] [private]
 

Definition at line 56 of file 1541t64.h.

Referenced by Write().

int T64Drive::cmd_len [private]
 

Definition at line 57 of file 1541t64.h.

Referenced by close_all_channels(), Reset(), and Write().

char T64Drive::dir_title[16] [private]
 

Definition at line 50 of file 1541t64.h.

Referenced by open_directory(), parse_lynx_file(), and parse_t64_file().

FILE* T64Drive::file[16] [private]
 

Definition at line 51 of file 1541t64.h.

Referenced by Close(), Open(), open_directory(), open_file(), Read(), T64Drive(), and Write().

FileInfo* T64Drive::file_info [private]
 

Definition at line 54 of file 1541t64.h.

Referenced by find_first_file(), open_close_t64_file(), open_directory(), open_file(), parse_lynx_file(), parse_t64_file(), and T64Drive().

bool T64Drive::is_lynx [private]
 

Definition at line 47 of file 1541t64.h.

Referenced by open_close_t64_file(), and open_file().

int T64Drive::num_files [private]
 

Definition at line 53 of file 1541t64.h.

Referenced by find_first_file(), open_directory(), parse_lynx_file(), and parse_t64_file().

char T64Drive::orig_t64_name[256] [private]
 

Definition at line 49 of file 1541t64.h.

Referenced by cht64_cmd(), and T64Drive().

uint8 T64Drive::read_char[16] [private]
 

Definition at line 59 of file 1541t64.h.

Referenced by open_directory(), open_file(), and Read().

FILE* T64Drive::the_file [private]
 

Definition at line 46 of file 1541t64.h.

Referenced by cht64_cmd(), Open(), open_close_t64_file(), open_file(), parse_lynx_file(), parse_t64_file(), and T64Drive().


The documentation for this class was generated from the following files:
Generated on Tue Feb 8 04:12:57 2005 for E32frodo by doxygen 1.3.3