Compare commits

...

1 Commits

39 changed files with 959 additions and 454 deletions

View File

@@ -202,7 +202,7 @@ namespace EGG {
return false;
}
return mSoundArchivePlayer.LoadGroup((int)id, pHeap, 0);
return mSoundArchivePlayer.LoadGroup(id, pHeap, 0);
}
bool ArcPlayer::loadGroup(const char* pName, nw4r::snd::SoundHeap* pHeap) {

View File

@@ -15,14 +15,14 @@ namespace EGG {
AudioFxMgr::AudioFxMgrArg unused1;
}
void SimpleAudioMgrWithFx::initialize(IAudioMgr::Arg* arg) {
SimpleAudioMgr::initialize(arg);
void SimpleAudioMgrWithFx::initialize(IAudioMgr::Arg* audioArgs) {
SimpleAudioMgr::initialize(audioArgs);
if (arg != NULL) {
arg = (IAudioMgr::Arg*)&((ArgWithFx*)arg)->fxArg;
if (audioArgs != NULL) {
audioArgs = (IAudioMgr::Arg*)&((ArgWithFx*)audioArgs)->fxArg;
}
initializeFx(&mHeap, (AudioFxMgrArg*)arg);
initializeFx(&mHeap, (AudioFxMgrArg*)audioArgs);
setFxReverbHi(nw4r::snd::AUX_A, AudioFxMgr::getDefaultFxReverbHi());
setFxChorus(nw4r::snd::AUX_B, AudioFxMgr::getDefaultFxChorus());

View File

@@ -37,7 +37,7 @@ namespace EGG {
mpOSThread = static_cast<OSThread*>(Heap::alloc(sizeof(OSThread), 32, mpContainHeap));
OSCreateThread(mpOSThread, Thread::start, this, reinterpret_cast<u8*>(mpStackMemory) + mStackSize, mStackSize, priority,
OSCreateThread(mpOSThread, Thread::start, this, static_cast<u8*>(mpStackMemory) + mStackSize, mStackSize, priority,
OS_THREAD_ATTR_DETACH);
setCommonMesgQueue(capacity, mpContainHeap);

View File

@@ -54,7 +54,7 @@ typedef struct {
int precision;
} print_format;
static const char* parse_format(const char* format_string, va_list* arg, print_format* format) {
static const char* parse_format(const char* format_string, va_list* args, print_format* format) {
print_format f;
const char* s = format_string;
int c;
@@ -109,7 +109,7 @@ static const char* parse_format(const char* format_string, va_list* arg, print_f
}
if (c == '*') {
if ((f.field_width = va_arg(*arg, int)) < 0) {
if ((f.field_width = va_arg(*args, int)) < 0) {
f.justification_options = left_justification;
f.field_width = -f.field_width;
}
@@ -132,7 +132,7 @@ static const char* parse_format(const char* format_string, va_list* arg, print_f
f.precision_specified = 1;
if ((c = *++s) == '*') {
if ((f.precision = va_arg(*arg, int)) < 0) {
if ((f.precision = va_arg(*args, int)) < 0) {
f.precision_specified = 0;
}
@@ -960,7 +960,7 @@ static char* float2str(long double num, char* buff, print_format format) {
}
int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProcArg,
const char* format_str, va_list arg
const char* format_str, va_list args
)
{
@@ -1000,27 +1000,27 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
}
format_ptr = curr_format;
format_ptr = parse_format(format_ptr, (va_list*)arg, &format);
format_ptr = parse_format(format_ptr, (va_list*)args, &format);
switch (format.conversion_char) {
case 'd':
case 'i':
if (format.argument_options == long_argument) {
long_num = va_arg(arg, signed long);
long_num = va_arg(args, signed long);
} else if (format.argument_options == long_long_argument) {
long_long_num = va_arg(arg, signed long long);
long_long_num = va_arg(args, signed long long);
}
else if (format.argument_options == intmax_argument) {
long_long_num = va_arg(arg, intmax_t);
long_long_num = va_arg(args, intmax_t);
}
else if (format.argument_options == size_t_argument) {
long_num = va_arg(arg, size_t);
long_num = va_arg(args, size_t);
}
else if (format.argument_options == ptrdiff_argument) {
long_num = va_arg(arg, ptrdiff_t);
long_num = va_arg(args, ptrdiff_t);
}
else {
long_num = va_arg(arg, int);
long_num = va_arg(args, int);
}
if (format.argument_options == short_argument) {
@@ -1052,21 +1052,21 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
case 'x':
case 'X':
if (format.argument_options == long_argument) {
long_num = va_arg(arg, unsigned long);
long_num = va_arg(args, unsigned long);
} else if (format.argument_options == long_long_argument) {
long_long_num = va_arg(arg, signed long long);
long_long_num = va_arg(args, signed long long);
}
else if (format.argument_options == intmax_argument) {
long_long_num = va_arg(arg, intmax_t);
long_long_num = va_arg(args, intmax_t);
}
else if (format.argument_options == size_t_argument) {
long_num = va_arg(arg, size_t);
long_num = va_arg(args, size_t);
}
else if (format.argument_options == ptrdiff_argument) {
long_num = va_arg(arg, ptrdiff_t);
long_num = va_arg(args, ptrdiff_t);
}
else {
long_num = va_arg(arg, unsigned int);
long_num = va_arg(args, unsigned int);
}
if (format.argument_options == short_argument) {
@@ -1100,9 +1100,9 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
case 'g':
case 'G':
if (format.argument_options == long_double_argument) {
long_double_num = va_arg(arg, long double);
long_double_num = va_arg(args, long double);
} else {
long_double_num = va_arg(arg, double);
long_double_num = va_arg(args, double);
}
if (!(buff_ptr = float2str(long_double_num, buff + 512, *fmt_ptr))) {
@@ -1115,9 +1115,9 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
case 'a':
case 'A':
if (format.argument_options == long_double_argument) {
long_double_num = va_arg(arg, long double);
long_double_num = va_arg(args, long double);
} else {
long_double_num = va_arg(arg, double);
long_double_num = va_arg(args, double);
}
if (!(buff_ptr = double2hex(long_double_num, buff + 512, *fmt_ptr))) {
@@ -1129,7 +1129,7 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
case 's':
if (format.argument_options == wchar_argument) {
wchar_t* wcs_ptr = va_arg(arg, wchar_t*);
wchar_t* wcs_ptr = va_arg(args, wchar_t*);
if (wcs_ptr == NULL) {
wcs_ptr = L"";
@@ -1141,7 +1141,7 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
buff_ptr = &buff[0];
} else {
buff_ptr = va_arg(arg, char*);
buff_ptr = va_arg(args, char*);
}
if (buff_ptr == NULL) {
@@ -1167,7 +1167,7 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
break;
case 'n':
buff_ptr = va_arg(arg, char*);
buff_ptr = va_arg(args, char*);
switch (format.argument_options) {
case normal_argument:
@@ -1197,7 +1197,7 @@ int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* WriteProc
case 'c':
buff_ptr = buff;
*buff_ptr = va_arg(arg, int);
*buff_ptr = va_arg(args, int);
num_chars = 1;
break;
@@ -1294,7 +1294,7 @@ int printf(const char* format, ...) {
{
va_list args;
va_start(args, format);
res = __pformatter(&__FileWrite, (void*)stdout, format, args);
res = __pformatter(&__FileWrite, stdout, format, args);
}
return res;
}
@@ -1308,18 +1308,18 @@ int fprintf(FILE* file, const char* format, ...) {
{
va_list args;
va_start(args, format);
res = __pformatter(&__FileWrite, (void*)file, format, args);
res = __pformatter(&__FileWrite, file, format, args);
}
return res;
}
int vprintf(const char* format, va_list arg) {
int vprintf(const char* format, va_list args) {
int ret;
if (fwide(stdout, -1) >= 0) {
return -1;
}
ret = __pformatter(&__FileWrite, (void*)stdout, format, arg);
ret = __pformatter(&__FileWrite, stdout, format, args);
return ret;
}
@@ -1345,8 +1345,8 @@ int vsnprintf(char* s, size_t n, const char* fmt, va_list args) {
return end;
}
int vsprintf(char *s, const char *format, va_list arg) {
return vsnprintf(s, 0xFFFFFFFF, format, arg);
int vsprintf(char *s, const char *format, va_list args) {
return vsnprintf(s, 0xFFFFFFFF, format, args);
}
int snprintf(char* s, size_t n, const char* format, ...) {

View File

@@ -5,11 +5,11 @@
char* p; \
char* q; \
size_t n = cnt; \
unsigned long tmp; \
unsigned long savedWord; \
for (p = (char*)src - 1, q = (char*)dst - 1, n++; --n;) { \
tmp = *++q; \
savedWord = *++q; \
*q = *++p; \
*p = tmp; \
*p = savedWord; \
} \
} while (0)

View File

@@ -257,7 +257,7 @@ static const char* parse_format(const char* format_string, scan_format* format)
return s + 1;
}
int __sformatter(int (*ReadProc)(void*, int, int), void* ReadProcArg, const char* format_str, va_list arg,
int __sformatter(int (*ReadProc)(void*, int, int), void* ReadProcArg, const char* format_str, va_list args,
int is_secure) {
int num_chars, chars_read, items_assigned, conversions;
int base, negative, overflow;
@@ -319,7 +319,7 @@ int __sformatter(int (*ReadProc)(void*, int, int), void* ReadProcArg, const char
format_ptr = parse_format(format_ptr, &format);
if (!format.suppress_assignment && format.conversion_char != '%') {
arg_ptr = va_arg(arg, char*);
arg_ptr = va_arg(args, char*);
} else {
arg_ptr = 0;
}
@@ -552,7 +552,7 @@ int __sformatter(int (*ReadProc)(void*, int, int), void* ReadProcArg, const char
if (arg_ptr) {
if (is_secure) {
elem_valid = 1;
elem_maxsize = va_arg(arg, size_t);
elem_maxsize = va_arg(args, size_t);
}
num_chars = 0;
@@ -648,7 +648,7 @@ int __sformatter(int (*ReadProc)(void*, int, int), void* ReadProcArg, const char
if (arg_ptr) {
if (is_secure) {
elem_valid = 1;
elem_maxsize = va_arg(arg, size_t) - 1;
elem_maxsize = va_arg(args, size_t) - 1;
}
num_chars = 0;
@@ -797,7 +797,7 @@ int __StringRead(void* pPtr, int ch, int act) {
return 0;
}
inline int vsscanf(const char* s, const char* format, va_list arg) {
inline int vsscanf(const char* s, const char* format, va_list args) {
__InStrCtrl isc;
isc.NextChar = (char*)s;
@@ -806,7 +806,7 @@ inline int vsscanf(const char* s, const char* format, va_list arg) {
}
isc.NullCharDetected = 0;
return __sformatter(&__StringRead, (void*)&isc, format, arg, 0);
return __sformatter(&__StringRead, (void*)&isc, format, args, 0);
}
int sscanf(const char* s, const char* pFormat, ...) {

View File

@@ -55,7 +55,7 @@ typedef struct {
static const wchar_t* parse_format(const wchar_t* format_string, va_list* arg, print_format* format) {
static const wchar_t* parse_format(const wchar_t* format_string, va_list* args, print_format* format) {
print_format f;
const wchar_t* s = format_string;
wchar_t c;
@@ -110,14 +110,14 @@ static const wchar_t* parse_format(const wchar_t* format_string, va_list* arg, p
}
if (c == '*') {
if ((f.field_width = va_arg(*arg, int)) < 0) {
if ((f.field_width = va_arg(*args, int)) < 0) {
f.justification_options = left_justification;
f.field_width = -f.field_width;
}
c = *++s;
} else {
while ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & 0x8) != 0) {
while ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & __MSL_ISDIGIT_MAP) != 0) {
f.field_width = f.field_width * 10 + (c - '0');
c = *++s;
}
@@ -133,13 +133,13 @@ static const wchar_t* parse_format(const wchar_t* format_string, va_list* arg, p
f.precision_specified = 1;
if ((c = *++s) == '*') {
if ((f.precision = va_arg(*arg, int)) < 0) {
if ((f.precision = va_arg(*args, int)) < 0) {
f.precision_specified = 0;
}
c = *++s;
} else {
while ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & 0x8) != 0)
while ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & __MSL_ISDIGIT_MAP) != 0)
{
f.precision = f.precision * 10 + (c - '0');
c = *++s;
@@ -769,7 +769,7 @@ static wchar_t* float2str(double num, wchar_t* buff, print_format format) {
c = format.conversion_char;
p = buff - 5;
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & 0x200) != 0) {
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & __MSL_ISUPPER_MAP) != 0) {
wcscpy(p, L"-INF");
} else {
wcscpy(p, L"-inf");
@@ -777,7 +777,7 @@ static wchar_t* float2str(double num, wchar_t* buff, print_format format) {
} else {
c = format.conversion_char;
p = buff - 4;
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & 0x200) != 0) {
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & __MSL_ISUPPER_MAP) != 0) {
wcscpy(p, L"INF");
} else {
wcscpy(p, L"inf");
@@ -790,7 +790,7 @@ static wchar_t* float2str(double num, wchar_t* buff, print_format format) {
if (dec.sign) {
c = format.conversion_char;
p = buff - 5;
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & 0x200) != 0) {
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & __MSL_ISUPPER_MAP) != 0) {
wcscpy(p, L"-NAN");
} else {
wcscpy(p, L"-nan");
@@ -798,7 +798,7 @@ static wchar_t* float2str(double num, wchar_t* buff, print_format format) {
} else {
c = format.conversion_char;
p = buff - 4;
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & 0x200) != 0) {
if ((c >= 0x100 ? 0 : _current_locale.ctype_cmpt_ptr->wctype_map_ptr[c] & __MSL_ISUPPER_MAP) != 0) {
wcscpy(p, L"NAN");
} else {
wcscpy(p, L"nan");
@@ -958,8 +958,8 @@ static wchar_t* float2str(double num, wchar_t* buff, print_format format) {
break;
}
p = buff - strlen((char*)p2) - 1;
mbstowcs(p, p2, strlen((char*)p2));
p = buff - strlen(p2) - 1;
mbstowcs(p, p2, strlen(p2));
return p;
}
@@ -1290,7 +1290,7 @@ void* __wStringWrite(void* wosc, const wchar_t* buffer, size_t numchars) {
void* res;
__wOutStrCtrl* wOscp = (__wOutStrCtrl*)wosc;
tobewritten = ((wOscp->CharsWritten + numchars) <= wOscp->MaxCharCount) ? numchars : wOscp->MaxCharCount - wOscp->CharsWritten;
res = (void*)wmemcpy(wOscp->wCharStr + wOscp->CharsWritten, buffer, tobewritten);
res = wmemcpy(wOscp->wCharStr + wOscp->CharsWritten, buffer, tobewritten);
wOscp->CharsWritten += tobewritten;
return res;
}

View File

@@ -1,3 +1,3 @@
#include <math.h>
double nan(const char* arg) {}
double nan(const char* tag) {}

View File

@@ -37,14 +37,14 @@ inline DSIOResult __access_file(unsigned int handle, unsigned char* buffer, int*
}
DSIOResult __read_console(unsigned int handle, unsigned char* buffer, int* count, void* ref_con) {
if (GetUseSerialIO() == FALSE) {
if (!GetUseSerialIO()) {
return DS_IOError;
}
return __read_file(DS_Stdin, buffer, count, ref_con);
}
DSIOResult __TRK_write_console(unsigned int handle, unsigned char* buffer, int* count, void* ref_con) {
if (GetUseSerialIO() == 0) {
if (!GetUseSerialIO()) {
return DS_IOError;
}
return __write_file(DS_Stdout, buffer, count, ref_con);

View File

@@ -590,7 +590,7 @@ static void replacebuffer_(s32 chan, RFLiCtrlBuffer* buffer, u8 count) {
offset = (count * sizeof(RFLiCtrlBuffer)) + OFFSET;
write = WPADWriteFaceData(chan, ((u8*)walker + OFFSET), 4, WPAD_FACE_ADDR + offset, replacecallback_);
write = WPADWriteFaceData(chan, (walker + OFFSET), 4, WPAD_FACE_ADDR + offset, replacecallback_);
if (write != WPAD_ERR_OK) {
RFLiEndWorkingReason(RFLErrcode_Controllerfail, write);
}

View File

@@ -98,7 +98,7 @@ void loadopencallback_() {
}
}
RFLErrcode RFLiLoadHiddenDataAsync(RFLiHiddenCharData* data, u16 index, RFLSimpleCBArg cb, u32 arg) {
RFLErrcode RFLiLoadHiddenDataAsync(RFLiHiddenCharData* data, u16 index, RFLSimpleCBArg cb, u32 callbackArg) {
RFLiHiddenDBManager* manager = NULL;
RFLi_ASSERTLINE_RANGE(index, 0, RFL_MAX_HIDDEN_DB, 203);
@@ -126,7 +126,7 @@ RFLErrcode RFLiLoadHiddenDataAsync(RFLiHiddenCharData* data, u16 index, RFLSimpl
manager->loadDst = data;
manager->loadIndex = index;
manager->loadCallback = cb;
manager->loadArg = arg;
manager->loadArg = callbackArg;
return RFLiOpenAsync(RFLiFileType_Database, NAND_ACCESS_READ, loadopencallback_);
}

View File

@@ -35,7 +35,7 @@ void RFLiSetupCopyTex(GXTexFmt texFmt, u16 width, u16 height, void* buf, GXColor
GXSetPixelFmt(GX_PF_RGBA6_Z24, GX_ZC_LINEAR);
GXSetCopyFilter(GX_FALSE, NULL, GX_FALSE, NULL);
GXSetCopyClamp(GX_CLAMP_TOP + GX_CLAMP_BOTTOM);
GXSetCopyClamp(GX_CLAMP_TOP | GX_CLAMP_BOTTOM);
GXSetTexCopySrc(0, 0, width, height);
GXSetTexCopyDst(width, height, texFmt, GX_FALSE);
@@ -541,8 +541,8 @@ void RFLiSetTev4Mole() {
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0);
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevColor(GX_TEVREG0, RFLi_MOLE_COLOR0);
}
@@ -556,22 +556,22 @@ void RFLiSetTev4Mouth(u32 mouthColor) {
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_C0, GX_CC_TEXC, GX_CC_ZERO);
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevSwapMode(GX_TEVSTAGE1, GX_TEV_SWAP3, GX_TEV_SWAP2);
GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE1, GX_CC_ZERO, GX_CC_C1, GX_CC_TEXC, GX_CC_CPREV);
GXSetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV);
GXSetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevSwapMode(GX_TEVSTAGE2, GX_TEV_SWAP2, GX_TEV_SWAP3);
GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE2, GX_CC_ZERO, GX_CC_ONE, GX_CC_TEXC, GX_CC_CPREV);
GXSetTevAlphaIn(GX_TEVSTAGE2, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV);
GXSetTevColorOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
GXSetTevColorOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
color0 = RFLi_MOUTH_COLOR0[mouthColor];
color1 = RFLi_MOUTH_COLOR1[mouthColor];

View File

@@ -103,15 +103,15 @@ static BOOL checkHiddenData_(RFLiHiddenCharData* data) {
RFLiConvertHRaw2Info(data, &info);
if (RFLiCheckValidInfo(&info) == FALSE) {
if (!RFLiCheckValidInfo(&info)) {
return FALSE;
}
return TRUE;
}
static void updateHDBcallback_(u32 arg) {
RFLiMiddleDatabase* db = (RFLiMiddleDatabase*)arg;
static void updateHDBcallback_(u32 databaseAddr) {
RFLiMiddleDatabase* db = (RFLiMiddleDatabase*)databaseAddr;
RFL_NEW_OLD_PARAM* param = (RFL_NEW_OLD_PARAM*)&db->userdata1;
if (RFLGetAsyncStatus() == RFLErrcode_Success || RFLGetAsyncStatus() == RFLErrcode_Broken) {
@@ -299,8 +299,8 @@ static void loadHiddenRandomSync_(RFLiMiddleDatabase* db) {
RFLiGetManager()->mLastErrcode = db->storedSize < db->size ? RFLErrcode_DBNodata : RFLErrcode_Success;
}
static void updateHDBRandcallback_(u32 arg) {
RFLiMiddleDatabase* db = (RFLiMiddleDatabase*)arg;
static void updateHDBRandcallback_(u32 databaseAddr) {
RFLiMiddleDatabase* db = (RFLiMiddleDatabase*)databaseAddr;
RFL_HIDDEN_RANDOM_PARAM* param = (RFL_HIDDEN_RANDOM_PARAM*)&db->userdata1;
if (RFLGetAsyncStatus() == RFLErrcode_Success || RFLGetAsyncStatus() == RFLErrcode_Broken) {
@@ -387,7 +387,7 @@ static void updateHiddenRandom_(RFLiMiddleDatabase* db, BOOL use_cache) {
RFLi_ASSERTLINE(aidx == count, 514);
for (i = 0; i < (count - 1); i++) {
u16 tmp;
u16 shuffledIndex;
u16 target;
target = (((rand >> 0x10) + rand) & 0xFFFF) % (count - 1);
@@ -395,9 +395,9 @@ static void updateHiddenRandom_(RFLiMiddleDatabase* db, BOOL use_cache) {
target++;
}
tmp = array[target];
shuffledIndex = array[target];
array[target] = array[i];
array[i] = tmp;
array[i] = shuffledIndex;
rand = 0x04F8BB63 * (rand + 0x046AC055);
}
@@ -586,12 +586,12 @@ RFLMiddleDBType RFLGetMiddleDBType(const RFLMiddleDatabase* db) {
u16 RFLGetMiddleDBSize(const RFLMiddleDatabase* db) {
RFLi_ASSERTLINE_NULL(db, 772);
return (u16)((RFLiMiddleDatabase*)db)->size;
return ((RFLiMiddleDatabase*)db)->size;
}
u16 RFLGetMiddleDBStoredSize(const RFLMiddleDatabase* db) {
RFLi_ASSERTLINE_NULL(db, 789);
return (u16)((RFLiMiddleDatabase*)db)->storedSize;
return ((RFLiMiddleDatabase*)db)->storedSize;
}
BOOL RFLiGetCharInfoMiddleDB(RFLiCharInfo* info, const RFLMiddleDatabase* db, u16 index) {

View File

@@ -607,123 +607,123 @@ void RFLiInitCharModelRes(RFLiCharModelRes* charModelRes, const RFLiCharInfo* in
// Init faceline shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Faceline;
arg.index = info->faceline.type;
arg.vtxPosBuf = charModelRes->vtxPosFaceline;
arg.vtxNrmBuf = charModelRes->vtxNrmFaceline;
arg.vtxTxcBuf = charModelRes->vtxTxcFaceline;
arg.dlBuf = charModelRes->dlFaceline;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosFaceline));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmFaceline));
arg.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcFaceline));
arg.dlBufSize = sizeof(charModelRes->dlFaceline);
arg.noseTrans = &noseTrans;
arg.beardTrans = &beardTrans;
arg.hairTrans = &hairTrans;
arg.flipX = FALSE;
arg.transform = FALSE;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Faceline;
shapeRes.index = info->faceline.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosFaceline;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmFaceline;
shapeRes.vtxTxcBuf = charModelRes->vtxTxcFaceline;
shapeRes.dlBuf = charModelRes->dlFaceline;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosFaceline));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmFaceline));
shapeRes.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcFaceline));
shapeRes.dlBufSize = sizeof(charModelRes->dlFaceline);
shapeRes.noseTrans = &noseTrans;
shapeRes.beardTrans = &beardTrans;
shapeRes.hairTrans = &hairTrans;
shapeRes.flipX = FALSE;
shapeRes.transform = FALSE;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeFaceline = arg.dlSize;
charModelRes->dlSizeFaceline = shapeRes.dlSize;
}
// Init cap shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Cap;
arg.index = info->hair.type;
arg.vtxPosBuf = charModelRes->vtxPosCap;
arg.vtxNrmBuf = charModelRes->vtxNrmCap;
arg.vtxTxcBuf = charModelRes->vtxTxcCap;
arg.dlBuf = charModelRes->dlCap;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosCap));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmCap));
arg.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcCap));
arg.dlBufSize = sizeof(charModelRes->dlCap);
arg.flipX = info->hair.flip;
arg.transform = TRUE;
arg.posScale = 1.0f;
arg.posTrans = &hairTrans;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Cap;
shapeRes.index = info->hair.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosCap;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmCap;
shapeRes.vtxTxcBuf = charModelRes->vtxTxcCap;
shapeRes.dlBuf = charModelRes->dlCap;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosCap));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmCap));
shapeRes.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcCap));
shapeRes.dlBufSize = sizeof(charModelRes->dlCap);
shapeRes.flipX = info->hair.flip;
shapeRes.transform = TRUE;
shapeRes.posScale = 1.0f;
shapeRes.posTrans = &hairTrans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeCap = arg.dlSize;
charModelRes->vtxPosHair = &charModelRes->vtxPosCap[arg.vtxPosSize * VTX_COORDS_IN_POS];
charModelRes->vtxNrmHair = &charModelRes->vtxNrmCap[arg.vtxNrmSize * VTX_COORDS_IN_NRM];
charModelRes->dlHair = charModelRes->dlNose + OSRoundUp32B(arg.dlSize) + offsetof(RFLiCharModelRes, dlCap);
charModelRes->dlSizeCap = shapeRes.dlSize;
charModelRes->vtxPosHair = &charModelRes->vtxPosCap[shapeRes.vtxPosSize * VTX_COORDS_IN_POS];
charModelRes->vtxNrmHair = &charModelRes->vtxNrmCap[shapeRes.vtxNrmSize * VTX_COORDS_IN_NRM];
charModelRes->dlHair = charModelRes->dlNose + OSRoundUp32B(shapeRes.dlSize) + offsetof(RFLiCharModelRes, dlCap);
}
// Init hair shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Hair;
arg.index = info->hair.type;
arg.vtxPosBuf = charModelRes->vtxPosHair;
arg.vtxNrmBuf = charModelRes->vtxNrmHair;
arg.dlBuf = charModelRes->dlHair;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosCap)) -
shapeRes.parts = RFLiPartsShp_Hair;
shapeRes.index = info->hair.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosHair;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmHair;
shapeRes.dlBuf = charModelRes->dlHair;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosCap)) -
(((u32)charModelRes->vtxPosHair - (u32)charModelRes->vtxPosCap) / VTX_COORD_SIZE) / VTX_COORDS_IN_POS;
arg.vtxNrmBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxNrmCap)) -
shapeRes.vtxNrmBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxNrmCap)) -
(((u32)charModelRes->vtxNrmHair - (u32)charModelRes->vtxNrmCap) / VTX_COORD_SIZE) / VTX_COORDS_IN_NRM;
arg.dlBufSize = sizeof(charModelRes->dlCap) - ((u32)charModelRes->dlHair - (u32)charModelRes->dlCap);
arg.flipX = info->hair.flip;
arg.transform = TRUE;
arg.posScale = 1.0f;
arg.posTrans = &hairTrans;
RFLiInitShapeRes(&arg);
shapeRes.dlBufSize = sizeof(charModelRes->dlCap) - ((u32)charModelRes->dlHair - (u32)charModelRes->dlCap);
shapeRes.flipX = info->hair.flip;
shapeRes.transform = TRUE;
shapeRes.posScale = 1.0f;
shapeRes.posTrans = &hairTrans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeHair = arg.dlSize;
charModelRes->vtxPosForehead = &charModelRes->vtxPosHair[arg.vtxPosSize * VTX_COORDS_IN_POS];
charModelRes->vtxNrmForehead = &charModelRes->vtxNrmHair[arg.vtxNrmSize * VTX_COORDS_IN_NRM];
charModelRes->dlForehead = charModelRes->dlHair + OSRoundUp32B(arg.dlSize);
charModelRes->dlSizeHair = shapeRes.dlSize;
charModelRes->vtxPosForehead = &charModelRes->vtxPosHair[shapeRes.vtxPosSize * VTX_COORDS_IN_POS];
charModelRes->vtxNrmForehead = &charModelRes->vtxNrmHair[shapeRes.vtxNrmSize * VTX_COORDS_IN_NRM];
charModelRes->dlForehead = charModelRes->dlHair + OSRoundUp32B(shapeRes.dlSize);
charModelRes->flipHair = info->hair.flip;
}
// Init forehead shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Forehead;
arg.index = info->hair.type;
arg.vtxPosBuf = charModelRes->vtxPosForehead;
arg.vtxNrmBuf = charModelRes->vtxNrmForehead;
arg.dlBuf = charModelRes->dlForehead;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosCap)) -
shapeRes.parts = RFLiPartsShp_Forehead;
shapeRes.index = info->hair.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosForehead;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmForehead;
shapeRes.dlBuf = charModelRes->dlForehead;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosCap)) -
(((u32)charModelRes->vtxPosForehead - (u32)charModelRes->vtxPosCap) / VTX_COORD_SIZE) / VTX_COORDS_IN_POS;
arg.vtxNrmBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxNrmCap)) -
shapeRes.vtxNrmBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxNrmCap)) -
(((u32)charModelRes->vtxNrmForehead - (u32)charModelRes->vtxNrmCap) / VTX_COORD_SIZE) / VTX_COORDS_IN_NRM;
arg.dlBufSize = sizeof(charModelRes->dlCap) - ((u32)charModelRes->dlForehead - (u32)charModelRes->dlCap);
arg.flipX = info->hair.flip;
arg.transform = TRUE;
arg.posScale = 1.0f;
arg.posTrans = &hairTrans;
RFLiInitShapeRes(&arg);
shapeRes.dlBufSize = sizeof(charModelRes->dlCap) - ((u32)charModelRes->dlForehead - (u32)charModelRes->dlCap);
shapeRes.flipX = info->hair.flip;
shapeRes.transform = TRUE;
shapeRes.posScale = 1.0f;
shapeRes.posTrans = &hairTrans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeForehead = arg.dlSize;
charModelRes->dlSizeForehead = shapeRes.dlSize;
}
// Init beard shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Beard;
arg.index = info->beard.type;
arg.vtxPosBuf = charModelRes->vtxPosBeard;
arg.vtxNrmBuf = charModelRes->vtxNrmBeard;
arg.dlBuf = charModelRes->dlBeard;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosBeard));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmBeard));
arg.dlBufSize = sizeof(charModelRes->dlBeard);
arg.flipX = FALSE;
arg.transform = TRUE;
arg.posScale = 1.0f;
arg.posTrans = &beardTrans;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Beard;
shapeRes.index = info->beard.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosBeard;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmBeard;
shapeRes.dlBuf = charModelRes->dlBeard;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosBeard));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmBeard));
shapeRes.dlBufSize = sizeof(charModelRes->dlBeard);
shapeRes.flipX = FALSE;
shapeRes.transform = TRUE;
shapeRes.posScale = 1.0f;
shapeRes.posTrans = &beardTrans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeBeard = arg.dlSize;
charModelRes->dlSizeBeard = shapeRes.dlSize;
}
// Init nose shape
@@ -731,7 +731,7 @@ void RFLiInitCharModelRes(RFLiCharModelRes* charModelRes, const RFLiCharInfo* in
f32 scale;
RFLiPositionData trans;
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
scale = 0.4f + 0.175f * info->nose.scale;
@@ -739,69 +739,69 @@ void RFLiInitCharModelRes(RFLiCharModelRes* charModelRes, const RFLiCharInfo* in
trans.y = +noseTrans.y + -1.5f * (info->nose.y - 8);
trans.z = noseTrans.z;
arg.parts = RFLiPartsShp_Nose;
arg.index = info->nose.type;
arg.vtxPosBuf = charModelRes->vtxPosNose;
arg.vtxNrmBuf = charModelRes->vtxNrmNose;
arg.dlBuf = charModelRes->dlNose;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosNose));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmNose));
arg.dlBufSize = sizeof(charModelRes->dlNose);
arg.flipX = FALSE;
arg.transform = TRUE;
arg.posScale = scale;
arg.posTrans = &trans;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Nose;
shapeRes.index = info->nose.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosNose;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmNose;
shapeRes.dlBuf = charModelRes->dlNose;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosNose));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmNose));
shapeRes.dlBufSize = sizeof(charModelRes->dlNose);
shapeRes.flipX = FALSE;
shapeRes.transform = TRUE;
shapeRes.posScale = scale;
shapeRes.posTrans = &trans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeNose = arg.dlSize;
charModelRes->dlSizeNose = shapeRes.dlSize;
}
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Noseline;
arg.index = info->nose.type;
arg.vtxPosBuf = charModelRes->vtxPosNoseline;
arg.vtxNrmBuf = charModelRes->vtxNrmNoseline;
arg.vtxTxcBuf = charModelRes->vtxTxcNoseline;
arg.dlBuf = charModelRes->dlNoseline;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosNoseline));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmNoseline));
arg.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcNoseline));
arg.dlBufSize = sizeof(charModelRes->dlNoseline);
arg.flipX = FALSE;
arg.transform = TRUE;
arg.posScale = scale;
arg.posTrans = &trans;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Noseline;
shapeRes.index = info->nose.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosNoseline;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmNoseline;
shapeRes.vtxTxcBuf = charModelRes->vtxTxcNoseline;
shapeRes.dlBuf = charModelRes->dlNoseline;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosNoseline));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmNoseline));
shapeRes.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcNoseline));
shapeRes.dlBufSize = sizeof(charModelRes->dlNoseline);
shapeRes.flipX = FALSE;
shapeRes.transform = TRUE;
shapeRes.posScale = scale;
shapeRes.posTrans = &trans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeNoseline = arg.dlSize;
charModelRes->dlSizeNoseline = shapeRes.dlSize;
}
}
// Init mask shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
arg.parts = RFLiPartsShp_Mask;
arg.index = info->faceline.type;
arg.vtxPosBuf = charModelRes->vtxPosMask;
arg.vtxNrmBuf = charModelRes->vtxNrmMask;
arg.vtxTxcBuf = charModelRes->vtxTxcMask;
arg.dlBuf = charModelRes->dlMask;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosMask));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmMask));
arg.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcMask));
arg.dlBufSize = sizeof(charModelRes->dlMask);
arg.flipX = FALSE;
arg.transform = FALSE;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Mask;
shapeRes.index = info->faceline.type;
shapeRes.vtxPosBuf = charModelRes->vtxPosMask;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmMask;
shapeRes.vtxTxcBuf = charModelRes->vtxTxcMask;
shapeRes.dlBuf = charModelRes->dlMask;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosMask));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmMask));
shapeRes.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcMask));
shapeRes.dlBufSize = sizeof(charModelRes->dlMask);
shapeRes.flipX = FALSE;
shapeRes.transform = FALSE;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeMask = arg.dlSize;
charModelRes->dlSizeMask = shapeRes.dlSize;
}
// Init glass shape
{
RFLiCharShapeRes arg;
RFLiCharShapeRes shapeRes;
f32 scale;
RFLiPositionData trans;
@@ -811,23 +811,23 @@ void RFLiInitCharModelRes(RFLiCharModelRes* charModelRes, const RFLiCharInfo* in
trans.y = 5.0f + noseTrans.y + -1.5f * (info->glass.y - 11);
trans.z = 2.0f + noseTrans.z;
arg.parts = RFLiPartsShp_Glass;
arg.index = 0;
arg.vtxPosBuf = charModelRes->vtxPosGlass;
arg.vtxNrmBuf = charModelRes->vtxNrmGlass;
arg.vtxTxcBuf = charModelRes->vtxTxcGlass;
arg.dlBuf = charModelRes->dlGlass;
arg.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosGlass));
arg.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmGlass));
arg.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcGlass));
arg.dlBufSize = sizeof(charModelRes->dlGlass);
arg.flipX = FALSE;
arg.transform = TRUE;
arg.posScale = scale;
arg.posTrans = &trans;
RFLiInitShapeRes(&arg);
shapeRes.parts = RFLiPartsShp_Glass;
shapeRes.index = 0;
shapeRes.vtxPosBuf = charModelRes->vtxPosGlass;
shapeRes.vtxNrmBuf = charModelRes->vtxNrmGlass;
shapeRes.vtxTxcBuf = charModelRes->vtxTxcGlass;
shapeRes.dlBuf = charModelRes->dlGlass;
shapeRes.vtxPosBufSize = NUM_VTX_POS(sizeof(charModelRes->vtxPosGlass));
shapeRes.vtxNrmBufSize = NUM_VTX_NRM(sizeof(charModelRes->vtxNrmGlass));
shapeRes.vtxTxcBufSize = NUM_VTX_TXC(sizeof(charModelRes->vtxTxcGlass));
shapeRes.dlBufSize = sizeof(charModelRes->dlGlass);
shapeRes.flipX = FALSE;
shapeRes.transform = TRUE;
shapeRes.posScale = scale;
shapeRes.posTrans = &trans;
RFLiInitShapeRes(&shapeRes);
charModelRes->dlSizeGlass = arg.dlSize;
charModelRes->dlSizeGlass = shapeRes.dlSize;
}
// Init faceline texture
@@ -856,38 +856,38 @@ void RFLiInitCharModelRes(RFLiCharModelRes* charModelRes, const RFLiCharInfo* in
}
// DEBUG NON MATCH (https://decomp.me/scratch/mQdEd)
void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
void RFLiInitShapeRes(RFLiCharShapeRes* shapeRes /* r30 */) {
void* res; // r31+0xE8
u8* ptr8; // r29
BOOL skipTxc; // r31+0xE4
static const u32 csHeader[RFLiPartsShp_Max] = {'nose', 'frhd', 'face', 'hair', 'cap_', 'berd', 'nsln', 'mask', 'glas'};
RFLi_ASSERTLINE_NULL(arg, 1261);
RFLi_ASSERTLINE_NULL(arg->vtxPosBuf, 1262);
RFLi_ASSERTLINE_NULL(arg->vtxNrmBuf, 1263);
RFLi_ASSERTLINE_NULL(arg->dlBuf, 1264);
RFLi_ASSERTLINE_ALIGN(arg->dlBuf, 32, 1265);
RFLi_ASSERTLINE_NULL(shapeRes, 1261);
RFLi_ASSERTLINE_NULL(shapeRes->vtxPosBuf, 1262);
RFLi_ASSERTLINE_NULL(shapeRes->vtxNrmBuf, 1263);
RFLi_ASSERTLINE_NULL(shapeRes->dlBuf, 1264);
RFLi_ASSERTLINE_ALIGN(shapeRes->dlBuf, 32, 1265);
skipTxc =
arg->parts == RFLiPartsShp_Nose || arg->parts == RFLiPartsShp_Forehead || arg->parts == RFLiPartsShp_Hair || arg->parts == RFLiPartsShp_Beard;
shapeRes->parts == RFLiPartsShp_Nose || shapeRes->parts == RFLiPartsShp_Forehead || shapeRes->parts == RFLiPartsShp_Hair || shapeRes->parts == RFLiPartsShp_Beard;
if (!skipTxc) {
RFLi_ASSERTLINE_NULL(arg->vtxTxcBuf, 1273);
RFLi_ASSERTLINE_NULL(shapeRes->vtxTxcBuf, 1273);
}
if (arg->transform) {
RFLi_ASSERTLINE_NULL(arg->posTrans, 1277);
if (shapeRes->transform) {
RFLi_ASSERTLINE_NULL(shapeRes->posTrans, 1277);
}
{
u32 fileSize = RFLiGetShapeSize(arg->parts, arg->index); // r31+0xE0
u32 fileSize = RFLiGetShapeSize(shapeRes->parts, shapeRes->index); // r31+0xE0
res = RFLiAlloc32(fileSize);
RFLi_ASSERTLINE_NULL(res, 1287);
}
{
void* result = RFLiLoadShape(arg->parts, arg->index, res); // r31+0xDC
void* result = RFLiLoadShape(shapeRes->parts, shapeRes->index, res); // r31+0xDC
RFLi_ASSERTLINE_MSG(result, 1290, "ファイルの読み込みに失敗しました。"); // "Failed to read file."
}
@@ -896,61 +896,61 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
ptr8 = res;
header = *(u32*)ptr8; // r31+0xD8
RFLi_ASSERTLINE_MSG(header == csHeader[arg->parts], 1304, "ヘッダとpartsが一致しません"); // "Header and "parts" do not match"
RFLi_ASSERTLINE_MSG(header == csHeader[shapeRes->parts], 1304, "ヘッダとpartsが一致しません"); // "Header and "parts" do not match"
ptr8 += sizeof(header);
}
if (arg->parts == RFLiPartsShp_Faceline) {
RFLi_ASSERTLINE_NULL(arg->noseTrans, 1310);
RFLi_ASSERTLINE_NULL(arg->beardTrans, 1311);
if (shapeRes->parts == RFLiPartsShp_Faceline) {
RFLi_ASSERTLINE_NULL(shapeRes->noseTrans, 1310);
RFLi_ASSERTLINE_NULL(shapeRes->beardTrans, 1311);
// Missing assert for arg->hairTrans?
memcpy(arg->noseTrans, ptr8, sizeof(RFLiPositionData));
memcpy(shapeRes->noseTrans, ptr8, sizeof(RFLiPositionData));
ptr8 += sizeof(RFLiPositionData);
memcpy(arg->beardTrans, ptr8, sizeof(RFLiPositionData));
memcpy(shapeRes->beardTrans, ptr8, sizeof(RFLiPositionData));
ptr8 += sizeof(RFLiPositionData);
memcpy(arg->hairTrans, ptr8, sizeof(RFLiPositionData));
memcpy(shapeRes->hairTrans, ptr8, sizeof(RFLiPositionData));
ptr8 += sizeof(RFLiPositionData);
}
{
u16 size = *(u16*)ptr8; // r31+0xA
if (size == 0) {
arg->vtxPosSize = 0;
arg->vtxNrmSize = 0;
arg->vtxTxcSize = 0;
shapeRes->vtxPosSize = 0;
shapeRes->vtxNrmSize = 0;
shapeRes->vtxTxcSize = 0;
arg->dlSize = 0;
shapeRes->dlSize = 0;
RFLiFree(res);
return;
}
}
arg->vtxPosSize = *(u16*)ptr8;
RFLi_ASSERTLINE_MSG(arg->vtxPosSize <= arg->vtxPosBufSize, 1351, "vtxPosSize(%d) > vtxPosBufSize(%d) parts:%d index:%d", arg->vtxPosSize,
arg->vtxPosBufSize, arg->parts, arg->index);
ptr8 += sizeof(arg->vtxPosSize);
shapeRes->vtxPosSize = *(u16*)ptr8;
RFLi_ASSERTLINE_MSG(shapeRes->vtxPosSize <= shapeRes->vtxPosBufSize, 1351, "vtxPosSize(%d) > vtxPosBufSize(%d) parts:%d index:%d", shapeRes->vtxPosSize,
shapeRes->vtxPosBufSize, shapeRes->parts, shapeRes->index);
ptr8 += sizeof(shapeRes->vtxPosSize);
{
u32 byteSize; // r31+0xD4
s16* ptr16; // r31+0xD0
ptr16 = (s16*)ptr8;
byteSize = SIZE_VTX_POS(arg->vtxPosSize);
byteSize = SIZE_VTX_POS(shapeRes->vtxPosSize);
if (arg->transform) {
if (shapeRes->transform) {
int i; // r31+0xCC
s32 s = 256.0f * arg->posScale; // r31+0xC8
s32 tx = 256.0f * arg->posTrans->x; // r31+0xC4
s32 ty = 256.0f * arg->posTrans->y; // r31+0xC0
s32 tz = 256.0f * arg->posTrans->z; // r31+0xBC
s32 s = 256.0f * shapeRes->posScale; // r31+0xC8
s32 tx = 256.0f * shapeRes->posTrans->x; // r31+0xC4
s32 ty = 256.0f * shapeRes->posTrans->y; // r31+0xC0
s32 tz = 256.0f * shapeRes->posTrans->z; // r31+0xBC
for (i = 0; i < arg->vtxPosSize; i++) {
for (i = 0; i < shapeRes->vtxPosSize; i++) {
s16 temp[3]; // r31+0xFC
if (arg->flipX) {
if (shapeRes->flipX) {
temp[0] = tx + ((-ptr16[0] * s) >> 8);
} else {
temp[0] = tx + ((ptr16[0] * s) >> 8);
@@ -959,27 +959,27 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
temp[1] = ty + ((ptr16[1] * s) >> 8);
temp[2] = tz + ((ptr16[2] * s) >> 8);
RFLiTransformCoordinate(&arg->vtxPosBuf[i * VTX_COORDS_IN_POS], temp);
RFLiTransformCoordinate(&shapeRes->vtxPosBuf[i * VTX_COORDS_IN_POS], temp);
ptr16 += VTX_COORDS_IN_POS;
}
} else if (arg->flipX) {
} else if (shapeRes->flipX) {
int i; // r31+0xB8
for (i = 0; i < arg->vtxPosSize; i++) {
for (i = 0; i < shapeRes->vtxPosSize; i++) {
s16 temp[3]; // r31+0xF4
temp[0] = -ptr16[0];
temp[1] = ptr16[1];
temp[2] = ptr16[2];
RFLiTransformCoordinate(&arg->vtxPosBuf[i * VTX_COORDS_IN_POS], temp);
RFLiTransformCoordinate(&shapeRes->vtxPosBuf[i * VTX_COORDS_IN_POS], temp);
ptr16 += VTX_COORDS_IN_POS;
}
} else {
int i; // r31+0xB4
for (i = 0; i < arg->vtxPosSize; i++) {
RFLiTransformCoordinate(&arg->vtxPosBuf[i * VTX_COORDS_IN_POS], ptr16);
for (i = 0; i < shapeRes->vtxPosSize; i++) {
RFLiTransformCoordinate(&shapeRes->vtxPosBuf[i * VTX_COORDS_IN_POS], ptr16);
ptr16 += VTX_COORDS_IN_POS;
}
}
@@ -987,9 +987,9 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
ptr8 += byteSize;
}
arg->vtxNrmSize = *(u16*)ptr8;
RFLi_ASSERTLINE_MSG(arg->vtxNrmSize <= arg->vtxNrmBufSize, 1415, "vtxNrmSize(%d) > vtxNrmBufSize(%d) parts:%d index:%d", arg->vtxNrmSize,
arg->vtxNrmBufSize, arg->parts, arg->index);
shapeRes->vtxNrmSize = *(u16*)ptr8;
RFLi_ASSERTLINE_MSG(shapeRes->vtxNrmSize <= shapeRes->vtxNrmBufSize, 1415, "vtxNrmSize(%d) > vtxNrmBufSize(%d) parts:%d index:%d", shapeRes->vtxNrmSize,
shapeRes->vtxNrmBufSize, shapeRes->parts, shapeRes->index);
ptr8 += sizeof(u16);
{
@@ -997,25 +997,25 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
s16* ptr16; // r31+0xAC
ptr16 = (s16*)ptr8;
byteSize = SIZE_VTX_NRM(arg->vtxNrmSize);
byteSize = SIZE_VTX_NRM(shapeRes->vtxNrmSize);
if (arg->flipX) {
if (shapeRes->flipX) {
int i; // r31+0xA8
for (i = 0; i < arg->vtxNrmSize; i++) {
for (i = 0; i < shapeRes->vtxNrmSize; i++) {
s16 temp[3]; // r31+0xEC
temp[0] = -ptr16[0];
temp[1] = ptr16[1];
temp[2] = ptr16[2];
RFLiTransformCoordinate(&arg->vtxNrmBuf[i * VTX_COORDS_IN_NRM], temp);
RFLiTransformCoordinate(&shapeRes->vtxNrmBuf[i * VTX_COORDS_IN_NRM], temp);
ptr16 += VTX_COORDS_IN_NRM;
}
} else {
int i; // r31+0xA4
for (i = 0; i < arg->vtxNrmSize; i++) {
RFLiTransformCoordinate(&arg->vtxNrmBuf[i * VTX_COORDS_IN_NRM], ptr16);
for (i = 0; i < shapeRes->vtxNrmSize; i++) {
RFLiTransformCoordinate(&shapeRes->vtxNrmBuf[i * VTX_COORDS_IN_NRM], ptr16);
ptr16 += VTX_COORDS_IN_NRM;
}
}
@@ -1027,15 +1027,15 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
u32 byteSize; // r31+0xA0
if (skipTxc) {
arg->vtxTxcSize = 0;
shapeRes->vtxTxcSize = 0;
} else {
arg->vtxTxcSize = *(u16*)ptr8;
RFLi_ASSERTLINE_MSG(arg->vtxTxcSize <= arg->vtxTxcBufSize, 1460, "vtxTxcSize(%d) > vtxTxcBufSize(%d) parts:%d index:%d", arg->vtxTxcSize,
arg->vtxTxcBufSize, arg->parts, arg->index);
shapeRes->vtxTxcSize = *(u16*)ptr8;
RFLi_ASSERTLINE_MSG(shapeRes->vtxTxcSize <= shapeRes->vtxTxcBufSize, 1460, "vtxTxcSize(%d) > vtxTxcBufSize(%d) parts:%d index:%d", shapeRes->vtxTxcSize,
shapeRes->vtxTxcBufSize, shapeRes->parts, shapeRes->index);
ptr8 += sizeof(u16);
byteSize = SIZE_VTX_TXC(arg->vtxTxcSize);
memcpy(arg->vtxTxcBuf, ptr8, byteSize);
byteSize = SIZE_VTX_TXC(shapeRes->vtxTxcSize);
memcpy(shapeRes->vtxTxcBuf, ptr8, byteSize);
ptr8 += byteSize;
}
}
@@ -1044,8 +1044,8 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
int primitiveNum = *ptr8++; // r31+0x9C
int i, j; // r31+0x94
DCInvalidateRange(arg->dlBuf, arg->dlBufSize);
GXBeginDisplayList(arg->dlBuf, arg->dlBufSize);
DCInvalidateRange(shapeRes->dlBuf, shapeRes->dlBufSize);
GXBeginDisplayList(shapeRes->dlBuf, shapeRes->dlBufSize);
for (i = 0; i < primitiveNum; i++) {
u16 vtxNum = *ptr8++; // r31+0x8
@@ -1065,7 +1065,7 @@ void RFLiInitShapeRes(RFLiCharShapeRes* arg /* r30 */) {
GXEnd();
}
arg->dlSize = GXEndDisplayList();
shapeRes->dlSize = GXEndDisplayList();
}
RFLiFree(res);

View File

@@ -408,7 +408,7 @@ RFLErrcode RFLiOpenAsync(RFLiFileType type, u8 openmode, RFLSimpleCB cb) {
strncpy(info->openinfo.filename, filename, NAND_MAX_PATH);
info->openinfo.filename[NAND_MAX_PATH] = 0;
info->openinfo.openmode = (u8)openmode;
info->openinfo.openmode = openmode;
info->openinfo.permission = scFilePermissions[type];
info->openinfo.attribute = scFileAttributes[type];
@@ -626,8 +626,8 @@ RFLErrcode RFLiReadAsync(RFLiFileType type, void* dst, u32 size, RFLSimpleCB cb,
static void writecallback_(s32 result, NANDCommandBlock* block);
static void retryWrite_(u32 arg) {
RFLiFileType type = (RFLiFileType)arg;
static void retryWrite_(u32 fileType) {
RFLiFileType type = (RFLiFileType)fileType;
RFLiNANDAccessInfo* info = RFLiGetAccInfo(type);
{
@@ -734,8 +734,8 @@ static s32 writestart_(RFLiFileType type) {
static void writeseekcallback_(s32 result, NANDCommandBlock* block);
static void retryWriteSeek_(u32 arg) {
RFLiFileType type = (RFLiFileType)arg;
static void retryWriteSeek_(u32 fileType) {
RFLiFileType type = (RFLiFileType)fileType;
RFLiNANDAccessInfo* info = RFLiGetAccInfo(type);
{

View File

@@ -349,7 +349,7 @@ RFLErrcode makeNWC24MsgforExchange_(NWC24MsgObj* obj, RFLCharData* sendTarget, B
RFLi_ASSERTLINE(aidx <= count, 407);
for (i = 0; i < aidx - 1; i++) {
u16 tmp;
u16 shuffledIndex;
u16 target;
target = (((rand >> 0x10) + rand) & 0xFFFF) % (aidx - 1);
@@ -357,9 +357,9 @@ RFLErrcode makeNWC24MsgforExchange_(NWC24MsgObj* obj, RFLCharData* sendTarget, B
target++;
}
tmp = array[target];
shuffledIndex = array[target];
array[target] = array[i];
array[i] = tmp;
array[i] = shuffledIndex;
rand = (rand + 0x02ED47B1) * 0x032ED8B7;
}
@@ -447,14 +447,14 @@ RFLErrcode makeNWC24MsgforExchange_(NWC24MsgObj* obj, RFLCharData* sendTarget, B
int k;
for (k = 0; k < friendsNum; k++) {
NWC24FriendInfo* tmp;
NWC24FriendInfo* shuffledFriend;
u32 l;
rand = (rand + 0x02ED47B1) * 0x032ED8B7;
l = rand % friendsNum;
tmp = lists[k];
shuffledFriend = lists[k];
lists[k] = lists[l];
lists[l] = tmp;
lists[l] = shuffledFriend;
}
for (i = 0; i < (int)GET_ARRAY_LENGTH(receiver); i++) {

View File

@@ -86,7 +86,7 @@ RFLErrcode RFLInitResAsync(void* workBuffer, void* resBuffer, u32 resSize, BOOL
} else {
size = (RFLi_WORK_SIZE - sizeof(RFLiSysManager));
}
RFLiGetManager()->mRootHeap = MEMCreateExpHeapEx(RFLiGetManager()->mWorkBuffer, size, 1);
RFLiGetManager()->mRootHeap = MEMCreateExpHeapEx(RFLiGetManager()->mWorkBuffer, size, MEM_HEAP_OPT_CLEAR_ALLOC);
RFLi_REPORT(" rootHeap : 0x%08x - 0x%08x (%6dByte)\n", (u8*)RFLiGetManager()->mWorkBuffer,
(size + (u32)RFLiGetManager()->mWorkBuffer), size);
}

View File

@@ -233,13 +233,13 @@ static void SetupTimeoutAlarm(CARDControl* card) {
break;
}
case 0xF4: {
if (card->pageSize > 0x80) {
if (card->pageSize > CARD_PAGE_SIZE) {
OSSetAlarm(&card->alarm, OSSecondsToTicks((OSTime)2) * (card->cBlock / 0x40), TimeoutHandler);
break;
}
}
case 0xF1: {
OSSetAlarm(&card->alarm, OSSecondsToTicks((OSTime)2) * (card->sectorSize / 0x2000), TimeoutHandler);
OSSetAlarm(&card->alarm, OSSecondsToTicks((OSTime)2) * (card->sectorSize / CARD_SYSTEM_BLOCK_SIZE), TimeoutHandler);
break;
}
}
@@ -408,7 +408,7 @@ s32 __CARDWritePage(s32 chan, CARDCallback callback) {
card = &__CARDBlock[chan];
card->cmd[0] = 0xF2;
if (card->pageSize > 0x80) {
if (card->pageSize > CARD_PAGE_SIZE) {
card->cmd[1] = AD1(card->addr) | 0x80;
} else {
card->cmd[1] = AD1(card->addr);
@@ -444,11 +444,11 @@ s32 __CARDEraseSector(s32 chan, u32 addr, CARDCallback callback) {
card = &__CARDBlock[chan];
if (card->pageSize > 0x80) {
if (card->pageSize > CARD_PAGE_SIZE) {
if (callback) {
callback(chan, 0);
callback(chan, CARD_RESULT_READY);
}
return 0;
return CARD_RESULT_READY;
}
card->cmd[0] = 0xF1;
@@ -496,7 +496,7 @@ void CARDInit() {
OSInitThreadQueue(&card->threadQueue);
OSCreateAlarm(&card->alarm);
}
__CARDSetDiskID((void*)OSPhysicalToCached(OS_ADDR_BOOT_INFO));
__CARDSetDiskID(OSPhysicalToCached(OS_ADDR_BOOT_INFO));
OSRegisterShutdownFunction(&ShutdownFunctionInfo);
}

View File

@@ -28,10 +28,10 @@ static void WriteCallback(s32 chan, s32 result) {
if (card->currentFat == fat0) {
card->currentFat = fat1;
memcpy(fat1, fat0, 0x2000);
memcpy(fat1, fat0, CARD_SYSTEM_BLOCK_SIZE);
} else {
card->currentFat = fat0;
memcpy(fat0, fat1, 0x2000);
memcpy(fat0, fat1, CARD_SYSTEM_BLOCK_SIZE);
}
}
@@ -90,25 +90,25 @@ s32 __CARDAllocBlock(s32 chan, u32 cBlock, CARDCallback callback) {
}
fat = __CARDGetFatBlockU16(card);
if (fat[3] < cBlock) {
if (fat[CARD_FAT_FREEBLOCKS] < cBlock) {
return CARD_RESULT_INSSPACE;
}
fat[3] -= cBlock;
fat[CARD_FAT_FREEBLOCKS] -= cBlock;
startBlock = 0xFFFF;
iBlock = fat[4];
iBlock = fat[CARD_FAT_LASTSLOT];
count = 0;
while (0 < cBlock) {
if (card->cBlock - 5 < ++count) {
if (card->cBlock - CARD_NUM_SYSTEM_BLOCK < ++count) {
return CARD_RESULT_BROKEN;
}
iBlock++;
if (!CARDIsValidBlockNo(card, iBlock)) {
iBlock = 5;
iBlock = CARD_NUM_SYSTEM_BLOCK;
}
if (fat[iBlock] == 0x0000u) {
if (fat[iBlock] == CARD_FAT_AVAIL) {
if (startBlock == 0xFFFF) {
startBlock = iBlock;
} else {
@@ -120,7 +120,7 @@ s32 __CARDAllocBlock(s32 chan, u32 cBlock, CARDCallback callback) {
}
}
fat[4] = iBlock;
fat[CARD_FAT_LASTSLOT] = iBlock;
card->startBlock = startBlock;
return __CARDUpdateFatBlock(chan, fat, callback);
}
@@ -142,9 +142,9 @@ s32 __CARDFreeBlock(s32 chan, u16 nBlock, CARDCallback callback) {
}
nextBlock = fat[nBlock];
fat[nBlock] = 0;
fat[nBlock] = CARD_FAT_AVAIL;
nBlock = nextBlock;
++fat[3];
++fat[CARD_FAT_FREEBLOCKS];
}
return __CARDUpdateFatBlock(chan, fat, callback);
@@ -155,9 +155,9 @@ s32 __CARDUpdateFatBlock(s32 chan, u16* fat, CARDCallback callback) {
u32 addr;
card = &__CARDBlock[chan];
++fat[2];
__CARDCheckSum(fat + 2, 0x1FFC, fat, fat + 1);
DCStoreRange(fat, 0x2000);
++fat[CARD_FAT_CHECKCODE];
__CARDCheckSum(fat + CARD_FAT_CHECKCODE, CARD_SYSTEM_BLOCK_SIZE - sizeof(u32), fat, fat + CARD_FAT_CHECKSUMINV);
DCStoreRange(fat, CARD_SYSTEM_BLOCK_SIZE);
card->eraseCallback = callback;
addr = ((u32)fat - (u32)card->workArea) / CARD_SYSTEM_BLOCK_SIZE * card->sectorSize;
return __CARDEraseSector(chan, addr, EraseCallback);

View File

@@ -14,16 +14,16 @@ static void WriteCallback(s32 chan, s32 result) {
CARDControl* card = &__CARDBlock[chan];
CARDCallback callback;
if (result >= 0) {
CARDDir* dir0 = (CARDDir*)((u8*)card->workArea + 0x2000);
if (result >= CARD_RESULT_READY) {
CARDDir* dir0 = (CARDDir*)((u8*)card->workArea + CARD_SYSTEM_BLOCK_SIZE);
CARDDir* dir1 = (CARDDir*)((u8*)card->workArea + 0x4000);
if (card->currentDir == dir0) {
card->currentDir = dir1;
memcpy(dir1, dir0, 0x2000);
memcpy(dir1, dir0, CARD_SYSTEM_BLOCK_SIZE);
} else {
card->currentDir = dir0;
memcpy(dir0, dir1, 0x2000);
memcpy(dir0, dir1, CARD_SYSTEM_BLOCK_SIZE);
}
}
@@ -44,11 +44,11 @@ static void EraseCallback(s32 chan, s32 result) {
CARDDir* dir;
u32 addr;
if (result >= 0) {
if (result >= CARD_RESULT_READY) {
dir = __CARDGetDirBlock(card);
addr = ((u32)dir - (u32)card->workArea) / 0x2000 * card->sectorSize;
result = __CARDWrite(chan, addr, 0x2000, dir, WriteCallback);
if (result >= 0) {
addr = ((u32)dir - (u32)card->workArea) / CARD_SYSTEM_BLOCK_SIZE * card->sectorSize;
result = __CARDWrite(chan, addr, CARD_SYSTEM_BLOCK_SIZE, dir, WriteCallback);
if (result >= CARD_RESULT_READY) {
return;
}
}
@@ -78,10 +78,10 @@ s32 __CARDUpdateDir(s32 chan, CARDCallback callback) {
dir = __CARDGetDirBlock(card);
check = CARDGetDirCheck(dir);
++check->checkCode;
__CARDCheckSum(dir, 0x2000 - sizeof(u32), &check->checkSum, &check->checkSumInv);
DCStoreRange(dir, 0x2000);
__CARDCheckSum(dir, CARD_SYSTEM_BLOCK_SIZE - sizeof(u32), &check->checkSum, &check->checkSumInv);
DCStoreRange(dir, CARD_SYSTEM_BLOCK_SIZE);
card->eraseCallback = callback;
addr = ((u32)dir - (u32)card->workArea) / 0x2000 * card->sectorSize;
addr = ((u32)dir - (u32)card->workArea) / CARD_SYSTEM_BLOCK_SIZE * card->sectorSize;
return __CARDEraseSector(chan, addr, EraseCallback);
}

View File

@@ -2,4 +2,4 @@
#include <revolution/card.h>
u16 __CARDVendorID = -1;
u8 __CARDPermMask = 0x1C;
u8 __CARDPermMask = CARD_ATTR_PUBLIC | CARD_ATTR_NO_COPY | CARD_ATTR_NO_MOVE;

View File

@@ -45,10 +45,10 @@ s32 __CARDIsWritable(CARDControl* card, CARDDir* ent) {
result = __CARDAccess(card, ent);
if (result == CARD_RESULT_NOPERM) {
perm = ent->permission & __CARDPermMask;
if (perm & 0x20 && (memcmp(ent->gameName, __CARDDiskNone.gameName, sizeof(ent->gameName)) == 0 &&
if (perm & CARD_ATTR_GLOBAL && (memcmp(ent->gameName, __CARDDiskNone.gameName, sizeof(ent->gameName)) == 0 &&
memcmp(ent->company, __CARDDiskNone.company, sizeof(ent->company)) == 0)) {
return CARD_RESULT_READY;
} else if (perm & 0x40 && (memcmp(ent->gameName, __CARDDiskNone.gameName, sizeof(ent->gameName)) == 0 &&
} else if (perm & CARD_ATTR_COMPANY && (memcmp(ent->gameName, __CARDDiskNone.gameName, sizeof(ent->gameName)) == 0 &&
memcmp(ent->company, diskID->company, sizeof(ent->company)) == 0)) {
return CARD_RESULT_READY;
}
@@ -59,7 +59,7 @@ s32 __CARDIsWritable(CARDControl* card, CARDDir* ent) {
s32 __CARDIsReadable(CARDControl* card, CARDDir* ent) {
s32 result = __CARDIsWritable(card, ent);
if (result == CARD_RESULT_NOPERM && (ent->permission & 0x4)) {
if (result == CARD_RESULT_NOPERM && (ent->permission & CARD_ATTR_PUBLIC)) {
return CARD_RESULT_READY;
}

View File

@@ -62,27 +62,27 @@ s32 __CARDSetStatusExAsync(s32 chan, s32 fileNo, CARDDir* dirent, CARDCallback c
break;
}
if (dirent->permission & 0x20) {
if (dirent->permission & CARD_ATTR_GLOBAL) {
memset(dirent->gameName, 0, sizeof(dirent->gameName));
memset(dirent->company, 0, sizeof(dirent->company));
}
if (dirent->permission & 0x40) {
if (dirent->permission & CARD_ATTR_COMPANY) {
memset(dirent->gameName, 0, sizeof(dirent->gameName));
}
if ((memcmp(&ent->fileName, &dirent->fileName, 32) != 0) || (memcmp(ent->gameName, dirent->gameName, 4) != 0) ||
if ((memcmp(&ent->fileName, &dirent->fileName, CARD_FILENAME_MAX) != 0) || (memcmp(ent->gameName, dirent->gameName, 4) != 0) ||
(memcmp(ent->company, dirent->company, 2) != 0)) {
for (i = 0; i < CARD_MAX_FILE; i++) {
if (i != fileNo) {
CARDDir* ent = &dir[i];
if (((u8)ent->gameName[0] != 0xFF) && (memcmp(&ent->gameName, &dirent->gameName, 4) == 0) &&
(memcmp(&ent->company, &dirent->company, 2) == 0) && (memcmp(&ent->fileName, &dirent->fileName, 0x20) == 0)) {
return __CARDPutControlBlock(card, -7);
(memcmp(&ent->company, &dirent->company, 2) == 0) && (memcmp(&ent->fileName, &dirent->fileName, CARD_FILENAME_MAX) == 0)) {
return __CARDPutControlBlock(card, CARD_RESULT_EXIST);
}
}
}
memcpy(&ent->fileName, &dirent->fileName, 0x20);
memcpy(&ent->fileName, &dirent->fileName, CARD_FILENAME_MAX);
memcpy(&ent->gameName, &dirent->gameName, 4);
memcpy(&ent->company, &dirent->company, 2);
}

View File

@@ -104,7 +104,7 @@ static s32 ReadArrayUnlock(s32 chan, u32 data, void* rbuf, s32 rlen, int mode) {
u8 cmd[5];
card = &__CARDBlock[chan];
if (!EXISelect(chan, 0, CARDFreq)) {
if (!EXISelect(chan, EXI_DEV_EXT, CARDFreq)) {
return CARD_RESULT_NOCARD;
}
@@ -122,9 +122,9 @@ static s32 ReadArrayUnlock(s32 chan, u32 data, void* rbuf, s32 rlen, int mode) {
}
err = FALSE;
err |= !EXIImmEx(chan, cmd, 5, 1);
err |= !EXIImmEx(chan, (u8*)card->workArea + (u32)sizeof(CARDID), card->latency, 1);
err |= !EXIImmEx(chan, rbuf, rlen, 0);
err |= !EXIImmEx(chan, cmd, 5, EXI_WRITE);
err |= !EXIImmEx(chan, (u8*)card->workArea + (u32)sizeof(CARDID), card->latency, EXI_WRITE);
err |= !EXIImmEx(chan, rbuf, rlen, EXI_READ);
err |= !EXIDeselect(chan);
return err ? CARD_RESULT_NOCARD : CARD_RESULT_READY;

View File

@@ -45,8 +45,8 @@ void _CNTCACHEDeleteTitle();
void _CNTCACHEDeleteContent();
void CNTCACHEInit(int unk0, int unk1) {
if (_CNTCACHEInitialized == FALSE) {
void CNTCACHEInit(int cacheValue, int cacheHighWord) {
if (!_CNTCACHEInitialized) {
BOOL old;
OSRegisterVersion(__CNTCACHEVersion);
@@ -60,8 +60,8 @@ void CNTCACHEInit(int unk0, int unk1) {
}
CNTCACHEClear();
_CNTCACHEUnused816997A4 = unk0;
*((int*)&_CNTCACHEUnused816997A8) = unk1;
_CNTCACHEUnused816997A4 = cacheValue;
*((int*)&_CNTCACHEUnused816997A8) = cacheHighWord;
}
asm void CNTCACHEClear() {
clrlwi r11, r1, 0x1b

View File

@@ -54,13 +54,13 @@ BOOL __DSP_rude_task_pending;
void __DSPHandler(__OSInterrupt intr, OSContext* context) {
OSContext exceptionContext;
u16 tmp;
u16 controlStatus;
u32 mail;
tmp = DSP_READ_REG(DSP_CONTROL_STATUS);
CLEAR_FLAG(tmp, ((1 << DSP_CONTROL_STATUS_AIDINT) | (1 << DSP_CONTROL_STATUS_ARINT)));
SET_FLAG(tmp, (1 << DSP_CONTROL_STATUS_DSPINT));
DSP_WRITE_REG(DSP_CONTROL_STATUS, tmp);
controlStatus = DSP_READ_REG(DSP_CONTROL_STATUS);
CLEAR_FLAG(controlStatus, ((1 << DSP_CONTROL_STATUS_AIDINT) | (1 << DSP_CONTROL_STATUS_ARINT)));
SET_FLAG(controlStatus, (1 << DSP_CONTROL_STATUS_DSPINT));
DSP_WRITE_REG(DSP_CONTROL_STATUS, controlStatus);
OSClearContext(&exceptionContext);
OSSetCurrentContext(&exceptionContext);

View File

@@ -30,8 +30,8 @@ static char s_homeDir[NAND_MAX_PATH] ALIGN32;
static BOOL nandOnShutdown(BOOL final, u32 event);
static void nandShutdownCallback(ISFSError result, void* arg);
static void nandChangeDirCallback(ISFSError result, void* arg);
static void nandShutdownCallback(ISFSError result, void* callbackContext);
static void nandChangeDirCallback(ISFSError result, void* callbackContext);
static OSShutdownFunctionInfo s_shutdownFuncInfo = {nandOnShutdown, 0xFF, NULL, NULL};
@@ -360,8 +360,8 @@ static BOOL nandOnShutdown(BOOL final, u32 event) {
}
}
static void nandShutdownCallback(ISFSError result, void* arg) {
*(BOOL*)arg = TRUE;
static void nandShutdownCallback(ISFSError result, void* callbackContext) {
*(BOOL*)callbackContext = TRUE;
}
static ISFSError nandChangeDir(const char* path, NANDCommandBlock* block, BOOL isAsync, BOOL hasPrivateAccess) {
@@ -400,8 +400,8 @@ s32 NANDChangeDir(const char* path) {
return nandConvertErrorCode(nandChangeDir(path, NULL, FALSE, FALSE));
}
static void nandChangeDirCallback(ISFSError result, void* arg) {
NANDCommandBlock* block = (NANDCommandBlock*)arg;
static void nandChangeDirCallback(ISFSError result, void* callbackContext) {
NANDCommandBlock* block = (NANDCommandBlock*)callbackContext;
if (result == ISFS_ERROR_OK) {
BOOL enabled = OSDisableInterrupts();
strcpy(s_currentDir, block->absPath);
@@ -435,12 +435,12 @@ s32 NANDGetHomeDir(char* path) {
return NAND_RESULT_OK;
}
void nandCallback(ISFSError result, void* arg) {
NANDCommandBlock* block = (NANDCommandBlock*)arg;
void nandCallback(ISFSError result, void* callbackContext) {
NANDCommandBlock* block = (NANDCommandBlock*)callbackContext;
block->callback(nandConvertErrorCode(result), block);
}
static void nandGetTypeCallback(ISFSError result, void* arg);
static void nandGetTypeCallback(ISFSError result, void* callbackContext);
static ISFSError nandGetType(const char* path, u8* type, NANDCommandBlock* block, BOOL isAsync, BOOL hasPrivateAccess) {
if (strlen(path) == 0) {
@@ -505,8 +505,8 @@ s32 NANDPrivateGetTypeAsync(const char* path, u8* type, NANDCallback callback, N
return nandConvertErrorCode(nandGetType(path, type, block, TRUE, TRUE));
}
static void nandGetTypeCallback(ISFSError result, void* arg) {
NANDCommandBlock* block = (NANDCommandBlock*)arg;
static void nandGetTypeCallback(ISFSError result, void* callbackContext) {
NANDCommandBlock* block = (NANDCommandBlock*)callbackContext;
if (result == ISFS_ERROR_OK || result == ISFS_ERROR_ACCESS) {
*block->type = NAND_TYPE_DIR;

View File

@@ -27,7 +27,7 @@ static NANDLoggingCallback s_callback = NULL;
if (s_callback) \
s_callback(b)
static void asyncRoutine(ISFSError result, void* arg);
static void asyncRoutine(ISFSError result, void* callbackContext);
static void PrepareLine(char* line, int count, const char* msg) {
int result;
char titleID[64];
@@ -169,7 +169,7 @@ BOOL NANDLoggingAddMessageAsync(NANDLoggingCallback callback, const char* fmt, .
}
}
static void asyncRoutine(ISFSError result, void* arg) {
static void asyncRoutine(ISFSError result, void* callbackContext) {
ISFSError ret;
static char s_rBuf[LINE_MAX_EACH] ATTRIBUTE_ALIGN(LINE_MAX);
static char s_wBuf[LINE_MAX_EACH] ATTRIBUTE_ALIGN(LINE_MAX);

View File

@@ -13,7 +13,7 @@
static BOOL nandInspectPermission(u8 perm);
static void nandSplitPerm(u8 perm, u32* owner, u32* group, u32* others);
static void nandGetStatusCallback(ISFSError result, void* arg);
static void nandGetStatusCallback(ISFSError result, void* callbackContext);
static ISFSError nandCreate(const char* path, u8 perm, u8 attr, NANDCommandBlock* block, BOOL isAsync, BOOL hasPrivateAccess) {
char absPath[NAND_MAX_PATH] = "";
@@ -302,8 +302,8 @@ s32 NANDTell(NANDFileInfo* info, u32* pos) {
return nandConvertErrorCode(nandGetFileStatus(info->fileDescriptor, NULL, pos));
}
static void nandGetFileStatusAsyncCallback(ISFSError result, void* arg) {
NANDCommandBlock* block = (NANDCommandBlock*)arg;
static void nandGetFileStatusAsyncCallback(ISFSError result, void* callbackContext) {
NANDCommandBlock* block = (NANDCommandBlock*)callbackContext;
ISFSFileStats* isfsStats = (ISFSFileStats*)OSRoundUp32B((u32)block->absPath);
if (result == ISFS_ERROR_OK) {
@@ -411,8 +411,8 @@ static ISFSError nandGetStatus(const char* path, NANDStatus* status, NANDCommand
}
}
static void nandGetStatusCallback(ISFSError result, void* arg) {
NANDCommandBlock* block = (NANDCommandBlock*)arg;
static void nandGetStatusCallback(ISFSError result, void* callbackContext) {
NANDCommandBlock* block = (NANDCommandBlock*)callbackContext;
if (result == ISFS_ERROR_OK) {
NANDStatus* status = (NANDStatus*)block->status;
status->attribute = block->attr;

View File

@@ -374,7 +374,7 @@ s32 WADGetInstalledVersion(ESTitleId titleId, u16* version) {
}
result = ES_GetTmdView(titleId, 0, &tmdSize);
if (result == -106) {
if (result == ES_ERR_DONT_EXISTS) {
return -3002;
}
if (result != 0) {
@@ -668,7 +668,7 @@ s32 WADImportEx(char* path, MEMAllocator* allocator, WADLocation location, u32 o
goto cleanup;
}
if (ticketViewCount == 0) {
result = -1028;
result = ES_ERR_TICKET_NOT_FOUND;
goto cleanup;
}
}
@@ -1006,20 +1006,20 @@ s32 WADImportEx(char* path, MEMAllocator* allocator, WADLocation location, u32 o
result = 0;
if (_WADCanImportFile(fileHeaderBuffer, transferIdValue,
unpackInfo.fileNames, transferId) == 0) {
if ((fileHeaderBuffer->flags[2] == 1) && (fileHeaderBuffer->fileSize != 0)) {
if ((fileHeaderBuffer->flags[2] == NAND_TYPE_FILE) && (fileHeaderBuffer->fileSize != 0)) {
importedBytes += fileHeaderBuffer->fileSize;
importedBytes = (importedBytes + 0x3F) & ~0x3F;
}
continue;
}
if (fileHeaderBuffer->flags[2] == 1) {
result = NANDPrivateCreate(fileHeaderBuffer->name, fileHeaderBuffer->flags[0] | 0x20,
if (fileHeaderBuffer->flags[2] == NAND_TYPE_FILE) {
result = NANDPrivateCreate(fileHeaderBuffer->name, fileHeaderBuffer->flags[0] | NAND_PERM_USER_WRITE,
fileHeaderBuffer->flags[1]);
if (result != 0) {
goto cleanup;
}
if (fileHeaderBuffer->fileSize != 0) {
result = NANDPrivateOpen(fileHeaderBuffer->name, &backupFile, 2);
result = NANDPrivateOpen(fileHeaderBuffer->name, &backupFile, NAND_ACCESS_WRITE);
if (result != 0) {
goto cleanup;
}
@@ -1066,7 +1066,7 @@ s32 WADImportEx(char* path, MEMAllocator* allocator, WADLocation location, u32 o
}
backupFileOpened = FALSE;
}
if ((fileHeaderBuffer->flags[0] & 0x20) == 0) {
if ((fileHeaderBuffer->flags[0] & NAND_PERM_USER_WRITE) == 0) {
result = NANDPrivateGetStatus(fileHeaderBuffer->name, &fileStatus);
if (result != 0) {
goto cleanup;
@@ -1078,17 +1078,17 @@ s32 WADImportEx(char* path, MEMAllocator* allocator, WADLocation location, u32 o
goto cleanup;
}
}
} else if (fileHeaderBuffer->flags[2] == 2) {
} else if (fileHeaderBuffer->flags[2] == NAND_TYPE_DIR) {
result = NANDPrivateCreateDir(fileHeaderBuffer->name,
fileHeaderBuffer->flags[0] | 0x20,
fileHeaderBuffer->flags[0] | NAND_PERM_USER_WRITE,
fileHeaderBuffer->flags[1]);
if (result == -6) {
if (result == NAND_RESULT_EXISTS) {
result = NANDPrivateGetStatus(fileHeaderBuffer->name, &fileStatus);
if (result != 0) {
goto cleanup;
}
if ((fileStatus.permission & 0x20) == 0) {
fileStatus.permission = fileHeaderBuffer->flags[0] | 0x20;
if ((fileStatus.permission & NAND_PERM_USER_WRITE) == 0) {
fileStatus.permission = fileHeaderBuffer->flags[0] | NAND_PERM_USER_WRITE;
fileStatus.attribute = fileHeaderBuffer->flags[1];
result = NANDPrivateSetStatus(fileHeaderBuffer->name, &fileStatus);
if (result != 0) {
@@ -1126,7 +1126,7 @@ s32 WADImportEx(char* path, MEMAllocator* allocator, WADLocation location, u32 o
if (result != 0) {
goto cleanup;
}
if ((fileHeaderBuffer->flags[0] & 0x20) == 0) {
if ((fileHeaderBuffer->flags[0] & NAND_PERM_USER_WRITE) == 0) {
savedataStatus.permission = fileHeaderBuffer->flags[0];
result = NANDPrivateSetStatus(fileHeaderBuffer->name, &savedataStatus);
if (result != 0) {
@@ -1352,7 +1352,7 @@ s32 WADBackupEx(u64 titleId, u32 flags, MEMAllocator* allocator, char* path, u32
}
if ((flags & 1) != 0) {
result = ES_ListTitleContentsOnCard(titleId, 0, &installedContentCount);
if (result == -106) {
if (result == ES_ERR_DONT_EXISTS) {
result = -3002;
goto cleanup;
}
@@ -1651,8 +1651,8 @@ s32 WADBackupEx(u64 titleId, u32 flags, MEMAllocator* allocator, char* path, u32
if (processCallback != 0) {
processCallback(importedSize, contentDataSize + fileDataSize, FALSE);
}
if ((fileHeaderBuffer->flags[2] == 1) && (fileHeaderBuffer->fileSize != 0)) {
result = NANDPrivateOpen(fileHeaderBuffer->name, &savedFile, 1);
if ((fileHeaderBuffer->flags[2] == NAND_TYPE_FILE) && (fileHeaderBuffer->fileSize != 0)) {
result = NANDPrivateOpen(fileHeaderBuffer->name, &savedFile, NAND_ACCESS_READ);
fileOpened = TRUE;
if (result != 0) {
goto file_done;
@@ -1720,7 +1720,7 @@ s32 WADBackupEx(u64 titleId, u32 flags, MEMAllocator* allocator, char* path, u32
processCallback(importedSize, contentDataSize + fileDataSize, FALSE);
}
}
} else if (fileHeaderBuffer->flags[2] == 1) {
} else if (fileHeaderBuffer->flags[2] == NAND_TYPE_FILE) {
byteCount = 0;
}
file_done:
@@ -1771,19 +1771,19 @@ file_done:
}
result = 0;
streamResult = WADWriteStream(&stream, signature, sizeof(signature));
if ((s32)streamResult != (s32)sizeof(signature)) {
if (streamResult != (s32)sizeof(signature)) {
result = -3006;
goto cleanup;
}
result = 0;
streamResult = WADWriteStream(&stream, (void*)ROUNDUP((u32)certificates->device, 64), sizeof(certificates->device));
if ((s32)streamResult != (s32)sizeof(certificates->device)) {
if (streamResult != (s32)sizeof(certificates->device)) {
result = -3006;
goto cleanup;
}
result = 0;
streamResult = WADWriteStream(&stream, (ESCertSignature*)ROUNDUP((u32)&certificates->signer, 64), sizeof(certificates->signer));
if ((s32)streamResult != (s32)sizeof(certificates->signer)) {
if (streamResult != (s32)sizeof(certificates->signer)) {
result = -3006;
goto cleanup;
}
@@ -1841,7 +1841,7 @@ static s32 _WADCheckContents(ESTmdView* titleMeta, ESContentMask* contentMask) {
s32 result;
u32 contentIndex;
if (ES_ListTitleContentsOnCard(titleMeta->head.titleId, 0, &installedContentCount) == -106) {
if (ES_ListTitleContentsOnCard(titleMeta->head.titleId, 0, &installedContentCount) == ES_ERR_DONT_EXISTS) {
result = -3002;
} else {
result = ES_ListTitleContentsOnCard(titleMeta->head.titleId, installedContentIds,
@@ -2006,23 +2006,23 @@ s32 WADOpenStream(WADLocation location, const char* path, WADStream* stream, u32
{
s32 result;
if (write != 0) {
result = NANDPrivateOpen(path, &stream->handle.nand, 3);
if (result == -12) {
result = NANDPrivateOpen(path, &stream->handle.nand, NAND_ACCESS_RW);
if (result == NAND_RESULT_NOEXISTS) {
result = NANDPrivateCreate(path, 0x3F, 0);
if (result != 0) {
return -3004;
}
result = NANDPrivateOpen(path, &stream->handle.nand, 3);
result = NANDPrivateOpen(path, &stream->handle.nand, NAND_ACCESS_RW);
}
if (result != 0) {
return -3004;
}
result = NANDSeek(&stream->handle.nand, offset, 0);
if (result == -8) {
result = NANDSeek(&stream->handle.nand, offset, NAND_SEEK_BEG);
if (result == NAND_RESULT_INVALID) {
u8 zeroes[0x4000] ALIGN32;
u32 fileSize;
fileSize = NANDSeek(&stream->handle.nand, 0, 2);
fileSize = NANDSeek(&stream->handle.nand, 0, NAND_SEEK_END);
if (fileSize >= offset) {
return -3004;
}
@@ -2037,11 +2037,11 @@ s32 WADOpenStream(WADLocation location, const char* path, WADStream* stream, u32
}
fileSize -= writeSize;
}
result = NANDSeek(&stream->handle.nand, offset, 0);
result = NANDSeek(&stream->handle.nand, offset, NAND_SEEK_BEG);
}
return result != offset ? -3004 : 0;
}
result = NANDPrivateOpen(path, &stream->handle.nand, 1);
result = NANDPrivateOpen(path, &stream->handle.nand, NAND_ACCESS_READ);
return result != 0 ? -3004 : result;
}
@@ -2104,7 +2104,7 @@ size_t WADReadStream(WADStream* stream, void** buffer, size_t size, s32 offset)
return DVDReadPrio(&stream->handle.dvd, *buffer, alignedSize, offset, 2);
case WAD_LOCATION_NAND:
result = NANDSeek(&stream->handle.nand, offset, 0);
result = NANDSeek(&stream->handle.nand, offset, NAND_SEEK_BEG);
if ((s32)result >= 0) {
result = NANDRead(&stream->handle.nand, *buffer, alignedSize);
}
@@ -2563,7 +2563,7 @@ static s32 _WADUnpackBackup(WADHeader* header, WADStream* stream, WADUnpackInfo*
goto done;
}
if (currentDeviceId != backupHeader->deviceId) {
return -3008;
return WAD_ERROR_INCORRECT_DEVICE;
}
}
@@ -2588,7 +2588,7 @@ static s32 _WADUnpackBackup(WADHeader* header, WADStream* stream, WADUnpackInfo*
info->titleMetaSize = 1;
result = WADReadStream(stream, (void**)&info->titleMeta, alignedSize,
offset + info->sectionOffset);
if ((s32)result != (s32)alignedSize) {
if (result != (s32)alignedSize) {
return -3005;
}
result = 0;
@@ -2656,7 +2656,7 @@ static s32 _WADGetTransferId(void* transferId) {
s32 result;
valid = FALSE;
result = NANDPrivateOpen("/shared2/succession/transfer.id", &fileInfo, 1);
result = NANDPrivateOpen("/shared2/succession/transfer.id", &fileInfo, NAND_ACCESS_READ);
if (result == 0) {
valid = TRUE;
result = NANDRead(&fileInfo, transferId, 0x20);
@@ -2771,23 +2771,23 @@ static s32 _WADBackupGetFiles(const char* directoryPath, u32 flags, MEMAllocator
if (absolutePaths && strcmp(directoryPath, ".") == 0) {
snprintf(noCopyPath, sizeof(noCopyPath), "%s/%s", currentDirectory, "nocopy");
snprintf(bannerPath, sizeof(bannerPath), "%s/%s", currentDirectory, "banner.bin");
if (strcmp(fullFilePath, noCopyPath) == 0 && fileType == 2) {
if (strcmp(fullFilePath, noCopyPath) == 0 && fileType == NAND_TYPE_DIR) {
goto nextName;
}
if (strcmp(fullFilePath, bannerPath) == 0 && fileType == 1) {
if (strcmp(fullFilePath, bannerPath) == 0 && fileType == NAND_TYPE_FILE) {
goto nextName;
}
} else {
if (strcmp(fullFilePath, "nocopy") == 0 && fileType == 2) {
if (strcmp(fullFilePath, "nocopy") == 0 && fileType == NAND_TYPE_DIR) {
goto nextName;
}
if (strcmp(fullFilePath, "banner.bin") == 0 && fileType == 1) {
if (strcmp(fullFilePath, "banner.bin") == 0 && fileType == NAND_TYPE_FILE) {
goto nextName;
}
}
}
if (fileType == 1) {
result = NANDPrivateOpen(fullFilePath, &fileInfo, 1);
if (fileType == NAND_TYPE_FILE) {
result = NANDPrivateOpen(fullFilePath, &fileInfo, NAND_ACCESS_READ);
closeFile = TRUE;
if (result != 0) {
goto nextName;
@@ -2801,7 +2801,7 @@ static s32 _WADBackupGetFiles(const char* directoryPath, u32 flags, MEMAllocator
if (result != 0) {
goto nextName;
}
} else if (fileType == 2) {
} else if (fileType == NAND_TYPE_DIR) {
if ((flags & 8) == 0) {
goto nextName;
}
@@ -2826,7 +2826,7 @@ static s32 _WADBackupGetFiles(const char* directoryPath, u32 flags, MEMAllocator
if (files != 0) {
file++;
}
if (fileType == 2) {
if (fileType == NAND_TYPE_DIR) {
WADBackupFileHeader* children;
childFileCount = 0;
children = 0;
@@ -3327,7 +3327,7 @@ static s32 _WADVerifySavedataZD(WADSaveDataHeader* header, WADStream* stream,
if (result != 0) {
goto cleanup;
}
result = NANDPrivateOpen(fileHeader->name, &fileInfo, 2);
result = NANDPrivateOpen(fileHeader->name, &fileInfo, NAND_ACCESS_WRITE);
if (result != 0) {
goto cleanup;
}
@@ -3582,7 +3582,7 @@ s32 WADImportDVDExForBS(const char* path, void* buffer, u32 bufferSize) {
goto cleanup;
}
value = DVDReadPrio(&fileInfo, readBuffer, sectionOffset, 0, 2);
if (value != (s32)sectionOffset) {
if (value != sectionOffset) {
result = -3005;
goto cleanup;
}

View File

@@ -520,7 +520,7 @@ NWC24Err NWC24iInitMsgBoxDir(BOOL force) {
}
result = NANDPrivateReadDir(path, NULL, &num);
if (result == -12) {
if (result == NAND_RESULT_NOEXISTS) {
result = NWC24CreateDir(path);
if (result != NWC24_OK) {
return NWC24_ERR_FATAL;
@@ -531,16 +531,16 @@ NWC24Err NWC24iInitMsgBoxDir(BOOL force) {
if (force) {
result = NANDPrivateDelete(mboxDir);
if (result != 0 && result != -12) {
if (result == -4) {
return -38;
if (result != 0 && result != NAND_RESULT_NOEXISTS) {
if (result == NAND_RESULT_CORRUPT) {
return NWC24_ERR_NAND_CORRUPT;
}
return NWC24_ERR_FATAL;
}
}
result = NWC24CreateDir(mboxDir);
if (result != -15 && result != 0) {
if (result != NWC24_ERR_DONE && result != 0) {
return NWC24_ERR_FATAL;
}

View File

@@ -48,7 +48,7 @@ void* __construct_new_array(void* block, void* ctor, void* dtor, size_t size, si
__partial_array_destructor pad(ptr, size, n, dtor);
char* p;
for (pad.i = 0, p = (char*)ptr; pad.i < n; pad.i++, p += size) {
for (pad.i = 0, p = ptr; pad.i < n; pad.i++, p += size) {
CTORCALL_COMPLETE(ctor, p);
}
}

View File

@@ -59,7 +59,7 @@ void SimpleWavePlayer::wavePacketCallback(WavePacketCallbackStatus status, WaveP
return;
}
if (self->mThreadRunning != false) {
if (self->mThreadRunning) {
OSSendMessage(&self->mQueue, packet, 0);
return;
}
@@ -213,11 +213,11 @@ void SimpleWavePlayer::update() {
}
}
void* SimpleWavePlayer::makeWaveProc(void* arg) {
void* SimpleWavePlayer::makeWaveProc(void* context) {
OSMessage msg;
SimpleWavePlayer* self = (SimpleWavePlayer*)arg;
SimpleWavePlayer* self = (SimpleWavePlayer*)context;
while (true) {
OSReceiveMessage(&self->mQueue, &msg, 1);
OSReceiveMessage(&self->mQueue, &msg, OS_MESSAGE_BLOCK);
if (msg == NULL) {
break;
}
@@ -239,15 +239,15 @@ bool SimpleWavePlayer::makeThread(s32 prio, void* stack, u32 stackSize) {
void* SimpleWavePlayer::convertDSPAddr(void* addr, u32 offset, int mode) {
void* out = 0;
switch (mode) {
case 0: {
case AX_SAMPLE_FORMAT_DSP_ADPCM: {
out = (void*)((u32)addr * 2 + offset % 14 + offset / 14 * 16 + 2);
break;
}
case 25: {
case AX_SAMPLE_FORMAT_PCM_S8: {
out = (void*)((u32)addr + offset);
break;
}
case 10: {
case AX_SAMPLE_FORMAT_PCM_S16: {
out = (void*)((u32)addr / 2 + offset);
break;
}

View File

@@ -508,7 +508,7 @@ bool WaveFileAiff::checkFile(const void* _data, u32 _dataLen, bool ignoreSize) {
return false;
}
if (self->mIsLoop != false) {
if (self->mIsLoop) {
// Loop start must be before end, start must be before end of data, end must
// be at or before end of data
if (self->mLoopStart >= self->mLoopEnd) {
@@ -586,7 +586,7 @@ bool WaveFileWav::init(const void* data, u32 dataLen) {
u32 offsetAfterRiffChunk = reader.getOffset();
if (reader.seekChunk('fmt ', fileEnd) == FALSE) {
if (!reader.seekChunk('fmt ', fileEnd)) {
return false;
}
@@ -624,7 +624,7 @@ bool WaveFileWav::init(const void* data, u32 dataLen) {
}
reader.seekTo(offsetAfterRiffChunk);
if (reader.seekChunk('data', fileEnd) == FALSE)
if (!reader.seekChunk('data', fileEnd))
return false;
reader.seekTo(reader.getOffset() - 4);
@@ -658,7 +658,7 @@ bool WaveFileWav::checkFile(const void* data, u32 dataLen, bool ignoreSize) {
u32 offsetAfterRiffChunk = reader.getOffset();
if (reader.seekChunk('fmt ', fileEnd) == FALSE) {
if (!reader.seekChunk('fmt ', fileEnd)) {
return false;
}
@@ -711,7 +711,7 @@ bool WaveFileWav::checkFile(const void* data, u32 dataLen, bool ignoreSize) {
}
reader.seekTo(offsetAfterRiffChunk);
if (reader.seekChunk('data', fileEnd) == FALSE) {
if (!reader.seekChunk('data', fileEnd)) {
return false;
}
@@ -729,7 +729,7 @@ bool WaveFileWav::checkFile(const void* data, u32 dataLen, bool ignoreSize) {
// Loop start must be before end, start must be before end of data, end must
// be at or before end of data
if (mIsLoop != false) {
if (mIsLoop) {
if (mLoopStart >= mLoopEnd) {
return false;
}

View File

@@ -34,7 +34,7 @@ inline u8* getCurrAddr(VoiceInfo* voice) {
inline bool currAddrInZeroBuf(VoiceInfo* currVoice) {
nw4r::ut::AutoInterruptLock lock;
u8* apbCurrAddr = getCurrAddr(currVoice);
u8* zeroBufAddr = (u8*)SimpleWavePlayer::convertDSPAddr(zeroBuffer, 0, 0);
u8* zeroBufAddr = (u8*)SimpleWavePlayer::convertDSPAddr(zeroBuffer, 0, AX_SAMPLE_FORMAT_DSP_ADPCM);
if (zeroBufAddr <= apbCurrAddr && apbCurrAddr < zeroBufAddr + 0x200) {
return true;
} else {
@@ -278,7 +278,7 @@ int AxAdpcmSimplePlayer::start(void* data, u32 length, AxAdpcmHandle* handle) {
coeffsBufB[i] = ADD_OFFSET(AdpcmCoeffs, infoBlockDataBase, chanInfo->coeffOff);
pAxvpbBuf = axVoiceBuf;
pAxvpbBuf[i] = AXAcquireVoice(0x1f, VoiceCallback, 0);
pAxvpbBuf[i] = AXAcquireVoice(AX_PRIORITY_MAX, VoiceCallback, 0);
if (pAxvpbBuf[i] == NULL) {
chanCount = 0;
break;
@@ -293,20 +293,20 @@ int AxAdpcmSimplePlayer::start(void* data, u32 length, AxAdpcmHandle* handle) {
axAdpcmLoop.loop_yn1 = coeffsBufB[i]->cfg.loopYn1;
// @bug Doesn't copy the loop value correctly :(
axAdpcmLoop.loop_yn2 = coeffsBufB[i]->cfg.loopYn1;
loopAddr = SimpleWavePlayer::convertDSPAddr(chanDataBuf[i], infoBlock->loopStart, 0);
loopAddr = SimpleWavePlayer::convertDSPAddr(chanDataBuf[i], infoBlock->loopStart, AX_SAMPLE_FORMAT_DSP_ADPCM);
} else {
loopAddr = SimpleWavePlayer::convertDSPAddr(zeroBuffer, 0, 0);
loopAddr = SimpleWavePlayer::convertDSPAddr(zeroBuffer, 0, AX_SAMPLE_FORMAT_DSP_ADPCM);
}
void* chanData = chanDataBuf[i];
axAddr.loopAddressHi = (u32)loopAddr >> 0x10;
axAddr.loopAddressLo = (u32)loopAddr;
void* endAddr = SimpleWavePlayer::convertDSPAddr(chanData, infoBlock->loopEnd, 0);
void* endAddr = SimpleWavePlayer::convertDSPAddr(chanData, infoBlock->loopEnd, AX_SAMPLE_FORMAT_DSP_ADPCM);
axAddr.endAddressHi = (u32)endAddr >> 0x10;
axAddr.endAddressLo = (u32)endAddr & 0xFFFF;
void* currAddr = SimpleWavePlayer::convertDSPAddr(chanData, 0, 0);
void* currAddr = SimpleWavePlayer::convertDSPAddr(chanData, 0, AX_SAMPLE_FORMAT_DSP_ADPCM);
axAddr.currentAddressHi = (u32)currAddr >> 0x10;
axAddr.currentAddressLo = (u32)currAddr & 0xFFFF;
@@ -337,7 +337,7 @@ int AxAdpcmSimplePlayer::start(void* data, u32 length, AxAdpcmHandle* handle) {
axSrc.last_samples[3] = axSrc.last_samples[2] = axSrc.last_samples[1] = axSrc.last_samples[0] = axSrc.currentAddressFrac = 0;
AXVPB* vpbA = pAxvpbBuf[i];
AXSetVoiceType(vpbA, 0);
AXSetVoiceType(vpbA, AX_VOICE_NORMAL);
AXSetVoiceAddr(vpbA, &axAddr);
AXSetVoiceAdpcm(vpbA, &axAdpcm);
AXSetVoiceAdpcmLoop(vpbA, &axAdpcmLoop);

View File

@@ -1319,7 +1319,7 @@ namespace homebutton {
}
static void MotorCallback(OSAlarm* pAlarm, OSContext* pContext) {
Controller* pController = reinterpret_cast<Controller*>(OSGetAlarmUserData(pAlarm));
Controller* pController = static_cast<Controller*>(OSGetAlarmUserData(pAlarm));
pController->stopMotor();
}
@@ -1444,7 +1444,7 @@ namespace homebutton {
getController(i)->connect();
getController(i)->startMotor();
OSSetAlarmUserData(&mAlarm[i], reinterpret_cast<void*>(getController(i)));
OSSetAlarmUserData(&mAlarm[i], getController(i));
OSCancelAlarm(&mAlarm[i]);
OSSetAlarm(&mAlarm[i], OSMillisecondsToTicks(300), &MotorCallback);
@@ -2582,7 +2582,7 @@ namespace homebutton {
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGB, GX_F32, 0);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XY, GX_F32, 0);
GXSetNumChans(1);
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_REG, GX_LIGHT_NULL, GX_DF_NONE, GX_AF_NONE);

View File

@@ -55,7 +55,7 @@ namespace homebutton {
// Animate and alternate direction; Once reaching the maximum frame, it then animates forwards.
// And once reaching the minimum frame, it animates backwards. Then repeat.
case ANIM_TYPE_ALTERNATE: {
if (mbAlternateBack == false) {
if (!mbAlternateBack) {
if ((mFrame += mDelta) >= getLastFrame()) {
mFrame = getLastFrame();
mbAlternateBack = true;

View File

@@ -10,13 +10,13 @@ namespace homebutton {
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
GXSetCullMode(GX_CULL_NONE);
GXSetNumChans(1);
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_VTX, GX_SRC_VTX, 0, GX_DF_NONE, GX_AF_NONE);
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_VTX, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, GX_AF_NONE);
GXSetNumTexGens(0);
GXSetNumTevStages(1);
@@ -28,7 +28,7 @@ namespace homebutton {
Mtx mtx;
MTXTrans(mtx, 0.0f, 0.0f, 0.0f);
GXLoadPosMtxImm(mtx, 0);
GXLoadPosMtxImm(mtx, GX_PNMTX0);
GXSetLineWidth(width, GX_TO_ZERO);

View File

@@ -0,0 +1,505 @@
# rx39 expression cleanup
Baseline: `e8911343c6704c52cc1c84c8f9f1f13955215810`, branch `agent/w1005/rx39`.
Acceptance: retain only edits whose complete source objects are byte-identical to the fresh baseline. Preserve every objdiff measure and function score, string pool, and the full 4.3U DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`. Existing nonmatches are outside this expression cleanup assignment.
Saved 1,027 source objects and the live baseline report under `/tmp/rx39.before/` and `/tmp/rx39.before.json`. Scope inventory is `/tmp/rx39.files.json`. Assembly bodies and excluded paths remain untouched.
## Attempts
- ACCEPT `libs/RVLFaceLib/src/RFL_MakeTex.c`: GX clamp flags. 1 constants; complete object byte-identical.
- ACCEPT `libs/RVLFaceLib/src/RFL_MakeTex.c`: GX TEV clamp booleans. 8 constants; complete object byte-identical.
- ACCEPT `src/homebutton/HBMGUIManager.cpp`: GX position format, light mask and matrix index. 3 constants; complete object byte-identical.
- ACCEPT `src/homebutton/HBMBase.cpp`: GX position component count. 1 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/wad/wad.c`: ES and NAND error results. 7 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/wad/wad.c`: NAND access modes and seek origins. 9 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/wad/wad.c`: NAND user write permission. 6 constants; complete object byte-identical.
- ACCEPT `libs/RevoEX/src/nwc24/NWC24Manage.c`: NAND and NWC24 directory results. 5 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/card/CARDDir.c`: memory card system block size. 2 constants; complete object byte-identical.
- WITHDRAW `libs/RVL_SDK/src/card/CARDFormat.c`: sector-size cast removal. 3 casts; complete object byte-identical.
- WITHDRAW `libs/RVL_SDK/src/card/CARDMount.c`: sector-size cast removal. 1 casts; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/card/CARDBios.c`: cached boot pointer already has type void pointer. 1 casts; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/dsp/dsp_task.c`: DSP control status register value. 5 names; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/nand/nand.c`: ISFS callback context. 5 names; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/nand/NANDCore.c`: ISFS callback context. 11 names; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/nand/NANDLogging.c`: ISFS callback context. 2 names; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/cntcache/cntcache.c`: direct initialized predicate. 1 control flow; complete object byte-identical.
- ACCEPT `libs/EGG/src/core/eggAudioExpMgr.cpp`: audio initialization parameters. 6 names; complete object byte-identical.
- ACCEPT `libs/EGG/src/core/eggAudioArcPlayerMgr.cpp`: signed group id already has type int. 1 casts; complete object byte-identical.
- ACCEPT `libs/MetroTRK/src/Export/mslsupp.c`: direct serial IO predicates. 2 control flow; complete object byte-identical.
- ACCEPT `src/homebutton/HBMFrameController.cpp`: direct animation direction predicate. 1 control flow; complete object byte-identical.
- REVERT `src/homebutton/HBMRemoteSpk.cpp`: return speaker readiness bool. 1 control flow; object bytes changed.
- ACCEPT `src/homebutton/HBMBase.cpp`: typed alarm context conversion. 2 casts; complete object byte-identical.
- REVERT `src/bannerSound/AudioWaveUtility.cpp`: AIFF this pointer and length already have the desired types. 2 casts; object bytes changed.
- ACCEPT `src/bannerSound/AudioWaveUtility.cpp`: direct loop and chunk-found predicates. 6 control flow; complete object byte-identical.
- ACCEPT `src/bannerSound/AudioWavePlayer.cpp`: wave worker context. 2 names; complete object byte-identical.
- REVERT `src/bannerSound/AudioWavePlayer.cpp`: direct worker and creation bools. 2 control flow; object bytes changed.
- WITHDRAW trials 10 and 11 after type review. CARDControl::sectorSize is s32; the u32 casts change signedness. Restored both files despite identical object bytes.
- ACCEPT `libs/RVLFaceLib/src/RFL_Model.c`: shape resource initialization data. 228 names; complete object byte-identical.
- ACCEPT `libs/RVLFaceLib/src/RFL_HiddenDatabase.c`: hidden data completion callback argument. 2 names; complete object byte-identical.
- ACCEPT `libs/RVLFaceLib/src/RFL_MiddleDatabase.c`: database callback and shuffled index. 7 names; complete object byte-identical.
- ACCEPT `libs/RVLFaceLib/src/RFL_NANDAccess.c`: retry callback file type. 4 names; complete object byte-identical.
- ACCEPT `libs/RVLFaceLib/src/RFL_NWC24.c`: shuffled index and friend entry. 6 names; complete object byte-identical.
- ACCEPT `libs/RVLFaceLib/src/RFL_MiddleDatabase.c`: direct character validity predicate. 1 control flow; complete object byte-identical.
- REVERT `libs/RVLFaceLib/src/RFL_System.c`: return error predicates directly. 3 control flow; object bytes changed.
- REVERT `libs/RVLFaceLib/src/RFL_Database.c`: return isolation comparison directly. 1 control flow; object bytes changed.
- REVERT `libs/RVLFaceLib/src/RFL_Model.c`: GX accepts vertex arrays and display lists as pointers. 52 casts; compile failed.
- REVERT `libs/RVLFaceLib/src/RFL_MiddleDatabase.c`: u16 database sizes and void CRC input. 3 casts; compile failed.
- ACCEPT `libs/RVLFaceLib/src/RFL_Controller.c`: face-data walker already has type u8 pointer. 1 casts; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/card/CARDOpen.c`: memory card access attributes. 3 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/card/CARDStatEx.c`: memory card attributes and duplicate-file result. 3 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/card/CARDDir.c`: directory block byte counts. 6 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/card/CARDBlock.c`: allocation table block byte counts. 3 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/card/CARDBios.c`: memory card page and system block sizes. 4 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/card/CARDUnlock.c`: EXI device and transfer directions. 4 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/cntcache/cntcache.c`: stored cache initialization words. 4 names; complete object byte-identical.
- ACCEPT `libs/MSL/src/MSL_Common/printf.c`: format argument lists. 29 names; complete object byte-identical.
- ACCEPT `libs/MSL/src/MSL_Common/scanf.c`: scan argument lists. 6 names; complete object byte-identical.
- ACCEPT `libs/MSL/src/MSL_Common/wprintf.c`: wide format argument list. 3 names; complete object byte-identical.
- ACCEPT `libs/MSL/src/MSL_Common/qsort.c`: element word being swapped. 3 names; complete object byte-identical.
- ACCEPT `libs/MSL/src/MSL_Common_Embedded/Math/math_ppc.c`: NaN payload tag. 1 names; complete object byte-identical.
- ACCEPT `libs/MSL/src/MSL_Common/wprintf.c`: wide digit and uppercase classification masks. 6 constants; complete object byte-identical.
- ACCEPT `libs/MSL/src/MSL_Common/printf.c`: formatter file arguments convert to void pointer implicitly. 3 casts; complete object byte-identical.
- ACCEPT `libs/MSL/src/MSL_Common/wprintf.c`: wmemcpy result converts to void pointer implicitly. 1 casts; complete object byte-identical.
- ACCEPT `libs/Runtime/src/NMWException.cpp`: constructed array cursor already has type char pointer. 1 casts; complete object byte-identical.
- REVERT `libs/RevoEX/src/ssl/ssl_api.c`: mutable IPC vector buffers convert to void pointer implicitly. 28 casts; compile failed.
- ACCEPT `src/bannerSound/AudioWavePlayer.cpp`: blocking OS queue receive and AX sample formats. 4 constants; complete object byte-identical.
- ACCEPT `src/bannerSound/AxAdpcmPlayer.cpp`: AX voice priority, type and sample formats. 7 constants; complete object byte-identical.
- REVERT `src/bannerSound/AudioWaveUtility.cpp`: AIFF length is already u32. 1 casts; object bytes changed.
- REVERT `src/bannerSound/AudioWaveUtility.cpp`: AIFF this pointer already has type WaveFileAiff pointer. 1 casts; object bytes changed.
- ACCEPT `src/bannerSound/AudioWavePlayer.cpp`: direct worker-running predicate. 1 control flow; complete object byte-identical.
- REVERT `src/bannerSound/AudioWavePlayer.cpp`: return thread-creation bool directly. 1 control flow; object bytes changed.
- ACCEPT `libs/EGG/src/core/eggThread.cpp`: stack allocation converts from void pointer with static_cast. 1 casts; complete object byte-identical.
- ACCEPT `libs/RVLFaceLib/src/RFL_MiddleDatabase.c`: database sizes already have type u16. 2 casts; complete object byte-identical.
- ACCEPT `libs/RVLFaceLib/src/RFL_NANDAccess.c`: NAND open mode already has type u8. 1 casts; complete object byte-identical.
- ACCEPT `libs/MSL/src/MSL_Common/wprintf.c`: decimal conversion buffer already has type char pointer. 2 casts; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/wad/wad.c`: remaining NAND access modes and WAD device error. 4 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/wad/wad.c`: NAND file and directory types. 12 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/wad/wad.c`: signed stream result and section offset already have type s32. 5 casts; complete object byte-identical.
- WITHDRAW `libs/RVL_SDK/src/nand/NANDOpenClose.c`: NAND block alignment mask. 1 constants; complete object byte-identical.
- REVERT `libs/RVLFaceLib/src/RFL_Controller.c`: return CRC validity comparison directly. 1 control flow; object bytes changed.
- REVERT `libs/RVLFaceLib/src/RFL_Database.c`: return character name predicate directly. 1 control flow; object bytes changed.
- REVERT `libs/RVLFaceLib/src/RFL_Database.c`: return CRC validity comparison directly. 1 control flow; object bytes changed.
- REVERT `libs/RVLFaceLib/src/RFL_System.c`: return library availability comparison directly. 1 control flow; object bytes changed.
- REVERT `libs/RVLFaceLib/src/RFL_System.c`: return missing-database comparison directly. 1 control flow; object bytes changed.
- REVERT `libs/RVLFaceLib/src/RFL_System.c`: return broken-database comparison directly. 1 control flow; object bytes changed.
- REVERT `libs/RVLFaceLib/src/RFL_System.c`: return critical-error comparison directly. 1 control flow; object bytes changed.
- REVERT `libs/RVL_SDK/src/card/CARDBlock.c`: allocation table field indices, free marker and system block count. 11 constants; compile failed.
- ACCEPT `libs/RVL_SDK/src/card/CARDNet.c`: initial public and copy-protection attribute mask. 1 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/card/CARDStatEx.c`: memory card filename size. 3 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/card/CARDDir.c`: successful CARD callback results. 3 constants; complete object byte-identical.
- Trial 77 had a missing semicolon in the proposed replacement. Its compile failure is not evidence against the named CARD constants; corrected and retried below.
- ACCEPT `libs/RVL_SDK/src/card/CARDBlock.c`: allocation table field indices, free marker and system block count. 13 constants; complete object byte-identical.
- ACCEPT `libs/RVL_SDK/src/card/CARDBios.c`: successful erase callback and return. 2 constants; complete object byte-identical.
- WITHDRAW trial 69. The stronger final pool check found the pre-existing extra `pretty pls?` string in NANDOpenClose. Its object was byte-identical to the baseline, but the original-pool gate was not clean. Restored the entire file to baseline; it is outside the retained diff.
- ACCEPT `libs/RVLFaceLib/src/RFL_System.c`: root heap uses the existing clear-allocation option. 1 constants; complete object byte-identical.
## Coverage and retained expressions
- Audited 157 C/C++ sources and 89 headers in the assigned paths for existing constants, same-type casts, boolean/control-flow simplifications, placeholder identifiers and literal member offsets. Header layouts and interfaces remain unchanged. OperaWWW has headers only. Assembly bodies and all excluded paths are unchanged.
- Source placeholder scan, excluding comments/literals and the descriptive stdio names `field_width` and `field_width_specified`, has zero remaining `unk`, `field_`, `tmp` or `arg` identifiers. Shared-header prototype names and varargs macro parameters remain at the interface boundary under the task's shared-header restriction. `fdlibm.h` exception operands `arg1` and `arg2` are public API members. Real function names were not renamed.
- Found no empty if/else branch eligible for inversion after removing comments, and no raw fixed member offset with an existing typed member. Allocation trailers, variable binary-file offsets, relocatable face-model buffers and card work-area blocks require their existing address arithmetic. No new structures or layout changes were introduced.
- Kept WAD's `-3002` literals. The header's uncertain `WAD_ERROR_NOCOPY` label does not describe missing-title uses. Other unmapped WAD errors and state numbers have no matching named constant. Existing home-button pane, animation, button and scene enums are already used.
- `RemoteSpk::isPlayReady`, `SimpleWavePlayer::makeThread`, both AIFF cast removals, and the RFL boolean-return ternaries changed object bytes. All such changes were restored. The combined AIFF and thread trials were split so the retained worker predicate was separated from the load-bearing expressions.
- RFL GX array casts and the CRC input cast remove const qualification, so removing them does not compile. SSL vector buffers target an aligned byte pointer rather than void pointer. Those casts remain. The isolated same-type RFL database-size casts were safe and retained.
- CARD sector-size casts remain because the member is signed. The rejected FAT-constant trial had a replacement typo, corrected in the subsequent successful trial.
- All retained substitutions use current repository declarations. No external decompilation was needed. Counts below count replaced expressions and renamed code identifier occurrences, excluding rejected or withdrawn trials.
## Final counts
38 source files, 61 accepted trials, 22 rejected or withdrawn trials.
| Category | Retained replacements |
| --- | ---: |
| constants | 121 |
| casts | 21 |
| control flow | 12 |
| member offsets | 0 |
| names | 324 |
## Changed files
| File | Constants | Casts | Control flow | Names |
| --- | ---: | ---: | ---: | ---: |
| `libs/EGG/src/core/eggAudioArcPlayerMgr.cpp` | 0 | 1 | 0 | 0 |
| `libs/EGG/src/core/eggAudioExpMgr.cpp` | 0 | 0 | 0 | 6 |
| `libs/EGG/src/core/eggThread.cpp` | 0 | 1 | 0 | 0 |
| `libs/MSL/src/MSL_Common/printf.c` | 0 | 3 | 0 | 29 |
| `libs/MSL/src/MSL_Common/qsort.c` | 0 | 0 | 0 | 3 |
| `libs/MSL/src/MSL_Common/scanf.c` | 0 | 0 | 0 | 6 |
| `libs/MSL/src/MSL_Common/wprintf.c` | 6 | 3 | 0 | 3 |
| `libs/MSL/src/MSL_Common_Embedded/Math/math_ppc.c` | 0 | 0 | 0 | 1 |
| `libs/MetroTRK/src/Export/mslsupp.c` | 0 | 0 | 2 | 0 |
| `libs/RVLFaceLib/src/RFL_Controller.c` | 0 | 1 | 0 | 0 |
| `libs/RVLFaceLib/src/RFL_HiddenDatabase.c` | 0 | 0 | 0 | 2 |
| `libs/RVLFaceLib/src/RFL_MakeTex.c` | 9 | 0 | 0 | 0 |
| `libs/RVLFaceLib/src/RFL_MiddleDatabase.c` | 0 | 2 | 1 | 7 |
| `libs/RVLFaceLib/src/RFL_Model.c` | 0 | 0 | 0 | 228 |
| `libs/RVLFaceLib/src/RFL_NANDAccess.c` | 0 | 1 | 0 | 4 |
| `libs/RVLFaceLib/src/RFL_NWC24.c` | 0 | 0 | 0 | 6 |
| `libs/RVLFaceLib/src/RFL_System.c` | 1 | 0 | 0 | 0 |
| `libs/RVL_SDK/src/card/CARDBios.c` | 6 | 1 | 0 | 0 |
| `libs/RVL_SDK/src/card/CARDBlock.c` | 16 | 0 | 0 | 0 |
| `libs/RVL_SDK/src/card/CARDDir.c` | 11 | 0 | 0 | 0 |
| `libs/RVL_SDK/src/card/CARDNet.c` | 1 | 0 | 0 | 0 |
| `libs/RVL_SDK/src/card/CARDOpen.c` | 3 | 0 | 0 | 0 |
| `libs/RVL_SDK/src/card/CARDStatEx.c` | 6 | 0 | 0 | 0 |
| `libs/RVL_SDK/src/card/CARDUnlock.c` | 4 | 0 | 0 | 0 |
| `libs/RVL_SDK/src/cntcache/cntcache.c` | 0 | 0 | 1 | 4 |
| `libs/RVL_SDK/src/dsp/dsp_task.c` | 0 | 0 | 0 | 5 |
| `libs/RVL_SDK/src/nand/NANDCore.c` | 0 | 0 | 0 | 11 |
| `libs/RVL_SDK/src/nand/NANDLogging.c` | 0 | 0 | 0 | 2 |
| `libs/RVL_SDK/src/nand/nand.c` | 0 | 0 | 0 | 5 |
| `libs/RVL_SDK/src/wad/wad.c` | 38 | 5 | 0 | 0 |
| `libs/RevoEX/src/nwc24/NWC24Manage.c` | 5 | 0 | 0 | 0 |
| `libs/Runtime/src/NMWException.cpp` | 0 | 1 | 0 | 0 |
| `src/bannerSound/AudioWavePlayer.cpp` | 4 | 0 | 1 | 2 |
| `src/bannerSound/AudioWaveUtility.cpp` | 0 | 0 | 6 | 0 |
| `src/bannerSound/AxAdpcmPlayer.cpp` | 7 | 0 | 0 | 0 |
| `src/homebutton/HBMBase.cpp` | 1 | 2 | 0 | 0 |
| `src/homebutton/HBMFrameController.cpp` | 0 | 0 | 1 | 0 |
| `src/homebutton/HBMGUIManager.cpp` | 3 | 0 | 0 | 0 |
## Final verification
- Clean, non-quick gate over all 38 changed units: `GATE PASS`.
- Owned instruction-exact functions: 569/569 -> 569/569.
- Owned objdiff functions: 569/569 -> 569/569.
- Owned matched code: 171776/171776 -> 171776/171776 bytes.
- Owned matched data: 21396/21396 -> 21396/21396 bytes.
- No remaining non-matching functions in the changed units. This is expression cleanup; the repository-wide incomplete status is unchanged.
- All 1,027 freshly rebuilt source objects match their baseline SHA-256, including every untouched translation unit. Entire objects were compared, covering code, data, relocations and symbol tables.
- Every unit, function and section in the new objdiff report equals the saved live baseline report. All owned pools equal the original pools.
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`.
- Zero regressions, new forbidden patterns or readability warnings. `git diff --check` passes. Assembly blocks, comments, headers, configuration, and excluded source paths are unchanged.
### Baseline byte check
```text
Source objects checked: 1027 changed: 0
Report unchanged: 1027 units, every function and section
DOL: 26116613f624061ba99c8d1a299aaa6efa85670d
Pools identical to original: 38
Retained counts: {'constants': 121, 'casts': 21, 'names': 324, 'control flow': 12}
Changed source files: 38
BASELINE BYTE GATE PASS
```
### Full gate output
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/EGG/src/core/eggAudioArcPlayerMgr] pool: IDENTICAL
[libs/EGG/src/core/eggAudioArcPlayerMgr] objdiff: code 1596/1596 data 88/88 functions 11/11 fuzzy 100.0000 linked code 1596
[libs/EGG/src/core/eggAudioArcPlayerMgr] instruction-exact functions: 11/11
[libs/EGG/src/core/eggAudioArcPlayerMgr] section .data size 88 match 100.0
[libs/EGG/src/core/eggAudioArcPlayerMgr] section .text size 1596 match 100.0
[libs/EGG/src/core/eggAudioArcPlayerMgr] baseline: code 1596/1596 data 88 functions 11 fuzzy 100.0000
[libs/EGG/src/core/eggAudioExpMgr] pool: IDENTICAL
[libs/EGG/src/core/eggAudioExpMgr] objdiff: code 524/524 data 120/120 functions 8/8 fuzzy 100.0000 linked code 524
[libs/EGG/src/core/eggAudioExpMgr] instruction-exact functions: 8/8
[libs/EGG/src/core/eggAudioExpMgr] section .data size 120 match 100.0
[libs/EGG/src/core/eggAudioExpMgr] section .text size 524 match 100.0
[libs/EGG/src/core/eggAudioExpMgr] baseline: code 524/524 data 120 functions 8 fuzzy 100.0000
[libs/EGG/src/core/eggThread] pool: IDENTICAL
[libs/EGG/src/core/eggThread] objdiff: code 888/888 data 40/40 functions 11/11 fuzzy 100.0000 linked code 888
[libs/EGG/src/core/eggThread] instruction-exact functions: 11/11
[libs/EGG/src/core/eggThread] section .bss size 16 match 100.0
[libs/EGG/src/core/eggThread] section .data size 24 match 100.0
[libs/EGG/src/core/eggThread] section .text size 888 match 100.0
[libs/EGG/src/core/eggThread] baseline: code 888/888 data 40 functions 11 fuzzy 100.0000
[libs/MSL/src/MSL_Common/printf] pool: IDENTICAL
[libs/MSL/src/MSL_Common/printf] objdiff: code 9556/9556 data 936/936 functions 16/16 fuzzy 100.0000 linked code 9556
[libs/MSL/src/MSL_Common/printf] instruction-exact functions: 16/16
[libs/MSL/src/MSL_Common/printf] section .data size 592 match 100.0
[libs/MSL/src/MSL_Common/printf] section .rodata size 48 match 100.0
[libs/MSL/src/MSL_Common/printf] section .sdata size 8 match 100.0
[libs/MSL/src/MSL_Common/printf] section .sdata2 size 8 match 100.0
[libs/MSL/src/MSL_Common/printf] section .text size 9556 match 100.0
[libs/MSL/src/MSL_Common/printf] section extab size 112 match 100.0
[libs/MSL/src/MSL_Common/printf] section extabindex size 168 match 100.0
[libs/MSL/src/MSL_Common/printf] baseline: code 9556/9556 data 936 functions 16 fuzzy 100.0000
[libs/MSL/src/MSL_Common/qsort] pool: IDENTICAL
[libs/MSL/src/MSL_Common/qsort] objdiff: code 368/368 data 20/20 functions 1/1 fuzzy 100.0000 linked code 368
[libs/MSL/src/MSL_Common/qsort] instruction-exact functions: 1/1
[libs/MSL/src/MSL_Common/qsort] section .text size 368 match 100.0
[libs/MSL/src/MSL_Common/qsort] section extab size 8 match 100.0
[libs/MSL/src/MSL_Common/qsort] section extabindex size 12 match 100.0
[libs/MSL/src/MSL_Common/qsort] baseline: code 368/368 data 20 functions 1 fuzzy 100.0000
[libs/MSL/src/MSL_Common/scanf] pool: IDENTICAL
[libs/MSL/src/MSL_Common/scanf] objdiff: code 5484/5484 data 388/388 functions 4/4 fuzzy 100.0000 linked code 5484
[libs/MSL/src/MSL_Common/scanf] instruction-exact functions: 4/4
[libs/MSL/src/MSL_Common/scanf] section .data size 288 match 100.0
[libs/MSL/src/MSL_Common/scanf] section .rodata size 40 match 100.0
[libs/MSL/src/MSL_Common/scanf] section .text size 5484 match 100.0
[libs/MSL/src/MSL_Common/scanf] section extab size 24 match 100.0
[libs/MSL/src/MSL_Common/scanf] section extabindex size 36 match 100.0
[libs/MSL/src/MSL_Common/scanf] baseline: code 5484/5484 data 388 functions 4 fuzzy 100.0000
[libs/MSL/src/MSL_Common/wprintf] pool: IDENTICAL
[libs/MSL/src/MSL_Common/wprintf] objdiff: code 8636/8636 data 836/836 functions 9/9 fuzzy 100.0000 linked code 8636
[libs/MSL/src/MSL_Common/wprintf] instruction-exact functions: 9/9
[libs/MSL/src/MSL_Common/wprintf] section .data size 680 match 100.0
[libs/MSL/src/MSL_Common/wprintf] section .rodata size 8 match 100.0
[libs/MSL/src/MSL_Common/wprintf] section .sdata2 size 8 match 100.0
[libs/MSL/src/MSL_Common/wprintf] section .text size 8636 match 100.0
[libs/MSL/src/MSL_Common/wprintf] section extab size 56 match 100.0
[libs/MSL/src/MSL_Common/wprintf] section extabindex size 84 match 100.0
[libs/MSL/src/MSL_Common/wprintf] baseline: code 8636/8636 data 836 functions 9 fuzzy 100.0000
[libs/MSL/src/MSL_Common_Embedded/Math/math_ppc] pool: IDENTICAL
[libs/MSL/src/MSL_Common_Embedded/Math/math_ppc] objdiff: code 4/4 data None/None functions 1/1 fuzzy 100.0000 linked code 4
[libs/MSL/src/MSL_Common_Embedded/Math/math_ppc] instruction-exact functions: 1/1
[libs/MSL/src/MSL_Common_Embedded/Math/math_ppc] section .text size 4 match 100.0
[libs/MSL/src/MSL_Common_Embedded/Math/math_ppc] baseline: code 4/4 data None functions 1 fuzzy 100.0000
[libs/MetroTRK/src/Export/mslsupp] pool: IDENTICAL
[libs/MetroTRK/src/Export/mslsupp] objdiff: code 376/376 data None/None functions 2/2 fuzzy 100.0000 linked code 376
[libs/MetroTRK/src/Export/mslsupp] instruction-exact functions: 2/2
[libs/MetroTRK/src/Export/mslsupp] section .text size 376 match 100.0
[libs/MetroTRK/src/Export/mslsupp] baseline: code 376/376 data None functions 2 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_Controller] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_Controller] objdiff: code 668/668 data 40/40 functions 2/2 fuzzy 100.0000 linked code 668
[libs/RVLFaceLib/src/RFL_Controller] instruction-exact functions: 2/2
[libs/RVLFaceLib/src/RFL_Controller] section .text size 668 match 100.0
[libs/RVLFaceLib/src/RFL_Controller] section extab size 16 match 100.0
[libs/RVLFaceLib/src/RFL_Controller] section extabindex size 24 match 100.0
[libs/RVLFaceLib/src/RFL_Controller] baseline: code 668/668 data 40 functions 2 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_HiddenDatabase] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_HiddenDatabase] objdiff: code 3356/3356 data 340/340 functions 20/20 fuzzy 100.0000 linked code 3356
[libs/RVLFaceLib/src/RFL_HiddenDatabase] instruction-exact functions: 20/20
[libs/RVLFaceLib/src/RFL_HiddenDatabase] section .text size 3356 match 100.0
[libs/RVLFaceLib/src/RFL_HiddenDatabase] section extab size 136 match 100.0
[libs/RVLFaceLib/src/RFL_HiddenDatabase] section extabindex size 204 match 100.0
[libs/RVLFaceLib/src/RFL_HiddenDatabase] baseline: code 3356/3356 data 340 functions 20 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_MakeTex] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_MakeTex] objdiff: code 10396/10396 data 544/544 functions 10/10 fuzzy 100.0000 linked code 10396
[libs/RVLFaceLib/src/RFL_MakeTex] instruction-exact functions: 10/10
[libs/RVLFaceLib/src/RFL_MakeTex] section .rodata size 192 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] section .sdata2 size 192 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] section .text size 10396 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] section extab size 64 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] section extabindex size 96 match 100.0
[libs/RVLFaceLib/src/RFL_MakeTex] baseline: code 10396/10396 data 544 functions 10 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_MiddleDatabase] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_MiddleDatabase] objdiff: code 3648/3648 data 200/200 functions 13/13 fuzzy 100.0000 linked code 3648
[libs/RVLFaceLib/src/RFL_MiddleDatabase] instruction-exact functions: 13/13
[libs/RVLFaceLib/src/RFL_MiddleDatabase] section .text size 3648 match 100.0
[libs/RVLFaceLib/src/RFL_MiddleDatabase] section extab size 80 match 100.0
[libs/RVLFaceLib/src/RFL_MiddleDatabase] section extabindex size 120 match 100.0
[libs/RVLFaceLib/src/RFL_MiddleDatabase] baseline: code 3648/3648 data 200 functions 13 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_Model] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_Model] objdiff: code 7788/7788 data 552/552 functions 15/15 fuzzy 100.0000 linked code 7788
[libs/RVLFaceLib/src/RFL_Model] instruction-exact functions: 15/15
[libs/RVLFaceLib/src/RFL_Model] section .data size 16 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section .rodata size 272 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section .sdata2 size 64 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section .text size 7788 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section extab size 80 match 100.0
[libs/RVLFaceLib/src/RFL_Model] section extabindex size 120 match 100.0
[libs/RVLFaceLib/src/RFL_Model] baseline: code 7788/7788 data 552 functions 15 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_NANDAccess] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_NANDAccess] objdiff: code 13460/13460 data 684/684 functions 28/28 fuzzy 100.0000 linked code 13460
[libs/RVLFaceLib/src/RFL_NANDAccess] instruction-exact functions: 28/28
[libs/RVLFaceLib/src/RFL_NANDAccess] section .data size 112 match 100.0
[libs/RVLFaceLib/src/RFL_NANDAccess] section .sbss2 size 8 match 100.0
[libs/RVLFaceLib/src/RFL_NANDAccess] section .sdata size 16 match 100.0
[libs/RVLFaceLib/src/RFL_NANDAccess] section .sdata2 size 8 match 100.0
[libs/RVLFaceLib/src/RFL_NANDAccess] section .text size 13460 match 100.0
[libs/RVLFaceLib/src/RFL_NANDAccess] section extab size 216 match 100.0
[libs/RVLFaceLib/src/RFL_NANDAccess] section extabindex size 324 match 100.0
[libs/RVLFaceLib/src/RFL_NANDAccess] baseline: code 13460/13460 data 684 functions 28 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_NWC24] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_NWC24] objdiff: code 2992/2992 data 552/552 functions 5/5 fuzzy 100.0000 linked code 2992
[libs/RVLFaceLib/src/RFL_NWC24] instruction-exact functions: 5/5
[libs/RVLFaceLib/src/RFL_NWC24] section .data size 472 match 100.0
[libs/RVLFaceLib/src/RFL_NWC24] section .text size 2992 match 100.0
[libs/RVLFaceLib/src/RFL_NWC24] section extab size 32 match 100.0
[libs/RVLFaceLib/src/RFL_NWC24] section extabindex size 48 match 100.0
[libs/RVLFaceLib/src/RFL_NWC24] baseline: code 2992/2992 data 552 functions 5 fuzzy 100.0000
[libs/RVLFaceLib/src/RFL_System] pool: IDENTICAL
[libs/RVLFaceLib/src/RFL_System] objdiff: code 2880/2880 data 252/252 functions 28/28 fuzzy 100.0000 linked code 2880
[libs/RVLFaceLib/src/RFL_System] instruction-exact functions: 28/28
[libs/RVLFaceLib/src/RFL_System] section .data size 88 match 100.0
[libs/RVLFaceLib/src/RFL_System] section .sbss size 16 match 100.0
[libs/RVLFaceLib/src/RFL_System] section .sdata size 8 match 100.0
[libs/RVLFaceLib/src/RFL_System] section .text size 2880 match 100.0
[libs/RVLFaceLib/src/RFL_System] section extab size 56 match 100.0
[libs/RVLFaceLib/src/RFL_System] section extabindex size 84 match 100.0
[libs/RVLFaceLib/src/RFL_System] baseline: code 2880/2880 data 252 functions 28 fuzzy 100.0000
[libs/RVL_SDK/src/card/CARDBios] pool: IDENTICAL
[libs/RVL_SDK/src/card/CARDBios] objdiff: code 5836/5836 data 728/728 functions 29/29 fuzzy 100.0000 linked code 5836
[libs/RVL_SDK/src/card/CARDBios] instruction-exact functions: 29/29
[libs/RVL_SDK/src/card/CARDBios] section .bss size 600 match 100.0
[libs/RVL_SDK/src/card/CARDBios] section .data size 112 match 100.0
[libs/RVL_SDK/src/card/CARDBios] section .sbss size 8 match 100.0
[libs/RVL_SDK/src/card/CARDBios] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/card/CARDBios] section .text size 5836 match 100.0
[libs/RVL_SDK/src/card/CARDBios] baseline: code 5836/5836 data 728 functions 29 fuzzy 100.0000
[libs/RVL_SDK/src/card/CARDBlock] pool: IDENTICAL
[libs/RVL_SDK/src/card/CARDBlock] objdiff: code 1224/1224 data None/None functions 6/6 fuzzy 100.0000 linked code 1224
[libs/RVL_SDK/src/card/CARDBlock] instruction-exact functions: 6/6
[libs/RVL_SDK/src/card/CARDBlock] section .text size 1224 match 100.0
[libs/RVL_SDK/src/card/CARDBlock] baseline: code 1224/1224 data None functions 6 fuzzy 100.0000
[libs/RVL_SDK/src/card/CARDDir] pool: IDENTICAL
[libs/RVL_SDK/src/card/CARDDir] objdiff: code 604/604 data None/None functions 4/4 fuzzy 100.0000 linked code 604
[libs/RVL_SDK/src/card/CARDDir] instruction-exact functions: 4/4
[libs/RVL_SDK/src/card/CARDDir] section .text size 604 match 100.0
[libs/RVL_SDK/src/card/CARDDir] baseline: code 604/604 data None functions 4 fuzzy 100.0000
[libs/RVL_SDK/src/card/CARDNet] pool: IDENTICAL
[libs/RVL_SDK/src/card/CARDNet] objdiff: code None/None data 8/8 functions 0/None fuzzy 100.0000 linked code 0
[libs/RVL_SDK/src/card/CARDNet] instruction-exact functions: 0/0
[libs/RVL_SDK/src/card/CARDNet] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/card/CARDNet] baseline: code None/None data 8 functions 0 fuzzy 100.0000
[libs/RVL_SDK/src/card/CARDOpen] pool: IDENTICAL
[libs/RVL_SDK/src/card/CARDOpen] objdiff: code 1320/1320 data None/None functions 6/6 fuzzy 100.0000 linked code 1320
[libs/RVL_SDK/src/card/CARDOpen] instruction-exact functions: 6/6
[libs/RVL_SDK/src/card/CARDOpen] section .text size 1320 match 100.0
[libs/RVL_SDK/src/card/CARDOpen] baseline: code 1320/1320 data None functions 6 fuzzy 100.0000
[libs/RVL_SDK/src/card/CARDStatEx] pool: IDENTICAL
[libs/RVL_SDK/src/card/CARDStatEx] objdiff: code 924/924 data None/None functions 3/3 fuzzy 100.0000 linked code 924
[libs/RVL_SDK/src/card/CARDStatEx] instruction-exact functions: 3/3
[libs/RVL_SDK/src/card/CARDStatEx] section .text size 924 match 100.0
[libs/RVL_SDK/src/card/CARDStatEx] baseline: code 924/924 data None functions 3 fuzzy 100.0000
[libs/RVL_SDK/src/card/CARDUnlock] pool: IDENTICAL
[libs/RVL_SDK/src/card/CARDUnlock] objdiff: code 3432/3432 data 360/360 functions 6/6 fuzzy 100.0000 linked code 3432
[libs/RVL_SDK/src/card/CARDUnlock] instruction-exact functions: 6/6
[libs/RVL_SDK/src/card/CARDUnlock] section .data size 352 match 100.0
[libs/RVL_SDK/src/card/CARDUnlock] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/card/CARDUnlock] section .text size 3432 match 100.0
[libs/RVL_SDK/src/card/CARDUnlock] baseline: code 3432/3432 data 360 functions 6 fuzzy 100.0000
[libs/RVL_SDK/src/cntcache/cntcache] pool: IDENTICAL
[libs/RVL_SDK/src/cntcache/cntcache] objdiff: code 1828/1828 data 280/280 functions 5/5 fuzzy 100.0000 linked code 1828
[libs/RVL_SDK/src/cntcache/cntcache] instruction-exact functions: 5/5
[libs/RVL_SDK/src/cntcache/cntcache] section .bss size 24 match 100.0
[libs/RVL_SDK/src/cntcache/cntcache] section .data size 232 match 100.0
[libs/RVL_SDK/src/cntcache/cntcache] section .sbss size 16 match 100.0
[libs/RVL_SDK/src/cntcache/cntcache] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/cntcache/cntcache] section .text size 1828 match 100.0
[libs/RVL_SDK/src/cntcache/cntcache] baseline: code 1828/1828 data 280 functions 5 fuzzy 100.0000
[libs/RVL_SDK/src/dsp/dsp_task] pool: IDENTICAL
[libs/RVL_SDK/src/dsp/dsp_task] objdiff: code 2196/2196 data 344/344 functions 5/5 fuzzy 100.0000 linked code 2196
[libs/RVL_SDK/src/dsp/dsp_task] instruction-exact functions: 5/5
[libs/RVL_SDK/src/dsp/dsp_task] section .data size 320 match 100.0
[libs/RVL_SDK/src/dsp/dsp_task] section .sbss size 24 match 100.0
[libs/RVL_SDK/src/dsp/dsp_task] section .text size 2196 match 100.0
[libs/RVL_SDK/src/dsp/dsp_task] baseline: code 2196/2196 data 344 functions 5 fuzzy 100.0000
[libs/RVL_SDK/src/nand/NANDCore] pool: IDENTICAL
[libs/RVL_SDK/src/nand/NANDCore] objdiff: code 4472/4472 data 800/800 functions 26/26 fuzzy 100.0000 linked code 4472
[libs/RVL_SDK/src/nand/NANDCore] instruction-exact functions: 26/26
[libs/RVL_SDK/src/nand/NANDCore] section .bss size 96 match 100.0
[libs/RVL_SDK/src/nand/NANDCore] section .data size 336 match 100.0
[libs/RVL_SDK/src/nand/NANDCore] section .rodata size 328 match 100.0
[libs/RVL_SDK/src/nand/NANDCore] section .sbss size 8 match 100.0
[libs/RVL_SDK/src/nand/NANDCore] section .sdata size 32 match 100.0
[libs/RVL_SDK/src/nand/NANDCore] section .text size 4472 match 100.0
[libs/RVL_SDK/src/nand/NANDCore] baseline: code 4472/4472 data 800 functions 26 fuzzy 100.0000
[libs/RVL_SDK/src/nand/NANDLogging] pool: IDENTICAL
[libs/RVL_SDK/src/nand/NANDLogging] objdiff: code 2228/2228 data 1048/1048 functions 4/4 fuzzy 100.0000 linked code 2228
[libs/RVL_SDK/src/nand/NANDLogging] instruction-exact functions: 4/4
[libs/RVL_SDK/src/nand/NANDLogging] section .bss size 768 match 100.0
[libs/RVL_SDK/src/nand/NANDLogging] section .data size 264 match 100.0
[libs/RVL_SDK/src/nand/NANDLogging] section .sbss size 8 match 100.0
[libs/RVL_SDK/src/nand/NANDLogging] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/nand/NANDLogging] section .text size 2228 match 100.0
[libs/RVL_SDK/src/nand/NANDLogging] baseline: code 2228/2228 data 1048 functions 4 fuzzy 100.0000
[libs/RVL_SDK/src/nand/nand] pool: IDENTICAL
[libs/RVL_SDK/src/nand/nand] objdiff: code 5608/5608 data 8/8 functions 37/37 fuzzy 100.0000 linked code 5608
[libs/RVL_SDK/src/nand/nand] instruction-exact functions: 37/37
[libs/RVL_SDK/src/nand/nand] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/nand/nand] section .text size 5608 match 100.0
[libs/RVL_SDK/src/nand/nand] baseline: code 5608/5608 data 8 functions 37 fuzzy 100.0000
[libs/RVL_SDK/src/wad/wad] pool: IDENTICAL
[libs/RVL_SDK/src/wad/wad] objdiff: code 24500/24500 data 528/528 functions 40/40 fuzzy 100.0000 linked code 24500
[libs/RVL_SDK/src/wad/wad] instruction-exact functions: 40/40
[libs/RVL_SDK/src/wad/wad] section .data size 464 match 100.0
[libs/RVL_SDK/src/wad/wad] section .sdata size 64 match 100.0
[libs/RVL_SDK/src/wad/wad] section .text size 24500 match 100.0
[libs/RVL_SDK/src/wad/wad] baseline: code 24500/24500 data 528 functions 40 fuzzy 100.0000
[libs/RevoEX/src/nwc24/NWC24Manage] pool: IDENTICAL
[libs/RevoEX/src/nwc24/NWC24Manage] objdiff: code 3784/3784 data 336/336 functions 21/21 fuzzy 100.0000 linked code 3784
[libs/RevoEX/src/nwc24/NWC24Manage] instruction-exact functions: 21/21
[libs/RevoEX/src/nwc24/NWC24Manage] section .bss size 32 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] section .data size 272 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] section .sbss size 24 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] section .sdata size 8 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] section .text size 3784 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] baseline: code 3784/3784 data 336 functions 21 fuzzy 100.0000
[libs/Runtime/src/NMWException] pool: IDENTICAL
[libs/Runtime/src/NMWException] objdiff: code 816/816 data 112/112 functions 4/4 fuzzy 100.0000 linked code 816
[libs/Runtime/src/NMWException] instruction-exact functions: 4/4
[libs/Runtime/src/NMWException] section .text size 816 match 100.0
[libs/Runtime/src/NMWException] section extab size 64 match 100.0
[libs/Runtime/src/NMWException] section extabindex size 48 match 100.0
[libs/Runtime/src/NMWException] baseline: code 816/816 data 112 functions 4 fuzzy 100.0000
[src/bannerSound/AudioWavePlayer] pool: IDENTICAL
[src/bannerSound/AudioWavePlayer] objdiff: code 3288/3288 data 80/80 functions 23/23 fuzzy 100.0000 linked code 3288
[src/bannerSound/AudioWavePlayer] instruction-exact functions: 23/23
[src/bannerSound/AudioWavePlayer] section .data size 64 match 100.0
[src/bannerSound/AudioWavePlayer] section .sdata2 size 16 match 100.0
[src/bannerSound/AudioWavePlayer] section .text size 3288 match 100.0
[src/bannerSound/AudioWavePlayer] baseline: code 3288/3288 data 80 functions 23 fuzzy 100.0000
[src/bannerSound/AudioWaveUtility] pool: IDENTICAL
[src/bannerSound/AudioWaveUtility] objdiff: code 5496/5496 data 520/520 functions 33/33 fuzzy 100.0000 linked code 5496
[src/bannerSound/AudioWaveUtility] instruction-exact functions: 33/33
[src/bannerSound/AudioWaveUtility] section .data size 416 match 100.0
[src/bannerSound/AudioWaveUtility] section .rodata size 24 match 100.0
[src/bannerSound/AudioWaveUtility] section .sdata size 8 match 100.0
[src/bannerSound/AudioWaveUtility] section .sdata2 size 72 match 100.0
[src/bannerSound/AudioWaveUtility] section .text size 5496 match 100.0
[src/bannerSound/AudioWaveUtility] baseline: code 5496/5496 data 520 functions 33 fuzzy 100.0000
[src/bannerSound/AxAdpcmPlayer] pool: IDENTICAL
[src/bannerSound/AxAdpcmPlayer] objdiff: code 3088/3088 data 6476/6476 functions 13/13 fuzzy 100.0000 linked code 3088
[src/bannerSound/AxAdpcmPlayer] instruction-exact functions: 13/13
[src/bannerSound/AxAdpcmPlayer] section .bss size 6400 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .ctors size 4 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .data size 32 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .sbss size 16 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .sdata size 8 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .sdata2 size 16 match 100.0
[src/bannerSound/AxAdpcmPlayer] section .text size 3088 match 100.0
[src/bannerSound/AxAdpcmPlayer] baseline: code 3088/3088 data 6476 functions 13 fuzzy 100.0000
[src/homebutton/HBMBase] pool: IDENTICAL
[src/homebutton/HBMBase] objdiff: code 23608/23608 data 3800/3800 functions 76/76 fuzzy 100.0000 linked code 23608
[src/homebutton/HBMBase] instruction-exact functions: 76/76
[src/homebutton/HBMBase] section .bss size 16 match 100.0
[src/homebutton/HBMBase] section .data size 2784 match 100.0
[src/homebutton/HBMBase] section .rodata size 688 match 100.0
[src/homebutton/HBMBase] section .sbss size 8 match 100.0
[src/homebutton/HBMBase] section .sdata size 176 match 100.0
[src/homebutton/HBMBase] section .sdata2 size 128 match 100.0
[src/homebutton/HBMBase] section .text size 23608 match 100.0
[src/homebutton/HBMBase] baseline: code 23608/23608 data 3800 functions 76 fuzzy 100.0000
[src/homebutton/HBMFrameController] pool: IDENTICAL
[src/homebutton/HBMFrameController] objdiff: code 392/392 data 8/8 functions 3/3 fuzzy 100.0000 linked code 392
[src/homebutton/HBMFrameController] instruction-exact functions: 3/3
[src/homebutton/HBMFrameController] section .sdata2 size 8 match 100.0
[src/homebutton/HBMFrameController] section .text size 392 match 100.0
[src/homebutton/HBMFrameController] baseline: code 392/392 data 8 functions 3 fuzzy 100.0000
[src/homebutton/HBMGUIManager] pool: IDENTICAL
[src/homebutton/HBMGUIManager] objdiff: code 4512/4512 data 368/368 functions 41/41 fuzzy 100.0000 linked code 4512
[src/homebutton/HBMGUIManager] instruction-exact functions: 41/41
[src/homebutton/HBMGUIManager] section .data size 344 match 100.0
[src/homebutton/HBMGUIManager] section .sbss size 8 match 100.0
[src/homebutton/HBMGUIManager] section .sdata2 size 16 match 100.0
[src/homebutton/HBMGUIManager] section .text size 4512 match 100.0
[src/homebutton/HBMGUIManager] baseline: code 4512/4512 data 368 functions 41 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 93.96723 -> 93.96723
global fuzzy_match_percent: 99.81488 -> 99.81488
global complete_code_percent: 80.08451 -> 80.08451
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
## Local source commits
- `06b650819bce9944da086edf20d1dede741614d9`: clarify sdk constants and callback names (14 files).
- `925037e3d9e18b9a7226129e0d6a5aa44dccf623`: clarify face library expressions and resource names (8 files).
- `7a5d819bfa9c676160cc712b23d568e40b76ef1f`: simplify egg and home menu expressions (9 files).
- `c2804dd96224efc7d958ccdee937d71eb840d66a`: clarify runtime formatting expressions and locals (7 files).