From ee4261cf5c2fa4da80006e24a732b779ccd96a46 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Wed, 25 Nov 2015 12:05:32 +0100 Subject: [PATCH] Attempt to address some auto-reported crashes on Android Still confused about the SignalSema/WaitSema ones.. they are still getting reported at high frequency --- Core/CwCheat.cpp | 6 +++--- android/src/org/ppsspp/ppsspp/NativeActivity.java | 6 ++++++ android/src/org/ppsspp/ppsspp/NativeEGLConfigChooser.java | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index ceb884d295..fe2e27ceea 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -124,7 +124,6 @@ void hleCheat(u64 userdata, int cyclesLate) { } CWCheatEngine::CWCheatEngine() { - } void CWCheatEngine::Exit() { @@ -139,7 +138,7 @@ static inline std::vector makeCodeParts(const std::vector CWCheatEngine::GetNextCode() { // Feeds a size-2 vector of ints std::vector finalCode; std::string modifier2 = "0"; while (true) { - if (currentCode >= parts.size()) { + // Shouldn't splitCode be cleared here? Otherwise var1 and var2 will always be set to the first two codes.. I don't get it + if (currentCode >= parts.size() - 1) { code1.clear(); code2.clear(); break; diff --git a/android/src/org/ppsspp/ppsspp/NativeActivity.java b/android/src/org/ppsspp/ppsspp/NativeActivity.java index 5ee27674c9..2cf5832e66 100644 --- a/android/src/org/ppsspp/ppsspp/NativeActivity.java +++ b/android/src/org/ppsspp/ppsspp/NativeActivity.java @@ -360,6 +360,12 @@ public class NativeActivity extends Activity { if (Build.MANUFACTURER == "OUYA") { mGLSurfaceView.getHolder().setFormat(PixelFormat.RGBX_8888); mGLSurfaceView.setEGLConfigChooser(new NativeEGLConfigChooser()); + } else { + // Many devices require that we set a config chooser, despite the documentation + // explicitly stating: "If no setEGLConfigChooser method is called, then by default the view will choose an RGB_888 surface with a depth buffer depth of at least 16 bits." + // On these devices, I get these crashes: http://stackoverflow.com/questions/14167319/android-opengl-demo-no-config-chosen + // So let's try it... + mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 8); } mGLSurfaceView.setRenderer(nativeRenderer); diff --git a/android/src/org/ppsspp/ppsspp/NativeEGLConfigChooser.java b/android/src/org/ppsspp/ppsspp/NativeEGLConfigChooser.java index c42a95e41f..fe4d09fe0d 100644 --- a/android/src/org/ppsspp/ppsspp/NativeEGLConfigChooser.java +++ b/android/src/org/ppsspp/ppsspp/NativeEGLConfigChooser.java @@ -144,7 +144,7 @@ public class NativeEGLConfigChooser implements EGLConfigChooser { } if (chosen == null) { - // Third, accept one with alpha but with stencil. + // Third, accept one with alpha but with stencil, 24-bit depth. for (int i = 0; i < configs.length; i++) { ConfigAttribs c = configs[i]; if (c.red == 8 && c.green == 8 && c.blue == 8 && c.alpha == 8 && c.stencil >= 8 && c.depth >= 24) { @@ -155,7 +155,7 @@ public class NativeEGLConfigChooser implements EGLConfigChooser { } if (chosen == null) { - // Third, accept one with alpha but with stencil. + // Third, accept one with alpha but with stencil, 16-bit depth. for (int i = 0; i < configs.length; i++) { ConfigAttribs c = configs[i]; if (c.red == 8 && c.green == 8 && c.blue == 8 && c.alpha == 8 && c.stencil >= 8 && c.depth >= 16) {