sotn-decomp/tools/sotn-assets
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
..
psx Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
asset_config.go Extract cutscene scripts, portraits and normalize code (#1686) 2024-09-28 19:56:35 -07:00
build.go Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
cutscene.go Extract cutscene scripts, portraits and normalize code (#1686) 2024-09-28 19:56:35 -07:00
data_range.go Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
go.mod CEN cutscene parser (#1680) 2024-09-27 23:13:29 +01:00
go.sum Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
graphics.go Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
layer.go Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
layout.go Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
main.go Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
paths.go Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
room.go Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
sprites.go Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
tile_def.go Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
tile_map.go Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00
utils.go Weapon assets and statically linked (#1470) 2024-08-09 00:57:26 +01:00