From 22ac0b92967ab5188ac433cbc814c0e5bd422b31 Mon Sep 17 00:00:00 2001 From: Joshua Peisach Date: Sat, 4 Nov 2023 09:47:35 -0400 Subject: [PATCH] Add missing ClassName's and IsA's (#262) * Add missing ClassName's and IsA's Exceptions: LegoAnimActor as it does something weird with a call to another private/inlined function(?) and RaceStandsEntity which seems to have two vtables * clang-format --------- Co-authored-by: Christian Semmler --- LEGO1/mxnextactiondatastart.h | 16 +++++++++++++++- LEGO1/mxramstreamprovider.h | 13 +++++++++++++ LEGO1/mxsmkpresenter.h | 13 +++++++++++++ LEGO1/mxstillpresenter.h | 13 +++++++++++++ LEGO1/mxstreamchunk.h | 15 ++++++++++++++- LEGO1/pizzeria.h | 12 ++++++++++++ LEGO1/pizzeriastate.h | 13 +++++++++++++ LEGO1/radio.h | 13 +++++++++++++ LEGO1/registrationbook.h | 13 +++++++++++++ 9 files changed, 119 insertions(+), 2 deletions(-) diff --git a/LEGO1/mxnextactiondatastart.h b/LEGO1/mxnextactiondatastart.h index 480e39b3..cf38242c 100644 --- a/LEGO1/mxnextactiondatastart.h +++ b/LEGO1/mxnextactiondatastart.h @@ -4,6 +4,20 @@ #include "mxcore.h" // VTABLE 0x100dc9a0 -class MxNextActionDataStart : public MxCore {}; +class MxNextActionDataStart : public MxCore { +public: + // OFFSET: LEGO1 0x100c1900 + inline virtual const char* ClassName() const override // vtable+0xc + { + // 0x101025a0 + return "MxNextActionDataStart"; + } + + // OFFSET: LEGO1 0x100c1910 + inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + { + return !strcmp(name, MxNextActionDataStart::ClassName()) || MxCore::IsA(name); + } +}; #endif // MXNEXTACTIONDATASTART_H diff --git a/LEGO1/mxramstreamprovider.h b/LEGO1/mxramstreamprovider.h index ba32768a..0dfd33ef 100644 --- a/LEGO1/mxramstreamprovider.h +++ b/LEGO1/mxramstreamprovider.h @@ -9,6 +9,19 @@ class MxRAMStreamProvider : public MxStreamProvider { MxRAMStreamProvider(); virtual ~MxRAMStreamProvider() override; + // OFFSET: LEGO1 0x100d0970 + inline virtual const char* ClassName() const override // vtable+0xc + { + // 0x10102864 + return "MxRAMStreamProvider"; + } + + // OFFSET: LEGO1 0x100d0980 + inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + { + return !strcmp(name, MxRAMStreamProvider::ClassName()) || MxStreamProvider::IsA(name); + } + virtual MxResult SetResourceToGet(MxStreamController* p_resource) override; // vtable+0x14 virtual MxU32 GetFileSize() override; // vtable+0x18 virtual MxU32 GetStreamBuffersNum() override; // vtable+0x1c diff --git a/LEGO1/mxsmkpresenter.h b/LEGO1/mxsmkpresenter.h index 39fbba94..549c65b7 100644 --- a/LEGO1/mxsmkpresenter.h +++ b/LEGO1/mxsmkpresenter.h @@ -13,6 +13,19 @@ class MxSmkPresenter : public MxVideoPresenter { MxSmkPresenter(); virtual ~MxSmkPresenter() override; + // OFFSET: LEGO1 0x100b3730 + inline virtual const char* ClassName() const override // vtable+0xc + { + // 0x10101e38 + return "MxSmkPresenter"; + } + + // OFFSET: LEGO1 0x100b3740 + inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + { + return !strcmp(name, MxSmkPresenter::ClassName()) || MxVideoPresenter::IsA(name); + } + virtual void Destroy() override; virtual void VTable0x5c(undefined4 p_unknown1) override; virtual void VTable0x60() override; diff --git a/LEGO1/mxstillpresenter.h b/LEGO1/mxstillpresenter.h index f812b545..d2e89f59 100644 --- a/LEGO1/mxstillpresenter.h +++ b/LEGO1/mxstillpresenter.h @@ -8,6 +8,19 @@ // SIZE 0x6c class MxStillPresenter : public MxVideoPresenter { public: + // OFFSET: LEGO1 0x100435c0 + inline virtual const char* ClassName() const override // vtable+0xc + { + // 0x100f0184 + return "MxStillPresenter"; + } + + // OFFSET: LEGO1 0x100435d0 + inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + { + return !strcmp(name, MxStillPresenter::ClassName()) || MxVideoPresenter::IsA(name); + } + virtual void ParseExtra() override; // vtable+0x30 MxStillPresenter() { m_unk68 = 0; } diff --git a/LEGO1/mxstreamchunk.h b/LEGO1/mxstreamchunk.h index 5043b722..18c137e5 100644 --- a/LEGO1/mxstreamchunk.h +++ b/LEGO1/mxstreamchunk.h @@ -4,6 +4,19 @@ #include "mxdschunk.h" // VTABLE 0x100dc2a8 -class MxStreamChunk : public MxDSChunk {}; +class MxStreamChunk : public MxDSChunk { + // OFFSET: LEGO1 0x100b1fe0 + inline virtual const char* ClassName() const override // vtable+0xc + { + // 0x10101e5c + return "MxStreamChunk"; + } + + // OFFSET: LEGO1 0x100b1ff0 + inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + { + return !strcmp(name, MxStreamChunk::ClassName()) || MxDSChunk::IsA(name); + } +}; #endif // MXSTREAMCHUNK_H diff --git a/LEGO1/pizzeria.h b/LEGO1/pizzeria.h index b7e1a4e6..a06aa9e5 100644 --- a/LEGO1/pizzeria.h +++ b/LEGO1/pizzeria.h @@ -7,6 +7,18 @@ // SIZE 0x84 class Pizzeria : public IsleActor { public: + // OFFSET: LEGO1 0x1000e780 + inline virtual const char* ClassName() const override // vtable+0x0c + { + // 0x100f0380 + return "Pizzeria"; + } + + // OFFSET: LEGO1 0x1000e790 + inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + { + return !strcmp(name, Pizzeria::ClassName()) || IsleActor::IsA(name); + } }; #endif // PIZZERIASTATE_H diff --git a/LEGO1/pizzeriastate.h b/LEGO1/pizzeriastate.h index 0c7143bf..76cb1728 100644 --- a/LEGO1/pizzeriastate.h +++ b/LEGO1/pizzeriastate.h @@ -8,6 +8,19 @@ class PizzeriaState : public LegoState { public: PizzeriaState(); + + // OFFSET: LEGO1 0x10017c20 + inline virtual const char* ClassName() const override // vtable+0x0c + { + // 0x100f0370 + return "PizzeriaState"; + } + + // OFFSET: LEGO1 0x10017c30 + inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + { + return !strcmp(name, PizzeriaState::ClassName()) || LegoState::IsA(name); + } }; #endif // PIZZERIASTATE_H diff --git a/LEGO1/radio.h b/LEGO1/radio.h index b0f785c6..e2a4325c 100644 --- a/LEGO1/radio.h +++ b/LEGO1/radio.h @@ -7,6 +7,19 @@ class Radio : public MxCore { public: virtual ~Radio() override; + + // OFFSET: LEGO1 0x1002c8e0 + inline virtual const char* ClassName() const override // vtable+0x0c + { + // 0x100f328c + return "Radio"; + } + + // OFFSET: LEGO1 0x1002c8f0 + inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + { + return !strcmp(name, Radio::ClassName()) || MxCore::IsA(name); + } }; #endif // RADIO_H diff --git a/LEGO1/registrationbook.h b/LEGO1/registrationbook.h index 17009204..28dd7de3 100644 --- a/LEGO1/registrationbook.h +++ b/LEGO1/registrationbook.h @@ -11,6 +11,19 @@ class RegistrationBook : public LegoWorld { virtual ~RegistrationBook() override; // vtable+0x0 virtual MxLong Notify(MxParam& p) override; // vtable+0x4 + + // OFFSET: LEGO1 0x10076e10 + inline virtual const char* ClassName() const override // vtable+0x0c + { + // 0x100f04c8 + return "RegistrationBook"; + } + + // OFFSET: LEGO1 0x10076e20 + inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + { + return !strcmp(name, RegistrationBook::ClassName()) || LegoWorld::IsA(name); + } }; #endif // REGISTRATIONBOOK_H