Put back Serial slowdown setting.

This commit is contained in:
dgis 2024-06-10 08:27:31 +02:00
parent 59a4f70cff
commit 8a8f2d8ce7
10 changed files with 42 additions and 36 deletions

View file

@ -17,7 +17,7 @@ QUICK START
1. From the left side, slide your finger to open the menu. 1. From the left side, slide your finger to open the menu.
2. Touch the "New..." menu item. 2. Touch the "New..." menu item.
3. Select a default calculator (or with Android >= 5.0, "[Select a Custom KML script folder...]" where you have copied the KML scripts and ROM files (Android 11 cannot use the folder Download)). 3. Select a default calculator (or "[Select a Custom KML script folder...]" where you have copied the KML scripts and ROM files (Android 11 may not be able to use the Download folder)).
4. And the calculator should now be opened. 4. And the calculator should now be opened.
@ -37,7 +37,7 @@ NOTES
without the need to be root. If it is not automatic, please, activate the OTG mode in your Android device, and then, without the need to be root. If it is not automatic, please, activate the OTG mode in your Android device, and then,
you should be able to see it in the Emu48 settings. you should be able to see it in the Emu48 settings.
It is still experimental and I see some issues when sending characters from the emulator to a real HP48 or HP49 with the kermit protocol. It is still experimental and I see some issues when sending characters from the emulator to a real HP48 or HP49 with the kermit protocol.
For the moment, the communication has been artificially slowed down in this direction. The communication can be artificially slowed down in this direction using an option.
If the adapter is unplugged then plugged back in, you may need to call OPENIO/CLOSEIO. If the adapter is unplugged then plugged back in, you may need to call OPENIO/CLOSEIO.
@ -58,12 +58,14 @@ LINKS
CHANGES CHANGES
Version 2.7 (2023-07-XX) Version 2.7 (2024-06-XX)
- Updated source code with Emu48 version 1.65+. This new version improve the serial communication. - Updated source code with Emu48 version 1.65+. This new version improve the serial communication.
- Attempt to fix haptic feedback with Android 13 (API deprecation). - Attempt to fix haptic feedback with Android 13 (API deprecation).
- Patch the ROM files to prevent the calculator to sleep (Fix #22). - Patch the ROM files to prevent the calculator to sleep (Fix #22).
- Fix a potential crash about the permission to access the files. - Fix a potential crash about the permission to access the files.
- Require at least Android 5.0 (4.4 previously).
BUG: In Emu48 with HP49 FlashCard, click on Android RECENT button, and comes back in the APP -> we lost the FlashCard!
Version 2.6 (2022-08-19) Version 2.6 (2022-08-19)

View file

@ -29,11 +29,11 @@ if (keystorePropertiesFile.exists()) {
android { android {
namespace 'org.emulator.forty.eight' namespace 'org.emulator.forty.eight'
compileSdk 33 compileSdk 34
defaultConfig { defaultConfig {
applicationId "org.emulator.forty.eight" applicationId "org.emulator.forty.eight"
minSdk 19 minSdk 21
targetSdk 33 //targetSdk 33
versionCode 26 versionCode 26
versionName "2.7" versionName "2.7"
setProperty("archivesBaseName", "Emu48-v$versionName") setProperty("archivesBaseName", "Emu48-v$versionName")
@ -79,10 +79,10 @@ android {
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.9.0' implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.preference:preference:1.2.0' implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.documentfile:documentfile:1.0.1'
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.5.2' androidTestImplementation 'androidx.test:runner:1.5.2'

View file

@ -17,7 +17,7 @@ QUICK START
1. From the left side, slide your finger to open the menu. 1. From the left side, slide your finger to open the menu.
2. Touch the "New..." menu item. 2. Touch the "New..." menu item.
3. Select a default calculator (or with Android >= 5.0, "[Select a Custom KML script folder...]" where you have copied the KML scripts and ROM files (Android 11 cannot use the folder Download)). 3. Select a default calculator (or "[Select a Custom KML script folder...]" where you have copied the KML scripts and ROM files (Android 11 may not be able to use the Download folder)).
4. And the calculator should now be opened. 4. And the calculator should now be opened.
@ -37,7 +37,7 @@ NOTES
without the need to be root. If it is not automatic, please, activate the OTG mode in your Android device, and then, without the need to be root. If it is not automatic, please, activate the OTG mode in your Android device, and then,
you should be able to see it in the Emu48 settings. you should be able to see it in the Emu48 settings.
It is still experimental and I see some issues when sending characters from the emulator to a real HP48 or HP49 with the kermit protocol. It is still experimental and I see some issues when sending characters from the emulator to a real HP48 or HP49 with the kermit protocol.
For the moment, the communication has been artificially slowed down in this direction. The communication can be artificially slowed down in this direction using an option.
If the adapter is unplugged then plugged back in, you may need to call OPENIO/CLOSEIO. If the adapter is unplugged then plugged back in, you may need to call OPENIO/CLOSEIO.
@ -58,12 +58,13 @@ LINKS
CHANGES CHANGES
Version 2.7 (2023-07-XX) Version 2.7 (2024-06-09)
- Updated source code with Emu48 version 1.65+. This new version improve the serial communication. - Updated source code with Emu48 version 1.65+. This new version improve the serial communication.
- Attempt to fix haptic feedback with Android 13 (API deprecation). - Attempt to fix haptic feedback with Android 13 (API deprecation).
- Patch the ROM files to prevent the calculator to sleep (Fix #22). - Patch the ROM files to prevent the calculator to sleep (Fix #22).
- Fix a potential crash about the permission to access the files. - Fix a potential crash about the permission to access the files.
- Require at least Android 5.0 (4.4 previously).
Version 2.6 (2022-08-19) Version 2.6 (2022-08-19)

View file

@ -342,7 +342,7 @@ BOOL WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,LPDWO
free(hexAsciiDump); free(hexAsciiDump);
#endif #endif
if(serialPortSlowDown) if(serialPortSlowDown)
Sleep(4); // Seems to be needed else the kermit packet does not fully reach the genuine calculator. Sleep(4); // Seems to be needed else kermit/XSend packets do not fully reach the genuine calculator.
if(lpNumberOfBytesWritten) if(lpNumberOfBytesWritten)
*lpNumberOfBytesWritten = (DWORD) writenByteCount; *lpNumberOfBytesWritten = (DWORD) writenByteCount;
return writenByteCount >= 0; return writenByteCount >= 0;

View file

@ -306,7 +306,7 @@ public class PanAndScaleView extends View {
public boolean onDown(MotionEvent e) { public boolean onDown(MotionEvent e) {
if(debug) Log.d(TAG, "onDown() actionIndex: " + e.getActionIndex() + ", X: " + e.getX() + ", Y: " + e.getY()); if(debug) Log.d(TAG, "onDown() actionIndex: " + e.getActionIndex() + ", X: " + e.getX() + ", Y: " + e.getY());
scroller.forceFinished(true); scroller.forceFinished(true);
ViewCompat.postInvalidateOnAnimation(PanAndScaleView.this); PanAndScaleView.this.postInvalidateOnAnimation();
if(onTapDownListener != null) { if(onTapDownListener != null) {
float scaleAndPanX = (e.getX() - viewPanOffsetX) / viewScaleFactorX; float scaleAndPanX = (e.getX() - viewPanOffsetX) / viewScaleFactorX;
float scaleAndPanY = (e.getY() - viewPanOffsetY) / viewScaleFactorY; float scaleAndPanY = (e.getY() - viewPanOffsetY) / viewScaleFactorY;
@ -386,7 +386,7 @@ public class PanAndScaleView extends View {
(int)(velocityFactor * velocityX), (int)(velocityFactor * velocityY), (int)(velocityFactor * velocityX), (int)(velocityFactor * velocityY),
0, -(int)viewPanMinX, 0, -(int)viewPanMinX,
0, -(int)viewPanMinY); 0, -(int)viewPanMinY);
ViewCompat.postInvalidateOnAnimation(PanAndScaleView.this); PanAndScaleView.this.postInvalidateOnAnimation();
return true; return true;
} }
}); });

View file

@ -20,6 +20,7 @@ import org.emulator.calculator.usbserial.driver.UsbSerialProber;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Locale; import java.util.Locale;
import java.util.Objects;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -43,14 +44,14 @@ public class DevicesFragment extends ListFragment {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setHasOptionsMenu(true); //setHasOptionsMenu(true);
listAdapter = new ArrayAdapter<ListItem>(getActivity(), 0, listItems) { listAdapter = new ArrayAdapter<ListItem>(requireActivity(), 0, listItems) {
@NonNull @NonNull
@Override @Override
public View getView(int position, View view, @NonNull ViewGroup parent) { public View getView(int position, View view, @NonNull ViewGroup parent) {
ListItem item = listItems.get(position); ListItem item = listItems.get(position);
if (view == null) if (view == null)
view = getActivity().getLayoutInflater().inflate(Utils.resId(DevicesFragment.this, "layout", "device_list_item"), parent, false); view = requireActivity().getLayoutInflater().inflate(Utils.resId(DevicesFragment.this, "layout", "device_list_item"), parent, false);
TextView text1 = view.findViewById(Utils.resId(DevicesFragment.this, "id", "text1")); TextView text1 = view.findViewById(Utils.resId(DevicesFragment.this, "id", "text1"));
TextView text2 = view.findViewById(Utils.resId(DevicesFragment.this, "id", "text2")); TextView text2 = view.findViewById(Utils.resId(DevicesFragment.this, "id", "text2"));
if(item.driver == null) if(item.driver == null)
@ -73,7 +74,7 @@ public class DevicesFragment extends ListFragment {
public void onActivityCreated(Bundle savedInstanceState) { public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
setListAdapter(null); setListAdapter(null);
View header = getActivity().getLayoutInflater().inflate(Utils.resId(DevicesFragment.this, "layout", "device_list_header"), null, false); View header = requireActivity().getLayoutInflater().inflate(Utils.resId(DevicesFragment.this, "layout", "device_list_header"), null, false);
getListView().addHeaderView(header, null, false); getListView().addHeaderView(header, null, false);
setEmptyText(getString(Utils.resId(this, "string", "serial_no_device"))); setEmptyText(getString(Utils.resId(this, "string", "serial_no_device")));
((TextView) getListView().getEmptyView()).setTextSize(18); ((TextView) getListView().getEmptyView()).setTextSize(18);

View file

@ -188,11 +188,11 @@
android:title="@string/settings_serial_ports_ir_title" android:title="@string/settings_serial_ports_ir_title"
android:summary="" android:summary=""
/> />
<!-- <SwitchPreference--> <SwitchPreference
<!-- android:defaultValue="false"--> android:defaultValue="false"
<!-- android:key="settings_serial_slowdown"--> android:key="settings_serial_slowdown"
<!-- android:title="@string/settings_serial_slowdown"--> android:title="@string/settings_serial_slowdown"
<!-- />--> />
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View file

@ -4,10 +4,10 @@ buildscript {
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:8.0.2' classpath 'com.android.tools.build:gradle:8.3.2'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
@ -18,14 +18,16 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
tasks.withType(JavaCompile) { tasks.withType(JavaCompile).tap {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" configureEach {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
} }
} }
task clean(type: Delete) { //task clean(type: Delete) {
delete rootProject.buildDir // delete rootProject.buildDir
} //}

View file

@ -6,10 +6,10 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html # http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
android.defaults.buildfeatures.buildconfig=true #android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=true android.enableJetifier=true
android.nonFinalResIds=false android.nonFinalResIds=true
android.nonTransitiveRClass=false android.nonTransitiveRClass=true
android.useAndroidX=true android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m org.gradle.jvmargs=-Xmx1536m
org.gradle.unsafe.configuration-cache=true org.gradle.unsafe.configuration-cache=true

View file

@ -1,6 +1,6 @@
#Sat Jan 28 21:16:38 CET 2023 #Sat Jan 28 21:16:38 CET 2023
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME