Shitcan unixvoc.c and make multivoc.c work under *nix

git-svn-id: https://svn.eduke32.com/eduke32@339 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-11-16 08:51:07 +00:00
parent a75a1eb10c
commit 62c19ced26
9 changed files with 122 additions and 3064 deletions

View file

@ -72,9 +72,8 @@ AUDIOLIB_FX_SDL=$(OBJ)/mv_mix.$o \
$(OBJ)/ll_man.$o \ $(OBJ)/ll_man.$o \
$(OBJ)/fx_man.$o \ $(OBJ)/fx_man.$o \
$(OBJ)/dsl.$o \ $(OBJ)/dsl.$o \
$(OBJ)/nodpmi.$o \
$(OBJ)/unixpitch.$o \ $(OBJ)/unixpitch.$o \
$(OBJ)/unixvoc.$o $(OBJ)/multivoc.$o
AUDIOLIB_MUSIC_SDL=$(OBJ)/sdlmusic.$o \ AUDIOLIB_MUSIC_SDL=$(OBJ)/sdlmusic.$o \
$(OBJ)/unixglob.$o $(OBJ)/unixglob.$o

View file

@ -46,9 +46,7 @@ $(OBJ)/scriplib.$o: $(SRC)/jmact/scriplib.c $(SRC)/jmact/scriplib.h $(SRC)/jmact
# jAudioLib objects # jAudioLib objects
$(OBJ)/dsl.$o: $(SRC)/jaudiolib/dsl.c $(SRC)/jaudiolib/util.h $(OBJ)/dsl.$o: $(SRC)/jaudiolib/dsl.c $(SRC)/jaudiolib/util.h
$(OBJ)/nodpmi.$o: $(SRC)/jaudiolib/nodpmi.c $(SRC)/jaudiolib/dpmi.h
$(OBJ)/unixpitch.$o: $(SRC)/jaudiolib/unixpitch.c $(SRC)/jaudiolib/pitch.h $(OBJ)/unixpitch.$o: $(SRC)/jaudiolib/unixpitch.c $(SRC)/jaudiolib/pitch.h
$(OBJ)/unixvoc.$o: $(SRC)/jaudiolib/unixvoc.c $(SRC)/jaudiolib/usrhooks.h $(SRC)/jaudiolib/linklist.h $(SRC)/jaudiolib/pitch.h $(SRC)/jaudiolib/multivoc.h $(SRC)/jaudiolib/_multivc.h
$(OBJ)/audiolib_fxstub.$o: $(SRC)/jaudiolib/audiolib_fxstub.c $(SRC)/jaudiolib/fx_man.h $(OBJ)/audiolib_fxstub.$o: $(SRC)/jaudiolib/audiolib_fxstub.c $(SRC)/jaudiolib/fx_man.h
$(OBJ)/audiolib_musicstub.$o: $(SRC)/jaudiolib/audiolib_musicstub.c $(SRC)/jaudiolib/music.h $(OBJ)/audiolib_musicstub.$o: $(SRC)/jaudiolib/audiolib_musicstub.c $(SRC)/jaudiolib/music.h

View file

@ -2,7 +2,7 @@
; HM NIS Edit Wizard helper defines ; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "EDuke32" !define PRODUCT_NAME "EDuke32"
!define PRODUCT_VERSION "1.4.0 beta 2" !define PRODUCT_VERSION "1.4.0"
!define PRODUCT_PUBLISHER "EDuke32 Team" !define PRODUCT_PUBLISHER "EDuke32 Team"
!define PRODUCT_WEB_SITE "http://www.eduke32.com" !define PRODUCT_WEB_SITE "http://www.eduke32.com"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_NAME}" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_NAME}"

View file

@ -1,43 +0,0 @@
/*
Copyright (C) 1994-1995 Apogee Software, Ltd.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**********************************************************************
module: DPMI.H
author: James R. Dose
date: March 31, 1994
Inline functions for performing DPMI calls.
(c) Copyright 1994 James R. Dose. All Rights Reserved.
**********************************************************************/
#ifndef __DPMI_H
#define __DPMI_H
enum DPMI_Errors
{
DPMI_Warning = -2,
DPMI_Error = -1,
DPMI_Ok = 0
};
int DPMI_GetDOSMemory( void **ptr, int *descriptor, unsigned length );
int DPMI_FreeDOSMemory( int descriptor );
#endif

