66 Commits

Author SHA1 Message Date
Andre Zeps
266b32dddf Documentation and removal of unused code 2026-05-25 22:12:43 +02:00
Andre Zeps
2c0332e40e CDIC: Add support for Subchannel R..W
- Allows playback of CD+G
2026-05-25 22:12:43 +02:00
Andre Zeps
7f3be52193 FMV: Fixed regression of GOP Timecode
- Issue was introduced with 594bae844
- Fixes division by zero with Addams Family Disc 2 when
  opening playback controls
2026-05-02 19:07:03 +02:00
Andre Zeps
f0b54e9e8d Added screenshots from SignalTap during Main stall
PS3 Replug, Raw Screenshots and scaled screenshots

Also moved some files around
2026-05-02 19:07:03 +02:00
Andre Zeps
72169ba53a Fixed documentation about memory maps
Was still aligned to the MAME source code
2026-05-02 16:57:39 +02:00
Andre Zeps
2b2c222d82 SERVO: Perform machine reset when a CD image is remounted with a closed tray
- Remount is allowed without reset, when the CD wasn't read yet during power cycle
- Allows changing a disc with multi disc titles after application induced eject
- Added debug option to allow replacing the image during operation
- Also fixed tray close on image mount
2026-02-28 21:53:11 +01:00
Andre Zeps
c0faa4906e FMV: Added support for MPEG frame synced register updates
- Required for games like Lost Ride
- Partially breaks https://github.com/Slamy/CDi_FMVTest/tree/main/fmv_moving_window again
- Mechanism not yet fully understood
2026-02-22 14:12:37 +01:00
Andre Zeps
ec0ff3b771 FMA: Fixed regression with timing of buffer underflow IRQ
Fixes regression by 7e3d995781
2026-02-22 14:12:37 +01:00
Andre Zeps
112d467b92 FMV: Altered timing of DTS register
- Slightly improves stability of MPEG pause and continue
  with "Lost Ride"
  Still not 100% there...
2026-02-22 14:12:37 +01:00
Andre Zeps
594bae844e FMV: Fixed timing of frame events and parameters
- Decoupled SEQ event from GOP event.
  Now behaves like real VMPEG hardware
- Fixes Lost Ride gameplay after vehicle charge intro
- Fixes timing accuracy of temp ref and time code
  Measurable with mv_status()
2026-02-22 14:12:37 +01:00
Andre Zeps
176e9b6403 FMV: Add support for mid stream sequence parameter change
- Fixes graphical issues after vehicle charge intro
  in "Lost Ride"
2026-02-22 14:12:37 +01:00
Andre Zeps
66cf1711ca FMV: Add 65ms playback delay after SYSCMD Play
- Fixes MPEG buffer underflow with certain titles
  like "Mad Dog McCree"
- Measured on real hardware with 30 and 25 FPS MPEG stream.
  Display rate seems irrelevant
2026-02-22 14:12:37 +01:00
Andre Zeps
47addf7da0 FMA: Fixed MPEG Audio Frame Header Register
- Replaced stub with actual data from stream
- Fixes value of MAS_Head as returned by ma_status()
  - Stereo and Mono are correctly detected by VCD bridge
2026-02-22 14:12:37 +01:00
Andre Zeps
6674435be8 Added manual for usage with homebrew software 2026-02-20 15:28:45 +01:00
Andre Zeps
c6c211cd76 MCD212: Increased ROM bus bandwidth
- Was slightly slower than real hardware. Now slightly faster than real hardware.
- Fixes black flicker during the intro of "The Ultimate Noah’s Ark", when
  running in 60 Hz mode

