update weakness

This commit is contained in:
EpochFlame 2023-11-01 19:19:05 -04:00
parent d2a7628a40
commit 052c6fa58e
23 changed files with 16840 additions and 52 deletions

View File

@ -435,7 +435,7 @@
/* 803CEBFC 003CBB3C 4E 80 00 20 */ blr
.endfn do_init__Q33ebi6Option8FSMStateFPQ33ebi6Option4TMgrPQ24Game8StateArg
.fn exec__Q33ebi6Option8FSMStateFPQ33ebi6Option4TMgr, weak
.fn exec__Q33ebi6Option8FSMStateFPQ33ebi6Option4TMgr, global
/* 803CEC00 003CBB40 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 803CEC04 003CBB44 7C 08 02 A6 */ mflr r0
/* 803CEC08 003CBB48 90 01 00 14 */ stw r0, 0x14(r1)

View File

@ -164,7 +164,7 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/jigumo.cpp">jigumo.cpp</a> | 41093 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/shijimiChou.cpp">shijimiChou.cpp</a> | 43405 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/kingChappyState.cpp">kingChappyState.cpp</a> | 49239 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/panModoki.cpp">panModoki.cpp</a> | 53794 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/umiMushi.cpp">umiMushi.cpp</a> | 58786 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/kingChappy.cpp">kingChappy.cpp</a> | 86600 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/blackMan.cpp">blackMan.cpp</a> | 116477 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/hiScore2D.cpp">hiScore2D.cpp</a> | 122683 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/blackMan.cpp">blackMan.cpp</a> | 116472 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/hiScore2D.cpp">hiScore2D.cpp</a> | 122683 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/challengeResult2D.cpp">challengeResult2D.cpp</a> | 146713 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/challengeSelect2D.cpp">challengeSelect2D.cpp</a> | 169980 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/zukan2D.cpp">zukan2D.cpp</a> | 174192 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/vsSelect2D.cpp">vsSelect2D.cpp</a> | 233792 |

71
findweak.py Normal file
View File

@ -0,0 +1,71 @@
import os
import re
import subprocess
import itertools
import sys
maps_folder = f"build/pikmin2.usa"
assert os.path.isdir(maps_folder)
weak_funcs = set()
weak_objects = set()
for file_name in os.listdir(maps_folder):
if not file_name.endswith(".MAP"):
continue
file_path = os.path.join(maps_folder, file_name)
with open(file_path) as f:
for line in f.readlines():
line = line.strip()
if line == "Link map of __start":
continue
if line.startswith(">>> SYMBOL NOT FOUND: "):
continue
if line.count(">>> UNREFERENCED DUPLICATE "):
continue
if line.endswith(" found as linker generated symbol"):
continue
if not line:
continue
if line == ".init section layout":
break
#print(line)
match = re.search(r"^\d+\] (\S+) \((func|object|notype|section),(weak|global|local)\) found in (\S+) (\S+)", line)
assert match
mangled_symbol = match.group(1)
symbol_type = match.group(2)
symbol_modifier = match.group(3)
if symbol_type == "section" and mangled_symbol.startswith("."):
continue
if symbol_type == "notype" and mangled_symbol.startswith("..."):
continue
if re.search(r"^@\d+$", mangled_symbol):
continue
if mangled_symbol in ["_prolog", "_epilog", "_unresolved", "__register_global_object", "__global_destructor_chain", "__destroy_global_chain_reference", "__destroy_global_chain", "sqrt", "fabs"]:
continue
if mangled_symbol == "@stringBase0":
continue
if re.search(r"^\S+\$\d+$", mangled_symbol): # e.g. init$4571, touch_work$4569
continue
if mangled_symbol.startswith("g_profile_"):
continue
if mangled_symbol.startswith("__sinit_"):
continue
if inheritance_match := re.search(r"^@\d+@(\S+)$", mangled_symbol):
mangled_symbol = inheritance_match.group(1)
#print(repr(mangled_symbol), symbol_type, symbol_modifier)
if symbol_modifier != "weak":
continue
if symbol_type == "func":
weak_funcs.add(mangled_symbol)
elif symbol_type == "object":
weak_objects.add(mangled_symbol)
with open("weak_funcs_built.txt", "w") as f:
for mangled_symbol in weak_funcs:
f.write(mangled_symbol + "\n")
with open("weak_objects_built.txt", "w") as f:
for mangled_symbol in weak_objects:
f.write(mangled_symbol + "\n")

