示例#1
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));
}
示例#2
0
void dragon_fdc_device_base::update_lines()
{
	// set the NMI line
	set_line_value(line::NMI, intrq() && (dskreg() & 0x20));

	// set the CART line
	set_line_value(line::CART, drq());
}
示例#3
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));
}