Thanks 😁
There is still missing support for stereo on LPT. I do not know if any game makes use of it. If not there is no need for digging support for it.
I found so far 4 types of stereo on LPT:
Method 1:
2 DACs on 2 LPT ports = 2 channels = stereo (which LPT is left/right signal?)
The emulation is easy by cloning current code of disney.c on second LPT port 0x278. I will not do that because several places in dosbox must be changed - developers of dosbox should decide if they would like to add such stereo support.
Method 2 and 3:
2 DACs on 1 LPT port = stereo (left/right keying using control port of LPT. LPT base+2 = control port. bits: strobe,auto feed)
bit strobe turns on/off right channel DAC
bit auto feed turns on/off left channel DAC
these bits should be set in inverted form:
0 - turn on DAC
1 - turn off DAC
Pin numbers on physical LPT port are 1 (strobe) and 14 (auto feed)
There is another project which shifts DACs using only strobe signaling (instead of on/off there is left/right)
Many DOS applications used some kind of autodetection of stereo DACs:
(taken from Linux LPT sound driver)
/* test if a Stereo-on-One is on lp(port) */
inline static int stereo1_detect(unsigned port)
{
if (! pcsp_free_port(port))
return 0;
outb(0x7F, LP_B(port));
if (LP_S(port) & 0x80) {
outb(0x80, LP_B(port));
return (LP_S(port) & 0x80) ? 0 : 1;
}
return 0;
}
/* test if a new Stereo-Circuit is on lp(port) */
inline static int stereo_nc_detect(unsigned port)
{
if (! pcsp_free_port(port))
return 0;
outb(0, LP_B(port));
if (LP_S(port) & 0x40) {
outb(0xFF, LP_B(port));
return (LP_S(port) & 0x40) ? 0 : 1;
}
return 0;
}
I prepared answers to these test procedures for dosbox disney but they do not work at all. Maybe DOS applications use different detection mechanism.
There is BUSY signal (pin 11) which may be significant part of DACs autodection procedure but do not know how it impacts on autodetection.
BUSY line is always soldered on scheme with D7 line of LPT port.
method 4:
Unknown method Visual Player 2.0 utilizes.
Inside mp219b.zip there is pure DOS text file hardware.doc which has scheme of stereo-on-1 DACs and author knows how detection procedure should look. However my both mails were bounced back because authors accounts does not exist anymore.