- 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()
- 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
- Fixes long videos with small frame size
- Fixes videos in "Les Guignols de l’Info"
A user has mentioned that "Les Guignols de l’Info" sometimes has problems with videos.
After analysis of "/cd/rtf/application.rtf" from said disc,
starting at byte position 0x11DEA000, it turns out that the
pictures in FIFO (0x0E040A4) can go up to 17 even on real hardware.
This has never happened before and I've assumed that 8 is the maximum.
This is an issue because DecodTS of fdrvs1 calculates the DTS of the next picture with
the formula GEN_DEC_TIM1 (0x0E040A0) - GEN_PINF (0x0E040A4) * GEN_PICT_RATE (0x0E040A8).
This means that GEN_DEC_TIM1 is constantly increasing but GEN_PINF was limited to 8
before. This resulted in having the next picture to show getting more and more out of reach
of V_SCR.
On real hardware, the FIFO reaches 14 until playback starts.
- 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
- Fixes width of VCDs according to the White book
- Current implementation uses next neighbor approach
as a first test. Linear filtering might be a better option.
This change is not 100% accurate to hardware. I can measure,
that at least my VMPEG DVC cuts off 1 pixel on the left
and 5 pixels on the right. I ignore this phenomenom for now
and show all 352 pixels, a VCD is delivering.
- VCUP and DCL IRQs should now behave like real hardware
- "FMV Moving Test" is now behaving as expected
DCL is not documented in any way. It's just that it seems
to occur at the same time as VCUP and a compare behaves differently
because of that
This library is not suited for playback of short MPEG files and
pauses in stream delivery at the same time.
If the stream has not enough data, frame generation is aborted.
So one would assume to just always wait until enough data
is there to decode. But that is trap, because short MPEG files
are never decoded on time.
This fix does 2 things
- If enough data for one frame to decode is available, communicate
at least 1 frame in the FIFO to the driver even so it is not yet
fully commited by pl_mpeg.
- Don't wait for data as soon as the driver has
instructed VMPEG to decode and play. I would guess that the buffer is
filled enough at that point to not underflow.
- Since my guess was wrong as underflows can still occur,
to abort the wait, the output buffer must be empty too.
There is also another fix here. The worker descriptor must now
be manually committed to increment the command counter.
Since waiting for data can now be aborted, it is possible
that a requested buffer for a worker descriptor needs to be thrown away,
which resulted into a wrong increment and an assertion failure ont the worker side.
- Increases computing power for pixel operations
- Fixes freeze at timecode 04:32 of
"Star Trek VI - Terre Inconnue (France) (Disc 1)"
during the shock wave scene
- 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.
Written values were stored but could not be read back
Concerning "Addams Family" - Disc 2, it crashed when entering the menu.
This was caused by a "Division by Zero" exception, resetting the machine.
This was caused by corrupted data, caused by double execution of the instructions
at 0x0275ed0 (program of the movie player) which causes a zero value at 0xD01D8A.
This problem already manifests even before the movie starts playback, but the crash itself is only occuring when the value is read.
This happens only when the movie player menu is opened.
All of this was caused by the values in mentioned registers being not the written ones but artificial ones when the VMPEG verilog implementation was first conceived.
So, this change does:
- Fixes "Division by Zero" when opening movie player menu with "Addams Family" - Disc 2
Fixes desynchronisation in fmvdrv after 18 minutes of Top Gun
Thanks to cdifan for pointing this out
Source:
http://icdia.co.uk/notes/technote097.pdf
TN #097 - The Full Motion System for CD-I,
section 4. ARCHITECTURE OF FULL MOTION CD-I PLAYER
VMPEG can be disabled via OSD
WIP
FMV: Increased soft core clock rate to 92 MHz
Was 80 MHz before, which wasn't enough
Fixes Top Gun CPU overload at timecode ~15:48
- 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
Only show data that was committed by the decoder.
Avoids scrambled graphics before playback starts.
Also added experimental "Last Picture Displayed" flag
- 25 fps hard coded for experiments
- Presentation time utilized to define start of playback
- Makes use of FIFO structure for stable frame rate
- Firmware
- Provides all 3 planar framebuffers to hardware for playback
- Added detection of MPEG stream overflows (for debugging)
- Reduced PLL for worker to 80 MHz (was 90 MHz before)
- Decoder core now running at worker speed (80 MHz instead of 30 MHz)
- MPEG Firmware
- Readded better FIFO level checks to avoid underflows
- Better buffer management to ensure immutability of decoded frames
- Frameplayer now switches framebuffer address when frame was decoded
- Added MPEG optimized data cache for DDR3 access to store 8 macroblock lines
Shows Dragon's Lair intro with less artefacts now.
Timing is not correct as the presentation time is not utilized
Skyways playable again
Dragon's Lair can enter gameplay again
In case of FMA this was done in software but
pl_mpeg doesn't really provide this info and
it can be done easily in hardware.
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
- MPEG video decoder based on pl_mpeg, executed
on 3 VexiiRiscv cores. One for decoding the stream and
two for pixel workings and IDCT.
- Added additional clock for MPEG workers
- Added hardware accelerated DCT coefficient huffman decoder
- Generalized MPEG demuxer design for video and audio
- Removed fake startcode decoder for video stream (for now)
- Expanded Verilator testbench with YUV to RGB conversion
to extract decoded MPEG frames
- Dragon's Lair Intro can be decoded with this (vmpeg.asm)
Design cannot be synthesized
- 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