amstrad: added Draysoft Doubler expansion device

This commit is contained in:
mahlemiut 2015-10-26 16:12:26 +13:00
parent de1623dbf3
commit 1e2904037e
5 changed files with 127 additions and 0 deletions

View File

@ -2201,6 +2201,8 @@ if (BUSES["CPC"]~=null) then
MAME_DIR .. "src/devices/bus/cpc/ddi1.h",
MAME_DIR .. "src/devices/bus/cpc/magicsound.c",
MAME_DIR .. "src/devices/bus/cpc/magicsound.h",
MAME_DIR .. "src/devices/bus/cpc/doubler.c",
MAME_DIR .. "src/devices/bus/cpc/doubler.h",
}
end

View File

@ -0,0 +1,75 @@
// license:BSD-3-Clause
// copyright-holders:Barry Rodewald
/*
* doubler.c -- Draysoft Doubler - external cassette interface for the 464 (works on 664/6128 with external cassette?),
* intended for use in duplicating cassette software
*
*/
#include "doubler.h"
#include "includes/amstrad.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type CPC_DOUBLER = &device_creator<cpc_doubler_device>;
static MACHINE_CONFIG_FRAGMENT( cpc_doubler )
MCFG_CASSETTE_ADD( "doubler_tape" )
MCFG_CASSETTE_FORMATS(cdt_cassette_formats)
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED)
MCFG_CASSETTE_INTERFACE("cpc_cass")
// no pass-through seen on remake PCBs, unknown if actual hardware had a pass-through port or not
MACHINE_CONFIG_END
machine_config_constructor cpc_doubler_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( cpc_doubler );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
cpc_doubler_device::cpc_doubler_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, CPC_DOUBLER, "Draysoft Doubler", tag, owner, clock, "cpc_doubler", __FILE__),
device_cpc_expansion_card_interface(mconfig, *this),
m_tape(*this,"doubler_tape")
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void cpc_doubler_device::device_start()
{
device_t* cpu = machine().device("maincpu");
address_space& space = cpu->memory().space(AS_IO);
m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner());
space.install_read_handler(0xf0e0,0xf0e0,0,0,read8_delegate(FUNC(cpc_doubler_device::ext_tape_r),this));
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void cpc_doubler_device::device_reset()
{
// TODO
}
READ8_MEMBER(cpc_doubler_device::ext_tape_r)
{
UINT8 data = 0;
if(m_tape->input() > 0.03)
data |= 0x20;
return data;
}

View File

@ -0,0 +1,45 @@
// license:BSD-3-Clause
// copyright-holders:Barry Rodewald
/*
* doubler.c -- Draysoft Doubler - external cassette interface for the 464 (works on 664/6128 with external cassette?),
* intended for use in duplicating cassette software
*
* Uses only port F0E0 (may conflict with other peripherals, PPI port A is not usable while Doubler software is running)
*
*/
#ifndef DOUBLER_H_
#define DOUBLER_H_
#include "emu.h"
#include "cpcexp.h"
#include "imagedev/cassette.h"
#include "formats/tzx_cas.h"
class cpc_doubler_device : public device_t,
public device_cpc_expansion_card_interface
{
public:
// construction/destruction
cpc_doubler_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
DECLARE_READ8_MEMBER(ext_tape_r);
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
private:
cpc_expansion_slot_device *m_slot;
required_device<cassette_image_device> m_tape;
};
// device type definition
extern const device_type CPC_DOUBLER;
#endif /* DOUBLER_H_ */

View File

@ -814,6 +814,7 @@ SLOT_INTERFACE_START(cpc464_exp_cards)
SLOT_INTERFACE("smartwatch", CPC_SMARTWATCH)
SLOT_INTERFACE("brunword4", CPC_BRUNWORD_MK4)
SLOT_INTERFACE("hd20", CPC_HD20)
SLOT_INTERFACE("doubler", CPC_DOUBLER)
SLOT_INTERFACE_END
SLOT_INTERFACE_START(cpc_exp_cards)
@ -830,6 +831,7 @@ SLOT_INTERFACE_START(cpc_exp_cards)
SLOT_INTERFACE("smartwatch", CPC_SMARTWATCH)
SLOT_INTERFACE("brunword4", CPC_BRUNWORD_MK4)
SLOT_INTERFACE("hd20", CPC_HD20)
SLOT_INTERFACE("doubler", CPC_DOUBLER)
SLOT_INTERFACE_END
SLOT_INTERFACE_START(cpcplus_exp_cards)
@ -844,6 +846,7 @@ SLOT_INTERFACE_START(cpcplus_exp_cards)
SLOT_INTERFACE("playcity", CPC_PLAYCITY)
SLOT_INTERFACE("smartwatch", CPC_SMARTWATCH)
SLOT_INTERFACE("hd20", CPC_HD20)
SLOT_INTERFACE("doubler", CPC_DOUBLER)
SLOT_INTERFACE_END
SLOT_INTERFACE_START(aleste_exp_cards)
@ -860,6 +863,7 @@ SLOT_INTERFACE_START(aleste_exp_cards)
SLOT_INTERFACE("smartwatch", CPC_SMARTWATCH)
SLOT_INTERFACE("brunword4", CPC_BRUNWORD_MK4)
SLOT_INTERFACE("hd20", CPC_HD20)
SLOT_INTERFACE("doubler", CPC_DOUBLER)
SLOT_INTERFACE("magicsound", AL_MAGICSOUND)
SLOT_INTERFACE_END

View File

@ -30,6 +30,7 @@
#include "bus/cpc/brunword4.h"
#include "bus/cpc/hd20.h"
#include "bus/cpc/magicsound.h"
#include "bus/cpc/doubler.h"
#include "machine/ram.h"
#include "imagedev/cassette.h"
#include "bus/centronics/ctronics.h"