Match MarioActor::movement, though there is a nasty volatile that maybe shouldnt be there

This commit is contained in:
Headpenguin 2023-07-03 13:04:21 -04:00
parent 64cdcb27b5
commit e43c2c6b57
3 changed files with 26 additions and 12 deletions

View File

@ -187,7 +187,7 @@ changeGameOverAnimation__10MarioActorFv,MarioActor.o,Player.a,true
getJointCtrl__10MarioActorCFPCc,MarioActor.o,Player.a,true
updateRotationInfo__10MarioActorFv,MarioActor.o,Player.a,false
exeWait__10MarioActorFv,MarioActor.o,Player.a,true
movement__10MarioActorFv,MarioActor.o,Player.a,false
movement__10MarioActorFv,MarioActor.o,Player.a,true
control__10MarioActorFv,MarioActor.o,Player.a,false
control2__10MarioActorFv,MarioActor.o,Player.a,false
controlMain__10MarioActorFv,MarioActor.o,Player.a,false

1 Symbol Name Object File Library Archive Matching
187 getJointCtrl__10MarioActorCFPCc MarioActor.o Player.a true
188 updateRotationInfo__10MarioActorFv MarioActor.o Player.a false
189 exeWait__10MarioActorFv MarioActor.o Player.a true
190 movement__10MarioActorFv MarioActor.o Player.a false true
191 control__10MarioActorFv MarioActor.o Player.a false
192 control2__10MarioActorFv MarioActor.o Player.a false
193 controlMain__10MarioActorFv MarioActor.o Player.a false

View File

@ -48,6 +48,12 @@ class MarioState;
class Mario : public MarioModule {
public:
struct BitField {
u32 bits;
inline bool getBit(u32 bit) volatile {
return bits >> (0x20 - bit) & 1;
}
};
typedef bool (Mario::*Task)(const void *, void *, unsigned long);
Mario(MarioActor *);
@ -88,7 +94,10 @@ public:
return _C >> (0x20 - bit) & 1;
}
u32 _8;
union {
u32 _8;
volatile BitField __8;
};
u32 _C;
u32 _10;
u32 _14;

View File

@ -216,18 +216,27 @@ inline bool bs(const MarioActor &bull, int crap) {
return bull._230 -> _C >> (0x20 - crap) & 1;
}
inline bool bs3(const MarioActor &bull, int crap) {
return bull._230 -> _8 >> (0x20 - crap) & 1;
inline bool bs3(volatile MarioActor (*bull), int crap) {
return bull -> _230 -> _8 >> (0x20 - crap) & 1;
}
inline bool _bs3(const Mario *bull, int crap) {
inline bool _bs3(Mario *bull, int crap) {
return bull -> _8 >> (0x20 - crap) & 1;
}
inline bool volatile bs4(Mario &mario, u32 offset) {
u32 flag(mario._8);
return flag >> (0x1f - offset) & 1;
}
inline bool bs2(const MarioActor &bull) {
return bull._230 -> _5FC;
}
inline bool nannynans(MarioActor &act) {
return act._9f1;
}
bool MarioActor::isTurning() const {
return _230 -> _8 >> 0x1c & 1;
}
@ -275,10 +284,6 @@ void MarioActor::exeWait() {
}
}
inline u16 nans(const MarioActor &actor) {
return (u16)(actor._f40 + 1) / actor._f42 * actor._f42 - (u16)(actor._f40 + 1);
}
void MarioActor::movement() {
__46c = 0;
_378++;
@ -347,7 +352,7 @@ void MarioActor::movement() {
_230 -> _14 |= 0x20000000;
}
}
if(_bs3(_230, 1) && !_9f1) {
if(bs3(this, 1) && !nannynans(*this)) {
if(stack_128.dot(getGravityVec()) < -40f) {
TVec3f stack_ec(mPosition.translateOpposite(getGravityVec() % 100f));
TVec3f stack_e0;
@ -403,7 +408,8 @@ void MarioActor::movement() {
}
}
}
else if(_bs3(_230, 2)) {
}
else if(bs3(this, 2)) {
const u32 stop = mBinder -> _28;
bool r31 = false;
for(u32 i = 0; i < stop; i++) {
@ -432,7 +438,6 @@ void MarioActor::movement() {
mPosition -= _230 -> _368 % element;
}
}
}
}
if(_230 -> _18 >> 5 & 1) {
_230 -> _18 &= ~(u32)0x20;