mirror of
https://github.com/holub/mame
synced 2025-04-21 16:01:56 +03:00
Wrote a new device for TA7630, hooked it up to buggychl.cpp (nw)
This commit is contained in:
parent
3ddb27cd82
commit
e3ccbe1852
@ -1433,3 +1433,15 @@ if (SOUNDS["DAVE"]~=null) then
|
||||
MAME_DIR .. "src/devices/sound/dave.h",
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------------------------------
|
||||
-- Toshiba TA7630
|
||||
--@src/devices/sound/ta7630.h,SOUNDS["TA7630"] = true
|
||||
---------------------------------------------------
|
||||
|
||||
if (SOUNDS["TA7630"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/sound/ta7630.cpp",
|
||||
MAME_DIR .. "src/devices/sound/ta7630.h",
|
||||
}
|
||||
end
|
||||
|
@ -265,6 +265,7 @@ SOUNDS["AD1848"] = true
|
||||
SOUNDS["VOLT_REG"] = true
|
||||
SOUNDS["MEA8000"] = true
|
||||
SOUNDS["DAC76"] = true
|
||||
SOUNDS["TA7630"] = true
|
||||
SOUNDS["MM5837"] = true
|
||||
--SOUNDS["DAVE"] = true
|
||||
|
||||
|
93
src/devices/sound/ta7630.cpp
Normal file
93
src/devices/sound/ta7630.cpp
Normal file
@ -0,0 +1,93 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Angelo Salese
|
||||
/***************************************************************************
|
||||
|
||||
TA7630P
|
||||
|
||||
Toshiba Dual. Volume / Balance / Tone (Bass/Treble)
|
||||
|
||||
A set of discrete filters that applies to sound chip outputs.
|
||||
According to the datasheet, two channels are outputted from here after it applies
|
||||
all of the filters
|
||||
|
||||
TODO:
|
||||
- mostly a placeholder, needs a way to read from sound chips and output
|
||||
back with filters enabled;
|
||||
- filters balance/bass/treble;
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "ta7630.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
DEFINE_DEVICE_TYPE(TA7630, ta7630_device, "ta7630", "TA7630 Device")
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// ta7630_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
ta7630_device::ta7630_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, TA7630, tag, owner, clock)
|
||||
// ,device_sound_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void ta7630_device::device_start()
|
||||
{
|
||||
int i;
|
||||
|
||||
double db = 0.0;
|
||||
double db_step = 1.50; /* 1.50 dB step (at least, maybe more) */
|
||||
double db_step_inc = 0.125;
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
double max = 100.0 / pow(10.0, db/20.0 );
|
||||
m_vol_ctrl[15 - i] = max / 100.0;
|
||||
//m_vol_ctrl[i] = max;
|
||||
/*logerror("vol_ctrl[%x] = %i (%f dB)\n", 15 - i, m_vol_ctrl[15 - i], db);*/
|
||||
db += db_step;
|
||||
db_step += db_step_inc;
|
||||
}
|
||||
|
||||
save_item(NAME(m_vol_ctrl));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void ta7630_device::device_reset()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// filter setters
|
||||
//**************************************************************************
|
||||
|
||||
void ta7630_device::set_device_volume(device_sound_interface *device,uint8_t value)
|
||||
{
|
||||
device->set_output_gain(ALL_OUTPUTS,m_vol_ctrl[value & 0xf]);
|
||||
}
|
||||
|
61
src/devices/sound/ta7630.h
Normal file
61
src/devices/sound/ta7630.h
Normal file
@ -0,0 +1,61 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Angelo Salese
|
||||
/***************************************************************************
|
||||
|
||||
TA7630P
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_SOUND_TA7630_H
|
||||
#define MAME_SOUND_TA7630_H
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
||||
#define MCFG_TA7630_ADD(tag) \
|
||||
MCFG_DEVICE_ADD((tag), TA7630, (0))
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> ta7630_device
|
||||
|
||||
class ta7630_device : public device_t
|
||||
/*, public device_sound_interface*/
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
ta7630_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// filter setters
|
||||
void set_device_volume(device_sound_interface *device,uint8_t value);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
//virtual void device_validity_check(validity_checker &valid) const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
double m_vol_ctrl[16]; // table for volume gains
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(TA7630, ta7630_device)
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
|
||||
#endif // MAME_SOUND_TA7630_H
|
@ -17,11 +17,16 @@ TODO:
|
||||
background, and the gradient can move around (the latter doesn't seem to
|
||||
be used except for making it cover the whole screen on the title screen,
|
||||
and start at the middle during gameplay)
|
||||
Update: stage 2 is supposed to have a different gradient, how/where
|
||||
this is located is unknown (pen 0x20?)
|
||||
- Video driver is largely unoptimized
|
||||
- Support for the 7630's controlling the sound chip outputs (bass/treble,
|
||||
volume) is completely missing.
|
||||
- The sound Z80 seems to write answers for the main Z80, but the latter doesn't
|
||||
seem to read them.
|
||||
- videoram and spriteram garbage occurs when entering into cross hatch test and exiting.
|
||||
Game attempts to transfer content of videoram into spriteram/scrollram, then transfer
|
||||
back again into videoram. Maybe the host CPU cannot read contents of VRAM at all?
|
||||
|
||||
Notes:
|
||||
- There is also a 4-channel version of the sound board for the cockpit
|
||||
@ -93,7 +98,6 @@ Schematics show the jumper set to the 6mhz setting.
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "cpu/m6805/m6805.h"
|
||||
#include "machine/watchdog.h"
|
||||
#include "sound/ay8910.h"
|
||||
#include "speaker.h"
|
||||
|
||||
#include "buggychl.lh"
|
||||
@ -239,7 +243,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, buggychl_state )
|
||||
AM_RANGE(0x4800, 0x4801) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
|
||||
AM_RANGE(0x4802, 0x4803) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
|
||||
AM_RANGE(0x4810, 0x481d) AM_DEVWRITE("msm", msm5232_device, write)
|
||||
AM_RANGE(0x4820, 0x4820) AM_RAM /* VOL/BAL for the 7630 on the MSM5232 output */
|
||||
AM_RANGE(0x4820, 0x4820) AM_WRITE(ta7630_volbal_msm_w) /* VOL/BAL for the 7630 on the MSM5232 output */
|
||||
AM_RANGE(0x4830, 0x4830) AM_RAM /* TRBL/BASS for the 7630 on the MSM5232 output */
|
||||
AM_RANGE(0x5000, 0x5000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
|
||||
AM_RANGE(0x5001, 0x5001) AM_READ(sound_status_sound_r) AM_DEVWRITE("soundnmi", input_merger_device, in_set<1>)
|
||||
@ -392,19 +396,28 @@ static GFXDECODE_START( buggychl )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
WRITE8_MEMBER(buggychl_state::ta7630_volbal_msm_w)
|
||||
{
|
||||
m_ta7630->set_device_volume(m_msm, data >> 4);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(buggychl_state::port_a_0_w)
|
||||
WRITE8_MEMBER(buggychl_state::ta7630_volbal_ay1_w)
|
||||
{
|
||||
/* VOL/BAL for the 7630 on this 8910 output */
|
||||
m_ta7630->set_device_volume(m_ay1, data >> 4);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(buggychl_state::port_b_0_w)
|
||||
{
|
||||
/* TRBL/BASS for the 7630 on this 8910 output */
|
||||
}
|
||||
WRITE8_MEMBER(buggychl_state::port_a_1_w)
|
||||
|
||||
WRITE8_MEMBER(buggychl_state::ta7630_volbal_ay2_w)
|
||||
{
|
||||
/* VOL/BAL for the 7630 on this 8910 output */
|
||||
m_ta7630->set_device_volume(m_ay2, data >> 4);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(buggychl_state::port_b_1_w)
|
||||
{
|
||||
/* TRBL/BASS for the 7630 on this 8910 output */
|
||||
@ -483,13 +496,15 @@ static MACHINE_CONFIG_START( buggychl )
|
||||
|
||||
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
|
||||
|
||||
MCFG_TA7630_ADD("ta7630")
|
||||
|
||||
MCFG_SOUND_ADD("ay1", YM2149, XTAL_8MHz/4)
|
||||
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(buggychl_state, port_a_0_w))
|
||||
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(buggychl_state, ta7630_volbal_ay1_w))
|
||||
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(buggychl_state, port_b_0_w))
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
|
||||
MCFG_SOUND_ADD("ay2", YM2149, XTAL_8MHz/4)
|
||||
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(buggychl_state, port_a_1_w))
|
||||
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(buggychl_state, ta7630_volbal_ay2_w))
|
||||
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(buggychl_state, port_b_1_w))
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
|
||||
@ -575,5 +590,5 @@ ROM_START( buggychlt )
|
||||
ROM_END
|
||||
|
||||
|
||||
GAMEL( 1984, buggychl, 0, buggychl, buggychl, buggychl_state, 0, ROT270, "Taito Corporation", "Buggy Challenge", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE, layout_buggychl )
|
||||
GAMEL( 1984, buggychlt,buggychl, buggychl, buggychl, buggychl_state, 0, ROT270, "Taito Corporation (Tecfri license)", "Buggy Challenge (Tecfri)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE, layout_buggychl )
|
||||
GAMEL( 1984, buggychl, 0, buggychl, buggychl, buggychl_state, 0, ROT270, "Taito Corporation", "Buggy Challenge", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE, layout_buggychl )
|
||||
GAMEL( 1984, buggychlt,buggychl, buggychl, buggychl, buggychl_state, 0, ROT270, "Taito Corporation (Tecfri license)", "Buggy Challenge (Tecfri)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE, layout_buggychl )
|
||||
|
@ -8,6 +8,8 @@
|
||||
#include "machine/input_merger.h"
|
||||
#include "machine/gen_latch.h"
|
||||
#include "sound/msm5232.h"
|
||||
#include "sound/ta7630.h"
|
||||
#include "sound/ay8910.h"
|
||||
#include "screen.h"
|
||||
|
||||
class buggychl_state : public driver_device
|
||||
@ -23,14 +25,17 @@ public:
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_bmcu(*this, "bmcu"),
|
||||
m_ta7630(*this, "ta7630"),
|
||||
m_msm(*this, "msm"),
|
||||
m_ay1(*this, "ay1"),
|
||||
m_ay2(*this, "ay2"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_screen(*this, "screen"),
|
||||
m_palette(*this, "palette"),
|
||||
m_soundnmi(*this, "soundnmi"),
|
||||
m_soundlatch(*this, "soundlatch"),
|
||||
m_soundlatch2(*this, "soundlatch2"),
|
||||
m_pedal_input(*this, "PEDAL")
|
||||
m_pedal_input(*this, "PEDAL")
|
||||
{ }
|
||||
|
||||
/* memory pointers */
|
||||
@ -44,7 +49,10 @@ public:
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<taito68705_mcu_device> m_bmcu;
|
||||
required_device<ta7630_device> m_ta7630;
|
||||
required_device<msm5232_device> m_msm;
|
||||
required_device<ay8910_device> m_ay1;
|
||||
required_device<ay8910_device> m_ay2;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<palette_device> m_palette;
|
||||
@ -63,10 +71,11 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(buggychl_sprite_lookup_w);
|
||||
DECLARE_WRITE8_MEMBER(buggychl_ctrl_w);
|
||||
DECLARE_WRITE8_MEMBER(buggychl_bg_scrollx_w);
|
||||
DECLARE_WRITE8_MEMBER(port_a_0_w);
|
||||
DECLARE_WRITE8_MEMBER(ta7630_volbal_ay1_w);
|
||||
DECLARE_WRITE8_MEMBER(port_b_0_w);
|
||||
DECLARE_WRITE8_MEMBER(port_a_1_w);
|
||||
DECLARE_WRITE8_MEMBER(ta7630_volbal_ay2_w);
|
||||
DECLARE_WRITE8_MEMBER(port_b_1_w);
|
||||
DECLARE_WRITE8_MEMBER(ta7630_volbal_msm_w);
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
Loading…
Reference in New Issue
Block a user