Ok, added. -mt should be disabled. Run the game with -nosyncrefresh -nowaitvsync -nothrottle -seconds_to_run -notriplebuffer. Then simply do s('path to log', 60.0) for genesis for instance. It's saved in RAM now so the log can't be viewed until after emulator exit. I think I got the formula right, but double check it to be sure. You can also use -video none. Note that ASIO output is disabled with -nothrottle.
https://mega.nz/#!a0ZGVASI!AhPJugKmGkRqImH-chiynBGAHJGaQFyh585aPaSnXAs
Edit again:
Updated the script to output the occurrence of each fd value
Awesome, many thanks for creating this!
The addition to see the occurence of each fd value in a table is great.
With regards to the formula, I think it needs a small adjustment. Framedelay in gm is set in units of 1/10th of frametime, and is being "off" by 1 unit as Calamity noted. So although the current formula is a good approximation and works for the edge cases (such as frame emulation time getting very small), it will generally give a (too) positive skew to the maximum framedelay values.
I changed the following line is s.m:
fdvals = round((frame_time - (frame_time ./ data(:,1))) / (frame_time / 9) - 0.5);
to
fdvals = round((frame_time - (frame_time ./ data(:,1))) / (frame_time / 10) - 1 - 0.5);
The attached graphs shows how this affects the results for a run of deathsml.
I've created a simple script that asks for a driver name and time to benchmark (see attached mame64bench.bat). Just to save a bit of typing everytime. This made me think that it should be possible to extend the script with a call to Octave (CLI?) and have it all fully automated? But for that we would also need to have the driver refresh rate available to the script.
I did notice one particular thing when benching the genesis driver. There is a peculiar speeddrop to about 113% for two frames in the middle of the test when i run a bench for 240 seconds, see attached image. This occurs every time when I run the test, any idea what may be causing this?
I also wondered if there's a specific reason that the benchtest needs to be run with -mt disabled?
@Calamity
Rethinking your approach for automation of fd, that would probably nicely work for the (big) lot of drivers that are able to run at high speed, with the variations only occuring above a certain level. The problem as you noted will be with the deathsml like drivers. What would you think of an approach where if the automated fd value detects to many overruns or "resets", that it logs this with a message to the user to run a benchmark of the driver, possibly like the one that intealls created? It would need a little bit of polishing for end-user usage and robustness, but with this approach we would have the best of both worlds.
Over the years, when hardware get's more and more powerful, the need for applying the manual benchmark will ofcourse fade, and automated fd will gradually take over. I'm getting more enthusiastic about your automation idea