Wing Commander
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
winmain.c
Go to the documentation of this file.
1/**
2 * @file
3 * @ingroup shell
4 * @brief Win32 shell (window creation, message loop, exit paths and the
5 * guarded debug allocator) and the asteroid and mine hazard fields.
6 *
7 * Address range 401000-402e7f; its string literals occupy 465048-465354.
8 */
9#include <stdio.h>
10#include "winmain.h"
11#include <crtdbg.h>
12#include <assert.h>
13#include <dos.h>
14/* WarpMouseTo keeps the DOS SetMousePos interrupt bracket; the 32-bit CRT
15 * also has called versions, so ask for the inline cli/sti. */
16#pragma intrinsic(_disable, _enable)
17
18short nHazardReferenceSpeed = 0; /* 0x00465040 */
19short nActiveHazards = 0; /* 0x00465044 */
20
21/* Base flight times and pitch windows for the four forward view bands. */
22static signed char acHazardTravelTimeByView[8] = {
23 56, 52, 75, 73, 0, 0, 0, 0
24}; /* 0x00465048 */
25
26static signed char acHazardPitchRange[8] = {
27 -10, 4, -8, 8, -12, 8, -8, 8
28}; /* 0x00465050 */
29
30int bIxAudioEnabled = 1; /* 0x00465058 */
31unsigned int bKeyEventQueueEnabled = 0; /* 0x0046505C */
32unsigned int nGuardedAllocationTotalBytes = 0; /* 0x00465060 */
33unsigned int nGuardedAllocationBytes = 0; /* 0x00465064 */
34unsigned int nGuardedAllocationPeakBytes = 0; /* 0x00465068 */
35int bShowKilrathiSagaCredits = 0; /* 0x0046506C */
36int bShowFrameRate = 0; /* 0x00465070 */
37int bDirectDrawModeCascadeEnabled = 1; /* 0x00465074 */
38/* Nothing in the shipped executable references this word or the zero at
39 * 0x00465084; both are original initialized data of unknown purpose. */
40int DAT_00465078 = 1; /* 0x00465078 */
41int bCockpitEnabled = 1; /* 0x0046507C */
42volatile int bMainWindowMinimized = 0; /* 0x00465080 */
43int DAT_00465084 = 0; /* 0x00465084 */
44
45char szMainWindowClassName[] = "Wing Commander"; /* 0x00465088 */
46char szMainWindowTitle[] = "Wing Commander"; /* 0x00465098 */
47
48int bWindowMessagePumpActive = 0; /* 0x004650A8 */
49volatile unsigned int bF1KeyLatch = 0; /* 0x004650AC */
50struct GuardedAllocation *pGuardedAllocationHead = 0; /* 0x004650B0 */
51
52HDC hMainWindowDC; /* 0x005a8a30 */
53HCURSOR hPrevPointer; /* 0x005a8a34 */
54unsigned int nSessionEndTime; /* 0x005a8a38 */
55int bMainWindowAlive; /* 0x005a8a3c */
56HINSTANCE hCurrentAppInstance; /* 0x005a8a40 */
57unsigned int nSessionStartTime; /* 0x005a8a44 */
58short awPaletteRgbWordsList[0x300]; /* 0x005a8a50 */
59
60/* Function start: 0x401000 */
62{
63 int index;
64 short *entry;
65
66 index = 0;
68 do {
69 GetPaletteEntry((short)index, entry);
70 entry += 3;
71 index++;
72 } while (entry < awPaletteRgbWordsList + 0x300);
73}
74
75/* Function start: 0x401020 */
81
82/* Function start: 0x401040 */
83short easy2see(short obj)
84{
85 ShortRect bounds;
86 short x;
87 short screenX;
88 short y;
89
90 screenX = asObjectScreenXList[obj];
91 if (screenX == (short)0x8001)
92 return 0;
93 x = (short)(screenX + nCurrentViewCenterPosX);
95 return (short)GetTransformedShapeBounds(
97 apObjShapeArray[obj],
101 asObjectFlipArray[obj], &bounds);
102}
103
104/* Function start: 0x4010C0 */
105void make_shard(short asteroid, FixedVector direction)
106{
107 short fragment;
108 short speed;
109
110 fragment = find_vacant_3d_object();
111 if (fragment == -1)
112 return;
113 set_objects_data(fragment, OBJECT_TYPE_ROCK_CHUNK, asteroid);
114 asObjectCounterArray[fragment] = 40;
115 acObjOwnersTable[fragment] = (signed char)asteroid;
116 SetVectorFixedPoint(&direction,
117 (short)(asObjectCollisionRadius[asteroid] >> 1));
118 AddFixedVectors(&aShipPositionsArray[asteroid], &direction,
119 &aShipPositionsArray[fragment]);
120 aShipFwdVec[fragment] = direction;
121 fix_objects_ijk(fragment);
122 alter_yaw(signed_random(20), fragment);
123 alter_pitch(signed_random(20), fragment);
124 aShipVelocity[fragment] =
125 aShipFwdVec[fragment];
126 speed = (short)(real_velocity(asteroid) + RandomInRange(0, 5));
128 &aShipVelocity[fragment], speed);
129}
130
131/* Function start: 0x4011D0 */
132void remove_hazard(signed char hazard)
133{
134 aiSoundEffectSourceActiveArray[(short)hazard] = 0;
135 remove_object((short)hazard);
137 MaxShort(0, (short)(nActiveHazards - 1));
138}
139
140/* Function start: 0x401210 */
142{
143 short slot = 0;
144
145 do {
147 abHazardObjects[slot] = -1;
148 slot++;
149 } while (slot < 20);
151}
152
153/* Function start: 0x401250 */
154short difficulty(void)
155{
156 return (short)(abs(25 - (int)nHazardReferenceSpeed) * 2);
157}
158
159/* Function start: 0x401270 */
161{
162 return MinShort(20, (short)(RandomBelowOrEqual(7) + 10));
163}
164
165/* Function start: 0x401290 */
166void skew_randomly(short obj, short allowReverse)
167{
168 FixedVector saved;
169
170 if (RandomBelow(100) < 50) {
171 saved = aShipRightVector[obj];
172 aShipRightVector[obj] =
173 aShipFwdVec[obj];
174 aShipFwdVec[obj] =
175 aShipUpVector[obj];
176 aShipUpVector[obj] = saved;
177 } else {
178 saved = aShipUpVector[obj];
179 aShipUpVector[obj] =
180 aShipFwdVec[obj];
181 aShipFwdVec[obj] =
182 aShipRightVector[obj];
183 aShipRightVector[obj] = saved;
184 }
185 if (allowReverse != 0 && RandomBelow(100) < 50)
187}
188
189/* Function start: 0x401390 */
190void align(short *value, short quantum)
191{
192 short current;
193
194 current = *value;
195 current = (short)(current - current % quantum);
196 *value = current;
197}
198
199/* Function start: 0x4013B0 */
200void init_hazard(short obj, FixedVector position, short moving)
201{
202 FixedVector vector;
203 enum ObjectType type;
204 short hazardMoves;
205 short travelTime;
206 short speed;
207 int separation;
208
209 hazardMoves = moving;
211 type = (enum ObjectType)(OBJECT_TYPE_ASTEROID1 +
213 else
215 set_objects_data(obj, type, -1);
216 aShipPositionsArray[obj] = position;
217
218 if (type == OBJECT_TYPE_SPACE_MINE) {
220 skew_randomly(obj, 1);
221 speed = 2;
222 hazardMoves = 0;
223 } else if (hazardMoves != 0) {
224 travelTime = (short)((cCurrentCockpitView < 4
226 : 65) +
228 if (bIntroSecondaryScene != 0) {
229 travelTime = (short)(travelTime -
231 travelTime = MaxShort(45, travelTime);
232 } else {
233 travelTime = (short)(travelTime -
235 travelTime = MaxShort(7, travelTime);
236 }
238 (int)travelTime << 8, &vector);
239 AddFixedVectors(&aShipPositionsArray[0], &vector, &vector);
240 point_at(obj, vector);
242 &vector, &aShipPositionsArray[obj]);
243 travelTime = MaxShort(3,
244 (short)(travelTime - RandomBelow(5)));
245 speed = (short)(speed / travelTime);
246 } else {
248 skew_randomly(obj, 1);
249 if (RandomBelow(100) < 20)
250 speed = 0;
251 else
252 speed = asteroid_velocity();
253 }
254 if (kilrathi_near(0, 16000) != 0)
255 speed = 0;
257 (int)speed << 8, &aShipVelocity[obj]);
258
259 if (hazardMoves == 0) {
260 if (type == OBJECT_TYPE_ASTEROID_FIELD)
261 separation = 1500;
262 else
263 separation = RandomBelowOrEqual(1000) << 8;
265 separation, &vector);
267 &aShipPositionsArray[obj]);
268 }
269 if (type == OBJECT_TYPE_SPACE_MINE) {
270 align((short *)&aShipPositionsArray[obj].x, 200);
271 align((short *)&aShipPositionsArray[obj].y, 200);
272 align((short *)&aShipPositionsArray[obj].z, 200);
273 }
275 asObjectCounterArray[obj] = 0;
277}
278
279/* Function start: 0x401680 */
280short near_field(const HazardField *field, const FixedVector *point)
281{
282 return IsPointWithinRange(&field->center,
283 point,
284 (short)(field->innerRadius + 4300));
285}
286
287/* Function start: 0x4016A0 */
288short within_field(const HazardField *field, const FixedVector *point)
289{
290 return IsPointWithinRange(&field->center,
291 point, field->innerRadius);
292}
293
294/* Function start: 0x4016C0 */
295short try_far_spot(FixedVector *spot, short *moving)
296{
297 short yaw;
298 short pitch;
299 unsigned short outsideRange;
300
301 copy_frame(0, 63);
303 pitch = signed_random(20);
304 yaw = signed_random(35);
305 if (nCameraViewMode == 0 && cCurrentCockpitView <= 3) {
306 signed char minimum;
307 signed char maximum;
308
309 minimum = acHazardPitchRange[
311 if (pitch > minimum &&
312 pitch < (maximum = acHazardPitchRange[
313 cCurrentCockpitView * 2 + 1]) &&
314 abs(yaw) < 19 &&
315 RandomBelow(100) < 60)
316 *moving = 1;
317 else
318 *moving = 0;
319 } else {
320 if (abs(pitch) > 5 && abs(pitch) < 20 &&
321 abs(yaw) > 5 && abs(yaw) < 20 && RandomBelow(100) < 30)
322 *moving = 1;
323 else
324 *moving = 0;
325 }
326 pitch = (short)(pitch + find_ratio(
327 -15, 15, anObjPitchRot[0], -150, 150));
328 yaw = (short)(yaw + find_ratio(
329 -15, 15, anObjectYawRotation[0], -150, 150));
331 &aShipFwdVec[63]);
332 rotate_about_i(pitch, &aShipUpVector[63],
333 &aShipFwdVec[63]);
334 position_relative_ijk(spot, 63, 0, 0, 3050);
335 outsideRange = !(unsigned short)IsPointWithinRange(
336 &aShipPositionsArray[0], spot, 3000);
337 return outsideRange != 0 &&
339}
340
341/* Function start: 0x401870 */
342short rear_sphere(void)
343{
344 return find_ratio(0, 20, (short)nHazardReferenceSpeed,
345 4300, 3100);
346}
347
348/* Function start: 0x401890 */
349short ok_hazard_spot(short obj)
350{
351 int range = 4300;
352
353 if (asObjectScreenXList[obj] == (short)0x8001)
354 range = rear_sphere();
357 (short)range);
358}
359
360/* Function start: 0x4018D0 */
361short make_hazard(void)
362{
363 FixedVector spot;
364 short moving;
365 short obj = find_vacant_3d_object();
366
367 if (obj != -1 && try_far_spot(&spot, &moving) != 0) {
368 init_hazard(obj, spot, moving);
369 } else
370 obj = -1;
371 return obj;
372}
373
374/* Function start: 0x401930 */
375void extra_hazard(short obj)
376{
379}
380
381/* Function start: 0x401950 */
382void approach(short obj)
383{
384 FixedVector offset;
385
386 ScaleFixedVector(&aShipVelocity[0], 20 << 8, &offset);
387 AddFixedVectors(&aShipPositionsArray[0], &offset, &offset);
388 point_at(obj, offset);
389 ScaleFixedVector(&aShipFwdVec[obj], 20 << 8,
390 &offset);
391 AddFixedVectors(&aShipVelocity[obj], &offset,
392 &aShipVelocity[obj]);
393}
394
395/* Function start: 0x4019E0 */
396void manage_hazard(short obj, short slot)
397{
398 if (nRenderedSpaceFrame % 20 != slot)
399 return;
400 if (ok_hazard_spot(obj) == 0) {
401 remove_hazard((signed char)obj);
402 return;
403 }
405 asObjectScreenXList[obj] != (short)0x8001 &&
406 asObjDistancesTable[obj] > 1500 &&
407 real_velocity(obj) < 20)
408 approach(obj);
409}
410
411/* Function start: 0x401A60 */
424
425/* Function start: 0x401B30 */
427{
428 short slot;
429 short emptySlot = -1;
430
431 if (bIntroSecondaryScene != 0)
433 else
435 for (slot = 0; slot < 20; slot++) {
436 if (abHazardObjects[slot] != -1)
437 manage_hazard((short)abHazardObjects[slot], slot);
438 else
439 emptySlot = slot;
440 }
441 if (emptySlot != -1 &&
442 RandomBelowOrEqual(215) <
443 (short)nHazardReferenceSpeed + 30)
444 abHazardObjects[emptySlot] = (signed char)make_hazard();
445}
446
447/* Function start: 0x401BC0 */
448void start_hazard_field(short region)
449{
450 short slot;
451
454 slot = 1;
455 do {
456 abHazardObjects[slot] = (signed char)make_hazard();
457 } while (slot++ < 3);
458}
459
460/* Function start: 0x401C00 */
462 short radius, short density)
463{
464 HazardField *field;
465
467 return;
469 field->type = type;
470 field->center = center;
471 field->outerRadius = radius;
472 field->innerRadius = radius;
473 field->density = density;
475}
476
477/* Function start: 0x401C60 */
479{
480 HazardField *field;
481 short region;
482
483 if (bIntroSecondaryScene != 0)
484 return;
485 if (pActiveHazardField == 0) {
486 for (region = 0, field = aHazardFields;
487 region < nCurrentHazardFieldTotal; region++, field++) {
488 if (field != pActiveHazardField &&
489 near_field(field, &aShipPositionsArray[0]) != 0) {
490 start_hazard_field(region);
491 return;
492 }
493 }
495 &aShipPositionsArray[0]) == 0) {
497 }
498}
499
500/* Function start: 0x401CE0 */
501void __stdcall WarpMouseTo(short x, short y)
502{
503 _disable();
509 _enable();
510}
511
512/* Function start: 0x401D10 */
514{
515 FILE *config;
516 char option[100];
517
518 if (ReadCheaterFlagFromRegistry() != 0) {
522 }
523
524 config = fopen("WINGCMDR.CFG", "rt");
525 if (config != 0) {
526 while (fscanf(config, "%s", option) != EOF) {
527 char command;
528
529 if (memcmp(option, "$#SAGA.EXE", 11) == 0)
531 command = option[0];
532 if (command == '-')
533 command = option[1];
534 switch (command) {
535 case 'b':
537 break;
538 case 'c':
539 bCockpitEnabled = 0;
540 break;
541 case 'f':
542 bShowFrameRate = 1;
543 break;
544 case 'k':
546 break;
547 case 'q':
549 break;
550 }
551 if (config == 0)
552 return;
553 }
554 fclose(config);
555 }
556}
557
558/* Function start: 0x401E30 */
559int WINAPI WinMain(HINSTANCE instance, HINSTANCE previous,
560 LPSTR commandLine, int showCommand)
561{
562 MEMORYSTATUS memoryStatus;
563 RECT clip;
564 HANDLE process;
565
566 (void)commandLine;
568 CreateSemaphoreA(0, 0, 1, "Wing Commander 1");
569 if (GetLastError() == ERROR_ALREADY_EXISTS) {
570 MessageBoxA(0,
571 "Only one instance of Wing Commander 1 for Windows95 may be running at a time",
572 "ATTENTION", MB_ICONERROR);
573 exit(0);
574 }
575
576 memset(&memoryStatus, 0, sizeof(memoryStatus));
577 memoryStatus.dwLength = sizeof(memoryStatus);
578 GlobalMemoryStatus(&memoryStatus);
579 if (memoryStatus.dwTotalPhys < 0x800000) {
580 MessageBoxA(0,
581 "You must have at leat 8 megs of memory available to play Wing Commander 1 for Windows95",
582 "ATTENTION", MB_ICONERROR);
583 exit(0);
584 }
585 if (memoryStatus.dwTotalPageFile < 0x800000) {
586 MessageBoxA(0,
587 "You must have at leat 8 megs of virtual memory available to play Wing Commander 1 for Window95",
588 "ATTENTION", MB_ICONERROR);
589 exit(0);
590 }
591
592 if (waveOutGetNumDevs() < 1)
593 bIxAudioEnabled = 0;
595 if (!PromptInsertCorrectCd()) {
596 CloseHandle(hSingleInstanceSemaphore);
597 return 0;
598 }
599 if (!CreateMainWindow(instance, previous, showCommand))
600 return 0;
601
603 process = GetCurrentProcess();
605 SetPriorityClass(process, HIGH_PRIORITY_CLASS);
606 if (bIxAudioEnabled != 0) {
609 }
610 srand((unsigned int)time(0));
612 CreateDebugOverlayConsole(instance, hMainWindow, 60, 20);
613 nSessionStartTime = (unsigned int)time(0);
614 ShowCursor(FALSE);
616 clip.left = 0;
617 clip.top = 0;
618 clip.right = 320;
619 clip.bottom = 200;
620 ClipCursor(&clip);
621
622 _onexit((_onexit_t)AbortToDesktop);
623 main(0, (char **)"");
624
625 ClipCursor(0);
626 ShowCursor(TRUE);
627 nSessionEndTime = (unsigned int)time(0);
630 DestroyWindow(hMainWindow);
631 DIBunInstall();
633 CloseHandle(hSingleInstanceSemaphore);
634 return 1;
635}
636
637/* Function start: 0x402070 */
639{
640 HANDLE process;
641
642 nSessionEndTime = (unsigned int)time(0);
643 ClipCursor(0);
644 ShowCursor(TRUE);
646 DestroyWindow(hMainWindow);
647 DIBunInstall();
648 ClipCursor(0);
649 ShowCursor(TRUE);
650 process = GetCurrentProcess();
651 SetPriorityClass(process, IDLE_PRIORITY_CLASS);
652 CloseHandle(hSingleInstanceSemaphore);
653 exit(0);
654}
655
656/* Function start: 0x4020E0 */
657void ShowNoticeMessageBox(const char *text)
658{
660 MessageBoxA(0, text, "NOTICE", 0x10);
661 exit(0);
662}
663
664/* Function start: 0x402110 */
665unsigned int AbortToDesktop(void)
666{
667 HANDLE process;
668
669 ClipCursor(0);
670 ShowCursor(TRUE);
671 process = GetCurrentProcess();
672 SetPriorityClass(process, IDLE_PRIORITY_CLASS);
673 sprintf(szMemoryUsage,
674 "Current: %i\nMax : %i\nTotal : %i\n",
678 OutputDebugStringA("Memory Info:\n");
679 OutputDebugStringA(szMemoryUsage);
680 CloseHandle(hSingleInstanceSemaphore);
681 return 0;
682}
683
684/* Function start: 0x402180 */
685int CreateMainWindow(HINSTANCE instance, HINSTANCE previous,
686 int showCommand)
687{
688 WNDCLASSA windowClass;
689
690 hCurrentAppInstance = instance;
691 if (previous != 0)
692 return 0;
693
694 windowClass.hInstance = instance;
695 windowClass.lpszClassName = szMainWindowClassName;
696 windowClass.lpfnWndProc = MainWindowProc;
697 windowClass.hCursor = 0;
698 windowClass.hIcon = LoadIconA(0, IDI_APPLICATION);
699 windowClass.lpszMenuName = szMainWindowClassName;
700 windowClass.hbrBackground = GetStockObject(BLACK_BRUSH);
701 windowClass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
702 windowClass.cbClsExtra = 0;
703 windowClass.cbWndExtra = 0;
704 if (RegisterClassA(&windowClass) == 0)
705 return 0;
706
707 hMainWindow = CreateWindowExA(0, szMainWindowClassName,
709 WS_POPUP, 0, 0, 320, 200,
710 0, 0,
712 if (hMainWindow == 0) {
713 GetLastError();
714 return 0;
715 }
716
717 hMainWindowDC = GetDC(hMainWindow);
718 SetTextColor(hMainWindowDC, RGB(255, 0, 0));
719 SetBkColor(hMainWindowDC, RGB(0, 0, 0));
720 if (GetDeviceCaps(hMainWindowDC, BITSPIXEL) < 8) {
721 MessageBoxA(0,
722 "You must be running with 256, or more, colors to play Wing Commander",
723 "NOTICE", MB_ICONEXCLAMATION);
724 DestroyWindow(hMainWindow);
725 return 0;
726 }
727
728 hPrevPointer = SetCursor(0);
729 ShowWindow(hMainWindow, showCommand);
730 UpdateWindow(hMainWindow);
736 return 1;
737}
738
739/* Function start: 0x402320 */
740unsigned int PumpWindowMessages(void)
741{
742 POINT cursor;
743 MSG message;
744 RECT clip;
745 HANDLE process;
746 int done = 0;
747
749 return 1;
753 do {
754 if (bMainWindowMinimized != 0) {
755 if (GetMessageA(&message, 0, 0, 0) != 0) {
756 TranslateMessage(&message);
757 done = 1;
758 DispatchMessageA(&message);
759 } else {
762 }
763 if (IsIconic(hMainWindow) == 0)
765 if (bMainWindowMinimized == 0) {
766 clip.left = 0;
767 clip.top = 0;
768 clip.right = 320;
769 clip.bottom = 200;
770 ShowCursor(FALSE);
771 process = GetCurrentProcess();
772 SetPriorityClass(process, HIGH_PRIORITY_CLASS);
773 SetActiveWindow(hMainWindow);
774 SetForegroundWindow(hMainWindow);
775 DIBreInstall();
776 DIBslam();
777 DIBslamReal();
778 ClipCursor(&clip);
779 SetCursorPos(cursor.x, cursor.y);
781 }
782 } else {
783 if (PeekMessageA(&message, 0, 0, 0, PM_NOREMOVE) != 0) {
784 if (GetMessageA(&message, 0, 0, 0) != 0) {
785 TranslateMessage(&message);
786 done = 0;
787 DispatchMessageA(&message);
788 } else {
789 done = 0;
792 }
793 } else {
794 done = 1;
795 }
796 }
797 if (IsIconic(hMainWindow) != 0) {
798 if (bMainWindowMinimized == 0) {
799 cursor.x = 160;
800 cursor.y = 100;
801 ClipCursor(0);
802 ShowCursor(TRUE);
803 process = GetCurrentProcess();
804 SetPriorityClass(process, IDLE_PRIORITY_CLASS);
805 }
807 }
808 if (bMainWindowMinimized != 0)
809 done = 0;
810 } while (done == 0);
811 nTickCount60Hz = GetTickCount() * 60 / 1000;
813 return bMainWindowAlive;
814}
815
816/* Function start: 0x402520 */
817unsigned int GetF1KeyLatch(void)
818{
819 return bF1KeyLatch;
820}
821
822/* Function start: 0x402530 */
823LRESULT CALLBACK MainWindowProc(HWND window, UINT message,
824 WPARAM wParam, LPARAM lParam)
825{
826 PAINTSTRUCT paint;
827 int mouseEvent;
828 unsigned int scanCode;
829 unsigned int primaryButton;
830 unsigned int secondaryButton;
831 unsigned int mouseX;
832 unsigned int mouseY;
833 unsigned int command;
834 unsigned short eventType;
835 HANDLE process;
836
837 mouseEvent = 0;
838 primaryButton = (unsigned int)wParam & 1;
839 secondaryButton = ((unsigned int)wParam & 2) >> 1;
840 mouseX = (unsigned short)lParam;
841 command = (unsigned short)wParam;
842 mouseY = (unsigned short)((unsigned long)lParam >> 16);
843
844 switch (message) {
845 case WM_SETFOCUS:
847 return 0;
848 case WM_CLOSE:
849 case WM_DESTROY:
851 ClipCursor(0);
852 ShowCursor(TRUE);
853 process = GetCurrentProcess();
854 SetPriorityClass(process, IDLE_PRIORITY_CLASS);
855 PostQuitMessage(0);
856 break;
857 case WM_QUIT:
859 ClipCursor(0);
860 ShowCursor(TRUE);
861 process = GetCurrentProcess();
862 SetPriorityClass(process, IDLE_PRIORITY_CLASS);
863 break;
864 case WM_PAINT:
865 BeginPaint(hMainWindow, &paint);
866 EndPaint(hMainWindow, &paint);
867 break;
868 case WM_KEYDOWN:
869 if (bKeyEventQueueEnabled != 0)
870 QueueInputEvent(3, 0, 0, (int)wParam,
871 0, 0, 0);
872 if (wParam == VK_F1) {
873 if ((lParam & 0x40000000) != 0) {
874 bF1KeyLatch = 1;
875 bF1KeyLatch = 0;
876 } else {
877 bF1KeyLatch = 1;
878 }
879 }
880 scanCode = ((unsigned long)lParam & 0xff0000) >> 16;
881 if (scanCode == 1)
883 QueueInputEvent(3, 0, 0, (int)scanCode,
884 0, 0, 0);
885 SetInputKeyState((int)scanCode, 1);
886 break;
887 case WM_KEYUP:
888 if (bKeyEventQueueEnabled != 0)
889 QueueInputEvent(4, 0, 0, (int)wParam,
890 0, 0, 0);
891 if (wParam == VK_F1)
892 bF1KeyLatch = 0;
893 scanCode = ((unsigned long)lParam & 0xff0000) >> 16;
894 QueueInputEvent(4, 0, 0, (int)scanCode,
895 0, 0, 0);
896 SetInputKeyState((int)scanCode, 0);
897 break;
898 case WM_SYSKEYDOWN:
899 nSystemKeyDown = (unsigned int)wParam;
900 if (wParam == 'X') {
901 if (((unsigned long)lParam & 0x20000000) != 0) {
902 PostQuitMessage(0);
903 sprintf(szMemoryUsage,
904 "Current: %i\nMax : %i\nTotal : %i\n",
908 OutputDebugStringA("Memory Info:\n");
909 OutputDebugStringA(szMemoryUsage);
910 }
911 } else if (wParam == 'N') {
913 } else if (wParam == 'M') {
915 }
916 break;
917 case WM_SYSKEYUP:
918 nSystemKeyDown = 0;
919 break;
920 case WM_COMMAND:
921 if (command == 3) {
923 PostQuitMessage(0);
924 }
925 break;
926 case WM_SYSCOMMAND:
927 if ((wParam & 0xfff0) == SC_SCREENSAVE ||
928 (wParam & 0xfff0) == SC_MONITORPOWER)
929 return 0;
930 break;
931 case WM_MOUSEMOVE:
932 if (bPtrMovedByKeyboardState == 0) {
933 eventType = 13;
934 QueueInputEvent(eventType, (int)mouseX,
935 (int)mouseY, 0,
936 primaryButton, secondaryButton, 0);
937 mouseEvent = 1;
938 } else {
940 }
941 break;
942 case WM_LBUTTONDOWN:
943 case WM_RBUTTONDOWN:
944 eventType = 2;
945 QueueInputEvent(eventType, (int)mouseX,
946 (int)mouseY, 0,
947 primaryButton, secondaryButton, 0);
948 mouseEvent = 1;
949 break;
950 case WM_LBUTTONUP:
951 case WM_RBUTTONUP:
952 eventType = 1;
953 QueueInputEvent(eventType, (int)mouseX,
954 (int)mouseY, 0,
955 primaryButton, secondaryButton, 0);
956 mouseEvent = 1;
957 break;
958 }
959 if (mouseEvent != 0) {
960 nHostMouseMessageX = mouseX;
961 nHostMouseMessageY = mouseY;
962 bHostPrimaryMouseButton = primaryButton;
963 bHostSecondaryMouseButton = secondaryButton;
964 }
965 return DefWindowProcA(window, message, wParam, lParam);
966}
967
968/* Function start: 0x402A20 */
969int __stdcall GetJoystickPosition(int *x, int *y,
970 unsigned int *buttons, short joystick,
971 unsigned short fallback)
972{
973 unsigned int device;
974 unsigned int infoIndex;
975 unsigned int buttonState;
976
977 if (joystick != 0) {
978 device = 1;
979 infoIndex = 1;
980 } else {
981 device = 0;
982 infoIndex = 0;
983 }
984 if (joyGetPos(device, &aJoystickInfos[infoIndex]) ==
985 JOYERR_NOERROR) {
986 *x = aJoystickInfos[infoIndex].wXpos;
987 *y = aJoystickInfos[infoIndex].wYpos;
988 buttonState = aJoystickInfos[infoIndex].wButtons;
989 *buttons = buttonState;
990 if (joystick != 0)
991 *buttons = buttonState >> 2;
992 else
993 *buttons = buttonState & 3;
994 return 0;
995 }
996
997 fallback &= 0xffff;
998 *x = fallback;
999 *y = fallback;
1000 *buttons = fallback;
1001 return 1;
1002}
1003
1004/* Function start: 0x402AC0 */
1006{
1007 return ((short)aJoystickInfos[1].wButtons << 2) |
1008 (unsigned short)aJoystickInfos[0].wButtons;
1009}
1010
1011/* Function start: 0x402AE0 */
1012void GetJoystickDevCaps(short joystick,
1013 unsigned short *xMin, unsigned short *xMax,
1014 unsigned short *yMin, unsigned short *yMax)
1015{
1016 JOYCAPSA caps;
1017 unsigned int device = joystick != 0;
1018
1019 *xMin = *xMax = *yMin = *yMax = 0;
1020 if (joyGetDevCapsA(device, &caps, sizeof(caps)) != JOYERR_NOERROR) {
1021 SystemDebugPrintf("Joystick: !joyGetDevCaps\n");
1022 return;
1023 }
1024
1025 *xMin = (unsigned short)caps.wXmin;
1026 *xMax = (unsigned short)caps.wXmax;
1027 *yMin = (unsigned short)caps.wYmin;
1028 *yMax = (unsigned short)caps.wYmax;
1029}
1030
1031/* Function start: 0x402B80 */
1033{
1034 return hCurrentAppInstance;
1035}
1036
1037/* Function start: 0x402B90 */
1038/* No inbound reference is known in the shipped executable; this routine is
1039 * believed unreachable. */
1041{
1042 return hMainWindow;
1043}
1044
1045/* Function start: 0x402BA0 */
1046/* No inbound reference is known in the shipped executable; this routine is
1047 * believed unreachable. */
1049{
1050 return hMainWindowDC;
1051}
1052
1053/* Function start: 0x402BB0 */
1054void *AllocateGuardedMemory(unsigned int size)
1055{
1056 if (pGuardedAllocationHead == 0) {
1058 malloc(sizeof(struct GuardedAllocation));
1060 } else {
1062 malloc(sizeof(struct GuardedAllocation));
1064 }
1067 pGuardedAllocationTail->block = malloc(size + 0x800);
1068
1069 memset(pGuardedAllocationTail->block, 0xab, 0x400);
1070 memset((unsigned char *)pGuardedAllocationTail->block +
1071 0x400,
1072 0, size);
1073 memset((unsigned char *)pGuardedAllocationTail->block +
1074 size + 0x400,
1075 0xab, 0x400);
1078 /* Matching workaround: force the original ECX choice for this update.
1079 * This is not evidence that the original source used inline assembly. */
1080 __asm {
1083 jae peakRecorded
1085 peakRecorded:
1086 }
1087 return (unsigned char *)pGuardedAllocationTail->block +
1088 0x400;
1089}
1090
1091/* Function start: 0x402CA0 */
1092void ReportHeapGuardCorruption(void *memory, int count, int overrun)
1093{
1094 char text[0x80];
1095
1097 sprintf(text, "Memory at %p %swritten. Corruption : (%i/%i) %s",
1098 memory, overrun ? "over" : "under", count, 0x100,
1099 count > 0x80
1100 ? (count > 0xc0 ? "EXTREME" : "SEVERE")
1101 : (count > 0x40 ? "BAD" : "NAUGHTY"));
1102 MessageBoxA(0, text, "NOTICE", 0x10);
1103 exit(0);
1104}
1105
1106/* Function start: 0x402D40 */
1108{
1109 struct GuardedAllocation *allocation = pGuardedAllocationHead;
1110 void *block;
1111 unsigned int *guard;
1112 int prefixCorrupt;
1113 int i;
1114 int suffixCorrupt;
1115
1116 while (allocation != 0) {
1117 block = allocation->block;
1118 guard = (unsigned int *)block;
1119 prefixCorrupt = 0;
1120 i = 0x100;
1121 do {
1122 if (*guard != 0xabababab)
1123 prefixCorrupt = prefixCorrupt + 1;
1124 guard = guard + 1;
1125 i = i - 1;
1126 } while (i != 0);
1127 if (prefixCorrupt != 0)
1128 ReportHeapGuardCorruption(block, prefixCorrupt, 0);
1129
1130 guard = (unsigned int *)((unsigned char *)guard + allocation->size);
1131 suffixCorrupt = 0;
1132 i = 0x100;
1133 do {
1134 if (*guard != 0xabababab)
1135 suffixCorrupt = suffixCorrupt + 1;
1136 guard = guard + 1;
1137 i = i - 1;
1138 } while (i != 0);
1139 if (suffixCorrupt != 0)
1140 ReportHeapGuardCorruption(allocation->block, suffixCorrupt, 1);
1141
1142 allocation = allocation->next;
1143 }
1144}
1145
1146/* Function start: 0x402DB0 */
1147void FreeGuardedAllocation(void *memory)
1148{
1149 struct GuardedAllocation *allocation = pGuardedAllocationHead;
1150 struct GuardedAllocation *previous = 0;
1151 void *block = (unsigned char *)memory - 0x400;
1152 int i;
1153 unsigned int *guard;
1154 int corrupt;
1155
1156 guard = (unsigned int *)block;
1157 if (allocation == 0)
1158 return;
1159 while (allocation->block != block) {
1160 previous = allocation;
1161 allocation = allocation->next;
1162 if (allocation == 0)
1163 return;
1164 }
1165
1166 corrupt = 0;
1167 i = 0x100;
1168 do {
1169 if (*guard != 0xabababab)
1170 corrupt = corrupt + 1;
1171 guard = guard + 1;
1172 i = i - 1;
1173 } while (i != 0);
1174 if (corrupt != 0)
1175 ReportHeapGuardCorruption(memory, corrupt, 0);
1176
1177 guard = (unsigned int *)((unsigned char *)memory + allocation->size);
1178 corrupt = 0;
1179 i = 0x100;
1180 do {
1181 if (*guard != 0xabababab)
1182 corrupt = corrupt + 1;
1183 guard = guard + 1;
1184 i = i - 1;
1185 } while (i != 0);
1186 if (corrupt != 0)
1187 ReportHeapGuardCorruption(memory, corrupt, 1);
1188
1190 nGuardedAllocationBytes - allocation->size;
1191 free(block);
1192 if (previous != 0)
1193 previous->next = allocation->next;
1194 else
1195 pGuardedAllocationHead = allocation->next;
1196 if (pGuardedAllocationTail == allocation) {
1197 if (previous != 0)
1198 pGuardedAllocationTail = previous;
1199 else
1201 }
1202 free(allocation);
1203}
void(__cdecl *pIxFree)(void *)
unsigned char bEscapePressedFlag
Definition mathfp.c:24
unsigned int nGuardedAllocationPeakBytes
Definition winmain.c:34
short asObjScreenScalesArray[SPACE_OBJECT_COUNT]
Definition dib.c:105
int bCockpitEnabled
Definition winmain.c:41
HINSTANCE hCurrentAppInstance
Definition winmain.c:56
int nCameraViewMode
Definition game.c:49
int bMainWindowAlive
Definition winmain.c:55
short nRenderedSpaceFrame
Definition input.c:22
short asObjScreenAngles[SPACE_OBJECT_COUNT]
Definition joycal.c:26
short nActiveHazards
Definition winmain.c:19
short nHazardReferenceSpeed
Definition winmain.c:18
volatile int bMainWindowMinimized
Definition winmain.c:42
short anObjectYawRotation[SPACE_OBJECT_COUNT]
Definition joycal.c:33
short anObjPitchRot[SPACE_OBJECT_COUNT]
Definition data.c:247
int bShowKilrathiSagaCredits
Definition winmain.c:35
HWND hMainWindow
Definition winsys.c:49
JOYINFO aJoystickInfos[2]
Definition auto.c:18
unsigned int bKeyEventQueueEnabled
Definition winmain.c:31
MouseCursorState stHostMouseState
Definition data.c:243
HazardField * pActiveHazardField
Definition smart.c:18
int bPtrMovedByKeyboardState
Definition disk.c:43
FixedVector aShipRightVector[64]
Definition smart.c:15
int bIntroSecondaryScene
Definition game.c:40
enum ObjectClass aeObjectClass[SPACE_OBJECT_COUNT]
Definition video.c:21
unsigned int nSystemKeyDown
Definition auto.c:17
int bShowFrameRate
Definition winmain.c:36
MouseCursorState stMouseCursorState
Definition strdos.c:19
int bWindowMessagePumpActive
Definition winmain.c:48
short asObjectScreenYArray[SPACE_OBJECT_COUNT]
Definition screen.c:20
struct GuardedAllocation * pGuardedAllocationHead
Definition winmain.c:50
int nHostMouseMessageX
Definition auto.c:19
HANDLE hSingleInstanceSemaphore
Definition winsys.c:50
int bDirectDrawModeCascadeEnabled
Definition winmain.c:37
FixedVector aShipVelocity[SPACE_OBJECT_COUNT]
Definition smart.c:21
short asObjectCollisionRadius[64]
Definition ending.c:27
signed char cCurrentCockpitView
Definition screen.c:23
short nCurrentViewCenterPosX
Definition eventmgr.c:25
void(*) pCurrentEventManagerPump(void)
Definition strdos.c:20
unsigned int nGuardedAllocationTotalBytes
Definition winmain.c:32
unsigned int nSessionEndTime
Definition winmain.c:54
unsigned short asObjDistancesTable[SPACE_OBJECT_COUNT]
Definition data.c:253
Viewport stSpaceBufferViewport
Definition timer.c:13
int nTickCount60Hz
Definition mathfp.c:23
char szMemoryUsage[0x80]
Definition winsys.c:53
short asObjectCounterArray[SPACE_OBJECT_COUNT]
Definition game.c:547
int aiSoundEffectSourceActiveArray[0x40]
Definition install.c:13
short awPaletteRgbWordsList[0x300]
Definition winmain.c:58
int nHostMouseMessageY
Definition mono.c:326
FixedVector aShipUpVector[64]
Definition smart.c:16
short asObjectScreenXList[SPACE_OBJECT_COUNT]
Definition screen.c:21
signed char acObjOwnersTable[64]
Definition joycal.c:29
int bHostPrimaryMouseButton
Definition mono.c:327
struct Shape * apObjShapeArray[SPACE_OBJECT_COUNT]
Definition comm.c:48
signed char acObjCollisionGraceTicks[SPACE_OBJECT_COUNT]
Definition screen.c:29
enum ObjectType aeObjectTypeList[SPACE_OBJECT_COUNT]
Definition data.c:255
short asObjectViewFrames[SPACE_OBJECT_COUNT]
Definition video.c:23
int bHostSecondaryMouseButton
Definition mono.c:328
short asObjectFlipArray[SPACE_OBJECT_COUNT]
Definition dib.c:97
HazardField aHazardFields[8]
Definition screen.c:18
struct GuardedAllocation * pGuardedAllocationTail
Definition winsys.c:52
unsigned int nGuardedAllocationBytes
Definition winmain.c:33
short nCurrentHazardFieldTotal
Definition dib.c:100
int bIxAudioEnabled
Definition winmain.c:30
HCURSOR hPrevPointer
Definition winmain.c:53
FixedVector aShipPositionsArray[SPACE_OBJECT_COUNT]
Definition game.c:556
volatile unsigned int bF1KeyLatch
Definition winmain.c:49
FixedVector aShipFwdVec[64]
Definition smart.c:17
short nCurrentViewCenterPosY
Definition eventmgr.c:26
unsigned int nSessionStartTime
Definition winmain.c:57
signed char abHazardObjects[0x14]
Definition game.c:43
int bPlayerCollisionResponse
Definition main.c:37
int bPlayerVulnerable
Definition main.c:36
int nOriginDevUnlock
Definition main.c:34
struct GuardedAllocation * next
Definition wc1base.h:340
unsigned int size
Definition wc1base.h:339
enum ObjectType type
Definition wcdata.h:794
short outerRadius
Definition wcdata.h:797
short innerRadius
Definition wcdata.h:796
FixedVector center
Definition wcdata.h:795
short density
Definition wcdata.h:798
void SystemDebugPrintf(const char *fmt,...)
Definition pilot.cpp:182
int __stdcall GetJoystickPosition(int *x, int *y, unsigned int *buttons, short joystick, unsigned short fallback)
Definition winmain.c:969
void remove_hazard(signed char hazard)
Definition winmain.c:132
short kilrathi_near(short obj, short range)
Definition cockpt.c:501
void InitGameClockEpoch(void)
Definition winsys.c:135
short GetTransformedShapeBounds(Viewport *viewport, short x, short y, struct Shape *shape, short frame, short angle, short scale, short flip, ShortRect *bounds)
Definition gr.c:1196
void DIBslam(void)
Definition dib.c:513
void make_shard(short asteroid, FixedVector direction)
Definition winmain.c:105
void DIBwholePaletteFromWords(short *palette)
Definition dib.c:879
void DestroyGlobalDebugOverlayConsole(void)
Definition pilot.cpp:176
short distance_between_points(const FixedVector *from, const FixedVector *to)
Definition geom.c:643
short LogMemoryUsage(void)
Definition main.c:102
void fix_objects_ijk(short obj)
Definition geom.c:596
void match_ship_to_eye(void)
Definition winmain.c:412
void rotate_about_i(short angle, FixedVector *j, FixedVector *k)
Definition geom.c:508
void ServiceAudioStream(void)
Definition sound.c:37
void remove_object(short obj)
Definition geom.c:1002
void alter_pitch(short angle, short obj)
Definition geom.c:619
void __stdcall GetPaletteEntry(short index, short *rgb)
Definition gr.c:648
void AddFixedVectors(const FixedVector *left, const FixedVector *right, FixedVector *sum)
Definition geom.c:296
void ShutdownGameWindow(void)
Definition winmain.c:638
unsigned int AbortToDesktop(void)
Definition winmain.c:665
void set_objects_data(short obj, enum ObjectType type, short owner)
Definition ship.c:173
void InitializeAudioStreamer(HWND window)
Definition gr.c:1356
short easy2see(short obj)
Definition winmain.c:83
void position_relative_ijk(FixedVector *position, short obj, short right, short up, short forward)
Definition geom.c:183
void DIBunInstall(void)
Definition dib.c:412
void * AllocateGuardedMemory(unsigned int size)
Definition winmain.c:1054
void init_player_input(void)
Definition main.c:564
void ReportSpaceFlightMaxFps(float adjustment)
Definition dib.c:153
int ReadCheaterFlagFromRegistry(void)
Definition gr.c:1499
unsigned int IsPointWithinRange(const FixedVector *from, const FixedVector *to, short range)
Definition geom.c:913
void CheckLauncherAndConfig(void)
Definition winmain.c:513
HWND GetMainWindowHandle(void)
Definition winmain.c:1040
void RestoreGamePalette(void)
Definition winmain.c:76
void SetInputKeyState(int scanCode, unsigned char pressed)
Definition eventmgr.c:822
short MinShort(short a, short b)
Definition mathutil.c:20
void DIBslamReal(void)
Definition dib.c:519
void DIBinstall(HWND window)
Definition dib.c:241
short find_ratio(short inputMinimum, short inputMaximum, short input, short outputMinimum, short outputMaximum)
Definition logic.c:1352
void DIBreInstall(void)
Definition dib.c:224
void FreeGuardedAllocation(void *memory)
Definition winmain.c:1147
short ok_hazard_spot(short obj)
Definition winmain.c:349
void DIBpositionWindow(void)
Definition dib.c:213
void Streamer_close(void)
Definition gr.c:1479
int main(short argc, char **argv)
Definition main.c:171
LRESULT CALLBACK MainWindowProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
Definition winmain.c:823
void QueueInputEvent(int type, int x, int y, int value, int primaryButton, int secondaryButton, unsigned int timestamp)
Definition eventmgr.c:114
void __stdcall SetMouseHomePosition(short x, short y)
Definition eventmgr.c:581
void extra_hazard(short obj)
Definition winmain.c:375
unsigned int PumpWindowMessages(void)
Definition winmain.c:740
void copy_frame(short source, short destination)
Definition geom.c:585
void CheckAllGuardedAllocations(void)
Definition winmain.c:1107
short signed_random(short range)
Definition logic.c:160
void GetJoystickDevCaps(short joystick, unsigned short *xMin, unsigned short *xMax, unsigned short *yMin, unsigned short *yMax)
Definition winmain.c:1012
void alter_yaw(short angle, short obj)
Definition geom.c:627
void MonoDebug_install(void)
Definition mono.c:331
void WaitForVerticalBlankThunk(void)
Definition mathfp.c:158
void init_hazard(short obj, FixedVector position, short moving)
Definition winmain.c:200
void InitializeAudioSystem(HWND window)
Definition sound.c:25
HINSTANCE GetApplicationInstance(void)
Definition winmain.c:1032
void ScaleFixedVector(const FixedVector *vector, int scale, FixedVector *result)
Definition geom.c:322
unsigned int GetF1KeyLatch(void)
Definition winmain.c:817
void SetVectorFixedPoint(FixedVector *p, short v)
Definition geom.c:907
void __stdcall WarpMouseTo(short x, short y)
Definition winmain.c:501
HDC GetMainWindowDeviceContext(void)
Definition winmain.c:1048
short GetJoystickButtons(void)
Definition winmain.c:1005
void SubtractFixedVectors(FixedVector *left, FixedVector *right, FixedVector *difference)
Definition geom.c:305
short real_velocity(short obj)
Definition ship.c:431
void start_hazard_field(short region)
Definition winmain.c:448
short within_field(const HazardField *field, const FixedVector *point)
Definition winmain.c:288
void approach(short obj)
Definition winmain.c:382
short RandomBelow(short n)
Definition mathfp.c:29
void ReportHeapGuardCorruption(void *memory, int count, int overrun)
Definition winmain.c:1092
void align(short *value, short quantum)
Definition winmain.c:190
short find_vacant_3d_object(void)
Definition geom.c:987
void SignalAudioMixerWakeEvent(void)
Definition gr.c:1349
short near_field(const HazardField *field, const FixedVector *point)
Definition winmain.c:280
short make_hazard(void)
Definition winmain.c:361
void point_at(short obj, FixedVector point)
Definition geom.c:152
short difficulty(void)
Definition winmain.c:154
int PromptInsertCorrectCd(void)
Definition winsys.c:278
short asteroid_velocity(void)
Definition winmain.c:160
void ShowNoticeMessageBox(const char *text)
Definition winmain.c:657
short try_far_spot(FixedVector *spot, short *moving)
Definition winmain.c:295
void SaveGamePalette(void)
Definition winmain.c:61
short MaxShort(short a, short b,...)
Definition mathutil.c:29
void manage_hazard(short obj, short slot)
Definition winmain.c:396
short rear_sphere(void)
Definition winmain.c:342
int WINAPI WinMain(HINSTANCE instance, HINSTANCE previous, LPSTR commandLine, int showCommand)
Definition winmain.c:559
void add_hazard_field(enum ObjectType type, FixedVector center, short radius, short density)
Definition winmain.c:461
short __stdcall RandomInRange(short lo, short hi)
Definition mathfp.c:49
void update_hazards(void)
Definition winmain.c:426
void remove_all_hazards(void)
Definition winmain.c:141
void CreateDebugOverlayConsole(HINSTANCE module, HWND window, short columns, short rows)
Definition pilot.cpp:168
short RandomBelowOrEqual(short n)
Definition mathfp.c:59
int CreateMainWindow(HINSTANCE instance, HINSTANCE previous, int showCommand)
Definition winmain.c:685
void skew_randomly(short obj, short allowReverse)
Definition winmain.c:166
void check_hazards(void)
Definition winmain.c:478
void negate_vector(FixedVector *vector)
Definition geom.c:288
void rotate_about_j(short angle, FixedVector *i, FixedVector *k)
Definition geom.c:528
ObjectType
Definition wcdata.h:54
@ OBJECT_TYPE_ROCK_CHUNK
Definition wcdata.h:95
@ OBJECT_TYPE_ASTEROID_FIELD
Definition wcdata.h:77
@ OBJECT_TYPE_ASTEROID1
Definition wcdata.h:89
@ OBJECT_TYPE_SPACE_MINE
Definition wcdata.h:88
@ OBJECT_CLASS_DUST
Definition wcdata.h:42
@ OBJECT_CLASS_NULL
Definition wcdata.h:38
static signed char acHazardTravelTimeByView[8]
Definition winmain.c:22
char szMainWindowTitle[]
Definition winmain.c:46
char szMainWindowClassName[]
Definition winmain.c:45
int DAT_00465078
Definition winmain.c:40
int DAT_00465084
Definition winmain.c:43
static signed char acHazardPitchRange[8]
Definition winmain.c:26
Declarations for the Win32 shell.
HDC hMainWindowDC
Definition winmain.c:52