dac: remove "are these real" section, move 2bit 1s complement dac to the others (it's not r2r or binary weighted, but simply connects one output to (+) speaker lead, one output to (-) speaker lead)

This commit is contained in:
hap 2022-07-12 20:42:49 +02:00
parent 5f57b28c50
commit 35c5843f73
6 changed files with 27 additions and 29 deletions

View File

@ -8,7 +8,7 @@
Binary Weighted Resistor Network, R-2R Ladder & PWM
Binary, Ones Complement, Twos Complement or Sign Magnitude coding
Binary, Ones Complement, or Twos Complement coding
***************************************************************************/
@ -34,8 +34,8 @@ stream_buffer::sample_t dac_mapper_unsigned(u32 input, u8 bits)
//-------------------------------------------------
// dac_mapper_signed - map a signed value of
// the given number of bits to a sample value
// dac_mapper_signed - map a signed (2s complement)
// value of the given number of bits to a sample value
//-------------------------------------------------
stream_buffer::sample_t dac_mapper_signed(u32 input, u8 bits)

View File

@ -218,26 +218,24 @@ DAC_GENERATOR(ZN428E, zn428e_device, dac_byte_device_base, dac_mapper_unsi
DAC_GENERATOR(ZN429E, zn429e_device, dac_byte_device_base, dac_mapper_unsigned, 8, dac_gain_r2r, "ZN429E-8 DAC", "zn429e")
// DAC circuits/unidentified chips
DAC_GENERATOR(DAC_1BIT, dac_1bit_device, dac_bit_device_base, dac_mapper_unsigned, 1, 1.0, "1-Bit DAC", "dac")
DAC_GENERATOR(DAC_2BIT_BINARY_WEIGHTED, dac_2bit_binary_weighted_device, dac_byte_device_base, dac_mapper_unsigned, 2, dac_gain_bw, "2-Bit Binary Weighted DAC", "dac_2bit_bw")
DAC_GENERATOR(DAC_2BIT_R2R, dac_2bit_r2r_device, dac_byte_device_base, dac_mapper_unsigned, 2, dac_gain_r2r, "2-Bit R-2R DAC", "dac_2bit_r2r")
DAC_GENERATOR(DAC_3BIT_BINARY_WEIGHTED, dac_3bit_binary_weighted_device, dac_byte_device_base, dac_mapper_unsigned, 3, dac_gain_bw, "3-Bit Binary Weighted DAC", "dac_3bit_bw")
DAC_GENERATOR(DAC_4BIT_BINARY_WEIGHTED, dac_4bit_binary_weighted_device, dac_byte_device_base, dac_mapper_unsigned, 4, dac_gain_bw, "4-Bit Binary Weighted DAC", "dac_4bit_bw")
DAC_GENERATOR(DAC_4BIT_R2R, dac_4bit_r2r_device, dac_byte_device_base, dac_mapper_unsigned, 4, dac_gain_r2r, "4-Bit R-2R DAC", "dac_4bit_r2r")
DAC_GENERATOR(DAC_6BIT_BINARY_WEIGHTED, dac_6bit_binary_weighted_device, dac_byte_device_base, dac_mapper_unsigned, 6, dac_gain_bw, "6-Bit Binary Weighted DAC", "dac_6bit_bw")
DAC_GENERATOR(DAC_6BIT_R2R, dac_6bit_r2r_device, dac_byte_device_base, dac_mapper_unsigned, 6, dac_gain_r2r, "6-Bit R-2R DAC", "dac_6bit_r2r")
DAC_GENERATOR(DAC_8BIT_BINARY_WEIGHTED, dac_8bit_binary_weighted_device, dac_byte_device_base, dac_mapper_unsigned, 8, dac_gain_bw, "8-Bit Binary Weighted DAC", "dac_8bit_bw")
DAC_GENERATOR(DAC_8BIT_PWM, dac_8bit_pwm_device, dac_byte_device_base, dac_mapper_unsigned, 8, dac_gain_r2r, "8-Bit PWM DAC", "dac_8bit_pwm")
DAC_GENERATOR(DAC_8BIT_R2R, dac_8bit_r2r_device, dac_byte_device_base, dac_mapper_unsigned, 8, dac_gain_r2r, "8-Bit R-2R DAC", "dac_8bit_r2r")
DAC_GENERATOR(DAC_8BIT_R2R_TWOS_COMPLEMENT, dac_8bit_r2r_twos_complement_device, dac_byte_device_base, dac_mapper_signed, 8, dac_gain_r2r, "8-Bit R-2R Twos Complement DAC", "dac_8bit_r2r_tc")
DAC_GENERATOR(DAC_10BIT_R2R, dac_10bit_r2r_device, dac_word_device_base, dac_mapper_unsigned, 10, dac_gain_r2r, "10-Bit R-2R DAC", "dac_10bit_r2r")
DAC_GENERATOR(DAC_12BIT_R2R, dac_12bit_r2r_device, dac_word_device_base, dac_mapper_unsigned, 12, dac_gain_r2r, "12-Bit R-2R DAC", "dac_12bit_r2r")
DAC_GENERATOR(DAC_12BIT_R2R_TWOS_COMPLEMENT, dac_12bit_r2r_twos_complement_device, dac_word_device_base, dac_mapper_signed, 12, dac_gain_r2r, "12-Bit R-2R Twos Complement DAC", "dac_12bit_r2r_tc")
DAC_GENERATOR(DAC_16BIT_R2R, dac_16bit_r2r_device, dac_word_device_base, dac_mapper_unsigned, 16, dac_gain_r2r, "16-Bit R-2R DAC", "dac_16bit_r2r")
DAC_GENERATOR(DAC_16BIT_R2R_TWOS_COMPLEMENT, dac_16bit_r2r_twos_complement_device, dac_word_device_base, dac_mapper_signed, 16, dac_gain_r2r, "16-Bit R-2R Twos Complement DAC", "dac_16bit_r2r_tc")
// special odd cases -- are these real?
DAC_GENERATOR(DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT, dac_2bit_binary_weighted_ones_complement_device, dac_byte_device_base, dac_mapper_ones_complement, 2, dac_gain_bw, "2-Bit Binary Weighted Ones Complement DAC", "dac_2bit_bw_oc")
DAC_GENERATOR(DAC_1BIT, dac_1bit_device, dac_bit_device_base, dac_mapper_unsigned, 1, 1.0, "1-Bit DAC", "dac")
DAC_GENERATOR(DAC_2BIT_BINARY_WEIGHTED, dac_2bit_binary_weighted_device, dac_byte_device_base, dac_mapper_unsigned, 2, dac_gain_bw, "2-Bit Binary Weighted DAC", "dac_2bit_bw")
DAC_GENERATOR(DAC_2BIT_R2R, dac_2bit_r2r_device, dac_byte_device_base, dac_mapper_unsigned, 2, dac_gain_r2r, "2-Bit R-2R DAC", "dac_2bit_r2r")
DAC_GENERATOR(DAC_2BIT_ONES_COMPLEMENT, dac_2bit_ones_complement_device, dac_byte_device_base, dac_mapper_ones_complement, 2, 1.0, "2-Bit Ones Complement DAC", "dac_2bit_oc")
DAC_GENERATOR(DAC_3BIT_BINARY_WEIGHTED, dac_3bit_binary_weighted_device, dac_byte_device_base, dac_mapper_unsigned, 3, dac_gain_bw, "3-Bit Binary Weighted DAC", "dac_3bit_bw")
DAC_GENERATOR(DAC_4BIT_BINARY_WEIGHTED, dac_4bit_binary_weighted_device, dac_byte_device_base, dac_mapper_unsigned, 4, dac_gain_bw, "4-Bit Binary Weighted DAC", "dac_4bit_bw")
DAC_GENERATOR(DAC_4BIT_R2R, dac_4bit_r2r_device, dac_byte_device_base, dac_mapper_unsigned, 4, dac_gain_r2r, "4-Bit R-2R DAC", "dac_4bit_r2r")
DAC_GENERATOR(DAC_6BIT_BINARY_WEIGHTED, dac_6bit_binary_weighted_device, dac_byte_device_base, dac_mapper_unsigned, 6, dac_gain_bw, "6-Bit Binary Weighted DAC", "dac_6bit_bw")
DAC_GENERATOR(DAC_6BIT_R2R, dac_6bit_r2r_device, dac_byte_device_base, dac_mapper_unsigned, 6, dac_gain_r2r, "6-Bit R-2R DAC", "dac_6bit_r2r")
DAC_GENERATOR(DAC_8BIT_BINARY_WEIGHTED, dac_8bit_binary_weighted_device, dac_byte_device_base, dac_mapper_unsigned, 8, dac_gain_bw, "8-Bit Binary Weighted DAC", "dac_8bit_bw")
DAC_GENERATOR(DAC_8BIT_PWM, dac_8bit_pwm_device, dac_byte_device_base, dac_mapper_unsigned, 8, dac_gain_r2r, "8-Bit PWM DAC", "dac_8bit_pwm")
DAC_GENERATOR(DAC_8BIT_R2R, dac_8bit_r2r_device, dac_byte_device_base, dac_mapper_unsigned, 8, dac_gain_r2r, "8-Bit R-2R DAC", "dac_8bit_r2r")
DAC_GENERATOR(DAC_8BIT_R2R_TWOS_COMPLEMENT, dac_8bit_r2r_twos_complement_device, dac_byte_device_base, dac_mapper_signed, 8, dac_gain_r2r, "8-Bit R-2R Twos Complement DAC", "dac_8bit_r2r_tc")
DAC_GENERATOR(DAC_10BIT_R2R, dac_10bit_r2r_device, dac_word_device_base, dac_mapper_unsigned, 10, dac_gain_r2r, "10-Bit R-2R DAC", "dac_10bit_r2r")
DAC_GENERATOR(DAC_12BIT_R2R, dac_12bit_r2r_device, dac_word_device_base, dac_mapper_unsigned, 12, dac_gain_r2r, "12-Bit R-2R DAC", "dac_12bit_r2r")
DAC_GENERATOR(DAC_12BIT_R2R_TWOS_COMPLEMENT, dac_12bit_r2r_twos_complement_device, dac_word_device_base, dac_mapper_signed, 12, dac_gain_r2r, "12-Bit R-2R Twos Complement DAC", "dac_12bit_r2r_tc")
DAC_GENERATOR(DAC_16BIT_R2R, dac_16bit_r2r_device, dac_word_device_base, dac_mapper_unsigned, 16, dac_gain_r2r, "16-Bit R-2R DAC", "dac_16bit_r2r")
DAC_GENERATOR(DAC_16BIT_R2R_TWOS_COMPLEMENT, dac_16bit_r2r_twos_complement_device, dac_word_device_base, dac_mapper_signed, 16, dac_gain_r2r, "16-Bit R-2R Twos Complement DAC", "dac_16bit_r2r_tc")
#undef DAC_GENERATOR

View File

@ -62,7 +62,7 @@ private:
required_device<cpu_device> m_maincpu;
required_device<pwm_display_device> m_display;
required_device<sensorboard_device> m_board;
required_device<dac_2bit_binary_weighted_ones_complement_device> m_dac;
required_device<dac_2bit_ones_complement_device> m_dac;
required_device<address_map_bank_device> m_mainmap;
required_ioport_array<2> m_inputs;
@ -234,7 +234,7 @@ void master_state::master(machine_config &config)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.125);
DAC_2BIT_ONES_COMPLEMENT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.125);
}

View File

@ -63,7 +63,7 @@ private:
required_device<hd61603_device> m_lcd;
required_device<pwm_display_device> m_display;
required_device<sensorboard_device> m_board;
required_device<dac_2bit_binary_weighted_ones_complement_device> m_dac;
required_device<dac_2bit_ones_complement_device> m_dac;
required_ioport_array<3> m_inputs;
output_finder<8> m_out_digit;
output_finder<64> m_out_lcd;
@ -249,7 +249,7 @@ void y532xl_state::y532xl(machine_config &config)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.125);
DAC_2BIT_ONES_COMPLEMENT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.125);
}

View File

@ -2450,7 +2450,7 @@ void vidchal_state::vidchal(machine_config &config)
// sound hardware
SPEAKER(config, "mono").front_center();
DAC_4BIT_R2R(config, "dac").add_route(ALL_OUTPUTS, "mono", 0.125);
DAC_4BIT_BINARY_WEIGHTED(config, "dac").add_route(ALL_OUTPUTS, "mono", 0.125);
}
// roms

View File

@ -478,7 +478,7 @@ void microvision_state::microvision(machine_config &config)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC
DAC_2BIT_ONES_COMPLEMENT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.25);
/* cartridge */
GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "microvision_cart");