diff --git a/asm/non_matchings/controller_pak/load_asset_section_from_rom.s b/asm/non_matchings/asset_loading/load_asset_section_from_rom.s similarity index 100% rename from asm/non_matchings/controller_pak/load_asset_section_from_rom.s rename to asm/non_matchings/asset_loading/load_asset_section_from_rom.s diff --git a/asm/non_matchings/unknown_066AA0/func_80065EA0.s b/asm/non_matchings/camera/func_80065EA0.s similarity index 98% rename from asm/non_matchings/unknown_066AA0/func_80065EA0.s rename to asm/non_matchings/camera/func_80065EA0.s index 23d23556..21e75683 100644 --- a/asm/non_matchings/unknown_066AA0/func_80065EA0.s +++ b/asm/non_matchings/camera/func_80065EA0.s @@ -113,10 +113,10 @@ glabel func_80065EA0 /* 066C38 80066038 3C014270 */ li $at, 0x42700000 # 60.000000 /* 066C3C 8006603C 44815000 */ mtc1 $at, $f10 /* 066C40 80066040 8FBF0034 */ lw $ra, 0x34($sp) -/* 066C44 80066044 3C018012 */ lui $at, %hi(D_80120D10) # $at, 0x8012 +/* 066C44 80066044 3C018012 */ lui $at, %hi(gCurCamFOV) # $at, 0x8012 /* 066C48 80066048 8FB00028 */ lw $s0, 0x28($sp) /* 066C4C 8006604C 8FB1002C */ lw $s1, 0x2c($sp) /* 066C50 80066050 8FB20030 */ lw $s2, 0x30($sp) /* 066C54 80066054 27BD0038 */ addiu $sp, $sp, 0x38 /* 066C58 80066058 03E00008 */ jr $ra -/* 066C5C 8006605C E42A0D10 */ swc1 $f10, %lo(D_80120D10)($at) +/* 066C5C 8006605C E42A0D10 */ swc1 $f10, %lo(gCurCamFOV)($at) diff --git a/asm/non_matchings/unknown_066AA0/func_80066610.s b/asm/non_matchings/camera/func_80066610.s similarity index 97% rename from asm/non_matchings/unknown_066AA0/func_80066610.s rename to asm/non_matchings/camera/func_80066610.s index ac22b253..7564d30b 100644 --- a/asm/non_matchings/unknown_066AA0/func_80066610.s +++ b/asm/non_matchings/camera/func_80066610.s @@ -8,7 +8,7 @@ glabel func_80066610 /* 067228 80066628 240F0001 */ li $t7, 1 /* 06722C 8006662C AFBE0038 */ sw $fp, 0x38($sp) /* 067230 80066630 AFB60030 */ sw $s6, 0x30($sp) -/* 067234 80066634 3C10800E */ lui $s0, %hi(D_800DD064) # $s0, 0x800e +/* 067234 80066634 3C10800E */ lui $s0, %hi(gScreenViewports) # $s0, 0x800e /* 067238 80066638 01EEC023 */ subu $t8, $t7, $t6 /* 06723C 8006663C AFBF003C */ sw $ra, 0x3c($sp) /* 067240 80066640 AFB5002C */ sw $s5, 0x2c($sp) @@ -17,7 +17,7 @@ glabel func_80066610 /* 06724C 8006664C AFB20020 */ sw $s2, 0x20($sp) /* 067250 80066650 AFB1001C */ sw $s1, 0x1c($sp) /* 067254 80066654 AEF80000 */ sw $t8, ($s7) -/* 067258 80066658 2610D064 */ addiu $s0, %lo(D_800DD064) # addiu $s0, $s0, -0x2f9c +/* 067258 80066658 2610D064 */ addiu $s0, %lo(gScreenViewports) # addiu $s0, $s0, -0x2f9c /* 06725C 8006665C 0000B025 */ move $s6, $zero /* 067260 80066660 241EFFFE */ li $fp, -2 .L80066664: diff --git a/asm/non_matchings/unknown_066AA0/func_80066940.s b/asm/non_matchings/camera/func_80066940.s similarity index 89% rename from asm/non_matchings/unknown_066AA0/func_80066940.s rename to asm/non_matchings/camera/func_80066940.s index 1079bef0..e4e679a1 100644 --- a/asm/non_matchings/unknown_066AA0/func_80066940.s +++ b/asm/non_matchings/camera/func_80066940.s @@ -38,8 +38,8 @@ glabel func_80066940 /* 0675C4 800669C4 01E87823 */ subu $t7, $t7, $t0 /* 0675C8 800669C8 000F7880 */ sll $t7, $t7, 2 /* 0675CC 800669CC 01E87821 */ addu $t7, $t7, $t0 -/* 0675D0 800669D0 3C18800E */ lui $t8, %hi(D_800DD064) # $t8, 0x800e -/* 0675D4 800669D4 2718D064 */ addiu $t8, %lo(D_800DD064) # addiu $t8, $t8, -0x2f9c +/* 0675D0 800669D0 3C18800E */ lui $t8, %hi(gScreenViewports) # $t8, 0x800e +/* 0675D4 800669D4 2718D064 */ addiu $t8, %lo(gScreenViewports) # addiu $t8, $t8, -0x2f9c /* 0675D8 800669D8 000F7880 */ sll $t7, $t7, 2 /* 0675DC 800669DC 01F81021 */ addu $v0, $t7, $t8 /* 0675E0 800669E0 AC400020 */ sw $zero, 0x20($v0) @@ -54,8 +54,8 @@ glabel func_80066940 /* 067600 80066A00 0328C823 */ subu $t9, $t9, $t0 /* 067604 80066A04 0019C880 */ sll $t9, $t9, 2 /* 067608 80066A08 0328C821 */ addu $t9, $t9, $t0 -/* 06760C 80066A0C 3C09800E */ lui $t1, %hi(D_800DD064) # $t1, 0x800e -/* 067610 80066A10 2529D064 */ addiu $t1, %lo(D_800DD064) # addiu $t1, $t1, -0x2f9c +/* 06760C 80066A0C 3C09800E */ lui $t1, %hi(gScreenViewports) # $t1, 0x800e +/* 067610 80066A10 2529D064 */ addiu $t1, %lo(gScreenViewports) # addiu $t1, $t1, -0x2f9c /* 067614 80066A14 0019C880 */ sll $t9, $t9, 2 /* 067618 80066A18 03291021 */ addu $v0, $t9, $t1 /* 06761C 80066A1C 1000000A */ b .L80066A48 @@ -65,8 +65,8 @@ glabel func_80066940 /* 067628 80066A28 01485023 */ subu $t2, $t2, $t0 /* 06762C 80066A2C 000A5080 */ sll $t2, $t2, 2 /* 067630 80066A30 01485021 */ addu $t2, $t2, $t0 -/* 067634 80066A34 3C0B800E */ lui $t3, %hi(D_800DD064) # $t3, 0x800e -/* 067638 80066A38 256BD064 */ addiu $t3, %lo(D_800DD064) # addiu $t3, $t3, -0x2f9c +/* 067634 80066A34 3C0B800E */ lui $t3, %hi(gScreenViewports) # $t3, 0x800e +/* 067638 80066A38 256BD064 */ addiu $t3, %lo(gScreenViewports) # addiu $t3, $t3, -0x2f9c /* 06763C 80066A3C 000A5080 */ sll $t2, $t2, 2 /* 067640 80066A40 014B1021 */ addu $v0, $t2, $t3 /* 067644 80066A44 AC450020 */ sw $a1, 0x20($v0) diff --git a/asm/non_matchings/unknown_066AA0/func_80066CDC.s b/asm/non_matchings/camera/func_80066CDC.s similarity index 99% rename from asm/non_matchings/unknown_066AA0/func_80066CDC.s rename to asm/non_matchings/camera/func_80066CDC.s index 6912cd3e..a2e075a3 100644 --- a/asm/non_matchings/unknown_066AA0/func_80066CDC.s +++ b/asm/non_matchings/camera/func_80066CDC.s @@ -27,8 +27,8 @@ glabel func_80066CDC /* 06793C 80066D3C 8FA90030 */ lw $t1, 0x30($sp) /* 067940 80066D40 240B0034 */ li $t3, 52 /* 067944 80066D44 012B0019 */ multu $t1, $t3 -/* 067948 80066D48 3C0A800E */ lui $t2, %hi(D_800DD064) # $t2, 0x800e -/* 06794C 80066D4C 254AD064 */ addiu $t2, %lo(D_800DD064) # addiu $t2, $t2, -0x2f9c +/* 067948 80066D48 3C0A800E */ lui $t2, %hi(gScreenViewports) # $t2, 0x800e +/* 06794C 80066D4C 254AD064 */ addiu $t2, %lo(gScreenViewports) # addiu $t2, $t2, -0x2f9c /* 067950 80066D50 3C1F8012 */ lui $ra, %hi(D_80120CE4) # $ra, 0x8012 /* 067954 80066D54 00024402 */ srl $t0, $v0, 0x10 /* 067958 80066D58 27FF0CE4 */ addiu $ra, %lo(D_80120CE4) # addiu $ra, $ra, 0xce4 diff --git a/asm/non_matchings/unknown_066AA0/func_80067A3C.s b/asm/non_matchings/camera/func_80067A3C.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_80067A3C.s rename to asm/non_matchings/camera/func_80067A3C.s diff --git a/asm/non_matchings/unknown_066AA0/func_80067D3C.s b/asm/non_matchings/camera/func_80067D3C.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_80067D3C.s rename to asm/non_matchings/camera/func_80067D3C.s diff --git a/asm/non_matchings/unknown_066AA0/func_80067F2C.s b/asm/non_matchings/camera/func_80067F2C.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_80067F2C.s rename to asm/non_matchings/camera/func_80067F2C.s diff --git a/asm/non_matchings/unknown_066AA0/func_80068158.s b/asm/non_matchings/camera/func_80068158.s similarity index 96% rename from asm/non_matchings/unknown_066AA0/func_80068158.s rename to asm/non_matchings/camera/func_80068158.s index 9bf203a1..2cc286ef 100644 --- a/asm/non_matchings/unknown_066AA0/func_80068158.s +++ b/asm/non_matchings/camera/func_80068158.s @@ -25,14 +25,14 @@ glabel func_80068158 /* 068DAC 800681AC 00053023 */ negu $a2, $a1 .L800681B0: /* 068DB0 800681B0 8CE50000 */ lw $a1, ($a3) -/* 068DB4 800681B4 3C19800E */ lui $t9, %hi(D_800DD064 + 0x30) # $t9, 0x800e +/* 068DB4 800681B4 3C19800E */ lui $t9, %hi(gScreenViewports + 0x30) # $t9, 0x800e /* 068DB8 800681B8 0005C080 */ sll $t8, $a1, 2 /* 068DBC 800681BC 0305C023 */ subu $t8, $t8, $a1 /* 068DC0 800681C0 0018C080 */ sll $t8, $t8, 2 /* 068DC4 800681C4 0305C021 */ addu $t8, $t8, $a1 /* 068DC8 800681C8 0018C080 */ sll $t8, $t8, 2 /* 068DCC 800681CC 0338C821 */ addu $t9, $t9, $t8 -/* 068DD0 800681D0 8F39D094 */ lw $t9, %lo(D_800DD064 + 0x30)($t9) +/* 068DD0 800681D0 8F39D094 */ lw $t9, %lo(gScreenViewports + 0x30)($t9) /* 068DD4 800681D4 3C0A800E */ lui $t2, %hi(D_800DD148) # $t2, 0x800e /* 068DD8 800681D8 332B0001 */ andi $t3, $t9, 1 /* 068DDC 800681DC 1560001A */ bnez $t3, .L80068248 diff --git a/asm/non_matchings/unknown_066AA0/func_800682AC.s b/asm/non_matchings/camera/func_800682AC.s similarity index 96% rename from asm/non_matchings/unknown_066AA0/func_800682AC.s rename to asm/non_matchings/camera/func_800682AC.s index e232409a..a5e60cd9 100644 --- a/asm/non_matchings/unknown_066AA0/func_800682AC.s +++ b/asm/non_matchings/camera/func_800682AC.s @@ -8,14 +8,14 @@ glabel func_800682AC /* 068EC4 800682C4 AFA40020 */ sw $a0, 0x20($sp) /* 068EC8 800682C8 3C0F8012 */ lui $t7, %hi(D_80120CE4) # $t7, 0x8012 /* 068ECC 800682CC 8DEF0CE4 */ lw $t7, %lo(D_80120CE4)($t7) -/* 068ED0 800682D0 3C19800E */ lui $t9, %hi(D_800DD064 + 0x30) # $t9, 0x800e +/* 068ED0 800682D0 3C19800E */ lui $t9, %hi(gScreenViewports + 0x30) # $t9, 0x800e /* 068ED4 800682D4 000FC080 */ sll $t8, $t7, 2 /* 068ED8 800682D8 030FC023 */ subu $t8, $t8, $t7 /* 068EDC 800682DC 0018C080 */ sll $t8, $t8, 2 /* 068EE0 800682E0 030FC021 */ addu $t8, $t8, $t7 /* 068EE4 800682E4 0018C080 */ sll $t8, $t8, 2 /* 068EE8 800682E8 0338C821 */ addu $t9, $t9, $t8 -/* 068EEC 800682EC 8F39D094 */ lw $t9, %lo(D_800DD064 + 0x30)($t9) +/* 068EEC 800682EC 8F39D094 */ lw $t9, %lo(gScreenViewports + 0x30)($t9) /* 068EF0 800682F0 8FA40020 */ lw $a0, 0x20($sp) /* 068EF4 800682F4 332A0001 */ andi $t2, $t9, 1 /* 068EF8 800682F8 00024402 */ srl $t0, $v0, 0x10 diff --git a/asm/non_matchings/unknown_066AA0/func_80068514.s b/asm/non_matchings/camera/func_80068514.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_80068514.s rename to asm/non_matchings/camera/func_80068514.s diff --git a/asm/non_matchings/unknown_066AA0/func_80068BF4.s b/asm/non_matchings/camera/func_80068BF4.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_80068BF4.s rename to asm/non_matchings/camera/func_80068BF4.s diff --git a/asm/non_matchings/unknown_066AA0/func_80068FA8.s b/asm/non_matchings/camera/func_80068FA8.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_80068FA8.s rename to asm/non_matchings/camera/func_80068FA8.s diff --git a/asm/non_matchings/unknown_066AA0/func_80069484.s b/asm/non_matchings/camera/func_80069484.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_80069484.s rename to asm/non_matchings/camera/func_80069484.s diff --git a/asm/non_matchings/unknown_066AA0/func_80069790.s b/asm/non_matchings/camera/func_80069790.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_80069790.s rename to asm/non_matchings/camera/func_80069790.s diff --git a/asm/non_matchings/unknown_066AA0/func_80069A40.s b/asm/non_matchings/camera/func_80069A40.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_80069A40.s rename to asm/non_matchings/camera/func_80069A40.s diff --git a/asm/non_matchings/unknown_066AA0/func_80069F28.s b/asm/non_matchings/camera/func_80069F28.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_80069F28.s rename to asm/non_matchings/camera/func_80069F28.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006A10C.s b/asm/non_matchings/camera/func_8006A10C.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006A10C.s rename to asm/non_matchings/camera/func_8006A10C.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006A1C4.s b/asm/non_matchings/camera/func_8006A1C4.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006A1C4.s rename to asm/non_matchings/camera/func_8006A1C4.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006A434.s b/asm/non_matchings/camera/func_8006A434.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006A434.s rename to asm/non_matchings/camera/func_8006A434.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006A6B0.s b/asm/non_matchings/unknown_06B2B0/func_8006A6B0.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006A6B0.s rename to asm/non_matchings/unknown_06B2B0/func_8006A6B0.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006BDDC.s b/asm/non_matchings/unknown_06B2B0/func_8006BDDC.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006BDDC.s rename to asm/non_matchings/unknown_06B2B0/func_8006BDDC.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006BFC8.s b/asm/non_matchings/unknown_06B2B0/func_8006BFC8.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006BFC8.s rename to asm/non_matchings/unknown_06B2B0/func_8006BFC8.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006C3E0.s b/asm/non_matchings/unknown_06B2B0/func_8006C3E0.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006C3E0.s rename to asm/non_matchings/unknown_06B2B0/func_8006C3E0.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006CCF0.s b/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006CCF0.s rename to asm/non_matchings/unknown_06B2B0/func_8006CCF0.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006DCF8.s b/asm/non_matchings/unknown_06B2B0/func_8006DCF8.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006DCF8.s rename to asm/non_matchings/unknown_06B2B0/func_8006DCF8.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006E3BC.s b/asm/non_matchings/unknown_06B2B0/func_8006E3BC.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006E3BC.s rename to asm/non_matchings/unknown_06B2B0/func_8006E3BC.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006E770.s b/asm/non_matchings/unknown_06B2B0/func_8006E770.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006E770.s rename to asm/non_matchings/unknown_06B2B0/func_8006E770.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006ECFC.s b/asm/non_matchings/unknown_06B2B0/func_8006ECFC.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006ECFC.s rename to asm/non_matchings/unknown_06B2B0/func_8006ECFC.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006EFB8.s b/asm/non_matchings/unknown_06B2B0/func_8006EFB8.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006EFB8.s rename to asm/non_matchings/unknown_06B2B0/func_8006EFB8.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006EFDC.s b/asm/non_matchings/unknown_06B2B0/func_8006EFDC.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006EFDC.s rename to asm/non_matchings/unknown_06B2B0/func_8006EFDC.s diff --git a/asm/non_matchings/unknown_066AA0/func_8006F4EC.s b/asm/non_matchings/unknown_06B2B0/func_8006F4EC.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/func_8006F4EC.s rename to asm/non_matchings/unknown_06B2B0/func_8006F4EC.s diff --git a/asm/non_matchings/unknown_066AA0/load_level.s b/asm/non_matchings/unknown_06B2B0/load_level.s similarity index 99% rename from asm/non_matchings/unknown_066AA0/load_level.s rename to asm/non_matchings/unknown_06B2B0/load_level.s index 4705d209..205af418 100644 --- a/asm/non_matchings/unknown_066AA0/load_level.s +++ b/asm/non_matchings/unknown_06B2B0/load_level.s @@ -719,7 +719,7 @@ glabel load_level /* 06C8A8 8006BCA8 806C009C */ lb $t4, 0x9c($v1) /* 06C8AC 8006BCAC 00000000 */ nop /* 06C8B0 8006BCB0 448C2000 */ mtc1 $t4, $f4 -/* 06C8B4 8006BCB4 0C01983B */ jal func_800660EC +/* 06C8B4 8006BCB4 0C01983B */ jal update_camera_fov /* 06C8B8 8006BCB8 46802320 */ cvt.s.w $f12, $f4 /* 06C8BC 8006BCBC 8E230000 */ lw $v1, ($s1) /* 06C8C0 8006BCC0 00000000 */ nop diff --git a/asm/non_matchings/unknown_066AA0/render.s b/asm/non_matchings/unknown_06B2B0/render.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/render.s rename to asm/non_matchings/unknown_06B2B0/render.s diff --git a/asm/non_matchings/unknown_066AA0/thread3_main.s b/asm/non_matchings/unknown_06B2B0/thread3_main.s similarity index 100% rename from asm/non_matchings/unknown_066AA0/thread3_main.s rename to asm/non_matchings/unknown_06B2B0/thread3_main.s diff --git a/include/structs.h b/include/structs.h index f3af0025..a43d8baa 100644 --- a/include/structs.h +++ b/include/structs.h @@ -202,10 +202,10 @@ typedef struct LevelHeader { /* 0x98 */ s16 unk98; /* 0x9A */ s16 unk9A; - /* 0x9C */ s8 unk9C; - /* 0x9D */ u8 unk9D; - /* 0x9E */ u8 unk9E; - /* 0x9F */ u8 unk9F; + /* 0x9C */ s8 cameraFOV; // Must be a value within [0, 90] + /* 0x9D */ u8 bgColorRed; + /* 0x9E */ u8 bgColorGreen; + /* 0x9F */ u8 bgColorBlue; /* 0xA0 */ s32 unkA0; /* 0xA4 */ s32 unkA4; /* 0xA8 */ u16 unkA8; diff --git a/src/unknown_0777A0.c b/src/asset_loading.c similarity index 97% rename from src/unknown_0777A0.c rename to src/asset_loading.c index f52db102..ac36aad3 100644 --- a/src/unknown_0777A0.c +++ b/src/asset_loading.c @@ -1,7 +1,7 @@ /* The comment below is needed for this file to be picked up by generate_ld */ /* RAM_POS: 0x80076BA0 */ -#include "unknown_0777A0.h" +#include "asset_loading.h" #include "memory.h" //#include "assets.h" @@ -100,7 +100,7 @@ u8 *func_80076CF0(u32 assetIndex, s32 arg1) { return temp_v0_3; } #else -GLOBAL_ASM("asm/non_matchings/controller_pak/load_asset_section_from_rom.s") +GLOBAL_ASM("asm/non_matchings/asset_loading/load_asset_section_from_rom.s") #endif /** diff --git a/src/unknown_0777A0.h b/src/asset_loading.h similarity index 100% rename from src/unknown_0777A0.h rename to src/asset_loading.h diff --git a/src/unknown_066AA0.c b/src/camera.c similarity index 73% rename from src/unknown_066AA0.c rename to src/camera.c index f7e27d24..fe83c233 100644 --- a/src/unknown_066AA0.c +++ b/src/camera.c @@ -1,10 +1,7 @@ /* The comment below is needed for this file to be picked up by generate_ld */ /* RAM_POS: 0x80065EA0 */ -#include "types.h" -#include "macros.h" -#include "structs.h" -#include "fast3d.h" +#include "camera.h" extern u32 osTvType; @@ -24,97 +21,49 @@ const char D_800E7048[] = "camPopModelMtx: bsp stack negative overflow!!\n"; /************ .data ************/ -s32 D_800DD060 = 0; // Currently unknown, might be a different type. +s8 D_800DD060 = 0; -/* Size: 0x34 bytes. */ -typedef struct unk800DD064 { - s32 unk0; - s32 unk4; - s32 unk8; - s32 unkC; - s32 unk10; - s32 unk14; - s32 unk18; - s32 unk1C; - s32 unk20; - s32 unk24; - s32 unk28; - s32 unk2C; - s32 unk30; -} unk800DD064; +#define DEFAULT_VIEWPORT \ + 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, \ + SCREEN_WIDTH_HALF, SCREEN_HEIGHT_HALF, SCREEN_WIDTH, SCREEN_HEIGHT, \ + 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, \ + 0 -unk800DD064 D_800DD064[4] = { - { - 0x00, 0x00, 0x140, 0xF0, - 0xA0, 0x78, 0x140, 0xF0, - 0x00, 0x00, 0x13F, 0xEF, 0x00 - }, - { - 0x00, 0x00, 0x140, 0xF0, - 0xA0, 0x78, 0x140, 0xF0, - 0x00, 0x00, 0x13F, 0xEF, 0x00 - }, - { - 0x00, 0x00, 0x140, 0xF0, - 0xA0, 0x78, 0x140, 0xF0, - 0x00, 0x00, 0x13F, 0xEF, 0x00 - }, - { - 0x00, 0x00, 0x140, 0xF0, - 0xA0, 0x78, 0x140, 0xF0, - 0x00, 0x00, 0x13F, 0xEF, 0x00 - } +ScreenViewport gScreenViewports[4] = { + { DEFAULT_VIEWPORT }, + { DEFAULT_VIEWPORT }, + { DEFAULT_VIEWPORT }, + { DEFAULT_VIEWPORT }, }; -// Not sure about the typing here -s16 D_800DD134[10] = { - 0, 0, 0, 0, - 0, -1, -1, 0, - 0, 0 -}; +s32 D_800DD134 = 0; // Not sure about the typing here -u16 D_800DD148[160] = { - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0, - 0, 0, 0x01FF, 0 +s16 D_800DD138[8] = { + 0, 0, 0, -1, -1, 0, 0, 0 +}; + +s16 D_800DD148[20][8] = { + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, + { 0, 0, 0x01FF, 0, 0, 0, 0x01FF, 0 }, }; f32 D_800DD288[6] = { @@ -179,7 +128,7 @@ s32 D_80120CEC; s32 D_80120CF0[6]; s32 D_80120D08; s32 D_80120D0C; -f32 D_80120D10; +f32 gCurCamFOV; s8 D_80120D14; u8 D_80120D15; s32 D_80120D18; @@ -188,9 +137,9 @@ s32 D_80120D20[2]; s32 D_80120D28[6]; s32 D_80120D40[6]; s32 D_80120D58[6]; -s32 D_80120D70[6]; +Mtx *D_80120D70[6]; s32 D_80120D88[6]; -s32 D_80120DA0[80]; +Mtx D_80120DA0[5]; s32 D_80120EE0[16]; s32 D_80120F20[16]; s32 D_80120F60[16]; @@ -242,7 +191,41 @@ void func_800705F8(s32, f32, f32, f32); void func_8006ECFC(s32 arg0); -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80065EA0.s") +#ifdef NON_MATCHING +void func_800663DC(s32 x_pos, s32 y_pos, s32 z_pos, s32 arg3, s32 arg4, s32 arg5); +extern s32 D_A4600010; +extern s32 D_B0000578; + +void func_80065EA0(void) { + s32 i, j; + for(i = 0; i < 5; i++) { + D_80120D70[i] = &D_80120DA0[i]; + }; + for(j = 0; j < 8; j++) { + D_80120CE4 = j; + func_800663DC(200, 200, 200, 0, 0, 180); + }; + D_80120D14 = 0; + D_80120CE4 = 0; + D_80120D1C = 0; + D_80120D20[0] = 0; + D_80120CE0 = 0; + D_80120D0C = 0; + D_80120D18 = 0; + D_80120D15 = 0; + D_800DD060 = 0; + while (D_A4600010 & 3) { + } + if ((D_B0000578 & 0xFFFF) != 0x8965) { + D_800DD060 = 1; + } + guPerspectiveF(&D_80120EE0, &D_80120D58[5], CAMERA_DEFAULT_FOV, CAMERA_ASPECT, CAMERA_NEAR, CAMERA_FAR, CAMERA_SCALE); + func_8006F870(&D_80120EE0, &D_80120FE0); + gCurCamFOV = CAMERA_DEFAULT_FOV; +} +#else +GLOBAL_ASM("asm/non_matchings/camera/func_80065EA0.s") +#endif void func_80066060(s32 arg0, s32 arg1) { if (arg0 >= 0 && arg0 < 4) { @@ -264,20 +247,22 @@ void func_800660D0(void) { D_80120D18 = 0; } /* Unused? */ -f32 func_800660DC(void) { - return D_80120D10; +f32 get_current_camera_fov(void) { + return gCurCamFOV; } -void func_800660EC(f32 arg0) { - if (0.0f < arg0 && arg0 < 90.0f && arg0 != D_80120D10) { - D_80120D10 = arg0; - guPerspectiveF(&D_80120EE0, &D_80120D58[5], arg0, 1.33333333f, 10.0f, 15000.0f, 1.0f); +void update_camera_fov(f32 camFieldOfView) { + if (CAMERA_MIN_FOV < camFieldOfView && camFieldOfView < CAMERA_MAX_FOV && camFieldOfView != gCurCamFOV) { + gCurCamFOV = camFieldOfView; + guPerspectiveF(&D_80120EE0, &D_80120D58[5], camFieldOfView, + CAMERA_ASPECT, CAMERA_NEAR, CAMERA_FAR, CAMERA_SCALE); func_8006F870(&D_80120EE0, &D_80120FE0); } } void func_80066194(void) { - guPerspectiveF(&D_80120EE0, &D_80120D58[5], 60.0f, 1.33333333f, 10.0f, 15000.0f, 1.0f); + guPerspectiveF(&D_80120EE0, &D_80120D58[5], CAMERA_DEFAULT_FOV, + CAMERA_ASPECT, CAMERA_NEAR, CAMERA_FAR, CAMERA_SCALE); func_8006F870(&D_80120EE0, &D_80120FE0); } @@ -419,64 +404,128 @@ void func_800665E8(s32 arg0) { } } -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80066610.s") +#ifdef NON_MATCHING + +// Has regalloc/stack issues +void func_80066610(void) { + s32 s1; + s32 s2; + s32 s3; + s32 s4; + s32 s5; + s32 i; + + D_800DD134 = 1 - D_800DD134; + for(i = 0; i < 4; i++) { + if (gScreenViewports[i].flags & 4) { + gScreenViewports[i].flags &= ~1; + } else if (gScreenViewports[i].flags & 2) { + gScreenViewports[i].flags |= 1; + } + gScreenViewports[i].flags &= ~6; + if (gScreenViewports[i].flags & 1) { + if (!(gScreenViewports[i].flags & 8)) { + // Issue here + s5 = (gScreenViewports[i].unk0 * 4) + (((gScreenViewports[i].unk8 - gScreenViewports[i].unk0) + 1) * 2); + } else { + s5 = gScreenViewports[i].unk10; + s5 *= 4; + } + if (!(gScreenViewports[i].flags & 0x10)) { + // Issue here + s4 = (gScreenViewports[i].unk4 * 4) + (((gScreenViewports[i].unkC - gScreenViewports[i].unk4) + 1) * 2); + } else { + s4 = gScreenViewports[i].unk14; + s4 *= 4; + } + if (!(gScreenViewports[i].flags & 0x20)) { + s1 = gScreenViewports[i].unk8 - gScreenViewports[i].unk0; + s1 += 1; + s1 *= 2; + } else { + s1 = gScreenViewports[i].unk18; + s1 *= 2; + } + if (!(gScreenViewports[i].flags & 0x40)) { + s2 = gScreenViewports[i].unkC - gScreenViewports[i].unk4; + s2 += 1; + s2 *= 2; + } else { + s2 = gScreenViewports[i].unk1C; + s2 *= 2; + } + s3 = i + (D_800DD134 * 5); + s3 += 10; + if (get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) { + s2 = -s2; + } + D_800DD148[s3][4] = s5; + D_800DD148[s3][5] = s4; + D_800DD148[s3][0] = s1; + D_800DD148[s3][1] = s2; + } + } +} +#else +GLOBAL_ASM("asm/non_matchings/camera/func_80066610.s") +#endif void func_80066818(s32 arg0, s32 arg1) { if (arg1 != 0) { - D_800DD064[arg0].unk30 |= 1; + gScreenViewports[arg0].flags |= 1; } else { - D_800DD064[arg0].unk30 |= 2; + gScreenViewports[arg0].flags |= 2; } - D_800DD064[arg0].unk30 &= -5; + gScreenViewports[arg0].flags &= ~4; } void func_80066894(s32 arg0, s32 arg1) { if (arg1 != 0) { - D_800DD064[arg0].unk30 &= -2; + gScreenViewports[arg0].flags &= ~1; } else { - D_800DD064[arg0].unk30 |= 4; + gScreenViewports[arg0].flags |= 4; } - D_800DD064[arg0].unk30 &= -3; + gScreenViewports[arg0].flags &= ~2; } s32 func_80066910(s32 arg0) { - return D_800DD064[arg0].unk30 & 0x1; + return gScreenViewports[arg0].flags & 0x1; } -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80066940.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80066940.s") void func_80066AA8(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { if (arg1 != 0x8000) { - D_800DD064[arg0].unk10 = arg1; - D_800DD064[arg0].unk30 |= 8; + gScreenViewports[arg0].unk10 = arg1; + gScreenViewports[arg0].flags |= 8; } else { - D_800DD064[arg0].unk30 &= 0xFFFFFFF7; + gScreenViewports[arg0].flags &= ~8; } if (arg2 != 0x8000) { - D_800DD064[arg0].unk10 = arg2; - D_800DD064[arg0].unk30 |= 0x10; + gScreenViewports[arg0].unk10 = arg2; + gScreenViewports[arg0].flags |= 0x10; } else { - D_800DD064[arg0].unk30 &= 0xFFFFFFEF; + gScreenViewports[arg0].flags &= ~0x10; } if (arg3 != 0x8000) { - D_800DD064[arg0].unk18 = arg3; - D_800DD064[arg0].unk30 |= 0x20; + gScreenViewports[arg0].unk18 = arg3; + gScreenViewports[arg0].flags |= 0x20; } else { - D_800DD064[arg0].unk30 &= 0xFFFFFFDF; + gScreenViewports[arg0].flags &= ~0x20; } if (arg4 != 0x8000) { - D_800DD064[arg0].unk1C = arg4; - D_800DD064[arg0].unk30 |= 0x40; + gScreenViewports[arg0].unk1C = arg4; + gScreenViewports[arg0].flags |= 0x40; return; } - D_800DD064[arg0].unk30 &= 0xFFFFFFBF; + gScreenViewports[arg0].flags &= ~0x40; } s32 func_80066BA8(s32 arg0, s32 *arg1, s32 *arg2, s32 *arg3, s32 *arg4) { - *arg1 = D_800DD064[arg0].unk20; - *arg3 = D_800DD064[arg0].unk28; - *arg2 = D_800DD064[arg0].unk24; - *arg4 = D_800DD064[arg0].unk2C; + *arg1 = gScreenViewports[arg0].unk20; + *arg3 = gScreenViewports[arg0].unk28; + *arg2 = gScreenViewports[arg0].unk24; + *arg4 = gScreenViewports[arg0].unk2C; if ((*arg1 | *arg3 | *arg2 | *arg4) == 0) { return 0; } @@ -484,10 +533,10 @@ s32 func_80066BA8(s32 arg0, s32 *arg1, s32 *arg2, s32 *arg3, s32 *arg4) { } void func_80066C2C(s32 arg0, s32 *arg1, s32 *arg2, s32 *arg3, s32 *arg4) { - *arg1 = D_800DD064[arg0].unk0; - *arg2 = D_800DD064[arg0].unk4; - *arg3 = D_800DD064[arg0].unk8; - *arg4 = D_800DD064[arg0].unkC; + *arg1 = gScreenViewports[arg0].unk0; + *arg2 = gScreenViewports[arg0].unk4; + *arg3 = gScreenViewports[arg0].unk8; + *arg4 = gScreenViewports[arg0].unkC; } // Unused? @@ -501,7 +550,7 @@ void func_80066C80(s32 *arg0, s32 *arg1, s32 *arg2, s32 *arg3) { #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80066CDC.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80066CDC.s") #else // Work in progress! @@ -555,13 +604,13 @@ void func_80066CDC(Gfx **dlist, s32 *arg1) { temp_t0 = temp_v0 >> 0x10; temp_a3 = temp_t0 >> 1; - if (D_800DD064[phi_t1].unk30 & 1) { + if (gScreenViewports[phi_t1].flags & 1) { sp2C = D_80120CE4; D_80120CE4 = phi_t1; fast3d_cmd( (*dlist)++, - ((((s32)(D_800DD064[D_80120CE4].unk24 * 4.0f)) & 0xFFF) | 0xED000000) | (((s32)(D_800DD064[D_80120CE4].unk20 * 4.0f)) & 0xFFF) << 0xC, - (((s32)(D_800DD064[D_80120CE4].unk2C * 4.0f)) & 0xFFF) | (((s32)(D_800DD064[D_80120CE4].unk28 * 4.0f)) & 0xFFF) << 0xC + ((((s32)(gScreenViewports[D_80120CE4].unk24 * 4.0f)) & 0xFFF) | 0xED000000) | (((s32)(gScreenViewports[D_80120CE4].unk20 * 4.0f)) & 0xFFF) << 0xC, + (((s32)(gScreenViewports[D_80120CE4].unk2C * 4.0f)) & 0xFFF) | (((s32)(gScreenViewports[D_80120CE4].unk28 * 4.0f)) & 0xFFF) << 0xC ) func_80068158(dlist, 0, 0, 0, 0); D_80120CE4 = sp2C; @@ -763,14 +812,14 @@ void func_80066CDC(Gfx **dlist, s32 *arg1) { } #endif -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80067A3C.s") -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80067D3C.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80067A3C.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80067D3C.s") void func_80067F20(f32 arg0) { D_800DD2CC[0] = arg0; } -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80067F2C.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80067F2C.s") void func_8006807C(Gfx **dlist, s32 *arg1) { func_8006FE74(&D_80121060, &D_800DD288); @@ -784,8 +833,8 @@ void func_8006807C(Gfx **dlist, s32 *arg1) { D_80120D08 = 0; } -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80068158.s") -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_800682AC.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80068158.s") +GLOBAL_ASM("asm/non_matchings/camera/func_800682AC.s") void func_80068408(Gfx **dlist, s32 *arg1) { func_800705F8(D_80120D70[D_80120D1C], 0.0f, 0.0f, 0.0f); @@ -802,12 +851,12 @@ void func_80068508(s32 arg0) { D_80120D0C = arg0; } -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80068514.s") -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80068BF4.s") -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80068FA8.s") -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80069484.s") -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80069790.s") -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80069A40.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80068514.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80068BF4.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80068FA8.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80069484.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80069790.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80069A40.s") unk80120AC0 *func_80069CFC(void) { return &D_80120AC0[D_80120CE4]; @@ -865,22 +914,13 @@ void func_80069E14(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { } } -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_80069F28.s") +GLOBAL_ASM("asm/non_matchings/camera/func_80069F28.s") s32* func_8006A100(void) { return &D_801210E0; } -#if 1 -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006A10C.s") -#else - -extern s32 D_800DD300; -extern s32 D_801210F8; -extern s32 D_801210FC; -extern s8 D_80121100; -extern u8 D_80121100+3; - +#ifdef NON_MATCHING // Has regalloc & stack issues. s32 func_8006A10C(void) { u8 sp23; @@ -890,16 +930,18 @@ s32 func_8006A10C(void) { func_800CCFE0(&D_801210E0); func_8006A434(); D_800DD300 = 0; - if ((sp23 & 1) && !(D_80121100+3 & 8)) { + if ((sp23 & 1) && !(D_80121100[3] & 8)) { return 0; } D_800DD300 = 1; return -1; } +#else +GLOBAL_ASM("asm/non_matchings/camera/func_8006A10C.s") #endif -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006A1C4.s") -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006A434.s") +GLOBAL_ASM("asm/non_matchings/camera/func_8006A1C4.s") +GLOBAL_ASM("asm/non_matchings/camera/func_8006A434.s") void func_8006A458(s8 *activePlayers) { s32 i; diff --git a/src/camera.h b/src/camera.h new file mode 100644 index 00000000..f6580a20 --- /dev/null +++ b/src/camera.h @@ -0,0 +1,67 @@ +#ifndef _UNKNOWN_066AA0_H_ +#define _UNKNOWN_066AA0_H_ + +#include "types.h" +#include "macros.h" +#include "structs.h" +#include "f3ddkr.h" +#include "menu.h" + +#define SCREEN_WIDTH 320 +#define SCREEN_HEIGHT 240 +#define SCREEN_WIDTH_HALF (SCREEN_WIDTH / 2) +#define SCREEN_HEIGHT_HALF (SCREEN_HEIGHT / 2) + +#define SCREEN_WIDTH_FLOAT ((float)(SCREEN_WIDTH)) +#define SCREEN_HEIGHT_FLOAT ((float)(SCREEN_HEIGHT)) + +#define CAMERA_ASPECT (SCREEN_WIDTH_FLOAT / SCREEN_HEIGHT_FLOAT) +#define CAMERA_FAR 15000.0f +#define CAMERA_NEAR 10.0f +#define CAMERA_DEFAULT_FOV 60.0f +#define CAMERA_MIN_FOV 0.0f +#define CAMERA_MAX_FOV 90.0f +#define CAMERA_SCALE 1.0f + +extern s8 D_800DD060; + +/* Size: 0x34 bytes. */ +typedef struct ScreenViewport { + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC; + s32 unk10; + s32 unk14; + s32 unk18; + s32 unk1C; + s32 unk20; + s32 unk24; + s32 unk28; + s32 unk2C; + s32 flags; +} ScreenViewport; + +extern ScreenViewport gScreenViewports[4]; + +// Not sure about the typing here +extern s16 D_800DD138[8]; + +// Not sure about the typing here +extern s16 D_800DD148[20][8]; + +extern f32 D_800DD288[6]; + +extern f32 D_800DD2A0[6]; + +extern f32 D_800DD2B8[5]; + +extern f32 D_800DD2CC[11]; + +extern u8 D_800DD2F8[8]; + +extern s32 D_800DD300; + +extern s16 D_800DD304; + +#endif \ No newline at end of file diff --git a/src/menu.c b/src/menu.c index 46fb12ee..b03b60e5 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1527,7 +1527,7 @@ void func_8009C674(s16 *arg0); void func_8008E4B0(void); s8 *get_misc_asset(s32 arg0); void func_80001D04(s32, s32*); -void func_800660EC(f32 arg0); +void update_camera_fov(f32 arg0); void func_8009C508(s32 arg0); void *allocate_from_main_pool_safe(s32, u32); void func_800C4170(s32 arg0); @@ -2878,7 +2878,7 @@ void draw_character_select_text(s32 arg0) { draw_text(&D_801263A0, 0xA0, yPos, D_800E8230 /* "OK?" */, 0xC); } func_8007B3D0(&D_801263A0); - func_800660EC(40.0f); + update_camera_fov(40.0f); } } diff --git a/src/unknown_066AA0.h b/src/unknown_066AA0.h deleted file mode 100644 index af6b0e74..00000000 --- a/src/unknown_066AA0.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _UNKNOWN_066AA0_H_ -#define _UNKNOWN_066AA0_H_ - -#include "types.h" - -extern s32 D_800DD060; - -/* Size: 0x34 bytes. */ -typedef struct unk800DD064 { - s32 unk0; - s32 unk4; - s32 unk8; - s32 unkC; - s32 unk10; - s32 unk14; - s32 unk18; - s32 unk1C; - s32 unk20; - s32 unk24; - s32 unk28; - s32 unk2C; - s32 unk30; -} unk800DD064; - -extern unk800DD064 D_800DD064[4]; - -// Not sure about the typing here -extern s16 D_800DD134[10]; - -// Not sure about the typing here -extern u16 D_800DD148[160]; - -extern f32 D_800DD288[6]; - -extern f32 D_800DD2A0[6]; - -extern f32 D_800DD2B8[5]; - -extern f32 D_800DD2CC[11]; - -extern u8 D_800DD2F8[8]; - -extern s32 D_800DD300; - -extern s16 D_800DD304; - -#endif \ No newline at end of file diff --git a/src/unknown_06B2B0.c b/src/unknown_06B2B0.c index f25978d0..a256d9cf 100644 --- a/src/unknown_06B2B0.c +++ b/src/unknown_06B2B0.c @@ -207,7 +207,7 @@ void func_80004A60(s32, s32); void menu_init(s32); void render(void); -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006A6B0.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006A6B0.s") s32 func_8006B0AC(s32 arg0) { if (arg0 > 0 && arg0 < D_80121170) { @@ -262,7 +262,7 @@ s32 func_8006B240(void) { } #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/load_level.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/load_level.s") #else Settings *get_settings(void); @@ -523,8 +523,8 @@ void load_level(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { gCurrentLevelHeader->unkAC = get_misc_asset((s32)gCurrentLevelHeader->unkAC); func_8007F414(gCurrentLevelHeader->unkAC); } - func_800660EC((f32)gCurrentLevelHeader->unk9C); - func_80077B34(gCurrentLevelHeader->unk9D, gCurrentLevelHeader->unk9E, gCurrentLevelHeader->unk9F); + update_camera_fov((f32)gCurrentLevelHeader->cameraFOV); + func_80077B34(gCurrentLevelHeader->bgColorRed, gCurrentLevelHeader->bgColorGreen, gCurrentLevelHeader->bgColorBlue); func_8007A974(); func_8007AB24(gCurrentLevelHeader->unk4[arg1]); } @@ -556,7 +556,7 @@ u8 func_8006BDC0(void) { return D_80121170 - 1; } -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006BDDC.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006BDDC.s") void func_8006BEFC(void) { func_8006C164(); @@ -633,7 +633,7 @@ void func_8006BFC8(s8 *arg0) { free_from_memory_pool(D_80121160); } #else -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006BFC8.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006BFC8.s") #endif void func_8006C164(void) { @@ -712,7 +712,7 @@ void thread3_main(s32 arg0) { } #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006C3E0.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006C3E0.s") #else extern Gfx *D_801211F0; extern u8 D_800DD374; @@ -896,7 +896,7 @@ void render(void) { } } #else -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/render.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/render.s") #endif void func_8006CAE4(s32 arg0, s32 arg1, s32 arg2) { @@ -948,7 +948,7 @@ void func_8006CC14(void) { } // Has a jump table -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006CCF0.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006CCF0.s") void func_8006D8A4(void) { D_800DD390 = 0x2C; @@ -1085,7 +1085,7 @@ void func_8006DC58(s32 arg0) { } // Has a jump table -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006DCF8.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006DCF8.s") void func_8006E2E8(s32 arg0, s32 arg1, s32 arg2) { if (D_80123514 == 0) { @@ -1104,7 +1104,7 @@ void func_8006E2E8(s32 arg0, s32 arg1, s32 arg2) { D_80123514 = (u8)1; } -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006E3BC.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006E3BC.s") void func_8006E5BC(void) { s32 i, j; @@ -1136,7 +1136,7 @@ void func_8006E5BC(void) { gSettingsPtr->courseId = 0; } -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006E770.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006E770.s") void func_8006E994(Settings* settings) { s32 i; @@ -1255,7 +1255,7 @@ void func_8006ECE0(void) { D_800DD37C |= 0x200; } -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006ECFC.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006ECFC.s") #ifdef NON_MATCHING extern s32 D_A4000000; @@ -1266,11 +1266,11 @@ s32 func_8006EFB8(void) { return 1; } #else -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006EFB8.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006EFB8.s") #endif #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006EFDC.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006EFDC.s") #else /* Size: 0x40 bytes, I think this might be a 4x4 matrix. */ @@ -1462,5 +1462,5 @@ s32 func_8006F4EC(void) { return 1; } #else -GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006F4EC.s") +GLOBAL_ASM("asm/non_matchings/unknown_06B2B0/func_8006F4EC.s") #endif