Wing Commander
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
winsys.c File Reference

Win32 system services: mouse, keyboard and clock wrappers, font workspaces, CD-ROM location and disc-swap prompts. More...

#include "wc1.h"

Go to the source code of this file.

Functions

void SetMousePosition (int x, int y)
unsigned int PollKeyboardState (void)
int GetShiftKeyState (void)
int GetControlKeyState (void)
unsigned int GetKeyboardModifiers (void)
unsigned int GetGameClockTicks (void)
void InitGameClockEpoch (void)
void WriteDebugString (const char *s)
void SetMousePositionDuplicate (int x, int y)
FontWorkspace ** AllocateFontWorkspace (short fontIndex)
void FreeFontWorkspace (FontWorkspace **workspace)
char * LocateStreamsDirOnDisc (void)
char FindCdRomDriveByVolumeLabel (const char *label, const char *directory)
int SetCurrentDirOnDrive (char drive, const char *directory)
int PromptInsertCorrectCd (void)
short __stdcall OpenDataFileOrDie (const char *path)

Variables

static int nInsertKeyDown
static int nClearedKeyboard
static unsigned char abUnusedPollArea [0x80]
static int nOemPeriodKeyStatus
static int nHomeState
static int nPageDownKeyHeld
static int nOemCommaKeyPressed
static int nRightArrowKeyHeld
static int nEndKeyDown
static int nClearKeyState
static int nDeleteKeyDown
static int nUpArrowKeyState
static int nDownArrowKeyState
static char szStreamsDir [0x100]
static int nPageUpKeyState
static int nLeftArrowKeyState
HWND hMainWindow
HANDLE hSingleInstanceSemaphore
unsigned long dwGameClockBaseValue
struct GuardedAllocation * pGuardedAllocationTail
char szMemoryUsage [0x80]

Detailed Description

Win32 system services: mouse, keyboard and clock wrappers, font workspaces, CD-ROM location and disc-swap prompts.

Address range 402e80-4034ff. It is one unit, not two: PollKeyboardState's statics and LocateStreamsDirOnDisc's szStreamsDir interleave in the original's .bss (475b68-475d1f), and statics are private to one object. Its string literals occupy 46535c-4653fc.

Definition in file winsys.c.

Function Documentation

◆ AllocateFontWorkspace()

FontWorkspace ** AllocateFontWorkspace ( short fontIndex)

Definition at line 155 of file winsys.c.

References AllocateFontWorkspace().

Referenced by AllocateFontWorkspace(), and InitializeTextContextFromFont().

◆ FindCdRomDriveByVolumeLabel()

char FindCdRomDriveByVolumeLabel ( const char * label,
const char * directory )

◆ FreeFontWorkspace()

void FreeFontWorkspace ( FontWorkspace ** workspace)

Definition at line 174 of file winsys.c.

References FreeFontWorkspace().

Referenced by FreeFontWorkspace(), and ReleaseTextFont().

◆ GetControlKeyState()

int GetControlKeyState ( void )

◆ GetGameClockTicks()

unsigned int GetGameClockTicks ( void )

Definition at line 129 of file winsys.c.

References dwGameClockBaseValue, and GetGameClockTicks().

Referenced by GetGameClockTicks(), and SplitGameClockTicks().

◆ GetKeyboardModifiers()

unsigned int GetKeyboardModifiers ( void )

◆ GetShiftKeyState()

int GetShiftKeyState ( void )

Definition at line 111 of file winsys.c.

References GetShiftKeyState().

Referenced by GetShiftKeyState(), process_player_input(), QueueInputEvent(), and ReadTextInput().

◆ InitGameClockEpoch()

void InitGameClockEpoch ( void )

Definition at line 135 of file winsys.c.

References dwGameClockBaseValue, and InitGameClockEpoch().

Referenced by InitGameClockEpoch(), and WinMain().

◆ LocateStreamsDirOnDisc()

char * LocateStreamsDirOnDisc ( void )

◆ OpenDataFileOrDie()

short __stdcall OpenDataFileOrDie ( const char * path)

◆ PollKeyboardState()

◆ PromptInsertCorrectCd()

