summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu
diff options
context:
space:
mode:
author Derrick Renaud <derrickr@mamedev.org>2009-10-02 02:10:43 +0000
committer Derrick Renaud <derrickr@mamedev.org>2009-10-02 02:10:43 +0000
commit9ca9d3041953e5b7f93cf59ffc01dac8f3adf9a0 (patch)
tree342f9cc293a30db2a7be85eb0263c5c7cc8078b3 /src/emu
parent27bbf65bd1f6f190eca544acf9d846db2e60ed93 (diff)
Sprint 8 - complete discrete sound
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/sound/disc_mth.c29
-rw-r--r--src/emu/sound/discrete.h26
2 files changed, 20 insertions, 35 deletions
diff --git a/src/emu/sound/disc_mth.c b/src/emu/sound/disc_mth.c
index d4269fb44f8..59f3e7bb150 100644
--- a/src/emu/sound/disc_mth.c
+++ b/src/emu/sound/disc_mth.c
@@ -272,31 +272,20 @@ static DISCRETE_RESET(dst_comp_adder)
*
* DST_CLAMP - Simple signal clamping circuit
*
- * input[0] - Enable ramp
- * input[1] - Input value
- * input[2] - Minimum value
- * input[3] - Maximum value
- * input[4] - Clamp output when disabled
+ * input[0] - Input value
+ * input[1] - Minimum value
+ * input[2] - Maximum value
*
************************************************************************/
-#define DST_CLAMP__ENABLE DISCRETE_INPUT(0)
-#define DST_CLAMP__IN DISCRETE_INPUT(1)
-#define DST_CLAMP__MIN DISCRETE_INPUT(2)
-#define DST_CLAMP__MAX DISCRETE_INPUT(3)
-#define DST_CLAMP__CLAMP DISCRETE_INPUT(4)
+#define DST_CLAMP__IN DISCRETE_INPUT(0)
+#define DST_CLAMP__MIN DISCRETE_INPUT(1)
+#define DST_CLAMP__MAX DISCRETE_INPUT(2)
static DISCRETE_STEP(dst_clamp)
{
- if(DST_CLAMP__ENABLE)
- {
- if (DST_CLAMP__IN < DST_CLAMP__MIN) node->output[0] = DST_CLAMP__MIN;
- else if (DST_CLAMP__IN > DST_CLAMP__MAX) node->output[0] = DST_CLAMP__MAX;
- else node->output[0]= DST_CLAMP__IN;
- }
- else
- {
- node->output[0] = DST_CLAMP__CLAMP;
- }
+ if (DST_CLAMP__IN < DST_CLAMP__MIN) node->output[0] = DST_CLAMP__MIN;
+ else if (DST_CLAMP__IN > DST_CLAMP__MAX) node->output[0] = DST_CLAMP__MAX;
+ else node->output[0]= DST_CLAMP__IN;
}
diff --git a/src/emu/sound/discrete.h b/src/emu/sound/discrete.h
index bbc17e7c047..4115fa285e3 100644
--- a/src/emu/sound/discrete.h
+++ b/src/emu/sound/discrete.h
@@ -1193,34 +1193,30 @@
*
* .------------.
* | |
- * ENAB -0------>| |
- * | |
- * INP0 -1------>| |
- * | |
- * MIN -2------>| CLAMP |----> Netlist node
+ * INP0 -0------>| |
* | |
- * MAX -3------>| |
+ * MIN -1------>| CLAMP |----> Netlist node
* | |
- * CLAMP -4------>| |
+ * MAX -2------>| |
* | |
* '------------'
*
* Declaration syntax
*
* DISCRETE_CLAMP(name of node,
- * enable,
* input node,
* minimum node or static value,
- * maximum node or static value,
- * clamp node or static value when disabled)
+ * maximum node or static value),
*
* Example config line
*
- * DISCRETE_CLAMP(NODE_9,NODE_10,NODE_11,2.0,10.0,5.0)
+ * DISCRETE_CLAMP(NODE_9,NODE_10,2.0,10.0)
+ *
+ * Force the value on the node output, to be within the MIN/MAX
+ * boundary. In this example the output is clamped to the range
+ * of 2.0 to 10.0 inclusive.
*
- * Node10 when not zero will allow clamp to operate forcing the value
- * on the node output, to be within the MIN/MAX boundard. When enable
- * is set to zero the node will output the clamp value
+ * EXAMPLES: Sprint 8
*
***********************************************************************
*
@@ -4319,7 +4315,7 @@ enum
#define DISCRETE_ADDER2(NODE,ENAB,INP0,INP1) { NODE, DST_ADDER , 3, { ENAB,INP0,INP1 }, { ENAB,INP0,INP1 }, NULL, "DISCRETE_ADDER2" },
#define DISCRETE_ADDER3(NODE,ENAB,INP0,INP1,INP2) { NODE, DST_ADDER , 4, { ENAB,INP0,INP1,INP2 }, { ENAB,INP0,INP1,INP2 }, NULL, "DISCRETE_ADDER3" },
#define DISCRETE_ADDER4(NODE,ENAB,INP0,INP1,INP2,INP3) { NODE, DST_ADDER , 5, { ENAB,INP0,INP1,INP2,INP3 }, { ENAB,INP0,INP1,INP2,INP3 }, NULL, "DISCRETE_ADDER4" },
-#define DISCRETE_CLAMP(NODE,ENAB,INP0,MIN,MAX,CLAMP) { NODE, DST_CLAMP , 5, { ENAB,INP0,MIN,MAX,CLAMP }, { ENAB,INP0,MIN,MAX,CLAMP }, NULL, "DISCRETE_CLAMP" },
+#define DISCRETE_CLAMP(NODE,INP0,MIN,MAX) { NODE, DST_CLAMP , 3, { INP0,MIN,MAX }, { INP0,MIN,MAX }, NULL, "DISCRETE_CLAMP" },
#define DISCRETE_DIVIDE(NODE,ENAB,INP0,INP1) { NODE, DST_DIVIDE , 3, { ENAB,INP0,INP1 }, { ENAB,INP0,INP1 }, NULL, "DISCRETE_DIVIDE" },
#define DISCRETE_GAIN(NODE,INP0,GAIN) { NODE, DST_GAIN , 3, { INP0,NODE_NC,NODE_NC }, { INP0,GAIN,0 }, NULL, "DISCRETE_GAIN" },
#define DISCRETE_INVERT(NODE,INP0) { NODE, DST_GAIN , 3, { INP0,NODE_NC,NODE_NC }, { INP0,-1,0 }, NULL, "DISCRETE_INVERT" },