Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

mplayer under dos/hx | Khusraw's source code (DOSX)

posted by Laaca Homepage, Czech republic, 24.02.2011, 22:11

Well, I have never tried to compile the SDR drivers. I only used it as a inspiration for LiveCD (http://www.laaca.borec.cz/soubory/livecd.zip)

Anyway I wrote an API description too. I don't know how much is it useful but it just Wolfgang Hesseler sent to me:


SOUND_EXT_Detect proc near
;Detects the sound chip and initializes it.
;Note: If you reprogram any register for detection you must restore its
;previous content.

;API Version 0:
;Input: ecx: API version: 0 (for API Version 0)
;Output: eax: 0 if chip wasn't detected, otherwise pointer to
; Null-terminated string with the name of the chip
; ecx: undefined, but not of the form ffffffxxH

;API Version 1:
;Input: eax: address of function that translates linear addresses to
; physical addresses
; ecx: API version: 1: 1 (for API Version 1)
;Output: eax: 0 if chip wasn't detected, otherwise pointer to
; Null-terminated string with the name of the chip
; ecx: API version negated (i.e. -1 for current version)

endp


SOUND_EXT_QueryPlayback proc near
;Check playback capabilities. Return the best possible sound chip parameter
;for the input parameters (in case of AC97 it will usually return sampling
;frequency 48000 and doesn't change sample bits and stereo/mono).
;Input: eax: Sampling frequency
; bl: Sample bits (8 or 16)
; bh: Channels (1 for mono, 2 for stereo)
;
;Output:eax: Sampling frequenxy
; bl: Sample bits (8 or 16)
; bh: Channels (1 for mono, 2 for stereo)

endp


SOUND_EXT_InitPlayback proc near
;Initialize playback with the given parameters but don't start playback.
;Input: eax: sampling frequency
; bl: Sample bits (8 or 16)
; bh: Channels (1 for mono, 2 for stereo)
; ecx: Length of DMA buffer
; edx: Physical Address of DMA buffer start
; edi: Linear Address of DMA buffer start
;
;Output:Carry set on error

endp

;Note: SOUND_EXT_InitPlayback will usually be called with the parameters
; returned by SOUND_EXT_QueryPlayback


SOUND_EXT_StartPlayback proc near
;Start playback of sound that is initialized with SOUND_EXT_InitPlayback.
;Input: ecx: Address of callback routine, call this function with each
; interrupt, i.e. after edx bytes were played.
; edx: Number of bytes after which an interrupt must be generated

endp


SOUND_EXT_StopPlayback proc near
;Stop playback of sound.

endp


SOUND_EXT_SetVolume proc near
;Input: al: Left channel [0..255]
; ah: Right channel [0..255]

endp


SOUND_EXT_Pause proc near
;Pause sound immediately.

endp


SOUND_EXT_Resume proc near
;Start playback of sound again that was paused with SOUND_EXT_Pause

endp


SOUND_EXT_GetPlaybackPosition proc near
;Get sample that is currently played as offset from the address of DMA
;buffer start (in bytes)
;Output:eax: Sample byte position

endp


SOUND_EXT_Deinstall proc near
;Deinstall all external driver support.

endp


;Copy the data from PC memory to the (onboard) sound chip memory. For chips
;that support playback directly from DMA memory this function will just
;return immediately.
;Note: API ver. 1 and later only
;Input: ecx: Length in bytes
; esi: Start of data to be copied
; edi: Offset of Data in onboard memory

SOUND_CopySound proc near
ret
endp


The order of the functions is in
API Version 0:
SOUNDdriverRoutines
SOUND_EXT_Detect
SOUND_EXT_QueryPlayback
SOUND_EXT_InitPlayback
SOUND_EXT_StartPlayback
SOUND_EXT_StopPlayback
SOUND_EXT_SetVolume
SOUND_EXT_Pause
SOUND_EXT_Resume
SOUND_EXT_Deinstall
SOUND_EXT_GetPlaybackPosition
SOUND_EXT_InitRecord
SOUND_EXT_StartRecord

API Version 1:
SOUNDdriverRoutines
SOUND_EXT_Detect
SOUND_EXT_QueryPlayback
SOUND_EXT_InitPlayback
SOUND_EXT_StartPlayback
SOUND_EXT_StopPlayback
SOUND_EXT_SetVolume
SOUND_EXT_Pause
SOUND_EXT_Resume
SOUND_EXT_Deinstall
SOUND_EXT_GetPlaybackPosition
SOUND_EXT_CopySound
SOUND_EXT_InitRecord
SOUND_EXT_StartRecord

---
DOS-u-akbar!

 

Complete thread:

Back to the forum
Board view  Mix view
22289 Postings in 2062 Threads, 399 registered users, 169 users online (0 registered, 169 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum