Arcade game resolutions

I did a bit of experimenting with setting different resolutions on the raspberry Pi for arcade emulation. This was in preparation for getting my standalone MAME image for the PJ adapter.

So the idea here is that the video output would be set to the exact resolution of the game, before emulation is started. Now, there are emulators that already do this, but I wanted to be able to possibly use emulators that don’t, and have full control of the process.

I started looking at the most commonly used resolution in arcade games. This came from MAME’s game info xml dump. Here’s the list:

Popular Horizontal Arcade Video Modes

Number of GamesResolution
399256x224
391320x224
302384x224
248320x240
197256x240
186288x224
146304x224
132336x240
64384x240
57512x240
53320x232
53256x480
53256x256
47704x480
43384x256
41480x480
41240x224
40640x240
33512x224
33400x254
30512x480
27352x240
27320x416
26256x192
25640x480
24512x384
23292x240
22512x400
20248x256
18512x288
18240x240
17638x240
16512x256
15448x224
13496x384
12432x224
12256x232
11508x384
11500x384
11240x192
10384x255

Popular Horizontal Arcade Video Modes

Number of GamesResolution
540224x256
175224x288
106240x256
86240x320
74224x240
64224x320
60240x240
47224x384
36240x384
24248x256
19192x240
18192x256
16256x256
16208x248
15384x512
13224x272
12224x280
10216x288

So, there are some things that are worth noting. Most games will run in a resolution of 320×240 without scaling. It just means that the screen size may be reduced. We have popular horizontal resolutions of 256 and 288 and 320. We also have a large quantity of games at 336 and 384 which will not display correctly at 320×240 unless rescaled, which we are trying to avoid.

For vertical resolution or line count, we have most games displaying either 224 or 240 lines. This is expected, due to the limitations of an arcade monitor. More on this later.

What we need to do is come up with a scheme to display most of these games at native resolution. Here’s my solution:

The raspberry Pi has 3 low frequency pixel clocks 4.8MHz, 6.8Mhz and 9.6Mhz.

  • For horizontal resolutions <=288 pixels, we use 4.8Mhz
  • For horizontal resolutions >288 and <=384 pixels, we use 6.8Mhz
  • For horizontal resolutions >384 pixels, we use 9.6Mhz

This works out quite well with most games displaying properly and fitting nicely to the available horizontal screen real estate.

Vertical line count is less of a problem. It can almost be ignored except for a few games that display at 248 and 256 lines like Irem’s R-Type and Midway’s Mortal Kombat and other games. Games that go over 240 lines break the rules somewhat (see my video generation tutorial here) and will likely have problems being displayed on anything but adjustable arcade monitors.

What we do in these cases is to reduce the front and back porch portion of the video signal and use that to get the addition line count. In my testing this worked fairly well.

This is the basis of my video mode switching algorithm for emulation going forward. It will be implemented in my standalone minimalist MAME image that can be found here.

One issue with this, console games that switch resolutions on the fly (Seiken Densentsu 3 / the unreleased Secret of Mana 3?) can not take advantage of this.