sinclair/spectrum.cpp: Play cassette output through speaker (MT08342). (#10199)

This commit is contained in:
holub 2022-08-11 12:00:57 -04:00 committed by GitHub
parent 5f2ae1149b
commit a99e48b6a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -346,16 +346,19 @@ void spectrum_state::spectrum_ula_w(offs_t offset, uint8_t data)
if (is_contended(offset)) content_early();
content_early(1);
unsigned char Changed = m_port_fe_data^data;
u8 changed = m_port_fe_data ^ data;
/* border colour changed? */
if ((Changed & 0x07)!=0) m_screen->update_now();
/* D0-D2: border colour changed? */
if (changed & 0x07) m_screen->update_now();
/* DAC output state */
if ((Changed & (1<<4))!=0) m_speaker->level_w(BIT(data, 4));
/* D3-D4: MIC+DAC output state */
if (changed & 0x18)
{
/* D3: write cassette data */
if (BIT(changed, 3)) m_cassette->output(BIT(data, 3) ? -1.0 : +1.0);
/* write cassette data */
if ((Changed & (1<<3))!=0) m_cassette->output((data & (1<<3)) ? -1.0 : +1.0);
m_speaker->level_w(BIT(data, 3, 2));
}
// Some exp devices use ula port unused bits 5-7:
// Beta v2/3/plus use bit 7, Beta clones use bits 6 and 7
@ -821,7 +824,9 @@ void spectrum_state::spectrum_common(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50);
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50);
static const double speaker_levels[4] = { 0.0, 0.33, 0.66, 1.0 };
m_speaker->set_levels(4, speaker_levels);
/* expansion port */
SPECTRUM_EXPANSION_SLOT(config, m_exp, spectrum_expansion_devices, "kempjoy");