ReactOS 0.4.15-dev-7660-g0086d05
wave.h File Reference
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for wave.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  WAVE_HDR
 

Functions

void sb16_play (WAVE_HDR *wave)
 
void dump_wav (WAVE_HDR *wave)
 
BOOLEAN playRoutine (PKINTERRUPT Interrupt, PVOID ServiceContext)
 

Variables

KIRQL irql
 
KAFFINITY affinity
 

Function Documentation

◆ dump_wav()

void dump_wav ( WAVE_HDR wave)

Definition at line 131 of file wave.c.

132{
133 DPRINT1("wave.rID: %c%c%c%c\n",wave->rID[0],wave->rID[1],wave->rID[2],wave->rID[3]);
134 DPRINT1("wave.rLen: 0x%x\n",wave->rLen);
135 DPRINT1("wave.wID: %c%c%c%c\n",wave->wID[0],wave->wID[1],wave->wID[2],wave->wID[3]);
136 DPRINT1("wave.fID: %c%c%c%c\n",wave->fID[0],wave->fID[1],wave->fID[2],wave->fID[3]);
137 DPRINT1("wave.fLen: 0x%x\n",wave->fLen);
138 DPRINT1("wave.wFormatTag: 0x%x\n",wave->wFormatTag);
139 DPRINT1("wave.nChannels: 0x%x\n",wave->nChannels);
140 DPRINT1("wave.nSamplesPerSec: 0x%x\n",wave->nSamplesPerSec);
141 DPRINT1("wave.nAvgBytesPerSec: 0x%x\n",wave->nAvgBytesPerSec);
142 DPRINT1("wave.nBlockAlign: 0x%x\n",wave->nBlockAlign);
143 DPRINT1("wave.FormatSpecific: 0x%x\n",wave->FormatSpecific);
144 DPRINT1("wave.dID: %c%c%c%c\n",wave->dID[0],wave->dID[1],wave->dID[2],wave->dID[3]);
145 DPRINT1("wave.dLen: 0x%x\n",wave->dLen);
146}
#define DPRINT1
Definition: precomp.h:8
unsigned char wave[]
Definition: in.h:3

Referenced by sb16_play().

◆ playRoutine()

BOOLEAN playRoutine ( PKINTERRUPT  Interrupt,
PVOID  ServiceContext 
)

Definition at line 148 of file wave.c.

149{
150 return FALSE;
151}
#define FALSE
Definition: types.h:117

◆ sb16_play()

void sb16_play ( WAVE_HDR wave)

Definition at line 39 of file wave.c.

40{
41 ULONG MappedIrq;
42 KIRQL Dirql;
45 unsigned int newmask;
46
47 unsigned int i;
48 unsigned int tmp[255];
49 i=0;
51 do
52 {
53// tmp[i++]=get_dma_page(0x0fffff);
54// DPRINT1("0x%x ",tmp[i-1]);
55 }
56 while((tmp[i-1]&0xffff)!=0);
57 // free_page((tmp[0]),i-1);
58 sb16.buffer=((unsigned char*)tmp[i-1]);
59
60 /*
61 * Because this is used by almost every subsystem including irqs it
62 * must be atomic. The following code sequence disables interrupts after
63 * saving the previous state of the interrupt flag
64 */
65
66 _disable();
67
68 memcpy(sb16.buffer,(&wave->data),wave->dLen);
69
70
71 MappedIrq = HalGetInterruptVector(Internal,0,0,8+sb16.irq,&Dirql,&Affinity);
72
73
74
76
77 // mask=inb(0x21);
78 newmask=((int)1<<sb16.irq);
79 // outb(0x21,(mask&~newmask));
80
81 // Restore the interrupt flag
82 _enable();
83
84
85
86 // disable_dma(sb16.dma8);
87 //outb(0x0a,5);
88 // clear_dma_ff(1);
89 //outb(0xc,0);
90 // set_dma_count(1,wave->dLen);
91 //set_dma_mode(1,DMA_MODE_WRITE);
92 //outb(0xb,0x49);
93 //outb(0x3,(wave->dLen)&0xff);
94 //outb(0x3,((unsigned int)(wave->dLen)>>8)&0xff);
95 //set_dma_addr(sb16.dma8,(unsigned int)sb16.buffer);
96 //outb(0x83,(((unsigned int)(sb16.buffer-IDMAP_BASE)>>16))&0xf);
97 //outb(0x2,((unsigned int)sb16.buffer&0xff));
98 //outb(0x2,(((unsigned int)(sb16.buffer-IDMAP_BASE)>>8))&0xff);
99 //enable_dma(sb16.dma8);
100 //outb(0xa,1);
101
102 write_dsp(sb16.base,0x00D1);
103
104 write_dsp(sb16.base,0x40);
105 write_dsp(sb16.base,((unsigned char)256-(1000000/wave->nSamplesPerSec)));
106
107// outb(sb16.base + 4, (int) 0xa);
108// outb(sb16.base + 5, (int) 0x00);
109
110// outb(sb16.base + 4, (int) 4);
111// outb(sb16.base + 5, (int) 0xFF);
112
113// outb(sb16.base + 4, (int) 0x22);
114// outb(sb16.base + 5, (int) 0xFF);
115
116 write_dsp(sb16.base,0x14);
117 write_dsp(sb16.base,(wave->dLen&0x00ff));
118 write_dsp(sb16.base,((wave->dLen)&0xff00)>>8);
119
120// write_dsp(sb16.base,0xc0);
121// write_dsp(sb16.base,0x0);
122// OldIRQ=HalGetInterruptVector(Internal,0,0,irq+8,&irql,&affinity);
123// DPRINT1("OldIRQ: 0x%x\n",OldIRQ);
124
125// status=IoConnectInterrupt(&IrqObject,playRoutine,0,NULL,OldIRQ,irql,irql,0,FALSE,affinity,FALSE);
126// if(status!=STATUS_SUCCESS) DPRINT1("Couldn't set irq\n");
127// else DPRINT1("IRQ set\n");
128
129}
#define NULL
Definition: types.h:112
ULONG_PTR KAFFINITY
Definition: compat.h:85
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
void dump_wav(WAVE_HDR *wave)
Definition: wave.c:131
SB16 sb16
Definition: wave.c:28
static BOOLEAN NTAPI DMAOutputISR(PKINTERRUPT Interrupt, PVOID ServiceContext)
Definition: wave.c:33
PKINTERRUPT IrqObject
Definition: wave.c:31
NTHALAPI ULONG NTAPI HalGetInterruptVector(INTERFACE_TYPE, ULONG, ULONG, ULONG, PKIRQL, PKAFFINITY)
void write_dsp(unsigned short base, unsigned char data)
Definition: dsp.c:73
UCHAR KIRQL
Definition: env_spec_w32.h:591
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
@ Internal
Definition: hwresource.cpp:137
void __cdecl _disable(void)
Definition: intrin_arm.h:365
void __cdecl _enable(void)
Definition: intrin_arm.h:373
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
NTSTATUS NTAPI IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject, IN PKSERVICE_ROUTINE ServiceRoutine, IN PVOID ServiceContext, IN PKSPIN_LOCK SpinLock, IN ULONG Vector, IN KIRQL Irql, IN KIRQL SynchronizeIrql, IN KINTERRUPT_MODE InterruptMode, IN BOOLEAN ShareVector, IN KAFFINITY ProcessorEnableMask, IN BOOLEAN FloatingSave)
Definition: irq.c:22
unsigned char * buffer
Definition: sb16.h:7
unsigned char irq
Definition: sb16.h:4
unsigned short base
Definition: sb16.h:3
uint32_t ULONG
Definition: typedefs.h:59
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:174

Variable Documentation

◆ affinity

KAFFINITY affinity

Definition at line 2 of file wave.h.

Referenced by child_process(), EnableIrq(), test_ExitProcess(), and test_thread_processor().

◆ irql

Request Lock & irql

Definition at line 1 of file wave.h.

