Wing Commander II
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
personnel.c
Go to the documentation of this file.
1/*
2 * Personnel database, campaign chalkboard and pilot transfer.
3 *
4 * Retail object 0x433AD0-0x43775F (link order; see docs/ORDER.md).
5 */
6#include "game.h"
7
8unsigned char *g_pCockpitBackgroundPacket = 0; /* 0x0049a5f0 */
9unsigned char *g_apCockpitVduOverlayShapes[2] = { 0 }; /* 0x0049a5f8 */
10int g_nLegacySaveSource = 0; /* 0x0049a600 */
11const char *g_apszPilotRankNames[5] = {
12 "2ND LT.",
13 "1ST LT.",
14 "CAPTAIN",
15 "MAJOR",
16 "LT. COL."
17}; /* 0x0049a608 */
18const char *g_apszShortPilotRankNames[5] = {
19 "2ND LT",
20 "1ST LT",
21 "CAPT.",
22 "MAJOR",
23 "LT COL"
24}; /* 0x0049a620 */
25
26/* The save-slot signature is a 0x24-byte record, not a 34-byte string: the
27 * original writes 36 bytes from it, the string and the two NULs after it.
28 * Spelling the object at its record width keeps the write inside it. */
29static char g_szSaveSlotSignature[0x24] =
30 "Wing Commander II (c) 1991 Origin"; /* 0x0049a638 */
31
32PersonnelFileSlot *g_apPersonnelFileSlots[8] = { 0 }; /* 0x0049a660 */
33PilotProfile *g_apPersonnelPilotProfiles[8] = { 0 }; /* 0x0049a680 */
34short g_nPersonnelMenuHighlight = -1; /* 0x0049a6a0 */
35void *g_pPersonnelCampaignSnapshot = 0; /* 0x0049a6a4 */
36static char g_szPersonnelFileName[] = "savegame.wc2"; /* 0x0049a6a8 */
37unsigned char *g_pPersonnelMenuBackdrop = 0; /* 0x0049a6b8 */
38short g_sPersonnelPreviousInput = -128; /* 0x0049a6bc */
39short g_bPersonnelMenuDrawing = 1; /* 0x0049a6c0 */
40const char *g_apszSaveGameFileNames[3] = {
41 "savegame.wld",
42 "savegame.wld",
43 "crusade.wld"
44}; /* 0x0049a6c8 */
45signed char g_bPersonnelPrimaryInputDown = 0; /* 0x0049a6d4 */
46
47/* Keyboard scan codes of the personnel menus' hot keys and confirm keys. */
49 PERSONNEL_KEY_0 = 0x0b, /* file slot 0 */
50 PERSONNEL_KEY_W = 0x11, /* [W]ing Commander */
51 PERSONNEL_KEY_T = 0x14, /* [T]ransfer */
53 PERSONNEL_KEY_S = 0x1f, /* [S]ave */
54 PERSONNEL_KEY_D = 0x20, /* [D]elete, [D]os version */
55 PERSONNEL_KEY_L = 0x26, /* [L]oad */
56 PERSONNEL_KEY_C = 0x2e, /* [C]reate */
58};
59
60/* Function start: 0x433AD0 */
62{
63 InputEventState event;
64 short eventType;
65
67 (signed char)g_sPersonnelPreviousInput;
71 g_cCurrentKey |= (signed char)0x80;
73 }
74 if (IsInputEventQueued(5) != 0) {
75 g_cCurrentKey |= (signed char)0x80;
78 }
79 while ((eventType = GetNextInputEvent(&event)) != 0) {
80 switch (eventType) {
81 case 3:
84 break;
85 case 7:
86 break;
87 case 2:
88 break;
89 case 1:
91 (g_cCurrentKey = 0x1c);
92 if ((event.modifiers & 1) != 0) {
94 (g_cCurrentKey = 0x1c);
95 }
96 if ((event.modifiers & 2) != 0) {
98 (g_cCurrentKey = 0x1c);
99 }
100 break;
101 case 4:
102 case 6:
104 (g_cCurrentKey = (signed char)event.status);
105 break;
106 }
107 }
108 if ((int)g_cPreviousKey ==
110 g_cCurrentKey = (signed char)0x80;
111 }
112}
113
114/* Function start: 0x433C84 */
115void InitializeCampaignChalkboardScreen(short cockpitVariant)
116{
117 void *workspace;
118 short frame;
119
121 (unsigned char *)0xa000) {
123 }
129 if ((short)AllocateViewport(
133 }
134 g_1_nCockpitArchiveVariantNumber = cockpitVariant;
136 "options.v00",
137 (short)(g_1_nCockpitArchiveVariantNumber * 3), 0);
140 frame = 1;
142 } else {
143 frame = 2;
144 }
146 frame = 1;
149 (unsigned short)frame);
157 workspace = AllocateTaggedMemory(0xce, 0x40);
158 if (workspace != 0) {
163 0x3c, 1, workspace);
164 while (AdvanceViewportWipe(workspace) == 0) {
165 }
166 ReleasePacketHandle(workspace);
167 }
168 }
177}
178
179/* Function start: 0x433E8C */
180void RefreshCampaignChalkboardScreen(short cockpitVariant)
181{
182 short frame;
183
184 (void)cockpitVariant;
188 frame = 1;
189 } else {
190 frame = 2;
191 }
192 DrawCampaignChalkboardFrame((unsigned short)frame);
193}
194
195/* Function start: 0x433ED7 */
218
219/* Function start: 0x433F94 */
220void DrawPersonnelMenuBackdrop(void *scenePacket)
221{
222 short selection;
223
224 selection = 0;
229 selection = PollSceneHotspotInput(scenePacket, 0, 0, 0, 0);
232 if (g_pszPersonnelFooter != 0) {
234 (unsigned short)((320 -
236 g_pszPersonnelFooter)) >> 1),
237 180);
239 }
240}
241
242#pragma function(strcpy)
243/* Function start: 0x434043 */
245{
246 int campaignBytes;
247 short loadedCampaign;
248 short file;
249
251 campaignBytes = (unsigned int)g_pCampaignGlobals->wordCount * 2;
253 if (file < 0)
255 SeekDataFile((unsigned short)file, (campaignBytes + 0x86) << 3, 0);
256 SeekDataFile((unsigned short)file, 2, 1);
257 ReadDataFileAtOffset((unsigned short)file, -1, 0x60,
259 SeekDataFile((unsigned short)file, 0x24, 1);
260 ReadDataFileAtOffset((unsigned short)file, -1, campaignBytes,
262 CloseDataFile((unsigned short)file);
270 loadedCampaign = g_pCampaignGlobals->campaignSlot;
272 return loadedCampaign;
273}
274
275/* Function start: 0x434177 */
276unsigned short HasSavedPilotCampaign(void)
277{
278 struct _finddata_t findData;
279 int stateBytes;
280 short occupied;
281 short file;
282 short findHandle;
283
285 stateBytes = (unsigned short)g_pCampaignGlobals->wordCount * 2;
287 findHandle = (short)_findfirst(g_szPersonnelFileName, &findData);
288 if (findHandle == -1 ||
289 (stateBytes + 0x86) * 9 != findData.size)
290 return 0;
291 _findclose((long)findHandle);
292 file = (short)_open(g_szPersonnelFileName, 0x8000);
293 if (file < 0)
294 return 0;
295 /* The complements preserve the offset and make CL 4.1 evaluate it
296 * before lseek, as in retail; neither complement emits an instruction. */
297 if (~~((stateBytes + 0x86) << 3) !=
298 lseek((int)file, (stateBytes + 0x86) << 3, 0)) {
299 _close((int)file);
300 return 0;
301 }
302 if (_read((int)file, &occupied, 2) != 2) {
303 _close((int)file);
304 return 0;
305 }
306 _close((int)file);
307 if (occupied == 0)
308 return 0;
309 return 1;
310}
311
312/* Function start: 0x4342E8 */
313void OpenDiskDataFile(short logicalFile)
314{
315 struct _finddata_t findData;
316 unsigned int stateBytes;
317 short blank;
318 short searchHandle;
319 short inUse;
320 short index;
321 short file;
322
323 inUse = 1;
324 blank = 0;
325 if (logicalFile != 0) {
327 }
328 stateBytes =
329 (unsigned int)g_pCampaignGlobals->wordCount * 2;
330 searchHandle = (short)_findfirst(g_szPersonnelFileName, &findData);
331 if (searchHandle == -1 ||
332 (stateBytes + 0x86) * 9 != findData.size) {
334 if (file < 0) {
336 }
337 for (index = 0; index < 9; index++) {
338 WriteDataFileAtOffset(file, -1, 2, &blank);
339 WriteDataFileAtOffset(file, -1, 0x60,
342 file, -1, sizeof(g_szSaveSlotSignature),
344 WriteDataFileAtOffset(file, -1, stateBytes,
346 }
347 CloseDataFile(file);
348 }
349 _findclose((long)searchHandle);
351 if (file < 0) {
353 }
360 SeekDataFile(file, (stateBytes + 0x86) << 3, 0);
361 WriteDataFileAtOffset(file, -1, 2, &inUse);
362 WriteDataFileAtOffset(file, -1, 0x60,
366 WriteDataFileAtOffset(file, -1, stateBytes,
368 CloseDataFile(file);
369 if (logicalFile != 0) {
371 }
372}
373
374/* Function start: 0x43456E */
376{
377 Viewport savedViewport;
378
379 savedViewport = *viewport;
380 DrawSpriteDefault(&savedViewport, 0, 0,
382}
383
384/* Function start: 0x4345A1 */
385void DrawPilotSaveMenuChoices(short choice)
386{
387 if (choice == g_nPersonnelMenuHighlight)
388 return;
390 if (choice == PERSONNEL_KEY_L) {
393 (unsigned char)g_nMenuSelectedCol, -1);
394 } else {
397 (unsigned char)g_10_nMenuDarkColour, -1);
398 }
399 SetTextCursor(0x5a, 0x38);
400 DrawFormattedText("[L]oad a personnel file");
401 if (choice == PERSONNEL_KEY_S) {
404 (unsigned char)g_nMenuSelectedCol, -1);
405 } else {
408 (unsigned char)g_10_nMenuDarkColour, -1);
409 }
410 SetTextCursor(0x5a, 0x4c);
411 DrawFormattedText("[S]ave a personnel file");
412 if (choice == PERSONNEL_KEY_D) {
415 (unsigned char)g_nMenuSelectedCol, -1);
416 } else {
419 (unsigned char)g_10_nMenuDarkColour, -1);
420 }
421 SetTextCursor(0x5a, 0x60);
422 DrawFormattedText("[D]elete a personnel file");
425}
426
427void DrawFormattedText(const char *format, ...);
428
429/* Function start: 0x4346E9 */
431{
432 if (choice == g_nPersonnelMenuHighlight)
433 return;
435 if (choice == PERSONNEL_KEY_W) {
438 (unsigned char)g_nMenuSelectedCol, -1);
439 } else {
442 (unsigned char)g_10_nMenuDarkColour, -1);
443 }
444 SetTextCursor(0x50, 0x2e);
445 DrawFormattedText("[W]ing Commander");
446 if (choice == PERSONNEL_KEY_D) {
449 (unsigned char)g_nMenuSelectedCol, -1);
450 } else {
453 (unsigned char)g_10_nMenuDarkColour, -1);
454 }
455 SetTextCursor(0x50, 0x42);
456 DrawFormattedText("[D]os Version of Wing Commander");
459}
460
461void InitializeTextContextFromFont(TextContext *context, short fontIndex, unsigned char colour, signed char background);
462
463/* Function start: 0x4347D6 */
464void DrawPersonnelMenuChoices(short choice)
465{
466 if (g_nPersonnelMenuHighlight == choice)
467 return;
469 if (choice == PERSONNEL_KEY_T) {
472 (unsigned char)g_nMenuSelectedCol, -1);
473 } else {
476 (unsigned char)g_10_nMenuDarkColour, -1);
477 }
478 SetTextCursor(0x3c, 0x38);
479 DrawFormattedText("[T]ransfer an existing personnel file");
480 if (choice == PERSONNEL_KEY_C) {
483 (unsigned char)g_nMenuSelectedCol, -1);
484 } else {
487 (unsigned char)g_10_nMenuDarkColour, -1);
488 }
489 SetTextCursor(0x3c, 0x4c);
490 DrawFormattedText("[C]reate a new personnel file");
493}
494
495#pragma function(strlen)
496/* Function start: 0x4348C3 */
497void DrawPersonnelFileSlot(short slot)
498{
499 if (g_apPersonnelFileSlots[slot]->occupied == 0) {
500 SetTextCursor(0x32, (unsigned short)(slot * 12 + 0x12));
502 "%d ----------------------------------------------------------",
503 slot);
504 return;
505 }
506
507 SetTextCursor(0x32, (unsigned short)(slot * 12 + 0x12));
508 if (strlen(g_apPersonnelPilotProfiles[slot]->lastName) +
509 strlen(g_apPersonnelPilotProfiles[slot]->callsign) +
510 strlen(g_apPersonnelPilotProfiles[slot]->firstName) >
511 0x16) {
513 "%d--%s %c. \"%s\" %s",
514 slot,
516 g_apPersonnelPilotProfiles[slot]->rank],
517 g_apPersonnelPilotProfiles[slot]->firstName[0],
518 g_apPersonnelPilotProfiles[slot]->callsign,
519 g_apPersonnelPilotProfiles[slot]->lastName);
520 } else {
522 "%d--%s %s \"%s\" %s",
523 slot,
525 g_apPersonnelPilotProfiles[slot]->rank],
526 g_apPersonnelPilotProfiles[slot]->firstName,
527 g_apPersonnelPilotProfiles[slot]->callsign,
528 g_apPersonnelPilotProfiles[slot]->lastName);
529 }
530 SetTextCursor(0xc6, (unsigned short)(slot * 12 + 0x12));
532 "%d",
533 g_apPersonnelPilotProfiles[slot]->field_41);
534 SetTextCursor(0xde, (unsigned short)(slot * 12 + 0x12));
536 "%d",
537 g_apPersonnelPilotProfiles[slot]->field_43);
538 SetTextCursor(0x36, (unsigned short)(slot * 12 + 0x18));
540 "%s",
541 g_apPersonnelFileSlots[slot]->description);
542}
543
544void DrawTransferredPilotRow(short row);
545
546/* Function start: 0x434ACE */
548{
549 short slot;
550
551 if (choice == g_nPersonnelMenuHighlight)
552 return;
553 if (choice == PERSONNEL_KEY_0) {
554 slot = 0;
555 } else {
556 slot = (short)(choice - 1);
557 }
559 if (choice != -1) {
562 (unsigned char)g_nMenuSelectedCol, -1);
564 }
565 if (g_nPersonnelMenuHighlight != -1) {
568 (unsigned char)g_10_nMenuDarkColour, -1);
570 slot = 0;
571 } else {
572 slot = (short)(g_nPersonnelMenuHighlight - 1);
573 }
575 }
578}
579
580/* Function start: 0x434BB5 */
582{
583 short hover;
584 short index;
585
588 (unsigned char)
590 -1);
591 for (index = 0; index < 8; index++) {
593 }
595 hover = 0x0b;
598 g_cCurrentKey = (signed char)0x80;
599 SetPersonnelMousePosition(0xdc, 0x12);
600 while (g_cCurrentKey == (signed char)0x80) {
606 hover = 0x0b;
610 } else if (g_37_stPersonnelMousePointerState.y >= 0x1d &&
612 hover = (short)((g_37_stPersonnelMousePointerState.y - 0x1d) /
613 12 + 2);
617 } else {
618 hover = -1;
622 }
623 } else {
624 hover = -1;
628 }
636 hover != -1) {
637 g_cCurrentKey = (signed char)hover;
638 }
639 if (g_cCurrentKey == 1 ||
642 hover == -1)) {
643 return -1;
644 }
645 switch (g_cCurrentKey) {
646 case 11:
647 return 0;
648 case 2:
649 return 1;
650 case 3:
651 return 2;
652 case 4:
653 return 3;
654 case 5:
655 return 4;
656 case 6:
657 return 5;
658 case 7:
659 return 6;
660 case 8:
661 return 7;
662 }
663 g_cCurrentKey = (signed char)0x80;
664 }
665 /* Retail falls off the end here; EAX still holds the key loaded by
666 * the loop test. */
667}
668
669/* The transfer-list routines: one row per transferable pilot. */
670void DrawTransferredPilotRow(short row);
671void HighlightTransferredPilot(short choice);
672short SelectTransferredPilot(short count);
673
674/* Function start: 0x434EBC */
676{
677 SetTextCursor(0x32, (unsigned short)(row * 10 + 0x1e));
678 DrawFormattedText("%d", row);
679 SetTextCursor(0x3c, (unsigned short)(row * 10 + 0x1e));
681 SetTextCursor(0xc4, (unsigned short)(row * 10 + 0x1e));
684 SetTextCursor(0xda, (unsigned short)(row * 10 + 0x1e));
687}
688
689void SetTextCursor(unsigned short a, unsigned short b);
690void CopyHugeMemoryOverlapSafe(void *destination, void *source, int count);
691void DrawPersonnelMenuBackdrop(void *scenePacket);
692
693/* Function start: 0x434F7D */
695{
696 short row;
697
698 if (choice == g_nPersonnelMenuHighlight)
699 return;
700 if (choice == PERSONNEL_KEY_0) {
701 row = 0;
702 } else {
703 row = (short)(choice - 1);
704 }
706 if (choice != -1) {
709 (unsigned char)g_nMenuSelectedCol, -1);
711 }
712 if (g_nPersonnelMenuHighlight != -1) {
715 (unsigned char)g_10_nMenuDarkColour, -1);
717 row = 0;
718 } else {
719 row = (short)(g_nPersonnelMenuHighlight - 1);
720 }
722 }
725}
726
727/* Function start: 0x435064 */
728short SelectTransferredPilot(short count)
729{
730 short hover;
731 short index;
732
736 (unsigned char)
738 -1);
739 SetTextCursor(0x32, 0x0f);
740 DrawFormattedText("Select a character to transfer");
741 SetTextCursor(0xba, 0x16);
742 DrawFormattedText("Missions Kills");
744 (unsigned char)
746 -1);
747 for (index = 0; index < count; index++) {
749 }
751 hover = 0x0b;
754 g_cCurrentKey = (signed char)0x80;
755 SetPersonnelMousePosition(0xdc, 0x12);
756 while (g_cCurrentKey == (signed char)0x80) {
762 hover = 0x0b;
766 } else if (g_37_stPersonnelMousePointerState.y >= 0x28 &&
768 (count - 2) * 10 + 0x31) {
769 hover = (short)((g_37_stPersonnelMousePointerState.y - 0x28) /
770 10 + 2);
774 } else {
775 hover = -1;
778 0);
779 }
780 } else {
781 hover = -1;
785 }
793 hover != -1) {
794 g_cCurrentKey = (signed char)hover;
795 }
796 if (g_cCurrentKey == 1 ||
799 hover == -1)) {
800 return -1;
801 }
802 switch (g_cCurrentKey) {
803 case 11:
804 return 0;
805 case 2:
806 return 1;
807 case 3:
808 return 2;
809 case 4:
810 return 3;
811 case 5:
812 return 4;
813 case 6:
814 return 5;
815 case 7:
816 return 6;
817 case 8:
818 return 7;
819 }
820 g_cCurrentKey = (signed char)0x80;
821 }
822 /* Retail falls off the end here; EAX still holds the key loaded by
823 * the loop test. */
824}
825
826/* Function start: 0x4353D4 */
828{
829 struct _finddata_t fileSearchData;
830 int campaignBytes;
831 char reply;
832 short confirm;
833 short file;
834 short i;
835 short hover;
836 short redrawFlag;
837 short finishedMenu;
838 short slot;
839
840 finishedMenu = 0;
841 redrawFlag = 0;
843 "options.v00",
844 (short)(g_1_nCockpitArchiveVariantNumber * 3 + 1), 0);
851 campaignBytes = g_pCampaignGlobals->wordCount * 2;
853 AllocateTaggedMemory(campaignBytes, 0x40);
856 }
857
858 /* The find handle shares storage with the menu's exit flag; the
859 * original reuses the same short once the file has been sized. */
860 finishedMenu = (short)_findfirst(g_szPersonnelFileName, &fileSearchData);
861 if (finishedMenu == -1 ||
862 (campaignBytes + 0x86) * 9 != fileSearchData.size) {
863 file = (short)_open(g_szPersonnelFileName, 0x8301, 0x180);
864 if (file < 0) {
866 }
869 campaignBytes);
870 for (i = 0; i < 9; i++) {
871 _write(file, &redrawFlag, 2);
872 _write(file, &g_stDefaultPilotProfile, 0x60);
873 _write(file, g_szSaveSlotSignature,
874 sizeof(g_szSaveSlotSignature));
875 _write(file, g_pPersonnelCampaignSnapshot,
876 campaignBytes);
877 }
878 _close(file);
879 }
880 _findclose((long)finishedMenu);
881
882 file = (short)_open(g_szPersonnelFileName, 0x8000);
883 for (i = 0; i < 8; i++) {
885 AllocateTaggedMemory(0x26, 0x40);
886 if (g_apPersonnelFileSlots[i] == 0) {
888 }
890 AllocateTaggedMemory(0x60, 0x40);
891 if (g_apPersonnelPilotProfiles[i] == 0) {
893 }
894 _read(file, g_apPersonnelFileSlots[i], 2);
895 _read(file, g_apPersonnelPilotProfiles[i], 0x60);
896 _read(file, g_apPersonnelFileSlots[i]->description,
897 0x24);
899 campaignBytes);
900 }
901 _close(file);
902
903 finishedMenu = 0;
904 SetPersonnelMousePosition(0xc8, 0x36);
905 while (finishedMenu == 0) {
915 (unsigned char)g_10_nMenuDarkColour, -1);
916 SetTextCursor(0x50, 0x12);
917 DrawFormattedText("TERRAN CONFEDERATION NAVY");
918 SetTextCursor(0x60, 0x1c);
919 DrawFormattedText("PERSONNEL DATABASE");
920 hover = 0x26;
925 g_cCurrentKey = (signed char)0x80;
926 while (g_cCurrentKey == (signed char)0x80) {
932 hover = 0x26;
936 } else if (g_37_stPersonnelMousePointerState.y >= 0x44 &&
938 hover = 0x1f;
942 } else if (g_37_stPersonnelMousePointerState.y >= 0x58 &&
944 hover = 0x20;
948 } else {
949 hover = -1;
953 }
954 } else {
955 hover = -1;
959 }
965 redrawFlag = 0;
968 hover != -1) {
969 g_cCurrentKey = (signed char)hover;
970 }
971 if (g_cCurrentKey == 1 ||
974 hover == -1)) {
975 finishedMenu++;
976 redrawFlag++;
977 }
978 switch (toupper(g_cCurrentKey)) {
979 case PERSONNEL_KEY_L:
980 redrawFlag = 1;
987 (unsigned char)g_10_nMenuDarkColour, -1);
988 SetTextCursor(0x50, 0x0c);
989 DrawFormattedText("Select a game to load");
990 SetTextCursor(0xb8, 0x0c);
991 DrawFormattedText("Missions Kills");
993 if (slot != -1 &&
994 g_apPersonnelFileSlots[slot]->occupied != 0) {
995 file = (short)_open(g_szPersonnelFileName,
996 0x8000);
997 if (file >= 0) {
998 /* Keep the slot-size addition signed so CL 4.1 does
999 * not fold it into the following profile size. */
1000 lseek(file,
1001 (campaignBytes + (int)sizeof(PersonnelFileSlot) +
1002 sizeof(PilotProfile)) * slot, 0);
1003 _read(file, g_apPersonnelFileSlots[slot], 2);
1004 _read(file, g_apPersonnelPilotProfiles[slot],
1005 0x60);
1006 _read(file,
1007 g_apPersonnelFileSlots[slot]->description,
1008 0x24);
1017 if (g_nOriginDevUnlock != 0) {
1018 strcpy(
1019 g_apPersonnelPilotProfiles[slot]->callsign,
1020 "CHEATER");
1021 }
1032 _read(file, g_pPersonnelCampaignSnapshot,
1033 campaignBytes);
1037 campaignBytes);
1038 _close(file);
1039 } else {
1040 ReportFatalErrorCode("011");
1041 }
1042 }
1043 break;
1044 case PERSONNEL_KEY_D:
1045 redrawFlag = 1;
1052 (unsigned char)g_10_nMenuDarkColour, -1);
1053 SetTextCursor(0xb8, 0x0c);
1054 DrawFormattedText("Missions Kills");
1055 SetTextCursor(0x50, 0x0c);
1056 DrawFormattedText("Select a slot to delete");
1057 slot = SelectPersonnelFileSlot();
1058 if (slot != -1 &&
1059 g_apPersonnelFileSlots[slot]->occupied != 0) {
1065 (unsigned char)g_10_nMenuDarkColour, -1);
1066 confirm = 1;
1067 SetTextCursor(0x32, 0x32);
1068 DrawFormattedText("Are you sure?");
1071 (unsigned char)g_nMenuSelectedCol,
1072 (unsigned char)g_3_nOptionMessageColour);
1073 SetTextCursor(0x6a, 0x32);
1074 DrawFormattedText("Yes");
1076 reply = (char)WaitForQueuedInputPress();
1077 while (reply != 0x0d) {
1078 SetTextCursor(0x6a, 0x32);
1079 if (toupper(reply) == 'Y') {
1080 DrawFormattedText("Yes");
1081 confirm = 1;
1082 } else {
1083 DrawFormattedText("No ");
1084 confirm = 0;
1085 }
1087 reply = (char)WaitForQueuedInputPress();
1088 }
1089 if (confirm != 0) {
1091 file = (short)_open(g_szPersonnelFileName, 0x8001);
1092 lseek(file,
1093 (campaignBytes + (int)sizeof(PersonnelFileSlot) +
1094 sizeof(PilotProfile)) * slot, 0);
1095 _write(file,
1096 g_apPersonnelFileSlots[slot], 2);
1097 _close(file);
1098 }
1099 }
1100 break;
1101 case PERSONNEL_KEY_S:
1102 redrawFlag = 1;
1108 (unsigned char)g_10_nMenuDarkColour, -1);
1109 SetTextCursor(0xb8, 0x0c);
1110 DrawFormattedText("Missions Kills");
1111 SetTextCursor(0x50, 0x0c);
1112 DrawFormattedText("Select a slot to save in");
1114 slot = SelectPersonnelFileSlot();
1115 if (slot != -1) {
1122 (unsigned char)g_10_nMenuDarkColour, -1);
1123 confirm = 1;
1124 if (g_apPersonnelFileSlots[slot]->occupied != 0) {
1125 SetTextCursor(0x32, 0x32);
1126 DrawFormattedText("Are you sure?");
1129 (unsigned char)g_nMenuSelectedCol,
1130 (unsigned char)g_3_nOptionMessageColour);
1131 SetTextCursor(0x6a, 0x32);
1132 DrawFormattedText("Yes");
1134 reply = (char)WaitForQueuedInputPress();
1135 while (reply != 0x0d) {
1136 SetTextCursor(0x6a, 0x32);
1137 if (toupper(reply) == 'Y') {
1138 DrawFormattedText("Yes");
1139 confirm = 1;
1140 } else {
1141 DrawFormattedText("No ");
1142 confirm = 0;
1143 }
1145 reply = (char)WaitForQueuedInputPress();
1147 }
1148 }
1151 (unsigned char)g_10_nMenuDarkColour, -1);
1152 if (confirm != 0) {
1154 g_apPersonnelFileSlots[slot]->description[0] = 0;
1155 SetTextCursor(0x32, 0x46);
1156 DrawFormattedText("%s", "Saved game comments:");
1160 (unsigned char)g_nMenuSelectedCol, -1);
1162 0x32, 0x4c, 2, "",
1163 g_apPersonnelFileSlots[slot]->description,
1164 0x20, 0, 0);
1165 strcpy(g_apPersonnelPilotProfiles[slot]->firstName,
1167 strcpy(g_apPersonnelPilotProfiles[slot]->lastName,
1169 strcpy(g_apPersonnelPilotProfiles[slot]->callsign,
1177 file = (short)_open(g_szPersonnelFileName, 0x8001);
1178 lseek(file,
1179 (campaignBytes + (int)sizeof(PersonnelFileSlot) +
1180 sizeof(PilotProfile)) * slot, 0);
1181 _write(file, g_apPersonnelFileSlots[slot], 2);
1182 _write(file, g_apPersonnelPilotProfiles[slot],
1183 0x60);
1184 _write(file,
1185 g_apPersonnelFileSlots[slot]->description,
1186 0x24);
1189 g_pCampaignGlobals, campaignBytes);
1190 _write(file, g_pPersonnelCampaignSnapshot,
1191 campaignBytes);
1192 _close(file);
1193 }
1194 }
1195 break;
1196 }
1197 if (redrawFlag != 0) {
1198 g_cCurrentKey = 0;
1199 }
1200 }
1201 g_cCurrentKey = (signed char)0x80;
1202 }
1203
1210 for (i = 0; i < 8; i++) {
1213 }
1214}
1215
1216/* Function start: 0x43641C */
1218{
1219 short choice;
1220 short done;
1221 short handled;
1222 short focus;
1223
1224 done = 0;
1225 choice = -1;
1227 SetPersonnelMousePosition(200, 0x2c);
1228 while (done == 0) {
1231 (unsigned char)g_10_nMenuDarkColour, -1);
1232 SetTextCursor(0x3c, 0x1e);
1233 DrawFormattedText("Transfer a character from:");
1238 g_cCurrentKey = (signed char)0x80;
1239 while (g_cCurrentKey == (signed char)0x80) {
1245 focus = PERSONNEL_KEY_W;
1249 } else if (g_37_stPersonnelMousePointerState.y >= 0x3a &&
1251 focus = PERSONNEL_KEY_D;
1255 } else {
1256 focus = -1;
1260 }
1261 } else {
1262 focus = -1;
1265 0);
1266 }
1272 handled = 0;
1273 choice = -1;
1276 focus != -1) {
1277 g_cCurrentKey = (signed char)focus;
1278 }
1279 if (g_cCurrentKey == 1 ||
1282 focus == -1)) {
1283 done++;
1284 handled++;
1285 }
1286 switch (toupper((int)g_cCurrentKey)) {
1287 case PERSONNEL_KEY_W:
1288 choice = 0;
1289 done++;
1290 handled++;
1292 break;
1293 case PERSONNEL_KEY_D:
1294 choice = 0;
1295 done++;
1296 handled++;
1298 break;
1299 }
1300 if (handled != 0) {
1301 g_cCurrentKey = 0;
1302 }
1303 }
1304 }
1306 return choice;
1307}
1308
1309#pragma function(strcat)
1310/* Function start: 0x436722 */
1311short LocateLegacySaveGame(short source)
1312{
1313 unsigned int isAlnum;
1314 short pathEntered;
1315 struct _finddata_t findData;
1316 short handle;
1317 const char *nameList[3] = {
1318 "Wing Commander",
1319 "Secret Missions 1",
1320 "Crusade:Secret Missions 2"
1321 };
1322 char *installedPath;
1323 short driveIndex;
1324 short index;
1325
1328 (unsigned char)g_10_nMenuDarkColour, -1);
1329 if (g_nLegacySaveSource == 0) {
1330 installedPath = GetLegacyGameDataPath();
1331 if (installedPath != 0) {
1332 strcpy(g_1_szLegacySaveFolder, installedPath);
1333 } else {
1334 strcpy(g_1_szLegacySaveFolder, "");
1335 }
1336 } else {
1337 strcpy(g_1_szLegacySaveFolder, "");
1339 SetTextCursor(0x32, 0x28);
1340 DrawFormattedText("Please enter the full path name of");
1341 SetTextCursor(0x32, 0x34);
1342 DrawFormattedText("your %s saved game file.", nameList[source]);
1343 SetTextCursor(0x32, 0x40);
1344 DrawFormattedText("Example: c:\\wing\\gamedat");
1347 pathEntered = ReadPersonnelTextField(
1348 0x32, 0x50, 2, "Path name: ",
1349 g_1_szLegacySaveFolder, 0x19, 0, 1);
1351 }
1352 if (pathEntered == 0) {
1353 return 0;
1354 }
1355 if (strlen(g_1_szLegacySaveFolder) >= 2) {
1356 for (index = (short)(strlen(g_1_szLegacySaveFolder) - 1);
1357 index >= 0; index--) {
1358 if (g_1_szLegacySaveFolder[index] == '\\')
1359 break;
1360 isAlnum = isalnum(g_1_szLegacySaveFolder[index]);
1361 if (isAlnum != 0) {
1362 strcat(g_1_szLegacySaveFolder, "\\");
1363 break;
1364 }
1365 }
1366 }
1368 g_apszSaveGameFileNames[source]);
1369 for (index = 0;
1370 strlen(g_1_szLegacySaveFolder) > (unsigned int)index;
1371 index++) {
1372 if (g_1_szLegacySaveFolder[index] == ':') {
1373 if (index == 0) {
1374 return 0;
1375 }
1376 driveIndex = (short)(toupper(
1377 g_1_szLegacySaveFolder[index - 1]) - 'A');
1378 PersonnelDriveHook(driveIndex);
1379 }
1380 }
1381 handle = (short)_findfirst(g_1_szLegacySaveFolder, &findData);
1382 if (handle == -1) {
1383 return 0;
1384 }
1385 return 1;
1386}
1387
1388/* Function start: 0x436A4D */
1390{
1392 SetTextCursor(0x50, 0x3c);
1393 DrawFormattedText("No valid characters found.");
1395 g_cCurrentKey = (signed char)0x80;
1397}
1398
1399/* Function start: 0x436A8F */
1401{
1402 short finishedDatabase = 0;
1403 short actionHandledFlag = 0;
1404 char firstNameText[13] = "Christopher";
1405 char surname[13] = "Blair";
1406 char callsign[13] = "Maverick";
1407 short accepted = 0;
1408 char captionBuffer[80];
1409 SaveGameDiskRecord *record;
1410 PilotRecord *pilotRecord;
1411 short handle;
1412 short inputResult;
1413 short transferCount;
1414 short saveSlot;
1415 short choice;
1416 short selectedPilotIndex;
1417 short hoverCommand;
1418 short driveToRestore;
1419
1424 if ((short)AllocateViewport(
1427 ReportFatalErrorCode("012");
1428 }
1436 "options.v00", (short)(g_1_nCockpitArchiveVariantNumber * 3 + 1),
1437 0);
1444 record = AllocateTaggedMemory(0x33c, 0x40);
1445 if (record == 0) {
1446 ReportFatalErrorCode("013");
1447 }
1448 for (saveSlot = 0; saveSlot < 8; saveSlot++) {
1450 AllocateTaggedMemory(0x50, 0x40);
1451 if (g_3_apszPersonnelImportCaptionsTable[saveSlot] == 0) {
1452 ReportFatalErrorCode("014");
1453 }
1454 }
1456 while (finishedDatabase == 0) {
1466 (unsigned char)g_10_nMenuDarkColour, -1);
1467 SetTextCursor(0x50, 0x12);
1468 DrawFormattedText("TERRAN CONFEDERATION NAVY");
1469 SetTextCursor(0x60, 0x1c);
1470 DrawFormattedText("PERSONNEL DATABASE");
1471 hoverCommand = 0x26;
1473 DrawPersonnelMenuChoices(hoverCommand);
1475 SetPersonnelMousePosition(200, 0x36);
1477 g_cCurrentKey = (signed char)0x80;
1478 while (g_cCurrentKey == (signed char)0x80) {
1484 hoverCommand = 0x14;
1485 DrawPersonnelMenuChoices(hoverCommand);
1488 } else if (g_37_stPersonnelMousePointerState.y >= 0x44 &&
1490 hoverCommand = 0x2e;
1491 DrawPersonnelMenuChoices(hoverCommand);
1494 } else {
1495 hoverCommand = -1;
1496 DrawPersonnelMenuChoices(hoverCommand);
1499 }
1500 } else {
1501 hoverCommand = -1;
1502 DrawPersonnelMenuChoices(hoverCommand);
1504 0);
1505 }
1511 actionHandledFlag = 0;
1514 hoverCommand != -1) {
1515 g_cCurrentKey = (signed char)hoverCommand;
1516 }
1519 hoverCommand == -1) {
1520 finishedDatabase++;
1521 actionHandledFlag++;
1522 }
1523 switch (toupper((int)g_cCurrentKey)) {
1524 case PERSONNEL_KEY_T:
1525 driveToRestore = 99;
1526 actionHandledFlag = 1;
1533 (unsigned char)g_10_nMenuDarkColour, -1);
1534 choice = SelectLegacyGameSource();
1535 if (choice == -1) {
1536 accepted = 0;
1537 } else {
1538 finishedDatabase = (short)LocateLegacySaveGame(choice);
1539 if (finishedDatabase == 0) {
1541 accepted = 0;
1542 g_cCurrentKey = 0x14;
1543 } else {
1544 handle = (short)_open(g_1_szLegacySaveFolder,
1545 0x8000);
1546 transferCount = 0;
1547 for (saveSlot = 0; saveSlot < 8; saveSlot++) {
1548 _read(handle, record, 0x33c);
1549 if (record->occupied != 0 &&
1550 record->campaign.campaignIndex ==
1551 choice) {
1552 pilotRecord = &record->pilots[8];
1553 strcpy(
1555 transferCount],
1557 pilotRecord->rank]);
1558 strcat(
1560 transferCount],
1561 " \"");
1562 strcat(
1564 transferCount],
1565 pilotRecord->callsign);
1566 strcat(
1568 transferCount],
1569 "\" ");
1570 strcat(
1572 transferCount],
1573 pilotRecord->name);
1574 itoa(pilotRecord->missions, captionBuffer, 10);
1575 strcpy(
1577 transferCount] + 0x28,
1578 captionBuffer);
1579 itoa(pilotRecord->kills, captionBuffer, 10);
1580 strcpy(
1582 transferCount] + 0x2c,
1583 captionBuffer);
1584 itoa(saveSlot, captionBuffer, 10);
1585 strcpy(
1587 transferCount] + 0x3c,
1588 captionBuffer);
1589 transferCount++;
1590 }
1591 }
1592 _close(handle);
1593 if (transferCount == 0) {
1595 accepted = 0;
1596 g_cCurrentKey = 0x14;
1597 finishedDatabase = 0;
1598 } else {
1599 selectedPilotIndex = SelectTransferredPilot(
1600 transferCount);
1601 if (selectedPilotIndex == -1) {
1602 finishedDatabase = 0;
1603 accepted = 0;
1604 g_cCurrentKey = 0x14;
1605 } else {
1606 PilotRecord *selectedPilot;
1607
1608 transferCount = (short)atoi(
1610 selectedPilotIndex] + 0x3c);
1611 handle = (short)_open(
1612 g_1_szLegacySaveFolder, 0x8000);
1613 lseek(handle, (long)transferCount * 0x33c, 0);
1614 _read(handle, record, 0x33c);
1615 selectedPilot = &record->pilots[8];
1616 _close(handle);
1617 PersonnelDriveHook(driveToRestore);
1620 (unsigned char)
1622 -1);
1627 strcpy(captionBuffer,
1629 selectedPilot->rank]);
1630 strcat(captionBuffer, " ");
1631 strcat(captionBuffer, selectedPilot->name);
1632 strcat(captionBuffer, "'s first name?");
1633 SetTextCursor(0x32, 0x32);
1634 DrawFormattedText(captionBuffer);
1637 0x32, 0x3c, 1, "", firstNameText,
1638 0x0c, 0, 0);
1639 strcpy(
1641 firstNameText);
1642 strcpy(
1644 selectedPilot->name);
1645 strcpy(
1647 selectedPilot->callsign);
1648 strcpy(
1650 firstNameText);
1651 strcpy(
1653 selectedPilot->name);
1654 strcpy(
1656 selectedPilot->callsign);
1659 selectedPilot->missions;
1661 selectedPilot->kills;
1665 finishedDatabase = 1;
1666 accepted = 1;
1667 }
1668 }
1669 }
1670 }
1671 PersonnelDriveHook(driveToRestore);
1672 break;
1673 case PERSONNEL_KEY_C:
1674 accepted = 1;
1675 actionHandledFlag = 1;
1682 (unsigned char)g_nMenuSelectedCol, -1);
1683 inputResult = ReadPersonnelTextField(
1684 0x32, 0x1e, 2, "Enter first name: ", firstNameText,
1685 0x0b, 0, 0);
1686 if (inputResult != 0) {
1688 firstNameText);
1690 firstNameText);
1691 inputResult = ReadPersonnelTextField(
1692 0x32, 0x32, 2, "Enter last name: ", surname,
1693 0x0b, 0, 0);
1694 if (inputResult != 0) {
1696 surname);
1698 surname);
1699 inputResult = ReadPersonnelTextField(
1700 0x32, 0x46, 2, "Enter callsign: ", callsign,
1701 0x0b, 0, 0);
1702 if (inputResult != 0) {
1704 callsign);
1705 strcpy(
1707 callsign);
1714 }
1715 }
1716 }
1717 if (inputResult == 0) {
1718 accepted = 0;
1719 }
1720 finishedDatabase++;
1721 g_cCurrentKey = 0x2e;
1722 break;
1723 }
1724 if (actionHandledFlag == 0) {
1725 g_cCurrentKey = (signed char)0x80;
1726 }
1727 }
1728 g_cCurrentKey = (signed char)0x80;
1729 }
1737 ReleasePacketHandle(record);
1738 for (saveSlot = 0; saveSlot < 8; saveSlot++) {
1741 }
1744 return accepted;
1745}
void(__cdecl *g_pIxFree)(void *)
short ReadPersonnelTextField(unsigned int x, unsigned int y, int font, const char *prompt, char *destination, int maximumLength, int mode, int required)
Definition optmenu.c:337
void RefreshCampaignChalkboardScreen(short cockpitVariant)
Definition personnel.c:180
void SaveAndFreeTemporaryCampaignGlobals(void)
Definition campglob.c:188
short SelectLegacyGameSource(void)
Definition personnel.c:1217
int SeekDataFile(unsigned short fd, int offset, unsigned int origin)
Definition datafile.c:78
void SetInputViewport(Viewport *viewport)
Definition eventmgr.c:2093
void DrawPersonnelFileSlot(short slot)
Definition personnel.c:497
short WriteDataFileAtOffset(unsigned short fd, int offset, unsigned int length, const void *data)
Definition datafile.c:28
void LoadStartingCampaignGlobals(short campaign)
Definition campaign.c:337
signed char InitializeViewportWipe(Viewport *source, Viewport *destination, int wipeType, short duration, short passFlags, void *workspace)
Definition wipe.c:12
void OpenDiskDataFile(short logicalFile)
Definition personnel.c:313
short ServiceInputDevices(short deviceMask)
Definition eventmgr.c:2071
void InitializeTextContextFromFont(TextContext *context, short fontIndex, unsigned char colour, signed char background)
Definition disk.c:254
short AllocateViewport(Viewport *viewport, short clearColour, short flags)
Definition vpalloc.c:32
void PersonnelDriveHook(short drive)
Definition eventmgr.c:1978
void free_viewport(Viewport *viewport)
Definition vpfree.c:10
void RefreshMemoryStatusOverlay(void)
Definition main.c:283
void HighlightPersonnelFileSlot(short choice)
Definition personnel.c:547
void SetTextContext(TextContext *context)
Definition eventmgr.c:179
short MeasureTextPixelWidthClamped(const char *text)
Definition strwidth.c:10
int ReadDataFileAtOffset(unsigned short fd, int offset, unsigned int length, void *data)
Definition datafile.c:60
void ReportFatalErrorCode(const char *errorCode)
Definition message.c:29
void InitializeGameTextContexts(void)
Definition startup.c:269
void DrawSpriteDefault(Viewport *viewport, short x, short y, unsigned char *shape, short frame)
Definition gr.c:682
void FlushInputEvents(void)
Definition eventmgr.c:1014
void PollPersonnelMenuInput(void)
Definition personnel.c:61
void DrawCampaignChalkboardFrame(unsigned short frame)
Definition personnel.c:196
void InitializeCampaignChalkboardScreen(short cockpitVariant)
Definition personnel.c:115
signed char AdvanceViewportWipe(void *workspace)
Definition wipe.c:255
void RestorePersonnelMenuBackground(Viewport *viewport)
Definition personnel.c:375
void DrawPersonnelMenuBackdrop(void *scenePacket)
Definition personnel.c:220
short SelectPersonnelFileSlot(void)
Definition personnel.c:581
short RunPilotDatabaseMenu(void)
Definition personnel.c:1400
short WaitForQueuedInputPress(void)
Definition waitkey.c:9
void DrawPersonnelMenuChoices(short choice)
Definition personnel.c:464
void * AllocateTaggedMemory(unsigned int size, short flags)
Definition memapi.c:92
void * FetchDiskPacketRetrying(char *fileName, short section, short flags)
Definition disk.c:187
void ServiceSoundSystem(void)
Definition sound.c:389
void ReleasePacketSlot(void **slot)
Definition iffload.c:23
void CopyHugeMemoryOverlapSafe(void *destination, void *source, int count)
Definition hugemove.c:9
short PollSceneHotspotInput(void *scenePacket, short offsetX, short offsetY, short dismissOnBackground, short maximumSelection)
Definition hotspot.c:170
short LoadSelectedPilotCampaign(void)
Definition personnel.c:244
short LocateLegacySaveGame(short source)
Definition personnel.c:1311
void LoadTemporaryCampaignGlobals(void)
Definition campglob.c:180
void RunPilotSaveLoadMenu(void)
Definition personnel.c:827
void DisableMouseCursorDrawing(void)
Definition eventmgr.c:1327
short OpenDataFileOrDie(const char *path)
Definition datafile.c:13
short CreateDataFile(const char *path)
Definition datafile.c:46
char * GetLegacyGameDataPath(void)
Definition stream.cpp:188
void HighlightTransferredPilot(short choice)
Definition personnel.c:694
short SelectTransferredPilot(short count)
Definition personnel.c:728
void DrawTransferredPilotRow(short row)
Definition personnel.c:675
void ClearViewport(Viewport *viewport, short colour)
Definition gr.c:1027
void EnableMouseCursorDrawing(void)
Definition eventmgr.c:1254
void CloseDataFile(unsigned short fd)
Definition datafile.c:22
void SetPersonnelMousePosition(short x, short y)
Definition mousepos.c:9
void DrawPersonnelSourceChoices(short choice)
Definition personnel.c:430
void SetMenuInputPump(void)
Definition eventmgr.c:2106
short IsInputEventQueued(int type)
Definition main.c:657
void ReleasePacketHandle(void *handle)
Definition memapi.c:108
void InitializeCampaignConstellationState(CampaignGlobals *globals, short copyPosition)
Definition campglob.c:98
void SetTextCursor(unsigned short a, unsigned short b)
Definition eventmgr.c:172
unsigned short WaitForAnyInputPress(void)
Definition disk.c:347
void FreePacketAndClear(void *slot, unsigned short releaseFlags)
Definition disk.c:45
void DrawPilotSaveMenuChoices(short choice)
Definition personnel.c:385
void DrawFormattedText(const char *format,...)
Definition textfmt.c:103
unsigned short HasSavedPilotCampaign(void)
Definition personnel.c:276
void ShowNoTransferablePilots(void)
Definition personnel.c:1389
int GetNextInputEvent(InputEventState *event)
Definition eventmgr.c:800
void LoadSceneHotspotBoundsForSelection(void *scenePacket, short selection)
Definition hotspot.c:53
void SetMouseCursorShape(unsigned char *shape, short frame)
Definition eventmgr.c:1357
Shared Win32 declarations, types and library interfaces.
unsigned char * g_apCockpitVduOverlayShapes[2]
Definition personnel.c:9
short g_8_nSceneRegionRightWord
Definition cockpt.c:3824
char * g_3_apszPersonnelImportCaptionsTable[8]
Definition cockpt.c:3821
short g_27_nSceneHotspotTopValue
Definition cockpt.c:3823
unsigned char * g_pCockpitBackgroundPacket
Definition personnel.c:8
InputManagerState * g_18_pEventManager
Definition eventmgr.c:2543
CampaignGlobals * g_pCampaignGlobals
Definition gameflow.c:3707
const char * g_apszSaveGameFileNames[3]
Definition personnel.c:40
unsigned char * g_pCampaignChalkboardShape
Definition optmenu.c:13
MouseCursorState g_37_stPersonnelMousePointerState
Definition eventmgr.c:2544
short g_bNewPilotCampaignInitialized
Definition campaign.c:9
signed char g_bPersonnelPrimaryInputDown
Definition personnel.c:45
short g_nPersonnelMenuHighlight
Definition personnel.c:34
void * g_pPersonnelCampaignSnapshot
Definition personnel.c:35
char g_6_szDefaultTextBufferText[0xc8]
Definition message.c:228
short g_nMenuSelectedCol
Definition main.c:2007
char g_1_szLegacySaveFolder[0x30]
Definition cockpt.c:3828
char * g_pszPersonnelFooter
Definition hotspot.c:243
short g_1_nCockpitArchiveVariantNumber
Definition starfld.c:240
signed char g_cPreviousKey
Definition viewrect.c:30
unsigned char g_cSecondaryViewBufferColour
Definition startup.c:544
const char * g_apszShortPilotRankNames[5]
Definition personnel.c:18
PilotProfile g_stDefaultPilotProfile
Definition campaign.c:8
void * g_pActiveScenePacket
Definition hotspot.c:242
short g_bPersonnelMenuDrawing
Definition personnel.c:39
unsigned char g_bPrimaryViewBufferColour
Definition startup.c:545
short g_128_nShotHotspotLeft
Definition cockpt.c:3822
Viewport g_2_stModalSourceWindow
Definition message.c:231
int g_nLegacySaveSource
Definition personnel.c:10
short g_15_nSceneAreaLowestWord
Definition cockpt.c:3825
Viewport g_101_stScrViewInfo
Definition cockpt.c:3831
signed char g_bRoomTransitionAnimationEnabled
Definition gameflow.c:14
PilotNameVariables g_stPilotNameVariables
Definition gameflow.c:3762
short g_sPersonnelPreviousInput
Definition personnel.c:38
signed char g_cCurrentKey
Definition viewrect.c:29
Viewport g_stSecondaryViewBufferBlock
Definition message.c:234
short g_nOriginDevUnlock
Definition main.c:1944
const char * g_apszPilotRankNames[5]
Definition personnel.c:11
short g_3_nOptionMessageColour
Definition main.c:2001
PilotProfile g_stCurrentPilotProfile
Definition viewrect.c:73
TextContext g_3_stDefaultStringContext
Definition message.c:239
SceneResourceTable g_stSceneTextList
Definition hotspot.c:249
SceneResourceTable g_stSceneZoneTable
Definition hotspot.c:248
unsigned char * g_pPersonnelMenuBackdrop
Definition personnel.c:37
short g_10_nMenuDarkColour
Definition main.c:2008
PersonnelMenuKey
Definition personnel.c:48
@ PERSONNEL_KEY_ENTER
Definition personnel.c:52
@ PERSONNEL_KEY_W
Definition personnel.c:50
@ PERSONNEL_KEY_C
Definition personnel.c:56
@ PERSONNEL_KEY_0
Definition personnel.c:49
@ PERSONNEL_KEY_L
Definition personnel.c:55
@ PERSONNEL_KEY_SPACE
Definition personnel.c:57
@ PERSONNEL_KEY_D
Definition personnel.c:54
@ PERSONNEL_KEY_T
Definition personnel.c:51
@ PERSONNEL_KEY_S
Definition personnel.c:53
static char g_szPersonnelFileName[]
Definition personnel.c:36
PersonnelFileSlot * g_apPersonnelFileSlots[8]
Definition personnel.c:32
PilotProfile * g_apPersonnelPilotProfiles[8]
Definition personnel.c:33
static char g_szSaveSlotSignature[0x24]
Definition personnel.c:29
unsigned short wordCount
Definition game_data.h:1136
unsigned short modifiers
Definition game.h:215
volatile short y
Definition game.h:166
volatile short x
Definition game.h:165
char description[36]
Definition game_data.h:1129
char lastName[24]
Definition globals.h:1693
char firstName[24]
Definition globals.h:1694
char callsign[24]
Definition globals.h:1692
char firstName[25]
Definition game_data.h:1113
char callsign[13]
Definition game_data.h:1115
char lastName[25]
Definition game_data.h:1114
short kills
Definition game_data.h:801
char callsign[14]
Definition game_data.h:797
short missions
Definition game_data.h:800
char name[14]
Definition game_data.h:796
PilotRecord pilots[9]
Definition game_data.h:1450
SaveGameDiskCampaignState campaign
Definition game_data.h:1451
signed char occupied
Definition game_data.h:1449
char * text
Definition game.h:290
Viewport * viewport
Definition game.h:284
unsigned char * pixels
Definition game.h:150
short right
Definition game.h:154
short bottom
Definition game.h:155
short left
Definition game.h:152
short top
Definition game.h:153