summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2022-08-20 20:56:56 +1000
committer Vas Crabb <vas@vastheman.com>2022-08-20 20:56:56 +1000
commit761788fbd9ce7e272c84473de80260a66c05e85e (patch)
treee4c24671ff94492013a64c6f93a78743c4e24139
parent2ed9b028b20a4207e971b9845fc82a6ba252d6d1 (diff)
emu/validity.cpp, ui/info.cpp: Base "no sound" check on speaker devices.
Currently the speaker device is the only way sound can get to the OSD layer, so its presence or absence determines whether the emulated system is capabale of producing sound. A few systems use chips with sound capability for other purposes (typically I/O or video) while leaving the sound outputs disconnected. These systems should display the notice about the absence of sound output.
-rw-r--r--src/emu/validity.cpp6
-rw-r--r--src/frontend/mame/ui/info.cpp3
2 files changed, 6 insertions, 3 deletions
diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp
index e4cf0860064..fa80e36d5f2 100644
--- a/src/emu/validity.cpp
+++ b/src/emu/validity.cpp
@@ -11,10 +11,12 @@
#include "emu.h"
#include "validity.h"
-#include "corestr.h"
#include "emuopts.h"
#include "romload.h"
+#include "speaker.h"
#include "video/rgbutil.h"
+
+#include "corestr.h"
#include "unicode.h"
#include <cctype>
@@ -2044,7 +2046,7 @@ void validity_checker::validate_driver(device_t &root)
device_t::feature_type const imperfect(m_current_driver->type.imperfect_features());
if (!(m_current_driver->flags & (machine_flags::IS_BIOS_ROOT | machine_flags::NO_SOUND_HW)) && !(unemulated & device_t::feature::SOUND))
{
- sound_interface_enumerator iter(root);
+ speaker_device_enumerator iter(root);
if (!iter.first())
osd_printf_error("Driver is missing MACHINE_NO_SOUND or MACHINE_NO_SOUND_HW flag\n");
}
diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp
index f6fa969bbb4..da1bc11eb77 100644
--- a/src/frontend/mame/ui/info.cpp
+++ b/src/frontend/mame/ui/info.cpp
@@ -19,6 +19,7 @@
#include "romload.h"
#include "screen.h"
#include "softlist.h"
+#include "speaker.h"
#include <set>
#include <sstream>
@@ -208,7 +209,7 @@ machine_static_info::machine_static_info(const ui_options &options, machine_conf
for (device_t &device : device_enumerator(config.root_device()))
{
// the "no sound hardware" warning doesn't make sense when you plug in a sound card
- if (dynamic_cast<device_sound_interface *>(&device))
+ if (dynamic_cast<speaker_device *>(&device))
m_flags &= ~::machine_flags::NO_SOUND_HW;
// build overall emulation status