Referenced by __drv_raisesIRQL(), FxFileObject::_CreateFileObject(), FxFileObject::_DestroyFileObject(), _Function_class_(), FxFileObject::_GetFileObjectFromWdm(), FxPkgFdo::_PnpStartDeviceCompletionRoutine(), FxWmiIrpHandler::_QueryAllData(), FxWmiIrpHandler::_RegInfo(), FxIoTarget::_RequestCancelled(), _Requires_lock_not_held_(), FxDisposeList::_WorkItemThunk(), FxTransactionedList::Add(), FxChildList::Add(), FxDisposeList::Add(), add_calc_job_comp(), add_calc_job_decomp(), FxResourceCollection::AddAt(), FxObject::AddContext(), FxPkgPdo::AddEjectionDevice(), FxWmiProvider::AddInstance(), FxPkgIo::AddIoQueue(), FxRequest::AddIrpReference(), FxWmiIrpHandler::AddPowerPolicyProviderAndInstance(), FxWmiIrpHandler::AddProvider(), FxPkgPnp::AddRemovalDevice(), FxPkgPnp::AddUsageDevice(), FxDmaPacketTransaction::AllocateAdapterChannel(), FxPkgPnp::AllocateDmaEnablerList(), FxPkgPnp::AllocateEnumInfo(), FxChildList::BeginIteration(), FxChildList::BeginScan(), FxDmaScatterGatherTransaction::BuildScatterGatherList(), calc_thread_main(), FxIoQueue::CancelForDriver(), FxIoTarget::CancelSentIo(), FxSystemThread::CancelWorkItem(), FxTagTracker::CheckForAbandondedTags(), ClasspRetryRequestDpc(), ClassRetryRequest(), FxWmiIrpHandler::Cleanup(), FxUsbInterface::CleanUpAndDelete(), FxUsbDevice::CleanupInterfacePipesAndDelete(), FxDevice::ClearCallbackFlags(), FxIoTarget::ClearCompletedRequestVerifierFlags(), FxRequestBase::ClearVerifierFlags(), FxIoTargetRemote::Close(), FxIoTarget::CompleteCanceledRequest(), FxPkgGeneral::ConfigureForwarding(), FxPkgIo::ConfigureForwarding(), FxChildList::CreateDevice(), FxIoQueue::DeferredDispatchRequestsFromDpc(), FxIoQueue::DeferredDispatchRequestsFromWorkerThread(), FxObject::DeleteEarlyDisposedObject(), FxFileObject::DeleteFileObjectFromFailedCreate(), FxDevice::DeleteObject(), FxTransactionedList::Deleting(), FxWmiIrpHandler::Deregister(), FxDeviceDescriptionEntry::DeviceSurpriseRemoved(), FxPowerIdleMachine::DisableTimer(), DiskShutdownFlush(), FxWmiIrpHandler::Dispatch(), FxPkgPdo::DispatchSystemSetPower(), FxPkgPnp::DispatchWaitWake(), FxIoQueue::Dispose(), FxSystemWorkItem::Dispose(), FxTimer::Dispose(), FxWorkItem::Dispose(), do_calc_job(), do_shutdown(), do_unlock_volume(), FxDpc::DpcHandler(), FxInterrupt::DpcHandler(), FxPowerIdleMachine::EnableTimer(), FxChildList::EndScan(), FxWorkItem::Enqueue(), FxSystemWorkItem::EnqueueWorker(), event_notification(), FxEventQueue::EventQueueWorker(), FxSystemThread::ExitThread(), FxSystemThread::ExitThreadAsync(), FxWmiIrpHandler::FindProviderReferenced(), FxPkgIo::FlushAllQueuesByFileObject(), FxIoQueue::FlushByFileObject(), FxIoQueue::ForwardRequestWorker(), FxDmaPacketTransaction::FreeMapRegistersAndAdapter(), FxDmaSystemTransaction::FreeMapRegistersAndAdapter(), FX_VF_METHOD(), FxAllocateDriverGlobals(), FxCacheBugCheckDriverInfo(), FxFreeDriverGlobals(), FxMdlAllocateDebug(), FxMdlFreeDebug(), FxPoolInsertNonPagedAllocateTracker(), FxPoolRemoveNonPagedAllocateTracker(), FxPurgeBugCheckDriverInfo(), FxTagTracker::FxTagTracker(), FxUsbPipeContinuousReader::FxUsbPipeRequestWorkItemHandler(), FxChildList::GetAddressDescription(), FxChildList::GetAddressDescriptionFromEntry(), FxDevice::GetCallbackFlags(), FxCmResList::GetCount(), FxRequest::GetCurrentIrpStackLocation(), FxCmResList::GetDescriptor(), FxRequest::GetDeviceControlOutputMdl(), FxRequest::GetDeviceControlOutputMemoryObject(), FxChildList::GetDeviceFromId(), FxRequest::GetFileObject(), FxRequest::GetInformation(), FxWmiProvider::GetInstanceIndex(), FxWmiProvider::GetInstanceReferenced(), FxRequest::GetIrp(), FxRequest::GetMdl(), FxRequest::GetMemoryObject(), FxChildList::GetNextDevice(), FxChildList::GetNextStaticDevice(), FxRequest::GetParameters(), FxPkgPnp::GetPnpCapsInternal(), FxPkgPnp::GetPnpStateInternal(), FxIoQueue::GetRequest(), FxRequest::GetRequestorMode(), FxDmaScatterGatherTransaction::GetScatterGatherList(), FxRequest::GetStatus(), FxRequestBase::GetVerifierFlags(), FxIoTarget::GotoPurgeState(), FxUsbPipe::GotoPurgeState(), FxIoTarget::GotoRemoveState(), FxUsbPipe::GotoRemoveState(), FxIoTarget::GotoStartState(), FxIoTarget::GotoStopState(), FxUsbPipe::GotoStopState(), FxIoTarget::HandleFailedResubmit(), if(), FxChildList::IndicateWakeStatus(), FxSystemThread::Initialize(), invalidate_volumes(), FxFileObjectFileCreate::Invoke(), FxCxFileObjectFileCreate::Invoke(), FxDriverDeviceAdd::Invoke(), FxIoQueueIoState::Invoke(), FxIoQueueIoDefault::Invoke(), FxIoQueueIoResume::Invoke(), FxIoQueueIoCanceledOnQueue::Invoke(), FxIoQueueIoStop::Invoke(), FxIoQueueIoRead::Invoke(), FxIoQueueIoWrite::Invoke(), FxIoQueueIoDeviceControl::Invoke(), FxIoQueueIoInternalDeviceControl::Invoke(), FxFileObjectFileCleanup::Invoke(), FxFileObjectFileClose::Invoke(), FxRequestCancelCallback::InvokeCancel(), FxChildList::InvokeReportedMissingCallback(), FxPowerIdleMachine::IoDecrement(), FxPowerIdleMachine::IoIncrementWithFlags(), FxDeviceDescriptionEntry::IsDeviceRemoved(), FxDeviceDescriptionEntry::IsDeviceReportedMissing(), KeGetCurrentIrql(), lock_volume(), FxTransactionedList::LockForEnum(), FxObject::MarkDisposeOverride(), FxObject::MarkNoDeleteDDI(), mount_vol(), FxChildList::NotifyDeviceRemove(), FxChildList::NotifyDeviceSurpriseRemove(), FxIoTargetRemote::Open(), FxIoQueue::PeekRequest(), FxUsbDevice::PipesGotoRemoveState(), FxChildList::PostParentToD0(), FxIoQueue::PostRequestCompletedCallback(), FxPkgPnp::PowerCompletePendedWakeIrp(), FxPkgPnp::PowerMakeWakeRequestNonCancelable(), FxPkgPnp::PowerPolicyProcessEvent(), FxPkgPnp::PowerPolicyProcessEventInner(), FxPkgPnp::PowerPolRemoved(), FxPkgPnp::PowerPolRestartingFailed(), FxPkgPnp::PowerPolStartingFailed(), FxPkgPnp::PowerPolStoppingSendStatus(), FxPkgPnp::PowerProcessEvent(), FxPowerIdleMachine::PowerReferenceWorker(), FxIoQueue::PreRequestCompletedCallback(), FxChildList::ProcessBusRelations(), FxDeviceDescriptionEntry::ProcessDeviceRemoved(), FxDevicePwrRequirementMachine::ProcessEvent(), FxWakeInterruptMachine::ProcessEvent(), FxDevicePwrRequirementMachine::ProcessEventInner(), FxWakeInterruptMachine::ProcessEventInner(), FxPowerIdleMachine::ProcessPowerEvent(), FxIoTarget::Purge(), FxUsbDevice::Purge(), FxDmaScatterGatherTransaction::PutScatterGatherList(), FxPowerIdleMachine::QueryReturnToIdle(), FxIoQueue::QueueIdle(), FxIoQueue::QueuePurge(), FxIoQueue::QueueRequest(), FxIoQueue::QueueRequestFromForward(), FxIoQueue::QueueStart(), FxEventQueue::QueueToThreadWorker(), FxSystemThread::QueueWorkItem(), FxIoQueue::ReadyNotify(), FxSystemThread::Reaper(), FxChildList::ReenumerateEntry(), FxWmiIrpHandler::Register(), register_fve_callback(), FxTransactionedList::Remove(), FxResourceCollection::RemoveAndDelete(), FxWmiProvider::RemoveInstance(), FxPkgIo::RemoveIoQueue(), FxWmiIrpHandler::RemoveProvider(), FxIoQueue::RequestCancelable(), FxIoQueue::RequestCompletedCallback(), FxIoTarget::RequestCompletionRoutine(), FxIoQueue::Requeue(), FxWmiIrpHandler::ResetStateForPdoRestart(), FxIoQueue::ResetStateForRestart(), FxPkgIo::ResetStateForRestart(), FxUsbPipeContinuousReader::ResubmitRepeater(), FxPkgIo::ResumeProcessingForPower(), FxIoQueue::ResumeProcessingForPower(), FxRequest::Reuse(), FxTransactionedList::SearchForAndRemove(), FxDevice::SetCallbackFlags(), FxEventQueue::SetDelayedDeletion(), FxEventQueue::SetFinished(), FxRequest::SetInformation(), FxPkgPnp::SetPnpCaps(), FxPkgPnp::SetPnpState(), FxRequestBase::SetVerifierFlags(), SpiSenseCompletionRoutine(), FxTimer::Start(), FxPowerIdleMachine::Start(), FxUsbDevice::Start(), FxIoQueue::StartPowerTransitionOff(), FxIoQueue::StartPowerTransitionOn(), FxTimer::Stop(), FxIoTarget::Stop(), FxUsbDevice::Stop(), FxPowerIdleMachine::Stop(), FxIoQueue::StopProcessingForPower(), FxPkgIo::StopProcessingForPower(), FxIoTarget::Submit(), FxIoTarget::SubmitSync(), FxSystemThread::Thread(), FxIoTarget::TimerCallback(), FxTimer::TimerHandler(), uninit(), FxTransactionedList::UnlockFromEnum(), FxChildList::UpdateAddressDescriptionFromEntry(), FxChildList::UpdateAllAsPresent(), FxChildList::UpdateAsMissing(), FxChildList::UpdateDeviceAsMissing(), FxTagTracker::UpdateTagHistory(), VerifyRequestComplete(), VerifyWdfRequestIsCanceled(), VfEvtDeviceD0Entry(), VfEvtDeviceD0EntryPostInterruptsEnabled(), VfEvtDeviceD0Exit(), VfEvtDeviceD0ExitPreInterruptsDisabled(), VfEvtDevicePrepareHardware(), VfEvtDeviceQueryRemove(), VfEvtDeviceQueryStop(), VfEvtDeviceRelationsQuery(), VfEvtDeviceReleaseHardware(), VfEvtDeviceSelfManagedIoCleanup(), VfEvtDeviceSelfManagedIoFlush(), VfEvtDeviceSelfManagedIoInit(), VfEvtDeviceSelfManagedIoRestart(), VfEvtDeviceSelfManagedIoSuspend(), VfEvtDeviceSurpriseRemoval(), VfEvtDeviceUsageNotification(), VfEvtDeviceUsageNotificationEx(), VfEvtIoCanceledOnQueue(), VfEvtIoDefault(), VfEvtIoDeviceControl(), VfEvtIoInternalDeviceControl(), VfEvtIoRead(), VfEvtIoResume(), VfEvtIoStop(), VfEvtIoWrite(), FxDisposeList::WaitForEmpty(), FxSystemWorkItem::WorkItemHandler(), FxWorkItem::WorkItemHandler(), FxInterrupt::WorkItemHandler(), and FxTagTracker::~FxTagTracker().