Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement instant-launch #139

Closed
kcgen opened this issue Jan 21, 2020 · 10 comments · Fixed by #477
Closed

Implement instant-launch #139

kcgen opened this issue Jan 21, 2020 · 10 comments · Fixed by #477
Assignees
Labels
enhancement New feature or enhancement of existing features

Comments

@kcgen
Copy link
Member

kcgen commented Jan 21, 2020

Instant-launch would take place when DOSBox is started with an executable (.bat, .com, or .exe) on its command-line. ie: dosbox rungame.bat

Instant-launch would:

  • skip all DOSBox-specific visual output (logos / banners / other messages)
  • set the video-mode to whatever the game has requested, straight-away, without any prior video modes being set

If no executable is provided, DOSBox would start in interactive-mode, per its existing behavior:

  • display the logo
  • display the help banner
  • display any other DOSBox-specific content
  • deposit the user at the DOS command prompt

Motivations for instant-launch are:

  1. to fall in-line with all other high-quality emulators that simply "get out of the way and start your game", such as those supported on RetroPie.
  2. to match the experience in real DOS. When your launch a game from the command prompt, Microsoft does not insert pre-popup fanfare before the game starts up.
  3. to eliminate visual redundancy. If the user launches multiple games in short succession, these screens act as unavoidable redundancy to the user's experience.

Please vote with a 👍 or 👎
(nothing personal here: this is simply an idea that we can kill or run with!)

@kcgen kcgen added the enhancement New feature or enhancement of existing features label Jan 21, 2020
@dreamer
Copy link
Member

dreamer commented Jan 21, 2020

I like this idea :)

Some notes:

Video mode concern

Right now, when a command or path is passed to DOSBox, it does a bit more than simply run the command - following sequence is injected into autoexec:

$ dosbox some/path/file.exe
Z:\> mount C some/path
Z:\> C:
C:\> file.exe

Because of this, it might be hard or impractical to go straight to video mode, that the game requested. Also, some execs might not request changing videomode at all and expect to stay in the current text mode (whatever it is 80x25, 80x50, or some different one). (Norton Commander is an example of such program). Maybe we can figure it out somehow.

User option or CLI flags

