CD-i interface

A project log for BlueRetro

Multiplayer Bluetooth controllers adapter for retro video game consoles

Jacques GagnonJacques Gagnon 04/12/2021 at 17:220 Comments

I added CD-i support with version v0.15! Regular pad, mouse & keyboards (K, X & T type) are supported. Any mix of devices is supported for up to 2 players! Refer to wiki for cable schematic and config documentation.

The low level protocol is UART based. It is well documented in various specifications but the most up-to-date one is contained in Chapter 9. Input devices of the Technical Documentation for CDI 605 / 605T Users that can be found on ICDIA.

CD-i pinout for dual interface front port

The spec defines RTS and RXD pin as standard RS-232 levels: 

- logical 1: -15V < signal level < +0.8V
- logical 0: +2.4V < signal level < + 15V

But from what I saw in various schematics the logical 1 level is always 0V and the logical 0 is 5V. So when interfacing with a CD-i interface level shifters are enough (no need for MAX232) as long the UART is configured to be inverted.

Pointing devices like gamepad and mouse defined speed of 1200 & 9600 baud in the original spec but only 1200 devices ever got released. Newer CD-i players dropped 9600 support on the front ports and the latest spec actually removed 9600 as a possible baud rate for mouse and gamepad.

For mouse, gamepad & type 'T' keyboard data signaling is 7 bits with 2 stop bits LSB first. For type 'K' & 'X' keyboards signaling is 8 bits with 1 stop bit LSB first.

Unlike most other game system the CD-i inputs are not polled. As long the RTS line is released devices are free to send data when state change.

Devices are identified once at boot time by holding the RTS line low. Once RTS line is released devices are required to send their 1 byte identification followed by their initial status data.

T is also used for 3rd keyboard type.

This was a problem for BlueRetro as devices per CD-i spec are required to answer the ID request within 500 ms. However BlueRetro take around 700 ms to read its configuration at boot. To work around this BlueRetro need to be powered externally and powered before powering the CD-i. This give the extra time required to load the config and to be ready to answer the ID request.

IDs request at boot for gamepad and 'K' keyboard.
IDs request at boot for mouse and 'T' keyboard.

Controller & Mouse

Status update sent on buttons press and release.
On axes movements update are continuously sent if value is not neutral (0).

'K' & 'X' type keyboards

Key A pressed and released
Key A pressed and released while holding shift key
Caps Lock press followed by Key A press and release

'T' type keyboard

Later CD-i model like my CD-i 450 only had a single physical front port including 2 serial port. Only the secondary port was compatible with 8 bits UART configuration that keyboards (K & X) and modem required. This posed a problem for CD online application as this made impossible to use the previous keyboard simultaneously with the modem. To answer this issue Philips defined the 'T' keyboard spec that piggy back on the tablet 'T' ID and redefine the data format to include the same data as the 'K' type keyboard.