WRP PSP func_8018C1E0 (#1183)

This commit is contained in:
sozud 2024-05-26 13:14:27 -07:00 committed by GitHub
parent 495e975952
commit 17a6647538
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,7 +61,28 @@ u16 func_8018C160(Entity* a, Entity* b) {
return ratan2(diffY, diffX);
}
INCLUDE_ASM("st/wrp_psp/psp/wrp_psp/st_common", func_8018C1E0);
u16 func_8018C1E0(u16 arg0, u16 arg1, u16 arg2) {
u16 temp_a2 = (s16)(arg2 - arg1);
u16 var_v0;
if (temp_a2 & 0x800) {
var_v0 = (0x800 - temp_a2) & 0x7FF;
} else {
var_v0 = temp_a2;
}
if (var_v0 > arg0) {
if (temp_a2 & 0x800) {
var_v0 = arg1 - arg0;
} else {
var_v0 = arg1 + arg0;
}
return var_v0;
}
return arg2;
}
void SetStep(u8 step) {
g_CurrentEntity->step = step;