Reverse-Engineered Minolta Printer Protocol

WARNING: Everything here was reverse-engineered by hairy folks on the net, and hence may cause your printer or spouse to spontaniously explode. We have no relationship to Minolta other than satisfied customers.

Protocol Basics

The 2400W does not speak PostScript, or anything like it. It speaks its own totally proprietary protocol, which luckily was very similar to the protocol spoken by the 2300W, 1200, 1250, 1300, and 1350. I tried to maintain backward compatability in my driver, so min00 may work with any of these printers, but I don't have anything but the 2400W to test with (reports welcome!). The foomatic stuff is currently hardcoded for the 2400W, since I can't figure out how to pass the right command-line option in (e.g., "-m 2300W" for the 2300W).

This Minolta format consists of "esc-commands", which always have a header consisting of 7 bytes, plus at least 1 byte of command data:

  1. The escape byte 0x1B.
  2. CMD: a "command byte". See command types listed below.
  3. A command count byte. This is a counter that starts at 0 for the file's first command, and increases by 1 for each command thereafter.
  4. LEN: a two-byte packet data length, in little-endian format.
  5. CMD^0xff: The command byte again, but with the bits inverted 0-1.
  6. LEN bytes of arbitrary packet data, interpreted by the command.
  7. A checksum, computed as the mod-256 sum of everything sent so far including the escape byte.

Known CMD command bytes include:

For some reason, the raster data is divided into 8 separate "raster data" chunks for each output plate. It's not clear if this is a hardware requirement, or just superstition based on the Windows driver.

Image Encoding

What the printer wants is actually quite simple--the engine just needs a full-page 1200x600 bitmap per page. For color, you just send a separate bitmap for Yellow, Magenta, Cyan, and Black toner (in that funky order). Luckily, with Foomatic the production of this bitmap is handled by GhostScript, and min00 (a Foomatic "filter") is passed in fully-rasterized PBM images of each page, just "cat"'d together into one long stream. For color, the page images are passed in from ghostscript in "pksmraw" format, which seems to just be Cyan, Magenta, Yellow, and Black (note the order) PBM images catted together.

The only complexity is that the printer encodes the page bitmaps using a clever but bizarre run-length encoding scheme. The image pixels are stored in the PBM or output image as bits (1 for white; 0 for black/toner). But the image data is then run-length encoded as bytes; hence taking 8 adjacent pixels at once.

The run-length encoding used is funky. You send data one row at a time. Each row of data starts with a start byte and a table with up to 16 entries of pixel bytes. The start byte is equal to the number of table entries plus 0x80, and the table entries are used in the "table data" compression scheme below. The remaining data is encoded as:

I don't know what bytes 0x00, 0x40, 0x80, or 0xc0 do. Possibly nothing.

For the 2400W, the default mode seems to compress "interleaved" scanlines, made of alternating bytes from two adjacent input scanlines. For example, input scanlines "0xa1 0xa2 0xa3" and "0xb1 0xb2 0xb3" would be compressed as a single double-width scanline "0xa1 0xb1 0xa2 0xb2 0xa3 0xb3". I'm not clear whether other printers also support this interleaved mode, or if it's possible to turn off interleaved mode for the 2400W, possibly via some wierd CMD byte above.

The min00 driver includes a rough little utility called "min_decode.c" that takes a Minolta esc-file and produces a PPM output image. It dumps out the various esc-headers it encounters, and creates an output image. See "min00/test/README.txt" for an example of how to use min_decode. You should be able to run this program on any output file from any comparable Minolta driver, or even the .prn files from the Windows driver (from "Save to file" in the print dialog box).


Back to min00 driver main page

Orion Lawlor, olawlor@acm.org