VOGONS


First post, by jomalin

User metadata
Rank Newbie
Rank
Newbie

Hi,

a have found a very strange bug in Dosbox related to music playing. I was remembering the old game Worms, so i executed a demo of it in Dosbox and ... what? this is not the Worms melody some years ago i listened to...

If you execute any of the two Worms demo (as i know there were two versions, one released in September 95 and the other on October) in Windows XP (with real msdos) and you stay in the main menu, you will hear in a while the Worms music playing well with the typical Worms melody, sounds like a trumpet. If you execute it in Dosbox, the melody notes of the trumpet get completely wrong! All the notes of the Worms melody are always at same note.

The music is of tracker type, this is, the game plays the samples involved in the song and change the frequency (to play different notes) or loop them (to extend them), and makes the mixing of all of the samples in realtime each time it is played. You can find here info about tracker music:
https://en.wikipedia.org/wiki/Music_tracker

Why Dosbox is not properly playing the Worms melody?

You can download the Worms demo from here (only 1,6 mb and it does not requiere installing, just execute WORMS.BAT):
https://mega.nz/#!gAU1xBjK!4g97NKhj5bizGgM4lK … jFNnoRhueP2Eos4

Listen the music in a real msdos (it executes well in XP) and then in Dosbox...

UPDATE: I have tested it also on Dosbox nightly build (r4000) and has the same bug.

Last edited by jomalin on 2016-12-02, 19:51. Edited 1 time in total.

Reply 1 of 7, by Jorpho

User metadata
Rank l33t++
Rank
l33t++
jomalin wrote:

in Windows XP (with real msdos)

This is not clear. Are you saying from the XP command prompt? That's not really MS-DOS. (I'm kind of surprised you can get any sound that way at all.)

Reply 4 of 7, by jomalin

User metadata
Rank Newbie
Rank
Newbie
ripsaw8080 wrote:

For this particular demo use normal core with SB sound. Do try GUS sound, though, as I think it is superior in this case.

Setting the core to "normal" fix the problem!

It was setted to "auto". But why "auto" fails in correctly playing the song (notes are changed) just out of curiosity? Should'nt "auto" play it well?

Reply 5 of 7, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The core=auto setting uses normal core when the emulated CPU is in real mode, and dynamic core when in protected mode. It is the dynamic core that seems to affect the SB sound in this demo. There are, of course, differences in the way the cores work, but I don't know the causative factor for the issue. Anyway, the GUS sound is considerably better IMO, and works as well with dynamic core.

Reply 6 of 7, by jomalin

User metadata
Rank Newbie
Rank
Newbie
ripsaw8080 wrote:

For this particular demo use normal core with SB sound. Do try GUS sound, though, as I think it is superior in this case.

In this forum, a user did that and he said it worked:
https://retropie.org.uk/forum/topic/2423/prob … rms-on-dosbox/2

I write the user post:

Changed sound settings in the game on the Gravis Ultrasound , and changed settings in DOSBox (/opt/retropie/configs/pk/dosbox-SVN.conf) -

gus = true
gusrate = 44100
gusbase = 240
gusirq = 5
gusdma = 3
ultradir = C: eULTRASND

And it worked perfectly!

Maybe someone would like to investigate why the music is not well played using dynamic core. Maybe other games have this problem too...

Reply 7 of 7, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The SB sound issue is likely caused by flag behavior of certain CPU instructions; shift instructions in particular. Dynamic core (dynx86) uses flag behavior of the host processor, which for some instructions may not be 100% the same as the behavior of old processors. The "fix" for the issue might be to have dynamic core drop out to normal core for the affected instruction(s), but that erodes performance.