I made a virtual dot matrix printer

Sdílet
Vložit
  • čas přidán 26. 05. 2024
  • Over the weekend, I wrote a program that I found rather interesting. It’s a program that emulates a very simple dot matrix printer.
    Get it here:
    github.com/freedosproject/vp
    Visit our website
    www.freedos.org/
    Join us on Facebook
    / freedosproject
    Follow us on Mastodon
    fosstodon.org/@freedosproject
    Consider supporting me on Patreon
    / freedos
    And don't forget to Like and Subscribe!
    Standard comment rules apply.
  • Věda a technologie

Komentáře • 30

  • @zirize
    @zirize Před měsícem +11

    About two decades ago, I was working on POS software for a company. At that time, most receipt printers used RS232 communication, and I remember a project where we created virtual printer based on communication data generated by the PC's RS232 port. The purpose was to test whether software outputs were accurate without actually using a printer.

    • @freedosproject
      @freedosproject  Před měsícem +3

      That's a great project - and practical!

    • @monad_tcp
      @monad_tcp Před měsícem

      That's was a cool idea, when I had that problem, I wrote a table of command translation between the matrix printer and ESC/P so I could just send the thing to a fast laser printer, It was very fast to make tests, but wasted paper.

  • @ahmad-murery
    @ahmad-murery Před měsícem +3

    I and my friend worked together to replace an old (1-pin with 9 colors ribbon) dot printer which was a part of scintigraphy thyroid scanner.
    this scanner was built as a tank and it prints as it scanning, the printer and the sensor mounted on one big moving arm and it prints directly on a paper laid down and held on a metal plate using adhesive tape , you really have to see it 😁🤦‍♂
    The reason to do the app is that the stock ran out from compatible ink ribbons
    The problem was it doesn't output any digital signals to rely on and al what we got is analog sound generator producing a wave depending on the strength of the radiation detected by the sensor.
    My friend designed an electronic interface circuit to convert these waves to something our program can read via RS232, and I built the app to mimic the output of the printer in order to print it on a modern inkjet printer.
    Thanks Jim, you bring back so many memories

    • @freedosproject
      @freedosproject  Před měsícem +1

      That project sounds pretty awesome!

    • @ahmad-murery
      @ahmad-murery Před měsícem

      @@freedosproject It was indeed, we enjoy doing it to revive an old machine.
      Thanks for the great reply Jim

  • @mlongval
    @mlongval Před měsícem +5

    Thanks for this Jim. I always find your videos very interesting. Keep up the great work. Cheers from Canada!

  • @gingered
    @gingered Před měsícem +2

    I would have thought converting the character set would be much more involved, this is very cool!
    I had a moment to think about it, and I think it will be 30 years this year since I last used a dot matrix printer. The sound as it tracks across the sheet and advances rows is very nostalgic.

    • @freedosproject
      @freedosproject  Před měsícem +1

      The old dot matrix sound was kind of soothing, in a way. 😄

    • @gingered
      @gingered Před měsícem

      @@freedosproject it helps that now it doesn't come with a parent shouting "stop that screeching!" from the next room 😃

    • @skilletpan5674
      @skilletpan5674 Před měsícem +1

      ​@@freedosprojectI still remember the IBM pro printer. Such a nice sound.

    • @andimachovec2719
      @andimachovec2719 Před měsícem

      @@skilletpan5674 : Legendary!

  • @williefleete
    @williefleete Před měsícem +1

    In amongst my stuff I have the manual for the star NX1000 mono dot matrix printer, The manual includes some BASIC listings for testing the capabilities of the printer, including user defined characters. Maybe include support for sending “escape” codes (char 27) for enabling underline, sending data for user defined characters, etc

    • @freedosproject
      @freedosproject  Před měsícem

      My printer at the time was Epson, and Epson printers had that ESC/P print control. The name actually comes from Epson Standard Code for Printers because Epson made it.
      I hope to update this in future to add ESC/P print control like underline and even graphics mode.

  • @brucetungsten5714
    @brucetungsten5714 Před měsícem

    Great video!

  • @LordHog
    @LordHog Před měsícem

    Very cool

  • @wherami
    @wherami Před měsícem

    most excellent

  • @kelli217
    @kelli217 Před měsícem +2

    Too bad that delay() requires an integer argument. Otherwise you could adjust the delay to something closer to, say, an Epson LX.

    • @freedosproject
      @freedosproject  Před měsícem +2

      One way to slow it down to a fraction of a millisecond would be to use a counter, and then you add the delay for every 2nd or 3rd byte. A live human might not spot the difference. Basically this:
      int count = 0;
      ...
      if ((++count % 3) == 0) {
      delay(1);
      count=0;
      }

    • @monad_tcp
      @monad_tcp Před měsícem

      Also needs sound emulation.

  • @rwoliver2
    @rwoliver2 Před měsícem +1

    This is awesome. I wonder how difficult it would be to redirect output to LPT1 to this as a TSR?

    • @ssl3546
      @ssl3546 Před měsícem

      Depends if you already have a robust TSR framework to build on, there's just a few int 21 calls to intercept and you'd have to parse pathnames for 3Dh. Making a TSR that knows when it can take over the system is the tricky part, and it would need to be quite big for the graphics buffer.

    • @fnjesusfreak
      @fnjesusfreak Před měsícem

      @@ssl3546 It's actually not int21, but int17 (AH=0 lpt_putch, AH=1 lpt_init, AH=2 lpt_status).

    • @freedosproject
      @freedosproject  Před měsícem +2

      I think an easier way would be to redirect printing to a file (many DOS word processors can already do that) and then use this to "print" it to the screen.

  • @raxadian
    @raxadian Před 6 dny

    I still have a dot matrix printer dunno if works.

  • @Kyoz
    @Kyoz Před měsícem

    🤍

  • @DanielLenskiy
    @DanielLenskiy Před měsícem

    What is purpose of this program, because result is clearly unreadable...

    • @NextMomentOnEarth
      @NextMomentOnEarth Před měsícem

      15:23 it's mostly a demonstration of the way dot matrix printers work without wasting paper on several demonstrations