summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Lord-Nightmare <Lord-Nightmare@users.noreply.github.com>2021-07-05 16:58:26 -0400
committer Lord-Nightmare <Lord-Nightmare@users.noreply.github.com>2021-07-05 16:58:26 -0400
commite01a3209dfe167c1cae19f23da92abd29c72823a (patch)
tree42df7075d2e74f4203076781ce53f5334ce04180
parentfd9c369c3967e0662c48dbece5dca8bcabc87f5c (diff)
flt_rc.cpp: Rename the filter types to be more consistent with regards to behavior: old LOWPASS_2C is now LOWPASS (to match the behavior of HIGHPASS); old LOWPASS is now LOWPASS_3R. [Lord Nightmare]
-rw-r--r--src/devices/sound/flt_rc.cpp8
-rw-r--r--src/devices/sound/flt_rc.h17
-rw-r--r--src/mame/audio/timeplt.cpp2
-rw-r--r--src/mame/drivers/bladestl.cpp6
-rw-r--r--src/mame/drivers/ddribble.cpp6
-rw-r--r--src/mame/drivers/junofrst.cpp2
-rw-r--r--src/mame/drivers/megazone.cpp2
-rw-r--r--src/mame/drivers/nemesis.cpp8
-rw-r--r--src/mame/drivers/tp84.cpp8
-rw-r--r--src/mame/drivers/ympsr60.cpp4
10 files changed, 32 insertions, 31 deletions
diff --git a/src/devices/sound/flt_rc.cpp b/src/devices/sound/flt_rc.cpp
index 48d542283e0..489cb01fb07 100644
--- a/src/devices/sound/flt_rc.cpp
+++ b/src/devices/sound/flt_rc.cpp
@@ -22,7 +22,7 @@ filter_rc_device::filter_rc_device(const machine_config &mconfig, const char *ta
m_stream(nullptr),
m_k(0),
m_memory(0),
- m_type(LOWPASS),
+ m_type(LOWPASS_3R),
m_last_sample_rate(0),
m_R1(1),
m_R2(1),
@@ -69,8 +69,8 @@ void filter_rc_device::sound_stream_update(sound_stream &stream, std::vector<rea
switch (m_type)
{
+ case LOWPASS_3R:
case LOWPASS:
- case LOWPASS_2C:
for (int sampindex = 0; sampindex < dst.samples(); sampindex++)
{
memory += (src.get(sampindex) - memory) * m_k;
@@ -96,7 +96,7 @@ void filter_rc_device::recalc()
switch (m_type)
{
- case LOWPASS:
+ case LOWPASS_3R:
if (m_C == 0.0)
{
/* filter disabled */
@@ -106,7 +106,7 @@ void filter_rc_device::recalc()
}
Req = (m_R1 * (m_R2 + m_R3)) / (m_R1 + m_R2 + m_R3);
break;
- case LOWPASS_2C:
+ case LOWPASS:
if (m_C == 0.0)
{
/* filter disabled */
diff --git a/src/devices/sound/flt_rc.h b/src/devices/sound/flt_rc.h
index d06d0ff75d1..def09f1eb11 100644
--- a/src/devices/sound/flt_rc.h
+++ b/src/devices/sound/flt_rc.h
@@ -8,7 +8,7 @@
#include "machine/rescap.h"
/*
- * FLT_RC_LOWPASS:
+ * FLT_RC_LOWPASS_3R:
*
* signal >--R1--+--R2--+
* | |
@@ -18,7 +18,7 @@
*
* Set C=0 to disable filter
*
- * FLT_RC_LOWPASS_@C:
+ * FLT_RC_LOWPASS:
*
* signal >--R1--+----> amp
* |
@@ -40,14 +40,15 @@
*
* FLT_RC_AC:
*
- * Same as FLT_RC_HIGHPASS, but with standard frequency of 16 HZ
+ * Same as FLT_RC_HIGHPASS, but with a standard cutoff frequency of ~16Hz
+ * (10KOhm R, 1uF C)
* This filter may be setup just with
*
* FILTER_RC(config, "tag", 0).set_ac();
*
* Default behaviour:
*
- * Without set_ac(), a disabled FLT_RC_LOWPASS is created
+ * Without set_ac(), a disabled FLT_RC_LOWPASS_3R is created
*
*/
@@ -62,8 +63,8 @@ class filter_rc_device : public device_t, public device_sound_interface
public:
enum
{
- LOWPASS = 0,
- LOWPASS_2C = 2,
+ LOWPASS_3R = 0,
+ LOWPASS = 2,
HIGHPASS = 3,
AC = 4
};
@@ -83,7 +84,7 @@ public:
filter_rc_device &set_lowpass(double R, double C)
{
- m_type = LOWPASS_2C;
+ m_type = LOWPASS;
m_R1 = R;
m_R2 = 0;
m_R3 = 0;
@@ -101,7 +102,7 @@ public:
filter_rc_device &set_ac()
{
- return set_rc(filter_rc_device::AC, 10000, 0, 0, CAP_U(1));
+ return set_rc(filter_rc_device::AC, RES_K(10), 0, 0, CAP_U(1));
}
protected:
diff --git a/src/mame/audio/timeplt.cpp b/src/mame/audio/timeplt.cpp
index f626a8f98f9..03d152d91fa 100644
--- a/src/mame/audio/timeplt.cpp
+++ b/src/mame/audio/timeplt.cpp
@@ -103,7 +103,7 @@ void timeplt_audio_device::set_filter(filter_rc_device &device, int data)
if (data & 2)
C += 47000; /* 47000pF = 0.047uF */
- device.filter_rc_set_RC(filter_rc_device::LOWPASS, 1000, 5100, 0, CAP_P(C));
+ device.filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 5100, 0, CAP_P(C));
}
diff --git a/src/mame/drivers/bladestl.cpp b/src/mame/drivers/bladestl.cpp
index daef1fac97e..03c769ccf11 100644
--- a/src/mame/drivers/bladestl.cpp
+++ b/src/mame/drivers/bladestl.cpp
@@ -92,13 +92,13 @@ void bladestl_state::bladestl_port_B_w(uint8_t data)
m_upd7759->set_rom_bank((data & 0x38) >> 3);
// bit 2 = SSG-C rc filter enable
- m_filter3->filter_rc_set_RC(filter_rc_device::LOWPASS, 1000, 2200, 1000, data & 0x04 ? CAP_N(150) : 0); /* YM2203-SSG-C */
+ m_filter3->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 1000, data & 0x04 ? CAP_N(150) : 0); /* YM2203-SSG-C */
// bit 1 = SSG-B rc filter enable
- m_filter2->filter_rc_set_RC(filter_rc_device::LOWPASS, 1000, 2200, 1000, data & 0x02 ? CAP_N(150) : 0); /* YM2203-SSG-B */
+ m_filter2->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 1000, data & 0x02 ? CAP_N(150) : 0); /* YM2203-SSG-B */
// bit 0 = SSG-A rc filter enable
- m_filter1->filter_rc_set_RC(filter_rc_device::LOWPASS, 1000, 2200, 1000, data & 0x01 ? CAP_N(150) : 0); /* YM2203-SSG-A */
+ m_filter1->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 1000, data & 0x01 ? CAP_N(150) : 0); /* YM2203-SSG-A */
}
uint8_t bladestl_state::bladestl_speech_busy_r()
diff --git a/src/mame/drivers/ddribble.cpp b/src/mame/drivers/ddribble.cpp
index 9ab5c574b66..3a35ad0698e 100644
--- a/src/mame/drivers/ddribble.cpp
+++ b/src/mame/drivers/ddribble.cpp
@@ -77,13 +77,13 @@ void ddribble_state::vlm5030_ctrl_w(uint8_t data)
m_vlmbank->set_entry(BIT(data, 3));
// b2 : SSG-C rc filter enable
- m_filter[2]->filter_rc_set_RC(filter_rc_device::LOWPASS, 1000, 2200, 1000, BIT(data, 2) ? CAP_N(150) : 0); // YM2203-SSG-C
+ m_filter[2]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 1000, data & 0x04 ? CAP_N(150) : 0); // YM2203-SSG-C
// b1 : SSG-B rc filter enable
- m_filter[1]->filter_rc_set_RC(filter_rc_device::LOWPASS, 1000, 2200, 1000, BIT(data, 1) ? CAP_N(150) : 0); // YM2203-SSG-B
+ m_filter[1]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 1000, data & 0x02 ? CAP_N(150) : 0); // YM2203-SSG-B
// b0 : SSG-A rc filter enable
- m_filter[0]->filter_rc_set_RC(filter_rc_device::LOWPASS, 1000, 2200, 1000, BIT(data, 0) ? CAP_N(150) : 0); // YM2203-SSG-A
+ m_filter[0]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 1000, data & 0x01 ? CAP_N(150) : 0); // YM2203-SSG-A
}
diff --git a/src/mame/drivers/junofrst.cpp b/src/mame/drivers/junofrst.cpp
index 68ef97650d6..3654a2d6f6d 100644
--- a/src/mame/drivers/junofrst.cpp
+++ b/src/mame/drivers/junofrst.cpp
@@ -250,7 +250,7 @@ void junofrst_state::portB_w(uint8_t data)
C += 220000; /* 220000pF = 0.22uF */
data >>= 2;
- filter[i]->filter_rc_set_RC(filter_rc_device::LOWPASS, 1000, 2200, 200, CAP_P(C));
+ filter[i]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 200, CAP_P(C));
}
}
diff --git a/src/mame/drivers/megazone.cpp b/src/mame/drivers/megazone.cpp
index 374e9960afa..4dd88e3a5a6 100644
--- a/src/mame/drivers/megazone.cpp
+++ b/src/mame/drivers/megazone.cpp
@@ -105,7 +105,7 @@ void megazone_state::megazone_port_b_w(uint8_t data)
C += 220000; /* 220000pF = 0.22uF */
data >>= 2;
- m_filter[i]->filter_rc_set_RC(filter_rc_device::LOWPASS, 1000, 2200, 200, CAP_P(C));
+ m_filter[i]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 200, CAP_P(C));
}
}
diff --git a/src/mame/drivers/nemesis.cpp b/src/mame/drivers/nemesis.cpp
index 0db0e56a69e..0bce1dd7ed9 100644
--- a/src/mame/drivers/nemesis.cpp
+++ b/src/mame/drivers/nemesis.cpp
@@ -354,10 +354,10 @@ void nemesis_state::nemesis_filter_w(offs_t offset, uint8_t data)
{
int C1 = /* offset & 0x1000 ? 4700 : */ 0; // is this right? 4.7uF seems too large
int C2 = offset & 0x0800 ? 33 : 0; // 0.033uF = 33 nF
- m_filter1->filter_rc_set_RC(filter_rc_device::LOWPASS, (AY8910_INTERNAL_RESISTANCE + 12000) / 3, 0, 0, CAP_N(C1)); // unused?
- m_filter2->filter_rc_set_RC(filter_rc_device::LOWPASS, AY8910_INTERNAL_RESISTANCE + 1000, 10000, 0, CAP_N(C2));
- m_filter3->filter_rc_set_RC(filter_rc_device::LOWPASS, AY8910_INTERNAL_RESISTANCE + 1000, 10000, 0, CAP_N(C2));
- m_filter4->filter_rc_set_RC(filter_rc_device::LOWPASS, AY8910_INTERNAL_RESISTANCE + 1000, 10000, 0, CAP_N(C2));
+ m_filter1->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, (AY8910_INTERNAL_RESISTANCE + 12000) / 3, 0, 0, CAP_N(C1)); // unused?
+ m_filter2->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, AY8910_INTERNAL_RESISTANCE + 1000, 10000, 0, CAP_N(C2));
+ m_filter3->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, AY8910_INTERNAL_RESISTANCE + 1000, 10000, 0, CAP_N(C2));
+ m_filter4->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, AY8910_INTERNAL_RESISTANCE + 1000, 10000, 0, CAP_N(C2));
// konamigt also uses bits 0x0018, what are they for?
}
diff --git a/src/mame/drivers/tp84.cpp b/src/mame/drivers/tp84.cpp
index c5f775d47eb..480a5645cb1 100644
--- a/src/mame/drivers/tp84.cpp
+++ b/src/mame/drivers/tp84.cpp
@@ -145,23 +145,23 @@ void tp84_state::tp84_filter_w(offs_t offset, uint8_t data)
C = 0;
if (offset & 0x008) C += 47000; /* 47000pF = 0.047uF */
if (offset & 0x010) C += 470000; /* 470000pF = 0.47uF */
- m_filter[0]->filter_rc_set_RC(filter_rc_device::LOWPASS,1000,2200,1000,CAP_P(C));
+ m_filter[0]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R,1000,2200,1000,CAP_P(C));
/* 76489 #1 (optional) */
C = 0;
if (offset & 0x020) C += 47000; /* 47000pF = 0.047uF */
if (offset & 0x040) C += 470000; /* 470000pF = 0.47uF */
- // m_filter[1]->filter_rc_set_RC(,1000,2200,1000,C);
+ //m_filter[1]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R,1000,2200,1000,CAP_P(C));
/* 76489 #2 */
C = 0;
if (offset & 0x080) C += 470000; /* 470000pF = 0.47uF */
- m_filter[1]->filter_rc_set_RC(filter_rc_device::LOWPASS,1000,2200,1000,CAP_P(C));
+ m_filter[1]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R,1000,2200,1000,CAP_P(C));
/* 76489 #3 */
C = 0;
if (offset & 0x100) C += 470000; /* 470000pF = 0.47uF */
- m_filter[2]->filter_rc_set_RC(filter_rc_device::LOWPASS,1000,2200,1000,CAP_P(C));
+ m_filter[2]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R,1000,2200,1000,CAP_P(C));
}
void tp84_state::tp84_sh_irqtrigger_w(uint8_t data)
diff --git a/src/mame/drivers/ympsr60.cpp b/src/mame/drivers/ympsr60.cpp
index 49d7b9cd0d3..a5c1d010f38 100644
--- a/src/mame/drivers/ympsr60.cpp
+++ b/src/mame/drivers/ympsr60.cpp
@@ -649,7 +649,7 @@ void psr60_state::psr_common(machine_config &config)
m_ic205->add_route(0, m_ic206a, 1.0);
FILTER_RC(config, m_postbbd_rc);
- m_postbbd_rc->set_rc(filter_rc_device::LOWPASS_2C, RES_K(22), 0, 0, CAP_U(0.0015));
+ m_postbbd_rc->set_rc(filter_rc_device::LOWPASS, RES_K(22), 0, 0, CAP_U(0.0015));
m_postbbd_rc->add_route(0, m_ic205, 1.0);
MIXER(config, m_bbd_mixer);
@@ -665,7 +665,7 @@ void psr60_state::psr_common(machine_config &config)
m_ic204b->add_route(0, m_bbd, 1.0);
FILTER_RC(config, m_first_rc);
- m_first_rc->set_rc(filter_rc_device::LOWPASS_2C, RES_R(22), 0, 0, CAP_U(0.0015));
+ m_first_rc->set_rc(filter_rc_device::LOWPASS, RES_R(22), 0, 0, CAP_U(0.0015));
m_first_rc->add_route(0, m_ic204b, 1.0);
// not accurate, not correctly modeling the 22k resistor bypassing the 22k resistor in series