VOGONS


Reply 20 of 31, by aitotat

User metadata
Rank Member
Rank
Member

I don't have any ESS based card at the moment but I happened to find just recently Terratec 16/96 on ebay. It hasn't arrived yet. I was hoping that ESS would be the one without any issues but I suppose that was too much to hope for. Every chip seems to have some sort of issue. But at least on this case it is really good if ESS has separate volume for waveblaster connector. That is a big plus.

MIDIto already prevents mixer reset command and it will restore all volumes by itself to the levels stored when MIDIto was loaded. The problem is that Gabriel Knight is a protected mode game and port trapping does not work on protected mode games. MIDIto can restore the volume levels when returning back to DOS even if the game was a protected mode game. But in this case, since the ESS is SBPRO compatible with DSP 3.xx, it will restore the standard SB Pro volumes. For SB16/32/AWE volume registers 30h-47h will also be restored. I can and will add the ESS AuxB to the list of volume registers to be restored.

But for Gabriel Knight it won't help. Midi stays silent, unless for some reason it resets the mixer before entering protected mode. But at least the volume could be restored when the game quits. I don't know if it is possible to use RTC interrupt, for example, and try to restore volumes from interrupt handler when the game is running. I don't know if the protected mode extender would allow that or not. I can try to experiment with that later.

Reply 21 of 31, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie
aitotat wrote on 2021-11-27, 12:51:

I don't have any ESS based card at the moment but I happened to find just recently Terratec 16/96 on ebay. It hasn't arrived yet. I was hoping that ESS would be the one without any issues but I suppose that was too much to hope for. Every chip seems to have some sort of issue. But at least on this case it is really good if ESS has separate volume for waveblaster connector. That is a big plus.

MIDIto already prevents mixer reset command and it will restore all volumes by itself to the levels stored when MIDIto was loaded. The problem is that Gabriel Knight is a protected mode game and port trapping does not work on protected mode games. MIDIto can restore the volume levels when returning back to DOS even if the game was a protected mode game. But in this case, since the ESS is SBPRO compatible with DSP 3.xx, it will restore the standard SB Pro volumes. For SB16/32/AWE volume registers 30h-47h will also be restored. I can and will add the ESS AuxB to the list of volume registers to be restored.

But for Gabriel Knight it won't help. Midi stays silent, unless for some reason it resets the mixer before entering protected mode. But at least the volume could be restored when the game quits. I don't know if it is possible to use RTC interrupt, for example, and try to restore volumes from interrupt handler when the game is running. I don't know if the protected mode extender would allow that or not. I can try to experiment with that later.

OK, thanks for the explanation. I have another idea that can help but I do not know if you want to change the workflow of your TSR this way. Namely adding a hotkey that can restore the original stored mixer settings while a game is running. So your TSR would also install a keyboard interrupt handler and the hotkey would restore the original mixer values every time you press the hotkey. Just and idea. In theory this should work also with protected mode games since does not require any port trapping.
Thanks.

Website, Facebook, Youtube
Falcosoft Midi Player + Munt VSTi + BassMidi VSTi topic

Reply 22 of 31, by aitotat

User metadata
Rank Member
Rank
Member

Hotkey would work if the game hooks keyboard interrupt properly. But I'm sure some just capture keyboard completely. But support for hotkeys could be added eventually.

After writing my last reply I though of much better way than using RTC or any other timer interrupts. To hook INT 13h instead. Basically that would mean mixer settings could be checked and restored every time game accesses hard disk. So mixer restore would be done during game loading times. And even better, there is idle interrupt that the BIOS calls when waiting hard disk IRQ (seek time before data transfer can begin). It is not always available but when it is, the mixer checking and restoring could basically be done without any performance penalty at all. And it should work with protected mode games.

Reply 23 of 31, by aitotat

User metadata
Rank Member
Rank
Member

Release 8 is now ready! I wanted to get this ready before Christmas. I hope this is not too rushed release.

So here are the changes:
* Added INT 13h handler to mixer locking. This allows limited protected mode
support (volumes are restored when reading data from hard disk).
* Added ESS detection (at least for ES18xx models, not sure about ES16xx and
ES17xx) and support for AuxB (MIDI) volume
* Added -dsp command line parameter for SB16/32/AWE DSP fixes (Sound Blaster Pro
support etc.)

The INT 13h handler is very basic and has room for improvements if it turns out to be useful. It can be disabled if it gives problems (specify NO13 to mixer locks). The ESS 18xx is now detected and AuxB lock is added to default locks. I did not find proper datasheets for ESS 16xx and 17xx but if they are similiar to 18xx then they should be supported as well. 19xx is not supported so mixer locking works just like on any other SB Pro compatible card.

But the most important feature (and perhaps most unimportant feature at the same time) is the new -dsp command line parameter. It will fix Sound Blaster Pro support for SB16/32/AWE among other small fixes. Like Turn on speaker and Turn off speaker commands are fixed by setting voice volume to zero and then restoring it back to normal.

Merry Christmas to everyone!

