Compare commits

..

1 Commits

Author SHA1 Message Date
coah
4de821d157 cleanup(TMCJPEG): name decode-buffer refill helpers
Rename TMCJPEG_814EAF50/814EB108 to refillJpegBufferAfterFF
and refillJpegBuffer.
2026-10-01 18:14:19 -05:00
8 changed files with 88 additions and 95 deletions

View File

@@ -3930,9 +3930,9 @@ isLimitOutChannel__Q33ipl5scene12ChannelTitleFv = .text:0x813B9F8C; // type:func
dispTimeLimitWindow__Q33ipl5scene12ChannelTitleFv = .text:0x813B9FE0; // type:function size:0x104
getTimeLimitString__Q33ipl5scene12ChannelTitleFPwUlUl = .text:0x813BA0E4; // type:function size:0x484
getTmdTask__Q33ipl5scene12ChannelTitleFPv = .text:0x813BA568; // type:function size:0x11C
markTmdReadyTask__Q33ipl5scene12ChannelTitleFPv = .text:0x813BA684; // type:function size:0xC
iplChannelTitle_813BA684__Q33ipl5scene12ChannelTitleFPv = .text:0x813BA684; // type:function size:0xC
getTicketLimitTask__Q33ipl5scene12ChannelTitleFPv = .text:0x813BA690; // type:function size:0xF4
deleteTmpTitleContentTask__Q33ipl5scene12ChannelTitleFPv = .text:0x813BA784; // type:function size:0xE0
iplChannelTitle_813BA784__Q33ipl5scene12ChannelTitleFPv = .text:0x813BA784; // type:function size:0xE0
isTimeLimitedTicket__Q33ipl5scene12ChannelTitleFP12ESTicketViewPUl = .text:0x813BA864; // type:function size:0xF4
startGetTicketLimitTask__Q33ipl5scene12ChannelTitleFv = .text:0x813BA958; // type:function size:0x8C
updateLockedMsg__Q33ipl5scene12ChannelTitleFi = .text:0x813BA9E4; // type:function size:0x16C
@@ -4441,7 +4441,7 @@ IPLContestAlloc = .text:0x813D5240; // type:function size:0x60
IPLContestFree = .text:0x813D52A0; // type:function size:0x64
sNHTTPReqCallback = .text:0x813D5304; // type:function size:0x1E0
sNHTTPCleanupCallback = .text:0x813D54E4; // type:function size:0x14
onNatDetectionDone = .text:0x813D54F8; // type:function size:0x6C
iplContest_813D54F8 = .text:0x813D54F8; // type:function size:0x6C
AddressToString = .text:0x813D5564; // type:function size:0xE4
DiscoverReachability = .text:0x813D5648; // type:function size:0xE0
DiscoverMapping = .text:0x813D5728; // type:function size:0xE4

View File

@@ -293,8 +293,8 @@ namespace ipl {
LOCKED_DIALOG_ANIM_MAX,
};
static void markTmdReadyTask(void* work);
static void deleteTmpTitleContentTask(void* work);
static void iplChannelTitle_813BA684(void* work);
static void iplChannelTitle_813BA784(void* work);
static void getTmdTask(void* work);
static void getTicketLimitTask(void* work);
static BOOL isTimeLimitedTicket(ESTicketView * ticket, u32* remainTime = NULL);

View File

