Introduce MR::checkJMapDataEntries() inline function

This fixes regswaps in two different functions.
This commit is contained in:
Galaxy Master 2023-03-27 14:34:31 -04:00
parent 95252dc27d
commit feb0fb3610
14 changed files with 43 additions and 60 deletions

View File

@ -292,7 +292,7 @@ movement__8WarpCubeFv,WarpCube.o,AreaObj.a,true
draw__8WarpCubeCFv,WarpCube.o,AreaObj.a,true
init__8WarpCubeFRC12JMapInfoIter,WarpCube.o,AreaObj.a,true
__ct__9WaterAreaFiPCc,WaterArea.o,AreaObj.a,true
init__9WaterAreaFRC12JMapInfoIter,WaterArea.o,AreaObj.a,false
init__9WaterAreaFRC12JMapInfoIter,WaterArea.o,AreaObj.a,true
__ct__12WaterAreaMgrFlPCc,WaterArea.o,AreaObj.a,true
__dt__9WaterAreaFv,WaterArea.o,AreaObj.a,true
__dt__12WaterAreaMgrFv,WaterArea.o,AreaObj.a,true

1 Symbol Name Object File Library Archive Matching
292 draw__8WarpCubeCFv WarpCube.o AreaObj.a true
293 init__8WarpCubeFRC12JMapInfoIter WarpCube.o AreaObj.a true
294 __ct__9WaterAreaFiPCc WaterArea.o AreaObj.a true
295 init__9WaterAreaFRC12JMapInfoIter WaterArea.o AreaObj.a false true
296 __ct__12WaterAreaMgrFlPCc WaterArea.o AreaObj.a true
297 __dt__9WaterAreaFv WaterArea.o AreaObj.a true
298 __dt__12WaterAreaMgrFv WaterArea.o AreaObj.a true

View File

@ -1517,7 +1517,7 @@ initAfterPlacement__15CutBushModelObjFv,CutBushModelObj.o,MapObj.a,true
calcAndSetBaseMtx__15CutBushModelObjFv,CutBushModelObj.o,MapObj.a,true
__dt__15CutBushModelObjFv,CutBushModelObj.o,MapObj.a,true
__dt__8DashRingFv,DashRing.o,MapObj.a,true
initCommon__8DashRingFRC12JMapInfoIterPCc,DashRing.o,MapObj.a,false
initCommon__8DashRingFRC12JMapInfoIterPCc,DashRing.o,MapObj.a,true
attackSensor__8DashRingFP9HitSensorP9HitSensor,DashRing.o,MapObj.a,false
control__8DashRingFv,DashRing.o,MapObj.a,false
calcAndSetBaseMtx__8DashRingFv,DashRing.o,MapObj.a,true

1 Symbol Name Object File Library Archive Matching
1517 calcAndSetBaseMtx__15CutBushModelObjFv CutBushModelObj.o MapObj.a true
1518 __dt__15CutBushModelObjFv CutBushModelObj.o MapObj.a true
1519 __dt__8DashRingFv DashRing.o MapObj.a true
1520 initCommon__8DashRingFRC12JMapInfoIterPCc DashRing.o MapObj.a false true
1521 attackSensor__8DashRingFP9HitSensorP9HitSensor DashRing.o MapObj.a false
1522 control__8DashRingFv DashRing.o MapObj.a false
1523 calcAndSetBaseMtx__8DashRingFv DashRing.o MapObj.a true

View File

@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "Game",
"message": "10.559%",
"message": "10.578%",
"color": "blue"
}

View File

@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "AreaObj",
"message": "57.237%",
"message": "57.683%",
"color": "green"
}

View File

@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "MapObj",
"message": "24.231%",
"message": "24.316%",
"color": "tan"
}

View File

