*Found and fixed bug with Memory for Carousel (also was one in Grid)

*Added Carousel back in
*Changed UMS Heapsize which increases compatibility for some HDD Devices with cIOS38 Rev12

**NOTE: If anyone encounters any HDD detection problems which start from this rev on, make an issue and we can revert that thing.
This commit is contained in:
dimok321 2009-05-31 21:40:22 +00:00
parent e9f9882edc
commit 1ffee5a484
5 changed files with 151 additions and 141 deletions

View File

@ -24,7 +24,7 @@
#define SHIFT_SPEED 100 #define SHIFT_SPEED 100
#define SPEED_STEP 4 #define SPEED_STEP 4
#define PAGESIZE 9 #define PAGESIZE 9
#define SAFETY 320 #define SAFETY 9
extern const int vol; extern const int vol;

View File

@ -35,7 +35,6 @@ class GuiGameCarousel : public GuiElement
int * bob; int * bob;
GuiButton ** game; GuiButton ** game;
GuiText ** gameTxt;
GuiImage ** coverImg; GuiImage ** coverImg;
GuiImageData ** cover; GuiImageData ** cover;

View File

@ -16,7 +16,7 @@
#include <string.h> #include <string.h>
#include <sstream> #include <sstream>
#define GAMESELECTSIZE 30
extern const int vol; extern const int vol;
/** /**
@ -157,7 +157,13 @@ GuiGameGrid::~GuiGameGrid()
delete btnLeft; delete btnLeft;
delete trigA; delete trigA;
delete trigHeldA;
delete trigL;
delete trigR;
delete trigPlus;
delete trigMinus;
delete btnSoundClick; delete btnSoundClick;
delete btnSoundOver;
for(int i=0; i<pagesize; i++) for(int i=0; i<pagesize; i++)
{ {
@ -168,6 +174,8 @@ GuiGameGrid::~GuiGameGrid()
} }
delete [] gameIndex; delete [] gameIndex;
delete [] game; delete [] game;
delete [] cover;
delete [] coverImg;
} }
void GuiGameGrid::SetFocus(int f) void GuiGameGrid::SetFocus(int f)

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);
@ -3291,7 +3291,8 @@ static int MenuDiscList()
} }
GuiText clockTime(theTime, 40, (GXColor){138, 138, 138, 240}); GuiText clockTime(theTime, 40, (GXColor){138, 138, 138, 240});
clockTime.SetAlignment(THEME.clockAlign, ALIGN_TOP); clockTime.SetAlignment(THEME.clockAlign, ALIGN_TOP);
clockTime.SetPosition(THEME.clock_x, THEME.clock_y); clockTime.SetFont(fontClock); clockTime.SetPosition(THEME.clock_x, THEME.clock_y);
clockTime.SetFont(fontClock);
if (Settings.gameDisplay==grid || Settings.gameDisplay==carousel) { if (Settings.gameDisplay==grid || Settings.gameDisplay==carousel) {
clockTime.SetPosition(THEME.clock_x, THEME.clock_y+3); clockTime.SetPosition(THEME.clock_x, THEME.clock_y+3);
} }
@ -3332,7 +3333,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 +3405,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 +3437,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 +3446,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 +3461,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 +3475,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 +3541,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,10 +3551,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();}
*/
menu = MENU_SETTINGS; menu = MENU_SETTINGS;
break; break;
@ -3570,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();
@ -3592,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);
@ -3617,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);
@ -3639,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;
@ -3702,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;
@ -3754,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);
@ -3810,25 +3810,28 @@ 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
int selectimg;//, promptnumber; int selectimg;//, promptnumber;
char ID[4]; char ID[4];
char IDfull[7]; char IDfull[7];
selectimg = gameBrowser.GetSelectedOption(); gameSelected = gameBrowser.GetClickedOption(); selectimg = gameBrowser.GetSelectedOption();
gameSelected = gameBrowser.GetClickedOption();
if (gameSelected > 0) //if click occured if (gameSelected > 0) //if click occured
@ -4182,7 +4185,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);}
} }
} }
} }
@ -4190,7 +4193,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

@ -40,7 +40,7 @@ distribution.
#define USB_IOCTL_UMS_READ_STRESS (UMS_BASE+0x5) #define USB_IOCTL_UMS_READ_STRESS (UMS_BASE+0x5)
#define USB_IOCTL_UMS_SET_VERBOSE (UMS_BASE+0x6) #define USB_IOCTL_UMS_SET_VERBOSE (UMS_BASE+0x6)
#define UMS_HEAPSIZE 0x8000 #define UMS_HEAPSIZE 0x10000
/* Variables */ /* Variables */
static char fs[] ATTRIBUTE_ALIGN(32) = "/dev/usb/ehc"; static char fs[] ATTRIBUTE_ALIGN(32) = "/dev/usb/ehc";