diff options
author | smf- <smf-@users.noreply.github.com> | 2016-10-17 16:03:29 +0100 |
---|---|---|
committer | smf- <smf-@users.noreply.github.com> | 2016-10-17 16:04:02 +0100 |
commit | 36944269bd6fe1fb47822a2112c524b13c4b27f2 (patch) | |
tree | c1b29a760bb9a1e222a9390fbc34fe09d407ae91 /src/mame/drivers/suna8.cpp | |
parent | 8676fc0d8dd0c3ccf2925075d86338da099ce148 (diff) |
DAC WIP, started documenting the DACs in use. [smf]
ataxx: Fixed missing sound channel caused by one dac not being hooked up and one dac being hooked up to two addresses.
bestbest: Fixed high pitch screech caused by incorrect addressing (two dacs weren't hooked up and two were hooked up to two addresses).
cchasm: Fixed static noise generation caused by feeding the same bit to both dacs.
cheekyms: Slightly improved sound by implementing sound triggers as 8 x 1 bit dacs instead of 1 x 8 bit dac.
galeb: Fixed sound by implementing it according to http://www.deltasoft.com.hr/retro/galebemu.htm & implemented enough of LOAD/SAVE to stop it hanging.
hard drivin: (all games in driver) Improved 12 bit controls, although centre still goes out of sync.
mea8000: Converted to a sound device.
megaphx: Fixed noisy samples due to wrong format.
microvsn: Fixed sound pitch caused by incorrect usage of write_signed8().
seicross: Changed to a 4 bit dac as samples are packed nibble.
spaceg: Preliminary sound using space invaders samples.
suna8: Changed to a 4 bit dac as samples are packed nibble.
vcombat: Fixed static during machine gun fire due to incorrect dc offset removal.
vectrex: Fixed noisy samples due to wrong format.
wheelfir: Fixed sound, eeprom & analogue steering wheel and brake pedal.
Diffstat (limited to 'src/mame/drivers/suna8.cpp')
-rw-r--r-- | src/mame/drivers/suna8.cpp | 79 |
1 files changed, 37 insertions, 42 deletions
diff --git a/src/mame/drivers/suna8.cpp b/src/mame/drivers/suna8.cpp index 9c129a5174a..114ab90e917 100644 --- a/src/mame/drivers/suna8.cpp +++ b/src/mame/drivers/suna8.cpp @@ -8,7 +8,7 @@ Main CPU: Encrypted Z80 (Epoxy Module) -Sound CPU: Z80 [Music] + Z80 [8 Bit PCM, Optional] +Sound CPU: Z80 [Music] + Z80 [4 Bit PCM, Optional] Sound Chips: AY8910 + YM3812/YM2203 + DAC x 4 [Optional] + Samples [Optional] @@ -36,13 +36,14 @@ Notes: ***************************************************************************/ #include "emu.h" +#include "includes/suna8.h" #include "cpu/z80/z80.h" #include "machine/watchdog.h" -#include "sound/ay8910.h" #include "sound/2203intf.h" #include "sound/3812intf.h" +#include "sound/ay8910.h" #include "sound/dac.h" -#include "includes/suna8.h" +#include "sound/volt_reg.h" #define SUNA8_MASTER_CLOCK XTAL_24MHz @@ -1307,17 +1308,13 @@ static ADDRESS_MAP_START( brickzn_pcm_map, AS_PROGRAM, 8, suna8_state ) ADDRESS_MAP_END -WRITE8_MEMBER(suna8_state::brickzn_pcm_w) -{ - static const char *const dacs[] = { "dac1", "dac2", "dac3", "dac4" }; - machine().device<dac_device>(dacs[offset & 3])->write_signed8( (data & 0xf) * 0x11 ); -} - - static ADDRESS_MAP_START( brickzn_pcm_io_map, AS_IO, 8, suna8_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) // From Sound CPU - AM_RANGE(0x00, 0x03) AM_WRITE(brickzn_pcm_w ) // 4 x DAC + AM_RANGE(0x00, 0x00) AM_DEVWRITE("ldac", dac_byte_interface, write) + AM_RANGE(0x01, 0x01) AM_DEVWRITE("rdac", dac_byte_interface, write) + AM_RANGE(0x02, 0x02) AM_DEVWRITE("ldac2", dac_byte_interface, write) + AM_RANGE(0x03, 0x03) AM_DEVWRITE("rdac2", dac_byte_interface, write) ADDRESS_MAP_END /*************************************************************************** @@ -1898,23 +1895,23 @@ static MACHINE_CONFIG_START( hardhead, suna8_state ) MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_text) /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SPEAKER_STANDARD_MONO("speaker") MCFG_GENERIC_LATCH_8_ADD("soundlatch") MCFG_GENERIC_LATCH_8_ADD("soundlatch2") MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) /* verified on pcb */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16) /* verified on pcb */ MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, suna8_play_samples_w)) MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suna8_state, suna8_samples_number_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) MCFG_SOUND_ADD("samples", SAMPLES, 0) MCFG_SAMPLES_CHANNELS(1) MCFG_SAMPLES_START_CB(suna8_state, sh_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) MACHINE_CONFIG_END @@ -1957,7 +1954,7 @@ static MACHINE_CONFIG_START( rranger, suna8_state ) MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_text) /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SPEAKER_STANDARD_MONO("speaker") MCFG_GENERIC_LATCH_8_ADD("soundlatch") MCFG_GENERIC_LATCH_8_ADD("soundlatch2") @@ -1965,15 +1962,15 @@ static MACHINE_CONFIG_START( rranger, suna8_state ) MCFG_SOUND_ADD("ym1", YM2203, SUNA8_MASTER_CLOCK / 16) /* verified on pcb */ MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, rranger_play_samples_w)) MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suna8_state, suna8_samples_number_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.9) MCFG_SOUND_ADD("ym2", YM2203, SUNA8_MASTER_CLOCK / 16) /* verified on pcb */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.9) MCFG_SOUND_ADD("samples", SAMPLES, 0) MCFG_SAMPLES_CHANNELS(1) MCFG_SAMPLES_START_CB(suna8_state, sh_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) MACHINE_CONFIG_END @@ -2026,29 +2023,27 @@ static MACHINE_CONFIG_START( brickzn11, suna8_state ) MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_brickzn) /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SPEAKER_STANDARD_MONO("speaker") MCFG_GENERIC_LATCH_8_ADD("soundlatch") MCFG_GENERIC_LATCH_8_ADD("soundlatch2") MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) // 3MHz (measured) MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16) // 1.5MHz (measured) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) - - MCFG_DAC_ADD("dac1") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.17) - - MCFG_DAC_ADD("dac2") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.17) - - MCFG_DAC_ADD("dac3") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.17) - - MCFG_DAC_ADD("dac4") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.17) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.33) + + MCFG_SOUND_ADD("ldac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.17) // unknown DAC + MCFG_SOUND_ADD("rdac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.17) // unknown DAC + MCFG_SOUND_ADD("ldac2", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.17) // unknown DAC + MCFG_SOUND_ADD("rdac2", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.17) // unknown DAC + MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) + MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT) + MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT) + MCFG_SOUND_ROUTE_EX(0, "ldac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac2", -1.0, DAC_VREF_NEG_INPUT) + MCFG_SOUND_ROUTE_EX(0, "rdac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac2", -1.0, DAC_VREF_NEG_INPUT) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( brickzn, brickzn11 ) @@ -2139,23 +2134,23 @@ static MACHINE_CONFIG_START( starfigh, suna8_state ) MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_starfigh) /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SPEAKER_STANDARD_MONO("speaker") MCFG_GENERIC_LATCH_8_ADD("soundlatch") MCFG_GENERIC_LATCH_8_ADD("soundlatch2") MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16) MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, suna8_play_samples_w)) MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suna8_state, suna8_samples_number_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) MCFG_SOUND_ADD("samples", SAMPLES, 0) MCFG_SAMPLES_CHANNELS(1) MCFG_SAMPLES_START_CB(suna8_state, sh_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) MACHINE_CONFIG_END @@ -2193,23 +2188,23 @@ static MACHINE_CONFIG_START( sparkman, suna8_state ) MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_sparkman) /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SPEAKER_STANDARD_MONO("speaker") MCFG_GENERIC_LATCH_8_ADD("soundlatch") MCFG_GENERIC_LATCH_8_ADD("soundlatch2") MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16) MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, suna8_play_samples_w)) // two sample roms MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suna8_state, suna8_samples_number_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) MCFG_SOUND_ADD("samples", SAMPLES, 0) MCFG_SAMPLES_CHANNELS(1) MCFG_SAMPLES_START_CB(suna8_state, sh_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) MACHINE_CONFIG_END |