(Android) Add Android Makefile + commit auo-generated com_retroarch_rruntime.h
header
This commit is contained in:
parent
84f0149c86
commit
7bec5ddb55
|
@ -0,0 +1,22 @@
|
||||||
|
###
|
||||||
|
##
|
||||||
|
# Makefile for RetroArch Android.
|
||||||
|
##
|
||||||
|
|
||||||
|
all:
|
||||||
|
ndk-build
|
||||||
|
|
||||||
|
clean:
|
||||||
|
ndk-build clean
|
||||||
|
|
||||||
|
headers:
|
||||||
|
javah -o android/com_retroarch_rruntime.h -classpath android/bin/classes com.retroarch.rruntime
|
||||||
|
|
||||||
|
install:
|
||||||
|
adb install retroarch-android.apk
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
adb uninstall com.retroarch
|
||||||
|
|
||||||
|
test_shader:
|
||||||
|
cgc -ogles -profile glslf $(FILE)
|
|
@ -22,12 +22,14 @@
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
#include "../boolean.h"
|
#include "../boolean.h"
|
||||||
|
|
||||||
|
#include "com_retroarch_rruntime.h"
|
||||||
|
|
||||||
#include "../console/rarch_console_main_wrap.h"
|
#include "../console/rarch_console_main_wrap.h"
|
||||||
#include "../console/rarch_console_rom_ext.h"
|
#include "../console/rarch_console_rom_ext.h"
|
||||||
#include "../console/rarch_console_settings.h"
|
#include "../console/rarch_console_settings.h"
|
||||||
#include "../general.h"
|
#include "../general.h"
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_retroarch_RRuntime_load_game
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_load_1game
|
||||||
(JNIEnv *env, jclass class, jstring j_path, jint j_extract_zip_mode)
|
(JNIEnv *env, jclass class, jstring j_path, jint j_extract_zip_mode)
|
||||||
{
|
{
|
||||||
jboolean is_copy = false;
|
jboolean is_copy = false;
|
||||||
|
@ -38,13 +40,13 @@ JNIEXPORT void JNICALL Java_com_retroarch_RRuntime_load_game
|
||||||
(*env)->ReleaseStringUTFChars(env, j_path, game_path);
|
(*env)->ReleaseStringUTFChars(env, j_path, game_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_com_retroarch_RRuntime_run_frame
|
JNIEXPORT jboolean JNICALL Java_com_retroarch_rruntime_run_1frame
|
||||||
(JNIEnv *env, jclass class)
|
(JNIEnv *env, jclass class)
|
||||||
{
|
{
|
||||||
return rarch_main_iterate();
|
return rarch_main_iterate();
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_retroarch_RRuntime_startup
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_startup
|
||||||
(JNIEnv *env, jclass class, jstring j_config_path)
|
(JNIEnv *env, jclass class, jstring j_config_path)
|
||||||
{
|
{
|
||||||
bool retval = false;
|
bool retval = false;
|
||||||
|
@ -56,32 +58,32 @@ JNIEXPORT void JNICALL Java_com_retroarch_RRuntime_startup
|
||||||
(*env)->ReleaseStringUTFChars(env, j_config_path, config_path);
|
(*env)->ReleaseStringUTFChars(env, j_config_path, config_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_retroarch_RRuntime_deinit
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_deinit
|
||||||
(JNIEnv *env, jclass class)
|
(JNIEnv *env, jclass class)
|
||||||
{
|
{
|
||||||
rarch_main_deinit();
|
rarch_main_deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_retroarch_RRuntime_load_state
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_load_1state
|
||||||
(JNIEnv *env, jclass class)
|
(JNIEnv *env, jclass class)
|
||||||
{
|
{
|
||||||
rarch_load_state();
|
rarch_load_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_retroarch_RRuntime_save_state
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_save_1state
|
||||||
(JNIEnv *env, jclass class)
|
(JNIEnv *env, jclass class)
|
||||||
{
|
{
|
||||||
rarch_save_state();
|
rarch_save_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_retroarch_RRuntime_settings_change
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_settings_1change
|
||||||
(JNIEnv *env, jclass class, jint j_setting)
|
(JNIEnv *env, jclass class, jint j_setting)
|
||||||
{
|
{
|
||||||
unsigned setting = j_setting;
|
unsigned setting = j_setting;
|
||||||
rarch_settings_change(setting);
|
rarch_settings_change(setting);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_retroarch_RRuntime_settings_set_defaults
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_settings_1set_1defaults
|
||||||
(JNIEnv *env, jclass class)
|
(JNIEnv *env, jclass class)
|
||||||
{
|
{
|
||||||
rarch_settings_set_default();
|
rarch_settings_set_default();
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||||
|
#include <jni.h>
|
||||||
|
/* Header for class com_retroarch_rruntime */
|
||||||
|
|
||||||
|
#ifndef _Included_com_retroarch_rruntime
|
||||||
|
#define _Included_com_retroarch_rruntime
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
* Class: com_retroarch_rruntime
|
||||||
|
* Method: load_game
|
||||||
|
* Signature: (Ljava/lang/String;I)V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_load_1game
|
||||||
|
(JNIEnv *, jclass, jstring, jint);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: com_retroarch_rruntime
|
||||||
|
* Method: run_frame
|
||||||
|
* Signature: ()Z
|
||||||
|
*/
|
||||||
|
JNIEXPORT jboolean JNICALL Java_com_retroarch_rruntime_run_1frame
|
||||||
|
(JNIEnv *, jclass);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: com_retroarch_rruntime
|
||||||
|
* Method: startup
|
||||||
|
* Signature: (Ljava/lang/String;)V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_startup
|
||||||
|
(JNIEnv *, jclass, jstring);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: com_retroarch_rruntime
|
||||||
|
* Method: deinit
|
||||||
|
* Signature: ()V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_deinit
|
||||||
|
(JNIEnv *, jclass);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: com_retroarch_rruntime
|
||||||
|
* Method: load_state
|
||||||
|
* Signature: ()V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_load_1state
|
||||||
|
(JNIEnv *, jclass);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: com_retroarch_rruntime
|
||||||
|
* Method: save_state
|
||||||
|
* Signature: ()V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_save_1state
|
||||||
|
(JNIEnv *, jclass);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: com_retroarch_rruntime
|
||||||
|
* Method: settings_change
|
||||||
|
* Signature: (I)V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_settings_1change
|
||||||
|
(JNIEnv *, jclass, jint);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: com_retroarch_rruntime
|
||||||
|
* Method: settings_set_defaults
|
||||||
|
* Signature: ()V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_settings_1set_1defaults
|
||||||
|
(JNIEnv *, jclass);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
|
@ -16,14 +16,14 @@
|
||||||
|
|
||||||
package com.retroarch;
|
package com.retroarch;
|
||||||
|
|
||||||
public class RRuntime
|
public class rruntime
|
||||||
{
|
{
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
System.loadLibrary("retroarch");
|
System.loadLibrary("retroarch");
|
||||||
}
|
}
|
||||||
|
|
||||||
private RRuntime()
|
private rruntime()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -32,9 +32,7 @@ public class RRuntime
|
||||||
|
|
||||||
public static native boolean run_frame();
|
public static native boolean run_frame();
|
||||||
|
|
||||||
public static native startup(String j_config_path);
|
public static native void startup(String j_config_path);
|
||||||
|
|
||||||
public static native int loadRom(final String fileName);
|
|
||||||
|
|
||||||
public static native void deinit();
|
public static native void deinit();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue