VOGONS


First post, by dos4decades

User metadata
Rank Newbie
Rank
Newbie

Hello, I am very impressed with DOSBox (kudos to the developers!!) but I have a small problem. I have some old DOS utilities that require ANSI.SYS for cursor positioning and macros. I have used these nearly every day for decades. I would LOVE to be able to use them in DOSBox (in OS X with directories mounted). The first thing they do is issue and <esc>[6n request to report the cursor position, and check for the report (which appears as though typed from the keyboard), e.g. <esc>[25;01R. These programs don't actually use the reported cursor position. They simply look for any response and if none is seen, they assume that ANSI.SYS is not loaded, and refuse to work until it is loaded. So I simply need DOSBox to respond to <esc>[6n with even just one character to enable these programs to work.

I see that ripsaw8080 made a patch to respond to <esc>[6n with a cursor position report, offered in a post dated 2009-06-16. I don't know how to use this patch, and I gather it is not in DOSBox 0.74.
Re: Problems with ansi.sys - Help wanted

It is easy to test. If you create a file named 'report' containing <esc>[6n and then do 'type report', in MS-DOS with ANSI.SYS loaded, you see the report come back at the command prompt, e.g. <esc>[25;01R. In DOSBox nothing comes back.

Similar tests that use ANSI sequences to position the cursor within the standard 25 line x 80 character window, or change the font color, work fine, so I can see that DOSBox does have a partial implementation of ANSI.SYS.

I have tried a number of ANSI alternatives within DOSBox without success (ansi.com, ansiplus.exe, nnansi.com, devload ansi.sys). I hope ANSI cursor position reporting can be provided, or at least a single character emitted in response to the position report request. Thank you!

Reply 1 of 7, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The diff file that adds "report position" support to DOSBox's internal ANSI.SYS implementation is a source code patch, and only useful when compiling DOSBox.

dos4decades wrote:

I have tried a number of ANSI alternatives within DOSBox without success (ansi.com, ansiplus.exe, nnansi.com, devload ansi.sys).

Those may work partially, if loaded correctly, but you may also need an additional support program. Try loading INT29.COM from this thread after loading one of the ANSI drivers.

Reply 2 of 7, by dos4decades

User metadata
Rank Newbie
Rank
Newbie

Thanks very much for your quick reply, ripsaw8080!

When I execute ansiplus.exe in the DOSBox window, it reports being loaded. Operation is confirmed because now the mouse can be captured in the DOS window and can scroll back at the top of the window. (Ctrl-F10 releases the mouse from the DOS window.)

However, the ANSI report cursor position (<esc>[6n) still does not generate any output at the cursor. Also my programs that expect such output still do not work.

You recommended “loading” INT29.COM. I’m not sure what loading means. Is INT29.COM a TSR by default? When I simply execute INT29 at the DOS prompt, a command prompt reappears without any messages. This does NOT fix the report cursor position problem.

When I try to load INT29.COM with David Woodhouse’s DEVLOAD.EXE (DEVLOAD /V INT29.COM), DOSBox hangs.

NNANSI.COM (Tom Almy) detects ANSIPLUS.EXE (if previously executed) and refuses to load. In a clean DOSBox, NNANSI.COM reports successful loading. However cursor position reporting does not work, and executing INT29.COM does not fix this.

ANSI.COM (Michael J. Mefford) detects NNANSI installation and refuses to install. In a clean DOSBox, same results as with NNANSI.COM (fails to report cursor and INT29 does not fix).

I have been unable to find a download for the ANSI.SYS native to DOS 5, which I assume would be suitable for DOSBox. I have the DOS 6.22 version, and also NANSI.SYS 3.3 from 1993. Attempting to load either of those with DEVLOAD hangs DOSBox.

What is involved in compiling DOSBox with the diff file that adds ‘report position’?

Thanks!

Reply 3 of 7, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

For example, run ANSIPlus to make it resident, then run INT29.COM (a TSR) to make it resident; both must be resident. DOSBox's internal DOS does not direct console output through INT 29h as real DOS does, and ANSI drivers hook INT 29h to use as a source of input, so INT29.COM intercepts writes to the console and directs them through INT 29h.

Another option is to boot real DOS inside DOSBox, and then you can load any ANSI driver in CONFIG.SYS that you want to. However, if you go that far, you could just as easily use other VMs.

For compiling DOSBox, see the "Advanced Topics" section of the DOSBox wiki.

Reply 4 of 7, by dos4decades

User metadata
Rank Newbie
Rank
Newbie

Maybe I wasn't clear but I did execute ANSIPLUS.EXE and then afterwards INT29.COM. There is still no cursor position report to my test <esc>[6n, and my programs still don't work. The test and programs work fine in authentic MS-DOS with ANSI.SYS loaded via CONFIG.SYS.

The docs for ANSIPLUS.EXE say that the cursor position report is supported. So the symptoms are consistent with INT29 inn DOSBox being the problem, except INT29.COM does not fix the problem.

Booting real MS-DOS 6.22 inside DOSBox removes the drives previously MOUNTed in DOSBox. This makes MS-DOS useless to me (unless there is a way to mount OS X directories that I don't know about).

I am willing to consider building DOSBox from source so I could include the patch for ANSI 'report cursor position'. However the instructions at the wiki all seem to be for Windows versions. I need to build DOSBox.app for Mac OS X. If there were a clear set of instructions I would consider it.

Reply 6 of 7, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The INT29.COM program helps getting data TO the ANSI driver, it doesn't help with data coming FROM the ANSI driver (e.g. the reply to the report position command). After running ANSIPLUS.EXE, try running SETAPLUS.EXE or SETCOLOR.EXE and you'll see a lot of unprocessed escape codes; then try running them again after running INT29.COM and you'll see the difference.

However, you need the reply to the report position command, so the source patch or booting real DOS are your choices. I can't guarantee the source patch will work 100% correctly because I had nothing to test it with.

Reply 7 of 7, by colodude

User metadata
Rank Newbie
Rank
Newbie

I have implemented this patch for one of my applications and have made it available to my users via a download from my website.

The link to the main website is : http://www.cjdsoftware.com

The link to a ZIP file containing the patched version (dosboxcmaster.exe) is: http://cjdsoftware.com/DosBoxCmaster.zip

I have tested this extensively with my applications and it works flawlessly! Other than this one patched file, it is DOSBOX V0.74.

If you have any troubles, contact me via this forum and we can work out the issues.

Bill