diff --git a/.gitattributes b/.gitattributes index 652895d7b4a..4c607b7bf50 100644 --- a/.gitattributes +++ b/.gitattributes @@ -785,6 +785,8 @@ src/emu/bus/comx35/ram.c svneol=native#text/plain src/emu/bus/comx35/ram.h svneol=native#text/plain src/emu/bus/comx35/thermal.c svneol=native#text/plain src/emu/bus/comx35/thermal.h svneol=native#text/plain +src/emu/bus/cpc/amdrum.c svneol=native#text/plain +src/emu/bus/cpc/amdrum.h svneol=native#text/plain src/emu/bus/cpc/cpc_pds.c svneol=native#text/plain src/emu/bus/cpc/cpc_pds.h svneol=native#text/plain src/emu/bus/cpc/cpc_rom.c svneol=native#text/plain diff --git a/src/emu/bus/bus.mak b/src/emu/bus/bus.mak index a8605a7ec47..1b356c19fbb 100644 --- a/src/emu/bus/bus.mak +++ b/src/emu/bus/bus.mak @@ -1082,6 +1082,7 @@ BUSOBJS += $(BUSOBJ)/cpc/cpc_pds.o BUSOBJS += $(BUSOBJ)/cpc/cpc_rs232.o BUSOBJS += $(BUSOBJ)/cpc/mface2.o BUSOBJS += $(BUSOBJ)/cpc/symbfac2.o +BUSOBJS += $(BUSOBJ)/cpc/amdrum.o endif #------------------------------------------------- diff --git a/src/emu/bus/cpc/amdrum.c b/src/emu/bus/cpc/amdrum.c new file mode 100644 index 00000000000..83ce8d21b9b --- /dev/null +++ b/src/emu/bus/cpc/amdrum.c @@ -0,0 +1,67 @@ +/* + * amdrum.c + * + * Created on: 23/08/2014 + */ + +#include "emu.h" +#include "amdrum.h" +#include "includes/amstrad.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type CPC_AMDRUM = &device_creator; + + +static MACHINE_CONFIG_FRAGMENT( cpc_amdrum ) + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_DAC_ADD("dac") + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + // no pass-through +MACHINE_CONFIG_END + +machine_config_constructor cpc_amdrum_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( cpc_amdrum ); +} + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +cpc_amdrum_device::cpc_amdrum_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, CPC_AMDRUM, "Amdrum", tag, owner, clock, "cpc_amdrum", __FILE__), + device_cpc_expansion_card_interface(mconfig, *this), + m_dac(*this,"dac") +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void cpc_amdrum_device::device_start() +{ + device_t* cpu = machine().device("maincpu"); + address_space& space = cpu->memory().space(AS_IO); + m_slot = dynamic_cast(owner()); + + space.install_write_handler(0xff00,0xffff,0,0,write8_delegate(FUNC(cpc_amdrum_device::dac_w),this)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void cpc_amdrum_device::device_reset() +{ + // TODO +} + +WRITE8_MEMBER(cpc_amdrum_device::dac_w) +{ + m_dac->write_unsigned8(data); +} diff --git a/src/emu/bus/cpc/amdrum.h b/src/emu/bus/cpc/amdrum.h new file mode 100644 index 00000000000..0abcdefb558 --- /dev/null +++ b/src/emu/bus/cpc/amdrum.h @@ -0,0 +1,46 @@ +/* + * amdrum.h + * + * Created on: 23/08/2014 + * + * Cheetah Marketing Amdrum + * + * I/O FFxx - 8-bit unsigned DAC, write only (Ferranti ZN428E-8) + * Lower 8 address bits are not decoded. + * + */ + +#ifndef AMDRUM_H_ +#define AMDRUM_H_ + +#include "emu.h" +#include "cpcexp.h" +#include "sound/dac.h" + +class cpc_amdrum_device : public device_t, + public device_cpc_expansion_card_interface +{ +public: + // construction/destruction + cpc_amdrum_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_WRITE8_MEMBER(dac_w); +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + +private: + cpc_expansion_slot_device *m_slot; + + required_device m_dac; +}; + +// device type definition +extern const device_type CPC_AMDRUM; + + +#endif /* AMDRUM_H_ */ diff --git a/src/mess/drivers/amstrad.c b/src/mess/drivers/amstrad.c index ab94f5e97ba..e09868b3578 100644 --- a/src/mess/drivers/amstrad.c +++ b/src/mess/drivers/amstrad.c @@ -816,6 +816,7 @@ SLOT_INTERFACE_START(cpc_exp_cards) SLOT_INTERFACE("rs232", CPC_RS232) SLOT_INTERFACE("amsrs232", CPC_RS232_AMS) SLOT_INTERFACE("sf2", CPC_SYMBIFACE2) + SLOT_INTERFACE("amdrum", CPC_AMDRUM) SLOT_INTERFACE_END SLOT_INTERFACE_START(cpcplus_exp_cards) @@ -826,6 +827,7 @@ SLOT_INTERFACE_START(cpcplus_exp_cards) SLOT_INTERFACE("rs232", CPC_RS232) SLOT_INTERFACE("amsrs232", CPC_RS232_AMS) SLOT_INTERFACE("sf2", CPC_SYMBIFACE2) + SLOT_INTERFACE("amdrum", CPC_AMDRUM) SLOT_INTERFACE_END static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state ) diff --git a/src/mess/includes/amstrad.h b/src/mess/includes/amstrad.h index 3556209619d..8bc88fb9203 100644 --- a/src/mess/includes/amstrad.h +++ b/src/mess/includes/amstrad.h @@ -21,6 +21,7 @@ #include "bus/cpc/cpc_pds.h" #include "bus/cpc/cpc_rs232.h" #include "bus/cpc/symbfac2.h" +#include "bus/cpc/amdrum.h" #include "machine/ram.h" #include "imagedev/cassette.h" #include "bus/centronics/ctronics.h"