summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/audio/warpwarp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/audio/warpwarp.c')
-rw-r--r--src/mame/audio/warpwarp.c84
1 files changed, 41 insertions, 43 deletions
diff --git a/src/mame/audio/warpwarp.c b/src/mame/audio/warpwarp.c
index a0095c32453..62367457f2f 100644
--- a/src/mame/audio/warpwarp.c
+++ b/src/mame/audio/warpwarp.c
@@ -10,7 +10,7 @@
#include "emu.h"
#include "includes/warpwarp.h"
-#define CLOCK_16H (18432000/3/2/16)
+#define CLOCK_16H (18432000/3/2/16)
#define CLOCK_1V (18432000/3/2/384)
struct warpwarp_sound_state
@@ -63,26 +63,26 @@ WRITE8_DEVICE_HANDLER( warpwarp_sound_w )
if( state->m_sound_latch & 8 )
{
/*
- * R85(?) is 10k, Rb is 0, C92 is 1uF
- * charge time t1 = 0.693 * (R24 + Rb) * C57 -> 0.22176s
- * discharge time t2 = 0.693 * (Rb) * C57 -> 0
- * C90(?) is only charged via D17 (1N914), no discharge!
- * Decay:
- * discharge C90(?) (1uF) through R13||R14 (22k||47k)
- * 0.639 * 15k * 1uF -> 0.9585s
- */
+ * R85(?) is 10k, Rb is 0, C92 is 1uF
+ * charge time t1 = 0.693 * (R24 + Rb) * C57 -> 0.22176s
+ * discharge time t2 = 0.693 * (Rb) * C57 -> 0
+ * C90(?) is only charged via D17 (1N914), no discharge!
+ * Decay:
+ * discharge C90(?) (1uF) through R13||R14 (22k||47k)
+ * 0.639 * 15k * 1uF -> 0.9585s
+ */
attotime period = attotime::from_hz(32768) * 95850 / 100000;
state->m_sound_volume_timer->adjust(period, 0, period);
}
else
{
/*
- * discharge only after R93 (100k) and through the 10k
- * potentiometerin the amplifier section.
- * 0.639 * 110k * 1uF -> 7.0290s
- * ...but this is not very realistic for the game sound :(
- * maybe there _is_ a discharge through the diode D17?
- */
+ * discharge only after R93 (100k) and through the 10k
+ * potentiometerin the amplifier section.
+ * 0.639 * 110k * 1uF -> 7.0290s
+ * ...but this is not very realistic for the game sound :(
+ * maybe there _is_ a discharge through the diode D17?
+ */
//attotime period = attotime::from_hz(32768) * 702900 / 100000;
attotime period = attotime::from_hz(32768) * 191700 / 100000;
state->m_sound_volume_timer->adjust(period, 0, period);
@@ -114,25 +114,25 @@ WRITE8_DEVICE_HANDLER( warpwarp_music2_w )
if( state->m_music2_latch & 0x10 )
{
/*
- * Ra (R83?) is 10k, Rb is 0, C92 is 1uF
- * charge time t1 = 0.693 * (Ra + Rb) * C -> 0.22176s
- * discharge time is (nearly) zero, because Rb is zero
- * C95(?) is only charged via D17, not discharged!
- * Decay:
- * discharge C95(?) (10uF) through R13||R14 (22k||47k)
- * 0.639 * 15k * 10uF -> 9.585s
- * ...I'm sure this is off by one number of magnitude :/
- */
+ * Ra (R83?) is 10k, Rb is 0, C92 is 1uF
+ * charge time t1 = 0.693 * (Ra + Rb) * C -> 0.22176s
+ * discharge time is (nearly) zero, because Rb is zero
+ * C95(?) is only charged via D17, not discharged!
+ * Decay:
+ * discharge C95(?) (10uF) through R13||R14 (22k||47k)
+ * 0.639 * 15k * 10uF -> 9.585s
+ * ...I'm sure this is off by one number of magnitude :/
+ */
attotime period = attotime::from_hz(32768) * 95850 / 100000;
state->m_music_volume_timer->adjust(period, 0, period);
}
else
{
/*
- * discharge through R14 (47k),
- * discharge C95(?) (10uF) through R14 (47k)
- * 0.639 * 47k * 10uF -> 30.033s
- */
+ * discharge through R14 (47k),
+ * discharge C95(?) (10uF) through R14 (47k)
+ * 0.639 * 47k * 10uF -> 30.033s
+ */
//attotime period = attotime::from_hz(32768) * 3003300 / 100000;
attotime period = attotime::from_hz(32768) * 300330 / 100000;
state->m_music_volume_timer->adjust(period, 0, period);
@@ -150,18 +150,18 @@ static STREAM_UPDATE( warpwarp_sound_update )
*buffer++ = (state->m_sound_signal + state->m_music_signal) / 2;
/*
- * The music signal is selected at a rate of 2H (1.536MHz) from the
- * four bits of a 4 bit binary counter which is clocked with 16H,
- * which is 192kHz, and is divided by 4 times (64 - music1_latch).
- * 0 = 256 steps -> 750 Hz
- * 1 = 252 steps -> 761.9 Hz
- * ...
- * 32 = 128 steps -> 1500 Hz
- * ...
- * 48 = 64 steps -> 3000 Hz
- * ...
- * 63 = 4 steps -> 48 kHz
- */
+ * The music signal is selected at a rate of 2H (1.536MHz) from the
+ * four bits of a 4 bit binary counter which is clocked with 16H,
+ * which is 192kHz, and is divided by 4 times (64 - music1_latch).
+ * 0 = 256 steps -> 750 Hz
+ * 1 = 252 steps -> 761.9 Hz
+ * ...
+ * 32 = 128 steps -> 1500 Hz
+ * ...
+ * 48 = 64 steps -> 3000 Hz
+ * ...
+ * 63 = 4 steps -> 48 kHz
+ */
state->m_mcarry -= CLOCK_16H / (4 * (64 - state->m_music1_latch));
while( state->m_mcarry < 0 )
{
@@ -245,7 +245,7 @@ const device_type WARPWARP = &device_creator<warpwarp_sound_device>;
warpwarp_sound_device::warpwarp_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, WARPWARP, "Warp Warp Custom", tag, owner, clock),
- device_sound_interface(mconfig, *this)
+ device_sound_interface(mconfig, *this)
{
m_token = global_alloc_clear(warpwarp_sound_state);
}
@@ -278,5 +278,3 @@ void warpwarp_sound_device::sound_stream_update(sound_stream &stream, stream_sam
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
-
-