Compare commits

...

1 Commits

Author SHA1 Message Date
coah
e2741b31e2 refactor: give generic tmp/arg locals descriptive names (rx31) (worker 603061bb) 2026-10-05 12:26:24 +00:00
25 changed files with 1480 additions and 843 deletions

View File

@@ -25,16 +25,16 @@ namespace nw4r {
}
VEC4* VEC4Transform(VEC4* pOut, const MTX44* pM, const VEC4* pV) {
VEC4 tmp;
tmp.x = pM->_00 * pV->x + pM->_01 * pV->y + pM->_02 * pV->z + pM->_03 * pV->w;
tmp.y = pM->_10 * pV->x + pM->_11 * pV->y + pM->_12 * pV->z + pM->_13 * pV->w;
tmp.z = pM->_20 * pV->x + pM->_21 * pV->y + pM->_22 * pV->z + pM->_23 * pV->w;
tmp.w = pM->_30 * pV->x + pM->_31 * pV->y + pM->_32 * pV->z + pM->_33 * pV->w;
VEC4 transformed;
transformed.x = pM->_00 * pV->x + pM->_01 * pV->y + pM->_02 * pV->z + pM->_03 * pV->w;
transformed.y = pM->_10 * pV->x + pM->_11 * pV->y + pM->_12 * pV->z + pM->_13 * pV->w;
transformed.z = pM->_20 * pV->x + pM->_21 * pV->y + pM->_22 * pV->z + pM->_23 * pV->w;
transformed.w = pM->_30 * pV->x + pM->_31 * pV->y + pM->_32 * pV->z + pM->_33 * pV->w;
pOut->x = tmp.x;
pOut->y = tmp.y;
pOut->z = tmp.z;
pOut->w = tmp.w;
pOut->x = transformed.x;
pOut->y = transformed.y;
pOut->z = transformed.z;
pOut->w = transformed.w;
return pOut;
}
} // namespace math

View File

@@ -131,50 +131,50 @@ static s32 ReadArrayUnlock(s32 chan, u32 data, void* rbuf, s32 rlen, int mode) {
}
static u32 GetInitVal(void) {
u32 tmp;
u32 unlockAddress;
u32 tick;
tick = OSGetTick();
CARDSrand(tick);
tmp = 0x7fec8000;
tmp |= CARDRand();
tmp &= 0xfffff000;
return tmp;
unlockAddress = 0x7fec8000;
unlockAddress |= CARDRand();
unlockAddress &= 0xfffff000;
return unlockAddress;
}
static s32 DummyLen(void) {
u32 tick;
u32 wk;
s32 tmp;
u32 max;
u32 seedShift;
s32 extraReadLength;
u32 retryCount;
wk = 1;
max = 0;
seedShift = 1;
retryCount = 0;
tick = OSGetTick();
CARDSrand(tick);
tmp = CARDRand();
tmp &= 0x0000001f;
tmp += 1;
while ((tmp < 4) && (max < 10)) {
extraReadLength = CARDRand();
extraReadLength &= 0x0000001f;
extraReadLength += 1;
while ((extraReadLength < 4) && (retryCount < 10)) {
tick = OSGetTick();
tmp = (s32)(tick << wk);
wk++;
if (wk > 16) {
wk = 1;
extraReadLength = (s32)(tick << seedShift);
seedShift++;
if (seedShift > 16) {
seedShift = 1;
}
CARDSrand((u32)tmp);
tmp = CARDRand();
tmp &= 0x0000001f;
tmp += 1;
max++;
CARDSrand((u32)extraReadLength);
extraReadLength = CARDRand();
extraReadLength &= 0x0000001f;
extraReadLength += 1;
retryCount++;
}
if (tmp < 4) {
tmp = 4;
if (extraReadLength < 4) {
extraReadLength = 4;
}
return tmp;
return extraReadLength;
}
s32 __CARDUnlock(s32 chan, u8 flashID[12]) {

View File

@@ -31,21 +31,21 @@ void DSPSendMailToDSP(u32 mail) {
void DSPAssertInt() {
BOOL old;
u16 tmp;
u16 controlStatus;
old = OSDisableInterrupts();
tmp = DSP_READ_REG(DSP_CONTROL_STATUS);
CLEAR_FLAG(tmp, 0xA8);
SET_FLAG(tmp, 2);
DSP_WRITE_REG(DSP_CONTROL_STATUS, tmp);
controlStatus = DSP_READ_REG(DSP_CONTROL_STATUS);
CLEAR_FLAG(controlStatus, 0xA8);
SET_FLAG(controlStatus, 2);
DSP_WRITE_REG(DSP_CONTROL_STATUS, controlStatus);
OSRestoreInterrupts(old);
}
void DSPInit() {
BOOL old;
u16 tmp;
u16 controlStatus;
__DSP_debug_printf("DSPInit(): Build Date: %s %s\n", "Apr 20 2010", "11:19:06");
@@ -60,15 +60,15 @@ void DSPInit() {
__OSUnmaskInterrupts(OS_INTERRUPTMASK_DSP_DSP);
// Reset DSP
tmp = DSP_READ_REG(DSP_CONTROL_STATUS);
CLEAR_FLAG(tmp, ((1 << DSP_CONTROL_STATUS_AIDINT) | (1 << DSP_CONTROL_STATUS_ARINT) | (1 << DSP_CONTROL_STATUS_DSPINT)));
SET_FLAG(tmp, (1 << DSP_CONTROL_STATUS_RESET));
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) | (1 << DSP_CONTROL_STATUS_DSPINT)));
SET_FLAG(controlStatus, (1 << DSP_CONTROL_STATUS_RESET));
DSP_WRITE_REG(DSP_CONTROL_STATUS, controlStatus);
tmp = DSP_READ_REG(DSP_CONTROL_STATUS);
CLEAR_FLAG(tmp, ((1 << DSP_CONTROL_STATUS_AIDINT) | (1 << DSP_CONTROL_STATUS_ARINT) | (1 << DSP_CONTROL_STATUS_DSPINT)) |
controlStatus = DSP_READ_REG(DSP_CONTROL_STATUS);
CLEAR_FLAG(controlStatus, ((1 << DSP_CONTROL_STATUS_AIDINT) | (1 << DSP_CONTROL_STATUS_ARINT) | (1 << DSP_CONTROL_STATUS_DSPINT)) |
(1 << DSP_CONTROL_STATUS_HALT));
DSP_WRITE_REG(DSP_CONTROL_STATUS, tmp);
DSP_WRITE_REG(DSP_CONTROL_STATUS, controlStatus);
__DSP_first_task = __DSP_last_task = __DSP_curr_task = __DSP_tmp_task = NULL;

View File

@@ -20,21 +20,21 @@ enum {
NAND_STATE_READ_FILE,
NAND_STATE_READ_FILE_2,
NAND_STATE_WRITE_FILE,
NAND_STATE_9,
NAND_STATE_10,
NAND_STATE_11,
NAND_STATE_12,
NAND_STATE_13,
NAND_STATE_14,
NAND_STATE_OPEN_COMPLETE,
NAND_STATE_CLOSE_TEMP_FILE,
NAND_STATE_CLOSE_ORIGINAL_FILE,
NAND_STATE_RENAME_TEMP_FILE,
NAND_STATE_DELETE_TEMP_DIR,
NAND_STATE_CLOSE_COMPLETE,
};
static void nandOpenCallback(ISFSError result, void* arg);
static void nandSafeOpenCallback(ISFSError result, void* arg);
static void nandReadOpenCallback(ISFSError result, void* arg);
static void nandOpenCallback(ISFSError result, void* callbackContext);
static void nandSafeOpenCallback(ISFSError result, void* callbackContext);
static void nandReadOpenCallback(ISFSError result, void* callbackContext);
static void nandCloseCallback(ISFSError result, void* arg);
static void nandSafeCloseCallback(ISFSError result, void* arg);
static void nandReadCloseCallback(ISFSError result, void* arg);
static void nandCloseCallback(ISFSError result, void* callbackContext);
static void nandSafeCloseCallback(ISFSError result, void* callbackContext);
static void nandReadCloseCallback(ISFSError result, void* callbackContext);
static s32 nandSafeClose(NANDFileInfo* info, BOOL isSimple);
static s32 nandSafeCloseAsync(NANDFileInfo* info, NANDCallback callback, NANDCommandBlock* block, BOOL isSimple);
@@ -151,8 +151,8 @@ s32 NANDPrivateOpenAsync(const char* path, NANDFileInfo* info, u8 accType, NANDC
return nandConvertErrorCode(fd);
}
static void nandOpenCallback(ISFSError result, void* arg) {
NANDCommandBlock* block = (NANDCommandBlock*)arg;
static void nandOpenCallback(ISFSError result, void* callbackContext) {
NANDCommandBlock* block = (NANDCommandBlock*)callbackContext;
if (result >= ISFS_ERROR_OK) {
((NANDFileInfo*)block->fileInfo)->fileDescriptor = result;
@@ -469,8 +469,8 @@ s32 nandSafeOpenAsync(const char* path, NANDFileInfo* info, u8 accType, void* bu
}
}
void nandSafeOpenCallback(ISFSError result, void* arg) {
NANDCommandBlock* block = (NANDCommandBlock*)arg;
void nandSafeOpenCallback(ISFSError result, void* callbackContext) {
NANDCommandBlock* block = (NANDCommandBlock*)callbackContext;
if (result >= ISFS_ERROR_OK || (result == ISFS_ERROR_EXISTS && block->state == NAND_STATE_NONE)) {
NANDFileInfo* info = block->fileInfo;
@@ -493,14 +493,14 @@ void nandSafeOpenCallback(ISFSError result, void* arg) {
if (block->state == NAND_STATE_GET_ATTR) {
ret = ISFS_GetAttrAsync(info->origPath, &block->ownerId, &block->groupId, &block->attr, &block->ownerAcc, &block->groupAcc,
&block->othersAcc, nandSafeOpenCallback, arg);
&block->othersAcc, nandSafeOpenCallback, callbackContext);
} else if (block->state == NAND_STATE_OPEN_FILE) {
ret = ISFS_OpenAsync(info->origPath, ISFS_ACCESS_READ, nandSafeOpenCallback, arg);
ret = ISFS_OpenAsync(info->origPath, ISFS_ACCESS_READ, nandSafeOpenCallback, callbackContext);
} else if (block->state == NAND_STATE_CREATE_TEMP_DIR) {
char tmpDir[NAND_MAX_PATH];
block->uniqueNo = nandGetUniqueNumber();
sprintf(tmpDir, "%s/%08x", "/tmp/sys", block->uniqueNo);
ret = ISFS_CreateDirAsync(tmpDir, 0, ISFS_ACCESS_RW, ISFS_ACCESS_NONE, ISFS_ACCESS_NONE, nandSafeOpenCallback, arg);
ret = ISFS_CreateDirAsync(tmpDir, 0, ISFS_ACCESS_RW, ISFS_ACCESS_NONE, ISFS_ACCESS_NONE, nandSafeOpenCallback, callbackContext);
} else if (block->state == NAND_STATE_CREATE_TEMP) {
char filename[13];
nandGetRelativeName(filename, info->origPath);
@@ -512,14 +512,14 @@ void nandSafeOpenCallback(ISFSError result, void* arg) {
sprintf(info->tmpPath, "%s/%s", "/tmp/sys", filename);
}
ret = ISFS_CreateFileAsync(info->tmpPath, block->attr, block->ownerAcc, block->groupAcc, block->othersAcc, nandSafeOpenCallback, arg);
ret = ISFS_CreateFileAsync(info->tmpPath, block->attr, block->ownerAcc, block->groupAcc, block->othersAcc, nandSafeOpenCallback, callbackContext);
} else if (block->state == NAND_STATE_OPEN_TEMP_FILE) {
info->stage = NAND_STATE_CREATE_TEMP;
if (info->accType == ISFS_ACCESS_WRITE) {
ret = ISFS_OpenAsync(info->tmpPath, ISFS_ACCESS_WRITE, nandSafeOpenCallback, arg);
ret = ISFS_OpenAsync(info->tmpPath, ISFS_ACCESS_WRITE, nandSafeOpenCallback, callbackContext);
} else if (info->accType == ISFS_ACCESS_RW) {
ret = ISFS_OpenAsync(info->tmpPath, ISFS_ACCESS_RW, nandSafeOpenCallback, arg);
ret = ISFS_OpenAsync(info->tmpPath, ISFS_ACCESS_RW, nandSafeOpenCallback, callbackContext);
} else {
ret = ISFS_ERROR_UNKNOWN;
}
@@ -527,17 +527,17 @@ void nandSafeOpenCallback(ISFSError result, void* arg) {
info->fileDescriptor = result;
info->stage = 5;
block->state = NAND_STATE_READ_FILE_2;
ret = ISFS_ReadAsync(info->origFd, block->copyBuf, block->bufLength, nandSafeOpenCallback, arg);
ret = ISFS_ReadAsync(info->origFd, block->copyBuf, block->bufLength, nandSafeOpenCallback, callbackContext);
} else if (block->state == NAND_STATE_READ_FILE_2) {
ret = ISFS_ReadAsync(info->origFd, block->copyBuf, block->bufLength, nandSafeOpenCallback, arg);
ret = ISFS_ReadAsync(info->origFd, block->copyBuf, block->bufLength, nandSafeOpenCallback, callbackContext);
} else if (block->state == NAND_STATE_WRITE_FILE) {
if (result > 0) {
block->state = NAND_STATE_READ_FILE;
ret = ISFS_WriteAsync(info->fileDescriptor, block->copyBuf, (u32)result, nandSafeOpenCallback, arg);
ret = ISFS_WriteAsync(info->fileDescriptor, block->copyBuf, (u32)result, nandSafeOpenCallback, callbackContext);
} else if (result == ISFS_ERROR_OK) {
ret = ISFS_SeekAsync(info->fileDescriptor, 0, 0, nandSafeOpenCallback, arg);
ret = ISFS_SeekAsync(info->fileDescriptor, 0, 0, nandSafeOpenCallback, callbackContext);
}
} else if (block->state == NAND_STATE_9) {
} else if (block->state == NAND_STATE_OPEN_COMPLETE) {
if (result == ISFS_ERROR_OK) {
if (!block->simpleFlag) {
info->mark = 3;
@@ -561,8 +561,8 @@ void nandSafeOpenCallback(ISFSError result, void* arg) {
}
}
void nandReadOpenCallback(ISFSError result, void* arg) {
NANDCommandBlock* block = (NANDCommandBlock*)arg;
void nandReadOpenCallback(ISFSError result, void* callbackContext) {
NANDCommandBlock* block = (NANDCommandBlock*)callbackContext;
if (result >= 0) {
((NANDFileInfo*)block->fileInfo)->fileDescriptor = result;
@@ -604,7 +604,7 @@ s32 nandSafeCloseAsync(NANDFileInfo* info, NANDCallback callback, NANDCommandBlo
} else if (info->accType == ISFS_ACCESS_WRITE || info->accType == ISFS_ACCESS_RW) {
block->fileInfo = info;
block->callback = callback;
block->state = NAND_STATE_10;
block->state = NAND_STATE_CLOSE_TEMP_FILE;
err = ISFS_CloseAsync(info->fileDescriptor, nandSafeCloseCallback, block);
} else {
err = ISFS_ERROR_INVALID;
@@ -613,34 +613,34 @@ s32 nandSafeCloseAsync(NANDFileInfo* info, NANDCallback callback, NANDCommandBlo
return nandConvertErrorCode(err);
}
void nandSafeCloseCallback(ISFSError result, void* arg) {
NANDCommandBlock* block = (NANDCommandBlock*)arg;
void nandSafeCloseCallback(ISFSError result, void* callbackContext) {
NANDCommandBlock* block = (NANDCommandBlock*)callbackContext;
if (result == ISFS_ERROR_OK) {
NANDFileInfo* info = block->fileInfo;
ISFSError ret = ISFS_ERROR_UNKNOWN;
if (block->state == NAND_STATE_12) {
if (block->state == NAND_STATE_RENAME_TEMP_FILE) {
info->stage = NAND_STATE_WRITE_FILE;
}
if ((block->state == NAND_STATE_12) && block->simpleFlag) {
block->state += (NAND_STATE_14 - NAND_STATE_12);
if ((block->state == NAND_STATE_RENAME_TEMP_FILE) && block->simpleFlag) {
block->state += (NAND_STATE_CLOSE_COMPLETE - NAND_STATE_RENAME_TEMP_FILE);
} else {
++block->state;
}
if (block->state == NAND_STATE_11) {
if (block->state == NAND_STATE_CLOSE_ORIGINAL_FILE) {
info->stage = NAND_STATE_READ_FILE;
ret = ISFS_CloseAsync(info->origFd, nandSafeCloseCallback, arg);
} else if (block->state == NAND_STATE_12) {
ret = ISFS_CloseAsync(info->origFd, nandSafeCloseCallback, callbackContext);
} else if (block->state == NAND_STATE_RENAME_TEMP_FILE) {
info->stage = NAND_STATE_READ_FILE_2;
ret = ISFS_RenameAsync(info->tmpPath, info->origPath, nandSafeCloseCallback, arg);
} else if (block->state == NAND_STATE_13) {
ret = ISFS_RenameAsync(info->tmpPath, info->origPath, nandSafeCloseCallback, callbackContext);
} else if (block->state == NAND_STATE_DELETE_TEMP_DIR) {
char tmpdir[NAND_MAX_PATH] = "";
nandGetParentDirectory(tmpdir, info->tmpPath);
ret = ISFS_DeleteAsync(tmpdir, nandSafeCloseCallback, arg);
} else if (block->state == NAND_STATE_14) {
ret = ISFS_DeleteAsync(tmpdir, nandSafeCloseCallback, callbackContext);
} else if (block->state == NAND_STATE_CLOSE_COMPLETE) {
if (!block->simpleFlag) {
info->stage = 9;
}
@@ -658,8 +658,8 @@ void nandSafeCloseCallback(ISFSError result, void* arg) {
}
}
static void nandReadCloseCallback(ISFSError result, void* arg) {
NANDCommandBlock* block = (NANDCommandBlock*)arg;
static void nandReadCloseCallback(ISFSError result, void* callbackContext) {
NANDCommandBlock* block = (NANDCommandBlock*)callbackContext;
if (result == ISFS_ERROR_OK) {
((NANDFileInfo*)block->fileInfo)->stage = 7;
@@ -669,8 +669,8 @@ static void nandReadCloseCallback(ISFSError result, void* arg) {
block->callback(nandConvertErrorCode(result), block);
}
static void nandCloseCallback(ISFSError result, void* arg) {
NANDCommandBlock* block = (NANDCommandBlock*)arg;
static void nandCloseCallback(ISFSError result, void* callbackContext) {
NANDCommandBlock* block = (NANDCommandBlock*)callbackContext;
if (result == ISFS_ERROR_OK) {
((NANDFileInfo*)block->fileInfo)->stage = 7;

View File

@@ -412,9 +412,9 @@ NWC24Err NWC24InitFiles(void* work, BOOL force) {
if (result == NWC24_OK) {
NWC24UserId userId;
u32 arg1;
u32 generationReply;
result = NWC24iRequestGenerateUserId(&userId, &arg1);
result = NWC24iRequestGenerateUserId(&userId, &generationReply);
if (result == NWC24_ERR_ID_GENERATED || result == NWC24_ERR_ID_REGISTERED) {
result = NWC24_OK;
}
@@ -609,14 +609,14 @@ NWC24Err AnalyzeScdErrors(s32* errorCode, u32 usage) {
NWC24Err AnalyzeErrorCode(s32 errorCode, u32 usage, u32* score) {
char digit[6];
int i;
s32 tmp = -errorCode;
s32 errorNumber = -errorCode;
*score = 0;
// Convert code to strings
for (i = 0; i < 6; i++) {
digit[i] = tmp % 10;
tmp = tmp / 10;
digit[i] = errorNumber % 10;
errorNumber = errorNumber / 10;
}
// If the code is 5XXXX, it is an NCD error
@@ -663,16 +663,16 @@ NWC24Err AnalyzeErrorCode(s32 errorCode, u32 usage, u32* score) {
}
// Get the NWC24Err code
tmp = digit[0] + (digit[1] * 10);
errorNumber = digit[0] + (digit[1] * 10);
// Handle 3rd digit
switch (digit[2]) {
case 0: {
// Over 70 means success
if (tmp >= 70) {
if (errorNumber >= 70) {
return NWC24_OK;
}
*score = 60;
switch (tmp) {
switch (errorNumber) {
case 0:
case 1:
case 2:
@@ -692,7 +692,7 @@ NWC24Err AnalyzeErrorCode(s32 errorCode, u32 usage, u32* score) {
}
}
case 2: {
switch (-tmp) {
switch (-errorNumber) {
case -1: {
*score = 60;
return NWC24_ERR_FATAL;
@@ -718,7 +718,7 @@ NWC24Err AnalyzeErrorCode(s32 errorCode, u32 usage, u32* score) {
break;
}
case 3: {
switch (tmp) {
switch (errorNumber) {
case 1:
case 2:
case 3:
@@ -744,7 +744,7 @@ NWC24Err AnalyzeErrorCode(s32 errorCode, u32 usage, u32* score) {
}
}
case 4: {
switch (tmp) {
switch (errorNumber) {
case 9:
case 10:
case 11:

View File

@@ -148,21 +148,21 @@ SSLResult SSLRead(SSLId i_sslId, char* o_buf, u32 i_bufSize) {
return SSL_RESULT_INVALID;
} else {
u32 bufSize = i_bufSize > SSL_BUFFER_MAX_LENGTH ? SSL_BUFFER_MAX_LENGTH : i_bufSize;
char tmp[32] ALIGN32;
char alignedBuffer[32] ALIGN32;
u32 align = (u32)o_buf & 31;
u32 front_bytes = align != 0 ? (32 - align) : 0;
u32 rest = bufSize;
int total_read = 0;
memset(tmp, 0, sizeof(tmp));
memset(alignedBuffer, 0, sizeof(alignedBuffer));
if (front_bytes != 0) {
if (front_bytes > bufSize) {
front_bytes = bufSize;
}
ret = SSL_read(fd, i_sslId, tmp, front_bytes);
ret = SSL_read(fd, i_sslId, alignedBuffer, front_bytes);
if (ret > 0) {
total_read += ret;
memcpy(o_buf, tmp, ret);
memcpy(o_buf, alignedBuffer, ret);
if (ret < front_bytes) {
IOS_Close(fd);
return total_read;
@@ -202,11 +202,11 @@ SSLResult SSLRead(SSLId i_sslId, char* o_buf, u32 i_bufSize) {
if (rest != 0) {
u32 back_bytes = (rest & 31);
if (back_bytes != 0) {
memset(tmp, 0, sizeof(tmp));
ret = SSL_read(fd, i_sslId, tmp, back_bytes);
memset(alignedBuffer, 0, sizeof(alignedBuffer));
ret = SSL_read(fd, i_sslId, alignedBuffer, back_bytes);
if (ret > 0) {
total_read += ret;
memcpy((s8*)o_buf, tmp, ret);
memcpy((s8*)o_buf, alignedBuffer, ret);
} else {
IOS_Close(fd);
if (total_read > 0) {
@@ -235,7 +235,7 @@ SSLResult SSLWrite(SSLId i_sslId, const char* i_buf, u32 i_bufSize) {
if (fd < 0) {
return SSL_RESULT_INVALID;
} else {
char tmp[32] ALIGN32;
char alignedBuffer[32] ALIGN32;
u32 align;
u32 front_bytes;
u32 rest;
@@ -245,13 +245,13 @@ SSLResult SSLWrite(SSLId i_sslId, const char* i_buf, u32 i_bufSize) {
front_bytes = align != 0 ? (32 - align) : 0;
rest = i_bufSize;
total_write = 0;
memset(tmp, 0, sizeof(tmp));
memset(alignedBuffer, 0, sizeof(alignedBuffer));
if (front_bytes != 0) {
if (front_bytes > i_bufSize) {
front_bytes = i_bufSize;
}
memcpy(tmp, i_buf, front_bytes);
ret = SSL_write(fd, i_sslId, tmp, front_bytes);
memcpy(alignedBuffer, i_buf, front_bytes);
ret = SSL_write(fd, i_sslId, alignedBuffer, front_bytes);
if (ret > 0) {
total_write += ret;
if (ret < front_bytes) {
@@ -292,9 +292,9 @@ SSLResult SSLWrite(SSLId i_sslId, const char* i_buf, u32 i_bufSize) {
if (rest != 0) {
u32 back_bytes = (rest & 31);
if (back_bytes != 0) {
memset(tmp, 0, sizeof(tmp));
memcpy(tmp, i_buf, back_bytes);
ret = SSL_write(fd, i_sslId, tmp, back_bytes);
memset(alignedBuffer, 0, sizeof(alignedBuffer));
memcpy(alignedBuffer, i_buf, back_bytes);
ret = SSL_write(fd, i_sslId, alignedBuffer, back_bytes);
if (ret > 0) {
total_write += ret;
} else {

View File

@@ -5,11 +5,11 @@
namespace ipl {
namespace cs {
namespace anim {
BOOL start(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL start(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
ipl::layout::Animator* anim;
BOOL ret = FALSE;
if (util::is_valid_datap(hdr)) {
anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
anim->initFrame();
anim->restart();
@@ -19,10 +19,10 @@ namespace ipl {
return ret;
}
BOOL restart(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL restart(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
if (util::is_valid_datap(hdr)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
anim->restart();
ret = TRUE;
@@ -31,10 +31,10 @@ namespace ipl {
return ret;
}
BOOL stop(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL stop(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
if (util::is_valid_datap(hdr)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
anim->stop();
ret = TRUE;
@@ -43,23 +43,23 @@ namespace ipl {
return ret;
}
BOOL is_playing(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL is_playing(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
if (util::is_valid_datap(hdr)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
ret = CHANSVmSetInteger(vm, hdr2, anim->isPlaying()) == CHANS_VM_OK;
ret = CHANSVmSetInteger(vm, returnObj, anim->isPlaying()) == CHANS_VM_OK;
}
}
return ret;
}
BOOL init_frame(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL init_frame(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(vm, 0);
if (util::is_valid_datap(hdr) && arg != NULL) {
f32 frame = static_cast<f32>(arg->value.float_v);
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
CHANSVmObjHdr* frameArg = CHANSVmGetArgFloat(vm, 0);
if (util::is_valid_datap(parentObj) && frameArg != NULL) {
f32 frame = static_cast<f32>(frameArg->value.float_v);
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
if (frame >= 0.0f) {
anim->initAnmFrame(frame);
@@ -70,16 +70,16 @@ namespace ipl {
return ret;
}
BOOL set_max_frame(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL set_max_frame(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(vm, 0);
if (util::is_valid_datap(hdr) && arg != NULL) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
CHANSVmObjHdr* maxFrameArg = CHANSVmGetArgFloat(vm, 0);
if (util::is_valid_datap(parentObj) && maxFrameArg != NULL) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
f32 val = static_cast<f32>(arg->value.float_v);
f32 maxFrame = static_cast<f32>(maxFrameArg->value.float_v);
f32 minFrame = anim->getMinFrame();
if (val >= 0.0f && minFrame < val) {
anim->setMaxFrame(val);
if (maxFrame >= 0.0f && minFrame < maxFrame) {
anim->setMaxFrame(maxFrame);
ret = TRUE;
}
}
@@ -87,16 +87,16 @@ namespace ipl {
return ret;
}
BOOL set_min_frame(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL set_min_frame(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(vm, 0);
if (util::is_valid_datap(hdr) && arg != NULL) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
CHANSVmObjHdr* minFrameArg = CHANSVmGetArgFloat(vm, 0);
if (util::is_valid_datap(parentObj) && minFrameArg != NULL) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
f32 val = static_cast<f32>(arg->value.float_v);
f32 minFrame = static_cast<f32>(minFrameArg->value.float_v);
f32 maxFrame = anim->getMaxFrame();
if (val >= 0.0f && val < maxFrame) {
anim->setMinFrame(val);
if (minFrame >= 0.0f && minFrame < maxFrame) {
anim->setMinFrame(minFrame);
ret = TRUE;
}
}
@@ -104,26 +104,26 @@ namespace ipl {
return ret;
}
BOOL set_current_frame(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL set_current_frame(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(vm, 0);
if (util::is_valid_datap(hdr) && arg != NULL) {
f32 val = static_cast<f32>(arg->value.float_v);
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
CHANSVmObjHdr* currentFrameArg = CHANSVmGetArgFloat(vm, 0);
if (util::is_valid_datap(parentObj) && currentFrameArg != NULL) {
f32 currentFrame = static_cast<f32>(currentFrameArg->value.float_v);
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
anim->setCurrentFrame(val);
anim->setCurrentFrame(currentFrame);
ret = TRUE;
}
}
return ret;
}
BOOL set_type(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL set_type(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgInteger(vm, 0);
if (util::is_valid_datap(hdr) && arg != NULL) {
s32 type = arg->value.int_v;
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
CHANSVmObjHdr* typeArg = CHANSVmGetArgInteger(vm, 0);
if (util::is_valid_datap(parentObj) && typeArg != NULL) {
s32 type = typeArg->value.int_v;
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
if (type >= 0 && type < 4) {
anim->setAnmType(type);
@@ -134,70 +134,70 @@ namespace ipl {
return ret;
}
BOOL set_delta(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL set_delta(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(vm, 0);
if (util::is_valid_datap(hdr) && arg != NULL) {
f32 val = static_cast<f32>(arg->value.float_v);
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
CHANSVmObjHdr* speedArg = CHANSVmGetArgFloat(vm, 0);
if (util::is_valid_datap(parentObj) && speedArg != NULL) {
f32 speed = static_cast<f32>(speedArg->value.float_v);
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
anim->setSpeed(val);
anim->setSpeed(speed);
ret = TRUE;
}
}
return ret;
}
BOOL get_max_frame(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get_max_frame(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
if (util::is_valid_datap(hdr)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
ret = CHANSVmSetFloat(vm, hdr2, anim->getMaxFrame()) == CHANS_VM_OK;
ret = CHANSVmSetFloat(vm, returnObj, anim->getMaxFrame()) == CHANS_VM_OK;
}
}
return ret;
}
BOOL get_min_frame(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get_min_frame(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
if (util::is_valid_datap(hdr)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
ret = CHANSVmSetFloat(vm, hdr2, anim->getMinFrame()) == CHANS_VM_OK;
ret = CHANSVmSetFloat(vm, returnObj, anim->getMinFrame()) == CHANS_VM_OK;
}
}
return ret;
}
BOOL get_current_frame(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get_current_frame(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
if (util::is_valid_datap(hdr)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
ret = CHANSVmSetFloat(vm, hdr2, anim->getCurrentFrame()) == CHANS_VM_OK;
ret = CHANSVmSetFloat(vm, returnObj, anim->getCurrentFrame()) == CHANS_VM_OK;
}
}
return ret;
}
BOOL get_type(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get_type(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
if (util::is_valid_datap(hdr)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
ret = CHANSVmSetInteger(vm, hdr2, anim->getAnmType()) == CHANS_VM_OK;
ret = CHANSVmSetInteger(vm, returnObj, anim->getAnmType()) == CHANS_VM_OK;
}
}
return ret;
}
BOOL get_delta(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get_delta(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL ret = FALSE;
if (util::is_valid_datap(hdr)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
ipl::layout::Animator* anim = *static_cast<ipl::layout::Animator**>(*parentObj->value.ptr_v);
if (anim != NULL) {
ret = CHANSVmSetFloat(vm, hdr2, anim->getSpeed()) == CHANS_VM_OK;
ret = CHANSVmSetFloat(vm, returnObj, anim->getSpeed()) == CHANS_VM_OK;
}
}
return ret;

View File

@@ -13,9 +13,9 @@ namespace ipl {
extern const CHANSVmPropertyList cPropertyList[COLOR_PROPERTY_COUNT];
typedef union CS_Color {
u32 val32;
u32 packedRgba;
GXColor gxColor;
u8 arr[4];
u8 components[4];
} CS_Color;
typedef struct _CS_Struct {
@@ -31,24 +31,24 @@ namespace ipl {
if (data != NULL) {
// new Color(GXColor)
if (CHANSVmGetArgc(VmInst) == 1) {
CHANSVmObjHdr* arg = CHANSVmGetArgInteger(VmInst, 0);
if (arg != NULL) {
*data = reinterpret_cast<CS_Struct*>(&arg->value.ptr_v)->argumentColor.gxColor;
CHANSVmObjHdr* packedColorArg = CHANSVmGetArgInteger(VmInst, 0);
if (packedColorArg != NULL) {
*data = reinterpret_cast<CS_Struct*>(&packedColorArg->value.ptr_v)->argumentColor.gxColor;
}
}
// new Color(u8 r, u8 g, u8 b, u8 a)
else {
CHANSVmObjHdr* arg0 = CHANSVmGetArgInteger(VmInst, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(VmInst, 1);
CHANSVmObjHdr* arg2 = CHANSVmGetArgInteger(VmInst, 2);
CHANSVmObjHdr* arg3 = CHANSVmGetArgInteger(VmInst, 3);
CHANSVmObjHdr* redArg = CHANSVmGetArgInteger(VmInst, 0);
CHANSVmObjHdr* greenArg = CHANSVmGetArgInteger(VmInst, 1);
CHANSVmObjHdr* blueArg = CHANSVmGetArgInteger(VmInst, 2);
CHANSVmObjHdr* alphaArg = CHANSVmGetArgInteger(VmInst, 3);
u8 val;
u8 componentValue;
data->r = arg0 != NULL ? arg0->value.int_v : 0;
data->g = arg1 != NULL ? arg1->value.int_v : 0;
data->b = arg2 != NULL ? arg2->value.int_v : 0;
data->a = arg3 != NULL ? arg3->value.int_v : 0;
data->r = redArg != NULL ? redArg->value.int_v : 0;
data->g = greenArg != NULL ? greenArg->value.int_v : 0;
data->b = blueArg != NULL ? blueArg->value.int_v : 0;
data->a = alphaArg != NULL ? alphaArg->value.int_v : 0;
}
result = TRUE;
}
@@ -82,14 +82,14 @@ namespace ipl {
template <int I>
CHANSVmDefineMethod(set) {
BOOL result = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgInteger(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && arg != NULL) {
CHANSVmObjHdr* componentArg = CHANSVmGetArgInteger(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && componentArg != NULL) {
CS_Struct* data = static_cast<CS_Struct*>(*VmParentObj->value.ptr_v);
if (data != NULL) {
result = TRUE;
CS_Color newVal = data->color;
newVal.arr[I] = arg->value.int_v;
data->color = newVal;
CS_Color updatedColor = data->color;
updatedColor.components[I] = componentArg->value.int_v;
data->color = updatedColor;
}
}
return result;
@@ -101,8 +101,8 @@ namespace ipl {
if (util::is_valid_datap(VmParentObj)) {
CS_Struct* data = static_cast<CS_Struct*>(*VmParentObj->value.ptr_v);
if (data != NULL) {
CS_Color val = data->color;
result = CHANSVmSetInteger(VmInst, VmReturnObj, val.arr[I]) == CHANS_VM_OK;
CS_Color colorValue = data->color;
result = CHANSVmSetInteger(VmInst, VmReturnObj, colorValue.components[I]) == CHANS_VM_OK;
}
}
return result;
@@ -127,17 +127,17 @@ namespace ipl {
GXColorS10* data = static_cast<GXColorS10*>(CHANSVmNewObjData(VmInst, VmReturnObj, sizeof(*data)));
if (data != NULL) {
CHANSVmObjHdr* arg0 = CHANSVmGetArgInteger(VmInst, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(VmInst, 1);
CHANSVmObjHdr* arg2 = CHANSVmGetArgInteger(VmInst, 2);
CHANSVmObjHdr* arg3 = CHANSVmGetArgInteger(VmInst, 3);
CHANSVmObjHdr* redArg = CHANSVmGetArgInteger(VmInst, 0);
CHANSVmObjHdr* greenArg = CHANSVmGetArgInteger(VmInst, 1);
CHANSVmObjHdr* blueArg = CHANSVmGetArgInteger(VmInst, 2);
CHANSVmObjHdr* alphaArg = CHANSVmGetArgInteger(VmInst, 3);
u16 val;
u16 componentValue;
data->r = arg0 != NULL ? arg0->value.int_v : 0;
data->g = arg1 != NULL ? arg1->value.int_v : 0;
data->b = arg2 != NULL ? arg2->value.int_v : 0;
data->a = arg3 != NULL ? arg3->value.int_v : 0;
data->r = redArg != NULL ? redArg->value.int_v : 0;
data->g = greenArg != NULL ? greenArg->value.int_v : 0;
data->b = blueArg != NULL ? blueArg->value.int_v : 0;
data->a = alphaArg != NULL ? alphaArg->value.int_v : 0;
result = TRUE;
}
@@ -171,12 +171,12 @@ namespace ipl {
template <int I>
CHANSVmDefineMethod(set) {
BOOL result = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgInteger(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && arg != NULL) {
CHANSVmObjHdr* componentArg = CHANSVmGetArgInteger(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && componentArg != NULL) {
s16* data = static_cast<s16*>(*VmParentObj->value.ptr_v);
if (*VmParentObj->value.ptr_v != NULL) {
result = TRUE;
data[I] = arg->value.int_v;
data[I] = componentArg->value.int_v;
}
}
return result;

View File

@@ -11,13 +11,13 @@ namespace ipl {
BOOL ok;
BOOL result = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgString(VmInst, 0);
if (util::is_valid_datap(arg)) {
CHANSVmObjHdr* paneNameArg = CHANSVmGetArgString(VmInst, 0);
if (util::is_valid_datap(paneNameArg)) {
char name[18];
wchar_t wide[18];
memset(name, 0, sizeof(name));
memset(wide, 0, sizeof(wide));
util::utf16_to_ascii(name, wide, 16, arg);
util::utf16_to_ascii(name, wide, 16, paneNameArg);
ok = FALSE;
name[16] = '\0';
@@ -36,10 +36,10 @@ namespace ipl {
CHANSVmDefineMethod(start_anm) {
ipl::layout::Animator** anims = System::getCSManager()->getData().anims;
BOOL result = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgInteger(VmInst, 0);
if (arg != NULL && arg->value.int_v < 16ULL) {
CHANSVmObjHdr* animationIndexArg = CHANSVmGetArgInteger(VmInst, 0);
if (animationIndexArg != NULL && animationIndexArg->value.int_v < 16ULL) {
if (anims != NULL) {
ipl::layout::Animator* anim = anims[arg->value.data.len];
ipl::layout::Animator* anim = anims[animationIndexArg->value.data.len];
if (anim != NULL) {
anim->initFrame();
anim->restart();
@@ -53,11 +53,11 @@ namespace ipl {
CHANSVmDefineMethod(get_anm) {
ipl::layout::Animator** anims = System::getCSManager()->getData().anims;
BOOL result = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgInteger(VmInst, 0);
if (arg != NULL && arg->value.int_v < 16ULL) {
CHANSVmObjHdr* animationIndexArg = CHANSVmGetArgInteger(VmInst, 0);
if (animationIndexArg != NULL && animationIndexArg->value.int_v < 16ULL) {
if (anims != NULL) {
result = TRUE;
ipl::layout::Animator* anim = anims[arg->value.int_v];
ipl::layout::Animator* anim = anims[animationIndexArg->value.int_v];
if (anim != NULL) {
if (!anim::_ctor(VmInst, VmReturnObj, (u32)anim)) {
result = FALSE;

View File

@@ -20,14 +20,14 @@ struct CSMatTexData {
namespace ipl {
namespace cs {
namespace material {
BOOL set_texture(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL set_texture(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
CHANSVmObjHdr* arg0 = CHANSVmGetArgInteger(vm, 0);
CHANSVmObjHdr* textureIndexArg = CHANSVmGetArgInteger(vm, 0);
CHANSVmObjHdr* texArg = CHANSVmGetArg(vm, 1);
if (util::is_valid_datap(hdr) && arg0 != NULL && util::is_valid_class(texArg, "Texture")) {
if (util::is_valid_datap(parentObj) && textureIndexArg != NULL && util::is_valid_class(texArg, "Texture")) {
CSMatTexData* texData = static_cast<CSMatTexData*>(*texArg->value.ptr_v);
nw4r::lyt::Material* mat = *static_cast<nw4r::lyt::Material**>(*hdr->value.ptr_v);
u32 idx = arg0->value.int_v;
nw4r::lyt::Material* mat = *static_cast<nw4r::lyt::Material**>(*parentObj->value.ptr_v);
u32 idx = textureIndexArg->value.int_v;
if (mat != NULL) {
u32 texMapCount = mat->GetTextureNum();
if ((u8)idx < texMapCount) {
@@ -44,38 +44,38 @@ namespace ipl {
return result;
}
BOOL get_tev_color(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get_tev_color(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
nw4r::lyt::Material* mat;
CHANSVmObjHdr* arg;
CHANSVmObjHdr* colorIndexArg;
BOOL result = FALSE;
if (util::is_valid_datap(hdr)) {
mat = *static_cast<nw4r::lyt::Material**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
mat = *static_cast<nw4r::lyt::Material**>(*parentObj->value.ptr_v);
u32 argc = CHANSVmGetArgc(vm);
arg = CHANSVmGetArgInteger(vm, 0);
if (mat != NULL && argc == 1 && arg != NULL) {
if (arg->value.int_v < 3ULL) {
result = color_s10::_ctor(vm, hdr2, mat->GetTevColor(arg->value.int_v)) == TRUE;
colorIndexArg = CHANSVmGetArgInteger(vm, 0);
if (mat != NULL && argc == 1 && colorIndexArg != NULL) {
if (colorIndexArg->value.int_v < 3ULL) {
result = color_s10::_ctor(vm, returnObj, mat->GetTevColor(colorIndexArg->value.int_v)) == TRUE;
}
}
}
return result;
}
BOOL set_tev_color(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL set_tev_color(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
nw4r::lyt::Material* mat;
CHANSVmObjHdr* arg0;
CHANSVmObjHdr* arg1;
CHANSVmObjHdr* colorIndexArg;
CHANSVmObjHdr* colorArg;
BOOL result = FALSE;
if (util::is_valid_datap(hdr)) {
mat = *static_cast<nw4r::lyt::Material**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
mat = *static_cast<nw4r::lyt::Material**>(*parentObj->value.ptr_v);
u32 argc = CHANSVmGetArgc(vm);
arg0 = CHANSVmGetArgInteger(vm, 0);
arg1 = CHANSVmGetArg(vm, 1);
if (mat != NULL && argc == 2 && arg0 != NULL && util::is_valid_class(arg1, "GXColorS10")) {
if (arg0->value.int_v < 3ULL) {
mat->SetTevColor(arg0->value.int_v, *static_cast<GXColorS10*>(*arg1->value.ptr_v));
colorIndexArg = CHANSVmGetArgInteger(vm, 0);
colorArg = CHANSVmGetArg(vm, 1);
if (mat != NULL && argc == 2 && colorIndexArg != NULL && util::is_valid_class(colorArg, "GXColorS10")) {
if (colorIndexArg->value.int_v < 3ULL) {
mat->SetTevColor(colorIndexArg->value.int_v, *static_cast<GXColorS10*>(*colorArg->value.ptr_v));
result = TRUE;
}
}
@@ -83,38 +83,38 @@ namespace ipl {
return result;
}
BOOL get_tev_kcolor(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get_tev_kcolor(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
nw4r::lyt::Material* mat;
CHANSVmObjHdr* arg;
CHANSVmObjHdr* colorIndexArg;
BOOL result = FALSE;
if (util::is_valid_datap(hdr)) {
mat = *static_cast<nw4r::lyt::Material**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
mat = *static_cast<nw4r::lyt::Material**>(*parentObj->value.ptr_v);
u32 argc = CHANSVmGetArgc(vm);
arg = CHANSVmGetArgInteger(vm, 0);
if (mat != NULL && argc == 1 && arg != NULL) {
if (arg->value.int_v < 4ULL) {
result = color::_ctor(vm, hdr2, mat->GetTevKColor(arg->value.int_v).ToU32()) == TRUE;
colorIndexArg = CHANSVmGetArgInteger(vm, 0);
if (mat != NULL && argc == 1 && colorIndexArg != NULL) {
if (colorIndexArg->value.int_v < 4ULL) {
result = color::_ctor(vm, returnObj, mat->GetTevKColor(colorIndexArg->value.int_v).ToU32()) == TRUE;
}
}
}
return result;
}
BOOL set_tev_kcolor(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL set_tev_kcolor(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
nw4r::lyt::Material* mat;
CHANSVmObjHdr* arg0;
CHANSVmObjHdr* colorIndexArg;
BOOL result = FALSE;
CHANSVmObjHdr* arg1;
CHANSVmObjHdr* colorArg;
if (util::is_valid_datap(hdr)) {
mat = *static_cast<nw4r::lyt::Material**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
mat = *static_cast<nw4r::lyt::Material**>(*parentObj->value.ptr_v);
u32 argc = CHANSVmGetArgc(vm);
arg0 = CHANSVmGetArgInteger(vm, 0);
arg1 = CHANSVmGetArg(vm, 1);
if (mat != NULL && argc == 2 && arg0 != NULL && util::is_valid_class(arg1, "Color")) {
if (arg0->value.int_v < 4ULL) {
mat->SetTevKColor(arg0->value.int_v, *static_cast<nw4r::ut::Color*>(*arg1->value.ptr_v));
colorIndexArg = CHANSVmGetArgInteger(vm, 0);
colorArg = CHANSVmGetArg(vm, 1);
if (mat != NULL && argc == 2 && colorIndexArg != NULL && util::is_valid_class(colorArg, "Color")) {
if (colorIndexArg->value.int_v < 4ULL) {
mat->SetTevKColor(colorIndexArg->value.int_v, *static_cast<nw4r::ut::Color*>(*colorArg->value.ptr_v));
result = TRUE;
}
}
@@ -122,26 +122,26 @@ namespace ipl {
return result;
}
BOOL get_mat_color(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get_mat_color(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
if (util::is_valid_datap(hdr)) {
nw4r::lyt::Material* mat = *static_cast<nw4r::lyt::Material**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
nw4r::lyt::Material* mat = *static_cast<nw4r::lyt::Material**>(*parentObj->value.ptr_v);
if (mat != NULL && mat->IsMatColorCap()) {
result = color::_ctor(vm, hdr2, mat->GetMatColor().ToU32()) == TRUE;
result = color::_ctor(vm, returnObj, mat->GetMatColor().ToU32()) == TRUE;
}
}
return result;
}
BOOL set_mat_color(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL set_mat_color(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
nw4r::lyt::Material* mat;
BOOL result = FALSE;
if (util::is_valid_datap(hdr)) {
mat = *static_cast<nw4r::lyt::Material**>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
mat = *static_cast<nw4r::lyt::Material**>(*parentObj->value.ptr_v);
u32 argc = CHANSVmGetArgc(vm);
CHANSVmObjHdr* arg = CHANSVmGetArg(vm, 0);
if (mat != NULL && mat->IsMatColorCap() && argc == 1 && util::is_valid_class(arg, "Color")) {
mat->SetMatColor(*static_cast<nw4r::ut::Color*>(*arg->value.ptr_v));
CHANSVmObjHdr* colorArg = CHANSVmGetArg(vm, 0);
if (mat != NULL && mat->IsMatColorCap() && argc == 1 && util::is_valid_class(colorArg, "Color")) {
mat->SetMatColor(*static_cast<nw4r::ut::Color*>(*colorArg->value.ptr_v));
result = TRUE;
}
}

View File

@@ -95,11 +95,11 @@ namespace ipl {
BOOL set(CHANSVm* vm, CHANSVmObjHdr* parentObj, int dimension0, int dimension1) {
BOOL result = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(vm, 0);
if (util::is_valid_datap(parentObj) && arg != NULL) {
CHANSVmObjHdr* elementArg = CHANSVmGetArgFloat(vm, 0);
if (util::is_valid_datap(parentObj) && elementArg != NULL) {
CHANSVmObjHdr* elem = CHANSVmGetArrayElement2D(vm, *parentObj->value.ptr_v, dimension0, dimension1);
if (elem != NULL) {
if (CHANSVmCopyObject(vm, elem, arg) != NULL) {
if (CHANSVmCopyObject(vm, elem, elementArg) != NULL) {
result = TRUE;
}
}

View File

@@ -207,8 +207,8 @@ namespace ipl {
if (util::is_valid_datap(VmParentObj)) {
nw4r::lyt::Pane* pane = *static_cast<nw4r::lyt::Pane**>(*VmParentObj->value.ptr_v);
if (pane != NULL) {
nw4r::lyt::Size temp = pane->GetSize();
result = size::_ctor(VmInst, VmReturnObj, temp.width, temp.height) == TRUE;
nw4r::lyt::Size paneSize = pane->GetSize();
result = size::_ctor(VmInst, VmReturnObj, paneSize.width, paneSize.height) == TRUE;
}
}
return result;
@@ -242,14 +242,14 @@ namespace ipl {
CHANSVmDefineMethod(set_alpha) {
nw4r::lyt::Pane* pane;
CHANSVmObjHdr* arg;
CHANSVmObjHdr* alphaArg;
BOOL result = FALSE;
if (util::is_valid_datap(VmParentObj)) {
pane = *static_cast<nw4r::lyt::Pane**>(*VmParentObj->value.ptr_v);
arg = CHANSVmGetArgInteger(VmInst, 0);
if (pane != NULL && arg != NULL) {
alphaArg = CHANSVmGetArgInteger(VmInst, 0);
if (pane != NULL && alphaArg != NULL) {
result = TRUE;
pane->SetAlpha(arg->value.int_v);
pane->SetAlpha(alphaArg->value.int_v);
}
}
return result;
@@ -321,16 +321,16 @@ namespace ipl {
CHANSVmDefineMethod(set_line_space) {
nw4r::lyt::Pane* pane;
CHANSVmObjHdr* arg;
CHANSVmObjHdr* lineSpaceArg;
BOOL result = FALSE;
if (util::is_valid_datap(VmParentObj)) {
pane = *static_cast<nw4r::lyt::Pane**>(*VmParentObj->value.ptr_v);
arg = CHANSVmGetArgFloat(VmInst, 0);
lineSpaceArg = CHANSVmGetArgFloat(VmInst, 0);
if (pane != NULL) {
nw4r::lyt::TextBox* box = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(pane);
if (box != NULL && arg != NULL) {
if (box != NULL && lineSpaceArg != NULL) {
result = TRUE;
box->SetLineSpace(arg->value.float_v);
box->SetLineSpace(lineSpaceArg->value.float_v);
}
}
}
@@ -356,12 +356,12 @@ namespace ipl {
BOOL result = FALSE;
if (util::is_valid_datap(VmParentObj)) {
pane = *static_cast<nw4r::lyt::Pane**>(*VmParentObj->value.ptr_v);
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(VmInst, 0);
CHANSVmObjHdr* charSpaceArg = CHANSVmGetArgFloat(VmInst, 0);
if (pane != NULL) {
nw4r::lyt::TextBox* box = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(pane);
if (box != NULL && arg != NULL) {
if (box != NULL && charSpaceArg != NULL) {
result = TRUE;
box->SetCharSpace(arg->value.float_v);
box->SetCharSpace(charSpaceArg->value.float_v);
}
}
}
@@ -374,10 +374,10 @@ namespace ipl {
if (util::is_valid_datap(VmParentObj)) {
pane = *static_cast<nw4r::lyt::Pane**>(*VmParentObj->value.ptr_v);
u32 argc = CHANSVmGetArgc(VmInst);
CHANSVmObjHdr* arg = CHANSVmGetArgInteger(VmInst, 0);
if (pane != NULL && argc == 1 && arg != NULL) {
if (arg->value.int_v < 4ULL) {
result = color::_ctor(VmInst, VmReturnObj, (nw4r::ut::Color) static_cast<u32>(pane->GetVtxColor(arg->value.int_v))) == TRUE;
CHANSVmObjHdr* vertexIndexArg = CHANSVmGetArgInteger(VmInst, 0);
if (pane != NULL && argc == 1 && vertexIndexArg != NULL) {
if (vertexIndexArg->value.int_v < 4ULL) {
result = color::_ctor(VmInst, VmReturnObj, (nw4r::ut::Color) static_cast<u32>(pane->GetVtxColor(vertexIndexArg->value.int_v))) == TRUE;
}
}
}
@@ -390,13 +390,13 @@ namespace ipl {
if (util::is_valid_datap(VmParentObj)) {
pane = *static_cast<nw4r::lyt::Pane**>(*VmParentObj->value.ptr_v);
u32 argc = CHANSVmGetArgc(VmInst);
CHANSVmObjHdr* arg = CHANSVmGetArgInteger(VmInst, 0);
CHANSVmObjHdr* vertexIndexArg = CHANSVmGetArgInteger(VmInst, 0);
CHANSVmObjHdr* colorArg = CHANSVmGetArg(VmInst, 1);
if (pane != NULL && argc == 2 && arg != NULL && util::is_valid_class(colorArg, "Color")) {
u64 v = arg->value.int_v;
if (v < 4) {
if (pane != NULL && argc == 2 && vertexIndexArg != NULL && util::is_valid_class(colorArg, "Color")) {
u64 vertexIndex = vertexIndexArg->value.int_v;
if (vertexIndex < 4) {
u8* src = static_cast<u8*>(*colorArg->value.ptr_v);
pane->SetVtxColor(arg->value.int_v, *(nw4r::ut::Color*)src);
pane->SetVtxColor(vertexIndexArg->value.int_v, *(nw4r::ut::Color*)src);
result = TRUE;
}
}
@@ -411,10 +411,10 @@ namespace ipl {
if (pane != NULL) {
nw4r::lyt::TextBox* box = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(pane);
u32 argc = CHANSVmGetArgc(VmInst);
CHANSVmObjHdr* arg = CHANSVmGetArgInteger(VmInst, 0);
if (box != NULL && argc == 1 && arg != NULL) {
if (arg->value.int_v < 4ULL) {
result = color::_ctor(VmInst, VmReturnObj, (nw4r::ut::Color) static_cast<u32>(GetTextColor__Q34nw4r3lyt7TextBoxCFUl(box, arg->value.int_v))) == TRUE;
CHANSVmObjHdr* colorIndexArg = CHANSVmGetArgInteger(VmInst, 0);
if (box != NULL && argc == 1 && colorIndexArg != NULL) {
if (colorIndexArg->value.int_v < 4ULL) {
result = color::_ctor(VmInst, VmReturnObj, (nw4r::ut::Color) static_cast<u32>(GetTextColor__Q34nw4r3lyt7TextBoxCFUl(box, colorIndexArg->value.int_v))) == TRUE;
}
}
}
@@ -429,12 +429,12 @@ namespace ipl {
if (pane != NULL) {
nw4r::lyt::TextBox* box = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(pane);
u32 argc = CHANSVmGetArgc(VmInst);
CHANSVmObjHdr* arg = CHANSVmGetArgInteger(VmInst, 0);
CHANSVmObjHdr* colorIndexArg = CHANSVmGetArgInteger(VmInst, 0);
CHANSVmObjHdr* colorArg = CHANSVmGetArg(VmInst, 1);
if (box != NULL && argc == 2 && arg != NULL && util::is_valid_class(colorArg, "Color")) {
if (arg->value.int_v < 2ULL) {
if (box != NULL && argc == 2 && colorIndexArg != NULL && util::is_valid_class(colorArg, "Color")) {
if (colorIndexArg->value.int_v < 2ULL) {
u8* src = static_cast<u8*>(*colorArg->value.ptr_v);
box->SetTextColor(static_cast<s32>(arg->value.int_v), *(nw4r::ut::Color*)src);
box->SetTextColor(static_cast<s32>(colorIndexArg->value.int_v), *(nw4r::ut::Color*)src);
result = TRUE;
}
}
@@ -496,11 +496,11 @@ namespace ipl {
BOOL result = FALSE;
if (util::is_valid_datap(VmParentObj)) {
pane = *static_cast<nw4r::lyt::Pane**>(*VmParentObj->value.ptr_v);
CHANSVmObjHdr* arg = CHANSVmGetArg(VmInst, 0);
CHANSVmObjHdr* fontArg = CHANSVmGetArg(VmInst, 0);
if (pane != NULL) {
nw4r::lyt::TextBox* box = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(pane);
if (box != NULL && util::is_valid_class(arg, "Font")) {
const nw4r::ut::Font* font = *static_cast<const nw4r::ut::Font**>(*arg->value.ptr_v);
if (box != NULL && util::is_valid_class(fontArg, "Font")) {
const nw4r::ut::Font* font = *static_cast<const nw4r::ut::Font**>(*fontArg->value.ptr_v);
if (font != NULL) {
box->SetFont(font);
result = TRUE;
@@ -513,25 +513,25 @@ namespace ipl {
nw4r::math::VEC3 get_vec_(CHANSVm* vm) {
u32 argc = CHANSVmGetArgc(vm);
CHANSVmObjHdr* arg = CHANSVmGetArg(vm, 0);
CHANSVmObjHdr* vectorArg = CHANSVmGetArg(vm, 0);
nw4r::math::VEC3 out(scCsZeroF, scCsZeroF, scCsZeroF);
if (argc == 1 && util::is_valid_class(arg, "VEC3")) {
f32* src = static_cast<f32*>(*arg->value.ptr_v);
if (argc == 1 && util::is_valid_class(vectorArg, "VEC3")) {
f32* src = static_cast<f32*>(*vectorArg->value.ptr_v);
out.x = src[0];
out.y = src[1];
out.z = src[2];
} else {
CHANSVmObjHdr* arg0 = CHANSVmGetArgFloat(vm, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgFloat(vm, 1);
CHANSVmObjHdr* arg2 = CHANSVmGetArgFloat(vm, 2);
if (arg0 != NULL) {
out.x = (f32)arg0->value.float_v;
CHANSVmObjHdr* xArg = CHANSVmGetArgFloat(vm, 0);
CHANSVmObjHdr* yArg = CHANSVmGetArgFloat(vm, 1);
CHANSVmObjHdr* zArg = CHANSVmGetArgFloat(vm, 2);
if (xArg != NULL) {
out.x = (f32)xArg->value.float_v;
}
if (arg1 != NULL) {
out.y = (f32)arg1->value.float_v;
if (yArg != NULL) {
out.y = (f32)yArg->value.float_v;
}
if (arg2 != NULL) {
out.z = (f32)arg2->value.float_v;
if (zArg != NULL) {
out.z = (f32)zArg->value.float_v;
}
}
return out;
@@ -539,20 +539,20 @@ namespace ipl {
nw4r::lyt::Size get_size_(CHANSVm* vm) {
u32 argc = CHANSVmGetArgc(vm);
CHANSVmObjHdr* arg = CHANSVmGetArg(vm, 0);
CHANSVmObjHdr* sizeArg = CHANSVmGetArg(vm, 0);
nw4r::lyt::Size out(scCsZeroF, scCsZeroF);
if (argc == 1 && util::is_valid_class(arg, "Size")) {
f32* src = static_cast<f32*>(*arg->value.ptr_v);
if (argc == 1 && util::is_valid_class(sizeArg, "Size")) {
f32* src = static_cast<f32*>(*sizeArg->value.ptr_v);
out.width = src[0];
out.height = src[1];
} else {
CHANSVmObjHdr* arg0 = CHANSVmGetArgFloat(vm, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgFloat(vm, 1);
if (arg0 != NULL) {
out.width = static_cast<f32>(arg0->value.float_v);
CHANSVmObjHdr* widthArg = CHANSVmGetArgFloat(vm, 0);
CHANSVmObjHdr* heightArg = CHANSVmGetArgFloat(vm, 1);
if (widthArg != NULL) {
out.width = static_cast<f32>(widthArg->value.float_v);
}
if (arg1 != NULL) {
out.height = static_cast<f32>(arg1->value.float_v);
if (heightArg != NULL) {
out.height = static_cast<f32>(heightArg->value.float_v);
}
}
return out;

View File

@@ -25,24 +25,24 @@ namespace ipl {
CHANSVmDefineMethod(set_width) {
BOOL result = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && arg != NULL) {
CHANSVmObjHdr* widthArg = CHANSVmGetArgFloat(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && widthArg != NULL) {
nw4r::ut::Rect* data = static_cast<nw4r::ut::Rect*>(*VmParentObj->value.ptr_v);
result = TRUE;
data->SetWidth(arg->value.float_v);
data->SetWidth(widthArg->value.float_v);
}
return result;
}
CHANSVmDefineMethod(set_height) {
BOOL result = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && arg != NULL) {
CHANSVmObjHdr* heightArg = CHANSVmGetArgFloat(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && heightArg != NULL) {
nw4r::ut::Rect* data = static_cast<nw4r::ut::Rect*>(*VmParentObj->value.ptr_v);
result = TRUE;
data->SetHeight(arg->value.float_v);
data->SetHeight(heightArg->value.float_v);
}
return result;
}
@@ -64,33 +64,33 @@ namespace ipl {
nw4r::ut::Rect* data = static_cast<nw4r::ut::Rect*>(CHANSVmNewObjData(VmInst, VmReturnObj, sizeof(*data)));
if (data != NULL) {
CHANSVmObjHdr* arg0 = CHANSVmGetArgFloat(VmInst, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgFloat(VmInst, 1);
CHANSVmObjHdr* arg2 = CHANSVmGetArgFloat(VmInst, 2);
CHANSVmObjHdr* arg3 = CHANSVmGetArgFloat(VmInst, 3);
CHANSVmObjHdr* leftArg = CHANSVmGetArgFloat(VmInst, 0);
CHANSVmObjHdr* topArg = CHANSVmGetArgFloat(VmInst, 1);
CHANSVmObjHdr* rightArg = CHANSVmGetArgFloat(VmInst, 2);
CHANSVmObjHdr* bottomArg = CHANSVmGetArgFloat(VmInst, 3);
f32 left, top, right, bottom;
if (arg0 != NULL) {
left = arg0->value.float_v;
if (leftArg != NULL) {
left = leftArg->value.float_v;
} else {
left = 0.0;
}
if (arg1 != NULL) {
top = arg1->value.float_v;
if (topArg != NULL) {
top = topArg->value.float_v;
} else {
top = 0.0;
}
if (arg2 != NULL) {
right = arg2->value.float_v;
if (rightArg != NULL) {
right = rightArg->value.float_v;
} else {
right = 0.0;
}
if (arg3 != NULL) {
bottom = arg3->value.float_v;
if (bottomArg != NULL) {
bottom = bottomArg->value.float_v;
} else {
bottom = 0.0;
}

View File

@@ -29,13 +29,13 @@ namespace ipl {
COMPRESSION_RL = 0x30,
};
BOOL load_(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2, EGG::Heap* heap);
BOOL load_(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj, EGG::Heap* heap);
BOOL load_nand_(CHANSVm* vm, data* data, EGG::Heap* heap, long offset, u32 size, int align);
BOOL load_vf_(CHANSVm* vm, data* data, EGG::Heap* heap, long offset, u32 size, int align);
BOOL uncompress_all_(data* data, EGG::Heap* heap, int compressionType);
BOOL uncompress_front_(data* data, EGG::Heap* heap, u32 outSize, int compressionType);
BOOL uncompress_(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2, EGG::Heap* heap);
u8* get_(CHANSVm* vm, CHANSVmObjHdr* hdr);
BOOL uncompress_(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj, EGG::Heap* heap);
u8* get_(CHANSVm* vm, CHANSVmObjHdr* parentObj);
void get_fullpath(char* dest, const char* src) {
if (src[0] != '/') {
@@ -47,24 +47,24 @@ namespace ipl {
dest[MAX_PATH_LENGTH] = '\0';
}
BOOL load_to_work(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
return load_(vm, hdr, hdr2, System::getCSManager()->getHeap());
BOOL load_to_work(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
return load_(vm, parentObj, returnObj, System::getCSManager()->getHeap());
}
BOOL load_to_heap(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
return load_(vm, hdr, hdr2, System::getCSManager()->getData().heap);
BOOL load_to_heap(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
return load_(vm, parentObj, returnObj, System::getCSManager()->getData().heap);
}
BOOL load_(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2, EGG::Heap* heap) {
BOOL load_(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj, EGG::Heap* heap) {
BOOL result = FALSE;
int error = 2;
if (util::is_valid_datap(hdr)) {
CHANSVmObjHdr* arg0 = CHANSVmGetArgInteger(vm, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(vm, 1);
s64 offset = (arg0 != NULL) ? arg0->value.data.len : 0;
u32 size = (arg1 != NULL) ? arg1->value.data.len : 0;
data* data = static_cast<savedata::data*>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
CHANSVmObjHdr* offsetArg = CHANSVmGetArgInteger(vm, 0);
CHANSVmObjHdr* sizeArg = CHANSVmGetArgInteger(vm, 1);
s64 offset = (offsetArg != NULL) ? offsetArg->value.data.len : 0;
u32 size = (sizeArg != NULL) ? sizeArg->value.data.len : 0;
data* data = static_cast<savedata::data*>(*parentObj->value.ptr_v);
if (data->pData == NULL && data->size == 0) {
if (data->sMountPath[0] == 0) {
@@ -81,25 +81,25 @@ namespace ipl {
}
}
}
CHANSVmSetInteger(vm, hdr2, (u32)(error == 0 ? 1 : 0));
CHANSVmSetInteger(vm, returnObj, (u32)(error == 0 ? 1 : 0));
return result;
}
BOOL uncomp_to_work(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
return uncompress_(vm, hdr, hdr2, System::getCSManager()->getHeap());
BOOL uncomp_to_work(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
return uncompress_(vm, parentObj, returnObj, System::getCSManager()->getHeap());
}
BOOL uncomp_to_heap(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
return uncompress_(vm, hdr, hdr2, System::getCSManager()->getData().heap);
BOOL uncomp_to_heap(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
return uncompress_(vm, parentObj, returnObj, System::getCSManager()->getData().heap);
}
BOOL uncompress_(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2, EGG::Heap* heap) {
BOOL uncompress_(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj, EGG::Heap* heap) {
int error;
BOOL result = FALSE;
error = 2;
if (util::is_valid_datap(hdr)) {
data* data = static_cast<savedata::data*>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
data* data = static_cast<savedata::data*>(*parentObj->value.ptr_v);
if (data->pData == NULL && data->size == 0) {
EGG::Heap* csHeap = System::getCSManager()->getHeap();
@@ -108,22 +108,22 @@ namespace ipl {
u32 outSize = 0;
u32 argc = CHANSVmGetArgc(vm);
CHANSVmObjHdr* arg0 = CHANSVmGetArgInteger(vm, 0);
CHANSVmObjHdr* compressionTypeArg = CHANSVmGetArgInteger(vm, 0);
if (arg0 != NULL) {
compressionType = arg0->value.int_v;
if (compressionTypeArg != NULL) {
compressionType = compressionTypeArg->value.int_v;
}
if (argc == 3) {
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(vm, 1);
CHANSVmObjHdr* arg2 = CHANSVmGetArgInteger(vm, 2);
CHANSVmObjHdr* compressedSizeArg = CHANSVmGetArgInteger(vm, 1);
CHANSVmObjHdr* outputSizeArg = CHANSVmGetArgInteger(vm, 2);
if (arg1 != NULL) {
size = arg1->value.int_v;
if (compressedSizeArg != NULL) {
size = compressedSizeArg->value.int_v;
}
if (arg2 != NULL) {
outSize = arg2->value.int_v;
if (outputSizeArg != NULL) {
outSize = outputSizeArg->value.int_v;
}
}
@@ -148,7 +148,7 @@ namespace ipl {
result = (error - 2) != 0;
}
CHANSVmSetInteger(vm, hdr2, error == 0);
CHANSVmSetInteger(vm, returnObj, error == 0);
}
return result;
@@ -372,14 +372,14 @@ namespace ipl {
return result;
}
BOOL copy_to_heap(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL copy_to_heap(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
if (util::is_valid_datap(hdr)) {
data* data = static_cast<savedata::data*>(*hdr->value.ptr_v);
CHANSVmObjHdr* arg0 = CHANSVmGetArgInteger(vm, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(vm, 1);
u32 offset = (arg0 != NULL) ? arg0->value.data.len : 0;
u32 size = (arg1 != NULL) ? arg1->value.data.len : 0;
if (util::is_valid_datap(parentObj)) {
data* data = static_cast<savedata::data*>(*parentObj->value.ptr_v);
CHANSVmObjHdr* offsetArg = CHANSVmGetArgInteger(vm, 0);
CHANSVmObjHdr* sizeArg = CHANSVmGetArgInteger(vm, 1);
u32 offset = (offsetArg != NULL) ? offsetArg->value.data.len : 0;
u32 size = (sizeArg != NULL) ? sizeArg->value.data.len : 0;
if (size != 0) {
u32 bufSize = data->size;
@@ -389,7 +389,7 @@ namespace ipl {
if (buf != NULL) {
memcpy(buf, data->pData + offset, size);
DCStoreRange(buf, size);
result = _ctor(vm, hdr2, (u32)buf, size);
result = _ctor(vm, returnObj, (u32)buf, size);
}
}
}
@@ -397,35 +397,35 @@ namespace ipl {
return result;
}
BOOL create_blob(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL create_blob(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
if (util::is_valid_datap(hdr)) {
data* data = static_cast<savedata::data*>(*hdr->value.ptr_v);
if (CHANSVmNewBlobObject(vm, hdr2, data->size, data->pData, data->size) != NULL) {
if (util::is_valid_datap(parentObj)) {
data* data = static_cast<savedata::data*>(*parentObj->value.ptr_v);
if (CHANSVmNewBlobObject(vm, returnObj, data->size, data->pData, data->size) != NULL) {
result = TRUE;
}
}
return result;
}
BOOL decode_odh(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL decode_odh(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
CHANSVmImage* image;
if (util::is_valid_datap(hdr)) {
data* data = static_cast<savedata::data*>(*hdr->value.ptr_v);
CHANSVmObjHdr* arg0 = CHANSVmGetArgInteger(vm, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(vm, 1);
CHANSVmObjHdr* arg2 = CHANSVmGetArgInteger(vm, 2);
if (util::is_valid_datap(parentObj)) {
data* data = static_cast<savedata::data*>(*parentObj->value.ptr_v);
CHANSVmObjHdr* formatArg = CHANSVmGetArgInteger(vm, 0);
CHANSVmObjHdr* offsetArg = CHANSVmGetArgInteger(vm, 1);
CHANSVmObjHdr* bufferSizeArg = CHANSVmGetArgInteger(vm, 2);
if (arg0 == NULL) {
if (formatArg == NULL) {
goto exit;
}
u32 format = arg0->value.int_v;
u32 pitch = (arg1 != NULL) ? arg1->value.int_v : 0;
u32 bufSize = (arg2 != NULL) ? arg2->value.data.len : data->size;
u32 format = formatArg->value.int_v;
u32 dataOffset = (offsetArg != NULL) ? offsetArg->value.int_v : 0;
u32 bufSize = (bufferSizeArg != NULL) ? bufferSizeArg->value.data.len : data->size;
u8* src = data->pData + pitch;
u8* src = data->pData + dataOffset;
if (format != 4 && format != 6) {
goto exit;
@@ -443,10 +443,10 @@ namespace ipl {
u32 workSize = width * height * 3;
if (CHANSVmNewImageObject(vm, hdr2, NULL, (u16)width, (u16)height, (s32)(u8)format) == NULL) {
if (CHANSVmNewImageObject(vm, returnObj, NULL, (u16)width, (u16)height, (s32)(u8)format) == NULL) {
goto exit;
}
image = static_cast<CHANSVmImage*>(*hdr2->value.ptr_v);
image = static_cast<CHANSVmImage*>(*returnObj->value.ptr_v);
u8* workBuf = new (System::getCSManager()->getHeap(), 0x20) u8[workSize];
if (workBuf != NULL) {
@@ -466,101 +466,101 @@ namespace ipl {
return result;
}
BOOL get_size(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get_size(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
if (util::is_valid_datap(hdr)) {
data* data = static_cast<savedata::data*>(*hdr->value.ptr_v);
result = CHANSVmSetInteger(vm, hdr2, data->size) == CHANS_VM_OK;
if (util::is_valid_datap(parentObj)) {
data* data = static_cast<savedata::data*>(*parentObj->value.ptr_v);
result = CHANSVmSetInteger(vm, returnObj, data->size) == CHANS_VM_OK;
}
return result;
}
BOOL get_addr(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get_addr(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
u8* ptr = get_(vm, hdr);
u8* ptr = get_(vm, parentObj);
if (ptr != NULL) {
result = CHANSVmSetInteger(vm, hdr2, reinterpret_cast<vmInteger>(ptr)) == CHANS_VM_OK;
result = CHANSVmSetInteger(vm, returnObj, reinterpret_cast<vmInteger>(ptr)) == CHANS_VM_OK;
}
return result;
}
template <typename T>
BOOL get(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
u8* ptr = get_(vm, hdr);
u8* ptr = get_(vm, parentObj);
if (ptr != NULL) {
if ((u32)ptr & (sizeof(T) - 1)) {
} else {
result = CHANSVmSetInteger(vm, hdr2, static_cast<vmInteger>(*(const T*)ptr)) == CHANS_VM_OK;
result = CHANSVmSetInteger(vm, returnObj, static_cast<vmInteger>(*(const T*)ptr)) == CHANS_VM_OK;
}
}
return result;
}
template <>
BOOL get<float>(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get<float>(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
u8* ptr = get_(vm, hdr);
u8* ptr = get_(vm, parentObj);
if (ptr != NULL && ((u32)ptr & 3) == 0) {
result = CHANSVmSetFloat(vm, hdr2, *reinterpret_cast<f32*>(ptr)) == CHANS_VM_OK;
result = CHANSVmSetFloat(vm, returnObj, *reinterpret_cast<f32*>(ptr)) == CHANS_VM_OK;
}
return result;
}
BOOL get_str(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get_str(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(vm, 1);
u8* ptr = get_(vm, hdr);
if (ptr != NULL && arg1 != NULL) {
result = CHANSVmSetU16StringFromU8(vm, hdr2, reinterpret_cast<char*>(ptr), arg1->value.int_v) == CHANS_VM_OK;
CHANSVmObjHdr* lengthArg = CHANSVmGetArgInteger(vm, 1);
u8* ptr = get_(vm, parentObj);
if (ptr != NULL && lengthArg != NULL) {
result = CHANSVmSetU16StringFromU8(vm, returnObj, reinterpret_cast<char*>(ptr), lengthArg->value.int_v) == CHANS_VM_OK;
}
return result;
}
BOOL get_wstr(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get_wstr(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(vm, 1);
u8* ptr = get_(vm, hdr);
if (ptr != NULL && arg1 != NULL) {
result = CHANSVmSetU16String(vm, hdr2, (wchar_t*)ptr, arg1->value.int_v * 2) == CHANS_VM_OK;
CHANSVmObjHdr* lengthArg = CHANSVmGetArgInteger(vm, 1);
u8* ptr = get_(vm, parentObj);
if (ptr != NULL && lengthArg != NULL) {
result = CHANSVmSetU16String(vm, returnObj, (wchar_t*)ptr, lengthArg->value.int_v * 2) == CHANS_VM_OK;
}
return result;
}
u8* get_(CHANSVm* vm, CHANSVmObjHdr* hdr) {
u8* get_(CHANSVm* vm, CHANSVmObjHdr* parentObj) {
u8* buf = NULL;
if (util::is_valid_datap(hdr)) {
data* data = static_cast<savedata::data*>(*hdr->value.ptr_v);
if (util::is_valid_datap(parentObj)) {
data* data = static_cast<savedata::data*>(*parentObj->value.ptr_v);
buf = data->pData;
CHANSVmObjHdr* arg0 = CHANSVmGetArgInteger(vm, 0);
if (buf != NULL && arg0 != NULL) {
buf += arg0->value.int_v;
CHANSVmObjHdr* offsetArg = CHANSVmGetArgInteger(vm, 0);
if (buf != NULL && offsetArg != NULL) {
buf += offsetArg->value.int_v;
}
}
return buf;
}
BOOL calc_crc16(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL calc_crc16(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(vm, 1);
u8* ptr = get_(vm, hdr);
CHANSVmObjHdr* sizeArg = CHANSVmGetArgInteger(vm, 1);
u8* ptr = get_(vm, parentObj);
if (ptr != NULL) {
if (arg1 != NULL) {
u16 crc = NETCalcCRC16(ptr, arg1->value.int_v);
result = CHANSVmSetInteger(vm, hdr2, crc) == CHANS_VM_OK;
if (sizeArg != NULL) {
u16 crc = NETCalcCRC16(ptr, sizeArg->value.int_v);
result = CHANSVmSetInteger(vm, returnObj, crc) == CHANS_VM_OK;
}
}
return result;
}
BOOL calc_crc32(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL calc_crc32(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(vm, 1);
u8* ptr = get_(vm, hdr);
CHANSVmObjHdr* sizeArg = CHANSVmGetArgInteger(vm, 1);
u8* ptr = get_(vm, parentObj);
if (ptr != NULL) {
if (arg1 != NULL) {
u32 crc = NETCalcCRC32(ptr, arg1->value.int_v);
result = CHANSVmSetInteger(vm, hdr2, crc) == CHANS_VM_OK;
if (sizeArg != NULL) {
u32 crc = NETCalcCRC32(ptr, sizeArg->value.int_v);
result = CHANSVmSetInteger(vm, returnObj, crc) == CHANS_VM_OK;
}
}
return result;
@@ -580,22 +580,22 @@ namespace ipl {
return flag;
}
BOOL ctor(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL ctor(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
CHANSVmObjHdr* arg0 = CHANSVmGetArgString(vm, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgString(vm, 1);
if (arg0 != NULL) {
data* data = static_cast<savedata::data*>(CHANSVmNewObjData(vm, hdr2, sizeof(savedata::data)));
CHANSVmObjHdr* mountOrPathArg = CHANSVmGetArgString(vm, 0);
CHANSVmObjHdr* pathArg = CHANSVmGetArgString(vm, 1);
if (mountOrPathArg != NULL) {
data* data = static_cast<savedata::data*>(CHANSVmNewObjData(vm, returnObj, sizeof(savedata::data)));
if (data != NULL) {
wchar_t temp[MAX_PATH_LENGTH + sizeof(wchar_t)];
wchar_t widePath[MAX_PATH_LENGTH + sizeof(wchar_t)];
memset(data, 0, sizeof(savedata::data));
memset(temp, 0, sizeof(temp));
if (arg1 != NULL) {
util::utf16_to_ascii(data->sMountPath, temp, MAX_PATH_LENGTH, arg0);
memset(temp, 0, sizeof(temp));
util::utf16_to_ascii(data->sPath, temp, MAX_PATH_LENGTH, arg1);
memset(widePath, 0, sizeof(widePath));
if (pathArg != NULL) {
util::utf16_to_ascii(data->sMountPath, widePath, MAX_PATH_LENGTH, mountOrPathArg);
memset(widePath, 0, sizeof(widePath));
util::utf16_to_ascii(data->sPath, widePath, MAX_PATH_LENGTH, pathArg);
} else {
util::utf16_to_ascii(data->sPath, temp, MAX_PATH_LENGTH, arg0);
util::utf16_to_ascii(data->sPath, widePath, MAX_PATH_LENGTH, mountOrPathArg);
}
data->flag = 1;
result = TRUE;
@@ -624,7 +624,7 @@ namespace ipl {
DECOMP_FORCE_LITERAL(iplCSSavedata_cpp, util::get_int<COMPRESSION_RL>)
template <>
BOOL get<s8>(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2);
BOOL get<s8>(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj);
// clang-format off
const CHANSVmMethodList cMethodList[METHOD_COUNT] = {
@@ -660,12 +660,12 @@ namespace ipl {
template <>
BOOL get<s8>(CHANSVm* vm, CHANSVmObjHdr* hdr, CHANSVmObjHdr* hdr2) {
BOOL get<s8>(CHANSVm* vm, CHANSVmObjHdr* parentObj, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
u8* ptr = get_(vm, hdr);
u8* ptr = get_(vm, parentObj);
if (ptr != NULL) {
s8 val = *ptr;
result = CHANSVmSetInteger(vm, hdr2, val) == CHANS_VM_OK;
s8 signedByte = *ptr;
result = CHANSVmSetInteger(vm, returnObj, signedByte) == CHANS_VM_OK;
}
return result;
}

View File

@@ -26,19 +26,19 @@ namespace ipl {
nw4r::lyt::Size* data = (nw4r::lyt::Size*)CHANSVmNewObjData(VmInst, VmReturnObj, sizeof(*data));
if (data != NULL) {
CHANSVmObjHdr* arg0 = CHANSVmGetArgFloat(VmInst, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgFloat(VmInst, 1);
CHANSVmObjHdr* widthArg = CHANSVmGetArgFloat(VmInst, 0);
CHANSVmObjHdr* heightArg = CHANSVmGetArgFloat(VmInst, 1);
f32 width, height;
if (arg0 != NULL) {
width = arg0->value.float_v;
if (widthArg != NULL) {
width = widthArg->value.float_v;
} else {
width = 0.0;
}
if (arg1 != NULL) {
height = arg1->value.float_v;
if (heightArg != NULL) {
height = heightArg->value.float_v;
} else {
height = 0.0;
}
@@ -66,12 +66,12 @@ namespace ipl {
template <int I>
CHANSVmDefineMethod(set) {
BOOL result = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && arg != NULL) {
CHANSVmObjHdr* dimensionArg = CHANSVmGetArgFloat(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && dimensionArg != NULL) {
f32* data = static_cast<f32*>(*VmParentObj->value.ptr_v);
result = TRUE;
data[I] = arg->value.float_v;
data[I] = dimensionArg->value.float_v;
}
return result;
}

View File

@@ -7,11 +7,11 @@ namespace ipl {
namespace sound {
CHANSVmDefineMethod(start) {
BOOL result = FALSE;
CHANSVmObjHdr* arg0 = CHANSVmGetArgInteger(VmInst, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(VmInst, 1);
CHANSVmObjHdr* soundDataArg = CHANSVmGetArgInteger(VmInst, 0);
CHANSVmObjHdr* soundSizeArg = CHANSVmGetArgInteger(VmInst, 1);
void* data = arg0 != NULL ? (void*)arg0->value.data.len : NULL;
u32 size = arg1 != NULL ? arg1->value.data.len : 0;
void* data = soundDataArg != NULL ? (void*)soundDataArg->value.data.len : NULL;
u32 size = soundSizeArg != NULL ? soundSizeArg->value.data.len : 0;
if (System::getCSManager()->isValidAddr(data) && size != 0) {
if (snd::sSystem.checkTmpSoundFile(data, size)) {

View File

@@ -29,13 +29,13 @@ namespace ipl {
CHANSVmDefineMethod(set_font_size) {
BOOL result = FALSE;
CHANSVmObjHdr* arg0 = CHANSVmGetArgFloat(VmInst, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgFloat(VmInst, 1);
if (util::is_valid_datap(VmParentObj) && arg0 != NULL && arg1 != NULL) {
CHANSVmObjHdr* widthArg = CHANSVmGetArgFloat(VmInst, 0);
CHANSVmObjHdr* heightArg = CHANSVmGetArgFloat(VmInst, 1);
if (util::is_valid_datap(VmParentObj) && widthArg != NULL && heightArg != NULL) {
nw4r::ut::TextWriterBase<char>* data = (nw4r::ut::TextWriterBase<char>*)*VmParentObj->value.ptr_v;
if (data != NULL) {
f32 width = (f32)arg0->value.float_v;
f32 height = (f32)arg1->value.float_v;
f32 width = (f32)widthArg->value.float_v;
f32 height = (f32)heightArg->value.float_v;
data->SetFontSize(width, height);
result = TRUE;
}
@@ -45,12 +45,12 @@ namespace ipl {
CHANSVmDefineMethod(set_line_space) {
BOOL result = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && arg != NULL) {
CHANSVmObjHdr* lineSpaceArg = CHANSVmGetArgFloat(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && lineSpaceArg != NULL) {
nw4r::ut::TextWriterBase<char>* data = (nw4r::ut::TextWriterBase<char>*)*VmParentObj->value.ptr_v;
if (data != NULL) {
f32 val = (f32)arg->value.float_v;
data->SetLineSpace(val);
f32 lineSpace = (f32)lineSpaceArg->value.float_v;
data->SetLineSpace(lineSpace);
result = TRUE;
}
}
@@ -59,12 +59,12 @@ namespace ipl {
CHANSVmDefineMethod(set_char_space) {
BOOL result = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && arg != NULL) {
CHANSVmObjHdr* charSpaceArg = CHANSVmGetArgFloat(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && charSpaceArg != NULL) {
nw4r::ut::TextWriterBase<char>* data = (nw4r::ut::TextWriterBase<char>*)*VmParentObj->value.ptr_v;
if (data != NULL) {
f32 val = (f32)arg->value.float_v;
data->SetCharSpace(val);
f32 charSpace = (f32)charSpaceArg->value.float_v;
data->SetCharSpace(charSpace);
result = TRUE;
}
}
@@ -106,8 +106,8 @@ namespace ipl {
(nw4r::ut::TextWriterBase<char>*)CHANSVmNewObjData(VmInst, VmReturnObj, sizeof(nw4r::ut::TextWriterBase<char>));
if (data != NULL) {
{
nw4r::ut::TextWriterBase<char> temp;
*data = temp;
nw4r::ut::TextWriterBase<char> defaultWriter;
*data = defaultWriter;
}
result = TRUE;
}

View File

@@ -14,13 +14,13 @@ namespace ipl {
BOOL result = FALSE;
if (obj != NULL) {
BOOL found;
u64 iv = (u64)obj->value.int_v;
u32 len = (u32)iv;
u64 formatValue = (u64)obj->value.int_v;
u32 formatIndex = (u32)formatValue;
found = FALSE;
// Cleaning this part breaks the match...
if (!(iv > 14)) {
if (1 << len & 0x407F) {
if (!(formatValue > 14)) {
if (1 << formatIndex & 0x407F) {
found = TRUE;
}
}
@@ -39,20 +39,20 @@ namespace ipl {
return result;
}
BOOL init_tpl(CHANSVm* vm, CHANSVmObjHdr* hdr) {
BOOL init_tpl(CHANSVm* vm, CHANSVmObjHdr* returnObj) {
BOOL result = FALSE;
CHANSVmObjHdr* arg0 = CHANSVmGetArgInteger(vm, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(vm, 1);
u32 palette = arg0 != NULL ? arg0->value.int_v : 0;
u32 tplSize = arg1 != NULL ? arg1->value.int_v : 0;
CHANSVmObjHdr* paletteArg = CHANSVmGetArgInteger(vm, 0);
CHANSVmObjHdr* tplSizeArg = CHANSVmGetArgInteger(vm, 1);
u32 palette = paletteArg != NULL ? paletteArg->value.int_v : 0;
u32 tplSize = tplSizeArg != NULL ? tplSizeArg->value.int_v : 0;
utility::tpl_validity tpl(reinterpret_cast<TPLPalette*>(palette), tplSize);
channel::ChannelScriptManager* mgr = System::getCSManager();
if (mgr->isValidAddr((void*)palette) && (palette & 0x1F) == 0 && tpl.is_valid()) {
// TODO:
u32* data = static_cast<u32*>(CHANSVmNewObjData(vm, hdr, 0x24));
u32* data = static_cast<u32*>(CHANSVmNewObjData(vm, returnObj, 0x24));
if (data != NULL) {
result = TRUE;
data[0] = 0;
@@ -63,51 +63,51 @@ namespace ipl {
return result;
}
BOOL init_texobj(CHANSVm* vm, CHANSVmObjHdr* hdr, u32 addr) {
BOOL init_texobj(CHANSVm* vm, CHANSVmObjHdr* returnObj, u32 addr) {
BOOL result = FALSE;
CHANSVmObjHdr* arg1 = CHANSVmGetArgInteger(vm, 1);
CHANSVmObjHdr* arg2 = CHANSVmGetArgInteger(vm, 2);
CHANSVmObjHdr* arg3 = CHANSVmGetArgInteger(vm, 3);
CHANSVmObjHdr* arg4 = CHANSVmGetArgInteger(vm, 4);
CHANSVmObjHdr* arg5 = CHANSVmGetArgInteger(vm, 5);
CHANSVmObjHdr* widthArg = CHANSVmGetArgInteger(vm, 1);
CHANSVmObjHdr* heightArg = CHANSVmGetArgInteger(vm, 2);
CHANSVmObjHdr* formatArg = CHANSVmGetArgInteger(vm, 3);
CHANSVmObjHdr* wrapSArg = CHANSVmGetArgInteger(vm, 4);
CHANSVmObjHdr* wrapTArg = CHANSVmGetArgInteger(vm, 5);
if (System::getCSManager()->isValidAddr((void*)addr) && (addr & 0x1F) == 0) {
// TODO: This was an inlined function but I wasn't able to get it to match after extracting it
BOOL arg1Valid = FALSE;
if (arg1 != NULL) {
BOOL widthValid = FALSE;
if (widthArg != NULL) {
BOOL isValid = FALSE;
u64 val1 = (u64)arg1->value.int_v;
if (val1 != 0 && val1 < 0x400) {
u64 widthValue = (u64)widthArg->value.int_v;
if (widthValue != 0 && widthValue < 0x400) {
isValid = TRUE;
}
if (isValid) {
arg1Valid = TRUE;
widthValid = TRUE;
}
}
if (arg1Valid) {
BOOL arg2Valid = FALSE;
if (arg2 != NULL) {
if (widthValid) {
BOOL heightValid = FALSE;
if (heightArg != NULL) {
BOOL isValid = FALSE;
u64 val2 = (u64)arg2->value.int_v;
if (val2 != 0 && val2 < 0x400) {
u64 heightValue = (u64)heightArg->value.int_v;
if (heightValue != 0 && heightValue < 0x400) {
isValid = TRUE;
}
if (isValid) {
arg2Valid = TRUE;
heightValid = TRUE;
}
}
if (arg2Valid && is_valid_fmt(arg3) && is_valid_wrap(arg4) && is_valid_wrap(arg5)) {
u32* data = static_cast<u32*>(CHANSVmNewObjData(vm, hdr, sizeof(GXTexObj) + sizeof(u32)));
if (heightValid && is_valid_fmt(formatArg) && is_valid_wrap(wrapSArg) && is_valid_wrap(wrapTArg)) {
u32* data = static_cast<u32*>(CHANSVmNewObjData(vm, returnObj, sizeof(GXTexObj) + sizeof(u32)));
if (data != NULL) {
// What is this value?
data[0] = 1;
u16 width = (u16)arg1->value.int_v;
u16 height = (u16)arg2->value.int_v;
u16 width = (u16)widthArg->value.int_v;
u16 height = (u16)heightArg->value.int_v;
// Access the GXTexObj area in the newly allocated objdata with a 4byte offset. Using struct member access does not match
GXInitTexObj((GXTexObj*)(data + 1), (void*)addr, width, height, (GXTexFmt)arg3->value.int_v,
(GXTexWrapMode)arg4->value.int_v, (GXTexWrapMode)arg5->value.int_v, GX_FALSE);
GXInitTexObj((GXTexObj*)(data + 1), (void*)addr, width, height, (GXTexFmt)formatArg->value.int_v,
(GXTexWrapMode)wrapSArg->value.int_v, (GXTexWrapMode)wrapTArg->value.int_v, GX_FALSE);
result = TRUE;
}
}
@@ -123,10 +123,10 @@ namespace ipl {
if (argc == 2) {
result = init_tpl(VmInst, VmReturnObj);
} else if (argc == 6) {
CHANSVmObjHdr* arg0 = CHANSVmGetArg(VmInst, 0);
if (CHANSVmCheckNativeInstance(arg0, "Image")) {
if (util::is_valid_datap(arg0)) {
u32 addr = *(u32*)*arg0->value.ptr_v;
CHANSVmObjHdr* imageArg = CHANSVmGetArg(VmInst, 0);
if (CHANSVmCheckNativeInstance(imageArg, "Image")) {
if (util::is_valid_datap(imageArg)) {
u32 addr = *(u32*)*imageArg->value.ptr_v;
result = init_texobj(VmInst, VmReturnObj, addr);
}
} else {

View File

@@ -27,26 +27,26 @@ namespace ipl {
math::VEC3* data = (math::VEC3*)CHANSVmNewObjData(VmInst, VmReturnObj, sizeof(*data));
if (data != NULL) {
CHANSVmObjHdr* arg0 = CHANSVmGetArgFloat(VmInst, 0);
CHANSVmObjHdr* arg1 = CHANSVmGetArgFloat(VmInst, 1);
CHANSVmObjHdr* arg2 = CHANSVmGetArgFloat(VmInst, 2);
CHANSVmObjHdr* xArg = CHANSVmGetArgFloat(VmInst, 0);
CHANSVmObjHdr* yArg = CHANSVmGetArgFloat(VmInst, 1);
CHANSVmObjHdr* zArg = CHANSVmGetArgFloat(VmInst, 2);
f32 x, y, z;
if (arg0 != NULL) {
x = arg0->value.float_v;
if (xArg != NULL) {
x = xArg->value.float_v;
} else {
x = 0.0;
}
if (arg1 != NULL) {
y = arg1->value.float_v;
if (yArg != NULL) {
y = yArg->value.float_v;
} else {
y = 0.0;
}
if (arg2 != NULL) {
z = arg2->value.float_v;
if (zArg != NULL) {
z = zArg->value.float_v;
} else {
z = 0.0;
}
@@ -75,12 +75,12 @@ namespace ipl {
template <int I>
CHANSVmDefineMethod(set) {
BOOL result = FALSE;
CHANSVmObjHdr* arg = CHANSVmGetArgFloat(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && arg != NULL) {
CHANSVmObjHdr* componentArg = CHANSVmGetArgFloat(VmInst, 0);
if (util::is_valid_datap(VmParentObj) && componentArg != NULL) {
f32* data = (f32*)*VmParentObj->value.ptr_v;
result = TRUE;
data[I] = arg->value.float_v;
data[I] = componentArg->value.float_v;
}
return result;
}

View File

@@ -364,13 +364,13 @@ namespace textinput {
}
const char* name = paneComponent->getPane()->GetName();
if (name[0] == 'B') {
char tmp[17];
char paneName[17];
// open-coded util::replaceChar
memset(tmp, 0, 17);
strncpy(tmp, name, strlen(name));
tmp[0] = 'P';
memset(paneName, 0, 17);
strncpy(paneName, name, strlen(name));
paneName[0] = 'P';
AnmPane* pane = static_cast<AnmPane*>(mpLayoutByNW4R->searchAnmPane(tmp));
AnmPane* pane = static_cast<AnmPane*>(mpLayoutByNW4R->searchAnmPane(paneName));
if (pane != NULL) {
switch (event) {
case ON_TRIG: {
@@ -392,13 +392,13 @@ namespace textinput {
}
if (event == ON_TRIG && (input->trigger & 0x800)) {
char tmp[17];
char paneName[17];
// open-coded util::replaceChar
memset(tmp, 0, 17);
strncpy(tmp, name, strlen(name));
tmp[0] = 'P';
memset(paneName, 0, 17);
strncpy(paneName, name, strlen(name));
paneName[0] = 'P';
inputform::Base::PredictMode mode = getPredictModeFromBPaneName(tmp);
inputform::Base::PredictMode mode = getPredictModeFromBPaneName(paneName);
if (mode != inputform::Base::PM_End) {
mpLayoutByNW4R->setPredictMode(mode);
mpLayoutByNW4R->startToClose();

View File

@@ -377,9 +377,9 @@ namespace textinput {
void EventHandler::onTiEvent(gui::PaneComponent* paneComponent, u32 event, Input* input) {
const char* name = paneComponent->getPane()->GetName();
if (name[0] == 'B') {
char tmp[17];
util::replaceChar(tmp, sizeof(tmp), name, 0, 'P');
AnmPane* pane = static_cast<AnmPane*>(mpLayoutByNW4R->searchAnmPane(tmp));
char paneName[17];
util::replaceChar(paneName, sizeof(paneName), name, 0, 'P');
AnmPane* pane = static_cast<AnmPane*>(mpLayoutByNW4R->searchAnmPane(paneName));
if (pane != NULL) {
switch (event) {
case ON_TRIG: {
@@ -401,16 +401,16 @@ namespace textinput {
}
}
if (event == ON_TRIG && (input->trigger & 0x800)) {
if (util::strcmp(tmp, "P_BT_confirm")) {
if (util::strcmp(paneName, "P_BT_confirm")) {
mpLayoutByNW4R->onOK();
} else if (util::strcmp(tmp, "P_BT_cancel")) {
} else if (util::strcmp(paneName, "P_BT_cancel")) {
mpLayoutByNW4R->onCancel();
} else if (util::strcmp(tmp, "P_kyChng_QWERTY")) {
} else if (util::strcmp(paneName, "P_kyChng_QWERTY")) {
if (!mpLayoutByNW4R->isQwerty()) {
mpLayoutByNW4R->searchAnmPane("P_kyChng_CP")->changeAnimation(6);
}
mpLayoutByNW4R->setQwertyWithSE(true);
} else if (util::strcmp(tmp, "P_kyChng_CP")) {
} else if (util::strcmp(paneName, "P_kyChng_CP")) {
if (mpLayoutByNW4R->isQwerty()) {
mpLayoutByNW4R->searchAnmPane("P_kyChng_QWERTY")->changeAnimation(6);
}

View File

@@ -164,17 +164,17 @@ namespace ipl {
}
void TextBalloon::set_translate(const math::VEC3& trans) {
f32 temp0;
f32 screenMargin;
if (SCGetAspectRatio() == SC_ASPECT_RATIO_16x9) {
temp0 = mMargin16x9;
screenMargin = mMargin16x9;
} else {
temp0 = mMargin4x3;
screenMargin = mMargin4x3;
}
nw4r::lyt::Pane* balloonPane = mpLayout->FindPaneByName("N_Balloon");
f32 temp1 = 0.0f;
f32 alignmentOffset = 0.0f;
nw4r::ut::Rect proj16x9;
nw4r::ut::Rect proj4x3;
@@ -183,31 +183,31 @@ namespace ipl {
switch (mHAlign) {
case 1: {
temp1 = get_size("W_Base")->width / 2;
alignmentOffset = get_size("W_Base")->width / 2;
break;
}
case 2: {
temp1 = -get_size("W_Base")->width / 2;
alignmentOffset = -get_size("W_Base")->width / 2;
break;
}
}
if (mbUse16x9X == 0) {
temp1 *= proj4x3.GetWidth() / proj16x9.GetWidth();
alignmentOffset *= proj4x3.GetWidth() / proj16x9.GetWidth();
}
f32 temp2 = (trans.x + temp1) - (get_size("W_Base")->width / 2) - proj16x9.left;
f32 leftClearance = (trans.x + alignmentOffset) - (get_size("W_Base")->width / 2) - proj16x9.left;
f32 temp4 = proj16x9.right - (trans.x + temp1 + get_size("W_Base")->width / 2);
f32 temp3 = 0.0f;
f32 rightClearance = proj16x9.right - (trans.x + alignmentOffset + get_size("W_Base")->width / 2);
f32 edgeAdjustment = 0.0f;
if (temp2 < temp0) {
temp3 = temp0 - temp2;
} else if (temp4 < temp0) {
temp3 = temp4 - temp0;
if (leftClearance < screenMargin) {
edgeAdjustment = screenMargin - leftClearance;
} else if (rightClearance < screenMargin) {
edgeAdjustment = rightClearance - screenMargin;
}
math::VEC3 finalTrans(trans.x + temp3 + temp1, trans.y, trans.z);
math::VEC3 finalTrans(trans.x + edgeAdjustment + alignmentOffset, trans.y, trans.z);
balloonPane->SetTranslate(finalTrans);
}
@@ -229,7 +229,7 @@ namespace ipl {
nw4r::lyt::TextBox* textPane = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mpLayout->FindPaneByName("T_Balloon"));
if (!bNoLimit) {
f32 temp1 = 0.0f;
f32 ellipsisWidthAdjustment = 0.0f;
int extraLen = 0;
for (u32 i = strLen; i != 0; i--) {
@@ -237,7 +237,7 @@ namespace ipl {
textPane->CalculateMtx(*mpLayout->getDrawInfo());
nw4r::ut::Rect textRect = textPane->GetTextDrawRect(*mpLayout->getDrawInfo());
if (textRect.GetWidth() <= temp1 + 391.5f && i <= 20) {
if (textRect.GetWidth() <= ellipsisWidthAdjustment + 391.5f && i <= 20) {
break;
}
@@ -245,7 +245,7 @@ namespace ipl {
fullStr[i - 1] = NULL;
fullStr[i - 2] = L'…';
} else {
temp1 = -1.179962f;
ellipsisWidthAdjustment = -1.179962f;
extraLen = 2;
fullStr[i + 1] = NULL;
fullStr[i] = '.';
@@ -265,15 +265,15 @@ namespace ipl {
System::getProjectionRect16x9(&proj16x9);
f32 locationAdjust = proj16x9.GetWidth() / proj4x3.GetWidth();
f32 temp1 = SCGetAspectRatio() == SC_ASPECT_RATIO_16x9 ? locationAdjust : 1.0f;
f32 minimumWidthScale = SCGetAspectRatio() == SC_ASPECT_RATIO_16x9 ? locationAdjust : 1.0f;
nw4r::ut::Rect textRect = textPane->GetTextDrawRect(*mpLayout->getDrawInfo());
nw4r::lyt::Size newSize = *get_size("W_Base");
newSize.width = textRect.GetWidth() + 40.0f;
if (newSize.width < temp1 * 160.0f) {
newSize.width = temp1 * 160.0f;
if (newSize.width < minimumWidthScale * 160.0f) {
newSize.width = minimumWidthScale * 160.0f;
}
set_size("W_Base", newSize);

View File

@@ -801,29 +801,29 @@ s32 CArGBAOdh::cdj_c_flashBuffer(SArCDJ_OdhMaster* master) {
void CArGBAOdh::cdj_c_setQuantizationTable(SArCDJ_OdhMaster* master, u32 qualityScale) {
int i;
u32 temp;
u32 quantizationFactor;
u32 table;
u8 quantization[128];
for (table = 0; table < 2; table++) {
for (i = 0; i < 64; i++) {
temp = (qualityScale * gArCdj_std_quant_tbl[table * 64 + i] + 50) / 100;
if (temp == 0) {
temp = 1;
quantizationFactor = (qualityScale * gArCdj_std_quant_tbl[table * 64 + i] + 50) / 100;
if (quantizationFactor == 0) {
quantizationFactor = 1;
}
if (temp > 255) {
temp = 255;
if (quantizationFactor > 255) {
quantizationFactor = 255;
}
quantization[table * 64 + i] = temp;
quantization[table * 64 + i] = quantizationFactor;
}
}
for (table = 0; table < 2; table++) {
for (i = 0; i < 64; i++) {
temp = ((const u16*)gArAANScales)[i];
temp *= quantization[table * 64 + i];
temp = 0x4000000 / temp;
master->quantizationTables[table * 64 + i] = temp;
quantizationFactor = ((const u16*)gArAANScales)[i];
quantizationFactor *= quantization[table * 64 + i];
quantizationFactor = 0x4000000 / quantizationFactor;
master->quantizationTables[table * 64 + i] = quantizationFactor;
}
}
}
@@ -957,9 +957,9 @@ void CArGBAOdh::LineConv11(u8* source, u8* lumaOutput, u8* cbOutput, u8* crOutpu
}
}
void CArGBAOdh::fdct_fast(u32* coefficients, u8* samples, u32 stride, u32* quantizationTable) {
int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int tmp10, tmp11, tmp12, tmp13;
int z1, z2, z3, z4, z5, z11, z13;
int sum07, sum16, sum25, sum34, difference34, difference25, difference16, difference07;
int butterflySum0, butterflySum1, butterflyCrossTerm, evenDifference;
int evenRotation, oddRotation35, oddRotationBase, oddRotation17, sharedOddRotation, oddSum17, oddDifference35;
int* buffer;
int counter;
@@ -971,85 +971,85 @@ void CArGBAOdh::fdct_fast(u32* coefficients, u8* samples, u32 stride, u32* quant
buffer = (int*)coefficients;
for (counter = 0; counter < 8; counter++) {
tmp0 = buffer[0] + buffer[7];
tmp7 = buffer[0] - buffer[7];
tmp1 = buffer[1] + buffer[6];
tmp6 = buffer[1] - buffer[6];
tmp2 = buffer[2] + buffer[5];
tmp5 = buffer[2] - buffer[5];
tmp3 = buffer[3] + buffer[4];
tmp4 = buffer[3] - buffer[4];
sum07 = buffer[0] + buffer[7];
difference07 = buffer[0] - buffer[7];
sum16 = buffer[1] + buffer[6];
difference16 = buffer[1] - buffer[6];
sum25 = buffer[2] + buffer[5];
difference25 = buffer[2] - buffer[5];
sum34 = buffer[3] + buffer[4];
difference34 = buffer[3] - buffer[4];
tmp10 = tmp0 + tmp3;
tmp13 = tmp0 - tmp3;
tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2;
butterflySum0 = sum07 + sum34;
evenDifference = sum07 - sum34;
butterflySum1 = sum16 + sum25;
butterflyCrossTerm = sum16 - sum25;
buffer[0] = tmp10 + tmp11;
buffer[4] = tmp10 - tmp11;
buffer[0] = butterflySum0 + butterflySum1;
buffer[4] = butterflySum0 - butterflySum1;
z1 = (tmp12 + tmp13) * 181 >> 8;
buffer[2] = tmp13 + z1;
buffer[6] = tmp13 - z1;
evenRotation = (butterflyCrossTerm + evenDifference) * 181 >> 8;
buffer[2] = evenDifference + evenRotation;
buffer[6] = evenDifference - evenRotation;
tmp10 = tmp4 + tmp5;
tmp11 = tmp5 + tmp6;
tmp12 = tmp6 + tmp7;
butterflySum0 = difference34 + difference25;
butterflySum1 = difference25 + difference16;
butterflyCrossTerm = difference16 + difference07;
z5 = (tmp10 - tmp12) * 98 >> 8;
z2 = (tmp10 * 139 >> 8) + z5;
z4 = (tmp12 * 334 >> 8) + z5;
z3 = tmp11 * 181 >> 8;
sharedOddRotation = (butterflySum0 - butterflyCrossTerm) * 98 >> 8;
oddRotation35 = (butterflySum0 * 139 >> 8) + sharedOddRotation;
oddRotation17 = (butterflyCrossTerm * 334 >> 8) + sharedOddRotation;
oddRotationBase = butterflySum1 * 181 >> 8;
z11 = tmp7 + z3;
z13 = tmp7 - z3;
oddSum17 = difference07 + oddRotationBase;
oddDifference35 = difference07 - oddRotationBase;
buffer[5] = z13 + z2;
buffer[3] = z13 - z2;
buffer[1] = z11 + z4;
buffer[7] = z11 - z4;
buffer[5] = oddDifference35 + oddRotation35;
buffer[3] = oddDifference35 - oddRotation35;
buffer[1] = oddSum17 + oddRotation17;
buffer[7] = oddSum17 - oddRotation17;
buffer += 8;
}
buffer = (int*)coefficients;
for (counter = 0; counter < 8; counter++) {
tmp0 = buffer[0] + buffer[56];
tmp7 = buffer[0] - buffer[56];
tmp1 = buffer[8] + buffer[48];
tmp6 = buffer[8] - buffer[48];
tmp2 = buffer[16] + buffer[40];
tmp5 = buffer[16] - buffer[40];
tmp3 = buffer[24] + buffer[32];
tmp4 = buffer[24] - buffer[32];
sum07 = buffer[0] + buffer[56];
difference07 = buffer[0] - buffer[56];
sum16 = buffer[8] + buffer[48];
difference16 = buffer[8] - buffer[48];
sum25 = buffer[16] + buffer[40];
difference25 = buffer[16] - buffer[40];
sum34 = buffer[24] + buffer[32];
difference34 = buffer[24] - buffer[32];
tmp10 = tmp0 + tmp3;
tmp13 = tmp0 - tmp3;
tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2;
butterflySum0 = sum07 + sum34;
evenDifference = sum07 - sum34;
butterflySum1 = sum16 + sum25;
butterflyCrossTerm = sum16 - sum25;
buffer[0] = tmp10 + tmp11;
buffer[32] = tmp10 - tmp11;
buffer[0] = butterflySum0 + butterflySum1;
buffer[32] = butterflySum0 - butterflySum1;
z1 = (tmp12 + tmp13) * 181 >> 8;
buffer[16] = tmp13 + z1;
buffer[48] = tmp13 - z1;
evenRotation = (butterflyCrossTerm + evenDifference) * 181 >> 8;
buffer[16] = evenDifference + evenRotation;
buffer[48] = evenDifference - evenRotation;
tmp10 = tmp4 + tmp5;
tmp11 = tmp5 + tmp6;
tmp12 = tmp6 + tmp7;
butterflySum0 = difference34 + difference25;
butterflySum1 = difference25 + difference16;
butterflyCrossTerm = difference16 + difference07;
z5 = (tmp10 - tmp12) * 98 >> 8;
z2 = (tmp10 * 139 >> 8) + z5;
z4 = (tmp12 * 334 >> 8) + z5;
z3 = tmp11 * 181 >> 8;
sharedOddRotation = (butterflySum0 - butterflyCrossTerm) * 98 >> 8;
oddRotation35 = (butterflySum0 * 139 >> 8) + sharedOddRotation;
oddRotation17 = (butterflyCrossTerm * 334 >> 8) + sharedOddRotation;
oddRotationBase = butterflySum1 * 181 >> 8;
z11 = tmp7 + z3;
z13 = tmp7 - z3;
oddSum17 = difference07 + oddRotationBase;
oddDifference35 = difference07 - oddRotationBase;
buffer[40] = z13 + z2;
buffer[24] = z13 - z2;
buffer[8] = z11 + z4;
buffer[56] = z11 - z4;
buffer[40] = oddDifference35 + oddRotation35;
buffer[24] = oddDifference35 - oddRotation35;
buffer[8] = oddSum17 + oddRotation17;
buffer[56] = oddSum17 - oddRotation17;
buffer++;
}
@@ -1614,19 +1614,19 @@ finishBlock:
void CArGBAOdh::cdj_d_setDequantizationTable(SArCDJ_OdhMaster* master, u32 qualityScale) {
int i;
u32 temp;
u32 quantizationFactor;
u32 table;
for (table = 0; table < 2; table++) {
for (i = 0; i < 64; i++) {
temp = (qualityScale * gArCdj_std_quant_tbl[table * 64 + i] + 50) / 100;
if (temp == 0) {
temp = 1;
quantizationFactor = (qualityScale * gArCdj_std_quant_tbl[table * 64 + i] + 50) / 100;
if (quantizationFactor == 0) {
quantizationFactor = 1;
}
if (temp > 255) {
temp = 255;
if (quantizationFactor > 255) {
quantizationFactor = 255;
}
master->quantizationTables[table * 64 + i] = (temp * ((const u16*)gArAANScales)[i] + 2048) >> 12;
master->quantizationTables[table * 64 + i] = (quantizationFactor * ((const u16*)gArAANScales)[i] + 2048) >> 12;
}
}
}
@@ -2083,7 +2083,7 @@ s32 CArGBAOdh::huffmanDecoder(u32* coefficientOutput, SArCDJ_HuffmanRequest* req
do {
if ((u32)(bytesConsumed + 4) > sourceLimit) {
decodeResult = 0x80000003;
goto LAB_00013590;
goto finishDecode;
}
bitIndex = 1;
tableIndex = 0;
@@ -2110,7 +2110,7 @@ s32 CArGBAOdh::huffmanDecoder(u32* coefficientOutput, SArCDJ_HuffmanRequest* req
}
if (bitIndex > 6) {
decodeResult = 0x80000003;
goto LAB_00013590;
goto finishDecode;
}
if (valueCategory == 7) {
bitCountAndMask += bitIndex;
@@ -2127,7 +2127,7 @@ s32 CArGBAOdh::huffmanDecoder(u32* coefficientOutput, SArCDJ_HuffmanRequest* req
(u32)(bitBuffer >> ((0x20 - bitIndex) - valueCategory));
if ((tableIndex & (u32)(1 << (valueCategory - 1))) == 0) {
decodeResult = 0x80000003;
goto LAB_00013590;
goto finishDecode;
}
} else {
tableIndex = 0;
@@ -2145,7 +2145,7 @@ s32 CArGBAOdh::huffmanDecoder(u32* coefficientOutput, SArCDJ_HuffmanRequest* req
}
if ((u32)(bytesConsumed + 4) > sourceLimit) {
decodeResult = 0x80000003;
goto LAB_00013590;
goto finishDecode;
}
maximumBitLength = 0xB;
bitBuffer = ((u32)*sourceCursor << 0x18) | ((u32)sourceCursor[1] << 0x10) | ((u32)sourceCursor[2] << 8) | sourceCursor[3];
@@ -2175,7 +2175,7 @@ s32 CArGBAOdh::huffmanDecoder(u32* coefficientOutput, SArCDJ_HuffmanRequest* req
}
if (bitIndex > maxHuffmanBits) {
decodeResult = 0x80000003;
goto LAB_00013590;
goto finishDecode;
}
if (valueCategory > 0) {
magnitudeMask = (1 << (valueCategory)) - 1;
@@ -2205,14 +2205,14 @@ s32 CArGBAOdh::huffmanDecoder(u32* coefficientOutput, SArCDJ_HuffmanRequest* req
*request->bitCount = bitCountAndMask;
}
}
LAB_00013590:
finishDecode:
return decodeResult;
}
void CArGBAOdh::idct_fast(const u8* rangeLimitTable, u32* coefficients, u32* quantizationTable, u8* destination, u32 stride) {
int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int tmp10, tmp11, tmp12, tmp13;
int z5, z10, z11, z12, z13;
int evenPart0, evenPart1, evenPart2, evenPart3, oddPart3, oddPart2, oddPart1, oddPart0;
int butterflyTerm0, butterflyTerm1, butterflyTerm2, evenInnerSum;
int sharedOddRotation, oddDifference53, oddSum17, oddDifference17, oddSum53;
int* input;
int* quantization;
int* workspacePointer;
@@ -2243,51 +2243,51 @@ void CArGBAOdh::idct_fast(const u8* rangeLimitTable, u32* coefficients, u32* qua
continue;
}
tmp0 = input[0] * quantization[0];
tmp1 = input[16] * quantization[16];
tmp2 = input[32] * quantization[32];
tmp3 = input[48] * quantization[48];
evenPart0 = input[0] * quantization[0];
evenPart1 = input[16] * quantization[16];
evenPart2 = input[32] * quantization[32];
evenPart3 = input[48] * quantization[48];
tmp10 = tmp0 + tmp2;
tmp11 = tmp0 - tmp2;
butterflyTerm0 = evenPart0 + evenPart2;
butterflyTerm1 = evenPart0 - evenPart2;
tmp13 = tmp1 + tmp3;
tmp12 = ((tmp1 - tmp3) * 362 >> 8) - tmp13;
evenInnerSum = evenPart1 + evenPart3;
butterflyTerm2 = ((evenPart1 - evenPart3) * 362 >> 8) - evenInnerSum;
tmp0 = tmp10 + tmp13;
tmp3 = tmp10 - tmp13;
tmp1 = tmp11 + tmp12;
tmp2 = tmp11 - tmp12;
evenPart0 = butterflyTerm0 + evenInnerSum;
evenPart3 = butterflyTerm0 - evenInnerSum;
evenPart1 = butterflyTerm1 + butterflyTerm2;
evenPart2 = butterflyTerm1 - butterflyTerm2;
tmp4 = input[8] * quantization[8];
tmp5 = input[24] * quantization[24];
tmp6 = input[40] * quantization[40];
tmp7 = input[56] * quantization[56];
oddPart3 = input[8] * quantization[8];
oddPart2 = input[24] * quantization[24];
oddPart1 = input[40] * quantization[40];
oddPart0 = input[56] * quantization[56];
z13 = tmp6 + tmp5;
z10 = tmp6 - tmp5;
z11 = tmp4 + tmp7;
z12 = tmp4 - tmp7;
oddSum53 = oddPart1 + oddPart2;
oddDifference53 = oddPart1 - oddPart2;
oddSum17 = oddPart3 + oddPart0;
oddDifference17 = oddPart3 - oddPart0;
tmp7 = z11 + z13;
tmp11 = (z11 - z13) * 362 >> 8;
oddPart0 = oddSum17 + oddSum53;
butterflyTerm1 = (oddSum17 - oddSum53) * 362 >> 8;
z5 = (z10 + z12) * 473 >> 8;
tmp10 = (z12 * 277 >> 8) - z5;
tmp12 = (z10 * -669 >> 8) + z5;
sharedOddRotation = (oddDifference53 + oddDifference17) * 473 >> 8;
butterflyTerm0 = (oddDifference17 * 277 >> 8) - sharedOddRotation;
butterflyTerm2 = (oddDifference53 * -669 >> 8) + sharedOddRotation;
tmp6 = tmp12 - tmp7;
tmp5 = tmp11 - tmp6;
tmp4 = tmp10 + tmp5;
oddPart1 = butterflyTerm2 - oddPart0;
oddPart2 = butterflyTerm1 - oddPart1;
oddPart3 = butterflyTerm0 + oddPart2;
workspacePointer[0] = tmp0 + tmp7;
workspacePointer[56] = tmp0 - tmp7;
workspacePointer[8] = tmp1 + tmp6;
workspacePointer[48] = tmp1 - tmp6;
workspacePointer[16] = tmp2 + tmp5;
workspacePointer[40] = tmp2 - tmp5;
workspacePointer[32] = tmp3 + tmp4;
workspacePointer[24] = tmp3 - tmp4;
workspacePointer[0] = evenPart0 + oddPart0;
workspacePointer[56] = evenPart0 - oddPart0;
workspacePointer[8] = evenPart1 + oddPart1;
workspacePointer[48] = evenPart1 - oddPart1;
workspacePointer[16] = evenPart2 + oddPart2;
workspacePointer[40] = evenPart2 - oddPart2;
workspacePointer[32] = evenPart3 + oddPart3;
workspacePointer[24] = evenPart3 - oddPart3;
input++;
quantization++;
@@ -2312,41 +2312,41 @@ void CArGBAOdh::idct_fast(const u8* rangeLimitTable, u32* coefficients, u32* qua
continue;
}
tmp10 = workspacePointer[0] + workspacePointer[4];
tmp11 = workspacePointer[0] - workspacePointer[4];
butterflyTerm0 = workspacePointer[0] + workspacePointer[4];
butterflyTerm1 = workspacePointer[0] - workspacePointer[4];
tmp13 = workspacePointer[2] + workspacePointer[6];
tmp12 = ((workspacePointer[2] - workspacePointer[6]) * 362 >> 8) - tmp13;
evenInnerSum = workspacePointer[2] + workspacePointer[6];
butterflyTerm2 = ((workspacePointer[2] - workspacePointer[6]) * 362 >> 8) - evenInnerSum;
tmp0 = tmp10 + tmp13;
tmp3 = tmp10 - tmp13;
tmp1 = tmp11 + tmp12;
tmp2 = tmp11 - tmp12;
evenPart0 = butterflyTerm0 + evenInnerSum;
evenPart3 = butterflyTerm0 - evenInnerSum;
evenPart1 = butterflyTerm1 + butterflyTerm2;
evenPart2 = butterflyTerm1 - butterflyTerm2;
z13 = workspacePointer[5] + workspacePointer[3];
z10 = workspacePointer[5] - workspacePointer[3];
z11 = workspacePointer[1] + workspacePointer[7];
z12 = workspacePointer[1] - workspacePointer[7];
oddSum53 = workspacePointer[5] + workspacePointer[3];
oddDifference53 = workspacePointer[5] - workspacePointer[3];
oddSum17 = workspacePointer[1] + workspacePointer[7];
oddDifference17 = workspacePointer[1] - workspacePointer[7];
tmp7 = z11 + z13;
tmp11 = (z11 - z13) * 362 >> 8;
oddPart0 = oddSum17 + oddSum53;
butterflyTerm1 = (oddSum17 - oddSum53) * 362 >> 8;
z5 = (z10 + z12) * 473 >> 8;
tmp10 = (z12 * 277 >> 8) - z5;
tmp12 = (z10 * -669 >> 8) + z5;
sharedOddRotation = (oddDifference53 + oddDifference17) * 473 >> 8;
butterflyTerm0 = (oddDifference17 * 277 >> 8) - sharedOddRotation;
butterflyTerm2 = (oddDifference53 * -669 >> 8) + sharedOddRotation;
tmp6 = tmp12 - tmp7;
tmp5 = tmp11 - tmp6;
tmp4 = tmp10 + tmp5;
oddPart1 = butterflyTerm2 - oddPart0;
oddPart2 = butterflyTerm1 - oddPart1;
oddPart3 = butterflyTerm0 + oddPart2;
outputRow[0] = rangeLimitTable[(u32)(tmp0 + tmp7) >> 5 & 0x3FF];
outputRow[7] = rangeLimitTable[(u32)(tmp0 - tmp7) >> 5 & 0x3FF];
outputRow[1] = rangeLimitTable[(u32)(tmp1 + tmp6) >> 5 & 0x3FF];
outputRow[6] = rangeLimitTable[(u32)(tmp1 - tmp6) >> 5 & 0x3FF];
outputRow[2] = rangeLimitTable[(u32)(tmp2 + tmp5) >> 5 & 0x3FF];
outputRow[5] = rangeLimitTable[(u32)(tmp2 - tmp5) >> 5 & 0x3FF];
outputRow[4] = rangeLimitTable[(u32)(tmp3 + tmp4) >> 5 & 0x3FF];
outputRow[3] = rangeLimitTable[(u32)(tmp3 - tmp4) >> 5 & 0x3FF];
outputRow[0] = rangeLimitTable[(u32)(evenPart0 + oddPart0) >> 5 & 0x3FF];
outputRow[7] = rangeLimitTable[(u32)(evenPart0 - oddPart0) >> 5 & 0x3FF];
outputRow[1] = rangeLimitTable[(u32)(evenPart1 + oddPart1) >> 5 & 0x3FF];
outputRow[6] = rangeLimitTable[(u32)(evenPart1 - oddPart1) >> 5 & 0x3FF];
outputRow[2] = rangeLimitTable[(u32)(evenPart2 + oddPart2) >> 5 & 0x3FF];
outputRow[5] = rangeLimitTable[(u32)(evenPart2 - oddPart2) >> 5 & 0x3FF];
outputRow[4] = rangeLimitTable[(u32)(evenPart3 + oddPart3) >> 5 & 0x3FF];
outputRow[3] = rangeLimitTable[(u32)(evenPart3 - oddPart3) >> 5 & 0x3FF];
workspacePointer += 8;
}

View File

@@ -493,47 +493,47 @@ int Rvl_decode_ash(u8* out, u8* in) {
u8* dst;
u32* inWordPtr;
u32 decodedSize;
u32 sym9;
u32 sym11;
u32 literalSymbol;
u32 distanceSymbol;
u32 nodeVal;
int needBits;
u16 nodeCount;
u16 nextNode;
u8* litPtr;
int bitOff1;
u32 bitPos1;
u8* copySource;
int literalWordOffset;
u32 literalBitPosition;
u32 shifted;
u32 bitWord1;
u32 tmp15;
u32 literalBitWord;
u32 decodeBitsOrCount;
int stackDepth;
int bitOff2;
u32 bitPos2;
u32 bitWord2;
u32 tmp20;
int distanceWordOffset;
u32 distanceBitPosition;
u32 distanceBitWord;
u32 nextDistanceBits;
u16* stackPtr;
decodedSize = *(u32*)(in + 4) & 0xffffff;
bitOff1 = 0x10;
bitPos1 = 0;
bitPos2 = 0;
bitWord2 = *(u32*)(*(int*)(in + 8) + in);
bitOff2 = *(int*)(in + 8) + 4;
literalWordOffset = 0x10;
literalBitPosition = 0;
distanceBitPosition = 0;
distanceBitWord = *(u32*)(*(int*)(in + 8) + in);
distanceWordOffset = *(int*)(in + 8) + 4;
stackPtr = (u16*)&work[0x4ff8];
nodeCount = 0x200;
stackDepth = 0;
bitWord1 = *(u32*)(in + 0xc);
literalBitWord = *(u32*)(in + 0xc);
nextNode = 0x200;
do {
while (1) {
if (bitPos1 == 0x1f) {
shifted = *(u32*)(in + bitOff1);
bitPos1 = 0;
bitOff1 = bitOff1 + 4;
if (literalBitPosition == 0x1f) {
shifted = *(u32*)(in + literalWordOffset);
literalBitPosition = 0;
literalWordOffset = literalWordOffset + 4;
} else {
bitPos1 = bitPos1 + 1;
shifted = bitWord1 << 1;
literalBitPosition = literalBitPosition + 1;
shifted = literalBitWord << 1;
}
if (-1 < (int)bitWord1) {
if (-1 < (int)literalBitWord) {
break;
}
*stackPtr = nextNode | 0x8000;
@@ -541,26 +541,26 @@ int Rvl_decode_ash(u8* out, u8* in) {
stackPtr = stackPtr + 2;
stackDepth = stackDepth + 2;
nodeCount = nodeCount + 1;
bitWord1 = shifted;
literalBitWord = shifted;
nextNode = nextNode + 1;
}
needBits = bitPos1 + 9;
needBits = literalBitPosition + 9;
if (needBits < 0x21) {
sym9 = shifted >> 0x17;
literalSymbol = shifted >> 0x17;
if (needBits == 0x20) {
bitWord1 = *(u32*)(in + bitOff1);
bitPos1 = 0;
bitOff1 = bitOff1 + 4;
literalBitWord = *(u32*)(in + literalWordOffset);
literalBitPosition = 0;
literalWordOffset = literalWordOffset + 4;
} else {
bitWord1 = shifted << 9;
bitPos1 = bitPos1 + 9;
literalBitWord = shifted << 9;
literalBitPosition = literalBitPosition + 9;
}
} else {
inWordPtr = (u32*)(in + bitOff1);
bitOff1 = bitOff1 + 4;
sym9 = shifted >> 0x17 | *inWordPtr >> (0x40U - needBits & 0x3f);
bitPos1 = bitPos1 - 0x17;
bitWord1 = *inWordPtr << (bitPos1 & 0x3f);
inWordPtr = (u32*)(in + literalWordOffset);
literalWordOffset = literalWordOffset + 4;
literalSymbol = shifted >> 0x17 | *inWordPtr >> (0x40U - needBits & 0x3f);
literalBitPosition = literalBitPosition - 0x17;
literalBitWord = *inWordPtr << (literalBitPosition & 0x3f);
}
while (1) {
stackPtr = stackPtr - 1;
@@ -570,23 +570,23 @@ int Rvl_decode_ash(u8* out, u8* in) {
if ((nextNode & 0x8000) == 0) {
break;
}
*(u16*)(&work[0x7fe] + needBits) = (u16)sym9;
sym9 = nextNode & 0x3fff;
*(u16*)(&work[0x7fe] + needBits) = (u16)literalSymbol;
literalSymbol = nextNode & 0x3fff;
if (stackDepth == 0) {
nodeCount = 0x800;
stackDepth = 0;
nextNode = 0x800;
do {
while (1) {
if (bitPos2 == 0x1f) {
shifted = *(u32*)(in + bitOff2);
bitPos2 = 0;
bitOff2 = bitOff2 + 4;
if (distanceBitPosition == 0x1f) {
shifted = *(u32*)(in + distanceWordOffset);
distanceBitPosition = 0;
distanceWordOffset = distanceWordOffset + 4;
} else {
bitPos2 = bitPos2 + 1;
shifted = bitWord2 << 1;
distanceBitPosition = distanceBitPosition + 1;
shifted = distanceBitWord << 1;
}
if (-1 < (int)bitWord2) {
if (-1 < (int)distanceBitWord) {
break;
}
*stackPtr = nextNode | 0x8000;
@@ -594,26 +594,26 @@ int Rvl_decode_ash(u8* out, u8* in) {
stackPtr = stackPtr + 2;
stackDepth = stackDepth + 2;
nodeCount = nodeCount + 1;
bitWord2 = shifted;
distanceBitWord = shifted;
nextNode = nextNode + 1;
}
needBits = bitPos2 + 0xb;
needBits = distanceBitPosition + 0xb;
if (needBits < 0x21) {
sym11 = shifted >> 0x15;
distanceSymbol = shifted >> 0x15;
if (needBits == 0x20) {
bitWord2 = *(u32*)(in + bitOff2);
bitPos2 = 0;
bitOff2 = bitOff2 + 4;
distanceBitWord = *(u32*)(in + distanceWordOffset);
distanceBitPosition = 0;
distanceWordOffset = distanceWordOffset + 4;
} else {
bitWord2 = shifted << 0xb;
bitPos2 = bitPos2 + 0xb;
distanceBitWord = shifted << 0xb;
distanceBitPosition = distanceBitPosition + 0xb;
}
} else {
inWordPtr = (u32*)(in + bitOff2);
bitOff2 = bitOff2 + 4;
sym11 = shifted >> 0x15 | *inWordPtr >> (0x40U - needBits & 0x3f);
bitPos2 = bitPos2 - 0x15;
bitWord2 = *inWordPtr << (bitPos2 & 0x3f);
inWordPtr = (u32*)(in + distanceWordOffset);
distanceWordOffset = distanceWordOffset + 4;
distanceSymbol = shifted >> 0x15 | *inWordPtr >> (0x40U - needBits & 0x3f);
distanceBitPosition = distanceBitPosition - 0x15;
distanceBitWord = *inWordPtr << (distanceBitPosition & 0x3f);
}
while (1) {
stackPtr = stackPtr - 1;
@@ -623,91 +623,91 @@ int Rvl_decode_ash(u8* out, u8* in) {
if ((nextNode & 0x8000) == 0) {
break;
}
*(u16*)(&work[0x2ffa] + needBits) = (u16)sym11;
sym11 = nextNode & 0x3fff;
nodeVal = sym9;
*(u16*)(&work[0x2ffa] + needBits) = (u16)distanceSymbol;
distanceSymbol = nextNode & 0x3fff;
nodeVal = literalSymbol;
shifted = decodedSize;
if (stackDepth == 0) {
do {
while (0x1ff < nodeVal) {
if (bitPos1 == 0x1f) {
tmp15 = *(u32*)(in + bitOff1);
bitOff1 = bitOff1 + 4;
bitPos1 = 0;
if (literalBitPosition == 0x1f) {
decodeBitsOrCount = *(u32*)(in + literalWordOffset);
literalWordOffset = literalWordOffset + 4;
literalBitPosition = 0;
} else {
bitPos1 = bitPos1 + 1;
tmp15 = bitWord1 << 1;
literalBitPosition = literalBitPosition + 1;
decodeBitsOrCount = literalBitWord << 1;
}
if ((int)bitWord1 < 0) {
if ((int)literalBitWord < 0) {
nodeVal = *(u16*)(&work[0x7fe] + nodeVal * 2);
bitWord1 = tmp15;
literalBitWord = decodeBitsOrCount;
} else {
nodeVal = *(u16*)((u8*)work + nodeVal * 2);
bitWord1 = tmp15;
literalBitWord = decodeBitsOrCount;
}
}
tmp15 = sym11;
decodeBitsOrCount = distanceSymbol;
if (nodeVal < 0x100) {
*out = (char)nodeVal;
out = out + 1;
shifted = shifted - 1;
} else {
while (0x7ff < tmp15) {
if (bitPos2 == 0x1f) {
tmp20 = *(u32*)(in + bitOff2);
bitOff2 = bitOff2 + 4;
bitPos2 = 0;
while (0x7ff < decodeBitsOrCount) {
if (distanceBitPosition == 0x1f) {
nextDistanceBits = *(u32*)(in + distanceWordOffset);
distanceWordOffset = distanceWordOffset + 4;
distanceBitPosition = 0;
} else {
bitPos2 = bitPos2 + 1;
tmp20 = bitWord2 << 1;
distanceBitPosition = distanceBitPosition + 1;
nextDistanceBits = distanceBitWord << 1;
}
if ((int)bitWord2 < 0) {
tmp15 = *(u16*)(&work[0x2ffa] + tmp15 * 2);
bitWord2 = tmp20;
if ((int)distanceBitWord < 0) {
decodeBitsOrCount = *(u16*)(&work[0x2ffa] + decodeBitsOrCount * 2);
distanceBitWord = nextDistanceBits;
} else {
tmp15 = *(u16*)(&work[0xffc] + tmp15 * 2);
bitWord2 = tmp20;
decodeBitsOrCount = *(u16*)(&work[0xffc] + decodeBitsOrCount * 2);
distanceBitWord = nextDistanceBits;
}
}
nodeVal = nodeVal - 0xfd;
litPtr = out - tmp15;
copySource = out - decodeBitsOrCount;
shifted = shifted - nodeVal;
tmp15 = nodeVal >> 3;
if (tmp15 == 0) {
decodeBitsOrCount = nodeVal >> 3;
if (decodeBitsOrCount == 0) {
goto copy_lit_tail;
}
do {
*out = litPtr[-1];
out[1] = *litPtr;
out[2] = litPtr[1];
out[3] = litPtr[2];
out[4] = litPtr[3];
out[5] = litPtr[4];
out[6] = litPtr[5];
out[7] = litPtr[6];
litPtr = litPtr + 8;
*out = copySource[-1];
out[1] = *copySource;
out[2] = copySource[1];
out[3] = copySource[2];
out[4] = copySource[3];
out[5] = copySource[4];
out[6] = copySource[5];
out[7] = copySource[6];
copySource = copySource + 8;
out = out + 8;
tmp15 = tmp15 - 1;
} while (tmp15 != 0);
decodeBitsOrCount = decodeBitsOrCount - 1;
} while (decodeBitsOrCount != 0);
for (nodeVal = nodeVal & 7; nodeVal != 0; nodeVal = nodeVal - 1) {
copy_lit_tail:
dst = litPtr - 1;
litPtr = litPtr + 1;
dst = copySource - 1;
copySource = copySource + 1;
*out = *dst;
out = out + 1;
}
}
nodeVal = sym9;
nodeVal = literalSymbol;
} while (shifted != 0);
return decodedSize;
}
}
*(u16*)(&work[0xffc] + needBits) = (u16)sym11;
*(u16*)(&work[0xffc] + needBits) = (u16)distanceSymbol;
nextNode = nodeCount;
} while (1);
}
}
*(u16*)((u8*)work + needBits) = (u16)sym9;
*(u16*)((u8*)work + needBits) = (u16)literalSymbol;
nextNode = nodeCount;
} while (1);
}

View File

@@ -0,0 +1,637 @@
# rx31 rename evidence and verification
Base: `901fe028`. Branch: `agent/w1005/rx31`. Target: 43U.
This readability round changes identifier names only. Acceptance requires unchanged
source tokens except renamed identifiers, unchanged object code/data sections and
objdiff scores, unchanged string pools, a full gate pass with zero regressions,
and DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`.
The fresh baseline covers 1,027 built source objects. Before-edit reports,
allocated-section hashes, focused objects and instruction-exact counts are saved
under `/tmp/rx31.*` and `/tmp/rx31.before/`. Only this worktree and `/tmp` are written.
## Ownership review
- Scroller `unk_0x3C` is accessed by excluded `src/scene/sdChannelMemory/iplSDMemory.cpp`; keep its declaration and all uses.
- JPEG `unk_0x24` and `unk_0x2C` are declared and used in excluded TMC_JPEG files; keep the uses in `iplJpegDecoder.cpp`.
- Memory card placeholders are shared with excluded memoryCard and cardSequence source; keep their header declarations.
- Exception placeholders and System::Arg `unk_0x1C` are used in excluded `iplException.cpp` and `iplSystem.cpp`.
- `unk_0x2C` is a virtual function name in APScanThread and its declarations; real function renames are forbidden and iplAOSSThread belongs to another worker.
- SDChannelTitle `unk_0x58` belongs to the excluded SDChannelTitle class and is retained.
- GX `field_rendering`/`field_mode` and stdio `field_width`/`field_width_specified` name real rendering and formatting fields. They are not placeholders.
- `NANDOpenClose.c` retains `/tmp/sys` strings and descriptive temporary-path names. Its callback `arg` parameters and numbered completion-state enums have call-derived names in the final diff.
## Retained placeholders at ownership boundaries
These declarations or uses remain unchanged for the ownership and real-function reasons listed above. The table excludes explicitly forbidden source paths; their shared headers and owned-side uses are still shown.
| File | Before -> after | Names |
| --- | ---: | --- |
| `include/iplMemoryCardLib.h` | 8 -> 8 | `unk_0x06, unk_0x0C, unk_0x0E, unk_0x12, unk_0x01, unk_0x02, unk_0x07` |
| `include/scene/memoryCard/iplMemoryCardBase.h` | 8 -> 8 | `unk_0x04, unk_0x24, unk_0x08` |
| `include/scene/memoryCard/iplMemoryCardManager.h` | 1 -> 1 | `unk_0x08` |
| `include/scene/sdChannelTitle/iplSDChannelTitle.h` | 1 -> 1 | `unk_0x58` |
| `include/scene/setting/iplAPScanThread.h` | 2 -> 2 | `unk_0x2C` |
| `include/system/iplException.h` | 2 -> 2 | `unk_0x04, unk_0x0C` |
| `include/system/iplSystem.h` | 1 -> 1 | `unk_0x1C` |
| `include/utility/iplScroller.h` | 2 -> 2 | `unk_0x3C` |
| `src/scene/setting/iplAOSSThread.cpp` | 1 -> 1 | `unk_0x2C` |
| `src/scene/setting/iplRakuRakuThread.cpp` | 1 -> 1 | `unk_0x2C` |
| `src/utility/iplJpegDecoder.cpp` | 6 -> 6 | `unk_0x24, unk_0x2C` |
| `src/utility/iplUtility.cpp` | 13 -> 13 | `unk_0x3C` |
## Counts
Renamed 1192 identifier occurrences across 24 source files. Placeholder occurrences in the 29 assigned source files: 819 -> 0. Counts exclude comments and literals. The inventory covers `tmpN`, `tempN`, `arg`/`argN`, `aN`, `CONCAT*`, `unk_*`, `field_*`, `valN`, `hdrN`, numbered `NAND_STATE_N` enums, and hexadecimal `LAB_` labels. Other descriptive renames are included in the final column.
| File | Placeholders before -> after | Renamed identifier occurrences |
| --- | ---: | ---: |
| `libs/NW4R/src/math/math_types.cpp` | 9 -> 0 | 9 |
| `libs/RVL_SDK/src/card/CARDUnlock.c` | 18 -> 0 | 28 |
| `libs/RVL_SDK/src/dsp/dsp.c` | 13 -> 0 | 13 |
| `libs/RVL_SDK/src/nand/NANDOpenClose.c` | 47 -> 0 | 47 |
| `libs/RevoEX/src/nwc24/NWC24Manage.c` | 12 -> 0 | 12 |
| `libs/RevoEX/src/ssl/ssl_api.c` | 18 -> 0 | 18 |
| `src/channelScript/systemmenu/iplCSAnim.cpp` | 39 -> 0 | 96 |
| `src/channelScript/systemmenu/iplCSColor.cpp` | 34 -> 0 | 44 |
| `src/channelScript/systemmenu/iplCSFont.cpp` | 0 -> 0 | 0 |
| `src/channelScript/systemmenu/iplCSGX.cpp` | 0 -> 0 | 0 |
| `src/channelScript/systemmenu/iplCSImage.cpp` | 0 -> 0 | 0 |
| `src/channelScript/systemmenu/iplCSLayout.cpp` | 11 -> 0 | 11 |
| `src/channelScript/systemmenu/iplCSMaterial.cpp` | 44 -> 0 | 65 |
| `src/channelScript/systemmenu/iplCSMtx.cpp` | 3 -> 0 | 3 |
| `src/channelScript/systemmenu/iplCSPane.cpp` | 54 -> 0 | 56 |
| `src/channelScript/systemmenu/iplCSRect.cpp` | 18 -> 0 | 18 |
| `src/channelScript/systemmenu/iplCSSavedata.cpp` | 102 -> 0 | 156 |
| `src/channelScript/systemmenu/iplCSSize.cpp` | 9 -> 0 | 9 |
| `src/channelScript/systemmenu/iplCSSound.cpp` | 6 -> 0 | 6 |
| `src/channelScript/systemmenu/iplCSSystem.cpp` | 0 -> 0 | 0 |
| `src/channelScript/systemmenu/iplCSTextWriter.cpp` | 14 -> 0 | 18 |
| `src/channelScript/systemmenu/iplCSTexture.cpp` | 33 -> 0 | 48 |
| `src/channelScript/systemmenu/iplCSUtil.cpp` | 0 -> 0 | 0 |
| `src/channelScript/systemmenu/iplCSVector.cpp` | 12 -> 0 | 12 |
| `src/keyboard/tiPredictLang.cpp` | 10 -> 0 | 10 |
| `src/keyboard/tiToolBar.cpp` | 8 -> 0 | 8 |
| `src/scene/textBalloon/iplBalloon.cpp` | 30 -> 0 | 30 |
| `src/system/odh.cpp` | 253 -> 0 | 337 |
| `src/system/rvl_dec.c` | 22 -> 0 | 138 |
## Rename evidence
### libs/NW4R/src/math/math_types.cpp
- `VEC4Transform`: `tmp -> transformed`. Stores matrix-vector multiplication components before copying them to pOut, preserving alias safety. 9 occurrences.
### libs/RVL_SDK/src/card/CARDUnlock.c
- `GetInitVal`: `tmp -> unlockAddress`. Returned value combines 0x7fec8000 with random bits, masks to 4 KiB, and becomes ReadArrayUnlock address. 5 occurrences.
- `DummyLen`: `tmp -> extraReadLength`. Randomized extra byte count used in ReadArrayUnlock lengths and scramble shifts; clamped to at least four. 13 occurrences.
- `DummyLen`: `wk -> seedShift`. Shifts OSGetTick before reseeding, cycling from 1 through 16. 6 occurrences.
- `DummyLen`: `max -> retryCount`. Counts reseeding attempts while the generated length is below four, capped at ten. 4 occurrences.
### libs/RVL_SDK/src/dsp/dsp.c
- `DSPAssertInt and DSPInit`: `tmp -> controlStatus`. Reads DSP_CONTROL_STATUS, changes interrupt/reset/halt flags, and writes the same register. 13 occurrences.
### libs/RVL_SDK/src/nand/NANDOpenClose.c
- `NAND asynchronous callbacks and completion states`: `arg -> callbackContext`. ISFS callback context is cast to NANDCommandBlock and forwarded through subsequent async operations. 31 occurrences.
- `NAND asynchronous callbacks and completion states`: `NAND_STATE_9 -> NAND_STATE_OPEN_COMPLETE`. After the seek-to-start completion, marks the safe-open file and calls its completion callback. 2 occurrences.
- `NAND asynchronous callbacks and completion states`: `NAND_STATE_10 -> NAND_STATE_CLOSE_TEMP_FILE`. Selected immediately before closing the safe-open temporary file descriptor. 2 occurrences.
- `NAND asynchronous callbacks and completion states`: `NAND_STATE_11 -> NAND_STATE_CLOSE_ORIGINAL_FILE`. Dispatches ISFS_CloseAsync on info->origFd. 2 occurrences.
- `NAND asynchronous callbacks and completion states`: `NAND_STATE_12 -> NAND_STATE_RENAME_TEMP_FILE`. Dispatches ISFS_RenameAsync from tmpPath to origPath and handles its completion. 5 occurrences.
- `NAND asynchronous callbacks and completion states`: `NAND_STATE_13 -> NAND_STATE_DELETE_TEMP_DIR`. Finds the parent of tmpPath and dispatches ISFS_DeleteAsync on that directory. 2 occurrences.
- `NAND asynchronous callbacks and completion states`: `NAND_STATE_14 -> NAND_STATE_CLOSE_COMPLETE`. Marks the file closed and invokes the safe-close completion callback. 3 occurrences.
### libs/RevoEX/src/nwc24/NWC24Manage.c
- `NWC24InitFiles`: `arg1 -> generationReply`. Receives auxiliary word 3 of NWC24_IOCTL_GENERATE_USER_ID reply; NWC24InitFiles does not inspect it. 2 occurrences.
- `AnalyzeErrorCode`: `tmp -> errorNumber`. Holds the positive error-code digits while extracting them, then the two-digit subsystem error number. 10 occurrences.
### libs/RevoEX/src/ssl/ssl_api.c
- `SSLRead and SSLWrite`: `tmp -> alignedBuffer`. 32-byte aligned buffer stages leading and trailing bytes around direct IOS transfers. 18 occurrences.
### src/channelScript/systemmenu/iplCSAnim.cpp
- `Anim VM method parameters`: `hdr -> parentObj`. Native Anim receiver dereferenced to obtain layout::Animator. 45 occurrences.
- `Anim VM method parameters`: `hdr2 -> returnObj`. VM return slot passed to CHANSVmSetFloat or CHANSVmSetInteger by getters. 21 occurrences.
- `BOOL init_frame(`: `arg -> frameArg`. Value is passed to Animator::initAnmFrame. 3 occurrences.
- `BOOL set_max_frame(`: `arg -> maxFrameArg`. Value is passed to Animator::setMaxFrame. 3 occurrences.
- `BOOL set_max_frame(`: `val -> maxFrame`. Float conversion supplied to Animator::setMaxFrame. 4 occurrences.
- `BOOL set_min_frame(`: `arg -> minFrameArg`. Value is passed to Animator::setMinFrame. 3 occurrences.
- `BOOL set_min_frame(`: `val -> minFrame`. Float conversion supplied to Animator::setMinFrame. 4 occurrences.
- `BOOL set_current_frame(`: `arg -> currentFrameArg`. Value is passed to Animator::setCurrentFrame. 3 occurrences.
- `BOOL set_current_frame(`: `val -> currentFrame`. Float conversion supplied to Animator::setCurrentFrame. 2 occurrences.
- `BOOL set_type(`: `arg -> typeArg`. Value is passed to Animator::setAnmType. 3 occurrences.
- `BOOL set_delta(`: `arg -> speedArg`. Value is passed to Animator::setSpeed. 3 occurrences.
- `BOOL set_delta(`: `val -> speed`. Float conversion supplied to Animator::setSpeed. 2 occurrences.
### src/channelScript/systemmenu/iplCSColor.cpp
- `Color and GXColorS10 constructors`: `arg0 -> redArg`. Value is assigned to the color r component. 6 occurrences.
- `Color and GXColorS10 constructors`: `arg1 -> greenArg`. Value is assigned to the color g component. 6 occurrences.
- `Color and GXColorS10 constructors`: `arg2 -> blueArg`. Value is assigned to the color b component. 6 occurrences.
- `Color and GXColorS10 constructors`: `arg3 -> alphaArg`. Value is assigned to the color a component. 6 occurrences.
- `CHANSVmDefineMethod(ctor)`: `arg -> packedColorArg`. Single integer argument is reinterpreted as the packed GXColor. 3 occurrences.
- `CHANSVmDefineMethod(set)`: `arg -> componentArg`. Value updates the component selected by template index I. 3 occurrences.
- `CHANSVmDefineMethod(set)`: `arg -> componentArg`. Value updates the component selected by template index I. 3 occurrences.
- `CS_Color storage and component update`: `val32 -> packedRgba`. 32-bit alias shares the union storage with GXColor and its four byte components. 1 occurrences.
- `CS_Color storage and component update`: `arr -> components`. Four-byte union view indexed by RGBA component accessors. 3 occurrences.
- `CS_Color storage and component update`: `newVal -> updatedColor`. Copy of the current color whose selected component is replaced before assignment. 3 occurrences.
- `CHANSVmDefineMethod(ctor)`: `val -> componentValue`. Unused scalar declared beside the per-channel constructor assignments; retained in its original position. 1 occurrences.
- `CHANSVmDefineMethod(ctor)`: `val -> componentValue`. Unused scalar declared beside the per-channel constructor assignments; retained in its original position. 1 occurrences.
- `CHANSVmDefineMethod(get)`: `val -> colorValue`. Copy of data->color read through the selected component index. 2 occurrences.
### src/channelScript/systemmenu/iplCSLayout.cpp
- `CHANSVmDefineMethod(find_pane)`: `arg -> paneNameArg`. UTF-16 string converted to the name passed to FindPaneByName. 3 occurrences.
- `CHANSVmDefineMethod(start_anm)`: `arg -> animationIndexArg`. Integer below 16 indexes the channel script animation array. 4 occurrences.
- `CHANSVmDefineMethod(get_anm)`: `arg -> animationIndexArg`. Integer below 16 indexes the channel script animation array. 4 occurrences.
### src/channelScript/systemmenu/iplCSMaterial.cpp
- `Material VM method parameters`: `hdr -> parentObj`. Native Material receiver dereferenced to obtain the nw4r Material. 21 occurrences.
- `Material VM method parameters`: `hdr2 -> returnObj`. VM return object passed to color constructors, or the unused result slot in setters. 10 occurrences.
- `BOOL set_texture(`: `arg0 -> textureIndexArg`. Index is compared with GetTextureNum and passed to SetTexture. 3 occurrences.
- `BOOL get_tev_color(`: `arg -> colorIndexArg`. Value selects the TEV color passed to GetTevColor. 5 occurrences.
- `BOOL set_tev_color(`: `arg0 -> colorIndexArg`. Value selects the TEV color passed to SetTevColor. 5 occurrences.
- `BOOL set_tev_color(`: `arg1 -> colorArg`. Native Color or GXColorS10 value passed to SetTevColor. 4 occurrences.
- `BOOL get_tev_kcolor(`: `arg -> colorIndexArg`. Value selects the TEV color passed to GetTevKColor. 5 occurrences.
- `BOOL set_tev_kcolor(`: `arg0 -> colorIndexArg`. Value selects the TEV color passed to SetTevKColor. 5 occurrences.
- `BOOL set_tev_kcolor(`: `arg1 -> colorArg`. Native Color or GXColorS10 value passed to SetTevKColor. 4 occurrences.
- `BOOL set_mat_color(`: `arg -> colorArg`. Native Color value passed to SetMatColor. 3 occurrences.
### src/channelScript/systemmenu/iplCSMtx.cpp
- `MTX34::set`: `arg -> elementArg`. Float object copied into the selected matrix array element. 3 occurrences.
### src/channelScript/systemmenu/iplCSPane.cpp
- `Pane::get_size`: `temp -> paneSize`. Result of Pane::GetSize passed to the Size VM constructor. 3 occurrences.
- `nw4r::math::VEC3 get_vec_(`: `arg -> vectorArg`. Single VEC3 native argument supplies all components. 3 occurrences.
- `nw4r::math::VEC3 get_vec_(`: `arg0 -> xArg`. Value is assigned to out.x. 3 occurrences.
- `nw4r::math::VEC3 get_vec_(`: `arg1 -> yArg`. Value is assigned to out.y. 3 occurrences.
- `nw4r::math::VEC3 get_vec_(`: `arg2 -> zArg`. Value is assigned to out.z. 3 occurrences.
- `nw4r::lyt::Size get_size_(`: `arg -> sizeArg`. Single Size native argument supplies width and height. 3 occurrences.
- `nw4r::lyt::Size get_size_(`: `arg0 -> widthArg`. Value is assigned to out.width. 3 occurrences.
- `nw4r::lyt::Size get_size_(`: `arg1 -> heightArg`. Value is assigned to out.height. 3 occurrences.
- `CHANSVmDefineMethod(set_alpha)`: `arg -> alphaArg`. Integer value is passed to Pane::SetAlpha. 4 occurrences.
- `CHANSVmDefineMethod(set_line_space)`: `arg -> lineSpaceArg`. Float value is passed to TextBox::SetLineSpace. 4 occurrences.
- `CHANSVmDefineMethod(set_char_space)`: `arg -> charSpaceArg`. Float value is passed to TextBox::SetCharSpace. 3 occurrences.
- `CHANSVmDefineMethod(get_vtx_color)`: `arg -> vertexIndexArg`. Index below four is passed to GetVtxColor. 4 occurrences.
- `CHANSVmDefineMethod(set_vtx_color)`: `arg -> vertexIndexArg`. Index below four is passed to SetVtxColor. 4 occurrences.
- `CHANSVmDefineMethod(get_text_color)`: `arg -> colorIndexArg`. Integer index is passed to GetTextColor. 4 occurrences.
- `CHANSVmDefineMethod(set_text_color)`: `arg -> colorIndexArg`. Integer index is passed to SetTextColor. 4 occurrences.
- `CHANSVmDefineMethod(set_font)`: `arg -> fontArg`. Native Font argument is dereferenced for TextBox::SetFont. 3 occurrences.
- `CHANSVmDefineMethod(set_vtx_color)`: `v -> vertexIndex`. Checks the supplied vertex index against the four pane vertices. 2 occurrences.
### src/channelScript/systemmenu/iplCSRect.cpp
- `Rect constructor`: `arg0 -> leftArg`. Initializes left. 3 occurrences.
- `Rect constructor`: `arg1 -> topArg`. Initializes top. 3 occurrences.
- `Rect constructor`: `arg2 -> rightArg`. Initializes right. 3 occurrences.
- `Rect constructor`: `arg3 -> bottomArg`. Initializes bottom. 3 occurrences.
- `CHANSVmDefineMethod(set_width)`: `arg -> widthArg`. Value is passed to Rect::SetWidth. 3 occurrences.
- `CHANSVmDefineMethod(set_height)`: `arg -> heightArg`. Value is passed to Rect::SetHeight. 3 occurrences.
### src/channelScript/systemmenu/iplCSSavedata.cpp
- `SaveData VM method parameters`: `hdr -> parentObj`. Native SaveData receiver passed to is_valid_datap or get_; ctor receives the unused receiver slot. 50 occurrences.
- `SaveData VM method parameters`: `hdr2 -> returnObj`. Receives VM scalars, strings, images, blobs or constructed SaveData objects. 42 occurrences.
- `BOOL load_(`: `arg0 -> offsetArg`. Value becomes the offset passed to load_nand_ or load_vf_. 3 occurrences.
- `BOOL load_(`: `arg1 -> sizeArg`. Value becomes the read size passed to load_nand_ or load_vf_. 3 occurrences.
- `BOOL uncompress_(`: `arg0 -> compressionTypeArg`. Value selects compressionType for the CX decompressor. 3 occurrences.
- `BOOL uncompress_(`: `arg1 -> compressedSizeArg`. Value limits bytes loaded from NAND or VF before decompression. 3 occurrences.
- `BOOL uncompress_(`: `arg2 -> outputSizeArg`. Value chooses the requested decompressed prefix size. 3 occurrences.
- `BOOL copy_to_heap(`: `arg0 -> offsetArg`. Value selects the source offset within pData. 3 occurrences.
- `BOOL copy_to_heap(`: `arg1 -> sizeArg`. Value selects allocation and memcpy size. 3 occurrences.
- `BOOL decode_odh(`: `arg0 -> formatArg`. Value 4 or 6 selects RGB565 or RGBA8 image decoding. 3 occurrences.
- `BOOL decode_odh(`: `arg1 -> offsetArg`. Value is added to data->pData to locate the ODH stream. 3 occurrences.
- `BOOL decode_odh(`: `arg2 -> bufferSizeArg`. Value bounds the ODH input buffer and is passed to the decoder. 3 occurrences.
- `BOOL decode_odh(`: `pitch -> dataOffset`. Added to pData before ODHGetWidth and ODHGetHeight; it is a byte offset, not a row pitch. 2 occurrences.
- `BOOL get_str(`: `arg1 -> lengthArg`. Value is the byte length passed to CHANSVmSetU16StringFromU8. 3 occurrences.
- `BOOL get_wstr(`: `arg1 -> lengthArg`. Value is multiplied by two for CHANSVmSetU16String byte length. 3 occurrences.
- `u8* get_(`: `arg0 -> offsetArg`. Value advances the data pointer before returning it. 3 occurrences.
- `BOOL calc_crc16(`: `arg1 -> sizeArg`. Value gives the number of bytes passed to NETCalcCRC. 3 occurrences.
- `BOOL calc_crc32(`: `arg1 -> sizeArg`. Value gives the number of bytes passed to NETCalcCRC. 3 occurrences.
- `BOOL ctor(`: `arg0 -> mountOrPathArg`. First string is the mount path with two arguments, or the file path with one. 4 occurrences.
- `BOOL ctor(`: `arg1 -> pathArg`. Optional second string becomes the file path within the mounted volume. 3 occurrences.
- `BOOL ctor(`: `temp -> widePath`. UTF-16 path workspace passed to utf16_to_ascii for both path conversions. 8 occurrences.
- `BOOL get<s8>(`: `val -> signedByte`. s8 load from the selected data byte passed to CHANSVmSetInteger. 2 occurrences.
### src/channelScript/systemmenu/iplCSSize.cpp
- `Size constructor and component setter`: `arg0 -> widthArg`. Initializes Size::width. 3 occurrences.
- `Size constructor and component setter`: `arg1 -> heightArg`. Initializes Size::height. 3 occurrences.
- `Size constructor and component setter`: `arg -> dimensionArg`. Value updates the dimension selected by template index I. 3 occurrences.
### src/channelScript/systemmenu/iplCSSound.cpp
- `Sound::start`: `arg0 -> soundDataArg`. Address is checked and passed as sound-file data to setAltBannerSound. 3 occurrences.
- `Sound::start`: `arg1 -> soundSizeArg`. Value is the checked sound-file size passed to setAltBannerSound. 3 occurrences.
### src/channelScript/systemmenu/iplCSTextWriter.cpp
- `TextWriter font size and constructor`: `arg0 -> widthArg`. Value is the first SetFontSize argument. 3 occurrences.
- `TextWriter font size and constructor`: `arg1 -> heightArg`. Value is the second SetFontSize argument. 3 occurrences.
- `TextWriter font size and constructor`: `temp -> defaultWriter`. Default-constructed TextWriterBase copied into the VM object data. 2 occurrences.
- `CHANSVmDefineMethod(set_line_space)`: `arg -> lineSpaceArg`. Value is passed to SetLineSpace. 3 occurrences.
- `CHANSVmDefineMethod(set_line_space)`: `val -> lineSpace`. Float conversion passed to SetLineSpace. 2 occurrences.
- `CHANSVmDefineMethod(set_char_space)`: `arg -> charSpaceArg`. Value is passed to SetCharSpace. 3 occurrences.
- `CHANSVmDefineMethod(set_char_space)`: `val -> charSpace`. Float conversion passed to SetCharSpace. 2 occurrences.
### src/channelScript/systemmenu/iplCSTexture.cpp
- `BOOL is_valid_fmt(`: `iv -> formatValue`. Integer format constrained to at most 14 and the supported-format bit mask. 3 occurrences.
- `BOOL is_valid_fmt(`: `len -> formatIndex`. 32-bit format value used as the 0x407F bit-mask index. 2 occurrences.
- `BOOL init_tpl(`: `arg0 -> paletteArg`. Address is cast to TPLPalette for validity checks and stored as palette data. 3 occurrences.
- `BOOL init_tpl(`: `arg1 -> tplSizeArg`. Value is supplied as the TPL data size to tpl_validity. 3 occurrences.
- `BOOL init_tpl(`: `hdr -> returnObj`. Receives the newly allocated Texture VM object data. 2 occurrences.
- `BOOL init_texobj(`: `arg1 -> widthArg`. Value becomes GXInitTexObj width. 4 occurrences.
- `BOOL init_texobj(`: `arg2 -> heightArg`. Value becomes GXInitTexObj height. 4 occurrences.
- `BOOL init_texobj(`: `arg3 -> formatArg`. Value becomes GXInitTexObj GXTexFmt. 3 occurrences.
- `BOOL init_texobj(`: `arg4 -> wrapSArg`. Value becomes GXInitTexObj horizontal wrap mode. 3 occurrences.
- `BOOL init_texobj(`: `arg5 -> wrapTArg`. Value becomes GXInitTexObj vertical wrap mode. 3 occurrences.
- `BOOL init_texobj(`: `arg1Valid -> widthValid`. Tracks successful nonzero width below 0x400. 3 occurrences.
- `BOOL init_texobj(`: `arg2Valid -> heightValid`. Tracks successful nonzero height below 0x400. 3 occurrences.
- `BOOL init_texobj(`: `val1 -> widthValue`. 64-bit width checked before narrowing to u16. 3 occurrences.
- `BOOL init_texobj(`: `val2 -> heightValue`. 64-bit height checked before narrowing to u16. 3 occurrences.
- `BOOL init_texobj(`: `hdr -> returnObj`. Receives the newly allocated Texture VM object data. 2 occurrences.
- `CHANSVmDefineMethod(ctor)`: `arg0 -> imageArg`. First argument is checked as an Image native instance before reading its data address. 4 occurrences.
### src/channelScript/systemmenu/iplCSVector.cpp
- `VEC3 constructor and component setter`: `arg0 -> xArg`. Initializes vector x. 3 occurrences.
- `VEC3 constructor and component setter`: `arg1 -> yArg`. Initializes vector y. 3 occurrences.
- `VEC3 constructor and component setter`: `arg2 -> zArg`. Initializes vector z. 3 occurrences.
- `VEC3 constructor and component setter`: `arg -> componentArg`. Value updates the component selected by template index I. 3 occurrences.
### src/keyboard/tiPredictLang.cpp
- `pane event handlers`: `tmp -> paneName`. Copies the event pane name and replaces its first character with P before animation lookup or prediction-mode selection. 10 occurrences.
### src/keyboard/tiToolBar.cpp
- `pane event handler`: `tmp -> paneName`. replaceChar generates the P-prefixed name for searchAnmPane and named toolbar-button comparisons. 8 occurrences.
### src/scene/textBalloon/iplBalloon.cpp
- `TextBalloon::set_translate`: `temp0 -> screenMargin`. Selected from mMargin16x9 or mMargin4x3 and compared with distance to projection edges. 7 occurrences.
- `TextBalloon::set_translate`: `temp1 -> alignmentOffset`. Half-width offset selected by mHAlign and scaled between aspect ratios. 7 occurrences.
- `TextBalloon::set_translate`: `temp2 -> leftClearance`. Distance from the aligned balloon left edge to proj16x9.left. 3 occurrences.
- `TextBalloon::set_translate`: `temp4 -> rightClearance`. Distance from the aligned balloon right edge to proj16x9.right. 3 occurrences.
- `TextBalloon::set_translate`: `temp3 -> edgeAdjustment`. Moves the balloon horizontally to meet the selected screen margin. 4 occurrences.
- `TextBalloon::set_textbox truncation`: `temp1 -> ellipsisWidthAdjustment`. Adjusts the 391.5 width limit when the non-Japanese three-dot ellipsis is inserted. 3 occurrences.
- `TextBalloon::set_textbox minimum width`: `temp1 -> minimumWidthScale`. Aspect-ratio scale multiplies the 160 minimum balloon width. 3 occurrences.
### src/system/odh.cpp
- `cdj_c_setQuantizationTable`: `temp -> quantizationFactor`. Scales and clamps a quantization entry, then is reused for its AAN-scaled reciprocal factor. 12 occurrences.
- `fdct_fast`: `tmp0 -> sum07`. Sum of samples 0 and 7 in each row or column. 7 occurrences.
- `fdct_fast`: `tmp1 -> sum16`. Sum of samples 1 and 6 in each row or column. 7 occurrences.
- `fdct_fast`: `tmp2 -> sum25`. Sum of samples 2 and 5 in each row or column. 7 occurrences.
- `fdct_fast`: `tmp3 -> sum34`. Sum of samples 3 and 4 in each row or column. 7 occurrences.
- `fdct_fast`: `tmp4 -> difference34`. Difference of samples 3 and 4 in each row or column. 5 occurrences.
- `fdct_fast`: `tmp5 -> difference25`. Difference of samples 2 and 5 in each row or column. 7 occurrences.
- `fdct_fast`: `tmp6 -> difference16`. Difference of samples 1 and 6 in each row or column. 7 occurrences.
- `fdct_fast`: `tmp7 -> difference07`. Difference of samples 0 and 7 in each row or column. 9 occurrences.
- `fdct_fast`: `tmp10 -> butterflySum0`. First sum in the even butterfly, then the first adjacent-difference sum in the odd butterfly. 13 occurrences.
- `fdct_fast`: `tmp11 -> butterflySum1`. Second sum in the even butterfly, then the middle adjacent-difference sum in the odd butterfly. 11 occurrences.
- `fdct_fast`: `tmp12 -> butterflyCrossTerm`. Inner pair-sum difference in the even butterfly, then final adjacent-difference sum in the odd butterfly. 11 occurrences.
- `fdct_fast`: `tmp13 -> evenDifference`. Difference of the outer pair sums, used for even-frequency coefficients 2 and 6. 9 occurrences.
- `fdct_fast`: `z1 -> evenRotation`. 181/256 rotation term used in the even-frequency outputs 2 and 6. 7 occurrences.
- `fdct_fast`: `z2 -> oddRotation35`. Odd rotation term added/subtracted for coefficient outputs 3 and 5. 7 occurrences.
- `fdct_fast`: `z3 -> oddRotationBase`. 181/256 rotation of the middle difference sum, combined with difference07. 7 occurrences.
- `fdct_fast`: `z4 -> oddRotation17`. Odd rotation term added/subtracted for coefficient outputs 1 and 7. 7 occurrences.
- `fdct_fast`: `z5 -> sharedOddRotation`. 98/256 rotation term shared by oddRotation35 and oddRotation17. 7 occurrences.
- `fdct_fast`: `z11 -> oddSum17`. Sum of difference07 and oddRotationBase feeds coefficients 1 and 7. 7 occurrences.
- `fdct_fast`: `z13 -> oddDifference35`. Difference of difference07 and oddRotationBase feeds coefficients 3 and 5. 7 occurrences.
- `cdj_d_setDequantizationTable`: `temp -> quantizationFactor`. Scales and clamps the standard quantization factor before applying the AAN scale. 7 occurrences.
- `idct_fast`: `tmp0 -> evenPart0`. Dequantized frequency 0, then even contribution to output sample pair 0/7. 10 occurrences.
- `idct_fast`: `tmp1 -> evenPart1`. Dequantized frequency 2, then even contribution to output sample pair 1/6. 10 occurrences.
- `idct_fast`: `tmp2 -> evenPart2`. Dequantized frequency 4, then even contribution to output sample pair 2/5. 10 occurrences.
- `idct_fast`: `tmp3 -> evenPart3`. Dequantized frequency 6, then even contribution to output sample pair 3/4. 10 occurrences.
- `idct_fast`: `tmp4 -> oddPart3`. Dequantized frequency 1, then odd contribution to output sample pair 3/4. 10 occurrences.
- `idct_fast`: `tmp5 -> oddPart2`. Dequantized frequency 3, then odd contribution to output sample pair 2/5. 12 occurrences.
- `idct_fast`: `tmp6 -> oddPart1`. Dequantized frequency 5, then odd contribution to output sample pair 1/6. 12 occurrences.
- `idct_fast`: `tmp7 -> oddPart0`. Dequantized frequency 7, then odd contribution to output sample pair 0/7. 12 occurrences.
- `idct_fast`: `tmp10 -> butterflyTerm0`. Even 0/4 sum, reused as the 277/256 odd rotation term in each transform pass. 11 occurrences.
- `idct_fast`: `tmp11 -> butterflyTerm1`. Even 0/4 difference, reused as the 362/256 odd rotation term in each pass. 11 occurrences.
- `idct_fast`: `tmp12 -> butterflyTerm2`. 362/256 even rotation term, reused as the -669/256 odd rotation term. 11 occurrences.
- `idct_fast`: `tmp13 -> evenInnerSum`. Sum of the even-frequency inputs 2 and 6. 9 occurrences.
- `idct_fast`: `z5 -> sharedOddRotation`. 473/256 rotation shared by the two odd difference rotations. 7 occurrences.
- `idct_fast`: `z10 -> oddDifference53`. Difference of odd-frequency inputs 5 and 3. 7 occurrences.
- `idct_fast`: `z11 -> oddSum17`. Sum of odd-frequency inputs 1 and 7. 7 occurrences.
- `idct_fast`: `z12 -> oddDifference17`. Difference of odd-frequency inputs 1 and 7. 7 occurrences.
- `idct_fast`: `z13 -> oddSum53`. Sum of odd-frequency inputs 5 and 3. 7 occurrences.
- `huffmanDecoder shared return`: `LAB_00013590 -> finishDecode`. All five error exits branch to the shared return of decodeResult. 6 occurrences.
### src/system/rvl_dec.c
- `Rvl_decode_ash C fallback`: `tmp15 -> decodeBitsOrCount`. Reused for the next literal bit word, decoded distance, then the number of eight-byte copy groups. 17 occurrences.
- `Rvl_decode_ash C fallback`: `tmp20 -> nextDistanceBits`. Next shifted or refilled bit word while traversing the distance tree. 5 occurrences.
- `Rvl_decode_ash C fallback`: `sym9 -> literalSymbol`. Nine-bit leaf or branch index used to construct and traverse the literal/length tree. 8 occurrences.
- `Rvl_decode_ash C fallback`: `sym11 -> distanceSymbol`. Eleven-bit leaf or branch index used to construct and traverse the distance tree. 7 occurrences.
- `Rvl_decode_ash C fallback`: `bitOff1 -> literalWordOffset`. Input byte offset for refilling the literal/length tree bitstream. 14 occurrences.
- `Rvl_decode_ash C fallback`: `bitPos1 -> literalBitPosition`. Position in the literal/length bit word, reset on each 32-bit refill. 17 occurrences.
- `Rvl_decode_ash C fallback`: `bitWord1 -> literalBitWord`. Bit word consumed while building and traversing the literal/length tree. 12 occurrences.
- `Rvl_decode_ash C fallback`: `bitOff2 -> distanceWordOffset`. Input byte offset for refilling the distance-tree bitstream. 14 occurrences.
- `Rvl_decode_ash C fallback`: `bitPos2 -> distanceBitPosition`. Position in the distance bit word, reset on each 32-bit refill. 17 occurrences.
- `Rvl_decode_ash C fallback`: `bitWord2 -> distanceBitWord`. Bit word consumed while building and traversing the distance tree. 12 occurrences.
- `Rvl_decode_ash C fallback`: `litPtr -> copySource`. Backreference source computed from output minus decoded distance, advanced during the copy. 15 occurrences.
## Rejected name and audit follow-up
- First full gate: build and DOL passed, zero regressions, zero readability warnings. `tmp -> dummyLength` in `DummyLen` triggered the gate's blanket `dummy*` object pattern. The final name is `extraReadLength`, describing the extra bytes read and scrambled during unlock. No object, declaration, initializer or expression was added. Failed run: `/tmp/rx31.first-gate.log`.
- The expanded token audit found the single-name `arg` callbacks in `NANDOpenClose.c`, which the first numbered-argument scan missed. They are now `callbackContext`; the six numbered safe-open/close states are named for their ISFS operation or completion role. The final full gate includes this unit.
- The final broad scan found the hexadecimal return label in `huffmanDecoder`. `finishDecode` follows the five assignments of error code `0x80000003` and names their shared return. The final clean gate includes this last rename.
## Validation
Final command: full, non-quick `/mnt/drive2/projects/wii-ipl-workers/_restore0928-tools/gate.py` with all 24 touched unit paths from `/tmp/rx31.units.json`. Raw output: `/tmp/rx31.full-gate.log`. The gate rebuilt 43U from a clean build directory.
- `GATE PASS`; zero regressions, zero added forbidden patterns and zero readability warnings.
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`.
- All 1,027 whole source objects are byte-identical to the fresh before-edit baseline, including every allocated section and relocation. No other unit changed output.
- `build/43U/report.json` is byte-identical to `/tmp/rx31.report.before.json`. Every global, unit, section and function measure is unchanged. Final copy: `/tmp/rx31.report.after.json`.
- All 24 before/after `pool_diff.py` comparisons pass. Retail comparisons pass for 23 units. NANDOpenClose retains its pre-existing extra `pretty pls?` string: four source strings versus three retail strings, with identical before/after object bytes. Pool output: `/tmp/rx31.pools.after.log`; original NAND comparison: `/tmp/rx31.nand-pool.before.log`.
- The token audit verifies exactly 1,192 identifier substitutions. Every other source byte is unchanged, including comments, strings, whitespace, declaration order, types, expressions and array extents. The `rvl_dec.c` changes are confined to the C fallback; original decoder assembly is unchanged.
- `git diff --check 901fe028` passes. Excluded worker files, headers, build configuration, symbols and tooling are unchanged.
| Measure across the 24 touched units | Before | After |
| --- | ---: | ---: |
| Instruction-exact functions | 391/393 | 391/393 |
| Objdiff exact functions | 391/393 | 391/393 |
| Matched code bytes | 73384/75192 | 73384/75192 |
| Matched data bytes | 63248/63248 | 63248/63248 |
### Baseline non-matches retained
- `LineConv11__9CArGBAOdhFPUcPUcPUcPUcUsUsPCli`: 98.08219%; 146/146 instructions, 12 ctxdiff differences in instruction scheduling and register choices. Its source is unchanged. Evidence: `/tmp/rx31.LineConv11.ctxdiff`.
- `huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl`: 95.57189%; 306/306 instructions, 171 ctxdiff differences including register allocation. Only its return label is renamed, and its object bytes are unchanged. Evidence: `/tmp/rx31.huffmanDecoder.ctxdiff`.
This is the requested rename-only round. No matching experiments or matching gains are claimed. The two pre-existing non-matches remain for their matching workers.
### Naming limits
- `generationReply` names the auxiliary word returned by the generate-user-ID request. The caller never examines it; no specific status or generation-stage meaning is inferred.
- `decodeBitsOrCount` preserves one C fallback local reused as a shifted bit word, distance-tree index/distance and copy-group count. Splitting that local would exceed rename-only scope.
- The DCT butterfly terms are reused between the even and odd stages; their names and evidence preserve those shared roles.
- Existing unused Color constructor scalar declarations remain in place as `componentValue`. No initializer or new local is added.
### Per-unit before/after measures
| Unit | Instruction-exact before -> after | Code bytes before -> after | Data bytes before -> after |
| --- | ---: | ---: | ---: |
| `libs/NW4R/src/math/math_types` | 2/2 -> 2/2 | 320/320 -> 320/320 | 8/8 -> 8/8 |
| `libs/RVL_SDK/src/card/CARDUnlock` | 6/6 -> 6/6 | 3432/3432 -> 3432/3432 | 360/360 -> 360/360 |
| `libs/RVL_SDK/src/dsp/dsp` | 8/8 -> 8/8 | 572/572 -> 572/572 | 144/144 -> 144/144 |
| `libs/RVL_SDK/src/nand/NANDOpenClose` | 22/22 -> 22/22 | 5056/5056 -> 5056/5056 | 88/88 -> 88/88 |
| `libs/RevoEX/src/nwc24/NWC24Manage` | 21/21 -> 21/21 | 3784/3784 -> 3784/3784 | 336/336 -> 336/336 |
| `libs/RevoEX/src/ssl/ssl_api` | 10/10 -> 10/10 | 3404/3404 -> 3404/3404 | 12424/12424 -> 12424/12424 |
| `src/channelScript/systemmenu/iplCSAnim` | 17/17 -> 17/17 | 2204/2204 -> 2204/2204 | 392/392 -> 392/392 |
| `src/channelScript/systemmenu/iplCSColor` | 22/22 -> 22/22 | 3104/3104 -> 3104/3104 | 128/128 -> 128/128 |
| `src/channelScript/systemmenu/iplCSLayout` | 9/9 -> 9/9 | 952/952 -> 952/952 | 240/240 -> 240/240 |
| `src/channelScript/systemmenu/iplCSMaterial` | 13/13 -> 13/13 | 2036/2036 -> 2036/2036 | 184/184 -> 184/184 |
| `src/channelScript/systemmenu/iplCSMtx` | 29/29 -> 29/29 | 1492/1492 -> 1492/1492 | 232/232 -> 232/232 |
| `src/channelScript/systemmenu/iplCSPane` | 36/36 -> 36/36 | 5804/5804 -> 5804/5804 | 672/672 -> 672/672 |
| `src/channelScript/systemmenu/iplCSRect` | 7/7 -> 7/7 | 980/980 -> 980/980 | 88/88 -> 88/88 |
| `src/channelScript/systemmenu/iplCSSavedata` | 35/35 -> 35/35 | 5836/5836 -> 5836/5836 | 512/512 -> 512/512 |
| `src/channelScript/systemmenu/iplCSSize` | 7/7 -> 7/7 | 880/880 -> 880/880 | 56/56 -> 56/56 |
| `src/channelScript/systemmenu/iplCSSound` | 4/4 -> 4/4 | 356/356 -> 356/356 | 56/56 -> 56/56 |
| `src/channelScript/systemmenu/iplCSTextWriter` | 7/7 -> 7/7 | 1320/1320 -> 1320/1320 | 128/128 -> 128/128 |
| `src/channelScript/systemmenu/iplCSTexture` | 6/6 -> 6/6 | 1132/1132 -> 1132/1132 | 16/16 -> 16/16 |
| `src/channelScript/systemmenu/iplCSVector` | 9/9 -> 9/9 | 1160/1160 -> 1160/1160 | 64/64 -> 64/64 |
| `src/keyboard/tiPredictLang` | 36/36 -> 36/36 | 5536/5536 -> 5536/5536 | 2300/2300 -> 2300/2300 |
| `src/keyboard/tiToolBar` | 37/37 -> 37/37 | 5464/5464 -> 5464/5464 | 1452/1452 -> 1452/1452 |
| `src/scene/textBalloon/iplBalloon` | 18/18 -> 18/18 | 3084/3084 -> 3084/3084 | 136/136 -> 136/136 |
| `src/system/odh` | 26/28 -> 26/28 | 12876/14684 -> 12876/14684 | 6360/6360 -> 6360/6360 |
| `src/system/rvl_dec` | 4/4 -> 4/4 | 2600/2600 -> 2600/2600 | 36872/36872 -> 36872/36872 |
### Final full gate output
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/NW4R/src/math/math_types] pool: IDENTICAL
[libs/NW4R/src/math/math_types] objdiff: code 320/320 data 8/8 functions 2/2 fuzzy 100.0000 linked code 320
[libs/NW4R/src/math/math_types] instruction-exact functions: 2/2
[libs/NW4R/src/math/math_types] section .sdata2 size 8 match 100.0
[libs/NW4R/src/math/math_types] section .text size 320 match 100.0
[libs/NW4R/src/math/math_types] baseline: code 320/320 data 8 functions 2 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/dsp/dsp] pool: IDENTICAL
[libs/RVL_SDK/src/dsp/dsp] objdiff: code 572/572 data 144/144 functions 8/8 fuzzy 100.0000 linked code 572
[libs/RVL_SDK/src/dsp/dsp] instruction-exact functions: 8/8
[libs/RVL_SDK/src/dsp/dsp] section .data size 128 match 100.0
[libs/RVL_SDK/src/dsp/dsp] section .sbss size 8 match 100.0
[libs/RVL_SDK/src/dsp/dsp] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/dsp/dsp] section .text size 572 match 100.0
[libs/RVL_SDK/src/dsp/dsp] baseline: code 572/572 data 144 functions 8 fuzzy 100.0000
[libs/RVL_SDK/src/nand/NANDOpenClose] pool: DIVERGES at string None (mine=4 orig=3)
[libs/RVL_SDK/src/nand/NANDOpenClose] objdiff: code 5056/5056 data 88/88 functions 22/22 fuzzy 100.0000 linked code 5056
[libs/RVL_SDK/src/nand/NANDOpenClose] instruction-exact functions: 22/22
[libs/RVL_SDK/src/nand/NANDOpenClose] section .data size 64 match 100.0
[libs/RVL_SDK/src/nand/NANDOpenClose] section .sbss size 8 match 100.0
[libs/RVL_SDK/src/nand/NANDOpenClose] section .sdata size 16 match 100.0
[libs/RVL_SDK/src/nand/NANDOpenClose] section .text size 5056 match 100.0
[libs/RVL_SDK/src/nand/NANDOpenClose] baseline: code 5056/5056 data 88 functions 22 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/RevoEX/src/ssl/ssl_api] pool: IDENTICAL
[libs/RevoEX/src/ssl/ssl_api] objdiff: code 3404/3404 data 12424/12424 functions 10/10 fuzzy 100.0000 linked code 3404
[libs/RevoEX/src/ssl/ssl_api] instruction-exact functions: 10/10
[libs/RevoEX/src/ssl/ssl_api] section .bss size 12320 match 100.0
[libs/RevoEX/src/ssl/ssl_api] section .data size 88 match 100.0
[libs/RevoEX/src/ssl/ssl_api] section .sbss size 8 match 100.0
[libs/RevoEX/src/ssl/ssl_api] section .sdata size 8 match 100.0
[libs/RevoEX/src/ssl/ssl_api] section .text size 3404 match 100.0
[libs/RevoEX/src/ssl/ssl_api] baseline: code 3404/3404 data 12424 functions 10 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSAnim] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSAnim] objdiff: code 2204/2204 data 392/392 functions 17/17 fuzzy 100.0000 linked code 2204
[src/channelScript/systemmenu/iplCSAnim] instruction-exact functions: 17/17
[src/channelScript/systemmenu/iplCSAnim] section .data size 176 match 100.0
[src/channelScript/systemmenu/iplCSAnim] section .rodata size 168 match 100.0
[src/channelScript/systemmenu/iplCSAnim] section .sdata size 40 match 100.0
[src/channelScript/systemmenu/iplCSAnim] section .sdata2 size 8 match 100.0
[src/channelScript/systemmenu/iplCSAnim] section .text size 2204 match 100.0
[src/channelScript/systemmenu/iplCSAnim] baseline: code 2204/2204 data 392 functions 17 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSColor] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSColor] objdiff: code 3104/3104 data 128/128 functions 22/22 fuzzy 100.0000 linked code 3104
[src/channelScript/systemmenu/iplCSColor] instruction-exact functions: 22/22
[src/channelScript/systemmenu/iplCSColor] section .data size 16 match 100.0
[src/channelScript/systemmenu/iplCSColor] section .rodata size 96 match 100.0
[src/channelScript/systemmenu/iplCSColor] section .sdata size 16 match 100.0
[src/channelScript/systemmenu/iplCSColor] section .text size 3104 match 100.0
[src/channelScript/systemmenu/iplCSColor] baseline: code 3104/3104 data 128 functions 22 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSLayout] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSLayout] objdiff: code 952/952 data 240/240 functions 9/9 fuzzy 100.0000 linked code 952
[src/channelScript/systemmenu/iplCSLayout] instruction-exact functions: 9/9
[src/channelScript/systemmenu/iplCSLayout] section .data size 128 match 100.0
[src/channelScript/systemmenu/iplCSLayout] section .rodata size 96 match 100.0
[src/channelScript/systemmenu/iplCSLayout] section .sdata size 16 match 100.0
[src/channelScript/systemmenu/iplCSLayout] section .text size 952 match 100.0
[src/channelScript/systemmenu/iplCSLayout] baseline: code 952/952 data 240 functions 9 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSMaterial] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSMaterial] objdiff: code 2036/2036 data 184/184 functions 13/13 fuzzy 100.0000 linked code 2036
[src/channelScript/systemmenu/iplCSMaterial] instruction-exact functions: 13/13
[src/channelScript/systemmenu/iplCSMaterial] section .data size 112 match 100.0
[src/channelScript/systemmenu/iplCSMaterial] section .rodata size 56 match 100.0
[src/channelScript/systemmenu/iplCSMaterial] section .sdata size 16 match 100.0
[src/channelScript/systemmenu/iplCSMaterial] section .text size 2036 match 100.0
[src/channelScript/systemmenu/iplCSMaterial] baseline: code 2036/2036 data 184 functions 13 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSMtx] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSMtx] objdiff: code 1492/1492 data 232/232 functions 29/29 fuzzy 100.0000 linked code 1492
[src/channelScript/systemmenu/iplCSMtx] instruction-exact functions: 29/29
[src/channelScript/systemmenu/iplCSMtx] section .rodata size 160 match 100.0
[src/channelScript/systemmenu/iplCSMtx] section .sdata size 56 match 100.0
[src/channelScript/systemmenu/iplCSMtx] section .sdata2 size 16 match 100.0
[src/channelScript/systemmenu/iplCSMtx] section .text size 1492 match 100.0
[src/channelScript/systemmenu/iplCSMtx] baseline: code 1492/1492 data 232 functions 29 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSPane] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSPane] objdiff: code 5804/5804 data 672/672 functions 36/36 fuzzy 100.0000 linked code 5804
[src/channelScript/systemmenu/iplCSPane] instruction-exact functions: 36/36
[src/channelScript/systemmenu/iplCSPane] section .data size 352 match 100.0
[src/channelScript/systemmenu/iplCSPane] section .rodata size 240 match 100.0
[src/channelScript/systemmenu/iplCSPane] section .sdata size 72 match 100.0
[src/channelScript/systemmenu/iplCSPane] section .sdata2 size 8 match 100.0
[src/channelScript/systemmenu/iplCSPane] section .text size 5804 match 100.0
[src/channelScript/systemmenu/iplCSPane] baseline: code 5804/5804 data 672 functions 36 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSRect] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSRect] objdiff: code 980/980 data 88/88 functions 7/7 fuzzy 100.0000 linked code 980
[src/channelScript/systemmenu/iplCSRect] instruction-exact functions: 7/7
[src/channelScript/systemmenu/iplCSRect] section .data size 40 match 100.0
[src/channelScript/systemmenu/iplCSRect] section .rodata size 32 match 100.0
[src/channelScript/systemmenu/iplCSRect] section .sdata size 8 match 100.0
[src/channelScript/systemmenu/iplCSRect] section .sdata2 size 8 match 100.0
[src/channelScript/systemmenu/iplCSRect] section .text size 980 match 100.0
[src/channelScript/systemmenu/iplCSRect] baseline: code 980/980 data 88 functions 7 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSSavedata] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSSavedata] objdiff: code 5836/5836 data 512/512 functions 35/35 fuzzy 100.0000 linked code 5836
[src/channelScript/systemmenu/iplCSSavedata] instruction-exact functions: 35/35
[src/channelScript/systemmenu/iplCSSavedata] section .data size 200 match 100.0
[src/channelScript/systemmenu/iplCSSavedata] section .rodata size 208 match 100.0
[src/channelScript/systemmenu/iplCSSavedata] section .sdata size 104 match 100.0
[src/channelScript/systemmenu/iplCSSavedata] section .text size 5836 match 100.0
[src/channelScript/systemmenu/iplCSSavedata] baseline: code 5836/5836 data 512 functions 35 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSSize] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSSize] objdiff: code 880/880 data 56/56 functions 7/7 fuzzy 100.0000 linked code 880
[src/channelScript/systemmenu/iplCSSize] instruction-exact functions: 7/7
[src/channelScript/systemmenu/iplCSSize] section .rodata size 24 match 100.0
[src/channelScript/systemmenu/iplCSSize] section .sdata size 24 match 100.0
[src/channelScript/systemmenu/iplCSSize] section .sdata2 size 8 match 100.0
[src/channelScript/systemmenu/iplCSSize] section .text size 880 match 100.0
[src/channelScript/systemmenu/iplCSSize] baseline: code 880/880 data 56 functions 7 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSSound] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSSound] objdiff: code 356/356 data 56/56 functions 4/4 fuzzy 100.0000 linked code 356
[src/channelScript/systemmenu/iplCSSound] instruction-exact functions: 4/4
[src/channelScript/systemmenu/iplCSSound] section .data size 24 match 100.0
[src/channelScript/systemmenu/iplCSSound] section .rodata size 16 match 100.0
[src/channelScript/systemmenu/iplCSSound] section .sdata size 16 match 100.0
[src/channelScript/systemmenu/iplCSSound] section .text size 356 match 100.0
[src/channelScript/systemmenu/iplCSSound] baseline: code 356/356 data 56 functions 4 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSTextWriter] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSTextWriter] objdiff: code 1320/1320 data 128/128 functions 7/7 fuzzy 100.0000 linked code 1320
[src/channelScript/systemmenu/iplCSTextWriter] instruction-exact functions: 7/7
[src/channelScript/systemmenu/iplCSTextWriter] section .data size 64 match 100.0
[src/channelScript/systemmenu/iplCSTextWriter] section .rodata size 40 match 100.0
[src/channelScript/systemmenu/iplCSTextWriter] section .sdata size 24 match 100.0
[src/channelScript/systemmenu/iplCSTextWriter] section .text size 1320 match 100.0
[src/channelScript/systemmenu/iplCSTextWriter] baseline: code 1320/1320 data 128 functions 7 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSTexture] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSTexture] objdiff: code 1132/1132 data 16/16 functions 6/6 fuzzy 100.0000 linked code 1132
[src/channelScript/systemmenu/iplCSTexture] instruction-exact functions: 6/6
[src/channelScript/systemmenu/iplCSTexture] section .sdata size 16 match 100.0
[src/channelScript/systemmenu/iplCSTexture] section .text size 1132 match 100.0
[src/channelScript/systemmenu/iplCSTexture] baseline: code 1132/1132 data 16 functions 6 fuzzy 100.0000
[src/channelScript/systemmenu/iplCSVector] pool: IDENTICAL
[src/channelScript/systemmenu/iplCSVector] objdiff: code 1160/1160 data 64/64 functions 9/9 fuzzy 100.0000 linked code 1160
[src/channelScript/systemmenu/iplCSVector] instruction-exact functions: 9/9
[src/channelScript/systemmenu/iplCSVector] section .rodata size 40 match 100.0
[src/channelScript/systemmenu/iplCSVector] section .sdata size 16 match 100.0
[src/channelScript/systemmenu/iplCSVector] section .sdata2 size 8 match 100.0
[src/channelScript/systemmenu/iplCSVector] section .text size 1160 match 100.0
[src/channelScript/systemmenu/iplCSVector] baseline: code 1160/1160 data 64 functions 9 fuzzy 100.0000
[src/keyboard/tiPredictLang] pool: IDENTICAL
[src/keyboard/tiPredictLang] objdiff: code 5536/5536 data 2300/2300 functions 36/36 fuzzy 100.0000 linked code 5536
[src/keyboard/tiPredictLang] instruction-exact functions: 36/36
[src/keyboard/tiPredictLang] section .ctors size 4 match 100.0
[src/keyboard/tiPredictLang] section .data size 1672 match 100.0
[src/keyboard/tiPredictLang] section .rodata size 616 match 100.0
[src/keyboard/tiPredictLang] section .sdata size 8 match 100.0
[src/keyboard/tiPredictLang] section .text size 5536 match 100.0
[src/keyboard/tiPredictLang] baseline: code 5536/5536 data 2300 functions 36 fuzzy 100.0000
[src/keyboard/tiToolBar] pool: IDENTICAL
[src/keyboard/tiToolBar] objdiff: code 5464/5464 data 1452/1452 functions 37/37 fuzzy 100.0000 linked code 5464
[src/keyboard/tiToolBar] instruction-exact functions: 37/37
[src/keyboard/tiToolBar] section .ctors size 4 match 100.0
[src/keyboard/tiToolBar] section .data size 944 match 100.0
[src/keyboard/tiToolBar] section .rodata size 480 match 100.0
[src/keyboard/tiToolBar] section .sdata size 24 match 100.0
[src/keyboard/tiToolBar] section .text size 5464 match 100.0
[src/keyboard/tiToolBar] baseline: code 5464/5464 data 1452 functions 37 fuzzy 100.0000
[src/scene/textBalloon/iplBalloon] pool: IDENTICAL
[src/scene/textBalloon/iplBalloon] objdiff: code 3084/3084 data 136/136 functions 18/18 fuzzy 100.0000 linked code 3084
[src/scene/textBalloon/iplBalloon] instruction-exact functions: 18/18
[src/scene/textBalloon/iplBalloon] section .data size 80 match 100.0
[src/scene/textBalloon/iplBalloon] section .sdata size 24 match 100.0
[src/scene/textBalloon/iplBalloon] section .sdata2 size 32 match 100.0
[src/scene/textBalloon/iplBalloon] section .text size 3084 match 100.0
[src/scene/textBalloon/iplBalloon] baseline: code 3084/3084 data 136 functions 18 fuzzy 100.0000
[src/system/odh] pool: IDENTICAL
[src/system/odh] objdiff: code 12876/14684 data 6360/6360 functions 26/28 fuzzy 99.5546 linked code 0
[src/system/odh] instruction-exact functions: 26/28
[src/system/odh] section .data size 464 match 100.0
[src/system/odh] section .rodata size 5856 match 100.0
[src/system/odh] section .sdata2 size 40 match 100.0
[src/system/odh] section .text size 14684 match 99.55462
[src/system/odh] below 100: LineConv11__9CArGBAOdhFPUcPUcPUcPUcUsUsPCli 98.08219
[src/system/odh] below 100: huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl 95.57189
[src/system/odh] baseline: code 12876/14684 data 6360 functions 26 fuzzy 99.5546
[src/system/rvl_dec] pool: IDENTICAL
[src/system/rvl_dec] objdiff: code 2600/2600 data 36872/36872 functions 4/4 fuzzy 100.0000 linked code 2600
[src/system/rvl_dec] instruction-exact functions: 4/4
[src/system/rvl_dec] section .bss size 36872 match 100.0
[src/system/rvl_dec] section .text size 2600 match 100.0
[src/system/rvl_dec] baseline: code 2600/2600 data 36872 functions 4 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 93.82541 -> 93.82541
global fuzzy_match_percent: 99.81117 -> 99.81117
global complete_code_percent: 79.26653 -> 79.26653
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 commits
Each source commit records one evidence line per rename in its message. All source commits are local to `agent/w1005/rx31`.
| Commit | Group | Files |
| --- | --- | ---: |
| `2c9781d0` | name odh transform terms and decoder exit | 1 |
| `3c49d110` | name ash decoder bit streams and copy values | 1 |
| `908162ad` | name sdk buffers results and callback state | 6 |
| `bf7e291f` | name keyboard animation pane lookups | 2 |
| `b4d3a8b3` | name balloon alignment margins and text limits | 1 |
| `076dfe86` | name script geometry and color arguments | 5 |
| `4c953005` | name script rendering arguments and values | 4 |
| `01cef64b` | name script animation controls and layout lookups | 2 |
| `d67e5dae` | name script savedata and sound arguments | 2 |