mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-12-01 15:44:19 +01:00
add anti002 to game specific settings.
fixed codedump i made in customoptionbrowsers
This commit is contained in:
parent
eea639c177
commit
87c95b3cef
@ -182,7 +182,7 @@ GuiCustomOptionBrowser::GuiCustomOptionBrowser(int w, int h, customOptionList *
|
|||||||
optionTxt[i] = new GuiText(options->GetName(i), 20, (GXColor){THEME.settingsTxt_r, THEME.settingsTxt_g, THEME.settingsTxt_b, 0xff});
|
optionTxt[i] = new GuiText(options->GetName(i), 20, (GXColor){THEME.settingsTxt_r, THEME.settingsTxt_g, THEME.settingsTxt_b, 0xff});
|
||||||
optionTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
optionTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
||||||
optionTxt[i]->SetPosition(24,0);
|
optionTxt[i]->SetPosition(24,0);
|
||||||
optionVal[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), GuiText::DOTTED);
|
optionTxt[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), GuiText::DOTTED);
|
||||||
|
|
||||||
optionBg[i] = new GuiImage(bgOptionsEntry);
|
optionBg[i] = new GuiImage(bgOptionsEntry);
|
||||||
|
|
||||||
|
@ -1863,6 +1863,7 @@ int MainMenu(int menu)
|
|||||||
ocarinaChoice = game_cfg->ocarina;
|
ocarinaChoice = game_cfg->ocarina;
|
||||||
viChoice = game_cfg->vipatch;
|
viChoice = game_cfg->vipatch;
|
||||||
fix002 = game_cfg->errorfix002;
|
fix002 = game_cfg->errorfix002;
|
||||||
|
fix002anti = game_cfg->errorfix002anti;
|
||||||
iosChoice = game_cfg->ios;
|
iosChoice = game_cfg->ios;
|
||||||
countrystrings = game_cfg->patchcountrystrings;
|
countrystrings = game_cfg->patchcountrystrings;
|
||||||
alternatedol = game_cfg->loadalternatedol;
|
alternatedol = game_cfg->loadalternatedol;
|
||||||
@ -1878,6 +1879,7 @@ int MainMenu(int menu)
|
|||||||
iosChoice = i249;
|
iosChoice = i249;
|
||||||
}
|
}
|
||||||
fix002 = Settings.error002;
|
fix002 = Settings.error002;
|
||||||
|
fix002anti = Settings.anti002fix;
|
||||||
countrystrings = Settings.patchcountrystrings;
|
countrystrings = Settings.patchcountrystrings;
|
||||||
alternatedol = off;
|
alternatedol = off;
|
||||||
reloadblock = off;
|
reloadblock = off;
|
||||||
@ -1932,6 +1934,17 @@ int MainMenu(int menu)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u8 errorfixer002anti = 0;
|
||||||
|
switch(fix002anti)
|
||||||
|
{
|
||||||
|
case on:
|
||||||
|
errorfixer002anti = 1;
|
||||||
|
break;
|
||||||
|
case off:
|
||||||
|
errorfixer002anti = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch(languageChoice)
|
switch(languageChoice)
|
||||||
{
|
{
|
||||||
case ConsoleLangDefault:
|
case ConsoleLangDefault:
|
||||||
@ -2048,7 +2061,7 @@ int MainMenu(int menu)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = Disc_WiiBoot(videoselected, cheat, vipatch, countrystrings, errorfixer002, alternatedol);
|
ret = Disc_WiiBoot(videoselected, cheat, vipatch, countrystrings, errorfixer002, alternatedol, errorfixer002anti);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
Sys_LoadMenu();
|
Sys_LoadMenu();
|
||||||
}
|
}
|
||||||
|
@ -1744,7 +1744,7 @@ int GameSettings(struct discHdr * header)
|
|||||||
strncat(gameName, "...", 3);
|
strncat(gameName, "...", 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
customOptionList options3(12);
|
customOptionList options3(13);
|
||||||
options3.SetName(0,"%s", tr("Video Mode"));
|
options3.SetName(0,"%s", tr("Video Mode"));
|
||||||
options3.SetName(1,"%s", tr("VIDTV Patch"));
|
options3.SetName(1,"%s", tr("VIDTV Patch"));
|
||||||
options3.SetName(2,"%s", tr("Game Language"));
|
options3.SetName(2,"%s", tr("Game Language"));
|
||||||
@ -1755,8 +1755,9 @@ int GameSettings(struct discHdr * header)
|
|||||||
options3.SetName(7,"%s", tr("Patch Country Strings"));
|
options3.SetName(7,"%s", tr("Patch Country Strings"));
|
||||||
options3.SetName(8,"%s", tr("Alternate DOL"));
|
options3.SetName(8,"%s", tr("Alternate DOL"));
|
||||||
options3.SetName(9,"%s", tr("Block IOS Reload"));
|
options3.SetName(9,"%s", tr("Block IOS Reload"));
|
||||||
options3.SetName(10,"%s", tr("Reset Playcounter"));
|
options3.SetName(10,"%s", tr("Anti Error 002 fix"));
|
||||||
options3.SetName(11,"%s", tr("Default Gamesettings"));
|
options3.SetName(11,"%s", tr("Reset Playcounter"));
|
||||||
|
options3.SetName(12,"%s", tr("Default Gamesettings"));
|
||||||
|
|
||||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
|
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
|
||||||
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
|
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
|
||||||
@ -1852,6 +1853,7 @@ int GameSettings(struct discHdr * header)
|
|||||||
iosChoice = game_cfg->ios;
|
iosChoice = game_cfg->ios;
|
||||||
parentalcontrolChoice = game_cfg->parentalcontrol;
|
parentalcontrolChoice = game_cfg->parentalcontrol;
|
||||||
fix002 = game_cfg->errorfix002;
|
fix002 = game_cfg->errorfix002;
|
||||||
|
fix002anti = game_cfg->errorfix002anti;
|
||||||
countrystrings = game_cfg->patchcountrystrings;
|
countrystrings = game_cfg->patchcountrystrings;
|
||||||
alternatedol = game_cfg->loadalternatedol;
|
alternatedol = game_cfg->loadalternatedol;
|
||||||
reloadblock = game_cfg->iosreloadblock;
|
reloadblock = game_cfg->iosreloadblock;
|
||||||
@ -1869,6 +1871,7 @@ int GameSettings(struct discHdr * header)
|
|||||||
}
|
}
|
||||||
parentalcontrolChoice = 0;
|
parentalcontrolChoice = 0;
|
||||||
fix002 = Settings.error002;
|
fix002 = Settings.error002;
|
||||||
|
fix002anti = Settings.anti002fix;
|
||||||
countrystrings = Settings.patchcountrystrings;
|
countrystrings = Settings.patchcountrystrings;
|
||||||
alternatedol = off;
|
alternatedol = off;
|
||||||
reloadblock = off;
|
reloadblock = off;
|
||||||
@ -1929,8 +1932,13 @@ int GameSettings(struct discHdr * header)
|
|||||||
if (reloadblock == on) options3.SetValue(9,tr("ON"));
|
if (reloadblock == on) options3.SetValue(9,tr("ON"));
|
||||||
else if (reloadblock == off) options3.SetValue(9,tr("OFF"));
|
else if (reloadblock == off) options3.SetValue(9,tr("OFF"));
|
||||||
|
|
||||||
options3.SetValue(10, NULL);
|
if (fix002anti == on) options3.SetValue(10,tr("ON"));
|
||||||
|
else if (fix002anti == off) options3.SetValue(10,tr("OFF"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
options3.SetValue(11, NULL);
|
options3.SetValue(11, NULL);
|
||||||
|
options3.SetValue(12, NULL);
|
||||||
|
|
||||||
if(shutdown == 1)
|
if(shutdown == 1)
|
||||||
Sys_Shutdown();
|
Sys_Shutdown();
|
||||||
@ -1972,6 +1980,9 @@ int GameSettings(struct discHdr * header)
|
|||||||
reloadblock = (reloadblock+1) % 2;
|
reloadblock = (reloadblock+1) % 2;
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
|
fix002anti = (fix002anti+1) % 2;
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
int result;
|
int result;
|
||||||
result = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"),0,0);
|
result = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"),0,0);
|
||||||
if(result == 1) {
|
if(result == 1) {
|
||||||
@ -1989,7 +2000,7 @@ int GameSettings(struct discHdr * header)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 12:
|
||||||
int choice = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"),0,0);
|
int choice = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"),0,0);
|
||||||
if(choice == 1) {
|
if(choice == 1) {
|
||||||
videoChoice = Settings.video;
|
videoChoice = Settings.video;
|
||||||
@ -1997,6 +2008,7 @@ int GameSettings(struct discHdr * header)
|
|||||||
languageChoice = Settings.language;
|
languageChoice = Settings.language;
|
||||||
ocarinaChoice = Settings.ocarina;
|
ocarinaChoice = Settings.ocarina;
|
||||||
fix002 = Settings.error002;
|
fix002 = Settings.error002;
|
||||||
|
fix002anti = Settings.anti002fix;
|
||||||
countrystrings = Settings.patchcountrystrings;
|
countrystrings = Settings.patchcountrystrings;
|
||||||
alternatedol = off;
|
alternatedol = off;
|
||||||
reloadblock = off;
|
reloadblock = off;
|
||||||
|
@ -26,6 +26,7 @@ u8 viChoice = 0;
|
|||||||
u8 iosChoice = 0;
|
u8 iosChoice = 0;
|
||||||
u8 parentalcontrolChoice = 0;
|
u8 parentalcontrolChoice = 0;
|
||||||
u8 fix002 = 0;
|
u8 fix002 = 0;
|
||||||
|
u8 fix002anti = 0;
|
||||||
u8 reloadblock = 0;
|
u8 reloadblock = 0;
|
||||||
u8 countrystrings = 0;
|
u8 countrystrings = 0;
|
||||||
u8 alternatedol = 0;
|
u8 alternatedol = 0;
|
||||||
@ -1159,6 +1160,7 @@ void cfg_set_game_opt(struct Game_CFG *game, u8 *id)
|
|||||||
game->ios = iosChoice;
|
game->ios = iosChoice;
|
||||||
game->parentalcontrol = parentalcontrolChoice;
|
game->parentalcontrol = parentalcontrolChoice;
|
||||||
game->errorfix002 = fix002;
|
game->errorfix002 = fix002;
|
||||||
|
game->errorfix002anti = fix002anti;
|
||||||
game->iosreloadblock = reloadblock;
|
game->iosreloadblock = reloadblock;
|
||||||
game->patchcountrystrings = countrystrings;
|
game->patchcountrystrings = countrystrings;
|
||||||
game->loadalternatedol = alternatedol;
|
game->loadalternatedol = alternatedol;
|
||||||
@ -1324,6 +1326,11 @@ void game_set(char *name, char *val)
|
|||||||
game->errorfix002 = opt_c;
|
game->errorfix002 = opt_c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (strcmp("errorfix002anti", opt_name) == 0) {
|
||||||
|
if (sscanf(opt_val, "%hd", &opt_c) == 1) {
|
||||||
|
game->errorfix002anti = opt_c;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (strcmp("iosreloadblock", opt_name) == 0) {
|
if (strcmp("iosreloadblock", opt_name) == 0) {
|
||||||
if (sscanf(opt_val, "%hd", &opt_c) == 1) {
|
if (sscanf(opt_val, "%hd", &opt_c) == 1) {
|
||||||
game->iosreloadblock = opt_c;
|
game->iosreloadblock = opt_c;
|
||||||
@ -1484,6 +1491,7 @@ bool cfg_save_games()
|
|||||||
fprintf(f, "ios:%d; ", cfg_game[i].ios);
|
fprintf(f, "ios:%d; ", cfg_game[i].ios);
|
||||||
fprintf(f, "pctrl:%d; ", cfg_game[i].parentalcontrol);
|
fprintf(f, "pctrl:%d; ", cfg_game[i].parentalcontrol);
|
||||||
fprintf(f, "errorfix002:%d; ", cfg_game[i].errorfix002);
|
fprintf(f, "errorfix002:%d; ", cfg_game[i].errorfix002);
|
||||||
|
fprintf(f, "errorfix002anti:%d; ", cfg_game[i].errorfix002anti);
|
||||||
fprintf(f, "iosreloadblock:%d; ", cfg_game[i].iosreloadblock);
|
fprintf(f, "iosreloadblock:%d; ", cfg_game[i].iosreloadblock);
|
||||||
fprintf(f, "patchcountrystrings:%d; ", cfg_game[i].patchcountrystrings);
|
fprintf(f, "patchcountrystrings:%d; ", cfg_game[i].patchcountrystrings);
|
||||||
fprintf(f, "loadalternatedol:%d;\n", cfg_game[i].loadalternatedol);
|
fprintf(f, "loadalternatedol:%d;\n", cfg_game[i].loadalternatedol);
|
||||||
|
@ -152,6 +152,7 @@ extern u8 viChoice;
|
|||||||
extern u8 iosChoice;
|
extern u8 iosChoice;
|
||||||
extern u8 parentalcontrolChoice;
|
extern u8 parentalcontrolChoice;
|
||||||
extern u8 fix002;
|
extern u8 fix002;
|
||||||
|
extern u8 fix002anti;
|
||||||
extern u8 reloadblock;
|
extern u8 reloadblock;
|
||||||
extern u8 countrystrings;
|
extern u8 countrystrings;
|
||||||
extern u8 alternatedol;
|
extern u8 alternatedol;
|
||||||
@ -176,6 +177,7 @@ struct Game_CFG
|
|||||||
u8 ios;
|
u8 ios;
|
||||||
u8 parentalcontrol;
|
u8 parentalcontrol;
|
||||||
u8 errorfix002;
|
u8 errorfix002;
|
||||||
|
u8 errorfix002anti;
|
||||||
u8 iosreloadblock;
|
u8 iosreloadblock;
|
||||||
u8 loadalternatedol;
|
u8 loadalternatedol;
|
||||||
u8 patchcountrystrings;
|
u8 patchcountrystrings;
|
||||||
|
@ -287,12 +287,13 @@ void gamepatches(void * dst, int len, u8 videoSelected, u8 patchcountrystring, u
|
|||||||
if(patchcountrystring == 1)
|
if(patchcountrystring == 1)
|
||||||
PatchCountryStrings(dst, len);
|
PatchCountryStrings(dst, len);
|
||||||
|
|
||||||
if(Settings.anti002fix == on)
|
//if(Settings.anti002fix == on)
|
||||||
|
if(fix002anti == on)
|
||||||
Anti_002_fix(dst, len);
|
Anti_002_fix(dst, len);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 Apploader_Run(entry_point *entry, u8 cheat, u8 videoSelected, u8 vipatch, u8 patchcountrystring, u8 error002fix, u8 alternatedol)
|
s32 Apploader_Run(entry_point *entry, u8 cheat, u8 videoSelected, u8 vipatch, u8 patchcountrystring, u8 error002fix, u8 alternatedol, u8 error002fixanti)
|
||||||
{
|
{
|
||||||
app_entry appldr_entry;
|
app_entry appldr_entry;
|
||||||
app_init appldr_init;
|
app_init appldr_init;
|
||||||
@ -324,7 +325,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) || (Settings.anti002fix == on)){
|
if((error002fix) || (error002fixanti)){
|
||||||
/* 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;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ extern "C"
|
|||||||
typedef void (*entry_point)(void);
|
typedef void (*entry_point)(void);
|
||||||
|
|
||||||
/* Prototypes */
|
/* Prototypes */
|
||||||
s32 Apploader_Run(entry_point *, u8, u8, u8, u8, u8, u8);
|
s32 Apploader_Run(entry_point *, u8, u8, u8, u8, u8, u8, u8);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ s32 Disc_IsWii(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring, u8 error002fix, u8 alternatedol)
|
s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring, u8 error002fix, u8 alternatedol, u8 error002fixanti)
|
||||||
{
|
{
|
||||||
entry_point p_entry;
|
entry_point p_entry;
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 pa
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* Run apploader */
|
/* Run apploader */
|
||||||
ret = Apploader_Run(&p_entry, cheat, videoselected, vipatch, patchcountrystring, error002fix, alternatedol);
|
ret = Apploader_Run(&p_entry, cheat, videoselected, vipatch, patchcountrystring, error002fix, alternatedol, error002fixanti);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -308,7 +308,7 @@ s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 pa
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 Disc_WiiBoot(u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring, u8 error002fix, u8 alternatedol)
|
s32 Disc_WiiBoot(u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring, u8 error002fix, u8 alternatedol, u8 error002fixanti)
|
||||||
{
|
{
|
||||||
u64 offset;
|
u64 offset;
|
||||||
s32 ret;
|
s32 ret;
|
||||||
@ -319,7 +319,7 @@ s32 Disc_WiiBoot(u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* Boot partition */
|
/* Boot partition */
|
||||||
return Disc_BootPartition(offset, videoselected, cheat, vipatch, patchcountrystring, error002fix, alternatedol);
|
return Disc_BootPartition(offset, videoselected, cheat, vipatch, patchcountrystring, error002fix, alternatedol, error002fixanti);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PatchCountryStrings(void *Address, int Size)
|
void PatchCountryStrings(void *Address, int Size)
|
||||||
|
@ -46,8 +46,8 @@ void __Disc_SetLowMem(void);
|
|||||||
s32 Disc_SetUSB(u8 *);
|
s32 Disc_SetUSB(u8 *);
|
||||||
s32 Disc_ReadHeader(void *);
|
s32 Disc_ReadHeader(void *);
|
||||||
s32 Disc_IsWii(void);
|
s32 Disc_IsWii(void);
|
||||||
s32 Disc_BootPartition(u64, u8, u8, u8, u8, u8, u8);
|
s32 Disc_BootPartition(u64, u8, u8, u8, u8, u8, u8,u8);
|
||||||
s32 Disc_WiiBoot(u8, u8, u8, u8, u8, u8);
|
s32 Disc_WiiBoot(u8, u8, u8, u8, u8, u8, u8);
|
||||||
void PatchCountryStrings(void *Address, int Size);
|
void PatchCountryStrings(void *Address, int Size);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Loading…
Reference in New Issue
Block a user