View File

@ -460,9 +460,9 @@ struct J2DPicture : public J2DPane {
}
JUtility::TColor mColor0; // _00
JUtility::TColor mColor1; // _00
JUtility::TColor mColor2; // _00
JUtility::TColor mColor3; // _00
JUtility::TColor mColor1; // _04
JUtility::TColor mColor2; // _08
JUtility::TColor mColor3; // _0C
};
/*

View File

@ -83,7 +83,7 @@ struct ObjAnaDemo : public ::Screen::ObjBase {
virtual void doDraw(Graphics&); // _68
void setBlinkMenu();
inline void commonUpdate();
void commonUpdate();
// unused/inined
inline void setWindowMsg(u64, u64, u64);

View File

@ -63,7 +63,7 @@ struct ObjCourseName : public ::Screen::ObjBase {
virtual void doUpdateFadeoutFinish(); // _64
virtual void doDraw(Graphics& gfx); // _68
inline void drawBG(Graphics&);
void drawBG(Graphics&);
// unused/inline
bool commonUpdate();

View File

@ -47,7 +47,7 @@ struct ObjFinalMsg : public ::Screen::ObjBase {
virtual void doUpdateFadeoutFinish(); // _64
virtual void doDraw(Graphics& gfx); // _68
inline void blink_Menu(int);
void blink_Menu(int);
bool menu();
void wait();

View File

@ -169,7 +169,7 @@ unsigned char __upper_map[256] = {
* Address: 800C6264
* Size: 000024
*/
int tolower(int __c) { return _tolower(__c); }
WEAKFUNC int tolower(int __c) { return _tolower(__c); }
/*
* --INFO--

View File

@ -576,21 +576,21 @@ void atan2f(void)
* Address: 800CFC98
* Size: 000024
*/
__declspec(weak) f32 cosf(f32 __x) { return cos((f64)__x); }
WEAKFUNC f32 cosf(f32 __x) { return cos((f64)__x); }
/*
* --INFO--
* Address: 800CFC74
* Size: 000024
*/
__declspec(weak) f32 sinf(f32 __x) { return sin((f64)__x); }
WEAKFUNC f32 sinf(f32 __x) { return sin((f64)__x); }
/*
* --INFO--
* Address: 800CFC50
* Size: 000024
*/
__declspec(weak) f32 tanf(f32 __x) { return tan((f64)__x); }
WEAKFUNC f32 tanf(f32 __x) { return tan((f64)__x); }
/*
* --INFO--

View File

@ -11,7 +11,7 @@ static BOOL initialized;
* Address: 800CC2E0
* Size: 0000D0
*/
BOOL __write_console(s32 arg0, s32 arg1, s32* arg2, s32 arg3)
WEAKFUNC BOOL __write_console(s32 arg0, s32 arg1, s32* arg2, s32 arg3)
{
if ((OSGetConsoleType() & 0x20000000) == 0) {

View File

@ -27,7 +27,7 @@ inline static void InitDefaultHeap()
* Address: 800C23A8
* Size: 0000B8
*/
__declspec(weak) extern void __sys_free(void* ptr)
WEAKFUNC extern void __sys_free(void* ptr)
{
if (__OSCurrHeap == -1) {
InitDefaultHeap();

View File

@ -6,60 +6,60 @@
* Address: 800C0C48
* Size: 000008
*/
int udp_cc_initialize(void* flagOut, __OSInterruptHandler handler) { return -1; }
WEAKFUNC int udp_cc_initialize(void* flagOut, __OSInterruptHandler handler) { return -1; }
/*
* --INFO--
* Address: 800C0C40
* Size: 000008
*/
int udp_cc_shutdown(void) { return -1; }
WEAKFUNC int udp_cc_shutdown(void) { return -1; }
/*
* --INFO--
* Address: 800C0C38
* Size: 000008
*/
int udp_cc_open(void) { return -1; }
WEAKFUNC int udp_cc_open(void) { return -1; }
/*
* --INFO--
* Address: 800C0C30
* Size: 000008
*/
int udp_cc_close(void) { return -1; }
WEAKFUNC int udp_cc_close(void) { return -1; }
/*
* --INFO--
* Address: 800C0C28
* Size: 000008
*/
int udp_cc_read(u8* dest, int size) { return 0; }
WEAKFUNC int udp_cc_read(u8* dest, int size) { return 0; }
/*
* --INFO--
* Address: 800C0C20
* Size: 000008
*/
int udp_cc_write(const u8* src, int size) { return 0; }
WEAKFUNC int udp_cc_write(const u8* src, int size) { return 0; }
/*
* --INFO--
* Address: 800C0C18
* Size: 000008
*/
int udp_cc_peek(void) { return 0; }
WEAKFUNC int udp_cc_peek(void) { return 0; }
/*
* --INFO--
* Address: 800C0C10
* Size: 000008
*/
int udp_cc_pre_continue(void) { return -1; }
WEAKFUNC int udp_cc_pre_continue(void) { return -1; }
/*
* --INFO--
* Address: 800C0C08
* Size: 000008
*/
int udp_cc_post_stop(void) { return -1; }
WEAKFUNC int udp_cc_post_stop(void) { return -1; }

View File

@ -133,7 +133,7 @@ asm void PPCMtl2cr (register u32 newL2cr)
* Address: 800D4588
* Size: 000008
*/
__declspec ( weak ) asm void PPCMtdec ( register u32 newDec )
WEAKFUNC asm void PPCMtdec ( register u32 newDec )
{
nofralloc
mtdec newDec
@ -177,7 +177,7 @@ void PPCEieio(void)
* Address: 800D4598
* Size: 000014
*/
__declspec ( weak ) asm void PPCHalt (void) //spins infinitely
WEAKFUNC asm void PPCHalt (void) //spins infinitely
{
nofralloc

View File

@ -45,7 +45,7 @@ static DVDBuffer Curr;
* Address: 800DB2B0
* Size: 000040
*/
__declspec(weak) void __DVDInitWA()
WEAKFUNC void __DVDInitWA()
{
NextCommandNumber = 0;
CommandList[0].cmd = -1;
@ -82,7 +82,7 @@ static BOOL ProcessNextCommand()
* Address: 800DB2F0
* Size: 0002E0
*/
__declspec(weak) void __DVDInterruptHandler(__OSInterrupt interrupt, OSContext* context)
WEAKFUNC void __DVDInterruptHandler(__OSInterrupt interrupt, OSContext* context)
{
DVDLowCallback cb;
OSContext exceptionContext;
@ -338,7 +338,7 @@ static void WaitBeforeRead(void* addr, u32 length, u32 offset, DVDLowCallback ca
* Address: 800DB854
* Size: 000298
*/
__declspec(weak) BOOL DVDLowRead(void* addr, u32 length, u32 offset, DVDLowCallback callback)
WEAKFUNC BOOL DVDLowRead(void* addr, u32 length, u32 offset, DVDLowCallback callback)
{
OSTime diff;
u32 prev;
@ -379,7 +379,7 @@ __declspec(weak) BOOL DVDLowRead(void* addr, u32 length, u32 offset, DVDLowCallb
* Address: 800DBAEC
* Size: 000094
*/
__declspec(weak) BOOL DVDLowSeek(u32 offset, DVDLowCallback callback)
WEAKFUNC BOOL DVDLowSeek(u32 offset, DVDLowCallback callback)
{
StopAtNextInt = FALSE;
Callback = callback;
@ -395,7 +395,7 @@ __declspec(weak) BOOL DVDLowSeek(u32 offset, DVDLowCallback callback)
* Address: 800DBB80
* Size: 00002C
*/
__declspec(weak) BOOL DVDLowWaitCoverClose(DVDLowCallback callback)
WEAKFUNC BOOL DVDLowWaitCoverClose(DVDLowCallback callback)
{
Callback = callback;
WaitingCoverClose = TRUE;
@ -409,7 +409,7 @@ __declspec(weak) BOOL DVDLowWaitCoverClose(DVDLowCallback callback)
* Address: 800DBBAC
* Size: 0000A4
*/
__declspec(weak) BOOL DVDLowReadDiskID(DVDDiskID* diskID, DVDLowCallback callback)
WEAKFUNC BOOL DVDLowReadDiskID(DVDDiskID* diskID, DVDLowCallback callback)
{
StopAtNextInt = FALSE;
Callback = callback;
@ -428,7 +428,7 @@ __declspec(weak) BOOL DVDLowReadDiskID(DVDDiskID* diskID, DVDLowCallback callbac
* Address: 800DBC50
* Size: 00008C
*/
__declspec(weak) BOOL DVDLowStopMotor(DVDLowCallback callback)
WEAKFUNC BOOL DVDLowStopMotor(DVDLowCallback callback)
{
StopAtNextInt = FALSE;
Callback = callback;
@ -443,7 +443,7 @@ __declspec(weak) BOOL DVDLowStopMotor(DVDLowCallback callback)
* Address: 800DBCDC
* Size: 00008C
*/
__declspec(weak) BOOL DVDLowRequestError(DVDLowCallback callback)
WEAKFUNC BOOL DVDLowRequestError(DVDLowCallback callback)
{
StopAtNextInt = FALSE;
Callback = callback;
@ -458,7 +458,7 @@ __declspec(weak) BOOL DVDLowRequestError(DVDLowCallback callback)
* Address: 800DBD68
* Size: 00009C
*/
__declspec(weak) BOOL DVDLowInquiry(DVDDriveInfo* info, DVDLowCallback callback)
WEAKFUNC BOOL DVDLowInquiry(DVDDriveInfo* info, DVDLowCallback callback)
{
StopAtNextInt = FALSE;
Callback = callback;
@ -476,7 +476,7 @@ __declspec(weak) BOOL DVDLowInquiry(DVDDriveInfo* info, DVDLowCallback callback)
* Address: 800DBE04
* Size: 000098
*/
__declspec(weak) BOOL DVDLowAudioStream(u32 subcmd, u32 length, u32 offset, DVDLowCallback callback)
WEAKFUNC BOOL DVDLowAudioStream(u32 subcmd, u32 length, u32 offset, DVDLowCallback callback)
{
StopAtNextInt = FALSE;
Callback = callback;
@ -493,7 +493,7 @@ __declspec(weak) BOOL DVDLowAudioStream(u32 subcmd, u32 length, u32 offset, DVDL
* Address: 800DBE9C
* Size: 00008C
*/
__declspec(weak) BOOL DVDLowRequestAudioStatus(u32 subcmd, DVDLowCallback callback)
WEAKFUNC BOOL DVDLowRequestAudioStatus(u32 subcmd, DVDLowCallback callback)
{
StopAtNextInt = FALSE;
Callback = callback;
@ -508,7 +508,7 @@ __declspec(weak) BOOL DVDLowRequestAudioStatus(u32 subcmd, DVDLowCallback callba
* Address: 800DBF28
* Size: 00009C
*/
__declspec(weak) BOOL DVDLowAudioBufferConfig(BOOL enable, u32 size, DVDLowCallback callback)
WEAKFUNC BOOL DVDLowAudioBufferConfig(BOOL enable, u32 size, DVDLowCallback callback)
{
StopAtNextInt = FALSE;
Callback = callback;
@ -523,7 +523,7 @@ __declspec(weak) BOOL DVDLowAudioBufferConfig(BOOL enable, u32 size, DVDLowCallb
* Address: 800DBFC4
* Size: 0000BC
*/
__declspec(weak) void DVDLowReset()
WEAKFUNC void DVDLowReset()
{
u32 reg;
OSTime resetStart;
@ -586,7 +586,7 @@ void SetBreakAlarm(void)
* Address: 800DC080
* Size: 000014
*/
__declspec(weak) BOOL DVDLowBreak()
WEAKFUNC BOOL DVDLowBreak()
{
StopAtNextInt = TRUE;
Breaking = TRUE;
@ -598,7 +598,7 @@ __declspec(weak) BOOL DVDLowBreak()
* Address: 800DC094
* Size: 00001C
*/
__declspec(weak) DVDLowCallback DVDLowClearCallback()
WEAKFUNC DVDLowCallback DVDLowClearCallback()
{
DVDLowCallback old;
__DIRegs[1] = 0;
@ -624,7 +624,7 @@ void DVDLowGetCoverStatus(void)
* Size: 000044
*/
__declspec(weak) void __DVDLowSetWAType(u32 type, u32 location)
WEAKFUNC void __DVDLowSetWAType(u32 type, u32 location)
{
BOOL enabled;
enabled = OSDisableInterrupts();

View File

@ -5,4 +5,4 @@
* Address: 800EAFC0
* Size: 000008
*/
BOOL Hu_IsStub(void) { return FALSE; }
WEAKFUNC BOOL Hu_IsStub(void) { return FALSE; }

View File

@ -84,7 +84,7 @@ static DVDCommandBlock DriveBlock;
static OSBootInfo* BootInfo;
static volatile u32* BI2DebugFlag;
static u32* BI2DebugFlagHolder;
__declspec(weak) BOOL __OSIsGcam = FALSE;
WEAKFUNC BOOL __OSIsGcam = FALSE;
static f64 ZeroF;
static f32 ZeroPS[2];
static BOOL AreWeInitialized = FALSE;

View File

@ -188,4 +188,4 @@ void init(J3DModel*, J3DAnmTransform*, J3DUMtxAnmCacheTable*)
blr
*/
}
} // namespace
} // namespace

View File

@ -52,11 +52,10 @@ void TOmake::doSetArchive(JKRArchive* arc)
mPaneListMesg[i] = static_cast<J2DTextBox*>(E2DScreen_searchAssert(mScreenMain, i + 'Tt00'));
mPaneListMesgShadow[i] = E2DScreen_searchAssert(mScreenMain, i + 'Tts00');
}
mPaneSelect = E2DScreen_searchAssert(mScreenMain, 'Wselctw');
for (int i = 0; i < 7; i++)
{
for (int i = 0; i < 7; i++) {
mMesgTags[i] = mPaneListMesg[i]->mMessageID;
}
@ -78,7 +77,8 @@ void TOmake::doSetArchive(JKRArchive* arc)
// J2DTextBox* pane1 = static_cast<J2DTextBox*>(E2DScreen_searchAssert(mScreenMain, 'Tscolor'));
// J2DTextBox* pane2 = static_cast<J2DTextBox*>(E2DScreen_searchAssert(mScreenMain, 'Tt00'));
mFonts[i].set(static_cast<J2DTextBox*>(E2DScreen_searchAssert(mScreenMain, 'Tt00')), static_cast<J2DTextBox*>(E2DScreen_searchAssert(mScreenMain, 'Tscolor')));
mFonts[i].set(static_cast<J2DTextBox*>(E2DScreen_searchAssert(mScreenMain, 'Tt00')),
static_cast<J2DTextBox*>(E2DScreen_searchAssert(mScreenMain, 'Tscolor')));
mScreenMain->addCallBackPane(mPaneListMesg[i], &mFonts[i]);
}

View File

@ -832,7 +832,7 @@ void EnemyBase::constructor()
* Address: 801017CC
* Size: 00005C
*/
inline void EnemyBase::createEffects()
void EnemyBase::createEffects()
{
EnemyEffectNodeHamon* next;
@ -847,7 +847,7 @@ inline void EnemyBase::createEffects()
* Address: 80101828
* Size: 00005C
*/
inline void EnemyBase::fadeEffects()
void EnemyBase::fadeEffects()
{
EnemyEffectNodeHamon* next;
@ -1729,7 +1729,7 @@ void EnemyBase::doSimulationStick(f32 frameRate)
* Address: 801038D0
* Size: 000070
*/
inline void EnemyBase::updateSpheres()
void EnemyBase::updateSpheres()
{
Sys::Sphere sphere;
mCollTree->mPart->getSphere(sphere);
@ -2931,7 +2931,7 @@ void EnemyBase::getCommonEffectPos(Vector3f& commonEffectPos)
* Address: 80106B60
* Size: 000040
*/
inline void EnemyBase::getWaterSphere(Sys::Sphere* sphere)
void EnemyBase::getWaterSphere(Sys::Sphere* sphere)
{
sphere->mPosition.x = mPosition.x + mEffectOffset.x;
sphere->mPosition.y = mPosition.y + mEffectOffset.y;

7018
weak_funcs.txt Normal file

File diff suppressed because it is too large Load Diff

6979
weak_funcs_built.txt Normal file

File diff suppressed because it is too large Load Diff

1371
weak_objects.txt Normal file

File diff suppressed because it is too large Load Diff

1349
weak_objects_built.txt Normal file

File diff suppressed because it is too large Load Diff