Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Commodore » Commodore 8-bit » Printing on Commodore printer without Commodore 64
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Printing on Commodore printer without Commodore 64 [message #349708] Sat, 29 July 2017 04:42 Go to next message
Rami is currently offline  Rami
Messages: 27
Registered: February 2012
Karma: 0
Junior Member
Hello fine Commodore people,

I have Commodore MPS 803 printer (I think it is 803, it is in the storage at the moment) and have been toying with the idea of hooking it up to Raspberry Pi or similar... And later maybe even add a CUPS driver and allow remote printing.

I think I did try to dig up information for this couple of years ago and came to understand that the printer serial protocol is non-standard and documentation for it is hard to find. Someone also mentioned some Nuts and Volts article but I was unable to get it from the publisher.

So I would appreciate any information on C64 serial printer protocol / modern tools / github repos / whatever you can provide.

Thanks!


--
Rami Saarinen
Re: Printing on Commodore printer without Commodore 64 [message #349758 is a reply to message #349708] Sun, 30 July 2017 00:26 Go to previous messageGo to next message
Pekka Takala is currently offline  Pekka Takala
Messages: 73
Registered: March 2012
Karma: 0
Member
On 29.07.2017 11:42, Rami wrote:
> Hello fine Commodore people,
>
> I have Commodore MPS 803 printer (I think it is 803, it is in the storage at the moment) and have been toying with the idea of hooking it up to Raspberry Pi or similar... And later maybe even add a CUPS driver and allow remote printing.
>
> I think I did try to dig up information for this couple of years ago and came to understand that the printer serial protocol is non-standard and documentation for it is hard to find. Someone also mentioned some Nuts and Volts article but I was unable to get it from the publisher.
>
> So I would appreciate any information on C64 serial printer protocol / modern tools / github repos / whatever you can provide.
>
> Thanks!
>
>
The protocol is essentially the same protocol as commodore 1541 disk
drive protocol is. The printer just uses device number 4 instead of 8.

Trust me, it is much easier to find a suitable matrix printer for your
PC than to attach the commodore printer to your pc. The cbm protocol is
very tight in timing.

Sell the printer to someone c64/vic20/c128 enthusiast.
Re: Printing on Commodore printer without Commodore 64 [message #349763 is a reply to message #349758] Sun, 30 July 2017 04:48 Go to previous messageGo to next message
Rami is currently offline  Rami
Messages: 27
Registered: February 2012
Karma: 0
Junior Member
On Sunday, July 30, 2017 at 7:26:50 AM UTC+3, Pekka Takala wrote:
> On 29.07.2017 11:42, Rami wrote:
>> Hello fine Commodore people,
>>
>> I have Commodore MPS 803 printer (I think it is 803, it is in the storage at the moment) and have been toying with the idea of hooking it up to Raspberry Pi or similar... And later maybe even add a CUPS driver and allow remote printing.
>>
>> I think I did try to dig up information for this couple of years ago and came to understand that the printer serial protocol is non-standard and documentation for it is hard to find. Someone also mentioned some Nuts and Volts article but I was unable to get it from the publisher.
>>
>> So I would appreciate any information on C64 serial printer protocol / modern tools / github repos / whatever you can provide.
>>
>> Thanks!
>>
>>
> The protocol is essentially the same protocol as commodore 1541 disk
> drive protocol is. The printer just uses device number 4 instead of 8.
>
> Trust me, it is much easier to find a suitable matrix printer for your
> PC than to attach the commodore printer to your pc. The cbm protocol is
> very tight in timing.
>
> Sell the printer to someone c64/vic20/c128 enthusiast.

Thanks Pekka. If the timing is as tight as you say I might just let this be for now. The idea was basically just hook up something almost useless to modern computer setting for fun and laughs.

I do have (I think) two Commodore 64s (and 2*A500, A500+ and A1200) so I think I keep the printer, find some continuous feed paper for it and hook it up to C64. :)

--
Rami
Re: Printing on Commodore printer without Commodore 64 [message #349792 is a reply to message #349763] Sun, 30 July 2017 18:10 Go to previous messageGo to next message
Andreas Kohlbach is currently offline  Andreas Kohlbach
Messages: 1456
Registered: December 2011
Karma: 0
Senior Member
On Sun, 30 Jul 2017 01:48:55 -0700 (PDT), Rami wrote:
>
> On Sunday, July 30, 2017 at 7:26:50 AM UTC+3, Pekka Takala wrote:
>> On 29.07.2017 11:42, Rami wrote:
>>> Hello fine Commodore people,
>>>
>>> I have Commodore MPS 803 printer (I think it is 803, it is in the
>>> storage at the moment) and have been toying with the idea of
>>> hooking it up to Raspberry Pi or similar... And later maybe even
>>> add a CUPS driver and allow remote printing.
>>>
>>> I think I did try to dig up information for this couple of years
>>> ago and came to understand that the printer serial protocol is
>>> non-standard and documentation for it is hard to find. Someone
>>> also mentioned some Nuts and Volts article but I was unable to get
>>> it from the publisher.
>>>
>>> So I would appreciate any information on C64 serial printer
>>> protocol / modern tools / github repos / whatever you can provide.
>>>
>>> Thanks!
>>>
>>>
>> The protocol is essentially the same protocol as commodore 1541 disk
>> drive protocol is. The printer just uses device number 4 instead of 8.
>>
>> Trust me, it is much easier to find a suitable matrix printer for your
>> PC than to attach the commodore printer to your pc. The cbm protocol is
>> very tight in timing.
>>
>> Sell the printer to someone c64/vic20/c128 enthusiast.
>
> Thanks Pekka. If the timing is as tight as you say I might just let
> this be for now. The idea was basically just hook up something almost
> useless to modern computer setting for fun and laughs.

Not really related. In the early 2000s I bought a Star NL-10 dot matrix
impact printer from Micronics to my Linux box, which I shot at the local
flea market for $5. It didn't take five minutes for the landlord, who
lived in the same building (which is already bad in itself ;-) to knock
at the door and ask WTF am I doing. *g* If it was 20 years earlier (the
80s) no one would had cared about the noise it produced. But it was fun.

Btw. I have forgotten how I get it running. The PC then had a parallel
port and it seems Linux just served the printer right.

> I do have (I think) two Commodore 64s (and 2*A500, A500+ and A1200) so
> I think I keep the printer, find some continuous feed paper for it and
> hook it up to C64. :)

I have no real hardware, only emulate the C64 and Amiga. I once tried to
print from The Print Shop from the C64 to the Linux host via CUPS the
emulator (VICE) runs on. But I set it up wrong and the result was messed
up 50% of the time, the other 50% the emulator crashed when printing.
--
Andreas
You know you are a redneck if
your favorite hangout is the phillips 66 near the freeway.
Re: Printing on Commodore printer without Commodore 64 [message #367339 is a reply to message #349708] Mon, 07 May 2018 09:53 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: sblendorio

Il giorno sabato 29 luglio 2017 10:42:36 UTC+2, Rami ha scritto:

> So I would appreciate any information on C64 serial printer
> protocol / modern tools / github repos / whatever you can provide.

Printing text is quite simple. All you need is a XUM1541 cable (it's an effective PCB card - adapter that let you connect any IEC device to USB ports), the cost is about 30€. Then just download the package "opencbm", here is some example of usage:

http://opencbm.trikaliotis.net/opencbm-17.html

here is a video I made recently:

https://www.youtube.com/watch?v=ffKstbCI7QU
Re: Printing on Commodore printer without Commodore 64 [message #367366 is a reply to message #367339] Mon, 07 May 2018 17:35 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: sblendorio

Il giorno lunedì 7 maggio 2018 15:54:00 UTC+2, sblen...@gmail.com ha scritto:

> Printing text is quite simple.

You can also print graphics. This is an example of what you can do:
https://imgur.com/a/gyxkkqk

I did it writing a simple "driver" in Java that converts images (for now in black and white, with white background) into commands for the Commodore MPS 803 printer:


package eu.sblendorio;

import javax.imageio.ImageIO;
import java.awt.image.*;
import java.io.File;
import java.io.IOException;

public class Main {

public static void main(String[] args) throws IOException {
if (args.length == 0) System.exit(1);
final String filename = args[0];
File f = new File(filename);
BufferedImage bi = ImageIO.read(f);

print(bi);
}

static int getPixel(BufferedImage bi, int x, int y) {
final int w = bi.getWidth();
final int h = bi.getHeight();

if (x >= w || y >= h || x < 0 || y < 0)
return 0;

final boolean pixel = bi.getRGB(x, y) != -1;
return pixel ? 1 : 0;
}

static void print(BufferedImage bi) {
final int pow[] = {1, 2, 4, 8, 16, 32, 64};
final int w = bi.getWidth();
final int h = bi.getHeight();
int rows = h / 7 + (h % 7 == 0 ? 0 : 1);
System.out.write(8);
for (int row=0; row<rows; ++row) {
for (int x=0; x<w; ++x) {
int code = 128;
for (int dy=0; dy<7; ++dy) {
final int pixel = getPixel(bi, x,(row * 7) + dy);
code += pow[dy]*pixel;
}
System.out.write(code);
}
System.out.write(13);
}
System.out.write(15);
System.out.write(13);
}
}
Re: Printing on Commodore printer without Commodore 64 [message #367386 is a reply to message #367366] Tue, 08 May 2018 06:55 Go to previous messageGo to next message
Rami is currently offline  Rami
Messages: 27
Registered: February 2012
Karma: 0
Junior Member
Awesome! I'll have a look as soon as possible.



On Tuesday, May 8, 2018 at 12:35:42 AM UTC+3, sblen...@gmail.com wrote:
> Il giorno lunedì 7 maggio 2018 15:54:00 UTC+2, sblen...@gmail.com ha scritto:
>
>> Printing text is quite simple.
>
> You can also print graphics. This is an example of what you can do:
> https://imgur.com/a/gyxkkqk
>
> I did it writing a simple "driver" in Java that converts images (for now in black and white, with white background) into commands for the Commodore MPS 803 printer:
>
>
> package eu.sblendorio;
>
> import javax.imageio.ImageIO;
> import java.awt.image.*;
> import java.io.File;
> import java.io.IOException;
>
> public class Main {
>
> public static void main(String[] args) throws IOException {
> if (args.length == 0) System.exit(1);
> final String filename = args[0];
> File f = new File(filename);
> BufferedImage bi = ImageIO.read(f);
>
> print(bi);
> }
>
> static int getPixel(BufferedImage bi, int x, int y) {
> final int w = bi.getWidth();
> final int h = bi.getHeight();
>
> if (x >= w || y >= h || x < 0 || y < 0)
> return 0;
>
> final boolean pixel = bi.getRGB(x, y) != -1;
> return pixel ? 1 : 0;
> }
>
> static void print(BufferedImage bi) {
> final int pow[] = {1, 2, 4, 8, 16, 32, 64};
> final int w = bi.getWidth();
> final int h = bi.getHeight();
> int rows = h / 7 + (h % 7 == 0 ? 0 : 1);
> System.out.write(8);
> for (int row=0; row<rows; ++row) {
> for (int x=0; x<w; ++x) {
> int code = 128;
> for (int dy=0; dy<7; ++dy) {
> final int pixel = getPixel(bi, x,(row * 7) + dy);
> code += pow[dy]*pixel;
> }
> System.out.write(code);
> }
> System.out.write(13);
> }
> System.out.write(15);
> System.out.write(13);
> }
> }
Re: Printing on Commodore printer without Commodore 64 [message #367691 is a reply to message #367386] Tue, 15 May 2018 05:16 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: francesco.sblendorio

Here is a ready-to-use solution for printing PNG images:

https://github.com/sblendorio/cbmage

I rewrote it in C (gcc). Compatible with Windows-Linux-macOS
Re: Printing on Commodore printer without Commodore 64 [message #368555 is a reply to message #367386] Sun, 03 June 2018 16:49 Go to previous message
Anonymous
Karma:
Originally posted by: sblendorio

Now, also for UNICODE text, for MPS 803:

https://github.com/sblendorio/cbmtext
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: CBMTEXT: Print international text filesystem with MPS803
Next Topic: Something strange going on.
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Mar 28 09:01:28 EDT 2024

Total time taken to generate the page: 0.19862 seconds