@ -1,7 +1,7 @@
| Library | Percentage |
| ------------- | ------------- |
| [Animation](https://github.com/shibbo/Petari/blob/master/docs/lib/Animation.md) | 4.513985045693714% |
| [AreaObj](https://github.com/shibbo/Petari/blob/master/docs/lib/AreaObj.md) | 57.23762914627515% |
| [AreaObj](https://github.com/shibbo/Petari/blob/master/docs/lib/AreaObj.md) | 57.68352365415987% |
| [AudioLib](https://github.com/shibbo/Petari/blob/master/docs/lib/AudioLib.md) | 0.0% |
| [Boss](https://github.com/shibbo/Petari/blob/master/docs/lib/Boss.md) | 0.029126011608796052% |
| [Camera](https://github.com/shibbo/Petari/blob/master/docs/lib/Camera.md) | 34.12644987572494% |
@ -12,7 +12,7 @@
| [Gravity](https://github.com/shibbo/Petari/blob/master/docs/lib/Gravity.md) | 56.816792337477075% |
| [LiveActor](https://github.com/shibbo/Petari/blob/master/docs/lib/LiveActor.md) | 41.18026740433379% |
| [Map](https://github.com/shibbo/Petari/blob/master/docs/lib/Map.md) | 16.35006406328338% |
| [MapObj](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj.md) | 24.231661275728296% |
| [MapObj](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj.md) | 24.31642554784761% |
| [NameObj](https://github.com/shibbo/Petari/blob/master/docs/lib/NameObj.md) | 30.427688079697695% |
| [NPC](https://github.com/shibbo/Petari/blob/master/docs/lib/NPC.md) | 2.155878467635403% |
| [NWC24](https://github.com/shibbo/Petari/blob/master/docs/lib/NWC24.md) | 0.0% |

View File

@ -44,4 +44,4 @@
| [SunLightArea.o](https://github.com/shibbo/Petari/blob/master/docs/lib/AreaObj/SunLightArea.md) | 100.0% | 3 / 3 | 100.0% | :white_check_mark:
| [SwitchArea.o](https://github.com/shibbo/Petari/blob/master/docs/lib/AreaObj/SwitchArea.md) | 100.0% | 5 / 5 | 100.0% | :white_check_mark:
| [WarpCube.o](https://github.com/shibbo/Petari/blob/master/docs/lib/AreaObj/WarpCube.md) | 73.33333333333333% | 4 / 8 | 50.0% | :eight_pointed_black_star:
| [WaterArea.o](https://github.com/shibbo/Petari/blob/master/docs/lib/AreaObj/WaterArea.md) | 65.2542372881356% | 4 / 5 | 80.0% | :eight_pointed_black_star:
| [WaterArea.o](https://github.com/shibbo/Petari/blob/master/docs/lib/AreaObj/WaterArea.md) | 100.0% | 5 / 5 | 100.0% | :white_check_mark:

View File

@ -5,12 +5,12 @@
| :white_check_mark: | Function is completed.
# 4 / 5 Completed -- (80.0%)
# 5 / 5 Completed -- (100.0%)
# WaterArea.o
| Symbol | Decompiled? |
| ------------- | ------------- |
| `__ct__9WaterAreaFiPCc` | :white_check_mark: |
| `init__9WaterAreaFRC12JMapInfoIter` | :x: |
| `init__9WaterAreaFRC12JMapInfoIter` | :white_check_mark: |
| `__ct__12WaterAreaMgrFlPCc` | :white_check_mark: |
| `__dt__9WaterAreaFv` | :white_check_mark: |
| `__dt__12WaterAreaMgrFv` | :white_check_mark: |

View File

@ -88,7 +88,7 @@
| [CrystalCageMoving.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/CrystalCageMoving.md) | 100.0% | 36 / 36 | 100.0% | :white_check_mark:
| [CrystalSwitch.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/CrystalSwitch.md) | 100.0% | 22 / 22 | 100.0% | :white_check_mark:
| [CutBushModelObj.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/CutBushModelObj.md) | 100.0% | 5 / 5 | 100.0% | :white_check_mark:
| [DashRing.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/DashRing.md) | 19.242902208201894% | 5 / 9 | 55.55555555555556% | :eight_pointed_black_star:
| [DashRing.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/DashRing.md) | 44.952681388012614% | 6 / 9 | 66.66666666666666% | :eight_pointed_black_star:
| [DeadLeaves.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/DeadLeaves.md) | 100.0% | 10 / 10 | 100.0% | :white_check_mark:
| [DesertLandMoveSwitch.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/DesertLandMoveSwitch.md) | 0.0% | 0 / 28 | 0.0% | :x:
| [DesertMovingLand.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/DesertMovingLand.md) | 0.0% | 0 / 30 | 0.0% | :x:

View File

@ -5,12 +5,12 @@
| :white_check_mark: | Function is completed.
# 5 / 9 Completed -- (55.55555555555556%)
# 6 / 9 Completed -- (66.66666666666666%)
# DashRing.o
| Symbol | Decompiled? |
| ------------- | ------------- |
| `__dt__8DashRingFv` | :white_check_mark: |
| `initCommon__8DashRingFRC12JMapInfoIterPCc` | :x: |
| `initCommon__8DashRingFRC12JMapInfoIterPCc` | :white_check_mark: |
| `attackSensor__8DashRingFP9HitSensorP9HitSensor` | :x: |
| `control__8DashRingFv` | :x: |
| `calcAndSetBaseMtx__8DashRingFv` | :white_check_mark: |

View File

@ -102,4 +102,32 @@ namespace MR {
getJMapInfoMessageID(rIter, &msgId);
return msgId;
}
inline bool checkJMapDataEntries(const JMapInfoIter &rIter) {
bool flag;
bool ret;
ret = false;
flag = false;
if (rIter.mInfo != nullptr && rIter._4 >= 0) {
flag = true;
}
if (flag) {
s32 numEntries;
if (rIter.mInfo->mData != nullptr) {
numEntries = rIter.mInfo->mData->mNumEntries;
} else {
numEntries = 0;
}
if (rIter._4 < numEntries) {
ret = true;
}
}
return ret;
}
};

BIN
prog.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -5,40 +5,15 @@ WaterArea::WaterArea(int type, const char *pName) : AreaObj(type, pName) {
_3C = 0;
}
#ifdef NON_MATCHING
// Register mismatch
void WaterArea::init(const JMapInfoIter &rIter) {
AreaObj::init(rIter);
bool bVar3 = false;
bool bVar2 = false;
if (rIter.mInfo != nullptr && rIter._4 >= 0) {
bVar2 = true;
}
if (bVar2) {
s32 iVar1;
if (rIter.mInfo->mData != nullptr) {
iVar1 = rIter.mInfo->mData->_0;
}
else {
iVar1 = 0;
}
if (rIter._4 < iVar1) {
bVar3 = true;
}
}
if (bVar3) {
if (MR::checkJMapDataEntries(rIter)) {
MR::getJMapInfoArg2NoInit(rIter, &_3C);
}
WaterAreaFunction::createWaterAreaHolder();
}
#endif
WaterAreaMgr::WaterAreaMgr(s32 type, const char *pName) : AreaObjMgr(type, pName) {

View File

@ -4,8 +4,6 @@ DashRing::~DashRing() {
}
#ifdef NON_MATCHING
// tiny regswap
void DashRing::initCommon(const JMapInfoIter &rIter, const char *pName) {
MR::initDefaultPos(this, rIter);
_A4 = 0;
@ -25,30 +23,13 @@ void DashRing::initCommon(const JMapInfoIter &rIter, const char *pName) {
MR::addHitSensorMapObj(this, "body", 4, 1000.0f, TVec3f(0.0f, 0.0f, 0.0f));
MR::validateClipping(this);
calcAxis();
bool anotherFlag = false;
JMapInfo* info = rIter.mInfo;
bool flag = false;
_A8 = 300;
_AC = 120;
_B0 = 2.5f;
_B5 = 1;
if (info && rIter._4 >= 0) {
flag = true;
}
if (flag) {
s32 data = info->mData ? info->mData->_0 : 0;
if (rIter._4 < data) {
anotherFlag = true;
}
}
if (anotherFlag) {
if (MR::checkJMapDataEntries(rIter)) {
s32 arg0 = -1;
s32 arg1 = -1;
s32 arg2 = -1;
@ -88,7 +69,6 @@ void DashRing::initCommon(const JMapInfoIter &rIter, const char *pName) {
_B8 = mPosition;
}
#endif
// DashRing::attackSensor
// DashRing::control