Skip to content

Commit e707193

Browse files
committed
checkpoint
1 parent eb5721c commit e707193

File tree

3 files changed

+166
-16
lines changed

3 files changed

+166
-16
lines changed

include/d/menu/d_menu_fmap2D.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class dMenu_Fmap2DBack_c : public dDlst_base_c, public dMenuMapCommon_c {
3232
/* 801D2100 */ void setIcon2DPos(u8, f32, f32, f32, u8, bool);
3333
/* 801D241C */ void setIcon2DPos(u8, char const*, f32, f32, f32, u8, bool);
3434
/* 801D2454 */ void setIcon2DPos(u8, u8, char const*, f32, f32, f32, u8, bool);
35-
/* 801D2508 */ bool isShowRegion(int);
35+
/* 801D2508 */ int isShowRegion(int);
3636
/* 801D2658 */ f32 getMapAreaGlobalPosX();
3737
/* 801D2668 */ f32 getMapAreaGlobalPosY();
3838
/* 801D2678 */ f32 getMapAreaGlobalCenterPosX();
@@ -135,7 +135,7 @@ class dMenu_Fmap2DBack_c : public dDlst_base_c, public dMenuMapCommon_c {
135135
/* 0x0F90 */ float field_0xf90;
136136
/* 0x0F94 */ float field_0xf94;
137137
/* 0x0F98 */ float field_0xf98;
138-
/* 0x0F9C */ float field_0xf9c; // Likely called mZoom
138+
/* 0x0F9C */ float field_0xf9c; // Likely called mZoom or something similar
139139
/* 0x0FA0 */ float field_0xfa0;
140140
/* 0x0FA4 */ float field_0xfa4;
141141
/* 0x0FA8 */ float field_0xfa8;

include/d/menu/d_menu_map_common.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ struct dMenuMapCommon_c {
3838
};
3939

4040
struct Stage_c {
41-
// Incomplete or wrong
41+
// Incomplete class
4242

4343
struct Stage_c_data {
44+
// Unknown name
45+
4446
/* 0x00 */ char mName[8];
4547
/* 0x08 */ u8 field_0x8;
4648
/* 0x09 */ u8 field_0x9;

src/d/menu/d_menu_fmap2D.cpp

+161-13
Original file line numberDiff line numberDiff line change
@@ -1477,9 +1477,9 @@ void dMenu_Fmap2DBack_c::setIcon2DPos(u8 param_0, u8 param_1, char const* param_
14771477
}
14781478

14791479
/* 801D2508-801D2658 1CCE48 0150+00 1/1 1/1 0/0 .text isShowRegion__18dMenu_Fmap2DBack_cFi */
1480-
bool dMenu_Fmap2DBack_c::isShowRegion(int param_0) {
1480+
int dMenu_Fmap2DBack_c::isShowRegion(int param_0) {
14811481
if (param_0 == 7) {
1482-
return true;
1482+
return 1;
14831483
}
14841484

14851485
if (g_fmapHIO.mAllRegionsUnlocked) {
@@ -1488,26 +1488,26 @@ bool dMenu_Fmap2DBack_c::isShowRegion(int param_0) {
14881488
}
14891489
} else {
14901490
if (g_fmapHIO.mDebugRegionBits[param_0] && isShowRegionFlag(param_0)) {
1491-
return true;
1491+
return 1;
14921492
}
14931493
if (param_0 == 6) {
14941494
if (isShowRegionFlag(3) && dComIfGs_isRegionBit(4)) {
1495-
return true;
1495+
return 1;
14961496
}
14971497
if (dComIfGp_getNowLevel() == 4) {
1498-
return true;
1498+
return 1;
14991499
}
1500-
return false;
1500+
return 0;
15011501
}
15021502
if (isShowRegionFlag(param_0) && dComIfGs_isRegionBit(param_0 + 1)) {
1503-
return true;
1503+
return 1;
15041504
}
15051505
if (param_0 + 1 == dComIfGp_getNowLevel()) {
1506-
return true;
1506+
return 1;
15071507
}
15081508
}
15091509

1510-
return false;
1510+
return 0;
15111511
}
15121512

15131513
/* 801D2658-801D2668 1CCF98 0010+00 2/2 0/0 0/0 .text getMapAreaGlobalPosX__18dMenu_Fmap2DBack_cFv
@@ -1771,9 +1771,7 @@ void dMenu_Fmap2DBack_c::calcOffset(u8 param_0, char const* param_1, f32* param_
17711771
if (mpStages != NULL) {
17721772
Stage_c::Stage_c_data* data = mpStages->field_0x4;
17731773
for (int i = 0; i < field_0x1225; i++) {
1774-
if (param_0 + 1 == data[i].field_0x9 &&
1775-
strcmp(param_1, data[i].mName) == 0)
1776-
{
1774+
if (param_0 + 1 == data[i].field_0x9 && strcmp(param_1, data[i].mName) == 0) {
17771775
*param_2 = field_0x1004[param_0] + data[i].field_0xc;
17781776
*param_3 = field_0x1024[param_0] + data[i].field_0x10;
17791777
return;
@@ -1783,10 +1781,72 @@ void dMenu_Fmap2DBack_c::calcOffset(u8 param_0, char const* param_1, f32* param_
17831781

17841782
*param_2 = field_0x1004[param_0];
17851783
*param_3 = field_0x1024[param_0];
1786-
return;
17871784
}
17881785

17891786
/* 801D2DA8-801D3094 1CD6E8 02EC+00 1/1 0/0 0/0 .text regionTextureDraw__18dMenu_Fmap2DBack_cFv */
1787+
#ifdef NONMATCHING
1788+
// Matches with literals
1789+
void dMenu_Fmap2DBack_c::regionTextureDraw() {
1790+
f32 local_84, local_88;
1791+
calcAllMapPosWorld(getMapScissorAreaCenterPosX(), getMapScissorAreaCenterPosY(), &local_84,
1792+
&local_88);
1793+
1794+
f32 local_8c, local_90;
1795+
calcAllMapPos2D(local_84 + field_0xfc8, local_88 + field_0xfcc, &local_8c, &local_90);
1796+
1797+
f32 dVar14 = getMapScissorAreaCenterPosX() - local_8c;
1798+
f32 dVar13 = getMapScissorAreaCenterPosY() - local_90;
1799+
1800+
s32 uVar9 = field_0x1227;
1801+
1802+
s32 local_94;
1803+
if (field_0xfa0 == 0.0f) {
1804+
local_94 = field_0x1226;
1805+
} else {
1806+
local_94 = field_0x1227;
1807+
}
1808+
1809+
if (g_fmapHIO.mDrawBackground == false) {
1810+
return;
1811+
}
1812+
1813+
for (int iVar8 = 0; iVar8 < 8; iVar8++) {
1814+
s32 uVar10 = field_0x1230[iVar8];
1815+
if (uVar10 != 0xff && mpAreaTex[uVar10] != NULL) {
1816+
f32 fVar3;
1817+
if (isShowRegion(uVar10)) {
1818+
if (uVar10 != local_94) {
1819+
mpAreaTex[uVar10]->setBlackWhite(field_0x11f8, field_0x11fc);
1820+
fVar3 = field_0x1214;
1821+
1822+
} else {
1823+
mpAreaTex[uVar10]->setBlackWhite(field_0x11f0, field_0x11f4);
1824+
fVar3 = field_0x1210;
1825+
}
1826+
} else {
1827+
mpAreaTex[uVar10]->setBlackWhite(field_0x1200, field_0x1204);
1828+
fVar3 = 0.5f;
1829+
}
1830+
1831+
mpAreaTex[uVar10]->setAlpha(field_0xfc4 * 255.0f * fVar3 * field_0xfa4);
1832+
1833+
if (uVar10 != uVar9) {
1834+
mpAreaTex[uVar10]->draw(
1835+
field_0xfbc + (dVar14 + (field_0xe8c[uVar10] + field_0xf0c[uVar10])),
1836+
field_0xfc0 + (dVar13 + (field_0xeac[uVar10] + field_0xf2c[uVar10])),
1837+
field_0xecc[uVar10] * field_0xf9c, field_0xeec[uVar10] * field_0xf9c, false,
1838+
false, false);
1839+
} else {
1840+
mpAreaTex[uVar9]->draw(
1841+
field_0xfbc + (dVar14 + (field_0xe8c[uVar9] + field_0xf0c[uVar9])),
1842+
field_0xfc0 + (dVar13 + (field_0xeac[uVar9] + field_0xf2c[uVar9])),
1843+
field_0xecc[uVar9] * field_0xf9c, field_0xeec[uVar9] * field_0xf9c, false,
1844+
false, false);
1845+
}
1846+
}
1847+
}
1848+
}
1849+
#else
17901850
#pragma push
17911851
#pragma optimization_level 0
17921852
#pragma optimizewithasm off
@@ -1795,8 +1855,24 @@ asm void dMenu_Fmap2DBack_c::regionTextureDraw() {
17951855
#include "asm/d/menu/d_menu_fmap2D/regionTextureDraw__18dMenu_Fmap2DBack_cFv.s"
17961856
}
17971857
#pragma pop
1858+
#endif
17981859

17991860
/* 801D3094-801D31D0 1CD9D4 013C+00 1/1 0/0 0/0 .text stageTextureDraw__18dMenu_Fmap2DBack_cFv */
1861+
#ifdef NONMATCHING
1862+
// Matches with literals
1863+
void dMenu_Fmap2DBack_c::stageTextureDraw() {
1864+
if (field_0x122f) {
1865+
mpSpotTexture->setAlpha(field_0xfc4 * 255.0f * field_0x11d8);
1866+
} else {
1867+
f32 tmp = field_0xfc4 * 255.0f * field_0xfa8;
1868+
mpSpotTexture->setAlpha(field_0x11d8 * tmp);
1869+
}
1870+
1871+
mpSpotTexture->draw(field_0xfbc + getMapScissorAreaLX(), field_0xfc0 + getMapScissorAreaLY(),
1872+
getMapScissorAreaSizeRealX(), getMapScissorAreaSizeRealY(), false, false,
1873+
false);
1874+
}
1875+
#else
18001876
#pragma push
18011877
#pragma optimization_level 0
18021878
#pragma optimizewithasm off
@@ -1805,8 +1881,79 @@ asm void dMenu_Fmap2DBack_c::stageTextureDraw() {
18051881
#include "asm/d/menu/d_menu_fmap2D/stageTextureDraw__18dMenu_Fmap2DBack_cFv.s"
18061882
}
18071883
#pragma pop
1884+
#endif
18081885

18091886
/* 801D31D0-801D34DC 1CDB10 030C+00 1/1 0/0 0/0 .text worldGridDraw__18dMenu_Fmap2DBack_cFv */
1887+
#ifdef NONMATCHING
1888+
// float regalloc
1889+
void dMenu_Fmap2DBack_c::worldGridDraw() {
1890+
f32 local_74, local_78;
1891+
1892+
f32 dVar9 = -field_0xfc8;
1893+
f32 dVar8 = -field_0xfcc;
1894+
calcAllMapPos2D(dVar9, dVar8, &local_74, &local_78);
1895+
1896+
J2DDrawLine(local_74, mDoGph_gInf_c::getMinYF(), local_74,
1897+
mDoGph_gInf_c::getMinYF() + mDoGph_gInf_c::getHeightF(),
1898+
JUtility::TColor(255, 255, 255, 255), 6);
1899+
1900+
f32 xPos = dVar9 - g_fmapHIO.mWorldGridWidth;
1901+
while (true) {
1902+
calcAllMapPos2D(xPos, dVar8, &local_74, &local_78);
1903+
if (local_74 >= getMapScissorAreaLX()) {
1904+
J2DDrawLine(local_74, mDoGph_gInf_c::getMinYF(), local_74,
1905+
mDoGph_gInf_c::getMinYF() + mDoGph_gInf_c::getHeightF(),
1906+
JUtility::TColor(255, 255, 255, 255), 6);
1907+
xPos -= g_fmapHIO.mWorldGridWidth;
1908+
} else {
1909+
break;
1910+
}
1911+
}
1912+
1913+
f32 xPos2 = dVar9 + g_fmapHIO.mWorldGridWidth;
1914+
while (true) {
1915+
calcAllMapPos2D(xPos2, dVar8, &local_74, &local_78);
1916+
if (local_74 <= getMapScissorAreaLX() + getMapScissorAreaSizeRealX()) {
1917+
J2DDrawLine(local_74, mDoGph_gInf_c::getMinYF(), local_74,
1918+
mDoGph_gInf_c::getMinYF() + mDoGph_gInf_c::getHeightF(),
1919+
JUtility::TColor(255, 255, 255, 255), 6);
1920+
xPos2 += g_fmapHIO.mWorldGridWidth;
1921+
} else {
1922+
break;
1923+
}
1924+
}
1925+
1926+
J2DDrawLine(mDoGph_gInf_c::getMinXF(), local_78,
1927+
mDoGph_gInf_c::getMinXF() + mDoGph_gInf_c::getWidthF(), local_78,
1928+
JUtility::TColor(255, 255, 255, 255), 6);
1929+
1930+
f32 yPos = dVar8 - g_fmapHIO.mWorldGridWidth;
1931+
while (true) {
1932+
calcAllMapPos2D(dVar9, yPos, &local_74, &local_78);
1933+
if (local_78 >= getMapScissorAreaLY()) {
1934+
J2DDrawLine(mDoGph_gInf_c::getMinXF(), local_78,
1935+
mDoGph_gInf_c::getMinXF() + mDoGph_gInf_c::getWidthF(), local_78,
1936+
JUtility::TColor(255, 255, 255, 255), 6);
1937+
yPos -= g_fmapHIO.mWorldGridWidth;
1938+
} else {
1939+
break;
1940+
}
1941+
}
1942+
1943+
f32 yPos2 = dVar8 + g_fmapHIO.mWorldGridWidth;
1944+
while (true) {
1945+
calcAllMapPos2D(dVar9, yPos2, &local_74, &local_78);
1946+
if (local_78 <= getMapScissorAreaLY() + getMapScissorAreaSizeRealY()) {
1947+
J2DDrawLine(mDoGph_gInf_c::getMinXF(), local_78,
1948+
mDoGph_gInf_c::getMinXF() + mDoGph_gInf_c::getWidthF(), local_78,
1949+
JUtility::TColor(255, 255, 255, 255), 6);
1950+
yPos2 += g_fmapHIO.mWorldGridWidth;
1951+
}else{
1952+
break;
1953+
}
1954+
}
1955+
}
1956+
#else
18101957
#pragma push
18111958
#pragma optimization_level 0
18121959
#pragma optimizewithasm off
@@ -1815,6 +1962,7 @@ asm void dMenu_Fmap2DBack_c::worldGridDraw() {
18151962
#include "asm/d/menu/d_menu_fmap2D/worldGridDraw__18dMenu_Fmap2DBack_cFv.s"
18161963
}
18171964
#pragma pop
1965+
#endif
18181966

18191967
/* 801D34DC-801D382C 1CDE1C 0350+00 1/1 0/0 0/0 .text regionGridDraw__18dMenu_Fmap2DBack_cFv */
18201968
#pragma push

0 commit comments

Comments
 (0)