Decompile contGetStickY

This commit is contained in:
Ryan Dwyer 2020-10-30 17:52:34 +10:00
parent 6010c607a1
commit c2e2e149ff
10 changed files with 46 additions and 83 deletions

View File

@ -1738,7 +1738,7 @@ glabel var7f1adb00
/* f0d0974: 0c005384 */ jal contGetStickX
/* f0d0978: 01e02025 */ or $a0,$t7,$zero
/* f0d097c: 83a400c3 */ lb $a0,0xc3($sp)
/* f0d0980: 0c0053ae */ jal func00014eb8
/* f0d0980: 0c0053ae */ jal contGetStickY
/* f0d0984: a3a200c2 */ sb $v0,0xc2($sp)
/* f0d0988: 8fae00e8 */ lw $t6,0xe8($sp)
/* f0d098c: 00023e00 */ sll $a3,$v0,0x18
@ -1802,7 +1802,7 @@ glabel var7f1adb00
/* f0d0a6c: 03002025 */ or $a0,$t8,$zero
/* f0d0a70: 83a40077 */ lb $a0,0x77($sp)
/* f0d0a74: a3a200c1 */ sb $v0,0xc1($sp)
/* f0d0a78: 0c0053ae */ jal func00014eb8
/* f0d0a78: 0c0053ae */ jal contGetStickY
/* f0d0a7c: afa4003c */ sw $a0,0x3c($sp)
/* f0d0a80: 8faf00e8 */ lw $t7,0xe8($sp)
/* f0d0a84: 00023600 */ sll $a2,$v0,0x18

View File

@ -853,7 +853,7 @@ glabel var7f1ad8e4
/* f0c8c3c: 12200008 */ beqz $s1,.L0f0c8c60
/* f0c8c40: 00152600 */ sll $a0,$s5,0x18
/* f0c8c44: 00044e03 */ sra $t1,$a0,0x18
/* f0c8c48: 0c0053ae */ jal func00014eb8
/* f0c8c48: 0c0053ae */ jal contGetStickY
/* f0c8c4c: 01202025 */ or $a0,$t1,$zero
/* f0c8c50: 00029e00 */ sll $s3,$v0,0x18
/* f0c8c54: 00135603 */ sra $t2,$s3,0x18
@ -1077,7 +1077,7 @@ glabel var7f1ad8e4
/* f0c8f60: 00142600 */ sll $a0,$s4,0x18
/* f0c8f64: 0004c603 */ sra $t8,$a0,0x18
/* f0c8f68: a3a200e9 */ sb $v0,0xe9($sp)
/* f0c8f6c: 0c0053ae */ jal func00014eb8
/* f0c8f6c: 0c0053ae */ jal contGetStickY
/* f0c8f70: 03002025 */ or $a0,$t8,$zero
/* f0c8f74: 00028600 */ sll $s0,$v0,0x18
/* f0c8f78: 00142600 */ sll $a0,$s4,0x18
@ -1833,7 +1833,7 @@ glabel var7f1ad8e4
/* f0c9a08: afa40234 */ sw $a0,0x234($sp)
/* f0c9a0c: 00142600 */ sll $a0,$s4,0x18
/* f0c9a10: 00044603 */ sra $t0,$a0,0x18
/* f0c9a14: 0c0053ae */ jal func00014eb8
/* f0c9a14: 0c0053ae */ jal contGetStickY
/* f0c9a18: 01002025 */ or $a0,$t0,$zero
/* f0c9a1c: 2844ffe2 */ slti $a0,$v0,-30
.L0f0c9a20:
@ -4000,7 +4000,7 @@ glabel var7f1ad8e4
// c1stickx = arg0 ? contGetStickX(contpad1) : 0;
//
// // 8c3c
// c1sticky = arg1 ? func00014eb8(contpad1) : 0;
// c1sticky = arg1 ? contGetStickY(contpad1) : 0;
//
// // 8c68
// sp1a2 = arg2 ? func00014f60(contpad1, 0xffff) : 0;
@ -4091,7 +4091,7 @@ glabel var7f1ad8e4
// // s4 shifted to s8 and stored in a0 for next jal
// c2stickx = contGetStickX(contpad2); // sb v0,0xe9(sp)
// // s4 shifted to s8 and stored in a0 for next jal
// c2sticky = func00014eb8(contpad2); // shifted to s8 and stored in s0
// c2sticky = contGetStickY(contpad2); // shifted to s8 and stored in s0
// // s4 shifted to s8 and stored in a0 for next jal
// spe6 = func00014f60(contpad2, 0xffff); // sh v0,0xe6(sp)
// // s4 shifted to s8 and stored in a0 for next jal
@ -4417,7 +4417,7 @@ glabel var7f1ad8e4
// && g_Vars.coopplayernum < 0) {
// movedata.eyesshut = g_Vars.currentplayer->insightaimmode
// && !sp1a8
// && func00014eb8(contpad2) < -30;
// && contGetStickY(contpad2) < -30;
// }
//
// // 9a24

