Gamecube DVD Protocol

From Wiki-Scene

Jump to: navigation, search


Gamecube Disk Drive replacement:

Contents

General ATA Data

Image:48LBA.gif

Image:ATA.gif

Image:SECTOR.gif

Signals

Important signals of the connector "P9" on the GC mainboard: DIDD: the 8 bit bidirectional data bus. DIHSTRB: Host strobe controlled by the GC which is an output used as a ready signal and a write strobe to the disk drive on the rising edge. DIDSTRB: Device strobe controlled by the disk drive used as a ready and write strobe. DIDIR: Direction line controlled by the GC; high=Drive->GC. DIRST: Reset active low. DICOVER: High = lid is open.


Transaction

A typical transaction looks like this for requesting data from the drive:

Image:GC_TIMING.gif

The transaction from the GC is always 12 bytes. The device responds by pulling DIDSTRB high after it receives the 3rd 32 bit packet. The transaction for sending data to the GC is the same. The timing diagram for it would look exactly the same as above except DIDIR will be inverted and device and host strobe swapped.

The Cycle

One cycle of AISLR = 32 cycles of AISCLK AISLR controlled by AI_STREAM_START/STOP

Image:AI_CLK1.gif

Image:AI_CLK2.gif

Initialization

Upon Power up or reset , 2 commands must be issued for proper use of audio streaming:

DVDReadDiskID A8000040,00000000,00000020 DVDLowAudioBufferConfig E4xx00yy,00000000,00000020

xx=byte 8 [0 or 1] from the disk header retrieved from DVDReadDiskID yy=0 (if xx=0) or 0xA (if xx=1)

Commands

All immediate commands [Ex] respond with 4 bytes.

Audio Status

DVDLowRequestAudioStatus E2xx0000 xx=0 is stream playing? response: 0,0,0,y y=1 yes;0=no

xx=1 what is the current address response: y,y,y,y y=address of current audio buffer that is burning on disk with 0x2000 granularity remember address is actaul byte offset>>2 i.e. it has a granularity of 0x8000 bytes which is 0x2000

xx=2 what was the start address of currently playing audio stream response: starting address of current audio stream >>2

xx=3 what was the length of currently playing audio stream response: length of current audio stream

DVDCancelStreamAsync

  • E1010000,xxxxxxxx,yyyyyyyy
  • response: 0,0,0,0
  • cancel current audio stream

DVDStopStreamAtEndAsync

  • E1000000,xxxxxxxx,yyyyyyyy
  • response: 0,0,0,0
  • start audio stream at x with length y
  • if x and y are zero then will stop audio stream at end of buffer.
  • if not zero then will add another stream to queue, when current one finishes

then next one will be played.

  • Queue is only 1 level deep, and is replaced by last command issued.

DVDLowInquiry

  • 12000000,00000000,00000020
  • response: 32 bytes with what appears to Date/Version info
  • 00,00,00,00
  • 20,02,04,02 Date code
  • 61,00,00,00 Version
  • rest are zero

DVDLowSeek

  • AB000000
  • seek to offset, reponse 4 bytes

DVDLowStopMotor

  • E3000000
  • stop motor

Door/Disc Status

To properly handle Door open and DIERRB:

When door is opened and command is issued [sometimes software doesnt check status of door open] assert DIERRB until E0000000 command is issued. Deassert DIERRB and send 4 byte response:

Error Responses:

high byte:

  • 00 Ready.
  • 01 Cover is opened.
  • 02 Disk change.
  • 03 No Disk.
  • 04 Motor stop.
  • 05 Disk ID not read.

low bytes:

  • 000000 No error.
  • 030200 No Seek complete.
  • 031100 UnRecoverd read error.
  • 052000 Invalid command operation code.
  • 052001 Audio Buffer not set.
  • 052100 Logical block address out of range.
  • 052400 Invalid Field in command packet.
  • 052401 Invalid audio command.
  • 052402 Configuration out of permitted period.
  • 062800 Medium may have changed.
  • 023A00 Medium not present / Cover opened.
  • 0B5A01 Operator medium removal request.
  • 056300 End of user area encountered on this track.
  • 020401 Disk ID not read.
  • 020400 Motor stopped.
  • 040800 Transfer protocol error.

Pinout

Image:Gamecube_dvd_connector.gif

Personal tools