2021-11-25 14:58:22 +00:00
|
|
|
|
/// TH05 in-game dialog script format
|
|
|
|
|
/// ---------------------------------
|
|
|
|
|
|
2022-03-13 18:29:08 +00:00
|
|
|
|
struct tx2_header_t {
|
|
|
|
|
// The dialog script for player character N is stored between
|
|
|
|
|
// `offset_for[N]` and `offset_for[N + 1]`.
|
|
|
|
|
uint16_t offset_for[PLAYCHAR_COUNT + 1];
|
|
|
|
|
};
|
|
|
|
|
|
2021-11-25 14:58:22 +00:00
|
|
|
|
const uint8_t FACE_NONE = 0xFF;
|
2022-03-13 16:00:28 +00:00
|
|
|
|
|
2022-03-13 19:47:32 +00:00
|
|
|
|
// Script buffer pointer. The segment part also doubles as the base pointer to
|
|
|
|
|
// the allocated dialog buffer for later dialog_free() calls, and therefore
|
|
|
|
|
// must not be changed while running the script – hence the explicit `far`.
|
2022-03-13 16:00:28 +00:00
|
|
|
|
extern unsigned char far *dialog_p;
|
2022-03-13 18:29:08 +00:00
|
|
|
|
|
|
|
|
|
// Loading and freeing
|
|
|
|
|
// -------------------
|
|
|
|
|
|
|
|
|
|
// Loads the dialog script for the current player character from the .TX2 file
|
|
|
|
|
// with the given name. `far` in this game, as it's also called from outside
|
|
|
|
|
// its segment.
|
|
|
|
|
void pascal dialog_load(const char *fn);
|
|
|
|
|
|
|
|
|
|
// Loads the dialog script for the current player character and stage.
|
|
|
|
|
void near dialog_load(void);
|
2022-03-13 19:47:32 +00:00
|
|
|
|
|
|
|
|
|
// Frees any previously loaded dialog script.
|
|
|
|
|
void near dialog_free(void);
|
2022-03-13 18:29:08 +00:00
|
|
|
|
// -------------------
|
2021-11-25 14:58:22 +00:00
|
|
|
|
/// ---------------------------------
|