int PromptInsertCorrectCd ( void )

Definition at line 278 of file winsys.c.

References LocateStreamsDirOnDisc(), and PromptInsertCorrectCd().

Referenced by PromptInsertCorrectCd(), and WinMain().

◆ SetCurrentDirOnDrive()

int SetCurrentDirOnDrive ( char drive,
const char * directory )

Definition at line 262 of file winsys.c.

References SetCurrentDirOnDrive().

Referenced by FindCdRomDriveByVolumeLabel(), and SetCurrentDirOnDrive().

◆ SetMousePosition()

◆ SetMousePositionDuplicate()

void SetMousePositionDuplicate ( int x,
int y )

◆ WriteDebugString()

void WriteDebugString ( const char * s)

Definition at line 141 of file winsys.c.

References WriteDebugString().

Referenced by exit_squadron(), sound_effect(), SoundFxTick(), and WriteDebugString().

Variable Documentation

◆ abUnusedPollArea

unsigned char abUnusedPollArea[0x80]
static

Definition at line 21 of file winsys.c.

◆ dwGameClockBaseValue

unsigned long dwGameClockBaseValue

Definition at line 51 of file winsys.c.

Referenced by GetGameClockTicks(), and InitGameClockEpoch().

◆ hMainWindow

HWND hMainWindow

◆ hSingleInstanceSemaphore

HANDLE hSingleInstanceSemaphore

Definition at line 50 of file winsys.c.

Referenced by AbortToDesktop(), ShutdownGameWindow(), and WinMain().

◆ nClearedKeyboard

int nClearedKeyboard
static

Definition at line 19 of file winsys.c.

Referenced by PollKeyboardState().

◆ nClearKeyState

int nClearKeyState
static

Definition at line 34 of file winsys.c.

Referenced by PollKeyboardState().

◆ nDeleteKeyDown

int nDeleteKeyDown
static

Definition at line 36 of file winsys.c.

Referenced by PollKeyboardState().

◆ nDownArrowKeyState

int nDownArrowKeyState
static

Definition at line 40 of file winsys.c.

Referenced by PollKeyboardState().

◆ nEndKeyDown

int nEndKeyDown
static

Definition at line 33 of file winsys.c.

Referenced by PollKeyboardState().

◆ nHomeState

int nHomeState
static

Definition at line 25 of file winsys.c.

Referenced by PollKeyboardState().

◆ nInsertKeyDown

int nInsertKeyDown
static

Definition at line 18 of file winsys.c.

Referenced by PollKeyboardState().

◆ nLeftArrowKeyState

int nLeftArrowKeyState
static

Definition at line 45 of file winsys.c.

Referenced by PollKeyboardState().

◆ nOemCommaKeyPressed

int nOemCommaKeyPressed
static

Definition at line 29 of file winsys.c.

Referenced by PollKeyboardState().

◆ nOemPeriodKeyStatus

int nOemPeriodKeyStatus
static

Definition at line 23 of file winsys.c.

Referenced by PollKeyboardState().

◆ nPageDownKeyHeld

int nPageDownKeyHeld
static

Definition at line 27 of file winsys.c.

Referenced by PollKeyboardState().

◆ nPageUpKeyState

int nPageUpKeyState
static

Definition at line 43 of file winsys.c.

Referenced by PollKeyboardState().

◆ nRightArrowKeyHeld

int nRightArrowKeyHeld
static

Definition at line 31 of file winsys.c.

Referenced by PollKeyboardState().

◆ nUpArrowKeyState

int nUpArrowKeyState
static

Definition at line 38 of file winsys.c.

Referenced by PollKeyboardState().

◆ pGuardedAllocationTail

struct GuardedAllocation* pGuardedAllocationTail

Definition at line 52 of file winsys.c.

Referenced by AllocateGuardedMemory(), and FreeGuardedAllocation().

◆ szMemoryUsage

char szMemoryUsage[0x80]

Definition at line 53 of file winsys.c.

Referenced by AbortToDesktop(), and MainWindowProc().

◆ szStreamsDir

char szStreamsDir[0x100]
static

Definition at line 41 of file winsys.c.

Referenced by LocateStreamsDirOnDisc().