- get sndblst and sound compiling on msvc.
Modified: trunk/reactos/drivers/dd/sndblst/card.c
Modified: trunk/reactos/drivers/dd/sndblst/dma.c
Modified: trunk/reactos/drivers/dd/sndblst/portio.c
Modified: trunk/reactos/drivers/dd/sndblst/sndblst.c
Modified: trunk/reactos/drivers/dd/sndblst/sndblst.h
Modified: trunk/reactos/drivers/dd/sound/wave.c
Modified: trunk/reactos/drivers/dd/sound/wave.h
_____
Modified: trunk/reactos/drivers/dd/sndblst/card.c
--- trunk/reactos/drivers/dd/sndblst/card.c 2006-01-07 05:37:22 UTC
(rev 20648)
+++ trunk/reactos/drivers/dd/sndblst/card.c 2006-01-07 05:47:21 UTC
(rev 20649)
@@ -7,7 +7,7 @@
#include <ntddk.h>
#include "sndblst.h"
-VOID SetOutputSampleRate(UINT BasePort, UINT SampleRate)
+VOID SetOutputSampleRate(ULONG BasePort, ULONG SampleRate)
{
// This only works for DSP v4.xx ONLY - need a workaround!
DPRINT("Setting output sample rate\n");
@@ -22,7 +22,7 @@
}
-VOID EnableSpeaker(UINT BasePort, BOOLEAN SpeakerOn)
+VOID EnableSpeaker(ULONG BasePort, BOOLEAN SpeakerOn)
{
DPRINT("Setting speaker status %d\n", SpeakerOn);
@@ -33,7 +33,7 @@
}
-BOOLEAN IsSpeakerEnabled(UINT BasePort)
+BOOLEAN IsSpeakerEnabled(ULONG BasePort)
{
DPRINT("Obtaining speaker status\n");
@@ -48,7 +48,7 @@
}
-VOID BeginPlayback(UINT BasePort, UINT BitDepth, UINT Channels, UINT
BlockSize)
+VOID BeginPlayback(ULONG BasePort, ULONG BitDepth, ULONG Channels,
ULONG BlockSize)
{
DPRINT("BeginPlayback(%d, %d, %d, %d)\n", BasePort, BitDepth,
Channels, BlockSize);
_____
Modified: trunk/reactos/drivers/dd/sndblst/dma.c
--- trunk/reactos/drivers/dd/sndblst/dma.c 2006-01-07 05:37:22 UTC
(rev 20648)
+++ trunk/reactos/drivers/dd/sndblst/dma.c 2006-01-07 05:47:21 UTC
(rev 20649)
@@ -41,7 +41,7 @@
IN PVOID Context)
{
PDEVICE_EXTENSION Device = DeviceObject->DeviceExtension;
- UINT zzz;
+ ULONG zzz;
PUCHAR VirtualAddress = (PUCHAR)
MmGetMdlVirtualAddress(Device->Mdl);
DPRINT("IoMapTransfer\n");
_____
Modified: trunk/reactos/drivers/dd/sndblst/portio.c
--- trunk/reactos/drivers/dd/sndblst/portio.c 2006-01-07 05:37:22 UTC
(rev 20648)
+++ trunk/reactos/drivers/dd/sndblst/portio.c 2006-01-07 05:47:21 UTC
(rev 20649)
@@ -12,7 +12,7 @@
#include <ntddk.h>
#include "sndblst.h"
-BOOLEAN WaitToSend(UINT BasePort)
+BOOLEAN WaitToSend(ULONG BasePort)
{
int TimeOut;
@@ -35,7 +35,7 @@
return TRUE;
}
-BOOLEAN WaitToReceive(UINT BasePort)
+BOOLEAN WaitToReceive(ULONG BasePort)
{
int TimeOut;
@@ -59,9 +59,9 @@
}
-WORD InitSoundCard(UINT BasePort)
+USHORT InitSoundCard(ULONG BasePort)
{
- UINT TimeOut;
+ ULONG TimeOut;
BOOLEAN Status;
UCHAR DSP_Major, DSP_Minor;
_____
Modified: trunk/reactos/drivers/dd/sndblst/sndblst.c
--- trunk/reactos/drivers/dd/sndblst/sndblst.c 2006-01-07 05:37:22 UTC
(rev 20648)
+++ trunk/reactos/drivers/dd/sndblst/sndblst.c 2006-01-07 05:47:21 UTC
(rev 20649)
@@ -20,7 +20,7 @@
/* INTERNAL VARIABLES
******************************************************/
-UINT DeviceCount = 0;
+ULONG DeviceCount = 0;
/* FUNCTIONS
***************************************************************/
@@ -38,7 +38,7 @@
// CONFIG Config;
RTL_QUERY_REGISTRY_TABLE Table[2];
NTSTATUS s;
- WORD DSP_Version = 0;
+ USHORT DSP_Version = 0;
UCHAR DSP_Major = 0, DSP_Minor = 0;
// This is TEMPORARY, to ensure that we don't process more than 1
device.
@@ -228,7 +228,7 @@
* RETURNS: Success or failure
*/
{
- UINT Channel;
+ ULONG Channel;
DPRINT("BlasterCleanup() called!\n");
// Reset the device (should we do this?)
@@ -255,8 +255,8 @@
{
PIO_STACK_LOCATION Stack;
PDEVICE_EXTENSION DeviceExtension;
- UINT ByteCount;
- PBYTE Data;
+ ULONG ByteCount;
+ PUCHAR Data;
DPRINT("BlasterWrite() called!\n");
@@ -265,7 +265,7 @@
DPRINT("%d bytes\n", Stack->Parameters.Write.Length);
- Data = (PBYTE) Irp->AssociatedIrp.SystemBuffer;
+ Data = (PUCHAR) Irp->AssociatedIrp.SystemBuffer;
for (ByteCount = 0; ByteCount <
Stack->Parameters.Write.Length; ByteCount ++)
{
@@ -307,7 +307,7 @@
/* case IOCTL_MIDI_PLAY :
{
DPRINT("Received IOCTL_MIDI_PLAY\n");
- Data = (PBYTE) Irp->AssociatedIrp.SystemBuffer;
+ Data = (PUCHAR) Irp->AssociatedIrp.SystemBuffer;
DPRINT("Sending %d bytes of MIDI data to 0x%d:\n",
Stack->Parameters.DeviceIoControl.InputBufferLength,
DeviceExtension->Port);
_____
Modified: trunk/reactos/drivers/dd/sndblst/sndblst.h
--- trunk/reactos/drivers/dd/sndblst/sndblst.h 2006-01-07 05:37:22 UTC
(rev 20648)
+++ trunk/reactos/drivers/dd/sndblst/sndblst.h 2006-01-07 05:47:21 UTC
(rev 20649)
@@ -96,9 +96,9 @@
{
PWSTR RegistryPath;
PDRIVER_OBJECT DriverObject;
- UINT Port;
- UINT IRQ;
- UINT DMA;
+ ULONG Port;
+ ULONG IRQ;
+ ULONG DMA;
ULONG BufferSize;
PADAPTER_OBJECT Adapter;
PMDL Mdl;
@@ -123,8 +123,8 @@
//typedef struct _CONFIG
//{
-// UINT Port;
-// UINT IRQ;
+// ULONG Port;
+// ULONG IRQ;
//} CONFIG, *PCONFIG;
/*
@@ -139,9 +139,9 @@
Prototypes for functions in portio.c :
*/
-BOOLEAN WaitToSend(UINT BasePort);
-BOOLEAN WaitToReceive(UINT BasePort);
-WORD InitSoundCard(UINT BasePort);
+BOOLEAN WaitToSend(ULONG BasePort);
+BOOLEAN WaitToReceive(ULONG BasePort);
+USHORT InitSoundCard(ULONG BasePort);
/*
Prototypes for functions in settings.c :
@@ -168,9 +168,9 @@
-VOID SetOutputSampleRate(UINT BasePort, UINT SampleRate);
-VOID EnableSpeaker(UINT BasePort, BOOLEAN SpeakerOn);
-BOOLEAN IsSpeakerEnabled(UINT BasePort);
-VOID BeginPlayback(UINT BasePort, UINT BitDepth, UINT Channels, UINT
BlockSize);
+VOID SetOutputSampleRate(ULONG BasePort, ULONG SampleRate);
+VOID EnableSpeaker(ULONG BasePort, BOOLEAN SpeakerOn);
+BOOLEAN IsSpeakerEnabled(ULONG BasePort);
+VOID BeginPlayback(ULONG BasePort, ULONG BitDepth, ULONG Channels,
ULONG BlockSize);
#endif
_____
Modified: trunk/reactos/drivers/dd/sound/wave.c
--- trunk/reactos/drivers/dd/sound/wave.c 2006-01-07 05:37:22 UTC
(rev 20648)
+++ trunk/reactos/drivers/dd/sound/wave.c 2006-01-07 05:47:21 UTC
(rev 20649)
@@ -13,6 +13,7 @@
/* FUNCTIONS
**************************************************************/
#include <ntddk.h>
+#include <halfuncs.h>
#include <string.h>
#include <devices.h>
@@ -38,7 +39,6 @@
void sb16_play(WAVE_HDR* wave)
{
- unsigned int eflags;
ULONG MappedIrq;
KIRQL Dirql;
KAFFINITY Affinity;
@@ -64,9 +64,7 @@
* saving the previous state of the interrupt flag
*/
- __asm__("pushf\n\tpop %0\n\tcli\n\t"
- : "=m" (eflags)
- : );
+ _disable();
memcpy(sb16.buffer,(&wave->data),wave->dLen);
@@ -82,9 +80,7 @@
// outb(0x21,(mask&~newmask));
// Restore the interrupt flag
- __asm__("push %0\n\tpopf\n\t"
- :
- : "m" (eflags));
+ _enable();
_____
Modified: trunk/reactos/drivers/dd/sound/wave.h
--- trunk/reactos/drivers/dd/sound/wave.h 2006-01-07 05:37:22 UTC
(rev 20648)
+++ trunk/reactos/drivers/dd/sound/wave.h 2006-01-07 05:47:21 UTC
(rev 20649)
@@ -1,23 +1,25 @@
KIRQL irql;
KAFFINITY affinity;
+#include <pshpack1.h>
typedef struct
{
- unsigned char rID[4] __attribute__((packed));
//4 0
- unsigned int rLen __attribute__((packed));
//4 4
- unsigned char wID[4] __attribute__((packed));
//4 8
- unsigned char fID[4] __attribute__((packed));
//4 12
- unsigned int fLen __attribute__((packed));
//4 16
- unsigned short wFormatTag __attribute__((packed));
//2 18
- unsigned short nChannels __attribute__((packed));
//2 20
- unsigned int nSamplesPerSec __attribute__((packed));
//2 22
- unsigned int nAvgBytesPerSec __attribute__((packed));
//2 24
- unsigned short nBlockAlign __attribute__((packed));
//2 26
- unsigned short FormatSpecific __attribute__((packed));
//2 28
- unsigned char dID[4] __attribute__((packed));
//4 30
- unsigned int dLen __attribute__((packed));
+ unsigned char rID[4] ;
//4 0
+ unsigned int rLen ;
//4 4
+ unsigned char wID[4] ;
//4 8
+ unsigned char fID[4] ;
//4 12
+ unsigned int fLen ;
//4 16
+ unsigned short wFormatTag ;
//2 18
+ unsigned short nChannels ; //2
20
+ unsigned int nSamplesPerSec ; //2 22
+ unsigned int nAvgBytesPerSec ; //2 24
+ unsigned short nBlockAlign ; //2 26
+ unsigned short FormatSpecific ; //2 28
+ unsigned char dID[4] ;
//4 30
+ unsigned int dLen ;
unsigned char* data;
}WAVE_HDR;
+#include <poppack.h>
void sb16_play(WAVE_HDR* wave);
void dump_wav(WAVE_HDR* wave);