usbloadergx/source/settings/CGameSettings.h
dimok321 2570d6dae8 *Fixed crash on start i made in last rev by mistake
*Changed boot process to wait for USB in GUI mode.
*Changed headless ID stuff (actually was in last rev)
*Added a GameTitles class for WiiTDB titles and fixed parental control (probably crashed before)
*Removed cfg.c completely now. Nothing left in it.
*Moved per game lock feature from game statistics to the individual game settings. It is not a game statistic ;).
2010-10-28 09:00:52 +00:00

71 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];
u8 video;
u8 language;
u8 ocarina;
u8 vipatch;
u8 ios;
u8 parentalcontrol;
u8 errorfix002;
u8 iosreloadblock;
u8 loadalternatedol;
u32 alternatedolstart;
u8 patchcountrystrings;
char alternatedolname[40];
u8 returnTo;
u8 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);
protected:
bool ReadGameID(const char * src, char * GameID, int size);
bool SetSetting(GameCFG & game, char *name, char *value);
//!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;
};
extern CGameSettings GameSettings;
#endif