--- Frodo4/Src/IEC.h 2004/01/11 00:09:51 1.3 +++ Frodo4/Src/IEC.h 2004/01/14 16:54:46 1.6 @@ -1,7 +1,7 @@ /* * IEC.h - IEC bus routines, 1541 emulation (DOS level) * - * Frodo (C) 1994-1997,2002-2003 Christian Bauer + * Frodo (C) 1994-1997,2002-2004 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 @@ -118,6 +118,28 @@ enum { }; +// Information about file in disk image/archive file +struct c64_dir_entry { + c64_dir_entry(const uint8 *n, int t, bool o, bool p, size_t s, off_t ofs = 0, uint8 sal = 0, uint8 sah = 0) + : type(t), is_open(o), is_protected(p), size(s), offset(ofs), sa_lo(sal), sa_hi(sah) + { + strncpy((char *)name, (const char *)n, 17); + name[16] = 0; + } + + // Basic information + uint8 name[17]; // File name (C64 charset, null-terminated) + int type; // File type (see defines above) + bool is_open; // Flag: file open + bool is_protected; // Flag: file protected + size_t size; // File size (may be approximated) + + // Special information + off_t offset; // Offset of file in archive file + uint8 sa_lo, sa_hi; // C64 start address +}; + + class Drive; class C64Display; class Prefs; @@ -135,7 +157,7 @@ public: uint8 Out(uint8 byte, bool eoi); uint8 OutATN(uint8 byte); uint8 OutSec(uint8 byte); - uint8 In(uint8 *byte); + uint8 In(uint8 &byte); void SetATN(void); void RelATN(void); void Turnaround(void); @@ -150,7 +172,7 @@ private: uint8 sec_talk(void); uint8 open_out(uint8 byte, bool eoi); uint8 data_out(uint8 byte, bool eoi); - uint8 data_in(uint8 *byte); + uint8 data_in(uint8 &byte); C64Display *the_display; // Pointer to display object (for drive LEDs) @@ -180,7 +202,7 @@ public: virtual uint8 Open(int channel, const uint8 *name, int name_len)=0; virtual uint8 Close(int channel)=0; - virtual uint8 Read(int channel, uint8 *byte)=0; + virtual uint8 Read(int channel, uint8 &byte)=0; virtual uint8 Write(int channel, uint8 byte, bool eoi)=0; virtual void Reset(void)=0; @@ -214,6 +236,7 @@ protected: char error_buf[256]; // Buffer with current error message char *error_ptr; // Pointer within error message int error_len; // Remaining length of error message + int current_error; // Number of current error uint8 cmd_buf[64]; // Buffer for incoming command strings int cmd_len; // Length of received command @@ -224,15 +247,15 @@ private: // Convert ASCII character to PETSCII character -extern char ascii2petscii(char c); +extern uint8 ascii2petscii(char c); // Convert ASCII string to PETSCII string -extern void ascii2petscii(char *dest, const char *src, int max); +extern void ascii2petscii(uint8 *dest, const char *src, int max); // Convert PETSCII character to ASCII character extern char petscii2ascii(uint8 c); // Convert PETSCII string to ASCII string -extern void petscii2ascii(char *dest, const char *src, int max); +extern void petscii2ascii(char *dest, const uint8 *src, int max); #endif