mirror of
https://github.com/holub/mame
synced 2025-07-05 09:57:47 +03:00
bml3mp1802: updated to use the new wd fdc. changes are untested, system
is not working.
This commit is contained in:
parent
0b593e25ea
commit
875a901dc2
@ -23,12 +23,9 @@
|
|||||||
|
|
||||||
const device_type BML3BUS_MP1802 = &device_creator<bml3bus_mp1802_device>;
|
const device_type BML3BUS_MP1802 = &device_creator<bml3bus_mp1802_device>;
|
||||||
|
|
||||||
static const floppy_interface bml3_mp1802_floppy_interface =
|
static SLOT_INTERFACE_START( mp1802_floppies )
|
||||||
{
|
SLOT_INTERFACE("dd", FLOPPY_525_DD)
|
||||||
FLOPPY_STANDARD_5_25_DSDD,
|
SLOT_INTERFACE_END
|
||||||
LEGACY_FLOPPY_OPTIONS_NAME(default),
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
WRITE_LINE_MEMBER( bml3bus_mp1802_device::bml3_wd17xx_intrq_w )
|
WRITE_LINE_MEMBER( bml3bus_mp1802_device::bml3_wd17xx_intrq_w )
|
||||||
{
|
{
|
||||||
@ -46,11 +43,13 @@ ROM_START( mp1802 )
|
|||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
MACHINE_CONFIG_FRAGMENT( mp1802 )
|
MACHINE_CONFIG_FRAGMENT( mp1802 )
|
||||||
MCFG_DEVICE_ADD("wd17xx", MB8866, 0)
|
MCFG_MB8866x_ADD("fdc", XTAL_1MHz)
|
||||||
MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
|
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(bml3bus_mp1802_device, bml3_wd17xx_intrq_w))
|
||||||
MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(bml3bus_mp1802_device, bml3_wd17xx_intrq_w))
|
|
||||||
|
|
||||||
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bml3_mp1802_floppy_interface)
|
MCFG_FLOPPY_DRIVE_ADD("fdc:0", mp1802_floppies, "dd", floppy_image_device::default_floppy_formats)
|
||||||
|
MCFG_FLOPPY_DRIVE_ADD("fdc:1", mp1802_floppies, "dd", floppy_image_device::default_floppy_formats)
|
||||||
|
MCFG_FLOPPY_DRIVE_ADD("fdc:2", mp1802_floppies, "", floppy_image_device::default_floppy_formats)
|
||||||
|
MCFG_FLOPPY_DRIVE_ADD("fdc:3", mp1802_floppies, "", floppy_image_device::default_floppy_formats)
|
||||||
MACHINE_CONFIG_END
|
MACHINE_CONFIG_END
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@ -78,34 +77,28 @@ const rom_entry *bml3bus_mp1802_device::device_rom_region() const
|
|||||||
|
|
||||||
READ8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_r)
|
READ8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_r)
|
||||||
{
|
{
|
||||||
return m_wd17xx->drq_r() ? 0x00 : 0x80;
|
return m_fdc->drq_r() ? 0x00 : 0x80;
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_w)
|
WRITE8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_w)
|
||||||
{
|
{
|
||||||
int drive = data & 0x03;
|
floppy_image_device *floppy = NULL;
|
||||||
int side = BIT(data, 4);
|
|
||||||
int motor = BIT(data, 3);
|
switch (data & 0x03)
|
||||||
const char *floppy_name = NULL;
|
{
|
||||||
switch (drive) {
|
case 0: floppy = m_floppy0->get_device(); break;
|
||||||
case 0:
|
case 1: floppy = m_floppy1->get_device(); break;
|
||||||
floppy_name = FLOPPY_0;
|
case 2: floppy = m_floppy2->get_device(); break;
|
||||||
break;
|
case 3: floppy = m_floppy3->get_device(); break;
|
||||||
case 1:
|
}
|
||||||
floppy_name = FLOPPY_1;
|
|
||||||
break;
|
m_fdc->set_floppy(floppy);
|
||||||
case 2:
|
|
||||||
floppy_name = FLOPPY_2;
|
if (floppy)
|
||||||
break;
|
{
|
||||||
case 3:
|
floppy->mon_w(!BIT(data, 3));
|
||||||
floppy_name = FLOPPY_3;
|
floppy->ss_w(BIT(data, 4));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
legacy_floppy_image_device *floppy = subdevice<legacy_floppy_image_device>(floppy_name);
|
|
||||||
m_wd17xx->set_drive(drive);
|
|
||||||
floppy->floppy_mon_w(!motor);
|
|
||||||
floppy->floppy_drive_set_ready_state(ASSERT_LINE, 0);
|
|
||||||
m_wd17xx->set_side(side);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -116,7 +109,11 @@ WRITE8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_w)
|
|||||||
bml3bus_mp1802_device::bml3bus_mp1802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
bml3bus_mp1802_device::bml3bus_mp1802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||||
device_t(mconfig, BML3BUS_MP1802, "Hitachi MP-1802 Floppy Controller Card", tag, owner, clock, "bml3mp1802", __FILE__),
|
device_t(mconfig, BML3BUS_MP1802, "Hitachi MP-1802 Floppy Controller Card", tag, owner, clock, "bml3mp1802", __FILE__),
|
||||||
device_bml3bus_card_interface(mconfig, *this),
|
device_bml3bus_card_interface(mconfig, *this),
|
||||||
m_wd17xx(*this, "wd17xx")
|
m_fdc(*this, "fdc"),
|
||||||
|
m_floppy0(*this, "fdc:0"),
|
||||||
|
m_floppy1(*this, "fdc:1"),
|
||||||
|
m_floppy2(*this, "fdc:2"),
|
||||||
|
m_floppy3(*this, "fdc:3")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,8 +131,8 @@ void bml3bus_mp1802_device::device_start()
|
|||||||
|
|
||||||
// install into memory
|
// install into memory
|
||||||
address_space &space_prg = machine().firstcpu->space(AS_PROGRAM);
|
address_space &space_prg = machine().firstcpu->space(AS_PROGRAM);
|
||||||
space_prg.install_readwrite_handler(0xff00, 0xff03, read8_delegate(FUNC(mb8866_device::read),(mb8866_device*)m_wd17xx), write8_delegate(FUNC(mb8866_device::write),(mb8866_device*)m_wd17xx));
|
space_prg.install_readwrite_handler(0xff00, 0xff03, read8_delegate(FUNC(mb8866_t::read),(mb8866_t*)m_fdc), write8_delegate(FUNC(mb8866_t::write),(mb8866_t*)m_fdc));
|
||||||
space_prg.install_readwrite_handler(0xff04, 0xff04, read8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_r), this), write8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_w), this) );
|
space_prg.install_readwrite_handler(0xff04, 0xff04, read8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_r), this), write8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_w), this));
|
||||||
// overwriting the main ROM (rather than using e.g. install_rom) should mean that bank switches for RAM expansion still work...
|
// overwriting the main ROM (rather than using e.g. install_rom) should mean that bank switches for RAM expansion still work...
|
||||||
UINT8 *mainrom = device().machine().root_device().memregion("maincpu")->base();
|
UINT8 *mainrom = device().machine().root_device().memregion("maincpu")->base();
|
||||||
memcpy(mainrom + 0xf800, m_rom + 0xf800, 0x800);
|
memcpy(mainrom + 0xf800, m_rom + 0xf800, 0x800);
|
||||||
|
@ -15,7 +15,8 @@
|
|||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "bml3bus.h"
|
#include "bml3bus.h"
|
||||||
#include "imagedev/flopdrv.h"
|
#include "imagedev/flopdrv.h"
|
||||||
#include "machine/wd17xx.h"
|
#include "machine/wd_fdc.h"
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// TYPE DEFINITIONS
|
// TYPE DEFINITIONS
|
||||||
@ -36,13 +37,18 @@ public:
|
|||||||
DECLARE_READ8_MEMBER(bml3_mp1802_r);
|
DECLARE_READ8_MEMBER(bml3_mp1802_r);
|
||||||
DECLARE_WRITE8_MEMBER(bml3_mp1802_w);
|
DECLARE_WRITE8_MEMBER(bml3_mp1802_w);
|
||||||
DECLARE_WRITE_LINE_MEMBER(bml3_wd17xx_intrq_w);
|
DECLARE_WRITE_LINE_MEMBER(bml3_wd17xx_intrq_w);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
virtual void device_reset();
|
virtual void device_reset();
|
||||||
|
|
||||||
required_device<mb8866_device> m_wd17xx;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
required_device<mb8866_t> m_fdc;
|
||||||
|
required_device<floppy_connector> m_floppy0;
|
||||||
|
required_device<floppy_connector> m_floppy1;
|
||||||
|
required_device<floppy_connector> m_floppy2;
|
||||||
|
required_device<floppy_connector> m_floppy3;
|
||||||
|
|
||||||
UINT8 *m_rom;
|
UINT8 *m_rom;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user