Zero pixel clock rate in MAME using CRT Switchres de

Hiya,

I’ve recently been testing some Sega arcade games, like Daytona USA. The resolution for these games is 496x384.

I’ve noticed that CRT Switchres doesn’t give me the right resolution when I start them. I’ve added in some debug printf statements, and xrandr does receive a modeline but it uses a zero pixel clock, resulting in a zero refresh rate and subsequent failure to switch to the resolution.

This is what xrandr --verbose gives me when I run Daytona USA:

CRT43-496x384-115.05 (0x1c3)  0.000MHz -HSync -VSync Interlace
    h: width   496 start  512 end  554 total  607 skew    0 clock   0.00KHz
    v: height  384 start  176 end  182 total    0           clock   0.00Hz

Most other consoles and arcade games seem to switch okay (though Game Boy crashes the LXQT desktop). It will switch correctly if I remove the modeline created by RetroArch from xrandr, regenerate it with cvt, and add it back manually with the same name.

Other games exhibiting this behavior are APB, Narc (I think), Emergency Call Ambulance (also Sega), and Donpachi. They all report Configure crt 0 failed.

@Alphanu Any ideas why this is happening? No hurry. :slight_smile:

I’ve posted two issues on GitHub (because I don’t know if it’s MAME or RA in general causing it), but I thought here too might be a gathering place for ideas.

Hi @tym,

Can you compile and test my latest source? https://github.com/alphanu1/MME4CRT

It should be fixed.

Sure thing! I’ll check it out ASAP. Thank you so much. You do great work :slight_smile:.

Thank you for working on this. Here are the results of my testing:

  • APB and Donpachi make the monitor sleep. They’re both vertically scrolling games, so maybe that has something to do with it. I noticed I get the negative back porch issue we’ve talked about before.

  • I can’t enable true native resolutions because the monitor just sleeps. I have to use a super res.

  • The Sega games (and some others, like Narc and NFL Blitz) switch, and are wide enough but look letterboxed. The sizes are reported correctly by the debug info, though. Interestingly, even if I try to set a custom aspect ratio, I still will get the same-sized letterboxing. Trying to go past the bounds of the letterbox doesn’t work. I just stretch the image into black.

  • If I exit with the Escape key the monitor goes to sleep and the desktop doesn’t come back until I run xrandr again.

  • The stuff that was working before still does.

This is an example of what I mean by letterboxing. The first picture is without SwitchRes, and the second is with it. Notice in the second image (I’m sorry it’s dark) the gap between the game and the top of the screen.

I suppose the question has become, “why do interlaced MAME games not fill the screen?” Anything around 240p works. The PSX BIOS works. But any arcade game that uses interlacing is letterboxed. It’s not cut off; the whole image is there but I’m left with ~10% black borders on the top and bottom. If I try to resize into those areas they just stay black and crop the image.