# The CDVD drive and the MechaCon Sources: ps2tek "CDVD Drive", "CDVD I/O Ports", "CDVD N/S Commands", "CDVD Reads and Seeks", "SECRMAN" (tier 3); israpps/ps2tek `PS2/MECHACON/` (tier 3; its introduction credits psdevwiki, whose site is set aside for its wishes: those sentences are marked "via psdevwiki" below); the Redump BIOS Images set for firmware SHA-1s (census.md). No Sony document on the drive is among the pinned manuals. No hardware-captured test for the drive exists among the pinned tests; F0bes' `hwtest-cdvd` (no licence) is a candidate to run only, not fetched. ## What the IOP sees Registers at 1F402004h-1F402018h (ps2tek "CDVD I/O Ports"): an **N command** register (asynchronous: seeks, reads, pauses, disc type), its status and parameter port, an error byte, BREAK, CDVD I_STAT, drive status, disc type, and an **S command** register (synchronous: RTC read/write, the MechaCon version, tray and sticky flags, NVRAM, the security commands) with its parameter and result ports. Reads finish into IOP DMA channel 3 and raise IOP IRQ2 (iop.md). Read timing as ps2tek gives it (tier 3, from PCSX2's model by its own account: "8/16 is used for CD/DVD respectively in PCSX2"): a sector takes `IOP_CLOCK x block_size / read_speed` IOP cycles with read_speed 24 x 153,600 bytes/s for CD and 4 x 1,382,400 for DVD; a seek from a stopped drive takes 333 ms; a full seek about 100 ms; contiguous reads cost one block time per sector of delta. **These are an emulator's fitted numbers**, so the specification tags them OBSERVED (tier 5) until measured: **U35**. ## The MechaCon: a separate CPU The drive is run by the **MechaCon**, a microcontroller with its own firmware. Two generations (israpps/ps2tek MECHACON README, via psdevwiki): - G-chassis and earlier: Sony **CXP10xxxx**, an SPC970 core (16-bit) at 33.8688 MHz; the separate SysCon, RTC and EEPROM chips beside it. - H-chassis on ("Dragon"): Sony **CXR7xxxxx**, an **ARM7TDMI** (Sony SR11 core, ARMv4T, ARM and Thumb), 16 KB RAM, which also absorbs the SysCon, RTC and EEPROM. It is also the **security processor**: "the CDVD Drive ... contains the actual MagicGate keys" (ps2tek "SECRMAN"): disc authentication, MagicGate decryption of KELF executables (DVD player, system updates) and memory card authentication go through it. **Firmware on hand** (census.md): the Redump BIOS Images set holds **14 MechaCon dumps** of 278,528 bytes (`ps2-mechacon-500` ... `-612`), the size of the Dragon generation's images (HYPOTHESIS from the version numbers: v5.x/v6.x on H-chassis and later). SHA-1s only; never copied. ## HLE or LLE (decision P8) | | HLE: the drive as a command-level model | LLE: run the MechaCon's firmware on a CPU core | | --- | --- | --- | | Needs | a model of the N and S commands, statuses and timings; a disc-image reader | an ARM7TDMI (`../arm7tdmi-python` exists; ARMv4T is its ISA) or an SPC970 core (none in the family), the MechaCon's peripherals (servo, DSP, the drive mechanics), the player's firmware dump | | Keys | **none shipped**. Authentication paths answer as a legitimate drive would where the answer does not depend on secret keys; where it does (MagicGate card auth, KELF decryption), the HLE cannot produce it without keys: those features are absent, named in the capability record | the keys are inside the player's firmware dump; nothing is shipped | | Timing evidence | none beyond an emulator's fitted numbers (U35) | the firmware's own timing, but the drive's mechanics (spin-up, seek, servo) are analogue and as unmeasured as HLE's delays | | Cost | small | a second embedded CPU per frame plus a mechanism model; arm7tdmi-python reuse is real (an ARM7TDMI is exactly what it is) | **Recommendation:** HLE first, as psx-python chose for its CD controller (its decision 1), with the LLE as a later **referee** for command responses and relative timings, run on arm7tdmi-python with a Dragon dump the player supplies. Games mostly need reads, seeks, disc type, RTC and NVRAM, which HLE can answer without keys; what needs keys (memory card MagicGate authentication, KELF loading) is out of scope until LLE exists, and the capability record says so. Whether retail games authenticate memory cards at all, or only the BIOS's browser and SECRMAN's users do, is **U36** (it decides how much the HLE must answer). Disc formats: Redump's PS2 DVDs are `.iso` (single and dual layer), CDs `.cue/.bin` (census.md). The layer break of DVD-9 images is in the image's DVD structure, which the reader must find (U37). ## Unknowns U35 drive timings (all tier 5 today); U36 which software authenticates memory cards; U37 DVD-9 layer break handling; U38 the MechaCon version bytes each CDVDMAN checks (ps2tek: "Newer versions of CDVDMAN do checks on them of some sort"); U39 the S-command set per MechaCon generation.