18 0x30, 0x1d, 0x110, 0x6d
22 "BISHOP",
"GOBLIN",
"JEFFTEP",
"MANGLER",
"THE MAN",
"MONGO"
25 { 1, 47, 29, 67, 49 },
26 { 1, 47, 89, 67, 109 },
27 { 1, 251, 29, 271, 49 },
28 { 1, 251, 89, 271, 109 },
47 unsigned short colour;
158 for (outer = 0; outer < 6; outer++)
159 for (inner = (
short)(outer + 1); inner < 6; inner++)
179 }
while (index >= 0);
188 (
unsigned char)pilot, score);
212 }
while (candidate == 8);
213 for (previous = 0; previous < slot; previous++) {
218 }
while (candidate == -1);
247 *(
short *)&remaining = 3;
252 }
while (pilot == 8 ||
255 .personalityDeathMission[pilot] != 0) ||
264 while (scoreRange / scale > 30000)
265 scale = (short)(scale * 2);
267 (
short)(scoreRange / scale)) *
271 (*(
short *)&remaining)--;
272 }
while (*(
short *)&remaining != 0);
278 unsigned char savedBackground =
282 char cursor[2] = { character, 0 };
296 short characterWidth;
301 clearArea.
right = (short)(clearArea.
left + characterWidth - 1);
303 clearArea.
bottom = (short)(clearArea.
top +
329 unsigned int savedFrameState;
335 unsigned char savedBackground;
341 if (savedBackground == 0xff) {
354 inputViewport.
left = savedX;
355 inputViewport.
top = savedY;
356 inputViewport.
bottom = (short)(inputViewport.
top +
358 inputViewport.
right = (short)(inputViewport.
left +
384 inputViewport.
left = savedX;
385 inputViewport.
top = savedY;
386 inputViewport.
bottom = (short)(inputViewport.
top +
388 inputViewport.
right = (short)(inputViewport.
left +
397 if (key == 8 && inputLength != 0) {
403 input[inputLength] = 0;
405 if (maximumLength > inputLength &&
406 ((key >=
'A' && key <=
'Z') ||
407 (key >=
'a' && key <=
'z') ||
408 (key >=
'0' && key <=
'9') ||
409 (key ==
' ' && inputLength != 0))) {
412 key = (
unsigned char)toupper(key);
415 if (key <
'0' || key >
'9')
420 key = (
unsigned char)(key | 0x20);
429 input[inputLength++] = (char)key;
430 input[inputLength] = 0;
432 (
unsigned short)savedY);
442 }
while (handled == 0);
443 }
while (accepted == 0);
455 char *destination,
short maximumLength)
461 cursorX += *(
volatile short *)&x;
471 char *destination,
short maximumLength,
472 const char *defaultText)
517 struct Shape *backdrop;
525 "YOU HAVE A TOP SCORE!\n"
526 "PLEASE ENTER YOUR\n"
527 "NAME AND CALLSIGN:\n");
549 unsigned int previousScore;
551 unsigned int submittedScore;
558 submittedScore = score;
560 if ((
int)submittedScore > (
int)previousScore)
569 sprintf(message,
"*******\n"
571 "YOU HAVE SCORE NUMBER\n"
576 sprintf(message,
"> SORRY <\n\n"
577 "YOUR SCORE IS ONLY\n"
579 "PLEASE PLAY AGAIN!", submittedScore);
591 struct Shape *backdrop;
631 titleLeft = (short)((160 - titleWidth / 2) & 0xfffe);
634 (short)(titleLeft + titleWidth);
659 lineHeight = (short)(lineHeight + 3);
669 for (row = 0; row < 6; row++) {
672 sprintf(score,
"%0ld",
676 lineHeight * (row + 1) +
700 (
signed char)(opponent + 0x16);
711 struct Shape *shapes[4];
712 unsigned short cancelled;
713 short savedInputMode;
716 signed char selection;
719 unsigned char activate;
751 positions[0].x, positions[0].y, shapes[0], 0);
757 positions[1].x, positions[1].y, shapes[1], 0);
763 positions[2].x, positions[2].y, shapes[2], 0);
769 positions[3].x, positions[3].y, shapes[3], 0);
809 key = (short)event.
value;
810 if (key == 0x1c || key == 0x39) {
822 regionIndex = region;
823 if (regionIndex >= 0 && regionIndex <= 3)
824 selection = (
signed char)(region + 1);
829 }
while (selection == 0);
842 *mission = (short)(selection - 1);
843 return cancelled == 0;
849 unsigned int savedFrameState;
void(__cdecl *pIxFree)(void *)
unsigned char bEscapePressedFlag
TextContext stTrainSimTxtContext
Viewport stTrainSimulatorHighScoreBufView
HighScoreEntry aHighScoreEntriesArray[6]
signed char acPlayerComponentDamageList[9]
ObjectTypeData aObjectTypeData[OBJECT_TYPE_COUNT]
short aasShipMaximumShieldTable[10][2]
unsigned char cBlackColour
TextContext * pCurTextContext
short nArcadeBonusCountdown
signed char acShipDmg[10]
unsigned int bKeyEventQueueEnabled
TextContext stTrainSimHighScoreTextContext
unsigned char bInputModeState
MouseCursorState stMouseCursorState
short nArcadeTimeRemaining
int nArcadeWaveBonusValue
Viewport stCurrentTrainSimTitleDisplayViewport
short aasShipShield[10][2]
signed char cCurrentCockpitView
signed char cCockpitLogicalFile
char szDefaultTxtBuf[0xc8]
unsigned char cDefaultTextColour
CampaignState stCampaignState
TextContext stHudMessageTextContext
enum ObjectType aeObjectTypeList[SPACE_OBJECT_COUNT]
Viewport stModalSrcViewport
short nMenuInputRepeatDelay
signed char cCurrentObjResourceLogicalFile
Viewport stTrainSimHighScoreDisplayViewport
PilotRecord aPilotEntriesList[9]
TitleMenuRegion aTrainSimMissionRegions[5]
PilotRecord * currentPilot
unsigned char backgroundColour
unsigned char * apszBuiltInHighScoreNames[6]
ShortRect stTrainSimPanelBounds
Viewport stTrainSimPanelViewport
Umbrella header for the game core.
unsigned int free_cockpit(void)
void FormatTextBufferFromStart(const char *format,...)
void LeaveAllocationScope(void)
int DisplayTrainSimHighScoreTable(short phase)
unsigned short __stdcall GetFontCharWidth(char i)
void PollJoystickButtonEvents(void)
void UpdateTrainSimMenuCursor(void)
void MoveMenuPointerFromKeyboard(InputEventState *event)
unsigned int InitializeTextContextFromFont(TextContext *context, short fontIndex, unsigned char colour, signed char background)
short __stdcall PollInputEvent(InputEventState *event, short filter)
void AddRandomTrainSimHighScores(void)
short IsHighScoreSlotUsed(short i)
unsigned int free_3Space(void)
unsigned short __stdcall AllocateViewport(Viewport *viewport, short clearColour, short flags)
short FindTrainSimHighScore(short pilot)
int AnimateTrainSimTitle(void)
void * FetchDiskPacketRetrying(short logicalFile, short section, short flags)
void __stdcall SetTextCursor(unsigned short a, unsigned short b)
void FigureArcadeTime(void)
int RunSpaceFlight(short entryNavPoint)
void set_up_next_wave(void)
void ClearInputKeyStatePreservingModifiers(void)
short InsertTrainSimHighScore(short pilot, unsigned int score)
int FindMenuRegionAtPoint(short x, short y, const TitleMenuRegion *regions)
short ReadTextInput(char *destination, short maximumLength, short mode)
short __stdcall MeasureTextPixelWidthClamped(const char *text)
void DrawSpriteDefault(Viewport *viewport, short x, short y, struct Shape *shape, short frame)
int IsFrameTickElapsed(void)
void ShowTrainSimHighScores(void)
void FlushInputEvents(void)
void __stdcall AlignSpriteFrameToRectCorner(const ShortRect *rectangle, ShortPoint *position, short corner, struct Shape *shape, short frame)
short WaitForInputKey(void)
unsigned int PreloadMusicTrackHook(short track)
void InvalidateVduMode(short i)
short SelectTrainSimMission(short *mission)
void __stdcall SetEventManagerPump(void(*pump)(void))
void __stdcall SetTextContext(TextContext *context)
void DrawFilledViewportRect(Viewport *viewport, short left, short top, short right, short bottom, short colour)
void EnterAllocationScope(void)
void ReadRequiredPilotField(short x, short y, const char *label, char *destination, short maximumLength)
void InitializeTrainSimTextPanel(void)
unsigned int GetHighScoreValue(short i)
char *__stdcall DosStrcpy(char *dst, const char *src)
void __stdcall SetFrameTimerPeriodDirect(short p)
unsigned int ShowGetReadyScreen(void)
void __stdcall WarpMouseTo(short x, short y)
unsigned int ReleaseMusicTrackHook(short track)
void SortTrainSimHighScores(void)
struct Shape * LoadTrainSimOpponentShape(int opponent)
void ClearTextInputCharacter(short character)
short WaitForStreamInputKey(void)
short RandomBelow(short n)
unsigned int SetHighScoreEntry(short i, unsigned char b, unsigned int v)
void EnterPilotNameAndCallsign(void)
unsigned short EraseTextContextBackground(TextContext *context)
unsigned short __stdcall FontHeight(const void *p)
void WaitForFrameTick(void)
void ClearViewport(Viewport *viewport, short colour)
void PollMenuInputDevices(void)
short __stdcall GetShapeFrameBounds(short *bounds, short x, short y, struct Shape *shape, short frame)
void DrawTextInputCursor(char character)
unsigned int ShowVictoryScreen(void)
void __stdcall free_viewport(Viewport *viewport)
unsigned char * GetHighScoreEntry(short i)
void PromptForPilotField(short x, short y, const char *label, char *destination, short maximumLength, const char *defaultText)
void ShowTrainSimTextMessage(const char *message)
void ReleasePacketHandle(void *handle)
unsigned int init_mission(short series, short mission)
void __stdcall SetViewportRect(Viewport *viewport, unsigned short left, unsigned short top, unsigned short right, unsigned short bottom)
int GetShiftKeyState(void)
void __stdcall EventManagerHook(void(*callback)(void))
void EraseLastTextInputCharacter(void)
unsigned int ShowGameOverScreen(void)
unsigned int ReleaseTextFont(short fontIndex)
short __stdcall RandomInRange(short lo, short hi)
short __stdcall DosStrlen(const char *s)
void InitializeTrainSimHighScores(void)
void ClearNextTextInputCharacter(short character)
void DrawFormattedText(const char *format,...)
short RandomBelowOrEqual(short n)
char *__stdcall ResetStringBuilder(TextContext *context)
void CopyViewportContents(Viewport *source, Viewport *destination)
void UpdateTrainSimHighScores(int score)