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:
@@ -21,7 +21,7 @@
|
||||
* already on their way out, the newer IDE standard based on the
|
||||
* PC/AT controller and 16b design became the IDE we now know.
|
||||
*
|
||||
* Version: @(#)hdc_xtide.c 1.0.11 2018/03/18
|
||||
* Version: @(#)hdc_xtide.c 1.0.12 2018/04/05
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -52,6 +52,7 @@
|
||||
|
||||
|
||||
typedef struct {
|
||||
void *ide_board;
|
||||
uint8_t data_high;
|
||||
rom_t bios_rom;
|
||||
} xtide_t;
|
||||
@@ -64,7 +65,7 @@ xtide_write(uint16_t port, uint8_t val, void *priv)
|
||||
|
||||
switch (port & 0xf) {
|
||||
case 0x0:
|
||||
writeidew(4, val | (xtide->data_high << 8));
|
||||
ide_writew(0x0, val | (xtide->data_high << 8), xtide->ide_board);
|
||||
return;
|
||||
|
||||
case 0x1:
|
||||
@@ -74,7 +75,7 @@ xtide_write(uint16_t port, uint8_t val, void *priv)
|
||||
case 0x5:
|
||||
case 0x6:
|
||||
case 0x7:
|
||||
writeide(4, (port & 0xf) | 0x1f0, val);
|
||||
ide_writeb((port & 0xf), val, xtide->ide_board);
|
||||
return;
|
||||
|
||||
case 0x8:
|
||||
@@ -82,7 +83,7 @@ xtide_write(uint16_t port, uint8_t val, void *priv)
|
||||
return;
|
||||
|
||||
case 0xe:
|
||||
writeide(4, 0x3f6, val);
|
||||
ide_write_devctl(0x0, val, xtide->ide_board);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -96,7 +97,7 @@ xtide_read(uint16_t port, void *priv)
|
||||
|
||||
switch (port & 0xf) {
|
||||
case 0x0:
|
||||
tempw = readidew(4);
|
||||
tempw = ide_readw(0x0, xtide->ide_board);
|
||||
xtide->data_high = tempw >> 8;
|
||||
break;
|
||||
|
||||
@@ -107,7 +108,7 @@ xtide_read(uint16_t port, void *priv)
|
||||
case 0x5:
|
||||
case 0x6:
|
||||
case 0x7:
|
||||
tempw = readide(4, (port & 0xf) | 0x1f0);
|
||||
tempw = ide_readb((port & 0xf), xtide->ide_board);
|
||||
break;
|
||||
|
||||
case 0x8:
|
||||
@@ -115,7 +116,7 @@ xtide_read(uint16_t port, void *priv)
|
||||
break;
|
||||
|
||||
case 0xe:
|
||||
tempw = readide(4, 0x3f6);
|
||||
tempw = ide_read_alt_status(0x0, xtide->ide_board);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -136,7 +137,7 @@ xtide_init(const device_t *info)
|
||||
rom_init(&xtide->bios_rom, ROM_PATH_XT,
|
||||
0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
ide_xtide_init();
|
||||
xtide->ide_board = ide_xtide_init();
|
||||
|
||||
io_sethandler(0x0300, 16,
|
||||
xtide_read, NULL, NULL,
|
||||
@@ -186,7 +187,7 @@ xtide_acculogic_init(const device_t *info)
|
||||
rom_init(&xtide->bios_rom, ROM_PATH_PS2,
|
||||
0xc8000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
ide_xtide_init();
|
||||
xtide->ide_board = ide_xtide_init();
|
||||
|
||||
io_sethandler(0x0360, 16,
|
||||
xtide_read, NULL, NULL,
|
||||
@@ -203,6 +204,17 @@ xtide_acculogic_available(void)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
xtide_close(void *priv)
|
||||
{
|
||||
xtide_t *xtide = (xtide_t *)priv;
|
||||
|
||||
free(xtide);
|
||||
|
||||
ide_xtide_close();
|
||||
}
|
||||
|
||||
|
||||
static void *
|
||||
xtide_at_ps2_init(const device_t *info)
|
||||
{
|
||||
@@ -227,7 +239,7 @@ xtide_at_ps2_available(void)
|
||||
|
||||
|
||||
static void
|
||||
xtide_close(void *priv)
|
||||
xtide_at_close(void *priv)
|
||||
{
|
||||
xtide_t *xtide = (xtide_t *)priv;
|
||||
|
||||
@@ -248,7 +260,7 @@ const device_t xtide_at_device = {
|
||||
"XTIDE (AT)",
|
||||
DEVICE_ISA | DEVICE_AT,
|
||||
0,
|
||||
xtide_at_init, xtide_close, NULL,
|
||||
xtide_at_init, xtide_at_close, NULL,
|
||||
xtide_at_available, NULL, NULL, NULL,
|
||||
NULL
|
||||
};
|
||||
@@ -266,7 +278,7 @@ const device_t xtide_at_ps2_device = {
|
||||
"XTIDE (AT) (1.1.5)",
|
||||
DEVICE_ISA | DEVICE_PS2,
|
||||
0,
|
||||
xtide_at_ps2_init, xtide_close, NULL,
|
||||
xtide_at_ps2_init, xtide_at_close, NULL,
|
||||
xtide_at_ps2_available, NULL, NULL, NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user