Previous 15994 Revisions Next

r9519 Thursday 4th November, 2010 at 16:04:04 UTC by Curt Coder
Synced with MAME.
[src/emu/debug]debugcpu.c
[src/emu/sound]disc_flt.c disc_mth.c disc_wav.c discrete.h

src/emu/debug/debugcpu.c
r9518r9519
31653165      {
31663166         return (m_condition.execute() != 0);
31673167      }
3168      catch (expression_error &err)
3168      catch (expression_error &)
31693169      {
31703170         return false;
31713171      }
r9518r9519
32233223      {
32243224         return (m_condition.execute() != 0);
32253225      }
3226      catch (expression_error &err)
3226      catch (expression_error &)
32273227      {
32283228         return false;
32293229      }
src/emu/sound/disc_mth.c
r9518r9519
366366   context->last_v = 0;
367367
368368   /* Calculate the Millman current of the bias circuit */
369   if (info->rBias)
369   if (info->rBias > 0)
370370      i_bias = info->vBias / info->rBias;
371371   else
372372      i_bias = 0;
r9518r9519
393393     */
394394   for(bit = 0; bit < ladderLength; bit++)
395395   {
396      if (info->r[bit] != 0)
396      if (info->r[bit] > 0)
397397         r_total += 1.0 / info->r[bit];
398398   }
399   if (info->rBias) r_total += 1.0 / info->rBias;
400   if (info->rGnd)  r_total += 1.0 / info->rGnd;
399   if (info->rBias > 0) r_total += 1.0 / info->rBias;
400   if (info->rGnd > 0)  r_total += 1.0 / info->rGnd;
401401   r_total = 1.0 / r_total;
402402
403403   node->output[0] = 0;
r9518r9519
420420         /* Add up currents of ON circuits per Millman. */
421421
422422         /* ignore if no resistor present */
423         if (EXPECTED(info->r[bit] != 0))
423         if (EXPECTED(info->r[bit] > 0))
424424         {
425425            double i_bit;
426426            int bit_val = (i >> bit) & 0x01;
src/emu/sound/discrete.h
r9518r9519
33403340 *
33413341 *  Declaration syntax
33423342 *
3343 *     DISCRETE_74LS624(name of node,(NODE,ENAB,VMOD,VRNG,C,R_FREQ_IN,C_FREQ_IN,OUTTYPE)
3343 *     DISCRETE_74LS624(name of node,(NODE,ENAB,VMOD,VRNG,C,R_FREQ_IN,C_FREQ_IN,R_RNG_IN,OUTTYPE)
33443344 *                      enable node or static value,
33453345 *                      vMod node or static value,
33463346 *                      vRng static value,
r9518r9519
33543354 *      DISC_LS624_OUT_SQUARE      - 4.4V square wave
33553355 *      DISC_LS624_OUT_ENERGY      - 4.4V anti-aliased square wave
33563356 *      DISC_LS624_OUT_LOGIC       - Logic ( 0 or 1)
3357 *      DISC_LS624_OUT_LOGIC_X     - Logic ( 0 or 1) with xime
3357 *      DISC_LS624_OUT_LOGIC_X     - Logic ( 0 or 1) with x_time
33583358 *      DISC_LS624_OUT_COUNT_F     - Number of Falling edges
3359 *      DISC_LS624_OUT_COUNT_F_X   - Number of Falling edges with xime
3359 *      DISC_LS624_OUT_COUNT_F_X   - Number of Falling edges with x_time
33603360 *      DISC_LS624_OUT_COUNT_R     - Number of Rising  edges
3361 *      DISC_LS624_OUT_COUNT_R_X   - Number of Rising  edges with xime
3361 *      DISC_LS624_OUT_COUNT_R_X   - Number of Rising  edges with x_time
33623362 *
33633363 *
33643364 * EXAMPLES: see Donkey Kong Jr.; Mario Bros.
src/emu/sound/disc_wav.c
r9518r9519
3333   int      clock_type;
3434   int      out_type;
3535   int      is_7492;
36   int      last_clock;
37   UINT32   last_count;
3638   UINT32   last;      /* Last clock state */
3739   UINT32   min;
3840   UINT32   max;
r9518r9519
196198
197199   double   cycles;
198200   double   ds_clock;
199   int      clock = 0, last_count, inc = 0;
201   int      clock = 0, inc = 0;
202   UINT32   last_count = context->last_count;   /* it is different then output in 7492 */
200203   double   x_time = 0;
201   UINT32   count = node->output[0];
204   UINT32   count = last_count;
202205
203206   ds_clock = DSS_COUNTER__CLOCK;
204207   if (UNEXPECTED(context->clock_type == DISC_CLK_IS_FREQ))
r9518r9519
220223   /* If reset enabled then set output to the reset value.  No x_time in reset. */
221224   if (UNEXPECTED(DSS_COUNTER__RESET))
222225   {
226      context->last_count = (int)DSS_COUNTER__INIT;
223227      node->output[0] = (int)DSS_COUNTER__INIT;
224228      return;
225229   }
r9518r9519
230234     */
231235   if (EXPECTED(DSS_COUNTER__ENABLE))
232236   {
233      last_count = count;
234
235237      switch (context->clock_type)
236238      {
237239         case DISC_CLK_ON_F_EDGE:
238240         case DISC_CLK_ON_R_EDGE:
239241            /* See if the clock has toggled to the proper edge */
240242            clock = (clock != 0);
241            if (context->last != clock)
243            if (context->last_clock != clock)
242244            {
243               context->last = clock;
245               context->last_clock = clock;
244246               if (context->clock_type == clock)
245247               {
246248                  /* Toggled */
r9518r9519
273275         }
274276      }
275277
278      context->last_count = count;
276279      node->output[0] = context->is_7492 ? disc_7492_count[count] : count;
277280
278281      if (UNEXPECTED(count != last_count))
r9518r9519
300303{
301304   DISCRETE_DECLARE_CONTEXT(dss_counter)
302305
303   if (DSS_COUNTER__MAX < DSS_COUNTER__MIN)
304      fatalerror("MAX < MIN in NODE_%02d", NODE_INDEX(node->block->node));
305
306306   if ((int)DSS_COUNTER__CLOCK_TYPE & DISC_COUNTER_IS_7492)
307307   {
308308      context->is_7492    = 1;
r9518r9519
319319      context->min = DSS_COUNTER__MIN;
320320      context->diff = context->max - context->min + 1;
321321   }
322
323
324   if (!context->is_7492 && (DSS_COUNTER__MAX < DSS_COUNTER__MIN))
325      fatalerror("MAX < MIN in NODE_%02d", NODE_INDEX(node->block->node));
326
322327   context->out_type    = context->clock_type & DISC_OUT_MASK;
323328   context->clock_type &= DISC_CLK_MASK;
324329
325   context->t_left  = 0;
326   context->last    = 0;
327   node->output[0]  = DSS_COUNTER__INIT; /* count starts at reset value */
330   context->t_left = 0;
331   context->last_count = 0;
332   context->last_clock = 0;
333   node->output[0] = DSS_COUNTER__INIT; /* count starts at reset value */
328334}
329335
330336
src/emu/sound/disc_flt.c
r9518r9519
169169      }
170170   }
171171
172   node->output[0] = DST_CRFILTER__IN - context->vCap;
173   //context->vCap += ((DST_CRFILTER__IN - context->vRef) - context->vCap) * context->exponent;
174   context->vCap += (node->output[0] - DST_CRFILTER__VREF) * context->exponent;
172   double v_out = DST_CRFILTER__IN - context->vCap;
173   double v_diff = v_out - DST_CRFILTER__VREF;
174   node->output[0] = v_out;
175   context->vCap += v_diff * context->exponent;
175176}
176177
177178DISCRETE_RESET(dst_crfilter)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team