summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/pastelg.cpp
diff options
context:
space:
mode:
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
commit36944269bd6fe1fb47822a2112c524b13c4b27f2 (patch)
treec1b29a760bb9a1e222a9390fbc34fe09d407ae91 /src/mame/drivers/pastelg.cpp
parent8676fc0d8dd0c3ccf2925075d86338da099ce148 (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/pastelg.cpp')
-rw-r--r--src/mame/drivers/pastelg.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/src/mame/drivers/pastelg.cpp b/src/mame/drivers/pastelg.cpp
index 10c1a2204f5..63c9261496a 100644
--- a/src/mame/drivers/pastelg.cpp
+++ b/src/mame/drivers/pastelg.cpp
@@ -23,19 +23,12 @@ Memo:
******************************************************************************/
#include "emu.h"
+#include "includes/pastelg.h"
#include "cpu/z80/z80.h"
+#include "machine/nvram.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/pastelg.h"
-#include "machine/nvram.h"
-
-
-#define SIGNED_DAC 0 // 0:unsigned DAC, 1:signed DAC
-#if SIGNED_DAC
-#define DAC_WRITE write_signed8
-#else
-#define DAC_WRITE write_unsigned8
-#endif
+#include "sound/volt_reg.h"
void pastelg_state::machine_start()
@@ -73,7 +66,7 @@ static ADDRESS_MAP_START( pastelg_io_map, AS_IO, 8, pastelg_state )
AM_RANGE(0xb0, 0xb0) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport2_r) AM_WRITE(pastelg_romsel_w)
AM_RANGE(0xc0, 0xc0) AM_READ(pastelg_sndrom_r)
AM_RANGE(0xc0, 0xcf) AM_WRITEONLY AM_SHARE("clut")
- AM_RANGE(0xd0, 0xd0) AM_READ(pastelg_irq_ack_r) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_READ(pastelg_irq_ack_r) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_READ_PORT("DSWC")
ADDRESS_MAP_END
@@ -126,7 +119,7 @@ static ADDRESS_MAP_START( threeds_io_map, AS_IO, 8, pastelg_state )
AM_RANGE(0xb0, 0xb0) AM_READ(threeds_inputport2_r) AM_WRITE(threeds_output_w)//writes: bit 3 is coin lockout, bit 1 is coin counter
AM_RANGE(0xc0, 0xcf) AM_WRITEONLY AM_SHARE("clut")
AM_RANGE(0xc0, 0xc0) AM_READ(threeds_rom_readback_r)
- AM_RANGE(0xd0, 0xd0) AM_READ(pastelg_irq_ack_r) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_READ(pastelg_irq_ack_r) AM_DEVWRITE("dac", dac_byte_interface, write)
ADDRESS_MAP_END
static INPUT_PORTS_START( pastelg )
@@ -425,15 +418,16 @@ static MACHINE_CONFIG_START( pastelg, pastelg_state )
MCFG_PALETTE_INIT_OWNER(pastelg_state, pastelg)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("aysnd", AY8910, 1250000)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWB"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWA"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ 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)
MACHINE_CONFIG_END
/*
@@ -483,15 +477,16 @@ static MACHINE_CONFIG_START( threeds, pastelg_state )
MCFG_PALETTE_INIT_OWNER(pastelg_state, pastelg)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("aysnd", AY8910, 1250000)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWB"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWA"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ 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)
MACHINE_CONFIG_END