Refactor : DWORD -> unsigned long

This commit is contained in:
Aaron Culliney 2015-06-07 11:47:57 -07:00
parent 7051e6d906
commit 109dfa855b
10 changed files with 98 additions and 99 deletions

View File

@ -31,17 +31,17 @@ typedef struct IDirectSoundBuffer {
// This method restores the memory allocation for a lost sound buffer for the specified DirectSoundBuffer object. // This method restores the memory allocation for a lost sound buffer for the specified DirectSoundBuffer object.
int (*Restore)(void *_this); 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 // 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. // 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 (*GetStatus)(void* _this, LPDWORD lpdwStatus);
int (*UnlockStaticBuffer)(void* _this, DWORD dwAudioBytes); int (*UnlockStaticBuffer)(void* _this, unsigned long dwAudioBytes);
int (*Replay)(void* _this); int (*Replay)(void* _this);
@ -153,48 +153,48 @@ static inline bool SUCCEEDED(int x) { return x == DS_OK; }
typedef struct { typedef struct {
uint16_t wFormatTag; uint16_t wFormatTag;
uint16_t nChannels; uint16_t nChannels;
DWORD nSamplesPerSec; unsigned long nSamplesPerSec;
DWORD nAvgBytesPerSec; unsigned long nAvgBytesPerSec;
uint16_t nBlockAlign; uint16_t nBlockAlign;
uint16_t wBitsPerSample; uint16_t wBitsPerSample;
uint16_t cbSize; uint16_t cbSize;
} WAVEFORMATEX, *LPWAVEFORMATEX; } WAVEFORMATEX, *LPWAVEFORMATEX;
typedef struct DSBUFFERDESC { typedef struct DSBUFFERDESC {
DWORD dwSize; unsigned long dwSize;
DWORD dwFlags; unsigned long dwFlags;
DWORD dwBufferBytes; unsigned long dwBufferBytes;
DWORD dwReserved; unsigned long dwReserved;
LPWAVEFORMATEX lpwfxFormat; LPWAVEFORMATEX lpwfxFormat;
} DSBUFFERDESC; } DSBUFFERDESC;
typedef DWORD DSCAPS_MASK; typedef unsigned long DSCAPS_MASK;
typedef struct _DSCAPS typedef struct _DSCAPS
{ {
DWORD dwSize; unsigned long dwSize;
DSCAPS_MASK dwFlags; DSCAPS_MASK dwFlags;
DWORD dwMinSecondarySampleRate; unsigned long dwMinSecondarySampleRate;
DWORD dwMaxSecondarySampleRate; unsigned long dwMaxSecondarySampleRate;
DWORD dwPrimaryBuffers; unsigned long dwPrimaryBuffers;
DWORD dwMaxHwMixingAllBuffers; unsigned long dwMaxHwMixingAllBuffers;
DWORD dwMaxHwMixingStaticBuffers; unsigned long dwMaxHwMixingStaticBuffers;
DWORD dwMaxHwMixingStreamingBuffers; unsigned long dwMaxHwMixingStreamingBuffers;
DWORD dwFreeHwMixingAllBuffers; unsigned long dwFreeHwMixingAllBuffers;
DWORD dwFreeHwMixingStaticBuffers; unsigned long dwFreeHwMixingStaticBuffers;
DWORD dwFreeHwMixingStreamingBuffers; unsigned long dwFreeHwMixingStreamingBuffers;
DWORD dwMaxHw3DAllBuffers; unsigned long dwMaxHw3DAllBuffers;
DWORD dwMaxHw3DStaticBuffers; unsigned long dwMaxHw3DStaticBuffers;
DWORD dwMaxHw3DStreamingBuffers; unsigned long dwMaxHw3DStreamingBuffers;
DWORD dwFreeHw3DAllBuffers; unsigned long dwFreeHw3DAllBuffers;
DWORD dwFreeHw3DStaticBuffers; unsigned long dwFreeHw3DStaticBuffers;
DWORD dwFreeHw3DStreamingBuffers; unsigned long dwFreeHw3DStreamingBuffers;
DWORD dwTotalHwMemBytes; unsigned long dwTotalHwMemBytes;
DWORD dwFreeHwMemBytes; unsigned long dwFreeHwMemBytes;
DWORD dwMaxContigFreeHwMemBytes; unsigned long dwMaxContigFreeHwMemBytes;
DWORD dwUnlockTransferRateHwBuffers; unsigned long dwUnlockTransferRateHwBuffers;
DWORD dwPlayCpuOverheadSwBuffers; unsigned long dwPlayCpuOverheadSwBuffers;
DWORD dwReserved1; unsigned long dwReserved1;
DWORD dwReserved2; unsigned long dwReserved2;
} DSCAPS, *LPDSCAPS; } DSCAPS, *LPDSCAPS;
typedef DSCAPS *LPCDSCAPS; typedef DSCAPS *LPCDSCAPS;

View File

@ -172,9 +172,9 @@ static bool g_bStopPhoneme = false;
static bool g_bVotraxPhoneme = false; static bool g_bVotraxPhoneme = false;
#ifdef APPLE2IX #ifdef APPLE2IX
static const DWORD SAMPLE_RATE = SPKR_SAMPLE_RATE; static const unsigned long SAMPLE_RATE = SPKR_SAMPLE_RATE;
#else #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 #endif
static short* ppAYVoiceBuffer[NUM_VOICES] = {0}; 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 #define MB_BUF_SIZE MAX_SAMPLES * 2 * MB_CHANNELS
static const unsigned short g_nMB_NumChannels = 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 #else
static const unsigned short g_nMB_NumChannels = 2; 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 #endif
static const int16_t nWaveDataMin = (int16_t)0x8000; static const int16_t nWaveDataMin = (int16_t)0x8000;
@ -245,7 +245,7 @@ static uint8_t quit_event = false;
#else #else
static const int g_nNumEvents = 2; static const int g_nNumEvents = 2;
static HANDLE g_hSSI263Event[g_nNumEvents] = {NULL}; // 1: Phoneme finished playing, 2: Exit thread 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 #endif
// When 6522 IRQ is *not* active use 60Hz update freq for MB voices // 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 #ifdef APPLE2IX
static void* SSI263Thread(LPVOID); static void* SSI263Thread(LPVOID);
#else #else
static DWORD SSI263Thread(LPVOID); static unsigned long SSI263Thread(LPVOID);
#endif #endif
static void Votrax_Write(uint8_t nDevice, uint8_t nValue); static void Votrax_Write(uint8_t nDevice, uint8_t nValue);
@ -866,7 +866,7 @@ static void MB_Update()
// //
#ifndef APPLE2IX #ifndef APPLE2IX
static DWORD dwByteOffset = (DWORD)-1; static unsigned long dwByteOffset = (unsigned long)-1;
static int nNumSamplesError = 0; static int nNumSamplesError = 0;
#endif #endif
@ -886,10 +886,10 @@ static void MB_Update()
// //
DWORD dwDSLockedBufferSize0, dwDSLockedBufferSize1; unsigned long dwDSLockedBufferSize0, dwDSLockedBufferSize1;
int16_t *pDSLockedBuffer0, *pDSLockedBuffer1; int16_t *pDSLockedBuffer0, *pDSLockedBuffer1;
DWORD dwCurrentPlayCursor, dwCurrentWriteCursor; unsigned long dwCurrentPlayCursor, dwCurrentWriteCursor;
#ifdef APPLE2IX #ifdef APPLE2IX
int hr = MockingboardVoice.lpDSBvoice->GetCurrentPosition(MockingboardVoice.lpDSBvoice->_this, &dwCurrentPlayCursor, &dwCurrentWriteCursor); int hr = MockingboardVoice.lpDSBvoice->GetCurrentPosition(MockingboardVoice.lpDSBvoice->_this, &dwCurrentPlayCursor, &dwCurrentWriteCursor);
#else #else
@ -899,7 +899,7 @@ static void MB_Update()
return; return;
#if 0 #if 0
if(dwByteOffset == (DWORD)-1) if(dwByteOffset == (unsigned long)-1)
{ {
// First time in this func // First time in this func
@ -1010,10 +1010,10 @@ static void MB_Update()
#ifdef APPLE2IX #ifdef APPLE2IX
if(!DSGetLock(MockingboardVoice.lpDSBvoice, if(!DSGetLock(MockingboardVoice.lpDSBvoice,
/*unused*/0, (DWORD)nNumSamples*sizeof(short)*g_nMB_NumChannels, /*unused*/0, (unsigned long)nNumSamples*sizeof(short)*g_nMB_NumChannels,
#else #else
if(DSGetLock(MockingboardVoice.lpDSBvoice, if(DSGetLock(MockingboardVoice.lpDSBvoice,
dwByteOffset, (DWORD)nNumSamples*sizeof(short)*g_nMB_NumChannels, dwByteOffset, (unsigned long)nNumSamples*sizeof(short)*g_nMB_NumChannels,
#endif #endif
&pDSLockedBuffer0, &dwDSLockedBufferSize0, &pDSLockedBuffer0, &dwDSLockedBufferSize0,
&pDSLockedBuffer1, &dwDSLockedBufferSize1)) &pDSLockedBuffer1, &dwDSLockedBufferSize1))
@ -1036,7 +1036,7 @@ static void MB_Update()
(void*)pDSLockedBuffer1, dwDSLockedBufferSize1); (void*)pDSLockedBuffer1, dwDSLockedBufferSize1);
#ifndef APPLE2IX #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 #endif
#ifdef RIFF_MB #ifdef RIFF_MB
@ -1049,7 +1049,7 @@ static void MB_Update()
#ifdef APPLE2IX #ifdef APPLE2IX
static void* SSI263Thread(LPVOID lpParameter) static void* SSI263Thread(LPVOID lpParameter)
#else #else
static DWORD SSI263Thread(LPVOID lpParameter) static unsigned long SSI263Thread(LPVOID lpParameter)
#endif #endif
{ {
while(1) while(1)
@ -1092,7 +1092,7 @@ static DWORD SSI263Thread(LPVOID lpParameter)
continue; continue;
} }
#else #else
DWORD dwWaitResult = WaitForMultipleObjects( unsigned long dwWaitResult = WaitForMultipleObjects(
g_nNumEvents, // number of handles in array g_nNumEvents, // number of handles in array
g_hSSI263Event, // array of event handles g_hSSI263Event, // array of event handles
FALSE, // wait until any one is signaled FALSE, // wait until any one is signaled
@ -1216,7 +1216,7 @@ static void SSI263_Play(unsigned int nPhoneme)
bPause = false; bPause = false;
} }
DWORD dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer unsigned long dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer
int16_t* pDSLockedBuffer; int16_t* pDSLockedBuffer;
hr = SSI263Voice.lpDSBvoice->Stop(); hr = SSI263Voice.lpDSBvoice->Stop();
@ -1287,7 +1287,7 @@ static bool MB_DSInit()
// Create single Mockingboard voice // 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; int16_t* pDSLockedBuffer;
if(!g_bDSAvailable) if(!g_bDSAvailable)
@ -1478,7 +1478,7 @@ static bool MB_DSInit()
// //
DWORD dwThreadId; unsigned long dwThreadId;
g_hThread = CreateThread(NULL, // lpThreadAttributes g_hThread = CreateThread(NULL, // lpThreadAttributes
0, // dwStackSize 0, // dwStackSize
@ -1500,7 +1500,7 @@ static void MB_DSUninit()
{ {
if(g_hThread) if(g_hThread)
{ {
DWORD dwExitCode; unsigned long dwExitCode;
#ifdef APPLE2IX #ifdef APPLE2IX
quit_event = true; quit_event = true;
pthread_cond_signal(&mockingboard_cond); pthread_cond_signal(&mockingboard_cond);
@ -2129,12 +2129,12 @@ bool MB_IsActive()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
DWORD MB_GetVolume() unsigned long MB_GetVolume()
{ {
return MockingboardVoice.dwUserVolume; return MockingboardVoice.dwUserVolume;
} }
void MB_SetVolume(DWORD dwVolume, DWORD dwVolumeMax) void MB_SetVolume(unsigned long dwVolume, unsigned long dwVolumeMax)
{ {
#ifdef APPLE2IX #ifdef APPLE2IX
#warning TODO FIXME ... why is OpenAL on my Linux box so damn loud?! #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 #ifdef APPLE2IX
// Saving and loading state currently unimplemented // Saving and loading state currently unimplemented
@ -2186,7 +2186,7 @@ DWORD MB_GetSnapshot(SS_CARD_MOCKINGBOARD* pSS, DWORD dwSlot)
#endif #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 #ifdef APPLE2IX
// Saving and loading state currently unimplemented // Saving and loading state currently unimplemented

View File

@ -110,10 +110,10 @@ SS_CARDTYPE MB_GetSoundcardType();
void MB_SetSoundcardType(SS_CARDTYPE NewSoundcardType); void MB_SetSoundcardType(SS_CARDTYPE NewSoundcardType);
double MB_GetFramePeriod(); double MB_GetFramePeriod();
bool MB_IsActive(); bool MB_IsActive();
DWORD MB_GetVolume(); unsigned long MB_GetVolume();
void MB_SetVolume(DWORD dwVolume, DWORD dwVolumeMax); void MB_SetVolume(unsigned long dwVolume, unsigned long dwVolumeMax);
DWORD MB_GetSnapshot(SS_CARD_MOCKINGBOARD* pSS, DWORD dwSlot); unsigned long MB_GetSnapshot(SS_CARD_MOCKINGBOARD* pSS, unsigned long dwSlot);
DWORD MB_SetSnapshot(SS_CARD_MOCKINGBOARD* pSS, DWORD dwSlot); unsigned long MB_SetSnapshot(SS_CARD_MOCKINGBOARD* pSS, unsigned long dwSlot);
#ifdef APPLE2IX #ifdef APPLE2IX
void mb_io_initialize(unsigned int slot4, unsigned int slot5); void mb_io_initialize(unsigned int slot4, unsigned int slot5);
#endif #endif

View File

@ -40,15 +40,15 @@ typedef enum SS_CARDTYPE
typedef struct typedef struct
{ {
DWORD dwLength; // Byte length of this unit struct unsigned long dwLength; // Byte length of this unit struct
DWORD dwVersion; unsigned long dwVersion;
} SS_UNIT_HDR; } SS_UNIT_HDR;
typedef struct typedef struct
{ {
SS_UNIT_HDR UnitHdr; SS_UNIT_HDR UnitHdr;
DWORD dwType; // SS_CARDTYPE unsigned long dwType; // SS_CARDTYPE
DWORD dwSlot; // [1..7] unsigned long dwSlot; // [1..7]
} SS_CARD_HDR; } SS_CARD_HDR;
void CpuIrqAssert(eIRQSRC irq_source); void CpuIrqAssert(eIRQSRC irq_source);

View File

@ -729,13 +729,13 @@ static long OpenALCreateSoundBuffer(ALBufferParamsStruct *params, ALSoundBufferS
(*soundbuf_struct)->GetCurrentPosition = (int (*)(void *, LPDWORD, LPDWORD))ALGetPosition; (*soundbuf_struct)->GetCurrentPosition = (int (*)(void *, LPDWORD, LPDWORD))ALGetPosition;
(*soundbuf_struct)->Stop = (int (*)(void *))ALStop; (*soundbuf_struct)->Stop = (int (*)(void *))ALStop;
(*soundbuf_struct)->Restore = (int (*)(void *))ALRestore; (*soundbuf_struct)->Restore = (int (*)(void *))ALRestore;
(*soundbuf_struct)->Play = (int (*)(void *, DWORD, DWORD, DWORD))ALPlay; (*soundbuf_struct)->Play = (int (*)(void *, unsigned long, unsigned long, unsigned long))ALPlay;
(*soundbuf_struct)->Lock = (int (*)(void *, DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD))ALBegin; (*soundbuf_struct)->Lock = (int (*)(void *, unsigned long, unsigned long, LPVOID *, LPDWORD, LPVOID *, LPDWORD, unsigned long))ALBegin;
(*soundbuf_struct)->Unlock = (int (*)(void *, LPVOID, DWORD, LPVOID, DWORD))ALCommit; (*soundbuf_struct)->Unlock = (int (*)(void *, LPVOID, unsigned long, LPVOID, unsigned long))ALCommit;
(*soundbuf_struct)->GetStatus = (int (*)(void *, LPDWORD))ALGetStatus; (*soundbuf_struct)->GetStatus = (int (*)(void *, LPDWORD))ALGetStatus;
// mockingboard-specific hacks // mockingboard-specific hacks
(*soundbuf_struct)->UnlockStaticBuffer = (int (*)(void *, DWORD))ALCommitStaticBuffer; (*soundbuf_struct)->UnlockStaticBuffer = (int (*)(void *, unsigned long))ALCommitStaticBuffer;
(*soundbuf_struct)->Replay = (int (*)(void *))ALReplay; (*soundbuf_struct)->Replay = (int (*)(void *))ALReplay;
return 0; return 0;

View File

@ -33,16 +33,16 @@ typedef struct IDirectSoundBuffer ALSoundBufferStruct;
typedef struct DSBUFFERDESC ALBufferParamsStruct; typedef struct DSBUFFERDESC ALBufferParamsStruct;
/* /*
DWORD dwSize; unsigned long dwSize;
DWORD dwFlags; unsigned long dwFlags;
DWORD dwBufferBytes; unsigned long dwBufferBytes;
DWORD dwReserved; unsigned long dwReserved;
LPWAVEFORMATEX lpwfxFormat LPWAVEFORMATEX lpwfxFormat
{ {
uint16_t wFormatTag; uint16_t wFormatTag;
uint16_t nChannels; uint16_t nChannels;
DWORD nSamplesPerSec; unsigned long nSamplesPerSec;
DWORD nAvgBytesPerSec; unsigned long nAvgBytesPerSec;
uint16_t nBlockAlign; uint16_t nBlockAlign;
uint16_t wBitsPerSample; uint16_t wBitsPerSample;
uint16_t cbSize; uint16_t cbSize;

View File

@ -57,11 +57,11 @@ bool g_bDisableDirectSound = false;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool DSGetLock(LPDIRECTSOUNDBUFFER pVoice, DWORD dwOffset, DWORD dwBytes, bool DSGetLock(LPDIRECTSOUNDBUFFER pVoice, unsigned long dwOffset, unsigned long dwBytes,
int16_t** ppDSLockedBuffer0, DWORD* pdwDSLockedBufferSize0, int16_t** ppDSLockedBuffer0, unsigned long* pdwDSLockedBufferSize0,
int16_t** ppDSLockedBuffer1, DWORD* pdwDSLockedBufferSize1) int16_t** ppDSLockedBuffer1, unsigned long* pdwDSLockedBufferSize1)
{ {
DWORD nStatus = 0; unsigned long nStatus = 0;
int hr = pVoice->GetStatus(pVoice->_this, &nStatus); int hr = pVoice->GetStatus(pVoice->_this, &nStatus);
if(hr != DS_OK) if(hr != DS_OK)
return false; 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; WAVEFORMATEX wavfmt;
DSBUFFERDESC dsbdesc; 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; int16_t* pDSLockedBuffer;
DWORD argX = 0; unsigned long argX = 0;
int hr = Voice->lpDSBvoice->Stop(Voice->lpDSBvoice->_this); int hr = Voice->lpDSBvoice->Stop(Voice->lpDSBvoice->_this);
if(FAILED(hr)) 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; 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 float fVol = (float) dwVolume / (float) dwVolumeMax; // 0.0=Max, 1.0=Min

View File

@ -35,21 +35,21 @@ typedef struct
bool bMute; bool bMute;
LONG nVolume; // Current volume (as used by DirectSound) LONG nVolume; // Current volume (as used by DirectSound)
LONG nFadeVolume; // Current fade 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 bIsSpeaker;
bool bRecentlyActive; // (Speaker only) false after 0.2s of speaker inactivity bool bRecentlyActive; // (Speaker only) false after 0.2s of speaker inactivity
} VOICE, *PVOICE; } VOICE, *PVOICE;
bool DSGetLock(LPDIRECTSOUNDBUFFER pVoice, DWORD dwOffset, DWORD dwBytes, bool DSGetLock(LPDIRECTSOUNDBUFFER pVoice, unsigned long dwOffset, unsigned long dwBytes,
int16_t** ppDSLockedBuffer0, DWORD* pdwDSLockedBufferSize0, int16_t** ppDSLockedBuffer0, unsigned long* pdwDSLockedBufferSize0,
int16_t** ppDSLockedBuffer1, DWORD* pdwDSLockedBufferSize1); 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); void DSReleaseSoundBuffer(VOICE* pVoice);
bool DSZeroVoiceBuffer(PVOICE Voice, char* pszDevName, DWORD dwBufferSize); bool DSZeroVoiceBuffer(PVOICE Voice, char* pszDevName, unsigned long dwBufferSize);
bool DSZeroVoiceWritableBuffer(PVOICE Voice, char* pszDevName, DWORD dwBufferSize); bool DSZeroVoiceWritableBuffer(PVOICE Voice, char* pszDevName, unsigned long dwBufferSize);
typedef enum eFADE {FADE_NONE, FADE_IN, FADE_OUT} eFADE; typedef enum eFADE {FADE_NONE, FADE_IN, FADE_OUT} eFADE;
void SoundCore_SetFade(eFADE FadeType); void SoundCore_SetFade(eFADE FadeType);
@ -62,12 +62,12 @@ void SoundCore_SetErrorMax(const int nErrorMax);
bool DSInit(); bool DSInit();
void DSUninit(); void DSUninit();
LONG NewVolume(DWORD dwVolume, DWORD dwVolumeMax); LONG NewVolume(unsigned long dwVolume, unsigned long dwVolumeMax);
void SysClk_WaitTimer(); void SysClk_WaitTimer();
bool SysClk_InitTimer(); bool SysClk_InitTimer();
void SysClk_UninitTimer(); void SysClk_UninitTimer();
void SysClk_StartTimerUsec(DWORD dwUsecPeriod); void SysClk_StartTimerUsec(unsigned long dwUsecPeriod);
void SysClk_StopTimer(); void SysClk_StopTimer();
// //

View File

@ -12,7 +12,7 @@
#include "common.h" #include "common.h"
#include "audio/win-shim.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; pthread_t a_thread = 0;
int err = 0; int err = 0;

View File

@ -25,7 +25,6 @@
// 2013/09/19 - http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx // 2013/09/19 - http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx
typedef unsigned long DWORD;
#ifdef __APPLE__ #ifdef __APPLE__
typedef UInt32 ULONG; typedef UInt32 ULONG;
#endif #endif
@ -38,7 +37,7 @@ typedef long *LPLONG;
typedef void *LPVOID; typedef void *LPVOID;
typedef void *LPDVOID; typedef void *LPDVOID;
typedef char *LPBYTE; typedef char *LPBYTE;
typedef DWORD *LPDWORD; typedef unsigned long *LPDWORD;
typedef char *GUID; // HACK typedef char *GUID; // HACK
typedef GUID IID; typedef GUID IID;
@ -85,7 +84,7 @@ typedef void *IUnknown;
typedef LPVOID (*LPTHREAD_START_ROUTINE)(LPVOID unused); 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_NORMAL 0
#define THREAD_PRIORITY_TIME_CRITICAL 15 #define THREAD_PRIORITY_TIME_CRITICAL 15