Merge branch '86Box:master' into main
This commit is contained in:
166
src/floppy/fdc.c
166
src/floppy/fdc.c
@@ -177,15 +177,13 @@ fdc_ctrl_reset(void *priv)
|
||||
{
|
||||
fdc_t *fdc = (fdc_t *) priv;
|
||||
|
||||
fdc->stat = 0x80;
|
||||
fdc->stat = 0x80;
|
||||
fdc->pnum = fdc->ptot = 0;
|
||||
fdc->st0 = 0;
|
||||
fdc->lock = 0;
|
||||
fdc->head = 0;
|
||||
fdc->step = 0;
|
||||
fdc->power_down = 0;
|
||||
if (!(fdc->flags & FDC_FLAG_AT))
|
||||
fdc->rate = 2;
|
||||
}
|
||||
|
||||
sector_id_t
|
||||
@@ -1211,7 +1209,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
|
||||
if (!(fdc->flags & FDC_FLAG_TOSHIBA) && !(fdc->flags & FDC_FLAG_AT) && !(fdc->flags & FDC_FLAG_UMC))
|
||||
return;
|
||||
fdc->rate = val & 0x03;
|
||||
if (fdc->flags & FDC_FLAG_PS1)
|
||||
if (fdc->flags & FDC_FLAG_PS2)
|
||||
fdc->noprec = !!(val & 0x04);
|
||||
return;
|
||||
|
||||
@@ -1231,23 +1229,43 @@ fdc_read(uint16_t addr, void *priv)
|
||||
|
||||
if (!fdc->power_down || ((addr & 7) == 2)) switch (addr & 7) {
|
||||
case 0: /* STA */
|
||||
if (fdc->flags & FDC_FLAG_PS1) {
|
||||
if (fdc->flags & FDC_FLAG_PS2) {
|
||||
drive = real_drive(fdc, fdc->dor & 3);
|
||||
ret = 0x00;
|
||||
/* TODO:
|
||||
Bit 2: INDEX (best return always 0 as it goes by very fast)
|
||||
*/
|
||||
if (fdc->seek_dir) /* nDIRECTION */
|
||||
if (fdc->seek_dir) /* nDIRECTION */
|
||||
ret |= 0x01;
|
||||
if (writeprot[drive]) /* WRITEPROT */
|
||||
if (writeprot[drive]) /* WRITEPROT */
|
||||
ret |= 0x02;
|
||||
if (!fdd_get_head(drive)) /* nHDSEL */
|
||||
if (!fdd_get_head(drive)) /* nHDSEL */
|
||||
ret |= 0x08;
|
||||
if (fdd_track0(drive)) /* TRK0 */
|
||||
if (fdd_track0(drive)) /* TRK0 */
|
||||
ret |= 0x10;
|
||||
if (fdc->step) /* STEP */
|
||||
if (fdc->step) /* STEP */
|
||||
ret |= 0x20;
|
||||
if (dma_get_drq(fdc->dma_ch)) /* DRQ */
|
||||
if (dma_get_drq(fdc->dma_ch)) /* DRQ */
|
||||
ret |= 0x40;
|
||||
if (fdc->fintr || fdc->reset_stat) /* INTR */
|
||||
ret |= 0x80;
|
||||
} else if (fdc->flags & FDC_FLAG_PS2_MCA) {
|
||||
drive = real_drive(fdc, fdc->dor & 3);
|
||||
ret = 0x04;
|
||||
/* TODO:
|
||||
Bit 2: nINDEX (best return always 1 as it goes by very fast)
|
||||
*/
|
||||
if (!fdc->seek_dir) /* DIRECTION */
|
||||
ret |= 0x01;
|
||||
if (!writeprot[drive]) /* nWRITEPROT */
|
||||
ret |= 0x02;
|
||||
if (fdd_get_head(drive)) /* HDSEL */
|
||||
ret |= 0x08;
|
||||
if (!fdd_track0(drive)) /* nTRK0 */
|
||||
ret |= 0x10;
|
||||
if (fdc->step) /* STEP */
|
||||
ret |= 0x20;
|
||||
if (!fdd_get_type(1)) /* -Drive 2 Installed */
|
||||
ret |= 0x40;
|
||||
if (fdc->fintr || fdc->reset_stat) /* INTR */
|
||||
ret |= 0x80;
|
||||
@@ -1255,14 +1273,12 @@ fdc_read(uint16_t addr, void *priv)
|
||||
ret = 0xff;
|
||||
break;
|
||||
case 1: /* STB */
|
||||
if (fdc->flags & FDC_FLAG_PS1) {
|
||||
if (fdc->flags & FDC_FLAG_PS2) {
|
||||
drive = real_drive(fdc, fdc->dor & 3);
|
||||
ret = 0x00;
|
||||
/* -Drive 2 Installed */
|
||||
if (!fdd_get_type(1))
|
||||
if (!fdd_get_type(1)) /* -Drive 2 Installed */
|
||||
ret |= 0x80;
|
||||
/* -Drive Select 1,0 */
|
||||
switch (drive) {
|
||||
switch (drive) { /* -Drive Select 1,0 */
|
||||
case 0:
|
||||
ret |= 0x43;
|
||||
break;
|
||||
@@ -1279,6 +1295,11 @@ fdc_read(uint16_t addr, void *priv)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (fdc->flags & FDC_FLAG_PS2_MCA) {
|
||||
drive = real_drive(fdc, fdc->dor & 3);
|
||||
ret = 0xc0;
|
||||
ret |= (fdc->dor & 0x01) << 5; /* Drive Select 0 */
|
||||
ret |= (fdc->dor & 0x30) >> 4; /* Motor Select 1, 0 */
|
||||
} else {
|
||||
if (is486 || !fdc->enable_3f1)
|
||||
ret = 0xff;
|
||||
@@ -1287,19 +1308,12 @@ fdc_read(uint16_t addr, void *priv)
|
||||
drive = real_drive(fdc, fdc->dor & 1);
|
||||
ret = !fdd_is_dd(drive) ? ((fdc->dor & 1) ? 2 : 1) : 0;
|
||||
} else {
|
||||
ret = 0x70;
|
||||
|
||||
/* TODO: What is this and what is it used for?
|
||||
It's almost identical to the PS/2 MCA mode. */
|
||||
drive = real_drive(fdc, fdc->dor & 3);
|
||||
|
||||
if (drive)
|
||||
ret &= ~0x40;
|
||||
else
|
||||
ret &= ~0x20;
|
||||
|
||||
if (fdc->dor & 0x10)
|
||||
ret |= 1;
|
||||
if (fdc->dor & 0x20)
|
||||
ret |= 2;
|
||||
ret = 0x70;
|
||||
ret &= ~(drive ? 0x40 : 0x20);
|
||||
ret |= (fdc->dor & 0x30) >> 4; /* Motor Select 1, 0 */
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1309,7 +1323,8 @@ fdc_read(uint16_t addr, void *priv)
|
||||
break;
|
||||
case 3:
|
||||
drive = real_drive(fdc, fdc->dor & 3);
|
||||
if (fdc->flags & FDC_FLAG_PS1) {
|
||||
/* TODO: FDC_FLAG_PS2_TDR? */
|
||||
if ((fdc->flags & FDC_FLAG_PS2) || (fdc->flags & FDC_FLAG_PS2_MCA)) {
|
||||
/* PS/1 Model 2121 seems return drive type in port
|
||||
* 0x3f3, despite the 82077AA fdc_t not implementing
|
||||
* this. This is presumably implemented outside the
|
||||
@@ -1371,7 +1386,7 @@ fdc_read(uint16_t addr, void *priv)
|
||||
case 7: /*Disk change*/
|
||||
drive = real_drive(fdc, fdc->dor & 3);
|
||||
|
||||
if (fdc->flags & FDC_FLAG_PS1) {
|
||||
if (fdc->flags & FDC_FLAG_PS2) {
|
||||
if (fdc->dor & (0x10 << drive)) {
|
||||
ret = (fdd_changed[drive] || drive_empty[drive]) ? 0x00 : 0x80;
|
||||
ret |= (fdc->dor & 0x08);
|
||||
@@ -1379,6 +1394,14 @@ fdc_read(uint16_t addr, void *priv)
|
||||
ret |= (fdc->rate & 0x03);
|
||||
} else
|
||||
ret = 0x00;
|
||||
} else if (fdc->flags & FDC_FLAG_PS2_MCA) {
|
||||
if (fdc->dor & (0x10 << drive)) {
|
||||
ret = (fdd_changed[drive] || drive_empty[drive]) ? 0x80 : 0x00;
|
||||
ret |= ((fdc->rate & 0x03) << 1);
|
||||
ret |= fdc_get_densel(fdc, drive);
|
||||
ret |= 0x78;
|
||||
} else
|
||||
ret = 0xf9;
|
||||
} else {
|
||||
if (fdc->dor & (0x10 << drive)) {
|
||||
if ((drive == 1) && (fdc->flags & FDC_FLAG_TOSHIBA))
|
||||
@@ -1411,7 +1434,7 @@ static void
|
||||
fdc_poll_common_finish(fdc_t *fdc, int compare, int st5)
|
||||
{
|
||||
fdc_int(fdc, 1);
|
||||
if (!(fdc->flags & FDC_FLAG_PS1))
|
||||
if (!(fdc->flags & FDC_FLAG_FINTR))
|
||||
fdc->fintr = 0;
|
||||
fdc->stat = 0xD0;
|
||||
fdc->st0 = fdc->res[4] = (fdd_get_head(real_drive(fdc, fdc->drive)) ? 4 : 0) | fdc->rw_drive;
|
||||
@@ -1712,7 +1735,7 @@ fdc_callback(void *priv)
|
||||
} else {
|
||||
fdc->interrupt = -2;
|
||||
fdc_int(fdc, 1);
|
||||
if (!(fdc->flags & FDC_FLAG_PS1))
|
||||
if (!(fdc->flags & FDC_FLAG_FINTR))
|
||||
fdc->fintr = 0;
|
||||
fdc->stat = 0xD0;
|
||||
fdc->st0 = fdc->res[4] = (fdd_get_head(real_drive(fdc, fdc->drive)) ? 4 : 0) | fdc->drive;
|
||||
@@ -1804,7 +1827,7 @@ fdc_error(fdc_t *fdc, int st5, int st6)
|
||||
timer_disable(&fdc->timer);
|
||||
|
||||
fdc_int(fdc, 1);
|
||||
if (!(fdc->flags & FDC_FLAG_PS1))
|
||||
if (!(fdc->flags & FDC_FLAG_FINTR))
|
||||
fdc->fintr = 0;
|
||||
fdc->stat = 0xD0;
|
||||
fdc->st0 = fdc->res[4] = 0x40 | (fdd_get_head(real_drive(fdc, fdc->drive)) ? 4 : 0) | fdc->rw_drive;
|
||||
@@ -2213,7 +2236,7 @@ fdc_reset(void *priv)
|
||||
fdc->enable_3f1 = 1;
|
||||
|
||||
fdc_update_enh_mode(fdc, 0);
|
||||
if (fdc->flags & FDC_FLAG_PS1)
|
||||
if (fdc->flags & FDC_FLAG_DENSEL_INVERT)
|
||||
fdc_update_densel_polarity(fdc, 0);
|
||||
else
|
||||
fdc_update_densel_polarity(fdc, 1);
|
||||
@@ -2259,6 +2282,9 @@ fdc_reset(void *priv)
|
||||
|
||||
fdc_ctrl_reset(fdc);
|
||||
|
||||
if (!(fdc->flags & FDC_FLAG_AT))
|
||||
fdc->rate = 2;
|
||||
|
||||
fdc->max_track = (fdc->flags & FDC_FLAG_MORE_TRACKS) ? 85 : 79;
|
||||
|
||||
fdc_remove(fdc);
|
||||
@@ -2443,6 +2469,20 @@ const device_t fdc_xt_tandy_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t fdc_xt_umc_um8398_device = {
|
||||
.name = "PC/XT Floppy Drive Controller (UMC UM8398)",
|
||||
.internal_name = "fdc_xt_umc_um8398",
|
||||
.flags = 0,
|
||||
.local = FDC_FLAG_UMC,
|
||||
.init = fdc_init,
|
||||
.close = fdc_close,
|
||||
.reset = fdc_reset,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t fdc_pcjr_device = {
|
||||
.name = "PCjr Floppy Drive Controller",
|
||||
.internal_name = "fdc_pcjr",
|
||||
@@ -2527,34 +2567,6 @@ const device_t fdc_at_actlow_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t fdc_at_ps1_device = {
|
||||
.name = "PC/AT Floppy Drive Controller (PS/1, PS/2 ISA)",
|
||||
.internal_name = "fdc_at_ps1",
|
||||
.flags = 0,
|
||||
.local = FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AT | FDC_FLAG_PS1,
|
||||
.init = fdc_init,
|
||||
.close = fdc_close,
|
||||
.reset = fdc_reset,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t fdc_at_ps1_2121_device = {
|
||||
.name = "PC/AT Floppy Drive Controller (PS/1, PS/2 ISA)",
|
||||
.internal_name = "fdc_at_ps1",
|
||||
.flags = 0,
|
||||
.local = FDC_FLAG_NO_DSR_RESET | FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AT | FDC_FLAG_PS1,
|
||||
.init = fdc_init,
|
||||
.close = fdc_close,
|
||||
.reset = fdc_reset,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t fdc_at_smc_device = {
|
||||
.name = "PC/AT Floppy Drive Controller (SM(s)C FDC37Cxxx)",
|
||||
.internal_name = "fdc_at_smc",
|
||||
@@ -2611,9 +2623,9 @@ const device_t fdc_at_nsc_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t fdc_dp8473_device = {
|
||||
.name = "NS DP8473 Floppy Drive Controller",
|
||||
.internal_name = "fdc_dp8473",
|
||||
const device_t fdc_at_nsc_dp8473_device = {
|
||||
.name = "PC/AT Floppy Drive Controller (NSC DP8473)",
|
||||
.internal_name = "fdc_at_nsc_dp8473",
|
||||
.flags = 0,
|
||||
.local = FDC_FLAG_AT | FDC_FLAG_NEC | FDC_FLAG_NO_DSR_RESET,
|
||||
.init = fdc_init,
|
||||
@@ -2625,11 +2637,27 @@ const device_t fdc_dp8473_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t fdc_um8398_device = {
|
||||
.name = "UMC UM8398 Floppy Drive Controller",
|
||||
.internal_name = "fdc_um8398",
|
||||
const device_t fdc_ps2_device = {
|
||||
.name = "PS/2 Model 25/30 Floppy Drive Controller",
|
||||
.internal_name = "fdc_ps2",
|
||||
.flags = 0,
|
||||
.local = FDC_FLAG_UMC,
|
||||
.local = FDC_FLAG_FINTR | FDC_FLAG_DENSEL_INVERT | FDC_FLAG_NO_DSR_RESET | FDC_FLAG_DISKCHG_ACTLOW |
|
||||
FDC_FLAG_AT | FDC_FLAG_PS2,
|
||||
.init = fdc_init,
|
||||
.close = fdc_close,
|
||||
.reset = fdc_reset,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t fdc_ps2_mca_device = {
|
||||
.name = "PS/2 MCA Floppy Drive Controller",
|
||||
.internal_name = "fdc_ps2_mca",
|
||||
.flags = 0,
|
||||
.local = FDC_FLAG_FINTR | FDC_FLAG_DENSEL_INVERT | FDC_FLAG_NO_DSR_RESET | FDC_FLAG_AT |
|
||||
FDC_FLAG_PS2_MCA,
|
||||
.init = fdc_init,
|
||||
.close = fdc_close,
|
||||
.reset = fdc_reset,
|
||||
|
||||
@@ -95,7 +95,7 @@ b215_init(UNUSED(const device_t *info))
|
||||
|
||||
rom_init(&dev->rom, ROM_B215, ROM_ADDR, 0x2000, 0x1fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
dev->fdc_controller = device_add(&fdc_um8398_device);
|
||||
dev->fdc_controller = device_add(&fdc_xt_umc_um8398_device);
|
||||
io_sethandler(FDC_PRIMARY_ADDR, 1, b215_read, NULL, NULL, NULL, NULL, NULL, dev);
|
||||
|
||||
return dev;
|
||||
|
||||
@@ -75,7 +75,7 @@ MiniMicro 4 also won't work with the XT FDC which the Zilog claims to be.
|
||||
#include <86box/fdc_ext.h>
|
||||
|
||||
#define DTK_VARIANT ((info->local == 158) ? ROM_PII_158B : ROM_PII_151B)
|
||||
#define DTK_CHIP ((info->local == 158) ? &fdc_xt_device : &fdc_dp8473_device)
|
||||
#define DTK_CHIP ((info->local == 158) ? &fdc_xt_device : &fdc_at_nsc_dp8473_device)
|
||||
#define BIOS_ADDR (uint32_t)(device_get_config_hex20("bios_addr") & 0x000fffff)
|
||||
#define ROM_PII_151B "roms/floppy/dtk/pii-151b.rom"
|
||||
#define ROM_PII_158B "roms/floppy/dtk/pii-158b.rom"
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/ui.h>
|
||||
@@ -153,20 +154,16 @@ static const struct {
|
||||
{ 43, FLAG_RPM_300 | FLAG_525 | FLAG_DS | FLAG_HOLE0, "5.25\" 360k", "525_2dd" },
|
||||
/* 5.25" QD */
|
||||
{ 86, FLAG_RPM_300 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "5.25\" 720k", "525_2qd" },
|
||||
/* 5.25" HD PS/2 */
|
||||
{ 86, FLAG_RPM_360 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP | FLAG_INVERT_DENSEL | FLAG_PS2, "5.25\" 1.2M PS/2", "525_2hd_ps2" },
|
||||
/* 5.25" HD */
|
||||
{ 86, FLAG_RPM_360 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "5.25\" 1.2M", "525_2hd" },
|
||||
{ 86, FLAG_RPM_360 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP | FLAG_PS2, "5.25\" 1.2M", "525_2hd" },
|
||||
/* 5.25" HD Dual RPM */
|
||||
{ 86, FLAG_RPM_300 | FLAG_RPM_360 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "5.25\" 1.2M 300/360 RPM", "525_2hd_dualrpm" },
|
||||
/* 3.5" 1DD */
|
||||
{ 86, FLAG_RPM_300 | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "3.5\" 360k", "35_1dd" },
|
||||
/* 3.5" DD, Equivalent to TEAC FD-235F */
|
||||
{ 86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "3.5\" 720k", "35_2dd" },
|
||||
/* 3.5" HD PS/2 */
|
||||
{ 86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP | FLAG_INVERT_DENSEL | FLAG_PS2, "3.5\" 1.44M PS/2", "35_2hd_ps2" },
|
||||
/* 3.5" HD, Equivalent to TEAC FD-235HF */
|
||||
{ 86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "3.5\" 1.44M", "35_2hd" },
|
||||
{ 86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP | FLAG_PS2, "3.5\" 1.44M", "35_2hd" },
|
||||
/* TODO: 3.5" DD, Equivalent to TEAC FD-235GF */
|
||||
// { 86, FLAG_RPM_300 | FLAG_RPM_360 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "3.5\" 1.25M", "35_2hd_2mode" },
|
||||
/* 3.5" HD PC-98 */
|
||||
@@ -214,10 +211,19 @@ fdd_get_internal_name(int type)
|
||||
int
|
||||
fdd_get_from_internal_name(char *s)
|
||||
{
|
||||
int c = 0;
|
||||
int c = 0;
|
||||
char *n;
|
||||
|
||||
/* TODO: Remove this once the migration period is over. */
|
||||
if (!strcmp(s, "525_2hd_ps2"))
|
||||
n = "525_2hd";
|
||||
else if (!strcmp(s, "35_2hd_ps2"))
|
||||
n = "35_2hd";
|
||||
else
|
||||
n = s;
|
||||
|
||||
while (strlen(drive_types[c].internal_name)) {
|
||||
if (!strcmp((char *) drive_types[c].internal_name, s))
|
||||
if (!strcmp((char *) drive_types[c].internal_name, n))
|
||||
return c;
|
||||
c++;
|
||||
}
|
||||
@@ -282,11 +288,32 @@ fdd_current_track(int drive)
|
||||
return fdd[drive].track;
|
||||
}
|
||||
|
||||
static int
|
||||
fdd_type_invert_densel(int type)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (drive_types[type].flags & FLAG_PS2)
|
||||
ret = !!strstr(machine_getname(), "PS/");
|
||||
else
|
||||
ret = drive_types[type].flags & FLAG_INVERT_DENSEL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
fdd_invert_densel(int drive)
|
||||
{
|
||||
int ret = fdd_type_invert_densel(fdd[drive].type);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
fdd_set_densel(int densel)
|
||||
{
|
||||
for (uint8_t i = 0; i < FDD_NUM; i++) {
|
||||
if (drive_types[fdd[i].type].flags & FLAG_INVERT_DENSEL)
|
||||
if (fdd_invert_densel(i))
|
||||
fdd[i].densel = densel ^ 1;
|
||||
else
|
||||
fdd[i].densel = densel;
|
||||
@@ -302,7 +329,7 @@ fdd_getrpm(int drive)
|
||||
hole = fdd_hole(drive);
|
||||
densel = fdd[drive].densel;
|
||||
|
||||
if (drive_types[fdd[drive].type].flags & FLAG_INVERT_DENSEL)
|
||||
if (fdd_invert_densel(drive))
|
||||
densel ^= 1;
|
||||
|
||||
if (!(drive_types[fdd[drive].type].flags & FLAG_RPM_360))
|
||||
@@ -340,10 +367,9 @@ fdd_doublestep_40(int drive)
|
||||
void
|
||||
fdd_set_type(int drive, int type)
|
||||
{
|
||||
int old_type = fdd[drive].type;
|
||||
fdd[drive].type = type;
|
||||
if ((drive_types[old_type].flags ^ drive_types[type].flags) & FLAG_INVERT_DENSEL)
|
||||
if (fdd_type_invert_densel(fdd[drive].type) != fdd_type_invert_densel(type))
|
||||
fdd[drive].densel ^= 1;
|
||||
fdd[drive].type = type;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -41,20 +41,23 @@
|
||||
#define FDC_FLAG_PCJR 0x01 /* PCjr */
|
||||
#define FDC_FLAG_DISKCHG_ACTLOW 0x02 /* Amstrad, PS/1, PS/2 ISA */
|
||||
#define FDC_FLAG_AT 0x04 /* AT+, PS/x */
|
||||
#define FDC_FLAG_PS1 0x08 /* PS/1, PS/2 ISA */
|
||||
#define FDC_FLAG_SUPERIO 0x10 /* Super I/O chips */
|
||||
#define FDC_FLAG_START_RWC_1 0x20 /* W83877F, W83977F */
|
||||
#define FDC_FLAG_MORE_TRACKS 0x40 /* W83877F, W83977F, PC87306, PC87309 */
|
||||
#define FDC_FLAG_NSC 0x80 /* PC87306, PC87309 */
|
||||
#define FDC_FLAG_TOSHIBA 0x100 /* T1000, T1200 */
|
||||
#define FDC_FLAG_AMSTRAD 0x200 /* Non-AT Amstrad machines */
|
||||
#define FDC_FLAG_UMC 0x400 /* UMC UM8398 */
|
||||
#define FDC_FLAG_ALI 0x800 /* ALi M512x / M1543C */
|
||||
#define FDC_FLAG_NO_DSR_RESET 0x1000 /* Has no DSR reset */
|
||||
#define FDC_FLAG_NEC 0x2000 /* Is NEC upd765-compatible */
|
||||
#define FDC_FLAG_SEC 0x10000 /* Is Secondary */
|
||||
#define FDC_FLAG_TER 0x20000 /* Is Tertiary */
|
||||
#define FDC_FLAG_QUA 0x40000 /* Is Quaternary */
|
||||
#define FDC_FLAG_PS2 0x08 /* PS/1, PS/2 ISA */
|
||||
#define FDC_FLAG_PS2_MCA 0x10 /* PS/2 MCA */
|
||||
#define FDC_FLAG_SUPERIO 0x20 /* Super I/O chips */
|
||||
#define FDC_FLAG_START_RWC_1 0x40 /* W83877F, W83977F */
|
||||
#define FDC_FLAG_MORE_TRACKS 0x80 /* W83877F, W83977F, PC87306, PC87309 */
|
||||
#define FDC_FLAG_NSC 0x100 /* PC87306, PC87309 */
|
||||
#define FDC_FLAG_TOSHIBA 0x200 /* T1000, T1200 */
|
||||
#define FDC_FLAG_AMSTRAD 0x400 /* Non-AT Amstrad machines */
|
||||
#define FDC_FLAG_UMC 0x800 /* UMC UM8398 */
|
||||
#define FDC_FLAG_ALI 0x1000 /* ALi M512x / M1543C */
|
||||
#define FDC_FLAG_NO_DSR_RESET 0x2000 /* Has no DSR reset */
|
||||
#define FDC_FLAG_DENSEL_INVERT 0x4000 /* Invert DENSEL polarity */
|
||||
#define FDC_FLAG_FINTR 0x8000 /* Raise FINTR on data command finish */
|
||||
#define FDC_FLAG_NEC 0x10000 /* Is NEC upd765-compatible */
|
||||
#define FDC_FLAG_SEC 0x20000 /* Is Secondary */
|
||||
#define FDC_FLAG_TER 0x40000 /* Is Tertiary */
|
||||
#define FDC_FLAG_QUA 0x80000 /* Is Quaternary */
|
||||
|
||||
typedef struct fdc_t {
|
||||
uint8_t dor;
|
||||
@@ -244,20 +247,20 @@ extern const device_t fdc_xt_qua_device;
|
||||
extern const device_t fdc_xt_t1x00_device;
|
||||
extern const device_t fdc_xt_tandy_device;
|
||||
extern const device_t fdc_xt_amstrad_device;
|
||||
extern const device_t fdc_xt_umc_um8398_device;
|
||||
extern const device_t fdc_pcjr_device;
|
||||
extern const device_t fdc_at_device;
|
||||
extern const device_t fdc_at_sec_device;
|
||||
extern const device_t fdc_at_ter_device;
|
||||
extern const device_t fdc_at_qua_device;
|
||||
extern const device_t fdc_at_actlow_device;
|
||||
extern const device_t fdc_at_ps1_device;
|
||||
extern const device_t fdc_at_ps1_2121_device;
|
||||
extern const device_t fdc_at_smc_device;
|
||||
extern const device_t fdc_at_ali_device;
|
||||
extern const device_t fdc_at_winbond_device;
|
||||
extern const device_t fdc_at_nsc_device;
|
||||
extern const device_t fdc_dp8473_device;
|
||||
extern const device_t fdc_um8398_device;
|
||||
extern const device_t fdc_at_nsc_dp8473_device;
|
||||
extern const device_t fdc_ps2_device;
|
||||
extern const device_t fdc_ps2_mca_device;
|
||||
#endif
|
||||
|
||||
#endif /*EMU_FDC_H*/
|
||||
|
||||
@@ -323,6 +323,8 @@ ps1_setup(int model)
|
||||
|
||||
device_add(&ps_nvr_device);
|
||||
|
||||
device_add(&fdc_ps2_device);
|
||||
|
||||
if (model == 2011) {
|
||||
if (!strcmp("english_us", device_get_config_bios("bios_language"))) {
|
||||
/* US English */
|
||||
@@ -350,8 +352,6 @@ ps1_setup(int model)
|
||||
|
||||
device_add(&ps1snd_device);
|
||||
|
||||
device_add(&fdc_at_ps1_device);
|
||||
|
||||
/* Enable the builtin HDC. */
|
||||
if (hdc_current[0] == HDC_INTERNAL) {
|
||||
priv = device_add(&ps1_hdc_device);
|
||||
@@ -378,8 +378,6 @@ ps1_setup(int model)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&ibm_ps1_2121_device);
|
||||
|
||||
device_add(&fdc_at_ps1_2121_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
|
||||
device_add(&ps1snd_device);
|
||||
|
||||
@@ -462,7 +462,6 @@ static const geom_t ibm_type_table[] = {
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
#define ENABLE_PS1_HDC_LOG 1
|
||||
#ifdef ENABLE_PS1_HDC_LOG
|
||||
int ps1_hdc_do_log = ENABLE_PS1_HDC_LOG;
|
||||
|
||||
@@ -721,7 +720,9 @@ hdc_callback(void *priv)
|
||||
off64_t addr;
|
||||
int no_data = 0;
|
||||
int val;
|
||||
#ifdef ENABLE_PS1_HDC_LOG
|
||||
uint8_t cmd = ccb->cmd & 0x0f;
|
||||
#endif
|
||||
|
||||
/* Clear the SSB error bits. */
|
||||
dev->ssb.track_0 = 0;
|
||||
|
||||
@@ -176,7 +176,7 @@ ps2_isa_setup(int model, int cpu_type)
|
||||
|
||||
device_add(&ps_nvr_device);
|
||||
|
||||
device_add(&fdc_at_ps1_device);
|
||||
device_add(&fdc_ps2_device);
|
||||
|
||||
/* Enable the builtin HDC. */
|
||||
if (hdc_current[0] == HDC_INTERNAL) {
|
||||
|
||||
@@ -1396,7 +1396,7 @@ machine_ps2_common_init(const machine_t *model)
|
||||
machine_common_init(model);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&fdc_ps2_mca_device);
|
||||
|
||||
dma16_init();
|
||||
ps2_dma_init();
|
||||
|
||||
@@ -1372,13 +1372,13 @@ msgid "This machine might have been moved or copied."
|
||||
msgstr "这台机器可能被移动或复制过。"
|
||||
|
||||
msgid "In order to ensure proper networking functionality, 86Box needs to know if this machine was moved or copied.\n\nSelect \"I Copied It\" if you are not sure."
|
||||
msgstr "为了确保网络功能正常,86Box需要知道这台机器是否被移动或复制。\n\n如果您不确定,请选择\"我复制了它\"。"
|
||||
msgstr "为了确保网络功能正常,86Box需要知道这台机器是否被移动或复制。\n\n如果您不确定,请选择\"我已复制这台机器\"。"
|
||||
|
||||
msgid "I Moved It"
|
||||
msgstr "我移动了它"
|
||||
msgstr "我已移动这台机器"
|
||||
|
||||
msgid "I Copied It"
|
||||
msgstr "我复制了它"
|
||||
msgstr "我已复制这台机器"
|
||||
|
||||
msgid "86Box Monitor #"
|
||||
msgstr "86Box 监测器 "
|
||||
|
||||
@@ -1372,13 +1372,13 @@ msgid "This machine might have been moved or copied."
|
||||
msgstr "這台機器可能已被移動或複製。"
|
||||
|
||||
msgid "In order to ensure proper networking functionality, 86Box needs to know if this machine was moved or copied.\n\nSelect \"I Copied It\" if you are not sure."
|
||||
msgstr "為了確保正常的網路功能,86Box 需要知道這台機器是否被移動或複製。\n\n如果您不確定,請選擇「我複製了它」。"
|
||||
msgstr "為了確保正常的網路功能,86Box 需要知道這台機器是否被移動或複製。\n\n如果您不確定,請選擇「我已複製這台機器」。"
|
||||
|
||||
msgid "I Moved It"
|
||||
msgstr "我移動了它"
|
||||
msgstr "我已移動這台機器"
|
||||
|
||||
msgid "I Copied It"
|
||||
msgstr "我複製了它"
|
||||
msgstr "我已複製這台機器"
|
||||
|
||||
msgid "86Box Monitor #"
|
||||
msgstr "86Box Monitor "
|
||||
|
||||
Reference in New Issue
Block a user