summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/mame/ui/ui.cpp')
-rw-r--r--src/frontend/mame/ui/ui.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index 22404f32364..c6a7bb21727 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -43,6 +43,8 @@
#include <chrono>
#include <type_traits>
+#define VISIBLE_SOUND_OVERDRIVE (1)
+
/***************************************************************************
CONSTANTS
@@ -643,6 +645,20 @@ void mame_ui_manager::update_and_render(render_container &container)
container.add_rect(0.0f, 0.0f, 1.0f, 1.0f, rgb_t(alpha,0x00,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
}
+ // show red if overdriving sound
+ if (VISIBLE_SOUND_OVERDRIVE && machine().phase() == machine_phase::RUNNING)
+ {
+ auto compressor = machine().sound().compressor_scale();
+ if (compressor < 1.0)
+ {
+ float width = 0.05f + std::min(0.15f, (1.0f - compressor) * 0.4f);
+ container.add_rect(0.0f, 0.0f, 1.0f, width, rgb_t(0xc0,0xff,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+ container.add_rect(0.0f, 1.0f - width, 1.0f, 1.0f, rgb_t(0xc0,0xff,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+ container.add_rect(0.0f, width, width, 1.0f - width, rgb_t(0xc0,0xff,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+ container.add_rect(1.0f - width, width, 1.0f, 1.0f - width, rgb_t(0xc0,0xff,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+ }
+ }
+
// render any cheat stuff at the bottom
if (machine().phase() >= machine_phase::RESET)
mame_machine_manager::instance()->cheat().render_text(*this, container);