VOGONS


Reprogramming the PIT

Topic actions

Reply 22 of 29, by QBiN

User metadata
Rank Oldbie
Rank
Oldbie
HunterZ wrote:

haha. Unfortunately I'm too lazy to set up a DOS partition to test your program. It does sound pretty neat though.

I'm surprised no one has mentioned the infamous PC Speaker audio driver for Win3.x?! It could play just about anything so long as the software was able to downmix it.

Like all the games you played with in the past, Hunter, that you mentioned -- they all worked off the same principle that Cheetah is discribing.

Reply 23 of 29, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

I played around with the Windows one a little. I seem to remember a Star Trek package I picked up for Win3.1....I want to say it used a tech called QAudio or something like that?

I never saw much use for Windows 3.1 tho since I did everything in DOS.....doing anything in Windows 3.1 seemed like a step backward. 😉

How To Ask Questions The Smart Way
Make your games work offline

Reply 24 of 29, by Zup

User metadata
Rank Oldbie
Rank
Oldbie

Pinball Fantasies 1 and 2 also supported MOD music through PC Speaker.

I have traveled across the universe and through the years to find Her.
Sometimes going all the way is just a start...

I'm selling some stuff!

Reply 25 of 29, by Spotted Cheetah

User metadata
Rank Newbie
Rank
Newbie

Yes, i have Pinball Fantasies, it not only just plays MODs on the speaker, but fakes higher color depth in 16 color screen modes 😀 (by swapping fastly two different colored images, so as they alternate 35 times in a second, the two colors become looking like one) That game was designed with absolutely the greatest coding techniques existing in it's age! I also have a lot of old PC Squakeries which i could try out on my old 4.86 until it worked.

BTW only the basements of my code existed before, everyone used 22KHz at 6bit then (or 11KHz resulting in that well - known annoying constant high - pitch beep). What i never had seen before are the use of higher update rate than the data's frequency, and the sound dithering technique as a second layer which well fakes 217 volume levels under any of the frequencies (It actually works on 5KHz, but because of that there the difference is very low between the speaker states, it only generates more silent sub - beeps than the music, and these sub - beeps are not constant either, so it can not be heard). I may also consider it new at least in the PC Speaker world to extend that 217 levels to 255, although this is really just a little trick.

Yesterday and this day i picked my PC speaker out of my PC's case and built a paper box for it 😁 - now really nobody would tell what kind of music playing is that unless i tell it - actually for me it really sounds as good as my sound card - but that XWave thing is really just some nameless crap... In 8bit mode it is horrible, this speaker driver produces much more clean music than it - although in 16bit it is OK.

HunterZ: You told you played, but did not create a DOS partition... Then how? Writing a CD, or booting from some USB device? I doubt you did from floppy as i think it would not be more than an utter crap to play from one - prebuffering would suffer.

Left this dictatoric junk. No. IV.

Reply 26 of 29, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

No I said I haven't tried it at all because I am too lazy.

Burning to a CD and then booting DOS from a floppy may be a good alternative to creating a DOS partition though.

Also, do you have a Sound Blaster 16? If so, you can connect your motherboard's PC Speaker output to a PC Speaker input connector on the SB16 and make recordings of it. I suppose the SB16 would have to be in a separate computer though do to your program's requirement of running in pure DOS.

Reply 27 of 29, by Spotted Cheetah

User metadata
Rank Newbie
Rank
Newbie

As i said i have some "nameless" stupid XWave card (I say "nameless" since i never found this card anywhere on the Net, again, the family's dumb ideas, this one from 1998... Now they suffer this stupid halfly gov. paid crap which can not run anything properly for them, and it is impossible to install anything but WinXP on it... - except DOS). But i doubt you would experience too much change compared to the original 8bit input as the thing should be able to record at maximally 44KHz where the speaker suspendings disappear... The only change in the waveform would be some little fluctuating compared to the original based on how the second layer ditherizer deals with the playback (So you would see actually 57 volume levels, but in some manner like how you reduce the color depth of an image). The ditherizer itself might be emulated easily if you wish to do that: if you reduce the bit depth with such a method of a wave you should get a music very similar to the one generated by my code.

By the way i think if you burn a DOS bootable CD (RW), it should work fine. Get a Win95 / 98 startup floppy (or floppy image), and copy the data you find on it on the booting area of the CD (CDs are booted as a "floppy" by the BIOS, and can access the actual CD data through a CD driver later). On the data area copy my program, and a test.wav, and if you wish, include a command in the "autoexec.bat" which starts it (Although it is not a too good idea unless you know what letter will your CD drive get during the booting - it varies from PC to PC depending on the other drives).

An other way is to use a floppy with an older (6.22) DOS which had RAMDRIVE.SYS. With that you can create a virtual disk in the XMS. So after booting from it, you can copy the music piece in the memory drive, then the player will be able to play it through nicely. Although on a single floppy not too much music can be copied...

(For other purposes before i used both methods and they worked... I created a retro game CD once with my self - made menu program which could boot the PC in DOS and automatically started - that time DOSBox did not exist, but stupid WinXP already did, so this was the best solution to show off such things. The RAMDRIVE trick was needed for the same purpose too, i think i wished to show a good old DOS game to somebody who had that damned WinXP again, but i did not have CDRW. So i copied the game in a few floppies, created such a boot floppy, then after first loading all the disks' contents in the ramdrive, the game could be started and played... What a mess have to be done to evade those bloody dictators! 😜 )

Left this dictatoric junk. No. IV.

Reply 28 of 29, by Spotted Cheetah

User metadata
Rank Newbie
Rank
Newbie

From now the squaker is really downloadable form my web page ( http://ruch.co.nr/ ) Since the last version i just made it a bit more functional so that now you can exit during playing, or set the volume (actually you can select from 4 pre - defined volumeforms with that). I also fixed up and corrected a few things in the code itself which did not really affect the playback - who is interested in the code although should really download that instead.

Left this dictatoric junk. No. IV.

Reply 29 of 29, by felipe.sanches

User metadata
Rank Newbie
Rank
Newbie

Pinball Fantasies used pulse width modulation to play music on the pc speaker. I would like to know how does dosbox handles it when we select Internal Speaker in the sound config.

I have tested a little and noticed that:
Gravis Ultrasound plays slower than Internal Speaker
Sound Blaster plays louder than Internal Speaker.

But what amazes me is that it plays in Internal Speaker mode. And this used to work nice on the real DOS (probably using PWM) Then, how does dosbox traenslate PWM to ALSA ?!?!?! (im running in linux)