From fa15cad30910694c788e2328516d1cc3adf52fac Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 3 Nov 2016 21:13:05 +0100 Subject: [PATCH] risc2500: added preliminary sound --- src/mame/drivers/risc2500.cpp | 19 ++++++++++++++++--- src/mame/mame.lst | 4 +++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/mame/drivers/risc2500.cpp b/src/mame/drivers/risc2500.cpp index a148a9b93ab..426980056e5 100644 --- a/src/mame/drivers/risc2500.cpp +++ b/src/mame/drivers/risc2500.cpp @@ -5,7 +5,8 @@ Saitek RISC 2500 TODO: - - sound + - Sound is too short and high pitch, better when you underclock the cpu. + Is cpu cycle timing wrong? or internal divider? ******************************************************************************/ @@ -14,6 +15,8 @@ #include "cpu/arm/arm.h" #include "machine/ram.h" #include "machine/nvram.h" +#include "sound/dac.h" +#include "sound/volt_reg.h" #include "risc2500.lh" @@ -26,6 +29,7 @@ public: m_maincpu(*this, "maincpu"), m_ram(*this, "ram"), m_nvram(*this, "nvram"), + m_dac(*this, "dac"), m_inputs(*this, "P%u", 0) { } @@ -44,6 +48,7 @@ private: required_device m_maincpu; required_device m_ram; required_device m_nvram; + required_device m_dac; required_ioport_array<8> m_inputs; uint32_t m_p1000; @@ -237,7 +242,9 @@ WRITE32_MEMBER(risc2500_state::p1000_w) { memset(m_vram, 0, sizeof(m_vram)); } - + + m_dac->write(data >> 28 & 3); // Speaker + m_p1000 = data; } @@ -300,6 +307,12 @@ static MACHINE_CONFIG_START( risc2500, risc2500_state ) MCFG_RAM_EXTRA_OPTIONS("128K, 256K, 512K, 1M, 2M") MCFG_NVRAM_ADD_NO_FILL("nvram") + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("speaker") + MCFG_SOUND_ADD("dac", DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT, 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 @@ -312,4 +325,4 @@ ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ -CONS( 1992, risc, 0, 0, risc2500, risc2500, driver_device, 0, "Saitek", "RISC 2500", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1992, risc, 0, 0, risc2500, risc2500, driver_device, 0, "Saitek", "RISC 2500", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 5e9fc7f3418..5fccc477146 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -20423,7 +20423,6 @@ megaiv // 1989 Mephisto Mega IV Schachcomputer milano // 1989 Mephisto Milano Schachcomputer monteciv // 1990 Mephisto Monte Carlo IV LE Schachcomputer polgar // 1986 Mephisto Polgar Schachcomputer -risc // Saitek 2500 14MHZ (skeleton) sexpertb // 1988 Novag Expert B Chess Computer sexpertc // 1989 Novag Super Expert C Chess Computer sfortea // 1987 Novag Super Forte A Chess Computer @@ -31538,6 +31537,9 @@ rex6000 // @source:rgum.cpp rgum // +@source:risc2500.cpp +risc // + @source:riscpc.cpp a7000 // 1995 Acorn Archimedes 7000 a7000p // 1997 Acorn Archimedes 7000+