sotn-decomp/config/splat.us.stnp3.yaml
Luciano Ciccariello de46f99e2e
New asset manager (#1343)
This aims to deprecate all the Splat tools in `tools/splat_ext` in
favour of a more centralised asset manager. This brings the following
advantages:

* Much faster extraction
* Faster build
* Automatically define `static` symbols or unique names whenever
`static` is not possible
* Allow to embed assets into the output binary
* Drastically simplify `Makefile` by removing all the asset build rules
* Avoid situations where it is not possible to extract and build assets
that is not 4-byte aligned

This is achieved by having the splat YAML targeting a normal C file as
data and have an external tool to take care of the following:

1. Extract asset files straight from the overlay binary file into human
readable file in `assets/st/STAGE_NAME`
2. Build assets as header files that go into `src/st/STAGE_NAME` to just
include them from any C file

This requires each stage header to have the following new format: please
see `src/st/nz0/header.c`

Built assets in `src/st` are ignored by Git.

As for now, for simplicity sake, the steps `make extract_assets` and
`make build_assets` are just executed within `make extract` exclusively
for the US version.

I plan to auto-generate files such as `src/st/nz0/tile_data.c`.

For a first iteration I am aiming to handle the following:

* [X] Extract rooms: `assets/st/*/rooms.json`
* [X] Extract room layers: `assets/st/*/entity_layouts.json`
* [X] Extract tilemap data: `assets/st/*/tilemap_*.bin`
* [X] Extract tilemap definitions: `assets/st/*/tiledef_*.json`
* [X] Extract sprites: `assets/st/*/sprites.json`
* [x] Extract entity layouts
* [X] Build rooms: `src/st/*/rooms.h`
* [X] Build room layers: `src/st/*/layers.h`
* [X] Build tilemap data: `src/st/*/tilemap_*.h`
* [X] Build tilemap definitions: `src/st/*/tiledef_*.h`
* [x] Build sprites (aka `g_SpriteBanks`)
* [x] Build entity layouts
* [x] Allow the tool to suggest how to adjust the Splat config for each
overlay

I want the tool to cover the following stages:
* [x] CEN
* [x] DRE
* ~MAD~ I do not think this can be done, it is way too different from
the other overlays
* [x] NO3
* [x] NP3
* [X] NZ0
* [x] ST0
* [X] WRP
* [x] RWRP
* ~WRP (PSP)~ Maybe in a follow-up PR

For a later iteration I plan on extracting and build:

* Entity GFX thingie
* The CLUT thingie in the header
* Uncompressed GFX data
* Cutscene data
* Blueprints
* The `src/config_us.h` thingie

---------

Co-authored-by: Josh Lory <josh.lory@outlook.com>
2024-07-02 21:38:36 +01:00

129 lines
4.0 KiB
YAML

options:
platform: psx
basename: stnp3
base_path: ..
build_path: build/us
target_path: disks/us/ST/NP3/NP3.BIN
asm_path: asm/us/st/np3
asset_path: assets/st/np3
src_path: src/st/np3
ld_script_path: build/us/stnp3.ld
compiler: GCC
symbol_addrs_path:
- config/symbols.us.txt
- config/symbols.us.stnp3.txt
undefined_funcs_auto_path: config/undefined_funcs_auto.us.stnp3.txt
undefined_syms_auto_path: config/undefined_syms_auto.us.stnp3.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
section_order:
- ".data"
- ".rodata"
- ".text"
- ".bss"
- ".sbss"
segments:
- name: stnp3
type: code
start: 0x00000000
vram: 0x80180000
align: 4
subalign: 4
subsegments:
- [0x0, .data, header]
- [0x1D0, .data, header] # layers
- [0x558, data]
- [0x728, .data, e_laydef] # layout entries header
- [0x8D0, data]
- [0xE50, data]
- [0x10C0, data]
- [0x1300, data]
- [0x1520, data]
- [0x1678, .data, collision]
- [0x1A38, .data, e_red_door]
- [0x1A50, data]
- [0x1F40, .data, entity_relic_orb]
- [0x1FA4, data]
- [0x22B0, data]
- [0x23D0, data]
- [0x2400, data]
- [0x2440, data]
- [0x2720, data]
- [0x2740, data]
- [0x2A20, data]
- [0x2B00, data]
- [0x3010, data]
- [0x33A0, data]
- [0x3530, data]
- [0x3570, data]
- [0x3580, data]
- [0x3720, data]
- [0x3760, data]
- [0x3A7C, .data, rooms]
- [0x3B68, .data, e_layout] # layout entries data
- [0x49E0, data]
- [0x168F4, .data, tile_data] # tile data
- [0x21CF4, .data, tile_data] # tile definitions
- [0x2A124, .data, sprites]
- [0x31EA0, data]
- [0x31EA8, .rodata, 3246C] # EntityStairwayPiece
- [0x31EBC, .rodata, 365FC] # func_801B65FC
- [0x31ED0, .rodata, slogra] # EntitySlogra .rodata, 36990
- [0x31EDC, .rodata, gaibon] # EntityGaibon .rodata, 36990
- [0x31F00, .rodata, e_red_door] # EntityRedDoor
- [0x31F18, rodata]
- [0x31F68, .rodata, 3DEF4]
- [0x31FA0, .rodata, entity_relic_orb]
- [0x31FD8, .rodata, entity_message_box]
- [0x31FEC, .rodata, 402F4] # EntityStageNamePopup
- [0x32020, .rodata, 44DCC] # EntityMerman2
- [0x32044, .rodata, 48238] # EntityMerman
- [0x3206C, .rodata, 490E8] # EntityBoneScimitar data
- [0x3208C, .rodata, 4997C]
- [0x320A0, .rodata, 49BC8]
- [0x320B4, .rodata, 49F98] # EntityBloodyZombie data
- [0x320DC, .rodata, 4B018] # Shared charal string for owl and owl knight
- [0x320EC, .rodata, 4B018] # EntityOwl
- [0x3214C, .rodata, 4B018] # EntityOwlKnight
- [0x321EC, .rodata, 4D540] # Strings
- [0x3224C, .rodata, 4E69C] # EntityHammer
- [0x322CC, .rodata, 4E69C] # EntityGurkhaBodyParts
- [0x322F8, .rodata, 4F5B8] # EntityGurkha
- [0x32380, .rodata, 4F5B8] # EntityGurkhaSword
- [0x323E4, .rodata, blade] # EntityBlade
- [0x32464, .rodata, prim_helpers]
- [0x3246C, c]
- [0x365FC, c]
- [0x36990, c, slogra]
- [0x378BC, c, gaibon]
- [0x390BC, c, random]
- [0x390EC, c, update]
- [0x393E8, c, update_stage_entities]
- [0x394F0, c, collision]
- [0x3ACAC, c, create_entity]
- [0x3B824, c, e_red_door]
- [0x3C4D4, c]
- [0x3DEF4, c]
- [0x3F1A0, c, entity_relic_orb]
- [0x3FC70, c, entity_heart_drop]
- [0x3FD98, c, entity_message_box]
- [0x402F4, c]
- [0x44144, c, player_water_effect]
- [0x44DCC, c] # Merman Entities
- [0x48238, c] # Merman Entities (2)
- [0x490E8, c] # EntityBoneScimitar
- [0x4997C, c]
- [0x49BC8, c]
- [0x49F98, c] # EntityBloodyZombie
- [0x4B018, c]
- [0x4D540, c]
- [0x4E69C, c]
- [0x4F5B8, c]
- [0x50A00, c, blade]
- [0x51F38, c, prim_helpers]
- [0x52768, sbss]
- [0x53434]