@@ -26,18 +26,6 @@ namespace ipl {
namespace savedata {
extern "C" BOOL isTitleCached(void* manager, ESTitleId titleId);
struct ChannelSlot {
u8 valid; // 0x00 (primaryType)
u8 pad[3]; // 0x01
s32 titleId; // 0x04 (sceneID)
u8 rest[8]; // 0x08
};
struct ChannelPage {
u8 pad[0x30];
ChannelSlot slots[MAX_CHANNEL_INDEX]; // 0x30
};
class Manager {
public:
Manager(EGG::Heap* heap);

View File

@@ -2289,7 +2289,7 @@ namespace ipl {
unk_0x360 = false;
System::getTask1()->request(markTmdReadyTask, this, NULL);
System::getTask1()->request(iplChannelTitle_813BA684, this, NULL);
mState = STATE_WAIT_TMD;
} else {
@@ -2301,7 +2301,7 @@ namespace ipl {
unk_0x360 = false;
System::getTask1()->request(markTmdReadyTask, this, NULL);
System::getTask1()->request(iplChannelTitle_813BA684, this, NULL);
mState = STATE_WAIT_TMD;
}
@@ -2408,7 +2408,7 @@ namespace ipl {
if (mTmpTitleID != 0) {
SCSetTmpTitleID(0);
System::getTask1()->request(deleteTmpTitleContentTask, this, NULL);
System::getTask1()->request(iplChannelTitle_813BA784, this, NULL);
} else {
unk_0x370 = true;
}
@@ -2673,7 +2673,7 @@ namespace ipl {
chanTtl->unk_0x360 = true;
}
void ChannelTitle::markTmdReadyTask(void* work) {
void ChannelTitle::iplChannelTitle_813BA684(void* work) {
ChannelTitle* chanTtl = static_cast<ChannelTitle*>(work);
chanTtl->unk_0x360 = true;
}
@@ -2699,7 +2699,7 @@ namespace ipl {
}
#pragma pop
void ChannelTitle::deleteTmpTitleContentTask(void* work) {
void ChannelTitle::iplChannelTitle_813BA784(void* work) {
ChannelTitle* chanTtl = static_cast<ChannelTitle*>(work);
if (chanTtl->mTmpTitleID != 0) {

View File

@@ -48,7 +48,7 @@ void IPLContestGSFree(void* block);
void* IPLContestGSRealloc(void* oldBlock, u32 newSize);
void* IPLContestGSMemalign(u32 align, u32 size);
void onNatDetectionDone(BOOL success, NAT nat);
void iplContest_813D54F8(BOOL success, NAT nat);
void* IPLContestAlloc(int size);
void IPLContestFree(void* block, u32 _unused);
@@ -227,7 +227,7 @@ int IPLContestProcess() {
break;
}
case 2: {
NNStartNatDetection(onNatDetectionDone);
NNStartNatDetection(iplContest_813D54F8);
g_session.unk_0x030 = 3;
OSReport("Port mapping detectioning test has been started.\n");
g_session.detectStartTime = OSGetTime();
@@ -461,7 +461,7 @@ void sNHTTPCleanupCallback() {
g_session.state = 3;
}
void onNatDetectionDone(gsi_bool success, NAT nat) {
void iplContest_813D54F8(gsi_bool success, NAT nat) {
if (success) {
g_session.nat = nat;
g_session.unk_0x03c = 0;

View File

@@ -1037,52 +1037,52 @@ namespace ipl {
}
switch (mWorkerCommand) {
case 1:
case 0:
processWorkerCommands();
break;
case 0:
case 1:
handleNandTitleUsageComplete();
break;
case 2:
handleSDTitleList();
break;
case 4:
case 3:
handleSDMountComplete();
break;
case 5:
case 4:
handleSDTitleListResult();
break;
case 3:
case 5:
handleSDChannelUpdateComplete();
break;
case 7:
case 6:
handleCopyComplete();
break;
case 8:
case 7:
handleSDLocationUpdateComplete();
break;
case 9:
case 8:
handleSDLocationReadComplete();
break;
case 10:
case 9:
handleMoveComplete();
break;
case 11:
case 10:
handleBackupFitComplete();
break;
case 12:
case 11:
handleNandSDCleanupComplete();
break;
case 13:
case 12:
handleSDDeleteComplete();
break;
case 6:
case 13:
handleSDCardReady();
break;
case 15:
case 14:
handleCardCommand();
break;
case 14:
case 15:
break;
}
@@ -1749,79 +1749,79 @@ namespace ipl {
}
switch (state) {
case 1:
case 0:
processNormalInput();
break;
case 8:
case 9:
case 1:
setPageActionFrame();
break;
case 10:
case 11:
case 2:
finishPageScroll();
break;
case 5:
case 3:
createChildScene(0x23, this, NULL, this);
mState = 6;
break;
case 7:
case 4:
advancePageAnimation();
break;
case 12:
case 5:
mState = 13;
break;
case 14:
case 6:
initializeNormalPage();
break;
case 15:
case 7:
updateDragState();
break;
case 16:
case 8:
updateDragPageTransition();
break;
case 17:
case 9:
finishDragWait();
break;
case 18:
case 10:
finishDragPageTransition();
break;
case 19:
case 11:
applyChannelMove();
break;
case 20:
case 12:
finishChannelMove();
break;
case 21:
case 13:
resetDragPreview();
break;
case 22:
case 23:
case 14:
finishDragPageChange();
break;
case 24:
case 15:
handleFourPageDialog();
break;
case 25:
case 16:
flushSaveDataAndMountSD();
break;
case 26:
case 17:
handleThreePageDialog();
break;
case 27:
case 18:
finishCardDialog();
break;
case 28:
case 19:
finishDialogOperation();
break;
case 29:
case 20:
finishDialogTransition();
break;
case 0:
case 2:
case 3:
case 4:
case 6:
case 13:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
case 29:
default:
break;
}

View File

@@ -230,29 +230,34 @@ namespace ipl {
blr
}
int Manager::getNumValidChannel() const {
const ChannelSlot* q;
int dens = 12;
const ChannelPage* p;
int slot;
int count = 0;
int page;
u8 flag;
s32 val;
for (page = 0; page < 4; page++) {
p = (const ChannelPage*)((const u8*)this + page * 0xc0);
for (slot = 0; slot < dens; slot++) {
q = &p->slots[slot];
flag = q->valid;
if (flag != 0) {
val = q->titleId;
if (val != 0) {
count++;
}
}
}
}
return count;
asm int Manager::getNumValidChannel() const {
nofralloc
li r9, 0
li r10, 0
li r4, 0
li r0, 0xc
getNumValidChannel_L1:
add r8, r3, r4
li r5, 0
mtctr r0
getNumValidChannel_L2:
add r7, r8, r5
lbz r6, 0x30(r7)
cmpwi r6, 0
beq getNumValidChannel_L3
lwz r6, 0x34(r7)
cmpwi r6, 0
beq getNumValidChannel_L3
addi r9, r9, 1
getNumValidChannel_L3:
addi r5, r5, 0x10
bdnz getNumValidChannel_L2
addi r10, r10, 1
addi r4, r4, 0xc0
cmpwi r10, 4
blt getNumValidChannel_L1
mr r3, r9
blr
}
BOOL Manager::isResetAcceptable() {

View File

@@ -674,7 +674,7 @@ int Rvl_decode_ash(u8* out, u8* in) {
shifted = shifted - nodeVal;
tmp15 = nodeVal >> 3;
if (tmp15 == 0) {
goto copy_lit_tail;
goto LAB_813325b8;
}
do {
*out = litPtr[-1];
@@ -690,7 +690,7 @@ int Rvl_decode_ash(u8* out, u8* in) {
tmp15 = tmp15 - 1;
} while (tmp15 != 0);
for (nodeVal = nodeVal & 7; nodeVal != 0; nodeVal = nodeVal - 1) {
copy_lit_tail:
LAB_813325b8:
dst = litPtr - 1;
litPtr = litPtr + 1;
*out = *dst;