I think user should have a bit more control over the splash screen; right now, the splash screen is hardcoded (I think it's because of companies distributing DOS games with bundled dosbox?) - but in many, many contexts it does not make sense to show it, even when starting simple terminal window (my terminal emulator does not show splash screen on each start - I would go insane if it did).

Maybe we should add a user setting dosbox.show_splash (with values always/never/auto, auto being default resulting in instant-launch functionality). Optionally, we could also add new flags: --show-splash, --no-splash (but .conf setting might be enough).

Banner

Blue banner on DOSBox start is a separate concern. I really don't like it - it contains too much information, so in the result users don't read it. In instant-launch mode we could simply add cls after switching to C: to avoid showing it. Personally, I would like remove this banner and replace it with better tutorial on dosbox usage than 'intro', and have a user option to not show it at all and start with a clean prompt (like a modern terminal emulator would do).

My point here: I suggest banner to be taken out of this feature and treated as a separate topic.

@kcgen
Copy link
Member Author

kcgen commented Jan 21, 2020

Great suggestions @dreamer ; The additional of the splash screen flag and conf option are nice touches, especially with 'auto' being the default.

I also agree the info/help banner should simply be removed; but for this feature it will be hidden/skipped in instant-launch mode. So it makes sense to tackle interactive-mode's help-banner under a separate feature.

@kcgen
Copy link
Member Author

kcgen commented Jan 21, 2020

I think it's because of companies distributing DOS games with bundled dosbox?

That's the consensus:

"Unscrupulous vendors packaging DOSBox without giving credit". The logic goes that by forcing the splash-screen into the users' experience, the nefarious vendor is foiled.

However, neither selling DOSBox nor displaying a splash screen are GPL violations.

https://www.gnu.org/philosophy/selling.en.html

"Many people believe that the spirit of the GNU Project is that you should not charge money for distributing copies of software, or that you should charge as little as possible—just enough to cover the cost. This is a misunderstanding.

Actually, we encourage people who redistribute free software to charge as much as they wish or can. If a license does not permit users to make copies and sell them, it is a nonfree license. If this seems surprising to you, please read on."

And similarly, there is no discussion of banners or splash screens in the license terms.

Leaving the license aside, does the use of an always-enabled splash screen fit with general practices? No. Otherwise DOSBox users would sit through splash-screens for ALSA, Timidity, Munt, Ogg Vorbis, and SDL; even before DOSBox displays its own splash screen.

DosFreak's response to a user requesting a way to disable the splash-screen clearly shows there is demand for such a feature from the users:

If there were then everybody would just set it to "No".

@kcgen
Copy link
Member Author

kcgen commented Jan 21, 2020

I do believe all credit is due to the DOSBox authors, and fighting plagiarism and copyright violation is a worthy and noble cause; however that war is best played out with lawyers filing lawsuits resulting in the transference of money from the violating parties.

If the battle against unscrupulous vendors is going to be played out on the splash-screen, then it should inform and arm the user with procedures on how to report bad vendors if purchased a "pirate DOSBox device" on ebay, amazon, or AliExpress.

@kcgen
Copy link
Member Author

kcgen commented Jun 4, 2020

To try out instant launch, run your executable or batch file strait-away on dosbox's command-line: ie: dosbox shamus.com

The default banner mode is auto, which means that banners will be skipped when you launch an executable using dosbox's command-line.

Builds to try:

@kcgen kcgen self-assigned this Jun 11, 2020
@kcgen kcgen added this to In progress in 0.76.0 release Jun 11, 2020
@kcgen
Copy link
Member Author

kcgen commented Jun 30, 2020

Calling for testing help!

Configuration option is as shown; set that to auto to try instant launch as originally described in this ticket, or set it to no to simply turn off the splash and intro banners.

2020-06-30_13-57

Note that it defaults to to the present behavior yes.

Source is on branch: kc/instant-launch-1, or grab the build binaries:

@dreamer
Copy link
Member

dreamer commented Jun 30, 2020

I like this solution very much; experienced users will just change it to no and not be bothered with welcome banner any more. Keeping yes as the default means users will always see the banner on the first run / first install.

So far I tested it on Gnome 3 + XWayland + Intel + OpenGL - works beautifully. Gnome 3 + pure Wayland - there are some bugs, but all I've seen are not regressions - just various issues we have in master.

Unfortunately, I don't have access to multiple displays at the moment, but tomorrow I'll attach it to the TV and do some testing this way and test some other DEs.

@kcgen
Copy link
Member Author

kcgen commented Jun 30, 2020

Thanks for the help in getting this one off our list @dreamer ! Rounding up latest tests on my side too.

@kcgen
Copy link
Member Author

kcgen commented Jun 30, 2020

In windowed-mode on Windows 10, the desktop's fade-effect start with a white SDL canvas before getting underway. Stability is good though, and works fine on all the output and texture_rendering modes. Fullscreen on Windows 10 is nice; goes straight in without the white background.

Given the PR is very minimal and doesn't touch the SDL code, maybe a follow on PR is best to tacle this window-mode white background? (Linux doesn't suffer from that though.. it's pretty darn instant on Linux).

My ultimate goal is to also hide or eliminate the first console-sized graphical mode change, and so there's only a single SDL mode set:

MAIN: Draw resolution: 320x200, double-width, double-height, pixel aspect ratio: 1.20
MAIN: Emulator resolution: 800x600

But right now there are still two, the first for the console (which on Linux tends to disappear very quick), but on Windows it's still visible for a fraction of a second.

@kcgen
Copy link
Member Author

kcgen commented Jul 1, 2020

Whoah.. just for fun I hooked the boolean into WriteOutput, and it's essentially a --quiet mode:

void Program::WriteOut(const char * format,...) {
	if(!control->WantsBanners())
		return;

...
void Program::WriteOut_NoParsing(const char * format,...) {
	if(!control->WantsBanners())
		return;

The first SDL window is the game's window! No pre-console that flashes by..

[05:33:33@hoya meanstreets] dosbox-staging ms.exe 
dosbox-staging version git
---
CONFIG: Loading primary file dosbox.conf
OPENGL: Pixel buffer object extension: available
SDL: Mouse will move seamlessly without being captured.
MEMORY: Base address: 0x56533b10ae80
MEMORY: Using 4096 DOS memory pages (16 MiB)
MIDI: Opened device:none
MAPPER: Found no joysticks
SDL: Window has been shown
SDL: Window is being offered a focus
MAIN: Draw resolution: 640x400, pixel aspect ratio: 1.20
MAIN: Emulator resolution: 640x480

 -- in the game --!

@kcgen kcgen linked a pull request Jul 2, 2020 that will close this issue
Backlog automation moved this from Suggested new features to Done Jul 5, 2020
@kcgen kcgen moved this from In progress to Done in 0.76.0 release Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement of existing features
Projects
2 participants