d_meter2 wip / d_s_play / d_file_sel_info (#179)

* d_meter2 wip

* d_s_play

* d_file_sel_info

* format

* tag_lv5soup / tag_setBall / fix dKyeff

* d_cc_uty
This commit is contained in:
TakaRikka
2022-02-06 06:23:54 -08:00
committed by GitHub
parent 612f26c132
commit 3a79e96e8b
133 changed files with 2652 additions and 4502 deletions
-1
View File
@@ -3285,7 +3285,6 @@ extern "C" extern void* __vt__19JPAParticleCallBack[5];
extern "C" extern void* g_fopAc_Method[8];
extern "C" extern void* __vt__8cM3dGPla[3];
extern "C" extern void* __vt__14dBgS_ObjGndChk[12 + 1 /* padding */];
extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */];
extern "C" extern void* __vt__12dDlst_base_c[3];
extern "C" extern void* __vt__8cM3dGCyl[3];
extern "C" extern void* __vt__8cM3dGAab[3];
+410 -94
View File
@@ -4,32 +4,12 @@
//
#include "d/cc/d_cc_uty.h"
#include "SSystem/SComponent/c_math.h"
#include "d/d_procname.h"
#include "d/s/d_s_play.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct fopAc_ac_c {};
struct daPy_py_c {
/* 80088134 */ bool checkCutJumpCancelTurn() const;
/* 8015F398 */ void checkMasterSwordEquip();
};
struct dCcU_AtInfo {};
struct dCcD_GObjInf {
/* 800845B0 */ void getHitSeID(u8, int);
};
struct cCcD_Obj {
/* 80263A48 */ void GetAc();
};
struct Z2Creature {};
//
// Forward References:
//
@@ -54,108 +34,319 @@ extern "C" void checkMasterSwordEquip__9daPy_py_cFv();
extern "C" void GetAc__8cCcD_ObjFv();
extern "C" void cM_atan2s__Fff();
extern "C" void cM_rndFX__Ff();
extern "C" void PSVECSquareMag();
extern "C" void _savegpr_25();
extern "C" void _restgpr_25();
extern "C" extern u8 g_dComIfG_gameInfo[122384];
extern "C" extern u32 __float_nan;
extern "C" extern u8 struct_80451124[4];
//
// Declarations:
//
bool daPy_py_c::checkWoodSwordEquip() {
return dComIfGs_getSelectEquipSword() == WOOD_STICK;
}
BOOL daPy_py_c::checkNowWolf() {
return dComIfGp_getLinkPlayer()->i_checkWolf();
}
/* ############################################################################################## */
/* 803AC418-803AC500 009538 00E8+00 1/1 0/0 0/0 .data plCutLRC */
SECTION_DATA static u8 plCutLRC[232] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 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, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 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, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
SECTION_DATA static int plCutLRC[58] = {
0, 0, 1, 1, 2, 0, 2, 1, 0, 0, 0, 2, 1, 1, 1, 2, 2, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0,
};
/* 800873B0-800873D4 081CF0 0024+00 0/0 0/0 3/3 .text pl_cut_LRC__Fi */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void pl_cut_LRC(int param_0) {
nofralloc
#include "asm/d/cc/d_cc_uty/pl_cut_LRC__Fi.s"
int pl_cut_LRC(int index) {
if (index >= 58) {
return 0;
}
return plCutLRC[index];
}
#pragma pop
/* 800873D4-800874C4 081D14 00F0+00 1/1 0/0 14/14 .text cc_pl_cut_bit_get__Fv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void cc_pl_cut_bit_get() {
nofralloc
#include "asm/d/cc/d_cc_uty/cc_pl_cut_bit_get__Fv.s"
u16 cc_pl_cut_bit_get() {
daPy_py_c* link = (daPy_py_c*)dComIfGp_getPlayer(0);
u16 bit = 0;
if (link->getCutType() == daPy_py_c::TYPE_CUT_VERTICAL) {
bit = 0x1;
} else if (link->getCutType() == daPy_py_c::TYPE_CUT_STAB) {
bit = 0x2;
} else if (link->getCutType() == daPy_py_c::TYPE_CUT_STAB_COMBO) {
bit = 0x200;
} else if (link->getCutType() == daPy_py_c::TYPE_CUT_SWEEP) {
bit = 0x4;
} else if (link->getCutType() == daPy_py_c::TYPE_CUT_HORIZONTAL) {
bit = 0x8;
} else if (link->getCutType() == daPy_py_c::TYPE_CUT_LEFT_SWEEP_FINISH) {
bit = 0x20;
} else if (link->getCutType() == daPy_py_c::TYPE_CUT_DOWN_FINISH) {
bit = 0x40;
} else if (link->getCutType() == daPy_py_c::TYPE_CUT_TURN_RIGHT || link->getCutType() == 9 ||
link->getCutType() == 43 ||
link->getCutType() == daPy_py_c::TYPE_CUT_LARGE_TURN_RIGHT) {
bit = 0x80;
} else if (link->getCutType() == daPy_py_c::TYPE_CUT_TURN_LEFT ||
link->getCutType() == daPy_py_c::TYPE_CUT_LARGE_TURN_LEFT) {
bit = 0x800;
} else if (link->getCutType() == daPy_py_c::TYPE_CUT_JUMP) {
bit = 0x100;
} else if (link->getCutType() == 40 || link->getCutType() == 41) {
bit = 0x400;
}
return bit;
}
#pragma pop
/* 800874C4-800874F0 081E04 002C+00 1/1 0/0 0/0 .text getMapInfo__FSc */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void getMapInfo(s8 param_0) {
nofralloc
#include "asm/d/cc/d_cc_uty/getMapInfo__FSc.s"
static int getMapInfo(s8 param_0) {
int map_info = 30;
if (param_0 == 1) {
map_info = 31;
} else if (param_0 == 2) {
map_info = 32;
}
return map_info;
}
#pragma pop
/* 800874F0-80087514 081E30 0024+00 2/2 0/0 0/0 .text getHitId__FP8cCcD_Obji */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void getHitId(cCcD_Obj* param_0, int param_1) {
nofralloc
#include "asm/d/cc/d_cc_uty/getHitId__FP8cCcD_Obji.s"
static u32 getHitId(cCcD_Obj* obj, int param_1) {
dCcD_GObjInf* dObj = static_cast<dCcD_GObjInf*>(obj);
return dObj->getHitSeID(dObj->GetAtSe(), param_1);
}
#pragma pop
/* 80087514-80087594 081E54 0080+00 0/0 0/0 47/47 .text
* def_se_set__FP10Z2CreatureP8cCcD_ObjUlP10fopAc_ac_c */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void def_se_set(Z2Creature* param_0, cCcD_Obj* param_1, u32 param_2, fopAc_ac_c* param_3) {
nofralloc
#include "asm/d/cc/d_cc_uty/def_se_set__FP10Z2CreatureP8cCcD_ObjUlP10fopAc_ac_c.s"
void def_se_set(Z2Creature* sound, cCcD_Obj* collider, u32 map_info, fopAc_ac_c* actor) {
if (sound != NULL) {
int tmp;
if (actor != NULL && fopAcM_checkStatus(actor, 0x280000)) {
tmp = 0;
} else {
tmp = 1;
}
sound->startCollisionSE(getHitId(collider, tmp), map_info);
}
}
#pragma pop
/* 80087594-80087A58 081ED4 04C4+00 1/1 0/0 0/0 .text at_power_get__FP11dCcU_AtInfo */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void at_power_get(dCcU_AtInfo* param_0) {
nofralloc
#include "asm/d/cc/d_cc_uty/at_power_get__FP11dCcU_AtInfo.s"
static u8 at_power_get(dCcU_AtInfo* info) {
u8 power = info->mpCollider->GetAtAtp();
if (info->mPowerType == 0) {
if (info->mpCollider->ChkAtType(0x10000000)) {
power = 0;
} else if (power == 1) {
power = 1;
} else if (power == 2) {
power = 10;
} else if (power == 3) {
power *= 10;
} else if (power == 6) {
power = 80;
} else if (power >= 4) {
power = 200;
}
} else if (info->mPowerType == 6) {
if (info->mpCollider->ChkAtType(0x10000000)) {
power = 0;
} else if (power == 1) {
power = 1;
} else if (power == 2) {
power = 10;
} else if (power == 6) {
power = 80;
} else if (power >= 3) {
power *= 10;
}
} else if (info->mPowerType == 4) {
if (info->mpCollider->ChkAtType(0x400000)) {
power = 200;
} else if (info->mpCollider->ChkAtType(0x10000000)) {
power = 0;
} else if (power == 1) {
power = 1;
} else if (power == 2) {
power = 10;
} else if (power >= 3) {
power *= 10;
} else if (power == 6) {
power = 80;
} else if (power >= 4) {
power = 200;
}
} else if (info->mPowerType == 5) {
if (info->mpCollider->ChkAtType(0x2000)) {
power = 0;
} else if (power == 1) {
power = 1;
} else if (power == 2) {
power = 3;
} else if (power >= 3) {
power = 4;
}
} else if (info->mPowerType == 2) {
if (info->mpCollider->ChkAtType(0x400000)) {
power = 200;
} else if (power == 1) {
power = 1;
} else if (power == 2) {
power = 10;
} else if (power == 3) {
power = 20;
} else if (power == 6) {
power = 80;
} else if (power >= 4) {
power = 200;
}
} else if (info->mPowerType == 1) {
if (info->mpCollider->ChkAtType(0x400000) || power >= 4) {
power = 200;
} else {
power *= 10;
}
} else if (info->mPowerType == 3) {
if (info->mpCollider->ChkAtType(0x400000) || power >= 4) {
power = 200;
} else if (power == 1) {
power = 10;
} else if (power == 2) {
power = 20;
} else if (power >= 3) {
power = 40;
}
} else if (info->mPowerType == 7) {
if (info->mpCollider->ChkAtType(0x420008)) {
power = 50;
} else if (info->mpCollider->ChkAtType(0x2000)) {
power = 27;
} else if (power == 1) {
power = 1;
} else if (power == 2) {
power = 10;
} else if (power == 3) {
power *= 10;
} else if (power == 6) {
power = 80;
} else if (power >= 4) {
power = 200;
}
} else if (info->mPowerType == 8) {
if (power == 1) {
power = 3;
} else if (power == 2) {
power = 10;
} else if (power == 6) {
power = 80;
} else if (power >= 3) {
power *= 10;
}
} else if (info->mPowerType == 9 || info->mPowerType == 10) {
if (info->mpCollider->ChkAtType(0x4000)) {
power = 0;
}
if (info->mpCollider->ChkAtType(0x400000)) {
power = 19;
}
if (power == 1) {
power = 4;
} else if (power == 2) {
power = 8;
} else if (power == 3) {
power *= 10;
} else if (power == 6) {
power = 80;
} else if (power >= 4) {
power = 200;
}
} else if (info->mPowerType == 11) {
if (info->mpCollider->ChkAtType(0x4000)) {
power = 0;
}
if (power == 1) {
power = 10;
} else if (power == 2) {
power = 20;
} else if (power == 3) {
power = 30;
} else if (power >= 4) {
power = 100;
}
} else if (info->mPowerType == 12) {
if (power == 1) {
power = 10;
} else if (power == 2) {
power = 20;
} else if (power == 3) {
power = 30;
} else if (power >= 4) {
power = 100;
}
}
return power;
}
#pragma pop
/* 80087A58-80087C04 082398 01AC+00 1/1 0/0 38/38 .text at_power_check__FP11dCcU_AtInfo
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void at_power_check(dCcU_AtInfo* param_0) {
nofralloc
#include "asm/d/cc/d_cc_uty/at_power_check__FP11dCcU_AtInfo.s"
fopAc_ac_c* at_power_check(dCcU_AtInfo* info) {
if (info->mpCollider == NULL) {
return NULL;
}
info->mpActor = info->mpCollider->GetAc();
info->mHitType = 12;
info->mAttackPower = 0;
info->mHitBit = 0;
if (info->mpActor != NULL) {
info->mAttackPower = at_power_get(info);
s16 ac_name = fopAcM_GetName(info->mpActor);
if (ac_name == PROC_ALINK || ac_name == PROC_ALINK) {
if (info->mpCollider->ChkAtType(0x8000) || info->mpCollider->ChkAtType(0x400000)) {
info->mHitType = 9;
} else {
info->mHitType = 1;
info->mHitBit = cc_pl_cut_bit_get();
}
} else if (ac_name == PROC_NBOMB) {
info->mHitType = 2;
info->mHitBit = 0x10000000;
} else if (ac_name == PROC_BOOMERANG) {
info->mHitType = 10;
info->mHitBit = 0x40000000;
} else if (ac_name == PROC_ARROW) {
info->mHitType = 15;
info->mHitBit = 0x80000000;
}
}
info->mHitStatus = 0;
if (info->mpCollider->ChkAtType(0x40) || info->mpCollider->ChkAtType(0x10000) ||
info->mpCollider->ChkAtType(0x80) || info->mpCollider->ChkAtType(0x10)) {
info->mHitType = 0x10;
} else if (info->mpCollider->ChkAtType(0x4000)) {
info->mHitBit = 0x1000;
} else {
s16 ac_name = fopAcM_GetName(info->mpActor);
if (ac_name == PROC_ALINK || ac_name == PROC_ALINK) {
if (dCcD_GetGObjInf(info->mpCollider)->GetAtSpl() == 1) {
info->mHitStatus = 1;
}
} else if (info->mAttackPower >= 3) {
info->mHitStatus = 1;
}
}
return info->mpActor;
}
#pragma pop
/* ############################################################################################## */
/* 80452798-804527A0 000D98 0004+04 1/1 0/0 0/0 .sdata2 @4212 */
@@ -191,16 +382,141 @@ SECTION_SDATA2 static f32 lit_4218[1 + 1 /* padding */] = {
/* 80087C04-80088134 082544 0530+00 0/0 0/0 84/84 .text cc_at_check__FP10fopAc_ac_cP11dCcU_AtInfo
*/
// reg issues
#ifdef NONMATCHING
fopAc_ac_c* cc_at_check(fopAc_ac_c* enemy, dCcU_AtInfo* info) {
daPy_py_c* link = (daPy_py_c*)dComIfGp_getPlayer(0);
info->mpActor = at_power_check(info);
if (info->mpActor != NULL) {
cXyz tmp = info->mpActor->mSpeed;
tmp.y = 0.0f;
if (tmp.abs() > 100.0f) {
f32 x = info->mpActor->mSpeed.x;
f32 z = info->mpActor->mSpeed.z;
info->mHitDirection = cM_atan2s(-x, -z) + (s16)cM_rndFX(4000.0f);
} else {
if (fopAcM_GetName(info->mpActor) == PROC_BOOMERANG) {
f32 x_diff = enemy->mCurrent.mPosition.x - link->mCurrent.mPosition.x;
f32 z_diff = enemy->mCurrent.mPosition.z - link->mCurrent.mPosition.z;
info->mHitDirection = cM_atan2s(-x_diff, -z_diff) + (s16)cM_rndFX(10000.0f);
} else {
f32 x_diff = enemy->mCurrent.mPosition.x - info->mpActor->mCurrent.mPosition.x;
f32 z_diff = enemy->mCurrent.mPosition.z - info->mpActor->mCurrent.mPosition.z;
info->mHitDirection = cM_atan2s(-x_diff, -z_diff);
}
}
if (info->mHitType == 1 && link->getCutType() == daPy_py_c::TYPE_CUT_HEAD) {
info->mHitDirection = link->mCollisionRot.y;
}
if (info->mpCollider->ChkAtType(0x4000) && fopAcM_checkStatus(enemy, 0x380000)) {
info->mAttackPower = 0;
}
if (static_cast<dCcD_GObjInf*>(info->mpCollider)->GetAtMtrl() == 4) {
if (fopAcM_GetName(enemy) == PROC_B_GND) {
info->mAttackPower = 0;
} else if (fopAcM_GetName(enemy) != PROC_B_ZANT) {
info->mAttackPower = 100;
}
}
if (info->mHitType == 1) {
if (!daPy_py_c::checkNowWolf()) {
if (link->checkMasterSwordEquip()) {
info->mAttackPower *= 2;
}
if (daPy_py_c::checkWoodSwordEquip()) {
// probably supposed to be some sort of division
info->mAttackPower = info->mAttackPower >> 1;
}
}
if (link->getSwordAtUpTime()) {
info->mAttackPower *= 2;
info->mHitStatus = 1;
}
}
if (info->mAttackPower != 0) {
enemy->field_0x562 -= info->mAttackPower;
}
s8 pause_time = 0;
if (info->mAttackPower != 0 && enemy->field_0x562 <= 0) {
info->mHitStatus = 2;
enemy->field_0x562 = 0;
}
int uvar8;
if (info->mpCollider->ChkAtType(0x4000) && !fopAcM_checkStatus(enemy, 0x280000)) {
uvar8 = 1;
} else {
uvar8 = 0;
}
if (info->mpSound != NULL) {
if (info->field_0x18 != 0) {
info->mpSound->startCollisionSE(getHitId(info->mpCollider, uvar8), info->field_0x18);
} else {
info->mpSound->startCollisionSE(getHitId(info->mpCollider, uvar8),
getMapInfo(info->mHitStatus));
}
}
if (info->mHitStatus != 0) {
pause_time = 5;
} else {
if (info->mAttackPower > 1) {
pause_time = 2;
}
}
if (info->mpCollider->ChkAtType(0x8000000) ||
((daPy_py_c*)dComIfGp_getPlayer(0))->checkHorseRide()) {
// actor is Bulblin or Horseback Ganon
// add bulblin class later
if ((fopAcM_GetName(enemy) == PROC_E_RD && *(char*)((char*)&enemy + 0x1292) != 0) ||
fopAcM_GetName(enemy) == PROC_B_GND) {
pause_time = 3;
} else {
pause_time = 0;
}
}
s16 ac_name = fopAcM_GetName(enemy);
// actor is Stalkin, Chu, Keese, Shadow Keese, Shadow Vermin, Baby Gohma, or Rat
if (ac_name == PROC_E_BS || ac_name == PROC_E_SM2 || ac_name == PROC_E_BA ||
ac_name == PROC_E_YK || ac_name == PROC_E_YG || ac_name == PROC_E_GM ||
ac_name == PROC_E_MS) {
pause_time = 0;
}
if (info->mHitType == 1 || info->mpCollider->ChkAtType(0x8)) {
if (!link->checkCutJumpCancelTurn() && info->mpCollider->ChkAtType(0x8)) {
pause_time = 4;
}
dScnPly_c::setPauseTimer(pause_time);
}
}
return info->mpActor;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void cc_at_check(fopAc_ac_c* param_0, dCcU_AtInfo* param_1) {
asm fopAc_ac_c* cc_at_check(fopAc_ac_c* param_0, dCcU_AtInfo* param_1) {
nofralloc
#include "asm/d/cc/d_cc_uty/cc_at_check__FP10fopAc_ac_cP11dCcU_AtInfo.s"
}
#pragma pop
#endif
/* 80088134-8008813C 082A74 0008+00 0/0 1/0 0/0 .text checkCutJumpCancelTurn__9daPy_py_cCFv */
bool daPy_py_c::checkCutJumpCancelTurn() const {
return false;
int daPy_py_c::checkCutJumpCancelTurn() const {
return 0;
}
+1 -1
View File
@@ -1367,7 +1367,7 @@ asm void dComIfG_changeOpeningScene(scene_class* param_0, s16 param_1) {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dComIfG_resetToOpening(scene_class* param_0) {
asm BOOL dComIfG_resetToOpening(scene_class* param_0) {
nofralloc
#include "asm/d/com/d_com_inf_game/dComIfG_resetToOpening__FP11scene_class.s"
}
+1 -15
View File
@@ -79,19 +79,6 @@ struct dDlst_2DM_c {
/* 80052C58 */ void draw();
};
class cM_rnd_c {
public:
/* 80053CDC */ void init(int, int, int);
/* 80053CEC */ f32 get();
/* 80053DE0 */ f32 getF(f32);
/* 80053E18 */ f32 getFX(f32);
/* 80053E60 */ f32 getValue(f32, f32);
/* 0x0 */ int seed0;
/* 0x4 */ int seed1;
/* 0x8 */ int seed2;
};
struct cBgS_ShdwDraw {
/* 80267F88 */ cBgS_ShdwDraw();
/* 80267FD0 */ ~cBgS_ShdwDraw();
@@ -3027,8 +3014,7 @@ SECTION_SDATA u8 dDlst_list_c::mWipeColor[4] = {
};
/* 80450ED0-80450ED4 0003D0 0004+00 2/2 1/1 0/0 .sbss None */
extern u8 data_80450ED0[4];
u8 data_80450ED0[4];
u8 data_80450ED0;
/* 80450ED4-80450ED8 0003D4 0004+00 2/2 1/1 0/0 .sbss mWipeRate__12dDlst_list_c */
f32 dDlst_list_c::mWipeRate;
+29 -60
View File
@@ -4,22 +4,18 @@
//
#include "d/d_kyeff.h"
#include "d/kankyo/d_kankyo_wether.h"
#include "Z2AudioLib/Z2EnvSeMgr.h"
#include "d/com/d_com_inf_game.h"
#include "d/kankyo/d_kankyo.h"
#include "dol2asm.h"
#include "dolphin/types.h"
#include "d/com/d_com_inf_game.h"
//
// Types:
//
struct kankyo_class {};
struct Z2EnvSeMgr {
/* 802C66B0 */ void framework();
};
//
// Forward References:
//
@@ -45,69 +41,50 @@ extern "C" void dKyw_wether_draw__Fv();
extern "C" void dKy_FiveSenses_fullthrottle_dark__Fv();
extern "C" void framework__10Z2EnvSeMgrFv();
extern "C" extern void* g_fopKy_Method[5 + 1 /* padding */];
extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */];
extern "C" extern u8 g_env_light[4880];
extern "C" extern u8 g_mEnvSeMgr[780];
extern "C" extern dScnKy_env_light_c g_env_light;
extern "C" extern Z2EnvSeMgr g_mEnvSeMgr;
//
// Declarations:
//
// move later
inline void mDoAud_mEnvse_framework() {
g_mEnvSeMgr.framework();
}
/* 801ADD00-801ADD38 1A8640 0038+00 2/2 0/0 0/0 .text dKankyo_DayProc__Fv */
void dKankyo_DayProc() {
dComIfGs_offTmpBit(dSv_event_tmp_flag_c::tempBitLabels[91]);
}
static bool dKyeff_Draw(dKyeff_c* ptr) {
static int dKyeff_Draw(dKyeff_c* ptr) {
dKyw_wether_draw();
return true;
return 1;
}
/* ############################################################################################## */
/* 80394F38-80394F38 021598 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
#pragma push
#pragma force_active on
SECTION_DEAD static char const* const stringBase_80394F38 = "Name";
/* @stringBase0 padding */
SECTION_DEAD static char const* const pad_80394F3D = "\0\0";
#pragma pop
/* 801ADD5C-801ADDB4 1A869C 0058+00 1/1 0/0 0/0 .text execute__8dKyeff_cFv */
// matching but need gameinfo setup
#ifdef NONMATCHING
bool dKyeff_c::execute() {
const char* stageName = dComIfGp_getStartStageName();
int strcmp_result = strcmp(stageName, "Name"); // strcmp(stageName,"Name");
if (strcmp_result != 0) {
int dKyeff_c::execute() {
if (strcmp(dComIfGp_getStartStageName(), "Name")) {
dKyw_wether_move();
}
dKyw_wether_move_draw();
dKy_FiveSenses_fullthrottle_dark();
mDoAud_mEnvse_framework();
return true;
return 1;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm bool dKyeff_c::execute() {
nofralloc
#include "asm/d/d_kyeff/execute__8dKyeff_cFv.s"
}
#pragma pop
#endif
static bool dKyeff_Execute(dKyeff_c* ptr) {
static int dKyeff_Execute(dKyeff_c* ptr) {
return ptr->execute();
}
static bool dKyeff_IsDelete(dKyeff_c* ptr) {
return true;
static int dKyeff_IsDelete(dKyeff_c* ptr) {
return 1;
}
static bool dKyeff_Delete(dKyeff_c* ptr) {
static int dKyeff_Delete(dKyeff_c* ptr) {
dKyw_wether_delete();
return true;
return 1;
}
/* ############################################################################################## */
@@ -132,25 +109,17 @@ SECTION_SDATA2 static f32 lit_3843 = 7.0f / 10.0f;
SECTION_SDATA2 static f32 lit_3844 = 15.0f;
/* 801ADE00-801ADEA0 1A8740 00A0+00 1/0 0/0 0/0 .text dKyeff_Create__FP12kankyo_class */
// matching but need gameinfo setup
// float data
#ifdef NONMATCHING
u32 dKyeff_Create(kankyo_class* kankyo_class_ptr) {
int strcmp_result;
OSTime Time;
OSCalendarTime CalendarTime;
static int dKyeff_Create(kankyo_class* kankyo) {
OSCalendarTime time;
dKyw_wether_init();
strcmp_result = strcmp(dComIfGp_getStartStageName(), "Name");
if (strcmp_result == 0) {
Time = OSGetTime();
OSTicksToCalendarTime(
Time,
&CalendarTime); // CONCAT44(iVar1,(int)((ulonglong)OVar2 >> 0x20)),&CalendarTime);
lbl_8042CA54.field_0xe48 = 1.0f;
lbl_8042CA54.field_0xe4c = 0.0f;
lbl_8042CA54.field_0xe50 = 0.0f;
lbl_8042CA54.field_0xe58 = 0.7f;
lbl_8042CA54.field_0x1244 = CalendarTime.hours * 15.0f;
if (!strcmp(dComIfGp_getStartStageName(), "Name")) {
OSTicksToCalendarTime(OSGetTime(), &time);
g_env_light.mWind.vec.set(1.0f, 0.0f, 0.0f);
g_env_light.mWind.pow = 0.7f;
g_env_light.mDaytime = time.hours * 15.0f;
}
return 4;
}
@@ -158,7 +127,7 @@ u32 dKyeff_Create(kankyo_class* kankyo_class_ptr) {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void dKyeff_Create(kankyo_class* param_0) {
static asm int dKyeff_Create(kankyo_class* param_0) {
nofralloc
#include "asm/d/d_kyeff/dKyeff_Create__FP12kankyo_class.s"
}
+2 -3
View File
@@ -412,7 +412,6 @@ extern "C" void _restgpr_28();
extern "C" void _restgpr_29();
extern "C" extern J3DLightInfo const j3dDefaultLightInfo;
extern "C" extern u8 g_save_bit_HIO[1184 + 4 /* padding */];
extern "C" extern u8 data_804505F0[8];
extern "C" u8 mResetData__6mDoRst[4 + 4 /* padding */];
//
@@ -1826,7 +1825,7 @@ int dStage_roomControl_c::resetArchiveBank(int i_bank) {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm int dStage_roomControl_c::resetArchiveBank(int param_0) {
asm bool dStage_roomControl_c::resetArchiveBank(int param_0) {
nofralloc
#include "asm/d/d_stage/resetArchiveBank__20dStage_roomControl_cFi.s"
}
@@ -2279,7 +2278,7 @@ static asm int dStage_lgtvInfoInit(dStage_dt_c* param_0, void* param_1, int para
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dStage_stagInfo_GetParticleNo(stage_stag_info_class* param_0, int param_1) {
asm u8 dStage_stagInfo_GetParticleNo(stage_stag_info_class* param_0, int param_1) {
nofralloc
#include "asm/d/d_stage/dStage_stagInfo_GetParticleNo__FP21stage_stag_info_classi.s"
}
-1
View File
@@ -143,7 +143,6 @@ extern "C" void _restgpr_29();
extern "C" u8 const tempBitLabels__20dSv_event_tmp_flag_c[370 + 2 /* padding */];
extern "C" u8 saveBitLabels__16dSv_event_flag_c[1644 + 4 /* padding */];
extern "C" f32 mFadeRate__13mDoGph_gInf_c;
extern "C" extern u8 struct_80450BE4[4];
extern "C" u8 m_control__7dDemo_c[4];
extern "C" u8 m_frameNoMsg__7dDemo_c[4];
extern "C" u8 m_mode__7dDemo_c[4];
+166 -142
View File
@@ -7,63 +7,6 @@
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct dSv_save_c {};
struct JMSMesgEntry_c {};
struct dMeter2Info_c {
/* 8021C250 */ void getString(u32, char*, JMSMesgEntry_c*);
};
struct JKRArchive {};
struct dFile_info_c {
/* 80192434 */ dFile_info_c(JKRArchive*, u8);
/* 801924A0 */ ~dFile_info_c();
/* 80192570 */ void screenSet();
/* 80192954 */ void setSaveData(dSv_save_c*, int, u8);
/* 80192AA0 */ void setHeartCnt(dSv_save_c*);
/* 80192C08 */ void setSaveDate(dSv_save_c*);
/* 80192C70 */ void setPlayTime(dSv_save_c*);
/* 80192D58 */ void modeWait();
/* 80192D5C */ void modeMove();
/* 80192D60 */ void _draw();
};
struct dDlst_base_c {};
struct dDlst_list_c {
/* 80056794 */ void set(dDlst_base_c**&, dDlst_base_c**&, dDlst_base_c*);
};
struct dDlst_FileInfo_c {
/* 80192D9C */ void draw();
/* 80192EC8 */ ~dDlst_FileInfo_c();
};
struct JKRExpHeap {};
struct J2DTextBox {
/* 80300658 */ void getStringPtr() const;
/* 8030074C */ void setString(s16, char const*, ...);
};
struct J2DGrafContext {};
struct J2DScreen {
/* 802F8498 */ J2DScreen();
/* 802F8648 */ void setPriority(char const*, u32, JKRArchive*);
/* 802F8ED4 */ void draw(f32, f32, J2DGrafContext const*);
};
struct CPaneMgrAlpha {
/* 802553FC */ CPaneMgrAlpha(J2DScreen*, u64, u8, JKRExpHeap*);
};
//
// Forward References:
//
@@ -99,10 +42,6 @@ extern "C" void setPriority__9J2DScreenFPCcUlP10JKRArchive();
extern "C" void draw__9J2DScreenFffPC14J2DGrafContext();
extern "C" void getStringPtr__10J2DTextBoxCFv();
extern "C" void setString__10J2DTextBoxFsPCce();
extern "C" void OSTicksToCalendarTime();
extern "C" void PSMTXCopy();
extern "C" void PSMTXConcat();
extern "C" void PSMTXScale();
extern "C" void _savegpr_22();
extern "C" void _savegpr_26();
extern "C" void _savegpr_28();
@@ -113,11 +52,7 @@ extern "C" void _restgpr_28();
extern "C" void _restgpr_29();
extern "C" void __div2i();
extern "C" void __mod2i();
extern "C" void sprintf();
extern "C" void strcpy();
extern "C" extern void* __vt__12dDlst_base_c[3];
extern "C" extern u8 g_dComIfG_gameInfo[122384];
extern "C" extern u8 g_meter2_info[248];
//
// Declarations:
@@ -154,25 +89,18 @@ SECTION_DATA static u8 cNullVec__6Z2Calc[12 + 4 /* padding */] = {
};
/* 803BB4A8-803BB548 0185C8 00A0+00 1/1 0/0 0/0 .data l_htag$3879 */
SECTION_DATA static u8 l_htag[160] = {
0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x32, 0x30, 0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x32, 0x31,
0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x32, 0x32, 0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x32, 0x33,
0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x32, 0x34, 0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x32, 0x35,
0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x32, 0x36, 0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x32, 0x37,
0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x32, 0x38, 0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x32, 0x39,
0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x33, 0x30, 0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x33, 0x31,
0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x33, 0x32, 0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x33, 0x33,
0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x33, 0x34, 0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x33, 0x35,
0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x33, 0x36, 0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x33, 0x37,
0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x33, 0x38, 0x00, 0x68, 0x65, 0x61, 0x72, 0x5F, 0x33, 0x39,
SECTION_DATA static u64 l_htag[20] = {
'hear_20', 'hear_21', 'hear_22', 'hear_23', 'hear_24', 'hear_25', 'hear_26',
'hear_27', 'hear_28', 'hear_29', 'hear_30', 'hear_31', 'hear_32', 'hear_33',
'hear_34', 'hear_35', 'hear_36', 'hear_37', 'hear_38', 'hear_39',
};
/* 803BB548-803BB558 -00001 0010+00 1/1 0/0 0/0 .data amariheartTex$3880 */
SECTION_DATA static void* amariheartTex[4] = {
(void*)(((char*)&d_file_d_file_sel_info__stringBase0) + 0x21),
(void*)(((char*)&d_file_d_file_sel_info__stringBase0) + 0x21),
(void*)(((char*)&d_file_d_file_sel_info__stringBase0) + 0x21),
(void*)(((char*)&d_file_d_file_sel_info__stringBase0) + 0x21),
SECTION_DATA static char* amariheartTex[4] = {
"tt_heart_00.bti",
"tt_heart_00.bti",
"tt_heart_00.bti",
"tt_heart_00.bti",
};
/* 803BB558-803BB564 -00001 000C+00 0/1 0/0 0/0 .data @3953 */
@@ -224,47 +152,144 @@ SECTION_DATA extern void* __vt__12dFile_info_c[3 + 3 /* padding */] = {
};
/* 80192434-801924A0 18CD74 006C+00 0/0 3/3 0/0 .text __ct__12dFile_info_cFP10JKRArchiveUc */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm dFile_info_c::dFile_info_c(JKRArchive* param_0, u8 param_1) {
nofralloc
#include "asm/d/file/d_file_sel_info/__ct__12dFile_info_cFP10JKRArchiveUc.s"
dFile_info_c::dFile_info_c(JKRArchive* arc, u8 param_1) {
mArchive = arc;
field_0x22 = param_1;
mFileInfo.mBasePane = NULL;
screenSet();
field_0x20 = 0;
}
#pragma pop
/* 801924A0-80192570 18CDE0 00D0+00 1/0 0/0 0/0 .text __dt__12dFile_info_cFv */
#ifdef NONMATCHING
dFile_info_c::~dFile_info_c() {
delete mFileInfo.Scr;
delete mDatBase;
delete mNoDatBase;
mDoExt_removeMesgFont();
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm dFile_info_c::~dFile_info_c() {
// asm dFile_info_c::~dFile_info_c() {
extern "C" asm void __dt__12dFile_info_cFv() {
nofralloc
#include "asm/d/file/d_file_sel_info/__dt__12dFile_info_cFv.s"
}
#pragma pop
#endif
/* 80192570-80192954 18CEB0 03E4+00 1/1 0/0 0/0 .text screenSet__12dFile_info_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dFile_info_c::screenSet() {
nofralloc
#include "asm/d/file/d_file_sel_info/screenSet__12dFile_info_cFv.s"
void dFile_info_c::screenSet() {
mFileInfo.Scr = new J2DScreen();
mFileInfo.Scr->setPriority("zelda_file_select_info_text.blo", 0x1100000, mArchive);
mFileInfo.mFont = mDoExt_getMesgFont();
mFileInfo.Scr->search('w_cp_ef1')->hide();
mFileInfo.field_0x10 = mFileInfo.Scr->search('w_dat_i1');
mDatBase = new CPaneMgrAlpha(mFileInfo.Scr, 'w_dat_i1', 2, NULL);
mNoDatBase = new CPaneMgrAlpha(mFileInfo.Scr, 'w_nda_i1', 2, NULL);
J2DTextBox* tboxs[4];
tboxs[0] = (J2DTextBox*)mFileInfo.Scr->search('f_s_t_02');
tboxs[1] = (J2DTextBox*)mFileInfo.Scr->search('f_p_t_02');
mFileInfo.Scr->search('w_s_t_01')->hide();
mFileInfo.Scr->search('w_p_t_01')->hide();
for (int i = 0; i < 2; i++) {
tboxs[i]->setFont(mFileInfo.mFont);
tboxs[i]->setString(0x20, "");
}
dMeter2Info_getString(0x3D0, tboxs[0]->getStringPtr(), NULL); // Save time
dMeter2Info_getString(0x3D1, tboxs[1]->getStringPtr(), NULL); // Total play time
tboxs[0] = (J2DTextBox*)mFileInfo.Scr->search('f_name01');
tboxs[1] = (J2DTextBox*)mFileInfo.Scr->search('f_new_1');
mFileInfo.Scr->search('w_name01')->hide();
mFileInfo.Scr->search('w_new_1')->hide();
tboxs[2] = (J2DTextBox*)mFileInfo.Scr->search('w_time01');
tboxs[3] = (J2DTextBox*)mFileInfo.Scr->search('w_ptim01');
for (int i = 0; i < 4; i++) {
tboxs[i]->setFont(mFileInfo.mFont);
tboxs[i]->setString(0x40, "");
}
mPlayerName = tboxs[0]->getStringPtr();
mSaveStatus = tboxs[1]->getStringPtr();
mSaveDate = tboxs[2]->getStringPtr();
mPlayTime = tboxs[3]->getStringPtr();
}
inline u16 dComIfGs_getLife() {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getLife();
}
#pragma pop
/* 80192954-80192AA0 18D294 014C+00 0/0 3/3 0/0 .text setSaveData__12dFile_info_cFP10dSv_save_ciUc
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dFile_info_c::setSaveData(dSv_save_c* param_0, int param_1, u8 param_2) {
nofralloc
#include "asm/d/file/d_file_sel_info/setSaveData__12dFile_info_cFP10dSv_save_ciUc.s"
int dFile_info_c::setSaveData(dSv_save_c* save, int param_1, u8 data_num) {
if (param_1 != 0) {
char* player_name = save->getPlayer().getPlayerInfo().getLinkName();
if (*player_name == NULL) {
if (field_0x22 == 1 && data_num == dComIfGs_getDataNum()) {
save->getPlayer().getPlayerStatusA().setLife(dComIfGs_getLife());
setHeartCnt(save);
save->getPlayer().getPlayerStatusA().setLife(12);
strcpy(mPlayerName, dComIfGs_getPlayerName());
strcpy(mSaveDate, "");
strcpy(mPlayTime, "");
dMeter2Info_getString(0x4D, mSaveStatus, NULL); // New Quest Log
return 2;
} else {
dMeter2Info_getString(0x4D, mSaveStatus, NULL); // New Quest Log
return 1;
}
} else {
setHeartCnt(save);
strcpy(mPlayerName, player_name);
setSaveDate(save);
setPlayTime(save);
return 0;
}
} else {
dMeter2Info_getString(0x51, mSaveStatus, NULL); // This Quest Log is Corrupted
return -1;
}
}
#pragma pop
/* 80192AA0-80192C08 18D3E0 0168+00 1/1 0/0 0/0 .text setHeartCnt__12dFile_info_cFP10dSv_save_c */
// close
#ifdef NONMATCHING
void dFile_info_c::setHeartCnt(dSv_save_c* save) {
u16 life = save->getPlayer().getPlayerStatusA().getLife();
s32 count = (u8)(life) / 5;
s32 quarter_count = life % 5;
if (quarter_count != 0) {
count++;
}
J2DPicture* heartP[20];
for (int i = 0; i < 20; i++) {
heartP[i] = (J2DPicture*)mFileInfo.Scr->search(l_htag[i]);
if (i < save->getPlayer().getPlayerStatusA().getMaxLife() / 5) {
heartP[i]->show();
if (i < count) {
if (quarter_count != 0 && i == --count) {
heartP[i]->changeTexture(amariheartTex[quarter_count - 1], 0);
} else {
heartP[i]->changeTexture("tt_heart_00.bti", 0);
}
} else {
heartP[i]->changeTexture("tt_heart_00.bti", 0);
}
} else {
heartP[i]->hide();
}
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -273,43 +298,29 @@ asm void dFile_info_c::setHeartCnt(dSv_save_c* param_0) {
#include "asm/d/file/d_file_sel_info/setHeartCnt__12dFile_info_cFP10dSv_save_c.s"
}
#pragma pop
/* ############################################################################################## */
/* 803948B8-803948B8 020F18 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
#pragma push
#pragma force_active on
SECTION_DEAD static char const* const stringBase_803948E9 = "%02d/%02d/%d %02d:%02d";
#pragma pop
#endif
/* 80192C08-80192C70 18D548 0068+00 1/1 0/0 0/0 .text setSaveDate__12dFile_info_cFP10dSv_save_c */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dFile_info_c::setSaveDate(dSv_save_c* param_0) {
nofralloc
#include "asm/d/file/d_file_sel_info/setSaveDate__12dFile_info_cFP10dSv_save_c.s"
void dFile_info_c::setSaveDate(dSv_save_c* save) {
OSCalendarTime time;
OSTicksToCalendarTime(save->getPlayer().getPlayerStatusB().getDateIpl(), &time);
sprintf(mSaveDate, "%02d/%02d/%d %02d:%02d", time.month + 1, time.day_of_month, time.year,
time.hours, time.minutes);
}
#pragma pop
/* ############################################################################################## */
/* 803948B8-803948B8 020F18 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
#pragma push
#pragma force_active on
SECTION_DEAD static char const* const stringBase_80394900 = "999:59";
SECTION_DEAD static char const* const stringBase_80394907 = "%d:%02d";
/* @stringBase0 padding */
SECTION_DEAD static char const* const pad_8039490F = "";
#pragma pop
/* 80192C70-80192D58 18D5B0 00E8+00 1/1 0/0 0/0 .text setPlayTime__12dFile_info_cFP10dSv_save_c */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dFile_info_c::setPlayTime(dSv_save_c* param_0) {
nofralloc
#include "asm/d/file/d_file_sel_info/setPlayTime__12dFile_info_cFP10dSv_save_c.s"
void dFile_info_c::setPlayTime(dSv_save_c* save) {
s64 time = save->getPlayer().getPlayerInfo().getTotalTime() / (OS_BUS_CLOCK / 4);
// 3599940 = 999:59 in seconds
if (time >= 3599940) {
sprintf(mPlayTime, "999:59");
} else {
u32 min = (time % 3600) / 60;
u32 hours = time / 3600;
sprintf(mPlayTime, "%d:%02d", hours, min);
}
}
#pragma pop
/* 80192D58-80192D5C 18D698 0004+00 1/0 0/0 0/0 .text modeWait__12dFile_info_cFv */
void dFile_info_c::modeWait() {
@@ -322,14 +333,9 @@ void dFile_info_c::modeMove() {
}
/* 80192D60-80192D9C 18D6A0 003C+00 0/0 2/2 0/0 .text _draw__12dFile_info_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dFile_info_c::_draw() {
nofralloc
#include "asm/d/file/d_file_sel_info/_draw__12dFile_info_cFv.s"
void dFile_info_c::_draw() {
dComIfGd_set2DOpa(&mFileInfo);
}
#pragma pop
/* ############################################################################################## */
/* 804539F8-804539FC 001FF8 0004+00 1/1 0/0 0/0 .sdata2 @4000 */
@@ -344,14 +350,32 @@ SECTION_SDATA2 static u8 lit_4001[4] = {
};
/* 80192D9C-80192E88 18D6DC 00EC+00 1/0 0/0 0/0 .text draw__16dDlst_FileInfo_cFv */
// close
#ifdef NONMATCHING
void dDlst_FileInfo_c::draw() {
Mtx m;
J2DGrafContext* ctx = dComIfGp_getCurrentGrafPort();
if (mBasePane != NULL) {
MtxP glbMtx = mBasePane->getGlbMtx();
PSMTXScale(m, mBasePane->getWidth() / field_0x10->getWidth(),
mBasePane->getHeight() / field_0x10->getHeight(), 1.0f);
PSMTXConcat(glbMtx, m, glbMtx);
Scr->search('Nm_02')->setMtx(glbMtx);
}
Scr->draw(0.0f, 0.0f, ctx);
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dDlst_FileInfo_c::draw() {
// asm void dDlst_FileInfo_c::draw() {
extern "C" asm void draw__16dDlst_FileInfo_cFv() {
nofralloc
#include "asm/d/file/d_file_sel_info/draw__16dDlst_FileInfo_cFv.s"
}
#pragma pop
#endif
/* 80192E88-80192EC8 18D7C8 0040+00 0/0 1/0 0/0 .text __sinit_d_file_sel_info_cpp */
#pragma push
-1
View File
@@ -344,7 +344,6 @@ extern "C" void _restgpr_29();
extern "C" u8 const tempBitLabels__20dSv_event_tmp_flag_c[370 + 2 /* padding */];
extern "C" extern void* __vt__12J3DFrameCtrl[3];
extern "C" extern void* g_fopKy_Method[5 + 1 /* padding */];
extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */];
extern "C" u8 m_bloom__13mDoGph_gInf_c[20];
extern "C" u8 now__14mDoMtx_stack_c[48];
extern "C" u8 mStatus__20dStage_roomControl_c[65792];
-5
View File
@@ -227,11 +227,6 @@ inline void mDoAud_rainPlay(s32 enable) {
g_mEnvSeMgr.startRainSe(enable, 0);
}
inline void mDoAud_seStart(u32 sfx_id, const Vec* param_1, u32 param_2, s8 param_3) {
Z2AudioMgr::getInterface()->mSeMgr.seStart(sfx_id, param_1, param_2, param_3, 1.0f, 1.0f, -1.0f,
-1.0f, 0);
}
/* 80056AA8-80056AF8 0513E8 0050+00 3/3 0/0 0/0 .text dKyw_setDrawPacketList__FP9J3DPacketi */
static J3DPacket* dKyw_setDrawPacketList(J3DPacket* p_packet, int param_1) {
if (p_packet == NULL) {
-2
View File
@@ -259,14 +259,12 @@ extern "C" void _restgpr_28();
extern "C" void _restgpr_29();
extern "C" extern u8 g_mDoMtx_identity[48 + 24 /* padding */];
extern "C" extern void* g_fopMsg_Method[5 + 1 /* padding */];
extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */];
extern "C" extern void* __vt__12dDlst_base_c[3];
extern "C" extern void* __vt__10CSTControl[4];
extern "C" u8 m_cpadInfo__8mDoCPd_c[256];
extern "C" u8 mFader__13mDoGph_gInf_c[4];
extern "C" u8 mFrameBufferTimg__13mDoGph_gInf_c[4];
extern "C" u8 mFrameBufferTex__13mDoGph_gInf_c[4];
extern "C" extern u8 struct_80450BE4[4];
extern "C" u8 sManager__10JFWDisplay[4];
extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */];
+492 -164
View File
@@ -4,9 +4,14 @@
//
#include "d/meter/d_meter2.h"
#include "d/d_timer.h"
#include "d/menu/d_menu_window_HIO.h"
#include "d/meter/d_meter_HIO.h"
#include "dol2asm.h"
#include "dolphin/types.h"
#include "f_op/f_op_msg.h"
#include "f_op/f_op_msg_mng.h"
#include "m_Do/m_Do_audio.h"
//
// Types:
@@ -16,35 +21,10 @@ struct dScope_c {
/* 80193690 */ dScope_c(u8);
};
struct dMw_HIO_c {
/* 801F9E14 */ bool getBombFlag();
/* 801F9E1C */ bool getArrowFlag();
/* 801F9E24 */ bool getPachinkoFlag();
};
struct dMeterString_c {
/* 8020ED60 */ dMeterString_c(int);
/* 8020F5A4 */ void createString(int);
};
struct dMeterHakusha_c {
/* 8020C320 */ dMeterHakusha_c(void*);
};
struct dMeterHaihai_c {
/* 8020AE8C */ dMeterHaihai_c(u8);
};
struct dMeterButton_c {
/* 80201328 */ dMeterButton_c();
/* 80201404 */ void _execute(u32, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool,
bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool,
bool);
/* 80209474 */ void isClose();
/* 802095C0 */ void setString(char*, u8, u8, u8);
/* 80209CEC */ void hideAll();
};
struct dDemo_c {
static u8 m_mode[4];
};
@@ -53,19 +33,6 @@ struct dCamera_c {
/* 80174EA4 */ bool CalcSubjectAngle(s16*, s16*);
};
struct Z2StatusMgr {
/* 802B5F70 */ void heartGaugeOn();
};
struct Z2SeMgr {
/* 802AB984 */ void seStart(JAISoundID, Vec const*, u32, s8, f32, f32, f32, f32, u8);
/* 802AC50C */ void seStartLevel(JAISoundID, Vec const*, u32, s8, f32, f32, f32, f32, u8);
};
struct Z2AudioMgr {
static u8 mAudioMgrPtr[4 + 4 /* padding */];
};
//
// Forward References:
//
@@ -120,7 +87,7 @@ extern "C" static bool dMeter2_IsDelete__FP9dMeter2_c();
extern "C" static void dMeter2_Delete__FP9dMeter2_c();
extern "C" static void dMeter2_Create__FP9msg_class();
extern "C" extern char const* const d_meter_d_meter2__stringBase0;
extern "C" extern void* g_profile_METER2[10];
// extern "C" extern void* g_profile_METER2[10];
//
// External References:
@@ -276,13 +243,6 @@ extern "C" void _restgpr_23();
extern "C" void _restgpr_25();
extern "C" void _restgpr_27();
extern "C" void _restgpr_29();
extern "C" extern void* g_fopMsg_Method[5 + 1 /* padding */];
extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */];
extern "C" extern u8 g_mwHIO[304];
extern "C" extern u8 g_drawHIO[3880];
extern "C" extern u8 g_ringHIO[344];
extern "C" extern u8 g_fmapHIO[1188];
extern "C" extern u8 g_cursorHIO[68 + 4 /* padding */];
extern "C" u8 m_mode__7dDemo_c[4];
extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */];
@@ -351,9 +311,9 @@ int dMeter2_c::_create() {
field_0x1e6 = 0;
field_0x1e7 = 0;
mItemMaxNum[2] = dComIfGs_getArrowMax();
mItemMaxNum[ARROW_MAX] = dComIfGs_getArrowMax();
mArrowNum = dComIfGs_getArrowNum();
mItemMaxNum[3] = dComIfGs_getPachinkoMax();
mItemMaxNum[PACHINKO_MAX] = dComIfGs_getPachinkoMax();
mPachinkoNum = dComIfGs_getPachinkoNum();
for (int i = 0; i < 3; i++) {
@@ -371,8 +331,8 @@ int dMeter2_c::_create() {
field_0x1e8 = 0;
field_0x1e9 = 0;
field_0x1ea = 0;
field_0x1eb = 0;
mRupeeSound = 0;
mArrowSound = 0;
for (int i = 0; i < 5; i++) {
field_0x1b8[i] = 0;
@@ -412,8 +372,8 @@ int dMeter2_c::_create() {
mRupeeNum = i_dComIfGs_getRupee();
mKeyNum = dComIfGs_getKeyNum();
field_0x1c4 = dComIfGp_getDoStatus();
field_0x1dc = dComIfGp_isDoSetFlag(2);
mDoStatus = dComIfGp_getDoStatus();
mDoSetFlag = dComIfGp_isDoSetFlag(2);
int i = 0;
f32 temp0 = FLOAT_LABEL(lit_4662);
@@ -423,9 +383,9 @@ int dMeter2_c::_create() {
}
field_0x144 = lit_4663;
field_0x1c5 = dComIfGp_getAStatus();
mAStatus = dComIfGp_getAStatus();
field_0x1c6 = 0;
field_0x1dd = dComIfGp_isASetFlag(2);
mASetFlag = dComIfGp_isASetFlag(2);
i = 0;
f32 temp1 = FLOAT_LABEL(lit_4662);
@@ -436,7 +396,7 @@ int dMeter2_c::_create() {
field_0x158 = lit_4663;
field_0x1e4 = 0;
field_0x1e2 = dComIfGs_getSelectEquipSword();
mEquipSword = dComIfGs_getSelectEquipSword();
field_0x1e3 = 0;
field_0x1fe = 0;
@@ -445,20 +405,20 @@ int dMeter2_c::_create() {
field_0x200 = 0;
field_0x201 = 0;
field_0x1c7 = dComIfGs_getCollectSmell();
field_0x1c8 = dComIfGp_getRStatus();
field_0x1de = dComIfGp_isRSetFlag(2);
field_0x1df = dComIfGp_isXSetFlag(2);
field_0x1e0 = dComIfGp_isYSetFlag(2);
mCollectSmell = dComIfGs_getCollectSmell();
mRStatus = dComIfGp_getRStatus();
mRSetFlag = dComIfGp_isRSetFlag(2);
mXSetFlag = dComIfGp_isXSetFlag(2);
mYSetFlag = dComIfGp_isYSetFlag(2);
for (int i = 0; i < 2; i++) {
dComIfGp_setSelectItem(i);
}
field_0x1d2[0] = dComIfGp_getSelectItem(0);
field_0x1d2[2] = dComIfGp_getSelectItem(1);
field_0x1d2[1] = dComIfGp_getXStatus();
field_0x1d2[3] = dComIfGp_getYStatus();
mItemStatus[X_ITEM] = dComIfGp_getSelectItem(0);
mItemStatus[Y_ITEM] = dComIfGp_getSelectItem(1);
mItemStatus[X_STATUS] = dComIfGp_getXStatus();
mItemStatus[Y_STATUS] = dComIfGp_getYStatus();
f32 temp2 = FLOAT_LABEL(lit_4662);
field_0x188 = temp2;
field_0x18c = temp2;
@@ -480,15 +440,15 @@ int dMeter2_c::_create() {
}
field_0x190 = 0;
field_0x1c9 = dComIfGp_getZStatus();
field_0x1ca = dComIfGp_get3DStatus();
field_0x1cb = dComIfGp_getCStickStatus();
field_0x1cc = dComIfGp_getSButtonStatus();
field_0x1cd = dComIfGp_getNunStatus();
field_0x1ce = dComIfGp_getRemoConStatus();
field_0x1cf = dComIfGp_getNunZStatus();
field_0x1d0 = dComIfGp_getNunCStatus();
field_0x1d1 = dComIfGp_getBottleStatus();
mZStatus = dComIfGp_getZStatus();
m3DStatus = dComIfGp_get3DStatus();
mCStickStatus = dComIfGp_getCStickStatus();
mSButtonStatus = dComIfGp_getSButtonStatus();
mNunStatus = dComIfGp_getNunStatus();
mRemoConStatus = dComIfGp_getRemoConStatus();
mNunZStatus = dComIfGp_getNunZStatus();
mNunCStatus = dComIfGp_getNunCStatus();
mBottleStatus = dComIfGp_getBottleStatus();
field_0x1ac = dMeter2Info_isUseButton(16);
field_0x19a = 0;
@@ -500,20 +460,20 @@ int dMeter2_c::_create() {
for (int i = 0; i < 2; i++) {
if (field_0x128 == 0) {
if (field_0x1d2[i * 2] == BOMB_BAG_LV1 || field_0x1d2[i * 2] == NORMAL_BOMB ||
field_0x1d2[i * 2] == WATER_BOMB || field_0x1d2[i * 2] == POKE_BOMB) {
if (mItemStatus[i * 2] == BOMB_BAG_LV1 || mItemStatus[i * 2] == NORMAL_BOMB ||
mItemStatus[i * 2] == WATER_BOMB || mItemStatus[i * 2] == POKE_BOMB) {
mpMeterDraw->setItemNum(i, dComIfGp_getSelectItemNum(i),
dComIfGp_getSelectItemMaxNum(i));
} else if (field_0x1d2[i * 2] == BEE_CHILD) {
} else if (mItemStatus[i * 2] == BEE_CHILD) {
mpMeterDraw->setItemNum(i, dComIfGp_getSelectItemNum(i),
dComIfGp_getSelectItemMaxNum(i));
} else if (field_0x1d2[i * 2] == BOW || field_0x1d2[i * 2] == LIGHT_ARROW ||
field_0x1d2[i * 2] == ARROW_LV1 || field_0x1d2[i * 2] == ARROW_LV2 ||
field_0x1d2[i * 2] == ARROW_LV3 || field_0x1d2[i * 2] == HAWK_ARROW) {
} else if (mItemStatus[i * 2] == BOW || mItemStatus[i * 2] == LIGHT_ARROW ||
mItemStatus[i * 2] == ARROW_LV1 || mItemStatus[i * 2] == ARROW_LV2 ||
mItemStatus[i * 2] == ARROW_LV3 || mItemStatus[i * 2] == HAWK_ARROW) {
mpMeterDraw->setItemNum(i, mArrowNum, dComIfGs_getArrowMax());
} else if (field_0x1d2[i * 2] == PACHINKO) {
} else if (mItemStatus[i * 2] == PACHINKO) {
mpMeterDraw->setItemNum(i, mPachinkoNum, dComIfGs_getPachinkoMax());
} else if (field_0x1d2[i * 2] == BOMB_ARROW) {
} else if (mItemStatus[i * 2] == BOMB_ARROW) {
u8 item_num = dComIfGp_getSelectItemNum(i);
u8 item_max = dComIfGp_getSelectItemMaxNum(i);
if (item_num > mArrowNum) {
@@ -541,9 +501,9 @@ int dMeter2_c::_create() {
mpHeap->getTotalFreeSize();
mpSubHeap = fopMsgM_createExpHeap(0x5000, mpHeap);
field_0x108 = NULL;
field_0x110 = NULL;
field_0x114 = NULL;
field_0x118 = NULL;
mpMeterSub = NULL;
mpMeterString = NULL;
mpMeterButton = NULL;
mpHeap->getTotalFreeSize();
field_0x11c = NULL;
@@ -623,14 +583,37 @@ int dMeter2_c::_execute() {
}
/* 8021F370-8021F49C 219CB0 012C+00 1/1 0/0 0/0 .text _draw__9dMeter2_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm int dMeter2_c::_draw() {
nofralloc
#include "asm/d/meter/d_meter2/_draw__9dMeter2_cFv.s"
int dMeter2_c::_draw() {
if (mpMap != NULL) {
mpMap->_draw();
}
if (mpMeterSub != NULL) {
dComIfGd_set2DOpaTop(mpMeterSub);
}
if (mpMeterString != NULL) {
if (mSubContents == 5) {
if (mSubContentsStringType != 0) {
dComIfGd_set2DOpaTop(mpMeterString);
}
} else {
dComIfGd_set2DOpaTop(mpMeterString);
}
}
if (dMeter2Info_getWindowStatus() == 2) {
dComIfGd_set2DOpa(mpMeterDraw);
} else {
dComIfGd_set2DOpaTop(mpMeterDraw);
}
if (mpMeterButton != NULL) {
dComIfGd_set2DOpaTop(mpMeterButton);
}
return 1;
}
#pragma pop
/* ############################################################################################## */
/* 804549D0-804549D8 002FD0 0004+04 10/10 0/0 0/0 .sdata2 @4837 */
@@ -641,6 +624,58 @@ SECTION_SDATA2 static f32 lit_4837[1 + 1 /* padding */] = {
};
/* 8021F49C-8021F6EC 219DDC 0250+00 1/1 0/0 0/0 .text _delete__9dMeter2_cFv */
#ifdef NONMATCHING
int dMeter2_c::_delete() {
mpHeap->getTotalFreeSize();
JKRHeap* heap = mDoExt_setCurrentHeap(mpHeap);
if (isRupeeSoundBit(2)) {
mDoAud_seStart(Z2SE_LUPY_INC_CNT_2, 0, 0, 0);
}
if (isRupeeSoundBit(3)) {
mDoAud_seStart(Z2SE_LUPY_DEC_CNT_2, 0, 0, 0);
}
if (isArrowSoundBit(2) && (isArrowEquip() || isPachinkoEquip()) &&
mpMeterDraw->isButtonVisible()) {
mDoAud_seStart(Z2SE_CONSUM_INC_CNT_2, 0, 0, 0);
}
mpHeap->getTotalFreeSize();
if (mpMap != NULL) {
delete mpMap;
mpMap = NULL;
}
mpHeap->getTotalFreeSize();
mDoExt_setCurrentHeap(mpSubHeap);
if (mpMeterSub != NULL) {
delete mpMeterSub;
mpMeterSub = NULL;
}
if (mpMeterString != NULL) {
delete mpMeterString;
mpMeterString = NULL;
}
mpHeap->getTotalFreeSize();
if (field_0x11c != NULL) {
delete field_0x11c;
field_0x11c = NULL;
}
mDoExt_setCurrentHeap(heap);
delete mpMeterDraw;
mpMeterDraw = NULL;
fopMsgM_destroyExpHeap(mpSubHeap);
fopMsgM_destroyExpHeap(mpHeap);
emphasisButtonDelete();
return 1;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -649,17 +684,24 @@ asm int dMeter2_c::_delete() {
#include "asm/d/meter/d_meter2/_delete__9dMeter2_cFv.s"
}
#pragma pop
#endif
/* 8021F6EC-8021F780 21A02C 0094+00 1/1 5/5 0/0 .text emphasisButtonDelete__9dMeter2_cFv
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dMeter2_c::emphasisButtonDelete() {
nofralloc
#include "asm/d/meter/d_meter2/emphasisButtonDelete__9dMeter2_cFv.s"
int dMeter2_c::emphasisButtonDelete() {
if (mpMeterButton != NULL) {
JKRExpHeap* heap = dComIfGp_getSubHeap2D(8);
mpMeterButton->hideAll();
if (heap != NULL) {
delete mpMeterButton;
mpMeterButton = NULL;
heap->freeAll();
dComIfGp_offHeapLockFlag(8);
}
}
return 1;
}
#pragma pop
inline void i_dComIfGp_setItemLifeCount(f32 amount, u8 type) {
g_dComIfG_gameInfo.play.setItemLifeCount(amount, type);
@@ -705,7 +747,144 @@ SECTION_SDATA2 static f64 lit_5267 = 4503601774854144.0 /* cast s32 to float */;
/* 804549E0-804549E8 002FE0 0008+00 2/2 0/0 0/0 .sdata2 @5268 */
SECTION_SDATA2 static f64 lit_5268 = 4503599627370496.0 /* cast u32 to float */;
inline bool i_dComIfGp_checkPlayerStatus1(int param_0, u32 flag) {
return g_dComIfG_gameInfo.play.checkPlayerStatus(param_0, 1, flag);
}
inline bool dComIfGp_checkPlayerStatus0(int param_0, u32 param_1) {
return g_dComIfG_gameInfo.play.checkPlayerStatus(param_0, 0, param_1);
}
inline void dComIfGp_setItemLifeCount(float amount, u8 type) {
g_dComIfG_gameInfo.play.setItemLifeCount(amount, type);
}
/* 8021FD60-80220180 21A6A0 0420+00 1/1 0/0 0/0 .text moveLife__9dMeter2_cFv */
// small type issue
#ifdef NONMATCHING
void dMeter2_c::moveLife() {
s16 life_count = 0;
bool setDraw = false;
s16 temp_r5 = dComIfGp_getItemMaxLifeCount();
if (temp_r5 != 0) {
s16 max_count = dComIfGs_getMaxLife() + dComIfGp_getItemMaxLifeCount();
if (max_count > 100) {
max_count = 100;
} else {
if (max_count < 15) {
max_count = 15;
}
}
life_count = (max_count / 5) * 4;
dComIfGs_setMaxLife(max_count);
s16 current_life = life_count - dComIfGs_getLife();
dComIfGp_setItemLifeCount(current_life, 0);
dComIfGp_clearItemMaxLifeCount();
setDraw = true;
}
f32 item_life_count = dComIfGp_getItemLifeCount();
if (item_life_count != FLOAT_LABEL(lit_4662)) {
field_0x1ee = dComIfGp_getItemLifeCountType();
if (!setDraw) {
life_count = (dComIfGs_getMaxLife() / 5) * 4;
}
s16 tmp = dComIfGs_getLife() + dComIfGp_getItemLifeCount();
if (tmp > life_count) {
tmp = life_count;
} else if (tmp < 0) {
tmp = 0;
}
dComIfGs_setLife((u8)tmp);
dComIfGp_clearItemLifeCount();
// extsh instead of mr
if (mNowLifeGauge == tmp && field_0x1ee != 0) {
field_0x1ee = 0;
}
setDraw = true;
}
u16 max_life = dComIfGs_getMaxLife();
if (mMaxLife != max_life) {
if (mMaxLife < max_life) {
mMaxLife++;
dMeter2Info_onLifeGaugeSE();
setDraw = true;
} else if (mMaxLife > max_life) {
mMaxLife--;
setDraw = true;
}
}
u16 current_life = dComIfGs_getLife();
if (mNowLifeGauge != current_life) {
if (mNowLifeGauge < current_life) {
mNowLifeGauge++;
if (i_dComIfGp_checkPlayerStatus1(0, 0x2000) ||
dComIfGp_checkPlayerStatus0(0, 0x20000000) || dMeter2Info_getLifeGaugeSE()) {
if (mNowLifeGauge % 4 == 0) {
mDoAud_seStart(Z2SE_HP_GAUGE_INC, 0, 0, 0);
}
} else {
if (field_0x1ee == 1) {
mDoAud_seStart(Z2SE_HP_GAUGE_INC, 0, 0, 0);
}
}
u16 life = dComIfGs_getLife();
if (mNowLifeGauge == life && field_0x1ee != 0) {
field_0x1ee = 0;
}
setDraw = true;
} else if (mNowLifeGauge > current_life) {
mNowLifeGauge--;
if (field_0x1ee != 0) {
field_0x1ee = 0;
}
setDraw = true;
}
} else {
if (dMeter2Info_getLifeGaugeSE()) {
dMeter2Info_offLifeGaugeSE();
}
}
f32 life_gauge_x = g_drawHIO.mLifeGaugePosX;
f32 life_gauge_y = g_drawHIO.mLifeGaugePosY;
if (field_0x204 != g_drawHIO.mLifeGaugePosX) {
field_0x204 = g_drawHIO.mLifeGaugePosX;
setDraw = true;
}
if (field_0x208 != g_drawHIO.mLifeGaugePosY) {
field_0x208 = g_drawHIO.mLifeGaugePosY;
setDraw = true;
}
if (field_0x20c != g_drawHIO.mLifeGaugeScale) {
field_0x20c = g_drawHIO.mLifeGaugeScale;
setDraw = true;
}
if (field_0x210 != g_drawHIO.mHeartScale) {
field_0x210 = g_drawHIO.mHeartScale;
setDraw = true;
}
if (field_0x214 != g_drawHIO.mLargeHeartScale) {
field_0x214 = g_drawHIO.mLargeHeartScale;
setDraw = true;
}
if (setDraw == true) {
mpMeterDraw->drawLife(mMaxLife, mNowLifeGauge, life_gauge_x, life_gauge_y);
}
alphaAnimeLife();
dComIfGp_setItemNowLife((u8)mNowLifeGauge);
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -714,6 +893,7 @@ asm void dMeter2_c::moveLife() {
#include "asm/d/meter/d_meter2/moveLife__9dMeter2_cFv.s"
}
#pragma pop
#endif
/* ############################################################################################## */
/* 804549E8-804549EC 002FE8 0004+00 4/4 0/0 0/0 .sdata2 @5791 */
@@ -835,24 +1015,46 @@ asm void dMeter2_c::moveButton3D() {
#pragma pop
/* 80222364-80222494 21CCA4 0130+00 1/1 0/0 0/0 .text moveButtonC__9dMeter2_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dMeter2_c::moveButtonC() {
nofralloc
#include "asm/d/meter/d_meter2/moveButtonC__9dMeter2_cFv.s"
void dMeter2_c::moveButtonC() {
if (dComIfGp_getCStickStatusForce()) {
u8 setFlag = dComIfGp_getCStickSetFlagForce();
u8 dirForce = dComIfGp_getCStickDirectionForce();
u8 statusForce = dComIfGp_getCStickStatusForce();
dComIfGp_setCStickStatus(statusForce, dirForce, setFlag);
dComIfGp_setCStickStatusForce(0, 0, 0);
}
if (mCStickStatus == dComIfGp_getCStickStatus() &&
field_0x1ac == dMeter2Info_isUseButton(0x10)) {
if ((!mpMeterDraw->isEmphasisC() || dComIfGp_isCStickSetFlag(2)) &&
(mpMeterDraw->isEmphasisC() || !dComIfGp_isCStickSetFlag(2)) &&
field_0x19a == mpMeterDraw->getButtonTimer()) {
return;
}
}
field_0x19a = mpMeterDraw->getButtonTimer();
mCStickStatus = dComIfGp_getCStickStatus();
field_0x1ac = dMeter2Info_isUseButton(0x10);
mpMeterDraw->drawButtonC(mCStickStatus, field_0x128 == 0);
}
#pragma pop
/* 80222494-80222518 21CDD4 0084+00 1/1 0/0 0/0 .text moveButtonS__9dMeter2_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dMeter2_c::moveButtonS() {
nofralloc
#include "asm/d/meter/d_meter2/moveButtonS__9dMeter2_cFv.s"
void dMeter2_c::moveButtonS() {
if (dComIfGp_getSButtonStatusForce()) {
u8 setFlag = dComIfGp_getSButtonSetFlagForce();
u8 statusForce = dComIfGp_getSButtonStatusForce();
dComIfGp_setSButtonStatus(statusForce, setFlag);
dComIfGp_setSButtonStatusForce(0, 0);
} else {
dComIfGp_setSButtonStatus(0, 0);
}
if (mSButtonStatus != dComIfGp_getSButtonStatus()) {
mSButtonStatus = dComIfGp_getSButtonStatus();
mpMeterDraw->drawButtonS(mSButtonStatus);
}
}
#pragma pop
/* 80222518-80222E88 21CE58 0970+00 1/1 0/0 0/0 .text moveButtonXY__9dMeter2_cFv */
#pragma push
@@ -887,14 +1089,25 @@ void dMeter2_c::moveTouchSubMenu() {
}
/* 802230FC-802231C8 21DA3C 00CC+00 1/1 0/0 0/0 .text moveSubContents__9dMeter2_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dMeter2_c::moveSubContents() {
nofralloc
#include "asm/d/meter/d_meter2/moveSubContents__9dMeter2_cFv.s"
void dMeter2_c::moveSubContents() {
JKRHeap* heap = mDoExt_setCurrentHeap(mpSubHeap);
checkSubContents();
if (mpMeterSub != NULL) {
mpMeterSub->_execute(field_0x124);
}
if (mpMeterString != NULL) {
if (mSubContents == 5 && mSubContentsStringType != dMeter2Info_getMeterStringType()) {
mSubContentsStringType = dMeter2Info_getMeterStringType();
if (mSubContentsStringType != 0) {
mpMeterString->createString(mSubContentsStringType);
}
}
mpMeterString->_execute(field_0x124);
}
mDoExt_setCurrentHeap(heap);
}
#pragma pop
/* 802231C8-802237D4 21DB08 060C+00 1/1 0/0 0/0 .text move2DContents__9dMeter2_cFv */
#pragma push
@@ -964,6 +1177,68 @@ asm void dMeter2_c::moveArrowNum() {
#pragma pop
/* 80224680-802248E4 21EFC0 0264+00 1/1 0/0 0/0 .text movePachinkoNum__9dMeter2_cFv */
// matches with literals
#ifdef NONMATCHING
void dMeter2_c::movePachinkoNum() {
if (g_mwHIO.getPachinkoFlag()) {
if (dComIfGs_getPachinkoNum() != dComIfGs_getPachinkoMax()) {
u8 max = dComIfGs_getPachinkoMax();
dComIfGp_setItemPachinkoNumCount(max);
}
if (dComIfGp_getItemPachinkoNumCount() < 0) {
dComIfGp_clearItemPachinkoNumCount();
}
}
if (dComIfGp_getItemPachinkoNumCount() == 0 && mItemMaxNum[3] == dComIfGs_getPachinkoMax() &&
mPachinkoNum == dComIfGs_getPachinkoNum()) {
return;
}
s16 pachinko_num = dComIfGs_getPachinkoNum() + dComIfGp_getItemPachinkoNumCount();
dComIfGp_clearItemPachinkoNumCount();
if (pachinko_num < 0) {
pachinko_num = 0;
}
if (dComIfGs_getPachinkoMax() < pachinko_num) {
pachinko_num = dComIfGs_getPachinkoMax();
}
dComIfGs_setPachinkoNum(pachinko_num);
mItemMaxNum[3] = dComIfGs_getPachinkoMax();
if (mPachinkoNum < dComIfGs_getPachinkoNum()) {
mPachinkoNum++;
onArrowSoundBit(2);
if (isArrowSoundBit(2)) {
if (mPachinkoNum != dComIfGs_getPachinkoNum()) {
if (!isArrowSoundBit(0) && isPachinkoEquip() && mpMeterDraw->isButtonVisible()) {
onArrowSoundBit(0);
mDoAud_seStart(Z2SE_CONSUM_INC_CNT_1, 0, 0, 0);
} else {
offArrowSoundBit(0);
}
} else {
if (isPachinkoEquip() && mpMeterDraw->isButtonVisible()) {
mDoAud_seStart(Z2SE_CONSUM_INC_CNT_2, 0, 0, 0);
}
offArrowSoundBit(2);
offArrowSoundBit(0);
}
}
} else if (mPachinkoNum > dComIfGs_getPachinkoNum()) {
mPachinkoNum--;
}
for (int i = 0; i < 2; i++) {
if (mItemStatus[i * 2] == PACHINKO) {
mpMeterDraw->setItemNum(i, mPachinkoNum, dComIfGs_getPachinkoMax());
}
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -972,6 +1247,7 @@ asm void dMeter2_c::movePachinkoNum() {
#include "asm/d/meter/d_meter2/movePachinkoNum__9dMeter2_cFv.s"
}
#pragma pop
#endif
/* 802248E4-80224A04 21F224 0120+00 1/1 0/0 0/0 .text alphaAnimeLife__9dMeter2_cFv */
#pragma push
@@ -1075,25 +1351,65 @@ asm void dMeter2_c::alphaAnimeButtonCross() {
}
#pragma pop
/* 802256DC-802258A0 22001C 01C4+00 3/3 0/0 0/0 .text isShowLightDrop__9dMeter2_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dMeter2_c::isShowLightDrop() {
nofralloc
#include "asm/d/meter/d_meter2/isShowLightDrop__9dMeter2_cFv.s"
inline daPy_py_c* daPy_getPlayerActorClass() {
return (daPy_py_c*)dComIfGp_getPlayer(0);
}
inline u16 dComIfGp_event_checkHind(u16 flag) {
if (!dComIfGp_event_runCheck()) {
return false;
}
return g_dComIfG_gameInfo.play.getEvent().checkHind(flag);
}
/* 802256DC-802258A0 22001C 01C4+00 3/3 0/0 0/0 .text isShowLightDrop__9dMeter2_cFv */
bool dMeter2_c::isShowLightDrop() {
if (!g_drawHIO.mLightDrop.mAnimDebug) {
if ((field_0x124 & 0x4000) ||
!dComIfGs_isLightDropGetFlag(dComIfGp_getStartStageDarkArea()) ||
dMeter2Info_getLightDropGetFlag(dComIfGp_getStartStageDarkArea()) <= 1 ||
!dKy_darkworld_check() || ((field_0x124 & 0x40) && dComIfGp_event_checkHind(0x200)) ||
daPy_getPlayerActorClass()->i_getSumouMode() ||
(daPy_getPlayerActorClass()->checkCanoeSlider() &&
(dComIfG_getTimerMode() == 3 || dComIfG_getTimerMode() == 4)) ||
(field_0x124 & 0x40000000) || (field_0x124 & 0x00001000) ||
(field_0x124 & 0x00100000) || (field_0x124 & 0x80000000) ||
(field_0x124 & 0x00000100) || (field_0x124 & 0x00000080) ||
(field_0x124 & 0x00000008) || (field_0x124 & 0x00000010) ||
(field_0x124 & 0x01000000) || (field_0x124 & 0x00000020) ||
(field_0x124 & 0x04000000) || (field_0x124 & 0x08000000) ||
(field_0x124 & 0x10000000) || dMeter2Info_isSub2DStatus(1)) {
return false;
}
}
return true;
}
#pragma pop
/* 802258A0-80225960 2201E0 00C0+00 1/1 0/0 0/0 .text killSubContents__9dMeter2_cFUc */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dMeter2_c::killSubContents(u8 param_0) {
nofralloc
#include "asm/d/meter/d_meter2/killSubContents__9dMeter2_cFUc.s"
void dMeter2_c::killSubContents(u8 param_0) {
if (mSubContents != param_0 && mSubContents != 0) {
bool free = false;
if (mpMeterSub != NULL) {
delete mpMeterSub;
mpMeterSub = NULL;
free = true;
}
if (mpMeterString != NULL) {
delete mpMeterString;
mpMeterString = NULL;
free = true;
}
if (free) {
mpSubHeap->freeAll();
}
mSubContents = 0;
mSubContentsStringType = 0;
}
}
#pragma pop
/* 80225960-802259F8 2202A0 0098+00 1/1 0/0 0/0 .text isKeyVisible__9dMeter2_cFv */
#pragma push
@@ -1106,24 +1422,27 @@ asm void dMeter2_c::isKeyVisible() {
#pragma pop
/* 802259F8-80225A64 220338 006C+00 2/2 0/0 0/0 .text isArrowEquip__9dMeter2_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dMeter2_c::isArrowEquip() {
nofralloc
#include "asm/d/meter/d_meter2/isArrowEquip__9dMeter2_cFv.s"
int dMeter2_c::isArrowEquip() {
for (int i = 0; i < 2; i++) {
if (mItemStatus[i * 2] == BOW || mItemStatus[i * 2] == LIGHT_ARROW ||
mItemStatus[i * 2] == ARROW_LV1 || mItemStatus[i * 2] == ARROW_LV2 ||
mItemStatus[i * 2] == ARROW_LV3 || mItemStatus[i * 2] == HAWK_ARROW ||
mItemStatus[i * 2] == BOMB_ARROW) {
return i + 1;
}
}
return 0;
}
#pragma pop
/* 80225A64-80225AA0 2203A4 003C+00 2/2 0/0 0/0 .text isPachinkoEquip__9dMeter2_cFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void dMeter2_c::isPachinkoEquip() {
nofralloc
#include "asm/d/meter/d_meter2/isPachinkoEquip__9dMeter2_cFv.s"
int dMeter2_c::isPachinkoEquip() {
for (int i = 0; i < 2; i++) {
if (mItemStatus[i * 2] == PACHINKO) {
return i + 1;
}
}
return 0;
}
#pragma pop
/* 80225AA0-80225AC0 2203E0 0020+00 1/0 0/0 0/0 .text dMeter2_Draw__FP9dMeter2_c */
static int dMeter2_Draw(dMeter2_c* p_meter) {
@@ -1146,28 +1465,37 @@ static int dMeter2_Delete(dMeter2_c* p_meter) {
}
/* 80225B08-80225BB8 220448 00B0+00 1/0 0/0 0/0 .text dMeter2_Create__FP9msg_class */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm int dMeter2_Create(msg_class* param_0) {
nofralloc
#include "asm/d/meter/d_meter2/dMeter2_Create__FP9msg_class.s"
static int dMeter2_Create(msg_class* meter) {
dMeter2Info_setMeterClass(static_cast<dMeter2_c*>(meter));
dComIfGp_2dShowOn();
fopMsgM_Create(0x314, NULL, NULL);
g_drawHIO.field_0x4 = -1;
g_ringHIO.field_0x4 = -1;
g_fmapHIO.field_0x4 = -1;
g_cursorHIO.field_0x4 = -1;
u32 id = fopMsgM_Create(0x313, NULL, NULL);
fopMsgM_setMessageID(id);
dTimer_createStockTimer();
fopMsgM_setStageLayer(meter);
return static_cast<dMeter2_c*>(meter)->_create();
}
#pragma pop
/* ############################################################################################## */
/* 803BFA54-803BFA68 -00001 0014+00 1/0 0/0 0/0 .data l_dMeter2_Method */
SECTION_DATA static dMeter2_Method l_dMeter2_Method[5] = {
(dMeter2_Method)dMeter2_Create, dMeter2_Delete, dMeter2_Execute, dMeter2_IsDelete, dMeter2_Draw,
SECTION_DATA static leafdraw_method_class l_dMeter2_Method = {
(process_method_func)dMeter2_Create, (process_method_func)dMeter2_Delete,
(process_method_func)dMeter2_Execute, (process_method_func)dMeter2_IsDelete,
(process_method_func)dMeter2_Draw,
};
/* 803BFA68-803BFA90 -00001 0028+00 0/0 0/0 1/0 .data g_profile_METER2 */
SECTION_DATA extern void* g_profile_METER2[10] = {
(void*)0xFFFFFFFD, (void*)0x000CFFFD,
(void*)0x03160000, (void*)&g_fpcLf_Method,
(void*)0x000004C0, (void*)NULL,
(void*)NULL, (void*)&g_fopMsg_Method,
(void*)0x03010000, (void*)&l_dMeter2_Method,
};
SECTION_DATA extern leaf_process_profile_definition g_profile_METER2 = {
-3, 12,
-3, 0x0316,
0, (process_method_class*)&g_fpcLf_Method,
0x4C0, 0,
0, &g_fopMsg_Method,
0x0301, 0,
0, &l_dMeter2_Method};
/* 80399338-80399338 025998 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-1
View File
@@ -429,7 +429,6 @@ extern "C" void _restgpr_28();
extern "C" void _restgpr_29();
extern "C" u8 const tempBitLabels__20dSv_event_tmp_flag_c[370 + 2 /* padding */];
extern "C" extern void* g_fopMsg_Method[5 + 1 /* padding */];
extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */];
extern "C" u8 saveBitLabels__16dSv_event_flag_c[1644 + 4 /* padding */];
extern "C" u8 m_cpadInfo__8mDoCPd_c[256];
extern "C" extern u8 data_80450B70[4];
+1 -2
View File
@@ -1408,8 +1408,7 @@ asm void dPa_control_c::level_c::emitter_c::entry(u32 param_0, u16 param_1, JPAB
/* ############################################################################################## */
/* 80450EC4-80450EC8 0003C4 0004+00 1/1 2/2 0/0 .sbss None */
extern u8 data_80450EC4[4];
u8 data_80450EC4[4];
u8 data_80450EC4;
/* 80450EC8-80450ED0 0003C8 0004+04 2/2 1/1 17/17 .sbss mParticleTracePCB__13dPa_control_c */
u8 dPa_control_c::mParticleTracePCB[4 + 4 /* padding */];
+426 -456
View File
File diff suppressed because it is too large Load Diff
+14 -82
View File
@@ -4,89 +4,27 @@
//
#include "d/s/d_s_room.h"
#include "d/com/d_com_inf_game.h"
#include "dol2asm.h"
#include "dolphin/types.h"
#include "f_op/f_op_scene.h"
//
// Types:
//
struct scene_class {};
struct room_of_scene_class {};
struct request_of_phase_process_class {};
struct mDoRst {
static u8 mResetData[4 + 4 /* padding */];
};
struct layer_class {};
struct dSv_zoneBit_c {
/* 80034CEC */ void clearRoomSwitch();
/* 80034CF8 */ void clearRoomItem();
};
struct dSv_info_c {
/* 800351A4 */ void createZone(int);
};
struct dStage_roomControl_c {
/* 80024384 */ void getStatusRoomDt(int);
/* 800243B0 */ void getMemoryBlock(int);
/* 8002490C */ void setArcBank(int, char const*);
/* 80024940 */ void getArcBank(int);
/* 80024954 */ void resetArchiveBank(int);
/* 8002D9B0 */ void getZoneNo(int);
/* 8025BAAC */ void setZoneNo(int, int);
static u8 mStatus[65792];
static u8 mDemoArcName[10 + 2 /* padding */];
static u8 mArcBankName[4];
static u8 mArcBankData[4];
};
struct dStage_dt_c {};
struct dRes_info_c {};
struct JKRHeap {
/* 802CE5CC */ void freeAll();
};
struct dRes_control_c {
/* 8003C078 */ void setRes(char const*, dRes_info_c*, int, char const*, u8, JKRHeap*);
/* 8003C160 */ void syncRes(char const*, dRes_info_c*, int);
/* 8003C194 */ void deleteRes(char const*, dRes_info_c*, int);
/* 8003C37C */ void getRes(char const*, char const*, dRes_info_c*, int);
/* 8003C5BC */ void setStageRes(char const*, JKRHeap*);
};
struct dPa_control_c {
struct level_c {
/* 8004B8E8 */ void allForceOnEventMove();
};
};
struct dEvent_manager_c {
/* 80046888 */ void demoInit();
/* 80046904 */ void roomInit(int);
/* 800469EC */ void roomFinish(int);
};
struct dComIfG_play_c {
/* 8002C97C */ void getLayerNo(int);
};
struct csXyz {};
struct create_tag {};
struct cXyz {};
struct JKRExpHeap {
/* 802CFD64 */ void getTotalUsedSize() const;
class room_of_scene_class : public process_node_class {
public:
/* 0x1AC */ process_method_class* mpProcessMtd;
/* 0x1B0 */ scene_tag_class* field_0x1b0;
/* 0x1B4 */ u8 field_0x1b4[0x10];
/* 0x1C4 */ request_of_phase_process_class field_0x1c4;
/* 0x1CC */ void* field_0x1cc;
/* 0x1D0 */ dStage_roomDt_c* field_0x1d0;
/* 0x1D4 */ s8 field_0x1d4;
/* 0x1D5 */ s8 field_0x1d5;
/* 0x1D6 */ u8 field_0x1d6[2];
/* 0x1D8 */ u8 field_0x1d8;
};
//
@@ -121,7 +59,6 @@ extern "C" extern void* g_profile_ROOM_SCENE[10];
// External References:
//
extern "C" void OSReport_Error();
extern "C" void mDoExt_getArchiveHeap__Fv();
extern "C" void mDoExt_setCurrentHeap__FP7JKRHeap();
extern "C" void fopAc_IsActor__FPv();
@@ -165,17 +102,12 @@ extern "C" void _restgpr_25();
extern "C" void _restgpr_27();
extern "C" void _restgpr_28();
extern "C" void _restgpr_29();
extern "C" void sprintf();
extern "C" void strcmp();
extern "C" void strnicmp();
extern "C" extern void* g_fopScn_Method[5 + 1 /* padding */];
extern "C" extern void* g_fpcNd_Method[5 + 1 /* padding */];
extern "C" u8 mStatus__20dStage_roomControl_c[65792];
extern "C" u8 mDemoArcName__20dStage_roomControl_c[10 + 2 /* padding */];
extern "C" extern u8 g_dComIfG_gameInfo[122384];
extern "C" u8 mResetData__6mDoRst[4 + 4 /* padding */];
extern "C" extern u8 g_fpcNd_type[4 + 4 /* padding */];
extern "C" extern u8 struct_80450D64[4];
extern "C" u8 mArcBankName__20dStage_roomControl_c[4];
extern "C" u8 mArcBankData__20dStage_roomControl_c[4];
extern "C" extern u8 struct_80451124[4];
+38 -49
View File
@@ -1819,61 +1819,55 @@ SECTION_DEAD static char const* const stringBase_8037926C = "SAVE size:%d\n";
#pragma pop
/* 80035798-80035A04 0300D8 026C+00 0/0 1/1 0/0 .text memory_to_card__10dSv_info_cFPci */
// few wrong instructions, lots of regalloc issues
// lots of regalloc issues
#ifdef NONMATCHING
int dSv_info_c::memory_to_card(char* param_0, int param_1) {
BOOL bVar1 = FALSE;
u32 unaff27;
int unaff23;
int unkr27 = 0;
int dSv_info_c::memory_to_card(char* card_ptr, int data_num) {
bool lantern_not_recovered = false;
s32 lantern_stolen;
s32 lantern_dropped;
bool phi_r30 = false;
u16 current_lantern_oil = 0;
if (!dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[226])) {
unaff27 = dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[224]);
unaff23 = dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[225]);
lantern_stolen = dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[224]);
lantern_dropped = dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[225]);
dComIfGs_offEventBit(dSv_event_flag_c::saveBitLabels[224]);
dComIfGs_offEventBit(dSv_event_flag_c::saveBitLabels[225]);
unkr27 = 1;
lantern_not_recovered = true;
}
if (dComIfGs_isItemFirstBit(KANTERA) && dComIfGs_getItem(1, 1) == 0xFF) {
if (dComIfGs_isItemFirstBit(KANTERA) && dComIfGs_getItem(SLOT_1, 1) == NO_ITEM) {
dComIfGs_setItem(SLOT_1, KANTERA);
current_lantern_oil = dComIfGs_getOil();
u16 oil_gauge_backup = dMeter2Info_getOilGaugeBackUp();
dComIfGs_setOil(oil_gauge_backup);
bVar1 = TRUE;
dComIfGs_setOil(dMeter2Info_getOilGaugeBackUp());
phi_r30 = true;
}
char* ptr = param_0 + param_1 * 0xa94;
char* save_ptr = card_ptr + (data_num * 0xA94); // 0xA94 = Quest Log size
dSv_save_c* savedata = dComIfGs_getSaveData();
// weird time stuff going on here. not really sure about any of it
s64 start_time = dComIfGs_getSaveStartTime();
s64 new_time = OSGetTime() - start_time;
// new_time = 0;
s64 ivar7 = new_time + start_time;
s64 play_time = (OSGetTime() - dComIfGs_getSaveStartTime());
s64 total_time = (play_time + dComIfGs_getSaveTotalTime()) / (OS_BUS_CLOCK / 4);
s64 total_time = dComIfGs_getSaveTotalTime();
new_time += total_time;
if (new_time < start_time) {
g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().setTotalTime(new_time);
// 3599940 = 999:59 in seconds
if (total_time < 3599940) {
savedata->getPlayer().getPlayerInfo().setTotalTime(total_time);
}
savedata->getPlayer().getPlayerStatusB().setDateIpl(OSGetTime());
s64 tmp = OSGetTime();
g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().setDateIpl(tmp);
memcpy(ptr, &g_dComIfG_gameInfo, sizeof(dSv_save_c));
memcpy(save_ptr, savedata, sizeof(dSv_save_c));
printf("Write size:%d\n", sizeof(dSv_save_c));
if ((u8)unkr27 == 1) {
if (unaff27) {
if (lantern_not_recovered == true) {
if (lantern_stolen) {
dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[224]);
}
if ((u8)unaff23 != 0) {
if (lantern_dropped) {
dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[225]);
}
}
if (!bVar1) {
if (phi_r30 == true) {
dComIfGs_setItem(SLOT_1, NO_ITEM);
dComIfGs_setOil(current_lantern_oil);
}
@@ -1900,29 +1894,24 @@ SECTION_DEAD static char const* const stringBase_8037927A = "LOAD size:%d\n";
#pragma pop
/* 80035A04-80035BD0 030344 01CC+00 0/0 2/2 0/0 .text card_to_memory__10dSv_info_cFPci */
// close, some instructions out of order / regalloc
// memcpy param loads out of order
#ifdef NONMATCHING
int dSv_info_c::card_to_memory(char* param_0, int param_1) {
char* ptr = param_0 + param_1 * 0xa94;
dSv_save_c* tmp = &g_dComIfG_gameInfo.info.getSavedata();
memcpy(tmp, ptr, sizeof(dSv_save_c));
memcpy(dComIfGs_getSaveData(), param_0 + param_1 * 0xa94, sizeof(dSv_save_c));
if (!OSGetSoundMode()) {
if (OSGetSoundMode() == SOUND_MODE_MONO) {
g_dComIfG_gameInfo.info.getPlayer().getConfig().setSound(SOUND_MODE_MONO);
Z2AudioMgr::mAudioMgrPtr->setOutputMode(SOUND_MODE_MONO);
} else if (g_dComIfG_gameInfo.info.getPlayer().getConfig().getSound() == 2) {
Z2AudioMgr::mAudioMgrPtr->setOutputMode(2);
} else {
u8 save_sound = g_dComIfG_gameInfo.info.getPlayer().getConfig().getSound();
if (save_sound == 2) {
Z2AudioMgr::mAudioMgrPtr->setOutputMode(2);
} else {
g_dComIfG_gameInfo.info.getPlayer().getConfig().setSound(SOUND_MODE_STEREO);
Z2AudioMgr::mAudioMgrPtr->setOutputMode(SOUND_MODE_STEREO);
}
g_dComIfG_gameInfo.info.getPlayer().getConfig().setSound(SOUND_MODE_STEREO);
Z2AudioMgr::mAudioMgrPtr->setOutputMode(SOUND_MODE_STEREO);
}
if (dComIfGs_getSaveData().getPlayer().getPlayerStatusA().getLife() < 12) {
dComIfGs_setLife(12);
dSv_save_c* savedata = dComIfGs_getSaveData();
if (savedata->getPlayer().getPlayerStatusA().getLife() < 12) {
savedata->getPlayer().getPlayerStatusA().setLife(12);
}
dComIfGs_setKeyNum(6, 0);
@@ -1932,16 +1921,16 @@ int dSv_info_c::card_to_memory(char* param_0, int param_1) {
dComIfGs_setItem(SLOT_9, NO_ITEM);
}
if (dComIfGs_getItem(SLOT_9, 1) == HOOKSHOT && dComIfGs_getItem(SLOT_9, 1) == W_HOOKSHOT) {
if (dComIfGs_getItem(SLOT_9, 1) == HOOKSHOT && dComIfGs_getItem(SLOT_10, 1) == W_HOOKSHOT) {
dComIfGs_setItem(SLOT_9, NO_ITEM);
}
dComIfGs_setLineUpItem();
u8 save_vibration = dComIfGs_getSaveData().getPlayer().getConfig().getVibration();
u8 save_vibration = savedata->getPlayer().getConfig().getVibration();
dComIfGp_setNowVibration(save_vibration);
char* save_stage = dComIfGs_getSaveData().getPlayer().getPlayerReturnPlace().getName();
char* save_stage = g_dComIfG_gameInfo.info.getPlayer().getPlayerReturnPlace().getName();
dMeter2Info_setSaveStageName(save_stage);
printf("LOAD size:%d\n", sizeof(dSv_save_c));
+7 -26
View File
@@ -7,18 +7,6 @@
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct process_method_class {};
struct leafdraw_method_class {};
struct leafdraw_class {};
struct create_tag_class {};
//
// Forward References:
//
@@ -28,7 +16,6 @@ extern "C" static void fopMsg_Execute__FPv();
extern "C" static void fopMsg_IsDelete__FPv();
extern "C" static void fopMsg_Delete__FPv();
extern "C" static void fopMsg_Create__FPv();
extern "C" extern void* g_fopMsg_Method[5 + 1 /* padding */];
//
// External References:
@@ -55,7 +42,7 @@ extern "C" extern u8 struct_80451124[4];
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void fopMsg_Draw(void* param_0) {
static asm int fopMsg_Draw(void* param_0) {
nofralloc
#include "asm/f_op/f_op_msg/fopMsg_Draw__FPv.s"
}
@@ -65,7 +52,7 @@ static asm void fopMsg_Draw(void* param_0) {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void fopMsg_Execute(void* param_0) {
static asm int fopMsg_Execute(void* param_0) {
nofralloc
#include "asm/f_op/f_op_msg/fopMsg_Execute__FPv.s"
}
@@ -75,7 +62,7 @@ static asm void fopMsg_Execute(void* param_0) {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void fopMsg_IsDelete(void* param_0) {
static asm int fopMsg_IsDelete(void* param_0) {
nofralloc
#include "asm/f_op/f_op_msg/fopMsg_IsDelete__FPv.s"
}
@@ -85,7 +72,7 @@ static asm void fopMsg_IsDelete(void* param_0) {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void fopMsg_Delete(void* param_0) {
static asm int fopMsg_Delete(void* param_0) {
nofralloc
#include "asm/f_op/f_op_msg/fopMsg_Delete__FPv.s"
}
@@ -99,7 +86,7 @@ static u8 fopMsg_MSG_TYPE[4 + 4 /* padding */];
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void fopMsg_Create(void* param_0) {
static asm int fopMsg_Create(void* param_0) {
nofralloc
#include "asm/f_op/f_op_msg/fopMsg_Create__FPv.s"
}
@@ -107,12 +94,6 @@ static asm void fopMsg_Create(void* param_0) {
/* ############################################################################################## */
/* 803A3958-803A3970 -00001 0014+04 0/0 5/0 0/0 .data g_fopMsg_Method */
SECTION_DATA extern void* g_fopMsg_Method[5 + 1 /* padding */] = {
(void*)fopMsg_Create__FPv,
(void*)fopMsg_Delete__FPv,
(void*)fopMsg_Execute__FPv,
(void*)fopMsg_IsDelete__FPv,
(void*)fopMsg_Draw__FPv,
/* padding */
NULL,
SECTION_DATA extern leafdraw_method_class g_fopMsg_Method = {
&fopMsg_Create, &fopMsg_Delete, &fopMsg_Execute, &fopMsg_IsDelete, &fopMsg_Draw,
};
+2 -12
View File
@@ -3,7 +3,7 @@
// Translation Unit: f_op/f_op_msg_mng
//
// #include "f_op/f_op_msg_mng.h"
#include "f_op/f_op_msg_mng.h"
#include "JSystem/J2DGraph/J2DPane.h"
#include "dol2asm.h"
#include "dolphin/types.h"
@@ -12,12 +12,6 @@
// Types:
//
struct process_priority_class {};
struct layer_class {};
struct fopAc_ac_c {};
struct dStage_roomControl_c {
static u8 mProcID[4];
};
@@ -48,10 +42,6 @@ struct JMath {
static u8 sincosTable_[65536];
};
struct JKRExpHeap {
/* 802CEE2C */ void create(u32, JKRHeap*, bool);
};
struct J2DPicture {
/* 800202CC */ void setBlendRatio(f32, f32);
/* 80020338 */ void append(char const*, f32);
@@ -283,7 +273,7 @@ asm void fopMsgM_setMessageID(unsigned int param_0) {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void fopMsgM_Create(s16 param_0, int (*param_1)(void*), void* param_2) {
asm u32 fopMsgM_Create(s16 param_0, int (*param_1)(void*), void* param_2) {
nofralloc
#include "asm/f_op/f_op_msg_mng/fopMsgM_Create__FsPFPv_iPv.s"
}
+1 -1
View File
@@ -27,7 +27,7 @@ int fopScnPause_Enable(scene_class* pScene) {
/* 80020594-8002064C 01AED4 00B8+00 0/0 2/2 0/0 .text fopScnPause_Disable__FP11scene_class */
int fopScnPause_Disable(scene_class* pScene) {
if (pScene) {
void* tmp = (void*)pScene->field_0x2C[6];
void* tmp = (void*)pScene->field_0x0.mLyTg.mpLayer->mpPcNode;
if (!tmp) {
fpcM_PauseDisable(pScene, 1);
+1 -1
View File
@@ -78,7 +78,7 @@ static void fopScnRq_Execute(scene_request_class* pScnRq) {
static int fopScnRq_PostMethod(void* param_1, scene_request_class* pScnRq) {
if (pScnRq->mFadeRequest) {
fopScnPause_Enable((scene_class*)param_1);
fopOvlpM_ToldAboutID(((scene_class*)param_1)->field_0x04);
fopOvlpM_ToldAboutID(((scene_class*)param_1)->field_0x0.mBsPcId);
}
return 1;
}
+1 -1
View File
@@ -85,7 +85,7 @@ base_process_class* fpcBs_Create(s16 pProcTypeID, unsigned int pProcID, void* pD
base_process_class* procClass;
u32 size;
procProfDef = fpcPf_Get(pProcTypeID);
procProfDef = (process_profile_definition*)fpcPf_Get(pProcTypeID);
size = procProfDef->mSize + procProfDef->mSizeOther;
procClass = (base_process_class*)cMl::memalignB(-4, size);
if (procClass == NULL) {
+1 -3
View File
@@ -179,6 +179,4 @@ s32 fpcPi_Init(process_priority_class* pPi, void* pUserData, unsigned int layer,
/* ############################################################################################## */
/* 804505F0-804505F8 0008+00 s=0 e=5 z=1 None .sdata None */
SECTION_SDATA u8 data_804505F0[8] = {
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
SECTION_SDATA s8 data_804505F0 = 0xFF;
+2 -2
View File
@@ -9,9 +9,9 @@
/* ############################################################################################## */
/* 80450D50-80450D58 0004+04 s=1 e=0 z=2 None .sbss g_fpcPf_ProfileList_p */
process_profile_definition** g_fpcPf_ProfileList_p;
leaf_process_profile_definition** g_fpcPf_ProfileList_p;
/* 80023564-80023578 0014+00 s=0 e=1 z=0 None .text fpcPf_Get__Fs */
process_profile_definition* fpcPf_Get(s16 profileID) {
leaf_process_profile_definition* fpcPf_Get(s16 profileID) {
return g_fpcPf_ProfileList_p[profileID];
}
+1 -1
View File
@@ -237,7 +237,7 @@ u8 struct_80450BE4;
#pragma force_active on
static bool data_80450BE5;
static u8 data_80450BE6;
u8 data_80450BE6;
static bool data_80450BE7;
#pragma pop