mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Improve matches
This commit is contained in:
parent
0c749a6124
commit
e6a69ef78d
|
|
@ -38,4 +38,4 @@ add_subdirectory(include/sead)
|
|||
target_link_libraries(odyssey PUBLIC sead)
|
||||
|
||||
add_subdirectory(include/agl)
|
||||
target_link_libraries(odyssey PUBLIC agl)
|
||||
target_link_libraries(odyssey PUBLIC agl)
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ Address,Quality,Size,Name
|
|||
0x0000007100004b48,U,000124,_ZN15ItemAmiiboKoopa9exeExpandEv
|
||||
0x0000007100004bc4,U,000080,_ZN15ItemAmiiboKoopa7exeWaitEv
|
||||
0x0000007100004c14,U,000008,_ZN15ItemAmiiboKoopa12attackSensorEPN2al9HitSensorES2_
|
||||
0x0000007100004c1c,O,000008,_ZNK2al9LiveActor14getNerveKeeperEv
|
||||
0x0000007100004c1c,U,000008,_ZNK2al9LiveActor14getNerveKeeperEv
|
||||
0x0000007100004c24,U,000004,_ZN2al9LiveActor4initERKNS_13ActorInitInfoE
|
||||
0x0000007100004c28,U,000004,_ZN2al9LiveActor12attackSensorEPNS_9HitSensorES2_
|
||||
0x0000007100004c2c,U,000008,_ZN2al9LiveActor10receiveMsgEPKNS_9SensorMsgEPNS_9HitSensorES5_
|
||||
|
|
@ -66391,7 +66391,7 @@ Address,Quality,Size,Name
|
|||
0x0000007100a61da8,U,000008,_ZN2al14ActorScoreInfoC2Ev
|
||||
0x0000007100a61db0,U,000068,_ZN2al14ActorScoreInfo4initERKNS_9ByamlIterE
|
||||
0x0000007100a61df4,U,000012,_ZN2al16ActorScoreKeeperC2Ev
|
||||
0x0000007100a61e00,U,000372,_ZN2al16ActorScoreKeeper4initERKNS_9ByamlIterE
|
||||
0x0000007100a61e00,O,000372,_ZN2al16ActorScoreKeeper4initERKNS_9ByamlIterE
|
||||
0x0000007100a61f74,U,000012,_ZNK2al16ActorScoreKeeper15getCategoryNameEv
|
||||
0x0000007100a61f80,U,000128,_ZNK2al16ActorScoreKeeper18tryGetCategoryNameEPKc
|
||||
0x0000007100a62000,U,000084,_ZN2al18JointAimControllerC1EPKNS_12JointAimInfoE
|
||||
|
|
|
|||
|
Can't render this file because it is too large.
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "al/actor/ActorInitInfo.h"
|
||||
#include "al/byaml/ByamlIter.h"
|
||||
|
||||
#include "al/area/AreaObjDirector.h"
|
||||
#include "al/audio/AudioKeeper.h"
|
||||
#include "al/camera/CameraDirector.h"
|
||||
|
|
@ -8,7 +9,6 @@
|
|||
#include "al/effect/EffectKeeper.h"
|
||||
#include "al/hio/HioNode.h"
|
||||
#include "al/nerve/Nerve.h"
|
||||
#include "al/pose/ActorPoseKeeper.h"
|
||||
#include "al/rail/RailKeeper.h"
|
||||
#include "al/rail/RailRider.h"
|
||||
#include "al/scene/SceneObjHolder.h"
|
||||
|
|
@ -18,23 +18,69 @@
|
|||
|
||||
namespace al
|
||||
{
|
||||
class ActorScoreKeeper {
|
||||
public:
|
||||
struct Entry {
|
||||
const char* factorName;
|
||||
const char* categoryName;
|
||||
};
|
||||
|
||||
ActorScoreKeeper();
|
||||
|
||||
void init(const al::ByamlIter& iter);
|
||||
void getCategoryName(); //unknown return type
|
||||
const char* tryGetCategoryName(const char* a1);
|
||||
|
||||
private:
|
||||
inline void allocArray();
|
||||
inline void putEntry(int index, const al::ByamlIter& iter);
|
||||
|
||||
Entry* array;
|
||||
int size;
|
||||
};
|
||||
|
||||
class ActorPoseKeeperBase;
|
||||
class ActorExecuteInfo;
|
||||
class ActorActionKeeper;
|
||||
class ActorItemKeeper;
|
||||
class ActorScoreKeeper;
|
||||
class Collider;
|
||||
class ModelKeeper;
|
||||
class ShadowKeeper;
|
||||
class ActorPrePassLightKeeper;
|
||||
class ActorOcclusionKeeper;
|
||||
class SubActorKeeper;
|
||||
class ActorSceneInfo;
|
||||
class LiveActorFlag;
|
||||
|
||||
class LiveActor : public al::IUseNerve, public al::IUseEffectKeeper, public al::IUseAudioKeeper, public al::IUseStageSwitch, public al::IUseSceneObjHolder, public al::IUseAreaObj, public al::IUseCamera, public al::IUseCollision, public al::IUseRail, public al::IUseHioNode
|
||||
{
|
||||
public:
|
||||
LiveActor(const char *);
|
||||
|
||||
virtual al::NerveKeeper* getNerveKeeper() const;
|
||||
|
||||
const char* mActorName; // _48
|
||||
al::ActorPoseKeeperBase* mPoseKeeper; // _50
|
||||
char _58[0x90-0x58];
|
||||
al::NerveKeeper* mNerveKeeper; // _90
|
||||
al::HitSensorKeeper* mHitSensorKeeper; // _98
|
||||
al::ScreenPointKeeper* mScreenPointKeeper; // _A0
|
||||
al::EffectKeeper* mEffectKeeper; // _A8
|
||||
al::AudioKeeper* mAudioKeeper; // _B0
|
||||
|
||||
al::StageSwitchKeeper* mStageSwitchKeeper; // _C0
|
||||
al::RailKeeper* mRailKeeper; // _C8
|
||||
const char *mActorName;
|
||||
al::ActorPoseKeeperBase *mPoseKeeper;
|
||||
al::ActorExecuteInfo *mLayoutExecuteInfo;
|
||||
al::ActorActionKeeper *mActorActionKeeper;
|
||||
al::ActorItemKeeper *mActorItemKeeper;
|
||||
al::ActorScoreKeeper *mActorScoreKeeper;
|
||||
al::Collider *mCollider;
|
||||
void *gap_2;
|
||||
al::ModelKeeper *mModelKeeper;
|
||||
al::NerveKeeper *mNerveKeeper;
|
||||
al::HitSensorKeeper *mHitSensorKeeper;
|
||||
al::ScreenPointKeeper *mScreenPointKeeper;
|
||||
al::EffectKeeper *mEffectKeeper;
|
||||
al::AudioKeeper *mAudioKeeper;
|
||||
void *gap_4;
|
||||
al::StageSwitchKeeper *mStageSwitchKeeper;
|
||||
al::RailKeeper *mRailKeeper;
|
||||
al::ShadowKeeper *mShadowKeeper;
|
||||
al::ActorPrePassLightKeeper *mActorPrePassLightKeeper;
|
||||
al::ActorOcclusionKeeper *mActorOcclusionKeeper;
|
||||
al::SubActorKeeper *mSubActorKeeper;
|
||||
void *gap_6;
|
||||
al::ActorSceneInfo *mSceneInfo;
|
||||
al::LiveActorFlag *mLiveActorFlag;
|
||||
};
|
||||
};
|
||||
|
|
@ -33,5 +33,6 @@ namespace al
|
|||
{
|
||||
public:
|
||||
ProjectActorFactory();
|
||||
const char* convertName(const char*) const override;
|
||||
};
|
||||
};
|
||||
|
|
@ -9,6 +9,6 @@ namespace al
|
|||
public:
|
||||
virtual al::SceneObjHolder* getSceneObjHolder() const = 0;
|
||||
|
||||
static const char* sSceneObjName;
|
||||
const char* mSceneObjName;
|
||||
};
|
||||
};
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
#include "al/LiveActor/LiveActor.h"
|
||||
#include "al/sensor/SensorHitGroup.h"
|
||||
#include <math/seadVector.h>
|
||||
#include <math/seadMatrix.h>
|
||||
|
||||
namespace al
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,11 +1,40 @@
|
|||
#include "al/LiveActor/LiveActor.h"
|
||||
|
||||
#include "al/resource/Resource.h"
|
||||
#include <string.h>
|
||||
|
||||
namespace al
|
||||
{
|
||||
al::NerveKeeper* LiveActor::getNerveKeeper() const
|
||||
{
|
||||
return mNerveKeeper;
|
||||
|
||||
ActorScoreKeeper::ActorScoreKeeper() = default;
|
||||
|
||||
void ActorScoreKeeper::init(const al::ByamlIter& iter){
|
||||
if(iter.isTypeArray()){
|
||||
size = iter.getSize();
|
||||
allocArray();
|
||||
for(int i=0;i<size;i++){
|
||||
al::ByamlIter subIter;
|
||||
iter.tryGetIterByIndex(&subIter, i);
|
||||
putEntry(i, subIter);
|
||||
}
|
||||
}
|
||||
else {
|
||||
size = 1;
|
||||
allocArray();
|
||||
putEntry(0, iter);
|
||||
}
|
||||
}
|
||||
|
||||
inline void ActorScoreKeeper::allocArray(){
|
||||
Entry* local_array = new Entry[size];
|
||||
if(size)
|
||||
memset(local_array, 0, sizeof(Entry)*size);
|
||||
array = local_array;
|
||||
}
|
||||
|
||||
inline void ActorScoreKeeper::putEntry(int index, const al::ByamlIter& iter){
|
||||
auto& entry = array[index];
|
||||
iter.tryGetStringByKey(&entry.factorName, "FactorName");
|
||||
iter.tryGetStringByKey(&entry.categoryName, "CategoryName");
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -12,8 +12,8 @@ namespace al
|
|||
: mFactoryName(pName), mFactoryEntries(nullptr), mNumFactoryEntries(0)
|
||||
{ }
|
||||
|
||||
ProjectActorFactory::ProjectActorFactory() : ActorFactory("繧「繧ッ繧ソ繝シ逕滓")
|
||||
{
|
||||
ProjectActorFactory::ProjectActorFactory() : ActorFactory("アクター生成") {//("繧「繧ッ繧ソ繝シ逕滓")
|
||||
mFactoryEntries = nullptr;
|
||||
#ifdef VER_100
|
||||
mNumFactoryEntries = 0x23A;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3,29 +3,24 @@
|
|||
namespace al
|
||||
{
|
||||
|
||||
NerveExecutor::NerveExecutor(const char *pName) : IUseNerve()
|
||||
{ }
|
||||
NerveExecutor::NerveExecutor(const char *pName) : IUseNerve() {
|
||||
mKeeper = 0;
|
||||
}
|
||||
|
||||
NerveExecutor::~NerveExecutor()
|
||||
{
|
||||
NerveExecutor::~NerveExecutor() {
|
||||
delete mKeeper;
|
||||
}
|
||||
|
||||
NerveKeeper* NerveExecutor::getNerveKeeper() const
|
||||
{
|
||||
NerveKeeper* NerveExecutor::getNerveKeeper() const {
|
||||
return mKeeper;
|
||||
}
|
||||
|
||||
void NerveExecutor::initNerve(const al::Nerve *pNerve, int nerveCount)
|
||||
{
|
||||
void NerveExecutor::initNerve(const al::Nerve *pNerve, int nerveCount) {
|
||||
mKeeper = new NerveKeeper(this, pNerve, nerveCount);
|
||||
}
|
||||
|
||||
void NerveExecutor::updateNerve()
|
||||
{
|
||||
void NerveExecutor::updateNerve() {
|
||||
if (mKeeper)
|
||||
{
|
||||
mKeeper->update();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -51,7 +51,7 @@ namespace al
|
|||
while (*pString_0 == *pString_1) {
|
||||
char val = *pString_0; //required to match
|
||||
|
||||
if (!*pString_0)
|
||||
if (!val)
|
||||
return true;
|
||||
|
||||
++pString_1;
|
||||
|
|
@ -61,6 +61,7 @@ namespace al
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool isEndWithString(const char *pString_0, const char *pString_1)
|
||||
{
|
||||
int pString0_Len = strlen(pString_0);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,12 @@ add_definitions(-D SWITCH)
|
|||
add_definitions(-D NNSDK)
|
||||
add_definitions(-D MATCHING_HACK_NX_CLANG)
|
||||
|
||||
# TODO multi-version definitions here
|
||||
add_definitions(-D VER_100)
|
||||
|
||||
add_link_options(-stdlib=libc++ -nostdlib)
|
||||
add_link_options(-fPIC -Wl,-Bsymbolic-functions -shared)
|
||||
# Use lld for performance reasons (and because we don't want a dependency on GNU tools)
|
||||
add_link_options(-fuse-ld=${ODYSSEY_CLANG_LLD}/bin/ld.lld)
|
||||
#add_link_options(-B "/home/monsterdruide1/botw/toolchain/lld-path")
|
||||
#add_link_options(-fuse-ld=lld)
|
||||
|
|
|
|||
BIN
toolchain/lld-path/ld
Normal file
BIN
toolchain/lld-path/ld
Normal file
Binary file not shown.
BIN
toolchain/lld-path/ld.lld
Normal file
BIN
toolchain/lld-path/ld.lld
Normal file
Binary file not shown.
|
|
@ -6,8 +6,6 @@ import cxxfilt
|
|||
from colorama import Fore, Style
|
||||
|
||||
from util import utils
|
||||
import util.checker
|
||||
import check
|
||||
|
||||
parser = argparse.ArgumentParser(description="Diff assembly")
|
||||
parser.add_argument(
|
||||
|
|
@ -28,34 +26,28 @@ def find_function_info(name: str):
|
|||
|
||||
return None
|
||||
|
||||
def check_func(info):
|
||||
checker = util.checker.FunctionChecker(log_mismatch_cause=True)
|
||||
return check.check_function(checker, info.addr, info.size, info.decomp_name)
|
||||
|
||||
info = find_function_info(args.function)
|
||||
if info is not None:
|
||||
if not info.decomp_name:
|
||||
utils.fail(f"{args.function} has not been decompiled")
|
||||
|
||||
print("comparing functions...")
|
||||
if(check_func(info)):
|
||||
print("matching function!")
|
||||
else:
|
||||
print(
|
||||
f"diffing: {Style.BRIGHT}{Fore.BLUE}{cxxfilt.demangle(info.decomp_name)}{Style.RESET_ALL} {Style.DIM}({info.decomp_name}){Style.RESET_ALL}")
|
||||
addr_end = info.addr + info.size
|
||||
subprocess.call(["tools/asm-differ/diff.py", "-I", "-e", info.decomp_name, "0x%016x" %
|
||||
|
||||
print(
|
||||
f"diffing: {Style.BRIGHT}{Fore.BLUE}{cxxfilt.demangle(info.decomp_name)}{Style.RESET_ALL} {Style.DIM}({info.decomp_name}){Style.RESET_ALL}")
|
||||
addr_end = info.addr + info.size
|
||||
subprocess.call(["tools/asm-differ/diff.py", "-I", "-e", info.decomp_name, "0x%016x" %
|
||||
info.addr, "0x%016x" % addr_end] + unknown)
|
||||
|
||||
if info.status == utils.FunctionStatus.NonMatching:
|
||||
utils.warn(
|
||||
f"{info.decomp_name} is marked as non-matching and possibly NOT functionally equivalent")
|
||||
elif info.status == utils.FunctionStatus.Equivalent:
|
||||
utils.warn(f"{info.decomp_name} is marked as functionally equivalent but non-matching")
|
||||
if info.status == utils.FunctionStatus.NonMatching:
|
||||
utils.warn(
|
||||
f"{info.decomp_name} is marked as non-matching and possibly NOT functionally equivalent")
|
||||
elif info.status == utils.FunctionStatus.Equivalent:
|
||||
utils.warn(f"{info.decomp_name} is marked as functionally equivalent but non-matching")
|
||||
|
||||
else:
|
||||
if find_wip:
|
||||
utils.fail("no WIP function")
|
||||
|
||||
utils.fail(
|
||||
f"unknown function '{args.function}'\nfor constructors and destructors, list the complete object constructor (C1) or destructor (D1)")
|
||||
f"unknown function '{args.function}'\nfor constructors and destructors, list the complete object constructor (C1) or destructor (D1)")
|
||||
|
||||
Loading…
Reference in a new issue