Reply 24 of 31, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie
aitotat wrote on 2021-12-23, 13:44:
Release 8 is now ready! I wanted to get this ready before Christmas. I hope this is not too rushed release. […]
Show full quote

Release 8 is now ready! I wanted to get this ready before Christmas. I hope this is not too rushed release.

So here are the changes:
* Added INT 13h handler to mixer locking. This allows limited protected mode
support (volumes are restored when reading data from hard disk).
* Added ESS detection (at least for ES18xx models, not sure about ES16xx and
ES17xx) and support for AuxB (MIDI) volume
* Added -dsp command line parameter for SB16/32/AWE DSP fixes (Sound Blaster Pro
support etc.)

The INT 13h handler is very basic and has room for improvements if it turns out to be useful. It can be disabled if it gives problems (specify NO13 to mixer locks). The ESS 18xx is now detected and AuxB lock is added to default locks. I did not find proper datasheets for ESS 16xx and 17xx but if they are similiar to 18xx then they should be supported as well. 19xx is not supported so mixer locking works just like on any other SB Pro compatible card.

But the most important feature (and perhaps most unimportant feature at the same time) is the new -dsp command line parameter. It will fix Sound Blaster Pro support for SB16/32/AWE among other small fixes. Like Turn on speaker and Turn off speaker commands are fixed by setting voice volume to zero and then restoring it back to normal.

Merry Christmas to everyone!

Hi,
Thanks for the update. And Merry Christmas to you also!
I would like to report that this version successfully fixed Gabriel Knight 1 muted Midi/AuxB problem on (at least) ESS 1868.
Thanks again.

Website, Facebook, Youtube
Falcosoft Midi Player + Munt VSTi + BassMidi VSTi topic

Reply 27 of 31, by aitotat

User metadata
Rank Member
Rank
Member

Release 9 is now ready. No new features this time. Just some fixes and improvements to the INT 13h handler. Now the INT 13h handler restores locked volumes only and once per 64kB of data read.

But I have something else as well: FIXYMF. It is the Yamaha YMF71x fix from MIDIto separated to fixymf.com. It is supposed to be executed just after unisound and that is all. Nothing needs to be configured. It uses the same SET BLASTER string as unisound so the R### must be set if some other control port is used. FIXYMF can be used with other initialization programs as well but the R### must be added to SET BLASTER string if control port is other than the default 370h.

