ta7630 hookup for msisaac (nw)

This commit is contained in:
angelosa 2017-09-22 01:27:15 +02:00
parent e3ccbe1852
commit bd91c93eff
4 changed files with 30 additions and 39 deletions

View File

@ -91,3 +91,10 @@ void ta7630_device::set_device_volume(device_sound_interface *device,uint8_t val
device->set_output_gain(ALL_OUTPUTS,m_vol_ctrl[value & 0xf]);
}
// Most Taito implementations seems to use this, is it correct?
void ta7630_device::set_channel_volume(device_sound_interface *device, uint8_t ch,uint8_t value)
{
device->set_output_gain(ch,m_vol_ctrl[value & 0xf]);
}

View File

@ -36,7 +36,8 @@ public:
// filter setters
void set_device_volume(device_sound_interface *device,uint8_t value);
void set_channel_volume(device_sound_interface *device, uint8_t ch,uint8_t value);
protected:
// device-level overrides
//virtual void device_validity_check(validity_checker &valid) const override;

View File

@ -213,44 +213,26 @@ static ADDRESS_MAP_START( msisaac_map, AS_PROGRAM, 8, msisaac_state )
// AM_RANGE(0xfc03, 0xfc04) AM_WRITE(msisaac_coin_counter_w)
ADDRESS_MAP_END
MACHINE_RESET_MEMBER(msisaac_state,ta7630)
{
int i;
double db = 0.0;
double db_step = 0.50; /* 0.50 dB step (at least, maybe more) */
double db_step_inc = 0.275;
for (i=0; i<16; i++)
{
double max = 100.0 / pow(10.0, db/20.0 );
m_vol_ctrl[15 - 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;
}
/*for (i=0; i<8; i++)
logerror("SOUND Chan#%i name=%s\n", i, mixer_get_name(i) );*/
/*
channels 0-2 AY#0
channels 3-5 AY#1
channels 6,7 MSM5232 group1,group2
*/
}
WRITE8_MEMBER(msisaac_state::sound_control_0_w)
{
m_snd_ctrl0 = data & 0xff;
//popmessage("SND0 0=%2x 1=%2x", m_snd_ctrl0, m_snd_ctrl1);
m_msm->set_output_gain(0, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */
m_msm->set_output_gain(1, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */
m_msm->set_output_gain(2, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */
m_msm->set_output_gain(3, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */
m_msm->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */
m_msm->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */
m_msm->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */
m_msm->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */
for(int i=0;i<4;i++)
{
// group1
m_ta7630->set_channel_volume(m_msm,i, m_snd_ctrl0 & 0xf);
// group2
m_ta7630->set_channel_volume(m_msm,i+4, m_snd_ctrl0 >> 4);
}
// m_msm->set_output_gain(0, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */
// m_msm->set_output_gain(1, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */
// m_msm->set_output_gain(2, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */
// m_msm->set_output_gain(3, m_vol_ctrl[m_snd_ctrl0 & 15] / 100.0); /* group1 from msm5232 */
// m_msm->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */
// m_msm->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */
// m_msm->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */
// m_msm->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group2 from msm5232 */
}
WRITE8_MEMBER(msisaac_state::sound_control_1_w)
{
@ -432,7 +414,6 @@ void msisaac_state::machine_start()
/* sound */
save_item(NAME(m_sound_nmi_enable));
save_item(NAME(m_pending_nmi));
save_item(NAME(m_vol_ctrl));
save_item(NAME(m_snd_ctrl0));
save_item(NAME(m_snd_ctrl1));
@ -445,7 +426,7 @@ void msisaac_state::machine_start()
void msisaac_state::machine_reset()
{
MACHINE_RESET_CALL_MEMBER(ta7630);
//MACHINE_RESET_CALL_MEMBER(ta7630);
/* video */
m_bg2_textbank = 0;
@ -499,7 +480,8 @@ static MACHINE_CONFIG_START( msisaac )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_TA7630_ADD("ta7630")
MCFG_SOUND_ADD("ay1", AY8910, 2000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)

View File

@ -4,6 +4,7 @@
#include "machine/taito68705interface.h"
#include "machine/gen_latch.h"
#include "sound/msm5232.h"
#include "sound/ta7630.h"
/* Disabled because the mcu dump is currently unavailable. -AS */
//#define USE_MCU
@ -21,6 +22,7 @@ public:
m_maincpu(*this, "maincpu"),
m_bmcu(*this, "bmcu"),
m_msm(*this, "msm"),
m_ta7630(*this, "ta7630"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch") { }
@ -49,7 +51,6 @@ public:
uint8_t m_direction;
#endif
int m_vol_ctrl[16];
uint8_t m_snd_ctrl0;
uint8_t m_snd_ctrl1;
uint8_t m_snd_ctrl2;
@ -60,6 +61,7 @@ public:
required_device<cpu_device> m_maincpu;
optional_device<taito68705_mcu_device> m_bmcu;
required_device<msm5232_device> m_msm;
required_device<ta7630_device> m_ta7630;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
@ -89,7 +91,6 @@ public:
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
DECLARE_MACHINE_RESET(ta7630);
uint32_t screen_update_msisaac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(nmi_callback);
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );