mirror of
https://github.com/zeldaret/tp
synced 2026-05-25 07:23:14 -04:00
8516f01f79
* dVibration_c::StartShock * dVibration_c::StartQuake * dVibration_c::StopQuake * dVibration_c::Kill() * dVibration_c::CheckQuake * dVibration_c::Init * dVibration_c::Remove * dVibration_c::setDefault * dVibration_c::Pause * remove asm * switch to u8 return, remove cast
278 lines
8.7 KiB
C++
278 lines
8.7 KiB
C++
//
|
|
// Generated By: dol2asm
|
|
// Translation Unit: d/d_vibration
|
|
//
|
|
|
|
#include "d/d_vibration.h"
|
|
#include "dol2asm.h"
|
|
#include "dolphin/types.h"
|
|
#include "d/com/d_com_inf_game.h"
|
|
|
|
//
|
|
// Forward References:
|
|
//
|
|
|
|
extern "C" static void func_8006F168();
|
|
extern "C" static void func_8006F184();
|
|
extern "C" static void func_8006F1A4();
|
|
extern "C" static void func_8006F1D8();
|
|
extern "C" void Run__12dVibration_cFv();
|
|
extern "C" void StartShock__12dVibration_cFii4cXyz();
|
|
extern "C" void StartQuake__12dVibration_cFii4cXyz();
|
|
extern "C" void StartQuake__12dVibration_cFPCUcii4cXyz();
|
|
extern "C" void StopQuake__12dVibration_cFi();
|
|
extern "C" void Kill__12dVibration_cFv();
|
|
extern "C" void CheckQuake__12dVibration_cFv();
|
|
extern "C" void setDefault__12dVibration_cFv();
|
|
extern "C" void Init__12dVibration_cFv();
|
|
extern "C" void Pause__12dVibration_cFv();
|
|
extern "C" void Remove__12dVibration_cFv();
|
|
extern "C" extern u8 on_final_boss_stg[8];
|
|
|
|
//
|
|
// External References:
|
|
//
|
|
|
|
extern "C" void checkVibration__19dSv_player_config_cCFv();
|
|
extern "C" void StartShake__9dCamera_cFlPUcl4cXyz();
|
|
extern "C" void StopShake__9dCamera_cFv();
|
|
extern "C" void dCam_getBody__Fv();
|
|
extern "C" void dKy_darkworld_check__Fv();
|
|
extern "C" void __pl__4cXyzCFRC3Vec();
|
|
extern "C" void norm__4cXyzCFv();
|
|
extern "C" void cM_rnd__Fv();
|
|
extern "C" void stopMotor__Q210JUTGamePad7CRumbleFib();
|
|
extern "C" void startPatternedRumble__Q210JUTGamePad7CRumbleFPvQ310JUTGamePad7CRumble7ERumbleUl();
|
|
extern "C" void stopPatternedRumble__Q210JUTGamePad7CRumbleFs();
|
|
extern "C" void stopPatternedRumbleAtThePeriod__Q210JUTGamePad7CRumbleFv();
|
|
extern "C" void __cvt_fp2unsigned();
|
|
extern "C" void _savegpr_26();
|
|
extern "C" void _savegpr_29();
|
|
extern "C" void _restgpr_26();
|
|
extern "C" void _restgpr_29();
|
|
extern "C" u8 const MS_patt__12dVibration_c[88];
|
|
extern "C" u8 const CS_patt__12dVibration_c[88];
|
|
extern "C" u8 const MQ_patt__12dVibration_c[80];
|
|
extern "C" u8 const CQ_patt__12dVibration_c[80];
|
|
extern "C" u8 m_gamePad__8mDoCPd_c[16];
|
|
|
|
//
|
|
// Declarations:
|
|
//
|
|
|
|
/* 8006F168-8006F184 069AA8 001C+00 1/1 0/0 0/0 .text makedata__25@unnamed@d_vibration_cpp@FPUsUll
|
|
*/
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
static asm void func_8006F168() {
|
|
nofralloc
|
|
#include "asm/d/d_vibration/func_8006F168.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* 8006F184-8006F1A4 069AC4 0020+00 1/1 0/0 0/0 .text rollshift__25@unnamed@d_vibration_cpp@FUlll
|
|
*/
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
static asm void func_8006F184() {
|
|
nofralloc
|
|
#include "asm/d/d_vibration/func_8006F184.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* 8006F1A4-8006F1D8 069AE4 0034+00 2/2 0/0 0/0 .text makebits__25@unnamed@d_vibration_cpp@FUlll
|
|
*/
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
static asm void func_8006F1A4() {
|
|
nofralloc
|
|
#include "asm/d/d_vibration/func_8006F1A4.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* ############################################################################################## */
|
|
/* 80452620-80452628 000C20 0008+00 1/1 0/0 0/0 .sdata2 @3756 */
|
|
SECTION_SDATA2 static f64 lit_3756 = 4503601774854144.0 /* cast s32 to float */;
|
|
|
|
/* 8006F1D8-8006F268 069B18 0090+00 1/1 0/0 0/0 .text randombit__25@unnamed@d_vibration_cpp@Fll */
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
static asm void func_8006F1D8() {
|
|
nofralloc
|
|
#include "asm/d/d_vibration/func_8006F1D8.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* ############################################################################################## */
|
|
/* 80450F50-80450F58 000450 0008+00 1/1 0/0 0/0 .sbss data$3831 */
|
|
static u8 data[8];
|
|
|
|
/* 8006F268-8006FA24 069BA8 07BC+00 0/0 2/2 0/0 .text Run__12dVibration_cFv */
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
asm void dVibration_c::Run() {
|
|
nofralloc
|
|
#include "asm/d/d_vibration/Run__12dVibration_cFv.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* 8006FA24-8006FB10 06A364 00EC+00 0/0 62/62 298/298 .text StartShock__12dVibration_cFii4cXyz */
|
|
bool dVibration_c::StartShock(int param_0, int param_1, cXyz param_2) {
|
|
bool ret = false;
|
|
if (param_1 & 0x7eU) {
|
|
field_0x0.mShock.field_0x4 = param_0;
|
|
field_0x0.mShock.field_0x24 = 0;
|
|
field_0x0.mShock.field_0x14 = param_1;
|
|
field_0x0.mShock.field_0x18 = param_2;
|
|
field_0x0.mShock.field_0x8 = CS_patt[param_0].field_0x04;
|
|
field_0x0.mShock.field_0xc = CS_patt[param_0].field_0x02;
|
|
field_0x0.mShock.field_0x10 = CS_patt[param_0].field_0x00;
|
|
ret = true;
|
|
}
|
|
if (param_1 & 1 && dComIfGs_checkOptVibration() == 1) {
|
|
field_0x54 = param_0;
|
|
field_0x64 = 0;
|
|
field_0x58 = MS_patt[param_0].field_0x04;
|
|
field_0x5c = MS_patt[param_0].field_0x02;
|
|
ret = true;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 8006FB10-8006FC0C 06A450 00FC+00 0/0 8/8 67/67 .text StartQuake__12dVibration_cFii4cXyz */
|
|
bool dVibration_c::StartQuake(int param_0, int param_1, cXyz param_2) {
|
|
bool ret = false;
|
|
if (param_1 & 0x7eU) {
|
|
field_0x0.mQuake.field_0x4 = param_0;
|
|
field_0x0.mQuake.field_0x24 = 0;
|
|
field_0x0.mQuake.field_0x14 = param_1;
|
|
field_0x0.mQuake.field_0x18 = param_2;
|
|
field_0x0.mQuake.field_0x8 = CQ_patt[param_0].field_0x04;
|
|
field_0x0.mQuake.field_0xc = CQ_patt[param_0].field_0x02;
|
|
field_0x0.mQuake.field_0x10 = CQ_patt[param_0].field_0x00;
|
|
ret = true;
|
|
}
|
|
if (param_1 & 1 && dComIfGs_checkOptVibration() == 1) {
|
|
field_0x70 = param_0;
|
|
field_0x80 = 0;
|
|
field_0x74 = MQ_patt[param_0].field_0x04;
|
|
field_0x78 = MQ_patt[param_0].field_0x02;
|
|
field_0x7c = CQ_patt[param_0].field_0x00;
|
|
ret = true;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 8006FC0C-8006FD94 06A54C 0188+00 0/0 2/2 2/2 .text StartQuake__12dVibration_cFPCUcii4cXyz */
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
asm void dVibration_c::StartQuake(u8 const* param_0, int param_1, int param_2, cXyz param_3) {
|
|
nofralloc
|
|
#include "asm/d/d_vibration/StartQuake__12dVibration_cFPCUcii4cXyz.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* 8006FD94-8006FE00 06A6D4 006C+00 0/0 6/6 82/82 .text StopQuake__12dVibration_cFi */
|
|
int dVibration_c::StopQuake(int param_0) {
|
|
int ret = 0;
|
|
if (param_0 & 0x7eU) {
|
|
if (field_0x0.mQuake.field_0x24 >= 0) {
|
|
field_0x0.mQuake.field_0x14 &= ~param_0;
|
|
if (field_0x0.mQuake.field_0x14 == 0) {
|
|
field_0x0.mQuake.field_0x0 |= 1;
|
|
}
|
|
ret = 1;
|
|
}
|
|
}
|
|
if (param_0 & 1 && field_0x80 >= 0) {
|
|
field_0x6c |= 1;
|
|
ret = 1;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 8006FE00-8006FE5C 06A740 005C+00 2/2 0/0 0/0 .text Kill__12dVibration_cFv */
|
|
void dVibration_c::Kill() {
|
|
mDoCPd_c::stopMotorWaveHard(0);
|
|
mDoCPd_c::stopMotorHard(0);
|
|
setDefault();
|
|
}
|
|
|
|
/* 8006FE5C-8006FE84 06A79C 0028+00 0/0 0/0 10/10 .text CheckQuake__12dVibration_cFv */
|
|
int dVibration_c::CheckQuake() {
|
|
int ret = 0;
|
|
if (field_0x0.mQuake.field_0x4 != -1 || field_0x70 != -1) {
|
|
ret = 1;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 8006FE84-8006FF04 06A7C4 0080+00 2/2 0/0 0/0 .text setDefault__12dVibration_cFv */
|
|
void dVibration_c::setDefault() {
|
|
field_0x54 = -1;
|
|
field_0x0.mShock.field_0x4 = -1;
|
|
field_0x70 = -1;
|
|
field_0x0.mQuake.field_0x4 = -1;
|
|
field_0x50 = 0;
|
|
field_0x0.mShock.field_0x0 = 0;
|
|
field_0x6c = 0;
|
|
field_0x0.mQuake.field_0x0 = 0;
|
|
field_0x58 = 0;
|
|
field_0x0.mShock.field_0x8 = 0;
|
|
field_0x74 = 0;
|
|
field_0x0.mQuake.field_0x8 = 0;
|
|
field_0x5c = 0;
|
|
field_0x0.mShock.field_0xc = 0;
|
|
field_0x78 = 0;
|
|
field_0x0.mQuake.field_0xc = 0;
|
|
field_0x60 = 0;
|
|
field_0x0.mShock.field_0x10 = 0;
|
|
field_0x7c = 0;
|
|
field_0x0.mQuake.field_0x10 = 0;
|
|
field_0x64 = -99;
|
|
field_0x0.mShock.field_0x24 = -99;
|
|
field_0x80 = -99;
|
|
field_0x0.mQuake.field_0x24 = -99;
|
|
field_0x68 = -99;
|
|
field_0x84 = -99;
|
|
field_0x8c = 0;
|
|
field_0x88 = 0;
|
|
}
|
|
|
|
/* 8006FF04-8006FF38 06A844 0034+00 0/0 2/2 0/0 .text Init__12dVibration_cFv */
|
|
void dVibration_c::Init() {
|
|
Kill();
|
|
setDefault();
|
|
}
|
|
|
|
/* 8006FF38-8006FFF8 06A878 00C0+00 0/0 1/1 0/0 .text Pause__12dVibration_cFv */
|
|
void dVibration_c::Pause() {
|
|
if (field_0x8c != -1) {
|
|
if (field_0x54 != -1 || field_0x70 != -1) {
|
|
mDoCPd_c::stopMotorWaveHard(0);
|
|
mDoCPd_c::stopMotorHard(0);
|
|
}
|
|
field_0x54 = -1;
|
|
field_0x0.mShock.field_0x4 = -1;
|
|
field_0x64 = -99;
|
|
field_0x0.mShock.field_0x24 = -99;
|
|
if (field_0x0.mQuake.field_0x4 != -1) {
|
|
field_0x0.mQuake.field_0x24 = 0;
|
|
}
|
|
if (field_0x70 != -1) {
|
|
field_0x80 = 0;
|
|
}
|
|
field_0x8c = -1;
|
|
}
|
|
}
|
|
|
|
/* 8006FFF8-80070018 06A938 0020+00 0/0 1/1 0/0 .text Remove__12dVibration_cFv */
|
|
void dVibration_c::Remove() {
|
|
Kill();
|
|
} |