29#define g_cShowMemoryStatus \
30 (*(signed char *)&g_nShowMemoryStatus)
40 short index,
int resourceType);
46#pragma function(memcpy)
53 signed char speechSpeed;
86 speaker = (
signed char)(speaker + 0x80);
89 }
else if (speaker <
' ') {
96 }
else if (speaker ==
'T' &&
107 sprite->
waitTicks = (short)(speechSpeed * ticks);
135 unsigned char previousFileMode;
149 unsigned int mainAvail;
150 unsigned int mainLargest;
151 unsigned int farFree;
152 unsigned int farBlock;
153 unsigned short nearTotal;
163 "----- Mem State ------\n");
165 "NEAR: %ud\n", nearTotal);
167 "FAR: %6ld Largest: %6ld\n",
168 mainAvail, mainLargest);
170 "EMS: %6ld Largest: %6ld\n",
173 "----------------------\n");
177#pragma function(memcmp, strlen)
188 "Show Work: %.10s... %.10s... %.10s...\n",
202 unsigned char *firstRow;
222 unsigned char *firstRow;
238 for (slot = 0; slot < 8; slot++) {
245#pragma intrinsic(memcpy)
254 switch (viewportIndex) {
311 memcmp(text,
"50", 2) != 0) {
339 for (hits = 0; hits < 4; hits++) {
357 int wipeType,
short duration)
369 workspace = malloc(0xce);
370 if (workspace == 0) {
373 "Unable to allocate Wipe.\n");
377 duration, 1, workspace) != 0) {
380 if (wipeType == 8 || wipeType == 9) {
387 "Unable to allocate Wipe (1).\n");
417 while (resources != 0) {
421 resources = resources->
next;
430 while (resources != 0) {
434 resources = resources->
next;
445 for (member = 0; member < count; member++) {
446 if (indices[member] == (
unsigned char)index) {
447 DosMemmove(indices, &indices[member + 1], (
size_t)(15 - member));
459 va_start(arguments, format);
469 for (index = 0; index < 0x80; index++) {
480 unsigned short debugFrameNumber;
487 debugViewport.
bottom = 0x17;
497 "%X%Y%d Delay: %d DrawsCalled: %d * %d Time: %U ",
513 signed char releasePacket)
515 signed char malformed;
517 unsigned char *nextChunk;
518 unsigned char *chunk;
527 if (*(
unsigned int *)chunk == 0x50414d43) {
531 if (size / 3 != 0x100)
539 if (releasePacket != 0)
553 while (effect != 0) {
562 effect = effect->
next;
581 effect->
sound = sound;
592 effect->
sound = sound;
607 if (resourceIndex == -1) {
608 while (effect != 0) {
611 previous = effect->
next;
617 while (effect != 0) {
628 "Free FX: %p free: %d\n", effect,
634 effect = effect->
next;
663 if (packetSize <= 0) {
703 "Alloc Music: %p free: %d\n", allocated,
718 nextNode = node->
next;
725 if (allocated != 0) {
728 "Alloc Music: %p free: %d\n", allocated,
731 nextNode = allocated;
732 node->
next = nextNode;
764 resourceIndex == 0xff) {
778 "Free Music: %p free: %d\n",
782 if (resourceIndex != 0xff)
830 "Cannot alloc SpritesArray");
835 "Cannot alloc PlanesArray");
840 "Cannot alloc SequenceArray");
845 "Cannot alloc ScriptArray");
854 "Alloc ___workstring: %p free: %d\n",
865 "Alloc ___printstring: %p free: %d\n",
910 for (index = 0; index < 8; index++) {
922 short savedInputPollPeriod;
923 short previousMemoryStatus;
944 "************************************\n"
945 "Initial %ld Overhead %ld\n",
966 "Free ___workstring %p free: %d\n",
973 "Free ___printstring %p free: %d\n",
1034 unsigned char source)
1057 unsigned char source)
1104 scale = sprite->
scale;
1109 rotation = (short)(rotation +
1111 scale = (short)(scale +
1115 rotation = (short)(rotation % 360);
1117 rotation = (short)(rotation + 360);
1122 if ((attributes & 1) != 0) {
1123 if ((attributes & 0x10) != 0) {
1124 x = (short)(160 - x + 160);
1126 if ((attributes & 0x20) != 0) {
1127 y = (short)(100 - y + 100);
1137 x, y, sprite->
shape,
1140 rotation, scale, attributes);
1152 rotation, scale, attributes);
1154 x, y, sprite->
shape,
1156 rotation, scale, attributes);
1164 x, y, sprite->
shape,
1166 rotation, scale, attributes);
1187 for (index = 0; index < plane->
spriteCount; index++) {
1239 unsigned int number[4];
1245 while ((character = *source++) != 0) {
1246 if ((
unsigned char)character == 0x40) {
1249 }
else if ((
unsigned char)character >= 0x85) {
1250 switch ((
unsigned char)character) {
1265 (
char *)number, 10);
1270 (
char *)number, 10);
1285 unsigned char *text,
signed char draw)
1288 signed char continueSequence;
1289 signed char textShown;
1303 if (textShown == 0 && text != 0) {
1326 if (continueSequence != 0 && sequence->
planeCount != 0 &&
1328 for (planeIndex = 0; planeIndex < sequence->
planeCount;
1334 for (planeIndex = 0; planeIndex < sequence->
planeCount;
1356 continueSequence = 0;
1358 }
while (continueSequence != 0);
1365 signed char updateChildren)
1392 if (updateChildren != 0) {
1393 for (listSlot = 0; listSlot < plane->
spriteCount; listSlot++) {
1397 plane->
x = (short)(plane->
x + plane->
deltaX);
1398 plane->
y = (short)(plane->
y + plane->
deltaY);
1409 signed char waiting;
1435 sprite->
x = (short)(sprite->
x + sprite->
deltaX);
1436 sprite->
y = (short)(sprite->
y + sprite->
deltaY);
1448 switch (handlerType) {
1470 object->segmentStartFrame = 0;
1471 object->segmentEndFrame = 0;
1472 object->currentFrame = 0;
1484 for (cacheIndex = 0; cacheIndex < 15U; cacheIndex++) {
1486 for (objectIndex = 0; objectIndex < 128; objectIndex++) {
1488 if (
object != 0 && object->
drawType == 4 &&
1498 for (cacheIndex = 0; cacheIndex < 15U; cacheIndex++) {
1516 object->decoderState = 0;
1529 retired =
object->shape;
1531 for (slot = 0; slot < 15U; slot++) {
1542 while (fetch != 0) {
1545 for (slot = 0; slot < 15U; slot++) {
1557 "FLIC Failed %s (%d)\n Hit Key to Continue",
1561 object->segmentEndFrame = 0;
1562 object->currentFrame =
object->finalFrame;
1569 "Loaded Flic %s (%d) at %Fp\n", filename,
1578 if (object->
shape != 0) {
1579 while (slot < 15U) {
1582 .shape == object->
shape)
1589 object->decoderState = 0;
1592 object->segmentStartFrame =
object->currentFrame;
1593 object->segmentEndFrame =
1596 object->nextSection++;
1626 count = activeResources->
count;
1628 for (scan = 0; scan < count; scan++, packetSlot++) {
1629 if (*packetSlot == packet) {
1633 "--- Dumped (reset): %Fp item: %3d "
1634 "level = %d free = %8lu\n",
1709 signed char release;
1712 if (viewport->
pixels != 0) {
1730#pragma function(strcpy)
1734 unsigned int farMemory;
1736 unsigned int largest;
1738 unsigned int memory;
1744 if (*message !=
'~') {
1753 if (*message !=
'~') {
1755 "%s Far: %lu (Lg) = %lu EMS: %lu\n"
1756 "OVR: %lu INITIAL: %lu",
1757 message, memory, largest,
1762 strcpy(text,
"Game Paused");
1790 va_start(marker, format);
1791 vsprintf(text, format, marker);
1799 unsigned int packetSize)
1803 "Alloc Failed %s (%d) size=%ld\n",
1804 filename, section, packetSize);
1818 if (limit <= current)
1836 if (topAddress >= current)
1847 unsigned char *scriptBytes;
1849 short scriptValueStack[10];
1850 short secondaryOperand;
1857 unsigned char unreferencedFrameStorage[100];
1859 signed char protectCondition;
1860 signed char shouldContinue;
1862 scriptBytes = *scriptCursor;
1863 protectCondition = 1;
1865 topOperand = scriptValueStack + 10;
1867 if (scriptBytes == 0)
1869 "ERROR: Running script for UNLINKED EXTERNAL (%s)",
1876 scriptSymbolIndices[0]];
1881 scriptSymbolIndices != 0) {
1886 scriptSymbolIndices[0]];
1891 scriptSymbolIndices != 0) {
1896 scriptSymbolIndices[0]];
1910 goto cutscene_input_processed;
1913 goto cutscene_input_processed;
1916 goto cutscene_input_processed;
1919 goto cutscene_input_processed;
1922 goto cutscene_input_processed;
1931 goto cutscene_input_processed;
1937 "Series: %d Mission: %c Talk: %d\n",
1942 goto cutscene_input_processed;
1966cutscene_input_processed:
1986 if (objectType == 2 &&
1992 if (objectType == 2 &&
1999 opcode = *scriptBytes++;
2002 *topOperand = (short)(*topOperand == 0);
2006 *topOperand = (short)(*topOperand != 0 && value != 0);
2010 *topOperand = (short)(*topOperand != 0 || value != 0);
2014 *topOperand = (short)(*topOperand + value);
2018 *topOperand = (short)(*topOperand - value);
2022 *topOperand = (short)(*topOperand * value);
2026 *topOperand = (short)(*topOperand / value);
2030 *topOperand = (short)(*topOperand % value);
2034 *topOperand = (short)(*topOperand & value);
2038 *topOperand = (short)(*topOperand | value);
2042 *topOperand = (short)(*topOperand ^ value);
2046 *topOperand <<= value;
2050 *topOperand >>= value;
2054 &topOperand, scriptValueStack + 10);
2056 &topOperand, scriptValueStack + 10);
2059 (
unsigned short)secondaryOperand));
2063 if (protectCondition == 0 &&
2085 if (protectCondition == 0 &&
2105 *topOperand = *topOperand >= value ? 0 : 1;
2109 *topOperand = (short)(*topOperand > value);
2113 *topOperand = *topOperand > value ? 0 : 1;
2117 *topOperand = (short)(*topOperand >= value);
2121 *topOperand = (short)(*topOperand == value);
2125 *topOperand = (short)(*topOperand != value);
2128 *topOperand = (short)(*topOperand == 0);
2131 *topOperand = (short)(*topOperand != 0);
2138 scriptSymbolIndices[*scriptBytes++]];
2147 scriptSymbolIndices[*scriptBytes++]];
2156 scriptSymbolIndices[*scriptBytes++]];
2166 scriptSymbolIndices[*scriptBytes++]];
2175 value = *scriptBytes++;
2177 value, 2, 0,
"Cannot Allocate Loacls Data");
2178 switch (objectType) {
2231 (short)(
signed char)*scriptBytes++;
2289 &topOperand, scriptValueStack + 10);
2290 protectCondition = 1;
2296 *scriptCursor = scriptBytes;
2300 (
short)(
signed char)*scriptBytes++);
2305 *(*(
short **)&scriptBytes)++);
2311 while (*scriptBytes == 0xff) {
2312 value = (short)(value + *scriptBytes++);
2314 value = (short)(value + *scriptBytes++);
2319 value = *scriptBytes++;
2347 while (*scriptBytes == 0xff) {
2348 value = (short)(value + *scriptBytes++);
2350 value = (short)(value + *scriptBytes++);
2357 value = *(
short *)scriptBytes;
2360 &topOperand, scriptValueStack + 10));
2367 value = *(
short *)scriptBytes;
2370 &topOperand, scriptValueStack + 10));
2491 if (objectType == 0) {
2492 *scriptCursor = scriptBytes;
2493 return shouldContinue;
2523 &topOperand, scriptValueStack + 10);
2624 &topOperand, scriptValueStack + 10);
2649 if (objectType == 1) {
2650 *scriptCursor = scriptBytes;
2651 return shouldContinue;
2701 (
unsigned char)value);
2717 (
unsigned char)value);
2724 &topOperand, scriptValueStack + 10);
2726 &topOperand, scriptValueStack + 10);
2758 &topOperand, scriptValueStack + 10);
2760 &topOperand, scriptValueStack + 10);
2761 value = *scriptBytes++;
2769 scriptSymbolIndices[*scriptBytes++]]);
2773 switch (*scriptBytes++) {
2777 (
unsigned char)value);
2781 (
unsigned char)value);
2785 (
unsigned char)value);
2790 (
unsigned char)value);
2794 (
unsigned char)value);
2800 &topOperand, scriptValueStack,
2876 damageCapacity >> 1) - 1 <=
2892 (
signed char)*scriptBytes++;
2901 value = *scriptBytes++;
2903 "VAL=========================================%d\n",
2914 value = (
signed char)*scriptBytes++;
2918 value = *scriptBytes++;
2936 value = *scriptBytes++;
2946 value = *scriptBytes++;
2954 StopMusic(*(*(
short **)&scriptBytes)++);
2958 value = *scriptBytes++;
2968 unsigned char paletteIndex;
2969 short colourEntries;
2970 unsigned char firstColour;
2972 paletteIndex = *scriptBytes++;
2980 firstColour = *scriptBytes++;
2981 colourEntries = (short)(*scriptBytes++ + 1);
3017 value = *scriptBytes++;
3019 if (value != 0xff) {
3022 scriptSymbolIndices[value];
3039 value = *scriptBytes++;
3040 if (value != 0xff) {
3043 scriptSymbolIndices[value];
3064 "%%%%%% ELOG: %Fs = %d\n",
3069 value = *(
short *)scriptBytes;
3073 "@@@@@@@@@@@@@@@@ Logged: %d\n", value);
3085 unsigned char filmNumber;
3090 filmNumber = *scriptBytes++;
3110 scriptSymbolIndices[0]]);
3130 scriptSymbolIndices[*scriptBytes++]],
3145 scriptSymbolIndices[*scriptBytes++]],
3148 (objectType == 3 || objectType == 2)) {
3155 &topOperand, scriptValueStack + 10);
3190 scriptLocal += *scriptBytes++ * 2;
3196 scriptLocal += *scriptBytes++ * 2;
3215 while (*scriptBytes == 0xff) {
3216 value = (short)(value + *scriptBytes++);
3218 value = (short)(value + *scriptBytes++);
3241 while (*scriptBytes == 0xff) {
3242 value = (short)(value + *scriptBytes++);
3244 value = (short)(value + *scriptBytes++);
3266 switch ((
signed char)*scriptBytes++) {
3273 scriptSymbolIndices[*scriptBytes++];
3286 scriptSymbolIndices[*scriptBytes++];
3321 switch ((
signed char)*scriptBytes++) {
3329 scriptSymbolIndices[*scriptBytes++];
3338 scriptSymbolIndices[*scriptBytes++];
3347 scriptSymbolIndices[*scriptBytes++];
3355 value = *scriptBytes++;
3363 value = *scriptBytes++;
3367 switch ((
signed char)*scriptBytes++) {
3373 scriptSymbolIndices[*scriptBytes++]];
3405 scriptSymbolIndices[*scriptBytes++]];
3422 scriptSymbolIndices[*scriptBytes++]];
3443 (
int)(
signed char)*scriptBytes++,
3447 value = *scriptBytes++;
3468 &topOperand, scriptValueStack + 10);
3474 (
unsigned char)opcode, opcode);
3494 for (stringIndex = 0; stringIndex < index; stringIndex++) {
3504 char *extensionPosition;
3507 extensionPosition =
DosStrchr(fileName,
'.');
3508 if (extensionPosition++ != 0 &&
3509 toupper((
int)*extensionPosition) ==
'V')
3510 *extensionPosition =
'E';
3520 if (extension++ != 0 && *extension != 0) {
3534 if (extension++ != 0 && *extension != 0)
3540 short index,
int resourceType)
3542 short retryMusicExtension;
3545 char *packedFilename;
3550 retryMusicExtension = 0;
3553 "Found: loc: %Fp level = %d, free = %8lu\n",
3557 while (packet == 0) {
3566 switch (resourceType) {
3572 retryMusicExtension = 1;
3580 if (retryMusicExtension != 0) {
3581 retryMusicExtension = 0;
3589 filename, sectionIndex, 0);
3593 filename, sectionIndex, 0);
3595 }
else if (packet == 0 &&
3598 "Unsuccessful load of %s packet %d error = %d",
3603 filename, sectionIndex,
3609 "Loaded: %12s (%03d) size %ld loc: %Fp "
3610 "level = %d, free = %8lu\n",
3611 filename, sectionIndex, size, packet,
3629 frames = sprite->
shape;
3633 for (index = 0; index < 0x80; index++) {
3635 if (peer != 0 && peer->
shape == frames && peer != sprite) {
3636 goto shape_is_shared;
3660 "--- Dumped: %Fp level = %d free = %8lu\n", resource,
3663 if (resource != 0) {
3664 for (scan = 0; scan < 0x80; scan++) {
3666 if (flic != 0 && flic->
shape == resource)
3675 return soundIndex + 1;
3709 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
3710 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 6, 6, 6, 6, 6,
3711 11, 11, 11, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1,
3712 15, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
3713 14, 14, 14, 14, 14, 14, 14, 4, 4, 4, 4, 4, 4, 4, 4, 4,
3714 12, 12, 12, 12, 12, 12, 12, 12, 14, 10, 10, 10, 10, 10, 2, 2,
3715 14, 14, 14, 14, 14, 14, 14, 14, 6, 6, 6, 6, 6, 6, 6, 6,
3716 12, 12, 12, 12, 12, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
3717 10, 10, 10, 10, 10, 10, 10, 10, 4, 4, 4, 4, 4, 4, 4, 4,
3718 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 9, 9, 9, 9, 1,
3719 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8,
3720 12, 12, 12, 12, 12, 12, 12, 12, 4, 4, 4, 4, 4, 4, 4, 4,
3721 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
3722 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 2, 2, 2, 2, 2, 2,
3723 7, 7, 7, 7, 8, 8, 8, 8, 12, 12, 12, 12, 4, 4, 4, 4,
3724 10, 10, 10, 10, 2, 2, 2, 2, 13, 13, 13, 13, 13, 13, 13, 13
3732 10, 13, 14, 12, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3733 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3734 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3735 3, 5, 5, 1, 5, 9, 5, 5, 1, 2, 5, -1, -1, -1, -1, -1,
3736 -1, 1, 0, 5, 5, 1, 9, 5, 3, 2, 5, 5, 8, 0, 5, 3,
3737 0, 6, 5, 5, 5, 4, 9, 6, 5, 5, 5, 1, -1, -1, -1, -1,
3738 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3739 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
3742 40, 3, 3, 50, 60, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3743 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3744 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3745 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3746 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
3747 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
3748 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3749 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
3763 "CALLSIGN",
"PCNAME",
"FIRSTNAME"
void(__cdecl *g_pIxFree)(void *)
void Build_objective_list(void)
signed char RunCutsceneScript(unsigned char **cursor, short objectType)
CutsceneObjectResourceList * FindActiveCutsceneObjectResources(CutsceneObjectResourceList *resources)
unsigned int GetLargestFreeMemoryBlock(void)
void FormatTextBufferFromStart(const char *format,...)
unsigned int DosFarPtrToNear(void *v)
void FatalCutsceneError(const char *format,...)
void FadeViewportPaletteToColour(Viewport *viewport, unsigned short colour, short enabled)
void FadeMusic(short duration)
short MaxShort(short a, short b)
void LoadMissionData(short series, short mission)
signed char InitializeViewportWipe(Viewport *source, Viewport *destination, int wipeType, short duration, short passFlags, void *workspace)
unsigned int GetAvailableMainMemory(void)
void ReleaseLoadedCutsceneResource(CutsceneResourceTable *resources, short index)
void * LoadCachedCutsceneResource(CutsceneResourceTable *resources, short index, int resourceType)
short ServiceInputDevices(short deviceMask)
void LoadCutsceneSpeechSlot(short resourceIndex, short slot)
void DispatchCutsceneSpriteHandler(SceneFlicObject *sprite, short handlerType)
void LogMemoryStateToFile(FILE *file)
short AllocateViewport(Viewport *viewport, short clearColour, short flags)
void ReleaseActiveCutscenePacket(CutsceneResourceTable *resources, void *packet)
void WriteDetailedMemoryStateReport(void)
void DosMemmove(void *dst, const void *src, unsigned short n)
unsigned int GetLargestMainMemoryBlock(void)
void InitializeCinematicTextRenderer(void)
void RunCutsceneWipeTransition(Viewport *destination, Viewport *source, int wipeType, short duration)
void free_viewport(Viewport *viewport)
InputEventState * FindQueuedInputEvent(int type)
signed char HasCutsceneMusicNode(CutsceneMusicNode *node)
void DrawCinematicMemoryStatus(const char *message)
void SetTextContext(TextContext *context)
long GetNamedPacketSize(const char *filename, short section)
void StopMusic(short enabled)
void * LoadSpeechPacketIntoBuffer(char *fileName, short section, void *destination)
void ReleaseSceneFlicPackets(void)
void ResetCutsceneSpriteDrawTicks(void)
void ReleaseCutsceneResourceLevel(short owner)
void DrawCutsceneTextAt(short x, short y, short viewportIndex, const char *text)
void RestoreGamePalette(void)
void InitializeCutsceneViewports(void)
void DrawSpriteDefault(Viewport *viewport, short x, short y, unsigned char *shape, short frame)
void * LoadNamedPacket(const char *filename, short section, void *destination, unsigned short flags, void *decompressionWorkspace, int registerHandle)
void FlushInputEvents(void)
short MinShort(short a, short b)
void UpdateCutsceneSpriteObject(SceneFlicObject *sprite)
void SoundDebugPrintf(const char *fmt,...)
signed char AdvanceViewportWipe(void *workspace)
void RestoreCutsceneTextBacking(void)
void ClearCutsceneViewport(Viewport *viewport, unsigned char colour)
short GetOriginalFreeMemory(void)
void ExpandCutsceneText(const unsigned char *source, char *destination)
void ClearActiveCutscenePixelAlias(void)
void AddCutsceneMusicNode(CutsceneMusicNode **head, short resourceIndex)
unsigned int PumpWindowMessages(int skipMessages)
short StartInteractiveMusic(int track)
void AnimateCutsceneSpeakerMouth(SceneFlicObject *sprite)
void LogChangedCutsceneWorkBuffers(void)
void ExecuteCutsceneSequence(CutsceneSequence *sequence, unsigned char *text, signed char draw)
void ReleaseCutsceneSpriteShape(SceneFlicObject *sprite)
void InitializeCutsceneRuntimeResources(void)
void RewriteCutsceneMusicExtensionForDriver(char *filename)
void AdvanceSceneFlicStream(SceneFlicObject *object)
void AllocateCutsceneViewportOrFatal(Viewport *viewport, short colour, short flags)
void ReleaseCutsceneSpeechPackets(void)
void ReleasePacketSlot(void **slot)
void ConsumeCutscenePalettePacket(short firstColour, short count, signed char releasePacket)
void PresentCutsceneFrame(Viewport *source, Viewport *destination)
void LoadAndPlaySpeechPacket(char *fileName, short section)
int TakeInputPressCount(void)
void LinkCutsceneSpriteScript(unsigned char destination, unsigned char source)
void PlaySpeechPacketBuffer(void *packet, unsigned short packetSize, int interrupt)
void PanToScreen(Viewport *source, Viewport *destination)
unsigned char * GetDIBPixelBuffer(void)
void RunLoadedCutscene(void)
void CopyCutsceneSpriteDisplay(unsigned char destination, unsigned char source)
void DrawCutsceneSprite(SceneFlicObject *sprite)
void LoadCutsceneCockpitOverlay(short scriptValue)
void DosMemset(void *destination, unsigned int count, short value)
char * DosStrcpy(char *dst, const char *src)
CutsceneResourceTable * FindActiveCutsceneFileResources(CutsceneResourceTable *resources)
unsigned int ReadNextSceneForm(unsigned char **cursor, unsigned char **nextForm)
void RewriteCutsceneMusicExtensionForRetry(char *filename)
void * AllocateScenePointerTable(int count, short elementSize, unsigned short flags, const char *errorMessage)
void InitializeSceneFlicStream(CutsceneResourceTable *resources, short index, SceneFlicObject *object)
void DrawCutscenePlane(CutscenePlane *plane)
void ReportCutscenePacketAllocationFailure(const char *filename, short section, unsigned int packetSize)
void ClearViewport(Viewport *viewport, short colour)
int MapCutsceneSoundEffectNumber(int soundIndex)
void WriteMemoryStateReportHook(void)
void RewriteDiskFileGraphicsExtensions(char *fileName)
void DrawCutsceneCockpitOverlay(short unused, short verticalOffset)
char * CopyStringAndReturnEnd(char *destination, const char *source)
void UpdateCutscenePlaneObject(CutscenePlane *plane, signed char updateChildren)
void ServiceCutsceneRuntimeHook(void)
short PopCutsceneScriptValue(short **stack, short *stackBottom)
short QueryCurrentGraphicsMode(void)
void ReleaseCutsceneViewport(Viewport *viewport)
void PlaySfxWaveFileByNumber(int soundNumber, int sourceObject, int looping)
void * FindLoadedCutsceneMusic(short resourceIndex)
char * DosStrchr(const char *s, short c)
void ClearCutsceneTextViewport(void)
void FormatCinematicMemoryStatus(const char *format,...)
void PushCutsceneScriptValue(short **stack, short *stackTop, short value)
void ReleaseSceneMusicPacket(void)
void AddCutsceneSoundEffect(void *sound, short resourceIndex)
void DrawSpriteScaled(Viewport *viewport, short x, short y, unsigned char *shape, short frame, short angle, short scale, short flip)
CutsceneSoundEffect * FindCutsceneSoundEffect(short resourceIndex)
void BriefingMap_DisplayMap(void)
void SwapSceneChunkSizeEndian(int *value)
short RemoveCutsceneMemberIndex(short count, unsigned char *indices, signed char index)
char * GetPackedStringByIndex(CutsceneResourceTable *resources, short index)
void SaveGamePalette(void)
void ReleaseCutsceneMusicNodes(CutsceneMusicNode **head, short resourceIndex)
void FlushSoundEffect(void)
void exit_squadron(const char *msg,...)
void ReleaseCutsceneSoundEffects(short resourceIndex)
void RouteCutsceneViewportToDisplay(void)
short GetShapeFrameCount(unsigned char *shape)
void ReleaseCutsceneFileResource(short owner, CutsceneResourceTable **head)
signed char IsCutsceneSpeechLoaded(void)
void WaitForCutsceneInputEvent(void)
unsigned short RandomInRange(unsigned short lo, unsigned short hi)
void FlushSoundEffects(void)
unsigned int GetAvailableFarMemory(void)
void ReleaseCutsceneFontPacket(void)
void OutputDebugPrintf(const char *format,...)
void DrawFormattedText(const char *format,...)
void CopyViewportContents(Viewport *source, Viewport *destination)
void FlushPendingInputEvents(void)
void FinishViewportWipe(void *workspace)
unsigned char ParseCutsceneContainer(void *scenePacket)
void UpdateMap(char *text, short objective)
void ExecuteCutsceneScene(CutsceneScene *scene)
Shared Win32 declarations, types and library interfaces.
#define HOST_POINTER_SIZE
static char g_szLastCutsceneWorkBuffer[16]
short g_4_nFreeGameflowWord2
SceneFlicObject * g_11_pWatchedSceneSpriteB
char g_13_nFreeGameflowWord1
int g_nUnusedCutsceneWord1
SceneFlicObject * g_7_pWatchedSceneSpriteA
int g_17_nIdleGameflowWord2[5]
int g_39_nIdleGameflowWord1
char g_10_nSpareGameflowWord
int g_nUnusedCutsceneWord3
#define g_cShowMemoryStatus
static char g_szLastCutscenePrintBuffer[12]
short g_nEarlierGlobalCount
char g_68_nUnusedGameflowNumberValue
int g_nUnusedCutsceneWord2
unsigned char * g_26_pFilmRgbPacket
void(* g_apCutsceneSpriteHandlers[1])(SceneFlicObject *sprite)
TextContext g_2_stCutsceneMessageCtxInfo
short g_2_bMovieStringAdvanceState
ShortPoint g_aCockpitDamagePositions[4]
void * g_3_apSceneSpeechPacketsList[8]
CutsceneScene * g_pCurrentCutsceneScene
CutsceneScene ** g_apCutsceneScenes
CutsceneObjectResourceList * g_pCutsceneSceneResources
short g_bBriefingMapActive
TextContext g_6_stMovieDebugTextCtx
signed char g_bCutsceneDebugOverlayEnabled
CutsceneSequence * g_pCurrentCutsceneSequence
short g_nCutsceneResourceLevel
short g_bSpeechEnabledFlag
short g_117_nCutsceneFormatValueWord
signed char g_bSceneEscapeRequested
CutsceneResourceTable * g_pCutsceneMusicResources
short * g_2_pCutsceneLocalsTemp
signed char g_9_bCinematicSpriteTextEnableStatus
unsigned int g_4_dwSceneMusicMode
unsigned short g_wCutsceneDebugFrameNumber
CutsceneObjectResourceList * g_pCutsceneSpriteResources
signed char g_cCutsceneVideoMode
signed char g_cCurrentObjective
CutscenePlane * g_pCutsceneSpriteParentPlane
InputEventState * g_19_pFilmInputFlag
signed char g_bCutsceneTextRestorePending
unsigned char g_abCutscenePaletteTranslation[256]
signed char g_bAutopilotDebugEnabled
CampaignGlobals * g_pCampaignGlobals
Viewport g_9_stCutsceneTextBackingPort
CutsceneResourceTable * g_1_pActiveSceneFileResourcesRef
short g_2_nCutsceneForkOffsetNumber
short g_19_asCutsceneSpeechSectionsList[8]
TextContext g_16_stCutsceneDrawingTextSettingsInfo
short g_69_asCockpitDmgStateList[4]
ObjectTypeData g_aObjectTypeData[OBJECT_DATA_COUNT]
short g_nCutsceneFrameTick
signed char g_bCutsceneSkipFrame
signed char g_bSceneCockpitLoaded
signed char g_bCutsceneDrawingEnabled
CutsceneSequence * g_pLinkedCutsceneSequence
CutsceneSequence ** g_apCutsceneSequences
char * g_pszCutsceneSpeechCursor
CutsceneMusicNode * g_pCutsceneMusicPackets
CutsceneResourceTable * g_pCutsceneFilmResources
CutsceneSoundEffect * g_pCutsceneSoundEffects
short g_nSceneFlicContext
Viewport g_15_stSceneFlicScratchViewport
TextContext * g_29_pCurrentTextContext
CutsceneResourceTable * g_pCutsceneFxResources
char g_7_szCockpitAssetFilenameText[16]
CutsceneTextResource * g_pCutsceneTextResources
short g_4_nCutsceneResourceScratchValue
char * g_4_pszFilmWorkScratch
signed char g_bCutsceneSkipAll
SceneFlicObject * g_pCurrentCutsceneSprite
void * g_pSceneMusicPacket
signed char g_bCutsceneSpeechActive
signed char g_acCutsceneMouthDurations[128]
SceneFlicObject * g_pLinkedCutsceneSprite
CutsceneResourceTable * g_pCutsceneFontResources
unsigned char * g_13_pActiveCutscenePixelsAddress
CutscenePlane * g_pCurrentCutscenePlane
short g_asObjectDamage[SPACE_OBJECT_COUNT]
char * g_27_pszCutsceneFormattedText
short g_1_asCutsceneSpeechChannelsTable[8]
signed char g_bCutsceneTextBoundsOverride
CutsceneResourceTable * g_pCutsceneSpeechResources
short g_8_bUserDestroyedFlag
signed char g_acCutsceneMouthFrames[128]
short g_3_nCutsceneTextIdx
SceneFlicObject ** g_apSceneObjects
signed char g_36_cPilotKillCountValue
int g_47_nCutsceneMemDelta
signed char g_cCutsceneSoundVolume
short g_nActiveCutsceneResourceLevel
char * g_12_apszMovieSpeechFiles[8]
CutscenePlane ** g_apCutscenePlanes
CutsceneResourceTable * g_pCutsceneShapeResources
void * g_pCutsceneFxPacket
Viewport g_2_stModalSourceWindow
short g_1_nCutsceneFontOwnerNumber
char g_16_szTextBufferBuffer[256]
volatile int g_196_nInputTimerTicks
CutsceneResourceTable * g_pCutscenePaletteResources
signed char g_bCutsceneViewportPreallocated
short g_19_bStoredHighMemoryEnabled
signed char g_bMovieFramePresented
short g_nCutsceneMusicVolume
unsigned short g_wDigiPlaying
char * g_pszCurrentCutsceneText
signed char g_bRoomTransitionAnimationEnabled
CutsceneObjectResourceList * g_pCutscenePlaneResources
Viewport g_10_stCutsceneStringViewportBlock
unsigned int g_17_nSceneInitialLargestBlockWord
signed char g_cCutsceneSpeechSpeed
PilotNameVariables g_stPilotNameVariables
int g_nNextCutsceneFrameClock
unsigned char g_bMemoryLogToFile
MusicResource g_aTuneResources[66]
CutscenePlane * g_pLinkedCutscenePlane
Viewport g_stSecondaryViewBufferBlock
unsigned short g_nCutsceneFrameDelay
short g_8_nSavedCutsceneResourceOwnerValue
CutsceneObjectResourceList * g_pCutsceneSequenceResources
short g_nFrameSkipCountdown
void * g_pCutsceneCockpitPalette
signed char g_acObjectType[SPACE_OBJECT_COUNT]
signed char g_cCutsceneTextStyle
char * g_4_pszFilmSourceText
char * g_116_pszFilmPrintStore
unsigned int g_28_nCutsceneInitialAvailableMemoryWord
void * g_pCutsceneCockpitPacket
short g_nCutsceneSpritesDrawn
SceneFlicCacheEntry g_aSceneFlicCopyTable[15]
ShortRect g_stCutsceneTextBounds
const char * g_apszCutsceneObjectTypeNames[4]
struct CutsceneMusicNode * previous
struct CutsceneMusicNode * next
unsigned char resourceIndex
struct CutsceneObjectResourceList * next
short * scriptSymbolIndices
unsigned char * spriteIndices
unsigned char * scriptCursor
unsigned char * scriptStart
const unsigned char * filenameIndices
const unsigned char * sectionIndices
struct CutsceneResourceTable * next
unsigned char * sequenceIndices
unsigned char * scriptCursor
unsigned char * scriptCursor
unsigned char * scriptStart
unsigned char * planeIndices
struct CutsceneSoundEffect * next
void * auxiliaryAllocation
unsigned char * linkedScript
unsigned char * scriptCursor
unsigned char * scriptStart
unsigned int decoderState
unsigned char backgroundColour
unsigned short * rowOffsets