2021-11-25 14:58:22 +00:00
|
|
|
|
/// TH05 in-game dialog script format
|
|
|
|
|
/// ---------------------------------
|
|
|
|
|
|
2024-05-25 18:31:09 +00:00
|
|
|
|
#include "th05/playchar.h"
|
|
|
|
|
#include "pc98.h"
|
|
|
|
|
|
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];
|
|
|
|
|
};
|
|
|
|
|
|
2023-10-14 19:52:40 +00:00
|
|
|
|
// Parameters for the 0x06 sprite blitting command.
|
|
|
|
|
struct tx2_op_06_params {
|
|
|
|
|
screen_x_t left;
|
|
|
|
|
screen_y_t top;
|
|
|
|
|
uint8_t patnum;
|
|
|
|
|
};
|
|
|
|
|
|
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
|
|
|
|
/// ---------------------------------
|