23 #ifndef M4_WSCRIPT_WS_MACHINE_H 24 #define M4_WSCRIPT_WS_MACHINE_H 26 #include "common/algorithm.h" 27 #include "m4/m4_types.h" 28 #include "m4/gui/gui.h" 32 #define DEAD_MACHINE_ID 0xdeaddead 57 typedef void (*MessageCB)(
frac16 myMessage,
struct machine *sender);
79 M4Rect *currLocation =
nullptr;
80 M4Rect *newLocation =
nullptr;
85 uint32 *streamSSHeader =
nullptr;
86 uint32 *streamSpriteSource =
nullptr;
87 void *myStream =
nullptr;
88 char *seriesName =
nullptr;
91 #define JSR_STACK_MAX 8 94 int32 eosReqOffset = 0;
95 int32 eosReqCount = 0;
96 Anim8 *next =
nullptr;
97 Anim8 *prev =
nullptr;
99 Anim8 *infront =
nullptr;
100 Anim8 *behind =
nullptr;
101 Anim8 *myParent =
nullptr;
103 MemHandle sequHandle =
nullptr;
105 CCB *myCCB =
nullptr;
107 MemHandle dataHandle =
nullptr;
108 int32 dataOffset = 0;
110 int32 switchTime = 0;
117 int32 numLocalVars = 0;
120 int32 returnStackIndex = 0;
121 uint32 returnHashes[JSR_STACK_MAX] = { 0 };
122 int32 returnOffsets[JSR_STACK_MAX] = { 0 };
125 Common::fill(returnHashes, returnHashes + JSR_STACK_MAX, 0);
126 Common::fill(returnOffsets, returnOffsets + JSR_STACK_MAX, 0);
135 char *machName =
nullptr;
136 MemHandle machHandle = 0;
137 int32 machInstrOffset = 0;
138 int32 stateTableOffset = 0;
140 int32 numOfStates = 0;
141 uint32 recurseLevel = 0;
142 Anim8 *myAnim8 =
nullptr;
143 Anim8 *parentAnim8 =
nullptr;
145 MemHandle dataHandle = 0;
146 int32 dataOffset = 0;
147 int32 targetCount = 0;
148 struct machine *msgReplyXM =
nullptr;
166 int32 _pauseTime = 0;
168 bool _enginesPaused =
false;
170 int32 *_dataFormats =
nullptr;
171 uint32 _machineIDCount = 0;
172 machine *_firstMachine =
nullptr;
178 frac16 *_ws_globals =
nullptr;
179 void *_addrExists =
nullptr;
182 bool ws_Initialize(
frac16 *theGlobals);
185 void unpauseEngines();
186 void addPauseTime(int32 myTime);
188 void cycleEngines(
Buffer *cleanBackground, int16 *depth_table,
Buffer *screenCodes,
189 uint8 *myPalette, uint8 *ICT,
bool updateVideo);
190 void ws_RefreshWoodscriptBuffer(
Buffer *cleanBackground, int16 *depth_table,
191 Buffer *screenCodes, uint8 *myPalette, uint8 *ICT);
193 void terminateMachine(
machine *m);
194 void terminateMachinesByHash(uint32 machHash);
195 void terminateMachineAndNull(
machine *&m);
196 bool verifyMachineExists(
machine *m);
197 int32 ws_KillMachines();
198 void ws_KillDeadMachines();
199 void ws_StepWhile(
machine *m, int32 pcOffset, int32 pcCount);
201 machine *TriggerMachineByHash(int32 myHash,
Anim8 *parentAnim8, int32 dataHash, int32 dataRow, MessageCB CintrMsg,
bool debug,
const char *machName);
202 machine *TriggerMachineByHash(int32 val1, int32 val2, int32 val3, int32 val4, int32 val5, int32 val6,
203 int32 val7, int32 val8, int32 val9, int32 val10,
bool flag,
204 MessageCB intrMsg,
const char *machName);
205 machine *TriggerMachineByHash(MessageCB intrMsg,
const char *machName);
211 uint32 machHash,
machine *sendM, int32 msgCount);
213 int32 trigger, int32 val5, int32 val6, int32 val7, int32 val8);
215 #define kernel_spawn_machine(name,hash,callback) TriggerMachineByHash(hash, nullptr, -1, -1, callback, false, name) 216 #define kernel_terminate_machine(m) terminateMachine(m) Definition: ws_machine.h:130
Definition: ws_machine.h:60
Definition: ws_machine.h:92
Definition: ws_machine.h:48
intptr frac16
Definition: m4_types.h:46
void debug(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: m4_types.h:67
Definition: database.h:28
Definition: ws_machine.h:156
Definition: ws_machine.h:165
signed char * fill(signed char *first, signed char *last, Value val)
Definition: algorithm.h:168
Definition: ws_machine.h:69
Definition: ws_machine.h:76
void sendWSMessage(uint32 msgHash, frac16 msgValue, machine *recvM, uint32 machHash, machine *sendM, int32 msgCount)