joncampbell123 / dosbox-x

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

Retro Coding Dual Screen Setup #1075

Open sy2002 opened 5 years ago

sy2002 commented 5 years ago

Is your feature request related to a problem? Please describe. Back in the days, I had a dual screen setup to debug my demos or other VGA-heavy stuff: main screen = VGA, second screen = MDA (well, I actually had a Hercules card).

The monochrome Second screen shows Borland Turbo Debugger, where I can single step my graphics routines. After many years, I now returned to retro coding and my first project is working through the Wolfenstein 3D source code using Borland C 3.1 and Turbo Debugger.

Right now, I need to use a virtual nullmodem network to do this like described here in a standard Dosbox. (Actually, it is two Dosbox instances running simultaneously in a nullmodem network.)

It works, but this virtual nullmodem network is awfully slow and not a lot of fun. Loading Wolfenstein3D.exe into the debugger alone is something like 3mins and then each debug step takes several seconds.

Describe the solution you'd like Well I thought, if Dosbox-X wants to support and enable retro coding, then enabling the retro coder to use the good old dual screen setup would be a good idea :-)

As SDL2 (in contrast to SDL1) is supporting multiple windows, it would be awsome to have such a dual screen setup: One Screen VGA, one screen MDA.

It should not be too hard to implement, as both cards are already emulated separately and as the memory areas (A0000 and B8000 are not overlapping).

Describe alternatives you've considered Well - the workaround is described above: Virtual nullmodem setup. Slow.

Additional context There had been ideas in Dosbox to do this, see this link, but these ideas were more workarounds (as SDL1 did not support multiple windows, so they used the console window, but this again did not work on macOS).

joncampbell123 commented 5 years ago

I've been thinking about how to do this!

First there needs to be code that runs Hercules emulation and CGA/EGA/VGA/SVGA emulation at the same time, and code to emulate the raster of both at the same time.

In SDL2 it could trivially be shown in a separate window if desired, else for SDL1 it will have to be rendered side by side with the main display.

sy2002 commented 5 years ago

Even John Carmarck did it this way :-) I don't know if this link works permanently, but it shows a quote and a screenshot from "Game Engine Black Book Wolfenstein 3D" from Fabien Sanglard. Would be just awesome to have this in Dosbox-x :-D (And requiring SDL2, i.e. only working with SDL2 would be OK, too, I think?)

joncampbell123 commented 5 years ago

It turns out you can purchase that book on Amazon Kindle, which is nice.

(and you can take it out of Amazon's walled garden using Calibre and some well known plugins).

sy2002 commented 5 years ago

@joncampbell123 yes - indeed I own this book (printed version) and while working it through, I ran into the pain of how incredibly slow Turbo Debugger runs via this emulated nullmodem connection on DOSBox. This is why I thought, that a Retro Coding Dual Screen Setup might be a good idea for DOSBox-X :-)

sy2002 commented 4 years ago

@joncampbell123 Hi Jon, Thank you for the great new release 0.83.1. As one of your goals is to enable retro coding: The dual screen setup: VGA screen for output + Hercules for the Turbo Debugger was the setup back in the days :-D Just wanted to bring this issue again to your attention ;-)

HunterZ commented 2 years ago

Is there some documentation somewhere on how this works?

sy2002 commented 2 years ago

@HunterZ Do you mean how my workaround works (above mentioned use case) or how this should work in Dosbox-x in a perfect world or how the dual screen vga and Hercules worked back in the day? :-)

rderooy commented 2 years ago

This does not work today. This is basically a feature request (enhancement).

HunterZ commented 2 years ago

Nevermind, I figured it out. It's supported via the -display2 command line option.

sy2002 commented 2 years ago

@HunterZ Sounds good.

@joncampbell123 Is this rather old feature request of mine from 2019 here a duplicate of the 2021 issue #2197 which was successfully implemented? Looks a bit like it. Please confirm and close if it is a duplicate.

leslietoo commented 2 years ago

Thanks for implementing this great feature! 1000 thanks!

rderooy commented 2 years ago

I wrote up some documentation which you can find here for now: https://github.com/Wengier/dosbox-x-wiki/wiki/Guide%3AVideo-card-support-in-DOSBox%E2%80%90X#dual-monitor

Once the next release is out, the above will be pushed to the regular wiki.

leslietoo commented 2 years ago

I wrote up some documentation which you can find here for now: https://github.com/Wengier/dosbox-x-wiki/wiki/Guide%3AVideo-card-support-in-DOSBox%E2%80%90X#dual-monitor

Once the next release is out, the above will be pushed to the regular wiki.

Great article, I'll read it soon...I have one question: I found the dosbox-x debugger can't popup when started with -display2 parameter, and the start debug command under debug menu is disabled. is that a bug?

rderooy commented 2 years ago

The debugger uses the same console as the second display, so they are not allowed at the same time. Yes this is a limitation of the code, as there should not be such a limitation.

Ideally the display2 code would actually create an SDL window instead of using a terminal. That would also allow for Hercules as the second display.

leslietoo commented 2 years ago

got it.hope it can be resolved in the future... really appreciate your effort, thanks a lot

Wengier commented 2 years ago

The original issue was solved, although with the limitation that you cannot use it with the debugger at the same time.

leslietoo commented 2 years ago

@Wengier Yes I know, I mean solve the limitation one day, then we can enjoy dual monitor + built-in debugger running simultaneously. Too excited...

sy2002 commented 2 years ago

OK, thank you. Then I guess it makes sense to leave this issue open until the use case https://github.com/joncampbell123/dosbox-x/issues/1075#issue-440377843 "dual monitor + built-in debugger" works.

boskar commented 2 years ago

Just a small ping - surprisingly some people in Poland would profit (in production environment) from Hercules-as-second-display-adapter support. I've described my case in bug #3407 . Unfortunately I can't code (well), but I will certainly test and give some feedback, if anybody would be welling to go for it.