diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index 7ef986c63..43d7d3bef 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -13464,7 +13464,7 @@ glabel func0f03e29c /* f03e2c8: 904e005c */ lbu $t6,0x5c($v0) /* f03e2cc: 2444005c */ addiu $a0,$v0,0x5c /* f03e2d0: afa4004c */ sw $a0,0x4c($sp) -/* f03e2d4: 0fc2c78a */ jal func0f0b1e28 +/* f03e2d4: 0fc2c78a */ jal handGetSingleUnk38 /* f03e2d8: afae005c */ sw $t6,0x5c($sp) /* f03e2dc: 8fa4004c */ lw $a0,0x4c($sp) /* f03e2e0: 0fc2c79a */ jal handGetSingleShootSound diff --git a/src/game/data/inventory.c b/src/game/data/inventory.c index 7ed015b12..9c3a9ee9c 100644 --- a/src/game/data/inventory.c +++ b/src/game/data/inventory.c @@ -126,7 +126,7 @@ struct weaponfunc_shootsingle invfunc_00011160 = { 0x40000000, 0x00000000, 0x40800000, - 0x0400, + 4, 0x8039, 0x01000000, }; @@ -449,7 +449,7 @@ struct weaponfunc_shootsingle invfunc_falcon2_singleshot = { 0x41700000, 0x426fffff, 0x00000000, - 0x0000, + 0, 0x804d, 0x01000000, }; @@ -471,7 +471,7 @@ struct weaponfunc_shootsingle invfunc_falcon2silenced_singleshot = { 0x41700000, 0x426fffff, 0x00000000, - 0x0000, + 0, 0x8054, 0x01000000, }; @@ -678,7 +678,7 @@ struct weaponfunc_shootsingle invfunc_magsec_singleshot = { 0x41200000, 0x426fffff, 0x41200000, - 0x0000, + 0, 0x804c, 0x01000000, }; @@ -700,7 +700,7 @@ struct weaponfunc_shootsingle invfunc_magsec_burst = { 0x41400000, 0x426fffff, 0x41200000, - 0x0000, + 0, 0x804c, 0x01000000, }; @@ -845,7 +845,7 @@ struct weaponfunc_shootsingle invfunc_dy357_singleshot = { 0x420c0000, 0x00000000, 0x40c00000, - 0x0000, + 0, 0x8066, 0x05000000, }; @@ -867,7 +867,7 @@ struct weaponfunc_shootsingle invfunc_dy357lx_singleshot = { 0x420c0000, 0x00000000, 0x40c00000, - 0x0000, + 0, 0x8066, 0x05000000, }; @@ -1014,7 +1014,7 @@ struct weaponfunc_shootsingle invfunc_phoenix_singleshot = { 0x41700000, 0x426fffff, 0x00000000, - 0x0000, + 0, 0x8071, 0x01000000, }; @@ -1036,7 +1036,7 @@ struct weaponfunc_shootsingle invfunc_phoenix_explosiveshells = { 0x41c80000, 0x426fffff, 0x00000000, - 0x0000, + 0, 0x8072, 0x01000000, }; @@ -1154,7 +1154,7 @@ struct weaponfunc_shootsingle invfunc_mauler_singleshot = { 0x00000000, 0x426fffff, 0x40800000, - 0x0000, + 0, 0x805b, 0x01000000, }; @@ -1176,7 +1176,7 @@ struct weaponfunc_shootsingle invfunc_mauler_chargeshot = { 0x00000000, 0x426fffff, 0x40800000, - 0x0000, + 0, 0x805b, 0x01000000, }; @@ -2408,7 +2408,7 @@ struct weaponfunc_shootsingle invfunc_shotgun_single = { 0x00000000, 0x00000000, 0x40800000, - 0x0000, + 0, 0x8055, 0x01000000, }; @@ -2430,7 +2430,7 @@ struct weaponfunc_shootsingle invfunc_shotgun_double = { 0x00000000, 0x00000000, 0x40800000, - 0x0000, + 0, 0x8055, 0x01000000, }; @@ -3450,7 +3450,7 @@ struct weaponfunc_shootsingle invfunc_farsight_shoot = { 0x00000000, 0x00000000, 0x00000000, - 0x0400, + 4, 0x813e, 0x05000000, }; @@ -3472,7 +3472,7 @@ struct weaponfunc_shootsingle invfunc_farsight_targetlocator = { 0x00000000, 0x00000000, 0x00000000, - 0x0400, + 4, 0x813e, 0x05000000, }; @@ -3713,7 +3713,7 @@ struct weaponfunc_shootsingle invfunc_tranquilizer_shoot = { 0x00000000, 0x426fffff, 0x00000000, - 0x0000, + 0, 0x8057, 0x01000000, }; @@ -3807,7 +3807,7 @@ struct weaponfunc_shootsingle invfunc_psychosisgun_shoot = { 0x00000000, 0x426fffff, 0x00000000, - 0x0000, + 0, 0x8057, 0x01000000, }; @@ -3889,7 +3889,7 @@ struct weaponfunc_shootsingle invfunc_sniperrifle_singleshot = { 0x00000000, 0x00000000, 0x00000000, - 0x0400, + 4, 0x8058, 0x01000000, }; @@ -3972,7 +3972,7 @@ struct weaponfunc_shootsingle invfunc_laser_pulse = { 0x00000000, 0x00000000, 0x00000000, - 0x0300, + 3, 0x8043, 0x01000000, }; @@ -4061,7 +4061,7 @@ struct weaponfunc_shootsingle invfunc_pp9i_shoot = { 0x41200000, 0x41efffff, 0x00000000, - 0x0000, + 0, 0x8069, 0x01000000, }; @@ -4122,7 +4122,7 @@ struct weaponfunc_shootsingle invfunc_cc13_shoot = { 0x41200000, 0x426fffff, 0x00000000, - 0x0000, + 0, 0x806a, 0x01000000, }; @@ -5936,7 +5936,7 @@ struct weaponfunc_shootsingle invfunc_tester_primary = { 0x00000000, 0x426fffff, 0x00000000, - 0x0000, + 0, 0x804d, 0x01000000, }; diff --git a/src/game/game_097ba0.c b/src/game/game_097ba0.c index 08a3225f2..c2b8493d9 100644 --- a/src/game/game_097ba0.c +++ b/src/game/game_097ba0.c @@ -3683,7 +3683,7 @@ glabel var7f1ac320 .L0f09a920: /* f09a920: 1040009b */ beqz $v0,.L0f09ab90 /* f09a924: 02002025 */ or $a0,$s0,$zero -/* f09a928: 0fc2c78a */ jal func0f0b1e28 +/* f09a928: 0fc2c78a */ jal handGetSingleUnk38 /* f09a92c: afa00044 */ sw $zero,0x44($sp) /* f09a930: 1840001e */ blez $v0,.L0f09a9ac /* f09a934: 8fa30044 */ lw $v1,0x44($sp) @@ -3708,7 +3708,7 @@ glabel var7f1ac320 /* f09a980: 01e2082a */ slt $at,$t7,$v0 /* f09a984: 1020000d */ beqz $at,.L0f09a9bc /* f09a988: 00000000 */ nop -/* f09a98c: 0fc2c78a */ jal func0f0b1e28 +/* f09a98c: 0fc2c78a */ jal handGetSingleUnk38 /* f09a990: 02002025 */ or $a0,$s0,$zero /* f09a994: 3c18800a */ lui $t8,%hi(g_Vars+0x8) /* f09a998: 8f189fc8 */ lw $t8,%lo(g_Vars+0x8)($t8) diff --git a/src/game/game_0b0420.c b/src/game/game_0b0420.c index 9a640aff7..2db00a8e8 100644 --- a/src/game/game_0b0420.c +++ b/src/game/game_0b0420.c @@ -1475,27 +1475,17 @@ glabel func0f0b1d28 /* f0b1e24: 00000000 */ nop ); -GLOBAL_ASM( -glabel func0f0b1e28 -/* f0b1e28: 27bdffe8 */ addiu $sp,$sp,-24 -/* f0b1e2c: afbf0014 */ sw $ra,0x14($sp) -/* f0b1e30: 0fc2c41f */ jal handGetWeaponFunction -/* f0b1e34: 00000000 */ nop -/* f0b1e38: 10400008 */ beqz $v0,.L0f0b1e5c -/* f0b1e3c: 8fbf0014 */ lw $ra,0x14($sp) -/* f0b1e40: 8c4e0000 */ lw $t6,0x0($v0) -/* f0b1e44: 24010001 */ addiu $at,$zero,0x1 -/* f0b1e48: 31cf00ff */ andi $t7,$t6,0xff -/* f0b1e4c: 55e10004 */ bnel $t7,$at,.L0f0b1e60 -/* f0b1e50: 00001025 */ or $v0,$zero,$zero -/* f0b1e54: 10000002 */ b .L0f0b1e60 -/* f0b1e58: 90420038 */ lbu $v0,0x38($v0) -.L0f0b1e5c: -/* f0b1e5c: 00001025 */ or $v0,$zero,$zero -.L0f0b1e60: -/* f0b1e60: 03e00008 */ jr $ra -/* f0b1e64: 27bd0018 */ addiu $sp,$sp,0x18 -); +u8 handGetSingleUnk38(struct hand *hand) +{ + struct weaponfunc *func = handGetWeaponFunction(hand); + + if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT_SINGLE) { + struct weaponfunc_shootsingle *funcshoot = (struct weaponfunc_shootsingle *)func; + return funcshoot->unk38; + } + + return 0; +} u16 handGetSingleShootSound(struct hand *hand) { diff --git a/src/include/game/game_0b0420.h b/src/include/game/game_0b0420.h index 0b37f7cd2..f262d80d9 100644 --- a/src/include/game/game_0b0420.h +++ b/src/include/game/game_0b0420.h @@ -42,7 +42,7 @@ u32 func0f0b1c24(void); u32 func0f0b1c78(void); u32 func0f0b1ce8(void); f32 func0f0b1d28(u8 *weaponnum); -u32 func0f0b1e28(void); +u8 handGetSingleUnk38(struct hand *hand); u16 handGetSingleShootSound(struct hand *hand); bool handHasFunctionFlags(struct hand *hand, u32 flags); s8 weaponGetMaxFireRatePerTick(u32 weaponnum, u32 funcindex); diff --git a/src/include/types.h b/src/include/types.h index b8d21c500..150a50775 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -2898,7 +2898,7 @@ struct weaponfunc_shootsingle { /*0x2c*/ u32 unk2c; /*0x30*/ u32 unk30; /*0x34*/ u32 unk34; - /*0x38*/ u16 unk38; + /*0x38*/ u8 unk38; /*0x3a*/ u16 shootsound; /*0x3c*/ u32 unk3c; };