View File

@ -652,10 +652,7 @@ struct contdata *var8005ee60 = &var80099a60;
u32 var8005ee64 = 0x00000000;
u32 var8005ee68 = 0x00000000;
u32 var8005ee6c[4] = {0};
u32 var8005ee7c = 0x00000000;
u32 var8005ee80 = 0x00000000;
u32 var8005ee84 = 0x00000000;
u32 var8005ee88 = 0x00000000;
u32 var8005ee7c[4] = {0};
u32 var8005ee8c = 0x00000000;
u32 var8005ee90 = 0x00000000;
u32 var8005ee94 = 0x00000000;

View File

@ -8923,7 +8923,7 @@ glabel var7f1ad6ac
/* f0be610: 00122600 */ sll $a0,$s2,0x18
/* f0be614: 00046e03 */ sra $t5,$a0,0x18
/* f0be618: a3a2023d */ sb $v0,0x23d($sp)
/* f0be61c: 0c0053ae */ jal func00014eb8
/* f0be61c: 0c0053ae */ jal contGetStickY
/* f0be620: 01a02025 */ or $a0,$t5,$zero
/* f0be624: 10000002 */ b .L0f0be630
/* f0be628: a3a2023c */ sb $v0,0x23c($sp)
@ -9003,7 +9003,7 @@ glabel var7f1ad6ac
/* f0be730: 00122600 */ sll $a0,$s2,0x18
/* f0be734: 00045e03 */ sra $t3,$a0,0x18
/* f0be738: a3a2023d */ sb $v0,0x23d($sp)
/* f0be73c: 0c0053ae */ jal func00014eb8
/* f0be73c: 0c0053ae */ jal contGetStickY
/* f0be740: 01602025 */ or $a0,$t3,$zero
/* f0be744: 10000002 */ b .L0f0be750
/* f0be748: a3a2023c */ sb $v0,0x23c($sp)
@ -10736,7 +10736,7 @@ glabel var7f1ad6ac
// }
//
// cStack243 = contGetStickX(contpad1);
// cStack244 = func00014eb8(contpad1);
// cStack244 = contGetStickY(contpad1);
// } else {
// slow = true;
// }
@ -10765,7 +10765,7 @@ glabel var7f1ad6ac
// }
//
// cStack243 = contGetStickX(contpad1);
// cStack244 = func00014eb8(contpad1);
// cStack244 = contGetStickY(contpad1);
// } else {
// slow = true;
// }

View File

@ -11000,7 +11000,7 @@ glabel var7f1b2ac8
/* f0fa938: 00028600 */ sll $s0,$v0,0x18
/* f0fa93c: 0010c603 */ sra $t8,$s0,0x18
/* f0fa940: 03008025 */ or $s0,$t8,$zero
/* f0fa944: 0c0053ae */ jal func00014eb8
/* f0fa944: 0c0053ae */ jal contGetStickY
/* f0fa948: 82640003 */ lb $a0,0x3($s3)
/* f0fa94c: 00028e00 */ sll $s1,$v0,0x18
/* f0fa950: 0011ce03 */ sra $t9,$s1,0x18

View File

