home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Audio 4.94 - Over 11,000 Files
/
audio-11000.iso
/
msdos
/
sndbords
/
proaudio
/
pcmtlsrc
/
pcmtlsrc.arj
/
PCM.ARJ
/
INT94.INC
< prev
next >
Wrap
Text File
|
1992-08-31
|
7KB
|
405 lines
;$Author: BCRANE $
;$Date: 31 Aug 1992 09:34:34 $
;$Header: X:/sccs/sdkapp/int94.inv 1.1 31 Aug 1992 09:34:34 BCRANE $
;$Log: X:/sccs/sdkapp/int94.inv $
;
; Rev 1.1 31 Aug 1992 09:34:34 BCRANE
;added support for 16-bit
;
; Rev 1.0 29 Jul 1992 16:57:38 BCRANE
;Initial revision.
;$Logfile: X:/sccs/sdkapp/int94.inv $
;$Modtimes$
;$Revision: 1.1 $
;$Workfile: int94.inc $
db 'int94.inc: copyright Media Vision, Inc., 1992', 00h
;; intr94 - PCM interrupt handler
if VERBOSE
align 256
db 'START OF INT94 VARIABLES:'
endif
align 16
DMADONEFLAG dw 0
if VERBOSE
db ':DMADONEFLAG'
endif
align 2
MAXI94FUNCS equ 12
dispatch:
d_i94f00 dw offset _i94f00
d_i94f01 dw offset _i94f01
d_i94f02 dw offset _i94f02
d_i94f03 dw offset _i94f03
d_i94f04 dw offset _i94f04
d_i94f05 dw offset _i94f05
d_i94f06 dw offset _i94f06
d_i94f07 dw offset _i94f07
d_i94f08 dw offset _i94f08
d_i94f09 dw offset _i94f09
d_i94f10 dw offset _i94f10
d_i94f11 dw offset _i94f11
if VERBOSE
align 16
db 'I94INHERE:'
endif
i94inhere dw 0
align 2
MAXI94SPEC equ 24
shark:
s_i94f80 dw offset _i94f80, offset _i94f81
dw offset _i94f82, offset _i94f83
dw offset _i94f84, offset _i94f85
dw offset _i94f86, offset _i94f87
dw offset _i94f88, offset _i94f89
dw offset _i94f8A, offset _i94f8B
dw offset _i94f8C, offset _i94f8D
dw offset _i94f8E, offset _i94f8F
dw offset _i94f90, offset _i94f91
dw offset _i94f92, offset _i94f93
dw offset _i94f94, offset _i94f95
dw offset _i94f96, offset _i94f97
if VERBOSE
align 256
endif
int94check:
pcmversion dw 02h
pcmverstring db 'PCMDRIVER', 0
org int94check+11
intr94 proc far
sti
inc word ptr cs:id94.cnt ; for the hell of it
or si, si ; test for high bit set
jns i94default ; no, not a shark call
push si ; save it
and si, 07FFFh ; make positive
cmp si, MAXI94SPEC ; out of range?
jb @F ; si < MAX and > 0
pop si ; restore
iret
@@: push ax
shl si, 1
mov ax, word ptr cs:[shark][si]
or ax, ax
pop ax ; restore
jnz @F
pop si
iret
@@: push di ; should not be necessary
call word ptr cs:[shark][si] ; only ax,dx,si can change
pop di ; was saved for safety
pop si ; restore
iret
i94default:
cmp si, MAXI94FUNCS ; out of range?
jb @F ; si < MAX and > 0
iret ; request out of range
@@: push si ; last restore before return
shl si, 1 ; index
cmp word ptr cs:[dispatch][si], 0 ; address valid?
jnz @F ; yes, continue
pop si ; not a supported function
iret
@@: cli ; no interruptions
test word ptr cs:[i94inhere], 0FFFFh ; are we in int 94 already?
jnz @F ; yes, stack is set
; set stack now if desired
@@: inc cs:[i94inhere] ; we are in here
sti ; okay, let someone else go
push ax ; save for possible restore
push dx
push bx ; dx:ax may be affected
push cx
push si
push di
push es
push ds
push bp
mov ax, cs ; ds= cs
mov ds, ax
call word ptr cs:[dispatch][si] ; ss= user stack
pop bp
pop ds
pop es
pop di
pop si
pop cx
pop bx
cli ; no interruptions
dec cs:[i94inhere] ; we are exiting
jnz @F ; not zero, called by i94f?
; reset stack if desired
@@: sti ; okay, i feel safe now
shr si, 1 ; si= function number
cmp si, 0
jz popnone94
cmp si, 1
jz popdx94
cmp si, 2
jz popdx94
cmp si, 3
jz popnone94
cmp si, 4
jz popboth94
cmp si, 5
jz popdx94
cmp si, 6
jz popdx94
cmp si, 7
jz popboth94
cmp si, 8
jz popboth94
cmp si, 9
jz popboth94
cmp si, 10
jz popboth94
cmp si, 11
jz popnone94
jmp short popboth94
popboth94:
pop dx
pop ax
jmp short done94
popdx94:
pop dx
add sp, 2
jmp short done94
popnone94:
add sp, 4
jmp short done94
done94:
pop si ; oh, yeah
iret
intr94 endp
;; init94() - call int 94h, function 0
initf2 dd 11025 ; default samplerate
dw 0 ; default mono/stereo
dw 0 ; default compression
dw 8 ; default datasize
init94 proc near
pushall
call InitMVSound
call InitPCM
push word ptr initf2[8]
push word ptr initf2[6]
push word ptr initf2[4] ; channels
push word ptr initf2[2] ; hi word of samplerate
push word ptr initf2[0] ; lo word of samplerate
call PCMInfo
add sp, 10
popall
ret
init94 endp
machinetable dw offset badmachine
machinetype equ offset badmachine - offset flawlist
setupptr proc
mov dx, machinetable
push dx
sub dx, machinetype + 1 ; d2- (d2-d1+1) = d1-1
or dx, dx
jz st_setupptr
mov ax, di
st_setupptr:
inc dx ; next element
inc cx ; set count
push dx ; save address
push sp ; save frame address
pop di ; restore target pointer
inc bx ; next data value
push dx ; save
inc cx ; set up for bytes
dec si ; back up to source
inc bp ; set flag
flawlist:
ret ; we are done
badmachine:
inc si ; next source
dec bx ; backup in table
dec bp ; clear flag
sub cx, 2 ; word count
mov di, ax ; linked list
exitsetupptr:
ret
setupptr endp
;; functions - all int 94h functions use the following:
;; es:bx points to parameters
;; si= function # * 2
;; ds points to cs
;; ;;;ss:sp points to internal stack
;; ax, dx may return parameters
;; bx, cx, si, di, es, ds are trashable
;; flags are undefined
assume ds:_text
include _i94f00.inc
include _i94f01.inc
include _i94f02.inc
include _i94f03.inc
include _i94f04.inc
include _i94f05.inc
include _i94f06.inc
include _i94f07.inc
include _i94f08.inc
include _i94f09.inc
include _i94f10.inc
include _i94f11.inc
;; shark functions
;; dx:ax can be used to return values
;; si can be trashed
;; no other precautions taken
assume ds:nothing
include _i94f80.inc
include _i94f81.inc
_i94f82 proc
ret
_i94f82 endp
_i94f83 proc
ret
_i94f83 endp
include _i94f84.inc
_i94f85 proc
ret
_i94f85 endp
_i94f86 proc
ret
_i94f86 endp
_i94f87 proc
ret
_i94f87 endp
_i94f88 proc
ret
_i94f88 endp
_i94f89 proc
ret
_i94f89 endp
_i94f8A proc
ret
_i94f8A endp
_i94f8B proc
ret
_i94f8B endp
_i94f8C proc
ret
_i94f8C endp
_i94f8D proc
ret
_i94f8D endp
_i94f8E proc
ret
_i94f8E endp
_i94f8F proc
ret
_i94f8F endp
_i94f90 proc
ret
_i94f90 endp
include _i94f91.inc
if DOI94F92
include _i94f92.inc
include _i94f93.inc
include _i94f94.inc
include _i94f95.inc
include _i94f96.inc
else
_i94f92 proc
ret
_i94f92 endp
_i94f93 proc
ret
_i94f93 endp
_i94f94 proc
ret
_i94f94 endp
_i94f95 proc
ret
_i94f95 endp
_i94f96 proc
ret
_i94f96 endp
endif
_i94f97 proc
ret
_i94f97 endp