Hi Jason,
I agree Cools, using hardware scanlines on a 22" svga monitor won't look very good, because of the fine dot-pitch. I've always used it with "small" monitors, 15" and such. They are also good for 31 kHz arcade monitors, in case they can support 120 Hz.
Anyway. Let's say you start with a preset that creates resolutions for the 31 kHz range:
crt_range0 31400-31500, 49.50-65.00, 0.940, 3.770, 1.890, 0.349, 0.064, 1.017, 0, 0, 384, 480, 0, 0
This sample is the default arcade_31 preset. Your particular monitor frequency range is muuuuch wider, but let's use this one for illustration. Now, if you use this preset, you'll notice that GM line-doubles low resolutions... why? This how GM validates modes:
1.- GM first tries to fit the vertical resolution into the ranges we define. In this case, the progressive minimum and maximum lines allowed are: 384-480. So, for a typical 224p@60Hz game, GM will notice it's out of range, and will scale the height until it gets into the range. In this case: 224 x 2 = 448 (line-doubling); 448 turns out to be between 384 and 480.
2.- GM then checks that 60Hz is within the vertical range: 49.50-65.00 -> It is.
3.- Finally, GM checks that 448@60Hz is within the horizontal range: 31.4-31.5 KHz -> It is.
So it validates the mode.
Now, what do we need to force GM to use double refresh rates, and still use 31 kHz? Easy: we halve the number of lines, and we double the vertical refresh range. We know this modification preserves the horizontal frequency:
crt_range0 31400-31500, 99.00-130.00, 0.940, 3.770, 1.890, 0.349, 0.064, 1.017, 0, 0, 192, 240, 0, 0
1.- 224p is within [192, 240]? -> Yes
2.- 60 Hz is within [99, 130]? -> No. Here is where frequency scaling happens. GM will try integer scaling of vfreq. It turns out that 60 x 2 = 120 Hz is within the range.
3.- 224p@120Hz is within [31.4-31-5]-> Yes
However, you probably want to keep the possibility to use higher resolutions for some games when required. So what we do is to create two ranges, one for low resolutions and another one for high resolutions:
crt_range0 31400-31500, 99.00-130.00, 0.940, 3.770, 1.890, 0.349, 0.064, 1.017, 0, 0, 192, 240, 0, 0
crt_range1 31400-31500, 49.50-65.00, 0.940, 3.770, 1.890, 0.349, 0.064, 1.017, 0, 0, 384, 480, 0, 0
That's all you need for mame.ini side (also, remind to set 'monitor custom' for these ranges to work)
Defining the ranges in GroovyMAME is easy, but notice that if you do so, GroovyMAME expects 192p - 240p resolutions to actually exist in your system, otherwise the range defined for those heights will be ignored. So you need to create the required modes first with VMMaker. The problem is, VMMaker is not updated yet to use the new crt_range format, so we need to define the ranges in a slightly different way:
monitor_specs0 15600-15800, 49.50-65.00, 0.940, 3.770, 1.890, 0.349, 0.064, 1.017, 0, 0, 240, 384
monitor_specs1 31400-31500, 49.50-65.00, 0.940, 3.770, 1.890, 0.349, 0.064, 1.017, 0, 0, 480, 768
Notice this will actually create 15 kHz resolutions for the low-res modes. Don't panic. GM will transform those into 31 kHz on the fly, when you use the crt_ranges above. It's just that we need to specify the range like this to persuade VMMaker to generate these low resolutions. I'm sorry it's a somewhat cumbersome process, hopefully I'll update VMMaker soon to use the same convention as GM and it will be much easier.