usbloadergx/source/settings/CGameSettings.h
Cyan fa4b1d162b * Fixed missing games in "GameCube Delete menu" if
the "GameCube Source" setting has USB priority.
* Fixed Playlog writing when using Hermes cIOS v4 (untested)
  (Requires AHB access).
* Fixed EmuNAND when using cIOS revision 65535 (issue 2225)
* Added Nintendont support:
  1. Select Nintendont's boot.dol folder in userpath settings.
  2. Set the "GameCube Mode" setting to Nintendont.
  3. Nintendont share some of DIOS MIOS (Lite) settings.
* Added sections in the Loader settings  
  (Wii/gamecube/Devolution/DIOS MIOS/Nintendont).
* Updated the GameCube game settings to display only 
  the selected GameCube mode related settings.
* Updated some menus to support more controller's input:
   - Prevent GC/CC X and Y buttons to change row number in
     Wall layout (use d-pad up/down only)
   - Added GC/CC support to carousel's arrow button
   - Added GC/CC support to Wall/Carousel continuous 
     scroll (+/- on CC, L/R on GC)
   - Added GC support L/R and Start buttons in the
     settings/homebrew browser.
   - Added D-pad support in listing windows if not pointing 
     the screen. The cursor now moves with the selection 
     (not very good with high Overscan value) (issue 2093)
* Changed the StartupProcess to speed up launch time by 
  using AHB access to read config files. IOS argument in
  meta.xml has priority over AHB detection.
* Added IOS58 + AHB support for launching the loader
  without cIOS (Wii games and EmuNAND still require cIOS).
* Added a Loader's IOS setting (now Loader and Games use 
  two separate settings: loader can use 58 and games 249).
* Added LibruntimeIOSPatch to patch IOS58 and Hermes v4 to
  get ISFS access and enable Banner mode, Channel's title
  and System font with these IOSes (Requires AHB access)
* Added a delete prompt if downloaded cheat file is empty.
* Force all launched homebrew to reload to IOS58 if available.
* Changed Gecko.c to send logs to wifigecko too.
* Changed wifigecko IP to send logs to all IP 192.168.0.x
* Updated French translation.
2013-10-01 21:13:08 +00:00

146 lines
4.1 KiB
C++

#ifndef _GAME_SETTINGS_H_
#define _GAME_SETTINGS_H_
#include <string>
#include <stdio.h>
#include <gctypes.h>
#include <vector>
#include "usbloader/disc.h"
typedef struct _GameCFG
{
char id[7];
short video;
short videoPatchDol;
short aspectratio;
short language;
short ocarina;
short vipatch;
short ios;
short parentalcontrol;
short errorfix002;
short iosreloadblock;
short loadalternatedol;
u32 alternatedolstart;
short patchcountrystrings;
std::string alternatedolname;
short returnTo;
short sneekVideoPatch;
short NandEmuMode;
std::string NandEmuPath;
short Hooktype;
short WiirdDebugger;
short GameCubeMode;
short DMLVideo;
short DMLProgPatch;
short DMLNMM;
short DMLActivityLED;
short DMLPADHOOK;
short DMLNoDisc2;
short DMLWidescreen;
short DMLScreenshot;
short DMLJPNPatch;
short DMLDebug;
short NINMCEmulation;
short NINUSBHID;
short DEVOMCEmulation;
short DEVOWidescreen;
short DEVOActivityLED;
short DEVOFZeroAX;
short DEVOTimerFix;
short DEVODButtons;
short Locked;
void operator=(const struct _GameCFG &game)
{
memcpy(this->id, game.id, sizeof(game.id));
this->video = game.video;
this->videoPatchDol = game.videoPatchDol;
this->aspectratio = game.aspectratio;
this->language = game.language;
this->ocarina = game.ocarina;
this->vipatch = game.vipatch;
this->ios = game.ios;
this->parentalcontrol = game.parentalcontrol;
this->errorfix002 = game.errorfix002;
this->iosreloadblock = game.iosreloadblock;
this->loadalternatedol = game.loadalternatedol;
this->alternatedolstart = game.alternatedolstart;
this->patchcountrystrings = game.patchcountrystrings;
this->alternatedolname = game.alternatedolname;
this->returnTo = game.returnTo;
this->sneekVideoPatch = game.sneekVideoPatch;
this->NandEmuMode = game.NandEmuMode;
this->NandEmuPath = game.NandEmuPath;
this->Hooktype = game.Hooktype;
this->WiirdDebugger = game.WiirdDebugger;
this->GameCubeMode = game.GameCubeMode;
this->DMLVideo = game.DMLVideo;
this->DMLProgPatch = game.DMLProgPatch;
this->DMLNMM = game.DMLNMM;
this->DMLActivityLED = game.DMLActivityLED;
this->DMLPADHOOK = game.DMLPADHOOK;
this->DMLNoDisc2 = game.DMLNoDisc2;
this->DMLWidescreen = game.DMLWidescreen;
this->DMLScreenshot = game.DMLScreenshot;
this->DMLJPNPatch = game.DMLJPNPatch;
this->DMLDebug = game.DMLDebug;
this->NINMCEmulation = game.NINMCEmulation;
this->NINUSBHID = game.NINUSBHID;
this->DEVOMCEmulation = game.DEVOMCEmulation;
this->DEVOWidescreen = game.DEVOWidescreen;
this->DEVOActivityLED = game.DEVOActivityLED;
this->DEVOFZeroAX = game.DEVOFZeroAX;
this->DEVOTimerFix = game.DEVOTimerFix;
this->DEVODButtons = game.DEVODButtons;
this->Locked = game.Locked;
}
} GameCFG;
class CGameSettings
{
public:
//!Constructor
CGameSettings();
//!Destructor
~CGameSettings();
//!Load
bool Load(const char * path);
//!Save
bool Save();
//!AddGame
bool AddGame(const GameCFG & NewGame);
//!Reset
bool RemoveAll();
//!Overload Reset for one Game
bool Remove(const char * id);
bool Remove(const u8 * id) { return Remove((const char *) id); }
bool Remove(const struct discHdr * game) { if(!game) return false; else return Remove(game->id); }
//!Get GameCFG
GameCFG * GetGameCFG(const char * id);
//!Overload
GameCFG * GetGameCFG(const u8 * id) { return GetGameCFG((const char *) id); }
//!Overload
GameCFG * GetGameCFG(const struct discHdr * game) { if(!game) return NULL; else return GetGameCFG(game->id); }
//!Quick settings to PEGI conversion
static int GetPartenalPEGI(int parentalsetting);
//!Set the default configuration block
void SetDefault(GameCFG &game);
protected:
bool ReadGameID(const char * src, char * GameID, int size);
bool SetSetting(GameCFG & game, const char *name, const char *value);
bool ValidVersion(FILE * file);
//!Find the config file in the default paths
bool FindConfig();
void ParseLine(char *line);
void TrimLine(std::string &dest, const char *src, char stopChar);
std::string ConfigPath;
std::vector<GameCFG> GameList;
GameCFG DefaultConfig;
};
extern CGameSettings GameSettings;
#endif