More cleanups and some fixes for the ZIP driver.

This commit is contained in:
waltje
2018-10-26 19:15:50 -04:00
parent d97c3a91e8
commit 28fa98e69d
3 changed files with 681 additions and 612 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@
* Implementation of the Iomega ZIP drive with SCSI(-like) * Implementation of the Iomega ZIP drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage. * commands, for both ATAPI and SCSI usage.
* *
* Version: @(#)zip.h 1.0.10 2018/10/25 * Version: @(#)zip.h 1.0.11 2018/10/26
* *
* Author: Miran Grca, <mgrca8@gmail.com> * Author: Miran Grca, <mgrca8@gmail.com>
* *
@@ -44,7 +44,7 @@
#define ZIP_TIME (5LL * 100LL * (1LL << TIMER_SHIFT)) #define ZIP_TIME (5LL * 100LL * (1LL << TIMER_SHIFT))
#define ZIP_SECTORS (96*2048) #define ZIP_SECTORS (96*2048)
#define ZIP_250_SECTORS (489532) #define ZIP_SECTORS_250 (489532)
enum { enum {
@@ -117,14 +117,6 @@ typedef struct {
extern zip_drive_t zip_drives[ZIP_NUM]; extern zip_drive_t zip_drives[ZIP_NUM];
extern uint8_t atapi_zip_drives[8];
extern uint8_t scsi_zip_drives[16][8];
/*FIXME: These should be removed, it makes the code unclear. --FvK */
#define zip_sense_error dev->sense[0]
#define zip_sense_key dev->sense[2]
#define zip_asc dev->sense[12]
#define zip_ascq dev->sense[13]
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -12,7 +12,7 @@
* format handlers, and re-integrated with that code. This is * format handlers, and re-integrated with that code. This is
* just the wrong place for it.. * just the wrong place for it..
* *
* Version: @(#)ui_new_image.c 1.0.4 2018/10/05 * Version: @(#)ui_new_image.c 1.0.5 2018/10/26
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -223,7 +223,7 @@ floppy_create_image(const wchar_t *fn, int8_t ds, int8_t is_fdi)
sector_bytes = (128 << dp->sector_len); sector_bytes = (128 << dp->sector_len);
total_sectors = dp->sides * dp->tracks * dp->sectors; total_sectors = dp->sides * dp->tracks * dp->sectors;
if (total_sectors > ZIP_SECTORS) if (total_sectors > ZIP_SECTORS)
total_sectors = ZIP_250_SECTORS; total_sectors = ZIP_SECTORS_250;
total_size = total_sectors * sector_bytes; total_size = total_sectors * sector_bytes;
root_dir_bytes = (dp->root_dir_entries << 5); root_dir_bytes = (dp->root_dir_entries << 5);
fat_size = (dp->spfat * sector_bytes); fat_size = (dp->spfat * sector_bytes);
@@ -337,7 +337,7 @@ zip_create_image(const wchar_t *fn, int8_t ds, int8_t is_zdi)
sector_bytes = (128 << dp->sector_len); sector_bytes = (128 << dp->sector_len);
total_sectors = dp->sides * dp->tracks * dp->sectors; total_sectors = dp->sides * dp->tracks * dp->sectors;
if (total_sectors > ZIP_SECTORS) if (total_sectors > ZIP_SECTORS)
total_sectors = ZIP_250_SECTORS; total_sectors = ZIP_SECTORS_250;
total_size = total_sectors * sector_bytes; total_size = total_sectors * sector_bytes;
root_dir_bytes = (dp->root_dir_entries << 5); root_dir_bytes = (dp->root_dir_entries << 5);
fat_size = (dp->spfat * sector_bytes); fat_size = (dp->spfat * sector_bytes);