VOGONS


First post, by Parazythum

User metadata
Rank Newbie
Rank
Newbie

Hello,

I've been messing with the sound blaster in turbo pascal 7 lately under DosBox 0.74, and I found a minor bug.

When I send the E1h command to the DSP (ask for SB Id), the DSP sends back 2 values :
* SB major value
* SB subversion value

Changing the sb type in the configuration file, I found out that all emulated SB cards return the wrong values.

According to http://the.earth.li/~tfm/oldpage/sb_dsp.html, the values should be :

MODEL VERSION
SoundBlaster 1.0 1.?? (1.05???)
SoundBlaster 1.5 1.?? (1.05???)
SoundBlaster 2.0 2.xx (2.01)
SoundBlaster Pro 3.00 (???)
SoundBlaster Pro 2 3.01+ (3.01, 3.02)
SoundBlaster 16 4.0x (4.04, 4.05)
SoundBlaster 16 SCSI-2 4.11 (4.11)
SoundBlaster AWE32 4.12+ (4.12)

For example in DosBox, asking a SB16 returns 5 and 5.

I'm using these values to automatically set the correct SB in my programs. The subversion doesn't matter, but the major version is what should be used to identify the card that is emulated.

What's more, not every SB has a mixer, that should be enabled/disabled automatically instead of being set manually in the config file ? That goes also for the OPL chip version embedded.

Now it's not really annoying, I can get sounds out of the SB under DosBox, but the emulation is not completely accurate, So I hope this helps 😀

Last edited by Parazythum on 2014-06-30, 19:13. Edited 1 time in total.

Parazythum,
the Big Bad Bug

Reply 1 of 8, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

first try DOSBox SVN

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 8, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

These are the DSP version values reported by DOSBox in its SB emulation:

    case 0xe1:    /* Get DSP Version */
DSP_FlushData();
switch (sb.type) {
case SBT_1:
DSP_AddData(0x1);DSP_AddData(0x05);break;
case SBT_2:
DSP_AddData(0x2);DSP_AddData(0x1);break;
case SBT_PRO1:
DSP_AddData(0x3);DSP_AddData(0x0);break;
case SBT_PRO2:
DSP_AddData(0x3);DSP_AddData(0x2);break;
case SBT_16:
DSP_AddData(0x4);DSP_AddData(0x5);break;
default:
break;
}
break;

SB detection would be problematic in a significant number of games if the DSP versions were not reported correctly, so I suggest you look at what you may be doing wrong in reading the version data. It appears you're somehow using the minor version for the major version as well.

DOSBox does not install mixer ports for SB1 and SB2, so the mixer is absent for those types of emulated SoundBlasters, regardless of what you may be trying to infer from settings.

Reply 3 of 8, by Great Hierophant

User metadata
Rank l33t
Rank
l33t
ripsaw8080 wrote:
These are the DSP version values reported by DOSBox in its SB emulation: […]
Show full quote

These are the DSP version values reported by DOSBox in its SB emulation:

    case 0xe1:    /* Get DSP Version */
DSP_FlushData();
switch (sb.type) {
case SBT_1:
DSP_AddData(0x1);DSP_AddData(0x05);break;
case SBT_2:
DSP_AddData(0x2);DSP_AddData(0x1);break;
case SBT_PRO1:
DSP_AddData(0x3);DSP_AddData(0x0);break;
case SBT_PRO2:
DSP_AddData(0x3);DSP_AddData(0x2);break;
case SBT_16:
DSP_AddData(0x4);DSP_AddData(0x5);break;
default:
break;
}
break;

SB detection would be problematic in a significant number of games if the DSP versions were not reported correctly, so I suggest you look at what you may be doing wrong in reading the version data. It appears you're somehow using the minor version for the major version as well.

DOSBox does not install mixer ports for SB1 and SB2, so the mixer is absent for those types of emulated SoundBlasters, regardless of what you may be trying to infer from settings.

Do the emulated Sound Blasters types respond only to the DSP commands supported by the reported version, or do they respond to all?

http://nerdlypleasures.blogspot.com/ - Nerdly Pleasures - My Retro Gaming, Computing & Tech Blog

Reply 4 of 8, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author
Great Hierophant wrote:

Do the emulated Sound Blasters types respond only to the DSP commands supported by the reported version, or do they respond to all?

There are conditions that prevent processing of certain DSP commands on SB types that do not support those commands. See the DSP_SB2_ABOVE and DSP_SB16_ONLY defines.

Reply 5 of 8, by Parazythum

User metadata
Rank Newbie
Rank
Newbie

Hello,

I don't think I'm doing anything wrong in my program, I double checked it, in doubt...

First I send the E1h command to the DSP, then I read twice one byte : first the major then the minor version.

Besides that, I can send DSP commands and hear sounds, no problem.

I'll try the SVN version too.

Thanks for these first answers !

Parazythum,
the Big Bad Bug

Reply 6 of 8, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Some years ago I made the attached C program to test DSP commands. It takes parameters of the SB base port and DSP command in hex and displays the response data. For example "SBDSP 220 E1" displays "04 05" for sbtype=sb16 in DOSBox. Perhaps you can compare the code to what you are doing to see why you're not getting the values you should be.

Attachments

  • Filename
    sbdsp.zip
    File size
    5.36 KiB
    Downloads
    101 downloads
    File comment
    SB DSP command test, C source and executable
    File license
    Fair use/fair dealing exception

Reply 7 of 8, by Parazythum

User metadata
Rank Newbie
Rank
Newbie

Eh, thanks, I will test that 😉

I forgot to mention I'm under Linux (Ubuntu Precise). Don't know if it makes a difference between the ports, I never tried to compile DosBox myself. Maybe I should have a look at the source code.

Parazythum,
the Big Bad Bug

Reply 8 of 8, by Parazythum

User metadata
Rank Newbie
Rank
Newbie

Mmmh... OK, my fault, it works now.

I wasn't using the right method to check if the DSP was ready to give an answer, ripsaw8080 your code helped a lot !

Now I can use the right commands for the right SBs, the Read_DSP portion of my code was only used for identifying --- the rest was working like a charm.

Thanks to you all.

Parazythum,
the Big Bad Bug