sotn-decomp/config/splat.us.stst0.yaml
Luciano Ciccariello f86e111fc5
Extract cutscene scripts, portraits and normalize code (#1686)
More research on how cutscenes work.

I normalized all the various C files as `cutscene.c`, marked all the
isolated function as `static` and renamed the main entity as
`{STAGE}_CutsceneExec` (e.g. `CEN_CutsceneExec`). I am using the
`OVL_EXPORT` to automate the names.

TO-DO:

- [x] Rename entity as `{STAGE}_EntityCutscene` for consistency
- [x] CEN
- [x] DRE
- [x] NO3
- [x] NZ0
- [x] ST0
- [x] MAR
~~SEL~~

The offset of the portrait data seems to be hardcoded. I have no idea
how to resolve these offsets at compilation time. The entire cutscene
script thing is very sketchy and horribly designed by the original
developers. What a nightmare to integrate into our project.

This is how a cutscene script gets decompiled:

```
LOAD_PORTRAIT(0x80188D8C, 0),
SET_PORTRAIT(1, 0),
SCRIPT_UNKNOWN_11(),
PLAY_SOUND(0x37B),
WAIT_FOR_SOUND(),
SET_SPEED(4),
'T','h','a','t',' ','v','o','i','c','e','!',' ',
SET_WAIT(16),
SET_SPEED(3),
'A','l','u','c','a','r','d',',',
LINE_BREAK(),
SET_WAIT(16),
SET_FLAG(2),
'i','t','\'','s',' ','y','o','u','!',
SET_WAIT(48),
NEXT_DIALOG(),
```
2024-09-28 19:56:35 -07:00

117 lines
3.7 KiB
YAML

options:
platform: psx
basename: stst0
base_path: ..
build_path: build/us
target_path: disks/us/ST/ST0/ST0.BIN
asm_path: asm/us/st/st0
asset_path: assets/st/st0
src_path: src/st/st0
ld_script_path: build/us/stst0.ld
compiler: GCC
symbol_addrs_path:
- config/symbols.us.txt
- config/symbols.us.stst0.txt
undefined_funcs_auto_path: config/undefined_funcs_auto.us.stst0.txt
undefined_syms_auto_path: config/undefined_syms_auto.us.stst0.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
disassemble_all: True
section_order:
- ".data"
- ".rodata"
- ".text"
- ".bss"
- ".sbss"
segments:
- name: stst0
type: code
start: 0x00000000
vram: 0x80180000
align: 4
subalign: 4
subsegments:
- [0x0, .data, header]
- [0x124, .data, header] # layers
- [0x1A4, data]
- [0x314, .data, e_laydef] # layout entries header
- [0x4BC, data]
- [0x580, data]
- [0x770, data]
- [0x828, .data, cutscene] # "Richter, Dracula"
- [0x830, data]
- [0x990, data]
- [0xAB0, data]
- [0x15EC, .data, st_update]
- [0x1618, .data, collision]
- [0x1978, .data, e_red_door]
- [0x1990, .data, st_common]
- [0x1B90, .data, e_collect]
- [0x1E3C, data]
- [0x1E5C, .data, e_misc]
- [0x1F54, data]
- [0x2060, .data, rooms]
- [0x2084, data]
- [0x26B8, .data, e_layout] # layout entries data
- [0x29D8, .data, cutscene_data]
- [0x2C4C, data]
#- [0x3D1C, cmp]
- [0x487C, data]
- [0xF130, raw, cutscene_richter]
- [0xFEB0, raw, cutscene_dracula]
- [0x10C30, data]
#- [0x17F80, cmp]
- [0x187BC, data]
#- [0x1A40C, cmp]
- [0x1A750, data]
- [0x1B2D0, .data, tile_data] # tile data
- [0x1E6D0, .data, tile_data] # tile definitions
- [0x226E0, .data, sprites]
- [0x27984, .rodata, 27D64]
- [0x279E8, .rodata, cutscene] # ST0_EntityCutscene
- [0x27A74, .rodata, 2A218] # EntityCutscene
- [0x27AB4, .rodata, 2A8DC] # EntitySecretButton
- [0x27ACC, .rodata, 2A8DC] # EntitySecretStairs
- [0x27AE0, .rodata, 2B0C8] # EntityStageTitleFadeout
- [0x27B00, .rodata, 2B0C8] # EntityStageTitleCard
- [0x27B18, .rodata, 2B0C8] # func_801ABBBC
- [0x27B40, .rodata, 2C564] # EntityDracula
- [0x27B7C, .rodata, 2DAC8] # "charal %x\n"
- [0x27B8C, .rodata, 2DAC8] # EntityDraculaFinalForm
- [0x27BDC, .rodata, 2DAC8] # "can't get effect works!\n"
- [0x27BFC, .rodata, 2DAC8] # func_801AF774
- [0x27C1C, .rodata, 30030] # PrologueScroll
- [0x27C6C, .rodata, e_red_door] # EntityRedDoor
- [0x27C84, .rodata, e_collect] # c_HeartPrizes
- [0x27C8C, .rodata, e_collect]
- [0x27CAC, .rodata, e_collect] # EntityEquipItemDrop
- [0x27CC4, .rodata, e_misc]
- [0x27CFC, rodata]
- [0x27D3C, .rodata, prim_helpers]
- [0x27D44, .rodata, 3D8F0]
- [0x27D64, c]
- [0x28984, c, cutscene]
- [0x2A218, c]
- [0x2A8DC, c]
- [0x2B0C8, c]
- [0x2C564, c] # EntityDracula
- [0x2DAC8, c]
- [0x30030, c]
- [0x3186C, c, st_update]
- [0x31CA0, c, collision]
- [0x330E0, c, create_entity]
- [0x33C58, c, e_red_door]
- [0x34908, c, st_common]
- [0x35EC8, c, e_collect]
- [0x37308, c, e_misc]
- [0x39EA8, c]
- [0x3D0C0, c, prim_helpers]
- [0x3D8F0, c]
- [0x3EB00, .bss, create_entity]
- [0x400B6, .bss, bss]
- [0x42584, .bss, e_collect]
- [0x425C4]