*Removed Carousel because it is causing all the Codedumps on game booting. (There is a memory overload in it we need to fix first)

*Changed CACHE and SECTOR size for SD Cards what increases the loading speeds
if anyone's cards get compatibility problems now with saving or other stuff report as issue and it will be reverted)
This commit is contained in:
dimok321 2009-05-31 17:08:09 +00:00
parent 9508d0103d
commit e9f9882edc
4 changed files with 45 additions and 41 deletions

View File

@ -6,8 +6,8 @@
#include <ogc/usbstorage.h> #include <ogc/usbstorage.h>
#include <sdcard/wiisd_io.h> #include <sdcard/wiisd_io.h>
#define CACHE 1 #define CACHE 32
#define SECTORS 64 #define SECTORS 128
int USBDevice_Init() int USBDevice_Init()
@ -25,7 +25,7 @@ return -1;
void USBDevice_deInit() void USBDevice_deInit()
{ {
//First unmount all the devs... //First unmount all the devs...
fatUnmount("USB"); fatUnmount("USB:/");
//...and then shutdown em! //...and then shutdown em!
__io_usbstorage.shutdown(); __io_usbstorage.shutdown();
} }

View File

@ -70,6 +70,7 @@ void ExitApp()
StopGX(); StopGX();
ShutdownAudio(); ShutdownAudio();
if(isSdInserted())
SDCard_deInit(); SDCard_deInit();
//WPAD_Flush(0); //WPAD_Flush(0);

View File

