Welcome! Log In Create A New Profile

Advanced

Wii game loader

Posted by pokeglobe 
Wii game loader
October 16, 2009 11:58AM
I am looking for some code to run wii games.

Does anyone have ocarina's source code? It's the smallest game loader i have ever seen.
GeckoOS would take forever to change.

Hope to find something!
Re: Wii game loader
October 17, 2009 01:03PM
Take the source of the old Gecko OS as base. It's more forward to launch games, the new Gecko OS does it a "little" more complicated using threads. Just look at the apploader.c file, and at everything that is started before running the apploader. If you remove the .dol patches, the stuff related to Wiird and/or Ocarina and everything that is related to 0x800018000, you get a basic game loader. I recommend using my mod for this:
[wiibrew.org]
Unoffical Gecko OS 1.07b with new 002fix, some game fixes and loading Ocarina from sd&usb
Because it has 1. a greater game compatiblity than the original 1.07b, 2. it is compilable with a recent libogc and 3. the source is actually available.

PS: Also remove the giant loop in main.c, it's related to usb gecko, and remove the usb gecko check of course.



Edited 1 time(s). Last edit at 10/17/2009 01:05PM by WiiPower.
Re: Wii game loader
October 18, 2009 01:29PM
Quote
pokeglobe
I used this to launch the game:
printf("\n    Launching Game...\n");
				hooktype = 1;
				memset((void*)0x80001800,0,kenobiwii_size);
				memcpy((void*)0x80001800,kenobiwii,kenobiwii_size); 
				DCFlushRange((void*)0x80001800,kenobiwii_size);
				apploader();

Is there a code I can add before apploader(); to change the language to default or english?
Thanks!

You need to cut all the language related stuff out, i said remove the main.dol patches. This is the loop where the patches are located:
	while (1)
	{
		void* dst = 0;
		int len = 0,offset = 0;
		int res = app_main(&dst, &len, &offset);
		
		if (!res){
			break;
		}

		dvddone = 0;
		ret = bwDVD_LowRead(dst,len,offset/4<<2,__dvd_readidcb);
		while(ret>=0 && dvddone==0);
		DCFlushRange(dst, len);

		dogamehooks(dst,len);
		if(vipatchon){
			vidolpatcher(dst,len);
		}
		if(debugmode){
			patchdebug(dst,len);
		}
		langpatcher(dst,len);
	
		DCFlushRange(dst, len);

	}

This loop loads some stuff, the main.dol and the fst.bin into memory. dogamehooks patches the hook into the .dol, that's for Ocarina and Wiird, vidolpatcher patches the strange video mode patch, you can select in the options. And langpatcher patches to the language that is selected. All games will run fine if all patches are removed.

Ans this:
memset((void*)0x80001800,0,kenobiwii_size);
memcpy((void*)0x80001800,kenobiwii,kenobiwii_size);
DCFlushRange((void*)0x80001800,kenobiwii_size);

Is the code handler for Ocarina and Wiird, you do not want it either i think.

Why don't you upload your code completely when you are done, so i can take a look?
Re: Wii game loader
October 18, 2009 04:48PM
I removed the entire main.dol and implemented the code I needed into my app xD
I was going to use LibwiiGUI for the loader.

So all language things were removed but all games load as japanese or something.
All the rest of the files are untouched.

In my app I now have:
hooktype = 1; // what does this do? I can change it to any number.
apploader(); // Loads game in japanese :(

So is there a manual way to load the game in another language? If you can do it by Gecko's menu, you should be able to manually.
I can't really put gecko's menu in either. Thanks :)

Edit: I have also found the same - ish loop in Apploader.c Should I take that out too?



Edited 1 time(s). Last edit at 10/18/2009 04:59PM by pokeglobe.
Sorry, only registered users may post in this forum.

Click here to login