From ae82c3d4b5d14ae495e20f15b7ac4b907203c7f3 Mon Sep 17 00:00:00 2001 From: dgis Date: Mon, 10 Dec 2018 20:54:43 +0000 Subject: [PATCH] --- app/CMakeLists.txt | 67 +++++++++---------- app/src/main/cpp/android-emu48.c | 12 ++-- app/src/main/cpp/android-layer.c | 4 +- app/src/main/cpp/{ => core}/Emu48.c | 0 app/src/main/cpp/{ => core}/Emu48.h | 0 app/src/main/cpp/{ => core}/Opcodes.h | 0 app/src/main/cpp/{ => core}/apple.c | 0 app/src/main/cpp/{ => core}/apple.h | 0 app/src/main/cpp/{ => core}/color.h | 0 app/src/main/cpp/{ => core}/cursor.c | 0 app/src/main/cpp/{ => core}/ddeserv.c | 0 app/src/main/cpp/{ => core}/debugdll.c | 0 app/src/main/cpp/{ => core}/debugger.c | 0 app/src/main/cpp/{ => core}/debugger.h | 0 app/src/main/cpp/{ => core}/disasm.c | 0 app/src/main/cpp/{ => core}/dismem.c | 0 app/src/main/cpp/{ => core}/display.c | 0 app/src/main/cpp/{ => core}/disrpl.c | 0 app/src/main/cpp/{ => core}/disrpl.h | 0 app/src/main/cpp/{ => core}/emu48dll.c | 0 app/src/main/cpp/{ => core}/emu48dll.h | 0 app/src/main/cpp/{ => core}/engine.c | 0 app/src/main/cpp/{ => core}/external.c | 0 app/src/main/cpp/{ => core}/fetch.c | 0 app/src/main/cpp/{ => core}/files.c | 0 app/src/main/cpp/{ => core}/i28f160.c | 0 app/src/main/cpp/{ => core}/i28f160.h | 0 app/src/main/cpp/{ => core}/io.h | 0 app/src/main/cpp/{ => core}/keyboard.c | 0 app/src/main/cpp/{ => core}/keymacro.c | 0 app/src/main/cpp/{ => core}/kml.c | 0 app/src/main/cpp/{ => core}/kml.h | 0 app/src/main/cpp/{ => core}/lodepng.c | 0 app/src/main/cpp/{ => core}/lodepng.h | 0 app/src/main/cpp/{ => core}/lowbat.c | 0 app/src/main/cpp/{ => core}/mops.c | 0 app/src/main/cpp/{ => core}/mru.c | 0 app/src/main/cpp/{ => core}/opcodes.c | 0 app/src/main/cpp/{ => core}/ops.h | 0 app/src/main/cpp/{ => core}/pch.c | 0 app/src/main/cpp/{ => core}/pch.h | 2 +- app/src/main/cpp/{ => core}/redeye.c | 0 app/src/main/cpp/{ => core}/resource.h | 0 app/src/main/cpp/{ => core}/rpl.c | 0 app/src/main/cpp/{ => core}/serial.c | 0 app/src/main/cpp/{ => core}/settings.c | 0 app/src/main/cpp/{ => core}/snddef.h | 0 app/src/main/cpp/{ => core}/sndenum.c | 0 app/src/main/cpp/{ => core}/sound.c | 0 app/src/main/cpp/{ => core}/stack.c | 0 app/src/main/cpp/{ => core}/symbfile.c | 0 app/src/main/cpp/{ => core}/timer.c | 0 app/src/main/cpp/{ => core}/types.h | 0 app/src/main/cpp/{ => core}/udp.c | 0 app/src/main/cpp/emu48-jni.c | 2 +- app/src/main/cpp/win32-layer.c | 4 +- .../regis/cosnier/emu48/MainScreenView.java | 7 ++ 57 files changed, 52 insertions(+), 46 deletions(-) rename app/src/main/cpp/{ => core}/Emu48.c (100%) rename app/src/main/cpp/{ => core}/Emu48.h (100%) rename app/src/main/cpp/{ => core}/Opcodes.h (100%) rename app/src/main/cpp/{ => core}/apple.c (100%) rename app/src/main/cpp/{ => core}/apple.h (100%) rename app/src/main/cpp/{ => core}/color.h (100%) rename app/src/main/cpp/{ => core}/cursor.c (100%) rename app/src/main/cpp/{ => core}/ddeserv.c (100%) rename app/src/main/cpp/{ => core}/debugdll.c (100%) rename app/src/main/cpp/{ => core}/debugger.c (100%) rename app/src/main/cpp/{ => core}/debugger.h (100%) rename app/src/main/cpp/{ => core}/disasm.c (100%) rename app/src/main/cpp/{ => core}/dismem.c (100%) rename app/src/main/cpp/{ => core}/display.c (100%) rename app/src/main/cpp/{ => core}/disrpl.c (100%) rename app/src/main/cpp/{ => core}/disrpl.h (100%) rename app/src/main/cpp/{ => core}/emu48dll.c (100%) rename app/src/main/cpp/{ => core}/emu48dll.h (100%) rename app/src/main/cpp/{ => core}/engine.c (100%) rename app/src/main/cpp/{ => core}/external.c (100%) rename app/src/main/cpp/{ => core}/fetch.c (100%) rename app/src/main/cpp/{ => core}/files.c (100%) rename app/src/main/cpp/{ => core}/i28f160.c (100%) rename app/src/main/cpp/{ => core}/i28f160.h (100%) rename app/src/main/cpp/{ => core}/io.h (100%) rename app/src/main/cpp/{ => core}/keyboard.c (100%) rename app/src/main/cpp/{ => core}/keymacro.c (100%) rename app/src/main/cpp/{ => core}/kml.c (100%) rename app/src/main/cpp/{ => core}/kml.h (100%) rename app/src/main/cpp/{ => core}/lodepng.c (100%) rename app/src/main/cpp/{ => core}/lodepng.h (100%) rename app/src/main/cpp/{ => core}/lowbat.c (100%) rename app/src/main/cpp/{ => core}/mops.c (100%) rename app/src/main/cpp/{ => core}/mru.c (100%) rename app/src/main/cpp/{ => core}/opcodes.c (100%) rename app/src/main/cpp/{ => core}/ops.h (100%) rename app/src/main/cpp/{ => core}/pch.c (100%) rename app/src/main/cpp/{ => core}/pch.h (96%) rename app/src/main/cpp/{ => core}/redeye.c (100%) rename app/src/main/cpp/{ => core}/resource.h (100%) rename app/src/main/cpp/{ => core}/rpl.c (100%) rename app/src/main/cpp/{ => core}/serial.c (100%) rename app/src/main/cpp/{ => core}/settings.c (100%) rename app/src/main/cpp/{ => core}/snddef.h (100%) rename app/src/main/cpp/{ => core}/sndenum.c (100%) rename app/src/main/cpp/{ => core}/sound.c (100%) rename app/src/main/cpp/{ => core}/stack.c (100%) rename app/src/main/cpp/{ => core}/symbfile.c (100%) rename app/src/main/cpp/{ => core}/timer.c (100%) rename app/src/main/cpp/{ => core}/types.h (100%) rename app/src/main/cpp/{ => core}/udp.c (100%) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index a7ed5eb..aa34f38 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -17,41 +17,40 @@ add_library( # Sets the name of the library. SHARED # Provides a relative path to your source file(s). - #src/main/cpp/native-lib.cpp - src/main/cpp/apple.c -# src/main/cpp/cursor.c -# src/main/cpp/ddeserv.c -# src/main/cpp/debugger.c - src/main/cpp/disasm.c - src/main/cpp/dismem.c - src/main/cpp/display.c - src/main/cpp/disrpl.c -# src/main/cpp/Emu48.c #-> To rewrite - src/main/cpp/engine.c - src/main/cpp/external.c - src/main/cpp/fetch.c - src/main/cpp/files.c - src/main/cpp/i28f160.c - src/main/cpp/keyboard.c - src/main/cpp/keymacro.c - src/main/cpp/kml.c - src/main/cpp/lodepng.c - src/main/cpp/lowbat.c - src/main/cpp/mops.c - src/main/cpp/mru.c - src/main/cpp/opcodes.c - src/main/cpp/pch.c -# src/main/cpp/redeye.c - src/main/cpp/rpl.c -# src/main/cpp/serial.c - src/main/cpp/settings.c -# src/main/cpp/sndenum.c -# src/main/cpp/sound.c # -> To rewrite - src/main/cpp/stack.c - src/main/cpp/symbfile.c - src/main/cpp/timer.c -# src/main/cpp/udp.c + src/main/cpp/core/apple.c +# src/main/cpp/core/cursor.c +# src/main/cpp/core/ddeserv.c +# src/main/cpp/core/debugger.c + src/main/cpp/core/disasm.c + src/main/cpp/core/dismem.c + src/main/cpp/core/display.c + src/main/cpp/core/disrpl.c +# src/main/cpp/core/Emu48.c #-> To rewrite + src/main/cpp/core/engine.c + src/main/cpp/core/external.c + src/main/cpp/core/fetch.c + src/main/cpp/core/files.c + src/main/cpp/core/i28f160.c + src/main/cpp/core/keyboard.c + src/main/cpp/core/keymacro.c + src/main/cpp/core/kml.c + src/main/cpp/core/lodepng.c + src/main/cpp/core/lowbat.c + src/main/cpp/core/mops.c + src/main/cpp/core/mru.c + src/main/cpp/core/opcodes.c + src/main/cpp/core/pch.c +# src/main/cpp/core/redeye.c + src/main/cpp/core/rpl.c +# src/main/cpp/core/serial.c + src/main/cpp/core/settings.c +# src/main/cpp/core/sndenum.c +# src/main/cpp/core/sound.c # -> To rewrite + src/main/cpp/core/stack.c + src/main/cpp/core/symbfile.c + src/main/cpp/core/timer.c +# src/main/cpp/core/udp.c src/main/cpp/win32-layer.c src/main/cpp/android-layer.c diff --git a/app/src/main/cpp/android-emu48.c b/app/src/main/cpp/android-emu48.c index 2e41c1f..ac385ee 100644 --- a/app/src/main/cpp/android-emu48.c +++ b/app/src/main/cpp/android-emu48.c @@ -6,12 +6,12 @@ * Copyright (C) 1995 Sebastien Carlier * */ -#include "pch.h" -#include "resource.h" -#include "Emu48.h" -#include "io.h" -#include "kml.h" -#include "debugger.h" +#include "core/pch.h" +#include "core/resource.h" +#include "core/Emu48.h" +#include "core/io.h" +#include "core/kml.h" +#include "core/debugger.h" #include "win32-layer.h" #define VERSION "1.59+" diff --git a/app/src/main/cpp/android-layer.c b/app/src/main/cpp/android-layer.c index 7453872..11b40eb 100644 --- a/app/src/main/cpp/android-layer.c +++ b/app/src/main/cpp/android-layer.c @@ -1,5 +1,5 @@ -#include "pch.h" -#include "Emu48.h" +#include "core/pch.h" +#include "core/Emu48.h" // Redeye.c VOID IrPrinter(BYTE c) { diff --git a/app/src/main/cpp/Emu48.c b/app/src/main/cpp/core/Emu48.c similarity index 100% rename from app/src/main/cpp/Emu48.c rename to app/src/main/cpp/core/Emu48.c diff --git a/app/src/main/cpp/Emu48.h b/app/src/main/cpp/core/Emu48.h similarity index 100% rename from app/src/main/cpp/Emu48.h rename to app/src/main/cpp/core/Emu48.h diff --git a/app/src/main/cpp/Opcodes.h b/app/src/main/cpp/core/Opcodes.h similarity index 100% rename from app/src/main/cpp/Opcodes.h rename to app/src/main/cpp/core/Opcodes.h diff --git a/app/src/main/cpp/apple.c b/app/src/main/cpp/core/apple.c similarity index 100% rename from app/src/main/cpp/apple.c rename to app/src/main/cpp/core/apple.c diff --git a/app/src/main/cpp/apple.h b/app/src/main/cpp/core/apple.h similarity index 100% rename from app/src/main/cpp/apple.h rename to app/src/main/cpp/core/apple.h diff --git a/app/src/main/cpp/color.h b/app/src/main/cpp/core/color.h similarity index 100% rename from app/src/main/cpp/color.h rename to app/src/main/cpp/core/color.h diff --git a/app/src/main/cpp/cursor.c b/app/src/main/cpp/core/cursor.c similarity index 100% rename from app/src/main/cpp/cursor.c rename to app/src/main/cpp/core/cursor.c diff --git a/app/src/main/cpp/ddeserv.c b/app/src/main/cpp/core/ddeserv.c similarity index 100% rename from app/src/main/cpp/ddeserv.c rename to app/src/main/cpp/core/ddeserv.c diff --git a/app/src/main/cpp/debugdll.c b/app/src/main/cpp/core/debugdll.c similarity index 100% rename from app/src/main/cpp/debugdll.c rename to app/src/main/cpp/core/debugdll.c diff --git a/app/src/main/cpp/debugger.c b/app/src/main/cpp/core/debugger.c similarity index 100% rename from app/src/main/cpp/debugger.c rename to app/src/main/cpp/core/debugger.c diff --git a/app/src/main/cpp/debugger.h b/app/src/main/cpp/core/debugger.h similarity index 100% rename from app/src/main/cpp/debugger.h rename to app/src/main/cpp/core/debugger.h diff --git a/app/src/main/cpp/disasm.c b/app/src/main/cpp/core/disasm.c similarity index 100% rename from app/src/main/cpp/disasm.c rename to app/src/main/cpp/core/disasm.c diff --git a/app/src/main/cpp/dismem.c b/app/src/main/cpp/core/dismem.c similarity index 100% rename from app/src/main/cpp/dismem.c rename to app/src/main/cpp/core/dismem.c diff --git a/app/src/main/cpp/display.c b/app/src/main/cpp/core/display.c similarity index 100% rename from app/src/main/cpp/display.c rename to app/src/main/cpp/core/display.c diff --git a/app/src/main/cpp/disrpl.c b/app/src/main/cpp/core/disrpl.c similarity index 100% rename from app/src/main/cpp/disrpl.c rename to app/src/main/cpp/core/disrpl.c diff --git a/app/src/main/cpp/disrpl.h b/app/src/main/cpp/core/disrpl.h similarity index 100% rename from app/src/main/cpp/disrpl.h rename to app/src/main/cpp/core/disrpl.h diff --git a/app/src/main/cpp/emu48dll.c b/app/src/main/cpp/core/emu48dll.c similarity index 100% rename from app/src/main/cpp/emu48dll.c rename to app/src/main/cpp/core/emu48dll.c diff --git a/app/src/main/cpp/emu48dll.h b/app/src/main/cpp/core/emu48dll.h similarity index 100% rename from app/src/main/cpp/emu48dll.h rename to app/src/main/cpp/core/emu48dll.h diff --git a/app/src/main/cpp/engine.c b/app/src/main/cpp/core/engine.c similarity index 100% rename from app/src/main/cpp/engine.c rename to app/src/main/cpp/core/engine.c diff --git a/app/src/main/cpp/external.c b/app/src/main/cpp/core/external.c similarity index 100% rename from app/src/main/cpp/external.c rename to app/src/main/cpp/core/external.c diff --git a/app/src/main/cpp/fetch.c b/app/src/main/cpp/core/fetch.c similarity index 100% rename from app/src/main/cpp/fetch.c rename to app/src/main/cpp/core/fetch.c diff --git a/app/src/main/cpp/files.c b/app/src/main/cpp/core/files.c similarity index 100% rename from app/src/main/cpp/files.c rename to app/src/main/cpp/core/files.c diff --git a/app/src/main/cpp/i28f160.c b/app/src/main/cpp/core/i28f160.c similarity index 100% rename from app/src/main/cpp/i28f160.c rename to app/src/main/cpp/core/i28f160.c diff --git a/app/src/main/cpp/i28f160.h b/app/src/main/cpp/core/i28f160.h similarity index 100% rename from app/src/main/cpp/i28f160.h rename to app/src/main/cpp/core/i28f160.h diff --git a/app/src/main/cpp/io.h b/app/src/main/cpp/core/io.h similarity index 100% rename from app/src/main/cpp/io.h rename to app/src/main/cpp/core/io.h diff --git a/app/src/main/cpp/keyboard.c b/app/src/main/cpp/core/keyboard.c similarity index 100% rename from app/src/main/cpp/keyboard.c rename to app/src/main/cpp/core/keyboard.c diff --git a/app/src/main/cpp/keymacro.c b/app/src/main/cpp/core/keymacro.c similarity index 100% rename from app/src/main/cpp/keymacro.c rename to app/src/main/cpp/core/keymacro.c diff --git a/app/src/main/cpp/kml.c b/app/src/main/cpp/core/kml.c similarity index 100% rename from app/src/main/cpp/kml.c rename to app/src/main/cpp/core/kml.c diff --git a/app/src/main/cpp/kml.h b/app/src/main/cpp/core/kml.h similarity index 100% rename from app/src/main/cpp/kml.h rename to app/src/main/cpp/core/kml.h diff --git a/app/src/main/cpp/lodepng.c b/app/src/main/cpp/core/lodepng.c similarity index 100% rename from app/src/main/cpp/lodepng.c rename to app/src/main/cpp/core/lodepng.c diff --git a/app/src/main/cpp/lodepng.h b/app/src/main/cpp/core/lodepng.h similarity index 100% rename from app/src/main/cpp/lodepng.h rename to app/src/main/cpp/core/lodepng.h diff --git a/app/src/main/cpp/lowbat.c b/app/src/main/cpp/core/lowbat.c similarity index 100% rename from app/src/main/cpp/lowbat.c rename to app/src/main/cpp/core/lowbat.c diff --git a/app/src/main/cpp/mops.c b/app/src/main/cpp/core/mops.c similarity index 100% rename from app/src/main/cpp/mops.c rename to app/src/main/cpp/core/mops.c diff --git a/app/src/main/cpp/mru.c b/app/src/main/cpp/core/mru.c similarity index 100% rename from app/src/main/cpp/mru.c rename to app/src/main/cpp/core/mru.c diff --git a/app/src/main/cpp/opcodes.c b/app/src/main/cpp/core/opcodes.c similarity index 100% rename from app/src/main/cpp/opcodes.c rename to app/src/main/cpp/core/opcodes.c diff --git a/app/src/main/cpp/ops.h b/app/src/main/cpp/core/ops.h similarity index 100% rename from app/src/main/cpp/ops.h rename to app/src/main/cpp/core/ops.h diff --git a/app/src/main/cpp/pch.c b/app/src/main/cpp/core/pch.c similarity index 100% rename from app/src/main/cpp/pch.c rename to app/src/main/cpp/core/pch.c diff --git a/app/src/main/cpp/pch.h b/app/src/main/cpp/core/pch.h similarity index 96% rename from app/src/main/cpp/pch.h rename to app/src/main/cpp/core/pch.h index 615f9b9..340096a 100644 --- a/app/src/main/cpp/pch.h +++ b/app/src/main/cpp/core/pch.h @@ -24,7 +24,7 @@ //#include //#include -#include "win32-layer.h" +#include "../win32-layer.h" #include #define LOG_TAG "NDK_NativeEmu48" #define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) diff --git a/app/src/main/cpp/redeye.c b/app/src/main/cpp/core/redeye.c similarity index 100% rename from app/src/main/cpp/redeye.c rename to app/src/main/cpp/core/redeye.c diff --git a/app/src/main/cpp/resource.h b/app/src/main/cpp/core/resource.h similarity index 100% rename from app/src/main/cpp/resource.h rename to app/src/main/cpp/core/resource.h diff --git a/app/src/main/cpp/rpl.c b/app/src/main/cpp/core/rpl.c similarity index 100% rename from app/src/main/cpp/rpl.c rename to app/src/main/cpp/core/rpl.c diff --git a/app/src/main/cpp/serial.c b/app/src/main/cpp/core/serial.c similarity index 100% rename from app/src/main/cpp/serial.c rename to app/src/main/cpp/core/serial.c diff --git a/app/src/main/cpp/settings.c b/app/src/main/cpp/core/settings.c similarity index 100% rename from app/src/main/cpp/settings.c rename to app/src/main/cpp/core/settings.c diff --git a/app/src/main/cpp/snddef.h b/app/src/main/cpp/core/snddef.h similarity index 100% rename from app/src/main/cpp/snddef.h rename to app/src/main/cpp/core/snddef.h diff --git a/app/src/main/cpp/sndenum.c b/app/src/main/cpp/core/sndenum.c similarity index 100% rename from app/src/main/cpp/sndenum.c rename to app/src/main/cpp/core/sndenum.c diff --git a/app/src/main/cpp/sound.c b/app/src/main/cpp/core/sound.c similarity index 100% rename from app/src/main/cpp/sound.c rename to app/src/main/cpp/core/sound.c diff --git a/app/src/main/cpp/stack.c b/app/src/main/cpp/core/stack.c similarity index 100% rename from app/src/main/cpp/stack.c rename to app/src/main/cpp/core/stack.c diff --git a/app/src/main/cpp/symbfile.c b/app/src/main/cpp/core/symbfile.c similarity index 100% rename from app/src/main/cpp/symbfile.c rename to app/src/main/cpp/core/symbfile.c diff --git a/app/src/main/cpp/timer.c b/app/src/main/cpp/core/timer.c similarity index 100% rename from app/src/main/cpp/timer.c rename to app/src/main/cpp/core/timer.c diff --git a/app/src/main/cpp/types.h b/app/src/main/cpp/core/types.h similarity index 100% rename from app/src/main/cpp/types.h rename to app/src/main/cpp/core/types.h diff --git a/app/src/main/cpp/udp.c b/app/src/main/cpp/core/udp.c similarity index 100% rename from app/src/main/cpp/udp.c rename to app/src/main/cpp/core/udp.c diff --git a/app/src/main/cpp/emu48-jni.c b/app/src/main/cpp/emu48-jni.c index 266826b..874ef24 100644 --- a/app/src/main/cpp/emu48-jni.c +++ b/app/src/main/cpp/emu48-jni.c @@ -7,7 +7,7 @@ #include #include -#include "pch.h" +#include "core/pch.h" extern void emu48Start(); extern AAssetManager * assetManager; diff --git a/app/src/main/cpp/win32-layer.c b/app/src/main/cpp/win32-layer.c index a7c4c92..e5c8d81 100644 --- a/app/src/main/cpp/win32-layer.c +++ b/app/src/main/cpp/win32-layer.c @@ -1,11 +1,11 @@ -#include "pch.h" +#include "core/pch.h" #include #include #include #include #include #include -#include "resource.h" +#include "core/resource.h" #include "win32-layer.h" extern JavaVM *java_machine; diff --git a/app/src/main/java/com/regis/cosnier/emu48/MainScreenView.java b/app/src/main/java/com/regis/cosnier/emu48/MainScreenView.java index 21f1c08..f8eb982 100644 --- a/app/src/main/java/com/regis/cosnier/emu48/MainScreenView.java +++ b/app/src/main/java/com/regis/cosnier/emu48/MainScreenView.java @@ -3,6 +3,7 @@ package com.regis.cosnier.emu48; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; +import android.content.Intent; import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.Canvas; @@ -242,6 +243,7 @@ public class MainScreenView extends SurfaceView { final int CALLBACK_TYPE_GETOPENFILENAME = 2; final int CALLBACK_TYPE_GETSAVEFILENAME = 3; + final int INTENT_GETSAVEFILENAME = 1; int updateCallback(int type, int param1, int param2, String param3, String param4) { switch (type) { case CALLBACK_TYPE_INVALIDATE: @@ -255,6 +257,11 @@ public class MainScreenView extends SurfaceView { case CALLBACK_TYPE_GETOPENFILENAME: break; case CALLBACK_TYPE_GETSAVEFILENAME: + Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + intent.setType("YOUR FILETYPE"); //not needed, but maybe usefull + intent.putExtra(Intent.EXTRA_TITLE, "YOUR FILENAME"); //not needed, but maybe usefull + ((Activity)getContext()).startActivityForResult(intent, INTENT_GETSAVEFILENAME); break; } return -1;