VOGONS


First post, by SKelley

User metadata
Rank Newbie
Rank
Newbie

Hi! I'm running DOSbox 0.74 on Ubuntu. I've got a few games from GoG, and for the most part they run fine. (I just run dosbox with the config files supplied in the .EXE from GoG)

The only issue is with games using MIDI. I have to start fluidsynth up, (or the qsynth front-end at the minute) and edit the config file every time with the new MIDI port -- so I've been working on a shell script that will start fluidsynth and then start and setup DOSbox for me.

GoG provides at least two conf files for each game, imbedded in the EXE. (which has long since been unpacked ...) In the case of Sim City 2000, these are dosboxSC2000.conf and dosboxSC2000_single.conf. The first is a standard configuration file, and the second is a file containing [autoexec] and the commands to load the game.

The issue I'm having is this: I can't seem to override the two .conf files provided. All I want to do is override the [midi] midiconfig option with whatever port my script detects fluidsynth in... I haven't started trying with the script yet, I've just been doing everything manually to figure out what the script needs to do. So far I have tried various permutations of this:

dosbox -c "config -set \"midi midiconfig=128:0\"" -conf dosboxSC2000.conf -conf dosboxSC2000_single.conf

My suspicion is that the autoexec is running before the -c command has a chance.

I read somewhere on this forum that setting an environmental variable $DOSBOX_MIDI_MIDICONFIG would override any config file, but it doesn't seem to hold true for this current version of DOSbox.

I might consider trying to run a batch file within the [autoexec] that itself scans for the port and sets itself up, but I'm not sure how easy that would really be... The other option is to have the script run sed or some such on the config file, but that seems clunky.

Any help is appreciated! Thanks

Reply 1 of 3, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

You can add your own third conf file with only the [midi] section and your midiconfig setting in it.
AFAIR the configs stack and the last one to set something rules over the previous ones (except the autoexec section, the commands in there get appended, again AFAIR).

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 2 of 3, by SKelley

User metadata
Rank Newbie
Rank
Newbie

That's a good idea... I can just run echo [whatever] >> midi.conf and add midi.conf to the list of config files. Thank you for the idea!

Reply 3 of 3, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Btw, it could be that the midiconfig is one of the few settings that can't be changed on runtime, only via configs.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper