VOGONS


IBM PS/1 Audio Card.

Topic actions

First post, by jmk

User metadata
Rank Newbie
Rank
Newbie

I didn't know this existed, but Mobygames says it does... very hard to find any information on it. Sure enough, my old KQ5 EGA supports it.

According to this:
http://www.old-computers.com/museum/doc.asp?c=1274&st=1

The Audio card, which fits into the system unit, includes the following:

· 3 voice synthesizer plus noise generator

Hmm... sounds a bit familiar, yes? 🙄

Sure enough, I did a bit of poking around and set port 0x0205 to write to the SN76496 The result: some PCJr/Tandy-like sounds! Yet another change where I can't be sure of finding any original content! 😊

Works fine on KQ5 EGA. I tried it on Prince Of Persia 2, but it requires some rather strict checks:

INT 15h AH = C0h (SYSTEM - GET CONFIGURATION).
Then checks:
CMP [BX+2],0BFC (OK - PS/1 LW-Type 44 and Model 2011 (286-10))
CMP [BX+2],30F8 (OK - PS/1 Model 2121 (386SX-16))

then...

OUT 70,2F (CMOS Reg 2F, usually the low byte of the checksum).
IN AL,71
If bit 4 high, then OK.

If all that passes, then it will play the sound in the intro, although it does get stuck in the game itself.

POP2 allows the PS/1 card to be used as a "sound device" as well as a "music synth". It does some reading/writing to 0x0200-0x0204 (excluding the joystick at 0x0201). Possibly some sort of sample-playing facility? The mystery deepens...

Reply 1 of 91, by Great Hierophant

User metadata
Rank l33t
Rank
l33t

Did you compare the output between the PS/1 and the Tandy options in KQ5? They should sound the same, unless the PS/1's TI SN74696 clone's tone generators are operating at different frequency. Interestingly, MobyGames does not include Tandy sound for PoP2's list of supported sound devices, yet the disk says "For IBM/Tandy & 100% compatibles."

That the PS/1 Audio Card supports sampled sounds is known, but how it supports those samples may be lost to time. The Tandy sound chip that combined the Waveform Generator and the DAC is called the PSSJ and is detailed in 1000 technical references available online. Perhaps IBM took more inspiration from its rival?

Reply 2 of 91, by jmk

User metadata
Rank Newbie
Rank
Newbie

Well, just judging by ear, the KQ5 music sounds the same in Tandy and PS/1 mode.

You don't think that IBM had a load of old PCjr parts lying around that they had to get rid of? 😉

The version of KQ5 I have doesn't seem to support samples, so I'm still looking at PoP2 to try and figure out the "DAC" part of it. It's still a bit confusing, but at least I think I've found the start of the code that sets up a single-play sample.

Reply 3 of 91, by Great Hierophant

User metadata
Rank l33t
Rank
l33t

Sierra does have an option for Tandy SL, TL & RL series; those machines support the Tandy DAC. However, you are correct in that the driver does not support digital sound, lazy Sierra. Why bother with the option at all?

Reply 4 of 91, by jmk

User metadata
Rank Newbie
Rank
Newbie

I've compared the two and I think they're different.

The PS/1 driver (for PoP2 at least) uses what looks like a FIFO, rather than DMA. It does trigger IRQ7 and the interrupt handler reads some status bits and feeds more to the FIFO (via an OUTSB).

It also uses ( 1,000,000 / HZ ) - 1 for calculating the timing, rather than the Tandy DAC's ~3.57 Mhz clock.

Another thing to note is that the PoP2 Tandy driver uses direct I/O (not the BIOS calls) so you don't get any DAC sounds under DOSBox... 🙁

Reply 5 of 91, by jmk

User metadata
Rank Newbie
Rank
Newbie