@ -3278,9 +3278,9 @@ static int MenuDiscList()
gameGrid.SetPosition(0,20); gameGrid.SetPosition(0,20);
gameGrid.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE); gameGrid.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
GuiGameCarousel gameCarousel(640, 400, gameList, gameCnt, CFG.theme_path, bg_options_png, startat, offset); //GuiGameCarousel gameCarousel(640, 400, gameList, gameCnt, CFG.theme_path, bg_options_png, startat, offset);
gameCarousel.SetPosition(0,-20); //gameCarousel.SetPosition(0,-20);
gameCarousel.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE); //gameCarousel.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
GuiText clockTimeBack("88:88", 40, (GXColor){138, 138, 138, 40}); GuiText clockTimeBack("88:88", 40, (GXColor){138, 138, 138, 40});
clockTimeBack.SetAlignment(THEME.clockAlign, ALIGN_TOP); clockTimeBack.SetAlignment(THEME.clockAlign, ALIGN_TOP);
@ -3332,7 +3332,7 @@ static int MenuDiscList()
if (Settings.gameDisplay==list){mainWindow->Append(&gameBrowser);} if (Settings.gameDisplay==list){mainWindow->Append(&gameBrowser);}
if (Settings.gameDisplay==grid){mainWindow->Append(&gameGrid);} if (Settings.gameDisplay==grid){mainWindow->Append(&gameGrid);}
if (Settings.gameDisplay==carousel){mainWindow->Append(&gameCarousel);} //if (Settings.gameDisplay==carousel){mainWindow->Append(&gameCarousel);}
mainWindow->Append(&w); mainWindow->Append(&w);
ResumeGui(); ResumeGui();
@ -3404,7 +3404,7 @@ static int MenuDiscList()
poweroffBtn.ResetState(); poweroffBtn.ResetState();
if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);} if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);}
else if (Settings.gameDisplay==grid){gameGrid.SetFocus(1);} else if (Settings.gameDisplay==grid){gameGrid.SetFocus(1);}
else if (Settings.gameDisplay==carousel){gameCarousel.SetFocus(1);} //else if (Settings.gameDisplay==carousel){gameCarousel.SetFocus(1);}
} }
} }
@ -3436,7 +3436,7 @@ static int MenuDiscList()
homeBtn.ResetState(); homeBtn.ResetState();
if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);} if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);}
else if (Settings.gameDisplay==grid){gameGrid.SetFocus(1);} else if (Settings.gameDisplay==grid){gameGrid.SetFocus(1);}
else if (Settings.gameDisplay==carousel){gameCarousel.SetFocus(1);} //else if (Settings.gameDisplay==carousel){gameCarousel.SetFocus(1);}
} }
} }
@ -3445,7 +3445,7 @@ static int MenuDiscList()
wiiBtn.ResetState(); wiiBtn.ResetState();
if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);} if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);}
else if (Settings.gameDisplay==grid){gameGrid.SetFocus(1);} else if (Settings.gameDisplay==grid){gameGrid.SetFocus(1);}
else if (Settings.gameDisplay==carousel){gameCarousel.SetFocus(1);} //else if (Settings.gameDisplay==carousel){gameCarousel.SetFocus(1);}
} }
else if(installBtn.GetState() == STATE_CLICKED) else if(installBtn.GetState() == STATE_CLICKED)
{ {
@ -3460,7 +3460,7 @@ static int MenuDiscList()
installBtn.ResetState(); installBtn.ResetState();
if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);} if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);}
else if (Settings.gameDisplay==grid){gameGrid.SetFocus(1);} else if (Settings.gameDisplay==grid){gameGrid.SetFocus(1);}
else if (Settings.gameDisplay==carousel){gameCarousel.SetFocus(1);} //else if (Settings.gameDisplay==carousel){gameCarousel.SetFocus(1);}
} }
} }
@ -3474,9 +3474,9 @@ static int MenuDiscList()
else if (Settings.gameDisplay==grid){ else if (Settings.gameDisplay==grid){
startat = gameGrid.GetSelectedOption(); startat = gameGrid.GetSelectedOption();
offset = gameGrid.GetOffset();} offset = gameGrid.GetOffset();}
else if (Settings.gameDisplay==carousel){ //else if (Settings.gameDisplay==carousel){
startat = gameCarousel.GetSelectedOption(); // startat = gameCarousel.GetSelectedOption();
offset = gameCarousel.GetOffset();} // offset = gameCarousel.GetOffset();}
if(isSdInserted()) { if(isSdInserted()) {
CFG_Load(); CFG_Load();
} }
@ -3540,7 +3540,7 @@ static int MenuDiscList()
DownloadBtn.ResetState(); DownloadBtn.ResetState();
if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);} if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);}
else if (Settings.gameDisplay==grid){gameGrid.SetFocus(1);} else if (Settings.gameDisplay==grid){gameGrid.SetFocus(1);}
else if (Settings.gameDisplay==carousel){gameCarousel.SetFocus(1);} //else if (Settings.gameDisplay==carousel){gameCarousel.SetFocus(1);}
}//end download }//end download
else if(settingsBtn.GetState() == STATE_CLICKED) else if(settingsBtn.GetState() == STATE_CLICKED)
@ -3550,9 +3550,10 @@ static int MenuDiscList()
else if (Settings.gameDisplay==grid){ else if (Settings.gameDisplay==grid){
startat = gameGrid.GetSelectedOption(); startat = gameGrid.GetSelectedOption();
offset = gameGrid.GetOffset();} offset = gameGrid.GetOffset();}
else if (Settings.gameDisplay==carousel){ /*else if (Settings.gameDisplay==carousel){
startat = gameCarousel.GetSelectedOption(); startat = gameCarousel.GetSelectedOption();
offset = gameCarousel.GetOffset();} offset = gameCarousel.GetOffset();}
*/
menu = MENU_SETTINGS; menu = MENU_SETTINGS;
break; break;
@ -3569,8 +3570,8 @@ static int MenuDiscList()
gameBrowser.Reload(gameList, gameCnt);} gameBrowser.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==grid){ else if (Settings.gameDisplay==grid){
gameGrid.Reload(gameList, gameCnt);} gameGrid.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==carousel){ //else if (Settings.gameDisplay==carousel){
gameCarousel.Reload(gameList, gameCnt);} // gameCarousel.Reload(gameList, gameCnt);}
gamecntTxt.SetTextf("%s: %i",LANGUAGE.Games, gameCnt); gamecntTxt.SetTextf("%s: %i",LANGUAGE.Games, gameCnt);
selectedold = 1; selectedold = 1;
favoriteBtn.ResetState(); favoriteBtn.ResetState();
@ -3591,8 +3592,8 @@ static int MenuDiscList()
gameBrowser.Reload(gameList, gameCnt);} gameBrowser.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==grid){ else if (Settings.gameDisplay==grid){
gameGrid.Reload(gameList, gameCnt);} gameGrid.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==carousel){ //else if (Settings.gameDisplay==carousel){
gameCarousel.Reload(gameList, gameCnt);} // gameCarousel.Reload(gameList, gameCnt);}
selectedold = 1; selectedold = 1;
abcBtn.SetImage(&abcBtnImg); abcBtn.SetImage(&abcBtnImg);
abcBtn.SetImageOver(&abcBtnImg); abcBtn.SetImageOver(&abcBtnImg);
@ -3616,8 +3617,8 @@ static int MenuDiscList()
gameBrowser.Reload(gameList, gameCnt);} gameBrowser.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==grid){ else if (Settings.gameDisplay==grid){
gameGrid.Reload(gameList, gameCnt);} gameGrid.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==carousel){ //else if (Settings.gameDisplay==carousel){
gameCarousel.Reload(gameList, gameCnt);} //gameCarousel.Reload(gameList, gameCnt);}
selectedold = 1; selectedold = 1;
abcBtn.SetImage(&abcBtnImg_g); abcBtn.SetImage(&abcBtnImg_g);
abcBtn.SetImageOver(&abcBtnImg_g); abcBtn.SetImageOver(&abcBtnImg_g);
@ -3638,12 +3639,12 @@ static int MenuDiscList()
gridBtn.SetImageOver(&gridBtnImg_g); gridBtn.SetImageOver(&gridBtnImg_g);
gridBtn.SetAlpha(180); gridBtn.SetAlpha(180);
} }
if (Settings.gameDisplay==carousel) { /*if (Settings.gameDisplay==carousel) {
mainWindow->Remove(&gameCarousel); mainWindow->Remove(&gameCarousel);
carouselBtn.SetImage(&carouselBtnImg_g); carouselBtn.SetImage(&carouselBtnImg_g);
carouselBtn.SetImageOver(&carouselBtnImg_g); carouselBtn.SetImageOver(&carouselBtnImg_g);
carouselBtn.SetAlpha(180); carouselBtn.SetAlpha(180);
} }*/
HaltGui(); HaltGui();
mainWindow->Remove(&w); mainWindow->Remove(&w);
Settings.gameDisplay=list; Settings.gameDisplay=list;
@ -3701,12 +3702,12 @@ static int MenuDiscList()
listBtn.SetImageOver(&listBtnImg_g); listBtn.SetImageOver(&listBtnImg_g);
listBtn.SetAlpha(180); listBtn.SetAlpha(180);
} }
if (Settings.gameDisplay==carousel) { /*if (Settings.gameDisplay==carousel) {
mainWindow->Remove(&gameCarousel); mainWindow->Remove(&gameCarousel);
carouselBtn.SetImage(&carouselBtnImg_g); carouselBtn.SetImage(&carouselBtnImg_g);
carouselBtn.SetImageOver(&carouselBtnImg_g); carouselBtn.SetImageOver(&carouselBtnImg_g);
carouselBtn.SetAlpha(180); carouselBtn.SetAlpha(180);
} }*/
HaltGui(); HaltGui();
mainWindow->Remove(&w); mainWindow->Remove(&w);
Settings.gameDisplay=grid; Settings.gameDisplay=grid;
@ -3753,7 +3754,7 @@ static int MenuDiscList()
} }
else if (carouselBtn.GetState() == STATE_CLICKED) { else if (carouselBtn.GetState() == STATE_CLICKED) {
if (Settings.gameDisplay!=carousel){ /*if (Settings.gameDisplay!=carousel){
if (Settings.gameDisplay==list) if (Settings.gameDisplay==list)
mainWindow->Remove(&gameBrowser); mainWindow->Remove(&gameBrowser);
if (GameIDTxt) w.Remove(GameIDTxt); if (GameIDTxt) w.Remove(GameIDTxt);
@ -3809,16 +3810,18 @@ static int MenuDiscList()
cfg_save_global(); cfg_save_global();
} }
} }
*/
carouselBtn.ResetState(); carouselBtn.ResetState();
} }
if (Settings.gameDisplay==grid){ if (Settings.gameDisplay==grid){
int selectimg; int selectimg;
selectimg = gameGrid.GetSelectedOption(); gameSelected = gameGrid.GetClickedOption(); } selectimg = gameGrid.GetSelectedOption(); gameSelected = gameGrid.GetClickedOption(); }
/*
if (Settings.gameDisplay==carousel){ if (Settings.gameDisplay==carousel){
int selectimg; int selectimg;
selectimg = gameCarousel.GetSelectedOption(); gameSelected = gameCarousel.GetClickedOption(); } selectimg = gameCarousel.GetSelectedOption(); gameSelected = gameCarousel.GetClickedOption(); }
*/
if (Settings.gameDisplay==list) { if (Settings.gameDisplay==list) {
//Get selected game under cursor //Get selected game under cursor
@ -3946,7 +3949,7 @@ static int MenuDiscList()
if (Settings.qboot == yes)//quickboot game if (Settings.qboot == yes)//quickboot game
{ {
wiilight(0); wiilight(0);
//////////save game play count//////////////// //////////save game play count////////////////
extern u8 favorite; extern u8 favorite;
extern u16 count; extern u16 count;
@ -4179,7 +4182,7 @@ static int MenuDiscList()
else if(choice == 0) else if(choice == 0)
if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);} if (Settings.gameDisplay==list){gameBrowser.SetFocus(1);}
else if (Settings.gameDisplay==grid){gameGrid.SetFocus(1);} else if (Settings.gameDisplay==grid){gameGrid.SetFocus(1);}
else if (Settings.gameDisplay==carousel){gameCarousel.SetFocus(1);} //else if (Settings.gameDisplay==carousel){gameCarousel.SetFocus(1);}
} }
} }
} }
@ -4187,7 +4190,7 @@ static int MenuDiscList()
HaltGui(); HaltGui();
if (Settings.gameDisplay==list)mainWindow->Remove(&gameBrowser); if (Settings.gameDisplay==list)mainWindow->Remove(&gameBrowser);
else if (Settings.gameDisplay==grid)mainWindow->Remove(&gameGrid); else if (Settings.gameDisplay==grid)mainWindow->Remove(&gameGrid);
else if (Settings.gameDisplay==carousel)mainWindow->Remove(&gameCarousel); //else if (Settings.gameDisplay==carousel)mainWindow->Remove(&gameCarousel);
mainWindow->Remove(&w); mainWindow->Remove(&w);
ResumeGui(); ResumeGui();
return menu; return menu;

View File

@ -51,8 +51,8 @@ int Sys_IosReload(int IOS)
{ {
s32 ret; s32 ret;
if(isSdInserted())
SDCard_deInit(); SDCard_deInit();
USBDevice_deInit();
WPAD_Flush(0); WPAD_Flush(0);
WPAD_Disconnect(0); WPAD_Disconnect(0);