10#pragma function(acos, asin, cos, sin, sqrt)
14 return (
short)(rand() % (int)n);
20 srand((
unsigned int)time(0));
27 return rand() & 0xffff;
35 span = (short)(hi - lo);
38 span = (short)(rand() % (span + 1));
39 return (
short)(span + lo);
45 if (n == -1 || n == 0)
47 return (
short)(rand() % (n + 1));
57 leftFloat = (float)left / 256.0;
58 rightFloat = (float)right / 256.0;
59 product = (long)(leftFloat * rightFloat * 256.0);
67 float denominatorValue;
70 numeratorValue = (float)numerator / 256.0;
72 denominatorValue = (float)denominator / 256.0;
74 denominatorValue = 1.0f;
75 quotient = (long)(numeratorValue / denominatorValue * 256.0);
85 angle = (float)degrees;
86 result = (long)(sin((
double)angle *
DEG2RAD) * 256.0);
96 angle = (float)degrees;
97 result = (long)(cos((
double)angle *
DEG2RAD) * 256.0);
109 normalized = (float)value;
111 result = (short)(asin((
double)normalized) * 57.295779513082323);
123 normalized = (float)value;
125 result = (short)(acos((
double)normalized) * 57.295779513082323);
134 long scaledMagnitude;
137 normalized = (float)value;
138 normalized /= fixedScale;
139 scaledMagnitude = (long)(sqrt((
double)normalized) * fixedScale);
140 return scaledMagnitude;
146 float scaledX = (float)x / 256.0;
147 float scaledY = (float)y / 256.0;
148 long scaledMagnitude;
152 scaledMagnitude = (long)(sqrt(scaledX + scaledY) * 256.0);
153 return scaledMagnitude;
159 float x = (float)vector->
x / 256.0;
160 float y = (float)vector->
y / 256.0;
161 float z = (float)vector->
z / 256.0;
162 long scaledMagnitude;
167 scaledMagnitude = (long)(sqrt(x + y + z) * 256.0);
168 return scaledMagnitude;
229 unsigned char *shape,
short frame)
233 if (*(
unsigned short *)(shape + 4) > frame) {
235 shape += *(
unsigned short *)(shape + frame);
236 bounds[2] = (short)(*(
unsigned short *)shape + x);
237 bounds[0] = (short)(x - ((
unsigned short *)shape)[1]);
238 bounds[1] = (short)(y - ((
unsigned short *)shape)[2]);
239 bounds[3] = (short)(((
unsigned short *)shape)[3] + y);
248 if (rect[0] <= x && x <= rect[2] &&
249 rect[1] <= y && y <= rect[3])
267 const char *lineBegin;
280 while (isDone == 0) {
282 while (*cursor ==
' ')
289 if (ch ==
'\n' || ch ==
'\r')
303 if (*cursor !=
' ') {
304 while (*cursor !=
' ' && cursor > text) {
310 if (cursor <= text) {
312 "FATAL : INVALID STRING '%s'n", text);
331 for (drawPos = lineBegin; drawPos < cursor; drawPos++) {
336 if (wrapPending != 0) {
351 unsigned int glyphWidth;
355 if (character ==
'\n') {
361 }
else if (character ==
'\r') {
364 }
else if (character != 0) {
368 lineHeight, glyphWidth,
387 unsigned short lineLength;
388 unsigned char command;
400 if (frameOffset < *(
unsigned short *)(shape + 4)) {
401 src = shape + *(
int *)(shape + frameOffset);
403 lineLength = *(
unsigned short *)src;
405 while (lineLength != 0) {
408 if ((lineLength & 1) != 0) {
410 while (lineLength > 0) {
413 if ((command & 1) != 0) {
416 (
unsigned short)(lineLength - command);
422 (
unsigned short)(lineLength - command);
432 lineLength = *(
unsigned short *)src;
439#pragma function(memcpy, memset, strcpy, strlen)
443 return (
unsigned int)v;
455 return strrchr(s, (
int)c);
461 return strchr(s, (
int)c);
467 return strcpy(dst, src);
473 strcpy(destination, source);
474 return destination + strlen(destination);
475 return strcpy(destination, source);
481 return (
short)strlen(s);
487 memmove(dst, src, n & 0xffff);
492void DosMemset(
void *destination,
unsigned int count,
short value)
494 memset(destination, value, (
unsigned short)count);
561 0, value & 1, (value & 2) >> 1, 0, 0, 0);
569 0, value & 1, (value & 2) >> 1, 0, 0, 0);
577 0, value & 1, (value & 2) >> 1, 0, 0, 0);
605 short secondaryButton)
608 unsigned int eventType = type & 0xffff;
612 primaryButton, secondaryButton, 0, 0, 0);
621 for (index = 0; index < 0x100; index++) {
639#pragma intrinsic(memset)
645 for (slot = 0; slot < 0x100; slot++) {
654 int primaryButton,
int secondaryButton,
655 unsigned int ignored,
unsigned int field14,
656 unsigned int field18)
658 unsigned int modifiers;
669 if (primaryButton != 0)
671 if (secondaryButton != 0)
741 nextEvent =
event->
next;
758 nextEvent =
event->
next;
759 if (event->
type != type) {
761 event->previous->next =
event->next;
764 if (event->
next != 0)
779 if (event->
next != 0) {
780 event->previous->next =
event->next;
781 event->next->previous =
event->previous;
783 event->previous->next = 0;
787 if (event->
next != 0) {
840 *(
unsigned int *)&state->
value =
843 state->
value = (short)*(
unsigned int *)&state->
value;
856 *(
unsigned int *)&state->
value =
859 state->
value = (short)*(
unsigned int *)&state->
value;
866 *(
unsigned int *)&state->
value =
876 *(
unsigned int *)&state->
value =
910 if (clearQueue != 0) {
938 event != 0 &&
event->
type != type;
947 eventType = (int)event->
type;
948 if (eventType == 1 || eventType == 2)
958 state->
modifiers = (
unsigned short)flags;
962 state->
value = (short)*(
unsigned int *)&state->
value;
971 unsigned int modifiers;
977 event != 0 &&
event->
type != type;
981 if (event->
type == 3) {
991 if (event->
type == 1 || event->
type == 2)
1002 (
unsigned short)modifiers;
1435#pragma function(memset)
1442 count * elementSize, (
short)(flags | 0x40));
1443 memset(allocation, 0, count * elementSize);
1454#pragma intrinsic(memset)
1591#pragma function(memset)
1627#pragma intrinsic(memset)
1631 if (scanCode >= 0 && scanCode < 0x80) {
1641#pragma function(memset)
1646 int minimumDistance;
1656 ceiling = -999999999;
1658 nextObject = furthest;
1670 nextObject = furthest;
1673 if (nextObject == -1)
1677 nextObject = nextFarthest;
1683 (
int)(
unsigned short)
1689 (int)(
unsigned short)
1718 drawObject = object;
1742 drawObject = object;
1781 drawObject = object;
1800 drawObject = object;
1836 ->geometryOffsets[0]);
2021#pragma function(abs)
2028 rangeFixed = (int)range << 8;
2030 if (abs(rangeFixed) >= magnitude)
2038 unsigned int shrinking;
2042 shrinking |=
shrink(&vector->
x);
2043 shrinking |=
shrink(&vector->
y);
2044 shrinking |=
shrink(&vector->
z);
2045 }
while (shrinking != 0);
2052 unsigned short whole;
2053 unsigned short fraction;
2055 *component = *component / 2;
2056 whole = (
unsigned short)((
unsigned int)*component >> 16);
2057 fraction = (
unsigned short)(*component & 0xffff);
2059 if (fraction <= 0x0f00)
2062 }
else if ((
short)whole == -1) {
2063 if (fraction >= 0xf100)
2066 }
else if (whole != 0)
2126 if (filename != 0) {
2171 void *destination,
unsigned short flags,
2172 void *decompressionWorkspace,
2175 return PacketLoad(filename, section, destination, flags,
2176 decompressionWorkspace, registerHandle);
2182 short offsetX,
short offsetY)
2184 bounds->
left = (short)(hotspot->
left + offsetX);
2185 bounds->
right = (short)(hotspot->
right + offsetX);
2187 bounds->
top = (short)(hotspot->
top + offsetY);
2206 rgb[0] = triplet[0];
2207 rgb[1] = triplet[1];
2208 rgb[2] = triplet[2];
2237 unsigned char *shape,
2251 rcL = rectangle->
left;
2252 rcT = rectangle->
top;
2253 rcR = rectangle->
right;
2255 spL = spLimits.
left;
2257 spR = spLimits.
right;
2259 if (((spL <= rcL && rcL <= spR) ||
2260 (spL <= rcR && rcR <= spR))) {
2261 if (spT <= rcT && rcT <= spB)
2263 if (spT <= rcB && rcB <= spB)
2266 if (((rcL <= spL && spL <= rcR) ||
2267 (rcL <= spR && spR <= rcR))) {
2268 if (rcT <= spT && spT <= rcB)
2270 if (rcT <= spB && spB <= rcB)
2291 pointXs[pointCount] = first->
left;
2292 pointYs[pointCount] = first->
top;
2294 pointXs[pointCount] = first->
left;
2295 pointYs[pointCount] = first->
bottom;
2297 pointXs[pointCount] = first->
right;
2298 pointYs[pointCount] = first->
top;
2300 pointXs[pointCount] = first->
right;
2301 pointYs[pointCount] = first->
bottom;
2303 pointXs[pointCount] = second->
left;
2304 pointYs[pointCount] = second->
top;
2306 pointXs[pointCount] = second->
left;
2307 pointYs[pointCount] = second->
bottom;
2309 pointXs[pointCount] = second->
right;
2310 pointYs[pointCount] = second->
top;
2312 pointXs[pointCount] = second->
right;
2313 pointYs[pointCount] = second->
bottom;
2315 pointXs[pointCount] = first->
left;
2316 pointYs[pointCount] = second->
top;
2318 pointXs[pointCount] = first->
left;
2319 pointYs[pointCount] = second->
bottom;
2321 pointXs[pointCount] = first->
right;
2322 pointYs[pointCount] = second->
top;
2324 pointXs[pointCount] = first->
right;
2325 pointYs[pointCount] = second->
bottom;
2327 pointXs[pointCount] = second->
left;
2328 pointYs[pointCount] = first->
top;
2330 pointXs[pointCount] = second->
left;
2331 pointYs[pointCount] = first->
bottom;
2333 pointXs[pointCount] = second->
right;
2334 pointYs[pointCount] = first->
top;
2336 pointXs[pointCount] = second->
right;
2337 pointYs[pointCount] = first->
bottom;
2342 for (cornerIndex = 0; cornerIndex++; cornerIndex < pointCount) {
2343 x = pointXs[cornerIndex];
2344 y = pointYs[cornerIndex];
2345 if (first->
left <= x && x <= first->right &&
2346 second->
left <= x && x <= second->right &&
2347 first->
top <= y && y <= first->bottom &&
2348 second->
top <= y && y <= second->bottom) {
2349 if (containedCount == 4)
2351 insideFlags[containedCount] = 1;
2354 if (containedCount == 4)
2356 insideFlags[containedCount] = 0;
2360 if (containedCount != 4)
2364 (
short)pointXs[insideFlags[0]],
2365 MinShort((
short)pointXs[insideFlags[1]],
2366 (
short)pointXs[insideFlags[2]]));
2368 (
short)pointYs[insideFlags[0]],
2369 MinShort((
short)pointYs[insideFlags[1]],
2370 (
short)pointYs[insideFlags[2]]));
2372 (
short)pointXs[insideFlags[0]],
2373 MaxShort((
short)pointXs[insideFlags[1]],
2374 (
short)pointXs[insideFlags[2]]));
2376 (
short)pointYs[insideFlags[0]],
2377 MaxShort((
short)pointYs[insideFlags[1]],
2378 (
short)pointYs[insideFlags[2]]));
2388 parts[0] = (
unsigned char)(ticks % 60);
2390 parts[1] = (
unsigned char)(ticks % 60);
2392 parts[2] = (
unsigned char)(ticks % 60);
2394 parts[3] = (
unsigned char)(ticks % 24);
2435 { 0, 0, 0, 0, 0, 0, 0, 0 },
2436 { 0, 0, 0, 0, 0, 0, 0, 0 },
2437 { 0, 0, 0, 0, 0, 0, 0, 0 },
2438 { 0, 0, 0, 0, 0, 0, 0, 0 },
2439 { 320, 128, 0, 24, 0, 24, -24576, -1 },
2440 { 320, 200, 0, 0, 0, 0, -1536, -1 },
2441 { 0, 0, 0, 0, 0, 0, 0, 0 }
2445 0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2,
2446 14, 13, 12, 11, 10, 9, 8, 9, 10, 11, 12, 13,
2447 15, 16, 17, 18, 19, 20, 21, 20, 19, 18, 17, 16,
2448 28, 27, 26, 25, 24, 23, 22, 23, 24, 25, 26, 27,
2449 29, 30, 31, 32, 33, 34, 35, 34, 33, 32, 31, 30,
2451 0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2,
2452 14, 13, 12, 11, 10, 9, 8, 9, 10, 11, 12, 13,
2453 15, 16, 17, 18, 19, 20, 21, 20, 19, 18, 17, 16,
2454 14, 13, 12, 11, 10, 9, 8, 9, 10, 11, 12, 13,
2455 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 0,
2456 0, 1, 2, 3, 1, 3, 2, 1, 2, 3, 1, 3, 2,
2457 4, 5, 6, 4, 6, 5, 4, 5, 6, 4, 6, 5,
2458 7, 8, 9, 7, 9, 8, 7, 8, 9, 7, 9, 8,
2459 10, 11, 12, 10, 12, 11, 10, 11, 12, 10, 12, 11,
2460 13, 14, 15, 13, 15, 14, 13, 14, 15, 13, 15, 14, 16
2464 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2465 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2466 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2467 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2468 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2470 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2471 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2472 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2473 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
2474 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 2,
2475 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2476 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2477 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2478 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2479 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0
void(__cdecl *g_pIxFree)(void *)
void InputDeviceShutdownHook(void)
void ResetPointerViewportsHook(void)
unsigned char g_3_abUnusedLibraryBytes[4]
void UnhookInterruptVectorHook(short vector)
void StopMusicTimerHook(void)
unsigned char g_388_abUnusedLibraryBuffer1[4]
unsigned char g_86_abUnreferencedEventData[8]
unsigned char g_68_abUnusedInputSpace3[16]
unsigned int GetEmsTotalFree(void)
short HookInterruptVector(short vector)
void * AllocateEmsBlock(unsigned int size)
void DumpVideoPageMapHook(void)
unsigned char g_56_abUnusedEventBuffer[6]
unsigned char g_18_abUnreferencedInputBuffer[4]
short HasKeyIntercept(void)
void SpeedCalibrationHook(void)
void RecordStartTimeHook(void)
unsigned char g_136_abUnusedInputMemoryData[12]
unsigned char g_138_abUnusedLibraryData[4]
unsigned char g_26_abUnusedInputStorage2[4]
unsigned char g_9_abUnusedInputData[16]
void RebootMachineHook(void)
short DetectTandyKeyboard(void)
void CalibrateDelayHook(void)
short CheckEmsPointer(void *pointer)
unsigned char g_17_abUnusedLibraryInputBuffer[8]
void KeyboardNullHook(void)
unsigned char g_128_abPauseInputState[0x100]
unsigned char g_5_abUnreferencedInputStorage2[4]
int SetupBackBufferHook(void)
void SetPointerViewportHook(void)
void DumpFarHeapHook(void)
unsigned char g_5_abUnusedInputSpace1[2]
void GetMouseHomePosition(ShortPoint *position)
void RemovePointerViewportHook(void)
void MusicTimerIsrHook(void)
unsigned char g_13_abPreviousPauseKeyStatuses[0x100]
void * AllocateNearMemory(short size)
void FreeDefaultMemory(void *block)
short InitializeMousePointer(void)
unsigned char g_4_abUnusedEventStorage[8]
unsigned char g_8_abUnusedInputSystemBytes[4]
unsigned char g_26_abUnusedInputStorage1[4]
unsigned char g_1_abUnreferencedInputData[4]
unsigned char g_4_abUnreferencedEventStorage[2]
unsigned char g_9_abUnusedLibrarySpace[260]
int IsEmsPointer(void *pointer)
unsigned char g_59_abUnusedLibraryBuffer2[4]
unsigned char g_39_abUnusedInputSpace2[12]
unsigned char g_97_abUnusedInputSystemBuffer[8]
unsigned char g_12_abUnusedLibraryInputData[16]
void FreeEmsBlockHook(void *block)
void FormatEmsHeapHook(void)
void FreeVideoPagesHook(void)
unsigned char g_10_abUnusedEventSpace[8]
unsigned char g_13_abUnusedLibrarySpaceData[4]
unsigned char g_37_abUnusedEventManagerBuffer[272]
unsigned char g_58_abUnreferencedInputStorage1[8]
unsigned char g_38_abUnusedLibraryInputBufferData[4]
void UnhookAllInterruptVectorsHook(void)
void set_up_screen_viewport(signed char mode)
short ReadWord(unsigned short *p)
void RefreshMouseCursorDisplay(void)
void SetMouseHomePosition(short x, short y)
short IsVectorWithinRange(FixedVector *vector, short range)
int ConfigureInputPump(int slot, void(*pump)(void))
unsigned int GetLargestFreeMemoryBlock(void)
void SetInputViewport(Viewport *viewport)
unsigned int DosFarPtrToNear(void *v)
void AllocateApplicationScratchBuffer(void)
short MaxShort(short a, short b)
long MultiplyFixed(int left, int right)
void TimerResetHook(void)
char PumpMessagesDuringWait(void)
void BuildObjectDepthOrder(void)
short LoadInputCursorShape(const char *filename, short section, short flags)
void * PacketLoad(const char *filename, short section, void *destination, short flags, void *decompressionWorkspace, int registerHandle)
unsigned int IdentityWord(unsigned int v)
void * AllocateDefaultMemory(unsigned int size)
void SplitGameClockTicksForNav(unsigned char *parts)
void VideoReleaseHook(void)
void ApplyPackedMousePosition(ShortPoint point)
short InitializePostPaletteState(void)
short ServiceInputDevices(short deviceMask)
void StartupHook(unsigned int(*callback)(unsigned int, short))
void DrawSolidColourSpriteScaled(Viewport *viewport, short x, short y, unsigned char *shape, short frame, short angle, short scale, short flip, unsigned short colour)
void ReleaseApplicationScratchBuffer(void)
long Vector_magnitude(const FixedVector *vector)
void DosMemmove(void *dst, const void *src, unsigned short n)
void intro_drawbackgroundships(void)
void SetMusicTickRateHook(short period)
void RestoreMouseCursorBackground(void)
void PersonnelDriveHook(short drive)
void ApplySpacePaletteModeHook(void)
short DosStrlen(const char *s)
InputEventState * FindQueuedInputEvent(int type)
void ClearInputKeyStatePreservingModifiers(void)
void SetTextContext(TextContext *context)
long GetNamedPacketSize(const char *filename, short section)
void ResumeMouseCursorHook(void)
short GetViewportIntersection(ShortRect *intersection, const ShortRect *first, const ShortRect *second)
void DrawSolidColourSprite(Viewport *viewport, short x, short y, unsigned char *shape, short frame, unsigned short colour)
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)
int PollInputEvent(InputEventState *event, short)
void FlushInputEvents(void)
void SetInputKeyState(int scanCode, unsigned char pressed)
void SetMultimediaTimerCallback(int period)
long SinFixed(short degrees)
short MinShort(short a, short b)
void QueueInputEvent(int type, int x, int y, int value, int primaryButton, int secondaryButton, unsigned int ignored, unsigned int field14, unsigned int field18)
short GetOriginalFreeMemory(void)
void DrawMouseCursor(void)
unsigned int PumpWindowMessages(int skipMessages)
void SetFrameTimerPeriodDirect(short p)
void DIBsetPalette(short index, short *rgb)
void SetWholePaletteFromTriplets(unsigned char *palette)
void * DosNearPtrToFar(unsigned int v)
void ClearInputKeyState(void)
void CaptureMouseCursorBackground(void)
void * AllocateZeroedRecords(int count, short elementSize, short flags)
short GetShapeFrameBounds(short *bounds, short x, short y, unsigned char *shape, short frame)
long PlanarMagnitude(int x, int y)
InputEvent * AllocateInputEvent(void)
void * AllocateTaggedMemory(unsigned int size, short flags)
unsigned int GetPacketSize(const char *filename, short section)
void DrawTextString(const char *text)
unsigned char * GetInputCursorShape(void)
void WaitForVerticalBlankThunk(void)
void SetPaletteEntryFromTriplet(const unsigned char *triplet, short index)
void ClearDebugPauseFlags(void)
void CaptureSpriteBackground(Viewport *viewport, unsigned char *background, short x, short y, unsigned char *shape, short frame)
void SeedRandomFromClock(void)
long CosFixed(short degrees)
void TranslatePolledInputEvent(unsigned short type, unsigned int value)
void ExitCleanupHook(void)
short InitializeInputManagerMemory(short eventQueueSize)
void draw_sorted_objects_to_buffer(void)
unsigned short SelectDiskDriveHook(short drive)
unsigned short GetRandomWord(void)
void RetainInputEventsOfType(int type)
void RestoreSpriteBackground(Viewport *viewport, unsigned char *background, short x, short y, unsigned char *shape, short frame)
long DivideFixed(int numerator, int denominator)
void FinalizeInputManagerHook(void)
void DosMemset(void *destination, unsigned int count, short value)
char * DosStrcpy(char *dst, const char *src)
void DisableMouseCursorDrawing(void)
int GetControlKeyState(void)
short RandomBelow(short n)
void SetFrameTimerPeriod(short period)
long Magnitude(int value)
void ReleaseInputEvent(InputEvent *event)
void WaitForFrameTick(void)
void DIBwholePaletteFromTriplets(unsigned char *palette)
void PollMenuInputDevices(void)
int MeasureShapeFrameStorage(unsigned char *shape, short frame)
void EnableMouseCursorDrawing(void)
void AppendTextCharacter(char character)
char * CopyStringAndReturnEnd(char *destination, const char *source)
void ServiceCutsceneRuntimeHook(void)
int GetSoundHardwareFlag(void)
unsigned short GetShutdownErrorCode(unsigned char *driveState)
void * IdentityHandle(void *v)
short EmsRestoreMapping(void)
short InitializeMouseCursorDepth()
short OffsetSceneHotspotBounds(ShortRect *bounds, const SceneHotspot *hotspot, short offsetX, short offsetY)
void ClearInputPump(void)
char * DosStrchr(const char *s, short c)
unsigned int shrink_vector(FixedVector *vector)
unsigned int GetGameClockTicks(void)
void SetMenuInputPump(void)
unsigned int GetStartupErrorCode(int vector)
unsigned int JoystickEdgeHook(int button)
void ReleasePacketHandle(void *handle)
char * DosStrrchr(char *s, short c)
void SetInputCursorHostPosition(int x, int y)
void DrawFontGlyph(char character, TextContext *context, int height, int width, int y)
unsigned int shrink(int *component)
void DrawSpriteScaled(Viewport *viewport, short x, short y, unsigned char *shape, short frame, short angle, short scale, short flip)
short IsFrameTickElapsed(void)
short GetCurrentDiskDriveHook(void)
void DIBupdate(int left, int top, int right, int bottom)
void SetTextCursor(unsigned short a, unsigned short b)
int GetShiftKeyState(void)
short PeekInputEvent(InputEventState *event, short type)
unsigned short EnableHighMemoryResources(void)
void DIBwaitForVerticalBlank(void)
short EmsSaveMapping(void)
void SplitPackedPoint(ShortPoint point, short *p)
unsigned short RandomInRange(unsigned short lo, unsigned short hi)
unsigned int GetKeyboardModifiers(void)
void InitializeInputDriverHook(void)
void QueueInputEventAtCursor(unsigned int type, short primaryButton, short secondaryButton)
unsigned int GetAvailableFarMemory(void)
void FreeIfNotNull(void *p)
void FinalizeInputDriverHook(void)
void SetFrameTimerAndWait(short period)
short IsSpriteFrameOverlappingRect(const ShortRect *rectangle, short x, short y, unsigned char *shape, short frame)
short RandomBelowOrEqual(short n)
DwordPtr IdentityDword(DwordPtr value)
void RemoveInputEvent(InputEvent *event)
int GetNextInputEvent(InputEventState *event)
void FlushPendingInputEvents(void)
short GetFontCharWidth(char i)
short GetNavRangeSentinel(void)
void SystemDebugPrintf(const char *format,...)
void DrawTextCharacter(char character)
short IsPointInRect(short x, short y, const short *rect)
void ShutdownEventManager(void)
void SetMouseCursorShape(unsigned char *shape, short frame)
void ReleaseInputEventQueue(void)
Shared Win32 declarations, types and library interfaces.
#define DIRECTION_SHAPE_TABLE_COUNT
#define DIRECTION_VIEW_COUNT
#define SPACE_OBJECT_COUNT
short g_asObjectScreenAngle[SPACE_OBJECT_COUNT]
HostMouseMessage g_6_stHostMouseTextBlock
short g_11_nViewportLeftOrigin
unsigned char * g_apObjectShape[SPACE_OBJECT_COUNT]
short g_asObjectDrawX[SPACE_OBJECT_COUNT]
short g_asObjectDistance[SPACE_OBJECT_COUNT]
unsigned char * g_pCockpitBackgroundPacket
int g_nCockpitDisplayMode
int g_3_anCurrentInputEventEntryAllocation[0x100]
QueuedMouseState g_16_stEventQueuePointerData
short g_96_nHighMemoryInitValue
void(*) g_59_pfnEventShutdownCallback(void)
short g_86_nCurrentInputTickInterval
signed char g_bSceneEscapeRequested
const ScreenViewportGeometry *volatile g_15_pScreenViewportGeometry
signed char g_9_bCinematicSpriteTextEnableStatus
unsigned char * g_pConstellationSprite
unsigned char * g_pDrawnInputCursorShape
int g_148_nPointerDirtyLeft
int g_6_bCurrentInputCursorBackgroundCapturedState
short g_aeObjectClass[SPACE_OBJECT_COUNT]
short g_asObjectType[SPACE_OBJECT_COUNT]
short g_9_nStoredHighMemoryResourceSetupWord
InputManagerState * g_18_pEventManager
short g_asObjectFlip[SPACE_OBJECT_COUNT]
short g_asObjectScreenX[SPACE_OBJECT_COUNT]
int g_26_bPointerDirtyValue
MouseCursorState g_37_stPersonnelMousePointerState
short g_105_nEmsIsrBusyValue
TextContext * g_29_pCurrentTextContext
unsigned char g_77_abKeyboardEventStates[0x80]
int g_2_bIgnoreNextCursorMoveFlag
short g_asObjectDrawY[SPACE_OBJECT_COUNT]
short g_12_wInputDeviceButtonStatus
unsigned char * g_13_pActiveCutscenePixelsAddress
int g_15_nPointerDirtyBottom
short g_6_wQueuedButtonsState
int g_nPreviousPrimaryButton
signed char g_cKeypadMouseSpeedValue
unsigned char g_26_bMouseCursorEnabled
short g_asObjectScreenScale[SPACE_OBJECT_COUNT]
signed char g_acDirectionShapeFlip[DIRECTION_VIEW_COUNT *DIRECTION_SHAPE_TABLE_COUNT]
InputEvent * g_pInputEventHead
int g_nMouseCursorDrawDepth
void(*) g_3_pfnRenderSceneTextStringHandler(char *text)
unsigned char g_88_nEventRepeatDelayState
short g_18_bEventManagerInitializationState
void(*) g_36_pfnRenderSceneFontCharacterHandler(char character)
Viewport g_27_stViewScratchInfo
EVENTMGR_STATIC InputEventState g_1_stFoundInputEvent
short g_nNavPointerObject
int g_nPreviousSecondaryButton
short g_14_nCurrentGraphicsModeDetectedValue
volatile int g_196_nInputTimerTicks
EVENTMGR_STATIC unsigned char g_abInputCursorBehind[0x1000]
unsigned char g_cPrimaryViewBufferColour
int g_3_nEventClockScaleValue
int g_56_anStoredObjectSortedIndicesData[SPACE_OBJECT_COUNT]
int g_146_nInputCursorDirtyTop
int g_nInputDoubleClickDeadline
short g_19_bStoredHighMemoryEnabled
InputDeviceSample g_aInputDeviceSamplesList[2]
ScreenViewportGeometry g_aScreenViewportGeometry[7]
signed char g_6_bCampaignFlightRunning
Viewport g_101_stScrViewInfo
void(*) g_176_pfnCurrentInputPump(void)
signed char g_1_cStoredViewDisplayModeValue
InputEvent g_3_aInputEventArray[0x100]
int g_11_anPlacedObjectDepths[SPACE_OBJECT_COUNT]
short g_8_nActiveInputDeviceWord
volatile int g_5_nFrameTimerWaitTicksValue
signed char g_acDirectionShapeFrame[DIRECTION_VIEW_COUNT *DIRECTION_SHAPE_TABLE_COUNT]
InputEvent * g_pInputEventTail
unsigned char * g_39_pCurrentCampaignDataOffset
short g_15_nStoredScreenViewCentreX
int g_138_nCursorDirtyRightValue
int g_nInputEventPoolInitialized
short g_18_nInterfaceEventMode
void * g_26_pLibraryCurrentLastPacketAllocation
PersonnelMouseSample g_6_stPersonnelMouseData
int g_4_nCapturedInputCursorX
int g_nNextInputQueueFlushTick
short g_49_nViewportOffsetY
short g_asObjectScreenY[SPACE_OBJECT_COUNT]
short g_asObjectViewFrame[SPACE_OBJECT_COUNT]
unsigned char primaryButton
unsigned char secondaryButton
unsigned char shapeChanged