some small NameObj functions

This commit is contained in:
shibbo 2022-01-20 04:53:59 -05:00
parent 6057eb30e6
commit 200a9b63dc
7 changed files with 68 additions and 28 deletions

View File

@ -372,7 +372,8 @@ def check_symbol(function_library, mangled_symbol, obj_name, readonly):
#print_instruction_comparison_warning(f"Skipping branch instruction at line {line_string}.", original_instruction, custom_instruction)
warning_count += 1
else:
print_instruction_comparison_error(f"Instruction mismatch on line {line_string}.", original_instruction, custom_instruction)
print(f"{Fore.RED}{str(original_instruction):<80}{custom_instruction}{Style.RESET_ALL}")
#print_instruction_comparison_error(f"Instruction mismatch on line {line_string}.", original_instruction, custom_instruction)
error_count += 1
elif original_instruction.id == PPC_INS_ADDI and custom_instruction.id == PPC_INS_LI:
assert(len(original_operands) == 3 and len(custom_operands) == 2)

View File

@ -29,11 +29,11 @@ calcViewAndEntry__7NameObjFv,NameObj.o,NameObj.a,true
initWithoutIter__7NameObjFv,NameObj.o,NameObj.a,true
setName__7NameObjFPCc,NameObj.o,NameObj.a,true
executeMovement__7NameObjFv,NameObj.o,NameObj.a,true
requestSuspend__7NameObjFv,NameObj.o,NameObj.a,false
requestResume__7NameObjFv,NameObj.o,NameObj.a,false
requestSuspend__7NameObjFv,NameObj.o,NameObj.a,true
requestResume__7NameObjFv,NameObj.o,NameObj.a,true
syncWithFlags__7NameObjFv,NameObj.o,NameObj.a,false
requestMovementOn__15NameObjFunctionFP7NameObj,NameObj.o,NameObj.a,false
requestMovementOff__15NameObjFunctionFP7NameObj,NameObj.o,NameObj.a,false
requestMovementOn__15NameObjFunctionFP7NameObj,NameObj.o,NameObj.a,true
requestMovementOff__15NameObjFunctionFP7NameObj,NameObj.o,NameObj.a,true
__ct__14NameObjAdaptorFPCc,NameObjAdaptor.o,NameObj.a,true
__dt__14NameObjAdaptorFv,NameObjAdaptor.o,NameObj.a,true
movement__14NameObjAdaptorFv,NameObjAdaptor.o,NameObj.a,true
@ -56,11 +56,11 @@ add__19NameObjCategoryListFP7NameObji,NameObjCategoryList.o,NameObj.a,true
remove__19NameObjCategoryListFP7NameObji,NameObjCategoryList.o,NameObj.a,false
registerExecuteBeforeFunction__19NameObjCategoryListFRCQ22MR11FunctorBasei,NameObjCategoryList.o,NameObj.a,true
initTable__19NameObjCategoryListFUlPC24CategoryListInitialTable,NameObjCategoryList.o,NameObj.a,true
__ct__Q219NameObjCategoryList12CategoryInfoFv,NameObjCategoryList.o,NameObj.a,false
__ct__Q219NameObjCategoryList12CategoryInfoFv,NameObjCategoryList.o,NameObj.a,true
__dt__Q219NameObjCategoryList12CategoryInfoFv,NameObjCategoryList.o,NameObj.a,false
__cl__Q233@unnamed@NameObjCategoryList_cpp@40NameObjRealDelegator<M7NameObjFPCvPCv_v>FP7NameObj,NameObjCategoryList.o,NameObj.a,false
__cl__Q233@unnamed@NameObjCategoryList_cpp@40NameObjRealDelegator<M7NameObjFPCvPCv_v>FP7NameObj,NameObjCategoryList.o,NameObj.a,true
__cl__Q233@unnamed@NameObjCategoryList_cpp@39NameObjRealDelegator<M7NameObjFPCvPv_v>FP7NameObj,NameObjCategoryList.o,NameObj.a,true
__dt__Q22MR54AssignableArray<Q219NameObjCategoryList12CategoryInfo>Fv,NameObjCategoryList.o,NameObj.a,false
__dt__Q22MR54AssignableArray<Q219NameObjCategoryList12CategoryInfo>Fv,NameObjCategoryList.o,NameObj.a,true
__ct__18NameObjExecuteInfoFv,NameObjExecuteHolder.o,NameObj.a,true
setConnectInfo__18NameObjExecuteInfoFP7NameObjiiii,NameObjExecuteHolder.o,NameObj.a,true
initConnectting__18NameObjExecuteInfoFv,NameObjExecuteHolder.o,NameObj.a,true

