Welcome! Log In Create A New Profile

Advanced

Problems using DVD drive

Posted by WiiDevD 
Problems using DVD drive
May 31, 2010 11:29PM
I'm currently trying to use the Wii's DVD drive to mount a data DVD. I looked at WiiMC's source and downloaded the di2.c/h and libdvdiso.c/h.
I also want to use IOS 202 instead of DVDX, just like WiiMC does.

So, I added those files to my project, and modified my main function to look like this:

int main(int argc, char **argv)
{
      //...
      IOS_ReloadIOS(202);
      if (IOS_GetVersion() == 202)
            WIIDVD_Init(false);

      printf("%d", IOS_GetVersion());
      //...
}

Now, with the WIIDVD_Init() line, it reloads to IOS 36 afterwards. It seems to reload IOS 202, like I told it to do, then init the DVD stuff and somewhere in there, reload back to IOS 36. As soon as I comment out that line, it sticks with IOS 202.
It doesn't seem to happen for WiiMC, so what am I missing here?
I'm using the same di2.c, di2.h, libdvdiso.c and libdvdiso.h files as WiiMC and the above shown part of the main function is also almost the same as in WiiMC.
Can anyone explain me what I'm doing wrong?

Thanks!
Re: Problems using DVD drive
June 01, 2010 11:09PM
It'd be just as good for you to do it the same as Snes9x GX. So do this:

// try to load IOS 202
	if(IOS_GetVersion() != 202 && FindIOS(202))
		IOS_ReloadIOS(202);

	if(IOS_GetVersion() == 202)
	{
		DI_LoadDVDX(false);
		DI_Init();
	}

Then you don't need di2.c/h and libdvdiso.c/h, just add -liso9660 to your makefile. Also see MountDVD() in fileop.cpp.
Re: Problems using DVD drive
June 02, 2010 12:59AM
Tantric, I tried it the way you told:

	DI_LoadDVDX(false);
	DI_Init(); //Returns 4
	
	//...
	
	ISO9660_Mount();

The problem is that ISO9660_Mount() instantly returns false, the DVD drive doesn't even make a sound like when it's reading a disc. When I comment out DI_LoadDVDX(false), it does make a sound like it should (it still doesn't mount the DVD though), but I still want it to work without DVDX.

__io_wiidvd.isInserted() does also return false, regardless of a DVD being inserted or not.
I'm clueless here, I'm still a beginner in Wii development.

Thanks for your help!



Edited 1 time(s). Last edit at 06/02/2010 01:01AM by WiiDevD.
Re: Problems using DVD drive
June 03, 2010 12:57AM
Well I'd also make sure IOS 202 was loaded. Are you sure that's happening? Also make sure DVD works on WiiMC/Snes9x GX for you.
Re: Problems using DVD drive
June 03, 2010 01:59AM
Yeah I do check if IOS 202 was loaded successfully, the code above was just written by hand and I was too lazy to add all extras :)

I already tested DVD with WiiMC and Snes9x GX and both worked excellent.
IOS 202 is installed via IOS 202 Installer from WiiMC.

Basically, I'm doing this:

	//Reload IOS 202

	if (GetIosVersion() == 202)
	{
		DI_LoadDVDX(false);
		DI_Init();
	}
	else exit(0);

	//Init Video, WPADs, ...

	if (ISO9660_Mount())
		printf("DVD mounted\n");
	else
		printf("DVD could not be mounted\n");

	//Wait for user to exit

In my makefile, I have both libs linked

LIBS :=	-ldi -liso9660

As I said before, the drive doesn't even make a sound and it also returns false instantly, usually it takes some time when trying to read/mount a disc, like you know.

I compiled WiiMC a while ago and DVDs worked in that version, so I'm sure it's not my setup.
I really don't see what I might be missing here?! Any ideas left?
Re: Problems using DVD drive
June 03, 2010 05:08AM
Maybe it's not your code, it's your libogc. Try compiling the latest from SVN and using that.
Re: Problems using DVD drive
June 04, 2010 01:20AM
I did that, but it wasn't the problem.
Now, the project where I tried all this was a libWiiGui project, it simply didn't display any GUI in this matter, because I exited before.
I made a new standard C project and inserted the code and it mounted the DVD.
There must be anything wrong with the libWiiGui project that prevents the DVD stuff from working. What could it be? It's basically the libWiiGui template project with some edits, I simply want to mount the DVD and display the files in a filebrowser for now.
Re: Problems using DVD drive
June 04, 2010 05:00PM
FYI, WiiXplorer can do that AFAIK. Perhaps not in "public" builds, but in the latest SVN builds at least, which are publicly downloadable. Obviously if you are intending to do more than just browse the files on the disc, that's no good, but if it uses libWiiGui (dunno if it does), perhaps you could look at its source?

EDIT: Yeah just checked it DOES use libWiiGui, so try looking at its source, it can definitely mount DVDs, so see if you can spot some difference or whatever. Link: [code.google.com]



Edited 1 time(s). Last edit at 06/04/2010 05:01PM by SifJar.
Sorry, only registered users may post in this forum.

Click here to login