(MESS) ql: Expansions WIP. (nw)

This commit is contained in:
Curt Coder 2014-06-03 11:58:17 +00:00
parent 48b70caf5b
commit 402d5e4d2d
3 changed files with 142 additions and 32 deletions

View file

@ -38,32 +38,4 @@
</part>
</software>
<software name="trumpcrd">
<description>Trump Card (v2.15)</description>
<year>198?</year>
<publisher>Miracle Systems</publisher>
<part name="cart" interface="ql_cart">
<feature name="slot" value="trumpcard" />
<dataarea name="rom" size="0x8000">
<rom name="trumpcard-125.rom" size="0x8000" crc="938eaa46" sha1="9b3458cf3a279ed86ba395dc45c8f26939d6c44d" offset="0" />
</dataarea>
</part>
</software>
<software name="superdsk">
<description>Super Disk</description>
<year>198?</year>
<publisher>Sandy</publisher>
<part name="cart" interface="ql_cart">
<feature name="slot" value="superdisk" />
<dataarea name="rom" size="0x4000">
<rom name="sandysuperdisk.rom" size="0x4000" crc="b52077da" sha1="bf531758145ffd083e01c1cf9c45d0e9264a3b53" offset="0" />
</dataarea>
</part>
</software>
</softwarelist>

View file

@ -18,6 +18,7 @@
//**************************************************************************
#define WD1772_TAG "wd1772"
#define TTL74273_TAG "ttl74273"
#define CENTRONICS_TAG "centronics"
@ -67,18 +68,29 @@ FLOPPY_FORMATS_MEMBER( sandy_super_disk_t::floppy_formats )
FLOPPY_FORMATS_END
//-------------------------------------------------
// centronics
//-------------------------------------------------
WRITE_LINE_MEMBER( sandy_super_disk_t::busy_w )
{
m_busy = state;
check_interrupt();
}
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( sandy_super_disk )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( sandy_super_disk )
MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, 8000000)
//MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(sandy_super_disk_t, fdc_intrq_w))
//MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(sandy_super_disk_t, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", sandy_super_disk_floppies, "35dd", sandy_super_disk_t::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":1", sandy_super_disk_floppies, NULL, sandy_super_disk_t::floppy_formats)
MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(sandy_super_disk_t, busy_w))
MCFG_CENTRONICS_OUTPUT_LATCH_ADD(TTL74273_TAG, CENTRONICS_TAG)
MACHINE_CONFIG_END
@ -105,8 +117,13 @@ machine_config_constructor sandy_super_disk_t::device_mconfig_additions() const
sandy_super_disk_t::sandy_super_disk_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, SANDY_SUPER_DISK, "Sandy Super Disk", tag, owner, clock, "sandy_super_disk", __FILE__),
device_ql_expansion_card_interface(mconfig, *this),
m_fdc(*this, WD1772_TAG),
m_floppy0(*this, WD1772_TAG":0"),
m_floppy1(*this, WD1772_TAG":1"),
m_centronics(*this, CENTRONICS_TAG),
m_latch(*this, TTL74273_TAG),
m_rom(*this, "rom"),
m_ram(*this, "ram")
m_busy(1)
{
}
@ -126,6 +143,12 @@ void sandy_super_disk_t::device_start()
void sandy_super_disk_t::device_reset()
{
m_fdc->reset();
m_fdc->set_floppy(NULL);
m_fdc->dden_w(0);
m_latch->write(0);
m_centronics->write_strobe(1);
}
@ -135,6 +158,42 @@ void sandy_super_disk_t::device_reset()
UINT8 sandy_super_disk_t::read(address_space &space, offs_t offset, UINT8 data)
{
if ((offset & 0xf0000) == 0xc0000)
{
if ((offset & 0xffc0) == 0x3fc0)
{
switch ((offset >> 2) & 0x03)
{
case 0:
data = m_fdc->read(space, offset & 0x03);
break;
case 3:
/*
bit description
0 BUSY
1
2
3
4
5
6
7
*/
data = m_busy;
break;
}
}
else
{
data = m_rom->base()[offset & 0x3fff];
}
}
return data;
}
@ -145,4 +204,72 @@ UINT8 sandy_super_disk_t::read(address_space &space, offs_t offset, UINT8 data)
void sandy_super_disk_t::write(address_space &space, offs_t offset, UINT8 data)
{
if ((offset & 0xf0000) == 0xc0000)
{
if ((offset & 0xffc0) == 0x3fc0)
{
switch ((offset >> 2) & 0x03)
{
case 0:
m_fdc->write(space, offset & 0x03, data);
break;
case 1:
{
/*
bit description
0 SIDE ONE
1 DSEL0
2 DSEL1
3 M ON0
4 /DDEN
5 STROBE inverted
6 enable printer interrupt
7
*/
floppy_image_device *floppy = NULL;
if (BIT(data, 1))
{
floppy = m_floppy0->get_device();
}
else if (BIT(data, 2))
{
floppy = m_floppy1->get_device();
}
m_fdc->set_floppy(floppy);
if (floppy)
{
floppy->ss_w(BIT(data, 0));
floppy->mon_w(BIT(data, 3));
}
m_fdc->dden_w(BIT(data, 4));
m_centronics->write_strobe(!BIT(data, 5));
m_fd6 = BIT(data, 6);
check_interrupt();
}
break;
case 2:
m_latch->write(data);
break;
}
}
}
}
void sandy_super_disk_t::check_interrupt()
{
int extint = m_fd6 && m_busy;
m_slot->extintl_w(extint ? ASSERT_LINE : CLEAR_LINE);
}

View file

@ -38,6 +38,8 @@ public:
virtual const rom_entry *device_rom_region() const;
virtual machine_config_constructor device_mconfig_additions() const;
WRITE_LINE_MEMBER( busy_w );
DECLARE_FLOPPY_FORMATS( floppy_formats );
protected:
@ -50,8 +52,17 @@ protected:
virtual void write(address_space &space, offs_t offset, UINT8 data);
private:
void check_interrupt();
required_device<wd1772_t> m_fdc;
required_device<floppy_connector> m_floppy0;
required_device<floppy_connector> m_floppy1;
required_device<centronics_device> m_centronics;
required_device<output_latch_device> m_latch;
required_memory_region m_rom;
optional_shared_ptr<UINT8> m_ram;
int m_busy;
int m_fd6;
};