From 66fa0b626a6bf8093c17bd2c89920d173561a123 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sun, 30 Mar 2014 12:51:21 +0200 Subject: [PATCH] DSPHLE: Remove 'ZeldaObsolete.txt' --- .../Core/HW/DSPHLE/UCodes/ZeldaObsolete.txt | 180 ------------------ 1 file changed, 180 deletions(-) delete mode 100644 Source/Core/Core/HW/DSPHLE/UCodes/ZeldaObsolete.txt diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/ZeldaObsolete.txt b/Source/Core/Core/HW/DSPHLE/UCodes/ZeldaObsolete.txt deleted file mode 100644 index 08231de61a..0000000000 --- a/Source/Core/Core/HW/DSPHLE/UCodes/ZeldaObsolete.txt +++ /dev/null @@ -1,180 +0,0 @@ - -#if 0 -void ZeldaUCode::UpdatePB(ZPB& _rPB, int *templbuffer, int *temprbuffer, u32 _Size) -{ - u16* pTest = (u16*)&_rPB; - - // Checks at 0293 - if (pTest[0x00] == 0) - return; - - if (pTest[0x01] != 0) - return; - - - if (pTest[0x06] != 0x00) - { - // probably pTest[0x06] == 0 -> AFC (and variants) - // See 02a4 - } - else - { - switch (_rPB.type) // or Bytes per Sample - { - case 0x05: - case 0x09: - { - // initialize "decoder" if the sample is played the first time - if (pTest[0x04] != 0) - { - // This is 0717_ReadOutPBStuff - - // increment 4fb - - // zelda: - // perhaps init or "has played before" - pTest[0x32] = 0x00; - pTest[0x66] = 0x00; // history1 - pTest[0x67] = 0x00; // history2 - - // samplerate? length? num of samples? i dunno... - // Likely length... - pTest[0x3a] = pTest[0x8a]; - pTest[0x3b] = pTest[0x8b]; - - // Copy ARAM addr from r to rw area. - pTest[0x38] = pTest[0x8c]; - pTest[0x39] = pTest[0x8d]; - } - - if (pTest[0x01] != 0) // 0747 early out... i dunno if this can happen because we filter it above - return; - - u32 ARAMAddr = (pTest[0x38] << 16) | pTest[0x39]; - u32 NumberOfSamples = (pTest[0x3a] << 16) | pTest[0x3b]; - - // round upwards how many samples we need to copy, 0759 - NumberOfSamples = (NumberOfSamples + 0xf) >> 4; // i think the lower 4 are the fraction - u32 frac = NumberOfSamples & 0xF; - - u8 inBuffer[9]; - short outbuf[16]; - u32 sampleCount = 0; - - // It must be something like this: - - // The PB contains a small sample buffer of 0x4D decoded samples. - // If it's empty or "used", decode to it. - // Then, resample from this buffer to the output as you go. When it needs - // wrapping, decode more. - -#define USE_RESAMPLE -#if !defined(USE_RESAMPLE) - for (int s = 0; s < _Size/16; s++) - { - for (int i = 0; i < 9; i++) - { - inBuffer[i] = DSP::ReadARAM(ARAMAddr); - ARAMAddr++; - } - - AFCdecodebuffer((char*)inBuffer, outbuf, (short*)&pTest[0x66], (short*)&pTest[0x67]); - - for (int i = 0; i < 16; i++) - { - templbuffer[sampleCount] += outbuf[i]; - temprbuffer[sampleCount] += outbuf[i]; - sampleCount++; - } - - NumberOfSamples--; - - if (NumberOfSamples<=0) - break; - } -#else - while (NumberOfSamples > 0) - { - for (int i = 0; i < 9; i++) - { - inBuffer[i] = DSP::ReadARAM(ARAMAddr); - ARAMAddr++; - } - - AFCdecodebuffer(m_AFCCoefTable, (char*)inBuffer, outbuf, (short*)&pTest[0x66], (short*)&pTest[0x67], 9); - CResampler Sampler(outbuf, 16, 48000); - - while (Sampler.m_queueSize > 0) - { - int sample = Sampler.sample_queue.front(); - Sampler.sample_queue.pop(); - Sampler.m_queueSize -= 1; - - templbuffer[sampleCount] += sample; - temprbuffer[sampleCount] += sample; - sampleCount++; - - if (sampleCount > _Size) - break; - } - - if (sampleCount > _Size) - break; - - NumberOfSamples--; - } -#endif - if (NumberOfSamples == 0) - { - pTest[0x01] = 1; // we are done ?? - } - - // write back - NumberOfSamples = (NumberOfSamples << 4); // missing fraction - - pTest[0x38] = ARAMAddr >> 16; - pTest[0x39] = ARAMAddr & 0xFFFF; - pTest[0x3a] = NumberOfSamples >> 16; - pTest[0x3b] = NumberOfSamples & 0xFFFF; - - -#if 0 - NumberOfSamples = (NumberOfSamples + 0xf) >> 4; - - static u8 Buffer[500000]; - for (int i =0; i