Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer

This commit is contained in:
gymnast86
2026-04-09 16:31:51 -07:00
30 changed files with 213 additions and 56 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ set(GAME_INCLUDE_DIRS
extern)
set(GAME_LIBS aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd
aurora::card freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json)
aurora::card freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient)
if (DUSK_MOVIE_SUPPORT_REAL)
if (TARGET libjpeg-turbo::turbojpeg-static)
+49
View File
@@ -17,6 +17,8 @@
#include "m_Do/m_Do_graphic.h"
#include <cstring>
#include "tracy/Tracy.hpp"
enum dComIfG_ButtonStatus {
/* 0x00 */ BUTTON_STATUS_NONE,
/* 0x01 */ BUTTON_STATUS_LET_GO,
@@ -3109,114 +3111,133 @@ inline void dComIfGp_particle_calcMenu() {
}
inline void dComIfGp_particle_draw(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawNormal(i_drawInfo);
}
}
inline void dComIfGp_particle_drawFog(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawNormalFog(i_drawInfo);
}
}
inline void dComIfGp_particle_drawP1(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawNormalP1(i_drawInfo);
}
}
inline void dComIfGp_particle_drawProjection(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawProjection(i_drawInfo);
}
}
inline void dComIfGp_particle_drawNormalPri0_A(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawNormalPri0_A(i_drawInfo);
}
}
inline void dComIfGp_particle_drawNormalPri0_B(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawNormalPri0_B(i_drawInfo);
}
}
inline void dComIfGp_particle_drawFogPri0_A(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawFogPri0_A(i_drawInfo);
}
}
inline void dComIfGp_particle_drawFogPri0_B(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawFogPri0_B(i_drawInfo);
}
}
inline void dComIfGp_particle_drawFogPri1(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawFogPri1(i_drawInfo);
}
}
inline void dComIfGp_particle_drawFogPri2(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawFogPri2(i_drawInfo);
}
}
inline void dComIfGp_particle_drawFogPri3(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawFogPri3(i_drawInfo);
}
}
inline void dComIfGp_particle_drawFogPri4(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawFogPri4(i_drawInfo);
}
}
inline void dComIfGp_particle_drawDarkworld(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawDarkworld(i_drawInfo);
}
}
inline void dComIfGp_particle_drawScreen(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->drawFogScreen(i_drawInfo);
}
}
inline void dComIfGp_particle_draw2Dgame(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->draw2Dgame(i_drawInfo);
}
}
inline void dComIfGp_particle_draw2Dfore(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->draw2Dfore(i_drawInfo);
}
}
inline void dComIfGp_particle_draw2Dback(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->draw2Dback(i_drawInfo);
}
}
inline void dComIfGp_particle_draw2DmenuFore(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->draw2DmenuFore(i_drawInfo);
}
}
inline void dComIfGp_particle_draw2DmenuBack(JPADrawInfo* i_drawInfo) {
ZoneScoped;
if (g_dComIfG_gameInfo.play.getParticle() != NULL) {
g_dComIfG_gameInfo.play.getParticle()->draw2DmenuBack(i_drawInfo);
}
@@ -4736,114 +4757,142 @@ inline void dComIfGd_setViewport(view_port_class* port) {
}
inline void dComIfGd_entryZSortListZxlu(J3DPacket* i_packet, cXyz& param_1) {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.entryZSortListZxlu(i_packet, param_1);
}
inline void dComIfGd_entryZSortXluList(J3DPacket* i_packet, cXyz& param_1) {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.entryZSortXluList(i_packet, param_1);
}
inline void dComIfGd_drawCopy2D() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawCopy2D();
}
inline void dComIfGd_drawOpaListSky() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawOpaListSky();
}
inline void dComIfGd_drawXluListSky() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawXluListSky();
}
inline void dComIfGd_drawOpaListBG() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawOpaListBG();
}
inline void dComIfGd_drawOpaListDarkBG() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawOpaListDarkBG();
}
inline void dComIfGd_drawOpaListMiddle() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawOpaListMiddle();
}
inline void dComIfGd_drawOpaList() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawOpaList();
}
inline void dComIfGd_drawOpaListDark() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawOpaListDark();
}
inline void dComIfGd_drawOpaListPacket() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawOpaListPacket();
}
inline void dComIfGd_drawXluListBG() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawXluListBG();
}
inline void dComIfGd_drawXluListDarkBG() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawXluListDarkBG();
}
inline void dComIfGd_drawXluList() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawXluList();
}
inline void dComIfGd_drawXluListDark() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawXluListDark();
}
inline void dComIfGd_drawXluListInvisible() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawXluListInvisible();
}
inline void dComIfGd_drawOpaListInvisible() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawOpaListInvisible();
}
inline void dComIfGd_drawXluListZxlu() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawXluListZxlu();
}
inline void dComIfGd_drawXluList2DScreen() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawXluList2DScreen();
}
inline void dComIfGd_drawOpaList3Dlast() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawOpaList3Dlast();
}
inline void dComIfGd_draw2DOpa() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.draw2DOpa();
}
inline void dComIfGd_draw2DOpaTop() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.draw2DOpaTop();
}
inline void dComIfGd_draw2DXlu() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.draw2DXlu();
}
inline void dComIfGd_drawOpaListFilter() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawOpaListFilter();
}
inline void dComIfGd_drawIndScreen() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawOpaListP0();
}
inline void dComIfGd_drawListZxlu() {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawXluListZxlu();
}
inline void dComIfGd_drawShadow(Mtx param_0) {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.drawShadow(param_0);
}
inline void dComIfGd_imageDrawShadow(Mtx param_0) {
ZoneScoped;
g_dComIfG_gameInfo.drawlist.imageDrawShadow(param_0);
}
@@ -8,6 +8,7 @@
#include "JSystem/J3DGraphBase/J3DDrawBuffer.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "tracy/Tracy.hpp"
void J3DDrawBuffer::calcZRatio() {
mZRatio = (mZFar - mZNear) / (f32)mEntryTableSize;
@@ -224,6 +225,7 @@ void J3DDrawBuffer::draw() const {
}
void J3DDrawBuffer::drawHead() const {
ZoneScoped;
u32 size = mEntryTableSize;
J3DPacket** buf = mpBuffer;
@@ -235,6 +237,7 @@ void J3DDrawBuffer::drawHead() const {
}
void J3DDrawBuffer::drawTail() const {
ZoneScoped;
for (int i = mEntryTableSize - 1; i >= 0; i--) {
for (J3DPacket* packet = mpBuffer[i]; packet != NULL; packet = packet->getNextPacket()) {
packet->draw();
+8 -5
View File
@@ -1,14 +1,15 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/J3DGraphBase/J3DPacket.h"
#include <cstring>
#include <os.h>
#include "JSystem/J3DGraphAnimator/J3DModel.h"
#include "JSystem/J3DGraphBase/J3DDrawBuffer.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "JSystem/J3DGraphBase/J3DPacket.h"
#include "JSystem/J3DGraphBase/J3DShapeMtx.h"
#include "JSystem/JKernel/JKRHeap.h"
#include <os.h>
#include <cstring>
#include "global.h"
#include "tracy/Tracy.hpp"
J3DError J3DDisplayListObj::newDisplayList(u32 maxSize) {
mMaxSize = ALIGN_NEXT(maxSize, 0x20);
@@ -207,12 +208,13 @@ bool J3DMatPacket::isSame(J3DMatPacket* pOther) const {
}
void J3DMatPacket::draw() {
ZoneScoped;
#if TARGET_PC
j3dSys.setTexture(mpTexture);
#endif
mpMaterial->load();
#if TARGET_PC
#if DEBUG && TARGET_PC
if (mpMaterial->mMaterialName != nullptr) {
char buf[64];
snprintf(buf, sizeof(buf), "Mat: %s", mpMaterial->mMaterialName);
@@ -239,7 +241,7 @@ void J3DMatPacket::draw() {
J3DShape::resetVcdVatCache();
#if TARGET_PC
#if DEBUG && TARGET_PC
if (mpMaterial->mMaterialName != nullptr) {
GXPopDebugGroup();
}
@@ -388,6 +390,7 @@ void J3DShapePacket::draw() {
}
void J3DShapePacket::drawFast() {
ZoneScoped;
if (!checkFlag(J3DShpFlag_Hidden) && mpShape != NULL) {
prepareDraw();
+4 -3
View File
@@ -3,13 +3,13 @@
#include "JSystem/J3DGraphBase/J3DShape.h"
#include <dolphin/gd.h>
#include <gd.h>
#include <gx.h>
#include "JSystem/J3DGraphBase/J3DFifo.h"
#include "JSystem/J3DGraphBase/J3DPacket.h"
#include "JSystem/J3DGraphBase/J3DVertex.h"
#include "JSystem/J3DGraphBase/J3DFifo.h"
#include <gx.h>
#include <gd.h>
#include "JSystem/JKernel/JKRHeap.h"
#include "tracy/Tracy.hpp"
void J3DGDSetVtxAttrFmtv(GXVtxFmt, GXVtxAttrFmtList const*, bool);
void J3DFifoLoadPosMtxImm(Mtx, u32);
@@ -318,6 +318,7 @@ void J3DShape::setArrayAndBindPipeline() const {
}
void J3DShape::drawFast() const {
ZoneScoped;
if (sOldVcdVatCmd != mVcdVatCmd) {
GXCallDisplayList(mVcdVatCmd, kVcdVatDLSize);
sOldVcdVatCmd = mVcdVatCmd;
+4
View File
@@ -6,6 +6,7 @@
#include "JSystem/J3DGraphBase/J3DTexture.h"
#include "dusk/gx_helper.h"
#include "global.h"
#include "tracy/Tracy.hpp"
J3DSys j3dSys;
@@ -121,6 +122,8 @@ void J3DSys::setTexCacheRegion(GXTexCacheSize size) {
}
void J3DSys::drawInit() {
ZoneScoped;
GXInvalidateVtxCache();
GXSetCurrentMtx(GX_PNMTX0);
GXSetCullMode(GX_CULL_BACK);
@@ -226,6 +229,7 @@ void J3DSys::drawInit() {
}
void J3DSys::reinitGX() {
ZoneScoped;
reinitGenMode();
reinitLighting();
reinitTransform();
+3
View File
@@ -18,6 +18,8 @@
#include <os.h>
#include <stdint.h>
#include "tracy/Tracy.hpp"
s16* JASDriver::sDmaDacBuffer[3];
static u8 data_804507A8 = 3;
@@ -143,6 +145,7 @@ void JASDriver::updateDac() {
}
void JASDriver::updateDSP() {
ZoneScoped;
JASProbe::start(3, "SFR-UPDATE");
JASDsp::invalChannelAll();
@@ -19,6 +19,7 @@
#include "dusk/logging.h"
#include "dusk/settings.h"
#include "global.h"
#include "tracy/Tracy.hpp"
void JFWDisplay::ctor_subroutine(bool enableAlpha) {
mEnableAlpha = enableAlpha;
@@ -350,6 +351,7 @@ void JFWDisplay::waitBlanking(int param_0) {
}
static void waitForTick(u32 p1, u16 p2) {
ZoneScopedC(tracy::Color::DimGray);
#if TARGET_PC
if (dusk::getTransientSettings().skipFrameRateLimit) {
p1 = OS_TIMER_CLOCK / 120;
@@ -9,6 +9,8 @@
#include <mtx.h>
#include <gx.h>
#include "tracy/Tracy.hpp"
void JPASetPointSize(JPAEmitterWorkData* work) {
GXSetPointSize((u8)(25.0f * work->mGlobalPtclScl.x), GX_TO_ONE);
}
@@ -684,6 +686,8 @@ void JPADrawDirection(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
return;
}
ZoneScoped;
JGeometry::TVec3<f32> local_6c;
JGeometry::TVec3<f32> local_78;
p_direction[param_0->mDirType](param_0, param_1, &local_6c);
@@ -729,6 +733,8 @@ void JPADrawRotDirection(JPAEmitterWorkData* param_0, JPABaseParticle* param_1)
return;
}
ZoneScoped;
f32 sinRot = JMASSin(param_1->mRotateAngle);
f32 cosRot = JMASCos(param_1->mRotateAngle);
JGeometry::TVec3<f32> local_6c;
@@ -779,6 +785,8 @@ void JPADrawDBillboard(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
return;
}
ZoneScoped;
JGeometry::TVec3<f32> local_70;
p_direction[param_0->mDirType](param_0, param_1, &local_70);
JGeometry::TVec3<f32> aTStack_7c(param_0->mPosCamMtx[2][0], param_0->mPosCamMtx[2][1], param_0->mPosCamMtx[2][2]);
@@ -814,6 +822,8 @@ void JPADrawRotation(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
return;
}
ZoneScoped;
f32 sinRot = JMASSin(param_1->mRotateAngle);
f32 cosRot = JMASCos(param_1->mRotateAngle);
f32 particleX = param_0->mGlobalPtclScl.x * param_1->mParticleScaleX;
@@ -835,6 +845,8 @@ void JPADrawPoint(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
return;
}
ZoneScoped;
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
GXBegin(GX_POINTS, GX_VTXFMT1, 1);
@@ -850,6 +862,8 @@ void JPADrawLine(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
return;
}
ZoneScoped;
JGeometry::TVec3<f32> local_1c(param_1->mPosition);
JGeometry::TVec3<f32> local_28;
param_1->getVelVec(&local_28);
@@ -883,6 +897,8 @@ JPANode<JPABaseParticle>* getPrev(JPANode<JPABaseParticle>* param_0) {
typedef JPANode<JPABaseParticle>* (*getNodeFunc)(JPANode<JPABaseParticle>*);
void JPADrawStripe(JPAEmitterWorkData* param_0) {
ZoneScoped;
JPABaseShape* shape = param_0->mpRes->getBsp();
u32 ptcl_num = param_0->mpAlivePtcl->getNum();
if (ptcl_num < 2) {
@@ -969,6 +985,8 @@ void JPADrawStripe(JPAEmitterWorkData* param_0) {
}
void JPADrawStripeX(JPAEmitterWorkData* param_0) {
ZoneScoped;
JPABaseShape* shape = param_0->mpRes->getBsp();
u32 ptcl_num = param_0->mpAlivePtcl->getNum();
if (ptcl_num < 2) {
@@ -8,6 +8,8 @@
#include "JSystem/JUtility/JUTAssert.h"
#include <gx.h>
#include "tracy/Tracy.hpp"
JPAEmitterManager::JPAEmitterManager(u32 i_ptclNum, u32 i_emtrNum, JKRHeap* pHeap, u8 i_gidMax,
u8 i_ridMax) {
emtrNum = i_emtrNum;
@@ -85,6 +87,7 @@ void JPAEmitterManager::calc(u8 group_id) {
}
void JPAEmitterManager::draw(JPADrawInfo const* drawInfo, u8 group_id) {
ZoneScoped;
JUT_ASSERT(192, group_id < gidMax);
drawInfo->getCamMtx(pWd->mPosCamMtx);
drawInfo->getPrjMtx(pWd->mPrjMtx);
@@ -16,6 +16,7 @@
#include "JSystem/JParticle/JPAParticle.h"
#include "JSystem/JParticle/JPAResourceManager.h"
#include "global.h"
#include "tracy/Tracy.hpp"
JPAResource::JPAResource() {
mpCalcEmitterFuncList = mpDrawEmitterFuncList = mpDrawEmitterChildFuncList = NULL;
@@ -782,6 +783,7 @@ bool JPAResource::calc(JPAEmitterWorkData* work, JPABaseEmitter* emtr) {
}
void JPAResource::draw(JPAEmitterWorkData* work, JPABaseEmitter* emtr) {
ZoneScoped;
work->mpEmtr = emtr;
work->mpRes = this;
work->mDrawCount = 0;
@@ -798,6 +800,7 @@ void JPAResource::draw(JPAEmitterWorkData* work, JPABaseEmitter* emtr) {
}
void JPAResource::drawP(JPAEmitterWorkData* work) {
ZoneScoped;
work->mpEmtr->clearStatus(0x80);
work->mGlobalPtclScl.x = work->mpEmtr->mGlobalPScl.x * pBsp->getBaseSizeX();
@@ -860,6 +863,7 @@ void JPAResource::drawP(JPAEmitterWorkData* work) {
}
void JPAResource::drawC(JPAEmitterWorkData* work) {
ZoneScoped;
work->mpEmtr->setStatus(0x80);
if (pCsp->isScaleInherited()) {
+8
View File
@@ -2417,10 +2417,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);
+1
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);
+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)
{
-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
+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);
+5
View File
@@ -17,6 +17,7 @@
#include <memory>
#include "JSystem/JKernel/JKRHeap.h"
#include "common/TracySystem.hpp"
#include "dusk/main.h"
#include "dusk/os.h"
@@ -667,6 +668,9 @@ void OSSetCurrentThreadName(const char* name) {
// "Why is this current thread only?", you might ask?
// Because macOS requires that. For some reason.
#if TRACY_ENABLE
tracy::SetThreadName(name);
#else
#if _WIN32
wchar_t buffer[256];
const auto converted = MultiByteToWideChar(
@@ -687,6 +691,7 @@ void OSSetCurrentThreadName(const char* name) {
#elif __APPLE__
pthread_setname_np(name);
#endif
#endif
}
#ifdef __cplusplus
+9
View File
@@ -14,6 +14,7 @@
#include "DuskDsp.hpp"
#include "JSystem/JAudio2/JASAudioThread.h"
#include "JSystem/JAudio2/JASDriverIF.h"
#include "tracy/Tracy.hpp"
using namespace dusk::audio;
@@ -82,18 +83,25 @@ void dusk::audio::SetEnableReverb(const bool value) {
EnableReverb = value;
}
#ifdef TRACY_ENABLE
static auto FrameName = "GetNewAudio";
#endif
void SDLCALL GetNewAudio(
void*,
SDL_AudioStream*,
int needed,
int) {
FrameMarkStart(FrameName);
while (needed > 0) {
const int rendered = RenderNewAudioFrame();
needed -= rendered;
}
FrameMarkEnd(FrameName);
}
int RenderNewAudioFrame() {
ZoneScoped;
JASCriticalSection section;
const u32 countSubframes = JASDriver::getSubFrames();
@@ -120,6 +128,7 @@ static void InterleaveOutputData(const OutputSubframe& data, std::span<f32> targ
}
void RenderAudioSubframe() {
ZoneScoped;
OutBuffer = {};
JASDriver::updateDSP();
+2
View File
@@ -14,6 +14,7 @@
#include "dusk/audio/DuskAudioSystem.h"
#include "dusk/endian.h"
#include "global.h"
#include "tracy/Tracy.hpp"
using namespace dusk::audio;
@@ -141,6 +142,7 @@ static void MixSubframe(DspSubframe& dst, const DspSubframe& src) {
}
void dusk::audio::DspRender(OutputSubframe& subframe) {
ZoneScoped;
if (DumpAudio != sDumpWasActive) {
sDumpWasActive = DumpAudio;
if (DumpAudio) {
+3 -1
View File
@@ -2,7 +2,9 @@
#include <mutex>
static std::recursive_mutex gAudioThreadMutex;
#include "tracy/Tracy.hpp"
static TracyLockable(std::recursive_mutex, gAudioThreadMutex);
JASCriticalSection::JASCriticalSection() {
gAudioThreadMutex.lock();
+2
View File
@@ -17,6 +17,7 @@
#include "dusk/settings.h"
#include "dusk/audio/DuskAudioSystem.h"
#include "dusk/dusk.h"
#include "tracy/Tracy.hpp"
#if _WIN32
#define NOMINMAX
@@ -200,6 +201,7 @@ namespace dusk {
}
void ImGuiConsole::PreDraw() {
ZoneScoped;
if (!m_isLaunchInitialized) {
InitSettings();
+3
View File
@@ -2,6 +2,8 @@
#include <cstdio>
#include <cstdlib>
#include "tracy/Tracy.hpp"
bool StubLogEnabled = true;
using namespace std::literals::string_view_literals;
@@ -32,6 +34,7 @@ static bool IsForStubLog(const char* message) {
void aurora_log_callback(AuroraLogLevel level, const char* module, const char* message,
unsigned int len) {
ZoneScoped;
if (StubLogEnabled && level != LOG_FATAL && IsForStubLog(message)) {
dusk::SendToStubLog(level, module, message);
return;
+3
View File
@@ -13,6 +13,8 @@
#include <dusk/logging.h>
#include <dusk/main.h>
#include "tracy/Tracy.hpp"
#ifndef _WIN32
#include <sys/time.h>
#include <time.h>
@@ -355,6 +357,7 @@ void VISetNextFrameBuffer(void* fb) {
}
void VIWaitForRetrace() {
ZoneScoped;
sRetraceCount++;
if (sVIPreRetraceCallback) {
sVIPreRetraceCallback(sRetraceCount);
+18 -16
View File
@@ -1,26 +1,27 @@
#include "f_ap/f_ap_game.h"
#include <cstring>
#include "DynamicLink.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "JSystem/J3DGraphLoader/J3DModelSaver.h"
#include "JSystem/JHostIO/JORFile.h"
#include "JSystem/JKernel/JKRAram.h"
#include "JSystem/JKernel/JKRAramArchive.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "JSystem/JUtility/JUTDbPrint.h"
#include "SSystem/SComponent/c_counter.h"
#include "d/actor/d_a_alink.h"
#include "d/actor/d_a_grass.h"
#include "d/actor/d_a_midna.h"
#include "d/d_model.h"
#include "d/d_tresure.h"
#include "dusk/logging.h"
#include "f_op/f_op_camera_mng.h"
#include "f_op/f_op_draw_tag.h"
#include "f_op/f_op_overlap_mng.h"
#include "f_op/f_op_scene_mng.h"
#include "m_Do/m_Do_main.h"
#include "m_Do/m_Do_graphic.h"
#include "DynamicLink.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "JSystem/JKernel/JKRAram.h"
#include "JSystem/JKernel/JKRAramArchive.h"
#include "JSystem/JUtility/JUTDbPrint.h"
#include "JSystem/JHostIO/JORFile.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "JSystem/J3DGraphLoader/J3DModelSaver.h"
#include "d/actor/d_a_alink.h"
#include "d/actor/d_a_midna.h"
#include "d/d_model.h"
#include "d/actor/d_a_grass.h"
#include "d/d_tresure.h"
#include <cstring>
#include "dusk/logging.h"
#include "m_Do/m_Do_main.h"
#include "tracy/Tracy.hpp"
fapGm_HIO_c::fapGm_HIO_c() {
mUsingHostIO = true;
@@ -722,6 +723,7 @@ void fapGm_After() {
}
void fapGm_Execute() {
ZoneScoped;
static u32 sExecCount = 0;
if (sExecCount < 10 || (sExecCount % 300 == 0)) {
DuskLog.debug("fapGm_Execute frame={}", sExecCount);
+3
View File
@@ -22,6 +22,8 @@
#include "m_Do/m_Do_controller_pad.h"
#include <cstdio>
#include "tracy/Tracy.hpp"
void fpcM_Draw(void* i_proc) {
fpcDw_Execute((base_process_class*)i_proc);
}
@@ -43,6 +45,7 @@ BOOL fpcM_IsCreating(fpc_ProcID i_id) {
}
void fpcM_Management(fpcM_ManagementFunc i_preExecuteFn, fpcM_ManagementFunc i_postExecuteFn) {
ZoneScoped;
MtxInit();
if (!fapGm_HIO_c::isCaptureScreen()) {
dComIfGd_peekZdata();
+2
View File
@@ -12,6 +12,7 @@
#include "d/d_debug_viewer.h"
#include "m_Do/m_Do_Reset.h"
#include "m_Do/m_Do_dvd_thread.h"
#include "tracy/Tracy.hpp"
#if PLATFORM_WII || PLATFORM_SHIELD
#include "Z2AudioCS/Z2AudioCS.h"
@@ -157,6 +158,7 @@ static void mDoAud_Create() {
void mDoAud_Execute() {
DUSK_AUDIO_SKIP()
ZoneScoped;
if (!mDoAud_zelAudio_c::isInitFlag()) {
if (!mDoRst::isShutdown() && !mDoRst::isReturnToMenu()) {
+2
View File
@@ -10,6 +10,7 @@
#include "f_ap/f_ap_game.h"
#include "m_Do/m_Do_Reset.h"
#include "m_Do/m_Do_main.h"
#include "tracy/Tracy.hpp"
JUTGamePad* mDoCPd_c::m_gamePad[4];
@@ -56,6 +57,7 @@ void mDoCPd_c::create() {
}
void mDoCPd_c::read() {
ZoneScoped;
JUTGamePad::read();
if (!mDoRst::isReset() && mDoRst::is3ButtonReset()) {
+20 -10
View File
@@ -7,6 +7,9 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include <base/PPCArch.h>
#include <cstring>
#include "DynamicLink.h"
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
#include "JSystem/J2DGraph/J2DPrint.h"
#include "JSystem/JAWExtSystem/JAWExtSystem.h"
@@ -19,24 +22,22 @@
#include "SSystem/SComponent/c_math.h"
#include "d/actor/d_a_player.h"
#include "d/d_com_inf_game.h"
#include "d/d_menu_collect.h"
#include "d/d_debug_viewer.h"
#include "d/d_jcam_editor.h"
#include "d/d_jpreviewer.h"
#include <base/PPCArch.h>
#include "d/d_menu_collect.h"
#include "d/d_meter2_info.h"
#include "d/d_s_play.h"
#include "dusk/endian.h"
#include "dusk/gx_helper.h"
#include "dusk/logging.h"
#include "f_ap/f_ap_game.h"
#include "f_op/f_op_camera_mng.h"
#include "m_Do/m_Do_controller_pad.h"
#include "m_Do/m_Do_graphic.h"
#include "m_Do/m_Do_machine.h"
#include "m_Do/m_Do_main.h"
#include "d/d_debug_viewer.h"
#include "d/d_meter2_info.h"
#include "d/d_s_play.h"
#include "DynamicLink.h"
#include <cstring>
#include "dusk/endian.h"
#include "dusk/logging.h"
#include "dusk/gx_helper.h"
#include "tracy/Tracy.hpp"
#if PLATFORM_WII || PLATFORM_SHIELD
#include <revolution/sc.h>
@@ -348,6 +349,8 @@ void mDoGph_gInf_c::create() {
static bool data_80450BE8;
void mDoGph_gInf_c::beginRender() {
ZoneScoped;
#if PLATFORM_WII || PLATFORM_SHIELD
VISetTrapFilter(fapGmHIO_getTrapFilter() ? 1 : 0);
VISetGamma((VIGamma)fapGmHIO_getGamma());
@@ -416,6 +419,7 @@ void mDoGph_gInf_c::fadeOut(f32 fadeSpeed) {
}
void darwFilter(GXColor matColor) {
ZoneScoped;
GXSetNumChans(1);
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_REG, GX_LIGHT_NULL, GX_DF_NONE,
GX_AF_NONE);
@@ -834,6 +838,7 @@ void mDoGph_drawFilterQuad(s8 param_0, s8 param_1) {
#endif
static void drawDepth2(view_class* param_0, view_port_class* param_1, int param_2) {
ZoneScoped;
static GXColorS10 l_tevColor0 = {0, 0, 0, 0};
if (daPy_getLinkPlayerActorClass() != NULL) {
@@ -1087,6 +1092,7 @@ static void drawDepth2(view_class* param_0, view_port_class* param_1, int param_
}
static void trimming(view_class* param_0, view_port_class* param_1) {
ZoneScoped;
UNUSED(param_0);
s16 y_orig = (int)param_1->y_orig & ~7;
@@ -1199,6 +1205,7 @@ void mDoGph_gInf_c::bloom_c::remove() {
void mDoGph_gInf_c::bloom_c::draw() {
#if TARGET_PC
ZoneScoped;
if (!dusk::getSettings().game.enableBloom) {
return;
}
@@ -1473,6 +1480,7 @@ static void retry_captue_frame(view_class* param_0, view_port_class* param_1, in
}
static void motionBlure(view_class* param_0) {
ZoneScoped;
if (g_env_light.is_blure) {
GXLoadTexObj(mDoGph_gInf_c::getFrameBufferTexObj(), GX_TEXMAP0);
GXColor local_60;
@@ -1652,6 +1660,7 @@ static void captureScreenPerspDrawInfo(JPADrawInfo& info) {
#endif
static void drawItem3D() {
ZoneScoped;
Mtx item_mtx;
dMenu_Collect3D_c::setupItem3D(item_mtx);
@@ -1668,6 +1677,7 @@ static void drawItem3D() {
}
int mDoGph_Painter() {
ZoneScoped;
// Diagnostic: log windowNum to track game state machine progress
static bool sDiagLoggedWindow = false;
if (!sDiagLoggedWindow) {
+5
View File
@@ -153,8 +153,13 @@ void mDoLib_project(Vec* src, Vec* dst, JGeometry::TBox2<f32> viewport) {
xOffset = (0.5f * ((2.0f * viewport.i.x) + viewport.f.x)) - (int)(FB_WIDTH / 2);
xSize = FB_WIDTH;
} else {
#if TARGET_PC
xOffset = mDoGph_gInf_c::getMinXF();
xSize = viewport.f.x * mDoGph_gInf_c::hudAspectScaleUp;
#else
xOffset = viewport.i.x;
xSize = viewport.f.x;
#endif
}
if (viewport.i.y != 0.0f) {
+3
View File
@@ -60,6 +60,7 @@
#include "SDL3/SDL_filesystem.h"
#include "cxxopts.hpp"
#include "dusk/config.hpp"
#include "tracy/Tracy.hpp"
#if RANDOMIZER_ONLY
#include "dusk/randomizer/randomizer.hpp"
@@ -203,6 +204,8 @@ void main01(void) {
mDoAud_Execute();
aurora_end_frame();
FrameMark;
} while (true);
exit:;