- 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()
- 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
- Workaround for the pop at the end of the railroad ambience loop
in "The Lost Ride"
This is probably not the correct fix, since it seems
that the real VMPEG continues to do a subband synthesis to fade
out the playback. I don't even know how that works and
how I need to change pl_mpeg to do that.
- 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.
- Fixes data corruption when output
buffer is full with 26 frames
I was able to prove that 30 framebuffers
are not enough when allowing 26 of them
to be queued for viewing.
There is a certain distance between
allocation and actually offering the framebuffer
to the queue of ready frames.
It can reach up to 5 frames, it seems.
This is probably the result of B and P frames?
- 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.
- 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.
- 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
- 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.
- 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.
- 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 behavior is noticable on real hardware as well
If the MPEG header has no DTS, the PTS can be read
from 0x00E040A0 instead
I thought, this is essential for playback of very short
MPEG files but seems, it isn't? Having at least
one frame in the FIFO is more important, I guess
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.
- Reduces CPU load of decoder core
- Fixes playback of "Secret of Nimh (VCD)"
- Fixes freeze in the early minutes of
"Star Trek VI - Terre Inconnue (France) (Disc 1)"
There is no evidence yet for an indication by VMPEG driver code,
that the sequence header cache needs to be discarded.
The FMV bitstream decoder firmware will now check whether a header
exists during the startup of the decoding process.
If one exists, the cache is not used.
- Fixes regression between CDi_dvc_rc2 and CDi_dvc_rc3
caused by using a cached but wrong SEQ HDR
in an attempt to fix memory errors after resets.
The error is no longer occuring
- .bss segment erase no longer overwrites first word of .noinit
- .data segment no longer overwritten by itself
Also added an endurance test which scans through the video
and tries to encourage this issue
- Fixes regression with titles like Top Gun that
have MPEG files with different settings
Note: For some reason, this state has wrong frame periods.
Tested using coneheads.
Note: For some reason, this state has also wrong frame periods when fast forwarding in Top Gun and resuming the playback.
Note: This is the pain. The linker scripts were wrong.
_end hat the same address as .noinit.seq_hdr_conf causing
the first variable - the frame period - to be reset along with other .bss symbols.
I keep this commit as a memento and not squash it.
- Frame buffer indexes kept between resets
- Avoids display of not committed buffers
- Discard frames until first I frame
- Avoids corrupted graphics during scanning
- Sequence header configuration protected from restart
- Configuration validity stored outside of soft core
- Fixes continuing playback of "Coneheads" which
only has one SEQ header at the start of whole stream
- Fixes scanning through Top Gun
- 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