示例#1
0
void dragon_fdc_device_base::dskreg_w(uint8_t data)
{
	if (LOG_FDC)
	{
		logerror("fdc_dragon_dskreg_w(): %c%c%c%c%c%c%c%c ($%02x)\n",
			BIT(data, 7) ? 'X' : 'x',
			BIT(data, 6) ? 'X' : 'x',
			BIT(data, 5) ? 'N' : 'n',
			BIT(data, 4) ? 'P' : 'p',
			BIT(data, 3) ? 'S' : 'D',
			BIT(data, 2) ? 'M' : 'm',
			BIT(data, 1) ? '1' : '0',
			BIT(data, 0) ? '1' : '0',
			data);
	}

	// update the motor on each floppy
	for (int i = 0; i < 4; i++)
	{
		floppy_image_device *floppy = m_floppies[i]->get_device();
		if (floppy)
			floppy->mon_w(BIT(data,2) && (i == (data & 0x03)) ? CLEAR_LINE : ASSERT_LINE);
	}

	// manipulate the WD2797
	m_wd2797->set_floppy(m_floppies[data & 0x03]->get_device());
	m_wd2797->dden_w(BIT(data, 3));

	set_dskreg(data);
}
示例#2
0
文件: coco_fdc.cpp 项目: qwijibo/mame
void coco_fdc_device_base::dskreg_w(uint8_t data)
{
	uint8_t drive = 0;
	uint8_t head;

	if (LOG_FDC)
	{
		logerror("fdc_coco_dskreg_w(): %c%c%c%c%c%c%c%c ($%02x)\n",
			data & 0x80 ? 'H' : 'h',
			data & 0x40 ? '3' : '.',
			data & 0x20 ? 'D' : 'S',
			data & 0x10 ? 'P' : 'p',
			data & 0x08 ? 'M' : 'm',
			data & 0x04 ? '2' : '.',
			data & 0x02 ? '1' : '.',
			data & 0x01 ? '0' : '.',
			data);
	}

	// An email from John Kowalski informed me that if the DS3 is
	// high, and one of the other drive bits is selected (DS0-DS2), then the
	// second side of DS0, DS1, or DS2 is selected.  If multiple bits are
	// selected in other situations, then both drives are selected, and any
	// read signals get yucky.

	if (data & 0x04)
		drive = 2;
	else if (data & 0x02)
		drive = 1;
	else if (data & 0x01)
		drive = 0;
	else if (data & 0x40)
		drive = 3;

	// the motor is always turned on or off for all drives
	for (int i = 0; i < 4; i++)
	{
		floppy_image_device *floppy = m_floppies[i]->get_device();
		if (floppy)
			floppy->mon_w(BIT(data, 3) ? 0 : 1);
	}

	head = ((data & 0x40) && (drive != 3)) ? 1 : 0;

	set_dskreg(data);

	update_lines();

	floppy_image_device *selected_floppy = m_floppies[drive]->get_device();
	m_wd17xx->set_floppy(selected_floppy);

	if (selected_floppy)
		selected_floppy->ss_w(head);

	m_wd17xx->dden_w(!BIT(dskreg(), 5));
}
示例#3
0
文件: coco_fdc.cpp 项目: qwijibo/mame
void coco_fdc_device_base::update_lines()
{
	// clear HALT enable under certain circumstances
	if (intrq() && (dskreg() & 0x20))
		set_dskreg(dskreg() & ~0x80);  // clear halt enable

	// set the NMI line
	set_line_value(line::NMI, intrq() && (dskreg() & 0x20));

	// set the HALT line
	set_line_value(line::HALT, !drq() && (dskreg() & 0x80));
}
示例#4
0
void premier_fdc_device_base::dskreg_w(uint8_t data)
{
	if (LOG_FDC)
	{
		logerror("fdc_premier_dskreg_w(): %c%c%c%c%c%c%c%c ($%02x)\n",
			BIT(data, 7) ? 'X' : 'x',
			BIT(data, 6) ? 'X' : 'x',
			BIT(data, 5) ? 'X' : 'x',
			BIT(data, 4) ? 'D' : 'S',
			BIT(data, 3) ? '8' : '5',
			BIT(data, 2) ? '1' : '0',
			BIT(data, 1) ? '1' : '0',
			BIT(data, 0) ? '1' : '0',
			data);
	}
	floppy_image_device *floppy = nullptr;

	// update the motor on each floppy
	for (int i = 0; i < 4; i++)
	{
		floppy = m_floppies[i]->get_device();
		if (floppy)
			floppy->mon_w((i == (data & 0x03)) ? CLEAR_LINE : ASSERT_LINE );
	}
	floppy = m_floppies[data & 0x03]->get_device();

	// manipulate the WD2791
	m_wd2791->set_floppy(floppy);

	if (floppy)
		floppy->ss_w(BIT(data, 2));

	m_wd2791->dden_w(!BIT(data, 4));

	set_dskreg(data);
}