Use decompiled overlays when building ROM (#121)

* Restore padding in ObjVisiblock struct

* Copy overlays out of compiled `code.elf` to put into the ROM

This is just a "tempory fix"

It seems like the built code/assets in `code.elf` should not be copied
into `build/baserom/...` (over the original ROM's files) but instead
into a `build/decomp/...` tree or similar.

`dmadata_table.txt` would also need to be updated to read from the
correct location.

* Use dmadata_table.txt to generate build rules

`makerom_files.txt` & `makerom_uncompressed_files.txt` contained a lot
of the same data in `dmadata_table.txt`, so I added a small python
script to generate this information into `build/`

Segments are no longer dumped out of `code.elf` into `build/baserom/``,
instead they are put in `build/binary/`.

`linker_scripts/dmadata_script.txt` was checked in, but generated by
`dmadata.py`. I deleted it / moved it to `build/dmadata_script.txt.pre`.

I also introduced some sentinel files (`dep`). I ended up needing these
to make incremental builds work smoothly? (Without them, there were a
lot of steps that were getting re-triggered on every build.) If this
style isn't welcome, I can try to fiddle with the Makefile more to try
to avoid having them?

* Restore padding in BgLbfshot struct

* Touch sentinel file before command; rm on failure

* Restore padding in ObjKepnKoya struct

* Ensure asm/ directories exist before disasm steps

* Clean up Makefile rules

* Set default goal; silent objcopy; fix code_script path

* Fix ovl_En_Ginko_Man, ovl_Obj_Lightswitch merge

ovl_En_Encount2 still needs work to bring back to matching

* Fix ovl_En_Encount2 merge
This commit is contained in:
Zach Banks
2021-05-10 18:24:59 -04:00
committed by GitHub
parent 024ba29706
commit 23d63852de
14 changed files with 1138 additions and 8726 deletions
@@ -7,6 +7,7 @@ struct BgLbfshot;
typedef struct BgLbfshot {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ UNK_TYPE1 pad15C[0x4];
} BgLbfshot; // size = 0x160
extern const ActorInit Bg_Lbfshot_InitVars;
@@ -67,7 +67,7 @@ void EnEncount2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->switchFlag = -1;
}
if ((this->switchFlag >= 0) && (Actor_GetSwitchFlag(globalCtx, this->switchFlag))) {
if ((this->switchFlag >= 0) && (Flags_GetSwitch(globalCtx, this->switchFlag))) {
Actor_MarkForDeath(&this->dynaActor.actor);
return;
}
@@ -8,6 +8,7 @@ typedef void (*EnEncount2ActionFunc)(struct EnEncount2*, GlobalContext*);
typedef struct EnEncount2Particle{
/* 0x00 */ u8 enabled;
/* 0x04 */ Vec3f pos;
/* 0x10 */ UNK_TYPE4 unk10;
/* 0x14 */ s16 alpha;
/* 0x16 */ s16 alphaFadeDelay; // frame count before alpha fade starts
/* 0x18 */ Vec3f vel;
@@ -665,13 +665,13 @@ void EnGinkoMan_SwitchAnimation(EnGinkoMan *this, GlobalContext *globalCtx) {
if (this->animTimer == 0) {
if (this->skelAnime.animCurrentSeg != object_ginko_amazed_anim) {
this->animTimer = 0x28;
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
func_800BDC5C(&this->skelAnime, animations, GINKO_ADVERTISING);
}
}
} else if ((this->animTimer == 0) && (this->skelAnime.animCurrentSeg != object_ginko_advertising_anim)) {
this->animTimer = 0x28;
func_800BDC5C(&this->skelAnime, animations, GINKO_REACHING);
func_800BDC5C(&this->skelAnime, animations, GINKO_AMAZED);
}
DECR(this->animTimer);
@@ -7,6 +7,7 @@ struct ObjKepnKoya;
typedef struct ObjKepnKoya {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ UNK_TYPE1 unk15C[0x4];
} ObjKepnKoya; // size = 0x160
extern const ActorInit Obj_Kepn_Koya_InitVars;
@@ -154,7 +154,7 @@ void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) {
u32 switchFlagResult;
s32 isTriggered;
switchFlagResult = Actor_GetSwitchFlag(globalCtx, GET_LIGHTSWITCH_SWITCHFLAG(this));
switchFlagResult = Flags_GetSwitch(globalCtx, GET_LIGHTSWITCH_SWITCHFLAG(this));
isTriggered = 0;
Actor_ProcessInitChain(&this->actor, &sInitChain);
Actor_SetHeight(&this->actor, 0.0f);
@@ -268,7 +268,7 @@ void ObjLightSwitch_Enabled(ObjLightswitch* this, GlobalContext* globalCtx) {
if (actorType == LIGHTSWITCH_TYPE_REGULAR) {
// switch can be disabled outside of this actor by flag
if (Actor_GetSwitchFlag(globalCtx, GET_LIGHTSWITCH_SWITCHFLAG(this)) == 0) {
if (Flags_GetSwitch(globalCtx, GET_LIGHTSWITCH_SWITCHFLAG(this)) == 0) {
ObjLightSwitch_SetupDisabled(this);
}
} else if (actorType == LIGHTSWITCH_TYPE_FLIP) {
@@ -7,6 +7,7 @@ struct ObjVisiblock;
typedef struct ObjVisiblock {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ UNK_TYPE1 unk15C[0x4];
} ObjVisiblock; // size = 0x160
extern const ActorInit Obj_Visiblock_InitVars;