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

Data files and packet fetching with retries, text-font setup and input waits. More...

#include "wc1.h"

Go to the source code of this file.

Functions

void ReportPacketLoadError (void *packet, short logicalFile, short retry, short section, const char *sourceTag)
void * LoadPacketIntoBuffer (short logicalFile, short section, void *destination)
void * LoadPacketAllocated (short logicalFile, short section)
void * FetchDiskPacketRetrying (short logicalFile, short section, short flags)
unsigned int InitializeTextContextFromFont (TextContext *context, short fontIndex, unsigned char colour, signed char background)
unsigned int ReleaseTextFont (short fontIndex)
unsigned int DrawTextAt (TextContext *context, short x, short y, const char *text, unsigned char alignment)
unsigned int SortSignedByteValuesAscending (signed char *values, short count)
short OpenDiskDataFile (short logicalFile)
void __stdcall PromptInsertNumberedDisk (short logicalFile)
unsigned int SetDiskFileNumber (char *fileName, short diskNumber)
unsigned int GetZeroUnused (void)
short CheckEscaped (void)
short WaitForInputKey (void)
void WaitForSceneAdvance (short duration, short unused)
void MoveMenuPointerFromKeyboard (InputEventState *event)
void EraseLastTextInputCharacter (void)
short WaitForStreamInputKey (void)

Variables

const char * apszGraphicsModeNames [4]
const char * pszPacketReadOperation = "reading from disk"
const char * pszPacketAllocationOperation = "allocating memory"
const char * pszPacketLoadErrorFormat
char szDiskMarkerFile [9] = "DISK.000"
short nDiskPromptBorderColour = 0x50
const char * DAT_00469698 [3]
short nKeyboardPointerStep = 4
DiskFileRecord * pDiskFileRecords
Viewport stDiskPromptBgView
unsigned char abDiskPromptDriveStates [0x20]
Viewport stDiskPromptViewport
int bPtrMovedByKeyboardState
TextContext stDiskPromptTextContext
ShortRect stDiskPromptBounds

Detailed Description

Data files and packet fetching with retries, text-font setup and input waits.

Address range 41d120-41dedf; the Mac ship unit begins right after it, with initialize_object at 41dee0.

Definition in file disk.c.

Function Documentation

◆ CheckEscaped()

◆ DrawTextAt()

◆ EraseLastTextInputCharacter()

◆ FetchDiskPacketRetrying()

void * FetchDiskPacketRetrying ( short logicalFile,
short section,
short flags )

Definition at line 126 of file disk.c.

References AllocateViewport(), cBlackColour, ClearInputKeyStatePreservingModifiers(), cPrimaryViewBufferColour, FetchDiskPacketRetrying(), free_viewport(), FreePacketAndClear(), GetFixedOneMillionThunkAlt(), GetPacketSize(), nPacketError, PacketLoad(), pDiskFileRecords, Viewport::pixels, PromptInsertNumberedDisk(), ReportPacketLoadError(), stSceneBuffer, and stSpaceBufferViewport.

Referenced by AwardCampaignMedal(), BarracksScreen(), BriefingMap_LoadShapes(), death_sequence(), DeBriefing(), Dismissed(), DrawBriefingLongShot(), DrawPendingCockpitDamage(), DrawPodiumShot(), ejection_sequence(), EnterPilotNameAndCallsign(), EstablishingShot(), explosion_draw(), FetchDiskPacketRetrying(), funeral_sequence(), get_right_shape(), InflightComputer(), init_constellation(), initialize_cockpit(), InitializeConstellationObject(), InitializeEventManagerResources(), InitializeTextContextFromFont(), landing(), LaunchPlayerShip(), load_ship(), LoadAnswerPromptAndResponse(), LoadBriefingData(), LoadBriefingRoom(), LoadCommDisplayResources(), LoadCommPortraitShape(), LoadFace(), LoadMissionData(), LoadPacketResourceList(), LoadSceneAnimationResources(), LoadShapeSet(), LoadTrainSimOpponentShape(), Office(), PlayScrambleHangarScene(), RecRoom(), ReturnToBriefingLongShot(), scramble(), ShowCampaignVictorySequence(), ShowCarrierLaunchSequence(), ShowChalkBoard(), ShowGameOverScreen(), ShowGetReadyScreen(), ShowMeanwhileTransition(), ShowTheEndScreen(), ShowTigerClawEscapeScene(), ShowTrainSimHighScores(), ShowVictoryScreen(), stranded_sequence(), Title_Sequence(), and ViewMedals().

◆ GetZeroUnused()

unsigned int GetZeroUnused ( void )

Definition at line 436 of file disk.c.

References GetZeroUnused().

Referenced by GetZeroUnused().

◆ InitializeTextContextFromFont()

◆ LoadPacketAllocated()

◆ LoadPacketIntoBuffer()

void * LoadPacketIntoBuffer ( short logicalFile,
short section,
void * destination )

◆ MoveMenuPointerFromKeyboard()

◆ OpenDiskDataFile()

◆ PromptInsertNumberedDisk()

◆ ReleaseTextFont()

◆ ReportPacketLoadError()

◆ SetDiskFileNumber()

unsigned int SetDiskFileNumber ( char * fileName,
short diskNumber )

Definition at line 419 of file disk.c.

References apszGraphicsModeNames, bSlowSceneAnimation, ConvertChar_Int(), and SetDiskFileNumber().

Referenced by SetDiskFileNumber().

◆ SortSignedByteValuesAscending()

unsigned int SortSignedByteValuesAscending ( signed char * values,
short count )

Definition at line 258 of file disk.c.

References SortSignedByteValuesAscending().

Referenced by SortSignedByteValuesAscending().

◆ WaitForInputKey()

◆ WaitForSceneAdvance()

◆ WaitForStreamInputKey()

Variable Documentation

◆ abDiskPromptDriveStates

unsigned char abDiskPromptDriveStates[0x20]

Definition at line 41 of file disk.c.

Referenced by main(), and OpenDiskDataFile().

◆ apszGraphicsModeNames

const char* apszGraphicsModeNames[4]
Initial value:
= {
"vga",
"ega",
"cga",
"tga"
}

Definition at line 12 of file disk.c.

Referenced by SetDiskFileNumber().

◆ bPtrMovedByKeyboardState

int bPtrMovedByKeyboardState

◆ DAT_00469698

const char* DAT_00469698[3]
Initial value:
= {
"(OVR)", "", 0
}

Definition at line 30 of file disk.c.

◆ nDiskPromptBorderColour

short nDiskPromptBorderColour = 0x50

Definition at line 28 of file disk.c.

Referenced by InitializeDiskPromptTextContext(), and PromptInsertNumberedDisk().

◆ nKeyboardPointerStep

short nKeyboardPointerStep = 4

Definition at line 33 of file disk.c.

Referenced by MoveMenuPointerFromKeyboard().

◆ pDiskFileRecords

◆ pszPacketAllocationOperation

const char* pszPacketAllocationOperation = "allocating memory"

Definition at line 19 of file disk.c.

Referenced by ReportPacketLoadError().

◆ pszPacketLoadErrorFormat

const char* pszPacketLoadErrorFormat
Initial value:
=
"Sorry, an error has occured while %s.\n"
"Please note the following information:\n"
"%s #%d (ERR %d PS%ld LB%ld FL%d) at %s\n"
"Check your configuration. If this problem persists, please\n"
"call Origin Systems' service line. We are sorry for the inconvenience."

Definition at line 21 of file disk.c.

Referenced by ReportPacketLoadError().

◆ pszPacketReadOperation

const char* pszPacketReadOperation = "reading from disk"

Definition at line 18 of file disk.c.

Referenced by ReportPacketLoadError().

◆ stDiskPromptBgView

Viewport stDiskPromptBgView

Definition at line 37 of file disk.c.

Referenced by PromptInsertNumberedDisk().

◆ stDiskPromptBounds

ShortRect stDiskPromptBounds

Definition at line 45 of file disk.c.

Referenced by InitializeDiskPromptTextContext(), and PromptInsertNumberedDisk().

◆ stDiskPromptTextContext

TextContext stDiskPromptTextContext

Definition at line 44 of file disk.c.

Referenced by InitializeDiskPromptTextContext(), and PromptInsertNumberedDisk().

◆ stDiskPromptViewport

Viewport stDiskPromptViewport

Definition at line 42 of file disk.c.

Referenced by InitializeDiskPromptTextContext(), and PromptInsertNumberedDisk().

◆ szDiskMarkerFile

char szDiskMarkerFile[9] = "DISK.000"

Definition at line 27 of file disk.c.

Referenced by OpenDiskDataFile().