From 56760ff8c37c93832ad3b391f27a2313224159ef Mon Sep 17 00:00:00 2001 From: ekeeke31 Date: Thu, 12 Aug 2010 19:21:25 +0000 Subject: [PATCH] removed cIOS202 & EHCI module support --- Makefile.wii | 3 +-- source/gx/main.c | 46 ++++++++++++++-------------------------------- 2 files changed, 15 insertions(+), 34 deletions(-) diff --git a/Makefile.wii b/Makefile.wii index 5746a01..9d300ef 100644 --- a/Makefile.wii +++ b/Makefile.wii @@ -81,8 +81,7 @@ endif export OFILES := $(addsuffix .o,$(BINFILES)) \ $(PNGFILES:.png=.png.o) $(PCMFILES:.pcm=.pcm.o) $(OGGFILES:.ogg=.ogg.o) \ $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ - $(sFILES:.s=.o) $(SFILES:.S=.o) \ - $(CURDIR)/source/gx/utils/ehcmodule.elf.o + $(sFILES:.s=.o) $(SFILES:.S=.o) #--------------------------------------------------------------------------------- # build a list of include paths diff --git a/source/gx/main.c b/source/gx/main.c index 9788de4..0d11e68 100644 --- a/source/gx/main.c +++ b/source/gx/main.c @@ -33,15 +33,11 @@ #include "file_fat.h" #include "filesel.h" -#ifdef HW_RVL -#include "usb2storage.h" -#include "mload.h" -#endif - #include #ifdef HW_RVL #include +extern u32 __di_check_ahbprot(void); #endif u32 Shutdown = 0; @@ -284,7 +280,6 @@ void shutdown(void) gx_video_Shutdown(); #ifdef HW_RVL DI_Close(); - mload_close(); #endif } @@ -298,21 +293,14 @@ u32 frameticker = 0; int main (int argc, char *argv[]) { #ifdef HW_RVL - /* try to load IOS 202 */ - if(IOS_GetVersion() != 202 && FindIOS(202)) - IOS_ReloadIOS(202); - - if(IOS_GetVersion() == 202) - { - /* disable DVDX stub */ - DI_LoadDVDX(false); - - /* load EHCI module & enable USB2 driver */ - if(mload_init() >= 0 && load_ehci_module()) - USB2Enable(true); + /* if not already loaded, try to reload IOS 58 (USB2 support) */ + if ((IOS_GetVersion() != 58) && FindIOS(58)) + { + /* IOS should not be reloaded if HW_AHBPROT flags are set (DVD support) */ + if (__di_check_ahbprot() != 1) IOS_ReloadIOS(58); } - /* initialize DVD driver */ + /* initialize DVD device */ DI_Init(); #endif @@ -320,7 +308,7 @@ int main (int argc, char *argv[]) gx_video_Init(); #ifdef HW_DOL - /* initialize DVD driver */ + /* initialize DVD device */ DVD_Init (); dvd_drive_detect(); #endif @@ -332,26 +320,20 @@ int main (int argc, char *argv[]) char pathname[MAXPATHLEN]; sprintf (pathname, DEFAULT_PATH); DIR_ITER *dir = diropen(pathname); - if (dir) - dirclose(dir); - else - mkdir(pathname,S_IRWXU); + if (dir) dirclose(dir); + else mkdir(pathname,S_IRWXU); /* default SRAM & Savestate files directory */ sprintf (pathname, "%s/saves",DEFAULT_PATH); dir = diropen(pathname); - if (dir) - dirclose(dir); - else - mkdir(pathname,S_IRWXU); + if (dir) dirclose(dir); + else mkdir(pathname,S_IRWXU); /* default Snapshot files directory */ sprintf (pathname, "%s/snaps",DEFAULT_PATH); dir = diropen(pathname); - if (dir) - dirclose(dir); - else - mkdir(pathname,S_IRWXU); + if (dir) dirclose(dir); + else mkdir(pathname,S_IRWXU); } /* initialize input engine */