--- Frodo4/Src/IEC.cpp 2004/01/11 00:09:51 1.3 +++ Frodo4/Src/IEC.cpp 2004/01/14 16:54:46 1.7 @@ -1,7 +1,7 @@ /* * IEC.cpp - 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 @@ -68,9 +68,9 @@ IEC::IEC(C64Display *display) : the_disp if (ThePrefs.DriveType[i] == DRVTYPE_DIR) drive[i] = new FSDrive(this, ThePrefs.DrivePath[i]); else if (ThePrefs.DriveType[i] == DRVTYPE_D64) - drive[i] = new D64Drive(this, ThePrefs.DrivePath[i]); + drive[i] = new ImageDrive(this, ThePrefs.DrivePath[i]); else - drive[i] = new T64Drive(this, ThePrefs.DrivePath[i]); + drive[i] = new ArchDrive(this, ThePrefs.DrivePath[i]); } listener_active = talker_active = false; @@ -120,9 +120,9 @@ void IEC::NewPrefs(Prefs *prefs) if (prefs->DriveType[i] == DRVTYPE_DIR) drive[i] = new FSDrive(this, prefs->DrivePath[i]); else if (prefs->DriveType[i] == DRVTYPE_D64) - drive[i] = new D64Drive(this, prefs->DrivePath[i]); + drive[i] = new ImageDrive(this, prefs->DrivePath[i]); else - drive[i] = new T64Drive(this, prefs->DrivePath[i]); + drive[i] = new ArchDrive(this, prefs->DrivePath[i]); } } @@ -210,12 +210,12 @@ uint8 IEC::OutSec(uint8 byte) * Read one byte */ -uint8 IEC::In(uint8 *byte) +uint8 IEC::In(uint8 &byte) { if (talker_active && (received_cmd == CMD_DATA)) return data_in(byte); - *byte = 0; + byte = 0; return ST_TIMEOUT; } @@ -388,7 +388,7 @@ uint8 IEC::data_out(uint8 byte, bool eoi * Read byte from channel */ -uint8 IEC::data_in(uint8 *byte) +uint8 IEC::data_in(uint8 &byte) { return talker->Read(sec_addr, byte); } @@ -451,6 +451,7 @@ void Drive::set_error(int error, int tra sprintf(error_buf, Errors_1541[error], track, sector); error_ptr = error_buf; error_len = strlen(error_buf); + current_error = error; // Set drive condition if (error != ERR_OK && error != ERR_SCRATCHED) @@ -847,14 +848,14 @@ void Drive::unsupp_cmd(void) * Convert PETSCII<->ASCII */ -char ascii2petscii(char c) +uint8 ascii2petscii(char c) { if ((c >= 'A') && (c <= 'Z') || (c >= 'a') && (c <= 'z')) return c ^ 0x20; return c; } -void ascii2petscii(char *dest, const char *src, int n) +void ascii2petscii(uint8 *dest, const char *src, int n) { while (n-- && (*dest++ = ascii2petscii(*src++))) ; } @@ -868,7 +869,7 @@ char petscii2ascii(uint8 c) return c; } -void petscii2ascii(char *dest, const char *src, int n) +void petscii2ascii(char *dest, const uint8 *src, int n) { while (n-- && (*dest++ = petscii2ascii(*src++))) ; }