Merge remote-tracking branch 'origin/main' into presets

# Conflicts:
#	files.cmake
#	src/d/actor/d_a_title.cpp
#	src/dusk/config.cpp
#	src/dusk/imgui/ImGuiConsole.cpp
#	src/dusk/imgui/ImGuiEngine.cpp
This commit is contained in:
MelonSpeedruns
2026-04-11 16:53:04 -04:00
15380 changed files with 4960 additions and 1354842 deletions
+24 -10
View File
@@ -850,7 +850,7 @@ daAlink_FaceTexData const daAlink_c::m_faceTexDataTable[] = {
{dRes_ID_ALANM_BTP_FDAM01_e, dRes_ID_ALANM_BTK_FFINISHA_e},
{dRes_ID_ALANM_BTP_FFINISHA_e, dRes_ID_ALANM_BTK_FFINISHED_e},
{dRes_ID_ALANM_BTP_FARELORD_e, dRes_ID_ALANM_BTK_FARELORD_e},
{dRes_ID_ALANM_BTP_FARELORDTAME_e, dRes_ID_ALANM_BTK_FARELORDTAME_e},
{dRes_ID_ALANM_BTP_FARELORDTAME_e, dRes_ID_ALANM_BTK_FARELORDTAME_e},
{dRes_ID_ALANM_BTP_FPUSHW_e, dRes_ID_ALANM_BTK_FPUSHW_e},
{dRes_ID_ALANM_BTP_FPULLW_e, dRes_ID_ALANM_BTK_FPULLW_e},
{dRes_ID_ALANM_BTP_FWAITST_e, dRes_ID_ALANM_BTK_FWAITST_e},
@@ -1001,7 +1001,7 @@ daAlink_FaceTexData const daAlink_c::m_faceTexDataTable[] = {
{dRes_ID_ALANM_BTP_WL_FSWIMDIEA_e, dRes_ID_ALANM_BTK_WL_FA_e},
{dRes_ID_ALANM_BTP_WL_FSWIMDIEP_e, dRes_ID_ALANM_BTK_WL_FA_e},
{dRes_ID_ALANM_BTP_WL_FMDSHOCK_e, dRes_ID_ALANM_BTK_WL_FMDSHOCK_e},
{dRes_ID_ALANM_BTP_WL_FENTRANCE_e, dRes_ID_ALANM_BTK_WL_FENTRANCE_e},
{dRes_ID_ALANM_BTP_WL_FENTRANCE_e, dRes_ID_ALANM_BTK_WL_FENTRANCE_e},
{dRes_ID_ALANM_BTP_WL_FHOWLC_e, dRes_ID_ALANM_BTK_WL_FA_e},
{dRes_ID_ALANM_BTP_WL_FC_e, dRes_ID_ALANM_BTK_WL_FA_e},
};
@@ -4943,7 +4943,7 @@ int daAlink_c::create() {
if (dComIfG_resLoad(&mShieldPhaseReq, mShieldArcName, mpShieldArcHeap) != cPhs_COMPLEATE_e) {
return cPhs_INIT_e;
}
u32 heapSize = 0x3E930;
heapSize |= 0x80000000;
heapSize |= 0x40000000;
@@ -5885,7 +5885,7 @@ void daAlink_c::setItemMatrix(int param_0) {
|| (mProcID == PROC_CUT_REVERSE && mProcVar2.field_0x300c != 0)
|| mProcID == PROC_GUARD_BREAK
|| (mEquipItem == 0x103 && !checkEndResetFlg1(ERFLG1_SHIELD_BACKBONE) && !checkModeFlg(0x400))
)
)
{
mShieldModel->setBaseTRMtx(mpLinkModel->getAnmMtx(mRightItemJntNo));
@@ -5949,9 +5949,23 @@ void daAlink_c::setItemMatrix(int param_0) {
mpLinkBootModels[0]->setAnmMtx(3, mpLinkModel->getAnmMtx(0x15));
mDoMtx_stack_c::XrotS(-0x8000);
mDoMtx_concat(mpLinkModel->getAnmMtx(0x18), mDoMtx_stack_c::get(), mpLinkBootModels[1]->getAnmMtx(1));
mDoMtx_concat(mpLinkModel->getAnmMtx(0x19), mDoMtx_stack_c::get(), mpLinkBootModels[1]->getAnmMtx(2));
mDoMtx_concat(mpLinkModel->getAnmMtx(0x1A), mDoMtx_stack_c::get(), mpLinkBootModels[1]->getAnmMtx(3));
#ifdef TARGET_PC
if (dusk::getSettings().game.enableFrameInterpolation) {
Mtx boot_mtx;
mDoMtx_concat(mpLinkModel->getAnmMtx(0x18), mDoMtx_stack_c::get(), boot_mtx);
mpLinkBootModels[1]->setAnmMtx(1, boot_mtx);
mDoMtx_concat(mpLinkModel->getAnmMtx(0x19), mDoMtx_stack_c::get(), boot_mtx);
mpLinkBootModels[1]->setAnmMtx(2, boot_mtx);
mDoMtx_concat(mpLinkModel->getAnmMtx(0x1A), mDoMtx_stack_c::get(), boot_mtx);
mpLinkBootModels[1]->setAnmMtx(3, boot_mtx);
} else {
#endif
mDoMtx_concat(mpLinkModel->getAnmMtx(0x18), mDoMtx_stack_c::get(), mpLinkBootModels[1]->getAnmMtx(1));
mDoMtx_concat(mpLinkModel->getAnmMtx(0x19), mDoMtx_stack_c::get(), mpLinkBootModels[1]->getAnmMtx(2));
mDoMtx_concat(mpLinkModel->getAnmMtx(0x1A), mDoMtx_stack_c::get(), mpLinkBootModels[1]->getAnmMtx(3));
#ifdef TARGET_PC
}
#endif
}
if (!checkNoResetFlg2(FLG2_STATUS_WINDOW_DRAW)) {
@@ -6279,7 +6293,7 @@ void daAlink_c::setWolfAtCollision() {
void daAlink_c::resetAtCollision(BOOL param_0) {
if (checkNoResetFlg0(FLG0_CUT_AT_FLG)) {
if (param_0
if (param_0
&& !setSwordHitVibration(&mAtCps[0])
&& !setSwordHitVibration(&mAtCps[1])
&& !setSwordHitVibration(&mAtCps[2])
@@ -14055,7 +14069,7 @@ void daAlink_c::setMetamorphoseModel(BOOL i_isChangeToWolf) {
JKRHeap* heap = setItemHeap();
mHeldItemModel = initModel(loadAramBmd(dRes_ID_ALANM_BMD_AL_WF_e, 0x6000), 0);
if (!mItemBck.init(bck, FALSE, 2, 1.0f, 0, -1, false)) {
JUT_ASSERT(20842, FALSE);
}
@@ -16727,7 +16741,7 @@ int daAlink_c::procAutoJump() {
#if VERSION == VERSION_SHIELD_DEBUG
if (!checkStageName("F_SP115") && mGrabItemAcKeep.getActor() != NULL) {
if ((fopAcM_GetName(mGrabItemAcKeep.getActor()) == fpcNm_NI_e && ((ni_class*)mGrabItemAcKeep.getActor())->checkGold() != TRUE) ||
(fopAcM_GetName(mGrabItemAcKeep.getActor()) == fpcNm_NPC_TKJ2_e))
(fopAcM_GetName(mGrabItemAcKeep.getActor()) == fpcNm_NPC_TKJ2_e))
{
mMaxSpeed = mpHIO->mAutoJump.m.mCuccoJumpMaxSpeed;
field_0x3478 = mpHIO->mAutoJump.m.mCuccoFallMaxSpeed;
+12 -5
View File
@@ -9,11 +9,6 @@ void daAlink_c::handleQuickTransform() {
return;
}
// Ensure that link is not in a cutscene.
if (checkEventRun()) {
return;
}
// Check to see if Link has the ability to transform.
if (!dComIfGs_isEventBit(dSv_event_flag_c::M_077)) {
return;
@@ -30,8 +25,20 @@ void daAlink_c::handleQuickTransform() {
return;
}
// Ensure that link is not in a cutscene.
if (checkEventRun()) {
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
return;
}
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags = 0;
// Don't allow quick transform while in the STAR tent.
if (checkStageName("R_SP161")) {
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
return;
}
// Ensure that the Z Button is not dimmed
if (meterDrawPtr->getButtonZAlpha() != 1.f) {
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
+42 -42
View File
@@ -1444,11 +1444,11 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamEyeTarget.set(240.0f, 274.0f, 2075.0f);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
}
spFC.set(0.0f, 0.0f, 1700.0f);
@@ -1478,16 +1478,16 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamCenterTarget.set(76.0f, 204.0f, 1782.0f);
i_this->mDemoCamEyeTarget.set(-41.0f, 261.0f, 2095.0f);
i_this->field_0x127c.x = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x127c.x = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x129c = 0.0f;
i_this->mDemoMode = 12;
@@ -1584,16 +1584,16 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamCenterTarget.set(0.0f, 278.0f, 1252.0f);
i_this->mDemoCamEyeTarget.set(0.0f, 86.0f, 2167.0f);
i_this->field_0x127c.x = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x127c.x = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x129c = 0.0f;
i_this->mDemoMode = 14;
@@ -1741,16 +1741,16 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamCenterTarget.set(-2243.0f, 1340.0f, 977.0f);
i_this->mDemoCamEyeTarget.set(-1226.0f, 980.0f, 1350.0f);
i_this->field_0x127c.x = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x127c.x = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x129c = 0.0f;
i_this->mDemoMode = 34;
@@ -1814,9 +1814,9 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamEye.set(95.0f, 50.0f, 2800.0f);
i_this->mDemoCamEyeTarget.set(72.0f, 52.0f, 2153.0f);
i_this->field_0x127c.x = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x127c.x = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.set(0.0f, 0.0f, 0.0f);
i_this->field_0x129c = 0.0f;
@@ -1973,18 +1973,18 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamEyeTarget.set(1214.0f, 350.0f, 2696.0f);
i_this->field_0x127c.x =
std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y =
std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z =
std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x129c = 0.0f;
} else if (i_this->mDemoModeTimer < 140) {
@@ -1993,18 +1993,18 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamEyeTarget.set(23.0f, 108.0f, 2155.0f);
i_this->field_0x127c.x =
std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y =
std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z =
std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
}
cam_3d_morf(i_this, 0.1f);
@@ -2042,18 +2042,18 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamEyeTarget.set(953.0f, 997.0f, -36.0f);
i_this->field_0x127c.x =
std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y =
std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z =
std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
cXyz pos(0.0f, 0.0f, 0.0f);
for (int i = 0; i < 5; i++) {
+18 -18
View File
@@ -2462,12 +2462,12 @@ static void demo_camera(b_ob_class* i_this) {
i_this->mDemoCamCenterTarget.set(80.0f, -24093.0f, 160.0f);
i_this->mDemoCamEyeTarget.set(-447.0f, -22850.0f, -718.0f);
i_this->field_0x5cb4 = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x5cb8 = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x5cbc = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x5cc0 = std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x5cc4 = std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x5cc8 = std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x5cb4 = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x5cb8 = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x5cbc = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x5cc0 = fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x5cc4 = fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x5cc8 = fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x5cd0 = 0.0f;
daPy_getPlayerActorClass()->changeDemoMode(0x17, 0, 0, 0);
@@ -2590,12 +2590,12 @@ static void demo_camera(b_ob_class* i_this) {
i_this->mDemoCamCenterTarget.set(-6378.0f, -21886.0f, 7150.0f);
i_this->mDemoCamEyeTarget.set(-6961.0f, -21727.0f, 7278.0f);
i_this->field_0x5cb4 = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x5cb8 = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x5cbc = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x5cc0 = std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x5cc4 = std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x5cc8 = std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x5cb4 = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x5cb8 = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x5cbc = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x5cc0 = fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x5cc4 = fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x5cc8 = fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x5cd0 = 0.0f;
i_this->mDemoAction = 46;
@@ -2656,12 +2656,12 @@ static void demo_camera(b_ob_class* i_this) {
i_this->mDemoCamCenterTarget.set(-2933.0f, -22626.0f, 6829.0f);
i_this->mDemoCamEyeTarget.set(-3295.0f, -22459.0f, 7307.0f);
i_this->field_0x5cb4 = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x5cb8 = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x5cbc = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x5cc0 = std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x5cc4 = std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x5cc8 = std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x5cb4 = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x5cb8 = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x5cbc = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x5cc0 = fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x5cc4 = fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x5cc8 = fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x5cd0 = 0.0f;
i_this->mDemoAction = 48;
+2 -2
View File
@@ -398,7 +398,7 @@ static int daE_TK2_Execute(e_tk2_class* i_this) {
cXyz cStack_94;
cXyz cStack_a0;
if (i_this->mExecuteState == 0x00) {
if (i_this->mActionTimer[3] == 0x00) {
dBgS_ObjGndChk_Spl ground_check;
cStack_94 = actor->current.pos;
cStack_94.y += 200.0f;
@@ -602,7 +602,7 @@ static int daE_TK2_Create(fopAc_ac_c* actor) {
i_this->mSound.init(&actor->current.pos, &actor->eyePos, 0x3, 0x1);
i_this->mSound.setEnemyName("E_tk2");
i_this->mAtInfo.mpSound = &i_this->mSound;
i_this->mExecuteState = 0x14;
i_this->mActionTimer[3] = 0x14;
daE_TK2_Execute(i_this);
}
return phase;
+25
View File
@@ -167,6 +167,30 @@ static dCcD_SrcSph cc_vt_magic_src = {
} // mSphAttr
};
// !@bug The i<40 loops that index these arrays read one element past the end; on
// GC/Wii the OOB reads land on adjacent rodata instead of a defined value.
#if AVOID_UB
static u8 va_tag_set_size[40] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02,
0x00,
};
static u8 va_tag_set_num[40] = {
0x01, 0x0C, 0x16, 0x1F, 0x21, 0x2A, 0x2B, 0x02, 0x04, 0x0D, 0x0F, 0x15, 0x18,
0x20, 0x2C, 0x03, 0x05, 0x06, 0x0B, 0x10, 0x17, 0x19, 0x1A, 0x22, 0x24, 0x29,
0x2D, 0x34, 0x49, 0x52, 0x36, 0x3E, 0x54, 0x5C, 0x39, 0x41, 0x4C, 0x56, 0x5E,
0x00,
};
static f32 va_tag_offset[40] = {
20.0f, 20.0f, 20.0f, 20.0f, 20.0f, 0.0f, 40.0f, 0.0f, 30.0f, 10.0f, 0.0f, 0.0f, 20.0f,
0.0f, 10.0f, 20.0f, 40.0f, 0.0f, 20.0f, 0.0f, 0.0f, 20.0f, 0.0f, 10.0f, 0.0f, 0.0f,
20.0f, 10.0f, 20.0f, 30.0f, 0.0f, 10.0f, 20.0f, 0.0f, 0.0f, 10.0f, 20.0f, 30.0f, 0.0f,
0.0f,
};
#else
static u8 va_tag_set_size[39] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
@@ -184,6 +208,7 @@ static f32 va_tag_offset[39] = {
0.0f, 10.0f, 20.0f, 40.0f, 0.0f, 20.0f, 0.0f, 0.0f, 20.0f, 0.0f, 10.0f, 0.0f, 0.0f,
20.0f, 10.0f, 20.0f, 30.0f, 0.0f, 10.0f, 20.0f, 0.0f, 0.0f, 10.0f, 20.0f, 30.0f, 0.0f,
};
#endif
} // namespace
+1 -1
View File
@@ -516,7 +516,7 @@ void daE_YMB_c::checkWaterPos() {
field_0x6cc = wtr_pos;
field_0x69c.y = wtr_pos + 1000.0f + l_HIO.fly_height_adjust;
UNUSED(std::fabsf(field_0x6cc - current.pos.y));
UNUSED(fabsf(field_0x6cc - current.pos.y));
if (current.pos.y < (200.0f + field_0x6cc)) {
if (field_0x715 == 0) {
setWaterEffect1();
+7
View File
@@ -14,6 +14,7 @@
#include "d/d_msg_object.h"
#include "d/d_s_play.h"
#include "d/d_debug_viewer.h"
#include "dusk/frame_interpolation.h"
static f32 dummy_lit_3777(int idx, u8 foo) {
Vec dummy_vec = {0.0f, 0.0f, 0.0f};
@@ -1052,6 +1053,12 @@ void daMidna_c::setBodyPartMatrix() {
mpModel->setAnmMtx(i, mpShadowModel->getAnmMtx(i));
}
mpModel->calcWeightEnvelopeMtx();
#ifdef TARGET_PC
// Frame interpolation: Record weight envelopes for Midna here, as they are otherwise missed causing distortion
for (u16 i = 0; i < mpModel->getModelData()->getWEvlpMtxNum(); i++) {
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(mpModel->getWeightAnmMtx(i)), mpModel->getWeightAnmMtx(i));
}
#endif
}
mDoMtx_stack_c::transS(mpShadowModel->getAnmMtx(JNT_BACKBONE1)[0][3],
+2 -2
View File
@@ -411,7 +411,7 @@ void daObjTOMBO_c::BoomChk() {
speedF = 5.0f;
field_0x71c = 5.0f;
mIsHitByBoomerang = false;
field_0x718 = 100;
field_0x714[2] = 100;
mpMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("Tombo", 6), 2, 5.0f, 1.0f,
0.0f, -1.0f);
home.pos = current.pos;
@@ -422,7 +422,7 @@ void daObjTOMBO_c::BoomChk() {
mIsHitByBoomerang = false;
speedF = 5.0f;
field_0x71c = 5.0f;
field_0x718 = 100;
field_0x714[2] = 100;
mpMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("Tombo", 6), 2, 5.0f, 1.0f,
0.0f, -1.0f);
current.pos.y = old.pos.y = playerPos.y + 100.0f;
+1 -1
View File
@@ -650,7 +650,7 @@ void daTbox_c::dropProcInit() {
field_0x97c = false;
f32 delta_y = pos.y - pnt1.y;
f32 abs_gravity = std::fabsf(fopAcM_GetGravity(this));
f32 abs_gravity = fabsf(fopAcM_GetGravity(this));
var_f30 = JMAFastSqrt(2.0f * delta_y / abs_gravity);
speedF = pos.absXZ(pnt1) / var_f30;
+14 -8
View File
@@ -126,7 +126,7 @@ static procFunc daTitleProc[6] = {
int daTitle_c::create() {
fopAcM_ct(this, daTitle_c);
int phase_state = dComIfG_resLoad(&mPhaseReq, l_arcName);
if (phase_state != cPhs_COMPLEATE_e) {
return phase_state;
@@ -157,20 +157,26 @@ int daTitle_c::createHeapCallBack(fopAc_ac_c* actor) {
int daTitle_c::Execute() {
#if TARGET_PC
if (dusk::config::IsConfigFileMissing()) {
if (!dusk::getSettings().backend.wasPresetChosen) {
return 0;
}
#endif
#if PLATFORM_WII || PLATFORM_SHIELD
mDoGph_gInf_c::resetDimming();
#endif
#endif
if (fopOvlpM_IsPeek()) {
return 1;
}
dMenu_Collect3D_c::setViewPortOffsetY(0.0f);
#ifdef TARGET_PC
if (!dusk::getSettings().game.enableFrameInterpolation) {
#endif
dMenu_Collect3D_c::setViewPortOffsetY(0.0f);
#ifdef TARGET_PC
}
#endif
if (mDoRst::isReset()) {
return 1;
@@ -179,9 +185,9 @@ int daTitle_c::Execute() {
(this->*daTitleProc[mProcID])();
KeyWaitAnm();
#if VERSION == VERSION_SHIELD_DEBUG
#if VERSION == VERSION_SHIELD_DEBUG
KeyWaitPosMove();
#endif
#endif
return 1;
}
@@ -375,7 +381,7 @@ int daTitle_c::getDemoPrm() {
int daTitle_c::Draw() {
#if TARGET_PC
if (dusk::config::IsConfigFileMissing()) {
if (!dusk::getSettings().backend.wasPresetChosen) {
return 0;
}
#endif
@@ -406,7 +412,7 @@ int daTitle_c::Delete() {
dComIfG_resDelete(&mPhaseReq, l_arcName);
JKR_DELETE(mTitle.Scr);
JKR_DELETE(field_0x600);
mpMount->getArchive()->removeResourceAll();
JKRUnmountArchive(mpMount->getArchive());
mpMount->destroy();
+25 -2
View File
@@ -5,6 +5,8 @@
#include "JSystem/J3DGraphBase/J3DDrawBuffer.h"
#include "SSystem/SComponent/c_counter.h"
#include "dusk/frame_interpolation.h"
#if TARGET_PC
const u16 l_J_Ohana00_64TEX__width = 64;
const u16 l_J_Ohana00_64TEX__height = 64;
@@ -695,7 +697,16 @@ void dFlower_packet_c::draw() {
GXSetChanAmbColor(GX_COLOR0A0, sp64);
if (!cLib_checkBit<u8>(sp44->m_state, 4) && !cLib_checkBit<u8>(sp44->m_state, 0x40)) {
GXLoadPosMtxImm(sp44->m_modelMtx, 0);
#ifdef TARGET_PC
Mtx flower_mtx;
if (dusk::frame_interp::lookup_replacement(reinterpret_cast<const void*>(&sp44->m_modelMtx), flower_mtx)) {
GXLoadPosMtxImm(flower_mtx, 0);
} else {
#endif
GXLoadPosMtxImm(sp44->m_modelMtx, 0);
#ifdef TARGET_PC
}
#endif
GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0);
#if TARGET_PC
@@ -841,7 +852,16 @@ void dFlower_packet_c::draw() {
sp30++;
if (!cLib_checkBit<u8>(sp34->m_state, 4) && cLib_checkBit<u8>(sp34->m_state, 0x40)) {
GXLoadPosMtxImm(sp34->m_modelMtx, 0);
#ifdef TARGET_PC
Mtx flower_mtx;
if (dusk::frame_interp::lookup_replacement(reinterpret_cast<const void*>(&sp34->m_modelMtx), flower_mtx)) {
GXLoadPosMtxImm(flower_mtx, 0);
} else {
#endif
GXLoadPosMtxImm(sp34->m_modelMtx, 0);
#ifdef TARGET_PC
}
#endif
GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0);
#if TARGET_PC
@@ -973,6 +993,9 @@ void dFlower_packet_c::update() {
mDoMtx_stack_c::copy(temp_r28);
mDoMtx_stack_c::scaleM(temp_f31, temp_f31, temp_f31);
cMtx_concat(j3dSys.getViewMtx(), temp_r28, data_p->m_modelMtx);
#ifdef TARGET_PC
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(&data_p->m_modelMtx), data_p->m_modelMtx);
#endif
}
}
+15 -1
View File
@@ -11,6 +11,8 @@
#include "d/d_camera.h"
#include "f_op/f_op_camera_mng.h"
#include "dusk/frame_interpolation.h"
const u16 l_M_Hijiki00TEX__width = 31;
const u16 l_M_Hijiki00TEX__height = 31;
const u16 l_M_kusa05_RGBATEX__width = 31;
@@ -751,7 +753,16 @@ void dGrass_packet_c::draw() {
GXSetChanAmbColor(GX_COLOR0A0, sp38);
if (!cLib_checkBit<u8>(var_r29->field_0x01, 2)) {
GXLoadPosMtxImm(var_r29->m_modelMtx, 0);
#ifdef TARGET_PC
Mtx grass_mtx;
if (dusk::frame_interp::lookup_replacement(reinterpret_cast<const void*>(&var_r29->m_modelMtx), grass_mtx)) {
GXLoadPosMtxImm(grass_mtx, 0);
} else {
#endif
GXLoadPosMtxImm(var_r29->m_modelMtx, 0);
#ifdef TARGET_PC
}
#endif
GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0);
if (var_r29->field_0x05 <= 3 || var_r29->field_0x05 >= 10) {
if (var_r29->field_0x02 < -1) {
@@ -1006,6 +1017,9 @@ void dGrass_packet_c::update() {
mDoMtx_stack_c::scaleM(scale, scale, scale);
cMtx_concat(j3dSys.getViewMtx(), mDoMtx_stack_c::get(), data_p->m_modelMtx);
}
#ifdef TARGET_PC
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(&data_p->m_modelMtx), data_p->m_modelMtx);
#endif
}
}
data_p++;
+58 -41
View File
@@ -20,6 +20,7 @@
#include "m_Do/m_Do_controller_pad.h"
#include "m_Do/m_Do_graphic.h"
#include "m_Do/m_Do_lib.h"
#include "dusk/frame_interpolation.h"
#include <cmath>
#include <cstring>
@@ -2179,9 +2180,9 @@ fopAc_ac_c* dCamera_c::getParamTargetActor(s32 param_0) {
daAlink_c* player = daAlink_getAlinkActorClass();
fopAc_ac_c* result;
u32* name = (u32*)(mCamTypeData[param_0].name + 16);
BE(u32)* name = (BE(u32)*)(mCamTypeData[param_0].name + 16);
//name += 16;
switch (*name) {
switch ((u32)*name) {
case '@LOC':
result = dComIfGp_getAttention()->LockonTarget(0);
break;
@@ -2417,10 +2418,18 @@ f32 dCamera_c::radiusActorInSight(fopAc_ac_c* i_actor1, fopAc_ac_c* i_actor2, cX
dDlst_window_c* window = get_window(field_0x0);
scissor_class* scissor = window->getScissor();
f32 var_f29 = cAngle::d2r(i_fovY) * 0.5f;
#if TARGET_PC
view_port_class* viewport = window->getViewPort();
f32 var_f28 = (scissor->height - mTrimHeight * 2.0f) / viewport->height;
f32 sp34 = var_f29 * var_f28 * (mTrimHeight < 0.01f ? 0.95f : 1.0f);
var_f29 *= mWindowAspect;
var_f28 = scissor->width / viewport->width;
#else
f32 var_f28 = (scissor->height - mTrimHeight * 2.0f) / FB_HEIGHT;
f32 sp34 = var_f29 * var_f28 * (mTrimHeight < 0.01f ? 0.95f : 1.0f);
var_f29 *= mWindowAspect;
var_f28 = scissor->width / FB_WIDTH;
#endif
f32 sp30 = var_f29 * var_f28 * 0.85f;
cXyz pos1 = attentionPos(i_actor1);
@@ -2450,8 +2459,8 @@ f32 dCamera_c::radiusActorInSight(fopAc_ac_c* i_actor1, fopAc_ac_c* i_actor2, cX
int bVar2 = 0;
var_f29 = std::fabsf(cM_atan2f(pos1.x, -pos1.z));
var_f28 = std::fabsf(cM_atan2f(pos1.y, -pos1.z));
var_f29 = fabsf(cM_atan2f(pos1.x, -pos1.z));
var_f28 = fabsf(cM_atan2f(pos1.y, -pos1.z));
if (var_f29 > sp30) {
bVar2 |= 1;
}
@@ -2459,8 +2468,8 @@ f32 dCamera_c::radiusActorInSight(fopAc_ac_c* i_actor1, fopAc_ac_c* i_actor2, cX
bVar2 |= 2;
}
var_f29 = std::fabsf(cM_atan2f(pos2.x, -pos2.z));
var_f28 = std::fabsf(cM_atan2f(pos2.y, -pos2.z));
var_f29 = fabsf(cM_atan2f(pos2.x, -pos2.z));
var_f28 = fabsf(cM_atan2f(pos2.y, -pos2.z));
if (var_f29 > sp30) {
bVar2 |= 4;
}
@@ -2485,25 +2494,25 @@ f32 dCamera_c::radiusActorInSight(fopAc_ac_c* i_actor1, fopAc_ac_c* i_actor2, cX
f32 var_f31;
if (bVar2 & 1) {
var_f31 = pos1.z + std::fabsf(pos1.x) / local_12c;
var_f31 = pos1.z + fabsf(pos1.x) / local_12c;
if (var_f31 > ret) {
ret = var_f31;
}
}
if (bVar2 & 2) {
var_f31 = pos1.z + std::fabsf(pos1.y) / local_130;
var_f31 = pos1.z + fabsf(pos1.y) / local_130;
if (var_f31 > ret) {
ret = var_f31;
}
}
if (bVar2 & 4) {
var_f31 = pos2.z + std::fabsf(pos2.x) / local_12c;
var_f31 = pos2.z + fabsf(pos2.x) / local_12c;
if (var_f31 > ret) {
ret = var_f31;
}
}
if (bVar2 & 8) {
var_f31 = pos2.z + std::fabsf(pos2.y) / local_130;
var_f31 = pos2.z + fabsf(pos2.y) / local_130;
if (var_f31 > ret) {
ret = var_f31;
}
@@ -2791,7 +2800,7 @@ bool dCamera_c::bumpCheck(u32 i_flags) {
}
wind_pow -= 0.3f;
cSAngle angle = wind_globe.U() - mViewCache.mDirection.U();
mFovy += mCamSetup.WindShakeGap4Fvy() * cM_rndFX(wind_pow / 0.7f) * (1.0f - std::fabsf(angle.Norm()));
mFovy += mCamSetup.WindShakeGap4Fvy() * cM_rndFX(wind_pow / 0.7f) * (1.0f - fabsf(angle.Norm()));
#if DEBUG
dDbVw_Report(300, 180, "wind %f %f", wind_pow, angle.Norm());
@@ -2935,7 +2944,7 @@ bool dCamera_c::bumpCheck(u32 i_flags) {
cXyz cross;
f32 dot = VECDotProduct(normal1, normal2);
VECCrossProduct(normal1, normal2, &cross);
if (chkCornerCos(dot) && std::fabsf(cross.y) > 0.5f
if (chkCornerCos(dot) && fabsf(cross.y) > 0.5f
&& cBgW_CheckBWall(normal2->y)) {
var_r27 = 5;
} else {
@@ -3048,7 +3057,7 @@ bool dCamera_c::bumpCheck(u32 i_flags) {
field_0x96c += (1.0f - field_0x96c) * 0.1f;
}
if (sp0C || !(mMonitor.field_0xc < 5.0f)
|| !(std::fabsf(mPadInfo.mCStick.mLastPosX) < 0.05f)) {
|| !(fabsf(mPadInfo.mCStick.mLastPosX) < 0.05f)) {
field_0x968 = 0.2f;
} else {
field_0x968 *= mMonitor.field_0xc / 5.0f;
@@ -3991,7 +4000,7 @@ bool dCamera_c::chaseCamera(s32 param_0) {
}
cSAngle ang;
if ((chkFlag(0x100000) || sp1C || bVar6) && std::fabsf(mPadInfo.mCStick.mLastPosX) < 0.05f) {
if ((chkFlag(0x100000) || sp1C || bVar6) && fabsf(mPadInfo.mCStick.mLastPosX) < 0.05f) {
ang.Val(directionOf(mpPlayerActor).Inv());
} else {
ang.Val(mViewCache.mDirection.U());
@@ -4006,13 +4015,13 @@ bool dCamera_c::chaseCamera(s32 param_0) {
pos3 = pos;
pos.y += dist;
sp1AC = cXyz(mCenter - pos3).abs() * 8.0f;
sp1BC = std::fabsf(dist1 > sp1AC ? dist1 : sp1AC);
sp1BC = fabsf(dist1 > sp1AC ? dist1 : sp1AC);
dist1 = val18 + (val17 - val18) * chase->field_0xa4;
sp1AC = std::fabsf(mFovy - dist1);
sp1AC = fabsf(mFovy - dist1);
f32 sin = cSAngle(mFovy > dist1 ? mFovy : dist1).Sin();
sp1AC = 100.0f * (sin * sin) * sp1AC;
sp1BC = std::fabsf(sp1BC > sp1AC ? sp1BC : sp1AC);
sp1BC = fabsf(sp1BC > sp1AC ? sp1BC : sp1AC);
sp1BC *= 1.2f;
sp1BC *= 0.00625f;
chase->field_0x4 = (int)(JMAFastSqrt(sp1BC) * 2.2f) + 1;
@@ -4120,7 +4129,7 @@ bool dCamera_c::chaseCamera(s32 param_0) {
mViewCache.mCenter += (pos - mViewCache.mCenter) * rate;
f32 dist = dCamMath::xyzHorizontalDistance(pos, chase->field_0x58);
if (dist < std::fabsf(vec.x > vec.z ? vec.x : vec.z) + 20.0f) {
if (dist < fabsf(vec.x > vec.z ? vec.x : vec.z) + 20.0f) {
cXyz attention_pos = attentionPos(mpPlayerActor);
attention_pos.y -= 15.0f;
dBgS_CamLinChk lin_chk;
@@ -4286,7 +4295,7 @@ bool dCamera_c::chaseCamera(s32 param_0) {
cSAngle ang = -mViewCache.mDirection.U();
delta = dCamMath::xyzRotateY(delta, ang);
cXyz vec5 = delta;
if (std::fabsf(vec5.y) < 200.0f) {
if (fabsf(vec5.y) < 200.0f) {
vec5.y = 0.0f;
vec5.x *= 0.5f;
f32 sp16C = vec5.abs();
@@ -4407,17 +4416,17 @@ bool dCamera_c::chaseCamera(s32 param_0) {
bool sp11 = false;
f32 sp140 = 0.05f;
f32 last_pos_x = mPadInfo.mCStick.mLastPosX;
f32 sp138 = std::fabsf(last_pos_x);
f32 sp138 = fabsf(last_pos_x);
f32 sp134 = mPadInfo.mCStick.mLastPosY;
f32 sp130 = std::fabsf(sp134);
f32 sp130 = fabsf(sp134);
f32 sp12C = 8.0f;
f32 sp128 = 12.0f;
chase->field_0x93 = false;
if (sp11 || (!mCamParam.Flag(param_0, 0x40) && std::fabsf(last_pos_x) > sp140)) {
if (sp11 || (!mCamParam.Flag(param_0, 0x40) && fabsf(last_pos_x) > sp140)) {
chase->field_0xac += (dCamMath::rationalBezierRatio(last_pos_x, 0.5f) * sp12C - chase->field_0xac) * chase->field_0x4c;
ang3 = globe.U() + cSAngle(chase->field_0xac);
sp148 = std::fabsf(last_pos_x) - 0.05f;
sp148 = fabsf(last_pos_x) - 0.05f;
if (mCamSetup.CheckFlag(0x1000) && mFakeAngleSys.field_0x0 == 0) {
setUSOAngle();
}
@@ -4914,7 +4923,7 @@ bool dCamera_c::lockonCamera(s32 param_0) {
sp0C = true;
}
f32 fVar43 = 1.0f - std::fabsf(mPadInfo.mCStick.mLastPosY);
f32 fVar43 = 1.0f - fabsf(mPadInfo.mCStick.mLastPosY);
f32 fVar44;
if (bVar1) {
@@ -4973,12 +4982,12 @@ bool dCamera_c::lockonCamera(s32 param_0) {
cSAngle u, v;
cSAngle ang5 = globe.V() - lockon->field_0x34.V();
if (sp0C) {
r = lockon->field_0x34.R() * 0.75f * std::fabsf(ang5.Cos());
r = lockon->field_0x34.R() * 0.75f * fabsf(ang5.Cos());
u.Val(lockon->field_0x34.U() + (ang4 - lockon->field_0x34.U()) * lockon->field_0x58);
v.Val(lockon->field_0x34.V() + ang5 * 0.05f);
} else {
r = lockon->field_0x34.R() + (sp184 - lockon->field_0x34.R()) *
lockon->field_0x54 * std::fabsf(ang5.Cos());
lockon->field_0x54 * fabsf(ang5.Cos());
u.Val(lockon->field_0x34.U() + (ang4 - lockon->field_0x34.U()) * lockon->field_0x58);
v.Val(lockon->field_0x34.V() + ang5 * lockon->field_0x58);
}
@@ -5014,7 +5023,11 @@ bool dCamera_c::lockonCamera(s32 param_0) {
f32 sp160;
cSAngle ang6 = ang3 - ang2;
curveWeight = mCamSetup.CurveWeight();
#if AVOID_UB
f32 sp15C = 0.0f;
#else
f32 sp15C;
#endif
f32 sp158 = mPadInfo.mCStick.mLastPosX;
if (mCamParam.Flag(param_0, 0x40)) {
sp158 = 0.0f;
@@ -5031,9 +5044,9 @@ bool dCamera_c::lockonCamera(s32 param_0) {
}
bool bVar3 = false;
if (std::fabsf(sp158) > 0.05f) {
if (fabsf(sp158) > 0.05f) {
cSAngle ang = globe2.U() + cSAngle(dCamMath::rationalBezierRatio(sp158, 0.5f) * 7.5f);
sp15C = std::fabsf(sp158) - 0.05f;
sp15C = fabsf(sp158) - 0.05f;
lockon->field_0x42 = ang;
lockon->field_0x4c = 0.0f;
bVar3 = true;
@@ -5097,7 +5110,7 @@ bool dCamera_c::lockonCamera(s32 param_0) {
}
ang6 = ang1.Inv() - mViewCache.mDirection.U();
if (std::fabsf(ang6.Degree()) < 2.0f && false) {
if (fabsf(ang6.Degree()) < 2.0f && false) {
lockon->field_0x2a = true;
}
u2 += ang6 * sp15C * lockon->field_0x4c;
@@ -5125,7 +5138,7 @@ bool dCamera_c::lockonCamera(s32 param_0) {
} else {
lockon->field_0xc = 0;
if (!mBG.field_0xc0.field_0x44 && !bVar1) {
v2 += (globe2.V() - v2) * fVar43 * std::fabsf(mViewCache.mDirection.V().Cos());
v2 += (globe2.V() - v2) * fVar43 * fabsf(mViewCache.mDirection.V().Cos());
} else {
cSAngle ang7 = lockon->field_0x34.V();
ang7 *= cSAngle(lockon->field_0x34.U() - mViewCache.mDirection.U()).Cos();
@@ -5457,7 +5470,7 @@ bool dCamera_c::talktoCamera(s32 param_0) {
if (talk->field_0x84 != 0) {
talk->field_0x48 = 1;
} else {
talk->field_0x48 = (int)(JMAFastSqrt(std::fabsf(mViewCache.mDirection.R() - talk->field_0x28.R())) / 2.0f);
talk->field_0x48 = (int)(JMAFastSqrt(fabsf(mViewCache.mDirection.R() - talk->field_0x28.R())) / 2.0f);
if (talk->field_0x48 < 2) {
talk->field_0x48 = 2;
}
@@ -5597,7 +5610,7 @@ bool dCamera_c::talktoCamera(s32 param_0) {
for (i = 0; i < 36; i++) {
sp26C = talk->field_0x28.U() - talk->field_0x30.U();
if (std::fabsf(sp26C.Degree()) < 10.0f) {
if (fabsf(sp26C.Degree()) < 10.0f) {
talk->field_0x28.U(talk->field_0x28.U() + sp270);
} else {
if (!sp5B) {
@@ -7160,7 +7173,7 @@ bool dCamera_c::subjectCamera(s32 param_0) {
f32 zoom_fovy = dCamMath::zoomFovy(val17 * 0.5f, tmp2) * 2.0f;
mViewCache.mFovy += (zoom_fovy - mViewCache.mFovy) * val22;
setComZoomScale(tmp2);
setComZoomForcus(1.0f - std::fabsf(sp88 - sp84) * -511.0f);
setComZoomForcus(1.0f - fabsf(sp88 - sp84) * -511.0f);
if (check_owner_action(mPadID, 0x200000)) {
setComStat(8);
}
@@ -7251,12 +7264,12 @@ bool dCamera_c::magneCamera(s32 param_0) {
cSAngle stack_238;
if (mCurMode == 1) {
stack_238 = sp54.Inv();
} else if (std::fabsf(cstick_x) > 0.05f) {
} else if (fabsf(cstick_x) > 0.05f) {
stack_238 = magne->field_0x1c.U() + cSAngle(dCamMath::rationalBezierRatio(cstick_x, 0.5f) * 10.0f);
} else {
cSAngle stack_23c = sp54.Inv() - stack_230.U();
f32 sin = stack_23c.Sin();
f32 tmp = std::fabsf(sin * mPadInfo.mMainStick.mLastValue);
f32 tmp = fabsf(sin * mPadInfo.mMainStick.mLastValue);
f32 tmp2 = stack_23c.Cos() > 0.0f ? 8.0f : 4.0f;
stack_238 = stack_230.U() + cSAngle(sin * tmp2 * dCamMath::rationalBezierRatio(tmp, 1.0f));
}
@@ -7572,7 +7585,7 @@ bool dCamera_c::towerCamera(s32 param_0) {
cXyz stack_21c = relationalPos(mpPlayerActor, &stack_210);
f32 sp1A8 = cXyz(mEye - stack_21c).abs() - val7;
f32 sp1A4 = cXyz(mCenter - stack_21c).abs() - val7;
f32 sp1A0 = std::fabsf(sp1A8 > sp1A4 ? sp1A8 : sp1A4);
f32 sp1A0 = fabsf(sp1A8 > sp1A4 ? sp1A8 : sp1A4);
sp1A8 = heightOf(mpPlayerActor);
sp1A0 /= (sp1A8 < 10.0f ? 10.0f : sp1A8);
tower->field_0x4 = (int)(JMAFastSqrt(sp1A0) * sp220) + 1;
@@ -7694,9 +7707,9 @@ bool dCamera_c::towerCamera(s32 param_0) {
cSAngle sp108;
cSAngle sp104 = stack_454 + (stack_454 - stack_458) * sp188;
if (!mCamParam.Flag(param_0, 0x40) && std::fabsf(sp18C) > sp184) {
if (!mCamParam.Flag(param_0, 0x40) && fabsf(sp18C) > sp184) {
cSAngle sp100 = mViewCache.mDirection.U() + cSAngle(dCamMath::rationalBezierRatio(sp18C, 0.5f) * sp180);
f32 sp17C = std::fabsf(sp18C) - sp184;
f32 sp17C = fabsf(sp18C) - sp184;
sp108.Val(mViewCache.mDirection.U() + (sp100 - mViewCache.mDirection.U()) * sp17C);
tower->field_0x6a = true;
tower->field_0x78 += (0.8f - tower->field_0x78) * 0.05f;
@@ -11018,16 +11031,20 @@ static int camera_draw(camera_process_class* i_this) {
int trim_height = body->TrimHeight();
#if TARGET_PC
#if TARGET_PC
trim_height *= viewport->height / FB_HEIGHT;
window->setScissor(0.0f, trim_height, viewport->width, viewport->height - trim_height * 2.0f);
#else
#else
window->setScissor(0.0f, trim_height, FB_WIDTH, FB_HEIGHT - trim_height * 2.0f);
#endif
#endif
C_MTXPerspective(process->view.projMtx, process->view.fovy, process->view.aspect, process->view.near_, process->view.far_);
mDoMtx_lookAt(process->view.viewMtx, &process->view.lookat.eye, &process->view.lookat.center,
&process->view.lookat.up, process->view.bank);
#ifdef TARGET_PC
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(process->view.viewMtx),
process->view.viewMtx);
#endif
#if WIDESCREEN_SUPPORT
mDoGph_gInf_c::setWideZoomProjection(process->view.projMtx);
+1 -1
View File
@@ -1018,7 +1018,7 @@ bool dComIfG_inf_c::baseCsr_c::navi_c::draw(f32 param_1, f32 param_2, u8 param_3
f32 f27 = f31 - field_0x5c;
field_0x58 = f29;
field_0x5c = f31;
cXyz spdc(param_1 - 304.0f, param_2 - 224.0f, 0.0f);
cXyz spdc(param_1 - FB_WIDTH_BASE / 2, param_2 - FB_HEIGHT_BASE / 2, 0.0f);
f32 target = param_3 != 0 ? 1.5f : 0.0f;
+76 -8
View File
@@ -10,7 +10,13 @@
#include "SSystem/SComponent/c_math.h"
#include "d/d_com_inf_game.h"
#include "d/d_drawlist.h"
#include <typeindex>
#include "absl/container/flat_hash_map.h"
#include "client/TracyScoped.hpp"
#include "d/d_s_play.h"
#include "dusk/frame_interpolation.h"
#include "dusk/gx_helper.h"
#include "dusk/logging.h"
#include "m_Do/m_Do_graphic.h"
@@ -1089,7 +1095,16 @@ void dDlst_shadowReal_c::draw() {
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
GXSetCurrentMtx(GX_PNMTX0);
GXLoadTexMtxImm(mReceiverProjMtx, GX_TEXMTX0, GX_MTX3x4);
#ifdef TARGET_PC
Mtx receiver_proj_mtx;
if (dusk::frame_interp::lookup_replacement(&mReceiverProjMtx, receiver_proj_mtx)) {
GXLoadTexMtxImm(receiver_proj_mtx, GX_TEXMTX0, GX_MTX3x4);
} else {
#endif
GXLoadTexMtxImm(mReceiverProjMtx, GX_TEXMTX0, GX_MTX3x4);
#ifdef TARGET_PC
}
#endif
mShadowRealPoly.draw();
}
@@ -1247,6 +1262,10 @@ u8 dDlst_shadowReal_c::setShadowRealMtx(cXyz* param_0, cXyz* param_1, f32 param_
C_MTXOrtho(mRenderProjMtx, param_2, -param_2, -param_2, param_2, 1.0f, 10000.0f);
C_MTXLightOrtho(mReceiverProjMtx, param_2, -param_2, -param_2, param_2, 0.5f, -0.5f, 0.5f, 0.5f);
cMtx_concat(mReceiverProjMtx, mViewMtx, mReceiverProjMtx);
#ifdef TARGET_PC
dusk::frame_interp::record_final_mtx_raw(&mViewMtx, mViewMtx);
dusk::frame_interp::record_final_mtx_raw(&mReceiverProjMtx, mReceiverProjMtx);
#endif
return r29;
}
@@ -1309,13 +1328,31 @@ void dDlst_shadowSimple_c::draw() {
GXSetTevColor(GX_TEVREG0, l_color);
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_INDEX8);
GXLoadPosMtxImm(mVolumeMtx, GX_PNMTX0);
#ifdef TARGET_PC
Mtx volume_mtx;
if (dusk::frame_interp::lookup_replacement(&mVolumeMtx, volume_mtx)) {
GXLoadPosMtxImm(volume_mtx, GX_PNMTX0);
} else {
#endif
GXLoadPosMtxImm(mVolumeMtx, GX_PNMTX0);
#ifdef TARGET_PC
}
#endif
GXSetCurrentMtx(GX_PNMTX0);
GXCallDisplayList(l_frontMat, 0x40);
GXCallDisplayList(l_shadowVolumeDL, 0x40);
GXCallDisplayList(l_backSubMat, 0x20);
GXCallDisplayList(l_shadowVolumeDL, 0x40);
GXLoadPosMtxImm(mMtx, GX_PNMTX1);
#ifdef TARGET_PC
Mtx shadow_mtx;
if (dusk::frame_interp::lookup_replacement(&mMtx, shadow_mtx)) {
GXLoadPosMtxImm(shadow_mtx, GX_PNMTX1);
} else {
#endif
GXLoadPosMtxImm(mMtx, GX_PNMTX1);
#ifdef TARGET_PC
}
#endif
GXSetCurrentMtx(GX_PNMTX1);
if (mpTexObj != NULL) {
@@ -1394,6 +1431,10 @@ void dDlst_shadowSimple_c::set(cXyz* param_0, f32 param_1, f32 param_2, cXyz* pa
mDoMtx_stack_c::YrotM(param_4);
mDoMtx_stack_c::scaleM(param_2, 1.0f, param_2 * param_5);
cMtx_concat(j3dSys.getViewMtx(), mDoMtx_stack_c::get(), mMtx);
#ifdef TARGET_PC
dusk::frame_interp::record_final_mtx_raw(&mVolumeMtx, mVolumeMtx);
dusk::frame_interp::record_final_mtx_raw(&mMtx, mMtx);
#endif
mpTexObj = param_6;
}
@@ -1541,7 +1582,16 @@ void dDlst_shadowControl_c::draw(Mtx param_0) {
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX3x4, GX_TG_POS, GX_TEXMTX0);
GXSetNumTevStages(1);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
GXLoadPosMtxImm(param_0, GX_PNMTX0);
#ifdef TARGET_PC
Mtx draw_mtx;
if (dusk::frame_interp::lookup_replacement(param_0, draw_mtx)) {
GXLoadPosMtxImm(draw_mtx, GX_PNMTX0);
} else {
#endif
GXLoadPosMtxImm(param_0, GX_PNMTX0);
#ifdef TARGET_PC
}
#endif
GXColor matColor = {0, 0, 0, 0x20};
GXSetChanMatColor(GX_ALPHA0, matColor);
@@ -1878,14 +1928,32 @@ int dDlst_list_c::set(dDlst_base_c**& p_start, dDlst_base_c**& p_end, dDlst_base
return 1;
}
#if TARGET_PC && (TRACY_ENABLE || PARTIAL_DEBUG)
static absl::flat_hash_map<std::type_index, const char*> typeDrawNames;
static const char* getTypeDrawName(dDlst_base_c* dlst) {
const auto& info = typeid(*dlst);
auto& elem = typeDrawNames[info];
if (elem) [[likely]] {
return elem;
}
const auto size = snprintf(nullptr, 0, "%s::draw()", info.name());
// Note: pointer is intentionally never freed, Tracy needs it.
const auto buf = static_cast<char*>(malloc(size+1));
snprintf(buf, size+1, "%s::draw()", info.name());
elem = buf;
return buf;
}
#endif
void dDlst_list_c::draw(dDlst_base_c** p_start, dDlst_base_c** p_end) {
for (; p_start < p_end; p_start++) {
dDlst_base_c* dlst = *p_start;
#if DEBUG && TARGET_PC
char buf[64];
snprintf(buf, sizeof(buf), "%s::draw()", typeid(dlst).name());
GXScopedDebugGroup scope(buf);
#if TARGET_PC && (TRACY_ENABLE || PARTIAL_DEBUG)
const auto name = getTypeDrawName(dlst);
GXScopedDebugGroup scope(name);
#endif
dlst->draw();
}
+1 -1
View File
@@ -5585,7 +5585,7 @@ void dFile_select3D_c::toItem3Dpos(f32 param_0, f32 param_1, f32 param_2, cXyz*
Mtx adStack_98;
Mtx auStack_c8;
param_0 = (2.0f * ((param_0 - mDoGph_gInf_c::getMinXF()) / mDoGph_gInf_c::getWidthF()) - 1.0f);
param_1 = (2.0f * ((param_1 - -100.0f) / 448.0f) - 1.0f);
param_1 = (2.0f * ((param_1 - -100.0f) / FB_HEIGHT_BASE) - 1.0f);
calcViewMtx(adStack_98);
cMtx_inverse(adStack_98, auStack_c8);
f32 tangent = std::tan(M_PI / 8.0f);
+2 -1
View File
@@ -1,11 +1,12 @@
#include "d/d_jcam_editor.h"
#include "m_Do/m_Do_graphic.h"
#include "m_Do/m_Do_hostIO.h"
#include "m_Do/m_Do_ext.h"
dJcame_c* dJcame_c::m_myObj;
dJcame_c::dJcame_c(const JStage::TSystem* i_system, f32 param_1, JUTGamePad& i_pad) {
mOrthoGraph = JKR_NEW J2DOrthoGraph(0.0f, 0.0f, 608.0f, 448.0f, -1.0f, 1.0f);
mOrthoGraph = JKR_NEW J2DOrthoGraph(0.0f, 0.0f, FB_WIDTH_BASE, FB_HEIGHT_BASE, -1.0f, 1.0f);
mFont = JKR_NEW JUTResFont((ResFONT*)JUTResFONT_Ascfont_fix12, NULL);
mHeap = JKRExpHeap::create(0x100000, JKRHeap::getRootHeap2(), false);
+2 -2
View File
@@ -10994,9 +10994,9 @@ void dKy_depth_dist_set(void* process_p) {
if ((sp30.x >= 0.0f && sp30.x < FB_WIDTH) && (sp30.y >= 0.0f &&
#if DEBUG
sp30.y < 608.0f
sp30.y < FB_WIDTH_BASE
#else
sp30.y < 600.0f
sp30.y < (FB_WIDTH_BASE - 8)
#endif
)) {
cXyz sp18;
+53 -4
View File
@@ -4041,6 +4041,7 @@ void dKyr_drawSnow(Mtx drawMtx, u8** tex) {
}
void dKyr_drawStar(Mtx drawMtx, u8** tex) {
ZoneScoped;
dScnKy_env_light_c* envlight = dKy_getEnvlight();
dKankyo_star_Packet* star_packet = g_env_light.mpStarPacket;
camera_class* camera = (camera_class*)dComIfGp_getCamera(0);
@@ -4085,6 +4086,8 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
#endif
if (star_packet->mEffectNum != 0) {
IF_DUSK(GXPushDebugGroup("dKyr_drawStar"));
if (strcmp(dComIfGp_getStartStageName(), "F_SP200") == 0 && dComIfG_play_c::getLayerNo(0) == 0) {
gwolf_howl_stage = true;
} else if (strcmp(dComIfGp_getStartStageName(), "F_SP127") == 0 ||
@@ -4127,23 +4130,27 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
mDoLib_project(&moon_pos, &moon_proj);
#endif
// Dusk optimization: we use vertex color rather than GX_TEVREG0 to set star color.
// This allows us to merge all the stars into a single draw.
GXSetNumChans(1);
GXSetChanCtrl(GX_COLOR0, GX_DISABLE, GX_SRC_REG, GX_SRC_REG, GX_LIGHT_NULL, GX_DF_CLAMP, GX_AF_NONE);
GXSetChanCtrl(GX_COLOR0, GX_DISABLE, GX_SRC_REG, DUSK_IF_ELSE(GX_SRC_VTX, GX_SRC_REG), GX_LIGHT_NULL, GX_DF_CLAMP, GX_AF_NONE);
GXSetNumTexGens(0);
GXSetNumTevStages(1);
GXSetTevColor(GX_TEVREG0, color_reg0);
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0);
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, DUSK_IF_ELSE(GX_CC_RASC, GX_CC_C0));
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_A0);
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, DUSK_IF_ELSE(GX_CA_RASA, GX_CA_A0));
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetZMode(GX_ENABLE, GX_LEQUAL, GX_DISABLE);
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_CLEAR);
GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0);
GXSetNumIndStages(0);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
IF_DUSK(GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0));
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
IF_DUSK(GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT));
Mtx rotMtx;
MTXRotRad(rotMtx, 'Z', DEG_TO_RAD(rot));
@@ -4203,6 +4210,15 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
int sp44 = 0;
f32 var_f28 = 0.0f;
#if TARGET_PC
// Dusk optimization: we submit a single large draw call, rather than a thousand.
u32 vertCount = 3 * star_packet->mEffectNum;
if (draw_mirrored) {
vertCount *= 2;
}
GXBegin(GX_TRIANGLES, GX_VTXFMT0, vertCount);
#endif
for (int i = 0; i < star_packet->mEffectNum; i++) {
f32 var_f31;
cXyz star_pos;
@@ -4253,7 +4269,7 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
color_reg0.a = 70.0f + ((i & 63) * 2);
}
GXSetTevColor(GX_TEVREG0, color_reg0);
IF_NOT_DUSK(GXSetTevColor(GX_TEVREG0, color_reg0));
cXyz sp68;
cXyz sp5C;
@@ -4294,6 +4310,33 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
}
// if a star is too close to the moon then avoid drawing
#if TARGET_PC
// Dusk optimization change: since we submit one large draw, we don't know the count of moon-hidden stars in advance.
// So, just set those to have zero alpha.
if (moon_dist_to_star <= moon_threshold) {
color_reg0.a = 0;
}
GXPosition3f32(sp68.x + (var_f31 * (pos[0].x - spBC.x)), sp68.y + (var_f31 * (pos[0].y - spBC.y)), sp68.z + (var_f31 * (pos[0].z - spBC.z)));
GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a);
GXPosition3f32(sp68.x + (var_f31 * (pos[1].x - spBC.x)), sp68.y + (var_f31 * (pos[1].y - spBC.y)), sp68.z + (var_f31 * (pos[1].z - spBC.z)));
GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a);
GXPosition3f32(sp68.x + (var_f31 * (pos[2].x - spBC.x)), sp68.y + (var_f31 * (pos[2].y - spBC.y)), sp68.z + (var_f31 * (pos[2].z - spBC.z)));
GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a);
if (draw_mirrored) {
sp5C.x = spBC.x + star_pos.x;
sp5C.y = spBC.y - star_pos.y;
sp5C.z = spBC.z + star_pos.z;
GXPosition3f32(sp5C.x + (var_f31 * (pos[0].x - spBC.x)), sp5C.y + (var_f31 * (pos[0].y - spBC.y)), sp5C.z + (var_f31 * (pos[0].z - spBC.z)));
GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a);
GXPosition3f32(sp5C.x + (var_f31 * (pos[1].x - spBC.x)), sp5C.y + (var_f31 * (pos[1].y - spBC.y)), sp5C.z + (var_f31 * (pos[1].z - spBC.z)));
GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a);
GXPosition3f32(sp5C.x + (var_f31 * (pos[2].x - spBC.x)), sp5C.y + (var_f31 * (pos[2].y - spBC.y)), sp5C.z + (var_f31 * (pos[2].z - spBC.z)));
GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a);
}
#else
if (moon_dist_to_star > moon_threshold) {
GXBegin(GX_TRIANGLES, GX_VTXFMT0, 3);
GXPosition3f32(sp68.x + (var_f31 * (pos[0].x - spBC.x)), sp68.y + (var_f31 * (pos[0].y - spBC.y)), sp68.z + (var_f31 * (pos[0].z - spBC.z)));
@@ -4313,8 +4356,14 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
GXEnd();
}
}
#endif
}
#if TARGET_PC
GXEnd();
GXPopDebugGroup();
#endif
J3DShape::resetVcdVatCache();
}
}
+10
View File
@@ -539,9 +539,19 @@ void renderingAmap_c::rendering(dDrawPath_c::poly_class const* i_poly) {
}
}
/* Enabling the following definition will modify the following function to
* make the map look worse for extra speed in the emulator, especially in large
* areas such as hyrule field.
*/
#define HYRULE_FIELD_SPEEDHACK
bool renderingAmap_c::isDrawOutSideTrim() {
bool rt = false;
#ifdef HYRULE_FIELD_SPEEDHACK
return 0;
#endif
if (getDispType() == 0 || getDispType() == 4 || getDispType() == 3 || getDispType() == 2 ||
getDispType() == 5)
{
+1 -1
View File
@@ -2708,7 +2708,7 @@ void dMenu_Collect3D_c::toItem3Dpos(f32 param_0, f32 param_1, f32 param_2, cXyz*
Mtx auStack_c8;
param_0 =
(2.0f * ((param_0 - mDoGph_gInf_c::getMinXF()) / mDoGph_gInf_c::getWidthF()) - 1.0f);
param_1 = (2.0f * ((param_1 - -100.0f) / 448.0f) - 1.0f);
param_1 = (2.0f * ((param_1 - -100.0f) / FB_HEIGHT_BASE) - 1.0f);
calcViewMtx(adStack_98);
MTXInverse(adStack_98, auStack_c8);
f32 tangent = tan(0.39269909262657166);
+12 -12
View File
@@ -229,17 +229,17 @@ dMenu_Fmap_c::dMenu_Fmap_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i
}
if (i_panDirection == 1) {
mTransX = -608.0f;
mTransX = -FB_WIDTH_BASE;
mTransY = 0.0f;
} else if (i_panDirection == 3) {
mTransX = 608.0f;
mTransX = FB_WIDTH_BASE;
mTransY = 0.0f;
} else if (i_panDirection == 2) {
mTransX = 0.0f;
mTransY = -448.0f;
mTransY = -FB_HEIGHT_BASE;
} else if (i_panDirection == 0) {
mTransX = 0.0f;
mTransY = 448.0f;
mTransY = FB_HEIGHT_BASE;
} else {
mTransX = 0.0f;
mTransY = 0.0f;
@@ -1705,17 +1705,17 @@ bool dMenu_Fmap_c::isOpen() {
f32 ratio = (f32)mDisplayFrame / (f32)display_frame_num;
if (mPanDirection == 1) {
mTransX = (1.0f - ratio) * -608.0f;
mTransX = (1.0f - ratio) * -FB_WIDTH_BASE;
mTransY = 0.0f;
} else if (mPanDirection == 3) {
mTransX = (1.0f - ratio) * 608.0f;
mTransX = (1.0f - ratio) * FB_WIDTH_BASE;
mTransY = 0.0f;
} else if (mPanDirection == 2) {
mTransX = 0.0f;
mTransY = (1.0f - ratio) * -448.0f;
mTransY = (1.0f - ratio) * -FB_HEIGHT_BASE;
} else if (mPanDirection == 0) {
mTransX = 0.0f;
mTransY = (1.0f - ratio) * 448.0f;
mTransY = (1.0f - ratio) * FB_HEIGHT_BASE;
}
mAlphaRatio = ratio;
@@ -1755,17 +1755,17 @@ bool dMenu_Fmap_c::isClose() {
}
if (mPanDirection == 1) {
mTransX = (1.0f - ratio) * 608.0f;
mTransX = (1.0f - ratio) * FB_WIDTH_BASE;
mTransY = 0.0f;
} else if (mPanDirection == 3) {
mTransX = (1.0f - ratio) * -608.0f;
mTransX = (1.0f - ratio) * -FB_WIDTH_BASE;
mTransY = 0.0f;
} else if (mPanDirection == 2) {
mTransX = 0.0f;
mTransY = (1.0f - ratio) * 448.0f;
mTransY = (1.0f - ratio) * FB_HEIGHT_BASE;
} else if (mPanDirection == 0) {
mTransX = 0.0f;
mTransY = (1.0f - ratio) * -448.0f;
mTransY = (1.0f - ratio) * -FB_HEIGHT_BASE;
}
mAlphaRatio = ratio;
+10 -3
View File
@@ -17,6 +17,7 @@
#include "d/d_msg_scrn_explain.h"
#include "m_Do/m_Do_graphic.h"
#include "d/actor/d_a_midna.h"
#include "dusk/frame_interpolation.h"
#include <cstring>
dMenu_Fmap2DBack_c::dMenu_Fmap2DBack_c() {
@@ -390,11 +391,17 @@ void dMenu_Fmap2DBack_c::draw() {
(mArrowPos3DZ + control_ypos + fVar3) - fVar5, &mArrowPos2DX,
&mArrowPos2DY);
field_0x11e0 -= g_fmapHIO.mCursorSpeed;
#ifdef TARGET_PC
for (u32 i = 0; i < dusk::frame_interp::get_presentation_ui_advance_ticks(); ++i) {
#endif
field_0x11e0 -= g_fmapHIO.mCursorSpeed;
if (field_0x11e0 < 0.0f) {
field_0x11e0 += 360.0f;
if (field_0x11e0 < 0.0f) {
field_0x11e0 += 360.0f;
}
#ifdef TARGET_PC
}
#endif
mpPointParent->getPanePtr()->rotate(mpPointParent->getSizeX() / 2.0f,
mpPointParent->getSizeY() / 2.0f, ROTATE_Z,
+3
View File
@@ -183,6 +183,9 @@ void dMenu_Insect_c::_draw() {
mpExpScreen->draw(0.0f, 0.0f, grafPort);
mpSelect_c->setOffsetX(g_drawHIO.mInsectListScreen.mConfirmOptionPosX_4x3);
// the magic numbers here are correlated with the framebuffer size, but
// were likely either chosen by hand or had multiple arithmetic
// operations applied which cannot easily be reverse engineered
mpSelect_c->translate(g_drawHIO.mInsectListScreen.mConfirmOptionPosX_4x3 + 486.0f,
g_drawHIO.mInsectListScreen.mConfirmOptionPosY_4x3 + 209.0f);
mpSelect_c->draw(0.0f, 0.0f);
+3
View File
@@ -330,6 +330,9 @@ void dMenu_ItemExplain_c::draw(J2DOrthoGraph* i_graph) {
mpInfoString->drawOutFontLocal((J2DTextBox*)mpInfoText->getPanePtr(), -1.0f);
drawKantera();
if (mpSelect_c != NULL) {
// the magic numbers here are correlated with the framebuffer size, but
// were likely either chosen by hand or had multiple arithmetic
// operations applied which cannot easily be reverse engineered
mpSelect_c->translate(486.0f, 209.0f);
mpSelect_c->draw(0.0f, 0.0f);
}
+18 -18
View File
@@ -87,16 +87,16 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i
mPikariFlashingSpeed = 0.0f;
if (mRingOrigin == 0) {
mCenterPosX = 0.0f;
mCenterPosY = 448.0f;
mCenterPosY = FB_HEIGHT_BASE;
} else if (mRingOrigin == 2) {
mCenterPosX = 0.0f;
mCenterPosY = -448.0f;
mCenterPosY = -FB_HEIGHT_BASE;
}
if (mRingOrigin == 3) {
mCenterPosX = 608.0f;
mCenterPosX = FB_WIDTH_BASE;
mCenterPosY = 0.0f;
} else if (mRingOrigin == 1) {
mCenterPosX = -608.0f;
mCenterPosX = -FB_WIDTH_BASE;
mCenterPosY = 0.0f;
} else {
mCenterPosX = 0.0f;
@@ -644,15 +644,15 @@ bool dMenu_Ring_c::isOpen() {
mAlphaRate = (f32)mOpenCloseFrames / (f32)g_ringHIO.mOpenFrames;
if (mRingOrigin == 0) {
mCenterPosX = 0.0f;
mCenterPosY = (1.0f - mAlphaRate) * 448.0f;
mCenterPosY = (1.0f - mAlphaRate) * FB_HEIGHT_BASE;
} else if (mRingOrigin == 2) {
mCenterPosX = 0.0f;
mCenterPosY = (1.0f - mAlphaRate) * -448.0f;
mCenterPosY = (1.0f - mAlphaRate) * -FB_HEIGHT_BASE;
} else if (mRingOrigin == 3) {
mCenterPosX = (1.0f - mAlphaRate) * 608.0f;
mCenterPosX = (1.0f - mAlphaRate) * FB_WIDTH_BASE;
mCenterPosY = 0.0f;
} else if (mRingOrigin == 1) {
mCenterPosX = (1.0f - mAlphaRate) * -608.0f;
mCenterPosX = (1.0f - mAlphaRate) * -FB_WIDTH_BASE;
mCenterPosY = 0.0f;
}
if (mOpenCloseFrames >= g_ringHIO.mOpenFrames) {
@@ -715,15 +715,15 @@ bool dMenu_Ring_c::isClose() {
}
if (mRingOrigin == 0) {
mCenterPosX = 0.0f;
mCenterPosY = (1.0f - mAlphaRate) * -448.0f;
mCenterPosY = (1.0f - mAlphaRate) * -FB_HEIGHT_BASE;
} else if (mRingOrigin == 2) {
mCenterPosX = 0.0f;
mCenterPosY = (1.0f - mAlphaRate) * 448.0f;
mCenterPosY = (1.0f - mAlphaRate) * FB_HEIGHT_BASE;
} else if (mRingOrigin == 3) {
mCenterPosX = (1.0f - mAlphaRate) * -608.0f;
mCenterPosX = (1.0f - mAlphaRate) * -FB_WIDTH_BASE;
mCenterPosY = 0.0f;
} else if (mRingOrigin == 1) {
mCenterPosX = (1.0f - mAlphaRate) * 608.0f;
mCenterPosX = (1.0f - mAlphaRate) * FB_WIDTH_BASE;
mCenterPosY = 0.0f;
}
mpDrawCursor->setPos(mItemSlotPosX[mCurrentSlot] + mCenterPosX,
@@ -855,11 +855,11 @@ s16 dMenu_Ring_c::calcStickAngle(STControl* i_stick, u8 param_1) {
}
void dMenu_Ring_c::setRotate() {
clacEllipsePlotAverage(mItemsTotal, g_ringHIO.mItemRingPosX + 304.0f,
g_ringHIO.mItemRingPosY + 224.0f);
clacEllipsePlotAverage(mItemsTotal, g_ringHIO.mItemRingPosX + FB_WIDTH_BASE / 2,
g_ringHIO.mItemRingPosY + FB_HEIGHT_BASE / 2);
for (int i = 0; i < mItemsTotal; i++) {
field_0x63e[i] = cM_atan2s(mItemSlotPosX[i] - (304.0f + g_ringHIO.mItemRingPosX),
mItemSlotPosY[i] - (224.0f + g_ringHIO.mItemRingPosY));
field_0x63e[i] = cM_atan2s(mItemSlotPosX[i] - (FB_WIDTH_BASE / 2 + g_ringHIO.mItemRingPosX),
mItemSlotPosY[i] - (FB_HEIGHT_BASE / 2 + g_ringHIO.mItemRingPosY));
}
}
@@ -1446,9 +1446,9 @@ void dMenu_Ring_c::stick_move_proc() {
setStatus(field_0x6b2);
} else {
f32 itemRingPosX =
g_ringHIO.mItemRingPosX + 304.0f + mRingRadiusH * cM_ssin(field_0x66e);
g_ringHIO.mItemRingPosX + FB_WIDTH_BASE / 2 + mRingRadiusH * cM_ssin(field_0x66e);
f32 itemRingPosY =
g_ringHIO.mItemRingPosY + 224.0f + mRingRadiusV * cM_scos(field_0x66e);
g_ringHIO.mItemRingPosY + FB_HEIGHT_BASE / 2 + mRingRadiusV * cM_scos(field_0x66e);
mpDrawCursor->setPos(itemRingPosX, itemRingPosY);
}
}
+54 -34
View File
@@ -20,6 +20,7 @@
#include "d/d_msg_class.h"
#include "d/d_msg_object.h"
#include "d/d_pane_class.h"
#include "dusk/frame_interpolation.h"
#include <cstring>
dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap* mp_heap) {
@@ -636,38 +637,49 @@ void dMeter2Draw_c::draw() {
if (field_0x756 >= 0) {
var_f29 = g_drawHIO.mLightDrop.mDropPikariAnimSpeed_Completed;
int temp_r5_2 = g_drawHIO.mLightDrop.mPikariInterval * 15;
#ifdef TARGET_PC
// Set even if not advancing
var_f28 = g_drawHIO.mLightDrop.mPikariScaleComplete;
if (field_0x756 <= temp_r5_2) {
int temp_r4 = (field_0x756 % g_drawHIO.mLightDrop.mPikariInterval);
int temp_r3_5 = field_0x756 / g_drawHIO.mLightDrop.mPikariInterval;
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
for (u32 tick = 0; tick < ui_advance_ticks; ++tick) {
#endif
if (field_0x756 <= temp_r5_2) {
int temp_r4 = (field_0x756 % g_drawHIO.mLightDrop.mPikariInterval);
int temp_r3_5 = field_0x756 / g_drawHIO.mLightDrop.mPikariInterval;
if (temp_r4 == 0 && field_0x62c[temp_r3_5] == 0.0f) {
field_0x62c[temp_r3_5] = 18.0f;
}
var_f28 = g_drawHIO.mLightDrop.mPikariScaleComplete;
field_0x756++;
} else {
int temp_r5_3 = temp_r5_2 + 1;
if (field_0x756 == temp_r5_3) {
if (field_0x62c[15] == 0.0f) {
field_0x756++;
if (temp_r4 == 0 && field_0x62c[temp_r3_5] == 0.0f) {
field_0x62c[temp_r3_5] = 18.0f;
}
var_f28 = g_drawHIO.mLightDrop.mPikariScaleComplete;
} else if (field_0x756 >= g_drawHIO.mLightDrop.field_0x54 + temp_r5_3) {
for (int i = 0; i < 16; i++) {
field_0x62c[i] = 18.0f - var_f29;
field_0x66c[i] = 18.0f - g_drawHIO.mLightDrop.mPikariLoopAnimSpeed;
}
field_0x756 = -1;
} else {
field_0x756++;
} else {
int temp_r5_3 = temp_r5_2 + 1;
if (field_0x756 == temp_r5_3) {
if (field_0x62c[15] == 0.0f) {
field_0x756++;
}
var_f28 = g_drawHIO.mLightDrop.mPikariScaleComplete;
} else if (field_0x756 >= g_drawHIO.mLightDrop.field_0x54 + temp_r5_3) {
for (int i = 0; i < 16; i++) {
field_0x62c[i] = 18.0f - var_f29;
field_0x66c[i] = 18.0f - g_drawHIO.mLightDrop.mPikariLoopAnimSpeed;
}
field_0x756 = -1;
#ifdef TARGET_PC
break;
#endif
} else {
field_0x756++;
}
}
}
#ifdef TARGET_PC
}
#endif
for (int i = 0; i < 16; i++) {
if (field_0x66c[i] > 0.0f) {
@@ -1336,20 +1348,27 @@ void dMeter2Draw_c::drawPikari(f32 i_posX, f32 i_posY, f32* i_framep, f32 i_scal
if (param_9 != 3 && param_9 != 4 && param_9 != 5 && dMsgObject_isTalkNowCheck()) {
*i_framep = 0.0f;
} else {
*i_framep += param_8;
if (*i_framep > var_f31) {
if (param_9 == 1 || param_9 == 2 || param_9 == 3) {
*i_framep = 18.0f;
} else {
*i_framep = 0.0f;
#ifdef TARGET_PC
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
for (u32 i = 0; i < ui_advance_ticks; ++i) {
#endif
*i_framep += param_8;
if (*i_framep > var_f31) {
if (param_9 == 1 || param_9 == 2 || param_9 == 3) {
*i_framep = 18.0f;
} else {
*i_framep = 0.0f;
}
}
}
if (*i_framep == 18.0f && param_9 == 1) {
mDoAud_seStart(Z2SE_NAVI_BLINK, NULL, 0, 0);
} else if (*i_framep == 18.0f && param_9 == 2) {
mDoAud_seStart(Z2SE_SY_ITEM_COMBINE_ICON, NULL, 0, 0);
if (*i_framep == 18.0f && param_9 == 1) {
mDoAud_seStart(Z2SE_NAVI_BLINK, NULL, 0, 0);
} else if (*i_framep == 18.0f && param_9 == 2) {
mDoAud_seStart(Z2SE_SY_ITEM_COMBINE_ICON, NULL, 0, 0);
}
#ifdef TARGET_PC
}
#endif
playPikariBckAnimation(*i_framep);
playPikariBpkAnimation(*i_framep);
@@ -1543,6 +1562,7 @@ void dMeter2Draw_c::setAlphaLifeAnimeMax() {
}
void dMeter2Draw_c::drawKanteraScreen(u8 i_meterType) {
GX_AND_TRACY_SCOPED("drawKanteraScreen");
J2DGrafContext* graf_ctx = dComIfGp_getCurrentGrafPort();
mpMagicParent->setAlphaRate(mMeterAlphaRate[i_meterType]);
+4 -4
View File
@@ -205,11 +205,11 @@ void dMeter2Info_c::init() {
unk_0x5c = 0.0f;
unk_0x60 = 1.0f;
unk_0x64 = 30.0f;
unk_0x68 = 304.0f;
unk_0x6c = 224.0f;
unk_0x68 = FB_WIDTH_BASE / 2;
unk_0x6c = FB_HEIGHT_BASE / 2;
m2DWidth = 608.0f;
m2DHeight = 448.0f;
m2DWidth = FB_WIDTH_BASE;
m2DHeight = FB_HEIGHT_BASE;
m2DPosH = 0.0f;
m2DPosV = 0.0f;
unk_0x80 = 0.0f;
+9 -9
View File
@@ -197,11 +197,11 @@ void dMeter_drawOptionHIO_c::genMessage(JORMContext* mctx) {
mctx->genSlider("位置X", &mOptionTypeBGPosX[3], -300.0f, 300.0f);
mctx->genSlider("位置Y", &mOptionTypeBGPosY[3], -300.0f, 300.0f);
mctx->genLabel("*****テレビ画面の設定*****", 0);
mctx->genSlider("位置X", &mTVsettingPosX, -300.0f, 300.0f);
mctx->genSlider("位置Y", &mTVsettingPosY, -300.0f, 300.0f);
mctx->genSlider("位置X", &mOptionTypeBGPosX[4], -300.0f, 300.0f);
mctx->genSlider("位置Y", &mOptionTypeBGPosY[4], -300.0f, 300.0f);
mctx->genLabel("*****キャリブレーション*****", 0);
mctx->genSlider("位置X", &mPointerCalibrationPosX, -300.0f, 300.0f);
mctx->genSlider("位置Y", &mPointerCalibrationPosY, -300.0f, 300.0f);
mctx->genSlider("位置X", &mOptionTypeBGPosX[5], -300.0f, 300.0f);
mctx->genSlider("位置Y", &mOptionTypeBGPosY[5], -300.0f, 300.0f);
mctx->genLabel("*****設定確認*****", 0);
mctx->genSlider("背景アルファ", &mBackgroundAlpha, 0, 255);
mctx->genSlider("位置Y", &mBackgroundPosY, -300.0f, 300.0f);
@@ -1493,7 +1493,7 @@ dMeter_drawLightDropHIO_c::dMeter_drawLightDropHIO_c() {
mPikariInterval = 1;
field_0x54 = 0xFFF1;
mVesselAlpha[2] = 0.5f;
mDropAlpha = 1.0f;
mVesselAlpha[3] = 1.0f;
mDropOnColorBlack.set(30, 255, 255, 0);
mDropOnColorWhite.set(255, 255, 255, 255);
@@ -1554,7 +1554,7 @@ void dMeter_drawLightDropHIO_c::genMessage(JORMContext* mctx) {
mctx->genSlider("位置調整Y(会話)", &mVesselTalkPosY, -300.0f, 300.0f);
mctx->genSlider("アルファ(会話)", &mVesselAlpha[1], 0.0f, 1.0f);
mctx->genSlider("アルファ(器)", &mVesselAlpha[2], 0.0f, 1.0f);
mctx->genSlider("アルファ(雫)", &mDropAlpha, 0.0f, 1.0f);
mctx->genSlider("アルファ(雫)", &mVesselAlpha[3], 0.0f, 1.0f);
mctx->genLabel("***光の器ゲット後***", 0);
mctx->genSlider("拡大縮小", &mDropGetScale, 0.0f, 3.0f);
mctx->genSlider("拡縮アニメフレーム数", &mDropGetScaleAnimFrameNum, 0, 30);
@@ -4010,9 +4010,9 @@ void dMeter_fmapHIO_c::genMessage(JORMContext* mctx) {
mctx->genSlider("リージョン拡大表示範囲", &mRegionZoomRange, 1000.0, 1000000.0);
mctx->genCheckBox("表示基準領域枠表示", (u8*)&mDisplayReferenceArea, 0x1);
mctx->genCheckBox("スクロール範囲を表示基準", (u8*)&field_0x308, 0x1);
mctx->genSlider("左上座標X", &mMapTopLeftPosX, 0.0, 608.0);
mctx->genSlider("左上座標Y", &mMapTopLeftPosY, 0.0, 448.0);
mctx->genSlider("領域幅", &mMapScale, 0.0, 608.0);
mctx->genSlider("左上座標X", &mMapTopLeftPosX, 0.0, FB_WIDTH_BASE);
mctx->genSlider("左上座標Y", &mMapTopLeftPosY, 0.0, FB_HEIGHT_BASE);
mctx->genSlider("領域幅", &mMapScale, 0.0, FB_WIDTH_BASE);
mctx->genLabel("\n*** スクロール速度境界 ***", 0);
mctx->genSlider("0~遅", &mScrollSpeedSlowBound, 0.0, 1.0);
mctx->genSlider("遅~速", &mScrollSpeedFastBound, 0.0, 1.0);
+1 -1
View File
@@ -1035,7 +1035,7 @@ void dMeterButton_c::screenInitButton() {
}
field_0x4b0 = 0;
mParentCenterX = (608.0f / 2) - mpParent->getInitCenterPosX();
mParentCenterX = (FB_WIDTH_BASE / 2.0f) - mpParent->getInitCenterPosX();
paneTrans(mpParent, mParentCenterX, 0.0f, 0xFF);
mpButtonA = JKR_NEW CPaneMgr(mpButtonScreen, MULTI_CHAR('abtn_n'), 2, NULL);
+6 -6
View File
@@ -99,28 +99,28 @@ void dMeterHaihai_c::draw() {
}
if (direction & DIR_DOWN_e || i_forceDraw) {
mpParent->getPanePtr()->translate(x_pos[0] + 304.0f, y_pos[0] + 224.0f);
mpParent->getPanePtr()->translate(x_pos[0] + FB_WIDTH_BASE / 2, y_pos[0] + FB_HEIGHT_BASE / 2);
mpParent->getPanePtr()->rotate(mpParent->getPanePtr()->getWidth() / 2,
mpParent->getPanePtr()->getHeight() / 2, ROTATE_Z, 0.0f);
mpHaihaiScreen->draw(0.0f, 0.0f, dComIfGp_getCurrentGrafPort());
}
if (direction & DIR_RIGHT_e || i_forceDraw) {
mpParent->getPanePtr()->translate(x_pos[1] + 304.0f, y_pos[1] + 224.0f);
mpParent->getPanePtr()->translate(x_pos[1] + FB_WIDTH_BASE / 2, y_pos[1] + FB_HEIGHT_BASE / 2);
mpParent->getPanePtr()->rotate(mpParent->getPanePtr()->getWidth() / 2,
mpParent->getPanePtr()->getHeight() / 2, ROTATE_Z, 90.0f);
mpHaihaiScreen->draw(0.0f, 0.0f, dComIfGp_getCurrentGrafPort());
}
if (direction & DIR_UP_e || i_forceDraw) {
mpParent->getPanePtr()->translate(x_pos[0] + 304.0f, 224.0f - y_pos[0]);
mpParent->getPanePtr()->translate(x_pos[0] + FB_WIDTH_BASE / 2, FB_HEIGHT_BASE / 2 - y_pos[0]);
mpParent->getPanePtr()->rotate(mpParent->getPanePtr()->getWidth() / 2,
mpParent->getPanePtr()->getHeight() / 2, ROTATE_Z, 180.0f);
mpHaihaiScreen->draw(0.0f, 0.0f, dComIfGp_getCurrentGrafPort());
}
if (direction & DIR_LEFT_e || i_forceDraw) {
mpParent->getPanePtr()->translate(304.0f - x_pos[1], y_pos[1] + 224.0f);
mpParent->getPanePtr()->translate(FB_WIDTH_BASE / 2 - x_pos[1], y_pos[1] + FB_HEIGHT_BASE / 2);
mpParent->getPanePtr()->rotate(mpParent->getPanePtr()->getWidth() / 2,
mpParent->getPanePtr()->getHeight() / 2, ROTATE_Z, 270.0f);
mpHaihaiScreen->draw(0.0f, 0.0f, dComIfGp_getCurrentGrafPort());
@@ -128,8 +128,8 @@ void dMeterHaihai_c::draw() {
}
void dMeterHaihai_c::drawHaihai(u8 i_direction) {
f32 center_x = 304.0f;
f32 center_y = 224.0f;
f32 center_x = FB_WIDTH_BASE / 2;
f32 center_y = FB_HEIGHT_BASE / 2;
if (mType == 1) {
center_x += (3.0f + g_drawHIO.mScrollArrowCenterPosX);
-9
View File
@@ -593,15 +593,6 @@ void dMeterMap_c::_draw() {
dComIfGd_set2DOpa(this);
}
#else
#if TARGET_PC
// Optimization: don't draw map if it's off-screen/invisible.
// Especially useful in debug builds on Hyrule field etc., it's slow!
// That +3 is an arbitrary bias to avoid rounding issues causing this to fail.
if ((!mMapIsInside && mSlidePositionOffset <= getDispPosOutSide_OffsetX() + 3) || mMapAlpha == 0) {
return;
}
#endif
mMap->_draw();
dComIfGd_set2DOpa(this);
#endif
+6
View File
@@ -2234,7 +2234,13 @@ int dMsgFlow_c::event027(mesg_flow_node_event* i_flowNode_p, fopAc_ac_c* i_speak
u16 prm0;
getParam(&prm0, &prm1, i_flowNode_p->params);
// !@bug aParam8 is undersized; getParam always writes 4 bytes, stomping the
// 2 bytes past the buffer. Harmless on GC/Wii (MWCC stack layout absorbs it).
#if AVOID_UB
u8 aParam8[4];
#else
u8 aParam8[2];
#endif
getParam(aParam8, i_flowNode_p->params);
JUT_ASSERT(4509, (aParam8[0] >= 0 && aParam8[0] <= dSv_player_item_c::BOMB_BAG_MAX) || (aParam8[0] == 4));
+8 -5
View File
@@ -70,7 +70,7 @@ dMsgScrnExplain_c::dMsgScrnExplain_c(STControl* i_stick, u8 param_1, bool i_isUs
mpTxScreen = JKR_NEW J2DScreen();
JUT_ASSERT(102, mpTxScreen != NULL);
field_0x48 = 608.0f;
field_0x48 = FB_WIDTH_BASE;
if (param_1 == 1 || param_1 == 3) {
#if PLATFORM_GCN
@@ -309,7 +309,7 @@ void dMsgScrnExplain_c::draw(J2DOrthoGraph* i_graf) {
}
if (mpBackTex != NULL) {
mpBackTex->draw(0.0f, 0.0f, 608.0f, 448.0f, false, false, false);
mpBackTex->draw(0.0f, 0.0f, FB_WIDTH_BASE, FB_HEIGHT_BASE, false, false, false);
}
if (field_0x66 != 2 && field_0x66 != 3) {
@@ -330,6 +330,9 @@ void dMsgScrnExplain_c::draw(J2DOrthoGraph* i_graf) {
strcpy(((J2DTextBox*)mpTm_c[0]->getPanePtr())->getStringPtr(), string_buf);
if (mpSelect_c != NULL && (field_0x64 == 1 || field_0x64 == 2)) {
// the magic numbers here are relative to the framebuffer size, but were likely
// either chosen by hand or had multiple arithmetic operations applied which
// cannot easily be reverse engineered
f32 y_offset = 0.0f;
if (field_0x66 == 2) {
y_offset = -100.0f;
@@ -385,7 +388,7 @@ void dMsgScrnExplain_c::open_request_proc() {
void dMsgScrnExplain_c::open_init() {
field_0x5a = 0;
field_0x48 = 608.0f;
field_0x48 = FB_WIDTH_BASE;
for (int i = 0; i < 2; i++) {
mpRoot_c[i]->setAlphaRate(0.0f);
}
@@ -403,7 +406,7 @@ void dMsgScrnExplain_c::open_proc() {
}
}
field_0x48 = 608.0f * getAlphaRatio();
field_0x48 = FB_WIDTH_BASE * getAlphaRatio();
for (int i = 0; i < 2; i++) {
mpRoot_c[i]->setAlphaRate(1.0f - getAlphaRatio());
}
@@ -583,7 +586,7 @@ void dMsgScrnExplain_c::close_proc() {
}
}
field_0x48 = 608.0f * getAlphaRatio();
field_0x48 = FB_WIDTH_BASE * getAlphaRatio();
for (int i = 0; i < 2; i++) {
mpRoot_c[i]->setAlphaRate(1.0f - getAlphaRatio());
}
+3
View File
@@ -609,6 +609,9 @@ void dMsgScrnItem_c::fukiPosCalc(u8 param_1) {
field_0x180 = 0.0f;
field_0x19c = param_1;
f32 yOffset;
// the magic numbers here are correlated with the framebuffer size, but
// were likely either chosen by hand or had multiple arithmetic
// operations applied which cannot easily be reverse engineered
switch(field_0x19c) {
case 1:
yOffset = g_MsgObject_HIO_c.mBoxPos[2][3];
+21 -6
View File
@@ -6,6 +6,7 @@
#include "JSystem/J2DGraph/J2DScreen.h"
#include "d/d_com_inf_game.h"
#include "d/d_pane_class.h"
#include "dusk/frame_interpolation.h"
class dMsgScrnLight_HIO_c {
public:
@@ -202,10 +203,17 @@ void dMsgScrnLight_c::draw(f32* i_anmFrame, f32 i_posX, f32 i_posY, f32 i_scaleX
}
if (mPlayAnim) {
*i_anmFrame += 1.0f;
if (*i_anmFrame >= mpBck->getFrameMax()) {
*i_anmFrame = 0.0f;
#ifdef TARGET_PC
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
for (u32 i = 0; i < ui_advance_ticks; ++i) {
#endif
*i_anmFrame += 1.0f;
if (*i_anmFrame >= mpBck->getFrameMax()) {
*i_anmFrame = 0.0f;
}
#ifdef TARGET_PC
}
#endif
mBckFrame = *i_anmFrame;
mBpkFrame = *i_anmFrame;
@@ -220,11 +228,18 @@ void dMsgScrnLight_c::draw(f32* i_anmFrame, f32 i_posX, f32 i_posY, f32 i_scaleX
mpParent_c->setBlackWhite(i_black, i_white);
if (mPlayAnim) {
*i_anmFrame += i_anmRate;
#ifdef TARGET_PC
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
for (u32 i = 0; i < ui_advance_ticks; ++i) {
#endif
*i_anmFrame += i_anmRate;
if (*i_anmFrame >= mpBck->getFrameMax()) {
*i_anmFrame = 0.0f;
if (*i_anmFrame >= mpBck->getFrameMax()) {
*i_anmFrame = 0.0f;
}
#ifdef TARGET_PC
}
#endif
mBckFrame = *i_anmFrame;
mBpkFrame = *i_anmFrame;
+7 -4
View File
@@ -454,11 +454,11 @@ void dMsgScrnTalk_c::fukiPosCalc(u8 param_1) {
#if TARGET_PC
mDoLib_project(&msgActor->pos, &local_70, {0, 0, FB_WIDTH, FB_HEIGHT});
#else
mDoLib_project(&msgActor->pos, &local_70,);
mDoLib_project(&msgActor->pos, &local_70);
#endif
if (local_70.x >= 0.0f && local_70.x <= 608.0f && local_70.y >= 0.0f &&
local_70.y <= 448.0f)
if (local_70.x >= 0.0f && local_70.x <= FB_WIDTH_BASE && local_70.y >= 0.0f &&
local_70.y <= FB_HEIGHT_BASE)
{
f3y = 0.5f * (cStack_7c.y + local_70.y);
} else {
@@ -493,6 +493,9 @@ void dMsgScrnTalk_c::fukiPosCalc(u8 param_1) {
field_0xf0 = 0.0f;
field_0x488 = param_1;
f32 dVar15;
// the magic numbers here are correlated with the framebuffer size, but
// were likely either chosen by hand or had multiple arithmetic
// operations applied which cannot easily be reverse engineered
switch (field_0x488) {
case 1:
dVar15 = g_MsgObject_HIO_c.mBoxPos[2][0];
+15 -11
View File
@@ -8,22 +8,23 @@
// weak data from it (unlike here).
#include "d/d_particle.h"
#include "d/d_jnt_col.h"
#include <cstdio>
#include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h"
#include "JSystem/JMath/JMATrigonometric.h"
#include "JSystem/JParticle/JPAEmitterManager.h"
#include "JSystem/JParticle/JPAResourceManager.h"
#include "JSystem/JMath/JMATrigonometric.h"
#include "d/d_s_play.h"
#include <cstdio>
#include "d/d_com_inf_game.h"
#include "m_Do/m_Do_lib.h"
#include "m_Do/m_Do_graphic.h"
#include "f_op/f_op_actor_mng.h"
#include "d/actor/d_a_player.h"
#include "SSystem/SComponent/c_math.h"
#include "d/actor/d_a_player.h"
#include "d/d_com_inf_game.h"
#include "d/d_jnt_col.h"
#include "d/d_s_play.h"
#include "f_op/f_op_actor_mng.h"
#include "m_Do/m_Do_graphic.h"
#include "m_Do/m_Do_lib.h"
#include "tracy/Tracy.hpp"
#ifndef __MWERKS__
#include "dusk/math.h"
@@ -1325,6 +1326,7 @@ void dPa_control_c::cleanup() {
}
void dPa_control_c::calc3D() {
ZoneScoped;
if (isStatus(2)) {
offStatus(2);
} else {
@@ -1336,12 +1338,14 @@ void dPa_control_c::calc3D() {
}
void dPa_control_c::calc2D() {
ZoneScoped;
for (u8 i = 14; i <= 16; i++) {
mEmitterMng->calc(i);
}
}
void dPa_control_c::calcMenu() {
ZoneScoped;
if (mEmitterMng != NULL) {
for (u8 i = 17; i <= 18; i++) {
mEmitterMng->calc(i);
+6 -5
View File
@@ -1176,19 +1176,20 @@ void dScnLogo_c::logoInitWii() {
break;
}
width = 608;
height = 456;
// this uses the standard width but the widescreen height?
width = FB_WIDTH_BASE;
height = FB_HEIGHT;
}
JUT_ASSERT(2309, timg != NULL);
mStrapImg = JKR_NEW dDlst_2D_c(timg, 304 - (width / 2), 224 - (height / 2), width, height, 255);
mStrapImg = JKR_NEW dDlst_2D_c(timg, (FB_WIDTH_BASE / 2) - (width / 2), (FB_HEIGHT_BASE / 2) - (height / 2), width, height, 255);
#if VERSION == VERSION_SHIELD
timg = (ResTIMG*)dComIfG_getObjectRes("LogoUsWii", 5);
mNvLogo = JKR_NEW dDlst_2D_c(timg, 304 - (width / 2), 224 - (height / 2), width, height, 255);
mNvLogo = JKR_NEW dDlst_2D_c(timg, (FB_WIDTH_BASE / 2) - (width / 2), (FB_HEIGHT_BASE / 2) - (height / 2), width, height, 255);
timg = (ResTIMG*)dComIfG_getObjectRes("LogoUsWii", 4);
mMocImg = JKR_NEW dDlst_2D_c(timg, 304 - (width / 2), 224 - (height / 2), width, height, 255);
mMocImg = JKR_NEW dDlst_2D_c(timg, (FB_WIDTH_BASE / 2) - (width / 2), (FB_HEIGHT_BASE / 2) - (height / 2), width, height, 255);
#endif
OS_REPORT("\x1b[32m%d archiveHeap->getTotalFreeSize %08x\n\x1b[m", 2316, archiveHeap->getTotalFreeSize());
-12
View File
@@ -785,19 +785,7 @@ static int dScnPly_Execute(dScnPly_c* i_this) {
dJprev_c::get()->update();
#endif
#if TARGET_PC
if (dusk::config::IsConfigFileMissing()) {
firstTime = true;
} else if (firstTime) {
mDoAud_seStart(Z2SE_TITLE_ENTER, NULL, 0, 0);
JUTGamePad::C3ButtonReset::sResetSwitchPushing = true;
firstTime = false;
} else {
dDemo_c::update();
}
#else
dDemo_c::update();
#endif
#if DEBUG
dJcame_c::get()->update();
+11 -11
View File
@@ -136,24 +136,24 @@ void dScope_c::draw() {
u8 alpha = mAlpha * 255.0f;
if (dComIfGp_checkPlayerStatus0(0, 0x1000)) {
J2DDrawLine(304.0f, mDoGph_gInf_c::getMinYF(), 304.0f, mDoGph_gInf_c::getMaxYF(),
JUtility::TColor(255, 0, 0, alpha), 6);
J2DDrawLine(mDoGph_gInf_c::getMinXF(), 224.0f, mDoGph_gInf_c::getMaxXF(), 224.0f,
JUtility::TColor(255, 0, 0, alpha), 6);
J2DDrawLine(FB_WIDTH_BASE / 2, mDoGph_gInf_c::getMinYF(), FB_WIDTH_BASE / 2,
mDoGph_gInf_c::getMaxYF(), JUtility::TColor(255, 0, 0, alpha), 6);
J2DDrawLine(mDoGph_gInf_c::getMinXF(), FB_HEIGHT_BASE / 2, mDoGph_gInf_c::getMaxXF(),
FB_HEIGHT_BASE / 2, JUtility::TColor(255, 0, 0, alpha), 6);
}
mpWipeTex->setAlpha(alpha);
mpBlackTex->setAlpha(alpha);
f32 temp_f29 = 304.0f - temp_f31;
f32 temp_f28 = 304.0f + temp_f31;
f32 temp_f27 = 224.0f - temp_f30;
f32 temp_f26 = 224.0f + temp_f30;
f32 temp_f29 = FB_WIDTH_BASE / 2 - temp_f31;
f32 temp_f28 = FB_WIDTH_BASE / 2 + temp_f31;
f32 temp_f27 = FB_HEIGHT_BASE / 2 - temp_f30;
f32 temp_f26 = FB_HEIGHT_BASE / 2 + temp_f30;
mpWipeTex->draw(temp_f29, temp_f27, temp_f31, temp_f30, false, false, false);
mpWipeTex->draw(304.0f, temp_f27, temp_f31, temp_f30, true, false, false);
mpWipeTex->draw(temp_f29, 224.0f, temp_f31, temp_f30, false, true, false);
mpWipeTex->draw(304.0f, 224.0f, temp_f31, temp_f30, true, true, false);
mpWipeTex->draw(FB_WIDTH_BASE / 2, temp_f27, temp_f31, temp_f30, true, false, false);
mpWipeTex->draw(temp_f29, FB_HEIGHT_BASE / 2, temp_f31, temp_f30, false, true, false);
mpWipeTex->draw(FB_WIDTH_BASE / 2, FB_HEIGHT_BASE / 2, temp_f31, temp_f30, true, true, false);
mpBlackTex->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(),
mDoGph_gInf_c::getWidthF(), temp_f27 - mDoGph_gInf_c::getMinYF(), false, false,
+48 -19
View File
@@ -5,6 +5,7 @@
#include "d/d_com_inf_game.h"
#include "JSystem/J2DGraph/J2DAnimation.h"
#include "JSystem/J2DGraph/J2DAnmLoader.h"
#include "dusk/frame_interpolation.h"
#include <cstring>
dSelect_cursorHIO_c::dSelect_cursorHIO_c() {
@@ -270,15 +271,22 @@ void dSelect_cursor_c::update() {
if (mUpdateFlag) {
if (field_0x30) {
if (chkPlayAnime(0)) {
if (mNameIdx == 1) {
field_0x44 += mpCursorHIO->field_0x8 * fVar1;
} else {
field_0x44 += fVar1;
}
#ifdef TARGET_PC
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
for (u32 tick = 0; tick < ui_advance_ticks; ++tick) {
#endif
if (mNameIdx == 1) {
field_0x44 += mpCursorHIO->field_0x8 * fVar1;
} else {
field_0x44 += fVar1;
}
if (field_0x44 >= field_0x30->getFrameMax()) {
field_0x44 -= field_0x30->getFrameMax();
if (field_0x44 >= field_0x30->getFrameMax()) {
field_0x44 -= field_0x30->getFrameMax();
}
#ifdef TARGET_PC
}
#endif
field_0x30->setFrame(field_0x44);
setBpkAnimation(field_0x30);
@@ -294,14 +302,21 @@ void dSelect_cursor_c::update() {
for (int i = 0; i < 2; i++) {
if (field_0x34[i]) {
if ((i == 0 && chkPlayAnime(2)) || (i == 1 && chkPlayAnime(3))) {
if (mNameIdx == 1) {
field_0x48[i] += mpCursorHIO->field_0x8 * fVar1;
} else {
field_0x48[i] += fVar1;
}
if (field_0x48[i] >= field_0x34[i]->getFrameMax()) {
field_0x48[i] -= field_0x34[i]->getFrameMax();
#ifdef TARGET_PC
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
for (u32 tick = 0; tick < ui_advance_ticks; ++tick) {
#endif
if (mNameIdx == 1) {
field_0x48[i] += mpCursorHIO->field_0x8 * fVar1;
} else {
field_0x48[i] += fVar1;
}
if (field_0x48[i] >= field_0x34[i]->getFrameMax()) {
field_0x48[i] -= field_0x34[i]->getFrameMax();
}
#ifdef TARGET_PC
}
#endif
field_0x34[i]->setFrame(field_0x48[i]);
}
@@ -310,7 +325,11 @@ void dSelect_cursor_c::update() {
}
if (field_0x2C && chkPlayAnime(1)) {
if (mNameIdx == 1) {
#ifdef TARGET_PC
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
for (u32 tick = 0; tick < ui_advance_ticks; ++tick) {
#endif
if (mNameIdx == 1) {
field_0x40 += mpCursorHIO->field_0x8 * fVar1;
} else {
field_0x40 += fVar1;
@@ -318,14 +337,24 @@ void dSelect_cursor_c::update() {
if (field_0x40 >= field_0x2C->getFrameMax()) {
field_0x40 -= field_0x2C->getFrameMax();
}
field_0x2C->setFrame(field_0x40);
setBckAnimation(field_0x2C);
#ifdef TARGET_PC
}
#endif
field_0x2C->setFrame(field_0x40);
setBckAnimation(field_0x2C);
}
if (chkPlayAnime(1) && mNameIdx == 0) {
setCursorAnimation();
#ifdef TARGET_PC
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
for (u32 tick = 0; tick < ui_advance_ticks; ++tick) {
#endif
setCursorAnimation();
#ifdef TARGET_PC
}
#endif
}
mpScreen->animation();
+18 -8
View File
@@ -2,21 +2,31 @@
#include "d/d_select_icon.h"
#include "JSystem/J2DGraph/J2DAnimation.h"
#include "dusk/frame_interpolation.h"
dSi_HIO_c::dSi_HIO_c() {}
void dSelect_icon_c::animation() {
if (field_0x10->getAlpha() != 0) {
field_0x20 += field_0x2c;
if (field_0x20 >= field_0x1c->getFrameMax()) {
field_0x20 = 0.0f;
}
field_0x1c->setFrame(field_0x20);
#ifdef TARGET_PC
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
for (u32 i = 0; i < ui_advance_ticks; ++i) {
#endif
field_0x20 += field_0x2c;
if (field_0x20 >= field_0x1c->getFrameMax()) {
field_0x20 = 0.0f;
}
field_0x1c->setFrame(field_0x20);
field_0x28 += field_0x2c;
if (field_0x28 >= field_0x24->getFrameMax()) {
field_0x28 = 0.0f;
field_0x28 += field_0x2c;
if (field_0x28 >= field_0x24->getFrameMax()) {
field_0x28 = 0.0f;
}
#ifdef TARGET_PC
}
// Set even if not advancing
field_0x1c->setFrame(field_0x20);
#endif
field_0x24->setFrame(field_0x28);
field_0x8->animation();