Skip to content

Commit 97e6190

Browse files
committed
load config file
Signed-off-by: Vincent-FK <[email protected]>
1 parent af80eaf commit 97e6190

File tree

4 files changed

+25
-9
lines changed

4 files changed

+25
-9
lines changed

src/drivers/common/configSys.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -543,21 +543,25 @@ Config::_parseArgs(int argc,
543543

544544

545545
/**
546-
* Parses first the configuration file, and then overrides with any
547-
* command-line options that were specified.
546+
* Parses the configuration file
548547
*/
549548
int
550-
Config::parse(int argc,
551-
char **argv)
549+
Config::load()
552550
{
553-
int error;
554551

555552
// read the config file
556-
error = _load();
557-
if(error) {
558-
return error;
553+
return _load();
559554
}
560555

556+
557+
/**
558+
* Parses command-line options that were specified.
559+
*/
560+
int
561+
Config::parse(int argc,
562+
char **argv)
563+
{
564+
561565
// parse the arguments
562566
return _parseArgs(argc, argv);
563567
}

src/drivers/common/configSys.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ class Config {
7676
int getOption(const std::string &, double *);
7777

7878
/**
79-
* Parse the arguments. Also read in the configuration file and
79+
* read in the configuration file and
80+
* set the variables accordingly.
81+
*/
82+
int load();
83+
84+
/**
85+
* Parse the arguments and
8086
* set the variables accordingly.
8187
*/
8288
int parse(int, char **);

src/drivers/dingux-sdl/config.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ Config * InitConfig() {
228228
// fm2 -> srt conversion
229229
config->addOption("ripsubs", "SDL.RipSubs", "");
230230

231+
// load from save file
232+
config->addOption("loadStateFile", "SDL.loadStateFile", "");
233+
config->setOption("SDL.loadStateFile", "");
234+
231235
// enable new PPU core
232236
config->addOption("newppu", "SDL.NewPPU", 0);
233237

src/drivers/dingux-sdl/dingoo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,8 @@ int main(int argc, char *argv[]) {
570570
return -1;
571571
}
572572

573+
/* Load config from file */
574+
g_config->load();
573575
int romIndex = g_config->parse(argc, argv);
574576

575577
// This is here so that a default fceux.cfg will be created on first

0 commit comments

Comments
 (0)