This title is on the edge when it comes to using DC_PWrLCT just a few lines
before it is too late. This resulted into wrong mixing weights for single frames
2026-01-25 11:37:40 +01:00
Andre Zeps
84dd96fc43 MCD212: Fix latch timing of DYUV Abs. Start Value
- Ensure DCA completion before start value is utilized
- Fixes graphical corruption in "Lost Eden" during the character screen of "Dina"
2026-01-22 20:59:18 +01:00
Andre Zeps
43ce071e4f MCD212: Add Mosaic Pixel Hold effect
Since no commercial software seems to use this effect,
a custom test application was written for CLUT7 and CLUT4
video modes to compare against real hardware.
2026-01-22 20:59:18 +01:00
Andre Zeps
c029785c57 FMV: Added averaging filter to MPEG video during VCD pixel clock mode
- Isn't visible on CRT but improves perceived HDMI quality
- Can be deactivated in debug options to show the improvement
2026-01-22 20:59:18 +01:00
Andre Zeps
957ab71ae2 FMV: Added experimental slow motion and single step
- Added slow motion mode
- Added support for single step
- Fixes playback control problems with "Imagination in Motion - A New Era in 3D Chill Out Video"

This commit introduces technical debt
- The stepping mechanism is not fully understood
- Slow motion seems to desync audio and video when resuming normal playback

With the current state, the playback speed is still dictated
by the MPEG decoder. It might be possible, that this is wrong.
2026-01-16 19:02:03 +01:00
Andre Zeps
3732decfd6 FMV: Added FIFO full flag
- Fixes overflow of MPEG stream data, when
  pausing the playback via mv_pause()
  and causing a flood of data with mv_continue()
- Fixes pausing with
  "Imagination in Motion - A New Era in 3D Chill Out Video"

This doesn't fix scanning through this title.

Previously, there was an assumption that
MPEG data will never be shoveled in, faster than
the CD speed allows. This assumption is wrong
when the functions mv_pause() and mv_continue()
are involved. The FMV driver will not stop
uploading PCL data into the FMV buffer, because
the FIFO full flag was not yet implemented.

The FIFO level had to be moved around, because
it needs to be able to store at least 2324 byte
when not full.
2026-01-10 17:10:04 +01:00
Andre Zeps
65d49f5fb3 Add support for a secondary pointing device
- Optional, must be enabled in Hardware Config

The typical use case of a CD-i, based on
the Mono-I architecture, is the connection
of a pointing device to the front port or
the usage of an Ir Controller.
Both are handled by the SLAVE and usually
combined as the first pointing device.
The back port is available as a serial port.

For 2 players, the first pointing device
is connected to the back port.
During bootup, the operating system decides to
disable the serial port in favor of having
the first pointing device on the back.
The SLAVE doesn't know about this and
all input devices handled by it,
will be perceived as the second pointing device.
2026-01-09 17:16:23 +01:00
Andre Zeps
77c4a85d30 FMV: Allow up to 25 frames in picture FIFO
- Fixes long videos with even smaller frame size
- Fixes even more videos in "Les Guignols de l’Info"

This is the change of b8e3bac amplified.
The failing video this time is at seek position 0xB278800.
The previous one failing was 208x128, this one is
even smaller with 160x112.

It reaches a FIFO level of 21 until playback is started
even on real hardware.
2026-01-07 20:23:28 +01:00
Andre Zeps
80941cd718 FMV: Configured VCD pixel clock as 13.5 MHz
- Instead of going for full 352 pixels, we adapt the behavior
  according to real hardware, as it turns out that the software
  adapts to the misbehavior of it.
- Based on analysis of the Robocop VCD, this is required
  to go full screen
2026-01-04 12:37:18 +01:00
Andre Zeps
f45ae19bcc VMPEG: Added a debug option to disable the VCD pixel clock
Since the visual quality is subpar due to the clock stretching approach,
the core shall have an option to restore the previous behavior until
that problem is solved.

It was squeezed but pixel perfect and therefore might look better
for some users
2026-01-04 11:25:50 +01:00
Andre Zeps
fd68fef278 SERVO: Fixed disc type according to actual hardware (210/05)
- Required for the vcd module to even attempt detecting a VCD medium
2026-01-04 11:23:43 +01:00
Andre Zeps
06dc8cf866 FMA: Added MPEG Audio Attenuation
- Added DSP registers for storing the derived volume
  from the attenuation value
- Since the official LUT of the VMPEG is not known, a custom
  one is derived, based on measurements from the real machine
