-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathGELIB.H
165 lines (138 loc) · 5.04 KB
/
GELIB.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/* Catacomb Abyss Source Code
* Copyright (C) 1993-2014 Flat Rock Software
*
* This program is free software; you can redistribute it 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
///////////////////////////////////////////////////////////////////////////
//
// Defines
//
#define MAX_TEXT_PAGES 40
#define SAVEVER_DATA "0.93"
#define FILENAME_LEN 15
#define GAMENAME "CATACOMB ABYSS 3-D"
#define VERSION "V1.24 "
#define REVISION "1"
//#define BOBLIST 1 //SP - Undefine if not using BOBList
#define AUDIO_DISK (2)
#define VIDEO_DISK (1)
#define LEVEL_DISK (2)
#define BIO_BUFFER_LEN (512)
#define TrashProg Quit
///////////////////////////////////////////////////////////////////////////
//
// Externs
//
extern char Filename[], ID[], VER[];
extern boolean ge_textmode;
extern short PPT_LeftEdge,PPT_RightEdge;
//extern boolean ConserveMemory;
typedef struct Sample {
char *filename;
memptr *data;
} Sample;
typedef enum {ged_none, ged_SoundSource,ged_SoundBlaster} AudioDeviceType;
typedef struct {
memptr textptr;
char far *pages[MAX_TEXT_PAGES];
short totalpages;
} textinfo;
typedef struct {
int handle; // handle of file
memptr buffer; // pointer to buffer
word offset; // offset into buffer
word status; // read/write status
} BufferedIO;
typedef enum ANIMINFO {at_NONE,at_INIT,at_WAIT,at_ONCE,at_CYCLE,
at_REBOUND,at_EXTRA,
at_FWD,at_REV
} ANIMINFO;
struct BitMapHeader {
unsigned int w,h,x,y;
unsigned char d,trans,comp,pad;
};
struct BitMap {
unsigned int Width;
unsigned int Height;
unsigned int Depth;
unsigned int BytesPerRow;
char far *Planes[8];
};
struct Shape {
memptr Data;
long size;
unsigned int BPR;
struct BitMapHeader bmHdr;
};
///////////////////////////////////////////////////////////////////////////
//
// Function prototypes
//
void WaitKeyVBL(short key, short vbls);
void CalibrateJoystick(short joynum);
void MoveScreen(short x, short y);
void MoveGfxDst(short x, short y);
void DoPiracy(void);
void PrintPropText(char far *text);
void DisplayText(textinfo *textinfo);
long LoadTextFile(char *filename,textinfo *textinfo);
void FreeTextFile(textinfo *textinfo);
void InitTextFile(textinfo *textinfo);
long Verify(char *filename);
void GE_SaveGame(void);
boolean GE_LoadGame(void);
int GE_HardError(word errval,int ax,int bp,int si);
#ifdef BOBLIST
boolean UpdateBOBList(objtype *obj,struct Simple_Shape *Shape,shapeclass Class, short priority, spriteflags sprflags);
boolean RemoveBOBShape(objtype *obj, shapeclass Class);
void RemoveBOBList(objtype *obj);
void InitBOBList(objtype *obj, struct BOB_Shape *BOB_Shape, short NumElements);
void RefreshBOBList(objtype *obj);
#endif
unsigned long BLoad(char *SourceFile, memptr *DstPtr);
void lzwDecompressFromRAM(byte far *SrcPtr, byte far *DstPtr, longword SrcLen);
void lzwDecompressFromFile(BufferedIO *SrcPtr, byte far *DstPtr, longword SrcLen);
byte readch(int handle);
memptr InitBufferedIO(int handle, BufferedIO *bio);
void FreeBufferedIO(BufferedIO *bio);
byte bio_readch(BufferedIO *bio);
void bio_fillbuffer(BufferedIO *bio);
void SwapLong(long far *Var);
void SwapWord(unsigned int far *Var);
int LoadShape(char *Filename,struct Shape *SHP);
void FreeShape(struct Shape *shape);
int UnpackEGAShapeToScreen(struct Shape *SHP,int startx,int starty);
char GetKeyChoice(char *choices,boolean clear);
boolean AnimateObj(objtype *obj);
void AdvanceAnimFWD(objtype *obj);
void AdvanceAnimREV(objtype *obj);
void LoadASArray(struct Sample *ASArray);
void FreeASArray(struct Sample *ASArray);
//void SelectDigiAudio(AudioDeviceType Device);
void PlaySample(unsigned SampleNum);
void GE_FreeAllDigiSounds(void);
void GE_LoadAllDigiSounds(void);
void DisplayGameList(short winx, short winy, short list_width, short list_height);
void ReadGameList(void);
void CheckStack(void);
void CenterObj(objtype *obj, unsigned x, unsigned y);
void cachein(short s,short e);
void cacheout(short s,short e);
void FizzleFade (unsigned source, unsigned dest,unsigned width,unsigned height, boolean abortable);
void mprintf(char *msg, ...);
boolean FindFile(char *filename,char *disktext,char disknum);
void CacheAV(char *title);
void BlackPalette(void);
void ColoredPalette(void);