1 Symbol Name Object File Library Archive Matching
29 initWithoutIter__7NameObjFv NameObj.o NameObj.a true
30 setName__7NameObjFPCc NameObj.o NameObj.a true
31 executeMovement__7NameObjFv NameObj.o NameObj.a true
32 requestSuspend__7NameObjFv NameObj.o NameObj.a false true
33 requestResume__7NameObjFv NameObj.o NameObj.a false true
34 syncWithFlags__7NameObjFv NameObj.o NameObj.a false
35 requestMovementOn__15NameObjFunctionFP7NameObj NameObj.o NameObj.a false true
36 requestMovementOff__15NameObjFunctionFP7NameObj NameObj.o NameObj.a false true
37 __ct__14NameObjAdaptorFPCc NameObjAdaptor.o NameObj.a true
38 __dt__14NameObjAdaptorFv NameObjAdaptor.o NameObj.a true
39 movement__14NameObjAdaptorFv NameObjAdaptor.o NameObj.a true
56 remove__19NameObjCategoryListFP7NameObji NameObjCategoryList.o NameObj.a false
57 registerExecuteBeforeFunction__19NameObjCategoryListFRCQ22MR11FunctorBasei NameObjCategoryList.o NameObj.a true
58 initTable__19NameObjCategoryListFUlPC24CategoryListInitialTable NameObjCategoryList.o NameObj.a true
59 __ct__Q219NameObjCategoryList12CategoryInfoFv NameObjCategoryList.o NameObj.a false true
60 __dt__Q219NameObjCategoryList12CategoryInfoFv NameObjCategoryList.o NameObj.a false
61 __cl__Q233@unnamed@NameObjCategoryList_cpp@40NameObjRealDelegator<M7NameObjFPCvPCv_v>FP7NameObj NameObjCategoryList.o NameObj.a false true
62 __cl__Q233@unnamed@NameObjCategoryList_cpp@39NameObjRealDelegator<M7NameObjFPCvPv_v>FP7NameObj NameObjCategoryList.o NameObj.a true
63 __dt__Q22MR54AssignableArray<Q219NameObjCategoryList12CategoryInfo>Fv NameObjCategoryList.o NameObj.a false true
64 __ct__18NameObjExecuteInfoFv NameObjExecuteHolder.o NameObj.a true
65 setConnectInfo__18NameObjExecuteInfoFP7NameObjiiii NameObjExecuteHolder.o NameObj.a true
66 initConnectting__18NameObjExecuteInfoFv NameObjExecuteHolder.o NameObj.a true

View File

@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "decompiled",
"message": "4.63524175758314%",
"message": "4.643265220896579%",
"color": "blue"
}

View File

@ -13,7 +13,7 @@
| [LiveActor](https://github.com/shibbo/Petari/blob/master/docs/lib/LiveActor.md) | 35.83679114799447% |
| [Map](https://github.com/shibbo/Petari/blob/master/docs/lib/Map.md) | 9.108127680909142% |
| [MapObj](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj.md) | 3.201281344579767% |
| [NameObj](https://github.com/shibbo/Petari/blob/master/docs/lib/NameObj.md) | 18.945379594641018% |
| [NameObj](https://github.com/shibbo/Petari/blob/master/docs/lib/NameObj.md) | 19.658193060803846% |
| [NPC](https://github.com/shibbo/Petari/blob/master/docs/lib/NPC.md) | 0.35402906208718626% |
| [Player](https://github.com/shibbo/Petari/blob/master/docs/lib/Player.md) | 0.14184156212575486% |
| [RhythmLib](https://github.com/shibbo/Petari/blob/master/docs/lib/RhythmLib.md) | 0.0% |

View File

@ -3,10 +3,10 @@
| ------------- | ------------- | ------------- | ------------- |
| ModelChangableObjFactory.o | 0.0% | 0 / 13 | 0.0% |
| MovementOnOffGroupHolder.o | 100.0% | 6 / 6 | 100.0% |
| NameObj.o | 55.46875% | 11 / 16 | 68.75% |
| NameObj.o | 86.71875% | 15 / 16 | 93.75% |
| NameObjAdaptor.o | 100.0% | 9 / 9 | 100.0% |
| NameObjArchiveListCollector.o | 100.0% | 3 / 3 | 100.0% |
| NameObjCategoryList.o | 76.39593908629442% | 10 / 15 | 66.66666666666666% |
| NameObjCategoryList.o | 87.30964467005076% | 13 / 15 | 86.66666666666667% |
| NameObjExecuteHolder.o | 94.73684210526315% | 44 / 49 | 89.79591836734694% |
| NameObjFactory.o | 3.7077907746634295% | 20 / 568 | 3.5211267605633805% |
| NameObjFinder.o | 0.0% | 0 / 1 | 0.0% |
@ -59,11 +59,11 @@
| initWithoutIter__7NameObjFv | :white_check_mark: |
| setName__7NameObjFPCc | :white_check_mark: |
| executeMovement__7NameObjFv | :white_check_mark: |
| requestSuspend__7NameObjFv | :x: |
| requestResume__7NameObjFv | :x: |
| requestSuspend__7NameObjFv | :white_check_mark: |
| requestResume__7NameObjFv | :white_check_mark: |
| syncWithFlags__7NameObjFv | :x: |
| requestMovementOn__15NameObjFunctionFP7NameObj | :x: |
| requestMovementOff__15NameObjFunctionFP7NameObj | :x: |
| requestMovementOn__15NameObjFunctionFP7NameObj | :white_check_mark: |
| requestMovementOff__15NameObjFunctionFP7NameObj | :white_check_mark: |
# NameObjAdaptor.o
@ -101,11 +101,11 @@
| remove__19NameObjCategoryListFP7NameObji | :x: |
| registerExecuteBeforeFunction__19NameObjCategoryListFRCQ22MR11FunctorBasei | :white_check_mark: |
| initTable__19NameObjCategoryListFUlPC24CategoryListInitialTable | :white_check_mark: |
| __ct__Q219NameObjCategoryList12CategoryInfoFv | :x: |
| __ct__Q219NameObjCategoryList12CategoryInfoFv | :white_check_mark: |
| __dt__Q219NameObjCategoryList12CategoryInfoFv | :x: |
| __cl__Q233@unnamed@NameObjCategoryList_cpp@40NameObjRealDelegator&lt;M7NameObjFPCvPCv_v&gt;FP7NameObj | :x: |
| __cl__Q233@unnamed@NameObjCategoryList_cpp@40NameObjRealDelegator&lt;M7NameObjFPCvPCv_v&gt;FP7NameObj | :white_check_mark: |
| __cl__Q233@unnamed@NameObjCategoryList_cpp@39NameObjRealDelegator&lt;M7NameObjFPCvPv_v&gt;FP7NameObj | :white_check_mark: |
| __dt__Q22MR54AssignableArray&lt;Q219NameObjCategoryList12CategoryInfo&gt;Fv | :x: |
| __dt__Q22MR54AssignableArray&lt;Q219NameObjCategoryList12CategoryInfo&gt;Fv | :white_check_mark: |
# NameObjExecuteHolder.o

View File

@ -4,6 +4,10 @@
#include <revolution.h>
namespace MR {
void notifyRequestNameObjMovementOnOff();
}
class NameObj {
public:
NameObj(const char *);
@ -24,6 +28,12 @@ public:
void syncWithFlags();
const char* mName; // _4
u16 mFlags; // _8
volatile u16 mFlags; // _8
s16 _A;
};
class NameObjFunction {
public:
static void requestMovementOn(NameObj *);
static void requestMovementOff(NameObj *);
};

View File

@ -1,6 +1,7 @@
#include "Game/NameObj/NameObj.h"
#include "Game/NameObj/NameObjRegister.h"
#include "Game/SingletonHolder.h"
#include "Game/Util.h"
NameObj::NameObj(const char *pName) {
mName = pName;
@ -54,18 +55,46 @@ void NameObj::executeMovement() {
}
}
#ifdef NON_MATCHING
// mFlags does not get reloaded in the block
void NameObj::requestSuspend() {
if ((mFlags & 0x4) == 0x4) {
mFlags &= 0xFFFFFFFB;
u16 flag = (mFlags & 0x4);
if (flag == 0x4) {
mFlags &= ~0x4;
}
mFlags |= 2;
}
void NameObj::requestResume() {
u16 flag = (mFlags & 0x2);
if (flag == 0x2) {
mFlags &= ~0x2;
}
mFlags |= 4;
}
#ifdef NON_MATCHING
void NameObj::syncWithFlags() {
u16 flag = (mFlags & 0x2);
if (flag == 0x2) {
flag = mFlags;
flag &= (~0x2);
flag |= 0x1;
mFlags = flag;
}
mFlags |= 2;
flag = (mFlags & 0x4);
if (flag == 0x4) {
mFlags = (mFlags & 0xFFFFFFFA);
}
}
#endif
// same issues will persist with these, decomp when requestSuspend matches
void NameObjFunction::requestMovementOn(NameObj *pObj) {
pObj->requestResume();
MR::notifyRequestNameObjMovementOnOff();
}
// NameObj::requestResume
// NameObj::syncWithFlags
void NameObjFunction::requestMovementOff(NameObj *pObj) {
pObj->requestSuspend();
MR::notifyRequestNameObjMovementOnOff();
}