Skip to content

Replace "Use Square Pixels" with "Vertical Size" knob #1524

@arekkusu42

Description

@arekkusu42

Hi Tom, great job with this project.

This issue is in response to #945, where the "Use Square Pixels" option was added.
Below, I'm going to copy-paste some notes about Apple ][ aspect ratio from one of
my own projects, but the TLDR is:
* don't trust what users "remember", or internet photos, or other emulators.
* do trust physically measuring a real monitor, and Apple's manuals.

I gently suggest that you remove the "Use Square Pixels" option. If you want to
allow users to adjust the aspect ratio to their own preference, an authentic way
to emulate that is to add a "Vertical Size" knob, like the old Apple monitors.
(c.f. MAME allows this via overriding -aspect, or -vstretch & -voffset)

/*
Aspect ratio notes:

First, differentiating terminology:
DAR = Display Aspect Ratio	the width/height of a display
PAR = Pixel Aspect Ratio	the width/height of a single pixel
SAR = Storage Aspect Ratio	the width/height of an image (in pixels)

We are simulating an Apple ][ designed to display on an NTSC television,
or similar CRT using a 4:3 physical (that is, the frame around the CRT
glass) DAR.  However, the Apple ][ video (the "active area") is inset
by a wide border, and there are differing opinions on what the correct
aspect ratio of this area is.

In 1983's "Understanding the Apple II", page 8-28 "Aspect Ratio in the
Apple Display", Jim Sather arrives at a 49:40 aspect ratio, starting
from the approximation that one NTSC scanline consists of:
	53.6 us active, 10.0 us blanking			(1MHz/15734Hz = 63.56 us total) 
Sather then computes an NTSC TV active area as:
	 53.6 /  63.6 us        = 84.3% horizontal visible
	242.5 / 262.5 scanlines = 92.4%   vertical visible
and 	.843 HD / .924 VD = 4/3, so HD/VD = 1.46		(4/3)/((53.6/(1000000/15734))/(242.5/262.5))
He then computes by symmetry the A][ active area as:
	560 / 912 14M clocks    = 61.4% horizontal visible
	192 / 262     scanlines = 73.3%   vertical visible
so	.614 HD / .733 VD = .838 HD/VD = 1.225 aspect		(560/912)/(192/262)*1.4605527147
or	a 560x192 PAR of 0.42					1.225/(560/192)
Sather then recommends using this scaling factor (or derivatives such
as 0.84 for 280-pixel HGR, and its inverse 1.191) to scale X or Y when
rendering geometrically correct (squares, circles) graphics.
	http://archive.org/details/understanding_the_apple_ii/page/n223/mode/2up

But!  There are three problems with this calculus.  First, Sather's
starting approximation was too coarse.  One NTSC scanline is actually:
	52.7 us active, 10.9 us blanking			(1MHz/15734Hz = 63.56 us total) 
	http://www.renesas.com/en/document/apn/an1695-basics-video-simple-analog-hdtv
Recomputing the horizontal terms:
	 52.7 /  63.6 us        = 82.9% horizontal visible
and 	.829 HD / .924 VD = 4/3, so HD/VD = 1.49		(4/3)/((52.7/(1000000/15734))/(242.5/262.5))
so	.614 HD / .733 VD = .838 HD/VD = 1.245 aspect		(560/912)/(192/262)*1.4854957402
or	a 560x192 PAR of 0.42675 (slightly wider)		1.2447/(560/192)

Second, consider physical evidence.  On a 1984 Apple //e with a 1983
Amdek Color-1 Plus CRT, a flexible measuring tape finds that the active
area is roughly 9.25" x 7", which is a 1.321 aspect ratio (roughly,
because the measured width isn't constant across the entire screen due
to barrel distortion.)  This is between 49:40 = 1.225 and 4:3 = 1.333,
but much closer to 4:3.  We posit here that the CRT manufacturer has
"adjusted at the factory" the vertical size (and for TVs, the overscan)
with the intention to approximate "evenly sized borders" in the 4:3 DAR.
We specifically point out mention of this in Apple monitor guides:
	http://archive.org/details/AppleColor_RGB_Monitor_Owners_Guide_Rev_C/page/n17/mode/2up
	http://archive.org/details/Apple_Monochrome_Monitor_Owners_Guide/page/n17/mode/2up
Apple has explicitly documented the "adjusted" active region as 200x150
or 215x160 mm.  This means the intended PAR is 0.457.		(4/3)/(560/192)
For geometrically correct rendering on the A][, scaling factors to
compensate the non-square HGR pixels stretched to the 4:3 aspect are
(35/32) in X or the inverse (32/35) in Y.

Third, many commonly-used monitors (including the Apple Monitor II,
AppleColor Composite and AppleColor RGB, but not the Amdek Color-1 Plus)
expose the vertical size adjustment to the user, via a knob on the back.
So the effective aspect ratio is whatever they have set it to!  As with
color tint, all measurements are subjective!
	http://archive.org/details/Apple_II_AppleColor_Composite_Monitor_Owners_Guide_1986_Apple/page/n11/mode/2up
	http://archive.org/details/Apple_Monitor_II_Users_Manual/page/n9/mode/2up

Here, we assume the intended aspect ratio of the active area is 4:3.
*/

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions