mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-06-06 11:37:13 -04:00
Decompile chrFindWaypointWithinPosQuadrant
This commit is contained in:
+13
-5
@@ -1074,13 +1074,21 @@
|
||||
label,
|
||||
|
||||
/**
|
||||
* Only ever called with values 1, 2, 4 and 8. The value is related to circles,
|
||||
* perhaps specifying a certain side of the target chr.
|
||||
* If u1 were 0x10 or 0x20, some other logic would be used (same as previous).
|
||||
* Attempts to find a waypoint within the given quadrant of the current chr's
|
||||
* target then sets the chr's padpreset to the given waypoint's pad number.
|
||||
*
|
||||
* If no waypoint is found, the padpreset is left unchanged and the label is not
|
||||
* followed.
|
||||
*
|
||||
* The exact formula for finding the waypoint is:
|
||||
* 1. Find the closest waypoint to the target regardless of direction
|
||||
* 2. Check if that waypoint or any of its direct neighbours are in the quadrant
|
||||
*
|
||||
* No further checks are done.
|
||||
*/
|
||||
#define try_set_target_pad_to_something2(u1, label) \
|
||||
#define try_set_padpreset_to_target_quadrant(quadrant, label) \
|
||||
mkshort(0x0076), \
|
||||
u1, \
|
||||
quadrant, \
|
||||
label,
|
||||
|
||||
/**
|
||||
|
||||
@@ -2443,6 +2443,13 @@
|
||||
#define PROPTYPE_EXPLOSION 7
|
||||
#define PROPTYPE_EFFECT 8
|
||||
|
||||
#define QUADRANT_BACK 0x01
|
||||
#define QUADRANT_SIDE1 0x02
|
||||
#define QUADRANT_SIDE2 0x04
|
||||
#define QUADRANT_FRONT 0x08
|
||||
#define QUADRANT_10 0x10
|
||||
#define QUADRANT_20 0x20
|
||||
|
||||
#define QUIP_ATTACK1 0
|
||||
#define QUIP_ATTACK2 1
|
||||
#define QUIP_GOTOCOVER1 2
|
||||
|
||||
@@ -185,10 +185,10 @@ f32 chrGetTimer(struct chrdata *chr);
|
||||
bool chrCanSeeTargetWithExtraCheck(struct chrdata *chr);
|
||||
bool chrSawInjury(struct chrdata *chr, u8 arg1);
|
||||
bool chrSawDeath(struct chrdata *chr, u8 arg1);
|
||||
u32 func0f04a2d4(void);
|
||||
s16 func0f04a37c(struct coord *pos, s16 *rooms, f32 angle, u8 arg3);
|
||||
bool waypointIsWithin90DegreesOfPosAngle(struct waypoint *waypoint, struct coord *pos, f32 angle);
|
||||
s32 chrFindWaypointWithinPosQuadrant(struct coord *pos, s16 *rooms, f32 angle, u8 quadrant);
|
||||
u32 func0f04a4ec(struct chrdata *chr, u8 arg1);
|
||||
bool func0f04a674(struct chrdata *chr, u8 arg1);
|
||||
bool chrSetPadPresetToWaypointWithinTargetQuadrant(struct chrdata *chr, u8 arg1);
|
||||
bool func0f04a7dc(u32 chrnum, struct chrdata *chr, f32 distance, s32 padnum);
|
||||
bool func0f04a848(u8 chrnum, struct chrdata *chr, f32 distance, struct coord *pos, s16 *room);
|
||||
u32 chrIsInLoadedRoom(struct chrdata *chr);
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
/*0x0073*/ bool aiIfObjectiveComplete(void);
|
||||
/*0x0074*/ bool aiIfObjectiveFailed(void);
|
||||
/*0x0075*/ bool ai0075(void);
|
||||
/*0x0076*/ bool ai0076(void);
|
||||
/*0x0076*/ bool aiSetPadPresetToTargetQuadrant(void);
|
||||
/*0x0077*/ bool aiIfDifficultyLessThan(void);
|
||||
/*0x0078*/ bool aiIfDifficultyGreaterThan(void);
|
||||
/*0x0079*/ bool aiIfUptimeLessThan(void);
|
||||
|
||||
@@ -24,7 +24,7 @@ u32 func0f1154cc(void);
|
||||
u32 func0f1155e0(void);
|
||||
u32 func0f115784(void);
|
||||
u32 func0f11594c(void);
|
||||
void func0f115a48(u32 *arg0, u32 *arg1);
|
||||
void func0f115a78(u32 *arg0, u32 *arg1);
|
||||
void waypointDisableSegment(struct waypoint *a, struct waypoint *b);
|
||||
void waypointEnableSegment(struct waypoint *a, struct waypoint *b);
|
||||
|
||||
#endif
|
||||
|
||||
+4
-201
@@ -340,6 +340,9 @@ struct modeldata_headspot { // type 0x17
|
||||
|
||||
struct waypoint {
|
||||
s32 padnum;
|
||||
s32 *neighbours; // most significant two bits are booleans, remaining bits are waypoint index
|
||||
s32 groupnum;
|
||||
s32 terminator; // always zero
|
||||
};
|
||||
|
||||
struct aibot014 {
|
||||
@@ -2808,206 +2811,6 @@ struct player {
|
||||
/*0x1c64*/ s32 unk1c64;
|
||||
};
|
||||
|
||||
struct stagesetup00 {
|
||||
/*0x000*/ u32 unk000;
|
||||
/*0x004*/ u32 unk004;
|
||||
/*0x008*/ u32 unk008;
|
||||
/*0x00c*/ u32 unk00c;
|
||||
/*0x010*/ u32 unk010;
|
||||
/*0x014*/ u32 unk014;
|
||||
/*0x018*/ u32 unk018;
|
||||
/*0x01c*/ u32 unk01c;
|
||||
/*0x020*/ u32 unk020;
|
||||
/*0x024*/ u32 unk024;
|
||||
/*0x028*/ u32 unk028;
|
||||
/*0x02c*/ u32 unk02c;
|
||||
/*0x030*/ u32 unk030;
|
||||
/*0x034*/ u32 unk034;
|
||||
/*0x038*/ u32 unk038;
|
||||
/*0x03c*/ u32 unk03c;
|
||||
/*0x040*/ u32 unk040;
|
||||
/*0x044*/ u32 unk044;
|
||||
/*0x048*/ u32 unk048;
|
||||
/*0x04c*/ u32 unk04c;
|
||||
/*0x050*/ u32 unk050;
|
||||
/*0x054*/ u32 unk054;
|
||||
/*0x058*/ u32 unk058;
|
||||
/*0x05c*/ u32 unk05c;
|
||||
/*0x060*/ u32 unk060;
|
||||
/*0x064*/ u32 unk064;
|
||||
/*0x068*/ u32 unk068;
|
||||
/*0x06c*/ u32 unk06c;
|
||||
/*0x070*/ u32 unk070;
|
||||
/*0x074*/ u32 unk074;
|
||||
/*0x078*/ u32 unk078;
|
||||
/*0x07c*/ u32 unk07c;
|
||||
/*0x080*/ u32 unk080;
|
||||
/*0x084*/ u32 unk084;
|
||||
/*0x088*/ u32 unk088;
|
||||
/*0x08c*/ u32 unk08c;
|
||||
/*0x090*/ u32 unk090;
|
||||
/*0x094*/ u32 unk094;
|
||||
/*0x098*/ u32 unk098;
|
||||
/*0x09c*/ u32 unk09c;
|
||||
/*0x0a0*/ u32 unk0a0;
|
||||
/*0x0a4*/ u32 unk0a4;
|
||||
/*0x0a8*/ u32 unk0a8;
|
||||
/*0x0ac*/ u32 unk0ac;
|
||||
/*0x0b0*/ u32 unk0b0;
|
||||
/*0x0b4*/ u32 unk0b4;
|
||||
/*0x0b8*/ u32 unk0b8;
|
||||
/*0x0bc*/ u32 unk0bc;
|
||||
/*0x0c0*/ u32 unk0c0;
|
||||
/*0x0c4*/ u32 unk0c4;
|
||||
/*0x0c8*/ u32 unk0c8;
|
||||
/*0x0cc*/ u32 unk0cc;
|
||||
/*0x0d0*/ u32 unk0d0;
|
||||
/*0x0d4*/ u32 unk0d4;
|
||||
/*0x0d8*/ u32 unk0d8;
|
||||
/*0x0dc*/ u32 unk0dc;
|
||||
/*0x0e0*/ u32 unk0e0;
|
||||
/*0x0e4*/ u32 unk0e4;
|
||||
/*0x0e8*/ u32 unk0e8;
|
||||
/*0x0ec*/ u32 unk0ec;
|
||||
/*0x0f0*/ u32 unk0f0;
|
||||
/*0x0f4*/ u32 unk0f4;
|
||||
/*0x0f8*/ u32 unk0f8;
|
||||
/*0x0fc*/ u32 unk0fc;
|
||||
/*0x100*/ u32 unk100;
|
||||
/*0x104*/ u32 unk104;
|
||||
/*0x108*/ u32 unk108;
|
||||
/*0x10c*/ u32 unk10c;
|
||||
/*0x110*/ u32 unk110;
|
||||
/*0x114*/ u32 unk114;
|
||||
/*0x118*/ u32 unk118;
|
||||
/*0x11c*/ u32 unk11c;
|
||||
/*0x120*/ u32 unk120;
|
||||
/*0x124*/ u32 unk124;
|
||||
/*0x128*/ u32 unk128;
|
||||
/*0x12c*/ u32 unk12c;
|
||||
/*0x130*/ u32 unk130;
|
||||
/*0x134*/ u32 unk134;
|
||||
/*0x138*/ u32 unk138;
|
||||
/*0x13c*/ u32 unk13c;
|
||||
/*0x140*/ u32 unk140;
|
||||
/*0x144*/ u32 unk144;
|
||||
/*0x148*/ u32 unk148;
|
||||
/*0x14c*/ u32 unk14c;
|
||||
/*0x150*/ u32 unk150;
|
||||
/*0x154*/ u32 unk154;
|
||||
/*0x158*/ u32 unk158;
|
||||
/*0x15c*/ u32 unk15c;
|
||||
/*0x160*/ u32 unk160;
|
||||
/*0x164*/ u32 unk164;
|
||||
/*0x168*/ u32 unk168;
|
||||
/*0x16c*/ u32 unk16c;
|
||||
/*0x170*/ u32 unk170;
|
||||
/*0x174*/ u32 unk174;
|
||||
/*0x178*/ u32 unk178;
|
||||
/*0x17c*/ u32 unk17c;
|
||||
/*0x180*/ u32 unk180;
|
||||
/*0x184*/ u32 unk184;
|
||||
/*0x188*/ u32 unk188;
|
||||
/*0x18c*/ u32 unk18c;
|
||||
/*0x190*/ u32 unk190;
|
||||
/*0x194*/ u32 unk194;
|
||||
/*0x198*/ u32 unk198;
|
||||
/*0x19c*/ u32 unk19c;
|
||||
/*0x1a0*/ u32 unk1a0;
|
||||
/*0x1a4*/ u32 unk1a4;
|
||||
/*0x1a8*/ u32 unk1a8;
|
||||
/*0x1ac*/ u32 unk1ac;
|
||||
/*0x1b0*/ u32 unk1b0;
|
||||
/*0x1b4*/ u32 unk1b4;
|
||||
/*0x1b8*/ u32 unk1b8;
|
||||
/*0x1bc*/ u32 unk1bc;
|
||||
/*0x1c0*/ u32 unk1c0;
|
||||
/*0x1c4*/ u32 unk1c4;
|
||||
/*0x1c8*/ u32 unk1c8;
|
||||
/*0x1cc*/ u32 unk1cc;
|
||||
/*0x1d0*/ u32 unk1d0;
|
||||
/*0x1d4*/ u32 unk1d4;
|
||||
/*0x1d8*/ u32 unk1d8;
|
||||
/*0x1dc*/ u32 unk1dc;
|
||||
/*0x1e0*/ u32 unk1e0;
|
||||
/*0x1e4*/ u32 unk1e4;
|
||||
/*0x1e8*/ u32 unk1e8;
|
||||
/*0x1ec*/ u32 unk1ec;
|
||||
/*0x1f0*/ u32 unk1f0;
|
||||
/*0x1f4*/ u32 unk1f4;
|
||||
/*0x1f8*/ u32 unk1f8;
|
||||
/*0x1fc*/ u32 unk1fc;
|
||||
/*0x200*/ u32 unk200;
|
||||
/*0x204*/ u32 unk204;
|
||||
/*0x208*/ u32 unk208;
|
||||
/*0x20c*/ u32 unk20c;
|
||||
/*0x210*/ u32 unk210;
|
||||
/*0x214*/ u32 unk214;
|
||||
/*0x218*/ u32 unk218;
|
||||
/*0x21c*/ u32 unk21c;
|
||||
/*0x220*/ u32 unk220;
|
||||
/*0x224*/ u32 unk224;
|
||||
/*0x228*/ u32 unk228;
|
||||
/*0x22c*/ u32 unk22c;
|
||||
/*0x230*/ u32 unk230;
|
||||
/*0x234*/ u32 unk234;
|
||||
/*0x238*/ u32 unk238;
|
||||
/*0x23c*/ u32 unk23c;
|
||||
/*0x240*/ u32 unk240;
|
||||
/*0x244*/ u32 unk244;
|
||||
/*0x248*/ u32 unk248;
|
||||
/*0x24c*/ u32 unk24c;
|
||||
/*0x250*/ u32 unk250;
|
||||
/*0x254*/ u32 unk254;
|
||||
/*0x258*/ u32 unk258;
|
||||
/*0x25c*/ u32 unk25c;
|
||||
/*0x260*/ u32 unk260;
|
||||
/*0x264*/ u32 unk264;
|
||||
/*0x268*/ u32 unk268;
|
||||
/*0x26c*/ u32 unk26c;
|
||||
/*0x270*/ u32 unk270;
|
||||
/*0x274*/ u32 unk274;
|
||||
/*0x278*/ u32 unk278;
|
||||
/*0x27c*/ u32 unk27c;
|
||||
/*0x280*/ u32 unk280;
|
||||
/*0x284*/ u32 unk284;
|
||||
/*0x288*/ u32 unk288;
|
||||
/*0x28c*/ u32 unk28c;
|
||||
/*0x290*/ u32 unk290;
|
||||
/*0x294*/ u32 unk294;
|
||||
/*0x298*/ u32 unk298;
|
||||
/*0x29c*/ u32 unk29c;
|
||||
/*0x2a0*/ u32 unk2a0;
|
||||
/*0x2a4*/ u32 unk2a4;
|
||||
/*0x2a8*/ u32 unk2a8;
|
||||
/*0x2ac*/ u32 unk2ac;
|
||||
/*0x2b0*/ u32 unk2b0;
|
||||
/*0x2b4*/ u32 unk2b4;
|
||||
/*0x2b8*/ u32 unk2b8;
|
||||
/*0x2bc*/ u32 unk2bc;
|
||||
/*0x2c0*/ u32 unk2c0;
|
||||
/*0x2c4*/ u32 unk2c4;
|
||||
/*0x2c8*/ u32 unk2c8;
|
||||
/*0x2cc*/ u32 unk2cc;
|
||||
/*0x2d0*/ u32 unk2d0;
|
||||
/*0x2d4*/ u32 unk2d4;
|
||||
/*0x2d8*/ u32 unk2d8;
|
||||
/*0x2dc*/ u32 unk2dc;
|
||||
/*0x2e0*/ u32 unk2e0;
|
||||
/*0x2e4*/ u32 unk2e4;
|
||||
/*0x2e8*/ u32 unk2e8;
|
||||
/*0x2ec*/ u32 unk2ec;
|
||||
/*0x2f0*/ u32 unk2f0;
|
||||
/*0x2f4*/ u32 unk2f4;
|
||||
/*0x2f8*/ u32 unk2f8;
|
||||
/*0x2fc*/ u32 unk2fc;
|
||||
/*0x300*/ u32 unk300;
|
||||
/*0x304*/ u32 unk304;
|
||||
/*0x308*/ u32 unk308;
|
||||
/*0x30c*/ u32 unk30c;
|
||||
/*0x310*/ u32 unk310;
|
||||
};
|
||||
|
||||
struct ailist {
|
||||
u8 *list;
|
||||
s32 id;
|
||||
@@ -3035,7 +2838,7 @@ struct cover {
|
||||
};
|
||||
|
||||
struct stagesetup {
|
||||
/*0x00*/ struct stagesetup00 *unk00;
|
||||
/*0x00*/ struct waypoint *waypoints;
|
||||
/*0x04*/ void *unk04;
|
||||
/*0x08*/ struct coverdefinition *cover;
|
||||
/*0x0c*/ s32 *intro;
|
||||
|
||||
Reference in New Issue
Block a user