mirror of https://github.com/zeldaret/tp.git
jdflyer's work
Co-Authored-By: jdflyer <jdflyer10@gmail.com>
This commit is contained in:
parent
92a4cd174e
commit
2e1be6224f
|
@ -222,4 +222,8 @@ inline void* JKRGetTypeResource(u32 tag, const char* name, JKRArchive* arc) {
|
||||||
return JKRArchive::getGlbResource(tag, name, arc);
|
return JKRArchive::getGlbResource(tag, name, arc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void* JKRGetResource(u32 tag, const char* name, JKRArchive* arc) {
|
||||||
|
return JKRArchive::getGlbResource(tag, name, arc);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -43,4 +43,12 @@ inline void* JKRDvdToMainRam(s32 entryNum, u8* dst, JKRExpandSwitch expandSwitch
|
||||||
offset, compression, returnSize);
|
offset, compression, returnSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void* JKRDvdToMainRam(char const* param_0, u8* dst, JKRExpandSwitch expandSwitch,
|
||||||
|
u32 dstLength, JKRHeap* heap,
|
||||||
|
JKRDvdRipper::EAllocDirection allocDirection, u32 offset,
|
||||||
|
JKRCompression* compression, u32* returnSize) {
|
||||||
|
return JKRDvdRipper::loadToMainRAM(param_0, dst, expandSwitch, dstLength, heap, allocDirection,
|
||||||
|
offset, compression, returnSize);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* JKRDVDRIPPER_H */
|
#endif /* JKRDVDRIPPER_H */
|
||||||
|
|
|
@ -225,4 +225,12 @@ inline u32 JKRGetMemBlockSize(JKRHeap* heap, void* block) {
|
||||||
return JKRHeap::getSize(block, heap);
|
return JKRHeap::getSize(block, heap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void* JKRAlloc(u32 size, int alignment) {
|
||||||
|
return JKRHeap::alloc(size, alignment, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline s32 JKRResizeMemBlock(JKRHeap* heap, void* ptr, u32 size) {
|
||||||
|
return JKRHeap::resize(ptr, size, heap);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* JKRHEAP_H */
|
#endif /* JKRHEAP_H */
|
||||||
|
|
|
@ -578,7 +578,7 @@ void dComIfGs_setWarpMarkFlag(u8);
|
||||||
void dComIfGs_setSelectEquipSword(u8);
|
void dComIfGs_setSelectEquipSword(u8);
|
||||||
void dComIfGs_setSelectEquipShield(u8);
|
void dComIfGs_setSelectEquipShield(u8);
|
||||||
void* dComIfG_getStageRes(char const*);
|
void* dComIfG_getStageRes(char const*);
|
||||||
void dComLbG_PhaseHandler(request_of_phase_process_class*, request_of_phase_process_fn, void*);
|
int dComLbG_PhaseHandler(request_of_phase_process_class*, request_of_phase_process_fn, void*);
|
||||||
void dComIfGp_addSelectItemNum(int, s16);
|
void dComIfGp_addSelectItemNum(int, s16);
|
||||||
BOOL dComIfGs_isOneZoneSwitch(int, int);
|
BOOL dComIfGs_isOneZoneSwitch(int, int);
|
||||||
u8 dComIfGp_getSelectItem(int);
|
u8 dComIfGp_getSelectItem(int);
|
||||||
|
|
|
@ -186,80 +186,40 @@ bool DynamicModuleControlBase::force_unlink() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NONMATCHING
|
/* 80262470-80262660 25CDB0 01F0+00 2/0 2/2 0/0 .text dump__24DynamicModuleControlBaseFv
|
||||||
|
*/
|
||||||
void DynamicModuleControlBase::dump() {
|
void DynamicModuleControlBase::dump() {
|
||||||
|
u16 doLinkCount;
|
||||||
|
u16 linkCount;
|
||||||
DynamicModuleControlBase* current = getFirstClass();
|
DynamicModuleControlBase* current = getFirstClass();
|
||||||
int totalSize = 0;
|
size_t totalSize = 0;
|
||||||
JUTReportConsole_f("\nDynamicModuleControlBase::dump()\n");
|
JUTReportConsole_f("\nDynamicModuleControlBase::dump()\n");
|
||||||
JUTReportConsole_f("Do Lnk Size Name\n");
|
JUTReportConsole_f("Do Lnk Size Name\n");
|
||||||
// lbl_80262608
|
|
||||||
while (current != NULL) {
|
while (current != NULL) {
|
||||||
// lbl_802624B8
|
doLinkCount = current->mDoLinkCount;
|
||||||
u16 doLinkCount = current->mDoLinkCount;
|
linkCount = current->mLinkCount;
|
||||||
u16 linkCount = current->mLinkCount;
|
|
||||||
if (doLinkCount != 0 || linkCount != 0) {
|
if (doLinkCount != 0 || linkCount != 0) {
|
||||||
// lbl_802624D0
|
|
||||||
u32 size = current->getModuleSize();
|
u32 size = current->getModuleSize();
|
||||||
const char* name = current->getModuleName();
|
const char* name = current->getModuleName();
|
||||||
if (size < 0xFFFFFFFF) {
|
if (size < 0xFFFFFFFF) {
|
||||||
name = (name != NULL) ? name : "(Null)";
|
name = (name != NULL) ? name : "(Null)";
|
||||||
// lbl_80262524
|
|
||||||
const char* type = current->getModuleTypeString();
|
const char* type = current->getModuleTypeString();
|
||||||
JUTReportConsole_f("%3d%3d%5.1f %05x %-4s %-24s ", doLinkCount, linkCount,
|
JUTReportConsole_f("%3d%3d%5.1f %05x %-4s %-24s ", doLinkCount, linkCount,
|
||||||
size * (1.0f / 1024.0f), size, type, name);
|
size / 1024.0f, size, type, name);
|
||||||
totalSize = totalSize + size;
|
totalSize = totalSize + size;
|
||||||
} else {
|
} else {
|
||||||
// lbl_80262588
|
|
||||||
name = (name != NULL) ? name : "(Null)";
|
name = (name != NULL) ? name : "(Null)";
|
||||||
// lbl_802625A4
|
|
||||||
const char* type = current->getModuleTypeString();
|
const char* type = current->getModuleTypeString();
|
||||||
JUTReportConsole_f("%3d%3d ???? ????? %-4s %-24s ", doLinkCount, linkCount, type,
|
JUTReportConsole_f("%3d%3d ???? ????? %-4s %-24s ", doLinkCount, linkCount, type,
|
||||||
name);
|
name);
|
||||||
}
|
}
|
||||||
// lbl_802625DC
|
|
||||||
current->dump2();
|
current->dump2();
|
||||||
JUTReportConsole_f("\n");
|
JUTReportConsole_f("\n");
|
||||||
}
|
}
|
||||||
// lbl_80262604
|
current = current->getNextClass();
|
||||||
current = getNextClass();
|
|
||||||
}
|
}
|
||||||
// lbl_80262608
|
JUTReportConsole_f("TotalSize %6.2f %06x\n\n", totalSize / 1024.0f, totalSize);
|
||||||
JUTReportConsole_f("TotalSize %6.2f %06x\n\n", (1.0f / 1024.0f) * totalSize, totalSize);
|
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
/* ############################################################################################## */
|
|
||||||
/* 80455008-80455010 003608 0004+04 1/1 0/0 0/0 .sdata2 @3772 */
|
|
||||||
SECTION_SDATA2 static f32 lit_3772[1 + 1 /* padding */] = {
|
|
||||||
0.0009765625f, // 1/1024
|
|
||||||
/* padding */
|
|
||||||
0.0f,
|
|
||||||
};
|
|
||||||
|
|
||||||
#pragma push
|
|
||||||
#pragma force_active on
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A4E5 = "\nDynamicModuleControlBase::dump()\n";
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A508 = "Do Lnk Size Name\n";
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A520 = "(Null)";
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A527 = "%3d%3d%5.1f %05x %-4s %-24s ";
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A544 = "%3d%3d ???? ????? %-4s %-24s ";
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A562 = "\n";
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A564 = "TotalSize %6.2f %06x\n\n";
|
|
||||||
#pragma pop
|
|
||||||
|
|
||||||
/* 80455010-80455018 003610 0008+00 1/1 0/0 0/0 .sdata2 @3774 */
|
|
||||||
SECTION_SDATA2 static f64 lit_3774 = 4503599627370496.0 /* cast u32 to float */;
|
|
||||||
|
|
||||||
/* 80262470-80262660 25CDB0 01F0+00 2/0 2/2 0/0 .text dump__24DynamicModuleControlBaseFv
|
|
||||||
*/
|
|
||||||
#pragma push
|
|
||||||
#pragma optimization_level 0
|
|
||||||
#pragma optimizewithasm off
|
|
||||||
asm void DynamicModuleControlBase::dump() {
|
|
||||||
nofralloc
|
|
||||||
#include "asm/DynamicLink/dump__24DynamicModuleControlBaseFv.s"
|
|
||||||
}
|
|
||||||
#pragma pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* 80262660-802626D0 25CFA0 0070+00 0/0 2/2 0/0 .text __ct__20DynamicModuleControlFPCc */
|
/* 80262660-802626D0 25CFA0 0070+00 0/0 2/2 0/0 .text __ct__20DynamicModuleControlFPCc */
|
||||||
DynamicModuleControl::DynamicModuleControl(char const* name) {
|
DynamicModuleControl::DynamicModuleControl(char const* name) {
|
||||||
|
@ -332,7 +292,8 @@ static u32 calcSum2(u16 const* data, u32 size) {
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NONMATCHING
|
/* 802627E8-80262AFC 25D128 0314+00 1/0 0/0 0/0 .text do_load__20DynamicModuleControlFv
|
||||||
|
*/
|
||||||
bool DynamicModuleControl::do_load() {
|
bool DynamicModuleControl::do_load() {
|
||||||
if (mModule != NULL) {
|
if (mModule != NULL) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -341,26 +302,26 @@ bool DynamicModuleControl::do_load() {
|
||||||
s32 i = 0;
|
s32 i = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
if (mModule != NULL) {
|
if (mModule != NULL) {
|
||||||
JKRHeap::free(mModule, NULL);
|
JKRFree(mModule);
|
||||||
mModule = NULL;
|
mModule = NULL;
|
||||||
}
|
}
|
||||||
char buffer[64];
|
char buffer[64];
|
||||||
snprintf(buffer, 64, "%s.rel", mName);
|
snprintf(buffer, 64, "%s.rel", mName);
|
||||||
if (mModule == NULL && sArchive != NULL) {
|
if (mModule == NULL && sArchive != NULL) {
|
||||||
if (mModule == NULL) {
|
if (mModule == NULL) {
|
||||||
mModule = (OSModuleInfo*)JKRArchive::getGlbResource('MMEM', buffer, sArchive);
|
mModule = (OSModuleInfo*)JKRGetResource('MMEM', buffer, sArchive);
|
||||||
if (mModule != NULL) {
|
if (mModule != NULL) {
|
||||||
mResourceType = 1;
|
mResourceType = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mModule == NULL) {
|
if (mModule == NULL) {
|
||||||
mModule = (OSModuleInfo*)JKRArchive::getGlbResource('AMEM', buffer, sArchive);
|
mModule = (OSModuleInfo*)JKRGetResource('AMEM', buffer, sArchive);
|
||||||
if (mModule != NULL) {
|
if (mModule != NULL) {
|
||||||
mResourceType = 2;
|
mResourceType = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mModule == NULL) {
|
if (mModule == NULL) {
|
||||||
mModule = (OSModuleInfo*)JKRArchive::getGlbResource('DMEM', buffer, sArchive);
|
mModule = (OSModuleInfo*)JKRGetResource('DMEM', buffer, sArchive);
|
||||||
if (mModule != NULL) {
|
if (mModule != NULL) {
|
||||||
mResourceType = 3;
|
mResourceType = 3;
|
||||||
}
|
}
|
||||||
|
@ -368,11 +329,12 @@ bool DynamicModuleControl::do_load() {
|
||||||
}
|
}
|
||||||
if (mModule != NULL) {
|
if (mModule != NULL) {
|
||||||
mSize = sArchive->getExpandedResSize(mModule);
|
mSize = sArchive->getExpandedResSize(mModule);
|
||||||
JKRFileLoader::detachResource(mModule, NULL);
|
JKRDetachResource(mModule, NULL);
|
||||||
} else if (mModule == NULL) {
|
} else {
|
||||||
|
if (mModule == NULL) {
|
||||||
snprintf(buffer, 64, "/rel/Final/Release/%s.rel", mName);
|
snprintf(buffer, 64, "/rel/Final/Release/%s.rel", mName);
|
||||||
mModule = (OSModuleInfo*)JKRDvdRipper::loadToMainRAM(
|
mModule = (OSModuleInfo*)JKRDvdToMainRam(
|
||||||
buffer, NULL, EXPAND_SWITCH_UNKNOWN1, 0, heap,
|
buffer, NULL, EXPAND_SWITCH_UNKNOWN1, NULL, heap,
|
||||||
JKRDvdRipper::ALLOC_DIRECTION_FORWARD, 0, NULL, NULL);
|
JKRDvdRipper::ALLOC_DIRECTION_FORWARD, 0, NULL, NULL);
|
||||||
if (mModule != NULL) {
|
if (mModule != NULL) {
|
||||||
mSize = 0;
|
mSize = 0;
|
||||||
|
@ -384,7 +346,8 @@ bool DynamicModuleControl::do_load() {
|
||||||
if (mModule != NULL) {
|
if (mModule != NULL) {
|
||||||
mSize = 0;
|
mSize = 0;
|
||||||
mResourceType = 11;
|
mResourceType = 11;
|
||||||
JKRFileLoader::detachResource(mModule, NULL);
|
JKRDetachResource(mModule, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mModule == NULL) {
|
if (mModule == NULL) {
|
||||||
|
@ -413,49 +376,22 @@ bool DynamicModuleControl::do_load() {
|
||||||
if (i >= 3) {
|
if (i >= 3) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
}
|
|
||||||
if (unk_33 < 0xFF) {
|
if (unk_33 < 0xFF) {
|
||||||
unk_33++;
|
unk_33++;
|
||||||
return true;
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
if (unk_33 < 0xFF) {
|
if (unk_33 < 0xFF) {
|
||||||
unk_33++;
|
unk_33++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
/* ############################################################################################## */
|
|
||||||
/* 8039A4A0-8039A4A0 026B00 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
|
|
||||||
#pragma push
|
|
||||||
#pragma force_active on
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A5E1 = "%s.rel";
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A5E8 = "/rel/Final/Release/%s.rel";
|
|
||||||
// MWCC ignores mapping of some japanese characters using the
|
|
||||||
// byte 0x5C (ASCII '\'). This is why this string is hex-encoded.
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A602 =
|
|
||||||
"\x44\x79\x6E\x61\x6D\x69\x63\x4D\x6F\x64\x75\x6C\x65\x43\x6F\x6E\x74\x72\x6F\x6C\x3A\x3A\x64"
|
|
||||||
"\x6F\x5F\x6C\x6F\x61\x64\x28\x29\x20\x83\x8A\x83\x5C\x81\x5B\x83\x58\x93\xC7\x82\xDD\x8D\x9E"
|
|
||||||
"\x82\xDD"
|
|
||||||
"\x8E\xB8\x94\x73\x20\x5B\x25\x73\x5D\x0A";
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A63D =
|
|
||||||
"DynamicModuleControl::do_load() チェックサムエラー %04x %"
|
|
||||||
"04x[%s]\n";
|
|
||||||
#pragma pop
|
|
||||||
|
|
||||||
/* 802627E8-80262AFC 25D128 0314+00 1/0 0/0 0/0 .text do_load__20DynamicModuleControlFv
|
|
||||||
*/
|
|
||||||
#pragma push
|
|
||||||
#pragma optimization_level 0
|
|
||||||
#pragma optimizewithasm off
|
|
||||||
asm bool DynamicModuleControl::do_load() {
|
|
||||||
nofralloc
|
|
||||||
#include "asm/DynamicLink/do_load__20DynamicModuleControlFv.s"
|
|
||||||
}
|
|
||||||
#pragma pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* 80262AFC-80262BC4 25D43C 00C8+00 1/0 0/0 0/0 .text do_load_async__20DynamicModuleControlFv */
|
/* 80262AFC-80262BC4 25D43C 00C8+00 1/0 0/0 0/0 .text do_load_async__20DynamicModuleControlFv */
|
||||||
BOOL DynamicModuleControl::do_load_async() {
|
BOOL DynamicModuleControl::do_load_async() {
|
||||||
|
@ -500,77 +436,75 @@ void DynamicModuleControl::dump2() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NONMATCHING
|
/* 80262C5C-80262F28 25D59C 02CC+00 1/0 0/0 0/0 .text do_link__20DynamicModuleControlFv
|
||||||
|
*/
|
||||||
BOOL DynamicModuleControl::do_link() {
|
BOOL DynamicModuleControl::do_link() {
|
||||||
OSGetTime();
|
OSGetTime();
|
||||||
if (mModule == NULL) {
|
if (mModule == NULL) {
|
||||||
do_load();
|
do_load();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mModule != NULL) {
|
if (mModule != NULL) {
|
||||||
ASSERT(mModule->info.sectionInfoOffset < 0x80000000);
|
ASSERT(mModule->info.sectionInfoOffset < 0x80000000);
|
||||||
ASSERT((u32)mModule + mModule->fixSize < 0x82000000);
|
ASSERT((u32)mModule + mModule->fixSize < 0x82000000);
|
||||||
OSGetTime();
|
OSGetTime();
|
||||||
OSGetTime();
|
OSGetTime();
|
||||||
if (mModule->mModuleVersion >= 3) {
|
if (mModule->mModuleVersion >= 3) {
|
||||||
u32 unk = mModule->fixSize;
|
u32 fixSizePtr;
|
||||||
u32 unk3 = (unk + 0x1f) & ~0x1f;
|
u32 fixSize = mModule->fixSize;
|
||||||
u32 unk2 = (u32)mModule + unk3;
|
u32 fixSize2 = (fixSize + 0x1f) & ~0x1f;
|
||||||
s32 size = JKRHeap::getSize(mModule, NULL);
|
fixSizePtr = (u32)mModule + fixSize2;
|
||||||
|
s32 size = JKRGetMemBlockSize(NULL, mModule);
|
||||||
if (size < 0) {
|
if (size < 0) {
|
||||||
void* bss = JKRHeap::alloc(mModule->mBssSize, 0x20, NULL);
|
void* bss = JKRAlloc(mModule->mBssSize, 0x20);
|
||||||
if (bss == NULL) {
|
if (bss == NULL) {
|
||||||
// "BSS Memory allocation failed\n"
|
// "BSS Memory allocation failed\n"
|
||||||
OSReport_Error("BSSメモリ確保失敗\n");
|
OSReport_Error("BSSメモリ確保失敗\n", bss);
|
||||||
goto end;
|
goto error;
|
||||||
} else {
|
}
|
||||||
mBss = bss;
|
mBss = bss;
|
||||||
BOOL linkResult = OSLink(mModule);
|
BOOL linkResult = OSLink(mModule);
|
||||||
if (linkResult == FALSE) {
|
if (linkResult == FALSE) {
|
||||||
// "link failed\n"
|
// "link failed\n"
|
||||||
OSReport_Error("リンク失敗\n");
|
OSReport_Error("リンク失敗\n");
|
||||||
goto end;
|
goto error;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mModule->mBssSize + unk < size) {
|
if (fixSize2 + mModule->mBssSize < size) {
|
||||||
BOOL linkResult = OSLinkFixed(mModule, unk2);
|
BOOL linkResult = OSLinkFixed(mModule, fixSizePtr);
|
||||||
if (linkResult == FALSE) {
|
if (linkResult == FALSE) {
|
||||||
// "link failed\n"
|
// "link failed\n"
|
||||||
OSReport_Error("リンク失敗\n");
|
OSReport_Error("リンク失敗\n");
|
||||||
goto end;
|
goto error;
|
||||||
} else {
|
}
|
||||||
s32 result = JKRHeap::resize(mModule, mModule->mBssSize + unk, NULL);
|
s32 result = JKRResizeMemBlock(NULL, mModule, fixSize2 + mModule->mBssSize);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
// "Module size (resize) failed\n"
|
// "Module size (resize) failed\n"
|
||||||
OSReport_Error("モジュールリサイズ(縮小)失敗\n");
|
OSReport_Error("モジュールリサイズ(縮小)失敗\n");
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
} else { // lbl_80262DB0
|
s32 result = JKRResizeMemBlock(NULL, mModule, fixSize2 + mModule->mBssSize);
|
||||||
s32 result = JKRHeap::resize(mModule, mModule->mBssSize + unk, NULL);
|
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
BOOL linkResult = OSLinkFixed(mModule, unk2);
|
BOOL linkResult = OSLinkFixed(mModule, fixSizePtr);
|
||||||
if (linkResult == FALSE) {
|
if (linkResult == FALSE) {
|
||||||
// "link failed\n"
|
// "link failed\n"
|
||||||
OSReport_Error("リンク失敗\n");
|
OSReport_Error("リンク失敗\n");
|
||||||
goto end;
|
goto error;
|
||||||
}
|
}
|
||||||
} else { // lbl_80262DF0
|
} else {
|
||||||
void* bss = JKRHeap::alloc(mModule->mBssSize, 0x20, NULL);
|
void* bss = JKRAlloc(mModule->mBssSize, 0x20);
|
||||||
if (bss == NULL) {
|
if (bss == NULL) {
|
||||||
// "BSS Memory allocation failure [%x]\n"
|
// "BSS Memory allocation failure [%x]\n"
|
||||||
OSReport_Error("BSSメモリ確保失敗 [%x]\n", mModule->mBssSize);
|
OSReport_Error("BSSメモリ確保失敗 [%x]\n", mModule->mBssSize);
|
||||||
goto end;
|
goto error;
|
||||||
} else { // lbl_80262E2C
|
}
|
||||||
mBss = bss;
|
mBss = bss;
|
||||||
BOOL linkResult = OSLinkFixed(mModule, (u32)bss);
|
BOOL linkResult = OSLinkFixed(mModule, (u32)bss);
|
||||||
if (linkResult == FALSE) {
|
if (linkResult == FALSE) {
|
||||||
// "link failed\n"
|
// "link failed\n"
|
||||||
OSReport_Error("リンク失敗\n");
|
OSReport_Error("リンク失敗\n");
|
||||||
goto end;
|
goto error;
|
||||||
}
|
}
|
||||||
// lbl_80262E58
|
s32 result = JKRResizeMemBlock(NULL, mModule, fixSize);
|
||||||
s32 result = JKRHeap::resize(mModule, unk3, NULL);
|
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
// "Module size (resize) failed\n"
|
// "Module size (resize) failed\n"
|
||||||
OSReport_Error("モジュールリサイズ(縮小)失敗\n");
|
OSReport_Error("モジュールリサイズ(縮小)失敗\n");
|
||||||
|
@ -579,17 +513,15 @@ BOOL DynamicModuleControl::do_link() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// lbl_80262E84
|
|
||||||
OSGetTime();
|
OSGetTime();
|
||||||
sAllocBytes = sAllocBytes + getModuleSize();
|
sAllocBytes = sAllocBytes + getModuleSize();
|
||||||
OSGetTime();
|
OSGetTime();
|
||||||
unk_24 = mModule->prolog();
|
unk_24 = ((u32(*)())mModule->prolog)();
|
||||||
OSGetTime();
|
OSGetTime();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
end: // lbl_80262ECC
|
error:
|
||||||
unk_33 = 0;
|
unk_33 = 0;
|
||||||
if (mBss != NULL) {
|
if (mBss != NULL) {
|
||||||
JKRHeap::free(mBss, NULL);
|
JKRHeap::free(mBss, NULL);
|
||||||
|
@ -601,26 +533,6 @@ end: // lbl_80262ECC
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#pragma push
|
|
||||||
#pragma force_active on
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A6E2 = "BSSメモリ確保失敗\n";
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A6F5 = "リンク失敗\n";
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A701 = "モジュールリサイズ(縮小)失敗\n";
|
|
||||||
SECTION_DEAD static char const* const stringBase_8039A71F = "BSSメモリ確保失敗 [%x]\n";
|
|
||||||
#pragma pop
|
|
||||||
|
|
||||||
/* 80262C5C-80262F28 25D59C 02CC+00 1/0 0/0 0/0 .text do_link__20DynamicModuleControlFv
|
|
||||||
*/
|
|
||||||
#pragma push
|
|
||||||
#pragma optimization_level 0
|
|
||||||
#pragma optimizewithasm off
|
|
||||||
asm BOOL DynamicModuleControl::do_link() {
|
|
||||||
nofralloc
|
|
||||||
#include "asm/DynamicLink/do_link__20DynamicModuleControlFv.s"
|
|
||||||
}
|
|
||||||
#pragma pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* 80262F28-80263000 25D868 00D8+00 1/0 0/0 0/0 .text do_unlink__20DynamicModuleControlFv
|
/* 80262F28-80263000 25D868 00D8+00 1/0 0/0 0/0 .text do_unlink__20DynamicModuleControlFv
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -961,61 +961,32 @@ int cDylPhs::phase_01(void* param_0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 8001880C-80018844 01314C 0038+00 1/0 0/0 0/0 .text phase_02__7cDylPhsFPs */
|
/* 8001880C-80018844 01314C 0038+00 1/0 0/0 0/0 .text phase_02__7cDylPhsFPs */
|
||||||
// instructions switched
|
|
||||||
#ifdef NONMATCHING
|
|
||||||
int cDylPhs::phase_02(s16* p_profName) {
|
int cDylPhs::phase_02(s16* p_profName) {
|
||||||
s32 temp_r3 = cDyl_LinkASync(*p_profName);
|
int ret = cDyl_LinkASync(*p_profName);
|
||||||
s32 phi_r0 = 2;
|
|
||||||
|
|
||||||
if (temp_r3 != 4) {
|
if (ret != 4) {
|
||||||
phi_r0 = temp_r3;
|
return ret;
|
||||||
}
|
}
|
||||||
return phi_r0;
|
return 2;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#pragma push
|
|
||||||
#pragma optimization_level 0
|
|
||||||
#pragma optimizewithasm off
|
|
||||||
asm int cDylPhs::phase_02(s16* param_0) {
|
|
||||||
nofralloc
|
|
||||||
#include "asm/c/c_dylink/phase_02__7cDylPhsFPs.s"
|
|
||||||
}
|
|
||||||
#pragma pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* 80018844-8001884C 013184 0008+00 1/0 0/0 0/0 .text phase_03__7cDylPhsFPv */
|
/* 80018844-8001884C 013184 0008+00 1/0 0/0 0/0 .text phase_03__7cDylPhsFPv */
|
||||||
int cDylPhs::phase_03(void* param_0) {
|
int cDylPhs::phase_03(void* param_0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ############################################################################################## */
|
|
||||||
/* 803A3590-803A35A0 -00001 000C+04 1/1 0/0 0/0 .data l_method$3807 */
|
|
||||||
SECTION_DATA static request_of_phase_process_fn l_method[3] = {
|
|
||||||
(request_of_phase_process_fn)cDylPhs::phase_01,
|
|
||||||
(request_of_phase_process_fn)cDylPhs::phase_02,
|
|
||||||
(request_of_phase_process_fn)cDylPhs::phase_03,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 8001884C-80018890 01318C 0044+00 0/0 2/2 0/0 .text
|
/* 8001884C-80018890 01318C 0044+00 0/0 2/2 0/0 .text
|
||||||
* Link__7cDylPhsFP30request_of_phase_process_classs */
|
* Link__7cDylPhsFP30request_of_phase_process_classs */
|
||||||
#ifdef NONMATCHING
|
|
||||||
int cDylPhs::Link(request_of_phase_process_class* i_phase, s16 param_1) {
|
int cDylPhs::Link(request_of_phase_process_class* i_phase, s16 param_1) {
|
||||||
|
static int (*l_method[3])(void*) = {cDylPhs::phase_01, (int (*)(void*))cDylPhs::phase_02,
|
||||||
|
cDylPhs::phase_03};
|
||||||
|
|
||||||
if (i_phase->mPhaseStep == 2) {
|
if (i_phase->mPhaseStep == 2) {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
dComLbG_PhaseHandler(i_phase, l_method[0], ¶m_1);
|
return dComLbG_PhaseHandler(i_phase, l_method, ¶m_1);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#pragma push
|
|
||||||
#pragma optimization_level 0
|
|
||||||
#pragma optimizewithasm off
|
|
||||||
asm int cDylPhs::Link(request_of_phase_process_class* param_0, s16 param_1) {
|
|
||||||
nofralloc
|
|
||||||
#include "asm/c/c_dylink/Link__7cDylPhsFP30request_of_phase_process_classs.s"
|
|
||||||
}
|
|
||||||
#pragma pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* 80018890-800188DC 0131D0 004C+00 0/0 1/1 0/0 .text
|
/* 80018890-800188DC 0131D0 004C+00 0/0 1/1 0/0 .text
|
||||||
* Unlink__7cDylPhsFP30request_of_phase_process_classs */
|
* Unlink__7cDylPhsFP30request_of_phase_process_classs */
|
||||||
|
|
|
@ -2526,7 +2526,7 @@ BOOL dComIfGp_TransportWarp_check() {
|
||||||
#pragma push
|
#pragma push
|
||||||
#pragma optimization_level 0
|
#pragma optimization_level 0
|
||||||
#pragma optimizewithasm off
|
#pragma optimizewithasm off
|
||||||
asm void dComLbG_PhaseHandler(request_of_phase_process_class* param_0, int (**param_1)(void*),
|
asm int dComLbG_PhaseHandler(request_of_phase_process_class* param_0, int (**param_1)(void*),
|
||||||
void* param_2) {
|
void* param_2) {
|
||||||
nofralloc
|
nofralloc
|
||||||
#include "asm/d/com/d_com_inf_game/dComLbG_PhaseHandler__FP30request_of_phase_process_classPPFPv_iPv.s"
|
#include "asm/d/com/d_com_inf_game/dComLbG_PhaseHandler__FP30request_of_phase_process_classPPFPv_iPv.s"
|
||||||
|
|
|
@ -9,12 +9,6 @@ import ctypes
|
||||||
import oead
|
import oead
|
||||||
|
|
||||||
|
|
||||||
def sha1_from_data(data):
|
|
||||||
sha1 = hashlib.sha1()
|
|
||||||
sha1.update(data)
|
|
||||||
|
|
||||||
return sha1.hexdigest().upper()
|
|
||||||
|
|
||||||
def copy(path,destPath):
|
def copy(path,destPath):
|
||||||
for root,dirs,files in os.walk(str(path)):
|
for root,dirs,files in os.walk(str(path)):
|
||||||
for file in files:
|
for file in files:
|
||||||
|
@ -28,11 +22,7 @@ def copy(path,destPath):
|
||||||
print(str(inFile)+" -> "+str(outputFile))
|
print(str(inFile)+" -> "+str(outputFile))
|
||||||
shutil.copyfile(inFile,outputFile)
|
shutil.copyfile(inFile,outputFile)
|
||||||
else:
|
else:
|
||||||
inf = open(inFile,"rb")
|
if os.path.getmtime(inFile)>os.path.getmtime(outputFile):
|
||||||
inSum = sha1_from_data(bytearray(inf.read()))
|
|
||||||
outf = open(outputFile,"rb")
|
|
||||||
outSum = sha1_from_data(bytearray(outf.read()))
|
|
||||||
if inSum!=outSum:
|
|
||||||
print(str(inFile)+" -> "+str(outputFile))
|
print(str(inFile)+" -> "+str(outputFile))
|
||||||
shutil.copyfile(inFile,outputFile)
|
shutil.copyfile(inFile,outputFile)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue