1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-07 14:50:15 +00:00

z_bgcheck.c, 800430A0.c, 80043480.c (#256)

* beginning of migrating changes

* got matching

* changed order a bit

* clean up bgcheck

* fix conflict

* fix conflict again

* first stab at identifying types, some oks

* Clean up most bad structs/pointer math, move relevant structs to z64bgcheck.h, get some OKs

* more OKs, z_bgcheck.bss migration, update some sys_math3d.c args

* couple more OKs

* pushing some OKs

* fix compilation issues

* code_800430A0.c OK, more files decomp'd

* 8003A3E0 big OK :)

* Decomp most of func_8003C614, decomp helper funcs

* Decomp SurfaceType, CamData, and WaterBox property related functions

* more OKs, big OK in 8003C078

* more OKs, more progress, move a function definition in z_collision_check to functions.h

* more clean-ups, more OKs, dyn_vtx is now defined as u8*

* 8003A5B8, 8003A7D8, 8003C614, 8003DD6C OK, document function args better

* data migrated, more OKs

* 80041240 OK, func_8003B3C8 and func_8003BB18 disassembled

* func_80040284, 800409A8 non_matching, add IS_ZERO macro

* All asm files have C representations, some big OKs, lots of minor tweaks

* More OKs, non-matching code cleanup

* 8003FBF4 and 80040BE4 OK, improve codegen for most functions

* format z_bgcheck.c

* fix warnings, compile errors on NON_MATCHING

* func_8003EE80 is now NON_MATCHING

* begin documenting some functions

* formatting

* more documentation, func_8003A95C OK

* fix PHYSICAL_TO_VIRTUAL changes

* fix var rename

* More documentation, functions 80040E40, 80041648 OK, change types to not be compatible with ZAP

* func_8004239C ok, more NON_MATCHING improvements, more documentation

* Implement most suggested changes

* Convert comments to slower comments

* /**

* Implement ZAP2 changes

* my anti-virus ate my format.sh results

* Rename a couple hundred functions, fix minor stuff

* rename var so that clang formats correctly

* run format.sh

* implement Petrie's matches/suggestions

* format

* matches

* and the asm

* slight error

* Add SSList

* two more matches

* stuff

* implement code changes

* clean up Petrie's matchings

Co-authored-by: Arthur <arthurtilly413@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
This commit is contained in:
mzxrules 2021-01-08 06:12:58 -05:00 committed by GitHub
parent 209f0d21b8
commit 3cef03f5ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
416 changed files with 6610 additions and 13487 deletions

View file

@ -1336,15 +1336,15 @@ void func_80AED8DC(EnRu1* this) {
void func_80AEDAE0(EnRu1* this, GlobalContext* globalCtx) {
Actor* thisx = &this->actor;
DynaPolyActor* dyna = DynaPolyInfo_GetActor(&globalCtx->colCtx, thisx->floorPolySource);
Actor* dyna = DynaPoly_GetActor(&globalCtx->colCtx, thisx->floorPolySource);
if ((dyna == NULL) || (dyna->actor.id == ACTOR_EN_BOX)) {
if (dyna == NULL || dyna->id == ACTOR_EN_BOX) {
thisx->bgCheckFlags &= ~0x19;
}
}
void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) {
DynaPolyActor* temp_dyna;
Actor* temp_dyna;
f32* velocityY;
f32* speedXZ;
f32* gravity;
@ -1356,11 +1356,11 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) {
if (this->actor.bgCheckFlags & 1) {
velocityY = &this->actor.velocity.y;
temp_dyna = DynaPolyInfo_GetActor(&globalCtx->colCtx, this->actor.floorPolySource);
temp_dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorPolySource);
if (*velocityY <= 0.0f) {
speedXZ = &this->actor.speedXZ;
if (temp_dyna != NULL) {
if (temp_dyna->actor.id != ACTOR_EN_BOX) {
if (temp_dyna->id != ACTOR_EN_BOX) {
*speedXZ = 0.0f;
}
} else {
@ -1372,7 +1372,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) {
}
gravity = &this->actor.gravity;
if (temp_dyna != NULL) {
if (temp_dyna->actor.id != ACTOR_EN_BOX) {
if (temp_dyna->id != ACTOR_EN_BOX) {
*velocityY = 0.0f;
this->actor.minVelocityY = 0.0f;
*gravity = 0.0f;
@ -1431,9 +1431,9 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEDEF4(EnRu1* this, GlobalContext* globalCtx) {
f32* speedXZ = &this->actor.speedXZ;
DynaPolyActor* dyna = DynaPolyInfo_GetActor(&globalCtx->colCtx, this->actor.floorPolySource);
Actor* dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorPolySource);
if ((dyna != NULL) && (dyna->actor.id == ACTOR_EN_BOX)) {
if (dyna != NULL && dyna->id == ACTOR_EN_BOX) {
if (*speedXZ != 0.0f) {
*speedXZ *= 1.1f;
} else {
@ -1538,14 +1538,13 @@ s32 func_80AEE264(EnRu1* this, GlobalContext* globalCtx) {
}
void func_80AEE2F8(EnRu1* this, GlobalContext* globalCtx) {
DynaPolyActor* dyna;
u32 floorPolySource;
if ((this->actor.bgCheckFlags & 1) && (this->actor.floorPolySource != 0x32)) {
Actor* dyna;
s32 floorPolySource;
if ((this->actor.bgCheckFlags & 1) && (this->actor.floorPolySource != BGCHECK_SCENE)) {
floorPolySource = this->actor.floorPolySource;
dyna = DynaPolyInfo_GetActor(&globalCtx->colCtx, floorPolySource);
if ((dyna != NULL) && (dyna->actor.id == ACTOR_BG_BDAN_SWITCH)) {
if ((((dyna->actor.params) >> 8) & 0x3F) == 0x38) {
dyna = DynaPoly_GetActor(&globalCtx->colCtx, floorPolySource);
if ((dyna != NULL) && (dyna->id == ACTOR_BG_BDAN_SWITCH)) {
if (((dyna->params >> 8) & 0x3F) == 0x38) {
gSaveContext.infTable[20] |= 1;
return;
}
@ -1560,13 +1559,13 @@ s32 func_80AEE394(EnRu1* this, GlobalContext* globalCtx) {
DynaPolyActor* dynaActor;
s32 floorPolySource;
if ((this->actor.bgCheckFlags & 1) && (this->actor.floorPolySource != 0x32)) {
if ((this->actor.bgCheckFlags & 1) && this->actor.floorPolySource != BGCHECK_SCENE) {
colCtx = &globalCtx->colCtx;
floorPolySource =
this->actor.floorPolySource; // necessary match, can't move this out of this block unfortunately
dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
if ((dynaActor != NULL) && (dynaActor->actor.id == ACTOR_BG_BDAN_OBJECTS) && (dynaActor->actor.params == 0) &&
(!Player_InCsMode(globalCtx)) && (globalCtx->msgCtx.unk_E300 == 0)) {
dynaActor = DynaPoly_GetActor(colCtx, floorPolySource);
if (dynaActor != NULL && dynaActor->actor.id == ACTOR_BG_BDAN_OBJECTS && dynaActor->actor.params == 0 &&
!Player_InCsMode(globalCtx) && globalCtx->msgCtx.unk_E300 == 0) {
func_80AEE02C(this);
globalCtx->csCtx.segment = &D_80AF10A4;
gSaveContext.cutsceneTrigger = 1;