- Should make "Lost Eden" more pleasant, since this game attenuates
  the music during spoken dialog.

Compared to a real CD-i, I've decided to recycle the dual AD7528
of the base case to control the volume.
So, it is no longer a dual but a quadro configuration.
2026-01-03 22:14:23 +01:00
Andre Zeps
f855ffc493 FMV: Fixed some meta data returned by MV_Status
- Fixed temporal ref and both frame rate registers
- Effect on commerical titles unknown
2025-12-28 15:49:43 +01:00
Andre Zeps
92a47322d9 FMV: Fix occurrence of NIS event when playing another video
- Fixes soft lock of "Brain Dead 13" after company logo

Also decoupled frame display from FIFO consumption as the real hardware
will probably also do. I don't recall why I even made that change.
Partially reverts ca4216f95
2025-12-28 15:49:43 +01:00
Andre Zeps
502794a01c Cleanup of the README file
I've noticed that the README is constantly updated by the MiSTer downloader, even so
no new rbf file is provided.

I would like to avoid this, considering how often I update the Quartus statistics and TODOs.
2025-12-28 15:49:43 +01:00
Andre Zeps
ca4216f956 FMV: Added support for window, screen, display offset and NIS events
- Fixes wrong offset with "Les Guignols de l’Info"
- Fixes graphical corruption with "Christmas Crisis"
- Fixes "skewed image corruption" with MPEG video
- Adds support for NIS video event due to update of sequence parameters
- Fixes "Philips Logo Intro" with "Brain Dead 13"

Dynamic behavior is probably not yet correct.
- "Christmas Crisis" is stuttering in the bonus rides.

It should be noted that "Brain Dead 13" is still not working
after the company logo.
2025-12-18 13:30:33 +01:00
Andre Zeps
249adbfaef Simulation: Added syscall analysis
- Provides better insight into program flow
2025-12-15 22:37:24 +01:00
Andre Zeps
e2acb6c939 MCD212 documentation about measured timings
Also added screenshots from the Logic Analyzer
2025-11-23 21:10:11 +01:00
Andre Zeps
842b3f1d74 FMA: Fixed decoding flag in status register
- Fixes ASY_Stat info of MPEG Audio handle
- Fixes perpetual start-stop of music in "Lost Eden"
- Fixes early stop of playback in "Les Guignols de l’Info"
- Fixes audio stop of "Mutant Rampage: Bodyslam" after music has played
- Fixes current stream id as returned by ma_status()
  This might not have an effect at all but it is more accurate
2025-11-23 21:10:11 +01:00
Andre Zeps
f3437725e8 FMV: Increased decoder clock rate to 86 MHz
Also renamed a number of variables.
Early on 60 MHz was considered but was simply too slow.
2025-11-02 13:11:41 +01:00
Andre Zeps
142207fcca FMV: Increased accuracy of video IRQs
- Added EOI - ISO 11172 End Code detection in demuxer
- Added EOS - Sequence End Code detection in decoder firmware
- SEQ, GOP and PIC no longer generated by bitstream decoder
- PIC now aligned to vblank before a new picture is shown
- SEQ and GOP now aligned to PIC when its the first I frame of a GOP
- LPD now aligned to PIC when it was the last picture
- BUF - Buffer underflow now detected by firmware
- Added pictures in FIFO register (00E040A4)
- Added DTS register (00E040A0)
- Added VDI register for DTS updates (0E0408C)
- FMV Playback start no longer decided by demuxer but by VMPEG ROM
- Added pixel width calculation for later use

- Fixes hang at the end of the Space Ace Intro

Names of events to according
https://github.com/TwBurn/cdi-docs/blob/main/mv_cbnd.md#mv_trigger-define-mpeg-video-events-to-signal
2025-11-02 13:11:41 +01:00
Andre Zeps
2aee070bd7 MPEG video decoder synthesizable for MiSTer
Replaced memory arrays of video decoder with dual port RAM for FPGA usage
Added planar YCbCr frame player to display decoded frames
Added DDR3 interface for frame player and pixel worker
Added DDR3 interface mux for multiple masters
MCD212: Added EV bit usage to replace backdrop with external video

