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

View File

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

View File

@ -953,7 +953,7 @@ int GameWindowPrompt()
f32 size = 0.0;
char ID[5];
char IDFull[7];
u8 faveChoice = 0;
u16 playCount = 0;
@ -1167,11 +1167,11 @@ int GameWindowPrompt()
delete diskCover;
snprintf(imgPath, sizeof(imgPath), "%s%s.png", CFG.disc_path, ID); //changed to current id
diskCover = new GuiImageData(imgPath, 0);
if (!diskCover->GetImage())
{ snprintf (ID,sizeof(ID),"%c%c%c%c", header->id[0], header->id[1], header->id[2], header->id[3]);
delete diskCover;
snprintf(imgPath, sizeof(imgPath), "%s%s.png", CFG.disc_path, ID); //changed to current id
diskCover = new GuiImageData(imgPath, 0);
@ -2486,7 +2486,7 @@ ProgressUpdateWindow()
int noControllers=0;
static void *
UpdateGUI (void *arg)
{
{
while(1)
{
if(guiHalt)
@ -2517,9 +2517,9 @@ UpdateGUI (void *arg)
}
else {noControllers =0;
if (mainWindow->GetState()==STATE_DISABLED);
mainWindow->SetState(STATE_DEFAULT);}*/
}
#endif
@ -3278,9 +3278,9 @@ static int MenuDiscList()
gameGrid.SetPosition(0,20);
gameGrid.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
GuiGameCarousel gameCarousel(640, 400, gameList, gameCnt, CFG.theme_path, bg_options_png, startat, offset);
gameCarousel.SetPosition(0,-20);
gameCarousel.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
//GuiGameCarousel gameCarousel(640, 400, gameList, gameCnt, CFG.theme_path, bg_options_png, startat, offset);
//gameCarousel.SetPosition(0,-20);
//gameCarousel.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
GuiText clockTimeBack("88:88", 40, (GXColor){138, 138, 138, 40});
clockTimeBack.SetAlignment(THEME.clockAlign, ALIGN_TOP);
@ -3332,7 +3332,7 @@ static int MenuDiscList()
if (Settings.gameDisplay==list){mainWindow->Append(&gameBrowser);}
if (Settings.gameDisplay==grid){mainWindow->Append(&gameGrid);}
if (Settings.gameDisplay==carousel){mainWindow->Append(&gameCarousel);}
//if (Settings.gameDisplay==carousel){mainWindow->Append(&gameCarousel);}
mainWindow->Append(&w);
ResumeGui();
@ -3404,7 +3404,7 @@ static int MenuDiscList()
poweroffBtn.ResetState();
if (Settings.gameDisplay==list){gameBrowser.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();
if (Settings.gameDisplay==list){gameBrowser.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();
if (Settings.gameDisplay==list){gameBrowser.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)
{
@ -3460,7 +3460,7 @@ static int MenuDiscList()
installBtn.ResetState();
if (Settings.gameDisplay==list){gameBrowser.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){
startat = gameGrid.GetSelectedOption();
offset = gameGrid.GetOffset();}
else if (Settings.gameDisplay==carousel){
startat = gameCarousel.GetSelectedOption();
offset = gameCarousel.GetOffset();}
//else if (Settings.gameDisplay==carousel){
// startat = gameCarousel.GetSelectedOption();
// offset = gameCarousel.GetOffset();}
if(isSdInserted()) {
CFG_Load();
}
@ -3540,7 +3540,7 @@ static int MenuDiscList()
DownloadBtn.ResetState();
if (Settings.gameDisplay==list){gameBrowser.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
else if(settingsBtn.GetState() == STATE_CLICKED)
@ -3550,9 +3550,10 @@ static int MenuDiscList()
else if (Settings.gameDisplay==grid){
startat = gameGrid.GetSelectedOption();
offset = gameGrid.GetOffset();}
else if (Settings.gameDisplay==carousel){
/*else if (Settings.gameDisplay==carousel){
startat = gameCarousel.GetSelectedOption();
offset = gameCarousel.GetOffset();}
*/
menu = MENU_SETTINGS;
break;
@ -3569,12 +3570,12 @@ static int MenuDiscList()
gameBrowser.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==grid){
gameGrid.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==carousel){
gameCarousel.Reload(gameList, gameCnt);}
//else if (Settings.gameDisplay==carousel){
// gameCarousel.Reload(gameList, gameCnt);}
gamecntTxt.SetTextf("%s: %i",LANGUAGE.Games, gameCnt);
selectedold = 1;
favoriteBtn.ResetState();
Settings.fave ? (favoriteBtn.SetImage(&favoriteBtnImg),favoriteBtn.SetImageOver(&favoriteBtnImg),
Settings.fave ? (favoriteBtn.SetImage(&favoriteBtnImg),favoriteBtn.SetImageOver(&favoriteBtnImg),
favoriteBtn.SetAlpha(255)) : (favoriteBtn.SetImage(&favoriteBtnImg_g),
favoriteBtn.SetImageOver(&favoriteBtnImg_g), favoriteBtn.SetAlpha(180));
}
@ -3591,8 +3592,8 @@ static int MenuDiscList()
gameBrowser.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==grid){
gameGrid.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==carousel){
gameCarousel.Reload(gameList, gameCnt);}
//else if (Settings.gameDisplay==carousel){
// gameCarousel.Reload(gameList, gameCnt);}
selectedold = 1;
abcBtn.SetImage(&abcBtnImg);
abcBtn.SetImageOver(&abcBtnImg);
@ -3616,8 +3617,8 @@ static int MenuDiscList()
gameBrowser.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==grid){
gameGrid.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==carousel){
gameCarousel.Reload(gameList, gameCnt);}
//else if (Settings.gameDisplay==carousel){
//gameCarousel.Reload(gameList, gameCnt);}
selectedold = 1;
abcBtn.SetImage(&abcBtnImg_g);
abcBtn.SetImageOver(&abcBtnImg_g);
@ -3638,12 +3639,12 @@ static int MenuDiscList()
gridBtn.SetImageOver(&gridBtnImg_g);
gridBtn.SetAlpha(180);
}
if (Settings.gameDisplay==carousel) {
/*if (Settings.gameDisplay==carousel) {
mainWindow->Remove(&gameCarousel);
carouselBtn.SetImage(&carouselBtnImg_g);
carouselBtn.SetImageOver(&carouselBtnImg_g);
carouselBtn.SetAlpha(180);
}
}*/
HaltGui();
mainWindow->Remove(&w);
Settings.gameDisplay=list;
@ -3701,12 +3702,12 @@ static int MenuDiscList()
listBtn.SetImageOver(&listBtnImg_g);
listBtn.SetAlpha(180);
}
if (Settings.gameDisplay==carousel) {
/*if (Settings.gameDisplay==carousel) {
mainWindow->Remove(&gameCarousel);
carouselBtn.SetImage(&carouselBtnImg_g);
carouselBtn.SetImageOver(&carouselBtnImg_g);
carouselBtn.SetAlpha(180);
}
}*/
HaltGui();
mainWindow->Remove(&w);
Settings.gameDisplay=grid;
@ -3753,7 +3754,7 @@ static int MenuDiscList()
}
else if (carouselBtn.GetState() == STATE_CLICKED) {
if (Settings.gameDisplay!=carousel){
/*if (Settings.gameDisplay!=carousel){
if (Settings.gameDisplay==list)
mainWindow->Remove(&gameBrowser);
if (GameIDTxt) w.Remove(GameIDTxt);
@ -3808,17 +3809,19 @@ static int MenuDiscList()
if(isSdInserted()) {
cfg_save_global();
}
}
}
*/
carouselBtn.ResetState();
}
if (Settings.gameDisplay==grid){
int selectimg;
selectimg = gameGrid.GetSelectedOption(); gameSelected = gameGrid.GetClickedOption(); }
/*
if (Settings.gameDisplay==carousel){
int selectimg;
selectimg = gameCarousel.GetSelectedOption(); gameSelected = gameCarousel.GetClickedOption(); }
*/
if (Settings.gameDisplay==list) {
//Get selected game under cursor
@ -3946,7 +3949,7 @@ static int MenuDiscList()
if (Settings.qboot == yes)//quickboot game
{
wiilight(0);
wiilight(0);
//////////save game play count////////////////
extern u8 favorite;
extern u16 count;
@ -4179,7 +4182,7 @@ static int MenuDiscList()
else if(choice == 0)
if (Settings.gameDisplay==list){gameBrowser.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();
if (Settings.gameDisplay==list)mainWindow->Remove(&gameBrowser);
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);
ResumeGui();
return menu;

View File

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