diff options
author | angelosa <salese_corp_ltd@email.it> | 2017-09-22 01:45:59 +0200 |
---|---|---|
committer | angelosa <salese_corp_ltd@email.it> | 2017-09-22 02:01:48 +0200 |
commit | a7b7edb534ca5c4e83488b99e971a5016267b387 (patch) | |
tree | cab9f0827b08cce5e8c47abd470c0559a87b9ee7 | |
parent | f25a13acc50a0683346d494e571a8d0e8d1bf697 (diff) |
Converted 40 Love to use ta7630 (nw)
-rw-r--r-- | src/mame/drivers/40love.cpp | 60 | ||||
-rw-r--r-- | src/mame/drivers/flstory.cpp | 2 | ||||
-rw-r--r-- | src/mame/includes/40love.h | 7 |
3 files changed, 26 insertions, 43 deletions
diff --git a/src/mame/drivers/40love.cpp b/src/mame/drivers/40love.cpp index f4ab405f26d..6f6764f31db 100644 --- a/src/mame/drivers/40love.cpp +++ b/src/mame/drivers/40love.cpp @@ -226,7 +226,6 @@ Notes - Has jumper setting for 122HZ or 61HZ) #include "cpu/m6805/m6805.h" #include "cpu/z80/z80.h" -#include "sound/ay8910.h" #include "sound/dac.h" #include "sound/volt_reg.h" #include "screen.h" @@ -450,63 +449,40 @@ static ADDRESS_MAP_START( undoukai_map, AS_PROGRAM, 8, fortyl_state ) AM_RANGE(0xc000, 0xffff) AM_READWRITE(fortyl_pixram_r, fortyl_pixram_w) ADDRESS_MAP_END -MACHINE_RESET_MEMBER(fortyl_state,ta7630) -{ - 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; - /*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,4 MSM5232 group1,group2 -*/ -} - WRITE8_MEMBER(fortyl_state::sound_control_0_w) { m_snd_ctrl0 = data & 0xff; // popmessage("SND0 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); /* this definitely controls main melody voice on 2'-1 and 4'-1 outputs */ - m_msm->set_output_gain(0, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ - m_msm->set_output_gain(1, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ - m_msm->set_output_gain(2, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ - m_msm->set_output_gain(3, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ + for(int i=0;i<4;i++) + m_ta7630->set_channel_volume(m_msm,i,m_snd_ctrl0 >> 4); + + //m_msm->set_output_gain(0, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ + //m_msm->set_output_gain(1, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ + //m_msm->set_output_gain(2, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ + //m_msm->set_output_gain(3, m_vol_ctrl[(m_snd_ctrl0 >> 4) & 15] / 100.0); /* group1 from msm5232 */ } WRITE8_MEMBER(fortyl_state::sound_control_1_w) { m_snd_ctrl1 = data & 0xff; // popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); - m_msm->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ - m_msm->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ - m_msm->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ - m_msm->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + for(int i=0;i<4;i++) + m_ta7630->set_channel_volume(m_msm,i+4,m_snd_ctrl1 >> 4); + + //m_msm->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + //m_msm->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + //m_msm->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + //m_msm->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ } WRITE8_MEMBER(fortyl_state::sound_control_2_w) { - device_t *device = machine().device("aysnd"); - int i; m_snd_ctrl2 = data & 0xff; // popmessage("SND2 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); - device_sound_interface *sound; - device->interface(sound); - for (i = 0; i < 3; i++) - sound->set_output_gain(i, m_vol_ctrl[(m_snd_ctrl2 >> 4) & 15] / 100.0); /* ym2149f all */ + m_ta7630->set_device_volume(m_ay,m_snd_ctrl2 >> 4); } WRITE8_MEMBER(fortyl_state::sound_control_3_w)/* unknown */ @@ -752,7 +728,7 @@ MACHINE_START_MEMBER(fortyl_state,40love) MACHINE_RESET_MEMBER(fortyl_state,common) { - MACHINE_RESET_CALL_MEMBER(ta7630); + //MACHINE_RESET_CALL_MEMBER(ta7630); /* video */ m_pix1 = 0; @@ -809,7 +785,8 @@ static MACHINE_CONFIG_START( 40love ) MCFG_SPEAKER_STANDARD_MONO("speaker") MCFG_GENERIC_LATCH_8_ADD("soundlatch") - + MCFG_TA7630_ADD("ta7630") + MCFG_SOUND_ADD("aysnd", AY8910, 2000000) MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(fortyl_state, sound_control_2_w)) MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(fortyl_state, sound_control_3_w)) @@ -867,6 +844,7 @@ static MACHINE_CONFIG_START( undoukai ) MCFG_SPEAKER_STANDARD_MONO("speaker") MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_TA7630_ADD("ta7630") MCFG_SOUND_ADD("aysnd", AY8910, 2000000) MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(fortyl_state, sound_control_2_w)) diff --git a/src/mame/drivers/flstory.cpp b/src/mame/drivers/flstory.cpp index 88ecd3ee318..7a9f269692f 100644 --- a/src/mame/drivers/flstory.cpp +++ b/src/mame/drivers/flstory.cpp @@ -138,7 +138,7 @@ WRITE8_MEMBER(flstory_state::sound_control_1_w) m_snd_ctrl1 = data & 0xff; // popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); for(int i=0;i<4;i++) - m_ta7630->set_channel_volume(m_msm,i+4,m_snd_ctrl0 >> 4); + m_ta7630->set_channel_volume(m_msm,i+4,m_snd_ctrl1 >> 4); // m_msm->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ // m_msm->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ diff --git a/src/mame/includes/40love.h b/src/mame/includes/40love.h index f3c9f6ccde1..a06f2518960 100644 --- a/src/mame/includes/40love.h +++ b/src/mame/includes/40love.h @@ -4,6 +4,8 @@ #include "machine/taito68705interface.h" #include "machine/gen_latch.h" #include "sound/msm5232.h" +#include "sound/ay8910.h" +#include "sound/ta7630.h" class fortyl_state : public driver_device { @@ -20,6 +22,8 @@ public: m_maincpu(*this, "maincpu"), m_bmcu(*this, "bmcu"), m_msm(*this, "msm"), + m_ay(*this,"aysnd"), + m_ta7630(*this,"ta7630"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch") { } @@ -68,6 +72,8 @@ public: required_device<cpu_device> m_maincpu; optional_device<taito68705_mcu_device> m_bmcu; required_device<msm5232_device> m_msm; + required_device<ay8910_device> m_ay; + 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; @@ -102,7 +108,6 @@ public: DECLARE_MACHINE_START(40love); DECLARE_MACHINE_RESET(40love); DECLARE_MACHINE_RESET(common); - DECLARE_MACHINE_RESET(ta7630); uint32_t screen_update_fortyl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void redraw_pixels(); void fortyl_set_scroll_x( int offset ); |