pureikyubu/SRC/DVD
2020-08-09 22:49:43 +03:00
..
Scripts Changed libraries to SHARED 2020-08-09 22:49:43 +03:00
DduCommands.cpp More portable code 2020-08-08 20:10:33 +03:00
DduCommands.h Paths fixed for pissed linux 2020-08-09 21:36:10 +03:00
DduCore.cpp Thread Workers instead ThreadProc 2020-08-09 16:28:22 +03:00
DduCore.h Refactored header includes 2020-07-23 17:00:48 +03:00
DVD.cpp First wave refactoring (remove TCHAR) 2020-08-06 22:18:38 +03:00
DVD.h First wave refactoring (remove TCHAR) 2020-08-06 22:18:38 +03:00
DvdAdpcmDecode.cpp More portable code 2020-08-08 20:10:33 +03:00
DvdAdpcmDecode.h Preliminary dvd adpcm decoder 2020-04-08 02:55:48 +03:00
DvdStructs.h Cpp alike structs 2020-06-28 16:01:58 +03:00
FileSystem.cpp More portable code 2020-08-08 20:10:33 +03:00
FileSystem.h Memory leaks 2020-08-04 02:02:35 +03:00
GCM.cpp Another part of portable code 2020-08-09 12:46:30 +03:00
GCM.h First wave refactoring (remove TCHAR) 2020-08-06 22:18:38 +03:00
Mn102Analyzer.cpp Another part of portable code 2020-08-09 12:46:30 +03:00
Mn102Analyzer.h Another part of portable code 2020-08-09 12:46:30 +03:00
Mn102Disasm.cpp Another part of portable code 2020-08-09 12:46:30 +03:00
Mn102Disasm.h Mn102 disassembler 2020-04-07 22:21:50 +03:00
MountSDK.cpp Another part of portable code 2020-08-09 12:46:30 +03:00
MountSDK.h First wave refactoring (remove TCHAR) 2020-08-06 22:18:38 +03:00
pch.cpp DVD WIP 2020-03-29 15:14:29 +03:00
pch.h Another part of portable code 2020-08-09 12:46:30 +03:00
Readme.md AdpcmDecoder re 2020-04-08 01:41:10 +03:00
Region.cpp Small UI fixes 2020-07-30 22:16:47 +03:00
Region.h Small UI fixes 2020-07-30 22:16:47 +03:00

DVD

This component implements everything you need for a healthy emulation of the GameCube disk drive unit (DDU).

There are currently two ways to read virtual DVDs:

  • Read sectors of a mounted GC DVD image (GCM)
  • Reading sectors of a virtual disk mounted as a DolphinSDK folder. Required for comfortable launch of DolphinSDK demos

DDU Core

This component is designed to emulate the DDU controller. DduCore provides a host interface (Flipper) close to the actual DDU connector interface (P9).

That is, DduCore honestly tries to process transactions via DDU Bus, various control signals (BRK, RST), as well as emulation of the DVD Audio stream.

On the host side (/HW/DI.cpp), the DI part is implemented, which is responsible for transmitting a 12-byte DDU command and processing following transactions via the DDU Bus (in the Immediate buffer or Main Memory via DMA).

If you are going to understand DduCore, just imagine that the DduCore API is just signals from the DDU connector (P9).

The documentation for DiskInterface is located somewhere in Docs/HW.

DDU Transaction Rate

In the official documentation there is a number of the minimum data transfer rate - 2 MByte/sec.

If the DDU does not manage to transmit the required amount of information and the Gekko Decrementer (OSAlarm) triggers before the DI TCINT interrupt, the game usually displays the message "Refer to the Instruction Booklet". This means that the DDU does what is called "Babble."

Therefore, set the timings so that the transaction speed of DduCore fits into 2 MByte/sec in accordance with the Gekko TBR timer.

Since the processor and DDU threads work in parallel to avoid babbling when reading the image (fread), the ExecuteCommand method receives a hint from the command packet with the transaction size, so that it can pre-cache DVD data from the image.

DVD Microcontroller(s)

It is not very clear yet how many controllers there are, how much RAM is inside the controller(s) and outside. Need to study the DDU motherboard.

But apparently the Firmware for this entire system is single - 128 KBytes. Dumps for several DDU models can be found on the internet.

  • Matsushita MN103S13BGA Optical Disk Controller
  • Matsushita MN102H60GFA MicroComputer

MemoryMap:

start end size description
0x00008000 4 Kbyte internal (cpu) ram
0x00080000 128 KByte Firmware ROM. Reading the firmware at its reallocation is prevented by the debug commands (immbuffer will not be changed at all). however you can read its contents from the memory mirrors, ie 0x000a0000
0x00400000 internal (controller) ram

(Source: YAGCD)

What is cpu and what is controller is not very clear. If there are two of them, then how does one get direct access to the memory of the other? And if the second one is also based on the processor core, then where is its firmware?

The current implementation is limited by the MN102 instruction analyzer and the disassembler for DVD firmware reversing (planning to find the ADPCM decoder algorithm there).

DDU JDI

The debugging interface specification provided by this component can be found in Data\DduJdi.json.