From e12362e26110899ed5700ed2c68a3679efdf84a3 Mon Sep 17 00:00:00 2001 From: Wengier Date: Tue, 27 Oct 2020 22:36:11 -0400 Subject: [PATCH] add -silent option --- CHANGELOG | 10 +++++++--- src/gui/sdlmain.cpp | 8 ++++++-- src/ints/int10.cpp | 3 +++ update-dosbox-x-reference-conf | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index db9b28054..1e7281eae 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -129,12 +129,16 @@ direct parallel port passthrough feature. (Wengier) - Improved Flatpak support for Linux. (rderooy) - Improved message for the -help command-line option, - adding for example the -socket option. (Wengier) + adding for example -silent and -socket command-line + options in the help messages. (Wengier) + - Added -silent command-line option to run DOSBox-X + silently (without showing the DOSBox-X window) and + then exit after executing AUTOEXEC.BAT. (Wengier) + - Fixed command-line option -socket not working for + the null-modem feature. (Wengier) - Fixed issue that aspect ratio not being respected in full-screen mode when a GLSL shader is enabled with an OpenGL output. (Wengier) - - Fixed command-line option -socket not working for - the null-modem feature. (Wengier) - Fixed shelling from programs may not work when the shell config option is set. (Wengier) - Improved Gravis Ultrasound (GUS) implementation to diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 9be763109..b79303142 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -7165,6 +7165,7 @@ bool DOSBOX_parse_argv() { fprintf(stderr," -noconfig Do not execute CONFIG.SYS config section\n"); fprintf(stderr," -noautoexec Do not execute AUTOEXEC.BAT config section\n"); fprintf(stderr," -exit Exit after executing AUTOEXEC.BAT\n"); + fprintf(stderr," -silent Run DOSBox-X silently and exit after executing AUTOEXEC.BAT.\n"); fprintf(stderr," -c Execute this command in addition to AUTOEXEC.BAT.\n"); fprintf(stderr," Make sure to surround the command in quotes to cover spaces.\n"); fprintf(stderr," -set
Set the config option (overriding the config file).\n"); @@ -7226,6 +7227,11 @@ bool DOSBOX_parse_argv() { else if (optname == "break-start") { control->opt_break_start = true; } + else if (optname == "silent") { + putenv("SDL_VIDEODRIVER=dummy"); + control->opt_exit = true; + control->opt_fastlaunch = true; + } else if (optname == "exit") { control->opt_exit = true; } @@ -8453,8 +8459,6 @@ bool intensity_menu_callback(DOSBoxMenu * const menu,DOSBoxMenu::item * const me CALLBACK_RunRealInt(0x10); reg_ax = oldax; reg_bx = oldbx; - mainMenu.get_item("text_background").check(!blinking).refresh_item(mainMenu); - mainMenu.get_item("text_blinking").check(blinking).refresh_item(mainMenu); return true; } diff --git a/src/ints/int10.cpp b/src/ints/int10.cpp index b1cbc2313..c78f408a9 100644 --- a/src/ints/int10.cpp +++ b/src/ints/int10.cpp @@ -20,6 +20,7 @@ #include "dosbox.h" #include "control.h" #include "mem.h" +#include "menu.h" #include "callback.h" #include "regs.h" #include "inout.h" @@ -160,6 +161,8 @@ Bitu INT10_Handler(void) { break; case 0x03: /* TOGGLE INTENSITY/BLINKING BIT */ blinking=reg_bl==1; + mainMenu.get_item("text_background").check(!blinking).refresh_item(mainMenu); + mainMenu.get_item("text_blinking").check(blinking).refresh_item(mainMenu); INT10_ToggleBlinkingBit(reg_bl); break; case 0x07: /* GET SINGLE PALETTE REGISTER */ diff --git a/update-dosbox-x-reference-conf b/update-dosbox-x-reference-conf index 5c4c17d55..490296f80 100755 --- a/update-dosbox-x-reference-conf +++ b/update-dosbox-x-reference-conf @@ -1,5 +1,5 @@ #!/bin/bash -src/dosbox-x -defaultconf -defaultdir . -exit -fastlaunch -c 'config -wcp dosbox-x.reference.conf' -c 'config -all -wcp dosbox-x.reference.full.conf' -c 'config -setup -wcp contrib/windows/installer/dosbox-x.reference.setup.conf' || exit 1 +src/dosbox-x -defaultconf -defaultdir . -silent -c 'config -wcp dosbox-x.reference.conf' -c 'config -all -wcp dosbox-x.reference.full.conf' -c 'config -setup -wcp contrib/windows/installer/dosbox-x.reference.setup.conf' || exit 1 # Convert to Unix format if needed dos2unix dosbox-x.reference.conf