From 810801f7152109d0d14d59d573529aa661986cd6 Mon Sep 17 00:00:00 2001 From: Dean Southwood Date: Sun, 15 Sep 2024 18:39:50 +1000 Subject: [PATCH] more Kando diffable (+ 5 small files linked) --- configure.py | 10 +- include/AIConstant.h | 91 ++ include/Animator.h | 6 +- include/Dolphin/hio.h | 34 + include/FormationMgr.h | 136 +++ include/KIO.h | 45 + include/KeyConfig.h | 45 + include/Msg.h | 29 +- include/Receiver.h | 62 +- include/SimpleAI.h | 113 ++- include/Traversable.h | 8 +- include/system.h | 2 +- src/hio/hio.c | 823 +++++------------- src/plugPikiKando/aiConstants.cpp | 353 +------- src/plugPikiKando/formationMgr.cpp | 72 +- src/plugPikiKando/keyConfig.cpp | 263 +----- src/plugPikiKando/kio.cpp | 388 ++------- src/plugPikiKando/saiEvents.cpp | 455 +--------- unsorted_include_todo/AIConstant.h | 47 - unsorted_include_todo/CircleArranger.h | 24 - unsorted_include_todo/FormationMgr.h | 24 - unsorted_include_todo/KIO.h | 15 - unsorted_include_todo/KIOContext.h | 12 - unsorted_include_todo/KeyConfig.h | 47 - unsorted_include_todo/KeyConfig/Key.h | 46 - unsorted_include_todo/LineArranger.h | 24 - unsorted_include_todo/PyramidArranger.h | 20 - unsorted_include_todo/SAIBounceEvent.h | 44 - unsorted_include_todo/SAICollideEvent.h | 44 - unsorted_include_todo/SAIGroundEvent.h | 43 - unsorted_include_todo/SAIMotionAction0Event.h | 44 - unsorted_include_todo/SAIMotionDoneEvent.h | 44 - unsorted_include_todo/SAIMotionLoopEndEvent.h | 44 - .../SAIMotionLoopStartEvent.h | 44 - unsorted_include_todo/SAIUserEvent.h | 44 - unsorted_include_todo/WingArranger.h | 24 - 36 files changed, 923 insertions(+), 2646 deletions(-) create mode 100644 include/AIConstant.h create mode 100644 include/Dolphin/hio.h create mode 100644 include/FormationMgr.h create mode 100644 include/KIO.h create mode 100644 include/KeyConfig.h delete mode 100644 unsorted_include_todo/AIConstant.h delete mode 100644 unsorted_include_todo/CircleArranger.h delete mode 100644 unsorted_include_todo/FormationMgr.h delete mode 100644 unsorted_include_todo/KIO.h delete mode 100644 unsorted_include_todo/KIOContext.h delete mode 100644 unsorted_include_todo/KeyConfig.h delete mode 100644 unsorted_include_todo/KeyConfig/Key.h delete mode 100644 unsorted_include_todo/LineArranger.h delete mode 100644 unsorted_include_todo/PyramidArranger.h delete mode 100644 unsorted_include_todo/SAIBounceEvent.h delete mode 100644 unsorted_include_todo/SAICollideEvent.h delete mode 100644 unsorted_include_todo/SAIGroundEvent.h delete mode 100644 unsorted_include_todo/SAIMotionAction0Event.h delete mode 100644 unsorted_include_todo/SAIMotionDoneEvent.h delete mode 100644 unsorted_include_todo/SAIMotionLoopEndEvent.h delete mode 100644 unsorted_include_todo/SAIMotionLoopStartEvent.h delete mode 100644 unsorted_include_todo/SAIUserEvent.h delete mode 100644 unsorted_include_todo/WingArranger.h diff --git a/configure.py b/configure.py index 0fb4e1de..07701390 100755 --- a/configure.py +++ b/configure.py @@ -408,7 +408,7 @@ def DolphinLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]: Object(NonMatching, "plugPikiKando/interactGrab.cpp"), Object(NonMatching, "plugPikiKando/interactEtc.cpp"), Object(NonMatching, "plugPikiKando/interactPullout.cpp"), - Object(NonMatching, "plugPikiKando/saiEvents.cpp"), + Object(Matching, "plugPikiKando/saiEvents.cpp"), Object(NonMatching, "plugPikiKando/simpleAI.cpp"), Object(NonMatching, "plugPikiKando/formationMgr.cpp"), Object(Matching, "plugPikiKando/globalShapes.cpp"), @@ -417,9 +417,9 @@ def DolphinLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]: Object(NonMatching, "plugPikiKando/demoInvoker.cpp"), Object(NonMatching, "plugPikiKando/demoEvent.cpp"), Object(NonMatching, "plugPikiKando/resultFlag.cpp"), - Object(NonMatching, "plugPikiKando/aiConstants.cpp"), - Object(NonMatching, "plugPikiKando/kio.cpp"), - Object(NonMatching, "plugPikiKando/keyConfig.cpp"), + Object(Matching, "plugPikiKando/aiConstants.cpp"), + Object(Matching, "plugPikiKando/kio.cpp"), + Object(Matching, "plugPikiKando/keyConfig.cpp"), Object(NonMatching, "plugPikiKando/aiPerf.cpp"), Object(NonMatching, "plugPikiKando/courseDebug.cpp"), Object(NonMatching, "plugPikiKando/memStat.cpp"), @@ -881,7 +881,7 @@ def DolphinLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]: DolphinLib( "hio", [ - Object(NonMatching, "hio/hio.c"), + Object(Matching, "hio/hio.c"), ] ), DolphinLib( diff --git a/include/AIConstant.h b/include/AIConstant.h new file mode 100644 index 00000000..ff1ea7c3 --- /dev/null +++ b/include/AIConstant.h @@ -0,0 +1,91 @@ +#ifndef _AICONSTANT_H +#define _AICONSTANT_H + +#include "types.h" +#include "Node.h" +#include "Parameters.h" +#include "Ayu.h" + +/** + * @brief TODO + * + * @note Size: 0x194. + */ +struct AIConstant : public Node { + + /** + * @brief TODO + * + * @note Offset comments are relative to AIConstant for ease of use. + */ + struct Constants : public Parameters { + inline Constants() + : _24(this, 550.0f, 0.0f, 0.0f, "p00", nullptr) + , _34(this, 1, 0, 0, "p01", nullptr) + , _44(this, 1, 0, 0, "p02", nullptr) + , _54(this, 0, 0, 0, "p03", nullptr) + , _64(this, 1, 0, 0, "p04", nullptr) + , _74(this, 1, 0, 0, "p05", nullptr) + , _84(this, 1, 0, 0, "p07", nullptr) + , _94(this, 1, 0, 0, "p06", nullptr) + , _A4(this, 1, 0, 0, "p08", nullptr) + , _B4(this, 1, 0, 0, "p09", nullptr) + , _C4(this, 1, 0, 0, "p10", nullptr) + , _D4(this, 90.0f, 0.0f, 0.0f, "p11", nullptr) + , _E4(this, 1, 0, 0, "p12", nullptr) + , _F4(this, 1, 0, 0, "p13", nullptr) + , _104(this, 1, 0, 0, "p14", nullptr) + , _114(this, 100, 0, 0, "p15", nullptr) + , _124(this, 1, 0, 0, "p16", nullptr) + , _134(this, 1.0f, 0.0f, 0.0f, "p17", nullptr) + , _144(this, 2.5f, 0.0f, 0.0f, "p18", nullptr) + , _154(this, 6, 0, 0, "p19", nullptr) + , _164(this, 12, 0, 0, "p20", nullptr) + , _174(this, 29, 0, 0, "p21", nullptr) + , _184(this, 30, 0, 0, "p22", nullptr) + { + } + + // _20-_24 = Parameters + Parm _24; // _24, p00 + Parm _34; // _34, p01 + Parm _44; // _44, p02 + Parm _54; // _54, p03 + Parm _64; // _64, p04 + Parm _74; // _74, p05 + Parm _84; // _84, p07 + Parm _94; // _94, p06 + Parm _A4; // _A4, p08 + Parm _B4; // _B4, p09 + Parm _C4; // _C4, p10 + Parm _D4; // _D4, p11 + Parm _E4; // _E4, p12 + Parm _F4; // _F4, p13 + Parm _104; // _104, p14 + Parm _114; // _114, p15 + Parm _124; // _124, p16 + Parm _134; // _134, p17 + Parm _144; // _144, p18 + Parm _154; // _154, p19 + Parm _164; // _164, p20 + Parm _174; // _174, p21 + Parm _184; // _174, p22 + }; + + AIConstant(); + + virtual void read(RandomAccessStream& input) // _0C (weak) + { + mConstants.read(input); + } + + static void createInstance(); + + static AIConstant* _instance; + + // _00 = VTBL + // _00-_20 = Node + Constants mConstants; // _20 +}; + +#endif diff --git a/include/Animator.h b/include/Animator.h index 733fa246..50d62215 100644 --- a/include/Animator.h +++ b/include/Animator.h @@ -39,9 +39,9 @@ struct DataChunk { } } - int mDataIndex; - int mDataSize; // _04 - f32* mData; // _08 + int mDataIndex; // _00 + int mDataSize; // _04 + f32* mData; // _08 }; /** diff --git a/include/Dolphin/hio.h b/include/Dolphin/hio.h new file mode 100644 index 00000000..58a235aa --- /dev/null +++ b/include/Dolphin/hio.h @@ -0,0 +1,34 @@ +#ifndef _DOLPHIN_HIO_H +#define _DOLPHIN_HIO_H + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif // ifdef __cplusplus + +//////////////// HIO TYPES ///////////////// +// Callback function types. +typedef void (*HIOCallback)(void); +typedef BOOL (*HIOEnumCallback)(s32 chan); + +//////////////////////////////////////////// + +////////////// HIO FUNCTIONS /////////////// +BOOL HIOEnumDevices(HIOEnumCallback callback); +BOOL HIOInit(s32 chan, HIOCallback callback); +BOOL HIOReadMailbox(u32* word); +BOOL HIOWriteMailbox(u32 word); +BOOL HIORead(u32 addr, void* buffer, s32 size); +BOOL HIOWrite(u32 addr, void* buffer, s32 size); +BOOL HIOReadAsync(u32 addr, void* buffer, s32 size, HIOCallback callback); +BOOL HIOWriteAsync(u32 addr, void* buffer, s32 size, HIOCallback callback); +BOOL HIOReadStatus(u32* status); + +//////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif // ifdef __cplusplus + +#endif diff --git a/include/FormationMgr.h b/include/FormationMgr.h new file mode 100644 index 00000000..62a15579 --- /dev/null +++ b/include/FormationMgr.h @@ -0,0 +1,136 @@ +#ifndef _FORMATIONMGR_H +#define _FORMATIONMGR_H + +#include "types.h" +#include "Traversable.h" +#include "Vector.h" + +struct Graphics; +struct FormArranger; + +/** + * @brief Stripped struct. + */ +struct Rope { + Rope(); // unused/inlined + + // unused/inlined: + void move(Vector3f&, Vector3f&, Vector3f&); + void refresh(Graphics&); +}; + +/** + * @brief Stripped struct. + */ +struct Spine { + Spine(); // unused/inlined + + // unused/inlined: + void init(Creature*); + void preMove(); + void postMove(); + void move(); + void refresh(Graphics&); +}; + +/** + * @brief TODO + */ +struct FormPoint { + FormPoint(); // unused/inlined + + void getPos(); + + // TODO: members +}; + +/** + * @brief TODO + */ +struct FormationMgr : public Traversable { + FormationMgr(); // unused/inlined + + virtual Creature* getCreature(int); // _08 + virtual int getFirst(); // _0C + virtual int getNext(int); // _10 + virtual bool isDone(int); // _14 + + void getLastCentre(); + void getFormPoint(Creature*); + void slide(Creature*, int); + void exit(Creature*); + + // unused/inlined: + void add(Vector3f&, Vector3f&); + void getIndex(Creature*); + void getFptIndex(FormPoint*); + void clear(); + void rearrange(); + void setOffset(Vector3f&); + void setAngOffset(f32); + + // _00 = VTBL + // _00-_08 = Traversable + u8 _08[0x4]; // _08, unknown + f32 _0C; // _0C + Vector3f _10; // _10 + u8 _1C[0x4]; // _1C, unknown + Creature** _20; // _20, maybe Piki**? + u8 _24[0x8]; // _24, unknown + int _2C; // _2C + u8 _30[0xC]; // _30, unknown + FormArranger* mArranger; // _3C +}; + +/** + * @brief TODO + */ +struct FormArranger { + virtual void arrange(FormationMgr*) = 0; // _08 + virtual f32 getLength(FormationMgr*) { return 0.0f; } // _0C + + // TODO: members +}; + +/** + * @brief TODO + */ +struct CircleArranger : public FormArranger { + virtual void arrange(FormationMgr*); // _08 + + // _00-_?? = FormArranger + // TODO: members +}; + +/** + * @brief TODO + */ +struct PyramidArranger : public FormArranger { + virtual void arrange(FormationMgr*); // _08 + virtual f32 getLength(FormationMgr*); // _0C + + // _00-_?? = FormArranger + // TODO: members +}; + +/** + * @brief TODO + */ +struct LineArranger : public FormArranger { + virtual void arrange(FormationMgr*); // _08 + + // _00-_?? = FormArranger + // TODO: members +}; + +/** + * @brief TODO + */ +struct WingArranger : public FormArranger { + virtual void arrange(FormationMgr*); // _08 + + // _00-_?? = FormArranger + // TODO: members +}; + +#endif diff --git a/include/KIO.h b/include/KIO.h new file mode 100644 index 00000000..a570ba8a --- /dev/null +++ b/include/KIO.h @@ -0,0 +1,45 @@ +#ifndef _KIO_H +#define _KIO_H + +#include "types.h" + +/* + * @brief TODO + */ +struct KIOContext { + void set(int, u8*, int); + void write(); + + int _00; // _00 + void* _04; // _04 +}; + +/** + * @brief TODO + */ +struct KIO { + KIO(); + + void initialise(); + void readMailbox(); + void startWrite(int, u8*, int); + void writeHeader(); + + // unused/inlined: + void copyEfb(u8*, u16, u16); + + static bool fbCopy; + static char* haltMessage; + static int kontMode; + + // TODO: members + s32 mChannel; // _00 + KIOContext mContext; // _04 + void* _0C; // _0C, maybe an array of something? + u8 _10; // _10 + u8 _11; // _11 +}; + +extern KIO* kio; + +#endif diff --git a/include/KeyConfig.h b/include/KeyConfig.h new file mode 100644 index 00000000..8be0a0c4 --- /dev/null +++ b/include/KeyConfig.h @@ -0,0 +1,45 @@ +#ifndef _KEYCONFIG_H +#define _KEYCONFIG_H + +#include "types.h" +#include "Node.h" + +/** + * @brief TODO + * + * @note Size: 0xF8. + */ +struct KeyConfig : public Node { + + /** + * @brief TODO + * + * @note Size: 0x24. + */ + struct Key : public Node { + virtual void read(RandomAccessStream&); // _0C + + // _00 = VTBL + // _00-_20 = Node + int _20; // _20, unknown + }; + + KeyConfig(); + + virtual void read(RandomAccessStream& input); // _0C (weak) + + static void createInstance(); + + static KeyConfig* _instance; + + // _00 = VTBL + // _00-_20 = Node + Key _20; // _20, 'throw' + Key _44; // _44, 'set cursor' + Key _68; // _68, 'extract' + Key _8C; // _8C, 'attack' + Key _B0; // _B0, 'menu' + Key _D4; // _C4, 'disband' +}; + +#endif diff --git a/include/Msg.h b/include/Msg.h index e147c2d5..1b68c50f 100644 --- a/include/Msg.h +++ b/include/Msg.h @@ -7,72 +7,79 @@ * @brief TODO */ struct Msg { + u32 _00; // _00, maybe msg type? }; /** * @brief TODO + * + * @note will need to fix saiEvents.cpp when this gets worked out */ -struct MsgAnim { +struct MsgAnim : public Msg { + // _00-_04 = Msg + u32* _04; // _04, probably a pointer to a struct with a u32 or int at _00 }; /** * @brief TODO */ -struct MsgBounce { +struct MsgBounce : public Msg { }; /** * @brief TODO */ -struct MsgCollide { +struct MsgCollide : public Msg { }; /** * @brief TODO */ -struct MsgDamage { +struct MsgDamage : public Msg { }; /** * @brief TODO */ -struct MsgGround { +struct MsgGround : public Msg { }; /** * @brief TODO */ -struct MsgHang { +struct MsgHang : public Msg { }; /** * @brief TODO */ -struct MsgOffWall { +struct MsgOffWall : public Msg { }; /** * @brief TODO */ -struct MsgStick { +struct MsgStick : public Msg { }; /** * @brief TODO */ -struct MsgTarget { +struct MsgTarget : public Msg { }; /** * @brief TODO */ -struct MsgUser { +struct MsgUser : public Msg { + // _00-_04 = Msg + u32 _04; // _04, could be int }; /** * @brief TODO */ -struct MsgWall { +struct MsgWall : public Msg { }; #endif diff --git a/include/Receiver.h b/include/Receiver.h index 8e31e3f6..f4156382 100644 --- a/include/Receiver.h +++ b/include/Receiver.h @@ -10,21 +10,57 @@ template struct Receiver { - virtual void procMsg(T*, Msg*); // _08 (weak) - virtual void procBounceMsg(T*, MsgBounce*); // _0C (weak) - virtual void procStickMsg(T*, MsgStick*); // _10 (weak) - virtual void procHangMsg(T*, MsgHang*); // _14 (weak) - virtual void procTargetMsg(T*, MsgTarget*); // _18 (weak) - virtual void procCollideMsg(T*, MsgCollide*); // _1C (weak) - virtual void procAnimMsg(T*, MsgAnim*); // _20 (weak) - virtual void procDamageMsg(T*, MsgDamage*); // _24 (weak) - virtual void procWallMsg(T*, MsgWall*); // _28 (weak) - virtual void procOffWallMsg(T*, MsgOffWall*); // _2C (weak) - virtual void procUserMsg(T*, MsgUser*); // _30 (weak) - virtual void procGroundMsg(T*, MsgGround*); // _34 (weak) + virtual void procMsg(T* target, Msg* msg) // _08 (weak) + { + switch (msg->_00) { + case 0: + procBounceMsg(target, static_cast(msg)); + break; + case 8: + procStickMsg(target, static_cast(msg)); + break; + case 1: + procHangMsg(target, static_cast(msg)); + break; + case 2: + procTargetMsg(target, static_cast(msg)); + break; + case 3: + procCollideMsg(target, static_cast(msg)); + break; + case 4: + procAnimMsg(target, static_cast(msg)); + break; + case 5: + procDamageMsg(target, static_cast(msg)); + break; + case 6: + procWallMsg(target, static_cast(msg)); + break; + case 7: + procOffWallMsg(target, static_cast(msg)); + break; + case 10: + procUserMsg(target, static_cast(msg)); + break; + case 9: + procGroundMsg(target, static_cast(msg)); + break; + } + } + virtual void procBounceMsg(T*, MsgBounce*) { } // _0C (weak) + virtual void procStickMsg(T*, MsgStick*) { } // _10 (weak) + virtual void procHangMsg(T*, MsgHang*) { } // _14 (weak) + virtual void procTargetMsg(T*, MsgTarget*) { } // _18 (weak) + virtual void procCollideMsg(T*, MsgCollide*) { } // _1C (weak) + virtual void procAnimMsg(T*, MsgAnim*) { } // _20 (weak) + virtual void procDamageMsg(T*, MsgDamage*) { } // _24 (weak) + virtual void procWallMsg(T*, MsgWall*) { } // _28 (weak) + virtual void procOffWallMsg(T*, MsgOffWall*) { } // _2C (weak) + virtual void procUserMsg(T*, MsgUser*) { } // _30 (weak) + virtual void procGroundMsg(T*, MsgGround*) { } // _34 (weak) // _00 = VTBL - // TODO: members }; #endif diff --git a/include/SimpleAI.h b/include/SimpleAI.h index cd185dca..f5f41d95 100644 --- a/include/SimpleAI.h +++ b/include/SimpleAI.h @@ -47,12 +47,112 @@ struct SAICondition : public CoreNode { /** * @brief TODO + * + * @note Size: 0x8. */ struct SAIEvent : public Receiver { - // _00 = VTBL? + SAIEvent() + : mEventID(-1) + { + } + + // _00 = VTBL + int mEventID; // _04 +}; + +/** + * @brief TODO + * + * @note Size: 0x8. + */ +struct SAIBounceEvent : public SAIEvent { + virtual void procBounceMsg(AICreature*, MsgBounce*); // _0C + + // _00 = VTBL + // _00-_08 = SAIEvent +}; + +/** + * @brief TODO + * + * @note Size: 0x8. + */ +struct SAICollideEvent : public SAIEvent { + virtual void procCollideMsg(AICreature*, MsgCollide*); // _1C + + // _00 = VTBL + // _00-_08 = SAIEvent +}; + +/** + * @brief TODO + * + * @note Size: 0x8. + */ +struct SAIGroundEvent : public SAIEvent { + virtual void procGroundMsg(AICreature*, MsgGround*); // _34 + + // _00 = VTBL + // _00-_08 = SAIEvent +}; + +/** + * @brief TODO + * + * @note Size: 0x8. + */ +struct SAIMotionAction0Event : public SAIEvent { + virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 + + // _00 = VTBL + // _00-_08 = SAIEvent +}; + +/** + * @brief TODO + * + * @note Size: 0x8. + */ +struct SAIMotionDoneEvent : public SAIEvent { + virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 + + // _00 = VTBL + // _00-_08 = SAIEvent +}; + +/** + * @brief TODO + */ +struct SAIMotionLoopStartEvent : public SAIEvent { + virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 + + // _00 = VTBL + // _00-_08 = SAIEvent // TODO: members }; +/** + * @brief TODO + */ +struct SAIMotionLoopEndEvent : public SAIEvent { + virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 + + // _00 = VTBL + // _00-_08 = SAIEvent + // TODO: members +}; + +/** + * @brief TODO + */ +struct SAIUserEvent : public SAIEvent { + virtual void procUserMsg(AICreature*, MsgUser*); // _30 + + // _00 = VTBL + // _00-_08 = SAIEvent + u32 _08; // _08, maybe user id? +}; + /** * @brief TODO */ @@ -93,4 +193,15 @@ struct SimpleAI : public StateMachine { // TODO: members }; +// Global functions and objects +void SAIEventInit(); + +extern SAIMotionDoneEvent* saiMotionDoneEvent; +extern SAIBounceEvent* saiBounceEvent; +extern SAIMotionLoopStartEvent* saiMotionLoopStartEvent; +extern SAIMotionLoopEndEvent* saiMotionLoopEndEvent; +extern SAICollideEvent* saiCollideEvent; +extern SAIGroundEvent* saiGroundEvent; +extern SAIMotionAction0Event* saiMotionAction0Event; + #endif diff --git a/include/Traversable.h b/include/Traversable.h index d039fab7..4f7fb834 100644 --- a/include/Traversable.h +++ b/include/Traversable.h @@ -14,10 +14,10 @@ struct Traversable { { } - virtual Creature* getCreature(int); // _08 - virtual int getFirst(); // _0C - virtual int getNext(int); // _10 - virtual bool isDone(int); // _14 + virtual Creature* getCreature(int) = 0; // _08 + virtual int getFirst() = 0; // _0C + virtual int getNext(int) = 0; // _10 + virtual bool isDone(int) = 0; // _14 // _00 = VTBL u32 _04; // _04, unknown diff --git a/include/system.h b/include/system.h index b7042cd0..d38cd942 100644 --- a/include/system.h +++ b/include/system.h @@ -202,7 +202,7 @@ struct System : public StdSystem { inline AtxRouter* getAtxRouter() { return mAtxRouter; } inline void setAtxRouter(AtxRouter* router) { mAtxRouter = router; } - inline f32 getFrameTime() { return mDeltaTime; } + f32 getFrameTime() { return mDeltaTime; } // _00 = VTBL // _00-_248 = StdSystem diff --git a/src/hio/hio.c b/src/hio/hio.c index 49d61229..48ae3766 100644 --- a/src/hio/hio.c +++ b/src/hio/hio.c @@ -1,44 +1,29 @@ -#include "types.h" +#include "Dolphin/hio.h" +#include "Dolphin/os.h" +#include "Dolphin/hw_regs.h" + +static s32 Chan = -1; +static HIOCallback ExiCallback; +static HIOCallback TxCallback; +static HIOCallback RxCallback; /* * --INFO-- * Address: 8020D388 * Size: 00000C */ -void ExtHandler(void) -{ - /* - .loc_0x0: - li r0, -0x1 - stw r0, 0x2A60(r13) - blr - */ -} +static void ExtHandler(s32 chan, OSContext* context) { Chan = -1; } /* * --INFO-- * Address: 8020D394 * Size: 000030 */ -void ExiHandler(void) +static void ExiHandler(s32 chan, OSContext* context) { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x8(r1) - lwz r12, 0x3410(r13) - cmplwi r12, 0 - beq- .loc_0x20 - mtlr r12 - blrl - - .loc_0x20: - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ + if (ExiCallback) { + ExiCallback(); + } } /* @@ -46,28 +31,12 @@ void ExiHandler(void) * Address: 8020D3C4 * Size: 00003C */ -void DbgHandler(void) +static void DbgHandler(__OSInterrupt interrupt, OSContext* context) { - /* - .loc_0x0: - mflr r0 - lis r3, 0xCC00 - stw r0, 0x4(r1) - li r0, 0x1000 - stwu r1, -0x8(r1) - lwz r12, 0x3410(r13) - stw r0, 0x3000(r3) - cmplwi r12, 0 - beq- .loc_0x2C - mtlr r12 - blrl - - .loc_0x2C: - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ + __PIRegs[PI_INTRPT_SRC] = 0x1000; + if (ExiCallback) { + ExiCallback(); + } } /* @@ -75,7 +44,7 @@ void DbgHandler(void) * Address: ........ * Size: 000040 */ -void TxHandler(void) +static void TxHandler(s32 chan, OSContext* context) { // UNUSED FUNCTION } @@ -85,7 +54,7 @@ void TxHandler(void) * Address: ........ * Size: 000040 */ -void RxHandler(void) +static void RxHandler(s32 chan, OSContext* context) { // UNUSED FUNCTION } @@ -95,144 +64,54 @@ void RxHandler(void) * Address: 8020D400 * Size: 0001C4 */ -void HIOEnumDevices(void) +BOOL HIOEnumDevices(HIOEnumCallback callback) { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x30(r1) - stmw r27, 0x1C(r1) - addi r30, r3, 0 - lwz r0, 0x2A60(r13) - cmpwi r0, -0x1 - bne- .loc_0x1AC - cmplwi r30, 0 - beq- .loc_0x1AC - lis r3, 0x8021 - subi r28, r3, 0x2C78 - li r27, 0x1 - li r31, 0 - - .loc_0x38: - cmpwi r31, 0x2 - bge- .loc_0x64 - - .loc_0x40: - mr r3, r31 - bl -0x14F68 - cmpwi r3, 0 - beq+ .loc_0x40 - addi r3, r31, 0 - addi r4, r28, 0 - bl -0x14F1C - cmpwi r3, 0 - beq- .loc_0x198 - - .loc_0x64: - addi r3, r31, 0 - li r4, 0 - li r5, 0 - bl -0x14734 - cmpwi r3, 0 - bne- .loc_0x88 - mr r3, r31 - bl -0x14E60 - b .loc_0x198 - - .loc_0x88: - addi r3, r31, 0 - li r4, 0 - li r5, 0 - bl -0x14DB8 - cmpwi r3, 0 - bne- .loc_0xB4 - mr r3, r31 - bl -0x14674 - mr r3, r31 - bl -0x14E8C - b .loc_0x198 - - .loc_0xB4: - li r0, 0 - stw r0, 0x10(r1) - addi r3, r31, 0 - addi r4, r1, 0x10 - li r5, 0x2 - li r6, 0x1 - li r7, 0 - bl -0x15810 - cntlzw r0, r3 - addi r3, r31, 0 - rlwinm r29,r0,27,5,31 - bl -0x15438 - cntlzw r0, r3 - rlwinm r0,r0,27,5,31 - addi r3, r31, 0 - or r29, r29, r0 - addi r4, r1, 0xC - li r5, 0x4 - li r6, 0 - li r7, 0 - bl -0x15844 - cntlzw r0, r3 - rlwinm r0,r0,27,5,31 - addi r3, r31, 0 - or r29, r29, r0 - bl -0x15470 - cntlzw r0, r3 - rlwinm r0,r0,27,5,31 - addi r3, r31, 0 - or r29, r29, r0 - bl -0x14D24 - cntlzw r0, r3 - rlwinm r0,r0,27,5,31 - addi r3, r31, 0 - or r29, r29, r0 - bl -0x14710 - cmpwi r29, 0 - bne- .loc_0x170 - lwz r3, 0xC(r1) - subis r0, r3, 0x101 - cmplwi r0, 0 - bne- .loc_0x170 - addi r12, r30, 0 - mtlr r12 - addi r3, r31, 0 - blrl - mr r27, r3 - - .loc_0x170: - cmpwi r31, 0x2 - bge- .loc_0x180 - mr r3, r31 - bl -0x14F5C - - .loc_0x180: - mr r3, r31 - bl -0x14754 - cmpwi r27, 0 - bne- .loc_0x198 - li r3, 0x1 - b .loc_0x1B0 - - .loc_0x198: - addi r31, r31, 0x1 - cmpwi r31, 0x2 - ble+ .loc_0x38 - li r3, 0x1 - b .loc_0x1B0 - - .loc_0x1AC: - li r3, 0 - - .loc_0x1B0: - lmw r27, 0x1C(r1) - lwz r0, 0x34(r1) - addi r1, r1, 0x30 - mtlr r0 - blr - */ + BOOL result; + s32 chan; + int err; + u32 cmd; + u32 id; + + if (Chan == -1 && callback) { + result = TRUE; + for (chan = 0; chan <= 2; chan++) { + if (chan < 2) { + while (EXIProbeEx(chan) == 0) { } + if (EXIAttach(chan, ExtHandler) == 0) { + continue; + } + } + if (EXILock(chan, 0, nullptr) == 0) { + EXIDetach(chan); + continue; + } + if (EXISelect(chan, 0, 0) == 0) { + EXIUnlock(chan); + EXIDetach(chan); + continue; + } + cmd = 0; + err = 0; + err |= !EXIImm(chan, &cmd, 2, 1, nullptr); + err |= !EXISync(chan); + err |= !EXIImm(chan, &id, 4, 0, nullptr); + err |= !EXISync(chan); + err |= !EXIDeselect(chan); + EXIUnlock(chan); + if (err == 0 && id == 0x1010000) { + result = callback(chan); + } + if (chan < 2) { + EXIDetach(chan); + } + EXIUnlock(chan); + if (result == FALSE) { + return TRUE; + } + } + return TRUE; + } + return FALSE; } /* @@ -240,176 +119,69 @@ void HIOEnumDevices(void) * Address: 8020D5C4 * Size: 000234 */ -void HIOInit(void) +BOOL HIOInit(s32 chan, HIOCallback callback) { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x20(r1) - stw r31, 0x1C(r1) - addi r31, r3, 0 - stw r30, 0x18(r1) - addi r30, r4, 0 - bl -0x17534 - cmplwi r3, 0xFF - bne- .loc_0x38 - li r0, -0x1 - stw r0, 0x2A60(r13) - li r3, 0 - b .loc_0x21C - - .loc_0x38: - lwz r0, 0x2A60(r13) - cmpwi r0, -0x1 - beq- .loc_0x4C - li r3, 0x1 - b .loc_0x21C - - .loc_0x4C: - li r0, 0 - stw r31, 0x2A60(r13) - cmpwi r31, 0x2 - stw r30, 0x3410(r13) - stw r0, 0x3414(r13) - stw r0, 0x3418(r13) - bge- .loc_0xA0 - - .loc_0x68: - lwz r3, 0x2A60(r13) - bl -0x15154 - cmpwi r3, 0 - beq+ .loc_0x68 - lis r4, 0x8021 - lwz r3, 0x2A60(r13) - subi r4, r4, 0x2C78 - bl -0x1510C - cmpwi r3, 0 - bne- .loc_0xA0 - li r0, -0x1 - stw r0, 0x2A60(r13) - li r3, 0 - b .loc_0x21C - - .loc_0xA0: - lwz r3, 0x2A60(r13) - li r4, 0 - li r5, 0 - bl -0x14934 - cmpwi r3, 0 - bne- .loc_0xD0 - lwz r3, 0x2A60(r13) - bl -0x15060 - li r0, -0x1 - stw r0, 0x2A60(r13) - li r3, 0 - b .loc_0x21C - - .loc_0xD0: - lwz r3, 0x2A60(r13) - li r4, 0 - li r5, 0 - bl -0x14FC4 - cmpwi r3, 0 - bne- .loc_0x108 - lwz r3, 0x2A60(r13) - bl -0x14880 - lwz r3, 0x2A60(r13) - bl -0x15098 - li r0, -0x1 - stw r0, 0x2A60(r13) - li r3, 0 - b .loc_0x21C - - .loc_0x108: - li r0, 0 - lwz r3, 0x2A60(r13) - stw r0, 0x14(r1) - addi r4, r1, 0x14 - li r5, 0x2 - li r6, 0x1 - li r7, 0 - bl -0x15A28 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r30,r0,27,5,31 - bl -0x15650 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - or r30, r30, r0 - addi r4, r1, 0x10 - li r5, 0x4 - li r6, 0 - li r7, 0 - bl -0x15A5C - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - or r30, r30, r0 - bl -0x15688 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - or r30, r30, r0 - bl -0x14F3C - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - or r30, r30, r0 - bl -0x14928 - cmpwi r30, 0 - bne- .loc_0x1B0 - lwz r3, 0x10(r1) - subis r0, r3, 0x101 - cmplwi r0, 0 - beq- .loc_0x1D8 - - .loc_0x1B0: - cmpwi r31, 0x2 - bge- .loc_0x1C0 - lwz r3, 0x2A60(r13) - bl -0x15160 - - .loc_0x1C0: - lwz r3, 0x2A60(r13) - bl -0x14958 - li r0, -0x1 - stw r0, 0x2A60(r13) - li r3, 0 - b .loc_0x21C - - .loc_0x1D8: - lwz r0, 0x3410(r13) - cmplwi r0, 0 - beq- .loc_0x218 - cmpwi r31, 0x2 - bge- .loc_0x200 - lis r4, 0x8021 - lwz r3, 0x2A60(r13) - subi r4, r4, 0x2C6C - bl -0x154C4 - b .loc_0x218 - - .loc_0x200: - lis r3, 0x8021 - subi r4, r3, 0x2C3C - li r3, 0x19 - bl -0x14808 - li r3, 0x40 - bl -0x14434 - - .loc_0x218: - li r3, 0x1 - - .loc_0x21C: - lwz r0, 0x24(r1) - lwz r31, 0x1C(r1) - lwz r30, 0x18(r1) - mtlr r0 - addi r1, r1, 0x20 - blr - */ + int err; + u32 cmd; + u32 id; + + if (__OSGetDIConfig() == 0xFF) { + Chan = -1; + return FALSE; + } + + if (Chan != -1) { + return TRUE; + } + + Chan = chan; + ExiCallback = callback; + TxCallback = nullptr; + RxCallback = nullptr; + if (chan < 2) { + while (EXIProbeEx(Chan) == 0) { } + if (EXIAttach(Chan, ExtHandler) == FALSE) { + Chan = -1; + return FALSE; + } + } + if (EXILock(Chan, 0, nullptr) == FALSE) { + EXIDetach(Chan); + Chan = -1; + return FALSE; + } + if (EXISelect(Chan, 0, 0) == FALSE) { + EXIUnlock(Chan); + EXIDetach(Chan); + Chan = -1; + return FALSE; + } + cmd = 0; + err = 0; + err |= !EXIImm(Chan, &cmd, 2, 1, nullptr); + err |= !EXISync(Chan); + err |= !EXIImm(Chan, &id, 4, 0, nullptr); + err |= !EXISync(Chan); + err |= !EXIDeselect(Chan); + EXIUnlock(Chan); + if (err != 0 || id != 0x1010000) { + if (chan < 2) { + EXIDetach(Chan); + } + EXIUnlock(Chan); + Chan = -1; + return FALSE; + } + if (ExiCallback) { + if (chan < 2) { + EXISetExiCallback(Chan, ExiHandler); + } else { + __OSSetInterruptHandler(0x19, DbgHandler); + __OSUnmaskInterrupts(0x40); + } + } + + return TRUE; } /* @@ -417,97 +189,31 @@ void HIOInit(void) * Address: 8020D7F8 * Size: 000130 */ -void HIOReadMailbox(void) +BOOL HIOReadMailbox(u32* word) { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x18(r1) - stw r31, 0x14(r1) - stw r30, 0x10(r1) - addi r30, r3, 0 - lwz r0, 0x2A60(r13) - cmpwi r0, -0x1 - beq- .loc_0x30 - bl -0x17770 - cmplwi r3, 0xFF - bne- .loc_0x38 - - .loc_0x30: - li r3, 0 - b .loc_0x118 - - .loc_0x38: - lwz r3, 0x2A60(r13) - li r4, 0 - li r5, 0 - bl -0x14B00 - cmpwi r3, 0 - bne- .loc_0x58 - li r3, 0 - b .loc_0x118 - - .loc_0x58: - lwz r3, 0x2A60(r13) - li r4, 0 - li r5, 0x4 - bl -0x15180 - cmpwi r3, 0 - bne- .loc_0x80 - lwz r3, 0x2A60(r13) - bl -0x14A3C - li r3, 0 - b .loc_0x118 - - .loc_0x80: - lis r0, 0x6000 - lwz r3, 0x2A60(r13) - stw r0, 0xC(r1) - addi r4, r1, 0xC - li r5, 0x2 - li r6, 0x1 - li r7, 0 - bl -0x15BD4 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r31,r0,27,5,31 - bl -0x157FC - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - addi r4, r30, 0 - or r31, r31, r0 - li r5, 0x4 - li r6, 0 - li r7, 0 - bl -0x15C08 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - or r31, r31, r0 - bl -0x15834 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - or r31, r31, r0 - bl -0x150E8 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - or r31, r31, r0 - bl -0x14AD4 - cntlzw r0, r31 - rlwinm r3,r0,27,5,31 - - .loc_0x118: - lwz r0, 0x1C(r1) - lwz r31, 0x14(r1) - lwz r30, 0x10(r1) - mtlr r0 - addi r1, r1, 0x18 - blr - */ + int err; + u32 cmd; + + if (Chan == -1 || __OSGetDIConfig() == 0xFF) { + return FALSE; + } + + if (EXILock(Chan, 0, nullptr) == FALSE) { + return FALSE; + } + if (EXISelect(Chan, 0, 4) == FALSE) { + EXIUnlock(Chan); + return FALSE; + } + cmd = 0x60000000; + err = 0; + err |= !EXIImm(Chan, &cmd, 2, 1, nullptr); + err |= !EXISync(Chan); + err |= !EXIImm(Chan, word, 4, 0, nullptr); + err |= !EXISync(Chan); + err |= !EXIDeselect(Chan); + EXIUnlock(Chan); + return !err; } /* @@ -515,82 +221,28 @@ void HIOReadMailbox(void) * Address: 8020D928 * Size: 0000F4 */ -void HIOWriteMailbox(void) +BOOL HIOWriteMailbox(u32 word) { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x18(r1) - stw r31, 0x14(r1) - addi r31, r3, 0 - lwz r0, 0x2A60(r13) - cmpwi r0, -0x1 - beq- .loc_0x2C - bl -0x1789C - cmplwi r3, 0xFF - bne- .loc_0x34 - - .loc_0x2C: - li r3, 0 - b .loc_0xE0 - - .loc_0x34: - lwz r3, 0x2A60(r13) - li r4, 0 - li r5, 0 - bl -0x14C2C - cmpwi r3, 0 - bne- .loc_0x54 - li r3, 0 - b .loc_0xE0 - - .loc_0x54: - lwz r3, 0x2A60(r13) - li r4, 0 - li r5, 0x4 - bl -0x152AC - cmpwi r3, 0 - bne- .loc_0x7C - lwz r3, 0x2A60(r13) - bl -0x14B68 - li r3, 0 - b .loc_0xE0 - - .loc_0x7C: - rlwinm r0,r31,0,3,31 - lwz r3, 0x2A60(r13) - oris r0, r0, 0xC000 - stw r0, 0xC(r1) - addi r4, r1, 0xC - li r5, 0x4 - li r6, 0x1 - li r7, 0 - bl -0x15D04 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r31,r0,27,5,31 - bl -0x1592C - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - or r31, r31, r0 - bl -0x151E0 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - or r31, r31, r0 - bl -0x14BCC - cntlzw r0, r31 - rlwinm r3,r0,27,5,31 - - .loc_0xE0: - lwz r0, 0x1C(r1) - lwz r31, 0x14(r1) - addi r1, r1, 0x18 - mtlr r0 - blr - */ + int err; + u32 cmd; + + if (Chan == -1 || __OSGetDIConfig() == 0xFF) { + return FALSE; + } + if (EXILock(Chan, 0, nullptr) == FALSE) { + return FALSE; + } + if (EXISelect(Chan, 0, 4) == FALSE) { + EXIUnlock(Chan); + return FALSE; + } + cmd = (word & 0x1FFFFFFF) | 0xC0000000; + err = 0; + err |= !EXIImm(Chan, &cmd, 4, 1, nullptr); + err |= !EXISync(Chan); + err |= !EXIDeselect(Chan); + EXIUnlock(Chan); + return !err; } /* @@ -598,7 +250,7 @@ void HIOWriteMailbox(void) * Address: ........ * Size: 000144 */ -void HIORead(void) +BOOL HIORead(u32 addr, void* buffer, s32 size) { // UNUSED FUNCTION } @@ -608,102 +260,31 @@ void HIORead(void) * Address: 8020DA1C * Size: 000144 */ -void HIOWrite(void) +BOOL HIOWrite(u32 addr, void* buffer, s32 size) { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x28(r1) - stw r31, 0x24(r1) - addi r31, r3, 0 - stw r30, 0x20(r1) - addi r30, r5, 0 - stw r29, 0x1C(r1) - addi r29, r4, 0 - lwz r0, 0x2A60(r13) - cmpwi r0, -0x1 - beq- .loc_0x3C - bl -0x179A0 - cmplwi r3, 0xFF - bne- .loc_0x44 - - .loc_0x3C: - li r3, 0 - b .loc_0x128 - - .loc_0x44: - lwz r3, 0x2A60(r13) - li r4, 0 - li r5, 0 - bl -0x14D30 - cmpwi r3, 0 - bne- .loc_0x64 - li r3, 0 - b .loc_0x128 - - .loc_0x64: - lwz r3, 0x2A60(r13) - li r4, 0 - li r5, 0x4 - bl -0x153B0 - cmpwi r3, 0 - bne- .loc_0x8C - lwz r3, 0x2A60(r13) - bl -0x14C6C - li r3, 0 - b .loc_0x128 - - .loc_0x8C: - rlwinm r0,r31,8,7,21 - lwz r3, 0x2A60(r13) - oris r0, r0, 0xA000 - stw r0, 0x14(r1) - addi r4, r1, 0x14 - li r5, 0x4 - li r6, 0x1 - li r7, 0 - bl -0x15E08 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r31,r0,27,5,31 - bl -0x15A30 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - addi r4, r29, 0 - addi r5, r30, 0 - or r31, r31, r0 - li r6, 0x1 - li r7, 0 - bl -0x15B40 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - or r31, r31, r0 - bl -0x15A68 - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - or r31, r31, r0 - bl -0x1531C - cntlzw r0, r3 - lwz r3, 0x2A60(r13) - rlwinm r0,r0,27,5,31 - or r31, r31, r0 - bl -0x14D08 - cntlzw r0, r31 - rlwinm r3,r0,27,5,31 - - .loc_0x128: - lwz r0, 0x2C(r1) - lwz r31, 0x24(r1) - lwz r30, 0x20(r1) - mtlr r0 - lwz r29, 0x1C(r1) - addi r1, r1, 0x28 - blr - */ + int err; + u32 cmd; + + if (Chan == -1 || __OSGetDIConfig() == 0xFF) { + return FALSE; + } + + if (EXILock(Chan, 0, nullptr) == FALSE) { + return FALSE; + } + if (EXISelect(Chan, 0, 4) == FALSE) { + EXIUnlock(Chan); + return FALSE; + } + cmd = ((addr << 8) & 0x01FFFC00) | 0xA0000000; + err = 0; + err |= !EXIImm(Chan, &cmd, 4, 1, nullptr); + err |= !EXISync(Chan); + err |= !EXIDma(Chan, buffer, size, 1, nullptr); + err |= !EXISync(Chan); + err |= !EXIDeselect(Chan); + EXIUnlock(Chan); + return !err; } /* @@ -711,7 +292,7 @@ void HIOWrite(void) * Address: ........ * Size: 000128 */ -void HIOReadAsync(void) +BOOL HIOReadAsync(u32 addr, void* buffer, s32 size, HIOCallback callback) { // UNUSED FUNCTION } @@ -721,7 +302,7 @@ void HIOReadAsync(void) * Address: ........ * Size: 000128 */ -void HIOWriteAsync(void) +BOOL HIOWriteAsync(u32 addr, void* buffer, s32 size, HIOCallback callback) { // UNUSED FUNCTION } @@ -731,7 +312,7 @@ void HIOWriteAsync(void) * Address: ........ * Size: 000130 */ -void HIOReadStatus(void) +BOOL HIOReadStatus(u32* status) { // UNUSED FUNCTION } diff --git a/src/plugPikiKando/aiConstants.cpp b/src/plugPikiKando/aiConstants.cpp index e452da2b..b576e369 100644 --- a/src/plugPikiKando/aiConstants.cpp +++ b/src/plugPikiKando/aiConstants.cpp @@ -1,14 +1,14 @@ -#include "types.h" +#include "AIConstant.h" +#include "sysNew.h" + +AIConstant* AIConstant::_instance; /* * --INFO-- * Address: ........ * Size: 00009C */ -static void _Error(char*, ...) -{ - // UNUSED FUNCTION -} +static void _Error(char* fmt, ...) { OSPanic(__FILE__, __LINE__, fmt); } /* * --INFO-- @@ -27,34 +27,9 @@ static void _Print(char*, ...) */ void AIConstant::createInstance() { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x10(r1) - stw r31, 0xC(r1) - lwz r0, 0x2F80(r13) - cmplwi r0, 0 - bne- .loc_0x38 - li r3, 0x194 - bl -0x3CE7C - addi r31, r3, 0 - mr. r3, r31 - beq- .loc_0x34 - bl .loc_0x4C - - .loc_0x34: - stw r31, 0x2F80(r13) - - .loc_0x38: - lwz r0, 0x14(r1) - lwz r31, 0xC(r1) - addi r1, r1, 0x10 - mtlr r0 - blr - - .loc_0x4C: - */ + if (_instance == nullptr) { + _instance = new AIConstant(); + } } /* @@ -62,314 +37,4 @@ void AIConstant::createInstance() * Address: 80083EAC * Size: 000470 */ -AIConstant::AIConstant() -{ - /* - .loc_0x0: - mflr r0 - lis r4, 0x8022 - stw r0, 0x4(r1) - addi r0, r4, 0x738C - subi r4, r13, 0x6038 - stwu r1, -0x198(r1) - stmw r27, 0x184(r1) - addi r31, r3, 0 - lis r3, 0x8022 - li r27, 0 - stw r0, 0x0(r31) - addi r0, r3, 0x737C - addi r3, r31, 0 - stw r0, 0x0(r31) - stw r27, 0x10(r31) - stw r27, 0xC(r31) - stw r27, 0x8(r31) - bl -0x5F01C - lis r3, 0x8023 - subi r0, r3, 0x71E0 - stw r0, 0x0(r31) - addi r3, r31, 0 - subi r4, r13, 0x6038 - bl -0x437CC - lis r3, 0x802B - subi r0, r3, 0x186C - stw r0, 0x0(r31) - addi r5, r1, 0xC0 - addi r3, r31, 0x24 - stw r27, 0x20(r31) - addi r4, r31, 0x20 - lwz r0, -0x6030(r13) - stw r0, 0xC8(r1) - lwz r0, 0xC8(r1) - stw r0, 0xC0(r1) - bl -0x254B8 - lis r3, 0x802A - addi r28, r3, 0x6098 - stw r28, 0x2C(r31) - addi r5, r1, 0xBC - addi r3, r31, 0x34 - lfs f0, -0x75E0(r2) - addi r4, r31, 0x20 - stfs f0, 0x30(r31) - lwz r0, -0x602C(r13) - stw r0, 0xD0(r1) - lwz r0, 0xD0(r1) - stw r0, 0xBC(r1) - bl -0x254EC - lis r3, 0x802A - addi r30, r3, 0x60C4 - stw r30, 0x3C(r31) - li r29, 0x1 - addi r5, r1, 0xB8 - stw r29, 0x40(r31) - addi r3, r31, 0x44 - addi r4, r31, 0x20 - lwz r0, -0x6028(r13) - stw r0, 0xD8(r1) - lwz r0, 0xD8(r1) - stw r0, 0xB8(r1) - bl -0x25520 - stw r30, 0x4C(r31) - addi r5, r1, 0xB4 - addi r3, r31, 0x54 - stw r29, 0x50(r31) - addi r4, r31, 0x20 - lwz r0, -0x6024(r13) - stw r0, 0xE0(r1) - lwz r0, 0xE0(r1) - stw r0, 0xB4(r1) - bl -0x25548 - stw r30, 0x5C(r31) - addi r5, r1, 0xB0 - addi r3, r31, 0x64 - stw r27, 0x60(r31) - addi r4, r31, 0x20 - lwz r0, -0x6020(r13) - stw r0, 0xE8(r1) - lwz r0, 0xE8(r1) - stw r0, 0xB0(r1) - bl -0x25570 - stw r30, 0x6C(r31) - addi r5, r1, 0xAC - addi r3, r31, 0x74 - stw r29, 0x70(r31) - addi r4, r31, 0x20 - lwz r0, -0x601C(r13) - stw r0, 0xF0(r1) - lwz r0, 0xF0(r1) - stw r0, 0xAC(r1) - bl -0x25598 - stw r30, 0x7C(r31) - addi r5, r1, 0xA8 - addi r3, r31, 0x84 - stw r29, 0x80(r31) - addi r4, r31, 0x20 - lwz r0, -0x6018(r13) - stw r0, 0xF8(r1) - lwz r0, 0xF8(r1) - stw r0, 0xA8(r1) - bl -0x255C0 - stw r30, 0x8C(r31) - addi r5, r1, 0xA4 - addi r3, r31, 0x94 - stw r29, 0x90(r31) - addi r4, r31, 0x20 - lwz r0, -0x6014(r13) - stw r0, 0x100(r1) - lwz r0, 0x100(r1) - stw r0, 0xA4(r1) - bl -0x255E8 - stw r30, 0x9C(r31) - addi r5, r1, 0xA0 - addi r3, r31, 0xA4 - stw r29, 0xA0(r31) - addi r4, r31, 0x20 - lwz r0, -0x6010(r13) - stw r0, 0x108(r1) - lwz r0, 0x108(r1) - stw r0, 0xA0(r1) - bl -0x25610 - stw r30, 0xAC(r31) - addi r5, r1, 0x9C - addi r3, r31, 0xB4 - stw r29, 0xB0(r31) - addi r4, r31, 0x20 - lwz r0, -0x600C(r13) - stw r0, 0x110(r1) - lwz r0, 0x110(r1) - stw r0, 0x9C(r1) - bl -0x25638 - stw r30, 0xBC(r31) - addi r5, r1, 0x98 - addi r3, r31, 0xC4 - stw r29, 0xC0(r31) - addi r4, r31, 0x20 - lwz r0, -0x6008(r13) - stw r0, 0x118(r1) - lwz r0, 0x118(r1) - stw r0, 0x98(r1) - bl -0x25660 - stw r30, 0xCC(r31) - addi r5, r1, 0x94 - addi r3, r31, 0xD4 - stw r29, 0xD0(r31) - addi r4, r31, 0x20 - lwz r0, -0x6004(r13) - stw r0, 0x120(r1) - lwz r0, 0x120(r1) - stw r0, 0x94(r1) - bl -0x25688 - stw r28, 0xDC(r31) - addi r5, r1, 0x90 - addi r3, r31, 0xE4 - lfs f0, -0x75DC(r2) - addi r4, r31, 0x20 - stfs f0, 0xE0(r31) - lwz r0, -0x6000(r13) - stw r0, 0x128(r1) - lwz r0, 0x128(r1) - stw r0, 0x90(r1) - bl -0x256B4 - stw r30, 0xEC(r31) - addi r5, r1, 0x8C - addi r3, r31, 0xF4 - stw r29, 0xF0(r31) - addi r4, r31, 0x20 - lwz r0, -0x5FFC(r13) - stw r0, 0x130(r1) - lwz r0, 0x130(r1) - stw r0, 0x8C(r1) - bl -0x256DC - stw r30, 0xFC(r31) - addi r5, r1, 0x88 - addi r3, r31, 0x104 - stw r29, 0x100(r31) - addi r4, r31, 0x20 - lwz r0, -0x5FF8(r13) - stw r0, 0x138(r1) - lwz r0, 0x138(r1) - stw r0, 0x88(r1) - bl -0x25704 - stw r30, 0x10C(r31) - addi r5, r1, 0x84 - addi r3, r31, 0x114 - stw r29, 0x110(r31) - addi r4, r31, 0x20 - lwz r0, -0x5FF4(r13) - stw r0, 0x140(r1) - lwz r0, 0x140(r1) - stw r0, 0x84(r1) - bl -0x2572C - stw r30, 0x11C(r31) - li r0, 0x64 - addi r5, r1, 0x80 - stw r0, 0x120(r31) - addi r3, r31, 0x124 - addi r4, r31, 0x20 - lwz r0, -0x5FF0(r13) - stw r0, 0x148(r1) - lwz r0, 0x148(r1) - stw r0, 0x80(r1) - bl -0x25758 - stw r30, 0x12C(r31) - addi r5, r1, 0x7C - addi r3, r31, 0x134 - stw r29, 0x130(r31) - addi r4, r31, 0x20 - lwz r0, -0x5FEC(r13) - stw r0, 0x150(r1) - lwz r0, 0x150(r1) - stw r0, 0x7C(r1) - bl -0x25780 - stw r28, 0x13C(r31) - addi r5, r1, 0x78 - addi r3, r31, 0x144 - lfs f0, -0x75D8(r2) - addi r4, r31, 0x20 - stfs f0, 0x140(r31) - lwz r0, -0x5FE8(r13) - stw r0, 0x158(r1) - lwz r0, 0x158(r1) - stw r0, 0x78(r1) - bl -0x257AC - stw r28, 0x14C(r31) - addi r5, r1, 0x74 - addi r3, r31, 0x154 - lfs f0, -0x75D4(r2) - addi r4, r31, 0x20 - stfs f0, 0x150(r31) - lwz r0, -0x5FE4(r13) - stw r0, 0x160(r1) - lwz r0, 0x160(r1) - stw r0, 0x74(r1) - bl -0x257D8 - stw r30, 0x15C(r31) - li r0, 0x6 - addi r5, r1, 0x70 - stw r0, 0x160(r31) - addi r3, r31, 0x164 - addi r4, r31, 0x20 - lwz r0, -0x5FE0(r13) - stw r0, 0x168(r1) - lwz r0, 0x168(r1) - stw r0, 0x70(r1) - bl -0x25804 - stw r30, 0x16C(r31) - li r0, 0xC - addi r5, r1, 0x6C - stw r0, 0x170(r31) - addi r3, r31, 0x174 - addi r4, r31, 0x20 - lwz r0, -0x5FDC(r13) - stw r0, 0x170(r1) - lwz r0, 0x170(r1) - stw r0, 0x6C(r1) - bl -0x25830 - stw r30, 0x17C(r31) - li r0, 0x1D - addi r5, r1, 0x68 - stw r0, 0x180(r31) - addi r3, r31, 0x184 - addi r4, r31, 0x20 - lwz r0, -0x5FD8(r13) - stw r0, 0x178(r1) - lwz r0, 0x178(r1) - stw r0, 0x68(r1) - bl -0x2585C - stw r30, 0x18C(r31) - li r0, 0x1E - lis r3, 0x802B - stw r0, 0x190(r31) - subi r5, r3, 0x1930 - addi r3, r31, 0 - subi r4, r13, 0x5FD4 - li r6, 0x1 - bl -0x43C60 - mr r3, r31 - lmw r27, 0x184(r1) - lwz r0, 0x19C(r1) - addi r1, r1, 0x198 - mtlr r0 - blr - */ -} - -/* - * --INFO-- - * Address: 8008431C - * Size: 000024 - */ -void AIConstant::read(RandomAccessStream&) -{ - /* - .loc_0x0: - mflr r0 - addi r3, r3, 0x20 - stw r0, 0x4(r1) - stwu r1, -0x8(r1) - bl -0x25794 - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ -} +AIConstant::AIConstant() { load("parms/", "aiconst.bin", 1); } diff --git a/src/plugPikiKando/formationMgr.cpp b/src/plugPikiKando/formationMgr.cpp index 594a8f32..deb2d03f 100644 --- a/src/plugPikiKando/formationMgr.cpp +++ b/src/plugPikiKando/formationMgr.cpp @@ -1,4 +1,5 @@ -#include "types.h" +#include "FormationMgr.h" +#include "system.h" /* * --INFO-- @@ -25,57 +26,34 @@ static void _Print(char*, ...) * Address: 8007DF5C * Size: 000010 */ -void FormationMgr::getCreature(int) -{ - /* - .loc_0x0: - lwz r3, 0x20(r3) - rlwinm r0,r4,2,0,29 - lwzx r3, r3, r0 - blr - */ -} +Creature* FormationMgr::getCreature(int idx) { return _20[idx]; } /* * --INFO-- * Address: 8007DF6C * Size: 000008 */ -u32 FormationMgr::getFirst() { return 0x0; } +int FormationMgr::getFirst() { return 0; } /* * --INFO-- * Address: 8007DF74 * Size: 000008 */ -void FormationMgr::getNext(int) -{ - /* - .loc_0x0: - addi r3, r4, 0x1 - blr - */ -} +int FormationMgr::getNext(int idx) { return idx + 1; } /* * --INFO-- * Address: 8007DF7C * Size: 00001C */ -void FormationMgr::isDone(int) +bool FormationMgr::isDone(int idx) { - /* - .loc_0x0: - lwz r0, 0x2C(r3) - cmpw r4, r0 - blt- .loc_0x14 - li r3, 0x1 - blr + if (idx >= _2C) { + return true; + } - .loc_0x14: - li r3, 0 - blr - */ + return false; } /* @@ -200,20 +178,6 @@ void FormationMgr::getLastCentre() */ } -/* - * --INFO-- - * Address: 8007E120 - * Size: 000008 - */ -void FormArranger::getLength(FormationMgr*) -{ - /* - .loc_0x0: - lfs f1, -0x7678(r2) - blr - */ -} - /* * --INFO-- * Address: ........ @@ -1199,7 +1163,7 @@ void PyramidArranger::arrange(FormationMgr*) * Address: 8007EC58 * Size: 0000EC */ -void PyramidArranger::getLength(FormationMgr*) +f32 PyramidArranger::getLength(FormationMgr*) { /* .loc_0x0: @@ -1677,20 +1641,6 @@ void Rope::move(Vector3f&, Vector3f&, Vector3f&) // UNUSED FUNCTION } -/* - * --INFO-- - * Address: 8007F2AC - * Size: 000008 - */ -void System::getFrameTime() -{ - /* - .loc_0x0: - lfs f1, 0x28C(r3) - blr - */ -} - /* * --INFO-- * Address: ........ diff --git a/src/plugPikiKando/keyConfig.cpp b/src/plugPikiKando/keyConfig.cpp index c99713ca..c99305aa 100644 --- a/src/plugPikiKando/keyConfig.cpp +++ b/src/plugPikiKando/keyConfig.cpp @@ -1,12 +1,17 @@ -#include "types.h" +#include "KeyConfig.h" +#include "Dolphin/os.h" +#include "sysNew.h" + +KeyConfig* KeyConfig::_instance; /* * --INFO-- * Address: ........ * Size: 00009C */ -static void _Error(char*, ...) +static void _Error(char* fmt, ...) { + OSPanic(__FILE__, __LINE__, fmt, "keyConfig"); // UNUSED FUNCTION } @@ -27,34 +32,9 @@ static void _Print(char*, ...) */ void KeyConfig::createInstance() { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x10(r1) - stw r31, 0xC(r1) - lwz r0, 0x2F98(r13) - cmplwi r0, 0 - bne- .loc_0x38 - li r3, 0xF8 - bl -0x3D6DC - addi r31, r3, 0 - mr. r3, r31 - beq- .loc_0x34 - bl .loc_0x4C - - .loc_0x34: - stw r31, 0x2F98(r13) - - .loc_0x38: - lwz r0, 0x14(r1) - lwz r31, 0xC(r1) - addi r1, r1, 0x10 - mtlr r0 - blr - - .loc_0x4C: - */ + if (!_instance) { + _instance = new KeyConfig; + } } /* @@ -64,128 +44,25 @@ void KeyConfig::createInstance() */ KeyConfig::KeyConfig() { - /* - .loc_0x0: - mflr r0 - lis r4, 0x8022 - stw r0, 0x4(r1) - addi r0, r4, 0x738C - lis r4, 0x802B - stwu r1, -0x20(r1) - stw r31, 0x1C(r1) - addi r31, r3, 0 - lis r3, 0x8022 - stw r30, 0x18(r1) - stw r29, 0x14(r1) - stw r28, 0x10(r1) - subi r28, r4, 0x1820 - subi r4, r13, 0x5F80 - stw r0, 0x0(r31) - addi r0, r3, 0x737C - addi r3, r31, 0 - stw r0, 0x0(r31) - li r0, 0 - stw r0, 0x10(r31) - stw r0, 0xC(r31) - stw r0, 0x8(r31) - bl -0x5F890 - lis r3, 0x8023 - subi r29, r3, 0x71E0 - stw r29, 0x0(r31) - addi r3, r31, 0 - subi r4, r13, 0x5F80 - bl -0x44040 - lis r3, 0x802B - subi r0, r3, 0x172C - stw r0, 0x0(r31) - addi r3, r31, 0x20 - subi r4, r13, 0x5F80 - bl -0x4F7DC - stw r29, 0x20(r31) - addi r3, r31, 0x20 - subi r4, r13, 0x5F80 - bl -0x44068 - lis r3, 0x802B - subi r30, r3, 0x1784 - stw r30, 0x20(r31) - addi r3, r31, 0x44 - subi r4, r13, 0x5F80 - bl -0x4F804 - stw r29, 0x44(r31) - addi r3, r31, 0x44 - subi r4, r13, 0x5F80 - bl -0x44090 - stw r30, 0x44(r31) - addi r3, r31, 0x68 - subi r4, r13, 0x5F80 - bl -0x4F824 - stw r29, 0x68(r31) - addi r3, r31, 0x68 - subi r4, r13, 0x5F80 - bl -0x440B0 - stw r30, 0x68(r31) - addi r3, r31, 0x8C - subi r4, r13, 0x5F80 - bl -0x4F844 - stw r29, 0x8C(r31) - addi r3, r31, 0x8C - subi r4, r13, 0x5F80 - bl -0x440D0 - stw r30, 0x8C(r31) - addi r3, r31, 0xB0 - subi r4, r13, 0x5F80 - bl -0x4F864 - stw r29, 0xB0(r31) - addi r3, r31, 0xB0 - subi r4, r13, 0x5F80 - bl -0x440F0 - stw r30, 0xB0(r31) - addi r3, r31, 0xD4 - subi r4, r13, 0x5F80 - bl -0x4F884 - stw r29, 0xD4(r31) - addi r3, r31, 0xD4 - subi r4, r13, 0x5F80 - bl -0x44110 - stw r30, 0xD4(r31) - subi r0, r13, 0x5F78 - lis r3, 0x1 - stw r0, 0x24(r31) - li r10, 0x1000 - addi r5, r28, 0x1C - stw r10, 0x40(r31) - li r4, 0x2000 - subi r0, r13, 0x5F70 - stw r5, 0x48(r31) - addi r6, r28, 0x2C - subi r9, r13, 0x5F68 - stw r4, 0x64(r31) - li r8, 0x4000 - addi r7, r28, 0x38 - stw r0, 0x6C(r31) - subi r0, r3, 0x8000 - addi r3, r31, 0 - stw r4, 0x88(r31) - subi r4, r13, 0x5F60 - subi r5, r13, 0x5F58 - stw r6, 0x90(r31) - li r6, 0x1 - stw r10, 0xAC(r31) - stw r9, 0xD8(r31) - stw r8, 0xF4(r31) - stw r7, 0xB4(r31) - stw r0, 0xD0(r31) - bl -0x44220 - mr r3, r31 - lwz r0, 0x24(r1) - lwz r31, 0x1C(r1) - lwz r30, 0x18(r1) - lwz r29, 0x14(r1) - lwz r28, 0x10(r1) - addi r1, r1, 0x20 - mtlr r0 - blr - */ + _20.setName("投げ"); // 'throw' + _20._20 = 0x1000; + + _44.setName("集合カーソル"); // 'set cursor' + _44._20 = 0x2000; + + _68.setName("抜き"); // 'extract' + _68._20 = 0x2000; + + _8C.setName("アタック"); // 'attack' + _8C._20 = 0x1000; + + _D4.setName("解散"); // 'disband' + _D4._20 = 0x4000; + + _B0.setName("メニュー"); // 'menu' + _B0._20 = 0x8000; + + load("parms/", "key.bin", 1); } /* @@ -193,59 +70,14 @@ KeyConfig::KeyConfig() * Address: 800848E8 * Size: 0000C0 */ -void KeyConfig::read(RandomAccessStream&) +void KeyConfig::read(RandomAccessStream& input) { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x18(r1) - stw r31, 0x14(r1) - mr r31, r4 - stw r30, 0x10(r1) - addi r30, r3, 0 - addi r3, r30, 0x20 - lwz r12, 0x20(r30) - lwz r12, 0xC(r12) - mtlr r12 - blrl - addi r3, r30, 0x44 - lwz r12, 0x44(r30) - mr r4, r31 - lwz r12, 0xC(r12) - mtlr r12 - blrl - addi r3, r30, 0x68 - lwz r12, 0x68(r30) - mr r4, r31 - lwz r12, 0xC(r12) - mtlr r12 - blrl - addi r3, r30, 0x8C - lwz r12, 0x8C(r30) - mr r4, r31 - lwz r12, 0xC(r12) - mtlr r12 - blrl - addi r3, r30, 0xD4 - lwz r12, 0xD4(r30) - mr r4, r31 - lwz r12, 0xC(r12) - mtlr r12 - blrl - addi r3, r30, 0xB0 - lwz r12, 0xB0(r30) - mr r4, r31 - lwz r12, 0xC(r12) - mtlr r12 - blrl - lwz r0, 0x1C(r1) - lwz r31, 0x14(r1) - lwz r30, 0x10(r1) - addi r1, r1, 0x18 - mtlr r0 - blr - */ + _20.read(input); + _44.read(input); + _68.read(input); + _8C.read(input); + _D4.read(input); + _B0.read(input); } /* @@ -253,25 +85,4 @@ void KeyConfig::read(RandomAccessStream&) * Address: 800849A8 * Size: 000040 */ -void KeyConfig::Key::read(RandomAccessStream&) -{ - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x18(r1) - stw r31, 0x14(r1) - addi r31, r3, 0 - addi r3, r4, 0 - lwz r12, 0x4(r4) - lwz r12, 0x8(r12) - mtlr r12 - blrl - stw r3, 0x20(r31) - lwz r0, 0x1C(r1) - lwz r31, 0x14(r1) - addi r1, r1, 0x18 - mtlr r0 - blr - */ -} +void KeyConfig::Key::read(RandomAccessStream& input) { _20 = input.readInt(); } diff --git a/src/plugPikiKando/kio.cpp b/src/plugPikiKando/kio.cpp index 6ba042ea..781511c1 100644 --- a/src/plugPikiKando/kio.cpp +++ b/src/plugPikiKando/kio.cpp @@ -1,12 +1,16 @@ -#include "types.h" +#include "KIO.h" +#include "sysNew.h" +#include "Dolphin/os.h" +#include "Dolphin/hio.h" /* * --INFO-- * Address: ........ * Size: 000098 */ -static void _Error(char*, ...) +static void _Error(char* fmt, ...) { + OSPanic(__FILE__, __LINE__, fmt); // UNUSED FUNCTION } @@ -20,20 +24,20 @@ static void _Print(char*, ...) // UNUSED FUNCTION } +KIO* kio; +bool KIO::fbCopy; +char* KIO::haltMessage; +int KIO::kontMode = 2; + /* * --INFO-- * Address: 80084340 * Size: 000010 */ -void hioEnumCallback(s32) +static BOOL hioEnumCallback(s32 chan) { - /* - .loc_0x0: - lwz r4, 0x2F88(r13) - stw r3, 0x0(r4) - li r3, 0 - blr - */ + kio->mChannel = chan; + return FALSE; } /* @@ -41,21 +45,7 @@ void hioEnumCallback(s32) * Address: 80084350 * Size: 000024 */ -void hioCallback() -{ - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x8(r1) - lwz r3, 0x2F88(r13) - bl 0xE4 - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ -} +static void hioCallback() { kio->readMailbox(); } /* * --INFO-- @@ -64,32 +54,12 @@ void hioCallback() */ KIO::KIO() { - /* - .loc_0x0: - mflr r0 - li r4, 0x20 - stw r0, 0x4(r1) - stwu r1, -0x18(r1) - stw r31, 0x14(r1) - li r31, 0 - stw r30, 0x10(r1) - addi r30, r3, 0 - stb r31, 0x10(r3) - li r3, 0x100 - stw r30, 0x2F88(r13) - bl -0x3D238 - stw r3, 0xC(r30) - mr r3, r30 - stb r31, 0x2F8C(r13) - stb r31, 0x11(r30) - stw r31, 0x2F90(r13) - lwz r0, 0x1C(r1) - lwz r31, 0x14(r1) - lwz r30, 0x10(r1) - addi r1, r1, 0x18 - mtlr r0 - blr - */ + _10 = 0; + kio = this; + _0C = new (0x20) u8[0x100]; // something goes here, probably not this + fbCopy = false; + _11 = false; + haltMessage = nullptr; } /* @@ -99,44 +69,14 @@ KIO::KIO() */ void KIO::initialise() { - /* - .loc_0x0: - mflr r0 - lis r4, 0x8008 - stw r0, 0x4(r1) - addi r0, r4, 0x4340 - stwu r1, -0x18(r1) - stw r31, 0x14(r1) - addi r31, r3, 0 - mr r3, r0 - bl 0x189010 - lis r4, 0x8008 - lwz r3, 0x0(r31) - addi r4, r4, 0x4350 - bl 0x1891C4 - cmpwi r3, 0 - bne- .loc_0x48 - li r0, 0 - stb r0, 0x10(r31) - b .loc_0x60 - - .loc_0x48: - li r0, 0x1 - stb r0, 0x10(r31) - mr r3, r31 - bl .loc_0x74 - li r0, 0x2 - stw r0, -0x5F88(r13) - - .loc_0x60: - lwz r0, 0x1C(r1) - lwz r31, 0x14(r1) - addi r1, r1, 0x18 - mtlr r0 - blr - - .loc_0x74: - */ + HIOEnumDevices(hioEnumCallback); + if (HIOInit(mChannel, hioCallback) == FALSE) { + _10 = 0; + } else { + _10 = 1; + readMailbox(); + kontMode = 2; + } } /* @@ -146,80 +86,35 @@ void KIO::initialise() */ void KIO::readMailbox() { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x18(r1) - stw r31, 0x14(r1) - li r31, 0 - stw r30, 0x10(r1) - addi r30, r3, 0 - addi r3, r1, 0xC - stw r31, 0xC(r1) - bl 0x189390 - cmpwi r3, 0 - beq- .loc_0xC4 - lis r3, 0x10 - lwz r4, 0xC(r1) - addi r0, r3, 0x3 - cmpw r4, r0 - beq- .loc_0xAC - bge- .loc_0x64 - addi r0, r3, 0x1 - cmpw r4, r0 - beq- .loc_0x90 - bge- .loc_0x80 - cmpw r4, r3 - bge- .loc_0x74 - b .loc_0xBC - - .loc_0x64: - addi r0, r3, 0x6 - cmpw r4, r0 - beq- .loc_0xA0 - b .loc_0xBC - - .loc_0x74: - stw r31, -0x5F88(r13) - stb r31, 0x11(r30) - b .loc_0xC4 - - .loc_0x80: - li r0, 0x1 - stw r0, -0x5F88(r13) - stb r31, 0x11(r30) - b .loc_0xC4 - - .loc_0x90: - li r0, 0x2 - stw r0, -0x5F88(r13) - stb r31, 0x11(r30) - b .loc_0xC4 - - .loc_0xA0: - addi r3, r30, 0x4 - bl 0xF0 - b .loc_0xC4 - - .loc_0xAC: - li r0, 0x1 - stb r0, 0x2F8C(r13) - stb r0, 0x11(r30) - b .loc_0xC4 - - .loc_0xBC: - li r0, 0x2 - stw r0, -0x5F88(r13) - - .loc_0xC4: - lwz r0, 0x1C(r1) - lwz r31, 0x14(r1) - lwz r30, 0x10(r1) - addi r1, r1, 0x18 - mtlr r0 - blr - */ + u32 mail = 0; + if (HIOReadMailbox(&mail) == FALSE) { + return; + } + + switch (mail) { + case 0x100000: + kontMode = 0; + _11 = 0; + break; + case 0x100002: + kontMode = 1; + _11 = 0; + break; + case 0x100001: + kontMode = 2; + _11 = 0; + break; + case 0x100006: + mContext.write(); + break; + case 0x100003: + fbCopy = true; + _11 = 1; + break; + default: + kontMode = 2; + break; + } } /* @@ -227,27 +122,10 @@ void KIO::readMailbox() * Address: 80084520 * Size: 000038 */ -void KIO::startWrite(int, u8*, int) +void KIO::startWrite(int p1, u8* p2, int p3) { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x20(r1) - stw r31, 0x1C(r1) - addi r31, r3, 0 - addi r3, r31, 0x4 - bl 0x84 - mr r3, r31 - bl .loc_0x38 - lwz r0, 0x24(r1) - lwz r31, 0x1C(r1) - addi r1, r1, 0x20 - mtlr r0 - blr - - .loc_0x38: - */ + mContext.set(p1, p2, p3); + writeHeader(); } /* @@ -257,36 +135,13 @@ void KIO::startWrite(int, u8*, int) */ void KIO::writeHeader() { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x18(r1) - stw r31, 0x14(r1) - mr r31, r3 - lbz r0, 0x10(r3) - cmplwi r0, 0 - beq- .loc_0x50 - lwz r3, 0xC(r31) - li r4, 0x100 - bl 0x172668 - lwz r4, 0xC(r31) - li r3, 0x500 - li r5, 0x100 - bl 0x18948C - cmpwi r3, 0 - beq- .loc_0x50 - lis r3, 0x10 - addi r3, r3, 0x3 - bl 0x189384 + if (_10) { + DCFlushRange(_0C, 0x100); - .loc_0x50: - lwz r0, 0x1C(r1) - lwz r31, 0x14(r1) - addi r1, r1, 0x18 - mtlr r0 - blr - */ + if (HIOWrite(0x500, _0C, 0x100) != FALSE) { + HIOWriteMailbox(0x100003); + } + } } /* @@ -304,18 +159,13 @@ void KIO::copyEfb(u8*, u16, u16) * Address: 800845BC * Size: 00001C */ -void KIOContext::set(int, u8*, int) +void KIOContext::set(int p1, u8* p2, int p3) { - /* - .loc_0x0: - stw r6, 0x0(r3) - lwz r7, 0x2F88(r13) - lwz r7, 0xC(r7) - stw r6, 0x4(r7) - stw r4, 0x0(r7) - stw r5, 0x4(r3) - blr - */ + _00 = p3; + int* buf = (int*)kio->_0C; + buf[1] = p3; + buf[0] = p1; + _04 = p2; } /* @@ -325,73 +175,27 @@ void KIOContext::set(int, u8*, int) */ void KIOContext::write() { - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x20(r1) - stw r31, 0x1C(r1) - stw r30, 0x18(r1) - stw r29, 0x14(r1) - mr r29, r3 - lwz r4, 0x0(r3) - cmpwi r4, 0 - bgt- .loc_0x48 - lwz r5, 0x2F90(r13) - cmplwi r5, 0 - beq- .loc_0xCC - crclr 6, 0x6 - subi r3, r13, 0x5F90 - li r4, 0xA6 - bl 0x1732F8 - b .loc_0xCC - - .loc_0x48: - lis r3, 0x2 - subi r0, r3, 0x600 - cmpw r4, r0 - addi r31, r4, 0 - ble- .loc_0x60 - mr r31, r0 - - .loc_0x60: - srawi r0, r31, 0x5 - addze r0, r0 - rlwinm r0,r0,5,0,26 - subc. r0, r31, r0 - addi r30, r31, 0 - beq- .loc_0x84 - srawi r0, r31, 0x5 - rlwinm r3,r0,5,0,26 - addi r30, r3, 0x20 - - .loc_0x84: - lwz r3, 0x4(r29) - mr r4, r30 - bl 0x172584 - lwz r4, 0x4(r29) - addi r5, r30, 0 - li r3, 0x600 - bl 0x1893A8 - cmpwi r3, 0 - beq- .loc_0xCC - lis r3, 0x10 - addi r3, r3, 0x4 - bl 0x1892A0 - lwz r0, 0x4(r29) - add r0, r0, r31 - stw r0, 0x4(r29) - lwz r0, 0x0(r29) - sub r0, r0, r31 - stw r0, 0x0(r29) - - .loc_0xCC: - lwz r0, 0x24(r1) - lwz r31, 0x1C(r1) - lwz r30, 0x18(r1) - lwz r29, 0x14(r1) - addi r1, r1, 0x20 - mtlr r0 - blr - */ + if (_00 <= 0) { + if (KIO::haltMessage) { + OSPanic(__FILE__, 166, KIO::haltMessage); + } + return; + } + + s32 bufSize = _00; + if (_00 > 0x1FA00) { + bufSize = 0x1FA00; + } + + s32 size = bufSize; + if ((s32)bufSize % 32) { + size = (bufSize >> 5) * 0x20 + 0x20; + } + + DCFlushRange(_04, size); + if (HIOWrite(0x600, _04, size) != FALSE) { + HIOWriteMailbox(0x100004); + _04 = (void*)((u32)_04 + bufSize); + _00 -= bufSize; + } } diff --git a/src/plugPikiKando/saiEvents.cpp b/src/plugPikiKando/saiEvents.cpp index 0820947e..6301104e 100644 --- a/src/plugPikiKando/saiEvents.cpp +++ b/src/plugPikiKando/saiEvents.cpp @@ -1,14 +1,21 @@ -#include "types.h" +#include "SimpleAI.h" +#include "Dolphin/os.h" +#include "sysNew.h" + +SAIMotionDoneEvent* saiMotionDoneEvent; +SAIBounceEvent* saiBounceEvent; +SAIMotionLoopStartEvent* saiMotionLoopStartEvent; +SAIMotionLoopEndEvent* saiMotionLoopEndEvent; +SAICollideEvent* saiCollideEvent; +SAIGroundEvent* saiGroundEvent; +SAIMotionAction0Event* saiMotionAction0Event; /* * --INFO-- * Address: ........ * Size: 00009C */ -static void _Error(char*, ...) -{ - // UNUSED FUNCTION -} +static void _Error(char* fmt, ...) { OSPanic(__FILE__, __LINE__, fmt, "saiEvent"); } /* * --INFO-- @@ -27,106 +34,11 @@ static void _Print(char*, ...) */ void SAIEventInit() { - /* - .loc_0x0: - mflr r0 - li r3, 0x8 - stw r0, 0x4(r1) - stwu r1, -0x8(r1) - bl -0x35E08 - cmplwi r3, 0 - beq- .loc_0x48 - lis r4, 0x802B - subi r0, r4, 0x2950 - lis r4, 0x802B - stw r0, 0x0(r3) - subi r0, r4, 0x2988 - stw r0, 0x0(r3) - li r0, -0x1 - lis r4, 0x802B - stw r0, 0x4(r3) - subi r0, r4, 0x29C0 - stw r0, 0x0(r3) - - .loc_0x48: - stw r3, 0x2F30(r13) - li r3, 0x8 - bl -0x35E48 - cmplwi r3, 0 - beq- .loc_0x88 - lis r4, 0x802B - subi r0, r4, 0x2950 - lis r4, 0x802B - stw r0, 0x0(r3) - subi r0, r4, 0x2988 - stw r0, 0x0(r3) - li r0, -0x1 - lis r4, 0x802B - stw r0, 0x4(r3) - subi r0, r4, 0x2B4C - stw r0, 0x0(r3) - - .loc_0x88: - stw r3, 0x2F34(r13) - li r3, 0x8 - bl -0x35E88 - cmplwi r3, 0 - beq- .loc_0xC8 - lis r4, 0x802B - subi r0, r4, 0x2950 - lis r4, 0x802B - stw r0, 0x0(r3) - subi r0, r4, 0x2988 - stw r0, 0x0(r3) - li r0, -0x1 - lis r4, 0x802B - stw r0, 0x4(r3) - subi r0, r4, 0x2BA8 - stw r0, 0x0(r3) - - .loc_0xC8: - stw r3, 0x2F40(r13) - li r3, 0x8 - bl -0x35EC8 - cmplwi r3, 0 - beq- .loc_0x108 - lis r4, 0x802B - subi r0, r4, 0x2950 - lis r4, 0x802B - stw r0, 0x0(r3) - subi r0, r4, 0x2988 - stw r0, 0x0(r3) - li r0, -0x1 - lis r4, 0x802B - stw r0, 0x4(r3) - subi r0, r4, 0x2C04 - stw r0, 0x0(r3) - - .loc_0x108: - stw r3, 0x2F44(r13) - li r3, 0x8 - bl -0x35F08 - cmplwi r3, 0 - beq- .loc_0x148 - lis r4, 0x802B - subi r0, r4, 0x2950 - lis r4, 0x802B - stw r0, 0x0(r3) - subi r0, r4, 0x2988 - stw r0, 0x0(r3) - li r0, -0x1 - lis r4, 0x802B - stw r0, 0x4(r3) - subi r0, r4, 0x2A20 - stw r0, 0x0(r3) - - .loc_0x148: - stw r3, 0x2F48(r13) - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ + saiMotionDoneEvent = new SAIMotionDoneEvent; + saiBounceEvent = new SAIBounceEvent; + saiCollideEvent = new SAICollideEvent; + saiGroundEvent = new SAIGroundEvent; + saiMotionAction0Event = new SAIMotionAction0Event; } /* @@ -134,370 +46,53 @@ void SAIEventInit() * Address: 8007CF58 * Size: 000040 */ -void SAIMotionDoneEvent::procAnimMsg(AICreature*, MsgAnim*) -{ - /* - .loc_0x0: - mflr r0 - mr r6, r4 - stw r0, 0x4(r1) - stwu r1, -0x8(r1) - lwz r5, 0x4(r5) - lwz r4, 0x4(r3) - addi r3, r6, 0 - lwz r0, 0x0(r5) - neg r0, r0 - cntlzw r0, r0 - rlwinm r5,r0,27,5,31 - bl 0x544 - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ -} +void SAIMotionDoneEvent::procAnimMsg(AICreature* creature, MsgAnim* msg) { creature->setEventFlag(mEventID, *msg->_04 == 0); } /* * --INFO-- * Address: 8007CF98 * Size: 000040 */ -void SAIMotionAction0Event::procAnimMsg(AICreature*, MsgAnim*) -{ - /* - .loc_0x0: - mflr r0 - mr r6, r4 - stw r0, 0x4(r1) - stwu r1, -0x8(r1) - lwz r5, 0x4(r5) - lwz r4, 0x4(r3) - addi r3, r6, 0 - lwz r0, 0x0(r5) - subfic r0, r0, 0x1 - cntlzw r0, r0 - rlwinm r5,r0,27,5,31 - bl 0x504 - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ -} +void SAIMotionAction0Event::procAnimMsg(AICreature* creature, MsgAnim* msg) { creature->setEventFlag(mEventID, *msg->_04 == 1); } /* * --INFO-- * Address: 8007CFD8 * Size: 000040 */ -void SAIMotionLoopStartEvent::procAnimMsg(AICreature*, MsgAnim*) -{ - /* - .loc_0x0: - mflr r0 - mr r6, r4 - stw r0, 0x4(r1) - stwu r1, -0x8(r1) - lwz r5, 0x4(r5) - lwz r4, 0x4(r3) - addi r3, r6, 0 - lwz r0, 0x0(r5) - subfic r0, r0, 0x5 - cntlzw r0, r0 - rlwinm r5,r0,27,5,31 - bl 0x4C4 - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ -} +void SAIMotionLoopStartEvent::procAnimMsg(AICreature* creature, MsgAnim* msg) { creature->setEventFlag(mEventID, *msg->_04 == 5); } /* * --INFO-- * Address: 8007D018 * Size: 000040 */ -void SAIMotionLoopEndEvent::procAnimMsg(AICreature*, MsgAnim*) -{ - /* - .loc_0x0: - mflr r0 - mr r6, r4 - stw r0, 0x4(r1) - stwu r1, -0x8(r1) - lwz r5, 0x4(r5) - lwz r4, 0x4(r3) - addi r3, r6, 0 - lwz r0, 0x0(r5) - subfic r0, r0, 0x6 - cntlzw r0, r0 - rlwinm r5,r0,27,5,31 - bl 0x484 - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ -} +void SAIMotionLoopEndEvent::procAnimMsg(AICreature* creature, MsgAnim* msg) { creature->setEventFlag(mEventID, *msg->_04 == 6); } /* * --INFO-- * Address: 8007D058 * Size: 000030 */ -void SAIBounceEvent::procBounceMsg(AICreature*, MsgBounce*) -{ - /* - .loc_0x0: - mflr r0 - li r5, 0x1 - stw r0, 0x4(r1) - mr r0, r4 - stwu r1, -0x8(r1) - lwz r4, 0x4(r3) - mr r3, r0 - bl 0x454 - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ -} +void SAIBounceEvent::procBounceMsg(AICreature* creature, MsgBounce*) { creature->setEventFlag(mEventID, true); } /* * --INFO-- * Address: 8007D088 * Size: 000030 */ -void SAICollideEvent::procCollideMsg(AICreature*, MsgCollide*) -{ - /* - .loc_0x0: - mflr r0 - li r5, 0x1 - stw r0, 0x4(r1) - mr r0, r4 - stwu r1, -0x8(r1) - lwz r4, 0x4(r3) - mr r3, r0 - bl 0x424 - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ -} +void SAICollideEvent::procCollideMsg(AICreature* creature, MsgCollide*) { creature->setEventFlag(mEventID, true); } /* * --INFO-- * Address: 8007D0B8 * Size: 000030 */ -void SAIGroundEvent::procGroundMsg(AICreature*, MsgGround*) -{ - /* - .loc_0x0: - mflr r0 - li r5, 0x1 - stw r0, 0x4(r1) - mr r0, r4 - stwu r1, -0x8(r1) - lwz r4, 0x4(r3) - mr r3, r0 - bl 0x3F4 - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ -} +void SAIGroundEvent::procGroundMsg(AICreature* creature, MsgGround*) { creature->setEventFlag(mEventID, true); } /* * --INFO-- * Address: 8007D0E8 * Size: 000040 */ -void SAIUserEvent::procUserMsg(AICreature*, MsgUser*) -{ - /* - .loc_0x0: - mflr r0 - mr r6, r4 - stw r0, 0x4(r1) - stwu r1, -0x8(r1) - lwz r0, 0x4(r5) - lwz r5, 0x8(r3) - lwz r4, 0x4(r3) - addi r3, r6, 0 - sub r0, r0, r5 - cntlzw r0, r0 - rlwinm r5,r0,27,5,31 - bl 0x3B4 - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ -} - -/* - * --INFO-- - * Address: 8007D128 - * Size: 000004 - */ -void Receiver::procBounceMsg(AICreature*, MsgBounce*) { } - -/* - * --INFO-- - * Address: 8007D12C - * Size: 000004 - */ -void Receiver::procStickMsg(AICreature*, MsgStick*) { } - -/* - * --INFO-- - * Address: 8007D130 - * Size: 000004 - */ -void Receiver::procHangMsg(AICreature*, MsgHang*) { } - -/* - * --INFO-- - * Address: 8007D134 - * Size: 000004 - */ -void Receiver::procTargetMsg(AICreature*, MsgTarget*) { } - -/* - * --INFO-- - * Address: 8007D138 - * Size: 000004 - */ -void Receiver::procCollideMsg(AICreature*, MsgCollide*) { } - -/* - * --INFO-- - * Address: 8007D13C - * Size: 000004 - */ -void Receiver::procAnimMsg(AICreature*, MsgAnim*) { } - -/* - * --INFO-- - * Address: 8007D140 - * Size: 000004 - */ -void Receiver::procDamageMsg(AICreature*, MsgDamage*) { } - -/* - * --INFO-- - * Address: 8007D144 - * Size: 000004 - */ -void Receiver::procWallMsg(AICreature*, MsgWall*) { } - -/* - * --INFO-- - * Address: 8007D148 - * Size: 000004 - */ -void Receiver::procOffWallMsg(AICreature*, MsgOffWall*) { } - -/* - * --INFO-- - * Address: 8007D14C - * Size: 000004 - */ -void Receiver::procUserMsg(AICreature*, MsgUser*) { } - -/* - * --INFO-- - * Address: 8007D150 - * Size: 000004 - */ -void Receiver::procGroundMsg(AICreature*, MsgGround*) { } - -/* - * --INFO-- - * Address: 8007D154 - * Size: 000118 - */ -void Receiver::procMsg(AICreature*, Msg*) -{ - /* - .loc_0x0: - mflr r0 - stw r0, 0x4(r1) - stwu r1, -0x8(r1) - lwz r0, 0x0(r5) - cmplwi r0, 0xA - bgt- .loc_0x108 - lis r6, 0x802B - subi r6, r6, 0x2918 - rlwinm r0,r0,2,0,29 - lwzx r0, r6, r0 - mtctr r0 - bctr - lwz r12, 0x0(r3) - lwz r12, 0xC(r12) - mtlr r12 - blrl - b .loc_0x108 - lwz r12, 0x0(r3) - lwz r12, 0x10(r12) - mtlr r12 - blrl - b .loc_0x108 - lwz r12, 0x0(r3) - lwz r12, 0x14(r12) - mtlr r12 - blrl - b .loc_0x108 - lwz r12, 0x0(r3) - lwz r12, 0x18(r12) - mtlr r12 - blrl - b .loc_0x108 - lwz r12, 0x0(r3) - lwz r12, 0x1C(r12) - mtlr r12 - blrl - b .loc_0x108 - lwz r12, 0x0(r3) - lwz r12, 0x20(r12) - mtlr r12 - blrl - b .loc_0x108 - lwz r12, 0x0(r3) - lwz r12, 0x24(r12) - mtlr r12 - blrl - b .loc_0x108 - lwz r12, 0x0(r3) - lwz r12, 0x28(r12) - mtlr r12 - blrl - b .loc_0x108 - lwz r12, 0x0(r3) - lwz r12, 0x2C(r12) - mtlr r12 - blrl - b .loc_0x108 - lwz r12, 0x0(r3) - lwz r12, 0x30(r12) - mtlr r12 - blrl - b .loc_0x108 - lwz r12, 0x0(r3) - lwz r12, 0x34(r12) - mtlr r12 - blrl - - .loc_0x108: - lwz r0, 0xC(r1) - addi r1, r1, 0x8 - mtlr r0 - blr - */ -} +void SAIUserEvent::procUserMsg(AICreature* creature, MsgUser* msg) { creature->setEventFlag(mEventID, _08 == msg->_04); } diff --git a/unsorted_include_todo/AIConstant.h b/unsorted_include_todo/AIConstant.h deleted file mode 100644 index 5d04ee71..00000000 --- a/unsorted_include_todo/AIConstant.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _AICONSTANT_H -#define _AICONSTANT_H - -/** - * .obj __vt__10AIConstant, weak - * .4byte __RTTI__10AIConstant - * .4byte 0 - * .4byte getAgeNodeType__5ANodeFv - * .4byte read__10AIConstantFR18RandomAccessStream - * .4byte update__4NodeFv - * .4byte draw__4NodeFR8Graphics - * .4byte render__4NodeFR8Graphics - * .4byte concat__4NodeFv - * .4byte concat__4NodeFR3VQS - * .4byte concat__4NodeFR3SRT - * .4byte concat__4NodeFR8Matrix4f - * .4byte getModelMatrix__4NodeFv - */ - -struct ANode { - virtual void getAgeNodeType(); // _08 (weak) -}; - -struct Node { - virtual void _08() = 0; // _08 - virtual void read(RandomAccessStream&); // _0C (weak) - virtual void update(); // _10 - virtual void draw(Graphics&); // _14 - virtual void render(Graphics&); // _18 - virtual void concat(); // _1C (weak) - virtual void concat(VQS&); // _20 (weak) - virtual void concat(SRT&); // _24 (weak) - virtual void concat(Matrix4f&); // _28 (weak) - virtual void getModelMatrix(); // _2C (weak) -}; - -/** - * @brief TODO - */ -struct AIConstant : public ANode, public Node { - virtual void read(RandomAccessStream&); // _0C (weak) - - void createInstance(); - AIConstant(); -}; - -#endif diff --git a/unsorted_include_todo/CircleArranger.h b/unsorted_include_todo/CircleArranger.h deleted file mode 100644 index f38cc071..00000000 --- a/unsorted_include_todo/CircleArranger.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _CIRCLEARRANGER_H -#define _CIRCLEARRANGER_H - -/** - * .obj __vt__14CircleArranger, global - * .4byte __RTTI__14CircleArranger - * .4byte 0 - * .4byte arrange__14CircleArrangerFP12FormationMgr - * .4byte getLength__12FormArrangerFP12FormationMgr - */ - -struct FormArranger { - virtual void arrange(FormationMgr*); // _08 - virtual void getLength(FormationMgr*); // _0C -}; - -/** - * @brief TODO - */ -struct CircleArranger : public FormArranger { - virtual void arrange(FormationMgr*); // _08 -}; - -#endif diff --git a/unsorted_include_todo/FormationMgr.h b/unsorted_include_todo/FormationMgr.h deleted file mode 100644 index 65056605..00000000 --- a/unsorted_include_todo/FormationMgr.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _FORMATIONMGR_H -#define _FORMATIONMGR_H - -/** - * .obj __vt__12FormationMgr, global - * .4byte __RTTI__12FormationMgr - * .4byte 0 - * .4byte getCreature__12FormationMgrFi - * .4byte getFirst__12FormationMgrFv - * .4byte getNext__12FormationMgrFi - * .4byte isDone__12FormationMgrFi - */ - -/** - * @brief TODO - */ -struct FormationMgr { - virtual void getCreature(int); // _08 - virtual void getFirst(); // _0C - virtual void getNext(int); // _10 - virtual void isDone(int); // _14 -}; - -#endif diff --git a/unsorted_include_todo/KIO.h b/unsorted_include_todo/KIO.h deleted file mode 100644 index 3e9b10b5..00000000 --- a/unsorted_include_todo/KIO.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _KIO_H -#define _KIO_H - -/* - * @brief TODO - */ -struct KIO { - KIO(); - void initialise(); - void readMailbox(); - void startWrite(int, unsigned char*, int); - void writeHeader(); -}; - -#endif diff --git a/unsorted_include_todo/KIOContext.h b/unsorted_include_todo/KIOContext.h deleted file mode 100644 index 22618caf..00000000 --- a/unsorted_include_todo/KIOContext.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _KIOCONTEXT_H -#define _KIOCONTEXT_H - -/* - * @brief TODO - */ -struct KIOContext { - void set(int, unsigned char*, int); - void write(); -}; - -#endif diff --git a/unsorted_include_todo/KeyConfig.h b/unsorted_include_todo/KeyConfig.h deleted file mode 100644 index 34fc363c..00000000 --- a/unsorted_include_todo/KeyConfig.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KEYCONFIG_H -#define _KEYCONFIG_H - -/** - * .obj __vt__9KeyConfig, global - * .4byte __RTTI__9KeyConfig - * .4byte 0 - * .4byte getAgeNodeType__5ANodeFv - * .4byte read__9KeyConfigFR18RandomAccessStream - * .4byte update__4NodeFv - * .4byte draw__4NodeFR8Graphics - * .4byte render__4NodeFR8Graphics - * .4byte concat__4NodeFv - * .4byte concat__4NodeFR3VQS - * .4byte concat__4NodeFR3SRT - * .4byte concat__4NodeFR8Matrix4f - * .4byte getModelMatrix__4NodeFv - */ - -struct ANode { - virtual void getAgeNodeType(); // _08 (weak) -}; - -struct Node { - virtual void _08() = 0; // _08 - virtual void read(RandomAccessStream&); // _0C - virtual void update(); // _10 - virtual void draw(Graphics&); // _14 - virtual void render(Graphics&); // _18 - virtual void concat(); // _1C (weak) - virtual void concat(VQS&); // _20 (weak) - virtual void concat(SRT&); // _24 (weak) - virtual void concat(Matrix4f&); // _28 (weak) - virtual void getModelMatrix(); // _2C (weak) -}; - -/** - * @brief TODO - */ -struct KeyConfig : public ANode, public Node { - virtual void read(RandomAccessStream&); // _0C - - void createInstance(); - KeyConfig(); -}; - -#endif diff --git a/unsorted_include_todo/KeyConfig/Key.h b/unsorted_include_todo/KeyConfig/Key.h deleted file mode 100644 index 93b9cfdf..00000000 --- a/unsorted_include_todo/KeyConfig/Key.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef _KEYCONFIG_KEY_H -#define _KEYCONFIG_KEY_H - -/** - * .obj __vt__Q29KeyConfig3Key, global - * .4byte __RTTI__Q29KeyConfig3Key - * .4byte 0 - * .4byte getAgeNodeType__5ANodeFv - * .4byte read__Q29KeyConfig3KeyFR18RandomAccessStream - * .4byte update__4NodeFv - * .4byte draw__4NodeFR8Graphics - * .4byte render__4NodeFR8Graphics - * .4byte concat__4NodeFv - * .4byte concat__4NodeFR3VQS - * .4byte concat__4NodeFR3SRT - * .4byte concat__4NodeFR8Matrix4f - * .4byte getModelMatrix__4NodeFv - */ - -struct ANode { - virtual void getAgeNodeType(); // _08 (weak) -}; - -struct Node { - virtual void _08() = 0; // _08 - virtual void read(RandomAccessStream&); // _0C - virtual void update(); // _10 - virtual void draw(Graphics&); // _14 - virtual void render(Graphics&); // _18 - virtual void concat(); // _1C (weak) - virtual void concat(VQS&); // _20 (weak) - virtual void concat(SRT&); // _24 (weak) - virtual void concat(Matrix4f&); // _28 (weak) - virtual void getModelMatrix(); // _2C (weak) -}; - -namespace KeyConfig { -/** - * @brief TODO - */ -struct Key : public ANode, public Node { - virtual void read(RandomAccessStream&); // _0C -}; -} // namespace KeyConfig - -#endif diff --git a/unsorted_include_todo/LineArranger.h b/unsorted_include_todo/LineArranger.h deleted file mode 100644 index 2bddd0f4..00000000 --- a/unsorted_include_todo/LineArranger.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _LINEARRANGER_H -#define _LINEARRANGER_H - -/** - * .obj __vt__12LineArranger, global - * .4byte __RTTI__12LineArranger - * .4byte 0 - * .4byte arrange__12LineArrangerFP12FormationMgr - * .4byte getLength__12FormArrangerFP12FormationMgr - */ - -struct FormArranger { - virtual void arrange(FormationMgr*); // _08 - virtual void getLength(FormationMgr*); // _0C -}; - -/** - * @brief TODO - */ -struct LineArranger : public FormArranger { - virtual void arrange(FormationMgr*); // _08 -}; - -#endif diff --git a/unsorted_include_todo/PyramidArranger.h b/unsorted_include_todo/PyramidArranger.h deleted file mode 100644 index f79837dd..00000000 --- a/unsorted_include_todo/PyramidArranger.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _PYRAMIDARRANGER_H -#define _PYRAMIDARRANGER_H - -/** - * .obj __vt__15PyramidArranger, global - * .4byte __RTTI__15PyramidArranger - * .4byte 0 - * .4byte arrange__15PyramidArrangerFP12FormationMgr - * .4byte getLength__15PyramidArrangerFP12FormationMgr - */ - -/** - * @brief TODO - */ -struct PyramidArranger { - virtual void arrange(FormationMgr*); // _08 - virtual void getLength(FormationMgr*); // _0C -}; - -#endif diff --git a/unsorted_include_todo/SAIBounceEvent.h b/unsorted_include_todo/SAIBounceEvent.h deleted file mode 100644 index a8f93a69..00000000 --- a/unsorted_include_todo/SAIBounceEvent.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _SAIBOUNCEEVENT_H -#define _SAIBOUNCEEVENT_H - -/** - * .obj __vt__14SAIBounceEvent, global - * .4byte __RTTI__14SAIBounceEvent - * .4byte 0 - * .4byte "procMsg__22Receiver<10AICreature>FP10AICreatureP3Msg" - * .4byte procBounceMsg__14SAIBounceEventFP10AICreatureP9MsgBounce - * .4byte "procStickMsg__22Receiver<10AICreature>FP10AICreatureP8MsgStick" - * .4byte "procHangMsg__22Receiver<10AICreature>FP10AICreatureP7MsgHang" - * .4byte "procTargetMsg__22Receiver<10AICreature>FP10AICreatureP9MsgTarget" - * .4byte "procCollideMsg__22Receiver<10AICreature>FP10AICreatureP10MsgCollide" - * .4byte "procAnimMsg__22Receiver<10AICreature>FP10AICreatureP7MsgAnim" - * .4byte "procDamageMsg__22Receiver<10AICreature>FP10AICreatureP9MsgDamage" - * .4byte "procWallMsg__22Receiver<10AICreature>FP10AICreatureP7MsgWall" - * .4byte "procOffWallMsg__22Receiver<10AICreature>FP10AICreatureP10MsgOffWall" - * .4byte "procUserMsg__22Receiver<10AICreature>FP10AICreatureP7MsgUser" - * .4byte "procGroundMsg__22Receiver<10AICreature>FP10AICreatureP9MsgGround" - */ - -struct Receiver { - virtual void procMsg(AICreature*, Msg*); // _08 (weak) - virtual void procBounceMsg(AICreature*, MsgBounce*); // _0C - virtual void procStickMsg(AICreature*, MsgStick*); // _10 (weak) - virtual void procHangMsg(AICreature*, MsgHang*); // _14 (weak) - virtual void procTargetMsg(AICreature*, MsgTarget*); // _18 (weak) - virtual void procCollideMsg(AICreature*, MsgCollide*); // _1C (weak) - virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 (weak) - virtual void procDamageMsg(AICreature*, MsgDamage*); // _24 (weak) - virtual void procWallMsg(AICreature*, MsgWall*); // _28 (weak) - virtual void procOffWallMsg(AICreature*, MsgOffWall*); // _2C (weak) - virtual void procUserMsg(AICreature*, MsgUser*); // _30 (weak) - virtual void procGroundMsg(AICreature*, MsgGround*); // _34 (weak) -}; - -/** - * @brief TODO - */ -struct SAIBounceEvent : public Receiver { - virtual void procBounceMsg(AICreature*, MsgBounce*); // _0C -}; - -#endif diff --git a/unsorted_include_todo/SAICollideEvent.h b/unsorted_include_todo/SAICollideEvent.h deleted file mode 100644 index 9fbda60a..00000000 --- a/unsorted_include_todo/SAICollideEvent.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _SAICOLLIDEEVENT_H -#define _SAICOLLIDEEVENT_H - -/** - * .obj __vt__15SAICollideEvent, global - * .4byte __RTTI__15SAICollideEvent - * .4byte 0 - * .4byte "procMsg__22Receiver<10AICreature>FP10AICreatureP3Msg" - * .4byte "procBounceMsg__22Receiver<10AICreature>FP10AICreatureP9MsgBounce" - * .4byte "procStickMsg__22Receiver<10AICreature>FP10AICreatureP8MsgStick" - * .4byte "procHangMsg__22Receiver<10AICreature>FP10AICreatureP7MsgHang" - * .4byte "procTargetMsg__22Receiver<10AICreature>FP10AICreatureP9MsgTarget" - * .4byte procCollideMsg__15SAICollideEventFP10AICreatureP10MsgCollide - * .4byte "procAnimMsg__22Receiver<10AICreature>FP10AICreatureP7MsgAnim" - * .4byte "procDamageMsg__22Receiver<10AICreature>FP10AICreatureP9MsgDamage" - * .4byte "procWallMsg__22Receiver<10AICreature>FP10AICreatureP7MsgWall" - * .4byte "procOffWallMsg__22Receiver<10AICreature>FP10AICreatureP10MsgOffWall" - * .4byte "procUserMsg__22Receiver<10AICreature>FP10AICreatureP7MsgUser" - * .4byte "procGroundMsg__22Receiver<10AICreature>FP10AICreatureP9MsgGround" - */ - -struct Receiver { - virtual void procMsg(AICreature*, Msg*); // _08 (weak) - virtual void procBounceMsg(AICreature*, MsgBounce*); // _0C (weak) - virtual void procStickMsg(AICreature*, MsgStick*); // _10 (weak) - virtual void procHangMsg(AICreature*, MsgHang*); // _14 (weak) - virtual void procTargetMsg(AICreature*, MsgTarget*); // _18 (weak) - virtual void procCollideMsg(AICreature*, MsgCollide*); // _1C - virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 (weak) - virtual void procDamageMsg(AICreature*, MsgDamage*); // _24 (weak) - virtual void procWallMsg(AICreature*, MsgWall*); // _28 (weak) - virtual void procOffWallMsg(AICreature*, MsgOffWall*); // _2C (weak) - virtual void procUserMsg(AICreature*, MsgUser*); // _30 (weak) - virtual void procGroundMsg(AICreature*, MsgGround*); // _34 (weak) -}; - -/** - * @brief TODO - */ -struct SAICollideEvent : public Receiver { - virtual void procCollideMsg(AICreature*, MsgCollide*); // _1C -}; - -#endif diff --git a/unsorted_include_todo/SAIGroundEvent.h b/unsorted_include_todo/SAIGroundEvent.h deleted file mode 100644 index 98db63c2..00000000 --- a/unsorted_include_todo/SAIGroundEvent.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _SAIGROUNDEVENT_H -#define _SAIGROUNDEVENT_H - -/** - * .obj __vt__14SAIGroundEvent, global - * .4byte __RTTI__14SAIGroundEvent - * .4byte 0 - * .4byte "procMsg__22Receiver<10AICreature>FP10AICreatureP3Msg" - * .4byte "procBounceMsg__22Receiver<10AICreature>FP10AICreatureP9MsgBounce" - * .4byte "procStickMsg__22Receiver<10AICreature>FP10AICreatureP8MsgStick" - * .4byte "procHangMsg__22Receiver<10AICreature>FP10AICreatureP7MsgHang" - * .4byte "procTargetMsg__22Receiver<10AICreature>FP10AICreatureP9MsgTarget" - * .4byte "procCollideMsg__22Receiver<10AICreature>FP10AICreatureP10MsgCollide" - * .4byte "procAnimMsg__22Receiver<10AICreature>FP10AICreatureP7MsgAnim" - * .4byte "procDamageMsg__22Receiver<10AICreature>FP10AICreatureP9MsgDamage" - * .4byte "procWallMsg__22Receiver<10AICreature>FP10AICreatureP7MsgWall" - * .4byte "procOffWallMsg__22Receiver<10AICreature>FP10AICreatureP10MsgOffWall" - * .4byte "procUserMsg__22Receiver<10AICreature>FP10AICreatureP7MsgUser" - * .4byte procGroundMsg__14SAIGroundEventFP10AICreatureP9MsgGround - */ - -struct Receiver { - virtual void procMsg(AICreature*, Msg*); // _08 (weak) - virtual void procBounceMsg(AICreature*, MsgBounce*); // _0C (weak) - virtual void procStickMsg(AICreature*, MsgStick*); // _10 (weak) - virtual void procHangMsg(AICreature*, MsgHang*); // _14 (weak) - virtual void procTargetMsg(AICreature*, MsgTarget*); // _18 (weak) - virtual void procCollideMsg(AICreature*, MsgCollide*); // _1C (weak) - virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 (weak) - virtual void procDamageMsg(AICreature*, MsgDamage*); // _24 (weak) - virtual void procWallMsg(AICreature*, MsgWall*); // _28 (weak) - virtual void procOffWallMsg(AICreature*, MsgOffWall*); // _2C (weak) - virtual void procUserMsg(AICreature*, MsgUser*); // _30 (weak) -}; - -/** - * @brief TODO - */ -struct SAIGroundEvent : public Receiver { - virtual void procGroundMsg(AICreature*, MsgGround*); // _34 -}; - -#endif diff --git a/unsorted_include_todo/SAIMotionAction0Event.h b/unsorted_include_todo/SAIMotionAction0Event.h deleted file mode 100644 index 5e9681ed..00000000 --- a/unsorted_include_todo/SAIMotionAction0Event.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _SAIMOTIONACTION0EVENT_H -#define _SAIMOTIONACTION0EVENT_H - -/** - * .obj __vt__21SAIMotionAction0Event, global - * .4byte __RTTI__21SAIMotionAction0Event - * .4byte 0 - * .4byte "procMsg__22Receiver<10AICreature>FP10AICreatureP3Msg" - * .4byte "procBounceMsg__22Receiver<10AICreature>FP10AICreatureP9MsgBounce" - * .4byte "procStickMsg__22Receiver<10AICreature>FP10AICreatureP8MsgStick" - * .4byte "procHangMsg__22Receiver<10AICreature>FP10AICreatureP7MsgHang" - * .4byte "procTargetMsg__22Receiver<10AICreature>FP10AICreatureP9MsgTarget" - * .4byte "procCollideMsg__22Receiver<10AICreature>FP10AICreatureP10MsgCollide" - * .4byte procAnimMsg__21SAIMotionAction0EventFP10AICreatureP7MsgAnim - * .4byte "procDamageMsg__22Receiver<10AICreature>FP10AICreatureP9MsgDamage" - * .4byte "procWallMsg__22Receiver<10AICreature>FP10AICreatureP7MsgWall" - * .4byte "procOffWallMsg__22Receiver<10AICreature>FP10AICreatureP10MsgOffWall" - * .4byte "procUserMsg__22Receiver<10AICreature>FP10AICreatureP7MsgUser" - * .4byte "procGroundMsg__22Receiver<10AICreature>FP10AICreatureP9MsgGround" - */ - -struct Receiver { - virtual void procMsg(AICreature*, Msg*); // _08 (weak) - virtual void procBounceMsg(AICreature*, MsgBounce*); // _0C (weak) - virtual void procStickMsg(AICreature*, MsgStick*); // _10 (weak) - virtual void procHangMsg(AICreature*, MsgHang*); // _14 (weak) - virtual void procTargetMsg(AICreature*, MsgTarget*); // _18 (weak) - virtual void procCollideMsg(AICreature*, MsgCollide*); // _1C (weak) - virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 - virtual void procDamageMsg(AICreature*, MsgDamage*); // _24 (weak) - virtual void procWallMsg(AICreature*, MsgWall*); // _28 (weak) - virtual void procOffWallMsg(AICreature*, MsgOffWall*); // _2C (weak) - virtual void procUserMsg(AICreature*, MsgUser*); // _30 (weak) - virtual void procGroundMsg(AICreature*, MsgGround*); // _34 (weak) -}; - -/** - * @brief TODO - */ -struct SAIMotionAction0Event : public Receiver { - virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 -}; - -#endif diff --git a/unsorted_include_todo/SAIMotionDoneEvent.h b/unsorted_include_todo/SAIMotionDoneEvent.h deleted file mode 100644 index 8f1e4cfe..00000000 --- a/unsorted_include_todo/SAIMotionDoneEvent.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _SAIMOTIONDONEEVENT_H -#define _SAIMOTIONDONEEVENT_H - -/** - * .obj __vt__18SAIMotionDoneEvent, global - * .4byte __RTTI__18SAIMotionDoneEvent - * .4byte 0 - * .4byte "procMsg__22Receiver<10AICreature>FP10AICreatureP3Msg" - * .4byte "procBounceMsg__22Receiver<10AICreature>FP10AICreatureP9MsgBounce" - * .4byte "procStickMsg__22Receiver<10AICreature>FP10AICreatureP8MsgStick" - * .4byte "procHangMsg__22Receiver<10AICreature>FP10AICreatureP7MsgHang" - * .4byte "procTargetMsg__22Receiver<10AICreature>FP10AICreatureP9MsgTarget" - * .4byte "procCollideMsg__22Receiver<10AICreature>FP10AICreatureP10MsgCollide" - * .4byte procAnimMsg__18SAIMotionDoneEventFP10AICreatureP7MsgAnim - * .4byte "procDamageMsg__22Receiver<10AICreature>FP10AICreatureP9MsgDamage" - * .4byte "procWallMsg__22Receiver<10AICreature>FP10AICreatureP7MsgWall" - * .4byte "procOffWallMsg__22Receiver<10AICreature>FP10AICreatureP10MsgOffWall" - * .4byte "procUserMsg__22Receiver<10AICreature>FP10AICreatureP7MsgUser" - * .4byte "procGroundMsg__22Receiver<10AICreature>FP10AICreatureP9MsgGround" - */ - -struct Receiver { - virtual void procMsg(AICreature*, Msg*); // _08 (weak) - virtual void procBounceMsg(AICreature*, MsgBounce*); // _0C (weak) - virtual void procStickMsg(AICreature*, MsgStick*); // _10 (weak) - virtual void procHangMsg(AICreature*, MsgHang*); // _14 (weak) - virtual void procTargetMsg(AICreature*, MsgTarget*); // _18 (weak) - virtual void procCollideMsg(AICreature*, MsgCollide*); // _1C (weak) - virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 - virtual void procDamageMsg(AICreature*, MsgDamage*); // _24 (weak) - virtual void procWallMsg(AICreature*, MsgWall*); // _28 (weak) - virtual void procOffWallMsg(AICreature*, MsgOffWall*); // _2C (weak) - virtual void procUserMsg(AICreature*, MsgUser*); // _30 (weak) - virtual void procGroundMsg(AICreature*, MsgGround*); // _34 (weak) -}; - -/** - * @brief TODO - */ -struct SAIMotionDoneEvent : public Receiver { - virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 -}; - -#endif diff --git a/unsorted_include_todo/SAIMotionLoopEndEvent.h b/unsorted_include_todo/SAIMotionLoopEndEvent.h deleted file mode 100644 index 62fc93d2..00000000 --- a/unsorted_include_todo/SAIMotionLoopEndEvent.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _SAIMOTIONLOOPENDEVENT_H -#define _SAIMOTIONLOOPENDEVENT_H - -/** - * .obj __vt__21SAIMotionLoopEndEvent, global - * .4byte __RTTI__21SAIMotionLoopEndEvent - * .4byte 0 - * .4byte "procMsg__22Receiver<10AICreature>FP10AICreatureP3Msg" - * .4byte "procBounceMsg__22Receiver<10AICreature>FP10AICreatureP9MsgBounce" - * .4byte "procStickMsg__22Receiver<10AICreature>FP10AICreatureP8MsgStick" - * .4byte "procHangMsg__22Receiver<10AICreature>FP10AICreatureP7MsgHang" - * .4byte "procTargetMsg__22Receiver<10AICreature>FP10AICreatureP9MsgTarget" - * .4byte "procCollideMsg__22Receiver<10AICreature>FP10AICreatureP10MsgCollide" - * .4byte procAnimMsg__21SAIMotionLoopEndEventFP10AICreatureP7MsgAnim - * .4byte "procDamageMsg__22Receiver<10AICreature>FP10AICreatureP9MsgDamage" - * .4byte "procWallMsg__22Receiver<10AICreature>FP10AICreatureP7MsgWall" - * .4byte "procOffWallMsg__22Receiver<10AICreature>FP10AICreatureP10MsgOffWall" - * .4byte "procUserMsg__22Receiver<10AICreature>FP10AICreatureP7MsgUser" - * .4byte "procGroundMsg__22Receiver<10AICreature>FP10AICreatureP9MsgGround" - */ - -struct Receiver { - virtual void procMsg(AICreature*, Msg*); // _08 (weak) - virtual void procBounceMsg(AICreature*, MsgBounce*); // _0C (weak) - virtual void procStickMsg(AICreature*, MsgStick*); // _10 (weak) - virtual void procHangMsg(AICreature*, MsgHang*); // _14 (weak) - virtual void procTargetMsg(AICreature*, MsgTarget*); // _18 (weak) - virtual void procCollideMsg(AICreature*, MsgCollide*); // _1C (weak) - virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 - virtual void procDamageMsg(AICreature*, MsgDamage*); // _24 (weak) - virtual void procWallMsg(AICreature*, MsgWall*); // _28 (weak) - virtual void procOffWallMsg(AICreature*, MsgOffWall*); // _2C (weak) - virtual void procUserMsg(AICreature*, MsgUser*); // _30 (weak) - virtual void procGroundMsg(AICreature*, MsgGround*); // _34 (weak) -}; - -/** - * @brief TODO - */ -struct SAIMotionLoopEndEvent : public Receiver { - virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 -}; - -#endif diff --git a/unsorted_include_todo/SAIMotionLoopStartEvent.h b/unsorted_include_todo/SAIMotionLoopStartEvent.h deleted file mode 100644 index e76eba24..00000000 --- a/unsorted_include_todo/SAIMotionLoopStartEvent.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _SAIMOTIONLOOPSTARTEVENT_H -#define _SAIMOTIONLOOPSTARTEVENT_H - -/** - * .obj __vt__23SAIMotionLoopStartEvent, global - * .4byte __RTTI__23SAIMotionLoopStartEvent - * .4byte 0 - * .4byte "procMsg__22Receiver<10AICreature>FP10AICreatureP3Msg" - * .4byte "procBounceMsg__22Receiver<10AICreature>FP10AICreatureP9MsgBounce" - * .4byte "procStickMsg__22Receiver<10AICreature>FP10AICreatureP8MsgStick" - * .4byte "procHangMsg__22Receiver<10AICreature>FP10AICreatureP7MsgHang" - * .4byte "procTargetMsg__22Receiver<10AICreature>FP10AICreatureP9MsgTarget" - * .4byte "procCollideMsg__22Receiver<10AICreature>FP10AICreatureP10MsgCollide" - * .4byte procAnimMsg__23SAIMotionLoopStartEventFP10AICreatureP7MsgAnim - * .4byte "procDamageMsg__22Receiver<10AICreature>FP10AICreatureP9MsgDamage" - * .4byte "procWallMsg__22Receiver<10AICreature>FP10AICreatureP7MsgWall" - * .4byte "procOffWallMsg__22Receiver<10AICreature>FP10AICreatureP10MsgOffWall" - * .4byte "procUserMsg__22Receiver<10AICreature>FP10AICreatureP7MsgUser" - * .4byte "procGroundMsg__22Receiver<10AICreature>FP10AICreatureP9MsgGround" - */ - -struct Receiver { - virtual void procMsg(AICreature*, Msg*); // _08 (weak) - virtual void procBounceMsg(AICreature*, MsgBounce*); // _0C (weak) - virtual void procStickMsg(AICreature*, MsgStick*); // _10 (weak) - virtual void procHangMsg(AICreature*, MsgHang*); // _14 (weak) - virtual void procTargetMsg(AICreature*, MsgTarget*); // _18 (weak) - virtual void procCollideMsg(AICreature*, MsgCollide*); // _1C (weak) - virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 - virtual void procDamageMsg(AICreature*, MsgDamage*); // _24 (weak) - virtual void procWallMsg(AICreature*, MsgWall*); // _28 (weak) - virtual void procOffWallMsg(AICreature*, MsgOffWall*); // _2C (weak) - virtual void procUserMsg(AICreature*, MsgUser*); // _30 (weak) - virtual void procGroundMsg(AICreature*, MsgGround*); // _34 (weak) -}; - -/** - * @brief TODO - */ -struct SAIMotionLoopStartEvent : public Receiver { - virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 -}; - -#endif diff --git a/unsorted_include_todo/SAIUserEvent.h b/unsorted_include_todo/SAIUserEvent.h deleted file mode 100644 index ae538fda..00000000 --- a/unsorted_include_todo/SAIUserEvent.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _SAIUSEREVENT_H -#define _SAIUSEREVENT_H - -/** - * .obj __vt__12SAIUserEvent, global - * .4byte __RTTI__12SAIUserEvent - * .4byte 0 - * .4byte "procMsg__22Receiver<10AICreature>FP10AICreatureP3Msg" - * .4byte "procBounceMsg__22Receiver<10AICreature>FP10AICreatureP9MsgBounce" - * .4byte "procStickMsg__22Receiver<10AICreature>FP10AICreatureP8MsgStick" - * .4byte "procHangMsg__22Receiver<10AICreature>FP10AICreatureP7MsgHang" - * .4byte "procTargetMsg__22Receiver<10AICreature>FP10AICreatureP9MsgTarget" - * .4byte "procCollideMsg__22Receiver<10AICreature>FP10AICreatureP10MsgCollide" - * .4byte "procAnimMsg__22Receiver<10AICreature>FP10AICreatureP7MsgAnim" - * .4byte "procDamageMsg__22Receiver<10AICreature>FP10AICreatureP9MsgDamage" - * .4byte "procWallMsg__22Receiver<10AICreature>FP10AICreatureP7MsgWall" - * .4byte "procOffWallMsg__22Receiver<10AICreature>FP10AICreatureP10MsgOffWall" - * .4byte procUserMsg__12SAIUserEventFP10AICreatureP7MsgUser - * .4byte "procGroundMsg__22Receiver<10AICreature>FP10AICreatureP9MsgGround" - */ - -struct Receiver { - virtual void procMsg(AICreature*, Msg*); // _08 (weak) - virtual void procBounceMsg(AICreature*, MsgBounce*); // _0C (weak) - virtual void procStickMsg(AICreature*, MsgStick*); // _10 (weak) - virtual void procHangMsg(AICreature*, MsgHang*); // _14 (weak) - virtual void procTargetMsg(AICreature*, MsgTarget*); // _18 (weak) - virtual void procCollideMsg(AICreature*, MsgCollide*); // _1C (weak) - virtual void procAnimMsg(AICreature*, MsgAnim*); // _20 (weak) - virtual void procDamageMsg(AICreature*, MsgDamage*); // _24 (weak) - virtual void procWallMsg(AICreature*, MsgWall*); // _28 (weak) - virtual void procOffWallMsg(AICreature*, MsgOffWall*); // _2C (weak) - virtual void procUserMsg(AICreature*, MsgUser*); // _30 - virtual void procGroundMsg(AICreature*, MsgGround*); // _34 (weak) -}; - -/** - * @brief TODO - */ -struct SAIUserEvent : public Receiver { - virtual void procUserMsg(AICreature*, MsgUser*); // _30 -}; - -#endif diff --git a/unsorted_include_todo/WingArranger.h b/unsorted_include_todo/WingArranger.h deleted file mode 100644 index a15721e9..00000000 --- a/unsorted_include_todo/WingArranger.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _WINGARRANGER_H -#define _WINGARRANGER_H - -/** - * .obj __vt__12WingArranger, global - * .4byte __RTTI__12WingArranger - * .4byte 0 - * .4byte arrange__12WingArrangerFP12FormationMgr - * .4byte getLength__12FormArrangerFP12FormationMgr - */ - -struct FormArranger { - virtual void arrange(FormationMgr*); // _08 - virtual void getLength(FormationMgr*); // _0C -}; - -/** - * @brief TODO - */ -struct WingArranger : public FormArranger { - virtual void arrange(FormationMgr*); // _08 -}; - -#endif