Android: Convert WiiUtils to Kotlin

This commit is contained in:
Charles Lombardo 2023-01-24 13:26:04 -05:00
parent 2b17e0334a
commit 60cb886cd4
2 changed files with 46 additions and 42 deletions

View File

@ -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();
}

View File

@ -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
}