This turned out to be harder than I expected.
There are a few functional differences between these printers that needed to be addressed:
- The sector numbers for some of the non-numeric characters on the numeric columns are different between the EP102 and the M-32TL.
- The glyphs printed by the EP102 in the two symbol columns are very different from the characters on the M-32TL's single symbol wheel.
- The M-32TL paper feed is performed during printing a the last (left-most) character on the line. This means that (a) it's necessary to know whether the character being printed is the end of the line, and (b) feeding the paper without printing requires printing a blank character.
Deciding to translate the single EP102 glyph like "M+" into two consecutive M-32TL characters requires the translator to see the EP102 codes for both columns 17 and 18 simultaneously, yet the codes arrive one at a time. To address this, the translator has a 2-stage shift register: when the code for column 18 in the second stage, the code for column 17 is in the first stage. This also helps address the end-of-line problem, because when the last character of the line is in the second stage, the EOL code will appear in the first.
Getting the timing right took quite a bit of work. The data stream starts with a mode code that indicates whether the line should be printed in black or red, followed by the column 18 code, and proceeds from right to left after that. Until the codes for the mode, column 18, and column 17 have been read there will be no output to the printer. From there until the end of the line, the input from the EP102 emulator and the output to the printer move in lock-step, with the printer being the most likely throttling point but the input could throttle too. When the EOL code appears in the first-stage of the shift register, the code in the second stage gets printed even if there is no more data available from the source. Special cases include the appearance of an EOL code as the first (right-most) code, which necessitates printing a space so the paper feed can occur even though an EP102 blank code wasn't received.
Eventually I worked out a scheme that supports this odd pattern while (hopefully) handling all the possible stalls and not-ready conditions.
No comments:
Post a Comment