1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 14:20:11 +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

@ -51,7 +51,7 @@ void ObjSwitch_CrystalTurnOffInit(ObjSwitch* this);
void ObjSwitch_CrystalTurnOff(ObjSwitch* this, GlobalContext* globalCtx);
extern Gfx D_05005AD0[]; // floor switch, rusty
extern ColHeader D_05005FB8;
extern CollisionHeader D_05005FB8;
// rgba16 32x32 textures
extern UNK_TYPE D_050144B0[]; // red plasma/cloud
@ -134,18 +134,17 @@ void ObjSwitch_RotateY(Vec3f* dest, Vec3f* src, s16 angle) {
dest->z = src->z * c - src->x * s;
}
void ObjSwitch_InitDynapoly(ObjSwitch* this, GlobalContext* globalCtx, ColHeader* collision,
void ObjSwitch_InitDynapoly(ObjSwitch* this, GlobalContext* globalCtx, CollisionHeader* collision,
DynaPolyMoveFlag moveFlag) {
s32 pad;
ColHeader* colHeader = NULL;
CollisionHeader* colHeader = NULL;
s32 pad2;
DynaPolyInfo_SetActorMove(&this->dyna, moveFlag);
DynaPolyInfo_Alloc(collision, &colHeader);
this->dyna.dynaPolyId =
DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
DynaPolyActor_Init(&this->dyna, moveFlag);
CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.dynaPolyId == 50) {
if (this->dyna.bgId == BG_ACTOR_MAX) {
// Warning : move BG registration failure
osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_switch.c", 531,
this->dyna.actor.id, this->dyna.actor.params);
@ -240,7 +239,7 @@ void ObjSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
type = (this->dyna.actor.params & 7);
if (type == OBJSWITCH_TYPE_FLOOR || type == OBJSWITCH_TYPE_FLOOR_RUSTY) {
ObjSwitch_InitDynapoly(this, globalCtx, &D_05005FB8, 1);
ObjSwitch_InitDynapoly(this, globalCtx, &D_05005FB8, DPM_PLAYER);
}
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
@ -304,7 +303,7 @@ void ObjSwitch_Destroy(Actor* thisx, GlobalContext* globalCtx) {
switch ((this->dyna.actor.params & 7)) {
case OBJSWITCH_TYPE_FLOOR:
case OBJSWITCH_TYPE_FLOOR_RUSTY:
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
break;
}