Skip to content

Commit bc8bd5b

Browse files
committed
Version 2.6 (2022-08-19)
- Updated source code from Eric Rechlin's Emu48 version 1.64+ that was merged from Christoph Gießelink's Emu48 version 1.65. This new version improve the serial communication.
1 parent d27d777 commit bc8bd5b

24 files changed

Lines changed: 633 additions & 295 deletions

ReadMe.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ LINKS
5858

5959
CHANGES
6060

61+
Version 2.6 (2022-08-19)
62+
63+
- Updated source code from Eric Rechlin's Emu48 version 1.64+ that was merged from Christoph Gießelink's Emu48 version 1.65. This new version improve the serial communication.
64+
65+
6166
Version 2.5 (2022-03-03)
6267

6368
- Allow to load RLE4, RLE8 and monochrome BMP images.
@@ -262,7 +267,7 @@ TODO
262267

263268
BUILD
264269

265-
Emu48 for Android is built with Android Studio 2020.3.1 (2021).
270+
Emu48 for Android is built with Android Studio 2021.1.1 (2022).
266271
And to generate an installable APK file with a real Android device, it MUST be signed.
267272

268273
Either use Android Studio:

app/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ if (keystorePropertiesFile.exists()) {
2828
}
2929

3030
android {
31-
compileSdkVersion 31
31+
compileSdkVersion 32
3232
defaultConfig {
3333
applicationId "org.emulator.forty.eight"
3434
minSdkVersion 19
35-
targetSdkVersion 31
36-
versionCode 24
37-
versionName "2.5"
35+
targetSdkVersion 32
36+
versionCode 25
37+
versionName "2.6"
3838
setProperty("archivesBaseName", "Emu48-v$versionName")
3939
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4040
externalNativeBuild {
@@ -84,10 +84,10 @@ android {
8484

8585
dependencies {
8686
implementation fileTree(dir: 'libs', include: ['*.jar'])
87-
implementation 'androidx.appcompat:appcompat:1.4.1'
88-
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
87+
implementation 'androidx.appcompat:appcompat:1.4.2'
88+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
8989
implementation 'androidx.preference:preference:1.2.0'
90-
implementation 'com.google.android.material:material:1.5.0'
90+
implementation 'com.google.android.material:material:1.6.1'
9191
implementation 'androidx.documentfile:documentfile:1.0.1'
9292
testImplementation 'junit:junit:4.13.2'
9393
androidTestImplementation 'androidx.test:runner:1.4.0'

app/src/main/assets/Emu48.htm

Lines changed: 97 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
<div id="navi">
3535
<p><a class="nav1" href="#s1">1. General</a></p>
3636
<p><a class="nav1" href="#s2">2. Acknowledgements</a></p>
37-
<p><a class="nav1" href="#s3">3. ROM Images</a></p>
37+
<p><a class="nav1" href="#s3">3. ROM Images</a><br>
38+
<a class="nav2" href="#ss3.1">3.1 Creation examples</a></p>
3839
<p><a class="nav1" href="#s4">4. Installation</a></p>
3940
<p><a class="nav1" href="#s5">5. How to Start</a></p>
4041
<p><a class="nav1" href="#s6">6. Command Line</a></p>
@@ -83,12 +84,11 @@
8384
<a href="#ss12.2">12.2 About Emu48...</a>
8485
</span></p>
8586
<p><a class="nav1" href="#s13">13. DDE Server</a></p>
86-
<p><a class="nav1" href="#s14">14. Emu48+ Changes</a></p>
87-
<p><a class="nav1" href="#s15">15. License</a></p>
87+
<p><a class="nav1" href="#s14">14. License</a></p>
8888
</div>
8989
<div id="main">
9090
<h1><a name=s1>1. General</a></h1>
91-
<p><a href="http://hp.giesselink.com/emu42.htm">Emu48</a> is an
91+
<p><a href="https://hp.giesselink.com/emu48.htm">Emu48</a> is an
9292
emulator for the Hewlett Packard HP38G, HP39G, HP40G, HP48SX, HP48GX
9393
and HP49G calculator hardware. These calculators are based on the
9494
1LT8 Clarke (HP48SX) and on the Yorke chip.</p>
@@ -127,73 +127,97 @@ <h1><a name=s3>3. ROM Images</a></h1>
127127
in the destination file with zeros. Final notice, the convert
128128
utility shows the CRC result after the file convert and a passed
129129
ROM CRC test does <u><b>not</b></u> imply, that the source file
130-
is in an Emu48 suitable format!
130+
is in an Emu48 suitable format! To create a ROM image in a suitable
131+
format, call the convert utility with the 2nd file argument.
131132
</p>
132-
<ul>
133-
<li>HP38
134-
<p>To upload the ROM of your HP38G, you will need a special aplet
135-
called <a href="http://www.hpcalc.org/details.php?id=633">&quot;ROM UPLOAD&quot;</a>.
136-
Once you've uploaded the ROM, you have to convert it using the
137-
Convert utility.</p>
138-
<p>To do that, start a Command Prompt while running Windows, and
139-
type:</p>
140-
<blockquote>Convert &lt;rom-file&gt; ROM.38G</blockquote>
141-
<p>Where &lt;rom-file&gt; is the path to your ROM image. This will
142-
create a file named ROM.38G. This tool will also check its validity.
143-
</p></li>
144-
<li>HP39/40
145-
<p>To upload the ROM of your HP39G/HP40G, you will need a special aplet
146-
called <a href="http://hp.giesselink.com/emu48.htm">&quot;ROM UPLOAD&quot;</a>.
147-
Once you've uploaded the ROM, you have to convert it using the Rom2emu utility.
148-
</p>
149-
<p>To do that, start a Command Prompt while running Windows, and
150-
type:</p>
151-
<blockquote>Rom2emu &lt;rom-file&gt; ROM.39G</blockquote>
152-
<p>There's also a HP39G/HP40G beta ROM for emulators inside an old
153-
<a href="http://www.hpcalc.org/details.php?id=4272">Emu48 package</a>.
154-
</p></li>
155-
<li>HP48
156-
<p>If you have already used another HP48 emulator, you can convert
157-
the ROM using the Convert utility.
158-
</p>
159-
<p>To do that, start a Command Prompt while running Windows, and
160-
type:</p>
161-
<blockquote>Convert &lt;rom-file&gt; ROM.48G</blockquote>
162-
<p>or</p>
163-
<blockquote>Convert &lt;rom-file&gt; ROM.48S</blockquote>
164-
<p>Where &lt;rom-file&gt; is the path to your old ROM image. This
165-
will create a file named ROM.48G or ROM.48S, depending on the version
166-
you own. This tool should be able to read any style of ROM image, and
167-
will also check its validity. Note that if you run it with only one
168-
parameter, no file will be written, but it will still check the
169-
validity of the ROM.</p>
170-
<p>If you have never used an HP48 emulator, and don't have a ROM
171-
dump, you can either use Jean-Yves Avenard's ROMUPL.BIN or the
172-
ROMDump Wizard V1.x, which will almost automatically get the ROM from
173-
your HP48. After the download you may have to convert your dump with
174-
the CONVERT utility into the Emu48 format.</p>
175-
<p>You can find the latest version of the ROM dump programs on:</p>
176-
<blockquote>
177-
ROMUPL.BIN <a href="http://www.hpcalc.org/details.php?id=3686">
178-
http://www.hpcalc.org/details.php?id=3686</a><br>
179-
ROMDump Wizard
180-
<a href="http://hp.giesselink.com/emu48.htm">
181-
http://hp.giesselink.com/emu48.htm</a>
182-
</blockquote></li>
183-
<li>HP49G
184-
<p>There's no ROM download program available so far. But you can
185-
create a ROM image with the
186-
<a href="http://hp.giesselink.com/emu48.htm">UPD49ROM tool</a>
187-
and a <a href="http://www.hpcalc.org/hp49/pc/rom/">
188-
ROM update file</a> for the HP49G calculator. I suggested to use
189-
<a href="http://www.hpcalc.org/details.php?id=3240">version 1.19-6</a>
190-
</p>
191-
<p>To create a HP49G ROM image file, start a Command Prompt while
192-
running Windows, and type:</p>
193-
<blockquote>UPD49ROM -f hp49119-6.flash ROM.49G</blockquote>
194-
<p>This will create a HP49G ROM image file with an empty User
195-
Port 2.</p></li>
196-
</ul>
133+
<p>The general syntax of the convert utility is:</p>
134+
<blockquote>Convert [-p] &lt;old-rom-dump&gt; [&lt;new-rom-dump&gt;]</blockquote>
135+
<p>where:</p>
136+
<blockquote>Convert &lt;old-rom-dump&gt;</blockquote>
137+
<p>check if &lt;old-rom-dump&gt; is in a known source format and
138+
report the ROM Model, the ROM Version and the result of the CRC
139+
check.
140+
</p>
141+
<p>where:</p>
142+
<blockquote>Convert &lt;old-rom-dump&gt; &lt;new-rom-dump&gt;</blockquote>
143+
<p>convert the file &lt;old-rom-dump&gt; into the <u>unpacked</u>
144+
ROM image file &lt;new-rom-dump&gt; valid for use in Emu48.
145+
</p>
146+
<p>where:</p>
147+
<blockquote>Convert -p &lt;old-rom-dump&gt; &lt;new-rom-dump&gt;</blockquote>
148+
<p>convert the file &lt;old-rom-dump&gt; into the <u>packed</u>
149+
ROM image file &lt;new-rom-dump&gt; valid for use in Emu48.
150+
</p>
151+
<h2><a name=ss3.1>3.1 Creation examples</a></h2>
152+
<ul>
153+
<li>HP38
154+
<p>To upload the ROM of your HP38G, you will need a special aplet
155+
called <a href="http://www.hpcalc.org/details.php?id=633">&quot;ROM UPLOAD&quot;</a>.
156+
Once you've uploaded the ROM, you have to convert it using the
157+
Convert utility.</p>
158+
<p>To do that, start a Command Prompt while running Windows, and
159+
type:</p>
160+
<blockquote>Convert -p &lt;rom-file&gt; ROM.38G</blockquote>
161+
<p>Where &lt;rom-file&gt; is the path to your ROM image. This will
162+
create a packed file named ROM.38G. This tool will also check its validity.
163+
</p></li>
164+
<li>HP39/40
165+
<p>To upload the ROM of your HP39G/HP40G, you will need a special aplet
166+
called <a href="https://hp.giesselink.com/emu48.htm">&quot;ROM UPLOAD&quot;</a>.
167+
Once you've uploaded the ROM, you may convert it to the unpacked format
168+
using the Rom2emu utility or rename it when you want to keep the packed
169+
format.
170+
</p>
171+
<p>To do that, start a Command Prompt while running Windows, and
172+
type:</p>
173+
<blockquote>Rom2emu &lt;rom-file&gt; ROM.39G</blockquote>
174+
<p>or</p>
175+
<blockquote>rename &lt;rom-file&gt; ROM.39G</blockquote>
176+
<p>There's also a HP39G/HP40G beta ROM for emulators inside an old
177+
<a href="http://www.hpcalc.org/details.php?id=4272">Emu48 package</a>.
178+
</p></li>
179+
<li>HP48
180+
<p>If you have already used another HP48 emulator, you can convert
181+
the ROM using the Convert utility.
182+
</p>
183+
<p>To do that, start a Command Prompt while running Windows, and
184+
type:</p>
185+
<blockquote>Convert &lt;rom-file&gt; ROM.48G</blockquote>
186+
<p>or</p>
187+
<blockquote>Convert &lt;rom-file&gt; ROM.48S</blockquote>
188+
<p>Where &lt;rom-file&gt; is the path to your old ROM image. This
189+
will create a file named ROM.48G or ROM.48S, depending on the
190+
version you own. This tool should be able to read any style of
191+
ROM image, and will also check its validity. Note that if you run
192+
it with only one parameter, no file will be written, but it will
193+
still check the validity of the ROM.</p>
194+
<p>If you have never used an HP48 emulator, and don't have a ROM
195+
dump, you can either use Jean-Yves Avenard's ROMUPL.BIN or the
196+
ROMDump Wizard V1.x, which will almost automatically get the ROM
197+
from your HP48. After the download you may have to convert your
198+
dump with the CONVERT utility into the Emu48 format.</p>
199+
<p>You can find the latest version of the ROM dump programs on:</p>
200+
<blockquote>
201+
ROMUPL.BIN <a href="http://www.hpcalc.org/details.php?id=3686">
202+
http://www.hpcalc.org/details.php?id=3686</a><br>
203+
ROMDump Wizard
204+
<a href="https://hp.giesselink.com/emu48.htm">
205+
https://hp.giesselink.com/emu48.htm</a>
206+
</blockquote></li>
207+
<li>HP49G
208+
<p>There's no ROM download program available so far. But you can
209+
create a ROM image with the
210+
<a href="https://hp.giesselink.com/emu48.htm">UPD49ROM tool</a>
211+
and a <a href="http://www.hpcalc.org/hp49/pc/rom/">
212+
ROM update file</a> for the HP49G calculator. I suggested to use
213+
<a href="http://www.hpcalc.org/details.php?id=3240">version 1.19-6</a>
214+
</p>
215+
<p>To create a HP49G ROM image file, start a Command Prompt while
216+
running Windows, and type:</p>
217+
<blockquote>UPD49ROM -f hp49119-6.flash ROM.49G</blockquote>
218+
<p>This will create a HP49G ROM image file with an empty User
219+
Port 2.</p></li>
220+
</ul>
197221
<h1><a name=s4>4. Installation</a></h1>
198222
<p>To install Emu48 you may use the installer package which contain,
199223
among the binaries, some HP48 KML scripts or just unzip the emulator
@@ -239,7 +263,7 @@ <h1><a name=s5>5. How to Start</a></h1>
239263
<p>If you want other great scripts, visit Rechlin's great HP archive
240264
<a href="http://www.hpcalc.org/"></a></p>
241265
<p>If you are interested in writing new scripts, get the KML 2.0
242-
documentation from <a href="http://hp.giesselink.com/emu48.htm">the
266+
documentation from <a href="https://hp.giesselink.com/emu48.htm">the
243267
authors Emu48 page</a>.</p>
244268
<p>Having selected a script, press OK to start the emulator. In most
245269
cases, when Emu48 crash after pressing the OK button, you are using
@@ -462,7 +486,7 @@ <h4>8.6.3.2 Section Infrared Printer</h4>
462486
simulation. The data transfer to the printer simulator is done over UDP.
463487
In this section you can the define the IPv4 address and the port the
464488
printer simulator is listening. A suitable HP82240B printer simulation can
465-
be found <a href="http://hp.giesselink.com/hp82240b.htm">here</a>.</p>
489+
be found <a href="https://hp.giesselink.com/hp82240b.htm">here</a>.</p>
466490
<h4>8.6.3.3 Section Serial Ports</h4>
467491
<ul>
468492
<li><i>Wire</i>
@@ -651,7 +675,7 @@ <h1><a name=s14>14. Emu48+ Changes</a></h1>
651675
Cyrille de Brebisson of Hewlett-Packard.</p>
652676
<h1><a name=s15>15. License</a></h1>
653677
<p>Emu48 - A HP38G/39G/40G/48SX/48GX/49G Emulator<br>
654-
Copyright (C) 2021 Christoph Gie&szlig;elink</p>
678+
Copyright (C) 2022 Christoph Gie&szlig;elink</p>
655679
<p>This program is free software; you can redistribute it and/or modify it
656680
under the terms of the GNU General Public License as published by the Free
657681
Software Foundation; either version 2 of the License, or (at your option)

app/src/main/assets/ReadMe.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ LINKS
5858

5959
CHANGES
6060

61+
Version 2.6 (2022-08-19)
62+
63+
- Updated source code from Eric Rechlin's Emu48 version 1.64+ that was merged from Christoph Gießelink's Emu48 version 1.65. This new version improve the serial communication.
64+
65+
6166
Version 2.5 (2022-03-03)
6267

6368
- Allow to load RLE4, RLE8 and monochrome BMP images.

app/src/main/cpp/core/Emu48.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "kml.h"
1414
#include "debugger.h"
1515

16-
#define VERSION "1.63+"
16+
#define VERSION "1.64+"
1717

1818
#ifdef _DEBUG
1919
LPCTSTR szNoTitle = _T("Emu48 ")_T(VERSION)_T(" Debug");
@@ -681,7 +681,7 @@ static INT_PTR CALLBACK SettingsPeripheralProc(HWND hDlg, UINT uMsg, WPARAM wPar
681681

682682
// set combobox parameter
683683
SetCommList(hDlg,szSerialWire,szSerialIr);
684-
if (bCommInit) // disable when port open
684+
if (CommIsOpen()) // disable when port open
685685
{
686686
EnableWindow(GetDlgItem(hDlg,IDC_WIRE),FALSE);
687687
EnableWindow(GetDlgItem(hDlg,IDC_IR),FALSE);
@@ -768,14 +768,18 @@ static UINT SaveChanges(BOOL bAuto)
768768
if (GetSaveAsFilename())
769769
{
770770
if (SaveDocumentAs(szBufferFilename))
771+
{
772+
MruAdd(szBufferFilename);
771773
return IDYES;
774+
}
772775
else
773776
return IDCANCEL;
774777
}
775778
return IDNO;
776779
}
777780

778781
SaveDocument();
782+
MruAdd(szCurrentFilename);
779783
return IDYES;
780784
}
781785

@@ -1056,25 +1060,32 @@ static LRESULT OnFileOpen(VOID)
10561060
//
10571061
static LRESULT OnFileMruOpen(UINT wID)
10581062
{
1059-
LPCTSTR lpszFilename;
1063+
TCHAR szFilename[MAX_PATH];
10601064

10611065
wID -= ID_FILE_MRU_FILE1; // zero based MRU index
1062-
lpszFilename = MruFilename(wID); // full filename from MRU list
1063-
if (lpszFilename == NULL) return 0; // MRU slot not filled
1066+
1067+
// full filename from MRU list
1068+
MruFilename(wID,szFilename,ARRAYSIZEOF(szFilename));
1069+
if (*szFilename == 0) return 0; // MRU slot not filled
10641070

10651071
if (bDocumentAvail)
10661072
{
10671073
SwitchToState(SM_INVALID);
1074+
// saving may change MRU index and destroy lpszFilename pointer content
10681075
if (IDCANCEL == SaveChanges(bAutoSave))
10691076
goto cancel;
10701077
}
1071-
if (!OpenDocument(lpszFilename)) // document loading failed
1078+
if (!OpenDocument(szFilename)) // document loading failed
10721079
{
1073-
MruRemove(wID); // entry not valid any more
1080+
wID = MruID(szFilename); // get actual MRU ID after saving
1081+
if (wID != (UINT) -1) // entry still in MRU list
1082+
{
1083+
MruRemove(wID); // entry not valid any more
1084+
}
10741085
}
10751086
else
10761087
{
1077-
MruMoveTop(wID); // move entry to top of MRU list
1088+
MruAdd(szFilename); // add entry to top of MRU list
10781089
}
10791090
cancel:
10801091
if (pbyRom) SwitchToState(SM_RUN);

app/src/main/cpp/core/Emu48.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ extern VOID MruAdd(LPCTSTR lpszEntry);
133133
extern VOID MruRemove(UINT nIndex);
134134
extern VOID MruMoveTop(UINT nIndex);
135135
extern UINT MruEntries(VOID);
136-
extern LPCTSTR MruFilename(UINT nIndex);
136+
extern UINT MruID(LPCTSTR lpszEntry);
137+
extern VOID MruFilename(UINT nIndex, LPTSTR szFilename, UINT nBuffersize);
137138
extern VOID MruUpdateMenu(HMENU hMenu);
138139
extern VOID MruWriteList(VOID);
139140
extern VOID MruReadList(VOID);
@@ -193,7 +194,6 @@ extern BOOL bRealSpeed;
193194
extern BOOL bKeySlow;
194195
extern BOOL bSoundSlow;
195196
extern UINT nOpcSlow;
196-
extern BOOL bCommInit;
197197
extern CHIPSET Chipset;
198198
extern TCHAR szSerialWire[16];
199199
extern TCHAR szSerialIr[16];
@@ -412,6 +412,7 @@ extern LPCTSTR RplGetName(DWORD dwAddr);
412412
extern BOOL RplGetAddr(LPCTSTR lpszName, DWORD *pdwAddr);
413413

414414
// Serial.c
415+
extern BOOL CommIsOpen(VOID);
415416
extern BOOL CommOpen(LPTSTR strWirePort,LPTSTR strIrPort);
416417
extern VOID CommClose(VOID);
417418
extern VOID CommSetBaud(VOID);

0 commit comments

Comments
 (0)