113 return GetAsyncKeyState(VK_SHIFT);
119 return GetAsyncKeyState(VK_CONTROL);
143 OutputDebugString(s);
161 *workspace = malloc(
sizeof(**workspace));
162 for (index = 0; index < 1; index++) {
163 (*workspace)[index].width = 5;
164 (*workspace)[index].height = 5;
165 (*workspace)[index].pixels =
166 malloc((*workspace)->width * (*workspace)->height);
167 memset((*workspace)[index].pixels, 5,
168 (*workspace)->width * (*workspace)->height);
180 free(((
FontWorkspace *)((
unsigned char *)*workspace + offset))->pixels);
195 GetCurrentDirectoryA(0xff, current);
198 sprintf(result,
"%c:%s", drive,
203 if (strstr(current,
"gamedat") != 0)
204 sprintf(result,
"%s\\..\\%s", current,
"streams\\");
206 sprintf(result,
"%s\\%s", current,
"streams\\");
207 GetCurrentDirectoryA(0xff, current);
208 if (!SetCurrentDirectoryA(result))
210 SetCurrentDirectoryA(current);
216 const char *directory)
223 DWORD maximumComponentLength;
231 for (scanDrive =
'a'; scanDrive <=
'z'; scanDrive++) {
232 sprintf(scanRoot,
"%c:\\", (
char)scanDrive);
233 if (GetDriveTypeA(scanRoot) == DRIVE_CDROM) {
234 drives[driveCount] = (char)scanDrive;
240 for (i = 0; i < driveCount; i++) {
242 sprintf(root,
"%c:\\", drive);
243 GetVolumeInformationA(root, volume, 0xff, 0,
244 &maximumComponentLength, &flags,
245 filesystem,
sizeof(filesystem));
246 if (memcmp(label,
"<anydisc>", 10) == 0) {
251 }
else if (strcmp(volume, label) == 0) {
269 GetCurrentDirectoryA(0xff, current);
270 sprintf(path,
"%c:%s", drive, directory);
271 if (SetCurrentDirectoryA(path) != 0)
273 SetCurrentDirectoryA(current);
283 strcpy(title,
"Insert Correct CD");
285 "Please place The Kilrathi Saga disc %d into your CD-ROM drive and click OK\n"
286 "or click cancel to quit",
291 }
while (MessageBoxA(0, message, title,
292 MB_OKCANCEL | MB_ICONEXCLAMATION) != IDCANCEL);
299 short fd = (short)_open(path, 0x8002);
unsigned int nSystemKeyDown
HANDLE hSingleInstanceSemaphore
unsigned long dwGameClockBaseValue
struct GuardedAllocation * pGuardedAllocationTail
Umbrella header for the game core.
void InitGameClockEpoch(void)
void SetMousePosition(int x, int y)
unsigned int PollKeyboardState(void)
void FreeFontWorkspace(FontWorkspace **workspace)
short __stdcall OpenDataFileOrDie(const char *path)
char * LocateStreamsDirOnDisc(void)
FontWorkspace ** AllocateFontWorkspace(short fontIndex)
int GetControlKeyState(void)
char FindCdRomDriveByVolumeLabel(const char *label, const char *directory)
unsigned int GetGameClockTicks(void)
int PromptInsertCorrectCd(void)
void SetMousePositionDuplicate(int x, int y)
int SetCurrentDirOnDrive(char drive, const char *directory)
int GetShiftKeyState(void)
void WriteDebugString(const char *s)
unsigned int GetKeyboardModifiers(void)
static int nDownArrowKeyState
static char szStreamsDir[0x100]
static int nOemPeriodKeyStatus
static unsigned char abUnusedPollArea[0x80]
static int nInsertKeyDown
static int nPageUpKeyState
static int nLeftArrowKeyState
static int nClearKeyState
static int nUpArrowKeyState
static int nPageDownKeyHeld
static int nOemCommaKeyPressed
static int nClearedKeyboard
static int nRightArrowKeyHeld
static int nDeleteKeyDown