Menu

#43 Dot-matrix printer emulation

open
Qbix
None
5
2014-08-16
2004-02-17
No

This patch adds the emulation of a full-fledged
black/white 48-dot matrix printer supporting ESC/P and
ESC/P2 to DOSBOX.

ESC/P(2) were the quasi-standards for matrix printers,
so the printer is able to emulate most 24/48-dot printers
from EPSON and other manufacturers.

The printer offers different paper sizes, resolutions and
output methods which can be selected in the DOSBOX
config file.

The Freetype2 (www.freetype.org) library and TrueType
fonts (GPL'ed ones included in the patch) are required to
render characters.

Besides the actual printer emulation, this patch adds a
few features to existing code in order to enable
programs to actually contact the printer:

  • BIOS "printer" interrupt 17

  • LPTn DOS device

  • Support for getting a device handler by creating it
    (DOS_CreateFile)

  • Dummy versions of the DOS-IOCTL functions 0x01 and
    0x0A (dos_ioctl.cpp)

  • DOS function "Write Character to PRINTER" (0x05)

Discussion

  • Frederic Weymann

    Logged In: YES
    user_id=954262

    The fonts are too big to be attached here, so I posted them
    in the forum:

    http://vogons.zetafleet.com/viewtopic.php?p=32371#32371

     
  • Frederic Weymann

    Logged In: YES
    user_id=954262

    I added a few extra features:

    • Output of created pages as postscript

    • Multipage support (more than one page per
      postscript/printer job)

    • Alt-F8 no longer "ejects" a page that is blank

     
  • Frederic Weymann

     
  • TaeWoong Yoo

    TaeWoong Yoo - 2005-08-08

    Logged In: YES
    user_id=844698

    I couldn't compile with your patch.
    There was a compile error.


    printer.cpp: In function void PRINTER_Init(Section*)': printer.cpp:2191: error: invalid conversion fromvoid ()
    (Bit32u, Bit8u)' to void (*)(Bitu, Bitu, Bitu)'printer.cpp:2191: error: initializing argument 2 ofvoid IO_RegisterWriteHandler
    (Bitu, void (
    )(Bitu, Bitu, Bitu), Bitu, Bitu)'
    printer.cpp:2191: error: invalid conversion from const char*' toBitu'
    printer.cpp:2191: error: initializing argument 3 of void IO_RegisterWriteHandler(Bitu, void (*)(Bitu, Bitu, Bitu), Bitu, Bitu)' printer.cpp:2192: error: invalid conversion fromBit8u ()
    (Bit32u)' to Bitu (*)(Bitu, Bitu)' printer.cpp:2192: error: initializing argument 2 ofvoid
    IO_RegisterReadHandler(Bitu, Bitu (
    )(Bitu, Bitu), Bitu, Bitu)'
    printer.cpp:2192: error: invalid conversion from const char*' toBitu'
    printer.cpp:2192: error: initializing argument 3 of void IO_RegisterReadHandler(Bitu, Bitu (*)(Bitu, Bitu), Bitu, Bitu)' printer.cpp:2193: error: invalid conversion fromvoid ()
    (Bit32u, Bit8u)' to void (*)(Bitu, Bitu, Bitu)'printer.cpp:2193: error: initializing argument 2 ofvoid IO_RegisterWriteHandler
    (Bitu, void (
    )(Bitu, Bitu, Bitu), Bitu, Bitu)'
    printer.cpp:2193: error: invalid conversion from const char*' toBitu'
    printer.cpp:2193: error: initializing argument 3 of void IO_RegisterWriteHandler(Bitu, void (*)(Bitu, Bitu, Bitu), Bitu, Bitu)' printer.cpp:2194: error: invalid conversion fromBit8u ()
    (Bit32u)' to Bitu (*)(Bitu, Bitu)' printer.cpp:2194: error: initializing argument 2 ofvoid
    IO_RegisterReadHandler(Bitu, Bitu (
    )(Bitu, Bitu), Bitu, Bitu)'
    printer.cpp:2194: error: invalid conversion from const char*' toBitu'
    printer.cpp:2194: error: initializing argument 3 of void IO_RegisterReadHandler(Bitu, Bitu (*)(Bitu, Bitu), Bitu, Bitu)' printer.cpp:2196: error:KBD_MOD_ALT' undeclared (first
    use this function)
    printer.cpp:2196: error: (Each undeclared identifier is reported
    only once for each function it appears in.)
    printer.cpp:2196: error: `KEYBOARD_AddEvent' undeclared
    (first use this function)


    The same result with floams's.
    http://vogons.zetafleet.com/viewtopic.php?
    t=4281&postdays=0&postorder=asc&start=40

     
  • Mark Junker

    Mark Junker - 2008-08-23

    Logged In: YES
    user_id=995396
    Originator: NO

    I updated the virtual printer patch to make it compilable with the latest sources. I did not change any of the internal logic. I'll make it available soon.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.