mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-26 14:28:34 +00:00
NativeLibrary: Add function to start system menu
This commit is contained in:
parent
30d51348f9
commit
8ad1292df7
2 changed files with 22 additions and 8 deletions
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "Core/Boot/Boot.h"
|
||||
#include "Core/BootManager.h"
|
||||
#include "Core/CommonTitles.h"
|
||||
#include "Core/ConfigLoaders/GameConfigLoader.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
|
@ -547,21 +548,14 @@ static float GetRenderSurfaceScale(JNIEnv* env)
|
|||
return env->CallStaticFloatMethod(native_library_class, get_render_surface_scale_method);
|
||||
}
|
||||
|
||||
static void Run(JNIEnv* env, const std::vector<std::string>& paths, bool riivolution,
|
||||
BootSessionData boot_session_data = BootSessionData())
|
||||
static void Run(JNIEnv* env, std::unique_ptr<BootParameters>&& boot, bool riivolution)
|
||||
{
|
||||
ASSERT(!paths.empty());
|
||||
__android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Running : %s", paths[0].c_str());
|
||||
|
||||
std::unique_lock<std::mutex> host_identity_guard(s_host_identity_lock);
|
||||
|
||||
WiimoteReal::InitAdapterClass();
|
||||
|
||||
s_have_wm_user_stop = false;
|
||||
|
||||
std::unique_ptr<BootParameters> boot =
|
||||
BootParameters::GenerateFromFile(paths, std::move(boot_session_data));
|
||||
|
||||
if (riivolution && std::holds_alternative<BootParameters::Disc>(boot->parameters))
|
||||
{
|
||||
const std::string& riivolution_dir = File::GetUserPath(D_RIIVOLUTION_IDX);
|
||||
|
@ -624,6 +618,15 @@ static void Run(JNIEnv* env, const std::vector<std::string>& paths, bool riivolu
|
|||
IDCache::GetFinishEmulationActivity());
|
||||
}
|
||||
|
||||
static void Run(JNIEnv* env, const std::vector<std::string>& paths, bool riivolution,
|
||||
BootSessionData boot_session_data = BootSessionData())
|
||||
{
|
||||
ASSERT(!paths.empty());
|
||||
__android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Running : %s", paths[0].c_str());
|
||||
|
||||
Run(env, BootParameters::GenerateFromFile(paths, std::move(boot_session_data)), riivolution);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run___3Ljava_lang_String_2Z(
|
||||
JNIEnv* env, jclass, jobjectArray jPaths, jboolean jRiivolution)
|
||||
{
|
||||
|
@ -641,6 +644,12 @@ Java_org_dolphinemu_dolphinemu_NativeLibrary_Run___3Ljava_lang_String_2ZLjava_la
|
|||
BootSessionData(GetJString(env, jSavestate), delete_state));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RunSystemMenu(JNIEnv* env,
|
||||
jclass)
|
||||
{
|
||||
Run(env, std::make_unique<BootParameters>(BootParameters::NANDTitle{Titles::SYSTEM_MENU}), false);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_ChangeDisc(JNIEnv* env, jclass,
|
||||
jstring jFile)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue