Correct Color Computer DAC type and separate single-bit sound

A few notes on Tandy 1000 joysticks (nw)
This commit is contained in:
AJR 2017-01-14 19:49:44 -05:00
parent 56d86b029a
commit cd4e732364
4 changed files with 27 additions and 15 deletions

View File

@ -279,9 +279,16 @@ SLOT_INTERFACE_END
MACHINE_CONFIG_FRAGMENT( coco_sound )
MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.125) // unknown DAC
// 6-bit D/A: R10-15 = 10K, 20K, 40.2K, 80.6K, 162K, 324K (according to parts list); output also controls joysticks
MCFG_SOUND_ADD("dac", DAC_6BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.125)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
// Single-bit sound: R22 = 10K
MCFG_SOUND_ADD("sbs", DAC_1BIT, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.125)
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END

View File

@ -8,6 +8,11 @@ Tandy 1000 machines are similar to the IBM 5160s with CGA graphics. Tandy
added some additional graphic capabilities similar, but not equal, to
those added for the IBM PC Jr.
The Tandy 1000's features include a pair of 6-pin mini-DIN connectors for
analog joysticks. They are compatible with CoCo joysticks but not standard
PC joysticks, though the software interface is identical. This difference
is not accurately reflected in the current slot device configuration.
Tandy 1000 (8088) variations:
1000 128KB-640KB RAM 4.77 MHz v01.00.00, v01.01.00
1000A/1000HD 128KB-640KB RAM 4.77 MHz v01.01.00

View File

@ -93,6 +93,7 @@ public:
required_device<pia6821_device> m_pia_0;
required_device<pia6821_device> m_pia_1;
required_device<dac_byte_interface> m_dac;
required_device<dac_1bit_device> m_sbs;
required_device<wave_device> m_wave;
required_device<cococart_slot_device> m_cococart;
required_device<ram_device> m_ram;

View File

@ -84,6 +84,7 @@ coco_state::coco_state(const machine_config &mconfig, device_type type, const ch
m_pia_0(*this, PIA0_TAG),
m_pia_1(*this, PIA1_TAG),
m_dac(*this, "dac"),
m_sbs(*this, "sbs"),
m_wave(*this, WAVE_TAG),
m_cococart(*this, CARTRIDGE_TAG),
m_ram(*this, RAM_TAG),
@ -657,28 +658,20 @@ coco_state::soundmux_status_t coco_state::soundmux_status(void)
void coco_state::update_sound(void)
{
/* PB1 will drive the sound output. This is a rarely
* used single bit sound mode. It is always connected thus
* cannot be disabled.
*
* Source: Page 31 of the Tandy Color Computer Serice Manual
*/
uint8_t single_bit_sound = (m_pia_1->b_output() & 0x02) ? 0x80 : 0x00;
/* determine the sound mux status */
soundmux_status_t status = soundmux_status();
/* the SC77526 DAC chip internally biases the AC-coupled sound inputs for Cassette and Cartridge at the midpoint of the 3.9v output range */
bool bCassSoundEnable = (status == (SOUNDMUX_ENABLE | SOUNDMUX_SEL1));
bool bCartSoundEnable = (status == (SOUNDMUX_ENABLE | SOUNDMUX_SEL2));
uint8_t cassette_sound = (bCassSoundEnable ? 0x40 : 0);
uint8_t cart_sound = (bCartSoundEnable ? 0x40 : 0);
uint8_t cassette_sound = (bCassSoundEnable ? 0x20 : 0);
uint8_t cart_sound = (bCartSoundEnable ? 0x20 : 0);
/* determine the value to send to the DAC (this is used by the Joystick read as well as audio out) */
m_dac_output = (m_pia_1->a_output() & 0xFC) >> 2;
uint8_t dac_sound = (status == SOUNDMUX_ENABLE ? m_dac_output << 1 : 0);
uint8_t dac_sound = (status == SOUNDMUX_ENABLE ? m_dac_output : 0);
/* The CoCo uses a single DAC for both audio output and joystick axis position measurement.
/* The CoCo uses the main 6-bit DAC for both audio output and joystick axis position measurement.
* To avoid introducing artifacts while reading the axis positions, some software will disable
* the audio output while using the DAC to read the joystick. On a real CoCo, there is a low-pass
* filter (C57 on the CoCo 3) which will hold the audio level for very short periods of time,
@ -692,7 +685,7 @@ void coco_state::update_sound(void)
m_analog_audio_level = dac_sound + cassette_sound + cart_sound;
}
m_dac->write(single_bit_sound + m_analog_audio_level);
m_dac->write(m_analog_audio_level);
/* determine the cassette sound status */
cassette_state cas_sound = bCassSoundEnable ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED;
@ -999,7 +992,13 @@ void coco_state::pia1_pa_changed(uint8_t data)
void coco_state::pia1_pb_changed(uint8_t data)
{
update_sound(); // singe_bit_sound is connected to PIA1 PB1
/* PB1 will drive the sound output. This is a rarely
* used single bit sound mode. It is always connected thus
* cannot be disabled.
*
* Source: Page 31 of the Tandy Color Computer Serice Manual
*/
m_sbs->write(BIT(data, 1));
}