1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-12 19:04:38 +00:00

Decompile code_800D2E30 and use struct in code_800A9F30 (#80)

* Match func_800AA000

* Match z_camera/func_800437F0

* Decompile code_800D2E30, use struct in 800A9F30

* Format

* Remove 'U' from literals

* Remove bss, cleanup z_camera

* Review changes, rename temp

* Move externs to variables.h
This commit is contained in:
Synray 2020-04-18 19:56:53 -07:00 committed by GitHub
parent 21750d5aee
commit eefbe9afe1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 197 additions and 424 deletions

View file

@ -22,9 +22,20 @@ typedef struct {
Vec3s pos;
} SplineData; // originally called SplinedatZ
// 47 lines
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800437F0.s")
// had an attempt at this but didn't get very close
f32 func_800437F0(f32 arg0, f32 arg1) {
f32 percent = 0.4f;
f32 ret = fabsf(arg1);
if (arg0 < ret) {
ret = 1;
} else if (ret < (f32)arg0 * (1 - percent)) { //! float cast needed to match
ret = (SQ(arg1) * (1 - percent)) / SQ((1 - percent) * arg0);
} else {
ret = 1 - (0.4f * SQ(arg0 - ret)) / SQ(0.4f * arg0);
}
return ret;
}
f32 func_8004389C(f32 a, f32 b, f32 c, f32 d) {
f32 temp1 = a - b;