mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 11:10:39 +00:00
Whitespace
git-svn-id: https://svn.eduke32.com/eduke32@109 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
fe5671e812
commit
0d411e468e
35 changed files with 29034 additions and 29034 deletions
|
@ -25,268 +25,268 @@ static long bpl, transmode = 0;
|
||||||
static long glogx, glogy, gbxinc, gbyinc, gpinc;
|
static long glogx, glogy, gbxinc, gbyinc, gpinc;
|
||||||
static char *gbuf, *gpal, *ghlinepal, *gtrans;
|
static char *gbuf, *gpal, *ghlinepal, *gtrans;
|
||||||
|
|
||||||
//Global variable functions
|
//Global variable functions
|
||||||
void setvlinebpl(long dabpl) { bpl = dabpl; }
|
void setvlinebpl(long dabpl) { bpl = dabpl; }
|
||||||
void fixtransluscence(long datransoff) { gtrans = (char *)datransoff; }
|
void fixtransluscence(long datransoff) { gtrans = (char *)datransoff; }
|
||||||
void settransnormal(void) { transmode = 0; }
|
void settransnormal(void) { transmode = 0; }
|
||||||
void settransreverse(void) { transmode = 1; }
|
void settransreverse(void) { transmode = 1; }
|
||||||
|
|
||||||
|
|
||||||
//Ceiling/floor horizontal line functions
|
//Ceiling/floor horizontal line functions
|
||||||
void sethlinesizes(long logx, long logy, long bufplc)
|
void sethlinesizes(long logx, long logy, long bufplc)
|
||||||
{ glogx = logx; glogy = logy; gbuf = (char *)bufplc; }
|
{ glogx = logx; glogy = logy; gbuf = (char *)bufplc; }
|
||||||
void setpalookupaddress(char *paladdr) { ghlinepal = paladdr; }
|
void setpalookupaddress(char *paladdr) { ghlinepal = paladdr; }
|
||||||
void setuphlineasm4(long bxinc, long byinc) { gbxinc = bxinc; gbyinc = byinc; }
|
void setuphlineasm4(long bxinc, long byinc) { gbxinc = bxinc; gbyinc = byinc; }
|
||||||
void hlineasm4(long cnt, long skiploadincs, long paloffs, unsigned long by, unsigned long bx, long p)
|
void hlineasm4(long cnt, long skiploadincs, long paloffs, unsigned long by, unsigned long bx, long p)
|
||||||
{
|
{
|
||||||
char *palptr;
|
char *palptr;
|
||||||
|
|
||||||
palptr = (char *)&ghlinepal[paloffs];
|
palptr = (char *)&ghlinepal[paloffs];
|
||||||
if (!skiploadincs) { gbxinc = asm1; gbyinc = asm2; }
|
if (!skiploadincs) { gbxinc = asm1; gbyinc = asm2; }
|
||||||
for(;cnt>=0;cnt--)
|
for(;cnt>=0;cnt--)
|
||||||
{
|
{
|
||||||
*((char *)p) = palptr[gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))]];
|
*((char *)p) = palptr[gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))]];
|
||||||
bx -= gbxinc;
|
bx -= gbxinc;
|
||||||
by -= gbyinc;
|
by -= gbyinc;
|
||||||
p--;
|
p--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Sloped ceiling/floor vertical line functions
|
//Sloped ceiling/floor vertical line functions
|
||||||
void setupslopevlin(long logylogx, long bufplc, long pinc)
|
void setupslopevlin(long logylogx, long bufplc, long pinc)
|
||||||
{
|
{
|
||||||
glogx = (logylogx&255); glogy = (logylogx>>8);
|
glogx = (logylogx&255); glogy = (logylogx>>8);
|
||||||
gbuf = (char *)bufplc; gpinc = pinc;
|
gbuf = (char *)bufplc; gpinc = pinc;
|
||||||
}
|
}
|
||||||
void slopevlin(long p, long i, long slopaloffs, long cnt, long bx, long by)
|
void slopevlin(long p, long i, long slopaloffs, long cnt, long bx, long by)
|
||||||
{
|
{
|
||||||
long *slopalptr, bz, bzinc;
|
long *slopalptr, bz, bzinc;
|
||||||
unsigned long u, v;
|
unsigned long u, v;
|
||||||
|
|
||||||
bz = asm3; bzinc = (asm1>>3);
|
bz = asm3; bzinc = (asm1>>3);
|
||||||
slopalptr = (long *)slopaloffs;
|
slopalptr = (long *)slopaloffs;
|
||||||
for(;cnt>0;cnt--)
|
for(;cnt>0;cnt--)
|
||||||
{
|
{
|
||||||
i = krecip(bz>>6); bz += bzinc;
|
i = krecip(bz>>6); bz += bzinc;
|
||||||
u = bx+globalx3*i;
|
u = bx+globalx3*i;
|
||||||
v = by+globaly3*i;
|
v = by+globaly3*i;
|
||||||
(*(char *)p) = *(char *)(slopalptr[0]+gbuf[((u>>(32-glogx))<<glogy)+(v>>(32-glogy))]);
|
(*(char *)p) = *(char *)(slopalptr[0]+gbuf[((u>>(32-glogx))<<glogy)+(v>>(32-glogy))]);
|
||||||
slopalptr--;
|
slopalptr--;
|
||||||
p += gpinc;
|
p += gpinc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Wall,face sprite/wall sprite vertical line functions
|
//Wall,face sprite/wall sprite vertical line functions
|
||||||
void setupvlineasm(long neglogy) { glogy = neglogy; }
|
void setupvlineasm(long neglogy) { glogy = neglogy; }
|
||||||
void vlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufplc, long p)
|
void vlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufplc, long p)
|
||||||
{
|
{
|
||||||
gbuf = (char *)bufplc;
|
gbuf = (char *)bufplc;
|
||||||
gpal = (char *)paloffs;
|
gpal = (char *)paloffs;
|
||||||
for(;cnt>=0;cnt--)
|
for(;cnt>=0;cnt--)
|
||||||
{
|
{
|
||||||
*((char *)p) = gpal[gbuf[vplc>>glogy]];
|
*((char *)p) = gpal[gbuf[vplc>>glogy]];
|
||||||
p += bpl;
|
p += bpl;
|
||||||
vplc += vinc;
|
vplc += vinc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupmvlineasm(long neglogy) { glogy = neglogy; }
|
void setupmvlineasm(long neglogy) { glogy = neglogy; }
|
||||||
void mvlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufplc, long p)
|
void mvlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufplc, long p)
|
||||||
{
|
{
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
gbuf = (char *)bufplc;
|
gbuf = (char *)bufplc;
|
||||||
gpal = (char *)paloffs;
|
gpal = (char *)paloffs;
|
||||||
for(;cnt>=0;cnt--)
|
for(;cnt>=0;cnt--)
|
||||||
{
|
{
|
||||||
ch = gbuf[vplc>>glogy]; if (ch != 255) *((char *)p) = gpal[ch];
|
ch = gbuf[vplc>>glogy]; if (ch != 255) *((char *)p) = gpal[ch];
|
||||||
p += bpl;
|
p += bpl;
|
||||||
vplc += vinc;
|
vplc += vinc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setuptvlineasm(long neglogy) { glogy = neglogy; }
|
void setuptvlineasm(long neglogy) { glogy = neglogy; }
|
||||||
void tvlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufplc, long p)
|
void tvlineasm1(long vinc, long paloffs, long cnt, unsigned long vplc, long bufplc, long p)
|
||||||
{
|
{
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
gbuf = (char *)bufplc;
|
gbuf = (char *)bufplc;
|
||||||
gpal = (char *)paloffs;
|
gpal = (char *)paloffs;
|
||||||
if (transmode)
|
if (transmode)
|
||||||
{
|
{
|
||||||
for(;cnt>=0;cnt--)
|
for(;cnt>=0;cnt--)
|
||||||
{
|
{
|
||||||
ch = gbuf[vplc>>glogy];
|
ch = gbuf[vplc>>glogy];
|
||||||
if (ch != 255) *((char *)p) = gtrans[(*((char *)p))+(gpal[ch]<<8)];
|
if (ch != 255) *((char *)p) = gtrans[(*((char *)p))+(gpal[ch]<<8)];
|
||||||
p += bpl;
|
p += bpl;
|
||||||
vplc += vinc;
|
vplc += vinc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for(;cnt>=0;cnt--)
|
for(;cnt>=0;cnt--)
|
||||||
{
|
{
|
||||||
ch = gbuf[vplc>>glogy];
|
ch = gbuf[vplc>>glogy];
|
||||||
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<8)+gpal[ch]];
|
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<8)+gpal[ch]];
|
||||||
p += bpl;
|
p += bpl;
|
||||||
vplc += vinc;
|
vplc += vinc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Floor sprite horizontal line functions
|
//Floor sprite horizontal line functions
|
||||||
void msethlineshift(long logx, long logy) { glogx = logx; glogy = logy; }
|
void msethlineshift(long logx, long logy) { glogx = logx; glogy = logy; }
|
||||||
void mhline(long bufplc, unsigned long bx, long cntup16, long junk, unsigned long by, long p)
|
void mhline(long bufplc, unsigned long bx, long cntup16, long junk, unsigned long by, long p)
|
||||||
{
|
{
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
gbuf = (char *)bufplc;
|
gbuf = (char *)bufplc;
|
||||||
gpal = (char *)asm3;
|
gpal = (char *)asm3;
|
||||||
for(cntup16>>=16;cntup16>0;cntup16--)
|
for(cntup16>>=16;cntup16>0;cntup16--)
|
||||||
{
|
{
|
||||||
ch = gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))];
|
ch = gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))];
|
||||||
if (ch != 255) *((char *)p) = gpal[ch];
|
if (ch != 255) *((char *)p) = gpal[ch];
|
||||||
bx += asm1;
|
bx += asm1;
|
||||||
by += asm2;
|
by += asm2;
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tsethlineshift(long logx, long logy) { glogx = logx; glogy = logy; }
|
void tsethlineshift(long logx, long logy) { glogx = logx; glogy = logy; }
|
||||||
void thline(long bufplc, unsigned long bx, long cntup16, long junk, unsigned long by, long p)
|
void thline(long bufplc, unsigned long bx, long cntup16, long junk, unsigned long by, long p)
|
||||||
{
|
{
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
gbuf = (char *)bufplc;
|
gbuf = (char *)bufplc;
|
||||||
gpal = (char *)asm3;
|
gpal = (char *)asm3;
|
||||||
if (transmode)
|
if (transmode)
|
||||||
{
|
{
|
||||||
for(cntup16>>=16;cntup16>0;cntup16--)
|
for(cntup16>>=16;cntup16>0;cntup16--)
|
||||||
{
|
{
|
||||||
ch = gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))];
|
ch = gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))];
|
||||||
if (ch != 255) *((char *)p) = gtrans[(*((char *)p))+(gpal[ch]<<8)];
|
if (ch != 255) *((char *)p) = gtrans[(*((char *)p))+(gpal[ch]<<8)];
|
||||||
bx += asm1;
|
bx += asm1;
|
||||||
by += asm2;
|
by += asm2;
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for(cntup16>>=16;cntup16>0;cntup16--)
|
for(cntup16>>=16;cntup16>0;cntup16--)
|
||||||
{
|
{
|
||||||
ch = gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))];
|
ch = gbuf[((bx>>(32-glogx))<<glogy)+(by>>(32-glogy))];
|
||||||
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<8)+gpal[ch]];
|
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<8)+gpal[ch]];
|
||||||
bx += asm1;
|
bx += asm1;
|
||||||
by += asm2;
|
by += asm2;
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Rotatesprite vertical line functions
|
//Rotatesprite vertical line functions
|
||||||
void setupspritevline(long paloffs, long bxinc, long byinc, long ysiz)
|
void setupspritevline(long paloffs, long bxinc, long byinc, long ysiz)
|
||||||
{
|
{
|
||||||
gpal = (char *)paloffs;
|
gpal = (char *)paloffs;
|
||||||
gbxinc = bxinc;
|
gbxinc = bxinc;
|
||||||
gbyinc = byinc;
|
gbyinc = byinc;
|
||||||
glogy = ysiz;
|
glogy = ysiz;
|
||||||
}
|
}
|
||||||
void spritevline(long bx, long by, long cnt, long bufplc, long p)
|
void spritevline(long bx, long by, long cnt, long bufplc, long p)
|
||||||
{
|
{
|
||||||
gbuf = (char *)bufplc;
|
gbuf = (char *)bufplc;
|
||||||
for(;cnt>1;cnt--)
|
for(;cnt>1;cnt--)
|
||||||
{
|
{
|
||||||
(*(char *)p) = gpal[gbuf[(bx>>16)*glogy+(by>>16)]];
|
(*(char *)p) = gpal[gbuf[(bx>>16)*glogy+(by>>16)]];
|
||||||
bx += gbxinc;
|
bx += gbxinc;
|
||||||
by += gbyinc;
|
by += gbyinc;
|
||||||
p += bpl;
|
p += bpl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Rotatesprite vertical line functions
|
//Rotatesprite vertical line functions
|
||||||
void msetupspritevline(long paloffs, long bxinc, long byinc, long ysiz)
|
void msetupspritevline(long paloffs, long bxinc, long byinc, long ysiz)
|
||||||
{
|
{
|
||||||
gpal = (char *)paloffs;
|
gpal = (char *)paloffs;
|
||||||
gbxinc = bxinc;
|
gbxinc = bxinc;
|
||||||
gbyinc = byinc;
|
gbyinc = byinc;
|
||||||
glogy = ysiz;
|
glogy = ysiz;
|
||||||
}
|
}
|
||||||
void mspritevline(long bx, long by, long cnt, long bufplc, long p)
|
void mspritevline(long bx, long by, long cnt, long bufplc, long p)
|
||||||
{
|
{
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
gbuf = (char *)bufplc;
|
gbuf = (char *)bufplc;
|
||||||
for(;cnt>1;cnt--)
|
for(;cnt>1;cnt--)
|
||||||
{
|
{
|
||||||
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
||||||
if (ch != 255) (*(char *)p) = gpal[ch];
|
if (ch != 255) (*(char *)p) = gpal[ch];
|
||||||
bx += gbxinc;
|
bx += gbxinc;
|
||||||
by += gbyinc;
|
by += gbyinc;
|
||||||
p += bpl;
|
p += bpl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tsetupspritevline(long paloffs, long bxinc, long byinc, long ysiz)
|
void tsetupspritevline(long paloffs, long bxinc, long byinc, long ysiz)
|
||||||
{
|
{
|
||||||
gpal = (char *)paloffs;
|
gpal = (char *)paloffs;
|
||||||
gbxinc = bxinc;
|
gbxinc = bxinc;
|
||||||
gbyinc = byinc;
|
gbyinc = byinc;
|
||||||
glogy = ysiz;
|
glogy = ysiz;
|
||||||
}
|
}
|
||||||
void tspritevline(long bx, long by, long cnt, long bufplc, long p)
|
void tspritevline(long bx, long by, long cnt, long bufplc, long p)
|
||||||
{
|
{
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
gbuf = (char *)bufplc;
|
gbuf = (char *)bufplc;
|
||||||
if (transmode)
|
if (transmode)
|
||||||
{
|
{
|
||||||
for(;cnt>1;cnt--)
|
for(;cnt>1;cnt--)
|
||||||
{
|
{
|
||||||
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
||||||
if (ch != 255) *((char *)p) = gtrans[(*((char *)p))+(gpal[ch]<<8)];
|
if (ch != 255) *((char *)p) = gtrans[(*((char *)p))+(gpal[ch]<<8)];
|
||||||
bx += gbxinc;
|
bx += gbxinc;
|
||||||
by += gbyinc;
|
by += gbyinc;
|
||||||
p += bpl;
|
p += bpl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for(;cnt>1;cnt--)
|
for(;cnt>1;cnt--)
|
||||||
{
|
{
|
||||||
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
ch = gbuf[(bx>>16)*glogy+(by>>16)];
|
||||||
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<8)+gpal[ch]];
|
if (ch != 255) *((char *)p) = gtrans[((*((char *)p))<<8)+gpal[ch]];
|
||||||
bx += gbxinc;
|
bx += gbxinc;
|
||||||
by += gbyinc;
|
by += gbyinc;
|
||||||
p += bpl;
|
p += bpl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupdrawslab (long dabpl, long pal)
|
void setupdrawslab (long dabpl, long pal)
|
||||||
{ bpl = dabpl; gpal = (char *)pal; }
|
{ bpl = dabpl; gpal = (char *)pal; }
|
||||||
|
|
||||||
void drawslab (long dx, long v, long dy, long vi, long vptr, long p)
|
void drawslab (long dx, long v, long dy, long vi, long vptr, long p)
|
||||||
{
|
{
|
||||||
long x;
|
long x;
|
||||||
|
|
||||||
while (dy > 0)
|
while (dy > 0)
|
||||||
{
|
{
|
||||||
for(x=0;x<dx;x++) *(char *)(p+x) = gpal[(long)(*(char *)((v>>16)+vptr))];
|
for(x=0;x<dx;x++) *(char *)(p+x) = gpal[(long)(*(char *)((v>>16)+vptr))];
|
||||||
p += bpl; v += vi; dy--;
|
p += bpl; v += vi; dy--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void stretchhline (long p0, long u, long cnt, long uinc, long rptr, long p)
|
void stretchhline (long p0, long u, long cnt, long uinc, long rptr, long p)
|
||||||
{
|
{
|
||||||
p0 = p-(cnt<<2);
|
p0 = p-(cnt<<2);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
p--;
|
p--;
|
||||||
*(char *)p = *(char *)((u>>16)+rptr); u -= uinc;
|
*(char *)p = *(char *)((u>>16)+rptr); u -= uinc;
|
||||||
} while (p > p0);
|
} while (p > p0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,37 +10,37 @@
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
struct glinfo glinfo = {
|
struct glinfo glinfo = {
|
||||||
"Unknown", // vendor
|
"Unknown", // vendor
|
||||||
"Unknown", // renderer
|
"Unknown", // renderer
|
||||||
"0.0.0", // version
|
"0.0.0", // version
|
||||||
"", // extensions
|
"", // extensions
|
||||||
|
|
||||||
1.0, // max anisotropy
|
1.0, // max anisotropy
|
||||||
0, // brga texture format
|
0, // brga texture format
|
||||||
0, // clamp-to-edge support
|
0, // clamp-to-edge support
|
||||||
0, // texture compression
|
0, // texture compression
|
||||||
0, // non-power-of-two textures
|
0, // non-power-of-two textures
|
||||||
0, // multisampling
|
0, // multisampling
|
||||||
0, // nvidia multisampling hint
|
0, // nvidia multisampling hint
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int osdfunc_dumpbuildinfo(const osdfuncparm_t *parm)
|
static int osdfunc_dumpbuildinfo(const osdfuncparm_t *parm)
|
||||||
{
|
{
|
||||||
OSD_Printf(
|
OSD_Printf(
|
||||||
"Build engine compilation:\n"
|
"Build engine compilation:\n"
|
||||||
" CFLAGS: %s\n"
|
" CFLAGS: %s\n"
|
||||||
" LIBS: %s\n"
|
" LIBS: %s\n"
|
||||||
" Host: %s\n"
|
" Host: %s\n"
|
||||||
" Compiler: %s\n"
|
" Compiler: %s\n"
|
||||||
" Built: %s\n",
|
" Built: %s\n",
|
||||||
_engine_cflags,
|
_engine_cflags,
|
||||||
_engine_libs,
|
_engine_libs,
|
||||||
_engine_uname,
|
_engine_uname,
|
||||||
_engine_compiler,
|
_engine_compiler,
|
||||||
_engine_date);
|
_engine_date);
|
||||||
|
|
||||||
return OSDCMD_OK;
|
return OSDCMD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void onvideomodechange(int newmode) { }
|
static void onvideomodechange(int newmode) { }
|
||||||
|
@ -48,159 +48,159 @@ void (*baselayer_onvideomodechange)(int) = onvideomodechange;
|
||||||
|
|
||||||
static int osdfunc_setrendermode(const osdfuncparm_t *parm)
|
static int osdfunc_setrendermode(const osdfuncparm_t *parm)
|
||||||
{
|
{
|
||||||
int m;
|
int m;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
char *modestrs[] = {
|
char *modestrs[] = {
|
||||||
"classic software", "polygonal flat-shaded software",
|
"classic software", "polygonal flat-shaded software",
|
||||||
"polygonal textured software", "polygonal OpenGL"
|
"polygonal textured software", "polygonal OpenGL"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (parm->numparms != 1) return OSDCMD_SHOWHELP;
|
if (parm->numparms != 1) return OSDCMD_SHOWHELP;
|
||||||
m = Bstrtol(parm->parms[0], &p, 10);
|
m = Bstrtol(parm->parms[0], &p, 10);
|
||||||
|
|
||||||
if (m < 0 || m > 3) return OSDCMD_SHOWHELP;
|
if (m < 0 || m > 3) return OSDCMD_SHOWHELP;
|
||||||
|
|
||||||
setrendermode(m);
|
setrendermode(m);
|
||||||
OSD_Printf("Rendering method changed to %s\n", modestrs[ getrendermode() ] );
|
OSD_Printf("Rendering method changed to %s\n", modestrs[ getrendermode() ] );
|
||||||
|
|
||||||
return OSDCMD_OK;
|
return OSDCMD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||||
#ifdef DEBUGGINGAIDS
|
#ifdef DEBUGGINGAIDS
|
||||||
static int osdcmd_hicsetpalettetint(const osdfuncparm_t *parm)
|
static int osdcmd_hicsetpalettetint(const osdfuncparm_t *parm)
|
||||||
{
|
{
|
||||||
long pal, cols[3], eff;
|
long pal, cols[3], eff;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
if (parm->numparms != 5) return OSDCMD_SHOWHELP;
|
if (parm->numparms != 5) return OSDCMD_SHOWHELP;
|
||||||
|
|
||||||
pal = Batol(parm->parms[0]);
|
pal = Batol(parm->parms[0]);
|
||||||
cols[0] = Batol(parm->parms[1]);
|
cols[0] = Batol(parm->parms[1]);
|
||||||
cols[1] = Batol(parm->parms[2]);
|
cols[1] = Batol(parm->parms[2]);
|
||||||
cols[2] = Batol(parm->parms[3]);
|
cols[2] = Batol(parm->parms[3]);
|
||||||
eff = Batol(parm->parms[4]);
|
eff = Batol(parm->parms[4]);
|
||||||
|
|
||||||
hicsetpalettetint(pal,cols[0],cols[1],cols[2],eff);
|
hicsetpalettetint(pal,cols[0],cols[1],cols[2],eff);
|
||||||
|
|
||||||
return OSDCMD_OK;
|
return OSDCMD_OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int osdcmd_glinfo(const osdfuncparm_t *parm)
|
static int osdcmd_glinfo(const osdfuncparm_t *parm)
|
||||||
{
|
{
|
||||||
char *s,*t,*u,i;
|
char *s,*t,*u,i;
|
||||||
|
|
||||||
if (bpp == 8) {
|
if (bpp == 8) {
|
||||||
OSD_Printf("glinfo: Not in OpenGL mode.\n");
|
OSD_Printf("glinfo: Not in OpenGL mode.\n");
|
||||||
return OSDCMD_OK;
|
return OSDCMD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSD_Printf("OpenGL Information:\n"
|
OSD_Printf("OpenGL Information:\n"
|
||||||
" Version: %s\n"
|
" Version: %s\n"
|
||||||
" Vendor: %s\n"
|
" Vendor: %s\n"
|
||||||
" Renderer: %s\n"
|
" Renderer: %s\n"
|
||||||
" Maximum anisotropy: %.1f%s\n"
|
" Maximum anisotropy: %.1f%s\n"
|
||||||
" BGRA textures: %s\n"
|
" BGRA textures: %s\n"
|
||||||
" Non-x^2 textures: %s\n"
|
" Non-x^2 textures: %s\n"
|
||||||
" Texure compression: %s\n"
|
" Texure compression: %s\n"
|
||||||
" Clamp-to-edge: %s\n"
|
" Clamp-to-edge: %s\n"
|
||||||
" Multisampling: %s\n"
|
" Multisampling: %s\n"
|
||||||
" Nvidia multisample hint: %s\n"
|
" Nvidia multisample hint: %s\n"
|
||||||
" Extensions:\n",
|
" Extensions:\n",
|
||||||
glinfo.version,
|
glinfo.version,
|
||||||
glinfo.vendor,
|
glinfo.vendor,
|
||||||
glinfo.renderer,
|
glinfo.renderer,
|
||||||
glinfo.maxanisotropy, glinfo.maxanisotropy>1.0?"":" (no anisotropic filtering)",
|
glinfo.maxanisotropy, glinfo.maxanisotropy>1.0?"":" (no anisotropic filtering)",
|
||||||
glinfo.bgra ? "supported": "not supported",
|
glinfo.bgra ? "supported": "not supported",
|
||||||
glinfo.texnpot ? "supported": "not supported",
|
glinfo.texnpot ? "supported": "not supported",
|
||||||
glinfo.texcompr ? "supported": "not supported",
|
glinfo.texcompr ? "supported": "not supported",
|
||||||
glinfo.clamptoedge ? "supported": "not supported",
|
glinfo.clamptoedge ? "supported": "not supported",
|
||||||
glinfo.multisample ? "supported": "not supported",
|
glinfo.multisample ? "supported": "not supported",
|
||||||
glinfo.nvmultisamplehint ? "supported": "not supported"
|
glinfo.nvmultisamplehint ? "supported": "not supported"
|
||||||
);
|
);
|
||||||
|
|
||||||
s = Bstrdup(glinfo.extensions);
|
s = Bstrdup(glinfo.extensions);
|
||||||
if (!s) OSD_Printf(glinfo.extensions);
|
if (!s) OSD_Printf(glinfo.extensions);
|
||||||
else {
|
else {
|
||||||
i = 0; t = u = s;
|
i = 0; t = u = s;
|
||||||
while (*t) {
|
while (*t) {
|
||||||
if (*t == ' ') {
|
if (*t == ' ') {
|
||||||
if (i&1) {
|
if (i&1) {
|
||||||
*t = 0;
|
*t = 0;
|
||||||
OSD_Printf(" %s\n",u);
|
OSD_Printf(" %s\n",u);
|
||||||
u = t+1;
|
u = t+1;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
t++;
|
t++;
|
||||||
}
|
}
|
||||||
if (i&1) OSD_Printf(" %s\n",u);
|
if (i&1) OSD_Printf(" %s\n",u);
|
||||||
Bfree(s);
|
Bfree(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
return OSDCMD_OK;
|
return OSDCMD_OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int osdcmd_vars(const osdfuncparm_t *parm)
|
static int osdcmd_vars(const osdfuncparm_t *parm)
|
||||||
{
|
{
|
||||||
int showval = (parm->numparms < 1);
|
int showval = (parm->numparms < 1);
|
||||||
|
|
||||||
if (!Bstrcasecmp(parm->name, "screencaptureformat")) {
|
if (!Bstrcasecmp(parm->name, "screencaptureformat")) {
|
||||||
const char *fmts[2][2] = { {"TGA", "PCX"}, {"0", "1"} };
|
const char *fmts[2][2] = { {"TGA", "PCX"}, {"0", "1"} };
|
||||||
if (showval) { OSD_Printf("captureformat is %s\n", fmts[captureformat]); }
|
if (showval) { OSD_Printf("captureformat is %s\n", fmts[captureformat]); }
|
||||||
else {
|
else {
|
||||||
int i,j;
|
int i,j;
|
||||||
for (j=0; j<2; j++)
|
for (j=0; j<2; j++)
|
||||||
for (i=0; i<2; i++)
|
for (i=0; i<2; i++)
|
||||||
if (!Bstrcasecmp(parm->parms[0], fmts[j][i])) break;
|
if (!Bstrcasecmp(parm->parms[0], fmts[j][i])) break;
|
||||||
if (j == 2) return OSDCMD_SHOWHELP;
|
if (j == 2) return OSDCMD_SHOWHELP;
|
||||||
captureformat = i;
|
captureformat = i;
|
||||||
}
|
}
|
||||||
return OSDCMD_OK;
|
return OSDCMD_OK;
|
||||||
}
|
}
|
||||||
#ifdef SUPERBUILD
|
#ifdef SUPERBUILD
|
||||||
else if (!Bstrcasecmp(parm->name, "novoxmips")) {
|
else if (!Bstrcasecmp(parm->name, "novoxmips")) {
|
||||||
if (showval) { OSD_Printf("novoxmips is %d\n", novoxmips); }
|
if (showval) { OSD_Printf("novoxmips is %d\n", novoxmips); }
|
||||||
else { novoxmips = (atoi(parm->parms[0]) != 0); }
|
else { novoxmips = (atoi(parm->parms[0]) != 0); }
|
||||||
}
|
}
|
||||||
else if (!Bstrcasecmp(parm->name, "usevoxels")) {
|
else if (!Bstrcasecmp(parm->name, "usevoxels")) {
|
||||||
if (showval) { OSD_Printf("usevoxels is %d\n", usevoxels); }
|
if (showval) { OSD_Printf("usevoxels is %d\n", usevoxels); }
|
||||||
else { usevoxels = (atoi(parm->parms[0]) != 0); }
|
else { usevoxels = (atoi(parm->parms[0]) != 0); }
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return OSDCMD_SHOWHELP;
|
return OSDCMD_SHOWHELP;
|
||||||
}
|
}
|
||||||
|
|
||||||
int baselayer_init(void)
|
int baselayer_init(void)
|
||||||
{
|
{
|
||||||
#ifdef POLYMOST
|
#ifdef POLYMOST
|
||||||
OSD_RegisterFunction("setrendermode","setrendermode <number>: sets the engine's rendering mode.\n"
|
OSD_RegisterFunction("setrendermode","setrendermode <number>: sets the engine's rendering mode.\n"
|
||||||
"Mode numbers are:\n"
|
"Mode numbers are:\n"
|
||||||
" 0 - Classic Build software\n"
|
" 0 - Classic Build software\n"
|
||||||
" 1 - Polygonal flat-shaded software\n"
|
" 1 - Polygonal flat-shaded software\n"
|
||||||
" 2 - Polygonal textured software\n"
|
" 2 - Polygonal textured software\n"
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
" 3 - Polygonal OpenGL\n"
|
" 3 - Polygonal OpenGL\n"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
osdfunc_setrendermode);
|
osdfunc_setrendermode);
|
||||||
#endif
|
#endif
|
||||||
OSD_RegisterFunction("dumpbuildinfo","dumpbuildinfo: outputs engine compilation information",osdfunc_dumpbuildinfo);
|
OSD_RegisterFunction("dumpbuildinfo","dumpbuildinfo: outputs engine compilation information",osdfunc_dumpbuildinfo);
|
||||||
OSD_RegisterFunction("screencaptureformat","screencaptureformat: sets the output format for screenshots (TGA or PCX)",osdcmd_vars);
|
OSD_RegisterFunction("screencaptureformat","screencaptureformat: sets the output format for screenshots (TGA or PCX)",osdcmd_vars);
|
||||||
#ifdef SUPERBUILD
|
#ifdef SUPERBUILD
|
||||||
OSD_RegisterFunction("novoxmips","novoxmips: turn off/on the use of mipmaps when rendering 8-bit voxels",osdcmd_vars);
|
OSD_RegisterFunction("novoxmips","novoxmips: turn off/on the use of mipmaps when rendering 8-bit voxels",osdcmd_vars);
|
||||||
OSD_RegisterFunction("usevoxels","usevoxels: enable/disable automatic sprite->voxel rendering",osdcmd_vars);
|
OSD_RegisterFunction("usevoxels","usevoxels: enable/disable automatic sprite->voxel rendering",osdcmd_vars);
|
||||||
#endif
|
#endif
|
||||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||||
#ifdef DEBUGGINGAIDS
|
#ifdef DEBUGGINGAIDS
|
||||||
OSD_RegisterFunction("hicsetpalettetint","hicsetpalettetint: sets palette tinting values",osdcmd_hicsetpalettetint);
|
OSD_RegisterFunction("hicsetpalettetint","hicsetpalettetint: sets palette tinting values",osdcmd_hicsetpalettetint);
|
||||||
#endif
|
#endif
|
||||||
OSD_RegisterFunction("glinfo","glinfo: shows OpenGL information about the current OpenGL mode",osdcmd_glinfo);
|
OSD_RegisterFunction("glinfo","glinfo: shows OpenGL information about the current OpenGL mode",osdcmd_glinfo);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,11 @@ static char tempbuf[256];
|
||||||
#define NUMOPTIONS 9
|
#define NUMOPTIONS 9
|
||||||
char option[NUMOPTIONS] = {0,0,0,0,0,0,1,0,0};
|
char option[NUMOPTIONS] = {0,0,0,0,0,0,1,0,0};
|
||||||
char keys[NUMBUILDKEYS] =
|
char keys[NUMBUILDKEYS] =
|
||||||
{
|
{
|
||||||
0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39,
|
0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39,
|
||||||
0x1e,0x2c,0xd1,0xc9,0x33,0x34,
|
0x1e,0x2c,0xd1,0xc9,0x33,0x34,
|
||||||
0x9c,0x1c,0xd,0xc,0xf,0x45
|
0x9c,0x1c,0xd,0xc,0xf,0x45
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,145 +67,145 @@ int ExtPreInit(int *argc,char ***argv)
|
||||||
|
|
||||||
int ExtInit(void)
|
int ExtInit(void)
|
||||||
{
|
{
|
||||||
long i, rv = 0;
|
long i, rv = 0;
|
||||||
|
|
||||||
/*printf("------------------------------------------------------------------------------\n");
|
/*printf("------------------------------------------------------------------------------\n");
|
||||||
printf(" BUILD.EXE copyright(c) 1996 by Ken Silverman. You are granted the\n");
|
printf(" BUILD.EXE copyright(c) 1996 by Ken Silverman. You are granted the\n");
|
||||||
printf(" right to use this software for your personal use only. This is a\n");
|
printf(" right to use this software for your personal use only. This is a\n");
|
||||||
printf(" special version to be used with \"Happy Fun KenBuild\" and may not work\n");
|
printf(" special version to be used with \"Happy Fun KenBuild\" and may not work\n");
|
||||||
printf(" properly with other Build engine games. Please refer to license.doc\n");
|
printf(" properly with other Build engine games. Please refer to license.doc\n");
|
||||||
printf(" for distribution rights\n");
|
printf(" for distribution rights\n");
|
||||||
printf("------------------------------------------------------------------------------\n");
|
printf("------------------------------------------------------------------------------\n");
|
||||||
getch();
|
getch();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
initgroupfile("stuff.dat");
|
initgroupfile("stuff.dat");
|
||||||
bpp = 8;
|
bpp = 8;
|
||||||
if (loadsetup("build.cfg") < 0) initprintf("Configuration file not found, using defaults.\n"), rv = 1;
|
if (loadsetup("build.cfg") < 0) initprintf("Configuration file not found, using defaults.\n"), rv = 1;
|
||||||
Bmemcpy((void *)buildkeys,(void *)keys,NUMBUILDKEYS); //Trick to make build use setup.dat keys
|
Bmemcpy((void *)buildkeys,(void *)keys,NUMBUILDKEYS); //Trick to make build use setup.dat keys
|
||||||
if (option[4] > 0) option[4] = 0;
|
if (option[4] > 0) option[4] = 0;
|
||||||
if (initengine()) {
|
if (initengine()) {
|
||||||
wm_msgbox("Build Engine Initialisation Error",
|
wm_msgbox("Build Engine Initialisation Error",
|
||||||
"There was a problem initialising the Build engine: %s", engineerrstr);
|
"There was a problem initialising the Build engine: %s", engineerrstr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
initinput();
|
initinput();
|
||||||
initmouse();
|
initmouse();
|
||||||
|
|
||||||
//You can load your own palette lookup tables here if you just
|
//You can load your own palette lookup tables here if you just
|
||||||
//copy the right code!
|
//copy the right code!
|
||||||
for(i=0;i<256;i++)
|
for(i=0;i<256;i++)
|
||||||
tempbuf[i] = ((i+32)&255); //remap colors for screwy palette sectors
|
tempbuf[i] = ((i+32)&255); //remap colors for screwy palette sectors
|
||||||
makepalookup(16,tempbuf,0,0,0,1);
|
makepalookup(16,tempbuf,0,0,0,1);
|
||||||
|
|
||||||
kensplayerheight = 32;
|
kensplayerheight = 32;
|
||||||
zmode = 0;
|
zmode = 0;
|
||||||
defaultspritecstat = 0;
|
defaultspritecstat = 0;
|
||||||
pskyoff[0] = 0; pskyoff[1] = 0; pskybits = 1;
|
pskyoff[0] = 0; pskyoff[1] = 0; pskybits = 1;
|
||||||
|
|
||||||
#ifdef SUPERBUILD
|
#ifdef SUPERBUILD
|
||||||
tiletovox[PLAYER] = nextvoxid++;
|
tiletovox[PLAYER] = nextvoxid++;
|
||||||
tiletovox[BROWNMONSTER] = nextvoxid++;
|
tiletovox[BROWNMONSTER] = nextvoxid++;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// allowtaskswitching(0);
|
// allowtaskswitching(0);
|
||||||
#endif
|
#endif
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtUnInit(void)
|
void ExtUnInit(void)
|
||||||
{
|
{
|
||||||
uninitgroupfile();
|
uninitgroupfile();
|
||||||
writesetup("build.cfg");
|
writesetup("build.cfg");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtSetupSpecialSpriteCols(void)
|
void ExtSetupSpecialSpriteCols(void)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//static long daviewingrange, daaspect, horizval1, horizval2;
|
//static long daviewingrange, daaspect, horizval1, horizval2;
|
||||||
void ExtPreCheckKeys(void)
|
void ExtPreCheckKeys(void)
|
||||||
{
|
{
|
||||||
long /*cosang, sinang, dx, dy, mindx,*/ i, j, k;
|
long /*cosang, sinang, dx, dy, mindx,*/ i, j, k;
|
||||||
|
|
||||||
if (keystatus[0x3e]) //F4 - screen re-size
|
if (keystatus[0x3e]) //F4 - screen re-size
|
||||||
{
|
{
|
||||||
keystatus[0x3e] = 0;
|
keystatus[0x3e] = 0;
|
||||||
|
|
||||||
//cycle through all vesa modes, then screen-buffer mode
|
//cycle through all vesa modes, then screen-buffer mode
|
||||||
if (keystatus[0x2a]|keystatus[0x36]) {
|
if (keystatus[0x2a]|keystatus[0x36]) {
|
||||||
setgamemode(!fullscreen, xdim, ydim, bpp);
|
setgamemode(!fullscreen, xdim, ydim, bpp);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//cycle through all modes
|
//cycle through all modes
|
||||||
j=-1;
|
j=-1;
|
||||||
|
|
||||||
// work out a mask to select the mode
|
// work out a mask to select the mode
|
||||||
for (i=0; i<validmodecnt; i++)
|
for (i=0; i<validmodecnt; i++)
|
||||||
if ((validmode[i].xdim == xdim) &&
|
if ((validmode[i].xdim == xdim) &&
|
||||||
(validmode[i].ydim == ydim) &&
|
(validmode[i].ydim == ydim) &&
|
||||||
(validmode[i].fs == fullscreen) &&
|
(validmode[i].fs == fullscreen) &&
|
||||||
(validmode[i].bpp == bpp))
|
(validmode[i].bpp == bpp))
|
||||||
{ j=i; break; }
|
{ j=i; break; }
|
||||||
|
|
||||||
for (k=0; k<validmodecnt; k++)
|
for (k=0; k<validmodecnt; k++)
|
||||||
if (validmode[k].fs == fullscreen && validmode[k].bpp == bpp) break;
|
if (validmode[k].fs == fullscreen && validmode[k].bpp == bpp) break;
|
||||||
|
|
||||||
if (j==-1) j=k;
|
if (j==-1) j=k;
|
||||||
else {
|
else {
|
||||||
j++;
|
j++;
|
||||||
if (j==validmodecnt) j=k;
|
if (j==validmodecnt) j=k;
|
||||||
}
|
}
|
||||||
setgamemode(fullscreen,validmode[j].xdim,validmode[j].ydim,bpp);
|
setgamemode(fullscreen,validmode[j].xdim,validmode[j].ydim,bpp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (keystatus[0x2a]|keystatus[0x36])
|
if (keystatus[0x2a]|keystatus[0x36])
|
||||||
{
|
{
|
||||||
if (keystatus[0xcf]) hang = max(hang-1,-182);
|
if (keystatus[0xcf]) hang = max(hang-1,-182);
|
||||||
if (keystatus[0xc7]) hang = min(hang+1,182);
|
if (keystatus[0xc7]) hang = min(hang+1,182);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (keystatus[0xcf]) hang = max(hang-8,-182);
|
if (keystatus[0xcf]) hang = max(hang-8,-182);
|
||||||
if (keystatus[0xc7]) hang = min(hang+8,182);
|
if (keystatus[0xc7]) hang = min(hang+8,182);
|
||||||
}
|
}
|
||||||
if (keystatus[0x4c]) { hang = 0; horiz = 100; }
|
if (keystatus[0x4c]) { hang = 0; horiz = 100; }
|
||||||
if (hang != 0)
|
if (hang != 0)
|
||||||
{
|
{
|
||||||
walock[4094] = 255;
|
walock[4094] = 255;
|
||||||
|
|
||||||
// JBF 20031117: scale each dimension by a factor of 1.2, and work out
|
// JBF 20031117: scale each dimension by a factor of 1.2, and work out
|
||||||
// the aspect of the screen. Anywhere you see 'i' below was the value
|
// the aspect of the screen. Anywhere you see 'i' below was the value
|
||||||
// '200' before I changed it. NOTE: This whole trick crashes in resolutions
|
// '200' before I changed it. NOTE: This whole trick crashes in resolutions
|
||||||
// above 800x600. I'm not sure why, and fixing it is not something I intend
|
// above 800x600. I'm not sure why, and fixing it is not something I intend
|
||||||
// to do in a real big hurry.
|
// to do in a real big hurry.
|
||||||
dx = (xdim + (xdim >> 3) + (xdim >> 4) + (xdim >> 6)) & (~7);
|
dx = (xdim + (xdim >> 3) + (xdim >> 4) + (xdim >> 6)) & (~7);
|
||||||
dy = (ydim + (ydim >> 3) + (ydim >> 4) + (ydim >> 6)) & (~7);
|
dy = (ydim + (ydim >> 3) + (ydim >> 4) + (ydim >> 6)) & (~7);
|
||||||
i = scale(320,ydim,xdim);
|
i = scale(320,ydim,xdim);
|
||||||
|
|
||||||
if (waloff[4094] == 0) allocache(&waloff[4094],/*240L*384L*/dx*dy,&walock[4094]);
|
if (waloff[4094] == 0) allocache(&waloff[4094],/*240L*384L*/dx*dy,&walock[4094]);
|
||||||
setviewtotile(4094,/*240L,384L*/dy,dx);
|
setviewtotile(4094,/*240L,384L*/dy,dx);
|
||||||
|
|
||||||
cosang = sintable[(hang+512)&2047];
|
cosang = sintable[(hang+512)&2047];
|
||||||
sinang = sintable[hang&2047];
|
sinang = sintable[hang&2047];
|
||||||
|
|
||||||
dx = dmulscale1(320,cosang,i,sinang); mindx = dx;
|
dx = dmulscale1(320,cosang,i,sinang); mindx = dx;
|
||||||
dy = dmulscale1(-i,cosang,320,sinang);
|
dy = dmulscale1(-i,cosang,320,sinang);
|
||||||
horizval1 = dy*(320>>1)/dx-1;
|
horizval1 = dy*(320>>1)/dx-1;
|
||||||
|
|
||||||
dx = dmulscale1(320,cosang,-i,sinang); mindx = min(dx,mindx);
|
dx = dmulscale1(320,cosang,-i,sinang); mindx = min(dx,mindx);
|
||||||
dy = dmulscale1(i,cosang,320,sinang);
|
dy = dmulscale1(i,cosang,320,sinang);
|
||||||
horizval2 = dy*(320>>1)/dx+1;
|
horizval2 = dy*(320>>1)/dx+1;
|
||||||
|
|
||||||
daviewingrange = scale(65536,16384*(xdim>>1),mindx-16);
|
daviewingrange = scale(65536,16384*(xdim>>1),mindx-16);
|
||||||
daaspect = scale(daviewingrange,scale(320,tilesizx[4094],tilesizy[4094]),horizval2+6-horizval1);
|
daaspect = scale(daviewingrange,scale(320,tilesizx[4094],tilesizy[4094]),horizval2+6-horizval1);
|
||||||
setaspect(daviewingrange,scale(daaspect,ydim*320,xdim*i));
|
setaspect(daviewingrange,scale(daaspect,ydim*320,xdim*i));
|
||||||
horiz = 100-divscale15(horizval1+horizval2,daviewingrange);
|
horiz = 100-divscale15(horizval1+horizval2,daviewingrange);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,109 +214,109 @@ void ExtPreCheckKeys(void)
|
||||||
extern char *voxoff[][MAXVOXMIPS];
|
extern char *voxoff[][MAXVOXMIPS];
|
||||||
void ExtAnalyzeSprites(void)
|
void ExtAnalyzeSprites(void)
|
||||||
{
|
{
|
||||||
long i, *longptr;
|
long i, *longptr;
|
||||||
spritetype *tspr;
|
spritetype *tspr;
|
||||||
|
|
||||||
for(i=0,tspr=&tsprite[0];i<spritesortcnt;i++,tspr++)
|
for(i=0,tspr=&tsprite[0];i<spritesortcnt;i++,tspr++)
|
||||||
{
|
{
|
||||||
if (usevoxels && tiletovox[tspr->picnum] >= 0)
|
if (usevoxels && tiletovox[tspr->picnum] >= 0)
|
||||||
{
|
{
|
||||||
switch(tspr->picnum)
|
switch(tspr->picnum)
|
||||||
{
|
{
|
||||||
case PLAYER:
|
case PLAYER:
|
||||||
if (!voxoff[ tiletovox[PLAYER] ][0]) {
|
if (!voxoff[ tiletovox[PLAYER] ][0]) {
|
||||||
if (qloadkvx(tiletovox[PLAYER],"voxel000.kvx")) {
|
if (qloadkvx(tiletovox[PLAYER],"voxel000.kvx")) {
|
||||||
tiletovox[PLAYER] = -1;
|
tiletovox[PLAYER] = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//tspr->cstat |= 48; tspr->picnum = tiletovox[tspr->picnum];
|
//tspr->cstat |= 48; tspr->picnum = tiletovox[tspr->picnum];
|
||||||
longptr = (long *)voxoff[ tiletovox[PLAYER] ][0];
|
longptr = (long *)voxoff[ tiletovox[PLAYER] ][0];
|
||||||
tspr->xrepeat = scale(tspr->xrepeat,56,longptr[2]);
|
tspr->xrepeat = scale(tspr->xrepeat,56,longptr[2]);
|
||||||
tspr->yrepeat = scale(tspr->yrepeat,56,longptr[2]);
|
tspr->yrepeat = scale(tspr->yrepeat,56,longptr[2]);
|
||||||
tspr->shade -= 6;
|
tspr->shade -= 6;
|
||||||
break;
|
break;
|
||||||
case BROWNMONSTER:
|
case BROWNMONSTER:
|
||||||
if (!voxoff[ tiletovox[BROWNMONSTER] ][0]) {
|
if (!voxoff[ tiletovox[BROWNMONSTER] ][0]) {
|
||||||
if (qloadkvx(tiletovox[BROWNMONSTER],"voxel001.kvx")) {
|
if (qloadkvx(tiletovox[BROWNMONSTER],"voxel001.kvx")) {
|
||||||
tiletovox[BROWNMONSTER] = -1;
|
tiletovox[BROWNMONSTER] = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//tspr->cstat |= 48; tspr->picnum = tiletovox[tspr->picnum];
|
//tspr->cstat |= 48; tspr->picnum = tiletovox[tspr->picnum];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tspr->shade += 6;
|
tspr->shade += 6;
|
||||||
if (sector[tspr->sectnum].ceilingstat&1)
|
if (sector[tspr->sectnum].ceilingstat&1)
|
||||||
tspr->shade += sector[tspr->sectnum].ceilingshade;
|
tspr->shade += sector[tspr->sectnum].ceilingshade;
|
||||||
else
|
else
|
||||||
tspr->shade += sector[tspr->sectnum].floorshade;
|
tspr->shade += sector[tspr->sectnum].floorshade;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ExtCheckKeys(void)
|
void ExtCheckKeys(void)
|
||||||
{
|
{
|
||||||
long i;//, p, y, dx, dy, cosang, sinang, bufplc, tsizy, tsizyup15;
|
long i;//, p, y, dx, dy, cosang, sinang, bufplc, tsizy, tsizyup15;
|
||||||
long j;
|
long j;
|
||||||
|
|
||||||
if (qsetmode == 200) //In 3D mode
|
if (qsetmode == 200) //In 3D mode
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
if (hang != 0)
|
if (hang != 0)
|
||||||
{
|
{
|
||||||
bufplc = waloff[4094]+(mulscale16(horiz-100,xdimenscale)+(tilesizx[4094]>>1))*tilesizy[4094];
|
bufplc = waloff[4094]+(mulscale16(horiz-100,xdimenscale)+(tilesizx[4094]>>1))*tilesizy[4094];
|
||||||
setviewback();
|
setviewback();
|
||||||
cosang = sintable[(hang+512)&2047];
|
cosang = sintable[(hang+512)&2047];
|
||||||
sinang = sintable[hang&2047];
|
sinang = sintable[hang&2047];
|
||||||
dx = dmulscale1(xdim,cosang,ydim,sinang);
|
dx = dmulscale1(xdim,cosang,ydim,sinang);
|
||||||
dy = dmulscale1(-ydim,cosang,xdim,sinang);
|
dy = dmulscale1(-ydim,cosang,xdim,sinang);
|
||||||
|
|
||||||
begindrawing();
|
begindrawing();
|
||||||
tsizy = tilesizy[4094];
|
tsizy = tilesizy[4094];
|
||||||
tsizyup15 = (tsizy<<15);
|
tsizyup15 = (tsizy<<15);
|
||||||
dx = mulscale14(dx,daviewingrange);
|
dx = mulscale14(dx,daviewingrange);
|
||||||
dy = mulscale14(dy,daaspect);
|
dy = mulscale14(dy,daaspect);
|
||||||
sinang = mulscale14(sinang,daviewingrange);
|
sinang = mulscale14(sinang,daviewingrange);
|
||||||
cosang = mulscale14(cosang,daaspect);
|
cosang = mulscale14(cosang,daaspect);
|
||||||
p = ylookup[windowy1]+frameplace+windowx2+1;
|
p = ylookup[windowy1]+frameplace+windowx2+1;
|
||||||
for(y=windowy1;y<=windowy2;y++)
|
for(y=windowy1;y<=windowy2;y++)
|
||||||
{
|
{
|
||||||
i = divscale16(tsizyup15,dx);
|
i = divscale16(tsizyup15,dx);
|
||||||
stretchhline(0,(xdim>>1)*i+tsizyup15,xdim>>2,i,mulscale32(i,dy)*tsizy+bufplc,p);
|
stretchhline(0,(xdim>>1)*i+tsizyup15,xdim>>2,i,mulscale32(i,dy)*tsizy+bufplc,p);
|
||||||
dx -= sinang; dy += cosang; p += ylookup[1];
|
dx -= sinang; dy += cosang; p += ylookup[1];
|
||||||
}
|
}
|
||||||
walock[4094] = 1;
|
walock[4094] = 1;
|
||||||
|
|
||||||
Bsprintf(tempbuf,"%d",(hang*180)>>10);
|
Bsprintf(tempbuf,"%d",(hang*180)>>10);
|
||||||
printext256(0L,8L,31,-1,tempbuf,1);
|
printext256(0L,8L,31,-1,tempbuf,1);
|
||||||
enddrawing();
|
enddrawing();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (keystatus[0xa]) setaspect(viewingrange+(viewingrange>>8),yxaspect+(yxaspect>>8));
|
if (keystatus[0xa]) setaspect(viewingrange+(viewingrange>>8),yxaspect+(yxaspect>>8));
|
||||||
if (keystatus[0xb]) setaspect(viewingrange-(viewingrange>>8),yxaspect-(yxaspect>>8));
|
if (keystatus[0xb]) setaspect(viewingrange-(viewingrange>>8),yxaspect-(yxaspect>>8));
|
||||||
if (keystatus[0xc]) setaspect(viewingrange,yxaspect-(yxaspect>>8));
|
if (keystatus[0xc]) setaspect(viewingrange,yxaspect-(yxaspect>>8));
|
||||||
if (keystatus[0xd]) setaspect(viewingrange,yxaspect+(yxaspect>>8));
|
if (keystatus[0xd]) setaspect(viewingrange,yxaspect+(yxaspect>>8));
|
||||||
//if (keystatus[0x38]) setrollangle(rollangle+=((keystatus[0x2a]|keystatus[0x36])*6+2));
|
//if (keystatus[0x38]) setrollangle(rollangle+=((keystatus[0x2a]|keystatus[0x36])*6+2));
|
||||||
//if (keystatus[0xb8]) setrollangle(rollangle-=((keystatus[0x2a]|keystatus[0x36])*6+2));
|
//if (keystatus[0xb8]) setrollangle(rollangle-=((keystatus[0x2a]|keystatus[0x36])*6+2));
|
||||||
//if (keystatus[0x1d]|keystatus[0x9d]) setrollangle(rollangle=0);
|
//if (keystatus[0x1d]|keystatus[0x9d]) setrollangle(rollangle=0);
|
||||||
|
|
||||||
begindrawing();
|
begindrawing();
|
||||||
|
|
||||||
i = frameval[framecnt&(AVERAGEFRAMES-1)];
|
i = frameval[framecnt&(AVERAGEFRAMES-1)];
|
||||||
j = frameval[framecnt&(AVERAGEFRAMES-1)] = getticks(); framecnt++;
|
j = frameval[framecnt&(AVERAGEFRAMES-1)] = getticks(); framecnt++;
|
||||||
if (i != j) averagefps = ((mul3(averagefps)+((AVERAGEFRAMES*1000)/(j-i)) )>>2);
|
if (i != j) averagefps = ((mul3(averagefps)+((AVERAGEFRAMES*1000)/(j-i)) )>>2);
|
||||||
Bsprintf(tempbuf,"%ld",averagefps);
|
Bsprintf(tempbuf,"%ld",averagefps);
|
||||||
printext256(0L,0L,31,-1,tempbuf,1);
|
printext256(0L,0L,31,-1,tempbuf,1);
|
||||||
|
|
||||||
enddrawing();
|
enddrawing();
|
||||||
editinput();
|
editinput();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtCleanUp(void)
|
void ExtCleanUp(void)
|
||||||
|
@ -329,9 +329,9 @@ void ExtPreLoadMap(void)
|
||||||
|
|
||||||
void ExtLoadMap(const char *mapname)
|
void ExtLoadMap(const char *mapname)
|
||||||
{
|
{
|
||||||
char title[256];
|
char title[256];
|
||||||
Bsprintf(title, "BUILD by Ken Silverman - %s", mapname);
|
Bsprintf(title, "BUILD by Ken Silverman - %s", mapname);
|
||||||
wm_setapptitle(title);
|
wm_setapptitle(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtPreSaveMap(void)
|
void ExtPreSaveMap(void)
|
||||||
|
@ -344,44 +344,44 @@ void ExtSaveMap(const char *mapname)
|
||||||
|
|
||||||
const char *ExtGetSectorCaption(short sectnum)
|
const char *ExtGetSectorCaption(short sectnum)
|
||||||
{
|
{
|
||||||
if ((sector[sectnum].lotag|sector[sectnum].hitag) == 0)
|
if ((sector[sectnum].lotag|sector[sectnum].hitag) == 0)
|
||||||
{
|
{
|
||||||
tempbuf[0] = 0;
|
tempbuf[0] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf,"%hu,%hu",(unsigned short)sector[sectnum].hitag,
|
Bsprintf(tempbuf,"%hu,%hu",(unsigned short)sector[sectnum].hitag,
|
||||||
(unsigned short)sector[sectnum].lotag);
|
(unsigned short)sector[sectnum].lotag);
|
||||||
}
|
}
|
||||||
return(tempbuf);
|
return(tempbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *ExtGetWallCaption(short wallnum)
|
const char *ExtGetWallCaption(short wallnum)
|
||||||
{
|
{
|
||||||
if ((wall[wallnum].lotag|wall[wallnum].hitag) == 0)
|
if ((wall[wallnum].lotag|wall[wallnum].hitag) == 0)
|
||||||
{
|
{
|
||||||
tempbuf[0] = 0;
|
tempbuf[0] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf,"%hu,%hu",(unsigned short)wall[wallnum].hitag,
|
Bsprintf(tempbuf,"%hu,%hu",(unsigned short)wall[wallnum].hitag,
|
||||||
(unsigned short)wall[wallnum].lotag);
|
(unsigned short)wall[wallnum].lotag);
|
||||||
}
|
}
|
||||||
return(tempbuf);
|
return(tempbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *ExtGetSpriteCaption(short spritenum)
|
const char *ExtGetSpriteCaption(short spritenum)
|
||||||
{
|
{
|
||||||
if ((sprite[spritenum].lotag|sprite[spritenum].hitag) == 0)
|
if ((sprite[spritenum].lotag|sprite[spritenum].hitag) == 0)
|
||||||
{
|
{
|
||||||
tempbuf[0] = 0;
|
tempbuf[0] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf,"%hu,%hu",(unsigned short)sprite[spritenum].hitag,
|
Bsprintf(tempbuf,"%hu,%hu",(unsigned short)sprite[spritenum].hitag,
|
||||||
(unsigned short)sprite[spritenum].lotag);
|
(unsigned short)sprite[spritenum].lotag);
|
||||||
}
|
}
|
||||||
return(tempbuf);
|
return(tempbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
//printext16 parameters:
|
//printext16 parameters:
|
||||||
|
@ -402,132 +402,132 @@ const char *ExtGetSpriteCaption(short spritenum)
|
||||||
|
|
||||||
void ExtShowSectorData(short sectnum) //F5
|
void ExtShowSectorData(short sectnum) //F5
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
if (qsetmode == 200) //In 3D mode
|
if (qsetmode == 200) //In 3D mode
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
begindrawing();
|
begindrawing();
|
||||||
clearmidstatbar16(); //Clear middle of status bar
|
clearmidstatbar16(); //Clear middle of status bar
|
||||||
|
|
||||||
Bsprintf(tempbuf,"Sector %d",sectnum);
|
Bsprintf(tempbuf,"Sector %d",sectnum);
|
||||||
printext16(8,ydim16+32,11,-1,tempbuf,0);
|
printext16(8,ydim16+32,11,-1,tempbuf,0);
|
||||||
|
|
||||||
printext16(8,ydim16+48,11,-1,"8*8 font: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789",0);
|
printext16(8,ydim16+48,11,-1,"8*8 font: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789",0);
|
||||||
printext16(8,ydim16+56,11,-1,"3*5 font: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789",1);
|
printext16(8,ydim16+56,11,-1,"3*5 font: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789",1);
|
||||||
|
|
||||||
i=ydim16; ydim16=ydim;
|
i=ydim16; ydim16=ydim;
|
||||||
drawline16(320,i+68,344,i+80,4); //Draw house
|
drawline16(320,i+68,344,i+80,4); //Draw house
|
||||||
drawline16(344,i+80,344,i+116,4);
|
drawline16(344,i+80,344,i+116,4);
|
||||||
drawline16(344,i+116,296,i+116,4);
|
drawline16(344,i+116,296,i+116,4);
|
||||||
drawline16(296,i+116,296,i+80,4);
|
drawline16(296,i+116,296,i+80,4);
|
||||||
drawline16(296,i+80,320,i+68,4);
|
drawline16(296,i+80,320,i+68,4);
|
||||||
ydim16=i;
|
ydim16=i;
|
||||||
enddrawing();
|
enddrawing();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtShowWallData(short wallnum) //F6
|
void ExtShowWallData(short wallnum) //F6
|
||||||
{
|
{
|
||||||
if (qsetmode == 200) //In 3D mode
|
if (qsetmode == 200) //In 3D mode
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
begindrawing();
|
begindrawing();
|
||||||
clearmidstatbar16(); //Clear middle of status bar
|
clearmidstatbar16(); //Clear middle of status bar
|
||||||
|
|
||||||
Bsprintf(tempbuf,"Wall %d",wallnum);
|
Bsprintf(tempbuf,"Wall %d",wallnum);
|
||||||
printext16(8,ydim16+32,11,-1,tempbuf,0);
|
printext16(8,ydim16+32,11,-1,tempbuf,0);
|
||||||
enddrawing();
|
enddrawing();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtShowSpriteData(short spritenum) //F6
|
void ExtShowSpriteData(short spritenum) //F6
|
||||||
{
|
{
|
||||||
if (qsetmode == 200) //In 3D mode
|
if (qsetmode == 200) //In 3D mode
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
begindrawing();
|
begindrawing();
|
||||||
clearmidstatbar16(); //Clear middle of status bar
|
clearmidstatbar16(); //Clear middle of status bar
|
||||||
|
|
||||||
Bsprintf(tempbuf,"Sprite %d",spritenum);
|
Bsprintf(tempbuf,"Sprite %d",spritenum);
|
||||||
printext16(8,ydim16+32,11,-1,tempbuf,0);
|
printext16(8,ydim16+32,11,-1,tempbuf,0);
|
||||||
enddrawing();
|
enddrawing();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtEditSectorData(short sectnum) //F7
|
void ExtEditSectorData(short sectnum) //F7
|
||||||
{
|
{
|
||||||
short nickdata;
|
short nickdata;
|
||||||
|
|
||||||
if (qsetmode == 200) //In 3D mode
|
if (qsetmode == 200) //In 3D mode
|
||||||
{
|
{
|
||||||
//Ceiling
|
//Ceiling
|
||||||
if (searchstat == 1)
|
if (searchstat == 1)
|
||||||
sector[searchsector].ceilingpicnum++; //Just a stupid example
|
sector[searchsector].ceilingpicnum++; //Just a stupid example
|
||||||
|
|
||||||
//Floor
|
//Floor
|
||||||
if (searchstat == 2)
|
if (searchstat == 2)
|
||||||
sector[searchsector].floorshade++; //Just a stupid example
|
sector[searchsector].floorshade++; //Just a stupid example
|
||||||
}
|
}
|
||||||
else //In 2D mode
|
else //In 2D mode
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf,"Sector (%d) Nick's variable: ",sectnum);
|
Bsprintf(tempbuf,"Sector (%d) Nick's variable: ",sectnum);
|
||||||
nickdata = 0;
|
nickdata = 0;
|
||||||
nickdata = getnumber16(tempbuf,nickdata,65536L,0);
|
nickdata = getnumber16(tempbuf,nickdata,65536L,0);
|
||||||
|
|
||||||
printmessage16(""); //Clear message box (top right of status bar)
|
printmessage16(""); //Clear message box (top right of status bar)
|
||||||
ExtShowSectorData(sectnum);
|
ExtShowSectorData(sectnum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtEditWallData(short wallnum) //F8
|
void ExtEditWallData(short wallnum) //F8
|
||||||
{
|
{
|
||||||
short nickdata;
|
short nickdata;
|
||||||
|
|
||||||
if (qsetmode == 200) //In 3D mode
|
if (qsetmode == 200) //In 3D mode
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf,"Wall (%d) Nick's variable: ",wallnum);
|
Bsprintf(tempbuf,"Wall (%d) Nick's variable: ",wallnum);
|
||||||
nickdata = 0;
|
nickdata = 0;
|
||||||
nickdata = getnumber16(tempbuf,nickdata,65536L,0);
|
nickdata = getnumber16(tempbuf,nickdata,65536L,0);
|
||||||
|
|
||||||
printmessage16(""); //Clear message box (top right of status bar)
|
printmessage16(""); //Clear message box (top right of status bar)
|
||||||
ExtShowWallData(wallnum);
|
ExtShowWallData(wallnum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtEditSpriteData(short spritenum) //F8
|
void ExtEditSpriteData(short spritenum) //F8
|
||||||
{
|
{
|
||||||
short nickdata;
|
short nickdata;
|
||||||
|
|
||||||
if (qsetmode == 200) //In 3D mode
|
if (qsetmode == 200) //In 3D mode
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf,"Sprite (%d) Nick's variable: ",spritenum);
|
Bsprintf(tempbuf,"Sprite (%d) Nick's variable: ",spritenum);
|
||||||
nickdata = 0;
|
nickdata = 0;
|
||||||
nickdata = getnumber16(tempbuf,nickdata,65536L,0);
|
nickdata = getnumber16(tempbuf,nickdata,65536L,0);
|
||||||
printmessage16("");
|
printmessage16("");
|
||||||
|
|
||||||
printmessage16(""); //Clear message box (top right of status bar)
|
printmessage16(""); //Clear message box (top right of status bar)
|
||||||
ExtShowSpriteData(spritenum);
|
ExtShowSpriteData(spritenum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void faketimerhandler(void)
|
void faketimerhandler(void)
|
||||||
{
|
{
|
||||||
sampletimer();
|
sampletimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Just thought you might want my getnumber16 code
|
//Just thought you might want my getnumber16 code
|
||||||
/*
|
/*
|
||||||
getnumber16(char namestart[80], short num, long maxnumber)
|
getnumber16(char namestart[80], short num, long maxnumber)
|
||||||
{
|
{
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -19,160 +19,160 @@
|
||||||
|
|
||||||
static void PopulateVideoModeLists(int fs, HWND list2d, HWND list3d)
|
static void PopulateVideoModeLists(int fs, HWND list2d, HWND list3d)
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
ComboBox_ResetContent(list2d);
|
ComboBox_ResetContent(list2d);
|
||||||
ComboBox_ResetContent(list3d);
|
ComboBox_ResetContent(list3d);
|
||||||
for (i=0; i<validmodecnt; i++) {
|
for (i=0; i<validmodecnt; i++) {
|
||||||
if (validmode[i].fs != fs) continue;
|
if (validmode[i].fs != fs) continue;
|
||||||
|
|
||||||
// all modes get added to the 3D mode list
|
// all modes get added to the 3D mode list
|
||||||
Bsprintf(buf, "%ldx%ld %dbpp", validmode[i].xdim, validmode[i].ydim, validmode[i].bpp);
|
Bsprintf(buf, "%ldx%ld %dbpp", validmode[i].xdim, validmode[i].ydim, validmode[i].bpp);
|
||||||
j = ComboBox_AddString(list3d, buf);
|
j = ComboBox_AddString(list3d, buf);
|
||||||
ComboBox_SetItemData(list3d, j, i);
|
ComboBox_SetItemData(list3d, j, i);
|
||||||
if (xdimgame == validmode[i].xdim && ydimgame == validmode[i].ydim && bppgame == validmode[i].bpp)
|
if (xdimgame == validmode[i].xdim && ydimgame == validmode[i].ydim && bppgame == validmode[i].bpp)
|
||||||
ComboBox_SetCurSel(list3d, j);
|
ComboBox_SetCurSel(list3d, j);
|
||||||
|
|
||||||
// only 8-bit modes get used for 2D
|
// only 8-bit modes get used for 2D
|
||||||
if (validmode[i].bpp != 8) continue;
|
if (validmode[i].bpp != 8) continue;
|
||||||
Bsprintf(buf, "%ldx%ld", validmode[i].xdim, validmode[i].ydim);
|
Bsprintf(buf, "%ldx%ld", validmode[i].xdim, validmode[i].ydim);
|
||||||
j = ComboBox_AddString(list2d, buf);
|
j = ComboBox_AddString(list2d, buf);
|
||||||
ComboBox_SetItemData(list2d, j, i);
|
ComboBox_SetItemData(list2d, j, i);
|
||||||
if (xdim2d == validmode[i].xdim && ydim2d == validmode[i].ydim && 8 == validmode[i].bpp)
|
if (xdim2d == validmode[i].xdim && ydim2d == validmode[i].ydim && 8 == validmode[i].bpp)
|
||||||
ComboBox_SetCurSel(list2d, j);
|
ComboBox_SetCurSel(list2d, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static INT_PTR CALLBACK LaunchWindowProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
static INT_PTR CALLBACK LaunchWindowProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch (uMsg) {
|
switch (uMsg) {
|
||||||
case WM_INITDIALOG: {
|
case WM_INITDIALOG: {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
if (lParam) {
|
if (lParam) {
|
||||||
long *saferect = (long*)lParam;
|
long *saferect = (long*)lParam;
|
||||||
RECT unresized, playbutton, exitbutton;
|
RECT unresized, playbutton, exitbutton;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
|
|
||||||
GetWindowRect(hwndDlg, &unresized);
|
GetWindowRect(hwndDlg, &unresized);
|
||||||
GetWindowRect(GetDlgItem(hwndDlg, IDOK), &playbutton);
|
GetWindowRect(GetDlgItem(hwndDlg, IDOK), &playbutton);
|
||||||
GetWindowRect(GetDlgItem(hwndDlg, IDCANCEL), &exitbutton);
|
GetWindowRect(GetDlgItem(hwndDlg, IDCANCEL), &exitbutton);
|
||||||
|
|
||||||
playbutton.right = 1 + playbutton.right - playbutton.left;
|
playbutton.right = 1 + playbutton.right - playbutton.left;
|
||||||
playbutton.bottom = 1 + playbutton.bottom - playbutton.top;
|
playbutton.bottom = 1 + playbutton.bottom - playbutton.top;
|
||||||
exitbutton.right = 1 + exitbutton.right - exitbutton.left;
|
exitbutton.right = 1 + exitbutton.right - exitbutton.left;
|
||||||
exitbutton.bottom = 1 + exitbutton.bottom - exitbutton.top;
|
exitbutton.bottom = 1 + exitbutton.bottom - exitbutton.top;
|
||||||
|
|
||||||
playbutton.left = playbutton.left - unresized.left;
|
playbutton.left = playbutton.left - unresized.left;
|
||||||
playbutton.top = playbutton.top - unresized.top;
|
playbutton.top = playbutton.top - unresized.top;
|
||||||
exitbutton.left = exitbutton.left - unresized.left;
|
exitbutton.left = exitbutton.left - unresized.left;
|
||||||
exitbutton.top = exitbutton.top - unresized.top;
|
exitbutton.top = exitbutton.top - unresized.top;
|
||||||
|
|
||||||
dx = saferect[2] - (unresized.right - unresized.left);
|
dx = saferect[2] - (unresized.right - unresized.left);
|
||||||
dy = saferect[3] - (unresized.bottom - unresized.top);
|
dy = saferect[3] - (unresized.bottom - unresized.top);
|
||||||
|
|
||||||
playbutton.left += dx; exitbutton.left += dx;
|
playbutton.left += dx; exitbutton.left += dx;
|
||||||
playbutton.top += dy; exitbutton.top += dy;
|
playbutton.top += dy; exitbutton.top += dy;
|
||||||
|
|
||||||
// reposition the dialog, play and exit buttons
|
// reposition the dialog, play and exit buttons
|
||||||
MoveWindow(hwndDlg, saferect[0], saferect[1], saferect[2], saferect[3], FALSE);
|
MoveWindow(hwndDlg, saferect[0], saferect[1], saferect[2], saferect[3], FALSE);
|
||||||
MoveWindow(GetDlgItem(hwndDlg, IDOK),
|
MoveWindow(GetDlgItem(hwndDlg, IDOK),
|
||||||
playbutton.left, playbutton.top, playbutton.right, playbutton.bottom, FALSE);
|
playbutton.left, playbutton.top, playbutton.right, playbutton.bottom, FALSE);
|
||||||
MoveWindow(GetDlgItem(hwndDlg, IDCANCEL),
|
MoveWindow(GetDlgItem(hwndDlg, IDCANCEL),
|
||||||
exitbutton.left, exitbutton.top, exitbutton.right, exitbutton.bottom, FALSE);
|
exitbutton.left, exitbutton.top, exitbutton.right, exitbutton.bottom, FALSE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// populate the controls
|
// populate the controls
|
||||||
Button_SetCheck(GetDlgItem(hwndDlg, IDCFULLSCREEN), fullscreen ? BST_CHECKED : BST_UNCHECKED);
|
Button_SetCheck(GetDlgItem(hwndDlg, IDCFULLSCREEN), fullscreen ? BST_CHECKED : BST_UNCHECKED);
|
||||||
PopulateVideoModeLists(fullscreen, GetDlgItem(hwndDlg, IDC2DVMODE), GetDlgItem(hwndDlg, IDC3DVMODE));
|
PopulateVideoModeLists(fullscreen, GetDlgItem(hwndDlg, IDC2DVMODE), GetDlgItem(hwndDlg, IDC3DVMODE));
|
||||||
|
|
||||||
ShowWindow(hwndDlg, SW_SHOW);
|
ShowWindow(hwndDlg, SW_SHOW);
|
||||||
/*
|
/*
|
||||||
if (GetDlgCtrlID((HWND)wParam) != IDOK) {
|
if (GetDlgCtrlID((HWND)wParam) != IDOK) {
|
||||||
SetFocus(GetDlgItem(hwndDlg, IDOK));
|
SetFocus(GetDlgItem(hwndDlg, IDOK));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
switch (LOWORD(wParam)) {
|
switch (LOWORD(wParam)) {
|
||||||
case IDCFULLSCREEN:
|
case IDCFULLSCREEN:
|
||||||
fullscreen = Button_GetCheck((HWND)lParam) == BST_CHECKED ? 1:0;
|
fullscreen = Button_GetCheck((HWND)lParam) == BST_CHECKED ? 1:0;
|
||||||
PopulateVideoModeLists(fullscreen, GetDlgItem(hwndDlg, IDC2DVMODE),
|
PopulateVideoModeLists(fullscreen, GetDlgItem(hwndDlg, IDC2DVMODE),
|
||||||
GetDlgItem(hwndDlg, IDC3DVMODE));
|
GetDlgItem(hwndDlg, IDC3DVMODE));
|
||||||
break;
|
break;
|
||||||
case IDC2DVMODE:
|
case IDC2DVMODE:
|
||||||
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
||||||
int i;
|
int i;
|
||||||
i = ComboBox_GetCurSel((HWND)lParam);
|
i = ComboBox_GetCurSel((HWND)lParam);
|
||||||
if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
|
if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
|
||||||
if (i != CB_ERR) {
|
if (i != CB_ERR) {
|
||||||
xdim2d = validmode[i].xdim;
|
xdim2d = validmode[i].xdim;
|
||||||
ydim2d = validmode[i].ydim;
|
ydim2d = validmode[i].ydim;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IDC3DVMODE:
|
case IDC3DVMODE:
|
||||||
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
||||||
int i;
|
int i;
|
||||||
i = ComboBox_GetCurSel((HWND)lParam);
|
i = ComboBox_GetCurSel((HWND)lParam);
|
||||||
if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
|
if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
|
||||||
if (i != CB_ERR) {
|
if (i != CB_ERR) {
|
||||||
xdimgame = validmode[i].xdim;
|
xdimgame = validmode[i].xdim;
|
||||||
ydimgame = validmode[i].ydim;
|
ydimgame = validmode[i].ydim;
|
||||||
bppgame = validmode[i].bpp;
|
bppgame = validmode[i].bpp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IDCANCEL:
|
case IDCANCEL:
|
||||||
quitevent = 1; // fall through
|
quitevent = 1; // fall through
|
||||||
case IDOK:
|
case IDOK:
|
||||||
DestroyWindow(hwndDlg);
|
DestroyWindow(hwndDlg);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoLaunchWindow(int initval)
|
int DoLaunchWindow(int initval)
|
||||||
{
|
{
|
||||||
HWND hwndStart, hwndLaunch;
|
HWND hwndStart, hwndLaunch;
|
||||||
MSG msg;
|
MSG msg;
|
||||||
long saferect[4];
|
long saferect[4];
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
// only show config window if no config is loaded, or if it is, only if left control is held
|
// only show config window if no config is loaded, or if it is, only if left control is held
|
||||||
if (initval == 0 /*&& !GetAsyncKeyState(VK_CONTROL)*/) return 0;
|
if (initval == 0 /*&& !GetAsyncKeyState(VK_CONTROL)*/) return 0;
|
||||||
|
|
||||||
if (win_getstartupwin((long*)&hwndStart, saferect, NULL)) return 0;
|
if (win_getstartupwin((long*)&hwndStart, saferect, NULL)) return 0;
|
||||||
|
|
||||||
hwndLaunch = CreateDialogParam((HINSTANCE)win_gethinstance(), MAKEINTRESOURCE(2000), hwndStart, LaunchWindowProc, (LPARAM)saferect);
|
hwndLaunch = CreateDialogParam((HINSTANCE)win_gethinstance(), MAKEINTRESOURCE(2000), hwndStart, LaunchWindowProc, (LPARAM)saferect);
|
||||||
if (hwndLaunch) {
|
if (hwndLaunch) {
|
||||||
EnableWindow(GetDlgItem(hwndStart,WIN_STARTWIN_ITEMLIST),FALSE);
|
EnableWindow(GetDlgItem(hwndStart,WIN_STARTWIN_ITEMLIST),FALSE);
|
||||||
#if 0
|
#if 0
|
||||||
while (GetMessage(&msg, NULL, 0, 0) > 0) {
|
while (GetMessage(&msg, NULL, 0, 0) > 0) {
|
||||||
if (!IsWindow(hwndLaunch) || quitevent) break;
|
if (!IsWindow(hwndLaunch) || quitevent) break;
|
||||||
if (IsDialogMessage(hwndStart, &msg) /*|| IsDialogMessage(hwndLaunch, &msg)*/) continue;
|
if (IsDialogMessage(hwndStart, &msg) /*|| IsDialogMessage(hwndLaunch, &msg)*/) continue;
|
||||||
|
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
while (IsWindow(hwndLaunch) && !quitevent) {
|
while (IsWindow(hwndLaunch) && !quitevent) {
|
||||||
x = win_getstartupcommand();
|
x = win_getstartupcommand();
|
||||||
if (x != 0) LaunchWindowProc(hwndLaunch, WM_COMMAND, x, 0);
|
if (x != 0) LaunchWindowProc(hwndLaunch, WM_COMMAND, x, 0);
|
||||||
handleevents();
|
handleevents();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
EnableWindow(GetDlgItem(hwndStart,WIN_STARTWIN_ITEMLIST),TRUE);
|
EnableWindow(GetDlgItem(hwndStart,WIN_STARTWIN_ITEMLIST),TRUE);
|
||||||
}
|
}
|
||||||
if (quitevent) return 1;
|
if (quitevent) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -41,278 +41,278 @@
|
||||||
|
|
||||||
int Brand(void)
|
int Brand(void)
|
||||||
{
|
{
|
||||||
return rand();
|
return rand();
|
||||||
}
|
}
|
||||||
|
|
||||||
void *Bmalloc(bsize_t size)
|
void *Bmalloc(bsize_t size)
|
||||||
{
|
{
|
||||||
return malloc(size);
|
return malloc(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bfree(void *ptr)
|
void Bfree(void *ptr)
|
||||||
{
|
{
|
||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bopen(const char *pathname, int flags, unsigned mode)
|
int Bopen(const char *pathname, int flags, unsigned mode)
|
||||||
{
|
{
|
||||||
int n=0,o=0;
|
int n=0,o=0;
|
||||||
|
|
||||||
if (flags&BO_BINARY) n|=O_BINARY; else n|=O_TEXT;
|
if (flags&BO_BINARY) n|=O_BINARY; else n|=O_TEXT;
|
||||||
if ((flags&BO_RDWR)==BO_RDWR) n|=O_RDWR;
|
if ((flags&BO_RDWR)==BO_RDWR) n|=O_RDWR;
|
||||||
else if ((flags&BO_RDWR)==BO_WRONLY) n|=O_WRONLY;
|
else if ((flags&BO_RDWR)==BO_WRONLY) n|=O_WRONLY;
|
||||||
else if ((flags&BO_RDWR)==BO_RDONLY) n|=O_RDONLY;
|
else if ((flags&BO_RDWR)==BO_RDONLY) n|=O_RDONLY;
|
||||||
if (flags&BO_APPEND) n|=O_APPEND;
|
if (flags&BO_APPEND) n|=O_APPEND;
|
||||||
if (flags&BO_CREAT) n|=O_CREAT;
|
if (flags&BO_CREAT) n|=O_CREAT;
|
||||||
if (flags&BO_TRUNC) n|=O_TRUNC;
|
if (flags&BO_TRUNC) n|=O_TRUNC;
|
||||||
if (mode&BS_IREAD) o|=S_IREAD;
|
if (mode&BS_IREAD) o|=S_IREAD;
|
||||||
if (mode&BS_IWRITE) o|=S_IWRITE;
|
if (mode&BS_IWRITE) o|=S_IWRITE;
|
||||||
if (mode&BS_IEXEC) o|=S_IEXEC;
|
if (mode&BS_IEXEC) o|=S_IEXEC;
|
||||||
|
|
||||||
return open(pathname,n,o);
|
return open(pathname,n,o);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bclose(int fd)
|
int Bclose(int fd)
|
||||||
{
|
{
|
||||||
return close(fd);
|
return close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
bssize_t Bwrite(int fd, const void *buf, bsize_t count)
|
bssize_t Bwrite(int fd, const void *buf, bsize_t count)
|
||||||
{
|
{
|
||||||
return write(fd,buf,count);
|
return write(fd,buf,count);
|
||||||
}
|
}
|
||||||
|
|
||||||
bssize_t Bread(int fd, void *buf, bsize_t count)
|
bssize_t Bread(int fd, void *buf, bsize_t count)
|
||||||
{
|
{
|
||||||
return read(fd,buf,count);
|
return read(fd,buf,count);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Blseek(int fildes, int offset, int whence)
|
int Blseek(int fildes, int offset, int whence)
|
||||||
{
|
{
|
||||||
switch (whence) {
|
switch (whence) {
|
||||||
case BSEEK_SET: whence=SEEK_SET; break;
|
case BSEEK_SET: whence=SEEK_SET; break;
|
||||||
case BSEEK_CUR: whence=SEEK_CUR; break;
|
case BSEEK_CUR: whence=SEEK_CUR; break;
|
||||||
case BSEEK_END: whence=SEEK_END; break;
|
case BSEEK_END: whence=SEEK_END; break;
|
||||||
}
|
}
|
||||||
return lseek(fildes,offset,whence);
|
return lseek(fildes,offset,whence);
|
||||||
}
|
}
|
||||||
|
|
||||||
BFILE *Bfopen(const char *path, const char *mode)
|
BFILE *Bfopen(const char *path, const char *mode)
|
||||||
{
|
{
|
||||||
return (BFILE*)fopen(path,mode);
|
return (BFILE*)fopen(path,mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bfclose(BFILE *stream)
|
int Bfclose(BFILE *stream)
|
||||||
{
|
{
|
||||||
return fclose((FILE*)stream);
|
return fclose((FILE*)stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Brewind(BFILE *stream)
|
void Brewind(BFILE *stream)
|
||||||
{
|
{
|
||||||
rewind((FILE*)stream);
|
rewind((FILE*)stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bfgetc(BFILE *stream)
|
int Bfgetc(BFILE *stream)
|
||||||
{
|
{
|
||||||
return fgetc((FILE*)stream);
|
return fgetc((FILE*)stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Bfgets(char *s, int size, BFILE *stream)
|
char *Bfgets(char *s, int size, BFILE *stream)
|
||||||
{
|
{
|
||||||
return fgets(s,size,(FILE*)stream);
|
return fgets(s,size,(FILE*)stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bfputc(int c, BFILE *stream)
|
int Bfputc(int c, BFILE *stream)
|
||||||
{
|
{
|
||||||
return fputc(c,(FILE*)stream);
|
return fputc(c,(FILE*)stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bfputs(const char *s, BFILE *stream)
|
int Bfputs(const char *s, BFILE *stream)
|
||||||
{
|
{
|
||||||
return fputs(s,(FILE*)stream);
|
return fputs(s,(FILE*)stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
bsize_t Bfread(void *ptr, bsize_t size, bsize_t nmemb, BFILE *stream)
|
bsize_t Bfread(void *ptr, bsize_t size, bsize_t nmemb, BFILE *stream)
|
||||||
{
|
{
|
||||||
return fread(ptr,size,nmemb,(FILE*)stream);
|
return fread(ptr,size,nmemb,(FILE*)stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
bsize_t Bfwrite(const void *ptr, bsize_t size, bsize_t nmemb, BFILE *stream)
|
bsize_t Bfwrite(const void *ptr, bsize_t size, bsize_t nmemb, BFILE *stream)
|
||||||
{
|
{
|
||||||
return fwrite(ptr,size,nmemb,(FILE*)stream);
|
return fwrite(ptr,size,nmemb,(FILE*)stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *Bstrdup(const char *s)
|
char *Bstrdup(const char *s)
|
||||||
{
|
{
|
||||||
return strdup(s);
|
return strdup(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Bstrcpy(char *dest, const char *src)
|
char *Bstrcpy(char *dest, const char *src)
|
||||||
{
|
{
|
||||||
return strcpy(dest,src);
|
return strcpy(dest,src);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Bstrncpy(char *dest, const char *src, bsize_t n)
|
char *Bstrncpy(char *dest, const char *src, bsize_t n)
|
||||||
{
|
{
|
||||||
return strncpy(dest,src,n);
|
return strncpy(dest,src,n);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bstrcmp(const char *s1, const char *s2)
|
int Bstrcmp(const char *s1, const char *s2)
|
||||||
{
|
{
|
||||||
return strcmp(s1,s2);
|
return strcmp(s1,s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bstrncmp(const char *s1, const char *s2, bsize_t n)
|
int Bstrncmp(const char *s1, const char *s2, bsize_t n)
|
||||||
{
|
{
|
||||||
return strncmp(s1,s2,n);
|
return strncmp(s1,s2,n);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bstrcasecmp(const char *s1, const char *s2)
|
int Bstrcasecmp(const char *s1, const char *s2)
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
return stricmp(s1,s2);
|
return stricmp(s1,s2);
|
||||||
#else
|
#else
|
||||||
return strcasecmp(s1,s2);
|
return strcasecmp(s1,s2);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bstrncasecmp(const char *s1, const char *s2, bsize_t n)
|
int Bstrncasecmp(const char *s1, const char *s2, bsize_t n)
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
return strnicmp(s1,s2,n);
|
return strnicmp(s1,s2,n);
|
||||||
#else
|
#else
|
||||||
return strncasecmp(s1,s2,n);
|
return strncasecmp(s1,s2,n);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Bstrcat(char *dest, const char *src)
|
char *Bstrcat(char *dest, const char *src)
|
||||||
{
|
{
|
||||||
return strcat(dest,src);
|
return strcat(dest,src);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Bstrncat(char *dest, const char *src, bsize_t n)
|
char *Bstrncat(char *dest, const char *src, bsize_t n)
|
||||||
{
|
{
|
||||||
return strncat(dest,src,n);
|
return strncat(dest,src,n);
|
||||||
}
|
}
|
||||||
|
|
||||||
bsize_t Bstrlen(const char *s)
|
bsize_t Bstrlen(const char *s)
|
||||||
{
|
{
|
||||||
return strlen(s);
|
return strlen(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Bstrchr(const char *s, int c)
|
char *Bstrchr(const char *s, int c)
|
||||||
{
|
{
|
||||||
return strchr(s,c);
|
return strchr(s,c);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Bstrrchr(const char *s, int c)
|
char *Bstrrchr(const char *s, int c)
|
||||||
{
|
{
|
||||||
return strrchr(s,c);
|
return strrchr(s,c);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Batoi(const char *nptr)
|
int Batoi(const char *nptr)
|
||||||
{
|
{
|
||||||
return atoi(nptr);
|
return atoi(nptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
long Batol(const char *nptr)
|
long Batol(const char *nptr)
|
||||||
{
|
{
|
||||||
return atol(nptr);
|
return atol(nptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
long int Bstrtol(const char *nptr, char **endptr, int base)
|
long int Bstrtol(const char *nptr, char **endptr, int base)
|
||||||
{
|
{
|
||||||
return strtol(nptr,endptr,base);
|
return strtol(nptr,endptr,base);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long int Bstrtoul(const char *nptr, char **endptr, int base)
|
unsigned long int Bstrtoul(const char *nptr, char **endptr, int base)
|
||||||
{
|
{
|
||||||
return strtoul(nptr,endptr,base);
|
return strtoul(nptr,endptr,base);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *Bmemcpy(void *dest, const void *src, bsize_t n)
|
void *Bmemcpy(void *dest, const void *src, bsize_t n)
|
||||||
{
|
{
|
||||||
return memcpy(dest,src,n);
|
return memcpy(dest,src,n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *Bmemmove(void *dest, const void *src, bsize_t n)
|
void *Bmemmove(void *dest, const void *src, bsize_t n)
|
||||||
{
|
{
|
||||||
return memmove(dest,src,n);
|
return memmove(dest,src,n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *Bmemchr(const void *s, int c, bsize_t n)
|
void *Bmemchr(const void *s, int c, bsize_t n)
|
||||||
{
|
{
|
||||||
return memchr(s,c,n);
|
return memchr(s,c,n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *Bmemset(void *s, int c, bsize_t n)
|
void *Bmemset(void *s, int c, bsize_t n)
|
||||||
{
|
{
|
||||||
return memset(s,c,n);
|
return memset(s,c,n);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bprintf(const char *format, ...)
|
int Bprintf(const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
va_start(ap,format);
|
va_start(ap,format);
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
r = _vprintf(format,ap);
|
r = _vprintf(format,ap);
|
||||||
#else
|
#else
|
||||||
r = vprintf(format,ap);
|
r = vprintf(format,ap);
|
||||||
#endif
|
#endif
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bsprintf(char *str, const char *format, ...)
|
int Bsprintf(char *str, const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
va_start(ap,format);
|
va_start(ap,format);
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
r = _vsprintf(str,format,ap);
|
r = _vsprintf(str,format,ap);
|
||||||
#else
|
#else
|
||||||
r = vsprintf(str,format,ap);
|
r = vsprintf(str,format,ap);
|
||||||
#endif
|
#endif
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bsnprintf(char *str, bsize_t size, const char *format, ...)
|
int Bsnprintf(char *str, bsize_t size, const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
va_start(ap,format);
|
va_start(ap,format);
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
r = _vsnprintf(str,size,format,ap);
|
r = _vsnprintf(str,size,format,ap);
|
||||||
#else
|
#else
|
||||||
r = vsnprintf(str,size,format,ap);
|
r = vsnprintf(str,size,format,ap);
|
||||||
#endif
|
#endif
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bvsnprintf(char *str, bsize_t size, const char *format, va_list ap)
|
int Bvsnprintf(char *str, bsize_t size, const char *format, va_list ap)
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
return _vsnprintf(str,size,format,ap);
|
return _vsnprintf(str,size,format,ap);
|
||||||
#else
|
#else
|
||||||
return vsnprintf(str,size,format,ap);
|
return vsnprintf(str,size,format,ap);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Bgetenv(const char *name)
|
char *Bgetenv(const char *name)
|
||||||
{
|
{
|
||||||
return getenv(name);
|
return getenv(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Bgetcwd(char *buf, bsize_t size)
|
char *Bgetcwd(char *buf, bsize_t size)
|
||||||
{
|
{
|
||||||
return getcwd(buf,size);
|
return getcwd(buf,size);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __compat_h_macrodef__
|
#endif // __compat_h_macrodef__
|
||||||
|
@ -325,359 +325,359 @@ char *Bgetcwd(char *buf, bsize_t size)
|
||||||
char *Bgethomedir(void)
|
char *Bgethomedir(void)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
TCHAR appdata[MAX_PATH];
|
TCHAR appdata[MAX_PATH];
|
||||||
|
|
||||||
//# if defined SHGetFolderPath
|
//# if defined SHGetFolderPath
|
||||||
// if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL, 0, appdata)))
|
// if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL, 0, appdata)))
|
||||||
//# if defined SHGetSpecialFolderPath
|
//# if defined SHGetSpecialFolderPath
|
||||||
if (SUCCEEDED(SHGetSpecialFolderPathA(NULL, appdata, CSIDL_APPDATA, FALSE)))
|
if (SUCCEEDED(SHGetSpecialFolderPathA(NULL, appdata, CSIDL_APPDATA, FALSE)))
|
||||||
//# else
|
//# else
|
||||||
//# error Cannot find SHGetFolderPath or SHGetSpecialFolderPath. Perhaps your shlobj.h is ancient?
|
//# error Cannot find SHGetFolderPath or SHGetSpecialFolderPath. Perhaps your shlobj.h is ancient?
|
||||||
//# endif
|
//# endif
|
||||||
return strdup(appdata);
|
return strdup(appdata);
|
||||||
return NULL;
|
return NULL;
|
||||||
#else
|
#else
|
||||||
char *e = getenv("HOME");
|
char *e = getenv("HOME");
|
||||||
if (!e) return NULL;
|
if (!e) return NULL;
|
||||||
return strdup(e);
|
return strdup(e);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bcorrectfilename(char *filename, int removefn)
|
int Bcorrectfilename(char *filename, int removefn)
|
||||||
{
|
{
|
||||||
char *fn;
|
char *fn;
|
||||||
char *tokarr[64], *first, *next, *token;
|
char *tokarr[64], *first, *next, *token;
|
||||||
int i, ntok = 0, leadslash = 0, trailslash = 0;
|
int i, ntok = 0, leadslash = 0, trailslash = 0;
|
||||||
|
|
||||||
fn = strdup(filename);
|
fn = strdup(filename);
|
||||||
if (!fn) return -1;
|
if (!fn) return -1;
|
||||||
|
|
||||||
for (first=fn; *first; first++) {
|
for (first=fn; *first; first++) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (*first == '\\') *first = '/';
|
if (*first == '\\') *first = '/';
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
leadslash = (*fn == '/');
|
leadslash = (*fn == '/');
|
||||||
trailslash = (first>fn && first[-1] == '/');
|
trailslash = (first>fn && first[-1] == '/');
|
||||||
|
|
||||||
first = fn;
|
first = fn;
|
||||||
do {
|
do {
|
||||||
token = Bstrtoken(first, "/", &next, 1);
|
token = Bstrtoken(first, "/", &next, 1);
|
||||||
first = NULL;
|
first = NULL;
|
||||||
if (!token) break;
|
if (!token) break;
|
||||||
else if (token[0] == 0) continue;
|
else if (token[0] == 0) continue;
|
||||||
else if (token[0] == '.' && token[1] == 0) continue;
|
else if (token[0] == '.' && token[1] == 0) continue;
|
||||||
else if (token[0] == '.' && token[1] == '.' && token[2] == 0) ntok = max(0,ntok-1);
|
else if (token[0] == '.' && token[1] == '.' && token[2] == 0) ntok = max(0,ntok-1);
|
||||||
else tokarr[ntok++] = token;
|
else tokarr[ntok++] = token;
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
if (!trailslash && removefn) { ntok = max(0,ntok-1); trailslash = 1; }
|
if (!trailslash && removefn) { ntok = max(0,ntok-1); trailslash = 1; }
|
||||||
if (ntok == 0 && trailslash && leadslash) trailslash = 0;
|
if (ntok == 0 && trailslash && leadslash) trailslash = 0;
|
||||||
|
|
||||||
first = filename;
|
first = filename;
|
||||||
if (leadslash) *(first++) = '/';
|
if (leadslash) *(first++) = '/';
|
||||||
for (i=0; i<ntok; i++) {
|
for (i=0; i<ntok; i++) {
|
||||||
if (i>0) *(first++) = '/';
|
if (i>0) *(first++) = '/';
|
||||||
for (token=tokarr[i]; *token; token++)
|
for (token=tokarr[i]; *token; token++)
|
||||||
*(first++) = *token;
|
*(first++) = *token;
|
||||||
}
|
}
|
||||||
if (trailslash) *(first++) = '/';
|
if (trailslash) *(first++) = '/';
|
||||||
*(first++) = 0;
|
*(first++) = 0;
|
||||||
|
|
||||||
Bfree(fn);
|
Bfree(fn);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bcanonicalisefilename(char *filename, int removefn)
|
int Bcanonicalisefilename(char *filename, int removefn)
|
||||||
{
|
{
|
||||||
char cwd[BMAX_PATH], fn[BMAX_PATH], *p;
|
char cwd[BMAX_PATH], fn[BMAX_PATH], *p;
|
||||||
char *fnp = filename;
|
char *fnp = filename;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
int drv = 0;
|
int drv = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
{
|
{
|
||||||
if (filename[0] && filename[1] == ':') {
|
if (filename[0] && filename[1] == ':') {
|
||||||
// filename is prefixed with a drive
|
// filename is prefixed with a drive
|
||||||
drv = toupper(filename[0])-'A' + 1;
|
drv = toupper(filename[0])-'A' + 1;
|
||||||
fnp += 2;
|
fnp += 2;
|
||||||
}
|
}
|
||||||
if (!_getdcwd(drv, cwd, sizeof(cwd))) return -1;
|
if (!_getdcwd(drv, cwd, sizeof(cwd))) return -1;
|
||||||
for (p=cwd; *p; p++) if (*p == '\\') *p = '/';
|
for (p=cwd; *p; p++) if (*p == '\\') *p = '/';
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (!getcwd(cwd,sizeof(cwd))) return -1;
|
if (!getcwd(cwd,sizeof(cwd))) return -1;
|
||||||
#endif
|
#endif
|
||||||
p = strrchr(cwd,'/'); if (!p || p[1]) strcat(cwd, "/");
|
p = strrchr(cwd,'/'); if (!p || p[1]) strcat(cwd, "/");
|
||||||
|
|
||||||
strcpy(fn, fnp);
|
strcpy(fn, fnp);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
for (p=fn; *p; p++) if (*p == '\\') *p = '/';
|
for (p=fn; *p; p++) if (*p == '\\') *p = '/';
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fn[0] != '/') {
|
if (fn[0] != '/') {
|
||||||
// we are dealing with a path relative to the current directory
|
// we are dealing with a path relative to the current directory
|
||||||
strcpy(filename, cwd);
|
strcpy(filename, cwd);
|
||||||
strcat(filename, fn);
|
strcat(filename, fn);
|
||||||
} else {
|
} else {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
filename[0] = cwd[0];
|
filename[0] = cwd[0];
|
||||||
filename[1] = ':';
|
filename[1] = ':';
|
||||||
filename[2] = 0;
|
filename[2] = 0;
|
||||||
#else
|
#else
|
||||||
filename[0] = 0;
|
filename[0] = 0;
|
||||||
#endif
|
#endif
|
||||||
strcat(filename, fn);
|
strcat(filename, fn);
|
||||||
}
|
}
|
||||||
fnp = filename;
|
fnp = filename;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
fnp += 2; // skip the drive
|
fnp += 2; // skip the drive
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return Bcorrectfilename(fnp,1);
|
return Bcorrectfilename(fnp,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Bgetsystemdrives(void)
|
char *Bgetsystemdrives(void)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
char *str, *p;
|
char *str, *p;
|
||||||
DWORD drv, mask;
|
DWORD drv, mask;
|
||||||
int number=0;
|
int number=0;
|
||||||
|
|
||||||
drv = GetLogicalDrives();
|
drv = GetLogicalDrives();
|
||||||
if (drv == 0) return NULL;
|
if (drv == 0) return NULL;
|
||||||
|
|
||||||
for (mask=1; mask<0x8000000l; mask<<=1) {
|
for (mask=1; mask<0x8000000l; mask<<=1) {
|
||||||
if ((drv&mask) == 0) continue;
|
if ((drv&mask) == 0) continue;
|
||||||
number++;
|
number++;
|
||||||
}
|
}
|
||||||
|
|
||||||
str = p = (char *)malloc(1 + (3*number));
|
str = p = (char *)malloc(1 + (3*number));
|
||||||
if (!str) return NULL;
|
if (!str) return NULL;
|
||||||
|
|
||||||
number = 0;
|
number = 0;
|
||||||
for (mask=1; mask<0x8000000l; mask<<=1, number++) {
|
for (mask=1; mask<0x8000000l; mask<<=1, number++) {
|
||||||
if ((drv&mask) == 0) continue;
|
if ((drv&mask) == 0) continue;
|
||||||
*(p++) = 'A' + number;
|
*(p++) = 'A' + number;
|
||||||
*(p++) = ':';
|
*(p++) = ':';
|
||||||
*(p++) = 0;
|
*(p++) = 0;
|
||||||
}
|
}
|
||||||
*(p++) = 0;
|
*(p++) = 0;
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
#else
|
#else
|
||||||
// Perhaps have Unix OS's put /, /home/user, and /mnt/* in the "drives" list?
|
// Perhaps have Unix OS's put /, /home/user, and /mnt/* in the "drives" list?
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
long Bfilelength(int fd)
|
long Bfilelength(int fd)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (fstat(fd, &st) < 0) return -1;
|
if (fstat(fd, &st) < 0) return -1;
|
||||||
return(long)(st.st_size);
|
return(long)(st.st_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
long dir;
|
long dir;
|
||||||
struct _finddata_t fid;
|
struct _finddata_t fid;
|
||||||
#else
|
#else
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
#endif
|
#endif
|
||||||
struct Bdirent info;
|
struct Bdirent info;
|
||||||
int status;
|
int status;
|
||||||
char name[1];
|
char name[1];
|
||||||
} BDIR_real;
|
} BDIR_real;
|
||||||
|
|
||||||
BDIR* Bopendir(const char *name)
|
BDIR* Bopendir(const char *name)
|
||||||
{
|
{
|
||||||
BDIR_real *dirr;
|
BDIR_real *dirr;
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
char *t,*tt;
|
char *t,*tt;
|
||||||
t = (char*)malloc(strlen(name)+1+4);
|
t = (char*)malloc(strlen(name)+1+4);
|
||||||
if (!t) return NULL;
|
if (!t) return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
dirr = (BDIR_real*)malloc(sizeof(BDIR_real) + strlen(name));
|
dirr = (BDIR_real*)malloc(sizeof(BDIR_real) + strlen(name));
|
||||||
if (!dirr) {
|
if (!dirr) {
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
free(t);
|
free(t);
|
||||||
#endif
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
strcpy(t,name);
|
strcpy(t,name);
|
||||||
tt = t+strlen(name)-1;
|
tt = t+strlen(name)-1;
|
||||||
while (*tt == ' ' && tt>t) tt--;
|
while (*tt == ' ' && tt>t) tt--;
|
||||||
if (*tt != '/' && *tt != '\\') *(++tt) = '/';
|
if (*tt != '/' && *tt != '\\') *(++tt) = '/';
|
||||||
*(++tt) = '*';
|
*(++tt) = '*';
|
||||||
*(++tt) = '.';
|
*(++tt) = '.';
|
||||||
*(++tt) = '*';
|
*(++tt) = '*';
|
||||||
*(++tt) = 0;
|
*(++tt) = 0;
|
||||||
|
|
||||||
dirr->dir = _findfirst(t,&dirr->fid);
|
dirr->dir = _findfirst(t,&dirr->fid);
|
||||||
free(t);
|
free(t);
|
||||||
if (dirr->dir == -1) {
|
if (dirr->dir == -1) {
|
||||||
free(dirr);
|
free(dirr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
dirr->dir = opendir(name);
|
dirr->dir = opendir(name);
|
||||||
if (dirr->dir == NULL) {
|
if (dirr->dir == NULL) {
|
||||||
free(dirr);
|
free(dirr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
dirr->status = 0;
|
dirr->status = 0;
|
||||||
strcpy(dirr->name, name);
|
strcpy(dirr->name, name);
|
||||||
|
|
||||||
return (BDIR*)dirr;
|
return (BDIR*)dirr;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Bdirent* Breaddir(BDIR *dir)
|
struct Bdirent* Breaddir(BDIR *dir)
|
||||||
{
|
{
|
||||||
BDIR_real *dirr = (BDIR_real*)dir;
|
BDIR_real *dirr = (BDIR_real*)dir;
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char *fn;
|
char *fn;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
if (dirr->status > 0) {
|
if (dirr->status > 0) {
|
||||||
if (_findnext(dirr->dir,&dirr->fid) != 0) {
|
if (_findnext(dirr->dir,&dirr->fid) != 0) {
|
||||||
dirr->status = -1;
|
dirr->status = -1;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dirr->info.namlen = strlen(dirr->fid.name);
|
dirr->info.namlen = strlen(dirr->fid.name);
|
||||||
dirr->info.name = dirr->fid.name;
|
dirr->info.name = dirr->fid.name;
|
||||||
dirr->status++;
|
dirr->status++;
|
||||||
#else
|
#else
|
||||||
de = readdir(dirr->dir);
|
de = readdir(dirr->dir);
|
||||||
if (de == NULL) {
|
if (de == NULL) {
|
||||||
dirr->status = -1;
|
dirr->status = -1;
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
dirr->status++;
|
dirr->status++;
|
||||||
}
|
}
|
||||||
//# if defined(__WATCOMC__) || defined(__linux) || defined(__BEOS__) || defined(__QNX__) || defined(SKYOS)
|
//# if defined(__WATCOMC__) || defined(__linux) || defined(__BEOS__) || defined(__QNX__) || defined(SKYOS)
|
||||||
dirr->info.namlen = strlen(de->d_name);
|
dirr->info.namlen = strlen(de->d_name);
|
||||||
//# else
|
//# else
|
||||||
// dirr->info.namlen = de->d_namlen;
|
// dirr->info.namlen = de->d_namlen;
|
||||||
//# endif
|
//# endif
|
||||||
dirr->info.name = de->d_name;
|
dirr->info.name = de->d_name;
|
||||||
#endif
|
#endif
|
||||||
dirr->info.mode = 0;
|
dirr->info.mode = 0;
|
||||||
dirr->info.size = 0;
|
dirr->info.size = 0;
|
||||||
dirr->info.mtime = 0;
|
dirr->info.mtime = 0;
|
||||||
|
|
||||||
fn = (char *)malloc(strlen(dirr->name) + 1 + dirr->info.namlen + 1);
|
fn = (char *)malloc(strlen(dirr->name) + 1 + dirr->info.namlen + 1);
|
||||||
if (fn) {
|
if (fn) {
|
||||||
sprintf(fn,"%s/%s",dirr->name,dirr->info.name);
|
sprintf(fn,"%s/%s",dirr->name,dirr->info.name);
|
||||||
if (!stat(fn, &st)) {
|
if (!stat(fn, &st)) {
|
||||||
dirr->info.mode = st.st_mode;
|
dirr->info.mode = st.st_mode;
|
||||||
dirr->info.size = st.st_size;
|
dirr->info.size = st.st_size;
|
||||||
dirr->info.mtime = st.st_mtime;
|
dirr->info.mtime = st.st_mtime;
|
||||||
}
|
}
|
||||||
free(fn);
|
free(fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
return &dirr->info;
|
return &dirr->info;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bclosedir(BDIR *dir)
|
int Bclosedir(BDIR *dir)
|
||||||
{
|
{
|
||||||
BDIR_real *dirr = (BDIR_real*)dir;
|
BDIR_real *dirr = (BDIR_real*)dir;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
_findclose(dirr->dir);
|
_findclose(dirr->dir);
|
||||||
#else
|
#else
|
||||||
closedir(dirr->dir);
|
closedir(dirr->dir);
|
||||||
#endif
|
#endif
|
||||||
free(dirr);
|
free(dirr);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *Bstrtoken(char *s, char *delim, char **ptrptr, int chop)
|
char *Bstrtoken(char *s, char *delim, char **ptrptr, int chop)
|
||||||
{
|
{
|
||||||
char *p, *start;
|
char *p, *start;
|
||||||
|
|
||||||
if (!ptrptr) return NULL;
|
if (!ptrptr) return NULL;
|
||||||
|
|
||||||
if (s) p = s;
|
if (s) p = s;
|
||||||
else p = *ptrptr;
|
else p = *ptrptr;
|
||||||
|
|
||||||
if (!p) return NULL;
|
if (!p) return NULL;
|
||||||
|
|
||||||
while (*p != 0 && strchr(delim, *p)) p++;
|
while (*p != 0 && strchr(delim, *p)) p++;
|
||||||
if (*p == 0) {
|
if (*p == 0) {
|
||||||
*ptrptr = NULL;
|
*ptrptr = NULL;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
start = p;
|
start = p;
|
||||||
while (*p != 0 && !strchr(delim, *p)) p++;
|
while (*p != 0 && !strchr(delim, *p)) p++;
|
||||||
if (*p == 0) *ptrptr = NULL;
|
if (*p == 0) *ptrptr = NULL;
|
||||||
else {
|
else {
|
||||||
if (chop) *(p++) = 0;
|
if (chop) *(p++) = 0;
|
||||||
*ptrptr = p;
|
*ptrptr = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
return start;
|
return start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Brute-force case-insensitive, slash-insensitive, * and ? wildcard matcher
|
//Brute-force case-insensitive, slash-insensitive, * and ? wildcard matcher
|
||||||
//Given: string i and string j. string j can have wildcards
|
//Given: string i and string j. string j can have wildcards
|
||||||
//Returns: 1:matches, 0:doesn't match
|
//Returns: 1:matches, 0:doesn't match
|
||||||
long Bwildmatch (const char *i, const char *j)
|
long Bwildmatch (const char *i, const char *j)
|
||||||
{
|
{
|
||||||
const char *k;
|
const char *k;
|
||||||
char c0, c1;
|
char c0, c1;
|
||||||
|
|
||||||
if (!*j) return(1);
|
if (!*j) return(1);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (*j == '*')
|
if (*j == '*')
|
||||||
{
|
{
|
||||||
for(k=i,j++;*k;k++) if (Bwildmatch(k,j)) return(1);
|
for(k=i,j++;*k;k++) if (Bwildmatch(k,j)) return(1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!*i) return(0);
|
if (!*i) return(0);
|
||||||
if (*j == '?') { i++; j++; continue; }
|
if (*j == '?') { i++; j++; continue; }
|
||||||
c0 = *i; if ((c0 >= 'a') && (c0 <= 'z')) c0 -= 32;
|
c0 = *i; if ((c0 >= 'a') && (c0 <= 'z')) c0 -= 32;
|
||||||
c1 = *j; if ((c1 >= 'a') && (c1 <= 'z')) c1 -= 32;
|
c1 = *j; if ((c1 >= 'a') && (c1 <= 'z')) c1 -= 32;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (c0 == '/') c0 = '\\';
|
if (c0 == '/') c0 = '\\';
|
||||||
if (c1 == '/') c1 = '\\';
|
if (c1 == '/') c1 = '\\';
|
||||||
#endif
|
#endif
|
||||||
if (c0 != c1) return(0);
|
if (c0 != c1) return(0);
|
||||||
i++; j++;
|
i++; j++;
|
||||||
} while (*j);
|
} while (*j);
|
||||||
return(!*i);
|
return(!*i);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
char *Bstrlwr(char *s)
|
char *Bstrlwr(char *s)
|
||||||
{
|
{
|
||||||
char *t = s;
|
char *t = s;
|
||||||
if (!s) return s;
|
if (!s) return s;
|
||||||
while (*t) { *t = Btolower(*t); t++; }
|
while (*t) { *t = Btolower(*t); t++; }
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Bstrupr(char *s)
|
char *Bstrupr(char *s)
|
||||||
{
|
{
|
||||||
char *t = s;
|
char *t = s;
|
||||||
if (!s) return s;
|
if (!s) return s;
|
||||||
while (*t) { *t = Btoupper(*t); t++; }
|
while (*t) { *t = Btoupper(*t); t++; }
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -688,28 +688,28 @@ char *Bstrupr(char *s)
|
||||||
unsigned int Bgetsysmemsize(void)
|
unsigned int Bgetsysmemsize(void)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
MEMORYSTATUS memst;
|
MEMORYSTATUS memst;
|
||||||
GlobalMemoryStatus(&memst);
|
GlobalMemoryStatus(&memst);
|
||||||
return (unsigned int)memst.dwTotalPhys;
|
return (unsigned int)memst.dwTotalPhys;
|
||||||
#elif (defined(_SC_PAGE_SIZE) || defined(_SC_PAGESIZE)) && defined(_SC_PHYS_PAGES)
|
#elif (defined(_SC_PAGE_SIZE) || defined(_SC_PAGESIZE)) && defined(_SC_PHYS_PAGES)
|
||||||
unsigned int siz = 0x7fffffff;
|
unsigned int siz = 0x7fffffff;
|
||||||
long scpagesiz, scphyspages;
|
long scpagesiz, scphyspages;
|
||||||
|
|
||||||
#ifdef _SC_PAGE_SIZE
|
#ifdef _SC_PAGE_SIZE
|
||||||
scpagesiz = sysconf(_SC_PAGE_SIZE);
|
scpagesiz = sysconf(_SC_PAGE_SIZE);
|
||||||
#else
|
#else
|
||||||
scpagesiz = sysconf(_SC_PAGESIZE);
|
scpagesiz = sysconf(_SC_PAGESIZE);
|
||||||
#endif
|
#endif
|
||||||
scphyspages = sysconf(_SC_PHYS_PAGES);
|
scphyspages = sysconf(_SC_PHYS_PAGES);
|
||||||
if (scpagesiz >= 0 && scphyspages >= 0)
|
if (scpagesiz >= 0 && scphyspages >= 0)
|
||||||
siz = (unsigned int)min(longlong(0x7fffffff), (int64)scpagesiz * (int64)scphyspages);
|
siz = (unsigned int)min(longlong(0x7fffffff), (int64)scpagesiz * (int64)scphyspages);
|
||||||
|
|
||||||
//initprintf("Bgetsysmemsize(): %d pages of %d bytes, %d bytes of system memory\n",
|
//initprintf("Bgetsysmemsize(): %d pages of %d bytes, %d bytes of system memory\n",
|
||||||
// scphyspages, scpagesiz, siz);
|
// scphyspages, scpagesiz, siz);
|
||||||
|
|
||||||
return siz;
|
return siz;
|
||||||
#else
|
#else
|
||||||
return 0x7fffffff;
|
return 0x7fffffff;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,45 +12,45 @@
|
||||||
#include "baselayer.h"
|
#include "baselayer.h"
|
||||||
|
|
||||||
static long vesares[13][2] = {{320,200},{360,200},{320,240},{360,240},{320,400},
|
static long vesares[13][2] = {{320,200},{360,200},{320,240},{360,240},{320,400},
|
||||||
{360,400},{640,350},{640,400},{640,480},{800,600},
|
{360,400},{640,350},{640,400},{640,480},{800,600},
|
||||||
{1024,768},{1280,1024},{1600,1200}};
|
{1024,768},{1280,1024},{1600,1200}};
|
||||||
|
|
||||||
static int readconfig(BFILE *fp, const char *key, char *value, unsigned len)
|
static int readconfig(BFILE *fp, const char *key, char *value, unsigned len)
|
||||||
{
|
{
|
||||||
char buf[1000], *k, *v, *eq;
|
char buf[1000], *k, *v, *eq;
|
||||||
int x=0;
|
int x=0;
|
||||||
|
|
||||||
if (len < 1) return 0;
|
if (len < 1) return 0;
|
||||||
|
|
||||||
Brewind(fp);
|
Brewind(fp);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (!Bfgets(buf, 1000, fp)) return 0;
|
if (!Bfgets(buf, 1000, fp)) return 0;
|
||||||
|
|
||||||
if (buf[0] == ';') continue;
|
if (buf[0] == ';') continue;
|
||||||
|
|
||||||
eq = Bstrchr(buf, '=');
|
eq = Bstrchr(buf, '=');
|
||||||
if (!eq) continue;
|
if (!eq) continue;
|
||||||
|
|
||||||
k = buf;
|
k = buf;
|
||||||
v = eq+1;
|
v = eq+1;
|
||||||
|
|
||||||
while (*k == ' ' || *k == '\t') k++;
|
while (*k == ' ' || *k == '\t') k++;
|
||||||
*(eq--) = 0;
|
*(eq--) = 0;
|
||||||
while ((*eq == ' ' || *eq == '\t') && eq>=k) *(eq--) = 0;
|
while ((*eq == ' ' || *eq == '\t') && eq>=k) *(eq--) = 0;
|
||||||
|
|
||||||
if (Bstrcasecmp(k, key)) continue;
|
if (Bstrcasecmp(k, key)) continue;
|
||||||
|
|
||||||
while (*v == ' ' || *k == '\t') v++;
|
while (*v == ' ' || *k == '\t') v++;
|
||||||
eq = v + Bstrlen(v)-1;
|
eq = v + Bstrlen(v)-1;
|
||||||
|
|
||||||
while ((*eq == ' ' || *eq == '\t' || *eq == '\r' || *eq == '\n') && eq>=v) *(eq--) = 0;
|
while ((*eq == ' ' || *eq == '\t' || *eq == '\r' || *eq == '\n') && eq>=v) *(eq--) = 0;
|
||||||
|
|
||||||
value[--len] = 0;
|
value[--len] = 0;
|
||||||
do value[x] = v[x]; while (v[x++] != 0 && len-- > 0);
|
do value[x] = v[x]; while (v[x++] != 0 && len-- > 0);
|
||||||
|
|
||||||
return x-1;
|
return x-1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern short brightness;
|
extern short brightness;
|
||||||
|
@ -99,35 +99,35 @@ extern double msens;
|
||||||
|
|
||||||
int loadsetup(const char *fn)
|
int loadsetup(const char *fn)
|
||||||
{
|
{
|
||||||
BFILE *fp;
|
BFILE *fp;
|
||||||
#define VL 32
|
#define VL 32
|
||||||
char val[VL];
|
char val[VL];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ((fp = Bfopen(fn, "rt")) == NULL) return -1;
|
if ((fp = Bfopen(fn, "rt")) == NULL) return -1;
|
||||||
|
|
||||||
if (readconfig(fp, "fullscreen", val, VL) > 0) { if (Batoi(val) != 0) fullscreen = 1; else fullscreen = 0; }
|
if (readconfig(fp, "fullscreen", val, VL) > 0) { if (Batoi(val) != 0) fullscreen = 1; else fullscreen = 0; }
|
||||||
if (readconfig(fp, "resolution", val, VL) > 0) {
|
if (readconfig(fp, "resolution", val, VL) > 0) {
|
||||||
i = Batoi(val) & 0x0f;
|
i = Batoi(val) & 0x0f;
|
||||||
if ((unsigned)i<13) { xdimgame = xdim2d = vesares[i][0]; ydimgame = ydim2d = vesares[i][1]; }
|
if ((unsigned)i<13) { xdimgame = xdim2d = vesares[i][0]; ydimgame = ydim2d = vesares[i][1]; }
|
||||||
}
|
}
|
||||||
if (readconfig(fp, "2dresolution", val, VL) > 0) {
|
if (readconfig(fp, "2dresolution", val, VL) > 0) {
|
||||||
i = Batoi(val) & 0x0f;
|
i = Batoi(val) & 0x0f;
|
||||||
if ((unsigned)i<13) { xdim2d = vesares[i][0]; ydim2d = vesares[i][1]; }
|
if ((unsigned)i<13) { xdim2d = vesares[i][0]; ydim2d = vesares[i][1]; }
|
||||||
}
|
}
|
||||||
if (readconfig(fp, "xdim2d", val, VL) > 0) xdim2d = Batoi(val);
|
if (readconfig(fp, "xdim2d", val, VL) > 0) xdim2d = Batoi(val);
|
||||||
if (readconfig(fp, "ydim2d", val, VL) > 0) ydim2d = Batoi(val);
|
if (readconfig(fp, "ydim2d", val, VL) > 0) ydim2d = Batoi(val);
|
||||||
if (readconfig(fp, "xdim3d", val, VL) > 0) xdimgame = Batoi(val);
|
if (readconfig(fp, "xdim3d", val, VL) > 0) xdimgame = Batoi(val);
|
||||||
if (readconfig(fp, "ydim3d", val, VL) > 0) ydimgame = Batoi(val);
|
if (readconfig(fp, "ydim3d", val, VL) > 0) ydimgame = Batoi(val);
|
||||||
if (readconfig(fp, "samplerate", val, VL) > 0) option[7] = (Batoi(val) & 0x0f) << 4;
|
if (readconfig(fp, "samplerate", val, VL) > 0) option[7] = (Batoi(val) & 0x0f) << 4;
|
||||||
if (readconfig(fp, "music", val, VL) > 0) { if (Batoi(val) != 0) option[2] = 1; else option[2] = 0; }
|
if (readconfig(fp, "music", val, VL) > 0) { if (Batoi(val) != 0) option[2] = 1; else option[2] = 0; }
|
||||||
if (readconfig(fp, "mouse", val, VL) > 0) { if (Batoi(val) != 0) option[3] = 1; else option[3] = 0; }
|
if (readconfig(fp, "mouse", val, VL) > 0) { if (Batoi(val) != 0) option[3] = 1; else option[3] = 0; }
|
||||||
if (readconfig(fp, "bpp", val, VL) > 0) bppgame = Batoi(val);
|
if (readconfig(fp, "bpp", val, VL) > 0) bppgame = Batoi(val);
|
||||||
if (readconfig(fp, "renderer", val, VL) > 0) { i = Batoi(val); setrendermode(i); }
|
if (readconfig(fp, "renderer", val, VL) > 0) { i = Batoi(val); setrendermode(i); }
|
||||||
if (readconfig(fp, "brightness", val, VL) > 0) brightness = min(max(Batoi(val),0),15);
|
if (readconfig(fp, "brightness", val, VL) > 0) brightness = min(max(Batoi(val),0),15);
|
||||||
|
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
if (readconfig(fp, "maxrefreshfreq", val, VL) > 0) maxrefreshfreq = Batoi(val);
|
if (readconfig(fp, "maxrefreshfreq", val, VL) > 0) maxrefreshfreq = Batoi(val);
|
||||||
#endif
|
#endif
|
||||||
glusetexcache = glusetexcachecompression = -1;
|
glusetexcache = glusetexcachecompression = -1;
|
||||||
if (readconfig(fp, "glusetexcache", val, VL) > 0) {
|
if (readconfig(fp, "glusetexcache", val, VL) > 0) {
|
||||||
|
@ -142,166 +142,166 @@ int loadsetup(const char *fn)
|
||||||
{
|
{
|
||||||
i=wm_ynbox("Texture caching",
|
i=wm_ynbox("Texture caching",
|
||||||
"Would you like to enable the on-disk texture cache? "
|
"Would you like to enable the on-disk texture cache? "
|
||||||
"This feature may use up to 200 megabytes of disk "
|
"This feature may use up to 200 megabytes of disk "
|
||||||
"space if you have a great deal of high resolution "
|
"space if you have a great deal of high resolution "
|
||||||
"textures and skins, but textures will load exponentially "
|
"textures and skins, but textures will load exponentially "
|
||||||
"faster after the first time they are loaded.");
|
"faster after the first time they are loaded.");
|
||||||
if (i) i = 'y';
|
if (i) i = 'y';
|
||||||
if(i == 'y' || i == 'Y' )
|
if(i == 'y' || i == 'Y' )
|
||||||
glusetexcompr = glusetexcache = glusetexcachecompression = 1;
|
glusetexcompr = glusetexcache = glusetexcachecompression = 1;
|
||||||
else glusetexcache = glusetexcachecompression = 0;
|
else glusetexcache = glusetexcachecompression = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
option[0] = 1; // vesa all the way...
|
option[0] = 1; // vesa all the way...
|
||||||
option[1] = 1; // sound all the way...
|
option[1] = 1; // sound all the way...
|
||||||
option[4] = 0; // no multiplayer
|
option[4] = 0; // no multiplayer
|
||||||
option[5] = 0;
|
option[5] = 0;
|
||||||
|
|
||||||
if (readconfig(fp, "keyforward", val, VL) > 0) keys[0] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keyforward", val, VL) > 0) keys[0] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keybackward", val, VL) > 0) keys[1] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keybackward", val, VL) > 0) keys[1] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keyturnleft", val, VL) > 0) keys[2] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keyturnleft", val, VL) > 0) keys[2] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keyturnright", val, VL) > 0) keys[3] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keyturnright", val, VL) > 0) keys[3] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keyrun", val, VL) > 0) keys[4] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keyrun", val, VL) > 0) keys[4] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keystrafe", val, VL) > 0) keys[5] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keystrafe", val, VL) > 0) keys[5] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keyfire", val, VL) > 0) keys[6] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keyfire", val, VL) > 0) keys[6] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keyuse", val, VL) > 0) keys[7] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keyuse", val, VL) > 0) keys[7] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keystandhigh", val, VL) > 0) keys[8] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keystandhigh", val, VL) > 0) keys[8] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keystandlow", val, VL) > 0) keys[9] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keystandlow", val, VL) > 0) keys[9] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keylookup", val, VL) > 0) keys[10] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keylookup", val, VL) > 0) keys[10] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keylookdown", val, VL) > 0) keys[11] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keylookdown", val, VL) > 0) keys[11] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keystrafeleft", val, VL) > 0) keys[12] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keystrafeleft", val, VL) > 0) keys[12] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keystraferight", val, VL) > 0) keys[13] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keystraferight", val, VL) > 0) keys[13] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "key2dmode", val, VL) > 0) keys[14] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "key2dmode", val, VL) > 0) keys[14] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keyviewcycle", val, VL) > 0) keys[15] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keyviewcycle", val, VL) > 0) keys[15] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "key2dzoomin", val, VL) > 0) keys[16] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "key2dzoomin", val, VL) > 0) keys[16] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "key2dzoomout", val, VL) > 0) keys[17] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "key2dzoomout", val, VL) > 0) keys[17] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keychat", val, VL) > 0) keys[18] = Bstrtol(val, NULL, 16);
|
if (readconfig(fp, "keychat", val, VL) > 0) keys[18] = Bstrtol(val, NULL, 16);
|
||||||
if (readconfig(fp, "keyconsole", val, VL) > 0) { keys[19] = Bstrtol(val, NULL, 16); OSD_CaptureKey(keys[19]); }
|
if (readconfig(fp, "keyconsole", val, VL) > 0) { keys[19] = Bstrtol(val, NULL, 16); OSD_CaptureKey(keys[19]); }
|
||||||
|
|
||||||
if (readconfig(fp, "mousesensitivity", val, VL) > 0) msens = Bstrtod(val, NULL);
|
if (readconfig(fp, "mousesensitivity", val, VL) > 0) msens = Bstrtod(val, NULL);
|
||||||
|
|
||||||
Bfclose(fp);
|
Bfclose(fp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int writesetup(const char *fn)
|
int writesetup(const char *fn)
|
||||||
{
|
{
|
||||||
BFILE *fp;
|
BFILE *fp;
|
||||||
|
|
||||||
fp = Bfopen(fn,"wt");
|
fp = Bfopen(fn,"wt");
|
||||||
if (!fp) return -1;
|
if (!fp) return -1;
|
||||||
|
|
||||||
Bfprintf(fp,
|
Bfprintf(fp,
|
||||||
"; Video mode selection\n"
|
"; Video mode selection\n"
|
||||||
"; 0 - Windowed\n"
|
"; 0 - Windowed\n"
|
||||||
"; 1 - Fullscreen\n"
|
"; 1 - Fullscreen\n"
|
||||||
"fullscreen = %ld\n"
|
"fullscreen = %ld\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Video resolution\n"
|
"; Video resolution\n"
|
||||||
"xdim2d = %ld\n"
|
"xdim2d = %ld\n"
|
||||||
"ydim2d = %ld\n"
|
"ydim2d = %ld\n"
|
||||||
"xdim3d = %ld\n"
|
"xdim3d = %ld\n"
|
||||||
"ydim3d = %ld\n"
|
"ydim3d = %ld\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; 3D-mode colour depth\n"
|
"; 3D-mode colour depth\n"
|
||||||
"bpp = %ld\n"
|
"bpp = %ld\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; OpenGL mode options\n"
|
"; OpenGL mode options\n"
|
||||||
"glusetexcache = %ld\n"
|
"glusetexcache = %ld\n"
|
||||||
"glusetexcachecompression = %ld\n"
|
"glusetexcachecompression = %ld\n"
|
||||||
"\n"
|
"\n"
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
"; Maximum OpenGL mode refresh rate (Windows only, in Hertz)\n"
|
"; Maximum OpenGL mode refresh rate (Windows only, in Hertz)\n"
|
||||||
"maxrefreshfreq = %d\n"
|
"maxrefreshfreq = %d\n"
|
||||||
"\n"
|
"\n"
|
||||||
#endif
|
#endif
|
||||||
"; 3D mode brightness setting\n"
|
"; 3D mode brightness setting\n"
|
||||||
"; 0 - lowest\n"
|
"; 0 - lowest\n"
|
||||||
"; 15 - highest\n"
|
"; 15 - highest\n"
|
||||||
"brightness = %d\n"
|
"brightness = %d\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Sound sample frequency\n"
|
"; Sound sample frequency\n"
|
||||||
"; 0 - 6 KHz\n"
|
"; 0 - 6 KHz\n"
|
||||||
"; 1 - 8 KHz\n"
|
"; 1 - 8 KHz\n"
|
||||||
"; 2 - 11.025 KHz\n"
|
"; 2 - 11.025 KHz\n"
|
||||||
"; 3 - 16 KHz\n"
|
"; 3 - 16 KHz\n"
|
||||||
"; 4 - 22.05 KHz\n"
|
"; 4 - 22.05 KHz\n"
|
||||||
"; 5 - 32 KHz\n"
|
"; 5 - 32 KHz\n"
|
||||||
"; 6 - 44.1 KHz\n"
|
"; 6 - 44.1 KHz\n"
|
||||||
"samplerate = %d\n"
|
"samplerate = %d\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Music playback\n"
|
"; Music playback\n"
|
||||||
"; 0 - Off\n"
|
"; 0 - Off\n"
|
||||||
"; 1 - On\n"
|
"; 1 - On\n"
|
||||||
"music = %d\n"
|
"music = %d\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Enable mouse\n"
|
"; Enable mouse\n"
|
||||||
"; 0 - No\n"
|
"; 0 - No\n"
|
||||||
"; 1 - Yes\n"
|
"; 1 - Yes\n"
|
||||||
"mouse = %d\n"
|
"mouse = %d\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Mouse sensitivity\n"
|
"; Mouse sensitivity\n"
|
||||||
"mousesensitivity = %g\n"
|
"mousesensitivity = %g\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Key Settings\n"
|
"; Key Settings\n"
|
||||||
"; Here's a map of all the keyboard scan codes: NOTE: values are listed in hex!\n"
|
"; Here's a map of all the keyboard scan codes: NOTE: values are listed in hex!\n"
|
||||||
"; +---------------------------------------------------------------------------------------------+\n"
|
"; +---------------------------------------------------------------------------------------------+\n"
|
||||||
"; | 01 3B 3C 3D 3E 3F 40 41 42 43 44 57 58 46 |\n"
|
"; | 01 3B 3C 3D 3E 3F 40 41 42 43 44 57 58 46 |\n"
|
||||||
"; |ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 SCROLL |\n"
|
"; |ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 SCROLL |\n"
|
||||||
"; | |\n"
|
"; | |\n"
|
||||||
"; |29 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E D2 C7 C9 45 B5 37 4A |\n"
|
"; |29 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E D2 C7 C9 45 B5 37 4A |\n"
|
||||||
"; | ` '1' '2' '3' '4' '5' '6' '7' '8' '9' '0' - = BACK INS HOME PGUP NUMLK KP/ KP* KP- |\n"
|
"; | ` '1' '2' '3' '4' '5' '6' '7' '8' '9' '0' - = BACK INS HOME PGUP NUMLK KP/ KP* KP- |\n"
|
||||||
"; | |\n"
|
"; | |\n"
|
||||||
"; | 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 2B D3 CF D1 47 48 49 4E |\n"
|
"; | 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 2B D3 CF D1 47 48 49 4E |\n"
|
||||||
"; |TAB Q W E R T Y U I O P [ ] \\ DEL END PGDN KP7 KP8 KP9 KP+ |\n"
|
"; |TAB Q W E R T Y U I O P [ ] \\ DEL END PGDN KP7 KP8 KP9 KP+ |\n"
|
||||||
"; | |\n"
|
"; | |\n"
|
||||||
"; | 3A 1E 1F 20 21 22 23 24 25 26 27 28 1C 4B 4C 4D |\n"
|
"; | 3A 1E 1F 20 21 22 23 24 25 26 27 28 1C 4B 4C 4D |\n"
|
||||||
"; |CAPS A S D F G H J K L ; ' ENTER KP4 KP5 KP6 9C |\n"
|
"; |CAPS A S D F G H J K L ; ' ENTER KP4 KP5 KP6 9C |\n"
|
||||||
"; | KPENTER|\n"
|
"; | KPENTER|\n"
|
||||||
"; | 2A 2C 2D 2E 2F 30 31 32 33 34 35 36 C8 4F 50 51 |\n"
|
"; | 2A 2C 2D 2E 2F 30 31 32 33 34 35 36 C8 4F 50 51 |\n"
|
||||||
"; |LSHIFT Z X C V B N M , . / RSHIFT UP KP1 KP2 KP3 |\n"
|
"; |LSHIFT Z X C V B N M , . / RSHIFT UP KP1 KP2 KP3 |\n"
|
||||||
"; | |\n"
|
"; | |\n"
|
||||||
"; | 1D 38 39 B8 9D CB D0 CD 52 53 |\n"
|
"; | 1D 38 39 B8 9D CB D0 CD 52 53 |\n"
|
||||||
"; |LCTRL LALT SPACE RALT RCTRL LEFT DOWN RIGHT KP0 KP. |\n"
|
"; |LCTRL LALT SPACE RALT RCTRL LEFT DOWN RIGHT KP0 KP. |\n"
|
||||||
"; +---------------------------------------------------------------------------------------------+\n"
|
"; +---------------------------------------------------------------------------------------------+\n"
|
||||||
"\n"
|
"\n"
|
||||||
"keyforward = %X\n"
|
"keyforward = %X\n"
|
||||||
"keybackward = %X\n"
|
"keybackward = %X\n"
|
||||||
"keyturnleft = %X\n"
|
"keyturnleft = %X\n"
|
||||||
"keyturnright = %X\n"
|
"keyturnright = %X\n"
|
||||||
"keyrun = %X\n"
|
"keyrun = %X\n"
|
||||||
"keystrafe = %X\n"
|
"keystrafe = %X\n"
|
||||||
"keyfire = %X\n"
|
"keyfire = %X\n"
|
||||||
"keyuse = %X\n"
|
"keyuse = %X\n"
|
||||||
"keystandhigh = %X\n"
|
"keystandhigh = %X\n"
|
||||||
"keystandlow = %X\n"
|
"keystandlow = %X\n"
|
||||||
"keylookup = %X\n"
|
"keylookup = %X\n"
|
||||||
"keylookdown = %X\n"
|
"keylookdown = %X\n"
|
||||||
"keystrafeleft = %X\n"
|
"keystrafeleft = %X\n"
|
||||||
"keystraferight = %X\n"
|
"keystraferight = %X\n"
|
||||||
"key2dmode = %X\n"
|
"key2dmode = %X\n"
|
||||||
"keyviewcycle = %X\n"
|
"keyviewcycle = %X\n"
|
||||||
"key2dzoomin = %X\n"
|
"key2dzoomin = %X\n"
|
||||||
"key2dzoomout = %X\n"
|
"key2dzoomout = %X\n"
|
||||||
"keychat = %X\n"
|
"keychat = %X\n"
|
||||||
"keyconsole = %X\n"
|
"keyconsole = %X\n"
|
||||||
"\n",
|
"\n",
|
||||||
|
|
||||||
fullscreen, xdim2d, ydim2d, xdimgame, ydimgame, bppgame,
|
fullscreen, xdim2d, ydim2d, xdimgame, ydimgame, bppgame,
|
||||||
glusetexcache, glusetexcachecompression,
|
glusetexcache, glusetexcachecompression,
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
maxrefreshfreq,
|
maxrefreshfreq,
|
||||||
#endif
|
#endif
|
||||||
brightness, option[7]>>4, option[2],
|
brightness, option[7]>>4, option[2],
|
||||||
option[3], msens,
|
option[3], msens,
|
||||||
keys[0], keys[1], keys[2], keys[3], keys[4], keys[5],
|
keys[0], keys[1], keys[2], keys[3], keys[4], keys[5],
|
||||||
keys[6], keys[7], keys[8], keys[9], keys[10], keys[11],
|
keys[6], keys[7], keys[8], keys[9], keys[10], keys[11],
|
||||||
keys[12], keys[13], keys[14], keys[15], keys[16], keys[17],
|
keys[12], keys[13], keys[14], keys[15], keys[16], keys[17],
|
||||||
keys[18], keys[19]
|
keys[18], keys[19]
|
||||||
);
|
);
|
||||||
|
|
||||||
Bfclose(fp);
|
Bfclose(fp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,43 +62,43 @@ static unsigned long crc32table[256];
|
||||||
|
|
||||||
void initcrc32table(void)
|
void initcrc32table(void)
|
||||||
{
|
{
|
||||||
unsigned long i,j,k;
|
unsigned long i,j,k;
|
||||||
|
|
||||||
// algorithm and polynomial same as that used by infozip's zip
|
// algorithm and polynomial same as that used by infozip's zip
|
||||||
for (i=0; i<256; i++) {
|
for (i=0; i<256; i++) {
|
||||||
j = i;
|
j = i;
|
||||||
for (k=8; k; k--)
|
for (k=8; k; k--)
|
||||||
j = (j&1) ? (0xedb88320L ^ (j>>1)) : (j>>1);
|
j = (j&1) ? (0xedb88320L ^ (j>>1)) : (j>>1);
|
||||||
crc32table[i] = j;
|
crc32table[i] = j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned long crc32once(unsigned char *blk, unsigned long len)
|
unsigned long crc32once(unsigned char *blk, unsigned long len)
|
||||||
{
|
{
|
||||||
unsigned long crc;
|
unsigned long crc;
|
||||||
|
|
||||||
crc32init(&crc);
|
crc32init(&crc);
|
||||||
crc32block(&crc, blk, len);
|
crc32block(&crc, blk, len);
|
||||||
return crc32finish(&crc);
|
return crc32finish(&crc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void crc32init(unsigned long *crcvar)
|
void crc32init(unsigned long *crcvar)
|
||||||
{
|
{
|
||||||
if (!crcvar) return;
|
if (!crcvar) return;
|
||||||
*crcvar = 0xffffffffl;
|
*crcvar = 0xffffffffl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void crc32block(unsigned long *crcvar, unsigned char *blk, unsigned long len)
|
void crc32block(unsigned long *crcvar, unsigned char *blk, unsigned long len)
|
||||||
{
|
{
|
||||||
unsigned long crc = *crcvar;
|
unsigned long crc = *crcvar;
|
||||||
while (len--) crc = crc32table[(crc ^ *(blk++)) & 0xffl] ^ (crc >> 8);
|
while (len--) crc = crc32table[(crc ^ *(blk++)) & 0xffl] ^ (crc >> 8);
|
||||||
*crcvar = crc;
|
*crcvar = crc;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long crc32finish(unsigned long *crcvar)
|
unsigned long crc32finish(unsigned long *crcvar)
|
||||||
{
|
{
|
||||||
*crcvar = *crcvar ^ 0xffffffffl;
|
*crcvar = *crcvar ^ 0xffffffffl;
|
||||||
return *crcvar;
|
return *crcvar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
10282
polymer/build/src/game.c
10282
polymer/build/src/game.c
File diff suppressed because it is too large
Load diff
|
@ -18,127 +18,127 @@
|
||||||
|
|
||||||
static void PopulateVideoModeLists(int fs, HWND list3d)
|
static void PopulateVideoModeLists(int fs, HWND list3d)
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
ComboBox_ResetContent(list3d);
|
ComboBox_ResetContent(list3d);
|
||||||
for (i=0; i<validmodecnt; i++) {
|
for (i=0; i<validmodecnt; i++) {
|
||||||
if (validmode[i].fs != fs) continue;
|
if (validmode[i].fs != fs) continue;
|
||||||
|
|
||||||
Bsprintf(buf, "%ldx%ld %dbpp", validmode[i].xdim, validmode[i].ydim, validmode[i].bpp);
|
Bsprintf(buf, "%ldx%ld %dbpp", validmode[i].xdim, validmode[i].ydim, validmode[i].bpp);
|
||||||
j = ComboBox_AddString(list3d, buf);
|
j = ComboBox_AddString(list3d, buf);
|
||||||
ComboBox_SetItemData(list3d, j, i);
|
ComboBox_SetItemData(list3d, j, i);
|
||||||
if (xdimgame == validmode[i].xdim && ydimgame == validmode[i].ydim && bppgame == validmode[i].bpp)
|
if (xdimgame == validmode[i].xdim && ydimgame == validmode[i].ydim && bppgame == validmode[i].bpp)
|
||||||
ComboBox_SetCurSel(list3d, j);
|
ComboBox_SetCurSel(list3d, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static INT_PTR CALLBACK LaunchWindowProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
static INT_PTR CALLBACK LaunchWindowProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch (uMsg) {
|
switch (uMsg) {
|
||||||
case WM_INITDIALOG: {
|
case WM_INITDIALOG: {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
if (lParam) {
|
if (lParam) {
|
||||||
long *saferect = (long*)lParam;
|
long *saferect = (long*)lParam;
|
||||||
RECT unresized, playbutton, exitbutton;
|
RECT unresized, playbutton, exitbutton;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
|
|
||||||
GetWindowRect(hwndDlg, &unresized);
|
GetWindowRect(hwndDlg, &unresized);
|
||||||
GetWindowRect(GetDlgItem(hwndDlg, IDOK), &playbutton);
|
GetWindowRect(GetDlgItem(hwndDlg, IDOK), &playbutton);
|
||||||
GetWindowRect(GetDlgItem(hwndDlg, IDCANCEL), &exitbutton);
|
GetWindowRect(GetDlgItem(hwndDlg, IDCANCEL), &exitbutton);
|
||||||
|
|
||||||
playbutton.right = 1 + playbutton.right - playbutton.left;
|
playbutton.right = 1 + playbutton.right - playbutton.left;
|
||||||
playbutton.bottom = 1 + playbutton.bottom - playbutton.top;
|
playbutton.bottom = 1 + playbutton.bottom - playbutton.top;
|
||||||
exitbutton.right = 1 + exitbutton.right - exitbutton.left;
|
exitbutton.right = 1 + exitbutton.right - exitbutton.left;
|
||||||
exitbutton.bottom = 1 + exitbutton.bottom - exitbutton.top;
|
exitbutton.bottom = 1 + exitbutton.bottom - exitbutton.top;
|
||||||
|
|
||||||
playbutton.left = playbutton.left - unresized.left;
|
playbutton.left = playbutton.left - unresized.left;
|
||||||
playbutton.top = playbutton.top - unresized.top;
|
playbutton.top = playbutton.top - unresized.top;
|
||||||
exitbutton.left = exitbutton.left - unresized.left;
|
exitbutton.left = exitbutton.left - unresized.left;
|
||||||
exitbutton.top = exitbutton.top - unresized.top;
|
exitbutton.top = exitbutton.top - unresized.top;
|
||||||
|
|
||||||
dx = saferect[2] - (unresized.right - unresized.left);
|
dx = saferect[2] - (unresized.right - unresized.left);
|
||||||
dy = saferect[3] - (unresized.bottom - unresized.top);
|
dy = saferect[3] - (unresized.bottom - unresized.top);
|
||||||
|
|
||||||
playbutton.left += dx; exitbutton.left += dx;
|
playbutton.left += dx; exitbutton.left += dx;
|
||||||
playbutton.top += dy; exitbutton.top += dy;
|
playbutton.top += dy; exitbutton.top += dy;
|
||||||
|
|
||||||
// reposition the dialog, play and exit buttons
|
// reposition the dialog, play and exit buttons
|
||||||
MoveWindow(hwndDlg, saferect[0], saferect[1], saferect[2], saferect[3], FALSE);
|
MoveWindow(hwndDlg, saferect[0], saferect[1], saferect[2], saferect[3], FALSE);
|
||||||
MoveWindow(GetDlgItem(hwndDlg, IDOK),
|
MoveWindow(GetDlgItem(hwndDlg, IDOK),
|
||||||
playbutton.left, playbutton.top, playbutton.right, playbutton.bottom, FALSE);
|
playbutton.left, playbutton.top, playbutton.right, playbutton.bottom, FALSE);
|
||||||
MoveWindow(GetDlgItem(hwndDlg, IDCANCEL),
|
MoveWindow(GetDlgItem(hwndDlg, IDCANCEL),
|
||||||
exitbutton.left, exitbutton.top, exitbutton.right, exitbutton.bottom, FALSE);
|
exitbutton.left, exitbutton.top, exitbutton.right, exitbutton.bottom, FALSE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// populate the controls
|
// populate the controls
|
||||||
Button_SetCheck(GetDlgItem(hwndDlg, IDCFULLSCREEN), fullscreen ? BST_CHECKED : BST_UNCHECKED);
|
Button_SetCheck(GetDlgItem(hwndDlg, IDCFULLSCREEN), fullscreen ? BST_CHECKED : BST_UNCHECKED);
|
||||||
PopulateVideoModeLists(fullscreen, GetDlgItem(hwndDlg, IDCVMODE));
|
PopulateVideoModeLists(fullscreen, GetDlgItem(hwndDlg, IDCVMODE));
|
||||||
|
|
||||||
ShowWindow(hwndDlg, SW_SHOW);
|
ShowWindow(hwndDlg, SW_SHOW);
|
||||||
if (GetDlgCtrlID((HWND)wParam) != IDOK) {
|
if (GetDlgCtrlID((HWND)wParam) != IDOK) {
|
||||||
SetFocus(GetDlgItem(hwndDlg, IDOK));
|
SetFocus(GetDlgItem(hwndDlg, IDOK));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
switch (LOWORD(wParam)) {
|
switch (LOWORD(wParam)) {
|
||||||
case IDCFULLSCREEN:
|
case IDCFULLSCREEN:
|
||||||
fullscreen = Button_GetCheck((HWND)lParam) == BST_CHECKED ? 1:0;
|
fullscreen = Button_GetCheck((HWND)lParam) == BST_CHECKED ? 1:0;
|
||||||
PopulateVideoModeLists(fullscreen, GetDlgItem(hwndDlg, IDCVMODE));
|
PopulateVideoModeLists(fullscreen, GetDlgItem(hwndDlg, IDCVMODE));
|
||||||
break;
|
break;
|
||||||
case IDCVMODE:
|
case IDCVMODE:
|
||||||
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
||||||
int i;
|
int i;
|
||||||
i = ComboBox_GetCurSel((HWND)lParam);
|
i = ComboBox_GetCurSel((HWND)lParam);
|
||||||
if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
|
if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
|
||||||
if (i != CB_ERR) {
|
if (i != CB_ERR) {
|
||||||
xdimgame = validmode[i].xdim;
|
xdimgame = validmode[i].xdim;
|
||||||
ydimgame = validmode[i].ydim;
|
ydimgame = validmode[i].ydim;
|
||||||
bppgame = validmode[i].bpp;
|
bppgame = validmode[i].bpp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IDCANCEL:
|
case IDCANCEL:
|
||||||
quitevent = 1; // fall through
|
quitevent = 1; // fall through
|
||||||
case IDOK:
|
case IDOK:
|
||||||
DestroyWindow(hwndDlg);
|
DestroyWindow(hwndDlg);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoLaunchWindow(int initval)
|
int DoLaunchWindow(int initval)
|
||||||
{
|
{
|
||||||
HWND hwndStart, hwndLaunch;
|
HWND hwndStart, hwndLaunch;
|
||||||
MSG msg;
|
MSG msg;
|
||||||
long saferect[4];
|
long saferect[4];
|
||||||
|
|
||||||
// only show config window if no config is loaded, or if it is, only if left control is held
|
// only show config window if no config is loaded, or if it is, only if left control is held
|
||||||
if (initval == 0 && !GetAsyncKeyState(VK_CONTROL)) return 0;
|
if (initval == 0 && !GetAsyncKeyState(VK_CONTROL)) return 0;
|
||||||
|
|
||||||
if (win_getstartupwin((long*)&hwndStart, saferect, NULL)) return 0;
|
if (win_getstartupwin((long*)&hwndStart, saferect, NULL)) return 0;
|
||||||
|
|
||||||
hwndLaunch = CreateDialogParam((HINSTANCE)win_gethinstance(), MAKEINTRESOURCE(2000), hwndStart, LaunchWindowProc, (LPARAM)saferect);
|
hwndLaunch = CreateDialogParam((HINSTANCE)win_gethinstance(), MAKEINTRESOURCE(2000), hwndStart, LaunchWindowProc, (LPARAM)saferect);
|
||||||
if (hwndLaunch) {
|
if (hwndLaunch) {
|
||||||
EnableWindow(GetDlgItem(hwndStart,WIN_STARTWIN_ITEMLIST),FALSE);
|
EnableWindow(GetDlgItem(hwndStart,WIN_STARTWIN_ITEMLIST),FALSE);
|
||||||
while (GetMessage(&msg, NULL, 0, 0) > 0) {
|
while (GetMessage(&msg, NULL, 0, 0) > 0) {
|
||||||
if (!IsWindow(hwndLaunch) || quitevent) break;
|
if (!IsWindow(hwndLaunch) || quitevent) break;
|
||||||
if (IsDialogMessage(hwndStart, &msg) /*|| IsDialogMessage(hwndLaunch, &msg)*/) continue;
|
if (IsDialogMessage(hwndStart, &msg) /*|| IsDialogMessage(hwndLaunch, &msg)*/) continue;
|
||||||
|
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
EnableWindow(GetDlgItem(hwndStart,WIN_STARTWIN_ITEMLIST),TRUE);
|
EnableWindow(GetDlgItem(hwndStart,WIN_STARTWIN_ITEMLIST),TRUE);
|
||||||
}
|
}
|
||||||
if (quitevent) return 1;
|
if (quitevent) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,20 +101,20 @@ char *gldriver = NULL;
|
||||||
|
|
||||||
static void * getproc_(const char *s, int *err, int fatal, int extension)
|
static void * getproc_(const char *s, int *err, int fatal, int extension)
|
||||||
{
|
{
|
||||||
void *t;
|
void *t;
|
||||||
#if defined RENDERTYPESDL
|
#if defined RENDERTYPESDL
|
||||||
t = (void*)SDL_GL_GetProcAddress(s);
|
t = (void*)SDL_GL_GetProcAddress(s);
|
||||||
#elif defined _WIN32
|
#elif defined _WIN32
|
||||||
if (extension) t = (void*)bwglGetProcAddress(s);
|
if (extension) t = (void*)bwglGetProcAddress(s);
|
||||||
else t = (void*)GetProcAddress(hGLDLL,s);
|
else t = (void*)GetProcAddress(hGLDLL,s);
|
||||||
#else
|
#else
|
||||||
#error Need a dynamic loader for this platform...
|
#error Need a dynamic loader for this platform...
|
||||||
#endif
|
#endif
|
||||||
if (!t && fatal) {
|
if (!t && fatal) {
|
||||||
initprintf("Failed to find %s in %s\n", s, gldriver);
|
initprintf("Failed to find %s in %s\n", s, gldriver);
|
||||||
*err = 1;
|
*err = 1;
|
||||||
}
|
}
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
#define GETPROC(s) getproc_(s,&err,1,0)
|
#define GETPROC(s) getproc_(s,&err,1,0)
|
||||||
#define GETPROCSOFT(s) getproc_(s,&err,0,0)
|
#define GETPROCSOFT(s) getproc_(s,&err,0,0)
|
||||||
|
@ -123,229 +123,229 @@ static void * getproc_(const char *s, int *err, int fatal, int extension)
|
||||||
|
|
||||||
int loadgldriver(const char *driver)
|
int loadgldriver(const char *driver)
|
||||||
{
|
{
|
||||||
void *t;
|
void *t;
|
||||||
int err=0;
|
int err=0;
|
||||||
|
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
if (hGLDLL) return 0;
|
if (hGLDLL) return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!driver) {
|
if (!driver) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
driver = "OPENGL32.DLL";
|
driver = "OPENGL32.DLL";
|
||||||
#else
|
#else
|
||||||
driver = "libGL.so";
|
driver = "libGL.so";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
initprintf("Loading %s\n",driver);
|
initprintf("Loading %s\n",driver);
|
||||||
|
|
||||||
#if defined RENDERTYPESDL
|
#if defined RENDERTYPESDL
|
||||||
if (SDL_GL_LoadLibrary(driver)) return -1;
|
if (SDL_GL_LoadLibrary(driver)) return -1;
|
||||||
#elif defined _WIN32
|
#elif defined _WIN32
|
||||||
hGLDLL = LoadLibrary(driver);
|
hGLDLL = LoadLibrary(driver);
|
||||||
if (!hGLDLL) return -1;
|
if (!hGLDLL) return -1;
|
||||||
#endif
|
#endif
|
||||||
gldriver = strdup(driver);
|
gldriver = strdup(driver);
|
||||||
|
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
bwglCreateContext = GETPROC("wglCreateContext");
|
bwglCreateContext = GETPROC("wglCreateContext");
|
||||||
bwglDeleteContext = GETPROC("wglDeleteContext");
|
bwglDeleteContext = GETPROC("wglDeleteContext");
|
||||||
bwglGetProcAddress = GETPROC("wglGetProcAddress");
|
bwglGetProcAddress = GETPROC("wglGetProcAddress");
|
||||||
bwglMakeCurrent = GETPROC("wglMakeCurrent");
|
bwglMakeCurrent = GETPROC("wglMakeCurrent");
|
||||||
|
|
||||||
bwglSwapBuffers = GETPROC("wglSwapBuffers");
|
bwglSwapBuffers = GETPROC("wglSwapBuffers");
|
||||||
bwglChoosePixelFormat = GETPROC("wglChoosePixelFormat");
|
bwglChoosePixelFormat = GETPROC("wglChoosePixelFormat");
|
||||||
bwglDescribePixelFormat = GETPROC("wglDescribePixelFormat");
|
bwglDescribePixelFormat = GETPROC("wglDescribePixelFormat");
|
||||||
bwglGetPixelFormat = GETPROC("wglGetPixelFormat");
|
bwglGetPixelFormat = GETPROC("wglGetPixelFormat");
|
||||||
bwglSetPixelFormat = GETPROC("wglSetPixelFormat");
|
bwglSetPixelFormat = GETPROC("wglSetPixelFormat");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bglClearColor = GETPROC("glClearColor");
|
bglClearColor = GETPROC("glClearColor");
|
||||||
bglClear = GETPROC("glClear");
|
bglClear = GETPROC("glClear");
|
||||||
bglColorMask = GETPROC("glColorMask");
|
bglColorMask = GETPROC("glColorMask");
|
||||||
bglAlphaFunc = GETPROC("glAlphaFunc");
|
bglAlphaFunc = GETPROC("glAlphaFunc");
|
||||||
bglBlendFunc = GETPROC("glBlendFunc");
|
bglBlendFunc = GETPROC("glBlendFunc");
|
||||||
bglCullFace = GETPROC("glCullFace");
|
bglCullFace = GETPROC("glCullFace");
|
||||||
bglFrontFace = GETPROC("glFrontFace");
|
bglFrontFace = GETPROC("glFrontFace");
|
||||||
bglPolygonOffset = GETPROC("glPolygonOffset");
|
bglPolygonOffset = GETPROC("glPolygonOffset");
|
||||||
bglPolygonMode = GETPROC("glPolygonMode");
|
bglPolygonMode = GETPROC("glPolygonMode");
|
||||||
bglEnable = GETPROC("glEnable");
|
bglEnable = GETPROC("glEnable");
|
||||||
bglDisable = GETPROC("glDisable");
|
bglDisable = GETPROC("glDisable");
|
||||||
bglGetFloatv = GETPROC("glGetFloatv");
|
bglGetFloatv = GETPROC("glGetFloatv");
|
||||||
bglGetIntegerv = GETPROC("glGetIntegerv");
|
bglGetIntegerv = GETPROC("glGetIntegerv");
|
||||||
bglPushAttrib = GETPROC("glPushAttrib");
|
bglPushAttrib = GETPROC("glPushAttrib");
|
||||||
bglPopAttrib = GETPROC("glPopAttrib");
|
bglPopAttrib = GETPROC("glPopAttrib");
|
||||||
bglGetError = GETPROC("glGetError");
|
bglGetError = GETPROC("glGetError");
|
||||||
bglGetString = GETPROC("glGetString");
|
bglGetString = GETPROC("glGetString");
|
||||||
bglHint = GETPROC("glHint");
|
bglHint = GETPROC("glHint");
|
||||||
|
|
||||||
// Depth
|
// Depth
|
||||||
bglDepthFunc = GETPROC("glDepthFunc");
|
bglDepthFunc = GETPROC("glDepthFunc");
|
||||||
bglDepthMask = GETPROC("glDepthMask");
|
bglDepthMask = GETPROC("glDepthMask");
|
||||||
bglDepthRange = GETPROC("glDepthRange");
|
bglDepthRange = GETPROC("glDepthRange");
|
||||||
|
|
||||||
// Matrix
|
// Matrix
|
||||||
bglMatrixMode = GETPROC("glMatrixMode");
|
bglMatrixMode = GETPROC("glMatrixMode");
|
||||||
bglOrtho = GETPROC("glOrtho");
|
bglOrtho = GETPROC("glOrtho");
|
||||||
bglFrustum = GETPROC("glFrustum");
|
bglFrustum = GETPROC("glFrustum");
|
||||||
bglViewport = GETPROC("glViewport");
|
bglViewport = GETPROC("glViewport");
|
||||||
bglPushMatrix = GETPROC("glPushMatrix");
|
bglPushMatrix = GETPROC("glPushMatrix");
|
||||||
bglPopMatrix = GETPROC("glPopMatrix");
|
bglPopMatrix = GETPROC("glPopMatrix");
|
||||||
bglLoadIdentity = GETPROC("glLoadIdentity");
|
bglLoadIdentity = GETPROC("glLoadIdentity");
|
||||||
bglLoadMatrixf = GETPROC("glLoadMatrixf");
|
bglLoadMatrixf = GETPROC("glLoadMatrixf");
|
||||||
|
|
||||||
// Drawing
|
// Drawing
|
||||||
bglBegin = GETPROC("glBegin");
|
bglBegin = GETPROC("glBegin");
|
||||||
bglEnd = GETPROC("glEnd");
|
bglEnd = GETPROC("glEnd");
|
||||||
bglVertex2f = GETPROC("glVertex2f");
|
bglVertex2f = GETPROC("glVertex2f");
|
||||||
bglVertex2i = GETPROC("glVertex2i");
|
bglVertex2i = GETPROC("glVertex2i");
|
||||||
bglVertex3d = GETPROC("glVertex3d");
|
bglVertex3d = GETPROC("glVertex3d");
|
||||||
bglVertex3fv = GETPROC("glVertex3fv");
|
bglVertex3fv = GETPROC("glVertex3fv");
|
||||||
bglColor4f = GETPROC("glColor4f");
|
bglColor4f = GETPROC("glColor4f");
|
||||||
bglColor4ub = GETPROC("glColor4ub");
|
bglColor4ub = GETPROC("glColor4ub");
|
||||||
bglTexCoord2d = GETPROC("glTexCoord2d");
|
bglTexCoord2d = GETPROC("glTexCoord2d");
|
||||||
bglTexCoord2f = GETPROC("glTexCoord2f");
|
bglTexCoord2f = GETPROC("glTexCoord2f");
|
||||||
|
|
||||||
// Lighting
|
// Lighting
|
||||||
bglShadeModel = GETPROC("glShadeModel");
|
bglShadeModel = GETPROC("glShadeModel");
|
||||||
|
|
||||||
// Raster funcs
|
// Raster funcs
|
||||||
bglReadPixels = GETPROC("glReadPixels");
|
bglReadPixels = GETPROC("glReadPixels");
|
||||||
|
|
||||||
// Texture mapping
|
// Texture mapping
|
||||||
bglTexEnvf = GETPROC("glTexEnvf");
|
bglTexEnvf = GETPROC("glTexEnvf");
|
||||||
bglGenTextures = GETPROC("glGenTextures");
|
bglGenTextures = GETPROC("glGenTextures");
|
||||||
bglDeleteTextures = GETPROC("glDeleteTextures");
|
bglDeleteTextures = GETPROC("glDeleteTextures");
|
||||||
bglBindTexture = GETPROC("glBindTexture");
|
bglBindTexture = GETPROC("glBindTexture");
|
||||||
bglTexImage2D = GETPROC("glTexImage2D");
|
bglTexImage2D = GETPROC("glTexImage2D");
|
||||||
bglTexSubImage2D = GETPROC("glTexSubImage2D");
|
bglTexSubImage2D = GETPROC("glTexSubImage2D");
|
||||||
bglTexParameterf = GETPROC("glTexParameterf");
|
bglTexParameterf = GETPROC("glTexParameterf");
|
||||||
bglTexParameteri = GETPROC("glTexParameteri");
|
bglTexParameteri = GETPROC("glTexParameteri");
|
||||||
bglGetTexLevelParameteriv = GETPROC("glGetTexLevelParameteriv");
|
bglGetTexLevelParameteriv = GETPROC("glGetTexLevelParameteriv");
|
||||||
|
|
||||||
// Fog
|
// Fog
|
||||||
bglFogf = GETPROC("glFogf");
|
bglFogf = GETPROC("glFogf");
|
||||||
bglFogi = GETPROC("glFogi");
|
bglFogi = GETPROC("glFogi");
|
||||||
bglFogfv = GETPROC("glFogfv");
|
bglFogfv = GETPROC("glFogfv");
|
||||||
|
|
||||||
loadglextensions();
|
loadglextensions();
|
||||||
|
|
||||||
if (err) unloadgldriver();
|
if (err) unloadgldriver();
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int loadglextensions(void)
|
int loadglextensions(void)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
if (!hGLDLL) return 0;
|
if (!hGLDLL) return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bglCompressedTexImage2DARB = GETPROCEXTSOFT("glCompressedTexImage2DARB");
|
bglCompressedTexImage2DARB = GETPROCEXTSOFT("glCompressedTexImage2DARB");
|
||||||
bglGetCompressedTexImageARB = GETPROCEXTSOFT("glGetCompressedTexImageARB");
|
bglGetCompressedTexImageARB = GETPROCEXTSOFT("glGetCompressedTexImageARB");
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int unloadgldriver(void)
|
int unloadgldriver(void)
|
||||||
{
|
{
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
if (!hGLDLL) return 0;
|
if (!hGLDLL) return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
free(gldriver);
|
free(gldriver);
|
||||||
gldriver = NULL;
|
gldriver = NULL;
|
||||||
|
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
FreeLibrary(hGLDLL);
|
FreeLibrary(hGLDLL);
|
||||||
hGLDLL = NULL;
|
hGLDLL = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bglClearColor = NULL;
|
bglClearColor = NULL;
|
||||||
bglClear = NULL;
|
bglClear = NULL;
|
||||||
bglColorMask = NULL;
|
bglColorMask = NULL;
|
||||||
bglAlphaFunc = NULL;
|
bglAlphaFunc = NULL;
|
||||||
bglBlendFunc = NULL;
|
bglBlendFunc = NULL;
|
||||||
bglCullFace = NULL;
|
bglCullFace = NULL;
|
||||||
bglFrontFace = NULL;
|
bglFrontFace = NULL;
|
||||||
bglPolygonOffset = NULL;
|
bglPolygonOffset = NULL;
|
||||||
bglPolygonMode = NULL;
|
bglPolygonMode = NULL;
|
||||||
bglEnable = NULL;
|
bglEnable = NULL;
|
||||||
bglDisable = NULL;
|
bglDisable = NULL;
|
||||||
bglGetFloatv = NULL;
|
bglGetFloatv = NULL;
|
||||||
bglGetIntegerv = NULL;
|
bglGetIntegerv = NULL;
|
||||||
bglPushAttrib = NULL;
|
bglPushAttrib = NULL;
|
||||||
bglPopAttrib = NULL;
|
bglPopAttrib = NULL;
|
||||||
bglGetError = NULL;
|
bglGetError = NULL;
|
||||||
bglGetString = NULL;
|
bglGetString = NULL;
|
||||||
bglHint = NULL;
|
bglHint = NULL;
|
||||||
|
|
||||||
// Depth
|
// Depth
|
||||||
bglDepthFunc = NULL;
|
bglDepthFunc = NULL;
|
||||||
bglDepthMask = NULL;
|
bglDepthMask = NULL;
|
||||||
bglDepthRange = NULL;
|
bglDepthRange = NULL;
|
||||||
|
|
||||||
// Matrix
|
// Matrix
|
||||||
bglMatrixMode = NULL;
|
bglMatrixMode = NULL;
|
||||||
bglOrtho = NULL;
|
bglOrtho = NULL;
|
||||||
bglFrustum = NULL;
|
bglFrustum = NULL;
|
||||||
bglViewport = NULL;
|
bglViewport = NULL;
|
||||||
bglPushMatrix = NULL;
|
bglPushMatrix = NULL;
|
||||||
bglPopMatrix = NULL;
|
bglPopMatrix = NULL;
|
||||||
bglLoadIdentity = NULL;
|
bglLoadIdentity = NULL;
|
||||||
bglLoadMatrixf = NULL;
|
bglLoadMatrixf = NULL;
|
||||||
|
|
||||||
// Drawing
|
// Drawing
|
||||||
bglBegin = NULL;
|
bglBegin = NULL;
|
||||||
bglEnd = NULL;
|
bglEnd = NULL;
|
||||||
bglVertex2f = NULL;
|
bglVertex2f = NULL;
|
||||||
bglVertex2i = NULL;
|
bglVertex2i = NULL;
|
||||||
bglVertex3d = NULL;
|
bglVertex3d = NULL;
|
||||||
bglVertex3fv = NULL;
|
bglVertex3fv = NULL;
|
||||||
bglColor4f = NULL;
|
bglColor4f = NULL;
|
||||||
bglColor4ub = NULL;
|
bglColor4ub = NULL;
|
||||||
bglTexCoord2d = NULL;
|
bglTexCoord2d = NULL;
|
||||||
bglTexCoord2f = NULL;
|
bglTexCoord2f = NULL;
|
||||||
|
|
||||||
// Lighting
|
// Lighting
|
||||||
bglShadeModel = NULL;
|
bglShadeModel = NULL;
|
||||||
|
|
||||||
// Raster funcs
|
// Raster funcs
|
||||||
bglReadPixels = NULL;
|
bglReadPixels = NULL;
|
||||||
|
|
||||||
// Texture mapping
|
// Texture mapping
|
||||||
bglTexEnvf = NULL;
|
bglTexEnvf = NULL;
|
||||||
bglGenTextures = NULL;
|
bglGenTextures = NULL;
|
||||||
bglDeleteTextures = NULL;
|
bglDeleteTextures = NULL;
|
||||||
bglBindTexture = NULL;
|
bglBindTexture = NULL;
|
||||||
bglTexImage2D = NULL;
|
bglTexImage2D = NULL;
|
||||||
bglTexSubImage2D = NULL;
|
bglTexSubImage2D = NULL;
|
||||||
bglTexParameterf = NULL;
|
bglTexParameterf = NULL;
|
||||||
bglTexParameteri = NULL;
|
bglTexParameteri = NULL;
|
||||||
bglGetTexLevelParameteriv = NULL;
|
bglGetTexLevelParameteriv = NULL;
|
||||||
bglCompressedTexImage2DARB = NULL;
|
bglCompressedTexImage2DARB = NULL;
|
||||||
bglGetCompressedTexImageARB = NULL;
|
bglGetCompressedTexImageARB = NULL;
|
||||||
|
|
||||||
// Fog
|
// Fog
|
||||||
bglFogf = NULL;
|
bglFogf = NULL;
|
||||||
bglFogi = NULL;
|
bglFogi = NULL;
|
||||||
bglFogfv = NULL;
|
bglFogfv = NULL;
|
||||||
|
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
bwglCreateContext = NULL;
|
bwglCreateContext = NULL;
|
||||||
bwglDeleteContext = NULL;
|
bwglDeleteContext = NULL;
|
||||||
bwglGetProcAddress = NULL;
|
bwglGetProcAddress = NULL;
|
||||||
bwglMakeCurrent = NULL;
|
bwglMakeCurrent = NULL;
|
||||||
|
|
||||||
bwglSwapBuffers = NULL;
|
bwglSwapBuffers = NULL;
|
||||||
bwglChoosePixelFormat = NULL;
|
bwglChoosePixelFormat = NULL;
|
||||||
bwglDescribePixelFormat = NULL;
|
bwglDescribePixelFormat = NULL;
|
||||||
bwglGetPixelFormat = NULL;
|
bwglGetPixelFormat = NULL;
|
||||||
bwglSetPixelFormat = NULL;
|
bwglSetPixelFormat = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -31,182 +31,182 @@ static GdkPixbuf *appicon = NULL;
|
||||||
|
|
||||||
static gboolean on_startwin_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data)
|
static gboolean on_startwin_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data)
|
||||||
{
|
{
|
||||||
quitevent++;
|
quitevent++;
|
||||||
return TRUE; // FALSE would let the event go through. we want the game to decide when to close
|
return TRUE; // FALSE would let the event go through. we want the game to decide when to close
|
||||||
}
|
}
|
||||||
|
|
||||||
void gtkbuild_create_startwin(void)
|
void gtkbuild_create_startwin(void)
|
||||||
{
|
{
|
||||||
GtkWidget *banner, *label, *content, *scroll;
|
GtkWidget *banner, *label, *content, *scroll;
|
||||||
GtkWidget *hbox1, *fixed1;
|
GtkWidget *hbox1, *fixed1;
|
||||||
GdkPixbuf *startbanner_pixbuf;
|
GdkPixbuf *startbanner_pixbuf;
|
||||||
|
|
||||||
if (!gtkenabled) return;
|
if (!gtkenabled) return;
|
||||||
|
|
||||||
startwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
startwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||||
gtk_window_set_title (GTK_WINDOW (startwin), apptitle);
|
gtk_window_set_title (GTK_WINDOW (startwin), apptitle);
|
||||||
gtk_window_set_position (GTK_WINDOW (startwin), GTK_WIN_POS_CENTER);
|
gtk_window_set_position (GTK_WINDOW (startwin), GTK_WIN_POS_CENTER);
|
||||||
gtk_window_set_resizable (GTK_WINDOW (startwin), FALSE);
|
gtk_window_set_resizable (GTK_WINDOW (startwin), FALSE);
|
||||||
gtk_window_set_type_hint (GTK_WINDOW (startwin), GDK_WINDOW_TYPE_HINT_DIALOG);
|
gtk_window_set_type_hint (GTK_WINDOW (startwin), GDK_WINDOW_TYPE_HINT_DIALOG);
|
||||||
|
|
||||||
hbox1 = gtk_hbox_new (FALSE, 0);
|
hbox1 = gtk_hbox_new (FALSE, 0);
|
||||||
gtk_widget_show (hbox1);
|
gtk_widget_show (hbox1);
|
||||||
gtk_container_add (GTK_CONTAINER (startwin), hbox1);
|
gtk_container_add (GTK_CONTAINER (startwin), hbox1);
|
||||||
|
|
||||||
startbanner_pixbuf = gdk_pixbuf_from_pixdata(&startbanner_pixdata, FALSE, NULL);
|
startbanner_pixbuf = gdk_pixbuf_from_pixdata(&startbanner_pixdata, FALSE, NULL);
|
||||||
banner = gtk_image_new_from_pixbuf(startbanner_pixbuf);
|
banner = gtk_image_new_from_pixbuf(startbanner_pixbuf);
|
||||||
g_object_unref((gpointer)startbanner_pixbuf);
|
g_object_unref((gpointer)startbanner_pixbuf);
|
||||||
gtk_widget_show (banner);
|
gtk_widget_show (banner);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox1), banner, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox1), banner, FALSE, FALSE, 0);
|
||||||
|
|
||||||
fixed1 = gtk_fixed_new ();
|
fixed1 = gtk_fixed_new ();
|
||||||
gtk_widget_show (fixed1);
|
gtk_widget_show (fixed1);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox1), fixed1, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox1), fixed1, TRUE, TRUE, 0);
|
||||||
gtk_widget_set_size_request (fixed1, 390, -1);
|
gtk_widget_set_size_request (fixed1, 390, -1);
|
||||||
|
|
||||||
label = gtk_label_new (startwin_labeltext);
|
label = gtk_label_new (startwin_labeltext);
|
||||||
gtk_widget_show (label);
|
gtk_widget_show (label);
|
||||||
gtk_fixed_put (GTK_FIXED (fixed1), label, 6, 6);
|
gtk_fixed_put (GTK_FIXED (fixed1), label, 6, 6);
|
||||||
gtk_widget_set_size_request (label, 378, 16);
|
gtk_widget_set_size_request (label, 378, 16);
|
||||||
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER);
|
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER);
|
||||||
|
|
||||||
scroll = gtk_scrolled_window_new (NULL, NULL);
|
scroll = gtk_scrolled_window_new (NULL, NULL);
|
||||||
gtk_widget_show (scroll);
|
gtk_widget_show (scroll);
|
||||||
gtk_fixed_put (GTK_FIXED (fixed1), scroll, 6, 28);
|
gtk_fixed_put (GTK_FIXED (fixed1), scroll, 6, 28);
|
||||||
gtk_widget_set_size_request (scroll, 378, 248);
|
gtk_widget_set_size_request (scroll, 378, 248);
|
||||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||||
|
|
||||||
content = gtk_text_view_new ();
|
content = gtk_text_view_new ();
|
||||||
gtk_widget_show (content);
|
gtk_widget_show (content);
|
||||||
gtk_container_add (GTK_CONTAINER(scroll), content);
|
gtk_container_add (GTK_CONTAINER(scroll), content);
|
||||||
//gtk_fixed_put (GTK_FIXED (fixed1), content, 6, 28);
|
//gtk_fixed_put (GTK_FIXED (fixed1), content, 6, 28);
|
||||||
gtk_widget_set_size_request (content, 378, 248);
|
gtk_widget_set_size_request (content, 378, 248);
|
||||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (content), FALSE);
|
gtk_text_view_set_editable (GTK_TEXT_VIEW (content), FALSE);
|
||||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (content), GTK_WRAP_WORD);
|
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (content), GTK_WRAP_WORD);
|
||||||
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (content), FALSE);
|
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (content), FALSE);
|
||||||
|
|
||||||
g_signal_connect ((gpointer) startwin, "delete_event",
|
g_signal_connect ((gpointer) startwin, "delete_event",
|
||||||
G_CALLBACK (on_startwin_delete_event),
|
G_CALLBACK (on_startwin_delete_event),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/* Store pointers to all widgets, for use by lookup_widget(). */
|
/* Store pointers to all widgets, for use by lookup_widget(). */
|
||||||
GLADE_HOOKUP_OBJECT_NO_REF (startwin, startwin, "startwin");
|
GLADE_HOOKUP_OBJECT_NO_REF (startwin, startwin, "startwin");
|
||||||
GLADE_HOOKUP_OBJECT (startwin, banner, "banner");
|
GLADE_HOOKUP_OBJECT (startwin, banner, "banner");
|
||||||
GLADE_HOOKUP_OBJECT (startwin, label, "label");
|
GLADE_HOOKUP_OBJECT (startwin, label, "label");
|
||||||
GLADE_HOOKUP_OBJECT (startwin, scroll, "scroll");
|
GLADE_HOOKUP_OBJECT (startwin, scroll, "scroll");
|
||||||
GLADE_HOOKUP_OBJECT (startwin, content, "content");
|
GLADE_HOOKUP_OBJECT (startwin, content, "content");
|
||||||
|
|
||||||
g_signal_connect((gpointer)startwin, "destroy", G_CALLBACK(gtk_widget_destroyed), (gpointer)&startwin);
|
g_signal_connect((gpointer)startwin, "destroy", G_CALLBACK(gtk_widget_destroyed), (gpointer)&startwin);
|
||||||
gtk_widget_show (startwin);
|
gtk_widget_show (startwin);
|
||||||
gtk_main_iteration_do (FALSE);
|
gtk_main_iteration_do (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gtkbuild_settitle_startwin(const char *title)
|
void gtkbuild_settitle_startwin(const char *title)
|
||||||
{
|
{
|
||||||
if (!gtkenabled || !startwin) return;
|
if (!gtkenabled || !startwin) return;
|
||||||
gtk_window_set_title (GTK_WINDOW (startwin), title);
|
gtk_window_set_title (GTK_WINDOW (startwin), title);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gtkbuild_puts_startwin(const char *str)
|
void gtkbuild_puts_startwin(const char *str)
|
||||||
{
|
{
|
||||||
GtkWidget *textview;
|
GtkWidget *textview;
|
||||||
GtkTextBuffer *textbuffer;
|
GtkTextBuffer *textbuffer;
|
||||||
GtkTextIter enditer;
|
GtkTextIter enditer;
|
||||||
GtkTextMark *mark;
|
GtkTextMark *mark;
|
||||||
const char *aptr, *bptr;
|
const char *aptr, *bptr;
|
||||||
|
|
||||||
if (!gtkenabled || !startwin || !str) return;
|
if (!gtkenabled || !startwin || !str) return;
|
||||||
if (!(textview = lookup_widget(startwin, "content"))) return;
|
if (!(textview = lookup_widget(startwin, "content"))) return;
|
||||||
textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
|
textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
|
||||||
|
|
||||||
gtk_text_buffer_get_end_iter(textbuffer, &enditer);
|
gtk_text_buffer_get_end_iter(textbuffer, &enditer);
|
||||||
for (aptr = bptr = str; *aptr != 0; ) {
|
for (aptr = bptr = str; *aptr != 0; ) {
|
||||||
switch (*bptr) {
|
switch (*bptr) {
|
||||||
case '\b':
|
case '\b':
|
||||||
if (bptr > aptr)
|
if (bptr > aptr)
|
||||||
gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr)-1);
|
gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr)-1);
|
||||||
#if GTK_CHECK_VERSION(2,6,0)
|
#if GTK_CHECK_VERSION(2,6,0)
|
||||||
gtk_text_buffer_backspace(textbuffer, &enditer, FALSE, TRUE);
|
gtk_text_buffer_backspace(textbuffer, &enditer, FALSE, TRUE);
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
GtkTextIter iter2 = enditer;
|
GtkTextIter iter2 = enditer;
|
||||||
gtk_text_iter_backward_cursor_position(&iter2);
|
gtk_text_iter_backward_cursor_position(&iter2);
|
||||||
//FIXME: this seems be deleting one too many chars somewhere!
|
//FIXME: this seems be deleting one too many chars somewhere!
|
||||||
if (!gtk_text_iter_equal(&iter2, &enditer))
|
if (!gtk_text_iter_equal(&iter2, &enditer))
|
||||||
gtk_text_buffer_delete_interactive(textbuffer, &iter2, &enditer, TRUE);
|
gtk_text_buffer_delete_interactive(textbuffer, &iter2, &enditer, TRUE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
aptr = ++bptr;
|
aptr = ++bptr;
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
if (bptr > aptr)
|
if (bptr > aptr)
|
||||||
gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr));
|
gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr));
|
||||||
aptr = bptr;
|
aptr = bptr;
|
||||||
break;
|
break;
|
||||||
case '\r': // FIXME
|
case '\r': // FIXME
|
||||||
default:
|
default:
|
||||||
bptr++;
|
bptr++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mark = gtk_text_buffer_create_mark(textbuffer, NULL, &enditer, 1);
|
mark = gtk_text_buffer_create_mark(textbuffer, NULL, &enditer, 1);
|
||||||
gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(textview), mark, 0.0, FALSE, 0.0, 1.0);
|
gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(textview), mark, 0.0, FALSE, 0.0, 1.0);
|
||||||
gtk_text_buffer_delete_mark(textbuffer, mark);
|
gtk_text_buffer_delete_mark(textbuffer, mark);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gtkbuild_close_startwin(void)
|
void gtkbuild_close_startwin(void)
|
||||||
{
|
{
|
||||||
if (!gtkenabled) return;
|
if (!gtkenabled) return;
|
||||||
if (startwin) {
|
if (startwin) {
|
||||||
gtk_widget_destroy (startwin);
|
gtk_widget_destroy (startwin);
|
||||||
startwin = NULL;
|
startwin = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gtkbuild_update_startwin(void)
|
void gtkbuild_update_startwin(void)
|
||||||
{
|
{
|
||||||
if (!gtkenabled) return;
|
if (!gtkenabled) return;
|
||||||
gtk_main_iteration_do (FALSE);
|
gtk_main_iteration_do (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int gtkbuild_msgbox(char *name, char *msg)
|
int gtkbuild_msgbox(char *name, char *msg)
|
||||||
{
|
{
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
if (!gtkenabled) return -1;
|
if (!gtkenabled) return -1;
|
||||||
|
|
||||||
dialog = gtk_message_dialog_new(NULL,
|
dialog = gtk_message_dialog_new(NULL,
|
||||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
GTK_MESSAGE_INFO,
|
GTK_MESSAGE_INFO,
|
||||||
GTK_BUTTONS_OK,
|
GTK_BUTTONS_OK,
|
||||||
msg);
|
msg);
|
||||||
gtk_window_set_title(GTK_WINDOW(dialog), name);
|
gtk_window_set_title(GTK_WINDOW(dialog), name);
|
||||||
gtk_dialog_run(GTK_DIALOG(dialog));
|
gtk_dialog_run(GTK_DIALOG(dialog));
|
||||||
gtk_widget_destroy(dialog);
|
gtk_widget_destroy(dialog);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gtkbuild_ynbox(char *name, char *msg)
|
int gtkbuild_ynbox(char *name, char *msg)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
if (!gtkenabled) return -1;
|
if (!gtkenabled) return -1;
|
||||||
|
|
||||||
dialog = gtk_message_dialog_new(NULL,
|
dialog = gtk_message_dialog_new(NULL,
|
||||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
GTK_MESSAGE_INFO,
|
GTK_MESSAGE_INFO,
|
||||||
GTK_BUTTONS_YES_NO,
|
GTK_BUTTONS_YES_NO,
|
||||||
msg);
|
msg);
|
||||||
gtk_window_set_title(GTK_WINDOW(dialog), name);
|
gtk_window_set_title(GTK_WINDOW(dialog), name);
|
||||||
r = gtk_dialog_run(GTK_DIALOG(dialog));
|
r = gtk_dialog_run(GTK_DIALOG(dialog));
|
||||||
gtk_widget_destroy(dialog);
|
gtk_widget_destroy(dialog);
|
||||||
|
|
||||||
if (r == GTK_RESPONSE_YES) return 1;
|
if (r == GTK_RESPONSE_YES) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RENDERTYPESDL
|
#ifdef RENDERTYPESDL
|
||||||
|
@ -215,24 +215,24 @@ extern struct sdlappicon sdlappicon;
|
||||||
#endif
|
#endif
|
||||||
void gtkbuild_init(int argc, char **argv)
|
void gtkbuild_init(int argc, char **argv)
|
||||||
{
|
{
|
||||||
gtkenabled = gtk_init_check(argc, argv);
|
gtkenabled = gtk_init_check(argc, argv);
|
||||||
if (!gtkenabled) return;
|
if (!gtkenabled) return;
|
||||||
#ifdef RENDERTYPESDL
|
#ifdef RENDERTYPESDL
|
||||||
appicon = gdk_pixbuf_new_from_data((const guchar *)sdlappicon.pixels,
|
appicon = gdk_pixbuf_new_from_data((const guchar *)sdlappicon.pixels,
|
||||||
GDK_COLORSPACE_RGB, TRUE, 8, sdlappicon.width, sdlappicon.height,
|
GDK_COLORSPACE_RGB, TRUE, 8, sdlappicon.width, sdlappicon.height,
|
||||||
sdlappicon.width*4, NULL, NULL);
|
sdlappicon.width*4, NULL, NULL);
|
||||||
#endif
|
#endif
|
||||||
if (appicon) gtk_window_set_default_icon(appicon);
|
if (appicon) gtk_window_set_default_icon(appicon);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gtkbuild_exit(int r)
|
void gtkbuild_exit(int r)
|
||||||
{
|
{
|
||||||
if (!gtkenabled) return;
|
if (!gtkenabled) return;
|
||||||
if (appicon) g_object_unref((gpointer)appicon);
|
if (appicon) g_object_unref((gpointer)appicon);
|
||||||
//gtk_exit(r);
|
//gtk_exit(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *gtkbuild_get_app_icon(void)
|
void *gtkbuild_get_app_icon(void)
|
||||||
{
|
{
|
||||||
return appicon;
|
return appicon;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,15 +10,15 @@
|
||||||
static palette_t hictinting[MAXPALOOKUPS];
|
static palette_t hictinting[MAXPALOOKUPS];
|
||||||
|
|
||||||
struct hicskybox_t {
|
struct hicskybox_t {
|
||||||
long ignore;
|
long ignore;
|
||||||
char *face[6];
|
char *face[6];
|
||||||
};
|
};
|
||||||
typedef struct hicreplc_t {
|
typedef struct hicreplc_t {
|
||||||
struct hicreplc_t *next;
|
struct hicreplc_t *next;
|
||||||
char palnum, ignore, flags, filler;
|
char palnum, ignore, flags, filler;
|
||||||
char *filename;
|
char *filename;
|
||||||
float alphacut;
|
float alphacut;
|
||||||
struct hicskybox_t *skybox;
|
struct hicskybox_t *skybox;
|
||||||
} hicreplctyp;
|
} hicreplctyp;
|
||||||
static hicreplctyp *hicreplc[MAXTILES];
|
static hicreplctyp *hicreplc[MAXTILES];
|
||||||
static char hicfirstinit = 0;
|
static char hicfirstinit = 0;
|
||||||
|
@ -28,27 +28,27 @@ static char hicfirstinit = 0;
|
||||||
//
|
//
|
||||||
static hicreplctyp * hicfindsubst(long picnum, long palnum, long skybox)
|
static hicreplctyp * hicfindsubst(long picnum, long palnum, long skybox)
|
||||||
{
|
{
|
||||||
hicreplctyp *hr;
|
hicreplctyp *hr;
|
||||||
|
|
||||||
if (!hicfirstinit) return NULL;
|
if (!hicfirstinit) return NULL;
|
||||||
if ((unsigned long)picnum >= (unsigned long)MAXTILES) return NULL;
|
if ((unsigned long)picnum >= (unsigned long)MAXTILES) return NULL;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
for (hr = hicreplc[picnum]; hr; hr = hr->next) {
|
for (hr = hicreplc[picnum]; hr; hr = hr->next) {
|
||||||
if (hr->palnum == palnum) {
|
if (hr->palnum == palnum) {
|
||||||
if (skybox) {
|
if (skybox) {
|
||||||
if (hr->skybox && !hr->skybox->ignore) return hr;
|
if (hr->skybox && !hr->skybox->ignore) return hr;
|
||||||
} else {
|
} else {
|
||||||
if (!hr->ignore) return hr;
|
if (!hr->ignore) return hr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!palnum) break;
|
if (!palnum) break;
|
||||||
palnum = 0;
|
palnum = 0;
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
return NULL; // no replacement found
|
return NULL; // no replacement found
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,36 +58,36 @@ static hicreplctyp * hicfindsubst(long picnum, long palnum, long skybox)
|
||||||
//
|
//
|
||||||
void hicinit(void)
|
void hicinit(void)
|
||||||
{
|
{
|
||||||
long i,j;
|
long i,j;
|
||||||
hicreplctyp *hr, *next;
|
hicreplctyp *hr, *next;
|
||||||
|
|
||||||
for (i=0;i<MAXPALOOKUPS;i++) { // all tints should be 100%
|
for (i=0;i<MAXPALOOKUPS;i++) { // all tints should be 100%
|
||||||
hictinting[i].r = hictinting[i].g = hictinting[i].b = 0xff;
|
hictinting[i].r = hictinting[i].g = hictinting[i].b = 0xff;
|
||||||
hictinting[i].f = 0;
|
hictinting[i].f = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hicfirstinit)
|
if (hicfirstinit)
|
||||||
for (i=MAXTILES-1;i>=0;i--) {
|
for (i=MAXTILES-1;i>=0;i--) {
|
||||||
for (hr=hicreplc[i]; hr; ) {
|
for (hr=hicreplc[i]; hr; ) {
|
||||||
next = hr->next;
|
next = hr->next;
|
||||||
|
|
||||||
if (hr->skybox) {
|
if (hr->skybox) {
|
||||||
for (j=5;j>=0;j--) {
|
for (j=5;j>=0;j--) {
|
||||||
if (hr->skybox->face[j]) {
|
if (hr->skybox->face[j]) {
|
||||||
free(hr->skybox->face[j]);
|
free(hr->skybox->face[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(hr->skybox);
|
free(hr->skybox);
|
||||||
}
|
}
|
||||||
if (hr->filename) free(hr->filename);
|
if (hr->filename) free(hr->filename);
|
||||||
free(hr);
|
free(hr);
|
||||||
|
|
||||||
hr = next;
|
hr = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
memset(hicreplc,0,sizeof(hicreplc));
|
memset(hicreplc,0,sizeof(hicreplc));
|
||||||
|
|
||||||
hicfirstinit = 1;
|
hicfirstinit = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,13 +99,13 @@ void hicinit(void)
|
||||||
//
|
//
|
||||||
void hicsetpalettetint(long palnum, unsigned char r, unsigned char g, unsigned char b, unsigned char effect)
|
void hicsetpalettetint(long palnum, unsigned char r, unsigned char g, unsigned char b, unsigned char effect)
|
||||||
{
|
{
|
||||||
if ((unsigned long)palnum >= (unsigned long)MAXPALOOKUPS) return;
|
if ((unsigned long)palnum >= (unsigned long)MAXPALOOKUPS) return;
|
||||||
if (!hicfirstinit) hicinit();
|
if (!hicfirstinit) hicinit();
|
||||||
|
|
||||||
hictinting[palnum].r = r;
|
hictinting[palnum].r = r;
|
||||||
hictinting[palnum].g = g;
|
hictinting[palnum].g = g;
|
||||||
hictinting[palnum].b = b;
|
hictinting[palnum].b = b;
|
||||||
hictinting[palnum].f = effect & HICEFFECTMASK;
|
hictinting[palnum].f = effect & HICEFFECTMASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,44 +115,44 @@ void hicsetpalettetint(long palnum, unsigned char r, unsigned char g, unsigned c
|
||||||
//
|
//
|
||||||
int hicsetsubsttex(long picnum, long palnum, char *filen, float alphacut, char flags)
|
int hicsetsubsttex(long picnum, long palnum, char *filen, float alphacut, char flags)
|
||||||
{
|
{
|
||||||
hicreplctyp *hr, *hrn;
|
hicreplctyp *hr, *hrn;
|
||||||
|
|
||||||
if ((unsigned long)picnum >= (unsigned long)MAXTILES) return -1;
|
if ((unsigned long)picnum >= (unsigned long)MAXTILES) return -1;
|
||||||
if ((unsigned long)palnum >= (unsigned long)MAXPALOOKUPS) return -1;
|
if ((unsigned long)palnum >= (unsigned long)MAXPALOOKUPS) return -1;
|
||||||
if (!hicfirstinit) hicinit();
|
if (!hicfirstinit) hicinit();
|
||||||
|
|
||||||
for (hr = hicreplc[picnum]; hr; hr = hr->next) {
|
for (hr = hicreplc[picnum]; hr; hr = hr->next) {
|
||||||
if (hr->palnum == palnum)
|
if (hr->palnum == palnum)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hr) {
|
if (!hr) {
|
||||||
// no replacement yet defined
|
// no replacement yet defined
|
||||||
hrn = (hicreplctyp *)calloc(1,sizeof(hicreplctyp));
|
hrn = (hicreplctyp *)calloc(1,sizeof(hicreplctyp));
|
||||||
if (!hrn) return -1;
|
if (!hrn) return -1;
|
||||||
hrn->palnum = palnum;
|
hrn->palnum = palnum;
|
||||||
} else hrn = hr;
|
} else hrn = hr;
|
||||||
|
|
||||||
// store into hicreplc the details for this replacement
|
// store into hicreplc the details for this replacement
|
||||||
if (hrn->filename) free(hrn->filename);
|
if (hrn->filename) free(hrn->filename);
|
||||||
|
|
||||||
hrn->filename = strdup(filen);
|
hrn->filename = strdup(filen);
|
||||||
if (!hrn->filename) {
|
if (!hrn->filename) {
|
||||||
if (hrn->skybox) return -1; // don't free the base structure if there's a skybox defined
|
if (hrn->skybox) return -1; // don't free the base structure if there's a skybox defined
|
||||||
if (hr == NULL) free(hrn); // not yet a link in the chain
|
if (hr == NULL) free(hrn); // not yet a link in the chain
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
hrn->ignore = 0;
|
hrn->ignore = 0;
|
||||||
hrn->alphacut = min(alphacut,1.0);
|
hrn->alphacut = min(alphacut,1.0);
|
||||||
hrn->flags = flags;
|
hrn->flags = flags;
|
||||||
if (hr == NULL) {
|
if (hr == NULL) {
|
||||||
hrn->next = hicreplc[picnum];
|
hrn->next = hicreplc[picnum];
|
||||||
hicreplc[picnum] = hrn;
|
hicreplc[picnum] = hrn;
|
||||||
}
|
}
|
||||||
|
|
||||||
//printf("Replacement [%d,%d]: %s\n", picnum, palnum, hicreplc[i]->filename);
|
//printf("Replacement [%d,%d]: %s\n", picnum, palnum, hicreplc[i]->filename);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -162,59 +162,59 @@ int hicsetsubsttex(long picnum, long palnum, char *filen, float alphacut, char f
|
||||||
//
|
//
|
||||||
int hicsetskybox(long picnum, long palnum, char *faces[6])
|
int hicsetskybox(long picnum, long palnum, char *faces[6])
|
||||||
{
|
{
|
||||||
hicreplctyp *hr, *hrn;
|
hicreplctyp *hr, *hrn;
|
||||||
long j;
|
long j;
|
||||||
|
|
||||||
if ((unsigned long)picnum >= (unsigned long)MAXTILES) return -1;
|
if ((unsigned long)picnum >= (unsigned long)MAXTILES) return -1;
|
||||||
if ((unsigned long)palnum >= (unsigned long)MAXPALOOKUPS) return -1;
|
if ((unsigned long)palnum >= (unsigned long)MAXPALOOKUPS) return -1;
|
||||||
for (j=5;j>=0;j--) if (!faces[j]) return -1;
|
for (j=5;j>=0;j--) if (!faces[j]) return -1;
|
||||||
if (!hicfirstinit) hicinit();
|
if (!hicfirstinit) hicinit();
|
||||||
|
|
||||||
for (hr = hicreplc[picnum]; hr; hr = hr->next) {
|
for (hr = hicreplc[picnum]; hr; hr = hr->next) {
|
||||||
if (hr->palnum == palnum)
|
if (hr->palnum == palnum)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hr) {
|
if (!hr) {
|
||||||
// no replacement yet defined
|
// no replacement yet defined
|
||||||
hrn = (hicreplctyp *)calloc(1,sizeof(hicreplctyp));
|
hrn = (hicreplctyp *)calloc(1,sizeof(hicreplctyp));
|
||||||
if (!hrn) return -1;
|
if (!hrn) return -1;
|
||||||
|
|
||||||
hrn->palnum = palnum;
|
hrn->palnum = palnum;
|
||||||
} else hrn = hr;
|
} else hrn = hr;
|
||||||
|
|
||||||
if (!hrn->skybox) {
|
if (!hrn->skybox) {
|
||||||
hrn->skybox = (struct hicskybox_t *)calloc(1,sizeof(struct hicskybox_t));
|
hrn->skybox = (struct hicskybox_t *)calloc(1,sizeof(struct hicskybox_t));
|
||||||
if (!hrn->skybox) {
|
if (!hrn->skybox) {
|
||||||
if (hr == NULL) free(hrn); // not yet a link in the chain
|
if (hr == NULL) free(hrn); // not yet a link in the chain
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (j=5;j>=0;j--) {
|
for (j=5;j>=0;j--) {
|
||||||
if (hrn->skybox->face[j])
|
if (hrn->skybox->face[j])
|
||||||
free(hrn->skybox->face[j]);
|
free(hrn->skybox->face[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// store each face's filename
|
// store each face's filename
|
||||||
for (j=0;j<6;j++) {
|
for (j=0;j<6;j++) {
|
||||||
hrn->skybox->face[j] = strdup(faces[j]);
|
hrn->skybox->face[j] = strdup(faces[j]);
|
||||||
if (!hrn->skybox->face[j]) {
|
if (!hrn->skybox->face[j]) {
|
||||||
for (--j; j>=0; --j) // free any previous faces
|
for (--j; j>=0; --j) // free any previous faces
|
||||||
free(hrn->skybox->face[j]);
|
free(hrn->skybox->face[j]);
|
||||||
free(hrn->skybox);
|
free(hrn->skybox);
|
||||||
hrn->skybox = NULL;
|
hrn->skybox = NULL;
|
||||||
if (hr == NULL) free(hrn);
|
if (hr == NULL) free(hrn);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hrn->skybox->ignore = 0;
|
hrn->skybox->ignore = 0;
|
||||||
if (hr == NULL) {
|
if (hr == NULL) {
|
||||||
hrn->next = hicreplc[picnum];
|
hrn->next = hicreplc[picnum];
|
||||||
hicreplc[picnum] = hrn;
|
hicreplc[picnum] = hrn;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -224,31 +224,31 @@ int hicsetskybox(long picnum, long palnum, char *faces[6])
|
||||||
//
|
//
|
||||||
int hicclearsubst(long picnum, long palnum)
|
int hicclearsubst(long picnum, long palnum)
|
||||||
{
|
{
|
||||||
hicreplctyp *hr, *hrn = NULL;
|
hicreplctyp *hr, *hrn = NULL;
|
||||||
|
|
||||||
if ((unsigned long)picnum >= (unsigned long)MAXTILES) return -1;
|
if ((unsigned long)picnum >= (unsigned long)MAXTILES) return -1;
|
||||||
if ((unsigned long)palnum >= (unsigned long)MAXPALOOKUPS) return -1;
|
if ((unsigned long)palnum >= (unsigned long)MAXPALOOKUPS) return -1;
|
||||||
if (!hicfirstinit) return 0;
|
if (!hicfirstinit) return 0;
|
||||||
|
|
||||||
for (hr = hicreplc[picnum]; hr; hrn = hr, hr = hr->next) {
|
for (hr = hicreplc[picnum]; hr; hrn = hr, hr = hr->next) {
|
||||||
if (hr->palnum == palnum)
|
if (hr->palnum == palnum)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hr) return 0;
|
if (!hr) return 0;
|
||||||
|
|
||||||
if (hr->filename) free(hr->filename);
|
if (hr->filename) free(hr->filename);
|
||||||
if (hr->skybox) {
|
if (hr->skybox) {
|
||||||
int i;
|
int i;
|
||||||
for (i=5;i>=0;i--)
|
for (i=5;i>=0;i--)
|
||||||
if (hr->skybox->face[i])
|
if (hr->skybox->face[i])
|
||||||
free(hr->skybox->face[i]);
|
free(hr->skybox->face[i]);
|
||||||
free(hr->skybox);
|
free(hr->skybox);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hrn) hrn->next = hr->next;
|
if (hrn) hrn->next = hr->next;
|
||||||
else hicreplc[picnum] = hr->next;
|
else hicreplc[picnum] = hr->next;
|
||||||
free(hr);
|
free(hr);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -82,161 +82,161 @@
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
lzf_compress (const void *const in_data, unsigned int in_len,
|
lzf_compress (const void *const in_data, unsigned int in_len,
|
||||||
void *out_data, unsigned int out_len
|
void *out_data, unsigned int out_len
|
||||||
#if LZF_STATE_ARG
|
#if LZF_STATE_ARG
|
||||||
, LZF_STATE *htab
|
, LZF_STATE *htab
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#if !LZF_STATE_ARG
|
#if !LZF_STATE_ARG
|
||||||
LZF_STATE htab;
|
LZF_STATE htab;
|
||||||
#endif
|
#endif
|
||||||
const u8 **hslot;
|
const u8 **hslot;
|
||||||
const u8 *ip = (const u8 *)in_data;
|
const u8 *ip = (const u8 *)in_data;
|
||||||
u8 *op = (u8 *)out_data;
|
u8 *op = (u8 *)out_data;
|
||||||
const u8 *in_end = ip + in_len;
|
const u8 *in_end = ip + in_len;
|
||||||
u8 *out_end = op + out_len;
|
u8 *out_end = op + out_len;
|
||||||
const u8 *ref;
|
const u8 *ref;
|
||||||
|
|
||||||
unsigned int hval = FRST (ip);
|
unsigned int hval = FRST (ip);
|
||||||
unsigned long off;
|
unsigned long off;
|
||||||
int lit = 0;
|
int lit = 0;
|
||||||
|
|
||||||
#if INIT_HTAB
|
#if INIT_HTAB
|
||||||
# if USE_MEMCPY
|
# if USE_MEMCPY
|
||||||
memset (htab, 0, sizeof (htab));
|
memset (htab, 0, sizeof (htab));
|
||||||
# else
|
# else
|
||||||
for (hslot = htab; hslot < htab + HSIZE; hslot++)
|
for (hslot = htab; hslot < htab + HSIZE; hslot++)
|
||||||
*hslot++ = ip;
|
*hslot++ = ip;
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (ip < in_end - 2)
|
if (ip < in_end - 2)
|
||||||
{
|
{
|
||||||
hval = NEXT (hval, ip);
|
hval = NEXT (hval, ip);
|
||||||
hslot = htab + IDX (hval);
|
hslot = htab + IDX (hval);
|
||||||
ref = *hslot; *hslot = ip;
|
ref = *hslot; *hslot = ip;
|
||||||
|
|
||||||
if (1
|
if (1
|
||||||
#if INIT_HTAB && !USE_MEMCPY
|
#if INIT_HTAB && !USE_MEMCPY
|
||||||
&& ref < ip /* the next test will actually take care of this, but this is faster */
|
&& ref < ip /* the next test will actually take care of this, but this is faster */
|
||||||
#endif
|
#endif
|
||||||
&& (off = ip - ref - 1) < MAX_OFF
|
&& (off = ip - ref - 1) < MAX_OFF
|
||||||
&& ip + 4 < in_end
|
&& ip + 4 < in_end
|
||||||
&& ref > (u8 *)in_data
|
&& ref > (u8 *)in_data
|
||||||
#if STRICT_ALIGN
|
#if STRICT_ALIGN
|
||||||
&& ref[0] == ip[0]
|
&& ref[0] == ip[0]
|
||||||
&& ref[1] == ip[1]
|
&& ref[1] == ip[1]
|
||||||
&& ref[2] == ip[2]
|
&& ref[2] == ip[2]
|
||||||
#else
|
#else
|
||||||
&& *(u16 *)ref == *(u16 *)ip
|
&& *(u16 *)ref == *(u16 *)ip
|
||||||
&& ref[2] == ip[2]
|
&& ref[2] == ip[2]
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
/* match found at *ref++ */
|
/* match found at *ref++ */
|
||||||
unsigned int len = 2;
|
unsigned int len = 2;
|
||||||
unsigned int maxlen = in_end - ip - len;
|
unsigned int maxlen = in_end - ip - len;
|
||||||
maxlen = maxlen > MAX_REF ? MAX_REF : maxlen;
|
maxlen = maxlen > MAX_REF ? MAX_REF : maxlen;
|
||||||
|
|
||||||
if (op + lit + 1 + 3 >= out_end)
|
if (op + lit + 1 + 3 >= out_end)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
do
|
do
|
||||||
len++;
|
len++;
|
||||||
while (len < maxlen && ref[len] == ip[len]);
|
while (len < maxlen && ref[len] == ip[len]);
|
||||||
|
|
||||||
if (lit)
|
if (lit)
|
||||||
{
|
{
|
||||||
*op++ = lit - 1;
|
*op++ = lit - 1;
|
||||||
lit = -lit;
|
lit = -lit;
|
||||||
do
|
do
|
||||||
*op++ = ip[lit];
|
*op++ = ip[lit];
|
||||||
while (++lit);
|
while (++lit);
|
||||||
}
|
}
|
||||||
|
|
||||||
len -= 2;
|
len -= 2;
|
||||||
ip++;
|
ip++;
|
||||||
|
|
||||||
if (len < 7)
|
if (len < 7)
|
||||||
{
|
{
|
||||||
*op++ = (off >> 8) + (len << 5);
|
*op++ = (off >> 8) + (len << 5);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*op++ = (off >> 8) + ( 7 << 5);
|
*op++ = (off >> 8) + ( 7 << 5);
|
||||||
*op++ = len - 7;
|
*op++ = len - 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
*op++ = off;
|
*op++ = off;
|
||||||
|
|
||||||
#if ULTRA_FAST || VERY_FAST
|
#if ULTRA_FAST || VERY_FAST
|
||||||
ip += len;
|
ip += len;
|
||||||
#if VERY_FAST && !ULTRA_FAST
|
#if VERY_FAST && !ULTRA_FAST
|
||||||
--ip;
|
--ip;
|
||||||
#endif
|
#endif
|
||||||
hval = FRST (ip);
|
hval = FRST (ip);
|
||||||
|
|
||||||
hval = NEXT (hval, ip);
|
hval = NEXT (hval, ip);
|
||||||
htab[IDX (hval)] = ip;
|
htab[IDX (hval)] = ip;
|
||||||
ip++;
|
ip++;
|
||||||
|
|
||||||
#if VERY_FAST && !ULTRA_FAST
|
#if VERY_FAST && !ULTRA_FAST
|
||||||
hval = NEXT (hval, ip);
|
hval = NEXT (hval, ip);
|
||||||
htab[IDX (hval)] = ip;
|
htab[IDX (hval)] = ip;
|
||||||
ip++;
|
ip++;
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
hval = NEXT (hval, ip);
|
hval = NEXT (hval, ip);
|
||||||
htab[IDX (hval)] = ip;
|
htab[IDX (hval)] = ip;
|
||||||
ip++;
|
ip++;
|
||||||
}
|
}
|
||||||
while (len--);
|
while (len--);
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ip == in_end)
|
else if (ip == in_end)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* one more literal byte we must copy */
|
/* one more literal byte we must copy */
|
||||||
lit++;
|
lit++;
|
||||||
ip++;
|
ip++;
|
||||||
|
|
||||||
if (lit == MAX_LIT)
|
if (lit == MAX_LIT)
|
||||||
{
|
{
|
||||||
if (op + 1 + MAX_LIT >= out_end)
|
if (op + 1 + MAX_LIT >= out_end)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
*op++ = MAX_LIT - 1;
|
*op++ = MAX_LIT - 1;
|
||||||
#if USE_MEMCPY
|
#if USE_MEMCPY
|
||||||
memcpy (op, ip - MAX_LIT, MAX_LIT);
|
memcpy (op, ip - MAX_LIT, MAX_LIT);
|
||||||
op += MAX_LIT;
|
op += MAX_LIT;
|
||||||
lit = 0;
|
lit = 0;
|
||||||
#else
|
#else
|
||||||
lit = -lit;
|
lit = -lit;
|
||||||
do
|
do
|
||||||
*op++ = ip[lit];
|
*op++ = ip[lit];
|
||||||
while (++lit);
|
while (++lit);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lit)
|
if (lit)
|
||||||
{
|
{
|
||||||
if (op + lit + 1 >= out_end)
|
if (op + lit + 1 >= out_end)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
*op++ = lit - 1;
|
*op++ = lit - 1;
|
||||||
lit = -lit;
|
lit = -lit;
|
||||||
do
|
do
|
||||||
*op++ = ip[lit];
|
*op++ = ip[lit];
|
||||||
while (++lit);
|
while (++lit);
|
||||||
}
|
}
|
||||||
|
|
||||||
return op - (u8 *) out_data;
|
return op - (u8 *) out_data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,68 +49,68 @@ unsigned int
|
||||||
lzf_decompress (const void *const in_data, unsigned int in_len,
|
lzf_decompress (const void *const in_data, unsigned int in_len,
|
||||||
void *out_data, unsigned int out_len)
|
void *out_data, unsigned int out_len)
|
||||||
{
|
{
|
||||||
u8 const *ip = (const u8 *)in_data;
|
u8 const *ip = (const u8 *)in_data;
|
||||||
u8 *op = (u8 *)out_data;
|
u8 *op = (u8 *)out_data;
|
||||||
u8 const *const in_end = ip + in_len;
|
u8 const *const in_end = ip + in_len;
|
||||||
u8 *const out_end = op + out_len;
|
u8 *const out_end = op + out_len;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
unsigned int ctrl = *ip++;
|
unsigned int ctrl = *ip++;
|
||||||
|
|
||||||
if (ctrl < (1 << 5)) /* literal run */
|
if (ctrl < (1 << 5)) /* literal run */
|
||||||
{
|
{
|
||||||
ctrl++;
|
ctrl++;
|
||||||
|
|
||||||
if (op + ctrl > out_end)
|
if (op + ctrl > out_end)
|
||||||
{
|
{
|
||||||
SET_ERRNO (E2BIG);
|
SET_ERRNO (E2BIG);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_MEMCPY
|
#if USE_MEMCPY
|
||||||
memcpy (op, ip, ctrl);
|
memcpy (op, ip, ctrl);
|
||||||
op += ctrl;
|
op += ctrl;
|
||||||
ip += ctrl;
|
ip += ctrl;
|
||||||
#else
|
#else
|
||||||
do
|
do
|
||||||
*op++ = *ip++;
|
*op++ = *ip++;
|
||||||
while (--ctrl);
|
while (--ctrl);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else /* back reference */
|
else /* back reference */
|
||||||
{
|
{
|
||||||
unsigned int len = ctrl >> 5;
|
unsigned int len = ctrl >> 5;
|
||||||
|
|
||||||
u8 *ref = op - ((ctrl & 0x1f) << 8) - 1;
|
u8 *ref = op - ((ctrl & 0x1f) << 8) - 1;
|
||||||
|
|
||||||
if (len == 7)
|
if (len == 7)
|
||||||
len += *ip++;
|
len += *ip++;
|
||||||
|
|
||||||
ref -= *ip++;
|
ref -= *ip++;
|
||||||
|
|
||||||
if (op + len + 2 > out_end)
|
if (op + len + 2 > out_end)
|
||||||
{
|
{
|
||||||
SET_ERRNO (E2BIG);
|
SET_ERRNO (E2BIG);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ref < (u8 *)out_data)
|
if (ref < (u8 *)out_data)
|
||||||
{
|
{
|
||||||
SET_ERRNO (EINVAL);
|
SET_ERRNO (EINVAL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
*op++ = *ref++;
|
|
||||||
*op++ = *ref++;
|
|
||||||
|
|
||||||
do
|
|
||||||
*op++ = *ref++;
|
*op++ = *ref++;
|
||||||
while (--len);
|
*op++ = *ref++;
|
||||||
|
|
||||||
|
do
|
||||||
|
*op++ = *ref++;
|
||||||
|
while (--len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (op < out_end && ip < in_end);
|
while (op < out_end && ip < in_end);
|
||||||
|
|
||||||
return op - (u8 *)out_data;
|
return op - (u8 *)out_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,107 +10,107 @@ static unsigned short SSWAPIB (unsigned short a) { return((a>>8)+(a<<8)); }
|
||||||
#define USENEW 1
|
#define USENEW 1
|
||||||
long lzwcompress (unsigned char *ucompbuf, long ucompleng, unsigned char *compbuf)
|
long lzwcompress (unsigned char *ucompbuf, long ucompleng, unsigned char *compbuf)
|
||||||
{
|
{
|
||||||
long i, j, numnodes, *lptr, bitcnt, nbits, oneupnbits, hmask, *child;
|
long i, j, numnodes, *lptr, bitcnt, nbits, oneupnbits, hmask, *child;
|
||||||
long *sibly;
|
long *sibly;
|
||||||
#if USENEW
|
#if USENEW
|
||||||
long *sibry;
|
long *sibry;
|
||||||
#endif
|
#endif
|
||||||
unsigned char *nodev, *cptr, *eptr;
|
unsigned char *nodev, *cptr, *eptr;
|
||||||
|
|
||||||
nodev = (unsigned char *)malloc((ucompleng+256)*sizeof(char)); if (!nodev) return(0);
|
nodev = (unsigned char *)malloc((ucompleng+256)*sizeof(char)); if (!nodev) return(0);
|
||||||
child = (long *)malloc((ucompleng+256)*sizeof(long)); if (!child) { free(nodev); return(0); }
|
child = (long *)malloc((ucompleng+256)*sizeof(long)); if (!child) { free(nodev); return(0); }
|
||||||
sibly = (long *)malloc((ucompleng+256)*sizeof(long)); if (!sibly) { free(child); free(nodev); return(0); }
|
sibly = (long *)malloc((ucompleng+256)*sizeof(long)); if (!sibly) { free(child); free(nodev); return(0); }
|
||||||
#if USENEW
|
#if USENEW
|
||||||
sibry = (long *)malloc((ucompleng+256)*sizeof(long)); if (!sibry) { free(sibly); free(child); free(nodev); return(0); }
|
sibry = (long *)malloc((ucompleng+256)*sizeof(long)); if (!sibry) { free(sibly); free(child); free(nodev); return(0); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(i=255;i>=0;i--) { nodev[i] = i; child[i] = -1; }
|
for(i=255;i>=0;i--) { nodev[i] = i; child[i] = -1; }
|
||||||
memset(compbuf,0,ucompleng+15);
|
memset(compbuf,0,ucompleng+15);
|
||||||
|
|
||||||
cptr = ucompbuf; eptr = &ucompbuf[ucompleng];
|
cptr = ucompbuf; eptr = &ucompbuf[ucompleng];
|
||||||
|
|
||||||
numnodes = 256; bitcnt = (4<<3); nbits = 8; oneupnbits = (1<<8); hmask = ((oneupnbits>>1)-1);
|
numnodes = 256; bitcnt = (4<<3); nbits = 8; oneupnbits = (1<<8); hmask = ((oneupnbits>>1)-1);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
for(i=cptr[0];i>=0;i=j)
|
for(i=cptr[0];i>=0;i=j)
|
||||||
{
|
{
|
||||||
cptr++; if (cptr >= eptr) goto lzwcompbreak2b;
|
cptr++; if (cptr >= eptr) goto lzwcompbreak2b;
|
||||||
j = child[i]; if (j < 0) { child[i] = numnodes; break; }
|
j = child[i]; if (j < 0) { child[i] = numnodes; break; }
|
||||||
#if USENEW
|
#if USENEW
|
||||||
//This is about 2x faster when ucompbuf is more random, 5% slower when very compressible
|
//This is about 2x faster when ucompbuf is more random, 5% slower when very compressible
|
||||||
while (cptr[0] != nodev[j])
|
while (cptr[0] != nodev[j])
|
||||||
{
|
{
|
||||||
if (cptr[0] < nodev[j])
|
if (cptr[0] < nodev[j])
|
||||||
{ if (sibly[j] < 0) { sibly[j] = numnodes; goto lzwcompbreak2a; } j = sibly[j]; }
|
{ if (sibly[j] < 0) { sibly[j] = numnodes; goto lzwcompbreak2a; } j = sibly[j]; }
|
||||||
else { if (sibry[j] < 0) { sibry[j] = numnodes; goto lzwcompbreak2a; } j = sibry[j]; }
|
else { if (sibry[j] < 0) { sibry[j] = numnodes; goto lzwcompbreak2a; } j = sibry[j]; }
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
for(;nodev[j]!=cptr[0];j=sibly[j])
|
for(;nodev[j]!=cptr[0];j=sibly[j])
|
||||||
if (sibly[j] < 0) { sibly[j] = numnodes; goto lzwcompbreak2a; }
|
if (sibly[j] < 0) { sibly[j] = numnodes; goto lzwcompbreak2a; }
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
lzwcompbreak2a: nodev[numnodes] = cptr[0];
|
lzwcompbreak2a: nodev[numnodes] = cptr[0];
|
||||||
lzwcompbreak2b: child[numnodes] = sibly[numnodes] = -1;
|
lzwcompbreak2b: child[numnodes] = sibly[numnodes] = -1;
|
||||||
#if USENEW
|
#if USENEW
|
||||||
sibry[numnodes] = -1;
|
sibry[numnodes] = -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lptr = (long *)&compbuf[bitcnt>>3]; lptr[0] |= LSWAPIB(i<<(bitcnt&7));
|
lptr = (long *)&compbuf[bitcnt>>3]; lptr[0] |= LSWAPIB(i<<(bitcnt&7));
|
||||||
bitcnt += nbits; if ((i&hmask) > ((numnodes-1)&hmask)) bitcnt--;
|
bitcnt += nbits; if ((i&hmask) > ((numnodes-1)&hmask)) bitcnt--;
|
||||||
|
|
||||||
numnodes++; if (numnodes > oneupnbits) { nbits++; oneupnbits <<= 1; hmask = ((oneupnbits>>1)-1); }
|
numnodes++; if (numnodes > oneupnbits) { nbits++; oneupnbits <<= 1; hmask = ((oneupnbits>>1)-1); }
|
||||||
} while ((cptr < eptr) && (bitcnt < (ucompleng<<3)));
|
} while ((cptr < eptr) && (bitcnt < (ucompleng<<3)));
|
||||||
|
|
||||||
#if USENEW
|
#if USENEW
|
||||||
free(sibry);
|
free(sibry);
|
||||||
#endif
|
#endif
|
||||||
free(sibly);
|
free(sibly);
|
||||||
free(child); free(nodev);
|
free(child); free(nodev);
|
||||||
|
|
||||||
lptr = (long *)compbuf;
|
lptr = (long *)compbuf;
|
||||||
if (((bitcnt+7)>>3) < ucompleng) { lptr[0] = LSWAPIB(numnodes); return((bitcnt+7)>>3); }
|
if (((bitcnt+7)>>3) < ucompleng) { lptr[0] = LSWAPIB(numnodes); return((bitcnt+7)>>3); }
|
||||||
memcpy(compbuf,ucompbuf,ucompleng); return(ucompleng);
|
memcpy(compbuf,ucompbuf,ucompleng); return(ucompleng);
|
||||||
}
|
}
|
||||||
|
|
||||||
long lzwuncompress (unsigned char *compbuf, long compleng, unsigned char *ucompbuf, long ucompleng)
|
long lzwuncompress (unsigned char *compbuf, long compleng, unsigned char *ucompbuf, long ucompleng)
|
||||||
{
|
{
|
||||||
long i, dat, leng, bitcnt, *lptr, numnodes, totnodes, nbits, oneupnbits, hmask, *prefix;
|
long i, dat, leng, bitcnt, *lptr, numnodes, totnodes, nbits, oneupnbits, hmask, *prefix;
|
||||||
unsigned char ch, *ucptr, *suffix;
|
unsigned char ch, *ucptr, *suffix;
|
||||||
long ucomp = (long)ucompbuf;
|
long ucomp = (long)ucompbuf;
|
||||||
|
|
||||||
if (compleng >= ucompleng) { memcpy(ucompbuf,compbuf,ucompleng); return ucompleng; }
|
if (compleng >= ucompleng) { memcpy(ucompbuf,compbuf,ucompleng); return ucompleng; }
|
||||||
|
|
||||||
totnodes = LSWAPIB(((long *)compbuf)[0]); if (totnodes <= 0 || totnodes >= ucompleng+256) return 0;
|
totnodes = LSWAPIB(((long *)compbuf)[0]); if (totnodes <= 0 || totnodes >= ucompleng+256) return 0;
|
||||||
|
|
||||||
prefix = (long *)malloc(totnodes*sizeof(long)); if (!prefix) return 0;
|
prefix = (long *)malloc(totnodes*sizeof(long)); if (!prefix) return 0;
|
||||||
suffix = (unsigned char *)malloc(totnodes*sizeof(char)); if (!suffix) { free(prefix); return 0; }
|
suffix = (unsigned char *)malloc(totnodes*sizeof(char)); if (!suffix) { free(prefix); return 0; }
|
||||||
|
|
||||||
numnodes = 256; bitcnt = (4<<3); nbits = 8; oneupnbits = (1<<8); hmask = ((oneupnbits>>1)-1);
|
numnodes = 256; bitcnt = (4<<3); nbits = 8; oneupnbits = (1<<8); hmask = ((oneupnbits>>1)-1);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
lptr = (long *)&compbuf[bitcnt>>3]; dat = ((LSWAPIB(lptr[0])>>(bitcnt&7))&(oneupnbits-1));
|
lptr = (long *)&compbuf[bitcnt>>3]; dat = ((LSWAPIB(lptr[0])>>(bitcnt&7))&(oneupnbits-1));
|
||||||
bitcnt += nbits; if ((dat&hmask) > ((numnodes-1)&hmask)) { dat &= hmask; bitcnt--; }
|
bitcnt += nbits; if ((dat&hmask) > ((numnodes-1)&hmask)) { dat &= hmask; bitcnt--; }
|
||||||
|
|
||||||
prefix[numnodes] = dat;
|
prefix[numnodes] = dat;
|
||||||
|
|
||||||
ucompbuf++;
|
ucompbuf++;
|
||||||
for(leng=0;dat>=256;dat=prefix[dat]) {
|
for(leng=0;dat>=256;dat=prefix[dat]) {
|
||||||
if ((long)ucompbuf+leng-ucomp > ucompleng) goto bail;
|
if ((long)ucompbuf+leng-ucomp > ucompleng) goto bail;
|
||||||
ucompbuf[leng++] = suffix[dat];
|
ucompbuf[leng++] = suffix[dat];
|
||||||
}
|
}
|
||||||
|
|
||||||
ucptr = &ucompbuf[leng-1];
|
ucptr = &ucompbuf[leng-1];
|
||||||
for(i=(leng>>1)-1;i>=0;i--) { ch = ucompbuf[i]; ucompbuf[i] = ucptr[-i]; ucptr[-i] = ch; }
|
for(i=(leng>>1)-1;i>=0;i--) { ch = ucompbuf[i]; ucompbuf[i] = ucptr[-i]; ucptr[-i] = ch; }
|
||||||
ucompbuf[-1] = dat; ucompbuf += leng;
|
ucompbuf[-1] = dat; ucompbuf += leng;
|
||||||
|
|
||||||
suffix[numnodes-1] = suffix[numnodes] = dat;
|
suffix[numnodes-1] = suffix[numnodes] = dat;
|
||||||
|
|
||||||
numnodes++; if (numnodes > oneupnbits) { nbits++; oneupnbits <<= 1; hmask = ((oneupnbits>>1)-1); }
|
numnodes++; if (numnodes > oneupnbits) { nbits++; oneupnbits <<= 1; hmask = ((oneupnbits>>1)-1); }
|
||||||
} while (numnodes < totnodes);
|
} while (numnodes < totnodes);
|
||||||
|
|
||||||
bail:
|
bail:
|
||||||
free(suffix); free(prefix);
|
free(suffix); free(prefix);
|
||||||
|
|
||||||
return (long)ucompbuf-ucomp;
|
return (long)ucompbuf-ucomp;
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -53,10 +53,10 @@ static void Decode (UINT4 *, unsigned char *, unsigned int);
|
||||||
#define MD4_memset memset
|
#define MD4_memset memset
|
||||||
|
|
||||||
static unsigned char PADDING[64] = {
|
static unsigned char PADDING[64] = {
|
||||||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
/* F, G and H are basic MD4 functions.
|
/* F, G and H are basic MD4 functions.
|
||||||
*/
|
*/
|
||||||
|
@ -85,25 +85,25 @@ static unsigned char PADDING[64] = {
|
||||||
|
|
||||||
void md4once(unsigned char *block, unsigned int len, unsigned char digest[16])
|
void md4once(unsigned char *block, unsigned int len, unsigned char digest[16])
|
||||||
{
|
{
|
||||||
MD4_CTX ctx;
|
MD4_CTX ctx;
|
||||||
|
|
||||||
md4init(&ctx);
|
md4init(&ctx);
|
||||||
md4block(&ctx, block, len);
|
md4block(&ctx, block, len);
|
||||||
md4finish(digest, &ctx);
|
md4finish(digest, &ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MD4 initialization. Begins an MD4 operation, writing a new context.
|
/* MD4 initialization. Begins an MD4 operation, writing a new context.
|
||||||
*/
|
*/
|
||||||
void md4init (MD4_CTX *context)
|
void md4init (MD4_CTX *context)
|
||||||
{
|
{
|
||||||
context->count[0] = context->count[1] = 0;
|
context->count[0] = context->count[1] = 0;
|
||||||
|
|
||||||
/* Load magic initialization constants.
|
/* Load magic initialization constants.
|
||||||
*/
|
*/
|
||||||
context->state[0] = 0x67452301;
|
context->state[0] = 0x67452301;
|
||||||
context->state[1] = 0xefcdab89;
|
context->state[1] = 0xefcdab89;
|
||||||
context->state[2] = 0x98badcfe;
|
context->state[2] = 0x98badcfe;
|
||||||
context->state[3] = 0x10325476;
|
context->state[3] = 0x10325476;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MD4 block update operation. Continues an MD4 message-digest
|
/* MD4 block update operation. Continues an MD4 message-digest
|
||||||
|
@ -112,35 +112,35 @@ void md4init (MD4_CTX *context)
|
||||||
*/
|
*/
|
||||||
void md4block (MD4_CTX *context, unsigned char *input, unsigned int inputLen)
|
void md4block (MD4_CTX *context, unsigned char *input, unsigned int inputLen)
|
||||||
{
|
{
|
||||||
unsigned int i, index, partLen;
|
unsigned int i, index, partLen;
|
||||||
|
|
||||||
/* Compute number of bytes mod 64 */
|
/* Compute number of bytes mod 64 */
|
||||||
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
|
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
|
||||||
/* Update number of bits */
|
/* Update number of bits */
|
||||||
if ((context->count[0] += ((UINT4)inputLen << 3))
|
if ((context->count[0] += ((UINT4)inputLen << 3))
|
||||||
< ((UINT4)inputLen << 3))
|
< ((UINT4)inputLen << 3))
|
||||||
context->count[1]++;
|
context->count[1]++;
|
||||||
context->count[1] += ((UINT4)inputLen >> 29);
|
context->count[1] += ((UINT4)inputLen >> 29);
|
||||||
|
|
||||||
partLen = 64 - index;
|
partLen = 64 - index;
|
||||||
|
|
||||||
/* Transform as many times as possible.
|
/* Transform as many times as possible.
|
||||||
*/
|
*/
|
||||||
if (inputLen >= partLen) {
|
if (inputLen >= partLen) {
|
||||||
|
MD4_memcpy
|
||||||
|
((POINTER)&context->buffer[index], (POINTER)input, partLen);
|
||||||
|
MD4Transform (context->state, context->buffer);
|
||||||
|
|
||||||
|
for (i = partLen; i + 63 < inputLen; i += 64)
|
||||||
|
MD4Transform (context->state, &input[i]);
|
||||||
|
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
/* Buffer remaining input */
|
||||||
MD4_memcpy
|
MD4_memcpy
|
||||||
((POINTER)&context->buffer[index], (POINTER)input, partLen);
|
|
||||||
MD4Transform (context->state, context->buffer);
|
|
||||||
|
|
||||||
for (i = partLen; i + 63 < inputLen; i += 64)
|
|
||||||
MD4Transform (context->state, &input[i]);
|
|
||||||
|
|
||||||
index = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
i = 0;
|
|
||||||
|
|
||||||
/* Buffer remaining input */
|
|
||||||
MD4_memcpy
|
|
||||||
((POINTER)&context->buffer[index], (POINTER)&input[i],
|
((POINTER)&context->buffer[index], (POINTER)&input[i],
|
||||||
inputLen-i);
|
inputLen-i);
|
||||||
}
|
}
|
||||||
|
@ -150,98 +150,98 @@ void md4block (MD4_CTX *context, unsigned char *input, unsigned int inputLen)
|
||||||
*/
|
*/
|
||||||
void md4finish (unsigned char digest[16], MD4_CTX *context)
|
void md4finish (unsigned char digest[16], MD4_CTX *context)
|
||||||
{
|
{
|
||||||
unsigned char bits[8];
|
unsigned char bits[8];
|
||||||
unsigned int index, padLen;
|
unsigned int index, padLen;
|
||||||
|
|
||||||
/* Save number of bits */
|
/* Save number of bits */
|
||||||
Encode (bits, context->count, 8);
|
Encode (bits, context->count, 8);
|
||||||
|
|
||||||
/* Pad out to 56 mod 64.
|
/* Pad out to 56 mod 64.
|
||||||
*/
|
*/
|
||||||
index = (unsigned int)((context->count[0] >> 3) & 0x3f);
|
index = (unsigned int)((context->count[0] >> 3) & 0x3f);
|
||||||
padLen = (index < 56) ? (56 - index) : (120 - index);
|
padLen = (index < 56) ? (56 - index) : (120 - index);
|
||||||
md4block (context, PADDING, padLen);
|
md4block (context, PADDING, padLen);
|
||||||
|
|
||||||
/* Append length (before padding) */
|
/* Append length (before padding) */
|
||||||
md4block (context, bits, 8);
|
md4block (context, bits, 8);
|
||||||
/* Store state in digest */
|
/* Store state in digest */
|
||||||
Encode (digest, context->state, 16);
|
Encode (digest, context->state, 16);
|
||||||
|
|
||||||
/* Zeroize sensitive information.
|
/* Zeroize sensitive information.
|
||||||
*/
|
*/
|
||||||
MD4_memset ((POINTER)context, 0, sizeof (*context));
|
MD4_memset ((POINTER)context, 0, sizeof (*context));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MD4 basic transformation. Transforms state based on block.
|
/* MD4 basic transformation. Transforms state based on block.
|
||||||
*/
|
*/
|
||||||
static void MD4Transform (UINT4 state[4], unsigned char block[64])
|
static void MD4Transform (UINT4 state[4], unsigned char block[64])
|
||||||
{
|
{
|
||||||
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
|
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
|
||||||
|
|
||||||
Decode (x, block, 64);
|
Decode (x, block, 64);
|
||||||
|
|
||||||
/* Round 1 */
|
/* Round 1 */
|
||||||
FF (a, b, c, d, x[ 0], S11); /* 1 */
|
FF (a, b, c, d, x[ 0], S11); /* 1 */
|
||||||
FF (d, a, b, c, x[ 1], S12); /* 2 */
|
FF (d, a, b, c, x[ 1], S12); /* 2 */
|
||||||
FF (c, d, a, b, x[ 2], S13); /* 3 */
|
FF (c, d, a, b, x[ 2], S13); /* 3 */
|
||||||
FF (b, c, d, a, x[ 3], S14); /* 4 */
|
FF (b, c, d, a, x[ 3], S14); /* 4 */
|
||||||
FF (a, b, c, d, x[ 4], S11); /* 5 */
|
FF (a, b, c, d, x[ 4], S11); /* 5 */
|
||||||
FF (d, a, b, c, x[ 5], S12); /* 6 */
|
FF (d, a, b, c, x[ 5], S12); /* 6 */
|
||||||
FF (c, d, a, b, x[ 6], S13); /* 7 */
|
FF (c, d, a, b, x[ 6], S13); /* 7 */
|
||||||
FF (b, c, d, a, x[ 7], S14); /* 8 */
|
FF (b, c, d, a, x[ 7], S14); /* 8 */
|
||||||
FF (a, b, c, d, x[ 8], S11); /* 9 */
|
FF (a, b, c, d, x[ 8], S11); /* 9 */
|
||||||
FF (d, a, b, c, x[ 9], S12); /* 10 */
|
FF (d, a, b, c, x[ 9], S12); /* 10 */
|
||||||
FF (c, d, a, b, x[10], S13); /* 11 */
|
FF (c, d, a, b, x[10], S13); /* 11 */
|
||||||
FF (b, c, d, a, x[11], S14); /* 12 */
|
FF (b, c, d, a, x[11], S14); /* 12 */
|
||||||
FF (a, b, c, d, x[12], S11); /* 13 */
|
FF (a, b, c, d, x[12], S11); /* 13 */
|
||||||
FF (d, a, b, c, x[13], S12); /* 14 */
|
FF (d, a, b, c, x[13], S12); /* 14 */
|
||||||
FF (c, d, a, b, x[14], S13); /* 15 */
|
FF (c, d, a, b, x[14], S13); /* 15 */
|
||||||
FF (b, c, d, a, x[15], S14); /* 16 */
|
FF (b, c, d, a, x[15], S14); /* 16 */
|
||||||
|
|
||||||
/* Round 2 */
|
/* Round 2 */
|
||||||
GG (a, b, c, d, x[ 0], S21); /* 17 */
|
GG (a, b, c, d, x[ 0], S21); /* 17 */
|
||||||
GG (d, a, b, c, x[ 4], S22); /* 18 */
|
GG (d, a, b, c, x[ 4], S22); /* 18 */
|
||||||
GG (c, d, a, b, x[ 8], S23); /* 19 */
|
GG (c, d, a, b, x[ 8], S23); /* 19 */
|
||||||
GG (b, c, d, a, x[12], S24); /* 20 */
|
GG (b, c, d, a, x[12], S24); /* 20 */
|
||||||
GG (a, b, c, d, x[ 1], S21); /* 21 */
|
GG (a, b, c, d, x[ 1], S21); /* 21 */
|
||||||
GG (d, a, b, c, x[ 5], S22); /* 22 */
|
GG (d, a, b, c, x[ 5], S22); /* 22 */
|
||||||
GG (c, d, a, b, x[ 9], S23); /* 23 */
|
GG (c, d, a, b, x[ 9], S23); /* 23 */
|
||||||
GG (b, c, d, a, x[13], S24); /* 24 */
|
GG (b, c, d, a, x[13], S24); /* 24 */
|
||||||
GG (a, b, c, d, x[ 2], S21); /* 25 */
|
GG (a, b, c, d, x[ 2], S21); /* 25 */
|
||||||
GG (d, a, b, c, x[ 6], S22); /* 26 */
|
GG (d, a, b, c, x[ 6], S22); /* 26 */
|
||||||
GG (c, d, a, b, x[10], S23); /* 27 */
|
GG (c, d, a, b, x[10], S23); /* 27 */
|
||||||
GG (b, c, d, a, x[14], S24); /* 28 */
|
GG (b, c, d, a, x[14], S24); /* 28 */
|
||||||
GG (a, b, c, d, x[ 3], S21); /* 29 */
|
GG (a, b, c, d, x[ 3], S21); /* 29 */
|
||||||
GG (d, a, b, c, x[ 7], S22); /* 30 */
|
GG (d, a, b, c, x[ 7], S22); /* 30 */
|
||||||
GG (c, d, a, b, x[11], S23); /* 31 */
|
GG (c, d, a, b, x[11], S23); /* 31 */
|
||||||
GG (b, c, d, a, x[15], S24); /* 32 */
|
GG (b, c, d, a, x[15], S24); /* 32 */
|
||||||
|
|
||||||
/* Round 3 */
|
/* Round 3 */
|
||||||
HH (a, b, c, d, x[ 0], S31); /* 33 */
|
HH (a, b, c, d, x[ 0], S31); /* 33 */
|
||||||
HH (d, a, b, c, x[ 8], S32); /* 34 */
|
HH (d, a, b, c, x[ 8], S32); /* 34 */
|
||||||
HH (c, d, a, b, x[ 4], S33); /* 35 */
|
HH (c, d, a, b, x[ 4], S33); /* 35 */
|
||||||
HH (b, c, d, a, x[12], S34); /* 36 */
|
HH (b, c, d, a, x[12], S34); /* 36 */
|
||||||
HH (a, b, c, d, x[ 2], S31); /* 37 */
|
HH (a, b, c, d, x[ 2], S31); /* 37 */
|
||||||
HH (d, a, b, c, x[10], S32); /* 38 */
|
HH (d, a, b, c, x[10], S32); /* 38 */
|
||||||
HH (c, d, a, b, x[ 6], S33); /* 39 */
|
HH (c, d, a, b, x[ 6], S33); /* 39 */
|
||||||
HH (b, c, d, a, x[14], S34); /* 40 */
|
HH (b, c, d, a, x[14], S34); /* 40 */
|
||||||
HH (a, b, c, d, x[ 1], S31); /* 41 */
|
HH (a, b, c, d, x[ 1], S31); /* 41 */
|
||||||
HH (d, a, b, c, x[ 9], S32); /* 42 */
|
HH (d, a, b, c, x[ 9], S32); /* 42 */
|
||||||
HH (c, d, a, b, x[ 5], S33); /* 43 */
|
HH (c, d, a, b, x[ 5], S33); /* 43 */
|
||||||
HH (b, c, d, a, x[13], S34); /* 44 */
|
HH (b, c, d, a, x[13], S34); /* 44 */
|
||||||
HH (a, b, c, d, x[ 3], S31); /* 45 */
|
HH (a, b, c, d, x[ 3], S31); /* 45 */
|
||||||
HH (d, a, b, c, x[11], S32); /* 46 */
|
HH (d, a, b, c, x[11], S32); /* 46 */
|
||||||
HH (c, d, a, b, x[ 7], S33); /* 47 */
|
HH (c, d, a, b, x[ 7], S33); /* 47 */
|
||||||
HH (b, c, d, a, x[15], S34); /* 48 */
|
HH (b, c, d, a, x[15], S34); /* 48 */
|
||||||
|
|
||||||
state[0] += a;
|
state[0] += a;
|
||||||
state[1] += b;
|
state[1] += b;
|
||||||
state[2] += c;
|
state[2] += c;
|
||||||
state[3] += d;
|
state[3] += d;
|
||||||
|
|
||||||
/* Zeroize sensitive information.
|
/* Zeroize sensitive information.
|
||||||
*/
|
*/
|
||||||
MD4_memset ((POINTER)x, 0, sizeof (x));
|
MD4_memset ((POINTER)x, 0, sizeof (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
|
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
|
||||||
|
@ -249,14 +249,14 @@ static void MD4Transform (UINT4 state[4], unsigned char block[64])
|
||||||
*/
|
*/
|
||||||
static void Encode (unsigned char *output, UINT4 *input, unsigned int len)
|
static void Encode (unsigned char *output, UINT4 *input, unsigned int len)
|
||||||
{
|
{
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
|
||||||
for (i = 0, j = 0; j < len; i++, j += 4) {
|
for (i = 0, j = 0; j < len; i++, j += 4) {
|
||||||
output[j] = (unsigned char)(input[i] & 0xff);
|
output[j] = (unsigned char)(input[i] & 0xff);
|
||||||
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
|
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
|
||||||
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
|
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
|
||||||
output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
|
output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
|
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
|
||||||
|
@ -264,9 +264,9 @@ static void Encode (unsigned char *output, UINT4 *input, unsigned int len)
|
||||||
*/
|
*/
|
||||||
static void Decode (UINT4 *output, unsigned char *input, unsigned int len)
|
static void Decode (UINT4 *output, unsigned char *input, unsigned int len)
|
||||||
{
|
{
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
|
||||||
for (i = 0, j = 0; j < len; i++, j += 4)
|
for (i = 0, j = 0; j < len; i++, j += 4)
|
||||||
output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
|
output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
|
||||||
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
|
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -29,13 +29,13 @@
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
static long GetTickCount(void)
|
static long GetTickCount(void)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
long ti;
|
long ti;
|
||||||
if (gettimeofday(&tv,NULL) < 0) return 0;
|
if (gettimeofday(&tv,NULL) < 0) return 0;
|
||||||
// tv is sec.usec, GTC gives msec
|
// tv is sec.usec, GTC gives msec
|
||||||
ti = tv.tv_sec * 1000;
|
ti = tv.tv_sec * 1000;
|
||||||
ti += tv.tv_usec / 1000;
|
ti += tv.tv_usec / 1000;
|
||||||
return ti;
|
return ti;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -79,113 +79,113 @@ static long snatchip = 0, snatchport = 0, danetmode = 255, netready = 0;
|
||||||
|
|
||||||
void netuninit ()
|
void netuninit ()
|
||||||
{
|
{
|
||||||
if (mysock != (SOCKET)INVALID_HANDLE_VALUE) closesocket(mysock);
|
if (mysock != (SOCKET)INVALID_HANDLE_VALUE) closesocket(mysock);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
long netinit (long portnum)
|
long netinit (long portnum)
|
||||||
{
|
{
|
||||||
LPHOSTENT lpHostEnt;
|
LPHOSTENT lpHostEnt;
|
||||||
char hostnam[256];
|
char hostnam[256];
|
||||||
struct sockaddr_in ip;
|
struct sockaddr_in ip;
|
||||||
long i;
|
long i;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
WSADATA ws;
|
WSADATA ws;
|
||||||
|
|
||||||
if (WSAStartup(0x101,&ws) == SOCKET_ERROR) return(0);
|
if (WSAStartup(0x101,&ws) == SOCKET_ERROR) return(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mysock = socket(AF_INET,SOCK_DGRAM,0); if (mysock == INVALID_SOCKET) return(0);
|
mysock = socket(AF_INET,SOCK_DGRAM,0); if (mysock == INVALID_SOCKET) return(0);
|
||||||
#ifdef __BEOS__
|
#ifdef __BEOS__
|
||||||
i = 1; if (setsockopt(mysock,SOL_SOCKET,SO_NONBLOCK,&i,sizeof(i)) < 0) return(0);
|
i = 1; if (setsockopt(mysock,SOL_SOCKET,SO_NONBLOCK,&i,sizeof(i)) < 0) return(0);
|
||||||
#else
|
#else
|
||||||
i = 1; if (ioctlsocket(mysock,FIONBIO,(unsigned long *)&i) == SOCKET_ERROR) return(0);
|
i = 1; if (ioctlsocket(mysock,FIONBIO,(unsigned long *)&i) == SOCKET_ERROR) return(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ip.sin_family = AF_INET;
|
ip.sin_family = AF_INET;
|
||||||
ip.sin_addr.s_addr = INADDR_ANY;
|
ip.sin_addr.s_addr = INADDR_ANY;
|
||||||
ip.sin_port = htons(portnum);
|
ip.sin_port = htons(portnum);
|
||||||
if (bind(mysock,(struct sockaddr *)&ip,sizeof(ip)) != SOCKET_ERROR)
|
if (bind(mysock,(struct sockaddr *)&ip,sizeof(ip)) != SOCKET_ERROR)
|
||||||
{
|
{
|
||||||
myport = portnum;
|
myport = portnum;
|
||||||
if (gethostname(hostnam,sizeof(hostnam)) != SOCKET_ERROR)
|
if (gethostname(hostnam,sizeof(hostnam)) != SOCKET_ERROR)
|
||||||
if ((lpHostEnt = gethostbyname(hostnam)))
|
if ((lpHostEnt = gethostbyname(hostnam)))
|
||||||
{
|
{
|
||||||
myip = ip.sin_addr.s_addr = *(long *)lpHostEnt->h_addr;
|
myip = ip.sin_addr.s_addr = *(long *)lpHostEnt->h_addr;
|
||||||
printf("mmulti: This machine's IP is %s\n", inet_ntoa(ip.sin_addr));
|
printf("mmulti: This machine's IP is %s\n", inet_ntoa(ip.sin_addr));
|
||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
long netsend (long other, char *dabuf, long bufsiz) //0:buffer full... can't send
|
long netsend (long other, char *dabuf, long bufsiz) //0:buffer full... can't send
|
||||||
{
|
{
|
||||||
struct sockaddr_in ip;
|
struct sockaddr_in ip;
|
||||||
|
|
||||||
if (!otherip[other]) return(0);
|
if (!otherip[other]) return(0);
|
||||||
ip.sin_family = AF_INET;
|
ip.sin_family = AF_INET;
|
||||||
ip.sin_addr.s_addr = otherip[other];
|
ip.sin_addr.s_addr = otherip[other];
|
||||||
ip.sin_port = otherport[other];
|
ip.sin_port = otherport[other];
|
||||||
return(sendto(mysock,dabuf,bufsiz,0,(struct sockaddr *)&ip,sizeof(struct sockaddr_in)) != SOCKET_ERROR);
|
return(sendto(mysock,dabuf,bufsiz,0,(struct sockaddr *)&ip,sizeof(struct sockaddr_in)) != SOCKET_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
long netread (long *other, char *dabuf, long bufsiz) //0:no packets in buffer
|
long netread (long *other, char *dabuf, long bufsiz) //0:no packets in buffer
|
||||||
{
|
{
|
||||||
struct sockaddr_in ip;
|
struct sockaddr_in ip;
|
||||||
long i;
|
long i;
|
||||||
|
|
||||||
i = sizeof(ip);
|
i = sizeof(ip);
|
||||||
if (recvfrom(mysock,dabuf,bufsiz,0,(struct sockaddr *)&ip,(int *)&i) == -1) return(0);
|
if (recvfrom(mysock,dabuf,bufsiz,0,(struct sockaddr *)&ip,(int *)&i) == -1) return(0);
|
||||||
#if (SIMMIS > 0)
|
#if (SIMMIS > 0)
|
||||||
if ((rand()&255) < SIMMIS) return(0);
|
if ((rand()&255) < SIMMIS) return(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
snatchip = (long)ip.sin_addr.s_addr; snatchport = (long)ip.sin_port;
|
snatchip = (long)ip.sin_addr.s_addr; snatchport = (long)ip.sin_port;
|
||||||
|
|
||||||
(*other) = myconnectindex;
|
(*other) = myconnectindex;
|
||||||
for(i=0;i<MAXPLAYERS;i++)
|
for(i=0;i<MAXPLAYERS;i++)
|
||||||
if ((otherip[i] == snatchip) && (otherport[i] == snatchport))
|
if ((otherip[i] == snatchip) && (otherport[i] == snatchport))
|
||||||
{ (*other) = i; break; }
|
{ (*other) = i; break; }
|
||||||
#if (SIMLAG > 1)
|
#if (SIMLAG > 1)
|
||||||
i = simlagcnt[*other]%(SIMLAG+1);
|
i = simlagcnt[*other]%(SIMLAG+1);
|
||||||
*(short *)&simlagfif[*other][i][0] = bufsiz; memcpy(&simlagfif[*other][i][2],dabuf,bufsiz);
|
*(short *)&simlagfif[*other][i][0] = bufsiz; memcpy(&simlagfif[*other][i][2],dabuf,bufsiz);
|
||||||
simlagcnt[*other]++; if (simlagcnt[*other] < SIMLAG+1) return(0);
|
simlagcnt[*other]++; if (simlagcnt[*other] < SIMLAG+1) return(0);
|
||||||
i = simlagcnt[*other]%(SIMLAG+1);
|
i = simlagcnt[*other]%(SIMLAG+1);
|
||||||
bufsiz = *(short *)&simlagfif[*other][i][0]; memcpy(dabuf,&simlagfif[*other][i][2],bufsiz);
|
bufsiz = *(short *)&simlagfif[*other][i][0]; memcpy(dabuf,&simlagfif[*other][i][2],bufsiz);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
long isvalidipaddress (char *st)
|
long isvalidipaddress (char *st)
|
||||||
{
|
{
|
||||||
long i, bcnt, num;
|
long i, bcnt, num;
|
||||||
|
|
||||||
bcnt = 0; num = 0;
|
bcnt = 0; num = 0;
|
||||||
for(i=0;st[i];i++)
|
for(i=0;st[i];i++)
|
||||||
{
|
{
|
||||||
if (st[i] == '.') { bcnt++; num = 0; continue; }
|
if (st[i] == '.') { bcnt++; num = 0; continue; }
|
||||||
if (st[i] == ':')
|
if (st[i] == ':')
|
||||||
{
|
{
|
||||||
if (bcnt != 3) return(0);
|
if (bcnt != 3) return(0);
|
||||||
num = 0;
|
num = 0;
|
||||||
for(i++;st[i];i++)
|
for(i++;st[i];i++)
|
||||||
{
|
{
|
||||||
if ((st[i] >= '0') && (st[i] <= '9'))
|
if ((st[i] >= '0') && (st[i] <= '9'))
|
||||||
{ num = num*10+st[i]-'0'; if (num >= 65536) return(0); }
|
{ num = num*10+st[i]-'0'; if (num >= 65536) return(0); }
|
||||||
else return(0);
|
else return(0);
|
||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
if ((st[i] >= '0') && (st[i] <= '9'))
|
if ((st[i] >= '0') && (st[i] <= '9'))
|
||||||
{ num = num*10+st[i]-'0'; if (num >= 256) return(0); }
|
{ num = num*10+st[i]-'0'; if (num >= 256) return(0); }
|
||||||
|
|
||||||
}
|
}
|
||||||
return(bcnt == 3);
|
return(bcnt == 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------- Obsolete variables&functions ----------------------------------
|
//---------------------------------- Obsolete variables&functions ----------------------------------
|
||||||
|
@ -202,25 +202,25 @@ void sendlogoff () {}
|
||||||
static long crctab16[256];
|
static long crctab16[256];
|
||||||
static void initcrc16 ()
|
static void initcrc16 ()
|
||||||
{
|
{
|
||||||
long i, j, k, a;
|
long i, j, k, a;
|
||||||
for(j=0;j<256;j++)
|
for(j=0;j<256;j++)
|
||||||
{
|
{
|
||||||
for(i=7,k=(j<<8),a=0;i>=0;i--,k=((k<<1)&65535))
|
for(i=7,k=(j<<8),a=0;i>=0;i--,k=((k<<1)&65535))
|
||||||
{
|
{
|
||||||
if ((k^a)&0x8000) a = ((a<<1)&65535)^0x1021;
|
if ((k^a)&0x8000) a = ((a<<1)&65535)^0x1021;
|
||||||
else a = ((a<<1)&65535);
|
else a = ((a<<1)&65535);
|
||||||
}
|
}
|
||||||
crctab16[j] = (a&65535);
|
crctab16[j] = (a&65535);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#define updatecrc16(crc,dat) crc = (((crc<<8)&65535)^crctab16[((((unsigned short)crc)>>8)&65535)^dat])
|
#define updatecrc16(crc,dat) crc = (((crc<<8)&65535)^crctab16[((((unsigned short)crc)>>8)&65535)^dat])
|
||||||
static unsigned short getcrc16 (char *buffer, long bufleng)
|
static unsigned short getcrc16 (char *buffer, long bufleng)
|
||||||
{
|
{
|
||||||
long i, j;
|
long i, j;
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
for(i=bufleng-1;i>=0;i--) updatecrc16(j,buffer[i]);
|
for(i=bufleng-1;i>=0;i--) updatecrc16(j,buffer[i]);
|
||||||
return((unsigned short)(j&65535));
|
return((unsigned short)(j&65535));
|
||||||
}
|
}
|
||||||
|
|
||||||
void uninitmultiplayers () { netuninit(); }
|
void uninitmultiplayers () { netuninit(); }
|
||||||
|
@ -228,145 +228,145 @@ void uninitmultiplayers () { netuninit(); }
|
||||||
long getpacket(long *, char *);
|
long getpacket(long *, char *);
|
||||||
static void initmultiplayers_reset(void)
|
static void initmultiplayers_reset(void)
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
|
|
||||||
initcrc16();
|
initcrc16();
|
||||||
memset(icnt0,0,sizeof(icnt0));
|
memset(icnt0,0,sizeof(icnt0));
|
||||||
memset(ocnt0,0,sizeof(ocnt0));
|
memset(ocnt0,0,sizeof(ocnt0));
|
||||||
memset(ocnt1,0,sizeof(ocnt1));
|
memset(ocnt1,0,sizeof(ocnt1));
|
||||||
memset(ipak,0,sizeof(ipak));
|
memset(ipak,0,sizeof(ipak));
|
||||||
//memset(opak,0,sizeof(opak)); //Don't need to init opak
|
//memset(opak,0,sizeof(opak)); //Don't need to init opak
|
||||||
//memset(pakmem,0,sizeof(pakmem)); //Don't need to init pakmem
|
//memset(pakmem,0,sizeof(pakmem)); //Don't need to init pakmem
|
||||||
#if (SIMLAG > 1)
|
#if (SIMLAG > 1)
|
||||||
memset(simlagcnt,0,sizeof(simlagcnt));
|
memset(simlagcnt,0,sizeof(simlagcnt));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lastsendtims[0] = GetTickCount();
|
lastsendtims[0] = GetTickCount();
|
||||||
for(i=1;i<MAXPLAYERS;i++) lastsendtims[i] = lastsendtims[0];
|
for(i=1;i<MAXPLAYERS;i++) lastsendtims[i] = lastsendtims[0];
|
||||||
numplayers = 1; myconnectindex = 0;
|
numplayers = 1; myconnectindex = 0;
|
||||||
|
|
||||||
memset(otherip,0,sizeof(otherip));
|
memset(otherip,0,sizeof(otherip));
|
||||||
for(i=0;i<MAXPLAYERS;i++) otherport[i] = htons(NETPORT);
|
for(i=0;i<MAXPLAYERS;i++) otherport[i] = htons(NETPORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Multiplayer command line summary. Assume myconnectindex always = 0 for 192.168.1.2
|
// Multiplayer command line summary. Assume myconnectindex always = 0 for 192.168.1.2
|
||||||
//
|
//
|
||||||
// /n0 (mast/slav) 2 player: 3 player:
|
// /n0 (mast/slav) 2 player: 3 player:
|
||||||
// 192.168.1.2 game /n0 game /n0:3
|
// 192.168.1.2 game /n0 game /n0:3
|
||||||
// 192.168.1.100 game /n0 192.168.1.2 game /n0 192.168.1.2
|
// 192.168.1.100 game /n0 192.168.1.2 game /n0 192.168.1.2
|
||||||
// 192.168.1.4 game /n0 192.168.1.2
|
// 192.168.1.4 game /n0 192.168.1.2
|
||||||
//
|
//
|
||||||
// /n1 (peer-peer) 2 player: 3 player:
|
// /n1 (peer-peer) 2 player: 3 player:
|
||||||
// 192.168.1.2 game /n1 192.168.1.100 game /n1 192.168.1.100 192.168.1.4
|
// 192.168.1.2 game /n1 192.168.1.100 game /n1 192.168.1.100 192.168.1.4
|
||||||
// 192.168.1.100 game 192.168.1.2 /n1 game 192.168.1.2 /n1 192.168.1.4
|
// 192.168.1.100 game 192.168.1.2 /n1 game 192.168.1.2 /n1 192.168.1.4
|
||||||
// 192.168.1.4 game 192.168.1.2 192.168.1.100 /n1
|
// 192.168.1.4 game 192.168.1.2 192.168.1.100 /n1
|
||||||
long initmultiplayersparms(long argc, char **argv)
|
long initmultiplayersparms(long argc, char **argv)
|
||||||
{
|
{
|
||||||
long i, j, daindex, portnum = NETPORT;
|
long i, j, daindex, portnum = NETPORT;
|
||||||
char *st;
|
char *st;
|
||||||
|
|
||||||
initmultiplayers_reset();
|
initmultiplayers_reset();
|
||||||
danetmode = 255; daindex = 0;
|
danetmode = 255; daindex = 0;
|
||||||
|
|
||||||
// go looking for the port, if specified
|
// go looking for the port, if specified
|
||||||
for (i=0;i<argc;i++) {
|
for (i=0;i<argc;i++) {
|
||||||
if (argv[i][0] != '-' && argv[i][0] != '/') continue;
|
if (argv[i][0] != '-' && argv[i][0] != '/') continue;
|
||||||
if ((argv[i][1] == 'p' || argv[i][1] == 'P') && argv[i][2]) {
|
if ((argv[i][1] == 'p' || argv[i][1] == 'P') && argv[i][2]) {
|
||||||
char *p;
|
char *p;
|
||||||
j = strtol(argv[i]+2, &p, 10);
|
j = strtol(argv[i]+2, &p, 10);
|
||||||
if (!(*p) && j > 1024 && j<65535) portnum = j;
|
if (!(*p) && j > 1024 && j<65535) portnum = j;
|
||||||
|
|
||||||
printf("mmulti: Using port %ld\n", portnum);
|
printf("mmulti: Using port %ld\n", portnum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
netinit(portnum);
|
netinit(portnum);
|
||||||
|
|
||||||
for(i=0;i<argc;i++)
|
for(i=0;i<argc;i++)
|
||||||
{
|
{
|
||||||
//if (((argv[i][0] == '/') || (argv[i][0] == '-')) &&
|
//if (((argv[i][0] == '/') || (argv[i][0] == '-')) &&
|
||||||
// ((argv[i][1] == 'N') || (argv[i][1] == 'n')) &&
|
// ((argv[i][1] == 'N') || (argv[i][1] == 'n')) &&
|
||||||
// ((argv[i][2] == 'E') || (argv[i][2] == 'e')) &&
|
// ((argv[i][2] == 'E') || (argv[i][2] == 'e')) &&
|
||||||
// ((argv[i][3] == 'T') || (argv[i][3] == 't')) &&
|
// ((argv[i][3] == 'T') || (argv[i][3] == 't')) &&
|
||||||
// (!argv[i][4]))
|
// (!argv[i][4]))
|
||||||
// { foundnet = 1; continue; }
|
// { foundnet = 1; continue; }
|
||||||
//if (!foundnet) continue;
|
//if (!foundnet) continue;
|
||||||
|
|
||||||
if ((argv[i][0] == '-') || (argv[i][0] == '/')) {
|
if ((argv[i][0] == '-') || (argv[i][0] == '/')) {
|
||||||
if ((argv[i][1] == 'N') || (argv[i][1] == 'n') || (argv[i][1] == 'I') || (argv[i][1] == 'i'))
|
if ((argv[i][1] == 'N') || (argv[i][1] == 'n') || (argv[i][1] == 'I') || (argv[i][1] == 'i'))
|
||||||
{
|
{
|
||||||
numplayers = 2;
|
numplayers = 2;
|
||||||
if (argv[i][2] == '0')
|
if (argv[i][2] == '0')
|
||||||
{
|
{
|
||||||
danetmode = 0;
|
danetmode = 0;
|
||||||
if ((argv[i][3] == ':') && (argv[i][4] >= '0') && (argv[i][4] <= '9'))
|
if ((argv[i][3] == ':') && (argv[i][4] >= '0') && (argv[i][4] <= '9'))
|
||||||
{
|
{
|
||||||
numplayers = (argv[i][4]-'0');
|
numplayers = (argv[i][4]-'0');
|
||||||
if ((argv[i][5] >= '0') && (argv[i][5] <= '9')) numplayers = numplayers*10+(argv[i][5]-'0');
|
if ((argv[i][5] >= '0') && (argv[i][5] <= '9')) numplayers = numplayers*10+(argv[i][5]-'0');
|
||||||
printf("mmulti: %ld-player game\n", numplayers);
|
printf("mmulti: %ld-player game\n", numplayers);
|
||||||
}
|
}
|
||||||
printf("mmulti: Master-slave mode\n");
|
printf("mmulti: Master-slave mode\n");
|
||||||
}
|
}
|
||||||
else if (argv[i][2] == '1')
|
else if (argv[i][2] == '1')
|
||||||
{
|
{
|
||||||
danetmode = 1;
|
danetmode = 1;
|
||||||
myconnectindex = daindex; daindex++;
|
myconnectindex = daindex; daindex++;
|
||||||
printf("mmulti: Peer-to-peer mode\n");
|
printf("mmulti: Peer-to-peer mode\n");
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if ((argv[i][1] == 'P') || (argv[i][1] == 'p')) continue;
|
else if ((argv[i][1] == 'P') || (argv[i][1] == 'p')) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
st = strdup(argv[i]); if (!st) break;
|
st = strdup(argv[i]); if (!st) break;
|
||||||
if (isvalidipaddress(st))
|
if (isvalidipaddress(st))
|
||||||
{
|
{
|
||||||
if ((danetmode == 1) && (daindex == myconnectindex)) daindex++;
|
if ((danetmode == 1) && (daindex == myconnectindex)) daindex++;
|
||||||
for(j=0;st[j];j++) {
|
for(j=0;st[j];j++) {
|
||||||
if (st[j] == ':')
|
if (st[j] == ':')
|
||||||
{ otherport[daindex] = htons((unsigned short)atol(&st[j+1])); st[j] = 0; break; }
|
{ otherport[daindex] = htons((unsigned short)atol(&st[j+1])); st[j] = 0; break; }
|
||||||
}
|
}
|
||||||
otherip[daindex] = inet_addr(st);
|
otherip[daindex] = inet_addr(st);
|
||||||
printf("mmulti: Player %ld at %s:%d\n",daindex,st,ntohs(otherport[daindex]));
|
printf("mmulti: Player %ld at %s:%d\n",daindex,st,ntohs(otherport[daindex]));
|
||||||
daindex++;
|
daindex++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LPHOSTENT lph;
|
LPHOSTENT lph;
|
||||||
unsigned short pt = htons(NETPORT);
|
unsigned short pt = htons(NETPORT);
|
||||||
|
|
||||||
for(j=0;st[j];j++)
|
for(j=0;st[j];j++)
|
||||||
if (st[j] == ':')
|
if (st[j] == ':')
|
||||||
{ pt = htons((unsigned short)atol(&st[j+1])); st[j] = 0; break; }
|
{ pt = htons((unsigned short)atol(&st[j+1])); st[j] = 0; break; }
|
||||||
if ((lph = gethostbyname(st)))
|
if ((lph = gethostbyname(st)))
|
||||||
{
|
{
|
||||||
if ((danetmode == 1) && (daindex == myconnectindex)) daindex++;
|
if ((danetmode == 1) && (daindex == myconnectindex)) daindex++;
|
||||||
otherip[daindex] = *(long *)lph->h_addr;
|
otherip[daindex] = *(long *)lph->h_addr;
|
||||||
otherport[daindex] = pt;
|
otherport[daindex] = pt;
|
||||||
printf("mmulti: Player %ld at %s:%d (%s)\n",daindex,
|
printf("mmulti: Player %ld at %s:%d (%s)\n",daindex,
|
||||||
inet_ntoa(*(struct in_addr *)lph->h_addr),ntohs(pt),argv[i]);
|
inet_ntoa(*(struct in_addr *)lph->h_addr),ntohs(pt),argv[i]);
|
||||||
daindex++;
|
daindex++;
|
||||||
} else printf("mmulti: Failed resolving %s\n",argv[i]);
|
} else printf("mmulti: Failed resolving %s\n",argv[i]);
|
||||||
}
|
}
|
||||||
free(st);
|
free(st);
|
||||||
}
|
}
|
||||||
if ((danetmode == 255) && (daindex)) { numplayers = 2; danetmode = 0; } //an IP w/o /n# defaults to /n0
|
if ((danetmode == 255) && (daindex)) { numplayers = 2; danetmode = 0; } //an IP w/o /n# defaults to /n0
|
||||||
if ((numplayers >= 2) && (daindex) && (!danetmode)) myconnectindex = 1;
|
if ((numplayers >= 2) && (daindex) && (!danetmode)) myconnectindex = 1;
|
||||||
if (daindex > numplayers) numplayers = daindex;
|
if (daindex > numplayers) numplayers = daindex;
|
||||||
|
|
||||||
//for(i=0;i<numplayers;i++)
|
//for(i=0;i<numplayers;i++)
|
||||||
// printf("Player %d: %d.%d.%d.%d:%d\n",i,otherip[i]&255,(otherip[i]>>8)&255,(otherip[i]>>16)&255,((unsigned long)otherip[i])>>24,ntohs(otherport[i]));
|
// printf("Player %d: %d.%d.%d.%d:%d\n",i,otherip[i]&255,(otherip[i]>>8)&255,(otherip[i]>>16)&255,((unsigned long)otherip[i])>>24,ntohs(otherport[i]));
|
||||||
|
|
||||||
connecthead = 0;
|
connecthead = 0;
|
||||||
for(i=0;i<numplayers-1;i++) connectpoint2[i] = i+1;
|
for(i=0;i<numplayers-1;i++) connectpoint2[i] = i+1;
|
||||||
connectpoint2[numplayers-1] = -1;
|
connectpoint2[numplayers-1] = -1;
|
||||||
|
|
||||||
return (((!danetmode) && (numplayers >= 2)) || (numplayers == 2));
|
return (((!danetmode) && (numplayers >= 2)) || (numplayers == 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
long initmultiplayerscycle(void)
|
long initmultiplayerscycle(void)
|
||||||
{
|
{
|
||||||
long i, k;
|
long i, k;
|
||||||
extern long totalclock;
|
extern long totalclock;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -375,275 +375,275 @@ long initmultiplayerscycle(void)
|
||||||
usleep(1);
|
usleep(1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
getpacket(&i,0);
|
getpacket(&i,0);
|
||||||
|
|
||||||
tims = GetTickCount();
|
tims = GetTickCount();
|
||||||
if (myconnectindex == connecthead)
|
if (myconnectindex == connecthead)
|
||||||
{
|
{
|
||||||
for(i=numplayers-1;i>0;i--)
|
for(i=numplayers-1;i>0;i--)
|
||||||
if (!otherip[i]) break;
|
if (!otherip[i]) break;
|
||||||
if (!i) {
|
if (!i) {
|
||||||
netready = 1;
|
netready = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (netready) return 0;
|
if (netready) return 0;
|
||||||
if (tims < lastsendtims[connecthead]) lastsendtims[connecthead] = tims;
|
if (tims < lastsendtims[connecthead]) lastsendtims[connecthead] = tims;
|
||||||
if (tims >= lastsendtims[connecthead]+250) //1000/PAKRATE)
|
if (tims >= lastsendtims[connecthead]+250) //1000/PAKRATE)
|
||||||
{
|
{
|
||||||
lastsendtims[connecthead] = tims;
|
lastsendtims[connecthead] = tims;
|
||||||
|
|
||||||
// short crc16ofs; //offset of crc16
|
// short crc16ofs; //offset of crc16
|
||||||
// long icnt0; //-1 (special packet for MMULTI.C's player collection)
|
// long icnt0; //-1 (special packet for MMULTI.C's player collection)
|
||||||
// ...
|
// ...
|
||||||
// unsigned short crc16; //CRC16 of everything except crc16
|
// unsigned short crc16; //CRC16 of everything except crc16
|
||||||
k = 2;
|
k = 2;
|
||||||
*(long *)&pakbuf[k] = -1; k += 4;
|
*(long *)&pakbuf[k] = -1; k += 4;
|
||||||
pakbuf[k++] = 0xaa;
|
pakbuf[k++] = 0xaa;
|
||||||
*(unsigned short *)&pakbuf[0] = (unsigned short)k;
|
*(unsigned short *)&pakbuf[0] = (unsigned short)k;
|
||||||
*(unsigned short *)&pakbuf[k] = getcrc16(pakbuf,k); k += 2;
|
*(unsigned short *)&pakbuf[k] = getcrc16(pakbuf,k); k += 2;
|
||||||
netsend(connecthead,pakbuf,k);
|
netsend(connecthead,pakbuf,k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void initmultiplayers (long argc, char **argv, char damultioption, char dacomrateoption, char dapriority)
|
void initmultiplayers (long argc, char **argv, char damultioption, char dacomrateoption, char dapriority)
|
||||||
{
|
{
|
||||||
long i, j, k, otims;
|
long i, j, k, otims;
|
||||||
|
|
||||||
if (initmultiplayersparms(argc,argv))
|
if (initmultiplayersparms(argc,argv))
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
//Console code seems to crash Win98 upon quitting game
|
//Console code seems to crash Win98 upon quitting game
|
||||||
//it's not necessary and it's not portable anyway
|
//it's not necessary and it's not portable anyway
|
||||||
char tbuf[1024];
|
char tbuf[1024];
|
||||||
unsigned long u;
|
unsigned long u;
|
||||||
HANDLE hconsout;
|
HANDLE hconsout;
|
||||||
AllocConsole();
|
AllocConsole();
|
||||||
SetConsoleTitle("Multiplayer status...");
|
SetConsoleTitle("Multiplayer status...");
|
||||||
hconsout = GetStdHandle(STD_OUTPUT_HANDLE);
|
hconsout = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
otims = 0;
|
otims = 0;
|
||||||
#endif
|
#endif
|
||||||
while (initmultiplayerscycle())
|
while (initmultiplayerscycle())
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
if ((tims < otims) || (tims > otims+100))
|
if ((tims < otims) || (tims > otims+100))
|
||||||
{
|
{
|
||||||
otims = tims;
|
otims = tims;
|
||||||
sprintf(tbuf,"\rWait for players (%d/%d): ",myconnectindex,numplayers);
|
sprintf(tbuf,"\rWait for players (%d/%d): ",myconnectindex,numplayers);
|
||||||
for(i=0;i<numplayers;i++)
|
for(i=0;i<numplayers;i++)
|
||||||
{
|
{
|
||||||
if (i == myconnectindex) { strcat(tbuf,"<me> "); continue; }
|
if (i == myconnectindex) { strcat(tbuf,"<me> "); continue; }
|
||||||
if (!otherip[i]) { strcat(tbuf,"?.?.?.?:? "); continue; }
|
if (!otherip[i]) { strcat(tbuf,"?.?.?.?:? "); continue; }
|
||||||
sprintf(&tbuf[strlen(tbuf)],"%d.%d.%d.%d:%04x ",otherip[i]&255,(otherip[i]>>8)&255,(otherip[i]>>16)&255,(((unsigned long)otherip[i])>>24),otherport[i]);
|
sprintf(&tbuf[strlen(tbuf)],"%d.%d.%d.%d:%04x ",otherip[i]&255,(otherip[i]>>8)&255,(otherip[i]>>16)&255,(((unsigned long)otherip[i])>>24),otherport[i]);
|
||||||
}
|
}
|
||||||
WriteConsole(hconsout,tbuf,strlen(tbuf),&u,0);
|
WriteConsole(hconsout,tbuf,strlen(tbuf),&u,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FreeConsole();
|
FreeConsole();
|
||||||
#else
|
#else
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
netready = 1;
|
netready = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dosendpackets (long other)
|
void dosendpackets (long other)
|
||||||
{
|
{
|
||||||
long i, j, k;
|
long i, j, k;
|
||||||
|
|
||||||
if (!otherip[other]) return;
|
if (!otherip[other]) return;
|
||||||
|
|
||||||
//Packet format:
|
//Packet format:
|
||||||
// short crc16ofs; //offset of crc16
|
// short crc16ofs; //offset of crc16
|
||||||
// long icnt0; //earliest unacked packet
|
// long icnt0; //earliest unacked packet
|
||||||
// char ibits[32]; //ack status of packets icnt0<=i<icnt0+256
|
// char ibits[32]; //ack status of packets icnt0<=i<icnt0+256
|
||||||
// while (short leng) //leng: !=0 for packet, 0 for no more packets
|
// while (short leng) //leng: !=0 for packet, 0 for no more packets
|
||||||
// {
|
// {
|
||||||
// long ocnt; //index of following packet data
|
// long ocnt; //index of following packet data
|
||||||
// char pak[leng]; //actual packet data :)
|
// char pak[leng]; //actual packet data :)
|
||||||
// }
|
// }
|
||||||
// unsigned short crc16; //CRC16 of everything except crc16
|
// unsigned short crc16; //CRC16 of everything except crc16
|
||||||
|
|
||||||
|
|
||||||
tims = GetTickCount();
|
tims = GetTickCount();
|
||||||
if (tims < lastsendtims[other]) lastsendtims[other] = tims;
|
if (tims < lastsendtims[other]) lastsendtims[other] = tims;
|
||||||
if (tims < lastsendtims[other]+1000/PAKRATE) return;
|
if (tims < lastsendtims[other]+1000/PAKRATE) return;
|
||||||
lastsendtims[other] = tims;
|
lastsendtims[other] = tims;
|
||||||
|
|
||||||
k = 2;
|
k = 2;
|
||||||
*(long *)&pakbuf[k] = icnt0[other]; k += 4;
|
*(long *)&pakbuf[k] = icnt0[other]; k += 4;
|
||||||
memset(&pakbuf[k],0,32);
|
memset(&pakbuf[k],0,32);
|
||||||
for(i=icnt0[other];i<icnt0[other]+256;i++)
|
for(i=icnt0[other];i<icnt0[other]+256;i++)
|
||||||
if (ipak[other][i&(FIFSIZ-1)])
|
if (ipak[other][i&(FIFSIZ-1)])
|
||||||
pakbuf[((i-icnt0[other])>>3)+k] |= (1<<((i-icnt0[other])&7));
|
pakbuf[((i-icnt0[other])>>3)+k] |= (1<<((i-icnt0[other])&7));
|
||||||
k += 32;
|
k += 32;
|
||||||
|
|
||||||
while ((ocnt0[other] < ocnt1[other]) && (!opak[other][ocnt0[other]&(FIFSIZ-1)])) ocnt0[other]++;
|
while ((ocnt0[other] < ocnt1[other]) && (!opak[other][ocnt0[other]&(FIFSIZ-1)])) ocnt0[other]++;
|
||||||
for(i=ocnt0[other];i<ocnt1[other];i++)
|
for(i=ocnt0[other];i<ocnt1[other];i++)
|
||||||
{
|
{
|
||||||
j = *(short *)&pakmem[opak[other][i&(FIFSIZ-1)]]; if (!j) continue; //packet already acked
|
j = *(short *)&pakmem[opak[other][i&(FIFSIZ-1)]]; if (!j) continue; //packet already acked
|
||||||
if (k+6+j+4 > (long)sizeof(pakbuf)) break;
|
if (k+6+j+4 > (long)sizeof(pakbuf)) break;
|
||||||
|
|
||||||
*(unsigned short *)&pakbuf[k] = (unsigned short)j; k += 2;
|
*(unsigned short *)&pakbuf[k] = (unsigned short)j; k += 2;
|
||||||
*(long *)&pakbuf[k] = i; k += 4;
|
*(long *)&pakbuf[k] = i; k += 4;
|
||||||
memcpy(&pakbuf[k],&pakmem[opak[other][i&(FIFSIZ-1)]+2],j); k += j;
|
memcpy(&pakbuf[k],&pakmem[opak[other][i&(FIFSIZ-1)]+2],j); k += j;
|
||||||
}
|
}
|
||||||
*(unsigned short *)&pakbuf[k] = 0; k += 2;
|
*(unsigned short *)&pakbuf[k] = 0; k += 2;
|
||||||
*(unsigned short *)&pakbuf[0] = (unsigned short)k;
|
*(unsigned short *)&pakbuf[0] = (unsigned short)k;
|
||||||
*(unsigned short *)&pakbuf[k] = getcrc16(pakbuf,k); k += 2;
|
*(unsigned short *)&pakbuf[k] = getcrc16(pakbuf,k); k += 2;
|
||||||
|
|
||||||
//printf("Send: "); for(i=0;i<k;i++) printf("%02x ",pakbuf[i]); printf("\n");
|
//printf("Send: "); for(i=0;i<k;i++) printf("%02x ",pakbuf[i]); printf("\n");
|
||||||
netsend(other,pakbuf,k);
|
netsend(other,pakbuf,k);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendpacket (long other, char *bufptr, long messleng)
|
void sendpacket (long other, char *bufptr, long messleng)
|
||||||
{
|
{
|
||||||
long i, j;
|
long i, j;
|
||||||
|
|
||||||
if (numplayers < 2) return;
|
if (numplayers < 2) return;
|
||||||
|
|
||||||
if (pakmemi+messleng+2 > (long)sizeof(pakmem)) pakmemi = 1;
|
if (pakmemi+messleng+2 > (long)sizeof(pakmem)) pakmemi = 1;
|
||||||
opak[other][ocnt1[other]&(FIFSIZ-1)] = pakmemi;
|
opak[other][ocnt1[other]&(FIFSIZ-1)] = pakmemi;
|
||||||
*(short *)&pakmem[pakmemi] = messleng;
|
*(short *)&pakmem[pakmemi] = messleng;
|
||||||
memcpy(&pakmem[pakmemi+2],bufptr,messleng); pakmemi += messleng+2;
|
memcpy(&pakmem[pakmemi+2],bufptr,messleng); pakmemi += messleng+2;
|
||||||
ocnt1[other]++;
|
ocnt1[other]++;
|
||||||
|
|
||||||
//printf("Send: "); for(i=0;i<messleng;i++) printf("%02x ",bufptr[i]); printf("\n");
|
//printf("Send: "); for(i=0;i<messleng;i++) printf("%02x ",bufptr[i]); printf("\n");
|
||||||
|
|
||||||
dosendpackets(other);
|
dosendpackets(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
//passing bufptr == 0 enables receive&sending raw packets but does not return any received packets
|
//passing bufptr == 0 enables receive&sending raw packets but does not return any received packets
|
||||||
//(used as hack for player collection)
|
//(used as hack for player collection)
|
||||||
long getpacket (long *retother, char *bufptr)
|
long getpacket (long *retother, char *bufptr)
|
||||||
{
|
{
|
||||||
long i, j, k, ic0, crc16ofs, messleng, other;
|
long i, j, k, ic0, crc16ofs, messleng, other;
|
||||||
|
|
||||||
if (numplayers < 2) return(0);
|
if (numplayers < 2) return(0);
|
||||||
|
|
||||||
if (netready)
|
if (netready)
|
||||||
{
|
{
|
||||||
for(i=connecthead;i>=0;i=connectpoint2[i])
|
for(i=connecthead;i>=0;i=connectpoint2[i])
|
||||||
{
|
{
|
||||||
if (i != myconnectindex) dosendpackets(i);
|
if (i != myconnectindex) dosendpackets(i);
|
||||||
if ((!danetmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
|
if ((!danetmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (netread(&other,pakbuf,sizeof(pakbuf)))
|
while (netread(&other,pakbuf,sizeof(pakbuf)))
|
||||||
{
|
{
|
||||||
//Packet format:
|
//Packet format:
|
||||||
// short crc16ofs; //offset of crc16
|
// short crc16ofs; //offset of crc16
|
||||||
// long icnt0; //earliest unacked packet
|
// long icnt0; //earliest unacked packet
|
||||||
// char ibits[32]; //ack status of packets icnt0<=i<icnt0+256
|
// char ibits[32]; //ack status of packets icnt0<=i<icnt0+256
|
||||||
// while (short leng) //leng: !=0 for packet, 0 for no more packets
|
// while (short leng) //leng: !=0 for packet, 0 for no more packets
|
||||||
// {
|
// {
|
||||||
// long ocnt; //index of following packet data
|
// long ocnt; //index of following packet data
|
||||||
// char pak[leng]; //actual packet data :)
|
// char pak[leng]; //actual packet data :)
|
||||||
// }
|
// }
|
||||||
// unsigned short crc16; //CRC16 of everything except crc16
|
// unsigned short crc16; //CRC16 of everything except crc16
|
||||||
k = 0;
|
k = 0;
|
||||||
crc16ofs = (long)(*(unsigned short *)&pakbuf[k]); k += 2;
|
crc16ofs = (long)(*(unsigned short *)&pakbuf[k]); k += 2;
|
||||||
|
|
||||||
//printf("Recv: "); for(i=0;i<crc16ofs+2;i++) printf("%02x ",pakbuf[i]); printf("\n");
|
//printf("Recv: "); for(i=0;i<crc16ofs+2;i++) printf("%02x ",pakbuf[i]); printf("\n");
|
||||||
|
|
||||||
if ((crc16ofs+2 <= (long)sizeof(pakbuf)) && (getcrc16(pakbuf,crc16ofs) == (*(unsigned short *)&pakbuf[crc16ofs])))
|
if ((crc16ofs+2 <= (long)sizeof(pakbuf)) && (getcrc16(pakbuf,crc16ofs) == (*(unsigned short *)&pakbuf[crc16ofs])))
|
||||||
{
|
{
|
||||||
ic0 = *(long *)&pakbuf[k]; k += 4;
|
ic0 = *(long *)&pakbuf[k]; k += 4;
|
||||||
if (ic0 == -1)
|
if (ic0 == -1)
|
||||||
{
|
{
|
||||||
//Slave sends 0xaa to Master at initmultiplayers() and waits for 0xab response
|
//Slave sends 0xaa to Master at initmultiplayers() and waits for 0xab response
|
||||||
//Master responds to slave with 0xab whenever it receives a 0xaa - even if during game!
|
//Master responds to slave with 0xab whenever it receives a 0xaa - even if during game!
|
||||||
if ((pakbuf[k] == 0xaa) && (myconnectindex == connecthead))
|
if ((pakbuf[k] == 0xaa) && (myconnectindex == connecthead))
|
||||||
{
|
{
|
||||||
for(other=1;other<numplayers;other++)
|
for(other=1;other<numplayers;other++)
|
||||||
{
|
{
|
||||||
//Only send to others asking for a response
|
//Only send to others asking for a response
|
||||||
if ((otherip[other]) && ((otherip[other] != snatchip) || (otherport[other] != snatchport))) continue;
|
if ((otherip[other]) && ((otherip[other] != snatchip) || (otherport[other] != snatchport))) continue;
|
||||||
otherip[other] = snatchip;
|
otherip[other] = snatchip;
|
||||||
otherport[other] = snatchport;
|
otherport[other] = snatchport;
|
||||||
|
|
||||||
// short crc16ofs; //offset of crc16
|
// short crc16ofs; //offset of crc16
|
||||||
// long icnt0; //-1 (special packet for MMULTI.C's player collection)
|
// long icnt0; //-1 (special packet for MMULTI.C's player collection)
|
||||||
// ...
|
// ...
|
||||||
// unsigned short crc16; //CRC16 of everything except crc16
|
// unsigned short crc16; //CRC16 of everything except crc16
|
||||||
k = 2;
|
k = 2;
|
||||||
*(long *)&pakbuf[k] = -1; k += 4;
|
*(long *)&pakbuf[k] = -1; k += 4;
|
||||||
pakbuf[k++] = 0xab;
|
pakbuf[k++] = 0xab;
|
||||||
pakbuf[k++] = (char)other;
|
pakbuf[k++] = (char)other;
|
||||||
pakbuf[k++] = (char)numplayers;
|
pakbuf[k++] = (char)numplayers;
|
||||||
*(unsigned short *)&pakbuf[0] = (unsigned short)k;
|
*(unsigned short *)&pakbuf[0] = (unsigned short)k;
|
||||||
*(unsigned short *)&pakbuf[k] = getcrc16(pakbuf,k); k += 2;
|
*(unsigned short *)&pakbuf[k] = getcrc16(pakbuf,k); k += 2;
|
||||||
netsend(other,pakbuf,k);
|
netsend(other,pakbuf,k);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((pakbuf[k] == 0xab) && (myconnectindex != connecthead))
|
else if ((pakbuf[k] == 0xab) && (myconnectindex != connecthead))
|
||||||
{
|
{
|
||||||
if (((unsigned long)pakbuf[k+1] < (unsigned long)pakbuf[k+2]) &&
|
if (((unsigned long)pakbuf[k+1] < (unsigned long)pakbuf[k+2]) &&
|
||||||
((unsigned long)pakbuf[k+2] < (unsigned long)MAXPLAYERS))
|
((unsigned long)pakbuf[k+2] < (unsigned long)MAXPLAYERS))
|
||||||
{
|
{
|
||||||
myconnectindex = (long)pakbuf[k+1];
|
myconnectindex = (long)pakbuf[k+1];
|
||||||
numplayers = (long)pakbuf[k+2];
|
numplayers = (long)pakbuf[k+2];
|
||||||
|
|
||||||
connecthead = 0;
|
connecthead = 0;
|
||||||
for(i=0;i<numplayers-1;i++) connectpoint2[i] = i+1;
|
for(i=0;i<numplayers-1;i++) connectpoint2[i] = i+1;
|
||||||
connectpoint2[numplayers-1] = -1;
|
connectpoint2[numplayers-1] = -1;
|
||||||
|
|
||||||
otherip[connecthead] = snatchip;
|
otherip[connecthead] = snatchip;
|
||||||
otherport[connecthead] = snatchport;
|
otherport[connecthead] = snatchport;
|
||||||
netready = 1;
|
netready = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ocnt0[other] < ic0) ocnt0[other] = ic0;
|
if (ocnt0[other] < ic0) ocnt0[other] = ic0;
|
||||||
for(i=ic0;i<min(ic0+256,ocnt1[other]);i++)
|
for(i=ic0;i<min(ic0+256,ocnt1[other]);i++)
|
||||||
if (pakbuf[((i-ic0)>>3)+k]&(1<<((i-ic0)&7)))
|
if (pakbuf[((i-ic0)>>3)+k]&(1<<((i-ic0)&7)))
|
||||||
opak[other][i&(FIFSIZ-1)] = 0;
|
opak[other][i&(FIFSIZ-1)] = 0;
|
||||||
k += 32;
|
k += 32;
|
||||||
|
|
||||||
messleng = (long)(*(unsigned short *)&pakbuf[k]); k += 2;
|
messleng = (long)(*(unsigned short *)&pakbuf[k]); k += 2;
|
||||||
while (messleng)
|
while (messleng)
|
||||||
{
|
{
|
||||||
j = *(long *)&pakbuf[k]; k += 4;
|
j = *(long *)&pakbuf[k]; k += 4;
|
||||||
if ((j >= icnt0[other]) && (!ipak[other][j&(FIFSIZ-1)]))
|
if ((j >= icnt0[other]) && (!ipak[other][j&(FIFSIZ-1)]))
|
||||||
{
|
{
|
||||||
if (pakmemi+messleng+2 > (long)sizeof(pakmem)) pakmemi = 1;
|
if (pakmemi+messleng+2 > (long)sizeof(pakmem)) pakmemi = 1;
|
||||||
ipak[other][j&(FIFSIZ-1)] = pakmemi;
|
ipak[other][j&(FIFSIZ-1)] = pakmemi;
|
||||||
*(short *)&pakmem[pakmemi] = messleng;
|
*(short *)&pakmem[pakmemi] = messleng;
|
||||||
memcpy(&pakmem[pakmemi+2],&pakbuf[k],messleng); pakmemi += messleng+2;
|
memcpy(&pakmem[pakmemi+2],&pakbuf[k],messleng); pakmemi += messleng+2;
|
||||||
}
|
}
|
||||||
k += messleng;
|
k += messleng;
|
||||||
messleng = (long)(*(unsigned short *)&pakbuf[k]); k += 2;
|
messleng = (long)(*(unsigned short *)&pakbuf[k]); k += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Return next valid packet from any player
|
//Return next valid packet from any player
|
||||||
if (!bufptr) return(0);
|
if (!bufptr) return(0);
|
||||||
for(i=connecthead;i>=0;i=connectpoint2[i])
|
for(i=connecthead;i>=0;i=connectpoint2[i])
|
||||||
{
|
{
|
||||||
if (i != myconnectindex)
|
if (i != myconnectindex)
|
||||||
{
|
{
|
||||||
j = ipak[i][icnt0[i]&(FIFSIZ-1)];
|
j = ipak[i][icnt0[i]&(FIFSIZ-1)];
|
||||||
if (j)
|
if (j)
|
||||||
{
|
{
|
||||||
messleng = *(short *)&pakmem[j]; memcpy(bufptr,&pakmem[j+2],messleng);
|
messleng = *(short *)&pakmem[j]; memcpy(bufptr,&pakmem[j+2],messleng);
|
||||||
*retother = i; ipak[i][icnt0[i]&(FIFSIZ-1)] = 0; icnt0[i]++;
|
*retother = i; ipak[i][icnt0[i]&(FIFSIZ-1)] = 0; icnt0[i]++;
|
||||||
//printf("Recv: "); for(i=0;i<messleng;i++) printf("%02x ",bufptr[i]); printf("\n");
|
//printf("Recv: "); for(i=0;i<messleng;i++) printf("%02x ",bufptr[i]); printf("\n");
|
||||||
return(messleng);
|
return(messleng);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((!danetmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
|
if ((!danetmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
|
||||||
}
|
}
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,23 +15,23 @@ char syncstate = 0;
|
||||||
|
|
||||||
long isvalidipaddress (char *st)
|
long isvalidipaddress (char *st)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
long initmultiplayersparms(long argc, char **argv)
|
long initmultiplayersparms(long argc, char **argv)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
long initmultiplayerscycle(void)
|
long initmultiplayerscycle(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void initmultiplayers(long argc, char **argv, char damultioption, char dacomrateoption, char dapriority)
|
void initmultiplayers(long argc, char **argv, char damultioption, char dacomrateoption, char dapriority)
|
||||||
{
|
{
|
||||||
numplayers = 1; myconnectindex = 0;
|
numplayers = 1; myconnectindex = 0;
|
||||||
connecthead = 0; connectpoint2[0] = -1;
|
connecthead = 0; connectpoint2[0] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setpackettimeout(long datimeoutcount, long daresendagaincount)
|
void setpackettimeout(long datimeoutcount, long daresendagaincount)
|
||||||
|
@ -52,7 +52,7 @@ void sendlogoff(void)
|
||||||
|
|
||||||
long getoutputcirclesize(void)
|
long getoutputcirclesize(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setsocket(short newsocket)
|
void setsocket(short newsocket)
|
||||||
|
@ -65,7 +65,7 @@ void sendpacket(long other, char *bufptr, long messleng)
|
||||||
|
|
||||||
long getpacket (long *other, char *bufptr)
|
long getpacket (long *other, char *bufptr)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void flushpackets(void)
|
void flushpackets(void)
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -32,50 +32,50 @@ void qinterpolatedown16short(long bufptr, long num, long val, long add)
|
||||||
|
|
||||||
void clearbuf(void *d, long c, long a)
|
void clearbuf(void *d, long c, long a)
|
||||||
{
|
{
|
||||||
long *p = (long*)d;
|
long *p = (long*)d;
|
||||||
while ((c--) > 0) *(p++) = a;
|
while ((c--) > 0) *(p++) = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void copybuf(void *s, void *d, long c)
|
void copybuf(void *s, void *d, long c)
|
||||||
{
|
{
|
||||||
long *p = (long*)s, *q = (long*)d;
|
long *p = (long*)s, *q = (long*)d;
|
||||||
while ((c--) > 0) *(q++) = *(p++);
|
while ((c--) > 0) *(q++) = *(p++);
|
||||||
}
|
}
|
||||||
|
|
||||||
void swapbuf4(void *a, void *b, long c)
|
void swapbuf4(void *a, void *b, long c)
|
||||||
{
|
{
|
||||||
long *p = (long*)a, *q = (long*)b;
|
long *p = (long*)a, *q = (long*)b;
|
||||||
long x, y;
|
long x, y;
|
||||||
while ((c--) > 0) {
|
while ((c--) > 0) {
|
||||||
x = *q;
|
x = *q;
|
||||||
y = *p;
|
y = *p;
|
||||||
*(q++) = y;
|
*(q++) = y;
|
||||||
*(p++) = x;
|
*(p++) = x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearbufbyte(void *D, long c, long a)
|
void clearbufbyte(void *D, long c, long a)
|
||||||
{ // Cringe City
|
{ // Cringe City
|
||||||
char *p = (char*)D;
|
char *p = (char*)D;
|
||||||
long m[4] = { 0xffl,0xff00l,0xff0000l,0xff000000l };
|
long m[4] = { 0xffl,0xff00l,0xff0000l,0xff000000l };
|
||||||
long n[4] = { 0,8,16,24 };
|
long n[4] = { 0,8,16,24 };
|
||||||
long z=0;
|
long z=0;
|
||||||
while ((c--) > 0) {
|
while ((c--) > 0) {
|
||||||
*(p++) = (char)((a & m[z])>>n[z]);
|
*(p++) = (char)((a & m[z])>>n[z]);
|
||||||
z=(z+1)&3;
|
z=(z+1)&3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void copybufbyte(void *S, void *D, long c)
|
void copybufbyte(void *S, void *D, long c)
|
||||||
{
|
{
|
||||||
char *p = (char*)S, *q = (char*)D;
|
char *p = (char*)S, *q = (char*)D;
|
||||||
while((c--) > 0) *(q++) = *(p++);
|
while((c--) > 0) *(q++) = *(p++);
|
||||||
}
|
}
|
||||||
|
|
||||||
void copybufreverse(void *S, void *D, long c)
|
void copybufreverse(void *S, void *D, long c)
|
||||||
{
|
{
|
||||||
char *p = (char*)S, *q = (char*)D;
|
char *p = (char*)S, *q = (char*)D;
|
||||||
while((c--) > 0) *(q++) = *(p--);
|
while((c--) > 0) *(q++) = *(p--);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(__GNUC__) && defined(__i386__) // NOASM
|
#elif defined(__GNUC__) && defined(__i386__) // NOASM
|
||||||
|
@ -89,144 +89,144 @@ void copybufreverse(void *S, void *D, long c)
|
||||||
|
|
||||||
long boundmulscale(long a, long b, long c)
|
long boundmulscale(long a, long b, long c)
|
||||||
{
|
{
|
||||||
ASM (
|
ASM (
|
||||||
"imull %%ebx\n\t"
|
"imull %%ebx\n\t"
|
||||||
"movl %%edx, %%ebx\n\t" // mov ebx, edx
|
"movl %%edx, %%ebx\n\t" // mov ebx, edx
|
||||||
"shrdl %%cl, %%edx, %%eax\n\t" // mov eax, edx, cl
|
"shrdl %%cl, %%edx, %%eax\n\t" // mov eax, edx, cl
|
||||||
"sarl %%cl, %%edx\n\t" // sar edx, cl
|
"sarl %%cl, %%edx\n\t" // sar edx, cl
|
||||||
"xorl %%eax, %%edx\n\t" // xor edx, eax
|
"xorl %%eax, %%edx\n\t" // xor edx, eax
|
||||||
"js 0f\n\t" // js checkit
|
"js 0f\n\t" // js checkit
|
||||||
"xorl %%eax, %%edx\n\t" // xor edx, eax
|
"xorl %%eax, %%edx\n\t" // xor edx, eax
|
||||||
"jz 1f\n\t" // js skipboundit
|
"jz 1f\n\t" // js skipboundit
|
||||||
"cmpl $0xffffffff, %%edx\n\t" // cmp edx, 0xffffffff
|
"cmpl $0xffffffff, %%edx\n\t" // cmp edx, 0xffffffff
|
||||||
"je 1f\n\t" // je skipboundit
|
"je 1f\n\t" // je skipboundit
|
||||||
"0:\n\t" // checkit:
|
"0:\n\t" // checkit:
|
||||||
"movl %%ebx, %%eax\n\t" // mov eax, ebx
|
"movl %%ebx, %%eax\n\t" // mov eax, ebx
|
||||||
"sarl $31, %%eax\n\t" // sar eax, 31
|
"sarl $31, %%eax\n\t" // sar eax, 31
|
||||||
"xorl $0x7fffffff, %%eax\n\t" // xor eax, 0x7fffffff
|
"xorl $0x7fffffff, %%eax\n\t" // xor eax, 0x7fffffff
|
||||||
"1:" // skipboundit:
|
"1:" // skipboundit:
|
||||||
: "+a" (a), "+b" (b), "+c" (c) // input eax ebx ecx
|
: "+a" (a), "+b" (b), "+c" (c) // input eax ebx ecx
|
||||||
:
|
:
|
||||||
: "edx", "cc"
|
: "edx", "cc"
|
||||||
);
|
);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void clearbufbyte(void *D, long c, long a)
|
void clearbufbyte(void *D, long c, long a)
|
||||||
{
|
{
|
||||||
ASM (
|
ASM (
|
||||||
"cmpl $4, %%ecx\n\t"
|
"cmpl $4, %%ecx\n\t"
|
||||||
"jae 1f\n\t"
|
"jae 1f\n\t"
|
||||||
"testb $1, %%cl\n\t"
|
"testb $1, %%cl\n\t"
|
||||||
"jz 0f\n\t" // jz preskip
|
"jz 0f\n\t" // jz preskip
|
||||||
"stosb\n\t"
|
"stosb\n\t"
|
||||||
"0:\n\t" // preskip:
|
"0:\n\t" // preskip:
|
||||||
"shrl $1, %%ecx\n\t"
|
"shrl $1, %%ecx\n\t"
|
||||||
"rep\n\t"
|
"rep\n\t"
|
||||||
"stosw\n\t"
|
"stosw\n\t"
|
||||||
"jmp 5f\n\t" // jmp endit
|
"jmp 5f\n\t" // jmp endit
|
||||||
"1:\n\t" // intcopy:
|
"1:\n\t" // intcopy:
|
||||||
"testl $1, %%edi\n\t"
|
"testl $1, %%edi\n\t"
|
||||||
"jz 2f\n\t" // jz skip1
|
"jz 2f\n\t" // jz skip1
|
||||||
"stosb\n\t"
|
"stosb\n\t"
|
||||||
"decl %%ecx\n\t"
|
"decl %%ecx\n\t"
|
||||||
"2:\n\t" // skip1:
|
"2:\n\t" // skip1:
|
||||||
"testl $2, %%edi\n\t"
|
"testl $2, %%edi\n\t"
|
||||||
"jz 3f\n\t" // jz skip2
|
"jz 3f\n\t" // jz skip2
|
||||||
"stosw\n\t"
|
"stosw\n\t"
|
||||||
"subl $2, %%ecx\n\t"
|
"subl $2, %%ecx\n\t"
|
||||||
"3:\n\t" // skip2:
|
"3:\n\t" // skip2:
|
||||||
"movl %%ecx, %%ebx\n\t"
|
"movl %%ecx, %%ebx\n\t"
|
||||||
"shrl $2, %%ecx\n\t"
|
"shrl $2, %%ecx\n\t"
|
||||||
"rep\n\t"
|
"rep\n\t"
|
||||||
"stosl\n\t"
|
"stosl\n\t"
|
||||||
"testb $2, %%bl\n\t"
|
"testb $2, %%bl\n\t"
|
||||||
"jz 4f\n\t" // jz skip3
|
"jz 4f\n\t" // jz skip3
|
||||||
"stosw\n\t"
|
"stosw\n\t"
|
||||||
"4:\n\t" // skip3:
|
"4:\n\t" // skip3:
|
||||||
"testb $1, %%bl\n\t"
|
"testb $1, %%bl\n\t"
|
||||||
"jz 5f\n\t" // jz endit
|
"jz 5f\n\t" // jz endit
|
||||||
"stosb\n\t"
|
"stosb\n\t"
|
||||||
"5:" // endit
|
"5:" // endit
|
||||||
: "+D" (D), "+c" (c), "+a" (a) :
|
: "+D" (D), "+c" (c), "+a" (a) :
|
||||||
: "ebx", "memory", "cc"
|
: "ebx", "memory", "cc"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void copybufbyte(void *S, void *D, long c)
|
void copybufbyte(void *S, void *D, long c)
|
||||||
{
|
{
|
||||||
ASM (
|
ASM (
|
||||||
"cmpl $4, %%ecx\n\t" // cmp ecx, 4
|
"cmpl $4, %%ecx\n\t" // cmp ecx, 4
|
||||||
"jae 1f\n\t"
|
"jae 1f\n\t"
|
||||||
"testb $1, %%cl\n\t" // test cl, 1
|
"testb $1, %%cl\n\t" // test cl, 1
|
||||||
"jz 0f\n\t"
|
"jz 0f\n\t"
|
||||||
"movsb\n\t"
|
"movsb\n\t"
|
||||||
"0:\n\t" // preskip:
|
"0:\n\t" // preskip:
|
||||||
"shrl $1, %%ecx\n\t" // shr ecx, 1
|
"shrl $1, %%ecx\n\t" // shr ecx, 1
|
||||||
"rep\n\t"
|
"rep\n\t"
|
||||||
"movsw\n\t"
|
"movsw\n\t"
|
||||||
"jmp 5f\n\t"
|
"jmp 5f\n\t"
|
||||||
"1:\n\t" // intcopy:
|
"1:\n\t" // intcopy:
|
||||||
"testl $1, %%edi\n\t" // test edi, 1
|
"testl $1, %%edi\n\t" // test edi, 1
|
||||||
"jz 2f\n\t"
|
"jz 2f\n\t"
|
||||||
"movsb\n\t"
|
"movsb\n\t"
|
||||||
"decl %%ecx\n\t"
|
"decl %%ecx\n\t"
|
||||||
"2:\n\t" // skip1:
|
"2:\n\t" // skip1:
|
||||||
"testl $2, %%edi\n\t" // test edi, 2
|
"testl $2, %%edi\n\t" // test edi, 2
|
||||||
"jz 3f\n\t"
|
"jz 3f\n\t"
|
||||||
"movsw\n\t"
|
"movsw\n\t"
|
||||||
"subl $2, %%ecx\n\t" // sub ecx, 2
|
"subl $2, %%ecx\n\t" // sub ecx, 2
|
||||||
"3:\n\t" // skip2:
|
"3:\n\t" // skip2:
|
||||||
"movl %%ecx, %%ebx\n\t" // mov ebx, ecx
|
"movl %%ecx, %%ebx\n\t" // mov ebx, ecx
|
||||||
"shrl $2, %%ecx\n\t" // shr ecx ,2
|
"shrl $2, %%ecx\n\t" // shr ecx ,2
|
||||||
"rep\n\t"
|
"rep\n\t"
|
||||||
"movsl\n\t"
|
"movsl\n\t"
|
||||||
"testb $2, %%bl\n\t" // test bl, 2
|
"testb $2, %%bl\n\t" // test bl, 2
|
||||||
"jz 4f\n\t"
|
"jz 4f\n\t"
|
||||||
"movsw\n\t"
|
"movsw\n\t"
|
||||||
"4:\n\t" // skip3:
|
"4:\n\t" // skip3:
|
||||||
"testb $1, %%bl\n\t" // test bl, 1
|
"testb $1, %%bl\n\t" // test bl, 1
|
||||||
"jz 5f\n\t"
|
"jz 5f\n\t"
|
||||||
"movsb\n\t"
|
"movsb\n\t"
|
||||||
"5:" // endit:
|
"5:" // endit:
|
||||||
: "+c" (c), "+S" (S), "+D" (D) :
|
: "+c" (c), "+S" (S), "+D" (D) :
|
||||||
: "ebx", "memory", "cc"
|
: "ebx", "memory", "cc"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void copybufreverse(void *S, void *D, long c)
|
void copybufreverse(void *S, void *D, long c)
|
||||||
{
|
{
|
||||||
ASM (
|
ASM (
|
||||||
"shrl $1, %%ecx\n\t"
|
"shrl $1, %%ecx\n\t"
|
||||||
"jnc 0f\n\t" // jnc skipit1
|
"jnc 0f\n\t" // jnc skipit1
|
||||||
"movb (%%esi), %%al\n\t"
|
"movb (%%esi), %%al\n\t"
|
||||||
"decl %%esi\n\t"
|
"decl %%esi\n\t"
|
||||||
"movb %%al, (%%edi)\n\t"
|
"movb %%al, (%%edi)\n\t"
|
||||||
"incl %%edi\n\t"
|
"incl %%edi\n\t"
|
||||||
"0:\n\t" // skipit1:
|
"0:\n\t" // skipit1:
|
||||||
"shrl $1, %%ecx\n\t"
|
"shrl $1, %%ecx\n\t"
|
||||||
"jnc 1f\n\t" // jnc skipit2
|
"jnc 1f\n\t" // jnc skipit2
|
||||||
"movw -1(%%esi), %%ax\n\t"
|
"movw -1(%%esi), %%ax\n\t"
|
||||||
"subl $2, %%esi\n\t"
|
"subl $2, %%esi\n\t"
|
||||||
"rorw $8, %%ax\n\t"
|
"rorw $8, %%ax\n\t"
|
||||||
"movw %%ax, (%%edi)\n\t"
|
"movw %%ax, (%%edi)\n\t"
|
||||||
"addl $2, %%edi\n\t"
|
"addl $2, %%edi\n\t"
|
||||||
"1:\n\t" // skipit2
|
"1:\n\t" // skipit2
|
||||||
"testl %%ecx, %%ecx\n\t"
|
"testl %%ecx, %%ecx\n\t"
|
||||||
"jz 3f\n\t" // jz endloop
|
"jz 3f\n\t" // jz endloop
|
||||||
"2:\n\t" // begloop
|
"2:\n\t" // begloop
|
||||||
"movl -3(%%esi), %%eax\n\t"
|
"movl -3(%%esi), %%eax\n\t"
|
||||||
"subl $4, %%esi\n\t"
|
"subl $4, %%esi\n\t"
|
||||||
"bswapl %%eax\n\t"
|
"bswapl %%eax\n\t"
|
||||||
"movl %%eax, (%%edi)\n\t"
|
"movl %%eax, (%%edi)\n\t"
|
||||||
"addl $4, %%edi\n\t"
|
"addl $4, %%edi\n\t"
|
||||||
"decl %%ecx\n\t"
|
"decl %%ecx\n\t"
|
||||||
"jnz 2b\n\t" // jnz begloop
|
"jnz 2b\n\t" // jnz begloop
|
||||||
"3:"
|
"3:"
|
||||||
: "+S" (S), "+D" (D), "+c" (c) :
|
: "+S" (S), "+D" (D), "+c" (c) :
|
||||||
: "eax", "memory", "cc"
|
: "eax", "memory", "cc"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(__WATCOMC__) // __GNUC__ && __i386__
|
#elif defined(__WATCOMC__) // __GNUC__ && __i386__
|
||||||
|
|
|
@ -18,307 +18,307 @@ static void skipovertoken(scriptfile *sf) { while ((sf->textptr < sf->eof) && (s
|
||||||
|
|
||||||
char *scriptfile_gettoken(scriptfile *sf)
|
char *scriptfile_gettoken(scriptfile *sf)
|
||||||
{
|
{
|
||||||
char *start;
|
char *start;
|
||||||
|
|
||||||
skipoverws(sf);
|
skipoverws(sf);
|
||||||
if (sf->textptr >= sf->eof) return NULL;
|
if (sf->textptr >= sf->eof) return NULL;
|
||||||
|
|
||||||
start = sf->ltextptr = sf->textptr;
|
start = sf->ltextptr = sf->textptr;
|
||||||
skipovertoken(sf);
|
skipovertoken(sf);
|
||||||
return start;
|
return start;
|
||||||
}
|
}
|
||||||
|
|
||||||
int scriptfile_getstring(scriptfile *sf, char **retst)
|
int scriptfile_getstring(scriptfile *sf, char **retst)
|
||||||
{
|
{
|
||||||
(*retst) = scriptfile_gettoken(sf);
|
(*retst) = scriptfile_gettoken(sf);
|
||||||
if (*retst == NULL)
|
if (*retst == NULL)
|
||||||
{
|
{
|
||||||
initprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
|
initprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
|
||||||
return(-2);
|
return(-2);
|
||||||
}
|
}
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int scriptfile_getnumber(scriptfile *sf, int *num)
|
int scriptfile_getnumber(scriptfile *sf, int *num)
|
||||||
{
|
{
|
||||||
skipoverws(sf);
|
skipoverws(sf);
|
||||||
if (sf->textptr >= sf->eof)
|
if (sf->textptr >= sf->eof)
|
||||||
{
|
{
|
||||||
initprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
|
initprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((sf->textptr[0] == '0') && (sf->textptr[1] >= '0') && (sf->textptr[1] <= '9'))
|
while ((sf->textptr[0] == '0') && (sf->textptr[1] >= '0') && (sf->textptr[1] <= '9'))
|
||||||
sf->textptr++; //hack to treat octal numbers like decimal
|
sf->textptr++; //hack to treat octal numbers like decimal
|
||||||
|
|
||||||
sf->ltextptr = sf->textptr;
|
sf->ltextptr = sf->textptr;
|
||||||
(*num) = strtol((const char *)sf->textptr,&sf->textptr,0);
|
(*num) = strtol((const char *)sf->textptr,&sf->textptr,0);
|
||||||
if (!ISWS(*sf->textptr) && *sf->textptr) {
|
if (!ISWS(*sf->textptr) && *sf->textptr) {
|
||||||
char *p = sf->textptr;
|
char *p = sf->textptr;
|
||||||
skipovertoken(sf);
|
skipovertoken(sf);
|
||||||
initprintf("Error on line %s:%d: expecting int, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),p);
|
initprintf("Error on line %s:%d: expecting int, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),p);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static double parsedouble(char *ptr, char **end)
|
static double parsedouble(char *ptr, char **end)
|
||||||
{
|
{
|
||||||
int beforedecimal = 1, negative = 0, dig;
|
int beforedecimal = 1, negative = 0, dig;
|
||||||
int exposgn = 0, expo = 0;
|
int exposgn = 0, expo = 0;
|
||||||
double num = 0.0, decpl = 0.1;
|
double num = 0.0, decpl = 0.1;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = ptr;
|
p = ptr;
|
||||||
if (*p == '-') negative = 1, p++;
|
if (*p == '-') negative = 1, p++;
|
||||||
else if (*p == '+') p++;
|
else if (*p == '+') p++;
|
||||||
for (;; p++) {
|
for (;; p++) {
|
||||||
if (*p >= '0' && *p <= '9') {
|
if (*p >= '0' && *p <= '9') {
|
||||||
dig = *p - '0';
|
dig = *p - '0';
|
||||||
if (beforedecimal) num = num * 10.0 + dig;
|
if (beforedecimal) num = num * 10.0 + dig;
|
||||||
else if (exposgn) expo = expo*10 + dig;
|
else if (exposgn) expo = expo*10 + dig;
|
||||||
else {
|
else {
|
||||||
num += (double)dig * decpl;
|
num += (double)dig * decpl;
|
||||||
decpl /= 10.0;
|
decpl /= 10.0;
|
||||||
}
|
}
|
||||||
} else if (*p == '.') {
|
} else if (*p == '.') {
|
||||||
if (beforedecimal) beforedecimal = 0;
|
if (beforedecimal) beforedecimal = 0;
|
||||||
else break;
|
else break;
|
||||||
} else if ((*p == 'E') || (*p == 'e')) {
|
} else if ((*p == 'E') || (*p == 'e')) {
|
||||||
exposgn = 1;
|
exposgn = 1;
|
||||||
if (p[1] == '-') { exposgn = -1; p++; }
|
if (p[1] == '-') { exposgn = -1; p++; }
|
||||||
else if (p[1] == '+') p++;
|
else if (p[1] == '+') p++;
|
||||||
} else break;
|
} else break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (end) *end = p;
|
if (end) *end = p;
|
||||||
if (exposgn) num *= pow(10.0,(double)(expo*exposgn));
|
if (exposgn) num *= pow(10.0,(double)(expo*exposgn));
|
||||||
return negative ? -num : num;
|
return negative ? -num : num;
|
||||||
}
|
}
|
||||||
|
|
||||||
int scriptfile_getdouble(scriptfile *sf, double *num)
|
int scriptfile_getdouble(scriptfile *sf, double *num)
|
||||||
{
|
{
|
||||||
skipoverws(sf);
|
skipoverws(sf);
|
||||||
if (sf->textptr >= sf->eof)
|
if (sf->textptr >= sf->eof)
|
||||||
{
|
{
|
||||||
initprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
|
initprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sf->ltextptr = sf->textptr;
|
sf->ltextptr = sf->textptr;
|
||||||
|
|
||||||
// On Linux, locale settings interfere with interpreting x.y format numbers
|
// On Linux, locale settings interfere with interpreting x.y format numbers
|
||||||
//(*num) = strtod((const char *)sf->textptr,&sf->textptr);
|
//(*num) = strtod((const char *)sf->textptr,&sf->textptr);
|
||||||
(*num) = parsedouble(sf->textptr, &sf->textptr);
|
(*num) = parsedouble(sf->textptr, &sf->textptr);
|
||||||
|
|
||||||
if (!ISWS(*sf->textptr) && *sf->textptr) {
|
if (!ISWS(*sf->textptr) && *sf->textptr) {
|
||||||
char *p = sf->textptr;
|
char *p = sf->textptr;
|
||||||
skipovertoken(sf);
|
skipovertoken(sf);
|
||||||
initprintf("Error on line %s:%d: expecting float, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),p);
|
initprintf("Error on line %s:%d: expecting float, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),p);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int scriptfile_getsymbol(scriptfile *sf, int *num)
|
int scriptfile_getsymbol(scriptfile *sf, int *num)
|
||||||
{
|
{
|
||||||
char *t, *e;
|
char *t, *e;
|
||||||
int v;
|
int v;
|
||||||
|
|
||||||
t = scriptfile_gettoken(sf);
|
t = scriptfile_gettoken(sf);
|
||||||
if (!t) return -1;
|
if (!t) return -1;
|
||||||
|
|
||||||
v = Bstrtol(t, &e, 10);
|
v = Bstrtol(t, &e, 10);
|
||||||
if (*e) {
|
if (*e) {
|
||||||
// looks like a string, so find it in the symbol table
|
// looks like a string, so find it in the symbol table
|
||||||
if (scriptfile_getsymbolvalue(t, num)) return 0;
|
if (scriptfile_getsymbolvalue(t, num)) return 0;
|
||||||
initprintf("Error on line %s:%d: expecting symbol, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),t);
|
initprintf("Error on line %s:%d: expecting symbol, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),t);
|
||||||
return -2; // not found
|
return -2; // not found
|
||||||
}
|
}
|
||||||
|
|
||||||
*num = v;
|
*num = v;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int scriptfile_getbraces(scriptfile *sf, char **braceend)
|
int scriptfile_getbraces(scriptfile *sf, char **braceend)
|
||||||
{
|
{
|
||||||
int bracecnt;
|
int bracecnt;
|
||||||
char *bracestart;
|
char *bracestart;
|
||||||
|
|
||||||
skipoverws(sf);
|
skipoverws(sf);
|
||||||
if (sf->textptr >= sf->eof)
|
if (sf->textptr >= sf->eof)
|
||||||
{
|
{
|
||||||
initprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
|
initprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sf->textptr[0] != '{') {
|
if (sf->textptr[0] != '{') {
|
||||||
initprintf("Error on line %s:%d: expecting '{'\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
|
initprintf("Error on line %s:%d: expecting '{'\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
bracestart = ++sf->textptr; bracecnt = 1;
|
bracestart = ++sf->textptr; bracecnt = 1;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (sf->textptr >= sf->eof) return(0);
|
if (sf->textptr >= sf->eof) return(0);
|
||||||
if (sf->textptr[0] == '{') bracecnt++;
|
if (sf->textptr[0] == '{') bracecnt++;
|
||||||
if (sf->textptr[0] == '}') { bracecnt--; if (!bracecnt) break; }
|
if (sf->textptr[0] == '}') { bracecnt--; if (!bracecnt) break; }
|
||||||
sf->textptr++;
|
sf->textptr++;
|
||||||
}
|
}
|
||||||
(*braceend) = sf->textptr;
|
(*braceend) = sf->textptr;
|
||||||
sf->textptr = bracestart;
|
sf->textptr = bracestart;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int scriptfile_getlinum (scriptfile *sf, char *ptr)
|
int scriptfile_getlinum (scriptfile *sf, char *ptr)
|
||||||
{
|
{
|
||||||
int i, stp, ind;
|
int i, stp, ind;
|
||||||
|
|
||||||
//for(i=0;i<sf->linenum;i++) if (sf->lineoffs[i] >= ind) return(i+1); //brute force algo
|
//for(i=0;i<sf->linenum;i++) if (sf->lineoffs[i] >= ind) return(i+1); //brute force algo
|
||||||
|
|
||||||
ind = ((long)ptr) - ((long)sf->textbuf);
|
ind = ((long)ptr) - ((long)sf->textbuf);
|
||||||
|
|
||||||
for(stp=1;stp+stp<sf->linenum;stp+=stp); //stp = highest power of 2 less than sf->linenum
|
for(stp=1;stp+stp<sf->linenum;stp+=stp); //stp = highest power of 2 less than sf->linenum
|
||||||
for(i=0;stp;stp>>=1)
|
for(i=0;stp;stp>>=1)
|
||||||
if ((i+stp < sf->linenum) && (sf->lineoffs[i+stp] < ind)) i += stp;
|
if ((i+stp < sf->linenum) && (sf->lineoffs[i+stp] < ind)) i += stp;
|
||||||
return(i+1); //i = index to highest lineoffs which is less than ind; convert to 1-based line numbers
|
return(i+1); //i = index to highest lineoffs which is less than ind; convert to 1-based line numbers
|
||||||
}
|
}
|
||||||
|
|
||||||
void scriptfile_preparse (scriptfile *sf, char *tx, long flen)
|
void scriptfile_preparse (scriptfile *sf, char *tx, long flen)
|
||||||
{
|
{
|
||||||
long i, cr, numcr, nflen, ws, cs, inquote;
|
long i, cr, numcr, nflen, ws, cs, inquote;
|
||||||
|
|
||||||
//Count number of lines
|
//Count number of lines
|
||||||
numcr = 1;
|
numcr = 1;
|
||||||
for(i=0;i<flen;i++)
|
for(i=0;i<flen;i++)
|
||||||
{
|
{
|
||||||
//detect all 4 types of carriage return (\r, \n, \r\n, \n\r :)
|
//detect all 4 types of carriage return (\r, \n, \r\n, \n\r :)
|
||||||
cr=0;if (tx[i] == '\r') { i += (tx[i+1] == '\n'); cr = 1; }
|
cr=0;if (tx[i] == '\r') { i += (tx[i+1] == '\n'); cr = 1; }
|
||||||
else if (tx[i] == '\n') { i += (tx[i+1] == '\r'); cr = 1; }
|
else if (tx[i] == '\n') { i += (tx[i+1] == '\r'); cr = 1; }
|
||||||
if (cr) { numcr++; continue; }
|
if (cr) { numcr++; continue; }
|
||||||
}
|
}
|
||||||
|
|
||||||
sf->linenum = numcr;
|
sf->linenum = numcr;
|
||||||
sf->lineoffs = (long *)malloc(sf->linenum*sizeof(long));
|
sf->lineoffs = (long *)malloc(sf->linenum*sizeof(long));
|
||||||
|
|
||||||
//Preprocess file for comments (// and /*...*/, and convert all whitespace to single spaces)
|
//Preprocess file for comments (// and /*...*/, and convert all whitespace to single spaces)
|
||||||
nflen = 0; ws = 0; cs = 0; numcr = 0; inquote = 0;
|
nflen = 0; ws = 0; cs = 0; numcr = 0; inquote = 0;
|
||||||
for(i=0;i<flen;i++)
|
for(i=0;i<flen;i++)
|
||||||
{
|
{
|
||||||
//detect all 4 types of carriage return (\r, \n, \r\n, \n\r :)
|
//detect all 4 types of carriage return (\r, \n, \r\n, \n\r :)
|
||||||
cr=0;if (tx[i] == '\r') { i += (tx[i+1] == '\n'); cr = 1; }
|
cr=0;if (tx[i] == '\r') { i += (tx[i+1] == '\n'); cr = 1; }
|
||||||
else if (tx[i] == '\n') { i += (tx[i+1] == '\r'); cr = 1; }
|
else if (tx[i] == '\n') { i += (tx[i+1] == '\r'); cr = 1; }
|
||||||
if (cr)
|
if (cr)
|
||||||
{
|
{
|
||||||
//Remember line numbers by storing the byte index at the start of each line
|
//Remember line numbers by storing the byte index at the start of each line
|
||||||
//Line numbers can be retrieved by doing a binary search on the byte index :)
|
//Line numbers can be retrieved by doing a binary search on the byte index :)
|
||||||
sf->lineoffs[numcr++] = nflen;
|
sf->lineoffs[numcr++] = nflen;
|
||||||
if (cs == 1) cs = 0;
|
if (cs == 1) cs = 0;
|
||||||
ws = 1; continue; //strip CR/LF
|
ws = 1; continue; //strip CR/LF
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!inquote) && ((tx[i] == ' ') || (tx[i] == '\t'))) { ws = 1; continue; } //strip Space/Tab
|
if ((!inquote) && ((tx[i] == ' ') || (tx[i] == '\t'))) { ws = 1; continue; } //strip Space/Tab
|
||||||
if ((tx[i] == '/') && (tx[i+1] == '/') && (!cs)) cs = 1;
|
if ((tx[i] == '/') && (tx[i+1] == '/') && (!cs)) cs = 1;
|
||||||
if ((tx[i] == '/') && (tx[i+1] == '*') && (!cs)) { ws = 1; cs = 2; }
|
if ((tx[i] == '/') && (tx[i+1] == '*') && (!cs)) { ws = 1; cs = 2; }
|
||||||
if ((tx[i] == '*') && (tx[i+1] == '/') && (cs == 2)) { cs = 0; i++; continue; }
|
if ((tx[i] == '*') && (tx[i+1] == '/') && (cs == 2)) { cs = 0; i++; continue; }
|
||||||
if (cs) continue;
|
if (cs) continue;
|
||||||
|
|
||||||
if (ws) { tx[nflen++] = 0; ws = 0; }
|
if (ws) { tx[nflen++] = 0; ws = 0; }
|
||||||
|
|
||||||
//quotes inside strings: \"
|
//quotes inside strings: \"
|
||||||
if ((tx[i] == '\\') && (tx[i+1] == '\"')) { i++; tx[nflen++] = '\"'; continue; }
|
if ((tx[i] == '\\') && (tx[i+1] == '\"')) { i++; tx[nflen++] = '\"'; continue; }
|
||||||
if (tx[i] == '\"') { inquote ^= 1; continue; }
|
if (tx[i] == '\"') { inquote ^= 1; continue; }
|
||||||
tx[nflen++] = tx[i];
|
tx[nflen++] = tx[i];
|
||||||
}
|
}
|
||||||
tx[nflen++] = 0; sf->lineoffs[numcr] = nflen;
|
tx[nflen++] = 0; sf->lineoffs[numcr] = nflen;
|
||||||
tx[nflen++] = 0;
|
tx[nflen++] = 0;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
//for debugging only:
|
//for debugging only:
|
||||||
printf("pre-parsed file:flen=%d,nflen=%d\n",flen,nflen);
|
printf("pre-parsed file:flen=%d,nflen=%d\n",flen,nflen);
|
||||||
for(i=0;i<nflen;i++) { if (tx[i] < 32) printf("_"); else printf("%c",tx[i]); }
|
for(i=0;i<nflen;i++) { if (tx[i] < 32) printf("_"); else printf("%c",tx[i]); }
|
||||||
printf("[eof]\nnumlines=%d\n",sf->linenum);
|
printf("[eof]\nnumlines=%d\n",sf->linenum);
|
||||||
for(i=0;i<sf->linenum;i++) printf("line %d = byte %d\n",i,sf->lineoffs[i]);
|
for(i=0;i<sf->linenum;i++) printf("line %d = byte %d\n",i,sf->lineoffs[i]);
|
||||||
#endif
|
#endif
|
||||||
flen = nflen;
|
flen = nflen;
|
||||||
|
|
||||||
sf->textbuf = sf->textptr = tx;
|
sf->textbuf = sf->textptr = tx;
|
||||||
sf->textlength = nflen;
|
sf->textlength = nflen;
|
||||||
sf->eof = &sf->textbuf[nflen-1];
|
sf->eof = &sf->textbuf[nflen-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
scriptfile *scriptfile_fromfile(char *fn)
|
scriptfile *scriptfile_fromfile(char *fn)
|
||||||
{
|
{
|
||||||
int fp;
|
int fp;
|
||||||
scriptfile *sf;
|
scriptfile *sf;
|
||||||
char *tx;
|
char *tx;
|
||||||
unsigned int flen;
|
unsigned int flen;
|
||||||
|
|
||||||
fp = kopen4load(fn,0);
|
fp = kopen4load(fn,0);
|
||||||
if (fp<0) return NULL;
|
if (fp<0) return NULL;
|
||||||
|
|
||||||
flen = kfilelength(fp);
|
flen = kfilelength(fp);
|
||||||
tx = (char *) malloc(flen + 2);
|
tx = (char *) malloc(flen + 2);
|
||||||
if (!tx) {
|
if (!tx) {
|
||||||
kclose(fp);
|
kclose(fp);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
sf = (scriptfile*) malloc(sizeof(scriptfile));
|
sf = (scriptfile*) malloc(sizeof(scriptfile));
|
||||||
if (!sf) {
|
if (!sf) {
|
||||||
kclose(fp);
|
kclose(fp);
|
||||||
free(tx);
|
free(tx);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
kread(fp, tx, flen);
|
kread(fp, tx, flen);
|
||||||
tx[flen] = tx[flen+1] = 0;
|
tx[flen] = tx[flen+1] = 0;
|
||||||
|
|
||||||
kclose(fp);
|
kclose(fp);
|
||||||
|
|
||||||
scriptfile_preparse(sf,tx,flen);
|
scriptfile_preparse(sf,tx,flen);
|
||||||
sf->filename = strdup(fn);
|
sf->filename = strdup(fn);
|
||||||
|
|
||||||
return sf;
|
return sf;
|
||||||
}
|
}
|
||||||
|
|
||||||
scriptfile *scriptfile_fromstring(char *string)
|
scriptfile *scriptfile_fromstring(char *string)
|
||||||
{
|
{
|
||||||
scriptfile *sf;
|
scriptfile *sf;
|
||||||
char *tx;
|
char *tx;
|
||||||
unsigned int flen;
|
unsigned int flen;
|
||||||
|
|
||||||
if (!string) return NULL;
|
if (!string) return NULL;
|
||||||
|
|
||||||
flen = strlen(string);
|
flen = strlen(string);
|
||||||
|
|
||||||
tx = (char *) malloc(flen + 2);
|
tx = (char *) malloc(flen + 2);
|
||||||
if (!tx) return NULL;
|
if (!tx) return NULL;
|
||||||
|
|
||||||
sf = (scriptfile*) malloc(sizeof(scriptfile));
|
sf = (scriptfile*) malloc(sizeof(scriptfile));
|
||||||
if (!sf) {
|
if (!sf) {
|
||||||
free(tx);
|
free(tx);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(tx, string, flen);
|
memcpy(tx, string, flen);
|
||||||
tx[flen] = tx[flen+1] = 0;
|
tx[flen] = tx[flen+1] = 0;
|
||||||
|
|
||||||
scriptfile_preparse(sf,tx,flen);
|
scriptfile_preparse(sf,tx,flen);
|
||||||
sf->filename = NULL;
|
sf->filename = NULL;
|
||||||
|
|
||||||
return sf;
|
return sf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void scriptfile_close(scriptfile *sf)
|
void scriptfile_close(scriptfile *sf)
|
||||||
{
|
{
|
||||||
if (!sf) return;
|
if (!sf) return;
|
||||||
if (sf->lineoffs) free(sf->lineoffs);
|
if (sf->lineoffs) free(sf->lineoffs);
|
||||||
if (sf->textbuf) free(sf->textbuf);
|
if (sf->textbuf) free(sf->textbuf);
|
||||||
if (sf->filename) free(sf->filename);
|
if (sf->filename) free(sf->filename);
|
||||||
sf->textbuf = NULL;
|
sf->textbuf = NULL;
|
||||||
sf->filename = NULL;
|
sf->filename = NULL;
|
||||||
free(sf);
|
free(sf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -328,68 +328,68 @@ static char *symbtab = NULL;
|
||||||
|
|
||||||
static char * getsymbtabspace(int reqd)
|
static char * getsymbtabspace(int reqd)
|
||||||
{
|
{
|
||||||
char *pos,*np;
|
char *pos,*np;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (symbtablength + reqd > symbtaballoclength)
|
if (symbtablength + reqd > symbtaballoclength)
|
||||||
{
|
{
|
||||||
for(i=max(symbtaballoclength,SYMBTABSTARTSIZE);symbtablength+reqd>i;i<<=1);
|
for(i=max(symbtaballoclength,SYMBTABSTARTSIZE);symbtablength+reqd>i;i<<=1);
|
||||||
np = (char *)realloc(symbtab, i); if (!np) return NULL;
|
np = (char *)realloc(symbtab, i); if (!np) return NULL;
|
||||||
symbtab = np; symbtaballoclength = i;
|
symbtab = np; symbtaballoclength = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = &symbtab[symbtablength];
|
pos = &symbtab[symbtablength];
|
||||||
symbtablength += reqd;
|
symbtablength += reqd;
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
int scriptfile_getsymbolvalue(char *name, int *val)
|
int scriptfile_getsymbolvalue(char *name, int *val)
|
||||||
{
|
{
|
||||||
char *scanner = symbtab;
|
char *scanner = symbtab;
|
||||||
|
|
||||||
if (!symbtab) return 0;
|
if (!symbtab) return 0;
|
||||||
while (scanner - symbtab < symbtablength) {
|
while (scanner - symbtab < symbtablength) {
|
||||||
if (!Bstrcasecmp(name, scanner)) {
|
if (!Bstrcasecmp(name, scanner)) {
|
||||||
*val = *(int*)(scanner + strlen(scanner) + 1);
|
*val = *(int*)(scanner + strlen(scanner) + 1);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
scanner += strlen(scanner) + 1 + sizeof(int);
|
scanner += strlen(scanner) + 1 + sizeof(int);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int scriptfile_addsymbolvalue(char *name, int val)
|
int scriptfile_addsymbolvalue(char *name, int val)
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
char *sp;
|
char *sp;
|
||||||
// if (scriptfile_getsymbolvalue(name, &x)) return -1; // already exists
|
// if (scriptfile_getsymbolvalue(name, &x)) return -1; // already exists
|
||||||
|
|
||||||
if (symbtab) {
|
if (symbtab) {
|
||||||
char *scanner = symbtab;
|
char *scanner = symbtab;
|
||||||
while (scanner - symbtab < symbtablength) {
|
while (scanner - symbtab < symbtablength) {
|
||||||
if (!Bstrcasecmp(name, scanner)) {
|
if (!Bstrcasecmp(name, scanner)) {
|
||||||
*(int*)(scanner + strlen(scanner) + 1) = val;
|
*(int*)(scanner + strlen(scanner) + 1) = val;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
scanner += strlen(scanner) + 1 + sizeof(int);
|
scanner += strlen(scanner) + 1 + sizeof(int);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sp = getsymbtabspace(strlen(name) + 1 + sizeof(int));
|
sp = getsymbtabspace(strlen(name) + 1 + sizeof(int));
|
||||||
if (!sp) return 0;
|
if (!sp) return 0;
|
||||||
strcpy(sp, name);
|
strcpy(sp, name);
|
||||||
sp += strlen(name)+1;
|
sp += strlen(name)+1;
|
||||||
*(int*)sp = val;
|
*(int*)sp = val;
|
||||||
return 1; // added
|
return 1; // added
|
||||||
}
|
}
|
||||||
|
|
||||||
void scriptfile_clearsymbols(void)
|
void scriptfile_clearsymbols(void)
|
||||||
{
|
{
|
||||||
if (symbtab) free(symbtab);
|
if (symbtab) free(symbtab);
|
||||||
symbtab = NULL;
|
symbtab = NULL;
|
||||||
symbtablength = 0;
|
symbtablength = 0;
|
||||||
symbtaballoclength = 0;
|
symbtaballoclength = 0;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -4,176 +4,176 @@
|
||||||
// Generated by BIN2C.EXE by Jonathon Fowler
|
// Generated by BIN2C.EXE by Jonathon Fowler
|
||||||
|
|
||||||
char smalltextfont[2048] = {
|
char smalltextfont[2048] = {
|
||||||
// 2048 bytes
|
// 2048 bytes
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x24,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x24,
|
||||||
0x3C, 0x18, 0x00, 0x00, 0x00, 0x18, 0x24, 0x3C, 0x24, 0x18, 0x00, 0x00,
|
0x3C, 0x18, 0x00, 0x00, 0x00, 0x18, 0x24, 0x3C, 0x24, 0x18, 0x00, 0x00,
|
||||||
0x00, 0x28, 0x3C, 0x3C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x10, 0x38, 0x3C,
|
0x00, 0x28, 0x3C, 0x3C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x10, 0x38, 0x3C,
|
||||||
0x38, 0x10, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x3C, 0x00, 0x00,
|
0x38, 0x10, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x3C, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x18, 0x3C, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x18, 0x18, 0x3C, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x28, 0x38, 0x38, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x28, 0x38, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x14, 0x14, 0x30, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x14, 0x14, 0x30, 0x00, 0x00,
|
||||||
0x00, 0x24, 0x18, 0x3C, 0x18, 0x24, 0x00, 0x00, 0x00, 0x20, 0x30, 0x38,
|
0x00, 0x24, 0x18, 0x3C, 0x18, 0x24, 0x00, 0x00, 0x00, 0x20, 0x30, 0x38,
|
||||||
0x30, 0x20, 0x00, 0x00, 0x00, 0x08, 0x18, 0x38, 0x18, 0x08, 0x00, 0x00,
|
0x30, 0x20, 0x00, 0x00, 0x00, 0x08, 0x18, 0x38, 0x18, 0x08, 0x00, 0x00,
|
||||||
0x00, 0x10, 0x38, 0x10, 0x38, 0x10, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28,
|
0x00, 0x10, 0x38, 0x10, 0x38, 0x10, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28,
|
||||||
0x00, 0x28, 0x00, 0x00, 0x00, 0x1C, 0x34, 0x34, 0x14, 0x14, 0x00, 0x00,
|
0x00, 0x28, 0x00, 0x00, 0x00, 0x1C, 0x34, 0x34, 0x14, 0x14, 0x00, 0x00,
|
||||||
0x00, 0x1C, 0x30, 0x28, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x1C, 0x30, 0x28, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x38, 0x38, 0x00, 0x00, 0x00, 0x10, 0x38, 0x10, 0x38, 0x38, 0x00, 0x00,
|
0x38, 0x38, 0x00, 0x00, 0x00, 0x10, 0x38, 0x10, 0x38, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10,
|
0x00, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10,
|
||||||
0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x3C, 0x08, 0x00, 0x00, 0x00,
|
0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x3C, 0x08, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x10, 0x3C, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x10, 0x3C, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x28, 0x28, 0x00,
|
0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x28, 0x28, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x3C, 0x28, 0x3C, 0x28, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x3C, 0x28, 0x3C, 0x28, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x30, 0x10, 0x18, 0x30, 0x00, 0x00, 0x00, 0x28, 0x08, 0x10,
|
0x00, 0x18, 0x30, 0x10, 0x18, 0x30, 0x00, 0x00, 0x00, 0x28, 0x08, 0x10,
|
||||||
0x20, 0x28, 0x00, 0x00, 0x00, 0x10, 0x28, 0x10, 0x30, 0x38, 0x00, 0x00,
|
0x20, 0x28, 0x00, 0x00, 0x00, 0x10, 0x28, 0x10, 0x30, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, 0x20,
|
0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, 0x20,
|
||||||
0x20, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x08, 0x08, 0x10, 0x00, 0x00,
|
0x20, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x08, 0x08, 0x10, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x28, 0x10, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
|
0x00, 0x00, 0x28, 0x10, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
|
||||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00,
|
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x10, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x10, 0x20, 0x00, 0x00,
|
0x00, 0x10, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x10, 0x20, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x28, 0x28, 0x28, 0x38, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10,
|
0x00, 0x38, 0x28, 0x28, 0x28, 0x38, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10,
|
||||||
0x10, 0x10, 0x00, 0x00, 0x00, 0x38, 0x08, 0x38, 0x20, 0x38, 0x00, 0x00,
|
0x10, 0x10, 0x00, 0x00, 0x00, 0x38, 0x08, 0x38, 0x20, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x08, 0x38, 0x08, 0x38, 0x00, 0x00, 0x00, 0x28, 0x28, 0x38,
|
0x00, 0x38, 0x08, 0x38, 0x08, 0x38, 0x00, 0x00, 0x00, 0x28, 0x28, 0x38,
|
||||||
0x08, 0x08, 0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x08, 0x38, 0x00, 0x00,
|
0x08, 0x08, 0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x08, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x20, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x38, 0x08, 0x08,
|
0x00, 0x38, 0x20, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x38, 0x08, 0x08,
|
||||||
0x08, 0x08, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x28, 0x38, 0x00, 0x00,
|
0x08, 0x08, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x28, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x28, 0x38, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
|
0x00, 0x38, 0x28, 0x38, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
|
||||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x20, 0x00, 0x00,
|
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x20, 0x00, 0x00,
|
||||||
0x00, 0x08, 0x10, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00,
|
0x00, 0x08, 0x10, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00,
|
||||||
0x38, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08, 0x10, 0x20, 0x00, 0x00,
|
0x38, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08, 0x10, 0x20, 0x00, 0x00,
|
||||||
0x00, 0x30, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38,
|
0x00, 0x30, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38,
|
||||||
0x30, 0x38, 0x00, 0x00, 0x00, 0x10, 0x28, 0x38, 0x28, 0x28, 0x00, 0x00,
|
0x30, 0x38, 0x00, 0x00, 0x00, 0x10, 0x28, 0x38, 0x28, 0x28, 0x00, 0x00,
|
||||||
0x00, 0x30, 0x28, 0x30, 0x28, 0x30, 0x00, 0x00, 0x00, 0x18, 0x20, 0x20,
|
0x00, 0x30, 0x28, 0x30, 0x28, 0x30, 0x00, 0x00, 0x00, 0x18, 0x20, 0x20,
|
||||||
0x20, 0x18, 0x00, 0x00, 0x00, 0x30, 0x28, 0x28, 0x28, 0x30, 0x00, 0x00,
|
0x20, 0x18, 0x00, 0x00, 0x00, 0x30, 0x28, 0x28, 0x28, 0x30, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x20, 0x30, 0x20, 0x38, 0x00, 0x00, 0x00, 0x38, 0x20, 0x30,
|
0x00, 0x38, 0x20, 0x30, 0x20, 0x38, 0x00, 0x00, 0x00, 0x38, 0x20, 0x30,
|
||||||
0x20, 0x20, 0x00, 0x00, 0x00, 0x38, 0x20, 0x28, 0x28, 0x38, 0x00, 0x00,
|
0x20, 0x20, 0x00, 0x00, 0x00, 0x38, 0x20, 0x28, 0x28, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x28, 0x28, 0x38, 0x28, 0x28, 0x00, 0x00, 0x00, 0x38, 0x10, 0x10,
|
0x00, 0x28, 0x28, 0x38, 0x28, 0x28, 0x00, 0x00, 0x00, 0x38, 0x10, 0x10,
|
||||||
0x10, 0x38, 0x00, 0x00, 0x00, 0x38, 0x08, 0x08, 0x28, 0x18, 0x00, 0x00,
|
0x10, 0x38, 0x00, 0x00, 0x00, 0x38, 0x08, 0x08, 0x28, 0x18, 0x00, 0x00,
|
||||||
0x00, 0x28, 0x28, 0x30, 0x28, 0x28, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20,
|
0x00, 0x28, 0x28, 0x30, 0x28, 0x28, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20,
|
||||||
0x20, 0x38, 0x00, 0x00, 0x00, 0x28, 0x38, 0x38, 0x28, 0x28, 0x00, 0x00,
|
0x20, 0x38, 0x00, 0x00, 0x00, 0x28, 0x38, 0x38, 0x28, 0x28, 0x00, 0x00,
|
||||||
0x00, 0x28, 0x38, 0x38, 0x38, 0x28, 0x00, 0x00, 0x00, 0x38, 0x28, 0x28,
|
0x00, 0x28, 0x38, 0x38, 0x38, 0x28, 0x00, 0x00, 0x00, 0x38, 0x28, 0x28,
|
||||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x20, 0x20, 0x00, 0x00,
|
0x28, 0x38, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x20, 0x20, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x28, 0x28, 0x38, 0x18, 0x00, 0x00, 0x00, 0x38, 0x28, 0x30,
|
0x00, 0x38, 0x28, 0x28, 0x38, 0x18, 0x00, 0x00, 0x00, 0x38, 0x28, 0x30,
|
||||||
0x28, 0x28, 0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x08, 0x38, 0x00, 0x00,
|
0x28, 0x28, 0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x08, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28,
|
0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28,
|
||||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00,
|
0x28, 0x38, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00,
|
||||||
0x00, 0x28, 0x28, 0x38, 0x38, 0x28, 0x00, 0x00, 0x00, 0x28, 0x28, 0x10,
|
0x00, 0x28, 0x28, 0x38, 0x38, 0x28, 0x00, 0x00, 0x00, 0x28, 0x28, 0x10,
|
||||||
0x28, 0x28, 0x00, 0x00, 0x00, 0x28, 0x28, 0x38, 0x10, 0x10, 0x00, 0x00,
|
0x28, 0x28, 0x00, 0x00, 0x00, 0x28, 0x28, 0x38, 0x10, 0x10, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x08, 0x10, 0x20, 0x38, 0x00, 0x00, 0x00, 0x30, 0x20, 0x20,
|
0x00, 0x38, 0x08, 0x10, 0x20, 0x38, 0x00, 0x00, 0x00, 0x30, 0x20, 0x20,
|
||||||
0x20, 0x30, 0x00, 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x08, 0x00, 0x00,
|
0x20, 0x30, 0x00, 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x08, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x08, 0x08, 0x08, 0x18, 0x00, 0x00, 0x00, 0x10, 0x28, 0x00,
|
0x00, 0x18, 0x08, 0x08, 0x08, 0x18, 0x00, 0x00, 0x00, 0x10, 0x28, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
|
0x00, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
|
||||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x20, 0x20, 0x38, 0x28, 0x38, 0x00, 0x00,
|
0x28, 0x18, 0x00, 0x00, 0x00, 0x20, 0x20, 0x38, 0x28, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x00, 0x00, 0x00, 0x08, 0x08, 0x38,
|
0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x00, 0x00, 0x00, 0x08, 0x08, 0x38,
|
||||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x18, 0x00, 0x00,
|
0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x18, 0x00, 0x00,
|
||||||
0x00, 0x08, 0x10, 0x38, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x18, 0x28,
|
0x00, 0x08, 0x10, 0x38, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x18, 0x28,
|
||||||
0x18, 0x08, 0x30, 0x00, 0x00, 0x20, 0x20, 0x38, 0x28, 0x28, 0x00, 0x00,
|
0x18, 0x08, 0x30, 0x00, 0x00, 0x20, 0x20, 0x38, 0x28, 0x28, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
|
0x00, 0x00, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
|
||||||
0x10, 0x10, 0x20, 0x00, 0x00, 0x20, 0x20, 0x28, 0x30, 0x28, 0x00, 0x00,
|
0x10, 0x10, 0x20, 0x00, 0x00, 0x20, 0x20, 0x28, 0x30, 0x28, 0x00, 0x00,
|
||||||
0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x20, 0x38,
|
0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x20, 0x38,
|
||||||
0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x28, 0x28, 0x00, 0x00,
|
0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x28, 0x28, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
|
0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
|
||||||
0x28, 0x38, 0x20, 0x00, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x08, 0x00,
|
0x28, 0x38, 0x20, 0x00, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x08, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x38, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
|
0x00, 0x00, 0x00, 0x38, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
|
||||||
0x10, 0x30, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x10, 0x10, 0x00, 0x00,
|
0x10, 0x30, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x10, 0x10, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x28, 0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28,
|
0x00, 0x00, 0x00, 0x28, 0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28,
|
||||||
0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x00, 0x00,
|
0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x28, 0x10, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28,
|
0x00, 0x00, 0x00, 0x28, 0x10, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28,
|
||||||
0x28, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x18, 0x00, 0x00,
|
0x28, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x18, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x10, 0x20, 0x10, 0x18, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,
|
0x00, 0x18, 0x10, 0x20, 0x10, 0x18, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,
|
||||||
0x10, 0x10, 0x00, 0x00, 0x00, 0x30, 0x10, 0x08, 0x10, 0x30, 0x00, 0x00,
|
0x10, 0x10, 0x00, 0x00, 0x00, 0x30, 0x10, 0x08, 0x10, 0x30, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28,
|
0x00, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28,
|
||||||
0x38, 0x00, 0x00, 0x00, 0x00, 0x18, 0x20, 0x20, 0x20, 0x18, 0x30, 0x00,
|
0x38, 0x00, 0x00, 0x00, 0x00, 0x18, 0x20, 0x20, 0x20, 0x18, 0x30, 0x00,
|
||||||
0x00, 0x28, 0x00, 0x28, 0x28, 0x18, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18,
|
0x00, 0x28, 0x00, 0x28, 0x28, 0x18, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18,
|
||||||
0x38, 0x18, 0x00, 0x00, 0x00, 0x38, 0x00, 0x18, 0x28, 0x18, 0x00, 0x00,
|
0x38, 0x18, 0x00, 0x00, 0x00, 0x38, 0x00, 0x18, 0x28, 0x18, 0x00, 0x00,
|
||||||
0x00, 0x28, 0x00, 0x18, 0x28, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x18,
|
0x00, 0x28, 0x00, 0x18, 0x28, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x18,
|
||||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x10, 0x18, 0x28, 0x18, 0x00, 0x00,
|
0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x10, 0x18, 0x28, 0x18, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x10, 0x00, 0x00, 0x38, 0x00, 0x18,
|
0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x10, 0x00, 0x00, 0x38, 0x00, 0x18,
|
||||||
0x38, 0x18, 0x00, 0x00, 0x00, 0x28, 0x00, 0x18, 0x38, 0x18, 0x00, 0x00,
|
0x38, 0x18, 0x00, 0x00, 0x00, 0x28, 0x00, 0x18, 0x38, 0x18, 0x00, 0x00,
|
||||||
0x00, 0x30, 0x00, 0x18, 0x38, 0x18, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00,
|
0x00, 0x30, 0x00, 0x18, 0x38, 0x18, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00,
|
||||||
0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x10, 0x10, 0x00, 0x00,
|
0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x10, 0x10, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x30, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x28, 0x10, 0x28,
|
0x00, 0x00, 0x30, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x28, 0x10, 0x28,
|
||||||
0x38, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x38, 0x28, 0x00, 0x00,
|
0x38, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x38, 0x28, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x00, 0x38, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
0x00, 0x18, 0x00, 0x38, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
||||||
0x28, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x28, 0x3C, 0x28, 0x2C, 0x00, 0x00,
|
0x28, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x28, 0x3C, 0x28, 0x2C, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x28, 0x00, 0x38,
|
0x00, 0x38, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x28, 0x00, 0x38,
|
||||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x30, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00,
|
0x28, 0x38, 0x00, 0x00, 0x00, 0x30, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x00, 0x28, 0x28, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x28,
|
0x00, 0x38, 0x00, 0x28, 0x28, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x28,
|
||||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28, 0x28, 0x18, 0x30, 0x00,
|
0x28, 0x18, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28, 0x28, 0x18, 0x30, 0x00,
|
||||||
0x00, 0x28, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28,
|
0x00, 0x28, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28,
|
||||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x10, 0x38, 0x20, 0x38, 0x10, 0x00, 0x00,
|
0x28, 0x38, 0x00, 0x00, 0x00, 0x10, 0x38, 0x20, 0x38, 0x10, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x14, 0x30, 0x10, 0x3C, 0x00, 0x00, 0x00, 0x28, 0x10, 0x38,
|
0x00, 0x18, 0x14, 0x30, 0x10, 0x3C, 0x00, 0x00, 0x00, 0x28, 0x10, 0x38,
|
||||||
0x38, 0x10, 0x00, 0x00, 0x00, 0x30, 0x28, 0x3C, 0x28, 0x2C, 0x00, 0x00,
|
0x38, 0x10, 0x00, 0x00, 0x00, 0x30, 0x28, 0x3C, 0x28, 0x2C, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x10, 0x38, 0x10, 0x30, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18,
|
0x00, 0x18, 0x10, 0x38, 0x10, 0x30, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18,
|
||||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x10, 0x10, 0x00, 0x00,
|
0x28, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x10, 0x10, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x18, 0x00, 0x28,
|
0x00, 0x18, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x18, 0x00, 0x28,
|
||||||
0x28, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x28, 0x28, 0x00, 0x00,
|
0x28, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x28, 0x28, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x00, 0x28, 0x38, 0x28, 0x00, 0x00, 0x00, 0x18, 0x28, 0x18,
|
0x00, 0x38, 0x00, 0x28, 0x38, 0x28, 0x00, 0x00, 0x00, 0x18, 0x28, 0x18,
|
||||||
0x00, 0x38, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0x38, 0x00, 0x00,
|
0x00, 0x38, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x10, 0x00, 0x10, 0x20, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
0x00, 0x10, 0x00, 0x10, 0x20, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
||||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x00, 0x00, 0x00,
|
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x20, 0x28, 0x10, 0x38, 0x18, 0x00, 0x00, 0x00, 0x20, 0x28, 0x18,
|
0x00, 0x20, 0x28, 0x10, 0x38, 0x18, 0x00, 0x00, 0x00, 0x20, 0x28, 0x18,
|
||||||
0x38, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00,
|
0x38, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x14, 0x28, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x14,
|
0x00, 0x00, 0x14, 0x28, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x14,
|
||||||
0x28, 0x00, 0x00, 0x00, 0x00, 0x08, 0x20, 0x08, 0x20, 0x08, 0x20, 0x00,
|
0x28, 0x00, 0x00, 0x00, 0x00, 0x08, 0x20, 0x08, 0x20, 0x08, 0x20, 0x00,
|
||||||
0x00, 0x14, 0x28, 0x14, 0x28, 0x14, 0x28, 0x00, 0x00, 0x34, 0x1C, 0x34,
|
0x00, 0x14, 0x28, 0x14, 0x28, 0x14, 0x28, 0x00, 0x00, 0x34, 0x1C, 0x34,
|
||||||
0x1C, 0x34, 0x1C, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00,
|
0x1C, 0x34, 0x1C, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00,
|
||||||
0x00, 0x10, 0x10, 0x30, 0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x30,
|
0x00, 0x10, 0x10, 0x30, 0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x30,
|
||||||
0x30, 0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x38, 0x18, 0x18, 0x18, 0x00,
|
0x30, 0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x38, 0x18, 0x18, 0x18, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x30,
|
0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x30,
|
||||||
0x30, 0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x38, 0x38, 0x18, 0x18, 0x00,
|
0x30, 0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x38, 0x38, 0x18, 0x18, 0x00,
|
||||||
0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x38,
|
0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x38,
|
||||||
0x38, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x38, 0x38, 0x00, 0x00, 0x00,
|
0x38, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x38, 0x38, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x18, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x30,
|
0x00, 0x18, 0x18, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x30,
|
||||||
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x00,
|
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x00,
|
||||||
0x00, 0x10, 0x10, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x3C,
|
0x00, 0x10, 0x10, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x3C,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x10, 0x10, 0x10, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x10, 0x10, 0x10, 0x00,
|
||||||
0x00, 0x10, 0x10, 0x1C, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3C,
|
0x00, 0x10, 0x10, 0x1C, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3C,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x00,
|
||||||
0x00, 0x10, 0x10, 0x1C, 0x1C, 0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x1C,
|
0x00, 0x10, 0x10, 0x1C, 0x1C, 0x10, 0x10, 0x00, 0x00, 0x18, 0x18, 0x1C,
|
||||||
0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x1C, 0x1C, 0x00, 0x00, 0x00,
|
0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x1C, 0x1C, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x1C, 0x1C, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x3C,
|
0x00, 0x00, 0x00, 0x1C, 0x1C, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x3C,
|
||||||
0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3C, 0x18, 0x18, 0x00,
|
0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3C, 0x18, 0x18, 0x00,
|
||||||
0x00, 0x18, 0x18, 0x1C, 0x1C, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x3C,
|
0x00, 0x18, 0x18, 0x1C, 0x1C, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x3C,
|
||||||
0x3C, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00,
|
0x3C, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00,
|
||||||
0x00, 0x10, 0x10, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3C,
|
0x00, 0x10, 0x10, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3C,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3C, 0x10, 0x10, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3C, 0x10, 0x10, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x1C,
|
0x00, 0x00, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x1C,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x1C, 0x1C, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x1C, 0x1C, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x1C, 0x1C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
0x00, 0x00, 0x00, 0x1C, 0x1C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
||||||
0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x3C, 0x18, 0x18, 0x18, 0x00,
|
0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x3C, 0x18, 0x18, 0x18, 0x00,
|
||||||
0x00, 0x10, 0x10, 0x3C, 0x3C, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x30,
|
0x00, 0x10, 0x10, 0x3C, 0x3C, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x30,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x10, 0x10, 0x10, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x10, 0x10, 0x10, 0x00,
|
||||||
0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00,
|
0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00,
|
||||||
0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x00, 0x00, 0x3C, 0x3C, 0x3C,
|
0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x00, 0x00, 0x3C, 0x3C, 0x3C,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x28, 0x34, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x28, 0x34, 0x00, 0x00,
|
||||||
0x00, 0x30, 0x28, 0x30, 0x28, 0x30, 0x20, 0x00, 0x00, 0x38, 0x28, 0x20,
|
0x00, 0x30, 0x28, 0x30, 0x28, 0x30, 0x20, 0x00, 0x00, 0x38, 0x28, 0x20,
|
||||||
0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x18, 0x18, 0x00, 0x00,
|
0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x18, 0x18, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x20, 0x10, 0x20, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
0x00, 0x38, 0x20, 0x10, 0x20, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C,
|
||||||
0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x30, 0x20, 0x00, 0x00,
|
0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x30, 0x20, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x14, 0x28, 0x08, 0x08, 0x00, 0x00, 0x00, 0x38, 0x10, 0x28,
|
0x00, 0x00, 0x14, 0x28, 0x08, 0x08, 0x00, 0x00, 0x00, 0x38, 0x10, 0x28,
|
||||||
0x10, 0x38, 0x00, 0x00, 0x00, 0x10, 0x28, 0x38, 0x28, 0x10, 0x00, 0x00,
|
0x10, 0x38, 0x00, 0x00, 0x00, 0x10, 0x28, 0x38, 0x28, 0x10, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x24, 0x24, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x18, 0x10, 0x18,
|
0x00, 0x18, 0x24, 0x24, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x18, 0x10, 0x18,
|
||||||
0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, 0x00,
|
0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x04, 0x18, 0x3C, 0x18, 0x20, 0x00, 0x00, 0x00, 0x18, 0x20, 0x30,
|
0x00, 0x04, 0x18, 0x3C, 0x18, 0x20, 0x00, 0x00, 0x00, 0x18, 0x20, 0x30,
|
||||||
0x20, 0x18, 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00,
|
0x20, 0x18, 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00,
|
||||||
0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x00, 0x00, 0x10, 0x38, 0x10,
|
0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x00, 0x00, 0x10, 0x38, 0x10,
|
||||||
0x00, 0x38, 0x00, 0x00, 0x00, 0x10, 0x08, 0x10, 0x00, 0x38, 0x00, 0x00,
|
0x00, 0x38, 0x00, 0x00, 0x00, 0x10, 0x08, 0x10, 0x00, 0x38, 0x00, 0x00,
|
||||||
0x00, 0x10, 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x00, 0x10, 0x28, 0x20,
|
0x00, 0x10, 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x00, 0x10, 0x28, 0x20,
|
||||||
0x20, 0x20, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x28, 0x10, 0x00, 0x00,
|
0x20, 0x20, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x28, 0x10, 0x00, 0x00,
|
||||||
0x00, 0x10, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38,
|
0x00, 0x10, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38,
|
||||||
0x30, 0x00, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00,
|
0x30, 0x00, 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
|
0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x10, 0x10, 0x30, 0x10, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x10, 0x10, 0x30, 0x10, 0x00, 0x00,
|
||||||
0x00, 0x30, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x38,
|
0x00, 0x30, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x38,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||||
};
|
};
|
||||||
|
|
|
@ -37,94 +37,94 @@ void loadwaves(void);
|
||||||
|
|
||||||
static unsigned int F_CALLBACKAPI f_open(const char *name)
|
static unsigned int F_CALLBACKAPI f_open(const char *name)
|
||||||
{
|
{
|
||||||
return kopen4load((char *)name, 0) + 1;
|
return kopen4load((char *)name, 0) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void F_CALLBACKAPI f_close(unsigned int handle)
|
static void F_CALLBACKAPI f_close(unsigned int handle)
|
||||||
{
|
{
|
||||||
kclose(handle - 1);
|
kclose(handle - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int F_CALLBACKAPI f_read(void *buffer, int size, unsigned int handle)
|
static int F_CALLBACKAPI f_read(void *buffer, int size, unsigned int handle)
|
||||||
{
|
{
|
||||||
return kread(handle - 1, buffer, size);
|
return kread(handle - 1, buffer, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int F_CALLBACKAPI f_seek(unsigned int handle, int pos, signed char mode)
|
static int F_CALLBACKAPI f_seek(unsigned int handle, int pos, signed char mode)
|
||||||
{
|
{
|
||||||
return klseek(handle - 1, pos, mode);
|
return klseek(handle - 1, pos, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int F_CALLBACKAPI f_tell(unsigned int handle)
|
static int F_CALLBACKAPI f_tell(unsigned int handle)
|
||||||
{
|
{
|
||||||
return ktell(handle - 1);
|
return ktell(handle - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void initsb(char dadigistat, char damusistat, long dasamplerate, char danumspeakers, char dabytespersample, char daintspersec, char daquality)
|
void initsb(char dadigistat, char damusistat, long dasamplerate, char danumspeakers, char dabytespersample, char daintspersec, char daquality)
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
int i,j;
|
int i,j;
|
||||||
|
|
||||||
if (fmod_inited) return;
|
if (fmod_inited) return;
|
||||||
fmod_inited = 0;
|
fmod_inited = 0;
|
||||||
|
|
||||||
if (dasamplerate < 6000) dasamplerate = 6000;
|
if (dasamplerate < 6000) dasamplerate = 6000;
|
||||||
else if (dasamplerate > 48000) dasamplerate = 48000;
|
else if (dasamplerate > 48000) dasamplerate = 48000;
|
||||||
|
|
||||||
musicstat = damusistat;
|
musicstat = damusistat;
|
||||||
|
|
||||||
printOSD("Initialising FMOD...\n");
|
printOSD("Initialising FMOD...\n");
|
||||||
printOSD(" Linked version: %.02f\n", FMOD_VERSION);
|
printOSD(" Linked version: %.02f\n", FMOD_VERSION);
|
||||||
printOSD(" DLL version: %.02f\n", FSOUND_GetVersion());
|
printOSD(" DLL version: %.02f\n", FSOUND_GetVersion());
|
||||||
|
|
||||||
if (FSOUND_GetVersion() < FMOD_VERSION) {
|
if (FSOUND_GetVersion() < FMOD_VERSION) {
|
||||||
printOSD(" ... Failure: FMOD DLL too old! Sound disabled.\n");
|
printOSD(" ... Failure: FMOD DLL too old! Sound disabled.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printOSD(" Samplerate: %d hz\n", dasamplerate);
|
printOSD(" Samplerate: %d hz\n", dasamplerate);
|
||||||
|
|
||||||
//FSOUND_SetOutput(FSOUND_OUTPUT_ASIO);
|
//FSOUND_SetOutput(FSOUND_OUTPUT_ASIO);
|
||||||
|
|
||||||
if (FSOUND_Init(dasamplerate, NUMCHANNELS, 0)) {
|
if (FSOUND_Init(dasamplerate, NUMCHANNELS, 0)) {
|
||||||
printOSD(" ... Success\n");
|
printOSD(" ... Success\n");
|
||||||
fmod_inited = 1;
|
fmod_inited = 1;
|
||||||
} else {
|
} else {
|
||||||
printOSD(" ... Failure: %s\n", FMOD_ErrorString(FSOUND_GetError()));
|
printOSD(" ... Failure: %s\n", FMOD_ErrorString(FSOUND_GetError()));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (FSOUND_GetOutput()) {
|
switch (FSOUND_GetOutput()) {
|
||||||
case FSOUND_OUTPUT_NOSOUND: s = "No Sound"; break;
|
case FSOUND_OUTPUT_NOSOUND: s = "No Sound"; break;
|
||||||
case FSOUND_OUTPUT_WINMM: s = "WINMM"; break;
|
case FSOUND_OUTPUT_WINMM: s = "WINMM"; break;
|
||||||
case FSOUND_OUTPUT_DSOUND: s = "DirectSound"; break;
|
case FSOUND_OUTPUT_DSOUND: s = "DirectSound"; break;
|
||||||
case FSOUND_OUTPUT_OSS: s = "OSS"; break;
|
case FSOUND_OUTPUT_OSS: s = "OSS"; break;
|
||||||
case FSOUND_OUTPUT_ESD: s = "ESound"; break;
|
case FSOUND_OUTPUT_ESD: s = "ESound"; break;
|
||||||
case FSOUND_OUTPUT_ALSA: s = "ALSA"; break;
|
case FSOUND_OUTPUT_ALSA: s = "ALSA"; break;
|
||||||
case FSOUND_OUTPUT_ASIO: s = "ASIO"; break;
|
case FSOUND_OUTPUT_ASIO: s = "ASIO"; break;
|
||||||
default: s = "Other"; break;
|
default: s = "Other"; break;
|
||||||
}
|
}
|
||||||
printOSD("Using FMOD \"%s\" output driver\n", s);
|
printOSD("Using FMOD \"%s\" output driver\n", s);
|
||||||
|
|
||||||
FSOUND_File_SetCallbacks(
|
FSOUND_File_SetCallbacks(
|
||||||
(FSOUND_OPENCALLBACK)f_open,
|
(FSOUND_OPENCALLBACK)f_open,
|
||||||
(FSOUND_CLOSECALLBACK)f_close,
|
(FSOUND_CLOSECALLBACK)f_close,
|
||||||
(FSOUND_READCALLBACK)f_read,
|
(FSOUND_READCALLBACK)f_read,
|
||||||
(FSOUND_SEEKCALLBACK)f_seek,
|
(FSOUND_SEEKCALLBACK)f_seek,
|
||||||
(FSOUND_TELLCALLBACK)f_tell);
|
(FSOUND_TELLCALLBACK)f_tell);
|
||||||
//FSOUND_SetMemorySystem(fmod_cache, fmod_cachelen, NULL, NULL, NULL);
|
//FSOUND_SetMemorySystem(fmod_cache, fmod_cachelen, NULL, NULL, NULL);
|
||||||
|
|
||||||
loadwaves();
|
loadwaves();
|
||||||
|
|
||||||
for (i=0; i<NUMCHANNELS; i++) channels[i] = -1;
|
for (i=0; i<NUMCHANNELS; i++) channels[i] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void uninitsb(void)
|
void uninitsb(void)
|
||||||
{
|
{
|
||||||
if (fmod_inited) {
|
if (fmod_inited) {
|
||||||
FSOUND_Close();
|
FSOUND_Close();
|
||||||
fmod_inited = 0;
|
fmod_inited = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -135,189 +135,189 @@ void setears(long daposx, long daposy, long daxvect, long dayvect)
|
||||||
|
|
||||||
void wsayfollow(char *dafilename, long dafreq, long davol, long *daxplc, long *dayplc, char followstat)
|
void wsayfollow(char *dafilename, long dafreq, long davol, long *daxplc, long *dayplc, char followstat)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
dafilename:
|
dafilename:
|
||||||
filename
|
filename
|
||||||
|
|
||||||
dafreq:
|
dafreq:
|
||||||
4096 = Middle C
|
4096 = Middle C
|
||||||
8192 = +1 8ve
|
8192 = +1 8ve
|
||||||
|
|
||||||
davol:
|
davol:
|
||||||
0-256 = volume
|
0-256 = volume
|
||||||
|
|
||||||
daxplc:
|
daxplc:
|
||||||
dayplc:
|
dayplc:
|
||||||
followstat: 0 = sound emination origin (fixed)
|
followstat: 0 = sound emination origin (fixed)
|
||||||
followstat: 1 = pointer to sprite coordinates (dynamic)
|
followstat: 1 = pointer to sprite coordinates (dynamic)
|
||||||
|
|
||||||
followstat:
|
followstat:
|
||||||
0 = position is fixed in space
|
0 = position is fixed in space
|
||||||
1 = position follows an object
|
1 = position follows an object
|
||||||
*/
|
*/
|
||||||
unsigned char ch1, ch2;
|
unsigned char ch1, ch2;
|
||||||
long i, wavnum, bad, oldest=0, free=-1, ox, oy, x, y, vo;
|
long i, wavnum, bad, oldest=0, free=-1, ox, oy, x, y, vo;
|
||||||
unsigned int oldestpos=0;
|
unsigned int oldestpos=0;
|
||||||
int chan;
|
int chan;
|
||||||
|
|
||||||
if (fmod_inited == 0) return;
|
if (fmod_inited == 0) return;
|
||||||
|
|
||||||
for (wavnum=numwaves-1;wavnum>=0;wavnum--) {
|
for (wavnum=numwaves-1;wavnum>=0;wavnum--) {
|
||||||
bad = 0;
|
bad = 0;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while ((dafilename[i] > 0) && (i < 16))
|
while ((dafilename[i] > 0) && (i < 16))
|
||||||
{
|
{
|
||||||
ch1 = dafilename[i]; if ((ch1 >= 97) && (ch1 <= 123)) ch1 -= 32;
|
ch1 = dafilename[i]; if ((ch1 >= 97) && (ch1 <= 123)) ch1 -= 32;
|
||||||
ch2 = instname[wavnum][i]; if ((ch2 >= 97) && (ch2 <= 123)) ch2 -= 32;
|
ch2 = instname[wavnum][i]; if ((ch2 >= 97) && (ch2 <= 123)) ch2 -= 32;
|
||||||
if (ch1 != ch2) {bad = 1; break;}
|
if (ch1 != ch2) {bad = 1; break;}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (bad != 0) continue;
|
if (bad != 0) continue;
|
||||||
|
|
||||||
for (i=0; i<NUMCHANNELS; i++) {
|
for (i=0; i<NUMCHANNELS; i++) {
|
||||||
if (!FSOUND_IsPlaying(channels[i])) {
|
if (!FSOUND_IsPlaying(channels[i])) {
|
||||||
free = i;
|
free = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i==0) continue;
|
if (i==0) continue;
|
||||||
|
|
||||||
if (FSOUND_GetCurrentPosition(channels[i]) > oldestpos) {
|
if (FSOUND_GetCurrentPosition(channels[i]) > oldestpos) {
|
||||||
oldest = i;
|
oldest = i;
|
||||||
oldestpos = FSOUND_GetCurrentPosition(channels[i]);
|
oldestpos = FSOUND_GetCurrentPosition(channels[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (free < 0) {
|
if (free < 0) {
|
||||||
FSOUND_StopSound(channels[oldest]);
|
FSOUND_StopSound(channels[oldest]);
|
||||||
free = oldest;
|
free = oldest;
|
||||||
}
|
}
|
||||||
|
|
||||||
chan = FSOUND_PlaySoundEx(FSOUND_FREE, samples[wavnum], NULL, 1);
|
chan = FSOUND_PlaySoundEx(FSOUND_FREE, samples[wavnum], NULL, 1);
|
||||||
if (chan == -1) return;
|
if (chan == -1) return;
|
||||||
FSOUND_SetFrequency(chan, dafreq*11025/4096);
|
FSOUND_SetFrequency(chan, dafreq*11025/4096);
|
||||||
FSOUND_SetVolume(chan, davol);
|
FSOUND_SetVolume(chan, davol);
|
||||||
|
|
||||||
FSOUND_SetPaused(chan, 0);
|
FSOUND_SetPaused(chan, 0);
|
||||||
|
|
||||||
channels[free] = chan;
|
channels[free] = chan;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wsay(char *dafilename, long dafreq, long volume1, long volume2)
|
void wsay(char *dafilename, long dafreq, long volume1, long volume2)
|
||||||
{
|
{
|
||||||
unsigned char ch1, ch2;
|
unsigned char ch1, ch2;
|
||||||
long i, j, bad, free=-1, oldest=0;
|
long i, j, bad, free=-1, oldest=0;
|
||||||
unsigned int oldestpos=0;
|
unsigned int oldestpos=0;
|
||||||
int chan;
|
int chan;
|
||||||
|
|
||||||
if (fmod_inited == 0) return;
|
if (fmod_inited == 0) return;
|
||||||
|
|
||||||
i = numwaves-1;
|
i = numwaves-1;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
bad = 0;
|
bad = 0;
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
while ((dafilename[j] > 0) && (j < 16))
|
while ((dafilename[j] > 0) && (j < 16))
|
||||||
{
|
{
|
||||||
ch1 = dafilename[j]; if ((ch1 >= 97) && (ch1 <= 123)) ch1 -= 32;
|
ch1 = dafilename[j]; if ((ch1 >= 97) && (ch1 <= 123)) ch1 -= 32;
|
||||||
ch2 = instname[i][j]; if ((ch2 >= 97) && (ch2 <= 123)) ch2 -= 32;
|
ch2 = instname[i][j]; if ((ch2 >= 97) && (ch2 <= 123)) ch2 -= 32;
|
||||||
if (ch1 != ch2) {bad = 1; break;}
|
if (ch1 != ch2) {bad = 1; break;}
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
if (bad == 0)
|
if (bad == 0)
|
||||||
{
|
{
|
||||||
for (j=0; j<NUMCHANNELS; j++) {
|
for (j=0; j<NUMCHANNELS; j++) {
|
||||||
if (!FSOUND_IsPlaying(channels[j])) {
|
if (!FSOUND_IsPlaying(channels[j])) {
|
||||||
free = j;
|
free = j;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (j==0) continue;
|
if (j==0) continue;
|
||||||
|
|
||||||
if (FSOUND_GetCurrentPosition(channels[j]) > oldestpos) {
|
if (FSOUND_GetCurrentPosition(channels[j]) > oldestpos) {
|
||||||
oldest = j;
|
oldest = j;
|
||||||
oldestpos = FSOUND_GetCurrentPosition(channels[j]);
|
oldestpos = FSOUND_GetCurrentPosition(channels[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (free < 0) {
|
if (free < 0) {
|
||||||
FSOUND_StopSound(channels[oldest]);
|
FSOUND_StopSound(channels[oldest]);
|
||||||
free = oldest;
|
free = oldest;
|
||||||
}
|
}
|
||||||
|
|
||||||
chan = FSOUND_PlaySoundEx(FSOUND_FREE, samples[i], NULL, 1);
|
chan = FSOUND_PlaySoundEx(FSOUND_FREE, samples[i], NULL, 1);
|
||||||
if (chan == -1) return;
|
if (chan == -1) return;
|
||||||
FSOUND_SetFrequency(chan, dafreq*11025/4096);
|
FSOUND_SetFrequency(chan, dafreq*11025/4096);
|
||||||
FSOUND_SetVolume(chan, (volume1*volume2)>>1);
|
FSOUND_SetVolume(chan, (volume1*volume2)>>1);
|
||||||
// set pan
|
// set pan
|
||||||
FSOUND_SetPaused(chan, 0);
|
FSOUND_SetPaused(chan, 0);
|
||||||
|
|
||||||
channels[free] = chan;
|
channels[free] = chan;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
i--;
|
i--;
|
||||||
} while (i >= 0);
|
} while (i >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void loadwaves(void)
|
void loadwaves(void)
|
||||||
{
|
{
|
||||||
long fil, dawaversionum, i, tmp;
|
long fil, dawaversionum, i, tmp;
|
||||||
long wavleng[MAXWAVES], repstart[MAXWAVES], repleng[MAXWAVES], finetune[MAXWAVES];
|
long wavleng[MAXWAVES], repstart[MAXWAVES], repleng[MAXWAVES], finetune[MAXWAVES];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
fil = kopen4load("WAVES.KWV", 0);
|
fil = kopen4load("WAVES.KWV", 0);
|
||||||
|
|
||||||
if (fil != -1) {
|
if (fil != -1) {
|
||||||
kread(fil, &dawaversionum, 4); dawaversionum = B_LITTLE32(dawaversionum);
|
kread(fil, &dawaversionum, 4); dawaversionum = B_LITTLE32(dawaversionum);
|
||||||
if (dawaversionum != 0) { kclose(fil); return; }
|
if (dawaversionum != 0) { kclose(fil); return; }
|
||||||
|
|
||||||
kread(fil, &numwaves, 4); numwaves = B_LITTLE32(numwaves);
|
kread(fil, &numwaves, 4); numwaves = B_LITTLE32(numwaves);
|
||||||
for (i=0; i<numwaves; i++) {
|
for (i=0; i<numwaves; i++) {
|
||||||
kread(fil, &instname[i][0], 16);
|
kread(fil, &instname[i][0], 16);
|
||||||
kread(fil, &wavleng[i], 4); wavleng[i] = B_LITTLE32(wavleng[i]);
|
kread(fil, &wavleng[i], 4); wavleng[i] = B_LITTLE32(wavleng[i]);
|
||||||
kread(fil, &repstart[i], 4); repstart[i] = B_LITTLE32(repstart[i]);
|
kread(fil, &repstart[i], 4); repstart[i] = B_LITTLE32(repstart[i]);
|
||||||
kread(fil, &repleng[i], 4); repleng[i] = B_LITTLE32(repleng[i]);
|
kread(fil, &repleng[i], 4); repleng[i] = B_LITTLE32(repleng[i]);
|
||||||
kread(fil, &finetune[i], 4); finetune[i] = B_LITTLE32(finetune[i]);
|
kread(fil, &finetune[i], 4); finetune[i] = B_LITTLE32(finetune[i]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dawaversionum = 0;
|
dawaversionum = 0;
|
||||||
numwaves = 0;
|
numwaves = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=numwaves; i<MAXWAVES; i++) {
|
for (i=numwaves; i<MAXWAVES; i++) {
|
||||||
memset(&instname[i][0], 0, 16);
|
memset(&instname[i][0], 0, 16);
|
||||||
wavleng[i] = 0;
|
wavleng[i] = 0;
|
||||||
repstart[i] = 0;
|
repstart[i] = 0;
|
||||||
repleng[i] = 0;
|
repleng[i] = 0;
|
||||||
finetune[i] = 0;
|
finetune[i] = 0;
|
||||||
samples[i] = NULL;
|
samples[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fil == -1) return;
|
if (fil == -1) return;
|
||||||
|
|
||||||
for (i=0; i<numwaves; i++) {
|
for (i=0; i<numwaves; i++) {
|
||||||
if (repleng[i]) tmp = FSOUND_LOOP_NORMAL;
|
if (repleng[i]) tmp = FSOUND_LOOP_NORMAL;
|
||||||
else tmp = FSOUND_LOOP_OFF;
|
else tmp = FSOUND_LOOP_OFF;
|
||||||
samples[i] = FSOUND_Sample_Alloc(FSOUND_FREE, wavleng[i], tmp, 11025, 255, 128, 1);
|
samples[i] = FSOUND_Sample_Alloc(FSOUND_FREE, wavleng[i], tmp, 11025, 255, 128, 1);
|
||||||
if (!samples[i]) continue;
|
if (!samples[i]) continue;
|
||||||
|
|
||||||
p = (char*)Bmalloc(wavleng[i]);
|
p = (char*)Bmalloc(wavleng[i]);
|
||||||
kread(fil,p,wavleng[i]);
|
kread(fil,p,wavleng[i]);
|
||||||
FSOUND_Sample_Upload(samples[i], p, FSOUND_8BITS | FSOUND_MONO | FSOUND_UNSIGNED);
|
FSOUND_Sample_Upload(samples[i], p, FSOUND_8BITS | FSOUND_MONO | FSOUND_UNSIGNED);
|
||||||
Bfree(p);
|
Bfree(p);
|
||||||
|
|
||||||
if (repleng[i]) FSOUND_Sample_SetLoopPoints(samples[i], repstart[i], repstart[i]+repleng[i]);
|
if (repleng[i]) FSOUND_Sample_SetLoopPoints(samples[i], repstart[i], repstart[i]+repleng[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
kclose(fil);
|
kclose(fil);
|
||||||
|
|
||||||
printOSD("Loaded %d waves\n", numwaves);
|
printOSD("Loaded %d waves\n", numwaves);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -327,29 +327,29 @@ static int musicplaying = 0;
|
||||||
|
|
||||||
void loadsong(char *filename)
|
void loadsong(char *filename)
|
||||||
{
|
{
|
||||||
if (!musicstat) return;
|
if (!musicstat) return;
|
||||||
if (musicstream) return;
|
if (musicstream) return;
|
||||||
#ifdef FMOD_PRE370
|
#ifdef FMOD_PRE370
|
||||||
musicstream = FSOUND_Stream_OpenFile(filename, FSOUND_LOOP_NORMAL, 0);
|
musicstream = FSOUND_Stream_OpenFile(filename, FSOUND_LOOP_NORMAL, 0);
|
||||||
#else
|
#else
|
||||||
musicstream = FSOUND_Stream_Open(filename, FSOUND_LOOP_NORMAL, 0, 0);
|
musicstream = FSOUND_Stream_Open(filename, FSOUND_LOOP_NORMAL, 0, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void musicon(void)
|
void musicon(void)
|
||||||
{
|
{
|
||||||
if (!musicstat) return;
|
if (!musicstat) return;
|
||||||
if (!musicstream || musicplaying) return;
|
if (!musicstream || musicplaying) return;
|
||||||
FSOUND_Stream_Play(FSOUND_FREE, musicstream);
|
FSOUND_Stream_Play(FSOUND_FREE, musicstream);
|
||||||
musicplaying = 1;
|
musicplaying = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void musicoff(void)
|
void musicoff(void)
|
||||||
{
|
{
|
||||||
if (!musicstat) return;
|
if (!musicstat) return;
|
||||||
if (!musicstream || !musicplaying) return;
|
if (!musicstream || !musicplaying) return;
|
||||||
FSOUND_Stream_Stop(musicstream);
|
FSOUND_Stream_Stop(musicstream);
|
||||||
musicplaying = 0;
|
musicplaying = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -4,176 +4,176 @@
|
||||||
// Generated by BIN2C.EXE by Jonathon Fowler
|
// Generated by BIN2C.EXE by Jonathon Fowler
|
||||||
|
|
||||||
char textfont[2048] = {
|
char textfont[2048] = {
|
||||||
// 2048 bytes
|
// 2048 bytes
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81,
|
||||||
0xBD, 0x99, 0x81, 0x7E, 0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E,
|
0xBD, 0x99, 0x81, 0x7E, 0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E,
|
||||||
0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00, 0x10, 0x38, 0x7C, 0xFE,
|
0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00, 0x10, 0x38, 0x7C, 0xFE,
|
||||||
0x7C, 0x38, 0x10, 0x00, 0x38, 0x7C, 0x38, 0xFE, 0xFE, 0x7C, 0x38, 0x7C,
|
0x7C, 0x38, 0x10, 0x00, 0x38, 0x7C, 0x38, 0xFE, 0xFE, 0x7C, 0x38, 0x7C,
|
||||||
0x10, 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x7C, 0x00, 0x00, 0x18, 0x3C,
|
0x10, 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x7C, 0x00, 0x00, 0x18, 0x3C,
|
||||||
0x3C, 0x18, 0x00, 0x00, 0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF,
|
0x3C, 0x18, 0x00, 0x00, 0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF,
|
||||||
0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00, 0xFF, 0xC3, 0x99, 0xBD,
|
0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00, 0xFF, 0xC3, 0x99, 0xBD,
|
||||||
0xBD, 0x99, 0xC3, 0xFF, 0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78,
|
0xBD, 0x99, 0xC3, 0xFF, 0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78,
|
||||||
0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x3F, 0x33, 0x3F, 0x30,
|
0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x3F, 0x33, 0x3F, 0x30,
|
||||||
0x30, 0x70, 0xF0, 0xE0, 0x7F, 0x63, 0x7F, 0x63, 0x63, 0x67, 0xE6, 0xC0,
|
0x30, 0x70, 0xF0, 0xE0, 0x7F, 0x63, 0x7F, 0x63, 0x63, 0x67, 0xE6, 0xC0,
|
||||||
0x99, 0x5A, 0x3C, 0xE7, 0xE7, 0x3C, 0x5A, 0x99, 0x80, 0xE0, 0xF8, 0xFE,
|
0x99, 0x5A, 0x3C, 0xE7, 0xE7, 0x3C, 0x5A, 0x99, 0x80, 0xE0, 0xF8, 0xFE,
|
||||||
0xF8, 0xE0, 0x80, 0x00, 0x02, 0x0E, 0x3E, 0xFE, 0x3E, 0x0E, 0x02, 0x00,
|
0xF8, 0xE0, 0x80, 0x00, 0x02, 0x0E, 0x3E, 0xFE, 0x3E, 0x0E, 0x02, 0x00,
|
||||||
0x18, 0x3C, 0x7E, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x66, 0x66, 0x66, 0x66,
|
0x18, 0x3C, 0x7E, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x66, 0x66, 0x66, 0x66,
|
||||||
0x66, 0x00, 0x66, 0x00, 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00,
|
0x66, 0x00, 0x66, 0x00, 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00,
|
||||||
0x3E, 0x63, 0x38, 0x6C, 0x6C, 0x38, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00,
|
0x3E, 0x63, 0x38, 0x6C, 0x6C, 0x38, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x7E, 0x7E, 0x7E, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF,
|
0x7E, 0x7E, 0x7E, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF,
|
||||||
0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18,
|
0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18,
|
||||||
0x7E, 0x3C, 0x18, 0x00, 0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00,
|
0x7E, 0x3C, 0x18, 0x00, 0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00,
|
||||||
0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0,
|
0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0,
|
||||||
0xC0, 0xFE, 0x00, 0x00, 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00,
|
0xC0, 0xFE, 0x00, 0x00, 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7E,
|
0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7E,
|
||||||
0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x30, 0x78, 0x78, 0x30, 0x30, 0x00, 0x30, 0x00, 0x6C, 0x6C, 0x6C, 0x00,
|
0x30, 0x78, 0x78, 0x30, 0x30, 0x00, 0x30, 0x00, 0x6C, 0x6C, 0x6C, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00,
|
||||||
0x30, 0x7C, 0xC0, 0x78, 0x0C, 0xF8, 0x30, 0x00, 0x00, 0xC6, 0xCC, 0x18,
|
0x30, 0x7C, 0xC0, 0x78, 0x0C, 0xF8, 0x30, 0x00, 0x00, 0xC6, 0xCC, 0x18,
|
||||||
0x30, 0x66, 0xC6, 0x00, 0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00,
|
0x30, 0x66, 0xC6, 0x00, 0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00,
|
||||||
0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x60,
|
0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x60,
|
||||||
0x60, 0x30, 0x18, 0x00, 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00,
|
0x60, 0x30, 0x18, 0x00, 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00,
|
||||||
0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, 0x00, 0x30, 0x30, 0xFC,
|
0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, 0x00, 0x30, 0x30, 0xFC,
|
||||||
0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60,
|
0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60,
|
||||||
0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x30, 0x30, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00,
|
0x00, 0x30, 0x30, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00,
|
||||||
0x7C, 0xC6, 0xCE, 0xDE, 0xF6, 0xE6, 0x7C, 0x00, 0x30, 0x70, 0x30, 0x30,
|
0x7C, 0xC6, 0xCE, 0xDE, 0xF6, 0xE6, 0x7C, 0x00, 0x30, 0x70, 0x30, 0x30,
|
||||||
0x30, 0x30, 0xFC, 0x00, 0x78, 0xCC, 0x0C, 0x38, 0x60, 0xCC, 0xFC, 0x00,
|
0x30, 0x30, 0xFC, 0x00, 0x78, 0xCC, 0x0C, 0x38, 0x60, 0xCC, 0xFC, 0x00,
|
||||||
0x78, 0xCC, 0x0C, 0x38, 0x0C, 0xCC, 0x78, 0x00, 0x1C, 0x3C, 0x6C, 0xCC,
|
0x78, 0xCC, 0x0C, 0x38, 0x0C, 0xCC, 0x78, 0x00, 0x1C, 0x3C, 0x6C, 0xCC,
|
||||||
0xFE, 0x0C, 0x1E, 0x00, 0xFC, 0xC0, 0xF8, 0x0C, 0x0C, 0xCC, 0x78, 0x00,
|
0xFE, 0x0C, 0x1E, 0x00, 0xFC, 0xC0, 0xF8, 0x0C, 0x0C, 0xCC, 0x78, 0x00,
|
||||||
0x38, 0x60, 0xC0, 0xF8, 0xCC, 0xCC, 0x78, 0x00, 0xFC, 0xCC, 0x0C, 0x18,
|
0x38, 0x60, 0xC0, 0xF8, 0xCC, 0xCC, 0x78, 0x00, 0xFC, 0xCC, 0x0C, 0x18,
|
||||||
0x30, 0x30, 0x30, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0xCC, 0xCC, 0x78, 0x00,
|
0x30, 0x30, 0x30, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0xCC, 0xCC, 0x78, 0x00,
|
||||||
0x78, 0xCC, 0xCC, 0x7C, 0x0C, 0x18, 0x70, 0x00, 0x00, 0x30, 0x30, 0x00,
|
0x78, 0xCC, 0xCC, 0x7C, 0x0C, 0x18, 0x70, 0x00, 0x00, 0x30, 0x30, 0x00,
|
||||||
0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x60,
|
0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x60,
|
||||||
0x18, 0x30, 0x60, 0xC0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x00, 0xFC, 0x00,
|
0x18, 0x30, 0x60, 0xC0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x00, 0xFC, 0x00,
|
||||||
0x00, 0xFC, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00,
|
0x00, 0xFC, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00,
|
||||||
0x78, 0xCC, 0x0C, 0x18, 0x30, 0x00, 0x30, 0x00, 0x7C, 0xC6, 0xDE, 0xDE,
|
0x78, 0xCC, 0x0C, 0x18, 0x30, 0x00, 0x30, 0x00, 0x7C, 0xC6, 0xDE, 0xDE,
|
||||||
0xDE, 0xC0, 0x78, 0x00, 0x30, 0x78, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0x00,
|
0xDE, 0xC0, 0x78, 0x00, 0x30, 0x78, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0x00,
|
||||||
0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00, 0x3C, 0x66, 0xC0, 0xC0,
|
0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00, 0x3C, 0x66, 0xC0, 0xC0,
|
||||||
0xC0, 0x66, 0x3C, 0x00, 0xF8, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00,
|
0xC0, 0x66, 0x3C, 0x00, 0xF8, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00,
|
||||||
0xFE, 0x62, 0x68, 0x78, 0x68, 0x62, 0xFE, 0x00, 0xFE, 0x62, 0x68, 0x78,
|
0xFE, 0x62, 0x68, 0x78, 0x68, 0x62, 0xFE, 0x00, 0xFE, 0x62, 0x68, 0x78,
|
||||||
0x68, 0x60, 0xF0, 0x00, 0x3C, 0x66, 0xC0, 0xC0, 0xCE, 0x66, 0x3E, 0x00,
|
0x68, 0x60, 0xF0, 0x00, 0x3C, 0x66, 0xC0, 0xC0, 0xCE, 0x66, 0x3E, 0x00,
|
||||||
0xCC, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0xCC, 0x00, 0x78, 0x30, 0x30, 0x30,
|
0xCC, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0xCC, 0x00, 0x78, 0x30, 0x30, 0x30,
|
||||||
0x30, 0x30, 0x78, 0x00, 0x1E, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00,
|
0x30, 0x30, 0x78, 0x00, 0x1E, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00,
|
||||||
0xE6, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0xE6, 0x00, 0xF0, 0x60, 0x60, 0x60,
|
0xE6, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0xE6, 0x00, 0xF0, 0x60, 0x60, 0x60,
|
||||||
0x62, 0x66, 0xFE, 0x00, 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00,
|
0x62, 0x66, 0xFE, 0x00, 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00,
|
||||||
0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00, 0x38, 0x6C, 0xC6, 0xC6,
|
0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00, 0x38, 0x6C, 0xC6, 0xC6,
|
||||||
0xC6, 0x6C, 0x38, 0x00, 0xFC, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00,
|
0xC6, 0x6C, 0x38, 0x00, 0xFC, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00,
|
||||||
0x78, 0xCC, 0xCC, 0xCC, 0xDC, 0x78, 0x1C, 0x00, 0xFC, 0x66, 0x66, 0x7C,
|
0x78, 0xCC, 0xCC, 0xCC, 0xDC, 0x78, 0x1C, 0x00, 0xFC, 0x66, 0x66, 0x7C,
|
||||||
0x6C, 0x66, 0xE6, 0x00, 0x78, 0xCC, 0xE0, 0x70, 0x1C, 0xCC, 0x78, 0x00,
|
0x6C, 0x66, 0xE6, 0x00, 0x78, 0xCC, 0xE0, 0x70, 0x1C, 0xCC, 0x78, 0x00,
|
||||||
0xFC, 0xB4, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0xCC, 0xCC, 0xCC, 0xCC,
|
0xFC, 0xB4, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0xCC, 0xCC, 0xCC, 0xCC,
|
||||||
0xCC, 0xCC, 0xFC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00,
|
0xCC, 0xCC, 0xFC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00,
|
||||||
0xC6, 0xC6, 0xC6, 0xD6, 0xFE, 0xEE, 0xC6, 0x00, 0xC6, 0xC6, 0x6C, 0x38,
|
0xC6, 0xC6, 0xC6, 0xD6, 0xFE, 0xEE, 0xC6, 0x00, 0xC6, 0xC6, 0x6C, 0x38,
|
||||||
0x38, 0x6C, 0xC6, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x30, 0x78, 0x00,
|
0x38, 0x6C, 0xC6, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x30, 0x78, 0x00,
|
||||||
0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00, 0x78, 0x60, 0x60, 0x60,
|
0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00, 0x78, 0x60, 0x60, 0x60,
|
||||||
0x60, 0x60, 0x78, 0x00, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00,
|
0x60, 0x60, 0x78, 0x00, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00,
|
||||||
0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00, 0x10, 0x38, 0x6C, 0xC6,
|
0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00, 0x10, 0x38, 0x6C, 0xC6,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
|
||||||
0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C,
|
0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C,
|
||||||
0x7C, 0xCC, 0x76, 0x00, 0xE0, 0x60, 0x60, 0x7C, 0x66, 0x66, 0xDC, 0x00,
|
0x7C, 0xCC, 0x76, 0x00, 0xE0, 0x60, 0x60, 0x7C, 0x66, 0x66, 0xDC, 0x00,
|
||||||
0x00, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x00, 0x1C, 0x0C, 0x0C, 0x7C,
|
0x00, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x00, 0x1C, 0x0C, 0x0C, 0x7C,
|
||||||
0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00,
|
0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00,
|
||||||
0x38, 0x6C, 0x60, 0xF0, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x76, 0xCC,
|
0x38, 0x6C, 0x60, 0xF0, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x76, 0xCC,
|
||||||
0xCC, 0x7C, 0x0C, 0xF8, 0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00,
|
0xCC, 0x7C, 0x0C, 0xF8, 0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00,
|
||||||
0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, 0x0C, 0x00, 0x0C, 0x0C,
|
0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, 0x0C, 0x00, 0x0C, 0x0C,
|
||||||
0x0C, 0xCC, 0xCC, 0x78, 0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00,
|
0x0C, 0xCC, 0xCC, 0x78, 0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00,
|
||||||
0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0xCC, 0xFE,
|
0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0xCC, 0xFE,
|
||||||
0xFE, 0xD6, 0xC6, 0x00, 0x00, 0x00, 0xF8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00,
|
0xFE, 0xD6, 0xC6, 0x00, 0x00, 0x00, 0xF8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00,
|
||||||
0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0xDC, 0x66,
|
0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0xDC, 0x66,
|
||||||
0x66, 0x7C, 0x60, 0xF0, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E,
|
0x66, 0x7C, 0x60, 0xF0, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E,
|
||||||
0x00, 0x00, 0xDC, 0x76, 0x66, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x7C, 0xC0,
|
0x00, 0x00, 0xDC, 0x76, 0x66, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x7C, 0xC0,
|
||||||
0x78, 0x0C, 0xF8, 0x00, 0x10, 0x30, 0x7C, 0x30, 0x30, 0x34, 0x18, 0x00,
|
0x78, 0x0C, 0xF8, 0x00, 0x10, 0x30, 0x7C, 0x30, 0x30, 0x34, 0x18, 0x00,
|
||||||
0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0xCC, 0xCC,
|
0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0xCC, 0xCC,
|
||||||
0xCC, 0x78, 0x30, 0x00, 0x00, 0x00, 0xC6, 0xD6, 0xFE, 0xFE, 0x6C, 0x00,
|
0xCC, 0x78, 0x30, 0x00, 0x00, 0x00, 0xC6, 0xD6, 0xFE, 0xFE, 0x6C, 0x00,
|
||||||
0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0xCC, 0xCC,
|
0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0xCC, 0xCC,
|
||||||
0xCC, 0x7C, 0x0C, 0xF8, 0x00, 0x00, 0xFC, 0x98, 0x30, 0x64, 0xFC, 0x00,
|
0xCC, 0x7C, 0x0C, 0xF8, 0x00, 0x00, 0xFC, 0x98, 0x30, 0x64, 0xFC, 0x00,
|
||||||
0x1C, 0x30, 0x30, 0xE0, 0x30, 0x30, 0x1C, 0x00, 0x18, 0x18, 0x18, 0x00,
|
0x1C, 0x30, 0x30, 0xE0, 0x30, 0x30, 0x1C, 0x00, 0x18, 0x18, 0x18, 0x00,
|
||||||
0x18, 0x18, 0x18, 0x00, 0xE0, 0x30, 0x30, 0x1C, 0x30, 0x30, 0xE0, 0x00,
|
0x18, 0x18, 0x18, 0x00, 0xE0, 0x30, 0x30, 0x1C, 0x30, 0x30, 0xE0, 0x00,
|
||||||
0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C,
|
0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C,
|
||||||
0xC6, 0xC6, 0xFE, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x18, 0x0C, 0x78,
|
0xC6, 0xC6, 0xFE, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x18, 0x0C, 0x78,
|
||||||
0x00, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0x7E, 0x00, 0x1C, 0x00, 0x78, 0xCC,
|
0x00, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0x7E, 0x00, 0x1C, 0x00, 0x78, 0xCC,
|
||||||
0xFC, 0xC0, 0x78, 0x00, 0x7E, 0xC3, 0x3C, 0x06, 0x3E, 0x66, 0x3F, 0x00,
|
0xFC, 0xC0, 0x78, 0x00, 0x7E, 0xC3, 0x3C, 0x06, 0x3E, 0x66, 0x3F, 0x00,
|
||||||
0xCC, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x7E, 0x00, 0xE0, 0x00, 0x78, 0x0C,
|
0xCC, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x7E, 0x00, 0xE0, 0x00, 0x78, 0x0C,
|
||||||
0x7C, 0xCC, 0x7E, 0x00, 0x30, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x7E, 0x00,
|
0x7C, 0xCC, 0x7E, 0x00, 0x30, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x7E, 0x00,
|
||||||
0x00, 0x00, 0x78, 0xC0, 0xC0, 0x78, 0x0C, 0x38, 0x7E, 0xC3, 0x3C, 0x66,
|
0x00, 0x00, 0x78, 0xC0, 0xC0, 0x78, 0x0C, 0x38, 0x7E, 0xC3, 0x3C, 0x66,
|
||||||
0x7E, 0x60, 0x3C, 0x00, 0xCC, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00,
|
0x7E, 0x60, 0x3C, 0x00, 0xCC, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00,
|
||||||
0xE0, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, 0xCC, 0x00, 0x70, 0x30,
|
0xE0, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, 0xCC, 0x00, 0x70, 0x30,
|
||||||
0x30, 0x30, 0x78, 0x00, 0x7C, 0xC6, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00,
|
0x30, 0x30, 0x78, 0x00, 0x7C, 0xC6, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00,
|
||||||
0xE0, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, 0xC6, 0x38, 0x6C, 0xC6,
|
0xE0, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, 0xC6, 0x38, 0x6C, 0xC6,
|
||||||
0xFE, 0xC6, 0xC6, 0x00, 0x30, 0x30, 0x00, 0x78, 0xCC, 0xFC, 0xCC, 0x00,
|
0xFE, 0xC6, 0xC6, 0x00, 0x30, 0x30, 0x00, 0x78, 0xCC, 0xFC, 0xCC, 0x00,
|
||||||
0x1C, 0x00, 0xFC, 0x60, 0x78, 0x60, 0xFC, 0x00, 0x00, 0x00, 0x7F, 0x0C,
|
0x1C, 0x00, 0xFC, 0x60, 0x78, 0x60, 0xFC, 0x00, 0x00, 0x00, 0x7F, 0x0C,
|
||||||
0x7F, 0xCC, 0x7F, 0x00, 0x3E, 0x6C, 0xCC, 0xFE, 0xCC, 0xCC, 0xCE, 0x00,
|
0x7F, 0xCC, 0x7F, 0x00, 0x3E, 0x6C, 0xCC, 0xFE, 0xCC, 0xCC, 0xCE, 0x00,
|
||||||
0x78, 0xCC, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0xCC, 0x00, 0x78,
|
0x78, 0xCC, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0xCC, 0x00, 0x78,
|
||||||
0xCC, 0xCC, 0x78, 0x00, 0x00, 0xE0, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00,
|
0xCC, 0xCC, 0x78, 0x00, 0x00, 0xE0, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00,
|
||||||
0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0x7E, 0x00, 0x00, 0xE0, 0x00, 0xCC,
|
0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0x7E, 0x00, 0x00, 0xE0, 0x00, 0xCC,
|
||||||
0xCC, 0xCC, 0x7E, 0x00, 0x00, 0xCC, 0x00, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8,
|
0xCC, 0xCC, 0x7E, 0x00, 0x00, 0xCC, 0x00, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8,
|
||||||
0xC3, 0x18, 0x3C, 0x66, 0x66, 0x3C, 0x18, 0x00, 0xCC, 0x00, 0xCC, 0xCC,
|
0xC3, 0x18, 0x3C, 0x66, 0x66, 0x3C, 0x18, 0x00, 0xCC, 0x00, 0xCC, 0xCC,
|
||||||
0xCC, 0xCC, 0x78, 0x00, 0x18, 0x18, 0x7E, 0xC0, 0xC0, 0x7E, 0x18, 0x18,
|
0xCC, 0xCC, 0x78, 0x00, 0x18, 0x18, 0x7E, 0xC0, 0xC0, 0x7E, 0x18, 0x18,
|
||||||
0x38, 0x6C, 0x64, 0xF0, 0x60, 0xE6, 0xFC, 0x00, 0xCC, 0xCC, 0x78, 0xFC,
|
0x38, 0x6C, 0x64, 0xF0, 0x60, 0xE6, 0xFC, 0x00, 0xCC, 0xCC, 0x78, 0xFC,
|
||||||
0x30, 0xFC, 0x30, 0x30, 0xF8, 0xCC, 0xCC, 0xFA, 0xC6, 0xCF, 0xC6, 0xC7,
|
0x30, 0xFC, 0x30, 0x30, 0xF8, 0xCC, 0xCC, 0xFA, 0xC6, 0xCF, 0xC6, 0xC7,
|
||||||
0x0E, 0x1B, 0x18, 0x3C, 0x18, 0x18, 0xD8, 0x70, 0x1C, 0x00, 0x78, 0x0C,
|
0x0E, 0x1B, 0x18, 0x3C, 0x18, 0x18, 0xD8, 0x70, 0x1C, 0x00, 0x78, 0x0C,
|
||||||
0x7C, 0xCC, 0x7E, 0x00, 0x38, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00,
|
0x7C, 0xCC, 0x7E, 0x00, 0x38, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00,
|
||||||
0x00, 0x1C, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x1C, 0x00, 0xCC,
|
0x00, 0x1C, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x1C, 0x00, 0xCC,
|
||||||
0xCC, 0xCC, 0x7E, 0x00, 0x00, 0xF8, 0x00, 0xF8, 0xCC, 0xCC, 0xCC, 0x00,
|
0xCC, 0xCC, 0x7E, 0x00, 0x00, 0xF8, 0x00, 0xF8, 0xCC, 0xCC, 0xCC, 0x00,
|
||||||
0xFC, 0x00, 0xCC, 0xEC, 0xFC, 0xDC, 0xCC, 0x00, 0x3C, 0x6C, 0x6C, 0x3E,
|
0xFC, 0x00, 0xCC, 0xEC, 0xFC, 0xDC, 0xCC, 0x00, 0x3C, 0x6C, 0x6C, 0x3E,
|
||||||
0x00, 0x7E, 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00,
|
0x00, 0x7E, 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00,
|
||||||
0x30, 0x00, 0x30, 0x60, 0xC0, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00, 0xFC,
|
0x30, 0x00, 0x30, 0x60, 0xC0, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00, 0xFC,
|
||||||
0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x0C, 0x0C, 0x00, 0x00,
|
0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x0C, 0x0C, 0x00, 0x00,
|
||||||
0xC3, 0xC6, 0xCC, 0xDE, 0x33, 0x66, 0xCC, 0x0F, 0xC3, 0xC6, 0xCC, 0xDB,
|
0xC3, 0xC6, 0xCC, 0xDE, 0x33, 0x66, 0xCC, 0x0F, 0xC3, 0xC6, 0xCC, 0xDB,
|
||||||
0x37, 0x6F, 0xCF, 0x03, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00,
|
0x37, 0x6F, 0xCF, 0x03, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00,
|
||||||
0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33,
|
0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33,
|
||||||
0x66, 0xCC, 0x00, 0x00, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88,
|
0x66, 0xCC, 0x00, 0x00, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88,
|
||||||
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0xDB, 0x77, 0xDB, 0xEE,
|
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0xDB, 0x77, 0xDB, 0xEE,
|
||||||
0xDB, 0x77, 0xDB, 0xEE, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
|
0xDB, 0x77, 0xDB, 0xEE, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
|
||||||
0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18,
|
0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18,
|
||||||
0xF8, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36,
|
0xF8, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36,
|
||||||
0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36, 0x00, 0x00, 0xF8, 0x18,
|
0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36, 0x00, 0x00, 0xF8, 0x18,
|
||||||
0xF8, 0x18, 0x18, 0x18, 0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36,
|
0xF8, 0x18, 0x18, 0x18, 0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36,
|
||||||
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFE, 0x06,
|
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFE, 0x06,
|
||||||
0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00,
|
0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00,
|
||||||
0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00, 0x18, 0x18, 0xF8, 0x18,
|
0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00, 0x18, 0x18, 0xF8, 0x18,
|
||||||
0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18,
|
0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18,
|
||||||
0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
|
0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
|
||||||
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18,
|
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18,
|
||||||
0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
|
0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
|
||||||
0xFF, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18,
|
0xFF, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18,
|
||||||
0x18, 0x18, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
|
0x18, 0x18, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
|
||||||
0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00,
|
0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF7, 0x00,
|
0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF7, 0x00,
|
||||||
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36,
|
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36,
|
||||||
0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFF, 0x00,
|
0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFF, 0x00,
|
||||||
0xFF, 0x00, 0x00, 0x00, 0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36,
|
0xFF, 0x00, 0x00, 0x00, 0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36,
|
||||||
0x18, 0x18, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36,
|
0x18, 0x18, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36,
|
||||||
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x18, 0x18, 0x18,
|
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x18, 0x18, 0x18,
|
||||||
0x00, 0x00, 0x00, 0x00, 0xFF, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
|
0x00, 0x00, 0x00, 0x00, 0xFF, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
|
||||||
0x3F, 0x00, 0x00, 0x00, 0x18, 0x18, 0x1F, 0x18, 0x1F, 0x00, 0x00, 0x00,
|
0x3F, 0x00, 0x00, 0x00, 0x18, 0x18, 0x1F, 0x18, 0x1F, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x3F, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFF, 0x36, 0x36, 0x36,
|
0x3F, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFF, 0x36, 0x36, 0x36,
|
||||||
0x18, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
|
0x18, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
|
||||||
0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18,
|
0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18,
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
||||||
0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
|
0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC, 0xC8, 0xDC, 0x76, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xDC, 0xC8, 0xDC, 0x76, 0x00,
|
||||||
0x00, 0x78, 0xCC, 0xF8, 0xCC, 0xF8, 0xC0, 0xC0, 0x00, 0xFC, 0xCC, 0xC0,
|
0x00, 0x78, 0xCC, 0xF8, 0xCC, 0xF8, 0xC0, 0xC0, 0x00, 0xFC, 0xCC, 0xC0,
|
||||||
0xC0, 0xC0, 0xC0, 0x00, 0x00, 0xFE, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x00,
|
0xC0, 0xC0, 0xC0, 0x00, 0x00, 0xFE, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x00,
|
||||||
0xFC, 0xCC, 0x60, 0x30, 0x60, 0xCC, 0xFC, 0x00, 0x00, 0x00, 0x7E, 0xD8,
|
0xFC, 0xCC, 0x60, 0x30, 0x60, 0xCC, 0xFC, 0x00, 0x00, 0x00, 0x7E, 0xD8,
|
||||||
0xD8, 0xD8, 0x70, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x60, 0xC0,
|
0xD8, 0xD8, 0x70, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x60, 0xC0,
|
||||||
0x00, 0x76, 0xDC, 0x18, 0x18, 0x18, 0x18, 0x00, 0xFC, 0x30, 0x78, 0xCC,
|
0x00, 0x76, 0xDC, 0x18, 0x18, 0x18, 0x18, 0x00, 0xFC, 0x30, 0x78, 0xCC,
|
||||||
0xCC, 0x78, 0x30, 0xFC, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x6C, 0x38, 0x00,
|
0xCC, 0x78, 0x30, 0xFC, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x6C, 0x38, 0x00,
|
||||||
0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x6C, 0xEE, 0x00, 0x1C, 0x30, 0x18, 0x7C,
|
0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x6C, 0xEE, 0x00, 0x1C, 0x30, 0x18, 0x7C,
|
||||||
0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x7E, 0xDB, 0xDB, 0x7E, 0x00, 0x00,
|
0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x7E, 0xDB, 0xDB, 0x7E, 0x00, 0x00,
|
||||||
0x06, 0x0C, 0x7E, 0xDB, 0xDB, 0x7E, 0x60, 0xC0, 0x38, 0x60, 0xC0, 0xF8,
|
0x06, 0x0C, 0x7E, 0xDB, 0xDB, 0x7E, 0x60, 0xC0, 0x38, 0x60, 0xC0, 0xF8,
|
||||||
0xC0, 0x60, 0x38, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x00,
|
0xC0, 0x60, 0x38, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x00,
|
||||||
0x00, 0xFC, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x00, 0x30, 0x30, 0xFC, 0x30,
|
0x00, 0xFC, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x00, 0x30, 0x30, 0xFC, 0x30,
|
||||||
0x30, 0x00, 0xFC, 0x00, 0x60, 0x30, 0x18, 0x30, 0x60, 0x00, 0xFC, 0x00,
|
0x30, 0x00, 0xFC, 0x00, 0x60, 0x30, 0x18, 0x30, 0x60, 0x00, 0xFC, 0x00,
|
||||||
0x18, 0x30, 0x60, 0x30, 0x18, 0x00, 0xFC, 0x00, 0x0E, 0x1B, 0x1B, 0x18,
|
0x18, 0x30, 0x60, 0x30, 0x18, 0x00, 0xFC, 0x00, 0x0E, 0x1B, 0x1B, 0x18,
|
||||||
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xD8, 0xD8, 0x70,
|
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xD8, 0xD8, 0x70,
|
||||||
0x30, 0x30, 0x00, 0xFC, 0x00, 0x30, 0x30, 0x00, 0x00, 0x76, 0xDC, 0x00,
|
0x30, 0x30, 0x00, 0xFC, 0x00, 0x30, 0x30, 0x00, 0x00, 0x76, 0xDC, 0x00,
|
||||||
0x76, 0xDC, 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00,
|
0x76, 0xDC, 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x18, 0x00, 0x00, 0x00, 0x0F, 0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x3C, 0x1C,
|
0x18, 0x00, 0x00, 0x00, 0x0F, 0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x3C, 0x1C,
|
||||||
0x78, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x70, 0x18, 0x30, 0x60,
|
0x78, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x70, 0x18, 0x30, 0x60,
|
||||||
0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00,
|
0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1738,10 +1738,10 @@ void coolgaugetext(short snum)
|
||||||
case 6: i = ((p->scuba_amount+63)>>6); break;
|
case 6: i = ((p->scuba_amount+63)>>6); break;
|
||||||
case 7: i = (p->boot_amount>>1); break;
|
case 7: i = (p->boot_amount>>1); break;
|
||||||
}
|
}
|
||||||
invennum(284-30-o,200-6,(char)i,0,10+permbit);
|
invennum(284-30-o,200-6,(char)i,0,10+permbit);
|
||||||
if (j > 0) minitext(288-30-o,180,"ON",0,10+16+permbit + 256);
|
if (j > 0) minitext(288-30-o,180,"ON",0,10+16+permbit + 256);
|
||||||
else if ((unsigned long)j != 0x80000000) minitext(284-30-o,180,"OFF",2,10+16+permbit + 256);
|
else if ((unsigned long)j != 0x80000000) minitext(284-30-o,180,"OFF",2,10+16+permbit + 256);
|
||||||
if (p->inven_icon >= 6) minitext(284-35-o,180,"AUTO",2,10+16+permbit + 256);
|
if (p->inven_icon >= 6) minitext(284-35-o,180,"AUTO",2,10+16+permbit + 256);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue