From 511e94dbd70f500a4803c50dda63c0ff29038cb2 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Mon, 17 Sep 2012 02:16:23 +0200 Subject: [PATCH] (Android) Add rruntime.java --- android/src/com/retroarch/audio_android.java | 16 +++++++ android/src/com/retroarch/main.java | 23 +++++++--- android/src/com/retroarch/rgl.java | 16 +++++++ android/src/com/retroarch/rruntime.java | 48 ++++++++++++++++++++ 4 files changed, 97 insertions(+), 6 deletions(-) create mode 100644 android/src/com/retroarch/rruntime.java diff --git a/android/src/com/retroarch/audio_android.java b/android/src/com/retroarch/audio_android.java index c12d649fd4..1ebe9d8bbf 100644 --- a/android/src/com/retroarch/audio_android.java +++ b/android/src/com/retroarch/audio_android.java @@ -1,3 +1,19 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * Copyright (C) 2011-2012 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + package com.retroarch; import android.media.AudioFormat; diff --git a/android/src/com/retroarch/main.java b/android/src/com/retroarch/main.java index c380f87720..0aaeca5ab5 100644 --- a/android/src/com/retroarch/main.java +++ b/android/src/com/retroarch/main.java @@ -1,3 +1,19 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * Copyright (C) 2011-2012 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + package com.retroarch; import com.retroarch.R; @@ -17,11 +33,6 @@ import android.os.Bundle; public class main extends Activity { - static - { - System.loadLibrary("retroarch"); - } - private GLSurfaceView ctx_gl; @Override @@ -84,4 +95,4 @@ class rgl_context extends GLSurfaceView setEGLContextClientVersion(2); setRenderer(new rgl()); } -} \ No newline at end of file +} diff --git a/android/src/com/retroarch/rgl.java b/android/src/com/retroarch/rgl.java index 7c71ca21fb..ea09b06ce2 100644 --- a/android/src/com/retroarch/rgl.java +++ b/android/src/com/retroarch/rgl.java @@ -1,3 +1,19 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * Copyright (C) 2011-2012 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + package com.retroarch; import java.nio.ByteBuffer; diff --git a/android/src/com/retroarch/rruntime.java b/android/src/com/retroarch/rruntime.java new file mode 100644 index 0000000000..c3992ec418 --- /dev/null +++ b/android/src/com/retroarch/rruntime.java @@ -0,0 +1,48 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * Copyright (C) 2011-2012 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +package com.retroarch; + +public class RRuntime +{ + static + { + System.loadLibrary("retroarch"); + } + + private RRuntime() + { + + } + + public static native void load_game(final String j_path, final int j_extract_zip_mode); + + public static native boolean run_frame(); + + public static native startup(String j_config_path); + + public static native int loadRom(final String fileName); + + public static native void deinit(); + + public static native void load_state(); + + public static native void save_state(); + + public static native void settings_change(final int j_setting); + + public static native void settings_set_defaults(); +}