9 |
****************************************************************************/ |
****************************************************************************/ |
10 |
|
|
11 |
/* CA3dSourceHw */ |
/* CA3dSourceHw */ |
12 |
|
void Asp4A3DTopology::MakeConnections(void) { |
13 |
|
if (this_34 == 0) { |
14 |
|
/* Connect A3DOUT to MIXIN */ |
15 |
|
Asp4Topology::Route((int) 1, (uchar) this_0c->this_0c, |
16 |
|
(uchar) this_08->this_04, (uchar) this_10 + 0x50, (uchar) this_14+0x50); |
17 |
|
/* Connect MIXIN's this_10 and this_14 to MIXOUT this_18 */ |
18 |
|
(CAsp4Mix)this_18::EnableInput(int this_10); |
19 |
|
(CAsp4Mix)this_18::EnableInput(int this_14); |
20 |
|
/* Connect MIXOUT this_18 to SRCIN this_0c */ |
21 |
|
Asp4Topology::Route((int) 1, (uchar) this_0c, |
22 |
|
(uchar) this_18->this_08 + 0x30, (uchar) this_0c + 0x40); |
23 |
|
/* Connect SRCOUT this_0c to A3DIN this_20 */ |
24 |
|
Asp4Topology::Route((int) 1, (uchar) 0x11, |
25 |
|
(uchar) this_0c->this0c + 0x20, (uchar) this_20 + 0x70); |
26 |
|
} else { |
27 |
|
if (this_08) { |
28 |
|
/* Connect this_08 to SRCIN this_0c */ |
29 |
|
Asp4Topology::Route((int) 1, (uchar) this_0c, |
30 |
|
(uchar) this_08->this_04, (uchar) this_0c + 0x40); |
31 |
|
/* Connect SRCOUT this_0c to A3DIN this_20 */ |
32 |
|
Asp4Topology::Route((int) 1, (uchar) 0x11, |
33 |
|
(uchar) this_0c->this0c + 0x20, (uchar) this_20 + 0x70); |
34 |
|
} else { |
35 |
|
// I'm tired. I going to sleep now . |
36 |
|
|
37 |
|
} |
38 |
|
} |
39 |
|
|
40 |
|
} |
41 |
|
|
42 |
void CA3dSourceHw::CA3dSourceHw(CAsp4HwIO *hwio, int a,int b) { |
void CA3dSourceHw::CA3dSourceHw(CAsp4HwIO *hwio, int a,int b) { |
43 |
CA3dSourceHw->this00 = hwio; |
CA3dSourceHw->this00 = hwio; |
44 |
CA3dSourceHw->this04 = a; |
CA3dSourceHw->this04 = a; |
64 |
|
|
65 |
} |
} |
66 |
|
|
67 |
|
/* Atmospheric absorbtion. */ |
68 |
void CA3dSourceHw::SetAtmosTarget(short a,short b,short c,short d,short e) { |
void CA3dSourceHw::SetAtmosTarget(short a,short b,short c,short d,short e) { |
69 |
hwwrite(vortex->mmio, addr(0x190Ec, this04, this08), (e << 0x10) | d); |
hwwrite(vortex->mmio, addr(0x190Ec, this04, this08), (e << 0x10) | d); |
70 |
hwwrite(vortex->mmio, addr(0x190F4, this04, this08), (b << 0x10) | a); |
hwwrite(vortex->mmio, addr(0x190F4, this04, this08), (b << 0x10) | a); |
142 |
b[i] = hwread(vortex->mmio, addr2(0x191e8, this04, this08, i)); |
b[i] = hwread(vortex->mmio, addr2(0x191e8, this04, this08, i)); |
143 |
} |
} |
144 |
|
|
145 |
|
void CA3dSourceHw::GetHrtfOutput(short *left,short *right) { |
146 |
|
*left = hwread(vortex->mmio, addr(0x1839C, this04, this08)); |
147 |
|
*right = hwread(vortex->mmio, addr(0x183A0, this04, this08)); |
148 |
|
} |
149 |
|
|
150 |
|
void CA3dSourceHw::SetHrtfOutput(short left,short right) { |
151 |
|
hwwrite(vortex->mmio, addr(0x1839C, this04, this08), left); |
152 |
|
hwwrite(vortex->mmio, addr(0x183a0, this04, this08), right); |
153 |
|
} |
154 |
|
|
155 |
|
/* Interaural Time Difference. |
156 |
|
* "The other main clue that humans use to locate sounds, is called |
157 |
|
* Interaural Time Difference (ITD). The differences in distance from |
158 |
|
* the sound source to a listeners ears means that the sound will |
159 |
|
* reach one ear slightly before the other...." */ |
160 |
void CA3dSourceHw::SetItdTarget(short litd,short ritd) { |
void CA3dSourceHw::SetItdTarget(short litd,short ritd) { |
161 |
if (litd < 0) |
if (litd < 0) |
162 |
litd = 0; |
litd = 0; |
204 |
dline[i] = hwwrite(vortex->mmio, addr2(0x182C8, this04, this08, i)); |
dline[i] = hwwrite(vortex->mmio, addr2(0x182C8, this04, this08, i)); |
205 |
} |
} |
206 |
|
|
207 |
|
/* This is maybe used for IID Interaural Intensity Difference. */ |
208 |
void CA3dSourceHw::SetGainTarget(short a,short b) { |
void CA3dSourceHw::SetGainTarget(short a,short b) { |
209 |
hwwrite(vortex->mmio, addr(0x190E4, this04, this08), (b<<0x10)|a); |
hwwrite(vortex->mmio, addr(0x190E4, this04, this08), (b<<0x10)|a); |
210 |
} |
} |
223 |
*a = hwread(vortex->mmio, addr(0x190e0, this04, this08)); |
*a = hwread(vortex->mmio, addr(0x190e0, this04, this08)); |
224 |
} |
} |
225 |
|
|
226 |
void CA3dSourceHw::GetHrtfOutput(short *left,short *right) { |
/* Generic A3D stuff */ |
|
*left = hwread(vortex->mmio, addr(0x1839C, this04, this08)); |
|
|
*right = hwread(vortex->mmio, addr(0x183A0, this04, this08)); |
|
|
} |
|
|
|
|
|
void CA3dSourceHw::SetHrtfOutput(short left,short right) { |
|
|
hwwrite(vortex->mmio, addr(0x1839C, this04, this08), left); |
|
|
hwwrite(vortex->mmio, addr(0x183a0, this04, this08), right); |
|
|
} |
|
|
|
|
227 |
void CA3dSourceHw::SetA3DSampleRate(int sr) { |
void CA3dSourceHw::SetA3DSampleRate(int sr) { |
228 |
int esp0 = 0; |
int esp0 = 0; |
229 |
esp0 = (((esp0 & 0x7fffffff)|0xB8000000)&0x7) | ((sr&0x1f)<<3); |
esp0 = (((esp0 & 0x7fffffff)|0xB8000000)&0x7) | ((sr&0x1f)<<3); |
281 |
CA3dSourceHw::SetItdCurrent(0,0); |
CA3dSourceHw::SetItdCurrent(0,0); |
282 |
CA3dSourceHw::SetItdTarget(0,0); |
CA3dSourceHw::SetItdTarget(0,0); |
283 |
CA3dSourceHw::SetGainCurrent(0,0); |
CA3dSourceHw::SetGainCurrent(0,0); |
284 |
// The guy who originally wrote this surely was smoking crack... |
/* The person who originally wrote this surely was smoking crack ... |
285 |
|
/* (or his/her compiler) */ |
286 |
CA3dIO::WriteReg(190E4 + (this08<<0xd) + (this04*5*9*2 - this04)*8,0,0); |
CA3dIO::WriteReg(190E4 + (this08<<0xd) + (this04*5*9*2 - this04)*8,0,0); |
287 |
|
|
288 |
CA3dSourceHw::SetHrtfCurrent(A3dHrirZeros, A3dHrirZeros); |
CA3dSourceHw::SetHrtfCurrent(A3dHrirZeros, A3dHrirZeros); |
306 |
this08 = var; |
this08 = var; |
307 |
} |
} |
308 |
|
|
309 |
|
/* Program A3D block as pass through */ |
310 |
void CA3dSourceHw::ProgramPipe(void) { |
void CA3dSourceHw::ProgramPipe(void) { |
311 |
CA3dSourceHw::SetTimeConsts(0,0,0,0); |
CA3dSourceHw::SetTimeConsts(0,0,0,0); |
312 |
CA3dSourceHw::SetAtmosCurrent(0, 0x4000, 0,0,0); |
CA3dSourceHw::SetAtmosCurrent(0, 0x4000, 0,0,0); |
318 |
CA3dSourceHw::SetHrtfCurrent(A3dHrirImpulse, A3dHrirImpulse); |
CA3dSourceHw::SetHrtfCurrent(A3dHrirImpulse, A3dHrirImpulse); |
319 |
CA3dSourceHw::SetHrtfTarget(A3dHrirImpulse, A3dHrirImpulse); |
CA3dSourceHw::SetHrtfTarget(A3dHrirImpulse, A3dHrirImpulse); |
320 |
} |
} |
321 |
|
/* VDB = Vortex audio Dataflow Bus */ |
322 |
void CA3dSourceHw::ClearVDBData(unsigned long a) { |
void CA3dSourceHw::ClearVDBData(unsigned long a) { |
323 |
hwwrite(vortex->mmio, 0x19c00 + (((a>>2)*255*4)+a)*8, 0); |
hwwrite(vortex->mmio, 0x19c00 + (((a>>2)*255*4)+a)*8, 0); |
324 |
hwwrite(vortex->mmio, 0x19c04 + (((a>>2)*255*4)+a)*8, 0); |
hwwrite(vortex->mmio, 0x19c04 + (((a>>2)*255*4)+a)*8, 0); |
329 |
hwwrite(vortex->mmio, addr, (a<<0x10)|b); |
hwwrite(vortex->mmio, addr, (a<<0x10)|b); |
330 |
} |
} |
331 |
|
|
332 |
|
/* CHrtf */ |
333 |
|
void CHrtf::CHrtf(void) { |
334 |
|
this_00 = 0; |
335 |
|
this_04 = 0; |
336 |
|
this_08 = 0; |
337 |
|
} |
338 |
|
void CHrtf::Initialize(int arg_0 ,int arg_4 ,short *arg_8) { |
339 |
|
this_04 = arg_0; |
340 |
|
this_00 = arg_4; |
341 |
|
this_08 = *arg_8; |
342 |
|
} |
343 |
|
void CHrtf::InterpolateHrtf(short *arg_0, short *arg_4, short *arg_8) { |
344 |
|
|
345 |
|
|
346 |
|
} |
347 |
/* CVort3dRend */ |
/* CVort3dRend */ |
348 |
|
|
349 |
void CVort3DRend::CVort3DRend(class CAsp4Core *core,class CAsp4HwIO *hwio) { |
void CVort3DRend::CVort3DRend(class CAsp4Core *core, class CAsp4HwIO *hwio) { |
350 |
this00 = core; |
this00 = core; |
351 |
this04 = hwio; |
this04 = hwio; |
352 |
this08 = 0; |
this08 = 0; |
366 |
|
|
367 |
CXtalkHw::SetGains(XtalkGainsAllChan); |
CXtalkHw::SetGains(XtalkGainsAllChan); |
368 |
if (this14) { |
if (this14) { |
369 |
if (this08==0xffff) |
if (this08==0xffff) { |
370 |
|
/* Speaker type 1 ? */ |
371 |
CXtalkHw::ProgramXtalkNarrow(void); |
CXtalkHw::ProgramXtalkNarrow(void); |
372 |
else |
} else{ |
373 |
|
/* Speaker type 2 ? */ |
374 |
CXtalkHw::ProgramXtalkWide(void) |
CXtalkHw::ProgramXtalkWide(void) |
375 |
|
} |
376 |
} else { |
} else { |
377 |
|
/* Headphones ? */ |
378 |
CXtalkHw::ProgramPipe(void); |
CXtalkHw::ProgramPipe(void); |
379 |
} |
} |
380 |
CXtalkHw::SetSampleRate(0x11); |
CXtalkHw::SetSampleRate(0x11); |
414 |
|
|
415 |
} |
} |
416 |
//174743 |
//174743 |
417 |
|
void CVort3dWave::Initialize(struct _ASPWAVEFORMAT * arg_0, void (__stdcall *)(class CAuWave *,char *,unsigned long,int,unsigned long,unsigned long),unsigned long arg_4 ,void *arg_c) { |
418 |
|
a3dsource_t a3d; |
419 |
|
CWave::Initialize(_ASPWAVEFORMAT *arg_0 ,ASPDIRECTION 0,void (*)(CAuWave *,char *,ulong ,int,ulong,ulong) arg_4,void *arg_c, ulong 1); |
420 |
|
|
421 |
|
this_320 = 0; |
422 |
|
this_324 = 0; |
423 |
|
this_334 = (short)0xffff; |
424 |
|
this_338 = (short)0x8000; |
425 |
|
this_328 = 0; |
426 |
|
this_77c = 0; |
427 |
|
this_790 = 0; |
428 |
|
this_794 = 0; |
429 |
|
this_7a4 = 0; |
430 |
|
this_7c8 = 0; /* struct ? */ |
431 |
|
this_79c = 0; |
432 |
|
this_7a0 = 0; |
433 |
|
this_7b4 = 0; |
434 |
|
this_7c0 = 0; |
435 |
|
this_7b0 = 0; |
436 |
|
this_7bc = 0; |
437 |
|
this_788 = 0; |
438 |
|
this_7cc = 0; |
439 |
|
|
440 |
|
if ((a3d = CAdbTopology::GetA3DSource(void)) < 0) { |
441 |
|
(CAsp4Core)this_318::GetProperty((COREPROPERTY) 4, void *arg_c, (ulong) 4); |
442 |
|
if (arg_c == 1) |
443 |
|
return 8007000E; |
444 |
|
} else { |
445 |
|
if (this_340 == 0) { |
446 |
|
operator new((uint) 0xc, (_POOL_TYPE) 0, (ulong) 44334143); |
447 |
|
|
448 |
|
} |
449 |
|
} |
450 |
|
} |
451 |
|
|
452 |
void CVort3DWave::SetLRGains(void) { |
void CVort3DWave::SetLRGains(void) { |
453 |
|
|
454 |
|
|
485 |
CHrtfMgr = this_344; |
CHrtfMgr = this_344; |
486 |
if (var14 == 1) { |
if (var14 == 1) { |
487 |
if (var0.b) |
if (var0.b) |
488 |
CHrtfMgr::Initialize((ulong) 0BB80, (ulong) 0x3a, (ulong) 0x102) |
CHrtfMgr::Initialize((ulong) 0xBB80, (ulong) 0x3a, (ulong) 0x102) |
489 |
else |
else |
490 |
CHrtfMgr::Initialize((ulong) 0BB80, (ulong) 2, (ulong) 0x101); |
CHrtfMgr::Initialize((ulong) 0xBB80, (ulong) 2, (ulong) 0x101); |
491 |
} else |
} else |
492 |
CHrtfMgr::Initialize((ulong) 0BB80, (ulong) 0x38, (ulong) 0); |
CHrtfMgr::Initialize((ulong) 0xBB80, (ulong) 0x38, (ulong) 0); |
493 |
} |
} |
494 |
if (var14 == 1) { |
if (var14 == 1) { |
495 |
if (var0.b == 0) |
if (var0.b == 0) |
519 |
CA3dSourceHw::SetAtmosTarget(short,short,short,short,short); |
CA3dSourceHw::SetAtmosTarget(short,short,short,short,short); |
520 |
CA3dSourceHw::SetAtmosCurrent(short,short,short,short,short); |
CA3dSourceHw::SetAtmosCurrent(short,short,short,short,short); |
521 |
CVort3dWave::SetLRGains(void); |
CVort3dWave::SetLRGains(void); |
522 |
CA3dSourceHw::SetHrtfTarget(short const *,short const *); |
CA3dSourceHw::SetHrtfTarget(short const *,short const *); |
523 |
CA3dSourceHw::SetHrtfCurrent(short const *,short const *) |
CA3dSourceHw::SetHrtfCurrent(short const *,short const *) |
524 |
CA3dSourceHw::SetItdTarget(short,short); |
CA3dSourceHw::SetItdTarget(short,short); |
525 |
|
|
531 |
|
|
532 |
} |
} |
533 |
|
|
534 |
void CAdbTopology::SetFilter(unsigned long) { |
void CAdbTopology::SetFilter(unsigned long a) { |
535 |
//line 101587 |
int eax; |
536 |
|
|
537 |
|
if (this_1E0 == 0) |
538 |
|
return; // "CAdbTopology::SetFilter - m_pWtDma not available\n" |
539 |
|
if (a) { |
540 |
|
if (a & 0xFFFF0000) |
541 |
|
eax = 0xcf; |
542 |
|
else { |
543 |
|
a <<= 0x10; |
544 |
|
eax = 0xc; |
545 |
|
while (((a & 0x80000000) == 0)&&(eax > 0)) { |
546 |
|
a <<= 1; |
547 |
|
eax--; |
548 |
|
} |
549 |
|
if (eax) |
550 |
|
a << 1; |
551 |
|
eax <<= 4; |
552 |
|
a >>= 0x1c; |
553 |
|
eax |= a; |
554 |
|
} |
555 |
|
} else |
556 |
|
eax = 0; |
557 |
|
this_1E4 = (this_1E4 & 0xFFFFFF) | (eax << 0x18); |
558 |
|
this_1E8 = this_1E4 | 1; |
559 |
|
AuWt::WriteReg(0x204 + (this_1DC << 4), this_1E8); |
560 |
|
AuWt::WriteReg(0x200 + (this_1DC << 4), this_1E4); |
561 |
|
} |
562 |
|
|
563 |
|
void AuWt::WriteReg(unsigned long addr, unsigned long data) { |
564 |
|
hwwrite(vortex->mmio, (this_04 << 0xf) + addr, data); |
565 |
|
} |
566 |
|
|
567 |
|
int AuWt::ReadReg(unsigned long addr) { |
568 |
|
return hwread(vortex->mmio, (this_04 << 0xf) + addr); |
569 |
} |
} |