-
-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathCGameSettings.h
More file actions
212 lines (203 loc) · 5.93 KB
/
Copy pathCGameSettings.h
File metadata and controls
212 lines (203 loc) · 5.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
#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 patchFix480p;
short deflicker;
short aspectratio;
short ScreenMode;
short language;
short ocarina;
short vipatch;
short ios;
short autoios;
short parentalcontrol;
short iosreloadblock;
short loadalternatedol;
u32 alternatedolstart;
short patchcountrystrings;
std::string alternatedolname;
short videoWidth;
short returnTo;
short sneekVideoPatch;
short NandEmuMode;
std::string NandEmuPath;
short Hooktype;
short WiirdDebugger;
short wpadMotor;
short wpadSpeaker;
short GameCubeMode;
short DMLVideo;
short DMLProgPatch;
short DMLNMM;
short DMLActivityLED;
short DMLPADHOOK;
short DMLNoDisc2;
short DMLWidescreen;
short DMLScreenshot;
short DMLJPNPatch;
short DMLDebug;
short NINDeflicker;
short NINPal50Patch;
short NINWiiUWide;
short NINVideoScale;
short NINVideoOffset;
short NINRemlimit;
short NINArcadeMode;
short NINCCRumble;
short NINSkipIPL;
short NINBBA;
short NINBBAProfile;
short NINWiiUGamepadSlot;
short NINMCEmulation;
short NINMCSize;
short NINUSBHID;
short NINMaxPads;
short NINNativeSI;
short NINOSReport;
short NINLED;
short NINLog;
std::string NINLoaderPath;
short DEVOMCEmulation;
short DEVOWidescreen;
short DEVOActivityLED;
short DEVOFZeroAX;
short DEVOTimerFix;
short DEVODButtons;
short DEVOCropOverscan;
short DEVODiscDelay;
short PrivateServer;
std::string CustomAddress;
short Locked;
std::string GameTitle;
_GameCFG() {}
_GameCFG(const struct _GameCFG &game)
{
*this = game;
}
void operator=(const struct _GameCFG &game)
{
memcpy(this->id, game.id, sizeof(game.id));
this->video = game.video;
this->videoPatchDol = game.videoPatchDol;
this->deflicker = game.deflicker;
this->patchFix480p = game.patchFix480p;
this->aspectratio = game.aspectratio;
this->ScreenMode = game.ScreenMode;
this->language = game.language;
this->ocarina = game.ocarina;
this->vipatch = game.vipatch;
this->ios = game.ios;
this->autoios = game.autoios;
this->parentalcontrol = game.parentalcontrol;
this->iosreloadblock = game.iosreloadblock;
this->loadalternatedol = game.loadalternatedol;
this->alternatedolstart = game.alternatedolstart;
this->patchcountrystrings = game.patchcountrystrings;
this->alternatedolname = game.alternatedolname;
this->videoWidth = game.videoWidth;
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->wpadMotor = game.wpadMotor;
this->wpadSpeaker = game.wpadSpeaker;
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->NINDeflicker = game.NINDeflicker;
this->NINPal50Patch = game.NINPal50Patch;
this->NINWiiUWide = game.NINWiiUWide;
this->NINVideoScale = game.NINVideoScale;
this->NINVideoOffset = game.NINVideoOffset;
this->NINRemlimit = game.NINRemlimit;
this->NINArcadeMode = game.NINArcadeMode;
this->NINCCRumble = game.NINCCRumble;
this->NINSkipIPL = game.NINSkipIPL;
this->NINBBA = game.NINBBA;
this->NINBBAProfile = game.NINBBAProfile;
this->NINWiiUGamepadSlot = game.NINWiiUGamepadSlot;
this->NINMCEmulation = game.NINMCEmulation;
this->NINMCSize = game.NINMCSize;
this->NINUSBHID = game.NINUSBHID;
this->NINMaxPads = game.NINMaxPads;
this->NINNativeSI = game.NINNativeSI;
this->NINOSReport = game.NINOSReport;
this->NINLED = game.NINLED;
this->NINLog = game.NINLog;
this->NINLoaderPath = game.NINLoaderPath;
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->DEVOCropOverscan = game.DEVOCropOverscan;
this->DEVODiscDelay = game.DEVODiscDelay;
this->PrivateServer = game.PrivateServer;
this->CustomAddress = game.CustomAddress;
this->Locked = game.Locked;
this->GameTitle = game.GameTitle;
}
} 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