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

Make startup verbosity configurable #477

Merged
merged 8 commits into from
Jul 5, 2020
Merged

Conversation

kcgen
Copy link
Member

@kcgen kcgen commented Jul 2, 2020

This is a rework of the prior instant launch PR, which was somewhat narrow in its focus.

This PR transforms that into the general concept of Startup Verbosity.

Level Show Splash Window Show Welcome Banner Show pre-executable stdout Program Display
High yes yes yes yes
Medium no yes yes yes
Low no no yes yes
Silent no no no yes

Graphically, this corresponds to:

Level Show Splash Window Show Welcome Banner Show pre-executable stdout Program Display
High 2020-07-01_21-06 2020-07-01_21-07 2020-07-01_21-18 2020-07-01_21-08
Medium no 2020-07-01_21-07 2020-07-01_21-18 2020-07-01_21-08
Low no no 2020-07-01_21-18 2020-07-01_21-08
Silent no no no 2020-07-01_21-08

'high' startup verbosity is default

This guarantees the existing verbose behavior is retained for new users, while allowing experienced users to dial back the verbosity.

'auto' startup verbosity is available

auto is equivalent to "high" if dosbox was not passed an executable, and "low" if it was.

What is pre-executable stdout?

This is non-executable stdout constructed by dosbox prior to launching an executable or batch-file.

For example, when you give dosbox an executable to launch, ie: dosbox duke1/dn1.exe, it still generates the following stdout, which requires setting a graphical text mode window:

2020-07-01_21-18

If verbosity is set to quiet, then this output is suppressed prior to the first executable.

How are batch files handled with 'silent' startup verbosity?

Any output generated in a batch file will be shown.

As described above, dosbox's stdout is suppressed prior to the first executable statement, after which stdout is re-enabled. Batch files are executable, so it's up to the batch file if it generates output (or not).

To make batch execution really quiet, ensure the first line in the batch file is: @echo off, which instructs DOS not to print each line in the file.

Inside the batch file, you can similarly hide a program's text output by redirecting its output, for example: noisy\game.exe > NUL.

dosbox.conf

2020-07-01_21-23

@kcgen kcgen mentioned this pull request Jul 2, 2020
@kcgen kcgen changed the title Controls dosbox's verbosity prior to displaying the program Control the startup verbosity, prior to displaying the program Jul 2, 2020
@kcgen kcgen changed the title Control the startup verbosity, prior to displaying the program Make startup verbosity configurable Jul 2, 2020
@kcgen kcgen requested a review from dreamer July 2, 2020 14:36
@kcgen kcgen self-assigned this Jul 2, 2020
@kcgen kcgen added the enhancement New feature or enhancement of existing features label Jul 2, 2020
@kcgen kcgen linked an issue Jul 2, 2020 that may be closed by this pull request
@kcgen
Copy link
Member Author

kcgen commented Jul 2, 2020

@dreamer , #478 has come just in time for this too. Will rebase this and see how this works under Windows 10 64-bit :-)

Copy link
Member

@dreamer dreamer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the change, and it has a very high "user-visible improvement to lines of code" ratio ;)

I left some design-oriented comments to various parts of the implementation.

During testing I found two small problems:

  1. "Silent" does not work so well - in smaller games it causes super fast flash of black screen (e.g. in "PAKU PAKU 1.6", in others the delay is uncomfortably longer (Wolfenstein 3D when games starts with default 3000 cycles). Also, despite suppression of output, some text still slips in: empty lines injected by who-knows-what part of dosbox implementation, text printed by DOS4/GW, DOS32/A, or the game itself…
  2. Running dosbox path/to/dir (which triggers mounting directory as C) should trigger instant launch as well.

About (1) - I think we could leave this option in as it is, without redesing and improve it in future iterations / PRs.

About (2) - this should be a rather easy fix, I think?

src/misc/setup.cpp Outdated Show resolved Hide resolved
src/misc/support.cpp Outdated Show resolved Hide resolved
src/shell/shell.cpp Outdated Show resolved Hide resolved
src/shell/shell_misc.cpp Outdated Show resolved Hide resolved
src/dosbox.cpp Outdated Show resolved Hide resolved
src/dosbox.cpp Outdated Show resolved Hide resolved
include/control.h Outdated Show resolved Hide resolved
@kcgen
Copy link
Member Author

kcgen commented Jul 2, 2020

Changes are in.

About (1) - I think we could leave this option in as it is, without redesigning and improve it in future iterations / PRs.

I like this step-wise approach; looking forward to more refinement!

About (2) - this should be a rather easy fix, I think?

It was just a couple lines, and working very nicely. Great suggestion @dreamer!

With this directory addition, auto lets me launch dosbox . or dosbox /some/dir very quickly and naturally, like spawning another Xterm (that just happens to be a DOS-interpreter)!

With this mental "startup weight" lifted, staging feels like a general tool for Linux and CLI users, and I now see myself using DOS CLI tools or MOD / MP3 players naturally into my daily workflow. This dovetails very nicely with LFN support!

@kcgen kcgen requested a review from dreamer July 2, 2020 22:23
Copy link
Member

@dreamer dreamer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :) And I'm glad you mentioned a new feature in README.

I left some additional comments, but at this point it's only polishing the code.

I performed some tests and in all cases I tried, the feature behaved according to user expectations :)

src/misc/setup.cpp Outdated Show resolved Hide resolved
src/misc/setup.cpp Outdated Show resolved Hide resolved
src/misc/support.cpp Outdated Show resolved Hide resolved
src/misc/programs.cpp Outdated Show resolved Hide resolved
src/misc/programs.cpp Outdated Show resolved Hide resolved
@dreamer dreamer added this to In progress in 0.76.0 release Jul 5, 2020
Copy link
Member

@dreamer dreamer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feature; I will merge it in momentarily :)

@@ -444,6 +445,18 @@ void DOSBOX_Init(void) {
secprop->AddInitFunction(&TIMER_Init);//done
secprop->AddInitFunction(&CMOS_Init);//done

const char *verbosity_choices[] = {"high", "medium", "low",
"quiet", "auto", 0};
Pstring = secprop->Add_string("startup_verbosity", only_at_start, "high");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Pstring -> pstring (but it's minor I will merge it in anyway).

@dreamer dreamer merged commit 7530307 into master Jul 5, 2020
@dreamer
Copy link
Member

dreamer commented Jul 5, 2020

And it's in; thanks @kcgen :)

@kcgen kcgen deleted the kc/startup-verbosity-1 branch July 5, 2020 11:31
@kcgen kcgen moved this from In progress to Done in 0.76.0 release Aug 3, 2020
@gumispl
Copy link

gumispl commented Feb 23, 2021

I have proposition for one extra mode.
We are using dosbox-staging for repackaging our old games to run on new computers.
Dosbox/Dosbox-staging are a great piece of software and we want to give proper credentials to it and always show DosBox splash window.
At the same time we would want to hide next screens - welcome banner and pre-executable stdout to not confuse users with irrelevant launching details.
Would this be easy change?

@dreamer
Copy link
Member

dreamer commented Feb 23, 2021

@gumispl startup_verbosity = quiet does this exactly :)

@gumispl
Copy link

gumispl commented Feb 23, 2021

@dreamer It skips DosBox Splash entirely - I want to show it and then hide following screens.

@kcgen
Copy link
Member Author

kcgen commented Feb 23, 2021

Maybe we call it:

startup_verbosity = splash
Or
startup_verbosity = splash_only

@dreamer
Copy link
Member

dreamer commented Feb 23, 2021

@gumispl Ah, you're right - sorry :)

@kcgen splash_only seems like a good name.

@kcgen
Copy link
Member Author

kcgen commented Feb 23, 2021

@gumispl ,

PR inbound for this: #912

Feel free to give it a go (or build using the kc/splash-only-1 branch).

Much thanks!

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
No open projects
Development

Successfully merging this pull request may close these issues.

Implement instant-launch
3 participants