From 60cb886cd458fc10390cb3e79096687da68a4354 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Tue, 24 Jan 2023 13:26:04 -0500 Subject: [PATCH] Android: Convert WiiUtils to Kotlin --- .../dolphinemu/dolphinemu/utils/WiiUtils.java | 42 ----------------- .../dolphinemu/dolphinemu/utils/WiiUtils.kt | 46 +++++++++++++++++++ 2 files changed, 46 insertions(+), 42 deletions(-) delete mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/WiiUtils.java create mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/WiiUtils.kt diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/WiiUtils.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/WiiUtils.java deleted file mode 100644 index 61dfedf5cd..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/WiiUtils.java +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -package org.dolphinemu.dolphinemu.utils; - -public final class WiiUtils -{ - public static final int RESULT_SUCCESS = 0; - public static final int RESULT_ERROR = 1; - public static final int RESULT_CANCELLED = 2; - public static final int RESULT_CORRUPTED_SOURCE = 3; - public static final int RESULT_TITLE_MISSING = 4; - - public static final int UPDATE_RESULT_SUCCESS = 0; - public static final int UPDATE_RESULT_ALREADY_UP_TO_DATE = 1; - public static final int UPDATE_RESULT_REGION_MISMATCH = 2; - public static final int UPDATE_RESULT_MISSING_UPDATE_PARTITION = 3; - public static final int UPDATE_RESULT_DISC_READ_FAILED = 4; - public static final int UPDATE_RESULT_SERVER_FAILED = 5; - public static final int UPDATE_RESULT_DOWNLOAD_FAILED = 6; - public static final int UPDATE_RESULT_IMPORT_FAILED = 7; - public static final int UPDATE_RESULT_CANCELLED = 8; - - public static native boolean installWAD(String file); - - public static native int importWiiSave(String file, BooleanSupplier canOverwrite); - - public static native void importNANDBin(String file); - - public static native int doOnlineUpdate(String region, WiiUpdateCallback callback); - - public static native int doDiscUpdate(String path, WiiUpdateCallback callback); - - public static native boolean isSystemMenuInstalled(); - - public static native boolean isSystemMenuvWii(); - - public static native String getSystemMenuVersion(); - - public static native boolean syncSdFolderToSdImage(); - - public static native boolean syncSdImageToSdFolder(); -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/WiiUtils.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/WiiUtils.kt new file mode 100644 index 0000000000..b41ab24816 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/WiiUtils.kt @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +package org.dolphinemu.dolphinemu.utils + +object WiiUtils { + const val RESULT_SUCCESS = 0 + const val RESULT_ERROR = 1 + const val RESULT_CANCELLED = 2 + const val RESULT_CORRUPTED_SOURCE = 3 + const val RESULT_TITLE_MISSING = 4 + const val UPDATE_RESULT_SUCCESS = 0 + const val UPDATE_RESULT_ALREADY_UP_TO_DATE = 1 + const val UPDATE_RESULT_REGION_MISMATCH = 2 + const val UPDATE_RESULT_MISSING_UPDATE_PARTITION = 3 + const val UPDATE_RESULT_DISC_READ_FAILED = 4 + const val UPDATE_RESULT_SERVER_FAILED = 5 + const val UPDATE_RESULT_DOWNLOAD_FAILED = 6 + const val UPDATE_RESULT_IMPORT_FAILED = 7 + const val UPDATE_RESULT_CANCELLED = 8 + + @JvmStatic + external fun installWAD(file: String): Boolean + + @JvmStatic + external fun importWiiSave(file: String, canOverwrite: BooleanSupplier): Int + + @JvmStatic + external fun importNANDBin(file: String) + external fun doOnlineUpdate(region: String, callback: WiiUpdateCallback): Int + external fun doDiscUpdate(path: String, callback: WiiUpdateCallback): Int + + @JvmStatic + external fun isSystemMenuInstalled(): Boolean + + @JvmStatic + external fun isSystemMenuvWii(): Boolean + + @JvmStatic + external fun getSystemMenuVersion(): String + + @JvmStatic + external fun syncSdFolderToSdImage(): Boolean + + @JvmStatic + external fun syncSdImageToSdFolder(): Boolean +}