31 0, 40000, 50000, 55000, 60000, 61000,
32 61500, 62000, 63000, 63500, 64000
55 10, 37, 52, 57, 62, 1070
59 5, 18, 27, 35, 38, 1040
111 "Original FMem %lu. Current FMem %lu. Current NMem %u.\n",
171int main(
short argc,
char **argv)
181 short animationIndex;
204 if (
sizeof(
int) !=
sizeof(
short *))
211 for (argumentIndex = 0;
212 argumentIndex < argumentCount;
215 if (strcmp(
"Origin", (*argumentSlot)) == 0)
218 argument = *argumentSlot;
219 switch (argument[0]) {
223 option = *argumentSlot + 1;
247 option = argument + 1;
249 if (*option ==
's' || *option ==
'S') {
288 mission = (short)atoi(argument + 1);
293 series = (short)atoi(argument + 1);
299 animationIndex = (short)atoi(argument + 1);
314 if (animationDemo == 1) {
330 if (launchMission == 0) {
499 entry[0] = (short)(entry[0] - 4);
538 if ((count & 0x1f) == 0) {
547 for (count = 0; count < 6; count++) {
643 while (finished == 0) {
684 }
else if (control != 0) {
708 }
else if (control != 0) {
851 short queuedKeyEvent;
854 unsigned short horizontalMagnitude;
855 unsigned short verticalMagnitude;
861 int afterburnerControl;
862 unsigned int buttons;
872 modifiers =
event.modifiers;
914 }
else if (buttons == 1) {
918 if ((buttons & 2) == 0)
933 if ((
short)event.
value == 1) {
943 if ((
short)event.
value == 3)
945 if ((
short)event.
value == 2 &&
954 (
short)event.
value == 2) {
956 if ((
short)event.
value == 1)
1015 afterburnerControl =
1016 (
unsigned short)(modifiers & 4) >= 1;
1017 if (afterburnerControl != 0 &&
1020 afterburnerControl = 0;
1034 horizontal =
event.x +
1037 vertical =
event.y -
1040 horizontal =
event.x +
1043 vertical =
event.y +
1048 horizontalMagnitude = (short)abs((
int)horizontal);
1049 verticalMagnitude = (short)abs((
int)vertical);
1052 (short)horizontalMagnitude;
1056 yawInput = -yawInput;
1057 for (pitchInput = 0;
1059 (short)verticalMagnitude;
1063 pitchInput = -pitchInput;
1066 if (mouseX - 4 <= viewportLeft)
1078 if (pitchInput >= 9)
1080 if (pitchInput <= -9)
1082 if (afterburnerControl != 0) {
1084 pitchInput = -pitchInput;
1134short __stdcall
DosStrlen(
const char *s);
1138 unsigned short duration);
1236 }
while (acknowledged == 0);
1244 }
while (acknowledged == 0);
1253 }
while (key == 0x19 || key == 0x50 || key == 0x0c);
1263 va_start(arguments, format);
1264 vsprintf(text, format, arguments);
1285 const char *format, ...)
1291 va_start(arguments, format);
1292 vsprintf(text, format, arguments);
1297 if (duration == 9999)
1299 if (modalShown == 0) {
1306 if (duration == 9999) {
1312 if (duration == 9999) {
1318 if (modalShown != 0) {
1322 if (duration == 9999)
1329 if (showBanner != 0) {
1387 if (notRepeated &&
get_mode(1) == 4 &&
1436 if (control != 0 && notRepeated) {
1463 if (notRepeated && control == 0) {
1488 if (notRepeated && control == 0)
1650 int missileCameraEnabled;
1655 if (missileCameraEnabled != 0)
1756 if (notRepeated && control != 0) {
1770 if (control != 0 && notRepeated) {
1819 if (notRepeated && control != 0) {
1875 x, y, score, x + 0x82,
1901 "Wave %d complete.\n\nBonus Points: %s0%P",
1906 "Mission %d complete.\n\nBonus Points: %s0%P",
1969 short navPointIndex = 0;
1973 if (navPoint->
type == 1 &&
1975 return navPointIndex;
1997 unsigned int frameReady;
2010 if (entryNavPoint == -1)
2072 if (frameReady != 0) {
2129 damage = (short)(((typeData->
armorLeft -
2132 damage = (short)(damage +
2135 damage = (short)(damage +
2138 damage = (short)(damage +
2144 damage = (short)(damage +
2169 frame = region->
frame;
2196 while (region->
frame != -1) {
2199 frame = region->
frame;
2214 unsigned short colour,
2217 unsigned char *indices;
2219 short *currentPalette;
2220 short *targetPalette;
2221 unsigned int paletteBytes;
2231 memset(indices, 0, 256);
2233 paletteBytes = (
unsigned int)(activeCount * 6);
2235 if (currentPalette == 0) {
2239 memset(currentPalette, 0, paletteBytes);
2241 if (targetPalette == 0) {
2246 memset(targetPalette, 0, paletteBytes);
2249 for (index = 0; index < activeCount; index++) {
2251 ¤tPalette[index * 3]);
2252 memcpy(&targetPalette[index * 3], target, 6);
2256 currentPalette, targetPalette,
2257 (
short)(activeCount * 3)) != 0) {
2258 for (paletteIndex = 0; paletteIndex < activeCount; paletteIndex++) {
2260 (
unsigned char)currentPalette[paletteIndex * 3];
2262 (
unsigned char)currentPalette[paletteIndex * 3 + 1];
2264 (
unsigned char)currentPalette[paletteIndex * 3 + 2];
void(__cdecl *pIxFree)(void *)
void DosInterruptHandlerHook(void)
unsigned char bEscapePressedFlag
InputDeviceSample aInputDevSamples[2]
short bSlowSceneAnimation
MissionHeaderDisk stCurrentMissionHeader
volatile signed char cPreviousKey
unsigned short wCurrentInputModifiers
short nRenderedSpaceFrame
signed char aShipWeaponsTable[10][0x47]
struct Shape * pLaunchDoorShape
int nCapitalShipViewDistance
signed char acPlayerComponentDamageList[9]
ObjectTypeData aObjectTypeData[OBJECT_TYPE_COUNT]
char szHudMessageBuf[0x60]
TextContext stDefaultTxtContext
unsigned char cBlackColour
ShortVector stRotationInput
int nUnusedFlightProfileTicksB
int nFlightSoundEffectsEnabled
short anObjectRollRotationList[SPACE_OBJECT_COUNT]
short anObjectYawRotation[SPACE_OBJECT_COUNT]
short anObjPitchRot[SPACE_OBJECT_COUNT]
short asShipAccumulatedDmg[SPACE_OBJECT_COUNT]
TextContext * pCurTextContext
short nArcadeBonusCountdown
short asInputButton2DoubleClick[2]
unsigned char cViewportClearColour
const ScreenViewportGeometry * pScreenViewGeometry
signed char acShipDmg[10]
ShortVector stPreviousRotationInput
CampaignState stInitialCampaignState
volatile int bMouseCursorVisible
TextContext stCurrentConvTxtCtx
short asShipWpnEnergyList[10]
int nUnusedFlightProfileTicksC
unsigned char bInputModeState
unsigned char bVideoImagesSuppressed
int bPtrMovedByKeyboardState
FixedVector aShipRightVector[64]
enum ShipObjective aeShipObjectiveList[12]
MissionNavPoint aMissionNavPoints[MISSION_NAV_POINT_COUNT]
unsigned char abPaletteTripletsArray[256][3]
enum ObjectClass aeObjectClass[SPACE_OBJECT_COUNT]
short bCurrentExpandedMemoryAvail
short bMouseMoveEvtQueued
short aasShipArmor[10][4]
unsigned char abDiskPromptDriveStates[0x20]
unsigned char bInputPollingGuard
Viewport stCurrentConvTextViewport
MouseCursorState stMouseCursorState
InputDeviceSample stPreviousFlightInput
short nArcadeTimeRemaining
short aPaletteFadeEntries[6][3]
int nArcadeWaveBonusValue
int bDirectDrawModeCascadeEnabled
Viewport stCurrentTrainSimTitleDisplayViewport
short nStartNavPointOverride
short bCurrentRunningFromHardDiskFlag
signed char cCurrentCockpitView
unsigned char cPrimaryViewBufferColour
char szDefaultTxtBuf[0xc8]
short bJoystickEventQueued
short asDamageFlashColour[3]
Viewport stSpaceBufferViewport
int nUnusedFlightProfileTicksA
unsigned char cPrimaryTextColour
short asObjectCounterArray[SPACE_OBJECT_COUNT]
FixedVector aShipUpVector[64]
CampaignState stCampaignState
short nCurrentSpaceFrameValue
unsigned char abCockpitLightGoalArray[7]
int bMissileCameraEnabled
TextContext stHudMessageTextContext
int bHostPrimaryMouseButton
short nCommMenuChoiceCount
short nCurrentActiveInputDevice
signed char cScreenViewMode
int nSelectedReleaseWeaponIndex
short nCurrentNavigationPoint
enum ObjectType aeObjectTypeList[SPACE_OBJECT_COUNT]
Viewport stModalSrcViewport
char szInsufficientMemory[100]
short bMouseButtonEventQueuedFlag
short nMainArcadeStartupParameterValue
int bHostSecondaryMouseButton
char * pCurrentStartupArgumentsPtr[30]
unsigned char bMessageSpeed
MissionShipRecord aMissionShips[MISSION_SHIP_STORAGE_COUNT]
short nCurrentHazardFieldTotal
short bCurrentKeyboardEvtQueued
FixedVector aShipPositionsArray[SPACE_OBJECT_COUNT]
int nCurrentDamageAlarmSfxHandle
FixedVector aShipFwdVec[64]
int nSavedDosInterruptVector
signed char acShipTargetTable[16]
short nCurrentViewCenterPosY
enum SpecialManeuver aeSpecialManeuvers[12]
int bPlayerCollisionsEnabled
RoomMenu stCurrentRoomMenu
unsigned int nCurrentFrameTimerIdValue
TitleMenuRegion aTrainSimMissionRegions[5]
static LARGE_INTEGER liRenderDoneCounter
static int nFlightPresentDelta
static int nShowMemoryStatus
static LARGE_INTEGER liSimulationDone
static LARGE_INTEGER liFrameStart
static LARGE_INTEGER liFlightFrameEndCounter
static unsigned char bFlightRollLatch
static int nFlightFrameTicks
static short asMousePitchThresholds[6]
static short nMousePitchInput
static volatile unsigned char bAfterburnerButtonLatched
static int bMouseAfterburnerControl
static short nMouseYawInput
static InputDeviceSample stLastPolledFlightInput
static int nSimulationDelta
static unsigned int dwLastSecondaryButtonPress
static LARGE_INTEGER liFlightAfterCockpitCounter
static LARGE_INTEGER liFlightAfterInputCounter
static short asMouseYawThresholds[6]
static int anVolumeLevels[11]
int bPlayerCollisionResponse
enum ObjectType playerShipType
signed char currentSeries
signed char currentMission
Umbrella header for the game core.
void ShowOnScreenMessage(int flags, short duration, const char *fmt,...)
void SystemDebugPrintf(const char *fmt,...)
void ShowGamePausedBanner(short showBanner)
unsigned int RefreshMemoryStatusOverlay(void)
int process_player_input(void)
void * AllocateTaggedMemory(int size, unsigned short flags)
unsigned int InitializeConversationText(void)
void FormatTextBufferFromStart(const char *format,...)
unsigned int initialize_cockpit(int requestedMode)
short __stdcall IsPointInRect(short x, short y, const short *rect)
unsigned int RenderSpaceViewFrame(void)
void SetMousePosition(int x, int y)
void UpdateTrainSimMenuCursor(void)
char PumpMessagesDuringWait(void)
unsigned int InitializeTextContextFromFont(TextContext *context, short fontIndex, unsigned char colour, signed char background)
short LogMemoryUsage(void)
short __stdcall PollInputEvent(InputEventState *event, short filter)
void LoadVolumeSettingsFromRegistry(void)
void SaveVolumeSettingsToRegistry(void)
unsigned int house_keep(void)
short GetShipDistanceToNavPoint(short ship, MissionNavPoint *navPoint)
void SetMusicStreamVolume(unsigned short volume)
void ResetSoundStateForFlight(void)
int HandleSpaceFlightControls(void)
void rotate_about_i(short angle, FixedVector *j, FixedVector *k)
void ClearRoomMenuLabel(void)
void StartupHook(unsigned int(*callback)(unsigned int, short))
int set_up_action_sphere(short navPoint)
void __stdcall SetWholePaletteFromTriplets(unsigned char *palette)
unsigned short __stdcall AllocateViewport(Viewport *viewport, short clearColour, short flags)
unsigned int LoadOriginFxDrivers(void)
void UpdateRoomMenuCursor(void)
unsigned int force_view(int view, short obj)
unsigned int FadeFlightPaletteEntry(short *entry)
unsigned int free_inflight_music(void)
long Vector_magnitude(const FixedVector *vector)
unsigned int Draw_3Space_Frame(void)
void ResetSoundStateForScene(void)
void __stdcall GetPaletteEntry(short index, short *rgb)
unsigned int fire_players_lasers(void)
void __stdcall SetTextCursor(unsigned short a, unsigned short b)
void FigureArcadeTime(void)
unsigned int AbortToDesktop(void)
void ShowHudTextLine(char *s, unsigned short b)
void CalibrateJoystickInteractive()
int RunSpaceFlight(short entryNavPoint)
unsigned int RunAnimationDemoLoop(signed char animation)
void SetSpaceFlightFrameTiming(void)
unsigned int RestoreTransientCockpitGraphics(void)
void your_afterburner(void)
unsigned int PollKeyboardState(void)
void get_player_input(void)
unsigned int GetMessagePumpResult(void)
unsigned short __stdcall StepPaletteTransition(short *current, const short *target, short componentCount)
void init_player_input(void)
void auto_pilot_sequence(void)
unsigned int GetFixedOneMillionThunkAlt(short memoryType)
int fire_missile(short ship)
short FixedToShortSaturating(int value)
void FlushInputEvents(void)
void __stdcall SetPaletteEntry(short index, short *rgb)
short MinShort(short a, short b)
void ShowModalMessage(const char *format,...)
unsigned int TriggerPlayerHitPaletteFlash(void)
unsigned int house_keep_objects(void)
unsigned int clear_view_buffer(void)
unsigned int GetScreenUpdateFlag(void)
void ReportFramesSkipped(short adjustment)
unsigned int SelectNextExternalViewObject(void)
void InvalidateVduMode(short i)
int fire_fixed_projectile_weapon(short obj)
short find_objective(int type, short index)
int main(short argc, char **argv)
void __stdcall SetEventManagerPump(void(*pump)(void))
void BlitViewportScanlineRuns(Viewport *source, Viewport *destination, const ScreenViewportGeometry *geometry)
void ReadPerformanceCounter(LARGE_INTEGER *p)
void __stdcall SetTextContext(TextContext *context)
void QueueInputEvent(int type, int x, int y, int value, int primaryButton, int secondaryButton, unsigned int timestamp)
void DrawFilledViewportRect(Viewport *viewport, short left, short top, short right, short bottom, short colour)
unsigned int update_objects_in_space(void)
unsigned int UpdateSpacePaletteFade(void)
void CloseCommChoiceMenu(void)
void GetArcadeBonus(void)
unsigned int PumpWindowMessages(void)
void copy_frame(short source, short destination)
unsigned int EMShutDown(void)
char *__stdcall DosStrcpy(char *dst, const char *src)
void ResetMouseCursorFrame(void)
short __stdcall GetNextInputEvent(InputEventState *event)
unsigned int initialize_view_buffer(void)
short LoadWingCmdrCfgFile(short argc, char **argv)
unsigned short GetOriginalFreeMemory(void)
void update_cockpit(void)
void __stdcall ShutdownVideoHook(short mode)
void WaitForVerticalBlankThunk(void)
void __stdcall SetFrameTimerPeriodDirect(short p)
void ClearDebugPauseFlags(void)
unsigned int ResetCockpitPaletteEntries(void)
unsigned int Chosen_communicate_option(short choice)
void ShutdownHook(int vector, void *handler)
void __stdcall FadeViewportPaletteToColour(Viewport *viewport, unsigned short colour, short enabled)
unsigned int overlay_head_up_display(void)
void TranslatePolledInputEvent(unsigned short type, unsigned int value)
unsigned int init_inflight_music(void)
unsigned int GetF1KeyLatch(void)
void ExitCleanupHook(void)
unsigned int GetJoystickButtonEdge(unsigned int a, short b)
void draw_sorted_objects_to_buffer(void)
void __stdcall WarpMouseTo(short x, short y)
void ReportPacketLoadError(void *packet, short logicalFile, short retry, short section, const char *sourceTag)
void zero_vector(FixedVector *vector)
unsigned int ResetScreenClipToFullHeight(void)
short __stdcall UpdateInputDeviceTransitions(short raw)
int GetControlKeyState(void)
unsigned int update_star_field(void)
void ReportOutOfMemoryAndExit(const char *resource)
unsigned int place_exhaust_on_ships(void)
void sort_object_depth(void)
void SetHudTextColour(short v)
int any_enemy(short obj, short range)
short FindNearestNavPoint(short ship)
short MeasureMessageWidth(const char *text)
void ClearViewport(Viewport *viewport, short colour)
void exit_squadron(const char *msg)
void SetMessageDisplaySpeed(void)
unsigned int StartNewCampaign(short campaign)
void SetHudMessageText(char *text, unsigned short colour, unsigned short duration)
int drop_player_mine(short obj)
unsigned int reposition_fixed_child_objects(void)
unsigned int RefreshCockpitStatus(void)
unsigned int SelectPreviousExternalViewObject(void)
void PlaySfxWaveFileByNumber()
int calculate_damage_level(void)
unsigned int new_view(int view, short obj)
void transform_objects_to_your_view(void)
short __stdcall CollectActivePaletteIndices(Viewport *viewport, unsigned char *indices, short capacity)
unsigned int Update_3Space(void)
void SelectRoomMenuLabel(short i)
void __stdcall free_viewport(Viewport *viewport)
void flag_objective(short objective, unsigned char flags)
unsigned int GetStartupErrorCode(int vector)
unsigned int JoystickEdgeHook(int button)
void ReleasePacketHandle(void *handle)
void DrawArcadeScorePanel(short x, short y)
unsigned int init_mission(short series, short mission)
void ComputeVectorDelta(const FixedVector *from, const FixedVector *to, FixedVector *delta)
unsigned int ReleaseStaleNavTarget(void)
short GetCurrentDiskDriveHook(void)
void ShowVersionBanner(void)
void __stdcall SetViewportRect(Viewport *viewport, unsigned short left, unsigned short top, unsigned short right, unsigned short bottom)
void __stdcall SetMouseCursorShape(struct Shape *shape, short frame)
int GetShiftKeyState(void)
void FrameStartHook(int mode)
unsigned int set_eye_direction_and_position(void)
void FlushSoundEffectsAndLog(int soundHandle, short fadeTicks)
short MaxShort(short a, short b,...)
void accelerate(short amount)
unsigned int players_flight_dynamics(void)
void MessagePumpHook(int mode)
unsigned int ShowMemoryStatusDebug(void)
short __stdcall IsInputEventQueued(short type)
void ReleaseModalTextPanel(void)
void WaitForKeyAcknowledge(int mode)
void request(short requester, short ship, short command)
void RestoreCockpitExplosionIfVisible(void)
void SetSoundEffectsVolume(int volume)
unsigned int HandleFleetOverviewInput(void)
void WriteDebugString(const char *s)
void FatalErrorAndExit(const char *format,...)
unsigned int GetKeyboardModifiers(void)
void ResetCampaignData(void)
short __stdcall RandomInRange(short lo, short hi)
short __stdcall DosStrlen(const char *s)
void DrawFormattedText(const char *format,...)
unsigned short __stdcall GetShutdownErrorCode(unsigned char *driveState)
unsigned short LoadInstallDat(void)
void SelectCockpitVduMode(short vdu, int mode)
void SetCinematicFrameTiming(void)
void CopyViewportContents(Viewport *source, Viewport *destination)
short ShowModalTextPanel(short fontIndex, const char *format,...)
void UpdateArcadeScoreDisplay(void)
void rotate_about_j(short angle, FixedVector *i, FixedVector *k)
unsigned int InitializeConversationViewport(void)
unsigned int dump_buffer_to_screen(void)
short message_showing(void)
unsigned int player_input(void)
@ OBJECTIVE_HOLD_FORMATION
@ SPECIAL_MANEUVER_BLOWING_UP
@ SPECIAL_MANEUVER_AFTERBURNER
#define ACTIVE_MISSION_NAV_POINT_COUNT