some initial PikiAI work
Some checks failed
Build / build (GPIE01_01) (push) Has been cancelled

This commit is contained in:
Dean Southwood 2024-11-02 01:25:09 +11:00
parent cdb9d7e497
commit 4653a4cf21
8 changed files with 433 additions and 1661 deletions

View File

@ -55,6 +55,7 @@ enum CreatureFlags {
CF_Unk19 = 1 << 19, // 0x80000, use result flags maybe?
CF_Unk20 = 1 << 20, // 0x100000
CF_FixPosition = 1 << 21, // 0x200000
CF_Unk22 = 1 << 22, // 0x400000
};
/**

View File

@ -154,7 +154,8 @@ struct Piki : public Creature, public PaniAnimKeyListener {
// _2B8 = PaniAnimKeyListener
u8 _2BC[0x354 - 0x2BC]; // _2BC, TODO: work out members
PaniPikiAnimMgr mPikiAnimMgr; // _354
u8 _400[0x408 - 0x400]; // _400, unknown
u8 _400; // _400
u8 _401[0x408 - 0x401]; // _401, unknown
u8 _408; // _408
u8 _409; // _409
u8 _40A[0x424 - 0x40A]; // _40A, unknown

View File

@ -6,11 +6,28 @@
#include "Piki.h"
#include "Receiver.h"
#include "SlotChangeListner.h"
#include "stl/stdio.h"
struct Pebble;
struct RockGen;
namespace zen {
struct particleGenerator;
} // namespace zen
/**
* @brief TODO
*/
enum ActionResults {
ACTOUT_Unk0 = 0,
ACTOUT_Unk1 = 1,
ACTOUT_Success = 2,
};
namespace Reaction {
extern char* info[9];
} // namespace Reaction
/**
* @brief TODO
*
@ -18,21 +35,6 @@ struct particleGenerator;
*/
struct Action : public Receiver<Piki> {
/**
* @brief TODO
*/
struct Child {
Child();
~Child();
void initialise(Creature*);
// TODO: members
u32 _00; // _00, unknown
u32 _04; // _04, unknown
};
/**
* @brief TODO
*/
@ -43,19 +45,47 @@ struct Action : public Receiver<Piki> {
// TODO: members
};
/**
* @brief TODO
*/
struct Child {
Child()
{
mAction = nullptr;
mInitialiser = nullptr;
}
~Child()
{
if (mAction) {
delete mAction;
}
if (mInitialiser) {
delete mInitialiser;
}
}
void initialise(Creature*);
// TODO: members
Action* mAction; // _00
Initialiser* mInitialiser; // _04
};
Action(Piki*, bool);
virtual void defaultInitialiser(); // _38 (weak)
virtual void dump(); // _3C (weak)
virtual void draw(struct Graphics&); // _40 (weak)
virtual ~Action(); // _44
virtual void init(Creature*); // _48
virtual int exec(); // _4C
virtual void cleanup(); // _50
virtual void resume(); // _54 (weak)
virtual void restart(); // _58 (weak)
virtual bool resumable(); // _5C (weak)
virtual void getInfo(char*); // _60 (weak)
virtual void defaultInitialiser() { } // _38 (weak)
virtual void dump() { } // _3C (weak)
virtual void draw(struct Graphics&) { } // _40 (weak)
virtual ~Action(); // _44
virtual void init(Creature*); // _48
virtual int exec(); // _4C
virtual void cleanup(); // _50
virtual void resume() { } // _54 (weak)
virtual void restart() { } // _58 (weak)
virtual bool resumable() { return false; } // _5C (weak)
virtual void getInfo(char* out) { sprintf(out, "-"); } // _60 (weak)
void procMsg(Msg*); // this isn't overridden in the vtable but it exists, idk.
void setChildren(int, ...);
@ -65,9 +95,11 @@ struct Action : public Receiver<Piki> {
inline void initialiseChildAction(Creature* creature) { getChild(mChildActionIdx)->initialise(creature); }
// _00 = VTBL
Child* mChildActions; // _04
Child* mChildActions; // _04, array of mChildCount Children
s16 mChildActionIdx; // _08
u8 _0A[0x14 - 0xA]; // _0A, TODO: work out members
s16 mChildCount; // _0A
Piki* mActor; // _0C
char* mName; // _10
};
/**
@ -79,13 +111,13 @@ struct AndAction : public Action {
{
}
virtual ~AndAction(); // _44 (weak)
virtual ~AndAction() { } // _44 (weak)
virtual void init(Creature*); // _48
virtual int exec(); // _4C
// _00 = VTBL
// _00-_14 = Action
u32 _14; // _14, unknown
Creature* _14; // _14
};
/**
@ -94,13 +126,13 @@ struct AndAction : public Action {
struct OrAction : public Action {
inline OrAction(); // TODO: probably
virtual ~OrAction(); // _44 (weak)
virtual ~OrAction() { } // _44 (weak)
virtual void init(Creature*); // _48
virtual int exec(); // _4C
// _00 = VTBL
// _00-_14 = Action
// TODO: members
Creature* _14; // _14
};
/**
@ -110,12 +142,19 @@ struct TopAction : public Action {
/**
* @brief TODO
*
* @note Size: 0x8.
*/
struct MotionListener : public PaniAnimKeyListener {
MotionListener(TopAction* action)
: mAction(action)
{
}
virtual void animationKeyUpdated(PaniAnimKeyEvent&); // _08
// _00 = VTBL
// TODO: members
TopAction* mAction; // _04
};
/**
@ -129,8 +168,8 @@ struct TopAction : public Action {
void addBoredom(int, f32);
void update();
u32 _00; // _00, unknown (pointer?)
u32 _04; // _04, unknown (pointer?)
u32* _00; // _00, unknown (pointer?)
u32* _04; // _04, unknown (pointer?)
u8* _08; // _08, array of size _10, might be bools
u32 _0C; // _0C, unknown
int mCnt; // _10, count of objects in _00, _04, _08 arrays
@ -150,7 +189,7 @@ struct TopAction : public Action {
void draw2d(Graphics&, int);
ObjBore* mObjects; // _00, array of mObjectCnt objects
u32 _04; // _04, unknown (pointer?)
u32* _04; // _04, unknown (pointer?)
u32 _08; // _08, unknown
int mObjectCnt; // _0C, number of mObjects
u32 _10; // _10, unknown
@ -158,14 +197,22 @@ struct TopAction : public Action {
TopAction(Piki*);
virtual void draw(Graphics&); // _40
virtual void getInfo(char* out) // _60
{
mChildActions[mChildActionIdx].mAction->getInfo(out);
}
virtual void draw(Graphics& gfx) // _40
{
if (_18) {
mChildActions[mChildActionIdx].mAction->draw(gfx);
}
}
virtual ~TopAction(); // _44
virtual void init(Creature*); // _48
virtual int exec(); // _4C
virtual void resume(); // _54
virtual void restart(); // _58
virtual bool resumable(); // _5C
virtual void getInfo(char*); // _60
void abandon(zen::particleGenerator*);
@ -174,7 +221,16 @@ struct TopAction : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
MotionListener* mListener; // _14
u8 _18; // _18
u8 _19; // _19
u8 _1A; // _1A
int _1C; // _1C
Creature* _20; // _20
int _24; // _24
u32 _28; // _28, unknown
f32 _2C; // _2C
Boredom _30; // _30
};
/**
@ -207,6 +263,8 @@ struct ActAdjust : public Action {
/**
* @brief TODO
*
* @note Size: 0x2C.
*/
struct ActAttack : public AndAction, public PaniAnimKeyListener {
ActAttack(Piki*);
@ -228,11 +286,13 @@ struct ActAttack : public AndAction, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_18 = AndAction
// _18 = PaniAnimKeyListener
// TODO: members
u8 _1C[0x2C - 0x1C]; // _14, unknown
};
/**
* @brief TODO
*
* @note Size: 0x24.
*/
struct ActBoMake : public Action {
ActBoMake(Piki*);
@ -248,8 +308,9 @@ struct ActBoMake : public Action {
void initWork();
int exeWork();
// _00 = VTBL
// TODO: members
// _00 = VTBL
// _00-_14 = Action
u8 _14[0x24 - 0x14]; // _14, unknown
};
/**
@ -354,6 +415,8 @@ struct ActBoreTalk : public Action, public PaniAnimKeyListener {
/**
* @brief TODO
*
* @note Size: 0x34.
*/
struct ActBou : public Action {
ActBou(Piki*);
@ -369,11 +432,13 @@ struct ActBou : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
u8 _14[0x34 - 0x14]; // _14, unknown
};
/**
* @brief TODO
*
* @note Size: 0x34.
*/
struct ActBreakWall : public Action, public PaniAnimKeyListener {
ActBreakWall(Piki*);
@ -393,11 +458,13 @@ struct ActBreakWall : public Action, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u8 _18[0x34 - 0x18]; // _18, unknown
};
/**
* @brief TODO
*
* @note Size: 0x58.
*/
struct ActBridge : public Action, public PaniAnimKeyListener {
ActBridge(Piki*);
@ -435,11 +502,13 @@ struct ActBridge : public Action, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u8 _18[0x58 - 0x18]; // _18, unknown
};
/**
* @brief TODO
*
* @note Size: 0x1C.
*/
struct ActChase : public Action {
@ -462,11 +531,13 @@ struct ActChase : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
u8 _14[0x1C - 0x14]; // _14, unknown
};
/**
* @brief TODO
*
* @note Size: 0x88.
*/
struct ActCrowd : public Action, public SlotChangeListner {
ActCrowd(Piki*);
@ -494,12 +565,14 @@ struct ActCrowd : public Action, public SlotChangeListner {
// _00 = VTBL
// _00-_14 = Action
// _18 = SlotChangeListner
// TODO: members
// _14 = SlotChangeListner
u8 _18[0x88 - 0x18]; // _18, unknown
};
/**
* @brief TODO
*
* @note Size: 0x20.
*/
struct ActDecoy : public Action, public PaniAnimKeyListener {
ActDecoy(Piki*);
@ -518,7 +591,7 @@ struct ActDecoy : public Action, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u8 _18[0x20 - 0x18]; // _18, unknown
};
/**
@ -550,6 +623,8 @@ struct ActDeliver : public AndAction {
/**
* @brief TODO
*
* @note Size: 0x30.
*/
struct ActEnter : public Action {
ActEnter(Piki*);
@ -569,11 +644,13 @@ struct ActEnter : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
u8 _14[0x30 - 0x14]; // _14, unknown
};
/**
* @brief TODO
*
* @note Size: 0x30.
*/
struct ActEscape : public Action {
@ -597,11 +674,13 @@ struct ActEscape : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
u8 _14[0x30 - 0x14]; // _14, unknown
};
/**
* @brief TODO
*
* @note Size: 0x24.
*/
struct ActExit : public Action {
ActExit(Piki*);
@ -614,7 +693,7 @@ struct ActExit : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
u8 _14[0x24 - 0x14]; // _14, unknown
};
/**
@ -637,6 +716,8 @@ struct ActFlower : public Action, public PaniAnimKeyListener {
/**
* @brief TODO
*
* @note Size: 0x34.
*/
struct ActFormation : public Action, public PaniAnimKeyListener {
ActFormation(Piki*);
@ -652,11 +733,13 @@ struct ActFormation : public Action, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u8 _18[0x34 - 0x18]; // _18, unknown
};
/**
* @brief TODO
*
* @note Size: 0x50.
*/
struct ActFree : public Action, public PaniAnimKeyListener {
ActFree(Piki*);
@ -675,7 +758,7 @@ struct ActFree : public Action, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u8 _18[0x50 - 0x18]; // _18
};
/**
@ -700,6 +783,8 @@ struct ActFreeSelect : public Action {
/**
* @brief TODO
*
* @note Size: 0x24.
*/
struct ActGoto : public Action {
@ -723,11 +808,13 @@ struct ActGoto : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
u8 _14[0x24 - 0x14]; // _14, unknown
};
/**
* @brief TODO
*
* @note Size: 0x4C.
*/
struct ActGuard : public Action {
ActGuard(Piki*);
@ -749,7 +836,7 @@ struct ActGuard : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
u8 _14[0x4C - 0x14]; // _14, unknown
};
/**
@ -782,6 +869,8 @@ struct ActJumpAttack : public Action, public PaniAnimKeyListener {
/**
* @brief TODO
*
* @note Size: 0x38.
*/
struct ActKinoko : public Action, public PaniAnimKeyListener {
ActKinoko(Piki*);
@ -806,11 +895,13 @@ struct ActKinoko : public Action, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u8 _18[0x38 - 0x18]; // _18, unknown
};
/**
* @brief TODO
*
* @note Size: 0x30.
*/
struct ActMine : public Action, public PaniAnimKeyListener {
ActMine(Piki*);
@ -833,7 +924,7 @@ struct ActMine : public Action, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u8 _18[0x30 - 0x18]; // _18, unknown
};
/**
@ -867,6 +958,8 @@ struct ActPick : public Action, public PaniAnimKeyListener {
/**
* @brief TODO
*
* @note Size: 0x1C.
*/
struct ActPickCreature : public AndAction {
@ -885,11 +978,13 @@ struct ActPickCreature : public AndAction {
// _00 = VTBL
// _00-_18 = AndAction
// TODO: members
u8 _18[0x1C - 0x18]; // _18, unknown
};
/**
* @brief TODO
*
* @note Size: 0x1C.
*/
struct ActPickItem : public AndAction {
ActPickItem(Piki*);
@ -903,11 +998,13 @@ struct ActPickItem : public AndAction {
// _00 = VTBL
// _00-_18 = AndAction
// TODO: members
u8 _18[0x1C - 0x18]; // _18, unknown
};
/**
* @brief TODO
*
* @note Size: 0x1C.
*/
struct ActPullout : public Action {
ActPullout(Piki*);
@ -919,7 +1016,7 @@ struct ActPullout : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
u8 _14[0x1C - 0x14]; // _14, unknown
};
/**
@ -942,6 +1039,8 @@ struct ActPulloutCreature : public Action, public PaniAnimKeyListener {
/**
* @brief TODO
*
* @note Size: 0x50.
*/
struct ActPush : public Action, public PaniAnimKeyListener {
ActPush(Piki*);
@ -963,7 +1062,7 @@ struct ActPush : public Action, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u8 _18[0x50 - 0x18]; // _18, unknown
};
/**
@ -995,6 +1094,8 @@ struct ActPut : public Action {
/**
* @brief TODO
*
* @note Size: 0x30.
*/
struct ActPutBomb : public Action, public PaniAnimKeyListener {
ActPutBomb(Piki*);
@ -1024,11 +1125,13 @@ struct ActPutBomb : public Action, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u8 _18[0x30 - 0x18]; // _18, unknown
};
/**
* @brief TODO
*
* @note Size: 0x24.
*/
struct ActPutItem : public Action {
ActPutItem(Piki*);
@ -1043,11 +1146,13 @@ struct ActPutItem : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
u8 _14[0x24 - 0x14]; // _14, unknown
};
/**
* @brief TODO
*
* @note Size: 0x28.
*/
struct ActRandomBoid : public Action {
@ -1081,11 +1186,13 @@ struct ActRandomBoid : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
u8 _14[0x28 - 0x14]; // _14, unknown
};
/**
* @brief TODO
*
* @note Size: 0x3C.
*/
struct ActRescue : public Action, public PaniAnimKeyListener {
ActRescue(Piki*);
@ -1108,11 +1215,13 @@ struct ActRescue : public Action, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u8 _18[0x3C - 0x18]; // _18, unknown
};
/**
* @brief TODO
*
* @note Size: 0x24.
*/
struct ActRope : public Action {
ActRope(Piki*);
@ -1124,11 +1233,13 @@ struct ActRope : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
u8 _14[0x24 - 0x14]; // _14, unknown
};
/**
* @brief TODO
*
* @note Size: 0x28.
*/
struct ActShoot : public AndAction {
ActShoot(Piki*);
@ -1145,7 +1256,7 @@ struct ActShoot : public AndAction {
// _00 = VTBL
// _00-_18 = AndAction
// TODO: members
u8 _18[0x28 - 0x18]; // _18, unknown
};
/**
@ -1168,8 +1279,20 @@ struct ActShootCreature : public Action, public PaniAnimKeyListener {
/**
* @brief TODO
*
* @note Size: 0x2C.
*/
struct ActStone : public Action, public PaniAnimKeyListener {
/**
* @brief TODO
*/
enum State {
STATE_Approach = 0,
STATE_Adjust = 1,
STATE_Attack = 2,
};
ActStone(Piki*);
virtual ~ActStone(); // _44
@ -1179,20 +1302,26 @@ struct ActStone : public Action, public PaniAnimKeyListener {
virtual void animationKeyUpdated(PaniAnimKeyEvent&); // _70
void initApproach();
void exeApproach();
int exeApproach();
void initAdjust();
void exeAdjust();
int exeAdjust();
void initAttack();
void exeAttack();
int exeAttack();
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u16 mState; // _18
u8 _1A[0x20 - 0x1A]; // _18, unknown
Pebble* mCurrPebble; // _20, unknown
RockGen* mRockGen; // _24
u8 _28; // _28
};
/**
* @brief TODO
*
* @note Size: 0xC0.
*/
struct ActTransport : public Action, public PaniAnimKeyListener {
ActTransport(Piki*);
@ -1234,11 +1363,13 @@ struct ActTransport : public Action, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u8 _18[0xC0 - 0x18]; // _18, unknown
};
/**
* @brief TODO
*
* @note Size: 0x2C.
*/
struct ActWatch : public Action {
@ -1272,11 +1403,13 @@ struct ActWatch : public Action {
// _00 = VTBL
// _00-_14 = Action
// TODO: members
u8 _14[0x2C - 0x14]; // _14, unknown
};
/**
* @brief TODO
*
* @note Size: 0x2C.
*/
struct ActWeed : public Action, public PaniAnimKeyListener {
ActWeed(Piki*);
@ -1297,7 +1430,7 @@ struct ActWeed : public Action, public PaniAnimKeyListener {
// _00 = VTBL
// _00-_14 = Action
// _14 = PaniAnimKeyListener
// TODO: members
u8 _18[0x2C - 0x18]; // _18, unknown
};
/**

View File

@ -72,7 +72,7 @@ struct RockGen : public ItemCreature {
void create(int, f32, int);
void setSizeAndNum(f32, int);
void killPebble();
void getRandomPebble();
Pebble* getRandomPebble();
// _00 = VTBL
// _00-_304 = ItemCreature?

File diff suppressed because it is too large Load Diff

View File

@ -85,45 +85,6 @@ ActAttack::ActAttack(Piki* piki)
*/
}
/*
* --INFO--
* Address: 800A83B0
* Size: 000064
*/
AndAction::~AndAction()
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
addi r31, r4, 0
stw r30, 0x10(r1)
mr. r30, r3
beq- .loc_0x48
lis r3, 0x802C
subi r0, r3, 0x7ED0
stw r0, 0x0(r30)
addi r3, r30, 0
li r4, 0
bl 0x1BA24
extsh. r0, r31
ble- .loc_0x48
mr r3, r30
bl -0x61248
.loc_0x48:
mr r3, r30
lwz r0, 0x1C(r1)
lwz r31, 0x14(r1)
lwz r30, 0x10(r1)
addi r1, r1, 0x18
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 800A8414

View File

@ -1,4 +1,5 @@
#include "PikiAI.h"
#include "WeedsItem.h"
/*
* --INFO--
@ -26,32 +27,8 @@ static void _Print(char*, ...)
* Size: 000054
*/
ActStone::ActStone(Piki* piki)
: Action(piki, false)
: Action(piki, true)
{
/*
.loc_0x0:
mflr r0
li r5, 0x1
stw r0, 0x4(r1)
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
addi r31, r3, 0
bl 0x1D024
lis r3, 0x802B
subi r0, r3, 0x246C
lis r3, 0x802B
stw r0, 0x14(r31)
addi r3, r3, 0x4FB0
stw r3, 0x0(r31)
addi r0, r3, 0x64
addi r3, r31, 0
stw r0, 0x14(r31)
lwz r0, 0x1C(r1)
lwz r31, 0x14(r1)
addi r1, r1, 0x18
mtlr r0
blr
*/
}
/*
@ -59,35 +36,15 @@ ActStone::ActStone(Piki* piki)
* Address: 800A6DE8
* Size: 000058
*/
void ActStone::init(Creature*)
void ActStone::init(Creature* creature)
{
/*
.loc_0x0:
mflr r0
cmplwi r4, 0
stw r0, 0x4(r1)
li r0, 0
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
addi r31, r3, 0
stw r0, 0x20(r3)
beq- .loc_0x3C
lwz r0, 0x6C(r4)
cmpwi r0, 0x21
bne- .loc_0x3C
stw r4, 0x24(r31)
lwz r3, 0x24(r31)
bl 0x3D87C
mCurrPebble = nullptr;
if (creature && creature->mObjType == OBJTYPE_RockGen) {
mRockGen = static_cast<RockGen*>(creature);
mRockGen->startWork();
}
.loc_0x3C:
mr r3, r31
bl 0xD8
lwz r0, 0x1C(r1)
lwz r31, 0x14(r1)
addi r1, r1, 0x18
mtlr r0
blr
*/
initApproach();
}
/*
@ -97,52 +54,22 @@ void ActStone::init(Creature*)
*/
int ActStone::exec()
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x8(r1)
lwz r0, 0x20(r3)
cmplwi r0, 0
bne- .loc_0x20
li r3, 0x2
b .loc_0x64
if (mCurrPebble == nullptr) {
return ACTOUT_Success;
}
.loc_0x20:
lhz r0, 0x18(r3)
cmpwi r0, 0x1
beq- .loc_0x50
bge- .loc_0x3C
cmpwi r0, 0
bge- .loc_0x48
b .loc_0x60
switch (mState) {
case STATE_Approach:
return exeApproach();
.loc_0x3C:
cmpwi r0, 0x3
bge- .loc_0x60
b .loc_0x58
case STATE_Adjust:
return exeAdjust();
.loc_0x48:
bl 0xFC
b .loc_0x64
case STATE_Attack:
return exeAttack();
}
.loc_0x50:
bl 0x290
b .loc_0x64
.loc_0x58:
bl 0x4E0
b .loc_0x64
.loc_0x60:
li r3, 0
.loc_0x64:
lwz r0, 0xC(r1)
addi r1, r1, 0x8
mtlr r0
blr
*/
return ACTOUT_Unk0;
}
/*
@ -152,30 +79,11 @@ int ActStone::exec()
*/
void ActStone::cleanup()
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x8(r1)
lwz r4, 0xC(r3)
lwz r0, 0xC8(r4)
rlwinm r0,r0,0,10,8
stw r0, 0xC8(r4)
lwz r4, 0xC(r3)
lwz r0, 0xC8(r4)
rlwinm r0,r0,0,11,9
stw r0, 0xC8(r4)
lwz r3, 0x24(r3)
cmplwi r3, 0
beq- .loc_0x3C
bl 0x3D7C8
.loc_0x3C:
lwz r0, 0xC(r1)
addi r1, r1, 0x8
mtlr r0
blr
*/
mActor->resetCreatureFlag(CF_Unk22);
mActor->resetCreatureFlag(CF_FixPosition);
if (mRockGen) {
mRockGen->finishWork();
}
}
/*
@ -185,46 +93,15 @@ void ActStone::cleanup()
*/
void ActStone::initApproach()
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x28(r1)
stw r31, 0x24(r1)
stw r30, 0x20(r1)
mr r30, r3
lwz r3, 0x24(r3)
cmplwi r3, 0
beq- .loc_0x30
bl 0x3E2E4
stw r3, 0x20(r30)
b .loc_0x38
if (mRockGen) {
mCurrPebble = mRockGen->getRandomPebble();
} else {
mCurrPebble = nullptr;
}
.loc_0x30:
li r0, 0
stw r0, 0x20(r30)
mState = STATE_Approach;
.loc_0x38:
li r0, 0
sth r0, 0x18(r30)
addi r3, r1, 0xC
li r4, 0x2
bl 0x78010
addi r31, r3, 0
addi r3, r1, 0x14
li r4, 0x2
bl 0x78000
mr r4, r3
lwz r3, 0xC(r30)
mr r5, r31
bl 0x23A70
lwz r0, 0x2C(r1)
lwz r31, 0x24(r1)
lwz r30, 0x20(r1)
addi r1, r1, 0x28
mtlr r0
blr
*/
mActor->startMotion(PaniMotionInfo(2), PaniMotionInfo(2));
}
/*
@ -232,7 +109,7 @@ void ActStone::initApproach()
* Address: 800A6F84
* Size: 000190
*/
void ActStone::exeApproach()
int ActStone::exeApproach()
{
/*
.loc_0x0:
@ -358,18 +235,14 @@ void ActStone::exeApproach()
* Address: 800A7114
* Size: 00000C
*/
void ActStone::initAdjust()
{
// Generated from sth r0, 0x18(r3)
// _18 = 1;
}
void ActStone::initAdjust() { mState = STATE_Adjust; }
/*
* --INFO--
* Address: 800A7120
* Size: 0001C4
*/
void ActStone::exeAdjust()
int ActStone::exeAdjust()
{
/*
.loc_0x0:
@ -510,48 +383,10 @@ void ActStone::exeAdjust()
*/
void ActStone::initAttack()
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
li r0, 0x2
stwu r1, -0x30(r1)
stw r31, 0x2C(r1)
stw r30, 0x28(r1)
stw r29, 0x24(r1)
mr. r29, r3
sth r0, 0x18(r3)
mr r30, r29
beq- .loc_0x30
addi r30, r30, 0x14
.loc_0x30:
addi r3, r1, 0x10
li r4, 0x13
bl 0x77C3C
addi r31, r3, 0
addi r5, r30, 0
addi r3, r1, 0x18
li r4, 0x13
bl 0x77C5C
mr r4, r3
lwz r3, 0xC(r29)
mr r5, r31
bl 0x23698
li r0, 0
stb r0, 0x28(r29)
lwz r3, 0xC(r29)
lwz r0, 0xC8(r3)
oris r0, r0, 0x40
stw r0, 0xC8(r3)
lwz r0, 0x34(r1)
lwz r31, 0x2C(r1)
lwz r30, 0x28(r1)
lwz r29, 0x24(r1)
addi r1, r1, 0x30
mtlr r0
blr
*/
mState = STATE_Attack;
mActor->startMotion(PaniMotionInfo(19, this), PaniMotionInfo(19));
_28 = 0;
mActor->setCreatureFlag(CF_Unk22);
}
/*
@ -559,7 +394,7 @@ void ActStone::initAttack()
* Address: 800A7378
* Size: 000174
*/
void ActStone::exeAttack()
int ActStone::exeAttack()
{
/*
.loc_0x0:
@ -934,68 +769,3 @@ ActStone::~ActStone()
blr
*/
}
/*
* --INFO--
* Address: 800A7864
* Size: 000004
*/
void Action::defaultInitialiser() { }
/*
* --INFO--
* Address: 800A7868
* Size: 000004
*/
void Action::dump() { }
/*
* --INFO--
* Address: 800A786C
* Size: 000004
*/
void Action::draw(Graphics&) { }
/*
* --INFO--
* Address: 800A7870
* Size: 000004
*/
void Action::resume() { }
/*
* --INFO--
* Address: 800A7874
* Size: 000004
*/
void Action::restart() { }
/*
* --INFO--
* Address: 800A7878
* Size: 000008
*/
bool Action::resumable() { return false; }
/*
* --INFO--
* Address: 800A7880
* Size: 00002C
*/
void Action::getInfo(char*)
{
/*
.loc_0x0:
mflr r0
addi r3, r4, 0
stw r0, 0x4(r1)
crclr 6, 0x6
subi r4, r13, 0x5098
stwu r1, -0x8(r1)
bl 0x16ED00
lwz r0, 0xC(r1)
addi r1, r1, 0x8
mtlr r0
blr
*/
}

View File

@ -1045,7 +1045,7 @@ f32 RockGen::getSize()
* Address: 800E5208
* Size: 0000E0
*/
void RockGen::getRandomPebble()
Pebble* RockGen::getRandomPebble()
{
/*
.loc_0x0: