forked from Ports/perfect_dark
Decompile bgunTickGunLoad
This commit is contained in:
1 parent
3b78245d9c
commit
c94f0e196a
11 files changed
+346
-616
No files matched your search
@@ -114,7 +114,7 @@ The decomp project wraps all decompiled piracy checks in `#if PIRACYCHECKS` stat
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### tagsAllocatePtrs
|
### tagsReset
|
||||||
|
|
||||||
**When Called:** When loading a normal stage (eg. CI Training).
|
**When Called:** When loading a normal stage (eg. CI Training).
|
||||||
|
|
||||||
@@ -122,13 +122,13 @@ The decomp project wraps all decompiled piracy checks in `#if PIRACYCHECKS` stat
|
|||||||
|
|
||||||
**Payload:** Copies 4KB from a random location in ROM to a random location in RAM.
|
**Payload:** Copies 4KB from a random location in ROM to a random location in RAM.
|
||||||
|
|
||||||
### bgun0f09e144
|
### bgunTickGunLoad
|
||||||
|
|
||||||
**When Called:** Unknown.
|
**When Called:** When equipping any weapon.
|
||||||
|
|
||||||
**What It Checks:** Checksums `tagsReset` to make sure it hasn't been modified.
|
**What It Checks:** Checksums `tagsReset` to make sure it hasn't been modified.
|
||||||
|
|
||||||
**Payload:** Corrupts `tagsReset` by writing 28 bytes of 0xff.
|
**Payload:** Corrupts `tagsReset` by writing 7 bytes of 0xff.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
+302
-569
File diff suppressed because it is too large.
Load diff
@@ -151,8 +151,8 @@ void bgunReset(void)
|
|||||||
g_Vars.currentplayer->gunctrl.handfilenum = 0;
|
g_Vars.currentplayer->gunctrl.handfilenum = 0;
|
||||||
g_Vars.currentplayer->gunctrl.unk15a0 = 0;
|
g_Vars.currentplayer->gunctrl.unk15a0 = 0;
|
||||||
g_Vars.currentplayer->gunctrl.unk15a4 = 0;
|
g_Vars.currentplayer->gunctrl.unk15a4 = 0;
|
||||||
g_Vars.currentplayer->gunctrl.unk15b0 = 0;
|
g_Vars.currentplayer->gunctrl.masterloadstate = 0;
|
||||||
g_Vars.currentplayer->gunctrl.unk15b1 = 0;
|
g_Vars.currentplayer->gunctrl.gunloadstate = 0;
|
||||||
g_Vars.currentplayer->gunctrl.gunmemtype = 0;
|
g_Vars.currentplayer->gunctrl.gunmemtype = 0;
|
||||||
g_Vars.currentplayer->gunctrl.gunmemnew = -1;
|
g_Vars.currentplayer->gunctrl.gunmemnew = -1;
|
||||||
g_Vars.currentplayer->gunctrl.gunmemowner = GUNMEMOWNER_CHRBODY;
|
g_Vars.currentplayer->gunctrl.gunmemowner = GUNMEMOWNER_CHRBODY;
|
||||||
|
|||||||
+2
-2
@@ -2018,7 +2018,7 @@ glabel var7f1acd60
|
|||||||
/* f0adf50: 8fa40148 */ lw $a0,0x148($sp)
|
/* f0adf50: 8fa40148 */ lw $a0,0x148($sp)
|
||||||
/* f0adf54: 0c005746 */ jal mtx4Copy
|
/* f0adf54: 0c005746 */ jal mtx4Copy
|
||||||
/* f0adf58: 27a500ec */ addiu $a1,$sp,0xec
|
/* f0adf58: 27a500ec */ addiu $a1,$sp,0xec
|
||||||
/* f0adf5c: 0fc27aef */ jal bgun0f09ebbc
|
/* f0adf5c: 0fc27aef */ jal bgunGetCartModeldef
|
||||||
/* f0adf60: 00000000 */ nop
|
/* f0adf60: 00000000 */ nop
|
||||||
/* f0adf64: 10400004 */ beqz $v0,.L0f0adf78
|
/* f0adf64: 10400004 */ beqz $v0,.L0f0adf78
|
||||||
/* f0adf68: 00402025 */ or $a0,$v0,$zero
|
/* f0adf68: 00402025 */ or $a0,$v0,$zero
|
||||||
@@ -2849,7 +2849,7 @@ glabel var7f1acd60
|
|||||||
/* f0adf50: 8fa40148 */ lw $a0,0x148($sp)
|
/* f0adf50: 8fa40148 */ lw $a0,0x148($sp)
|
||||||
/* f0adf54: 0c005746 */ jal mtx4Copy
|
/* f0adf54: 0c005746 */ jal mtx4Copy
|
||||||
/* f0adf58: 27a500ec */ addiu $a1,$sp,0xec
|
/* f0adf58: 27a500ec */ addiu $a1,$sp,0xec
|
||||||
/* f0adf5c: 0fc27aef */ jal bgun0f09ebbc
|
/* f0adf5c: 0fc27aef */ jal bgunGetCartModeldef
|
||||||
/* f0adf60: 00000000 */ nop
|
/* f0adf60: 00000000 */ nop
|
||||||
/* f0adf64: 10400004 */ beqz $v0,.L0f0adf78
|
/* f0adf64: 10400004 */ beqz $v0,.L0f0adf78
|
||||||
/* f0adf68: 00402025 */ or $a0,$v0,$zero
|
/* f0adf68: 00402025 */ or $a0,$v0,$zero
|
||||||
|
|||||||
@@ -3214,7 +3214,7 @@ void texLoadFromDisplayList(Gfx *gdl, struct texturething *arg1, s32 arg2)
|
|||||||
while (bytes[0] != (u8)G_ENDDL) {
|
while (bytes[0] != (u8)G_ENDDL) {
|
||||||
// Look for GBI sequence: fd...... abcd....
|
// Look for GBI sequence: fd...... abcd....
|
||||||
if (bytes[0] == G_SETTIMG && bytes[4] == 0xab && bytes[5] == 0xcd) {
|
if (bytes[0] == G_SETTIMG && bytes[4] == 0xab && bytes[5] == 0xcd) {
|
||||||
texLoad((u32 *)((s32)bytes + 4), arg1, arg2);
|
texLoad((s32 *)((s32)bytes + 4), arg1, arg2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bytes += 8;
|
bytes += 8;
|
||||||
@@ -3701,11 +3701,11 @@ void texLoadFromConfigs(struct textureconfig *configs, s32 numconfigs, struct te
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void texLoadFromTextureNum(u32 arg0, struct texturething *arg1)
|
void texLoadFromTextureNum(u32 texturenum, struct texturething *arg1)
|
||||||
{
|
{
|
||||||
u32 sp1c = arg0;
|
s32 texturenumcopy = texturenum;
|
||||||
|
|
||||||
texLoad(&sp1c, arg1, 1);
|
texLoad(&texturenumcopy, arg1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 func0f173510(s32 arg0, s32 arg1, s32 arg3)
|
s32 func0f173510(s32 arg0, s32 arg1, s32 arg3)
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ void texSelect(Gfx **gdlptr, struct textureconfig *tconfig, u32 arg2, s32 arg3,
|
|||||||
|
|
||||||
s4 = NULL;
|
s4 = NULL;
|
||||||
|
|
||||||
if (tconfig->texturenum < NUM_TEXTURES) {
|
if ((u32)tconfig->texturenum < NUM_TEXTURES) {
|
||||||
texLoadFromConfigs(tconfig, 1, arg6, 0);
|
texLoadFromConfigs(tconfig, 1, arg6, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1377,6 +1377,7 @@
|
|||||||
#define LOADTYPE_SETUP 4
|
#define LOADTYPE_SETUP 4
|
||||||
#define LOADTYPE_PADS 5
|
#define LOADTYPE_PADS 5
|
||||||
#define LOADTYPE_MODEL 6
|
#define LOADTYPE_MODEL 6
|
||||||
|
#define LOADTYPE_GUN 7
|
||||||
|
|
||||||
// These actions are assigned to chr->myaction
|
// These actions are assigned to chr->myaction
|
||||||
#define MA_NONE 0
|
#define MA_NONE 0
|
||||||
|
|||||||
@@ -68,11 +68,11 @@ void bgunFreeGunMem(void);
|
|||||||
void bgunSetGunMemWeapon(s32 weaponnum);
|
void bgunSetGunMemWeapon(s32 weaponnum);
|
||||||
void bgun0f09df9c(void);
|
void bgun0f09df9c(void);
|
||||||
bool bgun0f09e004(s32 newowner);
|
bool bgun0f09e004(s32 newowner);
|
||||||
void bgun0f09e144(void);
|
void bgunTickGunLoad(void);
|
||||||
void bgunTickIncLoad(void);
|
void bgunTickMasterLoad(void);
|
||||||
void bgunTickLoad(void);
|
void bgunTickLoad(void);
|
||||||
bool bgun0f09eae4(void);
|
bool bgun0f09eae4(void);
|
||||||
struct modelfiledata *bgun0f09ebbc(void);
|
struct modelfiledata *bgunGetCartModeldef(void);
|
||||||
void bgun0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf *matrix1, struct coord *velocity, Mtxf *matrix2, struct prop *prop, struct coord *pos);
|
void bgun0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf *matrix1, struct coord *velocity, Mtxf *matrix2, struct prop *prop, struct coord *pos);
|
||||||
void bgun0f09ed2c(struct defaultobj *obj, struct coord *coord, Mtxf *arg2, struct coord *velocity, Mtxf *arg4);
|
void bgun0f09ed2c(struct defaultobj *obj, struct coord *coord, Mtxf *arg2, struct coord *velocity, Mtxf *arg4);
|
||||||
struct defaultobj *bgunCreateThrownProjectile2(struct chrdata *chr, struct gset *gset, struct coord *pos, s16 *rooms, Mtxf *arg4, struct coord *velocity);
|
struct defaultobj *bgunCreateThrownProjectile2(struct chrdata *chr, struct gset *gset, struct coord *pos, s16 *rooms, Mtxf *arg4, struct coord *velocity);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ struct texloadthing *tex0f172e8c(s32 texturenum, struct texturething *arg1);
|
|||||||
s32 func0f172f44(struct texturething *arg0);
|
s32 func0f172f44(struct texturething *arg0);
|
||||||
struct texloadthing *func0f172f54(struct texturething *arg0);
|
struct texloadthing *func0f172f54(struct texturething *arg0);
|
||||||
void texLoadFromDisplayList(Gfx *gdl, struct texturething *arg1, s32 arg2);
|
void texLoadFromDisplayList(Gfx *gdl, struct texturething *arg1, s32 arg2);
|
||||||
void texLoad(u32 *texturenum, struct texturething *arg1, s32 arg2);
|
void texLoad(s32 *texturenum, struct texturething *arg1, s32 arg2);
|
||||||
void texLoadFromConfigs(struct textureconfig *configs, s32 numconfigs, struct texturething *arg2, s32 arg3);
|
void texLoadFromConfigs(struct textureconfig *configs, s32 numconfigs, struct texturething *arg2, s32 arg3);
|
||||||
void texLoadFromTextureNum(u32 arg0, struct texturething *arg1);
|
void texLoadFromTextureNum(u32 arg0, struct texturething *arg1);
|
||||||
|
|
||||||
|
|||||||
+25
-29
@@ -2286,6 +2286,18 @@ struct hand {
|
|||||||
/*0x0dd8*/ Mtxf *unk0dd8;
|
/*0x0dd8*/ Mtxf *unk0dd8;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct texturething {
|
||||||
|
struct texloadthing *unk00;
|
||||||
|
struct texloadthing *unk04;
|
||||||
|
struct texloadthing *unk08;
|
||||||
|
struct texloadthing *unk0c;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct fileinfo {
|
||||||
|
u32 loadedsize;
|
||||||
|
u32 allocsize;
|
||||||
|
};
|
||||||
|
|
||||||
struct gunctrl {
|
struct gunctrl {
|
||||||
/*0x1580*/ s8 weaponnum;
|
/*0x1580*/ s8 weaponnum;
|
||||||
/*0x1581*/ s8 prevweaponnum; // previously drawn weapon, switched to when throwing Dragon/Laptop or when ammo depleted
|
/*0x1581*/ s8 prevweaponnum; // previously drawn weapon, switched to when throwing Dragon/Laptop or when ammo depleted
|
||||||
@@ -2303,25 +2315,21 @@ struct gunctrl {
|
|||||||
/*0x158c*/ u8 *gunmem;
|
/*0x158c*/ u8 *gunmem;
|
||||||
/*0x1590*/ struct modelfiledata *gunmodeldef;
|
/*0x1590*/ struct modelfiledata *gunmodeldef;
|
||||||
/*0x1594*/ struct modelfiledata *handmodeldef;
|
/*0x1594*/ struct modelfiledata *handmodeldef;
|
||||||
/*0x1598*/ struct modelfiledata *unk1598;
|
/*0x1598*/ struct modelfiledata *cartmodeldef;
|
||||||
/*0x159c*/ u16 handfilenum;
|
/*0x159c*/ u16 handfilenum;
|
||||||
/*0x15a0*/ u8 *unk15a0;
|
/*0x15a0*/ u8 *unk15a0;
|
||||||
/*0x15a4*/ s32 unk15a4;
|
/*0x15a4*/ s32 unk15a4;
|
||||||
/*0x15a8*/ s32 unk15a8;
|
/*0x15a8*/ s32 unk15a8;
|
||||||
/*0x15ac*/ s32 unk15ac;
|
/*0x15ac*/ s32 unk15ac;
|
||||||
/*0x15b0*/ u8 unk15b0;
|
/*0x15b0*/ u8 masterloadstate;
|
||||||
/*0x15b1*/ u8 unk15b1;
|
/*0x15b1*/ u8 gunloadstate;
|
||||||
/*0x15b2*/ u16 unk15b2;
|
/*0x15b2*/ u16 loadfilenum;
|
||||||
/*0x15b4*/ struct modelfiledata **unk15b4;
|
/*0x15b4*/ struct modelfiledata **loadtomodeldef;
|
||||||
/*0x15b8*/ void *unk15b8;
|
/*0x15b8*/ u32 *loadmemptr;
|
||||||
/*0x15bc*/ void *unk15bc;
|
/*0x15bc*/ u32 *loadmemremaining;
|
||||||
/*0x15c0*/ u32 unk15c0;
|
/*0x15c0*/ struct texturething unk15c0;
|
||||||
/*0x15c4*/ u32 unk15c4;
|
/*0x15d0*/ u32 nexttexturetoload;
|
||||||
/*0x15c8*/ u32 unk15c8;
|
/*0x15d4*/ struct fileinfo fileinfo;
|
||||||
/*0x15cc*/ u32 unk15cc;
|
|
||||||
/*0x15d0*/ u32 unk15d0;
|
|
||||||
/*0x15d4*/ u32 unk15d4;
|
|
||||||
/*0x15d8*/ u32 unk15d8;
|
|
||||||
/*0x15dc*/ struct abmag abmag;
|
/*0x15dc*/ struct abmag abmag;
|
||||||
/*0x15e4*/ s8 ammotypes[2];
|
/*0x15e4*/ s8 ammotypes[2];
|
||||||
/*0x15e6*/ u8 action;
|
/*0x15e6*/ u8 action;
|
||||||
@@ -3779,7 +3787,7 @@ struct menudata_training {
|
|||||||
|
|
||||||
struct textureconfig {
|
struct textureconfig {
|
||||||
union {
|
union {
|
||||||
u32 texturenum;
|
s32 texturenum;
|
||||||
u8 *textureptr;
|
u8 *textureptr;
|
||||||
};
|
};
|
||||||
u8 width;
|
u8 width;
|
||||||
@@ -5131,11 +5139,6 @@ struct var800aabb8 {
|
|||||||
u16 unk00_02 : 14;
|
u16 unk00_02 : 14;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fileinfo {
|
|
||||||
u32 loadedsize;
|
|
||||||
u32 allocsize;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct portalcmd {
|
struct portalcmd {
|
||||||
u8 type;
|
u8 type;
|
||||||
u8 len;
|
u8 len;
|
||||||
@@ -5777,8 +5780,8 @@ struct var8009dd78 {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct texturepair {
|
struct texturepair {
|
||||||
u32 texturenum1;
|
s32 texturenum1;
|
||||||
u32 texturenum2;
|
s32 texturenum2;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct collisionthing {
|
struct collisionthing {
|
||||||
@@ -6272,13 +6275,6 @@ struct awardmetrics {
|
|||||||
/*0x38*/ f32 accuracyfrac;
|
/*0x38*/ f32 accuracyfrac;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct texturething {
|
|
||||||
struct texloadthing *unk00;
|
|
||||||
struct texloadthing *unk04;
|
|
||||||
struct texloadthing *unk08;
|
|
||||||
struct texloadthing *unk0c;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct texloadthing {
|
struct texloadthing {
|
||||||
/*0x00*/ u16 texturenum : 12;
|
/*0x00*/ u16 texturenum : 12;
|
||||||
/*0x00*/ u16 unk00_0c : 4;
|
/*0x00*/ u16 unk00_0c : 4;
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ void piracy_patch(void)
|
|||||||
patch(algo06, "lvReset", "lvGetSlowMotionType");
|
patch(algo06, "lvReset", "lvGetSlowMotionType");
|
||||||
patch(algo07, "bodyAllocateEyespy", "lvReset");
|
patch(algo07, "bodyAllocateEyespy", "lvReset");
|
||||||
patch(algo08, "chrConsiderGrenadeThrow", "bgReset");
|
patch(algo08, "chrConsiderGrenadeThrow", "bgReset");
|
||||||
patch(algo09, "bgun0f09e144", "tagsReset");
|
patch(algo09, "bgunTickGunLoad", "tagsReset");
|
||||||
patch(algo10, "explosionAlertChrs", "glassDestroy");
|
patch(algo10, "explosionAlertChrs", "glassDestroy");
|
||||||
patch(algo11, "func0f0069dc", "mtxGetObfuscatedRomBase");
|
patch(algo11, "func0f0069dc", "mtxGetObfuscatedRomBase");
|
||||||
patch(algo12, "func0f15c920", "func0f0069dc");
|
patch(algo12, "func0f15c920", "func0f0069dc");
|
||||||
|
|||||||
Reference in new issue
Block a user