summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/cc40.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/cc40.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/cc40.cpp')
-rw-r--r--src/mame/drivers/cc40.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/mame/drivers/cc40.cpp b/src/mame/drivers/cc40.cpp
index f3500bcabbd..e8e04132d12 100644
--- a/src/mame/drivers/cc40.cpp
+++ b/src/mame/drivers/cc40.cpp
@@ -73,12 +73,13 @@
***************************************************************************/
#include "emu.h"
-#include "cpu/tms7000/tms7000.h"
-#include "video/hd44780.h"
-#include "sound/dac.h"
-#include "machine/nvram.h"
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
+#include "cpu/tms7000/tms7000.h"
+#include "machine/nvram.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
+#include "video/hd44780.h"
#include "softlist.h"
#include "cc40.lh"
@@ -90,7 +91,6 @@ public:
cc40_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_dac(*this, "dac"),
m_cart(*this, "cartslot"),
m_key_matrix(*this, "IN.%u", 0),
m_battery_inp(*this, "BATTERY")
@@ -100,7 +100,6 @@ public:
}
required_device<tms70c20_device> m_maincpu;
- required_device<dac_device> m_dac;
required_device<generic_slot_device> m_cart;
required_ioport_array<8> m_key_matrix;
required_ioport m_battery_inp;
@@ -131,7 +130,6 @@ public:
DECLARE_READ8_MEMBER(bus_control_r);
DECLARE_WRITE8_MEMBER(bus_control_w);
DECLARE_WRITE8_MEMBER(power_w);
- DECLARE_WRITE8_MEMBER(sound_w);
DECLARE_READ8_MEMBER(battery_r);
DECLARE_READ8_MEMBER(bankswitch_r);
DECLARE_WRITE8_MEMBER(bankswitch_w);
@@ -289,12 +287,6 @@ WRITE8_MEMBER(cc40_state::power_w)
m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
}
-WRITE8_MEMBER(cc40_state::sound_w)
-{
- // d0: piezo control
- m_dac->write_signed8((data & 1) ? 0x7f : 0);
-}
-
READ8_MEMBER(cc40_state::battery_r)
{
// d0: low battery sense line (0 = low power)
@@ -370,7 +362,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, cc40_state )
AM_RANGE(0x0112, 0x0112) AM_NOP // d0-d3: Hexbus data
AM_RANGE(0x0113, 0x0113) AM_NOP // d0: Hexbus available
AM_RANGE(0x0114, 0x0114) AM_NOP // d0,d1: Hexbus handshake
- AM_RANGE(0x0115, 0x0115) AM_WRITE(sound_w)
+ AM_RANGE(0x0115, 0x0115) AM_DEVWRITE("dac", dac_bit_interface, write) // d0: piezo control
AM_RANGE(0x0116, 0x0116) AM_READ(battery_r)
AM_RANGE(0x0119, 0x0119) AM_READWRITE(bankswitch_r, bankswitch_w)
AM_RANGE(0x011a, 0x011a) AM_READWRITE(clock_control_r, clock_control_w)
@@ -609,10 +601,10 @@ static MACHINE_CONFIG_START( cc40, cc40_state )
MCFG_HD44780_PIXEL_UPDATE_CB(cc40_state, cc40_pixel_update)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ 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)
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "cc40_cart")