So you're running MAME on an LCD, and it looks terrible. Sharp edged pixels, no scanlines, no wonky geometry or convergence issues, and you miss how the games look on a CRT. What can be done? Until we get high enough resolution LCDs to simulate a true CRT shadowmask, it'll never look the same - but we can get things looking a lot better than they do untweaked.
There are a few settings to do this effectively in mame.ini (or the individual game .ini file):
Code: Select all
multithreading 1
video ddraw
keepaspect 1
aspect 4:3
prescale 2
hwstretch 1
effect effect_cools
- If you've got a multiprocessor or multicore machine (or even plain old P4 hyperthreading) then it's well worth having multithreading turned on - MAME will use a seperate thread to do all the fancy video effects so the emulation performance won't suffer as badly as with it off.
- We have to use DirectDraw rather than Direct3D. MAME peforms the scaling and image effects differently with both. In ddraw mode, the image is scaled internally (prescaled), then the effect is applied, then it's fed out to the graphics card. In d3d the image is fed out to the graphics card which handles the scaling, and the card then applies the effect to the scaled image.
- We have to force the aspect ratio to 4:3 - this is the aspect ratio of the monitors we're trying to simulate. Allowing MAME to use arbitrary (or so it seems) aspect ratios makes a mess of things. I suspect in most cases MAME looks at the game resolution and works out the aspect ratio from there - wrongly.
- We double the image in width and height internally in MAME. This is needed for the effect we wish to apply. Prescaling by a higher amount uses more CPU power, and would need a different effect image suited to the extra scaling. I'd love to see a good "prescale 4" effect but the difference between 2 and 4 in performance on this machine is a 50% framerate drop, and we need the eventual graphics card blurring to complete the effect, which would be lost if we're prescaling up to the output resolution.
- We use the graphics card to scale the image up to the monitor resolution. Disabling this is fine if you're running custom resolutions, using a VGA CRT (like in a Naomi), but on a high resolution LCD - I've been testing with a 1280x1024 display - this causes MAME to behave in a similar fashion to using d3d. With it disabled MAME scales the image up to the screen resolution, then applies the effect.
- Lastly, the most important bit is a good overlay effect .png image (attached at the post bottom). This demo image is scaled up by 2000 percent so you can see what's going on. Normally it's a 2x4 image (which is attached). I've been through the ones available elsewhere and I'm not a fan of any (they either do the scanline or the shadowmask, not both), so I've spent a few hours playing about with this one till I'm happy with it. With the settings above, MAME takes this image, and tiles and applies it to the internally prescaled image before handing it over to the graphics card. Since we're prescaling by 2 times, we're doubling the the number of pixels in both directions. The dark lines in the effect dim every second line in our prescaled image so they appear as scanlines, and the alternating light grey/white squares apply a subtle change to the lines we want to see, simulating the ever so slightly speckled effect of a CRT shadowmask. By altering how light or dark the pixels in the effect image are we can control the strength of the scanlines and shadowmask simulation. Most important is to keep the levels far apart - by making the shadowmask effect stronger (darker pixels) or the scanline effect weaker (lighter lines) you end up with a display that simply looks speckled, losing the scanline effect that we're really after.
Hope this lot helps some of you - I've never been satisfied with the current video effects, and I've not seen a decent guide available to exactly what MAME does to the picture and what can be done with it.