Previous 199869 Revisions Next

r33031 Tuesday 28th October, 2014 at 08:02:23 UTC by Miodrag Milanović
line endings (nw)
[src/mess/machine]coco.c

trunk/src/mess/machine/coco.c
r241542r241543
678678    */
679679   UINT8 single_bit_sound = (m_pia_1->b_output() & 0x02) ? 0x80 : 0x00;
680680
681   /* determine the sound mux status */
682   soundmux_status_t status = soundmux_status();
683 
684    /* the SC77526 DAC chip internally biases the AC-coupled sound inputs for Cassette and Cartridge at the midpoint of the 3.9v output range */
685    bool bCassSoundEnable = (status == (SOUNDMUX_ENABLE | SOUNDMUX_SEL1));
686    bool bCartSoundEnable = (status == (SOUNDMUX_ENABLE | SOUNDMUX_SEL2));
687    UINT8 cassette_sound = (bCassSoundEnable ? 0x40 : 0);
688    UINT8 cart_sound = (bCartSoundEnable ? 0x40 : 0);
689 
690   /* determine the value to send to the DAC */
691   m_dac_output = (m_pia_1->a_output() & 0xFC) >> 2;
692   UINT8 dac_sound =  (status == SOUNDMUX_ENABLE ? m_dac_output << 1 : 0);
693   m_dac->write_unsigned8(single_bit_sound + dac_sound + cassette_sound + cart_sound);
694 
695   /* determine the cassette sound status */
696   cassette_state cas_sound = bCassSoundEnable ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED;
697   m_cassette->change_state(cas_sound, CASSETTE_MASK_SPEAKER);
698 
699   /* determine the cartridge sound status */
700   m_cococart->cart_set_line(COCOCART_LINE_SOUND_ENABLE, bCartSoundEnable ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR);
701}
702 
703 
681   /* determine the sound mux status */
682   soundmux_status_t status = soundmux_status();
704683
684    /* the SC77526 DAC chip internally biases the AC-coupled sound inputs for Cassette and Cartridge at the midpoint of the 3.9v output range */
685    bool bCassSoundEnable = (status == (SOUNDMUX_ENABLE | SOUNDMUX_SEL1));
686    bool bCartSoundEnable = (status == (SOUNDMUX_ENABLE | SOUNDMUX_SEL2));
687    UINT8 cassette_sound = (bCassSoundEnable ? 0x40 : 0);
688    UINT8 cart_sound = (bCartSoundEnable ? 0x40 : 0);
689
690   /* determine the value to send to the DAC */
691   m_dac_output = (m_pia_1->a_output() & 0xFC) >> 2;
692   UINT8 dac_sound =  (status == SOUNDMUX_ENABLE ? m_dac_output << 1 : 0);
693   m_dac->write_unsigned8(single_bit_sound + dac_sound + cassette_sound + cart_sound);
694
695   /* determine the cassette sound status */
696   cassette_state cas_sound = bCassSoundEnable ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED;
697   m_cassette->change_state(cas_sound, CASSETTE_MASK_SPEAKER);
698
699   /* determine the cartridge sound status */
700   m_cococart->cart_set_line(COCOCART_LINE_SOUND_ENABLE, bCartSoundEnable ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR);
701}
702
703
704
705705//-------------------------------------------------
706706//  joystick_type - returns the type of joystick
707707//  in the specified port


Previous 199869 Revisions Next


© 1997-2024 The MAME Team