I was working on auto-detecting dual-layer wii discs in CleanRip, but my intitial idea to detect this wasn't very clever anyways.
Please take a look: https://github.com/emukidid/cleanrip/pull/73
(I hope this is the correct sub-forum to ask this question.)
AdmiralCurtiss pointed out this idea:
> Can't you instead try to do a read of a sector past the single layer disc limit and see if it succeeds or not?
CleanRip provides this function to read raw bytes:
But in my tests the function also returned 0, when reading past the size of single-layer disc. It also wrote the same bytes to *dst, when running multiple times, so it wasn't random garbage, but apparently garbage.
So i sporadically looked through Dolphin's code ( https://github.com/dolphin-emu/dolphin/t...ore/DiscIO ), but I did not find any details for dual-layer discs either.
WiiBrew ( https://wiibrew.org/wiki/Wii_Disc ) does also not list any sort of indication in the header of the wii disc, wether it's single or dual-layer.
I am curious if any dolphin dev maybe knows more about dual-layer discs and whats the best way to detect them.
Any help is appreciated! Thanks
Please take a look: https://github.com/emukidid/cleanrip/pull/73
(I hope this is the correct sub-forum to ask this question.)
AdmiralCurtiss pointed out this idea:
> Can't you instead try to do a read of a sector past the single layer disc limit and see if it succeeds or not?
CleanRip provides this function to read raw bytes:
Code:
/*
DVD_LowRead64(void* dst, unsigned int len, uint64_t offset)
Read Raw, needs to be on sector boundaries
Has 8,796,093,020,160 byte limit (8 TeraBytes)
Synchronous function.
return -1 if offset is out of range
*/
int DVD_LowRead64(void* dst, u32 len, uint64_t offset) {
if (offset >> 2 > 0xFFFFFFFF)
return -1;
if ((((u32) dst) & 0xC0000000) == 0x80000000) // cached?
dvd[0] = 0x2E;
dvd[1] = 0;
dvd[2] = read_cmd;
dvd[3] = read_cmd == DVDR ? offset >> 11 : offset >> 2;
dvd[4] = read_cmd == DVDR ? len >> 11 : len;
dvd[5] = (u32) dst & 0x1FFFFFFF;
dvd[6] = len;
dvd[7] = 3; // enable reading!
DCInvalidateRange(dst, len);
while (dvd[7] & 1)
LWP_YieldThread();
if (dvd[0] & 0x4)
return 1;
return 0;
}
But in my tests the function also returned 0, when reading past the size of single-layer disc. It also wrote the same bytes to *dst, when running multiple times, so it wasn't random garbage, but apparently garbage.
So i sporadically looked through Dolphin's code ( https://github.com/dolphin-emu/dolphin/t...ore/DiscIO ), but I did not find any details for dual-layer discs either.
WiiBrew ( https://wiibrew.org/wiki/Wii_Disc ) does also not list any sort of indication in the header of the wii disc, wether it's single or dual-layer.
I am curious if any dolphin dev maybe knows more about dual-layer discs and whats the best way to detect them.
Any help is appreciated! Thanks