Transfering a file to a HP38 emulated by wine

Last update on February 2nd 2006.

This document have been written by Khanh-Dang Nguyen Thu-Lam (kdntl at yahoo . fr). The original version can be found at http://perso.wanadoo.fr/kdntl/hp49/transfer_to_emu38.html.

Introduction

There is no way to transfer a file to a HP38 emulated by emu48 without using additinonal harware. See the Emu48 FAQ:

Q: How can I load an Aplet (e-Lesson) into the HP39G/HP40G?
A: There's no direct way. You have to load an Aplet over the serial port. Therefore you need two PC's with one COM port each or one PC with two free COM ports. Then you have to connect the COM ports with a Null-Modem cable.

This document will describe a trick to transfer a file (a library, an aplet, whatever) to a HP38 calculator emulated by emu48 even if you have no access to two computers or one with two serial ports and a null-modem cable.

This document also applies to HP39/40 calcs.

What you need

Let's go

First, we try to get a HP38 RAM content with our file FILE0000.000 (the library, aplet, or whatever file) into it.

  1. First compile the saturn program (and read its documentation). You should also take a look at this page: Emulating a HP38 with saturn. You have to convert the HP38 ROM (emu48 format) into the saturn format. For example:
    $ cd /path_to_saturn
    $ mkdir hp38_statedir
    $ ./pack /path_to_emu48/ROM.38 ./hp38_statedir/rom.38
  2. Run the saturn emulator:
    $ ./run_saturn -stateDir hp38_statedir -rom rom.38 -face hp48 -hw hp48 -reset
    An error message will appear, as the HP38 has no Port1, while saturn try to access it. Just close the dialog box.
    Note the terminal with which the emulated serial port is connected to (this is written at the bottom of the window). Let's say this is "/dev/pts/2".
  3. Press the [M] key to go to the aplet list. Select the menu item [RECV], then select "HP 38G". Now, sends the file with your Xmodem program:
    $ sx </dev/pts/2 >/dev/pts/2 FILE0000.000
  4. Quit the emulator, by closing the window.

Then all we have to do is to convert the RAM content (this is the hp38_satedir/ram file provided by saturn) into emu48's format.

Just download this C file: ram2e3x.c.

Now, we convert the ram file and write it into emu48's file:
$ cd hp38_statedir
$ cc /path/ram2e3x.c -o ram2e3x
$ ./ram2e3x ram /path/file.e38

I found it too complicated

Me too ;-)

Currently, you have to reset the emulated calc because the CPU registers are not saved in the emu48's file.