Code_800E8EA0 Docs (#832)

* Start

* Add notes from OOT

* D_801D0D50 -> gDbgCamEnabled

* Rotation Functions

* Text function

* RotateBack -> RotateForward

* Flags functions

* Document rotation func returns

* Remove comment from play

* Rename play function, add notes about Flags, add notes about focus

* Update notes a little

* Update src/code/code_800E8EA0.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Fix apostrophes

* Bring over OoT changes

* TurnTo -> Track in SubS systesm

* format and remove OoT specific comment

* Remove old comments

* namefixer

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
Derek Hensley
2022-06-19 17:16:30 -07:00
committed by GitHub
parent 6d371502e1
commit 37d3934e2c
57 changed files with 323 additions and 279 deletions
+2 -2
View File
@@ -216,7 +216,7 @@ void EnRecepgirl_Update(Actor *thisx, GlobalContext *globalCtx) {
Vec3s sp30;
this->actionFunc(this, globalCtx);
func_800E9250(globalCtx, &this->actor, &this->unk_2AE, &sp30, this->actor.focus.pos);
Actor_TrackPlayer(globalCtx, &this->actor, &this->unk_2AE, &sp30, this->actor.focus.pos);
func_80C100DC(this);
}
@@ -287,7 +287,7 @@ That's probably as much as we can do on functions for now. Next let's think abou
- data/bss
- intrafunction/stack variables
and this is roughly the order of preference for naming them (although not necessarily the logical order to determine what they do). This actor is quite limited in the last category: only `sp30` is unnamed at the moment. Even though `func_800E9250` is decomped, the purpose of the argument in which `sp30` is placed is not clear (and, indeed, is not named), so it's probably best to leave it unnamed for now. (With greater experience, you might analyse `func_800E9250` to work out what this argument is for, but let's not worry about that for now.)
and this is roughly the order of preference for naming them (although not necessarily the logical order to determine what they do). This actor is quite limited in the last category: only `sp30` is unnamed at the moment. Even though `Actor_TrackPlayer` is decomped, the purpose of the argument in which `sp30` is placed is not clear (and, indeed, is not named), so it's probably best to leave it unnamed for now. (With greater experience, you might analyse `Actor_TrackPlayer` to work out what this argument is for, but let's not worry about that for now.)
As for the struct, there are two unnamed variables at the moment:
```C
+6 -6
View File
@@ -422,7 +422,7 @@ void EnRecepgirl_Update(Actor *thisx, GlobalContext *globalCtx) {
? sp30;
this->actionFunc(this, globalCtx);
func_800E9250(globalCtx, (Actor *) this, this + 0x2AE, (Vec3s *) &sp30, (bitwise Vec3f) this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z);
Actor_TrackPlayer(globalCtx, (Actor *) this, this + 0x2AE, (Vec3s *) &sp30, (bitwise Vec3f) this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z);
func_80C100DC(this);
}
```
@@ -440,13 +440,13 @@ void EnRecepgirl_Update(Actor *thisx, GlobalContext *globalCtx) {
? sp30;
this->actionFunc(this, globalCtx);
func_800E9250(globalCtx, &this->actor, this + 0x2AE, (Vec3s *) &sp30, (bitwise Vec3f) this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z);
Actor_TrackPlayer(globalCtx, &this->actor, this + 0x2AE, (Vec3s *) &sp30, (bitwise Vec3f) this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z);
func_80C100DC(this);
}
```
Now, our problem is `func_800E9250`. The arguments all look terrible! Indeed, if we look at the actual function in `src/code/code_800E8EA0.c` (found by searching), we find that it should be
Now, our problem is `Actor_TrackPlayer`. The arguments all look terrible! Indeed, if we look at the actual function in `src/code/code_800E8EA0.c` (found by searching), we find that it should be
```C
s32 func_800E9250(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s* param_4, Vec3f param_5)
s32 Actor_TrackPlayer(GlobalContext* globalCtx, Actor* actor, Vec3s* headRot, Vec3s* torsoRot, Vec3f focusPos)
```
So mips2c has made a bit of a mess here:
- the third argument should be a `Vec3s`. Hence `this + 0x2AE` is a `Vec3s*`, and so `this->unk_2AE` is a `Vec3s`
@@ -460,7 +460,7 @@ void EnRecepgirl_Update(EnRecepgirl *this, GlobalContext *globalCtx) {
Vec3s sp30;
this->actionFunc(this, globalCtx);
func_800E9250(globalCtx, &this->actor, &this->unk_2AE, &sp30, this->actor.focus.pos);
Actor_TrackPlayer(globalCtx, &this->actor, &this->unk_2AE, &sp30, this->actor.focus.pos);
func_80C100DC(this);
}
```
@@ -490,7 +490,7 @@ void EnRecepgirl_Update(Actor *thisx, GlobalContext *globalCtx) {
Vec3s sp30;
this->actionFunc(this, globalCtx);
func_800E9250(globalCtx, &this->actor, &this->unk_2AE, &sp30, this->actor.focus.pos);
Actor_TrackPlayer(globalCtx, &this->actor, &this->unk_2AE, &sp30, this->actor.focus.pos);
func_80C100DC(this);
}
```