[Patch] Aztech Sound Cards
Posted: Tue 11 Feb, 2020 12:49 am
UPDATE: Support for the NT 3.1 drivers: https://pcem-emulator.co.uk/phpBB3/viewtopic.php?f=4&t=3395&p=13262#p13262
This patch adds support for two types of Aztech sound cards: AZT2316A and AZT1605.
These cards are Sound Blaster Pro v2 (8-bit) + Windows Sound System (16-bit) combos that were very common OEM cards during the mid-90's, Packard Bell for example used them extensively (including on some of the models emulated by PCem.)
The cards do not do anything new or different, but having support for them enables the usage of the Master CD or HDD dumps from lots of systems without any further configuration (this is actually the reason why I created this patch).
The two emulated families are Washington (Aztech MMPRO16AB, Aztech Sound Galaxy Pro 16 AB, Aztech Sound Galaxy Washington 16, other OEM names with FCC ID I38-MMSN824 and others) and Clinton (Packard Bell FORTE16, Aztech Sound Galaxy Nova 16 Extra, Aztech Sound Galaxy Clinton 16, other OEM names)
It also works more or less for drivers of other models with the same chipsets.
Some of them use the CS4248 DSP which is pin and software compatible with the AD1848 that is already emulated. Others use a CS4231 in CS4248 mode. You need to select the right one for your driver.
There is a jumper to load the startup configuration from an EEPROM. This is implemented, so any software-configured parameters will be saved.
The CD-ROM interface commands are just ignored, along with gameport (PCem takes care of these in other places).
The MPU401 is always enabled, but IRQs are not implemented yet in PCem so it should work in polling mode. The OPL3 is always active in some (all?) drivers/cards, so there is no configuration for this.
Tested with DOS (driver installation, tools, diagnostics), Win3.1 (driver installation, tools), Win95 (driver auto-detection), lots of games.
I consider the Washington family (AZT2316A) to be functionally complete and very well tested. The Clinton (AZT1605) family should work better in WSS mode (explanation below).
BEWARE that there are *too many* driver types and OEM versions for each card. Maybe yours isn't emulated or you have the wrong driver. Some features of each card may work when using wrong drivers. CODEC selection is also important. A wrong codec may render you without cd-volume control, etc.
Beware that CD music for some (all?) DOS games does not work under Win95, this is a known bug in PCem in all sound cards. The mode selects get truncated and send all zeros for output channel selection and volume, Descent 2 in particular also has excess zeros! CD audio works in Windows programs and in pure DOS.
I still don't know how the Clinton family AZT1605 DMA is configured and the SBPROV2 emulation seems to be done partly by a TSR. It's better to remove the TSR for now. I need to investigate this. Mixer is also weird under DOS. I've read horror stories about this TSR on the internet. There is absolutely no documentation for both of these chips (and the Linux drivers are very basic), so more reverse engineering will be necessary.
Descent 2 W95 version can't start cd music. Happens on real hardware. The game calls auxGetNumDevs() to check if any of the AUX devices has caps.wTechnology == AUXCAPS_CDAUDIO, but this fails because the Aztech Win95 driver only returns a "Line-In" device. I'm not aware of any other game that does this and this is completely unnecessary. Other games that play cd audio correctly have the exact *same* initialization code, minus this check that only Descent 2 Win95 does. It would work if it just skipped this check and progressed with calling mciSendCommand() with mciOpenParms.lpstrDeviceType = "cdaudio", like other games do. There are some sound cards listed as incompatible in the game's README.TXT file that are probably due to this.
You need to run autotools before configure (there is a new file and I wanted to keep the patch clean).
I don't know how much screenshots would be useful for a *sound* card, but here they are. Bonus screenshot of me using Visual C++ 1.52 to confirm the hypothesis of why Descent 2 CD Audio didn't work.
This patch adds support for two types of Aztech sound cards: AZT2316A and AZT1605.
These cards are Sound Blaster Pro v2 (8-bit) + Windows Sound System (16-bit) combos that were very common OEM cards during the mid-90's, Packard Bell for example used them extensively (including on some of the models emulated by PCem.)
The cards do not do anything new or different, but having support for them enables the usage of the Master CD or HDD dumps from lots of systems without any further configuration (this is actually the reason why I created this patch).
The two emulated families are Washington (Aztech MMPRO16AB, Aztech Sound Galaxy Pro 16 AB, Aztech Sound Galaxy Washington 16, other OEM names with FCC ID I38-MMSN824 and others) and Clinton (Packard Bell FORTE16, Aztech Sound Galaxy Nova 16 Extra, Aztech Sound Galaxy Clinton 16, other OEM names)
It also works more or less for drivers of other models with the same chipsets.
Some of them use the CS4248 DSP which is pin and software compatible with the AD1848 that is already emulated. Others use a CS4231 in CS4248 mode. You need to select the right one for your driver.
There is a jumper to load the startup configuration from an EEPROM. This is implemented, so any software-configured parameters will be saved.
The CD-ROM interface commands are just ignored, along with gameport (PCem takes care of these in other places).
The MPU401 is always enabled, but IRQs are not implemented yet in PCem so it should work in polling mode. The OPL3 is always active in some (all?) drivers/cards, so there is no configuration for this.
Tested with DOS (driver installation, tools, diagnostics), Win3.1 (driver installation, tools), Win95 (driver auto-detection), lots of games.
I consider the Washington family (AZT2316A) to be functionally complete and very well tested. The Clinton (AZT1605) family should work better in WSS mode (explanation below).
BEWARE that there are *too many* driver types and OEM versions for each card. Maybe yours isn't emulated or you have the wrong driver. Some features of each card may work when using wrong drivers. CODEC selection is also important. A wrong codec may render you without cd-volume control, etc.
Beware that CD music for some (all?) DOS games does not work under Win95, this is a known bug in PCem in all sound cards. The mode selects get truncated and send all zeros for output channel selection and volume, Descent 2 in particular also has excess zeros! CD audio works in Windows programs and in pure DOS.
I still don't know how the Clinton family AZT1605 DMA is configured and the SBPROV2 emulation seems to be done partly by a TSR. It's better to remove the TSR for now. I need to investigate this. Mixer is also weird under DOS. I've read horror stories about this TSR on the internet. There is absolutely no documentation for both of these chips (and the Linux drivers are very basic), so more reverse engineering will be necessary.
Descent 2 W95 version can't start cd music. Happens on real hardware. The game calls auxGetNumDevs() to check if any of the AUX devices has caps.wTechnology == AUXCAPS_CDAUDIO, but this fails because the Aztech Win95 driver only returns a "Line-In" device. I'm not aware of any other game that does this and this is completely unnecessary. Other games that play cd audio correctly have the exact *same* initialization code, minus this check that only Descent 2 Win95 does. It would work if it just skipped this check and progressed with calling mciSendCommand() with mciOpenParms.lpstrDeviceType = "cdaudio", like other games do. There are some sound cards listed as incompatible in the game's README.TXT file that are probably due to this.
You need to run autotools before configure (there is a new file and I wanted to keep the patch clean).
I don't know how much screenshots would be useful for a *sound* card, but here they are. Bonus screenshot of me using Visual C++ 1.52 to confirm the hypothesis of why Descent 2 CD Audio didn't work.