1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 06:54:33 +00:00

Create separate build directories based on version (#1591)

* Create separate build directories based on version

* Fix find_unused_asm.sh

* Remove find_unused_asm.sh from Jenkinsfile

* Revert diff.py

* Clarify that gc-eu-mq is not "supported" yet

* Revert xmlcreate.py (to be deleted)

* Remove gc-eu-mq for now

* Add version flags to diff_settings.py and sym_info.py

* --version -> --oot-version

* Fix --oot-version

* Revert adding version flags to tools

* Delete find_unused_asm.sh

* Revert changes to first_diff.py output in tutorial

* Factor out sed usages for spec
This commit is contained in:
cadmic 2024-01-05 14:27:19 -08:00 committed by GitHub
parent 1f9c28f370
commit 25ff0a27de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 2500 additions and 2534 deletions

View file

@ -772,7 +772,7 @@ Once preliminary cleanup and struct filling is done, most time spent matching fu
In order to use `diff.py` with the symbol names, we need a copy of the code to compare against. This is done by copying the `build` directory into a directory called `expected`. Copying in Windows on WSL is very slow, so run
```
$ mkdir expected
cp -r build/ expected/
cp -r build expected/
```
from the main directory of the repository. You should end up with the directory structure `expected/build/...`.
@ -914,7 +914,7 @@ It turns out that this is enough to completely fix the diff:
Everything *looks* fine, but we only know for sure when we run `make`. Thankfully doing so gives
```
zelda_ocarina_mq_dbg.z64: OK
oot-gc-eu-mq-dbg.z64: OK
```
which is either a sense of triumph or relief depending on how long you've spent on a function.

View file

@ -118,18 +118,18 @@ Now, open the file called `spec` in the base directory, find the section corresp
```
beginseg
name "ovl_En_Tg"
include "build/src/overlays/actors/ovl_En_Tg/z_en_tg.o"
include "build/data/overlays/actors/z_en_tg.data.o"
include "build/data/overlays/actors/z_en_tg.reloc.o"
include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tg/z_en_tg.o"
include "$(BUILD_DIR)/data/overlays/actors/z_en_tg.data.o"
include "$(BUILD_DIR)/data/overlays/actors/z_en_tg.reloc.o"
endseg
```
and comment out the .data line,
```
beginseg
name "ovl_En_Tg"
include "build/src/overlays/actors/ovl_En_Tg/z_en_tg.o"
//include "build/data/overlays/actors/z_en_tg.data.o"
include "build/data/overlays/actors/z_en_tg.reloc.o"
include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tg/z_en_tg.o"
//include "$(BUILD_DIR)/data/overlays/actors/z_en_tg.data.o"
include "$(BUILD_DIR)/data/overlays/actors/z_en_tg.reloc.o"
endseg
```
to tell the compiler not to look for the data in that file any more. Now run `make -j`, and if you did both steps correctly, you should get `OK`.
@ -262,18 +262,18 @@ First, we tell the compiler to ignore the original data file. To do this, open t
```
beginseg
name "ovl_En_Jj"
include "build/src/overlays/actors/ovl_En_Jj/z_en_jj.o"
include "build/data/overlays/actors/z_en_jj.data.o"
include "build/data/overlays/actors/z_en_jj.reloc.o"
include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o"
include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.data.o"
include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.reloc.o"
endseg
```
We will eventually remove both of the bottom two lines and replace them with our own reloc file, but for now, just comment out the data line:
```
beginseg
name "ovl_En_Jj"
include "build/src/overlays/actors/ovl_En_Jj/z_en_jj.o"
//include "build/data/overlays/actors/z_en_jj.data.o"
include "build/data/overlays/actors/z_en_jj.reloc.o"
include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o"
//include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.data.o"
include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.reloc.o"
endseg
```
@ -557,7 +557,7 @@ Ignore the first line: `gDmaDataTable` is always different if the ROM is shifted
To fix this, we use a binary diff program. A suitable one is `vbindiff`: run it on the baserom and the zelda_whatever one the compiler generates:
```
vbindiff baserom.z64 zelda_ocarina_mq_dbg.z64
vbindiff baserom.z64 oot-gc-eu-mq-dbg.z64
```
In this, press `g` to open up goto position, and paste in the address `0xE3ED10` from the first important line of the `first_diff` output. This gives us the following:
@ -623,7 +623,7 @@ static ColliderCylinderInit sCylinderInit =
Running `make -j` again,
```
zelda_ocarina_mq_dbg.z64: OK
oot-gc-eu-mq-dbg.z64: OK
```
Hooray, we won!

View file

@ -26,9 +26,9 @@ Specifically, to use the automatically generated reloc, rather than the original
```
beginseg
name "ovl_En_Jj"
include "build/src/overlays/actors/ovl_En_Jj/z_en_jj.o"
//include "build/data/overlays/actors/z_en_jj.data.o"
include "build/data/overlays/actors/z_en_jj.reloc.o"
include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o"
//include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.data.o"
include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.reloc.o"
endseg
```
@ -37,8 +37,8 @@ and change to use our reloc:
```
beginseg
name "ovl_En_Jj"
include "build/src/overlays/actors/ovl_En_Jj/z_en_jj.o"
include "build/src/overlays/actors/ovl_En_Jj/ovl_En_Jj_reloc.o"
include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o"
include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/ovl_En_Jj_reloc.o"
endseg
```

View file

@ -113,13 +113,13 @@ If in doubt, look at completed objects in the repo, and if still in doubt, ask.
Just as when you decomp an actor you have to change the `spec` to tell it to use the new files, you have to do a similar thing for the object. Find the appropriate section for the object you have decompiled, and replace the line
```c
include "build/baserom/object_name.o"
include "$(BUILD_DIR)/baserom/object_name.o"
```
by
```c
include "build/assets/objects/object_name/object_name.o"
include "$(BUILD_DIR)/assets/objects/object_name/object_name.o"
number 6
```

View file

@ -83,7 +83,7 @@ to extract the contents of the object into the new folder, change the spec to us
beginseg
name "object_bg"
romalign 0x1000
include "build/baserom/object_bg.o"
include "$(BUILD_DIR)/baserom/object_bg.o"
endseg
```
@ -93,7 +93,7 @@ to
beginseg
name "object_bg"
romalign 0x1000
include "build/assets/objects/object_bg/object_bg.o"
include "$(BUILD_DIR)/assets/objects/object_bg/object_bg.o"
number 6
endseg
```