Previous 199869 Revisions Next

r31807 Wednesday 27th August, 2014 at 13:11:44 UTC by Robbbert
atari_s2: fixed sound clipping
[src/mame/drivers]atari_s2.c

trunk/src/mame/drivers/atari_s2.c
r31806r31807
4747   TIMER_DEVICE_CALLBACK_MEMBER(timer_s);
4848private:
4949   bool m_timer_sb;
50   bool m_ab1;
5150   UINT8 m_timer_s[5];
5251   UINT8 m_sound0;
5352   UINT8 m_sound1;
r31806r31807
387386         // noise
388387         if BIT(m_sound0, 7)
389388         {
390            m_timer_s[3] = (m_timer_s[3] << 1) | m_ab1;
391            m_timer_s[4] = (m_timer_s[4] << 1) | !BIT(m_timer_s[3], 1);
392            m_ab1 = BIT(m_timer_s[3], 0) ^ BIT(m_timer_s[4], 6);
389            bool ab0 = BIT(m_timer_s[3], 0) ^ BIT(m_timer_s[4], 6);
390            bool ab1 = !BIT(m_timer_s[3], 1);
391            m_timer_s[3] = (m_timer_s[3] << 1) | ab0;
392            m_timer_s[4] = (m_timer_s[4] << 1) | ab1;
393393            m_dac1->write_unsigned8((m_timer_s[4] & 7)<< 5);
394394         }
395         else
396         {
397            m_timer_s[3] = 0;
398            m_timer_s[4] = 0;
399         }
395400      }
396401   }
397402}
r31806r31807
452457   MCFG_FRAGMENT_ADD( genpin_audio )
453458   MCFG_SPEAKER_STANDARD_MONO("mono")
454459   MCFG_SOUND_ADD("dac", DAC, 0)
455   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
460   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
456461   MCFG_SOUND_ADD("dac1", DAC, 0)
457   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
462   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
458463
459464   /* Video */
460465   MCFG_DEFAULT_LAYOUT(layout_atari_s2)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team