joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.81k stars 383 forks source link

Config file details for printing to dot matrix via a parallel port #3324

Open AdvGK opened 2 years ago

AdvGK commented 2 years ago

Code of Conduct & Contributing Guidelines

Have you checked that no other similar question(s) already exists?

Question

I'm running the 0.83.22 build within a Win10 64 bit OS. Our Oki 320 dot matrix is connected via a parallel port card (SIIG ECP/EPP PCIe card). I have worked with various fonts in the specified folder under the Printer config section and ttf section printfont=false, all the output is just not acceptable - misinterpreted characters, overlapping characters, etc. Even the default printing is resulting in poor output.

I can see that the output is being interpreted by the OKI as a scalable courier, but what I would like is for it to be output and result in the printing of one of its basic ascii characters. Perhaps I have configured the parallel and printer sections incorrect to achieve this result, so I'm searching for some guidance. The difficulty that I have is that I'm doing all this remotely, so I don't have access to the printer - I have an onsite person tell me what they see and it is been inefficient at best.

So, I wanted to revisit my assumptions, which were built from reading all the great instructions, forums, etc.

If I wanted DOSBOX-X to send a print job that resulted in just ASCII characters to be generated by the non-scalable fonts (the standard Xpitch characters) and avoid any scalable font (only two loaded on this OKI) is this config correct or not? NOTE: I have to timeout set due to a lag issue with the first print job being sent for this application. The higher timeout solved the "disappearing" print job.

Thank you for your time and input.

[parallel] parallel1 = printer

[printer] printer = true dpi = 360 width = 85 height = 110 printoutput = printer multipage = false device = - docpath = . fontpath = fonts openwith = openerror = printdbcs = auto shellhide = false timeout = 3500

AdvGK commented 2 years ago

As follow-up, under the original deployment of this app on a Win XP computer with direct parallel connection to printer, the print jobs always resulted in just ASCII characters being generated. Since this 16 and 32 bit app will no longer function under Win10, I have been trying to deploy the app via DOSBOX-X. Thank you.

rderooy commented 2 years ago

If you set parallel1=printer, then dosbox-x will emulate an Epson printer and your printer will output in graphics mode. If you don't want that to happen and you want to use the built-in fonts of your OKI printer then you should not use the Epson emulation.

Have a look at the wiki on this subject.

AdvGK commented 2 years ago

For that setting, parallel should be disabled (bypass emu) or reallpt (since there is a real lpt that is being traversed)? I ask the latter, even though I think it is the former, because the wiki states:

Used to specify that you want to redirect the output to a real physical port on the host PC. You will need to use this if you have for instance a parallel port security dongle, but can be used with any parallel device supported by your dos application.

But I understand that setting to reallpt is just to pass emulation through a LPT port, which for my needs isn't what is required, so I will set it to disabled.

I appreciate your input. I will make this change and do a test.

rderooy commented 2 years ago

parallel1=disabled as mentioned on the wiki, will disable the parallel port and you will no longer be able to print to it from a DOS application.

Again, have a look at the wiki. https://dosbox-x.com/wiki/Guide%3ASetting-up-printing-in-DOSBox%E2%80%90X#_example_printing_to_a_real_printer

AdvGK commented 2 years ago

parallel1=disabled as mentioned on the wiki, will disable the parallel port and you will no longer be able to print to it from a DOS application.

Again, have a look at the wiki. https://dosbox-x.com/wiki/Guide%3ASetting-up-printing-in-DOSBox%E2%80%90X#_example_printing_to_a_real_printer

I appreciate your efforts, but this is exactly how it was configured, but resulted in the problem cited in the OP.

Here is a summary of the config file, cited in the original post, that results in the print output to be graphics mode and interpreted by the printer as a scalable font (courier), instead of a request to print one of its ascii characters.

[parallel] parallel1 = printer

[printer] printer = true dpi = 360 width = 85 height = 110 printoutput = printer multipage = false device = - docpath = . fontpath = fonts openwith = openerror = printdbcs = auto shellhide = false timeout = 3500

AdvGK commented 2 years ago

If you set parallel1=printer, then dosbox-x will emulate an Epson printer and your printer will output in graphics mode. If you don't want that to happen and you want to use the built-in fonts of your OKI printer then you should not use the Epson emulation.

Have a look at the wiki on this subject.

Once again, appreciate the effort, but I don't want it output in graphics mode, I want it output in a mode that the printer will interpret as ascii. Graphics mode has the printer interpreting the output as a scalable ttf font and that results in non-ideal output.

AdvGK commented 2 years ago

Reading over the oft-cited wiki, it can't be done, if I'm reading this correctly:

Windows host, method 2 This assumes your PC still has a parallel printer port integrated on the system board, or a legacy ISA parallel printer adapter. It reportedly will not work with either USB parallel printer adapters or PCI parallel printer port adapters.

and as detailed in the OP, this is the setup.

Also note that the output is sent verbatim from the DOS application to the printer, without any filtering or conversion. Therefore, it is important that the printer can understand the printer control codes that are being sent by the application. In practice this means that this method is only really meant for situations where you have a legacy printer, or are perhaps only sending pure text.

Make sure your DOSBox-X config file contains the statements:

[parallel] parallel1=file dev:lpt1

AdvGK commented 2 years ago

Then again, the wiki mentions this, but I'm sure if the above mentioned incompatibility with a PCI parallel card negates this:

Alternatively you can try to set it up as follows, but this only works if your host is running Windows 9x, or with later Windows versions by installing "PortTalk". PortTalk is needed because direct port access is no longer permitted with more modern Windows versions. The last Windows version supported by PortTalk is Windows XP (32-bit).

[parallel] parallel1=reallpt directlpt:378

rderooy commented 2 years ago

We have had reports from users that USB and PCI parallel port adapters don't work with realport. One of the problems with newer windows versions is that you no longer have access to the low-level IO ports from user space. So the realport option no longer works. Also with USB and PCI adapters, the port address will reportedly not be 378 but something else (I think you can probably find what it is in device manager).

It sounds like the only option you have, is to use the

[parallel]
parallel1=file dev:lpt1

But this requires that your OKI printer must be supported by the DOS application (or support a compatible language, like the Epson printer language).

Alternatively, you may be able to configure your dos application to only print pure text

AdvGK commented 2 years ago

With a change to the configs, [parallel] parallel1=file dev:lpt1

and [printer] printer=false

I generated a print job to file. It was saved to capture folder. I then sent that print job file XXXX.prt to a net use mapped LPT1 printer, which is an OKI620 USB connected device (different setup than OP, but for the focus of this issue, similar)

The print job (raw data) was properly interpreted by the printer, where it utilized its non-ttf fonts to generate the printout.

I will now research print pickup applications like printfil, etc. to see if they can help with picking up the print job and sending it on to the printer.

Not promoting another emulator, but vDOS did this automatically. I generated the print as RAW and it sent it directly to the LPT1 mapped printer.

I'm going to repeat this on the original technical setup defined in the OP, which is a parallel port connected (PCIe card) to a parallel port OKI320.

Since the generated print file is raw data (not emulated), it should work.

I will report back and write-up a summary for other users encountering this similar issue.

rderooy commented 2 years ago

I don't have the equipment to test, but parallel1=file dev:lpt1 should do exactly that. Note that it needs to be on the same line, not split over 2 lines as your showing.

AdvGK commented 2 years ago

Thank you for that clarification. I modified the conf to

[parallel] parallel1=file dev:lpt1

and

[printer] printer=false

and it works.

Thank you for your patience and effort. Once I test the other hardware configuration, I will do a summary.