Main > Software Forum
[Discontinued][17-09-22] RatRefresh - refresh rate switcher, stops LCD tearing
pulp25:
Fantastic Software.
I use it with a Nvidia 1030 and a Viewsonic 2365wp (Fv : 50 – 75 Hz) IPS 1080P
I configure .bat for emuloader frontend to test it with mame and all is ok with all filter on (GLSL).
R-Type 55khz -> smooth
Mortal Kombat 55khz -> smooth
Neo-Geo KOF 2000 59.x khz -> wall scrooling smooth
Negative point : The EDID process (windows sound for new device manager [can't cut sample], restarting driver) but it work
The Response Time of the LCD Viewsonic 2365wp
Thanks
Rataplan626:
Hi, we are currently about to move back in our completely rebuilt house. Which means I am about to unpack my cab again, and my actual PC, and be able to work on this tool again. Although I've had only 46 downloads (count 'em!) I have some idea's to improve usability. Having said that, for me it works fine with the quircks it has. Are people actually using it?
Metalhammer:
--- Quote from: Rataplan626 on June 18, 2018, 05:30:38 am ---Hi, we are currently about to move back in our completely rebuilt house. Which means I am about to unpack my cab again, and my actual PC, and be able to work on this tool again. Although I've had only 46 downloads (count 'em!) I have some idea's to improve usability. Having said that, for me it works fine with the quircks it has. Are people actually using it?
--- End quote ---
Hi Rataplan, nice to hear from you again ;)
Just letting you know every time I power on my cab I cannot help but thank you once more for your tool :notworthy:
... showing it with pride to everyone who comes around and who grew up playing arcades ;)
Obviously let me know if there will be further developements: improvements are always welcome ;D
Take care ;)
Cheers :cheers:
ramos8414:
Can you please reupload the example pictures.
ramos8414:
--- Quote from: Rataplan626 on January 10, 2017, 09:32:51 am ---Hi. I've been looking for a tool to automatically change refreshrates on my LCD corresponding the game I start. More like CRU does, but then automated for use with MAME. I was unable to find something like that. So I wrote it myself.
I short: you can run 'RatRefresh.exe -edidfile edid.txt -file refreshrates.txt -get bublbobl;mame' to switch to the exact refresh rate for that game.
A little backstory
Last year I've build me an arcade-cabinet with a LCD screen. We all know that gives issues with refreshrates and tearing. (And I don't want to debate that - I know CRT is 'better' for arcade gaming). We also know we can use CRU or actually EDID overrides to setup custom refreshrates to solve that. But that's quite cumbersome if you need to switch refreshrates between games. Also until a short while ago you would need specific hardware for that, as only ATI and NVidia seem to support EDID override. As my cab uses its Intel Core i3 6300 build in GPU I was out of luck anyway. Until a short while ago when Intel finally released a testdriver with EDID override support. Check https://communities.intel.com/thread/25904?start=150&tstart=0 for more info, and https://downloadcenter.intel.com/download/26504/Intel-Graphics-Test-Driver for that actual driver download. It will relatively soon come out of test and from then on the official Intel driver will probably support EDID override as well. This testdriver was only supposed to support 4th and 5th gen iGPU's with internal panels only. Still I took the plunge and what do you know? It worked! Using CRU I was now able to do custom resolutions and refreshrates on my Intel GPU! If you use that with MAME's -syncrefresh option, it will give you a completely tearing-free experience at the correct game-speed.
The next step was to automate this, so when I select a game, the resolution automatically switches. No tool as such found, so I wrote:
RatRefresh
RatRefresh is a simple tool that updates the EDID information of the first custom resolution to match a given refreshrate. It's mainly intended to switch your display refreshrate to exactly match the MAME game you will play. I've given it some thoughts but for now I've made it quite universal, with both manual command line and input from a file with games/refreshrates in it. You could put anything you want in the inputfile with a specific refreshrate, and it can be picked up. So if you want to automate this to run your mediaplayer at 59.94Hz, you can.
Note that this is currently more or less a testbuild.
Requirements
* .NET Framework 4.5.1 or higher
* Hardware that supports EDID override
* Windows Vista or higher (XP does not support EDID override)
* Admin permissions (more on that below)
* One (and only one) custom resolution set for your display
* For now: CRU package, get it at https://www.monitortests.com/forum/Thread-Custom-Resolution-Utility-CRU
I use .NET Studio to program. For now though this means .NET 4.5.1 is required. Most of you will already have that on your systems anyway. However this whole tool could have been created in a rather simple VBScript as well, but for now this tool will be written and updated in .NET only.
Reason for only one custom resolution: Windows will automatically switch to the first custom resolution if only one is there, which means no manual resolution-switching is needed after that.
Usage
There are a few initial manual steps involved. As I want to keep it versatile I will keep it that way for now.
* Unzip the RatRefresh zipfile to a folder on your system
* Start CRU and create ONE custom resolution for your display. Use whatever resolution you want to play your games in, I use the native resolution of my screen which is 1920x1200@60Hz. If a custom resolution is already there, delete it and recreate to make sure the registry keys are setup correctly. If multiple custom resolutions are there delete all but one. Example:
* Now start regedit.exe and find the the path to the EDID_OVERRIDE key + value. It is located in "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY" and then some subkey for your GPU / display. You could search for 'EDID_OVERRIDE' or look for the value 'CRU_Name'. In that key you will probably two REG_BINARY values, 0 and 1. These correspond to the monitor number (I think) and on all my systems this is 0.
Now right-click the EDID_OVERRIDE key in the left-pane and click 'Copy Key Name'. Then open notepad and paste that key. Now add \ and the monitor number behind that, for example \0.
It should look like this, but probably with differend ID's in:
save that file to the RatRefresh folder as edid.txt, or another name if you want, like monitor_1.txt
Basic setup is done now. You can now run RatRefresh as follows (I use edid.txt here):
RatRefresh -edidfile edid.txt -refresh 59.150
This will set the refresh rate of the display setup in edid.txt to 59.150. After it does that it will run devcon64.exe to restart the displaydriver, more on that below.
Automate for MAME
As for now I merely run MAME on my cab, I wanted to automate that. MAME's XML file contains the refreshrates for all machines it supports. However parsing the almost 200MB and growing XML file takes quite a while, even on beefy PC's (using .NET libraries that is). When using the regular XML tooling available in .NET memory usage grows beyond 2GB when processing mame.xml. My cab has 8GB of RAM, but I know there are a lot of machines with maybe only 1GB. So I wrote a little, not so smart mame.xml parser of my own, which is way faster and uses a fraction of the memory. But it might be buggy. Still this would take way too long to do with each game you select, so I went another route.
MameXMLParser.exe
MameXMLParser.exe takes a MAME xml file as input and outputs a plain textfile with the following structure:
<rom name>;mame;<refreshrate>
one rom per line. So you'll end up with a file with as many lines as MAME supports individual machines. To fetch a game out of that file takes a fraction of a second even on the slowest and worst piece of cr@p pc I have still lying around, which is a Intel Atom N330 based netbook.
Usage:
* First create a MAME xml file by running 'MAME.exe -listxml > mame.xml'. If you run 64bit MAME it will be 'MAME64.exe -listxml > mame.xml'. If you use any other MAME distribution use it's executable name, I think all support the -listXML option.
* Find out your displays native default refreshrate. Not all MAME machines have a refreshrate set in MAME.XML, for example mechanicals. When no match is found your screen will still need a certain refreshrate :) Usually this is 60.000 or 75.000 but you can use whatever you want if your monitor supports it.
* Then run 'MameXMLParser.exe -input mame.xml -output refreshrates.txt -default 60.000'
This will generate rereshratex.txt with all needed info for MAME.
* Now you can use RatRefresh with this generated refreshrates.txt file:
RatRefresh.exe -edidfile edid.txt -file refreshrates.txt -get bublbobl;mame
This will search for the string 'bublbobl;mame' in 'refreshrates.txt' and set the corresponding refreshrate.
You could easily add roms for another emulator to this file with whatever name you want to call it, like
nes;nes;60.000
palgenesis;palgenesis;50.000
When used together with a frontend (more on that below) it can usually supply you the emulator / system name you are starting a game for to use in a commandline.
Issues
* I have put some error-checking in, but certainly not excessive. Using wrong combinations of commandlines or inputfiles will probably result in a nice errormessage. Read the help again and try again.
* Frontends: huge issue for me personally: When an EDID resolution is added, it's only picked up when the displaybus is reset. This means restarting the displaydriver works, physically switching the display off and on works, and removing the (DVI at least) cable and reconnecting it works. For now I can only do the first one, restarting the videodriver.
The issue with this is though that the frontend I use on my cab, AttractMode, crashes. This makes sense as it looses its screen completely when running. However when switching the monitor off and on again or pluging the cable, the new refreshrate is picked up too. So I am still looking for a way to simulate that instead of restarting the whole videodriver.
For now that means I am personally only using it from commandline. I haven't tested other frontends though.
Any suggestions to solving this are welcome!
* Admin permissions required. As the EDID value is stored in HKLM registry, you will need admin rights to modify them. This could be prevented by granting users write permissions to the EDID_OVERRIDE key. However, after that restarting the display driver requires admin permissions as well. Those permissions can also be granted to users, but as I am still looking for a better way to have the EDID values reloaded. For now I use devcon to restart the display driver.
* I haven't done any testing at all on x86 machines, as I simply don't have x86 running anymore. Feel free to report!
Version history
v0.1 download
initial release
v0.11 download
fixed: bug in calculating horizonatal blanking pixels - thanks to xxDaViDxx for reporting!
Also switched back from using CRU's Restart64.exe to devcon64.exe, to be less dependant of CRU.
I this tool is useful for you, or you have questions or bugreports, feel free to respond. If you test it, please respond if it works for you. If something like this already exists and I am making a fuss out of nothing feel free to respond as well :) Happy gaming! :cheers:
--- End quote ---
Fixed the image url's.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version