Identify some stuff in the Camera struct (#238)

Make a header file for all the camera stuff, refresh a lot of
mips_to_c output

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
Tyler McGavran 2022-07-06 20:36:27 -04:00 committed by GitHub
parent bf106ede73
commit f2eef3b82e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 2541 additions and 3181 deletions

View File

@ -1,46 +0,0 @@
glabel func_80014D30
/* 015930 80014D30 00047840 */ sll $t7, $a0, 1
/* 015934 80014D34 3C038016 */ lui $v1, %hi(gNearestWaypointByCameraId) # 0x8016
/* 015938 80014D38 006F1821 */ addu $v1, $v1, $t7
/* 01593C 80014D3C 0005C880 */ sll $t9, $a1, 2
/* 015940 80014D40 3C088016 */ lui $t0, %hi(D_80164550) # 0x8016
/* 015944 80014D44 84634668 */ lh $v1, %lo(gNearestWaypointByCameraId)($v1) # 0x4668($v1)
/* 015948 80014D48 01194021 */ addu $t0, $t0, $t9
/* 01594C 80014D4C 8D084550 */ lw $t0, %lo(D_80164550)($t0) # 0x4550($t0)
/* 015950 80014D50 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 015954 80014D54 000348C0 */ sll $t1, $v1, 3
/* 015958 80014D58 AFBF001C */ sw $ra, 0x1c($sp)
/* 01595C 80014D5C AFA40020 */ sw $a0, 0x20($sp)
/* 015960 80014D60 AFA50024 */ sw $a1, 0x24($sp)
/* 015964 80014D64 01091021 */ addu $v0, $t0, $t1
/* 015968 80014D68 844D0000 */ lh $t5, ($v0)
/* 01596C 80014D6C 844F0002 */ lh $t7, 2($v0)
/* 015970 80014D70 84580004 */ lh $t8, 4($v0)
/* 015974 80014D74 448D2000 */ mtc1 $t5, $f4
/* 015978 80014D78 448F3000 */ mtc1 $t7, $f6
/* 01597C 80014D7C 3C0141F0 */ li $at, 0x41F00000 # 30.000000
/* 015980 80014D80 46802120 */ cvt.s.w $f4, $f4
/* 015984 80014D84 44815000 */ mtc1 $at, $f10
/* 015988 80014D88 44989000 */ mtc1 $t8, $f18
/* 01598C 80014D8C 00045080 */ sll $t2, $a0, 2
/* 015990 80014D90 01445023 */ subu $t2, $t2, $a0
/* 015994 80014D94 46803220 */ cvt.s.w $f8, $f6
/* 015998 80014D98 44062000 */ mfc1 $a2, $f4
/* 01599C 80014D9C 000A50C0 */ sll $t2, $t2, 3
/* 0159A0 80014DA0 01445023 */ subu $t2, $t2, $a0
/* 0159A4 80014DA4 000A50C0 */ sll $t2, $t2, 3
/* 0159A8 80014DA8 46809120 */ cvt.s.w $f4, $f18
/* 0159AC 80014DAC 3C0C8016 */ lui $t4, %hi(cameras) # $t4, 0x8016
/* 0159B0 80014DB0 258C46F0 */ addiu $t4, %lo(cameras) # addiu $t4, $t4, 0x46f0
/* 0159B4 80014DB4 254B0054 */ addiu $t3, $t2, 0x54
/* 0159B8 80014DB8 016C2021 */ addu $a0, $t3, $t4
/* 0159BC 80014DBC 460A4400 */ add.s $f16, $f8, $f10
/* 0159C0 80014DC0 E7A40010 */ swc1 $f4, 0x10($sp)
/* 0159C4 80014DC4 3C054120 */ lui $a1, 0x4120
/* 0159C8 80014DC8 44078000 */ mfc1 $a3, $f16
/* 0159CC 80014DCC 0C0AB772 */ jal func_802ADDC8
/* 0159D0 80014DD0 00000000 */ nop
/* 0159D4 80014DD4 8FBF001C */ lw $ra, 0x1c($sp)
/* 0159D8 80014DD8 27BD0020 */ addiu $sp, $sp, 0x20
/* 0159DC 80014DDC 03E00008 */ jr $ra
/* 0159E0 80014DE0 00000000 */ nop

View File

@ -1,50 +0,0 @@
glabel func_800224F0
/* 0230F0 800224F0 AFA50004 */ sw $a1, 4($sp)
/* 0230F4 800224F4 AFA60008 */ sw $a2, 8($sp)
/* 0230F8 800224F8 84880000 */ lh $t0, ($a0)
/* 0230FC 800224FC 00057400 */ sll $t6, $a1, 0x10
/* 023100 80022500 000E2C03 */ sra $a1, $t6, 0x10
/* 023104 80022504 0006C400 */ sll $t8, $a2, 0x10
/* 023108 80022508 00A81023 */ subu $v0, $a1, $t0
/* 02310C 8002250C 0018CC03 */ sra $t9, $t8, 0x10
/* 023110 80022510 00024C00 */ sll $t1, $v0, 0x10
/* 023114 80022514 03203025 */ move $a2, $t9
/* 023118 80022518 07210004 */ bgez $t9, .L8002252C
/* 02311C 8002251C 00091403 */ sra $v0, $t1, 0x10
/* 023120 80022520 00195823 */ negu $t3, $t9
/* 023124 80022524 000B6400 */ sll $t4, $t3, 0x10
/* 023128 80022528 000C3403 */ sra $a2, $t4, 0x10
.L8002252C:
/* 02312C 8002252C 5840000B */ blezl $v0, .L8002255C
/* 023130 80022530 00461021 */ addu $v0, $v0, $a2
/* 023134 80022534 00461023 */ subu $v0, $v0, $a2
/* 023138 80022538 00027400 */ sll $t6, $v0, 0x10
/* 02313C 8002253C 000E7C03 */ sra $t7, $t6, 0x10
/* 023140 80022540 05E00003 */ bltz $t7, .L80022550
/* 023144 80022544 00AFC023 */ subu $t8, $a1, $t7
/* 023148 80022548 1000000B */ b .L80022578
/* 02314C 8002254C A4980000 */ sh $t8, ($a0)
.L80022550:
/* 023150 80022550 10000009 */ b .L80022578
/* 023154 80022554 A4850000 */ sh $a1, ($a0)
/* 023158 80022558 00461021 */ addu $v0, $v0, $a2
.L8002255C:
/* 02315C 8002255C 0002CC00 */ sll $t9, $v0, 0x10
/* 023160 80022560 00194403 */ sra $t0, $t9, 0x10
/* 023164 80022564 1D000003 */ bgtz $t0, .L80022574
/* 023168 80022568 00A84823 */ subu $t1, $a1, $t0
/* 02316C 8002256C 10000002 */ b .L80022578
/* 023170 80022570 A4890000 */ sh $t1, ($a0)
.L80022574:
/* 023174 80022574 A4850000 */ sh $a1, ($a0)
.L80022578:
/* 023178 80022578 848A0000 */ lh $t2, ($a0)
/* 02317C 8002257C 24020001 */ li $v0, 1
/* 023180 80022580 14AA0003 */ bne $a1, $t2, .L80022590
/* 023184 80022584 00000000 */ nop
/* 023188 80022588 03E00008 */ jr $ra
/* 02318C 8002258C 00001025 */ move $v0, $zero
.L80022590:
/* 023190 80022590 03E00008 */ jr $ra
/* 023194 80022594 00000000 */ nop

View File

@ -1,54 +0,0 @@
# Mario Kart 64 (U) disassembly and split file
# generated by n64split v0.4a - N64 ROM splitter
.include "macros.inc"
.section .data
#glabel D_802B8CD4 # array of structs hhww, only one?
#.hword 0, 0
#.word 0, 0
#.word 0 # struct fill
#.word 0 # fill
#glabel D_802B8CE8
#.word 0xbc000002, 0x80000040
#glabel D_802B8CF0
#.word 0xb7000000, 0x00002000
#glabel D_802B8CF8
#.word 0xb6000000, 0x00002000
#glabel D_802B8D00
#.word 0xbe000000, 0x00000140
#glabel D_802B8D08
#.word 0xfc121824, 0xff33ffff
#glabel D_802B8D10
#.word 0xfc127e24, 0xfffff3f9
#glabel D_802B8D18
#.word 0xfcffffff, 0xfffe793c
#glabel D_802B8D20
#.word 0xfc127e24, 0xfffff3f9
#glabel D_802B8D28
#.word 0xfcffffff, 0xfffcf279
#glabel D_802B8D30
#.word 0xb900031d, 0x00552078
#glabel D_802B8D38
#.word 0xb900031d, 0x00553078
#glabel D_802B8D40
#.word 0xb900031d, 0x005049d8
#glabel D_802B8D48
#.word 0xb900031d, 0x00442d58
#glabel D_802B8D50
#.word 0xb900031d, 0x00404dd8
#glabel D_802B8D58
#.word 0xe8000000, 0x00000000
#glabel D_802B8D60
#.word 0xe8000000, 0x00000000
#glabel D_802B8D68
#.word 0xe6000000, 0x00000000
#glabel D_802B8D70
#.word 0xbb000001, 0xffffffff
#glabel D_802B8D78
#.word 0xbb000000, 0x00010001

View File

@ -584,266 +584,4 @@ glabel D_80286B80
.word 0x453B8000
glabel D_80286B84
.word 0x3F8CCCCD, 0x00000000, 0x00000000
glabel D_80286B90
.word 0xC543D000
glabel D_80286B94
.word 0xC3E98000
glabel D_80286B98
.word 0xC5596000
glabel D_80286B9C
.word 0x3FAAAAAB
glabel D_80286BA0
.word 0x45D48000
.word 0x00000000, 0x00000000, 0x00000000
# English credits
.asciiz "executive producer"
.balign 4
.asciiz "hiroshi yamauchi"
.balign 4
.asciiz "producer"
.balign 4
.asciiz "shigeru miyamoto"
.balign 4
.asciiz "director"
.balign 4
.asciiz "hideki konno"
.balign 4
.asciiz "assistant director"
.balign 4
.asciiz "yasuyuki oyagi"
.balign 4
.asciiz "programmer"
.balign 4
.asciiz "masato kimura"
.balign 4
.asciiz "kenji yamamoto"
.balign 4
.asciiz "yasuhiro kawaguchi"
.balign 4
.asciiz "yuzuru ogawa"
.balign 4
.asciiz "masahiro kawano"
.balign 4
.asciiz "hirohito yoshimoto"
.balign 4
.asciiz "demo sequence programmer"
.balign 4
.asciiz ""
.balign 4
.asciiz "hajime yajima"
.balign 4
.asciiz "takumi kawagoe"
.balign 4
.asciiz "visual director"
.balign 4
.asciiz "tadashi sugiyama"
.balign 4
.asciiz "c.g.character designer"
.balign 4
.asciiz ""
.balign 4
.asciiz "tomoaki kuroume"
.balign 4
.asciiz "hiroaki takenaka"
.balign 4
.asciiz "tokihiko toyoda"
.balign 4
.asciiz "shigefumi hino"
.balign 4
.asciiz "masanao arimoto"
.balign 4
.asciiz "hisashi nogami"
.balign 4
.asciiz "c.g.map designer"
.balign 4
.asciiz "makoto miyanaga"
.balign 4
.asciiz "naoki mori"
.balign 4
.asciiz "hiroyasu kuwabara"
.balign 4
.asciiz "music composer"
.balign 4
.asciiz "kenta nagata"
.balign 4
.asciiz "sound programmer"
.balign 4
.asciiz "taro bando"
.balign 4
.asciiz "yoji inagaki"
.balign 4
.asciiz "sampling voice"
.balign 4
.asciiz "charles martinet"
.balign 4
.asciiz "leslie swan"
.balign 4
.asciiz "isaac marshall"
.balign 4
.asciiz ""
.balign 4
.asciiz ""
.balign 4
.asciiz ""
.balign 4
.asciiz "technical support"
.balign 4
.asciiz "takao sawano"
.balign 4
.asciiz "tsuyoshi takahashi"
.balign 4
.asciiz "hirohito yada"
.balign 4
.asciiz "progress management"
.balign 4
.asciiz "kimiyoshi fukui"
.balign 4
.asciiz "keizo kato"
.balign 4
.asciiz "special thanks"
.balign 4
.asciiz "yasuhiro sakai"
.balign 4
.asciiz "yoshitaka nishikawa"
.balign 4
.asciiz "hideki fujii"
.balign 4
.asciiz "yusuke nakano"
.balign 4
.asciiz "wataru yamaguchi"
.balign 4
.asciiz "phil sandhop"
.balign 4
.asciiz "super mario club"
.balign 4
.asciiz "Donkey Kong 3-D Model Provided Courtesy of Rare U.K."
.balign 4
.asciiz "the end"
.balign 4
.asciiz "mariokart64 staff"
/*
The encoding on these strings is very odd.
As best as I can tell they are encoded as specified by either:
the euc-jis-2004 standard
or
the JIS X 0213 standard
I can't tell which, they may be the same thing, or one may have
superceded the other. I can't quite tell
See http://x0213.org/codetable/euc-jis-2004-std.txt for a table
that maps euc-jis-2004 codes to equivalent Unicode
If the MSB of a character is 0 its treated like plain Unicode.
So 0x20 is still a space, 0x4D is still "m", like in Unicode/ASCII
If the MSB of a character is 1 its a control character, which
indicates that the next byte has a special interpretation.
For our purposes its always(?) a katakana glyph.
See char_to_glyph_index for reference, it looks for those
control characters if the byte isn't in the usual ASCII range
*/
# Japanse credits
.word 0xA5A8A5B0, 0xA5BCA5AF, 0xA5C6A5A3, 0xA5D620A5
.word 0xD7A5EDA5, 0xC7A5E5A1, 0xBCA5B5A1, 0xBC000000
.word 0xA4E4A4DE, 0xA4A6A4C1, 0x20A4D2A4, 0xEDA4B700
.word 0xA5D7A5ED, 0xA5C7A5E5, 0xA1BCA5B5, 0xA1BC0000
.word 0xA4DFA4E4, 0xA4E2A4C8, 0x20A4B7A4, 0xB2A4EB00
.word 0xA5C7A5A3, 0xA5ECA5AF, 0xA5BFA1BC, 0x00000000
.word 0xA4B3A4F3, 0xA4CE20A4, 0xD2A4C7A4, 0xAD000000
.word 0xA5A2A5B7, 0xA5B9A5BF, 0xA5F3A5C8, 0x20A5C7A5
.word 0xA3A5ECA5, 0xAFA5BFA1, 0xBC000000, 0xA4AAA4AA
.word 0xA4E4A4AE, 0x20A4E4A4, 0xB9A4E6A4, 0xAD000000
.word 0xA5D7A5ED, 0xA5B0A5E9, 0xA5DEA1BC, 0x00000000
.word 0xA4ADA4E0, 0xA4E920A4, 0xDEA4B5A4, 0xC8000000
.word 0xA4E4A4DE, 0xA4E2A4C8, 0x20A4B1A4, 0xF3A4B800
.word 0xA4ABA4EF, 0xA4B0A4C1, 0x20A4E4A4, 0xB9A4D2A4
.word 0xED000000, 0xA4AAA4AC, 0xA4EF20A4, 0xE6A4BAA4
.word 0xEB000000, 0xA4ABA4EF, 0xA4CE20A4, 0xDEA4B5A4
.word 0xD2A4ED00, 0xA4E8A4B7, 0xA4E2A4C8, 0x20A4D2A4
.word 0xEDA4D2A4, 0xC8000000, 0xA5C7A5E2, 0x20A5B7A1
.word 0xBCA5B1A5, 0xF3A5B920, 0xA5D7A5ED, 0xA5B0A5E9
.word 0xA5DEA1BC, 0x00000000, 0x00000000, 0xA4E4A4B8
.word 0xA4DE20A4, 0xCFA4B8A4, 0xE1000000, 0xA4ABA4EF
.word 0xA4B4A4A8, 0x20A4BFA4, 0xAFA4DF00, 0xA5D3A5B8
.word 0xA5E5A5A2, 0xA5EB20A5, 0xC7A5A3A5, 0xECA5AFA5
.word 0xBFA1BC00, 0xA4B9A4AE, 0xA4E4A4DE, 0x20A4BFA4
.word 0xC0A4B700, 0x636720A5, 0xADA5E3A5, 0xE9A5AFA5
.word 0xBFA1BC20, 0xA5C7A5B6, 0xA5A4A5CA, 0xA1BC0000
.word 0x00000000, 0xA4AFA4ED, 0xA4A6A4E1, 0x20A4C8A4
.word 0xE2A4A2A4, 0xAD000000, 0xA4BFA4B1, 0xA4CAA4AB
.word 0x20A4D2A4, 0xEDA4A2A4, 0xAD000000, 0xA4C8A4E8
.word 0xA4C020A4, 0xC8A4ADA4, 0xD2A4B300, 0xA4D2A4CE
.word 0x20A4B7A4, 0xB2A4D5A4, 0xDF000000, 0xA4A2A4EA
.word 0xA4E2A4C8, 0x20A4DEA4, 0xB5A4CAA4, 0xAA000000
.word 0xA4CEA4AC, 0xA4DF20A4, 0xD2A4B5A4, 0xB7000000
.word 0x636720A5, 0xDEA5C3A5, 0xD720A5C7, 0xA5B6A5A4
.word 0xA5CAA1BC, 0x00000000, 0xA4DFA4E4, 0xA4CAA4AC
.word 0x20A4DEA4, 0xB3A4C800, 0xA4E2A4EA, 0x20A4CAA4
.word 0xAAA4AD00, 0xA4AFA4EF, 0xA4D0A4E9, 0x20A4D2A4
.word 0xEDA4E4A4, 0xB9000000, 0xA5DFA5E5, 0xA1BCA5B8
.word 0xA5C3A5AF, 0x20A5B3A5, 0xF3A5DDA1, 0xBCA5B6A1
.word 0xBC000000, 0xA4CAA4AC, 0xA4BF20A4, 0xB1A4F3A4
.word 0xBF000000, 0xA5B5A5A6, 0xA5F3A5C9, 0x20A5D7A5
.word 0xEDA5B0A5, 0xE9A5DEA1, 0xBC000000, 0xA4D0A4F3
.word 0xA4C9A4A6, 0x20A4BFA4, 0xEDA4A600, 0xA4A4A4CA
.word 0xA4ACA4AD, 0x20A4E8A4, 0xA6A4B800, 0xA5B5A5F3
.word 0xA5D7A5EA, 0xA5F3A5F3, 0xA5B020A5, 0xDCA5A4A5
.word 0xB9000000, 0xA4B3A4A6, 0xA4C5A4AD, 0x20A4A2A4
.word 0xB5A4B300, 0xA4DEA4EB, 0xA4CE20A4, 0xC8A4E2A4
.word 0xB3000000, 0xA4C1A4E3, 0xA1BCA4EB, 0xA4BA20A4
.word 0xDEA4EBA4, 0xC6A4A3A4, 0xCD000000, 0xA4B8A4E5
.word 0xA4EAA4A2, 0xA4F320A4, 0xD0A4EBA4, 0xC0A4B3A4
.word 0xD5000000, 0xA4C8A4DE, 0xA4B920A4, 0xB9A4D4A4
.word 0xF3A4C9A4, 0xE9A1BC00, 0xA4B8A4E7, 0xA4F320A4
.word 0xD2A4E5A1, 0xBCA4E9A4, 0xC8A4F300, 0xA5C6A5AF
.word 0xA5CBA5AB, 0xA5EB20A5, 0xB5A5DDA1, 0xBCA5C800
.word 0xA4B5A4EF, 0xA4CE20A4, 0xBFA4ABA4, 0xAA000000
.word 0xA4BFA4AB, 0xA4CFA4B7, 0x20A4C4A4, 0xE8A4B700
.word 0xA4E4A4C0, 0x20A4D2A4, 0xEDA4D2A4, 0xC8000000
.word 0xA5D7A5ED, 0xA5B0A5EC, 0xA5B920A5, 0xDEA5CDA1
.word 0xBCA5B8A5, 0xE1A5F3A5, 0xC8000000, 0xA4D5A4AF
.word 0xA4A420A4, 0xADA4DFA4, 0xE8A4B700, 0xA4ABA4C8
.word 0xA4A620A4, 0xB1A4A4A4, 0xBEA4A600, 0xA5B9A5DA
.word 0xA5B7A5E3, 0xA5EB20A5, 0xB5A5F3A5, 0xAFA5B900
.word 0xA4B5A4AB, 0xA4A420A4, 0xE4A4B9A4, 0xD2A4ED00
.word 0xA4CBA4B7, 0xA4ABA4EF, 0x20A4E8A4, 0xB7A4BFA4
.word 0xAB000000, 0xA4D5A4B8, 0xA4A420A4, 0xD2A4C7A4
.word 0xAD000000, 0xA4CAA4AB, 0xA4CE20A4, 0xE6A4A6A4
.word 0xB9A4B100, 0xA4E4A4DE, 0xA4B0A4C1, 0x20A4EFA4
.word 0xBFA4EB00, 0xA4CBA4F3, 0xA4C6A4F3, 0xA4C9A4A6
.word 0x20A4B8A4, 0xE7A1BCA4, 0xABA4A400, 0xA4B9A1BC
.word 0xA4D1A1BC, 0x20A4DEA4, 0xEAA4AA20, 0xA4AFA4E9
.word 0xA4D60000, 0xA4ECA4A2, 0x20A4EAA4, 0xDFA4C6A4
.word 0xC3A4C900, 0x2020A4AA, 0xA4B7A4DE, 0xA4A40000
.word 0x20A4DEA4, 0xEAA4AAA4, 0xABA1BCA4, 0xC8363420
.word 0xA4B9A4BF, 0xA4C3A4D5
.word 0x00000000, 0x00000000, 0x00000000, 0x00000000
glabel D_80287470
.word 0x3F2AAAAB
glabel D_80287474
.word 0x3E2AAAAB
glabel D_80287478
.word 0x3F666666
glabel D_8028747C
.word 0xC52EC000
glabel D_80287480
.word 0x80284B1C, 0x80284B4C, 0x80284B7C
.word 0x80284BAC
.word 0x80284BE8
.word 0x00000000
.word 0x00000000, 0x00000000
.word 0x3F8CCCCD

View File

@ -0,0 +1,248 @@
.include "macros.inc"
.data
# English credits
.asciiz "executive producer"
.balign 4
.asciiz "hiroshi yamauchi"
.balign 4
.asciiz "producer"
.balign 4
.asciiz "shigeru miyamoto"
.balign 4
.asciiz "director"
.balign 4
.asciiz "hideki konno"
.balign 4
.asciiz "assistant director"
.balign 4
.asciiz "yasuyuki oyagi"
.balign 4
.asciiz "programmer"
.balign 4
.asciiz "masato kimura"
.balign 4
.asciiz "kenji yamamoto"
.balign 4
.asciiz "yasuhiro kawaguchi"
.balign 4
.asciiz "yuzuru ogawa"
.balign 4
.asciiz "masahiro kawano"
.balign 4
.asciiz "hirohito yoshimoto"
.balign 4
.asciiz "demo sequence programmer"
.balign 4
.asciiz ""
.balign 4
.asciiz "hajime yajima"
.balign 4
.asciiz "takumi kawagoe"
.balign 4
.asciiz "visual director"
.balign 4
.asciiz "tadashi sugiyama"
.balign 4
.asciiz "c.g.character designer"
.balign 4
.asciiz ""
.balign 4
.asciiz "tomoaki kuroume"
.balign 4
.asciiz "hiroaki takenaka"
.balign 4
.asciiz "tokihiko toyoda"
.balign 4
.asciiz "shigefumi hino"
.balign 4
.asciiz "masanao arimoto"
.balign 4
.asciiz "hisashi nogami"
.balign 4
.asciiz "c.g.map designer"
.balign 4
.asciiz "makoto miyanaga"
.balign 4
.asciiz "naoki mori"
.balign 4
.asciiz "hiroyasu kuwabara"
.balign 4
.asciiz "music composer"
.balign 4
.asciiz "kenta nagata"
.balign 4
.asciiz "sound programmer"
.balign 4
.asciiz "taro bando"
.balign 4
.asciiz "yoji inagaki"
.balign 4
.asciiz "sampling voice"
.balign 4
.asciiz "charles martinet"
.balign 4
.asciiz "leslie swan"
.balign 4
.asciiz "isaac marshall"
.balign 4
.asciiz ""
.balign 4
.asciiz ""
.balign 4
.asciiz ""
.balign 4
.asciiz "technical support"
.balign 4
.asciiz "takao sawano"
.balign 4
.asciiz "tsuyoshi takahashi"
.balign 4
.asciiz "hirohito yada"
.balign 4
.asciiz "progress management"
.balign 4
.asciiz "kimiyoshi fukui"
.balign 4
.asciiz "keizo kato"
.balign 4
.asciiz "special thanks"
.balign 4
.asciiz "yasuhiro sakai"
.balign 4
.asciiz "yoshitaka nishikawa"
.balign 4
.asciiz "hideki fujii"
.balign 4
.asciiz "yusuke nakano"
.balign 4
.asciiz "wataru yamaguchi"
.balign 4
.asciiz "phil sandhop"
.balign 4
.asciiz "super mario club"
.balign 4
.asciiz "Donkey Kong 3-D Model Provided Courtesy of Rare U.K."
.balign 4
.asciiz "the end"
.balign 4
.asciiz "mariokart64 staff"
/*
The encoding on these strings is very odd.
As best as I can tell they are encoded as specified by either:
the euc-jis-2004 standard
or
the JIS X 0213 standard
I can't tell which, they may be the same thing, or one may have
superceded the other. I can't quite tell
See http://x0213.org/codetable/euc-jis-2004-std.txt for a table
that maps euc-jis-2004 codes to equivalent Unicode
If the MSB of a character is 0 its treated like plain Unicode.
So 0x20 is still a space, 0x4D is still "m", like in Unicode/ASCII
If the MSB of a character is 1 its a control character, which
indicates that the next byte has a special interpretation.
For our purposes its always(?) a katakana glyph.
See char_to_glyph_index for reference, it looks for those
control characters if the byte isn't in the usual ASCII range
*/
# Japanse credits
.word 0xA5A8A5B0, 0xA5BCA5AF, 0xA5C6A5A3, 0xA5D620A5
.word 0xD7A5EDA5, 0xC7A5E5A1, 0xBCA5B5A1, 0xBC000000
.word 0xA4E4A4DE, 0xA4A6A4C1, 0x20A4D2A4, 0xEDA4B700
.word 0xA5D7A5ED, 0xA5C7A5E5, 0xA1BCA5B5, 0xA1BC0000
.word 0xA4DFA4E4, 0xA4E2A4C8, 0x20A4B7A4, 0xB2A4EB00
.word 0xA5C7A5A3, 0xA5ECA5AF, 0xA5BFA1BC, 0x00000000
.word 0xA4B3A4F3, 0xA4CE20A4, 0xD2A4C7A4, 0xAD000000
.word 0xA5A2A5B7, 0xA5B9A5BF, 0xA5F3A5C8, 0x20A5C7A5
.word 0xA3A5ECA5, 0xAFA5BFA1, 0xBC000000, 0xA4AAA4AA
.word 0xA4E4A4AE, 0x20A4E4A4, 0xB9A4E6A4, 0xAD000000
.word 0xA5D7A5ED, 0xA5B0A5E9, 0xA5DEA1BC, 0x00000000
.word 0xA4ADA4E0, 0xA4E920A4, 0xDEA4B5A4, 0xC8000000
.word 0xA4E4A4DE, 0xA4E2A4C8, 0x20A4B1A4, 0xF3A4B800
.word 0xA4ABA4EF, 0xA4B0A4C1, 0x20A4E4A4, 0xB9A4D2A4
.word 0xED000000, 0xA4AAA4AC, 0xA4EF20A4, 0xE6A4BAA4
.word 0xEB000000, 0xA4ABA4EF, 0xA4CE20A4, 0xDEA4B5A4
.word 0xD2A4ED00, 0xA4E8A4B7, 0xA4E2A4C8, 0x20A4D2A4
.word 0xEDA4D2A4, 0xC8000000, 0xA5C7A5E2, 0x20A5B7A1
.word 0xBCA5B1A5, 0xF3A5B920, 0xA5D7A5ED, 0xA5B0A5E9
.word 0xA5DEA1BC, 0x00000000, 0x00000000, 0xA4E4A4B8
.word 0xA4DE20A4, 0xCFA4B8A4, 0xE1000000, 0xA4ABA4EF
.word 0xA4B4A4A8, 0x20A4BFA4, 0xAFA4DF00, 0xA5D3A5B8
.word 0xA5E5A5A2, 0xA5EB20A5, 0xC7A5A3A5, 0xECA5AFA5
.word 0xBFA1BC00, 0xA4B9A4AE, 0xA4E4A4DE, 0x20A4BFA4
.word 0xC0A4B700, 0x636720A5, 0xADA5E3A5, 0xE9A5AFA5
.word 0xBFA1BC20, 0xA5C7A5B6, 0xA5A4A5CA, 0xA1BC0000
.word 0x00000000, 0xA4AFA4ED, 0xA4A6A4E1, 0x20A4C8A4
.word 0xE2A4A2A4, 0xAD000000, 0xA4BFA4B1, 0xA4CAA4AB
.word 0x20A4D2A4, 0xEDA4A2A4, 0xAD000000, 0xA4C8A4E8
.word 0xA4C020A4, 0xC8A4ADA4, 0xD2A4B300, 0xA4D2A4CE
.word 0x20A4B7A4, 0xB2A4D5A4, 0xDF000000, 0xA4A2A4EA
.word 0xA4E2A4C8, 0x20A4DEA4, 0xB5A4CAA4, 0xAA000000
.word 0xA4CEA4AC, 0xA4DF20A4, 0xD2A4B5A4, 0xB7000000
.word 0x636720A5, 0xDEA5C3A5, 0xD720A5C7, 0xA5B6A5A4
.word 0xA5CAA1BC, 0x00000000, 0xA4DFA4E4, 0xA4CAA4AC
.word 0x20A4DEA4, 0xB3A4C800, 0xA4E2A4EA, 0x20A4CAA4
.word 0xAAA4AD00, 0xA4AFA4EF, 0xA4D0A4E9, 0x20A4D2A4
.word 0xEDA4E4A4, 0xB9000000, 0xA5DFA5E5, 0xA1BCA5B8
.word 0xA5C3A5AF, 0x20A5B3A5, 0xF3A5DDA1, 0xBCA5B6A1
.word 0xBC000000, 0xA4CAA4AC, 0xA4BF20A4, 0xB1A4F3A4
.word 0xBF000000, 0xA5B5A5A6, 0xA5F3A5C9, 0x20A5D7A5
.word 0xEDA5B0A5, 0xE9A5DEA1, 0xBC000000, 0xA4D0A4F3
.word 0xA4C9A4A6, 0x20A4BFA4, 0xEDA4A600, 0xA4A4A4CA
.word 0xA4ACA4AD, 0x20A4E8A4, 0xA6A4B800, 0xA5B5A5F3
.word 0xA5D7A5EA, 0xA5F3A5F3, 0xA5B020A5, 0xDCA5A4A5
.word 0xB9000000, 0xA4B3A4A6, 0xA4C5A4AD, 0x20A4A2A4
.word 0xB5A4B300, 0xA4DEA4EB, 0xA4CE20A4, 0xC8A4E2A4
.word 0xB3000000, 0xA4C1A4E3, 0xA1BCA4EB, 0xA4BA20A4
.word 0xDEA4EBA4, 0xC6A4A3A4, 0xCD000000, 0xA4B8A4E5
.word 0xA4EAA4A2, 0xA4F320A4, 0xD0A4EBA4, 0xC0A4B3A4
.word 0xD5000000, 0xA4C8A4DE, 0xA4B920A4, 0xB9A4D4A4
.word 0xF3A4C9A4, 0xE9A1BC00, 0xA4B8A4E7, 0xA4F320A4
.word 0xD2A4E5A1, 0xBCA4E9A4, 0xC8A4F300, 0xA5C6A5AF
.word 0xA5CBA5AB, 0xA5EB20A5, 0xB5A5DDA1, 0xBCA5C800
.word 0xA4B5A4EF, 0xA4CE20A4, 0xBFA4ABA4, 0xAA000000
.word 0xA4BFA4AB, 0xA4CFA4B7, 0x20A4C4A4, 0xE8A4B700
.word 0xA4E4A4C0, 0x20A4D2A4, 0xEDA4D2A4, 0xC8000000
.word 0xA5D7A5ED, 0xA5B0A5EC, 0xA5B920A5, 0xDEA5CDA1
.word 0xBCA5B8A5, 0xE1A5F3A5, 0xC8000000, 0xA4D5A4AF
.word 0xA4A420A4, 0xADA4DFA4, 0xE8A4B700, 0xA4ABA4C8
.word 0xA4A620A4, 0xB1A4A4A4, 0xBEA4A600, 0xA5B9A5DA
.word 0xA5B7A5E3, 0xA5EB20A5, 0xB5A5F3A5, 0xAFA5B900
.word 0xA4B5A4AB, 0xA4A420A4, 0xE4A4B9A4, 0xD2A4ED00
.word 0xA4CBA4B7, 0xA4ABA4EF, 0x20A4E8A4, 0xB7A4BFA4
.word 0xAB000000, 0xA4D5A4B8, 0xA4A420A4, 0xD2A4C7A4
.word 0xAD000000, 0xA4CAA4AB, 0xA4CE20A4, 0xE6A4A6A4
.word 0xB9A4B100, 0xA4E4A4DE, 0xA4B0A4C1, 0x20A4EFA4
.word 0xBFA4EB00, 0xA4CBA4F3, 0xA4C6A4F3, 0xA4C9A4A6
.word 0x20A4B8A4, 0xE7A1BCA4, 0xABA4A400, 0xA4B9A1BC
.word 0xA4D1A1BC, 0x20A4DEA4, 0xEAA4AA20, 0xA4AFA4E9
.word 0xA4D60000, 0xA4ECA4A2, 0x20A4EAA4, 0xDFA4C6A4
.word 0xC3A4C900, 0x2020A4AA, 0xA4B7A4DE, 0xA4A40000
.word 0x20A4DEA4, 0xEAA4AAA4, 0xABA1BCA4, 0xC8363420
.word 0xA4B9A4BF, 0xA4C3A4D5
.word 0x00000000, 0x00000000, 0x00000000, 0x00000000
glabel D_80287470
.word 0x3F2AAAAB
glabel D_80287474
.word 0x3E2AAAAB
glabel D_80287478
.word 0x3F666666
glabel D_8028747C
.word 0xC52EC000
glabel D_80287480
.word 0x80284B1C, 0x80284B4C, 0x80284B7C
.word 0x80284BAC
.word 0x80284BE8
.word 0x00000000
.word 0x00000000, 0x00000000

View File

@ -97,58 +97,20 @@ typedef struct {
// 80160ADC Banana's remaining
typedef struct {
// B4 long
Vec3f pos;
//f32 posY;
//f32 posZ;
f32 unk; // lookat? faceangle?
f32 unk1;
f32 unk2;
f32 angleX;
f32 angleY;
f32 angleZ;
Vec3s rotX;
s16 rotZ;
s32 unk3; // zero
s32 unk4; // 0x4119999A
s32 unk5; // 0xC20C bit flag?
s32 unk6; // 0
s32 unk7; // 0
s32 unk8; // 0x41F
s32 unk9; // 0
s32 unk10; // 0
s32 unk11; // 0
s32 unk12; // 0
u16 unk13; // 0x103F7
u16 unk13_and_a_half;
u16 unk14; // 0x05BC00## Surface camera is over?
u16 unk14_half;
f32 collisionX;
f32 collisionY;
f32 collisionZ;
f32 unk15;
f32 unk16;
f32 unk17;
f32 unk18;
f32 unk19;
f32 unk20;
f32 unkAngleX;
f32 unkAngleY;
f32 unkAngleZ;
s32 unk21; // zero
f32 collision;
f32 unk22; // zero
s16 unk23; // confirmed s16
s16 unk24; // zero
s16 unk24_and_a_half;
s32 unk25; // zero
s32 unk26; // zero
// need another s16 here?
s32 unk27; // 8
s16 unk28; // zero
f32 unk29; // 422
f32 unk30;
} Camera;
/* 0x00 */ u16 unk30;
/* 0x02 */ u16 unk32;
/* 0x04 */ u16 unk34;
/* 0x06 */ u16 unk36;
/* 0x08 */ u16 unk38;
/* 0x0A */ u16 unk3A;
/* 0x0C */ f32 unk3C;
/* 0x10 */ f32 unk40;
/* 0x14 */ f32 unk44;
/* 0x18 */ Vec3f unk48;
/* 0x24 */ Vec3f unk54;
/* 0x30 */ Vec3f unk60;
/* 0x3C */ f32 unk6C;
} UnkActorInner;
typedef struct {
/* 0x00 */ Vec3f unk_000;
@ -248,24 +210,6 @@ typedef struct {
#define BACK_LEFT_TYRE 2
#define BACK_RIGHT_TYRE 3
typedef struct {
/* 0x00 */ u16 unk30;
/* 0x02 */ u16 unk32;
/* 0x04 */ u16 unk34;
/* 0x06 */ u16 unk36;
/* 0x08 */ u16 unk38;
/* 0x0A */ u16 unk3A;
/* 0x0C */ f32 unk3C;
/* 0x10 */ f32 unk40;
/* 0x14 */ f32 unk44;
/* 0x18 */ Vec3f unk48;
/* 0x24 */ Vec3f unk54;
/* 0x30 */ Vec3f unk60;
/* 0x3C */ f32 unk6C;
} UnkActorInner;
typedef struct {
/* 0x0000 */ u16 unk_000;
/* 0x0002 */ u16 unk_002;

View File

@ -3,6 +3,7 @@
#include <ultra64.h>
#include <common_structs.h>
#include "camera.h"
typedef f32 Mat4[4][4];
typedef f32 Mat3[3][3];

View File

@ -72,11 +72,6 @@ extern char *gSoundModeNames[NUM_SOUND_MODES]; // D_800E7710
extern f32 gTimePlayerLastTouchedFinishLine[8]; // D_8015F898
extern s8 gTimeTrialDataCourseIndex; // D_8018EDF7
extern Camera *camera1;
extern Camera *camera2;
extern Camera *camera3;
extern Camera *camera4;
extern Player gPlayers[8];
extern Player* gPlayerOne;
extern Player* gPlayerTwo;

View File

@ -327,7 +327,6 @@ SECTIONS
BUILD_DIR/src/actors.o(.data);
BUILD_DIR/src/skybox_and_splitscreen.o(.data);
BUILD_DIR/src/memory.o(.data);
BUILD_DIR/data/data_121DA0_1.o(.data);
BUILD_DIR/courses/courseTable.inc.o(.data);
BUILD_DIR/src/actors_extended.o(.data);
BUILD_DIR/data/data_121DA0_2.o(.data);
@ -374,6 +373,8 @@ SECTIONS
BUILD_DIR/src/dl_unk_80284EE0.inc.o(.data);
BUILD_DIR/src/credits_01.inc.o(.data);
BUILD_DIR/data/data_credits_128480_1.o(.data);
BUILD_DIR/src/camera_junk.o(.rodata);
BUILD_DIR/data/data_credits_128480_2.o(.data);
}
END_SEG(code_80280000)

View File

@ -551,7 +551,7 @@ void func_802979F8(struct Actor *arg0, f32 arg1) {
void func_80297A50(Camera *camera, Mat4 arg1, struct Actor *arg2) {
u16 temp_t0;
f32 temp = func_802B80D0(camera->pos, arg2->unk18, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B95F8);
f32 temp = func_802B80D0(camera->pos, arg2->unk18, camera->rot[1], 0, D_80150130[camera - camera1], D_802B95F8);
if (temp < 0.0f) { return; }
@ -780,7 +780,7 @@ void func_80298328(Camera *arg0, Mat4 arg1, struct PiranhaPlant *arg2) {
if (temp & 0x800) { return; }
temp_f0 = func_802B80D0(arg0->pos, arg2->pos, arg0->rotX[1], 0, D_80150130[arg0 - camera1], D_802B9624);
temp_f0 = func_802B80D0(arg0->pos, arg2->pos, arg0->rot[1], 0, D_80150130[arg0 - camera1], D_802B9624);
if (temp_f0 < 0.0f) {
@ -941,7 +941,7 @@ loop_2:
sp88 = (f32) phi_v0 * gCourseDirection;
sp8C = (f32) phi_s1->unk2;
sp90 = (f32) phi_s1->unk4;
temp_f0 = func_802B80D0(camera, &sp88, (u16) camera->rotX2, 0.0f, D_80150130[(s32) (camera - camera1) / 184], D_802B9630);
temp_f0 = func_802B80D0(camera, &sp88, (u16) camera->rot2, 0.0f, D_80150130[(s32) (camera - camera1) / 184], D_802B9630);
phi_s5_2 = phi_s5_3;
phi_s5_2 = phi_s5_3;
if (temp_f0 > 0.0f) {
@ -1163,7 +1163,7 @@ loop_5:
spD8 = (f32) phi_s1->unk2;
spDC = (f32) phi_s1->unk_04;
temp_t0 = temp_s0 & 0xF;
if (func_802B80D0(camera, temp_a1, (u16) camera->rotX2, 0.0f, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), phi_f22) < 0.0f) {
if (func_802B80D0(camera, temp_a1, (u16) camera->rot2, 0.0f, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), phi_f22) < 0.0f) {
goto block_29;
}
if (temp_t0 == 6) {
@ -1231,7 +1231,7 @@ void func_80299144(Camera *camera, Mat4 arg1, struct Actor *arg2) {
if ((temp_v0 & 0x800) != 0) { return; }
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9658);
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B9658);
if (temp_f0 < 0.0f) { return; }
@ -1254,7 +1254,7 @@ void func_8029930C(Camera *camera, Mat4 arg1, struct Actor *arg2) {
if ((temp_v0 & 0x800) != 0) { return; }
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9660);
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B9660);
if (temp_f0 < 0.0f) { return; }
@ -1277,7 +1277,7 @@ void func_802994D4(Camera *camera, Mat4 arg1, struct Actor *arg2) {
if ((temp_v0 & 0x800) != 0) { return; }
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9668);
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B9668);
if (temp_f0 < 0.0f) { return; }
@ -1300,7 +1300,7 @@ void func_8029969C(Camera *camera, Mat4 arg1, struct Actor *arg2) {
if ((temp_v0 & 0x800) != 0) { return; }
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9670);
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B9670);
if (temp_f0 < 0.0f) { return; }
@ -1323,7 +1323,7 @@ void func_80299864(Camera *camera, Mat4 arg1, struct Actor *arg2) {
if ((temp_v0 & 0x800) != 0) { return; }
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9674);
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B9674);
if (temp_f0 < 0.0f) { return; }
@ -1346,7 +1346,7 @@ void func_80299A2C(Camera *camera, Mat4 arg1, struct Actor *arg2) {
if ((temp_v0 & 0x800) != 0) { return; }
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B967C);
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B967C);
if (temp_f0 < 0.0f) { return; }
@ -1369,7 +1369,7 @@ void func_80299BF4(Camera *camera, Mat4 arg1, struct Actor *arg2) {
if ((temp_v0 & 0x800) != 0) { return; }
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9684);
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B9684);
if (temp_f0 < 0.0f) { return; }
@ -1392,7 +1392,7 @@ void func_80299DBC(Camera *camera, Mat4 arg1, struct Actor *arg2) {
if ((temp_v0 & 0x800) != 0) { return; }
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B968C);
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B968C);
if (temp_f0 < 0.0f) { return; }
@ -1414,7 +1414,7 @@ void func_80299EDC(Camera *camera, Mat4 arg1, struct Actor *arg2) {
if ((temp_v0 & 0x800) != 0) { return; }
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9694);
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B9694);
if (temp_f0 < 0.0f) { return; }
@ -1436,7 +1436,7 @@ void func_80299FFC(Camera *camera, Mat4 arg1, struct Actor *arg2) {
if ((temp_v0 & 0x800) != 0) { return; }
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B969C);
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B969C);
if (temp_f0 < 0.0f) { return; }
@ -1458,7 +1458,7 @@ void func_8029A11C(Camera *camera, Mat4 arg1, struct Actor *arg2) {
if ((temp_v0 & 0x800) != 0) { return; }
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B96A4);
temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B96A4);
if (temp_f0 < 0.0f) { return; }
@ -1505,7 +1505,7 @@ void func_8029A3AC(Camera *camera, Mat4 arg1, struct ShellActor *shell) {
};
uintptr_t phi_t3;
f32 temp_f0 = func_802B80D0(camera->pos, shell->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B96AC);
f32 temp_f0 = func_802B80D0(camera->pos, shell->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B96AC);
if (temp_f0 < 0.0f) {
func_80297230(camera, (struct Actor *)shell);
return;
@ -1573,7 +1573,7 @@ void func_8029A8F4(Camera *arg0, Mat4 arg1, struct BananaActor *arg2) {
Vec3s sp7C;
Mat4 sp3C;
f32 temp = func_802B80D0(arg0->pos, arg2->pos, arg0->rotX[1], 0, D_80150130[arg0 - camera1], D_802B96B4);
f32 temp = func_802B80D0(arg0->pos, arg2->pos, arg0->rot[1], 0, D_80150130[arg0 - camera1], D_802B96B4);
if (temp < 0.0f) {
func_80297230(arg0, arg2);
return;
@ -1667,7 +1667,7 @@ extern f32 D_802B96B8;
void func_8029AC18(Camera *camera, Mat4 arg1, struct Actor *arg2) {
f32 temp;
temp = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B96B8);
temp = func_802B80D0(camera->pos, arg2->pos, camera->rot[1], 0, D_80150130[camera - camera1], D_802B96B8);
if (temp < 0.0f) { return; }
arg1[3][0] = arg2->pos[0]; // unk30
@ -1718,7 +1718,7 @@ void func_8029AE1C(Camera *arg0, struct PaddleWheelBoat *boat, Mat4 arg2, u16 ar
f32 temp;
if ((arg3 > 20) && (arg3 < 25)) { return; }
temp = func_802B80D0(arg0->pos, boat->pos, arg0->rotX[1], 90000.0f, D_80150130[arg0 - camera1], D_802B96DC);
temp = func_802B80D0(arg0->pos, boat->pos, arg0->rot[1], 90000.0f, D_80150130[arg0 - camera1], D_802B96DC);
if (temp < 0.0f) { return; }
@ -1748,7 +1748,7 @@ void func_8029B06C(Camera *arg0, struct Actor *arg1) {
s32 pad[6];
Mat4 spD8;
s32 pad2[32];
f32 temp_f0 = func_802B80D0(arg0->pos, arg1->pos, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B96E0);
f32 temp_f0 = func_802B80D0(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, D_80150130[arg0 - camera1], D_802B96E0);
if (temp_f0 < 0.0f) { return; }
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
@ -1791,7 +1791,7 @@ void func_8029B2E4(Camera *arg0, struct Actor *arg1) {
s32 pad2[32];
f32 temp_f0;
temp_f0 = func_802B80D0(arg0->pos, arg1->pos, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B96F0);
temp_f0 = func_802B80D0(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, D_80150130[arg0 - camera1], D_802B96F0);
if (temp_f0 < 0.0f) { return; }
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
@ -1821,7 +1821,7 @@ void func_8029B4E0(Camera *arg0, struct Actor *arg1) {
s32 pad[6];
Mat4 spC8;
s32 pad2[32];
f32 temp_f0 = func_802B80D0(arg0->pos,arg1->pos, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B9700);
f32 temp_f0 = func_802B80D0(arg0->pos,arg1->pos, arg0->rot[1], 2500.0f, D_80150130[arg0 - camera1], D_802B9700);
if (!(temp_f0 < 0.0f)) {
@ -1854,7 +1854,7 @@ void func_8029B6EC(Camera *camera, struct Actor* arg1) {
s32 pad[6];
Mat4 spC8;
s32 pad2[32];
f32 temp_f0 = func_802B80D0(camera->pos, arg1->pos, camera->rotX[1], 2500.0f, D_80150130[camera - camera1], D_802B9710);
f32 temp_f0 = func_802B80D0(camera->pos, arg1->pos, camera->rot[1], 2500.0f, D_80150130[camera - camera1], D_802B9710);
if (!(temp_f0 < 0.0f)) {
@ -1889,7 +1889,7 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
Mat4 spE0;
Mat4 spA0;
f32 temp_f0 = func_802B80D0(camera->pos, actor->pos, camera->rotX[1], 2500.0f, D_80150130[camera - camera1], D_802B9720);
f32 temp_f0 = func_802B80D0(camera->pos, actor->pos, camera->rot[1], 2500.0f, D_80150130[camera - camera1], D_802B9720);
if (temp_f0 < 0.0f) { return; }
@ -2004,7 +2004,7 @@ void func_8029BFB0(Camera *camera, struct TrainCar *actor) {
Mat4 spE0;
Mat4 spA0;
f32 temp_f0 = func_802B80D0(camera->pos, actor->pos, camera->rotX[1], 625.0f, D_80150130[camera - camera1], D_802B9730);
f32 temp_f0 = func_802B80D0(camera->pos, actor->pos, camera->rot[1], 625.0f, D_80150130[camera - camera1], D_802B9730);
if (temp_f0 < 0.0f) { return; }
@ -2074,7 +2074,7 @@ void func_8029C3CC(Camera *camera, struct TrainCar *actor) {
Mat4 spE0;
Mat4 spA0;
f32 temp_f0 = func_802B80D0(camera->pos, actor->pos, camera->rotX[1], 2025.0f, D_80150130[camera - camera1], D_802B9740);
f32 temp_f0 = func_802B80D0(camera->pos, actor->pos, camera->rot[1], 2025.0f, D_80150130[camera - camera1], D_802B9740);
if (temp_f0 < 0.0f) { return; }
@ -2192,7 +2192,7 @@ void func_8029CA90(Camera *camera, struct FallingRock *rock) {
if (rock->respawnTimer != 0) { return; }
temp_f0 = func_802B80D0(camera->pos, rock->pos, camera->rotX[1], 400.0f, D_80150130[camera - camera1], D_802B9750);
temp_f0 = func_802B80D0(camera->pos, rock->pos, camera->rot[1], 400.0f, D_80150130[camera - camera1], D_802B9750);
if (temp_f0 < 0.0f) { return; }
@ -4423,7 +4423,7 @@ void func_802A171C(Camera *camera, struct Actor *actor) {
temp_a1 = actor->pos;
sp38 = temp_a1;
if (func_802B80D0(temp_a1, (u16) camera->rotX2, 0x451C4000, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), D_802B99E0) < 0.0f) {
if (func_802B80D0(temp_a1, (u16) camera->rot2, 0x451C4000, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), D_802B99E0) < 0.0f) {
func_80297230(camera, actor);
return;
}
@ -4713,7 +4713,7 @@ void func_802A1EA0(Camera *camera, struct ItemBox *item_box) {
temp_a1 = item_box->pos;
sp38 = temp_a1;
temp_f0 = func_802B80D0(temp_a1, (u16) camera->rotX2, 0, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), D_802B9A00);
temp_f0 = func_802B80D0(temp_a1, (u16) camera->rot2, 0, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), D_802B9A00);
if (!(temp_f0 < 0.0f) && !(D_802B9A04 < temp_f0)) {
temp_a0 = item_box->state;
phi_a0 = temp_a0;
@ -4949,7 +4949,7 @@ GLOBAL_ASM("asm/non_matchings/actors/func_802A1EA0.s")
void func_802A269C(Camera *arg0, struct Actor *arg1) {
Mat4 sp38;
f32 unk = func_802B80D0(arg0->pos, arg1->pos, arg0->rotX[1], 0, D_80150130[arg0 - camera1], D_802B9A28);
f32 unk = func_802B80D0(arg0->pos, arg1->pos, arg0->rot[1], 0, D_80150130[arg0 - camera1], D_802B9A28);
if (!(unk < 0.0f)) {
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
@ -4970,7 +4970,7 @@ void func_802A27A0(Camera *arg0, Mat4 arg1, struct YoshiValleyEgg *egg, u16 arg3
f32 temp_f0;
if (D_800DC50C != CREDITS_SEQUENCE) {
temp_f0 = func_802B80D0(arg0->pos, egg->pos, arg0->rotX[1], 200.0f, D_80150130[arg0 - camera1], D_802B9A2C);
temp_f0 = func_802B80D0(arg0->pos, egg->pos, arg0->rot[1], 200.0f, D_80150130[arg0 - camera1], D_802B9A2C);
if (temp_f0 < 0.0f) {
return;
}
@ -5014,7 +5014,7 @@ void func_802A29BC(Camera *arg0, Mat4 arg1, struct Actor *arg2) {
s16 temp = arg2->flags;
if (temp & 0x800) { return; }
unk = func_802B80D0(arg0->pos, arg2->pos, arg0->rotX[1], 0, D_80150130[arg0 - camera1], 16000000.0f);
unk = func_802B80D0(arg0->pos, arg2->pos, arg0->rot[1], 0, D_80150130[arg0 - camera1], 16000000.0f);
if (!(unk < 0.0f)) {
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
@ -5031,7 +5031,7 @@ s16 D_802B885C[] = {0, 0, 0};
void func_802A2AD0(Camera *arg0, struct Actor *arg1) {
Vec3s sp80 = {0, 0, 0};
Mat4 sp40;
f32 unk = func_802B80D0(arg0->pos, arg1->pos, arg0->rotX[1], 0.0f, D_80150130[arg0 - camera1], 4000000.0f);
f32 unk = func_802B80D0(arg0->pos, arg1->pos, arg0->rot[1], 0.0f, D_80150130[arg0 - camera1], 4000000.0f);
if (unk < 0.0f) { return; }
func_802B5F74(sp40, arg1->pos, arg1->rot);
@ -5063,7 +5063,7 @@ void func_802A2C78(Camera *arg0, Mat4 arg1, struct Actor *arg2) {
return;
}
temp_f0 = func_802B80D0(arg0->pos, arg2->pos, arg0->rotX[1], 0.0f, D_80150130[arg0 - camera1], 4000000.0f);
temp_f0 = func_802B80D0(arg0->pos, arg2->pos, arg0->rot[1], 0.0f, D_80150130[arg0 - camera1], 4000000.0f);
if (!(temp_f0 < 0.0f)) {
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
@ -5137,8 +5137,8 @@ void func_802A3008(struct UnkStruct_800DC5EC *arg0) {
struct Actor *phi_s0;
Vec3f sp4C = {0.0f, 5.0f, 10.0f};
f32 sp48 = sins(temp_s1->rotX[1] - 0x8000); // unk26;
f32 temp_f0 = coss(temp_s1->rotX[1] - 0x8000);
f32 sp48 = sins(temp_s1->rot[1] - 0x8000); // unk26;
f32 temp_f0 = coss(temp_s1->rot[1] - 0x8000);
D_801502C0[0][0] = temp_f0;

File diff suppressed because it is too large Load Diff

55
src/camera.h Normal file
View File

@ -0,0 +1,55 @@
#ifndef CAMERA_H
#define CAMERA_H
#include "common_structs.h"
typedef struct {
/* 0x00 */ Vec3f pos;
/* 0x0C */ Vec3f lookAt;
// This is expected to be a normalized vector, indicates what direction is "up" for the camera
/* 0x18 */ Vec3f up;
// I think these are the "nautical angles" between pos and lookAt
// rot[0] = pitch, rot[1] = yaw, rot[2] = roll?
/* 0x24 */ Vec3s rot;
/* 0x2A */ s16 rotZ;
/* 0x2C */ s16 unk_2C;
/* 0x2E */ s16 unk_2E;
/* 0x30 */ Vec3f unk_30;
/* 0x3C */ Vec3f unk_3C;
/* 0x48 */ s32 unk_48;
/* 0x4C */ s32 unk_4C;
/* 0x50 */ s32 unk_50;
/* 0x54 */ UnkActorInner unk_54;
// When you hit a wall (or another driver) the camera's pos and lookAt bounce up and down. This is the velocity(?) of that bouncing
/* 0x94 */ f32 unk_94;
/* 0x98 */ s16 unk_98;
/* 0x9A */ s16 unk_9A;
// Timer for wall-hit bounce. Counts up instead of down
/* 0x9C */ s16 unk_9C;
/* 0x9E */ s16 pad_9E;
/* 0xA0 */ f32 unk_A0;
/* 0xA4 */ s32 unk_A4;
/* 0xA8 */ s32 unk_A8;
/* 0xAC */ s16 unk_AC;
// Id of the player the camera is following.
/* 0xAE */ s16 playerId;
// Seems related to camera movement during drifting
/* 0xB0 */ s16 unk_B0;
/* 0xB2 */ s16 unk_B2;
/* 0xB4 */ f32 unk_B4;
} Camera; /* size = 0xB8 */
void func_8001CA10(Camera*);
void func_8001CA24(Player*, f32);
extern Camera cameras[];
extern Camera *camera1;
extern Camera *camera2;
extern Camera *camera3;
extern Camera *camera4;
extern Player *gPlayerTwo;
extern Player *gPlayerThree;
extern Player *gPlayerFour;
#endif

View File

@ -1,48 +1,44 @@
#include <ultra64.h>
#include <macros.h>
#include <common_structs.h>
extern Camera cameras[];
extern u16 atan2s(f32, f32);
void func_80281610(void) {
Camera *camera = &cameras[0];
//f32 sp1C;
f32 temp_f12;
f32 temp;
f32 temp_f14;
func_80283648(camera);
temp_f12 = camera->unk - camera->pos[0];
temp = camera->unk1 - camera->pos[1];
temp_f14 = camera->unk2 - camera->pos[2];
camera->rotX[1] = atan2s(temp_f12, temp_f14);
camera->rotX[0] = atan2s(sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14)), temp);
camera->rotX[2] = 0;
}
#include "camera.h"
#include "math_util.h"
// guPerspective params
extern f32 D_80150148, D_8015014C, D_80150150;
extern f32 D_80150130[];
// rodata
extern const f32 D_80286B90, D_80286B94, D_80286B98, D_80286B9C, D_80286BA0;
void func_80281610(void) {
Camera *camera;
f32 x_dist;
f32 y_dist;
f32 z_dist;
camera = &cameras[0];
func_80283648(camera);
x_dist = camera->lookAt[0] - camera->pos[0];
y_dist = camera->lookAt[1] - camera->pos[1];
z_dist = camera->lookAt[2] - camera->pos[2];
camera->rot[1] = atan2s(x_dist, z_dist);
camera->rot[0] = atan2s(sqrtf((x_dist * x_dist) + (z_dist * z_dist)), y_dist);
camera->rot[2] = 0;
}
// GP Ending sequence camera settings?
void func_802816B8(void) {
cameras[0].pos[0] = D_80286B90;
cameras[0].pos[0] = -3133.0f;
cameras[0].pos[1] = 19.0f;
cameras[0].pos[2] = D_80286B94;
cameras[0].unk = D_80286B98;
cameras[0].unk1 = 21.0f;
cameras[0].unk2 = -528.0f;
cameras[0].angleX = 0.0f;
cameras[0].angleY = 1.0f;
cameras[0].angleZ = 0.0f;
cameras[0].pos[2] = -467.0f;
cameras[0].lookAt[0] = -3478.0f;
cameras[0].lookAt[1] = 21.0f;
cameras[0].lookAt[2] = -528.0f;
cameras[0].up[0] = 0.0f;
cameras[0].up[1] = 1.0f;
cameras[0].up[2] = 0.0f;
D_80150130[0] = 40.0f;
D_80150148 = D_80286B9C;
D_80150148 = 1.33333333f;
D_80150150 = 3.0f;
D_8015014C = D_80286BA0;
D_8015014C = 6800.0f;
func_80283430();
}

File diff suppressed because it is too large Load Diff

View File

@ -41,7 +41,8 @@ f32 func_80010FA0(f32, f32, f32, s32);
s32 process_path_data(struct TrackWayPoint*, struct TrackWayPoint*);
f32 func_80013C74(s16, s16);
f32 func_800145A8(s16, f32, s16);
void func_8001968C(void);
void func_80014D30(s32, s32);
void func_8001968C();
/* This is where I'd put my static data, if I had any */
// Might belong in menus.h?

View File

@ -963,32 +963,25 @@ void func_80022180(Mtx *arg0, Mat4 arg1) {
arg0->m[3][3] = ((s32) (arg1[3][2] * someMultiplier) << 0x10) | ((s32) (arg1[3][3] * someMultiplier) & 0xFFFF);
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800224F0(s16 *arg0, s16 arg1, s16 arg2) {
s32 func_800224F0(s16 *arg0, s16 arg1, s16 arg2) {
s16 temp_v0;
s16 temp_v0_2;
s16 temp_v0_3;
s16 phi_a2;
temp_v0 = arg1 - *arg0;
phi_a2 = arg2;
if (arg2 < 0) {
phi_a2 = arg2 * -1;
arg2 *= -1;
}
if (temp_v0 > 0) {
temp_v0_2 = temp_v0 - phi_a2;
if (temp_v0_2 >= 0) {
*arg0 = arg1 - temp_v0_2;
temp_v0 -= arg2;
if (temp_v0 >= 0) {
*arg0 = arg1 - temp_v0;
} else {
goto block_8;
*arg0 = arg1;
}
} else {
temp_v0_3 = temp_v0 + phi_a2;
if (temp_v0_3 <= 0) {
*arg0 = arg1 - temp_v0_3;
temp_v0 += arg2;
if (temp_v0 <= 0) {
*arg0 = arg1 - temp_v0;
} else {
block_8:
*arg0 = arg1;
}
}
@ -997,9 +990,6 @@ block_8:
}
return 1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_8001F980/func_800224F0.s")
#endif
void move_s32_towards(s32 *startingValue, s32 targetValue, f32 somePercent) {
*startingValue -= ((*startingValue - targetValue) * somePercent);

View File

@ -19,6 +19,7 @@ void func_80021DA8();
void func_80021F84(Mat4, f32);
void func_80021FF8(Mtx*, Mat4);
void func_80022180(Mtx*, Mat4);
s32 func_800224F0(s16*, s16, s16);
void move_s32_towards(s32*, s32, f32);
void move_f32_towards(f32*, f32, f32);
void move_s16_towards(s16*, s16, f32);

View File

@ -2815,19 +2815,16 @@ GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002CD48.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800224F0(void *, ?, ?); // extern
? func_8003680C(f32, void *, s16, s32, s32); // extern
s32 func_802B5224(s32, f32 *, s32, s32); // extern
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
? func_8003680C(f32, Player *, s16, s16, s32); /* extern */
void func_8002D028(void *arg0, s8 arg1) {
void func_8002D028(Player *player, s8 arg1) {
f32 sp54;
f32 sp50;
f32 sp4C;
s16 sp46;
s32 sp34;
s16 *sp2C;
f32 *temp_a1;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f2;
@ -2835,59 +2832,54 @@ void func_8002D028(void *arg0, s8 arg1) {
s16 temp_v0;
s16 temp_v1;
s16 temp_v1_2;
s32 temp_a3;
s16 var_a2;
s32 temp_f18;
s32 temp_f8;
s32 temp_t1;
s32 phi_a2;
s32 phi_a2_2;
temp_a3 = arg1 * 2;
temp_v0 = D_80165270[arg1];
temp_a1 = &sp4C;
sp34 = temp_a3;
sp34 = arg1 * 2;
sp4C = D_80165210[temp_v0];
sp50 = 0.0f;
sp54 = D_80165230[temp_v0];
temp_f0 = 8.0f * 182.0f;
temp_v1 = -func_802B5224(arg0 + 0x14, temp_a1, arg1 << 0x18, temp_a3) - arg0->unk2E;
temp_f8 = temp_f0;
temp_f18 = -8.0f * 182.0f;
phi_a2 = temp_v1;
if (temp_f8 < temp_v1) {
phi_a2 = temp_f8;
temp_v1 = -func_802B5224(player->pos, &sp4C) - player->unk_02E;
temp_f8 = (s32) temp_f0;
var_a2 = temp_v1;
temp_f18 = (s32) (-8.0f * 182.0f);
if ((s16) temp_f8 < temp_v1) {
var_a2 = (s16) temp_f8;
}
phi_a2_2 = phi_a2;
if (phi_a2 < temp_f18) {
phi_a2_2 = temp_f18;
if (var_a2 < (s16) temp_f18) {
var_a2 = (s16) temp_f18;
}
temp_v0_2 = &D_80165020[arg1];
temp_v0_2 = sp34 + D_80165020;
sp2C = temp_v0_2;
temp_t1 = (*temp_v0_2 + ((phi_a2_2 * 0x35) / temp_f0)) / 2;
sp46 = temp_t1;
func_8003680C(182.0f, arg0, temp_t1, phi_a2_2, temp_a3);
*temp_v0_2 = temp_t1;
temp_f0_2 = sp54 - arg0->unk1C;
temp_f2 = sp4C - arg0->unk14;
temp_t1 = (s32) (*temp_v0_2 + (s16) (s32) ((f32) (var_a2 * 0x35) / temp_f0)) / 2;
sp46 = (s16) temp_t1;
func_8003680C(182.0f, player, (s16) temp_t1, var_a2, sp34);
*temp_v0_2 = (s16) temp_t1;
temp_f0_2 = sp54 - player->pos[2];
temp_f2 = sp4C - player->pos[0];
if (sqrtf((temp_f0_2 * temp_f0_2) + (temp_f2 * temp_f2)) <= 8.0f) {
func_800224F0(arg0 + 0x2E, -0x8000, 0x16C);
temp_v1_2 = arg0->unk2E;
func_800224F0(&player->unk_02E, -0x8000, 0x016C);
temp_v1_2 = player->unk_02E;
if ((temp_v1_2 < -0x7F41) || (temp_v1_2 >= 0x7F42)) {
arg0->unk0 = arg0->unk0 & 0xFDFF;
player->unk_000 &= 0xFDFF;
}
arg0->unk8C = 0.0f;
arg0->unk94 = 0.0f;
arg0->unk104 = 0.0f;
arg0->unk240 = 0;
arg0->unk7C = 0;
arg0->unk34 = 0.0f;
arg0->unk38 = 0.0f;
arg0->unk3C = 0.0f;
arg0->unkC0 = 0;
arg0->unk78 = 0;
player->unk_08C = 0.0f;
player->unk_094 = 0.0f;
player->unk_104 = 0.0f;
player->unk_240 = 0;
player->unk_07C = 0;
player->unk_034[0] = 0.0f;
player->unk_034[1] = 0.0f;
player->unk_034[2] = 0.0f;
player->unk_0C0 = 0;
player->unk_078 = 0;
return;
}
arg0->unk8C = 1200.0f;
player->unk_08C = 1200.0f;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002D028.s")

View File

@ -5,12 +5,11 @@
#include "main.h"
#include "types.h"
#include "camera.h"
#include "code_80281780.h"
extern Gfx *gDisplayListHead;
extern Camera cameras[];//, *camera1, *camera2, *camera3, *camera4;
extern f32 D_80150148, D_8015014C, D_80150150;
extern f32 D_80150130[4];
extern s16 gCreditsCourseId;
@ -54,7 +53,7 @@ void func_80280038(void) {
guPerspective(&gGfxPool->mtxPool[1], &sp44[37], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f);
gDPHalf1(gDisplayListHead++, sp44[37]);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ);
guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
gCurrentCourseId = gCreditsCourseId;
mtxf_identity(&sp44);
@ -99,12 +98,12 @@ void func_802802AC(void) {
D_802874FC = 0;
func_80283648(camera);
temp_f12 = camera->unk - camera->pos[0];
temp = camera->unk1 - camera->pos[1];
temp_f14 = camera->unk2 - camera->pos[2];
camera->rotX[1] = atan2s(temp_f12, temp_f14);
camera->rotX[0] = atan2s(sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14)), temp);
camera->rotX[2] = 0;
temp_f12 = camera->lookAt[0] - camera->pos[0];
temp = camera->lookAt[1] - camera->pos[1];
temp_f14 = camera->lookAt[2] - camera->pos[2];
camera->rot[1] = atan2s(temp_f12, temp_f14);
camera->rot[0] = atan2s(sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14)), temp);
camera->rot[2] = 0;
if (D_802874A0 != 0) {
D_800DC5E4++;
} else {
@ -124,7 +123,7 @@ void func_80280420(void) {
D_800DC518 = 1;
func_802A4D18();
func_802A74BC();
camera->unk30 = 60.0f;
camera->unk_B4 = 60.0f;
D_80150130[0] = 60.0f;
D_800DC5EC->screenWidth = 320;
D_800DC5EC->screenHeight = 240;
@ -152,12 +151,12 @@ void func_80280420(void) {
camera->pos[0] = 1400.0f;
camera->pos[1] = 300.0f;
camera->pos[2] = 1400.0f;
camera->unk = 0.0f;
camera->unk1 = 0.0f;
camera->unk2 = 0.0f;
camera->angleX = 0.0f;
camera->angleY = 1.0f;
camera->angleZ = 0.0f;
camera->lookAt[0] = 0.0f;
camera->lookAt[1] = 0.0f;
camera->lookAt[2] = 0.0f;
camera->up[0] = 0.0f;
camera->up[1] = 1.0f;
camera->up[2] = 0.0f;
func_80283430();
func_80003040();
func_8006E9C0();

View File

@ -97,7 +97,7 @@ void load_ending_sequence_royalraceway(void) {
D_80287554 = 0;
func_802A4D18();
func_802A74BC();
camera->unk30 = 60.0f;
camera->unk_B4 = 60.0f;
D_80150130[0] = 60.0f;
D_800DC5EC->screenWidth = SCREEN_WIDTH;
D_800DC5EC->screenHeight = SCREEN_HEIGHT;

View File

@ -21,8 +21,6 @@ extern u16 gIsInQuitToMenuTransition;
extern Gfx D_00284F70[];
extern Gfx D_00284EE0[];
extern Camera cameras[];
extern f32 D_80150148, D_8015014C, D_80150150;
extern f32 D_80150130[];
@ -66,7 +64,7 @@ void func_80281D00(void) {
guPerspective((Mtx*) &gGfxPool->mtxPool[1], &sp64[39], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f);
gDPHalf1(gDisplayListHead++, sp64[39]);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
guLookAt((Mtx*) &gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ);
guLookAt((Mtx*) &gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(&sp64[6]);
func_802B4FF8(&sp64[6], 0);

View File

@ -611,7 +611,7 @@ void func_8000142C(void) {
D_800DC514 = 0;
}
temp_v0 = camera1->rotX[1];
temp_v0 = camera1->rot[1];
D_801625E8 = D_800DC5EC->pathCounter;
if (temp_v0 < 0x2000) {
func_80057A50(40, 100, "SOUTH ", D_801625E8);

View File

@ -49,6 +49,7 @@ s16 func_802B7D28(f32);
u16 random_u16();
u16 random_int(u16);
s16 func_802B7F34(f32, f32, f32, f32);
void func_802B7F7C(Vec3f, Vec3f, Vec3s);
f32 sins(u16);
f32 coss(u16);

View File

@ -451,7 +451,7 @@ s32 func_80041980(Vec3f arg0, Camera *arg1, u16 arg2) {
s32 ret;
ret = 0;
temp_t9 = (func_80041770(arg1->pos[0], arg0[0], arg1->pos[2], arg0[2]) + (arg2 / 2)) - arg1->rotX[1];
temp_t9 = (func_80041770(arg1->pos[0], arg0[0], arg1->pos[2], arg0[2]) + (arg2 / 2)) - arg1->rot[1];
if ((temp_t9 >= 0) && (arg2 >= temp_t9)) {
ret = 1;
}

View File

@ -5,6 +5,7 @@
#include <config.h>
#include <defines.h>
#include "waypoints.h"
#include "camera.h"
extern Player *gPlayerTwo;
extern Player *gPlayerThree;
@ -12,11 +13,6 @@ extern Player *gPlayerFour;
extern Player *gPlayerOneCopy;
extern Player *gPlayerTwoCopy;
extern struct Camera *camera1;
extern struct Camera *camera2;
extern struct Camera *camera3;
extern struct Camera *camera4;
extern struct Controller gControllers[];
extern struct Controller *gControllerOne;
extern struct Controller *gControllerThree;

View File

@ -34,13 +34,13 @@ extern s32 D_802B87CC;
void func_802A7658(s32, s32, s32, s32, u16*, u16*);
s32 func_80290C20(Camera *camera) {
if (camera->unk14 == 0) {
if (camera->unk_54.unk34 == 0) {
return 1;
}
if ((camera->unk13 == 1) && (camera->collisionY < 3.0f)) {
if ((camera->unk_54.unk30 == 1) && (camera->unk_54.unk3C < 3.0f)) {
return 1;
}
if ((camera->unk13_and_a_half == 1) && (camera->collisionZ < 3.0f)) {
if ((camera->unk_54.unk32 == 1) && (camera->unk_54.unk40 < 3.0f)) {
return 1;
}
return 0;

View File

@ -6,6 +6,7 @@
#include <common_structs.h>
#include <variables.h>
#include <config.h>
#include "camera.h"
void func_802A41D4();
@ -988,8 +989,8 @@ void func_802A59A4(void) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2],
camera->unk, camera->unk1, camera->unk2, camera->angleX,
camera->angleY, camera->angleZ);
camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0],
camera->up[1], camera->up[2]);
if (D_800DC5C8 == 0) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(sp5C);
@ -1036,7 +1037,7 @@ void func_802A5CB4(void) {
guPerspective(&gGfxPool->mtxPool[1], &sp9A[17], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f);
gDPHalf1(gDisplayListHead++, sp9A[17]);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ);
guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]);
if (D_800DC5C8 == 0) {
@ -1085,7 +1086,7 @@ void func_802A5FAC(void) {
guPerspective(&gGfxPool->mtxPool[2], &sp9A[17], D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f);
gDPHalf1(gDisplayListHead++, sp9A[17]);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ);
guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]);
//D_801647A8, D_801647AC, D_801647B0, D_801647B4, D_801647B8, D_801647BC, D_801647C0, D_801647C4, D_801647C8);
@ -1133,7 +1134,7 @@ void func_802A62A4(void) {
guPerspective(&gGfxPool->mtxPool[1], &sp9A[17], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f);
gDPHalf1(gDisplayListHead++, sp9A[17]);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ);
guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]);
if (D_800DC5C8 == 0) {
@ -1181,7 +1182,7 @@ void func_802A65B8(void) {
guPerspective(&gGfxPool->mtxPool[2], &sp9A[17], D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f);
gDPHalf1(gDisplayListHead++, sp9A[17]);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ);
guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]);
if (D_800DC5C8 == 0) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
@ -1227,7 +1228,7 @@ void func_802A68CC(void) {
guPerspective(&gGfxPool->mtxPool[1], &sp9A[17], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f);
gDPHalf1(gDisplayListHead++, sp9A[17]);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ);
guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]);
if (D_800DC5C8 == 0) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[7]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
@ -1274,7 +1275,7 @@ void func_802A6BB0(void) {
gDPHalf1(gDisplayListHead++, sp9A[17]);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ);
guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]);
if (D_800DC5C8 == 0) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[8]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(sp58);
@ -1318,7 +1319,7 @@ void func_802A6E94(void) {
guPerspective(&gGfxPool->mtxPool[3], &sp9A[17], D_80150130[2], D_80150148, D_80150150, D_8015014C, 1.0f);
gDPHalf1(gDisplayListHead++, sp9A[17]);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
guLookAt(&gGfxPool->mtxPool[9], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ);
guLookAt(&gGfxPool->mtxPool[9], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]);
if (D_800DC5C8 == 0) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[9]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
@ -1373,7 +1374,7 @@ void func_802A7178(void) {
guPerspective(&gGfxPool->mtxPool[4], &sp92[17], D_80150130[3], D_80150148, D_80150150, D_8015014C, 1.0f);
gDPHalf1(gDisplayListHead++, sp92[17]);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[4]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
guLookAt(&gGfxPool->mtxPool[10], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ);
guLookAt(&gGfxPool->mtxPool[10], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]);
if (D_800DC5C8 == 0) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[10]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(sp50);