try to apply patches from #1593

This commit is contained in:
zeromus 2016-09-08 22:31:31 +00:00
parent de91bcf369
commit ebff84cd45
4 changed files with 28 additions and 13 deletions

View File

@ -67,6 +67,7 @@ CommandLine::CommandLine()
, start_paused(FALSE) , start_paused(FALSE)
, autodetect_method(-1) , autodetect_method(-1)
, render3d(COMMANDLINE_RENDER3D_DEFAULT) , render3d(COMMANDLINE_RENDER3D_DEFAULT)
, language(-1)
{ {
#ifndef HOST_WINDOWS #ifndef HOST_WINDOWS
disable_sound = 0; disable_sound = 0;
@ -117,6 +118,7 @@ ENDL
" --bios-arm9 BIN_FILE Uses the ARM9 BIOS provided at the specified path" ENDL " --bios-arm9 BIN_FILE Uses the ARM9 BIOS provided at the specified path" ENDL
" --bios-arm7 BIN_FILE Uses the ARM7 BIOS provided at the specified path" ENDL " --bios-arm7 BIN_FILE Uses the ARM7 BIOS provided at the specified path" ENDL
" --bios-swi Uses SWI from the provided bios files (else HLE)" ENDL " --bios-swi Uses SWI from the provided bios files (else HLE)" ENDL
" --lang N Pick firmware language (can affect game translations)" ENDL
ENDL ENDL
"Arguments affecting contents of SLOT-1:" ENDL "Arguments affecting contents of SLOT-1:" ENDL
" --slot1 [RETAIL|RETAILAUTO|R4|RETAILNAND|RETAILMCDROM|RETAILDEBUG]" ENDL " --slot1 [RETAIL|RETAILAUTO|R4|RETAILNAND|RETAILMCDROM|RETAILDEBUG]" ENDL
@ -163,6 +165,7 @@ ENDL
#define OPT_CONSOLE_TYPE 200 #define OPT_CONSOLE_TYPE 200
#define OPT_ARM9 201 #define OPT_ARM9 201
#define OPT_ARM7 202 #define OPT_ARM7 202
#define OPT_LANGUAGE 203
#define OPT_SLOT1 300 #define OPT_SLOT1 300
#define OPT_SLOT1_FAT_DIR 301 #define OPT_SLOT1_FAT_DIR 301
@ -224,7 +227,8 @@ bool CommandLine::parse(int argc,char **argv)
{ "console-type", required_argument, NULL, OPT_CONSOLE_TYPE }, { "console-type", required_argument, NULL, OPT_CONSOLE_TYPE },
{ "bios-arm9", required_argument, NULL, OPT_ARM9}, { "bios-arm9", required_argument, NULL, OPT_ARM9},
{ "bios-arm7", required_argument, NULL, OPT_ARM7}, { "bios-arm7", required_argument, NULL, OPT_ARM7},
{ "bios-swi", required_argument, &_bios_swi, 1}, { "bios-swi", no_argument, &_bios_swi, 1},
{ "lang", required_argument, NULL, OPT_LANGUAGE},
//slot-1 contents //slot-1 contents
{ "slot1", required_argument, NULL, OPT_SLOT1}, { "slot1", required_argument, NULL, OPT_SLOT1},
@ -308,6 +312,7 @@ bool CommandLine::parse(int argc,char **argv)
//utilities //utilities
case OPT_ADVANSCENE: CommonSettings.run_advanscene_import = optarg; break; case OPT_ADVANSCENE: CommonSettings.run_advanscene_import = optarg; break;
case OPT_LANGUAGE: language = atoi(optarg); break;
} }
} //arg parsing loop } //arg parsing loop
@ -354,10 +359,10 @@ bool CommandLine::parse(int argc,char **argv)
//process 3d renderer //process 3d renderer
_render3d = strtoupper(_render3d); _render3d = strtoupper(_render3d);
if(_render3d == "NONE") render3d = COMMANDLINE_RENDER3D_NONE; if(_render3d == "NONE") render3d = COMMANDLINE_RENDER3D_NONE;
if(_render3d == "SW") render3d = COMMANDLINE_RENDER3D_SW; else if(_render3d == "SW") render3d = COMMANDLINE_RENDER3D_SW;
if(_render3d == "OLDGL") render3d = COMMANDLINE_RENDER3D_OLDGL; else if(_render3d == "OLDGL") render3d = COMMANDLINE_RENDER3D_OLDGL;
if(_render3d == "AUTOGL") render3d = COMMANDLINE_RENDER3D_AUTOGL; else if(_render3d == "AUTOGL") render3d = COMMANDLINE_RENDER3D_AUTOGL;
if(_render3d == "GL") render3d = COMMANDLINE_RENDER3D_GL; else if(_render3d == "GL") render3d = COMMANDLINE_RENDER3D_GL;
if (autodetect_method != -1) if (autodetect_method != -1)
CommonSettings.autodetectBackupMethod = autodetect_method; CommonSettings.autodetectBackupMethod = autodetect_method;

View File

@ -47,6 +47,7 @@ public:
int depth_threshold; int depth_threshold;
int autodetect_method; int autodetect_method;
int render3d; int render3d;
int language;
std::string nds_file; std::string nds_file;
std::string play_movie_file; std::string play_movie_file;
std::string record_movie_file; std::string record_movie_file;

View File

@ -1,6 +1,6 @@
/* main.cpp - this file is part of DeSmuME /* main.cpp - this file is part of DeSmuME
* *
* Copyright (C) 2006-2015 DeSmuME Team * Copyright (C) 2006-2016 DeSmuME Team
* Copyright (C) 2007 Pascal Giard (evilynux) * Copyright (C) 2007 Pascal Giard (evilynux)
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
@ -649,24 +649,30 @@ public:
}; };
static void static void
init_configured_features( class configured_features *config) init_configured_features( class configured_features *config )
{ {
config->engine_3d = 1; if(config->render3d == COMMANDLINE_RENDER3D_GL || config->render3d == COMMANDLINE_RENDER3D_OLDGL || config->render3d == COMMANDLINE_RENDER3D_AUTOGL)
config->engine_3d = 2;
else
config->engine_3d = 1;
config->savetype = 0; config->savetype = 0;
config->timeout = 0; config->timeout = 0;
/* use the default language */ /* use the default language */
config->firmware_language = -1; config->firmware_language = -1;
/* If specified by --lang option the lang will change to choosed one */
config->firmware_language = config->language;
} }
static int static int
fill_configured_features( class configured_features *config, fill_configured_features( class configured_features *config,
int argc, char ** argv) char ** argv)
{ {
GOptionEntry options[] = { GOptionEntry options[] = {
{ "3d-engine", 0, 0, G_OPTION_ARG_INT, &config->engine_3d, "Select 3d rendering engine. Available engines:\n" { "3d-render", 0, 0, G_OPTION_ARG_INT, &config->engine_3d, "Select 3D rendering engine. Available engines:\n"
"\t\t\t\t 0 = 3d disabled\n" "\t\t\t\t 0 = 3d disabled\n"
"\t\t\t\t 1 = internal rasterizer (default)\n" "\t\t\t\t 1 = internal rasterizer (default)\n"
#if defined(HAVE_LIBOSMESA) || defined(HAVE_GL_GLX) #if defined(HAVE_LIBOSMESA) || defined(HAVE_GL_GLX)
@ -696,7 +702,6 @@ fill_configured_features( class configured_features *config,
//g_option_context_add_main_entries (config->ctx, options, "options"); //g_option_context_add_main_entries (config->ctx, options, "options");
//g_option_context_add_group (config->ctx, gtk_get_option_group (TRUE)); //g_option_context_add_group (config->ctx, gtk_get_option_group (TRUE));
config->parse(argc,argv);
if(!config->validate()) if(!config->validate())
goto error; goto error;
@ -3252,6 +3257,7 @@ int main (int argc, char *argv[])
// The global menu screws up the window size... // The global menu screws up the window size...
unsetenv("UBUNTU_MENUPROXY"); unsetenv("UBUNTU_MENUPROXY");
my_config.parse(argc, argv);
init_configured_features( &my_config); init_configured_features( &my_config);
if (!g_thread_supported()) if (!g_thread_supported())
@ -3259,7 +3265,7 @@ int main (int argc, char *argv[])
gtk_init(&argc, &argv); gtk_init(&argc, &argv);
if ( !fill_configured_features( &my_config, argc, argv)) { if ( !fill_configured_features( &my_config, argv)) {
exit(0); exit(0);
} }

View File

@ -3383,6 +3383,9 @@ int _main()
} }
} }
if(cmdline.language != -1)
CommonSettings.fw_config.language = cmdline.language;
cmdline.process_movieCommands(); cmdline.process_movieCommands();
if(cmdline.load_slot != -1) if(cmdline.load_slot != -1)