Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


pcspeaker outports//inports ? How to

This topic is 5531 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi gurus need some help about making sounds with the pc speaker maybe you could tell me how ? ore you have a link for me where i can read throuh ? I remember that there are some strange ports outport and inport but i don´t know the exact hexa dezi ________ thanks nxo

Share this post

Link to post
Share on other sites

all i had off hand.
basically you need to get very cozy with the intel 8254 PIT (programmable interutp timer) or atleast ports 0 and 2.

you need to then output the frequency of the sound to timer port2.

the freq is set in hertz, (the basis for a divsor is, 1193180hz, 4.77/4mhz)
the output value should be 1193180 / hz. (this of course gives you the cycle rate in seconds (or tiny fraction thereof), which is important, becuase the switcing is done by a timer)

out 43h, 0xb6 (10100110b)the reason for this (or more accuratly the meaning of the bits) is explained http://www.geocities.com/SiliconValley/Sector/7256/tutor/MHEART.TXT

to turn the speaker on you need to binary or port 61h with 0x03
in al, 61h
or al, 0x03
out 61h, 0x03

to turn it off you clear those bits.
mov bl, 0x03
not bl
and al, bl

[edited by - Freidog on April 29, 2003 5:28:24 AM]

Share this post

Link to post
Share on other sites
oh thank goodness somebody answered
i sat all night searchig the net for some tutorials about the pc speaker
thank you for your advice
i´ll try it in a second
thanks again

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!