Applied all relevant PCem commits;
Extensively cleaned up and changed the CD-ROM code; Removed CD-ROM IOCTTL (it was causing performance and stability issues); Turned a lot of things into device_t's; Added the PS/1 Model 2011 XTA and standalone XTA hard disk controllers, ported from Varcem; Numerous FDC fixes for the PS/1 Model 2121; NVR changes ported from Varcem; The PCap code no longer requires libpcap to be compiled; Numerous fixes to various SCSI controllers; Updated NukedOPL to 1.8; Fixes to OpenAL initialization and closing, should give less Audio issues now; Revorked parts of the common (S)VGA code (also based on code from QEMU); Removed the Removable SCSI hard disks (they were a never finished experiment so there was no need to keep them there); Cleaned up the SCSI hard disk and Iomega ZIP code (but more cleanups of that are coming in the future); In some occasions (IDE hard disks in multiple sector mode and SCSI hard disks) the status bar icon is no longer updated, should improve performance a bit; Redid the way the tertiary and quaternary IDE controllers are configured (and they are now device_t's); Extensively reworked the IDE code and fixed quite a few bugs; Fixes to XT MFM, AT MFM, and AT ESDI code; Some changes to XTIDE and MCA ESDI code; Some fixes to the CD-ROM image handler.
This commit is contained in:
@@ -8,12 +8,12 @@
|
||||
*
|
||||
* Definitions for the hard disk image handler.
|
||||
*
|
||||
* Version: @(#)hdd.h 1.0.3 2017/10/05
|
||||
* Version: @(#)hdd.h 1.0.4 2018/03/29
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
* Copyright 2017 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
*/
|
||||
#ifndef EMU_HDD_H
|
||||
# define EMU_HDD_H
|
||||
@@ -23,17 +23,53 @@
|
||||
|
||||
|
||||
/* Hard Disk bus types. */
|
||||
#if 0
|
||||
/* Bit 4 = DMA supported (0 = no, 1 yes) - used for IDE and ATAPI only;
|
||||
Bit 5 = Removable (0 = no, 1 yes). */
|
||||
|
||||
enum {
|
||||
BUS_DISABLED = 0x00,
|
||||
|
||||
BUS_MFM = 0x01, /* These four are for hard disk only. */
|
||||
BUS_XIDE = 0x02,
|
||||
BUS_XTA = 0x03,
|
||||
BUS_ESDI = 0x04,
|
||||
|
||||
BUS_PANASONIC = 0x21, / These four are for CD-ROM only. */
|
||||
BUS_PHILIPS = 0x22,
|
||||
BUS_SONY = 0x23,
|
||||
BUS_MITSUMI = 0x24,
|
||||
|
||||
BUS_IDE_PIO_ONLY = 0x05,
|
||||
BUS_IDE_PIO_AND_DMA = 0x15,
|
||||
BUS_IDE_R_PIO_ONLY = 0x25,
|
||||
BUS_IDE_R_PIO_AND_DMA = 0x35,
|
||||
|
||||
BUS_ATAPI_PIO_ONLY = 0x06,
|
||||
BUS_ATAPI_PIO_AND_DMA = 0x16,
|
||||
BUS_ATAPI_R_PIO_ONLY = 0x26,
|
||||
BUS_ATAPI_R_PIO_AND_DMA = 0x36,
|
||||
|
||||
BUS_SASI = 0x07,
|
||||
BUS_SASI_R = 0x27,
|
||||
|
||||
BUS_SCSI = 0x08,
|
||||
BUS_SCSI_R = 0x28,
|
||||
|
||||
BUS_USB = 0x09,
|
||||
BUS_USB_R = 0x29
|
||||
};
|
||||
#else
|
||||
enum {
|
||||
HDD_BUS_DISABLED = 0,
|
||||
HDD_BUS_MFM,
|
||||
HDD_BUS_XTIDE,
|
||||
HDD_BUS_XTA,
|
||||
HDD_BUS_ESDI,
|
||||
HDD_BUS_IDE_PIO_ONLY,
|
||||
HDD_BUS_IDE_PIO_AND_DMA,
|
||||
HDD_BUS_IDE,
|
||||
HDD_BUS_SCSI,
|
||||
HDD_BUS_SCSI_REMOVABLE,
|
||||
HDD_BUS_USB
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
/* Define the virtual Hard Disk. */
|
||||
@@ -45,18 +81,16 @@ typedef struct {
|
||||
|
||||
uint8_t mfm_channel; /* should rename and/or unionize */
|
||||
uint8_t esdi_channel;
|
||||
uint8_t xtide_channel;
|
||||
uint8_t xta_channel;
|
||||
uint8_t ide_channel;
|
||||
uint8_t scsi_id;
|
||||
uint8_t scsi_lun;
|
||||
|
||||
uint32_t base;
|
||||
|
||||
uint64_t spt,
|
||||
uint32_t base,
|
||||
spt,
|
||||
hpc, /* physical geometry parameters */
|
||||
tracks;
|
||||
|
||||
uint64_t at_spt, /* [Translation] parameters */
|
||||
tracks,
|
||||
at_spt, /* [Translation] parameters */
|
||||
at_hpc;
|
||||
|
||||
FILE *f; /* current file handle to image */
|
||||
@@ -67,7 +101,7 @@ typedef struct {
|
||||
|
||||
|
||||
extern hard_disk_t hdd[HDD_NUM];
|
||||
extern uint64_t hdd_table[128][3];
|
||||
extern unsigned int hdd_table[128][3];
|
||||
|
||||
|
||||
extern int hdd_init(void);
|
||||
@@ -75,6 +109,7 @@ extern int hdd_string_to_bus(char *str, int cdrom);
|
||||
extern char *hdd_bus_to_string(int bus, int cdrom);
|
||||
extern int hdd_is_valid(int c);
|
||||
|
||||
extern void hdd_image_init(void);
|
||||
extern int hdd_image_load(int id);
|
||||
extern void hdd_image_seek(uint8_t id, uint32_t sector);
|
||||
extern void hdd_image_read(uint8_t id, uint32_t sector, uint32_t count, uint8_t *buffer);
|
||||
|
||||
Reference in New Issue
Block a user