Emu42 - A freeware HP17B/17BII/19BII/27S/28S/42S Emulator
for Windows 9x, ME, NT, 2000, XP and Vista

1. General

Emu42 base on the sources of Emu48 and is an emulator for the Hewlett Packard High End Pioneer series HP17B, HP17BII, HP27S and HP42S and for the Clamshell calculators HP19BII and HP28S hardware. These calculators base on the 1LR2 Lewis chip.

2. Acknowledgements

I want to thank Raymond Del Tondo who convinced me to begin with a HP42S emulator and for his HP42S ROM entry point list. A big thank also to Cyrille de Brebisson for his technical assistance, without him the emulator would only be a "Proof of concept". Jean-Francois Garnier spend a lot of knowledge and material on the HP17BII and HP28S calculator. Warren Furlow's V41 emulator spend some basic parts of the HP42S User Code import/export handling. Also thanks to Sébastien Carlier for his Emu48 v1.0, without him this emulator would never have been created. A big thank to Erik Ehrling for his beta testing and his suggestions. And finally I want to thank all the unnamed authors for publishing material about these calculators.

3. ROM Images

You need ROM images. The ROM images are copyrighted by Hewlett Packard and I have no license to distribute them. Please don't ask me, I don't send you mine.

ROM images are valid in a packed (even address lower nibble, odd address higher nibble) or unpacked (one nibble per byte with even address first) form. They can be validated with the LEWISCRC.EXE command line utility. To do that, start a Command Prompt while running Windows, and type:

Lewiscrc <image-file>

where <image-file> is the ROM image you want to test. As result you will get a report of the CRC check.

4. Installation

To install Emu42, just unzip the emulator and the wanted emulator skins into an empty directory. Finally copy your ROM images into this directory and adjust the ROM image name to the name used in the corresponding KML script. When you first run Emu42, it will detect the directory in which you installed it, and will write the configuration to a file named Emu42.ini in your Windows directory.

5. How to Start

When Emu42 is installed and you have put the valid ROM image(s) into your Emu42 installation directory, you can start Emu42. You'll see a "Choose Your KML Script" box.

KML scripts in fact define the visual aspect of Emu42, the behavior of the buttons, of the keyboard, ... It's a GREAT way to customize your copy of Emu42.

Check that the path in the "Emu42 Directory" text area is correct. Modify it if the directory in which you installed Emu42 is not the directory displayed. Click the refresh button ("V") after modifying it to update the list box or use the ("...") button to start the directory browser.

Choose a KML script in the list box for your calculator ROM you put into Emu42's directory.

Available scripts from the author at the moment are:

And if you are interested in writing new scripts, get the KML 2.0 documentation from the authors Emu48 page.

Once you have selected a script, press OK to start the emulator. In most cases, when Emu42 crash after pressing the OK button, you are using an invalid ROM image. While it's running, you can use the View/Change KML Script... command to change the visual aspect of Emu42.

6. Command Line

The command line syntax is "Emu42 [file]". The parameter sets the filename for the emulation data independent from the "LastDocument" setting in the Emu42.ini file. The argument is optional.

7. Virtual Keyboard

There are two ways to use the virtual keyboard on the emulated calculator:

  1. by Mouse
  2. by PC keyboard

The easiest way to use the emulated calculator is using the mouse. The KML script define buttons with an area where mouse input is active. By default the mouse cursor change from an arrow to a hand cursor in these areas. Remember, this behavior can be disabled! The state of the virtual key follow the state of your left mouse button. When the mouse cursor leaves the virtual key area the virtual button automatically release. In some cases you need to press more than one key on the emulator. For these cases press the virtual key with the right mouse button. When you release the mouse button or leave the area of the virtual key, the key is still hold. To release all hold virtual buttons, just use the left mouse botton again. A single release of a hold virtual key isn't possible.

Another convenient way is using the PC keyboard. The KML script language support a large variety of commands to implement this feature. So keyboard usage depends on your used KML script and not on the emulator. Because of this it's impossible to say what's happen when you press a key on the PC keyboard. For further details read the KML 2.0 documentation mentioned before please.

8. File Menu

8.1 New...

Create a new emulation session. You're asked for a new KML script where you can select the calculator type and skin to emulate.

8.2 Open...

Open an existing emulation session. The emulation continues at the same position where the loaded session was aborted. Loading emulation sessions made with a different ROM revision may destroy the memory content or may cause other unpredictable results.

8.3 Save

Save the current running session with the actual name.

8.4 Save As...

Save the current running session with a new name. You're also get in this dialog when you Exit a new session without a state file name.

8.5 Close

Close the current session without closing the emulator.

8.6 Settings

This calls the Settings dialog. This dialog has three sections: General Disassembler and Sound.

8.6.1 General section

8.6.2 Disassembler section

Choosing the assembler syntax:

8.6.3 Sound section

There are two possible ways of sound output, with the Speaker selection over the internal PC speaker, or with the Wave selection over a sound card and external speakers. The internal PC speaker hasn't a volume control, so the Volume slider is disabled in speaker mode.

8.7 Exit

Quit emulation. The default actions at finishing are defined in the Settings dialog. If the current session is "Untitled" you are ask for a session file name using the Save As... dialog. If you quit the emulator without a given filename, you're ask for choosing a KML script at next startup.

9. Edit Menu

9.1 Load Object...

This is only valid for the HP28S and the HP42S emulation.

9.2 Save Object...

This is only valid for the HP28S and the HP42S emulation.

9.3 Copy Screen

Copy the screen content as bitmap to the clipboard.

9.4 Copy Stack

This is only valid for the HP28S and the HP42S emulation.

The decimal point (radix mark) of "Real Numbers" in the clipboard is equal to the calculator setting. This point maybe important when you try to paste the numbers into a program using the locale settings of the host operating system.

9.5 Paste Stack

This is only valid for the HP28S and the HP42S emulation.

To import "Real Numbers" from the clipboard, the decimal point (radix mark) of the clipboard and calculator must be equal. A real number is only detected in the case of valid real number characters in the clipboard. Especially heading and tailing white spaces aren't valid number characters also.

9.6 Reset Calculator

This emulates the Reset pin of the internal CPU.

9.7 Backup

9.7.1 Backup Save

This saves the current emulator status into a backup slot. If the backup slot already contain data, it will be overwritten.

9.7.2 Backup Restore

This restores a previous saved emulator status without request. If you changed the calculator model meanwhile, the emulator will switch back to the old model.

9.7.3 Backup Delete

This deletes the data in the backup slot.

10. View Menu

10.1 Change KML Script...

This allows you to change the skin of the current emulated calculator. In opposite to the New... command you see only scripts emulating the same calculator model.

11. Tools Menu

11.1 Disassembler...

This is a simple disassembler.

Enter the address to disassemble in hexadecimal into the "Address (HEX)" field and press <Return>. With the "Next Address" button the next opcode is disassembled. With the "Copy Data" button you can copy all selected lines inside the list box to the clipboard.

11.2 Debugger...

The assembler code debugger of the emulator. For more details refer to the extra documentation of the debugger please.

11.3 Macro

The keyboard macro recorder unit.

11.3.1 Macro Record...

Prompts a dialog to enter the macro file for the data to record. After accepting the confirm message, every key event is recorded into the macro file with it's time information.

11.3.2 Macro Play...

Prompts a dialog box to ask for the keyboard macro file to play. The replay starts immediately after selecting the file.

11.3.3 Macro Stop

Stops recording or replaying a keyboard macro file.

11.3.4 Macro Settings...

Settings for the Macro Replay mode

12. Help Menu

12.1 Help Topics

Call this document.

12.2 About Emu42...

The version, copyright and license message...

13. DDE Server

Emu42 has an integrated DDE server to transmit data from and to the HP stack. Because only the HP28S has a stack, all DDE transfers are ignored on the other calculators. You have the same restrictions like with the commands "Load object..." and "Save Object...", that a running program may corrupt memory. In difference you can choose the stack level for the transfer in the DDE item field. Take care to transmit data only after the acknowledge of the last DDE transaction.

Technical data:

Servicename: Emu42
Topicname: Stack
Item: 1 (stack level)
Clipboardformat: "CF_HPOBJ" (user defined)

The DDE commands CONNECT, POKE and REQUEST are supported.

The structure of the clipboard format "CF_HPOBJ":

4 Byte (length of object, LSB first) HP object (normal HP object)

14. License

Emu42 - A HP17B/17BII/19BII/27S/28S/42S Emulator
Copyright (C) 2009 Christoph Gießelink

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA