Line 629:
Line 629:
The output buffer size must be ≥ 0x20, or DIMAR and DILENGTH will not be written. It must also be 32-bit aligned, or else the driver will hang.
The output buffer size must be ≥ 0x20, or DIMAR and DILENGTH will not be written. It must also be 32-bit aligned, or else the driver will hang.
+
+
Note that YAGCD is incorrect and there is actually one additional byte after the drive date, [https://web.archive.org/web/20070602090342/http://www.crazynation.org/GC/GC_DD_TECH/GCTech.htm apparently] indicating the version. This is not new to the Wii.
DICMDBUF0 = 0x12000000
DICMDBUF0 = 0x12000000
Line 1,079:
Line 1,081:
Original purpose unknown. Does not work on retail drives.
Original purpose unknown. Does not work on retail drives.
โ
Nintendo titles send this after performing the off-disc DVDLowUnencryptedRead check to verify that they are on official hardware; specifically, the first parameter is set to 4 (internally, 0x40000 >> 16) and the second parameter is set to 0. If this call returns anything other than 2, the "An error has occurred" message will be shown. If the drive error is anything other than 0x0053100 (OK/(Wii-exclusive?) error not in yagcd) or 0x0052000 (OK/Invalid command operation code), the "Error #001" message will be shown.
+
Nintendo titles send this after performing the off-disc DVDLowUnencryptedRead check to verify that they are on official hardware; specifically, the first parameter is set to 4 (internally, 0x40000 >> 16) and the second parameter is set to 0. If this call returns anything other than 2, the "An error has occurred" message will be shown. If the drive error is anything other than 0x0053100 (OK/Invalid Request Medium Format Corrupted) or 0x0052000 (OK/Invalid command operation code), the "Error #001" message will be shown.
The output buffer size must be ≥ 0x20, or DIMAR and DILENGTH will not be written. Last_DILENGTH is reset to 0 after completion. The output buffer also needs to be 32-byte aligned, or else the driver will hang.
The output buffer size must be ≥ 0x20, or DIMAR and DILENGTH will not be written. Last_DILENGTH is reset to 0 after completion. The output buffer also needs to be 32-byte aligned, or else the driver will hang.
Line 1,382:
Line 1,384:
The contents of DIIMMBUF (u32) are written to the output buffer. The output buffer size is not checked, but 4 would be a sane value.
The contents of DIIMMBUF (u32) are written to the output buffer. The output buffer size is not checked, but 4 would be a sane value.
โ
See [http://hitmen.c02.at/files/yagcd/yagcd/chap5.html#sec5.7.3.5 yagcd ยง5.7.3.5] for a list of error codes.
+
See [http://hitmen.c02.at/files/yagcd/yagcd/chap5.html#sec5.7.3.5 yagcd ยง5.7.3.5] for a partial list of error codes. Byte 4 is as described in yagcd. The 3rd byte an [http://www.t10.org/lists/2sensekey.htm SCSI Sense Key], and bytes 2 and 1 are [http://www.t10.org/lists/asc-num.htm SCSI ASC/ASCQ].
DICMDBUF0 = 0xE0000000
DICMDBUF0 = 0xE0000000
Line 1,400:
Line 1,402:
=== 0xE1 Play Audio Stream ===
=== 0xE1 Play Audio Stream ===
โ
Plays an audio stream, according to [http://hitmen.c02.at/files/yagcd/yagcd/chap5.html#sec5.7.1 yagcd ยง5.7.1]{{check}}. It's not clear where the stream is played <em>to</em>.
+
Plays an audio stream, according to [http://hitmen.c02.at/files/yagcd/yagcd/chap5.html#sec5.7.1 yagcd ยง5.7.1] and [https://web.archive.org/web/20070602090342/http://www.crazynation.org/GC/GC_DD_TECH/GCTech.htm this article]{{check}}. The audio stream is played through the [[Hardware/Audio Interface|Audio Interface]]. Audio is almost certainly not decrypted, making this command useless for Wii games{{check}}.
The output buffer is not used, and it may be null. Its size is not checked.
The output buffer is not used, and it may be null. Its size is not checked.
โ
DICMDBUF0 = 0xE1000000 | ((param1 & 3) << 16) // E1000000, E1010000, E1020000, E1030000
+
DICMDBUF0 = 0xE1000000 | ((mode & 3) << 16) // E1000000, E1010000, E1020000, E1030000
DICMDBUF1 = position
DICMDBUF1 = position
DICMDBUF2 = length
DICMDBUF2 = length
DICR = TSTART
DICR = TSTART
+
+
Modes:
+
0: Immediately stop the current stream, and start the new one (if present)
+
1: Wait for the current stream to finish before starting the new one (if present)
+
2: Unknown
+
3: Unknown
+
+
If length and position are both 0, then audio streaming stops.
{| class="wikitable"
{| class="wikitable"
Line 1,421:
Line 1,431:
| 7
| 7
| u8
| u8
โ
| Param1
+
| Mode
|-
|-
| 8
| 8
Line 1,434:
Line 1,444:
=== 0xE2 Request Audio Status ===
=== 0xE2 Request Audio Status ===
โ
Requests information about an audio stream, according to [http://hitmen.c02.at/files/yagcd/yagcd/chap5.html#sec5.7.1 yagcd ยง5.7.1]{{check}}.
+
Requests information about an audio stream, according to [http://hitmen.c02.at/files/yagcd/yagcd/chap5.html#sec5.7.1 yagcd ยง5.7.1] and [https://web.archive.org/web/20070602090342/http://www.crazynation.org/GC/GC_DD_TECH/GCTech.htm this article]{{check}}.
โ
The output buffer is not used, and it may be null. Its size is not checked. This is somewhat odd, as yagcd says that the status is put into DIIMMBUF.
+
The output buffer is not used, and it may be null. Its size is not checked. This is somewhat odd, as the response is put into into DIIMMBUF.
โ
DICMDBUF0 = 0xE2000000 | ((param & 3) << 16) // E2000000, E2010000, E2020000, E2030000
+
DICMDBUF0 = 0xE2000000 | ((request & 3) << 16) // E2000000, E2010000, E2020000, E2030000
DICMDBUF1 = 0
DICMDBUF1 = 0
DICR = TSTART
DICR = TSTART
+
+
Requests:
+
* 0 → Is stream playing (sets DIIMMBUF to 0/1)
+
* 1 → Current playback address (sets DIIMMBUF to current location, with sector-level granularity, byte >> 2)
+
* 2 → Playback start address (sets DIIMBUF to the value previously configured from play audio stream)
+
* 3 → Playback length (sets DIIMBUF to the value previously configured from play audio stream)
{| class="wikitable"
{| class="wikitable"
Line 1,454:
Line 1,470:
| 7
| 7
| u8
| u8
โ
| Param
+
| Request
|}
|}
Line 1,487:
Line 1,503:
=== 0xE4 DVDLowAudioBufferConfig ===
=== 0xE4 DVDLowAudioBufferConfig ===
โ
Audio buffer(?) configuration.
+
Audio buffer configuration.
The contents of DIIMMBUF (u32) are written to the output buffer. The output buffer size is not checked, but 4 would be a sane value.
The contents of DIIMMBUF (u32) are written to the output buffer. The output buffer size is not checked, but 4 would be a sane value.
Line 1,494:
Line 1,510:
DICMDBUF1 = 0
DICMDBUF1 = 0
DICR = TSTART
DICR = TSTART
+
+
The system menu issues this based off of the audio streaming and streaming buffer size fields in the [[Wii Disc]] header; byte 8 indicates whether or not it is enabled and byte 9 indicates the buffer size (defaulting to 10 if set to 0 while streaming is enabled).
{| class="wikitable"
{| class="wikitable"
Line 1,511:
Line 1,529:
| 11
| 11
| u8
| u8
โ
| Param2
+
| Streaming buffer size
|}
|}