summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/audio/segag80r.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/audio/segag80r.cpp')
-rw-r--r--src/mame/audio/segag80r.cpp254
1 files changed, 0 insertions, 254 deletions
diff --git a/src/mame/audio/segag80r.cpp b/src/mame/audio/segag80r.cpp
index d71ec7edda9..1662c2f2258 100644
--- a/src/mame/audio/segag80r.cpp
+++ b/src/mame/audio/segag80r.cpp
@@ -88,260 +88,6 @@ void sega005_sound_device::sound_stream_update(sound_stream &stream, stream_samp
/*************************************
*
- * Astro Blaster sound hardware
- *
- *************************************/
-
-/*
- Description of Astro Blaster sounds (in the hope of future discrete goodness):
-
- CD4017 = decade counter with one output per decoded stage (10 outputs altogether)
- CD4024 = 7-bit counter with 7 outputs
-
-
- "V" signal
- ----------
- CD4017 @ U15:
- reset by RATE RESET signal = 1
- clocked by falling edge of ATTACK signal
- +12V output from here goes through a diode and one of 10 resistors:
- 0 = 120k
- 1 = 82k
- 2 = 62k
- 3 = 56k
- 4 = 47k
- 5 = 39k
- 6 = 35k
- 7 = 27k
- 8 = 24k
- 9 = 22k
- and then in series through a 22k resistor
-
- Op-amp @ U6 takes the WARP signal and the output of CD4017 @ U15
- and forms the signal "V" which is used to control the invader
- sounds
-
-
- How to calculate the output voltage at U16 labeled (V).
- (Derrick Renaud)
-
- First you have an inverting amp. To get the gain you
- use G=-Rf/Ri, where Rf=R178=22k. Ri is the selected
- resistor on the output of U15.
-
- The input voltage to the amp (pin 6) will always be
- about 12V - 0.5V (diode drop in low current circuit) =
- 11.5V.
-
- Now you need to calculate the reference voltage on the
- + input (pin 5). Depending on the state of WARP...
-
- If the warp data is 0, then U31 inverts it to an Open
- Collector high, meaning WARP is out of circuit. So:
- Vref = 12V * (R163)/(R162+R163)
- = 12V * 10k/(10K+4.7k)
- = 8.163V
-
- When warp data is 1, then U31 inverts it to low,
- grounding R164 putting it in parallel with R163,
- giving:
- Vref = 12V * (R163||R164)/(R163||R164 +R162)
- = 12V * 5k/(5k+4.7k)
- = 6.186V
-
- Now to get the control voltage V:
- V = (Vi - Vref) * G + Vref
- = (11.5V - Vref) * G + Vref
-
- That gives you the control voltage at V. From there I
- would have to millman the voltage with the internal
- voltage/resistors of the 555 to get the actual used
- control voltage.
-
- But it seems you just want a range, so just use the
- above info to get the highest and lowest voltages
- generated, and create the frequency shift you desire.
- Remember as the control voltage (V) lowers, the
- frequency increases.
-
-
-
- INVADER-1 output
- ----------------
-
-
-
-
- INVADER-2 output
- ----------------
- 555 timer @ U13 in astable mode with the following parameters:
- R1 = 10k
- R2 = 100k
- C = 0.0022u
- CV = "V" signal
- Reset = (PORT076 & 0x02)
- Output goes to CD4024 @ U12
-
- CD4024 @ U12:
- reset through some unknown means
- clocked by 555 timer @ U13
- +12 output from here goes through a resistor ladder:
- Q1 -> 82k
- Q2 -> 39k
- Q3 -> 22k
- Q4 -> 10k
- Summed output from here is INVADER-2
-
-
- INVADER-3 output
- ----------------
- 555 timer at U17 in astable mode with the following parameters:
- R1 = 10k
- R2 = 68k
- C = 0.1u
- CV = some combination of "V" and "W" signals
- Reset = (PORT076 & 0x04)
- Output from here is INVADER-3
-
-*/
-
-static const char *const astrob_sample_names[] =
-{
- "*astrob",
- "invadr1", /* 0 */
- "winvadr1", /* 1 */
- "invadr2", /* 2 */
- "winvadr2", /* 3 */
- "invadr3", /* 4 */
- "winvadr3", /* 5 */
- "invadr4", /* 6 */
- "winvadr4", /* 7 */
- "asteroid", /* 8 */
- "refuel", /* 9 */
- "pbullet", /* 10 */
- "ebullet", /* 11 */
- "eexplode", /* 12 */
- "pexplode", /* 13 */
- "deedle", /* 14 */
- "sonar", /* 15 */
- nullptr
-};
-
-
-void segag80r_state::astrob_sound_board(machine_config &config)
-{
- /* sound hardware */
- SAMPLES(config, m_samples);
- m_samples->set_channels(11);
- m_samples->set_samples_names(astrob_sample_names);
- m_samples->add_route(ALL_OUTPUTS, "speaker", 0.25);
-}
-
-
-/*************************************
- *
- * Astro Blaster sound triggers
- *
- *************************************/
-
-void segag80r_state::astrob_sound_w(offs_t offset, uint8_t data)
-{
- static const float attack_resistor[10] =
- {
- 120.0f, 82.0f, 62.0f, 56.0f, 47.0f, 39.0f, 33.0f, 27.0f, 24.0f, 22.0f
- };
- float freq_factor;
-
- uint8_t diff = data ^ m_sound_state[offset];
- m_sound_state[offset] = data;
-
- switch (offset)
- {
- case 0:
- /* INVADER-1: channel 0 */
- if ((diff & 0x01) && !(data & 0x01)) m_samples->start(0, (data & 0x80) ? 0 : 1, true);
- if ((data & 0x01) && m_samples->playing(0)) m_samples->stop(0);
-
- /* INVADER-2: channel 1 */
- if ((diff & 0x02) && !(data & 0x02)) m_samples->start(1, (data & 0x80) ? 2 : 3, true);
- if ((data & 0x02) && m_samples->playing(1)) m_samples->stop(1);
-
- /* INVADER-3: channel 2 */
- if ((diff & 0x04) && !(data & 0x04)) m_samples->start(2, (data & 0x80) ? 4 : 5, true);
- if ((data & 0x04) && m_samples->playing(2)) m_samples->stop(2);
-
- /* INVADER-4: channel 3 */
- if ((diff & 0x08) && !(data & 0x08)) m_samples->start(3, (data & 0x80) ? 6 : 7, true);
- if ((data & 0x08) && m_samples->playing(3)) m_samples->stop(3);
-
- /* ASTROIDS: channel 4 */
- if ((diff & 0x10) && !(data & 0x10)) m_samples->start(4, 8, true);
- if ((data & 0x10) && m_samples->playing(4)) m_samples->stop(4);
-
- /* MUTE */
- machine().sound().system_mute(data & 0x20);
-
- /* REFILL: channel 5 */
- if (!(data & 0x40) && !m_samples->playing(5)) m_samples->start(5, 9);
- if ( (data & 0x40) && m_samples->playing(5)) m_samples->stop(5);
-
- /* WARP: changes which sample is played for the INVADER samples above */
- if (diff & 0x80)
- {
- if (m_samples->playing(0)) m_samples->start(0, (data & 0x80) ? 0 : 1, true);
- if (m_samples->playing(1)) m_samples->start(1, (data & 0x80) ? 2 : 3, true);
- if (m_samples->playing(2)) m_samples->start(2, (data & 0x80) ? 4 : 5, true);
- if (m_samples->playing(3)) m_samples->start(3, (data & 0x80) ? 6 : 7, true);
- }
- break;
-
- case 1:
- /* LASER #1: channel 6 */
- if ((diff & 0x01) && !(data & 0x01)) m_samples->start(6, 10);
-
- /* LASER #2: channel 7 */
- if ((diff & 0x02) && !(data & 0x02)) m_samples->start(7, 11);
-
- /* SHORT EXPL: channel 8 */
- if ((diff & 0x04) && !(data & 0x04)) m_samples->start(8, 12);
-
- /* LONG EXPL: channel 8 */
- if ((diff & 0x08) && !(data & 0x08)) m_samples->start(8, 13);
-
- /* ATTACK RATE */
- if ((diff & 0x10) && !(data & 0x10)) m_sound_rate = (m_sound_rate + 1) % 10;
-
- /* RATE RESET */
- if (!(data & 0x20)) m_sound_rate = 0;
-
- /* BONUS: channel 9 */
- if ((diff & 0x40) && !(data & 0x40)) m_samples->start(9, 14);
-
- /* SONAR: channel 10 */
- if ((diff & 0x80) && !(data & 0x80)) m_samples->start(10, 15);
- break;
- }
-
- /* the samples were recorded with sound_rate = 0, so we need to scale */
- /* the frequency as a fraction of that; these equations come from */
- /* Derrick's analysis above; we compute the inverted scale factor to */
- /* account for the fact that frequency goes up as CV goes down */
- /* WARP is already taken into account by the differing samples above */
- freq_factor = (11.5f - 8.163f) * (-22.0f / attack_resistor[0]) + 8.163f;
- freq_factor /= (11.5f - 8.163f) * (-22.0f / attack_resistor[m_sound_rate]) + 8.163f;
-
- /* adjust the sample rate of invader sounds based the sound_rate */
- /* this is an approximation */
- if (m_samples->playing(0)) m_samples->set_frequency(0, m_samples->base_frequency(0) * freq_factor);
- if (m_samples->playing(1)) m_samples->set_frequency(1, m_samples->base_frequency(1) * freq_factor);
- if (m_samples->playing(2)) m_samples->set_frequency(2, m_samples->base_frequency(2) * freq_factor);
- if (m_samples->playing(3)) m_samples->set_frequency(3, m_samples->base_frequency(3) * freq_factor);
-}
-
-
-
-/*************************************
- *
* 005 sound hardware
*
*************************************/