Decompile gsetGetNoiseSettings
This commit is contained in:
parent
d6cccc48ae
commit
6d34869161
|
|
@ -8500,29 +8500,29 @@ void bgunDecreaseNoiseRadius(void)
|
|||
{
|
||||
struct player *player = g_Vars.currentplayer;
|
||||
f32 consideramount;
|
||||
struct gset shortleft;
|
||||
struct gset shortright;
|
||||
f32 sp3c[5];
|
||||
f32 sp28[5];
|
||||
struct gset gsetleft;
|
||||
struct gset gsetright;
|
||||
struct noisesettings noisesettingsleft;
|
||||
struct noisesettings noisesettingsright;
|
||||
f32 subamount;
|
||||
|
||||
handPopulateFromCurrentPlayer(HAND_LEFT, &shortleft);
|
||||
handPopulateFromCurrentPlayer(HAND_RIGHT, &shortright);
|
||||
gsetPopulateFromCurrentPlayer(HAND_LEFT, &gsetleft);
|
||||
gsetPopulateFromCurrentPlayer(HAND_RIGHT, &gsetright);
|
||||
|
||||
func0f0b201c(&shortleft, sp3c);
|
||||
func0f0b201c(&shortright, sp28);
|
||||
gsetGetNoiseSettings(&gsetleft, &noisesettingsleft);
|
||||
gsetGetNoiseSettings(&gsetright, &noisesettingsright);
|
||||
|
||||
// Right hand
|
||||
if (bgunIsFiring(HAND_RIGHT)) {
|
||||
player->hands[HAND_RIGHT].noiseradius += sp28[2];
|
||||
player->hands[HAND_RIGHT].noiseradius += noisesettingsright.incradius;
|
||||
|
||||
if (player->hands[HAND_RIGHT].noiseradius > sp28[1]) {
|
||||
player->hands[HAND_RIGHT].noiseradius = sp28[1];
|
||||
if (player->hands[HAND_RIGHT].noiseradius > noisesettingsright.maxradius) {
|
||||
player->hands[HAND_RIGHT].noiseradius = noisesettingsright.maxradius;
|
||||
}
|
||||
}
|
||||
|
||||
subamount = g_Vars.lvupdate240freal * sp28[2] / (sp28[3] * 60.0f);
|
||||
consideramount = (player->hands[HAND_RIGHT].noiseradius - sp28[0]) * g_Vars.lvupdate240freal / (sp28[4] * 60.0f);
|
||||
subamount = g_Vars.lvupdate240freal * noisesettingsright.incradius / (noisesettingsright.unk0c * 60.0f);
|
||||
consideramount = (player->hands[HAND_RIGHT].noiseradius - noisesettingsright.minradius) * g_Vars.lvupdate240freal / (noisesettingsright.unk10 * 60.0f);
|
||||
|
||||
if (consideramount > subamount) {
|
||||
subamount = consideramount;
|
||||
|
|
@ -8530,21 +8530,21 @@ void bgunDecreaseNoiseRadius(void)
|
|||
|
||||
player->hands[HAND_RIGHT].noiseradius -= subamount;
|
||||
|
||||
if (player->hands[HAND_RIGHT].noiseradius < sp28[0]) {
|
||||
player->hands[HAND_RIGHT].noiseradius = sp28[0];
|
||||
if (player->hands[HAND_RIGHT].noiseradius < noisesettingsright.minradius) {
|
||||
player->hands[HAND_RIGHT].noiseradius = noisesettingsright.minradius;
|
||||
}
|
||||
|
||||
// Left hand
|
||||
if (bgunIsFiring(HAND_LEFT)) {
|
||||
player->hands[HAND_LEFT].noiseradius += sp3c[2];
|
||||
player->hands[HAND_LEFT].noiseradius += noisesettingsleft.incradius;
|
||||
|
||||
if (player->hands[HAND_LEFT].noiseradius > sp3c[1]) {
|
||||
player->hands[HAND_LEFT].noiseradius = sp3c[1];
|
||||
if (player->hands[HAND_LEFT].noiseradius > noisesettingsleft.maxradius) {
|
||||
player->hands[HAND_LEFT].noiseradius = noisesettingsleft.maxradius;
|
||||
}
|
||||
}
|
||||
|
||||
subamount = g_Vars.lvupdate240freal * sp3c[2] / (sp3c[3] * 60.0f);
|
||||
consideramount = (player->hands[HAND_LEFT].noiseradius - sp3c[0]) * g_Vars.lvupdate240freal / (sp3c[4] * 60.0f);
|
||||
subamount = g_Vars.lvupdate240freal * noisesettingsleft.incradius / (noisesettingsleft.unk0c * 60.0f);
|
||||
consideramount = (player->hands[HAND_LEFT].noiseradius - noisesettingsleft.minradius) * g_Vars.lvupdate240freal / (noisesettingsleft.unk10 * 60.0f);
|
||||
|
||||
if (consideramount > subamount) {
|
||||
subamount = consideramount;
|
||||
|
|
@ -8552,8 +8552,8 @@ void bgunDecreaseNoiseRadius(void)
|
|||
|
||||
player->hands[HAND_LEFT].noiseradius -= subamount;
|
||||
|
||||
if (player->hands[HAND_LEFT].noiseradius < sp3c[0]) {
|
||||
player->hands[HAND_LEFT].noiseradius = sp3c[0];
|
||||
if (player->hands[HAND_LEFT].noiseradius < noisesettingsleft.minradius) {
|
||||
player->hands[HAND_LEFT].noiseradius = noisesettingsleft.minradius;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -398,7 +398,7 @@ u16 weaponGetModelNum2(s32 weaponnum)
|
|||
}
|
||||
|
||||
GLOBAL_ASM(
|
||||
glabel handPopulateFromCurrentPlayer
|
||||
glabel gsetPopulateFromCurrentPlayer
|
||||
/* f0b1af0: 3c06800a */ lui $a2,%hi(g_Vars)
|
||||
/* f0b1af4: 24c69fc0 */ addiu $a2,$a2,%lo(g_Vars)
|
||||
/* f0b1af8: 8cce0284 */ lw $t6,0x284($a2)
|
||||
|
|
@ -484,7 +484,7 @@ glabel handPopulateFromCurrentPlayer
|
|||
);
|
||||
|
||||
// Mismatch: regalloc
|
||||
//void handPopulateFromCurrentPlayer(s32 handnum, struct gset *gset)
|
||||
//void gsetPopulateFromCurrentPlayer(s32 handnum, struct gset *gset)
|
||||
//{
|
||||
// gset->weaponnum = g_Vars.currentplayer->weaponnum;
|
||||
// gset->weaponfunc = g_Vars.currentplayer->hands[handnum].weaponfunc;
|
||||
|
|
@ -732,38 +732,25 @@ u32 currentPlayerGetSight(void)
|
|||
return SIGHT_DEFAULT;
|
||||
}
|
||||
|
||||
GLOBAL_ASM(
|
||||
glabel func0f0b201c
|
||||
/* f0b201c: 27bdffe0 */ addiu $sp,$sp,-32
|
||||
/* f0b2020: afbf0014 */ sw $ra,0x14($sp)
|
||||
/* f0b2024: afa0001c */ sw $zero,0x1c($sp)
|
||||
/* f0b2028: 0fc2c41f */ jal gsetGetWeaponFunction
|
||||
/* f0b202c: afa50024 */ sw $a1,0x24($sp)
|
||||
/* f0b2030: 8fa3001c */ lw $v1,0x1c($sp)
|
||||
/* f0b2034: 10400002 */ beqz $v0,.L0f0b2040
|
||||
/* f0b2038: 8fa50024 */ lw $a1,0x24($sp)
|
||||
/* f0b203c: 8c430008 */ lw $v1,0x8($v0)
|
||||
.L0f0b2040:
|
||||
/* f0b2040: 54600004 */ bnezl $v1,.L0f0b2054
|
||||
/* f0b2044: c4640000 */ lwc1 $f4,0x0($v1)
|
||||
/* f0b2048: 3c038007 */ lui $v1,%hi(invmenupos_00010fd0)
|
||||
/* f0b204c: 2463afb0 */ addiu $v1,$v1,%lo(invmenupos_00010fd0)
|
||||
/* f0b2050: c4640000 */ lwc1 $f4,0x0($v1)
|
||||
.L0f0b2054:
|
||||
/* f0b2054: e4a40000 */ swc1 $f4,0x0($a1)
|
||||
/* f0b2058: c4660004 */ lwc1 $f6,0x4($v1)
|
||||
/* f0b205c: e4a60004 */ swc1 $f6,0x4($a1)
|
||||
/* f0b2060: c4680008 */ lwc1 $f8,0x8($v1)
|
||||
/* f0b2064: e4a80008 */ swc1 $f8,0x8($a1)
|
||||
/* f0b2068: c46a000c */ lwc1 $f10,0xc($v1)
|
||||
/* f0b206c: e4aa000c */ swc1 $f10,0xc($a1)
|
||||
/* f0b2070: c4700010 */ lwc1 $f16,0x10($v1)
|
||||
/* f0b2074: e4b00010 */ swc1 $f16,0x10($a1)
|
||||
/* f0b2078: 8fbf0014 */ lw $ra,0x14($sp)
|
||||
/* f0b207c: 27bd0020 */ addiu $sp,$sp,0x20
|
||||
/* f0b2080: 03e00008 */ jr $ra
|
||||
/* f0b2084: 00000000 */ nop
|
||||
);
|
||||
void gsetGetNoiseSettings(struct gset *gset, struct noisesettings *dst)
|
||||
{
|
||||
struct noisesettings *settings = NULL;
|
||||
struct weaponfunc *func = gsetGetWeaponFunction(gset);
|
||||
|
||||
if (func != NULL) {
|
||||
settings = func->noisesettings;
|
||||
}
|
||||
|
||||
if (settings == NULL) {
|
||||
settings = &invnoisesettings_00010fd0;
|
||||
}
|
||||
|
||||
dst->minradius = settings->minradius;
|
||||
dst->maxradius = settings->maxradius;
|
||||
dst->incradius = settings->incradius;
|
||||
dst->unk0c = settings->unk0c;
|
||||
dst->unk10 = settings->unk10;
|
||||
}
|
||||
|
||||
struct guncmd *handGetEquipAnim(struct gset *gset)
|
||||
{
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -606,7 +606,7 @@ struct prop *shotCalculateHits(s32 handnum, bool arg1, struct coord *arg2, struc
|
|||
shotdata.unk0c.y = arg3->y;
|
||||
shotdata.unk0c.z = arg3->z;
|
||||
|
||||
handPopulateFromCurrentPlayer(handnum, &shotdata.gset);
|
||||
gsetPopulateFromCurrentPlayer(handnum, &shotdata.gset);
|
||||
func = gsetGetWeaponFunction(&shotdata.gset);
|
||||
|
||||
if (func) {
|
||||
|
|
@ -1264,7 +1264,7 @@ void handTickAttack(s32 handnum)
|
|||
|
||||
g_Vars.currentplayer->hands[handnum].unk0d0f_03 = false;
|
||||
|
||||
handPopulateFromCurrentPlayer(handnum, (struct gset *)&tmpweaponnum);
|
||||
gsetPopulateFromCurrentPlayer(handnum, (struct gset *)&tmpweaponnum);
|
||||
frIncrementNumShots();
|
||||
|
||||
switch (type) {
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ extern bool g_ObjectiveChecksDisabled;
|
|||
extern u16 var8006ae90[];
|
||||
extern u16 var8006af0c[];
|
||||
extern u16 var8006af8c[];
|
||||
extern struct inventory_menupos invmenupos_00010fd0;
|
||||
extern struct noisesettings invnoisesettings_00010fd0;
|
||||
extern struct inventory_class invclass_default;
|
||||
extern struct weapon *g_Weapons[];
|
||||
extern u32 var800700ac;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ s32 currentPlayerGetDeviceState(s32 weaponnum);
|
|||
void currentPlayerSetDeviceActive(s32 weaponum, bool active);
|
||||
u16 weaponGetModelNum(s32 weaponnum);
|
||||
u16 weaponGetModelNum2(s32 weaponnum);
|
||||
void handPopulateFromCurrentPlayer(s32 handnum, struct gset *gset);
|
||||
void gsetPopulateFromCurrentPlayer(s32 handnum, struct gset *gset);
|
||||
struct inventory_ammo *gsetGetAmmoDefinition(struct gset *gset);
|
||||
u8 gsetGetSingleUnk3c(struct gset *gset);
|
||||
f32 gsetGetStrength(struct gset *gset);
|
||||
|
|
@ -34,7 +34,7 @@ u16 gsetGetSingleShootSound(struct gset *gset);
|
|||
bool gsetHasFunctionFlags(struct gset *gset, u32 flags);
|
||||
s8 weaponGetNumTicksPerShot(u32 weaponnum, u32 funcindex);
|
||||
u32 currentPlayerGetSight(void);
|
||||
void func0f0b201c(struct gset *gset, f32 *arg1);
|
||||
void gsetGetNoiseSettings(struct gset *gset, struct noisesettings *settings);
|
||||
struct guncmd *gsetGetPriToSecAnim(struct gset *gset);
|
||||
struct guncmd *gsetGetSecToPriAnim(struct gset *gset);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#define IN_GAME_INVENTORY_ITEMS_H
|
||||
#include <ultra64.h>
|
||||
|
||||
extern struct inventory_menupos invmenupos_00010fd0;
|
||||
extern struct noisesettings invnoisesettings_00010fd0;
|
||||
extern struct inventory_class invclass_default;
|
||||
extern struct weapon *g_Weapons[WEAPON_SUICIDEPILL + 1];
|
||||
|
||||
|
|
|
|||
|
|
@ -2959,12 +2959,12 @@ struct stagesetup {
|
|||
/*0x1c*/ s8 *padfiledata;
|
||||
};
|
||||
|
||||
struct inventory_menupos {
|
||||
f32 x;
|
||||
f32 y;
|
||||
f32 z;
|
||||
f32 rotation;
|
||||
f32 size;
|
||||
struct noisesettings {
|
||||
f32 minradius;
|
||||
f32 maxradius;
|
||||
f32 incradius;
|
||||
f32 unk0c;
|
||||
f32 unk10;
|
||||
};
|
||||
|
||||
struct inventory_class {
|
||||
|
|
@ -3004,14 +3004,14 @@ struct weaponfunc {
|
|||
/*0x04*/ u16 name;
|
||||
/*0x06*/ u8 unk06;
|
||||
/*0x07*/ s8 ammoindex; // -1 = no ammo, 0 or 1 = index into weapon->ammos[]
|
||||
/*0x08*/ struct inventory_menupos *menupos;
|
||||
/*0x08*/ struct noisesettings *noisesettings;
|
||||
/*0x0c*/ struct guncmd *fire_animation;
|
||||
/*0x10*/ u32 flags;
|
||||
};
|
||||
|
||||
struct weaponfunc_shoot {
|
||||
struct weaponfunc base;
|
||||
/*0x14*/ struct inventory_menupos *unk14;
|
||||
/*0x14*/ struct noisesettings *unk14;
|
||||
/*0x18*/ s8 unk18;
|
||||
/*0x1c*/ f32 damage;
|
||||
/*0x20*/ f32 spread;
|
||||
|
|
|
|||
Loading…
Reference in New Issue