VOGONS


First post, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

Hello,
i wonder its possible to make Dosbox with MS-DOS 6+ choice menu in Dosbox?

I know that is possible to use multiple *.conf files and run them with bat, problem is that i would have to copy autoexec settings and keep synchronized multiple autoexecs, unless its possible to include some external autoexec file in *.conf and even then i would have to have open and edit multiple files, instead nice 1 config with all.

I wrote some testing code with Dosbox-X , its not failing, but im not really sure if really working and enablign and disabling soundcards on the fly..
Other distros have some start up *.conf parsing window, but its seems that Dosbox it does not.
I know that this is not best example, because SB16 + GUS, can work fine together..

@RuThaN im trying to create menu as on Physical machine, to not have edit conf itself because of Soundcard change - proven

#ECHO OFF
CLS
ECHO 1) Sound Blaster 16 (Default)
ECHO 2) Gravis Ultrasound (GUS Only)
ECHO 3) No Sound / Clean Boot
ECHO.
CHOICE /C:123 /N Choose your sound configuration:

IF ERRORLEVEL 3 GOTO NOSOUND
IF ERRORLEVEL 2 GOTO GRAVIS
IF ERRORLEVEL 1 GOTO SB16

:SB16
# DOSBox-X command to set sound card type at runtime
CONFIG -set "sblaster sbtype=sb16"
CONFIG -set "gus gus=false"
SET BLASTER=A220 I7 D1 T6
ECHO Sound Blaster 16 Enabled!
GOTO END

:GRAVIS
# Disable Sound Blaster to avoid conflicts - its should be possible with Dosbox staging, other AI claims that is not supperted..
#Still not define SB variables can make SB invisible for some games / setup
CONFIG -set "sblaster sbtype=none" # disable SB to avoid conflicts
SET ULTRADIR=C:\ULTRASND
SET ULTRASND=240,3,3,5,5
ECHO Gravis Ultrasound Enabled
GOTO END

:NOSOUND
CONFIG -set "sblaster sbtype=none"
CONFIG -set "gus gus=false"
ECHO Sound Disabled.
GOTO END

:END

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 1 of 8, by wierd_w

User metadata
Rank Oldbie
Rank
Oldbie

Many things can be directly specified on the commandline at startup.

I am unsure if audio hardware type is one of them, but GUS and SB16+MT32 can coexist I believe, in the same .conf

They just need different port assigns.

(220, i5, d1,d5,p330 for SB16+mt32 and 240,i7,d3,d7,p360 for coexisting GUS?)

Anyhow.. if you instead create a .cmd (or .sh), you can ask the questions there, and keep all that housekeeping in that file?

I dont have a proper computer (thats appropriate for me to tinker on) in front of me to test if setting the sound type is possible at dosbox invocation as commandline options or not, but autoexec like things can be done with

-c "some autoexec thing here"

Reply 2 of 8, by wierd_w

User metadata
Rank Oldbie
Rank
Oldbie

Ok.

The command line will get very busy and untidy... but..

A .bat that is called from the start menu may do what you want.

Something like this:


#ECHO OFF
CLS
ECHO 1) Sound Blaster 16 (Default)
ECHO 2) Gravis Ultrasound (GUS Only)
ECHO 3) No Sound / Clean Boot
ECHO.
CHOICE /C:123 /N Choose your sound configuration:

IF ERRORLEVEL 3 GOTO NOSOUND
IF ERRORLEVEL 2 GOTO GRAVIS
IF ERRORLEVEL 1 GOTO SB16

:SB16
# DOSBox-X command to set sound card type at runtime
#change working dir to where dosbox is installed
cd C:\dosbox
#invoke dosbox with correct voodoo for SB16

Dosbox -noautoexec -c 'CONFIG -set "sblaster sbtype=sb16"' -c 'CONFIG -set "gus gus=false"' -c "SET BLASTER=A220 I7 D1 T6" -c "ECHO SoundBalster 16 Enabled!"
GOTO END

:GRAVIS
# Disable Sound Blaster to avoid conflicts - its should be possible with Dosbox staging, other AI claims that is not supperted..
#Still not define SB variables can make SB invisible for some games / setup
CONFIG -set "sblaster sbtype=none" # disable SB to avoid conflicts
# change working dir to where dosbox lives
cd C:\dosbox
#invoke dosbox with correct voodoo for ultrasound
dosbox -noautoexec -c "SET ULTRADIR=C:\ULTRASND" -c "SET ULTRASND=A240,3,3,5,5" -c "ECHO Gravis Ultrasound Enabled!"
GOTO END

:NOSOUND

#change working dir to were dosbox lives
cd C:\dosbox
#invoke dosbox with correct voodoo for nosound
Dosbox -noautoexec -c 'CONFIG -set "sblaster sbtype=none"' -c 'CONFIG -set "gus gus=false"' -c "ECHO Sound Disabled!"
GOTO END

:END

This would skip whatever is in the [autoexec] section of the conf, but you can fix that by removing the directive from the invocation line. (Mounting drives might be desirable) It also will override what is in the .conf at invocation time.

Reply 3 of 8, by zirkoni

User metadata
Rank Member
Rank
Member
ruthan wrote on Today, 12:33:

I know that is possible to use multiple *.conf files and run them with bat, problem is that i would have to copy autoexec settings and keep synchronized multiple autoexecs, unless its possible to include some external autoexec file in *.conf and even then i would have to have open and edit multiple files, instead nice 1 config with all.

