DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
script.hpp
1#pragma once
2
3#include "common.h"
4
5#include <libvu0.h>
6
10// clang-format off
11enum TitleScriptCommand {
12 TSC_OBJ_MOTION2 = 0,
13 TSC_OBJ_MOTION = 1,
14 TSC_OBJ_MOVE = 2,
15 TSC_OBJ_TALK = 3,
16 TSC_OBJ_EYE = 4,
17 TSC_OBJ_MOUTH = 5,
18 TSC_OBJ_DISP = 6,
19 TSC_OBJ_STEP = 7,
20 TSC_CAMERA = 8,
21 TSC_SE_STOP = 9,
22 TSC_SE = 10,
23 TSC_SOUND_FADE = 11,
24 TSC_FADE_IN = 12,
25 TSC_FADE_OUT = 13,
26 TSC_MESSAGE = 14,
27 TSC_NEXT_MES = 15,
28 TSC_MES_CLR = 16,
29 TSC_LOAD_OBJ = 17,
30 TSC_SPRITE = 18,
31 TSC_BOM = 19,
32 TSC_BEEM = 20,
33 TSC_SCENE_LOAD = 21,
34 TSC_SCENE = 22,
35 TSC_END = 23,
36 TSC_WAIT_KEY = 24,
37 TSC_WAIT = 25,
38 TSC_COMMAND_COUNT = 26,
39};
40
41// clang-format on
42
46// clang-format off
47enum TitleScriptArgType {
48 TSARG_STRING = 0,
49 TSARG_COMMA_VALUE = 1,
50 TSARG_VALUE = 2,
51};
52
53// clang-format on
54
58// clang-format off
59enum TitleScriptFade {
60 TSFADE_NONE = 0,
61 TSFADE_IN_BLACK = 1,
62 TSFADE_OUT_BLACK = 2,
63 TSFADE_IN_WHITE = 3,
64 TSFADE_OUT_WHITE = 4,
65};
66
67// clang-format on
68
72// clang-format off
73enum TitleScriptSeKind {
74 TSSE_ALL = -1,
75 TSSE_EFFECT = 0,
76 TSSE_SPECIAL = 1,
77};
78
79// clang-format on
80
84// clang-format off
85enum TitleScriptLoadStep {
86 TSLOAD_NONE = -1,
87 TSLOAD_START = 0,
88 TSLOAD_WAIT = 1,
89 TSLOAD_UNPACK = 2,
90};
91
92// clang-format on
93
98 const char *name;
99 int length;
101 int arg_type[8];
102};
103
104STATIC_ASSERT(sizeof(CSCRIPT_COMMAND) == 0x2C);
105
110 u8 disp;
111 u8 unk_01[3];
112 int motion;
114 int move;
116 u8 unk_11[3];
117 int eye;
118 float eye_time;
119 int mouth;
121 u8 talk;
122 u8 unk_25[3];
123 int load;
125 float step;
126};
127
128STATIC_ASSERT(sizeof(SCRIPT_OBJ) == 0x34);
129
133class CScript {
134public:
137 int fade;
139 u8 end;
140 u8 unk_11[3];
141 int sprite;
142 int scene;
146 float wait;
148 u8 unk_2D[3];
154 u8 unk_4E1[3];
155 int mes_no;
156 float mes_timer;
157 int mes_x;
158 int mes_y;
163 int unk_504;
164 int bom_no;
166 u8 unk_50D[11];
167 sceVu0FVECTOR bom_pos[3];
168 float bom_size[4];
172 u8 unk_566[10];
173 sceVu0FVECTOR beem_from[3];
174 sceVu0FVECTOR beem_to[3];
176 int se_no;
181 int size;
182 u8 unk_5E4[20];
183 char data[56000];
184 char *p;
185 int pos;
186 float arg[128];
187 u8 unk_E2C0[56];
188
196 void Load(const char *name);
197
205 void Step();
206
214 int CheckScript(char *buffer, int position, CSCRIPT_COMMAND *command, int command_no);
215
223 int CheckArg(char *buffer, int position, CSCRIPT_COMMAND *command);
224
232 int SkipSpace(char *buffer, int position);
233};
234
235STATIC_ASSERT(sizeof(CScript) == 0xE300);
236
238extern CSCRIPT_COMMAND Command[26];
239
241extern class CScript CScript__2;
SCRIPT_OBJ obj[23]
Definition script.hpp:149
int mes_y
Definition script.hpp:158
int mes_tail_y
Definition script.hpp:161
int bgm_fade
Definition script.hpp:180
sceVu0FVECTOR beem_to[3]
Definition script.hpp:174
int mes_page_wait
Definition script.hpp:162
float motion_step
Definition script.hpp:152
int load_no
Definition script.hpp:143
sceVu0FVECTOR bom_pos[3]
Definition script.hpp:167
sceVu0FVECTOR beem_from[3]
Definition script.hpp:173
void Load(const char *name)
Definition script.cpp:51
int pos
Definition script.hpp:185
int mes_talker
Definition script.hpp:159
int camera_no
Definition script.hpp:136
float wait
Definition script.hpp:146
int mes_x
Definition script.hpp:157
int mes_tail_x
Definition script.hpp:160
int se_no
Definition script.hpp:176
float arg[128]
Definition script.hpp:186
int fade
Definition script.hpp:137
int scene
Definition script.hpp:142
int motion_end
Definition script.hpp:151
int beem_no
Definition script.hpp:169
int sprite
Definition script.hpp:141
int motion_start
Definition script.hpp:150
u8 motion_req
Definition script.hpp:153
u8 beem_req
Definition script.hpp:170
u8 bom_req
Definition script.hpp:165
int se_kind
Definition script.hpp:175
float mes_timer
Definition script.hpp:156
int size
Definition script.hpp:181
int se_voice
Definition script.hpp:177
int mes_no
Definition script.hpp:155
int CheckScript(char *buffer, int position, CSCRIPT_COMMAND *command, int command_no)
Definition script.cpp:151
int CheckArg(char *buffer, int position, CSCRIPT_COMMAND *command)
Definition script.cpp:356
int bom_no
Definition script.hpp:164
float bom_size[4]
Definition script.hpp:168
int mes_wait
Definition script.hpp:145
int camera_start
Definition script.hpp:135
u8 beem_end
Definition script.hpp:171
float fade_speed
Definition script.hpp:138
char * p
Definition script.hpp:184
u8 reset_flag
Definition script.hpp:147
char data[56000]
Definition script.hpp:183
int SkipSpace(char *buffer, int position)
Definition script.cpp:491
int se_fade_time
Definition script.hpp:178
int se_stop
Definition script.hpp:179
int init_no
Definition script.hpp:144
void Step()
Definition script.cpp:103
int arg_type[8]
Definition script.hpp:101
const char * name
Definition script.hpp:98
float step
Definition script.hpp:125
float eye_time
Definition script.hpp:118
int motion_end
Definition script.hpp:113
int load_step
Definition script.hpp:124
float mouth_time
Definition script.hpp:120