AC97 在 DOS 下的 .WAV/.MP3 播放程式, 支援 Intel ICH? 及 VIA 868/8233 及部份的 SIS 及 AMD AC97晶片.
http://upload.cn-dos.net/img/919.zip
此程式的 AC97 控制是參考 WSS.C 程式, MP3 的 decoder 則是參考 allegro library (
www.allegro.cc) 中的 almp3 函式庫修改而成的
這是我接受委託, 幫某TV Game公司專屬的遊戲平台(使用 Intel 852)的, 最終要開發的是一個 djgpp 配合 allegro library 使用 的 AC97 Sound 函式庫, 此播放程式只是驗證功能而已.
本程式若在 Intel ICH 主板播放, 可以正確的設定 samles rate (44.1K), 但在 VIA 868/8233 則 samples rate 無法調整, 只可以以 48000 播放, 會感覺音樂播的快一點.
有些人會問為什麼不寫成 SB 相容的驅動, 我的回答是不可能, 若你的主板沒有提供 SB 相容模式, 是絶不可能可以寫成 SB 相容的驅動.
原因在於 SB 的標準 Control I/O 假設為 0x220, 所有的控制碼都會送到此埠位址, 若主板在此位址無相容 SB 的 controller 作處理, 是絶不會有動作的, 反而 IRQ / DMA 及 TSR 都是很容易達成的, 但....還是沒得商量...若主板沒有提供 SB 相容模式的話
AC97 playback program under DOS for .WAV/.MP3, supports Intel ICH? And VIA 868/8233 and some SIS and AMD AC97 chips.
http://upload.cn-dos.net/img/919.zip
The AC97 control of this program is referenced from the WSS.C program, and the MP3 decoder is modified from the almp3 library in the allegro library (
www.allegro.cc)
This is what I accepted the commission for, for a game platform exclusive to a certain TV Game company (using Intel 852). The final thing to develop is an AC97 Sound library using djgpp with the allegro library. This playback program is just to verify the function.
When this program is played on an Intel ICH motherboard, it can correctly set the samples rate (44.1K), but on VIA 868/8233, the samples rate cannot be adjusted and can only be played at 48000, which will make the music play faster.
Some people will ask why not write an SB-compatible driver. My answer is impossible. If your motherboard does not provide an SB-compatible mode, it is absolutely impossible to write an SB-compatible driver.
The reason is that the standard Control I/O of SB is assumed to be 0x220, and all control codes will be sent to this port address. If the motherboard has no compatible SB controller to process at this address, there will be no action at all. Also, IRQ/DMA and TSR are all easy to achieve, but.... still no negotiation... If the motherboard does not provide an SB-compatible mode