EmuNews

OpenCDi

sigsantilio/opencdi

6 tracked updates · latest 4 days ago

GitHub
Release notes · 2 files

OpenCDi v0.2.0 - Release Notes

OpenCDi v0.2.0 represents a major architectural milestone. This release replaces the legacy monolithic windowing system with a modern cross-platform frontend (winit + softbuffer), introduces a headless automated testing harness (harness.exe), resolves in-game audio stuttering across the entire software library (Zelda: The Wand of Gamelon, Link: The Faces of Evil, Escape from Cyber City), synchronizes gunshots in FMV rail shooters (Mad Dog 2), refines MPEG-1 / DVC video decoding, and adds custom NVRAM file support via CLI.


Highlights and Key Changes in v0.2.0

1. Cross-Platform Windowing & Modern Frontend (winit + softbuffer)

  • Migrated from minifb to winit (0.30) and softbuffer (0.4.8).
  • Native Linux Support (X11 & Wayland): OpenCDi now builds and runs natively on modern Linux distributions (such as Kubuntu, Ubuntu, Fedora, and Arch) without requiring Wine or Windows GUI emulation, resolving Linux build failures.
  • Foundation for macOS / Apple Silicon: Gated platform-specific Win32 APIs, enabling native POSIX / ARM64 compilation.
  • Enhanced Window Controls: Added RetroArch-style shortcuts:
    • F11 / Alt+Enter: Fullscreen toggle
    • P: Pause / Resume emulation
    • Space (hold): Fast-forward
    • F8: Save Screenshot (PPM)
    • F12: Save Screenshot (BMP)
    • F5 / H: Restart Console (Reset)
    • Esc: Quit

2. Headless Machine Test Harness (harness.exe)

  • Extracted the core machine execution loop into an independent module (Machine::run_frame).
  • Introduces harness.exe for automated batch testing, frame comparison, and audio verification without requiring a window or audio device.
  • Supports scripted input playback and peek reads without CPU side-effects.

3. Complete Elimination of Audio Stuttering in Zelda Games

  • CDIC ADPCM Soundmap Architecture (Zelda: The Wand of Gamelon / Link: The Faces of Evil): In Zelda games, music is synthesized via CDIC Sound Maps rather than streamed disc sectors.
  • Fixed handling of CDIC register 0x3FFA (ZBUF / AUDCTL): buffer reactivation now preserves ADPCM predictor filter states, eliminating harsh DC offset pops and dropouts.
  • Continuous soundmap playback avoids premature termination between buffer reloads.
  • Dynamic Rate Control (DRC) & SFX Prebuffering: Implemented a dedicated 1536-sample prebuffer and continuous proportional DRC on the host soundmap/SFX queue to absorb clock jitter without starvation.

4. Additional Audio & Gunshot Emulation Fixes

  • Level B/C Mono ADPCM Decoding (Escape from Cyber City): Corrected byte packing for mono ADPCM streams, eliminating harsh audio distortion and buffer starvation at decision points and forks.
  • Gunshot Detection & Controller Timing (Mad Dog McCree / Mad Dog 2): Synchronized slave mouse coordinate registers with video scanlines to ensure reliable gunshot registration during FMV interactive scenes.

5. MPEG-1 & DVC Digital Video Cartridge Improvements

  • Motion Compensation Edge Clamping (The Lost Ride / Lost Eden): Half-pel macroblock neighbors outside picture boundaries are now clamped instead of dropping the macroblock.
  • Mid-stream Sequence Headers: Added dynamic decoder resizing when sequence headers change within a video stream.
  • DVC Display Window: Hardware windowing (PICSZ, matte keying) is accurately applied to high-resolution display fields.
  • Slave Channel 2 Reset: Slave MCU pulls the system reset line upon channel 2 reset commands, restarting the player cleanly.

6. Persistent NVRAM Customization (--nvram <path>)

  • Added command-line parameter --nvram <path> allowing users and frontends (e.g. RetroArch / Pegasus / LaunchBox) to specify custom NVRAM save locations per game.
  • Includes safety-guarded menu action File -> Clear Console Memory (Reset NVRAM)....

