Pjb dev 3 (#48)

* Undo array allocation changes from #43

Doesn't work

* Expand dmeter heap sizes, give names

* Fix manual operator delete call in resource.cpp

* Disable map rendering for now

Aurora can't handle lines

* Re-enable assert heap on DVD thread

Should be fine?

* Some basic debug groups with the new Aurora API

* Allow Aurora backend to be set via CLI

* Give materials debug groups

* More debug groups

* JKRHeap separation: array edition

Pain
This commit is contained in:
Pieter-Jan Briers
2026-03-11 21:40:21 +01:00
committed by GitHub
parent 9e303b063f
commit 15732e241c
93 changed files with 440 additions and 313 deletions
+5 -5
View File
@@ -4247,12 +4247,12 @@ int daAlink_c::createHeap() {
}
int sp38 = 40;
J3DTransformInfo* sp1C = JKR_NEW J3DTransformInfo[sp38];
J3DTransformInfo* sp1C = JKR_NEW_ARRAY(J3DTransformInfo, sp38);
if (sp1C == NULL) {
return 0;
}
Quaternion* sp30 = JKR_NEW Quaternion[sp38];
Quaternion* sp30 = JKR_NEW_ARRAY(Quaternion, sp38);
if (sp30 == NULL) {
return 0;
}
@@ -4284,7 +4284,7 @@ int daAlink_c::createHeap() {
return 0;
}
field_0x2d78 = JKR_NEW_ARGS (0x20) u8[0x800];
field_0x2d78 = JKR_NEW_ARRAY_ARGS(u8, 0x800, 0x20);
if (field_0x2d78 == NULL) {
return 0;
}
@@ -14220,7 +14220,7 @@ BOOL daAlink_c::checkMagicArmorWearAbility() const {
J3DModelData* daAlink_c::loadAramBmd(u16 i_resIdx, u32 i_bufSize) {
JKRArchive* anmArchive = dComIfGp_getAnmArchive();
u8* tmpBuffer = JKR_NEW_ARGS (0x20) u8[i_bufSize];
u8* tmpBuffer = JKR_NEW_ARRAY_ARGS(u8, i_bufSize, 0x20);
JKRReadIdxResource(tmpBuffer, i_bufSize, i_resIdx, anmArchive);
#if DEBUG
@@ -14241,7 +14241,7 @@ J3DModelData* daAlink_c::loadAramBmd(u16 i_resIdx, u32 i_bufSize) {
}
void* daAlink_c::loadAram(u16 i_resIdx, u32 i_bufSize) {
u8* tmpBuffer = JKR_NEW_ARGS (0x20) u8[i_bufSize];
u8* tmpBuffer = JKR_NEW_ARRAY_ARGS(u8, i_bufSize, 0x20);
JKRReadIdxResource(tmpBuffer, i_bufSize, i_resIdx, dComIfGp_getAnmArchive());
#if DEBUG
daPy_aramBufferCheck(tmpBuffer, i_bufSize);
+3 -3
View File
@@ -5166,8 +5166,8 @@ void daAlinkHIO_c::listenPropertyEvent(const JORPropertyEvent* event) {
}
case PROPERTY_SAVE_FILE_e: {
if (file.open(6, "すべてのファイル(*.*)\0*.*\0", NULL, NULL, NULL)) {
char* fileData = JKR_NEW_ARGS (0x20) char[0x10000];
char* structData = JKR_NEW_ARGS (0x20) char[0x10000];
char* fileData = JKR_NEW_ARRAY_ARGS(char, 0x10000, 0x20);
char* structData = JKR_NEW_ARRAY_ARGS(char, 0x10000, 0x20);
if (fileData != NULL && structData != NULL) {
size_t dataSize = makeFileOutData(fileData, structData);
@@ -5204,7 +5204,7 @@ void daAlinkHIO_c::listenPropertyEvent(const JORPropertyEvent* event) {
}
case PROPERTY_LOAD_FILE_e: {
if (file.open(1, "すべてのファイル(*.*)\0*.*\0", NULL, NULL, NULL)) {
char* fileData = JKR_NEW_ARGS (0x20) char[0x10000];
char* fileData = JKR_NEW_ARRAY_ARGS(char, 0x10000, 0x20);
if (fileData != NULL) {
file.readData(fileData, 0);
+3 -3
View File
@@ -94,9 +94,9 @@ void daAlink_c::setIronBallModel() {
mpItemModelData = loadAramBmd(dRes_ID_ALANM_BMD_AL_HS_KUSARI_e, 0x1000);
mpHookChain = JKR_NEW hsChainShape_c();
mIronBallChainPos = JKR_NEW cXyz[102];
mIronBallChainAngle = JKR_NEW csXyz[102];
field_0x3848 = JKR_NEW cXyz[102];
mIronBallChainPos = JKR_NEW_ARRAY(cXyz, 102);
mIronBallChainAngle = JKR_NEW_ARRAY(csXyz, 102);
field_0x3848 = JKR_NEW_ARRAY(cXyz, 102);
field_0x0774 = JKR_NEW dBgS_AcchCir();
field_0x0778 = JKR_NEW dBgS_ObjAcch();
+3 -3
View File
@@ -239,7 +239,7 @@ void daAlink_c::changeModelDataDirectWolf(int param_0) {
void daAlink_c::initStatusWindow() {
onNoResetFlg2(FLG2_STATUS_WINDOW_DRAW);
void* tmpBuffer = JKR_NEW_ARGS (0x20) void*[0x500];
void* tmpBuffer = JKR_NEW_ARRAY_ARGS(void*, 0x500, 0x20);
JUT_ASSERT(394, tmpBuffer);
u16 bckResIdx, btpResIdx, btkResIdx;
@@ -268,7 +268,7 @@ void daAlink_c::initStatusWindow() {
JUT_ASSERT(433, FALSE);
}
tmpBuffer = JKR_NEW_ARGS (0x20) void*[0x100];
tmpBuffer = JKR_NEW_ARRAY_ARGS(void*, 0x100, 0x20);
JUT_ASSERT(437, tmpBuffer);
JKRReadIdxResource(tmpBuffer, 0x400, btpResIdx, dComIfGp_getAnmArchive());
@@ -278,7 +278,7 @@ void daAlink_c::initStatusWindow() {
btp->searchUpdateMaterialID(field_0x06c0);
field_0x06c0->entryTexNoAnimator(btp);
tmpBuffer = JKR_NEW_ARGS (0x20) void*[0x100];
tmpBuffer = JKR_NEW_ARRAY_ARGS(void*, 0x100, 0x20);
JUT_ASSERT(449, tmpBuffer);
JKRReadIdxResource(tmpBuffer, 0x400, btkResIdx, dComIfGp_getAnmArchive());
+1 -1
View File
@@ -180,7 +180,7 @@ int daCstatue_c::createHeap() {
}
if (checkBossType()) {
mSph = JKR_NEW dCcD_Sph[9]();
mSph = JKR_NEW_ARRAY(dCcD_Sph, 9);
if (!mSph) {
return cPhs_INIT_e;
}
+1 -1
View File
@@ -3360,7 +3360,7 @@ int daE_YM_c::CreateHeap() {
}
if (mType == 6) {
field_0x6d0 = JKR_NEW cXyz[45];
field_0x6d0 = JKR_NEW_ARRAY(cXyz, 45);
}
return 1;
+3 -3
View File
@@ -213,7 +213,7 @@ void daFmtMng_c::executeReverse() {
int i;
FmtPos_c* currentPos;
currentPos = mPos;
tempPos = JKR_NEW FmtPos_c[mFormationRow];
tempPos = JKR_NEW_ARRAY(FmtPos_c, mFormationRow);
for (i = 0; i < mFormationRow; i++, currentPos++, tempPos++) {
tempPos->field_0x10.set(currentPos->field_0x10);
tempPos->field_0x1c = currentPos->field_0x1c;
@@ -354,10 +354,10 @@ void daFmtMng_c::create_init() {
mFormationLine = getFormationLine();
mFormationRow = getFormationRow();
mPos = NULL;
mPos = JKR_NEW FmtPos_c[mFormationRow];
mPos = JKR_NEW_ARRAY(FmtPos_c, mFormationRow);
JUT_ASSERT(357, mPos != NULL);
mMember = NULL;
mMember = JKR_NEW FmtMember_c[mFormationLine * mFormationRow];
mMember = JKR_NEW_ARRAY(FmtMember_c, mFormationLine * mFormationRow);
JUT_ASSERT(361, mMember != NULL);
FmtMember_c* member = mMember;
+4 -4
View File
@@ -496,12 +496,12 @@ int daHorse_c::createHeap() {
return 0;
}
J3DTransformInfo* transInfoBuf = JKR_NEW J3DTransformInfo[38];
J3DTransformInfo* transInfoBuf = JKR_NEW_ARRAY(J3DTransformInfo, 38);
if (transInfoBuf == NULL) {
return 0;
}
Quaternion* quatBuf = JKR_NEW Quaternion[38];
Quaternion* quatBuf = JKR_NEW_ARRAY(Quaternion, 38);
if (quatBuf == NULL) {
return 0;
}
@@ -538,12 +538,12 @@ int daHorse_c::createHeap() {
daHorseRein_c* rein_p = m_rein;
for (int i = 0; i < 3; i++, rein_p++) {
rein_p->field_0x0[0] = JKR_NEW cXyz[rein_p->field_0x8[1]];
rein_p->field_0x0[0] = JKR_NEW_ARRAY(cXyz, rein_p->field_0x8[1]);
if (rein_p->field_0x0[0] == NULL) {
return 0;
}
rein_p->field_0x0[1] = JKR_NEW cXyz[rein_p->field_0x8[1]];
rein_p->field_0x0[1] = JKR_NEW_ARRAY(cXyz, rein_p->field_0x8[1]);
if (rein_p->field_0x0[1] == NULL) {
return 0;
}
+2 -2
View File
@@ -88,12 +88,12 @@ BOOL daHoZelda_c::createHeap() {
}
}
J3DTransformInfo* transinfo_buf = JKR_NEW J3DTransformInfo[47];
J3DTransformInfo* transinfo_buf = JKR_NEW_ARRAY(J3DTransformInfo, 47);
if (transinfo_buf == NULL) {
return FALSE;
}
Quaternion* quat_buf = JKR_NEW Quaternion[47];
Quaternion* quat_buf = JKR_NEW_ARRAY(Quaternion, 47);
if (quat_buf == NULL) {
return FALSE;
}
+1 -1
View File
@@ -162,7 +162,7 @@ int daObjCBlk_c::CreateHeap() {
if (model1 == NULL) {
return 0;
}
chains = JKR_NEW chain_s[6];
chains = JKR_NEW_ARRAY(chain_s, 6);
if (chains == NULL) {
return 0;
}
+1 -1
View File
@@ -168,7 +168,7 @@ int daObjCwall_c::CreateHeap() {
if (mWallModel == NULL) {
return 0;
}
mChains = JKR_NEW chain_s[6];
mChains = JKR_NEW_ARRAY(chain_s, 6);
if (mChains == NULL) {
return 0;
}
+1 -1
View File
@@ -234,7 +234,7 @@ int daObjE_CREATE_c::create() {
mActivateSw = fopAcM_GetParam(this) >> 8;
mDeactivateSw = fopAcM_GetParam(this) >> 0x10;
mActorList = JKR_NEW u32[mEnemyNum];
mActorList = JKR_NEW_ARRAY(u32, mEnemyNum);
if (mActorList == NULL) {
return cPhs_ERROR_e;
+2 -2
View File
@@ -251,14 +251,14 @@ int daObjKLift00_c::CreateHeap() {
mpChainBase = NULL;
}
mChainPositions = JKR_NEW ChainPos[mNumChains];
mChainPositions = JKR_NEW_ARRAY(ChainPos, mNumChains);
if(!mChainPositions)
return 0;
mChainModelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(l_arcName, l_bmdidx[1]));
JUT_ASSERT(334, mChainModelData != NULL);
mChainMdlObjs = JKR_NEW dMdl_obj_c[mNumChainModels];
mChainMdlObjs = JKR_NEW_ARRAY(dMdl_obj_c, mNumChainModels);
return mChainMdlObjs ? TRUE : FALSE;
}
+6 -6
View File
@@ -213,17 +213,17 @@ int daObjLv4Chan_c::CreateHeap() {
return 0;
}
mChains[0] = JKR_NEW ChainPos[mChainLengths[0]];
mChains[0] = JKR_NEW_ARRAY(ChainPos, mChainLengths[0]);
if (mChains[0] == NULL) {
return 0;
}
mChains[1] = JKR_NEW ChainPos[mChainLengths[1]];
mChains[1] = JKR_NEW_ARRAY(ChainPos, mChainLengths[1]);
if (mChains[1] == NULL) {
return 0;
}
mChains[2] = JKR_NEW ChainPos[mChainLengths[2]];
mChains[2] = JKR_NEW_ARRAY(ChainPos, mChainLengths[2]);
if (mChains[2] == NULL) {
return 0;
}
@@ -231,17 +231,17 @@ int daObjLv4Chan_c::CreateHeap() {
mChainModelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, l_bmdidx[1]);
JUT_ASSERT(500, mChainModelData != NULL);
mMdls[0] = JKR_NEW dMdl_obj_c[mMdlLengths[0]];
mMdls[0] = JKR_NEW_ARRAY(dMdl_obj_c, mMdlLengths[0]);
if (mMdls[0] == NULL) {
return 0;
}
mMdls[1] = JKR_NEW dMdl_obj_c[mMdlLengths[1]];
mMdls[1] = JKR_NEW_ARRAY(dMdl_obj_c, mMdlLengths[1]);
if (mMdls[1] == NULL) {
return 0;
}
mMdls[2] = JKR_NEW dMdl_obj_c[mMdlLengths[2]];
mMdls[2] = JKR_NEW_ARRAY(dMdl_obj_c, mMdlLengths[2]);
if (mMdls[2] == NULL) {
return 0;
}
+1 -1
View File
@@ -360,7 +360,7 @@ int daObjRBridge_c::CreateHeap() {
if (!fopAcM_isSwitch(this, getSwbit2()) && !fopAcM_isSwitch(this, getSwbit())) {
mRopeSegmentNum = 10;
field_0xb04 = JKR_NEW cXyz[mRopeSegmentNum];
field_0xb04 = JKR_NEW_ARRAY(cXyz, mRopeSegmentNum);
if (field_0xb04 == NULL) {
return 0;
}
+2 -2
View File
@@ -267,13 +267,13 @@ void daObjItaRope_c::setNormalRopePos() {
inline int daObjItaRope_c::createHeap() {
mRopes = NULL;
mRopes = JKR_NEW RopeWork_c[field_0x635 - 2];
mRopes = JKR_NEW_ARRAY(RopeWork_c, field_0x635 - 2);
if (mRopes == NULL) {
return 0;
}
mSakuitas = NULL;
mSakuitas = JKR_NEW Sakuita_c[field_0x635 - 2];
mSakuitas = JKR_NEW_ARRAY(Sakuita_c, field_0x635 - 2);
if (mSakuitas == NULL) {
return 0;
}
+1 -1
View File
@@ -197,7 +197,7 @@ int daObjSwChain_c::Create() {
}
int daObjSwChain_c::CreateHeap() {
mChains = JKR_NEW chain_s[mChainNum + 1];
mChains = JKR_NEW_ARRAY(chain_s, mChainNum + 1);
if (mChains == NULL) {
return 0;
+2 -2
View File
@@ -525,7 +525,7 @@ void daPasserMng_c::create_init() {
dPnt* pnt1 = dPath_GetPnt(mPath, 1);
current.pos.set(pnt0->m_position);
current.angle.y = cLib_targetAngleY(pnt0->m_position, pnt1->m_position);
childProcIds = JKR_NEW fpc_ProcID[getMaxNum()];
childProcIds = JKR_NEW_ARRAY(fpc_ProcID, getMaxNum());
currentChildIndex = 0;
int time = getTime();
intervalTime = getIntervalTime() * 5;
@@ -556,7 +556,7 @@ void daPasserMng_c::create_init() {
max = mPath->m_num - 2;
}
int i;
int* arr = JKR_NEW int[max];
int* arr = JKR_NEW_ARRAY(int, max);
int ind = 0;
while (ind < max) {
int rnd = cLib_getRndValue(1, mPath->m_num - 2);
+2 -2
View File
@@ -233,7 +233,7 @@ void daPy_anmHeap_c::initData() {
}
void* daPy_anmHeap_c::mallocBuffer() {
mBuffer = JKR_NEW_ARGS (0x20) u8[mBufferSize];
mBuffer = JKR_NEW_ARRAY_ARGS(u8, mBufferSize, 0x20);
return mBuffer;
}
@@ -262,7 +262,7 @@ void daPy_anmHeap_c::createHeap(daPy_anmHeap_c::daAlinkHEAP_TYPE i_heapType) {
mAnimeHeap = mDoExt_createSolidHeapFromGameToCurrent(&tmp, size, 0x20);
if (i_heapType == 4) {
tmpWork = JKR_NEW char[size];
tmpWork = JKR_NEW_ARRAY(char, size);
JUT_ASSERT(669, tmpWork != NULL);
} else if (i_heapType == 3) {
tmpTransBas = JKR_NEW mDoExt_transAnmBas(NULL);
+5 -5
View File
@@ -114,7 +114,7 @@ void dBgp_c::model_c::create(J3DModelData* i_modelData, Mtx i_mtx) {
JUT_ASSERT(205, i_modelData->getJointNum() == 1);
JUT_ASSERT(206, i_modelData->getMaterialNum() != 0);
mMaterial = JKR_NEW modelMaterial_c[i_modelData->getMaterialNum()];
mMaterial = JKR_NEW_ARRAY(modelMaterial_c, i_modelData->getMaterialNum());
JUT_ASSERT(212, mMaterial != NULL);
J3DJoint* joint = i_modelData->getJointNodePointer(0);
@@ -288,7 +288,7 @@ int dBgp_c::share_c::execute() {
JUT_ASSERT(544, mModelData->getMaterialNum() != 0);
mMaterial = JKR_NEW modelMaterial_c[mModelData->getMaterialNum()];
mMaterial = JKR_NEW_ARRAY(modelMaterial_c, mModelData->getMaterialNum());
JUT_ASSERT(546, mMaterial != NULL);
for (u16 i = 0; i < mModelData->getMaterialNum(); i++) {
@@ -446,11 +446,11 @@ void dBgp_c::create(s8 i_roomNo, void* i_data) {
JKRHeap* prevHeap = mDoExt_setCurrentHeap(mHeap);
mModel = JKR_NEW model_c[((stage_map_unit_class*)mPointer)->num];
mModel = JKR_NEW_ARRAY(model_c, ((stage_map_unit_class*)mPointer)->num);
JUT_ASSERT(886, mModel != NULL);
unit_class* mapUnit = (unit_class*)((stage_map_unit_class*)mPointer)->entries;
mBgWork = JKR_NEW dBgW[mapUnit->num];
mBgWork = JKR_NEW_ARRAY(dBgW, mapUnit->num);
JUT_ASSERT(890, mBgWork != NULL);
dBgW* bgw = mBgWork;
@@ -758,7 +758,7 @@ void dBgp_c::createShare() {
mShareHeap = mDoExt_createSolidHeapFromGameToCurrent(0, 0x20);
JUT_ASSERT(1409, mShareHeap != NULL);
mShare = JKR_NEW share_c[16];
mShare = JKR_NEW_ARRAY(share_c, 16);
JUT_ASSERT(1411, mShare != NULL);
u32 heapSize = mDoExt_adjustSolidHeapToSystem(mShareHeap);
+6 -6
View File
@@ -88,7 +88,7 @@ bool cBgW::SetVtx() {
if (mFlags & NO_VTX_TBL_e) {
pm_vtx_tbl = NULL;
} else if (mFlags & MOVE_BG_e) {
pm_vtx_tbl = (cBgD_Vtx_t*)JKR_NEW Vec[pm_bgd->m_v_num];
pm_vtx_tbl = (cBgD_Vtx_t*)JKR_NEW_ARRAY(Vec, pm_bgd->m_v_num);
if (pm_vtx_tbl == NULL) {
return true;
@@ -139,7 +139,7 @@ void cBgW::CalcPlane() {
}
bool cBgW::SetTri() {
pm_tri = JKR_NEW cBgW_TriElm[pm_bgd->m_t_num];
pm_tri = JKR_NEW_ARRAY(cBgW_TriElm, pm_bgd->m_t_num);
if (pm_tri == NULL) {
return true;
@@ -387,25 +387,25 @@ bool cBgW::Set(cBgD_t* pbgd, u32 flags, Mtx* pbase_mtx) {
return true;
}
pm_rwg = JKR_NEW cBgW_RwgElm[pm_bgd->m_t_num];
pm_rwg = JKR_NEW_ARRAY(cBgW_RwgElm, pm_bgd->m_t_num);
if (pm_rwg == NULL) {
FreeArea();
return true;
}
pm_blk = JKR_NEW cBgW_BlkElm[pm_bgd->m_b_num];
pm_blk = JKR_NEW_ARRAY(cBgW_BlkElm, pm_bgd->m_b_num);
if (pm_blk == NULL) {
FreeArea();
return true;
}
pm_node_tree = JKR_NEW cBgW_NodeTree[pm_bgd->m_tree_num];
pm_node_tree = JKR_NEW_ARRAY(cBgW_NodeTree, pm_bgd->m_tree_num);
if (pm_node_tree == NULL) {
FreeArea();
return true;
}
pm_grp = JKR_NEW cBgW_GrpElm[pm_bgd->m_g_num];
pm_grp = JKR_NEW_ARRAY(cBgW_GrpElm, pm_bgd->m_g_num);
if (pm_grp == NULL) {
FreeArea();
return true;
+1 -1
View File
@@ -18,7 +18,7 @@ u8 dBgWSv::Set(cBgD_t* pbgd, u32 param_1) {
return 0;
}
field_0xc0 = JKR_NEW Vec[pm_bgd->m_v_num];
field_0xc0 = JKR_NEW_ARRAY(Vec, pm_bgd->m_v_num);
return field_0xc0 == NULL;
}
+1 -1
View File
@@ -277,7 +277,7 @@ BOOL dCsr_mng_c::bloObj_c::create(J2DScreen* i_screen, u16 i_mask, u8 i_priority
m_screen = i_screen;
m_pane_num = 0;
calcPaneObjNum(i_screen);
m_panes = JKR_NEW paneObj_c[m_pane_num];
m_panes = JKR_NEW_ARRAY(paneObj_c, m_pane_num);
paneObj_c* sp08 = m_panes + m_pane_num;
createPaneObj(&sp08, m_screen);
return TRUE;
+1 -1
View File
@@ -727,7 +727,7 @@ int dDbgCamera_c::makeZevData() {
field_0xb14 = 0;
if (zevwork::WorkBuffer == NULL) {
zevwork::WorkBuffer = JKR_NEW u8[zevwork::WorkSize];
zevwork::WorkBuffer = JKR_NEW_ARRAY(u8, zevwork::WorkSize);
if (zevwork::WorkBuffer == NULL) {
OSReport("debug camera: memory allocate error!! %d byte\n", zevwork::WorkSize);
return 0;
+1 -1
View File
@@ -1404,7 +1404,7 @@ void dDlst_shadowControl_c::init() {
u16 size = l_realImageSize[i];
u32 buffer_size = GXGetTexBufferSize(size, size, 5, GX_DISABLE, 0);
field_0x15ef0[i] = JKR_NEW_ARGS (0x20) u8[buffer_size];
field_0x15ef0[i] = JKR_NEW_ARRAY_ARGS(u8, buffer_size, 0x20);
GXInitTexObj(&field_0x15eb0[i], field_0x15ef0[i], size, size, GX_TF_RGB5A3, GX_CLAMP,
GX_CLAMP, GX_DISABLE);
GXInitTexObjLOD(&field_0x15eb0[i], GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE,
+1 -1
View File
@@ -207,7 +207,7 @@ void dJntCol_HIO_c::update() {
}
void dJntCol_HIO_c::fileOut() {
char* buffer = JKR_NEW_ARGS(0x20) char[0x10000];
char* buffer = JKR_NEW_ARRAY_ARGS(char, 0x10000, 0x20);
if (!buffer) {
OSReport("書き込み用領域確保できませんでした\n");
return;
+1 -1
View File
@@ -1177,7 +1177,7 @@ dMap_c::dMap_c(int param_0, int param_1, int param_2, int param_3) {
}
int buffer_size = GXGetTexBufferSize(param_2, param_3, 9, GX_FALSE, 0);
mImage_p = JKR_NEW_ARGS (0x20) u8[buffer_size];
mImage_p = JKR_NEW_ARRAY_ARGS(u8, buffer_size, 0x20);
JUT_ASSERT(2638, mImage_p != NULL);
renderingDAmap_c::init(mImage_p, mTexSizeX, mTexSizeY, mTexSizeX, mTexSizeY);
+1 -1
View File
@@ -212,7 +212,7 @@ bool dMpath_HIO_file_base_c::readBinaryFile(const char* param_1) {
}
if (file.open(JORFile::EFlags_READ, r26, NULL, NULL, NULL)) {
s32 r28 = file.getFileSize();
char* buf = JKR_NEW char[r28];
char* buf = JKR_NEW_ARRAY(char, r28);
JUT_ASSERT(855, buf != NULL);
file.readData(buf, r28);
copyReadBufToData(buf, r28);
+3
View File
@@ -617,7 +617,10 @@ bool renderingDAmap_c::isSwitch(dDrawPath_c::group_class const* i_group) {
}
void renderingDAmap_c::draw() {
#if !TARGET_PC
// Currently breaks Aurora.
renderingMap();
#endif
mIsDraw = true;
}
+1 -1
View File
@@ -303,7 +303,7 @@ void dMenu_DmapMap_c::_delete() {
void dMenu_DmapMap_c::setTexture(u16 param_0, u16 param_1, u16 param_2, u16 param_3) {
for (int lp1 = 0; lp1 < 2; lp1++) {
u32 var_r27 = GXGetTexBufferSize(param_0, param_1, 9, 0, 0);
mMapImage_p[lp1] = JKR_NEW_ARGS (0x20) u8[var_r27];
mMapImage_p[lp1] = JKR_NEW_ARRAY_ARGS(u8, var_r27, 0x20);
JUT_ASSERT(1672, mMapImage_p[lp1] != NULL);
mRend[lp1].init(mMapImage_p[lp1], param_0, param_1, param_2, param_3);
+1 -1
View File
@@ -660,7 +660,7 @@ void dMenu_FmapMap_c::setTexture(u16 i_width, u16 i_height, u16 param_2, u16 par
mMapImage_p = NULL;
mResTIMG = NULL;
int size = GXGetTexBufferSize(i_width, i_height, GX_TF_C8, 0, 0);
mMapImage_p = JKR_NEW_ARGS (0x20) u8[size];
mMapImage_p = JKR_NEW_ARRAY_ARGS(u8, size, 0x20);
init(mMapImage_p, i_width, i_height, param_2, param_3);
mResTIMG = JKR_NEW_ARGS (0x20) ResTIMG();
makeResTIMG(mResTIMG, i_width, i_height, mMapImage_p, (u8*)m_palette, 0x1b);
+7 -3
View File
@@ -24,13 +24,16 @@
#include "d/actor/d_a_horse.h"
#include <cstring>
#include "dusk/memory.h"
int dMeter2_c::_create() {
stage_stag_info_class* stag_info = dComIfGp_getStageStagInfo();
if (dStage_stagInfo_GetUpButton(stag_info) == 1) {
mpHeap = fopMsgM_createExpHeap(0x5A400, NULL);
mpHeap = fopMsgM_createExpHeap(HEAP_SIZE(0x5A400, 0xA0000), NULL);
} else {
mpHeap = fopMsgM_createExpHeap(0x60800, NULL);
mpHeap = fopMsgM_createExpHeap(HEAP_SIZE(0x60800, 0xA0000), NULL);
}
JKRHEAP_NAME(mpHeap, "dMeter2_c");
JKRHeap* heap = mDoExt_setCurrentHeap(mpHeap);
mpHeap->getTotalFreeSize();
@@ -231,7 +234,8 @@ int dMeter2_c::_create() {
dMeter2Info_setMeterMapClass(mpMap);
mpHeap->getTotalFreeSize();
mpSubHeap = fopMsgM_createExpHeap(0x5000, mpHeap);
mpSubHeap = fopMsgM_createExpHeap(HEAP_SIZE(0x5000, 0x6500), mpHeap);
JKRHEAP_NAME(mpSubHeap, "dMeter2_c mpSubHeap");
field_0x108 = NULL;
mpSubContents = NULL;
mpSubSubContents = NULL;
+2 -2
View File
@@ -632,7 +632,7 @@ void dPa_modelEcallBack::setup(JPABaseEmitter* i_emitter, cXyz const* param_1, c
}
void dPa_modelEcallBack::create(u8 param_0) {
mModel = JKR_NEW model_c[param_0];
mModel = JKR_NEW_ARRAY(model_c, param_0);
struct_80450E9C = param_0;
struct_80450E9D = 0;
}
@@ -767,7 +767,7 @@ JPABaseEmitter* dPa_simpleEcallBack::create(JPAEmitterManager* param_0, u16 id,
field_0xa = param_2;
mID = id;
field_0xe = 0x20;
mData = JKR_NEW dPa_simpleData_c[field_0xe];
mData = JKR_NEW_ARRAY(dPa_simpleData_c, field_0xe);
JUT_ASSERT(1747, mData != NULL);
createEmitter(param_0);
return mEmitter;
+1 -1
View File
@@ -310,7 +310,7 @@ int dRes_info_c::loadResource() {
JUT_ASSERT(709, mRes == NULL);
s32 countFile = mArchive->countFile();
mRes = JKR_NEW void*[countFile];
mRes = JKR_NEW_ARRAY(void*, countFile);
if (mRes == NULL) {
OSReport_Error("<%s.arc> setRes: res pointer buffer nothing !!\n", mArchiveName);
return -1;
+1 -1
View File
@@ -127,7 +127,7 @@ void dLog_HIO_c::genMessage(JORMContext*) {}
#endif
void dScnLogo_c::preLoad_dyl_create() {
m_preLoad_dylPhase = JKR_NEW request_of_phase_process_class[14];
m_preLoad_dylPhase = JKR_NEW_ARRAY(request_of_phase_process_class, 14);
JUT_ASSERT(194, m_preLoad_dylPhase != NULL);
memset(m_preLoad_dylPhase, 0, sizeof(request_of_phase_process_class) * 14);
+1 -1
View File
@@ -1583,7 +1583,7 @@ int phase_2(dScnMenu_c* i_this) {
}
if (l_groupPoint == NULL) {
l_groupPoint = JKR_NEW s8[menu_info->num];
l_groupPoint = JKR_NEW_ARRAY(s8, menu_info->num);
JUT_ASSERT(3252, l_groupPoint != NULL);
if (mDoExt_getSafeZeldaHeapSize() >= 0) {
+1 -1
View File
@@ -427,7 +427,7 @@ bool dStage_roomControl_c::resetArchiveBank(int i_bank) {
void dStage_roomControl_c::roomDzs_c::create(u8 i_num) {
JUT_ASSERT(1112, !m_num && 0 < i_num && i_num < 64);
m_dzs = JKR_NEW_ARGS (mDoExt_getArchiveHeap(), -4) void*[i_num];
m_dzs = JKR_NEW_ARRAY_ARGS(void*, i_num, mDoExt_getArchiveHeap(), -4);
JUT_ASSERT(1114, m_dzs != NULL);
if (m_dzs != NULL) {
+1 -1
View File
@@ -11,7 +11,7 @@ static bool data_80450680 = true;
dTres_c::typeGroupData_c* dTres_c::mTypeGroupData;
int dTres_c::createWork() {
mTypeGroupData = JKR_NEW dTres_c::typeGroupData_c[0x40];
mTypeGroupData = JKR_NEW_ARRAY(dTres_c::typeGroupData_c, 0x40);
return 1;
}