Line 23:
Line 23:
(DiIoctl) Note: This is normal for DVD software before 6-24
(DiIoctl) Note: This is normal for DVD software before 6-24
</pre></blockquote>
</pre></blockquote>
−
−
Fleshed out into a simple API called "WDVD": http://emergent.unpy.net/01212889187
== Return values ==
== Return values ==
Line 54:
Line 52:
| style="background: #ececec; color: #2C2C2C; vertical-align: middle; font-size: smaller; text-align: center;" class="table-na" | N/A
| style="background: #ececec; color: #2C2C2C; vertical-align: middle; font-size: smaller; text-align: center;" class="table-na" | N/A
| Returned after DVDLowWaitForCoverClose (0x79). Also could theoretically be or'd onto most other return values if a flag (<code>20209000</code>) is set, but this flag is never set.
| Returned after DVDLowWaitForCoverClose (0x79). Also could theoretically be or'd onto most other return values if a flag (<code>20209000</code>) is set, but this flag is never set.
+
|-
+
| 0x8
+
| style="background: #ececec; color: #2C2C2C; vertical-align: middle; font-size: smaller; text-align: center;" class="table-na" | N/A
+
| Not actually returned by any DI ioctls, but Nintendo's libraries will OR this value when breakRequested is true, and the bit is reserved for that purpose.
|-
|-
| 0x10
| 0x10
| 0x8000
| 0x8000
−
| Read timed out (took over 15000000µs, i.e. 15 seconds, to respond — seems unlikely in practice)
+
| Read timed out (took over 15000000µs, i.e. 15 seconds, to respond; this mainly happens when bad parameters result in DILENGTH not being written)
|-
|-
| 0x20
| 0x20
Line 154:
Line 156:
|}
|}
−
=== 0x90 DVDLowGetNoDiscOpenPartitionParams ===
+
=== <s>0x90 DVDLowGetNoDiscOpenPartitionParams</s> ===
<strong>Dummied out</strong>; always returns 0x80. However, still usable as an Ioctl (which is probably unintended). System menu 4.3U still has a PPC-side implementation (815504c4) but this is not used{{check}}.
<strong>Dummied out</strong>; always returns 0x80. However, still usable as an Ioctl (which is probably unintended). System menu 4.3U still has a PPC-side implementation (815504c4) but this is not used{{check}}.
−
=== 0x91 DVDLowNoDiscOpenPartition ===
+
=== <s>0x91 DVDLowNoDiscOpenPartition</s> ===
<strong>Dummied out</strong>; always returns 0x80. However, still usable as an Ioctl (which is probably unintended).
<strong>Dummied out</strong>; always returns 0x80. However, still usable as an Ioctl (which is probably unintended).
−
=== 0x92 DVDLowGetNoDiscBufferSizes ===
+
=== <s>0x92 DVDLowGetNoDiscBufferSizes</s> ===
<strong>Dummied out</strong>; always returns 0x80. However, still usable as an Ioctl (which is probably unintended). System menu 4.3U still has a PPC-side implementation (815502b8) but this is not used{{check}}.
<strong>Dummied out</strong>; always returns 0x80. However, still usable as an Ioctl (which is probably unintended). System menu 4.3U still has a PPC-side implementation (815502b8) but this is not used{{check}}.
Line 333:
Line 335:
|}
|}
−
=== 0x7A DVDLowGetCoverReg ===
+
=== 0x7A DVDLowGetCoverRegister ===
Stores the current value of DICVR into outbuf, which must be at least 4 bytes in size (or else 0x20 is returned). Note that Nintendo titles also refer to this as DVDLowPrepareCoverRegister, but that function simply asynchronously reads it into game memory so that it can be accessed by a separate function later. (A similar name pattern is found for the other get-reg commands.)
Stores the current value of DICVR into outbuf, which must be at least 4 bytes in size (or else 0x20 is returned). Note that Nintendo titles also refer to this as DVDLowPrepareCoverRegister, but that function simply asynchronously reads it into game memory so that it can be accessed by a separate function later. (A similar name pattern is found for the other get-reg commands.)
Line 348:
Line 350:
|}
|}
−
=== 0x83 Get last DILENGTH ===
+
=== 0x83 DVDLowGetLength ===
Stores the last DILENGTH value into outbuf, which must be at least 4 bytes in size (or else 0x20 is returned). Note that this doesn't directly read DILENGTH, but rather a separate value that is set when DILENGTH is set, but zero'd after reading for most commands. The only commands that leave a nonzero value are DVDLowInquiry and DVDLowRead (which doesn't even record the right field...).
Stores the last DILENGTH value into outbuf, which must be at least 4 bytes in size (or else 0x20 is returned). Note that this doesn't directly read DILENGTH, but rather a separate value that is set when DILENGTH is set, but zero'd after reading for most commands. The only commands that leave a nonzero value are DVDLowInquiry and DVDLowRead (which doesn't even record the right field...).
Line 378:
Line 380:
|}
|}
−
=== 0x85 Disable cover interrupt ===
+
=== 0x85 DVDLowUnmaskCoverInterrupt ===
Disables the cover interrupt by clearing bit 1 of DICVR (leaving bit zero unchanged). Does not clear the cover interrupt if it is currently asserted (does not write bit 2).
Disables the cover interrupt by clearing bit 1 of DICVR (leaving bit zero unchanged). Does not clear the cover interrupt if it is currently asserted (does not write bit 2).
Line 412:
Line 414:
|}
|}
−
=== 0x87 ===
+
=== <s>0x87</s> ===
−
Dummied out; does nothing (and always returns 1).
+
Dummied out; does nothing (and always returns 1). Possibly an ID reserved for a PPC-only command (DVDLowBreak?), as is also done with DVDLowSetSpinupFlag?
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.
Line 463:
Line 465:
|}
|}
−
=== 0x8B DVDLowOpenPartition ioctl ===
+
=== <s>0x8B DVDLowOpenPartition ioctl</s> ===
Returns 0x20 and prints a warning that "OPEN_PARTITION done through Ioctlv, not Ioctl".
Returns 0x20 and prints a warning that "OPEN_PARTITION done through Ioctlv, not Ioctl".
Line 497:
Line 499:
|}
|}
−
=== 0x95 Get DISR ===
+
=== 0x95 DVDLowGetStatusRegister ===
Stores the current value of DISR into outbuf, which must be at least 4 bytes in size (or else 0x20 is returned).
Stores the current value of DISR into outbuf, which must be at least 4 bytes in size (or else 0x20 is returned).
Line 512:
Line 514:
|}
|}
−
=== 0x96 Get DICR ===
+
=== 0x96 DVDLowGetControlRegister ===
Stores the current value of DICR into outbuf, which must be at least 4 bytes in size (or else 0x20 is returned).
Stores the current value of DICR into outbuf, which must be at least 4 bytes in size (or else 0x20 is returned).
Line 596:
Line 598:
This command immediately returns 0x20 if the buffer is too small, and also returns 0x20 if something went wrong with decryption or hashing and 2 for a drive error.
This command immediately returns 0x20 if the buffer is too small, and also returns 0x20 if something went wrong with decryption or hashing and 2 for a drive error.
−
If everything completed successfully, Last_DILENGTH is set to offset{{check}}. Otherwise, it is set to 0.
+
If everything completed successfully, Last_DILENGTH is set to offset. Otherwise, it is set to 0.
{| class="wikitable"
{| class="wikitable"
Line 632:
Line 634:
|}
|}
−
=== 0x7F DVDLowSetSpinupFlag ===
+
=== <s>0x7F DVDLowSetSpinupFlag</s> ===
+
+
Prints the message "(handleDiCommand) DI_SET_SPINUP_FLAG_CMD should have been executed in the PPC shim layer only" and returns 0x80.
−
Prints the message "(handleDiCommand) DI_SET_SPINUP_FLAG_CMD should have been executed in the PPC shim layer only" and returns 0x80. Maybe the PPC-side version of this command is related to the DI_SPIN [[Hardware/Hollywood_GPIOs|GPIO]]{{check}}?
+
The PPC-side simply stores a boolean which is later used as the parameter to DVDLowReset. For some reason, Nintendo decided to give it an ioctl number as well, even though it didn't need one.
{| class="wikitable"
{| class="wikitable"
Line 814:
Line 818:
DIMAR = dest
DIMAR = dest
DICR = TSTART|DMA
DICR = TSTART|DMA
+
+
Versions of IOS prior to IOS30 only permitted reads in the first range{{check}}. Nintendo titles check on startup if they are running an IOS ≥ 30 (and ≤ 253) and if so, perform some DI checks; specifically, they attempt to read 0x20 bytes from 0x460a0000 (or from 0x7ed40000 if the byte at 0x8000319c is 0x81 — possibly related to dual-layer discs?). If this read attempt returns anything other than 2, the game will refuse to start with the message "An error has occurred. Press the Eject Button, remove the Game Disc, and turn off the power to the console. Please read the Wii Operations Manual for further instructions." If the drive error is anything other than 0x0052100 (OK/Logical block address out of range), the game will refuse to start with the message "Error #001, unauthorized device has been detected."
{| class="wikitable"
{| class="wikitable"
Line 984:
Line 990:
=== 0xA4 DVDLowReportKey ===
=== 0xA4 DVDLowReportKey ===
−
Unknown. [https://github.com/dolphin-emu/dolphin/blob/71ff97cf1cf6ccaed34826a8f8d14cad0e292d7c/Source/Core/Core/HW/DVD/DVDInterface.cpp#L892-L898 According to dolphin], "Does not work on retail discs/drives. Retail games send this command to see if they are running on real retail hw."{{check}}
+
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.
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.