Tester Feedback & Bug Reporting

Community feedback remains essential for catalog coverage and edge-case discovery. Click Send Feedback (F1) on the main menu bar or press F1 at any time to open the dedicated tester portal:

https://cdi-tester-feedback.pages.dev/


Package Contents

The OpenCDi_v0.2.0_Windows_x64.zip package contains:

  • opencdi.exe (OpenCDi v0.2.0 64-bit release binary)
  • harness.exe (Headless test harness binary)
  • opencdi_controls.ini (Default controller configuration)
  • Avvia_OpenCDi.bat (Quick launcher script)
  • icon.ico (High-resolution icon)
  • bios/ (Target directory for system ROMs)
  • README.txt (Complete configuration and usage guide)

Special Acknowledgments

  • ArnoldDeRuiter: Special thanks for the Machine Harness architecture, Linux windowing migration (PR #3 & #4), and DVC/MPEG emulation improvements (PR #5).
  • MAME (MAMEDev): Hardware register architecture draws reference from MAME's Philips CD-i drivers licensed under the BSD 3-Clause License (cdi.cpp, mcd212.cpp, cdicdic.cpp, scc68070.cpp).
  • CDi_MiSTer: Heartfelt thanks to ash2020 and the CDi_MiSTer project for FPGA hardware reverse-engineering and CD-i ASIC research.
Release notes · 1 file

OpenCDi v0.1.9 - Release Notes

OpenCDi v0.1.9 is now available for Windows (x64). This release introduces full Save States and Load States, persistent console memory (NVRAM), exclusive input device handling (eliminating mouse and gamepad signal conflicts), real-time audio pacing without stuttering, and hardware-level emulation fixes for DVC and MCD-212 video controllers.

Additionally, this release integrates a prominent tester feedback entry point directly on the main menu bar to facilitate bug reporting and community testing.


Importance of the Tester Feedback System

The Philips CD-i catalog is technically diverse, featuring proprietary multimedia engines, custom OS-9 file formats, and varying MPEG/ADPCM stream configurations across titles. Comprehensive community feedback is crucial to discovering title-specific regressions, audio timing glitches, and edge cases.

To streamline this process, the Send Feedback (F1) button is now placed directly on the top-level menu bar, accessible with a single click or by pressing F1 at any time during emulation. This connects directly to the dedicated tester feedback portal:

https://cdi-tester-feedback.pages.dev/

Testers are encouraged to report:

  • Boot freezes or games that halt at specific screens.
  • Visual corruption, incorrect color blending, or broken transitions.
  • Audio stuttering, channel drift, or synchronization loss.
  • Controller, button mapping, or mouse cursor anomalies.

Every submission provides reproducible data that accelerates investigation and targeted hardware fixes.


Key Features and Changes in v0.1.9

1. Save States and Load States (Slots 1 - 5)

  • Added full emulation state serialization across 5 dedicated slots.
  • Keyboard shortcuts:
    • F6: Quick Save State (Slot 1)
    • F7: Quick Load State (Slot 1)
  • Accessible through the menu via File -> Save State to Slot and File -> Load State from Slot.
  • Captures an atomic snapshot of the entire machine: SCC68070 CPU registers and memory, MCD-212 VRAM and CLUT palettes, CDIC and ADPCM audio state, 68HC05 Slave microcontroller, and DVC MPEG-1 hardware registers.

2. Persistent Console Memory (NVRAM MK48T08)

  • Game saves and preferences stored in the console's internal non-volatile memory (battery-backed MK48T08 SRAM) are now persistently saved to disk across sessions.
  • In-game save data (such as progress and puzzles in The 7th Guest, Hotel Mario, Burn:Cycle, etc.) remains intact upon closing and restarting the emulator.
  • Added a safety-guarded menu action File -> Clear Console Memory (Reset NVRAM)... with confirmation dialog to reset console NVRAM to factory defaults.

3. Exclusive Input Mode (CD-i Gamepad vs CD-i Mouse)

  • Resolved concurrent signal conflicts between mouse and controller. Only the active device forwards inputs to the console, preventing unwanted cursor clicks during gamepad play.
  • Toggle anytime via F9 or through Controls -> Input Device (Exclusive):
    • CD-i Gamepad (F9): Direct mapping for USB gamepads (Xbox, PlayStation, generic controllers) and PC keyboard arrows/WASD. Mouse input is muted.
    • Philips CD-i Mouse (F9): Exclusive control of the CD-i cursor and mouse buttons via the host PC mouse.
  • Active input mode is automatically saved in opencdi_controls.ini.

4. Audio Pacing and Stutter Elimination

  • Resolved audio stuttering and buffer starvation during DVC MPEG-1 playback and CD-DA audio tracks.
  • Host audio playback buffer is synchronized with fractional frame pacing, providing continuous low-latency audio output without dropouts.

5. Accurate Hardware Emulation Fixes (DVC & MCD-212)

  • The 7th Guest: Eliminated the post-cutscene black screen. In authentic CD-i hardware, the CL450 MPEG processor retains the last decoded picture in DRAM across stream pauses; maintaining this frame in memory provides seamless transitions into interactive 3D rooms.
  • Ultra CD-i Soccer: Fixed color corruption and video bleed during main menu transitions. The DVC now accurately responds to hardware control register commands (STOP, RESET, DEC_OFF), blanking the video buffer when explicitly instructed by the software driver.

6. User Interface Improvements

  • Added Send Feedback (F1) directly to the top-level menu bar.
  • Embedded high-resolution CD-i icon is now assigned to all application windows.

Keyboard Shortcuts Reference

  • F1: Send Tester Feedback (opens feedback platform in browser)
  • F5: Hardware Reset console
  • F6: Quick Save State (Slot 1)
  • F7: Quick Load State (Slot 1)
  • F9: Toggle Input Mode (CD-i Gamepad / CD-i Mouse)
  • F11: Fullscreen toggle
  • F12: Save Screenshot (BMP)
  • Ctrl+O: Open Disc Image & Restart Console
  • Ctrl+I: Hot-swap Disc Image
  • M: Mute / Unmute audio
  • + / -: Adjust volume
  • Middle Click: Capture / Release host mouse cursor

Package Contents

The opencdi-v0.1.9-windows-x64.zip distribution includes:

  • opencdi.exe (64-bit release build)
  • opencdi_controls.ini (default input configuration)
  • Avvia_OpenCDi.bat (launcher script)
  • icon.ico (high-resolution icon)
  • bios/ (directory for required system ROMs)
  • README.txt (quick start guide and documentation)

Acknowledgments & Third-Party Licenses

  • MAME (MAMEDev): Special credit to the MAME development team and contributors. Portions of the hardware register architecture draw reference from MAME's Philips CD-i drivers licensed under the BSD 3-Clause License (cdi.cpp, mcd212.cpp, cdicdic.cpp, scc68070.cpp).
  • CDi_MiSTer: Heartfelt thanks to ash2020 and the CDi_MiSTer project for their FPGA hardware reverse-engineering and CD-i bus analysis.
Release notes · 1 file

OpenCDi v0.1.8 – Release Notes

Welcome to OpenCDi v0.1.8! This release brings major quality-of-life enhancements to the user interface, including a custom application icon, a recent disc image history, direct physical optical CD-ROM drive support, and key hardware fixes for the Digital Video Cartridge (DVC / MPEG-1) and MCD-212 Display Controller.


Highlights in v0.1.8

1. Custom Application Icon

  • Native PE Resource: OpenCDi now features an embedded high-resolution application icon compiled directly into the Windows executable via winres.
  • Desktop & Taskbar Integration: The icon is displayed natively in Windows File Explorer, on the application window title bar, and in the taskbar.

2. Recent Disc Images History (Up to 10 Discs)

  • Fast 1-Click Reload: Added a new File → Recent Disc Images submenu listing the last 10 loaded disc images with rapid keyboard accelerators (&1 through &0).
  • Persistent Storage: Disc history is saved automatically to opencdi_recent.txt and dynamically updates at runtime when opening, hot-swapping, or resetting games.
  • History Management: Includes a dedicated Clear Recent Images History menu option.

3. Physical Optical CD-ROM Drive Support

  • Play Real Discs: Automatically scans and detects host optical drives (CD-ROM / DVD-ROM).
  • Native Menu Options: Directly boot real CD-i discs from your PC drive (Boot Real Disc (D:) & Restart) or hot-swap multi-disc games on the fly without console restart.

4. Digital Video Cartridge (DVC / CL450 MPEG-1) Fixes

  • Frame Persistence in DRAM: Eliminated premature black frames and visual blinking at stream boundaries. Real CD-i DVC hardware retains the last decoded frame in DRAM until the next picture is ready.
  • Death Cutscene Blanking Fix: Resolved premature FMV window closing on player deaths in titles like Dragon's Lair and Space Ace.
  • CL450 Register Safety: Guarded host driver registers (0x02 and 0x04) from being overwritten by the decoder; video sequence geometry is now properly mapped to registers 0x52 and 0x54.
  • Unified Stream Demuxing: Implemented simultaneous video draining from both FMV and FMA demux buffers.

5. Philips/Motorola MCD-212 Display Controller

  • DCP Register Latching: Fixed access to the Display Command Pointer (DCP) registers at offsets 0x0A and 0x1A according to official MCD-212 hardware specifications.

6. Verified Game Compatibility & Documentation

  • Space Ace (USA): Verified fully playable with smooth MPEG-1 full motion video, synchronized CD-audio/ADPCM, and responsive controls.
  • Brain Dead 13 (USA): Completed extensive architectural reverse engineering and signal trace analysis of cdi_bd13, cdapdriv, and CDIC sector buffer registers (DBUF bit 5 0x0020), fully documented in docs/BRAINDEAD13_RESEARCH_AND_ARCHITECTURE.md.

Acknowledgments & Third-Party Licenses

This project benefits greatly from the prior work, documentation, and dedication of the digital preservation community:

MAME (MAMEDev)

Special acknowledgment and credit to the MAME development team and contributors (including Harmony, Ryan Holtz, Pete Bernert, and the CD-i driver authors). Portions of the hardware register architecture, CD-i subsystem behavior, and hardware timing research in OpenCDi draw reference from MAME's Philips CD-i drivers, which are licensed under the BSD 3-Clause License:

  • src/mame/philips/cdi.cpp
  • src/mame/philips/mcd212.cpp
  • src/mame/philips/cdicdic.cpp
  • src/devices/cpu/m68000/scc68070.cpp (and scc68070.cpp)

MAME is distributed under the terms of the GNU General Public License v2 or later (GPL-2.0+), with individual driver files licensed under permissive terms such as BSD-3-Clause. Copyright © 1997-2026 MAMEDev and contributors.

CDi_MiSTer

Special thanks to the authors and contributors of the CDi_MiSTer project (including ash2020 and the MiSTer FPGA community). Their FPGA hardware research, reverse-engineering of CD-i ASICs, bus cycle analysis, and hardware documentation have been instrumental in verifying low-level behaviors of real CD-i hardware.

The CD-i Preservation Community

Heartfelt thanks to the broader CD-i community for ongoing preservation efforts, testing, and documentation of the CD-i hardware and software library.


System BIOS & Required Files

Due to copyright restrictions, system ROMs are not bundled and must be placed into the bios/ folder or next to opencdi.exe:

Component Recommended Filename Supported Alternatives Exact Size SHA-1 Checksum Status
System BIOS cdi220b.rom cdi220.rom, cdi200.rom, cdi490a.rom 524,288 bytes (512 KB) 53360a1f21ddac952e95306ced64186a3fc0b93e Mandatory
DVC ROM (FMV) vmpega.rom impega.rom 262,144 bytes (256 KB) be407fbc102f1731a0862554855e963e5a47c17b Required for MPEG titles
Timekeeper NVRAM nvram_mk48t08.bin nvram.bin 8,192 bytes (8 KB) 601d780e1544985352535143705ffcc670d282d1 Optional (Auto-created)

Quick Start Guide

  1. Download and extract opencdi-v0.1.8-windows-x64.zip.
  2. Place cdi220b.rom (and vmpega.rom for MPEG video games) inside the bios/ folder.
  3. Drag and drop any .chd, .iso, or .bin/.cue CD-i disc image directly onto opencdi.exe (or launch Avvia_OpenCDi.bat).
Release notes · 1 file

OpenCDi v0.1.7 — Release Notes

Welcome to OpenCDi v0.1.7! This release introduces complete English UI localization, a more flexible multi-path BIOS loader with dedicated user warning dialogs, and key fixes for Full Motion Video (FMV) titles and hardware timing.


Highlights in v0.1.7

1. English User Interface & Controls Localization

  • Fully translated Win32 native menus (File, Controls, Audio, Video, Help) and standard keyboard shortcuts.
  • English control mapping dialogs, key profiles (Standard, WASD, Numpad, Custom), and opencdi_controls.ini templates.
  • English file dialogs and real-time titlebar telemetry.

2. Robust Multi-Path BIOS & DVC ROM Detection

  • Flexible search across bios/, dvc/, root ./, and executable parent directories for all system ROMs.
  • Automatic recognition of alternative BIOS naming (cdi220b.rom, cdi220.rom, cdi200.rom, cdi490a.rom) and DVC ROMs (vmpega.rom, impega.rom).
  • Replaced sudden startup panics with a friendly native modal dialog (MessageBox) detailing missing files, exact sizes, and SHA-1 checksums.

3. Video & DVC Compatibility Fixes

  • The 7th Guest (USA): Eliminated the black flash/flicker at the end of MPEG video cutscenes. The DVC DRAM scanout now persistently retains the last decoded MPEG frame until the next room loads, matching authentic Philips hardware.
  • Ultra CD-i Soccer (Europe): Resolved infinite startup spin loop by accurately adhering to the Motorola/Philips MCD-212 hardware specification for PAL 280-line active display timing, allowing scanline 289 to generate the Level 5 IRQ required by OS-9.

System BIOS & Required Files

Due to copyright restrictions, system ROMs are not bundled and must be provided by the user inside the bios/ folder or next to opencdi.exe:

Component Recommended Filename Supported Alternatives Exact Size SHA-1 Checksum Status
System BIOS cdi220b.rom cdi220.rom, cdi200.rom, cdi490a.rom 524,288 bytes (512 KB) 53360a1f21ddac952e95306ced64186a3fc0b93e Mandatory
DVC ROM (FMV) vmpega.rom impega.rom 262,144 bytes (256 KB) be407fbc102f1731a0862554855e963e5a47c17b Required for MPEG titles
Timekeeper NVRAM nvram_mk48t08.bin nvram.bin 8,192 bytes (8 KB) 601d780e1544985352535143705ffcc670d282d1 Optional (Auto-created)

Quick Start Guide

  1. Download and extract opencdi-v0.1.7-windows-x64.zip.
  2. Place cdi220b.rom (and vmpega.rom for MPEG video games) inside the bios/ folder.
  3. Drag and drop any .chd, .iso, or .bin/.cue CD-i disc image directly onto opencdi.exe (or launch Launch_OpenCDi.bat).
Release notes · 2 files

OpenCDi v0.1.6 (Release Notes)

OpenCDi v0.1.6 brings major input responsiveness refinements, authentic sub-pixel coordinate tracking, fixes for audio/video stream synchronization on the Digital Video Cartridge (DVC), and enhanced disc compatibility.

?? Input & Controls Improvements

  • Authentic Steady Gamepad Speed: Replaced aggressive integer coordinate jumps with an authentic, steady speed of 2.5 pixels per frame.
  • Continuous f32 Sub-Pixel Accumulation: Eliminated coordinate snapping and fixed-position jumps in the standalone disc-less dashboard. Motion is now completely linear, smooth, and progressive.
  • Center-Anchored Resting Coordinates: Cursors start centered at (384, 280) on standalone boot, system Reset, and disc Eject.
  • Zero-Drift Position Hold: Upon releasing the D-pad, coordinates hold their exact position without snapping back or drifting.
  • Slave HLE In-Flight Packet Staging: Implemented staged buffer queuing for in-flight CH0 mouse/pad packets and authentic 3-byte C0 warp position decoding matching real 68HC05 microcontroller behavior.
  • Strict Mutual Exclusion: Gamepad D-pad/buttons and mouse inputs are strictly segregated to avoid packet collisions and contradictory coordinate streams.

?? DVC (Digital Video Cartridge / MPEG-1) Fixes

  • The 7th Guest Hallway Progression Fix: Resolved the hallway freeze post-ghost cutscene (avm_play: Still busy from last play $8000). Temporary audio FIFO buffer drains strictly assert hardware underflow (FMA_IRQ_UNF) rather than prematurely firing FMA_IRQ_EOI (End of Item), allowing the remaining 45 audio sectors to finish streaming down to sector 246955 (second EOR).
  • Independent Stream EOS Handling: Video sequence completion in on_vsync only asserts audio FMA_IRQ_EOI if audio does not have a dedicated FMA DMA channel (!self.fma_dma_seen).
  • Dynamic DVC Detection & Controls: DVC hardware is fitted by default when dvc/vmpega.rom is present and preserved across disc swaps; interactive toggle added to the Win32 menu and CLI (--no-dvc).

?? CD-ROM & Disc Compatibility

  • Multi-Track & Multi-File Video CD (White Book) Support: Added native support for multi-track and multi-file CUE/BIN images (e.g. Kilby Predicts and Gateway to the Mind).
  • Dynamic Subcode Q TOC: Dynamically generates TOC packets (0xA0, 0xA1, 0xA2, 0x01..0xNN) based on disc structure and disc type (0x20 for White Book VCD Bridge, 0x10 for standard CD-i).
  • Hot-Swap Disc Support: Added non-resetting hot-swap disc switching for multi-CD titles like Creature Shock.

?? Setup & Running

  1. Download the attached opencdi-v0.1.6-windows-x64.zip and extract it.
  2. Place the required BIOS file cdi220b.rom (and optional DVC ROM vmpega.rom) in the bios/ folder.
  3. Run Avvia_OpenCDi.bat or drag and drop any .chd disc image directly onto opencdi.exe.
Release notes · 1 file

OpenCDi v0.1.3 — Initial Public Release

Welcome to the first public release of OpenCDi, an open-source Philips CD-i emulator written in Rust designed for accuracy, performance, and preservation.


Highlights & Architecture

  • CPU: Philips SCC68070 (68000/68010 instructions, on-chip DMA, UART, timers).
  • Video: Philips MCD-212 Display Controller:
    • Dual-plane rendering (Plane A & Plane B) with hardware backdrop.
    • Supported graphics modes: CLUT4, CLUT7, CLUT8, Run-Length (7/8-bit), DYUV, and RGB555.
    • Line-by-line ICA/DCA instruction lists execution.
  • Audio & Disc: CDIC controller with CD-DA and ADPCM Level A/B/C audio decoding; native CHD support.
  • DVC (Digital Video Cartridge / MPEG-1):
    • Integrated hardware MPEG-1 system demuxer (video & audio stream separation).
    • Video decoding and MCD-212 video compositing.
    • End-of-sequence drain and presentation timestamp synchronization.
  • Input & Peripherals: HLE 68HC05 Slave microcontroller supporting keyboard, mouse, and gamepads.

Verified Titles

  • Hotel Mario: Fully playable with in-game action, animations, and CD-i ADPCM sound.
  • Striker Pro: In-game gameplay, menus, and match audio.
  • Dragon's Lair (USA): Continuous attract mode and interactive gameplay with active MPEG FMV.
  • The 7th Guest: Boots, plays intro cutscenes, and advances through scenes.
  • Lost Eden: Boots with cutscenes and character dialogue.

Quick Start Guide

  1. Download and extract opencdi-v0.1.3-windows-x64.zip.
  2. Place the Philips CD-i BIOS (cdi220b.rom) and the DVC ROM (vmpega.rom) inside the bios/ folder (or next to opencdi.exe).
  3. Drag and drop any .chd CD-i game disc image directly onto opencdi.exe or launch Avvia_OpenCDi.bat.

Community & Contributions

OpenCDi is open-source under the MIT License. Feedback, game compatibility reports, and pull requests are warmly welcome!