Fixed allocated memory and some cleanup after latest changes.

This commit is contained in:
Volker Ruppert 2015-02-08 10:33:12 +00:00
parent 739d18c48d
commit 52b4c20992
2 changed files with 3 additions and 7 deletions

View File

@ -44,15 +44,14 @@ bx_sound_windows_c::bx_sound_windows_c()
ismidiready = 1;
// size is the total size of the midi header and buffer and the
// BX_SOUND_WINDOWS_NBUF wave header and buffers, all aligned
// on a 16-byte boundary
// wave header and buffer, all aligned on a 16-byte boundary
#define ALIGN(size) ((size + 15) & ~15)
#define size ALIGN(sizeof(MIDIHDR)) \
+ ALIGN(sizeof(WAVEHDR)) * (BX_SOUND_WINDOWS_NBUF + 1) \
+ ALIGN(sizeof(WAVEHDR)) * 2 \
+ ALIGN(BX_SOUND_WINDOWS_MAXSYSEXLEN) \
+ ALIGN(BX_SOUNDLOW_WAVEPACKETSIZE + 64) * (BX_SOUND_WINDOWS_NBUF + 1)
+ ALIGN(BX_SOUNDLOW_WAVEPACKETSIZE + 64)
DataHandle = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, size);
DataPointer = (Bit8u*) GlobalLock(DataHandle);

View File

@ -27,9 +27,6 @@
#define BX_SOUND_WINDOWS_MAXSYSEXLEN 256 // maximum supported length of a sysex message
#define BX_SOUND_WINDOWS_NBUF 64 // number of buffers for the output, must be power of 2 and >= 4
#define BX_SOUND_WINDOWS_NMASK (BX_SOUND_WINDOWS_NBUF - 1)
#ifndef WAVEMAPPER
#define WAVEMAPPER -1
#endif