The different conf-files do not have to be complete. I think it's possible to have 1 conf-file that has nothing else but the autoexec section. Then you can include it with your HW specific conf:

dosbox --conf base.conf --conf gus.conf --conf autoexec.conf

base.conf: all common settings
gus.conf: GUS specific settings (disable SB if you want, enable GUS)
autoexec.conf: autoexec only

https://youtube.com/@zirkoni42

Reply 4 of 8, by wierd_w

User metadata
Rank Oldbie
Rank
Oldbie

Oh, that's MUCH cleaner!

Reply 5 of 8, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

Thanks, for quick replies and confirmation, of that including is possible..

Well still not ideal, good not know, laziness great engine of human progress. And have to open multiple Windows with part of .conf files, is also not ideal, at least for me. Its on the less to have multiple complete *.conf files.

Also any improvement counts, so it would be nice to see, in Dosbox console that some parameter which user are trying to force in autoexec is actually un supported to set this way.

Beauty of this approach, if all parameters would be available and possible to set on the fly or in autoexec, or both.

1) It would actually mean, that user can ignore all configuration before autoexec part, they would have to scroll through walls of text to set something.. Parameter descripts are nice, when you need it, but quick setup, you would just have posiblity to ignore them, what is very BFU friendly.. and more over just copy / paste 1 block of code written by somebody else for particular Dosbox setup. I would make some rom like Dosbox distros much more compact.

And if autoexec would not touch some already user defined parameters, they would be still kept, valid. I mean for example, different people i have different display and Windows / Full screen setting, which are breaking games to run, as other HW and SW settings as soundcards.

2) Not need to restart Dosbox, after some HW change - i guess that command could automatically trigger reboot inside of Dosbox window if restart is really needed to apply change.

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 6 of 8, by wierd_w

User metadata
Rank Oldbie
Rank
Oldbie

Setting them on the fly seems supported, according to dosbox wiki.

https://www.dosbox.com/DOSBoxManual.html#Parameters

in the pertinent section on internal programs.

CONFIG -set "foo bar"

does not list which parameters can be changed at runtime, so caveat emptor.

Reply 7 of 8, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie
wierd_w wrote on Today, 13:39:
Ok. […]
Show full quote

Ok.

The command line will get very busy and untidy... but..

A .bat that is called from the start menu may do what you want.

Something like this:


#ECHO OFF
CLS
ECHO 1) Sound Blaster 16 (Default)
ECHO 2) Gravis Ultrasound (GUS Only)
ECHO 3) No Sound / Clean Boot
ECHO.
CHOICE /C:123 /N Choose your sound configuration:

IF ERRORLEVEL 3 GOTO NOSOUND
IF ERRORLEVEL 2 GOTO GRAVIS
IF ERRORLEVEL 1 GOTO SB16

:SB16
# DOSBox-X command to set sound card type at runtime
#change working dir to where dosbox is installed
cd C:\dosbox
#invoke dosbox with correct voodoo for SB16

Dosbox -noautoexec -c 'CONFIG -set "sblaster sbtype=sb16"' -c 'CONFIG -set "gus gus=false"' -c "SET BLASTER=A220 I7 D1 T6" -c "ECHO SoundBalster 16 Enabled!"
GOTO END

:GRAVIS
# Disable Sound Blaster to avoid conflicts - its should be possible with Dosbox staging, other AI claims that is not supperted..
#Still not define SB variables can make SB invisible for some games / setup
CONFIG -set "sblaster sbtype=none" # disable SB to avoid conflicts
# change working dir to where dosbox lives
cd C:\dosbox
#invoke dosbox with correct voodoo for ultrasound
dosbox -noautoexec -c "SET ULTRADIR=C:\ULTRASND" -c "SET ULTRASND=A240,3,3,5,5" -c "ECHO Gravis Ultrasound Enabled!"
GOTO END

:NOSOUND

#change working dir to were dosbox lives
cd C:\dosbox
#invoke dosbox with correct voodoo for nosound
Dosbox -noautoexec -c 'CONFIG -set "sblaster sbtype=none"' -c 'CONFIG -set "gus gus=false"' -c "ECHO Sound Disabled!"
GOTO END

:END

This would skip whatever is in the [autoexec] section of the conf, but you can fix that by removing the directive from the invocation line. (Mounting drives might be desirable) It also will override what is in the .conf at invocation time.

This is good elegant idea, just 2 confing files except of like 5+ and that with branching would need to be edited rarely.. Yeah some Windows annoying open/closing blinking bundled with it. I would still prefer my dreamed solution, but this is definitely improvement.
I also wonder would this work with all todays Dosbox builds? Im not sure where Config -set was introduces and if some parameters werent added later.. I still keep things like Gulikoza and Ykhwongs builds, which are 10+ years old, im not saying that i have to use this with all of them, but would be nice to have some idea from when this syntax could be used.

Update:
I imaged 1 more thing, if settings on the fly is supported, so my original idea/solution/script , a far as change of particular parameter is on the fly is support, unless some other syntax errors,should work too, or im wrong?

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 8 of 8, by wierd_w

User metadata
Rank Oldbie
Rank
Oldbie

It may.

I'd verify that things turned on/off with config -get, just to be sure.