mirror of
https://github.com/holub/mame
synced 2025-04-24 01:11:11 +03:00
Created a base class delegate_common_base for all delegate
types. Created a binding_type_exception which is thrown when a bind attempt fails due to mismatched types. Added helper templates to driver_device to wrap legacy device read/write handlers into driver_device member functions. This should help move some things forward until more common code is converted into proper devices. Introduce new module devcb2 which contains modernized versions of devcb. Compared to previous implementation this one is simpler overall, trampolining calls through a single internal set of adapter functions. The new versions are also designed to be specified in the machine_config rather than in structures, so they are no longer simple POD types. Additional new/changed features: * reads and writes can map to delegates for line or 8/16/32/64-bit * reads and writes can map to an I/O port * reads can be mapped to a constant value, with or without logging * writes can be mapped to a device's input line * all reads/writes can have a shift, mask, and/or xor applied * devices can opt to make the functions safe-if-NULL when resolving * only member function types are supported Rewrote the YM2151 interface to be fully modernized, and removed the ym2151_interface struct in favor of inline configs using the new devcb2 mechanism. In many cases, removed no longer needed trampolines, instead taking advantage of direct support for input line writes.
This commit is contained in:
parent
85f1df0adc
commit
ecfbeb7fd0
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -876,6 +876,8 @@ src/emu/delegate.c svneol=native#text/plain
|
||||
src/emu/delegate.h svneol=native#text/plain
|
||||
src/emu/devcb.c svneol=native#text/plain
|
||||
src/emu/devcb.h svneol=native#text/plain
|
||||
src/emu/devcb2.c svneol=native#text/plain
|
||||
src/emu/devcb2.h svneol=native#text/plain
|
||||
src/emu/devcpu.c svneol=native#text/plain
|
||||
src/emu/devcpu.h svneol=native#text/plain
|
||||
src/emu/devdelegate.c svneol=native#text/plain
|
||||
|
@ -107,6 +107,10 @@
|
||||
#ifndef __DELEGATE_H__
|
||||
#define __DELEGATE_H__
|
||||
|
||||
// standard C++ includes
|
||||
#include <exception>
|
||||
#include <typeinfo>
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MACROS
|
||||
@ -151,6 +155,19 @@ public:
|
||||
};
|
||||
|
||||
|
||||
// ======================> binding_type_exception
|
||||
|
||||
// exception that is thrown when a bind fails the dynamic_cast
|
||||
class binding_type_exception : public std::exception
|
||||
{
|
||||
public:
|
||||
binding_type_exception(const std::type_info &target_type, const std::type_info &actual_type)
|
||||
: m_target_type(target_type), m_actual_type(actual_type) { }
|
||||
const std::type_info &m_target_type;
|
||||
const std::type_info &m_actual_type;
|
||||
};
|
||||
|
||||
|
||||
// ======================> delegate_traits
|
||||
|
||||
// delegate_traits is a meta-template that is used to provide a static function pointer
|
||||
@ -215,6 +232,53 @@ struct delegate_traits<_ClassType, _ReturnType, _noparam, _noparam, _noparam, _n
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// COMMON DELEGATE BASE CLASS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> delegate_common_base
|
||||
|
||||
// common non-templatized base class
|
||||
class delegate_common_base
|
||||
{
|
||||
protected:
|
||||
typedef delegate_generic_class *(*late_bind_func)(delegate_late_bind &object);
|
||||
|
||||
// construction
|
||||
delegate_common_base(const char *name = NULL, late_bind_func latebinder = NULL, delegate_generic_class *object = NULL)
|
||||
: m_name(name),
|
||||
m_object(object),
|
||||
m_latebinder(latebinder) { }
|
||||
|
||||
delegate_common_base(const delegate_common_base &src)
|
||||
: m_name(src.m_name),
|
||||
m_object(src.m_object),
|
||||
m_latebinder(src.m_latebinder) { }
|
||||
|
||||
public:
|
||||
// getters
|
||||
bool has_object() const { return (m_object != NULL); }
|
||||
const char *name() const { return m_name; }
|
||||
|
||||
protected:
|
||||
// late binding helper
|
||||
template<class _FunctionClass>
|
||||
static delegate_generic_class *late_bind_helper(delegate_late_bind &object)
|
||||
{
|
||||
_FunctionClass *result = dynamic_cast<_FunctionClass *>(&object);
|
||||
if (result == NULL)
|
||||
throw binding_type_exception(typeid(_FunctionClass), typeid(object));
|
||||
return reinterpret_cast<delegate_generic_class *>(result);
|
||||
}
|
||||
|
||||
// internal state
|
||||
const char * m_name; // name string
|
||||
delegate_generic_class * m_object; // pointer to the post-cast object
|
||||
late_bind_func m_latebinder; // late binding helper
|
||||
};
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// COMPATIBLE DELEGATES
|
||||
//**************************************************************************
|
||||
@ -272,10 +336,8 @@ struct delegate_raw_mfp
|
||||
|
||||
// general delegate class template supporting up to 4 parameters
|
||||
template<typename _ReturnType, typename _P1Type = _noparam, typename _P2Type = _noparam, typename _P3Type = _noparam, typename _P4Type = _noparam, typename _P5Type = _noparam>
|
||||
class delegate_base
|
||||
class delegate_base : public delegate_common_base
|
||||
{
|
||||
typedef delegate_generic_class *(*late_bind_func)(delegate_late_bind &object);
|
||||
|
||||
public:
|
||||
// define our traits
|
||||
template<class _FunctionClass>
|
||||
@ -289,57 +351,56 @@ public:
|
||||
|
||||
// generic constructor
|
||||
delegate_base()
|
||||
: m_name(NULL),
|
||||
m_object(NULL),
|
||||
m_callobject(NULL),
|
||||
m_function(NULL),
|
||||
m_latebinder(NULL) { }
|
||||
: m_function(NULL),
|
||||
m_callobject(NULL) { }
|
||||
|
||||
// copy constructor
|
||||
delegate_base(const delegate_base &src)
|
||||
: m_name(src.m_name),
|
||||
m_object(src.m_object),
|
||||
m_callobject(src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object),
|
||||
: delegate_common_base(src),
|
||||
m_function(src.m_function),
|
||||
m_rawfunction(src.m_rawfunction),
|
||||
m_latebinder(src.m_latebinder) { }
|
||||
m_callobject(src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object),
|
||||
m_rawfunction(src.m_rawfunction) { }
|
||||
|
||||
// copy constructor with late bind
|
||||
delegate_base(const delegate_base &src, delegate_late_bind &object)
|
||||
: m_name(src.m_name),
|
||||
m_object(src.m_object),
|
||||
m_callobject(src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object),
|
||||
: delegate_common_base(src),
|
||||
m_function(src.m_function),
|
||||
m_rawfunction(src.m_rawfunction),
|
||||
m_latebinder(src.m_latebinder) { late_bind(object); }
|
||||
m_callobject(src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object),
|
||||
m_rawfunction(src.m_rawfunction)
|
||||
{
|
||||
late_bind(object);
|
||||
}
|
||||
|
||||
// construct from member function with object pointer
|
||||
template<class _FunctionClass>
|
||||
delegate_base(typename traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object)
|
||||
: m_name(name),
|
||||
m_object(NULL),
|
||||
m_callobject(reinterpret_cast<delegate_generic_class *>(this)),
|
||||
: delegate_common_base(name, &late_bind_helper<_FunctionClass>),
|
||||
m_function(&delegate_base::method_stub<_FunctionClass>),
|
||||
m_rawfunction(funcptr),
|
||||
m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
m_callobject(reinterpret_cast<delegate_generic_class *>(this)),
|
||||
m_rawfunction(funcptr)
|
||||
{
|
||||
bind(reinterpret_cast<delegate_generic_class *>(object));
|
||||
}
|
||||
|
||||
// construct from static function with object pointer
|
||||
template<class _FunctionClass>
|
||||
delegate_base(typename traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object)
|
||||
: m_name(name),
|
||||
m_object(NULL),
|
||||
m_callobject(NULL),
|
||||
: delegate_common_base(name, &late_bind_helper<_FunctionClass>),
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr)),
|
||||
m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
m_callobject(NULL)
|
||||
{
|
||||
bind(reinterpret_cast<delegate_generic_class *>(object));
|
||||
}
|
||||
|
||||
// construct from static reference function with object pointer
|
||||
template<class _FunctionClass>
|
||||
delegate_base(typename traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object)
|
||||
: m_name(name),
|
||||
m_object(NULL),
|
||||
m_callobject(NULL),
|
||||
: delegate_common_base(name, &late_bind_helper<_FunctionClass>),
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr)),
|
||||
m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
m_callobject(NULL)
|
||||
{
|
||||
bind(reinterpret_cast<delegate_generic_class *>(object));
|
||||
}
|
||||
|
||||
// copy operator
|
||||
delegate_base &operator=(const delegate_base &src)
|
||||
@ -364,8 +425,6 @@ public:
|
||||
|
||||
// getters
|
||||
bool isnull() const { return (m_function == NULL); }
|
||||
bool has_object() const { return (m_object != NULL); }
|
||||
const char *name() const { return m_name; }
|
||||
|
||||
// call the function
|
||||
_ReturnType operator()() const { return (*m_function)(m_callobject); }
|
||||
@ -444,21 +503,10 @@ protected:
|
||||
return (reinterpret_cast<_FunctionClass *>(_this->m_object)->*mfp)(p1, p2, p3, p4, p5);
|
||||
}
|
||||
|
||||
// late binding helper
|
||||
template<class _FunctionClass>
|
||||
static delegate_generic_class *late_bind_helper(delegate_late_bind &object)
|
||||
{
|
||||
_FunctionClass *result = dynamic_cast<_FunctionClass *>(&object);
|
||||
return reinterpret_cast<delegate_generic_class *>(result);
|
||||
}
|
||||
|
||||
// internal state
|
||||
const char * m_name; // name string
|
||||
delegate_generic_class * m_object; // pointer to the post-cast object
|
||||
delegate_generic_class * m_callobject; // pointer to the object used for calling
|
||||
generic_static_func m_function; // generic static function pointer
|
||||
delegate_generic_class * m_callobject; // pointer to the object used for calling
|
||||
delegate_raw_mfp m_rawfunction; // copy of raw MFP
|
||||
late_bind_func m_latebinder; // late binding helper
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -525,10 +573,8 @@ struct delegate_internal_mfp
|
||||
// ======================> delegate_base
|
||||
|
||||
template<typename _ReturnType, typename _P1Type = _noparam, typename _P2Type = _noparam, typename _P3Type = _noparam, typename _P4Type = _noparam, typename _P5Type = _noparam>
|
||||
class delegate_base
|
||||
class delegate_base : public delegate_common_base
|
||||
{
|
||||
typedef delegate_generic_class *(*late_bind_func)(delegate_late_bind &object);
|
||||
|
||||
public:
|
||||
// define our traits
|
||||
template<class _FunctionClass>
|
||||
@ -542,51 +588,50 @@ public:
|
||||
|
||||
// generic constructor
|
||||
delegate_base()
|
||||
: m_name(NULL),
|
||||
m_object(NULL),
|
||||
m_function(NULL),
|
||||
m_latebinder(NULL) { }
|
||||
: m_function(NULL) { }
|
||||
|
||||
// copy constructor
|
||||
delegate_base(const delegate_base &src)
|
||||
: m_name(src.m_name),
|
||||
m_object(src.m_object),
|
||||
: delegate_common_base(src),
|
||||
m_function(src.m_function),
|
||||
m_rawfunction(src.m_rawfunction),
|
||||
m_latebinder(src.m_latebinder) { }
|
||||
m_rawfunction(src.m_rawfunction) { }
|
||||
|
||||
// copy constructor with late bind
|
||||
delegate_base(const delegate_base &src, delegate_late_bind &object)
|
||||
: m_name(src.m_name),
|
||||
m_object(src.m_object),
|
||||
: delegate_common_base(src),
|
||||
m_function(src.m_function),
|
||||
m_rawfunction(src.m_rawfunction),
|
||||
m_latebinder(src.m_latebinder) { late_bind(object); }
|
||||
m_rawfunction(src.m_rawfunction)
|
||||
{
|
||||
late_bind(object);
|
||||
}
|
||||
|
||||
// construct from member function with object pointer
|
||||
template<class _FunctionClass>
|
||||
delegate_base(typename traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object)
|
||||
: m_name(name),
|
||||
m_object(NULL),
|
||||
: delegate_common_base(name, &late_bind_helper<_FunctionClass>),
|
||||
m_function(NULL),
|
||||
m_rawfunction(funcptr),
|
||||
m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
m_rawfunction(funcptr)
|
||||
{
|
||||
bind(reinterpret_cast<delegate_generic_class *>(object));
|
||||
}
|
||||
|
||||
// construct from static function with object pointer
|
||||
template<class _FunctionClass>
|
||||
delegate_base(typename traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object)
|
||||
: m_name(name),
|
||||
m_object(NULL),
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr)),
|
||||
m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
: delegate_common_base(name, &late_bind_helper<_FunctionClass>),
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr))
|
||||
{
|
||||
bind(reinterpret_cast<delegate_generic_class *>(object));
|
||||
}
|
||||
|
||||
// construct from static reference function with object pointer
|
||||
template<class _FunctionClass>
|
||||
delegate_base(typename traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object)
|
||||
: m_name(name),
|
||||
m_object(NULL),
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr)),
|
||||
m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
: delegate_common_base(name, &late_bind_helper<_FunctionClass>),
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr))
|
||||
{
|
||||
bind(reinterpret_cast<delegate_generic_class *>(object));
|
||||
}
|
||||
|
||||
// copy operator
|
||||
delegate_base &operator=(const delegate_base &src)
|
||||
@ -610,8 +655,6 @@ public:
|
||||
|
||||
// getters
|
||||
bool isnull() const { return (m_function == NULL && m_rawfunction.m_function == 0); }
|
||||
bool has_object() const { return (m_object != NULL); }
|
||||
const char *name() const { return m_name; }
|
||||
|
||||
// call the function
|
||||
_ReturnType operator()() const { return (*m_function)(m_object); }
|
||||
@ -633,20 +676,9 @@ protected:
|
||||
m_function = reinterpret_cast<generic_static_func>(m_rawfunction.convert_to_generic(m_object));
|
||||
}
|
||||
|
||||
// late binding helper
|
||||
template<class _FunctionClass>
|
||||
static delegate_generic_class *late_bind_helper(delegate_late_bind &object)
|
||||
{
|
||||
_FunctionClass *result = dynamic_cast<_FunctionClass *>(&object);
|
||||
return reinterpret_cast<delegate_generic_class *>(result);
|
||||
}
|
||||
|
||||
// internal state
|
||||
const char * m_name; // name string
|
||||
delegate_generic_class * m_object; // pointer to the post-cast object
|
||||
generic_static_func m_function; // generic static function pointer
|
||||
delegate_internal_mfp m_rawfunction; // raw member function definition
|
||||
late_bind_func m_latebinder; // late binding helper
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -239,16 +239,6 @@ void devcb_stub64(device_t *device, address_space &space, offs_t offset, UINT64
|
||||
#define DEVCB_CPU_INPUT_LINE(tag,line) { DEVCB_TYPE_INPUT_LINE, (line), (tag), NULL, NULL, NULL, NULL }
|
||||
|
||||
|
||||
// macros for defining read_line/write_line functions
|
||||
#define READ_LINE_DEVICE_HANDLER(name) int name(ATTR_UNUSED device_t *device)
|
||||
#define WRITE_LINE_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED int state)
|
||||
|
||||
#define DECLARE_READ_LINE_MEMBER(name) int name()
|
||||
#define READ_LINE_MEMBER(name) int name()
|
||||
#define DECLARE_WRITE_LINE_MEMBER(name) void name(ATTR_UNUSED int state)
|
||||
#define WRITE_LINE_MEMBER(name) void name(ATTR_UNUSED int state)
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
|
571
src/emu/devcb2.c
Normal file
571
src/emu/devcb2.c
Normal file
@ -0,0 +1,571 @@
|
||||
/***************************************************************************
|
||||
|
||||
devcb2.c
|
||||
|
||||
Device callback interface helpers.
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVCB BASE CLASS
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// devcb2_base - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
devcb2_base::devcb2_base(device_t &device, UINT64 defmask)
|
||||
: m_device(device),
|
||||
m_rshift(0),
|
||||
m_mask(defmask),
|
||||
m_xor(0)
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// reset - reset/initialize state
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_base::reset(callback_type type)
|
||||
{
|
||||
m_type = type;
|
||||
m_target_tag = NULL;
|
||||
m_target_int = 0;
|
||||
m_space_tag = NULL;
|
||||
m_space_num = AS_0;
|
||||
m_space = NULL;
|
||||
m_target.ptr = NULL;
|
||||
m_rshift = 0;
|
||||
m_mask = ~U64(0);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// resolve_ioport - resolve an I/O port or fatal
|
||||
// error if we can't find it
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_base::resolve_ioport()
|
||||
{
|
||||
// attempt to resolve, fatal error if fail
|
||||
m_target.ioport = (m_target_tag != NULL) ? m_device.owner()->ioport(m_target_tag) : NULL;
|
||||
if (m_target.ioport == NULL)
|
||||
throw emu_fatalerror("Unable to resolve I/O port callback reference to '%s' in device '%s'\n", m_target_tag, m_device.tag());
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// resolve_inputline - resolve a device and input
|
||||
// number or fatal error if we can't find it
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_base::resolve_inputline()
|
||||
{
|
||||
// attempt to resolve, fatal error if fail
|
||||
m_target.device = (m_target_tag != NULL) ? m_device.owner()->subdevice(m_target_tag) : NULL;
|
||||
if (m_target.device == NULL)
|
||||
throw emu_fatalerror("Unable to resolve device reference to '%s' in device '%s'\n", m_target_tag, m_device.tag());
|
||||
|
||||
// make sure we have an execute interface
|
||||
device_execute_interface *exec;
|
||||
if (!m_target.device->interface(exec))
|
||||
throw emu_fatalerror("No execute interface found for device reference to '%s' in device '%s'\n", m_target_tag, m_device.tag());
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// resolve_space - resolve an address space or
|
||||
// fatal error if we can't find it
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_base::resolve_space()
|
||||
{
|
||||
// attempt to resolve, fatal error if fail
|
||||
device_t *spacedev = (m_space_tag != NULL) ? m_device.owner()->subdevice(m_space_tag) : NULL;
|
||||
if (spacedev == NULL)
|
||||
throw emu_fatalerror("Unable to resolve device reference to '%s' in device '%s'\n", m_space_tag, m_device.tag());
|
||||
if (!spacedev->memory().has_space(m_space_num))
|
||||
throw emu_fatalerror("Unable to resolve device address space %d on '%s' in device '%s'\n", m_space_num, m_space_tag, m_device.tag());
|
||||
m_space = &spacedev->memory().space(m_space_num);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVCB READ CLASS
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// devcb2_read_base - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
devcb2_read_base::devcb2_read_base(device_t &device, UINT64 defmask)
|
||||
: devcb2_base(device, defmask)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// reset - reset/initialize state
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_read_base::reset(callback_type type)
|
||||
{
|
||||
// parent first
|
||||
devcb2_base::reset(type);
|
||||
|
||||
// local stuff
|
||||
m_readline = read_line_delegate();
|
||||
m_read8 = read8_delegate();
|
||||
m_read16 = read16_delegate();
|
||||
m_read32 = read32_delegate();
|
||||
m_read64 = read64_delegate();
|
||||
m_adapter = &devcb2_read_base::read_unresolved_adapter;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// resolve - resolve the specified callback to
|
||||
// its final form
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_read_base::resolve()
|
||||
{
|
||||
// first resolve any address spaces
|
||||
if (m_space_tag != NULL)
|
||||
resolve_space();
|
||||
else
|
||||
m_space = &downcast<driver_device &>(m_device.machine().root_device()).generic_space();
|
||||
|
||||
// then handle the various types
|
||||
try
|
||||
{
|
||||
switch (m_type)
|
||||
{
|
||||
case CALLBACK_NONE:
|
||||
break;
|
||||
|
||||
case CALLBACK_LINE:
|
||||
m_readline.bind_relative_to(*m_device.owner());
|
||||
m_target_int = 0;
|
||||
m_adapter = m_readline.isnull() ? &devcb2_read_base::read_constant_adapter : &devcb2_read_base::read_line_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_8:
|
||||
m_read8.bind_relative_to(*m_device.owner());
|
||||
m_target_int = 0;
|
||||
m_adapter = m_read8.isnull() ? &devcb2_read_base::read_constant_adapter : &devcb2_read_base::read8_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_16:
|
||||
m_read16.bind_relative_to(*m_device.owner());
|
||||
m_target_int = 0;
|
||||
m_adapter = m_read16.isnull() ? &devcb2_read_base::read_constant_adapter : &devcb2_read_base::read16_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_32:
|
||||
m_read32.bind_relative_to(*m_device.owner());
|
||||
m_target_int = 0;
|
||||
m_adapter = m_read32.isnull() ? &devcb2_read_base::read_constant_adapter : &devcb2_read_base::read32_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_64:
|
||||
m_read64.bind_relative_to(*m_device.owner());
|
||||
m_target_int = 0;
|
||||
m_adapter = m_read64.isnull() ? &devcb2_read_base::read_constant_adapter : &devcb2_read_base::read64_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_IOPORT:
|
||||
resolve_ioport();
|
||||
m_target_int = 0;
|
||||
m_adapter = (m_target.ioport == NULL) ? &devcb2_read_base::read_constant_adapter : &devcb2_read_base::read_ioport_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_LOG:
|
||||
m_adapter = &devcb2_read_base::read_logged_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_CONSTANT:
|
||||
m_adapter = &devcb2_read_base::read_constant_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_INPUTLINE:
|
||||
throw emu_fatalerror("Device read callbacks can't be connected to input lines\n");
|
||||
}
|
||||
}
|
||||
catch (binding_type_exception &binderr)
|
||||
{
|
||||
throw emu_fatalerror("Error performing a late bind of type %s to %s\n", binderr.m_actual_type.name(), binderr.m_target_type.name());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// resolve_safe - resolve the callback; if not
|
||||
// specified, resolve to a constant callback with
|
||||
// the given value
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_read_base::resolve_safe(UINT64 none_constant_value)
|
||||
{
|
||||
// convert to a constant if none specified
|
||||
if (m_type == CALLBACK_NONE)
|
||||
{
|
||||
m_target_int = none_constant_value;
|
||||
m_type = CALLBACK_CONSTANT;
|
||||
}
|
||||
resolve();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_unresolved_adapter - error-generating
|
||||
// unresolved adapter
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT64 devcb2_read_base::read_unresolved_adapter(address_space &space, offs_t offset, UINT64 mask)
|
||||
{
|
||||
throw emu_fatalerror("Attempted to read through an unresolved devcb item");
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_line_adapter - read from a line delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT64 devcb2_read_base::read_line_adapter(address_space &space, offs_t offset, UINT64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_readline() & 1);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// read8_adapter - read from an 8-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT64 devcb2_read_base::read8_adapter(address_space &space, offs_t offset, UINT64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_read8(space, offset, unshift_mask(mask)));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// read16_adapter - read from a 16-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT64 devcb2_read_base::read16_adapter(address_space &space, offs_t offset, UINT64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_read16(space, offset, unshift_mask(mask)));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// read32_adapter - read from a 32-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT64 devcb2_read_base::read32_adapter(address_space &space, offs_t offset, UINT64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_read32(space, offset, unshift_mask(mask)));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// read64_adapter - read from a 64-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT64 devcb2_read_base::read64_adapter(address_space &space, offs_t offset, UINT64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_read64(space, offset, unshift_mask(mask)));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_ioport - read from an I/O port
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT64 devcb2_read_base::read_ioport_adapter(address_space &space, offs_t offset, UINT64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_target.ioport->read());
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_logged_adapter - log a read and return a
|
||||
// constant
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT64 devcb2_read_base::read_logged_adapter(address_space &space, offs_t offset, UINT64 mask)
|
||||
{
|
||||
logerror("%s: read %s\n", m_device.machine().describe_context(), m_target_tag);
|
||||
return shift_mask_xor(m_target_int);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_constant - read from a constant
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT64 devcb2_read_base::read_constant_adapter(address_space &space, offs_t offset, UINT64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_target_int);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVCB WRITE CLASS
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// devcb2_write_base - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
devcb2_write_base::devcb2_write_base(device_t &device, UINT64 defmask)
|
||||
: devcb2_base(device, defmask)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// reset - reset/initialize state
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::reset(callback_type type)
|
||||
{
|
||||
// parent first
|
||||
devcb2_base::reset(type);
|
||||
|
||||
// local stuff
|
||||
m_writeline = write_line_delegate();
|
||||
m_write8 = write8_delegate();
|
||||
m_write16 = write16_delegate();
|
||||
m_write32 = write32_delegate();
|
||||
m_write64 = write64_delegate();
|
||||
m_adapter = &devcb2_write_base::write_unresolved_adapter;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// resolve - resolve the specified callback to
|
||||
// its final form
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::resolve()
|
||||
{
|
||||
// first resolve any address spaces
|
||||
if (m_space_tag != NULL)
|
||||
resolve_space();
|
||||
else
|
||||
m_space = &downcast<driver_device &>(m_device.machine().root_device()).generic_space();
|
||||
|
||||
// then handle the various types
|
||||
try
|
||||
{
|
||||
switch (m_type)
|
||||
{
|
||||
case CALLBACK_NONE:
|
||||
break;
|
||||
|
||||
case CALLBACK_LINE:
|
||||
m_writeline.bind_relative_to(*m_device.owner());
|
||||
m_adapter = m_writeline.isnull() ? &devcb2_write_base::write_noop_adapter : &devcb2_write_base::write_line_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_8:
|
||||
m_write8.bind_relative_to(*m_device.owner());
|
||||
m_adapter = m_write8.isnull() ? &devcb2_write_base::write_noop_adapter : &devcb2_write_base::write8_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_16:
|
||||
m_write16.bind_relative_to(*m_device.owner());
|
||||
m_adapter = m_write16.isnull() ? &devcb2_write_base::write_noop_adapter : &devcb2_write_base::write16_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_32:
|
||||
m_write32.bind_relative_to(*m_device.owner());
|
||||
m_adapter = m_write32.isnull() ? &devcb2_write_base::write_noop_adapter : &devcb2_write_base::write32_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_64:
|
||||
m_write64.bind_relative_to(*m_device.owner());
|
||||
m_adapter = m_write64.isnull() ? &devcb2_write_base::write_noop_adapter : &devcb2_write_base::write64_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_IOPORT:
|
||||
resolve_ioport();
|
||||
m_adapter = (m_target.ioport == NULL) ? &devcb2_write_base::write_noop_adapter : &devcb2_write_base::write_ioport_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_LOG:
|
||||
m_adapter = &devcb2_write_base::write_logged_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_CONSTANT:
|
||||
m_adapter = &devcb2_write_base::write_noop_adapter;
|
||||
break;
|
||||
|
||||
case CALLBACK_INPUTLINE:
|
||||
resolve_inputline();
|
||||
m_adapter = &devcb2_write_base::write_inputline_adapter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (binding_type_exception &binderr)
|
||||
{
|
||||
throw emu_fatalerror("Error performing a late bind of type %s to %s\n", binderr.m_actual_type.name(), binderr.m_target_type.name());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// resolve_safe - resolve the callback; if not
|
||||
// specified, resolve to a no-op
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::resolve_safe()
|
||||
{
|
||||
// convert to a constant if none specified
|
||||
if (m_type == CALLBACK_NONE)
|
||||
m_type = CALLBACK_CONSTANT;
|
||||
resolve();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write_unresolved_adapter - error-generating
|
||||
// unresolved adapter
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::write_unresolved_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask)
|
||||
{
|
||||
throw emu_fatalerror("Attempted to write through an unresolved devcb item");
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write_line_adapter - write from a line delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::write_line_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask)
|
||||
{
|
||||
m_writeline(unshift_mask_xor(data) & 1);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write8_adapter - write from an 8-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::write8_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask)
|
||||
{
|
||||
m_write8(space, offset, unshift_mask_xor(data), unshift_mask(mask));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write16_adapter - write from a 16-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::write16_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask)
|
||||
{
|
||||
m_write16(space, offset, unshift_mask_xor(data), unshift_mask(mask));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write32_adapter - write from a 32-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::write32_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask)
|
||||
{
|
||||
m_write32(space, offset, unshift_mask_xor(data), unshift_mask(mask));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write64_adapter - write from a 64-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::write64_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask)
|
||||
{
|
||||
m_write64(space, offset, unshift_mask_xor(data), unshift_mask(mask));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write_ioport - write from an I/O port
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::write_ioport_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask)
|
||||
{
|
||||
m_target.ioport->write_safe(unshift_mask_xor(data));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write_logged_adapter - logging unresolved
|
||||
// adapter
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::write_logged_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask)
|
||||
{
|
||||
logerror("%s: unresolved devcb write\n", m_device.machine().describe_context());
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write_constant - write from a constant
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::write_noop_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask)
|
||||
{
|
||||
// constant for writes is a no-op
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write_inputline_adapter - write to an device's
|
||||
// input line
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb2_write_base::write_inputline_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask)
|
||||
{
|
||||
m_target.device->execute().set_input_line(m_target_int, unshift_mask_xor(data) & 1);
|
||||
}
|
433
src/emu/devcb2.h
Normal file
433
src/emu/devcb2.h
Normal file
@ -0,0 +1,433 @@
|
||||
/***************************************************************************
|
||||
|
||||
devcb2.h
|
||||
|
||||
Device callback interface helpers.
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __EMU_H__
|
||||
#error Dont include this file directly; include emu.h instead.
|
||||
#endif
|
||||
|
||||
#ifndef __DEVCB2_H__
|
||||
#define __DEVCB2_H__
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MACROS
|
||||
//**************************************************************************
|
||||
|
||||
// wrappers for ioports, constants, and loggers
|
||||
#define DEVCB2_NULL devcb2_base::null_desc()
|
||||
#define DEVCB2_NOOP devcb2_base::null_desc()
|
||||
#define DEVCB2_IOPORT(_tag) devcb2_base::ioport_desc(_tag)
|
||||
#define DEVCB2_CONSTANT(_value) devcb2_base::constant_desc(_value)
|
||||
#define DEVCB2_LOGGER(_string, _value) devcb2_base::logger_desc(_string, _value)
|
||||
#define DEVCB2_INPUTLINE(_tag, _line) devcb2_base::inputline_desc(_tag, _line)
|
||||
|
||||
// wrappers for read callbacks into the owner device
|
||||
#define DEVCB2_READLINE(_class, _func) read_line_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0)
|
||||
#define DEVCB2_READ8(_class, _func) read8_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0)
|
||||
#define DEVCB2_READ16(_class, _func) read16_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0)
|
||||
#define DEVCB2_READ32(_class, _func) read32_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0)
|
||||
#define DEVCB2_READ64(_class, _func) read64_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0)
|
||||
|
||||
// wrappers for read callbacks into any tagged device
|
||||
#define DEVCB2_DEVREADLINE(tag, _class, _func) read_line_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0)
|
||||
#define DEVCB2_DEVREAD8(tag, _class, _func) read8_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0)
|
||||
#define DEVCB2_DEVREAD16(tag, _class, _func) read16_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0)
|
||||
#define DEVCB2_DEVREAD32(tag, _class, _func) read32_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0)
|
||||
#define DEVCB2_DEVREAD64(tag, _class, _func) read64_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0)
|
||||
|
||||
// wrappers for write callbacks into the owner device
|
||||
#define DEVCB2_WRITELINE(_class, _func) write_line_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0)
|
||||
#define DEVCB2_WRITE8(_class, _func) write8_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0)
|
||||
#define DEVCB2_WRITE16(_class, _func) write16_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0)
|
||||
#define DEVCB2_WRITE32(_class, _func) write32_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0)
|
||||
#define DEVCB2_WRITE64(_class, _func) write64_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0)
|
||||
|
||||
// wrappers for write callbacks into any tagged device
|
||||
#define DEVCB2_DEVWRITELINE(tag, _class, _func) write_line_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0)
|
||||
#define DEVCB2_DEVWRITE8(tag, _class, _func) write8_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0)
|
||||
#define DEVCB2_DEVWRITE16(tag, _class, _func) write16_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0)
|
||||
#define DEVCB2_DEVWRITE32(tag, _class, _func) write32_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0)
|
||||
#define DEVCB2_DEVWRITE64(tag, _class, _func) write64_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0)
|
||||
|
||||
// machine config helpers to add shift, mask, or address space configuration
|
||||
#define MCFG_DEVCB_SHIFT(_shift) devcb->set_shift(_shift);
|
||||
#define MCFG_DEVCB_MASK(_mask) devcb->set_mask(_mask);
|
||||
#define MCFG_DEVCB_XOR(_xor) devcb->set_xor(_xor);
|
||||
#define MCFG_DEVCB_INVERT devcb->set_xor(~U64(0));
|
||||
#define MCFG_DEVCB_ADDRESS_SPACE(_device, _spacenum) devcb->set_space(_device, _spacenum);
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// base delegate type for a read_line/write_line
|
||||
typedef device_delegate<int ()> read_line_delegate;
|
||||
typedef device_delegate<void (int)> write_line_delegate;
|
||||
|
||||
|
||||
// ======================> devcb2_base
|
||||
|
||||
class devcb2_base
|
||||
{
|
||||
protected:
|
||||
// enumerate the types of callbacks
|
||||
enum callback_type
|
||||
{
|
||||
CALLBACK_NONE,
|
||||
CALLBACK_LINE,
|
||||
CALLBACK_8,
|
||||
CALLBACK_16,
|
||||
CALLBACK_32,
|
||||
CALLBACK_64,
|
||||
CALLBACK_IOPORT,
|
||||
CALLBACK_LOG,
|
||||
CALLBACK_CONSTANT,
|
||||
CALLBACK_INPUTLINE
|
||||
};
|
||||
|
||||
// construction/destruction
|
||||
devcb2_base(device_t &device, UINT64 defmask);
|
||||
|
||||
public:
|
||||
// getters
|
||||
bool isnull() const { return (m_type == CALLBACK_NONE); }
|
||||
|
||||
// additional configuration
|
||||
devcb2_base &set_space(const char *device, address_spacenum space = AS_0) { m_space_tag = device; m_space_num = space; return *this; }
|
||||
devcb2_base &set_rshift(int rshift) { m_rshift = rshift; return *this; }
|
||||
devcb2_base &set_mask(UINT64 mask) { m_mask = mask; return *this; }
|
||||
devcb2_base &set_xor(UINT64 xorval) { m_xor = xorval; return *this; }
|
||||
|
||||
// construction helper classes
|
||||
class null_desc
|
||||
{
|
||||
public:
|
||||
null_desc() { }
|
||||
};
|
||||
|
||||
class ioport_desc
|
||||
{
|
||||
public:
|
||||
ioport_desc(const char *tag) { m_tag = tag; }
|
||||
const char *m_tag;
|
||||
};
|
||||
|
||||
class constant_desc
|
||||
{
|
||||
public:
|
||||
constant_desc(UINT64 value) { m_value = value; }
|
||||
UINT64 m_value;
|
||||
};
|
||||
|
||||
class logger_desc
|
||||
{
|
||||
public:
|
||||
logger_desc(const char *string, UINT64 value = 0) { m_string = string; m_value = value; }
|
||||
const char *m_string;
|
||||
UINT64 m_value;
|
||||
};
|
||||
|
||||
class inputline_desc
|
||||
{
|
||||
public:
|
||||
inputline_desc(const char *tag, int inputnum) { m_tag = tag; m_inputnum = inputnum; }
|
||||
const char *m_tag;
|
||||
int m_inputnum;
|
||||
};
|
||||
|
||||
// shared callback setters
|
||||
devcb2_base &set_callback(null_desc null) { reset(CALLBACK_NONE); return *this; }
|
||||
devcb2_base &set_callback(ioport_desc ioport) { reset(CALLBACK_IOPORT); m_target_tag = ioport.m_tag; return *this; }
|
||||
devcb2_base &set_callback(constant_desc constant) { reset(CALLBACK_CONSTANT); m_target_int = constant.m_value; return *this; }
|
||||
devcb2_base &set_callback(logger_desc logger) { reset(CALLBACK_LOG); m_target_int = logger.m_value; m_target_tag = logger.m_string; return *this; }
|
||||
devcb2_base &set_callback(inputline_desc inputline) { reset(CALLBACK_INPUTLINE); m_target_tag = inputline.m_tag; m_target_int = inputline.m_inputnum; return *this; }
|
||||
|
||||
protected:
|
||||
// internal helpers
|
||||
inline UINT64 shift_mask_xor(UINT64 value) const { return (((m_rshift < 0) ? (value << -m_rshift) : (value >> m_rshift)) ^ m_xor) & m_mask; }
|
||||
inline UINT64 unshift_mask(UINT64 value) const { return (m_rshift < 0) ? ((value & m_mask) >> -m_rshift) : ((value & m_mask) << m_rshift); }
|
||||
inline UINT64 unshift_mask_xor(UINT64 value) const { return (m_rshift < 0) ? (((value ^ m_xor) & m_mask) >> -m_rshift) : (((value ^ m_xor) & m_mask) << m_rshift); }
|
||||
void reset(callback_type type = CALLBACK_NONE);
|
||||
void resolve_ioport();
|
||||
void resolve_inputline();
|
||||
void resolve_space();
|
||||
|
||||
// the callback target is going to be one of these
|
||||
union callback_target
|
||||
{
|
||||
void * ptr;
|
||||
device_t * device;
|
||||
ioport_port * ioport;
|
||||
};
|
||||
|
||||
// configuration
|
||||
device_t & m_device; // reference to our owning device
|
||||
callback_type m_type; // type of callback registered
|
||||
const char * m_target_tag; // tag of target object
|
||||
UINT64 m_target_int; // integer value of target object
|
||||
const char * m_space_tag; // tag of address space device
|
||||
address_spacenum m_space_num; // address space number of space device
|
||||
|
||||
// derived state
|
||||
address_space * m_space; // target address space
|
||||
callback_target m_target; // resolved pointer to target object
|
||||
int m_rshift; // right shift to apply to data read
|
||||
UINT64 m_mask; // mask to apply to data read
|
||||
UINT64 m_xor; // XOR to apply to data read
|
||||
};
|
||||
|
||||
|
||||
// ======================> devcb2_read_base
|
||||
|
||||
class devcb2_read_base : public devcb2_base
|
||||
{
|
||||
protected:
|
||||
// construction/destruction
|
||||
devcb2_read_base(device_t &device, UINT64 defmask);
|
||||
|
||||
public:
|
||||
// callback configuration
|
||||
using devcb2_base::set_callback;
|
||||
devcb2_base &set_callback(read_line_delegate func) { reset(CALLBACK_LINE); m_readline = func; return *this; }
|
||||
devcb2_base &set_callback(read8_delegate func) { reset(CALLBACK_8); m_read8 = func; return *this; }
|
||||
devcb2_base &set_callback(read16_delegate func) { reset(CALLBACK_16); m_read16 = func; return *this; }
|
||||
devcb2_base &set_callback(read32_delegate func) { reset(CALLBACK_32); m_read32 = func; return *this; }
|
||||
devcb2_base &set_callback(read64_delegate func) { reset(CALLBACK_64); m_read64 = func; return *this; }
|
||||
|
||||
// resolution
|
||||
void resolve();
|
||||
void resolve_safe(UINT64 none_constant_value);
|
||||
|
||||
protected:
|
||||
// internal helpers
|
||||
void reset(callback_type type = CALLBACK_NONE);
|
||||
|
||||
// adapters
|
||||
UINT64 read_unresolved_adapter(address_space &space, offs_t offset, UINT64 mask);
|
||||
UINT64 read_line_adapter(address_space &space, offs_t offset, UINT64 mask);
|
||||
UINT64 read8_adapter(address_space &space, offs_t offset, UINT64 mask);
|
||||
UINT64 read16_adapter(address_space &space, offs_t offset, UINT64 mask);
|
||||
UINT64 read32_adapter(address_space &space, offs_t offset, UINT64 mask);
|
||||
UINT64 read64_adapter(address_space &space, offs_t offset, UINT64 mask);
|
||||
UINT64 read_ioport_adapter(address_space &space, offs_t offset, UINT64 mask);
|
||||
UINT64 read_logged_adapter(address_space &space, offs_t offset, UINT64 mask);
|
||||
UINT64 read_constant_adapter(address_space &space, offs_t offset, UINT64 mask);
|
||||
|
||||
// configuration
|
||||
read_line_delegate m_readline; // copy of registered line reader
|
||||
read8_delegate m_read8; // copy of registered 8-bit reader
|
||||
read16_delegate m_read16; // copy of registered 16-bit reader
|
||||
read32_delegate m_read32; // copy of registered 32-bit reader
|
||||
read64_delegate m_read64; // copy of registered 64-bit reader
|
||||
|
||||
// derived state
|
||||
typedef UINT64 (devcb2_read_base::*adapter_func)(address_space &, offs_t, UINT64);
|
||||
adapter_func m_adapter; // actual callback to invoke
|
||||
};
|
||||
|
||||
|
||||
// ======================> devcb2_write_base
|
||||
|
||||
class devcb2_write_base : public devcb2_base
|
||||
{
|
||||
protected:
|
||||
// construction/destruction
|
||||
devcb2_write_base(device_t &device, UINT64 defmask);
|
||||
|
||||
public:
|
||||
// callback configuration
|
||||
using devcb2_base::set_callback;
|
||||
devcb2_base &set_callback(write_line_delegate func) { reset(CALLBACK_LINE); m_writeline = func; return *this; }
|
||||
devcb2_base &set_callback(write8_delegate func) { reset(CALLBACK_8); m_write8 = func; return *this; }
|
||||
devcb2_base &set_callback(write16_delegate func) { reset(CALLBACK_16); m_write16 = func; return *this; }
|
||||
devcb2_base &set_callback(write32_delegate func) { reset(CALLBACK_32); m_write32 = func; return *this; }
|
||||
devcb2_base &set_callback(write64_delegate func) { reset(CALLBACK_64); m_write64 = func; return *this; }
|
||||
|
||||
// resolution
|
||||
void resolve();
|
||||
void resolve_safe();
|
||||
|
||||
protected:
|
||||
// internal helpers
|
||||
void reset(callback_type type = CALLBACK_NONE);
|
||||
|
||||
// adapters
|
||||
void write_unresolved_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask);
|
||||
void write_line_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask);
|
||||
void write8_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask);
|
||||
void write16_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask);
|
||||
void write32_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask);
|
||||
void write64_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask);
|
||||
void write_ioport_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask);
|
||||
void write_logged_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask);
|
||||
void write_noop_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask);
|
||||
void write_inputline_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask);
|
||||
|
||||
// configuration
|
||||
write_line_delegate m_writeline; // copy of registered line writer
|
||||
write8_delegate m_write8; // copy of registered 8-bit writer
|
||||
write16_delegate m_write16; // copy of registered 16-bit writer
|
||||
write32_delegate m_write32; // copy of registered 32-bit writer
|
||||
write64_delegate m_write64; // copy of registered 64-bit writer
|
||||
|
||||
// derived state
|
||||
typedef void (devcb2_write_base::*adapter_func)(address_space &, offs_t, UINT64, UINT64);
|
||||
adapter_func m_adapter; // actual callback to invoke
|
||||
};
|
||||
|
||||
|
||||
// ======================> devcb2_read_line
|
||||
|
||||
class devcb2_read_line : public devcb2_read_base
|
||||
{
|
||||
public:
|
||||
devcb2_read_line(device_t &device) : devcb2_read_base(device, 0xff) { }
|
||||
int operator()() { return (this->*m_adapter)(*m_space, 0, U64(0xff)) & 1; }
|
||||
int operator()(address_space &space) { return (this->*m_adapter)((m_space_tag != NULL) ? *m_space : space, 0, U64(0xff)) & 1; }
|
||||
};
|
||||
|
||||
|
||||
// ======================> devcb2_read8
|
||||
|
||||
class devcb2_read8 : public devcb2_read_base
|
||||
{
|
||||
public:
|
||||
devcb2_read8(device_t &device) : devcb2_read_base(device, 0xff) { }
|
||||
UINT8 operator()(offs_t offset = 0, UINT8 mask = 0xff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; }
|
||||
UINT8 operator()(address_space &space, offs_t offset = 0, UINT8 mask = 0xff) { return (this->*m_adapter)((m_space_tag != NULL) ? *m_space : space, offset, mask) & mask; }
|
||||
};
|
||||
|
||||
|
||||
// ======================> devcb2_read16
|
||||
|
||||
class devcb2_read16 : public devcb2_read_base
|
||||
{
|
||||
public:
|
||||
devcb2_read16(device_t &device) : devcb2_read_base(device, 0xffff) { }
|
||||
UINT16 operator()(offs_t offset = 0, UINT16 mask = 0xffff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; }
|
||||
UINT16 operator()(address_space &space, offs_t offset = 0, UINT16 mask = 0xffff) { return (this->*m_adapter)((m_space_tag != NULL) ? *m_space : space, offset, mask) & mask; }
|
||||
};
|
||||
|
||||
|
||||
// ======================> devcb2_read32
|
||||
|
||||
class devcb2_read32 : public devcb2_read_base
|
||||
{
|
||||
public:
|
||||
devcb2_read32(device_t &device) : devcb2_read_base(device, 0xffffffff) { }
|
||||
UINT32 operator()(offs_t offset = 0, UINT32 mask = 0xffffffff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; }
|
||||
UINT32 operator()(address_space &space, offs_t offset = 0, UINT32 mask = 0xffffffff) { return (this->*m_adapter)((m_space_tag != NULL) ? *m_space : space, offset, mask) & mask; }
|
||||
};
|
||||
|
||||
|
||||
// ======================> devcb2_read64
|
||||
|
||||
class devcb2_read64 : public devcb2_read_base
|
||||
{
|
||||
public:
|
||||
devcb2_read64(device_t &device) : devcb2_read_base(device, U64(0xffffffffffffffff)) { }
|
||||
UINT64 operator()(offs_t offset = 0, UINT64 mask = U64(0xffffffffffffffff)) { return (this->*m_adapter)(*m_space, offset, mask) & mask; }
|
||||
UINT64 operator()(address_space &space, offs_t offset = 0, UINT64 mask = U64(0xffffffffffffffff)) { return (this->*m_adapter)((m_space_tag != NULL) ? *m_space : space, offset, mask) & mask; }
|
||||
};
|
||||
|
||||
|
||||
// ======================> devcb2_write_line
|
||||
|
||||
class devcb2_write_line : public devcb2_write_base
|
||||
{
|
||||
public:
|
||||
devcb2_write_line(device_t &device) : devcb2_write_base(device, 0xff) { }
|
||||
void operator()(int state) { (this->*m_adapter)(*m_space, 0, state & 1, U64(0xff)); }
|
||||
void operator()(address_space &space, int state) { (this->*m_adapter)((m_space_tag != NULL) ? *m_space : space, 0, state & 1, U64(0xff)); }
|
||||
};
|
||||
|
||||
|
||||
// ======================> devcb2_write8
|
||||
|
||||
class devcb2_write8 : public devcb2_write_base
|
||||
{
|
||||
public:
|
||||
devcb2_write8(device_t &device) : devcb2_write_base(device, 0xff) { }
|
||||
void operator()(UINT8 data, UINT8 mask = 0xff) { (this->*m_adapter)(*m_space, 0, data, mask); }
|
||||
void operator()(offs_t offset, UINT8 data, UINT8 mask = 0xff) { (this->*m_adapter)(*m_space, offset, data, mask); }
|
||||
void operator()(address_space &space, offs_t offset, UINT8 data, UINT8 mask = 0xff) { (this->*m_adapter)((m_space_tag != NULL) ? *m_space : space, offset, data, mask); }
|
||||
};
|
||||
|
||||
|
||||
// ======================> devcb2_write16
|
||||
|
||||
class devcb2_write16 : public devcb2_write_base
|
||||
{
|
||||
public:
|
||||
devcb2_write16(device_t &device) : devcb2_write_base(device, 0xffff) { }
|
||||
void operator()(UINT16 data, UINT16 mask = 0xffff) { (this->*m_adapter)(*m_space, 0, data, mask); }
|
||||
void operator()(offs_t offset, UINT16 data, UINT16 mask = 0xffff) { (this->*m_adapter)(*m_space, offset, data, mask); }
|
||||
void operator()(address_space &space, offs_t offset, UINT16 data, UINT16 mask = 0xffff) { (this->*m_adapter)((m_space_tag != NULL) ? *m_space : space, offset, data, mask); }
|
||||
};
|
||||
|
||||
|
||||
// ======================> devcb2_write32
|
||||
|
||||
class devcb2_write32 : public devcb2_write_base
|
||||
{
|
||||
public:
|
||||
devcb2_write32(device_t &device) : devcb2_write_base(device, 0xffffffff) { }
|
||||
void operator()(UINT32 data, UINT32 mask = 0xffffffff) { (this->*m_adapter)(*m_space, 0, data, mask); }
|
||||
void operator()(offs_t offset, UINT32 data, UINT32 mask = 0xffffffff) { (this->*m_adapter)(*m_space, offset, data, mask); }
|
||||
void operator()(address_space &space, offs_t offset, UINT32 data, UINT32 mask = 0xffffffff) { (this->*m_adapter)((m_space_tag != NULL) ? *m_space : space, offset, data, mask); }
|
||||
};
|
||||
|
||||
|
||||
// ======================> devcb2_write64
|
||||
|
||||
class devcb2_write64 : public devcb2_write_base
|
||||
{
|
||||
public:
|
||||
devcb2_write64(device_t &device) : devcb2_write_base(device, U64(0xffffffffffffffff)) { }
|
||||
void operator()(UINT64 data, UINT64 mask = U64(0xffffffffffffffff)) { (this->*m_adapter)(*m_space, 0, data, mask); }
|
||||
void operator()(offs_t offset, UINT64 data, UINT64 mask = U64(0xffffffffffffffff)) { (this->*m_adapter)(*m_space, offset, data, mask); }
|
||||
void operator()(address_space &space, offs_t offset, UINT64 data, UINT64 mask = U64(0xffffffffffffffff)) { (this->*m_adapter)((m_space_tag != NULL) ? *m_space : space, offset, data, mask); }
|
||||
};
|
||||
|
||||
|
||||
#endif /* __DEVCB2_H__ */
|
@ -75,6 +75,16 @@
|
||||
device_t::static_set_input_default(*device, DEVICE_INPUT_DEFAULTS_NAME(_config)); \
|
||||
|
||||
|
||||
// macros for defining read_line/write_line functions
|
||||
#define READ_LINE_DEVICE_HANDLER(name) int name(ATTR_UNUSED device_t *device)
|
||||
#define WRITE_LINE_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED int state)
|
||||
|
||||
#define DECLARE_READ_LINE_MEMBER(name) int name()
|
||||
#define READ_LINE_MEMBER(name) int name()
|
||||
#define DECLARE_WRITE_LINE_MEMBER(name) void name(ATTR_UNUSED int state)
|
||||
#define WRITE_LINE_MEMBER(name) void name(ATTR_UNUSED int state)
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
|
@ -202,6 +202,28 @@ public:
|
||||
(machine.driver_data<_DriverClass>()->*_Function)();
|
||||
}
|
||||
|
||||
// member-to-legacy-static wrappers
|
||||
template<read_line_device_func _Func>
|
||||
DECLARE_READ_LINE_MEMBER( member_wrapper_line ) { return (*_Func)(this); }
|
||||
template<write_line_device_func _Func>
|
||||
DECLARE_WRITE_LINE_MEMBER( member_wrapper_line ) { (*_Func)(this, state); }
|
||||
template<read8_device_func _Func>
|
||||
DECLARE_READ8_MEMBER( member_wrapper8 ) { return (*_Func)(this, space, offset, mem_mask); }
|
||||
template<write8_device_func _Func>
|
||||
DECLARE_WRITE8_MEMBER( member_wrapper8 ) { (*_Func)(this, space, offset, data, mem_mask); }
|
||||
template<read16_device_func _Func>
|
||||
DECLARE_READ16_MEMBER( member_wrapper16 ) { return (*_Func)(this, space, offset, mem_mask); }
|
||||
template<write16_device_func _Func>
|
||||
DECLARE_WRITE16_MEMBER( member_wrapper16 ) { (*_Func)(this, space, offset, data, mem_mask); }
|
||||
template<read32_device_func _Func>
|
||||
DECLARE_READ32_MEMBER( member_wrapper32 ) { return (*_Func)(this, space, offset, mem_mask); }
|
||||
template<write32_device_func _Func>
|
||||
DECLARE_WRITE32_MEMBER( member_wrapper32 ) { (*_Func)(this, space, offset, data, mem_mask); }
|
||||
template<read64_device_func _Func>
|
||||
DECLARE_READ64_MEMBER( member_wrapper64 ) { return (*_Func)(this, space, offset, mem_mask); }
|
||||
template<write64_device_func _Func>
|
||||
DECLARE_WRITE64_MEMBER( member_wrapper64 ) { (*_Func)(this, space, offset, data, mem_mask); }
|
||||
|
||||
// dummy driver_init callbacks
|
||||
void init_0() { }
|
||||
|
||||
|
@ -139,6 +139,7 @@ typedef device_t * (*machine_config_constructor)(machine_config &config, device_
|
||||
|
||||
// generic helpers
|
||||
#include "devcb.h"
|
||||
#include "devcb2.h"
|
||||
#include "drivers/xtal.h"
|
||||
#include "machine/generic.h"
|
||||
#include "video/generic.h"
|
||||
|
@ -56,6 +56,7 @@ EMUOBJS = \
|
||||
$(EMUOBJ)/delegate.o \
|
||||
$(EMUOBJ)/devdelegate.o \
|
||||
$(EMUOBJ)/devcb.o \
|
||||
$(EMUOBJ)/devcb2.o \
|
||||
$(EMUOBJ)/devcpu.o \
|
||||
$(EMUOBJ)/device.o \
|
||||
$(EMUOBJ)/didisasm.o \
|
||||
|
@ -177,6 +177,8 @@ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t
|
||||
{ \
|
||||
device_t *device = NULL; \
|
||||
(void)device; \
|
||||
devcb2_base *devcb = NULL; \
|
||||
(void)devcb; \
|
||||
if (owner == NULL) owner = config.device_add(NULL, "root", &driver_device_creator<_class>, 0); \
|
||||
|
||||
#define MACHINE_CONFIG_FRAGMENT(_name) \
|
||||
@ -184,6 +186,8 @@ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t
|
||||
{ \
|
||||
device_t *device = NULL; \
|
||||
(void)device; \
|
||||
devcb2_base *devcb = NULL; \
|
||||
(void)devcb; \
|
||||
assert(owner != NULL); \
|
||||
|
||||
#define MACHINE_CONFIG_DERIVED(_name, _base) \
|
||||
@ -191,6 +195,8 @@ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t
|
||||
{ \
|
||||
device_t *device = NULL; \
|
||||
(void)device; \
|
||||
devcb2_base *devcb = NULL; \
|
||||
(void)devcb; \
|
||||
owner = MACHINE_CONFIG_NAME(_base)(config, owner); \
|
||||
assert(owner != NULL); \
|
||||
|
||||
@ -199,6 +205,8 @@ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t
|
||||
{ \
|
||||
device_t *device = NULL; \
|
||||
(void)device; \
|
||||
devcb2_base *devcb = NULL; \
|
||||
(void)devcb; \
|
||||
if (owner == NULL) owner = config.device_add(NULL, "root", &driver_device_creator<_class>, 0); \
|
||||
owner = MACHINE_CONFIG_NAME(_base)(config, owner); \
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
/***************************************************************************
|
||||
|
||||
2151intf.c
|
||||
2151intf.c
|
||||
|
||||
Support interface YM2151(OPM)
|
||||
Support interface YM2151(OPM)
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
@ -12,166 +12,118 @@
|
||||
#include "ym2151.h"
|
||||
|
||||
|
||||
struct ym2151_state
|
||||
{
|
||||
sound_stream * stream;
|
||||
emu_timer * timer[2];
|
||||
void * chip;
|
||||
UINT8 lastreg;
|
||||
devcb_resolved_write_line irqhandler;
|
||||
devcb_resolved_write8 portwritehandler;
|
||||
};
|
||||
|
||||
const device_type YM2151 = &device_creator<ym2151_device>;
|
||||
|
||||
|
||||
INLINE ym2151_state *get_safe_token(device_t *device)
|
||||
//-------------------------------------------------
|
||||
// ym2151_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
ym2151_device::ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, YM2151, "YM2151", tag, owner, clock),
|
||||
device_sound_interface(mconfig, *this),
|
||||
m_irqhandler(*this),
|
||||
m_portwritehandler(*this)
|
||||
{
|
||||
assert(device != NULL);
|
||||
assert(device->type() == YM2151);
|
||||
return (ym2151_state *)downcast<ym2151_device *>(device)->token();
|
||||
}
|
||||
|
||||
|
||||
static STREAM_UPDATE( ym2151_update )
|
||||
//-------------------------------------------------
|
||||
// read - read from the device
|
||||
//-------------------------------------------------
|
||||
|
||||
READ8_MEMBER( ym2151_device::read )
|
||||
{
|
||||
ym2151_state *info = (ym2151_state *)param;
|
||||
ym2151_update_one(info->chip, outputs, samples);
|
||||
}
|
||||
|
||||
static void ym2151_irq_frontend(device_t *device, int irq)
|
||||
{
|
||||
ym2151_state *info = get_safe_token(device);
|
||||
info->irqhandler(irq);
|
||||
}
|
||||
|
||||
static void ym2151_port_write_frontend(device_t *device, offs_t offset, UINT8 data)
|
||||
{
|
||||
ym2151_state *info = get_safe_token(device);
|
||||
info->portwritehandler(offset, data);
|
||||
}
|
||||
|
||||
static DEVICE_START( ym2151 )
|
||||
{
|
||||
static const ym2151_interface dummy = { DEVCB_NULL };
|
||||
ym2151_state *info = get_safe_token(device);
|
||||
int rate;
|
||||
|
||||
const ym2151_interface *intf = device->static_config() ? (const ym2151_interface *)device->static_config() : &dummy;
|
||||
info->irqhandler.resolve(intf->irqhandler, *device);
|
||||
info->portwritehandler.resolve(intf->portwritehandler, *device);
|
||||
|
||||
rate = device->clock()/64;
|
||||
|
||||
/* stream setup */
|
||||
info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,ym2151_update);
|
||||
|
||||
info->chip = ym2151_init(device,device->clock(),rate);
|
||||
assert_always(info->chip != NULL, "Error creating YM2151 chip");
|
||||
|
||||
ym2151_set_irq_handler(info->chip,ym2151_irq_frontend);
|
||||
ym2151_set_port_write_handler(info->chip,ym2151_port_write_frontend);
|
||||
}
|
||||
|
||||
|
||||
static DEVICE_STOP( ym2151 )
|
||||
{
|
||||
ym2151_state *info = get_safe_token(device);
|
||||
ym2151_shutdown(info->chip);
|
||||
}
|
||||
|
||||
static DEVICE_RESET( ym2151 )
|
||||
{
|
||||
ym2151_state *info = get_safe_token(device);
|
||||
ym2151_reset_chip(info->chip);
|
||||
}
|
||||
|
||||
|
||||
READ8_DEVICE_HANDLER( ym2151_r )
|
||||
{
|
||||
ym2151_state *token = get_safe_token(device);
|
||||
|
||||
if (offset & 1)
|
||||
{
|
||||
token->stream->update();
|
||||
return ym2151_read_status(token->chip);
|
||||
m_stream->update();
|
||||
return ym2151_read_status(m_chip);
|
||||
}
|
||||
else
|
||||
return 0xff; /* confirmed on a real YM2151 */
|
||||
}
|
||||
|
||||
WRITE8_DEVICE_HANDLER( ym2151_w )
|
||||
{
|
||||
ym2151_state *token = get_safe_token(device);
|
||||
|
||||
//-------------------------------------------------
|
||||
// write - write from the device
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER( ym2151_device::write )
|
||||
{
|
||||
if (offset & 1)
|
||||
{
|
||||
token->stream->update();
|
||||
ym2151_write_reg(token->chip, token->lastreg, data);
|
||||
m_stream->update();
|
||||
ym2151_write_reg(m_chip, m_lastreg, data);
|
||||
}
|
||||
else
|
||||
token->lastreg = data;
|
||||
m_lastreg = data;
|
||||
}
|
||||
|
||||
|
||||
READ8_DEVICE_HANDLER( ym2151_status_port_r ) { return ym2151_r(device, space, 1); }
|
||||
READ8_MEMBER( ym2151_device::status_r ) { return read(space, 1); }
|
||||
|
||||
WRITE8_DEVICE_HANDLER( ym2151_register_port_w ) { ym2151_w(device, space, 0, data); }
|
||||
WRITE8_DEVICE_HANDLER( ym2151_data_port_w ) { ym2151_w(device, space, 1, data); }
|
||||
WRITE8_MEMBER( ym2151_device::register_w ) { write(space, 0, data); }
|
||||
WRITE8_MEMBER( ym2151_device::data_w ) { write(space, 1, data); }
|
||||
|
||||
|
||||
const device_type YM2151 = &device_creator<ym2151_device>;
|
||||
|
||||
ym2151_device::ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, YM2151, "YM2151", tag, owner, clock),
|
||||
device_sound_interface(mconfig, *this)
|
||||
{
|
||||
m_token = global_alloc_clear(ym2151_state);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_config_complete - perform any
|
||||
// operations now that the configuration is
|
||||
// complete
|
||||
//-------------------------------------------------
|
||||
|
||||
void ym2151_device::device_config_complete()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void ym2151_device::device_start()
|
||||
{
|
||||
DEVICE_START_NAME( ym2151 )(this);
|
||||
m_irqhandler.resolve_safe();
|
||||
m_portwritehandler.resolve_safe();
|
||||
|
||||
// stream setup
|
||||
int rate = clock() / 64;
|
||||
m_stream = stream_alloc(0, 2, rate);
|
||||
|
||||
m_chip = ym2151_init(this, clock(), rate);
|
||||
assert_always(m_chip != NULL, "Error creating YM2151 chip");
|
||||
|
||||
ym2151_set_irq_handler(m_chip, irq_frontend);
|
||||
ym2151_set_port_write_handler(m_chip, port_write_frontend);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void ym2151_device::device_reset()
|
||||
{
|
||||
DEVICE_RESET_NAME( ym2151 )(this);
|
||||
ym2151_reset_chip(m_chip);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_stop - device-specific stop
|
||||
//-------------------------------------------------
|
||||
|
||||
void ym2151_device::device_stop()
|
||||
{
|
||||
DEVICE_STOP_NAME( ym2151 )(this);
|
||||
ym2151_shutdown(m_chip);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void ym2151_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||
{
|
||||
// should never get here
|
||||
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
|
||||
ym2151_update_one(m_chip, outputs, samples);
|
||||
}
|
||||
|
||||
|
||||
void ym2151_device::irq_frontend(device_t *device, int irq)
|
||||
{
|
||||
downcast<ym2151_device *>(device)->m_irqhandler(irq);
|
||||
}
|
||||
|
||||
void ym2151_device::port_write_frontend(device_t *device, offs_t offset, UINT8 data)
|
||||
{
|
||||
downcast<ym2151_device *>(device)->m_portwritehandler(offset, data);
|
||||
}
|
||||
|
@ -1,46 +1,83 @@
|
||||
/***************************************************************************
|
||||
|
||||
2151intf.h
|
||||
|
||||
MAME interface to YM2151 emulator.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __2151INTF_H__
|
||||
#define __2151INTF_H__
|
||||
|
||||
#include "devlegcy.h"
|
||||
|
||||
struct ym2151_interface
|
||||
{
|
||||
devcb_write_line irqhandler;
|
||||
devcb_write8 portwritehandler;
|
||||
};
|
||||
//**************************************************************************
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
||||
DECLARE_READ8_DEVICE_HANDLER( ym2151_r );
|
||||
DECLARE_WRITE8_DEVICE_HANDLER( ym2151_w );
|
||||
#define MCFG_YM2151_ADD(_tag, _clock) \
|
||||
MCFG_DEVICE_ADD(_tag, YM2151, _clock)
|
||||
|
||||
DECLARE_READ8_DEVICE_HANDLER( ym2151_status_port_r );
|
||||
DECLARE_WRITE8_DEVICE_HANDLER( ym2151_register_port_w );
|
||||
DECLARE_WRITE8_DEVICE_HANDLER( ym2151_data_port_w );
|
||||
#define MCFG_YM2151_IRQ_HANDLER(_devcb) \
|
||||
devcb = &ym2151_device::set_irq_handler(*device, DEVCB2_##_devcb); \
|
||||
|
||||
class ym2151_device : public device_t,
|
||||
public device_sound_interface
|
||||
#define MCFG_YM2151_PORT_WRITE_HANDLER(_devcb) \
|
||||
devcb = &ym2151_device::set_port_write_handler(*device, DEVCB2_##_devcb); \
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
|
||||
// ======================> ym2151_device
|
||||
|
||||
class ym2151_device : public device_t,
|
||||
public device_sound_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
~ym2151_device() { global_free(m_token); }
|
||||
|
||||
// access to legacy token
|
||||
void *token() const { assert(m_token != NULL); return m_token; }
|
||||
// static configuration helpers
|
||||
template<class _Object> static devcb2_base &set_irq_handler(device_t &device, _Object object) { return downcast<ym2151_device &>(device).m_irqhandler.set_callback(object); }
|
||||
template<class _Object> static devcb2_base &set_port_write_handler(device_t &device, _Object object) { return downcast<ym2151_device &>(device).m_portwritehandler.set_callback(object); }
|
||||
|
||||
// read/write
|
||||
DECLARE_READ8_MEMBER( read );
|
||||
DECLARE_WRITE8_MEMBER( write );
|
||||
|
||||
DECLARE_READ8_MEMBER( status_r );
|
||||
DECLARE_WRITE8_MEMBER( register_w );
|
||||
DECLARE_WRITE8_MEMBER( data_w );
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete();
|
||||
virtual void device_start();
|
||||
virtual void device_stop();
|
||||
virtual void device_reset();
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
|
||||
|
||||
private:
|
||||
// internal helpers
|
||||
static void irq_frontend(device_t *device, int irq);
|
||||
static void port_write_frontend(device_t *device, offs_t offset, UINT8 data);
|
||||
|
||||
// internal state
|
||||
void *m_token;
|
||||
sound_stream * m_stream;
|
||||
emu_timer * m_timer[2];
|
||||
void * m_chip;
|
||||
UINT8 m_lastreg;
|
||||
devcb2_write_line m_irqhandler;
|
||||
devcb2_write8 m_portwritehandler;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type YM2151;
|
||||
|
||||
|
||||
|
@ -716,7 +716,7 @@ static WRITE8_HANDLER( jsa3s_io_w )
|
||||
}
|
||||
}
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( ym2151_ctl_w )
|
||||
WRITE8_DEVICE_HANDLER( ym2151_ctl_w )
|
||||
{
|
||||
ym2151_ct1 = data&0x1;
|
||||
ym2151_ct2 = (data&0x2)>>1;
|
||||
@ -750,7 +750,7 @@ static void update_all_volumes(running_machine &machine )
|
||||
|
||||
static ADDRESS_MAP_START( atarijsa1_map, AS_PROGRAM, 8, driver_device )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_RAM
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x2800, 0x2bff) AM_READWRITE_LEGACY(jsa1_io_r, jsa1_io_w)
|
||||
AM_RANGE(0x3000, 0xffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
@ -758,7 +758,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( atarijsa2_map, AS_PROGRAM, 8, driver_device )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_RAM
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x2800, 0x2bff) AM_READWRITE_LEGACY(jsa2_io_r, jsa2_io_w)
|
||||
AM_RANGE(0x3000, 0xffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
@ -767,7 +767,7 @@ ADDRESS_MAP_END
|
||||
/* full map verified from schematics and Batman GALs */
|
||||
static ADDRESS_MAP_START( atarijsa3_map, AS_PROGRAM, 8, driver_device )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_RAM
|
||||
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x07fe) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x07fe) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x2800, 0x2fff) AM_READWRITE_LEGACY(jsa3_io_r, jsa3_io_w)
|
||||
AM_RANGE(0x3000, 0xffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
@ -775,27 +775,13 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( atarijsa3s_map, AS_PROGRAM, 8, driver_device )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_RAM
|
||||
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x07fe) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x07fe) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x2800, 0x2fff) AM_READWRITE_LEGACY(jsa3s_io_r, jsa3s_io_w)
|
||||
AM_RANGE(0x3000, 0xffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Sound definitions
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(atarigen_ym2151_irq_gen),
|
||||
DEVCB_HANDLER(ym2151_ctl_w)
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Machine drivers
|
||||
@ -813,8 +799,9 @@ MACHINE_CONFIG_FRAGMENT( jsa_i_stereo )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, JSA_MASTER_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", JSA_MASTER_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(atarigen_state, ym2151_irq_gen))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(driver_device, member_wrapper8<ym2151_ctl_w>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.60)
|
||||
MACHINE_CONFIG_END
|
||||
@ -826,8 +813,8 @@ MACHINE_CONFIG_DERIVED( jsa_i_stereo_swapped, jsa_i_stereo )
|
||||
/* basic machine hardware */
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SOUND_REPLACE("ymsnd", YM2151, JSA_MASTER_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_DEVICE_MODIFY("ymsnd")
|
||||
MCFG_SOUND_ROUTES_RESET()
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 0.60)
|
||||
MACHINE_CONFIG_END
|
||||
@ -856,8 +843,9 @@ MACHINE_CONFIG_FRAGMENT( jsa_i_mono_speech )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, JSA_MASTER_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", JSA_MASTER_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(atarigen_state, ym2151_irq_gen))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(driver_device, member_wrapper8<ym2151_ctl_w>))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.60)
|
||||
|
||||
@ -877,8 +865,9 @@ MACHINE_CONFIG_FRAGMENT( jsa_ii_mono )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, JSA_MASTER_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", JSA_MASTER_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(atarigen_state, ym2151_irq_gen))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(driver_device, member_wrapper8<ym2151_ctl_w>))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.60)
|
||||
|
||||
@ -920,8 +909,9 @@ MACHINE_CONFIG_FRAGMENT( jsa_iiis_stereo )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, JSA_MASTER_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", JSA_MASTER_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(atarigen_state, ym2151_irq_gen))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(driver_device, member_wrapper8<ym2151_ctl_w>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.60)
|
||||
|
||||
|
@ -2204,7 +2204,7 @@ static READ16_DEVICE_HANDLER( peripheral_r )
|
||||
if (!state->m_has_ym2151)
|
||||
return pit8254_r(device, space, offset | 0x40, mem_mask);
|
||||
else
|
||||
return ym2151_r(space.machine().device("ymsnd"), space, offset);
|
||||
return space.machine().device<ym2151_device>("ymsnd")->read(space, offset);
|
||||
|
||||
case 4:
|
||||
if (state->m_is_redline)
|
||||
@ -2241,7 +2241,7 @@ static WRITE16_DEVICE_HANDLER( peripheral_w )
|
||||
if (!state->m_has_ym2151)
|
||||
pit8254_w(device, space, offset | 0x40, data, mem_mask);
|
||||
else
|
||||
ym2151_w(space.machine().device("ymsnd"), space, offset, data);
|
||||
space.machine().device<ym2151_device>("ymsnd")->write(space, offset, data);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
|
@ -139,12 +139,12 @@ static DEVICE_RESET( m72_audio )
|
||||
setvector_callback(device->machine(), state, VECTOR_INIT);
|
||||
}
|
||||
|
||||
void m72_ym2151_irq_handler(device_t *device, int irq)
|
||||
WRITE_LINE_DEVICE_HANDLER(m72_ym2151_irq_handler)
|
||||
{
|
||||
device_t *audio = device->machine().device("m72");
|
||||
m72_audio_state *state = get_safe_token(audio);
|
||||
m72_audio_state *audstate = get_safe_token(audio);
|
||||
|
||||
device->machine().scheduler().synchronize(FUNC(setvector_callback), irq ? YM2151_ASSERT : YM2151_CLEAR, state);
|
||||
device->machine().scheduler().synchronize(FUNC(setvector_callback), state ? YM2151_ASSERT : YM2151_CLEAR, audstate);
|
||||
}
|
||||
|
||||
WRITE16_DEVICE_HANDLER( m72_sound_command_w )
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
void m72_ym2151_irq_handler(device_t *device, int irq);
|
||||
WRITE_LINE_DEVICE_HANDLER(m72_ym2151_irq_handler);
|
||||
DECLARE_WRITE8_DEVICE_HANDLER( m72_sound_command_byte_w );
|
||||
DECLARE_WRITE16_DEVICE_HANDLER( m72_sound_command_w );
|
||||
DECLARE_WRITE8_DEVICE_HANDLER( m72_sound_irq_ack_w );
|
||||
|
@ -314,9 +314,9 @@ void seibu_ym3812_irqhandler(device_t *device, int linestate)
|
||||
update_irq_lines(device->machine(), linestate ? RST10_ASSERT : RST10_CLEAR);
|
||||
}
|
||||
|
||||
void seibu_ym2151_irqhandler(device_t *device, int linestate)
|
||||
WRITE_LINE_DEVICE_HANDLER( seibu_ym2151_irqhandler )
|
||||
{
|
||||
update_irq_lines(device->machine(), linestate ? RST10_ASSERT : RST10_CLEAR);
|
||||
update_irq_lines(device->machine(), state ? RST10_ASSERT : RST10_CLEAR);
|
||||
}
|
||||
|
||||
void seibu_ym2203_irqhandler(device_t *device, int linestate)
|
||||
@ -450,11 +450,6 @@ const ym3812_interface seibu_ym3812_interface =
|
||||
seibu_ym3812_irqhandler
|
||||
};
|
||||
|
||||
const ym2151_interface seibu_ym2151_interface =
|
||||
{
|
||||
DEVCB_LINE(seibu_ym2151_irqhandler)
|
||||
};
|
||||
|
||||
const ym2203_interface seibu_ym2203_interface =
|
||||
{
|
||||
{
|
||||
@ -493,7 +488,7 @@ ADDRESS_MAP_START( seibu2_airraid_sound_map, AS_PROGRAM, 8, driver_device )
|
||||
AM_RANGE(0x4002, 0x4002) AM_WRITE_LEGACY(seibu_rst10_ack_w)
|
||||
AM_RANGE(0x4003, 0x4003) AM_WRITE_LEGACY(seibu_rst18_ack_w)
|
||||
AM_RANGE(0x4007, 0x4007) AM_WRITENOP // bank, always 0
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x4010, 0x4011) AM_READ_LEGACY(seibu_soundlatch_r)
|
||||
AM_RANGE(0x4012, 0x4012) AM_READ_LEGACY(seibu_main_data_pending_r)
|
||||
AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
|
||||
@ -511,7 +506,7 @@ ADDRESS_MAP_START( seibu2_sound_map, AS_PROGRAM, 8, driver_device )
|
||||
AM_RANGE(0x4002, 0x4002) AM_WRITE_LEGACY(seibu_rst10_ack_w)
|
||||
AM_RANGE(0x4003, 0x4003) AM_WRITE_LEGACY(seibu_rst18_ack_w)
|
||||
AM_RANGE(0x4007, 0x4007) AM_WRITE_LEGACY(seibu_bank_w)
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x4010, 0x4011) AM_READ_LEGACY(seibu_soundlatch_r)
|
||||
AM_RANGE(0x4012, 0x4012) AM_READ_LEGACY(seibu_main_data_pending_r)
|
||||
AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
|
||||
@ -528,7 +523,7 @@ ADDRESS_MAP_START( seibu2_raiden2_sound_map, AS_PROGRAM, 8, driver_device )
|
||||
AM_RANGE(0x4001, 0x4001) AM_WRITE_LEGACY(seibu_irq_clear_w)
|
||||
AM_RANGE(0x4002, 0x4002) AM_WRITE_LEGACY(seibu_rst10_ack_w)
|
||||
AM_RANGE(0x4003, 0x4003) AM_WRITE_LEGACY(seibu_rst18_ack_w)
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x4010, 0x4011) AM_READ_LEGACY(seibu_soundlatch_r)
|
||||
AM_RANGE(0x4012, 0x4012) AM_READ_LEGACY(seibu_main_data_pending_r)
|
||||
AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
|
||||
|
@ -51,7 +51,7 @@ DECLARE_WRITE8_HANDLER( seibu_rst18_ack_w );
|
||||
DECLARE_WRITE8_HANDLER( seibu_bank_w );
|
||||
DECLARE_WRITE8_HANDLER( seibu_coin_w );
|
||||
void seibu_ym3812_irqhandler(device_t *device, int linestate);
|
||||
void seibu_ym2151_irqhandler(device_t *device, int linestate);
|
||||
WRITE_LINE_DEVICE_HANDLER(seibu_ym2151_irqhandler);
|
||||
void seibu_ym2203_irqhandler(device_t *device, int linestate);
|
||||
DECLARE_READ8_HANDLER( seibu_soundlatch_r );
|
||||
DECLARE_READ8_HANDLER( seibu_main_data_pending_r );
|
||||
@ -88,7 +88,6 @@ extern const device_type SEIBU_ADPCM;
|
||||
|
||||
|
||||
extern const ym3812_interface seibu_ym3812_interface;
|
||||
extern const ym2151_interface seibu_ym2151_interface;
|
||||
extern const ym2203_interface seibu_ym2203_interface;
|
||||
|
||||
struct seibu_adpcm_interface
|
||||
@ -166,8 +165,8 @@ extern const seibu_adpcm_interface seibu_adpcm2_intf;
|
||||
#define SEIBU_SOUND_SYSTEM_YM2151_INTERFACE(freq1,freq2) \
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono") \
|
||||
\
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, freq1) \
|
||||
MCFG_SOUND_CONFIG(seibu_ym2151_interface) \
|
||||
MCFG_YM2151_ADD("ymsnd", freq1) \
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<seibu_ym2151_irqhandler>)) \
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50) \
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50) \
|
||||
\
|
||||
@ -177,8 +176,8 @@ extern const seibu_adpcm_interface seibu_adpcm2_intf;
|
||||
#define SEIBU_AIRRAID_SOUND_SYSTEM_YM2151_INTERFACE(freq1) \
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono") \
|
||||
\
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, freq1) \
|
||||
MCFG_SOUND_CONFIG(seibu_ym2151_interface) \
|
||||
MCFG_YM2151_ADD("ymsnd", freq1) \
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<seibu_ym2151_irqhandler>)) \
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50) \
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50) \
|
||||
\
|
||||
@ -187,8 +186,8 @@ extern const seibu_adpcm_interface seibu_adpcm2_intf;
|
||||
#define SEIBU_SOUND_SYSTEM_YM2151_RAIDEN2_INTERFACE(freq1,freq2,regiona, regionb) \
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono") \
|
||||
\
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, freq1) \
|
||||
MCFG_SOUND_CONFIG(seibu_ym2151_interface) \
|
||||
MCFG_YM2151_ADD("ymsnd", freq1) \
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<seibu_ym2151_irqhandler>)) \
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50) \
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50) \
|
||||
\
|
||||
|
@ -232,9 +232,9 @@ static WRITE8_HANDLER( t5182_cpu_irq_ack_w )
|
||||
space.machine().scheduler().synchronize(FUNC(setirq_callback), CPU_CLEAR);
|
||||
}
|
||||
|
||||
static void t5182_ym2151_irq_handler(device_t *device, int irq)
|
||||
WRITE_LINE_DEVICE_HANDLER(t5182_ym2151_irq_handler)
|
||||
{
|
||||
if (irq)
|
||||
if (state)
|
||||
device->machine().scheduler().synchronize(FUNC(setirq_callback), YM2151_ASSERT);
|
||||
else
|
||||
device->machine().scheduler().synchronize(FUNC(setirq_callback), YM2151_CLEAR);
|
||||
@ -275,12 +275,6 @@ static READ8_HANDLER(t5182_sharedram_semaphore_main_r)
|
||||
}
|
||||
|
||||
|
||||
const ym2151_interface t5182_ym2151_interface =
|
||||
{
|
||||
DEVCB_LINE(t5182_ym2151_irq_handler)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// 4000-407F RAM shared with main CPU
|
||||
@ -320,7 +314,7 @@ ADDRESS_MAP_END
|
||||
// 50 W test mode status flags (bit 0 = ROM test fail, bit 1 = RAM test fail, bit 2 = YM2151 IRQ not received)
|
||||
ADDRESS_MAP_START( t5182_io, AS_IO, 8, driver_device )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x10, 0x10) AM_WRITE_LEGACY(t5182_sharedram_semaphore_snd_acquire_w)
|
||||
AM_RANGE(0x11, 0x11) AM_WRITE_LEGACY(t5182_sharedram_semaphore_snd_release_w)
|
||||
AM_RANGE(0x12, 0x12) AM_WRITE_LEGACY(t5182_ym2151_irq_ack_w)
|
||||
|
@ -18,4 +18,4 @@ DECLARE_WRITE8_HANDLER(t5182_sharedram_semaphore_main_release_w);
|
||||
DECLARE_READ8_HANDLER( t5182_sharedram_r );
|
||||
DECLARE_WRITE8_HANDLER( t5182_sharedram_w );
|
||||
|
||||
extern const ym2151_interface t5182_ym2151_interface;
|
||||
WRITE_LINE_DEVICE_HANDLER(t5182_ym2151_irq_handler);
|
||||
|
@ -222,7 +222,7 @@ WRITE_LINE_MEMBER(williams_cvsd_sound_device::pia_irqb)
|
||||
|
||||
static ADDRESS_MAP_START( williams_cvsd_map, AS_PROGRAM, 8, williams_cvsd_sound_device )
|
||||
AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_RAM
|
||||
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x1ffe) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x1ffe) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
|
||||
AM_RANGE(0x4000, 0x4003) AM_MIRROR(0x1ffc) AM_DEVREADWRITE("pia", pia6821_device, read, write)
|
||||
AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x07ff) AM_WRITE(cvsd_digit_clock_clear_w)
|
||||
AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07ff) AM_WRITE(cvsd_clock_set_w)
|
||||
@ -252,16 +252,6 @@ static const pia6821_interface cvsd_pia_intf =
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// YM2151 configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
static const ym2151_interface cvsd_ym2151_interface =
|
||||
{
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, williams_cvsd_sound_device, ym2151_irq_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine configuration
|
||||
//-------------------------------------------------
|
||||
@ -272,8 +262,8 @@ static MACHINE_CONFIG_FRAGMENT( williams_cvsd_sound )
|
||||
|
||||
MCFG_PIA6821_ADD("pia", cvsd_pia_intf)
|
||||
|
||||
MCFG_SOUND_ADD("ym2151", YM2151, CVSD_FM_CLOCK)
|
||||
MCFG_SOUND_CONFIG(cvsd_ym2151_interface)
|
||||
MCFG_YM2151_ADD("ym2151", CVSD_FM_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(williams_cvsd_sound_device, ym2151_irq_w))
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
|
||||
|
||||
MCFG_DAC_ADD("dac")
|
||||
@ -566,7 +556,7 @@ WRITE_LINE_MEMBER(williams_narc_sound_device::ym2151_irq_w)
|
||||
|
||||
static ADDRESS_MAP_START( williams_narc_master_map, AS_PROGRAM, 8, williams_narc_sound_device )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_RAM
|
||||
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x03fe) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x03fe) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
|
||||
AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_WRITE(master_talkback_w)
|
||||
AM_RANGE(0x2c00, 0x2c00) AM_MIRROR(0x03ff) AM_WRITE(command2_w)
|
||||
AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_DEVWRITE("dac1", dac_device, write_unsigned8)
|
||||
@ -596,16 +586,6 @@ static ADDRESS_MAP_START( williams_narc_slave_map, AS_PROGRAM, 8, williams_narc_
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// YM2151 configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
static const ym2151_interface narc_ym2151_interface =
|
||||
{
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, williams_narc_sound_device, ym2151_irq_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine configuration
|
||||
//-------------------------------------------------
|
||||
@ -617,8 +597,8 @@ static MACHINE_CONFIG_FRAGMENT( williams_narc_sound )
|
||||
MCFG_CPU_ADD("cpu1", M6809E, NARC_MASTER_CLOCK)
|
||||
MCFG_CPU_PROGRAM_MAP(williams_narc_slave_map)
|
||||
|
||||
MCFG_SOUND_ADD("ym2151", YM2151, NARC_FM_CLOCK)
|
||||
MCFG_SOUND_CONFIG(narc_ym2151_interface)
|
||||
MCFG_YM2151_ADD("ym2151", NARC_FM_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(williams_narc_sound_device, ym2151_irq_w))
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
|
||||
|
||||
MCFG_DAC_ADD("dac1")
|
||||
@ -859,7 +839,7 @@ WRITE_LINE_MEMBER(williams_adpcm_sound_device::ym2151_irq_w)
|
||||
static ADDRESS_MAP_START( williams_adpcm_map, AS_PROGRAM, 8, williams_adpcm_sound_device )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_RAM
|
||||
AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x03ff) AM_WRITE(bank_select_w)
|
||||
AM_RANGE(0x2400, 0x2401) AM_MIRROR(0x03fe) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x2400, 0x2401) AM_MIRROR(0x03fe) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
|
||||
AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_DEVWRITE("dac", dac_device, write_unsigned8)
|
||||
AM_RANGE(0x2c00, 0x2c00) AM_MIRROR(0x03ff) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_READ(command_r)
|
||||
@ -880,16 +860,6 @@ static ADDRESS_MAP_START( williams_adpcm_oki_map, AS_0, 8, williams_adpcm_sound_
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// YM2151 configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
static const ym2151_interface adpcm_ym2151_interface =
|
||||
{
|
||||
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, williams_adpcm_sound_device, ym2151_irq_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine configuration
|
||||
//-------------------------------------------------
|
||||
@ -898,8 +868,8 @@ static MACHINE_CONFIG_FRAGMENT( williams_adpcm_sound )
|
||||
MCFG_CPU_ADD("cpu", M6809E, ADPCM_MASTER_CLOCK)
|
||||
MCFG_CPU_PROGRAM_MAP(williams_adpcm_map)
|
||||
|
||||
MCFG_SOUND_ADD("ym2151", YM2151, ADPCM_FM_CLOCK)
|
||||
MCFG_SOUND_CONFIG(adpcm_ym2151_interface)
|
||||
MCFG_YM2151_ADD("ym2151", ADPCM_FM_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(williams_adpcm_sound_device, ym2151_irq_w))
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
|
||||
|
||||
MCFG_DAC_ADD("dac")
|
||||
|
@ -150,7 +150,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, _88games_state )
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0x9000, 0x9000) AM_WRITE(speech_msg_w)
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xe000, 0xe000) AM_WRITE(speech_control_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -396,7 +396,7 @@ static MACHINE_CONFIG_START( 88games, _88games_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.75)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.75)
|
||||
|
||||
|
@ -55,7 +55,7 @@ static ADDRESS_MAP_START( ajax_sound_map, AS_PROGRAM, 8, ajax_state )
|
||||
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232_2", k007232_r, k007232_w) /* 007232 registers (chip 2) */
|
||||
AM_RANGE(0xb80c, 0xb80c) AM_WRITE(k007232_extvol_w) /* extra volume, goes to the 007232 w/ A11 */
|
||||
/* selecting a different latch for the external port */
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) /* YM2151 */
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */
|
||||
AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -241,7 +241,7 @@ static MACHINE_CONFIG_START( ajax, ajax_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
|
@ -130,7 +130,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( aliens_sound_map, AS_PROGRAM, 8, aliens_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM g04_b03.bin */
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */
|
||||
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
|
||||
AM_RANGE(0xe000, 0xe00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w)
|
||||
ADDRESS_MAP_END
|
||||
@ -202,12 +202,6 @@ static const k007232_interface k007232_config =
|
||||
volume_callback /* external port callback */
|
||||
};
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_NULL,
|
||||
DEVCB_DRIVER_MEMBER(aliens_state,aliens_snd_bankswitch_w)
|
||||
};
|
||||
|
||||
|
||||
static const k052109_interface aliens_k052109_intf =
|
||||
{
|
||||
@ -280,8 +274,8 @@ static MACHINE_CONFIG_START( aliens, aliens_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(aliens_state,aliens_snd_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.60)
|
||||
|
||||
|
@ -64,8 +64,8 @@ READ8_MEMBER(amspdwy_state::amspdwy_wheel_1_r)
|
||||
|
||||
READ8_MEMBER(amspdwy_state::amspdwy_sound_r)
|
||||
{
|
||||
device_t *device = machine().device("ymsnd");
|
||||
return (ym2151_status_port_r(device, space, 0) & ~ 0x30) | machine().root_device().ioport("IN0")->read();
|
||||
ym2151_device *device = machine().device<ym2151_device>("ymsnd");
|
||||
return (device->status_r(space, 0) & ~ 0x30) | machine().root_device().ioport("IN0")->read();
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(amspdwy_state::amspdwy_sound_w)
|
||||
@ -116,7 +116,7 @@ static ADDRESS_MAP_START( amspdwy_sound_map, AS_PROGRAM, 8, amspdwy_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM // ROM
|
||||
// AM_RANGE(0x8000, 0x8000) AM_WRITENOP // ? Written with 0 at the start
|
||||
AM_RANGE(0x9000, 0x9000) AM_READ(soundlatch_byte_r) // From Main CPU
|
||||
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) //
|
||||
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) //
|
||||
AM_RANGE(0xc000, 0xdfff) AM_RAM // Work RAM
|
||||
AM_RANGE(0xffff, 0xffff) AM_READNOP // ??? IY = FFFF at the start ?
|
||||
ADDRESS_MAP_END
|
||||
@ -239,17 +239,6 @@ GFXDECODE_END
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
static void irq_handler( device_t *device, int irq )
|
||||
{
|
||||
amspdwy_state *state = device->machine().driver_data<amspdwy_state>();
|
||||
state->m_audiocpu->set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface amspdwy_ym2151_interface =
|
||||
{
|
||||
DEVCB_LINE(irq_handler)
|
||||
};
|
||||
|
||||
void amspdwy_state::machine_start()
|
||||
{
|
||||
|
||||
@ -297,8 +286,8 @@ static MACHINE_CONFIG_START( amspdwy, amspdwy_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3000000)
|
||||
MCFG_SOUND_CONFIG(amspdwy_ym2151_interface)
|
||||
MCFG_YM2151_ADD("ymsnd", 3000000)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -129,7 +129,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( snd_portmap, AS_IO, 8, aquarium_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x02, 0x02) AM_READWRITE(aquarium_oki_r, aquarium_oki_w)
|
||||
AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x06, 0x06) AM_WRITE(aquarium_snd_ack_w)
|
||||
@ -288,18 +288,6 @@ static GFXDECODE_START( aquarium )
|
||||
GFXDECODE_ENTRY( "gfx4", 0, char5bpplayout, 0x400, 32 )
|
||||
GFXDECODE_END
|
||||
|
||||
static void irq_handler( device_t *device, int irq )
|
||||
{
|
||||
aquarium_state *state = device->machine().driver_data<aquarium_state>();
|
||||
state->m_audiocpu->set_input_line(0 , irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(irq_handler)
|
||||
};
|
||||
|
||||
|
||||
void aquarium_state::machine_start()
|
||||
{
|
||||
|
||||
@ -340,8 +328,8 @@ static MACHINE_CONFIG_START( aquarium, aquarium_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_14_31818MHz/4) // clock not verified on pcb
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_14_31818MHz/4) // clock not verified on pcb
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.45)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.45)
|
||||
|
||||
|
@ -193,10 +193,10 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, asterix_state )
|
||||
AM_RANGE(0x0000, 0xefff) AM_ROM
|
||||
AM_RANGE(0xf000, 0xf7ff) AM_RAM
|
||||
AM_RANGE(0xf801, 0xf801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_status_port_r, ym2151_data_port_w)
|
||||
AM_RANGE(0xf801, 0xf801) AM_DEVREADWRITE("ymsnd", ym2151_device, status_r, data_w)
|
||||
AM_RANGE(0xfa00, 0xfa2f) AM_DEVREADWRITE_LEGACY("k053260", k053260_r, k053260_w)
|
||||
AM_RANGE(0xfc00, 0xfc00) AM_WRITE(sound_arm_nmi_w)
|
||||
AM_RANGE(0xfe00, 0xfe00) AM_DEVWRITE_LEGACY("ymsnd", ym2151_register_port_w)
|
||||
AM_RANGE(0xfe00, 0xfe00) AM_DEVWRITE("ymsnd", ym2151_device, register_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
@ -316,7 +316,7 @@ static MACHINE_CONFIG_START( asterix, asterix_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
|
@ -393,7 +393,7 @@ static ADDRESS_MAP_START( z80_map, AS_PROGRAM, 8, asuka_state )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROM
|
||||
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
|
||||
AM_RANGE(0x8000, 0x8fff) AM_RAM
|
||||
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
// AM_RANGE(0x9002, 0x9100) AM_READNOP
|
||||
AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
|
||||
AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
|
||||
@ -407,7 +407,7 @@ static ADDRESS_MAP_START( cadash_z80_map, AS_PROGRAM, 8, asuka_state )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROM
|
||||
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
|
||||
AM_RANGE(0x8000, 0x8fff) AM_RAM
|
||||
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
|
||||
AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
|
||||
ADDRESS_MAP_END
|
||||
@ -777,12 +777,6 @@ static const ym2610_interface ym2610_config =
|
||||
};
|
||||
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(irq_handler),
|
||||
DEVCB_DRIVER_MEMBER(asuka_state,sound_bankswitch_2151_w)
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
asuka_msm5205_vck, /* VCK function */
|
||||
@ -965,8 +959,9 @@ static MACHINE_CONFIG_START( asuka, asuka_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_16MHz/4) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_16MHz/4) /* verified on pcb */
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(asuka_state,sound_bankswitch_2151_w))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
|
||||
@ -1015,8 +1010,9 @@ static MACHINE_CONFIG_START( cadash, asuka_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_8MHz/2) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_8MHz/2) /* verified on pcb */
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(asuka_state,sound_bankswitch_2151_w))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
|
||||
@ -1057,8 +1053,9 @@ static MACHINE_CONFIG_START( mofflott, asuka_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(asuka_state,sound_bankswitch_2151_w))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
|
||||
@ -1103,8 +1100,9 @@ static MACHINE_CONFIG_START( galmedes, asuka_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(asuka_state,sound_bankswitch_2151_w))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
|
||||
@ -1145,8 +1143,9 @@ static MACHINE_CONFIG_START( eto, asuka_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(asuka_state,sound_bankswitch_2151_w))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
|
||||
|
@ -501,7 +501,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, atarisy1_state )
|
||||
AM_RANGE(0x0000, 0x0fff) AM_RAM
|
||||
AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE("via6522_0", via6522_device, read, write)
|
||||
AM_RANGE(0x1800, 0x1801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x1800, 0x1801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x1810, 0x1810) AM_READWRITE_LEGACY(atarigen_6502_sound_r, atarigen_6502_sound_w)
|
||||
AM_RANGE(0x1820, 0x1820) AM_READ(switch_6502_r)
|
||||
AM_RANGE(0x1824, 0x1825) AM_WRITE(led_w)
|
||||
@ -737,19 +737,6 @@ GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Sound definitions
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(atarigen_ym2151_irq_gen)
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Machine driver
|
||||
@ -791,8 +778,8 @@ static MACHINE_CONFIG_START( atarisy1, atarisy1_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, ATARI_CLOCK_14MHz/4)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", ATARI_CLOCK_14MHz/4)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(atarigen_state, ym2151_irq_gen))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
|
||||
|
@ -833,7 +833,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, atarisy2_state )
|
||||
AM_RANGE(0x1810, 0x1813) AM_MIRROR(0x278c) AM_READ(leta_r)
|
||||
AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x2780) AM_DEVREADWRITE("pokey2", pokey_device, read, write)
|
||||
AM_RANGE(0x1840, 0x1840) AM_MIRROR(0x278f) AM_READ(switch_6502_r)
|
||||
AM_RANGE(0x1850, 0x1851) AM_MIRROR(0x278e) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x1850, 0x1851) AM_MIRROR(0x278e) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x1860, 0x1860) AM_MIRROR(0x278f) AM_READ(sound_6502_r)
|
||||
AM_RANGE(0x1870, 0x1870) AM_MIRROR(0x2781) AM_WRITE(tms5220_w)
|
||||
AM_RANGE(0x1872, 0x1873) AM_MIRROR(0x2780) AM_WRITE(tms5220_strobe_w)
|
||||
@ -1283,7 +1283,7 @@ static MACHINE_CONFIG_START( atarisy2, atarisy2_state )
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK/4)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK/4)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.60)
|
||||
|
||||
|
@ -347,7 +347,7 @@ static MACHINE_CONFIG_DERIVED( wsf, ataxx )
|
||||
/* basic machine hardware */
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.40)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.40)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -405,7 +405,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, badlands_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_RAM
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x2800, 0x2bff) AM_READWRITE(audio_io_r, audio_io_w)
|
||||
AM_RANGE(0x3000, 0xffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
@ -526,7 +526,7 @@ static MACHINE_CONFIG_START( badlands, badlands_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, ATARI_CLOCK_14MHz/4)
|
||||
MCFG_YM2151_ADD("ymsnd", ATARI_CLOCK_14MHz/4)
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.30)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.30)
|
||||
MACHINE_CONFIG_END
|
||||
@ -732,7 +732,7 @@ static MACHINE_CONFIG_START( badlandsb, badlands_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_20MHz/8) /* Divisor estimated */
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_20MHz/8) /* Divisor estimated */
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.30)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.30)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -213,7 +213,7 @@ static MACHINE_CONFIG_START( bigstrkb, bigstrkb_state )
|
||||
|
||||
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
// MCFG_SOUND_ADD("ymsnd", YM2151, ym2151_config)
|
||||
// MCFG_YM2151_ADD("ymsnd", ym2151_config)
|
||||
|
||||
MCFG_OKIM6295_ADD("oki1", 4000000, OKIM6295_PIN7_HIGH)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
|
||||
|
@ -127,7 +127,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_io, AS_IO, 8, bingoc_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x40, 0x40) AM_WRITE(bingoc_play_w)
|
||||
AM_RANGE(0x80, 0x80) AM_DEVWRITE_LEGACY("upd", upd7759_port_w)
|
||||
#if !SOUND_TEST
|
||||
@ -168,7 +168,7 @@ static MACHINE_CONFIG_START( bingoc, bingoc_state )
|
||||
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") //might just be mono...
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 7159160/2)
|
||||
MCFG_YM2151_ADD("ymsnd", 7159160/2)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
|
@ -163,7 +163,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, bionicc_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x8001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x8000, 0x8001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
@ -382,7 +382,7 @@ static MACHINE_CONFIG_START( bionicc, bionicc_state )
|
||||
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.60)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -110,7 +110,7 @@ static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, blockhl_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xe00c, 0xe00d) AM_WRITENOP /* leftover from missing 007232? */
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -239,7 +239,7 @@ static MACHINE_CONFIG_START( blockhl, blockhl_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.60)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -145,7 +145,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, blockout_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
|
||||
ADDRESS_MAP_END
|
||||
@ -260,17 +260,11 @@ INPUT_PORTS_END
|
||||
*************************************/
|
||||
|
||||
/* handler called by the 2151 emulator when the internal timers cause an IRQ */
|
||||
static void blockout_irq_handler(device_t *device, int irq)
|
||||
WRITE_LINE_MEMBER(blockout_state::irq_handler)
|
||||
{
|
||||
blockout_state *state = device->machine().driver_data<blockout_state>();
|
||||
state->m_audiocpu->set_input_line_and_vector(0, irq ? ASSERT_LINE : CLEAR_LINE, 0xff);
|
||||
m_audiocpu->set_input_line_and_vector(0, state ? ASSERT_LINE : CLEAR_LINE, 0xff);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(blockout_irq_handler)
|
||||
};
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
@ -329,8 +323,8 @@ static MACHINE_CONFIG_START( blockout, blockout_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, AUDIO_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", AUDIO_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(blockout_state,irq_handler))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.60)
|
||||
|
||||
|
@ -131,7 +131,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, boogwing_state )
|
||||
AM_RANGE(0x000000, 0x00ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x100001) AM_NOP
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
|
||||
AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write)
|
||||
AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r)
|
||||
@ -275,24 +275,12 @@ GFXDECODE_END
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
static void sound_irq(device_t *device, int state)
|
||||
{
|
||||
boogwing_state *driver_state = device->machine().driver_data<boogwing_state>();
|
||||
driver_state->m_audiocpu->set_input_line(1, state); /* IRQ 2 */
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(boogwing_state::sound_bankswitch_w)
|
||||
{
|
||||
m_oki2->set_bank_base(((data & 2) >> 1) * 0x40000);
|
||||
m_oki1->set_bank_base((data & 1) * 0x40000);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq),
|
||||
DEVCB_DRIVER_MEMBER(boogwing_state,sound_bankswitch_w)
|
||||
};
|
||||
|
||||
|
||||
static int boogwing_bank_callback( const int bank )
|
||||
{
|
||||
@ -377,8 +365,9 @@ static MACHINE_CONFIG_START( boogwing, boogwing_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) /* IRQ2 */
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(boogwing_state, sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
|
||||
|
@ -183,7 +183,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cabal_state )
|
||||
AM_RANGE(0x4002, 0x4002) AM_WRITE_LEGACY(seibu_rst10_ack_w)
|
||||
AM_RANGE(0x4003, 0x4003) AM_WRITE_LEGACY(seibu_rst18_ack_w)
|
||||
AM_RANGE(0x4005, 0x4006) AM_DEVWRITE_LEGACY("adpcm1", seibu_adpcm_adr_w)
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x4010, 0x4011) AM_READ_LEGACY(seibu_soundlatch_r)
|
||||
AM_RANGE(0x4012, 0x4012) AM_READ_LEGACY(seibu_main_data_pending_r)
|
||||
AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
|
||||
@ -205,7 +205,7 @@ static ADDRESS_MAP_START( cabalbl_sound_map, AS_PROGRAM, 8, cabal_state )
|
||||
AM_RANGE(0x4008, 0x4008) AM_READ(cabalbl_snd2_r)
|
||||
AM_RANGE(0x400a, 0x400a) AM_READ(cabalbl_snd1_r)
|
||||
AM_RANGE(0x400c, 0x400c) AM_WRITE(soundlatch2_byte_w)
|
||||
AM_RANGE(0x400e, 0x400f) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x400e, 0x400f) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x6000, 0x6000) AM_WRITENOP /* ??? */
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
@ -465,16 +465,6 @@ static GFXDECODE_START( cabal )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
static void irqhandler(device_t *device, int irq)
|
||||
{
|
||||
device->machine().device("audiocpu")->execute().set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface cabalbl_ym2151_interface =
|
||||
{
|
||||
DEVCB_LINE(irqhandler)
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_interface_1 =
|
||||
{
|
||||
0,
|
||||
@ -514,8 +504,8 @@ static MACHINE_CONFIG_START( cabal, cabal_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(seibu_ym2151_interface)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<seibu_ym2151_irqhandler>))
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.80)
|
||||
|
||||
MCFG_SOUND_ADD("adpcm1", SEIBU_ADPCM, 8000) /* it should use the msm5205 */
|
||||
@ -569,8 +559,8 @@ static MACHINE_CONFIG_START( cabalbl, cabal_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(cabalbl_ym2151_interface)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.80)
|
||||
|
||||
MCFG_SOUND_ADD("msm1", MSM5205, XTAL_12MHz/32) /* verified on pcb (no resonator) */
|
||||
|
@ -1149,7 +1149,7 @@ static ADDRESS_MAP_START( metmqstr_sound_portmap, AS_IO, 8, cave_state )
|
||||
AM_RANGE(0x20, 0x20) AM_READ(soundflags_r) // Communication
|
||||
AM_RANGE(0x30, 0x30) AM_READ(soundlatch_lo_r) // From Main CPU
|
||||
AM_RANGE(0x40, 0x40) AM_READ(soundlatch_hi_r) //
|
||||
AM_RANGE(0x50, 0x51) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) // YM2151
|
||||
AM_RANGE(0x50, 0x51) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) // YM2151
|
||||
AM_RANGE(0x60, 0x60) AM_DEVWRITE("oki1", okim6295_device, write) // M6295 #0
|
||||
AM_RANGE(0x70, 0x70) AM_WRITE(metmqstr_okibank0_w) // Samples Bank #0
|
||||
AM_RANGE(0x80, 0x80) AM_DEVWRITE("oki2", okim6295_device, write) // M6295 #1
|
||||
@ -1241,7 +1241,7 @@ static ADDRESS_MAP_START( sailormn_sound_portmap, AS_IO, 8, cave_state )
|
||||
AM_RANGE(0x20, 0x20) AM_READ(soundflags_r) // Communication
|
||||
AM_RANGE(0x30, 0x30) AM_READ(soundlatch_lo_r) // From Main CPU
|
||||
AM_RANGE(0x40, 0x40) AM_READ(soundlatch_hi_r) //
|
||||
AM_RANGE(0x50, 0x51) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) // YM2151
|
||||
AM_RANGE(0x50, 0x51) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) // YM2151
|
||||
AM_RANGE(0x60, 0x60) AM_DEVREADWRITE("oki1", okim6295_device, read, write) // M6295 #0
|
||||
AM_RANGE(0x70, 0x70) AM_WRITE(sailormn_okibank0_w) // Samples Bank #0
|
||||
AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("oki2", okim6295_device, read, write) // M6295 #1
|
||||
@ -1827,11 +1827,6 @@ static void irqhandler(device_t *device, int irq)
|
||||
device->machine().device("audiocpu")->execute().set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(irqhandler)
|
||||
};
|
||||
|
||||
static const ym2203_interface ym2203_config =
|
||||
{
|
||||
{
|
||||
@ -2299,8 +2294,8 @@ static MACHINE_CONFIG_START( metmqstr, cave_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_16MHz / 4)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_16MHz / 4)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.20)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.20)
|
||||
|
||||
@ -2472,8 +2467,8 @@ static MACHINE_CONFIG_START( sailormn, cave_state )
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_16MHz/4)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_16MHz/4)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.30)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.30)
|
||||
|
||||
|
@ -130,7 +130,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cbuster_state )
|
||||
AM_RANGE(0x000000, 0x00ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x100001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ym2", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE("ym2", ym2151_device, read, write)
|
||||
AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
|
||||
AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write)
|
||||
AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r)
|
||||
@ -262,17 +262,6 @@ GFXDECODE_END
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static void sound_irq(device_t *device, int state)
|
||||
{
|
||||
cbuster_state *driver_state = device->machine().driver_data<cbuster_state>();
|
||||
driver_state->m_audiocpu->set_input_line(1, state); /* IRQ 2 */
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq)
|
||||
};
|
||||
|
||||
static int twocrude_bank_callback( const int bank )
|
||||
{
|
||||
return ((bank >> 4) & 0x7) * 0x1000;
|
||||
@ -355,8 +344,8 @@ static MACHINE_CONFIG_START( twocrude, cbuster_state )
|
||||
MCFG_SOUND_ADD("ym1", YM2203, 32220000/8)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
|
||||
|
||||
MCFG_SOUND_ADD("ym2", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ym2", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) /* IRQ2 */
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.45)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.45)
|
||||
|
||||
|
@ -338,7 +338,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, ddragon_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_byte_r)
|
||||
ADDRESS_MAP_END
|
||||
@ -364,7 +364,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( saiyugoub1_sound_map, AS_PROGRAM, 8, ddragon_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x9800, 0x9800) AM_WRITE_LEGACY(saiyugoub1_mcu_command_w)
|
||||
AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_byte_r)
|
||||
ADDRESS_MAP_END
|
||||
@ -497,11 +497,6 @@ static void chinagat_irq_handler( device_t *device, int irq )
|
||||
state->m_snd_cpu->execute().set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE );
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(chinagat_irq_handler)
|
||||
};
|
||||
|
||||
/* This on the bootleg board, instead of the m6295 */
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
@ -596,8 +591,8 @@ static MACHINE_CONFIG_START( chinagat, ddragon_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.80)
|
||||
|
||||
@ -640,8 +635,8 @@ static MACHINE_CONFIG_START( saiyugoub1, ddragon_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.80)
|
||||
|
||||
|
@ -185,7 +185,7 @@ static ADDRESS_MAP_START( chqflag_sound_map, AS_PROGRAM, 8, chqflag_state )
|
||||
AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE_LEGACY("k007232_1", k007232_r, k007232_w) /* 007232 (chip 1) */
|
||||
AM_RANGE(0xa01c, 0xa01c) AM_WRITE(k007232_extvolume_w) /* extra volume, goes to the 007232 w/ A11 */
|
||||
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232_2", k007232_r, k007232_w) /* 007232 (chip 2) */
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) /* YM2151 */
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */
|
||||
AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
|
||||
AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch2_byte_r) /* engine sound volume */
|
||||
AM_RANGE(0xf000, 0xf000) AM_WRITENOP /* ??? */
|
||||
@ -256,18 +256,6 @@ INPUT_PORTS_END
|
||||
|
||||
|
||||
|
||||
static void chqflag_ym2151_irq_w( device_t *device, int data )
|
||||
{
|
||||
chqflag_state *state = device->machine().driver_data<chqflag_state>();
|
||||
state->m_audiocpu->set_input_line(INPUT_LINE_NMI, data ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(chqflag_ym2151_irq_w)
|
||||
};
|
||||
|
||||
static void volume_callback0( device_t *device, int v )
|
||||
{
|
||||
k007232_set_volume(device, 0, (v & 0x0f) * 0x11, 0);
|
||||
@ -385,8 +373,8 @@ static MACHINE_CONFIG_START( chqflag, chqflag_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
|
||||
|
@ -690,7 +690,7 @@ static ADDRESS_MAP_START( bigrun_sound_map, AS_PROGRAM, 16, cischeat_state )
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM
|
||||
AM_RANGE(0x040000, 0x040001) AM_READ(soundlatch_word_r) AM_WRITE(bigrun_soundbank_w) // From Main CPU
|
||||
AM_RANGE(0x060000, 0x060001) AM_WRITE(soundlatch2_word_w) // To Main CPU
|
||||
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r, ym2151_w, 0x00ff)
|
||||
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0f0000, 0x0fffff) AM_RAM // RAM
|
||||
@ -720,7 +720,7 @@ static ADDRESS_MAP_START( cischeat_sound_map, AS_PROGRAM, 16, cischeat_state )
|
||||
AM_RANGE(0x040004, 0x040005) AM_WRITE(cischeat_soundbank_2_w) // Sample Banking
|
||||
AM_RANGE(0x060002, 0x060003) AM_WRITE(soundlatch2_word_w) // To Main CPU
|
||||
AM_RANGE(0x060004, 0x060005) AM_READ(soundlatch_word_r) // From Main CPU
|
||||
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r, ym2151_w, 0x00ff)
|
||||
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0f0000, 0x0fffff) AM_RAM // RAM
|
||||
@ -736,7 +736,7 @@ static ADDRESS_MAP_START( f1gpstar_sound_map, AS_PROGRAM, 16, cischeat_state )
|
||||
AM_RANGE(0x040004, 0x040005) AM_WRITE(cischeat_soundbank_1_w) // Sample Banking (cischeat: 40002)
|
||||
AM_RANGE(0x040008, 0x040009) AM_WRITE(cischeat_soundbank_2_w) // Sample Banking (cischeat: 40004)
|
||||
AM_RANGE(0x060000, 0x060001) AM_READWRITE(soundlatch_word_r, soundlatch2_word_w) // From Main CPU (cischeat: 60004)
|
||||
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r, ym2151_w, 0x00ff)
|
||||
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0e0000, 0x0fffff) AM_RAM // RAM (cischeat: f0000-fffff)
|
||||
@ -753,7 +753,7 @@ static ADDRESS_MAP_START( f1gpstr2_sound_map, AS_PROGRAM, 16, cischeat_state )
|
||||
AM_RANGE(0x040008, 0x040009) AM_WRITE(cischeat_soundbank_2_w) // Sample Banking
|
||||
AM_RANGE(0x04000e, 0x04000f) AM_WRITENOP // ? 0 (f1gpstar: no)
|
||||
AM_RANGE(0x060004, 0x060005) AM_READWRITE(soundlatch_word_r, soundlatch2_word_w) // From Main CPU (f1gpstar: 60000)
|
||||
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r, ym2151_w, 0x00ff)
|
||||
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0e0000, 0x0fffff) AM_RAM // RAM
|
||||
@ -1594,7 +1594,7 @@ static MACHINE_CONFIG_START( bigrun, cischeat_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, STD_FM_CLOCK)
|
||||
MCFG_YM2151_ADD("ymsnd", STD_FM_CLOCK)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
|
||||
|
||||
|
@ -298,7 +298,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cninja_state )
|
||||
AM_RANGE(0x000000, 0x00ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x100001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ym2", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE("ym2", ym2151_device, read, write)
|
||||
AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
|
||||
AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write)
|
||||
AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r)
|
||||
@ -310,7 +310,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map_mutantf, AS_PROGRAM, 8, cninja_state )
|
||||
AM_RANGE(0x000000, 0x00ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x100001) AM_READNOP AM_WRITENOP
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
|
||||
AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write)
|
||||
AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r)
|
||||
@ -322,7 +322,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( stoneage_s_map, AS_PROGRAM, 8, cninja_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
|
||||
ADDRESS_MAP_END
|
||||
@ -703,35 +703,12 @@ GFXDECODE_END
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
static void sound_irq(device_t *device, int state)
|
||||
{
|
||||
cninja_state *driver_state = device->machine().driver_data<cninja_state>();
|
||||
driver_state->m_audiocpu->set_input_line(1, state); /* IRQ 2 */
|
||||
}
|
||||
|
||||
static void sound_irq2(device_t *device, int state)
|
||||
{
|
||||
cninja_state *driver_state = device->machine().driver_data<cninja_state>();
|
||||
driver_state->m_audiocpu->set_input_line(0, state);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(cninja_state::sound_bankswitch_w)
|
||||
{
|
||||
/* the second OKIM6295 ROM is bank switched */
|
||||
m_oki2->set_bank_base((data & 1) * 0x40000);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq),
|
||||
DEVCB_DRIVER_MEMBER(cninja_state,sound_bankswitch_w)
|
||||
};
|
||||
|
||||
static const ym2151_interface ym2151_interface2 =
|
||||
{
|
||||
DEVCB_LINE(sound_irq2)
|
||||
};
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
static int cninja_bank_callback( const int bank )
|
||||
@ -932,8 +909,9 @@ static MACHINE_CONFIG_START( cninja, cninja_state )
|
||||
MCFG_SOUND_ADD("ym1", YM2203, 32220000/8)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
|
||||
|
||||
MCFG_SOUND_ADD("ym2", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ym2", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) // IRQ2
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(cninja_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.45)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.45)
|
||||
|
||||
@ -984,8 +962,8 @@ static MACHINE_CONFIG_START( stoneage, cninja_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_interface2)
|
||||
MCFG_YM2151_ADD("ymsnd", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.45)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.45)
|
||||
|
||||
@ -1030,8 +1008,8 @@ static MACHINE_CONFIG_START( cninjabl, cninja_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_interface2)
|
||||
MCFG_YM2151_ADD("ymsnd", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.45)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.45)
|
||||
|
||||
@ -1080,8 +1058,9 @@ static MACHINE_CONFIG_START( edrandy, cninja_state )
|
||||
MCFG_SOUND_ADD("ym1", YM2203, 32220000/8)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
|
||||
|
||||
MCFG_SOUND_ADD("ym2", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ym2", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) // IRQ2
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(cninja_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.45)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.45)
|
||||
|
||||
@ -1134,8 +1113,9 @@ static MACHINE_CONFIG_START( robocop2, cninja_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.60)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.60)
|
||||
|
||||
MCFG_SOUND_ADD("ym2", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ym2", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) // IRQ2
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(cninja_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.45)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.45)
|
||||
|
||||
@ -1190,8 +1170,9 @@ static MACHINE_CONFIG_START( mutantf, cninja_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) // IRQ2
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(cninja_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.45)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.45)
|
||||
|
||||
|
@ -97,7 +97,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, contra_state )
|
||||
AM_RANGE(0x0000, 0x0000) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x4000, 0x4000) AM_WRITENOP /* read triggers irq reset and latch read (in the hardware only). */
|
||||
AM_RANGE(0x6000, 0x67ff) AM_RAM
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROM
|
||||
@ -217,7 +217,7 @@ static MACHINE_CONFIG_START( contra, contra_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_3_579545MHz)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.60)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -579,7 +579,7 @@ static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, cps_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
|
||||
AM_RANGE(0xd000, 0xd7ff) AM_RAM
|
||||
AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE_LEGACY("2151", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("2151", ym2151_device, read, write)
|
||||
AM_RANGE(0xf002, 0xf002) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0xf004, 0xf004) AM_WRITE(cps1_snd_bankswitch_w)
|
||||
AM_RANGE(0xf006, 0xf006) AM_WRITE(cps1_oki_pin7_w) /* controls pin 7 of OKI chip */
|
||||
@ -3008,19 +3008,6 @@ GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
static void cps1_irq_handler_mus(device_t *device, int irq)
|
||||
{
|
||||
cps_state *state = device->machine().driver_data<cps_state>();
|
||||
state->m_audiocpu->set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(cps1_irq_handler_mus)
|
||||
};
|
||||
|
||||
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
* Machine Driver macro
|
||||
@ -3079,8 +3066,8 @@ static MACHINE_CONFIG_START( cps1_10MHz, cps_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("2151", YM2151, XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("2151", XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.35)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.35)
|
||||
|
||||
@ -3237,8 +3224,8 @@ static MACHINE_CONFIG_START( sf2mdt, cps_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("2151", YM2151, 3579545)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("2151", 3579545)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.35)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.35)
|
||||
|
||||
@ -3321,8 +3308,8 @@ static MACHINE_CONFIG_START( knightsb, cps_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("2151", YM2151, 29821000 / 8)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("2151", 29821000 / 8)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.35)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.35)
|
||||
|
||||
|
@ -103,7 +103,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( crimfght_sound_map, AS_PROGRAM, 8, crimfght_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM 821l01.h4 */
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */
|
||||
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) /* YM2151 */
|
||||
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */
|
||||
AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
|
||||
AM_RANGE(0xe000, 0xe00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) /* 007232 registers */
|
||||
ADDRESS_MAP_END
|
||||
@ -223,12 +223,6 @@ INPUT_PORTS_END
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_NULL,
|
||||
DEVCB_DRIVER_MEMBER(crimfght_state,crimfght_snd_bankswitch_w)
|
||||
};
|
||||
|
||||
static void volume_callback( device_t *device, int v )
|
||||
{
|
||||
k007232_set_volume(device, 0, (v & 0x0f) * 0x11, 0);
|
||||
@ -306,8 +300,8 @@ static MACHINE_CONFIG_START( crimfght, crimfght_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(crimfght_state,crimfght_snd_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
|
@ -204,7 +204,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cyberbal_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_RAM
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x2800, 0x2801) AM_WRITE(cyberbal_sound_68k_6502_w)
|
||||
AM_RANGE(0x2802, 0x2803) AM_READWRITE_LEGACY(atarigen_6502_irq_ack_r, atarigen_6502_irq_ack_w)
|
||||
AM_RANGE(0x2804, 0x2805) AM_WRITE_LEGACY(atarigen_6502_sound_w)
|
||||
@ -405,19 +405,6 @@ GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Sound definitions
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(atarigen_ym2151_irq_gen)
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Machine driver
|
||||
@ -470,8 +457,8 @@ static MACHINE_CONFIG_START( cyberbal, cyberbal_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, ATARI_CLOCK_14MHz/4)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", ATARI_CLOCK_14MHz/4)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(atarigen_state, ym2151_irq_gen))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.60)
|
||||
|
||||
|
@ -250,8 +250,8 @@ static MACHINE_CONFIG_START( darkmist, darkmist_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 14318180/4) /* 3.579545 MHz */
|
||||
MCFG_SOUND_CONFIG(t5182_ym2151_interface)
|
||||
MCFG_YM2151_ADD("ymsnd", 14318180/4) /* 3.579545 MHz */
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<t5182_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 1.0)
|
||||
|
||||
|
@ -85,7 +85,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, darkseal_state )
|
||||
AM_RANGE(0x000000, 0x00ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x100001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ym2", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE("ym2", ym2151_device, read, write)
|
||||
AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
|
||||
AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write)
|
||||
AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r)
|
||||
@ -222,16 +222,6 @@ GFXDECODE_END
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static void sound_irq(device_t *device, int state)
|
||||
{
|
||||
device->machine().device("audiocpu")->execute().set_input_line(1, state); /* IRQ 2 */
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq)
|
||||
};
|
||||
|
||||
static const deco16ic_interface darkseal_deco16ic_tilegen1_intf =
|
||||
{
|
||||
"screen",
|
||||
@ -297,8 +287,8 @@ static MACHINE_CONFIG_START( darkseal, darkseal_state )
|
||||
MCFG_SOUND_ADD("ym1", YM2203, 32220000/8)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45)
|
||||
|
||||
MCFG_SOUND_ADD("ym2", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ym2", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) // IRQ2
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.55)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.55)
|
||||
|
||||
|
@ -262,7 +262,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, dassault_state )
|
||||
AM_RANGE(0x000000, 0x00ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x100001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ym2", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE("ym2", ym2151_device, read, write)
|
||||
AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
|
||||
AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write)
|
||||
AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r)
|
||||
@ -445,12 +445,6 @@ GFXDECODE_END
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
static void sound_irq(device_t *device, int state)
|
||||
{
|
||||
dassault_state *driver_state = device->machine().driver_data<dassault_state>();
|
||||
driver_state->m_audiocpu->set_input_line(1, state);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(dassault_state::sound_bankswitch_w)
|
||||
{
|
||||
|
||||
@ -458,12 +452,6 @@ WRITE8_MEMBER(dassault_state::sound_bankswitch_w)
|
||||
m_oki2->set_bank_base((data & 1) * 0x40000);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq),
|
||||
DEVCB_DRIVER_MEMBER(dassault_state,sound_bankswitch_w)
|
||||
};
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
static const decocomn_interface dassault_decocomn_intf =
|
||||
@ -552,8 +540,9 @@ static MACHINE_CONFIG_START( dassault, dassault_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.40)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.40)
|
||||
|
||||
MCFG_SOUND_ADD("ym2", YM2151, XTAL_32_22MHz/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ym2", XTAL_32_22MHz/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(dassault_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.45)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.45)
|
||||
|
||||
|
@ -77,6 +77,7 @@ public:
|
||||
cpu_device *m_maincpu;
|
||||
cpu_device *m_audiocpu;
|
||||
device_t *m_deco_tilegen1;
|
||||
DECLARE_WRITE_LINE_MEMBER(sound_irq);
|
||||
DECLARE_READ16_MEMBER(dblewing_prot_r);
|
||||
DECLARE_WRITE16_MEMBER(dblewing_prot_w);
|
||||
DECLARE_READ8_MEMBER(irq_latch_r);
|
||||
@ -351,7 +352,7 @@ READ8_MEMBER(dblewing_state::irq_latch_r)
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, dblewing_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_status_port_r,ym2151_w)
|
||||
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, status_r, write)
|
||||
AM_RANGE(0xb000, 0xb000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0xd000, 0xd000) AM_READ(irq_latch_r) //timing? sound latch?
|
||||
@ -530,23 +531,16 @@ static INPUT_PORTS_START( dblewing )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static void sound_irq( device_t *device, int state )
|
||||
WRITE_LINE_MEMBER(dblewing_state::sound_irq)
|
||||
{
|
||||
dblewing_state *driver_state = device->machine().driver_data<dblewing_state>();
|
||||
|
||||
/* bit 0 of dblewing_sound_irq specifies IRQ from sound chip */
|
||||
if (state)
|
||||
driver_state->m_sound_irq |= 0x01;
|
||||
m_sound_irq |= 0x01;
|
||||
else
|
||||
driver_state->m_sound_irq &= ~0x01;
|
||||
driver_state->m_audiocpu->set_input_line(0, (driver_state->m_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
|
||||
m_sound_irq &= ~0x01;
|
||||
m_audiocpu->set_input_line(0, (m_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq)
|
||||
};
|
||||
|
||||
static int dblewing_bank_callback( const int bank )
|
||||
{
|
||||
return ((bank >> 4) & 0x7) * 0x1000;
|
||||
@ -669,8 +663,8 @@ static MACHINE_CONFIG_START( dblewing, dblewing_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(dblewing_state, sound_irq))
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
|
||||
MCFG_OKIM6295_ADD("oki", 32220000/32, OKIM6295_PIN7_HIGH)
|
||||
|
@ -104,12 +104,6 @@ WRITE16_MEMBER(dbz_state::dbz_sound_cause_nmi)
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static void dbz_sound_irq( device_t *device, int irq )
|
||||
{
|
||||
dbz_state *state = device->machine().driver_data<dbz_state>();
|
||||
|
||||
state->m_audiocpu->set_input_line(0, (irq) ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( dbz_map, AS_PROGRAM, 16, dbz_state )
|
||||
AM_RANGE(0x000000, 0x0fffff) AM_ROM
|
||||
@ -151,7 +145,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( dbz_sound_map, AS_PROGRAM, 8, dbz_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0xbfff) AM_RAM
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xd000, 0xd002) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0xe000, 0xe001) AM_READ(soundlatch_byte_r)
|
||||
ADDRESS_MAP_END
|
||||
@ -278,13 +272,6 @@ INPUT_PORTS_END
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(dbz_sound_irq)
|
||||
};
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
static const gfx_layout bglayout =
|
||||
{
|
||||
16,16,
|
||||
@ -413,8 +400,8 @@ static MACHINE_CONFIG_START( dbz, dbz_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
|
@ -330,10 +330,9 @@ WRITE8_MEMBER(ddragon_state::ddragon2_sub_irq_w)
|
||||
}
|
||||
|
||||
|
||||
static void irq_handler( device_t *device, int irq )
|
||||
WRITE_LINE_MEMBER(ddragon_state::irq_handler)
|
||||
{
|
||||
ddragon_state *state = device->machine().driver_data<ddragon_state>();
|
||||
state->m_snd_cpu->execute().set_input_line(state->m_ym_irq , irq ? ASSERT_LINE : CLEAR_LINE );
|
||||
m_snd_cpu->execute().set_input_line(m_ym_irq , state ? ASSERT_LINE : CLEAR_LINE );
|
||||
}
|
||||
|
||||
|
||||
@ -578,7 +577,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, ddragon_state )
|
||||
AM_RANGE(0x0000, 0x0fff) AM_RAM
|
||||
AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x1800, 0x1800) AM_READ(dd_adpcm_status_r)
|
||||
AM_RANGE(0x2800, 0x2801) AM_DEVREADWRITE_LEGACY("fmsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x2800, 0x2801) AM_DEVREADWRITE("fmsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x3800, 0x3807) AM_WRITE(dd_adpcm_w)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
@ -587,7 +586,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( dd2_sound_map, AS_PROGRAM, 8, ddragon_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("fmsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("fmsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_byte_r)
|
||||
ADDRESS_MAP_END
|
||||
@ -941,11 +940,6 @@ GFXDECODE_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(irq_handler)
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
dd_adpcm_int, /* interrupt function */
|
||||
@ -991,8 +985,8 @@ static MACHINE_CONFIG_START( ddragon, ddragon_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("fmsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("fmsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(ddragon_state,irq_handler))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.60)
|
||||
|
||||
@ -1054,8 +1048,8 @@ static MACHINE_CONFIG_START( ddragon6809, ddragon_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("fmsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("fmsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(ddragon_state,irq_handler))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.60)
|
||||
|
||||
@ -1100,8 +1094,8 @@ static MACHINE_CONFIG_START( ddragon2, ddragon_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("fmsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("fmsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(ddragon_state,irq_handler))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.60)
|
||||
|
||||
|
@ -256,7 +256,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, ddragon3_state )
|
||||
AM_RANGE(0x0000, 0xbfff) AM_ROM
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_RAM
|
||||
AM_RANGE(0xc800, 0xc801) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xc800, 0xc801) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
|
||||
AM_RANGE(0xd800, 0xd800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0xe800, 0xe800) AM_WRITE(oki_bankswitch_w)
|
||||
@ -265,7 +265,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( ctribe_sound_map, AS_PROGRAM, 8, ddragon3_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_status_port_r, ym2151_w)
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ym2151", ym2151_device, status_r, write)
|
||||
AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
|
||||
ADDRESS_MAP_END
|
||||
@ -508,22 +508,6 @@ static GFXDECODE_START( ddragon3 )
|
||||
GFXDECODE_ENTRY( "gfx2", 0, sprite_layout, 0, 16 )
|
||||
GFXDECODE_END
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Sound Interfaces
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void dd3_ymirq_handler(device_t *device, int irq)
|
||||
{
|
||||
ddragon3_state *state = device->machine().driver_data<ddragon3_state>();
|
||||
state->m_audiocpu->set_input_line(0 , irq ? ASSERT_LINE : CLEAR_LINE );
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(dd3_ymirq_handler)
|
||||
};
|
||||
|
||||
/*************************************
|
||||
*
|
||||
@ -610,8 +594,8 @@ static MACHINE_CONFIG_START( ddragon3, ddragon3_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ym2151", YM2151, XTAL_3_579545MHz)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ym2151", XTAL_3_579545MHz)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
|
||||
|
||||
|
@ -1004,7 +1004,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, deco32_state )
|
||||
AM_RANGE(0x000000, 0x00ffff) AM_ROM
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
|
||||
AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write)
|
||||
AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r)
|
||||
@ -1024,7 +1024,7 @@ READ8_MEMBER(deco32_state::latch_r)
|
||||
static ADDRESS_MAP_START( nslasher_sound, AS_PROGRAM, 8, deco32_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xb000, 0xb000) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
|
||||
AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE("oki2", okim6295_device, read, write)
|
||||
AM_RANGE(0xd000, 0xd000) AM_READ(latch_r)
|
||||
@ -1621,20 +1621,14 @@ GFXDECODE_END
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
static void sound_irq(device_t *device, int state)
|
||||
WRITE_LINE_MEMBER(deco32_state::sound_irq_nslasher)
|
||||
{
|
||||
device->machine().device("audiocpu")->execute().set_input_line(1, state); /* IRQ 2 */
|
||||
}
|
||||
|
||||
static void sound_irq_nslasher(device_t *device, int state)
|
||||
{
|
||||
deco32_state *drvstate = device->machine().driver_data<deco32_state>();
|
||||
/* bit 0 of nslasher_sound_irq specifies IRQ from sound chip */
|
||||
if (state)
|
||||
drvstate->m_nslasher_sound_irq |= 0x01;
|
||||
m_nslasher_sound_irq |= 0x01;
|
||||
else
|
||||
drvstate->m_nslasher_sound_irq &= ~0x01;
|
||||
device->machine().device("audiocpu")->execute().set_input_line(0, (drvstate->m_nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
|
||||
m_nslasher_sound_irq &= ~0x01;
|
||||
subdevice("audiocpu")->execute().set_input_line(0, (m_nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(deco32_state::sound_bankswitch_w)
|
||||
@ -1645,18 +1639,6 @@ WRITE8_MEMBER(deco32_state::sound_bankswitch_w)
|
||||
oki2->set_bank_base(((data >> 1)& 1) * 0x40000);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq),
|
||||
DEVCB_DRIVER_MEMBER(deco32_state,sound_bankswitch_w)
|
||||
};
|
||||
|
||||
static const ym2151_interface ym2151_interface_nslasher =
|
||||
{
|
||||
DEVCB_LINE(sound_irq_nslasher),
|
||||
DEVCB_DRIVER_MEMBER(deco32_state,sound_bankswitch_w)
|
||||
};
|
||||
|
||||
static const eeprom_interface eeprom_interface_tattass =
|
||||
{
|
||||
10, // address bits 10 ==> } 1024 byte eprom
|
||||
@ -1767,8 +1749,9 @@ static MACHINE_CONFIG_START( captaven, deco32_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_32_22MHz/9) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_32_22MHz/9) /* verified on pcb */
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(deco32_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.42)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.42)
|
||||
|
||||
@ -1815,8 +1798,9 @@ static MACHINE_CONFIG_START( fghthist, deco32_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(deco32_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.42)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.42)
|
||||
|
||||
@ -1861,8 +1845,9 @@ static MACHINE_CONFIG_START( fghthsta, deco32_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(deco32_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.42)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.42)
|
||||
|
||||
@ -1974,8 +1959,9 @@ static MACHINE_CONFIG_START( dragngun, dragngun_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(deco32_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.42)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.42)
|
||||
|
||||
@ -2049,8 +2035,9 @@ static MACHINE_CONFIG_START( lockload, dragngun_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_interface_nslasher)
|
||||
MCFG_YM2151_ADD("ymsnd", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(deco32_state,sound_irq_nslasher))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(deco32_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.42)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.42)
|
||||
|
||||
@ -2068,7 +2055,7 @@ static MACHINE_CONFIG_DERIVED( lockloadu, lockload )
|
||||
MCFG_CPU_PROGRAM_MAP(sound_map)
|
||||
|
||||
MCFG_SOUND_MODIFY("ymsnd")
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1))
|
||||
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
@ -2176,8 +2163,9 @@ static MACHINE_CONFIG_START( nslasher, deco32_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_interface_nslasher)
|
||||
MCFG_YM2151_ADD("ymsnd", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(deco32_state,sound_irq_nslasher))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(deco32_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.40)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.40)
|
||||
|
||||
|
@ -34,7 +34,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, dietgo_state )
|
||||
AM_RANGE(0x000000, 0x00ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x100001) AM_NOP /* YM2203 - this board doesn't have one */
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0x130000, 0x130001) AM_NOP /* This board only has 1 oki chip */
|
||||
AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r)
|
||||
@ -160,18 +160,6 @@ static GFXDECODE_START( dietgo )
|
||||
GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 512, 16 ) /* Sprites (16x16) */
|
||||
GFXDECODE_END
|
||||
|
||||
static void sound_irq(device_t *device, int state)
|
||||
{
|
||||
dietgo_state *driver_state = device->machine().driver_data<dietgo_state>();
|
||||
driver_state->m_audiocpu->set_input_line(1, state); /* IRQ 2 */
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq)
|
||||
};
|
||||
|
||||
|
||||
static int dietgo_bank_callback(const int bank)
|
||||
{
|
||||
return ((bank >> 4) & 0x7) * 0x1000;
|
||||
@ -235,8 +223,8 @@ static MACHINE_CONFIG_START( dietgo, dietgo_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_32_22MHz/9) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_32_22MHz/9) /* verified on pcb */
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) /* IRQ 2 */
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45)
|
||||
|
||||
MCFG_OKIM6295_ADD("oki", XTAL_32_22MHz/32, OKIM6295_PIN7_HIGH) /* verified on pcb */
|
||||
|
@ -303,7 +303,7 @@ static ADDRESS_MAP_START( bluehawk_sound_map, AS_PROGRAM, 8, dooyong_state )
|
||||
AM_RANGE(0x0000, 0xefff) AM_ROM
|
||||
AM_RANGE(0xf000, 0xf7ff) AM_RAM
|
||||
AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0xf808, 0xf809) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xf808, 0xf809) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xf80a, 0xf80a) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -773,11 +773,6 @@ READ8_MEMBER(dooyong_state::unk_r)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void irqhandler(device_t *device, int irq)
|
||||
{
|
||||
device->machine().device("audiocpu")->execute().set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static void irqhandler_2203_1(device_t *device, int irq)
|
||||
{
|
||||
dooyong_state *state = device->machine().driver_data<dooyong_state>();
|
||||
@ -812,11 +807,6 @@ static const ym2203_interface ym2203_interface_2 =
|
||||
DEVCB_LINE(irqhandler_2203_2)
|
||||
};
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(irqhandler)
|
||||
};
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Machine driver(s)
|
||||
@ -839,8 +829,8 @@ MACHINE_CONFIG_END
|
||||
static MACHINE_CONFIG_FRAGMENT( sound_2151 )
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
|
||||
@ -851,8 +841,8 @@ MACHINE_CONFIG_END
|
||||
static MACHINE_CONFIG_FRAGMENT( sound_2151_m68k )
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
|
||||
|
@ -203,9 +203,9 @@ TIMER_DEVICE_CALLBACK_MEMBER(exterm_state::master_sound_nmi_callback)
|
||||
|
||||
WRITE8_MEMBER(exterm_state::ym2151_data_latch_w)
|
||||
{
|
||||
device_t *device = machine().device("ymsnd");
|
||||
ym2151_device *device = machine().device<ym2151_device>("ymsnd");
|
||||
/* bit 7 of the sound control selects which port */
|
||||
ym2151_w(device, space, m_sound_control >> 7, data);
|
||||
device->write(space, m_sound_control >> 7, data);
|
||||
}
|
||||
|
||||
|
||||
@ -472,7 +472,7 @@ static MACHINE_CONFIG_START( exterm, exterm_state )
|
||||
MCFG_DAC_ADD("dac")
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
@ -175,7 +175,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, exzisus_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x8fff) AM_RAM
|
||||
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xa000, 0xa000) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
|
||||
AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
|
||||
ADDRESS_MAP_END
|
||||
@ -252,17 +252,6 @@ GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
static void irqhandler(device_t *device, int irq)
|
||||
{
|
||||
device->machine().device("audiocpu")->execute().set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(irqhandler)
|
||||
};
|
||||
|
||||
|
||||
static const tc0140syt_interface exzisus_tc0140syt_intf =
|
||||
{
|
||||
"cpub", "audiocpu"
|
||||
@ -305,8 +294,8 @@ static MACHINE_CONFIG_START( exzisus, exzisus_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
|
||||
|
@ -75,13 +75,13 @@ READ32_MEMBER(mosaicf2_state::f32_input_port_1_r)
|
||||
|
||||
static ADDRESS_MAP_START( mosaicf2_io, AS_IO, 32, mosaicf2_state )
|
||||
AM_RANGE(0x4000, 0x4003) AM_DEVREAD8("oki", okim6295_device, read, 0x000000ff)
|
||||
AM_RANGE(0x4810, 0x4813) AM_DEVREAD8_LEGACY("ymsnd", ym2151_status_port_r, 0x000000ff)
|
||||
AM_RANGE(0x4810, 0x4813) AM_DEVREAD8("ymsnd", ym2151_device, status_r, 0x000000ff)
|
||||
AM_RANGE(0x5000, 0x5003) AM_READ_PORT("P1")
|
||||
AM_RANGE(0x5200, 0x5203) AM_READ(f32_input_port_1_r)
|
||||
AM_RANGE(0x5400, 0x5403) AM_READ_PORT("EEPROMIN")
|
||||
AM_RANGE(0x6000, 0x6003) AM_DEVWRITE8("oki", okim6295_device, write, 0x000000ff)
|
||||
AM_RANGE(0x6800, 0x6803) AM_DEVWRITE8_LEGACY("ymsnd", ym2151_data_port_w, 0x000000ff)
|
||||
AM_RANGE(0x6810, 0x6813) AM_DEVWRITE8_LEGACY("ymsnd", ym2151_register_port_w, 0x000000ff)
|
||||
AM_RANGE(0x6800, 0x6803) AM_DEVWRITE8("ymsnd", ym2151_device, data_w, 0x000000ff)
|
||||
AM_RANGE(0x6810, 0x6813) AM_DEVWRITE8("ymsnd", ym2151_device, register_w, 0x000000ff)
|
||||
AM_RANGE(0x7000, 0x7003) AM_WRITE_PORT("EEPROMCLK")
|
||||
AM_RANGE(0x7200, 0x7203) AM_WRITE_PORT("EEPROMCS")
|
||||
AM_RANGE(0x7400, 0x7403) AM_WRITE_PORT("EEPROMOUT")
|
||||
@ -155,7 +155,7 @@ static MACHINE_CONFIG_START( mosaicf2, mosaicf2_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 14318180/4)
|
||||
MCFG_YM2151_ADD("ymsnd", 14318180/4)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
|
@ -293,13 +293,13 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( fantland_sound_iomap, AS_IO, 8, fantland_state )
|
||||
AM_RANGE( 0x0080, 0x0080 ) AM_READ(soundlatch_byte_r )
|
||||
AM_RANGE( 0x0100, 0x0101 ) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w )
|
||||
AM_RANGE( 0x0100, 0x0101 ) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE( 0x0180, 0x0180 ) AM_DEVWRITE("dac", dac_device, write_unsigned8 )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( galaxygn_sound_iomap, AS_IO, 8, fantland_state )
|
||||
AM_RANGE( 0x0080, 0x0080 ) AM_READ(soundlatch_byte_r )
|
||||
AM_RANGE( 0x0100, 0x0101 ) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w )
|
||||
AM_RANGE( 0x0100, 0x0101 ) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
@ -873,7 +873,7 @@ static MACHINE_CONFIG_START( fantland, fantland_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3000000)
|
||||
MCFG_YM2151_ADD("ymsnd", 3000000)
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.35)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.35)
|
||||
|
||||
@ -882,17 +882,11 @@ static MACHINE_CONFIG_START( fantland, fantland_state )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
static void galaxygn_sound_irq( device_t *device, int line )
|
||||
WRITE_LINE_MEMBER(fantland_state::galaxygn_sound_irq)
|
||||
{
|
||||
fantland_state *state = device->machine().driver_data<fantland_state>();
|
||||
state->m_audio_cpu->execute().set_input_line_and_vector(0, line ? ASSERT_LINE : CLEAR_LINE, 0x80/4);
|
||||
m_audio_cpu->execute().set_input_line_and_vector(0, state ? ASSERT_LINE : CLEAR_LINE, 0x80/4);
|
||||
}
|
||||
|
||||
static const ym2151_interface galaxygn_ym2151_interface =
|
||||
{
|
||||
DEVCB_LINE(galaxygn_sound_irq)
|
||||
};
|
||||
|
||||
static MACHINE_CONFIG_START( galaxygn, fantland_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
@ -922,8 +916,8 @@ static MACHINE_CONFIG_START( galaxygn, fantland_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3000000)
|
||||
MCFG_SOUND_CONFIG(galaxygn_ym2151_interface)
|
||||
MCFG_YM2151_ADD("ymsnd", 3000000)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(fantland_state, galaxygn_sound_irq))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -801,7 +801,7 @@ static MACHINE_CONFIG_START( kodb, cps_state )
|
||||
/* sound hardware */
|
||||
// MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
// MCFG_SOUND_ADD("2151", YM2151, 3579545)
|
||||
// MCFG_YM2151_ADD("2151", 3579545)
|
||||
// MCFG_SOUND_CONFIG(ym2151_config)
|
||||
// MCFG_SOUND_ROUTE(0, "mono", 0.35)
|
||||
// MCFG_SOUND_ROUTE(1, "mono", 0.35)
|
||||
|
@ -111,7 +111,7 @@ static ADDRESS_MAP_START( flkatck_sound_map, AS_PROGRAM, 8, flkatck_state )
|
||||
AM_RANGE(0x9006, 0x9006) AM_WRITENOP /* ??? */
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
|
||||
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("konami", k007232_r, k007232_w) /* 007232 registers */
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) /* YM2151 */
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
@ -246,7 +246,7 @@ static MACHINE_CONFIG_START( flkatck, flkatck_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
|
@ -121,7 +121,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, funkyjet_state )
|
||||
AM_RANGE(0x000000, 0x00ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x100001) AM_NOP /* YM2203 - this board doesn't have one */
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0x130000, 0x130001) AM_NOP /* This board only has 1 oki chip */
|
||||
AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r)
|
||||
@ -275,17 +275,6 @@ GFXDECODE_END
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static void sound_irq( device_t *device, int state )
|
||||
{
|
||||
funkyjet_state *driver_state = device->machine().driver_data<funkyjet_state>();
|
||||
driver_state->m_audiocpu->set_input_line(1, state); /* IRQ 2 */
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq)
|
||||
};
|
||||
|
||||
static const deco16ic_interface funkyjet_deco16ic_tilegen1_intf =
|
||||
{
|
||||
"screen",
|
||||
@ -336,8 +325,8 @@ static MACHINE_CONFIG_START( funkyjet, funkyjet_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_32_22MHz/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_32_22MHz/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) // IRQ2
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.45)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.45)
|
||||
|
||||
|
@ -448,7 +448,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( drgnbowl_sound_port_map, AS_IO, 8, gaiden_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_byte_r)
|
||||
ADDRESS_MAP_END
|
||||
@ -845,7 +845,7 @@ static MACHINE_CONFIG_START( drgnbowl, gaiden_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
|
||||
|
||||
MCFG_OKIM6295_ADD("oki", 1000000, OKIM6295_PIN7_HIGH)
|
||||
|
@ -347,7 +347,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gauntlet_state )
|
||||
AM_RANGE(0x1020, 0x102f) AM_MIRROR(0x27c0) AM_READ_PORT("COIN") AM_WRITE(mixer_w)
|
||||
AM_RANGE(0x1030, 0x103f) AM_MIRROR(0x27c0) AM_READWRITE(switch_6502_r, sound_ctl_w)
|
||||
AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x27c0) AM_DEVREADWRITE("pokey", pokey_device, read, write)
|
||||
AM_RANGE(0x1810, 0x1811) AM_MIRROR(0x27ce) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x1810, 0x1811) AM_MIRROR(0x27ce) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x1820, 0x182f) AM_MIRROR(0x27c0) AM_DEVWRITE_LEGACY("tms", tms5220_data_w)
|
||||
AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x27c0) AM_READWRITE_LEGACY(atarigen_6502_irq_ack_r, atarigen_6502_irq_ack_w)
|
||||
AM_RANGE(0x4000, 0xffff) AM_ROM
|
||||
@ -539,7 +539,7 @@ static MACHINE_CONFIG_START( gauntlet, gauntlet_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, ATARI_CLOCK_14MHz/4)
|
||||
MCFG_YM2151_ADD("ymsnd", ATARI_CLOCK_14MHz/4)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 0.48)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 0.48)
|
||||
|
||||
|
@ -173,8 +173,8 @@ static ADDRESS_MAP_START( gbusters_sound_map, AS_PROGRAM, 8, gbusters_state )
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
|
||||
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) /* 007232 registers */
|
||||
AM_RANGE(0xc001, 0xc001) AM_DEVREAD_LEGACY("ymsnd", ym2151_status_port_r) /* YM 2151 */
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) /* YM 2151 */
|
||||
AM_RANGE(0xc001, 0xc001) AM_DEVREAD("ymsnd", ym2151_device, status_r) /* YM 2151 */
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM 2151 */
|
||||
AM_RANGE(0xf000, 0xf000) AM_WRITE(gbusters_snd_bankswitch_w) /* 007232 bankswitch? */
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -327,7 +327,7 @@ static MACHINE_CONFIG_START( gbusters, gbusters_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.60)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.60)
|
||||
|
||||
|
@ -119,7 +119,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gotcha_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xc002, 0xc002) AM_DEVREADWRITE("oki", okim6295_device, read, write) AM_MIRROR(1)
|
||||
AM_RANGE(0xc006, 0xc006) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0xd000, 0xd7ff) AM_RAM
|
||||
@ -238,18 +238,6 @@ GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
static void irqhandler( device_t *device, int linestate )
|
||||
{
|
||||
gotcha_state *state = device->machine().driver_data<gotcha_state>();
|
||||
state->m_audiocpu->set_input_line(0, linestate);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(irqhandler)
|
||||
};
|
||||
|
||||
|
||||
void gotcha_state::machine_start()
|
||||
{
|
||||
|
||||
@ -306,8 +294,8 @@ static MACHINE_CONFIG_START( gotcha, gotcha_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 14318180/4)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 14318180/4)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.80)
|
||||
|
||||
|
@ -192,7 +192,7 @@ static ADDRESS_MAP_START( gradius3_s_map, AS_PROGRAM, 8, gradius3_state )
|
||||
AM_RANGE(0xf000, 0xf000) AM_WRITE(sound_bank_w) /* 007232 bankswitch */
|
||||
AM_RANGE(0xf010, 0xf010) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0xf020, 0xf02d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w)
|
||||
AM_RANGE(0xf030, 0xf031) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xf030, 0xf031) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xf800, 0xffff) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -348,7 +348,7 @@ static MACHINE_CONFIG_START( gradius3, gradius3_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
|
@ -444,7 +444,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( hyprduel_map2, AS_PROGRAM, 16, hyprduel_state )
|
||||
AM_RANGE(0x000000, 0x003fff) AM_RAM AM_SHARE("sharedram1") /* shadow ($c00000 - $c03fff : vector) */
|
||||
AM_RANGE(0x004000, 0x007fff) AM_READONLY AM_WRITENOP AM_SHARE("sharedram3") /* shadow ($fe4000 - $fe7fff : read only) */
|
||||
AM_RANGE(0x400000, 0x400003) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r, ym2151_w, 0x00ff )
|
||||
AM_RANGE(0x400000, 0x400003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff )
|
||||
AM_RANGE(0x400004, 0x400005) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x800000, 0x800001) AM_NOP
|
||||
AM_RANGE(0xc00000, 0xc07fff) AM_RAM AM_SHARE("sharedram1")
|
||||
@ -612,21 +612,6 @@ static GFXDECODE_START( 14220 )
|
||||
GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x8h, 0x0, 0x20 ) // [1] 8 Bit Tiles
|
||||
GFXDECODE_END
|
||||
|
||||
/***************************************************************************
|
||||
Sound Communication
|
||||
***************************************************************************/
|
||||
|
||||
static void sound_irq( device_t *device, int state )
|
||||
{
|
||||
hyprduel_state *hyprduel = device->machine().driver_data<hyprduel_state>();
|
||||
hyprduel->m_subcpu->set_input_line(1, HOLD_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq)
|
||||
};
|
||||
|
||||
/***************************************************************************
|
||||
Machine Drivers
|
||||
***************************************************************************/
|
||||
@ -693,8 +678,8 @@ static MACHINE_CONFIG_START( hyprduel, hyprduel_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("sub", 1))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
|
||||
|
@ -175,7 +175,7 @@ static ADDRESS_MAP_START( master_map, AS_PROGRAM, 8, jackal_state )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( slave_map, AS_PROGRAM, 8, jackal_state )
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x4000, 0x43ff) AM_RAM AM_SHARE("paletteram") // self test only checks 0x4000-0x423f, 007327 should actually go up to 4fff
|
||||
AM_RANGE(0x6000, 0x605f) AM_RAM // SOUND RAM (Self test check 0x6000-605f, 0x7c00-0x7fff)
|
||||
AM_RANGE(0x6060, 0x7fff) AM_RAM AM_SHARE("share1")
|
||||
@ -380,7 +380,7 @@ static MACHINE_CONFIG_START( jackal, jackal_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK) // verified on pcb
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK) // verified on pcb
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -711,7 +711,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( blazeon_soundport, AS_IO, 8, kaneko16_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x02, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x02, 0x03) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x06, 0x06) AM_READ(soundlatch_byte_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -1796,7 +1796,7 @@ static MACHINE_CONFIG_START( blazeon, kaneko16_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -112,7 +112,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, lemmings_state )
|
||||
AM_RANGE(0x0000, 0x07ff) AM_RAM
|
||||
AM_RANGE(0x0800, 0x0801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w)
|
||||
AM_RANGE(0x0800, 0x0801) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
|
||||
AM_RANGE(0x1000, 0x1000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_byte_r) AM_WRITE(lemmings_sound_ack_w)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROM
|
||||
@ -241,17 +241,6 @@ GFXDECODE_END
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static void sound_irq( device_t *device, int state )
|
||||
{
|
||||
lemmings_state *lemmings = device->machine().driver_data<lemmings_state>();
|
||||
lemmings->m_audiocpu->set_input_line(0, state);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq)
|
||||
};
|
||||
|
||||
void lemmings_state::machine_start()
|
||||
{
|
||||
|
||||
@ -295,8 +284,8 @@ static MACHINE_CONFIG_START( lemmings, lemmings_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 32220000/9)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 32220000/9)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.45)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.45)
|
||||
|
||||
|
@ -181,7 +181,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 16, m107_state )
|
||||
AM_RANGE(0x00000, 0x1ffff) AM_ROM
|
||||
AM_RANGE(0xa0000, 0xa3fff) AM_RAM
|
||||
AM_RANGE(0xa8000, 0xa803f) AM_DEVREADWRITE8_LEGACY("irem", irem_ga20_r, irem_ga20_w, 0x00ff)
|
||||
AM_RANGE(0xa8040, 0xa8043) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r, ym2151_w, 0x00ff)
|
||||
AM_RANGE(0xa8040, 0xa8043) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
|
||||
AM_RANGE(0xa8044, 0xa8045) AM_READWRITE(m107_soundlatch_r, m107_sound_irq_ack_w)
|
||||
AM_RANGE(0xa8046, 0xa8047) AM_WRITE(m107_sound_status_w)
|
||||
AM_RANGE(0xffff0, 0xfffff) AM_ROM AM_REGION("soundcpu", 0x1fff0)
|
||||
@ -753,18 +753,6 @@ GFXDECODE_END
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
static void sound_irq(device_t *device, int state)
|
||||
{
|
||||
device->machine().device("soundcpu")->execute().set_input_line(NEC_INPUT_LINE_INTP0, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq)
|
||||
};
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
static const nec_config firebarr_config ={ rtypeleo_decryption_table, };
|
||||
|
||||
static MACHINE_CONFIG_START( firebarr, m107_state )
|
||||
@ -796,8 +784,8 @@ static MACHINE_CONFIG_START( firebarr, m107_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 14318180/4)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 14318180/4)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", NEC_INPUT_LINE_INTP0))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.40)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.40)
|
||||
|
||||
|
@ -1043,7 +1043,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( rtype_sound_portmap, AS_IO, 8, m72_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w)
|
||||
AM_RANGE(0x84, 0x84) AM_DEVREAD_LEGACY("m72", m72_sample_r)
|
||||
@ -1051,7 +1051,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, m72_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w)
|
||||
AM_RANGE(0x82, 0x82) AM_DEVWRITE_LEGACY("m72", m72_sample_w)
|
||||
@ -1060,7 +1060,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( rtype2_sound_portmap, AS_IO, 8, m72_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("m72", rtype2_sample_addr_w)
|
||||
AM_RANGE(0x82, 0x82) AM_DEVWRITE_LEGACY("m72", m72_sample_w)
|
||||
@ -1072,7 +1072,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( poundfor_sound_portmap, AS_IO, 8, m72_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x10, 0x13) AM_DEVWRITE_LEGACY("m72", poundfor_sample_addr_w)
|
||||
AM_RANGE(0x40, 0x41) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x40, 0x41) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x42, 0x42) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x42, 0x42) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w)
|
||||
ADDRESS_MAP_END
|
||||
@ -1791,13 +1791,6 @@ GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(m72_ym2151_irq_handler)
|
||||
};
|
||||
|
||||
|
||||
|
||||
static MACHINE_CONFIG_START( m72_base, m72_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
@ -1827,8 +1820,8 @@ static MACHINE_CONFIG_START( m72_base, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
@ -1882,8 +1875,8 @@ static MACHINE_CONFIG_START( rtype, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
@ -1919,8 +1912,8 @@ static MACHINE_CONFIG_START( xmultipl, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
@ -1960,8 +1953,8 @@ static MACHINE_CONFIG_START( xmultiplm72, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
@ -2001,8 +1994,8 @@ static MACHINE_CONFIG_START( dbreed, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
@ -2042,8 +2035,8 @@ static MACHINE_CONFIG_START( dbreedm72, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
@ -2083,8 +2076,8 @@ static MACHINE_CONFIG_START( rtype2, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
@ -2124,8 +2117,8 @@ static MACHINE_CONFIG_START( majtitle, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
@ -2165,8 +2158,8 @@ static MACHINE_CONFIG_START( hharry, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
@ -2206,8 +2199,8 @@ static MACHINE_CONFIG_START( hharryu, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
@ -2247,8 +2240,8 @@ static MACHINE_CONFIG_START( dkgenm72, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
@ -2288,8 +2281,8 @@ static MACHINE_CONFIG_START( poundfor, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
@ -2329,8 +2322,8 @@ static MACHINE_CONFIG_START( cosmccop, m72_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0);
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
|
@ -129,7 +129,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( m90_sound_cpu_io_map, AS_IO, 8, m90_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("m72", rtype2_sample_addr_w)
|
||||
AM_RANGE(0x82, 0x82) AM_DEVWRITE_LEGACY("m72", m72_sample_w)
|
||||
@ -139,7 +139,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( dynablsb_sound_cpu_io_map, AS_IO, 8, m90_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x82, 0x82) AM_DEVWRITE("dac", dac_device, write_signed8)
|
||||
ADDRESS_MAP_END
|
||||
@ -147,7 +147,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( m99_sound_cpu_io_map, AS_IO, 8, m90_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("m72", poundfor_sample_addr_w)
|
||||
AM_RANGE(0x40, 0x41) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x40, 0x41) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x42, 0x42) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x42, 0x42) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w)
|
||||
ADDRESS_MAP_END
|
||||
@ -666,17 +666,6 @@ GFXDECODE_END
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(m72_ym2151_irq_handler)
|
||||
};
|
||||
|
||||
/* this bootleg polls the YM2151 instead of taking interrupts from it */
|
||||
static const ym2151_interface dynablsb_ym2151_config =
|
||||
{
|
||||
DEVCB_NULL
|
||||
};
|
||||
|
||||
INTERRUPT_GEN_MEMBER(m90_state::fake_nmi)
|
||||
{
|
||||
address_space &space = machine().firstcpu->space(AS_PROGRAM);
|
||||
@ -741,8 +730,8 @@ static MACHINE_CONFIG_START( m90, m90_state )
|
||||
|
||||
MCFG_SOUND_ADD("m72", M72, 0)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<m72_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.15)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.15)
|
||||
|
||||
@ -842,7 +831,7 @@ static MACHINE_CONFIG_DERIVED( dynablsb, m90 )
|
||||
MCFG_DEVICE_REMOVE("m72")
|
||||
|
||||
MCFG_SOUND_MODIFY("ymsnd")
|
||||
MCFG_SOUND_CONFIG(dynablsb_ym2151_config)
|
||||
MCFG_YM2151_IRQ_HANDLER(NULL) /* this bootleg polls the YM2151 instead of taking interrupts from it */
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
|
@ -404,7 +404,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 16, m92_state )
|
||||
AM_RANGE(0x00000, 0x1ffff) AM_ROM
|
||||
AM_RANGE(0xa0000, 0xa3fff) AM_RAM
|
||||
AM_RANGE(0xa8000, 0xa803f) AM_DEVREADWRITE8_LEGACY("irem", irem_ga20_r, irem_ga20_w, 0x00ff)
|
||||
AM_RANGE(0xa8040, 0xa8043) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r, ym2151_w, 0x00ff)
|
||||
AM_RANGE(0xa8040, 0xa8043) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
|
||||
AM_RANGE(0xa8044, 0xa8045) AM_READWRITE(m92_soundlatch_r, m92_sound_irq_ack_w)
|
||||
AM_RANGE(0xa8046, 0xa8047) AM_WRITE(m92_sound_status_w)
|
||||
AM_RANGE(0xffff0, 0xfffff) AM_ROM AM_REGION("soundcpu", 0x1fff0)
|
||||
@ -907,20 +907,6 @@ GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
static void sound_irq(device_t *device, int pinstate)
|
||||
{
|
||||
m92_state *state = device->machine().driver_data<m92_state>();
|
||||
|
||||
state->m_soundcpu->set_input_line(NEC_INPUT_LINE_INTP0, pinstate ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq)
|
||||
};
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
void m92_sprite_interrupt(running_machine &machine)
|
||||
@ -963,8 +949,8 @@ static MACHINE_CONFIG_START( m92, m92_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_14_31818MHz/4)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_14_31818MHz/4)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", NEC_INPUT_LINE_INTP0))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.40)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.40)
|
||||
|
||||
|
@ -69,7 +69,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, madmotor_state )
|
||||
AM_RANGE(0x000000, 0x00ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x100001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r,ym2203_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ym2", ym2151_r,ym2151_w)
|
||||
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE("ym2", ym2151_device,read,write)
|
||||
AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
|
||||
AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write)
|
||||
AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r)
|
||||
@ -219,17 +219,6 @@ GFXDECODE_END
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static void sound_irq(device_t *device, int state)
|
||||
{
|
||||
madmotor_state *driver_state = device->machine().driver_data<madmotor_state>();
|
||||
driver_state->m_audiocpu->set_input_line(1, state); /* IRQ 2 */
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq)
|
||||
};
|
||||
|
||||
void madmotor_state::machine_start()
|
||||
{
|
||||
|
||||
@ -287,8 +276,8 @@ static MACHINE_CONFIG_START( madmotor, madmotor_state )
|
||||
MCFG_SOUND_ADD("ym1", YM2203, 21470000/6)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
|
||||
|
||||
MCFG_SOUND_ADD("ym2", YM2151, 21470000/6)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ym2", 21470000/6)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) /* IRQ 2 */
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.45)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.45)
|
||||
|
||||
|
@ -225,7 +225,7 @@ static ADDRESS_MAP_START( devstors_sound_map, AS_PROGRAM, 8, mainevt_state )
|
||||
AM_RANGE(0x8000, 0x83ff) AM_RAM
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r,k007232_w)
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w)
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
|
||||
AM_RANGE(0xe000, 0xe000) AM_WRITE(devstor_sh_irqcontrol_w)
|
||||
AM_RANGE(0xf000, 0xf000) AM_WRITE(dv_sh_bankswitch_w)
|
||||
ADDRESS_MAP_END
|
||||
@ -536,7 +536,7 @@ static MACHINE_CONFIG_START( devstors, mainevt_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.30)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.30)
|
||||
|
||||
|
@ -371,10 +371,10 @@ ADDRESS_MAP_END
|
||||
*/
|
||||
|
||||
/* YM2151 IRQ */
|
||||
static void megasys1_sound_irq(device_t *device, int irq)
|
||||
WRITE_LINE_MEMBER(megasys1_state::sound_irq)
|
||||
{
|
||||
if (irq)
|
||||
device->machine().device("soundcpu")->execute().set_input_line(4, HOLD_LINE);
|
||||
if (state)
|
||||
subdevice("soundcpu")->execute().set_input_line(4, HOLD_LINE);
|
||||
}
|
||||
|
||||
READ8_MEMBER(megasys1_state::oki_status_1_r)
|
||||
@ -403,7 +403,7 @@ static ADDRESS_MAP_START( megasys1A_sound_map, AS_PROGRAM, 16, megasys1_state )
|
||||
AM_RANGE(0x000000, 0x01ffff) AM_ROM
|
||||
AM_RANGE(0x040000, 0x040001) AM_READ(soundlatch_word_r)
|
||||
AM_RANGE(0x060000, 0x060001) AM_WRITE(soundlatch2_word_w) // to main cpu
|
||||
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r,ym2151_w, 0x00ff)
|
||||
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0a0000, 0x0a0001) AM_READ8(oki_status_1_r, 0x00ff)
|
||||
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVWRITE8("oki1", okim6295_device, write, 0x00ff)
|
||||
AM_RANGE(0x0c0000, 0x0c0001) AM_READ8(oki_status_2_r, 0x00ff)
|
||||
@ -421,7 +421,7 @@ static ADDRESS_MAP_START( megasys1B_sound_map, AS_PROGRAM, 16, megasys1_state )
|
||||
AM_RANGE(0x000000, 0x01ffff) AM_ROM
|
||||
AM_RANGE(0x040000, 0x040001) AM_READWRITE(soundlatch_word_r,soundlatch2_word_w) /* from/to main cpu */
|
||||
AM_RANGE(0x060000, 0x060001) AM_READWRITE(soundlatch_word_r,soundlatch2_word_w) /* from/to main cpu */
|
||||
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r,ym2151_w, 0x00ff)
|
||||
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x0a0000, 0x0a0001) AM_READ8(oki_status_1_r, 0x00ff)
|
||||
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVWRITE8("oki1", okim6295_device, write, 0x00ff)
|
||||
AM_RANGE(0x0c0000, 0x0c0001) AM_READ8(oki_status_2_r, 0x00ff)
|
||||
@ -1456,11 +1456,6 @@ GFXDECODE_END
|
||||
|
||||
/* Provided by Jim Hernandez: 3.5MHz for FM, 30KHz (!) for ADPCM */
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(megasys1_sound_irq)
|
||||
};
|
||||
|
||||
static MACHINE_CONFIG_START( system_A, megasys1_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
@ -1493,8 +1488,8 @@ static MACHINE_CONFIG_START( system_A, megasys1_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CPU_CLOCK/2) /* 3.5MHz (7MHz / 2) verified */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CPU_CLOCK/2) /* 3.5MHz (7MHz / 2) verified */
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(megasys1_state,sound_irq))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
|
||||
|
@ -406,13 +406,13 @@ WRITE8_MEMBER(metro_state::daitorid_portb_w)
|
||||
if (!BIT(data, 2))
|
||||
{
|
||||
/* write */
|
||||
ym2151_w(m_ymsnd, space, BIT(data, 1), m_porta);
|
||||
downcast<ym2151_device *>(m_ymsnd.target())->write(space, BIT(data, 1), m_porta);
|
||||
}
|
||||
|
||||
if (!BIT(data, 3))
|
||||
{
|
||||
/* read */
|
||||
m_porta = ym2151_r(m_ymsnd, space, BIT(data, 1));
|
||||
m_porta = downcast<ym2151_device *>(m_ymsnd.target())->read(space, BIT(data, 1));
|
||||
}
|
||||
|
||||
m_portb = data;
|
||||
@ -436,18 +436,6 @@ WRITE8_MEMBER(metro_state::daitorid_portb_w)
|
||||
m_portb = data;
|
||||
}
|
||||
|
||||
static void metro_sound_irq_handler( device_t *device, int state )
|
||||
{
|
||||
metro_state *driver_state = device->machine().driver_data<metro_state>();
|
||||
driver_state->m_audiocpu->set_input_line(UPD7810_INTF2, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(metro_sound_irq_handler) /* irq handler */
|
||||
};
|
||||
|
||||
|
||||
static const ymf278b_interface ymf278b_config =
|
||||
{
|
||||
ymf278b_interrupt
|
||||
@ -3610,8 +3598,8 @@ static MACHINE_CONFIG_START( daitorid, metro_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_3_579545MHz)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", UPD7810_INTF2))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
|
||||
@ -4091,8 +4079,8 @@ static MACHINE_CONFIG_START( pururun, metro_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_3_579545MHz) /* Confirmed match to reference video */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* Confirmed match to reference video */
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", UPD7810_INTF2))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
|
||||
|
@ -273,7 +273,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( soundmem_io, AS_IO, 8, micro3d_state )
|
||||
AM_RANGE(0x0000, 0x07ff) AM_RAM
|
||||
AM_RANGE(0xfd00, 0xfd01) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xfd00, 0xfd01) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
|
||||
AM_RANGE(0xfe00, 0xfe00) AM_WRITE(micro3d_upd7759_w)
|
||||
AM_RANGE(0xff00, 0xff00) AM_WRITE(micro3d_snd_dac_a)
|
||||
AM_RANGE(0xff01, 0xff01) AM_WRITE(micro3d_snd_dac_b)
|
||||
@ -368,7 +368,7 @@ static MACHINE_CONFIG_START( micro3d, micro3d_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.35)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.35)
|
||||
|
||||
MCFG_SOUND_ADD("ym2151", YM2151, XTAL_3_579545MHz)
|
||||
MCFG_YM2151_ADD("ym2151", XTAL_3_579545MHz)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.35)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.35)
|
||||
|
||||
|
@ -540,7 +540,7 @@ static ADDRESS_MAP_START( mlanding_z80_mem, AS_PROGRAM, 8, mlanding_state )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROM
|
||||
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
|
||||
AM_RANGE(0x8000, 0x8fff) AM_RAM
|
||||
AM_RANGE(0x9000, 0x9001) AM_MIRROR(0x00fe) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x9000, 0x9001) AM_MIRROR(0x00fe) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xa000, 0xa001) AM_WRITE(ml_sound_to_main_w)
|
||||
AM_RANGE(0xa001, 0xa001) AM_DEVREAD_LEGACY("tc0140syt", tc0140syt_slave_comm_r)
|
||||
|
||||
@ -730,23 +730,12 @@ static INPUT_PORTS_START( mlanding )
|
||||
PORT_BIT( 0x0fff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0x0800,0x07ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_PLAYER(1)
|
||||
INPUT_PORTS_END
|
||||
|
||||
static void irq_handler(device_t *device, int irq)
|
||||
{
|
||||
device->machine().device("audiocpu")->execute().set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
ml_msm5205_vck, /* VCK function */
|
||||
MSM5205_S48_4B /* 8 kHz */
|
||||
};
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(irq_handler),
|
||||
DEVCB_DRIVER_MEMBER(mlanding_state,sound_bankswitch_w)
|
||||
};
|
||||
|
||||
static const tc0140syt_interface mlanding_tc0140syt_intf =
|
||||
{
|
||||
"maincpu", "audiocpu"
|
||||
@ -803,8 +792,9 @@ static MACHINE_CONFIG_START( mlanding, mlanding_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(mlanding_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
|
||||
|
@ -358,7 +358,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, moo_state )
|
||||
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
|
||||
AM_RANGE(0xc000, 0xdfff) AM_RAM
|
||||
AM_RANGE(0xe000, 0xe22f) AM_DEVREADWRITE("k054539", k054539_device, read, write)
|
||||
AM_RANGE(0xec00, 0xec01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w)
|
||||
AM_RANGE(0xec00, 0xec01) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
|
||||
AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch3_byte_w)
|
||||
AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_byte_r)
|
||||
@ -546,7 +546,7 @@ static MACHINE_CONFIG_START( moo, moo_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 4000000)
|
||||
MCFG_YM2151_ADD("ymsnd", 4000000)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
|
||||
|
||||
|
@ -194,7 +194,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( mugsmash_sound_map, AS_PROGRAM, 8, mugsmash_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w)
|
||||
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
|
||||
AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
|
||||
ADDRESS_MAP_END
|
||||
@ -388,17 +388,6 @@ static GFXDECODE_START( mugsmash )
|
||||
GFXDECODE_ENTRY( "gfx2", 0, mugsmash2_layout, 0x100, 256 ) /* bg tiles */
|
||||
GFXDECODE_END
|
||||
|
||||
static void irq_handler(device_t *device, int irq)
|
||||
{
|
||||
mugsmash_state *state = device->machine().driver_data<mugsmash_state>();
|
||||
state->m_audiocpu->set_input_line(0 , irq ? ASSERT_LINE : CLEAR_LINE );
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(irq_handler)
|
||||
};
|
||||
|
||||
void mugsmash_state::machine_start()
|
||||
{
|
||||
|
||||
@ -429,8 +418,8 @@ static MACHINE_CONFIG_START( mugsmash, mugsmash_state )
|
||||
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.00) /* music */
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
|
||||
|
||||
|
@ -209,8 +209,8 @@ static MACHINE_CONFIG_START( mustache, mustache_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, YM_CLOCK)
|
||||
MCFG_SOUND_CONFIG(t5182_ym2151_interface)
|
||||
MCFG_YM2151_ADD("ymsnd", YM_CLOCK)
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<t5182_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -465,8 +465,8 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, namcos1_state )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROMBANK("bank17") /* Banked ROMs */
|
||||
AM_RANGE(0x4000, 0x4001) AM_DEVREAD_LEGACY("ymsnd", ym2151_status_port_r)
|
||||
AM_RANGE(0x4000, 0x4001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x4000, 0x4001) AM_DEVREAD("ymsnd", ym2151_device, status_r)
|
||||
AM_RANGE(0x4000, 0x4001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x5000, 0x53ff) AM_DEVREADWRITE_LEGACY("namco", namcos1_cus30_r, namcos1_cus30_w) AM_MIRROR(0x400) /* PSG ( Shared ) */
|
||||
AM_RANGE(0x7000, 0x77ff) AM_RAMBANK("bank18") /* TRIRAM (shared) */
|
||||
AM_RANGE(0x8000, 0x9fff) AM_RAM /* Sound RAM 3 */
|
||||
@ -1056,16 +1056,6 @@ GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
static void namcos1_sound_interrupt( device_t *device, int irq )
|
||||
{
|
||||
device->machine().device("audiocpu")->execute().set_input_line(M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(namcos1_sound_interrupt)
|
||||
};
|
||||
|
||||
static const namco_interface namco_config =
|
||||
{
|
||||
8, /* number of voices */
|
||||
@ -1121,8 +1111,8 @@ static MACHINE_CONFIG_START( ns1, namcos1_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579580)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579580)
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
|
||||
|
||||
|
@ -736,7 +736,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_default_am, AS_PROGRAM, 8, namcos2_state )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROMBANK("bank6") /* banked */
|
||||
AM_RANGE(0x4000, 0x4001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w)
|
||||
AM_RANGE(0x4000, 0x4001) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
|
||||
AM_RANGE(0x5000, 0x6fff) AM_DEVREADWRITE_LEGACY("c140", c140_r,c140_w)
|
||||
AM_RANGE(0x7000, 0x77ff) AM_READWRITE(dpram_byte_r,dpram_byte_w) AM_SHARE("dpram")
|
||||
AM_RANGE(0x7800, 0x7fff) AM_READWRITE(dpram_byte_r,dpram_byte_w) /* mirror */
|
||||
@ -1645,7 +1645,7 @@ static MACHINE_CONFIG_START( default, namcos2_state )
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.75)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, YM2151_SOUND_CLOCK) /* 3.579545MHz */
|
||||
MCFG_YM2151_ADD("ymsnd", YM2151_SOUND_CLOCK) /* 3.579545MHz */
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
MACHINE_CONFIG_END
|
||||
@ -1719,7 +1719,7 @@ static MACHINE_CONFIG_START( gollygho, namcos2_state )
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.75)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, YM2151_SOUND_CLOCK) /* 3.579545MHz */
|
||||
MCFG_YM2151_ADD("ymsnd", YM2151_SOUND_CLOCK) /* 3.579545MHz */
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
MACHINE_CONFIG_END
|
||||
@ -1770,7 +1770,7 @@ static MACHINE_CONFIG_START( finallap, namcos2_state )
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.75)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, YM2151_SOUND_CLOCK) /* 3.579545MHz */
|
||||
MCFG_YM2151_ADD("ymsnd", YM2151_SOUND_CLOCK) /* 3.579545MHz */
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
MACHINE_CONFIG_END
|
||||
@ -1819,7 +1819,7 @@ static MACHINE_CONFIG_START( sgunner, namcos2_state )
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.75)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, YM2151_SOUND_CLOCK) /* 3.579545MHz */
|
||||
MCFG_YM2151_ADD("ymsnd", YM2151_SOUND_CLOCK) /* 3.579545MHz */
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
MACHINE_CONFIG_END
|
||||
@ -1870,7 +1870,7 @@ static MACHINE_CONFIG_START( luckywld, namcos2_state )
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.75)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, YM2151_SOUND_CLOCK) /* 3.579545MHz */
|
||||
MCFG_YM2151_ADD("ymsnd", YM2151_SOUND_CLOCK) /* 3.579545MHz */
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
MACHINE_CONFIG_END
|
||||
@ -1919,7 +1919,7 @@ static MACHINE_CONFIG_START( metlhawk, namcos2_state )
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, YM2151_SOUND_CLOCK) /* 3.579545MHz */
|
||||
MCFG_YM2151_ADD("ymsnd", YM2151_SOUND_CLOCK) /* 3.579545MHz */
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -1369,7 +1369,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( am_sound_winrun, AS_PROGRAM, 8, namcos21_state )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROMBANK("bank6") /* banked */
|
||||
AM_RANGE(0x3000, 0x3003) AM_WRITENOP /* ? */
|
||||
AM_RANGE(0x4000, 0x4001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w)
|
||||
AM_RANGE(0x4000, 0x4001) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
|
||||
AM_RANGE(0x5000, 0x6fff) AM_DEVREADWRITE_LEGACY("c140", c140_r,c140_w)
|
||||
AM_RANGE(0x7000, 0x77ff) AM_READWRITE(namcos2_dualportram_byte_r,namcos2_dualportram_byte_w) AM_SHARE("mpdualportram")
|
||||
AM_RANGE(0x7800, 0x7fff) AM_READWRITE(namcos2_dualportram_byte_r,namcos2_dualportram_byte_w) /* mirror */
|
||||
@ -1540,7 +1540,7 @@ static MACHINE_CONFIG_START( namcos21, namcos21_state )
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579580)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579580)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.30)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.30)
|
||||
MACHINE_CONFIG_END
|
||||
@ -1595,7 +1595,7 @@ static MACHINE_CONFIG_START( driveyes, namcos21_state )
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579580)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579580)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.30)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.30)
|
||||
MACHINE_CONFIG_END
|
||||
@ -1653,7 +1653,7 @@ static MACHINE_CONFIG_START( winrun, namcos21_state )
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579580)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579580)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.30)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.30)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -392,7 +392,7 @@ static ADDRESS_MAP_START( NAME##_mcu_map, AS_PROGRAM, 8, namcos86_state ) \
|
||||
AM_RANGE(0x0080, 0x00ff) AM_RAM \
|
||||
AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE_LEGACY("namco", namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */ \
|
||||
AM_RANGE(0x1400, 0x1fff) AM_RAM \
|
||||
AM_RANGE(ADDR_INPUT+0x00, ADDR_INPUT+0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) \
|
||||
AM_RANGE(ADDR_INPUT+0x00, ADDR_INPUT+0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) \
|
||||
AM_RANGE(ADDR_INPUT+0x20, ADDR_INPUT+0x20) AM_READ_PORT("IN0") \
|
||||
AM_RANGE(ADDR_INPUT+0x21, ADDR_INPUT+0x21) AM_READ_PORT("IN1") \
|
||||
AM_RANGE(ADDR_INPUT+0x30, ADDR_INPUT+0x30) AM_READ(dsw0_r) \
|
||||
@ -1022,7 +1022,7 @@ static MACHINE_CONFIG_START( hopmappy, namcos86_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579580)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579580)
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.0)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.60) /* only right channel is connected */
|
||||
|
||||
|
@ -541,7 +541,7 @@ static ADDRESS_MAP_START( sal_sound_map, AS_PROGRAM, 8, nemesis_state )
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w)
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w)
|
||||
AM_RANGE(0xe000, 0xe000) AM_READ(wd_r) /* watchdog?? */
|
||||
AM_RANGE(0xf000, 0xf000) AM_WRITE(salamand_speech_start_w)
|
||||
@ -552,7 +552,7 @@ static ADDRESS_MAP_START( blkpnthr_sound_map, AS_PROGRAM, 8, nemesis_state )
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w)
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xe000, 0xe000) AM_READ(wd_r) /* watchdog?? */
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -1489,11 +1489,6 @@ static void sound_irq(device_t *device, int state)
|
||||
// driver_state->audiocpu->set_input_line(0, HOLD_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq)
|
||||
};
|
||||
|
||||
static const ym3812_interface ym3812_config =
|
||||
{
|
||||
sound_irq
|
||||
@ -1755,8 +1750,8 @@ static MACHINE_CONFIG_START( salamand, nemesis_state )
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 0.08)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.08)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
// MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) ... Interrupts _are_ generated, I wonder where they go
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.2) // reversed according to MT #4565
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.2)
|
||||
MACHINE_CONFIG_END
|
||||
@ -1797,8 +1792,8 @@ static MACHINE_CONFIG_START( blkpnthr, nemesis_state )
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 0.10)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.10)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
// MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) ... Interrupts _are_ generated, I wonder where they go
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
@ -1933,8 +1928,8 @@ static MACHINE_CONFIG_START( hcrash, nemesis_state )
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 0.10)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.10)
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
// MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) ... Interrupts _are_ generated, I wonder where they go
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -4685,7 +4685,7 @@ static ADDRESS_MAP_START( afega_sound_cpu, AS_PROGRAM, 8, nmk16_state )
|
||||
AM_RANGE(0x0000, 0xefff) AM_ROM
|
||||
AM_RANGE(0xf000, 0xf7ff) AM_RAM // RAM
|
||||
AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) // From Main CPU
|
||||
AM_RANGE(0xf808, 0xf809) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) // YM2151
|
||||
AM_RANGE(0xf808, 0xf809) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) // YM2151
|
||||
AM_RANGE(0xf80a, 0xf80a) AM_DEVREADWRITE("oki1", okim6295_device, read, write) // M6295
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -4799,17 +4799,6 @@ GFXDECODE_END
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
static void irq_handler(device_t *device, int irq)
|
||||
{
|
||||
device->machine().device("audiocpu")->execute().set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface afega_ym2151_intf =
|
||||
{
|
||||
DEVCB_LINE(irq_handler)
|
||||
};
|
||||
|
||||
|
||||
static MACHINE_CONFIG_START( stagger1, nmk16_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
@ -4837,8 +4826,8 @@ static MACHINE_CONFIG_START( stagger1, nmk16_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_4MHz) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(afega_ym2151_intf)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_4MHz) /* verified on pcb */
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.30)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.30)
|
||||
|
||||
|
@ -540,7 +540,7 @@ static ADDRESS_MAP_START( opwolf_sound_z80_map, AS_PROGRAM, 8, opwolf_state )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROM
|
||||
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
|
||||
AM_RANGE(0x8000, 0x8fff) AM_RAM
|
||||
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w)
|
||||
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
|
||||
AM_RANGE(0x9002, 0x9100) AM_READNOP
|
||||
AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
|
||||
AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
|
||||
@ -686,22 +686,6 @@ GFXDECODE_END
|
||||
YM2151 (SOUND)
|
||||
**************************************************************/
|
||||
|
||||
/* handler called by the YM2151 emulator when the internal timers cause an IRQ */
|
||||
|
||||
static void irq_handler( device_t *device, int irq )
|
||||
{
|
||||
opwolf_state *state = device->machine().driver_data<opwolf_state>();
|
||||
state->m_audiocpu->set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(irq_handler),
|
||||
DEVCB_DRIVER_MEMBER(opwolf_state,sound_bankswitch_w)
|
||||
};
|
||||
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
opwolf_msm5205_vck, /* VCK function */
|
||||
@ -761,8 +745,9 @@ static MACHINE_CONFIG_START( opwolf, opwolf_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CPU_CLOCK ) /* 4 MHz */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CPU_CLOCK ) /* 4 MHz */
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(opwolf_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.75)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
|
||||
|
||||
@ -814,8 +799,9 @@ static MACHINE_CONFIG_START( opwolfb, opwolf_state ) /* OSC clocks unknown for t
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CPU_CLOCK )
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CPU_CLOCK )
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(opwolf_state,sound_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.75)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
|
||||
|
||||
|
@ -204,7 +204,7 @@ static ADDRESS_MAP_START( overdriv_slave_map, AS_PROGRAM, 16, overdriv_state )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( overdriv_sound_map, AS_PROGRAM, 8, overdriv_state )
|
||||
AM_RANGE(0x0200, 0x0201) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w)
|
||||
AM_RANGE(0x0200, 0x0201) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
|
||||
AM_RANGE(0x0400, 0x042f) AM_DEVREADWRITE_LEGACY("k053260_1", k053260_r, k053260_w)
|
||||
AM_RANGE(0x0600, 0x062f) AM_DEVREADWRITE_LEGACY("k053260_2", k053260_r, k053260_w)
|
||||
AM_RANGE(0x0800, 0x0fff) AM_RAM
|
||||
@ -370,7 +370,7 @@ static MACHINE_CONFIG_START( overdriv, overdriv_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.5)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.5)
|
||||
|
||||
|
@ -525,8 +525,8 @@ static MACHINE_CONFIG_START( panicr, panicr_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, SOUND_CLOCK/4) /* 3.579545 MHz */
|
||||
MCFG_SOUND_CONFIG(t5182_ym2151_interface)
|
||||
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK/4) /* 3.579545 MHz */
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<t5182_ym2151_irq_handler>))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 1.0)
|
||||
|
||||
|
@ -158,7 +158,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( parodius_sound_map, AS_PROGRAM, 8, parodius_state )
|
||||
AM_RANGE(0x0000, 0xefff) AM_ROM
|
||||
AM_RANGE(0xf000, 0xf7ff) AM_RAM
|
||||
AM_RANGE(0xf800, 0xf801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w)
|
||||
AM_RANGE(0xf800, 0xf801) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
|
||||
AM_RANGE(0xfa00, 0xfa00) AM_WRITE(sound_arm_nmi_w)
|
||||
AM_RANGE(0xfc00, 0xfc2f) AM_DEVREADWRITE_LEGACY("k053260", k053260_r,k053260_w)
|
||||
ADDRESS_MAP_END
|
||||
@ -313,7 +313,7 @@ static MACHINE_CONFIG_START( parodius, parodius_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
|
||||
MCFG_YM2151_ADD("ymsnd", 3579545)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
|
@ -410,7 +410,7 @@ static ADDRESS_MAP_START( rbisland_sound_map, AS_PROGRAM, 8, rbisland_state )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROM
|
||||
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
|
||||
AM_RANGE(0x8000, 0x8fff) AM_RAM
|
||||
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w)
|
||||
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
|
||||
AM_RANGE(0x9002, 0x9100) AM_READNOP
|
||||
AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
|
||||
AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
|
||||
@ -617,25 +617,6 @@ static GFXDECODE_START( jumping )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
/**************************************************************
|
||||
YM2151 & YM2203 (SOUND)
|
||||
**************************************************************/
|
||||
|
||||
/* handler called by the YM2151 emulator when the internal timers cause an IRQ */
|
||||
|
||||
static void irqhandler( device_t *device, int irq )
|
||||
{
|
||||
rbisland_state *state = device->machine().driver_data<rbisland_state>();
|
||||
state->m_audiocpu->set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(irqhandler),
|
||||
DEVCB_DRIVER_MEMBER(rbisland_state,bankswitch_w)
|
||||
};
|
||||
|
||||
|
||||
/***********************************************************
|
||||
MACHINE DRIVERS
|
||||
***********************************************************/
|
||||
@ -701,8 +682,9 @@ static MACHINE_CONFIG_START( rbisland, rbisland_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_16MHz/4) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_16MHz/4) /* verified on pcb */
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(rbisland_state,bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
|
||||
|
@ -230,7 +230,7 @@ static ADDRESS_MAP_START( rastan_s_map, AS_PROGRAM, 8, rastan_state )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROM
|
||||
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
|
||||
AM_RANGE(0x8000, 0x8fff) AM_RAM
|
||||
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
|
||||
AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
|
||||
AM_RANGE(0xb000, 0xb000) AM_WRITE(rastan_msm5205_address_w)
|
||||
@ -338,19 +338,6 @@ GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
/* handler called by the YM2151 emulator when the internal timers cause an IRQ */
|
||||
static void irqhandler( device_t *device, int irq )
|
||||
{
|
||||
rastan_state *state = device->machine().driver_data<rastan_state>();
|
||||
state->m_audiocpu->set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
{
|
||||
DEVCB_LINE(irqhandler),
|
||||
DEVCB_DRIVER_MEMBER(rastan_state,rastan_bankswitch_w)
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
rastan_msm5205_vck, /* VCK function */
|
||||
@ -432,8 +419,9 @@ static MACHINE_CONFIG_START( rastan, rastan_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_16MHz/4) /* verified on pcb */
|
||||
MCFG_SOUND_CONFIG(ym2151_config)
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_16MHz/4) /* verified on pcb */
|
||||
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(rastan_state,rastan_bankswitch_w))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user