home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
QBAS
/
RUKQ10.ZIP
/
RUCKDAC.BI7
< prev
next >
Wrap
Text File
|
1993-02-15
|
13KB
|
292 lines
'RUCKDAC.BI 10-Jan-93 BETA 0.50 ------------------
'BETA NOT FOR PUBLIC RELEASE
'Do not distribute this release
'Do not create programs for distribution with this release
DECLARE FUNCTION RUCKDAC% (SEG packinfo AS ANY)
CONST SysInfoDac = 0, InitDac = 1, ExitDac = 2, AtExitDac = 3
CONST LoadDac = 4, PlayDac = 5, RecordDac = 6
CONST StoreDac = 7, EndDac = 8, PauseDac = 9
CONST DeallocDac = 10
CONST SetAllDac = 20, SetVolumeDac = 21, SetIntRateDac = 22, SetPriorityDac = 23
CONST GetBufferDataDac = 28, GetBytePosDac = 29
CONST SetAllSBP = 30, SetVolMainSBP = 31, SetVolVocSBP = 32
CONST SetLevelMicSBP = 33, SetLevelCDSBP = 34, SetLevelLineSBP = 35
CONST SetFilterOutSBP = 36, SetFilterInSBP = 37
CONST SetSourceSBP = 38, SetStereoSBP = 39
CONST SetSpeakerSB = 40
CONST GetMixerRegSBP = 48, GetDacSB = 49
CONST ExitMod = 50, AtExitMod = 51
CONST LoadMod = 52, PlayMod = 53
CONST EndMod = 54, PauseMod = 55
CONST SetIntRateMod = 56, SetSpeedMod = 57
CONST SetVolumeMod = 58, SetPositionMod = 59
CONST SetStereoMod = 60, SetFastMod = 61
TYPE DeallocPackTYPE 'DP
Func AS INTEGER
stat AS INTEGER
HandSeg AS INTEGER 'RUCKUS allocates either XMM handle or DOS para
TypeFlag AS INTEGER '0=DOS para, 1=XMS handle
END TYPE '8
TYPE GetDataPackTYPE 'GDP
Func AS INTEGER
stat AS INTEGER
BytePos AS LONG 'current byte relative base ptr (27)
BufferPtrOff AS INTEGER 'far pointer to buffer to fill with data,offset
BufferPtrSeg AS INTEGER 'segment
StartPos AS LONG 'start get at this offset relative BufferPtr
BufferCnt AS INTEGER 'bytes to fill (2-65520)
MixerReg AS INTEGER 'SBPro mixer register to get
END TYPE '20
TYPE InitPackTYPE 'IP
Func AS INTEGER
stat AS INTEGER
DeviceID AS INTEGER '0=SPKR,1=LPTDAC,2=DSS,4=SB,5=SBPro
IOport AS INTEGER
IRQline AS INTEGER
DMAch AS INTEGER
Flags AS INTEGER '(see source)
InfoPtrOff AS INTEGER 'ret:far ptr to dac info
InfoPtrSeg AS INTEGER
DacExitPtrOff AS INTEGER 'ret:far ptr to dac's ExitXB routine
DacExitPtrSeg AS INTEGER
ModExitPtrOff AS INTEGER 'ret:far ptr to mod's ExitXB routine
ModExitPtrSeg AS INTEGER
END TYPE '24
TYPE LoadPackTYPE 'LP
Func AS INTEGER
stat AS INTEGER
FilenamePtrOff AS INTEGER 'far ptr to filenameZ to load
FilenamePtrSeg AS INTEGER
StartPos AS LONG 'offset into file to start load at
LoadSize AS LONG 'number of bytes to load (or 0 for autosize)
XMMflag AS INTEGER 'if <> 0 use XMS for load
XMMhandle AS INTEGER 'ret:XMS handle, or
LoadPtrOff AS INTEGER 'ret:DOS seg:offset (offset always 0)
LoadPtrSeg AS INTEGER
END TYPE '20
TYPE PlaybackPackTYPE 'PBP
Func AS INTEGER
stat AS INTEGER
Mode AS INTEGER 'playback mode (0=interrupt FG,1=BG,2=DMA,3=DMA+BG for mod)
XMMhandle AS INTEGER 'if <> 0 this XMM handle used regardless
LoadPtrOff AS INTEGER 'seg:off to start of data to play
LoadPtrSeg AS INTEGER
BufferSize AS INTEGER 'size of DMA buffer for mod playback
END TYPE '14
TYPE PausePackTYPE 'PP
Func AS INTEGER
stat AS INTEGER
Pause AS INTEGER '0=unpause else pause
END TYPE '6
TYPE RecordPackTYPE 'RP
Func AS INTEGER
stat AS INTEGER
SampleRate AS INTEGER
XMMhandle AS INTEGER '-1 auto XMS (ret in dx) else use this handle
RecordPtrOff AS INTEGER 'seg:off of buffer to store (0 for auto-store)
RecordPtrSeg AS INTEGER
RecordBytes AS LONG 'bytes to record
StereoFlag AS INTEGER 'stereo flag
END TYPE '18
TYPE SaveDataPackTYPE 'SDP
Func AS INTEGER
stat AS INTEGER
FilenamePtrOff AS INTEGER 'far ptr to filenameZ to save
FilenamePtrSeg AS INTEGER
DataPtrOff AS INTEGER 'pointer to start of data to save, offset
DataPtrSeg AS INTEGER 'segment (or 0 if XMS)
FileType AS INTEGER '1=VOC,2=WAV
XMMhandle AS INTEGER 'XMS handle of data to save (0 if DOS data)
END TYPE '16
TYPE SetPackTYPE 'SP
Func AS INTEGER
stat AS INTEGER ' (if volume=0 SB speaker off'ed else on'ed)
Volume AS INTEGER 'volume (left ch=MSB,right=LSB) (0-127,0-127)
IntRate AS INTEGER 'playback interrupt rate (5000-23000)
Priority AS INTEGER 'priority level (0-2, default=1)
END TYPE '18
TYPE SetModPackTYPE 'SMP 'stereo modes
Func AS INTEGER 'A=ch1+ch3 & ch2+ch4
stat AS INTEGER 'B=?
VolCh1 AS INTEGER 'channel volume (0-255) 'C=?
VolCh2 AS INTEGER 'channel volumes adjustments made only
VolCh3 AS INTEGER ' if FastMode=0
VolCh4 AS INTEGER
Stereo AS INTEGER 'playback mode (0=mono,stereo 1=A,2=B,3=C)
FastMode AS INTEGER 'fast playback (0=normal,1 fast,no ch volumes)
IntRate AS INTEGER 'playback interrupt rate (5000-45500)
Position AS INTEGER 'pattern list position (0-patterns to play)
Speed AS INTEGER 'overall playback speed (1-15,default=6,15=slow)
SliceAdj AS INTEGER 'slice adjust (1-64,default=1)
END TYPE '24
TYPE SetProPackTYPE 'SPP
Func AS INTEGER
stat AS INTEGER
Volume AS INTEGER 'volume (low=right;0-15, high byte=left;0-15)
VolVoc AS INTEGER '
VolMic AS INTEGER '(mono only, 0-7) input level
VolCD AS INTEGER 'input level (0-15,0-15)
VolLI AS INTEGER 'input level (0-15,0-15)
FilterOut AS INTEGER '0=filter off, 1=filter on
FilterIn AS INTEGER '0=filter off, 1=3.2kHz, 2=8.8kHz
SourceIn AS INTEGER '0=mic,1=CD,2=line
StereoIn AS INTEGER '0=mono,1=stereo record
END TYPE '22
TYPE XitPackTYPE 'XP
Func AS INTEGER
stat AS INTEGER
END TYPE '4
TYPE SysInfoPackTYPE 'SIP
Func AS INTEGER '
stat AS INTEGER
CPU AS INTEGER 'CPU class (88,286,386,486)
CPUmode AS INTEGER '0=real mode,1=PM,2=PM w/paging
MHz AS INTEGER 'approx speed (5,20,33)
Device0 AS INTEGER '=1 speaker available
D0port AS INTEGER '42h
D0IRQ AS INTEGER 'n/a
D0DMA AS INTEGER 'n/a
D0flags AS INTEGER 'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
Device1 AS INTEGER '=1 LPT-DAC available on LPT1
D1port AS INTEGER 'port of _first_ LPT found in BIOS data area
D1IRQ AS INTEGER 'n/a
D1DMA AS INTEGER 'n/a
D1flags AS INTEGER 'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
Device2 AS INTEGER '=1 Disney Sound Source available
D2port AS INTEGER 'port of DSS
D2IRQ AS INTEGER 'n/a
D2DMA AS INTEGER 'n/a
D2flags AS INTEGER 'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
Device3 AS INTEGER '=1 AdLib available
D3port AS INTEGER '388h
D3IRQ AS INTEGER 'n/a
D3DMA AS INTEGER 'n/a
D3flags AS INTEGER 'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
Device4 AS INTEGER '=1 SB available
D4port AS INTEGER 'port of SB
D4IRQ AS INTEGER 'IRQ
D4DMA AS INTEGER 'DMA
D4flags AS INTEGER 'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
Device5 AS INTEGER '=1 SBPro available
D5port AS INTEGER 'port of SBPro
D5IRQ AS INTEGER 'IRQ
D5DMA AS INTEGER 'DMA
D5flags AS INTEGER 'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
END TYPE '70
TYPE SysDevTYPE 'SD (used by BASIC 7.1 compiler)
device AS INTEGER '=1 device available
port AS INTEGER
IRQ AS INTEGER
DMA AS INTEGER
Flags AS INTEGER 'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
END TYPE '10
TYPE SysInfoPackTYPE7 'SIP BASIC 7.1: SIP.SD(0).device = ...
Func AS INTEGER
stat AS INTEGER
CPU AS INTEGER 'CPU class (88,286,386,486)
CPUmode AS INTEGER '0=real mode,1=PM,2=PM w/paging
MHz AS INTEGER 'approx speed (5,20,33)
SD(0 TO 5) AS SysDevTYPE 'QB45 won't accept arrays in TYPEs
END TYPE '70
'---------------------------------dac_info---------------------------------
'dac@deviceID dw 0 ;0 ;device ID
'dac@IOport dw 0 ;2 ;port of device
'dac@IRQ dw 0 ;4 ;IRQ of device
'dac@DMA dw 0 ;6 ;DMA of device
'dac@Flags dw 0 ;8 ;bit0=1 use DOS UMB memory
' ;bit1-4 reserved
' ;bit5=1 force XMS2 to be used
';SB device only one that pops! ;bit6=1 force device speaker on until exit
' ;bit7=1 force passed parms to be used
' ; Following values are ret bits
' ;bit8=1 paging mechanism in force, no UMBs
' ;bit9-15 reserved
'dac@end dw 1 ;10 ;=1 end of play
'dac@pause dw 0 ;12 ;=1 pause play
'dac@umbLink dw 0 ;14 ;h=upper-memory link, l=org alloc strategy
'dac@memDOS dw 0 ;16 ;DOS memory available (in K)
'dac@memXMM dw 0 ;18 ;XMS memory available (in K)
'
' ;following data should be zeroed before each load
'
'dac@type dw 0 ;20 ;digital file type (0=SAM,1=VOC w/header,2=WAV)
'dac@memUsed dw 0 ;22 ;memory used for last file load (in K)
'dac@sampleRate dw 0 ;24 ;sample rate currently playing
'dac@stereo dw 0 ;26 ;stereo
'dac@vocLen dd 0 ;28 ;length of voc block (only current block)
'dac@vocPtrPtr dd 0 ;32 ;pointer to pointer->current data
'
'dac@recordLen dd 0 ;36 ;length of recorded data
'
'LoadClearSize = $-dac@type
'
'dac@sbpMixerPtr dd sbc@volMasterR ;40 ;pointer to SBP mixer data
' ;-4=farptr to SB data start (sbc@IRQnum)
' ;+0=volMasterR,+2=L
' ;+4=volVocR,+6=L
' ;+8=volMic
' ;+10=volCDR,+12=CDL
' ;+14=volLIR,+16=LIL
' ;+18=filterInOff,+20=filterOutOff
' ;+22=input source selected
' ;+24=input cutoff freq selected
' ;+26=1=stereo data output
' ;+27=1=high sample rate (>23kHz)
' ;+28=SB speaker on=1/off=0
' ;+30=DSPver (1xx, 2xx, 3xx)
' ;+32=sbc@DSPtype 1=SB2 or below, 3=SBPro
'dac@modDataPtr dd DGROUP:mod@type ;44 ;pointer to mod data
'
'
' -------mod section data --------------
'
'mod@type dw 0 ; 0 ;mod type (15 or 31 samples)
'mod@samples dw 0 ; 2 ;number of instrument samples in mod
'mod@headerSeg dw 0 ; 4 ;header segment (aka sample info)
'mod@patternSeg dw 0 ; 6 ;patterns' segment (1 to pats2play 1K patterns)
'mod@sampleSeg dw 31 DUP (0) ; 8 (+62) ;list of sample segments
'mod@stereo dw 0 ; 70 ;=1 then playback in stereo (only SBPro can set)
'mod@fastMode dw 0 ; 72 ;=1 then channel volume adjusts disabled
'
' ;following data should be zeroed before each initial play
' ;from mod@mt_patListPos to ...
'
'mod@mt_patListPos dw 0 ;74 ;byte position within mod@patterList (0-127)
'mod@mt_notePatPos dw 0 ;76 ;note position within pattern 1K area (0-1008)
' ;pattern#=patternList(patListPos)
' ;note is at offset (pattern#*1024)+notePatPos
' ;-- in segment mod@patternSeg
'mod@hiPattern dw 0 ;78 ;highest pattern number to play/+1!/ (0-63)
'mod@pats2play dw 0 ;80 ;patterns to play (direct DOS file load here)
'mod@patternList db 128 DUP (0) ;82 (+128) ;pattern positions (to here)
'mod@MKoverflow db 'AMIGAz' ;210 (+6) ;overflow for 31-instr patpos read
'
'mod@memUsed dw 0 ;216 ;DOS memory needed by mod file loaded (in para)
'mod@VS dw 0 ;218 ;number of times VS handler entered (50Hz rate)
'
'END RUCKDAC.BI -----------------------