A virtual HP16C -- updated

All other HP calculators

A virtual HP16C -- updated

Postby mike-stgt » Sun Dec 17, 2023 12:41 am

Jean-François published recently an ingenious bug fix what paves the way for a pretty fast virtual 16C running under Windows by replacing the ROM copy within the well known virtual 12C.

v16c.jpg
How it looks like

First things first:
i) In case you surmise such a mod as fraudulent then do not download it, otherwise you could be prosecuted for possession of illicit material. There are various alternatives like NutEm/PC or Nonpareil or some simulations -- if you don't mind differences in details from the original HP16C.
ii) Do not extract the ROM copy from enclosed exe, two of its three patches are emulator specific, it fails for sure with others systems. (The third patch fixes the CHS stack lift bug.)
iii) If something fails, discard it, I won't fix it. Or fix it on your own an publish it as an enhancement.

Enclosed you find two ZIP files, V16c.zip contains the emulator and some files belonging to it. Unpack it to a directory at will (remember it for adaption of the supplements). Replace the two PDF files with something useful, but keep the names exactly the same, that way you get access to it from the help menu.
Just in case the exe fails to run, maybe (sheer guesswork!) the priorly setup of the original virtual 12C could cure this by installing some prerequisites I don't know. Otherwise see item iii) above.

One patch of the ROM shows the result of MEM, STATUS, and View Mantissa for about one second. Alas, I don't know (yet) how to make hit-n-hold the corresponding key to extend this time. Useful hint's are welcome.

This emulator does not offer any ON+key option. So if you prefer a comma as decimal separator take the state file (typically C:\Users\%username%\AppData\Roaming\HP11cState.bin ) to an hex editor and OR '80'x to byte @9B. The "RAM tree view" of NutEm/PC helped me to locate this spot.

V16c.zip
The virtual 16C
(3.08 MiB) Downloaded 3337 times

The complements in supV16C.zip enable to extract the user program from the virtual 16C's state file as a human-readable listing and to reinsert such listings.

dcd16cp.rx extracts the user program, I developed it with ooRexx, maybe it runs also under other REXX variants. Run it in a CMD window or send it with a right mouse click in the Explorer to "ooRexx with pause". Maybe you have to adjust at the beginning of the program the location of HP16cState.bin according to your Windows version.

impro16C.ahk is an AutoHotkey script, you have to install AHK v2.0 to run it. Main task is to import program listings like those from a. m. REXX routine. In addition it enhances the virtual 16C with copy and paste, while copy (Ctrl+c) takes just the content of the display to the clipboard, paste (Ctrl+v) respects hex mode for input or takes floating point numbers. In program mode input is same as for hex mode. Adjust this and the corresponding regular expressions in subroutine pastevalue() according to your needs. Adjust also the location where you filed V16c.exe so starting the script will also start the emulator.

Note: Due to read of single segments of all digits Ctrl+c is quite slow (about 1/2 second), that is why a short tone indicates when finished. Wait for it before using the clipboard content.

toI3E+back.16Clst (convert to and from IEEE format) is a text file with the two programs of Appendix D in "HP-16C Computer Scientist Owner's Handbook". Use it as a sample for the import option (Ins, F12, or middle mouse button) of the a. m. AHK script.

supV16C.zip
The Supplements
(9.98 KiB) Downloaded 3349 times

Enjoy.

Edit: The virtual 16C program did not pause 1 second for display of MEM, STATUS, View Mantissa. Fixed after a kind hint from J-F.
Last edited by mike-stgt on Thu Dec 21, 2023 10:17 am, edited 1 time in total.
mike-stgt
.........
.........
 
Posts: 182
Joined: Tue Dec 24, 2019 12:12 pm

Re: A virtual HP16C -- so what?

Postby mike-stgt » Thu Dec 21, 2023 10:14 am

My initial euphoria about JF's fix, which enables to misuse the HP12C.exe as a virtual 16C, is lowered by few disenchantments. Let's face the facts and list the pros and cons:
+ fastest emulator for Nut CPU (AFAIK),
o photo as faceplate (looks nice, nothing more),
- no hit-n-hold to prolong display of MEM, STATUS, and View Mantissa,
- no hold SST to show next program step,
- no auto-repeat for SST/BST in PRGM mode,
- no access to self tests,
- no no-fuss change of decimal separator (only by fiddling the state file),
+ display of user program with nice REXX complement,
+ import of user programs with nice AHK complement.
Bottom line: it is what it is.

Maybe it's kind of a promotion for other emulators, particularly for those including the two last items.

A little consolation, Pi/Vieta on the 16C:
Code: Select all
140-43,22, E  LBL Euler number by Vieta
141-42,45, 9  FLOAT 9
142-       2  2
143-      36  ENTER^
144-43,22, 0  LBL 0
145-   43 25  SQRT
146-      10  /
147-       2  2
148-   43 36  LAST X
149-      33  RDN
150-      20  *
151-   43 33  R^
152-   43 36  LAST X
153-   43  1  x<=y?
154-   22  F  GTO FIN
155-      40  +
156-   22  0  GTO 0  G0 r0und
157-43,22, F  LBL FIN
158-   43 33  R^
159-   43 33  R^
Model was the famous 12C version from Tony Hutchins (NZ). Labels are well chosen so to coexist with the two programs in appendix D of Usr Mnl.
mike-stgt
.........
.........
 
Posts: 182
Joined: Tue Dec 24, 2019 12:12 pm

Re: A virtual HP16C -- so what?

Postby dlachieze » Thu Dec 21, 2023 10:38 am

Nice project !

mike-stgt wrote:My initial euphoria about JF's fix, which enables to misuse the HP12C.exe as a virtual 16C, is lowered by few disenchantments.

Did you try starting from the 15C emulator instead of the 12C?
dlachieze
......
......
 
Posts: 28
Joined: Wed Mar 11, 2009 9:39 am

Re: A virtual HP16C -- so what?

Postby mike-stgt » Thu Dec 21, 2023 11:19 am

dlachieze wrote:Did you try starting from the 15C emulator instead of the 12C?
Yes, I did -- alas, same result.
mike-stgt
.........
.........
 
Posts: 182
Joined: Tue Dec 24, 2019 12:12 pm


Return to Other HP Calculators

Who is online

Users browsing this forum: No registered users and 1 guest