sotn-decomp/config/splat.us.stwrp.yaml

95 lines
3.1 KiB
YAML
Raw Normal View History

2022-02-09 12:49:33 +00:00
options:
platform: psx
basename: stwrp
2022-10-16 08:55:11 +00:00
base_path: ..
2023-02-21 20:06:27 +00:00
build_path: build/us
2023-02-21 23:25:24 +00:00
target_path: disks/us/ST/WRP/WRP.BIN
asm_path: asm/us/st/wrp
2022-02-09 12:49:33 +00:00
asset_path: assets/st/wrp
src_path: src/st/wrp
Enhance make extract on PSX (#662) Previously if either the YAML or the symbol list were changed, we were forced to either manually delete the `asm` folder of the specific overlay or to invoke `make clean`, where the latter forced us to re-extract all the overlays via `make -j extract`. That changes with this PR. How `make` works is `target: dep1 dep2` where if one of the dependencies has the last modified date greater than the target, the rule is triggered again. Previously we were extracting overlays doing `make extract_stcen`. But since every overlay extraction generates a linker script I now changed the rules to do `make build/us/stcen.ld` to extract the same overlay. As I explained above, if either the YAML or one of the related symbols changes, the linker modified date will be older and the extraction for that overlay to be trigger again. The above allowed me to stop polluting the repo root with the linker scripts as they are now moved into `build/us` or `build/hd` depending of what you're trying to build. If you do `make extract` twice in a row you will be welcomed with a `make: Nothing to be done for 'extract'.`. There are still some instances where you **might** need `make clean` beforehand, especially when modifying the `segment` section in the YAML or renaming the symbols. A `rm -rf asm/$(VERSION)/$*` can help but I want to see if the current solution will be enough. ### Please try removing `make clean` from your workflow, once this is merged, to quickly detect possible problems with this new approach. I am also planning to make more substantial changes on our build-chain like this PR or #660 in the future. I am aiming to small incremental changes over time in case I break someone's flow or detect design flaws. I am also considering the breaking changes introduced in make 4.4, which will most likely be included in Ubuntu 24.04 LTS. I set March 2024 as a deadline to finish all the new build-chain work. --------- Co-authored-by: sozud <122322823+sozud@users.noreply.github.com>
2023-10-05 08:26:29 +00:00
ld_script_path: build/us/stwrp.ld
2022-02-09 12:49:33 +00:00
compiler: GCC
symbol_addrs_path:
- config/symbols.us.txt
- config/symbols.us.stwrp.txt
undefined_funcs_auto_path: config/undefined_funcs_auto.us.stwrp.txt
undefined_syms_auto_path: config/undefined_syms_auto.us.stwrp.txt
2022-02-09 12:49:33 +00:00
find_file_boundaries: yes
use_legacy_include_asm: no
2022-10-16 08:55:11 +00:00
migrate_rodata_to_functions: no
asm_jtbl_label_macro: jlabel
extensions_path: tools/splat_ext
disassemble_all: True
2022-12-25 09:46:07 +00:00
section_order:
2023-01-08 23:30:47 +00:00
- ".data"
2022-12-25 09:46:07 +00:00
- ".rodata"
- ".text"
2023-01-08 23:30:47 +00:00
- ".bss"
- ".sbss"
sha1: 2ae313f4e394422e4c5f37a2d8e976e92f9e3cda
2022-02-09 12:49:33 +00:00
segments:
- name: stwrp
type: code
start: 0x00000000
vram: 0x80180000
align: 4
2022-02-09 12:49:33 +00:00
subalign: 4
subsegments:
2023-03-31 07:42:03 +00:00
- [0x0, .data, header]
- [0xA0, .data, header] # palette definitions
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 20:38:36 +00:00
- [0xB8, .data, header] # layers
- [0x1B8, .data, header] # graphics banks
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 20:38:36 +00:00
- [0x23C, .data, e_laydef] # layout entries header
- [0x3E4, .data, e_init]
- [0x528, .data, st_debug]
- [0x5A8, .data, e_breakable]
- [0x608, .data, d_prize_drops]
- [0x648, .data, warp]
- [0x690, .data, st_update]
Share more code and data between stage overlays (#1281) Given the fact that sharing compiled C objects is not exactly possible (code heavily copy&pasted maybe? this initiative is now abandoned 👉 https://github.com/Xeeynamo/sotn-decomp/commit/53a566f075a395e064f42db28737d5ef351f0ea1) 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`.
2024-06-08 19:34:58 +00:00
- [0x6BC, .data, collision]
- [0xA7C, .data, e_red_door]
- [0xA94, .data, st_common]
- [0xC94, .data, e_collect]
- [0xF84, .data, e_misc]
- [0xFE8, .data, e_particles]
- [0x1120, .data, e_room_fg]
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 20:38:36 +00:00
- [0x11AC, .data, rooms]
- [0x1228, .data, e_layout] # layout entries data
- [0x1420, cmpgfx, stage_title_jp, 128, 128, 4]
- [0x1764, cmpgfx, stage_placeholder, 128, 128, 4]
- [0x1D08, pal, D_80181D08]
- [0x1D28, pal, D_80181D28]
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 20:38:36 +00:00
- [0x1D68, .data, tile_data] # tile data
- [0x2968, .data, tile_data] # tile definitions
- [0x6D88, .data, sprites]
- [0x6E30, .rodata, warp] # warp strings
- [0x6E70, .rodata, warp] # EntityWarpRoom
- [0x6E90, .rodata, warp] # EntityWarpSmallRocks
- [0x6EA8, .rodata, e_red_door] # EntityRedDoor
Share more code and data between stage overlays (#1281) Given the fact that sharing compiled C objects is not exactly possible (code heavily copy&pasted maybe? this initiative is now abandoned 👉 https://github.com/Xeeynamo/sotn-decomp/commit/53a566f075a395e064f42db28737d5ef351f0ea1) 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`.
2024-06-08 19:34:58 +00:00
- [0x6EC0, .rodata, e_collect] # CollectGold strings
- [0x6F10, .rodata, e_collect] # EntityPrizeDrop
- [0x6F30, .rodata, e_collect] # EntityEquipItemDrop
- [0x6F48, .rodata, e_misc]
- [0x6F94, .rodata, e_stage_name] # EntityStageNamePopup
- [0x6FC8, .rodata, prim_helpers]
- [0x6FD0, c, st_debug]
- [0x726C, c, e_breakable]
- [0x73A0, c, warp]
- [0x81E8, c, st_update]
- [0x861C, c, collision]
- [0x9DD8, c, create_entity]
- [0xA950, c, e_red_door]
- [0xB600, c, st_common]
- [0xCAB0, c, e_collect]
- [0xE01C, c, blit_char]
- [0xE2CC, c, e_misc]
- [0x117BC, c, e_stage_name]
- [0x12610, c, e_particles]
- [0x12E54, c, e_room_fg]
- [0x12F40, c, popup]
- [0x13270, c, prim_helpers]
- [0x13AB0, .bss, create_entity]
- [0x13AC0, .bss, bss]
- [0x14728, .bss, e_collect]
2022-02-09 12:49:33 +00:00
- [0x14768]