Saturday, June 28, 2014

Epson JX-80 Javascript Interpreter

After writing a Epson JX-80 graphics interpreter in QBasic, I figured that I should make one in javascript. It only interprets the ESC L 120 dpi graphics and not regular text printing. If I wanted to do regular text I reckon I'd have to duplicate the Epson font in the rom. The manual gives a full table of the rom characters if I remember correctly.

I did find some javascript problems with firefox. Performance under firefox was abysmal when I was using canvas2d getImageData(x,y,1,16). It was horribly slow, in fact totally unusable. After trying to get it to work with firefox and failing, I tried Chromium and it absolutely flew in comparison. The slowdown under firefox was around 100x slower.

My workaround is to use getImageData on a larger block size and that seemed to help tremendously.

Another bug is that firefox seems to have some numerical precision problems as I get a single pixel blank line gap near the bottom of my text sample. Again, Chromium doesn't have this issue.


I can't figure out why it has a gap here...




When I have more time, I may make it work on more than a single page at a time so that when it hits an FF it'll clear the canvas for the next page in the stream. Maybe I'll also upload the super-slow version that brings firefox to a crawl so you can see the difference.



Sample text rendered with firefox, note the gap in the last line of text.



Chromium renders the sample text perfectly, with no gap line.



JX-80 Javascript Interpreter

4 comments:

  1. I had to give this a shot, so I fired up a Windows NT VM, installed the Epson JX-80 driver, had it print to a file, and uploaded it to the page, and got some output. Printing at 240x144 resolution gives me the following error:

    ESC unrecognized ESC code 90

    But knocking it down to 120x144 gives me some output! Although for some reason my colour printout (well I think it should be in colour) comes out in black and white. But it does work!

    Printing the NT test page prints the graphical part (again no colour) but chokes I guess when it's switching to a built in font?

    unrecognized code at (14411 input=67) exiting...

    But It's still incredible to watch the virtual printer render the job. You can almost hear the print head going nuts doing it's thing.

    http://virtuallyfun.superglobalmegacorp.com/wordpress/wp-content/uploads/2014/12/Virtual-Epson-JX-80.png

    For how the NT print job looks.

    ReplyDelete
  2. Do you by chance have your JS printer emulators archived anywhere? The links on your blog to them no longer work.

    ReplyDelete
  3. I've put them up at
    http://ptouchman.weebly.com/blog
    since googledrive doesn't do web serving anymore.

    ReplyDelete