FIXYMF does not require EMM386 or QEMM and it also works even on 8088 (I don't know if the cards work on 8-bit slot) so FIXYMF is a very good alternative if EMM/QEMM cannot be used. Of course there is no mixer locking so if game messes with master volume, then the fix no longer works. Also you cannot use FIXYMF and YMF lock from MIDIto at the same time. FIXYMF and MIDIto can be used at the same time but you need to use locks just like with any other SB Pro compatible, without the YMF lock.

Attachments

Reply 28 of 31, by digger

User metadata
Rank Oldbie
Rank
Oldbie
Kamerat wrote on 2021-09-17, 08:59:

Make the mapping range four didgit so it also can map into the PCI I/O range. Some PCI sound cards can have their MPU-401 interface accessed that way without even initializing the card, see the spreadsheet in my signature for sound cards that allow this.

To expand on that idea, could you perhaps also add the option to redirect Adlib ports 388h and 389h to specified ports in the PCI I/O range, so the PCI cards in Kamerat's spreadsheet that can expose their Adlib/OPL3 capability in that higher port range can be made to work in real mode games, even on newer motherboards that don't support subtractive decode?

I know at that point it really broadens the scope of the tool, since it was initially just meant for MPU-401 MIDI redirection, but why stop there? 🙂

Reply 29 of 31, by aitotat

User metadata
Rank Member
Rank
Member

I'm already planning OPL redirect for next version so hopefully it will help with PCI cards as well.

I've been trying to avoid PCI sound cards on DOS so I have very little experience with them. I'm wondering how much port redirection will help. If PCI I/O range has the OPL ports available it might not be enough since most likely the PCI card is mute until it is initialized with DOS drivers. And those same DOS drivers should make the OPL available from Sound Blaster and Adlib addresses.

PCI OPL would be useful if there is only one ISA slot on the system and, for example, AWE64 installed to it. Then the real (or better than CQM) PCI OPL could be mapped to Sound Blaster and Adlib addresses to get best of both. But the PCI card would have to be initialized as a second Sound Blaster so it would be essentially just like two ISA cards.

Or is there something about PCI sound cards that I should know?

Reply 30 of 31, by aitotat

User metadata
Rank Member
Rank
Member

I'm trying to think what is needed from the OPL redirecting feature and here are some things. I haven't started yet so nothing is set. There are much more things to consider than just map one OPL over another.

First, what kinds of multi sound card configurations you might have and why is the OPL redirecting useful?

Configuration 1:
You have AWE64 (or just any otherwise good card but with bad OPL) as your primary card (SET BLASTER in autoexec.bat points to that card). Then you have a good SB pro compatible or maybe even a real SB Pro 2 to compensate for the weaknesses of the AWE64. That would mean the second card would provide better OPL3 (or MPU401 but that is not needed here).
So configuration 1 is AWE64 + sbpro compatible with good OPL. I think this configuration is the most common (and I use it as well).

Configuration 2:
As configuration 1 but you also have Sound Blaster 2.0 or clone. Basically you have this card for CMS but it also has a real OPL2 that could be used for Adlib support.

Configuration 3:
You have AWE64 and some OPL3 card that is not Sound Blaster pro compatible (like PAS16 or Adlib Gold). This configuration needs to be handled differently than configuration 1 as you will soon see.

Configuration 4:
Like configuration 1 but you have a second sbpro compatible card as well! But why? So you could choose between CQM, ESFM and real OPL3, for example.

Configuration 5:
Configuration 3 plus Sound Blaster 2.0 or clone. One more to choose from but no Sound Blaster pro mixer.

And some configurations that I can forget or can be handled with some of the above:
Configuration 6:
AWE64 + Sound Blaster 2.0 or clone. You might want the SB2.0 for CMS and Adlib. And you likely have already configured AWE64 with unisound so that Sound Blaster address space plays CQM (OPL3) and Adlib address space plays OPL2. You don't need MIDIto here except for the Game Blaster detection chip emulation.

Configuration 7:
AWE64 + sb pro compatible OPL3 card + non sb pro compatible OPL3 card. Essentially the same as configuration 1 or 4

Configuration 8:
AWE64 + two non sb pro compatible OPL3 cards. Anyone actually has a setup like this? Essentially the same as configuration 5

Configuration 9:
AWE64 + real Sound Blaster pro 1. Like configuration 6. You most likely have it already set so that MIDIto is not needed at all.

So we can simplify all above to a three different scenarios:
A: AWE64 + Sound Blaster Pro with good OPL3
B: AWE64 + good OPL (2 or 3) card that does not have Sound Blaster pro mixer
(C: A + B so we can forget it. Supporting the A and B will also cover C)

I'm going to remove the -a command line parameter and merge it with the new -fm parameter. How should it work? This is what I have in mind:

Map to Adlib and SB address space (from SET BLASTER=A###):

-fm=a240	; Use OPL from address 240h with LIN mixer
-fm=a240m ; Use OPL from address 240h with SB pro compatible mixer from 240h
-fm=a240x ; Use OPL from address 240h without any mixer support

-fm=a388,d##### ; Use OPL from address 388h with LIN mixer and use delay of ##### jumps
-fm=a240m,d ; Use OPL from address 240h with SB pro compatible mixer from 240h and use minimum delay
-fm=a388x,d1 ; Use OPL from address 388h without any mixer support and use delay with one jump (external mixer)

-fma= ; Like above but maps only to Adlib address space of 388h and not to Sound Blaster address space
-fmsb= ; Maps only to Sound Blaster address space and not to Adlib address space

Dual OPL support:

-fm=ar240	; Use OPL from SET BLASTER=A### as left OPL and OPL from 240h as right OPL connected to LIN
-fm=ar240m ; As above but use FM mixer from 240h for right OPL
-fm=ar240x ; x should not be used with dual OPL mode

-fm=ar388,d ; Use 388h as right OPL connected to LIN and use minimal delay for BOTH OPLs

-fm=al240m,ar260m ; Use OPL at 240h as left OPL and OPL at 260 as right OPL. Both have SBpro compatible mixer so use it
-fm=al240,ar260m ; Use OPL at 240h as left OPL connected to LIN and OPL at 260h as right OPL with SBpro mixer
-fm=al240,ar260m,d ; Same as above but delay for BOTH OPLs

What plays from Adlib address space? Both by default but that can be changed from Sound Blaster Pro 1 mixer register 06h that needs to be emulated in the dual OPL mode. (Actually I'm not quite sure how it behaves but I do have CT1330A to test with)

To disable OPLs:

-fma=off	; Disable OPL at Adlib address space (to force CMS detection without -cms flag)
-fmsb=off ; Disable OPL at Sound Blaster address space (never needed?)
-fm=off ; Disable OPL completely (never needed?)

So the Sound Blaster pro mixer is handy because it means there is no need to connect the other card to AWE64 Line-IN. So external mixers can be easily used but are not necessary. When connected to AWE64 Line-IN, the LIN volume will be used to control FM volume.

Did I forget anything? Are the command line parameters easy enough?

Reply 31 of 31, by Kamerat

User metadata
Rank Oldbie
Rank
Oldbie
aitotat wrote on 2022-01-24, 06:42:

I've been trying to avoid PCI sound cards on DOS so I have very little experience with them. I'm wondering how much port redirection will help. If PCI I/O range has the OPL ports available it might not be enough since most likely the PCI card is mute until it is initialized with DOS drivers. And those same DOS drivers should make the OPL available from Sound Blaster and Adlib addresses.

It will help when the sound card is on a PCI bus without subtractive decoding because the card won't be able to use the I/O range for ISA cards. noop made a tool for the C-Media CMI8738 some years ago that could do remapping. The Yamaha YMF744 can use also the PCI I/O addresses for access of the Sound Blaster part.

DOS Sound Blaster compatibility: PCI sound cards vs. PCI chipsets
YouTube channel