@ -3998,7 +3998,7 @@ glabel hudRenderEyespyUi
/* f1451ec: 00102600 */ sll $a0,$s0,0x18
/* f1451f0: 00047603 */ sra $t6,$a0,0x18
/* f1451f4: 01c02025 */ or $a0,$t6,$zero
/* f1451f8: 0c0053ae */ jal func00014eb8
/* f1451f8: 0c0053ae */ jal contGetStickY
/* f1451fc: a3a20251 */ sb $v0,0x251($sp)
/* f145200: 02a01825 */ or $v1,$s5,$zero
/* f145204: 26b50008 */ addiu $s5,$s5,0x8

View File

@ -4207,23 +4207,23 @@ void func0f16b96c(void)
if ((func00015020(0, 0xffff) != 0
|| contGetStickX(0) > 10
|| contGetStickX(0) < -10
|| func00014eb8(0) > 10
|| func00014eb8(0) < -10
|| contGetStickY(0) > 10
|| contGetStickY(0) < -10
|| func00015020(1, 0xffff) != 0
|| contGetStickX(1) > 10
|| contGetStickX(1) < -10
|| func00014eb8(1) > 10
|| func00014eb8(1) < -10
|| contGetStickY(1) > 10
|| contGetStickY(1) < -10
|| func00015020(2, 0xffff) != 0
|| contGetStickX(2) > 10
|| contGetStickX(2) < -10
|| func00014eb8(2) > 10
|| func00014eb8(2) < -10
|| contGetStickY(2) > 10
|| contGetStickY(2) < -10
|| func00015020(3, 0xffff) != 0
|| contGetStickX(3) > 10
|| contGetStickX(3) < -10
|| func00014eb8(3) > 10
|| func00014eb8(3) < -10) && var800624a4) {
|| contGetStickY(3) > 10
|| contGetStickY(3) < -10) && var800624a4) {
if (g_Vars.stagenum != STAGE_TITLE) {
titleSetNextMode(TITLEMODE_SKIP);
mainSetStageNum(STAGE_TITLE);
@ -4236,23 +4236,23 @@ void func0f16b96c(void)
if (func00014f60(0, 0xffff) == 0
&& contGetStickX(0) < 10
&& contGetStickX(0) > -10
&& func00014eb8(0) < 10
&& func00014eb8(0) > -10
&& contGetStickY(0) < 10
&& contGetStickY(0) > -10
&& func00014f60(1, 0xffff) == 0
&& contGetStickX(1) < 10
&& contGetStickX(1) > -10
&& func00014eb8(1) < 10
&& func00014eb8(1) > -10
&& contGetStickY(1) < 10
&& contGetStickY(1) > -10
&& func00014f60(2, 0xffff) == 0
&& contGetStickX(2) < 10
&& contGetStickX(2) > -10
&& func00014eb8(2) < 10
&& func00014eb8(2) > -10
&& contGetStickY(2) < 10
&& contGetStickY(2) > -10
&& func00014f60(3, 0xffff) == 0
&& contGetStickX(3) < 10
&& contGetStickX(3) > -10
&& func00014eb8(3) < 10
&& func00014eb8(3) > -10) {
&& contGetStickY(3) < 10
&& contGetStickY(3) > -10) {
var800624b0 += g_Vars.diffframe60;
} else {
var800624b0 = 0;

View File

@ -116,7 +116,7 @@ extern u32 var8005ee18;
extern struct contdata *var8005ee60;
extern u32 var8005ee68;
extern u32 var8005ee6c[4];
extern u32 var8005ee7c;
extern u32 var8005ee7c[4];
extern u32 var8005ee8c;
extern u32 var8005ee9c;
extern u8 var8005eeac;

View File

@ -33,7 +33,7 @@ u32 func00014a78(u32 samplenum, s8 contpadnum, u32 buttons);
u32 func00014b50(u32 samplenum, s8 contpadnum, u32 buttons);
u32 func00014c98(u32 *arg0, s8 contpadnum, u32 buttons);
s8 contGetStickX(s8 contpadnum);
s8 func00014eb8(s8 contpadnum);
s8 contGetStickY(s8 contpadnum);
u16 func00014f60(s8 contpadnum, u16 arg1);
u16 func00015020(s8 contpadnum, u16 arg1);
u32 func000150c4(void);

View File

@ -1688,53 +1688,19 @@ s8 contGetStickX(s8 contpadnum)
return var8005ee60->samples[var8005ee60->index].pads[contpadnum].stick_x;
}
GLOBAL_ASM(
glabel func00014eb8
/* 14eb8: 3c038006 */ lui $v1,%hi(var8005ee60)
/* 14ebc: 8c63ee60 */ lw $v1,%lo(var8005ee60)($v1)
/* 14ec0: afa40000 */ sw $a0,0x0($sp)
/* 14ec4: 00047600 */ sll $t6,$a0,0x18
/* 14ec8: 8c780200 */ lw $t8,0x200($v1)
/* 14ecc: 000e7e03 */ sra $t7,$t6,0x18
/* 14ed0: 01e02025 */ or $a0,$t7,$zero
/* 14ed4: 0701000e */ bgez $t8,.L00014f10
/* 14ed8: 3c198006 */ lui $t9,%hi(var8005eeac)
/* 14edc: 9339eeac */ lbu $t9,%lo(var8005eeac)($t9)
/* 14ee0: 3c0b8006 */ lui $t3,%hi(var8005ee7c)
/* 14ee4: 256bee7c */ addiu $t3,$t3,%lo(var8005ee7c)
/* 14ee8: 01f94007 */ srav $t0,$t9,$t7
/* 14eec: 31090001 */ andi $t1,$t0,0x1
/* 14ef0: 15200007 */ bnez $t1,.L00014f10
/* 14ef4: 000f5080 */ sll $t2,$t7,0x2
/* 14ef8: 014b1821 */ addu $v1,$t2,$t3
/* 14efc: 8c6c0000 */ lw $t4,0x0($v1)
/* 14f00: 00001025 */ or $v0,$zero,$zero
/* 14f04: 258d0001 */ addiu $t5,$t4,0x1
/* 14f08: 03e00008 */ jr $ra
/* 14f0c: ac6d0000 */ sw $t5,0x0($v1)
.L00014f10:
/* 14f10: 00047080 */ sll $t6,$a0,0x2
/* 14f14: 3c0f800a */ lui $t7,%hi(var80099e68)
/* 14f18: 01ee7821 */ addu $t7,$t7,$t6
/* 14f1c: 8def9e68 */ lw $t7,%lo(var80099e68)($t7)
/* 14f20: 59e00004 */ blezl $t7,.L00014f34
/* 14f24: 8c7801e0 */ lw $t8,0x1e0($v1)
/* 14f28: 03e00008 */ jr $ra
/* 14f2c: 00001025 */ or $v0,$zero,$zero
/* 14f30: 8c7801e0 */ lw $t8,0x1e0($v1)
.L00014f34:
/* 14f34: 00044880 */ sll $t1,$a0,0x2
/* 14f38: 01244823 */ subu $t1,$t1,$a0
/* 14f3c: 0018c880 */ sll $t9,$t8,0x2
/* 14f40: 0338c823 */ subu $t9,$t9,$t8
/* 14f44: 0019c8c0 */ sll $t9,$t9,0x3
/* 14f48: 00794021 */ addu $t0,$v1,$t9
/* 14f4c: 00094840 */ sll $t1,$t1,0x1
/* 14f50: 01095021 */ addu $t2,$t0,$t1
/* 14f54: 81420003 */ lb $v0,0x3($t2)
/* 14f58: 03e00008 */ jr $ra
/* 14f5c: 00000000 */ nop
);
s8 contGetStickY(s8 contpadnum)
{
if (var8005ee60->unk200 < 0 && (var8005eeac >> contpadnum & 1) == 0) {
var8005ee7c[contpadnum]++;
return 0;
}
if (var80099e68[contpadnum] > 0) {
return 0;
}
return var8005ee60->samples[var8005ee60->index].pads[contpadnum].stick_y;
}
GLOBAL_ASM(
glabel func00014f60