The real V99x8 Pixel Aspect Ratio (PAR)

Page 1/2
| 2

By sd_snatcher

Prophet (2775)

sd_snatcher's picture

24-01-2018, 02:15

I'm trying to find out the real V99x8 pixel aspect ratio (PAR).

The two articles on the V9938 VRAM timings. Seem to be a great resource for this. But unfortunately they don't mention some important info:

- Were the measurements made with the VDP set to 60Hz or 50Hz? Supposedly it was 50Hz, given the machine is an NMS-8250.
- Whether the 60Hz/50Hz has any effect in the line timings
- How many lines the VDP draws: upper border, active area, lower border and vblank

Anyway some important info can be deduced from the article and the V9938 datasheet:

- The pixel clock is 10.738635MHz. 256-pixel wide modes draw horizontally doubled pixels in the active area.
- The active area is 554 pixels wide (28+512+14)

If we suppose that the timings will be the same for NTSC or PAL, as the V9938 datasheet suggests, then we can add:

- NTSC interlaced has 480 active lines, from a total of 525 (the rest is drawn of the screen)

So, the pixel aspect ratio for a well calibrated 4:3 NTSC monitor will be:

(4/554)/(3/480) = 1.155234657

So, the variations of the V99x8 resolutions will have the following PARs:

256x212 and 256x192: 1.155234657
512x212 and 512x192: 0.577617329
256x424 and 256x384: 2.310469314
512x424 and 512x384: 1.155234657

What are your thoughts on this?

Login or register to post comments

By TomH

Master (205)

TomH's picture

24-01-2018, 03:34

It's apparently the only thing I know how to talk about, but my emulator includes a full emulation of a CRT, which should mean that the aspect ratio is correct even though I've never bothered to work out what it is. For comparison, 1:1 copying from another emulator versus mine (showing composite video, so a bit fuzzier, but check out the aspect ratio):

Doing the arithmetic, sticking to the TMS modes because my knowledge is limited, I get:

256 cycles of pixels, at 2/3rds of a colour cycle per pixel = very close to 75% of the complete line as pixels. Or, each pixel is 1 / (227.5 * 1.5) of a line. Around 52/64ths of the line are visible, so:
64 / (227.5 * 1.5 * 52)
= 64 / 17745

Each line is 1/240th of the visible area tall.

Given the screen is 4:3, the aspect ratio of a pixel is:
(4 * (64 / 17745)) / (3 * (1 / 240))
= (256 / 17745) / (3 / 240)
= (256 / 17745) / (1 / 80)
= 4096 / 3549
~= 1.154127923358693

So we agree!

By Grauw

Enlighted (7317)

Grauw's picture

24-01-2018, 09:37

https://www.msx.org/forum/msx-talk/development/creating-pixe...

Grauw wrote:

I’ve been wondering what the exact MSX pixel aspect ratios (PAR) are. This is relevant when drawing graphics on PC since they have square (1:1) pixels while the MSX doesn’t.

The V9938 vertical display area at 60 Hz is 243 lines, at 50 Hz it is 294 lines. The horizontal display area including borders is 1139 cycles, or 284,75 pixels (/4) in screen modes other than 3, 6 and 7.

As far as I know the display aspect ratio (DAR) of a TV is calculated based on the full frame output including overscan (borders), so we can derive the pixel aspect ratios from these numbers.

The pixel aspect ratios on a 4:3 display are (4y / 3x):

60 Hz: 1296 / 1139 = 1,138 = ~9:8
50 Hz: 1568 / 1139 = 1,377 = ~7:5

The pixel aspect ratios on a 16:9 display are (16y / 9x):

60 Hz: 1728 / 1139 = 1,517 = ~3:2
50 Hz: 6272 / 3417 = 1,836 = ~11:6

In openMSX these would correspond to horizontal_stretch values of 281 (60 Hz 4:3), 232 (50 Hz 4:3), 211 (60 Hz 16:9) and 174 (50 Hz 16:9). Unfortunately only one of these can actually be entered because the values can not be <256. The default is 280 though, so quite correct for a 60 Hz MSX.

By sd_snatcher

Prophet (2775)

sd_snatcher's picture

25-01-2018, 01:51

@Grauw

Thanks!

But then there's the "well calibrated NTSC monitor" issue. They're calibrated using a standard calibration card (electronic card, these days). This sets the monitor to the exact standardized image dimensions. (it's also used to calibrate the gain, hue and many other parameters, but those are out of the scope right now).

The monitor will then impose the following constraints to the image:

1) Only 480i lines (240p) will be drawn. So the extra three lines that the V99x8 renders will fall off of the screen, as overscan
2) The image period of a line is exactly 52.6uS long. Any pixels sent after this will fall off of the screen, as overscan

