/* Lcars24.h, defines and globals for LCARS 24 */
/* Windows version */

/* This program is free software. You may redistribute and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License or
 * (at your option) any later version.
 *
 * Refer to the file C:\LCARS24\DATA\COPYING.TXT for details.
 */


#ifndef LCARS24_H
#define LCARS24_H


#define BS				0x3F08
#define ENTER				       13
#define ESC				       27

#define F1				0x2F00
#define F2				0x3000
#define F3				0x3100
#define F4				0x3200
#define F5				0x3300
#define F6				0x3400
#define F7				0x3500
#define F8				0x3600
#define F9				0x3700
#define F10				0x3800
#define F11				0x3900
#define F12				0x3A00

#define SHFT_F1				0x2F01
#define SHFT_F2				0x3001
#define SHFT_F3				0x3101
#define SHFT_F4				0x3201
#define SHFT_F5				0x3301
#define SHFT_F6				0x3401
#define SHFT_F7				0x3501
#define SHFT_F8				0x3601
#define SHFT_F9				0x3701
#define SHFT_F10			0x3801
#define SHFT_F11			0x3901
#define SHFT_F12			0x3A01

#define CTRL_F1		 		0x2F02
#define CTRL_F2				0x3002
#define CTRL_F3				0x3102
#define CTRL_F4				0x3202
#define CTRL_F5				0x3302
#define CTRL_F6				0x3402
#define CTRL_F7				0x3502
#define CTRL_F8				0x3602
#define CTRL_F9				0x3702
#define CTRL_F10				0x3802
#define CTRL_F11				0x3902
#define CTRL_F12				0x3A02

#define ALT_F1		 		0x2F04
#define ALT_F2				0x3004
#define ALT_F3				0x3104
#define ALT_F4				0x3204
#define ALT_F5				0x3304
#define ALT_F6				0x3404
#define ALT_F7				0x3504
#define ALT_F8				0x3604
#define ALT_F9				0x3704
#define ALT_F10				0x3804
#define ALT_F11				0x3904
#define ALT_F12				0x3A04

#define LEFTARROW			0x5200
#define RIGHTARROW			0x5300
#define UPARROW				0x5400
#define DOWNARROW			0x5500
#define SHFT_LEFTARROW			0x5201
#define SHFT_RIGHTARROW			0x5301
#define SHFT_UPARROW			0x5401
#define SHFT_DOWNARROW			0x5501
#define CTRL_LEFTARROW			0x5202
#define CTRL_RIGHTARROW			0x5302
#define CTRL_UPARROW			0x5402
#define CTRL_DOWNARROW			0x5502
#define SHFT_CTRL_LEFTARROW		0x5203
#define SHFT_CTRL_RIGHTARROW		0x5303
#define SHFT_CTRL_UPARROW		0x5403
#define SHFT_CTRL_DOWNARROW		0x5503

#define HOMEKEY				0x4E00
#define ENDKEY				0x4F00
#define PGUPKEY				0x5000
#define PGDNKEY				0x5100
#define SHFT_HOMEKEY			0x4E01
#define SHFT_ENDKEY			0x4F01
#define SHFT_PGUPKEY			0x5001
#define SHFT_PGDNKEY			0x5101
#define CTRL_HOMEKEY			0x4E02
#define CTRL_ENDKEY			0x4F02
#define CTRL_PGUPKEY			0x5002
#define CTRL_PGDNKEY			0x5102
#define INSKEY				0x4C00
#define DELKEY				0x4D00
#define SHFT_INSKEY			0x4C01
#define SHFT_DELKEY			0x4D01
#define CTRL_INSKEY			0x4C02
#define CTRL_DELKEY			0x4D02


#define LINELENGTH 96
#define LINECOUNT 4096
#define MAXPROGRAMS 30

#include <stdio.h>
#include <stdlib.h>
/* #include <bios.h> */
#include <dos.h>
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include <sys/stat.h>
/* #include <sys/exceptn.h> */
#include <dir.h>
#include <malloc.h> /* The math engine wanted this. */
#include <math.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
/* #include <pc.h>	*/
#include <process.h>
/* #include <dpmi.h>	*/
#include <float.h>
#include <allegro.h>
#include <jpgalleg.h>
#include "algif.h"


char Ln[LINECOUNT][LINELENGTH];
char ProgramPath[MAXPROGRAMS][LINELENGTH];
char Highlight[LINELENGTH];
char MathInput[2][80];
char MathOutput[80];
char ErrMessage[256];
char DosVerStr[80];
char CurrentFile[256];
char AppTitle[MAXPROGRAMS][LINELENGTH];
char LcarsExeName[256];
char NewName[256];
int NumOfFiles;
char file_too_long;
char load_abort;
int EndAppList;
int NumOfApps;
char NoAppList;
int c;
int t;
int EndText;
char PickMode;
char AppPage;
int OldPWy;
int PWx;
int PWy;
int PickWindowOffset;
int MaxX;
int MaxY;
char DosDetected;
char GifList[100][256];
int EndGifList;
char VoiceList[100][256];
int EndVoiceList;
char BeepList[100][256];
int EndBeepList;

float m;	/* magnification factor from VGA for brackets */
int uy;	/* brackets: upper edge of divider */
int ly;	/* brackets: lower edge of divider */
extern int _doserrno;
char CurrentTrack[30];
char TimeDisplay[6];
char DateDisplay[6];
char SecDisplay[3];
char SecWhenAlarmSet[3]; /* to seed random music selection for alarm */
char TimeSetting[6];
char DateSetting[6];
char YearDisplay[5];
char old_sec;
char min_old;
char day_old;
int Hours, Minutes, Seconds;
int DateMonth, DateDay, DateYear;
int DayOfMonth;
char SettingType;
int AlarmHour;
int AlarmMin;
int SingleAlarmOnOff;
int MidiPlaying;
char AlarmString[11];
char KeyInStr[80];
char MathClip[80];
char DosClip[80];
char LcarsPath[256];
char CurrentPath[256];
char PathOfDriveC[128];
char PathOfDriveA[128];

size_t w,cx,cy,dx; /* for keyboard input */
int x, y;
size_t k;  /* for strlen */
int TimeColor;
int BracketColor1, BracketColor2;
char DriveChange;
char DirectoryChange;
int ProgramType;
char DosFolderArray[100][256];
char DosFileArray[100][256];
int NumOfFolders;
int TotalBytes;
char CopyPath[256];
int CurrentDrive;
int DepthFound, ScreenSize;
int W1Current;
char PathName[256];
char StarDate[10];
int null;
int BlasterOK;
char MuteBeeps;
char BeepSet;
char AlarmType;
char ColorScheme;
char AudioOff;
int SnoozeVal;
int SnoozeAlarmMin;
int Timers[15];
/* for Viewscreen */
int VsOffsetX;
int VsOffsetY;
int VsImageW, VsImageH;
int VsZoom, VsPrevZoom;
char VsScroll;
BITMAP *VsImage;
BITMAP *VsBuf;
PALETTE VsPalette;
char Endgame; /* special pallete flag */
char MonoType;
char MilitaryTime;
char *ProgramFolder;
int DeltaHr, DeltaMn, DeltaSc, DeltaDa, DeltaMo, DeltaYr;
int IdleTime, IdleLimit;
char Relaunch;
char SlideshowActive;
int Autorun;
int SecondsCounter;
int TimerOldSec;

#endif


