Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CD-i: Unclear correct configuration for 625 scanlines #13231

Open
Vincent-Halver opened this issue Jan 14, 2025 · 3 comments
Open

CD-i: Unclear correct configuration for 625 scanlines #13231

Vincent-Halver opened this issue Jan 14, 2025 · 3 comments

Comments

@Vincent-Halver
Copy link

Vincent-Halver commented Jan 14, 2025

MAME version

0.272 (mame0272-397-ge2e6629e89b)

Emulated system/software

CD-i

Incorrect behaviour

High Res patterns missing all odd-numbered lines.

  1. Use the Validation Disc (Europe)
  2. Phillips Tests > 1st option > Drawing > Clut 4 High Res
  3. Click through the examples. Take special notice of the "Outline" (Example 3)
    image
  4. Compare to how the outline is supposed to look (e.g. one of the other draw modes). Notice how many horizontal 1 pixel tall features are missing.

If you look at cdi.cpp

	screen.set_raw(14976000, 960, 0, 768, 312, 32, 312);

Then you will see the vertical height is only 312, with a 32 line vblank. Though this is to spec, the screen needs 625 lines to support High Res.

Expected behaviour

All CD-i players are expected to support the "Base Case". Clut4 High Res mode is in the base case.

High Res mode renders interlaced. According to the Green Book Spec, page V-38:

The video decoder scan timing is such as to drive a standard 525 line (typically 60Hz)
or 625 line (typically 50Hz) television display, with two fields per frame.

In the extended case, High Resolution images may be displayed with two interlaced
fields per frame, or line sequentially.

Given there is only 312 lines of output, it's not obvious where to draw the additional lines. So the screen must be adjusted.

screen.set_raw(14976000, 960, 0, 768, 625, 64, 625);

This was my attempt, however I'm looking for guidance on whether this is a correct setup of the Screen object.

Additional details

The minimal patch to fix this issue will be to increase the screen resolution, and then update the screen_update to

  1. Skip all processing after line 312
  2. Preferably have each line draw two output lines (2N and 2N+1) to avoid regression of the visuals.

Only after the resolution is corrected can support for High Res image decoding be added.

@mamehaze
Copy link
Contributor

I'm assuming this is an interlace mode of some kind and the extra lines are on the 2nd field, and therefore should be shown every other frame (creating fake hi-res modes is not a real solution)

@Vincent-Halver
Copy link
Author

Example diagram I found. Yes, each "Field" runs for 312 lines. It seems likely to me that the screen must be 625 lines tall. But this also then leads to the image appearing squished. To properly interlace, some tricks can be done to correct the image, but before I get too deep doing that, I wanted some feedback on the expected idiomatic way that it should be done.
image

@mamehaze
Copy link
Contributor

mamehaze commented Jan 15, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants