Post Reply 
Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
11-08-2017, 06:24 PM
Post: #1
Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
How do I do that?

I have a LIF file with a regular ROM image in it (disguised as a HEPAX SDATA file [as that is how I can get it into a LIF image using LIFUTILS). I then have to get that ROM/SDATA loaded into a slot in the HP-41CL RAM. How?
Find all posts by this user
Quote this message in a reply
11-08-2017, 07:44 PM
Post: #2
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
Perhaps the solution is to store the ROM files as ROM files. I did this for the 71B using the DOS utility HPDir.

http://www.hpmuseum.org/forum/thread-251...l#pid22721

You'll need to prepend the LIF file header to the ROM files. Then lifput can be used to copy the file to a LIF disc image. LIFUTILS has a tool to strip the file header, but not a tool to add the header.

Dave
Find all posts by this user
Quote this message in a reply
11-08-2017, 08:10 PM
Post: #3
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
(11-08-2017 07:44 PM)Dave Frederickson Wrote:  Perhaps the solution is to store the ROM files as ROM files. I did this for the 71B using the DOS utility HPDir.

http://www.hpmuseum.org/forum/thread-251...l#pid22721

You'll need to prepend the LIF file header to the ROM files. Then lifput can be used to copy the file to a LIF disc image. LIFUTILS has a tool to strip the file header, but not a tool to add the header.

Dave

DOS utility... bummer. LIFUTILS should get a program to write LIF headers to inject ROM files (as ROM files) into a LIF image.
Find all posts by this user
Quote this message in a reply
11-08-2017, 08:21 PM
Post: #4
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
It seems that the LIF file header could be identical for all ROM files, except for the filename. In that case you could manually generate a LIF file header which could be prepended to the ROM file. All you'd need is a means of changing the filename in the header.

Dave
Find all posts by this user
Quote this message in a reply
11-08-2017, 10:38 PM (This post was last modified: 11-08-2017 11:58 PM by Geir Isene.)
Post: #5
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
I can save a ROM file to a LIF image as a HEPAX SDATA file using HEPAX's WRTROM function. But the other way gets broken. I do this:

Code:

cat CASINO.ROM | rom41hx CASINO > CASINO.sda

...to convert the CASINO.ROM (just an example, could be any ROM) to a HEPAX SDATA file (the only way to get LIFUTILS to stuff a ROM file into a LIF image). Then I do:

Code:

lifput test.lif CASINO.sda

...to add the CASINO SDATA file to the LIF image.

Using HEPAX's READROM, I try to read the ROM file into page E ("CASINO" in Alpha, 14 in X) but get "H:CHKSUM ERR" indicating (from the HEPAX manual) that the file on the mass sorage (LIF image) is disrupted (pointing to the possibility that rom41hx is buggy).

LIFUTILS has some other quirks/bugs*, so it may be that this is also a bug. Do you know of a workaround here?

*
LIFILPER doesn't work with the latest PILbox.
LIFPUT has an example that adds the option "-c" that doesn't exist (lifput -c disk1.lif test1.p41)

Update: Running the process of converting the CASINO.ROM (8K file) to a HEPAX SDATA file (using LIFUTIL's "rom41hx"), adding it to the LIF file (using "lifput"), extracting it from the LIF file (using "lifget") and converting it back to a ROM file (using "hx41rom") - then I DO NOT get the same file that I started out with. I get a file that is 8.05K and when running both through "hexdiff" (a Linux hexadecimal diff viewer), the original ROM has LABELS and Alpha messages in there, while the converted-reconverted ROM is all scrambled.

Conclusion: This part of LIFUTILS is broken.
Find all posts by this user
Quote this message in a reply
11-08-2017, 11:04 PM
Post: #6
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
If you find any bugs in LIFUTILS then forward to Joachim. He's pretty responsive.

I don't have a Linux machine so I haven't used LIFILPER.

I think the -c option for LIFPUT is redundant since Copying is what the tool does.

Dave
Find all posts by this user
Quote this message in a reply
11-08-2017, 11:10 PM
Post: #7
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
(11-08-2017 11:04 PM)Dave Frederickson Wrote:  If you find any bugs in LIFUTILS then forward to Joachim. He's pretty responsive.

I've dropped him an e-mail and asked him to look at this thread and comment :-)
Find all posts by this user
Quote this message in a reply
11-08-2017, 11:13 PM
Post: #8
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
What would be ideal is a LIFUTIL program that adds a LIF header to a ROM file so that it can be added to a LIF image and that HP-41 commands such as READPG and WRTPG (from the AMC_OS/X module) can read/write the ROMs to mass storage (LIF image/file).
Find all posts by this user
Quote this message in a reply
11-08-2017, 11:40 PM
Post: #9
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
The creation of the LIF header can get complicated. The LIF format is used by Series 40, 70, 80, and 9000 and that's where I stopped cataloging LIF file types. Currently I've cataloged around 60 different LIF file types. Some of these file types incorporate "Implementation Bytes" which in the case of 71B binary files are the file size in nibbles. This is where Christophe Gottheimer gave up on his LIFTOOL.

JFG created alifhdr which generates headers for 71 binary files.

Joachim is actively maintaining his tools so you might try appealing to him.

Dave
Find all posts by this user
Quote this message in a reply
11-08-2017, 11:49 PM
Post: #10
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
I tried to debug the code for "lifilper" by changing the connection speed from 115200 to the current PILbox firmware speed of 230400 in lifilper.c at lines 381 and 382 and also the timeout for the function ReadPILBox from 5ms to 50ms at line 193) but it still gives the message "No response from PILBox".

I am not a c programmer, so I'm hoping for a hand or five here :-)
Find all posts by this user
Quote this message in a reply
11-09-2017, 12:05 AM
Post: #11
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
Additional data:

Mounting a LIF image/file via pyILPer, I add a ROM image from the HP-41CL to that LIF image/file in two different ways:

1. Using the HEPAX function WRTROM, it shows up in pyILPer as a 5120 bytes SDATA entry
2. Using the AMC_OS/X function WRTPG, it shows up as a 5121 bytes X-M41 entry

As already mentioned, having LIFUTILS handle the X-M41 entries by adding and retreiving such ROM files to/from LIF files would be ideal.
Find all posts by this user
Quote this message in a reply
11-09-2017, 12:16 AM
Post: #12
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
Coincidentally the 71B also supports the SDATA (E0D0) file type.

Yes, LIFUTILS identifies an E0D0 file type as X-M41, probably because it's the same as the PANAME ROM eXtended Memory file. Other programs will identify this file type as ROM41, r41, ROM, or 41:ML.

Dave
Find all posts by this user
Quote this message in a reply
11-09-2017, 01:16 AM
Post: #13
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
Hi Geir,

I managed to successfully transfer a ROM image to a 41CL RAM page via HPIL & PILBox. I did this in Windows 10 using pyILPR running in an Anaconda python distribution. The basic steps were to

> Put the ROM file on a LIF image as an SDATA file for HEPAX
> Setup the 41CL for the transfer
> Transfer and verify the ROM image.

You've already accomplished the first part from the command line. I transferred the MATH-1D ROM image to the LIF image and it shows up as a 5120 byte SDATA entry in the directory.

The second set involves setting up HEPAX and a RAM page on the 41CL. I'm using the Extreme CL commands for the following.

"HEPX 9"
PPLUG
"0B9>808"
YMCPY
"-808 8"
PPLUG
HEPDIR

Modify the target page 808 to suit your setup. I'm initializing the RAM page because I've locked up my 41CL when plugging in an uninitialized RAM page! Now all you should need to do is transfer the file via HPIL/PILBox and verify the transfer.

"MATH1D"
8
READROM

Alpha has your filename and X the page. You should see your ROM in page 8 using HEPAX 002 or CAT 1:G in OSX3. For me it shows up as "-MATH 1D" with the usual FAT entries.

I have an Ubuntu VM image I can run in Oracle VirtualBox tomorrow to see what steps are needed in Linux.

Hope this works for you too,
~Mark
Find all posts by this user
Quote this message in a reply
11-09-2017, 08:27 AM (This post was last modified: 11-09-2017 08:40 AM by jsi.)
Post: #14
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
If you wish to automate the creation of a LIF image file with rom data you can proceed according to the following example. It shows how to extract the ROM-images of the PLOTTER mod file and to create two HEPAX packed SDATA files in a lif image.

Extract the rom images:
Code:

lifmod -e PLOTTER.MOD

It creates the files PlotterL_1A.rom and PlotterU_2A.rom. If you need the information which ROM images are contained in a mod file use:

Code:

lifmod -v PLOTTER.MOD

and search for the string "ROM NAME:"

Create an empty LIF image file

Code:

lifinit -m cass romdisk.dat 100

This creates a LIF image file "romdisk.dat" emulating a HP 82161A cassette with 100 directory entries. If the HP-41CL is not limited to this medium size you can use larger media like "hdrive1" (640KB) or the undocumented media types "hdrive2" (2MB) up to "hdrive16" (16MB).

Pack rom images and store them in the LIF image file

Code:

cat PlotterL_1A.rom | rom41hx PLOTTERL | lifput romdisk.dat
cat PlotterU_2A.rom | rom41hx PLOTTERU | lifput romdisk.dat

On Windos use "type" instead of "cat".

"rom41hx" takes the input of the "cat" (or "type") command, packs the content to the HEPAX rom format and puts a LIF header in front of it. Therefore you must specify the LIF filename "PLOTTERL" or "PLOTTERU" here. Note: the LIFUTILS are quite strict concerning file names and allow only file names which are valid on the HP-71B. Therefore use only file names starting with a letter followed by letters or digits.

List content of LIF image file

Code:

lifdir romdisk.dat

gives a directory listing of the LIF image file "romdisk.dat". If you need to retrieve information which files are stored in a LIF image file for scripting purposes then use:

Code:

lifdir -n romdisk.dat

This commands lists the file names only.

Other useful commands
Above all the LIFUTILS provide among other things the following commands that work on LIF image files:

Code:

LIFPURGE : purge a file in a LIF image file
LIFRENAME: rename a file in a LIF image file. Allows to rename files which do not apply to the HP71 file name scheme
LIFGET: get the content of a file in a LIF image file and put the content to a file or standard output
LIFPACK: defragment a LIF image file system

I hope that this helps as a start. I see that there is need for a "LIFUTILS guide" to extend the documentation.

Regards
Joachim
Find all posts by this user
Quote this message in a reply
11-09-2017, 10:20 AM
Post: #15
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
(11-09-2017 12:05 AM)Geir Isene Wrote:  As already mentioned, having LIFUTILS handle the X-M41 entries by adding and retreiving such ROM files to/from LIF files would be ideal.

There is not filter in the LIFUTILS to create compressed ERAMCO ROM files with LIF headers from uncompressed rom files as rom41hx does it for the HEPAX format.

If the HEPAX format is definitely not applicable for your application then I could develop a filter for the ERAMCO format.

Regards
Joachim
Find all posts by this user
Quote this message in a reply
11-09-2017, 01:45 PM
Post: #16
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
(11-09-2017 08:27 AM)jsi Wrote:  If you wish to automate the creation of a LIF image file with rom data you can proceed according to the following example. It shows how to extract the ROM-images of the PLOTTER mod file and to create two HEPAX packed SDATA files in a lif image.

Thanks very much for this excellent, detailed example Joachim, it is very helpful to understand how to better use your tools!

A guide would of course be nice too, but detailed and complete examples like this are great.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
11-09-2017, 03:42 PM
Post: #17
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
Great answers. Thanks a bunch. Commencing project Smile
Find all posts by this user
Quote this message in a reply
11-10-2017, 09:27 AM
Post: #18
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
Joachim,

Could you update the lifilper to work with the latest PILbox firmware (w/speed @ 230400)?
Find all posts by this user
Quote this message in a reply
11-10-2017, 05:35 PM
Post: #19
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
In the mean time, have you tried jumpering the PIL-Box for 115k?
Find all posts by this user
Quote this message in a reply
11-10-2017, 05:51 PM
Post: #20
RE: Extracting a ROM file to my HP-41CL from a HEPAX SDATA file in a LIF image
Actually, I don't think that is the problem - as the code didn't work when I sat the speed to 230400.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)