MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / Decode

Method Decode

Source/HLEAudio/ABI3mp3.cpp:583–626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581
582
583void CMP3Decode::Decode( AudioHLECommand command )
584{
585 // Initialization Code
586 u32 readPtr; // s5
587 u32 writePtr; // s6
588 //const u32 Count = 0x0480; // s4
589 u32 tmp;
590 //u32 inPtr, outPtr;
591
592 t6 = 0x08A0; // I think these are temporary storage buffers
593 t5 = 0x0AC0;
594 t4 = (command.cmd0 & 0x1E);
595
596 writePtr = command.cmd1 & 0xFFFFFF;
597 readPtr = writePtr;
598 memmove(mp3data+0xCE8, rdram+readPtr, 8); // Just do that for efficiency... may remove and use directly later anyway
599 readPtr += 8; // This must be a header byte or whatnot
600
601 for (u32 cnt = 0; cnt < 0x0480; cnt += 0x180)
602 {
603 memmove(mp3data+0xCF0, rdram+readPtr, 0x180); // DMA: 0xCF0 <- RDRAM[s5] : 0x180
604 inPtr = 0xCF0; // s7
605 outPtr = 0xE70; // s3
606
607 for (int cnt2 = 0; cnt2 < 0x180; cnt2 += 0x40)
608 {
609 t6 &= 0xFFE0;
610 t5 &= 0xFFE0;
611 t6 |= t4;
612 t5 |= t4;
613 InnerLoop();
614 t4 = (t4-2)&0x1E;
615 tmp = t6;
616 t6 = t5;
617 t5 = tmp;
618 //outPtr += 0x40;
619 inPtr += 0x40;
620 }
621
622 memmove(rdram+writePtr, mp3data+0xe70, 0x180);
623 writePtr += 0x180;
624 readPtr += 0x180;
625 }
626}
627
628
629CMP3Decode gMP3Decode;

Callers 1

MP3Function · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected