mirror of
https://github.com/pmret/papermario.git
synced 2024-11-09 12:32:38 +01:00
Match func_802B7000
This commit is contained in:
parent
51ff61c479
commit
65f1db2e87
@ -1,55 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel func_802B7000
|
||||
/* E20EB0 802B7000 3C014387 */ lui $at, 0x4387
|
||||
/* E20EB4 802B7004 44810000 */ mtc1 $at, $f0
|
||||
/* E20EB8 802B7008 00000000 */ nop
|
||||
/* E20EBC 802B700C 460C003E */ c.le.s $f0, $f12
|
||||
/* E20EC0 802B7010 00000000 */ nop
|
||||
/* E20EC4 802B7014 45000009 */ bc1f .L802B703C
|
||||
/* E20EC8 802B7018 240200FF */ addiu $v0, $zero, 0xff
|
||||
/* E20ECC 802B701C 3C0143B4 */ lui $at, 0x43b4
|
||||
/* E20ED0 802B7020 44810000 */ mtc1 $at, $f0
|
||||
/* E20ED4 802B7024 00000000 */ nop
|
||||
/* E20ED8 802B7028 460C0001 */ sub.s $f0, $f0, $f12
|
||||
/* E20EDC 802B702C 4600010D */ trunc.w.s $f4, $f0
|
||||
/* E20EE0 802B7030 44032000 */ mfc1 $v1, $f4
|
||||
/* E20EE4 802B7034 080ADC2B */ j .L802B70AC
|
||||
/* E20EE8 802B7038 00431023 */ subu $v0, $v0, $v1
|
||||
.L802B703C:
|
||||
/* E20EEC 802B703C 3C014334 */ lui $at, 0x4334
|
||||
/* E20EF0 802B7040 44811000 */ mtc1 $at, $f2
|
||||
/* E20EF4 802B7044 00000000 */ nop
|
||||
/* E20EF8 802B7048 460C103E */ c.le.s $f2, $f12
|
||||
/* E20EFC 802B704C 00000000 */ nop
|
||||
/* E20F00 802B7050 45000006 */ bc1f .L802B706C
|
||||
/* E20F04 802B7054 00000000 */ nop
|
||||
/* E20F08 802B7058 46026001 */ sub.s $f0, $f12, $f2
|
||||
/* E20F0C 802B705C 4600010D */ trunc.w.s $f4, $f0
|
||||
/* E20F10 802B7060 44032000 */ mfc1 $v1, $f4
|
||||
/* E20F14 802B7064 080ADC2B */ j .L802B70AC
|
||||
/* E20F18 802B7068 00431023 */ subu $v0, $v0, $v1
|
||||
.L802B706C:
|
||||
/* E20F1C 802B706C 3C0142B4 */ lui $at, 0x42b4
|
||||
/* E20F20 802B7070 44810000 */ mtc1 $at, $f0
|
||||
/* E20F24 802B7074 00000000 */ nop
|
||||
/* E20F28 802B7078 460C003E */ c.le.s $f0, $f12
|
||||
/* E20F2C 802B707C 00000000 */ nop
|
||||
/* E20F30 802B7080 45000006 */ bc1f .L802B709C
|
||||
/* E20F34 802B7084 240200FF */ addiu $v0, $zero, 0xff
|
||||
/* E20F38 802B7088 460C1001 */ sub.s $f0, $f2, $f12
|
||||
/* E20F3C 802B708C 4600010D */ trunc.w.s $f4, $f0
|
||||
/* E20F40 802B7090 44032000 */ mfc1 $v1, $f4
|
||||
/* E20F44 802B7094 080ADC2B */ j .L802B70AC
|
||||
/* E20F48 802B7098 00431023 */ subu $v0, $v0, $v1
|
||||
.L802B709C:
|
||||
/* E20F4C 802B709C 4600610D */ trunc.w.s $f4, $f12
|
||||
/* E20F50 802B70A0 44032000 */ mfc1 $v1, $f4
|
||||
/* E20F54 802B70A4 00000000 */ nop
|
||||
/* E20F58 802B70A8 00431023 */ subu $v0, $v0, $v1
|
||||
.L802B70AC:
|
||||
/* E20F5C 802B70AC 03E00008 */ jr $ra
|
||||
/* E20F60 802B70B0 00431023 */ subu $v0, $v0, $v1
|
||||
|
@ -1,6 +1,20 @@
|
||||
#include "common.h"
|
||||
|
||||
INCLUDE_ASM(code_e20eb0, func_802B7000);
|
||||
// TODO: Figure out what this function is doing
|
||||
s32 func_802B7000(f32 angle) {
|
||||
s32 angleDiff;
|
||||
|
||||
if (270.0f <= angle) {
|
||||
angleDiff = 360.0f - angle;
|
||||
} else if (180.0f <= angle) {
|
||||
angleDiff = angle - 180.0f;
|
||||
} else if (90.0f <= angle) {
|
||||
angleDiff = 180.0f - angle;
|
||||
} else {
|
||||
angleDiff = angle;
|
||||
}
|
||||
return 0xFF - angleDiff - angleDiff;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(code_e20eb0, func_802B70B4);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user