From 94eb2184a2bd75cd80b6b1d96f8e0a4a22f471d0 Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Tue, 9 Jun 2020 04:20:49 +0200 Subject: [PATCH] audio: Rename nextDescriptorMod31 to nextDescriptor --- lib/hal/audio.c | 20 ++++++++++---------- lib/hal/audio.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/hal/audio.c b/lib/hal/audio.c index 21d0550c3..514648d94 100644 --- a/lib/hal/audio.c +++ b/lib/hal/audio.c @@ -146,7 +146,7 @@ void XAudioInit(int sampleSizeInBits, int numChannels, XAudioCallback callback, MmLockUnlockBufferPages((PVOID)pac97device, sizeof(AC97_DEVICE), FALSE); pac97device->mmio = (unsigned int *)0xfec00000; - pac97device->nextDescriptorMod31 = 0; + pac97device->nextDescriptor = 0; pac97device->callback = callback; pac97device->callbackData = data; pac97device->sampleSizeInBits = sampleSizeInBits; @@ -248,18 +248,18 @@ void XAudioProvideSamples(unsigned char *buffer, unsigned short bufferLength, in unsigned int address = MmGetPhysicalAddress((PVOID)buffer); unsigned int wordCount = bufferLength / 2; - pac97device->pcmOutDescriptor[pac97device->nextDescriptorMod31].bufferStartAddress = address; - pac97device->pcmOutDescriptor[pac97device->nextDescriptorMod31].bufferLengthInSamples = wordCount; - pac97device->pcmOutDescriptor[pac97device->nextDescriptorMod31].bufferControl = bufferControl; - pb[0x115] = (unsigned char)pac97device->nextDescriptorMod31; // set last active descriptor + pac97device->pcmOutDescriptor[pac97device->nextDescriptor].bufferStartAddress = address; + pac97device->pcmOutDescriptor[pac97device->nextDescriptor].bufferLengthInSamples = wordCount; + pac97device->pcmOutDescriptor[pac97device->nextDescriptor].bufferControl = bufferControl; + pb[0x115] = (unsigned char)pac97device->nextDescriptor; // set last active descriptor analogBufferCount++; - pac97device->pcmSpdifDescriptor[pac97device->nextDescriptorMod31].bufferStartAddress = address; - pac97device->pcmSpdifDescriptor[pac97device->nextDescriptorMod31].bufferLengthInSamples = wordCount; - pac97device->pcmSpdifDescriptor[pac97device->nextDescriptorMod31].bufferControl = bufferControl; - pb[0x175] = (unsigned char)pac97device->nextDescriptorMod31; // set last active descriptor + pac97device->pcmSpdifDescriptor[pac97device->nextDescriptor].bufferStartAddress = address; + pac97device->pcmSpdifDescriptor[pac97device->nextDescriptor].bufferLengthInSamples = wordCount; + pac97device->pcmSpdifDescriptor[pac97device->nextDescriptor].bufferControl = bufferControl; + pb[0x175] = (unsigned char)pac97device->nextDescriptor; // set last active descriptor digitalBufferCount++; // increment to the next buffer descriptor (rolling around to 0 once you get to 31) - pac97device->nextDescriptorMod31 = (pac97device->nextDescriptorMod31 +1 ) & 0x1f; + pac97device->nextDescriptor = (pac97device->nextDescriptor + 1) % 32; } diff --git a/lib/hal/audio.h b/lib/hal/audio.h index 2a68ef83c..375c6c1de 100644 --- a/lib/hal/audio.h +++ b/lib/hal/audio.h @@ -24,7 +24,7 @@ typedef struct AC97_DESCRIPTOR pcmSpdifDescriptor[32]; AC97_DESCRIPTOR pcmOutDescriptor[32]; volatile unsigned int *mmio; - volatile unsigned int nextDescriptorMod31; + volatile unsigned int nextDescriptor; XAudioCallback callback; void *callbackData; int sampleSizeInBits;