|
| 1 | +This article originally appeared in a slightly different form at |
| 2 | +http://aarongiles.com. You should read this if you are used to how |
| 3 | +MAME's video system worked prior to 0.107 and you want to understand |
| 4 | +how you should configure MAME with the new rendering system in place. |
| 5 | + |
| 6 | + |
| 7 | +The New Video Landscape |
| 8 | + |
| 9 | +Since its inception 9 years ago, MAME's video system has defaulted to |
| 10 | +a mode where it tries to change resolutions on you. And since the |
| 11 | +first port of the core to Windows 5 years ago, it has defaulted to |
| 12 | +using your graphics card to stretch the video to that resolution. |
| 13 | + |
| 14 | +I'm sure a lot of you out there have taken a lot of time to tweak the |
| 15 | +current set of video options to make them work the way you like. But |
| 16 | +every once in a while, you need to take a step back and re-evaluate |
| 17 | +the situation. The current video system has been in place for 5 years |
| 18 | +now without much substantial change. And with the recent rewrite, |
| 19 | +you're almost certainly going to want to rethink the way you have |
| 20 | +things configured. |
| 21 | + |
| 22 | +At the highest level, there are really three different ways you can |
| 23 | +configure the new system. Placing yourself into one of these three |
| 24 | +categories will help you get the initial settings right. From there, |
| 25 | +you can tweak with the settings to figure out what works best. |
| 26 | + |
| 27 | + |
| 28 | +Category 1: Bells and whistles. People who fall into this category |
| 29 | +would include anyone with a modern system and a decent video card |
| 30 | +(decent in this context means at least 16MB of VRAM and built in the |
| 31 | +last 5 years or so -- we're not talking cutting edge here). Any decent |
| 32 | +video card will be able to render the simple MAME graphics at pretty |
| 33 | +much any resolution without breaking a sweat. Configure your desktop |
| 34 | +to the video mode you want (preferably something high like 1024x768 |
| 35 | +or greater with a high refresh rate, unless you are running on a |
| 36 | +fixed-mode LCD, in which case just match what your LCD panel is), |
| 37 | +and tell MAME to leave the resolution alone. In this day and age, |
| 38 | +there is little reason to switch resolutions at all, unless you |
| 39 | +fall into Category 3, below. In this mode, you will have full access |
| 40 | +to artwork options, and you'll get your artwork scaled to full |
| 41 | +resolution and with full alpha blending effects. Vector games will |
| 42 | +look crisp, you can use decent fonts, and you can see a whole lot |
| 43 | +more of the world when using the graphics/tilemap viewer. This mode |
| 44 | +uses Direct3D, so you should configure yourself like this: |
| 45 | + |
| 46 | + -video d3d -noswitchres [-triplebuffer] [-nofilter] |
| 47 | + |
| 48 | +The -noswitchres option tells MAME to just run at the current |
| 49 | +resolution. Although you can let MAME pick a resolution for you, it |
| 50 | +doesn't really make much sense in D3D mode, and in fact I may even |
| 51 | +remove that feature altogether. To avoid tearing artifacts, I |
| 52 | +recommend using the -triplebuffer option as well. Just make sure your |
| 53 | +monitor's refresh rate is higher than the game you are running. If |
| 54 | +you dislike the blurry look of the graphics, you can specify the |
| 55 | +-nofilter option to disable bilinear filtering, though that will |
| 56 | +produce blocky artifacts. Alternatively, you can use the -prescale |
| 57 | +option which is described at the end of this article. |
| 58 | + |
| 59 | + |
| 60 | +Category 2: Like the old days. I really didn't even want to support |
| 61 | +this mode at all, but certain vocal MAMEdevs would have skinned me |
| 62 | +alive otherwise. People who fall into this category include those who |
| 63 | +have weak systems that worked fine with previous versions of MAME, |
| 64 | +but who don't run well with Direct3D rendering. (Note that just |
| 65 | +because Space Invaders runs unthrottled at 2000fps with DirectDraw |
| 66 | +and 1000fps with Direct3D doesn't mean that Direct3D is going to be |
| 67 | +a serious issue when playing at a regular 60fps, so if you're unsure, |
| 68 | +give the Direct3D route a try for a while.) In this mode, MAME will |
| 69 | +draw the game screen and artwork at the game's resolution, just like |
| 70 | +it did in MAME 0.106 and earlier; however, some artwork options, |
| 71 | +such as -artcrop, won't work as you might expect, and some alpha |
| 72 | +blending artwork modes (specifically overlays) will operate with a |
| 73 | +performance penality. MAME will then use your video card to stretch |
| 74 | +the video to the proper aspect ratio. |
| 75 | + |
| 76 | + -video ddraw -hwstretch [-switchres] [-triplebuffer] |
| 77 | + |
| 78 | +The -switchres is optional here. If your video card is really ancient |
| 79 | +and struggles expanding the screen to fit your desktop resolution, |
| 80 | +you might want to turn it on. Again, to avoid tearing artifacts, I |
| 81 | +recommend using the -triplebuffer option as well, but make sure your |
| 82 | +monitor's refresh rate is higher than the game you are running |
| 83 | +(-switchres will do that for you if you use it). If your video card |
| 84 | +produces blurry pixels which you don't like, try the -prescale option |
| 85 | +described at the end of this article. |
| 86 | + |
| 87 | + |
| 88 | +Category 3: Anal video mode types. These are the guys who have |
| 89 | +generally built their own cabinets and set them up with a CRT display |
| 90 | +where they have several dozen carefully hand-tweaked video modes that |
| 91 | +approximate the original video modes the games ran at. They want MAME |
| 92 | +to pick that hand-tweaked mode and use it, drawing one pixel on the |
| 93 | +screen for each pixel in the original game. They don't give a whit |
| 94 | +about artwork or anything other than the raw pixels going to the |
| 95 | +right place. Fortunately, you can still configure MAME for this case |
| 96 | +as well: |
| 97 | + |
| 98 | + -video ddraw -nohwstretch -switchres [-triplebuffer] |
| 99 | + |
| 100 | +Obviously in this case, the -switchres is required. You also want to |
| 101 | +disable hardware stretching, otherwise you won't get that "perfect" |
| 102 | +1:1 pixel mapping. Triple buffering may or may not help. |
| 103 | + |
| 104 | + |
| 105 | +So, I recommend starting with these initial options and then tweaking |
| 106 | +from there. One additional option you might want to try in |
| 107 | +combination with the above is the -prescale option. -prescale takes |
| 108 | +an integer parameter from 1 to 8, and specifies a magnification |
| 109 | +amount by which the screen pixels are expanded before they are drawn |
| 110 | +to the screen. Why is this useful? And how much of a performance |
| 111 | +impact does it have? Well, that depends on the mode you are running |
| 112 | +in. |
| 113 | + |
| 114 | +If you are running in Category 1 (-video d3d), then -prescale will |
| 115 | +use your video card to scale the game graphics up before rendering |
| 116 | +them to the screen. Depending on the video card, this is usually a |
| 117 | +small performance hit, but not too significant. The benefit is that |
| 118 | +each prescale factor reduces the blurriness of the pixels. |
| 119 | +-prescale 1 is the default, which does no scaling. -prescale 2 will |
| 120 | +double each pixel, -prescale 3 will triple each pixel, etc. For my |
| 121 | +money, -prescale 2 is sufficient, but people with super high |
| 122 | +resolution displays claim that larger -prescale factors work even |
| 123 | +better. |
| 124 | + |
| 125 | +If you are running in Category 2 (-video ddraw -hwstretch), then |
| 126 | +-prescale will cause MAME to compose the screen graphics at the |
| 127 | +specified scale factor. This is unfortunately done in software, but |
| 128 | +carries the benefit that artwork, fonts, and the graphics viewer can |
| 129 | +take advantage of the additional resolution to produce nicer results. |
| 130 | +The end effect is that you will get less blurry pixels, just like the |
| 131 | +Category 1 case, plus higher quality artwork, fonts, and more visible |
| 132 | +area in the graphics viewer. |
| 133 | + |
| 134 | +If you are running in Category 3 (-video ddraw -nohwstretch), then |
| 135 | +-prescale will cause MAME to pick a video mode that is the prescale |
| 136 | +factor times the raw screen resolution, and then MAME will, in |
| 137 | +software, compose the screen graphics at the specified scale factor. |
| 138 | +This has all the advantages of the Category 2 case, except that since |
| 139 | +there wasn't any pixel blurring to begin with, there is no additional |
| 140 | +crispness that comes about as a result. |
| 141 | + |
| 142 | +Finally, you may be wondering about effects (and yes, scanlines are |
| 143 | +an "effect"). Effects are no longer hard-coded into the system. |
| 144 | +Rather, you can provide a PNG file in the artwork directory that will |
| 145 | +be loaded and overlaid on top of screen bitmaps. See the description |
| 146 | +of -effect in windows.txt for more details. |
0 commit comments