16 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1
19 0, 16, 16, 0, 4, 4, 20, 20, 24, 8, 8, 24, 28, 12, 12, 28
205 while (--index >= 0) {
221 ((
unsigned int (__cdecl *)(
222 const unsigned char *, int, int, short, short,
242 short viewportHeight;
243 unsigned short starHeight;
251 width = (short)(viewport->
right - viewport->
left);
252 viewportHeight = (short)(viewport->
bottom - viewport->
top);
253 population = density;
259 starHeight = viewportHeight;
367 { -29, -20, -12, 20 }
374 unsigned int sectionEntry;
375 unsigned int sectionEnd;
378 unsigned int directorySize;
384 unsigned int fileSize;
393 sectionCount = (short)(directorySize >> 2) - 1;
394 if (section >= sectionCount) {
398 sectionIndex = (int)section;
399 directoryOffset = sectionIndex * 4 + 4;
403 compression = (short)(sectionEntry >> 24) & 0xff;
405 sectionEntry &= 0x00ffffff;
406 if (sectionCount - sectionIndex == 1) {
408 sectionEnd = fileSize;
410 directoryOffset += 4;
415 ((
unsigned char *)§ionEnd)[3] = 0;
419 unsigned int sectionSize;
421 sectionSize = sectionEnd - sectionEntry;
428 handle->
dataSize = *(
volatile unsigned int *)§ionSize;
446 void *decompressionWorkspace)
448 unsigned int allocationSize;
453 unsigned char fallbackAllocations;
455 fallbackAllocations = 0;
468 if (decompressionWorkspace == 0 &&
473 if (decompressionWorkspace == 0) {
476 if (largeScratch == 0 || smallScratch == 0) {
477 if (largeScratch != 0)
479 if (smallScratch != 0)
481 fallbackAllocations = 1;
483 if (largeScratch == 0) {
488 if (smallScratch == 0) {
500 allocationSize = 0x3020;
513 (short)(
unsigned int)workspace;
521 if (destination == 0) {
524 allocationSize, flags);
546 if (decompressionWorkspace == 0) {
548 if (fallbackAllocations != 0) {
616 if (rating >= 0 && rating <= 7) {
620 }
else if (rating >= 9 && rating <= 12) {
639 frame = (short)((3 -
MinShort(frame, 3)) * 2);
646 for (armor = 0; armor < 4; armor++) {
647 targetViewport.
left =
651 targetViewport.
right =
656 (
short)(maximumArmor[armor] >> 1)) {
668 frame = (short)((3 -
MinShort(frame, 3)) * 2);
752 height = (short)(viewport->
bottom - viewport->
top + 1);
753 width = (short)(viewport->
right - viewport->
left + 1);
754 return (
short)(height * width);
759 short clearColour,
short flags)
763 unsigned short width;
764 unsigned short height;
770 height = viewport->
bottom - top + 1;
771 width = viewport->
right - viewport->
left + 1;
772 left = viewport->
left;
777 (
unsigned int)width * height, (
unsigned short)(flags + 2));
786 (top + (
unsigned int)height) *
sizeof(
unsigned short) + 4,
794 rowCount = height + 2;
795 for (row = 0; (int)row < rowCount; row++) {
796 viewport->
rowOffsets[top + row] = offset - left;
799 if (clearColour != -1)
807 struct Shape *shape,
short frame)
819 x = rectangle->
right;
827 x = rectangle->
right;
837 position->
x = (short)(x * 2 - frameBounds.
left);
838 position->
y = (short)(y * 2 - frameBounds.
top);
841 position->
x = (short)(x * 2 - frameBounds.
right);
842 position->
y = (short)(y * 2 - frameBounds.
top);
845 position->
x = (short)(x * 2 - frameBounds.
left);
846 position->
y = (short)(y * 2 - frameBounds.
bottom);
849 position->
x = (short)(x * 2 - frameBounds.
right);
850 position->
y = (short)(y * 2 - frameBounds.
bottom);
signed char acShipRating[16]
short asPreviousInputButtons[2]
int anInputButton1PressTimes[2]
short nConstellationParticleTotal
TextContext stRightVduTxtContext
short asInputButton1DoubleClicksList[2]
Viewport stRightVduViewport
short nRenderedSpaceFrame
ObjectTypeData aObjectTypeData[OBJECT_TYPE_COUNT]
void * pLastPacketAllocation
unsigned char cBlackColour
char szTxtWorkspaceBuffer[256]
short nPacketDecompressPending
short nPktDecompressSourceFile
const short * pCurrentViewScriptPtr
int anInputButton2PressTime[2]
short nTargetLockCountdown
ConstellationParticle aConstellationParticlesList[16]
enum ObjectClass aeObjectClass[SPACE_OBJECT_COUNT]
struct Shape * pCurrentConstellationShape
unsigned char aabSoundEffectDescriptors[37][8]
short nEyePitchTargetValue
short aasShipArmor[10][4]
short nViewConstellationStarCount
short nPacketDecompressInputPositionValue
FixedVector aShipVelocity[SPACE_OBJECT_COUNT]
short nCurrentPacketDecompressScratchSegment
char szCommMenuHeadingBuf[0x40]
short asObjectCollisionRadius[64]
unsigned short wPacketDecompressInputSize
const char * apszKilrathiAceNames[4]
short aasShipShield[10][2]
unsigned char cPrimaryViewBufferColour
int nAllocateViewportCallsValue
short nEyeRollTargetValue
unsigned char cDefaultTextColour
struct Shape * pFireworkShape
short nScriptedViewObject
unsigned short asObjDistancesTable[SPACE_OBJECT_COUNT]
PilotRecord * apWingmanPilotsList[8]
short asObjectCounterArray[SPACE_OBJECT_COUNT]
short bTargetLockReadoutDirty
short asInputButton2ChangedTable[2]
short asObjectScreenXList[SPACE_OBJECT_COUNT]
int nPacketDecompressResult
const char * pszCommMenuHeading
enum ObjectType aeObjectTypeList[SPACE_OBJECT_COUNT]
signed char cTargetDisplayObject
unsigned char * apViewportAllocations[128]
FireworkState aFireworksList[30]
Viewport * pConstellationViewportPtr
struct Shape * pCockpitIndicatorShape
short nShipMissionIndices[10]
FixedVector aShipPositionsArray[SPACE_OBJECT_COUNT]
FixedVector aShipFwdVec[64]
const char * apszCommMenuChoiceTextTable[7]
signed char acShipTargetTable[16]
ConstellationStar aConstellationStarsTable[10]
enum SpecialManeuver aeSpecialManeuvers[12]
short asInputBtn1ChangedTable[2]
unsigned char * allocation
unsigned short * rowOffsets
static ShortRect aTargetArmorClipRects[4]
static short asConstellationVelocity[16]
static short nConstellationDirection
static unsigned short wPacketDecompressionInputSizeOverride
static unsigned char * pPacketDecompressionWorkspace
static unsigned short wPacketCompressionFormatFlags
static short asConstellationFrame[16]
Umbrella header for the game core.
void SystemDebugPrintf(const char *fmt,...)
void * AllocateTaggedMemory(int size, unsigned short flags)
short __stdcall OpenPacketSection(const char *filename, short section, PacketSectionHandle *handle)
void __stdcall CloseDataFileByHandle(PacketSectionHandle *p)
void DrawCockpitReadout(signed char slot, const char *text)
unsigned int GetPacketDecompressionResult(void *)
char PumpMessagesDuringWait(void)
void fix_objects_ijk(short obj)
short __stdcall ReadPacketSectionData(PacketSectionHandle *handle, void *destination, unsigned int length)
void show_target_disp(void)
unsigned short __stdcall AllocateViewport(Viewport *viewport, short clearColour, short flags)
unsigned int InitializeFireworks(void)
int __stdcall SeekDataFile(unsigned short fd, int offset, unsigned int origin)
short __stdcall CalcRectangleArea(const Viewport *viewport)
void alter_pitch(short angle, short obj)
unsigned int force_view(int view, short obj)
void AddFixedVectors(const FixedVector *left, const FixedVector *right, FixedVector *sum)
void *__stdcall IdentityHandle(void *v)
unsigned int SoundFxTick(void)
void alter_roll(short angle, short obj)
int __stdcall SeekPacketSection(PacketSectionHandle *handle, int offset, short origin)
unsigned int DrawConstellationField(void)
void DrawSpriteDefault(Viewport *viewport, short x, short y, struct Shape *shape, short frame)
int __stdcall ReadDataFileAtOffset(unsigned short fd, int offset, unsigned int length, void *data)
short MinShort(short a, short b)
void __stdcall AlignSpriteFrameToRectCorner(const ShortRect *rectangle, ShortPoint *position, short corner, struct Shape *shape, short frame)
void InvalidateVduMode(short i)
void __stdcall CloseDataFile(unsigned short fd)
void initialize_scripted_view(const short *script)
void copy_frame(short source, short destination)
void alter_yaw(short angle, short obj)
void EraseCockpitReadoutRegion(Viewport *viewport, short left, short top, short right, short bottom, short colour)
short __stdcall OpenDataFileOrDie(const char *path)
void ClearDebugPauseFlags(void)
void ScaleFixedVector(const FixedVector *vector, int scale, FixedVector *result)
short TheEndFireWorks(Viewport *viewport, short count)
void FinishPacketDecompressionHook(void)
void zero_vector(FixedVector *vector)
unsigned int update_scripted_view(void)
unsigned int parse_view_script(void)
void ClearViewport(Viewport *viewport, short colour)
short __stdcall GetShapeFrameBounds(short *bounds, short x, short y, struct Shape *shape, short frame)
void set_new_vdu(short vdu)
unsigned int InitializeCockpitReadout(signed char slot, TextContext *context)
short GetTargetColourIndex(void)
void DrawTargetRangeReadout(void)
void ReleasePacketHandle(void *handle)
void ComputeVectorDelta(const FixedVector *from, const FixedVector *to, FixedVector *delta)
unsigned int DrawTextAt(TextContext *context, short x, short y, const char *text, unsigned char alignment)
void FlushSoundEffectsAndLog(int soundHandle, short fadeTicks)
short __stdcall RandomInRange(short lo, short hi)
unsigned int InitializeConstellationField(Viewport *viewport, short direction, short density)
void DrawFormattedText(const char *format,...)
void LogDisplayMode(const char *mode)
void *__stdcall DecompressPacketSection(PacketSectionHandle *handle, void *destination, unsigned short flags, void *decompressionWorkspace)
@ SPECIAL_MANEUVER_UNKNOWN_9