mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-01 07:30:45 +00:00
Refactor : DWORD -> unsigned long
This commit is contained in:
parent
7051e6d906
commit
109dfa855b
@ -31,17 +31,17 @@ typedef struct IDirectSoundBuffer {
|
||||
// This method restores the memory allocation for a lost sound buffer for the specified DirectSoundBuffer object.
|
||||
int (*Restore)(void *_this);
|
||||
|
||||
int (*Play)(void* _this, DWORD dwReserved1, DWORD dwReserved2, DWORD dwFlags);
|
||||
int (*Play)(void* _this, unsigned long dwReserved1, unsigned long dwReserved2, unsigned long dwFlags);
|
||||
|
||||
// This method obtains a valid write pointer to the sound buffer's audio data
|
||||
int (*Lock)(void* _this, DWORD dwWriteCursor, DWORD dwWriteBytes, LPVOID* lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID* lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags);
|
||||
int (*Lock)(void* _this, unsigned long dwWriteCursor, unsigned long dwWriteBytes, LPVOID* lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID* lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, unsigned long dwFlags);
|
||||
|
||||
// This method releases a locked sound buffer.
|
||||
int (*Unlock)(void* _this, LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2);
|
||||
int (*Unlock)(void* _this, LPVOID lpvAudioPtr1, unsigned long dwAudioBytes1, LPVOID lpvAudioPtr2, unsigned long dwAudioBytes2);
|
||||
|
||||
int (*GetStatus)(void* _this, LPDWORD lpdwStatus);
|
||||
|
||||
int (*UnlockStaticBuffer)(void* _this, DWORD dwAudioBytes);
|
||||
int (*UnlockStaticBuffer)(void* _this, unsigned long dwAudioBytes);
|
||||
|
||||
int (*Replay)(void* _this);
|
||||
|
||||
@ -153,48 +153,48 @@ static inline bool SUCCEEDED(int x) { return x == DS_OK; }
|
||||
typedef struct {
|
||||
uint16_t wFormatTag;
|
||||
uint16_t nChannels;
|
||||
DWORD nSamplesPerSec;
|
||||
DWORD nAvgBytesPerSec;
|
||||
unsigned long nSamplesPerSec;
|
||||
unsigned long nAvgBytesPerSec;
|
||||
uint16_t nBlockAlign;
|
||||
uint16_t wBitsPerSample;
|
||||
uint16_t cbSize;
|
||||
} WAVEFORMATEX, *LPWAVEFORMATEX;
|
||||
|
||||
typedef struct DSBUFFERDESC {
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
unsigned long dwSize;
|
||||
unsigned long dwFlags;
|
||||
unsigned long dwBufferBytes;
|
||||
unsigned long dwReserved;
|
||||
LPWAVEFORMATEX lpwfxFormat;
|
||||
} DSBUFFERDESC;
|
||||
|
||||
typedef DWORD DSCAPS_MASK;
|
||||
typedef unsigned long DSCAPS_MASK;
|
||||
typedef struct _DSCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
unsigned long dwSize;
|
||||
DSCAPS_MASK dwFlags;
|
||||
DWORD dwMinSecondarySampleRate;
|
||||
DWORD dwMaxSecondarySampleRate;
|
||||
DWORD dwPrimaryBuffers;
|
||||
DWORD dwMaxHwMixingAllBuffers;
|
||||
DWORD dwMaxHwMixingStaticBuffers;
|
||||
DWORD dwMaxHwMixingStreamingBuffers;
|
||||
DWORD dwFreeHwMixingAllBuffers;
|
||||
DWORD dwFreeHwMixingStaticBuffers;
|
||||
DWORD dwFreeHwMixingStreamingBuffers;
|
||||
DWORD dwMaxHw3DAllBuffers;
|
||||
DWORD dwMaxHw3DStaticBuffers;
|
||||
DWORD dwMaxHw3DStreamingBuffers;
|
||||
DWORD dwFreeHw3DAllBuffers;
|
||||
DWORD dwFreeHw3DStaticBuffers;
|
||||
DWORD dwFreeHw3DStreamingBuffers;
|
||||
DWORD dwTotalHwMemBytes;
|
||||
DWORD dwFreeHwMemBytes;
|
||||
DWORD dwMaxContigFreeHwMemBytes;
|
||||
DWORD dwUnlockTransferRateHwBuffers;
|
||||
DWORD dwPlayCpuOverheadSwBuffers;
|
||||
DWORD dwReserved1;
|
||||
DWORD dwReserved2;
|
||||
unsigned long dwMinSecondarySampleRate;
|
||||
unsigned long dwMaxSecondarySampleRate;
|
||||
unsigned long dwPrimaryBuffers;
|
||||
unsigned long dwMaxHwMixingAllBuffers;
|
||||
unsigned long dwMaxHwMixingStaticBuffers;
|
||||
unsigned long dwMaxHwMixingStreamingBuffers;
|
||||
unsigned long dwFreeHwMixingAllBuffers;
|
||||
unsigned long dwFreeHwMixingStaticBuffers;
|
||||
unsigned long dwFreeHwMixingStreamingBuffers;
|
||||
unsigned long dwMaxHw3DAllBuffers;
|
||||
unsigned long dwMaxHw3DStaticBuffers;
|
||||
unsigned long dwMaxHw3DStreamingBuffers;
|
||||
unsigned long dwFreeHw3DAllBuffers;
|
||||
unsigned long dwFreeHw3DStaticBuffers;
|
||||
unsigned long dwFreeHw3DStreamingBuffers;
|
||||
unsigned long dwTotalHwMemBytes;
|
||||
unsigned long dwFreeHwMemBytes;
|
||||
unsigned long dwMaxContigFreeHwMemBytes;
|
||||
unsigned long dwUnlockTransferRateHwBuffers;
|
||||
unsigned long dwPlayCpuOverheadSwBuffers;
|
||||
unsigned long dwReserved1;
|
||||
unsigned long dwReserved2;
|
||||
} DSCAPS, *LPDSCAPS;
|
||||
typedef DSCAPS *LPCDSCAPS;
|
||||
|
||||
|
@ -172,9 +172,9 @@ static bool g_bStopPhoneme = false;
|
||||
static bool g_bVotraxPhoneme = false;
|
||||
|
||||
#ifdef APPLE2IX
|
||||
static const DWORD SAMPLE_RATE = SPKR_SAMPLE_RATE;
|
||||
static const unsigned long SAMPLE_RATE = SPKR_SAMPLE_RATE;
|
||||
#else
|
||||
static const DWORD SAMPLE_RATE = 44100; // Use a base freq so that DirectX (or sound h/w) doesn't have to up/down-sample
|
||||
static const unsigned long SAMPLE_RATE = 44100; // Use a base freq so that DirectX (or sound h/w) doesn't have to up/down-sample
|
||||
#endif
|
||||
|
||||
static short* ppAYVoiceBuffer[NUM_VOICES] = {0};
|
||||
@ -211,11 +211,11 @@ static uint8_t g_nPhasorMode = 0; // 0=Mockingboard emulation, 1=Phasor native
|
||||
#define MB_BUF_SIZE MAX_SAMPLES * 2 * MB_CHANNELS
|
||||
static const unsigned short g_nMB_NumChannels = MB_CHANNELS;
|
||||
|
||||
static const DWORD g_dwDSBufferSize = MB_BUF_SIZE;
|
||||
static const unsigned long g_dwDSBufferSize = MB_BUF_SIZE;
|
||||
#else
|
||||
static const unsigned short g_nMB_NumChannels = 2;
|
||||
|
||||
static const DWORD g_dwDSBufferSize = MAX_SAMPLES * sizeof(short) * g_nMB_NumChannels;
|
||||
static const unsigned long g_dwDSBufferSize = MAX_SAMPLES * sizeof(short) * g_nMB_NumChannels;
|
||||
#endif
|
||||
|
||||
static const int16_t nWaveDataMin = (int16_t)0x8000;
|
||||
@ -245,7 +245,7 @@ static uint8_t quit_event = false;
|
||||
#else
|
||||
static const int g_nNumEvents = 2;
|
||||
static HANDLE g_hSSI263Event[g_nNumEvents] = {NULL}; // 1: Phoneme finished playing, 2: Exit thread
|
||||
static DWORD g_dwMaxPhonemeLen = 0;
|
||||
static unsigned long g_dwMaxPhonemeLen = 0;
|
||||
#endif
|
||||
|
||||
// When 6522 IRQ is *not* active use 60Hz update freq for MB voices
|
||||
@ -265,7 +265,7 @@ uint32_t g_uTimer1IrqCount = 0; // DEBUG
|
||||
#ifdef APPLE2IX
|
||||
static void* SSI263Thread(LPVOID);
|
||||
#else
|
||||
static DWORD SSI263Thread(LPVOID);
|
||||
static unsigned long SSI263Thread(LPVOID);
|
||||
#endif
|
||||
static void Votrax_Write(uint8_t nDevice, uint8_t nValue);
|
||||
|
||||
@ -866,7 +866,7 @@ static void MB_Update()
|
||||
//
|
||||
|
||||
#ifndef APPLE2IX
|
||||
static DWORD dwByteOffset = (DWORD)-1;
|
||||
static unsigned long dwByteOffset = (unsigned long)-1;
|
||||
static int nNumSamplesError = 0;
|
||||
#endif
|
||||
|
||||
@ -886,10 +886,10 @@ static void MB_Update()
|
||||
|
||||
//
|
||||
|
||||
DWORD dwDSLockedBufferSize0, dwDSLockedBufferSize1;
|
||||
unsigned long dwDSLockedBufferSize0, dwDSLockedBufferSize1;
|
||||
int16_t *pDSLockedBuffer0, *pDSLockedBuffer1;
|
||||
|
||||
DWORD dwCurrentPlayCursor, dwCurrentWriteCursor;
|
||||
unsigned long dwCurrentPlayCursor, dwCurrentWriteCursor;
|
||||
#ifdef APPLE2IX
|
||||
int hr = MockingboardVoice.lpDSBvoice->GetCurrentPosition(MockingboardVoice.lpDSBvoice->_this, &dwCurrentPlayCursor, &dwCurrentWriteCursor);
|
||||
#else
|
||||
@ -899,7 +899,7 @@ static void MB_Update()
|
||||
return;
|
||||
|
||||
#if 0
|
||||
if(dwByteOffset == (DWORD)-1)
|
||||
if(dwByteOffset == (unsigned long)-1)
|
||||
{
|
||||
// First time in this func
|
||||
|
||||
@ -1010,10 +1010,10 @@ static void MB_Update()
|
||||
|
||||
#ifdef APPLE2IX
|
||||
if(!DSGetLock(MockingboardVoice.lpDSBvoice,
|
||||
/*unused*/0, (DWORD)nNumSamples*sizeof(short)*g_nMB_NumChannels,
|
||||
/*unused*/0, (unsigned long)nNumSamples*sizeof(short)*g_nMB_NumChannels,
|
||||
#else
|
||||
if(DSGetLock(MockingboardVoice.lpDSBvoice,
|
||||
dwByteOffset, (DWORD)nNumSamples*sizeof(short)*g_nMB_NumChannels,
|
||||
dwByteOffset, (unsigned long)nNumSamples*sizeof(short)*g_nMB_NumChannels,
|
||||
#endif
|
||||
&pDSLockedBuffer0, &dwDSLockedBufferSize0,
|
||||
&pDSLockedBuffer1, &dwDSLockedBufferSize1))
|
||||
@ -1036,7 +1036,7 @@ static void MB_Update()
|
||||
(void*)pDSLockedBuffer1, dwDSLockedBufferSize1);
|
||||
|
||||
#ifndef APPLE2IX
|
||||
dwByteOffset = (dwByteOffset + (DWORD)nNumSamples*sizeof(short)*g_nMB_NumChannels) % g_dwDSBufferSize;
|
||||
dwByteOffset = (dwByteOffset + (unsigned long)nNumSamples*sizeof(short)*g_nMB_NumChannels) % g_dwDSBufferSize;
|
||||
#endif
|
||||
|
||||
#ifdef RIFF_MB
|
||||
@ -1049,7 +1049,7 @@ static void MB_Update()
|
||||
#ifdef APPLE2IX
|
||||
static void* SSI263Thread(LPVOID lpParameter)
|
||||
#else
|
||||
static DWORD SSI263Thread(LPVOID lpParameter)
|
||||
static unsigned long SSI263Thread(LPVOID lpParameter)
|
||||
#endif
|
||||
{
|
||||
while(1)
|
||||
@ -1092,7 +1092,7 @@ static DWORD SSI263Thread(LPVOID lpParameter)
|
||||
continue;
|
||||
}
|
||||
#else
|
||||
DWORD dwWaitResult = WaitForMultipleObjects(
|
||||
unsigned long dwWaitResult = WaitForMultipleObjects(
|
||||
g_nNumEvents, // number of handles in array
|
||||
g_hSSI263Event, // array of event handles
|
||||
FALSE, // wait until any one is signaled
|
||||
@ -1216,7 +1216,7 @@ static void SSI263_Play(unsigned int nPhoneme)
|
||||
bPause = false;
|
||||
}
|
||||
|
||||
DWORD dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer
|
||||
unsigned long dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer
|
||||
int16_t* pDSLockedBuffer;
|
||||
|
||||
hr = SSI263Voice.lpDSBvoice->Stop();
|
||||
@ -1287,7 +1287,7 @@ static bool MB_DSInit()
|
||||
// Create single Mockingboard voice
|
||||
//
|
||||
|
||||
DWORD dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer
|
||||
unsigned long dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer
|
||||
int16_t* pDSLockedBuffer;
|
||||
|
||||
if(!g_bDSAvailable)
|
||||
@ -1478,7 +1478,7 @@ static bool MB_DSInit()
|
||||
|
||||
//
|
||||
|
||||
DWORD dwThreadId;
|
||||
unsigned long dwThreadId;
|
||||
|
||||
g_hThread = CreateThread(NULL, // lpThreadAttributes
|
||||
0, // dwStackSize
|
||||
@ -1500,7 +1500,7 @@ static void MB_DSUninit()
|
||||
{
|
||||
if(g_hThread)
|
||||
{
|
||||
DWORD dwExitCode;
|
||||
unsigned long dwExitCode;
|
||||
#ifdef APPLE2IX
|
||||
quit_event = true;
|
||||
pthread_cond_signal(&mockingboard_cond);
|
||||
@ -2129,12 +2129,12 @@ bool MB_IsActive()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
DWORD MB_GetVolume()
|
||||
unsigned long MB_GetVolume()
|
||||
{
|
||||
return MockingboardVoice.dwUserVolume;
|
||||
}
|
||||
|
||||
void MB_SetVolume(DWORD dwVolume, DWORD dwVolumeMax)
|
||||
void MB_SetVolume(unsigned long dwVolume, unsigned long dwVolumeMax)
|
||||
{
|
||||
#ifdef APPLE2IX
|
||||
#warning TODO FIXME ... why is OpenAL on my Linux box so damn loud?!
|
||||
@ -2155,7 +2155,7 @@ void MB_SetVolume(DWORD dwVolume, DWORD dwVolumeMax)
|
||||
|
||||
//===========================================================================
|
||||
|
||||
DWORD MB_GetSnapshot(SS_CARD_MOCKINGBOARD* pSS, DWORD dwSlot)
|
||||
unsigned long MB_GetSnapshot(SS_CARD_MOCKINGBOARD* pSS, unsigned long dwSlot)
|
||||
{
|
||||
#ifdef APPLE2IX
|
||||
// Saving and loading state currently unimplemented
|
||||
@ -2186,7 +2186,7 @@ DWORD MB_GetSnapshot(SS_CARD_MOCKINGBOARD* pSS, DWORD dwSlot)
|
||||
#endif
|
||||
}
|
||||
|
||||
DWORD MB_SetSnapshot(SS_CARD_MOCKINGBOARD* pSS, DWORD dwSlot_unused)
|
||||
unsigned long MB_SetSnapshot(SS_CARD_MOCKINGBOARD* pSS, unsigned long dwSlot_unused)
|
||||
{
|
||||
#ifdef APPLE2IX
|
||||
// Saving and loading state currently unimplemented
|
||||
|
@ -110,10 +110,10 @@ SS_CARDTYPE MB_GetSoundcardType();
|
||||
void MB_SetSoundcardType(SS_CARDTYPE NewSoundcardType);
|
||||
double MB_GetFramePeriod();
|
||||
bool MB_IsActive();
|
||||
DWORD MB_GetVolume();
|
||||
void MB_SetVolume(DWORD dwVolume, DWORD dwVolumeMax);
|
||||
DWORD MB_GetSnapshot(SS_CARD_MOCKINGBOARD* pSS, DWORD dwSlot);
|
||||
DWORD MB_SetSnapshot(SS_CARD_MOCKINGBOARD* pSS, DWORD dwSlot);
|
||||
unsigned long MB_GetVolume();
|
||||
void MB_SetVolume(unsigned long dwVolume, unsigned long dwVolumeMax);
|
||||
unsigned long MB_GetSnapshot(SS_CARD_MOCKINGBOARD* pSS, unsigned long dwSlot);
|
||||
unsigned long MB_SetSnapshot(SS_CARD_MOCKINGBOARD* pSS, unsigned long dwSlot);
|
||||
#ifdef APPLE2IX
|
||||
void mb_io_initialize(unsigned int slot4, unsigned int slot5);
|
||||
#endif
|
||||
|
@ -40,15 +40,15 @@ typedef enum SS_CARDTYPE
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwLength; // Byte length of this unit struct
|
||||
DWORD dwVersion;
|
||||
unsigned long dwLength; // Byte length of this unit struct
|
||||
unsigned long dwVersion;
|
||||
} SS_UNIT_HDR;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SS_UNIT_HDR UnitHdr;
|
||||
DWORD dwType; // SS_CARDTYPE
|
||||
DWORD dwSlot; // [1..7]
|
||||
unsigned long dwType; // SS_CARDTYPE
|
||||
unsigned long dwSlot; // [1..7]
|
||||
} SS_CARD_HDR;
|
||||
|
||||
void CpuIrqAssert(eIRQSRC irq_source);
|
||||
|
@ -729,13 +729,13 @@ static long OpenALCreateSoundBuffer(ALBufferParamsStruct *params, ALSoundBufferS
|
||||
(*soundbuf_struct)->GetCurrentPosition = (int (*)(void *, LPDWORD, LPDWORD))ALGetPosition;
|
||||
(*soundbuf_struct)->Stop = (int (*)(void *))ALStop;
|
||||
(*soundbuf_struct)->Restore = (int (*)(void *))ALRestore;
|
||||
(*soundbuf_struct)->Play = (int (*)(void *, DWORD, DWORD, DWORD))ALPlay;
|
||||
(*soundbuf_struct)->Lock = (int (*)(void *, DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD))ALBegin;
|
||||
(*soundbuf_struct)->Unlock = (int (*)(void *, LPVOID, DWORD, LPVOID, DWORD))ALCommit;
|
||||
(*soundbuf_struct)->Play = (int (*)(void *, unsigned long, unsigned long, unsigned long))ALPlay;
|
||||
(*soundbuf_struct)->Lock = (int (*)(void *, unsigned long, unsigned long, LPVOID *, LPDWORD, LPVOID *, LPDWORD, unsigned long))ALBegin;
|
||||
(*soundbuf_struct)->Unlock = (int (*)(void *, LPVOID, unsigned long, LPVOID, unsigned long))ALCommit;
|
||||
(*soundbuf_struct)->GetStatus = (int (*)(void *, LPDWORD))ALGetStatus;
|
||||
|
||||
// mockingboard-specific hacks
|
||||
(*soundbuf_struct)->UnlockStaticBuffer = (int (*)(void *, DWORD))ALCommitStaticBuffer;
|
||||
(*soundbuf_struct)->UnlockStaticBuffer = (int (*)(void *, unsigned long))ALCommitStaticBuffer;
|
||||
(*soundbuf_struct)->Replay = (int (*)(void *))ALReplay;
|
||||
|
||||
return 0;
|
||||
|
@ -33,16 +33,16 @@ typedef struct IDirectSoundBuffer ALSoundBufferStruct;
|
||||
|
||||
typedef struct DSBUFFERDESC ALBufferParamsStruct;
|
||||
/*
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
unsigned long dwSize;
|
||||
unsigned long dwFlags;
|
||||
unsigned long dwBufferBytes;
|
||||
unsigned long dwReserved;
|
||||
LPWAVEFORMATEX lpwfxFormat
|
||||
{
|
||||
uint16_t wFormatTag;
|
||||
uint16_t nChannels;
|
||||
DWORD nSamplesPerSec;
|
||||
DWORD nAvgBytesPerSec;
|
||||
unsigned long nSamplesPerSec;
|
||||
unsigned long nAvgBytesPerSec;
|
||||
uint16_t nBlockAlign;
|
||||
uint16_t wBitsPerSample;
|
||||
uint16_t cbSize;
|
||||
|
@ -57,11 +57,11 @@ bool g_bDisableDirectSound = false;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool DSGetLock(LPDIRECTSOUNDBUFFER pVoice, DWORD dwOffset, DWORD dwBytes,
|
||||
int16_t** ppDSLockedBuffer0, DWORD* pdwDSLockedBufferSize0,
|
||||
int16_t** ppDSLockedBuffer1, DWORD* pdwDSLockedBufferSize1)
|
||||
bool DSGetLock(LPDIRECTSOUNDBUFFER pVoice, unsigned long dwOffset, unsigned long dwBytes,
|
||||
int16_t** ppDSLockedBuffer0, unsigned long* pdwDSLockedBufferSize0,
|
||||
int16_t** ppDSLockedBuffer1, unsigned long* pdwDSLockedBufferSize1)
|
||||
{
|
||||
DWORD nStatus = 0;
|
||||
unsigned long nStatus = 0;
|
||||
int hr = pVoice->GetStatus(pVoice->_this, &nStatus);
|
||||
if(hr != DS_OK)
|
||||
return false;
|
||||
@ -100,7 +100,7 @@ bool DSGetLock(LPDIRECTSOUNDBUFFER pVoice, DWORD dwOffset, DWORD dwBytes,
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
int DSGetSoundBuffer(VOICE* pVoice, DWORD dwFlags, DWORD dwBufferSize, DWORD nSampleRate, int nChannels)
|
||||
int DSGetSoundBuffer(VOICE* pVoice, unsigned long dwFlags, unsigned long dwBufferSize, unsigned long nSampleRate, int nChannels)
|
||||
{
|
||||
WAVEFORMATEX wavfmt;
|
||||
DSBUFFERDESC dsbdesc;
|
||||
@ -167,13 +167,13 @@ void DSReleaseSoundBuffer(VOICE* pVoice)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool DSZeroVoiceBuffer(PVOICE Voice, char* pszDevName, DWORD dwBufferSize)
|
||||
bool DSZeroVoiceBuffer(PVOICE Voice, char* pszDevName, unsigned long dwBufferSize)
|
||||
{
|
||||
DWORD dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer
|
||||
unsigned long dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer
|
||||
int16_t* pDSLockedBuffer;
|
||||
|
||||
|
||||
DWORD argX = 0;
|
||||
unsigned long argX = 0;
|
||||
int hr = Voice->lpDSBvoice->Stop(Voice->lpDSBvoice->_this);
|
||||
if(FAILED(hr))
|
||||
{
|
||||
@ -209,9 +209,9 @@ bool DSZeroVoiceBuffer(PVOICE Voice, char* pszDevName, DWORD dwBufferSize)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool DSZeroVoiceWritableBuffer(PVOICE Voice, char* pszDevName, DWORD dwBufferSize)
|
||||
bool DSZeroVoiceWritableBuffer(PVOICE Voice, char* pszDevName, unsigned long dwBufferSize)
|
||||
{
|
||||
DWORD dwDSLockedBufferSize0=0, dwDSLockedBufferSize1=0;
|
||||
unsigned long dwDSLockedBufferSize0=0, dwDSLockedBufferSize1=0;
|
||||
int16_t *pDSLockedBuffer0, *pDSLockedBuffer1;
|
||||
|
||||
|
||||
@ -335,7 +335,7 @@ void DSUninit()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
LONG NewVolume(DWORD dwVolume, DWORD dwVolumeMax)
|
||||
LONG NewVolume(unsigned long dwVolume, unsigned long dwVolumeMax)
|
||||
{
|
||||
float fVol = (float) dwVolume / (float) dwVolumeMax; // 0.0=Max, 1.0=Min
|
||||
|
||||
|
@ -35,21 +35,21 @@ typedef struct
|
||||
bool bMute;
|
||||
LONG nVolume; // Current volume (as used by DirectSound)
|
||||
LONG nFadeVolume; // Current fade volume (as used by DirectSound)
|
||||
DWORD dwUserVolume; // Volume from slider on Property Sheet (0=Max)
|
||||
unsigned long dwUserVolume; // Volume from slider on Property Sheet (0=Max)
|
||||
bool bIsSpeaker;
|
||||
bool bRecentlyActive; // (Speaker only) false after 0.2s of speaker inactivity
|
||||
} VOICE, *PVOICE;
|
||||
|
||||
|
||||
bool DSGetLock(LPDIRECTSOUNDBUFFER pVoice, DWORD dwOffset, DWORD dwBytes,
|
||||
int16_t** ppDSLockedBuffer0, DWORD* pdwDSLockedBufferSize0,
|
||||
int16_t** ppDSLockedBuffer1, DWORD* pdwDSLockedBufferSize1);
|
||||
bool DSGetLock(LPDIRECTSOUNDBUFFER pVoice, unsigned long dwOffset, unsigned long dwBytes,
|
||||
int16_t** ppDSLockedBuffer0, unsigned long* pdwDSLockedBufferSize0,
|
||||
int16_t** ppDSLockedBuffer1, unsigned long* pdwDSLockedBufferSize1);
|
||||
|
||||
int DSGetSoundBuffer(VOICE* pVoice, DWORD dwFlags, DWORD dwBufferSize, DWORD nSampleRate, int nChannels);
|
||||
int DSGetSoundBuffer(VOICE* pVoice, unsigned long dwFlags, unsigned long dwBufferSize, unsigned long nSampleRate, int nChannels);
|
||||
void DSReleaseSoundBuffer(VOICE* pVoice);
|
||||
|
||||
bool DSZeroVoiceBuffer(PVOICE Voice, char* pszDevName, DWORD dwBufferSize);
|
||||
bool DSZeroVoiceWritableBuffer(PVOICE Voice, char* pszDevName, DWORD dwBufferSize);
|
||||
bool DSZeroVoiceBuffer(PVOICE Voice, char* pszDevName, unsigned long dwBufferSize);
|
||||
bool DSZeroVoiceWritableBuffer(PVOICE Voice, char* pszDevName, unsigned long dwBufferSize);
|
||||
|
||||
typedef enum eFADE {FADE_NONE, FADE_IN, FADE_OUT} eFADE;
|
||||
void SoundCore_SetFade(eFADE FadeType);
|
||||
@ -62,12 +62,12 @@ void SoundCore_SetErrorMax(const int nErrorMax);
|
||||
bool DSInit();
|
||||
void DSUninit();
|
||||
|
||||
LONG NewVolume(DWORD dwVolume, DWORD dwVolumeMax);
|
||||
LONG NewVolume(unsigned long dwVolume, unsigned long dwVolumeMax);
|
||||
|
||||
void SysClk_WaitTimer();
|
||||
bool SysClk_InitTimer();
|
||||
void SysClk_UninitTimer();
|
||||
void SysClk_StartTimerUsec(DWORD dwUsecPeriod);
|
||||
void SysClk_StartTimerUsec(unsigned long dwUsecPeriod);
|
||||
void SysClk_StopTimer();
|
||||
|
||||
//
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "common.h"
|
||||
#include "audio/win-shim.h"
|
||||
|
||||
pthread_t CreateThread(void* unused_lpThreadAttributes, int unused_dwStackSize, LPTHREAD_START_ROUTINE lpStartRoutine, LPVOID lpParameter, DWORD unused_dwCreationFlags, LPDWORD lpThreadId)
|
||||
pthread_t CreateThread(void* unused_lpThreadAttributes, int unused_dwStackSize, LPTHREAD_START_ROUTINE lpStartRoutine, LPVOID lpParameter, unsigned long unused_dwCreationFlags, LPDWORD lpThreadId)
|
||||
{
|
||||
pthread_t a_thread = 0;
|
||||
int err = 0;
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
// 2013/09/19 - http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx
|
||||
|
||||
typedef unsigned long DWORD;
|
||||
#ifdef __APPLE__
|
||||
typedef UInt32 ULONG;
|
||||
#endif
|
||||
@ -38,7 +37,7 @@ typedef long *LPLONG;
|
||||
typedef void *LPVOID;
|
||||
typedef void *LPDVOID;
|
||||
typedef char *LPBYTE;
|
||||
typedef DWORD *LPDWORD;
|
||||
typedef unsigned long *LPDWORD;
|
||||
|
||||
typedef char *GUID; // HACK
|
||||
typedef GUID IID;
|
||||
@ -85,7 +84,7 @@ typedef void *IUnknown;
|
||||
|
||||
typedef LPVOID (*LPTHREAD_START_ROUTINE)(LPVOID unused);
|
||||
|
||||
pthread_t CreateThread(void* unused_lpThreadAttributes, int unused_dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD unused_dwCreationFlags, LPDWORD lpThreadId);
|
||||
pthread_t CreateThread(void* unused_lpThreadAttributes, int unused_dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, unsigned long unused_dwCreationFlags, LPDWORD lpThreadId);
|
||||
|
||||
#define THREAD_PRIORITY_NORMAL 0
|
||||
#define THREAD_PRIORITY_TIME_CRITICAL 15
|
||||
|
Loading…
Reference in New Issue
Block a user