Decompile viGetZRange

This commit is contained in:
Ryan Dwyer 2020-06-15 19:27:26 +10:00
parent 2f9c06b9ac
commit 4d8b24f577
5 changed files with 18 additions and 21 deletions

View File

@ -6955,7 +6955,7 @@ bool func0f15cd90(u32 room, struct screenbox *screen)
}
if (func0f15d08c(&corner, &roomscreenpos) == 0) {
if (var800a4cf0.unk0c <= -roomscreenpos.z) {
if (var800a4cf0.zrange.far <= -roomscreenpos.z) {
numb++;
}
@ -6977,7 +6977,7 @@ bool func0f15cd90(u32 room, struct screenbox *screen)
numa++;
} else {
if (var800a4cf0.unk0c <= -roomscreenpos.z) {
if (var800a4cf0.zrange.far <= -roomscreenpos.z) {
numb++;
}
@ -14875,7 +14875,7 @@ glabel func0f163e34
/* f163e9c: c60417a0 */ lwc1 $f4,0x17a0($s0)
/* f163ea0: 4600218d */ trunc.w.s $f6,$f4
/* f163ea4: 440c3000 */ mfc1 $t4,$f6
/* f163ea8: 0c002fb8 */ jal func0000bee0
/* f163ea8: 0c002fb8 */ jal viGetZRange
/* f163eac: a7ac003e */ sh $t4,0x3e($sp)
/* f163eb0: 8e4d0288 */ lw $t5,0x288($s2)
/* f163eb4: 3c08800a */ lui $t0,%hi(var800a4cf0)
@ -15082,8 +15082,8 @@ glabel func0f163e34
// box.xmax = player->screenxmaxf;
// box.ymax = player->screenymaxf;
//
// func0000bee0(&var800a4cf0.unk08);
// var800a4cf0.unk0c = var800a4cf0.unk0c / g_Vars.currentplayerstats->scale_bg2gfx;
// viGetZRange(&var800a4cf0.zrange);
// var800a4cf0.zrange.far = var800a4cf0.zrange.far / g_Vars.currentplayerstats->scale_bg2gfx;
//
// for (i = 0; i < g_Vars.roomcount; i++) {
// g_Rooms[i].flags &= ~0x2d;

View File

@ -153,7 +153,7 @@ glabel func0f1657f8
/* f165804: afbf0014 */ sw $ra,0x14($sp)
/* f165808: 51c0005d */ beqzl $t6,.L0f165980
/* f16580c: 8fbf0014 */ lw $ra,0x14($sp)
/* f165810: 0c002fb8 */ jal func0000bee0
/* f165810: 0c002fb8 */ jal viGetZRange
/* f165814: 27a40038 */ addiu $a0,$sp,0x38
/* f165818: 0fc5722e */ jal currentPlayerGetScaleBg2Gfx
/* f16581c: 00000000 */ sll $zero,$zero,0x0

View File

@ -54,7 +54,7 @@ u32 func0000bdc8(void);
void func0000bdd8(f32 arg0, f32 arg1, s16 viewx, s16 viewy);
f32 viGetFovY(void);
void func0000be84(f32 arg0, f32 arg1);
void func0000bee0(f32 *arg0);
void viGetZRange(struct zrange *zrange);
u32 func0000bf04(void);
#endif

View File

@ -5772,12 +5772,16 @@ struct var800a4640 {
struct screenbox unk2d4;
};
struct zrange {
f32 near;
f32 far;
};
struct var800a4cf0 {
u16 unk00;
u16 unk02;
u16 unk04;
f32 unk08;
f32 unk0c;
struct zrange zrange;
};
struct menuthing {

View File

@ -2968,18 +2968,11 @@ glabel func0000be84
/* bedc: 00000000 */ sll $zero,$zero,0x0
);
GLOBAL_ASM(
glabel func0000bee0
/* bee0: 3c028006 */ lui $v0,%hi(g_ViData)
/* bee4: 2442d594 */ addiu $v0,$v0,%lo(g_ViData)
/* bee8: 8c4e0000 */ lw $t6,0x0($v0)
/* beec: c5c40010 */ lwc1 $f4,0x10($t6)
/* bef0: e4840000 */ swc1 $f4,0x0($a0)
/* bef4: 8c4f0000 */ lw $t7,0x0($v0)
/* bef8: c5e60014 */ lwc1 $f6,0x14($t7)
/* befc: 03e00008 */ jr $ra
/* bf00: e4860004 */ swc1 $f6,0x4($a0)
);
void viGetZRange(struct zrange *zrange)
{
zrange->near = g_ViData->znear;
zrange->far = g_ViData->zfar;
}
GLOBAL_ASM(
glabel func0000bf04