I thought I was getting somewhere... I got the PoP2 DAC playing and Space Quest 4 playing (with a bit of stutter - it doesn't use interrupts, just keeps on feeding the FIFO).

But... get to level 2 on PoP2 and things go wrong.

It plays a long sample then ends up with:
"CPU:Illegal Unhandled Interrupt Called F".

So... after a time of happy IRQ 7 triggering, that error is reported and IRQ 7 never triggers again...

Hmm... what does the error mean exactly? A re-entrant IRQ? A CPU trap interfering?

Still puzzled. 🙁

Reply 6 of 91, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

what does the error mean exactly?

This is the default callback handler, means that irq7 was not hooked by
the game (at the moment when the irq7 is executed).
Maybe add a dummy handler that issues an out 20,20 to acknowledge the irq.

Reply 7 of 91, by jmk

User metadata
Rank Newbie
Rank
Newbie

OK, thanks.

The interrupt routine was trying to loop a sample by calling the "play sample" function again, which was resulting in a flag bit (which I assumed to be "confirm that the audio card caused the interrupt") to be low when the IRQ was reentered, which resulted in it calling the old IRQ routine - which just happened to be the unhandled one.

Well, apart from some on-off clicks and a little bit of stutter on SQ4, I'd say that the PS1 Audio Card emulation was (un)officially "OK".

Tested on:
Prince Of Persia 2 (Interrupt-driven FIFO).
Space Quest 4 (Manually-fed FIFO).
King's Quest 5 (No DAC, just SN76496).

Space Quest 4 has the distinction of not having Tandy support, so it's the only one that gives you (sort of) something new. 😎

Reply 8 of 91, by Servo

User metadata
Rank Newbie
Rank
Newbie
jmk wrote:

Space Quest 4 has the distinction of not having Tandy support, so it's the only one that gives you (sort of) something new. 😎

If you want to hear Space Quest 4 with Tandy sound this is supported in the 16 color version of the game; from memory I think it also worked fine if you copied the drivers from the 16 color version to the 256 color version. I've always wondered what the PS/1 audio card sounded like, it's one of the few sound cards I haven't heard in action!

Reply 9 of 91, by jmk

User metadata
Rank Newbie
Rank
Newbie
Servo wrote:

If you want to hear Space Quest 4 with Tandy sound this is supported in the 16 color version of the game; from memory I think it also worked fine if you copied the drivers from the 16 color version to the 256 color version.

Ah, I didn't know about that one. Scratch the "original content" idea. 😊

I've now tested it on the following:

  • Prince Of Persia ("ibmg" on command line - SN + DAC) - OK.
    Prince Of Persia 2 (SN + DAC) - OK.
    Bard's Tale III (SN - opening title) - OK.
    Space Quest IV VGA (SN + DAC) - OK, occasional stutter.
    King's Quest V EGA (SN) - OK.

I've also found some play & record VOC programs that someone made, so I'll have a look at them as well.

Servo wrote:

I've always wondered what the PS/1 audio card sounded like, it's one of the few sound cards I haven't heard in action!

Erm, sounds a bit like a Tandy... with a DAC. 😅

The FIFO method plays sounds as clearly as the SB, but taking a bit more CPU time (but still quite a bit less than direct I/O). I'll stick a build on a patch thread soon, assuming that's the correct course of action around here.

Reply 10 of 91, by jmk

User metadata
Rank Newbie
Rank
Newbie

OK, time is a bit limited for me (at the moment) so here is a build...

dosbox.conf accepts the following new fields for this version:

ps1audio=true
ps1audiorate=22050

These two activate the IBM PS/1 Audio Card. It is always situated at ports 0200, 0202-0204, so there's no need for a "base" value.

machine=AMSTRAD

This activates the Amstrad PC1512 video mode (640x200x16) - an extension to standard CGA, for the handful of software that can actually use it... Some occasional glitchy issues, possibly BIOS text problems to blame.

Attachments

  • Filename
    dosbox_ps1_amstrad_experimental.zip
    File size
    681.6 KiB
    Downloads
    1131 downloads
    File comment
    IBM PS/1 Audio Card and Amstrad PC1512 video mode WIP version.
    File license
    Fair use/fair dealing exception

Reply 12 of 91, by jmk

User metadata
Rank Newbie
Rank
Newbie

Ah... 🙄

Here's a quick grab of the "unabridged" src dir.

Attachments

  • Filename
    dbps1am_src.zip
    File size
    991.41 KiB
    Downloads
    1101 downloads
    File comment
    Quick grab of the src dir of PS/1 and Amstrad first build.
    File license
    Fair use/fair dealing exception

Reply 13 of 91, by Myloch

User metadata
Rank Oldbie
Rank
Oldbie

Oh fuck... you're THE MAN Jmk... I waited for Ps/1 soundcard emulation for AGES!!! I'm so happy that I'm crying 😁 I had an IBM PS/1 386sx 20mhz when I was a child and now finally I can play again Silpheed and Bushbuck with decent music/sound. Note: other games that supported Ibm ps1 card were Roger Rabbit and Rocketeer (and maybe some other Disney software). Thank you thank you thank you, ps/1 emulation works great (except some minor problems):

TESTED GAMES:
King's Quest 5 (very good)
Silpheed (good - some random corrupt/static sound)
Prince of persia 1 (very good - disable other sound cards to avoid adlib music loops when you kill first enemy at level 2, maybe other bugs)
Prince of persia 2 (very good - even with ambient music activated, you can hear Ps/1 music only during intro, intermissions and when you die. I'm not sure this is a bug!)
Rocketeer (good - random sound skips/repete, pitch is too high)
Roger Rabbit (good - same problems as rocketeer)
Stunt island (good - same problems as rocketeer)
Bushbuck (good - sound pitch/speed is too low)

The pitch/speed problem is weird: some games seem to have too high pitch, others too low.
By ear, memory and confronting with pc speaker, adlib and sb counterparts, pitch should be approximately +1st and speed +3% (for Bushbuck)
For Rocketeer (and probably also Roger Rabbit and Stunt Island) speed is correct but pitch should be -1st.

Keep up the good work! 😀

Last edited by Myloch on 2008-05-24, 19:15. Edited 1 time in total.

Reply 14 of 91, by jmk

User metadata
Rank Newbie
Rank
Newbie

One happy customer. 😉

Thanks for the testing, I've found that Stunt Island and Roger Rabbit 2 read port 0203 for proper detection. (Gets rid of the "I can't find the card, force it?" question on the installer).

Also, Bush Buck reads ports 0205 and 0206 and expects both to return 0 if the PS/1 card is present.

Prince of Persia is a strange one. I wonder if it could happen on the real thing? V1.0 of the EXE will play Adlib music with PS/1 samples, if it detects both, whereas V1.3 of the EXE will use PS/1 music with PS/1 samples, even if the Adlib card is present.

Skipping and repeating are still issues I need to figure out, but hopefully I will.

Reply 15 of 91, by Myloch

User metadata
Rank Oldbie
Rank
Oldbie

Made other tests and I'm pretty sure that SN76496 music generated pitch and speed for Bush Buck are wrong: they should be "pitch +1 st" and "speed +3%".
No problems with Prince of persia 1 and 2 (100% correct SN76496 and DAC). Another situation for King's Quest 5 and Silpheed (100% correct SN76496 but wrong DAC pitch, 1 semitone too high). Again another different case for Rocketeer and Roger Rabbit (wrong DAC pitch, it should be -1st)
very strange behaviours!!!

I have a very good musical ear and I played all these games on a real Ps/1 with audiocard for so many years that I'm pretty sure about what I'm saying. 😀

I used ctrl-f6 to record wav files and Audioretoucher 3.1.2.13 for my tests.

And yeah, prince of persia 1 is a strange one: the adlib music loop is not necessarily a dosbox bug, it can also be a game bug.

Reply 17 of 91, by jmk

User metadata
Rank Newbie
Rank
Newbie

Here is a new version which fixes skipping/repeating (bug in FIFO_FULL flag) and reduces "pops". Detection is better (as mentioned in a previous post) so it should help in certain cases where a game would decide to use the internal speaker for sample playing instead (e.g. Stunt Island).

Further testing is, of course, appreciated. 😁

Neville wrote:

Sounds interesting. Will this be on the next official version?

That's up to the maintainers. 😉

The one source file that has changed since the previous source attachment is included in the zip.

Attachments

Reply 18 of 91, by jal

User metadata
Rank Oldbie
Rank
Oldbie
Myloch wrote:

very strange behaviours!!!

If it is exactly +/-1 semitone, one would almost think (without having any knowledge of the PS/1 audio card) that there's some register one can set a semitone offset or something. But I doubt jmk would have missed that...

JAL

Reply 19 of 91, by Myloch

User metadata
Rank Oldbie
Rank
Oldbie

yes this is a mistery. I dunno if it's like Jal said because some games seem correct and I cannot be 100% sure the difference is exactly 1 semitone.
In Bushbuck the problem is more evident and it has obviously something wrong.

I'm looking for some old tape recordings of Ps/1 songs I made when I was a little child (yes, I was a crazy maniac), if they are not lost in time, that could help.

Dunno if it can help jmk, I have got some old ibm hardware pieces (one of them is the ps/1 audio/joystick card), I can snap some hires photos of the board front/back and post them here.