Friday, October 30, 2009

Video mode refactoring

In search of something small, I refactored the video mode calculation today, in preparation for a more complete VSC (SCC66470) emulation and CD-i File video decoding. This gets a bit technical...

It turns out that the VSC chip supports much more video modes than the "standard" CD-i ones supported by the VDSC, and in the interest of accuracy I will eventually want to emulate that. These modes include widths of 224, 256 and 320 pixels in addition to the standard ones of 360 (NTSC) and 384 (PAL) and an height of 210 lines in addition to the standard ones of 240 (NTSC) and 280 (PAL). Charles Doty accidentally hit one of these resolutions during his Frog Feast development and we were both extremely baffled until we figured out that a stray bit had been set in his "set video mode" instruction. The VSC chip is only used in Mini- and Maxi-MMC players which means these resolutions exist only on the CD-i 180, CD-i 220 F1 and CD-i 60x players.

I also wanted to generalize the mode stuff in preparation for the decoding of arbitrarily sized images as needed by future versions of CD-i File.

So instead of four bits (CF,ST,FD,SM) taken directly from the VDSC registers DCR1 and CSR1 the CCdiVideo::SetMode function now takes an SCdiVideoMode structure containing all the parameters previously derived from these four bits: field and line count, starting video line and total number of video lines, video pixels and decoded pixels. I've also added pixel resolution which previously was a separate parameter that chooses between decoding to normal resolution (384) or double resolution (768).

The calculations of the parameters from the hardware register bits have been moved into the CCdiVdsc and CCdiVsc classes (the VDSC and VSC emulations) so that the VSC emulation can in the future extend the calculation to include the non-standard video modes.

Thursday, October 29, 2009

Blog start

Well, I've finally succumbed to this blog thing...

I will try to make regular (but not daily) posts here about whatever I'm doing related to CD-i. That of course includes work on CD-i Emulator, but also on tools (CD-i File comes to mind), interesting information I found out, etc.

If wou want more CD-i info, I can recommend the CD-i Forum at http://www.cdinteractive.co.uk/forum/ and the CD-i WIP topic on the MESS forum at http://www.bannister.org/forums/ubbthreads.php?ubb=showflat&Number=54354.

Today I added CD-i File stuff to the Downloads and What's New sections of the CD-i Emulator site, didn't have much time for other things, as I also had to install my wife's new laptop a bit more. And I was home late also.

The last weeks have been fairly hectic, I blame MESS for it :-) The CD-i interest seems to have risen sharply, and I've actually fixed a few CD-i Emulator bugs and added a few features to CD-i Emulator as the result of it.

And of course I polished up CD-i File Extractor and released its first version. This is intended as the command-line version of the much-requested CD-i File Player. Whereas the Extractor will only be able to extract and convert audio and video (images), using the command line, the Player will be able to actually play the audio and show the video. But that's still a while to go...