mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-20 13:45:14 -04:00
More demo work, cleanup
This commit is contained in:
@@ -31,18 +31,18 @@ u8 daAndsw2_c::getEventNo() {
|
||||
/* 00000084-00000090 .text getSwbit__10daAndsw2_cFv */
|
||||
u8 daAndsw2_c::getSwbit() {
|
||||
// Switch to set.
|
||||
return (base.mParameters & 0x00FF0000) >> 16;
|
||||
return (fopAcM_GetParam(this) & 0x00FF0000) >> 16;
|
||||
}
|
||||
|
||||
/* 00000090-0000009C .text getSwbit2__10daAndsw2_cFv */
|
||||
u8 daAndsw2_c::getSwbit2() {
|
||||
// First switch to check.
|
||||
return (base.mParameters & 0xFF000000) >> 24;
|
||||
return (fopAcM_GetParam(this) & 0xFF000000) >> 24;
|
||||
}
|
||||
|
||||
/* 0000009C-000000A8 .text getType__10daAndsw2_cFv */
|
||||
u8 daAndsw2_c::getType() {
|
||||
return (base.mParameters & 0x0000FF00) >> 8;
|
||||
return (fopAcM_GetParam(this) & 0x0000FF00) >> 8;
|
||||
}
|
||||
|
||||
/* 000000A8-000000B4 .text getTimer__10daAndsw2_cFv */
|
||||
@@ -53,7 +53,7 @@ u8 daAndsw2_c::getTimer() {
|
||||
/* 000000B4-000000C0 .text getNum__10daAndsw2_cFv */
|
||||
u8 daAndsw2_c::getNum() {
|
||||
// Number of switches to check.
|
||||
return (base.mParameters & 0x000000FF) >> 0;
|
||||
return (fopAcM_GetParam(this) & 0x000000FF) >> 0;
|
||||
}
|
||||
|
||||
/* 000000C0-00000130 .text getTopSw__10daAndsw2_cFv */
|
||||
|
||||
@@ -50,8 +50,8 @@ static cPhs_State daKytag04_Create(fopAc_ac_c* i_this) {
|
||||
fopAcM_SetupActor(i_this, kytag04_class);
|
||||
kytag04_class* a_this = (kytag04_class*)i_this;
|
||||
a_this->mState = 0;
|
||||
a_this->mOffColPat = a_this->base.mParameters;
|
||||
a_this->mOnColPat = a_this->base.mParameters >> 8;
|
||||
a_this->mOffColPat = fopAcM_GetParam(a_this) & 0xFF;
|
||||
a_this->mOnColPat = (fopAcM_GetParam(a_this) >> 8) & 0xFF;
|
||||
a_this->mSwitchNo = a_this->current.angle.x;
|
||||
a_this->mScaleX = a_this->scale.x * 100.0f;
|
||||
a_this->mScaleY = a_this->scale.y * 100.0f;
|
||||
|
||||
@@ -135,7 +135,7 @@ static cPhs_State daKytag05_Create(fopAc_ac_c* i_this) {
|
||||
|
||||
a_this->mIndex = 0;
|
||||
a_this->mTimer = 0;
|
||||
a_this->mUnknownParam = i_this->base.mParameters & 0xff;
|
||||
a_this->mUnknownParam = fopAcM_GetParam(i_this) & 0xff;
|
||||
dKyw_evt_wind_set_go();
|
||||
dKyw_evt_wind_set(0, 0);
|
||||
g_env_light.mSnowCount = 200;
|
||||
|
||||
@@ -489,7 +489,7 @@ static BOOL daSail_Draw(sail_class* i_this) {
|
||||
mDoMtx_XrotM(*calc_mtx, i_this->current.angle.x);
|
||||
mDoMtx_ZrotM(*calc_mtx, i_this->current.angle.z);
|
||||
|
||||
mDoMtx_concat(j3dSys.mViewMtx, *calc_mtx, *i_this->mSailPacket.getMtx());
|
||||
mDoMtx_concat(j3dSys.getViewMtx(), *calc_mtx, *i_this->mSailPacket.getMtx());
|
||||
|
||||
cXyz* vtxPos = i_this->mSailPacket.getPos();
|
||||
MtxTrans(
|
||||
@@ -503,7 +503,7 @@ static BOOL daSail_Draw(sail_class* i_this) {
|
||||
mDoMtx_XrotM(*calc_mtx, i_this->current.angle.x);
|
||||
mDoMtx_ZrotM(*calc_mtx, i_this->current.angle.z);
|
||||
|
||||
mDoMtx_concat(j3dSys.mViewMtx, *calc_mtx, *i_this->mSailPacket.getStickMtx());
|
||||
mDoMtx_concat(j3dSys.getViewMtx(), *calc_mtx, *i_this->mSailPacket.getStickMtx());
|
||||
i_this->mSailPacket.mStickModel->setBaseTRMtx(*calc_mtx);
|
||||
|
||||
MtxTrans(0.0f, 0.0f, 0.0f, 0);
|
||||
|
||||
@@ -250,16 +250,17 @@ void hand_move(shand_class* i_this) {
|
||||
case 1:
|
||||
if((fopAcM_GetParam(actor) & 0xFF) != 1){
|
||||
dBgS_GndChk local_ac;
|
||||
float chk_pos_x = actor->current.pos.x, chk_pos_y = actor->current.pos.y, chk_pos_z = actor->current.pos.z;
|
||||
chk_pos_y -= 100.0f;
|
||||
local_ac.GetPointP()->set(chk_pos_x, chk_pos_y, chk_pos_z);
|
||||
Vec chk_pos;
|
||||
chk_pos = actor->current.pos;
|
||||
chk_pos.y -= 100.0f;
|
||||
local_ac.SetPos(&chk_pos);
|
||||
i_this->ground_y = dComIfG_Bgsp()->GroundCross(&local_ac);
|
||||
|
||||
dBgS_ObjGndChk_Spl local_100;
|
||||
chk_pos_x = actor->current.pos.x, chk_pos_y = actor->current.pos.y, chk_pos_z = actor->current.pos.z;
|
||||
chk_pos_y += 200.0f;
|
||||
local_100.GetPointP()->set(chk_pos_x, chk_pos_y, chk_pos_z);
|
||||
float spl_ground_y = dComIfG_Bgsp()->GroundCross(&local_100) + 10.0f;
|
||||
chk_pos = actor->current.pos;
|
||||
chk_pos.y += 200.0f;
|
||||
local_100.SetPos(&chk_pos);
|
||||
f32 spl_ground_y = dComIfG_Bgsp()->GroundCross(&local_100) + 10.0f;
|
||||
if(spl_ground_y != -G_CM3D_F_INF){
|
||||
i_this->ground_y = spl_ground_y;
|
||||
}
|
||||
|
||||
@@ -17,22 +17,22 @@ static u8 msg_mode;
|
||||
|
||||
/* 00000078-00000084 .text getEventNo__11daTag_Msg_cFv */
|
||||
u32 daTag_Msg_c::getEventNo() {
|
||||
return base.mParameters >> 0x18;
|
||||
return fopAcM_GetParam(this) >> 0x18;
|
||||
}
|
||||
|
||||
/* 00000084-00000090 .text getSwbit__11daTag_Msg_cFv */
|
||||
u32 daTag_Msg_c::getSwbit() {
|
||||
return base.mParameters >> 8 & 0xff;
|
||||
return (fopAcM_GetParam(this) >> 8) & 0xff;
|
||||
}
|
||||
|
||||
/* 00000090-0000009C .text getSwbit2__11daTag_Msg_cFv */
|
||||
u32 daTag_Msg_c::getSwbit2() {
|
||||
return base.mParameters >> 0x10 & 0xff;
|
||||
return (fopAcM_GetParam(this) >> 0x10) & 0xff;
|
||||
}
|
||||
|
||||
/* 0000009C-000000A8 .text getType2__11daTag_Msg_cFv */
|
||||
u32 daTag_Msg_c::getType2() {
|
||||
return base.mParameters >> 6 & 3;
|
||||
return (fopAcM_GetParam(this) >> 6) & 3;
|
||||
}
|
||||
|
||||
/* 000000A8-0000015C .text myDemoName__11daTag_Msg_cFv */
|
||||
|
||||
@@ -109,7 +109,9 @@ bool daBomb_c::chk_state(daBomb_c::State_e state) const {
|
||||
|
||||
/* 800682C0-800682F0 .text change_state__8daBomb_cFQ28daBomb_c7State_e */
|
||||
void daBomb_c::change_state(daBomb_c::State_e new_state) {
|
||||
base.mParameters = (base.mParameters & ~(((1 << PRM_STATE_W) - 1) << PRM_STATE_S)) | (new_state << PRM_STATE_S); // & 0xFF000000
|
||||
u32 params = fopAcM_GetParam(this) & ~(((1 << PRM_STATE_W) - 1) << PRM_STATE_S);
|
||||
params |= (new_state << PRM_STATE_S);
|
||||
fopAcM_SetParam(this, params);
|
||||
|
||||
_prm_chk_version();
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ void dBgS_Acch::GroundCheck(dBgS& i_bgs) {
|
||||
|
||||
pos.y += m_ground_up_h_diff + (m_ground_check_offset - m_ground_up_h);
|
||||
m_ground_up_h_diff = 0.0f;
|
||||
m_gnd.m_pos = pos;
|
||||
m_gnd.SetPos(&pos);
|
||||
|
||||
m_ground_h = i_bgs.GroundCross(&m_gnd);
|
||||
if (m_ground_h != -G_CM3D_F_INF) {
|
||||
|
||||
@@ -32,25 +32,23 @@ void dCcMassS_Mng::Ct() {
|
||||
void dCcMassS_Mng::Prepare() {
|
||||
cM3dGAab area;
|
||||
area.ClearForMinMax();
|
||||
cCcD_ShapeAttr* attr;
|
||||
for (dCcMassS_Obj* mass = mMassObjs; mass < mMassObjs + mMassObjCount; mass++) {
|
||||
cCcD_Obj* pobj = mass->GetObj();
|
||||
JUT_ASSERT(61, pobj != NULL);
|
||||
attr = pobj->GetShapeAttr();
|
||||
cCcD_ShapeAttr* attr = pobj->GetShapeAttr();
|
||||
attr->CalcAabBox();
|
||||
area.SetMinMax(attr->GetWorkAab());
|
||||
}
|
||||
for (dCcMassS_Obj* mass = mMassAreas; mass < mMassAreas + mMassAreaCount; mass++) {
|
||||
cCcD_Obj* parea = mass->GetObj();
|
||||
JUT_ASSERT(73, parea != NULL);
|
||||
attr = parea->GetShapeAttr();
|
||||
cCcD_ShapeAttr* attr = parea->GetShapeAttr();
|
||||
attr->CalcAabBox();
|
||||
area.SetMinMax(attr->GetWorkAab());
|
||||
}
|
||||
if (mFlag & 1) {
|
||||
mCpsAttr.CalcAabBox();
|
||||
attr = &mCpsAttr;
|
||||
area.SetMinMax(attr->GetWorkAab());
|
||||
area.SetMinMax(mCpsAttr.GetWorkAab());
|
||||
}
|
||||
mDivideArea.SetArea(area);
|
||||
for (dCcMassS_Obj* mass = mMassObjs; mass < mMassObjs + mMassObjCount; mass++) {
|
||||
|
||||
@@ -479,8 +479,3 @@ bool dCcS::ChkNoHitGCo(cCcD_Obj* obj1, cCcD_Obj* obj2) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 800AE930-800AE938 .text ChkNoHitGAtTg__4cCcSFPC12cCcD_GObjInfPC12cCcD_GObjInfP10cCcD_GSttsP10cCcD_GStts */
|
||||
bool cCcS::ChkNoHitGAtTg(const cCcD_GObjInf*, const cCcD_GObjInf*, cCcD_GStts*, cCcD_GStts*) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+2
-2
@@ -86,7 +86,7 @@ void def_se_set_p(fopAc_ac_c* actor, cXyz* sePos, cCcD_Obj* obj, unsigned long r
|
||||
|
||||
/* 800AEBCC-800AEEF8 .text at_power_check__FP8CcAtInfo */
|
||||
fopAc_ac_c* at_power_check(CcAtInfo* atInfo) {
|
||||
daPy_py_c* player = daPy_getPlayerActorClass();
|
||||
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
|
||||
if (atInfo->mpObj == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -209,7 +209,7 @@ fopAc_ac_c* cc_at_check(fopAc_ac_c* tgActor, CcAtInfo* atInfo) {
|
||||
|
||||
if (fopAcM_GetName(atInfo->mpActor) == PROC_HIMO2 && tgActor->stealItemLeft != 0) {
|
||||
tgActor->stealItemLeft--;
|
||||
fopAcM_createStealItem(&tgActor->current.pos, tgActor->itemTableIdx, tgActor->current.roomNo, NULL, tgActor->stealItemBitNo);
|
||||
fopAcM_createStealItem(&tgActor->current.pos, tgActor->itemTableIdx, fopAcM_GetRoomNo(tgActor), NULL, tgActor->stealItemBitNo);
|
||||
tgActor->stealItemBitNo++;
|
||||
atInfo->mDamage = 0;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ dOvlpFd4_c::dOvlpFd4_c() {
|
||||
first = true;
|
||||
setExecute(&dOvlpFd4_c::execFirstSnap);
|
||||
setDraw(&dOvlpFd4_c::drawFadeOut);
|
||||
if (base.mProcName == PROC_OVERLAP4) {
|
||||
if (fopOvlpM_GetName(this) == PROC_OVERLAP4) {
|
||||
fadeOutComposite_dlst.init(mDoGph_gInf_c::getFrameBufferTimg(), 0.0f, 0.0f, 640.0f, 480.0f, g_saftyWhiteColor);
|
||||
} else {
|
||||
fadeOutComposite_dlst.init(mDoGph_gInf_c::getFrameBufferTimg(), 0.0f, 0.0f, 640.0f, 480.0f, (GXColor){ 0x00, 0x00, 0x00, 0x00 });
|
||||
|
||||
@@ -65,11 +65,10 @@ void dADM_CharTbl::SetUpIndex() {
|
||||
/* 800C2B40-800C2BC8 .text GetNameIndex2__12dADM_CharTblCFPCci */
|
||||
int dADM_CharTbl::GetNameIndex2(const char* pName, int index) const {
|
||||
for (int start = 0; ; start++) {
|
||||
int col = GetNameIndex(pName, start);
|
||||
if (col == -1)
|
||||
start = GetNameIndex(pName, start);
|
||||
if (start == -1)
|
||||
return -1;
|
||||
|
||||
start = col;
|
||||
int inf = GetInf(mIndex_ARG, start);
|
||||
if (index == inf)
|
||||
return start;
|
||||
@@ -117,7 +116,7 @@ void dADM::SetData(void* pData) {
|
||||
}
|
||||
|
||||
if (FindTag('ACFN', &row, &rowOffs) && FindTag('ACNA', &name, &nameOffs) && FindTag('ACDS', &dat_size, &dataOffs)) {
|
||||
JUT_ASSERT(0xca, row * name == dat_size);
|
||||
JUT_ASSERT(202, row * name == dat_size);
|
||||
mCharTbl.SetData((u32)pData, row, rowOffs, name, nameOffs, dat_size, dataOffs);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -194,7 +194,7 @@ int stayRoomCheck(int roomCount, u8* rooms, int roomNo) {
|
||||
|
||||
/* 80040DDC-80040E38 .text createRoomScene__Fi */
|
||||
int createRoomScene(int param_0) {
|
||||
int* ptr = (int*)JKRHeap::alloc(4, -4, NULL);
|
||||
int* ptr = (int*)JKRAlloc(4, -4);
|
||||
if (ptr == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user