From 80b5739f86d28aa872325170f809c4d675bdedb2 Mon Sep 17 00:00:00 2001 From: Themaister Date: Thu, 24 Jan 2013 23:55:28 +0100 Subject: [PATCH] Don't display non-NEON version if NEON-version exists. --- .../src/org/retroarch/browser/RetroArch.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/android/phoenix/src/org/retroarch/browser/RetroArch.java b/android/phoenix/src/org/retroarch/browser/RetroArch.java index 91c3e55b71..ad468a41a2 100644 --- a/android/phoenix/src/org/retroarch/browser/RetroArch.java +++ b/android/phoenix/src/org/retroarch/browser/RetroArch.java @@ -184,12 +184,31 @@ public class RetroArch extends Activity implements // Populate the list final String modulePath = getApplicationInfo().nativeLibraryDir; - for (final File lib : new File(modulePath).listFiles()) { + final File[] libs = new File(modulePath).listFiles(); + for (final File lib : libs) { String libName = lib.getName(); + // Never append a NEON lib if we don't have NEON. if (libName.contains("neon") && !cpuIsNeon) continue; + // If we have a NEON version with NEON capable CPU, + // never append a non-NEON version. + if (cpuIsNeon && !libName.contains("neon")) { + boolean hasNeonVersion = false; + for (final File lib_ : libs) { + String otherName = lib_.getName(); + String baseName = libName.replace(".so", ""); + if (otherName.contains("neon") && otherName.startsWith(baseName)) { + hasNeonVersion = true; + break; + } + } + + if (hasNeonVersion) + continue; + } + // Allow both libretro-core.so and libretro_core.so. if (libName.startsWith("libretro") && !libName.startsWith("libretroarch")) { try {