Post Reply 
A new old bug in the printer ROM?
01-16-2023, 07:25 PM (This post was last modified: 01-16-2023 07:30 PM by ThomasF.)
Post: #1
A new old bug in the printer ROM?
Hi,

I just built myself an IR-receiver after the description from Martin and Meindert.
The receiver works perfectly, and I thought of doing an emulation of the printer HP82143 since I mainly use the 41.
Yes, there are already some nice emulators, but I wanted it for Linux (and doing it by myself to learn something but also because it is fun Wink).

I also noticed that the existing emulators don't emulate the 82143 that well, since the pixels are not correctly dimensioned (they are rectangular, not squared) so e.g. when plotting with the 'HP' in the PPC ROM the lines are not aligned. How it is with physical 82240 HW I don't know since I don't have one.

Anyhow, when I started to decode the data sent from the calculator (I use a DM41X since I don't have the IR-module for the 41), I see that the data is basically sent in two modes, text or graphics.

Text is straight forward, using the character set from the printer. And graphics are sent by sending ESC, then the number of bytes followed by 8-bit values describing the corresponding pattern in each column to be printed. Also quite straight forward.

When listing a program, this is done in text-mode. Almost.
Listing this little program results in graphics mode being used:

   

This is the "raw" data sent from the calculator to the printer, I just formatted it for readability:

01*LBL "TEST".
02 RDN.
03 RESC{7:00.08.04.7E.04.08.00}.
04 ENTERESC{7:00.08.04.7E.04.08.00}.
05 XESC{7:00.08.04.7E.04.08.00}2.
06 .END..

So, instead of printing an up-arrow, the calculator draws the graphics for the up-arrow ... !

Is this actually how the printer ROM in the HP41 does it? I would have thought so if the up-arrow wasn't part of the character set of the printer, but the up-arrow is indeed included as character 94.

And if I do the following:
67 ACCHR 104 ACCHR 114 ACCHR 58 ACCHR 94 ACCHR ADV

I get the following result:
   

But, looking at the datastream over IR shows the following:

Chr:ESC{6:00.08.04.7E.04.08}

So, again has the printer ROM replaced the character 94 with graphics instead!
And filling the alphareg with the up-arrow (shift enter in alpha-mode) causes the following to be printed:

   
(Sorry for the "small" picture - click on it for better viewing ..)

The two last characters are not printed correctly (well, printed correctly but not sent by the calculator, the last character is missing and the next to last is replaced by character 0x88 ...)

I verified this with the 82240 emulator by Giesselink, but I have no real hardware to try this on, so I don't know if the "error" is actually in the printer-ROM (which I think), in the DM41X (which I'm using) or somewhere else.

And from what I can see, the same behavior is apparent with chr(7) (down-arrow) and chr(10) (diamond) - they are also sent as graphics instead of the corresponding byte code.

If this is the case, the error has no real effect on the calculator or programs, just that e.g. printing a whole line of these characters is impossible due to buffer overflow.

Is there someone who could verify this on the real HP41 and HP82143 (or with IR-module and the 82240), e.g. by filling the alpha-reg with the characters 7, 10 or 94 and print it (PRA)?

Cheers,
Thomas

[35/45/55/65/67/97/80 21/25/29C 31E/32E/33E|C/34C/38E 41C|CV|CX 71B 10C/11C/12C/15C|CE/16C 32S|SII/42S 28C|S 48GX/49G/50G 35S 41X]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
A new old bug in the printer ROM? - ThomasF - 01-16-2023 07:25 PM



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