I am trying to get a C Program to print to my printer.
However, I don't want to use fprintf(stdprn,"message").
I am trying to write directly to the printer, using outportb.
I can initialise the printer, and bring it into (what I assume is a) data receival state, with paper drawn in.
However, I cannot actually get the printer to print the data I send to it; it will only linefeed afterwards, and throw the paper out.
The code I have is this:
#define DATA 0x378
#define CONTROL DATA+2
outportb(CONTROL, 0xC); /*Reset*/
outportb(CONTROL, 0x7); /*Draw Paper*/
outportb(CONTROL, 0xA0); /*Data Ready Mode*/
outportb(DATA, "THIS IS A TEST MESSAGE"); /*My message*/
outportb(DATA, '\n'); /*Line return*/
outportb(DATA, '\f'); /*Linefeed*/
outportb(CONTROL, 0xFF); /*Clear and eject paper, also RESET*/
This resets the printer, draws paper in, and puts the printer in DATA mode.
However, it doesn't print THIS IS A TEST MESSAGE.
All it does is print the line return, and linefeed.
It then resets the printer, and throws the paper out.
How can I get it to print the message as well?