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
-16
View File
@@ -89,22 +89,6 @@ target_link_libraries(game_debug PUBLIC aurora::core aurora::gx aurora::gd auror
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
add_library(game SHARED ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${SSYSTEM_FILES} ${JSYSTEM_FILES} ${REL_FILES} ${DUSK_FILES} ${DOLPHIN_FILES})
# Hide global operator new/delete overrides from the dynamic symbol table.
# Without this, other dylibs (e.g. Apple's AGX GPU driver) resolve these symbols
# from libgame and crash when they encounter JKRHeap-managed memory.
if (APPLE)
target_link_options(game PRIVATE
"LINKER:-unexported_symbol,__ZdlPv" # operator delete(void*)
"LINKER:-unexported_symbol,__ZdaPv" # operator delete[](void*)
"LINKER:-unexported_symbol,__Znwm" # operator new(size_t)
"LINKER:-unexported_symbol,__Znam" # operator new[](size_t)
)
elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)
target_link_options(game PRIVATE
"LINKER:--version-script,${CMAKE_SOURCE_DIR}/hide_new_delete.lds"
)
endif ()
target_link_libraries(game PRIVATE game_debug cxxopts::cxxopts)
target_compile_definitions(game PRIVATE TARGET_PC AVOID_UB=1 VERSION=0 NDEBUG=1 NDEBUG_DEFINED=1 DEBUG_DEFINED=0)
-8
View File
@@ -1,8 +0,0 @@
{
global: *;
local:
_ZdlPv;
_ZdaPv;
_Znwm;
_Znam;
};
+1 -1
View File
@@ -59,7 +59,7 @@ class dCsr_mng_c {
};
bloObj_c() {
m_panes = JKR_NEW paneObj_c[1];
m_panes = JKR_NEW_ARRAY(paneObj_c, 1);
m_screen = 0;
}
+13
View File
@@ -0,0 +1,13 @@
#ifndef DUSK_GX_HELPER_H
#define DUSK_GX_HELPER_H
#include <dolphin/gx/GXAurora.h>
#define GX_DEBUG_GROUP(name, ...) \
do { \
GXPushDebugGroup(#name); \
name(__VA_ARGS__); \
GXPopDebugGroup(); \
} while (0)
#endif // DUSK_GX_HELPER_H
@@ -125,6 +125,10 @@ public:
/* 0x3C */ J3DMaterialAnm* mMaterialAnm;
/* 0x40 */ J3DCurrentMtx mCurrentMtx;
/* 0x48 */ J3DDisplayListObj* mSharedDLObj;
#if TARGET_PC
const char* mMaterialName;
#endif
};
/**
+79 -3
View File
@@ -5,6 +5,7 @@
#include <os.h>
#include "global.h"
#include <new>
#include <utility>
#include <cstdint>
class JKRHeap;
@@ -238,14 +239,18 @@ inline void* operator new[](size_t, JKRHeapToken, void* where) {
}
#define JKR_NEW new (JKRHeapToken::Dummy)
#define JKR_NEW_ARGS(...) new (JKRHeapToken::Dummy, __VA_ARGS__ )
#define JKR_NEW_ARRAY(type, count) jkrNewArray(count, std::in_place_type<type>)
#define JKR_NEW_ARGS(...) new (JKRHeapToken::Dummy, __VA_ARGS__)
#define JKR_NEW_ARRAY_ARGS(type, count, ...) jkrNewArray(count, std::in_place_type<type>, __VA_ARGS__)
#define JKR_DELETE(expr) jkrDelete(expr)
#define JKR_DELETE_ARRAY(expr) jkrDeleteArray(expr)
#define JKR_HEAP_TOKEN , JKRHeapToken::Dummy
#define JKR_HEAP_TOKEN_PARAM , JKRHeapToken
#else
#define JKR_NEW new
#define JKR_NEW_ARRAY(type, count) new type[count]
#define JKR_NEW_ARGS(...) new (__VA_ARGS__ )
#define JKR_NEW_ARRAY_ARGS(type, count, ...) new (JKRHeapToken::Dummy, __VA_ARGS__ ) type[count]
#define JKR_DELETE(expr) delete (expr)
#define JKR_DELETE_ARRAY(expr) delete[] (expr)
#define JKR_HEAP_TOKEN
@@ -256,6 +261,7 @@ void* operator new(size_t size JKR_HEAP_TOKEN_PARAM);
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, int alignment);
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment);
// On PC, these new[] overloads are only used to catch usages of JKR_NEW with [].
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM);
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, int alignment);
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment);
@@ -282,8 +288,78 @@ inline void jkrDelete(void* ptr) {
operator delete(ptr, JKRHeapToken::Dummy);
}
static void jkrDeleteArray(void* ptr) {
operator delete[](ptr, JKRHeapToken::Dummy);
template<typename... Args>
bool constexpr newArgsHasCustomAlignment(Args&&...) {
return false;
}
template<>
constexpr bool newArgsHasCustomAlignment(int&&) {
return true;
}
template<>
constexpr bool newArgsHasCustomAlignment(JKRHeap*&&, int&&) {
return true;
}
template<typename T, typename... Args>
T* jkrNewArray(size_t count, std::in_place_type_t<T>, Args&&... args) {
size_t allocSize = count * sizeof(T);
if constexpr (!std::is_trivially_destructible<T>()) {
static_assert(
!newArgsHasCustomAlignment(args...),
"jkrNewArray cannot currently handle non-trivially-destructible array allocations with custom alignment");
allocSize += sizeof(size_t);
}
void* ptr = operator new(allocSize, JKRHeapToken::Dummy, args...);
T* dataPtr;
if constexpr (!std::is_trivially_destructible<T>()) {
auto length = static_cast<size_t*>(ptr);
*length = count;
dataPtr = reinterpret_cast<T*>(length + 1);
} else {
dataPtr = static_cast<T*>(ptr);
}
if constexpr (!std::is_trivially_constructible<T>()) {
for (int i = 0; i < count; ++i) {
new (dataPtr + i) T();
}
}
return dataPtr;
}
template<typename T>
void jkrDeleteArray(T* pointer) {
if (pointer == nullptr) {
return;
}
if constexpr (!std::is_trivially_destructible<T>()) {
auto countPtr = reinterpret_cast<size_t*>(pointer) - 1;
auto count = *countPtr;
for (int i = 0; i < count; ++i) {
(pointer + i)->~T();
}
operator delete(countPtr, JKRHeapToken::Dummy);
} else {
operator delete(pointer, JKRHeapToken::Dummy);
}
}
template<>
inline void jkrDeleteArray(void* pointer) {
if (pointer == nullptr) {
return;
}
operator delete(pointer, JKRHeapToken::Dummy);
}
#endif
+1 -1
View File
@@ -586,7 +586,7 @@ void J2DAnmTexPattern::searchUpdateMaterialID(J2DScreen* pScreen) {
}
}
JKR_DELETE_ARRAY(mTIMGPtrArray);
mTIMGPtrArray = JKR_NEW J2DAnmTexPatternTIMGPointer[pScreen->mTexRes->mCount];
mTIMGPtrArray = JKR_NEW_ARRAY(J2DAnmTexPatternTIMGPointer, pScreen->mTexRes->mCount);
if (mTIMGPtrArray != NULL) {
JUTResReference resRef;
for (u16 i = 0; i < pScreen->mTexRes->mCount; i++) {
+1 -1
View File
@@ -93,7 +93,7 @@ u8* J2DPrint::setBuffer(size_t size) {
JKR_DELETE(mStrBuff);
}
mStrBuff = JKR_NEW_ARGS (JKRGetSystemHeap(), 0) char[size];
mStrBuff = JKR_NEW_ARRAY_ARGS(char, size, JKRGetSystemHeap(), 0);
mStrBuffSize = size;
sStrBufInitialized = true;
return u8Buff;
+6 -6
View File
@@ -321,9 +321,9 @@ J2DResReference* J2DScreen::getResReference(JSURandomInputStream* p_stream, u32
char* buffer;
if (param_1 & 0x1F0000) {
buffer = JKR_NEW char[size1];
buffer = JKR_NEW_ARRAY(char, size1);
} else {
buffer = JKR_NEW_ARGS (-4) char[size1];
buffer = JKR_NEW_ARRAY_ARGS(char, size1, -4);
}
if (buffer != NULL) {
@@ -343,12 +343,12 @@ bool J2DScreen::createMaterial(JSURandomInputStream* p_stream, u32 param_1, JKRA
p_stream->skip(2);
if (param_1 & 0x1F0000) {
mMaterials = JKR_NEW J2DMaterial[mMaterialNum];
mMaterials = JKR_NEW_ARRAY(J2DMaterial, mMaterialNum);
} else {
mMaterials = JKR_NEW_ARGS (-4) J2DMaterial[mMaterialNum];
mMaterials = JKR_NEW_ARRAY_ARGS(J2DMaterial, mMaterialNum, -4);
}
u8* buffer = JKR_NEW_ARGS (-4) u8[header.mSize];
u8* buffer = JKR_NEW_ARRAY_ARGS(u8, header.mSize, -4);
if (mMaterials != NULL && buffer != NULL) {
J2DMaterialBlock* pBlock = (J2DMaterialBlock*)buffer;
p_stream->seek(position, JSUStreamSeekFrom_SET);
@@ -372,7 +372,7 @@ bool J2DScreen::createMaterial(JSURandomInputStream* p_stream, u32 param_1, JKRA
}
size++;
u8* nametab = JKR_NEW u8[size];
u8* nametab = JKR_NEW_ARRAY(u8, size);
if (nametab == NULL) {
goto failure;
}
+5 -5
View File
@@ -74,7 +74,7 @@ J2DTextBox::J2DTextBox(J2DPane* p_pane, JSURandomInputStream* p_stream, u32 para
mStringPtr = NULL;
if (strLength != 0) {
mStringPtr = JKR_NEW char[strLength];
mStringPtr = JKR_NEW_ARRAY(char, strLength);
}
if (mStringPtr != NULL) {
@@ -144,7 +144,7 @@ void J2DTextBox::initiate(ResFONT const* p_font, char const* string, s16 length,
stringLen = len + 1;
}
mStringPtr = JKR_NEW char[stringLen];
mStringPtr = JKR_NEW_ARRAY(char, stringLen);
if (stringLen != 0 && mStringPtr != NULL) {
strncpy(mStringPtr, string, stringLen - 1);
@@ -198,7 +198,7 @@ void J2DTextBox::private_readStream(J2DPane* p_pane, JSURandomInputStream* p_str
mFontSizeY = p_stream->read16b();
s16 stringLen = p_stream->read16b();
mStringPtr = JKR_NEW char[stringLen + 1];
mStringPtr = JKR_NEW_ARRAY(char, stringLen + 1);
if (mStringPtr != NULL) {
p_stream->read(mStringPtr, stringLen);
@@ -326,7 +326,7 @@ s32 J2DTextBox::setString(char const* string, ...) {
}
mStringLength = 0;
mStringPtr = JKR_NEW char[len + 1];
mStringPtr = JKR_NEW_ARRAY(char, len + 1);
if (mStringPtr) {
mStringLength = len + 1;
@@ -357,7 +357,7 @@ s32 J2DTextBox::setString(s16 length, char const* string, ...) {
mStringLength = 0;
if (stringLen != 0) {
mStringPtr = JKR_NEW char[stringLen];
mStringPtr = JKR_NEW_ARRAY(char, stringLen);
}
if (mStringPtr != NULL) {
+1 -1
View File
@@ -65,7 +65,7 @@ J2DTextBoxEx::J2DTextBoxEx(J2DPane* p_pane, JSURandomInputStream* p_stream, u32
mStringPtr = NULL;
if (strLength != 0) {
mStringPtr = JKR_NEW char[strLength];
mStringPtr = JKR_NEW_ARRAY(char, strLength);
}
if (mStringPtr != NULL) {
@@ -100,7 +100,7 @@ s32 J3DModel::createShapePacket(J3DModelData* pModelData) {
J3D_ASSERTMSG(173, pModelData != NULL, "Error : null pointer.");
if (pModelData->getShapeNum() != 0) {
mShapePacket = JKR_NEW J3DShapePacket[pModelData->getShapeNum()];
mShapePacket = JKR_NEW_ARRAY(J3DShapePacket, pModelData->getShapeNum());
if (mShapePacket == NULL) {
return kJ3DError_Alloc;
@@ -120,7 +120,7 @@ s32 J3DModel::createMatPacket(J3DModelData* pModelData, u32 mdlFlags) {
s32 ret = 0;
if (pModelData->getMaterialNum() != 0) {
mMatPacket = JKR_NEW J3DMatPacket[pModelData->getMaterialNum()];
mMatPacket = JKR_NEW_ARRAY(J3DMatPacket, pModelData->getMaterialNum());
if (mMatPacket == NULL) {
return kJ3DError_Alloc;
@@ -93,8 +93,8 @@ s32 J3DMtxBuffer::create(J3DModelData* pModelData, u32 mtxNum) {
J3DError J3DMtxBuffer::createAnmMtx(J3DModelData* pModelData) {
if (pModelData->getJointNum() != 0) {
mpScaleFlagArr = JKR_NEW u8[pModelData->getJointNum()];
mpAnmMtx = JKR_NEW Mtx[pModelData->getJointNum()];
mpScaleFlagArr = JKR_NEW_ARRAY(u8, pModelData->getJointNum());
mpAnmMtx = JKR_NEW_ARRAY(Mtx, pModelData->getJointNum());
mpUserAnmMtx = mpAnmMtx;
}
@@ -110,8 +110,8 @@ J3DError J3DMtxBuffer::createAnmMtx(J3DModelData* pModelData) {
s32 J3DMtxBuffer::createWeightEnvelopeMtx(J3DModelData* pModelData) {
if (pModelData->getWEvlpMtxNum() != 0) {
mpEvlpScaleFlagArr = JKR_NEW u8[pModelData->getWEvlpMtxNum()];
mpWeightEvlpMtx = JKR_NEW Mtx[pModelData->getWEvlpMtxNum()];
mpEvlpScaleFlagArr = JKR_NEW_ARRAY(u8, pModelData->getWEvlpMtxNum());
mpWeightEvlpMtx = JKR_NEW_ARRAY(Mtx, pModelData->getWEvlpMtxNum());
}
if (pModelData->getWEvlpMtxNum() != 0 && mpEvlpScaleFlagArr == NULL)
@@ -132,8 +132,8 @@ s32 J3DMtxBuffer::setNoUseDrawMtx() {
s32 J3DMtxBuffer::createDoubleDrawMtx(J3DModelData* pModelData, u32 mtxNum) {
if (mtxNum != 0) {
for (s32 i = 0; i < 2; i++) {
mpDrawMtxArr[i] = JKR_NEW Mtx*[mtxNum];
mpNrmMtxArr[i] = JKR_NEW Mtx33*[mtxNum];
mpDrawMtxArr[i] = JKR_NEW_ARRAY(Mtx*, mtxNum);
mpNrmMtxArr[i] = JKR_NEW_ARRAY(Mtx33*, mtxNum);
mpBumpMtxArr[i] = NULL;
}
}
@@ -150,8 +150,8 @@ s32 J3DMtxBuffer::createDoubleDrawMtx(J3DModelData* pModelData, u32 mtxNum) {
for (s32 i = 0; i < 2; i++) {
for (u32 j = 0; j < mtxNum; j++) {
if (pModelData->getDrawMtxNum() != 0) {
mpDrawMtxArr[i][j] = JKR_NEW_ARGS (0x20) Mtx[pModelData->getDrawMtxNum()];
mpNrmMtxArr[i][j] = JKR_NEW_ARGS (0x20) Mtx33[pModelData->getDrawMtxNum()];
mpDrawMtxArr[i][j] = JKR_NEW_ARRAY_ARGS(Mtx, pModelData->getDrawMtxNum(), 0x20);
mpNrmMtxArr[i][j] = JKR_NEW_ARRAY_ARGS(Mtx33, pModelData->getDrawMtxNum(), 0x20);
}
}
}
@@ -187,7 +187,7 @@ s32 J3DMtxBuffer::createBumpMtxArray(J3DModelData* i_modelData, u32 mtxNum) {
if (bumpMtxNum != 0 && mtxNum != 0) {
for (int i = 0; i < 2; i++) {
mpBumpMtxArr[i] = JKR_NEW Mtx33**[(u16)materialCount];
mpBumpMtxArr[i] = JKR_NEW_ARRAY(Mtx33**, (u16)materialCount);
if (mpBumpMtxArr[i] == NULL) {
return kJ3DError_Alloc;
}
@@ -200,7 +200,7 @@ s32 J3DMtxBuffer::createBumpMtxArray(J3DModelData* i_modelData, u32 mtxNum) {
for (u16 j = 0; j < materialNum; j++) {
J3DMaterial* material = i_modelData->getMaterialNodePointer(j);
if (material->getNBTScale()->mbHasScale == true) {
mpBumpMtxArr[i][offset] = JKR_NEW Mtx33*[mtxNum];
mpBumpMtxArr[i][offset] = JKR_NEW_ARRAY(Mtx33*, mtxNum);
if (mpBumpMtxArr[i][offset] == NULL) {
return kJ3DError_Alloc;
}
@@ -217,7 +217,7 @@ s32 J3DMtxBuffer::createBumpMtxArray(J3DModelData* i_modelData, u32 mtxNum) {
J3DMaterial* material = i_modelData->getMaterialNodePointer((u16)j);
if (material->getNBTScale()->mbHasScale == true) {
for (int k = 0; k < mtxNum; k++) {
mpBumpMtxArr[i][offset][k] = JKR_NEW_ARGS (0x20) Mtx33[i_modelData->getDrawMtxNum()];
mpBumpMtxArr[i][offset][k] = JKR_NEW_ARRAY_ARGS(Mtx33, i_modelData->getDrawMtxNum(), 0x20);
if (mpBumpMtxArr[i][offset][k] == NULL) {
return kJ3DError_Alloc;
}
@@ -99,7 +99,7 @@ void J3DSkinDeform::initSkinInfo(J3DModelData* pModelData) {
}
if (pModelData->getJointNum() != 0) {
mSkinNList = JKR_NEW J3DSkinNList[pModelData->getJointNum()];
mSkinNList = JKR_NEW_ARRAY(J3DSkinNList, pModelData->getJointNum());
}
for (int i = 0; i < pModelData->getVtxNum(); i++) {
@@ -138,13 +138,13 @@ void J3DSkinDeform::initSkinInfo(J3DModelData* pModelData) {
for (u16 i = 0; i < pModelData->getJointNum(); i++) {
if (mSkinNList[i].field_0x10) {
mSkinNList[i].field_0x0 = JKR_NEW u16[mSkinNList[i].field_0x10];
mSkinNList[i].field_0x8 = JKR_NEW f32[mSkinNList[i].field_0x10];
mSkinNList[i].field_0x0 = JKR_NEW_ARRAY(u16, mSkinNList[i].field_0x10);
mSkinNList[i].field_0x8 = JKR_NEW_ARRAY(f32, mSkinNList[i].field_0x10);
mSkinNList[i].field_0x10 = 0;
}
if (mSkinNList[i].field_0x12) {
mSkinNList[i].field_0x4 = JKR_NEW u16[mSkinNList[i].field_0x12];
mSkinNList[i].field_0xc = JKR_NEW f32[mSkinNList[i].field_0x12];
mSkinNList[i].field_0x4 = JKR_NEW_ARRAY(u16, mSkinNList[i].field_0x12);
mSkinNList[i].field_0xc = JKR_NEW_ARRAY(f32, mSkinNList[i].field_0x12);
mSkinNList[i].field_0x12 = 0;
}
}
@@ -202,7 +202,7 @@ int J3DSkinDeform::initMtxIndexArray(J3DModelData* pModelData) {
return kJ3DError_Success;
}
mPosData = JKR_NEW u16[pModelData->getVtxNum()];
mPosData = JKR_NEW_ARRAY(u16, pModelData->getVtxNum());
if (mPosData == NULL) {
return kJ3DError_Alloc;
}
@@ -212,7 +212,7 @@ int J3DSkinDeform::initMtxIndexArray(J3DModelData* pModelData) {
}
if (pModelData->getNrmNum()) {
mNrmData = JKR_NEW u16[pModelData->getNrmNum()];
mNrmData = JKR_NEW_ARRAY(u16, pModelData->getNrmNum());
if (mNrmData == NULL) {
return kJ3DError_Alloc;
}
@@ -223,8 +223,8 @@ int J3DSkinDeform::initMtxIndexArray(J3DModelData* pModelData) {
mNrmData = NULL;
}
mPosMtx = JKR_NEW Mtx[pModelData->getJointNum()];
mNrmMtx = JKR_NEW_ARGS (32) Mtx33[pModelData->getDrawMtxNum()];
mPosMtx = JKR_NEW_ARRAY(Mtx, pModelData->getJointNum());
mNrmMtx = JKR_NEW_ARRAY_ARGS(Mtx33, pModelData->getDrawMtxNum(), 32);
if (mPosMtx == NULL) {
return kJ3DError_Alloc;
}
@@ -25,7 +25,7 @@ void J3DDrawBuffer::initialize() {
}
int J3DDrawBuffer::allocBuffer(u32 size) {
mpBuffer = JKR_NEW_ARGS (0x20) J3DPacket*[size];
mpBuffer = JKR_NEW_ARRAY_ARGS(J3DPacket*, size, 0x20);
if (mpBuffer == NULL)
return kJ3DError_Alloc;
+19 -4
View File
@@ -12,8 +12,8 @@
J3DError J3DDisplayListObj::newDisplayList(u32 maxSize) {
mMaxSize = ALIGN_NEXT(maxSize, 0x20);
mpDisplayList[0] = JKR_NEW_ARGS (0x20) char[mMaxSize];
mpDisplayList[1] = JKR_NEW_ARGS (0x20) char[mMaxSize];
mpDisplayList[0] = JKR_NEW_ARRAY_ARGS(char, mMaxSize, 0x20);
mpDisplayList[1] = JKR_NEW_ARRAY_ARGS(char, mMaxSize, 0x20);
mSize = 0;
if (mpDisplayList[0] == NULL || mpDisplayList[1] == NULL)
@@ -24,7 +24,7 @@ J3DError J3DDisplayListObj::newDisplayList(u32 maxSize) {
J3DError J3DDisplayListObj::newSingleDisplayList(u32 maxSize) {
mMaxSize = ALIGN_NEXT(maxSize, 0x20);
mpDisplayList[0] = JKR_NEW_ARGS (0x20) char[mMaxSize];
mpDisplayList[0] = JKR_NEW_ARRAY_ARGS(char, mMaxSize, 0x20);
mpDisplayList[1] = mpDisplayList[0];
mSize = 0;
@@ -36,7 +36,7 @@ J3DError J3DDisplayListObj::newSingleDisplayList(u32 maxSize) {
int J3DDisplayListObj::single_To_Double() {
if (mpDisplayList[0] == mpDisplayList[1]) {
mpDisplayList[1] = JKR_NEW_ARGS (0x20) char[mMaxSize];
mpDisplayList[1] = JKR_NEW_ARRAY_ARGS(char, mMaxSize, 0x20);
if (mpDisplayList[1] == NULL)
return kJ3DError_Alloc;
@@ -211,6 +211,15 @@ void J3DMatPacket::draw() {
j3dSys.setTexture(mpTexture);
#endif
mpMaterial->load();
#if TARGET_PC
if (mpMaterial->mMaterialName != nullptr) {
char buf[64];
snprintf(buf, sizeof(buf), "Mat: %s", mpMaterial->mMaterialName);
GXPushDebugGroup(buf);
}
#endif
callDL();
J3DShapePacket* packet = getShapePacket();
@@ -229,6 +238,12 @@ void J3DMatPacket::draw() {
}
J3DShape::resetVcdVatCache();
#if TARGET_PC
if (mpMaterial->mMaterialName != nullptr) {
GXPopDebugGroup();
}
#endif
}
J3DShapePacket::J3DShapePacket() {
+1 -1
View File
@@ -87,7 +87,7 @@ void J3DShape::addTexMtxIndexInVcd(GXAttr attr) {
if (attrIdx == -1)
return;
GXVtxDescList* newVtxDesc = JKR_NEW GXVtxDescList[attrCount + 2];
GXVtxDescList* newVtxDesc = JKR_NEW_ARRAY(GXVtxDescList, attrCount + 2);
bool inserted = false;
vtxDesc = getVtxDesc();
@@ -28,7 +28,7 @@ void J3DShapeDraw::addTexMtxIndexInDL(u32 stride, u32 attrOffs, u32 valueBase) {
u32 byteNum = countVertex(stride);
u32 oldSize = mDisplayListSize;
u32 newSize = ALIGN_NEXT(oldSize + byteNum, 0x20);
u8* newDLStart = JKR_NEW_ARGS (0x20) u8[newSize];
u8* newDLStart = JKR_NEW_ARRAY_ARGS(u8, newSize, 0x20);
u8* oldDLStart = (u8*)mDisplayList;
u8* oldDL = oldDLStart;
u8* newDL = newDLStart;
+1 -1
View File
@@ -81,7 +81,7 @@ void J3DTexture::entryNum(u16 num) {
J3D_ASSERT_NONZEROARG(79, num != 0);
mNum = num;
mpRes = JKR_NEW ResTIMG[num];
mpRes = JKR_NEW_ARRAY(ResTIMG, num);
J3D_ASSERT_ALLOCMEM(83, mpRes != NULL);
delete[] mpTexObj;
+6 -6
View File
@@ -76,7 +76,7 @@ void J3DVertexBuffer::setArray() const {
s32 J3DVertexBuffer::copyLocalVtxPosArray(u32 flag) {
if (flag & 1) {
for (int i = 0; i < 2; i++) {
mVtxPosArray[i] = JKR_NEW_ARGS (0x20) char[mVtxData->getVtxNum() * 3 * 4];
mVtxPosArray[i] = JKR_NEW_ARRAY_ARGS(char, mVtxData->getVtxNum() * 3 * 4, 0x20);
if (mVtxPosArray[i] == NULL) {
return kJ3DError_Alloc;
}
@@ -88,7 +88,7 @@ s32 J3DVertexBuffer::copyLocalVtxPosArray(u32 flag) {
mVtxPosArray[0] = mVtxData->getVtxPosArray();
if (mVtxPosArray[1] == NULL) {
mVtxPosArray[1] = JKR_NEW_ARGS (0x20) char[mVtxData->getVtxNum() * 3 * 4];
mVtxPosArray[1] = JKR_NEW_ARRAY_ARGS(char, mVtxData->getVtxNum() * 3 * 4, 0x20);
if (mVtxPosArray[1] == NULL) {
return kJ3DError_Alloc;
}
@@ -104,7 +104,7 @@ s32 J3DVertexBuffer::copyLocalVtxPosArray(u32 flag) {
s32 J3DVertexBuffer::copyLocalVtxNrmArray(u32 flag) {
if (flag & 1) {
for (int i = 0; i < 2; i++) {
mVtxNrmArray[i] = JKR_NEW_ARGS (0x20) char[mVtxData->getNrmNum() * 3 * 4];
mVtxNrmArray[i] = JKR_NEW_ARRAY_ARGS(char, mVtxData->getNrmNum() * 3 * 4, 0x20);
if (mVtxNrmArray[i] == NULL) {
return kJ3DError_Alloc;
}
@@ -116,7 +116,7 @@ s32 J3DVertexBuffer::copyLocalVtxNrmArray(u32 flag) {
mVtxNrmArray[0] = mVtxData->getVtxNrmArray();
if (mVtxNrmArray[1] == NULL) {
mVtxNrmArray[1] = JKR_NEW_ARGS (0x20) char[mVtxData->getNrmNum() * 3 * 4];
mVtxNrmArray[1] = JKR_NEW_ARRAY_ARGS(char, mVtxData->getNrmNum() * 3 * 4, 0x20);
if (mVtxNrmArray[1] == NULL) {
return kJ3DError_Alloc;
}
@@ -186,7 +186,7 @@ s32 J3DVertexBuffer::allocTransformedVtxPosArray() {
for (int i = 0; i < 2; i++) {
if (i == 0 || mTransformedVtxPosArray[i] == NULL) {
mTransformedVtxPosArray[i] = JKR_NEW_ARGS (0x20) char[mVtxData->getVtxNum() * 3 * 4];
mTransformedVtxPosArray[i] = JKR_NEW_ARRAY_ARGS(char, mVtxData->getVtxNum() * 3 * 4, 0x20);
if (mTransformedVtxPosArray[i] == NULL)
return kJ3DError_Alloc;
}
@@ -201,7 +201,7 @@ s32 J3DVertexBuffer::allocTransformedVtxNrmArray() {
for (int i = 0; i < 2; i++) {
if (i == 0 || mTransformedVtxNrmArray[i] == NULL) {
mTransformedVtxNrmArray[i] = JKR_NEW_ARGS (0x20) char[mVtxData->getNrmNum() * 3 * 4];
mTransformedVtxNrmArray[i] = JKR_NEW_ARRAY_ARGS(char, mVtxData->getNrmNum() * 3 * 4, 0x20);
if (mTransformedVtxNrmArray[i] == NULL)
return kJ3DError_Alloc;
}
@@ -76,14 +76,14 @@ void J3DClusterLoader_v15::readCluster(const J3DClusterBlock* block) {
int clusterKeyPointerSize = (intptr_t)block->mClusterKeyPointer - (intptr_t)block->mClusterPointer;
int clusterVertexPointerSize = (intptr_t)block->mClusterVertex - (intptr_t)block->mClusterPointer;
int vtxPosSize = (intptr_t)block->mVtxPos - (intptr_t)block->mClusterPointer;
u8* arr = JKR_NEW_ARGS (0x20) u8[vtxPosSize];
u8* arr = JKR_NEW_ARRAY_ARGS(u8, vtxPosSize, 0x20);
memcpy(arr, JSUConvertOffsetToPtr<J3DCluster>(block, block->mClusterPointer), vtxPosSize);
mpDeformData->mClusterPointer = (J3DCluster*)arr;
mpDeformData->mClusterKeyPointer = (J3DClusterKey*)&arr[clusterKeyPointerSize];
mpDeformData->mClusterVertex = (J3DClusterVertex*)&arr[clusterVertexPointerSize];
#if TARGET_PC
mpDeformData->mDeformers = JKR_NEW J3DDeformer*[mpDeformData->getClusterNum()];
mpDeformData->mDeformers = JKR_NEW_ARRAY(J3DDeformer*, mpDeformData->getClusterNum());
#endif
for (int i = 0; i < mpDeformData->getClusterNum(); i++) {
@@ -96,12 +96,12 @@ void J3DClusterLoader_v15::readCluster(const J3DClusterBlock* block) {
#endif
J3DDeformer* deformer = JKR_NEW J3DDeformer(mpDeformData);
if (cluster->field_0x14 != 0) {
deformer->field_0xc = JKR_NEW f32[cluster->field_0x14 * 3];
deformer->field_0xc = JKR_NEW_ARRAY(f32, cluster->field_0x14 * 3);
} else {
deformer->field_0xc = NULL;
}
deformer->mFlags = cluster->mFlags;
deformer->field_0x8 = JKR_NEW f32[cluster->mKeyNum];
deformer->field_0x8 = JKR_NEW_ARRAY(f32, cluster->mKeyNum);
#if TARGET_PC
deformer->mArrayBase = arr - clusterPointer;
deformer->mBlockBase = block;
@@ -17,6 +17,17 @@
#include "SSystem/SComponent/c_xyz.h"
#include <utility>
#if TARGET_PC
static void AssignMaterialNames(const J3DModelLoader& loader) {
auto table = loader.mpMaterialTable;
auto materialName = table->getMaterialName();
for (int i = 0; i < table->getMaterialNum(); i++) {
auto mat = table->getMaterialNodePointer(i);
mat->mMaterialName = materialName->getName(i);
}
}
#endif
J3DModelLoader::J3DModelLoader() :
mpModelData(NULL),
mpMaterialTable(NULL),
@@ -119,6 +130,9 @@ J3DModelData* J3DModelLoader::load(void const* i_data, u32 i_flags) {
mpModelData->getShapeNodePointer(shape_no)->onFlag(0x200);
}
}
#if TARGET_PC
AssignMaterialNames(*this);
#endif
return mpModelData;
}
@@ -581,7 +595,7 @@ void J3DModelLoader::readDraw(J3DDrawBlock const* i_block) {
}
}
drawMtxData->mDrawFullWgtMtxNum = i;
mpModelData->getJointTree().mWEvlpImportantMtxIdx = JKR_NEW u16[drawMtxData->mEntryNum];
mpModelData->getJointTree().mWEvlpImportantMtxIdx = JKR_NEW_ARRAY(u16, drawMtxData->mEntryNum);
J3D_ASSERT_ALLOCMEM(767, mpModelData->getJointTree().mWEvlpImportantMtxIdx);
}
@@ -597,7 +611,7 @@ void J3DModelLoader::readJoint(J3DJointBlock const* i_block) {
mpModelData->getJointTree().mJointName = NULL;
}
mpModelData->getJointTree().mJointNodePointer =
JKR_NEW J3DJoint*[mpModelData->getJointTree().mJointNum];
JKR_NEW_ARRAY(J3DJoint*, mpModelData->getJointTree().mJointNum);
J3D_ASSERT_ALLOCMEM(797, mpModelData->getJointTree().mJointNodePointer);
for (u16 i = 0; i < mpModelData->getJointNum(); i++) {
mpModelData->getJointTree().mJointNodePointer[i] = factory.create(i);
@@ -616,10 +630,10 @@ void J3DModelLoader_v26::readMaterial(J3DMaterialBlock const* i_block, u32 i_fla
} else {
mpMaterialTable->mMaterialName = NULL;
}
mpMaterialTable->mMaterialNodePointer = JKR_NEW J3DMaterial*[mpMaterialTable->mMaterialNum];
mpMaterialTable->mMaterialNodePointer = JKR_NEW_ARRAY(J3DMaterial*, mpMaterialTable->mMaterialNum);
J3D_ASSERT_ALLOCMEM(841, mpMaterialTable->mMaterialNodePointer);
if (i_flags & 0x200000) {
mpMaterialTable->field_0x10 = JKR_NEW_ARGS (0x20) J3DMaterial[mpMaterialTable->mUniqueMatNum];
mpMaterialTable->field_0x10 = JKR_NEW_ARRAY_ARGS(J3DMaterial, mpMaterialTable->mUniqueMatNum, 0x20);
J3D_ASSERT_ALLOCMEM(846, mpMaterialTable->field_0x10);
} else {
mpMaterialTable->field_0x10 = NULL;
@@ -662,10 +676,10 @@ void J3DModelLoader_v21::readMaterial_v21(J3DMaterialBlock_v21 const* i_block, u
} else {
mpMaterialTable->mMaterialName = NULL;
}
mpMaterialTable->mMaterialNodePointer = JKR_NEW J3DMaterial*[mpMaterialTable->mMaterialNum];
mpMaterialTable->mMaterialNodePointer = JKR_NEW_ARRAY(J3DMaterial*, mpMaterialTable->mMaterialNum);
J3D_ASSERT_ALLOCMEM(940, mpMaterialTable->mMaterialNodePointer);
if (i_flags & 0x200000) {
mpMaterialTable->field_0x10 = JKR_NEW_ARGS (0x20) J3DMaterial[mpMaterialTable->mUniqueMatNum];
mpMaterialTable->field_0x10 = JKR_NEW_ARRAY_ARGS(J3DMaterial, mpMaterialTable->mUniqueMatNum, 0x20);
J3D_ASSERT_ALLOCMEM(945, mpMaterialTable->field_0x10);
} else {
mpMaterialTable->field_0x10 = NULL;
@@ -706,7 +720,7 @@ void J3DModelLoader::readShape(J3DShapeBlock const* i_block, u32 i_flags) {
} else {
shape_table->mShapeName = NULL;
}
shape_table->mShapeNodePointer = JKR_NEW J3DShape*[shape_table->mShapeNum];
shape_table->mShapeNodePointer = JKR_NEW_ARRAY(J3DShape*, shape_table->mShapeNum);
J3D_ASSERT_ALLOCMEM(1034, shape_table->mShapeNodePointer);
factory.allocVcdVatCmdBuffer(shape_table->mShapeNum);
J3DModelHierarchy const* hierarchy_entry = mpModelData->getHierarchy();
@@ -746,7 +760,7 @@ void J3DModelLoader_v26::readMaterialTable(J3DMaterialBlock const* i_block, u32
} else {
mpMaterialTable->mMaterialName = NULL;
}
mpMaterialTable->mMaterialNodePointer = JKR_NEW J3DMaterial*[mpMaterialTable->mMaterialNum];
mpMaterialTable->mMaterialNodePointer = JKR_NEW_ARRAY(J3DMaterial*, mpMaterialTable->mMaterialNum);
J3D_ASSERT_ALLOCMEM(1121, mpMaterialTable->mMaterialNodePointer);
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
mpMaterialTable->mMaterialNodePointer[i] =
@@ -769,7 +783,7 @@ void J3DModelLoader_v21::readMaterialTable_v21(J3DMaterialBlock_v21 const* i_blo
} else {
mpMaterialTable->mMaterialName = NULL;
}
mpMaterialTable->mMaterialNodePointer = JKR_NEW J3DMaterial*[mpMaterialTable->mMaterialNum];
mpMaterialTable->mMaterialNodePointer = JKR_NEW_ARRAY(J3DMaterial*, mpMaterialTable->mMaterialNum);
J3D_ASSERT_ALLOCMEM(1172, mpMaterialTable->mMaterialNodePointer);
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
mpMaterialTable->mMaterialNodePointer[i] =
@@ -808,7 +822,7 @@ void J3DModelLoader::readPatchedMaterial(J3DMaterialBlock const* i_block, u32 i_
} else {
mpMaterialTable->mMaterialName = NULL;
}
mpMaterialTable->mMaterialNodePointer = JKR_NEW J3DMaterial*[mpMaterialTable->mMaterialNum];
mpMaterialTable->mMaterialNodePointer = JKR_NEW_ARRAY(J3DMaterial*, mpMaterialTable->mMaterialNum);
J3D_ASSERT_ALLOCMEM(1260, mpMaterialTable->mMaterialNodePointer);
mpMaterialTable->field_0x10 = NULL;
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
@@ -834,7 +848,7 @@ void J3DModelLoader::readMaterialDL(J3DMaterialDLBlock const* i_block, u32 i_fla
} else {
mpMaterialTable->mMaterialName = NULL;
}
mpMaterialTable->mMaterialNodePointer = JKR_NEW J3DMaterial*[mpMaterialTable->mMaterialNum];
mpMaterialTable->mMaterialNodePointer = JKR_NEW_ARRAY(J3DMaterial*, mpMaterialTable->mMaterialNum);
J3D_ASSERT_ALLOCMEM(1320, mpMaterialTable->mMaterialNodePointer);
mpMaterialTable->field_0x10 = NULL;
for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) {
@@ -46,9 +46,9 @@ J3DShape* J3DShapeFactory::create(int no, u32 flag, GXVtxDescList* vtxDesc) {
shape->mMtxGroupNum = getMtxGroupNum(no);
shape->mRadius = getRadius(no);
shape->mVtxDesc = getVtxDescList(no);
shape->mShapeMtx = JKR_NEW J3DShapeMtx*[shape->mMtxGroupNum];
shape->mShapeMtx = JKR_NEW_ARRAY(J3DShapeMtx*, shape->mMtxGroupNum);
J3D_ASSERT_ALLOCMEM(74, shape->mShapeMtx);
shape->mShapeDraw = JKR_NEW J3DShapeDraw*[shape->mMtxGroupNum];
shape->mShapeDraw = JKR_NEW_ARRAY(J3DShapeDraw*, shape->mMtxGroupNum);
J3D_ASSERT_ALLOCMEM(76, shape->mShapeDraw);
shape->mMin = getMin(no);
shape->mMax = getMax(no);
@@ -138,7 +138,7 @@ J3DShapeDraw* J3DShapeFactory::newShapeDraw(int shapeNo, int mtxGroupNo) const {
}
void J3DShapeFactory::allocVcdVatCmdBuffer(u32 count) {
mVcdVatCmdBuffer = JKR_NEW_ARGS (0x20) u8[J3DShape::kVcdVatDLSize * count];
mVcdVatCmdBuffer = JKR_NEW_ARRAY_ARGS(u8, J3DShape::kVcdVatDLSize * count, 0x20);
J3D_ASSERT_ALLOCMEM(211, mVcdVatCmdBuffer);
for (u32 i = 0; i < (J3DShape::kVcdVatDLSize * count) / 4; i++)
((u32*)mVcdVatCmdBuffer)[i] = 0;
+3 -3
View File
@@ -51,15 +51,15 @@ void JASDriver::initAI(void (*param_0)(void)) {
u32 dacSize = getDacSize();
const u32 size = dacSize * 2;
for (int i = 0; i < 3; i++) {
sDmaDacBuffer[i] = JKR_NEW_ARGS(JASDram, 0x20) s16[dacSize];
sDmaDacBuffer[i] = JKR_NEW_ARRAY_ARGS(s16, dacSize, JASDram, 0x20);
JUT_ASSERT(102, sDmaDacBuffer[i])
JASCalc::bzero(sDmaDacBuffer[i], size);
DCStoreRange(sDmaDacBuffer[i], size);
}
sDspDacBuffer = JKR_NEW_ARGS(JASDram, 0) s16*[data_804507A8];
sDspDacBuffer = JKR_NEW_ARRAY_ARGS(s16*, data_804507A8, JASDram, 0);
JUT_ASSERT(113, sDspDacBuffer);
for (int i = 0; i < data_804507A8; i++) {
sDspDacBuffer[i] = JKR_NEW_ARGS(JASDram, 0x20) s16[getDacSize()];
sDspDacBuffer[i] = JKR_NEW_ARRAY_ARGS(s16, getDacSize(), JASDram, 0x20);
JUT_ASSERT(119, sDspDacBuffer[i]);
JASCalc::bzero(sDspDacBuffer[i], size);
DCStoreRange(sDspDacBuffer[i], size);
+1 -1
View File
@@ -33,7 +33,7 @@ void JASAramStream::initSystem(u32 block_size, u32 channel_max) {
if (sLoadThread == NULL) {
sLoadThread = JASDvd::getThreadPointer();
}
sReadBuffer = JKR_NEW_ARGS (JASDram, 0x20) u8[(block_size + 0x20) * channel_max];
sReadBuffer = JKR_NEW_ARRAY_ARGS(u8, (block_size + 0x20) * channel_max, JASDram, 0x20);
JUT_ASSERT(79, sReadBuffer);
sBlockSize = block_size;
sChannelMax = channel_max;
+4 -4
View File
@@ -68,12 +68,12 @@ JASBasicBank* JASBNKParser::Ver1::createBasicBank(void const* stream, JKRHeap* h
TListChunk* list_chunk = (TListChunk*)findChunk(stream, 'LIST');
JUT_ASSERT(145, list_chunk);
u8* envt = JKR_NEW_ARGS (heap, 2) u8[envt_chunk->mSize];
u8* envt = JKR_NEW_ARRAY_ARGS(u8, envt_chunk->mSize, heap, 2);
JASCalc::bcopy(envt_chunk->mData, envt, envt_chunk->mSize);
BE(u32)* ptr = &osc_chunk->mCount;
u32 count = *ptr++;
JASOscillator::Data* osc_data = JKR_NEW_ARGS (heap, 0) JASOscillator::Data[count];
JASOscillator::Data* osc_data = JKR_NEW_ARRAY_ARGS(JASOscillator::Data, count, heap, 0);
for (int i = 0; i < count; i++, ptr += sizeof(TOsc) >> 2) {
TOsc* op = (TOsc*)ptr;
JUT_ASSERT(155, op->id == 'Osci');
@@ -209,7 +209,7 @@ JASBasicBank* JASBNKParser::Ver0::createBasicBank(void const* stream, JKRHeap* h
if (points != NULL) {
const JASOscillator::Point* endPtr = getOscTableEndPtr(points);
int size = endPtr - points;
JASOscillator::Point* table = JKR_NEW_ARGS (heap, 0) JASOscillator::Point[size];
JASOscillator::Point* table = JKR_NEW_ARRAY_ARGS(JASOscillator::Point, size, heap, 0);
JUT_ASSERT(396, table != NULL);
JASCalc::bcopy(points, table, size * sizeof(JASOscillator::Point));
osc->mTable = table;
@@ -221,7 +221,7 @@ JASBasicBank* JASBNKParser::Ver0::createBasicBank(void const* stream, JKRHeap* h
if (points != NULL) {
const JASOscillator::Point* endPtr = getOscTableEndPtr(points);
int size = endPtr - points;
JASOscillator::Point* table = JKR_NEW_ARGS (heap, 0) JASOscillator::Point[size];
JASOscillator::Point* table = JKR_NEW_ARRAY_ARGS(JASOscillator::Point, size, heap, 0);
JUT_ASSERT(409, table != NULL);
JASCalc::bcopy(points, table, size * sizeof(JASOscillator::Point));
osc->rel_table = table;
+1 -1
View File
@@ -12,7 +12,7 @@ void JASBasicBank::newInstTable(u8 num, JKRHeap* heap) {
if (num != 0) {
JUT_ASSERT(31, num <= JASBank::PRG_OSC);
mInstNumMax = num;
mInstTable = JKR_NEW_ARGS (heap, 0) JASInst*[mInstNumMax];
mInstTable = JKR_NEW_ARRAY_ARGS(JASInst*, mInstNumMax, heap, 0);
JASCalc::bzero(mInstTable, mInstNumMax * 4);
}
}
+1 -1
View File
@@ -49,7 +49,7 @@ bool JASBasicInst::getParam(int param_0, int param_1, JASInstParam* param_2) con
void JASBasicInst::setKeyRegionCount(u32 count, JKRHeap* param_1) {
JKR_DELETE_ARRAY(mKeymap);
mKeymap = JKR_NEW_ARGS (param_1, 0) TKeymap[count];
mKeymap = JKR_NEW_ARRAY_ARGS(TKeymap, count, param_1, 0);
JUT_ASSERT(114, mKeymap != NULL);
mKeymapCount = count;
}
@@ -29,7 +29,7 @@ JASBasicWaveBank::TWaveGroup* JASBasicWaveBank::getWaveGroup(u32 param_0) {
void JASBasicWaveBank::setGroupCount(u32 param_0, JKRHeap* param_1) {
JKR_DELETE_ARRAY(mWaveGroupArray);
mGroupCount = param_0;
mWaveGroupArray = JKR_NEW_ARGS(param_1, 0) TWaveGroup[param_0];
mWaveGroupArray = JKR_NEW_ARRAY_ARGS(TWaveGroup, param_0, param_1, 0);
JUT_ASSERT(62, mWaveGroupArray != NULL);
for (int i = 0; i < mGroupCount; i++) {
mWaveGroupArray[i].mBank = this;
@@ -38,7 +38,7 @@ void JASBasicWaveBank::setGroupCount(u32 param_0, JKRHeap* param_1) {
void JASBasicWaveBank::setWaveTableSize(u32 param_0, JKRHeap* param_1) {
JKR_DELETE_ARRAY(mWaveTable);
mWaveTable = JKR_NEW_ARGS(param_1, 0) TWaveHandle[param_0];
mWaveTable = JKR_NEW_ARRAY_ARGS(TWaveHandle, param_0, param_1, 0);
JUT_ASSERT(92, mWaveTable != NULL);
mHandleCount = param_0;
}
@@ -104,7 +104,7 @@ JASBasicWaveBank::TWaveGroup::~TWaveGroup() {
void JASBasicWaveBank::TWaveGroup::setWaveCount(u32 param_0, JKRHeap* param_1) {
JKR_DELETE_ARRAY(mCtrlWaveArray);
mWaveCount = param_0;
mCtrlWaveArray = JKR_NEW_ARGS(param_1, 0) TGroupWaveInfo[param_0];
mCtrlWaveArray = JKR_NEW_ARRAY_ARGS(TGroupWaveInfo, param_0, param_1, 0);
JUT_ASSERT(255, mCtrlWaveArray != NULL);
}
+1 -1
View File
@@ -42,7 +42,7 @@ void JASDSPChannel::drop() {
}
void JASDSPChannel::initAll() {
sDspChannels = JKR_NEW_ARGS (JASDram, 0x20) JASDSPChannel[0x40];
sDspChannels = JKR_NEW_ARRAY_ARGS(JASDSPChannel, 0x40, JASDram, 0x20);
JUT_ASSERT(102, sDspChannels);
for (int i = 0; i < 0x40; i++) {
sDspChannels[i].mChannel = JASDsp::getDSPHandle(i);
+2 -2
View File
@@ -426,9 +426,9 @@ u32 const ATTRIBUTE_ALIGN(32) JASDsp::DSPRES_FILTER[320] = {
};
void JASDsp::initBuffer() {
CH_BUF = JKR_NEW_ARGS(JASDram, 0x20) TChannel[64];
CH_BUF = JKR_NEW_ARRAY_ARGS(TChannel, 64, JASDram, 0x20);
JUT_ASSERT(354, CH_BUF);
FX_BUF = JKR_NEW_ARGS(JASDram, 0x20) FxBuf[4];
FX_BUF = JKR_NEW_ARRAY_ARGS(FxBuf, 4, JASDram, 0x20);
JUT_ASSERT(356, FX_BUF);
JASCalc::bzero(CH_BUF, 0x6000);
JASCalc::bzero(FX_BUF, sizeof(FxBuf) * 4);
+1 -1
View File
@@ -17,7 +17,7 @@ void JASDrumSet::newPercArray(u8 num, JKRHeap* heap) {
if (num) {
JUT_ASSERT(39, num <= 128);
mPercNumMax = num;
mPercArray = JKR_NEW_ARGS (heap, 0) TPerc*[mPercNumMax];
mPercArray = JKR_NEW_ARRAY_ARGS(TPerc*, mPercNumMax, heap, 0);
JASCalc::bzero(mPercArray, mPercNumMax * sizeof(TPerc*));
}
}
+1 -1
View File
@@ -258,7 +258,7 @@ void JASGenericMemPool::newMemPool(u32 n, int param_1) {
JUT_ASSERT(734, n >= sizeof(TNextOnFreeList));
void* runner;
for (int i = 0; i < param_1; i++) {
runner = JKR_NEW_ARGS (JASDram, 0) u8[n];
runner = JKR_NEW_ARRAY_ARGS(u8, n, JASDram, 0);
JUT_ASSERT(739, runner);
*(void**)runner = field_0x0;
field_0x0 = runner;
+1 -1
View File
@@ -28,7 +28,7 @@ void JASReportInit(JKRHeap* heap, int lineMax) {
JUT_ASSERT(35, heap != NULL);
OSInitMutex(&sMutex);
sLineMax = lineMax;
sBuffer = JKR_NEW_ARGS (heap, 0) char[sLineMax * 64];
sBuffer = JKR_NEW_ARRAY_ARGS(char, sLineMax * 64, heap, 0);
JUT_ASSERT(41, sBuffer);
}
@@ -14,7 +14,7 @@ JASSimpleWaveBank::~JASSimpleWaveBank() {
void JASSimpleWaveBank::setWaveTableSize(u32 size, JKRHeap* heap) {
JKR_DELETE_ARRAY(mWaveTable);
mWaveTable = JKR_NEW_ARGS (heap, 0) TWaveHandle[size];
mWaveTable = JKR_NEW_ARRAY_ARGS(TWaveHandle, size, heap, 0);
JUT_ASSERT(29, mWaveTable != NULL);
mWaveTableSize = size;
}
@@ -168,7 +168,7 @@ void JASWaveArc::setFileName(char const* fileName) {
char* currentDir = JASWaveArcLoader::getCurrentDir();
size_t length = strlen(currentDir);
length = length + strlen(fileName);
char* path = JKR_NEW_ARGS (JASKernel::getSystemHeap(), -4) char[length + 1];
char* path = JKR_NEW_ARRAY_ARGS(char, length + 1, JASKernel::getSystemHeap(), -4);
JUT_ASSERT(322, path);
strcpy(path, currentDir);
strcat(path, fileName);
+5 -5
View File
@@ -38,7 +38,7 @@ namespace {
return;
}
mNumStreamFiles = stack_14.getNumFiles();
mStreamFileDVDEntryNums = JKR_NEW s32[mNumStreamFiles];
mStreamFileDVDEntryNums = JKR_NEW_ARRAY(s32, mNumStreamFiles);
if (!mStreamFileDVDEntryNums) {
mNumStreamFiles = 0;
return;
@@ -228,7 +228,7 @@ u8* JAUSection::newStaticSeqDataBlock_(JAISoundID param_0, u32 size) {
JUT_WARN(432, "%s", "created UNUSED object in Heap\n");
return NULL;
}
u8* r28 = JKR_NEW_ARGS(0x20) u8[size];
u8* r28 = JKR_NEW_ARRAY_ARGS(u8, size, 0x20);
if (!r28) {
JUT_WARN(438, "%s", "created UNUSED object in Heap\n");
return NULL;
@@ -277,7 +277,7 @@ bool JAUSection::newStaticSeqData(JAISoundID param_0) {
void* JAUSection::newCopy(void const* param_0, u32 param_1, s32 param_2) {
JUT_ASSERT(516, isOpen());
JUT_ASSERT(517, isBuilding());
u8* r31 = JKR_NEW_ARGS(getHeap_(), param_2) u8[param_1];
u8* r31 = JKR_NEW_ARRAY_ARGS(u8, param_1, getHeap_(), param_2);
if (r31) {
memcpy(r31, param_0, param_1);
}
@@ -382,7 +382,7 @@ bool JAUSection::beginNewBankTable(u32 param_0, u32 param_1) {
JAUBankTableLink* bankTableLink = NULL;
{
TPushCurrentHeap push(getHeap_());
JASBank** r26 = JKR_NEW JASBank*[param_1];
JASBank** r26 = JKR_NEW_ARRAY(JASBank*, param_1);
if (r26) {
bankTableLink = JKR_NEW JAUBankTableLink(param_0, r26, param_1);
if (bankTableLink) {
@@ -489,7 +489,7 @@ bool JAUSectionHeap::newDynamicSeqBlock(u32 size) {
JUT_WARN(950, "%s", "created UNUSED object in Heap\n");
return false;
}
u8* r25 = JKR_NEW_ARGS(0x20) u8[size];
u8* r25 = JKR_NEW_ARRAY_ARGS(u8, size, 0x20);
if (!r25) {
JUT_WARN(956, "%s", "created UNUSED object in Heap\n");
return false;
+1 -1
View File
@@ -40,7 +40,7 @@ void JHIMccBuf::init() {
if (mTempBuf != NULL) {
initBuf();
} else {
mTempBuf = JKR_NEW_ARGS (32) u8[0x18000];
mTempBuf = JKR_NEW_ARRAY_ARGS(u8, 0x18000, 32);
if (mTempBuf == NULL) {
JHIHalt("ERROR: JHIMccBuf cannot alloc temp buf.\n");
} else {
+1 -1
View File
@@ -11,7 +11,7 @@
int JHIMemBuf::create() {
int rt = 1;
if (mp_buffer == NULL) {
mp_buffer = JKR_NEW_ARGS (32) u8[0x20000];
mp_buffer = JKR_NEW_ARRAY_ARGS(u8, 0x20000, 32);
if (mp_buffer == NULL) {
rt = 0;
+2 -2
View File
@@ -35,8 +35,8 @@ BOOL JHIInit(u32 enabled) {
OS_REPORT("INFO: *** Disable JHostIO ***\n");
}
gsReadBuf = JKR_NEW_ARGS (32) u8[0xC000];
gsWriteBuf = JKR_NEW_ARGS (32) u8[0xC000];
gsReadBuf = JKR_NEW_ARRAY_ARGS(u8, 0xC000, 32);
gsWriteBuf = JKR_NEW_ARRAY_ARGS(u8, 0xC000, 32);
if (gsReadBuf == NULL || gsWriteBuf == NULL) {
gsEnableInterface = FALSE;
+6 -14
View File
@@ -593,12 +593,8 @@ void* operator new[](size_t size) {
return JKRHeap::alloc(size, 4, NULL);
}
#else
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM) {
void* mem = JKRHeap::alloc(size, alignof(max_align_t), NULL);
if (mem == NULL) {
return fallback_alloc(size, 0, true);
}
return mem;
void* operator new[](size_t JKR_HEAP_TOKEN_PARAM) {
OSPanic(__FILE__, __LINE__, "Allocation should go through JKR_NEW_ARRAY instead");
}
#endif
@@ -607,17 +603,13 @@ void* operator new[](size_t size, int alignment) {
return JKRHeap::alloc(size, alignment, NULL);
}
#else
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, int alignment) {
void* mem = JKRHeap::alloc(size, alignment, nullptr);
if (mem == nullptr) {
return fallback_alloc(size, 0, true);
}
return mem;
void* operator new[](size_t JKR_HEAP_TOKEN_PARAM, int) {
OSPanic(__FILE__, __LINE__, "Allocation should go through JKR_NEW_ARRAY instead");
}
#endif
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment) {
return JKRHeap::alloc(size, alignment, heap);
void* operator new[](size_t JKR_HEAP_TOKEN_PARAM, JKRHeap*, int) {
OSPanic(__FILE__, __LINE__, "Allocation should go through JKR_NEW_ARRAY instead");
}
#if !TARGET_PC
+1 -1
View File
@@ -121,7 +121,7 @@ void JMessage::TResourceContainer::TCResource::Do_destroy(JMessage::TResource* p
#if DEBUG
JKR_DELETE(pResource);
#else
operator delete(pResource);
operator delete(pResource JKR_HEAP_TOKEN);
#endif
}
@@ -17,19 +17,19 @@ JPAEmitterManager::JPAEmitterManager(u32 i_ptclNum, u32 i_emtrNum, JKRHeap* pHea
JUT_ASSERT(40, emtrNum && ptclNum && gidMax && ridMax);
JPABaseEmitter* p_emtr_link = JKR_NEW_ARGS (pHeap, 0) JPABaseEmitter[emtrNum];
JPABaseEmitter* p_emtr_link = JKR_NEW_ARRAY_ARGS(JPABaseEmitter, emtrNum, pHeap, 0);
JUT_ASSERT(44, p_emtr_link);
for (u32 i = 0; i < emtrNum; i++)
mFreeEmtrList.prepend(&p_emtr_link[i].mLink);
JPANode<JPABaseParticle>* p_ptcl_node = JKR_NEW_ARGS (pHeap, 0) JPANode<JPABaseParticle>[ptclNum];
JPANode<JPABaseParticle>* p_ptcl_node = JKR_NEW_ARRAY_ARGS(JPANode<JPABaseParticle>, ptclNum, pHeap, 0);
JUT_ASSERT(51, p_ptcl_node);
for (u32 i = 0; i < ptclNum; i++)
mPtclPool.push_back(&p_ptcl_node[i]);
pEmtrUseList = JKR_NEW_ARGS (pHeap, 0) JSUList<JPABaseEmitter>[gidMax];
pEmtrUseList = JKR_NEW_ARRAY_ARGS(JSUList<JPABaseEmitter>, gidMax, pHeap, 0);
JUT_ASSERT(58, pEmtrUseList);
pResMgrAry = JKR_NEW_ARGS (pHeap, 0) JPAResourceManager*[ridMax];
pResMgrAry = JKR_NEW_ARRAY_ARGS(JPAResourceManager*, ridMax, pHeap, 0);
JUT_ASSERT(62, pResMgrAry)
for (int i = 0; i < ridMax; i++) {
pResMgrAry[i] = NULL;
@@ -54,8 +54,8 @@ void JPAResourceLoader::load_jpc(u8 const* data, JPAResourceManager* p_res_mgr)
JKRHeap* heap = p_res_mgr->mpHeap;
p_res_mgr->resMaxNum = *(BE(u16)*)(data + 8);
p_res_mgr->texMaxNum = *(BE(u16)*)(data + 0xA);
p_res_mgr->pResAry = JKR_NEW_ARGS (heap, 0) JPAResource*[p_res_mgr->resMaxNum];
p_res_mgr->pTexAry = JKR_NEW_ARGS (heap, 0) JPATexture*[p_res_mgr->texMaxNum];
p_res_mgr->pResAry = JKR_NEW_ARRAY_ARGS(JPAResource*, p_res_mgr->resMaxNum, heap, 0);
p_res_mgr->pTexAry = JKR_NEW_ARRAY_ARGS(JPATexture*, p_res_mgr->texMaxNum, heap, 0);
JUT_ASSERT(199, (p_res_mgr->pResAry != NULL) && (p_res_mgr->pTexAry != 0));
u32 offset = 0x10;
@@ -65,11 +65,11 @@ void JPAResourceLoader::load_jpc(u8 const* data, JPAResourceManager* p_res_mgr)
JUT_ASSERT(211, p_res != NULL);
p_res->fldNum = header->mFieldBlockNum;
p_res->ppFld = p_res->fldNum != 0 ?
JKR_NEW_ARGS (heap, 0) JPAFieldBlock*[p_res->fldNum] : NULL;
JKR_NEW_ARRAY_ARGS(JPAFieldBlock*, p_res->fldNum, heap, 0) : NULL;
JUT_ASSERT(216, (p_res->ppFld != NULL) || (p_res->fldNum == 0));
p_res->keyNum = header->mKeyBlockNum;
p_res->ppKey = p_res->keyNum != 0 ?
JKR_NEW_ARGS (heap, 0) JPAKeyBlock*[p_res->keyNum] : NULL;
JKR_NEW_ARRAY_ARGS(JPAKeyBlock*, p_res->keyNum, heap, 0) : NULL;
JUT_ASSERT(221, (p_res->ppKey != NULL) || (p_res->keyNum == 0));
p_res->texNum = header->mTDB1Num;
p_res->mpTDB1 = NULL;
+8 -8
View File
@@ -178,14 +178,14 @@ bool JUTCacheFont::allocArea(void* cacheBuffer, u32 param_1, JKRHeap* heap) {
}
if (mTotalWidSize != 0) {
field_0x7c = JKR_NEW_ARGS (heap, 0) u8[mTotalWidSize];
field_0x7c = JKR_NEW_ARRAY_ARGS(u8, mTotalWidSize, heap, 0);
if (field_0x7c == NULL) {
return false;
}
}
if (mGly1BlockNum != 0) {
field_0x80 = JKR_NEW_ARGS (heap, 0) u8[mGly1BlockNum * sizeof(ResFONT::GLY1)];
field_0x80 = JKR_NEW_ARRAY_ARGS(u8, mGly1BlockNum * sizeof(ResFONT::GLY1), heap, 0);
if (field_0x80 == NULL) {
return false;
}
@@ -197,7 +197,7 @@ bool JUTCacheFont::allocArea(void* cacheBuffer, u32 param_1, JKRHeap* heap) {
}
if (mTotalMapSize != 0) {
field_0x84 = JKR_NEW_ARGS (heap, 0) u8[mTotalMapSize];
field_0x84 = JKR_NEW_ARRAY_ARGS(u8, mTotalMapSize, heap, 0);
if (field_0x84 == NULL) {
return false;
}
@@ -215,7 +215,7 @@ bool JUTCacheFont::allocArea(void* cacheBuffer, u32 param_1, JKRHeap* heap) {
mCacheBuffer = cacheBuffer;
field_0xb0 = 0;
} else {
mCacheBuffer = JKR_NEW_ARGS (heap, 0x20) u8[v1];
mCacheBuffer = JKR_NEW_ARRAY_ARGS(u8, v1, heap, 0x20);
if (mCacheBuffer == NULL) {
return false;
}
@@ -227,25 +227,25 @@ bool JUTCacheFont::allocArea(void* cacheBuffer, u32 param_1, JKRHeap* heap) {
}
bool JUTCacheFont::allocArray(JKRHeap* param_0) {
mMemBlocks = (void**)JKR_NEW_ARGS (param_0, 0) uintptr_t[mWid1BlockNum + mGly1BlockNum + mMap1BlockNum];
mMemBlocks = (void**)JKR_NEW_ARRAY_ARGS(uintptr_t, mWid1BlockNum + mGly1BlockNum + mMap1BlockNum, param_0, 0);
if (mMemBlocks == NULL) {
return false;
}
void** blocks = mMemBlocks;
if (mWid1BlockNum) {
mpWidthBlocks = JKR_NEW_ARGS (blocks) ResFONT::WID1*[mWid1BlockNum];
mpWidthBlocks = JKR_NEW_ARRAY_ARGS(ResFONT::WID1*, mWid1BlockNum, blocks);
blocks = blocks + mWid1BlockNum;
}
if (mGly1BlockNum) {
mpGlyphBlocks = JKR_NEW_ARGS (blocks) ResFONT::GLY1*[mGly1BlockNum];
mpGlyphBlocks = JKR_NEW_ARRAY_ARGS(ResFONT::GLY1*, mGly1BlockNum, blocks);
blocks = blocks + mGly1BlockNum;
for (int i = 0; i < mGly1BlockNum; i++) {
mpGlyphBlocks[i] = (ResFONT::GLY1*)((u8*)mCacheBuffer + (field_0x94 * i));
}
}
if (mMap1BlockNum) {
mpMapBlocks = JKR_NEW_ARGS (blocks) ResFONT::MAP1*[mMap1BlockNum];
mpMapBlocks = JKR_NEW_ARRAY_ARGS(ResFONT::MAP1*, mMap1BlockNum, blocks);
}
return true;
}
+4 -4
View File
@@ -62,22 +62,22 @@ bool JUTResFont::protected_initiate(const ResFONT* pFont, JKRHeap* pHeap) {
mValid = true;
countBlock();
mMemBlocks = JKR_NEW_ARGS (pHeap, 0) void*[mWid1BlockNum + mGly1BlockNum + mMap1BlockNum];
mMemBlocks = JKR_NEW_ARRAY_ARGS(void*, mWid1BlockNum + mGly1BlockNum + mMap1BlockNum, pHeap, 0);
if (!mMemBlocks) {
return false;
}
p = mMemBlocks;
if (mWid1BlockNum != 0) {
mpWidthBlocks = JKR_NEW_ARGS (p) ResFONT::WID1*[mWid1BlockNum];
mpWidthBlocks = JKR_NEW_ARRAY_ARGS(ResFONT::WID1*, mWid1BlockNum, p);
p += mWid1BlockNum;
}
if (mGly1BlockNum != 0) {
mpGlyphBlocks = JKR_NEW_ARGS (p) ResFONT::GLY1*[mGly1BlockNum];
mpGlyphBlocks = JKR_NEW_ARRAY_ARGS(ResFONT::GLY1*, mGly1BlockNum, p);
p += mGly1BlockNum;
}
if (mMap1BlockNum != 0) {
mpMapBlocks = JKR_NEW_ARGS (p) ResFONT::MAP1*[mMap1BlockNum];
mpMapBlocks = JKR_NEW_ARRAY_ARGS(ResFONT::MAP1*, mMap1BlockNum, p);
}
setBlock();
return true;
+3 -3
View File
@@ -69,11 +69,11 @@ void JUTXfb::initiate(u16 width, u16 height, JKRHeap* pHeap, JUTXfb::EXfbNumber
int size = (u16)((u16)width + 0xf & ~0xf) * height * 2;
mBuffer[0] = JKR_NEW_ARGS (pHeap, 0x20) u8[size];
mBuffer[0] = JKR_NEW_ARRAY_ARGS(u8, size, pHeap, 0x20);
mXfbAllocated[0] = true;
if (xfbNum >= 2) {
mBuffer[1] = JKR_NEW_ARGS (pHeap, 0x20) u8[size];
mBuffer[1] = JKR_NEW_ARRAY_ARGS(u8, size, pHeap, 0x20);
mXfbAllocated[1] = true;
} else {
mBuffer[1] = NULL;
@@ -81,7 +81,7 @@ void JUTXfb::initiate(u16 width, u16 height, JKRHeap* pHeap, JUTXfb::EXfbNumber
}
if (xfbNum >= 3) {
mBuffer[2] = JKR_NEW_ARGS (pHeap, 0x20) u8[size];
mBuffer[2] = JKR_NEW_ARRAY_ARGS(u8, size, pHeap, 0x20);
mXfbAllocated[2] = true;
} else {
mBuffer[2] = NULL;
+1 -1
View File
@@ -8,7 +8,7 @@
SpkMixingBuffer::SpkMixingBuffer(JKRHeap* heap) {
JUT_ASSERT(25, heap);
for (s32 chan = 0; chan < ARRAY_SIZE(mBuffer); chan++) {
mBuffer[chan] = JKR_NEW_ARGS (heap, 0) s16[cSamplesPerAudioPacket];
mBuffer[chan] = JKR_NEW_ARRAY_ARGS(s16, cSamplesPerAudioPacket, heap, 0);
JUT_ASSERT(29, mBuffer[chan]);
bzeroBuffer(chan);
}
+1 -1
View File
@@ -21,7 +21,7 @@ int Z2AudioCS::init(JKRHeap* heap, JKRArchive* res, s32 param_2, s32 param_3) {
SpkSystem* spkSys = JKR_NEW_ARGS(heap, 0) SpkSystem(heap);
JUT_ASSERT(67, spkSys);
sSpkHandles = JKR_NEW_ARGS (heap, 0) SpkSoundHandle[HANDLES_MAX];
sSpkHandles = JKR_NEW_ARRAY_ARGS(SpkSoundHandle, HANDLES_MAX, heap, 0);
JUT_ASSERT(71, sSpkHandles);
spkSys->setResource(res, 2, 3);
+1 -1
View File
@@ -56,7 +56,7 @@ void Z2AudioArcLoader::readBSTN(const void* addr, u32 param_1) {
u8* bstnDst = (u8*)addr;
if (param_1 != 0) {
bstnDst = JKR_NEW_ARGS (gameHeap, 4) u8[param_1];
bstnDst = JKR_NEW_ARRAY_ARGS(u8, param_1, gameHeap, 4);
if (bstnDst != NULL) {
memcpy(bstnDst, addr, param_1);
}
+5 -5
View File
@@ -21,10 +21,10 @@ void Z2FxLineMgr::initDataArc(JKRArchive* arc, JKRHeap* heap) {
JUT_ASSERT(44, arc);
JUT_ASSERT(45, heap);
mFxLineBuffer[0] = JKR_NEW_ARGS (heap, 0x20) u8[0x2800];
mFxLineBuffer[1] = JKR_NEW_ARGS (heap, 0x20) u8[0x2800];
mFxLineBuffer[2] = JKR_NEW_ARGS (heap, 0x20) u8[0x4B00];
mFxLineBuffer[3] = JKR_NEW_ARGS (heap, 0x20) u8[0x4B00];
mFxLineBuffer[0] = JKR_NEW_ARRAY_ARGS(u8, 0x2800, heap, 0x20);
mFxLineBuffer[1] = JKR_NEW_ARRAY_ARGS(u8, 0x2800, heap, 0x20);
mFxLineBuffer[2] = JKR_NEW_ARRAY_ARGS(u8, 0x4B00, heap, 0x20);
mFxLineBuffer[3] = JKR_NEW_ARRAY_ARGS(u8, 0x4B00, heap, 0x20);
JUT_ASSERT(53, mFxLineBuffer[0]);
JUT_ASSERT(54, mFxLineBuffer[1]);
@@ -32,7 +32,7 @@ void Z2FxLineMgr::initDataArc(JKRArchive* arc, JKRHeap* heap) {
JUT_ASSERT(56, mFxLineBuffer[3]);
mFxDataNum = arc->countResource();
mConfig = JKR_NEW_ARGS (heap, 0) Z2FxLineConfig[mFxDataNum];
mConfig = JKR_NEW_ARRAY_ARGS(Z2FxLineConfig, mFxDataNum, heap, 0);
for (u8 i = 0; i < mFxDataNum; i++) {
void* res = arc->getResource(i);
+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;
}
-6
View File
@@ -17,13 +17,7 @@
s32 mDoDvdThd::main(void* param_0) {
JKRThread(OSGetCurrentThread(), 0);
#if TARGET_PC
// Disable assert heap, our DVD impl does allocs
// Can be turned back if we isolate the OS impl from game code properly.
JKRSetCurrentHeap(JKRHeap::getSystemHeap());
#else
JKRSetCurrentHeap(mDoExt_getAssertHeap());
#endif
mDoDvdThd_param_c* param = static_cast<mDoDvdThd_param_c*>(param_0);
param->mainLoop();
return 0;
+17 -17
View File
@@ -505,7 +505,7 @@ static void dummy2() {
int mDoExt_invisibleModel::create(J3DModel* i_model, u8 param_1) {
J3DModelData* model_data = i_model->getModelData();
mpPackets = JKR_NEW mDoExt_invJntPacket[model_data->getJointNum()];
mpPackets = JKR_NEW_ARRAY(mDoExt_invJntPacket, model_data->getJointNum());
if (mpPackets == NULL) {
return 0;
}
@@ -1327,11 +1327,11 @@ int mDoExt_McaMorf::create(J3DModelData* modelData, mDoExt_McaMorfCallBack1_c* c
}
setAnm(anmTransform, param_4, 0.0f, param_5, param_6, param_7, param_9);
mPrevMorf = -1.0f;
mpTransformInfo = JKR_NEW J3DTransformInfo[modelData->getJointNum()];
mpTransformInfo = JKR_NEW_ARRAY(J3DTransformInfo, modelData->getJointNum());
if (!mpTransformInfo) {
goto cleanup;
}
mpQuat = JKR_NEW Quaternion[modelData->getJointNum()];
mpQuat = JKR_NEW_ARRAY(Quaternion, modelData->getJointNum());
if (mpQuat) {
J3DTransformInfo* info = mpTransformInfo;
Quaternion* quat = mpQuat;
@@ -1578,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 = JKR_NEW J3DTransformInfo[i_modelData->getJointNum()];
mpTransformInfo = JKR_NEW_ARRAY(J3DTransformInfo, i_modelData->getJointNum());
if (mpTransformInfo != NULL) {
mpQuat = JKR_NEW Quaternion[i_modelData->getJointNum()];
mpQuat = JKR_NEW_ARRAY(Quaternion, i_modelData->getJointNum());
if (mpQuat != NULL) {
J3DTransformInfo* transInfo_p = mpTransformInfo;
@@ -1866,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 = JKR_NEW J3DTransformInfo[param_0->getJointNum()];
mpTransformInfo = JKR_NEW_ARRAY(J3DTransformInfo, param_0->getJointNum());
if (mpTransformInfo == NULL) {
ERROR_EXIT();
return 0;
}
mpQuat = JKR_NEW Quaternion[param_0->getJointNum()];
mpQuat = JKR_NEW_ARRAY(Quaternion, param_0->getJointNum());
if (mpQuat == NULL) {
ERROR_EXIT();
return 0;
@@ -2261,13 +2261,13 @@ void mDoExt_invJntPacket::draw() {
}
int mDoExt_3Dline_c::init(u16 param_0, int param_1, BOOL param_2) {
field_0x0 = JKR_NEW cXyz[param_0];
field_0x0 = JKR_NEW_ARRAY(cXyz, param_0);
if (field_0x0 == NULL) {
return 0;
}
if (param_1 != 0) {
field_0x4 = JKR_NEW f32[param_0];
field_0x4 = JKR_NEW_ARRAY(f32, param_0);
if (field_0x4 == NULL) {
return 0;
}
@@ -2277,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] = JKR_NEW cXyz[sp20];
field_0x8[0] = JKR_NEW_ARRAY(cXyz, sp20);
if (field_0x8 == NULL) {
return 0;
}
field_0x8[1] = JKR_NEW cXyz[sp20];
field_0x8[1] = JKR_NEW_ARRAY(cXyz, sp20);
if (field_0x8[1] == NULL) {
return 0;
}
field_0x10[0] = JKR_NEW mDoExt_3Dline_field_0x10_c[sp20];
field_0x10[0] = JKR_NEW_ARRAY(mDoExt_3Dline_field_0x10_c, sp20);
if (field_0x10 == NULL) {
return 0;
}
field_0x10[1] = JKR_NEW mDoExt_3Dline_field_0x10_c[sp20];
field_0x10[1] = JKR_NEW_ARRAY(mDoExt_3Dline_field_0x10_c, sp20);
if (field_0x10[1] == NULL) {
return 0;
}
if (param_2) {
field_0x18[0] = JKR_NEW cXy[sp20];
field_0x18[0] = JKR_NEW_ARRAY(cXy, sp20);
if (field_0x18[0] == NULL) {
return 0;
}
field_0x18[1] = JKR_NEW cXy[sp20];
field_0x18[1] = JKR_NEW_ARRAY(cXy, sp20);
if (field_0x18[1] == NULL) {
return 0;
}
@@ -2329,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 = JKR_NEW mDoExt_3Dline_c[param_0];
field_0x18 = JKR_NEW_ARRAY(mDoExt_3Dline_c, param_0);
if (field_0x18 == NULL) {
return 0;
}
@@ -2635,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 = JKR_NEW mDoExt_3Dline_c[param_0];
mpLines = JKR_NEW_ARRAY(mDoExt_3Dline_c, param_0);
if (mpLines == NULL) {
return 0;
}
+44 -43
View File
@@ -36,6 +36,7 @@
#include <cstring>
#include "dusk/endian.h"
#include "dusk/logging.h"
#include "dusk/gx_helper.h"
#if PLATFORM_WII || PLATFORM_SHIELD
#include <revolution/sc.h>
@@ -1602,7 +1603,7 @@ int mDoGph_Painter() {
fapGm_HIO_c::startCpuTimer();
#endif
dComIfGd_imageDrawShadow(camera_p->view.viewMtx);
GX_DEBUG_GROUP(dComIfGd_imageDrawShadow, camera_p->view.viewMtx);
#if DEBUG
// "drawing Shadow Texture (Rendering)"
@@ -1675,8 +1676,8 @@ int mDoGph_Painter() {
j3dSys.setViewMtx(camera_p->view.viewMtx);
dKy_setLight();
dComIfGd_drawOpaListSky();
dComIfGd_drawXluListSky();
GX_DEBUG_GROUP(dComIfGd_drawOpaListSky);
GX_DEBUG_GROUP(dComIfGd_drawXluListSky);
GXSetClipMode(GX_CLIP_ENABLE);
@@ -1687,16 +1688,16 @@ int mDoGph_Painter() {
fapGm_HIO_c::startCpuTimer();
#endif
dComIfGd_drawOpaListBG();
dComIfGd_drawOpaListDarkBG();
dComIfGd_drawOpaListMiddle();
GX_DEBUG_GROUP(dComIfGd_drawOpaListBG);
GX_DEBUG_GROUP(dComIfGd_drawOpaListDarkBG);
GX_DEBUG_GROUP(dComIfGd_drawOpaListMiddle);
if (fapGmHIO_getParticle()) {
dComIfGp_particle_drawFogPri0_B(&draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawFogPri0_B, &draw_info);
}
if (fapGmHIO_getParticle()) {
dComIfGp_particle_drawNormalPri0_B(&draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawNormalPri0_B, &draw_info);
}
#if DEBUG
@@ -1706,7 +1707,7 @@ int mDoGph_Painter() {
fapGm_HIO_c::startCpuTimer();
#endif
dComIfGd_drawShadow(camera_p->view.viewMtx);
GX_DEBUG_GROUP(dComIfGd_drawShadow, camera_p->view.viewMtx);
#if DEBUG
// "shadow drawing (Rendering)"
@@ -1715,17 +1716,17 @@ int mDoGph_Painter() {
fapGm_HIO_c::startCpuTimer();
#endif
dComIfGd_drawOpaList();
GX_DEBUG_GROUP(dComIfGd_drawOpaList);
if (DEBUG && g_kankyoHIO.navy.field_0x30d) {
if (dKy_darkworld_check() != TRUE) {
dComIfGd_drawOpaListDark();
GX_DEBUG_GROUP(dComIfGd_drawOpaListDark);
}
} else {
dComIfGd_drawOpaListDark();
GX_DEBUG_GROUP(dComIfGd_drawOpaListDark);
}
dComIfGd_drawOpaListPacket();
GX_DEBUG_GROUP(dComIfGd_drawOpaListPacket);
#if DEBUG
// "drawing up to special-use drawing (Opaque) except J3D (Rendering)"
@@ -1734,12 +1735,12 @@ int mDoGph_Painter() {
fapGm_HIO_c::startCpuTimer();
#endif
dComIfGd_drawXluListBG();
dComIfGd_drawXluListDarkBG();
GX_DEBUG_GROUP(dComIfGd_drawXluListBG);
GX_DEBUG_GROUP(dComIfGd_drawXluListDarkBG);
if (fapGmHIO_getParticle()) {
dComIfGp_particle_drawFogPri0_A(&draw_info);
dComIfGp_particle_drawNormalPri0_A(&draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawFogPri0_A, &draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawNormalPri0_A, &draw_info);
}
#if DEBUG
@@ -1749,14 +1750,14 @@ int mDoGph_Painter() {
fapGm_HIO_c::startCpuTimer();
#endif
dComIfGd_drawXluList();
GX_DEBUG_GROUP(dComIfGd_drawXluList);
if (DEBUG && g_kankyoHIO.navy.field_0x30d) {
if (dKy_darkworld_check() != TRUE) {
dComIfGd_drawXluListDark();
GX_DEBUG_GROUP(dComIfGd_drawXluListDark);
}
} else {
dComIfGd_drawXluListDark();
GX_DEBUG_GROUP(dComIfGd_drawXluListDark);
}
#if DEBUG
@@ -1781,7 +1782,7 @@ int mDoGph_Painter() {
fapGm_HIO_c::startCpuTimer();
#endif
motionBlure(&camera_p->view);
GX_DEBUG_GROUP(motionBlure, &camera_p->view);
#if DEBUG
// "blur filter (Rendering)"
@@ -1790,7 +1791,7 @@ int mDoGph_Painter() {
fapGm_HIO_c::startCpuTimer();
#endif
drawDepth2(&camera_p->view, view_port, dComIfGp_getCameraZoomForcus(camera_id));
GX_DEBUG_GROUP(drawDepth2, &camera_p->view, view_port, dComIfGp_getCameraZoomForcus(camera_id));
GXInvalidateTexAll();
GXSetClipMode(GX_CLIP_ENABLE);
@@ -1804,8 +1805,8 @@ int mDoGph_Painter() {
if (!(DEBUG && g_kankyoHIO.navy.field_0x30d != 0 &&
dKy_darkworld_check() == TRUE)) {
if (g_env_light.is_blure == 0) {
dComIfGd_drawOpaListInvisible();
dComIfGd_drawXluListInvisible();
GX_DEBUG_GROUP(dComIfGd_drawOpaListInvisible);
GX_DEBUG_GROUP(dComIfGd_drawXluListInvisible);
}
}
@@ -1818,8 +1819,8 @@ int mDoGph_Painter() {
#endif
if (fapGmHIO_getParticle()) {
dComIfGp_particle_drawFogPri4(&draw_info);
dComIfGp_particle_drawProjection(&draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawFogPri4, &draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawProjection, &draw_info);
}
#if DEBUG
@@ -1829,7 +1830,7 @@ int mDoGph_Painter() {
fapGm_HIO_c::startCpuTimer();
#endif
dComIfGd_drawListZxlu();
GX_DEBUG_GROUP(dComIfGd_drawListZxlu);
#if DEBUG
// "drawing up to 2-draw Z-update translucent (Rendering)"
@@ -1842,10 +1843,10 @@ int mDoGph_Painter() {
if (DEBUG && g_kankyoHIO.navy.field_0x30d) {
if (dKy_darkworld_check() != TRUE) {
dComIfGd_drawOpaListFilter();
GX_DEBUG_GROUP(dComIfGd_drawOpaListFilter);
}
} else {
dComIfGd_drawOpaListFilter();
GX_DEBUG_GROUP(dComIfGd_drawOpaListFilter);
}
#if DEBUG
@@ -1858,13 +1859,13 @@ int mDoGph_Painter() {
GXSetClipMode(GX_CLIP_ENABLE);
if (fapGmHIO_getParticle()) {
dComIfGp_particle_drawFogPri1(&draw_info);
dComIfGp_particle_draw(&draw_info);
dComIfGp_particle_drawFogPri2(&draw_info);
dComIfGp_particle_drawFog(&draw_info);
dComIfGp_particle_drawFogPri3(&draw_info);
dComIfGp_particle_drawP1(&draw_info);
dComIfGp_particle_drawDarkworld(&draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawFogPri1, &draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_draw, &draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawFogPri2, &draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawFog, &draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawFogPri3, &draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawP1, &draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawDarkworld, &draw_info);
}
#if DEBUG
@@ -1888,13 +1889,13 @@ int mDoGph_Painter() {
if (!(DEBUG && g_kankyoHIO.navy.field_0x30d != 0 &&
dKy_darkworld_check() == TRUE)) {
if (g_env_light.is_blure == 1) {
dComIfGd_drawOpaListInvisible();
dComIfGd_drawXluListInvisible();
GX_DEBUG_GROUP(dComIfGd_drawOpaListInvisible);
GX_DEBUG_GROUP(dComIfGd_drawXluListInvisible);
}
}
if (fapGmHIO_getParticle()) {
dComIfGp_particle_drawScreen(&draw_info);
GX_DEBUG_GROUP(dComIfGp_particle_drawScreen, &draw_info);
}
#if DEBUG
@@ -1906,7 +1907,7 @@ int mDoGph_Painter() {
GXSetClipMode(GX_CLIP_ENABLE);
dComIfGd_drawIndScreen();
GX_DEBUG_GROUP(dComIfGd_drawIndScreen);
if (strcmp(dComIfGp_getStartStageName(), "F_SP124") == 0) {
retry_captue_frame(&camera_p->view, view_port,
@@ -1924,7 +1925,7 @@ int mDoGph_Painter() {
cMtx_lookAt(m2, &sp38c, &cXyz::Zero, &sp398, 0);
j3dSys.setViewMtx(m2);
dComIfGd_drawXluList2DScreen();
GX_DEBUG_GROUP(dComIfGd_drawXluList2DScreen);
j3dSys.setViewMtx(camera_p->view.viewMtx);
GXSetProjection(camera_p->view.projMtx, GX_PERSPECTIVE);
@@ -1955,7 +1956,7 @@ int mDoGph_Painter() {
fapGm_HIO_c::startCpuTimer();
#endif
mDoGph_gInf_c::getBloom()->draw();
GX_DEBUG_GROUP(mDoGph_gInf_c::getBloom()->draw);
j3dSys.setViewMtx(camera_p->view.viewMtx);
GXSetProjection(camera_p->view.projMtx, GX_PERSPECTIVE);
@@ -1971,7 +1972,7 @@ int mDoGph_Painter() {
}
#endif
dComIfGd_drawOpaList3Dlast();
GX_DEBUG_GROUP(dComIfGd_drawOpaList3Dlast);
#if DEBUG
// "saturation add filter (Rendering)"
+36 -1
View File
@@ -186,6 +186,39 @@ void main01(void) {
exit:;
}
static AuroraBackend ParseAuroraBackend(const std::string& value) {
if (value == "auto") {
return BACKEND_AUTO;
}
if (value == "d3d11") {
return BACKEND_D3D11;
}
if (value == "d3d12") {
return BACKEND_D3D12;
}
if (value == "metal") {
return BACKEND_METAL;
}
if (value == "vulkan") {
return BACKEND_VULKAN;
}
if (value == "opengl") {
return BACKEND_OPENGL;
}
if (value == "opengles") {
return BACKEND_OPENGLES;
}
if (value == "webgpu") {
return BACKEND_WEBGPU;
}
if (value == "null") {
return BACKEND_NULL;
}
fmt::print(stderr, "Unknown backend: {}", value);
exit(1);
}
// =========================================================================
// PC ENTRY POINT
// =========================================================================
@@ -198,7 +231,8 @@ int game_main(int argc, char* argv[]) {
arg_options.add_options()
("l,log-level", "Log level from " + std::to_string(AuroraLogLevel::LOG_DEBUG) + " to " + std::to_string(AuroraLogLevel::LOG_FATAL), cxxopts::value<uint8_t>()->default_value("0"))
("h,help", "Print usage")
("dvd", "Path to DVD image file", cxxopts::value<std::string>()->default_value("game.iso"));
("dvd", "Path to DVD image file", cxxopts::value<std::string>()->default_value("game.iso"))
("backend", "Graphics API backend to use (auto, d3d11, d3d12, metal, vulkan, opengl, opengles, webgpu, null)", cxxopts::value<std::string>()->default_value("auto"));
arg_options.parse_positional({"dvd"});
arg_options.positional_help("<dvd-image>");
@@ -223,6 +257,7 @@ int game_main(int argc, char* argv[]) {
config.windowPosY = -1;
config.windowWidth = 608 * 2;
config.windowHeight = 448 * 2;
config.desiredBackend = ParseAuroraBackend(parsed_arg_options["backend"].as<std::string>());
config.configPath = ".";
config.logCallback = &aurora_log_callback;
config.logLevel = (AuroraLogLevel)parsed_arg_options["log-level"].as<uint8_t>();