Hi mdrejhon,
Thanks for spreading this. I just want to clarify I'm not one of the MAME devs, so I can't add anything into MAME documentation. Of course I will add your link for reference on the new GroovyMAME update when this feature is included.
The new version is a bit delayed as there are some bulk changes to the source that need to be done, probably not so exciting stuff but defintely required.
The -strobe patch (or "-black_frame_insertion" if we rename it finally), as it is now, is just too hacky for MAME devs to consider, however a reworked version of it might have some chance some day, especially when there's general awareness (i.e: mameworld forums) of the improved visual experience (it might be early for this yet, as most of us still use 60 Hz panels). If you think about it, HLSL is definitely much more baroque and managed to get its way into baseline MAME.
Just thought I'd copy the patch here so people following this thread understand what we're talking about. This is to be applied to baseline MAME v0.148, NOT GroovyMAME. It adds a new option named -strobe, so create a new mame.ini (mame -cc). This is for 120 Hz LCD only.
For proper operation, these parameters are *required*: -strobe -video d3d -syncrefresh -nothrottle -nomultithreading
diff -rupN ./src/osd/windows/drawd3d.c ./src/osd/windows/drawd3d.c
--- ./src/osd/windows/drawd3d.c 2013-01-11 08:32:46.000000000 +0100
+++ ./src/osd/windows/drawd3d.c 2013-03-01 22:34:18.000000000 +0100
@@ -545,6 +545,7 @@ static int drawd3d_window_draw(win_windo
{
d3d_info *d3d = (d3d_info *)window->drawdata;
render_primitive *prim;
+ static bool blank_frame;
HRESULT result;
// if we're in the middle of resizing, leave things alone
@@ -581,6 +582,9 @@ mtlog_add("drawd3d_window_draw: begin");
d3d->hlsl->record_texture();
+ blank_frame = !blank_frame;
+ if (!video_config.strobe || !blank_frame){
+
// first update any textures
window->primlist->acquire_lock();
for (prim = window->primlist->first(); prim != NULL; prim = prim->next())
@@ -629,7 +633,7 @@ mtlog_add("drawd3d_window_draw: primitiv
}
mtlog_add("drawd3d_window_draw: primitive loop end");
window->primlist->release_lock();
-
+}
// flush any pending polygons
mtlog_add("drawd3d_window_draw: flush_pending begin");
primitive_flush_pending(d3d);
diff -rupN ./src/osd/windows/video.c ./src/osd/windows/video.c
--- ./src/osd/windows/video.c 2011-12-15 15:10:46.000000000 +0100
+++ ./src/osd/windows/video.c 2013-03-01 21:57:39.000000000 +0100
@@ -427,6 +427,7 @@ static void extract_video_config(running
video_config.syncrefresh = options.sync_refresh();
video_config.triplebuf = options.triple_buffer();
video_config.switchres = options.switch_res();
+ video_config.strobe = options.strobe();
// ddraw options: extract the data
video_config.hwstretch = options.hwstretch();
diff -rupN ./src/osd/windows/video.h ./src/osd/windows/video.h
--- ./src/osd/windows/video.h 2013-01-11 08:32:46.000000000 +0100
+++ ./src/osd/windows/video.h 2013-03-01 21:56:26.000000000 +0100
@@ -100,6 +100,7 @@ struct win_video_config
int syncrefresh; // sync only to refresh rate
int triplebuf; // triple buffer
int switchres; // switch resolutions
+ int strobe; // strobe to reduce motion blur
// ddraw options
int hwstretch; // stretch using the hardware
diff -rupN ./src/osd/windows/window.c ./src/osd/windows/window.c
--- ./src/osd/windows/window.c 2013-01-11 08:32:46.000000000 +0100
+++ ./src/osd/windows/window.c 2013-03-01 22:57:29.000000000 +0100
@@ -817,7 +817,11 @@ void winwindow_video_window_update(win_w
if (multithreading_enabled)
PostMessage(window->hwnd, WM_USER_REDRAW, 0, (LPARAM)primlist);
else
+ {
SendMessage(window->hwnd, WM_USER_REDRAW, 0, (LPARAM)primlist);
+ if (video_config.strobe)
+ SendMessage(window->hwnd, WM_USER_REDRAW, 0, (LPARAM)primlist);
+ }
mtlog_add("winwindow_video_window_update: PostMessage end");
}
}
diff -rupN ./src/osd/windows/winmain.c ./src/osd/windows/winmain.c
--- ./src/osd/windows/winmain.c 2013-01-11 08:32:46.000000000 +0100
+++ ./src/osd/windows/winmain.c 2013-03-01 21:53:05.000000000 +0100
@@ -422,6 +422,7 @@ const options_entry windows_options::s_o
{ WINOPTION_FULLSCREENBRIGHTNESS ";fsb(0.1-2.0)", "1.0", OPTION_FLOAT, "brightness value in full screen mode" },
{ WINOPTION_FULLSCREENCONTRAST ";fsc(0.1-2.0)", "1.0", OPTION_FLOAT, "contrast value in full screen mode" },
{ WINOPTION_FULLSCREENGAMMA ";fsg(0.1-3.0)", "1.0", OPTION_FLOAT, "gamma value in full screen mode" },
+ { WINOPTION_STROBE ";st", "0", OPTION_BOOLEAN, "alternate a normal and a blank frame, intended to remove motion blur on 120
Hz monitors" },
// sound options
{ NULL, NULL, OPTION_HEADER, "WINDOWS SOUND OPTIONS" },
diff -rupN ./src/osd/windows/winmain.h ./src/osd/windows/winmain.h
--- ./src/osd/windows/winmain.h 2013-01-11 08:32:46.000000000 +0100
+++ ./src/osd/windows/winmain.h 2013-03-01 21:29:57.000000000 +0100
@@ -143,6 +143,7 @@
#define WINOPTION_FULLSCREENBRIGHTNESS "full_screen_brightness"
#define WINOPTION_FULLSCREENCONTRAST "full_screen_contrast"
#define WINOPTION_FULLSCREENGAMMA "full_screen_gamma"
+#define WINOPTION_STROBE "strobe"
// sound options
#define WINOPTION_AUDIO_LATENCY "audio_latency"
@@ -262,6 +263,7 @@ public:
float full_screen_brightness() const { return float_value(WINOPTION_FULLSCREENBRIGHTNESS); }
float full_screen_contrast() const { return float_value(WINOPTION_FULLSCREENCONTRAST); }
float full_screen_gamma() const { return float_value(WINOPTION_FULLSCREENGAMMA); }
+ bool strobe() const { return bool_value(WINOPTION_STROBE); }
// sound options
int audio_latency() const { return int_value(WINOPTION_AUDIO_LATENCY); }