From 35c5843f73e486bece469b8edd062ff3e35ac295 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 12 Jul 2022 20:42:49 +0200 Subject: 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) --- src/devices/sound/dac.cpp | 6 +++--- src/devices/sound/dac.h | 38 ++++++++++++++++++------------------- src/mame/chess/cking_master.cpp | 4 ++-- src/mame/chess/yeno_532xl.cpp | 4 ++-- src/mame/handheld/hh_cop400.cpp | 2 +- src/mame/miltonbradley/microvsn.cpp | 2 +- 6 files changed, 27 insertions(+), 29 deletions(-) diff --git a/src/devices/sound/dac.cpp b/src/devices/sound/dac.cpp index f32d61006bc..7305f2c12a7 100644 --- a/src/devices/sound/dac.cpp +++ b/src/devices/sound/dac.cpp @@ -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) diff --git a/src/devices/sound/dac.h b/src/devices/sound/dac.h index 172e56592ee..e0b4fb01cf9 100644 --- a/src/devices/sound/dac.h +++ b/src/devices/sound/dac.h @@ -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 diff --git a/src/mame/chess/cking_master.cpp b/src/mame/chess/cking_master.cpp index 764d46bc4e3..3b5fe0b65fc 100644 --- a/src/mame/chess/cking_master.cpp +++ b/src/mame/chess/cking_master.cpp @@ -62,7 +62,7 @@ private: required_device m_maincpu; required_device m_display; required_device m_board; - required_device m_dac; + required_device m_dac; required_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); } diff --git a/src/mame/chess/yeno_532xl.cpp b/src/mame/chess/yeno_532xl.cpp index e828478cab5..10618cb063e 100644 --- a/src/mame/chess/yeno_532xl.cpp +++ b/src/mame/chess/yeno_532xl.cpp @@ -63,7 +63,7 @@ private: required_device m_lcd; required_device m_display; required_device m_board; - required_device m_dac; + required_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); } diff --git a/src/mame/handheld/hh_cop400.cpp b/src/mame/handheld/hh_cop400.cpp index 26d23b79d7b..c9a1c3c2245 100644 --- a/src/mame/handheld/hh_cop400.cpp +++ b/src/mame/handheld/hh_cop400.cpp @@ -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 diff --git a/src/mame/miltonbradley/microvsn.cpp b/src/mame/miltonbradley/microvsn.cpp index eede6688ee5..1a8fc88f737 100644 --- a/src/mame/miltonbradley/microvsn.cpp +++ b/src/mame/miltonbradley/microvsn.cpp @@ -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"); -- cgit v1.2.3