summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2022-09-02 18:57:18 +0200
committer hap <happppp@users.noreply.github.com>2022-09-02 18:57:31 +0200
commit68e74d6b839681401e2a70febb43d22539844b1a (patch)
tree95011f3cbd9f5a85249d2e848279b0d522c79b4b
parentf3bb9bdd7c8c6c9ed81947702d7a49a961a0f4b7 (diff)
zerohour: add 1bit dac
-rw-r--r--src/mame/universal/zerohour.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mame/universal/zerohour.cpp b/src/mame/universal/zerohour.cpp
index 921b527ed37..d90fe6f4df2 100644
--- a/src/mame/universal/zerohour.cpp
+++ b/src/mame/universal/zerohour.cpp
@@ -17,7 +17,8 @@ TODO:
scrolling at the same speed as the stars, it's used in canyon parts and during the
big ufo explosion
- redclash canyon level, a gap sometimes appears on the right side, maybe BTANB
-- replace zerohour samples with netlist audio (schematics available but bad quality)
+- replace zerohour samples with netlist audio (schematics available)
+- zerohour should play a beep when an orange asteroid is shot, missing sample?
- add redclash samples or netlist audio (eg. player shot sound, explosions)
- redclash beeper frequency range should be higher, but it can't be solved with a
simple multiply calculation. Besides, anything more than right now and ears will
@@ -37,6 +38,7 @@ BTANB:
#include "cpu/z80/z80.h"
#include "machine/74259.h"
#include "machine/clock.h"
+#include "sound/dac.h"
#include "sound/spkrdev.h"
#include "sound/samples.h"
#include "video/resnet.h"
@@ -452,7 +454,6 @@ static const char *const zerohour_sample_names[] =
"zh7",
"zh8",
"zh9",
- "zh10",
nullptr
};
@@ -474,6 +475,8 @@ template <unsigned N> WRITE_LINE_MEMBER(zerohour_state::sample_w)
{
if (m_sound_on && state)
m_samples->start(N, N);
+
+ // thrust sound is level-triggered
else if (N == 8)
m_samples->stop(N);
}
@@ -801,13 +804,14 @@ void zerohour_state::zerohour(machine_config &config)
m_outlatch[1]->q_out_cb<1>().set(FUNC(zerohour_state::sample_w<8>));
m_outlatch[1]->q_out_cb<2>().set(FUNC(zerohour_state::sound_enable_w));
- m_outlatch[1]->q_out_cb<3>().set(FUNC(zerohour_state::sample_w<9>));
- m_outlatch[1]->q_out_cb<4>().set(FUNC(zerohour_state::sample_w<10>));
+ m_outlatch[1]->q_out_cb<3>().set("dac", FUNC(dac_1bit_device::write));
+ m_outlatch[1]->q_out_cb<4>().set(FUNC(zerohour_state::sample_w<9>));
SPEAKER(config, "mono").front_center();
+ DAC_1BIT(config, "dac").add_route(ALL_OUTPUTS, "mono", 0.25);
SAMPLES(config, m_samples);
- m_samples->set_channels(11);
+ m_samples->set_channels(10);
m_samples->set_samples_names(zerohour_sample_names);
m_samples->add_route(ALL_OUTPUTS, "mono", 0.5);
}