diff --git a/README.md b/README.md index 53a726fac7..200913770a 100644 --- a/README.md +++ b/README.md @@ -68,3 +68,6 @@ Pass the disc image as a positional argument. Supported formats: ISO (GCM), RVZ, build/dusk/dusk /path/to/game.rvz ``` If no path is specified, Dusk defaults to `game.iso` in the current working directory. + +#### 30 FPS on Debug +When compiled fully in a Debug the game runs too slowly to hit playable 30 FPS. To avoid this, you can set a CMake cache variable to optimize specific critical files without hampering debuggability in the rest of the program: `-DDUSK_SELECTED_OPT=ON`. When building for MSVC (Windows) you must also modify `CMAKE_CXX_FLAGS_DEBUG` and `CMAKE_C_FLAGS_DEBUG` to remove `/RTC1` from the flags, like so: `-DCMAKE_CXX_FLAGS_DEBUG="/MDd /Zi /Ob0 /Od" -DCMAKE_C_FLAGS_DEBUG="/MDd /Zi /Ob0 /Od"` diff --git a/extern/aurora b/extern/aurora index 156f9a65e3..d76b70fc72 160000 --- a/extern/aurora +++ b/extern/aurora @@ -1 +1 @@ -Subproject commit 156f9a65e38db18a8fc93b30271703e58fa339f5 +Subproject commit d76b70fc72c6a5904a9e78c0526353f8b8e93c61 diff --git a/include/SSystem/SComponent/c_xyz.h b/include/SSystem/SComponent/c_xyz.h index 0bea35efe3..1f99737825 100644 --- a/include/SSystem/SComponent/c_xyz.h +++ b/include/SSystem/SComponent/c_xyz.h @@ -31,7 +31,17 @@ struct cXyz : Vec { z = vec.z; } #else - cXyz() = default; + cXyz() { + if (std::isnan(x)) { + x = 0.0f; + } + if (std::isnan(y)) { + y = 0.0f; + } + if (std::isnan(z)) { + z = 0.0f; + } + } ~cXyz() = default; cXyz(const cXyz& vec) = default; #endif diff --git a/include/d/actor/d_a_player.h b/include/d/actor/d_a_player.h index e81bce0a94..41a11ff662 100644 --- a/include/d/actor/d_a_player.h +++ b/include/d/actor/d_a_player.h @@ -73,6 +73,20 @@ private: /* 0x8 */ f32 m_offsetXZ; }; // Size: 0xC +#if TARGET_PC +#define PLAYER_CREATE_ANM_HEAP_F(heap, type, fmt, ...) \ + { \ + char pcah_name_buf[32]; \ + sprintf(pcah_name_buf, fmt, ##__VA_ARGS__); \ + (heap).createHeap(type, pcah_name_buf); \ + \ + } +#define PLAYER_CREATE_ANM_HEAP(heap, type, name) (heap).createHeap(type, name) +#else +#define PLAYER_CREATE_ANM_HEAP_F(heap, type, name, ...) (heap).createHeap(type) +#define PLAYER_CREATE_ANM_HEAP(heap, type, name) (heap).createHeap(type) +#endif + class daPy_anmHeap_c { public: enum daAlinkHEAP_TYPE { @@ -87,7 +101,11 @@ public: ~daPy_anmHeap_c(); void initData(); void* mallocBuffer(); +#if TARGET_PC + void createHeap(daAlinkHEAP_TYPE i_heapType, const char* name); +#else void createHeap(daAlinkHEAP_TYPE i_heapType); +#endif void* loadData(u16 i_resId); void* loadDataIdx(u16 i_resId); void* loadDataPriIdx(u16 i_resId); diff --git a/include/d/d_simple_model.h b/include/d/d_simple_model.h index 4952553208..25b9e6e2d1 100644 --- a/include/d/d_simple_model.h +++ b/include/d/d_simple_model.h @@ -32,6 +32,10 @@ public: J3DModel* getModel() { return mpModel; } +#if TARGET_PC + void setIdx(u8 idx) { this->idx = idx; } +#endif + private: /* 0x00 */ JKRSolidHeap* mpHeap; /* 0x04 */ J3DModel* mpModel; @@ -40,6 +44,9 @@ private: /* 0x10 */ u8 mDrawBG; /* 0x11 */ s8 mRoomNo; /* 0x12 */ u8 field_0x12; +#if TARGET_PC + u8 idx; +#endif }; // Size: 0x14 class dSmplMdl_draw_c { diff --git a/libs/JSystem/include/JSystem/JKernel/JKRHeap.h b/libs/JSystem/include/JSystem/JKernel/JKRHeap.h index 2ff883c393..419d49301d 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRHeap.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRHeap.h @@ -222,9 +222,13 @@ public: #define JKRHEAP_NAME(heap, name) (heap)->setName(name) #define JKRHEAP_NAMEF(heap, name, ...) (heap)->setNamef(name, __VA_ARGS__) +#define JKRHEAP_CURRENT_NAME(heap, name) JKRHEAP_NAME(mDoExt_getCurrentHeap(), name) +#define JKRHEAP_CURRENT_NAMEF(heap, name, ...) JKRHEAP_NAMEF(mDoExt_getCurrentHeap(), name, __VA_ARGS__) #else #define JKRHEAP_NAME(heap, name) -#define JKRHEAP_NAMEF(heap, name) +#define JKRHEAP_NAMEF(heap, name, ...) +#define JKRHEAP_CURRENT_NAME(heap, name) +#define JKRHEAP_CURRENT_NAMEF(heap, name, ...) #endif }; diff --git a/libs/JSystem/include/JSystem/JStudio/JStudio/ctb.h b/libs/JSystem/include/JSystem/JStudio/JStudio/ctb.h index 108d6f60f1..da03389c25 100644 --- a/libs/JSystem/include/JSystem/JStudio/JStudio/ctb.h +++ b/libs/JSystem/include/JSystem/JStudio/JStudio/ctb.h @@ -64,9 +64,9 @@ struct data { }; struct TBlockData { - u32 size; - u16 scheme; - u16 IDSize; + BE(u32) size; + BE(u16) scheme; + BE(u16) IDSize; u32 field_0x8[0]; }; diff --git a/libs/JSystem/src/JKernel/JKRExpHeap.cpp b/libs/JSystem/src/JKernel/JKRExpHeap.cpp index 4c0c6bf1ae..3ec15cd161 100644 --- a/libs/JSystem/src/JKernel/JKRExpHeap.cpp +++ b/libs/JSystem/src/JKernel/JKRExpHeap.cpp @@ -214,7 +214,9 @@ void* JKRExpHeap::do_alloc(u32 size, int alignment) { #endif #if TARGET_PC - JUT_ASSERT_MSG_F(__LINE__, ptr != nullptr, "failed to alloc memory! (0x%x byte).\n", size); + JUT_ASSERT_MSG_F(__LINE__, ptr != nullptr, + "Failed to alloc memory! (%s) (0x%X bytes).\n Heap size: %u\n Used size: %u", + this->getName(), size, getSize(), getTotalUsedSize()); #else if (ptr == NULL) { JUTWarningConsole_f(":::cannot alloc memory (0x%x byte).\n", size); diff --git a/libs/JSystem/src/JStudio/JStudio/ctb.cpp b/libs/JSystem/src/JStudio/JStudio/ctb.cpp index 9a371ea936..61046ad35c 100644 --- a/libs/JSystem/src/JStudio/JStudio/ctb.cpp +++ b/libs/JSystem/src/JStudio/JStudio/ctb.cpp @@ -68,7 +68,7 @@ JStudio::ctb::TObject* JStudio::ctb::TControl::getObject_index(u32 param_0) { JStudio::ctb::TFactory::~TFactory() {} JStudio::ctb::TObject* JStudio::ctb::TFactory::create(JStudio::ctb::data::TParse_TBlock const& param_0) { - switch(BSWAP16(param_0.get_scheme())) { + switch(param_0.get_scheme()) { case 1: return JKR_NEW TObject_TxyzRy(param_0); default: diff --git a/libs/JSystem/src/JStudio/JStudio/jstudio-control.cpp b/libs/JSystem/src/JStudio/JStudio/jstudio-control.cpp index ff192835b3..18eab0832b 100644 --- a/libs/JSystem/src/JStudio/JStudio/jstudio-control.cpp +++ b/libs/JSystem/src/JStudio/JStudio/jstudio-control.cpp @@ -49,7 +49,7 @@ int JStudio::TControl::transformOnGet_setOrigin_TxyzRy(Vec const& param_0, f32 p int JStudio::TControl::transform_setOrigin_ctb(JStudio::ctb::TObject const& param_0) { switch (param_0.getScheme()) { case 1: { - const f32* pfVar4 = (const f32*)param_0.getData(); + const BE(f32)* pfVar4 = (const BE(f32)*)param_0.getData(); Vec local_144 = {0.0f, 0.0f, 0.0f}; local_144.x = pfVar4[0]; local_144.y = pfVar4[1]; diff --git a/libs/JSystem/src/JStudio/JStudio_JParticle/object-particle.cpp b/libs/JSystem/src/JStudio/JStudio_JParticle/object-particle.cpp index f2193f42f0..14fffc12b6 100644 --- a/libs/JSystem/src/JStudio/JStudio_JParticle/object-particle.cpp +++ b/libs/JSystem/src/JStudio/JStudio_JParticle/object-particle.cpp @@ -153,7 +153,7 @@ void JStudio_JParticle::TAdaptor_particle::adaptor_do_PARENT( switch (param_1) { case JStudio::data::UNK_0x18: JUT_ASSERT(313, pContent!=NULL); - JUT_ASSERT(314, uSize==4); + JUT_ASSERT(314, uSize>0); field_0x1d0 = NULL; const JStage::TSystem* pJSGSystem = pCreateObject_->get_pJSGSystem_(); JUT_ASSERT(345, pJSGSystem!=NULL); @@ -172,7 +172,7 @@ void JStudio_JParticle::TAdaptor_particle::adaptor_do_PARENT_NODE( case JStudio::data::UNK_0x18: if (field_0x1d0 != NULL) { JUT_ASSERT(380, pContent!=NULL); - JUT_ASSERT(381, uSize==4); + JUT_ASSERT(381, uSize>0); field_0x1d4 = field_0x1d0->JSGFindNodeID((const char*)pContent); if (field_0x1d4 == -1) { return; diff --git a/src/d/actor/d_a_alink.cpp b/src/d/actor/d_a_alink.cpp index c05d595a3c..58e8935e7d 100644 --- a/src/d/actor/d_a_alink.cpp +++ b/src/d/actor/d_a_alink.cpp @@ -4453,7 +4453,7 @@ void daAlink_c::playerInit() { mAtSph.StartCAt(current.pos); mAnmHeap3.setBufferSize(0x20000); - mAnmHeap3.createHeap(daPy_anmHeap_c::HEAP_TYPE_4); + PLAYER_CREATE_ANM_HEAP(mAnmHeap3, daPy_anmHeap_c::HEAP_TYPE_4, "daAlink_c::mAnmHeap3"); if (checkWolf()) { changeWolf(); @@ -4462,7 +4462,7 @@ void daAlink_c::playerInit() { } mAnmHeap4.setBufferSize(0xB00); - mAnmHeap4.createHeap(daPy_anmHeap_c::HEAP_TYPE_4); + PLAYER_CREATE_ANM_HEAP(mAnmHeap4, daPy_anmHeap_c::HEAP_TYPE_4, "daAlink_c::mAnmHeap4"); setShieldModel(); #if DEBUG @@ -4507,24 +4507,24 @@ void daAlink_c::playerInit() { for (i = 0; i < 3; i++) { mUnderAnmHeap[i].setBuffer(mUnderAnmHeap[0].getBuffer() + (i * 0x2C00)); - mUnderAnmHeap[i].createHeap(daPy_anmHeap_c::HEAP_TYPE_3); + PLAYER_CREATE_ANM_HEAP_F(mUnderAnmHeap[i], daPy_anmHeap_c::HEAP_TYPE_3, "daAlink_c::mUnderAnmHeap[%d]", i); } mUpperAnmHeap[0].setBuffer(mUnderAnmHeap[0].getBuffer() + 0x8400); for (i = 0; i < 3; i++) { mUpperAnmHeap[i].setBuffer(mUpperAnmHeap[0].getBuffer() + (i * 0x2C00)); - mUpperAnmHeap[i].createHeap(daPy_anmHeap_c::HEAP_TYPE_3); + PLAYER_CREATE_ANM_HEAP_F(mUpperAnmHeap[i], daPy_anmHeap_c::HEAP_TYPE_3, "daAlink_c::mUpperAnmHeap[%d]", i); } - mFaceBtpHeap.createHeap(daPy_anmHeap_c::HEAP_TYPE_1); - mFaceBtkHeap.createHeap(daPy_anmHeap_c::HEAP_TYPE_2); - mFaceBckHeap.createHeap(daPy_anmHeap_c::HEAP_TYPE_3); + PLAYER_CREATE_ANM_HEAP(mFaceBtpHeap, daPy_anmHeap_c::HEAP_TYPE_1, "daAlink_c::mFaceBtpHeap"); + PLAYER_CREATE_ANM_HEAP(mFaceBtkHeap, daPy_anmHeap_c::HEAP_TYPE_2, "daAlink_c::mFaceBtkHeap"); + PLAYER_CREATE_ANM_HEAP(mFaceBckHeap, daPy_anmHeap_c::HEAP_TYPE_3, "daAlink_c::mFaceBckHeap"); for (i = 0; i < 2; i++) { mItemHeap[i].setBufferSize(0x13200); - mItemHeap[i].createHeap(daPy_anmHeap_c::HEAP_TYPE_4); + PLAYER_CREATE_ANM_HEAP_F(mItemHeap[i], daPy_anmHeap_c::HEAP_TYPE_4, "daAlink_c::mItemHeap[%d]", i); } - mAnmHeap9.createHeap(daPy_anmHeap_c::HEAP_TYPE_3); + PLAYER_CREATE_ANM_HEAP(mAnmHeap9, daPy_anmHeap_c::HEAP_TYPE_3, "daAlink_c::mAnmHeap9"); resetBasAnime(); mZ2Link.init(¤t.pos, &eyePos, &field_0x3720); diff --git a/src/d/actor/d_a_bg.cpp b/src/d/actor/d_a_bg.cpp index 2cc6f1f192..e73723d1f9 100644 --- a/src/d/actor/d_a_bg.cpp +++ b/src/d/actor/d_a_bg.cpp @@ -532,6 +532,7 @@ int daBg_c::create() { if (room_heap != NULL) { this->heap = JKRCreateSolidHeap(-1, room_heap, false); JUT_ASSERT(471, heap != NULL); + JKRHEAP_NAME(heap, "d_a_bg Anms"); JKRHeap* old = mDoExt_setCurrentHeap(this->heap); int rt = createHeap(); diff --git a/src/d/actor/d_a_e_dt.cpp b/src/d/actor/d_a_e_dt.cpp index 3d88065113..c88635d111 100644 --- a/src/d/actor/d_a_e_dt.cpp +++ b/src/d/actor/d_a_e_dt.cpp @@ -1578,11 +1578,17 @@ bool daE_DT_c::pointInSight(cXyz* i_point) { f32 width = scissor->width; f32 height = scissor->height; mDoLib_project(i_point, &proj); + + #if TARGET_PC + view_port_class* viewport = dComIfGp_getWindow(dComIfGp_getCameraWinID(idx))->getViewPort(); + return proj.x > 0.0f && proj.x < width && proj.y > (30.0f * viewport->height / FB_HEIGHT) && -(30.0f * viewport->height / FB_HEIGHT) < height; + #else if (proj.x > 0.0f && proj.x < width && proj.y > 30.0f && -30.0f < height) { return true; } else { return false; } + #endif } void daE_DT_c::executeOpening() { diff --git a/src/d/actor/d_a_midna.cpp b/src/d/actor/d_a_midna.cpp index dcdb2f43ff..cbbf1915e2 100644 --- a/src/d/actor/d_a_midna.cpp +++ b/src/d/actor/d_a_midna.cpp @@ -565,12 +565,12 @@ cPhs_Step daMidna_c::create() { mpFunc = &daMidna_c::checkMetamorphoseEnableBase; for (u16 i = 0; i < 3; i++) { - mBckHeap[i].createHeap(daPy_anmHeap_c::HEAP_TYPE_3); + PLAYER_CREATE_ANM_HEAP_F(mBckHeap[i], daPy_anmHeap_c::HEAP_TYPE_3, "daMidna_c::mBckHeap[%d]", i); } - mBtpHeap.createHeap(daPy_anmHeap_c::HEAP_TYPE_1); - mBtkHeap.createHeap(daPy_anmHeap_c::HEAP_TYPE_2); - + PLAYER_CREATE_ANM_HEAP_F(mBtpHeap, daPy_anmHeap_c::HEAP_TYPE_1, "daMidna_c::mBtpHeap"); + PLAYER_CREATE_ANM_HEAP_F(mBtkHeap, daPy_anmHeap_c::HEAP_TYPE_2, "daMidna_c::mBtkHeap"); + mSound.init(¤t.pos, &eyePos, 3, 1); mpShadowModel = mpMorf->getModel(); mpShadowModel->setUserArea((uintptr_t)this); diff --git a/src/d/actor/d_a_npc_tks.cpp b/src/d/actor/d_a_npc_tks.cpp index 1338ba0368..f1c33003f8 100644 --- a/src/d/actor/d_a_npc_tks.cpp +++ b/src/d/actor/d_a_npc_tks.cpp @@ -823,7 +823,15 @@ void daNpcTks_c::playMotion() { daNpcF_anmPlayData dat4a = {ANM_JUMP_S, 4.0f, 1}; daNpcF_anmPlayData dat4b = {ANM_FLY, 0.0f, 0}; daNpcF_anmPlayData* pDat4[2] = {&dat4a, &dat4b}; + + #if TARGET_PC + // Note: this fixes a crash in the cutscene after entering city and likely needs to be revisited as its + // unclear why this was 1 in the first place and unclear why this fixes it + daNpcF_anmPlayData dat5 = {ANM_JUMP_E, 0.0f, 0}; + #else daNpcF_anmPlayData dat5 = {ANM_JUMP_E, 0.0f, 1}; + #endif + daNpcF_anmPlayData* pDat5[1] = {&dat5}; daNpcF_anmPlayData dat6a = {ANM_LAND, 0.0f, 1}; daNpcF_anmPlayData dat6b = {ANM_WAIT_A, 4.0f, 0}; diff --git a/src/d/actor/d_a_peru.cpp b/src/d/actor/d_a_peru.cpp index df134aa5b6..7d2a7c39bb 100644 --- a/src/d/actor/d_a_peru.cpp +++ b/src/d/actor/d_a_peru.cpp @@ -1008,6 +1008,7 @@ int daPeru_c::_cutAppear_Init(int const& param_1) { initTalk(mFlowNodeNo, NULL); break; case 140: + { static cXyz see_pos; see_pos.set(0.0f, -300.0f, 300.0f); mDoMtx_stack_c::ZXYrotS(shape_angle); @@ -1016,6 +1017,7 @@ int daPeru_c::_cutAppear_Init(int const& param_1) { mJntAnm.lookPos(&see_pos, 0); setCnt(80); break; + } case 150: mJntAnm.lookNone(0); setAction(&daPeru_c::demo_walk_to_window, 0); diff --git a/src/d/actor/d_a_player.cpp b/src/d/actor/d_a_player.cpp index c091fae5dd..f38fe15a3b 100644 --- a/src/d/actor/d_a_player.cpp +++ b/src/d/actor/d_a_player.cpp @@ -237,7 +237,11 @@ void* daPy_anmHeap_c::mallocBuffer() { return mBuffer; } -void daPy_anmHeap_c::createHeap(daPy_anmHeap_c::daAlinkHEAP_TYPE i_heapType) { +#if TARGET_PC +void daPy_anmHeap_c::createHeap(daPy_anmHeap_c::daAlinkHEAP_TYPE i_heapType, const char* name) { +#else +void daPy_anmHeap_c::createHeap(daPy_anmHeap_c::daAlinkHEAP_TYPE i_heapType, const char* name) { +#endif u32 size; if (i_heapType == 4) { @@ -260,8 +264,8 @@ void daPy_anmHeap_c::createHeap(daPy_anmHeap_c::daAlinkHEAP_TYPE i_heapType) { JKRHeap* tmp; mAnimeHeap = mDoExt_createSolidHeapFromGameToCurrent(&tmp, size, 0x20); - JKRHEAP_NAMEF(mAnimeHeap, "Alink anime type %d", i_heapType); - + JKRHEAP_NAME(mAnimeHeap, name); + if (i_heapType == 4) { tmpWork = JKR_NEW_ARRAY(char, size); JUT_ASSERT(669, tmpWork != NULL); diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp index a24dcd47dc..ad12a4b773 100644 --- a/src/d/d_camera.cpp +++ b/src/d/d_camera.cpp @@ -10997,7 +10997,14 @@ static int camera_draw(camera_process_class* i_this) { #endif int trim_height = body->TrimHeight(); + + #if TARGET_PC + trim_height *= viewport->height / FB_HEIGHT; + window->setScissor(0.0f, trim_height, viewport->width, viewport->height - trim_height * 2.0f); + #else window->setScissor(0.0f, trim_height, FB_WIDTH, FB_HEIGHT - trim_height * 2.0f); + #endif + C_MTXPerspective(process->view.projMtx, process->view.fovy, process->view.aspect, process->view.near_, process->view.far_); mDoMtx_lookAt(process->view.viewMtx, &process->view.lookat.eye, &process->view.lookat.center, &process->view.lookat.up, process->view.bank); diff --git a/src/d/d_file_select.cpp b/src/d/d_file_select.cpp index 748d963de3..16aafb721f 100644 --- a/src/d/d_file_select.cpp +++ b/src/d/d_file_select.cpp @@ -5195,6 +5195,7 @@ void dFile_select3D_c::_create(u8 i_mirrorIdx, u8 i_maskIdx) { if (mpSolidHeap == NULL) { JUT_ASSERT(5189, mpSolidHeap != NULL); } + JKRHEAP_NAME(mpSolidHeap, "dFile_select3D_c::mpSolidHeap"); field_0x03c4 = 0.0f; field_0x03c8 = 0.0f; diff --git a/src/d/d_k_wmark.cpp b/src/d/d_k_wmark.cpp index 8021494be2..379b55f532 100644 --- a/src/d/d_k_wmark.cpp +++ b/src/d/d_k_wmark.cpp @@ -35,6 +35,7 @@ int dkWmark_c::create() { mpHeap = mDoExt_createSolidHeapFromGameToCurrent(0x880, 0x20); if (mpHeap != NULL) { + JKRHEAP_NAME(mpHeap, "dkWmark_c::mpHeap"); J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Alink", 0x23); JUT_ASSERT(60, modelData != NULL); diff --git a/src/d/d_kankyo.cpp b/src/d/d_kankyo.cpp index a74ca3c9db..e6d076c05f 100644 --- a/src/d/d_kankyo.cpp +++ b/src/d/d_kankyo.cpp @@ -31,6 +31,9 @@ #include "JSystem/JKernel/JKRSolidHeap.h" #include #include +#if TARGET_PC +#include "dusk/imgui/ImGuiConsole.hpp" +#endif static void GxXFog_set(); @@ -11376,7 +11379,12 @@ void dKy_bg_MAxx_proc(void* bg_model_p) { Mtx sp1D8; if (mat_name[6] == '2') { C_MTXLightPerspective(sp1D8, dComIfGd_getView()->fovy, - camera_p->view.aspect, 1.0f, 1.0f, -0.01f, 0.0f); + camera_p->view.aspect, 1.0f, 1.0f, +#if TARGET_PC + dusk::g_imguiConsole.isWaterProjectionOffsetEnabled() ? -0.01f : 0.0f, 0.0f); +#else + -0.01f, 0.0f); +#endif } else { C_MTXLightPerspective(sp1D8, dComIfGd_getView()->fovy, camera_p->view.aspect, 0.49f, -0.49f, 0.5f, 0.5f); diff --git a/src/d/d_ky_thunder.cpp b/src/d/d_ky_thunder.cpp index 69c0d690ad..77c2a92769 100644 --- a/src/d/d_ky_thunder.cpp +++ b/src/d/d_ky_thunder.cpp @@ -26,6 +26,8 @@ int dThunder_c::createHeap() { if (mpHeap == NULL) { return 0; } + + JKRHEAP_NAME(mpHeap, "dThunder_c::mpHeap"); } return 1; diff --git a/src/d/d_menu_collect.cpp b/src/d/d_menu_collect.cpp index 4f18e74391..c1281a86c2 100644 --- a/src/d/d_menu_collect.cpp +++ b/src/d/d_menu_collect.cpp @@ -2222,6 +2222,7 @@ dMenu_Collect3D_c::~dMenu_Collect3D_c() { void dMenu_Collect3D_c::_create() { mpHeap->getTotalFreeSize(); mpSolidHeap = mDoExt_createSolidHeapToCurrent(0x25800, mpHeap, 0x20); + JKRHEAP_NAME(mpSolidHeap, "dMenu_Collect3D_c::mpSolidHeap"); mDoExt_setCurrentHeap((JKRHeap*)mpSolidHeap); daAlink_c* linkActor = daAlink_getAlinkActorClass(); if (linkActor != NULL) { diff --git a/src/d/d_menu_dmap.cpp b/src/d/d_menu_dmap.cpp index d78766b0e3..97721d9dd2 100644 --- a/src/d/d_menu_dmap.cpp +++ b/src/d/d_menu_dmap.cpp @@ -1649,6 +1649,7 @@ void dMenu_Dmap_c::_create() { mDmapHeap = JKRCreateExpHeap(field_0xe8->getFreeSize() - 0x10, field_0xe8, false); JUT_ASSERT(3732, mDmapHeap != NULL); + JKRHEAP_NAME(mDmapHeap, "dMenu_Dmap_c::mDmapHeap"); JKRHeap* heap = mDoExt_setCurrentHeap(mDmapHeap); u32 sp28 = mDmapHeap->getTotalFreeSize(); diff --git a/src/d/d_simple_model.cpp b/src/d/d_simple_model.cpp index 2bea7e950d..7106197644 100644 --- a/src/d/d_simple_model.cpp +++ b/src/d/d_simple_model.cpp @@ -18,6 +18,7 @@ static void dSmplMdl_modelUpdateDL(J3DModel* i_model) { dSmplMdl_draw_c::dSmplMdl_draw_c() { for (int i = 0; i < 8; i++) { mModel[i].init(); + mModel[i].setIdx(i); } for (int i = 0; i < 500; i++) { @@ -128,6 +129,7 @@ BOOL diff_model_c::create(J3DModelData* i_modelData, int roomNo, u8 drawBG) { JUT_ASSERT(397, i_modelData != NULL); if (mpHeap == NULL) { mpHeap = mDoExt_createSolidHeapFromGameToCurrent(0x2000, 0x20); + JKRHEAP_NAMEF(mpHeap, "Simple model (%d)", idx); if (mpHeap != NULL) { mpModel = mDoExt_J3DModel__create(i_modelData, 0x80000, 0x11000084); diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index b79bcc128c..f6c90b0f3d 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -384,6 +384,7 @@ static void dummy1(dStage_roomControl_c* roomControl) { JKRExpHeap* dStage_roomControl_c::createMemoryBlock(int i_blockIdx, u32 i_heapSize) { if (mMemoryBlock[i_blockIdx] == NULL) { mMemoryBlock[i_blockIdx] = JKRCreateExpHeap(i_heapSize, mDoExt_getArchiveHeap(), false); + JKRHEAP_NAMEF(mMemoryBlock[i_blockIdx], "Room control memory block %d", i_blockIdx); } return mMemoryBlock[i_blockIdx]; diff --git a/src/d/d_timer.cpp b/src/d/d_timer.cpp index 5299ebeb04..41826c3029 100644 --- a/src/d/d_timer.cpp +++ b/src/d/d_timer.cpp @@ -40,6 +40,7 @@ int dTimer_c::_create() { dComIfGp_setAllMapArchive(resInfo->getArchive()); mp_heap = fopMsgM_createExpHeap(0x11000, NULL); + JKRHEAP_NAME(mp_heap, "dTimer_c::mp_heap"); JKRHeap* prev_heap = mDoExt_setCurrentHeap(mp_heap); if (mp_heap != NULL) { mp_heap->getTotalFreeSize(); diff --git a/src/dusk/OSMutex.cpp b/src/dusk/OSMutex.cpp index 55d8ccb52f..8e26402e0d 100644 --- a/src/dusk/OSMutex.cpp +++ b/src/dusk/OSMutex.cpp @@ -14,43 +14,6 @@ #include "JSystem/JKernel/JKRHeap.h" -// ============================================================================ -// Malloc-based allocator to bypass JKRHeap operator new/delete -// Without this, side-table allocations call operator new -> JKRHeap::alloc -// -> OSLockMutex -> GetMutexData -> operator new ... infinite recursion. -// ============================================================================ - -template -struct MallocAllocator { - using value_type = T; - MallocAllocator() = default; - template MallocAllocator(const MallocAllocator&) noexcept {} - T* allocate(std::size_t n) { - void* p = std::malloc(n * sizeof(T)); - if (!p) throw std::bad_alloc(); - return static_cast(p); - } - void deallocate(T* p, std::size_t) noexcept { std::free(p); } - template bool operator==(const MallocAllocator&) const noexcept { return true; } - template bool operator!=(const MallocAllocator&) const noexcept { return false; } -}; - -template -struct MallocDeleter { - void operator()(T* p) const { - p->~T(); - std::free(p); - } -}; - -template -std::unique_ptr> make_malloc_unique(Args&&... args) { - void* mem = std::malloc(sizeof(T)); - if (!mem) throw std::bad_alloc(); - T* obj = JKR_NEW_ARGS (mem) T(std::forward(args)...); - return std::unique_ptr>(obj); -} - // ============================================================================ // Side-table: native mutex per OSMutex // ============================================================================ @@ -59,17 +22,13 @@ struct PCMutexData { std::recursive_mutex nativeMutex; }; -template -using MallocMap = std::unordered_map, std::equal_to, - MallocAllocator>>; - // Lazy-initialized to avoid DLL static init crashes static std::mutex& GetMutexMapMutex() { static std::mutex mtx; return mtx; } -static MallocMap>>& GetMutexMap() { - static MallocMap>> map; +static std::unordered_map>& GetMutexMap() { + static std::unordered_map> map; return map; } @@ -78,7 +37,7 @@ static PCMutexData& GetMutexData(OSMutex* mutex) { auto& map = GetMutexMap(); auto it = map.find(mutex); if (it == map.end()) { - auto result = map.emplace(mutex, make_malloc_unique()); + auto result = map.emplace(mutex, std::make_unique()); return *result.first->second; } return *it->second; @@ -97,8 +56,8 @@ static std::mutex& GetCondMapMutex() { static std::mutex mtx; return mtx; } -static MallocMap>>& GetCondMap() { - static MallocMap>> map; +static std::unordered_map>& GetCondMap() { + static std::unordered_map> map; return map; } @@ -107,7 +66,7 @@ static PCCondData& GetCondData(OSCond* cond) { auto& map = GetCondMap(); auto it = map.find(cond); if (it == map.end()) { - auto result = map.emplace(cond, make_malloc_unique()); + auto result = map.emplace(cond, std::make_unique()); return *result.first->second; } return *it->second; diff --git a/src/dusk/OSThread.cpp b/src/dusk/OSThread.cpp index 2d19139272..c88126bd52 100644 --- a/src/dusk/OSThread.cpp +++ b/src/dusk/OSThread.cpp @@ -18,45 +18,6 @@ #include "JSystem/JKernel/JKRHeap.h" -// ============================================================================ -// Malloc-based allocator to bypass JKRHeap operator new/delete -// ============================================================================ - -template -struct MallocAllocator { - using value_type = T; - MallocAllocator() = default; - template MallocAllocator(const MallocAllocator&) noexcept {} - T* allocate(std::size_t n) { - void* p = std::malloc(n * sizeof(T)); - if (!p) throw std::bad_alloc(); - return static_cast(p); - } - void deallocate(T* p, std::size_t) noexcept { std::free(p); } - template bool operator==(const MallocAllocator&) const noexcept { return true; } - template bool operator!=(const MallocAllocator&) const noexcept { return false; } -}; - -template -struct MallocDeleter { - void operator()(T* p) const { - p->~T(); - std::free(p); - } -}; - -template -std::unique_ptr> make_malloc_unique(Args&&... args) { - void* mem = std::malloc(sizeof(T)); - if (!mem) throw std::bad_alloc(); - T* obj = JKR_NEW_ARGS (mem) T(std::forward(args)...); - return std::unique_ptr>(obj); -} - -template -using MallocMap = std::unordered_map, std::equal_to, - MallocAllocator>>; - // ============================================================================ // Side-table: native thread data per OSThread // ============================================================================ @@ -76,8 +37,8 @@ static std::mutex& GetThreadDataMutex() { static std::mutex mtx; return mtx; } -static MallocMap>>& GetThreadDataMap() { - static MallocMap>> map; +static std::unordered_map>& GetThreadDataMap() { + static std::unordered_map> map; return map; } @@ -86,8 +47,8 @@ static std::mutex& GetQueueCvMutex() { static std::mutex mtx; return mtx; } -static MallocMap>>& GetQueueCvMap() { - static MallocMap>> map; +static std::unordered_map>& GetQueueCvMap() { + static std::unordered_map> map; return map; } @@ -96,7 +57,7 @@ static std::condition_variable& GetQueueCV(OSThreadQueue* queue) { auto& map = GetQueueCvMap(); auto it = map.find(queue); if (it == map.end()) { - auto result = map.emplace(queue, make_malloc_unique()); + auto result = map.emplace(queue, std::make_unique()); return *result.first->second; } return *it->second; @@ -295,7 +256,7 @@ int OSCreateThread(OSThread* thread, void* (*func)(void*), void* param, // Create side-table entry (but don't start the thread yet) { - auto data = make_malloc_unique(); + auto data = std::make_unique(); data->func = func; data->param = param; @@ -649,24 +610,14 @@ s32 OSEnableScheduler(void) { // ============================================================================ BOOL OSDisableInterrupts(void) { - GetInterruptMutex().lock(); - sInterruptLockCount++; - return (BOOL)(sInterruptLockCount > 1); // TRUE if was already locked + return FALSE; } BOOL OSRestoreInterrupts(BOOL level) { - if (sInterruptLockCount > 0) { - sInterruptLockCount--; - GetInterruptMutex().unlock(); - } - return level; + return FALSE; } BOOL OSEnableInterrupts(void) { - if (sInterruptLockCount > 0) { - sInterruptLockCount--; - GetInterruptMutex().unlock(); - } return FALSE; } diff --git a/src/dusk/imgui/ImGuiConsole.hpp b/src/dusk/imgui/ImGuiConsole.hpp index 82f0658e7a..c67bb2a885 100644 --- a/src/dusk/imgui/ImGuiConsole.hpp +++ b/src/dusk/imgui/ImGuiConsole.hpp @@ -15,6 +15,7 @@ namespace dusk { void draw(); bool isBloomEnabled() { return m_menuGame.isBloomEnabled(); } + bool isWaterProjectionOffsetEnabled() { return m_menuGame.isWaterProjectionOffsetEnabled(); } ImGuiMenuTools::CollisionViewSettings& getCollisionViewSettings() { return m_menuTools.getCollisionViewSettings(); } static bool CheckMenuViewToggle(ImGuiKey key, bool& active); diff --git a/src/dusk/imgui/ImGuiMapLoader.cpp b/src/dusk/imgui/ImGuiMapLoader.cpp index 4b52fd1b04..73f9f17dc9 100644 --- a/src/dusk/imgui/ImGuiMapLoader.cpp +++ b/src/dusk/imgui/ImGuiMapLoader.cpp @@ -12,19 +12,17 @@ namespace dusk { return; } - ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | + ImGuiWindowFlags windowFlags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav; ImGui::SetNextWindowBgAlpha(0.65f); ImGui::SetNextWindowSizeConstraints(ImVec2(300, 0), ImVec2(FLT_MAX, FLT_MAX)); - if (!ImGui::Begin("Map Loader", nullptr, windowFlags)) { + if (!ImGui::Begin("Map Loader", &m_showMapLoader, windowFlags)) { ImGui::End(); return; } - ImGui::SeparatorText("Map Loader"); - ImGui::Checkbox("Show Internal Names", &m_mapLoaderInfo.showInternalNames); const char* previewRegion = "None"; @@ -38,6 +36,8 @@ namespace dusk { if (ImGui::Selectable(region.regionName)) { if (m_mapLoaderInfo.regionIdx != idx) { m_mapLoaderInfo.mapIdx = 0; + m_mapLoaderInfo.roomNoIdx = 0; + m_mapLoaderInfo.pointNoIdx = 0; } m_mapLoaderInfo.regionIdx = idx; } @@ -70,7 +70,7 @@ namespace dusk { m_mapLoaderInfo.pointNoIdx = 0; } } - }else { + } else { ImGui::Text("No region selected."); } diff --git a/src/dusk/imgui/ImGuiMenuGame.cpp b/src/dusk/imgui/ImGuiMenuGame.cpp index 2366fb6a42..79dfcb022d 100644 --- a/src/dusk/imgui/ImGuiMenuGame.cpp +++ b/src/dusk/imgui/ImGuiMenuGame.cpp @@ -23,6 +23,11 @@ namespace dusk { if (ImGui::BeginMenu("Graphics")) { ImGui::Checkbox("Native Bloom", &m_graphicsSettings.m_enableBloom); + ImGui::Checkbox("Water Projection Offset", &m_graphicsSettings.m_waterProjectionOffset); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Adds GC-specific -0.01 transS offset\n" + "that causes ~6px ghost artifacts in water reflections"); + } ImGui::EndMenu(); } @@ -110,7 +115,7 @@ namespace dusk { ImGui::SetNextWindowBgAlpha(0.65f); ImGui::SetNextWindowSizeConstraints(ImVec2(850, 400), ImVec2(850, 400)); - if (!ImGui::Begin("Controller Config", nullptr, windowFlags)) { + if (!ImGui::Begin("Controller Config", &m_showControllerConfig, windowFlags)) { ImGui::End(); return; } diff --git a/src/dusk/imgui/ImGuiMenuGame.hpp b/src/dusk/imgui/ImGuiMenuGame.hpp index a76a20f7c4..35e7e397aa 100644 --- a/src/dusk/imgui/ImGuiMenuGame.hpp +++ b/src/dusk/imgui/ImGuiMenuGame.hpp @@ -13,6 +13,7 @@ namespace dusk { ImGuiMenuGame(); void draw(); bool isBloomEnabled() { return m_graphicsSettings.m_enableBloom; } + bool isWaterProjectionOffsetEnabled() { return m_graphicsSettings.m_waterProjectionOffset; } void windowInputViewer(); void windowControllerConfig(); @@ -35,6 +36,7 @@ namespace dusk { struct { bool m_enableBloom = 1; + bool m_waterProjectionOffset = false; } m_graphicsSettings; bool m_showControllerConfig = false; diff --git a/src/dusk/imgui/ImGuiMenuTools.cpp b/src/dusk/imgui/ImGuiMenuTools.cpp index d848690063..e84dbc1f08 100644 --- a/src/dusk/imgui/ImGuiMenuTools.cpp +++ b/src/dusk/imgui/ImGuiMenuTools.cpp @@ -61,7 +61,7 @@ namespace dusk { ShowPlayerInfo(); if (m_showSaveEditor) { - m_saveEditor.draw(); + m_saveEditor.draw(m_showSaveEditor); } DuskDebugPad(); // temporary, remove later @@ -141,7 +141,7 @@ namespace dusk { ImGui::SetNextWindowBgAlpha(0.65f); ImGui::SetNextWindowSizeConstraints(ImVec2(300, 200), ImVec2(300, 200)); - if (ImGui::Begin("Player Info", nullptr, windowFlags)) { + if (ImGui::Begin("Player Info", &m_showPlayerInfo, windowFlags)) { daAlink_c* player = (daAlink_c*)dComIfGp_getPlayer(0); daHorse_c* horse = dComIfGp_getHorseActor(); diff --git a/src/dusk/imgui/ImGuiProcessOverlay.cpp b/src/dusk/imgui/ImGuiProcessOverlay.cpp index cf2d22402e..04a87f00b6 100644 --- a/src/dusk/imgui/ImGuiProcessOverlay.cpp +++ b/src/dusk/imgui/ImGuiProcessOverlay.cpp @@ -74,7 +74,7 @@ namespace dusk { return; } - if (ImGui::Begin("Processes")) { + if (ImGui::Begin("Processes", &m_showProcessManagement)) { if (ImGui::BeginTabBar("Tabs")) { showTreeRecursive = true; if (ImGui::BeginTabItem("Tree")) { diff --git a/src/dusk/imgui/ImGuiSaveEditor.cpp b/src/dusk/imgui/ImGuiSaveEditor.cpp index 2462e23f21..ff04b1f1a2 100644 --- a/src/dusk/imgui/ImGuiSaveEditor.cpp +++ b/src/dusk/imgui/ImGuiSaveEditor.cpp @@ -282,14 +282,14 @@ namespace dusk { ImGuiSaveEditor::ImGuiSaveEditor() {} - void ImGuiSaveEditor::draw() { + void ImGuiSaveEditor::draw(bool& open) { ImGuiIO& io = ImGui::GetIO(); ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoResize; ImGui::SetNextWindowBgAlpha(0.65f); ImGui::SetNextWindowSizeConstraints(ImVec2(600, 700), ImVec2(600, 700)); - if (ImGui::Begin("Save Editor", nullptr, windowFlags)) { + if (ImGui::Begin("Save Editor", &open, windowFlags)) { if (ImGui::BeginTabBar("SaveEditorTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { if (ImGui::BeginTabItem("Player Status")) { drawPlayerStatusTab(); diff --git a/src/dusk/imgui/ImGuiSaveEditor.hpp b/src/dusk/imgui/ImGuiSaveEditor.hpp index f6668a75db..3afc1b8145 100644 --- a/src/dusk/imgui/ImGuiSaveEditor.hpp +++ b/src/dusk/imgui/ImGuiSaveEditor.hpp @@ -11,7 +11,7 @@ namespace dusk { public: ImGuiSaveEditor(); - void draw(); + void draw(bool& open); void drawPlayerStatusTab(); void drawLocationTab(); void drawInventoryTab(); diff --git a/src/dusk/stubs.cpp b/src/dusk/stubs.cpp index 73f4e93d80..f4d1b2688b 100644 --- a/src/dusk/stubs.cpp +++ b/src/dusk/stubs.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -55,42 +56,6 @@ u32 OSGetSoundMode() { // Message Queue (thread-safe implementation) // ========================================================================== -// Malloc-based allocator to bypass JKRHeap operator new/delete -template -struct MallocAllocator { - using value_type = T; - MallocAllocator() = default; - template MallocAllocator(const MallocAllocator&) noexcept {} - T* allocate(std::size_t n) { - void* p = std::malloc(n * sizeof(T)); - if (!p) throw std::bad_alloc(); - return static_cast(p); - } - void deallocate(T* p, std::size_t) noexcept { std::free(p); } - template bool operator==(const MallocAllocator&) const noexcept { return true; } - template bool operator!=(const MallocAllocator&) const noexcept { return false; } -}; - -template -struct MallocDeleter { - void operator()(T* p) const { - p->~T(); - std::free(p); - } -}; - -template -std::unique_ptr> make_malloc_unique(Args&&... args) { - void* mem = std::malloc(sizeof(T)); - if (!mem) throw std::bad_alloc(); - T* obj = new (mem) T(std::forward(args)...); - return std::unique_ptr>(obj); -} - -template -using MallocMap = std::unordered_map, std::equal_to, - MallocAllocator>>; - // Side-table for native synchronization per OSMessageQueue struct PCMessageQueueData { std::mutex mtx; @@ -103,8 +68,8 @@ static std::mutex& GetMsgQueueMapMutex() { static std::mutex mtx; return mtx; } -static MallocMap>>& GetMsgQueueMap() { - static MallocMap>> map; +static std::unordered_map>& GetMsgQueueMap() { + static std::unordered_map> map; return map; } @@ -113,7 +78,7 @@ static PCMessageQueueData& GetMsgQueueData(OSMessageQueue* mq) { auto& map = GetMsgQueueMap(); auto it = map.find(mq); if (it == map.end()) { - auto result = map.emplace(mq, make_malloc_unique()); + auto result = map.emplace(mq, std::make_unique()); return *result.first->second; } return *it->second; diff --git a/src/f_op/f_op_actor_mng.cpp b/src/f_op/f_op_actor_mng.cpp index 082c721418..79795d3bfe 100644 --- a/src/f_op/f_op_actor_mng.cpp +++ b/src/f_op/f_op_actor_mng.cpp @@ -524,6 +524,7 @@ bool fopAcM_entrySolidHeap_(fopAc_ac_c* i_actor, heapCallbackFunc i_heapCallback OSReport_Error("最大空きヒープサイズで確保失敗。[%s]\n", procNameString); return false; } + JKRHEAP_NAMEF(heap, "Actor mng (%s)", procNameString); #if DEBUG if (!fopAcM::HeapAdjustQuiet) { // Attempting registration with max heap size. %08x @@ -625,6 +626,7 @@ bool fopAcM_entrySolidHeap_(fopAc_ac_c* i_actor, heapCallbackFunc i_heapCallback if (alignedSize + adjOffset + 0x10 < freeSize) { newHeap = mDoExt_createSolidHeapFromGame(alignedSize, 0x20); + JKRHEAP_NAMEF(newHeap, "Actor mng (%s)", procNameString); } if (fopAcM::HeapAdjustVerbose) { diff --git a/src/m_Do/m_Do_graphic.cpp b/src/m_Do/m_Do_graphic.cpp index 1264e54dd8..94ba2fe6ce 100644 --- a/src/m_Do/m_Do_graphic.cpp +++ b/src/m_Do/m_Do_graphic.cpp @@ -1081,7 +1081,13 @@ static void trimming(view_class* param_0, view_port_class* param_1) { GXSetDither(GX_TRUE); GXSetNumIndStages(0); Mtx44 ortho; + + #if TARGET_PC + C_MTXOrtho(ortho, 0.0f, param_1->height, 0.0f, param_1->width, 0.0f, 10.0f); + #else C_MTXOrtho(ortho, 0.0f, FB_HEIGHT, 0.0f, FB_WIDTH, 0.0f, 10.0f); + #endif + GXLoadPosMtxImm(cMtx_getIdentity(), 0); GXClearVtxDesc(); GXSetVtxDesc(GX_VA_POS, GX_DIRECT); @@ -1089,6 +1095,17 @@ static void trimming(view_class* param_0, view_port_class* param_1) { GXSetProjection(ortho, GX_ORTHOGRAPHIC); GXSetCurrentMtx(0); GXBegin(GX_QUADS, GX_VTXFMT0, 8); + + #if TARGET_PC + GXPosition3s16(0, 0, -5); + GXPosition3s16(param_1->width, 0, -5); + GXPosition3s16(param_1->width, sc_top, -5); + GXPosition3s16(0, sc_top, -5); + GXPosition3s16(0, sc_bottom, -5); + GXPosition3s16(param_1->width, sc_bottom, -5); + GXPosition3s16(param_1->width, param_1->height, -5); + GXPosition3s16(0, param_1->height, -5); + #else GXPosition3s16(0, 0, -5); GXPosition3s16(FB_WIDTH, 0, -5); GXPosition3s16(FB_WIDTH, sc_top, -5); @@ -1097,6 +1114,8 @@ static void trimming(view_class* param_0, view_port_class* param_1) { GXPosition3s16(FB_WIDTH, sc_bottom, -5); GXPosition3s16(FB_WIDTH, FB_HEIGHT, -5); GXPosition3s16(0, FB_HEIGHT, -5); + #endif + GXEnd(); } GXSetScissor(param_1->scissor.x_orig, param_1->scissor.y_orig, param_1->scissor.width, diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index 20fc2a8aee..a2fe24771d 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -272,6 +272,7 @@ int game_main(int argc, char* argv[]) { config.logLevel = (AuroraLogLevel)parsed_arg_options["log-level"].as(); config.mem1Size = 256 * 1024 * 1024; config.mem2Size = 24 * 1024 * 1024; + config.allowJoystickBackgroundEvents = true; auroraInfo = aurora_initialize(argc, argv, &config);