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

Function RESAMPLE3

Source/HLEAudio/ABI_Resample.cpp:45–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void RESAMPLE3(AudioHLECommand command)
46{
47 #ifdef DEBUG_AUDIO
48 DBGConsole_Msg(0, "RESAMPLE3");
49 #endif
50 u8 Flags=(u8)((command.cmd1>>0x1e));
51 u32 Pitch=((command.cmd1>>0xe)&0xffff) << 1;
52 u32 addy = (command.cmd0 & 0xffffff);
53 u32 Accum;
54 s16 *dst;
55 s16 *src;
56 dst=(s16 *)(gAudioHLEState.Buffer);
57 src=(s16 *)(gAudioHLEState.Buffer);
58 u32 srcPtr=((((command.cmd1>>2)&0xfff)+0x4f0)/2);
59 u32 dstPtr;//=(gAudioHLEState.OutBuffer/2);
60
61 srcPtr -= 1;
62
63 if (command.cmd1 & 0x3) {
64 dstPtr = 0x660/2;
65 } else {
66 dstPtr = 0x4f0/2;
67 }
68
69 if ((Flags & 0x1) == 0) {
70 src[srcPtr^1] = ((u16 *)rdram)[((addy/2))^1];
71 Accum = *(u16 *)(rdram+addy+10);
72 } else {
73 src[(srcPtr)^1] = 0;
74 Accum = 0;
75 }
76
77 for(u32 i=0;i < 0x170/2;i++)
78 {
79 dst[dstPtr^1] = src[srcPtr^1] + FixedPointMul16( src[(srcPtr+1)^1] - src[srcPtr^1], Accum );
80 ++dstPtr;
81 Accum += Pitch;
82 srcPtr += (Accum>>16);
83 Accum &= 0xFFFF;
84 }
85
86 ((u16 *)rdram)[((addy/2))^1] = src[srcPtr^1];
87 *(u16 *)(rdram+addy+10) = u16( Accum );
88}

Callers

nothing calls this directly

Calls 1

FixedPointMul16Function · 0.70

Tested by

no test coverage detected