mirror of
https://github.com/Xeeynamo/sotn-decomp.git
synced 2024-11-27 06:50:35 +00:00
7a5baed841
Given the fact that sharing compiled C objects is not exactly possible
(code heavily copy&pasted maybe? this initiative is now abandoned 👉
53a566f075
)
I decided to keep pressing forward with shared headers. Thanks a lot to
@hohle for making our life much easier by cross-referencing symbols.
The file split on WRP seems to be the closest file split we might have
compared to the original source code (still speculating here). I think
it would be a good idea to start splitting other overlays too with the
same approach.
My idea is to have a file split like the following:
```
st/
cen/
e_particles.c
e_misc.c
st_common.c
nz0/
e_particles.c
e_misc.c
st_common.c
wrp/
e_particles.c
e_misc.c
st_common.c
e_particles.h
e_misc.h
st_common.h
```
each of those C files will just be a one-line `#include
"../the_shared_code.h"` as usual. Right now we create individual headers
for single functions, sometimes for more than one function when we think
grouping makes sense. But I think we can start merging some of those
headers and consolidate the code. This can be done gradually. For
example `src/st/e_particles.h` is still importing function headers under
the hood. That is okay for now, but later on I wish to import those
headers functions into their respective parent headers.
Another important aspect to consider that will validate a correct file
split is to start importing the data inside these new C files. Right now
we have floating data such as `src/st/wrp_psp/wrp_data_EA00.c` or
monstrosities such as `src/st/wrp/6FD0.c`. An example of a (possibly)
correct migrated data is what this PR does with WRP PSP and NZ0 PSX,
with data pointing in `src/st/*/e_particles.c`.
91 lines
3.0 KiB
YAML
91 lines
3.0 KiB
YAML
options:
|
|
platform: psx
|
|
basename: stmad
|
|
base_path: ..
|
|
build_path: build/us
|
|
target_path: disks/us/ST/MAD/MAD.BIN
|
|
asm_path: asm/us/st/mad
|
|
asset_path: assets/st/mad
|
|
src_path: src/st/mad
|
|
ld_script_path: build/us/stmad.ld
|
|
compiler: GCC
|
|
symbol_addrs_path:
|
|
# NOTE: shifted overlay!
|
|
- config/symbols.beta.txt
|
|
- config/symbols.stmad.txt
|
|
undefined_funcs_auto_path: config/undefined_funcs_auto.stmad.txt
|
|
undefined_syms_auto_path: config/undefined_syms_auto.stmad.txt
|
|
find_file_boundaries: yes
|
|
use_legacy_include_asm: no
|
|
migrate_rodata_to_functions: no
|
|
asm_jtbl_label_macro: jlabel
|
|
extensions_path: tools/splat_ext
|
|
string_encoding: SHIFT-JIS
|
|
section_order:
|
|
- ".data"
|
|
- ".rodata"
|
|
- ".text"
|
|
- ".bss"
|
|
segments:
|
|
- name: stmad
|
|
type: code
|
|
start: 0x00000000
|
|
vram: 0x80180000
|
|
subalign: 2
|
|
subsegments:
|
|
- [0x0, data]
|
|
- [0x6DC, .data, collision]
|
|
- [0x9D4, .data, e_red_door]
|
|
- [0x9EC, data]
|
|
- [0xE40, data]
|
|
- [0xEF8, .data, entity_relic_orb]
|
|
- [0xF5C, data]
|
|
- [0x1130, roomdef, g_Rooms]
|
|
- [0x11D4, data] # assets/st/mad/0.objlayout
|
|
# - [0x11E8, data] # assets/st/mad/1.objlayout
|
|
# - [0x1206, data] # assets/st/mad/2.objlayout
|
|
# - [0x12B0, data] # assets/st/mad/3.objlayout
|
|
# - [0x135A, data] # assets/st/mad/4.objlayout
|
|
# - [0x1404, data] # assets/st/mad/5.objlayout
|
|
# - [0x14AE, data] # assets/st/mad/6.objlayout
|
|
# - [0x1558, data] # assets/st/mad/7.objlayout
|
|
# - [0x1602, data] # assets/st/mad/8.objlayout
|
|
# - [0x16AC, data] # assets/st/mad/9.objlayout
|
|
# - [0x1756, data] # assets/st/mad/10.objlayout
|
|
# - [0x1774, data] # assets/st/mad/11.objlayout
|
|
# - [0x1788, data] # assets/st/mad/12.objlayout
|
|
# - [0x17A6, data] # assets/st/mad/13.objlayout
|
|
# - [0x1850, data] # assets/st/mad/14.objlayout
|
|
# - [0x18FA, data] # assets/st/mad/15.objlayout
|
|
# - [0x19A4, data] # assets/st/mad/16.objlayout
|
|
# - [0x1A4E, data] # assets/st/mad/17.objlayout
|
|
# - [0x1AF8, data] # assets/st/mad/18.objlayout
|
|
# - [0x1BA2, data] # assets/st/mad/19.objlayout
|
|
# - [0x1C4C, data] # assets/st/mad/20.objlayout
|
|
# - [0x1CF6, data] # assets/st/mad/21.objlayout
|
|
- [0x1404, data]
|
|
- [0x1774, data]
|
|
- [0x19A4, data]
|
|
- [0x1D14, data]
|
|
- [0xD794, rodata]
|
|
- [0xD7CC, .rodata, e_red_door] # EntityRedDoor
|
|
- [0xD7E4, rodata]
|
|
- [0xD83C, .rodata, 139E0]
|
|
- [0xD85C, .rodata, 139E0] # EntityEquipItemDrop
|
|
- [0xD874, .rodata, entity_relic_orb]
|
|
- [0xD8AC, rodata]
|
|
- [0xD8C8, c]
|
|
- [0xE964, c, random]
|
|
- [0xE994, c, update]
|
|
- [0xEC90, c, CollectGold]
|
|
- [0xEDB8, c, collision]
|
|
- [0x10544, c, create_entity]
|
|
- [0x110A8, c, e_red_door]
|
|
- [0x11D3C, c]
|
|
- [0x139E0, c]
|
|
- [0x149C0, c, entity_relic_orb]
|
|
- [0x15520, c]
|
|
- [0x18FA0, c, prim_helpers]
|
|
- [0x197D8, sbss]
|
|
- [0x19E94]
|