tiki100: Added skeleton for Winchester controller. [Curt Coder]

This commit is contained in:
Curt Coder 2015-10-14 22:55:09 +03:00
parent dada051a35
commit 60d08590a1
6 changed files with 180 additions and 2 deletions

View file

@ -542,10 +542,10 @@
</software>
<software name="msdos">
<!-- 16 bit -->
<description>MS-DOS v2.11 (Nor)</description>
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
<sharedfeat name="requirement" value="slot1:8088"/>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="368640">
<rom name="msdos.dsk" size="368640" crc="4475dfa0" sha1="f925a7d60df8291c5b8aaa140a01933bba4a10c0" offset="0"/>
@ -859,6 +859,7 @@
<description>TIKOS systemdiskett v2.0/24 (Nor)</description>
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
<sharedfeat name="requirement" value="slot1:8088"/>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="409600">
<rom name="tikos20.dsk" size="409600" crc="44ac5d24" sha1="25b8002738ae729539032a8eee49c64d316640cf" offset="0"/>

View file

@ -1110,6 +1110,8 @@ if (BUSES["TIKI100"]~=null) then
MAME_DIR .. "src/devices/bus/tiki100/exp.h",
MAME_DIR .. "src/devices/bus/tiki100/8088.c",
MAME_DIR .. "src/devices/bus/tiki100/8088.h",
MAME_DIR .. "src/devices/bus/tiki100/hdc.c",
MAME_DIR .. "src/devices/bus/tiki100/hdc.h",
}
end

View file

@ -171,7 +171,9 @@ device_tiki100bus_card_interface::device_tiki100bus_card_interface(const machine
// slot devices
#include "8088.h"
#include "hdc.h"
SLOT_INTERFACE_START( tiki100_cards )
SLOT_INTERFACE("8088", TIKI100_8088)
SLOT_INTERFACE("hdc", TIKI100_HDC)
SLOT_INTERFACE_END

View file

@ -0,0 +1,118 @@
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************
TIKI-100 Winchester controller card emulation
**********************************************************************/
#include "hdc.h"
//**************************************************************************
// MACROS/CONSTANTS
//**************************************************************************
#define WD1010_TAG "hdc"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type TIKI100_HDC = &device_creator<tiki100_hdc_t>;
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( tiki100_hdc )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( tiki100_hdc )
MCFG_DEVICE_ADD(WD1010_TAG, WD2010, 5000000)
//MCFG_WD2010_OUT_INTRQ_CB()
MCFG_WD2010_IN_DRDY_CB(VCC)
MCFG_WD2010_IN_INDEX_CB(VCC)
MCFG_WD2010_IN_WF_CB(VCC)
MCFG_WD2010_IN_TK000_CB(VCC)
MCFG_WD2010_IN_SC_CB(VCC)
MCFG_HARDDISK_ADD("hard0")
MCFG_HARDDISK_ADD("hard1")
MACHINE_CONFIG_END
//-------------------------------------------------
// machine_config_additions - device-specific
// machine configurations
//-------------------------------------------------
machine_config_constructor tiki100_hdc_t::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( tiki100_hdc );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// tiki100_hdc_t - constructor
//-------------------------------------------------
tiki100_hdc_t::tiki100_hdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, TIKI100_HDC, "TIKI-100 Winchester controller", tag, owner, clock, "tiki100_hdc", __FILE__),
device_tiki100bus_card_interface(mconfig, *this),
m_hdc(*this, WD1010_TAG)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void tiki100_hdc_t::device_start()
{
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void tiki100_hdc_t::device_reset()
{
m_hdc->reset();
}
//-------------------------------------------------
// tiki100bus_iorq_r - I/O read
//-------------------------------------------------
UINT8 tiki100_hdc_t::iorq_r(address_space &space, offs_t offset, UINT8 data)
{
if ((offset & 0xf8) == 0x20)
{
data = m_hdc->read(space, offset & 0x07);
}
return data;
}
//-------------------------------------------------
// tiki100bus_iorq_w - I/O write
//-------------------------------------------------
void tiki100_hdc_t::iorq_w(address_space &space, offs_t offset, UINT8 data)
{
if ((offset & 0xf8) == 0x20)
{
m_hdc->write(space, offset, data);
}
}

View file

@ -0,0 +1,55 @@
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************
TIKI-100 Winchester controller card emulation
**********************************************************************/
#pragma once
#ifndef __TIKI100_HDC__
#define __TIKI100_HDC__
#include "emu.h"
#include "bus/tiki100/exp.h"
#include "imagedev/harddriv.h"
#include "machine/wd2010.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> tiki100_hdc_t
class tiki100_hdc_t : public device_t,
public device_tiki100bus_card_interface
{
public:
// construction/destruction
tiki100_hdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
// device_tiki100bus_card_interface overrides
virtual UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data);
virtual void iorq_w(address_space &space, offs_t offset, UINT8 data);
private:
required_device<wd2010_device> m_hdc;
};
// device type definition
extern const device_type TIKI100_HDC;
#endif

View file

@ -709,7 +709,7 @@ static MACHINE_CONFIG_START( tiki100, tiki100_state )
//MCFG_TIKI100_BUS_IRQ_CALLBACK()
//MCFG_TIKI100_BUS_NMI_CALLBACK()
MCFG_TIKI100_BUS_SLOT_ADD("slot1", "8088")
MCFG_TIKI100_BUS_SLOT_ADD("slot2", NULL)
MCFG_TIKI100_BUS_SLOT_ADD("slot2", "hdc")
MCFG_TIKI100_BUS_SLOT_ADD("slot3", NULL)
/* devices */