Compare commits

...

12 Commits

Author SHA1 Message Date
coah
dd2993f12d Match RVL SDK FAFinfo wrapper 2026-09-23 02:26:52 +00:00
coah
4b71db7dfd Match FAInitDiskManager data (#207) 2026-09-22 21:23:18 -05:00
coah
e052c9ae0c Match RVL SDK ferror wrapper (#206) 2026-09-22 21:22:57 -05:00
coah
a843f0770f Match RVL SDK flock wrapper (#204) 2026-09-22 03:49:37 -05:00
coah
c356c90f22 Match RVL SDK ferror wrapper (#203) 2026-09-22 03:49:32 -05:00
coah
6af767089f Match RVL SDK FAFclose wrapper (#201) 2026-09-22 03:40:42 -05:00
coah
bee0a51dbf Match MSL wctype tables (#200) 2026-09-22 03:40:29 -05:00
coah
d9e7306a99 Match RVL SDK errnum wrapper (#198) 2026-09-22 03:37:57 -05:00
coah
f214b726b5 Match RVL SDK closedir wrapper (#190) 2026-09-22 03:35:37 -05:00
coah
cbe489cd37 Match AXFX HiExp reverb unit (#195) 2026-09-22 03:33:39 -05:00
coah
d78ab4cfd1 Link matching www browser unit (#193) 2026-09-22 03:32:00 -05:00
coah
311b437e5f Match RVL SDK feof wrapper (#192) 2026-09-22 03:31:56 -05:00
12 changed files with 633 additions and 12 deletions

View File

@@ -692,7 +692,7 @@ config.libs = [
]
),
IPLSection("iplwww", [
Object(Equivalent, "iplwww/www_browser.cpp"),
Object(Matching, "iplwww/www_browser.cpp"),
Object(Matching, "iplwww/www_message.cpp"),
Object(Matching, "iplwww/www_surface.cpp"),
Object(Matching, "iplwww/www_thread.cpp"),
@@ -1446,7 +1446,7 @@ config.libs = [
RVLSDKLib("axfx", [
Object(Matching, "axfx/AXFXReverbHi.c"),
Object(Matching, "axfx/AXFXReverbHiDpl2.c"),
Object(NonMatching, "axfx/AXFXReverbHiExp.c"),
Object(Matching, "axfx/AXFXReverbHiExp.c"),
Object(NonMatching, "axfx/AXFXReverbHiExpDpl2.c"),
Object(Matching, "axfx/AXFXDelay.c"),
Object(Matching, "axfx/AXFXReverbStd.c"),
@@ -1714,7 +1714,7 @@ config.libs = [
Object(NonMatching, "fa/pf_chdmod.c"),
Object(NonMatching, "fa/pf_chmod.c"),
Object(NonMatching, "fa/pf_cinsert.c"),
Object(NonMatching, "fa/pf_closedir.c"),
Object(Matching, "fa/pf_closedir.c"),
Object(NonMatching, "fa/pf_combine.c"),
Object(NonMatching, "fa/pf_create.c"),
Object(NonMatching, "fa/pf_createdir.c"),
@@ -1722,16 +1722,16 @@ config.libs = [
Object(NonMatching, "fa/pf_derrnum.c"),
Object(NonMatching, "fa/pf_detach.c"),
Object(NonMatching, "fa/pf_divide.c"),
Object(NonMatching, "fa/pf_errnum.c"),
Object(Matching, "fa/pf_errnum.c"),
Object(NonMatching, "fa/pf_fadjust.c"),
Object(NonMatching, "fa/pf_fappend.c"),
Object(NonMatching, "fa/pf_fchdir.c"),
Object(Matching, "fa/pf_fclose.c"),
Object(NonMatching, "fa/pf_fconcat.c"),
Object(NonMatching, "fa/pf_feof.c"),
Object(NonMatching, "fa/pf_ferror.c"),
Object(Matching, "fa/pf_feof.c"),
Object(Matching, "fa/pf_ferror.c"),
Object(NonMatching, "fa/pf_finfo.c"),
Object(NonMatching, "fa/pf_flock.c"),
Object(Matching, "fa/pf_flock.c"),
Object(NonMatching, "fa/pf_fopen.c"),
Object(NonMatching, "fa/pf_format.c"),
Object(Matching, "fa/pf_fread.c"),
@@ -1831,8 +1831,8 @@ config.libs = [
Object(NonMatching, "fa/api/FACreatedir.c"),
Object(NonMatching, "fa/api/FADetach.c"),
Object(NonMatching, "fa/api/FAErrnum.c"),
Object(NonMatching, "fa/api/FAFclose.c"),
Object(NonMatching, "fa/api/FAFinfo.c"),
Object(Matching, "fa/api/FAFclose.c"),
Object(Matching, "fa/api/FAFinfo.c"),
Object(NonMatching, "fa/api/FAFopen.c"),
Object(NonMatching, "fa/api/FAFormat.c"),
Object(Matching, "fa/api/FAFread.c"),
@@ -1843,7 +1843,7 @@ config.libs = [
Object(Matching, "fa/api/FAFwrite.c"),
Object(NonMatching, "fa/api/FAGetdev.c"),
Object(NonMatching, "fa/api/FAInit.c"),
Object(NonMatching, "fa/api/FAInitDiskManager.c"),
Object(Matching, "fa/api/FAInitDiskManager.c"),
Object(NonMatching, "fa/api/FAMount.c"),
Object(NonMatching, "fa/api/FARegistCB.c"),
Object(NonMatching, "fa/api/FARemove.c"),
@@ -1967,7 +1967,7 @@ config.libs = [
Object(NonMatching, "MSL_Common/strtold.c"),
Object(NonMatching, "MSL_Common/strtoul.c"),
Object(NonMatching, "MSL_Common/time.c"),
Object(NonMatching, "MSL_Common/wctype.c"),
Object(Matching, "MSL_Common/wctype.c"),
Object(Matching, "MSL_Common/wmem.c"),
Object(NonMatching, "MSL_Common/wprintf.c"),
Object(Matching, "MSL_Common/wstring.c"),

View File

@@ -0,0 +1,104 @@
const unsigned int __wctype_mapC[128] = {
0x00040004, 0x00040004, 0x00040004, 0x00040004,
0x00040106, 0x01040104, 0x01040104, 0x00040004,
0x00040004, 0x00040004, 0x00040004, 0x00040004,
0x00040004, 0x00040004, 0x00040004, 0x00040004,
0x014200D0, 0x00D000D0, 0x00D000D0, 0x00D000D0,
0x00D000D0, 0x00D000D0, 0x00D000D0, 0x00D000D0,
0x04580458, 0x04580458, 0x04580458, 0x04580458,
0x04580458, 0x00D000D0, 0x00D000D0, 0x00D000D0,
0x00D00651, 0x06510651, 0x06510651, 0x06510251,
0x02510251, 0x02510251, 0x02510251, 0x02510251,
0x02510251, 0x02510251, 0x02510251, 0x02510251,
0x02510251, 0x025100D0, 0x00D000D0, 0x00D000D0,
0x00D00471, 0x04710471, 0x04710471, 0x04710071,
0x00710071, 0x00710071, 0x00710071, 0x00710071,
0x00710071, 0x00710071, 0x00710071, 0x00710071,
0x00710071, 0x007100D0, 0x00D000D0, 0x00D00004,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
};
const unsigned int __wlower_mapC[128] = {
0x00000001, 0x00020003, 0x00040005, 0x00060007,
0x00080009, 0x000A000B, 0x000C000D, 0x000E000F,
0x00100011, 0x00120013, 0x00140015, 0x00160017,
0x00180019, 0x001A001B, 0x001C001D, 0x001E001F,
0x00200021, 0x00220023, 0x00240025, 0x00260027,
0x00280029, 0x002A002B, 0x002C002D, 0x002E002F,
0x00300031, 0x00320033, 0x00340035, 0x00360037,
0x00380039, 0x003A003B, 0x003C003D, 0x003E003F,
0x00400061, 0x00620063, 0x00640065, 0x00660067,
0x00680069, 0x006A006B, 0x006C006D, 0x006E006F,
0x00700071, 0x00720073, 0x00740075, 0x00760077,
0x00780079, 0x007A005B, 0x005C005D, 0x005E005F,
0x00600061, 0x00620063, 0x00640065, 0x00660067,
0x00680069, 0x006A006B, 0x006C006D, 0x006E006F,
0x00700071, 0x00720073, 0x00740075, 0x00760077,
0x00780079, 0x007A007B, 0x007C007D, 0x007E007F,
0x00800081, 0x00820083, 0x00840085, 0x00860087,
0x00880089, 0x008A008B, 0x008C008D, 0x008E008F,
0x00900091, 0x00920093, 0x00940095, 0x00960097,
0x00980099, 0x009A009B, 0x009C009D, 0x009E009F,
0x00A000A1, 0x00A200A3, 0x00A400A5, 0x00A600A7,
0x00A800A9, 0x00AA00AB, 0x00AC00AD, 0x00AE00AF,
0x00B000B1, 0x00B200B3, 0x00B400B5, 0x00B600B7,
0x00B800B9, 0x00BA00BB, 0x00BC00BD, 0x00BE00BF,
0x00C000C1, 0x00C200C3, 0x00C400C5, 0x00C600C7,
0x00C800C9, 0x00CA00CB, 0x00CC00CD, 0x00CE00CF,
0x00D000D1, 0x00D200D3, 0x00D400D5, 0x00D600D7,
0x00D800D9, 0x00DA00DB, 0x00DC00DD, 0x00DE00DF,
0x00E000E1, 0x00E200E3, 0x00E400E5, 0x00E600E7,
0x00E800E9, 0x00EA00EB, 0x00EC00ED, 0x00EE00EF,
0x00F000F1, 0x00F200F3, 0x00F400F5, 0x00F600F7,
0x00F800F9, 0x00FA00FB, 0x00FC00FD, 0x00FE00FF,
};
const unsigned int __wupper_mapC[128] = {
0x00000001, 0x00020003, 0x00040005, 0x00060007,
0x00080009, 0x000A000B, 0x000C000D, 0x000E000F,
0x00100011, 0x00120013, 0x00140015, 0x00160017,
0x00180019, 0x001A001B, 0x001C001D, 0x001E001F,
0x00200021, 0x00220023, 0x00240025, 0x00260027,
0x00280029, 0x002A002B, 0x002C002D, 0x002E002F,
0x00300031, 0x00320033, 0x00340035, 0x00360037,
0x00380039, 0x003A003B, 0x003C003D, 0x003E003F,
0x00400041, 0x00420043, 0x00440045, 0x00460047,
0x00480049, 0x004A004B, 0x004C004D, 0x004E004F,
0x00500051, 0x00520053, 0x00540055, 0x00560057,
0x00580059, 0x005A005B, 0x005C005D, 0x005E005F,
0x00600041, 0x00420043, 0x00440045, 0x00460047,
0x00480049, 0x004A004B, 0x004C004D, 0x004E004F,
0x00500051, 0x00520053, 0x00540055, 0x00560057,
0x00580059, 0x005A007B, 0x007C007D, 0x007E007F,
0x00800081, 0x00820083, 0x00840085, 0x00860087,
0x00880089, 0x008A008B, 0x008C008D, 0x008E008F,
0x00900091, 0x00920093, 0x00940095, 0x00960097,
0x00980099, 0x009A009B, 0x009C009D, 0x009E009F,
0x00A000A1, 0x00A200A3, 0x00A400A5, 0x00A600A7,
0x00A800A9, 0x00AA00AB, 0x00AC00AD, 0x00AE00AF,
0x00B000B1, 0x00B200B3, 0x00B400B5, 0x00B600B7,
0x00B800B9, 0x00BA00BB, 0x00BC00BD, 0x00BE00BF,
0x00C000C1, 0x00C200C3, 0x00C400C5, 0x00C600C7,
0x00C800C9, 0x00CA00CB, 0x00CC00CD, 0x00CE00CF,
0x00D000D1, 0x00D200D3, 0x00D400D5, 0x00D600D7,
0x00D800D9, 0x00DA00DB, 0x00DC00DD, 0x00DE00DF,
0x00E000E1, 0x00E200E3, 0x00E400E5, 0x00E600E7,
0x00E800E9, 0x00EA00EB, 0x00EC00ED, 0x00EE00EF,
0x00F000F1, 0x00F200F3, 0x00F400F5, 0x00F600F7,
0x00F800F9, 0x00FA00FB, 0x00FC00FD, 0x00FE00FF,
};

View File

@@ -55,7 +55,7 @@ typedef struct AXFX_REVERBHI_EXP {
f32 sendGain; // 0x144
} AXFX_REVERBHI_EXP;
u32 AXFXReverbHiExpGetMemSize(const AXFX_REVERBHI_EXP* fx);
u32 AXFXReverbHiExpGetMemSize(AXFX_REVERBHI_EXP* fx);
BOOL AXFXReverbHiExpInit(AXFX_REVERBHI_EXP* fx);
void AXFXReverbHiExpShutdown(AXFX_REVERBHI_EXP* fx);
BOOL AXFXReverbHiExpSettings(AXFX_REVERBHI_EXP* fx);

View File

@@ -0,0 +1,447 @@
#include <private/axfx.h>
#include <revolution/AXFX.h>
#include <revolution/MEM.h>
#include <revolution/OS.h>
#include <math.h>
#include <string.h>
static BOOL __AllocDelayLine(AXFX_REVERBHI_EXP* fx);
static void __BzeroDelayLines(AXFX_REVERBHI_EXP* fx);
static void __FreeDelayLine(AXFX_REVERBHI_EXP* fx);
static BOOL __InitParams(AXFX_REVERBHI_EXP* fx);
static u32 __EarlySizeTable[8][3] = {{157, 479, 829}, {317, 809, 1117}, {479, 941, 1487}, {641, 1259, 1949},
{797, 1667, 2579}, {967, 1901, 2903}, {1123, 2179, 3413}, {1279, 2477, 3889}};
static f32 __EarlyCoefTable[8][3] = {{0.4f, -1.0f, 0.3f}, {0.5f, -0.95f, 0.3f}, {0.6f, -0.9f, 0.3f}, {0.75f, -0.85f, 0.3f},
{-0.9f, 0.8f, 0.3f}, {-1.0f, 0.7f, 0.3f}, {-1.0f, 0.7f, 0.3f}, {-1.0f, 0.7f, 0.3f}};
static u32 __FilterSizeTable[7][8] = {{1789, 1999, 2333, 433, 149, 47, 73, 67}, {149, 293, 449, 251, 103, 47, 73, 67},
{947, 1361, 1531, 433, 137, 47, 73, 67}, {1279, 1531, 1973, 509, 149, 47, 73, 67},
{1531, 1847, 2297, 563, 179, 47, 73, 67}, {1823, 2357, 2693, 571, 137, 47, 73, 67},
{1823, 2357, 2693, 571, 179, 47, 73, 67}};
u32 AXFXReverbHiExpGetMemSize(AXFX_REVERBHI_EXP* fx) {
u32 sum = 0;
u32 i = 0;
sum += __EarlySizeTable[7][2];
sum += (int)(fx->preDelayTimeMax * 32000);
for (i = 0; i < 5; i++) {
sum += __FilterSizeTable[6][i];
}
sum *= 3;
for (i = 5; i < 8; i++) {
sum += __FilterSizeTable[6][i];
}
sum *= 4;
return sum;
}
BOOL AXFXReverbHiExpInit(AXFX_REVERBHI_EXP* fx) {
u32 ch, i;
BOOL result = TRUE;
BOOL mask = OSDisableInterrupts();
fx->active = 1;
if (fx->preDelayTimeMax < 0.0f) {
AXFXReverbHiExpShutdown(fx);
OSRestoreInterrupts(mask);
return FALSE;
}
fx->earlyMaxLength = __EarlySizeTable[8 - 1][2];
fx->preDelayMaxLength = (u32)(fx->preDelayTimeMax * 32000);
for (i = 0; i < 3; i++) {
fx->combMaxLength[i] = __FilterSizeTable[6][i];
}
for (i = 0; i < 2; i++) {
fx->allpassMaxLength[i] = __FilterSizeTable[6][3 + i];
}
for (ch = 0; ch < 3; ch++) {
fx->lastAllpassMaxLength[ch] = __FilterSizeTable[6][5 + ch];
}
result = __AllocDelayLine(fx);
if (result == FALSE) {
AXFXReverbHiExpShutdown(fx);
OSRestoreInterrupts(mask);
return FALSE;
}
__BzeroDelayLines(fx);
result = __InitParams(fx);
if (result == FALSE) {
AXFXReverbHiExpShutdown(fx);
OSRestoreInterrupts(mask);
return FALSE;
}
fx->active &= ~1;
OSRestoreInterrupts(mask);
return TRUE;
}
BOOL AXFXReverbHiExpSettings(AXFX_REVERBHI_EXP* fx) {
BOOL mask = OSDisableInterrupts();
fx->active = fx->active | 1;
AXFXReverbHiExpShutdown(fx);
if (!AXFXReverbHiExpInit(fx)) {
AXFXReverbHiExpShutdown(fx);
OSRestoreInterrupts(mask);
return FALSE;
} else {
fx->active |= 2;
fx->active &= ~1;
OSRestoreInterrupts(mask);
return TRUE;
}
}
void AXFXReverbHiExpShutdown(AXFX_REVERBHI_EXP* fx) {
BOOL mask = OSDisableInterrupts();
fx->active |= 1;
__FreeDelayLine(fx);
OSRestoreInterrupts(mask);
}
void AXFXReverbHiExpCallback(AXFX_BUFFERUPDATE* bufferUpdate, AXFX_REVERBHI_EXP* fx) {
u32 ch, i;
u32 samp;
s32* input[3];
f32 data;
f32 output[3];
f32* earlyLine;
f32 earlyOut;
f32* preDelayLine;
f32 preDelayOut;
f32 filterOut;
f32* combLine;
f32 combOutOne;
f32* allpass;
f32 outTmp;
f32 allpassIn;
f32 allpassCoef;
f32 lpfOut;
f32 lpfCoef1;
f32 lpfCoef2;
f32 fusedOut[3];
f32 fusedGain;
f32 crosstalkGain;
f32 crosstalkL;
f32 crosstalkR;
f32 crosstalkS;
s32* inBusData[3];
s32* outBusData[3];
if (fx->active != 0) {
fx->active &= ~2;
return;
}
input[0] = bufferUpdate->left;
input[1] = bufferUpdate->right;
input[2] = bufferUpdate->surround;
if (fx->busIn != NULL) {
inBusData[0] = fx->busIn->left;
inBusData[1] = fx->busIn->right;
inBusData[2] = fx->busIn->surround;
}
if (fx->busOut != NULL) {
outBusData[0] = fx->busOut->left;
outBusData[1] = fx->busOut->right;
outBusData[2] = fx->busOut->surround;
}
lpfCoef1 = 1.0f - fx->lpfCoef;
lpfCoef2 = fx->lpfCoef;
allpassCoef = fx->allpassCoef;
fusedGain = fx->fusedGain * 0.6f;
crosstalkGain = fx->crosstalk * 0.5f;
for (samp = 0; samp < 96; samp++) {
for (ch = 0; ch < 3; ch++) {
if (fx->busIn != NULL) {
data = (f32)(*(input[ch]) + *(inBusData[ch]++));
} else {
data = (f32)(*input[ch]);
}
earlyLine = fx->earlyLine[ch];
earlyOut = earlyLine[fx->earlyPos[0]] * fx->earlyCoef[0] + earlyLine[fx->earlyPos[1]] * fx->earlyCoef[1] +
earlyLine[fx->earlyPos[2]] * fx->earlyCoef[2];
earlyLine[fx->earlyPos[2]] = data;
if (fx->preDelayLength != 0) {
preDelayLine = fx->preDelayLine[ch];
preDelayOut = preDelayLine[fx->preDelayPos];
preDelayLine[fx->preDelayPos] = data;
} else {
preDelayOut = data;
}
filterOut = 0.0f;
for (i = 0; i < 3; i++) {
combLine = fx->combLine[ch][i];
combOutOne = combLine[fx->combPos[i]];
combLine[fx->combPos[i]] = preDelayOut + (combOutOne * fx->combCoef[i]);
filterOut += combOutOne;
}
for (i = 0; i < 2; i++) {
allpass = fx->allpassLine[ch][i];
outTmp = allpass[fx->allpassPos[i]];
allpassIn = filterOut + outTmp * allpassCoef;
allpass[fx->allpassPos[i]] = allpassIn;
filterOut = outTmp - allpassIn * allpassCoef;
}
lpfOut = lpfCoef1 * filterOut + lpfCoef2 * fx->lastLpfOut[ch];
fx->lastLpfOut[ch] = lpfOut;
allpass = fx->lastAllpassLine[ch];
outTmp = allpass[fx->lastAllpassPos[ch]];
allpassIn = lpfOut + outTmp * allpassCoef;
allpass[fx->lastAllpassPos[ch]] = allpassIn;
fusedOut[ch] = outTmp - allpassIn * allpassCoef;
if (++fx->lastAllpassPos[ch] >= fx->lastAllpassLength[ch]) {
fx->lastAllpassPos[ch] = 0;
}
fusedOut[ch] *= fusedGain;
fusedOut[ch] += earlyOut;
}
crosstalkL = fusedOut[1] + fusedOut[2];
crosstalkR = fusedOut[0] + fusedOut[2];
crosstalkS = fusedOut[0] + fusedOut[1];
output[0] = fusedOut[0] + crosstalkL * crosstalkGain;
output[1] = fusedOut[1] + crosstalkR * crosstalkGain;
output[2] = fusedOut[2] + crosstalkS * crosstalkGain;
*(input[0]++) = (s32)(output[0] * fx->outGain);
*(input[1]++) = (s32)(output[1] * fx->outGain);
*(input[2]++) = (s32)(output[2] * fx->outGain);
if (fx->busOut != NULL) {
*(outBusData[0]++) = (s32)(output[0] * fx->sendGain);
*(outBusData[1]++) = (s32)(output[1] * fx->sendGain);
*(outBusData[2]++) = (s32)(output[2] * fx->sendGain);
}
for (i = 0; i < 3; i++) {
if (++fx->earlyPos[i] >= fx->earlyLength) {
fx->earlyPos[i] = 0;
}
}
if (fx->preDelayLength != 0) {
if (++fx->preDelayPos >= fx->preDelayLength) {
fx->preDelayPos = 0;
}
}
for (i = 0; i < 3; i++) {
if (++fx->combPos[i] >= fx->combLength[i]) {
fx->combPos[i] = 0;
}
}
for (i = 0; i < 2; i++) {
if (++fx->allpassPos[i] >= fx->allpassLength[i]) {
fx->allpassPos[i] = 0;
}
}
}
}
static BOOL __AllocDelayLine(AXFX_REVERBHI_EXP* fx) {
u32 ch, i;
for (ch = 0; ch < 3; ch++) {
fx->earlyLine[ch] = (f32*)__AXFXAlloc(sizeof(f32) * fx->earlyMaxLength);
if (fx->earlyLine[ch] == NULL)
return FALSE;
if (fx->preDelayMaxLength != 0) {
fx->preDelayLine[ch] = (f32*)__AXFXAlloc(sizeof(f32) * fx->preDelayMaxLength);
if (fx->preDelayLine[ch] == NULL)
return FALSE;
} else {
fx->preDelayLine[ch] = NULL;
}
for (i = 0; i < 3; i++) {
fx->combLine[ch][i] = (f32*)__AXFXAlloc(sizeof(f32) * fx->combMaxLength[i]);
if (fx->combLine[ch][i] == NULL)
return FALSE;
}
for (i = 0; i < 2; i++) {
fx->allpassLine[ch][i] = (f32*)__AXFXAlloc(sizeof(f32) * fx->allpassMaxLength[i]);
if (fx->allpassLine[ch][i] == NULL)
return FALSE;
}
fx->lastAllpassLine[ch] = (f32*)__AXFXAlloc(sizeof(f32) * fx->lastAllpassMaxLength[ch]);
if (fx->lastAllpassLine[ch] == NULL)
return FALSE;
}
return TRUE;
}
static void __BzeroDelayLines(AXFX_REVERBHI_EXP* fx) {
u32 ch, i;
for (ch = 0; ch < 3; ch++) {
if (fx->earlyLine[ch] != NULL) {
memset(fx->earlyLine[ch], 0, sizeof(f32) * fx->earlyMaxLength);
}
if (fx->preDelayLine[ch] != NULL) {
memset(fx->preDelayLine[ch], 0, sizeof(f32) * fx->preDelayMaxLength);
}
for (i = 0; i < 3; i++) {
if (fx->combLine[ch][i] != NULL) {
memset(fx->combLine[ch][i], 0, sizeof(f32) * fx->combMaxLength[i]);
}
}
for (i = 0; i < 2; i++) {
if (fx->allpassLine[ch][i] != NULL) {
memset(fx->allpassLine[ch][i], 0, sizeof(f32) * fx->allpassMaxLength[i]);
}
}
if (fx->lastAllpassLine[ch] != NULL) {
memset(fx->lastAllpassLine[ch], 0, sizeof(f32) * fx->lastAllpassMaxLength[ch]);
}
}
}
static void __FreeDelayLine(AXFX_REVERBHI_EXP* fx) {
u32 ch, i;
for (ch = 0; ch < 3; ch++) {
if (fx->earlyLine[ch] != NULL) {
__AXFXFree(fx->earlyLine[ch]);
fx->earlyLine[ch] = NULL;
}
if (fx->preDelayLine[ch] != NULL) {
__AXFXFree(fx->preDelayLine[ch]);
fx->preDelayLine[ch] = NULL;
}
for (i = 0; i < 3; i++) {
if (fx->combLine[ch][i] != NULL) {
__AXFXFree(fx->combLine[ch][i]);
fx->combLine[ch][i] = NULL;
}
}
for (i = 0; i < 2; i++) {
if (fx->allpassLine[ch][i] != NULL) {
__AXFXFree(fx->allpassLine[ch][i]);
fx->allpassLine[ch][i] = NULL;
}
}
if (fx->lastAllpassLine[ch] != NULL) {
__AXFXFree(fx->lastAllpassLine[ch]);
fx->lastAllpassLine[ch] = NULL;
}
}
}
DECOMP_FORCE_LITERAL(AXFXReverbHiExp_c, -3.0f, 10.0);
static BOOL __InitParams(AXFX_REVERBHI_EXP* reverb) {
u32 ch, i;
if (reverb->earlyMode >= 8)
return FALSE;
if (reverb->preDelayTime < 0.0f || reverb->preDelayTime > reverb->preDelayTimeMax)
return FALSE;
if (reverb->fusedMode >= 6)
return FALSE;
if (reverb->fusedTime < 0.0f)
return FALSE;
if (reverb->coloration < 0.0f || reverb->coloration > 1.0f)
return FALSE;
if (reverb->damping < 0.0f || reverb->damping > 1.0f)
return FALSE;
if (reverb->crosstalk < 0.0f || reverb->crosstalk > 1.0f)
return FALSE;
if (reverb->earlyGain < 0.0f || reverb->earlyGain > 1.0f)
return FALSE;
if (reverb->fusedGain < 0.0f || reverb->fusedGain > 1.0f)
return FALSE;
if (reverb->outGain < 0.0f || reverb->outGain > 1.0f)
return FALSE;
if (reverb->sendGain < 0.0f || reverb->sendGain > 1.0f)
return FALSE;
reverb->earlyLength = __EarlySizeTable[reverb->earlyMode][2];
for (i = 0; i < 3; i++) {
reverb->earlyPos[i] = reverb->earlyLength - __EarlySizeTable[reverb->earlyMode][i];
reverb->earlyCoef[i] = __EarlyCoefTable[reverb->earlyMode][i] * reverb->earlyGain * 0.6f;
}
reverb->preDelayPos = 0;
reverb->preDelayLength = (u32)(reverb->preDelayTime * (f32)32000);
for (i = 0; i < 3; i++) {
reverb->combPos[i] = 0;
reverb->combLength[i] = __FilterSizeTable[reverb->fusedMode][i];
reverb->combCoef[i] = pow(10.0f, (-3.0f * (f32)(reverb->combLength[i]) / (f32)(reverb->fusedTime * 32000)));
}
for (i = 0; i < 2; i++) {
reverb->allpassPos[i] = 0;
reverb->allpassLength[i] = __FilterSizeTable[reverb->fusedMode][3 + i];
}
for (ch = 0; ch < 3; ch++) {
reverb->lastAllpassPos[ch] = 0;
reverb->lastAllpassLength[ch] = __FilterSizeTable[reverb->fusedMode][5 + ch];
}
reverb->allpassCoef = reverb->coloration;
reverb->lpfCoef = 1.0f - reverb->damping;
if (reverb->lpfCoef > 0.95f)
reverb->lpfCoef = 0.95f;
for (ch = 0; ch < 3; ch++) {
reverb->lastLpfOut[ch] = 0.0f;
}
return TRUE;
}

View File

@@ -0,0 +1,8 @@
#include <revolution/fa.h>
extern s32 pfstub_fclose(FAFILE* stream);
FAError FAFclose(FAFILE* stream) {
s32 error = pfstub_fclose(stream);
return (-error | error) >> 31;
}

View File

@@ -0,0 +1,8 @@
#include <revolution/fa.h>
extern s32 pfstub_finfo(FAFILE* stream, FAFileInfo* info);
FAError FAFinfo(FAFILE* stream, FAFileInfo* info) {
s32 error = pfstub_finfo(stream, info);
return (-error | error) >> 31;
}

View File

@@ -0,0 +1,2 @@
int FADiskInitializedPadding;
int FADiskInitialized;

View File

@@ -0,0 +1,10 @@
typedef int s32;
extern s32 PFDIR_closedir(void* dir);
extern s32 PFAPI_convertReturnValue(s32 err);
s32 pf2_closedir(void* dir) {
s32 err = PFDIR_closedir(dir);
err = PFAPI_convertReturnValue(err);
return err;
}

View File

@@ -0,0 +1,10 @@
#include <revolution/fa.h>
extern s32 PFVOL_errnum(void);
extern s32 PFAPI_convertError(s32 error);
FAError pf2_errnum() {
s32 error = PFVOL_errnum();
error = PFAPI_convertError(error);
return error;
}

View File

@@ -0,0 +1,10 @@
#include <revolution/fa.h>
extern s32 PFFILE_feof(FAFILE* stream);
extern s32 PFAPI_convertReturnValue4feof(s32 error);
FAError pf2_feof(FAFILE* stream) {
s32 error = PFFILE_feof(stream);
error = PFAPI_convertReturnValue4feof(error);
return error;
}

View File

@@ -0,0 +1,10 @@
#include <revolution/fa.h>
extern s32 PFFILE_ferror(FAFILE* stream);
extern s32 PFAPI_convertError(s32 error);
FAError pf2_ferror(FAFILE* stream) {
s32 error = PFFILE_ferror(stream);
error = PFAPI_convertError(error);
return error;
}

View File

@@ -0,0 +1,12 @@
#include <revolution/fa.h>
extern s32 PFFILE_flock(FAFILE* stream, s32 mode);
extern s32 PFAPI_convertReturnValue(s32 error);
FAError pf2_flock(FAFILE* stream, s32 mode) {
s32 error;
mode |= 8;
error = PFFILE_flock(stream, mode);
error = PFAPI_convertReturnValue(error);
return error;
}