equites.cpp: deviceified sound board emulation. Also added skeleton device for the bngotime sound board (nw)

This commit is contained in:
Ivan Vangelista 2020-04-21 18:43:29 +02:00
parent a38cc7e767
commit ae2449193f
5 changed files with 680 additions and 377 deletions

View File

@ -1041,6 +1041,8 @@ files {
MAME_DIR .. "src/mame/video/equites.cpp",
MAME_DIR .. "src/mame/drivers/meijinsn.cpp",
MAME_DIR .. "src/mame/drivers/shougi.cpp",
MAME_DIR .. "src/mame/audio/ad_sound.cpp",
MAME_DIR .. "src/mame/audio/ad_sound.h",
MAME_DIR .. "src/mame/machine/alpha8201.cpp",
MAME_DIR .. "src/mame/machine/alpha8201.h",
MAME_DIR .. "src/mame/video/snk68_spr.cpp",

516
src/mame/audio/ad_sound.cpp Normal file
View File

@ -0,0 +1,516 @@
// license:BSD-3-Clause
// copyright-holders:Acho A. Tang, Nicola Salmoria
/***************************************************************************
Functions to emulate the Alpha Denshi "59MC07" audio board
|----------------------|
| Fully boxed = socket |
|----------------------|
| separation = solder
-----------------------------------------------------------------------|
|ALPHA DENSHI CO, LTD. SOUND BOARD NO.59MC07 |
| |
| |--------------------| |
| P | \/ | JAPAN 84250C | SN74LS232J | SN74LS74AN | DISSIPATOR |
| | /\ | M5l8085AP | 8131BJ | 8314A | |
| |--------------------| |
| |
| N | SN74LS74A |
| | 8122AG |
| |
| |------------| |
| M | HV1VR OKI | SN74LS138J | SN74LS74AJ | LM324N | LM324N |
| | 2764-45 | 8044AG | F8048 | J423A2 | 98509 |- (+12V)
| |------------| |
| |- (+5V)
| |------------| |
| L | HV2VR OKI | T74LS14B1 | SN74LS08N |- (OUT)
| | 2764-45 | 88442 | K8208 |
| |------------| |- (
| | (GND)
| |------------| |- (
| K | HV3VR OKI | SN74LS08J | SN74LS04N | LM324N |
| | 2764-45 | K8208 | I8313 | 98509 |
| |------------| |
| |
| J | SN74LS74A | SN74LS232J | | LM324N |
| | 8122AG | 8131BG | | 436A |
| |
| |------------| |------------| |
| H | HV4VR OKI | SN74LS393N | TBP18S030N | | LM324N |
| | 2764-45 | K8208 | J419X | | 436A |
| |------------| |------------| |
| |
| F | SN74LS138J | HCF40174BE | | CD4066BCN |
| | 8044AG | MSM40174 | | MM5666BN |
| |
| E | M74LS123P | SN74LS138J | CD4066BCN | CD4066BCN |
| | 84A6C1 | 8044AG | MM5666BN | MM5666BN |
| MUSIC |
| |-------------------------| |
| D | SN74LS373N | JAPAN 841903 | | CD4066BCN |
| | 2764-45 | M5L8155P | | MM5666BN |
| |-------------------------| VOICE |
| |
|C |-------------------------| |
|O C | 74LS173 PC | MSM5232RS | |
|N | 8247 | OKI 4342 | |
|N |-------------------------| |
| |
|T B |
|O |
| |-------------------------| |
|M A | 74LS173 PC | SOUND AY-3-8910 | CD4066BCN | CD4066BCN |
|A | 8247 | 8046 CDA | MM5666BN | MM5666BN |
|I |-------------------------| |
|N |
| | 1 | 2 | 3 | 4 | 5 |
-----------------------------------------------------------------------|
***************************************************************************/
#include "emu.h"
#include "audio/ad_sound.h"
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "sound/volt_reg.h"
#include "speaker.h"
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
DEFINE_DEVICE_TYPE(AD_59MC07, ad_59mc07_device, "ad_59mc07", "Alpha Denshi 59MC07 sound board")
//**************************************************************************
// MEMORY MAPS
//**************************************************************************
void ad_59mc07_device::sound_map(address_map &map)
{
map(0x0000, 0xbfff).rom();
map(0xc000, 0xc000).r(m_soundlatch, FUNC(generic_latch_8_device::read));
map(0xc080, 0xc08d).w(m_msm, FUNC(msm5232_device::write));
map(0xc0a0, 0xc0a1).w("aysnd", FUNC(ay8910_device::data_address_w));
map(0xc0b0, 0xc0b0).nopw(); // n.c.
map(0xc0c0, 0xc0c0).w(FUNC(ad_59mc07_device::cymbal_ctrl_w));
map(0xc0d0, 0xc0d0).w(FUNC(ad_59mc07_device::dac_latch_w)); // followed by 1 (and usually 0) on 8155 port B
map(0xc0e0, 0xc0e0).w(FUNC(ad_59mc07_device::dac_latch_w)); // followed by 2 (and usually 0) on 8155 port B
map(0xc0f8, 0xc0ff).w(FUNC(ad_59mc07_device::c0f8_w));
map(0xe000, 0xe0ff).rw(m_audio8155, FUNC(i8155_device::memory_r), FUNC(i8155_device::memory_w));
}
void ad_59mc07_device::sound_portmap(address_map &map)
{
map(0x00e0, 0x00e7).rw(m_audio8155, FUNC(i8155_device::io_r), FUNC(i8155_device::io_w));
}
//**************************************************************************
// SPECIFIC IMPLEMENTATION
//**************************************************************************
//-------------------------------------------------
// ad_59mc07_device: Constructor
//-------------------------------------------------
ad_59mc07_device::ad_59mc07_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, AD_59MC07, tag, owner, clock),
m_audiocpu(*this, "audiocpu"),
m_audio8155(*this, "audio8155"),
m_samples(*this, "samples"),
m_msm(*this, "msm"),
m_dac_1(*this, "dac1"),
m_dac_2(*this, "dac2"),
m_soundlatch(*this, "soundlatch"),
m_frq_adjuster(*this, ":FRQ") // TODO: this should be moved here, but I don't think it's possible to set the default per-game value with a variable
{}
// MSM5232 clock is generated by a transistor oscillator circuit, not by the pcb xtal
// The circuit is controlled by a pot to allow adjusting the frequency. All games
// have been hand-tuned to a recording claiming to be an original recording from the
// boards. You can adjust this in the Slider Controls while using -cheat if needed.
#define MSM5232_MAX_CLOCK 6144000
#define MSM5232_MIN_CLOCK 214000 // unstable
/******************************************************************************/
// Sound
WRITE_LINE_MEMBER(ad_59mc07_device::i8155_timer_pulse)
{
if (!state)
m_audiocpu->set_input_line(I8085_TRAP_LINE, ASSERT_LINE);
}
TIMER_CALLBACK_MEMBER(ad_59mc07_device::frq_adjuster_callback)
{
uint8_t frq = m_frq_adjuster->read();
m_msm->set_clock(MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100);
//popmessage("8155: C %02x A %02x AY: A %02x B %02x Unk:%x", m_8155_port_c, m_8155_port_a, m_ay_port_a, m_ay_port_b, m_cymbal_ctrl & 15);
m_cymvol *= 0.94f;
m_hihatvol *= 0.94f;
m_msm->set_output_gain(10, m_hihatvol + m_cymvol * (m_ay_port_b & 3) * 0.33f); /* NO from msm5232 */
}
void ad_59mc07_device::c0f8_w(offs_t offset, uint8_t data)
{
switch (offset)
{
case 0: // c0f8: NMI ack (written by NMI handler)
m_audiocpu->set_input_line(I8085_TRAP_LINE, CLEAR_LINE);
break;
case 1: // c0f9: RST75 trigger (written by NMI handler)
// Note: solder pad CP3 on the pcb would allow to disable this
m_audiocpu->pulse_input_line(I8085_RST75_LINE, attotime::zero);
break;
case 2: // c0fa: INTR trigger (written by NMI handler)
// verified on PCB:
m_audiocpu->set_input_line(I8085_INTR_LINE, HOLD_LINE);
break;
case 3: // c0fb: n.c.
// Note: this is written at end of the INTR handler, however LS138@E3 pin 12 is definitely unconnected
break;
case 4: // c0fc: increment PROM address (written by NMI handler)
m_sound_prom_address = (m_sound_prom_address + 1) & 0x1f;
// at this point, the 5-bit value
// goes to an op-amp and to the base of a transistor. The transistor is part
// of a resonator that is used to generate the M5232 clock. The PROM doesn't
// actually seem to be important, since even removing it the M5232 clock
// continues to come out normally.
break;
case 5: // c0fd: n.c.
// Note: this is written at end of the RST75 handler, however LS138@E3 pin 10 is definitely unconnected
break;
case 6: // c0fe: 4-bit answer for main CPU (unused)
// Note: this would go to the LS173@B1, which is however unpopulated on the pcb
break;
case 7: // c0ff: sound command latch clear
// Note: solder pad CP1 on the pcb would allow to disable this
m_soundlatch->clear_w();
break;
}
}
void ad_59mc07_device::ay8910_porta_w(uint8_t data)
{
// bongo 1
m_samples->set_volume(0, ((data & 0x30) >> 4) * 0.33);
if (data & ~m_ay_port_a & 0x80)
m_samples->start(0, 0);
// bongo 2
m_samples->set_volume(1, (data & 0x03) * 0.33);
if (data & ~m_ay_port_a & 0x08)
m_samples->start(1, 1);
m_ay_port_a = data;
}
void ad_59mc07_device::ay8910_portb_w(uint8_t data)
{
// bongo 3
m_samples->set_volume(2, ((data & 0x30)>>4) * 0.33);
if (data & ~m_ay_port_b & 0x80)
m_samples->start(2, 2);
// FIXME I'm just enabling the MSM5232 Noise Output for now. Proper emulation
// of the analog circuitry should be done instead.
// if (data & ~m_ay_port_b & 0x08) cymbal hit trigger
// if (data & ~m_ay_port_b & 0x04) hi-hat hit trigger
// data & 3 cymbal volume
// data & 0x40 hi-hat enable
if (data & ~m_ay_port_b & 0x08)
m_cymvol = 1.0f;
if (data & ~m_ay_port_b & 0x04)
m_hihatvol = 0.8f;
if (~data & 0x40)
m_hihatvol = 0.0f;
m_ay_port_b = data;
}
void ad_59mc07_device::cymbal_ctrl_w(uint8_t data)
{
m_cymbal_ctrl++;
}
void ad_59mc07_device::update_dac()
{
// there is only one latch, which is used to drive two DAC channels.
// When the channel is enabled in the 4066, it goes to a series of
// low-pass filters. The channel is kept enabled only for a short time,
// then it's disabled again.
// Note that PB0 goes through three filters while PB1 only goes through one.
if (m_8155_port_b & 1)
m_dac_1->write(m_dac_latch);
if (m_8155_port_b & 2)
m_dac_2->write(m_dac_latch);
}
void ad_59mc07_device::dac_latch_w(uint8_t data)
{
m_dac_latch = data;
update_dac();
}
void ad_59mc07_device::i8155_porta_w(uint8_t data)
{
m_8155_port_a = data;
m_msm->set_output_gain(0, (data >> 4) / 15.0); // group1 from msm5232
m_msm->set_output_gain(1, (data >> 4) / 15.0); // group1 from msm5232
m_msm->set_output_gain(2, (data >> 4) / 15.0); // group1 from msm5232
m_msm->set_output_gain(3, (data >> 4) / 15.0); // group1 from msm5232
m_msm->set_output_gain(4, (data & 0x0f) / 15.0); // group2 from msm5232
m_msm->set_output_gain(5, (data & 0x0f) / 15.0); // group2 from msm5232
m_msm->set_output_gain(6, (data & 0x0f) / 15.0); // group2 from msm5232
m_msm->set_output_gain(7, (data & 0x0f) / 15.0); // group2 from msm5232
}
void ad_59mc07_device::i8155_portb_w(uint8_t data)
{
m_8155_port_b = data;
update_dac();
}
void ad_59mc07_device::i8155_portc_w(uint8_t data)
{
m_8155_port_c = data;
m_msm->set_output_gain(8, (data & 0x0f) / 15.0); // SOLO 8' from msm5232
if (data & 0x20)
m_msm->set_output_gain(9, (data & 0x0f) / 15.0); // SOLO 16' from msm5232
else
m_msm->set_output_gain(9, 0); // SOLO 16' from msm5232
}
WRITE_LINE_MEMBER(ad_59mc07_device::msm5232_gate)
{
}
static const char *const alphamc07_sample_names[] =
{
"*equites",
"bongo1",
"bongo2",
"bongo3",
nullptr
};
#define MSM5232_BASE_VOLUME 1.0
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
void ad_59mc07_device::device_add_mconfig(machine_config &config)
{
I8085A(config, m_audiocpu, 6.144_MHz_XTAL); // verified on pcb
m_audiocpu->set_addrmap(AS_PROGRAM, &ad_59mc07_device::sound_map);
m_audiocpu->set_addrmap(AS_IO, &ad_59mc07_device::sound_portmap);
m_audiocpu->set_clk_out(m_audio8155, FUNC(i8155_device::set_unscaled_clock_int));
I8155(config, m_audio8155, 0);
m_audio8155->out_pa_callback().set(FUNC(ad_59mc07_device::i8155_porta_w));
m_audio8155->out_pb_callback().set(FUNC(ad_59mc07_device::i8155_portb_w));
m_audio8155->out_pc_callback().set(FUNC(ad_59mc07_device::i8155_portc_w));
m_audio8155->out_to_callback().set(FUNC(ad_59mc07_device::i8155_timer_pulse));
// sound hardware
SPEAKER(config, "speaker").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
MSM5232(config, m_msm, MSM5232_MAX_CLOCK); // will be adjusted at runtime through PORT_ADJUSTER
m_msm->set_capacitors(0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6); // verified
m_msm->gate().set(FUNC(ad_59mc07_device::msm5232_gate));
m_msm->add_route(0, "speaker", MSM5232_BASE_VOLUME/2.2); // pin 28 2'-1 : 22k resistor
m_msm->add_route(1, "speaker", MSM5232_BASE_VOLUME/1.5); // pin 29 4'-1 : 15k resistor
m_msm->add_route(2, "speaker", MSM5232_BASE_VOLUME); // pin 30 8'-1 : 10k resistor
m_msm->add_route(3, "speaker", MSM5232_BASE_VOLUME); // pin 31 16'-1 : 10k resistor
m_msm->add_route(4, "speaker", MSM5232_BASE_VOLUME/2.2); // pin 36 2'-2 : 22k resistor
m_msm->add_route(5, "speaker", MSM5232_BASE_VOLUME/1.5); // pin 35 4'-2 : 15k resistor
m_msm->add_route(6, "speaker", MSM5232_BASE_VOLUME); // pin 34 8'-2 : 10k resistor
m_msm->add_route(7, "speaker", MSM5232_BASE_VOLUME); // pin 33 16'-2 : 10k resistor
m_msm->add_route(8, "speaker", 1.0); // pin 1 SOLO 8' (this actually feeds an analog section)
m_msm->add_route(9, "speaker", 1.0); // pin 2 SOLO 16' (this actually feeds an analog section)
m_msm->add_route(10,"speaker", 0.12); // pin 22 Noise Output (this actually feeds an analog section)
ay8910_device &aysnd(AY8910(config, "aysnd", 6.144_MHz_XTAL/4)); // verified on pcb
aysnd.port_a_write_callback().set(FUNC(ad_59mc07_device::ay8910_porta_w));
aysnd.port_b_write_callback().set(FUNC(ad_59mc07_device::ay8910_portb_w));
aysnd.add_route(ALL_OUTPUTS, "speaker", 0.15);
DAC_6BIT_R2R(config, m_dac_1, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC
DAC_6BIT_R2R(config, m_dac_2, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT);
vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT);
vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
SAMPLES(config, m_samples);
m_samples->set_channels(3);
m_samples->set_samples_names(alphamc07_sample_names);
m_samples->add_route(ALL_OUTPUTS, "speaker", 0.3);
}
//-------------------------------------------------
// device_start: Start up the device
//-------------------------------------------------
void ad_59mc07_device::device_start()
{
// zerofill
m_sound_prom_address = 0;
m_dac_latch = 0;
m_8155_port_b = 0;
m_8155_port_a = 0;
m_8155_port_c = 0;
m_ay_port_a = 0;
m_ay_port_b = 0;
m_cymbal_ctrl = 0;
m_cymvol = 0.0;
m_hihatvol = 0.0;
// register for savestates
save_item(NAME(m_sound_prom_address));
save_item(NAME(m_dac_latch));
save_item(NAME(m_8155_port_b));
save_item(NAME(m_8155_port_a));
save_item(NAME(m_8155_port_c));
save_item(NAME(m_ay_port_a));
save_item(NAME(m_ay_port_b));
save_item(NAME(m_cymbal_ctrl));
save_item(NAME(m_cymvol));
save_item(NAME(m_hihatvol));
m_adjuster_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ad_59mc07_device::frq_adjuster_callback), this));
m_adjuster_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60));
}
//-------------------------------------------------
// device_reset: Reset the device
//-------------------------------------------------
void ad_59mc07_device::device_reset()
{
m_audiocpu->set_input_line(I8085_INTR_LINE, CLEAR_LINE);
m_audiocpu->set_input_line(I8085_TRAP_LINE, CLEAR_LINE);
}
/*
Functions to emulate the Alpha Denshi "60MC01" audio board
CPU :Z80A
Sound:AY-3-8910A (unpopulated: another 8910 and a YM2203)
OSC :6.000MHz
*/
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
DEFINE_DEVICE_TYPE(AD_60MC01, ad_60mc01_device, "ad_60mc01", "Alpha Denshi 60MC01 sound board")
//**************************************************************************
// MEMORY MAPS
//**************************************************************************
void ad_60mc01_device::sound_map(address_map &map) // TODO: verify everything
{
map(0x0000, 0x1fff).rom();
map(0x8000, 0x87ff).ram();
// map(0xc100, 0xc100).r(m_soundlatch, FUNC(generic_latch_8_device::read));
// map(0xc102, 0xc102).w(m_soundlatch, FUNC(generic_latch_8_device::clear_w));
}
void ad_60mc01_device::sound_portmap(address_map &map)
{
map.global_mask(0xff);
// map(0x10, 0x11).w("aysnd", FUNC(ay8910_device::data_address_w));
// map(0x80, 0x81).w
}
//**************************************************************************
// SPECIFIC IMPLEMENTATION
//**************************************************************************
//-------------------------------------------------
// ad_60mc01_device: Constructor
//-------------------------------------------------
ad_60mc01_device::ad_60mc01_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, AD_60MC01, tag, owner, clock),
m_audiocpu(*this, "audiocpu"),
m_soundlatch(*this, "soundlatch")
{}
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
void ad_60mc01_device::device_add_mconfig(machine_config &config)
{
Z80(config, m_audiocpu, 6_MHz_XTAL / 2); // divider not verified
m_audiocpu->set_addrmap(AS_PROGRAM, &ad_60mc01_device::sound_map);
m_audiocpu->set_addrmap(AS_IO, &ad_60mc01_device::sound_portmap);
// sound hardware
SPEAKER(config, "speaker").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
ay8910_device &aysnd(AY8910(config, "aysnd", 6_MHz_XTAL / 4)); // divider not verified
aysnd.add_route(ALL_OUTPUTS, "speaker", 0.50);
}
//-------------------------------------------------
// device_start: Start up the device
//-------------------------------------------------
void ad_60mc01_device::device_start()
{
}
//-------------------------------------------------
// device_reset: Reset the device
//-------------------------------------------------
void ad_60mc01_device::device_reset()
{
}

129
src/mame/audio/ad_sound.h Normal file
View File

@ -0,0 +1,129 @@
// license:BSD-3-Clause
// copyright-holders:Acho A. Tang, Nicola Salmoria
//****************************************************************************
// Functions to emulate the Alpha Denshi "59MC07" audio board
//****************************************************************************
#ifndef MAME_AUDIO_AD_SOUND_BOARDS_H
#define MAME_AUDIO_AD_SOUND_BOARDS_H
#pragma once
#include "cpu/i8085/i8085.h"
#include "machine/gen_latch.h"
#include "machine/i8155.h"
#include "sound/dac.h"
#include "sound/msm5232.h"
#include "sound/samples.h"
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
DECLARE_DEVICE_TYPE(AD_59MC07, ad_59mc07_device)
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> ad_59mc07_device
class ad_59mc07_device : public device_t
{
public:
// construction/destruction
ad_59mc07_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
void sound_command_w(uint8_t data) { m_soundlatch->write(data); }
protected:
// device level overrides
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
virtual void device_reset() override;
private:
required_device<i8085a_cpu_device> m_audiocpu;
required_device<i8155_device> m_audio8155;
required_device<samples_device> m_samples;
required_device<msm5232_device> m_msm;
required_device<dac_byte_interface> m_dac_1;
required_device<dac_byte_interface> m_dac_2;
required_device<generic_latch_8_device> m_soundlatch;
required_ioport m_frq_adjuster;
int m_sound_prom_address;
uint8_t m_dac_latch;
uint8_t m_8155_port_b;
uint8_t m_8155_port_a;
uint8_t m_8155_port_c;
uint8_t m_ay_port_a;
uint8_t m_ay_port_b;
uint8_t m_cymbal_ctrl;
float m_cymvol;
float m_hihatvol;
emu_timer *m_adjuster_timer;
void sound_map(address_map &map);
void sound_portmap(address_map &map);
void c0f8_w(offs_t offset, uint8_t data);
void cymbal_ctrl_w(uint8_t data);
void dac_latch_w(uint8_t data);
void i8155_porta_w(uint8_t data);
void i8155_portb_w(uint8_t data);
void i8155_portc_w(uint8_t data);
void ay8910_porta_w(uint8_t data);
void ay8910_portb_w(uint8_t data);
DECLARE_WRITE_LINE_MEMBER(i8155_timer_pulse);
TIMER_CALLBACK_MEMBER(frq_adjuster_callback);
void update_dac();
DECLARE_WRITE_LINE_MEMBER(msm5232_gate);
};
//****************************************************************************
// Functions to emulate the Alpha Denshi "60MC01" audio board
//****************************************************************************
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
DECLARE_DEVICE_TYPE(AD_60MC01, ad_60mc01_device)
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> ad_60mc01_device
class ad_60mc01_device : public device_t
{
public:
// construction/destruction
ad_60mc01_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
static constexpr feature_type unemulated_features() { return feature::SOUND; }
void sound_command_w(uint8_t data) { m_soundlatch->write(data); }
protected:
// device level overrides
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
virtual void device_reset() override;
private:
required_device<cpu_device> m_audiocpu;
required_device<generic_latch_8_device> m_soundlatch;
void sound_map(address_map &map);
void sound_portmap(address_map &map);
};
#endif // MAME_AUDIO_AD_SOUND_BOARDS_H

