trunk/src/emu/bus/cpc/amdrum.c
| r0 | r31747 | |
| 1 | /* |
| 2 | * amdrum.c |
| 3 | * |
| 4 | * Created on: 23/08/2014 |
| 5 | */ |
| 6 | |
| 7 | #include "emu.h" |
| 8 | #include "amdrum.h" |
| 9 | #include "includes/amstrad.h" |
| 10 | |
| 11 | |
| 12 | //************************************************************************** |
| 13 | // DEVICE DEFINITIONS |
| 14 | //************************************************************************** |
| 15 | |
| 16 | const device_type CPC_AMDRUM = &device_creator<cpc_amdrum_device>; |
| 17 | |
| 18 | |
| 19 | static MACHINE_CONFIG_FRAGMENT( cpc_amdrum ) |
| 20 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 21 | MCFG_DAC_ADD("dac") |
| 22 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 23 | // no pass-through |
| 24 | MACHINE_CONFIG_END |
| 25 | |
| 26 | machine_config_constructor cpc_amdrum_device::device_mconfig_additions() const |
| 27 | { |
| 28 | return MACHINE_CONFIG_NAME( cpc_amdrum ); |
| 29 | } |
| 30 | |
| 31 | //************************************************************************** |
| 32 | // LIVE DEVICE |
| 33 | //************************************************************************** |
| 34 | |
| 35 | cpc_amdrum_device::cpc_amdrum_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 36 | device_t(mconfig, CPC_AMDRUM, "Amdrum", tag, owner, clock, "cpc_amdrum", __FILE__), |
| 37 | device_cpc_expansion_card_interface(mconfig, *this), |
| 38 | m_dac(*this,"dac") |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | //------------------------------------------------- |
| 43 | // device_start - device-specific startup |
| 44 | //------------------------------------------------- |
| 45 | |
| 46 | void cpc_amdrum_device::device_start() |
| 47 | { |
| 48 | device_t* cpu = machine().device("maincpu"); |
| 49 | address_space& space = cpu->memory().space(AS_IO); |
| 50 | m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner()); |
| 51 | |
| 52 | space.install_write_handler(0xff00,0xffff,0,0,write8_delegate(FUNC(cpc_amdrum_device::dac_w),this)); |
| 53 | } |
| 54 | |
| 55 | //------------------------------------------------- |
| 56 | // device_reset - device-specific reset |
| 57 | //------------------------------------------------- |
| 58 | |
| 59 | void cpc_amdrum_device::device_reset() |
| 60 | { |
| 61 | // TODO |
| 62 | } |
| 63 | |
| 64 | WRITE8_MEMBER(cpc_amdrum_device::dac_w) |
| 65 | { |
| 66 | m_dac->write_unsigned8(data); |
| 67 | } |
trunk/src/emu/bus/cpc/amdrum.h
| r0 | r31747 | |
| 1 | /* |
| 2 | * amdrum.h |
| 3 | * |
| 4 | * Created on: 23/08/2014 |
| 5 | * |
| 6 | * Cheetah Marketing Amdrum |
| 7 | * |
| 8 | * I/O FFxx - 8-bit unsigned DAC, write only (Ferranti ZN428E-8) |
| 9 | * Lower 8 address bits are not decoded. |
| 10 | * |
| 11 | */ |
| 12 | |
| 13 | #ifndef AMDRUM_H_ |
| 14 | #define AMDRUM_H_ |
| 15 | |
| 16 | #include "emu.h" |
| 17 | #include "cpcexp.h" |
| 18 | #include "sound/dac.h" |
| 19 | |
| 20 | class cpc_amdrum_device : public device_t, |
| 21 | public device_cpc_expansion_card_interface |
| 22 | { |
| 23 | public: |
| 24 | // construction/destruction |
| 25 | cpc_amdrum_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 26 | |
| 27 | // optional information overrides |
| 28 | virtual machine_config_constructor device_mconfig_additions() const; |
| 29 | |
| 30 | DECLARE_WRITE8_MEMBER(dac_w); |
| 31 | protected: |
| 32 | // device-level overrides |
| 33 | virtual void device_start(); |
| 34 | virtual void device_reset(); |
| 35 | |
| 36 | private: |
| 37 | cpc_expansion_slot_device *m_slot; |
| 38 | |
| 39 | required_device<dac_device> m_dac; |
| 40 | }; |
| 41 | |
| 42 | // device type definition |
| 43 | extern const device_type CPC_AMDRUM; |
| 44 | |
| 45 | |
| 46 | #endif /* AMDRUM_H_ */ |
trunk/src/mess/drivers/amstrad.c
| r31746 | r31747 | |
| 816 | 816 | SLOT_INTERFACE("rs232", CPC_RS232) |
| 817 | 817 | SLOT_INTERFACE("amsrs232", CPC_RS232_AMS) |
| 818 | 818 | SLOT_INTERFACE("sf2", CPC_SYMBIFACE2) |
| 819 | SLOT_INTERFACE("amdrum", CPC_AMDRUM) |
| 819 | 820 | SLOT_INTERFACE_END |
| 820 | 821 | |
| 821 | 822 | SLOT_INTERFACE_START(cpcplus_exp_cards) |
| r31746 | r31747 | |
| 826 | 827 | SLOT_INTERFACE("rs232", CPC_RS232) |
| 827 | 828 | SLOT_INTERFACE("amsrs232", CPC_RS232_AMS) |
| 828 | 829 | SLOT_INTERFACE("sf2", CPC_SYMBIFACE2) |
| 830 | SLOT_INTERFACE("amdrum", CPC_AMDRUM) |
| 829 | 831 | SLOT_INTERFACE_END |
| 830 | 832 | |
| 831 | 833 | static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state ) |