68kMLA Classic Interface

This is a version of the 68kMLA forums for viewing on your favorite old mac. Visitors on modern platforms may prefer the main site.

Click here to select a new forum.
Virtual Imagewriter for very early System software
Posted by: pl212 on 2026-09-26 22:47:57
@stepleton posted a great idea over on the Lisa forums, to intercept serial data from LisaOS and use Apple's own ImageWriter-to-Postscript code, originally intended for the Apple IIgs, to produce a .ps file. This can can then be distilled into a PDF.

I'm interested in this same technique for early Macintosh system software – before the Chooser or even Choose Printer – that assumes only an Imagewriter 1 is hooked up. This could be real hardware or via an emulator such as Snow that allows serial capture/redirection.

As noted in that post, the steps are:

1) Cut this file at line 342, leaving the final _WBJ_, and save as iwem_header.txt
2) Capture the serial output -- I did this by configuring Snow's Printer Port as a TCP bridge and running nc localhost 1985 > iwdata.dat.
3) Strip certain characters -- the original instructions were sed -i '1 s/^\x18*//' iwdata.dat, although I found, perhaps due to macos/gnu utility differences, that I needed to do sed -i '' '1 s/^\x18*//' iwdata.dat
4) Concatenate the two files together with cat iwem_header.txt iwdata.dat > printout.ps
5) Use Acrobat Distiller, ghostscript or other tool to get a PDF.

This initially looked great. I experimented with the three Imagewriter quality settings, and -- as expected -- they all did different things.

Draft is actually just raw text output, with no formatting, and so its journey to Postscript-land rendered it as Courier:
printout-draft.png
A little anachronistic, and with some funky character spacing -- but actually draft spacing problems happened on the real Imagewriter also, as the Mac manual warned you about.

Standard matched most closely the 72dpi screen of the Macintosh itself:

printout-standard.png

And High gives us...

printout-highquality.png

This is perfectly fine, especially since -- if I recall correctly -- "high quality mode" on real hardware is accomplished by moving the printhead a half-dot sideways and printing the same letter again slightly offset. I'm somewhat surprised it actually approximates the same effect all the way into a modern PDF.



But! Something looked a bit off to my eye. And overlaying the Standard PDF with Snow's screen showed the problem:

aspect-overlay.jpg

The printed text was... squished horizontally.

Now, there's always been a weirdness of the Imagewriter having non-proportional DPI: 160 horizontal by 72 vertical. I think that the pins themselves were also slightly rectangular, so perhaps this worked itself out in the end? But there seemed to be some aspect ratio correction, perhaps only relevant in the IIgs context, that was being applied here unnecessarily. The code contained a 0.828125 constant, and that tracked with my eyes feeling everything was 82% as wide as it should be.

Switching that to 1 gives us this result, shown in the same overlay way:

overlay-final.png

This seems like a much better match!

I can't decide if I find it charming, unsettling, or both that the final raster output in my PDF seems to betray a little wobbliness, the kind you might see in a real bidirectional dot-matrix printout:

Screenshot 2026-09-26 at 10.39.35 PM.png

...but at the moment I'm going to leave well enough alone.

I'd like to wrap this code up into some kind of batch script to make this more turnkey, but otherwise I'm really happy to have solved the "1984 output problem" that I've been struggling with for a while. Thanks again to @stepleton and others who provided insight!

(The Pascal code in question is from the first example program in Moll & Folsom's Macintosh Pascal, recommended reading by the authors of the identically-named Apple software package.)

Screenshot 2026-09-26 at 10.43.14 PM.png
Posted by: stepleton on 2026-09-27 04:25:08
Thanks for noticing and well-spotted on the aspect ratio difference; I never saw it!

I love this trick Apple made (specifically, probably someone with the initials WBJ). It's probably obvious to most, but for anyone skimming: Apple wrote an emulator of the ImageWriter printer in PostScript, which is actually a fairly expressive programming language.

The first bit of the .ps file that you make with the procedure described above programs a PostScript printer (or Acrobat, ghostscript, etc.) to run this emulator, and then this emulator is what consumes the ImageWriter data in the rest of the file. What a nice hack!
Posted by: adespoton on 2026-09-27 11:48:12
This sounds like something that could be relatively easily converted into a virtual peripheral for emulators like Snow/MAME/Granny Smith?
Posted by: NJRoadfan on 2026-09-27 13:01:59
WBJ are the initials of the original author of the emulator, William Judd.
Posted by: pl212 on 2026-09-27 19:00:14
Yes, in fact there's an open issue requesting this feature:


And you could do the same with real hardware and a DB9->USB-> modern mac or linux machine.
Posted by: NJRoadfan on 2026-09-27 19:24:24
A C++ ImageWriter II/LQ emulator that uses a SDLSurface for rendering exists in GSport. Someone later separated it from the emulator (something I did years ago but never published), here: https://github.com/greg-kennedy/ImageWriter

The original implementation connected to an emulated serial port on the IIgs.
Posted by: PappaDF on 2026-10-08 12:16:04
This sounds like something that could be relatively easily converted into a virtual peripheral for emulators like Snow/MAME/Granny Smith?

I played around with it in emulator - it does seem to work quite well (with an emulated LaserWriter). However, it was slightly cumbersome to use, so I ended up implementing a built-in ImageWriter model instead.

Example with Lisa2/LisaDraw here: https://youtu.be/7lkppjkcnKE

...and you can try it out with LisaDraw live here: https://pappadf.github.io/gs-pages/...e=lisaem-profile.dc42&imagewriter=imagewriter

(the profile image above comes from archive.org)
Posted by: PappaDF on 2026-10-08 23:45:03
...and you can try it out with LisaDraw live here: https://pappadf.github.io/gs-pages/v0.9.0/?ROM=https://ia600103.us.archive.org/view_archive.php?archive=/21/items/lisa-software/Lisa%20Software.zip&file=Lisa%20Software%2Ffirmware%2F341-0175-H.BIN&ROM=https://ia600103.us.archive.org/view_archive.php?archive=/21/items/lisa-software/Lisa%20Software.zip&file=Lisa%20Software%2Ffirmware%2F341-0176-H.BIN&HD0=https://ia600806.us.archive.org/view_archive.php?archive=/22/items/apple-lisa-profile-hd-disk-images-for-lisaem-and-idle-lisa-office-system-3.1-lis/LisaEM_LOS3.1with7LisaApps.zip&file=lisaem-profile.dc42&imagewriter=imagewriter

Use this link instead (there was a bug in the previous version that hit Windows host): https://pappadf.github.io/gs-pages/...e=lisaem-profile.dc42&imagewriter=imagewriter
1