mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
fix some nonmatching functions (#2141)
This commit is contained in:
@@ -43,25 +43,29 @@ u8 daItemBase_c::chkDead() {
|
||||
|
||||
/* 80037B0C-80037B78 03244C 006C+00 0/0 0/0 1/1 .text CheckItemCreateHeap__FP10fopAc_ac_c
|
||||
*/
|
||||
void CheckItemCreateHeap(fopAc_ac_c* actor) {
|
||||
int CheckItemCreateHeap(fopAc_ac_c* actor) {
|
||||
daItemBase_c* item = static_cast<daItemBase_c*>(actor);
|
||||
|
||||
u8 item_no = item->getItemNo();
|
||||
item->CreateItemHeap(dItem_data::getArcName(item_no), dItem_data::getBmdName(item_no),
|
||||
dItem_data::getBtkName(item_no), dItem_data::getBpkName(item_no),
|
||||
dItem_data::getBckName(item_no), dItem_data::getBxaName(item_no),
|
||||
dItem_data::getBrkName(item_no), dItem_data::getBtpName(item_no));
|
||||
return item->CreateItemHeap(
|
||||
dItem_data::getArcName(item_no), dItem_data::getBmdName(item_no),
|
||||
dItem_data::getBtkName(item_no), dItem_data::getBpkName(item_no),
|
||||
dItem_data::getBckName(item_no), dItem_data::getBxaName(item_no),
|
||||
dItem_data::getBrkName(item_no), dItem_data::getBtpName(item_no)
|
||||
);
|
||||
}
|
||||
|
||||
/* 80037B78-80037BE0 0324B8 0068+00 0/0 1/1 7/7 .text CheckFieldItemCreateHeap__FP10fopAc_ac_c */
|
||||
void CheckFieldItemCreateHeap(fopAc_ac_c* actor) {
|
||||
int CheckFieldItemCreateHeap(fopAc_ac_c* actor) {
|
||||
daItemBase_c* item = static_cast<daItemBase_c*>(actor);
|
||||
|
||||
u8 item_no = item->getItemNo();
|
||||
item->CreateItemHeap(dItem_data::getFieldArc(item_no), dItem_data::getItemBmdName(item_no),
|
||||
dItem_data::getItemBtkName(item_no), dItem_data::getItemBpkName(item_no),
|
||||
dItem_data::getItemBckName(item_no), dItem_data::getItemBxaName(item_no),
|
||||
dItem_data::getItemBrkName(item_no), dItem_data::getItemBtpName(item_no));
|
||||
return item->CreateItemHeap(
|
||||
dItem_data::getFieldArc(item_no), dItem_data::getItemBmdName(item_no),
|
||||
dItem_data::getItemBtkName(item_no), dItem_data::getItemBpkName(item_no),
|
||||
dItem_data::getItemBckName(item_no), dItem_data::getItemBxaName(item_no),
|
||||
dItem_data::getItemBrkName(item_no), dItem_data::getItemBtpName(item_no)
|
||||
);
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
|
||||
+1
-12
@@ -1860,7 +1860,6 @@ static s32 const a_jntNumTbl[13][2] = {
|
||||
};
|
||||
|
||||
/* 80158FF0-801590FC 153930 010C+00 0/0 0/0 4/4 .text drawObj__10daNpcCd2_cFiP8J3DModelf */
|
||||
#ifdef NONMATCHING // rlwinm loading wrong value
|
||||
int daNpcCd2_c::drawObj(int idx, J3DModel* i_model, f32 i_scale) {
|
||||
if (i_model == NULL) {
|
||||
return 0;
|
||||
@@ -1868,7 +1867,7 @@ int daNpcCd2_c::drawObj(int idx, J3DModel* i_model, f32 i_scale) {
|
||||
if (field_0xac6 && !daPy_py_c::checkNowWolfEyeUp()) {
|
||||
return 0;
|
||||
}
|
||||
u32 x = !isM_();
|
||||
int x = isM_() ? 0 : 1;
|
||||
s32 jntNum = a_jntNumTbl[idx][x];
|
||||
if (i_model && jntNum >= 0) {
|
||||
g_env_light.setLightTevColorType_MAJI(i_model, &tevStr);
|
||||
@@ -1879,16 +1878,6 @@ int daNpcCd2_c::drawObj(int idx, J3DModel* i_model, f32 i_scale) {
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm int daNpcCd2_c::drawObj(int param_0, J3DModel* param_1, f32 param_2) {
|
||||
nofralloc
|
||||
#include "asm/a/npc/d_a_npc_cd2/drawObj__10daNpcCd2_cFiP8J3DModelf.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 801590FC-80159258 153A3C 015C+00 0/0 0/0 4/4 .text drawNpc__10daNpcCd2_cFv */
|
||||
int daNpcCd2_c::drawNpc() {
|
||||
|
||||
+14
-46
@@ -631,56 +631,24 @@ void daPy_py_c::setMidnaFaceNum(int i_faceNum) {
|
||||
}
|
||||
|
||||
/* 8015F97C-8015FA2C 15A2BC 00B0+00 0/0 7/7 2/2 .text daPy_addCalcShort__FPsssss */
|
||||
// 1 instruction in wrong place
|
||||
#ifdef NONMATCHING
|
||||
int daPy_addCalcShort(s16* param_0, s16 param_1, s16 param_2, s16 param_3, s16 param_4) {
|
||||
s16 temp_r0;
|
||||
s16 temp_r0_2;
|
||||
s16 temp_r8;
|
||||
s16 temp_r9;
|
||||
s32 temp_r10;
|
||||
s32 temp_r4;
|
||||
s32 temp_r5;
|
||||
s32 phi_r4;
|
||||
int daPy_addCalcShort(s16* i_value, s16 i_target, s16 i_scale, s16 i_maxStep, s16 i_minStep) {
|
||||
int delta = i_target - *i_value;
|
||||
|
||||
temp_r8 = *param_0;
|
||||
temp_r9 = (s16)param_1;
|
||||
temp_r10 = temp_r9 - temp_r8;
|
||||
|
||||
if (temp_r8 != temp_r9) {
|
||||
temp_r5 = temp_r10 / param_2;
|
||||
temp_r0 = (s16)param_4;
|
||||
if (temp_r5 > temp_r0 || temp_r5 < -temp_r0) {
|
||||
temp_r0_2 = param_3;
|
||||
temp_r4 = -temp_r0_2;
|
||||
phi_r4 = temp_r4;
|
||||
if (temp_r5 < temp_r4) {
|
||||
phi_r4 = temp_r5;
|
||||
} else if (temp_r5 > temp_r0_2) {
|
||||
phi_r4 = temp_r0_2;
|
||||
}
|
||||
*param_0 += phi_r4;
|
||||
} else if (temp_r10 >= 0) {
|
||||
*param_0 = temp_r8 + param_4;
|
||||
if (temp_r9 - *param_0 <= 0) {
|
||||
*param_0 = param_1;
|
||||
if (*i_value != i_target) {
|
||||
int step = delta / i_scale;
|
||||
if (step > i_minStep || step < -i_minStep) {
|
||||
*i_value += cLib_minMaxLimit<int>(step, -i_maxStep, i_maxStep);
|
||||
} else if (delta >= 0) {
|
||||
*i_value += i_minStep;
|
||||
if (i_target - *i_value <= 0) {
|
||||
*i_value = i_target;
|
||||
}
|
||||
} else {
|
||||
*param_0 = temp_r8 - param_4;
|
||||
if (temp_r9 - *param_0 >= 0) {
|
||||
*param_0 = param_1;
|
||||
*i_value -= i_minStep;
|
||||
if (i_target - *i_value >= 0) {
|
||||
*i_value = i_target;
|
||||
}
|
||||
}
|
||||
}
|
||||
return temp_r9 - *param_0;
|
||||
return i_target - *i_value;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm int daPy_addCalcShort(s16* param_0, s16 param_1, s16 param_2, s16 param_3, s16 param_4) {
|
||||
nofralloc
|
||||
#include "asm/d/a/d_a_player/daPy_addCalcShort__FPsssss.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -498,7 +498,7 @@ void dCcS::ProcAtTgHitmark(bool i_setAt, bool i_setTg, cCcD_Obj* param_2, cCcD_O
|
||||
{
|
||||
if ((i_atObjInf->GetAtType() &
|
||||
(AT_TYPE_WOLF_ATTACK | AT_TYPE_WOLF_CUT_TURN | AT_TYPE_10000000 | AT_TYPE_MIDNA_LOCK |
|
||||
AT_TYPE_HOOKSHOT | AT_TYPE_SHIELD_ATTACK | AT_TYPE_NORMAL_SWORD)) == 0 ||
|
||||
AT_TYPE_HOOKSHOT | AT_TYPE_SHIELD_ATTACK | AT_TYPE_NORMAL_SWORD)) != 0 &&
|
||||
i_tgObjInf->GetTgSpl() == 1)
|
||||
{
|
||||
return;
|
||||
|
||||
+100
-419
File diff suppressed because it is too large
Load Diff
+5
-3
@@ -782,7 +782,7 @@ int dDemo_setDemoData(fopAc_ac_c* param_0, u8 param_1, mDoExt_McaMorf* param_2,
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 flags = demo_actor->checkEnable(param_1);
|
||||
u8 flags = demo_actor->checkEnable(param_1);
|
||||
if (flags & 2) {
|
||||
param_0->current.pos = demo_actor->getTrans();
|
||||
param_0->old.pos = param_0->current.pos;
|
||||
@@ -793,7 +793,7 @@ int dDemo_setDemoData(fopAc_ac_c* param_0, u8 param_1, mDoExt_McaMorf* param_2,
|
||||
}
|
||||
|
||||
if (flags & 4) {
|
||||
param_0->mScale = demo_actor->getScale();
|
||||
param_0->scale = demo_actor->getScale();
|
||||
}
|
||||
|
||||
if (flags & 0x80) {
|
||||
@@ -1428,18 +1428,20 @@ SECTION_SDATA2 static f64 lit_5123 = 1.0 / 29.999998435378155;
|
||||
|
||||
/* 80039678-80039910 033FB8 0298+00 0/0 1/1 0/0 .text create__7dDemo_cFv */
|
||||
#ifdef NONMATCHING
|
||||
// matches with data
|
||||
void dDemo_c::create() {
|
||||
m_system = new dDemo_system_c();
|
||||
m_control = new JStudio::TControl();
|
||||
m_mesgControl = new jmessage_tControl();
|
||||
m_stage = new JStudio_JStage::TCreateObject(m_system);
|
||||
m_audio = new JStudio_JAudio2::TCreateObject(Z2GetSoundStarter(), m_system);
|
||||
m_audio->mPermit_onExit_notEnd = true;
|
||||
m_particle = new dDemo_particle_c(dPa_control_c::getEmitterManager(), m_system);
|
||||
m_message = new jstudio_tCreateObject_message();
|
||||
m_factory = new JStudio::TFactory();
|
||||
m_object = new dDemo_object_c();
|
||||
|
||||
m_control->setSecondPerFrame(1.0 / 29.999998435378155);
|
||||
m_control->setSecondPerFrame(1.0f / 30.0f);
|
||||
m_control->setFactory(m_factory);
|
||||
m_factory->appendCreateObject(m_stage);
|
||||
m_factory->appendCreateObject(m_audio);
|
||||
|
||||
+14
-90
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: d/d_lib
|
||||
//
|
||||
/**
|
||||
* d_lib.cpp
|
||||
* Utility Functions
|
||||
*/
|
||||
|
||||
#include "d/d_lib.h"
|
||||
#include "d/event/d_event.h"
|
||||
@@ -9,58 +9,9 @@
|
||||
#include "JSystem/JKernel/JKRAramArchive.h"
|
||||
#include "JSystem/JKernel/JKRAram.h"
|
||||
#include "JSystem/JKernel/JKRDecomp.h"
|
||||
#include "dol2asm.h"
|
||||
#include "f_op/f_op_actor.h"
|
||||
#include "m_Do/m_Do_controller_pad.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __ct__9STControlFssssffss();
|
||||
extern "C" void setWaitParm__9STControlFssssffss();
|
||||
extern "C" void init__9STControlFv();
|
||||
extern "C" void Xinit__9STControlFv();
|
||||
extern "C" void Yinit__9STControlFv();
|
||||
extern "C" void getValueStick__9STControlFv();
|
||||
extern "C" void getAngleStick__9STControlFv();
|
||||
extern "C" void getValueStick__10CSTControlFv();
|
||||
extern "C" void getAngleStick__10CSTControlFv();
|
||||
extern "C" void checkTrigger__9STControlFv();
|
||||
extern "C" void checkLeftTrigger__9STControlFv();
|
||||
extern "C" void checkRightTrigger__9STControlFv();
|
||||
extern "C" void checkUpTrigger__9STControlFv();
|
||||
extern "C" void checkDownTrigger__9STControlFv();
|
||||
extern "C" void dLib_getEventSwitchNo__Fi();
|
||||
extern "C" void dLib_checkActorInRectangle__FP10fopAc_ac_cP10fopAc_ac_cPC4cXyzPC4cXyz();
|
||||
extern "C" void dLib_getExpandSizeFromAramArchive__FP14JKRAramArchivePCc();
|
||||
extern "C" void getTime__11dLib_time_cFv();
|
||||
extern "C" void stopTime__11dLib_time_cFv();
|
||||
extern "C" void startTime__11dLib_time_cFv();
|
||||
extern "C" u8 m_diffTime__11dLib_time_c[4];
|
||||
extern "C" u8 m_stopTime__11dLib_time_c[4];
|
||||
extern "C" extern u8 struct_80450DF0[8];
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void mDoMtx_YrotS__FPA4_fs();
|
||||
extern "C" void searchMapEventData__14dEvt_control_cFUc();
|
||||
extern "C" void __mi__4cXyzCFRC3Vec();
|
||||
extern "C" void aramToMainRam__7JKRAramFUlPUcUl15JKRExpandSwitchUlP7JKRHeapiPUl();
|
||||
extern "C" void findFsResource__10JKRArchiveCFPCcUl();
|
||||
extern "C" void getAramAddress__14JKRAramArchiveFPCc();
|
||||
extern "C" void _savegpr_29();
|
||||
extern "C" void _restgpr_29();
|
||||
extern "C" u8 m_cpadInfo__8mDoCPd_c[256];
|
||||
extern "C" u8 now__14mDoMtx_stack_c[48];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 803A7240-803A7250 004360 0010+00 0/0 0/0 6/6 .data ZeroQuat */
|
||||
Quaternion ZeroQuat = {
|
||||
0.0f,
|
||||
@@ -69,22 +20,6 @@ Quaternion ZeroQuat = {
|
||||
1.0f
|
||||
};
|
||||
|
||||
/* 803A7250-803A7260 004370 0010+00 0/0 1/1 0/0 .data __vt__10CSTControl */
|
||||
SECTION_DATA extern void* __vt__10CSTControl[4] = {
|
||||
(void*)NULL /* RTTI */,
|
||||
(void*)NULL,
|
||||
(void*)getValueStick__10CSTControlFv,
|
||||
(void*)getAngleStick__10CSTControlFv,
|
||||
};
|
||||
|
||||
/* 803A7260-803A7270 004380 0010+00 1/1 1/1 0/0 .data __vt__9STControl */
|
||||
SECTION_DATA extern void* __vt__9STControl[4] = {
|
||||
(void*)NULL /* RTTI */,
|
||||
(void*)NULL,
|
||||
(void*)getValueStick__9STControlFv,
|
||||
(void*)getAngleStick__9STControlFv,
|
||||
};
|
||||
|
||||
STControl::STControl(s16 delayY, s16 delayX, s16 param_2, s16 param_3, f32 threshold, f32 param_5,
|
||||
s16 param_6, s16 param_7) {
|
||||
setWaitParm(delayY, delayX, param_2, param_3, threshold, param_5, param_6, param_7);
|
||||
@@ -152,7 +87,6 @@ s16 CSTControl::getAngleStick() {
|
||||
}
|
||||
|
||||
/* 8003219C-8003242C 02CADC 0290+00 0/0 24/24 0/0 .text checkTrigger__9STControlFv */
|
||||
#ifdef NONMATCHING
|
||||
u8 STControl::checkTrigger() {
|
||||
field_0x0d = mDirectionTrig;
|
||||
f32 stickValue = getValueStick();
|
||||
@@ -161,21 +95,21 @@ u8 STControl::checkTrigger() {
|
||||
s16 temp_r7 = 0x2000 - field_0x26 >> 1;
|
||||
|
||||
if (!cM3d_IsZero(stickValue)) {
|
||||
if (stickAngle < field_0x22 + temp_r7 - 0x7000) {
|
||||
if (stickAngle < field_0x22 - 0x7000 + temp_r7) {
|
||||
var_r6 |= TRIG_UP;
|
||||
} else if (stickAngle < (field_0x22 - 0x5000) - temp_r7) {
|
||||
} else if (stickAngle < field_0x22 - 0x5000 - temp_r7) {
|
||||
var_r6 |= TRIG_UP_LEFT;
|
||||
} else if (stickAngle < field_0x22 + temp_r7 - 0x3000) {
|
||||
} else if (stickAngle < field_0x22 - 0x3000 + temp_r7) {
|
||||
var_r6 |= TRIG_LEFT;
|
||||
} else if (stickAngle < (field_0x22 - 0x1000) - temp_r7) {
|
||||
} else if (stickAngle < field_0x22 - 0x1000 - temp_r7) {
|
||||
var_r6 |= TRIG_DOWN_LEFT;
|
||||
} else if (stickAngle < field_0x22 + temp_r7 + 0x1000) {
|
||||
} else if (stickAngle < field_0x22 + 0x1000 + temp_r7) {
|
||||
var_r6 |= TRIG_DOWN;
|
||||
} else if (stickAngle < (field_0x22 + 0x3000) - temp_r7) {
|
||||
} else if (stickAngle < field_0x22 + 0x3000 - temp_r7) {
|
||||
var_r6 |= TRIG_DOWN_RIGHT;
|
||||
} else if (stickAngle < field_0x22 + temp_r7 + 0x5000) {
|
||||
} else if (stickAngle < field_0x22 + 0x5000 + temp_r7) {
|
||||
var_r6 |= TRIG_RIGHT;
|
||||
} else if (stickAngle < (field_0x22 + 0x7000) - temp_r7) {
|
||||
} else if (stickAngle < field_0x22 + 0x7000 - temp_r7) {
|
||||
var_r6 |= TRIG_UP_RIGHT;
|
||||
} else {
|
||||
var_r6 |= TRIG_UP;
|
||||
@@ -222,16 +156,6 @@ u8 STControl::checkTrigger() {
|
||||
|
||||
return mDirectionTrig;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm u8 STControl::checkTrigger() {
|
||||
nofralloc
|
||||
#include "asm/d/d_lib/checkTrigger__9STControlFv.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
bool STControl::checkLeftTrigger() {
|
||||
if (field_0x0e == 0 && mDirectionTrig & TRIG_LEFT) {
|
||||
@@ -334,7 +258,8 @@ u32 dLib_getExpandSizeFromAramArchive(JKRAramArchive* i_aramArchive, char const*
|
||||
if (address == 0) {
|
||||
return 0;
|
||||
}
|
||||
u8* readAddress = JKRAramToMainRam(address, header, 0x20, EXPAND_SWITCH_UNKNOWN0, 0, 0, 0xffffffff, 0);
|
||||
u8* readAddress = JKRAramToMainRam(address, header, 0x20, EXPAND_SWITCH_UNKNOWN0,
|
||||
0, 0, 0xffffffff, 0);
|
||||
JUT_ASSERT(1260, readAddress == header);
|
||||
JKRArchive::SDIFileEntry* entry = i_aramArchive->findFsResource(param_2, 0);
|
||||
JUT_ASSERT(1263, entry != 0);
|
||||
@@ -346,7 +271,6 @@ u32 dLib_getExpandSizeFromAramArchive(JKRAramArchive* i_aramArchive, char const*
|
||||
return uVar5;
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80450DD8-80450DDC 0002D8 0004+00 2/2 0/0 0/0 .sbss m_diffTime__11dLib_time_c */
|
||||
OSTime dLib_time_c::m_diffTime;
|
||||
|
||||
|
||||
+6
-4
@@ -5,6 +5,8 @@
|
||||
|
||||
#include "d/d_resorce.h"
|
||||
#include "JSystem/J3DGraphBase/J3DMaterial.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h"
|
||||
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
|
||||
#include "JSystem/JKernel/JKRMemArchive.h"
|
||||
#include "JSystem/JKernel/JKRSolidHeap.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
@@ -393,7 +395,7 @@ J3DModelData* dRes_info_c::loaderBasicBmd(u32 i_type, void* i_data) {
|
||||
flags ^= 0x60020;
|
||||
}
|
||||
|
||||
modelData = (J3DModelData*)J3DModelLoaderDataBase::load(i_data, flags);
|
||||
modelData = J3DModelLoaderDataBase::load(i_data, flags);
|
||||
if (modelData == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -447,11 +449,11 @@ J3DModelData* dRes_info_c::loaderBasicBmd(u32 i_type, void* i_data) {
|
||||
}
|
||||
|
||||
if (i_type == 'BMDR' || i_type == 'BMWR') {
|
||||
if (modelData->newSharedDisplayList(0x40000) == 0) {
|
||||
if (modelData->newSharedDisplayList(0x40000) != 0) {
|
||||
return NULL;
|
||||
} else {
|
||||
modelData->simpleCalcMaterial(0, (MtxP)j3dDefaultMtx);
|
||||
modelData->makeSharedDL();
|
||||
} else {
|
||||
modelData = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ SECTION_SDATA2 static f64 lit_3632 = 4503601774854144.0 /* cast s32 to float */;
|
||||
|
||||
/* 80097878-80097904 0921B8 008C+00 0/0 7/7 0/0 .text Init__14d2DBSplinePathFll */
|
||||
#ifdef NONMATCHING
|
||||
// regalloc
|
||||
// matches with literals
|
||||
void d2DBSplinePath::Init(s32 param_0, s32 param_1) {
|
||||
s32 tmp;
|
||||
s32 tmp2;
|
||||
@@ -38,11 +38,8 @@ void d2DBSplinePath::Init(s32 param_0, s32 param_1) {
|
||||
field_0x08 = 1;
|
||||
field_0x0c = param_1;
|
||||
|
||||
if (field_0x0c != 0) {
|
||||
tmp2 = field_0x0c - 1;
|
||||
}
|
||||
|
||||
field_0x04 < 2 ? tmp = 1 : tmp = field_0x04 - 2;
|
||||
tmp2 = field_0x0c != 0 ? field_0x0c - 1 : 1;
|
||||
tmp = field_0x04 < 2 ? 1 : field_0x04 - 2;
|
||||
field_0x10 = (f32)tmp / (f32)tmp2;
|
||||
|
||||
field_0x2c = 0;
|
||||
|
||||
+10
-46
@@ -6,6 +6,7 @@
|
||||
#include "d/d_stage.h"
|
||||
#include "JSystem/JKernel/JKRAramArchive.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "d/d_path.h"
|
||||
#include "stdio.h"
|
||||
#include "SSystem/SComponent/c_malloc.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
@@ -1626,37 +1627,25 @@ SECTION_DEAD static char const* const stringBase_80378AF0 =
|
||||
|
||||
/* 80024954-80024A34 01F294 00E0+00 0/0 2/2 0/2 .text resetArchiveBank__20dStage_roomControl_cFi
|
||||
*/
|
||||
// regalloc
|
||||
#ifdef NONMATCHING
|
||||
bool dStage_roomControl_c::resetArchiveBank(int i_bank) {
|
||||
for (; i_bank < 32; i_bank++) {
|
||||
char* bank = getArcBank(i_bank);
|
||||
for (int i = i_bank; i < 32; i++) {
|
||||
char* bank = getArcBank(i);
|
||||
|
||||
if (strcmp(bank, "")) {
|
||||
s32 syncStatus = dComIfG_syncObjectRes(bank);
|
||||
if (syncStatus < 0) {
|
||||
OSReport_Error("Bank[%d] : %s.arc Sync Read Error !!\n", i_bank, bank);
|
||||
OSReport_Error("Bank[%d] : %s.arc Sync Read Error !!\n", i, bank);
|
||||
} else {
|
||||
if (syncStatus > 0) {
|
||||
return 0;
|
||||
}
|
||||
dComIfG_deleteObjectResMain(bank);
|
||||
setArcBank(i_bank, "");
|
||||
setArcBank(i, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm bool dStage_roomControl_c::resetArchiveBank(int param_0) {
|
||||
nofralloc
|
||||
#include "asm/d/d_stage/resetArchiveBank__20dStage_roomControl_cFi.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 80024A34-80024ABC 01F374 0088+00 1/1 0/0 0/2 .text
|
||||
* create__Q220dStage_roomControl_c9roomDzs_cFUc */
|
||||
@@ -2366,8 +2355,6 @@ static int dStage_doorInfoInit(dStage_dt_c* stageDt, void* i_data, int entryNum,
|
||||
}
|
||||
|
||||
/* 80025DA8-80025E40 0206E8 0098+00 2/0 0/0 0/0 .text dStage_roomReadInit__FP11dStage_dt_cPviPv */
|
||||
// close
|
||||
#ifdef NONMATCHING
|
||||
static int dStage_roomReadInit(dStage_dt_c* param_0, void* i_data, int param_2, void* param_3) {
|
||||
roomRead_class* p_node = (roomRead_class*)((int*)i_data + 1);
|
||||
roomRead_data_class** rtbl = p_node->field_0x4;
|
||||
@@ -2376,24 +2363,13 @@ static int dStage_roomReadInit(dStage_dt_c* param_0, void* i_data, int param_2,
|
||||
|
||||
for (int i = 0; i < p_node->field_0x0; i++) {
|
||||
if ((int)rtbl[i] < 0x80000000) {
|
||||
rtbl[i] += (int)param_3;
|
||||
rtbl[i]->field_0x4 += (int)param_3;
|
||||
rtbl[i] = (roomRead_data_class*)((int)rtbl[i] + (int)param_3);
|
||||
rtbl[i]->field_0x4 = (u8*)((int)rtbl[i]->field_0x4 + (int)param_3);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm int dStage_roomReadInit(dStage_dt_c* param_0, void* param_1, int param_2,
|
||||
void* param_3) {
|
||||
nofralloc
|
||||
#include "asm/d/d_stage/dStage_roomReadInit__FP11dStage_dt_cPviPv.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 80025E40-80025E70 020780 0030+00 0/0 1/1 0/0 .text
|
||||
* dStage_roomRead_dt_c_GetReverbStage__FR14roomRead_classi */
|
||||
@@ -2412,8 +2388,6 @@ static int dStage_ppntInfoInit(dStage_dt_c* stageDt, void* i_data, int entryNum,
|
||||
}
|
||||
|
||||
/* 80025EA4-80025F44 0207E4 00A0+00 1/0 0/0 0/0 .text dStage_pathInfoInit__FP11dStage_dt_cPviPv */
|
||||
// close
|
||||
#ifdef NONMATCHING
|
||||
static int dStage_pathInfoInit(dStage_dt_c* stageDt, void* i_data, int entryNum, void* param_3) {
|
||||
dStage_dPath_c* path_c = (dStage_dPath_c*)((char*)i_data + 4);
|
||||
dPath* path = path_c->m_path;
|
||||
@@ -2422,24 +2396,14 @@ static int dStage_pathInfoInit(dStage_dt_c* stageDt, void* i_data, int entryNum,
|
||||
|
||||
for (int i = 0; i < path_c->m_num; i++) {
|
||||
if ((u32)path->m_points < 0x80000000) {
|
||||
path->m_points += (int)stageDt->getPntInf();
|
||||
// fake match?
|
||||
path->m_points = (dStage_dPnt_c*)((int)path->m_points + *(int*)&stageDt->getPntInf()->m_position);
|
||||
}
|
||||
path++;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm int dStage_pathInfoInit(dStage_dt_c* param_0, void* param_1, int param_2,
|
||||
void* param_3) {
|
||||
nofralloc
|
||||
#include "asm/d/d_stage/dStage_pathInfoInit__FP11dStage_dt_cPviPv.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 80025F44-80025F78 020884 0034+00 2/0 0/0 0/0 .text dStage_rppnInfoInit__FP11dStage_dt_cPviPv */
|
||||
static int dStage_rppnInfoInit(dStage_dt_c* stageDt, void* i_data, int entryNum, void* param_3) {
|
||||
@@ -3157,7 +3121,7 @@ int dStage_changeScene4Event(int i_exitId, s8 room_no, int i_wipe, bool param_3,
|
||||
}
|
||||
|
||||
dComIfGp_setNextStage(scls_info->mStage, scls_info->mStart, (s8)scls_info->mRoom, (s8)layer,
|
||||
speed, mode, 1, wipe == 15 ? 0 : wipe, angle, param_3 != false,
|
||||
speed, mode, 1, wipe == 15 ? 0 : wipe, angle, param_3 ? 1 : 0,
|
||||
wipe_time);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "d/file/d_file_select.h"
|
||||
#include "d/file/d_file_sel_info.h"
|
||||
#include "JSystem/J2DGraph/J2DAnmLoader.h"
|
||||
#include "JSystem/J3DGraphBase/J3DMaterial.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h"
|
||||
#include "d/meter/d_meter2_info.h"
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
#include "dol2asm.h"
|
||||
@@ -441,7 +443,7 @@ SECTION_DATA static u8 cNullVec__6Z2Calc[12] = {
|
||||
};
|
||||
|
||||
/* 803BA854-803BA860 017974 000C+00 3/3 0/0 0/0 .data SelStartFrameTbl */
|
||||
SECTION_DATA static u32 SelStartFrameTbl[3] = {
|
||||
SECTION_DATA static s32 SelStartFrameTbl[3] = {
|
||||
0x0000003B,
|
||||
0x00000063,
|
||||
0x0000008B,
|
||||
@@ -455,14 +457,14 @@ SECTION_DATA static s32 SelEndFrameTbl[3] = {
|
||||
};
|
||||
|
||||
/* 803BA86C-803BA878 01798C 000C+00 7/7 0/0 0/0 .data SelOpenStartFrameTbl */
|
||||
SECTION_DATA static u32 SelOpenStartFrameTbl[3] = {
|
||||
SECTION_DATA static s32 SelOpenStartFrameTbl[3] = {
|
||||
0x000000F8,
|
||||
0x000001C0,
|
||||
0x00000288,
|
||||
};
|
||||
|
||||
/* 803BA878-803BA884 017998 000C+00 7/7 0/0 0/0 .data SelOpenEndFrameTbl */
|
||||
SECTION_DATA static u32 SelOpenEndFrameTbl[3] = {
|
||||
SECTION_DATA static s32 SelOpenEndFrameTbl[3] = {
|
||||
0x00000103,
|
||||
0x000001CC,
|
||||
0x00000293,
|
||||
@@ -2693,14 +2695,14 @@ asm void dFile_select_c::dataSelectAnmSet() {
|
||||
|
||||
/* 80185DE0-80186088 180720 02A8+00 1/0 0/0 0/0 .text dataSelectMoveAnime__14dFile_select_cFv */
|
||||
#ifdef NONMATCHING
|
||||
// still alot wrong
|
||||
// matches with literals
|
||||
void dFile_select_c::dataSelectMoveAnime() {
|
||||
int iVar7 = 1;
|
||||
int iVar6 = 1;
|
||||
bool iVar7 = true;
|
||||
bool iVar6 = true;
|
||||
bool bVar1 = true;
|
||||
if (mLastSelectNum != 0xff) {
|
||||
field_0x0188[mLastSelectNum]->alphaAnime(g_fsHIO.field_0x0006,0xff,0,1);
|
||||
selectWakuAlpahAnm(mLastSelectNum);
|
||||
iVar7 = field_0x0188[mLastSelectNum]->alphaAnime(g_fsHIO.field_0x0006,0xff,0,1);
|
||||
iVar6 = selectWakuAlpahAnm(mLastSelectNum);
|
||||
|
||||
if (field_0x00e0[mLastSelectNum] != SelStartFrameTbl[mLastSelectNum]) {
|
||||
field_0x00e0[mLastSelectNum] = field_0x00e0[mLastSelectNum] - 2;
|
||||
@@ -2714,16 +2716,16 @@ void dFile_select_c::dataSelectMoveAnime() {
|
||||
}
|
||||
}
|
||||
|
||||
int iVar5 = 1;
|
||||
bool iVar5 = true;
|
||||
bool bVar2 = true;
|
||||
|
||||
if (mSelectNum != 0xff) {
|
||||
field_0x0188[mSelectNum]->alphaAnime(g_fsHIO.field_0x0006,0,0xff,1);
|
||||
iVar5 = field_0x0188[mSelectNum]->alphaAnime(g_fsHIO.field_0x0006,0,0xff,1);
|
||||
|
||||
if (field_0x00e0[mSelectNum] != SelEndFrameTbl[mSelectNum]) {
|
||||
field_0x00e0[mSelectNum] = field_0x00e0[mSelectNum] + 2;
|
||||
|
||||
if (SelEndFrameTbl[mSelectNum] < field_0x00e0[mSelectNum])
|
||||
if (field_0x00e0[mSelectNum] > SelEndFrameTbl[mSelectNum])
|
||||
field_0x00e0[mSelectNum] = SelEndFrameTbl[mSelectNum];
|
||||
|
||||
field_0x0084->setFrame(field_0x00e0[mSelectNum]);
|
||||
@@ -2732,7 +2734,7 @@ void dFile_select_c::dataSelectMoveAnime() {
|
||||
}
|
||||
}
|
||||
|
||||
if (iVar7 == 1 && iVar6 == 1 && bVar1 && (iVar5 == 1 && !bVar2)) {
|
||||
if (iVar7 == true && iVar6 == true && bVar1 == true && iVar5 == true && bVar2 == true) {
|
||||
if (mSelectNum != 0xff) {
|
||||
field_0x00bc[mSelectNum]->getPanePtr()->setAnimation((J2DAnmTransform*)0);
|
||||
selFileCursorShow();
|
||||
@@ -5719,9 +5721,10 @@ asm void dDlst_FileSelCp_c::draw() {
|
||||
|
||||
/* 8018E0C0-8018E0F8 188A00 0038+00 1/0 0/0 0/0 .text draw__17dDlst_FileSelYn_cFv */
|
||||
#ifdef NONMATCHING
|
||||
// matches with literals
|
||||
void dDlst_FileSelYn_c::draw() {
|
||||
J2DGrafContext* graf = dComIfGp_getCurrentGrafPort();
|
||||
mpScreen->draw(0.0f, 0.0f, graf);
|
||||
ScrYn->draw(0.0f, 0.0f, graf);
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
@@ -5736,9 +5739,10 @@ asm void dDlst_FileSelYn_c::draw() {
|
||||
|
||||
/* 8018E0F8-8018E130 188A38 0038+00 1/0 0/0 0/0 .text draw__17dDlst_FileSel3m_cFv */
|
||||
#ifdef NONMATCHING
|
||||
// matches with literals
|
||||
void dDlst_FileSel3m_c::draw() {
|
||||
J2DGrafContext* graf = dComIfGp_getCurrentGrafPort();
|
||||
mpScreen->draw(0.0f, 0.0f, graf);
|
||||
Scr3m->draw(0.0f, 0.0f, graf);
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
@@ -6603,6 +6607,7 @@ bool dFile_select_c::fileRecScaleAnm() {
|
||||
/* 8018FE64-8018FEF4 18A7A4 0090+00 2/2 0/0 0/0 .text fileRecScaleAnmInitSet2__14dFile_select_cFff
|
||||
*/
|
||||
#ifdef NONMATCHING
|
||||
// matches with literals
|
||||
void dFile_select_c::fileRecScaleAnmInitSet2(f32 param_1, f32 param_2) {
|
||||
for (int i = 0; (int)i < 3; i++) {
|
||||
field_0x00c8[i] = param_1;
|
||||
|
||||
+295
-313
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+17
-19
@@ -1529,12 +1529,11 @@ void dSv_info_c::onSwitch(int i_no, int i_roomNo) {
|
||||
} else if (i_no < (MEMORY_SWITCH + DAN_SWITCH)) {
|
||||
mDan.onSwitch(i_no - MEMORY_SWITCH);
|
||||
} else {
|
||||
int zoneId = dStage_roomControl_c::getZoneNo(i_roomNo);
|
||||
int zoneId = dComIfGp_roomControl_getZoneNo(i_roomNo);
|
||||
if (i_no < (MEMORY_SWITCH + DAN_SWITCH + ZONE_SWITCH)) {
|
||||
mZone[zoneId].getZoneBit().onSwitch(i_no - (MEMORY_SWITCH + DAN_SWITCH));
|
||||
mZone[zoneId].getBit().onSwitch(i_no - (MEMORY_SWITCH + DAN_SWITCH));
|
||||
} else {
|
||||
mZone[zoneId].getZoneBit().onOneSwitch(i_no -
|
||||
(MEMORY_SWITCH + DAN_SWITCH + ZONE_SWITCH));
|
||||
mZone[zoneId].getBit().onOneSwitch(i_no - (MEMORY_SWITCH + DAN_SWITCH + ZONE_SWITCH));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1550,12 +1549,11 @@ void dSv_info_c::offSwitch(int i_no, int i_roomNo) {
|
||||
} else if (i_no < (MEMORY_SWITCH + DAN_SWITCH)) {
|
||||
mDan.offSwitch(i_no - MEMORY_SWITCH);
|
||||
} else {
|
||||
int zoneId = dStage_roomControl_c::getZoneNo(i_roomNo);
|
||||
int zoneId = dComIfGp_roomControl_getZoneNo(i_roomNo);
|
||||
if (i_no < (MEMORY_SWITCH + DAN_SWITCH + ZONE_SWITCH)) {
|
||||
mZone[zoneId].getZoneBit().offSwitch(i_no - (MEMORY_SWITCH + DAN_SWITCH));
|
||||
mZone[zoneId].getBit().offSwitch(i_no - (MEMORY_SWITCH + DAN_SWITCH));
|
||||
} else {
|
||||
mZone[zoneId].getZoneBit().offOneSwitch(i_no -
|
||||
(MEMORY_SWITCH + DAN_SWITCH + ZONE_SWITCH));
|
||||
mZone[zoneId].getBit().offOneSwitch(i_no - (MEMORY_SWITCH + DAN_SWITCH + ZONE_SWITCH));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1571,7 +1569,7 @@ BOOL dSv_info_c::isSwitch(int i_no, int i_roomNo) const {
|
||||
} else if (i_no < (MEMORY_SWITCH + DAN_SWITCH)) {
|
||||
return mDan.isSwitch(i_no - MEMORY_SWITCH);
|
||||
} else {
|
||||
int zoneId = dStage_roomControl_c::getZoneNo(i_roomNo);
|
||||
int zoneId = dComIfGp_roomControl_getZoneNo(i_roomNo);
|
||||
if (zoneId < 0 || zoneId >= ZONE_MAX) {
|
||||
return FALSE;
|
||||
} else {
|
||||
@@ -1596,11 +1594,11 @@ BOOL dSv_info_c::revSwitch(int i_no, int i_roomNo) {
|
||||
} else if (i_no < (MEMORY_SWITCH + DAN_SWITCH)) {
|
||||
return mDan.revSwitch(i_no - MEMORY_SWITCH);
|
||||
} else {
|
||||
int zoneNo = dStage_roomControl_c::getZoneNo(i_roomNo);
|
||||
int zoneNo = dComIfGp_roomControl_getZoneNo(i_roomNo);
|
||||
if (i_no < (MEMORY_SWITCH + DAN_SWITCH + ZONE_SWITCH)) {
|
||||
return mZone[zoneNo].getZoneBit().revSwitch(i_no - (MEMORY_SWITCH + DAN_SWITCH));
|
||||
return mZone[zoneNo].getBit().revSwitch(i_no - (MEMORY_SWITCH + DAN_SWITCH));
|
||||
} else {
|
||||
return mZone[zoneNo].getZoneBit().revOneSwitch(
|
||||
return mZone[zoneNo].getBit().revOneSwitch(
|
||||
i_no - (MEMORY_SWITCH + DAN_SWITCH + ZONE_SWITCH));
|
||||
}
|
||||
}
|
||||
@@ -1617,11 +1615,11 @@ void dSv_info_c::onItem(int i_no, int i_roomNo) {
|
||||
} else if (i_no < (MEMORY_ITEM + DAN_ITEM)) {
|
||||
mMemory.getBit().onItem(i_no - MEMORY_ITEM);
|
||||
} else {
|
||||
int zoneNo = dStage_roomControl_c::getZoneNo(i_roomNo);
|
||||
int zoneNo = dComIfGp_roomControl_getZoneNo(i_roomNo);
|
||||
if (i_no < (MEMORY_ITEM + DAN_ITEM + ZONE_ITEM)) {
|
||||
mZone[zoneNo].getZoneBit().onItem(i_no - (MEMORY_ITEM + DAN_ITEM));
|
||||
mZone[zoneNo].getBit().onItem(i_no - (MEMORY_ITEM + DAN_ITEM));
|
||||
} else {
|
||||
mZone[zoneNo].getZoneBit().onOneItem(i_no - (MEMORY_ITEM + DAN_ITEM + ZONE_ITEM));
|
||||
mZone[zoneNo].getBit().onOneItem(i_no - (MEMORY_ITEM + DAN_ITEM + ZONE_ITEM));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1637,7 +1635,7 @@ BOOL dSv_info_c::isItem(int i_no, int i_roomNo) const {
|
||||
} else if (i_no < (MEMORY_ITEM + DAN_ITEM)) {
|
||||
return mMemory.getBit().isItem(i_no - MEMORY_ITEM);
|
||||
} else {
|
||||
int zoneNo = dStage_roomControl_c::getZoneNo(i_roomNo);
|
||||
int zoneNo = dComIfGp_roomControl_getZoneNo(i_roomNo);
|
||||
if (i_no < (MEMORY_ITEM + DAN_ITEM + ZONE_ITEM)) {
|
||||
return mZone[zoneNo].getBit().isItem(i_no - (MEMORY_ITEM + DAN_ITEM));
|
||||
} else {
|
||||
@@ -1652,7 +1650,7 @@ void dSv_info_c::onActor(int i_id, int i_roomNo) {
|
||||
return;
|
||||
}
|
||||
|
||||
int zoneNo = dStage_roomControl_c::getZoneNo(i_roomNo);
|
||||
int zoneNo = dComIfGp_roomControl_getZoneNo(i_roomNo);
|
||||
mZone[zoneNo].getActor().on(i_id);
|
||||
}
|
||||
|
||||
@@ -1662,7 +1660,7 @@ void dSv_info_c::offActor(int i_id, int i_roomNo) {
|
||||
return;
|
||||
}
|
||||
|
||||
int zoneNo = dStage_roomControl_c::getZoneNo(i_roomNo);
|
||||
int zoneNo = dComIfGp_roomControl_getZoneNo(i_roomNo);
|
||||
mZone[zoneNo].getActor().off(i_id);
|
||||
}
|
||||
|
||||
@@ -1672,7 +1670,7 @@ BOOL dSv_info_c::isActor(int i_id, int i_roomNo) const {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int zoneNo = dStage_roomControl_c::getZoneNo(i_roomNo);
|
||||
int zoneNo = dComIfGp_roomControl_getZoneNo(i_roomNo);
|
||||
return mZone[zoneNo].getActor().is(i_id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user