Skip to content

Commit ad0e908

Browse files
authored
Merge pull request #132 from RevoSucks/naudio
n_mainbus
2 parents cca64d8 + 4fa25ce commit ad0e908

File tree

3 files changed

+77
-4
lines changed

3 files changed

+77
-4
lines changed

src/518A0.c

-3
This file was deleted.

src/libnaudio/n_mainbus.c

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*====================================================================
2+
*
3+
* Copyright 1993, Silicon Graphics, Inc.
4+
* All Rights Reserved.
5+
*
6+
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
7+
* Inc.; the contents of this file may not be disclosed to third
8+
* parties, copied or duplicated in any form, in whole or in part,
9+
* without the prior written permission of Silicon Graphics, Inc.
10+
*
11+
* RESTRICTED RIGHTS LEGEND:
12+
* Use, duplication or disclosure by the Government is subject to
13+
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
14+
* in Technical Data and Computer Software clause at DFARS
15+
* 252.227-7013, and/or in similar or successor clauses in the FAR,
16+
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
17+
* Copyright Laws of the United States.
18+
*====================================================================*/
19+
20+
#include "n_synthInternals.h"
21+
22+
// This function appears to be different than the stock n_alMainBusPull.
23+
24+
extern u8 D_800FC824;
25+
extern u8 D_80077D98;
26+
extern u8* D_800FC6D8;
27+
extern u32 D_800FD6F0;
28+
extern u8* D_800FCF28[];
29+
extern u32 D_800FCF30[];
30+
31+
Acmd *n_alMainBusPull(s32 sampleOffset, Acmd *p)
32+
{
33+
Acmd *ptr = p;
34+
s32 i;
35+
36+
aClearBuffer(ptr++, N_AL_MAIN_L_OUT, N_AL_DIVIDED<<1);
37+
38+
ptr = (n_syn->mainBus->filter.handler)(sampleOffset,ptr);
39+
40+
aMix(ptr++, 0, 0x7fff, N_AL_AUX_L_OUT, N_AL_MAIN_L_OUT);
41+
aMix(ptr++, 0, 0x7fff, N_AL_AUX_R_OUT, N_AL_MAIN_R_OUT);
42+
43+
// theres more code after?
44+
if (D_800FC824 != 0) {
45+
aClearBuffer(ptr++, 0x7C0, 0x2E0);
46+
n_aLoadBuffer(ptr++, 0x170, 0x7C0, osVirtualToPhysical(&D_800FC6D8[D_800FD6F0 * 2]));
47+
n_aLoadBuffer(ptr++, 0x170, 0x930, osVirtualToPhysical(&D_800FC6D8[D_800FD6F0 * 2]));
48+
49+
D_800FD6F0 += 0xB8;
50+
if (D_800FD6F0 >= 0xB80) {
51+
D_800FD6F0 = 0;
52+
}
53+
aMix(ptr++, 0, 0x7fff, N_AL_AUX_L_OUT, N_AL_MAIN_L_OUT);
54+
aMix(ptr++, 0, 0x7fff, N_AL_AUX_R_OUT, N_AL_MAIN_R_OUT);
55+
aClearBuffer(ptr++, 0x7C0, 0x2E0);
56+
}
57+
58+
if (D_80077D98 != 0) {
59+
for (i = 0; i < 2; i++) {
60+
aClearBuffer(ptr++, 0x7C0, 0x2E0);
61+
n_aLoadBuffer(ptr++, 0x170, 0x7C0, osVirtualToPhysical(&D_800FCF28[i][D_800FCF30[i] * 2]));
62+
n_aLoadBuffer(ptr++, 0x170, 0x930, osVirtualToPhysical(&D_800FCF28[i][D_800FCF30[i] * 2]));
63+
64+
D_800FCF30[i] += 0xB8;
65+
if (D_800FCF30[i] >= 0x8A0) {
66+
D_800FCF30[i] = 0;
67+
}
68+
69+
aMix(ptr++, 0, 0x7fff, N_AL_AUX_L_OUT, N_AL_MAIN_L_OUT);
70+
aMix(ptr++, 0, 0x7fff, N_AL_AUX_R_OUT, N_AL_MAIN_R_OUT);
71+
}
72+
}
73+
74+
return ptr;
75+
}
76+

yamls/us/rom.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
- [0x51740, c]
124124
- [0x517A0, c] # yay0 audio decoder
125125
- [0x51850, c, libnaudio/n_save]
126-
- [0x518A0, c] # this is n_alMainBusPull but the function appears to have changed.
126+
- [0x518A0, c, libnaudio/n_mainbus]
127127
- [0x51B20, c, libnaudio/n_synsetvol]
128128

129129
# libleo

0 commit comments

Comments
 (0)