0xdd/calculator/screenscaling/

home

When choosing an LCD for a game console that will be used for emulation, the pixel dimensions are important to get right. If this is not done properly the emulated console's screen will be tiny but crisp or correctly sized but blurry. The reason for this is that the ideal LCD's pixel dimensions should be very close to an integer multiple of the emulated console's pixel dimensions.

For an example, check out the calculator below:

width height formula
original resolution px px
new resolution px px
ratio 6 4.821428571428571 new / original
integer ratio 6 4 floor(ratio)
integer scale factor 4 min(width int. ratio, height int. ratio)
remainder 2 0.8214285714285712 ratio - int. scale factor
screen area used 67% 83%
Given an input and output resolution, the ideal scale factor is calculated. In order for the image to be clear on the LCD, an integer scale factor must be used. If the scale factor is not an integer, not all of the emulated console's pixels can be displayed using the same number of LCD pixels: some have to be smaller than others to fit the desired size. In order to maintain the correct aspect ratio, to prevent the image from appearing "taller" or "wider" than it should, the horizontal and vertical scale factors must both be the same. Finally, the ideal scaling will not have excessively large unused areas around the emulated console's screen area. This is where the "remainder" and "screen area used" values become important. The "remainder" value indicates how close we are to the next highest integer scale factor value. The ideal "remainder" value is 0, which would indicate that there would be no unused area on the screen in the specified dimension. Values that are near to 1 or above are bad, this means that we could nearly (or actually) bump the scale factor up, but can't. This leads to large unused areas in the specified dimension. Sometimes, if the original image has a different aspect ratio than the output image, the horizontal "remainder" value will be bad. This isn't really avoidable if the proper aspect ratio is to be preserved.