mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
spectrum: Added the Cheetah SpecDrum device.
This commit is contained in:
parent
596c68e755
commit
3a8fc3967b
@ -3307,6 +3307,8 @@ if (BUSES["SPECTRUM"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/spectrum/plus2test.h",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/protek.cpp",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/protek.h",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/specdrum.cpp",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/specdrum.h",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/uslot.cpp",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/uslot.h",
|
||||
MAME_DIR .. "src/devices/bus/spectrum/usource.cpp",
|
||||
|
@ -171,6 +171,7 @@ void spectrum_expansion_slot_device::mreq_w(offs_t offset, uint8_t data)
|
||||
#include "plus2test.h"
|
||||
//#include "plusd.h"
|
||||
#include "protek.h"
|
||||
#include "specdrum.h"
|
||||
#include "uslot.h"
|
||||
#include "usource.h"
|
||||
#include "uspeech.h"
|
||||
@ -192,6 +193,7 @@ void spectrum_expansion_devices(device_slot_interface &device)
|
||||
//device.option_add("opus", SPECTRUM_OPUS);
|
||||
//device.option_add("plusd", SPECTRUM_PLUSD);
|
||||
device.option_add("protek", SPECTRUM_PROTEK);
|
||||
device.option_add("specdrum", SPECTRUM_SPECDRUM);
|
||||
device.option_add("uslot", SPECTRUM_USLOT);
|
||||
device.option_add("usource", SPECTRUM_USOURCE);
|
||||
device.option_add("uspeech", SPECTRUM_USPEECH);
|
||||
@ -209,6 +211,7 @@ void spec128_expansion_devices(device_slot_interface &device)
|
||||
device.option_add("mprint", SPECTRUM_MPRINT);
|
||||
device.option_add("plus2test", SPECTRUM_PLUS2TEST);
|
||||
device.option_add("protek", SPECTRUM_PROTEK);
|
||||
device.option_add("specdrum", SPECTRUM_SPECDRUM);
|
||||
}
|
||||
|
||||
void specpls3_expansion_devices(device_slot_interface &device)
|
||||
|
73
src/devices/bus/spectrum/specdrum.cpp
Normal file
73
src/devices/bus/spectrum/specdrum.cpp
Normal file
@ -0,0 +1,73 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
Cheetah Marketing SpecDrum emulation
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "specdrum.h"
|
||||
#include "sound/volt_reg.h"
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(SPECTRUM_SPECDRUM, spectrum_specdrum_device, "spectrum_specdrum", "SpecDrum")
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
void spectrum_specdrum_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
SPEAKER(config, "speaker").front_center();
|
||||
ZN428E(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5);
|
||||
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
|
||||
vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
|
||||
vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// spectrum_specdrum_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
spectrum_specdrum_device::spectrum_specdrum_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, SPECTRUM_SPECDRUM, tag, owner, clock)
|
||||
, device_spectrum_expansion_interface(mconfig, *this)
|
||||
, m_dac(*this, "dac")
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void spectrum_specdrum_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// IMPLEMENTATION
|
||||
//**************************************************************************
|
||||
|
||||
void spectrum_specdrum_device::iorq_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
switch (offset & 0x00ff)
|
||||
{
|
||||
case 0xdf:
|
||||
m_dac->write(data);
|
||||
break;
|
||||
}
|
||||
}
|
51
src/devices/bus/spectrum/specdrum.h
Normal file
51
src/devices/bus/spectrum/specdrum.h
Normal file
@ -0,0 +1,51 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
Cheetah Marketing SpecDrum emulation
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_SPECTRUM_SPECDRUM_H
|
||||
#define MAME_BUS_SPECTRUM_SPECDRUM_H
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "exp.h"
|
||||
#include "sound/dac.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> spectrum_specdrum_device
|
||||
|
||||
class spectrum_specdrum_device :
|
||||
public device_t,
|
||||
public device_spectrum_expansion_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
spectrum_specdrum_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
virtual void iorq_w(offs_t offset, uint8_t data) override;
|
||||
|
||||
private:
|
||||
required_device<dac_byte_interface> m_dac;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(SPECTRUM_SPECDRUM, spectrum_specdrum_device)
|
||||
|
||||
|
||||
#endif // MAME_BUS_SPECTRUM_SPECDRUM_H
|
Loading…
Reference in New Issue
Block a user