2011-01-20 16:00:55 +01:00
/****************************************************************************
2010-11-13 23:34:53 +01:00
* Copyright ( C ) 2010
* by Dimok
*
* This software is provided ' as - is ' , without any express or implied
* warranty . In no event will the authors be held liable for any
* damages arising from the use of this software .
*
* Permission is granted to anyone to use this software for any
* purpose , including commercial applications , and to alter it and
* redistribute it freely , subject to the following restrictions :
*
* 1. The origin of this software must not be misrepresented ; you
* must not claim that you wrote the original software . If you use
* this software in a product , an acknowledgment in the product
* documentation would be appreciated but is not required .
*
* 2. Altered source versions must be plainly marked as such , and
* must not be misrepresented as being the original software .
*
* 3. This notice may not be removed or altered from any source
* distribution .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
# include <unistd.h>
2011-01-09 11:45:29 +01:00
# include <gccore.h>
2010-11-13 23:34:53 +01:00
# include "settings/CSettings.h"
2012-05-06 12:59:58 +02:00
# include "settings/CGameStatistics.h"
2011-01-09 11:45:29 +01:00
# include "themes/CTheme.h"
2010-11-13 23:34:53 +01:00
# include "prompts/PromptWindows.h"
2011-01-09 11:45:29 +01:00
# include "prompts/DiscBrowser.h"
2011-12-20 22:41:00 +01:00
# include "prompts/filebrowser.h"
2011-01-21 20:43:59 +01:00
# include "usbloader/AlternateDOLOffsets.h"
2010-11-13 23:34:53 +01:00
# include "language/gettext.h"
# include "wad/nandtitle.h"
2011-05-30 21:49:12 +02:00
# include "system/IosLoader.h"
2011-01-09 11:45:29 +01:00
# include "GameLoadSM.hpp"
2010-11-13 23:34:53 +01:00
2011-05-28 21:52:00 +02:00
static const char * OnOffText [ ] =
2010-11-13 23:34:53 +01:00
{
2011-07-26 00:28:22 +02:00
trNOOP ( " OFF " ) ,
trNOOP ( " ON " ) ,
trNOOP ( " Auto " )
2010-11-13 23:34:53 +01:00
} ;
2011-05-28 21:52:00 +02:00
static const char * VideoModeText [ ] =
2010-11-13 23:34:53 +01:00
{
2011-07-26 00:28:22 +02:00
trNOOP ( " System Default " ) ,
trNOOP ( " Disc Default " ) ,
trNOOP ( " Force PAL50 " ) ,
trNOOP ( " Force PAL60 " ) ,
trNOOP ( " Force NTSC " ) ,
trNOOP ( " Region Patch " ) ,
trNOOP ( " Force PAL480p " ) ,
trNOOP ( " Force NTSC480p " ) ,
2010-11-13 23:34:53 +01:00
} ;
* Improved GameCube controller functions (patch by Dynamit)
R+Z=Screenshot, X=Gameinfo window, Y=Covers download
* Added Classic Controller and GameCube Controller support
in GameInfo window:
Right stick=3D Cover movement, X=Flip 3DCover 180°, L/R=Zoom
* Added Wifi6 and wifi10 pictures for GameInfo window.
(Thanks OriginalHamster)
* Added device priority selection for GameCube listing
in global Loader settings (SD->USB, or USB->SD)
* Added a "Use global" language setting for Gamecube games.
* Added support for USB devices with modified MBR's signature
to prevent WiiU's format message.
* Prevent Rockband cursor display on GameCube and WiiWare
games with "band" in the title (Crach bandicoot, Beach
Bandits, etc.)
* Added Dol's Video mode patcher in Loader/Game settings,
for games which couldn't be forced. (MadWorld, MotoGP08,
Mario Party 8, etc.)
♦ Region patch = Patches the dol's known video modes
to the region selected in "Video mode" setting,
but keep interlace/progressive references.
♦ ON = Patch all dol's known video modes to the one
selected in "Video mode" setting.
♦ ALL = Patch all dol's found video mode patterns
(even unknown video modes) to the one selected
in "Video mode" setting.
* DML: Updated DM(L) version detection up to v2.10
* DML: Automatically enable PADHook if Screenshot setting
is enabled
* DML: Fixed a bug where multiple video modes could be set
at the same time
* DEVO: Added a prompt if trying to launch a game from a
non FAT32 partition.
* DEVO: Added Direct Mapping Buttons setting (Devo r200+)
* DEVO: Added support for Language setting
* Language files updated: Chinese, French
2013-08-18 16:30:39 +02:00
static const char * VideoPatchDolText [ ] =
{
trNOOP ( " OFF " ) ,
trNOOP ( " Region Patch " ) ,
trNOOP ( " ON " ) ,
trNOOP ( " All " ) ,
} ;
2011-12-23 16:48:20 +01:00
static const char * AspectText [ ] =
{
trNOOP ( " Force 4:3 " ) ,
trNOOP ( " Force 16:9 " ) ,
trNOOP ( " System Default " )
} ;
2011-05-28 21:52:00 +02:00
static const char * LanguageText [ ] =
2010-11-13 23:34:53 +01:00
{
2011-07-26 00:28:22 +02:00
trNOOP ( " Japanese " ) ,
trNOOP ( " English " ) ,
trNOOP ( " German " ) ,
trNOOP ( " French " ) ,
trNOOP ( " Spanish " ) ,
trNOOP ( " Italian " ) ,
trNOOP ( " Dutch " ) ,
trNOOP ( " SChinese " ) ,
trNOOP ( " TChinese " ) ,
trNOOP ( " Korean " ) ,
trNOOP ( " Console Default " ) ,
2010-11-13 23:34:53 +01:00
} ;
2011-05-28 21:52:00 +02:00
static const char * ParentalText [ ] =
2010-12-29 16:42:26 +01:00
{
2011-07-26 00:28:22 +02:00
trNOOP ( " 0 (Everyone) " ) ,
trNOOP ( " 1 (Child 7+) " ) ,
trNOOP ( " 2 (Teen 12+) " ) ,
trNOOP ( " 3 (Mature 16+) " ) ,
trNOOP ( " 4 (Adults Only 18+) " )
2010-12-29 16:42:26 +01:00
} ;
2011-01-09 11:45:29 +01:00
static const char * AlternateDOLText [ ] =
2010-11-13 23:34:53 +01:00
{
2011-07-26 00:28:22 +02:00
trNOOP ( " OFF " ) ,
trNOOP ( " Select a DOL from Game " ) ,
trNOOP ( " Load From SD/USB " ) ,
trNOOP ( " List on Gamelaunch " ) ,
trNOOP ( " Default " ) ,
2010-11-13 23:34:53 +01:00
} ;
2011-09-03 11:39:26 +02:00
static const char * NandEmuText [ ] =
{
trNOOP ( " OFF " ) ,
trNOOP ( " Partial " ) ,
2015-07-05 16:44:24 +02:00
trNOOP ( " Full " ) ,
trNOOP ( " Neek " )
2011-09-03 11:39:26 +02:00
} ;
static const char * HooktypeText [ ] =
{
trNOOP ( " None " ) ,
trNOOP ( " VBI (Default) " ) ,
trNOOP ( " KPAD Read " ) ,
trNOOP ( " Joypad " ) ,
trNOOP ( " GXDraw " ) ,
trNOOP ( " GXFlush " ) ,
trNOOP ( " OSSleepThread " ) ,
trNOOP ( " AXNextFrame " ) ,
} ;
2014-07-12 15:17:58 +02:00
static const char * PrivServText [ ] =
{
trNOOP ( " OFF " ) ,
trNOOP ( " NoSSL only " ) ,
trNOOP ( " Wiimmfi.de " ) ,
} ;
2011-12-22 23:44:48 +01:00
GameLoadSM : : GameLoadSM ( struct discHdr * hdr )
: SettingsMenu ( tr ( " Game Load " ) , & GuiOptions , MENU_NONE ) ,
Header ( hdr )
2010-11-13 23:34:53 +01:00
{
2011-12-22 23:44:48 +01:00
GameConfig = * GameSettings . GetGameCFG ( ( const char * ) Header - > id ) ;
2011-07-26 00:28:22 +02:00
if ( ! btnOutline )
btnOutline = Resources : : GetImageData ( " button_dialogue_box.png " ) ;
if ( ! trigA )
trigA = new GuiTrigger ( ) ;
trigA - > SetSimpleTrigger ( - 1 , WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A , PAD_BUTTON_A ) ;
saveBtnTxt = new GuiText ( tr ( " Save " ) , 22 , thColor ( " r=0 g=0 b=0 a=255 - prompt windows button text color " ) ) ;
saveBtnTxt - > SetMaxWidth ( btnOutline - > GetWidth ( ) - 30 ) ;
saveBtnImg = new GuiImage ( btnOutline ) ;
if ( Settings . wsprompt = = ON )
{
saveBtnTxt - > SetWidescreen ( Settings . widescreen ) ;
saveBtnImg - > SetWidescreen ( Settings . widescreen ) ;
}
saveBtn = new GuiButton ( saveBtnImg , saveBtnImg , 2 , 3 , 180 , 400 , trigA , btnSoundOver , btnSoundClick2 , 1 ) ;
saveBtn - > SetLabel ( saveBtnTxt ) ;
Append ( saveBtn ) ;
SetOptionNames ( ) ;
SetOptionValues ( ) ;
2010-11-13 23:34:53 +01:00
}
2011-01-09 11:45:29 +01:00
GameLoadSM : : ~ GameLoadSM ( )
{
2011-07-26 00:28:22 +02:00
HaltGui ( ) ;
//! The rest is destroyed in SettingsMenu.cpp
Remove ( saveBtn ) ;
delete saveBtnTxt ;
delete saveBtnImg ;
delete saveBtn ;
ResumeGui ( ) ;
2011-01-09 11:45:29 +01:00
}
void GameLoadSM : : SetDefaultConfig ( )
{
2011-07-26 00:28:22 +02:00
char id [ 7 ] ;
snprintf ( id , sizeof ( id ) , GameConfig . id ) ;
2011-12-20 22:41:00 +01:00
GameSettings . SetDefault ( GameConfig ) ;
2011-07-26 00:28:22 +02:00
snprintf ( GameConfig . id , sizeof ( GameConfig . id ) , id ) ;
2011-01-09 11:45:29 +01:00
}
void GameLoadSM : : SetOptionNames ( )
2010-11-13 23:34:53 +01:00
{
2011-07-26 00:28:22 +02:00
int Idx = 0 ;
2012-02-09 22:18:16 +01:00
Options - > SetName ( Idx + + , " %s " , tr ( " Game Lock " ) ) ;
2012-05-06 12:59:58 +02:00
Options - > SetName ( Idx + + , " %s " , tr ( " Favorite Level " ) ) ;
2011-07-26 00:28:22 +02:00
Options - > SetName ( Idx + + , " %s " , tr ( " Video Mode " ) ) ;
* Improved GameCube controller functions (patch by Dynamit)
R+Z=Screenshot, X=Gameinfo window, Y=Covers download
* Added Classic Controller and GameCube Controller support
in GameInfo window:
Right stick=3D Cover movement, X=Flip 3DCover 180°, L/R=Zoom
* Added Wifi6 and wifi10 pictures for GameInfo window.
(Thanks OriginalHamster)
* Added device priority selection for GameCube listing
in global Loader settings (SD->USB, or USB->SD)
* Added a "Use global" language setting for Gamecube games.
* Added support for USB devices with modified MBR's signature
to prevent WiiU's format message.
* Prevent Rockband cursor display on GameCube and WiiWare
games with "band" in the title (Crach bandicoot, Beach
Bandits, etc.)
* Added Dol's Video mode patcher in Loader/Game settings,
for games which couldn't be forced. (MadWorld, MotoGP08,
Mario Party 8, etc.)
♦ Region patch = Patches the dol's known video modes
to the region selected in "Video mode" setting,
but keep interlace/progressive references.
♦ ON = Patch all dol's known video modes to the one
selected in "Video mode" setting.
♦ ALL = Patch all dol's found video mode patterns
(even unknown video modes) to the one selected
in "Video mode" setting.
* DML: Updated DM(L) version detection up to v2.10
* DML: Automatically enable PADHook if Screenshot setting
is enabled
* DML: Fixed a bug where multiple video modes could be set
at the same time
* DEVO: Added a prompt if trying to launch a game from a
non FAT32 partition.
* DEVO: Added Direct Mapping Buttons setting (Devo r200+)
* DEVO: Added support for Language setting
* Language files updated: Chinese, French
2013-08-18 16:30:39 +02:00
Options - > SetName ( Idx + + , " %s " , tr ( " Dol Video Patch " ) ) ;
2012-05-06 12:59:58 +02:00
Options - > SetName ( Idx + + , " %s " , tr ( " Sneek Video Patch " ) ) ;
* Improved GameCube controller functions (patch by Dynamit)
R+Z=Screenshot, X=Gameinfo window, Y=Covers download
* Added Classic Controller and GameCube Controller support
in GameInfo window:
Right stick=3D Cover movement, X=Flip 3DCover 180°, L/R=Zoom
* Added Wifi6 and wifi10 pictures for GameInfo window.
(Thanks OriginalHamster)
* Added device priority selection for GameCube listing
in global Loader settings (SD->USB, or USB->SD)
* Added a "Use global" language setting for Gamecube games.
* Added support for USB devices with modified MBR's signature
to prevent WiiU's format message.
* Prevent Rockband cursor display on GameCube and WiiWare
games with "band" in the title (Crach bandicoot, Beach
Bandits, etc.)
* Added Dol's Video mode patcher in Loader/Game settings,
for games which couldn't be forced. (MadWorld, MotoGP08,
Mario Party 8, etc.)
♦ Region patch = Patches the dol's known video modes
to the region selected in "Video mode" setting,
but keep interlace/progressive references.
♦ ON = Patch all dol's known video modes to the one
selected in "Video mode" setting.
♦ ALL = Patch all dol's found video mode patterns
(even unknown video modes) to the one selected
in "Video mode" setting.
* DML: Updated DM(L) version detection up to v2.10
* DML: Automatically enable PADHook if Screenshot setting
is enabled
* DML: Fixed a bug where multiple video modes could be set
at the same time
* DEVO: Added a prompt if trying to launch a game from a
non FAT32 partition.
* DEVO: Added Direct Mapping Buttons setting (Devo r200+)
* DEVO: Added support for Language setting
* Language files updated: Chinese, French
2013-08-18 16:30:39 +02:00
Options - > SetName ( Idx + + , " %s " , tr ( " VIDTV Patch " ) ) ;
2012-05-06 12:59:58 +02:00
Options - > SetName ( Idx + + , " %s " , tr ( " Aspect Ratio " ) ) ;
Options - > SetName ( Idx + + , " %s " , tr ( " Patch Country Strings " ) ) ;
2011-07-26 00:28:22 +02:00
Options - > SetName ( Idx + + , " %s " , tr ( " Game Language " ) ) ;
Options - > SetName ( Idx + + , " %s " , tr ( " Ocarina " ) ) ;
2014-07-12 15:17:58 +02:00
Options - > SetName ( Idx + + , " %s " , tr ( " Private Server " ) ) ;
2011-07-26 00:28:22 +02:00
Options - > SetName ( Idx + + , " %s " , tr ( " Parental Control " ) ) ;
2012-05-06 12:59:58 +02:00
Options - > SetName ( Idx + + , " %s " , tr ( " Hooktype " ) ) ;
Options - > SetName ( Idx + + , " %s " , tr ( " Wiird Debugger " ) ) ;
Options - > SetName ( Idx + + , " %s " , tr ( " Game IOS " ) ) ;
Options - > SetName ( Idx + + , " %s " , tr ( " Return To " ) ) ;
Options - > SetName ( Idx + + , " %s " , tr ( " Block IOS Reload " ) ) ;
2012-02-09 22:18:16 +01:00
//! Only wii games and emu nand channels
if ( Header - > type = = TYPE_GAME_WII_IMG
| | Header - > type = = TYPE_GAME_WII_DISC
| | Header - > type = = TYPE_GAME_EMUNANDCHAN )
2011-12-22 23:44:48 +01:00
{
Options - > SetName ( Idx + + , " %s " , tr ( " Nand Emulation " ) ) ;
Options - > SetName ( Idx + + , " %s " , tr ( " Nand Emu Path " ) ) ;
}
2012-02-09 22:18:16 +01:00
//! Only on Wii games
if ( Header - > type = = TYPE_GAME_WII_IMG | | Header - > type = = TYPE_GAME_WII_DISC )
{
Options - > SetName ( Idx + + , " %s " , tr ( " Alternate DOL " ) ) ;
Options - > SetName ( Idx + + , " %s " , tr ( " Select DOL Offset " ) ) ;
}
2010-11-13 23:34:53 +01:00
}
void GameLoadSM : : SetOptionValues ( )
{
2011-07-26 00:28:22 +02:00
int Idx = 0 ;
2012-02-09 22:18:16 +01:00
//! Settings: Game Lock
Options - > SetValue ( Idx + + , " %s " , tr ( OnOffText [ GameConfig . Locked ] ) ) ;
2012-05-06 12:59:58 +02:00
//! Settings: Favorite Level
Options - > SetValue ( Idx + + , " %i " , GameStatistics . GetFavoriteRank ( Header - > id ) ) ;
2011-07-26 00:28:22 +02:00
//! Settings: Video Mode
if ( GameConfig . video = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , tr ( VideoModeText [ GameConfig . video ] ) ) ;
* Improved GameCube controller functions (patch by Dynamit)
R+Z=Screenshot, X=Gameinfo window, Y=Covers download
* Added Classic Controller and GameCube Controller support
in GameInfo window:
Right stick=3D Cover movement, X=Flip 3DCover 180°, L/R=Zoom
* Added Wifi6 and wifi10 pictures for GameInfo window.
(Thanks OriginalHamster)
* Added device priority selection for GameCube listing
in global Loader settings (SD->USB, or USB->SD)
* Added a "Use global" language setting for Gamecube games.
* Added support for USB devices with modified MBR's signature
to prevent WiiU's format message.
* Prevent Rockband cursor display on GameCube and WiiWare
games with "band" in the title (Crach bandicoot, Beach
Bandits, etc.)
* Added Dol's Video mode patcher in Loader/Game settings,
for games which couldn't be forced. (MadWorld, MotoGP08,
Mario Party 8, etc.)
♦ Region patch = Patches the dol's known video modes
to the region selected in "Video mode" setting,
but keep interlace/progressive references.
♦ ON = Patch all dol's known video modes to the one
selected in "Video mode" setting.
♦ ALL = Patch all dol's found video mode patterns
(even unknown video modes) to the one selected
in "Video mode" setting.
* DML: Updated DM(L) version detection up to v2.10
* DML: Automatically enable PADHook if Screenshot setting
is enabled
* DML: Fixed a bug where multiple video modes could be set
at the same time
* DEVO: Added a prompt if trying to launch a game from a
non FAT32 partition.
* DEVO: Added Direct Mapping Buttons setting (Devo r200+)
* DEVO: Added support for Language setting
* Language files updated: Chinese, French
2013-08-18 16:30:39 +02:00
//! Settings: Dol Video Patch
if ( GameConfig . videoPatchDol = = INHERIT )
2012-05-06 12:59:58 +02:00
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
* Improved GameCube controller functions (patch by Dynamit)
R+Z=Screenshot, X=Gameinfo window, Y=Covers download
* Added Classic Controller and GameCube Controller support
in GameInfo window:
Right stick=3D Cover movement, X=Flip 3DCover 180°, L/R=Zoom
* Added Wifi6 and wifi10 pictures for GameInfo window.
(Thanks OriginalHamster)
* Added device priority selection for GameCube listing
in global Loader settings (SD->USB, or USB->SD)
* Added a "Use global" language setting for Gamecube games.
* Added support for USB devices with modified MBR's signature
to prevent WiiU's format message.
* Prevent Rockband cursor display on GameCube and WiiWare
games with "band" in the title (Crach bandicoot, Beach
Bandits, etc.)
* Added Dol's Video mode patcher in Loader/Game settings,
for games which couldn't be forced. (MadWorld, MotoGP08,
Mario Party 8, etc.)
♦ Region patch = Patches the dol's known video modes
to the region selected in "Video mode" setting,
but keep interlace/progressive references.
♦ ON = Patch all dol's known video modes to the one
selected in "Video mode" setting.
♦ ALL = Patch all dol's found video mode patterns
(even unknown video modes) to the one selected
in "Video mode" setting.
* DML: Updated DM(L) version detection up to v2.10
* DML: Automatically enable PADHook if Screenshot setting
is enabled
* DML: Fixed a bug where multiple video modes could be set
at the same time
* DEVO: Added a prompt if trying to launch a game from a
non FAT32 partition.
* DEVO: Added Direct Mapping Buttons setting (Devo r200+)
* DEVO: Added support for Language setting
* Language files updated: Chinese, French
2013-08-18 16:30:39 +02:00
Options - > SetValue ( Idx + + , " %s " , tr ( VideoPatchDolText [ GameConfig . videoPatchDol ] ) ) ;
2011-07-26 00:28:22 +02:00
2012-05-06 12:59:58 +02:00
//! Settings: Sneek Video Patch
if ( GameConfig . sneekVideoPatch = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , tr ( OnOffText [ GameConfig . sneekVideoPatch ] ) ) ;
2011-07-26 00:28:22 +02:00
* Improved GameCube controller functions (patch by Dynamit)
R+Z=Screenshot, X=Gameinfo window, Y=Covers download
* Added Classic Controller and GameCube Controller support
in GameInfo window:
Right stick=3D Cover movement, X=Flip 3DCover 180°, L/R=Zoom
* Added Wifi6 and wifi10 pictures for GameInfo window.
(Thanks OriginalHamster)
* Added device priority selection for GameCube listing
in global Loader settings (SD->USB, or USB->SD)
* Added a "Use global" language setting for Gamecube games.
* Added support for USB devices with modified MBR's signature
to prevent WiiU's format message.
* Prevent Rockband cursor display on GameCube and WiiWare
games with "band" in the title (Crach bandicoot, Beach
Bandits, etc.)
* Added Dol's Video mode patcher in Loader/Game settings,
for games which couldn't be forced. (MadWorld, MotoGP08,
Mario Party 8, etc.)
♦ Region patch = Patches the dol's known video modes
to the region selected in "Video mode" setting,
but keep interlace/progressive references.
♦ ON = Patch all dol's known video modes to the one
selected in "Video mode" setting.
♦ ALL = Patch all dol's found video mode patterns
(even unknown video modes) to the one selected
in "Video mode" setting.
* DML: Updated DM(L) version detection up to v2.10
* DML: Automatically enable PADHook if Screenshot setting
is enabled
* DML: Fixed a bug where multiple video modes could be set
at the same time
* DEVO: Added a prompt if trying to launch a game from a
non FAT32 partition.
* DEVO: Added Direct Mapping Buttons setting (Devo r200+)
* DEVO: Added support for Language setting
* Language files updated: Chinese, French
2013-08-18 16:30:39 +02:00
//! Settings: VIDTV Patch
if ( GameConfig . vipatch = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , tr ( OnOffText [ GameConfig . vipatch ] ) ) ;
2012-05-06 12:59:58 +02:00
//! Settings: Aspect Ratio
if ( GameConfig . aspectratio = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , tr ( AspectText [ GameConfig . aspectratio ] ) ) ;
2012-02-09 22:18:16 +01:00
2012-05-06 12:59:58 +02:00
//! Settings: Patch Country Strings
if ( GameConfig . patchcountrystrings = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , tr ( OnOffText [ GameConfig . patchcountrystrings ] ) ) ;
2011-12-23 16:48:20 +01:00
2011-07-26 00:28:22 +02:00
//! Settings: Game Language
if ( GameConfig . language = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , tr ( LanguageText [ GameConfig . language ] ) ) ;
//! Settings: Ocarina
if ( GameConfig . ocarina = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , tr ( OnOffText [ GameConfig . ocarina ] ) ) ;
2014-07-12 15:17:58 +02:00
//! Settings: Private Server
if ( GameConfig . PrivateServer = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , tr ( PrivServText [ GameConfig . PrivateServer ] ) ) ;
2011-07-26 00:28:22 +02:00
//! Settings: Parental Control
Options - > SetValue ( Idx + + , " %s " , tr ( ParentalText [ GameConfig . parentalcontrol ] ) ) ;
2012-05-06 12:59:58 +02:00
//! Settings: Hooktype
if ( GameConfig . Hooktype = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , tr ( HooktypeText [ GameConfig . Hooktype ] ) ) ;
2011-12-22 23:44:48 +01:00
2012-05-06 12:59:58 +02:00
//! Settings: Wiird Debugger
if ( GameConfig . WiirdDebugger = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , tr ( OnOffText [ GameConfig . WiirdDebugger ] ) ) ;
2012-02-09 22:18:16 +01:00
2012-05-06 12:59:58 +02:00
//! Settings: Game IOS
if ( GameConfig . ios = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %i " , GameConfig . ios ) ;
2012-02-09 22:18:16 +01:00
2012-05-06 12:59:58 +02:00
//! Settings: Return To
2015-07-05 16:44:24 +02:00
if ( Header - > type = = TYPE_GAME_EMUNANDCHAN & & EMUNAND_NEEK = = ( GameConfig . NandEmuMode = = INHERIT ? Settings . NandEmuChanMode : GameConfig . NandEmuMode ) )
{
Options - > SetValue ( Idx + + , " %s " , tr ( OnOffText [ GameConfig . returnTo ] ) ) ;
}
else if ( GameConfig . returnTo )
2012-05-06 12:59:58 +02:00
{
const char * TitleName = NULL ;
u64 tid = NandTitles . FindU32 ( Settings . returnTo ) ;
if ( tid > 0 )
TitleName = NandTitles . NameOf ( tid ) ;
Options - > SetValue ( Idx + + , " %s " , TitleName ? TitleName : strlen ( Settings . returnTo ) > 0 ?
Settings . returnTo : tr ( OnOffText [ 0 ] ) ) ;
}
else
{
Options - > SetValue ( Idx + + , " %s " , tr ( OnOffText [ 0 ] ) ) ;
2012-02-09 22:18:16 +01:00
}
2011-07-26 00:28:22 +02:00
2012-05-06 12:59:58 +02:00
//! Settings: Block IOS Reload
if ( GameConfig . iosreloadblock = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , tr ( OnOffText [ GameConfig . iosreloadblock ] ) ) ;
2012-02-09 22:18:16 +01:00
//! Only wii games and emu nand channels
if ( Header - > type = = TYPE_GAME_WII_IMG
| | Header - > type = = TYPE_GAME_WII_DISC
| | Header - > type = = TYPE_GAME_EMUNANDCHAN )
2011-12-22 23:44:48 +01:00
{
//! Settings: Nand Emulation
if ( GameConfig . NandEmuMode = = INHERIT )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , tr ( NandEmuText [ GameConfig . NandEmuMode ] ) ) ;
2011-09-03 11:39:26 +02:00
2011-12-22 23:44:48 +01:00
//! Settings: Nand Emu Path
if ( GameConfig . NandEmuPath . size ( ) = = 0 )
Options - > SetValue ( Idx + + , tr ( " Use global " ) ) ;
else
Options - > SetValue ( Idx + + , " %s " , GameConfig . NandEmuPath . c_str ( ) ) ;
}
2011-12-20 22:41:00 +01:00
2012-02-09 22:18:16 +01:00
//! Only on Wii games
if ( Header - > type = = TYPE_GAME_WII_IMG | | Header - > type = = TYPE_GAME_WII_DISC )
{
//! Settings: Alternate DOL
Options - > SetValue ( Idx + + , " %s " , tr ( AlternateDOLText [ GameConfig . loadalternatedol ] ) ) ;
2011-09-03 11:39:26 +02:00
2012-02-09 22:18:16 +01:00
//! Settings: Select DOL Offset
if ( GameConfig . loadalternatedol ! = 1 )
Options - > SetValue ( Idx + + , tr ( " Not required " ) ) ;
else
{
if ( GameConfig . alternatedolname . size ( ) ! = 0 )
2017-12-14 15:26:57 +01:00
Options - > SetValue ( Idx + + , " %i <%s> " , ( int ) GameConfig . alternatedolstart , GameConfig . alternatedolname . c_str ( ) ) ;
2012-02-09 22:18:16 +01:00
else
2017-12-14 15:26:57 +01:00
Options - > SetValue ( Idx + + , " %i " , ( int ) GameConfig . alternatedolstart ) ;
2012-02-09 22:18:16 +01:00
}
}
2010-11-13 23:34:53 +01:00
}
int GameLoadSM : : GetMenuInternal ( )
{
2011-07-26 00:28:22 +02:00
if ( saveBtn - > GetState ( ) = = STATE_CLICKED )
{
if ( GameSettings . AddGame ( GameConfig ) & & GameSettings . Save ( ) )
{
WindowPrompt ( tr ( " Successfully Saved " ) , 0 , tr ( " OK " ) ) ;
}
else
WindowPrompt ( tr ( " Save Failed. No device inserted? " ) , 0 , tr ( " OK " ) ) ;
saveBtn - > ResetState ( ) ;
}
int ret = optionBrowser - > GetClickedOption ( ) ;
if ( ret < 0 )
return MENU_NONE ;
int Idx = - 1 ;
2012-02-09 22:18:16 +01:00
//! Settings: Game Lock
2011-07-26 00:28:22 +02:00
if ( ret = = + + Idx )
{
2012-02-09 22:18:16 +01:00
if ( + + GameConfig . Locked > = MAX_ON_OFF ) GameConfig . Locked = 0 ;
2011-07-26 00:28:22 +02:00
}
2012-05-06 12:59:58 +02:00
//! Settings: Favorite Level
else if ( ret = = + + Idx )
{
int Level = GameStatistics . GetFavoriteRank ( Header - > id ) ;
if ( + + Level > 5 ) Level = 0 ;
GameStatistics . SetFavoriteRank ( Header - > id , Level ) ;
GameStatistics . Save ( ) ;
}
2012-02-09 22:18:16 +01:00
//! Settings: Video Mode
2011-07-26 00:28:22 +02:00
else if ( ret = = + + Idx )
{
2012-02-09 22:18:16 +01:00
if ( + + GameConfig . video > = VIDEO_MODE_MAX ) GameConfig . video = INHERIT ;
2011-07-26 00:28:22 +02:00
}
* Improved GameCube controller functions (patch by Dynamit)
R+Z=Screenshot, X=Gameinfo window, Y=Covers download
* Added Classic Controller and GameCube Controller support
in GameInfo window:
Right stick=3D Cover movement, X=Flip 3DCover 180°, L/R=Zoom
* Added Wifi6 and wifi10 pictures for GameInfo window.
(Thanks OriginalHamster)
* Added device priority selection for GameCube listing
in global Loader settings (SD->USB, or USB->SD)
* Added a "Use global" language setting for Gamecube games.
* Added support for USB devices with modified MBR's signature
to prevent WiiU's format message.
* Prevent Rockband cursor display on GameCube and WiiWare
games with "band" in the title (Crach bandicoot, Beach
Bandits, etc.)
* Added Dol's Video mode patcher in Loader/Game settings,
for games which couldn't be forced. (MadWorld, MotoGP08,
Mario Party 8, etc.)
♦ Region patch = Patches the dol's known video modes
to the region selected in "Video mode" setting,
but keep interlace/progressive references.
♦ ON = Patch all dol's known video modes to the one
selected in "Video mode" setting.
♦ ALL = Patch all dol's found video mode patterns
(even unknown video modes) to the one selected
in "Video mode" setting.
* DML: Updated DM(L) version detection up to v2.10
* DML: Automatically enable PADHook if Screenshot setting
is enabled
* DML: Fixed a bug where multiple video modes could be set
at the same time
* DEVO: Added a prompt if trying to launch a game from a
non FAT32 partition.
* DEVO: Added Direct Mapping Buttons setting (Devo r200+)
* DEVO: Added support for Language setting
* Language files updated: Chinese, French
2013-08-18 16:30:39 +02:00
//! Settings: Dol Video Patch
else if ( ret = = + + Idx )
2011-07-26 00:28:22 +02:00
{
* Improved GameCube controller functions (patch by Dynamit)
R+Z=Screenshot, X=Gameinfo window, Y=Covers download
* Added Classic Controller and GameCube Controller support
in GameInfo window:
Right stick=3D Cover movement, X=Flip 3DCover 180°, L/R=Zoom
* Added Wifi6 and wifi10 pictures for GameInfo window.
(Thanks OriginalHamster)
* Added device priority selection for GameCube listing
in global Loader settings (SD->USB, or USB->SD)
* Added a "Use global" language setting for Gamecube games.
* Added support for USB devices with modified MBR's signature
to prevent WiiU's format message.
* Prevent Rockband cursor display on GameCube and WiiWare
games with "band" in the title (Crach bandicoot, Beach
Bandits, etc.)
* Added Dol's Video mode patcher in Loader/Game settings,
for games which couldn't be forced. (MadWorld, MotoGP08,
Mario Party 8, etc.)
♦ Region patch = Patches the dol's known video modes
to the region selected in "Video mode" setting,
but keep interlace/progressive references.
♦ ON = Patch all dol's known video modes to the one
selected in "Video mode" setting.
♦ ALL = Patch all dol's found video mode patterns
(even unknown video modes) to the one selected
in "Video mode" setting.
* DML: Updated DM(L) version detection up to v2.10
* DML: Automatically enable PADHook if Screenshot setting
is enabled
* DML: Fixed a bug where multiple video modes could be set
at the same time
* DEVO: Added a prompt if trying to launch a game from a
non FAT32 partition.
* DEVO: Added Direct Mapping Buttons setting (Devo r200+)
* DEVO: Added support for Language setting
* Language files updated: Chinese, French
2013-08-18 16:30:39 +02:00
if ( + + GameConfig . videoPatchDol > = VIDEO_PATCH_DOL_MAX ) GameConfig . videoPatchDol = INHERIT ;
2012-05-06 12:59:58 +02:00
}
2011-07-26 00:28:22 +02:00
2012-05-06 12:59:58 +02:00
//! Settings: Sneek Video Patch
else if ( ret = = + + Idx )
{
if ( + + GameConfig . sneekVideoPatch > = MAX_ON_OFF ) GameConfig . sneekVideoPatch = INHERIT ;
}
2012-02-09 22:18:16 +01:00
* Improved GameCube controller functions (patch by Dynamit)
R+Z=Screenshot, X=Gameinfo window, Y=Covers download
* Added Classic Controller and GameCube Controller support
in GameInfo window:
Right stick=3D Cover movement, X=Flip 3DCover 180°, L/R=Zoom
* Added Wifi6 and wifi10 pictures for GameInfo window.
(Thanks OriginalHamster)
* Added device priority selection for GameCube listing
in global Loader settings (SD->USB, or USB->SD)
* Added a "Use global" language setting for Gamecube games.
* Added support for USB devices with modified MBR's signature
to prevent WiiU's format message.
* Prevent Rockband cursor display on GameCube and WiiWare
games with "band" in the title (Crach bandicoot, Beach
Bandits, etc.)
* Added Dol's Video mode patcher in Loader/Game settings,
for games which couldn't be forced. (MadWorld, MotoGP08,
Mario Party 8, etc.)
♦ Region patch = Patches the dol's known video modes
to the region selected in "Video mode" setting,
but keep interlace/progressive references.
♦ ON = Patch all dol's known video modes to the one
selected in "Video mode" setting.
♦ ALL = Patch all dol's found video mode patterns
(even unknown video modes) to the one selected
in "Video mode" setting.
* DML: Updated DM(L) version detection up to v2.10
* DML: Automatically enable PADHook if Screenshot setting
is enabled
* DML: Fixed a bug where multiple video modes could be set
at the same time
* DEVO: Added a prompt if trying to launch a game from a
non FAT32 partition.
* DEVO: Added Direct Mapping Buttons setting (Devo r200+)
* DEVO: Added support for Language setting
* Language files updated: Chinese, French
2013-08-18 16:30:39 +02:00
//! Settings: VIDTV Patch
if ( ret = = + + Idx )
{
if ( + + GameConfig . vipatch > = MAX_ON_OFF ) GameConfig . vipatch = INHERIT ;
}
2012-05-06 12:59:58 +02:00
//! Settings: Aspect Ratio
else if ( ret = = + + Idx )
{
if ( + + GameConfig . aspectratio > = ASPECT_MAX ) GameConfig . aspectratio = INHERIT ;
}
2012-02-09 22:18:16 +01:00
2012-05-06 12:59:58 +02:00
//! Settings: Patch Country Strings
if ( ret = = + + Idx )
{
if ( + + GameConfig . patchcountrystrings > = MAX_ON_OFF ) GameConfig . patchcountrystrings = INHERIT ;
2011-12-23 16:48:20 +01:00
}
2011-07-26 00:28:22 +02:00
//! Settings: Game Language
2012-02-09 22:18:16 +01:00
if ( ret = = + + Idx )
2011-07-26 00:28:22 +02:00
{
if ( + + GameConfig . language > = MAX_LANGUAGE ) GameConfig . language = INHERIT ;
}
//! Settings: Ocarina
else if ( ret = = + + Idx )
{
if ( + + GameConfig . ocarina > = MAX_ON_OFF ) GameConfig . ocarina = INHERIT ;
}
2014-07-12 15:17:58 +02:00
//! Settings: Private Server
else if ( ret = = + + Idx )
{
if ( + + GameConfig . PrivateServer > = PRIVSERV_MAX_CHOICE ) GameConfig . PrivateServer = INHERIT ;
}
2011-07-26 00:28:22 +02:00
//! Settings: Parental Control
else if ( ret = = + + Idx )
{
if ( + + GameConfig . parentalcontrol > = 5 ) GameConfig . parentalcontrol = 0 ;
}
2012-05-06 12:59:58 +02:00
//! Settings: Hooktype
if ( ret = = + + Idx )
2011-07-26 00:28:22 +02:00
{
2012-05-06 12:59:58 +02:00
if ( + + GameConfig . Hooktype > = 8 ) GameConfig . Hooktype = INHERIT ;
}
2011-07-26 00:28:22 +02:00
2012-05-06 12:59:58 +02:00
//! Settings: Wiird Debugger
else if ( ret = = + + Idx )
{
if ( + + GameConfig . WiirdDebugger > = MAX_ON_OFF ) GameConfig . WiirdDebugger = INHERIT ;
}
2011-12-20 22:41:00 +01:00
2012-05-06 12:59:58 +02:00
//! Settings: Game IOS
else if ( ret = = + + Idx )
{
char entered [ 4 ] ;
snprintf ( entered , sizeof ( entered ) , " %i " , GameConfig . ios ) ;
if ( OnScreenNumpad ( entered , sizeof ( entered ) ) )
2011-07-26 00:28:22 +02:00
{
2012-05-06 12:59:58 +02:00
int newIOS = atoi ( entered ) ;
if ( newIOS ! = INHERIT & & ( newIOS < 200 | | newIOS > 255 ) ) {
WindowPrompt ( tr ( " Error: " ) , tr ( " Invalid IOS number entered. Number must be -1 for inherit or 200 - 255. " ) , tr ( " OK " ) ) ;
}
else
2012-02-09 22:18:16 +01:00
{
2012-05-06 12:59:58 +02:00
GameConfig . ios = newIOS ;
2012-02-09 22:18:16 +01:00
if ( GameConfig . ios ! = INHERIT & & NandTitles . IndexOf ( TITLE_ID ( 1 , GameConfig . ios ) ) < 0 )
{
WindowPrompt ( tr ( " Warning: " ) , tr ( " This IOS was not found on the titles list. If you are sure you have it installed than ignore this warning. " ) , tr ( " OK " ) ) ;
}
else if ( GameConfig . ios = = 254 )
{
WindowPrompt ( tr ( " Warning: " ) , tr ( " This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning. " ) , tr ( " OK " ) ) ;
}
}
2011-07-26 00:28:22 +02:00
}
2012-05-06 12:59:58 +02:00
}
2011-07-26 00:28:22 +02:00
2012-05-06 12:59:58 +02:00
//! Settings: Return To
else if ( ret = = + + Idx )
{
if ( + + GameConfig . returnTo > = MAX_ON_OFF ) GameConfig . returnTo = 0 ;
}
2011-07-26 00:28:22 +02:00
2012-05-06 12:59:58 +02:00
//! Settings: Block IOS Reload
if ( ret = = + + Idx )
{
if ( + + GameConfig . iosreloadblock > = 3 ) GameConfig . iosreloadblock = INHERIT ;
2011-07-26 00:28:22 +02:00
}
2012-02-09 22:18:16 +01:00
//! Only wii games and emu nand channels
if ( Header - > type = = TYPE_GAME_WII_IMG
| | Header - > type = = TYPE_GAME_WII_DISC
| | Header - > type = = TYPE_GAME_EMUNANDCHAN )
2011-09-03 11:39:26 +02:00
{
2012-02-09 22:18:16 +01:00
//! Settings: Nand Emulation
if ( ret = = + + Idx )
{
2015-07-05 16:44:24 +02:00
if ( + + GameConfig . NandEmuMode > = EMUNAND_MAX ) GameConfig . NandEmuMode = INHERIT ;
2013-01-06 14:41:22 +01:00
2015-07-05 16:44:24 +02:00
// neek available only for EmuNAND Channels
if ( Header - > type ! = TYPE_GAME_EMUNANDCHAN & & GameConfig . NandEmuMode > = EMUNAND_NEEK )
GameConfig . NandEmuMode = INHERIT ;
2012-01-08 19:24:46 +01:00
2012-02-09 22:18:16 +01:00
//! On titles from emulated nand path disabling the nand emu mode is not allowed
if ( Header - > type = = TYPE_GAME_EMUNANDCHAN & & GameConfig . NandEmuMode = = OFF )
GameConfig . NandEmuMode = 1 ;
}
2011-09-03 11:39:26 +02:00
2012-02-09 22:18:16 +01:00
//! Settings: Nand Emu Path
else if ( ret = = + + Idx )
2011-12-20 22:41:00 +01:00
{
2013-01-06 14:41:22 +01:00
// If NandEmuPath is on root of the first FAT32 partition, allow rev17-21 cIOS for EmuNAND Channels
bool NandEmu_compatible = false ;
if ( Header - > type = = TYPE_GAME_EMUNANDCHAN )
{
NandEmu_compatible = IosLoader : : is_NandEmu_compatible ( NULL , GameConfig . ios = = INHERIT ? Settings . cios : GameConfig . ios ) ;
}
if ( ! IosLoader : : IsD2X ( GameConfig . ios = = INHERIT ? Settings . cios : GameConfig . ios ) & & ! NandEmu_compatible )
2012-02-09 22:18:16 +01:00
WindowPrompt ( tr ( " Error: " ) , tr ( " Nand Emulation is only available on D2X cIOS! " ) , tr ( " OK " ) ) ;
else
{
char entered [ 300 ] ;
snprintf ( entered , sizeof ( entered ) , GameConfig . NandEmuPath . c_str ( ) ) ;
2011-12-20 22:41:00 +01:00
2012-02-09 22:18:16 +01:00
HaltGui ( ) ;
GuiWindow * parent = ( GuiWindow * ) parentElement ;
if ( parent ) parent - > SetState ( STATE_DISABLED ) ;
this - > SetState ( STATE_DEFAULT ) ;
this - > Remove ( optionBrowser ) ;
ResumeGui ( ) ;
2011-12-20 22:41:00 +01:00
2012-02-09 22:18:16 +01:00
int result = BrowseDevice ( entered , sizeof ( entered ) , FB_DEFAULT , noFILES ) ;
2011-12-20 22:41:00 +01:00
2012-02-09 22:18:16 +01:00
if ( parent ) parent - > SetState ( STATE_DEFAULT ) ;
this - > Append ( optionBrowser ) ;
2011-12-20 22:41:00 +01:00
2012-02-09 22:18:16 +01:00
if ( result = = 1 )
{
if ( entered [ strlen ( entered ) - 1 ] ! = ' / ' )
strcat ( entered , " / " ) ;
2011-12-20 22:41:00 +01:00
2012-02-09 22:18:16 +01:00
GameConfig . NandEmuPath = entered ;
WindowPrompt ( tr ( " Path Changed " ) , 0 , tr ( " OK " ) ) ;
}
2011-12-20 22:41:00 +01:00
}
}
}
2012-02-09 22:18:16 +01:00
//! Only on Wii games
if ( Header - > type = = TYPE_GAME_WII_IMG | | Header - > type = = TYPE_GAME_WII_DISC )
2011-09-03 11:39:26 +02:00
{
2012-02-09 22:18:16 +01:00
//! Settings: Alternate DOL
if ( ret = = + + Idx )
{
if ( + + GameConfig . loadalternatedol > = ALT_DOL_MAX_CHOICE )
GameConfig . loadalternatedol = 0 ;
}
2011-09-03 11:39:26 +02:00
2012-02-09 22:18:16 +01:00
//! Settings: Select DOL Offset from Game
2012-05-06 12:59:58 +02:00
else if ( ( ret = = + + Idx )
2012-02-09 22:18:16 +01:00
& & ( GameConfig . loadalternatedol = = 1 ) )
{
GuiWindow * parentWindow = ( GuiWindow * ) parentElement ;
if ( parentWindow ) parentWindow - > SetState ( STATE_DISABLED ) ;
//alt dol menu for games that require more than a single alt dol
int autodol = autoSelectDolPrompt ( ( char * ) GameConfig . id ) ;
if ( autodol = = 0 )
{
if ( parentWindow ) parentWindow - > SetState ( STATE_DEFAULT ) ;
return MENU_NONE ; //Cancel Button pressed
}
2011-09-03 11:39:26 +02:00
2012-02-09 22:18:16 +01:00
char tmp [ 170 ] ;
if ( autodol > 0 )
{
GameConfig . alternatedolstart = autodol ;
snprintf ( tmp , sizeof ( tmp ) , " %s <%i> " , tr ( " AUTO " ) , autodol ) ;
GameConfig . alternatedolname = tmp ;
SetOptionValues ( ) ;
if ( parentWindow ) parentWindow - > SetState ( STATE_DEFAULT ) ;
return MENU_NONE ;
}
int res = DiscBrowse ( GameConfig . id , tmp , sizeof ( tmp ) ) ;
if ( res > = 0 )
{
GameConfig . alternatedolname = tmp ;
GameConfig . alternatedolstart = res ;
2017-12-14 15:26:57 +01:00
snprintf ( tmp , sizeof ( tmp ) , " %s %.6s - %i " , tr ( " It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team. " ) , ( char * ) GameConfig . id , ( int ) GameConfig . alternatedolstart ) ;
2012-02-09 22:18:16 +01:00
WindowPrompt ( 0 , tmp , tr ( " OK " ) ) ;
}
if ( GameConfig . alternatedolstart = = 0 )
GameConfig . loadalternatedol = 0 ;
if ( parentWindow ) parentWindow - > SetState ( STATE_DEFAULT ) ;
}
2011-07-26 00:28:22 +02:00
}
SetOptionValues ( ) ;
return MENU_NONE ;
2010-11-13 23:34:53 +01:00
}