Shows Dragon's Lair intro with artefacts on MiSTer
because the worker currently cannot read from DDR3
For some reason, the EV bit is not working correctly
2025-09-09 00:06:42 +02:00
Andre Zeps
b06784da6f Added VMPEG Vsync interrupt
Fixes bootup of Lucky Luke
No audio in game afterwards
2025-07-21 21:30:06 +02:00
Andre Zeps
3fac9e7b67 DVC test with SkyWays
Game is running, MPEG implementation is faking the process
No actual MPEG decoding involved
2025-06-11 18:48:11 +02:00
Andre Zeps
3c3d4e4c4d Quality of life: Auto Play
- Added auto play via playcdi kernel module (by cdifan)
  Replaces system shell when activated via OSD.
  Only takes effect on CD-i discs.
2025-04-18 22:01:32 +02:00
Andre Zeps
9b29abaa23 Reduced boot time by fixing bus error accuracy
Philips Logo now shown at frame 120 (50 Hz)
Previously it was shown at frame 188 (50 Hz)

Measurements taken with Verilator and CPU Turbo
2025-04-18 21:26:11 +02:00
Andre Zeps
91450d6ca5 68HC05: Added Input Capture registers and adjusted clock frequency
- Added clock divider to get 0.5 MHz from 30 MHz system clock
  The system timer tick now occurs every 8.1ms like it does on a 210/05

- Added reset delay mechanism to fix the resulting time out when polling
  for the PAL/NTSC status.
  This occurs when the m68k is overclocked

- Added captured RC5 test data to confirm compatibility with the
  Thumbstick remote controller in a simulated environment
2025-04-14 09:54:22 +02:00
Andre Zeps
28395d7ba9 SERVO: Simulate tray operation
- Can be opened and closed
- Avoids reading of an empty tray
2025-03-29 15:20:04 +01:00
Andre Zeps
8579145c66 AD7528: Reduces volume of input to 56%
- Approximates the clipping behavior of a CDI 210/05
- Required to fit the theoretical 17 bit output
  into the 16 bit PCM signal of the MiSTer
- Fixes sound distortion in Hotel Mario
2025-03-28 19:27:09 +01:00
Andre Zeps
2c5b60519e CDIC: Rework of audio player state machine
- Removal of Tick wait counter
  It was an artifact only required by software emulators
- Added abort of playback
  Fixes some audio map related sound glitches in Zelda's Adventure
- Added mysterious bit reset
  Forces Unmute during Audio Channel playback
  Full function not yet understood

AD7528: Added instances for stereo mixing

- Fixes audio panning in Zelda's Adventure
- Fixes stereo to mono mixing (SFX + BGM)
  - Hotel Mario
  - Zelda - Wand of Gamelon
2025-02-14 20:54:19 +01:00
Andre Zeps
3f282a3677 Avoid HPS request without mounted CD 2025-01-18 14:54:03 +01:00
Andre Zeps
85d48a7dcc SERVO: Experimental Audio CD disk type
Allows starting with Audio CD in tray
instead of CD-i medium
2025-01-17 20:40:53 +01:00
Andre Zeps
215d4aae82 MCD212: Limited to full range scaling
Just an experiment
Can be activated with debug options
2025-01-17 20:23:41 +01:00
Andre Zeps
53a483951d CDIC: Fixed subchannel data for CDDA
Also introduces negative LBA for TOC reading
2025-01-17 20:21:32 +01:00
Andre Zeps
22cb55b4f7 Board: Added DVC memory
Extended the available memory by 1.5MB
According to memory map of MAME
Allows playing "The Apprentice" with SFX
2025-01-12 18:49:32 +01:00
Andre Zeps
e0991d0753 CDIC: Added experimental CDDA support
- Fixes audio in "The Apprentice (USA)"
- Adds stub TOC to satisfy "The Apprentice (USA)"
  during starting phase
2024-12-30 15:39:31 +01:00