diff --git a/.gitignore b/.gitignore
index f483ccc30b..0c2ecdafe2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,6 +46,6 @@ profile
DerivedData
.idea/
*.hmap
-ios/tmp
-ios/modules/*.dylib
-ios/*.mobileprovision
+apple/tmp
+apple/modules/*.dylib
+apple/*.mobileprovision
diff --git a/Makefile b/Makefile
index 80aad3fa87..af0873898a 100644
--- a/Makefile
+++ b/Makefile
@@ -183,10 +183,6 @@ ifeq ($(HAVE_SDL), 1)
JOYCONFIG_OBJ += input/sdl_joypad.o
DEFINES += $(SDL_CFLAGS) $(BSD_LOCAL_INC)
LIBS += $(SDL_LIBS)
-
- ifeq ($(HAVE_OPENGL), 1)
- OBJ += gfx/context/sdl_ctx.o
- endif
endif
ifeq ($(HAVE_OPENGL), 1)
diff --git a/Makefile.win b/Makefile.win
index 00d3bbce92..0c5f24d416 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -100,7 +100,7 @@ ifeq ($(HAVE_RGUI), 1)
endif
ifeq ($(HAVE_SDL), 1)
- OBJ += gfx/sdl_gfx.o gfx/context/sdl_ctx.o input/sdl_input.o input/sdl_joypad.o audio/sdl_audio.o
+ OBJ += gfx/sdl_gfx.o input/sdl_input.o input/sdl_joypad.o audio/sdl_audio.o
JOBJ += input/sdl_joypad.o
LIBS += -lSDL
JLIBS += -lSDL
diff --git a/android/andretro/AndroidManifest.xml b/android/andretro/AndroidManifest.xml
new file mode 100644
index 0000000000..511aa4034c
--- /dev/null
+++ b/android/andretro/AndroidManifest.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/andretro/README b/android/andretro/README
new file mode 100644
index 0000000000..b060895c53
--- /dev/null
+++ b/android/andretro/README
@@ -0,0 +1,6 @@
+Building:
+
+* Put any compiled module libraries in Andretro/jni/modules, the file must be named like libretro_{MODNAME}.so.
+* Ensure a matching libretro_{MODNAME}.so.xml exists in the Andretro/assets directory. The xml file contains basic information used by the file browser before the .so itself is loaded.
+* In the Andretro directory, run the ndk-build script supplied with the Android NDK.
+* In the Andretro directory, run 'ant debug install' to install to the device. The java code can alternatively be built with the included eclipse project.
diff --git a/android/andretro/ant.properties b/android/andretro/ant.properties
new file mode 100644
index 0000000000..b0971e891e
--- /dev/null
+++ b/android/andretro/ant.properties
@@ -0,0 +1,17 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked into Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+# 'source.dir' for the location of your java source folder and
+# 'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+# 'key.store' for the location of your keystore and
+# 'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
diff --git a/android/andretro/assets/libretro_fceu-next.so.xml b/android/andretro/assets/libretro_fceu-next.so.xml
new file mode 100644
index 0000000000..7c220b7e50
--- /dev/null
+++ b/android/andretro/assets/libretro_fceu-next.so.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/andretro/assets/libretro_final_burn_alpha.so.xml b/android/andretro/assets/libretro_final_burn_alpha.so.xml
new file mode 100644
index 0000000000..e0f1cc7f1a
--- /dev/null
+++ b/android/andretro/assets/libretro_final_burn_alpha.so.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/andretro/assets/libretro_gambatte.so.xml b/android/andretro/assets/libretro_gambatte.so.xml
new file mode 100644
index 0000000000..bc4efaee09
--- /dev/null
+++ b/android/andretro/assets/libretro_gambatte.so.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/andretro/assets/libretro_genesis-plus-gx.so.xml b/android/andretro/assets/libretro_genesis-plus-gx.so.xml
new file mode 100644
index 0000000000..da6792a1ff
--- /dev/null
+++ b/android/andretro/assets/libretro_genesis-plus-gx.so.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/andretro/assets/libretro_pcsx_rearmed.so.xml b/android/andretro/assets/libretro_pcsx_rearmed.so.xml
new file mode 100644
index 0000000000..066637c815
--- /dev/null
+++ b/android/andretro/assets/libretro_pcsx_rearmed.so.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/andretro/assets/libretro_prboom.so.xml b/android/andretro/assets/libretro_prboom.so.xml
new file mode 100644
index 0000000000..6f2931accd
--- /dev/null
+++ b/android/andretro/assets/libretro_prboom.so.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/andretro/assets/libretro_snes9x-next.so.xml b/android/andretro/assets/libretro_snes9x-next.so.xml
new file mode 100644
index 0000000000..19f551e946
--- /dev/null
+++ b/android/andretro/assets/libretro_snes9x-next.so.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/andretro/assets/libretro_stella.so.xml b/android/andretro/assets/libretro_stella.so.xml
new file mode 100644
index 0000000000..d9774ae546
--- /dev/null
+++ b/android/andretro/assets/libretro_stella.so.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/andretro/assets/libretro_vba-next.so.xml b/android/andretro/assets/libretro_vba-next.so.xml
new file mode 100644
index 0000000000..63173b9fe6
--- /dev/null
+++ b/android/andretro/assets/libretro_vba-next.so.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/andretro/build.xml b/android/andretro/build.xml
new file mode 100644
index 0000000000..a20ad3790d
--- /dev/null
+++ b/android/andretro/build.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/andretro/ic_launcher-web.png b/android/andretro/ic_launcher-web.png
new file mode 100644
index 0000000000..c37372acb9
Binary files /dev/null and b/android/andretro/ic_launcher-web.png differ
diff --git a/android/andretro/jni/Android.mk b/android/andretro/jni/Android.mk
new file mode 100644
index 0000000000..50729fcf80
--- /dev/null
+++ b/android/andretro/jni/Android.mk
@@ -0,0 +1,23 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_CPP_FEATURES := exceptions rtti
+
+LOCAL_SRC_FILES = Driver.cpp
+
+LOCAL_MODULE := retroiface
+LOCAL_LDLIBS := -llog -lz -lGLESv2
+
+include $(BUILD_SHARED_LIBRARY)
+
+# Include all present sub-modules
+FOCAL_PATH := $(LOCAL_PATH)
+
+define function
+$(eval RETRO_MODULE_OBJECT := $(1))
+$(eval include $(FOCAL_PATH)/modules/Android.mk)
+endef
+
+$(foreach m,$(wildcard $(FOCAL_PATH)/modules/*.so),$(eval $(call function,$(m))))
diff --git a/android/andretro/jni/Application.mk b/android/andretro/jni/Application.mk
new file mode 100644
index 0000000000..87124dd882
--- /dev/null
+++ b/android/andretro/jni/Application.mk
@@ -0,0 +1 @@
+APP_STL := gnustl_static
diff --git a/android/andretro/jni/Common.h b/android/andretro/jni/Common.h
new file mode 100644
index 0000000000..18dd51c6be
--- /dev/null
+++ b/android/andretro/jni/Common.h
@@ -0,0 +1,177 @@
+#ifndef MJNI_COMMON_H
+#define MJNI_COMMON_H
+
+#include
+#include