src/core1: renamed and documented file

umbenannt:      src/core1/code_2FA0.c -> src/core1/stub_2FA0.c
This commit is contained in:
mariob92
2024-10-13 21:40:02 +02:00
parent e125d3c1be
commit a5b65b87fa
4 changed files with 79 additions and 75 deletions

View File

@@ -152,7 +152,7 @@ segments:
- [0xF3F680, c, code_1D00] # NONMATCHING
- [0xF40490, c, pimanager]
- [0xF40650, c, defragmanager]
- [0xF40850, c, code_2FA0]
- [0xF40850, c, stub_2FA0]
- [0xF40A70, c, initthread]
- [0xF40B00, c, code_3250]
- [0xF41320, c, code_3A70]
@@ -365,7 +365,7 @@ segments:
- [0xF74830, .data, code_660]
- [0xF74930, .data, code_1D00]
- [0xF74A10, bin, data_37E30] #unreferenced
- [0xF74A20, .data, code_2FA0]
- [0xF74A20, .data, stub_2FA0]
- [0xF74A30, .data, code_3250]
- [0xF74A40, .data, code_3A70]
- [0xF74A80, .data, code_5650]

View File

@@ -152,7 +152,7 @@ segments:
- [0xF1AF50, c, code_1D00] #DONE
- [0xF1BE20, c, pimanager]
- [0xF1BFF0, c, defragmanager] #DONE
- [0xF1C1F0, c, code_2FA0] #DONE
- [0xF1C1F0, c, stub_2FA0] #DONE
- [0xF1C410, c, initthread] #DONE
- [0xF1C4A0, c, code_3250] #DONE
- [0xF1CCC0, c, code_3A70] #DONE
@@ -365,7 +365,7 @@ segments:
- [0xF50EA0, .data, code_660]
- [0xF50FA0, .data, code_1D00]
- [0xF51080, bin, data_37E30] #unreferenced
- [0xF51090, .data, code_2FA0]
- [0xF51090, .data, stub_2FA0]
- [0xF510A0, .data, code_3250]
- [0xF510B0, .data, code_3A70]
- [0xF510F0, .data, code_5650]

View File

@@ -1,71 +0,0 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
s32 D_80275860 = 0;
void func_802409C0(f32 arg0[3], f32 arg1){
f32 vp_rotation[3];
f32 sp30[3];
f32 sp28[2];
f32 dt;
dt = time_getDelta()*arg1;
controller_getJoystick(0, sp28);
sp30[0] = sp28[0] * dt;
sp30[1] = 0.0f;
sp30[2] = -(sp28[1] * dt);
viewport_getRotation_vec3f(vp_rotation);
ml_vec3f_yaw_rotate_copy(sp30, sp30, vp_rotation[1]);
arg0[0] = arg0[0] + sp30[0];
arg0[1] = arg0[1] + sp30[1];
arg0[2] = arg0[2] + sp30[2];
}
void func_80240A74(f32 arg0[3]){
func_802409C0(arg0, 400.0f);
}
f32 func_80240A94(s32 arg0, f32 arg1){
if(arg0 >= 0x29){
arg0 = 0x28;
}
return arg1 + (f32)arg0*(arg1)/16 ;
}
void func_80240AC8(f32 arg0[3], f32 arg1){
f32 vp_rotation[3];
f32 sp30[3];
f32 sp28[2];
f32 dt;
dt = time_getDelta()*arg1;
controller_getJoystick(0, sp28);
if(0.0f != sp28[0] || 0.0f != sp28[1]){
D_80275860++;
if(D_80275860 >= 0x12D)
D_80275860 = 0x12C;
}
else{
D_80275860 = 1;
}
dt = func_80240A94(D_80275860, dt);
sp30[0] = sp28[0] * dt;
sp30[1] = 0.0f;
sp30[2] = -(sp28[1] * dt);
viewport_getRotation_vec3f(vp_rotation);
ml_vec3f_yaw_rotate_copy(sp30, sp30, vp_rotation[1]);
arg0[0] = arg0[0] + sp30[0];
arg0[1] = arg0[1] + sp30[1];
arg0[2] = arg0[2] + sp30[2];
}

75
src/core1/stub_2FA0.c Normal file
View File

@@ -0,0 +1,75 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
// all functions in this file are unsued
void stub_802409C0(f32 position[3], f32 speed);
void stub_80240A74(f32 position[3]);
f32 stub_80240A94(s32 time_out, f32 arg1);
void stub_80240AC8(f32 position[3], f32 speed);
static s32 sTimeout = 0;
void stub_802409C0(f32 position[3], f32 speed) {
f32 vp_rotation[3];
f32 delta_position[3];
f32 joystick_data[2];
f32 dt;
dt = time_getDelta() * speed;
controller_getJoystick(0, joystick_data);
delta_position[0] = joystick_data[0] * dt;
delta_position[1] = 0.0f;
delta_position[2] = -(joystick_data[1] * dt);
viewport_getRotation_vec3f(vp_rotation);
ml_vec3f_yaw_rotate_copy(delta_position, delta_position, vp_rotation[1]);
position[0] = position[0] + delta_position[0];
position[1] = position[1] + delta_position[1];
position[2] = position[2] + delta_position[2];
}
void stub_80240A74(f32 position[3]) {
stub_802409C0(position, 400.0f);
}
f32 stub_80240A94(s32 time_out, f32 delta_time) {
if (time_out > 40)
time_out = 40;
return delta_time + (f32) time_out * delta_time / 16;
}
void stub_80240AC8(f32 position[3], f32 speed) {
f32 vp_rotation[3];
f32 delta_position[3];
f32 joystick_data[2];
f32 dt;
dt = time_getDelta() * speed;
controller_getJoystick(0, joystick_data);
if (0.0f != joystick_data[0] || 0.0f != joystick_data[1]) {
sTimeout++;
if (sTimeout > 300)
sTimeout = 300;
} else {
sTimeout = 1;
}
dt = stub_80240A94(sTimeout, dt);
delta_position[0] = joystick_data[0] * dt;
delta_position[1] = 0.0f;
delta_position[2] = -(joystick_data[1] * dt);
viewport_getRotation_vec3f(vp_rotation);
ml_vec3f_yaw_rotate_copy(delta_position, delta_position, vp_rotation[1]);
position[0] = position[0] + delta_position[0];
position[1] = position[1] + delta_position[1];
position[2] = position[2] + delta_position[2];
}