diff --git a/src/game/game_016100.c b/src/game/game_016100.c index 434e6bbea..72a464d93 100644 --- a/src/game/game_016100.c +++ b/src/game/game_016100.c @@ -4810,7 +4810,7 @@ glabel var7f1a84c0 /* f01a430: 0c002ee8 */ jal func0000bba0 /* f01a434: 240500dc */ addiu $a1,$zero,0xdc /* f01a438: 24040140 */ addiu $a0,$zero,0x140 -/* f01a43c: 0fc4a2a7 */ jal func0f128a9c +/* f01a43c: 0fc4a2a7 */ jal currentPlayerSetViewSize /* f01a440: 240500dc */ addiu $a1,$zero,0xdc /* f01a444: 24040140 */ addiu $a0,$zero,0x140 /* f01a448: 0c002f0a */ jal func0000bc28 @@ -5156,14 +5156,14 @@ glabel var7f1a851c /* f01a854: 24040240 */ addiu $a0,$zero,0x240 /* f01a858: 3c058006 */ lui $a1,%hi(var800624a0) /* f01a85c: 84a524a0 */ lh $a1,%lo(var800624a0)($a1) -/* f01a860: 0fc4a2a7 */ jal func0f128a9c +/* f01a860: 0fc4a2a7 */ jal currentPlayerSetViewSize /* f01a864: 24040240 */ addiu $a0,$zero,0x240 /* f01a868: 3c058006 */ lui $a1,%hi(var800624a0) /* f01a86c: 84a524a0 */ lh $a1,%lo(var800624a0)($a1) /* f01a870: 0c002f0a */ jal func0000bc28 /* f01a874: 24040240 */ addiu $a0,$zero,0x240 /* f01a878: 00002025 */ or $a0,$zero,$zero -/* f01a87c: 0fc4a2ae */ jal func0f128ab8 +/* f01a87c: 0fc4a2ae */ jal currentPlayerSetViewPosition /* f01a880: 00002825 */ or $a1,$zero,$zero /* f01a884: 00002025 */ or $a0,$zero,$zero /* f01a888: 0c002f2a */ jal func0000bca8 @@ -5588,14 +5588,14 @@ glabel func0f01adb8 /* f01ade4: 24040240 */ addiu $a0,$zero,0x240 /* f01ade8: 3c058006 */ lui $a1,%hi(var800624a0) /* f01adec: 84a524a0 */ lh $a1,%lo(var800624a0)($a1) -/* f01adf0: 0fc4a2a7 */ jal func0f128a9c +/* f01adf0: 0fc4a2a7 */ jal currentPlayerSetViewSize /* f01adf4: 24040240 */ addiu $a0,$zero,0x240 /* f01adf8: 3c058006 */ lui $a1,%hi(var800624a0) /* f01adfc: 84a524a0 */ lh $a1,%lo(var800624a0)($a1) /* f01ae00: 0c002f0a */ jal func0000bc28 /* f01ae04: 24040240 */ addiu $a0,$zero,0x240 /* f01ae08: 00002025 */ or $a0,$zero,$zero -/* f01ae0c: 0fc4a2ae */ jal func0f128ab8 +/* f01ae0c: 0fc4a2ae */ jal currentPlayerSetViewPosition /* f01ae10: 00002825 */ or $a1,$zero,$zero /* f01ae14: 00002025 */ or $a0,$zero,$zero /* f01ae18: 0c002f2a */ jal func0000bca8 diff --git a/src/game/game_0b63b0.c b/src/game/game_0b63b0.c index 5e24cb1f1..7da43ba9d 100644 --- a/src/game/game_0b63b0.c +++ b/src/game/game_0b63b0.c @@ -8388,7 +8388,7 @@ glabel func0f0bd764 /* f0bd7b0: 0fc2f2a8 */ jal func0f0bcaa0 /* f0bd7b4: 01c08025 */ or $s0,$t6,$zero /* f0bd7b8: 02002025 */ or $a0,$s0,$zero -/* f0bd7bc: 0fc4a2a7 */ jal func0f128a9c +/* f0bd7bc: 0fc4a2a7 */ jal currentPlayerSetViewSize /* f0bd7c0: 00402825 */ or $a1,$v0,$zero /* f0bd7c4: 0fc2f1eb */ jal func0f0bc7ac /* f0bd7c8: 00000000 */ sll $zero,$zero,0x0 @@ -8397,7 +8397,7 @@ glabel func0f0bd764 /* f0bd7d4: 0fc2f389 */ jal func0f0bce24 /* f0bd7d8: 01e08025 */ or $s0,$t7,$zero /* f0bd7dc: 02002025 */ or $a0,$s0,$zero -/* f0bd7e0: 0fc4a2ae */ jal func0f128ab8 +/* f0bd7e0: 0fc4a2ae */ jal currentPlayerSetViewPosition /* f0bd7e4: 00402825 */ or $a1,$v0,$zero /* f0bd7e8: 3c188007 */ lui $t8,%hi(var800706c8) /* f0bd7ec: 8f1806c8 */ lw $t8,%lo(var800706c8)($t8) @@ -8638,7 +8638,7 @@ glabel var7f1ad6ac /* f0bdaec: 0fc2f2a8 */ jal func0f0bcaa0 /* f0bdaf0: 01a08025 */ or $s0,$t5,$zero /* f0bdaf4: 02002025 */ or $a0,$s0,$zero -/* f0bdaf8: 0fc4a2a7 */ jal func0f128a9c +/* f0bdaf8: 0fc4a2a7 */ jal currentPlayerSetViewSize /* f0bdafc: 00402825 */ or $a1,$v0,$zero /* f0bdb00: 0fc2f1eb */ jal func0f0bc7ac /* f0bdb04: 00000000 */ sll $zero,$zero,0x0 @@ -8647,7 +8647,7 @@ glabel var7f1ad6ac /* f0bdb10: 0fc2f389 */ jal func0f0bce24 /* f0bdb14: 01c08025 */ or $s0,$t6,$zero /* f0bdb18: 02002025 */ or $a0,$s0,$zero -/* f0bdb1c: 0fc4a2ae */ jal func0f128ab8 +/* f0bdb1c: 0fc4a2ae */ jal currentPlayerSetViewPosition /* f0bdb20: 00402825 */ or $a1,$v0,$zero /* f0bdb24: 8e2f0000 */ lw $t7,0x0($s1) /* f0bdb28: 3c048007 */ lui $a0,%hi(var800705c0+0x10) diff --git a/src/game/game_127910.c b/src/game/game_127910.c index c7a6b0f28..a7e46fa57 100644 --- a/src/game/game_127910.c +++ b/src/game/game_127910.c @@ -87,11 +87,11 @@ void playersAllocate(s32 count) if (g_Vars.unk0004e0) { s16 a = func0f0bc44c(); s16 b = func0f0bc478(); - func0f128a9c(a, b << 1); + currentPlayerSetViewSize(a, b << 1); } else { s16 a = func0f0bc44c(); s16 b = func0f0bc478(); - func0f128a9c(a, b); + currentPlayerSetViewSize(a, b); } g_Vars.coop = NULL; @@ -1235,16 +1235,16 @@ glabel propGetPlayerNum /* f128a98: 27bd0008 */ addiu $sp,$sp,0x8 ); -void func0f128a9c(u32 arg0, u32 arg1) +void currentPlayerSetViewSize(s32 viewx, s32 viewy) { - g_Vars.currentplayer->unk0630 = arg0; - g_Vars.currentplayer->unk0632 = arg1; + g_Vars.currentplayer->viewx = viewx; + g_Vars.currentplayer->viewy = viewy; } -void func0f128ab8(u32 arg0, u32 arg1) +void currentPlayerSetViewPosition(s32 viewleft, s32 viewtop) { - g_Vars.currentplayer->unk0634 = arg0; - g_Vars.currentplayer->unk0636 = arg1; + g_Vars.currentplayer->viewleft = viewleft; + g_Vars.currentplayer->viewtop = viewtop; } void currentPlayerSetFovY(f32 fovy) diff --git a/src/game/game_157db0.c b/src/game/game_157db0.c index 0cf2192e7..e13d09af6 100644 --- a/src/game/game_157db0.c +++ b/src/game/game_157db0.c @@ -5476,25 +5476,14 @@ glabel func0f15cae0 /* f15cb70: c7000004 */ lwc1 $f0,0x4($t8) ); -GLOBAL_ASM( -glabel func0f15cb74 -/* f15cb74: 3c02800a */ lui $v0,%hi(g_Vars+0x284) -/* f15cb78: 8c42a244 */ lw $v0,%lo(g_Vars+0x284)($v0) -/* f15cb7c: 27bdffe0 */ addiu $sp,$sp,-32 -/* f15cb80: afbf001c */ sw $ra,0x1c($sp) -/* f15cb84: 844f0632 */ lh $t7,0x632($v0) -/* f15cb88: 84460636 */ lh $a2,0x636($v0) -/* f15cb8c: 844e0630 */ lh $t6,0x630($v0) -/* f15cb90: 84450634 */ lh $a1,0x634($v0) -/* f15cb94: 00cfc021 */ addu $t8,$a2,$t7 -/* f15cb98: afb80010 */ sw $t8,0x10($sp) -/* f15cb9c: 0fc57306 */ jal func0f15cc18 -/* f15cba0: 00ae3821 */ addu $a3,$a1,$t6 -/* f15cba4: 8fbf001c */ lw $ra,0x1c($sp) -/* f15cba8: 27bd0020 */ addiu $sp,$sp,0x20 -/* f15cbac: 03e00008 */ jr $ra -/* f15cbb0: 00000000 */ sll $zero,$zero,0x0 -); +Gfx *func0f15cb74(Gfx *gdl) +{ + return func0f15cc18(gdl, + g_Vars.currentplayer->viewleft, + g_Vars.currentplayer->viewtop, + g_Vars.currentplayer->viewleft + g_Vars.currentplayer->viewx, + g_Vars.currentplayer->viewtop + g_Vars.currentplayer->viewy); +} GLOBAL_ASM( glabel func0f15cbb4 diff --git a/src/gvars/gvars.c b/src/gvars/gvars.c index 6d06081fc..eccb925c3 100644 --- a/src/gvars/gvars.c +++ b/src/gvars/gvars.c @@ -21403,28 +21403,7 @@ u32 var800acc78 = 0; u32 var800acc7c = 0; struct chrdata *g_MpSimulantChrs[MAX_SIMULANTS] = {NULL}; u8 var800acca0[40] = {0}; -u8 g_MpChallengesCompleted[4] = {0}; // This is one *byte* per option, and length is unknown -u32 var800acccc = 0; -u32 var800accd0 = 0; -u32 var800accd4 = 0; -u32 var800accd8 = 0; -u32 var800accdc = 0; -u32 var800acce0 = 0; -u32 var800acce4 = 0; -u32 var800acce8 = 0; -u32 var800accec = 0; -u32 var800accf0 = 0; -u32 var800accf4 = 0; -u32 var800accf8 = 0; -u32 var800accfc = 0; -u32 var800acd00 = 0; -u32 var800acd04 = 0; -u32 var800acd08 = 0; -u32 var800acd0c = 0; -u32 var800acd10 = 0; -u32 var800acd14 = 0; -u32 var800acd18 = 0; -u32 var800acd1c = 0; +u8 g_MpChallengesCompleted[88] = {0}; // This is one *byte* per challenge, and length is at least 64 struct frdata g_FiringRangeData = {0}; struct trainingdata g_DeviceTrainingData = {0}; struct trainingdata g_HoloTrainingData = {0}; diff --git a/src/include/game/game_127910.h b/src/include/game/game_127910.h index 523c1fed1..07951d4da 100644 --- a/src/include/game/game_127910.h +++ b/src/include/game/game_127910.h @@ -9,8 +9,8 @@ void playersAllocate(s32 count); void playerAllocate(u32 index); void currentPlayerCalculateAiBuddyNums(void); u32 propGetPlayerNum(struct prop *prop); -void func0f128a9c(u32 arg0, u32 arg1); -void func0f128ab8(u32 arg0, u32 arg1); +void currentPlayerSetViewSize(s32 viewx, s32 viewy); +void currentPlayerSetViewPosition(s32 viewleft, s32 viewtop); void currentPlayerSetFovY(f32 fovy); void currentPlayerSetAspectRatio(f32 aspect); s32 weaponGetModel(s32 arg0); diff --git a/src/include/game/game_157db0.h b/src/include/game/game_157db0.h index 14dbbfdbc..b9af138ad 100644 --- a/src/include/game/game_157db0.h +++ b/src/include/game/game_157db0.h @@ -33,9 +33,9 @@ void currentPlayerSetScaleBg2Gfx(f32 arg0); void func0f15c920(void); u32 func0f15ca00(void); u32 func0f15cae0(void); -u32 func0f15cb74(void); +Gfx *func0f15cb74(Gfx *gdl); u32 func0f15cbb4(void); -u32 func0f15cc18(void); +Gfx *func0f15cc18(Gfx *gdl, s32 viewleft, s32 viewtop, s32 arg3, s32 arg4); void func0f15cd28(void); bool func0f15cd90(u32 room, struct screenbox *arg1); bool func0f15d08c(struct coord *a, struct coord *b); diff --git a/src/include/types.h b/src/include/types.h index d9fa92280..b546c4dec 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -1970,10 +1970,10 @@ struct player { /*0x0624*/ u32 unk0624; /*0x0628*/ u32 unk0628; /*0x062c*/ u32 unk062c; - /*0x0630*/ u16 unk0630; - /*0x0632*/ u16 unk0632; - /*0x0634*/ u16 unk0634; - /*0x0636*/ u16 unk0636; + /*0x0630*/ s16 viewx; // 320 lo-res, 640 hi-res + /*0x0632*/ s16 viewy; // 220 regardless of res + /*0x0634*/ s16 viewleft; // 0 + /*0x0636*/ s16 viewtop; // 0 /*0x0638*/ struct player638 unk0638[2]; /*0x1580*/ s8 unk1580; /*0x1581*/ u8 unk1581;