mirror of
https://github.com/dgis/emu48android
synced 2024-12-26 09:58:49 +01:00
Version 2.0 (2020-11-15)
This commit is contained in:
parent
3427c62a89
commit
23184e86d2
7 changed files with 234 additions and 232 deletions
10
ReadMe.txt
10
ReadMe.txt
|
@ -63,7 +63,7 @@ LINKS
|
|||
|
||||
CHANGES
|
||||
|
||||
Version 2.0 (2020-11-XX)
|
||||
Version 2.0 (2020-11-15)
|
||||
|
||||
- Updated source code from Eric Rechlin's Emu48 version 1.62+ that was merged from Christoph Gießelink's Emu48 version 1.63.
|
||||
- For the HP49/50 port 2, it is now possible to load a new Flash ROM file (It fully replaces the ROM).
|
||||
|
@ -72,6 +72,7 @@ Version 2.0 (2020-11-XX)
|
|||
- Fix a printer issue from Christoph Gießelink's HP82240B Printer Simulator version 1.12.
|
||||
- Fix the KML button Type 3 with a Background offset which was not display at the right location (Fix #15).
|
||||
- Fix a timer issue.
|
||||
- Fix a freeze with a hp48 sx or gx, when switching on/off several times port 1 and 2!
|
||||
|
||||
|
||||
Version 1.9 (2020-09-07)
|
||||
|
@ -219,21 +220,18 @@ TODO
|
|||
|
||||
- Manage the HP 48 port 2 with the same kind of interface for the memory card.
|
||||
- The render pixels are very nice. A solution to obtain uniform pixel size could be a preset (a multiplier, auto) so the user could decide and upscale/downscale (Michael P).
|
||||
- Bug: In Xiaomi mi A3 under Android10, the haptic feedback does not work (add an intensity setting).
|
||||
- Somehow LEFT (Shift on the keyboard) + 7 activates the DIVIDE-key (z-Key)..., but with the NUM-Key it can make it work without problems...
|
||||
I think it might have something to do with the "/" sign on the Shifted-7-key.
|
||||
- The clock seems unsynchronized sometimes (Michael P).
|
||||
- Retain a key by right clicking if it is from a mouse.
|
||||
- Add the possibility to load and save the flash in another file.
|
||||
- Sometimes, the calculator seems to lag and finally freeze.
|
||||
- In Chrome OS:
|
||||
- sometimes there is no OK button in the KML Script Compilation Result.
|
||||
- In Chrome OS, sometimes there is no OK button in the KML Script Compilation Result.
|
||||
- Add KML script loading dependencies fallback to the inner ROM (and may be KML include?).
|
||||
|
||||
|
||||
BUILD
|
||||
|
||||
Emu48 for Android is built with Android Studio 4.0 (2020).
|
||||
Emu48 for Android is built with Android Studio 4.1 (2020).
|
||||
And to generate an installable APK file with a real Android device, it MUST be signed.
|
||||
|
||||
Either use Android Studio:
|
||||
|
|
|
@ -63,7 +63,7 @@ LINKS
|
|||
|
||||
CHANGES
|
||||
|
||||
Version 2.0 (2020-11-XX)
|
||||
Version 2.0 (2020-11-15)
|
||||
|
||||
- Updated source code from Eric Rechlin's Emu48 version 1.62+ that was merged from Christoph Gießelink's Emu48 version 1.63.
|
||||
- For the HP49/50 port 2, it is now possible to load a new Flash ROM file (It fully replaces the ROM).
|
||||
|
@ -72,6 +72,7 @@ Version 2.0 (2020-11-XX)
|
|||
- Fix a printer issue from Christoph Gießelink's HP82240B Printer Simulator version 1.12.
|
||||
- Fix the KML button Type 3 with a Background offset which was not display at the right location (Fix #15).
|
||||
- Fix a timer issue.
|
||||
- Fix a freeze with a hp48 sx or gx, when switching on/off several times port 1 and 2!
|
||||
|
||||
|
||||
Version 1.9 (2020-09-07)
|
||||
|
|
|
@ -1047,6 +1047,8 @@ JNIEXPORT void JNICALL Java_org_emulator_calculator_NativeLib_setConfiguration(J
|
|||
const char *configKey = (*env)->GetStringUTFChars(env, key, NULL) ;
|
||||
const char *configStringValue = stringValue ? (*env)->GetStringUTFChars(env, stringValue, NULL) : NULL;
|
||||
|
||||
//LOGE("NativeLib_setConfiguration(%s, %d, %d, %s)", configKey, intValue1, intValue2, configStringValue);
|
||||
|
||||
bAutoSave = FALSE;
|
||||
bAutoSaveOnExit = FALSE;
|
||||
bLoadObjectWarning = FALSE;
|
||||
|
@ -1081,6 +1083,8 @@ JNIEXPORT void JNICALL Java_org_emulator_calculator_NativeLib_setConfiguration(J
|
|||
if (Chipset.Port1Size && (cCurrentRomType!='X' || cCurrentRomType!='2' || cCurrentRomType!='Q')) // CdB for HP: add apples
|
||||
{
|
||||
UINT nOldState = SwitchToState(SM_SLEEP);
|
||||
//LOGE("NativeLib_setConfiguration port1 start SwitchToState %d -> SM_SLEEP", nOldState);
|
||||
|
||||
// save old card status
|
||||
BYTE byCardsStatus = Chipset.cards_status;
|
||||
|
||||
|
@ -1103,7 +1107,9 @@ JNIEXPORT void JNICALL Java_org_emulator_calculator_NativeLib_setConfiguration(J
|
|||
Chipset.SoftInt = TRUE; // set interrupt
|
||||
bInterrupt = TRUE;
|
||||
}
|
||||
//LOGE("NativeLib_setConfiguration port1 end SwitchToState %d", nOldState);
|
||||
SwitchToState(nOldState);
|
||||
while (nState!=nNextState) Sleep(0);
|
||||
}
|
||||
} else if(_tcscmp(_T("settings_port2"), configKey) == 0) {
|
||||
settingsPort2en = (BOOL)intValue1;
|
||||
|
@ -1139,6 +1145,7 @@ JNIEXPORT void JNICALL Java_org_emulator_calculator_NativeLib_setConfiguration(J
|
|||
if (bPort2CfgChange) // slot2 configuration changed
|
||||
{
|
||||
UINT nOldState = SwitchToState(SM_INVALID);
|
||||
//LOGE("NativeLib_setConfiguration port2 start SwitchToState %d -> SM_INVALID", nOldState);
|
||||
|
||||
UnmapPort2(); // unmap port2
|
||||
|
||||
|
@ -1159,6 +1166,7 @@ JNIEXPORT void JNICALL Java_org_emulator_calculator_NativeLib_setConfiguration(J
|
|||
// save fingerprint of port2
|
||||
Chipset.wPort2Crc = wPort2Crc;
|
||||
}
|
||||
//LOGE("NativeLib_setConfiguration port2 end SwitchToState %d", nOldState);
|
||||
SwitchToState(nOldState);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -612,8 +612,19 @@ DWORD ResumeThread(HANDLE hThread) {
|
|||
|
||||
BOOL SetThreadPriority(HANDLE hThread, int nPriority) {
|
||||
THREAD_LOGD("SetThreadPriority()");
|
||||
//TODO
|
||||
return 0;
|
||||
// if(hThread->handleType == HANDLE_TYPE_THREAD) {
|
||||
// int policy;
|
||||
// struct sched_param param;
|
||||
// int result = pthread_getschedparam(hThread->threadId, &policy, ¶m);
|
||||
// if(nPriority == THREAD_PRIORITY_HIGHEST) {
|
||||
// param.sched_priority = sched_get_priority_min(policy);
|
||||
// param.sched_priority = sched_get_priority_max(policy);
|
||||
// }
|
||||
// result = pthread_setschedparam(hThread->threadId, policy, ¶m);
|
||||
// // THIS DOES NOT WORK WITH ANDROID!
|
||||
// return TRUE;
|
||||
// }
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -733,13 +744,18 @@ BOOL WINAPI CloseHandle(HANDLE hObject) {
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void Sleep(int ms)
|
||||
{
|
||||
void Sleep(int ms) {
|
||||
if(ms == 0) {
|
||||
// Because sched_yield() does not seem to work with Android, try to increase the pause duration,
|
||||
// hoping to switch to the others thread (WorkerThread).
|
||||
ms = 1;
|
||||
}
|
||||
sched_yield();
|
||||
time_t seconds = ms / 1000;
|
||||
long milliseconds = ms - 1000 * seconds;
|
||||
struct timespec timeOut, remains;
|
||||
timeOut.tv_sec = seconds;
|
||||
timeOut.tv_nsec = milliseconds * 1000000; /* 50 milliseconds */
|
||||
timeOut.tv_nsec = milliseconds * 1000000;
|
||||
nanosleep(&timeOut, &remains);
|
||||
}
|
||||
|
||||
|
|
|
@ -350,6 +350,8 @@ public class SettingsFragment extends AppCompatDialogFragment {
|
|||
|
||||
Preference preferenceFlashPort2 = findPreference("settings_flash_port2");
|
||||
if(preferenceFlashPort2 != null) {
|
||||
int cCurrentRomType = NativeLib.getCurrentModel();
|
||||
if(cCurrentRomType == 'X' || cCurrentRomType == 'Q') {
|
||||
String flashPort2Filename = settings.getString(preferenceFlashPort2.getKey(), "");
|
||||
String displayName = flashPort2Filename;
|
||||
try {
|
||||
|
@ -359,16 +361,16 @@ public class SettingsFragment extends AppCompatDialogFragment {
|
|||
}
|
||||
preferenceFlashPort2.setSummary(displayName);
|
||||
//TODO offer the possibility to manage the Flash from here too.
|
||||
// preferenceFlashPort2.setOnPreferenceClickListener(preference -> {
|
||||
// Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
||||
// intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
// intent.setType("*/*");
|
||||
// intent.putExtra(Intent.EXTRA_TITLE, "shared.bin");
|
||||
// Fragment parentFragment = getParentFragment();
|
||||
// if (parentFragment != null)
|
||||
// parentFragment.startActivityForResult(intent, MainActivity.INTENT_PORT2LOAD);
|
||||
// return true;
|
||||
// });
|
||||
preferenceFlashPort2.setOnPreferenceClickListener(preference -> {
|
||||
new AlertDialog.Builder(requireContext())
|
||||
.setTitle(getString(R.string.settings_flash_port2_title))
|
||||
.setMessage(getString(R.string.settings_flash_port2_dialog_description))
|
||||
.setPositiveButton(android.R.string.ok, (dialog1, which1) -> {
|
||||
}).show();
|
||||
return true;
|
||||
});
|
||||
} else
|
||||
preferenceFlashPort2.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<string name="nav_change_kml_script">Change KML Script...</string>
|
||||
<string name="nav_show_printer">Show the Printer Simulator...</string>
|
||||
<string name="nav_tool">Tool</string>
|
||||
<string name="nav_create_ram_card">Create RAM Card...</string>
|
||||
<string name="nav_create_ram_card">Create RAM Card (HP48)...</string>
|
||||
<string name="nav_manage_flash_rom">Manage Flash ROM (HP49)...</string>
|
||||
<string name="nav_macro_record">Record Macro...</string>
|
||||
<string name="nav_macro_play">Play Macro...</string>
|
||||
|
@ -175,13 +175,15 @@
|
|||
<string name="settings_background_custom_color_title">Custom color</string>
|
||||
<string name="settings_background_custom_color_summary">Used when selecting the \'Custom color\' in the \'Other possible colors\'</string>
|
||||
|
||||
<string name="settings_category_memory_cards_title">Memory Cards</string>
|
||||
<string name="settings_category_memory_cards_hp48_title">Memory Cards HP48</string>
|
||||
<string name="settings_port1en_title">Port 1 is Plugged</string>
|
||||
<string name="settings_port1wr_title">Port 1 is Writable</string>
|
||||
<string name="settings_port2en_title">Port 2 is Plugged</string>
|
||||
<string name="settings_port2wr_title">Port 2 is Writable</string>
|
||||
<string name="settings_port2load_title">Port 2 File</string>
|
||||
<string name="settings_category_memory_cards_hp49_title">Memory Cards HP49/50</string>
|
||||
<string name="settings_flash_port2_title">Port 2 Flash File</string>
|
||||
<string name="settings_flash_port2_dialog_description">This file can be set from the main menu item "Manage Flash ROM (HP49)...".</string>
|
||||
|
||||
<string name="settings_category_printer_title">Printer Simulator</string>
|
||||
<string name="settings_printer_model_title">Printer Model</string>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<!-- General -->
|
||||
<PreferenceCategory android:title="@string/settings_category_general_title">
|
||||
<SwitchPreference
|
||||
android:key="settings_realspeed"
|
||||
|
@ -127,7 +126,6 @@
|
|||
/>
|
||||
</PreferenceCategory>
|
||||
|
||||
|
||||
<PreferenceCategory android:title="@string/settings_category_macro_title">
|
||||
<SwitchPreference
|
||||
android:key="settings_macro_real_speed"
|
||||
|
@ -142,13 +140,7 @@
|
|||
app:showSeekBarValue="true" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<!--<PreferenceCategory app:title="Disassembler">
|
||||
"HP Mnemonics",IDC_DISASM_HP
|
||||
"Class Mnemonics",IDC_DISASM_CLASS
|
||||
</PreferenceCategory>-->
|
||||
|
||||
<!-- Memory -->
|
||||
<PreferenceCategory android:title="@string/settings_category_memory_cards_title">
|
||||
<PreferenceCategory android:title="@string/settings_category_memory_cards_hp48_title">
|
||||
<SwitchPreference
|
||||
android:key="settings_port1en"
|
||||
android:title="@string/settings_port1en_title"
|
||||
|
@ -174,6 +166,9 @@
|
|||
android:title="@string/settings_port2load_title"
|
||||
android:summary=""
|
||||
/>
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/settings_category_memory_cards_hp49_title">
|
||||
<Preference
|
||||
android:key="settings_flash_port2"
|
||||
android:title="@string/settings_flash_port2_title"
|
||||
|
@ -181,24 +176,4 @@
|
|||
/>
|
||||
</PreferenceCategory>
|
||||
|
||||
<!-- Peripheral -->
|
||||
<!--<PreferenceCategory app:title="Sound">-->
|
||||
<!--"Volume",IDC_STATIC,14,21,24,8-->
|
||||
<!--"Slider1",IDC_SOUND_SLIDER,"msctls_trackbar32",-->
|
||||
<!--"Device",IDC_STATIC,13,42,24,8-->
|
||||
<!--COMBOBOX IDC_SOUND_DEVICE,44,40,193,87,CBS_DROPDOWNLIST |-->
|
||||
<!--</PreferenceCategory>-->
|
||||
<!--<PreferenceCategory app:title="Infrared PrinterSimulator">
|
||||
"IP Address:",IDC_STATIC
|
||||
"Port:",IDC_STATIC
|
||||
IDC_IR_ADDR
|
||||
IDC_IR_PORT
|
||||
</PreferenceCategory>-->
|
||||
<!--<PreferenceCategory app:title="Serial Ports">
|
||||
"Wire:",IDC_STATIC
|
||||
COMBOBOX IDC_WIRE
|
||||
"IR:",IDC_STATIC
|
||||
COMBOBOX IDC_IR
|
||||
</PreferenceCategory>-->
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
Loading…
Reference in a new issue