usbloadergx/source/settings/CGameSettings.h
dimok321 e43c9b108d *Added per game NandEmu, Hooktype, WiirdDebugger setting
*Disabled try to mount of drive when no disc is inserted
*Bug in NandEmu fat FD close was fixed with latest d2x, workaround removed
*Added create of nand emu path for rabbits go home to /title/00010004/ (Partial Nand Emu) (thx nic for the info)
*Fixed loading default values for new added game settings
2011-09-03 09:39:26 +00:00

79 lines
1.9 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 language;
short ocarina;
short vipatch;
short ios;
short parentalcontrol;
short errorfix002;
short iosreloadblock;
short loadalternatedol;
u32 alternatedolstart;
short patchcountrystrings;
char alternatedolname[40];
short returnTo;
short sneekVideoPatch;
short NandEmuMode;
short Hooktype;
short WiirdDebugger;
short 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);
//!Get the default configuration block
GameCFG * GetDefault();
protected:
bool ReadGameID(const char * src, char * GameID, int size);
bool SetSetting(GameCFG & game, char *name, char *value);
bool ValidVersion(FILE * file);
//!Find the config file in the default paths
bool FindConfig();
void ParseLine(char *line);
void TrimLine(char *dest, const char *src, int size);
std::string ConfigPath;
std::vector<GameCFG> GameList;
GameCFG DefaultConfig;
};
extern CGameSettings GameSettings;
#endif