mirror of
https://github.com/zeldaret/tp
synced 2026-06-27 10:43:03 -04:00
Various Matches, J2DTextBoxEx and J2DTevs OK (#2025)
* Work on src/d/bg * misc work * J2dTextBoxEx OK * J2DTevs OK * Better return values for bool
This commit is contained in:
+17
-36
@@ -1,30 +1,10 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: d/bg/d_bg_plc
|
||||
//
|
||||
|
||||
#include "d/bg/d_bg_plc.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __ct__6dBgPlcFv();
|
||||
extern "C" void __dt__6dBgPlcFv();
|
||||
extern "C" void setBase__6dBgPlcFPv();
|
||||
extern "C" void getCode__6dBgPlcCFiPP5sBgPc();
|
||||
extern "C" void getGrpCode__6dBgPlcCFi();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void __dl__FPv();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
|
||||
/* 80074074-80074080 06E9B4 000C+00 0/0 1/1 0/0 .text __ct__6dBgPlcFv */
|
||||
dBgPlc::dBgPlc() {
|
||||
@@ -36,25 +16,26 @@ dBgPlc::~dBgPlc() {}
|
||||
|
||||
/* 800740BC-800740C4 -00001 0008+00 0/0 0/0 0/0 .text setBase__6dBgPlcFPv */
|
||||
void dBgPlc::setBase(void* p_base) {
|
||||
m_base = p_base;
|
||||
m_base = (PLC*)p_base;
|
||||
}
|
||||
|
||||
/* 800740C4-800740DC 06EA04 0018+00 0/0 1/1 0/0 .text getCode__6dBgPlcCFiPP5sBgPc */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void dBgPlc::getCode(int param_0, sBgPc** param_1) const {
|
||||
nofralloc
|
||||
#include "asm/d/bg/d_bg_plc/getCode__6dBgPlcCFiPP5sBgPc.s"
|
||||
sBgPc* dBgPlc::getCode(int index, sBgPc** param_1) const {
|
||||
JUT_ASSERT(45, m_base != 0);
|
||||
JUT_ASSERT(46, m_base->m_code_size == ZELDA_CODE_SIZE);
|
||||
JUT_ASSERT(47, index >= 0 && index< m_base->m_num);
|
||||
sBgPc* rv = m_base->field_0x8;
|
||||
rv += index;
|
||||
*param_1 = rv;
|
||||
return rv;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 800740DC-800740F4 06EA1C 0018+00 0/0 1/1 0/0 .text getGrpCode__6dBgPlcCFi */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm u32 dBgPlc::getGrpCode(int param_0) const {
|
||||
nofralloc
|
||||
#include "asm/d/bg/d_bg_plc/getGrpCode__6dBgPlcCFi.s"
|
||||
u32 dBgPlc::getGrpCode(int index) const {
|
||||
JUT_ASSERT(62, m_base != 0);
|
||||
JUT_ASSERT(63, m_base->m_code_size == ZELDA_CODE_SIZE);
|
||||
JUT_ASSERT(64, 0 <= index && index < m_base->m_num);
|
||||
sBgPc* rv = m_base->field_0x8;
|
||||
rv += index;
|
||||
return rv->code4;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
@@ -1,43 +1,8 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: d/bg/d_bg_s_grp_pass_chk
|
||||
// d/bg/d_bg_s_grp_pass_chk.cpp
|
||||
//
|
||||
|
||||
#include "d/bg/d_bg_s_grp_pass_chk.h"
|
||||
#include "dol2asm.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __ct__15dBgS_GrpPassChkFv();
|
||||
extern "C" void __dt__15dBgS_GrpPassChkFv();
|
||||
extern "C" void __dt__15cBgS_GrpPassChkFv();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void __dl__FPv();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 803AB7A8-803AB7B4 0088C8 000C+00 2/2 0/0 0/0 .data __vt__15dBgS_GrpPassChk */
|
||||
SECTION_DATA extern void* __vt__15dBgS_GrpPassChk[3] = {
|
||||
(void*)NULL /* RTTI */,
|
||||
(void*)NULL,
|
||||
(void*)__dt__15dBgS_GrpPassChkFv,
|
||||
};
|
||||
|
||||
/* 803AB7B4-803AB7C0 0088D4 000C+00 3/3 0/0 0/0 .data __vt__15cBgS_GrpPassChk */
|
||||
SECTION_DATA extern void* __vt__15cBgS_GrpPassChk[3] = {
|
||||
(void*)NULL /* RTTI */,
|
||||
(void*)NULL,
|
||||
(void*)__dt__15cBgS_GrpPassChkFv,
|
||||
};
|
||||
|
||||
/* 80077BA0-80077BC4 0724E0 0024+00 0/0 1/1 0/0 .text __ct__15dBgS_GrpPassChkFv */
|
||||
dBgS_GrpPassChk::dBgS_GrpPassChk() {
|
||||
@@ -45,15 +10,4 @@ dBgS_GrpPassChk::dBgS_GrpPassChk() {
|
||||
}
|
||||
|
||||
/* 80077BC4-80077C20 072504 005C+00 1/0 1/1 0/0 .text __dt__15dBgS_GrpPassChkFv */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
// asm dBgS_GrpPassChk::~dBgS_GrpPassChk() {
|
||||
extern "C" asm void __dt__15dBgS_GrpPassChkFv() {
|
||||
nofralloc
|
||||
#include "asm/d/bg/d_bg_s_grp_pass_chk/__dt__15dBgS_GrpPassChkFv.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 80077C20-80077C68 072560 0048+00 1/0 0/0 0/0 .text __dt__15cBgS_GrpPassChkFv */
|
||||
cBgS_GrpPassChk::~cBgS_GrpPassChk() {}
|
||||
dBgS_GrpPassChk::~dBgS_GrpPassChk() {}
|
||||
|
||||
+93
-16
@@ -7,6 +7,7 @@
|
||||
#include "d/bg/d_bg_pc.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "dol2asm.h"
|
||||
#include "rel/d/a/d_a_horse/d_a_horse.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
@@ -222,15 +223,34 @@ bool dBgWKCol::GetTriPnt(int poly_index, Vec* param_1, Vec* param_2, Vec* param_
|
||||
|
||||
/* 8007E9D4-8007EB28 079314 0154+00 3/3 0/0 0/0 .text
|
||||
* GetTriPnt__8dBgWKColCFPC12KC_PrismDataP3VecP3VecP3Vec */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm bool dBgWKCol::GetTriPnt(KC_PrismData const* param_0, Vec* param_1, Vec* param_2,
|
||||
Vec* param_3) const {
|
||||
nofralloc
|
||||
#include "asm/d/bg/d_bg_w_kcol/GetTriPnt__8dBgWKColCFPC12KC_PrismDataP3VecP3VecP3Vec.s"
|
||||
bool dBgWKCol::GetTriPnt(KC_PrismData const* param_1, Vec* param_2, Vec* param_3,
|
||||
Vec* param_4) const {
|
||||
pkcdata* pkcData = m_pkc_head;
|
||||
*param_2 = pkcData->field_0x0[param_1->field_0x4];
|
||||
Vec* vec6 = &pkcData->field_0x4[param_1->field_0x6];
|
||||
Vec* veca = &pkcData->field_0x4[param_1->field_0xa];
|
||||
Vec* vecc = &pkcData->field_0x4[param_1->field_0xc];
|
||||
|
||||
Vec auStack_64;
|
||||
VECCrossProduct(vec6, &pkcData->field_0x4[param_1->field_0x8], &auStack_64);
|
||||
Vec auStack_70;
|
||||
VECCrossProduct(veca, vec6, &auStack_70);
|
||||
f32 dVar11 = VECDotProduct(&auStack_64,vecc);
|
||||
if (cM3d_IsZero(dVar11)) {
|
||||
return false;
|
||||
}
|
||||
dVar11 = param_1->field_0x0 / dVar11;
|
||||
VECScale(&auStack_64, &auStack_64, dVar11);
|
||||
VECAdd(&auStack_64, param_2, param_4);
|
||||
dVar11 = VECDotProduct(&auStack_70,vecc);
|
||||
if (cM3d_IsZero(dVar11)) {
|
||||
return false;
|
||||
}
|
||||
dVar11 = param_1->field_0x0 / dVar11;
|
||||
VECScale(&auStack_70, &auStack_70, dVar11);
|
||||
VECAdd(&auStack_70, param_2, param_3);
|
||||
return true;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8007EB28-8007EB30 079468 0008+00 1/0 0/0 0/0 .text GetBnd__8dBgWKColCFv */
|
||||
cM3dGAab* dBgWKCol::GetBnd() const {
|
||||
@@ -260,15 +280,72 @@ void dBgWKCol::getPolyCode(int poly_index, dBgPc* pbgpc) const {
|
||||
|
||||
/* 8007EBC4-8007EE34 079504 0270+00 8/8 0/0 0/0 .text
|
||||
* chkPolyThrough__8dBgWKColCFP5dBgPcP16cBgS_PolyPassChkP15cBgS_GrpPassChkR4cXyz */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm bool dBgWKCol::chkPolyThrough(dBgPc* param_0, cBgS_PolyPassChk* param_1,
|
||||
cBgS_GrpPassChk* param_2, cXyz& param_3) const {
|
||||
nofralloc
|
||||
#include "asm/d/bg/d_bg_w_kcol/chkPolyThrough__8dBgWKColCFP5dBgPcP16cBgS_PolyPassChkP15cBgS_GrpPassChkR4cXyz.s"
|
||||
bool dBgWKCol::chkPolyThrough(dBgPc* ppoly, cBgS_PolyPassChk* param_2,
|
||||
cBgS_GrpPassChk* param_3, cXyz& param_4) const {
|
||||
JUT_ASSERT(279, ppoly != 0);
|
||||
|
||||
if (param_3 != NULL) {
|
||||
if (ppoly->maskNrm() == 0) {
|
||||
if (((dBgS_GrpPassChk*)param_3)->MaskNormalGrp() == 0) {
|
||||
return true;
|
||||
}
|
||||
} else if (ppoly->getWtr() != 0 &&
|
||||
(((dBgS_GrpPassChk*)param_3)->MaskWaterGrp() == 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (param_2 != NULL) {
|
||||
dBgS_PolyPassChk* polypass = (dBgS_PolyPassChk*)param_2;
|
||||
if (polypass->ChkObj() && ppoly->getObjThrough() != 0) {
|
||||
return true;
|
||||
}
|
||||
if (polypass->ChkCam() && ppoly->getCamThrough() != 0) {
|
||||
return true;
|
||||
}
|
||||
if ((polypass->ChkLink() && ppoly->getLinkThrough() != 0) ||
|
||||
(polypass->ChkHorse() && ppoly->getLinkThrough() != 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (polypass->ChkArrow() && ppoly->getArrowThrough() != 0) {
|
||||
return true;
|
||||
}
|
||||
if (polypass->ChkBomb() && ppoly->getBombThrough() != 0) {
|
||||
return true;
|
||||
}
|
||||
if (polypass->ChkBoomerang() && ppoly->getBoomerangThrough() != 0) {
|
||||
return true;
|
||||
}
|
||||
if (polypass->ChkRope() && ppoly->getRopeThrough() != 0) {
|
||||
return true;
|
||||
}
|
||||
if (polypass->ChkUnderwaterRoof() && ppoly->getUnderwaterRoof() != 0) {
|
||||
return true;
|
||||
}
|
||||
if (ppoly->getWallCode() == 8 && polypass->ChkNoHorse())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (ppoly->getWallCode() == 9) {
|
||||
if (polypass->ChkNoHorse()) {
|
||||
return true;
|
||||
}
|
||||
if (polypass->ChkHorse() && i_dComIfGp_getHorseActor() != NULL) {
|
||||
if (!i_dComIfGp_getHorseActor()->checkSpecialWallHit(param_4)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (polypass->ChkStatue() && ppoly->getSpl() == 7) {
|
||||
return true;
|
||||
}
|
||||
if (polypass->ChkIronBall() && ppoly->getIronBallThrough() != 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80452718-8045271C 000D18 0004+00 5/5 0/0 0/0 .sdata2 @4187 */
|
||||
|
||||
+14
-24
@@ -1474,10 +1474,6 @@ s32 fopAcM_createItemForTrBoxDemo(cXyz const* i_pos, int i_itemNo, int i_itemBit
|
||||
}
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80451C28-80451C2C 000228 0004+00 1/1 0/0 0/0 .sdata2 @5584 */
|
||||
SECTION_SDATA2 static f32 lit_5584 = 15.999899864196777f;
|
||||
|
||||
struct ItemTableList {
|
||||
/* 0x00 */ char mListName[11];
|
||||
/* 0x0B */ u8 mTableNum;
|
||||
@@ -1487,7 +1483,6 @@ struct ItemTableList {
|
||||
|
||||
/* 8001BCFC-8001BE14 01663C 0118+00 2/2 0/0 0/0 .text fopAcM_getItemNoFromTableNo__FUc */
|
||||
// out of order instructions / regalloc
|
||||
#ifdef NONMATCHING
|
||||
u8 fopAcM_getItemNoFromTableNo(u8 i_tableNo) {
|
||||
u8 tableNo = i_tableNo;
|
||||
ItemTableList* tableList = (ItemTableList*)dComIfGp_getItemTable();
|
||||
@@ -1518,18 +1513,8 @@ u8 fopAcM_getItemNoFromTableNo(u8 i_tableNo) {
|
||||
break;
|
||||
}
|
||||
|
||||
return tableList->mTables[tableNo][(int)cM_rndF(15.999f)];
|
||||
return tableList->mTables[tableNo][(int)cM_rndF(15.999899864196777f)];
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm u8 fopAcM_getItemNoFromTableNo(u8 param_0) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_actor_mng/fopAcM_getItemNoFromTableNo__FUc.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
struct EnemyTableList {
|
||||
/* 0x0 */ u32 mTag;
|
||||
@@ -1687,7 +1672,7 @@ inline u32 maskShift(int val, int bits, int shift) {
|
||||
return (val & ((1 << bits) - 1)) << shift;
|
||||
}
|
||||
|
||||
inline u32 makeItemParams(int iNo, int p8, int unk, int p9) {
|
||||
inline u32 makeItemParams(u32 iNo, u32 p8, u32 unk, u32 p9) {
|
||||
return maskShift(p8, 8, 0x8) | maskShift(iNo, 8, 0) | maskShift(unk, 8, 0x10) |
|
||||
maskShift(p9, 4, 0x18);
|
||||
}
|
||||
@@ -2536,17 +2521,21 @@ asm s16 fopAcM_getPolygonAngle(cM3dGPla const* param_0, s16 param_1) {
|
||||
|
||||
/* 8001DC68-8001DCBC 0185A8 0054+00 0/0 5/5 21/21 .text
|
||||
* lineCheck__11fopAcM_lc_cFPC4cXyzPC4cXyzPC10fopAc_ac_c */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm bool fopAcM_lc_c::lineCheck(cXyz const* param_0, cXyz const* param_1,
|
||||
bool fopAcM_lc_c::lineCheck(cXyz const* param_0, cXyz const* param_1,
|
||||
fopAc_ac_c const* param_2) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_actor_mng/lineCheck__11fopAcM_lc_cFPC4cXyzPC4cXyzPC10fopAc_ac_c.s"
|
||||
((dBgS_LinChk*)mLineCheck)->Set(param_0, param_1, param_2);
|
||||
dComIfG_Bgsp().LineCross((cBgS_LinChk*)mLineCheck);
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8001DCBC-8001DD1C 0185FC 0060+00 1/1 10/10 108/108 .text gndCheck__11fopAcM_gc_cFPC4cXyz */
|
||||
// return value calculation
|
||||
#ifdef NONMATCHING
|
||||
bool fopAcM_gc_c::gndCheck(cXyz const* param_0) {
|
||||
((cBgS_GndChk*)mGndCheck)->SetPos(param_0);
|
||||
mGroundY = dComIfG_Bgsp().GroundCross((cBgS_GndChk*)mGndCheck);
|
||||
return -1000000000.0f > mGroundY;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
@@ -2555,6 +2544,7 @@ asm bool fopAcM_gc_c::gndCheck(cXyz const* param_0) {
|
||||
#include "asm/f_op/f_op_actor_mng/gndCheck__11fopAcM_gc_cFPC4cXyz.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80451C5C-80451C60 00025C 0004+00 1/1 0/0 0/0 .sdata2 @6517 */
|
||||
|
||||
Reference in New Issue
Block a user