diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/AlberDriver.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/AlberDriver.java index bb3945b5..83392b0a 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/AlberDriver.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/AlberDriver.java @@ -34,6 +34,7 @@ public class AlberDriver { public static native void setShaderJitEnabled(boolean enable); public static native void setAccurateShaderMulEnable(boolean enable); + public static native void setAudioEnabled(boolean enable); public static int openDocument(String path, String mode) { try { diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/preferences/AdvancedPreferences.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/preferences/AdvancedPreferences.java index 8d04403e..13c579dd 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/preferences/AdvancedPreferences.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/preferences/AdvancedPreferences.java @@ -23,6 +23,7 @@ public class AdvancedPreferences extends BasePreferenceFragment { setItemClick("performanceMonitor", pref -> GlobalConfig.set(GlobalConfig.KEY_SHOW_PERFORMANCE_OVERLAY, ((SwitchPreferenceCompat) pref).isChecked())); setItemClick("shaderJit", pref -> GlobalConfig.set(GlobalConfig.KEY_SHADER_JIT, ((SwitchPreferenceCompat) pref).isChecked())); setItemClick("accurateShaderMul", pref -> GlobalConfig.set(GlobalConfig.KEY_ACCURATE_SHADER_MULTIPLY, ((SwitchPreferenceCompat) pref).isChecked())); + setItemClick("enableAudio", pref -> GlobalConfig.set(GlobalConfig.KEY_ENABLE_AUDIO, ((SwitchPreferenceCompat) pref).isChecked())); setItemClick("loggerService", pref -> { boolean checked = ((SwitchPreferenceCompat) pref).isChecked(); Context ctx = PandroidApplication.getAppContext(); @@ -48,5 +49,6 @@ public class AdvancedPreferences extends BasePreferenceFragment { ((SwitchPreferenceCompat) findPreference("loggerService")).setChecked(GlobalConfig.get(GlobalConfig.KEY_LOGGER_SERVICE)); ((SwitchPreferenceCompat) findPreference("shaderJit")).setChecked(GlobalConfig.get(GlobalConfig.KEY_SHADER_JIT)); ((SwitchPreferenceCompat) findPreference("accurateShaderMul")).setChecked(GlobalConfig.get(GlobalConfig.KEY_ACCURATE_SHADER_MULTIPLY)); + ((SwitchPreferenceCompat) findPreference("enableAudio")).setChecked(GlobalConfig.get(GlobalConfig.KEY_ENABLE_AUDIO)); } } diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/data/config/GlobalConfig.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/data/config/GlobalConfig.java index c8750f88..e9e32aed 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/data/config/GlobalConfig.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/data/config/GlobalConfig.java @@ -23,6 +23,7 @@ public class GlobalConfig { public static final Key KEY_SHADER_JIT = new Key<>("emu.shader_jit", true); public static final Key KEY_ACCURATE_SHADER_MULTIPLY = new Key<>("emu.accurate_shader_mul", false); + public static final Key KEY_ENABLE_AUDIO = new Key<>("emu.enable_audio", true); public static final Key KEY_PICTURE_IN_PICTURE = new Key<>("app.behavior.pictureInPicture", false); public static final Key KEY_SHOW_PERFORMANCE_OVERLAY = new Key<>("dev.performanceOverlay", false); public static final Key KEY_LOGGER_SERVICE = new Key<>("dev.loggerService", false); diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/PandaGlRenderer.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/PandaGlRenderer.java index 3fb435b4..dfdad225 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/PandaGlRenderer.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/PandaGlRenderer.java @@ -94,6 +94,7 @@ public class PandaGlRenderer implements GLSurfaceView.Renderer, ConsoleRenderer AlberDriver.Initialize(); AlberDriver.setShaderJitEnabled(GlobalConfig.get(GlobalConfig.KEY_SHADER_JIT)); AlberDriver.setAccurateShaderMulEnable(GlobalConfig.get(GlobalConfig.KEY_ACCURATE_SHADER_MULTIPLY)); + AlberDriver.setAudioEnabled(GlobalConfig.get(GlobalConfig.KEY_ENABLE_AUDIO)); // If loading the ROM failed, display an error message and early exit if (!AlberDriver.LoadRom(romPath)) { diff --git a/src/pandroid/app/src/main/res/values/strings.xml b/src/pandroid/app/src/main/res/values/strings.xml index 63a6c246..b0479ade 100644 --- a/src/pandroid/app/src/main/res/values/strings.xml +++ b/src/pandroid/app/src/main/res/values/strings.xml @@ -59,6 +59,9 @@ Graphics Shader JIT Use shader recompiler. + Audio + Enable Audio + Audio will be enabled Tools Logger Store application logs to file. diff --git a/src/pandroid/app/src/main/res/xml/advanced_preferences.xml b/src/pandroid/app/src/main/res/xml/advanced_preferences.xml index 9ef81dbf..0f025994 100644 --- a/src/pandroid/app/src/main/res/xml/advanced_preferences.xml +++ b/src/pandroid/app/src/main/res/xml/advanced_preferences.xml @@ -35,4 +35,16 @@ app:iconSpaceReserved="false"/> - \ No newline at end of file + + + + + + +