mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-16 03:05:06 +00:00
android: set current dir to cache so boot.rom and file i/o are usable
This commit is contained in:
parent
20a6f050fc
commit
dce68e0e41
2 changed files with 11 additions and 2 deletions
|
@ -1698,7 +1698,11 @@ class SDLMain implements Runnable {
|
|||
// Runs SDL_main()
|
||||
String library = SDLActivity.mSingleton.getMainSharedObject();
|
||||
String function = SDLActivity.mSingleton.getMainFunction();
|
||||
String[] arguments = SDLActivity.mSingleton.getArguments();
|
||||
String[] a = SDLActivity.mSingleton.getArguments();
|
||||
String[] args = new String[a.length + 2];
|
||||
System.arraycopy(a, 0, args, 0, a.length);
|
||||
args[a.length + 0] = "-cd";
|
||||
args[a.length + 1] = SDLActivity.mSingleton.getCacheDir().getPath();
|
||||
|
||||
try {
|
||||
android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_DISPLAY);
|
||||
|
@ -1708,7 +1712,7 @@ class SDLMain implements Runnable {
|
|||
|
||||
Log.v(SDLActivity.TAG, "Running main function " + function + " from library " + library);
|
||||
|
||||
SDLActivity.nativeRunMain(library, function, arguments);
|
||||
SDLActivity.nativeRunMain(library, function, args);
|
||||
|
||||
Log.v(SDLActivity.TAG, "Finished main function");
|
||||
|
||||
|
|
|
@ -565,6 +565,11 @@ main(int argc, char **argv)
|
|||
set_zoom(atoi(argv[++i]));
|
||||
else
|
||||
return error("Opt", "-s No scale provided.");
|
||||
} else if(strcmp(argv[i], "-cd") == 0) {
|
||||
if(i < argc - 1)
|
||||
chdir(argv[++i]);
|
||||
else
|
||||
return error("Opt", "-cd No path provided.");
|
||||
} else if(!loaded++) {
|
||||
if(!start(&u, argv[i]))
|
||||
return error("Boot", "Failed to boot.");
|
||||
|
|
Loading…
Reference in a new issue