diff --git a/Android/jni/jnihooks.c b/Android/jni/jnihooks.c index 0e6add9e..5ef3a576 100644 --- a/Android/jni/jnihooks.c +++ b/Android/jni/jnihooks.c @@ -64,7 +64,6 @@ void Java_org_deadc0de_apple2_Apple2Activity_nativeOnPause(JNIEnv *env, jobject void Java_org_deadc0de_apple2_Apple2Activity_nativeRender(JNIEnv *env, jobject obj) { c_keys_handle_input(-1, 0, 0); -#define FPS_LOG 1 #if FPS_LOG static uint32_t prevCount = 0; static uint32_t idleCount = 0; @@ -82,8 +81,6 @@ void Java_org_deadc0de_apple2_Apple2Activity_nativeRender(JNIEnv *env, jobject o } #endif - if (_vid_dirty) { - video_driver_render(); - } + video_driver_render(); } diff --git a/Android/src/org/deadc0de/apple2/Apple2Activity.java b/Android/src/org/deadc0de/apple2/Apple2Activity.java index a33fdfce..1e580e71 100644 --- a/Android/src/org/deadc0de/apple2/Apple2Activity.java +++ b/Android/src/org/deadc0de/apple2/Apple2Activity.java @@ -68,18 +68,14 @@ public class Apple2Activity extends Activity { Log.d(TAG, "First time copying stuff-n-things out of APK for ease-of-NDK access..."); try { - _copyFile(dataDir, "shaders", "Basic.vsh"); - _copyFile(dataDir, "shaders", "Basic.fsh"); - _copyFile(dataDir, "disks", "blank.dsk"); - _copyFile(dataDir, "disks", "blank.nib"); - _copyFile(dataDir, "disks", "blank.po"); - _copyFile(dataDir, "disks", "etc.dsk"); - _copyFile(dataDir, "disks", "flapple140.po"); - _copyFile(dataDir, "disks", "mystery.dsk"); - _copyFile(dataDir, "disks", "ProDOS.dsk"); - _copyFile(dataDir, "disks", "speedtest.dsk"); - _copyFile(dataDir, "disks", "testdisplay1.dsk"); - _copyFile(dataDir, "disks", "testvm1.dsk"); + String[] shaders = getAssets().list("shaders"); + for (String shader : shaders) { + _copyFile(dataDir, "shaders", shader); + } + String[] disks = getAssets().list("disks"); + for (String disk : disks) { + _copyFile(dataDir, "disks", disk); + } } catch (IOException e) { Log.e(TAG, "problem copying resources : "+e); System.exit(1); diff --git a/Android/src/org/deadc0de/apple2/Apple2View.java b/Android/src/org/deadc0de/apple2/Apple2View.java index b2ca0b03..47f63f96 100644 --- a/Android/src/org/deadc0de/apple2/Apple2View.java +++ b/Android/src/org/deadc0de/apple2/Apple2View.java @@ -49,7 +49,7 @@ import javax.microedition.khronos.opengles.GL10; */ class Apple2View extends GLSurfaceView { private final static String TAG = "Apple2View"; - private final static boolean DEBUG = true; + private final static boolean DEBUG = false; private Apple2Activity mActivity = null; @@ -165,10 +165,8 @@ class Apple2View extends GLSurfaceView { // Now return the "best" one EGLConfig best = chooseConfig(egl, display, configs); - if (DEBUG) { - Log.w(TAG, "BEST CONFIG : "); - printConfig(egl, display, best); - } + Log.w(TAG, "Using EGL CONFIG : "); + printConfig(egl, display, best); return best; } diff --git a/src/video/glvideo.c b/src/video/glvideo.c index 54c46093..56da60c5 100644 --- a/src/video/glvideo.c +++ b/src/video/glvideo.c @@ -324,12 +324,16 @@ static GLuint _build_program(demoSource *vertexSource, demoSource *fragmentSourc // Determine if GLSL version 140 is supported by this context. // We'll use this info to generate a GLSL shader source string // with the proper version preprocessor string prepended - float glLanguageVersion; + float glLanguageVersion = 0.f; + char *shaderLangVersion = (char *)glGetString(GL_SHADING_LANGUAGE_VERSION); + if (shaderLangVersion == NULL) { + ERRQUIT("shader toolchain unavailable"); + } #if TARGET_OS_IPHONE - sscanf((char *)glGetString(GL_SHADING_LANGUAGE_VERSION), "OpenGL ES GLSL ES %f", &glLanguageVersion); + sscanf(shaderLangVersion, "OpenGL ES GLSL ES %f", &glLanguageVersion); #else - sscanf((char *)glGetString(GL_SHADING_LANGUAGE_VERSION), "%f", &glLanguageVersion); + sscanf(shaderLangVersion, "%f", &glLanguageVersion); #endif // GL_SHADING_LANGUAGE_VERSION returns the version standard version form @@ -620,9 +624,7 @@ static void gldriver_update(int unused) { #endif c_keys_handle_input(-1, 0, 0); - if (_vid_dirty) { - glutPostRedisplay(); - } + glutPostRedisplay(); glutTimerFunc(17, gldriver_update, 0); } #endif @@ -660,22 +662,25 @@ static void gldriver_render(void) { // that we calculated above glUniformMatrix4fv(uniformMVPIdx, 1, GL_FALSE, mvp); - // Update texture from indexed-color Apple //e internal framebuffer - unsigned int count = SCANWIDTH * SCANHEIGHT; char pixels[SCANWIDTH * SCANHEIGHT * 4]; - for (unsigned int i=0, j=0; i