d_shop_camera, d_shop_item_ctrl OK (#2044)

This commit is contained in:
hatal175
2024-01-22 22:24:24 +02:00
committed by GitHub
parent 697cd08979
commit ea041b9d95
17 changed files with 436 additions and 1601 deletions
+223 -237
View File
@@ -1,292 +1,278 @@
//
// Generated By: dol2asm
// Translation Unit: d/shop/d_shop_camera
// d/shop/d_shop_camera
//
#include "d/shop/d_shop_camera.h"
#include "dol2asm.h"
#include "d/com/d_com_inf_game.h"
#include "d/d_camera.h"
#include "d/a/d_a_player.h"
#include "SSystem/SComponent/c_math.h"
//
// Types:
//
struct fopAc_ac_c {};
struct Vec {};
struct cXyz {
/* 80266B34 */ void operator-(Vec const&) const;
struct SeiraCam {
/* 0x00 */ Vec field_0x0;
/* 0x0C */ Vec field_0xc;
/* 0x18 */ f32 field_0x18;
/* 0x1c */ Vec field_0x1c;
/* 0x20 */ Vec field_0x28;
/* 0x18 */ f32 field_0x34;
};
struct dCamera_c {
/* 801614E8 */ void Stay();
/* 8016300C */ void SetTrimSize(s32);
/* 80180A40 */ void EventRecoverNotime();
/* 80180AE0 */ void Set(cXyz, cXyz, f32, s16);
/* 80180BA0 */ void Reset(cXyz, cXyz, f32, s16);
};
struct ShopCam_action_c {
/* 80195C9C */ void shop_cam_action_init();
/* 80195E18 */ void shop_cam_action();
/* 8019630C */ void Save();
/* 8019635C */ void EventRecoverNotime();
/* 801963B4 */ void Reset();
/* 801964C8 */ void move();
/* 80196544 */ void setCamDataIdx(fopAc_ac_c*, fopAc_ac_c*, fopAc_ac_c*, fopAc_ac_c*, cXyz*,
cXyz*);
/* 80196608 */ void setCamDataIdx2(fopAc_ac_c*, fopAc_ac_c*, fopAc_ac_c*, fopAc_ac_c*,
fopAc_ac_c*, fopAc_ac_c*, fopAc_ac_c*, cXyz*, cXyz*);
/* 801966D4 */ void _debugSetCamera();
/* 801968B8 */ void setMasterCamCtrPos(cXyz*);
};
//
// Forward References:
//
extern "C" void shop_cam_action_init__16ShopCam_action_cFv();
extern "C" void shop_cam_action__16ShopCam_action_cFv();
extern "C" void Save__16ShopCam_action_cFv();
extern "C" void EventRecoverNotime__16ShopCam_action_cFv();
extern "C" void Reset__16ShopCam_action_cFv();
extern "C" void move__16ShopCam_action_cFv();
extern "C" void
setCamDataIdx__16ShopCam_action_cFP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP4cXyzP4cXyz();
extern "C" void
setCamDataIdx2__16ShopCam_action_cFP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP4cXyzP4cXyz();
extern "C" void _debugSetCamera__16ShopCam_action_cFv();
extern "C" void setMasterCamCtrPos__16ShopCam_action_cFP4cXyz();
//
// External References:
//
extern "C" void Stay__9dCamera_cFv();
extern "C" void SetTrimSize__9dCamera_cFl();
extern "C" void EventRecoverNotime__9dCamera_cFv();
extern "C" void Set__9dCamera_cF4cXyz4cXyzfs();
extern "C" void Reset__9dCamera_cF4cXyz4cXyzfs();
extern "C" void dCam_getBody__Fv();
extern "C" void __mi__4cXyzCFRC3Vec();
extern "C" void cM_atan2s__Fff();
extern "C" void cLib_addCalc2__FPffff();
extern "C" void cLib_addCalcPos2__FP4cXyzRC4cXyzff();
extern "C" void cLib_offsetPos__FP4cXyzPC4cXyzsPC4cXyz();
extern "C" void PSVECSquareMag();
extern "C" void __ptmf_test();
extern "C" void __ptmf_scall();
extern "C" void _savegpr_27();
extern "C" void _restgpr_27();
extern "C" extern u8 const __ptmf_null[12 + 4 /* padding */];
extern "C" extern u8 g_dComIfG_gameInfo[122384];
extern "C" extern u32 __float_nan;
//
// Declarations:
//
/* ############################################################################################## */
/* 803BB7C8-803BB800 0188E8 0038+00 1/0 0/0 0/0 .data cam_seira_shop */
SECTION_DATA static u8 cam_seira_shop[56] = {
0x00, 0x00, 0x00, 0x00, 0x42, 0xE6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x42, 0xE6, 0x00, 0x00, 0x43, 0x16, 0x00, 0x00, 0x42, 0x34, 0x00, 0x00,
0x42, 0xC8, 0x00, 0x00, 0x43, 0x1B, 0x00, 0x00, 0xC3, 0x2F, 0x00, 0x00, 0x42, 0xC8,
0x00, 0x00, 0x43, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x34, 0x00, 0x00,
static SeiraCam cam_seira_shop = {
{0.0f, 115.0f, 0.0f}, {0.0f, 115.0f, 150.0f}, 45.0f, {100.0f, 155.0f, -175.0f}, {100.0f, 155.0f, 0.0f}, 45.0f
};
/* 803BB800-803BB838 018920 0038+00 1/0 0/0 0/0 .data cam_seira_evnt_before */
SECTION_DATA static u8 cam_seira_evnt_before[56] = {
0xC2, 0x48, 0x00, 0x00, 0x42, 0xE6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0x48,
0x00, 0x00, 0x42, 0xE6, 0x00, 0x00, 0x43, 0x16, 0x00, 0x00, 0x42, 0x34, 0x00, 0x00,
0x42, 0xC8, 0x00, 0x00, 0x43, 0x1B, 0x00, 0x00, 0xC3, 0x2F, 0x00, 0x00, 0x42, 0xC8,
0x00, 0x00, 0x43, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x34, 0x00, 0x00,
static SeiraCam cam_seira_evnt_before = {
{-50.0f, 115.0f, 0.0f}, {-50.0f, 115.0f, 150.0f}, 45.0f, {100.0f, 155.0f, -175.0f}, {100.0f, 155.0f, 0.0f}, 45.0f
};
/* 803BB838-803BB870 018958 0038+00 1/0 0/0 0/0 .data cam_seira_evnt_after */
SECTION_DATA static u8 cam_seira_evnt_after[56] = {
0x00, 0x00, 0x00, 0x00, 0x42, 0xE6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x42, 0xE6, 0x00, 0x00, 0x43, 0x16, 0x00, 0x00, 0x42, 0x34, 0x00, 0x00,
0x42, 0xC8, 0x00, 0x00, 0x43, 0x1B, 0x00, 0x00, 0xC3, 0x2F, 0x00, 0x00, 0x42, 0xC8,
0x00, 0x00, 0x43, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x34, 0x00, 0x00,
static SeiraCam cam_seira_evnt_after = {
{0.0f, 115.0f, 0.0f}, {0.0f, 115.0f, 150.0f}, 45.0f, {100.0f, 155.0f, -175.0f}, {100.0f, 155.0f, 0.0f}, 45.0f
};
/* 803BB870-803BB87C -00001 000C+00 2/2 0/0 0/0 .data shop_cam_data_tbl */
SECTION_DATA static void* shop_cam_data_tbl[3] = {
(void*)&cam_seira_shop,
(void*)&cam_seira_evnt_before,
(void*)&cam_seira_evnt_after,
static SeiraCam* shop_cam_data_tbl[3] = {
&cam_seira_shop,
&cam_seira_evnt_before,
&cam_seira_evnt_after,
};
/* 803BB87C-803BB888 -00001 000C+00 1/1 0/0 0/0 .data @3771 */
SECTION_DATA static void* lit_3771[3] = {
(void*)NULL,
(void*)0xFFFFFFFF,
(void*)shop_cam_action__16ShopCam_action_cFv,
};
/* 80453A88-80453A8C 002088 0004+00 1/1 0/0 0/0 .sdata2 @3796 */
SECTION_SDATA2 static f32 lit_3796 = 0.25f;
/* 80453A8C-80453A90 00208C 0004+00 1/1 0/0 0/0 .sdata2 @3797 */
SECTION_SDATA2 static f32 lit_3797 = 20.0f;
/* 80453A90-80453A94 002090 0004+00 1/1 0/0 0/0 .sdata2 @3798 */
SECTION_SDATA2 static f32 lit_3798 = 5.0f;
/* 80195C9C-80195E18 1905DC 017C+00 0/0 0/0 9/9 .text shop_cam_action_init__16ShopCam_action_cFv
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void ShopCam_action_c::shop_cam_action_init() {
nofralloc
#include "asm/d/shop/d_shop_camera/shop_cam_action_init__16ShopCam_action_cFv.s"
int ShopCam_action_c::shop_cam_action_init() {
Save();
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
player->i_onPlayerNoDraw();
setCamAction(&ShopCam_action_c::shop_cam_action);
if (field_0xd6 >= 0) {
field_0x7c = shop_cam_data_tbl[field_0xd6]->field_0x0;
field_0x88 = shop_cam_data_tbl[field_0xd6]->field_0xc;
field_0x94 = shop_cam_data_tbl[field_0xd6]->field_0x18;
} else if (field_0xd4 <= 0) {
field_0x7c = field_0x38;
field_0x88 = field_0x44;
field_0x94 = field_0x50;
} else {
field_0x7c = field_0x54;
field_0x88 = field_0x60;
field_0x94 = field_0x6c;
}
SetSelectIdx(-1);
return 1;
}
#pragma pop
/* ############################################################################################## */
/* 80453A94-80453A98 002094 0004+00 2/2 0/0 0/0 .sdata2 @3916 */
SECTION_SDATA2 static u8 lit_3916[4] = {
0x00,
0x00,
0x00,
0x00,
};
/* 80453A98-80453AA0 002098 0008+00 1/1 0/0 0/0 .sdata2 @3917 */
SECTION_SDATA2 static f64 lit_3917 = 0.5;
/* 80453AA0-80453AA8 0020A0 0008+00 1/1 0/0 0/0 .sdata2 @3918 */
SECTION_SDATA2 static f64 lit_3918 = 3.0;
/* 80453AA8-80453AB0 0020A8 0008+00 1/1 0/0 0/0 .sdata2 @3919 */
SECTION_SDATA2 static u8 lit_3919[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
/* 80453AB0-80453AB4 0020B0 0004+00 1/1 0/0 0/0 .sdata2 @3920 */
SECTION_SDATA2 static f32 lit_3920 = 1.0f;
/* 80195E18-8019630C 190758 04F4+00 1/0 0/0 0/0 .text shop_cam_action__16ShopCam_action_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void ShopCam_action_c::shop_cam_action() {
nofralloc
#include "asm/d/shop/d_shop_camera/shop_cam_action__16ShopCam_action_cFv.s"
int ShopCam_action_c::shop_cam_action() {
camera_class* camera = dComIfGp_getCamera(i_dComIfGp_getPlayerCameraID(0));
camera->mCamera.Stay();
camera->mCamera.SetTrimSize(1);
cXyz acStack_4c;
cXyz acStack_58;
f32 dVar11;
if (field_0xd4 <= 0) {
if (field_0xd6 >= 0) {
acStack_4c = shop_cam_data_tbl[field_0xd6]->field_0x0;
acStack_58 = shop_cam_data_tbl[field_0xd6]->field_0xc;
dVar11 = shop_cam_data_tbl[field_0xd6]->field_0x18;
} else {
acStack_4c = field_0x38;
acStack_58 = field_0x44;
dVar11 = field_0x50;
}
} else if (field_0xd6 >= 0) {
acStack_4c = shop_cam_data_tbl[field_0xd6]->field_0x1c;
acStack_58 = shop_cam_data_tbl[field_0xd6]->field_0x28;
dVar11 = shop_cam_data_tbl[field_0xd6]->field_0x34;
} else {
acStack_4c = field_0x54;
acStack_58 = field_0x60;
dVar11 = field_0x6c;
}
cLib_addCalcPos2(&field_0x7c, acStack_4c, field_0xc0, field_0xc4);
cLib_addCalcPos2(&field_0x88, acStack_58, field_0xc0, field_0xc4);
cLib_addCalc2(&field_0x94, dVar11, field_0xc8, field_0xcc);
cXyz cStack_64 = field_0x7c - acStack_4c;
cXyz cStack_70 = field_0x88 - acStack_58;
f32 dVar10 = field_0x94 - dVar11;
bool r30 = false;
bool r29 = false;
bool r28 = false;
if (cStack_64.abs() < 1.0f) {
field_0x7c = acStack_4c;
r30 = true;
}
if (cStack_70.abs() < 1.0f) {
field_0x88 = acStack_58;
r29 = true;
}
if (dVar10 < 1.0f) {
field_0x94 = dVar11;
r28 = true;
}
if (r30 && r29 && r28) {
field_0xda = true;
} else {
field_0xda = false;
}
camera->mCamera.Set(field_0x7c, field_0x88, field_0x94, 0);
return 1;
}
#pragma pop
/* 8019630C-8019635C 190C4C 0050+00 1/1 0/0 12/12 .text Save__16ShopCam_action_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void ShopCam_action_c::Save() {
nofralloc
#include "asm/d/shop/d_shop_camera/Save__16ShopCam_action_cFv.s"
void ShopCam_action_c::Save() {
camera_class* camera = dComIfGp_getCamera(0);
if (camera != NULL) {
field_0x98 = *fopCamM_GetCenter_p(camera);
field_0xa4 = *fopCamM_GetEye_p(camera);
field_0xbc = fopCamM_GetFovy(camera);
}
}
#pragma pop
/* 8019635C-801963B4 190C9C 0058+00 0/0 0/0 9/9 .text EventRecoverNotime__16ShopCam_action_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void ShopCam_action_c::EventRecoverNotime() {
nofralloc
#include "asm/d/shop/d_shop_camera/EventRecoverNotime__16ShopCam_action_cFv.s"
void ShopCam_action_c::EventRecoverNotime() {
dComIfGp_getPlayer(0);
field_0xd8 = 2;
dCam_getBody()->EventRecoverNotime();
field_0x0 = NULL;
}
#pragma pop
/* 801963B4-801964C8 190CF4 0114+00 0/0 0/0 9/9 .text Reset__16ShopCam_action_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void ShopCam_action_c::Reset() {
nofralloc
#include "asm/d/shop/d_shop_camera/Reset__16ShopCam_action_cFv.s"
void ShopCam_action_c::Reset() {
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
player->i_offPlayerNoDraw();
camera_class* camera = dComIfGp_getCamera(i_dComIfGp_getPlayerCameraID(0));
camera->mCamera.Set(field_0x98, field_0xa4, field_0xbc, 0);
camera->mCamera.Stay();
camera->mCamera.Reset(field_0x98, field_0xa4, field_0xbc, 0);
field_0x0 = NULL;
}
#pragma pop
/* 801964C8-80196544 190E08 007C+00 0/0 0/0 9/9 .text move__16ShopCam_action_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void ShopCam_action_c::move() {
nofralloc
#include "asm/d/shop/d_shop_camera/move__16ShopCam_action_cFv.s"
void ShopCam_action_c::move() {
if (field_0x0 != NULL) {
(this->*field_0x0)();
}
if (field_0xd8 > 0) {
--field_0xd8;
if (field_0xd8 == 0) {
((daPy_py_c*)dComIfGp_getPlayer(0))->i_offPlayerNoDraw();
}
}
}
#pragma pop
/* ############################################################################################## */
/* 80453AB4-80453AB8 0020B4 0004+00 2/2 0/0 0/0 .sdata2 @3992 */
SECTION_SDATA2 static f32 lit_3992 = 45.0f;
/* 80196544-80196608 190E84 00C4+00 0/0 1/1 0/0 .text
* setCamDataIdx__16ShopCam_action_cFP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP4cXyzP4cXyz
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void ShopCam_action_c::setCamDataIdx(fopAc_ac_c* param_0, fopAc_ac_c* param_1,
fopAc_ac_c* param_2, fopAc_ac_c* param_3, cXyz* param_4,
cXyz* param_5) {
nofralloc
#include "asm/d/shop/d_shop_camera/func_80196544.s"
void ShopCam_action_c::setCamDataIdx(fopAc_ac_c* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3,
fopAc_ac_c* param_4, cXyz* param_5, cXyz* param_6) {
field_0xd6 = -1;
if (field_0x18 == NULL) {
field_0xb0 = param_1->mEyePos;
}
field_0x18 = param_1;
field_0x1c = param_2;
field_0x20 = param_3;
field_0x24 = param_4;
field_0x28 = 0;
field_0x2c = 0;
field_0x30 = 0;
field_0x34 = 0;
field_0x44.x = param_5->x;
field_0x44.y = param_5->y;
field_0x44.z = param_5->z;
field_0x50 = 45.0f;
field_0x60.x = param_6->x;
field_0x60.y = param_6->y;
field_0x60.z = param_6->z;
field_0x6c = 45.0f;
field_0x70.set(*param_6);
_debugSetCamera();
}
#pragma pop
/* 80196608-801966D4 190F48 00CC+00 0/0 1/1 0/0 .text
* setCamDataIdx2__16ShopCam_action_cFP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP10fopAc_ac_cP4cXyzP4cXyz
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void ShopCam_action_c::setCamDataIdx2(fopAc_ac_c* param_0, fopAc_ac_c* param_1,
fopAc_ac_c* param_2, fopAc_ac_c* param_3,
fopAc_ac_c* param_4, fopAc_ac_c* param_5,
fopAc_ac_c* param_6, cXyz* param_7, cXyz* param_8) {
nofralloc
#include "asm/d/shop/d_shop_camera/func_80196608.s"
void ShopCam_action_c::setCamDataIdx2(fopAc_ac_c* param_1, fopAc_ac_c* param_2,
fopAc_ac_c* param_3, fopAc_ac_c* param_4,
fopAc_ac_c* param_5, fopAc_ac_c* param_6,
fopAc_ac_c* param_7, cXyz* param_8, cXyz* param_9) {
field_0xd6 = -1;
if (field_0x18 == NULL) {
field_0xb0 = param_1->mEyePos;
}
field_0x18 = param_1;
field_0x1c = param_2;
field_0x20 = param_3;
field_0x24 = param_4;
field_0x28 = param_5;
field_0x2c = param_6;
field_0x30 = param_7;
field_0x34 = 0;
field_0x44.x = param_8->x;
field_0x44.y = param_8->y;
field_0x44.z = param_8->z;
field_0x50 = 45.0f;
field_0x60.x = param_9->x;
field_0x60.y = param_9->y;
field_0x60.z = param_9->z;
field_0x6c = 45.0f;
field_0x70.set(*param_9);
_debugSetCamera();
}
#pragma pop
/* ############################################################################################## */
/* 80453AB8-80453ABC 0020B8 0004+00 1/1 0/0 0/0 .sdata2 @4059 */
SECTION_SDATA2 static f32 lit_4059 = 0.5f;
/* 80453ABC-80453AC0 0020BC 0004+00 1/1 0/0 0/0 .sdata2 @4060 */
SECTION_SDATA2 static f32 lit_4060 = 167.0f;
/* 80453AC0-80453AC4 0020C0 0004+00 1/1 0/0 0/0 .sdata2 @4061 */
SECTION_SDATA2 static f32 lit_4061 = 220.0f;
/* 80453AC4-80453AC8 0020C4 0004+00 1/1 0/0 0/0 .sdata2 @4062 */
SECTION_SDATA2 static f32 lit_4062 = 120.0f;
/* 80453AC8-80453ACC 0020C8 0004+00 1/1 0/0 0/0 .sdata2 @4063 */
SECTION_SDATA2 static f32 lit_4063 = -50.0f;
/* 80453ACC-80453AD0 0020CC 0004+00 1/1 0/0 0/0 .sdata2 @4064 */
SECTION_SDATA2 static f32 lit_4064 = 350.0f;
/* 801966D4-801968B8 191014 01E4+00 2/2 0/0 0/0 .text _debugSetCamera__16ShopCam_action_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void ShopCam_action_c::_debugSetCamera() {
nofralloc
#include "asm/d/shop/d_shop_camera/_debugSetCamera__16ShopCam_action_cFv.s"
void ShopCam_action_c::_debugSetCamera() {
field_0x38.x = field_0xb0.x;
field_0x38.y = field_0xb0.y;
field_0x38.z = field_0xb0.z;
cXyz local_28;
cXyz cStack_34;
cXyz local_40;
cXyz local_4c;
bool bVar1 = false;
if (field_0x1c != NULL && field_0x20 != NULL && field_0x24 != NULL && field_0x28 != NULL &&
field_0x2c == NULL && field_0x30 == NULL)
{
local_4c.x = (field_0x24->orig.pos.x + field_0x20->orig.pos.x) / 2;
local_4c.y = (field_0x24->orig.pos.y + field_0x20->orig.pos.y) / 2;
local_4c.z = (field_0x24->orig.pos.z + field_0x20->orig.pos.z) / 2;
} else {
if (field_0x1c != NULL && field_0x20 != NULL && field_0x24 != NULL && field_0x28 != NULL &&
field_0x2c != NULL && field_0x30 == NULL)
{
local_4c.set(field_0x28->orig.pos);
bVar1 = true;
} else {
local_4c.set(field_0x20->orig.pos);
}
}
if (bVar1) {
field_0x54.x = 167.0f;
field_0x54.y = 220.0f;
field_0x54.z = 120.0f;
} else {
local_28 = local_4c - field_0x70;
s16 sVar2 = cM_atan2s(local_28.x, local_28.z);
cStack_34.set(0.0f, -50.0f, 350.0f);
cLib_offsetPos(&local_40, &field_0x70, sVar2, &cStack_34);
field_0x54.x = local_40.x;
field_0x54.y = local_40.y;
field_0x54.z = local_40.z;
}
}
#pragma pop
/* 801968B8-80196914 1911F8 005C+00 0/0 1/1 3/3 .text
* setMasterCamCtrPos__16ShopCam_action_cFP4cXyz */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void ShopCam_action_c::setMasterCamCtrPos(cXyz* param_0) {
nofralloc
#include "asm/d/shop/d_shop_camera/setMasterCamCtrPos__16ShopCam_action_cFP4cXyz.s"
void ShopCam_action_c::setMasterCamCtrPos(cXyz* param_0) {
if (param_0 == NULL) {
field_0xb0.set(field_0x18->mEyePos);
} else {
field_0xb0.set(*param_0);
}
field_0x38.x = field_0xb0.x;
field_0x38.y = field_0xb0.y;
field_0x38.z = field_0xb0.z;
}
#pragma pop
+50 -76
View File
@@ -1,46 +1,12 @@
//
// Generated By: dol2asm
// Translation Unit: d/shop/d_shop_item_ctrl
// d/shop/d_shop_item_ctrl
//
#include "d/shop/d_shop_item_ctrl.h"
#include "SSystem/SComponent/c_lib.h"
#include "d/a/d_a_shop_item_static.h"
#include "dol2asm.h"
#include "f_op/f_op_actor_mng.h"
//
// Forward References:
//
extern "C" void __ct__15dShopItemCtrl_cFv();
extern "C" void __dt__15dShopItemCtrl_cFv();
extern "C" void getCurrentPos__15dShopItemCtrl_cFi();
extern "C" void isHomePos__15dShopItemCtrl_cFi();
extern "C" void setRotateAnime__15dShopItemCtrl_cFi();
extern "C" void setZoomAnime__15dShopItemCtrl_cFiP4cXyzsb();
//
// External References:
//
extern "C" void fopAcIt_Judge__FPFPvPv_PvPv();
extern "C" void fpcSch_JudgeByID__FPvPv();
extern "C" void getRotateP__12daShopItem_cFv();
extern "C" void getPosP__12daShopItem_cFv();
extern "C" void __mi__4cXyzCFRC3Vec();
extern "C" void cLib_addCalcPos2__FP4cXyzRC4cXyzff();
extern "C" void cLib_addCalcAngleS__FPsssss();
extern "C" void __dl__FPv();
extern "C" void _savegpr_23();
extern "C" void _savegpr_27();
extern "C" void _restgpr_23();
extern "C" void _restgpr_27();
//
// Declarations:
//
/* 80196914-80196958 191254 0044+00 0/0 0/0 10/10 .text __ct__15dShopItemCtrl_cFv */
dShopItemCtrl_c::dShopItemCtrl_c() {
for (int i = 0; i < 7; i++) {
@@ -52,19 +18,10 @@ dShopItemCtrl_c::dShopItemCtrl_c() {
/* 80196958-801969A0 191298 0048+00 1/0 1/1 0/0 .text __dt__15dShopItemCtrl_cFv */
dShopItemCtrl_c::~dShopItemCtrl_c() {}
/* ############################################################################################## */
/* 80453AD0-80453AD8 0020D0 0004+04 2/2 0/0 0/0 .sdata2 @3659 */
SECTION_SDATA2 static f32 lit_3659[1 + 1 /* padding */] = {
0.0f,
/* padding */
0.0f,
};
/* 801969A0-80196A3C 1912E0 009C+00 0/0 3/3 3/3 .text getCurrentPos__15dShopItemCtrl_cFi
*/
cXyz dShopItemCtrl_c::getCurrentPos(int item_index) {
f32 tmp = lit_3659[0];
cXyz item_pos(tmp, tmp, tmp);
cXyz item_pos(0.0f, 0.0f, 0.0f);
if (mItemIndex[item_index] != -1) {
fopAc_ac_c* item = fopAcM_SearchByID(mItemIndex[item_index]);
@@ -113,36 +70,53 @@ void dShopItemCtrl_c::setRotateAnime(int item_index) {
}
}
/* ############################################################################################## */
/* 80453AD8-80453AE0 0020D8 0008+00 1/1 0/0 0/0 .sdata2 @3838 */
SECTION_SDATA2 static f64 lit_3838 = 0.5;
/* 80453AE0-80453AE8 0020E0 0008+00 1/1 0/0 0/0 .sdata2 @3839 */
SECTION_SDATA2 static f64 lit_3839 = 3.0;
/* 80453AE8-80453AF0 0020E8 0008+00 1/1 0/0 0/0 .sdata2 @3840 */
SECTION_SDATA2 static u8 lit_3840[8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
/* 80453AF0-80453AF4 0020F0 0004+00 1/1 0/0 0/0 .sdata2 @3841 */
SECTION_SDATA2 static f32 lit_3841 = 0.5f;
/* 80453AF4-80453AF8 0020F4 0004+00 1/1 0/0 0/0 .sdata2 @3842 */
SECTION_SDATA2 static f32 lit_3842 = 1.0f / 20.0f;
/* 80453AF8-80453AFC 0020F8 0004+00 1/1 0/0 0/0 .sdata2 @3843 */
SECTION_SDATA2 static f32 lit_3843 = 1.0f / 10.0f;
/* 80453AFC-80453B00 0020FC 0004+00 1/1 0/0 0/0 .sdata2 @3844 */
SECTION_SDATA2 static f32 lit_3844 = 1.0f / 100.0f;
/* 80196BA4-80197098 1914E4 04F4+00 0/0 1/1 0/0 .text setZoomAnime__15dShopItemCtrl_cFiP4cXyzsb */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dShopItemCtrl_c::setZoomAnime(int param_0, cXyz* param_1, s16 param_2, bool param_3) {
nofralloc
#include "asm/d/shop/d_shop_item_ctrl/setZoomAnime__15dShopItemCtrl_cFiP4cXyzsb.s"
void dShopItemCtrl_c::setZoomAnime(int param_1, cXyz* param_2, s16 param_3, bool param_4) {
for (int i = 0; i < 7; i++) {
if (mItemIndex[i] == -1) {
continue;
}
daShopItem_c* shopItem = (daShopItem_c*) fopAcM_SearchByID(mItemIndex[i]);
if (shopItem == NULL) {
continue;
}
cXyz* this_01 = shopItem->getPosP();
cXyz cStack_44 = shopItem->orig.pos;
cXyz cStack_50 = *param_2 - cStack_44;
s16 local_5e = shopItem->getAngleX();
s16 local_60 = shopItem->getAngleY();
if (i == param_1 - 1 && param_4 == true) {
cLib_addCalcPos2(
this_01,
*param_2,
0.5f,
0.05f * cStack_50.abs()
);
cLib_addCalcAngleS(&local_5e, param_3, 4, 0x800, 0x80);
shopItem->setAngleX(local_5e);
cLib_addCalcAngleS(&local_60, shopItem->orig.angle.y, 4, 0x800, 0x80);
shopItem->setAngleY(local_60);
} else {
cLib_addCalcPos2(
this_01,
cStack_44,
0.5f,
0.1f * cStack_50.abs());
cXyz cStack_5c = *this_01 - cStack_44;
if (cStack_5c.abs() < 0.01f) {
this_01->set(shopItem->orig.pos);
}
cLib_addCalcAngleS(&local_5e, 0, 4, 0x800, 0x80);
if (local_5e <= 0x80) {
local_5e = 0;
}
shopItem->setAngleX(local_5e);
cLib_addCalcAngleS(&local_60, 0, 4, 0x800, 0x80);
if (local_60 <= 0x80) {
local_60 = 0;
}
shopItem->setAngleY(local_60);
}
}
}
#pragma pop
+86 -86
View File
@@ -876,16 +876,17 @@ int dShopSystem_c::chooseItem3(u8 seq) {
if (mCursorPos != 0 && isFlag(mCursorPos - 1)) {
mCursorPos = mLastCursorPos;
mLastCursorPos = old_cursor;
goto right;
} else if (seq != SEQ_START) {
if (mCursorPos != 0) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
} else {
if (seq != SEQ_START) {
if (mCursorPos != 0) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
}
mShopCamAction.SetSelectIdx(mCursorPos);
}
mShopCamAction.SetSelectIdx(mCursorPos);
return 3;
}
return 3;
} else if (cursor_pos == 4) {
mLastCursorPos = cursor_pos;
mCursorPos = 0;
@@ -906,19 +907,19 @@ int dShopSystem_c::chooseItem3(u8 seq) {
if (mCursorPos != 0 && isFlag(mCursorPos - 1)) {
mCursorPos = mLastCursorPos;
mLastCursorPos = old_cursor;
goto right;
} else if (seq != SEQ_START) {
if (mCursorPos != 0) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
}
} else {
if (seq != SEQ_START) {
if (mCursorPos != 0) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
}
mShopCamAction.SetSelectIdx(mCursorPos);
mShopCamAction.SetSelectIdx(mCursorPos);
}
return 3;
}
return 3;
}
}
right:
if (checkRightTrigger(mpStick) && seq != SEQ_SELECT_WAIT) {
u8 cursor_pos = mCursorPos;
@@ -930,32 +931,31 @@ right:
if (mCursorPos != 0 && isFlag(mCursorPos - 1)) {
mCursorPos = mLastCursorPos;
mLastCursorPos = old_cursor;
goto up;
} else if (seq != SEQ_START) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
mShopCamAction.SetSelectIdx(mCursorPos);
} else {
if (seq != SEQ_START) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
mShopCamAction.SetSelectIdx(mCursorPos);
}
return 4;
}
return 4;
}
if (data_80451058 == 7) {
} else if (data_80451058 == 7) {
mLastCursorPos = cursor_pos;
mCursorPos = 7;
if (mCursorPos != 0 && isFlag(mCursorPos - 1)) {
mCursorPos = mLastCursorPos;
mLastCursorPos = old_cursor;
goto up;
} else if (seq != SEQ_START) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
mShopCamAction.SetSelectIdx(mCursorPos);
} else {
if (seq != SEQ_START) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
mShopCamAction.SetSelectIdx(mCursorPos);
}
return 4;
}
return 4;
}
}
}
up:
if (data_80451058 >= 6) {
if (mpStick->checkUpTrigger() && seq != SEQ_SELECT_WAIT && mCursorPos <= 3) {
mLastCursorPos = mCursorPos;
@@ -964,19 +964,19 @@ up:
if (mCursorPos != 0 && isFlag(mCursorPos - 1)) {
mCursorPos = mLastCursorPos;
mLastCursorPos = old_cursor;
goto down;
} else if (seq != SEQ_START) {
if (mCursorPos != 0) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
} else {
if (seq != SEQ_START) {
if (mCursorPos != 0) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
}
mShopCamAction.SetSelectIdx(mCursorPos);
}
mShopCamAction.SetSelectIdx(mCursorPos);
return 5;
}
return 5;
}
down:
if (mpStick->checkDownTrigger() && seq != SEQ_SELECT_WAIT) {
u8 cursor_pos = mCursorPos;
@@ -987,17 +987,17 @@ up:
if (mCursorPos != 0 && isFlag(mCursorPos - 1)) {
mCursorPos = mLastCursorPos;
mLastCursorPos = old_cursor;
goto ret;
} else if (seq != SEQ_START) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
mShopCamAction.SetSelectIdx(mCursorPos);
} else {
if (seq != SEQ_START) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
mShopCamAction.SetSelectIdx(mCursorPos);
}
return 6;
}
return 6;
}
}
}
ret:
return 0;
}
@@ -1027,19 +1027,19 @@ int dShopSystem_c::chooseItem5(u8 seq) {
if (mCursorPos != 0 && isFlag(mCursorPos - 1)) {
mCursorPos = mLastCursorPos;
mLastCursorPos = old_cursor;
goto right;
} else if (seq != SEQ_START) {
if (mCursorPos != 0) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
}
} else {
if (seq != SEQ_START) {
if (mCursorPos != 0) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
}
mShopCamAction.SetSelectIdx(mCursorPos);
mShopCamAction.SetSelectIdx(mCursorPos);
}
return 3;
}
return 3;
}
}
right:
if (checkRightTrigger(mpStick) && seq != SEQ_SELECT_WAIT) {
u8 cursor_pos = mCursorPos;
@@ -1050,16 +1050,16 @@ right:
if (mCursorPos != 0 && isFlag(mCursorPos - 1)) {
mCursorPos = mLastCursorPos;
mLastCursorPos = old_cursor;
goto up;
} else if (seq != SEQ_START) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
mShopCamAction.SetSelectIdx(mCursorPos);
} else {
if (seq != SEQ_START) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
mShopCamAction.SetSelectIdx(mCursorPos);
}
return 4;
}
return 4;
}
}
up:
if (mpStick->checkUpTrigger() && seq != SEQ_SELECT_WAIT) {
u8 cursor_pos = mCursorPos;
@@ -1075,19 +1075,19 @@ up:
if (mCursorPos != 0 && isFlag(mCursorPos - 1)) {
mCursorPos = mLastCursorPos;
mLastCursorPos = old_cursor;
goto down;
} else if (seq != SEQ_START) {
if (mCursorPos != 0) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
}
} else {
if (seq != SEQ_START) {
if (mCursorPos != 0) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
}
mShopCamAction.SetSelectIdx(mCursorPos);
mShopCamAction.SetSelectIdx(mCursorPos);
}
return 5;
}
return 5;
}
}
down:
if (mpStick->checkDownTrigger() && seq != SEQ_SELECT_WAIT) {
u8 cursor_pos = mCursorPos;
@@ -1103,16 +1103,16 @@ down:
if (mCursorPos != 0 && isFlag(mCursorPos - 1)) {
mCursorPos = mLastCursorPos;
mLastCursorPos = old_cursor;
goto ret;
} else if (seq != SEQ_START) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
mShopCamAction.SetSelectIdx(mCursorPos);
} else {
if (seq != SEQ_START) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
mShopCamAction.SetSelectIdx(mCursorPos);
}
return 6;
}
return 6;
}
}
ret:
return 0;
}
@@ -1126,19 +1126,19 @@ int dShopSystem_c::chooseItem4(u8 seq) {
if (mCursorPos != 0 && isFlag(mCursorPos - 1)) {
mCursorPos = mLastCursorPos;
mLastCursorPos = old_cursor;
goto right;
} else if (seq != SEQ_START) {
if (mCursorPos != 0) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
} else {
if (seq != SEQ_START) {
if (mCursorPos != 0) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
}
mShopCamAction.SetSelectIdx(mCursorPos);
}
mShopCamAction.SetSelectIdx(mCursorPos);
return 3;
}
return 3;
}
right:
if (checkRightTrigger(mpStick) && seq != SEQ_SELECT_WAIT && mCursorPos < 4) {
mLastCursorPos = mCursorPos;
mCursorPos++;
@@ -1146,16 +1146,16 @@ right:
if (mCursorPos != 0 && isFlag(mCursorPos - 1)) {
mCursorPos = mLastCursorPos;
mLastCursorPos = old_cursor;
goto ret;
} else if (seq != SEQ_START) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
mShopCamAction.SetSelectIdx(mCursorPos);
}
} else {
if (seq != SEQ_START) {
mDoAud_seStart(Z2SE_SY_TALK_NEXT, NULL, 0, 0);
mShopCamAction.SetSelectIdx(mCursorPos);
}
return 4;
return 4;
}
}
ret:
return 0;
}