mirror of
https://github.com/zeldaret/tp
synced 2026-06-18 07:25:50 -04:00
d_select_cursor - most functions matching
This commit is contained in:
+429
-106
@@ -4,19 +4,19 @@
|
||||
//
|
||||
|
||||
#include "d/d_select_cursor.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "JSystem/J2DGraph/J2DAnmLoader.h"
|
||||
#include "JSystem/J2DGraph/J2DAnimation.h"
|
||||
#include "JSystem/J2DGraph/J2DGrafContext.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
#include "global.h"
|
||||
|
||||
//
|
||||
// Types:
|
||||
//
|
||||
|
||||
struct J2DAnmLoaderDataBase {
|
||||
/* 80308A6C */ void load(void const*);
|
||||
};
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
@@ -83,24 +83,7 @@ extern "C" extern void* __vt__18J2DAnmTransformKey[6];
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80394AA0-80394AA0 021100 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DEAD static char const* const stringBase_80394AA0 = "zelda_select_cursor_4parts.blo";
|
||||
SECTION_DEAD static char const* const stringBase_80394ABF = "zelda_store_select_icon.blo";
|
||||
SECTION_DEAD static char const* const stringBase_80394ADB = "zelda_map_screen_portal_icon.blo";
|
||||
SECTION_DEAD static char const* const stringBase_80394AFC = "zelda_map_screen_batsumark.blo";
|
||||
SECTION_DEAD static char const* const stringBase_80394B1B = "";
|
||||
SECTION_DEAD static char const* const stringBase_80394B1C = "zelda_store_select_icon.bck";
|
||||
SECTION_DEAD static char const* const stringBase_80394B38 = "zelda_select_cursor_4parts.bpk";
|
||||
SECTION_DEAD static char const* const stringBase_80394B57 = "zelda_store_select_icon.bpk";
|
||||
SECTION_DEAD static char const* const stringBase_80394B73 = "zelda_map_screen_portal_icon.bpk";
|
||||
SECTION_DEAD static char const* const stringBase_80394B94 = "zelda_map_screen_batsumark.bpk";
|
||||
SECTION_DEAD static char const* const stringBase_80394BB3 = "zelda_select_cursor_4parts.btk";
|
||||
SECTION_DEAD static char const* const stringBase_80394BD2 = "zelda_store_select_icon.btk";
|
||||
SECTION_DEAD static char const* const stringBase_80394BEE = "zelda_store_select_icon_02.btk";
|
||||
/* @stringBase0 padding */
|
||||
SECTION_DEAD static char const* const pad_80394C0D = "\0\0";
|
||||
#pragma pop
|
||||
|
||||
|
||||
/* 803BB700-803BB70C 018820 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */
|
||||
SECTION_DATA static u8 cNullVec__6Z2Calc[12] = {
|
||||
@@ -110,55 +93,55 @@ SECTION_DATA static u8 cNullVec__6Z2Calc[12] = {
|
||||
/* 803BB70C-803BB71C -00001 0010+00 0/1 0/0 0/0 .data blo_name$3684 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static void* blo_name[4] = {
|
||||
(void*)&d_d_select_cursor__stringBase0,
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x1F),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x3B),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x5C),
|
||||
SECTION_DATA static char* blo_name[4] = {
|
||||
"zelda_select_cursor_4parts.blo",
|
||||
"zelda_store_select_icon.blo",
|
||||
"zelda_map_screen_portal_icon.blo",
|
||||
"zelda_map_screen_batsumark.blo",
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 803BB71C-803BB72C -00001 0010+00 0/1 0/0 0/0 .data bck_name$3685 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static void* bck_name[4] = {
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x7B),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x7C),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x7B),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x7B),
|
||||
SECTION_DATA static char* bck_name[4] = {
|
||||
"",
|
||||
"zelda_store_select_icon.bck",
|
||||
"",
|
||||
"",
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 803BB72C-803BB73C -00001 0010+00 0/1 0/0 0/0 .data bpk_name$3686 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static void* bpk_name[4] = {
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x98),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0xB7),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0xD3),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0xF4),
|
||||
SECTION_DATA static char* bpk_name[4] = {
|
||||
"zelda_select_cursor_4parts.bpk",
|
||||
"zelda_store_select_icon.bpk",
|
||||
"zelda_map_screen_portal_icon.bpk",
|
||||
"zelda_map_screen_batsumark.bpk",
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 803BB73C-803BB74C -00001 0010+00 0/1 0/0 0/0 .data btk_name$3687 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static void* btk_name[4] = {
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x113),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x132),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x7B),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x7B),
|
||||
SECTION_DATA static char* btk_name[4] = {
|
||||
"zelda_select_cursor_4parts.btk",
|
||||
"zelda_store_select_icon.btk",
|
||||
"",
|
||||
"",
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 803BB74C-803BB78C -00001 0010+30 0/1 0/0 0/0 .data btk2_name$3688 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static void* btk2_name[4 + 12 /* padding */] = {
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x7B),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x14E),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x7B),
|
||||
(void*)(((char*)&d_d_select_cursor__stringBase0) + 0x7B),
|
||||
SECTION_DATA static char* btk2_name[4 + 12 /* padding */] = {
|
||||
"",
|
||||
"zelda_store_select_icon_02.btk",
|
||||
"",
|
||||
"",
|
||||
/* padding */
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -175,6 +158,11 @@ SECTION_DATA static void* btk2_name[4 + 12 /* padding */] = {
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DEAD static char const* const pad_80394C0D = "\0\0";
|
||||
#pragma pop
|
||||
|
||||
/* 803BB78C-803BB7A8 0188AC 0010+0C 2/2 0/0 0/0 .data __vt__16dSelect_cursor_c */
|
||||
SECTION_DATA extern void* __vt__16dSelect_cursor_c[4 + 3 /* padding */] = {
|
||||
(void*)NULL /* RTTI */,
|
||||
@@ -203,6 +191,19 @@ SECTION_SDATA2 static f32 lit_3673 = 1.0f;
|
||||
SECTION_SDATA2 static f32 lit_3674 = 3.0f / 10.0f;
|
||||
|
||||
/* 801941E4-80194220 18EB24 003C+00 1/1 0/0 0/0 .text __ct__19dSelect_cursorHIO_cFv */
|
||||
// matches with literals
|
||||
#ifdef NONMATCHING
|
||||
dSelect_cursorHIO_c::dSelect_cursorHIO_c() {
|
||||
field_0x8 = 1.0f;
|
||||
mXAxisExpansion = 1.0f;
|
||||
mYAxisExpansion = 1.0f;
|
||||
mOscillation = 3.0f / 10.0f;
|
||||
field_0x18 = 1.0f;
|
||||
mRatioX = 1.0f;
|
||||
mRatioY = 1.0f;
|
||||
mDebugON = false;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
@@ -211,12 +212,12 @@ asm dSelect_cursorHIO_c::dSelect_cursorHIO_c() {
|
||||
#include "asm/d/d_select_cursor/__ct__19dSelect_cursorHIO_cFv.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80394A10-80394A30 021070 0020+00 1/1 0/0 0/0 .rodata corner_tag$3707 */
|
||||
SECTION_RODATA static u8 const corner_tag[32] = {
|
||||
0x6C, 0x5F, 0x75, 0x5F, 0x6E, 0x75, 0x6C, 0x6C, 0x6C, 0x5F, 0x64, 0x5F, 0x6E, 0x75, 0x6C, 0x6C,
|
||||
0x72, 0x5F, 0x75, 0x5F, 0x6E, 0x75, 0x6C, 0x6C, 0x72, 0x5F, 0x64, 0x5F, 0x6E, 0x75, 0x6C, 0x6C,
|
||||
SECTION_RODATA static u64 const corner_tag[4] = {
|
||||
'l_u_null', 'l_d_null', 'r_u_null', 'r_d_null',
|
||||
};
|
||||
COMPILER_STRIP_GATE(0x80394A10, &corner_tag);
|
||||
|
||||
@@ -230,6 +231,150 @@ SECTION_SDATA2 static u8 lit_3808[4] = {
|
||||
|
||||
/* 80194220-801949EC 18EB60 07CC+00 0/0 14/14 0/0 .text __ct__16dSelect_cursor_cFUcfP10JKRArchive
|
||||
*/
|
||||
// Matches with literals
|
||||
#ifdef NONMATCHING
|
||||
dSelect_cursor_c::dSelect_cursor_c(u8 param_0, f32 param_1, JKRArchive* param_2) {
|
||||
mpCursorHIO = new dSelect_cursorHIO_c();
|
||||
mpCursorHIO->field_0x4 = -1;
|
||||
mNameIdx = 0;
|
||||
field_0xb6 = param_0;
|
||||
field_0xb4 = 0xff;
|
||||
mUpdateFlag = true;
|
||||
mpPane = NULL;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
field_0x94[i] = 0.0f;
|
||||
field_0xa4[i] = 0.0f;
|
||||
field_0x74[i] = 0.0f;
|
||||
field_0x84[i] = 0.0f;
|
||||
}
|
||||
mParam1 = mpCursorHIO->mXAxisExpansion;
|
||||
mParam2 = mpCursorHIO->mYAxisExpansion;
|
||||
mParam3 = mpCursorHIO->mOscillation;
|
||||
mParam4 = mpCursorHIO->mRatioX;
|
||||
mParam5 = mpCursorHIO->mRatioY;
|
||||
|
||||
switch(field_0xb6) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
mNameIdx = 0;
|
||||
break;
|
||||
case 5:
|
||||
mNameIdx = 2;
|
||||
break;
|
||||
case 6:
|
||||
mNameIdx = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
if (param_2 == NULL) {
|
||||
param_2 = dComIfGp_getMain2DArchive();
|
||||
}
|
||||
|
||||
mpScreen = new J2DScreen();
|
||||
mpScreen->setPriority((char*) blo_name[mNameIdx], 0x20000, param_2);
|
||||
dPaneClass_showNullPane(mpScreen);
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
field_0x1C[i] = NULL;
|
||||
}
|
||||
|
||||
switch(mNameIdx) {
|
||||
case 0:
|
||||
mpPaneMgr = new CPaneMgr(mpScreen, 'n_all', 2, NULL);
|
||||
mpPaneMgr->hide();
|
||||
mpPaneMgr->setAlpha(0);
|
||||
|
||||
for (int i = 0; i< 4; i++) {
|
||||
field_0x1C[i] = new CPaneMgr(mpScreen, ((u64*)corner_tag)[i], 0, NULL);
|
||||
field_0x94[i] = mpScreen->search( ((u64*)corner_tag)[i])->getTranslateX();
|
||||
field_0xa4[i] = mpScreen->search( ((u64*)corner_tag)[i])->getTranslateY();
|
||||
field_0x74[i] = field_0x94[i];
|
||||
field_0x84[i] = field_0xa4[i];
|
||||
}
|
||||
|
||||
mpPaneMgr->scale(param_1, param_1);
|
||||
field_0x14 = NULL;
|
||||
field_0x18 = NULL;
|
||||
break;
|
||||
case 1:
|
||||
mpPaneMgr = new CPaneMgr(mpScreen, 'n_all', 2, NULL);
|
||||
mpPaneMgr->hide();
|
||||
mpPaneMgr->setAlpha(0);
|
||||
mpPaneMgr->scale(param_1, param_1);
|
||||
field_0x14 = new CPaneMgr(mpScreen, 'sel_po00', 0, NULL);
|
||||
field_0x14->hide();
|
||||
field_0x18 = new CPaneMgr(mpScreen, 'n_all2', 2, NULL);
|
||||
break;
|
||||
case 2:
|
||||
mpPaneMgr = new CPaneMgr(mpScreen, 'Null', 2, NULL);
|
||||
mpPaneMgr->hide();
|
||||
mpPaneMgr->setAlpha(0);
|
||||
mpPaneMgr->scale(param_1, param_1);
|
||||
field_0x14 = NULL;
|
||||
field_0x18 = NULL;
|
||||
break;
|
||||
case 3:
|
||||
mpPaneMgr = new CPaneMgr(mpScreen, 'batsu', 2, NULL);
|
||||
mpPaneMgr->hide();
|
||||
mpPaneMgr->setAlpha(0);
|
||||
mpPaneMgr->scale(param_1, param_1);
|
||||
field_0x14 = NULL;
|
||||
field_0x18 = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
mpSelectIcon = NULL;
|
||||
i_OSInitFastCast();
|
||||
if (strcmp(bpk_name[mNameIdx], "") != 0) {
|
||||
field_0x30 = (J2DAnmColor*)J2DAnmLoaderDataBase::load(JKRFileLoader::getGlbResource(bpk_name[mNameIdx], param_2));
|
||||
field_0x30->searchUpdateMaterialID(mpScreen);
|
||||
} else {
|
||||
field_0x30 = NULL;
|
||||
}
|
||||
|
||||
field_0x44 = 0.0f;
|
||||
if (strcmp(btk_name[mNameIdx], "") != 0) {
|
||||
field_0x34[0] = (J2DAnmTextureSRTKey*)J2DAnmLoaderDataBase::load(JKRFileLoader::getGlbResource(btk_name[mNameIdx], param_2));
|
||||
field_0x34[0]->searchUpdateMaterialID(mpScreen);
|
||||
} else {
|
||||
field_0x34[0] = NULL;
|
||||
}
|
||||
|
||||
field_0x48[0] = 0.0f;
|
||||
if (strcmp(btk2_name[mNameIdx], "") != 0) {
|
||||
field_0x34[1] = (J2DAnmTextureSRTKey*)J2DAnmLoaderDataBase::load(JKRFileLoader::getGlbResource(btk2_name[mNameIdx], param_2));
|
||||
field_0x34[1]->searchUpdateMaterialID(mpScreen);
|
||||
} else {
|
||||
field_0x34[1] = NULL;
|
||||
}
|
||||
|
||||
field_0x48[1] = 0.0f;
|
||||
if (strcmp(bck_name[mNameIdx], "") != 0) {
|
||||
field_0x2C = (J2DAnmTransformKey*)J2DAnmLoaderDataBase::load(JKRFileLoader::getGlbResource(bck_name[mNameIdx], param_2));
|
||||
} else {
|
||||
field_0x2C = NULL;
|
||||
}
|
||||
|
||||
field_0x40 = 0.0f;
|
||||
switch(mNameIdx) {
|
||||
case 1:
|
||||
field_0x50 = mpScreen->search('ssel_ico')->getTranslateX();
|
||||
field_0x54 = mpScreen->search('ssel_ico')->getTranslateY();
|
||||
break;
|
||||
case 0:
|
||||
case 2:
|
||||
case 3:
|
||||
field_0x50 = 0.0f;
|
||||
field_0x54 = 0.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
mPositionY = 0.0f;
|
||||
mPositionX = 0.0f;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
@@ -238,16 +383,53 @@ asm dSelect_cursor_c::dSelect_cursor_c(u8 param_0, f32 param_1, JKRArchive* para
|
||||
#include "asm/d/d_select_cursor/__ct__16dSelect_cursor_cFUcfP10JKRArchive.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 801949EC-80194C30 18F32C 0244+00 1/0 0/0 0/0 .text __dt__16dSelect_cursor_cFv */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm dSelect_cursor_c::~dSelect_cursor_c() {
|
||||
nofralloc
|
||||
#include "asm/d/d_select_cursor/__dt__16dSelect_cursor_cFv.s"
|
||||
dSelect_cursor_c::~dSelect_cursor_c() {
|
||||
delete mpScreen;
|
||||
mpScreen = NULL;
|
||||
if (mpPaneMgr) {
|
||||
delete mpPaneMgr;
|
||||
mpPaneMgr = NULL;
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (field_0x1C[i]) {
|
||||
delete field_0x1C[i];
|
||||
field_0x1C[i] = NULL;
|
||||
}
|
||||
}
|
||||
if (field_0x14) {
|
||||
delete field_0x14;
|
||||
field_0x14 = NULL;
|
||||
}
|
||||
if (field_0x18) {
|
||||
delete field_0x18;
|
||||
field_0x18 = NULL;
|
||||
}
|
||||
if (mpSelectIcon) {
|
||||
delete mpSelectIcon;
|
||||
mpSelectIcon = NULL;
|
||||
}
|
||||
if (field_0x30) {
|
||||
delete field_0x30;
|
||||
field_0x30 = NULL;
|
||||
}
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (field_0x34[i]) {
|
||||
delete field_0x34[i];
|
||||
field_0x34[i] = NULL;
|
||||
}
|
||||
}
|
||||
if (field_0x2C) {
|
||||
delete field_0x2C;
|
||||
field_0x2C = NULL;
|
||||
}
|
||||
if (mpCursorHIO) {
|
||||
delete mpCursorHIO;
|
||||
mpCursorHIO = NULL;
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 80194C30-80194CC0 18F570 0090+00 1/0 0/0 0/0 .text draw__16dSelect_cursor_cFv */
|
||||
#ifdef NONMATCHING
|
||||
@@ -256,9 +438,9 @@ void dSelect_cursor_c::draw() {
|
||||
update();
|
||||
J2DGrafContext* gphCtx = dComIfGp_getCurrentGrafPort();
|
||||
gphCtx->setup2D();
|
||||
mpScreen->draw(FLOAT_LABEL(lit_3808),FLOAT_LABEL(lit_3808),gphCtx);
|
||||
mpScreen->draw(0.0f, 0.0f, gphCtx);
|
||||
if (mpSelectIcon) {
|
||||
// mpSelectIcon->drawSelf(); // inline here, but not sure how to properly define it
|
||||
mpSelectIcon->drawSelf(); // inline here, but not sure how to properly define it
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -281,6 +463,100 @@ SECTION_SDATA2 static f32 lit_4062 = 0.5f;
|
||||
SECTION_SDATA2 static f64 lit_4064 = 4503601774854144.0 /* cast s32 to float */;
|
||||
|
||||
/* 80194CC0-801950F4 18F600 0434+00 1/1 0/0 0/0 .text update__16dSelect_cursor_cFv */
|
||||
// matches with literals
|
||||
#ifdef NONMATCHING
|
||||
void dSelect_cursor_c::update() {
|
||||
f32 fVar1 = 1.0f;
|
||||
if (field_0xb6 == 3) {
|
||||
fVar1 = 0.5f;
|
||||
}
|
||||
mpPaneMgr->translate(mPositionX, mPositionY);
|
||||
if (mpCursorHIO->mDebugON) {
|
||||
mParam1 = mpCursorHIO->mXAxisExpansion;
|
||||
mParam2 = mpCursorHIO->mYAxisExpansion;
|
||||
mParam3 = mpCursorHIO->mOscillation;
|
||||
mParam4 = mpCursorHIO->mRatioX;
|
||||
mParam5 = mpCursorHIO->mRatioY;
|
||||
}
|
||||
|
||||
if (mUpdateFlag) {
|
||||
if (field_0x30) {
|
||||
if (chkPlayAnime(0)) {
|
||||
if (mNameIdx == 1) {
|
||||
field_0x44 += mpCursorHIO->field_0x8 * fVar1;
|
||||
} else {
|
||||
field_0x44 += fVar1;
|
||||
}
|
||||
|
||||
if (field_0x44 >= field_0x30->getFrameMax()) {
|
||||
field_0x44 -= field_0x30->getFrameMax();
|
||||
}
|
||||
|
||||
field_0x30->setFrame(field_0x44);
|
||||
setBpkAnimation(field_0x30);
|
||||
} else {
|
||||
if (field_0x44 != 1.0f) {
|
||||
field_0x44 = 1.0f;
|
||||
field_0x30->setFrame(field_0x44);
|
||||
setBpkAnimation(field_0x30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (field_0x34[i]) {
|
||||
if ((i == 0 && chkPlayAnime(2)) || (i == 1 && chkPlayAnime(3))) {
|
||||
if (mNameIdx == 1) {
|
||||
field_0x48[i] += mpCursorHIO->field_0x8 * fVar1;
|
||||
} else {
|
||||
field_0x48[i] += fVar1;
|
||||
}
|
||||
if (field_0x48[i] >= field_0x34[i]->getFrameMax()) {
|
||||
field_0x48[i] -= field_0x34[i]->getFrameMax();
|
||||
}
|
||||
|
||||
field_0x34[i]->setFrame(field_0x48[i]);
|
||||
}
|
||||
setBtk0Animation(field_0x34[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (field_0x2C && chkPlayAnime(1)) {
|
||||
if (mNameIdx == 1) {
|
||||
field_0x40 += mpCursorHIO->field_0x8 * fVar1;
|
||||
} else {
|
||||
field_0x40 += fVar1;
|
||||
}
|
||||
if (field_0x40 >= field_0x2C->getFrameMax()) {
|
||||
field_0x40 -= field_0x2C->getFrameMax();
|
||||
}
|
||||
|
||||
field_0x2C->setFrame(field_0x40);
|
||||
setBckAnimation(field_0x2C);
|
||||
|
||||
}
|
||||
|
||||
if (chkPlayAnime(1) && mNameIdx == 0) {
|
||||
setCursorAnimation();
|
||||
}
|
||||
|
||||
mpScreen->animation();
|
||||
}
|
||||
|
||||
if (mpSelectIcon && field_0x14) {
|
||||
Vec res = field_0x14->getGlobalVtxCenter(field_0x14->mPane, false, 0);
|
||||
mpSelectIcon->setPos(field_0x14->getPanePtr(), res.x, res.y);
|
||||
mpSelectIcon->animation();
|
||||
mpSelectIcon->setAlpha(field_0x14->getPanePtr()->getAlpha());
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (field_0x1C[i]) {
|
||||
field_0x1C[i]->scale(mParam4, mParam5);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
@@ -289,12 +565,14 @@ asm void dSelect_cursor_c::update() {
|
||||
#include "asm/d/d_select_cursor/update__16dSelect_cursor_cFv.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80453A60-80453A64 002060 0004+00 1/1 0/0 0/0 .sdata2 @4089 */
|
||||
SECTION_SDATA2 static f32 lit_4089 = -1.0f;
|
||||
|
||||
/* 801950F4-801951B0 18FA34 00BC+00 0/0 30/30 0/0 .text setPos__16dSelect_cursor_cFffP7J2DPaneb */
|
||||
// matches with literals
|
||||
#ifdef NONMATCHING
|
||||
void dSelect_cursor_c::setPos(f32 i_posX, f32 i_posY, J2DPane* i_pane, bool i_scaleBounds) {
|
||||
mpPane = i_pane;
|
||||
@@ -304,15 +582,16 @@ void dSelect_cursor_c::setPos(f32 i_posX, f32 i_posY, J2DPane* i_pane, bool i_sc
|
||||
return;
|
||||
}
|
||||
|
||||
f32 width = i_pane->getWidth() * FLOAT_LABEL(lit_3673) * FLOAT_LABEL(lit_4062);
|
||||
f32 height = i_pane->getHeight() * FLOAT_LABEL(lit_4062);
|
||||
f32 val1 = 1.0f;
|
||||
f32 width = (i_pane->getWidth()) * val1 * 0.5f;
|
||||
f32 height = i_pane->getHeight() * 0.5f;
|
||||
|
||||
if (i_scaleBounds) {
|
||||
width *= i_pane->getScaleX();
|
||||
height *= i_pane->getScaleY();
|
||||
}
|
||||
|
||||
f32 tmp7 = FLOAT_LABEL(lit_4089);
|
||||
f32 tmp7 = -1.0f;
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
||||
@@ -323,7 +602,7 @@ void dSelect_cursor_c::setPos(f32 i_posX, f32 i_posY, J2DPane* i_pane, bool i_sc
|
||||
field_0x94[i] *= tmp7;
|
||||
}
|
||||
|
||||
if ((i & 1) ^ (i >> 0x1f) == i >> 0x1f) {
|
||||
if (i % 2 == 0) {
|
||||
field_0xa4[i] *= tmp7;
|
||||
}
|
||||
}
|
||||
@@ -351,19 +630,23 @@ void dSelect_cursor_c::setParam(f32 i_param1, f32 i_param2, f32 i_param3, f32 i_
|
||||
}
|
||||
|
||||
/* 801951C8-801952A0 18FB08 00D8+00 0/0 14/14 0/0 .text setScale__16dSelect_cursor_cFf */
|
||||
// matches with literals
|
||||
#ifdef NONMATCHING
|
||||
// first conditional has issues
|
||||
void dSelect_cursor_c::setScale(f32 i_scale) {
|
||||
J2DPane* pane = mpPaneMgr->getPanePtr();
|
||||
pane->scale(i_scale,i_scale);
|
||||
|
||||
s8 name_idx = mNameIdx;
|
||||
if ((name_idx == 1 || name_idx < 1) || (name_idx < 0 && name_idx < 4)) {
|
||||
switch (mNameIdx) {
|
||||
case 1:
|
||||
field_0x50 = mpScreen->search('ssel_ico')->getTranslateX();
|
||||
field_0x54 = mpScreen->search('ssel_ico')->getTranslateY();
|
||||
} else {
|
||||
break;
|
||||
case 0:
|
||||
case 2:
|
||||
case 3:
|
||||
field_0x50 = 0.0f;
|
||||
field_0x54 = 0.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -398,8 +681,8 @@ void dSelect_cursor_c::setAlphaRate(f32 i_alphaRate) {
|
||||
SECTION_SDATA2 static f32 lit_4157 = 5.0f;
|
||||
|
||||
/* 80195330-801953CC 18FC70 009C+00 0/0 1/1 0/0 .text addAlpha__16dSelect_cursor_cFv */
|
||||
#ifdef NONMATCHING
|
||||
// matches with literals
|
||||
#ifdef NONMATCHING
|
||||
int dSelect_cursor_c::addAlpha() {
|
||||
s16 alpha_timer = mpPaneMgr->getAlphaTimer();
|
||||
|
||||
@@ -412,7 +695,7 @@ int dSelect_cursor_c::addAlpha() {
|
||||
} else {
|
||||
alpha_timer++;
|
||||
mpPaneMgr->alphaAnimeStart(alpha_timer);
|
||||
mpPaneMgr->setAlphaRate(alpha_timer/FLOAT_LABEL(lit_4157));
|
||||
mpPaneMgr->setAlphaRate(alpha_timer/5.0f);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -429,8 +712,8 @@ asm int dSelect_cursor_c::addAlpha() {
|
||||
#endif
|
||||
|
||||
/* 801953CC-80195460 18FD0C 0094+00 0/0 1/1 0/0 .text decAlpha__16dSelect_cursor_cFv */
|
||||
#ifdef NONMATCHING
|
||||
// matches with literals
|
||||
#ifdef NONMATCHING
|
||||
int dSelect_cursor_c::decAlpha() {
|
||||
s16 alpha_timer = mpPaneMgr->getAlphaTimer();
|
||||
|
||||
@@ -442,7 +725,7 @@ int dSelect_cursor_c::decAlpha() {
|
||||
} else {
|
||||
alpha_timer--;
|
||||
mpPaneMgr->alphaAnimeStart(alpha_timer);
|
||||
mpPaneMgr->setAlphaRate(alpha_timer/FLOAT_LABEL(lit_4157));
|
||||
mpPaneMgr->setAlphaRate(alpha_timer/5.0f);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -460,49 +743,62 @@ asm int dSelect_cursor_c::decAlpha() {
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80394A30-80394A50 021090 0020+00 1/1 0/0 0/0 .rodata tag$4181 */
|
||||
SECTION_RODATA static u8 const tag_4181[32] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x6C, 0x5F, 0x6C, 0x64, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x5F, 0x6C, 0x75,
|
||||
0x00, 0x00, 0x00, 0x00, 0x6C, 0x5F, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x5F, 0x72, 0x75,
|
||||
static u64 const tag_4181[4] = {
|
||||
'l_ld', 'l_lu', 'l_rd', 'l_ru',
|
||||
};
|
||||
COMPILER_STRIP_GATE(0x80394A30, &tag_4181);
|
||||
|
||||
/* 80195460-801955F0 18FDA0 0190+00 1/1 0/0 0/0 .text
|
||||
* setBpkAnimation__16dSelect_cursor_cFP11J2DAnmColor */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void dSelect_cursor_c::setBpkAnimation(J2DAnmColor* param_0) {
|
||||
nofralloc
|
||||
#include "asm/d/d_select_cursor/setBpkAnimation__16dSelect_cursor_cFP11J2DAnmColor.s"
|
||||
void dSelect_cursor_c::setBpkAnimation(J2DAnmColor* param_0) {
|
||||
switch (mNameIdx) {
|
||||
case 0:
|
||||
for (int i = 0; i < 4; i++) {
|
||||
mpScreen->search(tag_4181[i])->setAnimation(param_0);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
mpScreen->search('light')->setAnimation(param_0);
|
||||
mpScreen->search('back_l')->setAnimation(param_0);
|
||||
break;
|
||||
case 3:
|
||||
mpScreen->search('batsu')->setAnimation(param_0);
|
||||
break;
|
||||
default:
|
||||
mpScreen->search('light00')->setAnimation(param_0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80394A50-80394A90 0210B0 0040+00 1/1 0/0 0/0 .rodata tag$4197 */
|
||||
SECTION_RODATA static u8 const tag_4197[64] = {
|
||||
0x00, 0x69, 0x5F, 0x63, 0x5F, 0x6C, 0x64, 0x31, 0x00, 0x69, 0x5F, 0x63, 0x5F, 0x6C, 0x64, 0x32,
|
||||
0x00, 0x69, 0x5F, 0x63, 0x5F, 0x6C, 0x75, 0x31, 0x00, 0x69, 0x5F, 0x63, 0x5F, 0x6C, 0x75, 0x32,
|
||||
0x00, 0x69, 0x5F, 0x63, 0x5F, 0x72, 0x64, 0x31, 0x00, 0x69, 0x5F, 0x63, 0x5F, 0x72, 0x64, 0x32,
|
||||
0x00, 0x69, 0x5F, 0x63, 0x5F, 0x72, 0x75, 0x31, 0x00, 0x69, 0x5F, 0x63, 0x5F, 0x72, 0x75, 0x32,
|
||||
static u64 const tag_4197[8] = {
|
||||
'i_c_ld1', 'i_c_ld2', 'i_c_lu1', 'i_c_lu2', 'i_c_rd1', 'i_c_rd2', 'i_c_ru1', 'i_c_ru2',
|
||||
};
|
||||
COMPILER_STRIP_GATE(0x80394A50, &tag_4197);
|
||||
|
||||
/* 80394A90-80394AA0 0210F0 0010+00 1/1 0/0 0/0 .rodata tag$4204 */
|
||||
SECTION_RODATA static u8 const tag_4204[16] = {
|
||||
0x00, 0x00, 0x67, 0x6F, 0x6C, 0x64, 0x30, 0x31, 0x00, 0x00, 0x67, 0x6F, 0x6C, 0x64, 0x30, 0x32,
|
||||
static u64 const tag_4204[2] = {
|
||||
'gold01', 'gold02',
|
||||
};
|
||||
COMPILER_STRIP_GATE(0x80394A90, &tag_4204);
|
||||
|
||||
/* 801955F0-80195724 18FF30 0134+00 1/1 0/0 0/0 .text
|
||||
* setBtk0Animation__16dSelect_cursor_cFP19J2DAnmTextureSRTKey */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void dSelect_cursor_c::setBtk0Animation(J2DAnmTextureSRTKey* param_0) {
|
||||
nofralloc
|
||||
#include "asm/d/d_select_cursor/setBtk0Animation__16dSelect_cursor_cFP19J2DAnmTextureSRTKey.s"
|
||||
void dSelect_cursor_c::setBtk0Animation(J2DAnmTextureSRTKey* param_0) {
|
||||
switch (mNameIdx) {
|
||||
case 0:
|
||||
for (int i = 0; i < 8; i++) {
|
||||
mpScreen->search(tag_4197[i])->setAnimation(param_0);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mpScreen->search(tag_4204[i])->setAnimation(param_0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
mpScreen->search('gold01')->setAnimation(param_0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80453A68-80453A6C 002068 0004+00 1/1 0/0 0/0 .sdata2 @4237 */
|
||||
@@ -512,6 +808,38 @@ SECTION_SDATA2 static f32 lit_4237 = 20.0f;
|
||||
SECTION_SDATA2 static f32 lit_4238 = 10.0f;
|
||||
|
||||
/* 80195724-801958E0 190064 01BC+00 1/1 0/0 0/0 .text setCursorAnimation__16dSelect_cursor_cFv */
|
||||
// Matches without literals
|
||||
#ifdef NONMATCHING
|
||||
void dSelect_cursor_c::setCursorAnimation() {
|
||||
f32 fVar1 = 1.0f;
|
||||
if (field_0xb6 == 3) {
|
||||
fVar1 = 0.5f;
|
||||
}
|
||||
|
||||
field_0x40 += fVar1;
|
||||
if (field_0x40 >= 20.0f) {
|
||||
field_0x40 -= 20.0f;
|
||||
}
|
||||
f32 fVar2;
|
||||
f32 param3 = mParam3;
|
||||
fVar2 = field_0x40;
|
||||
if (fVar2 < 10.0f) {
|
||||
fVar2 /= 10.0f;
|
||||
} else {
|
||||
fVar2 = (20.0f - fVar2) / 10.0f;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
field_0x74[i] = mParam1 * (field_0x94[i] * ((1.0f - param3) + fVar2 * param3));
|
||||
field_0x84[i] = mParam2 * (field_0xa4[i] * ((1.0f - param3) + fVar2 * param3));
|
||||
}
|
||||
|
||||
moveCenter(mpScreen->search('l_u_null'), field_0x74[0], field_0x84[0]);
|
||||
moveCenter(mpScreen->search('l_d_null'), field_0x74[1], field_0x84[1]);
|
||||
moveCenter(mpScreen->search('r_u_null'), field_0x74[2], field_0x84[2]);
|
||||
moveCenter(mpScreen->search('r_d_null'), field_0x74[3], field_0x84[3]);
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
@@ -520,6 +848,7 @@ asm void dSelect_cursor_c::setCursorAnimation() {
|
||||
#include "asm/d/d_select_cursor/setCursorAnimation__16dSelect_cursor_cFv.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 801958E0-80195940 190220 0060+00 1/1 0/0 0/0 .text
|
||||
* setBckAnimation__16dSelect_cursor_cFP18J2DAnmTransformKey */
|
||||
@@ -534,14 +863,8 @@ void dSelect_cursor_c::moveCenter(J2DPane* i_pane, f32 i_x, f32 i_y) {
|
||||
}
|
||||
|
||||
/* 80195978-801959C0 1902B8 0048+00 1/0 0/0 0/0 .text __dt__19dSelect_cursorHIO_cFv */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm dSelect_cursorHIO_c::~dSelect_cursorHIO_c() {
|
||||
nofralloc
|
||||
#include "asm/d/d_select_cursor/__dt__19dSelect_cursorHIO_cFv.s"
|
||||
dSelect_cursorHIO_c::~dSelect_cursorHIO_c() {
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 801959C0-80195A2C 190300 006C+00 0/0 1/0 0/0 .text __dt__18J2DAnmTransformKeyFv */
|
||||
#pragma push
|
||||
|
||||
Reference in New Issue
Block a user