diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2025-04-23 00:08:13 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-23 10:08:13 +0300 |
| commit | 556bfc958c7448656abacda51d710f59ab1c424a (patch) | |
| tree | 1892da46bdba38453f6428ed2851e04a96ec90e0 /src | |
| parent | d3bf501777536ade7d6cfac2744a5fd28089812d (diff) | |
d_menu_dmap_map equivalent / update dtk-template (#2409)
* d_menu_dmap_map equivalent
* update dtk-template
Diffstat (limited to 'src')
| -rw-r--r-- | src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h | 8 | ||||
| -rw-r--r-- | src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/math.h | 9 | ||||
| -rw-r--r-- | src/d/d_menu_dmap.cpp | 1 | ||||
| -rw-r--r-- | src/d/d_menu_dmap_map.cpp | 1594 |
4 files changed, 751 insertions, 861 deletions
diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h index 425777b915..d4e55263a7 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h @@ -27,6 +27,14 @@ inline float abs(float x) { inline float fmod(float x, float y) { return ::fmod(x, y); } + +inline float ceil(float num) { + return ::ceilf(num); +} + +inline float floor(float num) { + return ::floorf(num); +} } // namespace std #endif diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/math.h b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/math.h index 2d10346881..b0837d3b7f 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/math.h +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/math.h @@ -22,7 +22,12 @@ float acosf(float); double asin(double); double atan(double); double atan2(double, double); + double ceil(double); +inline float ceilf(float num) { + return ceil(num); +} + double copysign(double, double); double cos(double); float cosf(float); @@ -44,6 +49,10 @@ inline float fabsf(float f) { } double floor(double); +inline float floorf(float num) { + return floor(num); +} + double fmod(double, double); inline float fmodf(float f1, float f2) { return fmod(f1, f2); diff --git a/src/d/d_menu_dmap.cpp b/src/d/d_menu_dmap.cpp index 375ac0bf4f..3429a3967b 100644 --- a/src/d/d_menu_dmap.cpp +++ b/src/d/d_menu_dmap.cpp @@ -11,6 +11,7 @@ #include "d/d_meter_HIO.h" #include "d/d_meter2_info.h" #include "d/d_lib.h" +#include "d/d_menu_dmap_map.h" #include "JSystem/J2DGraph/J2DAnmLoader.h" #include "JSystem/J2DGraph/J2DGrafContext.h" #include "JSystem/J2DGraph/J2DOrthoGraph.h" diff --git a/src/d/d_menu_dmap_map.cpp b/src/d/d_menu_dmap_map.cpp index c4e10de0ad..9d7bfc3be2 100644 --- a/src/d/d_menu_dmap_map.cpp +++ b/src/d/d_menu_dmap_map.cpp @@ -1,483 +1,181 @@ // -// Generated By: dol2asm // Translation Unit: d/d_menu_dmap_map // #include "d/d_menu_dmap_map.h" -#include "dol2asm.h" - -// -// Types: -// - -struct renderingPlusDoor_c { - /* 80040518 */ void afterDrawPath(); -}; - -struct dTres_c { - struct data_s {}; - - struct typeGroupData_c {}; - - /* 8009C360 */ void getFirstData(u8); - /* 8009C39C */ void getNextData(dTres_c::typeGroupData_c*); - /* 8009C4B0 */ void getTypeToTypeGroupNo(u8); - - static u8 mTypeGroupListAll[204 + 4 /* padding */]; -}; - -struct renderingDmap_c { - /* 801C0380 */ ~renderingDmap_c(); - /* 801C084C */ void hasMap() const; - /* 801C086C */ void isDrawIconSingle2(dTres_c::data_s const*, bool, bool, int) const; - /* 801C0B40 */ void getPlayerCursorSize(); - /* 801C0B48 */ void getLineWidthZoomBig(int); - /* 801C0BAC */ void getLineWidthZoomSmall(int); - /* 801C0C10 */ void getLineWidth(int); - /* 801C0C48 */ void getColor(int); - /* 801C0CB8 */ void afterDrawPath(); - /* 801C25E4 */ void beforeDrawPath(); - /* 801C25E8 */ void getRestartCursorSize(); - /* 801C2614 */ bool isRendAllRoom() const; - /* 801C261C */ bool isRendDoor() const; - /* 801C2624 */ bool isCheckFloor() const; - /* 801C262C */ bool isRendRestart() const; - /* 801C2634 */ bool isRendCursor() const; - /* 801C263C */ bool isRendIcon() const; -}; - -struct dDrawPath_c { - struct line_class {}; - - struct poly_class {}; - - struct room_class {}; - - struct group_class {}; - - /* 8002ABF0 */ bool isDrawType(int); - /* 8002AD84 */ void getLineColor(int, int); - /* 8003CA40 */ void rendering(dDrawPath_c::poly_class const*); - /* 8003CC24 */ void rendering(dDrawPath_c::room_class const*); - /* 8003C94C */ void rendering(dDrawPath_c::line_class const*); - /* 8003CCC4 */ void drawPath(); -}; - -struct Vec {}; - -struct renderingDAmap_c { - /* 8003FCC8 */ void init(u8*, u16, u16, u16, u16); - /* 8003FD08 */ void entry(f32, f32, f32, int, s8); - /* 8003FD9C */ void isSwitch(dDrawPath_c::group_class const*); - /* 8003FE18 */ void draw(); - /* 8003FE4C */ void getBackColor() const; - /* 8003FE54 */ void isRenderingFloor(int); - /* 8003FE70 */ void isDrawRoom(int, int) const; - /* 8003FF14 */ void preDrawPath(); - /* 8003FFC4 */ void postDrawPath(); - /* 8003FFEC */ void getRoomNoSingle(); - /* 80040134 */ void getFirstRoomPointer(); - /* 800401E8 */ void getNextRoomPointer(); - /* 800402C0 */ void isDrawPath(); - /* 800402E0 */ bool getFirstDrawLayerNo(); - /* 800402E8 */ void getNextDrawLayerNo(int); - /* 800409B4 */ void isDrawRoomIcon(int, int) const; - /* 800409E0 */ void isDrawIconSingle(dTres_c::data_s const*, int, int, bool, bool, - Vec const*) const; - /* 80040AE4 */ void getIconGroupNumber(u8) const; -}; - -struct _GXColor {}; - -struct mDoGph_gInf_c { - /* 80007FD8 */ void fadeOut(f32, _GXColor&); -}; - -struct dSv_memBit_c { - /* 800347E8 */ void isTbox(int) const; - /* 80034934 */ void isDungeonItem(int) const; -}; - -struct dSv_info_c { - /* 80035360 */ void isSwitch(int, int) const; -}; - -struct dStage_roomControl_c { - static u8 mStatus[65792]; -}; - -struct ResTIMG {}; - -struct dRenderingMap_c { - /* 8003CD38 */ void makeResTIMG(ResTIMG*, u16, u16, u8*, u8*, u16) const; -}; - -struct dRenderingFDAmap_c { - /* 8003D188 */ void preRenderingMap(); - /* 8003D320 */ void postRenderingMap(); - /* 8003D68C */ void getDecoLineColor(int, int); - /* 8003D6B8 */ void getDecorationLineWidth(int); -}; - -struct dMpath_c { - /* 8003F760 */ void getTopBottomFloorNo(s8*, s8*); - - static u8 mLayerList[4]; - static f32 mAllCenterX; - static f32 mAllCenterZ; - static f32 mAllSizeX; - static f32 mAllSizeZ; -}; +#include "d/d_menu_dmap.h" +#include "d/d_map_path_dmap.h" +#include "d/d_com_inf_game.h" +#include "m_Do/m_Do_graphic.h" +#include "f_op/f_op_msg_mng.h" +#include <cmath.h> struct dMdm_HIO_prm_res_dst_s { - static u8 m_res[4]; + static void* m_res; }; -struct dMapInfo_n { - /* 8003ECA0 */ void chkGetCompass(); - /* 8003ECD8 */ void chkGetMap(); - /* 8003ED10 */ void isVisitedRoom(int); - /* 8003EE5C */ void getMapPlayerPos(); - /* 8003EF20 */ void getMapPlayerAngleY(); - /* 8003F02C */ void getMapRestartPos(); - /* 8003F0F8 */ void getMapRestartAngleY(); - /* 8003F19C */ void getRoomCenter(int, f32*, f32*); - /* 8003F1F4 */ void getRoomMinMaxXZ(int, f32*, f32*, f32*, f32*); -}; - -struct dMapInfo_c { - /* 8003F570 */ void calcNowStayFloorNo(f32, bool); -}; - -// -// Forward References: -// - -extern "C" void hasMap__15renderingDmap_cCFv(); -extern "C" void isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi(); -extern "C" void getPlayerCursorSize__15renderingDmap_cFv(); -extern "C" void getLineWidthZoomBig__15renderingDmap_cFi(); -extern "C" void getLineWidthZoomSmall__15renderingDmap_cFi(); -extern "C" void getLineWidth__15renderingDmap_cFi(); -extern "C" void getColor__15renderingDmap_cFi(); -extern "C" void afterDrawPath__15renderingDmap_cFv(); -extern "C" void _create__15dMenu_DmapMap_cFUsUsUsUsPv(); -extern "C" void _delete__15dMenu_DmapMap_cFv(); -extern "C" void setTexture__15dMenu_DmapMap_cFUsUsUsUs(); -extern "C" void setPos__15dMenu_DmapMap_cFiifffbf(); -extern "C" void getMapBlendPer__20dMenu_StageMapCtrl_cCFv(); -extern "C" void getPixelStageSizeX__20dMenu_StageMapCtrl_cCFv(); -extern "C" void getPixelStageSizeZ__20dMenu_StageMapCtrl_cCFv(); -extern "C" void getPixelCenterX__20dMenu_StageMapCtrl_cCFv(); -extern "C" void getPixelCenterZ__20dMenu_StageMapCtrl_cCFv(); -extern "C" void initGetTreasureList__20dMenu_StageMapCtrl_cFUcSc(); -extern "C" void getTreasureList__20dMenu_StageMapCtrl_cFPfPfPScPUcPSc(); -extern "C" void cnvPosTo2Dpos__20dMenu_StageMapCtrl_cCFffPfPf(); -extern "C" void getPlayerDrawInfo__20dMenu_StageMapCtrl_cCFPfPfPs(); -extern "C" void getRestartDrawInfo__20dMenu_StageMapCtrl_cCFPfPfPs(); -extern "C" void setPlusNowStayFloorNo__20dMenu_StageMapCtrl_cFScUc(); -extern "C" void moveFloor__20dMenu_StageMapCtrl_cFv(); -extern "C" void wait_init_proc__20dMenu_StageMapCtrl_cFv(); -extern "C" void wait_proc__20dMenu_StageMapCtrl_cFv(); -extern "C" void zoomIn_init_proc__20dMenu_StageMapCtrl_cFv(); -extern "C" void getZoomMinMaxCheck__19dMenu_DmapMapCtrl_cFPfPfPfPfPbPb(); -extern "C" void calcZoomCenter__19dMenu_DmapMapCtrl_cFPfPf(); -extern "C" void getZoomCmPerPixel__19dMenu_DmapMapCtrl_cFv(); -extern "C" void initZoomIn__20dMenu_StageMapCtrl_cFUc(); -extern "C" void initZoomIn__20dMenu_StageMapCtrl_cFUcff(); -extern "C" void initZoomInCenterHold__20dMenu_StageMapCtrl_cFUc(); -extern "C" void zoomCalcSet__20dMenu_StageMapCtrl_cFf(); -extern "C" void zoomIn_proc__20dMenu_StageMapCtrl_cFv(); -extern "C" void initZoomOut__20dMenu_StageMapCtrl_cFUc(); -extern "C" void initZoomWait__20dMenu_StageMapCtrl_cFff(); -extern "C" void zoomWait_init_proc__20dMenu_StageMapCtrl_cFv(); -extern "C" void isEnableZoomMove__19dMenu_DmapMapCtrl_cCFv(); -extern "C" void zoomWait_proc__20dMenu_StageMapCtrl_cFv(); -extern "C" void zoomOut_init_proc__20dMenu_StageMapCtrl_cFv(); -extern "C" void zoomOut_proc__20dMenu_StageMapCtrl_cFv(); -extern "C" void move__20dMenu_StageMapCtrl_cFv(); -extern "C" void draw__19dMenu_DmapMapCtrl_cFv(); -extern "C" void getPlayerStayFloorNo__20dMenu_StageMapCtrl_cCFv(); -extern "C" void _create__20dMenu_StageMapCtrl_cFUsUsUsUsPv(); -extern "C" void _create__20dMenu_StageMapCtrl_cFUsUsUsUsScPv(); -extern "C" void _delete__20dMenu_StageMapCtrl_cFv(); -extern "C" void isEnableZoomIn__20dMenu_StageMapCtrl_cFv(); -extern "C" void isEnableZoomOut__20dMenu_StageMapCtrl_cFv(); -extern "C" void setPlusZoomCenterX__20dMenu_StageMapCtrl_cFf(); -extern "C" void setPlusZoomCenterZ__20dMenu_StageMapCtrl_cFf(); -extern "C" void getInitWholeMapScale__19dMenu_DmapMapCtrl_cFPfffff(); -extern "C" void getInitDispCenter__19dMenu_DmapMapCtrl_cFPfPf(); -extern "C" void beforeDrawPath__15renderingDmap_cFv(); -extern "C" void getRestartCursorSize__15renderingDmap_cFv(); -extern "C" bool isRendAllRoom__15renderingDmap_cCFv(); -extern "C" bool isRendDoor__15renderingDmap_cCFv(); -extern "C" bool isCheckFloor__15renderingDmap_cCFv(); -extern "C" bool isRendRestart__15renderingDmap_cCFv(); -extern "C" bool isRendCursor__15renderingDmap_cCFv(); -extern "C" bool isRendIcon__15renderingDmap_cCFv(); -extern "C" void __sinit_d_menu_dmap_map_cpp(); -extern "C" extern void* __vt__19dMenu_DmapMapCtrl_c[10 + 51 /* padding */]; -extern "C" extern void* __vt__15renderingDmap_c[43 + 1 /* padding */]; -extern "C" u8 m_res__22dMdm_HIO_prm_res_dst_s[4]; -extern "C" f32 m_zoomCenterMinX__20dMenu_StageMapCtrl_c; -extern "C" f32 m_zoomCenterMaxX__20dMenu_StageMapCtrl_c; -extern "C" f32 m_zoomCenterMinZ__20dMenu_StageMapCtrl_c; -extern "C" f32 m_zoomCenterMaxZ__20dMenu_StageMapCtrl_c[1 + 1 /* padding */]; - -// -// External References: -// - -extern "C" void fadeOut__13mDoGph_gInf_cFfR8_GXColor(); -extern "C" void fopMsgM_valueIncrease__FiiUc(); -extern "C" bool isDrawType__11dDrawPath_cFi(); -extern "C" void getLineColor__11dDrawPath_cFii(); -extern "C" void isTbox__12dSv_memBit_cCFi(); -extern "C" void isDungeonItem__12dSv_memBit_cCFi(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void rendering__11dDrawPath_cFPCQ211dDrawPath_c10line_class(); -extern "C" void rendering__11dDrawPath_cFPCQ211dDrawPath_c10poly_class(); -extern "C" void rendering__11dDrawPath_cFPCQ211dDrawPath_c10room_class(); -extern "C" void drawPath__11dDrawPath_cFv(); -extern "C" void makeResTIMG__15dRenderingMap_cCFP7ResTIMGUsUsPUcPUcUs(); -extern "C" void preRenderingMap__18dRenderingFDAmap_cFv(); -extern "C" void postRenderingMap__18dRenderingFDAmap_cFv(); -extern "C" void getDecoLineColor__18dRenderingFDAmap_cFii(); -extern "C" void getDecorationLineWidth__18dRenderingFDAmap_cFi(); -extern "C" void chkGetCompass__10dMapInfo_nFv(); -extern "C" void chkGetMap__10dMapInfo_nFv(); -extern "C" void isVisitedRoom__10dMapInfo_nFi(); -extern "C" void getMapPlayerPos__10dMapInfo_nFv(); -extern "C" void getMapPlayerAngleY__10dMapInfo_nFv(); -extern "C" void getMapRestartPos__10dMapInfo_nFv(); -extern "C" void getMapRestartAngleY__10dMapInfo_nFv(); -extern "C" void getRoomCenter__10dMapInfo_nFiPfPf(); -extern "C" void getRoomMinMaxXZ__10dMapInfo_nFiPfPfPfPf(); -extern "C" void calcNowStayFloorNo__10dMapInfo_cFfb(); -extern "C" void getTopBottomFloorNo__8dMpath_cFPScPSc(); -extern "C" void init__16renderingDAmap_cFPUcUsUsUsUs(); -extern "C" void entry__16renderingDAmap_cFfffiSc(); -extern "C" void isSwitch__16renderingDAmap_cFPCQ211dDrawPath_c11group_class(); -extern "C" void draw__16renderingDAmap_cFv(); -extern "C" void getBackColor__16renderingDAmap_cCFv(); -extern "C" void isRenderingFloor__16renderingDAmap_cFi(); -extern "C" void isDrawRoom__16renderingDAmap_cCFii(); -extern "C" void preDrawPath__16renderingDAmap_cFv(); -extern "C" void postDrawPath__16renderingDAmap_cFv(); -extern "C" void getRoomNoSingle__16renderingDAmap_cFv(); -extern "C" void getFirstRoomPointer__16renderingDAmap_cFv(); -extern "C" void getNextRoomPointer__16renderingDAmap_cFv(); -extern "C" void isDrawPath__16renderingDAmap_cFv(); -extern "C" bool getFirstDrawLayerNo__16renderingDAmap_cFv(); -extern "C" void getNextDrawLayerNo__16renderingDAmap_cFi(); -extern "C" void afterDrawPath__19renderingPlusDoor_cFv(); -extern "C" void isDrawRoomIcon__16renderingDAmap_cCFii(); -extern "C" void isDrawIconSingle__16renderingDAmap_cCFPCQ27dTres_c6data_siiibPC3Vec(); -extern "C" void getIconGroupNumber__16renderingDAmap_cCFUc(); -extern "C" void getFirstData__7dTres_cFUc(); -extern "C" void getNextData__7dTres_cFPQ27dTres_c15typeGroupData_c(); -extern "C" void getTypeToTypeGroupNo__7dTres_cFUc(); -extern "C" void __dt__19dMenu_DmapMapCtrl_cFv(); -extern "C" void __dt__15renderingDmap_cFv(); -extern "C" void* __nw__FUli(); -extern "C" void* __nwa__FUli(); -extern "C" void __dla__FPv(); -extern "C" void GXGetTexBufferSize(); -extern "C" void __ptmf_scall(); -extern "C" void _savefpr_28(); -extern "C" void _restfpr_28(); -extern "C" void _savegpr_22(); -extern "C" void _savegpr_25(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_22(); -extern "C" void _restgpr_25(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" void ceil(); -extern "C" void floor(); -extern "C" void fmod(); -extern "C" u8 mStatus__20dStage_roomControl_c[65792]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; -extern "C" u8 mTypeGroupListAll__7dTres_c[204 + 4 /* padding */]; -extern "C" extern u32 __float_max; -extern "C" extern u8 mStayNo__20dStage_roomControl_c[4]; -extern "C" extern u8 mNowStayFloorNo__10dMapInfo_c[4]; -extern "C" extern u8 mNowStayFloorNoDecisionFlg__10dMapInfo_c[4]; -extern "C" u8 mLayerList__8dMpath_c[4]; -extern "C" f32 mAllCenterX__8dMpath_c; -extern "C" f32 mAllCenterZ__8dMpath_c; -extern "C" f32 mAllSizeX__8dMpath_c; -extern "C" f32 mAllSizeZ__8dMpath_c; - -// -// Declarations: -// - -/* 801C084C-801C086C 1BB18C 0020+00 1/0 0/0 0/0 .text hasMap__15renderingDmap_cCFv */ -void renderingDmap_c::hasMap() const { - // NONMATCHING -} - -/* ############################################################################################## */ /* 803BCB60-803BCB6C 019C80 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */ -SECTION_DATA static u8 cNullVec__6Z2Calc[12] = { +static u8 cNullVec__6Z2Calc[12] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -/* 803BCB6C-803BCBC0 -00001 0044+10 1/1 0/0 0/0 .data @3798 */ -SECTION_DATA static void* lit_3798[17 + 4 /* padding */] = { - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x80), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0xE0), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0xB4), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x15C), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x2B8), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0xF8), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x2B8), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x2B8), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0xE0), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x1B4), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x2B8), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x1EC), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x1FC), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x2B8), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x2B8), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x234), - (void*)(((char*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi) + 0x26C), - /* padding */ - NULL, - NULL, - NULL, - NULL, -}; +/* 801C084C-801C086C 1BB18C 0020+00 1/0 0/0 0/0 .text hasMap__15renderingDmap_cCFv */ +bool renderingDmap_c::hasMap() const { + return dMapInfo_n::chkGetMap(); +} /* 801C086C-801C0B40 1BB1AC 02D4+00 2/0 0/0 0/0 .text * isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi */ -void renderingDmap_c::isDrawIconSingle2(dTres_c::data_s const* param_0, bool param_1, - bool param_2, int param_3) const { - // NONMATCHING +bool renderingDmap_c::isDrawIconSingle2(dTres_c::data_s const* i_data, bool param_1, + bool param_2, int param_3) const { + JUT_ASSERT(995, i_data != 0); + + bool rt = false; + int var_r27 = dTres_c::getTypeToTypeGroupNo(i_data->mType); + bool is_get_map = false; + bool is_get_compass = false; + + if (dMapInfo_n::chkGetMap()) { + is_get_map = true; + } + + if (dMapInfo_n::chkGetCompass()) { + is_get_compass = true; + } + + bool var_r29 = false; + if (is_get_compass && param_1) { + var_r29 = true; + } + + switch (var_r27) { + default: + JUT_ASSERT(1015, 0); + break; + case 0: + if (var_r29 && i_data->mNo != 0xFF && !dComIfGs_isTbox(i_data->mNo)) { + rt = true; + } + break; + case 2: + if (var_r29 && !dComIfGs_isTbox(i_data->mNo)) { + rt = true; + } + break; + case 1: + case 8: + if (param_1 && param_2) { + rt = true; + } + break; + case 4: + JUT_ASSERT(1044, 0); + break; + case 5: + if ((i_data->mNo == 0xFF || (i_data->mNo != 0xFF && !dComIfGs_isTbox(i_data->mNo))) && (i_data->mSwBit == 0xFF || (i_data->mSwBit != 0xFF && dComIfGs_isSwitch(i_data->mSwBit, i_data->mRoomNo))) && param_1) { + rt = true; + } + break; + case 6: + JUT_ASSERT(1070, 0); + break; + case 3: + if (var_r29 && (i_data->mSwBit == 0xFF || (i_data->mSwBit != 0xFF && dComIfGs_isSwitch(i_data->mSwBit, i_data->mRoomNo))) && !dComIfGs_isStageBossEnemy()) { + rt = true; + } + break; + case 9: + if (var_r29 && (i_data->mNo == 0xFF || (i_data->mNo != 0xFF && !dComIfGs_isTbox(i_data->mNo)))) { + rt = true; + } + break; + case 10: + JUT_ASSERT(1100, 0); + break; + case 11: + if (var_r29) { + rt = true; + } + break; + case 12: + if (var_r29 && (i_data->mNo == 0xFF || (i_data->mNo != 0xFF && !dComIfGs_isTbox(i_data->mNo)))) { + rt = true; + } + break; + case 13: + case 14: + JUT_ASSERT(1123, 0); + break; + case 15: + if (var_r29 && (i_data->mNo == 0xFF || (i_data->mNo != 0xFF && dComIfGs_isTbox(i_data->mNo)))) { + rt = true; + } + break; + case 16: + if (!dComIfGs_isStageBossEnemy() && var_r29 && (i_data->mNo == 0xFF || (i_data->mNo != 0xFF && !dComIfGs_isTbox(i_data->mNo)))) { + rt = true; + } + break; + } + + return rt; } -/* ############################################################################################## */ -/* 80454060-80454064 002660 0004+00 10/10 0/0 0/0 .sdata2 @3803 */ -SECTION_SDATA2 static u8 lit_3803[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; - /* 801C0B40-801C0B48 1BB480 0008+00 1/0 0/0 0/0 .text getPlayerCursorSize__15renderingDmap_cFv */ -void renderingDmap_c::getPlayerCursorSize() { - // NONMATCHING +f32 renderingDmap_c::getPlayerCursorSize() { + return 0.0f; } -/* ############################################################################################## */ -/* 80454064-8045406C 002664 0005+03 1/1 0/0 0/0 .sdata2 l_lineWidthPatOff$3807 */ -SECTION_SDATA2 static u8 l_lineWidthPatOff_3807[5 + 3 /* padding */] = { - 0x00, - 0x00, - 0x06, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, -}; - -/* 8045406C-80454074 00266C 0005+03 1/1 0/0 0/0 .sdata2 l_lineWidthPatOn$3808 */ -SECTION_SDATA2 static u8 l_lineWidthPatOn_3808[5 + 3 /* padding */] = { - 0x06, - 0x06, - 0x0C, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, -}; - -/* 80454074-8045407C 002674 0005+03 1/1 0/0 0/0 .sdata2 l_lineWidthPatStay$3809 */ -SECTION_SDATA2 static u8 l_lineWidthPatStay_3809[5 + 3 /* padding */] = { - 0x06, - 0x06, - 0x0C, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, -}; - /* 801C0B48-801C0BAC 1BB488 0064+00 1/1 0/0 0/0 .text getLineWidthZoomBig__15renderingDmap_cFi */ -void renderingDmap_c::getLineWidthZoomBig(int param_0) { - // NONMATCHING +int renderingDmap_c::getLineWidthZoomBig(int param_0) { + static const u8 l_lineWidthPatOff[] = {0, 0, 6, 0, 0}; + static const u8 l_lineWidthPatOn[] = {6, 6, 12, 0, 0}; + static const u8 l_lineWidthPatStay[] = {6, 6, 12, 0, 0}; + const u8* var_r28; + + var_r28 = l_lineWidthPatOff; + if (mRoomNo == mRoomNoSingle) { + var_r28 = l_lineWidthPatStay; + } else if (dMapInfo_n::isVisitedRoom(mRoomNo)) { + var_r28 = l_lineWidthPatOn; + } + + return var_r28[param_0]; } -/* ############################################################################################## */ -/* 8045407C-80454084 00267C 0005+03 1/1 0/0 0/0 .sdata2 l_lineWidthPatOff$3820 */ -SECTION_SDATA2 static u8 l_lineWidthPatOff_3820[5 + 3 /* padding */] = { - 0x00, - 0x00, - 0x06, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, -}; - -/* 80454084-8045408C 002684 0005+03 1/1 0/0 0/0 .sdata2 l_lineWidthPatOn$3821 */ -SECTION_SDATA2 static u8 l_lineWidthPatOn_3821[5 + 3 /* padding */] = { - 0x00, - 0x00, - 0x06, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, -}; - -/* 8045408C-80454094 00268C 0005+03 1/1 0/0 0/0 .sdata2 l_lineWidthPatStay$3822 */ -SECTION_SDATA2 static u8 l_lineWidthPatStay_3822[5 + 3 /* padding */] = { - 0x00, - 0x00, - 0x06, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, -}; - /* 801C0BAC-801C0C10 1BB4EC 0064+00 1/1 0/0 0/0 .text getLineWidthZoomSmall__15renderingDmap_cFi */ -void renderingDmap_c::getLineWidthZoomSmall(int param_0) { - // NONMATCHING +int renderingDmap_c::getLineWidthZoomSmall(int param_0) { + static const u8 l_lineWidthPatOff[] = {0, 0, 6, 0, 0}; + static const u8 l_lineWidthPatOn[] = {0, 0, 6, 0, 0}; + static const u8 l_lineWidthPatStay[] = {0, 0, 6, 0, 0}; + const u8* var_r28; + + var_r28 = l_lineWidthPatOff; + if (mRoomNo == mRoomNoSingle) { + var_r28 = l_lineWidthPatStay; + } else if (dMapInfo_n::isVisitedRoom(mRoomNo)) { + var_r28 = l_lineWidthPatOn; + } + + return var_r28[param_0]; } -/* ############################################################################################## */ -/* 80454094-80454098 002694 0004+00 4/4 0/0 0/0 .sdata2 @3837 */ -SECTION_SDATA2 static f32 lit_3837 = 0.5f; - /* 801C0C10-801C0C48 1BB550 0038+00 1/0 0/0 0/0 .text getLineWidth__15renderingDmap_cFi */ -void renderingDmap_c::getLineWidth(int param_0) { - // NONMATCHING +int renderingDmap_c::getLineWidth(int param_0) { + int var_r31; + if (field_0x34 > 0.5f) { + var_r31 = getLineWidthZoomBig(param_0); + } else { + var_r31 = getLineWidthZoomSmall(param_0); + } + + return var_r31; } -/* ############################################################################################## */ /* 80395860-80395950 -00001 00F0+00 1/1 0/0 0/0 .rodata l_paletteDmap_m */ -SECTION_RODATA static u32 const l_paletteDmap_m[60] = { +static u32 const l_paletteDmap_m[60] = { 0x00000000, 0x00000000, 0x80008000, @@ -539,260 +237,490 @@ SECTION_RODATA static u32 const l_paletteDmap_m[60] = { 0x00000000, 0x00000000, }; -COMPILER_STRIP_GATE(0x80395860, &l_paletteDmap_m); - -/* 80395950-80395974 021FB0 0024+00 0/1 0/0 0/0 .rodata l_dungeon_offColor$3841 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const l_dungeon_offColor[36] = { - 0x08, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, - 0x1C, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80395950, &l_dungeon_offColor); -#pragma pop - -/* 80395974-80395998 021FD4 0024+00 0/1 0/0 0/0 .rodata l_dungeon_onColor$3842 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const l_dungeon_onColor[36] = { - 0x28, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, - 0x3C, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80395974, &l_dungeon_onColor); -#pragma pop - -/* 80395998-803959C0 021FF8 0024+04 0/1 0/0 0/0 .rodata l_dungeon_stayColor$3843 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const l_dungeon_stayColor[36 + 4 /* padding */] = { - 0x48, - 0x00, - 0x00, - 0x00, - 0x4C, - 0x00, - 0x00, - 0x00, - 0x50, - 0x00, - 0x00, - 0x00, - 0x04, - 0x00, - 0x00, - 0x00, - 0x54, - 0x00, - 0x00, - 0x00, - 0x58, - 0x00, - 0x00, - 0x00, - 0x5C, - 0x00, - 0x00, - 0x00, - 0x60, - 0x00, - 0x00, - 0x00, - 0x64, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80395998, &l_dungeon_stayColor); -#pragma pop /* 801C0C48-801C0CB8 1BB588 0070+00 1/0 0/0 0/0 .text getColor__15renderingDmap_cFi */ -void renderingDmap_c::getColor(int param_0) { - // NONMATCHING +const GXColor* renderingDmap_c::getColor(int param_0) { + static const GXColor l_dungeon_offColor[] = { + {0x08, 0x00, 0x00, 0x00}, + {0x0C, 0x00, 0x00, 0x00}, + {0x10, 0x00, 0x00, 0x00}, + {0x04, 0x00, 0x00, 0x00}, + {0x14, 0x00, 0x00, 0x00}, + {0x18, 0x00, 0x00, 0x00}, + {0x1C, 0x00, 0x00, 0x00}, + {0x20, 0x00, 0x00, 0x00}, + {0x24, 0x00, 0x00, 0x00}, + }; + + static const GXColor l_dungeon_onColor[] = { + {0x28, 0x00, 0x00, 0x00}, + {0x2C, 0x00, 0x00, 0x00}, + {0x30, 0x00, 0x00, 0x00}, + {0x04, 0x00, 0x00, 0x00}, + {0x34, 0x00, 0x00, 0x00}, + {0x38, 0x00, 0x00, 0x00}, + {0x3C, 0x00, 0x00, 0x00}, + {0x40, 0x00, 0x00, 0x00}, + {0x44, 0x00, 0x00, 0x00}, + }; + + static const GXColor l_dungeon_stayColor[] = { + {0x48, 0x00, 0x00, 0x00}, + {0x4C, 0x00, 0x00, 0x00}, + {0x50, 0x00, 0x00, 0x00}, + {0x04, 0x00, 0x00, 0x00}, + {0x54, 0x00, 0x00, 0x00}, + {0x58, 0x00, 0x00, 0x00}, + {0x5C, 0x00, 0x00, 0x00}, + {0x60, 0x00, 0x00, 0x00}, + {0x64, 0x00, 0x00, 0x00}, + }; + + const GXColor* var_r28; + + var_r28 = l_dungeon_offColor; + if (mRoomNo == mRoomNoSingle) { + var_r28 = l_dungeon_stayColor; + } else if (dMapInfo_n::isVisitedRoom(mRoomNo)) { + var_r28 = l_dungeon_onColor; + } + + return &var_r28[param_0]; } /* 801C0CB8-801C0CD8 1BB5F8 0020+00 1/0 0/0 0/0 .text afterDrawPath__15renderingDmap_cFv */ void renderingDmap_c::afterDrawPath() { - // NONMATCHING + renderingPlusDoor_c::afterDrawPath(); } -/* ############################################################################################## */ /* 80451088-8045108C 000588 0004+00 2/2 0/0 0/0 .sbss m_res__22dMdm_HIO_prm_res_dst_s */ -u8 dMdm_HIO_prm_res_dst_s::m_res[4]; +void* dMdm_HIO_prm_res_dst_s::m_res; /* 801C0CD8-801C0D04 1BB618 002C+00 1/1 0/0 0/0 .text _create__15dMenu_DmapMap_cFUsUsUsUsPv */ void dMenu_DmapMap_c::_create(u16 param_0, u16 param_1, u16 param_2, u16 param_3, - void* param_4) { - // NONMATCHING + void* res) { + JUT_ASSERT(1569, res != 0); + dMdm_HIO_prm_res_dst_s::m_res = res; + field_0x84 = 120; + setTexture(param_0, param_1, param_2, param_3); } /* 801C0D04-801C0D70 1BB644 006C+00 1/1 0/0 0/0 .text _delete__15dMenu_DmapMap_cFv */ void dMenu_DmapMap_c::_delete() { - // NONMATCHING + for (int i = 0; i < 2; i++) { + if (mMapImage_p[i] != NULL) { + delete[] mMapImage_p[i]; + } + + if (mResTIMG[i] != NULL) { + delete[] mResTIMG[i]; + } + } } /* 801C0D70-801C0E4C 1BB6B0 00DC+00 1/1 0/0 0/0 .text setTexture__15dMenu_DmapMap_cFUsUsUsUs */ void dMenu_DmapMap_c::setTexture(u16 param_0, u16 param_1, u16 param_2, u16 param_3) { - // NONMATCHING + for (int lp1 = 0; lp1 < 2; lp1++) { + u32 var_r27 = GXGetTexBufferSize(param_0, param_1, 9, 0, 0); + mMapImage_p[lp1] = new (0x20) u8[var_r27]; + JUT_ASSERT(1672, mMapImage_p[lp1] != 0); + mRend[lp1].init(mMapImage_p[lp1], param_0, param_1, param_2, param_3); + + mResTIMG[lp1] = new (0x20) ResTIMG; + JUT_ASSERT(1687, mResTIMG[lp1] != 0); + mRend[lp1].makeResTIMG(mResTIMG[lp1], param_0, param_1, mMapImage_p[lp1], (u8*)dMdm_HIO_prm_res_dst_s::m_res, 30); + } } /* 801C0E4C-801C0EE0 1BB78C 0094+00 1/1 0/0 0/0 .text setPos__15dMenu_DmapMap_cFiifffbf */ void dMenu_DmapMap_c::setPos(int param_0, int param_1, f32 param_2, f32 param_3, f32 param_4, - bool param_5, f32 param_6) { - // NONMATCHING + bool param_5, f32 param_6) { + mRend[0].entry(param_2, param_3, param_4, dComIfGp_roomControl_getStayNo(), param_0, param_6); + mRend[1].entry(param_2, param_3, param_4, dComIfGp_roomControl_getStayNo(), param_1, param_6); } -/* ############################################################################################## */ -/* 80454098-804540A0 002698 0004+04 9/9 0/0 0/0 .sdata2 @3946 */ -SECTION_SDATA2 static f32 lit_3946[1 + 1 /* padding */] = { - 1.0f, - /* padding */ - 0.0f, -}; - -/* 804540A0-804540A8 0026A0 0008+00 2/2 0/0 0/0 .sdata2 @3947 */ -SECTION_SDATA2 static f64 lit_3947 = 1.0; - /* 801C0EE0-801C0F24 1BB820 0044+00 0/0 2/2 0/0 .text getMapBlendPer__20dMenu_StageMapCtrl_cCFv */ f32 dMenu_StageMapCtrl_c::getMapBlendPer() const { - // NONMATCHING + f32 var_f31; + if (field_0x90 == 0.0f) { + var_f31 = 1.0f; + } else { + var_f31 = std::fmod(field_0x90, 1.0f); + } + + return var_f31; } /* 801C0F24-801C0F3C 1BB864 0018+00 0/0 1/1 0/0 .text * getPixelStageSizeX__20dMenu_StageMapCtrl_cCFv */ -void dMenu_StageMapCtrl_c::getPixelStageSizeX() const { - // NONMATCHING +f32 dMenu_StageMapCtrl_c::getPixelStageSizeX() const { + f32 var_f31 = dMpath_c::getSizeX(); + return var_f31 * (1.0f / field_0xbc); } /* 801C0F3C-801C0F54 1BB87C 0018+00 0/0 1/1 0/0 .text * getPixelStageSizeZ__20dMenu_StageMapCtrl_cCFv */ -void dMenu_StageMapCtrl_c::getPixelStageSizeZ() const { - // NONMATCHING +f32 dMenu_StageMapCtrl_c::getPixelStageSizeZ() const { + f32 var_f31 = dMpath_c::getSizeZ(); + return var_f31 * (1.0f / field_0xbc); } /* 801C0F54-801C0F74 1BB894 0020+00 0/0 1/1 0/0 .text getPixelCenterX__20dMenu_StageMapCtrl_cCFv */ -void dMenu_StageMapCtrl_c::getPixelCenterX() const { - // NONMATCHING +f32 dMenu_StageMapCtrl_c::getPixelCenterX() const { + f32 var_f31 = dMpath_c::getCenterX(); + return (1.0f / field_0xbc) * (field_0x9c - var_f31); } /* 801C0F74-801C0F94 1BB8B4 0020+00 0/0 1/1 0/0 .text getPixelCenterZ__20dMenu_StageMapCtrl_cCFv */ -void dMenu_StageMapCtrl_c::getPixelCenterZ() const { - // NONMATCHING +f32 dMenu_StageMapCtrl_c::getPixelCenterZ() const { + f32 var_f31 = dMpath_c::getCenterZ(); + return (1.0f / field_0xbc) * (field_0xa0 - var_f31); } /* 801C0F94-801C0FF8 1BB8D4 0064+00 0/0 1/1 0/0 .text * initGetTreasureList__20dMenu_StageMapCtrl_cFUcSc */ void dMenu_StageMapCtrl_c::initGetTreasureList(u8 param_0, s8 param_1) { - // NONMATCHING + field_0xf6 = param_0; + field_0xf7 = param_1; + field_0x8c = dTres_c::getFirstData(param_0); + field_0xe4 = dTres_c::getTypeGroupNumber(param_0); +} + +inline static s16 rightModeCnvRot(s16 param_0) { + return param_0; } /* 801C0FF8-801C1128 1BB938 0130+00 0/0 1/1 0/0 .text * getTreasureList__20dMenu_StageMapCtrl_cFPfPfPScPUcPSc */ bool dMenu_StageMapCtrl_c::getTreasureList(f32* param_0, f32* param_1, s8* param_2, u8* param_3, - s8* param_4) { - // NONMATCHING + s8* param_4) { + bool var_r30 = false; + + while (field_0xe4 != 0 && !var_r30) { + Vec sp10; + sp10 = *field_0x8c->getPos(); + + if (getRendPointer(0)->isDrawIconSingle(field_0x8c->getDataPointer(), (s8)dComIfGp_roomControl_getStayNo(), field_0xf7, true, true, &sp10)) { + cnvPosTo2Dpos(sp10.x, sp10.z, param_0, param_1); + + if (param_2 != NULL) { + *param_2 = rightModeCnvRot((s8)field_0x8c->getAngleY()) >> 8; + } + + if (param_3 != NULL) { + *param_3 = field_0x8c->getSwBit(); + } + + if (param_4 != NULL) { + *param_4 = field_0x8c->getRoomNo(); + } + + var_r30 = true; + } + + field_0x8c = dTres_c::getNextData(field_0x8c); + field_0xe4--; + } + + return var_r30; +} + +inline static f32 rightModeCnvPos(f32 param_0) { + return param_0; } /* 801C1128-801C1194 1BBA68 006C+00 3/3 0/0 0/0 .text * cnvPosTo2Dpos__20dMenu_StageMapCtrl_cCFffPfPf */ void dMenu_StageMapCtrl_c::cnvPosTo2Dpos(f32 param_0, f32 param_1, f32* param_2, - f32* param_3) const { - // NONMATCHING + f32* param_3) const { + if (param_2 != NULL) { + *param_2 = (0.5f * field_0x94) + rightModeCnvPos((1.0f / field_0xbc) * (param_0 - field_0x9c)); + } + + if (param_3 != NULL) { + *param_3 = (0.5f * field_0x98) + ((1.0f / field_0xbc) * (param_1 - field_0xa0)); + } } /* 801C1194-801C1218 1BBAD4 0084+00 0/0 1/1 0/0 .text * getPlayerDrawInfo__20dMenu_StageMapCtrl_cCFPfPfPs */ -void dMenu_StageMapCtrl_c::getPlayerDrawInfo(f32* param_0, f32* param_1, s16* param_2) const { - // NONMATCHING +void dMenu_StageMapCtrl_c::getPlayerDrawInfo(f32* i_dispX, f32* i_dispY, s16* i_rotY) const { + JUT_ASSERT(2030, i_dispX != 0); + JUT_ASSERT(2031, i_dispX != 0); + JUT_ASSERT(2032, i_rotY != 0); + + Vec sp10 = dMapInfo_n::getMapPlayerPos(); + cnvPosTo2Dpos(sp10.x, sp10.z, i_dispX, i_dispY); + + if (i_rotY != NULL) { + *i_rotY = rightModeCnvRot(dMapInfo_n::getMapPlayerAngleY()); + } } /* 801C1218-801C12A8 1BBB58 0090+00 0/0 1/1 0/0 .text * getRestartDrawInfo__20dMenu_StageMapCtrl_cCFPfPfPs */ -s8 dMenu_StageMapCtrl_c::getRestartDrawInfo(f32* param_0, f32* param_1, s16* param_2) const { - // NONMATCHING +s8 dMenu_StageMapCtrl_c::getRestartDrawInfo(f32* i_dispX, f32* i_dispY, s16* i_rotY) const { + JUT_ASSERT(2057, i_dispX != 0); + JUT_ASSERT(2058, i_dispX != 0); + JUT_ASSERT(2059, i_rotY != 0); + + Vec sp10 = dMapInfo_n::getMapRestartPos(); + cnvPosTo2Dpos(sp10.x, sp10.z, i_dispX, i_dispY); + s16 var_r29 = dMapInfo_n::getMapRestartAngleY(); + + if (i_rotY != NULL) { + *i_rotY = rightModeCnvRot(var_r29); + } + + dMapInfo_c::calcNowStayFloorNo(sp10.y, true); } /* 801C12A8-801C12B4 1BBBE8 000C+00 0/0 2/2 0/0 .text * setPlusNowStayFloorNo__20dMenu_StageMapCtrl_cFScUc */ void dMenu_StageMapCtrl_c::setPlusNowStayFloorNo(s8 param_0, u8 param_1) { - // NONMATCHING + field_0xea = param_0; + field_0xf0 = param_1; } -/* ############################################################################################## */ -/* 804540A8-804540B0 0026A8 0008+00 1/1 0/0 0/0 .sdata2 @4168 */ -SECTION_SDATA2 static f64 lit_4168 = 4503601774854144.0 /* cast s32 to float */; - -/* 804540B0-804540B8 0026B0 0008+00 2/2 0/0 0/0 .sdata2 @4170 */ -SECTION_SDATA2 static f64 lit_4170 = 4503599627370496.0 /* cast u32 to float */; - /* 801C12B4-801C1878 1BBBF4 05C4+00 2/2 0/0 0/0 .text moveFloor__20dMenu_StageMapCtrl_cFv */ void dMenu_StageMapCtrl_c::moveFloor() { - // NONMATCHING + if ((field_0xf3 == 0) && (field_0xf1 == 0)) { + if (field_0xea != 0) { + field_0xf3 = field_0xf0; + field_0x90 = 0.0f; + + if (field_0xea > 0) { + if (field_0xe7 < field_0xed) { + field_0xc0 = makeStayFloorBlendPer(field_0xe7, 0.0f); + field_0xc4 = makeStayFloorBlendPer(field_0xe7 + field_0xea, 0.0f); + field_0xe8 = field_0xe7; + field_0xf3 = field_0xf0; + field_0xf1 = field_0xf3; + field_0xe9 = field_0xe7; + field_0xe7 += field_0xea; + } + } else if ((field_0xea < 0) && (field_0xe7 > field_0xee)) { + field_0xc0 = makeStayFloorBlendPer(field_0xe7, 0.0f); + field_0xc4 = makeStayFloorBlendPer(field_0xe7 + field_0xea, 0.0f); + field_0xe8 = field_0xe7; + field_0xe7 += field_0xea; + field_0xe9 = field_0xe7; + field_0xf3 = field_0xf0; + field_0xf1 = field_0xf3; + } + + field_0xea = 0; + } + } else if (field_0xf1 != 0 && field_0xea != 0) { + if (field_0xea > 0) { + if (field_0xe7 < field_0xed) { + if ((field_0xe7 == std::floor(field_0xc4) && field_0xe8 == field_0xe7 + field_0xea) || field_0x90 > 0.5f) { + field_0xf1 = field_0x90 * field_0xf0; + field_0xf3 = field_0xf1; + field_0xc0 = field_0xc4; + } + + field_0xc4 = makeStayFloorBlendPer(field_0xe7 + field_0xea, 0.0f); + field_0xe8 = field_0xe7; + field_0xe7 += field_0xea; + } + } else if (field_0xea < 0) { + if (field_0xe7 > field_0xee) { + if ((field_0xe7 == std::floor(field_0xc4) && field_0xe8 == field_0xe7 + field_0xea) || field_0x90 > 0.5f) { + field_0xf1 = field_0x90 * field_0xf0; + field_0xf3 = field_0xf1; + field_0xc0 = field_0xc4; + } + + field_0xc4 = makeStayFloorBlendPer(field_0xe7 + field_0xea, 0.0f); + field_0xe8 = field_0xe7; + field_0xe7 += field_0xea; + } + } + + field_0x90 = 0.0f; + field_0xea = 0; + field_0xeb = field_0xe7; + } + + if (field_0xf1 != 0) { + f32 temp_f31 = (f32)(field_0xf0 - field_0xf3) / (f32)field_0xf0; + + field_0xeb = getFloorNo(field_0xc4); + field_0xec = getFloorNo(field_0xc0); + field_0x90 = getBlendPer(temp_f31 - std::floor(temp_f31)); + + field_0xf1--; + if (field_0xf1 == 0) { + field_0xe8 = field_0xe7; + } + } + + if (field_0xf3 != 0) { + field_0xf3--; + if (field_0xf3 != 0 && field_0xf1 != 0) { + f32 temp_f30 = (f32)(field_0xf0 - field_0xf3) / (f32)field_0xf0; + field_0xeb = getFloorNo(field_0xc4); + field_0xec = getFloorNo(field_0xc0); + field_0x90 = temp_f30; + } else { + field_0x90 = 0.0f; + field_0xeb = getFloorNo(field_0xc4); + } + } } /* 801C1878-801C188C 1BC1B8 0014+00 1/0 0/0 0/0 .text wait_init_proc__20dMenu_StageMapCtrl_cFv */ void dMenu_StageMapCtrl_c::wait_init_proc() { - // NONMATCHING + field_0x90 = 0.0f; + field_0xe8 = field_0xe7; } /* 801C188C-801C18AC 1BC1CC 0020+00 1/0 0/0 0/0 .text wait_proc__20dMenu_StageMapCtrl_cFv */ void dMenu_StageMapCtrl_c::wait_proc() { - // NONMATCHING + moveFloor(); } /* 801C18AC-801C18C0 1BC1EC 0014+00 1/0 0/0 0/0 .text zoomIn_init_proc__20dMenu_StageMapCtrl_cFv */ void dMenu_StageMapCtrl_c::zoomIn_init_proc() { - // NONMATCHING + field_0xf4 = field_0xf2; + field_0xd8 = 0.0f; } -/* ############################################################################################## */ -/* 804540B8-804540BC 0026B8 0004+00 1/1 0/0 0/0 .sdata2 @4245 */ -SECTION_SDATA2 static f32 lit_4245 = 3600.0f; - /* 801C18C0-801C1B14 1BC200 0254+00 1/0 0/0 0/0 .text * getZoomMinMaxCheck__19dMenu_DmapMapCtrl_cFPfPfPfPfPbPb */ void dMenu_DmapMapCtrl_c::getZoomMinMaxCheck(f32* param_0, f32* param_1, f32* param_2, - f32* param_3, bool* param_4, bool* param_5) { - // NONMATCHING + f32* param_3, bool* param_4, bool* param_5) { + f32 var_f31 = FLT_MAX; + f32 var_f29 = -FLT_MAX; + f32 var_f30 = FLT_MAX; + f32 var_f28 = -FLT_MAX; + + f32 sp8 = getZoomCmPerPixel(); + for (int i = 0; i < 64; i++) { + if (dMpath_c::getRoomPointer(0, i) || dMpath_c::getRoomPointer(1, i)) { + dStage_FileList2_dt_c* fileList2_p = dStage_roomControl_c::getFileList2(i); + JUT_ASSERT(2360, fileList2_p != 0); + + if (fileList2_p != NULL && (dMapInfo_n::chkGetMap() || dMapInfo_n::chkGetCompass() || dMapInfo_n::isVisitedRoom(i) || field_0xe6 == i)) { + f32 sp18, sp14, sp10, spC; + dMapInfo_n::getRoomMinMaxXZ(i, &sp18, &sp10, &sp14, &spC); + + if (sp18 < var_f31) { + var_f31 = sp18; + } + if (sp14 > var_f29) { + var_f29 = sp14; + } + if (sp10 < var_f30) { + var_f30 = sp10; + } + if (spC > var_f28) { + var_f28 = spC; + } + } + } + } + + if (var_f29 - var_f31 < 3600.0f) { + var_f31 = 0.5f * (var_f31 + var_f29); + var_f29 = var_f31; + } + + if (var_f28 - var_f30 < 3600.0f) { + var_f30 = 0.5f * (var_f30 + var_f28); + var_f28 = var_f30; + } + + if (param_0 != NULL) { + *param_0 = var_f31; + } + + if (param_1 != NULL) { + *param_1 = var_f29; + } + + if (param_2 != NULL) { + *param_2 = var_f30; + } + + if (param_3 != NULL) { + *param_3 = var_f28; + } + + if (param_4 != NULL) { + if (var_f31 == var_f29) { + *param_4 = 1; + } else { + *param_4 = 0; + } + } + + if (param_5 != NULL) { + if (var_f30 == var_f28) { + *param_5 = 1; + } else { + *param_5 = 0; + } + } } /* 801C1B14-801C1BA4 1BC454 0090+00 1/0 0/0 0/0 .text calcZoomCenter__19dMenu_DmapMapCtrl_cFPfPf */ void dMenu_DmapMapCtrl_c::calcZoomCenter(f32* param_0, f32* param_1) { - // NONMATCHING -} + f32 spC = 0.0f; + f32 sp8 = 0.0f; + + dStage_FileList2_dt_c* fileList2_p = dStage_roomControl_c::getFileList2(field_0xe6); + JUT_ASSERT(2437, fileList2_p != 0); -/* ############################################################################################## */ -/* 804540BC-804540C0 0026BC 0004+00 1/1 0/0 0/0 .sdata2 @4277 */ -SECTION_SDATA2 static f32 lit_4277 = 10800.0f; + if (fileList2_p != NULL) { + dMapInfo_n::getRoomCenter(field_0xe6, &spC, &sp8); + } -/* 804540C0-804540C4 0026C0 0004+00 1/1 0/0 0/0 .sdata2 @4278 */ -SECTION_SDATA2 static f32 lit_4278 = 1.5f; + if (param_0 != NULL) { + *param_0 = spC; + } + + if (param_1 != NULL) { + *param_1 = sp8; + } +} /* 801C1BA4-801C1C40 1BC4E4 009C+00 1/0 0/0 0/0 .text getZoomCmPerPixel__19dMenu_DmapMapCtrl_cFv */ -void dMenu_DmapMapCtrl_c::getZoomCmPerPixel() { - // NONMATCHING +f32 dMenu_DmapMapCtrl_c::getZoomCmPerPixel() { + f32 var_f30 = field_0x98 < field_0x94 ? field_0x98 : field_0x94; + + stage_stag_info_class* pstag = dComIfGp_getStage()->getStagInfo(); + JUT_ASSERT(2467, pstag != 0); + + f32 var_f29 = 10800.0f / var_f30; + f32 var_f31 = 0.0f; + + if (pstag != NULL) { + var_f31 = pstag->field_0x24; + if (var_f31 == 0.0f) { + var_f31 = 1.5f * pstag->field_0x20; + } + } + + if (var_f31 != 0.0f) { + var_f29 = var_f31 / var_f30; + } + + return var_f29; } -/* ############################################################################################## */ /* 803BCBC0-803BCCB4 -00001 00F4+00 0/0 0/0 0/0 .data l_data */ -#pragma push -#pragma force_active on -SECTION_DATA static u32 l_data[61] = { +static u32 l_data[61] ALIGN_DECL(32) = { 0x80008000, 0x80008000, 0x00000000, @@ -855,195 +783,225 @@ SECTION_DATA static u32 l_data[61] = { 0xE739E739, 0x45610000, }; -#pragma pop - -/* 803BCCB4-803BCCC0 -00001 000C+00 0/1 0/0 0/0 .data @3922 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3922[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait_init_proc__20dMenu_StageMapCtrl_cFv, -}; -#pragma pop - -/* 803BCCC0-803BCCCC -00001 000C+00 0/1 0/0 0/0 .data @3923 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3923[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)zoomIn_init_proc__20dMenu_StageMapCtrl_cFv, -}; -#pragma pop - -/* 803BCCCC-803BCCD8 -00001 000C+00 0/1 0/0 0/0 .data @3924 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3924[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)zoomWait_init_proc__20dMenu_StageMapCtrl_cFv, -}; -#pragma pop - -/* 803BCCD8-803BCCE4 -00001 000C+00 0/1 0/0 0/0 .data @3925 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3925[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)zoomOut_init_proc__20dMenu_StageMapCtrl_cFv, -}; -#pragma pop /* 803BCCE4-803BCD14 019E04 0030+00 7/8 0/0 0/0 .data init_process */ -SECTION_DATA static u8 init_process[48] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +typedef void (dMenu_StageMapCtrl_c::*process_fn)(); +static process_fn init_process[] = { + &dMenu_StageMapCtrl_c::wait_init_proc, + &dMenu_StageMapCtrl_c::zoomIn_init_proc, + &dMenu_StageMapCtrl_c::zoomWait_init_proc, + &dMenu_StageMapCtrl_c::zoomOut_init_proc, }; /* 801C1C40-801C1CEC 1BC580 00AC+00 0/0 1/1 0/0 .text initZoomIn__20dMenu_StageMapCtrl_cFUc */ void dMenu_StageMapCtrl_c::initZoomIn(u8 param_0) { - // NONMATCHING + f32 sp10 = 0.0f; + f32 spC = 0.0f; + calcZoomCenter(&sp10, &spC); + + field_0xac = sp10; + field_0xb0 = spC; + field_0xe0 = getZoomCmPerPixel(); + field_0xf2 = param_0; + field_0xf5 = 1; + + (this->*init_process[field_0xf5])(); } /* 801C1CEC-801C1E00 1BC62C 0114+00 0/0 1/1 0/0 .text initZoomIn__20dMenu_StageMapCtrl_cFUcff */ void dMenu_StageMapCtrl_c::initZoomIn(u8 param_0, f32 param_1, f32 param_2) { - // NONMATCHING + field_0xe0 = getZoomCmPerPixel(); + field_0xac = field_0xa4 + (field_0xdc * param_1); + field_0xb0 = field_0xa8 + (field_0xdc * param_2); + + if (field_0xac < field_0xc8) { + field_0xac = field_0xc8; + } else if (field_0xac > field_0xcc) { + field_0xac = field_0xcc; + } + + if (field_0xb0 < field_0xd0) { + field_0xb0 = field_0xd0; + } else if (field_0xb0 > field_0xd4) { + field_0xb0 = field_0xd4; + } + + field_0xf2 = param_0; + field_0xf5 = 1; + + (this->*init_process[field_0xf5])(); } /* 801C1E00-801C1E74 1BC740 0074+00 0/0 1/1 0/0 .text * initZoomInCenterHold__20dMenu_StageMapCtrl_cFUc */ void dMenu_StageMapCtrl_c::initZoomInCenterHold(u8 param_0) { - // NONMATCHING + field_0xe0 = getZoomCmPerPixel(); + field_0xf2 = param_0; + field_0xf5 = 1; + + (this->*init_process[field_0xf5])(); } /* 801C1E74-801C1EC0 1BC7B4 004C+00 2/2 0/0 0/0 .text zoomCalcSet__20dMenu_StageMapCtrl_cFf */ void dMenu_StageMapCtrl_c::zoomCalcSet(f32 param_0) { - // NONMATCHING + field_0x9c = field_0xa4 + (param_0 * (field_0xac - field_0xa4)); + field_0xa0 = field_0xa8 + (param_0 * (field_0xb0 - field_0xa8)); + field_0xbc = field_0xdc + (param_0 * (field_0xe0 - field_0xdc)); } /* 801C1EC0-801C1F2C 1BC800 006C+00 1/0 0/0 0/0 .text zoomIn_proc__20dMenu_StageMapCtrl_cFv */ void dMenu_StageMapCtrl_c::zoomIn_proc() { - // NONMATCHING + f32 temp_f1 = fopMsgM_valueIncrease(field_0xf2, field_0xf2 - field_0xf4, 4); + field_0xd8 = temp_f1; + zoomCalcSet(temp_f1); + + field_0xf4--; + if (field_0xf4 < 0) { + field_0xf5 = 2; + } } /* 801C1F2C-801C1F70 1BC86C 0044+00 0/0 1/1 0/0 .text initZoomOut__20dMenu_StageMapCtrl_cFUc */ void dMenu_StageMapCtrl_c::initZoomOut(u8 param_0) { - // NONMATCHING + field_0xf2 = param_0; + field_0xf5 = 3; + + (this->*init_process[field_0xf5])(); } /* 801C1F70-801C2004 1BC8B0 0094+00 0/0 1/1 0/0 .text initZoomWait__20dMenu_StageMapCtrl_cFff */ void dMenu_StageMapCtrl_c::initZoomWait(f32 param_0, f32 param_1) { - // NONMATCHING + field_0xac = param_0; + field_0xb0 = param_1; + + field_0x9c = field_0xac; + field_0xa0 = field_0xb0; + field_0xe0 = getZoomCmPerPixel(); + field_0xbc = getZoomCmPerPixel(); + field_0xf5 = 2; + + (this->*init_process[field_0xf5])(); } /* 801C2004-801C2028 1BC944 0024+00 1/0 0/0 0/0 .text zoomWait_init_proc__20dMenu_StageMapCtrl_cFv */ void dMenu_StageMapCtrl_c::zoomWait_init_proc() { - // NONMATCHING + field_0xb4 = 0.0f; + field_0xb8 = 0.0f; + field_0xd8 = 1.0f; + field_0x90 = 0.0f; + field_0xe8 = field_0xe7; } /* 801C2028-801C205C 1BC968 0034+00 1/0 0/0 0/0 .text isEnableZoomMove__19dMenu_DmapMapCtrl_cCFv */ -void dMenu_DmapMapCtrl_c::isEnableZoomMove() const { - // NONMATCHING +bool dMenu_DmapMapCtrl_c::isEnableZoomMove() const { + return field_0xf3 == 0 && (!getDisableZoomMoveFlgX() || !getDisableZoomMoveFlgZ()); } -/* ############################################################################################## */ -/* 804540C4-804540C8 0026C4 0004+00 1/1 0/0 0/0 .sdata2 @4395 */ -SECTION_SDATA2 static f32 lit_4395 = 1.0f / 100.0f; - /* 801C205C-801C2198 1BC99C 013C+00 1/0 0/0 0/0 .text zoomWait_proc__20dMenu_StageMapCtrl_cFv */ void dMenu_StageMapCtrl_c::zoomWait_proc() { - // NONMATCHING + if (isEnableZoomMove()) { + if (field_0xf8 == 0 && fabsf(field_0xb4) > 0.01f) { + field_0xac += field_0xb4; + } + if (field_0xf9 == 0 && fabsf(field_0xb8) > 0.01f) { + field_0xb0 += field_0xb8; + } + } + + if (field_0xf8 == 0) { + if (field_0xac <= field_0xc8) { + field_0xac = field_0xc8; + } + if (field_0xac >= field_0xcc) { + field_0xac = field_0xcc; + } + } + + if (field_0xf9 == 0) { + if (field_0xb0 <= field_0xd0) { + field_0xb0 = field_0xd0; + } + if (field_0xb0 >= field_0xd4) { + field_0xb0 = field_0xd4; + } + } + + field_0x9c = field_0xac; + field_0xa0 = field_0xb0; + field_0xb4 = 0.0f; + field_0xb8 = 0.0f; + moveFloor(); } /* 801C2198-801C21AC 1BCAD8 0014+00 1/0 0/0 0/0 .text zoomOut_init_proc__20dMenu_StageMapCtrl_cFv */ void dMenu_StageMapCtrl_c::zoomOut_init_proc() { - // NONMATCHING + field_0xf4 = field_0xf2; + field_0xd8 = 1.0f; } /* 801C21AC-801C2234 1BCAEC 0088+00 1/0 0/0 0/0 .text zoomOut_proc__20dMenu_StageMapCtrl_cFv */ void dMenu_StageMapCtrl_c::zoomOut_proc() { - // NONMATCHING + f32 temp_f1 = fopMsgM_valueIncrease(field_0xf2, field_0xf2 - field_0xf4, 4); + zoomCalcSet(1.0f - temp_f1); + field_0xd8 = 1.0f - temp_f1; + + field_0xf4--; + if (field_0xf4 < 0) { + field_0xf5 = 0; + } } -/* ############################################################################################## */ -/* 803BCD14-803BCD20 -00001 000C+00 0/1 0/0 0/0 .data @3926 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3926[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait_proc__20dMenu_StageMapCtrl_cFv, -}; -#pragma pop - -/* 803BCD20-803BCD2C -00001 000C+00 0/1 0/0 0/0 .data @3927 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3927[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)zoomIn_proc__20dMenu_StageMapCtrl_cFv, -}; -#pragma pop - -/* 803BCD2C-803BCD38 -00001 000C+00 0/1 0/0 0/0 .data @3928 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3928[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)zoomWait_proc__20dMenu_StageMapCtrl_cFv, -}; -#pragma pop - -/* 803BCD38-803BCD44 -00001 000C+00 0/1 0/0 0/0 .data @3929 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3929[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)zoomOut_proc__20dMenu_StageMapCtrl_cFv, -}; -#pragma pop - /* 803BCD44-803BCD74 019E64 0030+00 1/2 0/0 0/0 .data move_process */ -SECTION_DATA static u8 move_process[48] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +static process_fn move_process[] = { + &dMenu_StageMapCtrl_c::wait_proc, + &dMenu_StageMapCtrl_c::zoomIn_proc, + &dMenu_StageMapCtrl_c::zoomWait_proc, + &dMenu_StageMapCtrl_c::zoomOut_proc, }; /* 801C2234-801C22A8 1BCB74 0074+00 0/0 1/1 0/0 .text move__20dMenu_StageMapCtrl_cFv */ void dMenu_StageMapCtrl_c::move() { - // NONMATCHING + u8 temp_r30 = field_0xf5; + (this->*move_process[field_0xf5])(); + + if (field_0xf5 != temp_r30) { + (this->*init_process[field_0xf5])(); + } } /* 801C22A8-801C22F8 1BCBE8 0050+00 1/0 0/0 0/0 .text draw__19dMenu_DmapMapCtrl_cFv */ void dMenu_DmapMapCtrl_c::draw() { - // NONMATCHING + if (field_0xef != 0) { + setPos(field_0xeb, field_0xec, field_0x9c, field_0xa0, field_0xbc, true, field_0xd8); + } } /* 801C22F8-801C231C 1BCC38 0024+00 0/0 1/1 0/0 .text * getPlayerStayFloorNo__20dMenu_StageMapCtrl_cCFv */ -void dMenu_StageMapCtrl_c::getPlayerStayFloorNo() const { - // NONMATCHING +s8 dMenu_StageMapCtrl_c::getPlayerStayFloorNo() const { + s8 var_r31 = 0; + if (dMapInfo_c::getNowStayFloorNoDecisionFlg()) { + var_r31 = dMapInfo_c::getNowStayFloorNo(); + } + + return var_r31; } /* 801C231C-801C235C 1BCC5C 0040+00 0/0 1/1 0/0 .text _create__20dMenu_StageMapCtrl_cFUsUsUsUsPv */ void dMenu_StageMapCtrl_c::_create(u16 param_0, u16 param_1, u16 param_2, u16 param_3, - void* param_4) { - // NONMATCHING + void* param_4) { + s8 var_r31; + if (dMapInfo_c::getNowStayFloorNoDecisionFlg()) { + var_r31 = dMapInfo_c::getNowStayFloorNo(); + } + + _create(param_0, param_1, param_2, param_3, var_r31, param_4); } -/* ############################################################################################## */ /* 8045108C-80451090 00058C 0004+00 1/1 0/0 0/0 .sbss m_zoomCenterMinX__20dMenu_StageMapCtrl_c */ f32 dMenu_StageMapCtrl_c::m_zoomCenterMinX; @@ -1054,78 +1012,118 @@ f32 dMenu_StageMapCtrl_c::m_zoomCenterMaxX; f32 dMenu_StageMapCtrl_c::m_zoomCenterMinZ; /* 80451098-804510A0 000598 0004+04 1/1 0/0 0/0 .sbss m_zoomCenterMaxZ__20dMenu_StageMapCtrl_c */ -f32 dMenu_StageMapCtrl_c::m_zoomCenterMaxZ[1 + 1 /* padding */]; - -/* 804540C8-804540CC 0026C8 0004+00 1/1 0/0 0/0 .sdata2 @4460 */ -SECTION_SDATA2 static f32 lit_4460 = 6.0f / 5.0f; - -/* 804540CC-804540D0 0026CC 0004+00 1/1 0/0 0/0 .sdata2 @4461 */ -SECTION_SDATA2 static f32 lit_4461 = 288.0f; - -/* 804540D0-804540D8 0026D0 0004+04 1/1 0/0 0/0 .sdata2 @4462 */ -SECTION_SDATA2 static f32 lit_4462[1 + 1 /* padding */] = { - 297.0f, - /* padding */ - 0.0f, -}; +f32 dMenu_StageMapCtrl_c::m_zoomCenterMaxZ; /* 801C235C-801C2518 1BCC9C 01BC+00 1/1 1/1 0/0 .text _create__20dMenu_StageMapCtrl_cFUsUsUsUsScPv */ void dMenu_StageMapCtrl_c::_create(u16 param_0, u16 param_1, u16 param_2, u16 param_3, - s8 param_4, void* param_5) { - // NONMATCHING + s8 param_4, void* param_5) { + field_0xe6 = dComIfGp_roomControl_getStayNo(); + field_0xe7 = param_4; + field_0xeb = field_0xe7; + field_0xec = field_0xe7; + dMpath_c::getTopBottomFloorNo(&field_0xed, &field_0xee); + + int temp_r30 = (field_0xed - field_0xee) + 1; + if (temp_r30 > 0) { + field_0xef = temp_r30; + } + + field_0x94 = param_2; + field_0x98 = param_3; + f32 var_f26 = field_0x98 > field_0x94 ? field_0x98 : field_0x94; + + dMenu_DmapMap_c::_create(param_0, param_1, param_2, param_3, param_5); + + getInitDispCenter(&field_0x9c, &field_0xa0); + field_0xa4 = field_0x9c; + field_0xa8 = field_0xa0; + + getInitWholeMapScale(&field_0xdc, 1.2f * dMpath_c::getSizeX(), 1.2f * dMpath_c::getSizeZ(), 288.0f, 297.0f); + field_0xbc = field_0xdc; + + getZoomMinMaxCheck(&field_0xc8, &field_0xcc, &field_0xd0, &field_0xd4, &field_0xf8, &field_0xf9); + + m_zoomCenterMinX = field_0xc8; + m_zoomCenterMaxX = field_0xcc; + m_zoomCenterMinZ = field_0xd0; + m_zoomCenterMaxZ = field_0xd4; + + field_0xf5 = 0; + (this->*init_process[field_0xf5])(); } /* 801C2518-801C2538 1BCE58 0020+00 0/0 1/1 0/0 .text _delete__20dMenu_StageMapCtrl_cFv */ void dMenu_StageMapCtrl_c::_delete() { - // NONMATCHING + dMenu_DmapMap_c::_delete(); } /* 801C2538-801C2578 1BCE78 0040+00 0/0 1/1 0/0 .text isEnableZoomIn__20dMenu_StageMapCtrl_cFv */ -void dMenu_StageMapCtrl_c::isEnableZoomIn() { - // NONMATCHING +bool dMenu_StageMapCtrl_c::isEnableZoomIn() { + bool var_r30 = 0; + if (field_0xf3 == 0 && dStage_roomControl_c::getFileList2(field_0xe6) != NULL) { + var_r30 = 1; + } + + return var_r30; } /* 801C2578-801C2588 1BCEB8 0010+00 0/0 1/1 0/0 .text isEnableZoomOut__20dMenu_StageMapCtrl_cFv */ -void dMenu_StageMapCtrl_c::isEnableZoomOut() { - // NONMATCHING +bool dMenu_StageMapCtrl_c::isEnableZoomOut() { + return field_0xf3 == 0; } /* 801C2588-801C2590 1BCEC8 0008+00 0/0 1/1 0/0 .text setPlusZoomCenterX__20dMenu_StageMapCtrl_cFf */ void dMenu_StageMapCtrl_c::setPlusZoomCenterX(f32 param_0) { - // NONMATCHING + field_0xb4 = param_0; } /* 801C2590-801C2598 1BCED0 0008+00 0/0 1/1 0/0 .text setPlusZoomCenterZ__20dMenu_StageMapCtrl_cFf */ void dMenu_StageMapCtrl_c::setPlusZoomCenterZ(f32 param_0) { - // NONMATCHING + field_0xb8 = param_0; } /* 801C2598-801C25C0 1BCED8 0028+00 1/0 0/0 0/0 .text * getInitWholeMapScale__19dMenu_DmapMapCtrl_cFPfffff */ void dMenu_DmapMapCtrl_c::getInitWholeMapScale(f32* param_0, f32 param_1, f32 param_2, - f32 param_3, f32 param_4) { - // NONMATCHING + f32 param_3, f32 param_4) { + if (param_0 != NULL) { + f32 temp_f31 = param_1 / param_3; + f32 temp_f30 = param_2 / param_4; + + f32 var_f29; + if (temp_f31 > temp_f30) { + var_f29 = temp_f31; + } else { + var_f29 = temp_f30; + } + + *param_0 = var_f29; + } } /* 801C25C0-801C25E4 1BCF00 0024+00 1/0 0/0 0/0 .text * getInitDispCenter__19dMenu_DmapMapCtrl_cFPfPf */ void dMenu_DmapMapCtrl_c::getInitDispCenter(f32* param_0, f32* param_1) { - // NONMATCHING + if (param_0 != NULL) { + *param_0 = dMpath_c::getCenterX(); + } + + if (param_1 != NULL) { + *param_1 = dMpath_c::getCenterZ(); + } } /* 801C25E4-801C25E8 1BCF24 0004+00 1/0 0/0 0/0 .text beforeDrawPath__15renderingDmap_cFv */ -void renderingDmap_c::beforeDrawPath() { - /* empty function */ -} +void renderingDmap_c::beforeDrawPath() {} /* 801C25E8-801C2614 1BCF28 002C+00 1/0 0/0 0/0 .text getRestartCursorSize__15renderingDmap_cFv */ -void renderingDmap_c::getRestartCursorSize() { - // NONMATCHING +f32 renderingDmap_c::getRestartCursorSize() { + return getPlayerCursorSize(); } /* 801C2614-801C261C 1BCF54 0008+00 1/0 0/0 0/0 .text isRendAllRoom__15renderingDmap_cCFv @@ -1161,129 +1159,3 @@ bool renderingDmap_c::isRendCursor() const { bool renderingDmap_c::isRendIcon() const { return true; } - -/* 801C2644-801C2718 1BCF84 00D4+00 0/0 1/0 0/0 .text __sinit_d_menu_dmap_map_cpp */ -void __sinit_d_menu_dmap_map_cpp() { - // NONMATCHING -} - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x801C2644, __sinit_d_menu_dmap_map_cpp); -#pragma pop - -/* ############################################################################################## */ -/* 803BCD74-803BCE68 019E94 0028+CC 0/0 2/2 0/0 .data __vt__19dMenu_DmapMapCtrl_c */ -SECTION_DATA extern void* __vt__19dMenu_DmapMapCtrl_c[10 + 51 /* padding */] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__19dMenu_DmapMapCtrl_cFv, - (void*)isEnableZoomMove__19dMenu_DmapMapCtrl_cCFv, - (void*)calcZoomCenter__19dMenu_DmapMapCtrl_cFPfPf, - (void*)getInitWholeMapScale__19dMenu_DmapMapCtrl_cFPfffff, - (void*)getInitDispCenter__19dMenu_DmapMapCtrl_cFPfPf, - (void*)getZoomMinMaxCheck__19dMenu_DmapMapCtrl_cFPfPfPfPfPbPb, - (void*)getZoomCmPerPixel__19dMenu_DmapMapCtrl_cFv, - (void*)draw__19dMenu_DmapMapCtrl_cFv, - /* padding */ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, -}; - -/* 803BCE68-803BCF18 019F88 00AC+04 0/0 2/2 0/0 .data __vt__15renderingDmap_c */ -SECTION_DATA extern void* __vt__15renderingDmap_c[43 + 1 /* padding */] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)draw__16renderingDAmap_cFv, - (void*)__dt__15renderingDmap_cFv, - (void*)isDrawType__11dDrawPath_cFi, - (void*)getColor__15renderingDmap_cFi, - (void*)getLineColor__11dDrawPath_cFii, - (void*)getLineWidth__15renderingDmap_cFi, - (void*)isSwitch__16renderingDAmap_cFPCQ211dDrawPath_c11group_class, - (void*)isRenderingFloor__16renderingDAmap_cFi, - (void*)getFirstRoomPointer__16renderingDAmap_cFv, - (void*)getNextRoomPointer__16renderingDAmap_cFv, - (void*)drawPath__11dDrawPath_cFv, - (void*)rendering__11dDrawPath_cFPCQ211dDrawPath_c10line_class, - (void*)rendering__11dDrawPath_cFPCQ211dDrawPath_c10poly_class, - (void*)rendering__11dDrawPath_cFPCQ211dDrawPath_c10room_class, - (void*)beforeDrawPath__15renderingDmap_cFv, - (void*)afterDrawPath__15renderingDmap_cFv, - (void*)preDrawPath__16renderingDAmap_cFv, - (void*)postDrawPath__16renderingDAmap_cFv, - (void*)isDrawPath__16renderingDAmap_cFv, - (void*)preRenderingMap__18dRenderingFDAmap_cFv, - (void*)postRenderingMap__18dRenderingFDAmap_cFv, - (void*)getBackColor__16renderingDAmap_cCFv, - (void*)getDecoLineColor__18dRenderingFDAmap_cFii, - (void*)getDecorationLineWidth__18dRenderingFDAmap_cFi, - (void*)getFirstDrawLayerNo__16renderingDAmap_cFv, - (void*)getNextDrawLayerNo__16renderingDAmap_cFi, - (void*)isDrawIconSingle__16renderingDAmap_cCFPCQ27dTres_c6data_siiibPC3Vec, - (void*)getIconGroupNumber__16renderingDAmap_cCFUc, - (void*)hasMap__15renderingDmap_cCFv, - (void*)isRendAllRoom__15renderingDmap_cCFv, - (void*)isRendDoor__15renderingDmap_cCFv, - (void*)isCheckFloor__15renderingDmap_cCFv, - (void*)isDrawIconSingle2__15renderingDmap_cCFPCQ27dTres_c6data_sbbi, - (void*)getRoomNoSingle__16renderingDAmap_cFv, - (void*)isDrawRoom__16renderingDAmap_cCFii, - (void*)isDrawRoomIcon__16renderingDAmap_cCFii, - (void*)isRendRestart__15renderingDmap_cCFv, - (void*)isRendCursor__15renderingDmap_cCFv, - (void*)isRendIcon__15renderingDmap_cCFv, - (void*)getPlayerCursorSize__15renderingDmap_cFv, - (void*)getRestartCursorSize__15renderingDmap_cFv, - /* padding */ - NULL, -}; |
