mirror of
https://github.com/holub/mame
synced 2025-07-05 18:08:04 +03:00
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.
This commit is contained in:
parent
2ed9b028b2
commit
761788fbd9
@ -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");
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user