Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c30710ff7d |
@@ -0,0 +1,238 @@
|
||||
/* Keen Dreams Source Code
|
||||
* Copyright (C) 2014 Javier M. Chavez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "KD_DEF.H"
|
||||
|
||||
#define BIO_BUFFER_LEN (512)
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FreeShape()
|
||||
//
|
||||
void FreeShape(struct Shape *shape)
|
||||
{
|
||||
if (shape->Data)
|
||||
MM_FreePtr(&shape->Data);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// UnpackEGAShapeToScreen()
|
||||
//
|
||||
int UnpackEGAShapeToScreen(struct Shape *SHP,int startx,int starty)
|
||||
{
|
||||
int currenty;
|
||||
signed char n, Rep, far *Src, far *Dst[8], loop, Plane;
|
||||
unsigned int BPR, Height;
|
||||
int NotWordAligned;
|
||||
|
||||
NotWordAligned = SHP->BPR & 1;
|
||||
startx>>=3;
|
||||
Src = MK_FP(SHP->Data,0);
|
||||
currenty = starty;
|
||||
Plane = 0;
|
||||
Height = SHP->bmHdr.h;
|
||||
while (Height--)
|
||||
{
|
||||
Dst[0] = (MK_FP(0xA000,displayofs));
|
||||
Dst[0] += ylookup[currenty];
|
||||
Dst[0] += startx;
|
||||
for (loop=1; loop<SHP->bmHdr.d; loop++)
|
||||
Dst[loop] = Dst[0];
|
||||
|
||||
|
||||
for (Plane=0; Plane<SHP->bmHdr.d; Plane++)
|
||||
{
|
||||
outport(0x3c4,((1<<Plane)<<8)|2);
|
||||
|
||||
BPR = ((SHP->BPR+1) >> 1) << 1; // IGNORE WORD ALIGN
|
||||
while (BPR)
|
||||
{
|
||||
if (SHP->bmHdr.comp)
|
||||
n = *Src++;
|
||||
else
|
||||
n = BPR-1;
|
||||
|
||||
if (n < 0)
|
||||
{
|
||||
if (n != -128)
|
||||
{
|
||||
n = (-n)+1;
|
||||
BPR -= n;
|
||||
Rep = *Src++;
|
||||
if ((!BPR) && (NotWordAligned)) // IGNORE WORD ALIGN
|
||||
n--;
|
||||
|
||||
while (n--)
|
||||
*Dst[Plane]++ = Rep;
|
||||
}
|
||||
else
|
||||
BPR--;
|
||||
}
|
||||
else
|
||||
{
|
||||
n++;
|
||||
BPR -= n;
|
||||
if ((!BPR) && (NotWordAligned)) // IGNORE WORD ALIGN
|
||||
n--;
|
||||
|
||||
while (n--)
|
||||
*Dst[Plane]++ = *Src++;
|
||||
|
||||
if ((!BPR) && (NotWordAligned)) // IGNORE WORD ALIGN
|
||||
Src++;
|
||||
}
|
||||
}
|
||||
}
|
||||
currenty++;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Verify()
|
||||
//
|
||||
long Verify(char *filename)
|
||||
{
|
||||
int handle;
|
||||
long size;
|
||||
|
||||
if ((handle=open(filename,O_BINARY))==-1)
|
||||
return (0);
|
||||
size=filelength(handle);
|
||||
close(handle);
|
||||
return(size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// InitBufferedIO()
|
||||
//--------------------------------------------------------------------------
|
||||
memptr InitBufferedIO(int handle, BufferedIO *bio)
|
||||
{
|
||||
bio->handle = handle;
|
||||
bio->offset = BIO_BUFFER_LEN;
|
||||
bio->status = 0;
|
||||
MM_GetPtr(&bio->buffer,BIO_BUFFER_LEN);
|
||||
|
||||
return(bio->buffer);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// FreeBufferedIO()
|
||||
//--------------------------------------------------------------------------
|
||||
void FreeBufferedIO(BufferedIO *bio)
|
||||
{
|
||||
if (bio->buffer)
|
||||
MM_FreePtr(&bio->buffer);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// bio_readch()
|
||||
//--------------------------------------------------------------------------
|
||||
byte bio_readch(BufferedIO *bio)
|
||||
{
|
||||
byte far *buffer;
|
||||
|
||||
if (bio->offset == BIO_BUFFER_LEN)
|
||||
{
|
||||
bio->offset = 0;
|
||||
bio_fillbuffer(bio);
|
||||
}
|
||||
|
||||
buffer = MK_FP(bio->buffer,bio->offset++);
|
||||
|
||||
return(*buffer);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// bio_fillbuffer()
|
||||
//
|
||||
// BUGS (Not really bugs... More like RULES!)
|
||||
//
|
||||
// 1) This code assumes BIO_BUFFER_LEN is no smaller than
|
||||
// NEAR_BUFFER_LEN!!
|
||||
//
|
||||
// 2) BufferedIO.status should be altered by this code to report
|
||||
// read errors, end of file, etc... If you know how big the file
|
||||
// is you're reading, determining EOF should be no problem.
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
void bio_fillbuffer(BufferedIO *bio)
|
||||
{
|
||||
#define NEAR_BUFFER_LEN (64)
|
||||
byte near_buffer[NEAR_BUFFER_LEN];
|
||||
short bio_length,bytes_read,bytes_requested;
|
||||
|
||||
bytes_read = 0;
|
||||
bio_length = BIO_BUFFER_LEN;
|
||||
while (bio_length)
|
||||
{
|
||||
if (bio_length > NEAR_BUFFER_LEN-1)
|
||||
bytes_requested = NEAR_BUFFER_LEN;
|
||||
else
|
||||
bytes_requested = bio_length;
|
||||
|
||||
read(bio->handle,near_buffer,bytes_requested);
|
||||
_fmemcpy(MK_FP(bio->buffer,bytes_read),near_buffer,bytes_requested);
|
||||
|
||||
bio_length -= bytes_requested;
|
||||
bytes_read += bytes_requested;
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SwapLong()
|
||||
//
|
||||
void SwapLong(long far *Var)
|
||||
{
|
||||
asm les bx,Var
|
||||
asm mov ax,[es:bx]
|
||||
asm xchg ah,al
|
||||
asm xchg ax,[es:bx+2]
|
||||
asm xchg ah,al
|
||||
asm mov [es:bx],ax
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SwapWord()
|
||||
//
|
||||
void SwapWord(unsigned int far *Var)
|
||||
{
|
||||
asm les bx,Var
|
||||
asm mov ax,[es:bx]
|
||||
asm xchg ah,al
|
||||
asm mov [es:bx],ax
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// MoveGfxDst()
|
||||
//
|
||||
void MoveGfxDst(short x, short y)
|
||||
{
|
||||
unsigned address;
|
||||
|
||||
address = (y*linewidth)+(x/8);
|
||||
bufferofs = displayofs = address;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/* Keen Dreams Source Code
|
||||
* Copyright (C) 2014 Javier M. Chavez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "SL_FILE.h"
|
||||
#include "id_mm.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Defines
|
||||
//
|
||||
|
||||
struct BitMapHeader {
|
||||
unsigned int w,h,x,y;
|
||||
unsigned char d,trans,comp,pad;
|
||||
};
|
||||
|
||||
struct BitMap {
|
||||
unsigned int Width;
|
||||
unsigned int Height;
|
||||
unsigned int Depth;
|
||||
unsigned int BytesPerRow;
|
||||
char far *Planes[8];
|
||||
};
|
||||
|
||||
struct Shape {
|
||||
memptr Data;
|
||||
long size;
|
||||
unsigned int BPR;
|
||||
struct BitMapHeader bmHdr;
|
||||
};
|
||||
|
||||
void FreeShape(struct Shape *shape);
|
||||
int UnpackEGAShapeToScreen(struct Shape *SHP,int startx,int starty);
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
;=====================================
|
||||
;
|
||||
; Graphics .EQU file for .KDR
|
||||
; IGRAB-ed on Fri Aug 21 03:04:31 1992
|
||||
; IGRAB-ed on Wed Jul 10 15:22:21 1991
|
||||
;
|
||||
;=====================================
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
//////////////////////////////////////
|
||||
//
|
||||
// Graphics .H file for .KDR
|
||||
// IGRAB-ed on Fri Aug 21 03:04:31 1992
|
||||
// IGRAB-ed on Fri Aug 07 09:27:42 1992
|
||||
//
|
||||
//////////////////////////////////////
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ CGAGR = 1
|
||||
EGAGR = 2
|
||||
VGAGR = 3
|
||||
|
||||
GRMODE = CGAGR
|
||||
GRMODE = EGAGR
|
||||
PROFILE = 0 ; 1=keep stats on tile drawing
|
||||
|
||||
SC_INDEX = 03C4h
|
||||
|
||||
@@ -673,9 +673,10 @@ void CAL_SetupGrFile (void)
|
||||
// load ???dict.ext (huffman dictionary for graphics files)
|
||||
//
|
||||
|
||||
if ((handle = open(GREXT"DICT."EXTENSION,
|
||||
// if ((handle = open(GREXT"DICT.",
|
||||
if ((handle = open("KDREAMS.EGA",
|
||||
O_RDONLY | O_BINARY, S_IREAD)) == -1)
|
||||
Quit ("Can't open "GREXT"DICT."EXTENSION"!");
|
||||
Quit ("Can't open KDREAMS.EGA!");
|
||||
|
||||
read(handle, &grhuffman, sizeof(grhuffman));
|
||||
close(handle);
|
||||
@@ -699,9 +700,10 @@ void CAL_SetupGrFile (void)
|
||||
//
|
||||
// Open the graphics file, leaving it open until the game is finished
|
||||
//
|
||||
grhandle = open(GREXT"GRAPH."EXTENSION, O_RDONLY | O_BINARY);
|
||||
// grhandle = open(GREXT"GRAPH."EXTENSION, O_RDONLY | O_BINARY); NOLAN
|
||||
grhandle = open("KDREAMS.EGA", O_RDONLY | O_BINARY);
|
||||
if (grhandle == -1)
|
||||
Quit ("Cannot open "GREXT"GRAPH."EXTENSION"!");
|
||||
Quit ("Cannot open KDREAMS.EGA!");
|
||||
|
||||
|
||||
//
|
||||
@@ -757,9 +759,10 @@ void CAL_SetupMapFile (void)
|
||||
// load maphead.ext (offsets and tileinfo for map file)
|
||||
//
|
||||
#ifndef MAPHEADERLINKED
|
||||
if ((handle = open("MAPHEAD."EXTENSION,
|
||||
// if ((handle = open("MAPHEAD."EXTENSION,
|
||||
if ((handle = open("KDREAMS.MAP",
|
||||
O_RDONLY | O_BINARY, S_IREAD)) == -1)
|
||||
Quit ("Can't open MAPHEAD."EXTENSION"!");
|
||||
Quit ("Can't open KDREAMS.MAP!");
|
||||
length = filelength(handle);
|
||||
MM_GetPtr (&(memptr)tinf,length);
|
||||
CA_FarRead(handle, tinf, length);
|
||||
@@ -776,9 +779,9 @@ void CAL_SetupMapFile (void)
|
||||
// open the data file
|
||||
//
|
||||
#ifdef MAPHEADERLINKED
|
||||
if ((maphandle = open("GAMEMAPS."EXTENSION,
|
||||
if ((maphandle = open("KDREAMS.MAP",
|
||||
O_RDONLY | O_BINARY, S_IREAD)) == -1)
|
||||
Quit ("Can't open GAMEMAPS."EXTENSION"!");
|
||||
Quit ("Can't open KDREAMS.MAP!");
|
||||
#else
|
||||
if ((maphandle = open("MAPTEMP."EXTENSION,
|
||||
O_RDONLY | O_BINARY, S_IREAD)) == -1)
|
||||
@@ -828,9 +831,10 @@ void CAL_SetupAudioFile (void)
|
||||
O_RDONLY | O_BINARY, S_IREAD)) == -1)
|
||||
Quit ("Can't open AUDIOT."EXTENSION"!");
|
||||
#else
|
||||
if ((audiohandle = open("AUDIO."EXTENSION,
|
||||
// if ((audiohandle = open("AUDIO."EXTENSION, NOLAN
|
||||
if ((audiohandle = open("KDREAMS.AUD",
|
||||
O_RDONLY | O_BINARY, S_IREAD)) == -1)
|
||||
Quit ("Can't open AUDIO."EXTENSION"!");
|
||||
Quit ("Can't open KDREAMS.AUD!");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1580,7 +1584,7 @@ void CA_DownLevel (void)
|
||||
Quit ("CA_DownLevel: Down past level 0!");
|
||||
ca_levelbit>>=1;
|
||||
ca_levelnum--;
|
||||
CA_CacheMarks(titleptr[ca_levelnum]);
|
||||
CA_CacheMarks(titleptr[ca_levelnum], 1);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -1639,7 +1643,7 @@ void CA_ClearAllMarks (void)
|
||||
#define BARSTEP 8
|
||||
#define MAXEMPTYREAD 1024
|
||||
|
||||
void CA_CacheMarks (char *title)
|
||||
void CA_CacheMarks (char *title, boolean cachedownlevel)
|
||||
{
|
||||
boolean dialog;
|
||||
int i,next,homex,homey,x,y,thx,thy,numcache,lastx,xl,xh;
|
||||
@@ -1655,6 +1659,10 @@ void CA_CacheMarks (char *title)
|
||||
titleptr[ca_levelnum] = title;
|
||||
|
||||
dialog = (title!=NULL);
|
||||
|
||||
if (cachedownlevel)
|
||||
dialog = false;
|
||||
|
||||
if (dialog)
|
||||
{
|
||||
//
|
||||
|
||||
@@ -119,5 +119,5 @@ void CA_ClearAllMarks (void);
|
||||
void CA_CacheGrChunk (int chunk);
|
||||
void CA_CacheMap (int mapnum);
|
||||
|
||||
void CA_CacheMarks (char *title);
|
||||
void CA_CacheMarks (char *title, boolean cachedownlevel);
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@
|
||||
#define EGAGR 2
|
||||
#define VGAGR 3
|
||||
|
||||
#define GRMODE CGAGR
|
||||
#define GRMODE EGAGR
|
||||
|
||||
#if GRMODE == EGAGR
|
||||
#define GREXT "EGA"
|
||||
|
||||
@@ -557,18 +557,16 @@ IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy)
|
||||
static boolean
|
||||
INL_StartJoy(word joy)
|
||||
{
|
||||
word x,y;
|
||||
boolean result;
|
||||
word x,y,d;
|
||||
JoystickDef *def;
|
||||
|
||||
IN_GetJoyAbs(joy, &x, &y);
|
||||
IN_GetJoyAbs(joy,&x,&y);
|
||||
|
||||
if (((x == 0) || (x > MaxJoyValue - 10)) ||
|
||||
((y == 0) || (y > MaxJoyValue - 10)))
|
||||
return(false);
|
||||
else
|
||||
{
|
||||
IN_SetupJoy(joy, 0, x*2, 0, y*2);
|
||||
return(true);
|
||||
}
|
||||
result = (x < MaxJoyValue - 10);
|
||||
if (result)
|
||||
IN_SetupJoy(joy,0,x * 2,0,y * 2);
|
||||
return(result);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -481,7 +481,7 @@ void MM_GetPtr (memptr *baseptr,unsigned long size)
|
||||
}
|
||||
}
|
||||
|
||||
Quit ("MM_GetPtr: Out of memory!");
|
||||
Quit ("Out of memory! Please make sure you have enough free memory.");
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
||||
@@ -275,7 +275,7 @@ USL_ReadConfig(void)
|
||||
SMMode sm;
|
||||
ControlType ctl;
|
||||
|
||||
if ((file = open("CONFIG."EXTENSION,O_BINARY | O_RDONLY)) != -1)
|
||||
if ((file = open("KDREAMS.CFG",O_BINARY | O_RDONLY)) != -1)
|
||||
{
|
||||
read(file,Scores,sizeof(HighScore) * MaxScores);
|
||||
read(file,&sd,sizeof(sd));
|
||||
@@ -312,7 +312,7 @@ USL_WriteConfig(void)
|
||||
{
|
||||
int file;
|
||||
|
||||
file = open("CONFIG."EXTENSION,O_CREAT | O_BINARY | O_WRONLY,
|
||||
file = open("KDREAMS.CFG", O_CREAT | O_BINARY | O_WRONLY,
|
||||
S_IREAD | S_IWRITE | S_IFREG);
|
||||
if (file != -1)
|
||||
{
|
||||
@@ -571,6 +571,8 @@ USL_ShowMem(word x,word y,long mem)
|
||||
USL_ScreenDraw(x,y,buf,0x48);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// US_UpdateTextScreen() - Called after the ID libraries are started up.
|
||||
@@ -585,7 +587,6 @@ US_UpdateTextScreen(void)
|
||||
word i;
|
||||
longword totalmem;
|
||||
|
||||
#if 0
|
||||
// Show video card info
|
||||
b = (grmode == CGAGR);
|
||||
USL_Show(21,7,4,(videocard >= CGAcard) && (videocard <= VGAcard),b);
|
||||
@@ -626,9 +627,10 @@ US_UpdateTextScreen(void)
|
||||
|
||||
// Change Initializing... to Loading...
|
||||
USL_ScreenDraw(27,22," Loading... ",0x9c);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// US_FinishTextScreen() - After the main program has finished its initial
|
||||
@@ -639,7 +641,6 @@ void
|
||||
US_FinishTextScreen(void)
|
||||
{
|
||||
// Change Loading... to Press a Key
|
||||
// USL_ScreenDraw(29,22," Ready - Press a Key ",0x9a);
|
||||
USL_ScreenDraw(30, 18, "Ready - Press a Key",0xCE);
|
||||
|
||||
if (!tedlevel)
|
||||
@@ -2172,7 +2173,6 @@ USL_CtlCKbdButtonCustom(UserCall call,word i,word n)
|
||||
static boolean
|
||||
USL_CtlCJoyButtonCustom(UserCall call,word i,word n)
|
||||
{
|
||||
boolean Done = false;
|
||||
word joy,
|
||||
minx,maxx,
|
||||
miny,maxy;
|
||||
@@ -2189,42 +2189,30 @@ USL_CtlCJoyButtonCustom(UserCall call,word i,word n)
|
||||
FlushHelp = true;
|
||||
fontcolor = F_SECONDCOLOR;
|
||||
|
||||
while (!(Done))
|
||||
USL_ShowHelp("Move Joystick to the Upper-Left");
|
||||
VW_UpdateScreen();
|
||||
while ((LastScan != sc_Escape) && !IN_GetJoyButtonsDB(joy))
|
||||
;
|
||||
if (LastScan != sc_Escape)
|
||||
{
|
||||
USL_ShowHelp("Move Joystick to the Upper-Left");
|
||||
VW_UpdateScreen();
|
||||
while ((LastScan != sc_Escape) && !IN_GetJoyButtonsDB(joy));
|
||||
IN_GetJoyAbs(joy,&minx,&miny);
|
||||
while (IN_GetJoyButtonsDB(joy))
|
||||
;
|
||||
|
||||
USL_ShowHelp("Move Joystick to the Lower-Right");
|
||||
VW_UpdateScreen();
|
||||
while ((LastScan != sc_Escape) && !IN_GetJoyButtonsDB(joy))
|
||||
;
|
||||
if (LastScan != sc_Escape)
|
||||
{
|
||||
IN_GetJoyAbs(joy,&minx,&miny);
|
||||
while (IN_GetJoyButtonsDB(joy));
|
||||
|
||||
USL_ShowHelp("Move Joystick to the Lower-Right");
|
||||
VW_UpdateScreen();
|
||||
while ((LastScan != sc_Escape) && !IN_GetJoyButtonsDB(joy));
|
||||
|
||||
if (LastScan != sc_Escape)
|
||||
{
|
||||
IN_GetJoyAbs(0,&maxx,&maxy);
|
||||
|
||||
if ((maxx != minx) && (maxy != miny))
|
||||
{
|
||||
Done = true;
|
||||
IN_SetupJoy(joy,minx,maxx,miny,maxy);
|
||||
}
|
||||
else
|
||||
while (IN_GetJoyButtonsDB(joy));
|
||||
}
|
||||
else
|
||||
Done = true;
|
||||
IN_GetJoyAbs(0,&maxx,&maxy);
|
||||
IN_SetupJoy(joy,minx,maxx,miny,maxy);
|
||||
}
|
||||
else
|
||||
Done = true;
|
||||
}
|
||||
|
||||
if (LastScan != sc_Escape)
|
||||
while (IN_GetJoyButtonsDB(joy));
|
||||
while (IN_GetJoyButtonsDB(joy))
|
||||
;
|
||||
|
||||
if (LastScan)
|
||||
IN_ClearKeysDown();
|
||||
@@ -2598,10 +2586,10 @@ extern char far gametext,far context,far story;
|
||||
break;
|
||||
}
|
||||
|
||||
MM_GetPtr(&dupe,5000);
|
||||
_fmemcpy((char far *)dupe,buf,5000);
|
||||
MM_GetPtr(&dupe,5600);
|
||||
_fmemcpy((char far *)dupe,buf,5600);
|
||||
|
||||
USL_DoHelp(dupe,5000);
|
||||
USL_DoHelp(dupe,5600);
|
||||
|
||||
MM_FreePtr(&dupe);
|
||||
if (LineOffsets)
|
||||
@@ -3325,14 +3313,14 @@ USL_TearDownCtlPanel(void)
|
||||
|
||||
if (!QuitToDos)
|
||||
{
|
||||
US_CenterWindow(20,8);
|
||||
US_CPrint("Loading");
|
||||
// US_CenterWindow(20,8); //NOLAN
|
||||
// US_CPrint("Loading");
|
||||
#if 0
|
||||
fontcolor = F_SECONDCOLOR;
|
||||
US_CPrint("Sounds");
|
||||
fontcolor = F_BLACK;
|
||||
#endif
|
||||
VW_UpdateScreen();
|
||||
// VW_UpdateScreen();
|
||||
|
||||
CA_LoadAllSounds();
|
||||
}
|
||||
@@ -3369,7 +3357,7 @@ US_ControlPanel(void)
|
||||
CA_MarkGrChunk(i);
|
||||
CA_MarkGrChunk(CTL_LITTLEMASKPICM);
|
||||
CA_MarkGrChunk(CTL_LSMASKPICM);
|
||||
CA_CacheMarks("Options Screen");
|
||||
CA_CacheMarks("Options Screen", 0);
|
||||
|
||||
USL_SetUpCtlPanel();
|
||||
|
||||
|
||||
@@ -16,173 +16,250 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
scr_rowcol(1,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(2,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(3,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(3,12) scr_aputs(" ",0x4E);
|
||||
scr_rowcol(3,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(4,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(4,12) scr_aputs("ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ",0x40);
|
||||
scr_rowcol(4,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(5,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(5,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(5,13) scr_aputs("ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß",0x7F);
|
||||
scr_rowcol(5,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(5,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(6,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(6,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(6,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(6,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(6,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(7,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(7,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(7,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(7,14) scr_aputs(" ",0x44);
|
||||
scr_rowcol(7,15) scr_aputs(" ",0x40);
|
||||
scr_rowcol(7,31) scr_aputs("Let the Dreams begin!",0x4E);
|
||||
scr_rowcol(7,52) scr_aputs(" ",0x40);
|
||||
scr_rowcol(7,67) scr_aputs(" ",0x44);
|
||||
scr_rowcol(7,68) scr_aputs(" ",0x77);
|
||||
scr_rowcol(7,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(7,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(8,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(8,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(8,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(8,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(8,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(9,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(9,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(9,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(9,19) scr_aputs("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»",0x70);
|
||||
scr_rowcol(9,64) scr_aputs(" ",0x77);
|
||||
scr_rowcol(9,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(9,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(10,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(10,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(10,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(10,19) scr_aputs("º",0x70);
|
||||
scr_rowcol(10,20) scr_aputs(" ",0x77);
|
||||
scr_rowcol(10,23) scr_aputs(" ",0x70);
|
||||
scr_rowcol(10,24) scr_aputs(" ",0x77);
|
||||
scr_rowcol(10,26) scr_aputs(" ",0x78);
|
||||
scr_rowcol(10,27) scr_aputs("Softdisk Publishing presents",0x71);
|
||||
scr_rowcol(10,55) scr_aputs(" ",0x77);
|
||||
scr_rowcol(10,63) scr_aputs("º",0x70);
|
||||
scr_rowcol(10,64) scr_aputs(" ",0x77);
|
||||
scr_rowcol(10,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(10,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(11,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(11,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(11,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(11,19) scr_aputs("º",0x70);
|
||||
scr_rowcol(11,20) scr_aputs(" ",0x77);
|
||||
scr_rowcol(11,23) scr_aputs(" ",0x70);
|
||||
scr_rowcol(11,24) scr_aputs(" ",0x77);
|
||||
scr_rowcol(11,32) scr_aputs(" ",0x74);
|
||||
scr_rowcol(11,45) scr_aputs(" ",0x77);
|
||||
scr_rowcol(11,63) scr_aputs("º",0x70);
|
||||
scr_rowcol(11,64) scr_aputs(" ",0x77);
|
||||
scr_rowcol(11,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(11,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(12,1) scr_aputs("ÜÜÜÜÜÜÜÜÜÜÜ",0xC);
|
||||
scr_rowcol(12,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(12,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(12,19) scr_aputs("º",0x70);
|
||||
scr_rowcol(12,20) scr_aputs(" ",0x77);
|
||||
scr_rowcol(12,23) scr_aputs(" ",0x70);
|
||||
scr_rowcol(12,24) scr_aputs(" ",0x77);
|
||||
scr_rowcol(12,34) scr_aputs(" ",0x78);
|
||||
scr_rowcol(12,35) scr_aputs("KEEN DREAMS",0x74);
|
||||
scr_rowcol(12,46) scr_aputs(" ",0x77);
|
||||
scr_rowcol(12,63) scr_aputs("º",0x70);
|
||||
scr_rowcol(12,64) scr_aputs(" ",0x77);
|
||||
scr_rowcol(12,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(12,70) scr_aputs("ÜÜÜÜÜÜÜÜÜÜÜ",0xC);
|
||||
scr_rowcol(13,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(13,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(13,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(13,19) scr_aputs("º",0x70);
|
||||
scr_rowcol(13,20) scr_aputs(" ",0x77);
|
||||
scr_rowcol(13,23) scr_aputs(" ",0x70);
|
||||
scr_rowcol(13,24) scr_aputs(" ",0x77);
|
||||
scr_rowcol(13,63) scr_aputs("º",0x70);
|
||||
scr_rowcol(13,64) scr_aputs(" ",0x77);
|
||||
scr_rowcol(13,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(13,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(14,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(14,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(14,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(14,19) scr_aputs("º",0x70);
|
||||
scr_rowcol(14,20) scr_aputs(" ",0x77);
|
||||
scr_rowcol(14,23) scr_aputs(" ",0x70);
|
||||
scr_rowcol(14,24) scr_aputs(" ",0x77);
|
||||
scr_rowcol(14,30) scr_aputs(" COMMANDER KEEN",0x78);
|
||||
scr_rowcol(14,48) scr_aputs(" ",0x77);
|
||||
scr_rowcol(14,63) scr_aputs("º",0x70);
|
||||
scr_rowcol(14,64) scr_aputs(" ",0x77);
|
||||
scr_rowcol(14,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(14,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(15,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(15,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(15,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(15,19) scr_aputs("º",0x70);
|
||||
scr_rowcol(15,20) scr_aputs(" ",0x77);
|
||||
scr_rowcol(15,23) scr_aputs(" ",0x70);
|
||||
scr_rowcol(15,24) scr_aputs(" ",0x77);
|
||||
scr_rowcol(15,31) scr_aputs(" is a trademark of",0x78);
|
||||
scr_rowcol(15,49) scr_aputs(" ",0x77);
|
||||
scr_rowcol(15,63) scr_aputs("º",0x70);
|
||||
scr_rowcol(15,64) scr_aputs(" ",0x77);
|
||||
scr_rowcol(15,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(15,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(16,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(16,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(16,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(16,19) scr_aputs("º",0x70);
|
||||
scr_rowcol(16,20) scr_aputs(" ",0x77);
|
||||
scr_rowcol(16,23) scr_aputs(" ",0x70);
|
||||
scr_rowcol(16,24) scr_aputs(" ",0x77);
|
||||
scr_rowcol(16,32) scr_aputs(" Id Software",0x78);
|
||||
scr_rowcol(16,46) scr_aputs(" ",0x77);
|
||||
scr_rowcol(16,63) scr_aputs("º",0x70);
|
||||
scr_rowcol(16,64) scr_aputs(" ",0x77);
|
||||
scr_rowcol(16,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(16,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(17,1) scr_aputs("ÜÜÜÜÜÜÜÜÜÜÜ",0xC);
|
||||
scr_rowcol(17,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(17,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(17,19) scr_aputs("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ",0x70);
|
||||
scr_rowcol(17,64) scr_aputs(" ",0x77);
|
||||
scr_rowcol(17,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(17,70) scr_aputs("ÜÜÜÜÜÜÜÜÜÜÜ",0xC);
|
||||
scr_rowcol(18,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(18,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(18,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(18,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(18,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(19,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(19,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(19,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(19,14) scr_aputs(" ",0x44);
|
||||
scr_rowcol(1,1) scr_aputs("ÛÛÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛÛÛ",0x4);
|
||||
scr_rowcol(2,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(2,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(2,5) scr_aputs("ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß",0x7F);
|
||||
scr_rowcol(2,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(2,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(3,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(3,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(3,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(3,6) scr_aputs(" Let the dreams begin! ",0x4E);
|
||||
scr_rowcol(3,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(3,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(3,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(4,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(4,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(4,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(4,6) scr_aputs(" ",0x71);
|
||||
scr_rowcol(4,16) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(4,18) scr_aputs("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»",0x70);
|
||||
scr_rowcol(4,62) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(4,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(4,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(4,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(5,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(5,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(5,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(5,6) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(5,12) scr_aputs(" ",0x71);
|
||||
scr_rowcol(5,18) scr_aputs("º",0x70);
|
||||
scr_rowcol(5,19) scr_aputs(" Now running",0x71);
|
||||
scr_rowcol(5,46) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(5,61) scr_aputs("º",0x70);
|
||||
scr_rowcol(5,62) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(5,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(5,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(5,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(6,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(6,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(6,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(6,6) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(6,18) scr_aputs("º",0x70);
|
||||
scr_rowcol(6,19) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(6,35) scr_aputs(" ",0x71);
|
||||
scr_rowcol(6,44) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(6,61) scr_aputs("º",0x70);
|
||||
scr_rowcol(6,62) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(6,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(6,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(6,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(7,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(7,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(7,5) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(7,18) scr_aputs("º",0x70);
|
||||
scr_rowcol(7,19) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(7,29) scr_aputs(" ",0x71);
|
||||
scr_rowcol(7,35) scr_aputs("KEEN DREAMS",0x74);
|
||||
scr_rowcol(7,46) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(7,61) scr_aputs("º",0x70);
|
||||
scr_rowcol(7,62) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(7,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(7,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(8,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(8,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(8,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(8,6) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(8,18) scr_aputs("º",0x70);
|
||||
scr_rowcol(8,19) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(8,39) scr_aputs("by",0x78);
|
||||
scr_rowcol(8,41) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(8,61) scr_aputs("º",0x70);
|
||||
scr_rowcol(8,62) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(8,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(8,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(8,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(9,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(9,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(9,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(9,6) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(9,18) scr_aputs("º",0x70);
|
||||
scr_rowcol(9,19) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(9,27) scr_aputs(" ",0x71);
|
||||
scr_rowcol(9,35) scr_aputs("ID Software",0x78);
|
||||
scr_rowcol(9,46) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(9,61) scr_aputs("º",0x70);
|
||||
scr_rowcol(9,62) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(9,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(9,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(9,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(10,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(10,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(10,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(10,6) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(10,18) scr_aputs("º",0x70);
|
||||
scr_rowcol(10,19) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(10,35) scr_aputs(" ",0x71);
|
||||
scr_rowcol(10,46) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(10,61) scr_aputs("º",0x70);
|
||||
scr_rowcol(10,62) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(10,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(10,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(10,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(11,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(11,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(11,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(11,6) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(11,18) scr_aputs("º",0x70);
|
||||
scr_rowcol(11,19) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(11,33) scr_aputs("exclusively from",0x71);
|
||||
scr_rowcol(11,49) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(11,61) scr_aputs("º",0x70);
|
||||
scr_rowcol(11,62) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(11,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(11,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(11,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(12,1) scr_aputs("ÜÜÜ",0xC);
|
||||
scr_rowcol(12,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(12,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(12,6) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(12,18) scr_aputs("º",0x70);
|
||||
scr_rowcol(12,19) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(12,27) scr_aputs(" ",0x71);
|
||||
scr_rowcol(12,35) scr_aputs("Gamer's Edge",0x74);
|
||||
scr_rowcol(12,47) scr_aputs(" ",0x71);
|
||||
scr_rowcol(12,49) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(12,61) scr_aputs("º",0x70);
|
||||
scr_rowcol(12,62) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(12,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(12,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(12,78) scr_aputs("ÜÜÜ",0xC);
|
||||
scr_rowcol(13,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(13,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(13,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(13,6) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(13,18) scr_aputs("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ",0x70);
|
||||
scr_rowcol(13,62) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(13,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(13,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(13,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(14,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(14,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(14,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(14,6) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(14,13) scr_aputs(" ",0x71);
|
||||
scr_rowcol(14,70) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(14,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(14,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(14,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(15,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(15,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(15,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(15,6) scr_aputs(" ",0x71);
|
||||
scr_rowcol(15,9) scr_aputs(" This software is NOT shareware or public domain. ",0x70);
|
||||
scr_rowcol(15,67) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(15,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(15,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(15,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(16,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(16,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(16,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(16,6) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(16,8) scr_aputs(" It is licensed to the original purchaser only. ",0x70);
|
||||
scr_rowcol(16,68) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(16,74) scr_aputs(" ",0x70);
|
||||
scr_rowcol(16,75) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(16,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(16,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(16,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(17,1) scr_aputs("ÜÜÜ",0xC);
|
||||
scr_rowcol(17,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(17,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(17,6) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(17,8) scr_aputs(" Please do not distribute. Thanks! ",0x70);
|
||||
scr_rowcol(17,71) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(17,74) scr_aputs(" ",0x70);
|
||||
scr_rowcol(17,75) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(17,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(17,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(17,78) scr_aputs("ÜÜÜ",0xC);
|
||||
scr_rowcol(18,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(18,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(18,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(18,6) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(18,15) scr_aputs(" ",0x7E);
|
||||
scr_rowcol(18,53) scr_aputs(" ",0x7B);
|
||||
scr_rowcol(18,67) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(18,74) scr_aputs(" ",0x70);
|
||||
scr_rowcol(18,75) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(18,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(18,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(18,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(19,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(19,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(19,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(19,6) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(19,7) scr_aputs(" ",0x4B);
|
||||
scr_rowcol(19,33) scr_aputs("Please standby...",0x4E);
|
||||
scr_rowcol(19,50) scr_aputs(" ",0x44);
|
||||
scr_rowcol(19,68) scr_aputs(" ",0x77);
|
||||
scr_rowcol(19,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(19,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(20,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(20,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(20,13) scr_aputs(" ",0x77);
|
||||
scr_rowcol(20,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(20,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(21,1) scr_aputs("ÜÜÜÜÜÜÜÜÜÜÜ",0xC);
|
||||
scr_rowcol(21,12) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(21,13) scr_aputs("ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ",0x78);
|
||||
scr_rowcol(21,69) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(21,70) scr_aputs("ÜÜÜÜÜÜÜÜÜÜÜ",0xC);
|
||||
scr_rowcol(22,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(22,12) scr_aputs("ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß",0x40);
|
||||
scr_rowcol(22,70) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(23,1) scr_aputs(" ",0xC4);
|
||||
scr_rowcol(19,50) scr_aputs(" ",0x41);
|
||||
scr_rowcol(19,51) scr_aputs(" ",0x4B);
|
||||
scr_rowcol(19,74) scr_aputs(" ",0x4E);
|
||||
scr_rowcol(19,75) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(19,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(19,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(19,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(20,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(20,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(20,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(20,6) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(20,13) scr_aputs(" ",0x70);
|
||||
scr_rowcol(20,15) scr_aputs("For technical assistance with running this software,",0x78);
|
||||
scr_rowcol(20,67) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(20,68) scr_aputs(" ",0x78);
|
||||
scr_rowcol(20,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(20,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(20,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(21,1) scr_aputs("ÜÜÜ",0xC);
|
||||
scr_rowcol(21,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(21,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(21,6) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(21,14) scr_aputs(" ",0x70);
|
||||
scr_rowcol(21,23) scr_aputs("* Type HELP at the DOS prompt, or",0x78);
|
||||
scr_rowcol(21,56) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(21,67) scr_aputs(" ",0x78);
|
||||
scr_rowcol(21,76) scr_aputs(" ",0x70);
|
||||
scr_rowcol(21,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(21,78) scr_aputs("ÜÜÜ",0xC);
|
||||
scr_rowcol(22,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(22,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(22,5) scr_aputs(" ",0x70);
|
||||
scr_rowcol(22,6) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(22,7) scr_aputs(" ",0x71);
|
||||
scr_rowcol(22,13) scr_aputs(" ",0x7A);
|
||||
scr_rowcol(22,14) scr_aputs(" ",0x70);
|
||||
scr_rowcol(22,23) scr_aputs("* Call 1-318-221-8311 for help",0x78);
|
||||
scr_rowcol(22,53) scr_aputs(" ",0x70);
|
||||
scr_rowcol(22,68) scr_aputs(" ",0x78);
|
||||
scr_rowcol(22,70) scr_aputs(" ",0x71);
|
||||
scr_rowcol(22,75) scr_aputs(" ",0x70);
|
||||
scr_rowcol(22,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(22,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(23,1) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(23,4) scr_aputs("Þ",0xF);
|
||||
scr_rowcol(23,5) scr_aputs("ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ",0x78);
|
||||
scr_rowcol(23,77) scr_aputs("Ý",0x8);
|
||||
scr_rowcol(23,78) scr_aputs("ÛÛÛ",0x4);
|
||||
scr_rowcol(24,1) scr_aputs("ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ",0xC);
|
||||
scr_rowcol(25,1) scr_aputs(" ",0x7);
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
/* Keen Dreams Source Code
|
||||
* Copyright (C) 2014 Javier M. Chavez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <alloc.h>
|
||||
#include <fcntl.h>
|
||||
#include <dos.h>
|
||||
#include <io.h>
|
||||
|
||||
#include "kd_def.h"
|
||||
//#include "gelib.h"
|
||||
#include "jam_io.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//
|
||||
// PTR/PTR COMPRESSION ROUTINES
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// WritePtr() -- Outputs data to a particular ptr type
|
||||
//
|
||||
// PtrType MUST be of type DEST_TYPE.
|
||||
//
|
||||
// NOTE : For PtrTypes DEST_MEM a ZERO (0) is always returned.
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
char WritePtr(long outfile, unsigned char data, unsigned PtrType)
|
||||
{
|
||||
int returnval = 0;
|
||||
|
||||
switch (PtrType & DEST_TYPES)
|
||||
{
|
||||
case DEST_FILE:
|
||||
write(*(int far *)outfile,(char *)&data,1);
|
||||
break;
|
||||
|
||||
case DEST_FFILE:
|
||||
returnval = putc(data, *(FILE **)outfile);
|
||||
break;
|
||||
|
||||
case DEST_IMEM:
|
||||
printf("WritePtr - unsupported ptr type\n");
|
||||
exit(0);
|
||||
break;
|
||||
|
||||
case DEST_MEM:
|
||||
*((char far *)*(char far **)outfile)++ = data;
|
||||
break;
|
||||
}
|
||||
|
||||
return(returnval);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// ReadPtr() -- Reads data from a particular ptr type
|
||||
//
|
||||
// PtrType MUST be of type SRC_TYPE.
|
||||
//
|
||||
// RETURNS :
|
||||
// The char read in or EOF for SRC_FFILE type of reads.
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
int ReadPtr(long infile, unsigned PtrType)
|
||||
{
|
||||
int returnval = 0;
|
||||
|
||||
switch (PtrType & SRC_TYPES)
|
||||
{
|
||||
case SRC_FILE:
|
||||
read(*(int far *)infile,(char *)&returnval,1);
|
||||
break;
|
||||
|
||||
case SRC_FFILE:
|
||||
returnval = getc(*(FILE far **)infile);
|
||||
break;
|
||||
|
||||
case SRC_BFILE:
|
||||
returnval = bio_readch((BufferedIO *)*(void far **)infile);
|
||||
break;
|
||||
|
||||
// case SRC_IMEM:
|
||||
// printf("WritePtr - unsupported ptr type\n");
|
||||
// exit(0);
|
||||
// break;
|
||||
|
||||
case SRC_MEM:
|
||||
returnval = (unsigned char)*((char far *)*(char far **)infile)++;
|
||||
break;
|
||||
}
|
||||
|
||||
return(returnval);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/* Keen Dreams Source Code
|
||||
* Copyright (C) 2014 Javier M. Chavez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
//
|
||||
// UNIT : JAM_IO.h
|
||||
//
|
||||
// FUNCTION : General defines, prototypes, typedefs used in all the
|
||||
// supported compression techniques used in JAMPAK Ver x.x
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// PARAMETER PASSING TYPES
|
||||
//
|
||||
//
|
||||
// SOURCE PARAMS (LO BYTE)
|
||||
|
||||
#define SRC_FILE (0x0001) // GE Buffered IO
|
||||
#define SRC_FFILE (0x0002) // Stdio File IO (fwrite etc.)
|
||||
#define SRC_MEM (0x0004) // Std void ptr (alloc etc)
|
||||
#define SRC_BFILE (0x0008) // Buffered File I/O
|
||||
|
||||
#define SRC_TYPES (SRC_FILE | SRC_FFILE | SRC_MEM | SRC_BFILE)
|
||||
|
||||
// DESTINATION PARAMS (HI BYTE)
|
||||
|
||||
#define DEST_FILE (0x0100) // GE Buffered IO
|
||||
#define DEST_FFILE (0x0200) // Stdio File IO (fwrite etc.)
|
||||
#define DEST_MEM (0x0400) // Std void ptr (alloc etc)
|
||||
#define DEST_IMEM (0x0800) // ID Memory alloc
|
||||
|
||||
#define DEST_TYPES (DEST_FILE | DEST_FFILE | DEST_MEM | DEST_IMEM)
|
||||
|
||||
|
||||
|
||||
//=========================================================================
|
||||
//
|
||||
// FILE CHUNK IDs
|
||||
//
|
||||
// NOTE: The only reason for changing from COMP to CMP1 and having multi
|
||||
// comp header structs is for downward compatablity.
|
||||
//
|
||||
|
||||
#define COMP ("COMP") // Comp type is ct_LZW ALWAYS!
|
||||
#define CMP1 ("CMP1") // Comp type is determined in header.
|
||||
|
||||
|
||||
//
|
||||
// COMPRESSION TYPES
|
||||
//
|
||||
typedef enum ct_TYPES
|
||||
{
|
||||
ct_NONE = 0, // No compression - Just data..Rarely used!
|
||||
ct_LZW, // LZW data compression
|
||||
ct_LZH,
|
||||
|
||||
} ct_TYPES;
|
||||
|
||||
//
|
||||
// FILE CHUNK HEADER FORMATS
|
||||
//
|
||||
|
||||
struct COMPStruct
|
||||
{
|
||||
unsigned long DecompLen;
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct CMP1Header
|
||||
{
|
||||
unsigned CompType; // SEE: ct_TYPES above for list of pos.
|
||||
unsigned long OrginalLen; // Orginal FileLength of compressed Data.
|
||||
unsigned long CompressLen; // Length of data after compression (A MUST for LZHUFF!)
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// FUNCTION PROTOTYPEING
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
char WritePtr(long outfile, unsigned char data, unsigned PtrType);
|
||||
int ReadPtr(long infile, unsigned PtrType);
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "ID_HEADS.H"
|
||||
#include <BIOS.H>
|
||||
#include "SOFT.H"
|
||||
#include "SL_FILE.H"
|
||||
|
||||
#define FRILLS 0 // Cut out frills for 360K - MIKE MAYNARD
|
||||
|
||||
@@ -131,6 +133,35 @@ typedef struct objstruct
|
||||
} objtype;
|
||||
|
||||
|
||||
struct BitMapHeader {
|
||||
unsigned int w,h,x,y;
|
||||
unsigned char d,trans,comp,pad;
|
||||
};
|
||||
|
||||
struct BitMap {
|
||||
unsigned int Width;
|
||||
unsigned int Height;
|
||||
unsigned int Depth;
|
||||
unsigned int BytesPerRow;
|
||||
char far *Planes[8];
|
||||
};
|
||||
|
||||
struct Shape {
|
||||
memptr Data;
|
||||
long size;
|
||||
unsigned int BPR;
|
||||
struct BitMapHeader bmHdr;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int handle; // handle of file
|
||||
memptr buffer; // pointer to buffer
|
||||
word offset; // offset into buffer
|
||||
word status; // read/write status
|
||||
} BufferedIO;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
@@ -312,3 +343,22 @@ extern statetype s_deathwait2;
|
||||
extern statetype s_deathwait3;
|
||||
extern statetype s_deathboom1;
|
||||
extern statetype s_deathboom2;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// GELIB.C DEFINITIONS
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void FreeShape(struct Shape *shape);
|
||||
int UnpackEGAShapeToScreen(struct Shape *SHP,int startx,int starty);
|
||||
|
||||
long Verify(char *filename);
|
||||
memptr InitBufferedIO(int handle, BufferedIO *bio);
|
||||
void FreeBufferedIO(BufferedIO *bio);
|
||||
byte bio_readch(BufferedIO *bio);
|
||||
void bio_fillbuffer(BufferedIO *bio);
|
||||
void SwapLong(long far *Var);
|
||||
void SwapWord(unsigned int far *Var);
|
||||
void MoveGfxDst(short x, short y);
|
||||
@@ -18,11 +18,12 @@
|
||||
|
||||
// KD_DEMO.C
|
||||
|
||||
#include <dir.h>
|
||||
#include "KD_DEF.H"
|
||||
|
||||
#pragma hdrstop
|
||||
#pragma hdrstop
|
||||
|
||||
#define RLETAG 0xABCD
|
||||
#define RLETAG 0xABCD
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
@@ -63,9 +64,9 @@
|
||||
|
||||
void NewGame (void)
|
||||
{
|
||||
word i;
|
||||
word i;
|
||||
|
||||
gamestate.worldx = 0; // spawn keen at starting spot
|
||||
gamestate.worldx = 0; // spawn keen at starting spot
|
||||
|
||||
gamestate.mapon = 0;
|
||||
gamestate.score = 0;
|
||||
@@ -90,7 +91,7 @@ int WaitOrKey (int vbls)
|
||||
{
|
||||
while (vbls--)
|
||||
{
|
||||
IN_ReadControl(0,&c); // get player input
|
||||
IN_ReadControl(0,&c); // get player input
|
||||
if (LastScan || c.button0 || c.button1)
|
||||
{
|
||||
IN_ClearKeysDown ();
|
||||
@@ -138,7 +139,7 @@ GameOver (void)
|
||||
|
||||
void StatusWindow (void)
|
||||
{
|
||||
word x;
|
||||
word x;
|
||||
|
||||
// DEBUG - make this look better
|
||||
|
||||
@@ -197,9 +198,9 @@ void StatusWindow (void)
|
||||
boolean
|
||||
SaveGame(int file)
|
||||
{
|
||||
word i,size,compressed,expanded;
|
||||
objtype *o;
|
||||
memptr bigbuffer;
|
||||
word i,size,compressed,expanded;
|
||||
objtype *o;
|
||||
memptr bigbuffer;
|
||||
|
||||
if (!CA_FarWrite(file,(void far *)&gamestate,sizeof(gamestate)))
|
||||
return(false);
|
||||
@@ -207,7 +208,7 @@ SaveGame(int file)
|
||||
expanded = mapwidth * mapheight * 2;
|
||||
MM_GetPtr (&bigbuffer,expanded);
|
||||
|
||||
for (i = 0;i < 3;i++) // Write all three planes of the map
|
||||
for (i = 0;i < 3;i++) // Write all three planes of the map
|
||||
{
|
||||
//
|
||||
// leave a word at start of compressed data for compressed length
|
||||
@@ -239,12 +240,12 @@ SaveGame(int file)
|
||||
boolean
|
||||
LoadGame(int file)
|
||||
{
|
||||
word i,j,size;
|
||||
objtype *o;
|
||||
word i,j,size;
|
||||
objtype *o;
|
||||
int orgx,orgy;
|
||||
objtype *prev,*next,*followed;
|
||||
unsigned compressed,expanded;
|
||||
memptr bigbuffer;
|
||||
objtype *prev,*next,*followed;
|
||||
unsigned compressed,expanded;
|
||||
memptr bigbuffer;
|
||||
|
||||
if (!CA_FarRead(file,(void far *)&gamestate,sizeof(gamestate)))
|
||||
return(false);
|
||||
@@ -255,7 +256,7 @@ LoadGame(int file)
|
||||
ca_levelbit >>= 1;
|
||||
ca_levelnum--;
|
||||
|
||||
SetupGameLevel (false); // load in and cache the base old level
|
||||
SetupGameLevel (false); // load in and cache the base old level
|
||||
titleptr[ca_levelnum] = levelnames[mapon];
|
||||
|
||||
ca_levelbit <<= 1;
|
||||
@@ -264,7 +265,7 @@ LoadGame(int file)
|
||||
expanded = mapwidth * mapheight * 2;
|
||||
MM_GetPtr (&bigbuffer,expanded);
|
||||
|
||||
for (i = 0;i < 3;i++) // Read all three planes of the map
|
||||
for (i = 0;i < 3;i++) // Read all three planes of the map
|
||||
{
|
||||
if (!CA_FarRead(file,(void far *)&compressed,sizeof(compressed)) )
|
||||
{
|
||||
@@ -315,9 +316,9 @@ LoadGame(int file)
|
||||
break;
|
||||
}
|
||||
|
||||
*((long *)&(scoreobj->temp1)) = -1; // force score to be updated
|
||||
scoreobj->temp3 = -1; // and flower power
|
||||
scoreobj->temp4 = -1; // and lives
|
||||
*((long *)&(scoreobj->temp1)) = -1; // force score to be updated
|
||||
scoreobj->temp3 = -1; // and flower power
|
||||
scoreobj->temp4 = -1; // and lives
|
||||
|
||||
return(true);
|
||||
}
|
||||
@@ -329,7 +330,7 @@ ResetGame(void)
|
||||
|
||||
ca_levelnum--;
|
||||
CA_ClearMarks();
|
||||
titleptr[ca_levelnum] = NULL; // don't reload old level
|
||||
titleptr[ca_levelnum] = NULL; // don't reload old level
|
||||
ca_levelnum++;
|
||||
}
|
||||
|
||||
@@ -345,11 +346,11 @@ TEDDeath(void)
|
||||
static boolean
|
||||
MoveTitleTo(int offset)
|
||||
{
|
||||
boolean done;
|
||||
int dir,
|
||||
boolean done;
|
||||
int dir,
|
||||
chunk,
|
||||
move;
|
||||
longword lasttime,delay;
|
||||
longword lasttime,delay;
|
||||
|
||||
if (offset < originxglobal)
|
||||
dir = -1;
|
||||
@@ -427,10 +428,16 @@ ShowText(int offset,WindowRec *wr,char *s)
|
||||
void
|
||||
DemoLoop (void)
|
||||
{
|
||||
char *s;
|
||||
word move;
|
||||
longword lasttime;
|
||||
WindowRec mywin;
|
||||
char *s;
|
||||
word move;
|
||||
longword lasttime;
|
||||
char *FileName1;
|
||||
struct Shape FileShape1;
|
||||
struct ffblk ffblk;
|
||||
WindowRec mywin;
|
||||
int bufsave = bufferofs;
|
||||
int dissave = displayofs;
|
||||
|
||||
|
||||
#if FRILLS
|
||||
//
|
||||
@@ -450,94 +457,64 @@ DemoLoop (void)
|
||||
//
|
||||
US_SetLoadSaveHooks(LoadGame,SaveGame,ResetGame);
|
||||
restartgame = gd_Continue;
|
||||
|
||||
if (findfirst("KDREAMS.CMP", &ffblk, 0) == -1)
|
||||
Quit("Couldn't find KDREAMS.CMP");
|
||||
|
||||
while (true)
|
||||
{
|
||||
// Load the Title map
|
||||
gamestate.mapon = 20; // title map number
|
||||
|
||||
loadedgame = false;
|
||||
SetupGameLevel(true);
|
||||
|
||||
FileName1 = "TITLESCR.LBM";
|
||||
if (LoadLIBShape("KDREAMS.CMP", FileName1, &FileShape1))
|
||||
Quit("Can't load TITLE SCREEN");
|
||||
|
||||
|
||||
while (!restartgame && !loadedgame)
|
||||
{
|
||||
|
||||
VW_InitDoubleBuffer();
|
||||
IN_ClearKeysDown();
|
||||
|
||||
while (true)
|
||||
{
|
||||
// Display the Title map
|
||||
RF_NewPosition((5 * TILEGLOBAL) + (TILEGLOBAL / 2),
|
||||
(TILEGLOBAL * 2) + (TILEGLOBAL / 2)
|
||||
+ (TILEGLOBAL / 4));
|
||||
RF_ForceRefresh();
|
||||
RF_Refresh();
|
||||
RF_Refresh();
|
||||
|
||||
if (Wait(TickBase * 2))
|
||||
VW_SetScreen(0, 0);
|
||||
MoveGfxDst(0, 200);
|
||||
UnpackEGAShapeToScreen(&FileShape1, 0, 0);
|
||||
VW_ScreenToScreen (64*200,0,40,200);
|
||||
|
||||
if (IN_UserInput(TickBase * 4, false))
|
||||
break;
|
||||
|
||||
mywin.x = (16 * 13) + 4;
|
||||
mywin.y = 0;
|
||||
mywin.w = 16 * 7;
|
||||
mywin.h = 200;
|
||||
mywin.px = mywin.x + 0;
|
||||
mywin.py = mywin.y + 10;
|
||||
s = "Game\n"
|
||||
"John Carmack\n"
|
||||
"\n"
|
||||
"Utilities\n"
|
||||
"John Romero\n"
|
||||
"\n"
|
||||
"Interface/Sound\n"
|
||||
"Jason Blochowiak\n"
|
||||
"\n"
|
||||
"Creative Director\n"
|
||||
"Tom Hall\n"
|
||||
"\n"
|
||||
"Art\n"
|
||||
"Adrian Carmack\n";
|
||||
if (ShowText((9 * TILEGLOBAL) - (PIXGLOBAL * 2),&mywin,s))
|
||||
break;
|
||||
|
||||
mywin.x = 4;
|
||||
mywin.y = 0;
|
||||
mywin.w = 16 * 7;
|
||||
mywin.h = 200;
|
||||
mywin.px = mywin.x + 0;
|
||||
mywin.py = mywin.y + 10;
|
||||
s = "\n"
|
||||
"\"Keen Dreams\"\n"
|
||||
"Copyright 1991-93\n"
|
||||
"Softdisk, Inc.\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"Commander Keen\n"
|
||||
"Copyright 1990-91\n"
|
||||
"Id Software, Inc.\n"
|
||||
"\n"
|
||||
"Press F1 for Help\n"
|
||||
"SPACE to Start\n";
|
||||
if (ShowText((2 * TILEGLOBAL) + (PIXGLOBAL * 2),&mywin,s))
|
||||
break;
|
||||
|
||||
if (MoveTitleTo((5 * TILEGLOBAL) + (TILEGLOBAL / 2)))
|
||||
break;
|
||||
if (Wait(TickBase * 3))
|
||||
MoveGfxDst(0, 200);
|
||||
UnpackEGAShapeToScreen(&FileShape1, 0, 0);
|
||||
VW_ScreenToScreen (64*200,0,40,200);
|
||||
|
||||
if (IN_UserInput(TickBase * 3, false))
|
||||
break;
|
||||
|
||||
displayofs = 0;
|
||||
VWB_Bar(0,0,320,200,FIRSTCOLOR);
|
||||
US_DisplayHighScores(-1);
|
||||
|
||||
if (IN_UserInput(TickBase * 8,false))
|
||||
if (IN_UserInput(TickBase * 6, false))
|
||||
break;
|
||||
}
|
||||
|
||||
bufferofs = bufsave;
|
||||
displayofs = dissave;
|
||||
|
||||
VW_FixRefreshBuffer();
|
||||
US_ControlPanel ();
|
||||
}
|
||||
|
||||
if (!loadedgame)
|
||||
NewGame();
|
||||
|
||||
FreeShape(&FileShape1);
|
||||
|
||||
GameLoop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +33,6 @@
|
||||
#include "KD_DEF.H"
|
||||
#pragma hdrstop
|
||||
|
||||
#define CATALOG
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
@@ -51,9 +49,9 @@
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
char str[80],str2[20];
|
||||
boolean singlestep,jumpcheat,godmode,tedlevel;
|
||||
unsigned tedlevelnum;
|
||||
char str[80],str2[20];
|
||||
boolean singlestep,jumpcheat,godmode,tedlevel;
|
||||
unsigned tedlevelnum;
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
@@ -63,13 +61,13 @@ unsigned tedlevelnum;
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
void DebugMemory (void);
|
||||
void TestSprites(void);
|
||||
int DebugKeys (void);
|
||||
void ShutdownId (void);
|
||||
void Quit (char *error);
|
||||
void InitGame (void);
|
||||
void main (void);
|
||||
void DebugMemory (void);
|
||||
void TestSprites(void);
|
||||
int DebugKeys (void);
|
||||
void ShutdownId (void);
|
||||
void Quit (char *error);
|
||||
void InitGame (void);
|
||||
void main (void);
|
||||
|
||||
//===========================================================================
|
||||
|
||||
@@ -112,14 +110,14 @@ void DebugMemory (void)
|
||||
===================
|
||||
*/
|
||||
|
||||
#define DISPWIDTH 110
|
||||
#define TEXTWIDTH 40
|
||||
#define DISPWIDTH 110
|
||||
#define TEXTWIDTH 40
|
||||
void TestSprites(void)
|
||||
{
|
||||
int hx,hy,sprite,oldsprite,bottomy,topx,shift;
|
||||
spritetabletype far *spr;
|
||||
spritetype _seg *block;
|
||||
unsigned mem,scan;
|
||||
spritetype _seg *block;
|
||||
unsigned mem,scan;
|
||||
|
||||
|
||||
VW_FixRefreshBuffer ();
|
||||
@@ -171,7 +169,7 @@ void TestSprites(void)
|
||||
else
|
||||
{
|
||||
mem = block->sourceoffset[3]+5*block->planesize[3];
|
||||
mem = (mem+15)&(~15); // round to paragraphs
|
||||
mem = (mem+15)&(~15); // round to paragraphs
|
||||
US_PrintUnsigned (mem);
|
||||
}
|
||||
|
||||
@@ -239,7 +237,7 @@ int DebugKeys (void)
|
||||
int level;
|
||||
|
||||
#if FRILLS
|
||||
if (Keyboard[0x12] && ingame) // DEBUG: end + 'E' to quit level
|
||||
if (Keyboard[0x12] && ingame) // DEBUG: end + 'E' to quit level
|
||||
{
|
||||
if (tedlevel)
|
||||
TEDDeath();
|
||||
@@ -247,7 +245,7 @@ int DebugKeys (void)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (Keyboard[0x22] && ingame) // G = god mode
|
||||
if (Keyboard[0x22] && ingame) // G = god mode
|
||||
{
|
||||
VW_FixRefreshBuffer ();
|
||||
US_CenterWindow (12,2);
|
||||
@@ -260,7 +258,7 @@ int DebugKeys (void)
|
||||
godmode ^= 1;
|
||||
return 1;
|
||||
}
|
||||
else if (Keyboard[0x17]) // I = item cheat
|
||||
else if (Keyboard[0x17]) // I = item cheat
|
||||
{
|
||||
VW_FixRefreshBuffer ();
|
||||
US_CenterWindow (12,3);
|
||||
@@ -272,7 +270,7 @@ int DebugKeys (void)
|
||||
IN_Ack ();
|
||||
return 1;
|
||||
}
|
||||
else if (Keyboard[0x24]) // J = jump cheat
|
||||
else if (Keyboard[0x24]) // J = jump cheat
|
||||
{
|
||||
jumpcheat^=1;
|
||||
VW_FixRefreshBuffer ();
|
||||
@@ -286,17 +284,17 @@ int DebugKeys (void)
|
||||
return 1;
|
||||
}
|
||||
#if FRILLS
|
||||
else if (Keyboard[0x32]) // M = memory info
|
||||
else if (Keyboard[0x32]) // M = memory info
|
||||
{
|
||||
DebugMemory();
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
else if (Keyboard[0x19]) // P = pause with no screen disruptioon
|
||||
else if (Keyboard[0x19]) // P = pause with no screen disruptioon
|
||||
{
|
||||
IN_Ack();
|
||||
}
|
||||
else if (Keyboard[0x1f] && ingame) // S = slow motion
|
||||
else if (Keyboard[0x1f] && ingame) // S = slow motion
|
||||
{
|
||||
singlestep^=1;
|
||||
VW_FixRefreshBuffer ();
|
||||
@@ -310,13 +308,13 @@ int DebugKeys (void)
|
||||
return 1;
|
||||
}
|
||||
#if FRILLS
|
||||
else if (Keyboard[0x14]) // T = sprite test
|
||||
else if (Keyboard[0x14]) // T = sprite test
|
||||
{
|
||||
TestSprites();
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
else if (Keyboard[0x11] && ingame) // W = warp to level
|
||||
else if (Keyboard[0x11] && ingame) // W = warp to level
|
||||
{
|
||||
VW_FixRefreshBuffer ();
|
||||
US_CenterWindow(26,3);
|
||||
@@ -379,23 +377,17 @@ void Quit (char *error)
|
||||
clrscr();
|
||||
puts(error);
|
||||
puts("\n");
|
||||
// puts("For techinical assistance with running this software, type HELP at");
|
||||
// puts(" the DOS prompt or call Softdisk Publishing at 1-318-221-8311");
|
||||
puts("For techinical assistance with running this software, type HELP at");
|
||||
puts(" the DOS prompt or call Gamer's Edge at 1-318-221-8311");
|
||||
exit(1);
|
||||
}
|
||||
#ifndef CATALOG
|
||||
|
||||
_argc = 2;
|
||||
_argv[1] = "LAST.SHL";
|
||||
_argv[2] = "ENDSCN.SCN";
|
||||
_argv[3] = NULL;
|
||||
if (execv("LOADSCN.EXE", _argv) == -1)
|
||||
Quit("Couldn't find executable LOADSCN.EXE.\n");
|
||||
#endif
|
||||
#ifdef CATALOG
|
||||
VW_SetScreenMode(TEXTGR);
|
||||
exit(0);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -410,7 +402,9 @@ void Quit (char *error)
|
||||
==========================
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#include "piracy.h"
|
||||
#endif
|
||||
|
||||
void InitGame (void)
|
||||
{
|
||||
@@ -418,6 +412,7 @@ void InitGame (void)
|
||||
|
||||
MM_Startup ();
|
||||
|
||||
|
||||
#if 0
|
||||
// Handle piracy screen...
|
||||
//
|
||||
@@ -425,16 +420,15 @@ void InitGame (void)
|
||||
while ((bioskey(0)>>8) != sc_Return);
|
||||
#endif
|
||||
|
||||
|
||||
#if GRMODE == EGAGR
|
||||
if (mminfo.mainmem < 335l*1024)
|
||||
{
|
||||
#pragma warn -pro
|
||||
#pragma warn -nod
|
||||
textcolor(7);
|
||||
textbackground(0);
|
||||
clrscr(); // we can't include CONIO because of a name conflict
|
||||
#pragma warn +nod
|
||||
#pragma warn +pro
|
||||
#pragma warn -pro
|
||||
#pragma warn -nod
|
||||
clrscr(); // we can't include CONIO because of a name conflict
|
||||
#pragma warn +nod
|
||||
#pragma warn +pro
|
||||
puts ("There is not enough memory available to play the game reliably. You can");
|
||||
puts ("play anyway, but an out of memory condition will eventually pop up. The");
|
||||
puts ("correct solution is to unload some TSRs or rename your CONFIG.SYS and");
|
||||
@@ -454,7 +448,7 @@ void InitGame (void)
|
||||
SD_Startup ();
|
||||
US_Startup ();
|
||||
|
||||
US_UpdateTextScreen();
|
||||
// US_UpdateTextScreen();
|
||||
|
||||
CA_Startup ();
|
||||
US_Setup ();
|
||||
@@ -472,7 +466,7 @@ void InitGame (void)
|
||||
for (i=KEEN_LUMP_START;i<=KEEN_LUMP_END;i++)
|
||||
CA_MarkGrChunk(i);
|
||||
|
||||
CA_CacheMarks (NULL);
|
||||
CA_CacheMarks (NULL, 0);
|
||||
|
||||
MM_SetLock (&grsegs[STARTFONT],true);
|
||||
MM_SetLock (&grsegs[STARTFONTM],true);
|
||||
@@ -503,43 +497,13 @@ void InitGame (void)
|
||||
==========================
|
||||
*/
|
||||
|
||||
static char *EntryParmStrings[] = {"detour",nil};
|
||||
static char *EntryParmStrings[] = {"detour",nil};
|
||||
|
||||
void main (void)
|
||||
{
|
||||
boolean LaunchedFromShell = false;
|
||||
short i;
|
||||
|
||||
textcolor(7);
|
||||
textbackground(0);
|
||||
|
||||
if (stricmp(_argv[1], "/VER") == 0)
|
||||
{
|
||||
printf("KEEN DREAMS\n");
|
||||
printf("CGA Version\n");
|
||||
printf("Copyright 1991-93 Softdisk Publishing\n");
|
||||
printf("Version 1.05 (rev 1)\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (stricmp(_argv[1], "/?") == 0)
|
||||
{
|
||||
printf("\nKeen Dreams CGA version 1.05\n");
|
||||
printf("Copyright 1991-1993 Softdisk Publishing.\n\n");
|
||||
printf("Commander Keen is a trademark of Id Software.\n");
|
||||
printf("Type KDREAMS from the DOS prompt to run.\n\n");
|
||||
printf("KDREAMS /COMP for SVGA compatibility mode\n");
|
||||
printf("KDREAMS /NODR stops program hang with the drive still on\n");
|
||||
printf("KDREAMS /NOAL disables AdLib and Sound Blaster detection\n");
|
||||
printf("KDREAMS /NOSB disables Sound Blaster detection\n");
|
||||
printf("KDREAMS /NOJOYS ignores joystick\n");
|
||||
printf("KDREAMS /NOMOUSE ignores mouse\n");
|
||||
printf("KDREAMS /HIDDENCARD overrides video card detection\n");
|
||||
printf("KDREAMS /VER for version and compatibility information\n");
|
||||
printf("KDREAMS /? for this help information\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
for (i = 1;i < _argc;i++)
|
||||
{
|
||||
switch (US_CheckParm(_argv[i],EntryParmStrings))
|
||||
@@ -549,18 +513,17 @@ void main (void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifndef CATALOG
|
||||
|
||||
if (!LaunchedFromShell)
|
||||
{
|
||||
clrscr();
|
||||
puts("You must type START at the DOS prompt to run KEEN DREAMS.");
|
||||
exit(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
InitGame();
|
||||
|
||||
DemoLoop(); // DemoLoop calls Quit when everything is done
|
||||
DemoLoop(); // DemoLoop calls Quit when everything is done
|
||||
Quit("Demo loop exited???");
|
||||
}
|
||||
|
||||
|
||||
@@ -81,14 +81,14 @@ char *levelnames[21] =
|
||||
"Bridge Bottoms",
|
||||
"Rhubarb Rapids",
|
||||
"Parsnip Pass",
|
||||
"Cheat Level 1",
|
||||
"Level 6",
|
||||
"Spud City",
|
||||
"Cheat Level 2",
|
||||
"Level 8",
|
||||
"Apple Acres",
|
||||
"Grape Grove",
|
||||
"Cheat Level 3",
|
||||
"Level 11",
|
||||
"Brussels Sprout Bay",
|
||||
"Cheat Level 4",
|
||||
"Level 13",
|
||||
"Squash Swamp",
|
||||
"Boobus' Chamber",
|
||||
"Castle Tuberia",
|
||||
@@ -679,6 +679,7 @@ void FadeAndUnhook (void)
|
||||
{
|
||||
if (++fadecount==2)
|
||||
{
|
||||
RF_ForceRefresh();
|
||||
VW_FadeIn ();
|
||||
RF_SetRefreshHook (NULL);
|
||||
lasttimecount = TimeCount; // don't adaptively time the fade
|
||||
@@ -738,7 +739,7 @@ void SetupGameLevel (boolean loadnow)
|
||||
US_PrintCentered ("Boobus Bombs Near!");
|
||||
VW_UpdateScreen ();
|
||||
}
|
||||
CA_CacheMarks (levelnames[mapon]);
|
||||
CA_CacheMarks (levelnames[mapon], 0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -1725,6 +1726,7 @@ struct date d;
|
||||
VW_WaitVBL(60);
|
||||
IN_ClearKeysDown ();
|
||||
IN_Ack();
|
||||
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,35 @@
|
||||
/* Keen Dreams Source Code
|
||||
* Copyright (C) 2014 Javier M. Chavez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
extern void (*LZH_CompressDisplayVector)();
|
||||
extern void (*LZH_DecompressDisplayVector)();
|
||||
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// PROTOTYPES
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
|
||||
long lzhCompress(void far *infile, void far *outfile,unsigned long DataLength,unsigned PtrTypes);
|
||||
long lzhDecompress(void far *infile, void far *outfile, unsigned long OrginalLength, unsigned long CompressLength, unsigned PtrTypes);
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/* Keen Dreams Source Code
|
||||
* Copyright (C) 2014 Javier M. Chavez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
// EXTERN DEFINITIONS FOR DISPLAY VEC ROUTINES
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
|
||||
extern void (*LZW_CompressDisplayVector)();
|
||||
extern void (*LZW_DecompressDisplayVector)();
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// FUNCTION PROTOTYPEING
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
unsigned long lzwCompress(void far *infile, void far *outfile,unsigned long DataLength,unsigned PtrTypes);
|
||||
void lzwDecompress(void far *infile, void far *outfile,unsigned long DataLength,unsigned PtrTypes);
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/* Keen Dreams Source Code
|
||||
* Copyright (C) 2014 Javier M. Chavez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef _SL_FILE_H
|
||||
#define _SL_FILE_H
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// DEFINES
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
#ifndef MakeID
|
||||
#define MakeID(a,b,c,d) (((long)(d)<<24L)|((long)(c)<<16L)|((long)(b)<<8L)|(long)(a))
|
||||
#endif
|
||||
|
||||
|
||||
#define ID_SLIB MakeID('S','L','I','B')
|
||||
#define SLIB ("SLIB")
|
||||
#define SOFTLIB_VER 2
|
||||
#define ID_CHUNK MakeID('C','U','N','K')
|
||||
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// TYPES
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// SOFTLIB File Entry Types
|
||||
//--------------------------------------------------------------------------
|
||||
typedef enum LibFileTypes
|
||||
{
|
||||
lib_DATA =0, // Just streight raw data
|
||||
// lib_AUDIO, // Multi chunk audio file
|
||||
|
||||
} LibFileTypes;
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// SOFTLIB Library File header..
|
||||
//
|
||||
// * This header will NEVER change! *
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
typedef struct SoftLibHdr
|
||||
{
|
||||
unsigned Version; // Library Version Num
|
||||
unsigned FileCount;
|
||||
} SoftlibHdr;
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// SOFTLIB Directory Entry Hdr
|
||||
//
|
||||
// This can change according to Version of SoftLib (Make sure we are
|
||||
// always downward compatable!
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
#define SL_FILENAMESIZE 16
|
||||
|
||||
typedef struct FileEntryHdr
|
||||
{
|
||||
char FileName[SL_FILENAMESIZE]; // NOTE : May not be null terminated!
|
||||
unsigned long Offset;
|
||||
unsigned long ChunkLen;
|
||||
unsigned long OrginalLength;
|
||||
short Compression; // ct_TYPES
|
||||
} FileEntryHdr;
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// SOFTLIB Entry Chunk Header
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
typedef struct ChunkHeader
|
||||
{
|
||||
unsigned long HeaderID;
|
||||
unsigned long OrginalLength;
|
||||
short Compression; // ct_TYPES
|
||||
} ChunkHeader;
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,480 @@
|
||||
/* Keen Dreams Source Code
|
||||
* Copyright (C) 2014 Javier M. Chavez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <alloc.h>
|
||||
#include <fcntl.h>
|
||||
#include <dos.h>
|
||||
#include <io.h>
|
||||
|
||||
#include "kd_def.h"
|
||||
//#include "gelib.h"
|
||||
#include "soft.h"
|
||||
#include "lzw.h"
|
||||
#include "lzhuff.h"
|
||||
#include "jam_io.h"
|
||||
|
||||
|
||||
BufferedIO lzwBIO;
|
||||
|
||||
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// SWITCHES
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
#define LZH_SUPPORT 1
|
||||
#define LZW_SUPPORT 0
|
||||
|
||||
|
||||
|
||||
|
||||
//=========================================================================
|
||||
//
|
||||
//
|
||||
// GENERAL LOAD ROUTINES
|
||||
//
|
||||
//
|
||||
//=========================================================================
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// BLoad() -- THIS HAS NOT BEEN FULLY TESTED!
|
||||
//
|
||||
// NOTICE : This version of BLOAD is compatable with JAMPak V3.0 and the
|
||||
// new fileformat...
|
||||
//--------------------------------------------------------------------------
|
||||
unsigned long BLoad(char *SourceFile, memptr *DstPtr)
|
||||
{
|
||||
int handle;
|
||||
|
||||
memptr SrcPtr;
|
||||
unsigned long i, j, k, r, c;
|
||||
word flags;
|
||||
byte Buffer[8];
|
||||
unsigned long SrcLen,DstLen;
|
||||
struct CMP1Header CompHeader;
|
||||
boolean Compressed = false;
|
||||
|
||||
|
||||
memset((void *)&CompHeader,0,sizeof(struct CMP1Header));
|
||||
|
||||
//
|
||||
// Open file to load....
|
||||
//
|
||||
|
||||
if ((handle = open(SourceFile, O_RDONLY|O_BINARY)) == -1)
|
||||
return(0);
|
||||
|
||||
//
|
||||
// Look for JAMPAK headers
|
||||
//
|
||||
|
||||
read(handle,Buffer,4);
|
||||
|
||||
if (!strncmp(Buffer,COMP,4))
|
||||
{
|
||||
//
|
||||
// Compressed under OLD file format
|
||||
//
|
||||
|
||||
Compressed = true;
|
||||
SrcLen = Verify(SourceFile);
|
||||
|
||||
read(handle,(void *)&CompHeader.OrginalLen,4);
|
||||
CompHeader.CompType = ct_LZW;
|
||||
MM_GetPtr(DstPtr,CompHeader.OrginalLen);
|
||||
if (!*DstPtr)
|
||||
return(0);
|
||||
}
|
||||
else
|
||||
if (!strncmp(Buffer,CMP1,4))
|
||||
{
|
||||
//
|
||||
// Compressed under new file format...
|
||||
//
|
||||
|
||||
Compressed = true;
|
||||
SrcLen = Verify(SourceFile);
|
||||
|
||||
read(handle,(void *)&CompHeader,sizeof(struct CMP1Header));
|
||||
MM_GetPtr(DstPtr,CompHeader.OrginalLen);
|
||||
if (!*DstPtr)
|
||||
return(0);
|
||||
}
|
||||
else
|
||||
DstLen = Verify(SourceFile);
|
||||
|
||||
|
||||
//
|
||||
// Load the file in memory...
|
||||
//
|
||||
|
||||
if (Compressed)
|
||||
{
|
||||
DstLen = CompHeader.OrginalLen;
|
||||
|
||||
if ((MM_TotalFree() < SrcLen) && (CompHeader.CompType))
|
||||
{
|
||||
if (!InitBufferedIO(handle,&lzwBIO))
|
||||
Quit("No memory for buffered I/O.");
|
||||
|
||||
switch (CompHeader.CompType)
|
||||
{
|
||||
#if LZW_SUPPORT
|
||||
case ct_LZW:
|
||||
lzwDecompress(&lzwBIO,MK_FP(*DstPtr,0),CompHeader.OrginalLen,(SRC_BFILE|DEST_MEM));
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if LZH_SUPPORT
|
||||
case ct_LZH:
|
||||
lzhDecompress(&lzwBIO,MK_FP(*DstPtr,0),CompHeader.OrginalLen,CompHeader.CompressLen,(SRC_BFILE|DEST_MEM));
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
Quit("BLoad() - Unrecognized/Supported compression");
|
||||
break;
|
||||
}
|
||||
|
||||
FreeBufferedIO(&lzwBIO);
|
||||
}
|
||||
else
|
||||
{
|
||||
CA_LoadFile(SourceFile,&SrcPtr);
|
||||
switch (CompHeader.CompType)
|
||||
{
|
||||
#if LZW_SUPPORT
|
||||
case ct_LZW:
|
||||
lzwDecompress(MK_FP(SrcPtr,8),MK_FP(*DstPtr,0),CompHeader.OrginalLen,(SRC_MEM|DEST_MEM));
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if LZH_SUPPORT
|
||||
case ct_LZH:
|
||||
lzhDecompress(MK_FP(SrcPtr,8),MK_FP(*DstPtr,0),CompHeader.OrginalLen,CompHeader.CompressLen,(SRC_MEM|DEST_MEM));
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
Quit("BLoad() - Unrecognized/Supported compression");
|
||||
break;
|
||||
}
|
||||
MM_FreePtr(&SrcPtr);
|
||||
}
|
||||
}
|
||||
else
|
||||
CA_LoadFile(SourceFile,DstPtr);
|
||||
|
||||
close(handle);
|
||||
return(DstLen);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// LoadLIBShape()
|
||||
//
|
||||
int LoadLIBShape(char *SLIB_Filename, char *Filename,struct Shape *SHP)
|
||||
{
|
||||
#define CHUNK(Name) (*ptr == *Name) && \
|
||||
(*(ptr+1) == *(Name+1)) && \
|
||||
(*(ptr+2) == *(Name+2)) && \
|
||||
(*(ptr+3) == *(Name+3))
|
||||
|
||||
|
||||
int RT_CODE;
|
||||
FILE *fp;
|
||||
char CHUNK[5];
|
||||
char far *ptr;
|
||||
memptr IFFfile = NULL;
|
||||
unsigned long FileLen, size, ChunkLen;
|
||||
int loop;
|
||||
|
||||
|
||||
RT_CODE = 1;
|
||||
|
||||
// Decompress to ram and return ptr to data and return len of data in
|
||||
// passed variable...
|
||||
|
||||
if (!LoadLIBFile(SLIB_Filename,Filename,&IFFfile))
|
||||
Quit("Error Loading Compressed lib shape!");
|
||||
|
||||
// Evaluate the file
|
||||
//
|
||||
ptr = MK_FP(IFFfile,0);
|
||||
if (!CHUNK("FORM"))
|
||||
goto EXIT_FUNC;
|
||||
ptr += 4;
|
||||
|
||||
FileLen = *(long far *)ptr;
|
||||
SwapLong((long far *)&FileLen);
|
||||
ptr += 4;
|
||||
|
||||
if (!CHUNK("ILBM"))
|
||||
goto EXIT_FUNC;
|
||||
ptr += 4;
|
||||
|
||||
FileLen += 4;
|
||||
while (FileLen)
|
||||
{
|
||||
ChunkLen = *(long far *)(ptr+4);
|
||||
SwapLong((long far *)&ChunkLen);
|
||||
ChunkLen = (ChunkLen+1) & 0xFFFFFFFE;
|
||||
|
||||
if (CHUNK("BMHD"))
|
||||
{
|
||||
ptr += 8;
|
||||
SHP->bmHdr.w = ((struct BitMapHeader far *)ptr)->w;
|
||||
SHP->bmHdr.h = ((struct BitMapHeader far *)ptr)->h;
|
||||
SHP->bmHdr.x = ((struct BitMapHeader far *)ptr)->x;
|
||||
SHP->bmHdr.y = ((struct BitMapHeader far *)ptr)->y;
|
||||
SHP->bmHdr.d = ((struct BitMapHeader far *)ptr)->d;
|
||||
SHP->bmHdr.trans = ((struct BitMapHeader far *)ptr)->trans;
|
||||
SHP->bmHdr.comp = ((struct BitMapHeader far *)ptr)->comp;
|
||||
SHP->bmHdr.pad = ((struct BitMapHeader far *)ptr)->pad;
|
||||
SwapWord(&SHP->bmHdr.w);
|
||||
SwapWord(&SHP->bmHdr.h);
|
||||
SwapWord(&SHP->bmHdr.x);
|
||||
SwapWord(&SHP->bmHdr.y);
|
||||
ptr += ChunkLen;
|
||||
}
|
||||
else
|
||||
if (CHUNK("BODY"))
|
||||
{
|
||||
ptr += 4;
|
||||
size = *((long far *)ptr);
|
||||
ptr += 4;
|
||||
SwapLong((long far *)&size);
|
||||
SHP->BPR = (SHP->bmHdr.w+7) >> 3;
|
||||
MM_GetPtr(&SHP->Data,size);
|
||||
if (!SHP->Data)
|
||||
goto EXIT_FUNC;
|
||||
movedata(FP_SEG(ptr),FP_OFF(ptr),FP_SEG(SHP->Data),0,size);
|
||||
ptr += ChunkLen;
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
ptr += ChunkLen+8;
|
||||
|
||||
FileLen -= ChunkLen+8;
|
||||
}
|
||||
|
||||
RT_CODE = 0;
|
||||
|
||||
EXIT_FUNC:;
|
||||
if (IFFfile)
|
||||
{
|
||||
// segptr = (memptr)FP_SEG(IFFfile);
|
||||
MM_FreePtr(&IFFfile);
|
||||
}
|
||||
|
||||
return (RT_CODE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// LoadLIBFile() -- Copies a file from an existing archive to dos.
|
||||
//
|
||||
// PARAMETERS :
|
||||
//
|
||||
// LibName - Name of lib file created with SoftLib V1.0
|
||||
//
|
||||
// FileName - Name of file to load from lib file.
|
||||
//
|
||||
// MemPtr - (IF !NULL) - Pointer to memory to load into ..
|
||||
// (IF NULL) - Routine allocates necessary memory and
|
||||
// returns a MEM(SEG) pointer to memory allocated.
|
||||
//
|
||||
// RETURN :
|
||||
//
|
||||
// (IF !NULL) - A pointer to the loaded data.
|
||||
// (IF NULL) - Error!
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
memptr LoadLIBFile(char *LibName,char *FileName,memptr *MemPtr)
|
||||
{
|
||||
int handle;
|
||||
unsigned long header;
|
||||
struct ChunkHeader Header;
|
||||
unsigned long ChunkLen;
|
||||
short x;
|
||||
struct FileEntryHdr FileEntry; // Storage for file once found
|
||||
struct FileEntryHdr FileEntryHeader; // Header used durring searching
|
||||
struct SoftLibHdr LibraryHeader; // Library header - Version Checking
|
||||
boolean FileFound = false;
|
||||
unsigned long id_slib = ID_SLIB;
|
||||
unsigned long id_chunk = ID_CHUNK;
|
||||
|
||||
|
||||
//
|
||||
// OPEN SOFTLIB FILE
|
||||
//
|
||||
|
||||
if ((handle = open(LibName,O_RDONLY|O_BINARY, S_IREAD)) == -1)
|
||||
return(NULL);
|
||||
|
||||
|
||||
//
|
||||
// VERIFY it is a SOFTLIB (SLIB) file
|
||||
//
|
||||
|
||||
if (read(handle,&header,4) == -1)
|
||||
{
|
||||
close(handle);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
if (header != id_slib)
|
||||
{
|
||||
close(handle);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CHECK LIBRARY HEADER VERSION NUMBER
|
||||
//
|
||||
|
||||
if (read(handle, &LibraryHeader,sizeof(struct SoftLibHdr)) == -1)
|
||||
Quit("read error in LoadSLIBFile()\n");
|
||||
|
||||
if (LibraryHeader.Version > SOFTLIB_VER)
|
||||
Quit("Unsupported file ver ");
|
||||
|
||||
|
||||
//
|
||||
// MANAGE FILE ENTRY HEADERS...
|
||||
//
|
||||
|
||||
for (x = 1;x<=LibraryHeader.FileCount;x++)
|
||||
{
|
||||
if (read(handle, &FileEntryHeader,sizeof(struct FileEntryHdr)) == -1)
|
||||
{
|
||||
close(handle);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
if (!stricmp(FileEntryHeader.FileName,FileName))
|
||||
{
|
||||
FileEntry = FileEntryHeader;
|
||||
FileFound = true;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// IF FILE HAS BEEN FOUND THEN SEEK TO POSITION AND EXTRACT
|
||||
// ELSE RETURN WITH ERROR CODE...
|
||||
//
|
||||
|
||||
if (FileFound)
|
||||
{
|
||||
if (lseek(handle,FileEntry.Offset,SEEK_CUR) == -1)
|
||||
{
|
||||
close(handle);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
//
|
||||
// READ CHUNK HEADER - Verify we are at the beginning of a chunk..
|
||||
//
|
||||
|
||||
if (read(handle,(char *)&Header,sizeof(struct ChunkHeader)) == -1)
|
||||
Quit("LIB File - Unable to read Header!");
|
||||
|
||||
if (Header.HeaderID != id_chunk)
|
||||
Quit("LIB File - BAD HeaderID!");
|
||||
|
||||
//
|
||||
// Allocate memory if Necessary...
|
||||
//
|
||||
|
||||
|
||||
if (!*MemPtr)
|
||||
MM_GetPtr(MemPtr,FileEntry.OrginalLength);
|
||||
|
||||
//
|
||||
// Calculate the length of the data (without the chunk header).
|
||||
//
|
||||
|
||||
ChunkLen = FileEntry.ChunkLen - sizeof(struct ChunkHeader);
|
||||
|
||||
|
||||
//
|
||||
// Extract Data from file
|
||||
//
|
||||
|
||||
switch (Header.Compression)
|
||||
{
|
||||
|
||||
#if LZW_SUPPORT
|
||||
case ct_LZW:
|
||||
if (!InitBufferedIO(handle,&lzwBIO))
|
||||
Quit("No memory for buffered I/O.");
|
||||
lzwDecompress(&lzwBIO,MK_FP(*MemPtr,0),FileEntry.OrginalLength,(SRC_BFILE|DEST_MEM));
|
||||
FreeBufferedIO(&lzwBIO);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if LZH_SUPPORT
|
||||
case ct_LZH:
|
||||
if (!InitBufferedIO(handle,&lzwBIO))
|
||||
Quit("No memory for buffered I/O.");
|
||||
lzhDecompress(&lzwBIO, MK_FP(*MemPtr,0), FileEntry.OrginalLength, ChunkLen, (SRC_BFILE|DEST_MEM));
|
||||
FreeBufferedIO(&lzwBIO);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ct_NONE:
|
||||
if (!CA_FarRead(handle,MK_FP(*MemPtr,0),ChunkLen))
|
||||
{
|
||||
// close(handle);
|
||||
*MemPtr = NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
close(handle);
|
||||
Quit("Unknown Chunk.Compression Type!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
*MemPtr = NULL;
|
||||
|
||||
close(handle);
|
||||
return(*MemPtr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/* Keen Dreams Source Code
|
||||
* Copyright (C) 2014 Javier M. Chavez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
//memptr InitBufferedIO(int handle, BufferedIO *bio);
|
||||
//void FreeBufferedIO(BufferedIO *bio);
|
||||
//byte bio_readch(BufferedIO *bio);
|
||||
|
||||
unsigned long BLoad(char *SourceFile, memptr *DstPtr);
|
||||
memptr LoadLIBFile(char *LibName,char *FileName,memptr *MemPtr);
|
||||
int LoadLIBShape(char *SLIB_Filename, char *Filename,struct Shape *SHP);
|
||||
+37
-84
@@ -1,102 +1,55 @@
|
||||
HELP: CONTROLS
|
||||
* * * * * * *
|
||||
GAME CONTROLS
|
||||
* * * * * * *
|
||||
|
||||
This section will tell you what controls you can use to help Commander Keen move around and do things.
|
||||
Here's a quick summary chart of the controls you can use. You can change some of the keyboard controls by pressing [F3] during play or while in the Control Panel.
|
||||
|
||||
Here's a quick summary chart of the default controls you can use.
|
||||
MOVE KEEN AROUND:
|
||||
Use the arrow keys (including those on the numeric keypad).
|
||||
|
||||
MOVE. Use joystick, or the arrow keys and numbers.
|
||||
JUMP/ENTER. To make Keen jump, or to enter a city, press button 1 on your joystick or Ctrl on the keyboard.
|
||||
THROW. To throw a Flower Power or Boobus Bomb, press button 2 or Alt.
|
||||
CLIMB POLE. To shinny up or slide down a pole, stand in front of the pole and move the joystick in that direction. On the keyboard, use the up or down arrow.
|
||||
JUMP DOWN. If you are on a log or beam, you can jump down from it by moving your joystick down and pressing button 1. On the keyboard, down arrow plus Ctrl does the trick.
|
||||
DUCK. If you aren't in front of a pole, pressing down will make Keen duck. You can't duck in front of a pole‹you'll climb down it!
|
||||
STATUS WINDOW. Press the spacebar to see how many Keens you have, how many points you need for your next Keen, how many Boobus Bombs you have, and how many keys you have.
|
||||
ENTER A NEW AREA:
|
||||
Press the [CTRL] key when Keen is on top of a new area in the big map.
|
||||
|
||||
MORE HELP
|
||||
JUMP UP:
|
||||
To make Keen jump, press the [CTRL] key.
|
||||
|
||||
Once you've selected a New Game, you will be placed in the Land of Tuberia, right next to the hill you woke up on. To your left is Horseradish Hill, the first place you can explore in the game. You can move Commander Keen around using the arrow keys, the numeric keypad, or whatever movement keys you define in the Controls section of the Control Panel (you're in the Control Panel right now, in the Help Section).
|
||||
CLIMB A POLE:
|
||||
To shinny up or slide down a pole, stand in front of the pole or jump up to it and use the up or down arrow keys to climb.
|
||||
|
||||
If you get to an area that has vegetable or fruit pictures and you see a waving flag with a "T" on it, that means you can enter this city or area by walking onto it and pressing Ctrl or button 1. You will have to finish some places before you can get past them. Horseradish Hill is one of these places.
|
||||
THROW:
|
||||
To throw a Flower Power or Boobus Bomb, press the [ALT] key.
|
||||
|
||||
Once you enter an area, you must find your way to the exit. However, you need to explore all over, because your mission is to defeat Boobus Tuber, and the only thing that can affect him is a Boobus Bomb. A Boobus Bomb is a round black bomb with a big smiley face on it.
|
||||
JUMP DOWN:
|
||||
If you are on a log, beam or other platform, you can jump down from it by pressing the down-arrow plus [CTRL] keys.
|
||||
|
||||
You will need at least twelve Boobus Bombs to defeat Boobus Tuber. There are more than twelve hidden in the Land of Tuberia, and some are harder to get than others.
|
||||
DUCK:
|
||||
If you aren't on a pole, pressing down will make Keen duck. You can't duck in front of a pole---you'll climb down it!
|
||||
|
||||
To help you on your way, you can get Flower Powers, which turn monsters into flowers for a little while. A Flower Power is a little silver ball that blinks red and yellow. You can also get a Super Flower Power, which looks like a flowerpot. This will give you five Flower Powers.
|
||||
* * * * * * * * *
|
||||
FUNCTION CONTROLS
|
||||
* * * * * * * * *
|
||||
|
||||
There are many other things you can get. For points, you can the following:
|
||||
F1
|
||||
Get Help
|
||||
|
||||
Peppermint (100 points)
|
||||
Cookie (200 points)
|
||||
Candy Cane (500 points)
|
||||
Candy Bar (1000 points)
|
||||
Lollipop (2000 points)
|
||||
Cotton Candy (5000 points)
|
||||
F2
|
||||
Turn Sound on/off
|
||||
|
||||
You get an extra Keen at 20000 points. You'll have to get twice as many points for each additional Keen (40000, 80000, 160000, etc.).
|
||||
F3
|
||||
Configure keyboard controls
|
||||
|
||||
There are Extra Keens on levels, too. They look like a little waving Keen.
|
||||
F4
|
||||
Restart game
|
||||
|
||||
There are other, even better powerups on the levels, so keep an eye out for them.
|
||||
F5
|
||||
New game
|
||||
|
||||
CAST OF CHARACTERS
|
||||
F6
|
||||
Save or Load game
|
||||
|
||||
ESC
|
||||
Exit current mode
|
||||
|
||||
|
||||
If you get touched by one of the bad vegetables, or if you plummet or land on a harmful thing, you will fall back asleep. You only have a certain number of chances to succeed in your quest, so make 'em count!
|
||||
|
||||
CARROT COURIERS
|
||||
These guys have tennis shoes and they are in a HURRY! They won't hurt you but they can push you off whatever you're standing on.
|
||||
|
||||
TATER TROOPER
|
||||
They are dumb, but they can be dangerous!
|
||||
|
||||
|
||||
BROCCOLASH
|
||||
Watch out or the broccolashes will do their "Broccolash Smash" on you.
|
||||
|
||||
TOMATOOTH
|
||||
Probably the scariest of the vegetables, with their scary teeth.
|
||||
|
||||
ASPARAGUSTO
|
||||
They run fast and they're hard to hit with Flower Powers.
|
||||
|
||||
SOUR GRAPE
|
||||
They'll fall on top of you, unless you can trick them.
|
||||
|
||||
CANTELOUPE CART
|
||||
These can take you over dangerous areas, but don't let them smash you into walls!
|
||||
|
||||
FRENCHY
|
||||
These scary potatoes from France will throw fearsome french fries at you.
|
||||
|
||||
SQUASHER
|
||||
They look friendly until you get close‹then they try to squash you!
|
||||
|
||||
MELON LIPS
|
||||
They spit watermelon seeds at you.
|
||||
|
||||
APELS
|
||||
They can climb poles just like you do!
|
||||
|
||||
PEA PODS
|
||||
They run around and spit out Pea Brains.
|
||||
|
||||
PEA BRAINS
|
||||
Don't let these little fellows touch you!
|
||||
|
||||
KING BOOBUS TUBER
|
||||
Sitting in his Castle atop Mount Tuberest, Boobus Tuber brings kids to Tuberia to be his slaves. Defeat him with Boobus Bombs. Then you can turn off his Dream Machine and rescue all the kids!
|
||||
|
||||
|
||||
GAME HINTS
|
||||
|
||||
Get candy for points, which will get you extra lives.
|
||||
|
||||
Search everywhere‹there's a LOT of hidden stuff!
|
||||
|
||||
Don't assume anything.
|
||||
|
||||
CONCLUSION
|
||||
|
||||
So, good luck now, Commander Keen! Turn off that stupid Dream Machine!
|
||||
~
|
||||
|
||||
|
||||
+6
-69
@@ -1,74 +1,11 @@
|
||||
HELP: CONTROL PANEL
|
||||
You are in the Help Section of the Control Panel of KEEN DREAMS.
|
||||
|
||||
You are now in the Control Panel. The Control Panel is here to help you use Commander Keen the way you want to‹but first, you need to know how to look at this Help article.
|
||||
You can get full details of how to operate this game by reading or printing the INSTRUCTIONS section of the main options menu you found when you typed START to begin play.
|
||||
|
||||
To read more of this text, you will have to press the down arrow key. If you scroll the text too far, you can press the up arrow key to scroll back up. The Page Up and Page Dn keys work as well. Also, if you have a mouse or joystick connected, they can be used to scroll the text. When you are done reading the text, press Esc. All three Help topics work this way. You can get more help on the controls of the game, and you can read the story of "Keen Dreams."
|
||||
A summary of the game controls can be found in the other 2 Help Sections here in the Control Panel.
|
||||
|
||||
* * * * * * * * * * *
|
||||
Press ESC now to exit this section, then select the other Help Sections for more help.
|
||||
* * * * * * * * * * *
|
||||
|
||||
CONTROL PANEL SECTIONS
|
||||
|
||||
There are six sections to choose in the Control Panel. They are: Game, Help, Disk, Controls, Sound Effects, and Music. You can choose these sections by selecting the buttons on the left side of the screen. With the keyboard, use the arrows to move the ship cursor to the button you want, then press ENTER. The joystick or mouse can also move the ship cursor, and pushing the button will select the item the ship is on.
|
||||
|
||||
GAME SECTION
|
||||
You can choose to start a new game in easy, normal, or hard modes. These determine how long your Flower Powers last.
|
||||
|
||||
If you are in the middle of a game and haven't saved it, starting a new game will wipe out that old game forever.
|
||||
|
||||
You can also choose to resume a game if you went to the Control Panel in the middle of play.
|
||||
|
||||
HELP SECTION
|
||||
This is where you are now. This topic is "Help me, I'm lost!" The others are about the game controls, and the story of "Keen Dreams."
|
||||
|
||||
DISK SECTION
|
||||
You can save your current game or load a previously saved game here. You can name your saved game so you'll remember where you saved it. Loading a game will replace your current game (make sure you saved it). Saving over an old game will replace that game forever.
|
||||
|
||||
You can also "Exit to DOS," which will quit the game.
|
||||
|
||||
CONTROLS SECTION
|
||||
You can control the game by keyboard or joystick. If you choose keyboard, you can redefine which keys you wish to use to control Keen. In the Control Panel, you will always use the arrow keys and ENTER.
|
||||
|
||||
SOUND EFFECTS SECTION
|
||||
If you have an AdLib, Sound Blaster, or Sound Source, you can choose to have the sound effects play on them. ("Keen Dreams" was too full of neat stuff and cool graphics to include digitized sound effects for the Sound Source and Sound Blaster, however.) If you don't have any of these boards, you'll have to choose "No Sound Effects" or "PC Speaker."
|
||||
|
||||
MUSIC SECTION
|
||||
Future games using this interface will include music. If you have an AdLib or SoundBlaster, you can choose to have background music playing. Otherwise, no music. We tried to make everything fit for Keen Dreams, but we had to opt for more levels and less frills, like music. (We tried, believe me!)
|
||||
|
||||
HOT KEYS: CONTROL PANEL SHORTCUTS
|
||||
|
||||
Some of the function keys provide quick shortcuts to parts of the control panel. Here's a quick list of them.
|
||||
|
||||
F1: Help
|
||||
F2: Sounds
|
||||
F3: Keyboard
|
||||
F4: Joystick
|
||||
F5: Restart Game
|
||||
F6: Load/Save Game
|
||||
F7: Music
|
||||
Esc: Quit (or return to game, from Control Panel)
|
||||
|
||||
|
||||
NOTE TO SUPER VGA OWNERS
|
||||
|
||||
If you own a Speedstar VGA card or other non-100% compatible SVGA card, you'll need to type "KDREAMS /COMP" on the command line, instead of just "KDREAMS." This should fix all your problems.
|
||||
|
||||
|
||||
OTHER NEAT-O COMMAND LINE PARAMETERS
|
||||
|
||||
When some documentation tells you to type more that just the name of the program you want to run (like we did above), those extra bits are called "command line parameters." This is a fancy term for extra information you can give the program when you run it. Normally, you will never have to type these. If the program is having trouble with your hardware, try the appropriate parameter. Here are some command line parameters that work with Commander Keen:
|
||||
|
||||
KDREAMS /NODR (Type this if the program hangs a lot with the drive still on.)
|
||||
KDREAMS /NOAL (No AdLib or Sound Blaster detection.)
|
||||
KDREAMS /NOSB (No Sound Blaster detection.)
|
||||
KDREAMS /NOSS (No Sound Source detection.)
|
||||
KDREAMS /SST (Put Sound Source in Tandy mode for Tandy computers with the special Sound Source adapter.)
|
||||
KDREAMS /SS1 (Set Sound Source to LPT1. /SS2 will set it to LPT2, and /SS3, LPT3.)
|
||||
|
||||
KDREAMS /NOJOYS (Tell program to ignore joystick.)
|
||||
KDREAMS /NOMOUSE (Tell program to ignore mouse.)
|
||||
|
||||
KDREAMS /HIDDENCARD (Overrides video card detection if the program seems to be detecting your video card incorrectly and not letting you play.)
|
||||
|
||||
CONCLUSION
|
||||
|
||||
Now go explore the Control Panel, and have fun playing Keen Dreams!
|
||||
~
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+7
-3
@@ -1,11 +1,12 @@
|
||||
HELP: THE STORY SO FAR
|
||||
THE STORY SO FAR
|
||||
|
||||
Billy Blaze, eight year-old genius, working diligently in his backyard clubhouse has created an interstellar starship from old soup cans, rubber cement, and plastic tubing. While his folks are out on the town and the babysitter has fallen asleep, Billy travels into his backyard workshop, dons his brother's football helmet, and transforms into...
|
||||
|
||||
COMMANDER KEEN‹defender of Earth!
|
||||
COMMANDER KEEN --- defender of Earth!
|
||||
|
||||
In his ship, the Bean-with-Bacon Megarocket, Keen dispenses galactic justice with an iron hand!
|
||||
|
||||
|
||||
THIS EPISODE: "Keen Dreams"
|
||||
|
||||
We find young Billy discussing matters of paramount importance with his mother.
|
||||
@@ -59,5 +60,8 @@ Just then, a child in chains ran up to him.
|
||||
|
||||
"Whatever. Save us!" said the child.
|
||||
|
||||
So Billy hopped out of bed and started on his quest to defeat King Boobus Tuber and destroy the Dream Machine.
|
||||
So Billy hopped out of bed and started on his quest to defeat King Boobus Tuber and destroy the Dream Machine!
|
||||
|
||||
|
||||
*** END OF THIS HELP SECTION ***
|
||||
~
|
||||
|
||||
Reference in New Issue
Block a user