On the V99x8, the leftBorder+ActiveArea+rightBorder = 1139 cycles = 53.03281uS

This means that the last 4.647799 pixels of the right border will fall off of the screen, as overscan.

So, after the monitor crops the image, we have an effective resolution of 564.8522 x 480i. Yes, the numbers have decimal points because this is all analog. NTSC had no real concept of pixels.

(4/564.8522)/(3/480) = 1.133039756

So I think this seems to be (finally!) the definite pixel aspect ratio for the MSX on an NTSC monitor. What do you think? :)

By Parn

Champion (304)

Parn's picture

25-01-2018, 20:00

I'm keen on the developments of this discussion. Smile

By TomH

Master (205)

TomH's picture

25-01-2018, 21:37

I'm not sure you can be absolutely definite:

  • practically, because CRTs were usually calibrated to a test card manually by factory staff; and
  • strictly, because both the TMS and V99x8 are off-spec by 0.2% in horizontal timing.

A real NTSC line is 227.5 colour clocks long — that's the period between horizontal syncs. Both the TMS and V99x8 run for 228 colour clocks between horizontal syncs. Within tolerance, but some screens might compress to make up the difference and others might not. You're still getting the same aspect ratio to two decimal places, but everything after that is questionable even if you discard the calibration concern as being a manufacturing problem.

By sd_snatcher

Prophet (2775)

sd_snatcher's picture

25-01-2018, 22:48

Oh, yes. "Definite" indeed sound exaggerated. "As precise as possible" maybe comes closer to what I wanted to express.

By Grauw

Enlighted (7317)

Grauw's picture

25-01-2018, 23:20

Two decimal places is good enough I reckon, and we’re not far apart Smile. Somewhere between 9:8 and 8:7.

Btw, do you have sources for that 52.6uS and 240 lines where I can read up on it?

By sd_snatcher

Prophet (2775)

sd_snatcher's picture

26-01-2018, 00:03

I agree that, for emulation, two decimal places are enough and not a lot of people would notice it. Probably 1.14 is the best compromise in this case, and it's the same PAR used for all descendants of the TMS9918, like the SMS, NES, Megadrive in 256x224 and even the SNES. This and this articles explain this in better detail.

But I think that to create new Pixel Art, artists would be more comfortable to use the closest possible configuration to what a real MSX would show. It's possible to configure The GIMP to do this, for example.

And, for pure nerdiness fun, it's also nice to find out what's the precise PAR should be, isn't it? ;)

Note: I had to create this thread under "emulation" due to the lack of a specific place to talk about Graphics or Art. Since we're trying to emulate the MSX pixel aspect ratio, I thought that the most adequate would be here. The "General Talk" board has too much traffic and the subject quickly drown and vanish.

The NTSC line timing can be seen here.

The image comes from this article, but many other sources cite this information.

By TomH

Master (205)

TomH's picture

26-01-2018, 00:48

I have my suspicion that the visible horizontal line time may have been redefined down to more like 50.2µs in the same way that the vertical visible area was redefined down to 240 on the grounds that the standard for digitisation of composite video is to sample at four times the colour subcarrier for Nyquist reasons, there should be 227.5 cycles of that in each 63.5µs period, and DVDs went with 720 pixels across.

720/4 is 180; (180/227.5)*63.5 = approximately 50.2µs.

Of course there's no inherent reason why DVDs would necessarily be aligned exactly with the preservation standard (e.g. they're definitely not in PAL), it just seems very unlikely to me that they'd make it 95% of the number for the same period and not just slightly redefine the visible region; it also feels improbable that what DVDs consider the visible region wasn't based on real empirical evidence.

All circumstantial though.

By Grauw

Enlighted (7317)

Grauw's picture

27-01-2018, 01:38

Creating graphics on PC was the reason I started thinking about the aspect ratios. Pretty early on I noticed that you can’t just ignore the ratio difference, it’s just a bit too far from 1:1 for that. I had to adjust the drawing to compensate, a bit of a hassle, and in the end it still was subtly too wide for my liking but I didn’t feel like doing another pass on it.

Aseprite (my editor of choice) currently has a feature request to allow the user to specify a custom aspect ratio (currently only 1:1, 1:2 and 2:1 are supported), which is on the roadmap for the next release. I hope it will actually be coming sometime soon, because it would sure be handy.

About what board it’s on, for me it doesn’t have much to do with emulation, so if an admin passes I wouldn’t mind if this thread were moved to the new arts section.

Page 1/2
| 2
My MSX profile