diff options
Diffstat (limited to 'src/mame/audio/8080bw.cpp')
-rw-r--r-- | src/mame/audio/8080bw.cpp | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/src/mame/audio/8080bw.cpp b/src/mame/audio/8080bw.cpp index b8ec710d20f..a62568a5ae8 100644 --- a/src/mame/audio/8080bw.cpp +++ b/src/mame/audio/8080bw.cpp @@ -1137,6 +1137,84 @@ WRITE8_MEMBER(_8080bw_state::schasercv_sh_port_2_w) +/*****************************************/ +/* Crash Road preliminary sound */ +/* Much more work needs to be done */ +/*****************************************/ + +WRITE8_MEMBER(_8080bw_state::crashrd_port03_w) +{ + int effect; + + /* bit 0 - Dot Sound Pitch (SX1) + bit 2 - Explosion (SX5) + bit 4 - Dot Sound Enable (SX0) + bit 5 - Effect Sound C (SX4) */ + + m_discrete->write(space, SCHASER_SND_EN, BIT(data,5)); + machine().sound().system_enable(BIT(data,5)); + m_discrete->write(space, SCHASER_DOT_EN, BIT(data, 4)); + m_discrete->write(space, SCHASER_DOT_SEL, BIT(data, 0)); + + /* The effect is a variable rate 555 timer. A diode/resistor array is used to + * select the frequency. Because of the diode voltage drop, we can not use the + * standard 555 time formulas. Also, when effect=0, the charge resistor + * is disconnected. This causes the charge on the cap to slowly bleed off, but + * but the bleed time is so long, that we can just cheat and put the time on hold + * when effect = 0. */ + effect = 0; //(data >> 2) & 0x07; + if (m_schaser_last_effect != effect) + { + if (effect) + { + if (m_schaser_effect_555_time_remain != attotime::zero) + { + /* timer re-enabled, use up remaining 555 high time */ + m_schaser_effect_555_timer->adjust(m_schaser_effect_555_time_remain, effect); + } + else if (!m_schaser_effect_555_is_low) + { + /* set 555 high time */ + attotime new_time = attotime(0, ATTOSECONDS_PER_SECOND * .8873 * schaser_effect_rc[effect]); + m_schaser_effect_555_timer->adjust(new_time, effect); + } + } + else + { + /* disable effect - stops at end of low cycle */ + if (!m_schaser_effect_555_is_low) + { + m_schaser_effect_555_time_remain = m_schaser_effect_555_timer->time_left(); + m_schaser_effect_555_time_remain_savable = m_schaser_effect_555_time_remain.as_double(); + m_schaser_effect_555_timer->adjust(attotime::never); + } + } + m_schaser_last_effect = effect; + } + + m_schaser_explosion = BIT(data, 2); + if (m_schaser_explosion) + { + m_sn->amplitude_res_w(1.0 / (1.0/RES_K(200) + 1.0/RES_K(68))); + } + else + { + m_sn->amplitude_res_w(RES_K(200)); + } + m_sn->enable_w(!(m_schaser_effect_555_is_low || m_schaser_explosion)); + m_sn->one_shot_cap_voltage_w(!(m_schaser_effect_555_is_low || m_schaser_explosion) ? 0 : sn76477_device::EXTERNAL_VOLTAGE_DISCONNECT); + m_sn->mixer_b_w(m_schaser_explosion); +} + +WRITE8_MEMBER(_8080bw_state::crashrd_port05_w) +{ + // bit 0 = bitstream audio + // bit 4 = not sure + m_discrete->write(space, SCHASER_MUSIC_BIT, BIT(data, 0)); +} + + + /*******************************************************************/ /* Yosakdon preliminary sound */ /* No information available as what the correct sounds are */ |