Launch a game/saveslot instantly at app start
Moderator: ScummVM Team
Launch a game/saveslot instantly at app start
Hello, it's posible to do that? Load a game or a save slot instantly after the app starts. Maybe with the .scummvmrcm file.
Just checked over the code. The tl;dr simple answer is NO.
The longer answer is not at the moment, but it might be a good feature to think about... Really, we should ensure all the command line options are mirrored by options in the GUI and entries in the configuration file, as this makes "command line less" builds such as most Smartphones much easier to deal with... It also makes life easier for debug as the "-d <n>" debug level flag can't be enabled/changed in the GUI or debug console currently which can be a pain during debugging.
The configuration options are dealt with by our Configuration Manager singleton class which deals with merging and resolving the default configuration, the configuration options from the config file and those passed on the command line...
The command line options are parsed by the code in scummvm/base/commandLine.cpp, specifically the function Base::parseCommandLine(settings, argc, argv) which is called from the main function found in scummvm/base/main.cpp ie. extern "C" int scummvm_main(int argc, const char * const argv[])) ...
The longer answer is not at the moment, but it might be a good feature to think about... Really, we should ensure all the command line options are mirrored by options in the GUI and entries in the configuration file, as this makes "command line less" builds such as most Smartphones much easier to deal with... It also makes life easier for debug as the "-d <n>" debug level flag can't be enabled/changed in the GUI or debug console currently which can be a pain during debugging.
The configuration options are dealt with by our Configuration Manager singleton class which deals with merging and resolving the default configuration, the configuration options from the config file and those passed on the command line...
The command line options are parsed by the code in scummvm/base/commandLine.cpp, specifically the function Base::parseCommandLine(settings, argc, argv) which is called from the main function found in scummvm/base/main.cpp ie. extern "C" int scummvm_main(int argc, const char * const argv[])) ...
Now for the Android port, the main function is called from within scummvm/backends/platform/android/jni.cpp in the function jint JNI::main(JNIEnv *env, jobject self, jobjectArray args) which passes the command line arguments in a jobjectArray... This is a Java Native Interface i.e. call to native C/C++ code... in this case, our main application.
The actual java code for the Android application which calls this JNI can be found in scummvm/backends/platform/android/org/scummvm/scummvm ... specifically the main function of the application is the run() method of the Runnable ScummVM java class. This calls the main JNI method with the _args variable of this class... which also has a setter on the object called setArgs(String).
However, I can find no indication that Android has any way of passing command line arguments to a application.. so _args will always be "" currently.
If you compile yourself, you could change this at compile time..
The actual java code for the Android application which calls this JNI can be found in scummvm/backends/platform/android/org/scummvm/scummvm ... specifically the main function of the application is the run() method of the Runnable ScummVM java class. This calls the main JNI method with the _args variable of this class... which also has a setter on the object called setArgs(String).
However, I can find no indication that Android has any way of passing command line arguments to a application.. so _args will always be "" currently.
If you compile yourself, you could change this at compile time..
Actually, all our command line options are "mirrored" by configuration file entries. For example, you should be able to set they key "debuglevel" to the debug level you want to use. Furthermore, you should be able to set "save_slot" to the save slot number you want to load on start up and then (as long as the engine supports loading from launcher) it will load that game on start up.digitall wrote:Really, we should ensure all the command line options are mirrored by options in the GUI and entries in the configuration file, as this makes "command line less" builds such as most Smartphones much easier to deal with...
Lordhoto: Ah yes... You are correct.
I have tested and both "debuglevel=10" and "save_slot=1" work if setup by editing the scummvmrc configuration file externally...
However, I can't see that it is possible to do what Chuke01 wanted to do this way as I can't work out a way of invoking a specific engine at startup, bypassing the GUI.
I have tried "gameid=<name>" but that does not work...
Any ideas if this is possible?
I have tested and both "debuglevel=10" and "save_slot=1" work if setup by editing the scummvmrc configuration file externally...
However, I can't see that it is possible to do what Chuke01 wanted to do this way as I can't work out a way of invoking a specific engine at startup, bypassing the GUI.
I have tried "gameid=<name>" but that does not work...
Any ideas if this is possible?
No, that's not possible.digitall wrote:Lordhoto: Ah yes... You are correct.
I have tested and both "debuglevel=10" and "save_slot=1" work if setup by editing the scummvmrc configuration file externally...
However, I can't see that it is possible to do what Chuke01 wanted to do this way as I can't work out a way of invoking a specific engine at startup, bypassing the GUI.
I have tried "gameid=<name>" but that does not work...
Any ideas if this is possible?