mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-11 13:08:33 -04:00
26 02 27 pjb dev 2 (#41)
* fix kankyo UB
* Fix TEV Stage DL writing
BE issue
* BE Fixes in materials/shapes
* Move to Aurora GD impl
* JUTDataFileHeader
* j3d: load vertex and texture not through GD
* Endian swap vertex data (mostly)
* Just exit(0) when closing the game
Fix crashes :godo:
* fix fopAcM_ct_placement and remove memcpy
* J3D: track vertex arrays correctly, swap work
* fix visibility, turn off overridden new/delete when we call into aurora
* event: cut name be
* Default window improvements
Double size, allow OS to decide position
* survive TParse::parseHeader_next
* color swap fix
* swap endian/fixes oob function pointer
* Remove GXGetViewportv stub
Aurora has it now
* Set array pointers via GD again
Relies on https://github.com/encounter/aurora/pull/35
* Let Aurora decide graphics backend
* disable procbar drawing
* Fix TColor endianness conversion issues
Fixes the wrong color for the flashing logo
* cam param swap
* simplify vtx loading, mat/amb color fix
* endian swap stb/fvb data
* aurora stat changes
* fix storage buffer crash
dont unnecessarily reassign vertex buffers in a way that forces aurora to recache things
* set bgobj spec fix
* add camera debug, endian swap more stb data, d_a_bg_obj::spec_data_c swapped
* JKRExpHeap: fix bad allocator slowdown
* solid tex
* texture caching
* log level
* fix window aspect ratio, disable bloom, endian swap camera type data
camera is now actually playing opening cutscene!!!!
* add GXDestroyTexObj to a couple stack init'd GXTexObjs, remove some diag printfs
* endian swap joint weight envelope data
* move to dusk config
* verbose arg errors
* better stub logging (for now)
* less logging, more BE
* more stubbing, move logging stuff around
* move all logging to aurora logging
* fix STUB_LOG, __FUNCTION__ isn't a string literal, wasn't building as it
was.
* update aurora
* fix heap alignment mismatch and always head align for now
* prevent them from fucking up my shit
* forward jut warning to DuskLog
* remove report logging
* maybe and i must emphasize maybe fix JMessage parsing
* this was a dumb idea
* preserve negative alignment for JKRHeap
* use normal free on macos and linux
* ^
* fix JMAHermiteInterpolation c impl
* endian swap J2DScreen mColor (oops)
* swap more J3D anim data, remove weird pointer addr check in J3DMaterial getMaterialAnm
* typo fix
* Fix aligned_alloc() size issues on POSIX
aligned_alloc() requires its input size to be a multiple of alignment. This wasn't being upheld so there were allocation failures in init code that made the game fail to start outside Windows.
Also just cleaned up some of this code a bit and removed fallback cases that *shouldn't* get hit.
* _Exit instead of exit()
Seriously I don't want destructors to run. Let the OS reclaim that shit.
* Reapply "Isolate JKRHeap operator overloads" (#39)
This reverts commit 3623b27f37.
* Fix some oopsies
* Fix hardcoded pointer size in JUTCacheFont::allocArray
* More operator overload fixes
Add void template specialization for jkrDelete
Add new[] placement overload. Apparently.
* Fix delete macros on nullptr
TIL C++ allows that.
* fix delete[]
* fix new(std::nothrow) overload
* fix avoid ub
* swap remaining anim data needed for title logo
* get rid of op 7
* move aurora_end_frame to correct spot
* juttexture destroy tex
* j2d animation be
* shutdown crash
* link warp material fix
* mDoExt_3DlineMat1_c fix
* hacky keyboard controls
* endian swap J2DResReference, add kb_pad to files.cmake
* fix some missing endian swaps in J2D, remove addr alignment check
* Remove heap unsetting in aurora calls
Never worked properly and not the right solution even if it did
* Don't print in DC stubs
They're fine to never implement
* Fix alignment stuff again
* Compile GF from dolphin lib
Doesn't seem to break anything and shuts up some stub warnings
* j3dtexture tlut obj fix
* addTexMtxIndexInDL fix
* don't recreate null tex data every frame
* the actual fix i wanted to push
* its kinda fakematch city over here
* insert hte efb copy
* limited window size / viewport support
* IsDelete FIX
---------
Co-authored-by: madeline <qwertytrogi@gmail.com>
Co-authored-by: Jasper St. Pierre <jstpierre@mecheye.net>
Co-authored-by: Jeffrey Crowell <jeff@crowell.biz>
Co-authored-by: TakaRikka <takarikka@outlook.com>
Co-authored-by: CraftyBoss <talibabdulmaalik@gmail.com>
Co-authored-by: Lurs <2795933+Lurs@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
820e2e3df6
commit
b289dece80
+35
-32
@@ -24,6 +24,7 @@
|
||||
#include "m_Do/m_Do_mtx.h"
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include "dusk/logging.h"
|
||||
|
||||
u8 mDoExt::CurrentHeapAdjustVerbose;
|
||||
u8 mDoExt::HeapAdjustVerbose;
|
||||
@@ -211,7 +212,7 @@ int mDoExt_bckAnm::init(J3DAnmTransform* i_bck, int i_play, int i_attr, f32 i_ra
|
||||
JUT_ASSERT(614, (i_modify || isCurrentSolidHeap()) && i_bck != NULL);
|
||||
mAnmTransform = i_bck;
|
||||
if (!i_modify) {
|
||||
mAnm = new J3DMtxCalcAnimation<J3DMtxCalcAnimationAdaptorDefault<J3DMtxCalcCalcTransformMaya>, J3DMtxCalcJ3DSysInitMaya>(mAnmTransform);
|
||||
mAnm = JKR_NEW J3DMtxCalcAnimation<J3DMtxCalcAnimationAdaptorDefault<J3DMtxCalcCalcTransformMaya>, J3DMtxCalcJ3DSysInitMaya>(mAnmTransform);
|
||||
if (!mAnm) {
|
||||
return 0;
|
||||
}
|
||||
@@ -423,8 +424,8 @@ static void dummy2() {
|
||||
J3DTevSwapModeTable tevSwapModeTable;
|
||||
J3DIndTexOrder indTexOrder;
|
||||
|
||||
J3DIndTexMtx* indTexMtx = new J3DIndTexMtx();
|
||||
J3DIndTexCoordScale* indTexCoordScale = new J3DIndTexCoordScale();
|
||||
J3DIndTexMtx* indTexMtx = JKR_NEW J3DIndTexMtx();
|
||||
J3DIndTexCoordScale* indTexCoordScale = JKR_NEW J3DIndTexCoordScale();
|
||||
J3DColorBlock* colorBlock = NULL;
|
||||
colorBlock->setColorChanNum((u8)NULL);
|
||||
colorBlock->setMatColor(0, gxColor);
|
||||
@@ -504,7 +505,7 @@ static void dummy2() {
|
||||
int mDoExt_invisibleModel::create(J3DModel* i_model, u8 param_1) {
|
||||
J3DModelData* model_data = i_model->getModelData();
|
||||
|
||||
mpPackets = new mDoExt_invJntPacket[model_data->getJointNum()];
|
||||
mpPackets = JKR_NEW mDoExt_invJntPacket[model_data->getJointNum()];
|
||||
if (mpPackets == NULL) {
|
||||
return 0;
|
||||
}
|
||||
@@ -1319,18 +1320,18 @@ int mDoExt_McaMorf::create(J3DModelData* modelData, mDoExt_McaMorfCallBack1_c* c
|
||||
}
|
||||
}
|
||||
if (param_8) {
|
||||
mpSound = new mDoExt_zelAnime();
|
||||
mpSound = JKR_NEW mDoExt_zelAnime();
|
||||
if (!mpSound) {
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
setAnm(anmTransform, param_4, 0.0f, param_5, param_6, param_7, param_9);
|
||||
mPrevMorf = -1.0f;
|
||||
mpTransformInfo = new J3DTransformInfo[modelData->getJointNum()];
|
||||
mpTransformInfo = JKR_NEW J3DTransformInfo[modelData->getJointNum()];
|
||||
if (!mpTransformInfo) {
|
||||
goto cleanup;
|
||||
}
|
||||
mpQuat = new Quaternion[modelData->getJointNum()];
|
||||
mpQuat = JKR_NEW Quaternion[modelData->getJointNum()];
|
||||
if (mpQuat) {
|
||||
J3DTransformInfo* info = mpTransformInfo;
|
||||
Quaternion* quat = mpQuat;
|
||||
@@ -1577,9 +1578,9 @@ int mDoExt_McaMorfSO::create(J3DModelData* i_modelData, mDoExt_McaMorfCallBack1_
|
||||
setAnm(param_3, param_4, 0.0f, param_5, param_6, param_7);
|
||||
mPrevMorf = -1.0f;
|
||||
|
||||
mpTransformInfo = new J3DTransformInfo[i_modelData->getJointNum()];
|
||||
mpTransformInfo = JKR_NEW J3DTransformInfo[i_modelData->getJointNum()];
|
||||
if (mpTransformInfo != NULL) {
|
||||
mpQuat = new Quaternion[i_modelData->getJointNum()];
|
||||
mpQuat = JKR_NEW Quaternion[i_modelData->getJointNum()];
|
||||
|
||||
if (mpQuat != NULL) {
|
||||
J3DTransformInfo* transInfo_p = mpTransformInfo;
|
||||
@@ -1737,7 +1738,7 @@ void mDoExt_McaMorfSO::setAnm(J3DAnmTransform* i_anm, int i_attr, f32 i_morf, f3
|
||||
setMorf(i_morf);
|
||||
|
||||
#if TARGET_PC
|
||||
puts("We don't know why, but initAnime doesn't work");
|
||||
STUB_LOG();
|
||||
return;
|
||||
#endif
|
||||
if (mpSound != NULL) {
|
||||
@@ -1865,13 +1866,13 @@ mDoExt_McaMorf2::~mDoExt_McaMorf2() {
|
||||
setAnm(param_3, param_4, 0.0f, param_5, 0.0f, param_6, param_7, param_8);
|
||||
mPrevMorf = -1.0f;
|
||||
|
||||
mpTransformInfo = new J3DTransformInfo[param_0->getJointNum()];
|
||||
mpTransformInfo = JKR_NEW J3DTransformInfo[param_0->getJointNum()];
|
||||
if (mpTransformInfo == NULL) {
|
||||
ERROR_EXIT();
|
||||
return 0;
|
||||
}
|
||||
|
||||
mpQuat = new Quaternion[param_0->getJointNum()];
|
||||
mpQuat = JKR_NEW Quaternion[param_0->getJointNum()];
|
||||
if (mpQuat == NULL) {
|
||||
ERROR_EXIT();
|
||||
return 0;
|
||||
@@ -2260,13 +2261,13 @@ void mDoExt_invJntPacket::draw() {
|
||||
}
|
||||
|
||||
int mDoExt_3Dline_c::init(u16 param_0, int param_1, BOOL param_2) {
|
||||
field_0x0 = new cXyz[param_0];
|
||||
field_0x0 = JKR_NEW cXyz[param_0];
|
||||
if (field_0x0 == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (param_1 != 0) {
|
||||
field_0x4 = new f32[param_0];
|
||||
field_0x4 = JKR_NEW f32[param_0];
|
||||
if (field_0x4 == NULL) {
|
||||
return 0;
|
||||
}
|
||||
@@ -2276,33 +2277,33 @@ int mDoExt_3Dline_c::init(u16 param_0, int param_1, BOOL param_2) {
|
||||
|
||||
int sp20 = param_0 * 2;
|
||||
|
||||
field_0x8[0] = new cXyz[sp20];
|
||||
field_0x8[0] = JKR_NEW cXyz[sp20];
|
||||
if (field_0x8 == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
field_0x8[1] = new cXyz[sp20];
|
||||
field_0x8[1] = JKR_NEW cXyz[sp20];
|
||||
if (field_0x8[1] == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
field_0x10[0] = new mDoExt_3Dline_field_0x10_c[sp20];
|
||||
field_0x10[0] = JKR_NEW mDoExt_3Dline_field_0x10_c[sp20];
|
||||
if (field_0x10 == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
field_0x10[1] = new mDoExt_3Dline_field_0x10_c[sp20];
|
||||
field_0x10[1] = JKR_NEW mDoExt_3Dline_field_0x10_c[sp20];
|
||||
if (field_0x10[1] == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (param_2) {
|
||||
field_0x18[0] = new cXy[sp20];
|
||||
field_0x18[0] = JKR_NEW cXy[sp20];
|
||||
if (field_0x18[0] == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
field_0x18[1] = new cXy[sp20];
|
||||
field_0x18[1] = JKR_NEW cXy[sp20];
|
||||
if (field_0x18[1] == NULL) {
|
||||
return 0;
|
||||
}
|
||||
@@ -2328,7 +2329,7 @@ int mDoExt_3DlineMat0_c::init(u16 param_0, u16 param_1, int param_2) {
|
||||
field_0x10 = param_0;
|
||||
field_0x12 = param_1;
|
||||
|
||||
field_0x18 = new mDoExt_3Dline_c[param_0];
|
||||
field_0x18 = JKR_NEW mDoExt_3Dline_c[param_0];
|
||||
if (field_0x18 == NULL) {
|
||||
return 0;
|
||||
}
|
||||
@@ -2634,7 +2635,7 @@ void mDoExt_3DlineMat0_c::update(int param_0, GXColor& param_2, dKy_tevstr_c* pa
|
||||
int mDoExt_3DlineMat1_c::init(u16 param_0, u16 param_1, ResTIMG* param_2, int param_3) {
|
||||
mNumLines = param_0;
|
||||
field_0x32 = param_1;
|
||||
mpLines = new mDoExt_3Dline_c[param_0];
|
||||
mpLines = JKR_NEW mDoExt_3Dline_c[param_0];
|
||||
if (mpLines == NULL) {
|
||||
return 0;
|
||||
}
|
||||
@@ -2698,9 +2699,11 @@ void mDoExt_3DlineMat1_c::draw() {
|
||||
mDoExt_3Dline_c* lines = mpLines;
|
||||
u16 vert_num = field_0x34 << 1;
|
||||
for (s32 i = 0; i < mNumLines; i++) {
|
||||
GXSETARRAY(GX_VA_POS, ((mDoExt_3Dline_c*)((intptr_t)lines + (mIsDrawn << 2)))->field_0x8, vert_num * sizeof(cXyz), sizeof(cXyz));
|
||||
GXSETARRAY(GX_VA_NRM, ((mDoExt_3Dline_c*)((intptr_t) lines + (mIsDrawn << 2)))->field_0x10, vert_num * sizeof(mDoExt_3Dline_field_0x10_c), sizeof(mDoExt_3Dline_field_0x10_c));
|
||||
GXSETARRAY(GX_VA_TEX0, ((mDoExt_3Dline_c*)((intptr_t)lines + (mIsDrawn << 2)))->field_0x18, vert_num * sizeof(cXy), sizeof(cXy));
|
||||
GXSETARRAY(GX_VA_POS, lines->field_0x8[mIsDrawn], vert_num * sizeof(cXyz), sizeof(cXyz));
|
||||
GXSETARRAY(GX_VA_NRM, lines->field_0x10[mIsDrawn],
|
||||
vert_num * sizeof(mDoExt_3Dline_field_0x10_c),
|
||||
sizeof(mDoExt_3Dline_field_0x10_c));
|
||||
GXSETARRAY(GX_VA_TEX0, lines->field_0x18[mIsDrawn], vert_num * sizeof(cXy), sizeof(cXy));
|
||||
GXBegin(GX_TRIANGLESTRIP, GX_VTXFMT0, vert_num);
|
||||
|
||||
u16 j = 0;
|
||||
@@ -3575,7 +3578,7 @@ static void mDoExt_initFontCommon(JUTFont** mDoExt_font_p, ResFONT** mDoExt_resf
|
||||
JUT_ASSERT_MSG(7144, *mDoExt_resfont != NULL, "mDoExt_resfont != 0");
|
||||
if (param_5 == 0) {
|
||||
u32 cacheSize = JUTCacheFont::calcCacheSize(param_7, param_6);
|
||||
JUTCacheFont* cacheFont = new (param_2, 0) JUTCacheFont(*mDoExt_resfont, cacheSize, param_2);
|
||||
JUTCacheFont* cacheFont = JKR_NEW_ARGS (param_2, 0) JUTCacheFont(*mDoExt_resfont, cacheSize, param_2);
|
||||
if (cacheFont->isValid()) {
|
||||
// "Allocated %d bytes for font cache buffer size"
|
||||
OS_REPORT("\nキャッシュフォントバッファサイズとして %d バイト確保しました\n", cacheSize);
|
||||
@@ -3591,7 +3594,7 @@ static void mDoExt_initFontCommon(JUTFont** mDoExt_font_p, ResFONT** mDoExt_resf
|
||||
JKRRemoveResource(*mDoExt_resfont, NULL);
|
||||
*mDoExt_resfont = NULL;
|
||||
} else {
|
||||
*mDoExt_font = new JUTResFont(*mDoExt_resfont, param_2);
|
||||
*mDoExt_font = JKR_NEW JUTResFont(*mDoExt_resfont, param_2);
|
||||
// "Allocated %d bytes for the font buffer size"
|
||||
OS_REPORT("\nフォントバッファサイズとして %d バイト確保しました\n",
|
||||
JKRGetMemBlockSize(param_2, *mDoExt_font));
|
||||
@@ -3601,7 +3604,7 @@ static void mDoExt_initFontCommon(JUTFont** mDoExt_font_p, ResFONT** mDoExt_resf
|
||||
if (*mDoExt_font != NULL && !(*mDoExt_font)->isValid()) {
|
||||
// "Failed to create cache font class"
|
||||
OSReport_FatalError("\nキャッシュフォントクラス作成に失敗しました\n");
|
||||
delete *mDoExt_font;
|
||||
JKR_DELETE(*mDoExt_font);
|
||||
*mDoExt_font = NULL;
|
||||
}
|
||||
JUT_ASSERT_MSG(7183, *mDoExt_font != NULL, "mDoExt_font != 0");
|
||||
@@ -3639,7 +3642,7 @@ void mDoExt_removeMesgFont() {
|
||||
mDoExt_font0_getCount--;
|
||||
JUT_ASSERT(7241, mDoExt_font0_getCount > 0);
|
||||
if (mDoExt_font0_getCount == 0) {
|
||||
delete mDoExt_font0;
|
||||
JKR_DELETE(mDoExt_font0);
|
||||
mDoExt_font0 = NULL;
|
||||
if (mDoExt_resfont0 != NULL) {
|
||||
#if REGION_JPN
|
||||
@@ -3705,7 +3708,7 @@ void mDoExt_removeSubFont() {
|
||||
mDoExt_font2_getCount--;
|
||||
JUT_ASSERT(7357, mDoExt_font2_getCount > 0);
|
||||
if (mDoExt_font2_getCount == 0) {
|
||||
delete mDoExt_font2;
|
||||
JKR_DELETE(mDoExt_font2);
|
||||
mDoExt_font2 = NULL;
|
||||
if (mDoExt_resfont2 != NULL) {
|
||||
JKRFree(mDoExt_resfont2);
|
||||
@@ -3717,7 +3720,7 @@ void mDoExt_removeSubFont() {
|
||||
|
||||
J3DModel* mDoExt_J3DModel__create(J3DModelData* i_modelData, u32 i_modelFlag, u32 i_differedDlistFlag) {
|
||||
if (i_modelData != NULL) {
|
||||
J3DModel* model = new J3DModel();
|
||||
J3DModel* model = JKR_NEW J3DModel();
|
||||
|
||||
if (model != NULL) {
|
||||
#if DEBUG
|
||||
@@ -3812,7 +3815,7 @@ void DummyCheckHeap::setHeap(JKRHeap* heap) {
|
||||
|
||||
int DummyCheckHeap_init() {
|
||||
JUT_ASSERT(7634, dch == NULL);
|
||||
dch = new((JKRHeap*)mDoExt_getZeldaHeap(), 0) DummyCheckHeap();
|
||||
dch = JKR_NEW_ARGS((JKRHeap*)mDoExt_getZeldaHeap(), 0) DummyCheckHeap();
|
||||
if (dch == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user