MAME CRT Simulation

From Arcade Otaku Wiki
Jump to: navigation, search

When using MAME on an LCD the video is non-optimal at best. Games designed for low resolution CRTs are missing their scanlines, and aren't nice to look at. Thankfully, since modern LCDs have far higher resolution we can simulate the shadowmask and scanlines of a CRT to give an authentic appearance.

Settings are detailed below. A few changes from the default MAME settings need to be made in mame.ini, and then the rest utilises the MAME artwork system. Each game needs to be done individually.

Note that this method only works nicely for certain game resolutions. One dimensions (width/height) must be an exact factor of the monitor resolution, with the other dimension fitting within the monitor resolution using the same factor. 320x240 works well on a 1280x1024 screen, but 256x224 does not.

  1. 320 x 4 = 1280, 240 x 4 = 960. The horizontal dimension is an exact factor of our example monitors horizontal resolution, and the vertical dimension scaled up by the same factor fits into our monitors vertical resolution.
  2. 256 x 5 = 1280, but 224 x 5 = 1120. The horizontal dimension is an exact factor of our example monitors horizontal resolution, but the vertical dimension scaled up by the same factor does not fit into our monitors vertical resolution.
  3. 256 x 4 = 1024, 224 x 4 = 896. Neither dimension is an exact factor of our example monitors matching dimensions.

In the first case, no scaling is done after the artwork has been dropped on. MAME won't attempt to use the second option, instead preferring the third - and leaves the graphics card to scale up the final image by a fractional factor.

mame/mame.ini

rotate                    0
brightness                1.05
contrast                  1.2
gamma                     0.95
waitvsync                 1

Example: Armed Police Batrider (batrid.zip)

Armed Police Batrider example screenshot

Raizing's Armed Police Batrider is an excellent example. Because our example monitor has a resolution width that is an exact multiple of the game resolution, when we scale up the game image it retains exact pixel placement - 1 pixel of the game takes up 4 pixels of the screen. The graphics card filtering blurs this slightly because we're not using any prescaling within MAME, and we get a beautiful output.

  • Our monitor native resolution - 1280x1024 (5:4)
  • Game resolution - 320x240 (4:3)
  • Scaled maximum resolution - 1280x960 (4:3) (320x240 x 4)

mame/artwork/batrid/batrid.lay

<?xml version="1.0"?>
<mamelayout version="2">
	<element name="overlay">
		<image file="320x240x4.png" />
	</element>
	<view name="Scanlines">
		<screen index="0">
			<bounds left="0" top="0" right="3" bottom="4" />
		</screen>
		<overlay element="overlay">
			<bounds left="0" top="0" right="3" bottom="4" />
			<orientation rotate="90" />
		</overlay>
	</view>
</mamelayout>

mame/artwork/batrid/320x240x4.png

Use this tile to create a 1280x960px PNG.

x4 scaling scanline tile, magnified x 3000%