mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-12-28 02:31:54 +01:00
Fixed clang skill issue
This commit is contained in:
parent
f12b649194
commit
a0db384339
@ -69,8 +69,8 @@ void InitJNI(JNIEnv* env) {
|
||||
env->NewGlobalRef(env->FindClass("io/github/lime3ds/applets/MiiSelector")));
|
||||
s_mii_selector_config_class = reinterpret_cast<jclass>(env->NewGlobalRef(
|
||||
env->FindClass("io/github/lime3ds/applets/MiiSelector$MiiSelectorConfig")));
|
||||
s_mii_selector_data_class = reinterpret_cast<jclass>(env->NewGlobalRef(
|
||||
env->FindClass("io/github/lime3ds/applets/MiiSelector$MiiSelectorData")));
|
||||
s_mii_selector_data_class = reinterpret_cast<jclass>(
|
||||
env->NewGlobalRef(env->FindClass("io/github/lime3ds/applets/MiiSelector$MiiSelectorData")));
|
||||
|
||||
s_mii_selector_execute =
|
||||
env->GetStaticMethodID(s_mii_selector_class, "Execute",
|
||||
|
@ -124,9 +124,8 @@ jobject ToJavaValidationError(Frontend::ValidationError error) {
|
||||
"Lio/github/lime3ds/applets/SoftwareKeyboard$ValidationError;"));
|
||||
}
|
||||
|
||||
jobject Java_io_github_lime3ds_applets_SoftwareKeyboard_ValidateFilters(JNIEnv* env,
|
||||
jclass clazz,
|
||||
jstring text) {
|
||||
jobject Java_io_github_lime3ds_applets_SoftwareKeyboard_ValidateFilters(JNIEnv* env, jclass clazz,
|
||||
jstring text) {
|
||||
|
||||
const auto ret =
|
||||
Core::System::GetInstance().GetSoftwareKeyboard()->ValidateFilters(GetJString(env, text));
|
||||
@ -134,7 +133,7 @@ jobject Java_io_github_lime3ds_applets_SoftwareKeyboard_ValidateFilters(JNIEnv*
|
||||
}
|
||||
|
||||
jobject Java_io_github_lime3ds_applets_SoftwareKeyboard_ValidateInput(JNIEnv* env, jclass clazz,
|
||||
jstring text) {
|
||||
jstring text) {
|
||||
|
||||
const auto ret =
|
||||
Core::System::GetInstance().GetSoftwareKeyboard()->ValidateInput(GetJString(env, text));
|
||||
|
@ -30,22 +30,22 @@ jobject CheatToJava(JNIEnv* env, std::shared_ptr<Cheats::CheatBase> cheat) {
|
||||
extern "C" {
|
||||
|
||||
JNIEXPORT void JNICALL Java_io_github_lime3ds_features_cheats_model_Cheat_finalize(JNIEnv* env,
|
||||
jobject obj) {
|
||||
jobject obj) {
|
||||
delete CheatFromJava(env, obj);
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_io_github_lime3ds_features_cheats_model_Cheat_getName(JNIEnv* env, jobject obj) {
|
||||
JNIEXPORT jstring JNICALL Java_io_github_lime3ds_features_cheats_model_Cheat_getName(JNIEnv* env,
|
||||
jobject obj) {
|
||||
return ToJString(env, (*CheatFromJava(env, obj))->GetName());
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_io_github_lime3ds_features_cheats_model_Cheat_getNotes(JNIEnv* env, jobject obj) {
|
||||
JNIEXPORT jstring JNICALL Java_io_github_lime3ds_features_cheats_model_Cheat_getNotes(JNIEnv* env,
|
||||
jobject obj) {
|
||||
return ToJString(env, (*CheatFromJava(env, obj))->GetComments());
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_io_github_lime3ds_features_cheats_model_Cheat_getCode(JNIEnv* env, jobject obj) {
|
||||
JNIEXPORT jstring JNICALL Java_io_github_lime3ds_features_cheats_model_Cheat_getCode(JNIEnv* env,
|
||||
jobject obj) {
|
||||
return ToJString(env, (*CheatFromJava(env, obj))->GetCode());
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ static Loader::SMDH* GetPointer(JNIEnv* env, jobject obj) {
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_io_github_lime3ds_model_GameInfo_initialize(JNIEnv* env, jclass,
|
||||
jstring j_path) {
|
||||
jstring j_path) {
|
||||
std::vector<u8> smdh_data = GetSMDHData(GetJString(env, j_path));
|
||||
|
||||
Loader::SMDH* smdh = nullptr;
|
||||
@ -148,8 +148,7 @@ jintArray Java_io_github_lime3ds_model_GameInfo_getIcon(JNIEnv* env, jobject obj
|
||||
return icon;
|
||||
}
|
||||
|
||||
jboolean Java_io_github_lime3ds_model_GameInfo_getIsVisibleSystemTitle(JNIEnv* env,
|
||||
jobject obj) {
|
||||
jboolean Java_io_github_lime3ds_model_GameInfo_getIsVisibleSystemTitle(JNIEnv* env, jobject obj) {
|
||||
Loader::SMDH* smdh = GetPointer(env, obj);
|
||||
if (smdh == nullptr) {
|
||||
return false;
|
||||
|
@ -168,9 +168,9 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
||||
// Initialize NativeLibrary
|
||||
const jclass native_library_class = env->FindClass("io/github/lime3ds/NativeLibrary");
|
||||
s_native_library_class = reinterpret_cast<jclass>(env->NewGlobalRef(native_library_class));
|
||||
s_on_core_error = env->GetStaticMethodID(
|
||||
s_native_library_class, "onCoreError",
|
||||
"(Lio/github/lime3ds/NativeLibrary$CoreError;Ljava/lang/String;)Z");
|
||||
s_on_core_error =
|
||||
env->GetStaticMethodID(s_native_library_class, "onCoreError",
|
||||
"(Lio/github/lime3ds/NativeLibrary$CoreError;Ljava/lang/String;)Z");
|
||||
s_is_portrait_mode = env->GetStaticMethodID(s_native_library_class, "isPortraitMode", "()Z");
|
||||
s_landscape_screen_layout =
|
||||
env->GetStaticMethodID(s_native_library_class, "landscapeScreenLayout", "()I");
|
||||
|
@ -287,9 +287,8 @@ void InitializeGpuDriver(const std::string& hook_lib_dir, const std::string& cus
|
||||
|
||||
extern "C" {
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_surfaceChanged(JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jobject surf) {
|
||||
void Java_io_github_lime3ds_NativeLibrary_surfaceChanged(JNIEnv* env, [[maybe_unused]] jobject obj,
|
||||
jobject surf) {
|
||||
s_surf = ANativeWindow_fromSurface(env, surf);
|
||||
|
||||
if (window) {
|
||||
@ -305,7 +304,7 @@ void Java_io_github_lime3ds_NativeLibrary_surfaceChanged(JNIEnv* env,
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_surfaceDestroyed([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
ANativeWindow_release(s_surf);
|
||||
s_surf = nullptr;
|
||||
if (window) {
|
||||
@ -314,24 +313,26 @@ void Java_io_github_lime3ds_NativeLibrary_surfaceDestroyed([[maybe_unused]] JNIE
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_doFrame([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
if (stop_run || pause_emulation) {
|
||||
return;
|
||||
}
|
||||
window->TryPresenting();
|
||||
}
|
||||
|
||||
void JNICALL Java_io_github_lime3ds_NativeLibrary_initializeGpuDriver(
|
||||
JNIEnv* env, jobject obj, jstring hook_lib_dir, jstring custom_driver_dir,
|
||||
jstring custom_driver_name, jstring file_redirect_dir) {
|
||||
void JNICALL Java_io_github_lime3ds_NativeLibrary_initializeGpuDriver(JNIEnv* env, jobject obj,
|
||||
jstring hook_lib_dir,
|
||||
jstring custom_driver_dir,
|
||||
jstring custom_driver_name,
|
||||
jstring file_redirect_dir) {
|
||||
InitializeGpuDriver(GetJString(env, hook_lib_dir), GetJString(env, custom_driver_dir),
|
||||
GetJString(env, custom_driver_name), GetJString(env, file_redirect_dir));
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_notifyOrientationChange([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jint layout_option,
|
||||
jint rotation) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jint layout_option,
|
||||
jint rotation) {
|
||||
Settings::values.layout_option = static_cast<Settings::LayoutOption>(layout_option);
|
||||
auto& system = Core::System::GetInstance();
|
||||
if (system.IsPoweredOn()) {
|
||||
@ -342,8 +343,8 @@ void Java_io_github_lime3ds_NativeLibrary_notifyOrientationChange([[maybe_unused
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_swapScreens([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jboolean swap_screens, jint rotation) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jboolean swap_screens, jint rotation) {
|
||||
Settings::values.swap_screen = swap_screens;
|
||||
auto& system = Core::System::GetInstance();
|
||||
if (system.IsPoweredOn()) {
|
||||
@ -354,15 +355,15 @@ void Java_io_github_lime3ds_NativeLibrary_swapScreens([[maybe_unused]] JNIEnv* e
|
||||
}
|
||||
|
||||
jboolean Java_io_github_lime3ds_NativeLibrary_areKeysAvailable([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
HW::AES::InitKeys();
|
||||
return HW::AES::IsKeyXAvailable(HW::AES::KeySlotID::NCCHSecure1) &&
|
||||
HW::AES::IsKeyXAvailable(HW::AES::KeySlotID::NCCHSecure2);
|
||||
}
|
||||
|
||||
jstring Java_io_github_lime3ds_NativeLibrary_getHomeMenuPath(JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jint region) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jint region) {
|
||||
const std::string path = Core::GetHomeMenuNcchPath(region);
|
||||
if (FileUtil::Exists(path)) {
|
||||
return ToJString(env, path);
|
||||
@ -371,8 +372,8 @@ jstring Java_io_github_lime3ds_NativeLibrary_getHomeMenuPath(JNIEnv* env,
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_setUserDirectory(JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jstring j_directory) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jstring j_directory) {
|
||||
FileUtil::SetCurrentDir(GetJString(env, j_directory));
|
||||
}
|
||||
|
||||
@ -415,9 +416,8 @@ jobjectArray Java_io_github_lime3ds_NativeLibrary_getInstalledGamePaths(
|
||||
}
|
||||
|
||||
jlongArray Java_io_github_lime3ds_NativeLibrary_getSystemTitleIds(JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jint system_type,
|
||||
jint region) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jint system_type, jint region) {
|
||||
const auto mode = static_cast<Core::SystemTitleSet>(system_type);
|
||||
const std::vector<u64> titles = Core::GetSystemTitleIds(mode, region);
|
||||
jlongArray jTitles = env->NewLongArray(titles.size());
|
||||
@ -427,8 +427,8 @@ jlongArray Java_io_github_lime3ds_NativeLibrary_getSystemTitleIds(JNIEnv* env,
|
||||
}
|
||||
|
||||
jobject Java_io_github_lime3ds_NativeLibrary_downloadTitleFromNus([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jlong title) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jlong title) {
|
||||
const auto title_id = static_cast<u64>(title);
|
||||
Service::AM::InstallStatus status = Service::AM::InstallFromNus(title_id);
|
||||
if (status != Service::AM::InstallStatus::Success) {
|
||||
@ -459,20 +459,20 @@ jboolean JNICALL Java_io_github_lime3ds_utils_GpuDriverHelper_supportsCustomDriv
|
||||
|
||||
// TODO(xperia64): ensure these cannot be called in an invalid state (e.g. after StopEmulation)
|
||||
void Java_io_github_lime3ds_NativeLibrary_unPauseEmulation([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
pause_emulation = false;
|
||||
running_cv.notify_all();
|
||||
InputManager::NDKMotionHandler()->EnableSensors();
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_pauseEmulation([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
pause_emulation = true;
|
||||
InputManager::NDKMotionHandler()->DisableSensors();
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_stopEmulation([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
stop_run = true;
|
||||
pause_emulation = false;
|
||||
window->StopPresenting();
|
||||
@ -480,21 +480,21 @@ void Java_io_github_lime3ds_NativeLibrary_stopEmulation([[maybe_unused]] JNIEnv*
|
||||
}
|
||||
|
||||
jboolean Java_io_github_lime3ds_NativeLibrary_isRunning([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
return static_cast<jboolean>(!stop_run);
|
||||
}
|
||||
|
||||
jlong Java_io_github_lime3ds_NativeLibrary_getRunningTitleId([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
u64 title_id{};
|
||||
Core::System::GetInstance().GetAppLoader().ReadProgramId(title_id);
|
||||
return static_cast<jlong>(title_id);
|
||||
}
|
||||
|
||||
jboolean Java_io_github_lime3ds_NativeLibrary_onGamePadEvent([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
[[maybe_unused]] jstring j_device,
|
||||
jint j_button, jint action) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
[[maybe_unused]] jstring j_device,
|
||||
jint j_button, jint action) {
|
||||
bool consumed{};
|
||||
if (action) {
|
||||
consumed = InputManager::ButtonHandler()->PressKey(j_button);
|
||||
@ -505,9 +505,10 @@ jboolean Java_io_github_lime3ds_NativeLibrary_onGamePadEvent([[maybe_unused]] JN
|
||||
return static_cast<jboolean>(consumed);
|
||||
}
|
||||
|
||||
jboolean Java_io_github_lime3ds_NativeLibrary_onGamePadMoveEvent(
|
||||
[[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject obj, [[maybe_unused]] jstring j_device,
|
||||
jint axis, jfloat x, jfloat y) {
|
||||
jboolean Java_io_github_lime3ds_NativeLibrary_onGamePadMoveEvent([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
[[maybe_unused]] jstring j_device,
|
||||
jint axis, jfloat x, jfloat y) {
|
||||
// Clamp joystick movement to supported minimum and maximum
|
||||
// Citra uses an inverted y axis sent by the frontend
|
||||
x = std::clamp(x, -1.f, 1.f);
|
||||
@ -524,29 +525,29 @@ jboolean Java_io_github_lime3ds_NativeLibrary_onGamePadMoveEvent(
|
||||
return static_cast<jboolean>(InputManager::AnalogHandler()->MoveJoystick(axis, x, y));
|
||||
}
|
||||
|
||||
jboolean Java_io_github_lime3ds_NativeLibrary_onGamePadAxisEvent(
|
||||
[[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject obj, [[maybe_unused]] jstring j_device,
|
||||
jint axis_id, jfloat axis_val) {
|
||||
jboolean Java_io_github_lime3ds_NativeLibrary_onGamePadAxisEvent([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
[[maybe_unused]] jstring j_device,
|
||||
jint axis_id, jfloat axis_val) {
|
||||
return static_cast<jboolean>(
|
||||
InputManager::ButtonHandler()->AnalogButtonEvent(axis_id, axis_val));
|
||||
}
|
||||
|
||||
jboolean Java_io_github_lime3ds_NativeLibrary_onTouchEvent([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jfloat x, jfloat y,
|
||||
jboolean pressed) {
|
||||
[[maybe_unused]] jobject obj, jfloat x,
|
||||
jfloat y, jboolean pressed) {
|
||||
return static_cast<jboolean>(
|
||||
window->OnTouchEvent(static_cast<int>(x + 0.5), static_cast<int>(y + 0.5), pressed));
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_onTouchMoved([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj, jfloat x,
|
||||
jfloat y) {
|
||||
[[maybe_unused]] jobject obj, jfloat x,
|
||||
jfloat y) {
|
||||
window->OnTouchMoved((int)x, (int)y);
|
||||
}
|
||||
|
||||
jlong Java_io_github_lime3ds_NativeLibrary_getTitleId(JNIEnv* env, [[maybe_unused]] jobject obj,
|
||||
jstring j_filename) {
|
||||
jstring j_filename) {
|
||||
std::string filepath = GetJString(env, j_filename);
|
||||
const auto loader = Loader::GetLoader(filepath);
|
||||
|
||||
@ -558,8 +559,8 @@ jlong Java_io_github_lime3ds_NativeLibrary_getTitleId(JNIEnv* env, [[maybe_unuse
|
||||
}
|
||||
|
||||
jboolean Java_io_github_lime3ds_NativeLibrary_getIsSystemTitle(JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jstring path) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jstring path) {
|
||||
const std::string filepath = GetJString(env, path);
|
||||
const auto loader = Loader::GetLoader(filepath);
|
||||
|
||||
@ -574,27 +575,27 @@ jboolean Java_io_github_lime3ds_NativeLibrary_getIsSystemTitle(JNIEnv* env,
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_createConfigFile([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
Config{};
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_createLogFile([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
Common::Log::Initialize();
|
||||
Common::Log::Start();
|
||||
LOG_INFO(Frontend, "Logging backend initialised");
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_logUserDirectory(JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jstring j_path) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jstring j_path) {
|
||||
std::string_view path = env->GetStringUTFChars(j_path, 0);
|
||||
LOG_INFO(Frontend, "User directory path: {}", path);
|
||||
env->ReleaseStringUTFChars(j_path, path.data());
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_reloadSettings([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
Config{};
|
||||
Core::System& system{Core::System::GetInstance()};
|
||||
|
||||
@ -609,7 +610,7 @@ void Java_io_github_lime3ds_NativeLibrary_reloadSettings([[maybe_unused]] JNIEnv
|
||||
}
|
||||
|
||||
jdoubleArray Java_io_github_lime3ds_NativeLibrary_getPerfStats(JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
auto& core = Core::System::GetInstance();
|
||||
jdoubleArray j_stats = env->NewDoubleArray(4);
|
||||
|
||||
@ -627,8 +628,8 @@ jdoubleArray Java_io_github_lime3ds_NativeLibrary_getPerfStats(JNIEnv* env,
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_run__Ljava_lang_String_2(JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jstring j_path) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jstring j_path) {
|
||||
const std::string path = GetJString(env, j_path);
|
||||
|
||||
if (!stop_run) {
|
||||
@ -644,15 +645,14 @@ void Java_io_github_lime3ds_NativeLibrary_run__Ljava_lang_String_2(JNIEnv* env,
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_reloadCameraDevices([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
if (g_ndk_factory) {
|
||||
g_ndk_factory->ReloadCameraDevices();
|
||||
}
|
||||
}
|
||||
|
||||
jboolean Java_io_github_lime3ds_NativeLibrary_loadAmiibo(JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jstring j_file) {
|
||||
jboolean Java_io_github_lime3ds_NativeLibrary_loadAmiibo(JNIEnv* env, [[maybe_unused]] jobject obj,
|
||||
jstring j_file) {
|
||||
std::string filepath = GetJString(env, j_file);
|
||||
Core::System& system{Core::System::GetInstance()};
|
||||
Service::SM::ServiceManager& sm = system.ServiceManager();
|
||||
@ -665,7 +665,7 @@ jboolean Java_io_github_lime3ds_NativeLibrary_loadAmiibo(JNIEnv* env,
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_removeAmiibo([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
Core::System& system{Core::System::GetInstance()};
|
||||
Service::SM::ServiceManager& sm = system.ServiceManager();
|
||||
auto nfc = sm.GetService<Service::NFC::Module::Interface>("nfc:u");
|
||||
@ -676,8 +676,9 @@ void Java_io_github_lime3ds_NativeLibrary_removeAmiibo([[maybe_unused]] JNIEnv*
|
||||
nfc->RemoveAmiibo();
|
||||
}
|
||||
|
||||
JNIEXPORT jobject JNICALL Java_io_github_lime3ds_utils_CiaInstallWorker_installCIA(
|
||||
JNIEnv* env, jobject jobj, jstring jpath) {
|
||||
JNIEXPORT jobject JNICALL Java_io_github_lime3ds_utils_CiaInstallWorker_installCIA(JNIEnv* env,
|
||||
jobject jobj,
|
||||
jstring jpath) {
|
||||
std::string path = GetJString(env, jpath);
|
||||
Service::AM::InstallStatus res = Service::AM::InstallCIA(
|
||||
path, [env, jobj](std::size_t total_bytes_read, std::size_t file_size) {
|
||||
@ -688,8 +689,8 @@ JNIEXPORT jobject JNICALL Java_io_github_lime3ds_utils_CiaInstallWorker_installC
|
||||
return IDCache::GetJavaCiaInstallStatus(res);
|
||||
}
|
||||
|
||||
jobjectArray Java_io_github_lime3ds_NativeLibrary_getSavestateInfo(
|
||||
JNIEnv* env, [[maybe_unused]] jobject obj) {
|
||||
jobjectArray Java_io_github_lime3ds_NativeLibrary_getSavestateInfo(JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
const jclass date_class = env->FindClass("java/util/Date");
|
||||
const auto date_constructor = env->GetMethodID(date_class, "<init>", "(J)V");
|
||||
|
||||
@ -723,17 +724,17 @@ jobjectArray Java_io_github_lime3ds_NativeLibrary_getSavestateInfo(
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_saveState([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj, jint slot) {
|
||||
[[maybe_unused]] jobject obj, jint slot) {
|
||||
Core::System::GetInstance().SendSignal(Core::System::Signal::Save, slot);
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_loadState([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj, jint slot) {
|
||||
[[maybe_unused]] jobject obj, jint slot) {
|
||||
Core::System::GetInstance().SendSignal(Core::System::Signal::Load, slot);
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_NativeLibrary_logDeviceInfo([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
LOG_INFO(Frontend, "Citra Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch,
|
||||
Common::g_scm_desc);
|
||||
LOG_INFO(Frontend, "Host CPU: {}", Common::GetCPUCaps().cpu_string);
|
||||
|
@ -13,12 +13,12 @@ std::shared_ptr<Service::CFG::Module> cfg;
|
||||
extern "C" {
|
||||
|
||||
void Java_io_github_lime3ds_utils_SystemSaveGame_save([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
cfg->UpdateConfigNANDSavegame();
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_utils_SystemSaveGame_load([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
cfg = Service::CFG::GetModule(Core::System::GetInstance());
|
||||
}
|
||||
|
||||
@ -27,24 +27,25 @@ jboolean Java_io_github_lime3ds_utils_SystemSaveGame_getIsSystemSetupNeeded(
|
||||
return cfg->IsSystemSetupNeeded();
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_utils_SystemSaveGame_setSystemSetupNeeded(
|
||||
[[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject obj, jboolean needed) {
|
||||
void Java_io_github_lime3ds_utils_SystemSaveGame_setSystemSetupNeeded([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jboolean needed) {
|
||||
cfg->SetSystemSetupNeeded(needed);
|
||||
}
|
||||
|
||||
jstring Java_io_github_lime3ds_utils_SystemSaveGame_getUsername([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
return ToJString(env, Common::UTF16ToUTF8(cfg->GetUsername()));
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_utils_SystemSaveGame_setUsername([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jstring username) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jstring username) {
|
||||
cfg->SetUsername(Common::UTF8ToUTF16(GetJString(env, username)));
|
||||
}
|
||||
|
||||
jshortArray Java_io_github_lime3ds_utils_SystemSaveGame_getBirthday(
|
||||
[[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject obj) {
|
||||
jshortArray Java_io_github_lime3ds_utils_SystemSaveGame_getBirthday([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
jshortArray jbirthdayArray = env->NewShortArray(2);
|
||||
auto birthday = cfg->GetBirthday();
|
||||
jshort birthdayArray[2]{static_cast<jshort>(get<0>(birthday)),
|
||||
@ -54,62 +55,62 @@ jshortArray Java_io_github_lime3ds_utils_SystemSaveGame_getBirthday(
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_utils_SystemSaveGame_setBirthday([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jshort jmonth, jshort jday) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jshort jmonth, jshort jday) {
|
||||
cfg->SetBirthday(static_cast<u8>(jmonth), static_cast<u8>(jday));
|
||||
}
|
||||
|
||||
jint Java_io_github_lime3ds_utils_SystemSaveGame_getSystemLanguage(
|
||||
[[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject obj) {
|
||||
jint Java_io_github_lime3ds_utils_SystemSaveGame_getSystemLanguage([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
return cfg->GetSystemLanguage();
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_utils_SystemSaveGame_setSystemLanguage([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jint jsystemLanguage) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jint jsystemLanguage) {
|
||||
cfg->SetSystemLanguage(static_cast<Service::CFG::SystemLanguage>(jsystemLanguage));
|
||||
}
|
||||
|
||||
jint Java_io_github_lime3ds_utils_SystemSaveGame_getSoundOutputMode(
|
||||
[[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject obj) {
|
||||
jint Java_io_github_lime3ds_utils_SystemSaveGame_getSoundOutputMode([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
return cfg->GetSoundOutputMode();
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_utils_SystemSaveGame_setSoundOutputMode([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jint jmode) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jint jmode) {
|
||||
cfg->SetSoundOutputMode(static_cast<Service::CFG::SoundOutputMode>(jmode));
|
||||
}
|
||||
|
||||
jshort Java_io_github_lime3ds_utils_SystemSaveGame_getCountryCode([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
return cfg->GetCountryCode();
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_utils_SystemSaveGame_setCountryCode([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jshort jmode) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jshort jmode) {
|
||||
cfg->SetCountryCode(static_cast<u8>(jmode));
|
||||
}
|
||||
|
||||
jint Java_io_github_lime3ds_utils_SystemSaveGame_getPlayCoins([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
return Service::PTM::Module::GetPlayCoins();
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_utils_SystemSaveGame_setPlayCoins([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj,
|
||||
jint jcoins) {
|
||||
[[maybe_unused]] jobject obj,
|
||||
jint jcoins) {
|
||||
Service::PTM::Module::SetPlayCoins(static_cast<u16>(jcoins));
|
||||
}
|
||||
|
||||
jlong Java_io_github_lime3ds_utils_SystemSaveGame_getConsoleId([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
[[maybe_unused]] jobject obj) {
|
||||
return cfg->GetConsoleUniqueId();
|
||||
}
|
||||
|
||||
void Java_io_github_lime3ds_utils_SystemSaveGame_regenerateConsoleId(
|
||||
[[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject obj) {
|
||||
void Java_io_github_lime3ds_utils_SystemSaveGame_regenerateConsoleId([[maybe_unused]] JNIEnv* env,
|
||||
[[maybe_unused]] jobject obj) {
|
||||
const auto [random_number, console_id] = cfg->GenerateConsoleUniqueId();
|
||||
cfg->SetConsoleUniqueId(random_number, console_id);
|
||||
cfg->UpdateConfigNANDSavegame();
|
||||
|
Loading…
Reference in New Issue
Block a user