Commit Graph

42 Commits

Author SHA1 Message Date
Andre Zeps
f7bd5d3d73 FMV: Improved frame pacing
- 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
2025-09-15 16:09:35 +02:00
Andre Zeps
b8f2a4852b FMV: Improved cropping and alignment
- Fixed horizontal size of pixels.
- Fixed vertical chroma subsampling alignment
- Removed fetch of pixel data when frame height is reached
2025-09-15 16:09:35 +02:00
Andre Zeps
1bde37ee45 FMV: Improved P and B frames
- 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
2025-09-12 16:36:04 +02:00
Andre Zeps
76a31b8527 Readded MPEG start code finder for FMV interrupts
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.
2025-09-09 12:43:40 +02: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
622284cb93 Added simulatable MPEG video decoder
- 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
2025-09-08 23:46:32 +02:00
Andre Zeps
a2a856226d Audiodecoder now processes elementary data instead of muxed
Saves lots of memory
Fixes support for very short MPEG files
pl_mpeg seems to be not able to demux short streams

Lucky Luke seems fine now
2025-07-27 19:47:21 +02:00
Andre Zeps
574617657a Verilator: Press B1 instead of B2
Noticed because Lucky Luke was not starting
2025-07-27 19:45:42 +02:00
Andre Zeps
68afa8ac86 Fixed audio decoder firmware to support one run of not decoding
Fixes Lucky Luke Philips Bumper

Also fixed Simulation of scrambled sectors
2025-07-27 19:45:42 +02:00
Andre Zeps
5abe195bff FMA Events now derived from DSP software
No longer faked
2025-07-27 19:43:16 +02:00
Andre Zeps
01ca354a9b Fixed stuffing bytes in MPEG packets
Fixes playback of Dragon's Lair intro audio
Of course no video yet and game hangs afterwards
2025-07-21 12:19:50 +02:00
Andre Zeps
9c2f3679b3 Utilized SCR for playback start 2025-07-20 12:02:53 +02:00
Andre Zeps
f47721fa34 Better buffer management
Fixes under and overflows.
2025-07-19 13:44:08 +02:00
Andre Zeps
a9091d515b MPEG Audio is working
Timing is still wrong
SkyWays music can be heard
2025-07-15 20:49:26 +02:00
Andre Zeps
01442563cc fixed clk audio
# Conflicts:
#	sim2/fma2.gtkw
2025-07-13 22:41:21 +02:00
Andre Zeps
01be50e887 should be more accurate. consider xfer as well 2025-06-30 19:53:37 +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
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
c5399ada89 MCD212: Display Active flag adapted to measured timing
- Seems to have no effect

Added some notes to the README
2025-04-06 12:13:03 +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
d53c682fcc CDIC: Rewritten audio state machine
- Changes based on findings of the CDIC_BlackBoxAnalyzer project
  - Removed side channel for audio coding
    - A real CDIC reads the audio coding always from RAM
  - Removed the concept of the audio tick found in MAME
    - A real CDIC performs audio playback asynchronous to the CD reading
- Seek time now 19 sectors
  - Fixes audio glitch in "Help cutscene" in "Zelda - Wand of Gamelon"
    "Remember, tools can only be used..."
- Fixes audio regression during "Hotel Mario" score screen
- Fixed spurious IRQ caused by sector data interrupt after reading stopped
  - Should fix hang on shopkeeper cutscene in "Zelda - Wand of Gamelon"
    (Cannot be reproduced or is very unlikely now)
2025-03-17 21:58:10 +01:00
Andre Zeps
b9707f84be MCD212: Added debug option for ICA execution line
- The new behavior based on 210/05 measurements
  added in 20250214 is hidden in the debug menu
- Original video timing from before is restored
- Fixes boot of "The Flowers of Robert Mapplethorpe"
2025-02-23 20:37:25 +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
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
Andre Zeps
d3deec71db CDIC: Add Seek command and subchannel data frame
- Fixes bootup of Flashback
- Change requires additional data from Main
  but is compatible with the previous Main as well.
2024-12-23 02:04:45 +01:00
Andre Zeps
6fdde4fc13 MCD212: Altered transparency calculations
- Fixes some invisible graphics
  in Tangram and PAWS.

Slightly more correct but still ignoring regions.
2024-12-23 01:37:46 +01:00
Andre Zeps
ada397c589 MCD212: Add support for the Standard bit
- Allows NTSC material being usable on PAL modes.
- Reduces horizontal resolution from 384 to 360 pixels
  and vertical resolution from 280 to 240.
- Fixes glitched graphics in Flashback intro.
  Game is still hanging after intro.
2024-12-23 01:37:46 +01:00
Andre Zeps
224b33c912 HPS: Added NvRAM backup and restore
Save files compatible with MAME.
It's just a 8kB memory dump
2024-12-12 07:29:13 +01:00
Andre Zeps
0f51aae7eb CDIC: Add audiomap and related features
- Added state management for audiomap usage
- Added coding dependent sector playback delay
- Basic seeking time simulation and constant data rate
- Removed debugging option to disable MODE2 filters
- Added a lot documentation about expectations of
  the CDIC to the code
- Splitted off all audio playback into seperate file
- Added DC bias filter to reduce pops between playbacks
- Fixed wrong sample during underflow of FIFO
- Added two sample delay for ADPCM
  Fixes frequent clicks and pops due to latency of ADPCM calculation
- Buffer management now equal to CDIC emulation of MAME
  Uses internal bank switching to avoid ADPCM overwrite
  Stabilizes intro of "Zelda's Adventure" and "Hotel Mario"

SCC68070: DMA support for transfer to CDIC memory

Added additional test roms to verify the additions

Known issues:
- Hotel Mario hangs during score screen
- Frog Feast hangs ingame
2024-11-15 12:18:55 +01:00
Andre Zeps
455e42414f Cleanup of simulation 2024-10-03 18:44:17 +02:00
Andre Zeps
2995dcb826 Add components for booting software from disc
- Implement data reading state machine in CDIC
- Implement required interface to HPS for reading
  cd sector data
- Add DMA support to CPU which is required
  by the CDIC driver to get sector data into main
  memory
- Add INT1 and INT2 to SCC68070
- Can boot into the demo of Frog Feast
- Servo HLE fixed to closed tray with
  inserted CDi medium
- Add video IRQ
2024-09-20 21:51:32 +02:00
Andre Zeps
a8aea63528 6805: fixed IRQ masking
also removed obsolete irq cooldown
2024-09-09 13:34:13 +02:00
Andre Zeps
d05f1fb295 Slave controller features
- Added servo controller SPI fake communication
  Behaves as a closed but empty tray
- Added pointing device emulation
  MiSTer joystick data used as input
  Behaves like a maneuvering device
- Added SCI IRQ to 6805 cpu core
- Added SPI and SCI to 6805 uC
- Fixed spurious 68k chip select for slave
- Added documentation about I2C to the Front LCD
- Simulated U3090MG no longer causes front panel button presses
  Lead to spurious IRQs before
- Removal of slave memory patches
2024-09-03 11:58:26 +02:00
Andre Zeps
15639a7953 Implement STAND signal
Removal of PAL/NTSC workaround
NTSC video currently not supported
2024-08-30 21:18:08 +02:00
Andre Zeps
dc5cb2e735 Second video channel and mouse cursor
- Added ICA1 and FILE1
- CLUT implemented as True Dual-Port RAM to allow
  writing and reading with two video channels
- Added weight calculations
- Mouse cursor
2024-08-26 21:50:07 +02:00
Andre Zeps
74bff4c5ce Removed slave rom from FPGA bitstream
Added ioctl_download for slave rom
boot0.rom is expected to be the main cpu rom
boot1.rom is expected to be the slave rom
2024-08-18 20:02:33 +02:00
Andre Zeps
738bd44379 Boot fixes and video implementation
- Attach display file and ICA to SDRAM
- Fixed byte order of 8 bit accesses by CPU
- Added SDRAM burst mode to fix video timing
- Fixed missing reset behavior of some components
- Added optional SDRAM zeroing
- Added SDRAM refresh during ROM download
- Added OS aware syscall parser to simulation
- Fixed SCC68070 on-chip interrupt autovector
- Fixed SCC68070 Timer0 frequency
- Added video pixel data FIFO
- Changed SDRAM auto refresh command
2024-08-17 22:32:51 +02:00
Andre Zeps
d20230609b Low level test functional
- SDRAM controller added
- fixed 6805 bus timing with clk enable signal
- fixed 6805 latch warnings in quartus
- added 6805 reset logic
- added 6805 ram zeroing after reset
- fixed synthesis and timing of CDIC memory
- MCD212 cpu bridge interfaces with SDRAM
- fixed NvRAM memory timing
- fixed spurious sdram access in reset
- removed fake display_active flag
- added SDRAM refresh logic
- added real UART to SCC68070
- switched simulation top level to real MiSTer core

video is corrupted and needs fixes
2024-07-29 20:52:21 +02:00
Andre Zeps
29005d5c2a MCD212 video demo
- CLUT7 RLE
- Video timing according to datasheet
- Example framebuffer in block ram
  as SDRAM interface is not finished yet
- simulation can export video signal to PNG
- design can be synthesized and fitted but CPU parts are not functional
2024-07-29 20:04:42 +02:00
Andre Zeps
b99ab86b09 First public release
- SCC68070 is booting cdi200.rom
- SLAVE is communicating with the CPU
- MCD212 only implements memory map
- IRQs incomplete
- CDIC missing
- MiSTer interface missing
2024-07-08 19:22:59 +02:00