Open ezathashim opened 3 years ago
Thanks for reporting the issue! Yes, please send a copy of the app and a sample book to open so that we can look at. I appreciate your support!
@ezathashim Thanks for uploading the files. So it is the usual "Packed file is corrupt" error, but DOSBox-X automatically fixes it only when the program is launched from the shell, not when from another application. But you can easily solve this by executing either command before running NV:
LOADFIX /A
Or:
A20GATE OFF
By the way, since you are running a text-mode DOS application, you probably want to check out DOSBox-X's TrueType font (TTF) output which will hopefully make the screen font look better than before. Either start with the config option "output=ttf" or select the output from the menu ("Video" => "Output" => "TrueType font"). More information about this output can be found from:
https://dosbox-x.com/wiki/Guide%3AUsing-TrueType-font-output-in-DOSBox%E2%80%90X.html
Hope this helps.
Wow, great!
Can this be entered in the config file somehow, or does the A20GATE OFF always need to be entered at the prompt?
You can put the commands in the config in the [autoexec]
section
Alternatively, for the A20gate, you can set a20=off
in the [dosbox]
section
Awesome!
Last thing - I've gone through the printing options in the configs, and there is no output on the Mac. Is there a wiki page on printing on the Mac that I cannot find?
There is a wiki page on printing. My suggestion would be to use the print to PostScript feature and then print the PostScipt file afterwards.
If you have any suggested updates to the wiki specific to macOS, let us know. I personally do not have any macOS systems.
Ok, I got it to work on my Mac with the following modifications in the config file:
[parallel] parallel2 = printer (my DOS application is set to use LPT2)
[printer] printoutput = ps multipage = true docpath = /Users/username/Documents/DOSBox-X_Output
I tried modifying the docpath with a '~/Documents/...' format and it did not seem to work. With the config default docpath setting, the output is saved to the root of the user Home folder (/Users/username), which was a bit confusing since the wiki states it should go to the currently active folder.
There is also a bug in the output system when using the Mac. The output file cannot be opened until I shut down DOSBox, so maybe there is a missing line of code to release the file at the end of the output? If you try to open it before quitting DOSBox-X, there is an error 'The PostScript file “doc1.ps” could not be converted to a PDF file.' This bug also seems to prevent pushing the file to the Mac print system. Should I post a new issue concerning this?
I'm really excited to have this app in my hands and the fact that it already runs on M1. Can I contribute a new Icon that will look better on our modern screens? I could probably take the existing one and give it more resolution.
Could you try from the DOS menu the "Send form-feed" option?
Regarding the icon, there is a SVG icon that is used on Linux. But I'm guessing that is not the icon that is getting used on macOS.
With the following config:
multipage = true docpath = /Users/username/Documents/DOSBox-X_Output
If I print from the DOS app, no file is produced at the designated path UNTIL I select the 'Send Form-Feed' menu item, at which point it is generated and I can open the file. I noticed the notes in the config file after you mentioned it. I'm not sure what happened earlier, but I was getting a .ps file even before the CTRL+F2 was pressed.
Thanks very much! It's an incredible piece of work that I wish I could contribute to.
If you look at the timeout value on the wiki, that may explain what happens. By default, it waits until it receives a form-feed to close the file, unless you set a timeout value. DOSBox-X does not know when the DOS application is done printing.
You may also want to look at redirecting the print output on the wiki. This way you can have it automatically open an application when the file is closed.
This is really awesome - so much better than running a VM!
I would maybe suggest putting this info more explicitly on the wiki printing section; you have been a real help.
Sure the wiki can be enhanced. What application do you use on macOS to open postscript files? I can add it to the wiki, if you can give me the syntax.
On macOS, everyone uses Preview for this purpose. However, I tried adding 'openwith = Preview' to the config file and it gives an error:
"The requested file handler failed to complete."
I suspect it has to do with allowing the app to open the file automatically. There are Security settings that need to be toggled on macOS to allow apps to do such things. Do you know what command it used to open the file?
If in a terminal you type
Preview <filename>
Does it open the file in the Preview application?
No, it does not. In Terminal, you would need this command:
open -s "Preview" filename
for example:
open -s "Preview" /Users/usename/Documents/nv/Printouts/myDocument.ps
So if I have this setting in [printer]:
openwith = open -s "Preview"
it works!
In that case, try something like:
parallel1 = file file:output1.ps timeout:1000 openps:"open -s Preview"
Or create a batch file with something like
open -s "Preview" %1
save it as openps.sh, set it executable, then call the batchfile with
parallel1 = file file:output1.ps timeout:1000 openps:openps.sh
This command did not work and gave a "The requested file printing handler failed to complete." failure error:
parallel1 = file file:output1.ps timeout:1000 openps:"open -s Preview"
I think 'openwith = open -s "Preview"' is a better and less complex solution for mortals to understand.
Do you want me to write up a 'Mac' section to add to the wiki?
@ezathashim sure, feel free to write a mac section.
I think the command:
parallel1 = file file:output1.ps timeout:1000 openps:"open -s Preview"
did not work because you need the " around Preview, as in "Preview". Is there a way to properly escape the enclosed " in something like this:
parallel1 = file file:output1.ps timeout:1000 openps:"open -s "Preview""
No, but you can try 'open -s "Preview"'
So use single-quote for the outer quotes and double quote for the inner.
You can use single quotes for outer quotes and double quote for the inner, but you will need to have the squote option enabled, e.g.
parallel1 = file file:output1.ps timeout:1000 squote openps:'open -s "Preview"'
It failed as well.
I'll write up something and send it to you later today.
Thanks!
@ezathashim Did you put the squote option?
Yes, I just tried again and it failed. It was a copy-paste.
Also, it places the file in the top level of the home directory, which is not ideal.
@ezathashim I probably mistyped a single quote symbol when I first posted it, so if you just do a copy-paste if may not work. But I just want to let you know the existence of such an option, in case you need it.
@ezathashim The output file is placed in the current working directory if you do not specify a path, so if the current working directory is the home directory then it will be placed there. If you want it to be placed in a different path, then just explicitly specify a path for that. Hope this helps.
Gotcha. I triple checked the parallel1 = file:... and it really does not want to play ball.
Attached is my take on macOS and DOSBox.
Thanks for all your help! DOSBox-X macOS Instructions.txt
Made a slight tweak DOSBox-X macOS Instructions.txt
Actually, the tilde resolving to your home directory (or relative paths in general) is a feature of the shell. On Linux this would be for instance the bash shell.
For DOSBox-X to support the tilde in the config file for an entry, special care needs to be taken to expand it to the full path as the base libraries used to open files do not support a tilde. In some places DOSBox-X already supports this. For instance in the mount command.
e.g. this works:
mount c ~/dosroot
Ok, here is an updated document. Maybe the config file interpreter should have the ability to interpret tilde paths. One annoying thing is having to copy path strings in the various areas of the config file. Perhaps a special [paths] section could be used to create a path string that can be used elsewhere in the file, and this section could have the ability to resolve tilde paths. DOSBox-X macOS Instructions.txt
@ezathashim Can you make a list of options in the config file need to be interpret tilde paths? I think perhaps they can actually be improved to do so. (for Windows systems, environment variables in such options will be expanded instead)
Sure - I'll have something for you tonight.
I will hold with updating the wiki for the moment.
The only areas that I can see that can take a path are:
[parallel] [printer] [autoexec]
I only looked at the smaller config file, not the complete one. Do you want me to look at the complete one?
[parallel] for file: [printer] docpath [printer] fontpath [autoexec] for mount [config] set path [render] glshader: [gus] ultradir
More complete
@ezathashim Thanks for making the list! It is certainly helpful. But please note that [autoexec] and [config] section commands only have access to the drives inside DOSBox-X, but not host system drives, so options in these two sections are probably not quite applicable. In any case, I have already added support for file path expansion for printing and serial/parallel port file options in #2183. For Windows systems, environment variables in such options will be expanded, and in non-Windows systems the tildes will be expanded. glshader and ultradir have additional requirements so they will be handled later.
Actually, there are a few more places
[sdl] mapperfile mapperfile_sdl1 mapperfile_sdl2
[log] logfile
[dosbox] language savefile
[render] pixelshader
[midi] midiconfig mt32.romdir fluid.soundfont
[serial] file, openwith, openerror phonebookfile
@rderooy Thanks! Hopefully all of the places you mentioned (as well as glshader and ultradir) will now be resolved in #2186, in addition to the places already resolved in #2183.
Nice! that will certainly be appreciated by Linux and macOS users alike.
In case you want to do one last thing for Mac, attached is an .icns file that can be used for the Mac icon file. It is based on the Linux svg file.
Many thanks!
@rderooy I read your comments with interest. I've been trying to print from a Clipper program for days. On a macbook in a windows VM this worked without any problems with DOSBox-SVN. The error "The requested file handler could not be completed." always occurs when the control character e.g. ??[CHR(27)+"(s0h12V"] is sent in the Clipper program in single-step mode. All changes to the quotation marks ([ ' ") have so far been unsuccessful. Do you have any idea?
I’m not familiar with Clipper, but from my notes, I have this:
***
Of note, modifying [parallel] with this sort of entry will not work:
parallel1 = file file:output1.ps timeout:1000 squote openps:'open -s "Preview”'
There appears to be an issue with resolving the double-quotes that are required to tell macOS to use Preview. You could, however, elect to open the file using the default application in this way:
parallel1 = file file:/Users/username/Documents/targetFolder/output1.ps timeout:1000 openps:”open”
***
I’m not sure what your setup is, but maybe you should try the technique outlined above.
I have attached the instructions file that I have archived.
On Aug 9, 2022, at 11:31 AM, hardl1 @.***> wrote:
@rderooy https://github.com/rderooy I read your comments with interest. I've been trying to print from a Clipper program for days. On a macbook in a windows VM this worked without any problems with DOSBox-SVN. The error "The requested file handler could not be completed." always occurs when the control character e.g. ??[CHR(27)+"(s0h12V"] is sent in the Clipper program in single-step mode. All changes to the quotation marks ([ ' ") have so far been unsuccessful. Do you have any idea?
— Reply to this email directly, view it on GitHub https://github.com/joncampbell123/dosbox-x/issues/2176#issuecomment-1209535602, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABI7U5YWSGB7ILAYQUKDU4DVYJ2T5ANCNFSM4V3PVUBQ. You are receiving this because you were mentioned.
Specifics for Macintosh OS
Macintosh has peculiarities with regards to file paths and launching programs to open the print output. Paths on Macintosh using the tilde (~) can be resolved by the OS to the true file path. For example:
~/Documents
would resolve to:
/Users/username/Documents
The DOS system resolves the tilde differently, and so cannot be used in most areas of the DOSBox-X config file. The DOSBox-X Shell, however, can resolve tilde in paths, so commands like 'mount' are able to use this convention.
Opening files using Terminal commands is done by this command:
open -s "Preview” filepath
Opening a file using the default OS application is done with this command:
open filepath
A typical setup might be the following:
mount c /Users/username/Documents/targetFolder in [autoexec]
This will automatically mount the 'targetFolder' on DOSBox-X launch. Because 'mount' is a shell command, this would also work:
mount c ~/Documents/targetFolder in [autoexec]
ttf.ptsize = 30 in [render] output = ttf in [sdl]
parallel1 = printer in [parallel]
printoutput = ps in [printer] docpath = /Users/username/Documents/targetFolder/Printouts in [printer] openwith = open -s "Preview” in [printer] timeout = 1000’ in [printer]
In the above example, the output will be saved to a 'Printouts' subfolder found in 'targetFolder'. If this entry is not made, then the output will default to the root level of the user home folder. The file will be opened by the 'Preview' application using the 'openwith' entry. The timeout parameter is needed to avoid having to press CTRL+F2 to tell the system that the output is complete.
Of note, modifying [parallel] with this sort of entry will not work:
parallel1 = file file:output1.ps timeout:1000 squote openps:'open -s "Preview”'
There appears to be an issue with resolving the double-quotes that are required to tell macOS to use Preview. You could, however, elect to open the file using the default application in this way:
parallel1 = file file:/Users/username/Documents/targetFolder/output1.ps timeout:1000 openps:"open"
Thanks Ezat, I have already tested this configuration, unfortunately without success.
Personally, I would not suggest to use parallel1=printer
, unless the DOS application only supports Epson or IBM Pro Printer. If you have the choice, use the parallel = file file:output1.ps...
syntax and configure a PostScript printer in the DOS application. Or alternatively, you can try a HP LaserJet using the PCL language, but I don't know if macOS understands PCL files by default.
The Epson printer emulation, which is enabled with parallel1=printer
is not great. The output is pretty ugly, and the fact that higher DPI settings don't work with the emulated printer does not help.
My problem seems to be related to the clipper program. I wrote it myself 20 years ago, but only with control sequences for PCL and ESC. It is a pure text program for house cost accounting. Unfortunately, I have no experience with control characters for PS, so I need a Clipper example. However, it is unclear to me why the PCL control characters work in the same program in the Windows VM under Dosbox-SVN, but are simply ignored under Dosbox-X and appear as a printout.
Could you try replacing the control character with a Mac-centric numeric equivalent? I think you would enter a backslash like this:
In C, Objective-C and C++, "\001" is a string containing a single Control-A character. '\001' would be a single Control-A character; you might as well write 1 (without quotes around it).
I found it here:
https://forums.macrumors.com/threads/entering-control-characters.782792/
On Aug 11, 2022, at 5:01 AM, hardl1 @.***> wrote:
My problem seems to be related to the clipper program. I wrote it myself 20 years ago, but only with control sequences for PCL and ESC. It is a pure text program for house cost accounting. Unfortunately, I have no experience with control characters for PS, so I need a Clipper example. However, it is unclear to me why the PCL control characters work in the same program in the Windows VM under Dosbox-SVN, but are simply ignored under Dosbox-X and appear as a printout.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
@ezathashim Unfortunately, I can't get any further with control characters like '\xxx'. I also tested emendelson's DOSBox-X app and scripts, but the app doesn't work for me. I've also asked for help on the XBase/Clipper forums, but to no avail.
@ezathashim But I think the instruction http://www.columbia.edu/~em36/printfileprinter.html refers only to Windows. My problem only exists with MacOS on M1.
Describe the bug I am trying to use dosbox-x (0.83.9) on macOS Catalina and Big Sur for an old accounting program named NewViews. When I try to open accounting files, the NewViews app gives an error 255 and cannot open the books.
I thought it was just a general problem, but when I tried the same thing using regular DOSBox, it all works fine. I would prefer to use dosbos-x, particularly for the ease of use and printing functions.
I can send a copy of the app and a sample book to open, if anyone is interested in looking into this issue.
Thanks!