cdoty wrote:Although Balboa isn't a good library for game development, it does provide source code that would help a programmer understand CD-I programming. It provides the correct way to interface with the CD RTOS.
I think you're giving Balboa a little too much c r e d i t (weird spelling to avoid spam detection), really. Most of the "how to interface" stuff is in the C bindings that come with the Microware C compiler, not with Balboa.
In the particular case above, the header file
uch.h provides the definition
Code: Select all
#define _OP_ICM 0xC0001010 /* image coding method */
and then uses that to define a macro
Code: Select all
#define cp_icm(cm0,cm1,nm,ev,cs) (_OP_ICM + /* details omitted */)
This macro constructs a 32-bit value that tells the video chip about image codings. No programmer in his right mind would ever construct this value by hand; that's what the macro is for!
In assembly language it's quite a different matter, but even there... One of the sample source lines I provided was the following
Code: Select all
* Load Image Coding Method.
CP_ICM equ $C0000000
Like any good programmer, Charles duly used this constant to construct his 32-bit value; but note that two bits are missing (the 1010 part)!. It should have been (and now is)
The same happened with the CP_DPRM instruction (one bit):
Code: Select all
* Reload Display Parameters.
CP_DPRM equ $78000000
versus the correct
If you want more details about these 32-bit values, check the MCD212 documentation available from the ICDIA site.
The Green Book explicitly defines the above three bits as required to be set, but does not tell you what happens if you forget to set them. Well, Charles found out the hard way: on Mini-MMC hardware you get a different video resolution; on later hardware it has no effect. I suspect that on Maxi-MMC hardware (CD-i 18x series) the effect would have been similar.
Charles actually happened to confirm both my best hopes and worst fears about using CD-i Emulator for development. He found the various tracing and debugging aids (which are much more powerful then whatever was available at the time) invaluable, but also managed to get stuck on the differences between the emulator and "real hardware" in several cases (some of which were bugs in CD-i Emulator, but others where not).
The experience has been enlightening and got me thinking about ways to support developement with the emulator. Bitwise validation of the Display Control Program was easy to add and presto, out rolled the three bits! Of course, Charles had already noticed them by bitwise comparison of DCPs from various other CD-i titles including the early Balboa version of Frog Feast, which speaks volumes about the amount of effort he must have thrown at the problem. Hats off!
About the various hardware versions... Some of this is documented in the Technical Notes series which should appear on ICDIA sometime soon (hopefully; Devin?!). Early CD-i models used a separate decoding chip per video plane, called VSC (Video System Controller???) on Maxi-MMC and VSR (Video System Revised???) on Mini-MMC, with another chip called VSD (Video System Decoder???) used to combine the outputs of the two video planes. This chipset generation supports the weird resolutions in hardware, but I have not been able to find any software support for it. It may have been a holdover from early development or an attempt to make the chipset reusable for other purposes as well.
The Motorola MCD212 reimplemented the functions of these chips on a single chip called VDSC (Video Decoder and System Controller), and I guess in the reimplementation the "undocumented" functionality got dropped. The VDSC is used in all CD-i players from Mono-I on.
ICDIA has a
Comparison table of all Philips and Philips-build consumer CD-i players listing the board types of each CD-i player; the
Player Support section of the C-i Emulator website shows the board types of each CD-i player in the tooltips; the
CDi-i Types section lists the chipsets used in each board type.
PS. Yesterday I started reading a new book where "Balboa" is an actual place where things happen. Mighty confusing...