Print a picture from a modern PC with an old-fashioned Commodore MPS 803 compatible printer
This utility outputs raw bytes for printing on a Commodore MPS 803 compatible printer. It should be used with opencbm package by Spiro Trikaliotis to redirect the output to the printer, connected through a XUM1541 cable, such as ZoomFloppy.
- source - Source code in C
- cbmage.c - Main program
- stb_image.h - STB library by Sean Barrett for reading image files
- stb_image_resize.h - STB library by Sean Barrett for resizing images
- Makefile - Makefile
- binaries - Precompiled executable files for different platforms
- win32/cbmage.exe - for Windows XP
- win64/cbmage.exe - for Windows 10
- macOS/cbmage - for macOS, 64 bit
- linux64/cbmage - for Linux (x86_64)
- macOS or Windows (32/64 bit) or Linux
- an MPS 803 printer or a compatible one
- XUM1541 / ZoomFloppy
- opencbm package installed (a.k.a. cbm4win)
- gcc if you want to compile from sources
To install opencbm you can use the installer from its website, or if you use a debian-based version of Linux, follow these instructions: http://debian.trikaliotis.net
On macOS you can use this command (with the help of Homebrew Package Manager):
brew install opencbm
Once you have gcc installed, enter the "source" directory and launch:
make
An executable file named "cbmage" will be generated: it's ready to use.
Synopsis:
cbmage <image file name>
This is the basic syntax: it will write on stdout (i.e. the terminal window) the raw bytes that will be interpreted by the MPS 803 printer. Quite useless if not redirected to a real printer.
The typical sequence of commands you should use to do the task is the following:
cbmctrl reset
cbmctrl lock
cbmctrl listen 4 0
./cbmage picture.png | cbmctrl write
cbmctrl unlisten
cbmctrl unlock
In particular, the 4th line (./cbmage picture.png | cbmctrl write
) produces the raw bytes (launch it without "./" if you run it on Windows), which are redirected to the printer through the piped cbmctrl write
command.
- Maximum width on a Commodore MPS 803 is 480 dots per row. Therefore the image will be automatically resized to that width if it exceeds that size.
- The printer is a black and white one. The recommended format is PNG: every single dot which is white (total white:
#ffffff
in hex) will be left blank, while any other pixel color will result in a black dot on the printer.
Thanks to Spiro Trikaliotis for the opencbm package, to Till Harbaum for the initial case study of the XU1541 (and also for the fantastic MIST) and to Sean Barrett for his powerful and effective STB Image Library.