Printer replacement

General "chat", not necessarily MTX related
Post Reply
Bill B
Posts: 338
Joined: 26 Jan 2014 16:31

Printer replacement

Post by Bill B »

I ran across a reference to this in the Raspberry Pi forums. It might be of interest to anyone without a working Centronics printer.

Probably not too difficult for a hardware hacker to knock-up their own version.
User avatar
1024MAK
Posts: 702
Joined: 24 Dec 2012 03:01
Location: Looking forward to summer, in Somerset, UK

Re: Printer replacement

Post by 1024MAK »

Bill B wrote: 05 May 2020 10:49 I ran across a reference to this in the Raspberry Pi forums. It might be of interest to anyone without a working Centronics printer.
Yes, that’s exactly what the Retro-Printer Module is for.

RWAP Software page about printers and printing
Bill B wrote: 05 May 2020 10:49Probably not too difficult for a hardware hacker to knock-up their own version.
Whoa, don’t let Rich Mellor (of RWAP Software and www.sellmyretro.com) hear you say that! He’s been working on this project for years!

As I understand it, the hardware side is the easy bit. The most complex part is the software.

If the printer you want to use is a low cost modern type, most of the intelligence is in the software driver running on the attached PC. This is rather different to the older generation of printers that could receive both text and various control codes, and which would then process the data and build up the image in the printers own onboard memory, and then print it. With modern low cost printers, it is the driver software running on the PC that does all the page formatting work. It then just sends the pixel data to the printer in a format that can be used directly by the printers hardware to print the page.

Mark
Bill B
Posts: 338
Joined: 26 Jan 2014 16:31

Re: Printer replacement

Post by Bill B »

The hardware is providing an interface to a Raspberry Pi. On the RPi you have all the Linux printer support.

The software part is not that difficult.

I have written something similar, but on a Windows PC. My father had a number of programs that he had written in GW-BASIC. Now GW-BASIC is convinced that all printers are on LPT1. So I wrote two pieces of software:
  • A reflection device driver, which received the characters written to LPT1, buffered them and then reflected them back into user space.
  • A program which read the characters from the driver and used Windows GDI calls to construct the pages. This recognised most of the Epsom escape codes, also much of HPGL.
The software is no longer usable as the reflection driver was written for XP, and the driver structure got revised for Vista.

If doing this today I would probably use DOSEMU or similar instead. Alternately, there is an emulation of GW-BASIC written in Python, from which you can redirect the printer output.

Perhaps not quite so easy on Linux which does not have a consistent Printer GDI. I would probably use WX-Widgets, where others have already done the hard work.
User avatar
1024MAK
Posts: 702
Joined: 24 Dec 2012 03:01
Location: Looking forward to summer, in Somerset, UK

Re: Printer replacement

Post by 1024MAK »

Sounds like you know your stuff.

I think the difficulty Rich was having, is trying to support so many different old computers and especially their graphical outputs. Then getting the printer driver to print a good representation on the modern printer.

He also wants to support ZX81 and ZX Spectrum computers printing to (what they think is) a Sinclair ZX Printer (which uses its own custom interface).

Mark
Bill B
Posts: 338
Joined: 26 Jan 2014 16:31

Re: Printer replacement

Post by Bill B »

ZX81 / Spectrum printer is certainly not a Centronics interface.

If I remember correctly it a simple raster output. Back in the day I created a fairly simple interface (no Microcontroller) that emulated the Sinclair printer and printed on a till-roll printer. It did rely on the particular printer I was using having a suitable raster printing mode.
stephen_usher
Posts: 238
Joined: 27 Nov 2016 19:58

Re: Printer replacement

Post by stephen_usher »

1024MAK wrote: 06 May 2020 15:59 As I understand it, the hardware side is the easy bit. The most complex part is the software.

If the printer you want to use is a low cost modern type, most of the intelligence is in the software driver running on the attached PC. This is rather different to the older generation of printers that could receive both text and various control codes, and which would then process the data and build up the image in the printers own onboard memory, and then print it. With modern low cost printers, it is the driver software running on the PC that does all the page formatting work. It then just sends the pixel data to the printer in a format that can be used directly by the printers hardware to print the page.

Mark
This is actually going back to the very earliest, pre-Postscript laser printers. The Atari SLM804 was just such a printer (as was the Sun SPARCprinter).
User avatar
1024MAK
Posts: 702
Joined: 24 Dec 2012 03:01
Location: Looking forward to summer, in Somerset, UK

Re: Printer replacement

Post by 1024MAK »

Yes, and for exactly the same reason, to keep the cost of the printer as low as possible. Why put expensive RAM in a printer when you can use existing RAM in the computer ;)

I was a poor student at the time, so my Atari STFM only ever had a Star LC10 connected to it.

Mark
Post Reply