mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-26 05:04:16 +01:00
Free up ~24KB for every 150 games installed.
Add button to mount DVD drive. Not completely tested, but somewhat. *Tested and working* retail Wii DVD Wii backup Wii backup w/ alt dol (redsteel) Wii backup w/ alt dol & ocarina (redsteel) Wii backup w/ alt dol & WiiRD Retail & Backup forcing video modes Saving individual settings for games on DVD (only Wii as BC is loaded before any settings would be used) Display disc images for DVD games Loading GC games retail & backup (w/ working MIOS patch installed) I did change some stuff after testing GC so it might be broken. Theme stuff for the button is not tested and I'm not quite up to speed with ardi's changes to the theme stuff so it might not work. Changed images are not compressed or optimized.
This commit is contained in:
parent
b7a96f77f8
commit
4d6e0fe412
File diff suppressed because one or more lines are too long
2
gui.pnps
2
gui.pnps
@ -1 +1 @@
|
|||||||
<pd><ViewState><e p="gui\source\mload" x="true"></e><e p="gui\source\settings" x="false"></e><e p="gui\source\images" x="false"></e><e p="gui\source\prompts" x="false"></e><e p="gui\source\banner" x="false"></e><e p="gui\source\cheats" x="false"></e><e p="gui\source\network" x="false"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source\usbloader" x="false"></e><e p="gui\source\xml" x="false"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\ramdisc" x="false"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\wad" x="false"></e><e p="gui" x="true"></e><e p="gui\source\homebrewboot" x="false"></e><e p="gui\source\language" x="false"></e><e p="gui\source" x="true"></e><e p="gui\source\libwbfs" x="false"></e><e p="gui\source\libwiigui" x="false"></e><e p="gui\source\patches" x="false"></e></ViewState></pd>
|
<pd><ViewState><e p="gui\source\mload" x="true"></e><e p="gui\source\settings" x="false"></e><e p="gui\source\images" x="false"></e><e p="gui\source\prompts" x="true"></e><e p="gui\source\banner" x="false"></e><e p="gui\source\cheats" x="false"></e><e p="gui\source\network" x="false"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source\usbloader" x="true"></e><e p="gui\source\xml" x="false"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\ramdisc" x="false"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\wad" x="false"></e><e p="gui" x="true"></e><e p="gui\source\homebrewboot" x="false"></e><e p="gui\source\language" x="false"></e><e p="gui\source" x="true"></e><e p="gui\source\libwbfs" x="false"></e><e p="gui\source\libwiigui" x="false"></e><e p="gui\source\patches" x="false"></e></ViewState></pd>
|
@ -504,4 +504,7 @@ extern const u32 pegi_18_png_size;
|
|||||||
extern const u8 usbport_png[];
|
extern const u8 usbport_png[];
|
||||||
extern const u32 usbport_png_size;
|
extern const u32 usbport_png_size;
|
||||||
|
|
||||||
|
extern const u8 dvd_png[];
|
||||||
|
extern const u32 dvd_png_size;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 4.3 KiB |
BIN
source/images/dvd.png
Normal file
BIN
source/images/dvd.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
124
source/menu.cpp
124
source/menu.cpp
@ -64,6 +64,9 @@ float gamesize;
|
|||||||
int currentMenu;
|
int currentMenu;
|
||||||
int idiotFlag=-1;
|
int idiotFlag=-1;
|
||||||
char idiotChar[50];
|
char idiotChar[50];
|
||||||
|
u8 dvdMounted=0;
|
||||||
|
struct discHdr *dvdheader = NULL;
|
||||||
|
|
||||||
|
|
||||||
/*** Variables used only in menu.cpp ***/
|
/*** Variables used only in menu.cpp ***/
|
||||||
static GuiImage * coverImg = NULL;
|
static GuiImage * coverImg = NULL;
|
||||||
@ -76,6 +79,7 @@ static int ExitRequested = 0;
|
|||||||
static char gameregion[7];
|
static char gameregion[7];
|
||||||
static bool altdoldefault = true;
|
static bool altdoldefault = true;
|
||||||
|
|
||||||
|
|
||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
extern FreeTypeGX *fontClock;
|
extern FreeTypeGX *fontClock;
|
||||||
extern u8 shutdown;
|
extern u8 shutdown;
|
||||||
@ -209,15 +213,16 @@ void ExitGUIThreads() {
|
|||||||
}
|
}
|
||||||
void rockout(int f = 0) {
|
void rockout(int f = 0) {
|
||||||
|
|
||||||
|
|
||||||
HaltGui();
|
HaltGui();
|
||||||
int num=(f==2?-1:gameSelected);
|
int num=(f==2?-1:gameSelected);
|
||||||
|
|
||||||
char imgPath[100];
|
char imgPath[100];
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
if (!(strcasestr(get_title(&gameList[num]),"guitar")||
|
if ((!(strcasestr(get_title(&gameList[num]),"guitar")||
|
||||||
strcasestr(get_title(&gameList[num]),"band")||
|
strcasestr(get_title(&gameList[num]),"band")||
|
||||||
strcasestr(get_title(&gameList[num]),"rock")||
|
strcasestr(get_title(&gameList[num]),"rock")||
|
||||||
f==1)) {
|
f==1))||dvdMounted) {
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
delete pointer[i];
|
delete pointer[i];
|
||||||
snprintf(imgPath, sizeof(imgPath), "%splayer1_point.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%splayer1_point.png", CFG.theme_path);
|
||||||
@ -299,11 +304,11 @@ GuiImageData *LoadCoverImage(struct discHdr *header, bool Prefere3D, bool noCove
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* MenuDiscList
|
* MenuDiscList
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
GuiButton *Toolbar[7];
|
GuiButton *Toolbar[8];
|
||||||
void DiscListWinUpdateCallback(void * e)
|
void DiscListWinUpdateCallback(void * e)
|
||||||
{
|
{
|
||||||
GuiWindow *w = (GuiWindow *)e;
|
GuiWindow *w = (GuiWindow *)e;
|
||||||
for(int i=0; i<7; ++i)
|
for(int i=0; i<8; ++i)
|
||||||
{
|
{
|
||||||
if(Toolbar[i]->GetState() == STATE_SELECTED)
|
if(Toolbar[i]->GetState() == STATE_SELECTED)
|
||||||
{
|
{
|
||||||
@ -328,7 +333,11 @@ int MenuDiscList() {
|
|||||||
char IDfull[7];
|
char IDfull[7];
|
||||||
u32 covert = 0;
|
u32 covert = 0;
|
||||||
char imgPath[100];
|
char imgPath[100];
|
||||||
|
char dvdID[8];
|
||||||
|
if (!dvdheader)
|
||||||
|
dvdheader = new struct discHdr;
|
||||||
|
|
||||||
|
|
||||||
WDVD_GetCoverStatus(&covert);
|
WDVD_GetCoverStatus(&covert);
|
||||||
u32 covertOld=covert;
|
u32 covertOld=covert;
|
||||||
|
|
||||||
@ -424,6 +433,8 @@ int MenuDiscList() {
|
|||||||
GuiImageData imgarrangeCarousel(imgPath, arrangeCarousel_png);
|
GuiImageData imgarrangeCarousel(imgPath, arrangeCarousel_png);
|
||||||
// snprintf(imgPath, sizeof(imgPath), "%sarrangeCarousel_gray.png", CFG.theme_path);
|
// snprintf(imgPath, sizeof(imgPath), "%sarrangeCarousel_gray.png", CFG.theme_path);
|
||||||
// GuiImageData imgarrangeCarousel_gray(imgPath, arrangeCarousel_gray_png);
|
// GuiImageData imgarrangeCarousel_gray(imgPath, arrangeCarousel_gray_png);
|
||||||
|
snprintf(imgPath, sizeof(imgPath), "%sdvd.png", CFG.theme_path);
|
||||||
|
GuiImageData imgdvd(imgPath, dvd_png);
|
||||||
|
|
||||||
snprintf(imgPath, sizeof(imgPath), "%sbrowser.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%sbrowser.png", CFG.theme_path);
|
||||||
GuiImageData homebrewImgData(imgPath, browser_png);
|
GuiImageData homebrewImgData(imgPath, browser_png);
|
||||||
@ -608,6 +619,18 @@ int MenuDiscList() {
|
|||||||
GuiButton carouselBtn(&carouselBtnImg_g,&carouselBtnImg_g, ALIGN_LEFT, ALIGN_TOP, THEME.gamelist_carousel_x, THEME.gamelist_carousel_y, &trigA, &btnSoundOver, &btnClick,1, &carouselBtnTT, 15, 52, 1, 3);
|
GuiButton carouselBtn(&carouselBtnImg_g,&carouselBtnImg_g, ALIGN_LEFT, ALIGN_TOP, THEME.gamelist_carousel_x, THEME.gamelist_carousel_y, &trigA, &btnSoundOver, &btnClick,1, &carouselBtnTT, 15, 52, 1, 3);
|
||||||
carouselBtn.SetAlpha(180);
|
carouselBtn.SetAlpha(180);
|
||||||
|
|
||||||
|
GuiTooltip dvdBtnTT(tr("Mount DVD drive"));
|
||||||
|
if (Settings.wsprompt == yes)
|
||||||
|
dvdBtnTT.SetWidescreen(CFG.widescreen);
|
||||||
|
dvdBtnTT.SetAlpha(THEME.tooltipAlpha);
|
||||||
|
GuiImage dvdBtnImg(&imgdvd);
|
||||||
|
dvdBtnImg.SetWidescreen(CFG.widescreen);
|
||||||
|
GuiImage dvdBtnImg_g(dvdBtnImg); //dvdBtnImg_g.SetGrayscale();
|
||||||
|
// GuiImage carouselBtnImg_g(&imgarrangeCarousel_gray);
|
||||||
|
dvdBtnImg_g.SetWidescreen(CFG.widescreen);
|
||||||
|
GuiButton dvdBtn(&dvdBtnImg_g,&dvdBtnImg_g, ALIGN_LEFT, ALIGN_TOP, THEME.gamelist_dvd_x, THEME.gamelist_dvd_y, &trigA, &btnSoundOver, &btnClick,1, &dvdBtnTT, 15, 52, 1, 3);
|
||||||
|
dvdBtn.SetAlpha(180);
|
||||||
|
|
||||||
GuiTooltip homebrewBtnTT(tr("Homebrew Launcher"));
|
GuiTooltip homebrewBtnTT(tr("Homebrew Launcher"));
|
||||||
if (Settings.wsprompt == yes)
|
if (Settings.wsprompt == yes)
|
||||||
homebrewBtnTT.SetWidescreen(CFG.widescreen);
|
homebrewBtnTT.SetWidescreen(CFG.widescreen);
|
||||||
@ -664,6 +687,7 @@ int MenuDiscList() {
|
|||||||
listBtn.SetPosition(THEME.gamelist_list_x, THEME.gamelist_list_y);
|
listBtn.SetPosition(THEME.gamelist_list_x, THEME.gamelist_list_y);
|
||||||
gridBtn.SetPosition(THEME.gamelist_grid_x, THEME.gamelist_grid_y);
|
gridBtn.SetPosition(THEME.gamelist_grid_x, THEME.gamelist_grid_y);
|
||||||
carouselBtn.SetPosition(THEME.gamelist_carousel_x, THEME.gamelist_carousel_y);
|
carouselBtn.SetPosition(THEME.gamelist_carousel_x, THEME.gamelist_carousel_y);
|
||||||
|
dvdBtn.SetPosition(THEME.gamelist_dvd_x, THEME.gamelist_dvd_y);
|
||||||
} else if(Settings.gameDisplay==grid) {
|
} else if(Settings.gameDisplay==grid) {
|
||||||
favoriteBtn.SetPosition(THEME.gamegrid_favorite_x, THEME.gamegrid_favorite_y);
|
favoriteBtn.SetPosition(THEME.gamegrid_favorite_x, THEME.gamegrid_favorite_y);
|
||||||
searchBtn.SetPosition(THEME.gamegrid_search_x, THEME.gamegrid_search_y);
|
searchBtn.SetPosition(THEME.gamegrid_search_x, THEME.gamegrid_search_y);
|
||||||
@ -672,6 +696,7 @@ int MenuDiscList() {
|
|||||||
listBtn.SetPosition(THEME.gamegrid_list_x, THEME.gamegrid_list_y);
|
listBtn.SetPosition(THEME.gamegrid_list_x, THEME.gamegrid_list_y);
|
||||||
gridBtn.SetPosition(THEME.gamegrid_grid_x, THEME.gamegrid_grid_y);
|
gridBtn.SetPosition(THEME.gamegrid_grid_x, THEME.gamegrid_grid_y);
|
||||||
carouselBtn.SetPosition(THEME.gamegrid_carousel_x, THEME.gamegrid_carousel_y);
|
carouselBtn.SetPosition(THEME.gamegrid_carousel_x, THEME.gamegrid_carousel_y);
|
||||||
|
dvdBtn.SetPosition(THEME.gamegrid_dvd_x, THEME.gamegrid_dvd_y);
|
||||||
} else if(Settings.gameDisplay==carousel) {
|
} else if(Settings.gameDisplay==carousel) {
|
||||||
favoriteBtn.SetPosition(THEME.gamecarousel_favorite_x, THEME.gamecarousel_favorite_y);
|
favoriteBtn.SetPosition(THEME.gamecarousel_favorite_x, THEME.gamecarousel_favorite_y);
|
||||||
searchBtn.SetPosition(THEME.gamecarousel_search_x, THEME.gamecarousel_favorite_y);
|
searchBtn.SetPosition(THEME.gamecarousel_search_x, THEME.gamecarousel_favorite_y);
|
||||||
@ -680,6 +705,7 @@ int MenuDiscList() {
|
|||||||
listBtn.SetPosition(THEME.gamecarousel_list_x, THEME.gamecarousel_list_y);
|
listBtn.SetPosition(THEME.gamecarousel_list_x, THEME.gamecarousel_list_y);
|
||||||
gridBtn.SetPosition(THEME.gamecarousel_grid_x, THEME.gamecarousel_grid_y);
|
gridBtn.SetPosition(THEME.gamecarousel_grid_x, THEME.gamecarousel_grid_y);
|
||||||
carouselBtn.SetPosition(THEME.gamecarousel_carousel_x, THEME.gamecarousel_carousel_y);
|
carouselBtn.SetPosition(THEME.gamecarousel_carousel_x, THEME.gamecarousel_carousel_y);
|
||||||
|
dvdBtn.SetPosition(THEME.gamecarousel_dvd_x, THEME.gamecarousel_dvd_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -778,6 +804,8 @@ int MenuDiscList() {
|
|||||||
Toolbar[5] = &gridBtn;
|
Toolbar[5] = &gridBtn;
|
||||||
w.Append(&carouselBtn);
|
w.Append(&carouselBtn);
|
||||||
Toolbar[6] = &carouselBtn;
|
Toolbar[6] = &carouselBtn;
|
||||||
|
w.Append(&dvdBtn);
|
||||||
|
Toolbar[7] = &dvdBtn;
|
||||||
w.SetUpdateCallback(DiscListWinUpdateCallback);
|
w.SetUpdateCallback(DiscListWinUpdateCallback);
|
||||||
// End Toolbar
|
// End Toolbar
|
||||||
|
|
||||||
@ -1255,6 +1283,19 @@ int MenuDiscList() {
|
|||||||
menu = MENU_DISCLIST;
|
menu = MENU_DISCLIST;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (dvdBtn.GetState() == STATE_CLICKED) {
|
||||||
|
dvdMounted=DiscMount(dvdID);
|
||||||
|
dvdheader->id[0]=dvdID[0];
|
||||||
|
dvdheader->id[1]=dvdID[1];
|
||||||
|
dvdheader->id[2]=dvdID[2];
|
||||||
|
dvdheader->id[3]=dvdID[3];
|
||||||
|
dvdheader->id[4]=dvdID[4];
|
||||||
|
dvdheader->id[5]=dvdID[5];
|
||||||
|
|
||||||
|
dvdBtn.ResetState();
|
||||||
|
rockout(1);
|
||||||
|
//break;
|
||||||
}
|
}
|
||||||
if (Settings.gameDisplay==grid) {
|
if (Settings.gameDisplay==grid) {
|
||||||
int selectimg;
|
int selectimg;
|
||||||
@ -1384,31 +1425,36 @@ int MenuDiscList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gameSelected >= 0) && (gameSelected < (s32)gameCnt)) {
|
if (((gameSelected >= 0) && (gameSelected < (s32)gameCnt)) || dvdMounted) {
|
||||||
if(searchBar)
|
if(searchBar)
|
||||||
{
|
{
|
||||||
HaltGui();
|
HaltGui();
|
||||||
mainWindow->Remove(searchBar);
|
mainWindow->Remove(searchBar);
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
}
|
}
|
||||||
rockout();
|
rockout();
|
||||||
struct discHdr *header = &gameList[gameSelected];
|
struct discHdr *header = (dvdMounted?dvdheader:&gameList[gameSelected]);
|
||||||
WBFS_GameSize(header->id, &size);
|
// struct discHdr *header = dvdheader:&gameList[gameSelected]);
|
||||||
if (strlen(get_title(header)) < (MAX_CHARACTERS + 3)) {
|
if (!dvdMounted)//only get this stuff it we are booting a game from USB
|
||||||
sprintf(text, "%s", get_title(header));
|
{
|
||||||
} else {
|
WBFS_GameSize(header->id, &size);
|
||||||
strlcpy(text, get_title(header), MAX_CHARACTERS+1);
|
if (strlen(get_title(header)) < (MAX_CHARACTERS + 3)) {
|
||||||
text[MAX_CHARACTERS] = '\0';
|
sprintf(text, "%s", get_title(header));
|
||||||
strcat(text, "...");
|
} else {
|
||||||
}
|
strncpy(text, get_title(header), MAX_CHARACTERS);
|
||||||
|
text[MAX_CHARACTERS] = '\0';
|
||||||
|
strncat(text, "...", 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//check if alt Dol and gct file is present
|
//check if alt Dol and gct file is present
|
||||||
FILE *exeFile = NULL;
|
FILE *exeFile = NULL;
|
||||||
char nipple[100];
|
char nipple[100];
|
||||||
header = &gameList[gameSelected]; //reset header
|
header = (dvdMounted?dvdheader:&gameList[gameSelected]); //reset header
|
||||||
snprintf (IDfull,sizeof(IDfull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
|
snprintf (IDfull,sizeof(IDfull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
|
||||||
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
|
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
|
||||||
if (game_cfg) {
|
|
||||||
|
if (game_cfg) {
|
||||||
alternatedol = game_cfg->loadalternatedol;
|
alternatedol = game_cfg->loadalternatedol;
|
||||||
ocarinaChoice = game_cfg->ocarina;
|
ocarinaChoice = game_cfg->ocarina;
|
||||||
} else {
|
} else {
|
||||||
@ -1518,7 +1564,7 @@ int MenuDiscList() {
|
|||||||
menu = MENU_EXIT;
|
menu = MENU_EXIT;
|
||||||
|
|
||||||
} else if (choice == 2) {
|
} else if (choice == 2) {
|
||||||
wiilight(0);
|
wiilight(0);
|
||||||
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);
|
||||||
@ -1527,7 +1573,7 @@ int MenuDiscList() {
|
|||||||
ResumeGui();
|
ResumeGui();
|
||||||
|
|
||||||
//re-evaluate header now in case they changed games while on the game prompt
|
//re-evaluate header now in case they changed games while on the game prompt
|
||||||
header = &gameList[gameSelected];
|
header = (dvdMounted?dvdheader:&gameList[gameSelected]);
|
||||||
int settret = GameSettings(header);
|
int settret = GameSettings(header);
|
||||||
/* unneeded for now, kept in case database gets a separate language setting
|
/* unneeded for now, kept in case database gets a separate language setting
|
||||||
//menu = MENU_DISCLIST; // refresh titles (needed if the language setting has changed)
|
//menu = MENU_DISCLIST; // refresh titles (needed if the language setting has changed)
|
||||||
@ -1546,7 +1592,7 @@ int MenuDiscList() {
|
|||||||
rockout(2);
|
rockout(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (choice == 3) { //WBFS renaming
|
else if (choice == 3 && !dvdMounted) { //WBFS renaming
|
||||||
wiilight(0);
|
wiilight(0);
|
||||||
//re-evaluate header now in case they changed games while on the game prompt
|
//re-evaluate header now in case they changed games while on the game prompt
|
||||||
header = &gameList[gameSelected];
|
header = &gameList[gameSelected];
|
||||||
@ -1563,6 +1609,7 @@ int MenuDiscList() {
|
|||||||
}
|
}
|
||||||
} else if (choice == 0) {
|
} else if (choice == 0) {
|
||||||
rockout(2);
|
rockout(2);
|
||||||
|
dvdMounted =0;
|
||||||
if (Settings.gameDisplay==list) {
|
if (Settings.gameDisplay==list) {
|
||||||
gameBrowser->SetFocus(1);
|
gameBrowser->SetFocus(1);
|
||||||
} else if (Settings.gameDisplay==grid) {
|
} else if (Settings.gameDisplay==grid) {
|
||||||
@ -1600,7 +1647,7 @@ int MenuDiscList() {
|
|||||||
|
|
||||||
// set alt dol default
|
// set alt dol default
|
||||||
if (menu == MENU_EXIT && altdoldefault) {
|
if (menu == MENU_EXIT && altdoldefault) {
|
||||||
struct discHdr *header = &gameList[gameSelected];
|
struct discHdr *header = (dvdMounted?dvdheader:&gameList[gameSelected]);
|
||||||
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
|
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
|
||||||
// use default only if no alt dol was selected manually
|
// use default only if no alt dol was selected manually
|
||||||
if (game_cfg) {
|
if (game_cfg) {
|
||||||
@ -1640,6 +1687,8 @@ int MenuDiscList() {
|
|||||||
gameGrid = NULL;
|
gameGrid = NULL;
|
||||||
delete gameCarousel;
|
delete gameCarousel;
|
||||||
gameCarousel = NULL;
|
gameCarousel = NULL;
|
||||||
|
//delete dvdheader;
|
||||||
|
//dvdheader = NULL;
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
@ -2113,7 +2162,12 @@ int MainMenu(int menu) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//MemInfoPrompt();
|
//MemInfoPrompt();
|
||||||
|
if (dvdMounted)
|
||||||
|
{
|
||||||
|
char tmp[30];
|
||||||
|
sprintf(tmp,"boot method --> %i",dvdMounted);
|
||||||
|
WindowPrompt(0,tmp,0,0,0,0,100);
|
||||||
|
}
|
||||||
CloseXMLDatabase();
|
CloseXMLDatabase();
|
||||||
ExitGUIThreads();
|
ExitGUIThreads();
|
||||||
bgMusic->Stop();
|
bgMusic->Stop();
|
||||||
@ -2131,6 +2185,11 @@ int MainMenu(int menu) {
|
|||||||
delete fontSystem;
|
delete fontSystem;
|
||||||
ShutdownAudio();
|
ShutdownAudio();
|
||||||
StopGX();
|
StopGX();
|
||||||
|
if (dvdMounted==2)
|
||||||
|
{
|
||||||
|
WII_Initialize();
|
||||||
|
WII_LaunchTitle(0x0000000100000100ULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (boothomebrew == 1) {
|
if (boothomebrew == 1) {
|
||||||
BootHomebrew(Settings.selected_homebrew);
|
BootHomebrew(Settings.selected_homebrew);
|
||||||
@ -2139,7 +2198,7 @@ int MainMenu(int menu) {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct discHdr *header = &gameList[gameSelected];
|
struct discHdr *header = (dvdMounted?dvdheader:&gameList[gameSelected]);
|
||||||
|
|
||||||
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
|
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
|
||||||
|
|
||||||
@ -2174,7 +2233,7 @@ int MainMenu(int menu) {
|
|||||||
}
|
}
|
||||||
reloadblock = off;
|
reloadblock = off;
|
||||||
}
|
}
|
||||||
int ios2;
|
int ios2;
|
||||||
switch (iosChoice) {
|
switch (iosChoice) {
|
||||||
case i249:
|
case i249:
|
||||||
ios2 = 249;
|
ios2 = 249;
|
||||||
@ -2200,15 +2259,24 @@ int MainMenu(int menu) {
|
|||||||
Sys_IosReload(249);
|
Sys_IosReload(249);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = Disc_SetUSB(header->id);
|
if (!dvdMounted)
|
||||||
if (ret < 0) Sys_BackToLoader();
|
{
|
||||||
|
ret = Disc_SetUSB(header->id);
|
||||||
|
if (ret < 0) Sys_BackToLoader();
|
||||||
|
}
|
||||||
ret = Disc_Open();
|
ret = Disc_Open();
|
||||||
if (ret < 0) Sys_BackToLoader();
|
if (ret < 0) Sys_BackToLoader();
|
||||||
|
|
||||||
SDCard_deInit();
|
SDCard_deInit();
|
||||||
USBDevice_deInit();
|
USBDevice_deInit();
|
||||||
|
|
||||||
if (reloadblock == on && (IOS_GetVersion() == 222 || IOS_GetVersion() == 223)) {
|
if (gameList){
|
||||||
|
free(gameList);
|
||||||
|
}
|
||||||
|
if(dvdheader)
|
||||||
|
delete dvdheader;
|
||||||
|
|
||||||
|
if (reloadblock == on && (IOS_GetVersion() == 222 || IOS_GetVersion() == 223)) {
|
||||||
patch_cios_data();
|
patch_cios_data();
|
||||||
mload_close();
|
mload_close();
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
#include "settings/cfg.h"
|
#include "settings/cfg.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "../wad/title.h"
|
#include "../wad/title.h"
|
||||||
|
#include "../patches/dvd_broadway.h"
|
||||||
|
|
||||||
|
#define BC 0x0000000100000100ULL
|
||||||
|
|
||||||
/*** Extern functions ***/
|
/*** Extern functions ***/
|
||||||
extern void ResumeGui();
|
extern void ResumeGui();
|
||||||
@ -27,25 +30,28 @@ extern void HaltGui();
|
|||||||
extern GuiWindow * mainWindow;
|
extern GuiWindow * mainWindow;
|
||||||
extern u8 shutdown;
|
extern u8 shutdown;
|
||||||
extern u8 reset;
|
extern u8 reset;
|
||||||
|
extern u8 dvdMounted;
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
*Game specific settings
|
*Disk Browser
|
||||||
*********************************************************************************/
|
*********************************************************************************/
|
||||||
int DiscBrowse(struct discHdr * header) {
|
int DiscBrowse(struct discHdr * header) {
|
||||||
bool exit = false;
|
bool exit = false;
|
||||||
int ret, choice;
|
int ret, choice;
|
||||||
u64 offset;
|
u64 offset;
|
||||||
|
|
||||||
//Halt Gui seems to fix that pain in the ass code dump. We'll see.
|
|
||||||
HaltGui();
|
HaltGui();
|
||||||
ret = Disc_SetUSB(header->id);
|
if (!dvdMounted)
|
||||||
if (ret < 0) {
|
{
|
||||||
ResumeGui();
|
ret = Disc_SetUSB(header->id);
|
||||||
WindowPrompt(tr("ERROR:"), tr("Could not set USB."), tr("OK"));
|
if (ret < 0) {
|
||||||
return ret;
|
ResumeGui();
|
||||||
}
|
WindowPrompt(tr("ERROR:"), tr("Could not set USB."), tr("OK"));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = Disc_Open();
|
ret = Disc_Open();
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
WindowPrompt(tr("ERROR:"), tr("Could not open disc."), tr("OK"));
|
WindowPrompt(tr("ERROR:"), tr("Could not open disc."), tr("OK"));
|
||||||
@ -65,8 +71,8 @@ int DiscBrowse(struct discHdr * header) {
|
|||||||
WindowPrompt(tr("ERROR:"), tr("Could not open WBFS partition"), tr("OK"));
|
WindowPrompt(tr("ERROR:"), tr("Could not open WBFS partition"), tr("OK"));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int *buffer = (int*)allocate_memory(0x20);
|
int *buffer = (int*)allocate_memory(0x20);
|
||||||
|
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
@ -80,8 +86,8 @@ int DiscBrowse(struct discHdr * header) {
|
|||||||
WindowPrompt(tr("ERROR:"), tr("Could not read the disc."), tr("OK"));
|
WindowPrompt(tr("ERROR:"), tr("Could not read the disc."), tr("OK"));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *fstbuffer = allocate_memory(buffer[2]*4);
|
void *fstbuffer = allocate_memory(buffer[2]*4);
|
||||||
FST_ENTRY *fst = (FST_ENTRY *)fstbuffer;
|
FST_ENTRY *fst = (FST_ENTRY *)fstbuffer;
|
||||||
|
|
||||||
if (fst == NULL) {
|
if (fst == NULL) {
|
||||||
@ -193,7 +199,6 @@ int DiscBrowse(struct discHdr * header) {
|
|||||||
mainWindow->Append(&w);
|
mainWindow->Append(&w);
|
||||||
|
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
|
|
||||||
while (!exit) {
|
while (!exit) {
|
||||||
VIDEO_WaitVSync();
|
VIDEO_WaitVSync();
|
||||||
|
|
||||||
@ -396,3 +401,50 @@ int autoSelectDolMenu(const char *id, bool force) {
|
|||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/********************************************************************************
|
||||||
|
* Mount a DVD, get the type and ID.
|
||||||
|
*********************************************************************************/
|
||||||
|
static vu32 dvddone = 0;
|
||||||
|
static dvddiskid *g_diskID = (dvddiskid*)0x80000000;
|
||||||
|
void __dvd_readidcb(s32 result)
|
||||||
|
{
|
||||||
|
dvddone = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
u8 DiscMount(char *id) {
|
||||||
|
int ret;
|
||||||
|
char gameidbuffer[8];
|
||||||
|
HaltGui();
|
||||||
|
memset((char*)0x80000000, 0, 6);
|
||||||
|
|
||||||
|
ret = bwDVD_LowInit();
|
||||||
|
dvddone = 0;
|
||||||
|
ret = bwDVD_LowReset(__dvd_readidcb);
|
||||||
|
while(ret>=0 && dvddone==0);
|
||||||
|
|
||||||
|
dvddone = 0;
|
||||||
|
ret = bwDVD_LowReadID(g_diskID,__dvd_readidcb);
|
||||||
|
while(ret>=0 && dvddone==0);
|
||||||
|
|
||||||
|
memset(gameidbuffer, 0, 8);
|
||||||
|
memcpy(gameidbuffer, (char*)0x80000000, 6);
|
||||||
|
strcpy(id,gameidbuffer);
|
||||||
|
if(gameidbuffer[1] == 0 &&
|
||||||
|
gameidbuffer[2] == 0 &&
|
||||||
|
gameidbuffer[3] == 0 &&
|
||||||
|
gameidbuffer[4] == 0 &&
|
||||||
|
gameidbuffer[5] == 0 &&
|
||||||
|
gameidbuffer[6] == 0)
|
||||||
|
{
|
||||||
|
ResumeGui();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if(*((u32 *) 0x8000001C) == 0xC2339F3D){
|
||||||
|
ResumeGui();
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
ResumeGui();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
@ -11,5 +11,6 @@
|
|||||||
int DiscBrowse(struct discHdr * header);
|
int DiscBrowse(struct discHdr * header);
|
||||||
int autoSelectDol(const char *id, bool force);
|
int autoSelectDol(const char *id, bool force);
|
||||||
int autoSelectDolMenu(const char *id, bool force);
|
int autoSelectDolMenu(const char *id, bool force);
|
||||||
|
u8 DiscMount(char *id);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -51,6 +51,8 @@ extern float gamesize;
|
|||||||
extern struct discHdr * gameList;
|
extern struct discHdr * gameList;
|
||||||
extern u8 shutdown;
|
extern u8 shutdown;
|
||||||
extern u8 reset;
|
extern u8 reset;
|
||||||
|
extern u8 dvdMounted;
|
||||||
|
extern struct discHdr *dvdheader;
|
||||||
|
|
||||||
/*** Extern functions ***/
|
/*** Extern functions ***/
|
||||||
extern void ResumeGui();
|
extern void ResumeGui();
|
||||||
@ -1031,7 +1033,7 @@ int GameWindowPrompt() {
|
|||||||
GuiImage dialogBoxImg(&dialogBox);
|
GuiImage dialogBoxImg(&dialogBox);
|
||||||
|
|
||||||
GuiTooltip nameBtnTT(tr("Rename Game on WBFS"));
|
GuiTooltip nameBtnTT(tr("Rename Game on WBFS"));
|
||||||
if (Settings.wsprompt == yes)
|
if (Settings.wsprompt == yes && !dvdMounted)
|
||||||
nameBtnTT.SetWidescreen(CFG.widescreen);
|
nameBtnTT.SetWidescreen(CFG.widescreen);
|
||||||
GuiText nameTxt("", 22, THEME.prompttext);
|
GuiText nameTxt("", 22, THEME.prompttext);
|
||||||
if (Settings.wsprompt == yes)
|
if (Settings.wsprompt == yes)
|
||||||
@ -1046,7 +1048,7 @@ int GameWindowPrompt() {
|
|||||||
nameBtn.SetSoundClick(&btnClick);
|
nameBtn.SetSoundClick(&btnClick);
|
||||||
nameBtn.SetToolTip(&nameBtnTT,24,-30, ALIGN_LEFT);
|
nameBtn.SetToolTip(&nameBtnTT,24,-30, ALIGN_LEFT);
|
||||||
|
|
||||||
if (Settings.godmode == 1) {
|
if (Settings.godmode == 1 && !dvdMounted) {
|
||||||
nameBtn.SetTrigger(&trigA);
|
nameBtn.SetTrigger(&trigA);
|
||||||
nameBtn.SetEffectGrow();
|
nameBtn.SetEffectGrow();
|
||||||
}
|
}
|
||||||
@ -1088,7 +1090,7 @@ int GameWindowPrompt() {
|
|||||||
btn2Img.SetWidescreen(CFG.widescreen);
|
btn2Img.SetWidescreen(CFG.widescreen);
|
||||||
}
|
}
|
||||||
GuiButton btn2(&btn2Img,&btn2Img, 1, 5, 0, 0, &trigA, &btnSoundOver, &btnClick,1);
|
GuiButton btn2(&btn2Img,&btn2Img, 1, 5, 0, 0, &trigA, &btnSoundOver, &btnClick,1);
|
||||||
if (Settings.godmode == 1) {
|
if (Settings.godmode == 1 && dvdMounted!=2) {
|
||||||
btn2.SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM);
|
btn2.SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM);
|
||||||
btn2.SetPosition(-50, -40);
|
btn2.SetPosition(-50, -40);
|
||||||
} else {
|
} else {
|
||||||
@ -1138,15 +1140,18 @@ int GameWindowPrompt() {
|
|||||||
|
|
||||||
promptWindow.Append(&dialogBoxImg);
|
promptWindow.Append(&dialogBoxImg);
|
||||||
promptWindow.Append(&nameBtn);
|
promptWindow.Append(&nameBtn);
|
||||||
promptWindow.Append(&sizeTxt);
|
|
||||||
promptWindow.Append(&playcntTxt);
|
promptWindow.Append(&playcntTxt);
|
||||||
promptWindow.Append(&btn2);
|
promptWindow.Append(&btn2);
|
||||||
promptWindow.Append(&btnLeft);
|
if (!dvdMounted)//stuff we don't show if it is a DVD mounted
|
||||||
promptWindow.Append(&btnRight);
|
{
|
||||||
promptWindow.Append(&btnFavorite);
|
promptWindow.Append(&sizeTxt);
|
||||||
|
promptWindow.Append(&btnLeft);
|
||||||
|
promptWindow.Append(&btnRight);
|
||||||
|
promptWindow.Append(&btnFavorite);
|
||||||
|
}
|
||||||
|
|
||||||
//check if unlocked
|
//check if unlocked
|
||||||
if (Settings.godmode == 1) {
|
if (Settings.godmode == 1 && dvdMounted!=2) {
|
||||||
promptWindow.Append(&btn3);
|
promptWindow.Append(&btn3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1174,7 +1179,7 @@ int GameWindowPrompt() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//load disc image based or what game is seleted
|
//load disc image based or what game is seleted
|
||||||
struct discHdr * header = &gameList[gameSelected];
|
struct discHdr * header = (dvdMounted?dvdheader:&gameList[gameSelected]);
|
||||||
|
|
||||||
snprintf (ID,sizeof(ID),"%c%c%c", header->id[0], header->id[1], header->id[2]);
|
snprintf (ID,sizeof(ID),"%c%c%c", header->id[0], header->id[1], header->id[2]);
|
||||||
snprintf (IDFull,sizeof(IDFull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
|
snprintf (IDFull,sizeof(IDFull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
|
||||||
@ -1253,10 +1258,14 @@ int GameWindowPrompt() {
|
|||||||
nameTxt.SetEffect(EFFECT_FADE, 17);
|
nameTxt.SetEffect(EFFECT_FADE, 17);
|
||||||
} else
|
} else
|
||||||
diskImg.SetImage(diskCover);
|
diskImg.SetImage(diskCover);
|
||||||
|
|
||||||
WBFS_GameSize(header->id, &size);
|
if (!dvdMounted)
|
||||||
sizeTxt.SetTextf("%.2fGB", size); //set size text;
|
{
|
||||||
nameTxt.SetText(get_title(header));
|
WBFS_GameSize(header->id, &size);
|
||||||
|
sizeTxt.SetTextf("%.2fGB", size); //set size text;
|
||||||
|
}
|
||||||
|
|
||||||
|
nameTxt.SetText(!dvdMounted?get_title(header):IDFull);
|
||||||
|
|
||||||
struct Game_NUM* game_num = CFG_get_game_num(header->id);
|
struct Game_NUM* game_num = CFG_get_game_num(header->id);
|
||||||
if (game_num) {
|
if (game_num) {
|
||||||
@ -1312,7 +1321,6 @@ int GameWindowPrompt() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
choice = 1;
|
choice = 1;
|
||||||
//SDCard_deInit();// moved this into menu.cpp after checking for gct file and alt dol
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (btn2.GetState() == STATE_CLICKED) { //back
|
else if (btn2.GetState() == STATE_CLICKED) { //back
|
||||||
|
@ -35,6 +35,8 @@ extern GuiImageData * pointer[4];
|
|||||||
extern GuiImageData * background;
|
extern GuiImageData * background;
|
||||||
extern u8 shutdown;
|
extern u8 shutdown;
|
||||||
extern u8 reset;
|
extern u8 reset;
|
||||||
|
extern u8 dvdMounted;
|
||||||
|
extern struct discHdr *dvdheader;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* MenuSettings
|
* MenuSettings
|
||||||
@ -1795,18 +1797,26 @@ int GameSettings(struct discHdr * header) {
|
|||||||
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
|
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
|
||||||
|
|
||||||
char gameName[31];
|
char gameName[31];
|
||||||
|
if (!dvdMounted)
|
||||||
|
{
|
||||||
|
if (strlen(get_title(header)) < (27 + 3)) {
|
||||||
|
sprintf(gameName, "%s", get_title(header));
|
||||||
|
} else {
|
||||||
|
strncpy(gameName, get_title(header), 27);
|
||||||
|
gameName[27] = '\0';
|
||||||
|
strncat(gameName, "...", 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else sprintf(gameName, "%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
|
||||||
|
|
||||||
if (strlen(get_title(header)) < (27 + 3)) {
|
if (strlen(get_title(header)) < (27 + 3)) {
|
||||||
strcpy(gameName, get_title(header));
|
strcpy(gameName, get_title(header));
|
||||||
} else {
|
} else {
|
||||||
strlcpy(gameName, get_title(header), 27+1);
|
strlcpy(gameName, get_title(header), 27+1);
|
||||||
strcat(gameName, "...");
|
strcat(gameName, "...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GuiText titleTxt(!dvdMounted?get_title(header):gameName, 28, (GXColor) {0, 0, 0, 255});
|
||||||
|
|
||||||
|
|
||||||
GuiText titleTxt(get_title(header), 28, (GXColor) {0, 0, 0, 255});
|
|
||||||
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
titleTxt.SetPosition(12,40);
|
titleTxt.SetPosition(12,40);
|
||||||
titleTxt.SetMaxWidth(356, GuiText::SCROLL);
|
titleTxt.SetMaxWidth(356, GuiText::SCROLL);
|
||||||
@ -2373,7 +2383,7 @@ int GameSettings(struct discHdr * header) {
|
|||||||
switch (ret) {
|
switch (ret) {
|
||||||
case 0:
|
case 0:
|
||||||
choice1 = WindowPrompt(tr("Do you really want to delete:"),gameName,tr("Yes"),tr("Cancel"));
|
choice1 = WindowPrompt(tr("Do you really want to delete:"),gameName,tr("Yes"),tr("Cancel"));
|
||||||
if (choice1 == 1) {
|
if (choice1 == 1 && !dvdMounted) {
|
||||||
CFG_forget_game_opt(header->id);
|
CFG_forget_game_opt(header->id);
|
||||||
CFG_forget_game_num(header->id);
|
CFG_forget_game_num(header->id);
|
||||||
ret = WBFS_RemoveGame(header->id);
|
ret = WBFS_RemoveGame(header->id);
|
||||||
|
@ -279,6 +279,8 @@ void CFG_Default(int widescreen) { // -1 = non forced Mode
|
|||||||
THEME.gamelist_grid_y = 13;
|
THEME.gamelist_grid_y = 13;
|
||||||
THEME.gamelist_carousel_x = CFG.widescreen ? 480 : 500;
|
THEME.gamelist_carousel_x = CFG.widescreen ? 480 : 500;
|
||||||
THEME.gamelist_carousel_y = 13;
|
THEME.gamelist_carousel_y = 13;
|
||||||
|
THEME.gamelist_dvd_x = CFG.widescreen ? 512 : 540;
|
||||||
|
THEME.gamelist_dvd_y = 13;
|
||||||
|
|
||||||
THEME.gamegrid_favorite_x = CFG.widescreen ? 208 : 180;
|
THEME.gamegrid_favorite_x = CFG.widescreen ? 208 : 180;
|
||||||
THEME.gamegrid_favorite_y = 13;
|
THEME.gamegrid_favorite_y = 13;
|
||||||
@ -294,6 +296,8 @@ void CFG_Default(int widescreen) { // -1 = non forced Mode
|
|||||||
THEME.gamegrid_grid_y = 13;
|
THEME.gamegrid_grid_y = 13;
|
||||||
THEME.gamegrid_carousel_x = CFG.widescreen ? 400 : 420;
|
THEME.gamegrid_carousel_x = CFG.widescreen ? 400 : 420;
|
||||||
THEME.gamegrid_carousel_y = 13;
|
THEME.gamegrid_carousel_y = 13;
|
||||||
|
THEME.gamegrid_dvd_x = CFG.widescreen ? 432 : 460;
|
||||||
|
THEME.gamegrid_dvd_y = 13;
|
||||||
|
|
||||||
THEME.gamecarousel_favorite_x = CFG.widescreen ? 208 : 180;
|
THEME.gamecarousel_favorite_x = CFG.widescreen ? 208 : 180;
|
||||||
THEME.gamecarousel_favorite_y = 13;
|
THEME.gamecarousel_favorite_y = 13;
|
||||||
@ -309,6 +313,8 @@ void CFG_Default(int widescreen) { // -1 = non forced Mode
|
|||||||
THEME.gamecarousel_grid_y = 13;
|
THEME.gamecarousel_grid_y = 13;
|
||||||
THEME.gamecarousel_carousel_x = CFG.widescreen ? 400 : 420;
|
THEME.gamecarousel_carousel_x = CFG.widescreen ? 400 : 420;
|
||||||
THEME.gamecarousel_carousel_y = 13;
|
THEME.gamecarousel_carousel_y = 13;
|
||||||
|
THEME.gamecarousel_dvd_x = CFG.widescreen ? 432 : 460;
|
||||||
|
THEME.gamecarousel_dvd_y = 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Global_Default(void) {
|
void Global_Default(void) {
|
||||||
@ -571,6 +577,7 @@ void path_set(char *name, char *val) {
|
|||||||
#define OLD_LIST_ICON 8
|
#define OLD_LIST_ICON 8
|
||||||
#define OLD_GRID_ICON 16
|
#define OLD_GRID_ICON 16
|
||||||
#define OLD_CAROUSEL_ICON 32
|
#define OLD_CAROUSEL_ICON 32
|
||||||
|
#define OLD_DVD_ICON 64
|
||||||
short WorkAroundIconSet=0;
|
short WorkAroundIconSet=0;
|
||||||
short WorkAroundBarOffset=100;
|
short WorkAroundBarOffset=100;
|
||||||
|
|
||||||
@ -647,6 +654,10 @@ void theme_set(char *name, char *val) {
|
|||||||
else CFG_COORDS2(gamegrid_carousel)
|
else CFG_COORDS2(gamegrid_carousel)
|
||||||
else CFG_COORDS2(gamecarousel_carousel)
|
else CFG_COORDS2(gamecarousel_carousel)
|
||||||
|
|
||||||
|
else CFG_COORDS2(gamelist_dvd)
|
||||||
|
else CFG_COORDS2(gamegrid_dvd)
|
||||||
|
else CFG_COORDS2(gamecarousel_dvd)
|
||||||
|
|
||||||
//**********************************
|
//**********************************
|
||||||
// Workaround for old Themes
|
// Workaround for old Themes
|
||||||
//**********************************
|
//**********************************
|
||||||
@ -748,6 +759,17 @@ void theme_set(char *name, char *val) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (strcmp(cfg_name, "dvd_coords") == 0) {
|
||||||
|
short x,y;
|
||||||
|
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
|
||||||
|
if(!CFG.widescreen) x+=24;
|
||||||
|
THEME.gamelist_dvd_x = x;
|
||||||
|
THEME.gamegrid_dvd_x = THEME.gamecarousel_dvd_x = x-WorkAroundBarOffset;
|
||||||
|
THEME.gamelist_dvd_y = THEME.gamegrid_dvd_y = THEME.gamecarousel_dvd_y = y;
|
||||||
|
WorkAroundIconSet |= OLD_DVD_ICON;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if (strcmp(cfg_name, "sortBarOffset") == 0) {
|
else if (strcmp(cfg_name, "sortBarOffset") == 0) {
|
||||||
short o;
|
short o;
|
||||||
if (sscanf(val, "%hd", &o) == 1) {
|
if (sscanf(val, "%hd", &o) == 1) {
|
||||||
@ -783,6 +805,11 @@ void theme_set(char *name, char *val) {
|
|||||||
THEME.gamegrid_carousel_x += WorkAroundBarOffset - o;
|
THEME.gamegrid_carousel_x += WorkAroundBarOffset - o;
|
||||||
THEME.gamecarousel_carousel_x += WorkAroundBarOffset - o;
|
THEME.gamecarousel_carousel_x += WorkAroundBarOffset - o;
|
||||||
}
|
}
|
||||||
|
if(WorkAroundIconSet & OLD_DVD_ICON)
|
||||||
|
{
|
||||||
|
THEME.gamegrid_dvd_x += WorkAroundBarOffset - o;
|
||||||
|
THEME.gamecarousel_dvd_x += WorkAroundBarOffset - o;
|
||||||
|
}
|
||||||
WorkAroundBarOffset = o;
|
WorkAroundBarOffset = o;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,6 +143,8 @@ extern "C" {
|
|||||||
short gamelist_grid_y;
|
short gamelist_grid_y;
|
||||||
short gamelist_carousel_x;
|
short gamelist_carousel_x;
|
||||||
short gamelist_carousel_y;
|
short gamelist_carousel_y;
|
||||||
|
short gamelist_dvd_x;
|
||||||
|
short gamelist_dvd_y;
|
||||||
// Toolbar Icons in GameGrid
|
// Toolbar Icons in GameGrid
|
||||||
short gamegrid_favorite_x;
|
short gamegrid_favorite_x;
|
||||||
short gamegrid_favorite_y;
|
short gamegrid_favorite_y;
|
||||||
@ -158,6 +160,8 @@ extern "C" {
|
|||||||
short gamegrid_grid_y;
|
short gamegrid_grid_y;
|
||||||
short gamegrid_carousel_x;
|
short gamegrid_carousel_x;
|
||||||
short gamegrid_carousel_y;
|
short gamegrid_carousel_y;
|
||||||
|
short gamegrid_dvd_x;
|
||||||
|
short gamegrid_dvd_y;
|
||||||
// Toolbar Icons in GameCarousel
|
// Toolbar Icons in GameCarousel
|
||||||
short gamecarousel_favorite_x;
|
short gamecarousel_favorite_x;
|
||||||
short gamecarousel_favorite_y;
|
short gamecarousel_favorite_y;
|
||||||
@ -173,6 +177,8 @@ extern "C" {
|
|||||||
short gamecarousel_grid_y;
|
short gamecarousel_grid_y;
|
||||||
short gamecarousel_carousel_x;
|
short gamecarousel_carousel_x;
|
||||||
short gamecarousel_carousel_y;
|
short gamecarousel_carousel_y;
|
||||||
|
short gamecarousel_dvd_x;
|
||||||
|
short gamecarousel_dvd_y;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
#include "apploader.h"
|
#include "apploader.h"
|
||||||
#include "wdvd.h"
|
#include "wdvd.h"
|
||||||
#include "fstfile.h"
|
#include "fstfile.h"
|
||||||
|
#include "../patches/dvd_broadway.h"
|
||||||
|
|
||||||
|
extern u8 dvdMounted;
|
||||||
|
|
||||||
/** Alternate dolloader made by WiiPower modified by dimok **/
|
/** Alternate dolloader made by WiiPower modified by dimok **/
|
||||||
bool Load_Dol(void **buffer, int* dollen, char * filepath) {
|
bool Load_Dol(void **buffer, int* dollen, char * filepath) {
|
||||||
@ -180,7 +183,11 @@ bool load_dol_image_modified(void **offset, u32 *pos, u32 *len) {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
static vu32 dvddone = 0;
|
||||||
|
void __dvd_readidcb(s32 result)
|
||||||
|
{
|
||||||
|
dvddone = result;
|
||||||
|
}
|
||||||
u32 Load_Dol_from_disc(u32 doloffset, u8 videoSelected, u8 patchcountrystring, u8 vipatch) {
|
u32 Load_Dol_from_disc(u32 doloffset, u8 videoSelected, u8 patchcountrystring, u8 vipatch) {
|
||||||
int ret;
|
int ret;
|
||||||
void *dol_header;
|
void *dol_header;
|
||||||
@ -191,8 +198,14 @@ u32 Load_Dol_from_disc(u32 doloffset, u8 videoSelected, u8 patchcountrystring, u
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = WDVD_Read(dol_header, sizeof(dolheader), (doloffset<<2));
|
if (!dvdMounted)ret = WDVD_Read(dol_header, sizeof(dolheader), (doloffset<<2));
|
||||||
|
|
||||||
|
else{
|
||||||
|
dvddone = 0;
|
||||||
|
ret = bwDVD_LowRead(dol_header, sizeof(dolheader), doloffset, __dvd_readidcb);
|
||||||
|
while(ret>=0 && dvddone==0);
|
||||||
|
}
|
||||||
|
|
||||||
entrypoint = load_dol_start(dol_header);
|
entrypoint = load_dol_start(dol_header);
|
||||||
|
|
||||||
if (entrypoint == 0) {
|
if (entrypoint == 0) {
|
||||||
@ -221,4 +234,5 @@ u32 Load_Dol_from_disc(u32 doloffset, u8 videoSelected, u8 patchcountrystring, u
|
|||||||
free(dol_header);
|
free(dol_header);
|
||||||
|
|
||||||
return entrypoint;
|
return entrypoint;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,15 @@
|
|||||||
#include "fstfile.h"
|
#include "fstfile.h"
|
||||||
#include "settings/cfg.h"
|
#include "settings/cfg.h"
|
||||||
|
|
||||||
|
#define BC 0x0000000100000100ULL
|
||||||
|
#define MIOS 0x0000000100000101ULL
|
||||||
|
static tikview view ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
/*KENOBI! - FISHEARS*/
|
/*KENOBI! - FISHEARS*/
|
||||||
extern const unsigned char kenobiwii[];
|
extern const unsigned char kenobiwii[];
|
||||||
extern const int kenobiwii_size;
|
extern const int kenobiwii_size;
|
||||||
/*KENOBI! - FISHEARS*/
|
/*KENOBI! - FISHEARS*/
|
||||||
|
extern u8 dvdMounted;
|
||||||
|
|
||||||
/* Apploader function pointers */
|
/* Apploader function pointers */
|
||||||
typedef int (*app_main)(void **dst, int *size, int *offset);
|
typedef int (*app_main)(void **dst, int *size, int *offset);
|
||||||
@ -300,6 +305,23 @@ s32 Apploader_Run(entry_point *entry, u8 cheat, u8 videoSelected, u8 vipatch, u8
|
|||||||
ret = WDVD_Read(appldr, appldr_len, APPLDR_OFFSET + 0x20);
|
ret = WDVD_Read(appldr, appldr_len, APPLDR_OFFSET + 0x20);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
if (dvdMounted==2)
|
||||||
|
{
|
||||||
|
int retval;
|
||||||
|
retval = ES_GetTicketViews(BC, &view, 1);
|
||||||
|
if (retval != 0){
|
||||||
|
// error. do something smart here like exit. anything besides return 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
WPAD_Shutdown();
|
||||||
|
*(volatile unsigned int *)0xCC003024 |= 7;
|
||||||
|
|
||||||
|
retval = ES_LaunchTitle(BC, &view); // bushing's code
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Set apploader entry function */
|
/* Set apploader entry function */
|
||||||
appldr_entry = (app_entry)buffer[4];
|
appldr_entry = (app_entry)buffer[4];
|
||||||
@ -309,7 +331,7 @@ s32 Apploader_Run(entry_point *entry, u8 cheat, u8 videoSelected, u8 vipatch, u8
|
|||||||
|
|
||||||
/* Initialize apploader */
|
/* Initialize apploader */
|
||||||
appldr_init(__noprint);
|
appldr_init(__noprint);
|
||||||
|
|
||||||
if (error002fix!=0) {
|
if (error002fix!=0) {
|
||||||
/* ERROR 002 fix (thanks to WiiPower for sharing this)*/
|
/* ERROR 002 fix (thanks to WiiPower for sharing this)*/
|
||||||
*(u32 *)0x80003140 = *(u32 *)0x80003188;
|
*(u32 *)0x80003140 = *(u32 *)0x80003188;
|
||||||
|
@ -318,6 +318,8 @@ s32 Disc_WiiBoot(u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring,
|
|||||||
return Disc_BootPartition(offset, videoselected, cheat, vipatch, patchcountrystring, error002fix, alternatedol, alternatedoloffset);
|
return Disc_BootPartition(offset, videoselected, cheat, vipatch, patchcountrystring, error002fix, alternatedol, alternatedoloffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void PatchCountryStrings(void *Address, int Size) {
|
void PatchCountryStrings(void *Address, int Size) {
|
||||||
u8 SearchPattern[4] = { 0x00, 0x00, 0x00, 0x00 };
|
u8 SearchPattern[4] = { 0x00, 0x00, 0x00, 0x00 };
|
||||||
u8 PatchData[4] = { 0x00, 0x00, 0x00, 0x00 };
|
u8 PatchData[4] = { 0x00, 0x00, 0x00, 0x00 };
|
||||||
|
Loading…
Reference in New Issue
Block a user