ScummVM logo Forum Index - ScummVM website - Contact us - Buy Supported Games: GOG.com Rules - Search - Register - Login curved edge
Folder Forum Index > Android Port > Launch a game/saveslot instantly at app start
Launch a game/saveslot instantly at app start
  Author    Thread Reply to topic
Chuke01



Joined: 05 Oct 2013
Posts: 3
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.

 Reply with quote  
Post Sat Oct 05, 2013 11:32 pm 
 View user's profile Send private message
md5
ScummVM Developer


Joined: 03 Nov 2005
Posts: 2256
Location: Athens, Greece
 

Check the README file:


quote:

--save-slot/-x:

This switch may be used to load a savegame directly from the command line.

Usage: --save-slot[SLOT] or -x[SLOT], where [SLOT] is the save slot number.


 Reply with quote  
Post Sun Oct 06, 2013 1:01 am 
 View user's profile Send private message
Chuke01



Joined: 05 Oct 2013
Posts: 3
 

quote:
Originally posted by md5
Check the README file:


quote:

--save-slot/-x:

This switch may be used to load a savegame directly from the command line.

Usage: --save-slot[SLOT] or -x[SLOT], where [SLOT] is the save slot number.




This is for the android version? Where I had to put this commands lines?
 Reply with quote  
Post Sun Oct 06, 2013 1:48 am 
 View user's profile Send private message
md5
ScummVM Developer


Joined: 03 Nov 2005
Posts: 2256
Location: Athens, Greece
 

Oh sorry, it was late when I wrote that. Not sure if you can modify the command line parameters in Android somehow but... can't you just load the saved game you want from the launcher?

 Reply with quote  
Post Sun Oct 06, 2013 1:47 pm 
 View user's profile Send private message
Chuke01



Joined: 05 Oct 2013
Posts: 3
 

Yes, It's the normal way, I can do it from launcher without problem. But I wanna do this other way, at app start, for a fast acces to the game in my phone. Because I only play one game at once.

 Reply with quote  
Post Sun Oct 06, 2013 1:56 pm 
 View user's profile Send private message
digitall
ScummVM Developer


Joined: 02 Aug 2012
Posts: 822
 

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[])) ...

 Reply with quote  
Post Tue Oct 08, 2013 10:39 pm 
 View user's profile Send private message
digitall
ScummVM Developer


Joined: 02 Aug 2012
Posts: 822
 

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..

 Reply with quote  
Post Tue Oct 08, 2013 11:14 pm 
 View user's profile Send private message
LordHoto
ScummVM Developer


Joined: 30 Oct 2005
Posts: 1030
Location: Germany
 

quote:
Originally posted by digitall
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...


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.
 Reply with quote  
Post Wed Oct 09, 2013 1:40 pm 
 View user's profile Send private message
digitall
ScummVM Developer


Joined: 02 Aug 2012
Posts: 822
 

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?

 Reply with quote  
Post Thu Oct 10, 2013 3:22 am 
 View user's profile Send private message
LordHoto
ScummVM Developer


Joined: 30 Oct 2005
Posts: 1030
Location: Germany
 

quote:
Originally posted by digitall
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?


No, that's not possible.
 Reply with quote  
Post Thu Oct 10, 2013 10:17 am 
 View user's profile Send private message
  Display posts from previous:      
Reply to topic

Forum Jump:
 



Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Powered by phpBB © 2001, 2006 phpBB Group
Forum design by ScummVM team, icons by raina
curved edge   curved edge