Saturday, May 17, 2025

Announcing CD-i Emulator version 0.5.3-beta9 for Windows

A new beta release of CD-i Emulator is now available from the Downloads section of the CD-i Emulator website at https://www.cdiemu.org/downloads/.

Release notes can be found in the RELNOTES file included in the download; a summary as well as the full version is available from the Release Notes section at https://www.cdiemu.org/relnotes/.

This version of CD-i Emulator is the ninth beta release for version 0.5.3, which is now in maintenance mode as all development has shifted to version 0.6.0 for which a first public beta release is expected soon.

Relative to the previous version 0.5.3-beta8 release a few enhancements have been made; see the Release Notes for details.

Note to would-be crackers of this version (you know who you are):

I really would prefer it if you didn't. There is really no need!

As with all previous beta versions, using a Mono-I CD-i system ROM (also called BIOS) will give you unlimited emulation functionality; this is the same ROM file needed for the MESS/MAME CD-i driver.

Saving the contents of the CD-i NVRAM to a file is still supported.

To obtain unlimited emulation functionality with a different CD-i system ROM file, please buy the still available unlimited edition of version 0.5.2. Activating this on your PC will also unlock the unlimited emulation functionality of this beta version.

If you have bug reports or feature requests please use the GitHub issue tracker at https://github.com/cdifan/cdiemu/issues; as of right now no CD-i Emulator source code is on GitHub but eventually there will be.

For comments, questions and discussion you can use the #emulation subforum of the Philips CD-i Community Discord server reachable at https://discord.gg/TKPejTfw6D. I am known there as CD-i Fan (cdifan).

You can also reach me via e-mail using cdifan@gmail.com, but this will not involve the larger CD-i community and is hence discouraged.

If you like my work and/or would like to support future development, you can also send me a donation. You can send PayPal payments to payment@cdiemu.org or use one of the following websites:

https://www.buymeacoffee.com/cdifan

https://ko-fi.com/cdifan

You can still buy the unlimited edition of version 0.5.2, but sometime in the future this will no longer be possible. Go to the Payments section of the website and get an original serialized version while you still can!

Have fun emulating your favorite CD-i titles!

Preparing for CD-i audio/video decoder source code release

Over the last few weeks I have been preparing for a source code release of the CD-i base case audio and video decoder functionality from CD-i Emulator (https://www.cdiemu.org) in the form of two of its generic controller classes (excluding the specific chip emulations) and supporting infrastructure.

CD-i Emulator is written in C++98 and currently uses Visual Studio 2010 as its compiler. This source code release will be done on GitHub under the LGPL version 2.1 license; based on number of source lines this release comprises about 15% of the current CD-i Emulator source code.

Controller classes

The CCdiAudio controller class is capable of decoding all CD-i ADPCM formats (levels A/B/C, both mono and stereo) into 16-bit PCM format, with optional upsampling to a 44.1 kHZ sample rate; it also supports 44.1 kHz stereo passthrough for Compact Disc Digital Audio (CDDA). The minimum decoding unit for ADPCM is the 128-byte Sound Group. The controller also supports mixing with external audio; in a typical CD-i player this would be decoded MPEG audio from the Digital Video Cartridge (DVC).

The CCdiVideo controller class is capable of decoding all CD-i image formats (CLUT, RL, DYUV and RGB555) into various RGB formats, with full processing of the two-plane Display Control Program (DCP) supporting all CD-i video effects such as overlay, transparency, mixing, regions and mosaics and the cursor plane. The minimal decoding unit is the display line. The controller also supports mixing with external video; in a typical CD-i player this would be decoded MPEG video from the DVC. 

These two controller classes together contain a little over 6000 Lines of Code (6 kLoC) or about 25% of this source code release. A large majority of the rest is utility and interface classes; keep in mind that this code is all lifted from CD-i Emulator as is and therefore contains more functionality then strictly needed for the use-cases discussed below.

Use-cases

The primary use-case for this source code release is to serve as a reference and toolkit for decoding the CD-i audio and video formats as described in the Green Book, hopefully easing the work of current and future writers of CD-i emulators, tools, and applications.

The generic controller classes and the other classes can also be used in other projects, thereby saving development time, provided their licenses are compatible with the LGPL.

However, I want this source code release to be more directly useful so I am spicing up my existing cdiconv program for converting CD-i audio and video files into PCM and RGB formats and will include that in the release. The program already takes "raw" CD-i audio and video data but especially the latter does not capture the full richness of CD-i video decoding with its multiple planes of video data and the Display Control Program (DCP).

To remedy this I am adding a mode to the cdiconv program where it can simply decode the current image from a full CD-i video memory dump file; such dumps are easily generated from any CD-i emulator by just writing out both 512 KB banks of video memory in big-endian byte order. This can be used to validate decoder implementations; it is also easier to debug decoder issues outside the framework of a CD-i emulator.

Of course the cdiconv program can also be used for decoding assets from an existing CD-i title after these assets have been extracted from the disc image using other tools.

CD-i Emulator

To create video memory dumps with CD-i Emulator, select Emulate | Dump from the menu, press its keyboard shortcut Ctrl-F12 or use the new debugger command "ex dump". A video memory dump will be written to the dump directory, much like Emulate | Snapshot or F12 writes a snaphot image in PNG format to the snap directory.

The dump function can actually be used to dump any CD-i memory area by using the new -dumpfilter option or passing an additional parameter to the "ex dump" command; the default for the filter parameter is "planea;planeb" which selects the two video memory areas. In the future this will be extended to a generic state save facility.

Two files are actually written by CD-i Emulator:

  • a .dmp file containing textual meta information about the dump
  • a .dat file containing the binary data from the memory areas
The .dat file is referenced from the .dmp file much like done with .bin/.cue files.

The cdiconv program can be passed either file; if given any binary file it will just assume it to be a video memory dump with two equal sized banks (not necessarily 512 KB) and determine the video memory addresses from the ICA instructions at offset 0x400 in each video bank. Other emulator authors do therefore not need to bother writing the meta information files; the video mode information which is not easily recoverable from the video memory can also be provided with a cdiconv mode parameter.

These changes are in CD-i Emulator version 0.5.3-beta9 which will be released later this weekend.

I am still working on the cdiconv program; the source code will be released when that is finished. This should be relatively soon (weeks not months).