From d58d58fcfc6f3b7a8dfe15148b2e9cadfe2de47b Mon Sep 17 00:00:00 2001 From: rafaelortis Date: Wed, 23 Nov 2016 08:36:23 -0200 Subject: [PATCH] Zenfone 2 workaround for emulation freeze bug --- jni/emulate.c | 4 +++- jni/x48.c | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/jni/emulate.c b/jni/emulate.c index d0c3066..98a741f 100644 --- a/jni/emulate.c +++ b/jni/emulate.c @@ -112,6 +112,8 @@ static word_20 jumpmasks[] = { 0xffff0000, 0xfff00000, 0xff000000, 0xf0000000 }; +int check_out_register(); + int #ifdef __FunctionProto__ decode_group_80(void) @@ -694,7 +696,7 @@ decode_group_1() } } -inline int +int #ifdef __FunctionProto__ decode_8_thru_f(int op1) #else diff --git a/jni/x48.c b/jni/x48.c index bfee69a..31ee379 100644 --- a/jni/x48.c +++ b/jni/x48.c @@ -629,7 +629,13 @@ GetEvent() int code = (*android_env)->CallIntMethod(android_env, android_callback, waitEvent); -//LOGI("code: %d", code); + //LOGI("code: %d", code); + //FIX for Zenfone 2 + struct timespec req, rem; + req.tv_sec = 0; + req.tv_nsec = 100L; + nanosleep(&req , &rem); + if (code < 0) { code = -code;