mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
myb3k: Added three new ISA8 cards, one COM card and two FDC, specific for the MyBrain 3000 and its branded variants JB-3000 and Ericsson PC step/one
This commit is contained in:
parent
412ef97d71
commit
2922b345d5
@ -1079,6 +1079,10 @@ if (BUSES["ISA"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/isa/num9rev.h",
|
||||
MAME_DIR .. "src/devices/bus/isa/mcd.cpp",
|
||||
MAME_DIR .. "src/devices/bus/isa/mcd.h",
|
||||
MAME_DIR .. "src/devices/bus/isa/myb3k_com.cpp",
|
||||
MAME_DIR .. "src/devices/bus/isa/myb3k_com.h",
|
||||
MAME_DIR .. "src/devices/bus/isa/myb3k_fdc.cpp",
|
||||
MAME_DIR .. "src/devices/bus/isa/myb3k_fdc.h",
|
||||
}
|
||||
end
|
||||
|
||||
|
530
src/devices/bus/isa/myb3k_com.cpp
Normal file
530
src/devices/bus/isa/myb3k_com.cpp
Normal file
@ -0,0 +1,530 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Joakim Larsson Edstrom
|
||||
/********************************************************************************
|
||||
|
||||
ADP 4703 ISA 8 bit RS232C Adapter Card for Step/One and possibly MyBrain 3000 and JB-3000.
|
||||
|
||||
TODO:
|
||||
- Put it into global ISA8 collection
|
||||
|
||||
*********************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "myb3k_com.h"
|
||||
#include "bus/rs232/rs232.h"
|
||||
#include "bus/rs232/null_modem.h"
|
||||
#include "machine/i8251.h"
|
||||
#include "machine/pit8253.h"
|
||||
|
||||
static SLOT_INTERFACE_START(isa8_myb3k_com)
|
||||
SLOT_INTERFACE("null_modem", NULL_MODEM)
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(ISA8_MYB3K_COM, isa8_myb3k_com_device, "isa8_myb3k_com", "ADP4703 RS-232C Serial Card")
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
MACHINE_CONFIG_MEMBER( isa8_myb3k_com_device::device_add_mconfig )
|
||||
MCFG_DEVICE_ADD( "usart", I8251, XTAL_15_9744MHz / 8 )
|
||||
MCFG_I8251_TXD_HANDLER(DEVWRITELINE("com1", rs232_port_device, write_txd))
|
||||
MCFG_I8251_DTR_HANDLER(DEVWRITELINE("com1", rs232_port_device, write_dtr))
|
||||
MCFG_I8251_RTS_HANDLER(DEVWRITELINE("com1", rs232_port_device, write_rts))
|
||||
MCFG_I8251_RXRDY_HANDLER(WRITELINE(isa8_myb3k_com_device, com_int_rx))
|
||||
MCFG_I8251_TXRDY_HANDLER(WRITELINE(isa8_myb3k_com_device, com_int_tx))
|
||||
|
||||
MCFG_RS232_PORT_ADD( "com1", isa8_myb3k_com, nullptr )
|
||||
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("usart", i8251_device, write_rxd))
|
||||
MCFG_RS232_DSR_HANDLER(DEVWRITELINE("usart", i8251_device, write_dsr))
|
||||
MCFG_RS232_CTS_HANDLER(DEVWRITELINE("usart", i8251_device, write_cts))
|
||||
MCFG_RS232_RI_HANDLER(WRITELINE(isa8_myb3k_com_device, ri_w))
|
||||
MCFG_RS232_DCD_HANDLER(WRITELINE(isa8_myb3k_com_device, dcd_w))
|
||||
// TODO: configure RxC and TxC from RS232 connector when these are defined is rs232.h
|
||||
|
||||
/* Timer chip */
|
||||
MCFG_DEVICE_ADD("pit", PIT8253, 0)
|
||||
MCFG_PIT8253_CLK0(XTAL_15_9744MHz / 8 ) /* TxC */
|
||||
MCFG_PIT8253_OUT0_HANDLER(WRITELINE(isa8_myb3k_com_device, pit_txc))
|
||||
MCFG_PIT8253_CLK1(XTAL_15_9744MHz / 8 ) /* RxC */
|
||||
MCFG_PIT8253_OUT1_HANDLER(WRITELINE(isa8_myb3k_com_device, pit_rxc))
|
||||
// Timer 2 is not used/connected to anything on the schematics
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
// PORT definitions moved to the end of this file as it became very long
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// isa8_myb3k_com_device - constructor
|
||||
//-------------------------------------------------
|
||||
isa8_myb3k_com_device::isa8_myb3k_com_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
isa8_myb3k_com_device(mconfig, ISA8_MYB3K_COM, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
isa8_myb3k_com_device::isa8_myb3k_com_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, type, tag, owner, clock)
|
||||
, device_isa8_card_interface(mconfig, *this)
|
||||
, m_iobase(*this, "DPSW1")
|
||||
, m_isairq(*this, "DPSW2")
|
||||
, m_usart(* this, "usart")
|
||||
, m_installed(false)
|
||||
, m_irq(4)
|
||||
, m_control(0)
|
||||
, m_status(0)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
void isa8_myb3k_com_device::device_start()
|
||||
{
|
||||
set_isa_device();
|
||||
m_installed = false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
void isa8_myb3k_com_device::device_reset()
|
||||
{
|
||||
if (!m_installed)
|
||||
{
|
||||
// IO base factory setting is 0x540
|
||||
uint32_t base = m_iobase->read();
|
||||
m_isa->install_device(base, base,
|
||||
read8_delegate(FUNC(i8251_device::data_r), subdevice<i8251_device>("usart")),
|
||||
write8_delegate(FUNC(i8251_device::data_w), subdevice<i8251_device>("usart")) );
|
||||
m_isa->install_device(base + 1, base + 1,
|
||||
read8_delegate(FUNC(i8251_device::status_r), subdevice<i8251_device>("usart")),
|
||||
write8_delegate(FUNC(i8251_device::control_w), subdevice<i8251_device>("usart")) );
|
||||
|
||||
m_isa->install_device(base + 2, base + 2,
|
||||
read8_delegate(FUNC(isa8_myb3k_com_device::dce_status), this),
|
||||
write8_delegate(FUNC(isa8_myb3k_com_device::dce_control), this) );
|
||||
|
||||
m_isa->install_device(base + 4, base + 7,
|
||||
read8_delegate(FUNC(pit8253_device::read), subdevice<pit8253_device>("pit")),
|
||||
write8_delegate(FUNC(pit8253_device::write), subdevice<pit8253_device>("pit")) );
|
||||
|
||||
m_irq = m_isairq->read();
|
||||
m_installed = true;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// pit_rxc - write receive clock if pit is selected source
|
||||
//-----------------------------------------------------------
|
||||
#define CLK_SEL 0x80
|
||||
WRITE_LINE_MEMBER(isa8_myb3k_com_device::pit_rxc)
|
||||
{
|
||||
if ((m_control & CLK_SEL) != 0)
|
||||
{
|
||||
m_usart->write_rxc(state);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
// pit_txc - write transmit clock if pit is selected source
|
||||
//------------------------------------------------------------
|
||||
WRITE_LINE_MEMBER(isa8_myb3k_com_device::pit_txc)
|
||||
{
|
||||
if ((m_control & CLK_SEL) != 0)
|
||||
{
|
||||
m_usart->write_txc(state);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// rem_rxc - write receive clock if remote clock is selected
|
||||
// source, eg for synchronous modes
|
||||
//-----------------------------------------------------------
|
||||
WRITE_LINE_MEMBER(isa8_myb3k_com_device::rem_rxc)
|
||||
{
|
||||
if ((m_control & CLK_SEL) == 0)
|
||||
{
|
||||
m_usart->write_rxc(state);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
// rem_txc - write transmit clock if remote cloc is selected
|
||||
// source, eg for synchronous modes
|
||||
//------------------------------------------------------------
|
||||
WRITE_LINE_MEMBER(isa8_myb3k_com_device::rem_txc)
|
||||
{
|
||||
if ((m_control & CLK_SEL) == 0)
|
||||
{
|
||||
m_usart->write_txc(state);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// com_int_rx - signal selected interrup on ISA bus
|
||||
//------------------------------------------------
|
||||
WRITE_LINE_MEMBER(isa8_myb3k_com_device::com_int_rx)
|
||||
{
|
||||
m_irq_rx = state;
|
||||
com_int();
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// com_int_tx - signal selected interrup on ISA bus
|
||||
//------------------------------------------------
|
||||
WRITE_LINE_MEMBER(isa8_myb3k_com_device::com_int_tx)
|
||||
{
|
||||
m_irq_tx = state;
|
||||
com_int();
|
||||
}
|
||||
|
||||
void isa8_myb3k_com_device::com_int()
|
||||
{
|
||||
int state = (m_irq_tx | m_irq_rx) ? ASSERT_LINE : CLEAR_LINE;
|
||||
|
||||
// Schematics allows for more than one interrupt to be triggered but there is probably only one jumper
|
||||
switch (m_irq)
|
||||
{
|
||||
case 2: m_isa->irq2_w(state); break;
|
||||
case 3: m_isa->irq3_w(state); break;
|
||||
case 4: m_isa->irq4_w(state); break;
|
||||
case 5: m_isa->irq5_w(state); break;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// dcd_w - DCD line value gated by a LS368
|
||||
//------------------------------------------------
|
||||
#define DCD_BIT 0x02
|
||||
WRITE_LINE_MEMBER(isa8_myb3k_com_device::dcd_w)
|
||||
{
|
||||
if (state == ASSERT_LINE)
|
||||
{
|
||||
m_status |= DCD_BIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_status &= ~DCD_BIT;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// ri_w - RI line value gated by a LS368
|
||||
//------------------------------------------------
|
||||
#define RI_BIT 0x01
|
||||
WRITE_LINE_MEMBER(isa8_myb3k_com_device::ri_w)
|
||||
{
|
||||
if (state == ASSERT_LINE)
|
||||
{
|
||||
m_status |= RI_BIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_status &= ~RI_BIT;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// dce_control -
|
||||
//------------------------------------------------
|
||||
#define TX_IRQ_RESET_BIT 0x40
|
||||
WRITE8_MEMBER(isa8_myb3k_com_device::dce_control)
|
||||
{
|
||||
m_control = data;
|
||||
if (m_control & TX_IRQ_RESET_BIT)
|
||||
{
|
||||
m_irq_tx = 0;
|
||||
com_int();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// dce_status - open LS368 gate and read status
|
||||
//------------------------------------------------
|
||||
READ8_MEMBER(isa8_myb3k_com_device::dce_status)
|
||||
{
|
||||
return m_status;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Port definition - Needs refactoring as becoming ridiculously long
|
||||
//--------------------------------------------------------------------
|
||||
static INPUT_PORTS_START( myb3k_com_dpsw )
|
||||
PORT_START("DPSW2")
|
||||
PORT_DIPNAME( 0x0f, 0x04, "USART ISA IRQ")
|
||||
PORT_DIPSETTING( 0x01, "IRQ2" )
|
||||
PORT_DIPSETTING( 0x02, "IRQ3" )
|
||||
PORT_DIPSETTING( 0x04, "IRQ4" )
|
||||
PORT_DIPSETTING( 0x08, "IRQ5" )
|
||||
PORT_START("DPSW1")
|
||||
PORT_DIPNAME( 0x7fc, 0x540, "I/O Base address")
|
||||
PORT_DIPSETTING( 0x000, "0x000" )
|
||||
PORT_DIPSETTING( 0x008, "0x008" )
|
||||
PORT_DIPSETTING( 0x010, "0x010" )
|
||||
PORT_DIPSETTING( 0x018, "0x018" )
|
||||
PORT_DIPSETTING( 0x020, "0x020" )
|
||||
PORT_DIPSETTING( 0x028, "0x028" )
|
||||
PORT_DIPSETTING( 0x030, "0x030" )
|
||||
PORT_DIPSETTING( 0x038, "0x038" )
|
||||
PORT_DIPSETTING( 0x040, "0x040" )
|
||||
PORT_DIPSETTING( 0x048, "0x048" )
|
||||
PORT_DIPSETTING( 0x050, "0x050" )
|
||||
PORT_DIPSETTING( 0x058, "0x058" )
|
||||
PORT_DIPSETTING( 0x060, "0x060" )
|
||||
PORT_DIPSETTING( 0x068, "0x068" )
|
||||
PORT_DIPSETTING( 0x070, "0x070" )
|
||||
PORT_DIPSETTING( 0x078, "0x078" )
|
||||
PORT_DIPSETTING( 0x080, "0x080" )
|
||||
PORT_DIPSETTING( 0x088, "0x088" )
|
||||
PORT_DIPSETTING( 0x090, "0x090" )
|
||||
PORT_DIPSETTING( 0x098, "0x098" )
|
||||
PORT_DIPSETTING( 0x0a0, "0x0a0" )
|
||||
PORT_DIPSETTING( 0x0a8, "0x0a8" )
|
||||
PORT_DIPSETTING( 0x0b0, "0x0b0" )
|
||||
PORT_DIPSETTING( 0x0b8, "0x0b8" )
|
||||
PORT_DIPSETTING( 0x0c0, "0x0c0" )
|
||||
PORT_DIPSETTING( 0x0c8, "0x0c8" )
|
||||
PORT_DIPSETTING( 0x0d0, "0x0d0" )
|
||||
PORT_DIPSETTING( 0x0d8, "0x0d8" )
|
||||
PORT_DIPSETTING( 0x0e0, "0x0e0" )
|
||||
PORT_DIPSETTING( 0x0e8, "0x0e8" )
|
||||
PORT_DIPSETTING( 0x0f0, "0x0f0" )
|
||||
PORT_DIPSETTING( 0x0f8, "0x0f8" )
|
||||
PORT_DIPSETTING( 0x100, "0x100" )
|
||||
PORT_DIPSETTING( 0x108, "0x108" )
|
||||
PORT_DIPSETTING( 0x110, "0x110" )
|
||||
PORT_DIPSETTING( 0x118, "0x118" )
|
||||
PORT_DIPSETTING( 0x120, "0x120" )
|
||||
PORT_DIPSETTING( 0x128, "0x128" )
|
||||
PORT_DIPSETTING( 0x130, "0x130" )
|
||||
PORT_DIPSETTING( 0x138, "0x138" )
|
||||
PORT_DIPSETTING( 0x140, "0x140" )
|
||||
PORT_DIPSETTING( 0x148, "0x148" )
|
||||
PORT_DIPSETTING( 0x150, "0x150" )
|
||||
PORT_DIPSETTING( 0x158, "0x158" )
|
||||
PORT_DIPSETTING( 0x160, "0x160" )
|
||||
PORT_DIPSETTING( 0x168, "0x168" )
|
||||
PORT_DIPSETTING( 0x170, "0x170" )
|
||||
PORT_DIPSETTING( 0x178, "0x178" )
|
||||
PORT_DIPSETTING( 0x180, "0x180" )
|
||||
PORT_DIPSETTING( 0x188, "0x188" )
|
||||
PORT_DIPSETTING( 0x190, "0x190" )
|
||||
PORT_DIPSETTING( 0x198, "0x198" )
|
||||
PORT_DIPSETTING( 0x1a0, "0x1a0" )
|
||||
PORT_DIPSETTING( 0x1a8, "0x1a8" )
|
||||
PORT_DIPSETTING( 0x1b0, "0x1b0" )
|
||||
PORT_DIPSETTING( 0x1b8, "0x1b8" )
|
||||
PORT_DIPSETTING( 0x1c0, "0x1c0" )
|
||||
PORT_DIPSETTING( 0x1c8, "0x1c8" )
|
||||
PORT_DIPSETTING( 0x1d0, "0x1d0" )
|
||||
PORT_DIPSETTING( 0x1d8, "0x1d8" )
|
||||
PORT_DIPSETTING( 0x1e0, "0x1e0" )
|
||||
PORT_DIPSETTING( 0x1e8, "0x1e8" )
|
||||
PORT_DIPSETTING( 0x1f0, "0x1f0" )
|
||||
PORT_DIPSETTING( 0x1f8, "0x1f8" )
|
||||
PORT_DIPSETTING( 0x200, "0x200" )
|
||||
PORT_DIPSETTING( 0x208, "0x208" )
|
||||
PORT_DIPSETTING( 0x210, "0x210" )
|
||||
PORT_DIPSETTING( 0x218, "0x218" )
|
||||
PORT_DIPSETTING( 0x220, "0x220" )
|
||||
PORT_DIPSETTING( 0x228, "0x228" )
|
||||
PORT_DIPSETTING( 0x230, "0x230" )
|
||||
PORT_DIPSETTING( 0x238, "0x238" )
|
||||
PORT_DIPSETTING( 0x240, "0x240" )
|
||||
PORT_DIPSETTING( 0x248, "0x248" )
|
||||
PORT_DIPSETTING( 0x250, "0x250" )
|
||||
PORT_DIPSETTING( 0x258, "0x258" )
|
||||
PORT_DIPSETTING( 0x260, "0x260" )
|
||||
PORT_DIPSETTING( 0x268, "0x268" )
|
||||
PORT_DIPSETTING( 0x270, "0x270" )
|
||||
PORT_DIPSETTING( 0x278, "0x278" )
|
||||
PORT_DIPSETTING( 0x280, "0x280" )
|
||||
PORT_DIPSETTING( 0x288, "0x288" )
|
||||
PORT_DIPSETTING( 0x290, "0x290" )
|
||||
PORT_DIPSETTING( 0x298, "0x298" )
|
||||
PORT_DIPSETTING( 0x2a0, "0x2a0" )
|
||||
PORT_DIPSETTING( 0x2a8, "0x2a8" )
|
||||
PORT_DIPSETTING( 0x2b0, "0x2b0" )
|
||||
PORT_DIPSETTING( 0x2b8, "0x2b8" )
|
||||
PORT_DIPSETTING( 0x2c0, "0x2c0" )
|
||||
PORT_DIPSETTING( 0x2c8, "0x2c8" )
|
||||
PORT_DIPSETTING( 0x2d0, "0x2d0" )
|
||||
PORT_DIPSETTING( 0x2d8, "0x2d8" )
|
||||
PORT_DIPSETTING( 0x2e0, "0x2e0" )
|
||||
PORT_DIPSETTING( 0x2e8, "0x2e8" )
|
||||
PORT_DIPSETTING( 0x2f0, "0x2f0" )
|
||||
PORT_DIPSETTING( 0x2f8, "0x2f8" )
|
||||
PORT_DIPSETTING( 0x300, "0x300" )
|
||||
PORT_DIPSETTING( 0x308, "0x308" )
|
||||
PORT_DIPSETTING( 0x310, "0x310" )
|
||||
PORT_DIPSETTING( 0x318, "0x318" )
|
||||
PORT_DIPSETTING( 0x320, "0x320" )
|
||||
PORT_DIPSETTING( 0x328, "0x328" )
|
||||
PORT_DIPSETTING( 0x330, "0x330" )
|
||||
PORT_DIPSETTING( 0x338, "0x338" )
|
||||
PORT_DIPSETTING( 0x340, "0x340" )
|
||||
PORT_DIPSETTING( 0x348, "0x348" )
|
||||
PORT_DIPSETTING( 0x350, "0x350" )
|
||||
PORT_DIPSETTING( 0x358, "0x358" )
|
||||
PORT_DIPSETTING( 0x360, "0x360" )
|
||||
PORT_DIPSETTING( 0x368, "0x368" )
|
||||
PORT_DIPSETTING( 0x370, "0x370" )
|
||||
PORT_DIPSETTING( 0x378, "0x378" )
|
||||
PORT_DIPSETTING( 0x380, "0x380" )
|
||||
PORT_DIPSETTING( 0x388, "0x388" )
|
||||
PORT_DIPSETTING( 0x390, "0x390" )
|
||||
PORT_DIPSETTING( 0x398, "0x398" )
|
||||
PORT_DIPSETTING( 0x3a0, "0x3a0" )
|
||||
PORT_DIPSETTING( 0x3a8, "0x3a8" )
|
||||
PORT_DIPSETTING( 0x3b0, "0x3b0" )
|
||||
PORT_DIPSETTING( 0x3b8, "0x3b8" )
|
||||
PORT_DIPSETTING( 0x3c0, "0x3c0" )
|
||||
PORT_DIPSETTING( 0x3c8, "0x3c8" )
|
||||
PORT_DIPSETTING( 0x3d0, "0x3d0" )
|
||||
PORT_DIPSETTING( 0x3d8, "0x3d8" )
|
||||
PORT_DIPSETTING( 0x3e0, "0x3e0" )
|
||||
PORT_DIPSETTING( 0x3e8, "0x3e8" )
|
||||
PORT_DIPSETTING( 0x3f0, "0x3f0" )
|
||||
PORT_DIPSETTING( 0x3f8, "0x3f8" )
|
||||
PORT_DIPSETTING( 0x400, "0x400" )
|
||||
PORT_DIPSETTING( 0x408, "0x408" )
|
||||
PORT_DIPSETTING( 0x410, "0x410" )
|
||||
PORT_DIPSETTING( 0x418, "0x418" )
|
||||
PORT_DIPSETTING( 0x420, "0x420" )
|
||||
PORT_DIPSETTING( 0x428, "0x428" )
|
||||
PORT_DIPSETTING( 0x430, "0x430" )
|
||||
PORT_DIPSETTING( 0x438, "0x438" )
|
||||
PORT_DIPSETTING( 0x440, "0x440" )
|
||||
PORT_DIPSETTING( 0x448, "0x448" )
|
||||
PORT_DIPSETTING( 0x450, "0x450" )
|
||||
PORT_DIPSETTING( 0x458, "0x458" )
|
||||
PORT_DIPSETTING( 0x460, "0x460" )
|
||||
PORT_DIPSETTING( 0x468, "0x468" )
|
||||
PORT_DIPSETTING( 0x470, "0x470" )
|
||||
PORT_DIPSETTING( 0x478, "0x478" )
|
||||
PORT_DIPSETTING( 0x480, "0x480" )
|
||||
PORT_DIPSETTING( 0x488, "0x488" )
|
||||
PORT_DIPSETTING( 0x490, "0x490" )
|
||||
PORT_DIPSETTING( 0x498, "0x498" )
|
||||
PORT_DIPSETTING( 0x4a0, "0x4a0" )
|
||||
PORT_DIPSETTING( 0x4a8, "0x4a8" )
|
||||
PORT_DIPSETTING( 0x4b0, "0x4b0" )
|
||||
PORT_DIPSETTING( 0x4b8, "0x4b8" )
|
||||
PORT_DIPSETTING( 0x4c0, "0x4c0" )
|
||||
PORT_DIPSETTING( 0x4c8, "0x4c8" )
|
||||
PORT_DIPSETTING( 0x4d0, "0x4d0" )
|
||||
PORT_DIPSETTING( 0x4d8, "0x4d8" )
|
||||
PORT_DIPSETTING( 0x4e0, "0x4e0" )
|
||||
PORT_DIPSETTING( 0x4e8, "0x4e8" )
|
||||
PORT_DIPSETTING( 0x4f0, "0x4f0" )
|
||||
PORT_DIPSETTING( 0x4f8, "0x4f8" )
|
||||
PORT_DIPSETTING( 0x500, "0x500" )
|
||||
PORT_DIPSETTING( 0x508, "0x508" )
|
||||
PORT_DIPSETTING( 0x510, "0x510" )
|
||||
PORT_DIPSETTING( 0x518, "0x518" )
|
||||
PORT_DIPSETTING( 0x520, "0x520" )
|
||||
PORT_DIPSETTING( 0x528, "0x528" )
|
||||
PORT_DIPSETTING( 0x530, "0x530" )
|
||||
PORT_DIPSETTING( 0x538, "0x538" )
|
||||
PORT_DIPSETTING( 0x540, "0x540" )
|
||||
PORT_DIPSETTING( 0x548, "0x548" )
|
||||
PORT_DIPSETTING( 0x550, "0x550" )
|
||||
PORT_DIPSETTING( 0x558, "0x558" )
|
||||
PORT_DIPSETTING( 0x560, "0x560" )
|
||||
PORT_DIPSETTING( 0x568, "0x568" )
|
||||
PORT_DIPSETTING( 0x570, "0x570" )
|
||||
PORT_DIPSETTING( 0x578, "0x578" )
|
||||
PORT_DIPSETTING( 0x580, "0x580" )
|
||||
PORT_DIPSETTING( 0x588, "0x588" )
|
||||
PORT_DIPSETTING( 0x590, "0x590" )
|
||||
PORT_DIPSETTING( 0x598, "0x598" )
|
||||
PORT_DIPSETTING( 0x5a0, "0x5a0" )
|
||||
PORT_DIPSETTING( 0x5a8, "0x5a8" )
|
||||
PORT_DIPSETTING( 0x5b0, "0x5b0" )
|
||||
PORT_DIPSETTING( 0x5b8, "0x5b8" )
|
||||
PORT_DIPSETTING( 0x5c0, "0x5c0" )
|
||||
PORT_DIPSETTING( 0x5c8, "0x5c8" )
|
||||
PORT_DIPSETTING( 0x5d0, "0x5d0" )
|
||||
PORT_DIPSETTING( 0x5d8, "0x5d8" )
|
||||
PORT_DIPSETTING( 0x5e0, "0x5e0" )
|
||||
PORT_DIPSETTING( 0x5e8, "0x5e8" )
|
||||
PORT_DIPSETTING( 0x5f0, "0x5f0" )
|
||||
PORT_DIPSETTING( 0x5f8, "0x5f8" )
|
||||
PORT_DIPSETTING( 0x600, "0x600" )
|
||||
PORT_DIPSETTING( 0x608, "0x608" )
|
||||
PORT_DIPSETTING( 0x610, "0x610" )
|
||||
PORT_DIPSETTING( 0x618, "0x618" )
|
||||
PORT_DIPSETTING( 0x620, "0x620" )
|
||||
PORT_DIPSETTING( 0x628, "0x628" )
|
||||
PORT_DIPSETTING( 0x630, "0x630" )
|
||||
PORT_DIPSETTING( 0x638, "0x638" )
|
||||
PORT_DIPSETTING( 0x640, "0x640" )
|
||||
PORT_DIPSETTING( 0x648, "0x648" )
|
||||
PORT_DIPSETTING( 0x650, "0x650" )
|
||||
PORT_DIPSETTING( 0x658, "0x658" )
|
||||
PORT_DIPSETTING( 0x660, "0x660" )
|
||||
PORT_DIPSETTING( 0x668, "0x668" )
|
||||
PORT_DIPSETTING( 0x670, "0x670" )
|
||||
PORT_DIPSETTING( 0x678, "0x678" )
|
||||
PORT_DIPSETTING( 0x680, "0x680" )
|
||||
PORT_DIPSETTING( 0x688, "0x688" )
|
||||
PORT_DIPSETTING( 0x690, "0x690" )
|
||||
PORT_DIPSETTING( 0x698, "0x698" )
|
||||
PORT_DIPSETTING( 0x6a0, "0x6a0" )
|
||||
PORT_DIPSETTING( 0x6a8, "0x6a8" )
|
||||
PORT_DIPSETTING( 0x6b0, "0x6b0" )
|
||||
PORT_DIPSETTING( 0x6b8, "0x6b8" )
|
||||
PORT_DIPSETTING( 0x6c0, "0x6c0" )
|
||||
PORT_DIPSETTING( 0x6c8, "0x6c8" )
|
||||
PORT_DIPSETTING( 0x6d0, "0x6d0" )
|
||||
PORT_DIPSETTING( 0x6d8, "0x6d8" )
|
||||
PORT_DIPSETTING( 0x6e0, "0x6e0" )
|
||||
PORT_DIPSETTING( 0x6e8, "0x6e8" )
|
||||
PORT_DIPSETTING( 0x6f0, "0x6f0" )
|
||||
PORT_DIPSETTING( 0x6f8, "0x6f8" )
|
||||
PORT_DIPSETTING( 0x700, "0x700" )
|
||||
PORT_DIPSETTING( 0x708, "0x708" )
|
||||
PORT_DIPSETTING( 0x710, "0x710" )
|
||||
PORT_DIPSETTING( 0x718, "0x718" )
|
||||
PORT_DIPSETTING( 0x720, "0x720" )
|
||||
PORT_DIPSETTING( 0x728, "0x728" )
|
||||
PORT_DIPSETTING( 0x730, "0x730" )
|
||||
PORT_DIPSETTING( 0x738, "0x738" )
|
||||
PORT_DIPSETTING( 0x740, "0x740" )
|
||||
PORT_DIPSETTING( 0x748, "0x748" )
|
||||
PORT_DIPSETTING( 0x750, "0x750" )
|
||||
PORT_DIPSETTING( 0x758, "0x758" )
|
||||
PORT_DIPSETTING( 0x760, "0x760" )
|
||||
PORT_DIPSETTING( 0x768, "0x768" )
|
||||
PORT_DIPSETTING( 0x770, "0x770" )
|
||||
PORT_DIPSETTING( 0x778, "0x778" )
|
||||
PORT_DIPSETTING( 0x780, "0x780" )
|
||||
PORT_DIPSETTING( 0x788, "0x788" )
|
||||
PORT_DIPSETTING( 0x790, "0x790" )
|
||||
PORT_DIPSETTING( 0x798, "0x798" )
|
||||
PORT_DIPSETTING( 0x7a0, "0x7a0" )
|
||||
PORT_DIPSETTING( 0x7a8, "0x7a8" )
|
||||
PORT_DIPSETTING( 0x7b0, "0x7b0" )
|
||||
PORT_DIPSETTING( 0x7b8, "0x7b8" )
|
||||
PORT_DIPSETTING( 0x7c0, "0x7c0" )
|
||||
PORT_DIPSETTING( 0x7c8, "0x7c8" )
|
||||
PORT_DIPSETTING( 0x7d0, "0x7d0" )
|
||||
PORT_DIPSETTING( 0x7d8, "0x7d8" )
|
||||
PORT_DIPSETTING( 0x7e0, "0x7e0" )
|
||||
PORT_DIPSETTING( 0x7e8, "0x7e8" )
|
||||
PORT_DIPSETTING( 0x7f0, "0x7f0" )
|
||||
PORT_DIPSETTING( 0x7f8, "0x7f8" )
|
||||
INPUT_PORTS_END
|
||||
|
||||
ioport_constructor isa8_myb3k_com_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME( myb3k_com_dpsw );
|
||||
}
|
82
src/devices/bus/isa/myb3k_com.h
Normal file
82
src/devices/bus/isa/myb3k_com.h
Normal file
@ -0,0 +1,82 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders: Joakim Larsson Edstrom
|
||||
#ifndef MAME_BUS_ISA_MYB3K_COM_H
|
||||
#define MAME_BUS_ISA_MYB3K_COM_H
|
||||
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
* This card is part of Matsushita MyBrain 3000 and branded Panasonic JB-3000
|
||||
* and Ericsson Step/One computers. These are not really PC compatibles but
|
||||
* mimics the IBM PC in feature set and stays close on hardware but not 100%
|
||||
*
|
||||
* Serial connector from Step/One service manual
|
||||
* ---------------------------------------------
|
||||
* Pin numbering------====------------------+ 1 - FG (AA) Chassi GND
|
||||
* | 25 23 21 19 17 15 13 11 9 7 5 3 1 | 3 - SD (BA) TxD
|
||||
* | 26 24 22 20 18 16 14 12 10 8 6 4 2 | 4 - ST (DB) TxC
|
||||
* +----------------------------------------+ 5 - RD (BB) RxD
|
||||
* 7 - RS (AC) RTS 8 - RT (DD) RxC 9 - CS (CB) CTS
|
||||
* 11 - DR (CC) DSR 13 - SG (AB) Signal GND 14 - ER (CD) DTR
|
||||
* 15 - CD (CF) DCD 18 - CI (CE) RI
|
||||
*
|
||||
*/
|
||||
|
||||
#include "isa.h"
|
||||
#include "machine/i8251.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> isa8_myb3k_com_device
|
||||
|
||||
class isa8_myb3k_com_device :
|
||||
public device_t,
|
||||
public device_isa8_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
isa8_myb3k_com_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(pit_txc);
|
||||
DECLARE_WRITE_LINE_MEMBER(pit_rxc);
|
||||
DECLARE_WRITE_LINE_MEMBER(rem_txc);
|
||||
DECLARE_WRITE_LINE_MEMBER(rem_rxc);
|
||||
DECLARE_WRITE_LINE_MEMBER(com_int_rx);
|
||||
DECLARE_WRITE_LINE_MEMBER(com_int_tx);
|
||||
DECLARE_WRITE_LINE_MEMBER(dcd_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(ri_w);
|
||||
DECLARE_WRITE8_MEMBER(dce_control);
|
||||
DECLARE_READ8_MEMBER(dce_status);
|
||||
|
||||
protected:
|
||||
isa8_myb3k_com_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
// helpers
|
||||
void com_int();
|
||||
|
||||
required_ioport m_iobase;
|
||||
required_ioport m_isairq;
|
||||
required_device<i8251_device> m_usart;
|
||||
bool m_installed;
|
||||
int m_irq;
|
||||
int m_irq_tx;
|
||||
int m_irq_rx;
|
||||
int m_control;
|
||||
int m_status;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(ISA8_MYB3K_COM, isa8_myb3k_com_device)
|
||||
|
||||
#endif // MAME_BUS_ISA_MYB3K_COM_H
|
376
src/devices/bus/isa/myb3k_fdc.cpp
Normal file
376
src/devices/bus/isa/myb3k_fdc.cpp
Normal file
@ -0,0 +1,376 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Joakim Larsson Edstrom
|
||||
/**********************************************************************
|
||||
|
||||
ISA 8 bit Floppy Disk Controller for Matsushita MyBrain 3000,
|
||||
Panasonic JB-3000 and Ericsson Step/One
|
||||
|
||||
FDC4710 - 5.25" FDD4730
|
||||
- 1-2 x SSDD 40 tracks, 8 sectors/track, 512 bytes/sector 160KB
|
||||
|
||||
FDC4711 - 5.25" FDD4731/FDD4732 (FDD4732 has external power needed for drive 3-4)
|
||||
- 1-4 x DSDD 80 tracks, 8 sectors/track, 512 bytes/sector 720KB
|
||||
|
||||
FDC4712 - 8" FDD4733
|
||||
- 1-2 x DSDD 154 tracks, 8 sector/track, 1024 bytes/sector 1232KB
|
||||
|
||||
Step/One service manuals: http://nivelleringslikaren.eu/stepone/
|
||||
|
||||
TODO:
|
||||
- Verify FDC4710 as soon as we find a 160Kb floppy image
|
||||
- Add FDC4712 8" as soon as we get a visual or schematics on it
|
||||
- Reduce code duplication by introducing a base class, once all are emulated
|
||||
- Put these into global ISA8 collection
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "myb3k_fdc.h"
|
||||
#include "imagedev/flopdrv.h"
|
||||
#include "formats/pc_dsk.h"
|
||||
#include "formats/imd_dsk.h"
|
||||
|
||||
//#define LOG_GENERAL (1U << 0) //defined in logmacro.h already
|
||||
#define LOG_READ (1U << 1)
|
||||
#define LOG_CMD (1U << 2)
|
||||
|
||||
//#define VERBOSE (LOG_GENERAL | LOG_CMD | LOG_READ)
|
||||
//#define LOG_OUTPUT_STREAM std::cout
|
||||
|
||||
#include "logmacro.h"
|
||||
|
||||
#define LOGR(...) LOGMASKED(LOG_READ, __VA_ARGS__)
|
||||
#define LOGCMD(...) LOGMASKED(LOG_CMD, __VA_ARGS__)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define FUNCNAME __func__
|
||||
#else
|
||||
#define FUNCNAME __PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
DEFINE_DEVICE_TYPE(ISA8_MYB3K_FDC4710, isa8_myb3k_fdc4710_device, "isa8_myb3k_fdc4710", "FDC4710 SSDD Floppy Disk Controller")
|
||||
DEFINE_DEVICE_TYPE(ISA8_MYB3K_FDC4711, isa8_myb3k_fdc4711_device, "isa8_myb3k_fdc4711", "FDC4711 DSDD Floppy Disk Controller")
|
||||
|
||||
DEVICE_ADDRESS_MAP_START(map, 8, isa8_myb3k_fdc4710_device)
|
||||
// AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("fdc", mb8876_device, read, write) AM_MIRROR(0x500)
|
||||
AM_RANGE(0x00, 0x03) AM_READ(myb3k_inv_fdc_data_r) AM_WRITE(myb3k_inv_fdc_data_w) AM_MIRROR(0x500)
|
||||
AM_RANGE(0x04, 0x04) AM_WRITE(myb3k_fdc_command) AM_MIRROR(0x500)
|
||||
AM_RANGE(0x05, 0x05) AM_READ(myb3k_fdc_status) AM_MIRROR(0x500)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
DEVICE_ADDRESS_MAP_START(map, 8, isa8_myb3k_fdc4711_device)
|
||||
// AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("fdc", fd1791_device, read, write) AM_MIRROR(0x500)
|
||||
AM_RANGE(0x00, 0x03) AM_READ(myb3k_inv_fdc_data_r) AM_WRITE(myb3k_inv_fdc_data_w) AM_MIRROR(0x500)
|
||||
AM_RANGE(0x04, 0x04) AM_WRITE(myb3k_fdc_command) AM_MIRROR(0x500)
|
||||
AM_RANGE(0x05, 0x05) AM_READ(myb3k_fdc_status) AM_MIRROR(0x500)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
FLOPPY_FORMATS_MEMBER( isa8_myb3k_fdc4710_device::myb3k_floppy_formats )
|
||||
FLOPPY_IMD_FORMAT
|
||||
FLOPPY_FORMATS_END
|
||||
|
||||
FLOPPY_FORMATS_MEMBER( isa8_myb3k_fdc4711_device::myb3k_floppy_formats )
|
||||
FLOPPY_PC_FORMAT,
|
||||
FLOPPY_IMD_FORMAT
|
||||
FLOPPY_FORMATS_END
|
||||
|
||||
static SLOT_INTERFACE_START( myb3k_sd_floppies )
|
||||
SLOT_INTERFACE( "525sd", FLOPPY_525_SD )
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
static SLOT_INTERFACE_START( myb3k_qd_floppies )
|
||||
SLOT_INTERFACE( "525qd", FLOPPY_525_QD )
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
#if 0
|
||||
static SLOT_INTERFACE_START( myb3k_8inch_floppies )
|
||||
SLOT_INTERFACE( "8dsdd", FLOPPY_8_DSDD )
|
||||
SLOT_INTERFACE_END
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
/* */
|
||||
MACHINE_CONFIG_MEMBER( isa8_myb3k_fdc4710_device::device_add_mconfig )
|
||||
MCFG_DEVICE_ADD("fdc", MB8876, XTAL_15_9744MHz / 8) /* From StepOne schematics */
|
||||
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(isa8_myb3k_fdc4710_device, irq_w))
|
||||
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(isa8_myb3k_fdc4710_device, drq_w))
|
||||
MCFG_FLOPPY_DRIVE_ADD("fdc:0", myb3k_sd_floppies, "525sd", isa8_myb3k_fdc4710_device::myb3k_floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_ADD("fdc:1", myb3k_sd_floppies, "525sd", isa8_myb3k_fdc4710_device::myb3k_floppy_formats)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/* Main difference from fdc4710 is that a Hitachi HA16632AP has replaced the descrete VFO enabling 720Kb disks */
|
||||
MACHINE_CONFIG_MEMBER( isa8_myb3k_fdc4711_device::device_add_mconfig )
|
||||
MCFG_DEVICE_ADD("fdc", FD1791, XTAL_15_9744MHz / 16)
|
||||
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(isa8_myb3k_fdc4711_device, irq_w))
|
||||
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(isa8_myb3k_fdc4711_device, drq_w))
|
||||
MCFG_FLOPPY_DRIVE_ADD("fdc:0", myb3k_qd_floppies, "525qd", isa8_myb3k_fdc4711_device::myb3k_floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_ADD("fdc:1", myb3k_qd_floppies, "525qd", isa8_myb3k_fdc4711_device::myb3k_floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_ADD("fdc:2", myb3k_qd_floppies, "525qd", isa8_myb3k_fdc4711_device::myb3k_floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_ADD("fdc:3", myb3k_qd_floppies, "525qd", isa8_myb3k_fdc4711_device::myb3k_floppy_formats)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
#if 0
|
||||
MACHINE_CONFIG_MEMBER( isa8_myb3k_fdc4712_device::device_add_mconfig )
|
||||
MCFG_DEVICE_ADD("fdc", FD1791, XTAL_15_9744MHz / 8)
|
||||
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(isa8_myb3k_fdc4712_device, irq_w))
|
||||
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(isa8_myb3k_fdc4712_device, drq_w))
|
||||
MCFG_FLOPPY_DRIVE_ADD("fdc:0", myb3k_8inch_floppies, "8dsdd", isa8_myb3k_fdc4712_device::myb3k_floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_ADD("fdc:1", myb3k_8inch_floppies, "8dsdd", isa8_myb3k_fdc4712_device::myb3k_floppy_formats)
|
||||
MACHINE_CONFIG_END
|
||||
#endif
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICES
|
||||
//**************************************************************************
|
||||
isa8_myb3k_fdc4710_device::isa8_myb3k_fdc4710_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, type, tag, owner, clock)
|
||||
, device_isa8_card_interface(mconfig, *this)
|
||||
, m_fdc(*this, "fdc")
|
||||
, m_fdd0(*this, "fdc:0")
|
||||
, m_fdd1(*this, "fdc:1")
|
||||
{
|
||||
}
|
||||
|
||||
isa8_myb3k_fdc4710_device::isa8_myb3k_fdc4710_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_myb3k_fdc4710_device(mconfig, ISA8_MYB3K_FDC4710, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
isa8_myb3k_fdc4711_device::isa8_myb3k_fdc4711_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, type, tag, owner, clock)
|
||||
, device_isa8_card_interface(mconfig, *this)
|
||||
, m_fdc(*this, "fdc")
|
||||
, m_fdd0(*this, "fdc:0")
|
||||
, m_fdd1(*this, "fdc:1")
|
||||
, m_fdd2(*this, "fdc:2")
|
||||
, m_fdd3(*this, "fdc:3")
|
||||
{
|
||||
}
|
||||
|
||||
isa8_myb3k_fdc4711_device::isa8_myb3k_fdc4711_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_myb3k_fdc4711_device(mconfig, ISA8_MYB3K_FDC4711, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
void isa8_myb3k_fdc4710_device::device_start()
|
||||
{
|
||||
LOG("%s\n", FUNCNAME);
|
||||
|
||||
set_isa_device();
|
||||
m_isa->set_dma_channel(2, this, true);
|
||||
m_isa->install_device(0x020, 0x027, *this, &isa8_myb3k_fdc4710_device::map, 8);
|
||||
}
|
||||
|
||||
void isa8_myb3k_fdc4711_device::device_start()
|
||||
{
|
||||
LOG("%s\n", FUNCNAME);
|
||||
|
||||
set_isa_device();
|
||||
m_isa->install_device(0x020, 0x027, *this, &isa8_myb3k_fdc4711_device::map, 8);
|
||||
m_isa->set_dma_channel(2, this, true);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
void isa8_myb3k_fdc4710_device::device_reset()
|
||||
{
|
||||
LOG("%s\n", FUNCNAME);
|
||||
}
|
||||
|
||||
void isa8_myb3k_fdc4711_device::device_reset()
|
||||
{
|
||||
LOG("%s\n", FUNCNAME);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// irq_w - signal interrupt request to ISA bus
|
||||
//-------------------------------------------------
|
||||
WRITE_LINE_MEMBER( isa8_myb3k_fdc4710_device::irq_w )
|
||||
{
|
||||
LOG("%s: %d\n", FUNCNAME, state);
|
||||
m_isa->irq6_w(state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( isa8_myb3k_fdc4711_device::irq_w )
|
||||
{
|
||||
LOG("%s: %d\n", FUNCNAME, state);
|
||||
m_isa->irq6_w(state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// drq_w - signal dma request to ISA bus
|
||||
//-------------------------------------------------
|
||||
WRITE_LINE_MEMBER( isa8_myb3k_fdc4710_device::drq_w )
|
||||
{
|
||||
LOG("%s: %d\n", FUNCNAME, state);
|
||||
m_isa->drq2_w(state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( isa8_myb3k_fdc4711_device::drq_w )
|
||||
{
|
||||
LOG("%s: %d\n", FUNCNAME, state);
|
||||
m_isa->drq2_w(state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// dack_r - return FDC data trough DMA
|
||||
//-------------------------------------------------
|
||||
uint8_t isa8_myb3k_fdc4710_device::dack_r(int line)
|
||||
{
|
||||
return m_fdc->data_r();
|
||||
}
|
||||
|
||||
uint8_t isa8_myb3k_fdc4711_device::dack_r(int line)
|
||||
{
|
||||
return m_fdc->data_r();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// dack_w - write DMA data to FDC
|
||||
//-------------------------------------------------
|
||||
void isa8_myb3k_fdc4710_device::dack_w(int line, uint8_t data)
|
||||
{
|
||||
return m_fdc->data_w(data);
|
||||
}
|
||||
|
||||
void isa8_myb3k_fdc4711_device::dack_w(int line, uint8_t data)
|
||||
{
|
||||
return m_fdc->data_w(data);
|
||||
}
|
||||
|
||||
#if 0 // eop/tc is used to for logic around multi sector transfers
|
||||
void isa8_myb3k_fdc4710_device::eop_w(int state)
|
||||
{
|
||||
m_fdc->tc_w(state == ASSERT_LINE);
|
||||
}
|
||||
|
||||
void isa8_myb3k_fdc4711_device::eop_w(int state)
|
||||
{
|
||||
m_fdc->tc_w(state == ASSERT_LINE);
|
||||
}
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------
|
||||
// myb3k_inv_fdc_data_r - a LS240 inverts databus for FDC
|
||||
//--------------------------------------------------------
|
||||
READ8_MEMBER( isa8_myb3k_fdc4710_device::myb3k_inv_fdc_data_r )
|
||||
{
|
||||
uint8_t tmp = m_fdc->read(space, offset);
|
||||
LOGR("%s: %02x -> %02x\n", FUNCNAME, tmp, (~tmp) & 0xff);
|
||||
return ~tmp;
|
||||
}
|
||||
|
||||
READ8_MEMBER( isa8_myb3k_fdc4711_device::myb3k_inv_fdc_data_r )
|
||||
{
|
||||
uint8_t tmp = m_fdc->read(space, offset);
|
||||
LOGR("%s: %02x -> %02x\n", FUNCNAME, tmp, (~tmp) & 0xff);
|
||||
return ~tmp;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// myb3k_inv_fdc_data_w - a LS240 inverts databus for FDC
|
||||
//--------------------------------------------------------
|
||||
WRITE8_MEMBER( isa8_myb3k_fdc4710_device::myb3k_inv_fdc_data_w )
|
||||
{
|
||||
LOG("%s: %02x -> %02x\n", FUNCNAME, data, (~data) & 0xff);
|
||||
m_fdc->write(space, offset, (~data) & 0xff);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( isa8_myb3k_fdc4711_device::myb3k_inv_fdc_data_w )
|
||||
{
|
||||
LOG("%s: %02x -> %02x\n", FUNCNAME, data, (~data) & 0xff);
|
||||
m_fdc->write(space, offset, (~data) & 0xff);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// myb3k_fdc_command - descrete fdc card features
|
||||
//-------------------------------------------------
|
||||
#define FDC_MSM_MODE 0x40
|
||||
#define FDC_DDEN 0x20
|
||||
//#define FDC_MOTOR_ON 0x10 // According to service manual but not schematics and BIOS
|
||||
#define FDC_SIDE_SEL 0x08
|
||||
#define FDC_MOTOR_ON 0x04 // According to schematics but "Motor Cont" according to service manual
|
||||
#define FDC_DRIVE_SEL 0x03
|
||||
WRITE8_MEMBER( isa8_myb3k_fdc4710_device::myb3k_fdc_command )
|
||||
{
|
||||
LOG("%s: %02x\n", FUNCNAME, data);
|
||||
LOGCMD(" - Drive %d\n", data & FDC_DRIVE_SEL);
|
||||
LOGCMD(" - Side %d\n", (data & FDC_SIDE_SEL) == 0 ? 0 : 1);
|
||||
LOGCMD(" - Motor %s\n", (data & FDC_MOTOR_ON) ? "ON" : "OFF");
|
||||
LOGCMD(" - Density %s\n", (data & FDC_DDEN) ? "FM" : "MFM");
|
||||
|
||||
floppy_image_device *floppy = nullptr;
|
||||
|
||||
switch(data & FDC_DRIVE_SEL)
|
||||
{
|
||||
case 0:floppy = m_fdd0->get_device(); break;
|
||||
case 1:floppy = m_fdd1->get_device(); break;
|
||||
}
|
||||
|
||||
if (floppy)
|
||||
{
|
||||
LOGCMD(" - Floppy found\n");
|
||||
m_fdc->set_floppy(floppy);
|
||||
floppy->ss_w((data & FDC_SIDE_SEL) ? 1 : 0);
|
||||
floppy->mon_w((data & FDC_MOTOR_ON) ? 0 : 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGCMD(" - Floppy not found\n");
|
||||
}
|
||||
m_fdc->dden_w((data & FDC_DDEN) ? 1 : 0); // active low == MFM
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( isa8_myb3k_fdc4711_device::myb3k_fdc_command )
|
||||
{
|
||||
LOG("%s: %02x\n", FUNCNAME, data);
|
||||
LOGCMD(" - Drive %d\n", data & FDC_DRIVE_SEL);
|
||||
LOGCMD(" - Side %d\n", (data & FDC_SIDE_SEL) == 0 ? 0 : 1);
|
||||
LOGCMD(" - Motor %s\n", (data & FDC_MOTOR_ON) ? "ON" : "OFF");
|
||||
LOGCMD(" - Density %s\n", (data & FDC_DDEN) ? "FM" : "MFM");
|
||||
|
||||
floppy_image_device *floppy = nullptr;
|
||||
|
||||
switch(data & FDC_DRIVE_SEL)
|
||||
{
|
||||
case 0:floppy = m_fdd0->get_device(); break;
|
||||
case 1:floppy = m_fdd1->get_device(); break;
|
||||
case 2:floppy = m_fdd2->get_device(); break;
|
||||
case 3:floppy = m_fdd3->get_device(); break;
|
||||
}
|
||||
|
||||
if (floppy)
|
||||
{
|
||||
LOGCMD(" - Floppy found\n");
|
||||
m_fdc->set_floppy(floppy);
|
||||
floppy->ss_w((data & FDC_SIDE_SEL) ? 1 : 0);
|
||||
floppy->mon_w((data & FDC_MOTOR_ON) ? 0 : 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGCMD(" - Floppy not found\n");
|
||||
}
|
||||
m_fdc->dden_w((data & FDC_DDEN) ? 1 : 0); // active low == MFM
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// myb3k_fdc_status - descrete fdc card status
|
||||
//-------------------------------------------------
|
||||
#define FDC_MSM_END_IR 0x01
|
||||
READ8_MEMBER( isa8_myb3k_fdc4710_device::myb3k_fdc_status )
|
||||
{
|
||||
LOG("%s\n", FUNCNAME);
|
||||
// TODO: return the multi sector mode interrupt status
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
READ8_MEMBER( isa8_myb3k_fdc4711_device::myb3k_fdc_status )
|
||||
{
|
||||
LOG("%s\n", FUNCNAME);
|
||||
// TODO: return the multi sector mode interrupt status
|
||||
return 0x00;
|
||||
}
|
98
src/devices/bus/isa/myb3k_fdc.h
Normal file
98
src/devices/bus/isa/myb3k_fdc.h
Normal file
@ -0,0 +1,98 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Joakim Larsson Edstrom
|
||||
/**********************************************************************
|
||||
|
||||
ISA 8 bit Floppy Disk Controller
|
||||
|
||||
**********************************************************************/
|
||||
#ifndef MAME_BUS_ISA_MYB3K_FDC_H
|
||||
#define MAME_BUS_ISA_MYB3K_FDC_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "isa.h"
|
||||
#include "machine/wd_fdc.h"
|
||||
#include "formats/imd_dsk.h"
|
||||
|
||||
class isa8_myb3k_fdc4710_device :
|
||||
public device_t,
|
||||
public device_isa8_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
isa8_myb3k_fdc4710_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
// construction/destruction
|
||||
isa8_myb3k_fdc4710_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual uint8_t dack_r(int line) override;
|
||||
virtual void dack_w(int line, uint8_t data) override;
|
||||
// virtual void eop_w(int state) override;
|
||||
|
||||
DECLARE_READ8_MEMBER(myb3k_inv_fdc_data_r);
|
||||
DECLARE_WRITE8_MEMBER(myb3k_inv_fdc_data_w);
|
||||
DECLARE_READ8_MEMBER(myb3k_fdc_status);
|
||||
DECLARE_WRITE8_MEMBER(myb3k_fdc_command);
|
||||
DECLARE_ADDRESS_MAP(map, 8);
|
||||
|
||||
required_device<mb8876_device> m_fdc;
|
||||
required_device<floppy_connector> m_fdd0;
|
||||
optional_device<floppy_connector> m_fdd1;
|
||||
|
||||
private:
|
||||
DECLARE_WRITE_LINE_MEMBER( irq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( drq_w );
|
||||
DECLARE_FLOPPY_FORMATS( myb3k_floppy_formats );
|
||||
};
|
||||
|
||||
class isa8_myb3k_fdc4711_device :
|
||||
public device_t,
|
||||
public device_isa8_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
isa8_myb3k_fdc4711_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
// construction/destruction
|
||||
isa8_myb3k_fdc4711_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual uint8_t dack_r(int line) override;
|
||||
virtual void dack_w(int line, uint8_t data) override;
|
||||
// virtual void eop_w(int state) override;
|
||||
|
||||
DECLARE_READ8_MEMBER(myb3k_inv_fdc_data_r);
|
||||
DECLARE_WRITE8_MEMBER(myb3k_inv_fdc_data_w);
|
||||
DECLARE_READ8_MEMBER(myb3k_fdc_status);
|
||||
DECLARE_WRITE8_MEMBER(myb3k_fdc_command);
|
||||
DECLARE_ADDRESS_MAP(map, 8);
|
||||
|
||||
required_device<fd1791_device> m_fdc;
|
||||
required_device<floppy_connector> m_fdd0;
|
||||
optional_device<floppy_connector> m_fdd1;
|
||||
optional_device<floppy_connector> m_fdd2;
|
||||
optional_device<floppy_connector> m_fdd3;
|
||||
|
||||
private:
|
||||
DECLARE_WRITE_LINE_MEMBER( irq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( drq_w );
|
||||
DECLARE_FLOPPY_FORMATS( myb3k_floppy_formats );
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(ISA8_MYB3K_FDC4710, isa8_myb3k_fdc4710_device)
|
||||
DECLARE_DEVICE_TYPE(ISA8_MYB3K_FDC4711, isa8_myb3k_fdc4711_device)
|
||||
//DECLARE_DEVICE_TYPE(ISA8_MYB3K_FDC4712, isa8_myb3k_fdc4712_device)
|
||||
|
||||
#endif // MAME_BUS_ISA_MYB3K_FDC_H
|
Loading…
Reference in New Issue
Block a user