mirror of
https://github.com/dgis/emu48android
synced 2024-12-25 09:58:26 +01:00
Update the readme.txt file and cleanup LCD update functions.
This commit is contained in:
parent
9f58423a93
commit
822845e1ba
5 changed files with 18 additions and 16 deletions
|
@ -61,6 +61,7 @@ CHANGES
|
|||
Version 2.8 (2024-xx-xx)
|
||||
|
||||
- Updated source code with Emu48 version 1.66+.
|
||||
- Fix an USB serial issue with Android 13+ (fix #23).
|
||||
|
||||
|
||||
Version 2.7 (2024-06-14)
|
||||
|
|
|
@ -58,6 +58,12 @@ LINKS
|
|||
|
||||
CHANGES
|
||||
|
||||
Version 2.8 (2024-xx-xx)
|
||||
|
||||
- Updated source code with Emu48 version 1.66+.
|
||||
- Fix an USB serial issue with Android 13+ (fix #23).
|
||||
|
||||
|
||||
Version 2.7 (2024-06-14)
|
||||
|
||||
- Updated source code with Emu48 version 1.65+. This new version improve the serial communication.
|
||||
|
|
|
@ -88,16 +88,14 @@ enum CALLBACK_TYPE {
|
|||
};
|
||||
|
||||
// https://stackoverflow.com/questions/9630134/jni-how-to-callback-from-c-or-c-to-java
|
||||
int mainViewCallback(int type, int param1, int param2, const TCHAR * param3, const TCHAR * param4) {
|
||||
int mainViewCallback(int type, int param1, int param2/*, const TCHAR * param3, const TCHAR * param4*/) {
|
||||
if (mainActivity) {
|
||||
JNIEnv *jniEnv = getJNIEnvironment();
|
||||
if(jniEnv) {
|
||||
jclass mainActivityClass = (*jniEnv)->GetObjectClass(jniEnv, mainActivity);
|
||||
if(mainActivityClass) {
|
||||
jmethodID midStr = (*jniEnv)->GetMethodID(jniEnv, mainActivityClass, "updateCallback", "(IIILjava/lang/String;Ljava/lang/String;)I");
|
||||
jstring utfParam3 = (*jniEnv)->NewStringUTF(jniEnv, param3);
|
||||
jstring utfParam4 = (*jniEnv)->NewStringUTF(jniEnv, param4);
|
||||
int result = (*jniEnv)->CallIntMethod(jniEnv, mainActivity, midStr, type, param1, param2, utfParam3, utfParam4);
|
||||
jmethodID midStr = (*jniEnv)->GetMethodID(jniEnv, mainActivityClass, "updateCallback", "(III)I");
|
||||
int result = (*jniEnv)->CallIntMethod(jniEnv, mainActivity, midStr, type, param1, param2);
|
||||
(*jniEnv)->DeleteLocalRef(jniEnv, mainActivityClass);
|
||||
//if(needDetach) ret = (*java_machine)->DetachCurrentThread(java_machine);
|
||||
return result;
|
||||
|
@ -113,18 +111,16 @@ void mainViewUpdateCallback() {
|
|||
// int param2 = ((mainViewRectangleToUpdate.right & 0xFFFF) << 16) | (mainViewRectangleToUpdate.bottom & 0xFFFF);
|
||||
// mainViewCallback(CALLBACK_TYPE_INVALIDATE,
|
||||
// param1,
|
||||
// param2,
|
||||
// NULL, NULL);
|
||||
// param2);
|
||||
// SetRectEmpty(&mainViewRectangleToUpdate);
|
||||
// } else
|
||||
mainViewCallback(CALLBACK_TYPE_INVALIDATE,
|
||||
0,
|
||||
0,
|
||||
NULL, NULL);
|
||||
0);
|
||||
}
|
||||
|
||||
void mainViewResizeCallback(int x, int y) {
|
||||
mainViewCallback(CALLBACK_TYPE_WINDOW_RESIZE, x, y, NULL, NULL);
|
||||
mainViewCallback(CALLBACK_TYPE_WINDOW_RESIZE, x, y);
|
||||
|
||||
JNIEnv * jniEnv;
|
||||
int ret = (*java_machine)->GetEnv(java_machine, (void **) &jniEnv, JNI_VERSION_1_6);
|
||||
|
|
|
@ -483,7 +483,7 @@ public class MainScreenView extends PanAndScaleView {
|
|||
canvas.drawLines(pointsBuffer, paintLCD);
|
||||
}
|
||||
|
||||
public void updateCallback(int type, int param1, int param2, String param3, String param4) {
|
||||
public void updateCallback(int type, int param1, int param2) {
|
||||
try {
|
||||
switch (type) {
|
||||
case NativeLib.CALLBACK_TYPE_INVALIDATE:
|
||||
|
|
|
@ -1783,12 +1783,11 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
|||
// Method used from JNI!
|
||||
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public int updateCallback(int type, int param1, int param2, String param3, String param4) {
|
||||
|
||||
mainScreenView.updateCallback(type, param1, param2, param3, param4);
|
||||
return -1;
|
||||
}
|
||||
public int updateCallback(int type, int param1, int param2) {
|
||||
|
||||
mainScreenView.updateCallback(type, param1, param2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
final int GENERIC_READ = 1;
|
||||
final int GENERIC_WRITE = 2;
|
||||
|
|
Loading…
Reference in a new issue