VOGONS

Common searches


First post, by qv90

User metadata
Rank Newbie
Rank
Newbie

If you ever used DosBox 0.65 and tried a program like "Framework IV" you'll have noticed, there is no printer support available.

For all DOS programs which want to access printer by device name, I've written this patch. All output to LPT1-4 is captured into files named "devLPTx.prn" (x-device 1-4) in the DosBox directory. If print is terminated (DOS program closes the device) a system command (as defined in dosbox.conf) is executed to deliver output to host printing system. All output from the issued command is echoed to the dosbox console. At termination of DosBox, the temporary "device" files were automatically deleted.

To get it to work, please

1. Apply patch by switching to DosBox source directory and enter "patch -p0 < PrtDev.diff".
2. Compile the new version ("./configure && make")
3. Call dosbox.exe
4. Enter "config -writeconf dosbox.conf"
5. Load dosbox.conf into editor
6. Search for "[printer]" section
7. Print output is discarded by default:
...
LPT1=disable
...
8. Change "disable" to a command which sends output file to your host printing system. If you're working on a Windows system, you may use "copy devLPT1.prn LPT1 >Nul".

Remarks:

- The ">Nul" parameter is used to minimize output to DosBox console (error message will still be shown on DosBox console window). Check out as required. For debugging purposes you may discard that parameter.
- You may use more complex commands. If the DOS program generated PostScript output and you've only a PCL printer, then you can convert the print output by sending print file to GhostScript (which is able to convert output from PostScript to PCL) and then send it to your printer.
- You can easily redirect output from one printer device to a diffrent host system printer device by modifying the output command (e.g. "copy devLPT2.prn LPT1 >Nul").

ToDo:
- I noticed that some DOS programs open and closes the device after only a couple of bytes. The output command is then executed each time the device is closed, resulting in a heavy slow down during printing. I'm currently working on a solution which does some sort of "spooling". There will be an additional parameter "timeout=" where you can specify a delay before the collected output is delivered to host printer. Stay tuned 😀
- Printer interupt were not captured.

Last edited by qv90 on 2012-11-11, 09:15. Edited 3 times in total.

Reply 1 of 72, by qv90

User metadata
Rank Newbie
Rank
Newbie

Hi,
version 0.2 is out 😀

Now print output is "spooled". You have to specify in dosbox.conf a new parameter "printer_timeout". Either after printer_timeout ticks or if you terminates dosbox.exe, output is delivered to host printing system. (Alternatively you may use "config -writeconf" to create a new fresh configuration file with all default values included).

Why?
I recognized a DOS program which opens LPT1, writes only a couple of bytes, closes LPT1, opens LPT1, write some bytes (and so forth)... I found no way to figger out when DOS program really terminates printing. So I designed a solution which caches print output for a "while" before executing print output command.

Have fun!

Last edited by qv90 on 2012-11-11, 09:16. Edited 1 time in total.

Reply 3 of 72, by qv90

User metadata
Rank Newbie
Rank
Newbie

Hi,
due to some customer claims I sligthly modified the code. In the new version it is garanteed the "device file" DevLPTx.prn is located in DoxBox.exe directory.

Additionally error message for unsuccessfull print-command is expanded.

Last edited by qv90 on 2012-11-11, 09:16. Edited 1 time in total.

Reply 7 of 72, by XoKoS

User metadata
Rank Newbie
Rank
Newbie

MSYS

in /sdl-1.2.11 source dir
$ ./configure && make && make install
ok

in /sdl_net-1.2.6 source dir
$ ./configure && make && make install
ok

copyed the SDL_net.dll, SDL.dll and Patch#02.diff to the dosbox source dir

in dosbox-0.65 source dir
$ Patch -p0 <patch#02.diff
ok

$ ./configure
ok

$ make

get the following error

f:/dosbox/dosbox-0.65/src/hardware/printer.cpp:61: undefined reference to `_errno()'

make[3]: *** [dosbox.exe] Error 1
make[3]: Leaving directory `/f/dosbox/dosbox-0.65/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/f/dosbox/dosbox-0.65/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/f/dosbox/dosbox-0.65'
make: *** [all] Error 2

Reply 13 of 72, by kees3328n

User metadata
Rank Newbie
Rank
Newbie

You are probabely right is some cases. But using Qemu with Freedos _and_ -parallel /dev/parport0 makes my dongle work with the application.

Dosbox: nice environment, easy access to host filesystem, no easy access for LPT dongles

Qemu+Freedos: nice environment, no so easy access to host filesystem, good access for LPT dongles.

If Dosbox had better LPT access or Qemu+Freedos had the mounting access of Dosbox.... I have a wish......

Kees

Reply 15 of 72, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

I thought Qemu did have host file access? I think I remember seeing that somewhere. Never used it so I have no idea how it works.

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline

Reply 17 of 72, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Interest which at this point in time the DosBox devs do not want because the main DosBox goal is GAME compatibility.

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline

Reply 19 of 72, by andre.afonso

User metadata
Rank Newbie
Rank
Newbie
qv90 wrote:
(...) […]
Show full quote

(...)

To get it to work, please

1. Apply patch by switching to DosBox source directory and enter "patch -p0 < PrtDev.diff".

(...)

i'm new using DOSBox and i'm getting a problem that i suppose it'll be resolved when i achieve a sucessfully instalation of this patch. but i can't do these first step. sorry about my ignorance on this subject.

where do i enter the command? in a command prompt?

Thanks