aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/script.h
blob: c840cbb231bfa03a7295047d87611fa3d2cf2255 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2006 The ScummVM project
 *
 * cinE Engine is (C) 2004-2005 by CinE Team
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * $URL$
 * $Id$
 *
 */

#ifndef CINE_SCRIPT_H_
#define CINE_SCRIPT_H_

namespace Cine {

#define SCRIPT_STACK_SIZE 50

struct scriptStruct {
	byte *ptr;
	uint16 size;
	int16 stack[SCRIPT_STACK_SIZE];
};

#define NUM_MAX_SCRIPT 50

extern scriptStruct scriptTable[NUM_MAX_SCRIPT];

 void setupOpcodes(); 

void computeScriptStack(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize);
void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16 scriptIdx);
void dumpScript(char *dumpName);

#define OP_loadPart                     0x3F
#define OP_loadNewPrcName               0x41
#define OP_requestCheckPendingDataLoad  0x42
#define OP_endScript                    0x50
#define OP_changeDataDisk               0x6B
#define OP_79                           0x79

void addScriptToList0(uint16 idx);
int16 checkCollision(int16 objIdx, int16 x, int16 y, int16 numZones, int16 zoneIdx);

void runObjectScript(int16 entryIdx);
int16 stopObjectScript(int16 entryIdx);

void executeList1(void);
void executeList0(void);

void purgeList1(void);
void purgeList0(void);

void o1_modifyObjectParam();
void o1_getObjectParam();
void o1_addObjectParam();
void o1_subObjectParam();
void o1_add2ObjectParam();
void o1_sub2ObjectParam();
void o1_compareObjectParam();
void o1_setupObject();
void o1_checkCollision();
void o1_loadVar();
void o1_addVar();
void o1_subVar();
void o1_mulVar();
void o1_divVar();
void o1_compareVar();
void o1_modifyObjectParam2();
void o1_loadMask0();
void o1_unloadMask0();
void o1_addToBgList();
void o1_loadMask1();
void o1_unloadMask1();
void o1_loadMask4();
void o1_unloadMask4();
void o1_addSpriteFilledToBgList();
void o1_op1B();
void o1_label();
void o1_goto();
void o1_gotoIfSup();
void o1_gotoIfSupEqu();
void o1_gotoIfInf();
void o1_gotoIfInfEqu();
void o1_gotoIfEqu();
void o1_gotoIfDiff();
void o1_removeLabel();
void o1_loop();
void o1_startGlobalScript();
void o1_endGlobalScript();
void o1_loadAnim();
void o1_loadBg();
void o1_loadCt();
void o1_loadPart();
void o1_closePart();
void o1_loadNewPrcName();
void o1_requestCheckPendingDataLoad();
void o1_blitAndFade();
void o1_fadeToBlack();
void o1_transformPaletteRange();
void o1_setDefaultMenuColor2();
void o1_palRotate();
void o1_break();
void o1_endScript();
void o1_message();
void o1_loadGlobalVar();
void o1_compareGlobalVar();
void o1_declareFunctionName();
void o1_freePartRange();
void o1_unloadAllMasks();
void o1_op63();
void o1_op64();
void o1_initializeZoneData();
void o1_setZoneDataEntry();
void o1_getZoneDataEntry();
void o1_setDefaultMenuColor();
void o1_allowPlayerInput();
void o1_disallowPlayerInput();
void o1_changeDataDisk();
void o1_loadMusic();
void o1_playMusic();
void o1_fadeOutMusic();
void o1_stopSample();
void o1_op71();
void o1_op72();
void o1_op73();
void o1_playSample();
void o1_playSample();
void o1_allowSystemMenu();
void o1_loadMask5();
void o1_unloadMask5();

void o2_loadPart();
void o2_addSeqListElement();
void o2_removeSeq();
void o2_op78(); 
void o2_op81();
void o2_op82();
void o2_isSeqRunning();
void o2_gotoIfSupNearest();
void o2_gotoIfSupEquNearest();
void o2_gotoIfInfNearest();
void o2_gotoIfInfEquNearest();
void o2_gotoIfEquNearest();
void o2_gotoIfDiffNearest();
void o2_startObjectScript();
void o2_stopObjectScript();
void o2_op8D();
void o2_addBackground();
void o2_removeBackground();
void o2_loadAbs();
void o2_loadBg();
void o2_wasZoneChecked();
void o2_op9B();
void o2_op9C();
void o2_useBgScroll();
void o2_setAdditionalBgVScroll();
void o2_op9F();
void o2_addGfxElementA0();
void o2_opA1();
void o2_opA2();
void o2_opA3();
void o2_loadMask22();
void o2_unloadMask22();

} // End of namespace Cine

#endif