diff --git a/src/d/actor/d_a_e_pm.cpp b/src/d/actor/d_a_e_pm.cpp index c994995591..5820985ec1 100644 --- a/src/d/actor/d_a_e_pm.cpp +++ b/src/d/actor/d_a_e_pm.cpp @@ -338,6 +338,10 @@ static s16 s_TargetAngle; void daE_PM_c::SearchFarP() { //! @bug best_distance is not initialized f32 best_distance; + #if AVOID_UB + best_distance = 0.0f; + #endif + int best_index; dPnt* pnt = dPath_GetPnt(mpPath, 0); Vec pos; @@ -2652,6 +2656,11 @@ void daE_PM_c::setGakkiBaseMtx() { void daE_PM_c::setLampBaseMtx() { cXyz vec1, vec2; +#if AVOID_UB + vec1.set(0, 0, 0); + vec2.set(0, 0, 0); +#endif + MTXCopy(mpMorf->getModel()->getAnmMtx(JNT_HAND_R), *calc_mtx); cXyz vec3(0.0f, -30.0f, -5.0f); //! @bug vec1 is not initialized in its first two uses, which are probably supposed to be vec3 diff --git a/src/d/actor/d_flower.inc b/src/d/actor/d_flower.inc index 07c722e521..13bc1ad251 100644 --- a/src/d/actor/d_flower.inc +++ b/src/d/actor/d_flower.inc @@ -510,6 +510,10 @@ dFlower_packet_c::dFlower_packet_c() { } m_deleteRoom = &dFlower_packet_c::deleteRoom; + +#if AVOID_UB + m_playerSwordTop.set(0, 0, 0); +#endif } void dFlower_packet_c::draw() { diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 393b6c9762..6b7f7d6ae3 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -2080,7 +2080,12 @@ void dComIfGp_createSubExpHeap2D() { if (dComIfGp_getSubExpHeap2D(i) == NULL) { JKRExpHeap* i_heap = JKRCreateExpHeap(size, dComIfGp_getExpHeap2D(), false); JUT_ASSERT(3576, i_heap != NULL); - JKRHEAP_NAMEF(i_heap, "SubExpHeap2D %d", i); + + #if TARGET_PC + if (i_heap != NULL) { + JKRHEAP_NAMEF(i_heap, "SubExpHeap2D %d", i); + } + #endif dComIfGp_setSubExpHeap2D(i, i_heap); } } diff --git a/src/m_Do/m_Do_machine.cpp b/src/m_Do/m_Do_machine.cpp index fef1875e92..f50c8a6fdb 100644 --- a/src/m_Do/m_Do_machine.cpp +++ b/src/m_Do/m_Do_machine.cpp @@ -514,6 +514,11 @@ void exceptionRestart() { } void myExceptionCallback(u16, OSContext*, u32, u32) { + #if TARGET_PC + printf("myExceptionCallback abort"); + abort(); + #endif + u32 btnHold; u32 btnTrig; @@ -971,8 +976,13 @@ int mDoMch_Create() { sysConsole->setPosition(16, 42); JUTException::setMapFile(MAP_FOLDER MAP_FILE); + #if TARGET_PC + JUTException::setPreUserCallback(nullptr); + JUTException::setPostUserCallback(nullptr); + #else JUTException::setPreUserCallback(myExceptionCallback); JUTException::setPostUserCallback(fault_callback_scroll); + #endif cMl::init(mDoExt_getZeldaHeap()); cM_initRnd(100, 100, 100);