Bug in Dosbox 0.74: music in Worms demo fails (notes are wrong!), well on real msdos

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Bug in Dosbox 0.74: music in Worms demo fails (notes are wrong!), well on real msdos

Postby jomalin » 2016-12-02 @ 19:40

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!4g97NKhj5bizGgM4lK1arwkwDBM3jFNnoRhueP2Eos4

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.
jomalin
Newbie
 
Posts: 63
Joined: 2010-12-14 @ 11:42

Re: Bug in Dosbox 0.74: music in Worms demo fails (notes are wrong!), well on real msdos

Postby Jorpho » 2016-12-02 @ 19:49

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.)
User avatar
Jorpho
l33t++
 
Posts: 7043
Joined: 2003-2-14 @ 19:50
Location: Canada

Re: Bug in Dosbox 0.74: music in Worms demo fails (notes are wrong!), well on real msdos

Postby jomalin » 2016-12-02 @ 19:52

Sorry, can be confusing, i mean the msdos that comes with XP, not a real msdos (in real msdos, it must be well played also).
jomalin
Newbie
 
Posts: 63
Joined: 2010-12-14 @ 11:42

Re: Bug in Dosbox 0.74: music in Worms demo fails (notes are wrong!), well on real msdos

Postby ripsaw8080 » 2016-12-02 @ 20:50

For this particular demo use normal core with SB sound. Do try GUS sound, though, as I think it is superior in this case.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 4389
Joined: 2006-4-25 @ 23:24

Re: Bug in Dosbox 0.74: music in Worms demo fails (notes are wrong!), well on real msdos

Postby jomalin » 2016-12-03 @ 01:10

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?
jomalin
Newbie
 
Posts: 63
Joined: 2010-12-14 @ 11:42

Re: Bug in Dosbox 0.74: music in Worms demo fails (notes are wrong!), well on real msdos

Postby ripsaw8080 » 2016-12-03 @ 02:25

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.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 4389
Joined: 2006-4-25 @ 23:24

Re: Bug in Dosbox 0.74: music in Worms demo fails (notes are wrong!), well on real msdos

Postby jomalin » 2019-7-30 @ 14:29

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/problems-with-sound-in-the-game-worms-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...
jomalin
Newbie
 
Posts: 63
Joined: 2010-12-14 @ 11:42

Re: Bug in Dosbox 0.74: music in Worms demo fails (notes are wrong!), well on real msdos

Postby ripsaw8080 » 2019-7-30 @ 17:42

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.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 4389
Joined: 2006-4-25 @ 23:24


Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 1 guest