Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: SwitchRes generates interlaced resolutions that flicker.  (Read 5840 times)

0 Members and 1 Guest are viewing this topic.

andreino11

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:September 18, 2015, 04:02:27 am
  • I want to build my own arcade controls!
SwitchRes generates interlaced resolutions that flicker.
« on: July 15, 2013, 01:58:49 pm »
Hi everybody.

I'm running the latest GroovyMAME version (149) and I just adjusted my arcade cabinet modelines via VMMaker successfully. I had to force the generation of double-width modelines or the lowest resolution wouldn't have displayed correctly.

The problem I have now is with vertical games, or more precisely 19XX which I just tried. Its vertical 384x224 adjusts to an interlaced 704x480 on my machine, and that should be fine since I tweaked that modeline via ArcadeOSD so that it doesn't flicker too much on my monitor (either by adding or removing a single line from the front or back porch setting). The problem is that when the game is run, the modeline I configured in ArcadeOSD doesn't get selected because the refresh rates are different. And since the modeline which is used by GroovyMAME is not one of the ones I can tweak via ArcadeOSD, there's no way I can get rid of that flicker effect.

The 704x480 modeline I have configured via ArcadeOS is: 59.948 Hz / 15.647 KHz
The one which is used by mame when playing 19XX is: 59.629 Hz / 15.712 KHz

Please see attached screenshots.

Furthermore, is there any common reason why I had to adjust +-1 lines on the front/back porch/sync pulse of every interlaced resolution in order to eliminate the flicker? Is there anything I should have done in VMMaker to automatically have all the modelines adjusted to my monitor?

Thanks!
« Last Edit: September 12, 2015, 01:34:34 pm by andreino11 »

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7463
  • Last login:July 01, 2025, 01:29:14 pm
  • Quote me with care
Hi andreino11,

This is interesting, because GroovyMAME/VMMaker are coded to create interlaced modes with an uneven number of lines, which is required to minimize flickering. This suggests that for the HD 3xxx cards it could be the opposite, and if this is the case it would be a driver's bug indeed. Please notice if the key change in ArcadeOSD that produces non-flickering modes is getting an even "V total" figure, by modifying either of the three V values.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

andreino11

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:September 18, 2015, 04:02:27 am
  • I want to build my own arcade controls!
Hi Calamity.

Thanks again for your help. I confirm that all of my interlaced resolutions have an even number of lines, otherwise they look so unstable that it's impossible to play with them.

In the meanwhile I also tried pac-man, and while not being translated to an interlaced resolutions, the refresh ate which is being used by switchres is around 51Hz against the 59 of the original game. As a result, the game runs slower and the sound is gibberish. In your opinion, is this problem related to the one I opened this thread with?

As a solution, is it possible (using inis, for example) to force specific modelines for specific games for which the automatic modeline change is not optimal? Thaks again.

andreino11

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:September 18, 2015, 04:02:27 am
  • I want to build my own arcade controls!
I don't know if this can help, but I also determined that by forcing a resolution to be used by groovymame (via the -resolution param), it doesn't pick up the modeline I tweaked via ArcadeOSD, but (somehow) the one that has originally been generated, which doesn't include the even V-lines tweak. I'll keep researching and post anything new I find out.

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7463
  • Last login:July 01, 2025, 01:29:14 pm
  • Quote me with care
Hi andreino11,

Sorry for not answering before. You're missing the whole point of GroovyMAME. It does not pick the modelines stored in the registry. Those are just dummy modelines that VMMaker creates so GroovyMAME has them available in the system in order to modify them on the fly (if they aren't there at boot time they can't be created afterwards).

You can modify those dummy modelines but the changes won't apply to GroovyMAME because it generates its own modelines that override those. If you force GroovyMAME into picking a certain resolution, it will pick it indeed, but it will recalculate its associated modeline.

You may be shocked by this design but believe when I say that's where its real power resides, otherwise you'll have to create individual modelines for each refresh and resolution and very few users are actually capable of doing this.

As for the need for even number of lines on interlaced modes, well this is quite a discovery. It's normally exactly the opposite. I'd really prefer this wasn't true! GroovyMAME and VMMaker are coded to produce interlaced modes with an uneven number lines, which is how things are supposed to work from the theory point of view. Now some sort of flag or option will need to be added to force interlaced modes with an even number of lines. I'm sorry but atm there's no manual workaround for this.

Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7463
  • Last login:July 01, 2025, 01:29:14 pm
  • Quote me with care
In the meanwhile I also tried pac-man, and while not being translated to an interlaced resolutions, the refresh ate which is being used by switchres is around 51Hz against the 59 of the original game. As a result, the game runs slower and the sound is gibberish. In your opinion, is this problem related to the one I opened this thread with?

As a solution, is it possible (using inis, for example) to force specific modelines for specific games for which the automatic modeline change is not optimal? Thaks again.

The automatic mode change should be optimal, according to your specs.

You probably have enabled -syncrefresh in mame.ini. Don't do it. Leave both -syncrefresh and -triplebuffer disabled. If you do this, GroovyMAME will enable either of those when required, depending of the -syncrefresh_tolerance value.

So for the pacman case, keep in mind that 288p@60.60606 is impossible in a standard arcade monitor, so the refresh must be lowered in order to keep inside your monitor working ranges. The best you can get is 288p@51Hz for a the "arcade_15" preset. Choose "arcade_15ex" and it will achieve a higher vertical refresh, but nowhere close to the original.

In this situation, GroovyMAME will pick -triplebuffer instead of -syncrefresh, so the action keeps at 100% speed and the sound pitch is not lowered.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

andreino11

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:September 18, 2015, 04:02:27 am
  • I want to build my own arcade controls!
Re: GroovyMAME doesn't match the refresh rates of the modelines in the registry
« Reply #6 on: September 12, 2015, 01:33:58 pm »
I'm reviving this old post because I've got some news.

I tried to change my previous video card (Radeon HD3xxx) with an ATI Radeon HD4550, to get rid of the "low pixel clock" limitation, and to see if that new video card could help with my flickering issue.
After running VMMaker, it generated 119 modelines and each and every interlaced modeline still flickers, as it did before. When it flickers it has an odd number of total vertical lines (e.g. 521 for 480x464i), if I increase that to 522 (via ArcadeOSD) it looks great (almost no flicker at all).

Of course, as explained above, SwitchRes recalculates the modeline on the fly so every game which triggers an interlaced resolution is still unplayable on my machine.

For now, I'm just preventing the resolution switch for vertical games (via vertical.ini) and playing them at 640x480i (which is my desktop resolution that I tweaked via arcade osd) but they look terrible - the stretch algorithm produces artifacts that make, for example, the text barely readable. Is there maybe some mame.ini configuration needed to improve the stretched image?

At this point, I'm suspecting it's my arcade monitor the main reason of this flickering issue so I'm here to ask: is it still true that there's no SwitchRes/Mame setting that I can use to work around this? I'm also starting to consider a recompilation of the GroovyMAME source after hacking the modeline generation algorithm, in order to generate an even total number of lines for interlaced resolutions.

PS: I'm using Windows XP. Would it make sense to try upgrading to Win7 to see if it solves the issue?
« Last Edit: September 12, 2015, 01:37:07 pm by andreino11 »

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7463
  • Last login:July 01, 2025, 01:29:14 pm
  • Quote me with care
Re: SwitchRes generates interlaced resolutions that flicker.
« Reply #7 on: September 12, 2015, 03:40:44 pm »
Hi andreino11,

Unfortunately I'm afraid this is an issue with your monitor. It is not uncommon to see arcade monitors that can't display interlaced modes properly, here in this forum there are a bunch of posts about this.

GM calculates its interlaced modes with an odd number of lines because this is the canonical way of doing it. There is no way force it to use an even number of lines, but modifying its source, which wouldn't be too hard anyway. Years ago I calculated interlaced modes with an arbitrary number of lines and found that the timings obtained weren't consistent when using even numbers.

Because you write like a competent GM user, I suggest you to upgrade to a modern GM version which can handle raw modelines, unlike the one you have now. Then, run:

groovymame game -v >game.txt

Now open notepad and press ctrl+v. You'll get the last modeline used by GM. Set the vertical total to an even number. Finally, create a game.ini file, type "modeline " in low case followed by the modeline text you just edited. GM will use this modified modeline instead of calculated its own.

Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

andreino11

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:September 18, 2015, 04:02:27 am
  • I want to build my own arcade controls!
Re: SwitchRes generates interlaced resolutions that flicker.
« Reply #8 on: September 13, 2015, 08:30:24 am »
Hi Calamity. Thanks for your suggestion. It's a bit repetitive to do for every game that has this issue, but once done it does the trick... After all, I don't have that many vertical games in my lists.

I have a problem with stretching, though: using the interlaced resolution that SwitchRes calculates (512x476i for all games with 288 vertical lines) games don't look good because they're being stretched without any filters.

Forgive me for the awful picture, but I think what I mean is evident from the "A" in the word Game: the two legs are uneven, as if they are, respectively, 2 and 1 pixels.

Is there anything I can do to overcome this? My cleanstretch option is set to 0, and I have hwstretch set to 1.
« Last Edit: September 13, 2015, 08:32:06 am by andreino11 »

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7463
  • Last login:July 01, 2025, 01:29:14 pm
  • Quote me with care
Re: SwitchRes generates interlaced resolutions that flicker.
« Reply #9 on: September 13, 2015, 02:11:26 pm »
Default stretching options applied by GM should be just as good as it can get. Make sure to leave the default options. If you create a specific ini file ONLY add the options you need to modify, not the whole contents of the mame.ini file. Anyway, post a log here so I can check it.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

andreino11

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:September 18, 2015, 04:02:27 am
  • I want to build my own arcade controls!
Re: SwitchRes generates interlaced resolutions that flicker.
« Reply #10 on: September 18, 2015, 04:02:27 am »
Just so you know: in the end I just had to apply option "filter 1" to every (vertical) mame game which goes interlaced and is thus stretched. This way is of course a little blurry, but at least the stretching is even.