View file

@ -29,7 +29,7 @@ Adapted to work with JonoF's port by James Bentler (bentler@cs.umn.edu)
#include "SDL.h" #include "SDL.h"
#include "SDL_mixer.h" #include "SDL_mixer.h"
extern volatile int MV_MixPage; extern int MV_MixPage;
static int DSL_ErrorCode = DSL_Ok; static int DSL_ErrorCode = DSL_Ok;

View file

@ -35,7 +35,12 @@ Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com)
#ifndef _MSC_VER #ifndef _MSC_VER
#include <unistd.h> #include <unistd.h>
#endif #endif
#ifdef _WIN32
#include "dsoundout.h" #include "dsoundout.h"
#else
#include "util.h"
#include "dsl.h"
#endif
#include "usrhooks.h" #include "usrhooks.h"
#include "linklist.h" #include "linklist.h"
#include "pitch.h" #include "pitch.h"
@ -108,7 +113,7 @@ static VoiceNode *MV_Voices = NULL;
static VoiceNode VoiceList; static VoiceNode VoiceList;
static VoiceNode VoicePool; static VoiceNode VoicePool;
static int MV_MixPage = 0; int MV_MixPage = 0;
static int MV_VoiceHandle = MV_MinVoiceHandle; static int MV_VoiceHandle = MV_MinVoiceHandle;
static void(*MV_CallBackFunc)(unsigned long) = NULL; static void(*MV_CallBackFunc)(unsigned long) = NULL;
@ -139,10 +144,7 @@ int MV_ErrorCode = MV_Ok;
number. A -1 returns a pointer the current error. number. A -1 returns a pointer the current error.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
char *MV_ErrorString char *MV_ErrorString( int ErrorNumber)
(
int ErrorNumber
)
{ {
char *ErrorString; char *ErrorString;
@ -178,9 +180,11 @@ char *MV_ErrorString
ErrorString = "No voice with matching handle found."; ErrorString = "No voice with matching handle found.";
break; break;
#if defined(_WIN32)
case MV_BlasterError : case MV_BlasterError :
ErrorString = DSOUND_ErrorString(DSOUND_ErrorCode); ErrorString = DSOUND_ErrorString(DSOUND_ErrorCode);
break; break;
#endif
case MV_DPMI_Error : case MV_DPMI_Error :
ErrorString = "DPMI Error in Multivoc."; ErrorString = "DPMI Error in Multivoc.";
@ -256,11 +260,8 @@ static unsigned MV_GetBufferSize(unsigned samplerate)
Mixes the sound into the buffer. Mixes the sound into the buffer.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
static void MV_Mix static void MV_Mix( VoiceNode *voice,
( int buffer)
VoiceNode *voice,
int buffer
)
{ {
char *start; char *start;
@ -349,10 +350,7 @@ static void MV_Mix
Adds a voice to the play list. Adds a voice to the play list.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_PlayVoice void MV_PlayVoice( VoiceNode *voice)
(
VoiceNode *voice
)
{ {
unsigned flags; unsigned flags;
@ -370,10 +368,7 @@ void MV_PlayVoice
Removes the voice from the play list and adds it to the free list. Removes the voice from the play list and adds it to the free list.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_StopVoice void MV_StopVoice( VoiceNode *voice)
(
VoiceNode *voice
)
{ {
unsigned flags; unsigned flags;
@ -396,17 +391,16 @@ void MV_StopVoice
// static int backcolor = 1; // static int backcolor = 1;
int MV_ServiceVoc int MV_ServiceVoc( int buffer)
(
int buffer
)
{ {
VoiceNode *voice; VoiceNode *voice;
VoiceNode *next; VoiceNode *next;
// Get the currently playing buffer // Get the currently playing buffer
#if defined(_WIN32)
MV_MixPage = buffer; MV_MixPage = buffer;
#endif
// Toggle which buffer we'll mix next // Toggle which buffer we'll mix next
MV_MixPage++; MV_MixPage++;
@ -519,10 +513,7 @@ int MV_ServiceVoc
Interperate the information of a VOC format sound file. Interperate the information of a VOC format sound file.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
playbackstatus MV_GetNextVOCBlock playbackstatus MV_GetNextVOCBlock( VoiceNode *voice)
(
VoiceNode *voice
)
{ {
unsigned char *ptr; unsigned char *ptr;
@ -794,10 +785,7 @@ playbackstatus MV_GetNextVOCBlock
Controls playback of demand fed data. Controls playback of demand fed data.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
playbackstatus MV_GetNextDemandFeedBlock playbackstatus MV_GetNextDemandFeedBlock( VoiceNode *voice)
(
VoiceNode *voice
)
{ {
if (voice->BlockLength > 0) if (voice->BlockLength > 0)
@ -836,10 +824,7 @@ playbackstatus MV_GetNextDemandFeedBlock
Controls playback of demand fed data. Controls playback of demand fed data.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
playbackstatus MV_GetNextRawBlock playbackstatus MV_GetNextRawBlock( VoiceNode *voice)
(
VoiceNode *voice
)
{ {
if (voice->BlockLength <= 0) if (voice->BlockLength <= 0)
@ -877,10 +862,7 @@ playbackstatus MV_GetNextRawBlock
Controls playback of demand fed data. Controls playback of demand fed data.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
playbackstatus MV_GetNextWAVBlock playbackstatus MV_GetNextWAVBlock( VoiceNode *voice)
(
VoiceNode *voice
)
{ {
if (voice->BlockLength <= 0) if (voice->BlockLength <= 0)
@ -918,10 +900,7 @@ playbackstatus MV_GetNextWAVBlock
Starts recording of the waiting buffer. Starts recording of the waiting buffer.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
static void MV_ServiceRecord static void MV_ServiceRecord( void)
(
void
)
{ {
if (MV_RecordFunc) if (MV_RecordFunc)
@ -945,10 +924,7 @@ static void MV_ServiceRecord
Locates the voice with the specified handle. Locates the voice with the specified handle.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
VoiceNode *MV_GetVoice VoiceNode *MV_GetVoice( int handle)
(
int handle
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -983,10 +959,7 @@ VoiceNode *MV_GetVoice
playing. playing.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_VoicePlaying int MV_VoicePlaying( int handle)
(
int handle
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -1014,10 +987,7 @@ int MV_VoicePlaying
Stops output of all currently active voices. Stops output of all currently active voices.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_KillAllVoices int MV_KillAllVoices( void)
(
void
)
{ {
if (!MV_Installed) if (!MV_Installed)
@ -1042,10 +1012,7 @@ int MV_KillAllVoices
Stops output of the voice associated with the specified handle. Stops output of the voice associated with the specified handle.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_Kill int MV_Kill( int handle)
(
int handle
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -1089,10 +1056,7 @@ int MV_Kill
Determines the number of currently active voices. Determines the number of currently active voices.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_VoicesPlaying int MV_VoicesPlaying( void)
(
void
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -1124,10 +1088,7 @@ int MV_VoicesPlaying
Retrieve an inactive or lower priority voice for output. Retrieve an inactive or lower priority voice for output.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
VoiceNode *MV_AllocVoice VoiceNode *MV_AllocVoice( int priority)
(
int priority
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -1196,10 +1157,7 @@ VoiceNode *MV_AllocVoice
Checks if a voice can be play at the specified priority. Checks if a voice can be play at the specified priority.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_VoiceAvailable int MV_VoiceAvailable( int priority)
(
int priority
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -1241,12 +1199,9 @@ int MV_VoiceAvailable
Sets the pitch for the specified voice. Sets the pitch for the specified voice.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_SetVoicePitch void MV_SetVoicePitch( VoiceNode *voice,
(
VoiceNode *voice,
unsigned long rate, unsigned long rate,
int pitchoffset int pitchoffset)
)
{ {
voice->SamplingRate = rate; voice->SamplingRate = rate;
@ -1265,11 +1220,8 @@ void MV_SetVoicePitch
Sets the pitch for the voice associated with the specified handle. Sets the pitch for the voice associated with the specified handle.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_SetPitch int MV_SetPitch( int handle,
( int pitchoffset)
int handle,
int pitchoffset
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -1299,11 +1251,8 @@ int MV_SetPitch
Sets the frequency for the voice associated with the specified handle. Sets the frequency for the voice associated with the specified handle.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_SetFrequency int MV_SetFrequency( int handle,
( int frequency)
int handle,
int frequency
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -1334,10 +1283,7 @@ int MV_SetFrequency
volume. volume.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
static short *MV_GetVolumeTable static short *MV_GetVolumeTable( int vol)
(
int vol
)
{ {
int volume; int volume;
@ -1357,10 +1303,7 @@ static short *MV_GetVolumeTable
Selects which method should be used to mix the voice. Selects which method should be used to mix the voice.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
static void MV_SetVoiceMixMode static void MV_SetVoiceMixMode( VoiceNode *voice)
(
VoiceNode *voice
)
{ {
unsigned flags; unsigned flags;
@ -1483,13 +1426,10 @@ static void MV_SetVoiceMixMode
with the specified handle. with the specified handle.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_SetVoiceVolume void MV_SetVoiceVolume( VoiceNode *voice,
(
VoiceNode *voice,
int vol, int vol,
int left, int left,
int right int right)
)
{ {
if (MV_Channels == 1) if (MV_Channels == 1)
@ -1521,10 +1461,7 @@ void MV_SetVoiceVolume
without stoping the sound. without stoping the sound.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_EndLooping int MV_EndLooping( int handle)
(
int handle
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -1563,13 +1500,10 @@ int MV_EndLooping
with the specified handle. with the specified handle.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_SetPan int MV_SetPan( int handle,
(
int handle,
int vol, int vol,
int left, int left,
int right int right)
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -1600,12 +1534,9 @@ int MV_SetPan
with the specified handle. with the specified handle.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_Pan3D int MV_Pan3D( int handle,
(
int handle,
int angle, int angle,
int distance int distance)
)
{ {
int left; int left;
@ -1641,10 +1572,7 @@ int MV_Pan3D
Sets the level of reverb to add to mix. Sets the level of reverb to add to mix.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_SetReverb void MV_SetReverb( int reverb)
(
int reverb
)
{ {
MV_ReverbLevel = MIX_VOLUME(reverb); MV_ReverbLevel = MIX_VOLUME(reverb);
@ -1658,10 +1586,7 @@ void MV_SetReverb
Sets the level of reverb to add to mix. Sets the level of reverb to add to mix.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_SetFastReverb void MV_SetFastReverb( int reverb)
(
int reverb
)
{ {
MV_ReverbLevel = max(0, min(16, reverb)); MV_ReverbLevel = max(0, min(16, reverb));
@ -1675,10 +1600,7 @@ void MV_SetFastReverb
Returns the maximum delay time for reverb. Returns the maximum delay time for reverb.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_GetMaxReverbDelay int MV_GetMaxReverbDelay( void)
(
void
)
{ {
int maxdelay; int maxdelay;
@ -1695,10 +1617,7 @@ int MV_GetMaxReverbDelay
Returns the current delay time for reverb. Returns the current delay time for reverb.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_GetReverbDelay int MV_GetReverbDelay( void)
(
void
)
{ {
return MV_ReverbDelay / MV_SampleSize; return MV_ReverbDelay / MV_SampleSize;
@ -1711,10 +1630,7 @@ int MV_GetReverbDelay
Sets the delay level of reverb to add to mix. Sets the delay level of reverb to add to mix.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_SetReverbDelay void MV_SetReverbDelay( int delay)
(
int delay
)
{ {
int maxdelay; int maxdelay;
@ -1731,11 +1647,8 @@ void MV_SetReverbDelay
Prepares Multivoc to play stereo of mono digitized sounds. Prepares Multivoc to play stereo of mono digitized sounds.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_SetMixMode int MV_SetMixMode( int numchannels,
( int samplebits)
int numchannels,
int samplebits
)
{ {
int mode; int mode;
@ -1756,7 +1669,11 @@ int MV_SetMixMode
mode |= SIXTEEN_BIT; mode |= SIXTEEN_BIT;
} }
#if defined(_WIN32)
MV_MixMode = DSOUND_SetMixMode(mode); MV_MixMode = DSOUND_SetMixMode(mode);
#else
MV_MixMode = mode;
#endif
MV_Channels = 1; MV_Channels = 1;
if (MV_MixMode & STEREO) if (MV_MixMode & STEREO)
@ -1800,10 +1717,7 @@ int MV_SetMixMode
Starts the sound playback engine. Starts the sound playback engine.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_StartPlayback int MV_StartPlayback( void)
(
void
)
{ {
int status; int status;
@ -1821,6 +1735,7 @@ int MV_StartPlayback
MV_MixFunction = MV_Mix; MV_MixFunction = MV_Mix;
#if defined(_WIN32)
MV_MixRate = MV_RequestedMixRate; MV_MixRate = MV_RequestedMixRate;
// Start playback // Start playback
@ -1830,7 +1745,19 @@ int MV_StartPlayback
MV_SetErrorCode(MV_BlasterError); MV_SetErrorCode(MV_BlasterError);
return(MV_Error); return(MV_Error);
} }
#else
status = DSL_BeginBufferedPlayback(MV_MixBuffer[ 0 ],
TotalBufferSize, MV_NumberOfBuffers,
MV_RequestedMixRate, MV_MixMode, MV_ServiceVoc);
if (status != DSL_Ok)
{
MV_SetErrorCode(MV_BlasterError);
return(MV_Error);
}
MV_MixRate = DSL_GetPlaybackRate();
#endif
return(MV_Ok); return(MV_Ok);
} }
@ -1841,10 +1768,7 @@ int MV_StartPlayback
Stops the sound playback engine. Stops the sound playback engine.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_StopPlayback void MV_StopPlayback( void)
(
void
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -1852,7 +1776,11 @@ void MV_StopPlayback
unsigned flags; unsigned flags;
// Stop sound playback // Stop sound playback
#if defined(_WIN32)
DSOUND_StopPlayback(); DSOUND_StopPlayback();
#else
DSL_StopPlayback();
#endif
// Make sure all callbacks are done. // Make sure all callbacks are done.
flags = DisableInterrupts(); flags = DisableInterrupts();
@ -1880,11 +1808,8 @@ void MV_StopPlayback
Starts the sound recording engine. Starts the sound recording engine.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_StartRecording int MV_StartRecording( int MixRate,
( void(*function)(char *ptr, int length))
int MixRate,
void(*function)(char *ptr, int length)
)
{ {
int status; int status;
@ -1944,10 +1869,7 @@ int MV_StartRecording
Stops the sound record engine. Stops the sound record engine.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_StopRecord void MV_StopRecord( void)
(
void
)
{ {
// Stop sound playback // Stop sound playback
@ -1970,17 +1892,14 @@ void MV_StopRecord
Plays a digitized sound from a user controlled buffering system. Plays a digitized sound from a user controlled buffering system.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_StartDemandFeedPlayback int MV_StartDemandFeedPlayback( void(*function)(char **ptr, unsigned long *length),
(
void(*function)(char **ptr, unsigned long *length),
int rate, int rate,
int pitchoffset, int pitchoffset,
int vol, int vol,
int left, int left,
int right, int right,
int priority, int priority,
unsigned long callbackval unsigned long callbackval)
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -2032,9 +1951,7 @@ int MV_StartDemandFeedPlayback
priority. priority.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_PlayRaw int MV_PlayRaw( char *ptr,
(
char *ptr,
unsigned long length, unsigned long length,
unsigned rate, unsigned rate,
int pitchoffset, int pitchoffset,
@ -2042,8 +1959,7 @@ int MV_PlayRaw
int left, int left,
int right, int right,
int priority, int priority,
unsigned long callbackval unsigned long callbackval)
)
{ {
int status; int status;
@ -2062,9 +1978,7 @@ int MV_PlayRaw
priority. priority.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_PlayLoopedRaw int MV_PlayLoopedRaw( char *ptr,
(
char *ptr,
long length, long length,
char *loopstart, char *loopstart,
char *loopend, char *loopend,
@ -2074,8 +1988,7 @@ int MV_PlayLoopedRaw
int left, int left,
int right, int right,
int priority, int priority,
unsigned long callbackval unsigned long callbackval)
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -2125,16 +2038,13 @@ int MV_PlayLoopedRaw
priority. priority.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_PlayWAV int MV_PlayWAV( char *ptr,
(
char *ptr,
int pitchoffset, int pitchoffset,
int vol, int vol,
int left, int left,
int right, int right,
int priority, int priority,
unsigned long callbackval unsigned long callbackval)
)
{ {
int status; int status;
@ -2153,15 +2063,12 @@ int MV_PlayWAV
from listener. from listener.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_PlayWAV3D int MV_PlayWAV3D( char *ptr,
(
char *ptr,
int pitchoffset, int pitchoffset,
int angle, int angle,
int distance, int distance,
int priority, int priority,
unsigned long callbackval unsigned long callbackval)
)
{ {
int left; int left;
@ -2205,9 +2112,7 @@ int MV_PlayWAV3D
priority. priority.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_PlayLoopedWAV int MV_PlayLoopedWAV( char *ptr,
(
char *ptr,
long loopstart, long loopstart,
long loopend, long loopend,
int pitchoffset, int pitchoffset,
@ -2215,8 +2120,7 @@ int MV_PlayLoopedWAV
int left, int left,
int right, int right,
int priority, int priority,
unsigned long callbackval unsigned long callbackval)
)
{ {
riff_header *riff; riff_header *riff;
@ -2336,15 +2240,12 @@ int MV_PlayLoopedWAV
from listener. from listener.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_PlayVOC3D int MV_PlayVOC3D( char *ptr,
(
char *ptr,
int pitchoffset, int pitchoffset,
int angle, int angle,
int distance, int distance,
int priority, int priority,
unsigned long callbackval unsigned long callbackval)
)
{ {
int left; int left;
@ -2388,16 +2289,13 @@ int MV_PlayVOC3D
priority. priority.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_PlayVOC int MV_PlayVOC( char *ptr,
(
char *ptr,
int pitchoffset, int pitchoffset,
int vol, int vol,
int left, int left,
int right, int right,
int priority, int priority,
unsigned long callbackval unsigned long callbackval)
)
{ {
int status; int status;
@ -2416,9 +2314,7 @@ int MV_PlayVOC
priority. priority.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_PlayLoopedVOC int MV_PlayLoopedVOC( char *ptr,
(
char *ptr,
long loopstart, long loopstart,
long loopend, long loopend,
int pitchoffset, int pitchoffset,
@ -2426,8 +2322,7 @@ int MV_PlayLoopedVOC
int left, int left,
int right, int right,
int priority, int priority,
unsigned long callbackval unsigned long callbackval)
)
{ {
VoiceNode *voice; VoiceNode *voice;
@ -2493,12 +2388,9 @@ int MV_PlayLoopedVOC
level. level.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_CreateVolumeTable void MV_CreateVolumeTable( int index,
(
int index,
int volume, int volume,
int MaxVolume int MaxVolume)
)
{ {
int val; int val;
@ -2536,10 +2428,7 @@ void MV_CreateVolumeTable
level. level.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_CalcVolume void MV_CalcVolume( int MaxVolume)
(
int MaxVolume
)
{ {
int volume; int volume;
@ -2570,10 +2459,7 @@ void MV_CalcVolume
a sound located at a specific angle and distance from the listener. a sound located at a specific angle and distance from the listener.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_CalcPanTable void MV_CalcPanTable( void)
(
void
)
{ {
int level; int level;
@ -2612,10 +2498,7 @@ void MV_CalcPanTable
Sets the volume of digitized sound playback. Sets the volume of digitized sound playback.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_SetVolume void MV_SetVolume( int volume)
(
int volume
)
{ {
volume = max(0, volume); volume = max(0, volume);
@ -2634,10 +2517,7 @@ void MV_SetVolume
Returns the volume of digitized sound playback. Returns the volume of digitized sound playback.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_GetVolume int MV_GetVolume( void)
(
void
)
{ {
return(MV_TotalVolume); return(MV_TotalVolume);
@ -2650,10 +2530,7 @@ int MV_GetVolume
Set the function to call when a voice stops. Set the function to call when a voice stops.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_SetCallBack void MV_SetCallBack( void(*function)(unsigned long))
(
void(*function)(unsigned long)
)
{ {
MV_CallBackFunc = function; MV_CallBackFunc = function;
@ -2666,10 +2543,7 @@ void MV_SetCallBack
Set the orientation of the left and right channels. Set the orientation of the left and right channels.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
void MV_SetReverseStereo void MV_SetReverseStereo( int setting)
(
int setting
)
{ {
MV_SwapLeftRight = setting; MV_SwapLeftRight = setting;
@ -2682,10 +2556,7 @@ void MV_SetReverseStereo
Returns the orientation of the left and right channels. Returns the orientation of the left and right channels.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_GetReverseStereo int MV_GetReverseStereo( void)
(
void
)
{ {
return(MV_SwapLeftRight); return(MV_SwapLeftRight);
@ -2698,10 +2569,7 @@ int MV_GetReverseStereo
Checks if playback has started. Checks if playback has started.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_TestPlayback int MV_TestPlayback( void)
(
void
)
{ {
unsigned flags; unsigned flags;
@ -2773,14 +2641,11 @@ int MV_TestPlayback
Multivoc. Multivoc.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_Init int MV_Init( int soundcard,
(
int soundcard,
int MixRate, int MixRate,
int Voices, int Voices,
int numchannels, int numchannels,
int samplebits int samplebits)
)
{ {
char *ptr; char *ptr;
@ -2843,13 +2708,20 @@ int MV_Init
MV_SetReverseStereo(FALSE); MV_SetReverseStereo(FALSE);
// Initialize the sound card // Initialize the sound card
#if defined(_WIN32)
status = DSOUND_Init(soundcard, MixRate, numchannels, samplebits, status = DSOUND_Init(soundcard, MixRate, numchannels, samplebits,
TotalBufferSize); TotalBufferSize);
if (status != DSOUND_Ok) if (status != DSOUND_Ok)
{ {
MV_SetErrorCode(MV_BlasterError); MV_SetErrorCode(MV_BlasterError);
} }
#else
status = DSL_Init();
if (status != DSL_Ok)
{
MV_SetErrorCode(MV_BlasterError);
}
#endif
if (MV_ErrorCode != MV_Ok) if (MV_ErrorCode != MV_Ok)
{ {
status = MV_ErrorCode; status = MV_ErrorCode;
@ -2909,10 +2781,7 @@ int MV_Init
Restore any resources allocated by Multivoc back to the system. Restore any resources allocated by Multivoc back to the system.
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
int MV_Shutdown int MV_Shutdown( void)
(
void
)
{ {
int buffer; int buffer;
@ -2941,7 +2810,11 @@ int MV_Shutdown
MV_StopPlayback(); MV_StopPlayback();
// Shutdown the sound card // Shutdown the sound card
#if defined(_WIN32)
DSOUND_Shutdown(); DSOUND_Shutdown();
#else
DSL_Shutdown();
#endif
RestoreInterrupts(flags); RestoreInterrupts(flags);

View file

@ -1,50 +0,0 @@
/*
Copyright (C) 1994-1995 Apogee Software, Ltd.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**********************************************************************
module: NODPMI.C
Functions for faking DPMI calls.
**********************************************************************/
#include <stdlib.h>
#include <string.h>
#include "dpmi.h"
#define TRUE ( 1 == 1 )
#define FALSE ( !TRUE )
int DPMI_GetDOSMemory(void **ptr, int *descriptor, unsigned length)
{
/* Lovely... */
*ptr = (void *)malloc(length);
*descriptor = (int) *ptr;
return (descriptor == 0) ? DPMI_Error : DPMI_Ok;
}
int DPMI_FreeDOSMemory(int descriptor)
{
free((void *)descriptor);
return (descriptor == 0) ? DPMI_Error : DPMI_Ok;
}

View file

@ -30,7 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdlib.h> #include <stdlib.h>
//#include <math.h> //#include <math.h>
#include "dpmi.h"
#include "standard.h" #include "standard.h"
#include "pitch.h" #include "pitch.h"

File diff suppressed because it is too large Load diff