mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-07 02:10:14 -04:00
Fix JGadget::TLinkList offsets on 64-bit
This commit is contained in:
@@ -17,6 +17,12 @@ namespace JASDsp {
|
||||
extern const u32 FILTER_MODE_IIR;
|
||||
};
|
||||
|
||||
#if !BIT_64
|
||||
const int JASTrackNodeOffset = 0x240;
|
||||
#else
|
||||
const int JASTrackNodeOffset = 0x310;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
@@ -48,7 +54,7 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
|
||||
/* 0x4c */ JASTrack* mTrack;
|
||||
};
|
||||
|
||||
struct TList : JGadget::TLinkList<JASTrack, -0x240> {
|
||||
struct TList : JGadget::TLinkList<JASTrack, JASTrackNodeOffset> {
|
||||
TList() : mCallbackRegistered(false) {}
|
||||
void append(JASTrack*);
|
||||
void seqMain();
|
||||
@@ -265,4 +271,8 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
|
||||
/* 0x240 */ JGadget::TLinkListNode field_0x240;
|
||||
};
|
||||
|
||||
#if TARGET_PC
|
||||
static_assert(offsetof(JASTrack, field_0x240) == JASTrackNodeOffset);
|
||||
#endif
|
||||
|
||||
#endif /* JASTRACK_H */
|
||||
|
||||
@@ -29,8 +29,12 @@ struct JOREventCallbackListNode {
|
||||
/* 0x04 */ JGadget::TLinkListNode m_node;
|
||||
/* 0x0C */ u32 field_0xc;
|
||||
/* 0x10 */ u32 field_0x10;
|
||||
|
||||
static const int NodeOffset;
|
||||
};
|
||||
|
||||
inline const int JOREventCallbackListNode::NodeOffset = -(int)offsetof(JOREventCallbackListNode, m_node);
|
||||
|
||||
class JORFile;
|
||||
class JORDir;
|
||||
class JORHostInfo_String;
|
||||
@@ -39,7 +43,7 @@ class JORHostInfo_CalendarTime;
|
||||
class JORServer : public JHITag<JHICmnMem> {
|
||||
public:
|
||||
typedef void (*EventFunc)(u32,char *);
|
||||
typedef JGadget::TLinkList<JOREventCallbackListNode, -4> CallbackLinkList;
|
||||
typedef JGadget::TLinkList<JOREventCallbackListNode, JOREventCallbackListNode::NodeOffset> CallbackLinkList;
|
||||
|
||||
enum ECommand {
|
||||
ECommand_GetRootObj = 1,
|
||||
|
||||
@@ -20,8 +20,12 @@ struct TObject : public object::TObject_ID {
|
||||
/* 0x08 vtable */
|
||||
/* 0x0C */ JGadget::TLinkListNode ocObject_;
|
||||
/* 0x14 */ const void* pData_;
|
||||
|
||||
static const int NodeOffset;
|
||||
};
|
||||
|
||||
inline const int TObject::NodeOffset = -(int)offsetof(TObject, ocObject_);
|
||||
|
||||
struct data {
|
||||
struct THeaderData {
|
||||
u32 signature;
|
||||
@@ -137,7 +141,7 @@ struct TControl {
|
||||
void setFactory(TFactory* factory) { pFactory_ = factory; }
|
||||
|
||||
/* 0x4 */ TFactory* pFactory_;
|
||||
/* 0x8 */ JGadget::TLinkList<TObject, -12> ocObject_;
|
||||
/* 0x8 */ JGadget::TLinkList<TObject, TObject::NodeOffset> ocObject_;
|
||||
};
|
||||
|
||||
struct TParse : public JGadget::binary::TParse_header_block {
|
||||
|
||||
@@ -41,11 +41,15 @@ public:
|
||||
|
||||
TFunctionValue* const referFunctionValue() { return pfv_; }
|
||||
|
||||
static const int NodeOffset;
|
||||
|
||||
protected:
|
||||
/* 0x0C */ JGadget::TLinkListNode mNode;
|
||||
/* 0x14 */ TFunctionValue* pfv_;
|
||||
};
|
||||
|
||||
inline const int TObject::NodeOffset = -(int)offsetof(TObject, mNode);
|
||||
|
||||
class TFactory {
|
||||
public:
|
||||
TFactory() {}
|
||||
@@ -72,7 +76,7 @@ public:
|
||||
|
||||
private:
|
||||
/* 0x4 */ TFactory* pFactory;
|
||||
/* 0x8 */ JGadget::TLinkList<TObject, -12> ocObject_;
|
||||
/* 0x8 */ JGadget::TLinkList<TObject, TObject::NodeOffset> ocObject_;
|
||||
}; // Size: 0x14
|
||||
|
||||
class TObject_composite : public TObject {
|
||||
|
||||
@@ -25,8 +25,12 @@ struct TCreateObject {
|
||||
}
|
||||
|
||||
/* 0x4 */ JGadget::TLinkListNode mNode;
|
||||
|
||||
static const int NodeOffset;
|
||||
}; // Size: 0xC
|
||||
|
||||
inline const int TCreateObject::NodeOffset = -(int)offsetof(TCreateObject, mNode);
|
||||
|
||||
struct TFactory : public stb::TFactory {
|
||||
TFactory() {}
|
||||
|
||||
@@ -35,7 +39,7 @@ struct TFactory : public stb::TFactory {
|
||||
|
||||
void appendCreateObject(JStudio::TCreateObject*);
|
||||
|
||||
/* 0x04 */ JGadget::TLinkList<TCreateObject, -4> mList;
|
||||
/* 0x04 */ JGadget::TLinkList<TCreateObject, TCreateObject::NodeOffset> mList;
|
||||
/* 0x10 */ fvb::TFactory fvb_Factory;
|
||||
/* 0x14 */ ctb::TFactory ctb_Factory;
|
||||
};
|
||||
|
||||
@@ -118,8 +118,12 @@ public: // private: // public for the fakematch in JStudio_JStage::TAdaptor_acto
|
||||
/* 0x28 */ const void* pSequence_next;
|
||||
/* 0x2C */ u32 u32Wait_;
|
||||
/* 0x30 */ TEStatus mStatus;
|
||||
|
||||
static const int NodeOffset;
|
||||
};
|
||||
|
||||
inline const int TObject::NodeOffset = -(int)offsetof(TObject, ocObject_);
|
||||
|
||||
class TFactory {
|
||||
public:
|
||||
TFactory() {}
|
||||
@@ -163,7 +167,7 @@ private:
|
||||
/* 0x04 */ u32 _4;
|
||||
/* 0x08 */ u32 _8;
|
||||
/* 0x0C */ TFactory* pFactory;
|
||||
/* 0x10 */ JGadget::TLinkList<TObject, -12> ocObject_;
|
||||
/* 0x10 */ JGadget::TLinkList<TObject, TObject::NodeOffset> ocObject_;
|
||||
/* 0x1C */ u32 mStatus;
|
||||
/* 0x20 */ TObject_control mObject_control;
|
||||
/* 0x54 */ s32 _54;
|
||||
|
||||
Reference in New Issue
Block a user