View File

@ -370,195 +370,10 @@ D
#include "emu.h"
#include "includes/equites.h"
#include "audio/ad_sound.h"
#include "cpu/m68000/m68000.h"
#include "machine/nvram.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/volt_reg.h"
#include "speaker.h"
#define FRQ_ADJUSTER_TAG "FRQ"
// MSM5232 clock is generated by a transistor oscillator circuit, not by the pcb xtal
// The circuit is controlled by a pot to allow adjusting the frequency. All games
// have been hand-tuned to a recording claiming to be an original recording from the
// boards. You can adjust this in the Slider Controls while using -cheat if needed.
#define MSM5232_MAX_CLOCK 6144000
#define MSM5232_MIN_CLOCK 214000 // unstable
/******************************************************************************/
// Sound
WRITE_LINE_MEMBER(equites_state::equites_8155_timer_pulse)
{
if (!state)
m_audiocpu->set_input_line(I8085_TRAP_LINE, ASSERT_LINE);
}
TIMER_CALLBACK_MEMBER(equites_state::equites_frq_adjuster_callback)
{
uint8_t frq = ioport(FRQ_ADJUSTER_TAG)->read();
m_msm->set_clock(MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100);
//popmessage("8155: C %02x A %02x AY: A %02x B %02x Unk:%x", m_eq8155_port_c, m_eq8155_port_a, m_ay_port_a, m_ay_port_b, m_eq_cymbal_ctrl & 15);
m_cymvol *= 0.94f;
m_hihatvol *= 0.94f;
m_msm->set_output_gain(10, m_hihatvol + m_cymvol * (m_ay_port_b & 3) * 0.33f); /* NO from msm5232 */
}
WRITE8_MEMBER(equites_state::equites_c0f8_w)
{
switch (offset)
{
case 0: // c0f8: NMI ack (written by NMI handler)
m_audiocpu->set_input_line(I8085_TRAP_LINE, CLEAR_LINE);
break;
case 1: // c0f9: RST75 trigger (written by NMI handler)
// Note: solder pad CP3 on the pcb would allow to disable this
m_audiocpu->pulse_input_line(I8085_RST75_LINE, attotime::zero);
break;
case 2: // c0fa: INTR trigger (written by NMI handler)
// verified on PCB:
m_audiocpu->set_input_line(I8085_INTR_LINE, HOLD_LINE);
break;
case 3: // c0fb: n.c.
// Note: this is written at end of the INTR handler, however LS138@E3 pin 12 is definitely unconnected
break;
case 4: // c0fc: increment PROM address (written by NMI handler)
m_sound_prom_address = (m_sound_prom_address + 1) & 0x1f;
// at this point, the 5-bit value
// goes to an op-amp and to the base of a transistor. The transistor is part
// of a resonator that is used to generate the M5232 clock. The PROM doesn't
// actually seem to be important, since even removing it the M5232 clock
// continues to come out normally.
break;
case 5: // c0fd: n.c.
// Note: this is written at end of the RST75 handler, however LS138@E3 pin 10 is definitely unconnected
break;
case 6: // c0fe: 4-bit answer for main CPU (unused)
// Note: this would go to the LS173@B1, which is however unpopulated on the pcb
break;
case 7: // c0ff: sound command latch clear
// Note: solder pad CP1 on the pcb would allow to disable this
m_soundlatch->clear_w();
break;
}
}
WRITE8_MEMBER(equites_state::equites_8910porta_w)
{
// bongo 1
m_samples->set_volume(0, ((data & 0x30) >> 4) * 0.33);
if (data & ~m_ay_port_a & 0x80)
m_samples->start(0, 0);
// bongo 2
m_samples->set_volume(1, (data & 0x03) * 0.33);
if (data & ~m_ay_port_a & 0x08)
m_samples->start(1, 1);
m_ay_port_a = data;
}
WRITE8_MEMBER(equites_state::equites_8910portb_w)
{
// bongo 3
m_samples->set_volume(2, ((data & 0x30)>>4) * 0.33);
if (data & ~m_ay_port_b & 0x80)
m_samples->start(2, 2);
// FIXME I'm just enabling the MSM5232 Noise Output for now. Proper emulation
// of the analog circuitry should be done instead.
// if (data & ~m_ay_port_b & 0x08) cymbal hit trigger
// if (data & ~m_ay_port_b & 0x04) hi-hat hit trigger
// data & 3 cymbal volume
// data & 0x40 hi-hat enable
if (data & ~m_ay_port_b & 0x08)
m_cymvol = 1.0f;
if (data & ~m_ay_port_b & 0x04)
m_hihatvol = 0.8f;
if (~data & 0x40)
m_hihatvol = 0.0f;
m_ay_port_b = data;
}
WRITE8_MEMBER(equites_state::equites_cymbal_ctrl_w)
{
m_eq_cymbal_ctrl++;
}
void equites_state::equites_update_dac( )
{
// there is only one latch, which is used to drive two DAC channels.
// When the channel is enabled in the 4066, it goes to a series of
// low-pass filters. The channel is kept enabled only for a short time,
// then it's disabled again.
// Note that PB0 goes through three filters while PB1 only goes through one.
if (m_eq8155_port_b & 1)
m_dac_1->write(m_dac_latch);
if (m_eq8155_port_b & 2)
m_dac_2->write(m_dac_latch);
}
WRITE8_MEMBER(equites_state::equites_dac_latch_w)
{
m_dac_latch = data;
equites_update_dac();
}
WRITE8_MEMBER(equites_state::equites_8155_porta_w)
{
m_eq8155_port_a = data;
m_msm->set_output_gain(0, (data >> 4) / 15.0); /* group1 from msm5232 */
m_msm->set_output_gain(1, (data >> 4) / 15.0); /* group1 from msm5232 */
m_msm->set_output_gain(2, (data >> 4) / 15.0); /* group1 from msm5232 */
m_msm->set_output_gain(3, (data >> 4) / 15.0); /* group1 from msm5232 */
m_msm->set_output_gain(4, (data & 0x0f) / 15.0); /* group2 from msm5232 */
m_msm->set_output_gain(5, (data & 0x0f) / 15.0); /* group2 from msm5232 */
m_msm->set_output_gain(6, (data & 0x0f) / 15.0); /* group2 from msm5232 */
m_msm->set_output_gain(7, (data & 0x0f) / 15.0); /* group2 from msm5232 */
}
WRITE8_MEMBER(equites_state::equites_8155_portb_w)
{
m_eq8155_port_b = data;
equites_update_dac();
}
WRITE8_MEMBER(equites_state::equites_8155_portc_w)
{
m_eq8155_port_c = data;
m_msm->set_output_gain(8, (data & 0x0f) / 15.0); /* SOLO 8' from msm5232 */
if (data & 0x20)
m_msm->set_output_gain(9, (data & 0x0f) / 15.0); /* SOLO 16' from msm5232 */
else
m_msm->set_output_gain(9, 0); /* SOLO 16' from msm5232 */
}
WRITE_LINE_MEMBER(equites_state::equites_msm5232_gate)
{
}
/******************************************************************************/
@ -626,9 +441,8 @@ void equites_state::equites_common_map(address_map &map)
map(0x100000, 0x1001ff).ram().share("spriteram");
map(0x100000, 0x100001).r(FUNC(equites_state::equites_spriteram_kludge_r));
map(0x140000, 0x1407ff).rw(m_alpha_8201, FUNC(alpha_8201_device::ext_ram_r), FUNC(alpha_8201_device::ext_ram_w)).umask16(0x00ff);
map(0x180000, 0x180001).portr("IN1").w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0x180000, 0x180001).portr("IN1");
map(0x180000, 0x180000).select(0x03c000).lw8(NAME([this] (offs_t offset, u8 data) { m_mainlatch->write_a3(offset >> 14); }));
map(0x180001, 0x180001).w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0x1c0000, 0x1c0001).portr("IN0").w(FUNC(equites_state::equites_scrollreg_w));
map(0x380000, 0x380000).w(FUNC(equites_state::equites_bgcolor_w));
map(0x780000, 0x780001).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
@ -638,15 +452,23 @@ void equites_state::equites_map(address_map &map)
{
equites_common_map(map);
map(0x040000, 0x040fff).ram();
map(0x180001, 0x180001).w("sound_board", FUNC(ad_59mc07_device::sound_command_w));
}
void gekisou_state::gekisou_map(address_map &map)
{
equites_common_map(map);
map(0x040000, 0x040fff).ram().share("nvram"); // mainram is battery-backed
map(0x180001, 0x180001).w("sound_board", FUNC(ad_59mc07_device::sound_command_w));
map(0x580000, 0x580001).select(0x020000).w(FUNC(gekisou_state::gekisou_unknown_bit_w));
}
void equites_state::bngotime_map(address_map &map)
{
equites_common_map(map);
map(0x040000, 0x040fff).ram();
// map(0x180001, 0x180001).w("sound_board", FUNC(ad_60mc01_device::sound_command_w)); // where's this?
}
void splndrbt_state::splndrbt_map(address_map &map)
{
@ -658,7 +480,7 @@ void splndrbt_state::splndrbt_map(address_map &map)
map(0x0c0000, 0x0c0000).select(0x020000).w(FUNC(splndrbt_state::equites_bgcolor_w));
map(0x0c0001, 0x0c0001).select(0x03c000).lw8(NAME([this] (offs_t offset, u8 data) { m_mainlatch->write_a3(offset >> 14); }));
map(0x100000, 0x100001).w(FUNC(splndrbt_state::splndrbt_bg_scrollx_w));
map(0x140001, 0x140001).w("soundlatch", FUNC(generic_latch_8_device::write));
map(0x140001, 0x140001).w("sound_board", FUNC(ad_59mc07_device::sound_command_w));
map(0x1c0000, 0x1c0001).w(FUNC(splndrbt_state::splndrbt_bg_scrolly_w));
map(0x180000, 0x1807ff).rw(m_alpha_8201, FUNC(alpha_8201_device::ext_ram_r), FUNC(alpha_8201_device::ext_ram_w)).umask16(0x00ff);
map(0x200000, 0x200fff).mirror(0x001000).rw(FUNC(splndrbt_state::equites_fg_videoram_r), FUNC(splndrbt_state::equites_fg_videoram_w)).umask16(0x00ff);
@ -669,27 +491,6 @@ void splndrbt_state::splndrbt_map(address_map &map)
}
void equites_state::sound_map(address_map &map)
{
map(0x0000, 0xbfff).rom();
map(0xc000, 0xc000).r(m_soundlatch, FUNC(generic_latch_8_device::read));
map(0xc080, 0xc08d).w(m_msm, FUNC(msm5232_device::write));
map(0xc0a0, 0xc0a1).w("aysnd", FUNC(ay8910_device::data_address_w));
map(0xc0b0, 0xc0b0).nopw(); // n.c.
map(0xc0c0, 0xc0c0).w(FUNC(equites_state::equites_cymbal_ctrl_w));
map(0xc0d0, 0xc0d0).w(FUNC(equites_state::equites_dac_latch_w)); // followed by 1 (and usually 0) on 8155 port B
map(0xc0e0, 0xc0e0).w(FUNC(equites_state::equites_dac_latch_w)); // followed by 2 (and usually 0) on 8155 port B
map(0xc0f8, 0xc0ff).w(FUNC(equites_state::equites_c0f8_w));
map(0xe000, 0xe0ff).rw("audio8155", FUNC(i8155_device::memory_r), FUNC(i8155_device::memory_w));
}
void equites_state::sound_portmap(address_map &map)
{
map(0x00e0, 0x00e7).rw("audio8155", FUNC(i8155_device::io_r), FUNC(i8155_device::io_w));
}
/******************************************************************************/
// Common Port Map
@ -713,6 +514,8 @@ void equites_state::sound_portmap(address_map &map)
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, button3 ) PORT_COCKTAIL \
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, start )
#define FRQ_ADJUSTER_TAG "FRQ"
/******************************************************************************/
// Equites Port Map
@ -993,108 +796,15 @@ static GFXDECODE_START( gfx_splndrbt )
GFXDECODE_END
/******************************************************************************/
static const char *const alphamc07_sample_names[] =
{
"*equites",
"bongo1",
"bongo2",
"bongo3",
nullptr
};
#define MSM5232_BASE_VOLUME 1.0
// the sound board is the same in all games but bngotime
void equites_state::common_sound(machine_config &config)
{
I8085A(config, m_audiocpu, 6.144_MHz_XTAL); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &equites_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &equites_state::sound_portmap);
m_audiocpu->set_clk_out(m_audio8155, FUNC(i8155_device::set_unscaled_clock_int));
I8155(config, m_audio8155, 0);
m_audio8155->out_pa_callback().set(FUNC(equites_state::equites_8155_porta_w));
m_audio8155->out_pb_callback().set(FUNC(equites_state::equites_8155_portb_w));
m_audio8155->out_pc_callback().set(FUNC(equites_state::equites_8155_portc_w));
m_audio8155->out_to_callback().set(FUNC(equites_state::equites_8155_timer_pulse));
/* sound hardware */
SPEAKER(config, "speaker").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
MSM5232(config, m_msm, MSM5232_MAX_CLOCK); // will be adjusted at runtime through PORT_ADJUSTER
m_msm->set_capacitors(0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6); // verified
m_msm->gate().set(FUNC(equites_state::equites_msm5232_gate));
m_msm->add_route(0, "speaker", MSM5232_BASE_VOLUME/2.2); // pin 28 2'-1 : 22k resistor
m_msm->add_route(1, "speaker", MSM5232_BASE_VOLUME/1.5); // pin 29 4'-1 : 15k resistor
m_msm->add_route(2, "speaker", MSM5232_BASE_VOLUME); // pin 30 8'-1 : 10k resistor
m_msm->add_route(3, "speaker", MSM5232_BASE_VOLUME); // pin 31 16'-1 : 10k resistor
m_msm->add_route(4, "speaker", MSM5232_BASE_VOLUME/2.2); // pin 36 2'-2 : 22k resistor
m_msm->add_route(5, "speaker", MSM5232_BASE_VOLUME/1.5); // pin 35 4'-2 : 15k resistor
m_msm->add_route(6, "speaker", MSM5232_BASE_VOLUME); // pin 34 8'-2 : 10k resistor
m_msm->add_route(7, "speaker", MSM5232_BASE_VOLUME); // pin 33 16'-2 : 10k resistor
m_msm->add_route(8, "speaker", 1.0); // pin 1 SOLO 8' (this actually feeds an analog section)
m_msm->add_route(9, "speaker", 1.0); // pin 2 SOLO 16' (this actually feeds an analog section)
m_msm->add_route(10,"speaker", 0.12); // pin 22 Noise Output (this actually feeds an analog section)
ay8910_device &aysnd(AY8910(config, "aysnd", 6.144_MHz_XTAL/4)); /* verified on pcb */
aysnd.port_a_write_callback().set(FUNC(equites_state::equites_8910porta_w));
aysnd.port_b_write_callback().set(FUNC(equites_state::equites_8910portb_w));
aysnd.add_route(ALL_OUTPUTS, "speaker", 0.15);
DAC_6BIT_R2R(config, m_dac_1, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC
DAC_6BIT_R2R(config, m_dac_2, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT);
vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT);
vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
SAMPLES(config, m_samples);
m_samples->set_channels(3);
m_samples->set_samples_names(alphamc07_sample_names);
m_samples->add_route(ALL_OUTPUTS, "speaker", 0.3);
}
/******************************************************************************/
void equites_state::machine_start()
{
// zerofill
m_bgcolor = 0;
m_sound_prom_address = 0;
m_dac_latch = 0;
m_eq8155_port_b = 0;
m_eq8155_port_a = 0;
m_eq8155_port_c = 0;
m_ay_port_a = 0;
m_ay_port_b = 0;
m_eq_cymbal_ctrl = 0;
m_cymvol = 0.0;
m_hihatvol = 0.0;
m_timer_count = 0;
// register for savestates
save_item(NAME(m_bgcolor));
save_item(NAME(m_sound_prom_address));
save_item(NAME(m_dac_latch));
save_item(NAME(m_eq8155_port_b));
save_item(NAME(m_eq8155_port_a));
save_item(NAME(m_eq8155_port_c));
save_item(NAME(m_ay_port_a));
save_item(NAME(m_ay_port_b));
save_item(NAME(m_eq_cymbal_ctrl));
save_item(NAME(m_cymvol));
save_item(NAME(m_hihatvol));
save_item(NAME(m_timer_count));
m_adjuster_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(equites_state::equites_frq_adjuster_callback), this));
m_adjuster_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60));
}
void gekisou_state::machine_start()
@ -1119,12 +829,6 @@ void splndrbt_state::machine_start()
m_splndrbt_bg_scrolly = 0;
}
void equites_state::machine_reset()
{
m_audiocpu->set_input_line(I8085_INTR_LINE, CLEAR_LINE);
m_audiocpu->set_input_line(I8085_TRAP_LINE, CLEAR_LINE);
}
void equites_state::equites(machine_config &config)
{
/* basic machine hardware */
@ -1137,11 +841,11 @@ void equites_state::equites(machine_config &config)
m_mainlatch->q_out_cb<2>().set(m_alpha_8201, FUNC(alpha_8201_device::mcu_start_w));
m_mainlatch->q_out_cb<3>().set(m_alpha_8201, FUNC(alpha_8201_device::bus_dir_w)).invert();
common_sound(config);
ALPHA_8201(config, m_alpha_8201, 4000000/8); // 8303 or 8304 (same device!)
config.set_perfect_quantum("alpha_8201:mcu");
AD_59MC07(config, "sound_board");
WATCHDOG_TIMER(config, "watchdog");
/* video hardware */
@ -1173,8 +877,9 @@ void equites_state::bngotime(machine_config &config)
{
equites(config);
// TODO: emulate different sound board with Z80 + AY8910
m_audiocpu->set_disable();
m_maincpu->set_addrmap(AS_PROGRAM, &equites_state::bngotime_map);
AD_60MC01(config.replace(), "sound_board");
}
void splndrbt_state::splndrbt(machine_config &config)
@ -1190,7 +895,7 @@ void splndrbt_state::splndrbt(machine_config &config)
m_mainlatch->q_out_cb<2>().set(m_alpha_8201, FUNC(alpha_8201_device::bus_dir_w)).invert();
m_mainlatch->q_out_cb<3>().set(FUNC(splndrbt_state::splndrbt_selchar_w));
common_sound(config);
AD_59MC07(config, "sound_board");
ALPHA_8201(config, m_alpha_8201, 4000000/8); // 8303 or 8304 (same device!)
config.set_perfect_quantum("alpha_8201:mcu");
@ -1241,7 +946,7 @@ ROM_START( equites )
ROM_LOAD16_BYTE( "ep4", 0x0c001, 0x2000, CRC(b636e086) SHA1(5fc23a86b6051ecf6ff3f95f810f0eb471a203b0) )
ROM_LOAD16_BYTE( "ep8", 0x0c000, 0x2000, CRC(d7ee48b0) SHA1(d0398704d8e89f2b0a9ed05e18f7c644d1e047c0) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // 8085A ROMs
ROM_REGION( 0x10000, "sound_board:audiocpu", 0 ) // 8085A ROMs
ROM_LOAD( "ev1.1m", 0x00000, 0x2000, CRC(43faaf2e) SHA1(c9aaf298d673eb70399366776474f1b242549eb4) )
ROM_LOAD( "ev2.1l", 0x02000, 0x2000, CRC(09e6702d) SHA1(896771f73a486e5035909eeed9ef48103d81d4ae) )
ROM_LOAD( "ev3.1k", 0x04000, 0x2000, CRC(10ff140b) SHA1(7c28f988a9c8b2a702d007096199e67b447a183c) )
@ -1305,7 +1010,7 @@ ROM_START( equitess )
ROM_LOAD16_BYTE( "epr-ep4.9d", 0x0c001, 0x2000, CRC(956a06bd) SHA1(a716f9aaf0c32c522968f4ff13de904d6e8c7f98) )
ROM_LOAD16_BYTE( "epr-ep8.9b", 0x0c000, 0x2000, CRC(4c78d60d) SHA1(207a82779e2fe3e9082f4fa09b87c713a51167e6) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // 8085A ROMs
ROM_REGION( 0x10000, "sound_board:audiocpu", 0 ) // 8085A ROMs
ROM_LOAD( "ev1.1m", 0x00000, 0x2000, CRC(43faaf2e) SHA1(c9aaf298d673eb70399366776474f1b242549eb4) )
ROM_LOAD( "ev2.1l", 0x02000, 0x2000, CRC(09e6702d) SHA1(896771f73a486e5035909eeed9ef48103d81d4ae) )
ROM_LOAD( "ev3.1k", 0x04000, 0x2000, CRC(10ff140b) SHA1(7c28f988a9c8b2a702d007096199e67b447a183c) )
@ -1363,7 +1068,7 @@ ROM_START( bullfgtr )
ROM_LOAD16_BYTE( "hp7vr.bin", 0x08000, 0x2000, CRC(665cc015) SHA1(17fe18c8f22808a102f48bc4cbc8e4a1f6f9eaf1) )
ROM_FILL( 0x0c000, 0x4000, 0x00 )
ROM_REGION( 0x10000, "audiocpu", 0 ) // 8085A ROMs
ROM_REGION( 0x10000, "sound_board:audiocpu", 0 ) // 8085A ROMs
ROM_LOAD( "hv1vr.bin", 0x00000, 0x2000, CRC(2a8e6fcf) SHA1(866903408e05938a982ffef4c9b849203c6cc060) )
ROM_LOAD( "hv2vr.bin", 0x02000, 0x2000, CRC(026e1533) SHA1(6271869a3faaafacfac35262746e87a83c158b93) )
ROM_LOAD( "hv3vr.bin", 0x04000, 0x2000, CRC(51ee751c) SHA1(60bf848dfdfe313ab05df5a5c05819b0fa87ca50) )
@ -1445,7 +1150,7 @@ ROM_START( bullfgtrs )
ROM_LOAD16_BYTE( "m_b10.bin", 0x08000, 0x2000, CRC(9d84f678) SHA1(32584d54788cb570bd5210992836f28ba9c87aac) )
ROM_FILL( 0x0c000, 0x4000, 0x00 )
ROM_REGION( 0x10000, "audiocpu", 0 ) // 8085A ROMs
ROM_REGION( 0x10000, "sound_board:audiocpu", 0 ) // 8085A ROMs
ROM_LOAD( "hv1vr.bin", 0x00000, 0x2000, CRC(2a8e6fcf) SHA1(866903408e05938a982ffef4c9b849203c6cc060) )
ROM_LOAD( "hv2vr.bin", 0x02000, 0x2000, CRC(026e1533) SHA1(6271869a3faaafacfac35262746e87a83c158b93) )
ROM_LOAD( "hv3vr.bin", 0x04000, 0x2000, CRC(51ee751c) SHA1(60bf848dfdfe313ab05df5a5c05819b0fa87ca50) )
@ -1513,7 +1218,7 @@ ROM_START( kouyakyu )
ROM_LOAD16_BYTE( "epr-6709.bin", 0x08000, 0x2000, CRC(f41cb58c) SHA1(f0d1048e949d51432739755f985e4df65b8e918b) )
ROM_FILL( 0x0c000, 0x4000, 0x00 )
ROM_REGION( 0x10000, "audiocpu", 0 ) // 8085A ROMs
ROM_REGION( 0x10000, "sound_board:audiocpu", 0 ) // 8085A ROMs
ROM_LOAD( "epr-6703.bin", 0x00000, 0x2000, CRC(fbff3a86) SHA1(4ed2887b1e4509ded853a230f735d4d2aa475886) )
ROM_LOAD( "epr-6702.bin", 0x02000, 0x2000, CRC(27ddf031) SHA1(2f11d3b693e46852762669ed1e35a667990edec7) )
ROM_LOAD( "epr-6701.bin", 0x04000, 0x2000, CRC(3c83588a) SHA1(a84c813ba9d464cffc855397aaacbb9177c86fb4) )
@ -1581,7 +1286,7 @@ ROM_START( gekisou )
ROM_LOAD16_BYTE( "3.14b", 0x08001, 0x4000, CRC(7c1cf4d0) SHA1(a122d3a51d205123e04c694912809e0bb31155d5) )
ROM_LOAD16_BYTE( "4.14d", 0x08000, 0x4000, CRC(c7282391) SHA1(144a34d74bb1e71e2f799913ab04927d00faec87) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // 8085A ROMs
ROM_REGION( 0x10000, "sound_board:audiocpu", 0 ) // 8085A ROMs
ROM_LOAD( "v1.1l", 0x00000, 0x4000, CRC(dc6af437) SHA1(77112fec51343d8e73765b2a342a888612813c3b) )
ROM_LOAD( "v2.1h", 0x04000, 0x4000, CRC(cb12582e) SHA1(ef378232e2744540cc4c9187cfb36d780dadc962) )
ROM_LOAD( "v3.1e", 0x08000, 0x4000, CRC(0ab5e777) SHA1(9177c42418f022a65d73c3302873b894c5a137a4) )
@ -1649,7 +1354,7 @@ ROM_START( splndrbt )
ROM_LOAD16_BYTE( "3.15a", 0x08001, 0x4000, CRC(5b182189) SHA1(50ebb1fddcb6838442e8a20261f200f3386ce8a8) )
ROM_LOAD16_BYTE( "4.15c", 0x08000, 0x4000, CRC(cde99613) SHA1(250b59f75eee84442da3cc7c599d1e16f0294df9) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // 8085A ROMs
ROM_REGION( 0x10000, "sound_board:audiocpu", 0 ) // 8085A ROMs
ROM_LOAD( "1_v.1m", 0x00000, 0x2000, CRC(1b3a6e42) SHA1(41a4f0503c939ec0a739c8bc6bf3c8fc354912ee) )
ROM_LOAD( "2_v.1l", 0x02000, 0x2000, CRC(2a618c72) SHA1(6ad459d94352c317150ae6344d4db9bb613938dd) )
ROM_LOAD( "3_v.1k", 0x04000, 0x2000, CRC(bbee5346) SHA1(753cb784b04f081fa1f8590dc28056d9918f313b) )
@ -1699,7 +1404,7 @@ ROM_START( splndrbta )
ROM_LOAD16_BYTE( "3red.15b", 0x08001, 0x4000, CRC(788deb02) SHA1(a4e79621bf4cda50dfb8dfab7f70dc4021065794) )
ROM_LOAD16_BYTE( "4red.15c", 0x08000, 0x4000, CRC(d02a5606) SHA1(6bb2e5d95ea711452dd40218bd90488d70f82006) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // 8085A ROMs
ROM_REGION( 0x10000, "sound_board:audiocpu", 0 ) // 8085A ROMs
ROM_LOAD( "8v.1l", 0x00000, 0x4000, CRC(71b2ec29) SHA1(89c630c5bf9c4752b01006183d1419fe6a458f5c) )
ROM_LOAD( "9v.1h", 0x04000, 0x4000, CRC(e95abcb5) SHA1(1680875fc16d1a4e1054ccdabdf6fd06d434a163) )
@ -1747,7 +1452,7 @@ ROM_START( splndrbtb )
ROM_LOAD16_BYTE( "3blue.15a", 0x08001, 0x4000, CRC(bce26d4f) SHA1(81a295e665af9e46ff28618f2f77f31f41f14a4f) )
ROM_LOAD16_BYTE( "4blue.15c", 0x08000, 0x4000, CRC(5715ec1b) SHA1(fddf45a4e1b2fd319b0a47376c11ce2a41c40eb2) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // 8085A ROMs
ROM_REGION( 0x10000, "sound_board:audiocpu", 0 ) // 8085A ROMs
ROM_LOAD( "1_v.1m", 0x00000, 0x2000, CRC(1b3a6e42) SHA1(41a4f0503c939ec0a739c8bc6bf3c8fc354912ee) )
ROM_LOAD( "2_v.1l", 0x02000, 0x2000, CRC(2a618c72) SHA1(6ad459d94352c317150ae6344d4db9bb613938dd) )
ROM_LOAD( "3_v.1k", 0x04000, 0x2000, CRC(bbee5346) SHA1(753cb784b04f081fa1f8590dc28056d9918f313b) )
@ -1797,7 +1502,7 @@ ROM_START( splndrbt2 )
ROM_LOAD16_BYTE( "3.a15", 0x08001, 0x4000, CRC(936f7cc9) SHA1(ef1601097659700f4a4b53fb57cd6d73efa03e0d) )
ROM_LOAD16_BYTE( "4.c15", 0x08000, 0x4000, CRC(3ff7c7b5) SHA1(4997efd4427f09a5427f752d0147b648fbdce252) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // 8085A ROMs
ROM_REGION( 0x10000, "sound_board:audiocpu", 0 ) // 8085A ROMs
ROM_LOAD( "s1.m1", 0x00000, 0x02000, CRC(045eac1b) SHA1(49ecc73b999719e470b2ef0afee6a84df620e0d9) )
ROM_LOAD( "s2.l1", 0x02000, 0x02000, CRC(65a3d094) SHA1(f6415eb323478a2d38acd4507404d9530fac77c4) )
ROM_LOAD( "s3.k1", 0x04000, 0x02000, CRC(980d38be) SHA1(c07f9851cfb6352781568f333d931b4ca08fd888) )
@ -1866,7 +1571,7 @@ ROM_START( hvoltage )
ROM_LOAD16_BYTE( "3.15a", 0x08001, 0x4000, CRC(677abe14) SHA1(78b343122f9ad187c823bf49e8f001288c762586) )
ROM_LOAD16_BYTE( "4.15c", 0x08000, 0x4000, CRC(8aab5a20) SHA1(fb90817173ad69c0e00d03814b4e10b18955c07e) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // 8085A ROMs
ROM_REGION( 0x10000, "sound_board:audiocpu", 0 ) // 8085A ROMs
ROM_LOAD( "5_v.1l", 0x00000, 0x4000, CRC(ed9bb6ea) SHA1(73b0251b86835368ec2a4e98a5f61e28e58fd234) )
ROM_LOAD( "6_v.1h", 0x04000, 0x4000, CRC(e9542211) SHA1(482f2c90e842fe5cc31cc6a39025adf65ba47ce9) )
ROM_LOAD( "7_v.1e", 0x08000, 0x4000, CRC(44d38554) SHA1(6765971376eafa218fda1accb1e173a7c1850cc8) )
@ -1929,7 +1634,7 @@ ROM_START( bngotime )
ROM_LOAD16_BYTE( "3.b14", 0x08001, 0x4000, CRC(e22555ab) SHA1(5c533b0b99ef600e2bc42c21b79a1a6914b1fc1e) )
ROM_LOAD16_BYTE( "2.d14", 0x08000, 0x4000, CRC(0f328bde) SHA1(30a98924600fc2beec8227100adfa6dfbbce5d67) )
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_REGION( 0x10000, "sound_board:audiocpu", 0 )
ROM_LOAD( "11.sub", 0x00000, 0x2000, CRC(9b063c07) SHA1(c9fe7fe10bd204cb82066db7b576072df7787046) )
ROM_REGION( 0x2000, "alpha_8201:mcu", 0 )
@ -2008,7 +1713,7 @@ GAME( 1984, bullfgtr, 0, equites, bullfgtr, equites_state, init_equite
GAME( 1984, bullfgtrs, bullfgtr, equites, bullfgtr, equites_state, init_equites, ROT90, "Alpha Denshi Co. (Sega license)", "Bull Fighter (Sega)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1985, kouyakyu, 0, equites, kouyakyu, equites_state, init_equites, ROT0, "Alpha Denshi Co.", "The Koukou Yakyuu", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1985, gekisou, 0, gekisou, gekisou, gekisou_state, init_equites, ROT90, "Eastern Corp.", "Gekisou (Japan)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1986, bngotime, 0, bngotime, equites, equites_state, init_equites, ROT90, "CLS", "Bingo Time", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // needs inputs, emulation of the sound board
GAME( 1986, bngotime, 0, bngotime, equites, equites_state, init_equites, ROT90, "CLS", "Bingo Time", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // needs inputs, emulation of the sound board
// Splendor Blast Hardware
GAME( 1985, splndrbt, 0, splndrbt, splndrbt, splndrbt_state, init_splndrbt, ROT0, "Alpha Denshi Co.", "Splendor Blast (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )

View File

@ -10,15 +10,9 @@
#pragma once
#include "cpu/i8085/i8085.h"
#include "machine/74259.h"
#include "machine/alpha8201.h"
#include "machine/gen_latch.h"
#include "machine/i8155.h"
#include "machine/timer.h"
#include "sound/dac.h"
#include "sound/msm5232.h"
#include "sound/samples.h"
#include "emupal.h"
#include "screen.h"
#include "tilemap.h"
@ -33,17 +27,10 @@ public:
m_spriteram(*this, "spriteram"),
m_spriteram_2(*this, "spriteram_2"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_audio8155(*this, "audio8155"),
m_samples(*this, "samples"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_screen(*this, "screen"),
m_alpha_8201(*this, "alpha_8201"),
m_msm(*this, "msm"),
m_dac_1(*this, "dac1"),
m_dac_2(*this, "dac2"),
m_soundlatch(*this, "soundlatch"),
m_mainlatch(*this, "mainlatch")
{ }
@ -58,41 +45,14 @@ public:
tilemap_t *m_bg_tilemap;
uint8_t m_bgcolor;
/* misc */
int m_sound_prom_address;
uint8_t m_dac_latch;
uint8_t m_eq8155_port_b;
uint8_t m_eq8155_port_a;
uint8_t m_eq8155_port_c;
uint8_t m_ay_port_a;
uint8_t m_ay_port_b;
uint8_t m_eq_cymbal_ctrl;
emu_timer *m_adjuster_timer;
float m_cymvol;
float m_hihatvol;
int m_timer_count;
/* devices */
required_device<cpu_device> m_maincpu;
required_device<i8085a_cpu_device> m_audiocpu;
required_device<i8155_device> m_audio8155;
required_device<samples_device> m_samples;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<screen_device> m_screen;
required_device<alpha_8201_device> m_alpha_8201;
required_device<msm5232_device> m_msm;
required_device<dac_byte_interface> m_dac_1;
required_device<dac_byte_interface> m_dac_2;
required_device<generic_latch_8_device> m_soundlatch;
required_device<ls259_device> m_mainlatch;
DECLARE_WRITE8_MEMBER(equites_c0f8_w);
DECLARE_WRITE8_MEMBER(equites_cymbal_ctrl_w);
DECLARE_WRITE8_MEMBER(equites_dac_latch_w);
DECLARE_WRITE8_MEMBER(equites_8155_porta_w);
DECLARE_WRITE8_MEMBER(equites_8155_portb_w);
DECLARE_WRITE8_MEMBER(equites_8155_portc_w);
DECLARE_READ16_MEMBER(equites_spriteram_kludge_r);
DECLARE_WRITE8_MEMBER(mainlatch_w);
DECLARE_READ8_MEMBER(equites_fg_videoram_r);
@ -101,21 +61,15 @@ public:
DECLARE_WRITE8_MEMBER(equites_bgcolor_w);
DECLARE_WRITE16_MEMBER(equites_scrollreg_w);
DECLARE_WRITE_LINE_MEMBER(flip_screen_w);
DECLARE_WRITE8_MEMBER(equites_8910porta_w);
DECLARE_WRITE8_MEMBER(equites_8910portb_w);
void init_equites();
TILE_GET_INFO_MEMBER(equites_fg_info);
TILE_GET_INFO_MEMBER(equites_bg_info);
DECLARE_VIDEO_START(equites);
void equites_palette(palette_device &palette) const;
uint32_t screen_update_equites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(equites_8155_timer_pulse);
TIMER_CALLBACK_MEMBER(equites_frq_adjuster_callback);
TIMER_DEVICE_CALLBACK_MEMBER(equites_scanline);
DECLARE_WRITE_LINE_MEMBER(equites_msm5232_gate);
void equites_draw_sprites_block(bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end);
void equites_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
void equites_update_dac();
void unpack_block(const char *region, int offset, int size);
void unpack_region(const char *region);
void equites(machine_config &config);
@ -123,12 +77,9 @@ public:
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
void common_sound(machine_config &config);
void bngotime_map(address_map &map);
void equites_map(address_map &map);
void equites_common_map(address_map &map);
void sound_map(address_map &map);
void sound_portmap(address_map &map);
};
class gekisou_state : public equites_state