Fix the WIN_SPECIFY command on both IDE and AT MFM to not ignore the parameters when executed on an already initialized drive, fixes the IDE issues on the Philips P3345, also implemented the C&T P82C604 super I/O chip used by the Philips P3345 to control the serial and parallel ports, and gave the machine the IDE flag and on-board IDE again, fixes #6859.

This commit is contained in:
OBattler
2026-02-28 12:26:20 +01:00
parent 43419f9ced
commit 7b9456a0f6
6 changed files with 17 additions and 20 deletions

View File

@@ -2609,13 +2609,11 @@ ide_callback(void *priv)
if (ide->type == IDE_ATAPI)
err = ABRT_ERR;
else {
/* Only accept after RESET or DIAG. */
if (!ide->params_specified) {
ide->cfg_spt = (ide->tf->secount == 0) ? 256 : ide->tf->secount;
ide->cfg_hpc = ide->tf->head + 1;
ide->cfg_spt = (ide->tf->secount == 0) ? 256 : ide->tf->secount;
ide->cfg_hpc = ide->tf->head + 1;
ide->params_specified = 1;
ide->params_specified = 1;
}
ide->command = 0x00;
ide->tf->atastat = DRDY_STAT | DSC_STAT;
ide->tf->error = 1;

View File

@@ -690,18 +690,13 @@ write_error:
*
* We SHOULD check that here!! --FvK
*/
if (drive->cfg_spt == 0) {
/* Only accept after RESET or DIAG. */
drive->cfg_spt = mfm->secount;
drive->cfg_hpc = mfm->head + 1;
st506_at_log("WD1003(%d) parameters: tracks=%d, spt=%i, hpc=%i\n",
mfm->drvsel, drive->tracks,
drive->cfg_spt, drive->cfg_hpc);
} else {
st506_at_log("WD1003(%d) parameters: tracks=%d,spt=%i,hpc=%i (IGNORED)\n",
mfm->drvsel, drive->tracks,
drive->cfg_spt, drive->cfg_hpc);
}
drive->cfg_spt = mfm->secount;
drive->cfg_hpc = mfm->head + 1;
st506_at_log("WD1003(%d) parameters: tracks=%d, spt=%i, hpc=%i\n",
mfm->drvsel, drive->tracks,
drive->cfg_spt, drive->cfg_hpc);
mfm->command = 0x00;
mfm->status = STAT_READY | STAT_DSC;
mfm->error = 1;

View File

@@ -27,6 +27,8 @@ extern const device_t f82c606_device;
extern const device_t f82c710_device;
extern const device_t f82c710_pc5086_device;
extern const device_t p82c604_device;
/* Commodore */
extern const device_t cbm_io_device;

View File

@@ -505,11 +505,12 @@ machine_at_p3345_init(const machine_t *model)
if (bios_only || !ret)
return ret;
machine_at_common_init(model);
machine_at_common_ide_init(model);
device_add_params(machine_get_kbc_device(machine), (void *) model->kbc_params);
device_add(&neat_device);
device_add(&p82c604_device);
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);

View File

@@ -6184,7 +6184,7 @@ const machine_t machines[] = {
.max_multi = 0
},
.bus_flags = MACHINE_AT,
.flags = 0,
.flags = MACHINE_IDE,
.ram = {
.min = 2048,
.max = 8192,

View File

@@ -31,6 +31,7 @@ add_library(sio OBJECT
sio_fdc37c93x.c
sio_fdc37m60x.c
sio_it86x1f.c
sio_p82c604.c
sio_pc87310.c
sio_pc873xx.c
sio_pc87306.c