update acklib to build under watcom

borland conditionals have been removed. asm sources converted fully
to tasm ideal mode. keyboard and timer interrupt handlers moved to c
code copied from fdemo watcom sources
This commit is contained in:
Gered 2019-11-02 13:51:40 -04:00
parent 7933231c9d
commit 83aaf0d5b9
30 changed files with 921 additions and 1964 deletions

View file

@ -5,11 +5,17 @@
// and the ACK-3D library. The four main data structures set up in this header file // and the ACK-3D library. The four main data structures set up in this header file
// include: ACKENG, DOORS, NEWOBJECT, and OBJSEQ. // include: ACKENG, DOORS, NEWOBJECT, and OBJSEQ.
#ifndef ACK3D_H_INCLUDED
#define ACK3D_H_INCLUDED
#include <stddef.h>
// USED TO RID OURSELVES OF THE MANY CASTING PROBLEMS // USED TO RID OURSELVES OF THE MANY CASTING PROBLEMS
#define CAST(t,f) (t)(f) #define CAST(t,f) (t)(f)
// Internal definitions used to simplify field declarations. // Internal definitions used to simplify field declarations.
typedef unsigned long ULONG; typedef unsigned long ULONG;
typedef unsigned int UINT;
typedef unsigned short USHORT; typedef unsigned short USHORT;
typedef unsigned char UCHAR; typedef unsigned char UCHAR;
@ -427,9 +433,10 @@ void AckSetPalette(UCHAR *PalBuffer);
void AckSetVGAmode(void); void AckSetVGAmode(void);
// Places video in 80x25 color text mode 3. // Places video in 80x25 color text mode 3.
void AckSetTextmode(void); void AckSetTextMode(void);
// Displays the contents of ScreenBuffer and OverlayBuffer if desired. // Displays the contents of ScreenBuffer and OverlayBuffer if desired.
short AckDisplayScreen(void); short AckDisplayScreen(void);
#endif

View file

@ -1,17 +1,3 @@
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>
#include <mem.h>
#include <io.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <sys\stat.h>
//typedef unsigned short USHORT;
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"

View file

@ -1,11 +1,10 @@
#include <windows.h>
#include <stdio.h> #include <stdio.h>
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"
long scPtr; long scPtr;
UCHAR *bmWall; UCHAR *bmWall = NULL;
long bmDistance; long bmDistance;
long BackDropRows; long BackDropRows;
@ -16,13 +15,13 @@ long yPglobal;
long xBegGlobal; long xBegGlobal;
long yBegGlobal; long yBegGlobal;
ACKENG *aeGlobal; ACKENG *aeGlobal = NULL;
USHORT *xGridGlobal; USHORT *xGridGlobal = NULL;
USHORT *yGridGlobal; USHORT *yGridGlobal = NULL;
long xPglobalHI; long xPglobalHI;
long yPglobalHI; long yPglobalHI;
ULONG *rbaTable; ULONG *rbaTable = NULL;
short rsHandle; int rsHandle;
long LastX1; long LastX1;
long LastY1; long LastY1;
@ -45,15 +44,15 @@ short ErrorCode;
long xMapPosn; long xMapPosn;
long yMapPosn; long yMapPosn;
USHORT *Grid; USHORT *Grid = NULL;
USHORT *ObjGrid; USHORT *ObjGrid = NULL;
SLICE Slice[VIEW_WIDTH]; SLICE Slice[VIEW_WIDTH];
SLICE *sPtr; SLICE *sPtr = NULL;
short TotalSpecial; short TotalSpecial;
short DistanceTable[MAX_DISTANCE + 1]; short DistanceTable[MAX_DISTANCE + 1];
long *AdjustTable; long *AdjustTable = NULL;
short xSecretmPos; short xSecretmPos;
short xSecretmPos1; short xSecretmPos1;
@ -66,18 +65,18 @@ short ySecretColumn;
short TotalSecret; short TotalSecret;
short ViewColumn; short ViewColumn;
long *SinTable; long *SinTable = NULL;
long *CosTable; long *CosTable = NULL;
long *LongTanTable; long *LongTanTable = NULL;
long *LongInvTanTable; long *LongInvTanTable = NULL;
long InvCosTable[INT_ANGLE_360]; long InvCosTable[INT_ANGLE_360];
long InvSinTable[INT_ANGLE_360]; long InvSinTable[INT_ANGLE_360];
long *LongCosTable; long *LongCosTable = NULL;
long *ViewCosTable; long *ViewCosTable = NULL;
long *xNextTable; long *xNextTable = NULL;
long *yNextTable; long *yNextTable = NULL;
short LastFloorAngle = -1; short LastFloorAngle = -1;
short LastFloorX; short LastFloorX;
@ -113,12 +112,12 @@ long Floorku;
long Floorkv; long Floorkv;
long Floorkdu; long Floorkdu;
long Floorkdv; long Floorkdv;
UCHAR *Floorbm; UCHAR *Floorbm = NULL;
UCHAR *Floorscr; UCHAR *Floorscr = NULL;
UCHAR *FloorscrTop; UCHAR *FloorscrTop = NULL;
UCHAR *Floorptr2; UCHAR *Floorptr2 = NULL;
UCHAR *Floors1; UCHAR *Floors1 = NULL;
UCHAR *Floors2; UCHAR *Floors2 = NULL;
long Floorht; long Floorht;
long Floorwt; long Floorwt;
short Floorvht; short Floorvht;
@ -132,18 +131,21 @@ short LastWallHeight;
short PlayerAngle; short PlayerAngle;
short ViewAngle; short ViewAngle;
USHORT SysFlags; USHORT SysFlags;
UCHAR **WallbMaps; UCHAR **WallbMaps = NULL;
UCHAR *VidTop; UCHAR *VidTop = NULL;
UCHAR *VidBottom; UCHAR *VidBottom = NULL;
short BotRowTable[320]; short BotRowTable[320];
USHORT FloorMap[4096]; USHORT FloorMap[4096];
USHORT CeilMap[4096]; USHORT CeilMap[4096];
UCHAR HitMap[4096]; UCHAR HitMap[4096];
UCHAR *VidSeg; UINT *VidSeg = 0xA0000;
char *scantables[96]; char *scantables[96];
UCHAR AckKeys[128]; // Buffer for keystrokes volatile UCHAR AckKeys[128]; // Buffer for keystrokes
long AckTimerCounter; volatile long AckTimerCounter;
volatile short AckTmCount=0;
volatile short AckTmDelay=0;
volatile UCHAR KeyPressed;
// **** End of Data **** // **** End of Data ****

View file

@ -1,33 +0,0 @@
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>
#include <mem.h>
#include <io.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <sys\stat.h>
//typedef unsigned short USHORT;
#include "ack3d.h"
#include "ackeng.h"
#include "ackext.h"
void AckDrawPage (void);
//±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
// This function has been replaced by AckDisplayScreen in assembler
//±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
short xxxAckDisplayScreen (void)
{
/* Let the assembly routine do the hard work */
AckDrawPage ();
return (0);
}

View file

@ -1,16 +1,5 @@
// This source file contains the functions needed to process doors. // This source file contains the functions needed to process doors.
// (c) 1995 ACK Software (Lary Myers) // (c) 1995 ACK Software (Lary Myers)
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>
#include <mem.h>
#include <io.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <sys\stat.h>
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"
#include "ackext.h" #include "ackext.h"

View file

@ -5,6 +5,9 @@
// the functions in the ACK-3D library. To locate data structures for the // the functions in the ACK-3D library. To locate data structures for the
// ACK-3D interface, see the file ACK3D.H. // ACK-3D interface, see the file ACK3D.H.
#ifndef ACKENG_H_INCLUDED
#define ACKENG_H_INCLUDED
#define TRANS_WALLS 0 #define TRANS_WALLS 0
#define FLOOR_ACTIVE 1 #define FLOOR_ACTIVE 1
#define USE_XMS 0 // Set to 0 if XMS not desired #define USE_XMS 0 // Set to 0 if XMS not desired
@ -62,4 +65,5 @@ typedef struct _slicer {
struct _slicer *Next; // References the wall slice behind the current slice struct _slicer *Next; // References the wall slice behind the current slice
} SLICE; } SLICE;
#endif

View file

@ -1,5 +1,8 @@
/* ACK-3D ( Animation Construction Kit 3D ) */ /* ACK-3D ( Animation Construction Kit 3D ) */
#ifndef ACKEXT_H_INCLUDED
#define ACKEXT_H_INCLUDED
extern UCHAR *BackArray[]; extern UCHAR *BackArray[];
extern long xPglobal; extern long xPglobal;
extern long yPglobal; extern long yPglobal;
@ -16,7 +19,7 @@ extern ULONG *rbaTable;
extern long bmDistance; extern long bmDistance;
extern short rsHandle; extern int rsHandle;
extern long LastX1; extern long LastX1;
extern long LastY1; extern long LastY1;
extern long iLastX; extern long iLastX;
@ -115,4 +118,11 @@ extern USHORT FloorMap[];
extern USHORT CeilMap[]; extern USHORT CeilMap[];
extern char *scantables[]; extern char *scantables[];
extern volatile UCHAR AckKeys[];
extern volatile UCHAR KeyPressed;
extern volatile long AckTimerCounter;
extern volatile short AckTmCount;
extern volatile short AckTmDelay;
#endif

View file

@ -1,24 +1,13 @@
// This source file contains the functions needed to process floors. // This source file contains the functions needed to process floors.
// (c) 1995 ACK Software (Lary Myers) // (c) 1995 ACK Software (Lary Myers)
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#include <mem.h>
#include <io.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <sys\stat.h>
#include <limits.h>
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"
#include "ackext.h" #include "ackext.h"
#define MAX_F_VIEWHALFHEIGHT 50 #define MAX_F_VIEWHALFHEIGHT 50
void DrawBackDrop(void);
extern long FloorCosTable[]; extern long FloorCosTable[];
extern short gWinStartX; extern short gWinStartX;
extern short gWinStartY; extern short gWinStartY;

View file

@ -1,13 +1,6 @@
// This source file contains the functions needed to read in GIF files. // This source file contains the functions needed to read in GIF files.
// (c) 1995 ACK Software (Lary Myers) // (c) 1995 ACK Software (Lary Myers)
#include <windows.h>
#include <stdio.h> #include <stdio.h>
#include <conio.h>
#include <process.h>
#include <bios.h>
#include <fcntl.h>
#include <malloc.h>
#include <string.h>
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"

View file

@ -9,14 +9,12 @@
// (the "old" type) are not supported. use the "new" deluxe paint .lbm type // (the "old" type) are not supported. use the "new" deluxe paint .lbm type
// and do not choose "old". // and do not choose "old".
//============================================================================= //=============================================================================
#include <windows.h>
#include <stdio.h> #include <stdio.h>
#include <conio.h> #include <string.h>
#include <process.h> #include <io.h>
#include <bios.h>
#include <fcntl.h> #include <fcntl.h>
#include <malloc.h> #include <sys/types.h>
#include <mem.h> #include <sys/stat.h>
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"
@ -48,7 +46,7 @@ void CloseFile(FILE *fp)
fclose(fp); fclose(fp);
if (rsHandle) if (rsHandle)
{ {
rsHandle = _lopen(rsName,OF_READ); rsHandle = open(rsName,O_RDONLY|O_BINARY);
if (rsHandle < 1) if (rsHandle < 1)
rsHandle = 0; rsHandle = 0;
} }
@ -57,8 +55,7 @@ if (rsHandle)
unsigned char *AckReadiff(char *picname) unsigned char *AckReadiff(char *picname)
{ {
FILE *pic; int handle;
short handle;
form_chunk fchunk; form_chunk fchunk;
ChunkHeader chunk; ChunkHeader chunk;
BitMapHeader bmhd; BitMapHeader bmhd;
@ -73,19 +70,19 @@ unsigned char *AckReadiff(char *picname)
rdSize = MAX_BUF_POS; rdSize = MAX_BUF_POS;
if (!rsHandle) if (!rsHandle)
handle = _lopen(picname,OF_READ); handle = open(picname,O_RDONLY|O_BINARY);
else else
{ {
handle = rsHandle; handle = rsHandle;
_llseek(rsHandle,rbaTable[(ULONG)picname],SEEK_SET); lseek(rsHandle,rbaTable[(ULONG)picname],SEEK_SET);
} }
_lread(handle,&fchunk,sizeof(form_chunk)); read(handle,&fchunk,sizeof(form_chunk));
if (fchunk.type != FORM) if (fchunk.type != FORM)
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
ErrorCode = ERR_INVALIDFORM; ErrorCode = ERR_INVALIDFORM;
return(0L); return(0L);
@ -94,26 +91,26 @@ unsigned char *AckReadiff(char *picname)
if (fchunk.subtype != ID_PBM) if (fchunk.subtype != ID_PBM)
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
ErrorCode = ERR_NOPBM; ErrorCode = ERR_NOPBM;
return(0L); return(0L);
} }
// now lets loop...Because the Chunks can be in any order! // now lets loop...Because the Chunks can be in any order!
while(1) while(1)
{ {
_lread(handle,&chunk,sizeof(ChunkHeader)); read(handle,&chunk,sizeof(ChunkHeader));
chunk.ckSize = ByteFlipLong(chunk.ckSize); chunk.ckSize = ByteFlipLong(chunk.ckSize);
if (chunk.ckSize & 1) chunk.ckSize ++; // must be word aligned if (chunk.ckSize & 1) chunk.ckSize ++; // must be word aligned
if(chunk.ckID == ID_BMHD) if(chunk.ckID == ID_BMHD)
{ {
_lread(handle,&bmhd,sizeof(BitMapHeader)); read(handle,&bmhd,sizeof(BitMapHeader));
bmhd.w=iffswab(bmhd.w); // the only things we need. bmhd.w=iffswab(bmhd.w); // the only things we need.
bmhd.h=iffswab(bmhd.h); bmhd.h=iffswab(bmhd.h);
destx = (unsigned char *)AckMalloc((bmhd.w * bmhd.h)+4); destx = (unsigned char *)AckMalloc((bmhd.w * bmhd.h)+4);
if ( !destx ) if ( !destx )
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
ErrorCode = ERR_NOMEMORY; ErrorCode = ERR_NOMEMORY;
return(0L); return(0L);
} }
@ -132,7 +129,7 @@ unsigned char *AckReadiff(char *picname)
short i; short i;
unsigned char r,g; unsigned char r,g;
_lread(handle,colordat,chunk.ckSize); read(handle,colordat,chunk.ckSize);
for (i=0;i<768;i++) for (i=0;i<768;i++)
{ {
r = colordat[i]; // r,g do not stand for red and green r = colordat[i]; // r,g do not stand for red and green
@ -154,16 +151,16 @@ unsigned char *AckReadiff(char *picname)
if (bmhd.compression) if (bmhd.compression)
{ {
value = 0; value = 0;
_lread(handle,&value,1); read(handle,&value,1);
if (value > 0) if (value > 0)
{ {
short len; short len;
len = value +1; len = value +1;
sofar -= len; sofar -= len;
if (!(_lread(handle,dest,len))) if (!(read(handle,dest,len)))
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
ErrorCode = ERR_BADPICFILE; ErrorCode = ERR_BADPICFILE;
AckFree(savedestx); AckFree(savedestx);
return(0L); return(0L);
@ -177,32 +174,32 @@ unsigned char *AckReadiff(char *picname)
count ++; count ++;
sofar -= count; sofar -= count;
value = 0; value = 0;
_lread(handle,&value,1); read(handle,&value,1);
while (--count >= 0) *dest++ = value; while (--count >= 0) *dest++ = value;
} }
} }
else else
{ {
_lread(handle,dest,sofar); read(handle,dest,sofar);
sofar = 0; sofar = 0;
} }
} }
if (sofar < 0) if (sofar < 0)
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
} }
_fmemcpy(destx,pplanes,bmhd.w); memcpy(destx,pplanes,bmhd.w);
destx += bmhd.w; destx += bmhd.w;
} }
break; // leave if we've unpacked the BODY break; // leave if we've unpacked the BODY
} }
_llseek(handle,chunk.ckSize,SEEK_CUR); lseek(handle,chunk.ckSize,SEEK_CUR);
} }
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
return((char *)savedestx); return((char *)savedestx);
} }

View file

@ -2,16 +2,12 @@
// The main function AckInitialize() must be called first before any of the // The main function AckInitialize() must be called first before any of the
// other ACK-3D functions are called. The internal functions defined in this file // other ACK-3D functions are called. The internal functions defined in this file
// perform all of the set up work of loading tables and resource files. // perform all of the set up work of loading tables and resource files.
#include <windows.h>
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <dos.h> #include <string.h>
#include <mem.h>
#include <io.h> #include <io.h>
#include <fcntl.h> #include <fcntl.h>
#include <time.h> #include <sys/stat.h>
#include <string.h> #include <sys/types.h>
#include <sys\stat.h>
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"
@ -23,7 +19,6 @@ extern char AckTimerSetup;
short *LowerTable[2048]; short *LowerTable[2048];
short tmpLowerValue[400]; short tmpLowerValue[400];
short LowerLen[2048]; short LowerLen[2048];
short OurDataSeg;
char rsName[128]; char rsName[128];
@ -65,10 +60,6 @@ short AckInitialize(ACKENG *ae)
short j; short j;
UCHAR topcolor; UCHAR topcolor;
#ifdef __BORLANDC__ // Conditional for Borland C++
OurDataSeg = _DS;
#endif
AckKeyboardSetup = 0; // Indicates keyboard interrupt has not been set up AckKeyboardSetup = 0; // Indicates keyboard interrupt has not been set up
AckTimerSetup = 0; // Indicates timer has not been set up AckTimerSetup = 0; // Indicates timer has not been set up
@ -109,9 +100,9 @@ short AckOpenResource(char *fName)
ULONG hLen; ULONG hLen;
if (rsHandle) // Is a resource file currently opened? if (rsHandle) // Is a resource file currently opened?
_lclose(rsHandle); // Close it before opening a new one close(rsHandle); // Close it before opening a new one
rsHandle = _lopen(fName,OF_READ); // Open new resource file rsHandle = open(fName,O_RDONLY|O_BINARY); // Open new resource file
if (rsHandle < 1) // Check to see if file is opened properly if (rsHandle < 1) // Check to see if file is opened properly
{ {
rsHandle = 0; // Reset file handle rsHandle = 0; // Reset file handle
@ -123,15 +114,15 @@ if (rbaTable == NULL)
rbaTable = (ULONG *)AckMalloc(hLen); // Allocate buffer for file rbaTable = (ULONG *)AckMalloc(hLen); // Allocate buffer for file
if (rbaTable == NULL) // Was memory available? if (rbaTable == NULL) // Was memory available?
{ {
_lclose(rsHandle); // Close file close(rsHandle); // Close file
rsHandle = 0; // Reset file handle rsHandle = 0; // Reset file handle
return(ERR_NOMEMORY); // Return error code return(ERR_NOMEMORY); // Return error code
} }
// Read in the file and check for byte count error // Read in the file and check for byte count error
if (_lread(rsHandle,(ULONG *)rbaTable,hLen) != hLen) if (read(rsHandle,(ULONG *)rbaTable,hLen) != hLen)
{ {
_lclose(rsHandle); // Close file close(rsHandle); // Close file
rsHandle = 0; // Reset file handle rsHandle = 0; // Reset file handle
AckFree(rbaTable); // Free up buffer AckFree(rbaTable); // Free up buffer
return(ERR_BADFILE); // Return file error code return(ERR_BADFILE); // Return file error code
@ -147,7 +138,7 @@ return(0);
void AckCloseResource(void) void AckCloseResource(void)
{ {
if (rsHandle) // Check to make sure resource file is opened if (rsHandle) // Check to make sure resource file is opened
_lclose(rsHandle); // Close the resource close(rsHandle); // Close the resource
if (rbaTable != NULL) // Do we need to free the memory for the file buffer? if (rbaTable != NULL) // Do we need to free the memory for the file buffer?
{ {
@ -230,14 +221,14 @@ BuildWallDstTables(); // Create the distance tables
if (!rsHandle) // Check to make sure resource file is not opened if (!rsHandle) // Check to make sure resource file is not opened
{ {
handle = _lopen("trig.dat",OF_READ); // Open trig data file handle = open("trig.dat",O_RDONLY|O_BINARY); // Open trig data file
if (handle < 1) if (handle < 1)
return(ERR_BADFILE); // File can't be opened; return error code return(ERR_BADFILE); // File can't be opened; return error code
} }
else else
{ {
handle = rsHandle; // Get handle for resource file handle = rsHandle; // Get handle for resource file
_llseek(handle,rbaTable[0],SEEK_SET); lseek(handle,rbaTable[0],SEEK_SET);
} }
// Allocate memory for trig and coordinate tables // Allocate memory for trig and coordinate tables
@ -275,21 +266,21 @@ if (LongTanTable == NULL || // Make sure memory is allocated for tab
ViewCosTable == NULL) ViewCosTable == NULL)
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
return(ERR_NOMEMORY); // Return memory allocation error code return(ERR_NOMEMORY); // Return memory allocation error code
} }
len = sizeof(long) * INT_ANGLE_360; // Calculate size for each trig table len = sizeof(long) * INT_ANGLE_360; // Calculate size for each trig table
_lread(handle,SinTable,len); // Read in trig data and place in appropriate tables read(handle,SinTable,len); // Read in trig data and place in appropriate tables
_lread(handle,CosTable,len); read(handle,CosTable,len);
_lread(handle,LongTanTable,len); read(handle,LongTanTable,len);
_lread(handle,LongInvTanTable,len); read(handle,LongInvTanTable,len);
_lread(handle,InvCosTable,len); read(handle,InvCosTable,len);
_lread(handle,InvSinTable,len); read(handle,InvSinTable,len);
_lread(handle,LongCosTable,len); read(handle,LongCosTable,len);
if (!rsHandle) if (!rsHandle)
_lclose(handle); // Done reading, close trig.dat close(handle); // Done reading, close trig.dat
ca = INT_ANGLE_32; ca = INT_ANGLE_32;
na = -1; na = -1;
@ -357,72 +348,72 @@ short AckReadMapFile(ACKENG *ae,char *fName)
if (!rsHandle) // Check to see if resource file is open already if (!rsHandle) // Check to see if resource file is open already
{ // No resource file so open new one { // No resource file so open new one
handle = _lopen(fName,OF_READ); // Open the specified resource handle = open(fName,O_RDONLY|O_BINARY); // Open the specified resource
if (handle < 1) if (handle < 1)
return(ERR_BADMAPFILE); // File was not opened; return error code return(ERR_BADMAPFILE); // File was not opened; return error code
} }
else else
{ {
handle = rsHandle; // Get handle to open resource handle = rsHandle; // Get handle to open resource
_llseek(handle,rbaTable[(ULONG)fName],SEEK_SET); // Access opened resource file lseek(handle,rbaTable[(ULONG)fName],SEEK_SET); // Access opened resource file
} }
aLen = GRID_ARRAY * 2; aLen = GRID_ARRAY * 2;
mLen = GRID_MAX * 2; mLen = GRID_MAX * 2;
if (_lread(handle,Grid,mLen) != mLen) // Read in grid map data if (read(handle,Grid,mLen) != mLen) // Read in grid map data
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
return(ERR_READINGMAP); // Return file read error code return(ERR_READINGMAP); // Return file read error code
} }
if (_lread(handle,ObjGrid,mLen) != mLen) // Read in object map data if (read(handle,ObjGrid,mLen) != mLen) // Read in object map data
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
return(ERR_READINGMAP); return(ERR_READINGMAP);
} }
if (_lread(handle,ae->xGrid,aLen) != aLen) // Read in x grid data if (read(handle,ae->xGrid,aLen) != aLen) // Read in x grid data
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
return(ERR_READINGMAP); return(ERR_READINGMAP);
} }
if (_lread(handle,ae->yGrid,aLen) != aLen) // Read in y grid data if (read(handle,ae->yGrid,aLen) != aLen) // Read in y grid data
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
return(ERR_READINGMAP); return(ERR_READINGMAP);
} }
if (_lread(handle,FloorMap,mLen) != mLen) // Read in floor map data if (read(handle,FloorMap,mLen) != mLen) // Read in floor map data
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
return(ERR_READINGMAP); return(ERR_READINGMAP);
} }
if (_lread(handle,CeilMap,mLen) != mLen) // Read in ceiling map data if (read(handle,CeilMap,mLen) != mLen) // Read in ceiling map data
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
return(ERR_READINGMAP); return(ERR_READINGMAP);
} }
_lread(handle,&count,2); // Check counter for multi-height walls read(handle,&count,2); // Check counter for multi-height walls
if (count) if (count)
{ {
for (i = 0; i < count;i++) // Read in multi-height wall data for (i = 0; i < count;i++) // Read in multi-height wall data
{ {
_lread(handle,&pos,2); // Get grid position for this multi-height wall read(handle,&pos,2); // Get grid position for this multi-height wall
mPtr = (UCHAR *)AckMalloc(MAX_MULTI+1); // Allocate memory for multi-height wall data mPtr = (UCHAR *)AckMalloc(MAX_MULTI+1); // Allocate memory for multi-height wall data
if (mPtr == NULL) if (mPtr == NULL)
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
return(ERR_NOMEMORY); return(ERR_NOMEMORY);
} }
@ -430,7 +421,7 @@ if (count)
ae->myGrid[pos] = mPtr; ae->myGrid[pos] = mPtr;
ae->mxGrid[pos+1] = mPtr; ae->mxGrid[pos+1] = mPtr;
ae->myGrid[pos+GRID_WIDTH] = mPtr; ae->myGrid[pos+GRID_WIDTH] = mPtr;
_lread(handle,buf,MAX_MULTI); read(handle,buf,MAX_MULTI);
buf[MAX_MULTI] = '\0'; buf[MAX_MULTI] = '\0';
len = strlen(buf); len = strlen(buf);
if (len > MAX_MULTI) len = MAX_MULTI; if (len > MAX_MULTI) len = MAX_MULTI;
@ -441,7 +432,7 @@ if (count)
} }
if (!rsHandle) // Close handle if (!rsHandle) // Close handle
_lclose(handle); close(handle);
AckBuildGrid(ae); // Build object lists AckBuildGrid(ae); // Build object lists
return(0); return(0);

View file

@ -1,14 +1,10 @@
#include <windows.h>
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <dos.h> #include <string.h>
#include <mem.h>
#include <io.h> #include <io.h>
#include <fcntl.h> #include <fcntl.h>
#include <time.h> #include <sys/stat.h>
#include <string.h> #include <sys/types.h>
#include <sys\stat.h>
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"
@ -48,7 +44,8 @@ return(0);
//±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± //±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
short AckLoadBitmap(ACKENG *ae,short BitmapNumber,short BitmapType,char *BitmapName) short AckLoadBitmap(ACKENG *ae,short BitmapNumber,short BitmapType,char *BitmapName)
{ {
short handle,bFlag; int handle;
short bFlag;
short x,y,bLen; short x,y,bLen;
short sPos,dPos; short sPos,dPos;
UCHAR ch; UCHAR ch;
@ -103,7 +100,7 @@ if (BitmapType == TYPE_OBJECT)
if (!bFlag) if (!bFlag)
{ {
handle = _lopen(BitmapName,OF_READ); handle = open(BitmapName,O_RDONLY|O_BINARY);
if (handle < 1) if (handle < 1)
{ {
AckFree(buf); AckFree(buf);
@ -113,7 +110,7 @@ if (!bFlag)
read(handle,buf,4); // Skip width and height for now read(handle,buf,4); // Skip width and height for now
read(handle,buf,BITMAP_SIZE); read(handle,buf,BITMAP_SIZE);
_lclose(handle); close(handle);
} }
for (y = 0; y < BITMAP_HEIGHT; y++) for (y = 0; y < BITMAP_HEIGHT; y++)

View file

@ -1,18 +1,8 @@
// This source file contains the internal functions needed to add objects // This source file contains the internal functions needed to add objects
// to the slice structures as a view is being built. // to the slice structures as a view is being built.
// (c) 1995 ACK Software (Lary Myers) // (c) 1995 ACK Software (Lary Myers)
#include <windows.h>
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <conio.h>
#include <dos.h>
#include <mem.h>
#include <io.h>
#include <fcntl.h>
#include <time.h>
#include <string.h> #include <string.h>
#include <sys\stat.h>
#include <limits.h>
#include "ack3d.h" // Main ACK-3D internal and interface data structures #include "ack3d.h" // Main ACK-3D internal and interface data structures
#include "ackeng.h" // Internal data structures and constants #include "ackeng.h" // Internal data structures and constants

View file

@ -1,14 +1,5 @@
#include <windows.h>
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <dos.h>
#include <mem.h>
#include <io.h>
#include <fcntl.h>
#include <time.h>
#include <string.h> #include <string.h>
#include <sys\stat.h>
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"

View file

@ -1,11 +1,10 @@
// This source file contains the functions needed to read in PCX files. // This source file contains the functions needed to read in PCX files.
// (c) 1995 ACK Software (Lary Myers) // (c) 1995 ACK Software (Lary Myers)
#include <windows.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <io.h>
#include <string.h> #include <fcntl.h>
#include <time.h> #include <sys/types.h>
#include <dos.h> #include <sys/stat.h>
//typedef unsigned short USHORT; //typedef unsigned short USHORT;
@ -61,15 +60,15 @@ unsigned char *AckReadPCX(char *filename)
long i; long i;
int mode=NORMAL,nbytes; int mode=NORMAL,nbytes;
char abyte,*p; char abyte,*p;
short handle; int handle;
PcxFile *pcx; PcxFile *pcx;
pcx = &pcxGlobal; pcx = &pcxGlobal;
// Open the file since no resource is open. // Open the file since no resource is open.
if (!rsHandle) if (!rsHandle)
{ {
handle = _lopen(filename,OF_READ); // Open the file for reading handle = open(filename,O_RDONLY|O_BINARY); // Open the file for reading
if (handle == HFILE_ERROR) // Make sure file is opened if (handle < 1) // Make sure file is opened
{ {
ErrorCode = ERR_BADFILE; ErrorCode = ERR_BADFILE;
return NULL; return NULL;
@ -79,11 +78,11 @@ else // Use the resource instead
{ {
handle = rsHandle; // Use the handle to the resource file handle = rsHandle; // Use the handle to the resource file
// Move to the location in the resource where the data is stored // Move to the location in the resource where the data is stored
_llseek(handle,rbaTable[(ULONG)filename],SEEK_SET); lseek(handle,rbaTable[(ULONG)filename],SEEK_SET);
} }
_lread(handle,&pcx->hdr,sizeof(PcxHeader)); // Read in the header data read(handle,&pcx->hdr,sizeof(PcxHeader)); // Read in the header data
pcx->width=1+pcx->hdr.xmax-pcx->hdr.xmin; // Store width and height pcx->width=1+pcx->hdr.xmax-pcx->hdr.xmin; // Store width and height
pcx->height=1+pcx->hdr.ymax-pcx->hdr.ymin; pcx->height=1+pcx->hdr.ymax-pcx->hdr.ymin;
// Store number of bytes used for image // Store number of bytes used for image
@ -93,7 +92,7 @@ pcx->imagebytes=(unsigned int)(pcx->width*pcx->height);
if (pcx->imagebytes > PCX_MAX_SIZE) if (pcx->imagebytes > PCX_MAX_SIZE)
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
ErrorCode = ERR_INVALIDFORM; ErrorCode = ERR_INVALIDFORM;
return(NULL); return(NULL);
} }
@ -105,7 +104,7 @@ pcx->bitmap=(char*)AckMalloc(pcx->imagebytes+4);
if (pcx->bitmap == NULL) // Make sure memory is allocated if (pcx->bitmap == NULL) // Make sure memory is allocated
{ {
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
ErrorCode = ERR_NOMEMORY; ErrorCode = ERR_NOMEMORY;
return(NULL); return(NULL);
} }
@ -117,11 +116,11 @@ for (i=0;i<pcx->imagebytes;i++)
{ {
if (mode == NORMAL) // Normal color read mode if (mode == NORMAL) // Normal color read mode
{ {
_lread(handle,&abyte,1); // Read in pixel value from file read(handle,&abyte,1); // Read in pixel value from file
if ((unsigned char)abyte > 0xbf) // Value read > 191 if ((unsigned char)abyte > 0xbf) // Value read > 191
{ {
nbytes=abyte & 0x3f; // Get the RLE counter nbytes=abyte & 0x3f; // Get the RLE counter
_lread(handle,&abyte,1); read(handle,&abyte,1);
if (--nbytes > 0) // Is counter greater than 1? if (--nbytes > 0) // Is counter greater than 1?
mode=RLE; // Yes, we're in RLE mode mode=RLE; // Yes, we're in RLE mode
} }
@ -135,18 +134,18 @@ for (i=0;i<pcx->imagebytes;i++)
// end of file. For a resource file we need to find the position where // end of file. For a resource file we need to find the position where
// the next file starts and then backup 768 bytes // the next file starts and then backup 768 bytes
if (rsHandle) if (rsHandle)
_llseek(handle,rbaTable[(ULONG)(filename + 1)]-768L,SEEK_CUR); lseek(handle,rbaTable[(ULONG)(filename + 1)]-768L,SEEK_CUR);
else else
_llseek(handle,-768L,SEEK_END); lseek(handle,-768L,SEEK_END);
// Store the palette data in our global colordat array // Store the palette data in our global colordat array
_lread(handle,colordat,768); read(handle,colordat,768);
p=colordat; p=colordat;
for (i=0;i<768;i++) // bit shift palette for (i=0;i<768;i++) // bit shift palette
*p++ = *p >> 2; *p++ = *p >> 2;
if (!rsHandle) // Close pcx file if not using a resource if (!rsHandle) // Close pcx file if not using a resource
_lclose(handle); close(handle);
// Add in bitmap width and height to first 4 bytes of buffer // Add in bitmap width and height to first 4 bytes of buffer
p = pcx->bitmap; p = pcx->bitmap;

View file

@ -1,16 +1,7 @@
// Source file ACKPOV.C - Player and Object Movement routines // Source file ACKPOV.C - Player and Object Movement routines
// (c) 1995 ACK Software (Lary Myers) // (c) 1995 ACK Software (Lary Myers)
#include <windows.h>
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <dos.h>
#include <mem.h>
#include <io.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <sys\stat.h>
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"

View file

@ -3,15 +3,6 @@
// CopyRight (c) 1993 Author: Lary Myers // CopyRight (c) 1993 Author: Lary Myers
//*************************************************************************** //***************************************************************************
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>
#include <mem.h>
#include <io.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <sys\stat.h>
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"
#include "ackext.h" #include "ackext.h"
@ -38,12 +29,13 @@ for (i = 0; i < FoundObjectCount; i++)
return(result); return(result);
} }
long x_xPos,x_yPos,x_xNext,x_yNext; // long x_xPos,x_yPos,x_xNext,x_yNext;
long y_xPos,y_yPos,y_xNext,y_yNext; // long y_xPos,y_yPos,y_xNext,y_yNext;
//************************************************************************* //*************************************************************************
// //
//************************************************************************* //*************************************************************************
/*
void xRaySetup(void) void xRaySetup(void)
{ {
@ -65,10 +57,12 @@ else
x_yPos = (((long)x_xPos - (long)xPglobal) * LongTanTable[ViewAngle]) + yPglobalHI; x_yPos = (((long)x_xPos - (long)xPglobal) * LongTanTable[ViewAngle]) + yPglobalHI;
} }
*/
//************************************************************************** //**************************************************************************
// //
//************************************************************************** //**************************************************************************
/*
UINT xRayCast(void) UINT xRayCast(void)
{ {
UINT Color; UINT Color;
@ -153,7 +147,7 @@ while (1)
return(0); // Return that no wall was found return(0); // Return that no wall was found
} }
*/
//************************************************************************* //*************************************************************************
// //
@ -267,6 +261,7 @@ return(0); // Return that no wall was found
//************************************************************************* //*************************************************************************
// //
//************************************************************************* //*************************************************************************
/*
void yRaySetup(void) void yRaySetup(void)
{ {
@ -288,10 +283,12 @@ else
y_xPos = (((long)y_yPos - (long)yPglobal) * LongInvTanTable[ViewAngle]) + xPglobalHI; y_xPos = (((long)y_yPos - (long)yPglobal) * LongInvTanTable[ViewAngle]) + xPglobalHI;
} }
*/
//************************************************************************* //*************************************************************************
// //
//************************************************************************* //*************************************************************************
/*
UINT yRayCast(void) UINT yRayCast(void)
{ {
UINT Color; UINT Color;
@ -376,6 +373,7 @@ while (1)
return(0); // Return here if no Y wall is found return(0); // Return here if no Y wall is found
} }
*/
//************************************************************************* //*************************************************************************
// //

View file

@ -1,15 +1,14 @@
locals locals
IDEAL IDEAL
JUMPS JUMPS
P386 P386
P387 ; Allow 386 processor P387 ; Allow 386 processor
model flat
MASM dataseg
.MODEL FLAT,STDCALL ;32-bit OS/2 model
.data
COLOR dw ? COLOR dw ?
RETVAL dw ? RETVAL dw ?
@ -23,10 +22,9 @@ SX dd ?
.CODE codeseg
IDEAL
include "ackrtn.inc" include "ackrtn.inc"
SC_INDEX EQU 03C4h ; Sequencer Controller access SC_INDEX EQU 03C4h ; Sequencer Controller access
HIGH_ADDR equ 80h ; High byte of screen offset HIGH_ADDR equ 80h ; High byte of screen offset
@ -45,113 +43,107 @@ SCREEN_WIDTH equ 320 ;# of pixels across screen
SCREEN_HEIGHT equ 400 ;# of scan lines on screen SCREEN_HEIGHT equ 400 ;# of scan lines on screen
extrn _ViewAngle:word extrn _ViewAngle:word
extrn _ScreenOffset:word extrn _ScreenOffset:word
extrn _xPglobal:dword extrn _xPglobal:dword
extrn _yPglobal:dword extrn _yPglobal:dword
extrn _xBegGlobal:dword extrn _xBegGlobal:dword
extrn _yBegGlobal:dword extrn _yBegGlobal:dword
extrn _aeGlobal:dword extrn _aeGlobal:dword
extrn _xGridGlobal:dword extrn _xGridGlobal:dword
extrn _yGridGlobal:dword extrn _yGridGlobal:dword
extrn _xPglobalHI:dword extrn _xPglobalHI:dword
extrn _yPglobalHI:dword extrn _yPglobalHI:dword
extrn _rbaTable:dword extrn _rbaTable:dword
extrn _rsHandle:word extrn _rsHandle:dword
extrn _LastX1:dword extrn _LastX1:dword
extrn _LastY1:dword extrn _LastY1:dword
extrn _iLastX:dword extrn _iLastX:dword
extrn _iLastY;dword extrn _iLastY:dword
extrn _MaxDistance:word extrn _MaxDistance:word
extrn _ErrorCode:word extrn _ErrorCode:word
extrn _xMapPosn:dword extrn _xMapPosn:dword
extrn _yMapPosn:dword extrn _yMapPosn:dword
extrn _Grid:dword extrn _Grid:dword
extrn _ObjGrid:dword extrn _ObjGrid:dword
extrn _xSecretmPos:word extrn _xSecretmPos:word
extrn _xSecretmPos1:word extrn _xSecretmPos1:word
extrn _xSecretColumn:word extrn _xSecretColumn:word
extrn _ySecretmPos:word extrn _ySecretmPos:word
extrn _ySecretmPos1:word extrn _ySecretmPos1:word
extrn _ySecretColumn:word extrn _ySecretColumn:word
extrn _TotalSecret:word extrn _TotalSecret:word
extrn _ViewColumn:word extrn _ViewColumn:word
extrn _SinTable:dword extrn _SinTable:dword
extrn _CosTable:dword extrn _CosTable:dword
extrn _LongTanTable:dword extrn _LongTanTable:dword
extrn _LongInvTanTable:dword extrn _LongInvTanTable:dword
extrn _InvCosTable:byte extrn _InvCosTable:byte
extrn _InvSinTable:byte extrn _InvSinTable:byte
extrn _LongCosTable:dword extrn _LongCosTable:dword
extrn _ViewCosTable:dword extrn _ViewCosTable:dword
extrn _xNextTable:dword extrn _xNextTable:dword
extrn _yNextTable:dword extrn _yNextTable:dword
extrn _LastMapPosn:word extrn _LastMapPosn:word
extrn _LastObjectHit:word extrn _LastObjectHit:word
extrn _TotalObjects:word extrn _TotalObjects:word
extrn _FoundObjectCount:word extrn _FoundObjectCount:word
extrn _ObjectsSeen:byte extrn _ObjectsSeen:byte
extrn _MoveObjectCount:word extrn _MoveObjectCount:word
extrn _MoveObjectList:byte extrn _MoveObjectList:byte
extrn _ObjNumber:byte extrn _ObjNumber:byte
extrn _ObjRelDist:byte extrn _ObjRelDist:byte
extrn _ObjColumn:byte extrn _ObjColumn:byte
extrn _x_xPos:dword extrn _x_xPos:dword
extrn _x_yPos:dword extrn _x_yPos:dword
extrn _x_xNext:dword extrn _x_xNext:dword
extrn _x_yNext:dword extrn _x_yNext:dword
extrn _y_xPos:dword extrn _y_xPos:dword
extrn _y_yPos:dword extrn _y_yPos:dword
extrn _y_xNext:dword extrn _y_xNext:dword
extrn _y_yNext:dword extrn _y_yNext:dword
extrn _Floorscr:dword extrn _Floorscr:dword
extrn _Floors1:dword extrn _Floors1:dword
extrn _Floors2:dword extrn _Floors2:dword
extrn _FloorscrTop:dword extrn _FloorscrTop:dword
extrn _Floorptr2:dword extrn _Floorptr2:dword
extrn _Floorht:word extrn _Floorht:word
extrn _Floorwt:word extrn _Floorwt:word
extrn _gScrnBuffer:dword extrn _gScrnBuffer:dword
extrn _gWinStartY:word extrn _gWinStartY:word
extrn _gWinStartX:word extrn _gWinStartX:word
extrn _gWinWidth:word extrn _gWinWidth:word
extrn _gWinHeight:word extrn _gWinHeight:word
extrn _gWinFullWidth:word extrn _gWinFullWidth:word
extrn _gWinDWORDS:dword extrn _gWinDWORDS:dword
extrn _gWinStartOffset:dword extrn _gWinStartOffset:dword
extrn _VidSeg:dword extrn _VidSeg:dword
extrn _AckKeys:byte extrn _AckKeys:byte
extrn _OurDataSeg:word extrn _HitMap:byte
extrn _HitMap:byte public AckInkey_
public AckPutVideo_
ACKPUBS AckInkey public AckGetVideo_
ACKPUBS AckKbdInt public AckCopyToVideo_
ACKPUBS AckPutVideo public AckSetPalette_
ACKPUBS AckGetVideo public AckDisplayScreen_
ACKPUBS AckCopyToVideo public AckSetVGAmode_
ACKPUBS AckSetPalette public AckSetTextMode_
ACKPUBS AckDisplayScreen public AckDrawPage_
ACKPUBS AckInitVideoSelector public xRaySetup_
ACKPUBS AckGetIntVector public yRaySetup_
ACKPUBS AckSetIntVector public xRayCast_
ACKPUBS AckSetVGAmode public yRayCast_
ACKPUBS AckSetTextMode
ACKPUBS AckDrawPage
ACKPUBS xRaySetup
ACKPUBS yRaySetup
ACKPUBS xRayCast
ACKPUBS yRayCast
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; Checks for a keystroke and returns 0 if none, else scan/char in AX ; Checks for a keystroke and returns 0 if none, else scan/char in AX
@ -159,7 +151,7 @@ SCREEN_HEIGHT equ 400 ;# of scan lines on screen
; to the AckKbdInt routine below. ; to the AckKbdInt routine below.
; unsigned short AckInkey(void); ; unsigned short AckInkey(void);
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckInkey proc AckInkey_ near
push ebx push ebx
mov ax,0100h mov ax,0100h
int 16h int 16h
@ -175,52 +167,13 @@ ackinkey_10:
ret ret
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; Interrupt 9 keyboard handler. Places keys into the keyboard array so they
; can be checked by the application.
; Do NOT call this routine directly!!!
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckKbdInt
push eax
push ebx
push esi
push ds
xor ebx,ebx
in al,60h
mov bl,al
in al,61h
mov ah,al
or al,80h
out 61h,al
mov al,ah
out 61h,al
mov al,20h
out 20h,al
mov ax,cs:[word ptr _OurDataSeg]
mov ds,ax
mov esi,offset _AckKeys
mov eax,ebx
and eax,127
mov [byte ptr esi+eax],1
test ebx,128
jz aki_10
mov [byte ptr esi+eax],0
aki_10:
pop ds
pop esi
pop ebx
pop eax
iretd
endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; Older version which now simply calls AckDrawPage. ; Older version which now simply calls AckDrawPage.
; void AckDisplayScreen(void); ; void AckDisplayScreen(void);
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckDisplayScreen proc AckDisplayScreen_ near
push ebp push ebp
ACKCALL AckDrawPage call AckDrawPage_
pop ebp pop ebp
xor eax,eax xor eax,eax
ret ret
@ -229,164 +182,70 @@ ACKPROC AckDisplayScreen
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; Puts a single byte onto the video ; Puts a single byte onto the video
; void AckPutVideo(unsigned int offset,unsigned char color); ; void AckPutVideo(unsigned int offset,unsigned char color);
; eax: offset
; edx: color
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckPutVideo proc AckPutVideo_ near
push ebp
mov ebp,esp
push es
push ebx push ebx
push edi push edi
mov bx,[word ptr _VidSeg+2] mov edi,[_VidSeg]
mov es,bx add edi,eax
movzx edi,[word ptr _VidSeg] mov edx,edx
add edi,[dword ptr ebp+8]
mov edx,[ebp+12]
mov [edi],dl mov [edi],dl
pop edi pop edi
pop ebx pop ebx
pop es
pop ebp
ret ret
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; Retrieves a single byte from the video ; Retrieves a single byte from the video
; unsigned char AckGetVideo(unsigned int offset); ; unsigned char AckGetVideo(unsigned int offset);
; eax: offset
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckGetVideo proc AckGetVideo_ near
push ebp
mov ebp,esp
push ds
push ebx push ebx
push esi push esi
movzx esi,[word ptr _VidSeg] mov esi,[_VidSeg]
add esi,[dword ptr ebp+8] add esi,eax
mov ax,[word ptr _VidSeg+2]
mov ds,ax
mov al,[esi] mov al,[esi]
mov ah,0 mov ah,0
pop esi pop esi
pop ebx pop ebx
pop ds
pop ebp
ret ret
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; Copies a block from the data segment buffer to the video screen ; Copies a block from the data segment buffer to the video screen
; void AckCopyToVideo(unsigned int SrcOff,unsigned int len); ; void AckCopyToVideo(unsigned int SrcOff,unsigned int len);
; eax: SrcOff
; edx: len
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckCopyToVideo proc AckCopyToVideo_ near
push ebp
mov ebp,esp
push es
push ebx
push ecx push ecx
push edx
push esi push esi
push edi push edi
mov esi,[ebp+8] mov esi,eax
mov ecx,[ebp+12] mov ecx,edx
movzx edi,[word ptr _VidSeg] mov edi,[_VidSeg]
mov ax,[word ptr _VidSeg+2]
mov es,ax
rep movsb rep movsb
pop edi pop edi
pop esi pop esi
pop edx
pop ecx pop ecx
pop ebx
pop es
pop ebp
ret
endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; Retrieves a selector to Video memory and stores it in the VidSeg global
; void AckInitVideoSelector(void);
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckInitVideoSelector
push ebx
push ecx
push edx
mov ax,2 ; Allocate selector for real mode address
mov bx,0A000h ; Get Video address
int 31h
mov [word ptr _VidSeg+2],ax
mov [word ptr _VidSeg],0
pop edx
pop ecx
pop ebx
ret ret
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; Retrieves a protected mode interrupt vector. ; void AckSetPalette(UCHAR *PalBuffer)
; void AckGetIntVector(int VectorNumber,int *sel,int *off); ; eax: PalBuffer
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckGetIntVector proc AckSetPalette_ near
push ebp
mov ebp,esp
push ebx push ebx
push ecx push ecx
push edx push edx
push es mov esi,eax
mov ebx,[ebp+8]
mov eax,204h
int 31h
mov ebx,[ebp+12]
mov [ebx],cx
mov ebx,[ebp+16]
mov [ebx],dx
pop es
; mov eax,ecx
pop edx
pop ecx
pop ebx
pop ebp
ret
endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; Sets a protected mode interrupt handler.
; void AckSetIntVector(int VecNum,unsigned int VecSel,unsigned int VecOff);
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckSetIntVector
push ebp
mov ebp,esp
push ebx
push ecx
push edx
mov ebx,[ebp+8]
mov ecx,[ebp+12]
mov edx,[ebp+16]
;; mov cx,cs
mov eax,205h
cli
int 31h
sti
pop edx
pop ecx
pop ebx
pop ebp
ret
endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
;
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckSetPalette
push ebp
mov ebp,esp
push ds
push ebx
push ecx
push edx
mov esi,[ebp+8]
mov ebx,0 mov ebx,0
mov ecx,256 mov ecx,256
mov dx,3c8h mov edx,3c8h
asp_loop: asp_loop:
mov al,bl mov al,bl
@ -405,15 +264,13 @@ asp_loop:
pop edx pop edx
pop ecx pop ecx
pop ebx pop ebx
pop ds
pop ebp
ret ret
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void AckSetVGAmode(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckSetVGAmode proc AckSetVGAmode_ near
push ebx push ebx
push ecx push ecx
push edx push edx
@ -485,9 +342,9 @@ ACKPROC AckSetVGAmode
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void AckSetTextMode(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckSetTextMode proc AckSetTextMode_ near
push ebx push ebx
push ecx push ecx
push edx push edx
@ -500,20 +357,16 @@ ACKPROC AckSetTextMode
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void AckDrawPage(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckDrawPage proc AckDrawPage_ near
push esi push esi
push edi push edi
push ebx push ebx
push ecx push ecx
push edx push edx
push es
push ds
;; mov edi,[_VidSeg] mov edi,[_VidSeg]
mov edi,0
mov di,[word ptr _VidSeg]
mov esi,[_gScrnBuffer] mov esi,[_gScrnBuffer]
cmp [word ptr _gWinFullWidth],0 cmp [word ptr _gWinFullWidth],0
jz short dp_smallscreen jz short dp_smallscreen
@ -523,10 +376,6 @@ ACKPROC AckDrawPage
add esi,eax add esi,eax
mov ecx,[_gWinDWORDS] mov ecx,[_gWinDWORDS]
mov ax,[word ptr _VidSeg+2]
mov es,ax
;; mov ds,ax
mov dx,3dah mov dx,3dah
fp020: fp020:
@ -541,8 +390,6 @@ fp030:
rep movsd rep movsd
pop ds
pop es
pop edx pop edx
pop ecx pop ecx
pop ebx pop ebx
@ -557,16 +404,13 @@ dp_smallscreen:
movzx eax,[_gWinStartX] movzx eax,[_gWinStartX]
add edi,eax add edi,eax
add esi,eax add esi,eax
mov dx,[_gWinHeight] movzx edx,[_gWinHeight]
inc dx inc dx
movzx ebx,[_gWinWidth] movzx ebx,[_gWinWidth]
push ebp
mov ebp,320 mov ebp,320
sub ebp,ebx ;width to advance pointers sub ebp,ebx ;width to advance pointers
mov ax,[word ptr _VidSeg+2]
mov es,ax
;; mov ds,ax
dp010: dp010:
mov ecx,ebx mov ecx,ebx
shr ecx,1 shr ecx,1
@ -579,8 +423,7 @@ dp010:
jnz dp010 jnz dp010
dp090: dp090:
pop ds pop ebp
pop es
pop edx pop edx
pop ecx pop ecx
pop ebx pop ebx
@ -591,9 +434,9 @@ dp090:
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void xRaySetup(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC xRaySetup proc xRaySetup_ near
push esi ; Save registers used push esi ; Save registers used
push ebx push ebx
push ecx push ecx
@ -640,9 +483,9 @@ xr_cont:
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; USHORT xRayCast(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC xRayCast proc xRayCast_ near
push esi ; Save registers used push esi ; Save registers used
push edi push edi
push ebx push ebx
@ -781,9 +624,9 @@ xRayDone:
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void yRaySetup(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC yRaySetup proc yRaySetup_ near
push esi push esi
push ebx push ebx
push ecx push ecx
@ -825,9 +668,9 @@ y_yr_cont:
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; USHORT yRayCast(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC yRayCast proc yRayCast_ near
push esi push esi
push edi push edi
push ebx push ebx

View file

@ -1,51 +1,4 @@
_BORLANDC_ = 1
MACRO ACKPROC L
IFDEF _BORLANDC_
PROC _&L NEAR
ENDIF
IFDEF _WATCOMC_
PROC &L_ NEAR
ENDIF
ENDM
MACRO ACKEXT L
IFDEF _BORLANDC_
extrn _&L:NEAR
ENDIF
IFDEF _WATCOMC_
extrn &L_:NEAR
ENDIF
ENDM
MACRO ACKPUBS LAB
IFDEF _BORLANDC_
public _&LAB
ENDIF
IFDEF _WATCOMC_
public &LAB_
ENDIF
ENDM
MACRO ACKCALL LAB
IFDEF _BORLANDC_
call _&LAB
ENDIF
IFDEF _WATCOMC_
call &LAB_
ENDIF
ENDM
IFDEF _BORLANDC_
VIDSEG equ 0a0000000h
ENDIF
IFDEF _WATCOMC_
VIDSEG equ 0a0000h
ENDIF
;; Equates for SLICE struct ;; Equates for SLICE struct
sabMap equ 0 sabMap equ 0
samPtr equ 4 samPtr equ 4

View file

@ -1,82 +1,79 @@
IDEAL IDEAL
JUMPS JUMPS
P386 P386
P387 P387
model flat
MASM dataseg
.MODEL FLAT
.DATA
SVTABLE dd ? SVTABLE dd ?
ENDPOS dd ? ENDPOS dd ?
.CODE codeseg
IDEAL
include "ackrtn.inc" include "ackrtn.inc"
extrn _VidSeg:dword extrn _VidSeg:dword
extrn _Resolution:word extrn _Resolution:word
extrn _ScreenOffset:word extrn _ScreenOffset:word
extrn _bmDistance:dword extrn _bmDistance:dword
extrn _bmWall:dword extrn _bmWall:dword
extrn _scPtr:dword extrn _scPtr:dword
extrn _VidTop:dword extrn _VidTop:dword
extrn _VidBottom:dword extrn _VidBottom:dword
extrn _Floors1:dword extrn _Floors1:dword
extrn _Floors2:dword extrn _Floors2:dword
extrn _gPalTable:dword extrn _gPalTable:dword
extrn _gWinStartX:word extrn _gWinStartX:word
extrn _gWinStartY:word extrn _gWinStartY:word
extrn _gWinEndX:word extrn _gWinEndX:word
extrn _gWinEndY:word extrn _gWinEndY:word
extrn _gWinHeight:word extrn _gWinHeight:word
extrn _ViewHeight:word extrn _ViewHeight:word
extrn _SysFlags:word extrn _SysFlags:word
extrn _Slice:byte extrn _Slice:byte
extrn _gScrnBuffer:dword extrn _gScrnBuffer:dword
extrn _gCenterOff:word extrn _gCenterOff:word
extrn _Floorht:word extrn _Floorht:word
extrn _Floorscr:dword extrn _Floorscr:dword
extrn _gWinStartOffset:dword extrn _gWinStartOffset:dword
extrn _scVid:dword extrn _scVid:dword
extrn _scWall:dword extrn _scWall:dword
extrn _scPal:dword extrn _scPal:dword
extrn _scdst:word extrn _scdst:word
extrn _scwht:word extrn _scwht:word
extrn _scmulti:word extrn _scmulti:word
extrn _sctopht:word extrn _sctopht:word
extrn _scbotht:word extrn _scbotht:word
extrn _scsavwht:word extrn _scsavwht:word
extrn _scmulcnt:word extrn _scmulcnt:word
extrn _scsavVid:dword extrn _scsavVid:dword
extrn _scbNum:word extrn _scbNum:word
extrn _scMulData:dword extrn _scMulData:dword
extrn _scColumn:dword extrn _scColumn:dword
extrn _WallbMaps:dword extrn _WallbMaps:dword
extrn _LowerTable:dword extrn _LowerTable:dword
extrn _gBottomOff:dword extrn _gBottomOff:dword
ACKEXT ShowColLow extrn ShowColLow_:near
ACKEXT ShowColMaskLow extrn ShowColMaskLow_:near
ACKPUBS ShowCol public ShowCol_
ACKPUBS ShowColMask public ShowColMask_
ACKPUBS DrawWalls public DrawWalls_
align 2 align 2
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void ShowCol(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC ShowCol proc ShowCol_ near
push ebp push ebp
push esi push esi
push edi push edi
@ -224,9 +221,9 @@ alldone:
align 2 align 2
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void ShowColMask(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC ShowColMask proc ShowColMask_ near
push ebp push ebp
push esi push esi
push edi push edi
@ -369,8 +366,9 @@ m_alldone:
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; This routine runs through the list of slices and draws the walls. ; This routine runs through the list of slices and draws the walls.
; void DrawWalls(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC DrawWalls proc DrawWalls_ near
push ebp push ebp
push esi push esi
push edi push edi
@ -537,11 +535,11 @@ stwlr050:
mov esi,ebx mov esi,ebx
cmp [byte ptr ebp+saType],ST_WALL ;transparent wall? cmp [byte ptr ebp+saType],ST_WALL ;transparent wall?
je short stwlr060 ;nope, use solid slice routine je short stwlr060 ;nope, use solid slice routine
ACKCALL ShowColMaskLow call ShowColMaskLow_
jmp short stwlr070 jmp short stwlr070
stwlr060: stwlr060:
ACKCALL ShowColLow call ShowColLow_
stwlr070: stwlr070:
mov ebx,esi mov ebx,esi

View file

@ -1,804 +0,0 @@
IDEAL
JUMPS
P386
P387 ; Allow 386 processor
MASM
.MODEL FLAT ;32-bit OS/2 model
IDEAL
include "ackrtn.inc"
MASM
extrn _WallDistTable:dword
extrn _FloorMap:word
extrn _CeilMap:word
extrn _LastWallHeight:word
extrn _ViewAngle:word
extrn _ScreenOffset:word
extrn _xPglobal:dword
extrn _yPglobal:dword
extrn _xBegGlobal:dword
extrn _yBegGlobal:dword
extrn _aeGlobal:dword
extrn _xGridGlobal:dword
extrn _yGridGlobal:dword
extrn _xPglobalHI:dword
extrn _yPglobalHI:dword
extrn _rbaTable:dword
extrn _rsHandle:word
extrn _LastX1:dword
extrn _LastY1:dword
extrn _iLastX:dword
extrn _iLastY;dword
extrn _MaxDistance:word
extrn _BackArray:dword
extrn _zdTable:dword
extrn _ErrorCode:word
extrn _xMapPosn:dword
extrn _yMapPosn:dword
extrn _Grid:dword
extrn _ObjGrid:dword
extrn _WallbMaps:dword
extrn _ViewHeight:word
extrn _CeilingHeight:word
extrn _gTopColor:byte
extrn _gBottomColor:byte
extrn _PlayerAngle:word
extrn _gScrnBuffer:dword
extrn _gBkgdBuffer:dword
extrn _gCenterOff:word
extrn _gWinStartOffset:dword
extrn _gWinHeight:word
extrn _gWinEndY:dword
extrn _SysFlags:word
extrn _sPtr:dword
extrn _mxGridGlobal:dword
extrn _myGridGlobal:dword
extrn _xSecretmPos:word
extrn _xSecretmPos1:word
extrn _xSecretColumn:word
extrn _ySecretmPos:word
extrn _ySecretmPos1:word
extrn _ySecretColumn:word
extrn _TotalSecret:word
extrn _ViewColumn:word
extrn _SinTable:dword
extrn _CosTable:dword
extrn _LongTanTable:dword
extrn _LongInvTanTable:dword
extrn _InvCosTable:byte
extrn _InvSinTable:byte
extrn _LongCosTable:dword
extrn _ViewCosTable:dword
extrn _xNextTable:dword
extrn _yNextTable:dword
extrn _LastMapPosn:word
extrn _LastObjectHit:word
extrn _TotalObjects:word
extrn _FoundObjectCount:word
extrn _ObjectsSeen:byte
extrn _MoveObjectCount:word
extrn _MoveObjectList:byte
extrn _ObjNumber:byte
extrn _ObjRelDist:byte
extrn _ObjColumn:byte
extrn _x_xPos:dword
extrn _x_yPos:dword
extrn _x_xNext:dword
extrn _x_yNext:dword
extrn _y_xPos:dword
extrn _y_yPos:dword
extrn _y_xNext:dword
extrn _y_yNext:dword
extrn _Resolution:word
extrn _Flooru:dword
extrn _Floorv:dword
extrn _Floordu:dword
extrn _Floordv:dword
extrn _Floorkx:dword
extrn _Floorky:dword
extrn _Floorku:dword
extrn _Floorkv:dword
extrn _Floorkdu:dword
extrn _Floorkdv:dword
extrn _Floorbm:dword
extrn _Floorscr:dword
extrn _Floors1:dword
extrn _Floors2:dword
extrn _FloorscrTop:dword
extrn _Floorptr2:dword
extrn _Floorht:dword
extrn _Floorwt:dword
extrn _Floorvht:word
extrn _Flooreht:word
extrn _FloorLastbNum:dword
extrn _FloorLastbm:dword
extrn _bmDistance:dword
extrn _scwht:word
extrn _scWall:dword
extrn _scPal:dword
extrn _scVid:dword
extrn _scantables:dword
ACKEXT DrawBackDrop
ACKEXT ShowCol
ACKEXT ShowColMask
ACKEXT FindDoor
ACKEXT xRayCast
ACKEXT yRayCast
ACKPUBS xxxAckDrawFloor
ACKPUBS xxxAckDrawFloorOnly
ACKPUBS xxxAckDrawCeilingOnly
.DATA
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; Globals used by the AckDrawFloor routine
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
BCOL dd ?
HEIGHT dd ?
VA dd ?
SY dd ?
EY dd ?
BFSCRN dd ?
BCSCRN dd ?
FSCRN dd ?
CSCRN dd ?
CV dd ?
SV dd ?
BA dd ?
BA1 dd ?
ZDPTR dd ?
POS dd ?
BMPOS dd ?
MPOS dd ?
MPOSHI dd ?
SCANTBL dd ?
LINENUM dd ?
LASTDIST dd ?
;LASTX dd ?
;LASTY dd ?
LASTEBP dd ?
LASTEAX dd ?
LASTEDX dd ?
WALLDIST dd ?
.CODE
IDEAL
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
;
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC xxxAckDrawFloor
push ebp
push esi
push edi
push ebx
push ecx
push edx
movzx eax,[word ptr _PlayerAngle]
mov ecx,eax
sub eax,INT_ANGLE_32
jnc short adf_20
add eax,INT_ANGLE_360
adf_20:
mov ebx,640
cdq
idiv ebx
mov [BCOL],edx
mov eax,89
sub ax,[word ptr _ViewHeight]
mov [HEIGHT],eax
sub ecx,INT_ANGLE_32
jnc short adf_30
add ecx,INT_ANGLE_360
adf_30:
mov [VA],ecx
movzx eax,[word ptr _gWinHeight]
sar eax,1
movzx ebx,[word ptr _gWinEndY]
sub ebx,eax
inc ebx
sub ebx,5 ; 6
mov [EY],ebx
mov edi,[_gScrnBuffer]
movzx eax,[word ptr _gCenterOff]
mov ebx,eax
add eax,1920
add eax,edi
mov [BFSCRN],eax
sub ebx,1600 ;1920
add ebx,edi
mov [BCSCRN],ebx
mov ebp,0
mov [LINENUM],ebp
mov [LASTDIST],ebp
mov ebx,[dword ptr _scantables]
mov [SCANTBL],ebx
mov ebx,[VA]
adf_loop:
mov eax,[_CosTable]
shl ebx,2
mov eax,[eax+ebx]
mov [CV],eax
mov eax,[_SinTable]
mov eax,[eax+ebx]
mov [SV],eax
mov eax,[dword ptr _WallDistTable+ebp*4]
mov [WALLDIST],eax
mov eax,[BCSCRN]
mov [CSCRN],eax
mov ecx,[EY]
mov ebx,[BCOL]
mov eax,[_BackArray+ebx*4]
add eax,ecx
mov [BA],eax
inc ebx
cmp ebx,640
jb short adf_l10
sub ebx,ebx
adf_l10:
mov eax,[_BackArray+ebx*4]
add eax,ecx
mov [BA1],eax
inc ebx
cmp ebx,640
jb short adf_l20
sub ebx,ebx
adf_l20:
mov [BCOL],ebx
lea esi,[offset _zdTable]
mov ecx,[EY] ;Number of rows to draw
imul eax,ebp,800
add esi,eax
add esi,24 ;ebx
mov edi,[BFSCRN]
push ebp
adf_yloop:
mov edx,[esi]
lea esi,[esi+4]
cmp edx,[WALLDIST]
jb short adf_distokay
lea edi,[edi+320]
jmp adf_ycont
adf_distokay:
cmp edx,[LASTDIST]
jne short adf_newdist
; mov eax,[LASTX]
; mov ebx,[LASTY]
mov ebp,[LASTEBP]
mov eax,[LASTEAX]
mov edx,[LASTEDX]
jmp short adf_samedist
adf_newdist:
mov [LASTDIST],edx
mov eax,[CV]
mov ebx,[SV]
imul eax,edx
imul ebx,edx
sar eax,16
sar ebx,16
mov edx,[_xPglobal]
add eax,edx
mov edx,[_yPglobal]
add ebx,edx
; mov [LASTX],eax
; mov [LASTY],ebx
;adf_samedist:
mov edx,ebx
and edx,0FC0h
mov ebp,eax
sar ebp,6
add ebp,edx ;Pos within floor and ceiling maps
and ebx,63
shl ebx,6
and eax,63
add eax,ebx ;bitmap position
;; mov ebx,0
shl ebp,1
mov [LASTEBP],ebp
mov [LASTEAX],eax
movzx ebx,[word ptr _FloorMap+ebp]
mov edx,[_WallbMaps]
mov edx,[edx+ebx*4]
movzx edx,[byte ptr edx+eax]
mov ebx,[SCANTBL]
mov dl,[ebx+edx]
mov dh,dl
mov [LASTEDX],edx
adf_samedist:
mov [edi],dx
lea edi,[edi+320]
movzx ebx,[word ptr _CeilMap+ebp]
mov ebp,[CSCRN]
test bx,bx
jz short adf_yback
mov edx,[_WallbMaps]
mov edx,[edx+ebx*4]
movzx eax,[byte ptr edx+eax]
mov edx,[SCANTBL]
mov al,[edx+eax]
mov ah,al
mov [ebp],ax
mov eax,[LINENUM]
add eax,4
mov [LINENUM],eax
mov eax,[_scantables+eax]
mov [SCANTBL],eax
lea ebp,[ebp-320]
mov [CSCRN],ebp
dec [dword ptr BA]
dec [dword ptr BA1]
dec ecx
jnz adf_yloop
jmp short adf_ynext
adf_yback:
mov eax,[BA]
mov dl,[eax]
mov eax,[BA1]
mov dh,[eax]
mov [ebp],dx
adf_ycont:
mov eax,[LINENUM]
add eax,4
mov [LINENUM],eax
mov eax,[_scantables+eax]
mov [SCANTBL],eax
sub [dword ptr CSCRN],320
dec [dword ptr BA]
dec [dword ptr BA1]
dec ecx
jnz adf_yloop
adf_ynext:
mov [dword ptr LINENUM],0
mov eax,[dword ptr _scantables]
mov [SCANTBL],eax
mov ebx,[VA]
lea ebx,[ebx+2]
cmp ebx,INT_ANGLE_360
jb short adf_l90
sub ebx,INT_ANGLE_360
adf_l90:
mov [VA],ebx ;Note: EBX is used for VA at top of loop!
add [dword ptr BFSCRN],2
add [dword ptr BCSCRN],2
pop ebp
lea ebp,[ebp+2]
cmp ebp,320
jb adf_loop
adf_exit:
pop edx
pop ecx
pop ebx
pop edi
pop esi
pop ebp
ret
endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
;
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC xxxAckDrawFloorOnly
push ebp
push esi
push edi
push ebx
push ecx
push edx
movzx eax,[word ptr _PlayerAngle]
mov ecx,eax
sub eax,INT_ANGLE_32
jnc short adfo_20
add eax,INT_ANGLE_360
adfo_20:
mov ebx,640
cdq
idiv ebx
mov [BCOL],edx
mov eax,89
sub ax,[word ptr _ViewHeight]
mov [HEIGHT],eax
sub ecx,INT_ANGLE_32
jnc short adfo_30
add ecx,INT_ANGLE_360
adfo_30:
mov [VA],ecx
movzx eax,[word ptr _gWinHeight]
sar eax,1
movzx ebx,[word ptr _gWinEndY]
sub ebx,eax
inc ebx
sub ebx,5 ; 6
mov [EY],ebx
mov edi,[_gScrnBuffer]
movzx eax,[word ptr _gCenterOff]
mov ebx,eax
add eax,1920
add eax,edi
mov [BFSCRN],eax
sub ebx,1600 ;1920
add ebx,edi
mov [BCSCRN],ebx
mov ebp,0
mov [LINENUM],ebp
mov ebx,[dword ptr _scantables]
mov [SCANTBL],ebx
mov ebx,[VA]
adfo_loop:
mov eax,[_CosTable]
shl ebx,2
mov eax,[eax+ebx]
mov [CV],eax
mov eax,[_SinTable]
mov eax,[eax+ebx]
mov [SV],eax
mov eax,[BCSCRN]
mov [CSCRN],eax
mov ecx,[EY]
mov ebx,[BCOL]
mov eax,[_BackArray+ebx*4]
add eax,ecx
mov [BA],eax
inc ebx
cmp ebx,640
jb short adfo_l10
sub ebx,ebx
adfo_l10:
mov eax,[_BackArray+ebx*4]
add eax,ecx
mov [BA1],eax
inc ebx
cmp ebx,640
jb short adfo_l20
sub ebx,ebx
adfo_l20:
mov [BCOL],ebx
lea esi,[offset _zdTable]
mov ecx,[EY] ;Number of rows to draw
imul eax,ebp,800
add esi,eax
add esi,24 ;ebx
mov edi,[BFSCRN]
push ebp
adfo_yloop:
mov edx,[esi]
lea esi,[esi+4]
mov eax,[CV]
mov ebx,[SV]
imul eax,edx
imul ebx,edx
sar eax,16
sar ebx,16
mov edx,[_xPglobal]
add eax,edx
mov edx,[_yPglobal]
add ebx,edx
mov edx,ebx
and edx,0FC0h
mov ebp,eax
sar ebp,6
add ebp,edx ;Pos within floor and ceiling maps
and ebx,63
shl ebx,6
and eax,63
add eax,ebx ;bitmap position
mov ebx,0
shl ebp,1
mov bx,[word ptr _FloorMap+ebp]
mov edx,[_WallbMaps]
mov edx,[edx+ebx*4]
movzx edx,[byte ptr edx+eax]
mov ebx,[SCANTBL]
mov dl,[ebx+edx]
mov dh,dl
mov [edi],dx
lea edi,[edi+320]
mov eax,[BA]
mov dl,[eax]
mov eax,[BA1]
mov dh,[eax]
mov ebp,[CSCRN]
mov [ebp],dx
adfo_ycont:
lea ebp,[ebp-320]
mov [CSCRN],ebp
mov eax,[LINENUM]
add eax,4
mov [LINENUM],eax
mov eax,[_scantables+eax]
mov [SCANTBL],eax
dec [dword ptr BA]
dec [dword ptr BA1]
dec ecx
jnz adfo_yloop
adfo_ynext:
mov [dword ptr LINENUM],0
mov eax,[dword ptr _scantables]
mov [SCANTBL],eax
mov ebx,[VA]
lea ebx,[ebx+2]
cmp ebx,INT_ANGLE_360
jb short adfo_l90
sub ebx,INT_ANGLE_360
adfo_l90:
mov [VA],ebx ;Note: EBX is used for VA at top of loop!
add [dword ptr BFSCRN],2
add [dword ptr BCSCRN],2
pop ebp
lea ebp,[ebp+2]
cmp ebp,320
jb adfo_loop
adfo_exit:
pop edx
pop ecx
pop ebx
pop edi
pop esi
pop ebp
ret
endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
;
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC xxxAckDrawCeilingOnly
push ebp
push esi
push edi
push ebx
push ecx
push edx
movzx eax,[word ptr _PlayerAngle]
mov ecx,eax
sub eax,INT_ANGLE_32
jnc short adco_20
add eax,INT_ANGLE_360
adco_20:
mov ebx,640
cdq
idiv ebx
mov [BCOL],edx
mov eax,89
sub ax,[word ptr _ViewHeight]
mov [HEIGHT],eax
sub ecx,INT_ANGLE_32
jnc short adco_30
add ecx,INT_ANGLE_360
adco_30:
mov [VA],ecx
movzx eax,[word ptr _gWinHeight]
sar eax,1
movzx ebx,[word ptr _gWinEndY]
sub ebx,eax
inc ebx
sub ebx,5 ; 6
mov [EY],ebx
mov edi,[_gScrnBuffer]
movzx eax,[word ptr _gCenterOff]
mov ebx,eax
sub ebx,1600 ;1920
add ebx,edi
mov [BCSCRN],ebx
mov ebp,0
mov [LINENUM],ebp
mov ebx,[dword ptr _scantables]
mov [SCANTBL],ebx
mov ebx,[VA]
adco_loop:
mov eax,[_CosTable]
shl ebx,2
mov eax,[eax+ebx]
mov [CV],eax
mov eax,[_SinTable]
mov eax,[eax+ebx]
mov [SV],eax
mov eax,[BCSCRN]
mov [CSCRN],eax
mov ecx,[EY]
mov ebx,[BCOL]
mov eax,[_BackArray+ebx*4]
add eax,ecx
mov [BA],eax
inc ebx
cmp ebx,640
jb short adco_l10
sub ebx,ebx
adco_l10:
mov eax,[_BackArray+ebx*4]
add eax,ecx
mov [BA1],eax
inc ebx
cmp ebx,640
jb short adco_l20
sub ebx,ebx
adco_l20:
mov [BCOL],ebx
lea esi,[offset _zdTable]
mov ecx,[EY] ;Number of rows to draw
imul eax,ebp,800
add esi,eax
add esi,24 ;ebx
push ebp
adco_yloop:
mov edx,[esi]
lea esi,[esi+4]
mov eax,[CV]
mov ebx,[SV]
imul eax,edx
imul ebx,edx
sar eax,16
sar ebx,16
mov edx,[_xPglobal]
add eax,edx
mov edx,[_yPglobal]
add ebx,edx
mov edx,ebx
and edx,0FC0h
mov ebp,eax
sar ebp,6
add ebp,edx ;Pos within floor and ceiling maps
and ebx,63
shl ebx,6
and eax,63
add eax,ebx ;bitmap position
mov ebx,0
shl ebp,1
movzx ebx,[word ptr _CeilMap+ebp]
mov ebp,[CSCRN]
test bx,bx
jz short adco_yback
mov edx,[_WallbMaps]
mov edx,[edx+ebx*4]
movzx eax,[byte ptr edx+eax]
mov edx,[SCANTBL]
mov al,[edx+eax]
mov ah,al
mov [ebp],ax
mov eax,[LINENUM]
add eax,4
mov [LINENUM],eax
mov eax,[_scantables+eax]
mov [SCANTBL],eax
lea ebp,[ebp-320]
mov [CSCRN],ebp
dec [dword ptr BA]
dec [dword ptr BA1]
dec ecx
jnz adco_yloop
jmp short adco_ynext
adco_yback:
mov eax,[BA]
mov dl,[eax]
mov eax,[BA1]
mov dh,[eax]
mov [ebp],dx
adco_ycont:
mov eax,[LINENUM]
add eax,4
mov [LINENUM],eax
mov eax,[_scantables+eax]
mov [SCANTBL],eax
sub [dword ptr CSCRN],320
dec [dword ptr BA]
dec [dword ptr BA1]
dec ecx
jnz adco_yloop
adco_ynext:
mov [dword ptr LINENUM],0
mov eax,[dword ptr _scantables]
mov [SCANTBL],eax
mov ebx,[VA]
lea ebx,[ebx+2]
cmp ebx,INT_ANGLE_360
jb short adco_l90
sub ebx,INT_ANGLE_360
adco_l90:
mov [VA],ebx ;Note: EBX is used for VA at top of loop!
add [dword ptr BCSCRN],2
pop ebp
lea ebp,[ebp+2]
cmp ebp,320
jb adco_loop
adco_exit:
pop edx
pop ecx
pop ebx
pop edi
pop esi
pop ebp
ret
endp
end

View file

@ -1,164 +1,162 @@
IDEAL IDEAL
JUMPS JUMPS
P386 P386
P387 ; Allow 386 processor P387 ; Allow 386 processor
model flat
codeseg
include "ackrtn.inc"
extrn _gMultiWalls:word
extrn _WallDistTable:dword
extrn _BackDropRows:dword
extrn _FloorCeilRtn:dword
extrn _Resolution:word
extrn _ScreenOffset:word
extrn _bmDistance:dword
extrn _bmWall:dword
extrn _scPtr:dword
extrn _VidTop:dword
extrn _VidBottom:dword
extrn _Floors1:dword
extrn _Floors2:dword
extrn _PlayerAngle:word
extrn _BackArray:dword
extrn _gWinStartX:word
extrn _gWinStartY:word
extrn _gWinEndX:word
extrn _gWinEndY:word
extrn _gWinHeight:word
extrn _gWinWidth:word
extrn _gCenterRow:word
extrn _gCenterOff:word
extrn _scVid:dword
extrn _scWall:dword
extrn _scPal:dword
extrn _scdst:word
extrn _scwht:word
extrn _scmulti:word
extrn _sctopht:word
extrn _scbotht:word
extrn _scsavwht:word
extrn _scmulcnt:word
extrn _scsavVid:dword
extrn _scbNum:word
extrn _scMulData:dword
extrn _scColumn:dword
extrn _WallbMaps:dword
extrn _FloorMap:word
extrn _CeilMap:word
extrn _LastWallHeight:word
extrn _ViewAngle:word
extrn _ScreenOffset:word
extrn _xPglobal:dword
extrn _yPglobal:dword
extrn _xBegGlobal:dword
extrn _yBegGlobal:dword
extrn _aeGlobal:dword
extrn _xGridGlobal:dword
extrn _yGridGlobal:dword
extrn _xPglobalHI:dword
extrn _yPglobalHI:dword
extrn _rbaTable:dword
extrn _rsHandle:dword
extrn _LastX1:dword
extrn _LastY1:dword
extrn _iLastX:dword
extrn _iLastY:dword
extrn _MaxDistance:word
extrn _ErrorCode:word
extrn _xMapPosn:dword
extrn _yMapPosn:dword
extrn _Grid:dword
extrn _ObjGrid:dword
extrn _ViewHeight:word
extrn _CeilingHeight:word
extrn _gTopColor:byte
extrn _gBottomColor:byte
extrn _PlayerAngle:word
extrn _gScrnBuffer:dword
extrn _gBkgdBuffer:dword
extrn _gCenterOff:word
extrn _gWinHeight:word
extrn _SysFlags:word
MASM extrn _xSecretmPos:word
.MODEL FLAT ;32-bit OS/2 model extrn _xSecretmPos1:word
.CODE extrn _xSecretColumn:word
IDEAL
include "ackrtn.inc" extrn _ySecretmPos:word
extrn _ySecretmPos1:word
extrn _ySecretColumn:word
extrn _gMultiWalls:word extrn _TotalSecret:word
extrn _WallDistTable:dword extrn _ViewColumn:word
extrn _BackDropRows:dword extrn _SinTable:dword
extrn _FloorCeilRtn:dword extrn _CosTable:dword
extrn _Resolution:word extrn _LongTanTable:dword
extrn _ScreenOffset:word extrn _LongInvTanTable:dword
extrn _bmDistance:dword extrn _InvCosTable:byte
extrn _bmWall:dword extrn _InvSinTable:byte
extrn _scPtr:dword extrn _LongCosTable:dword
extrn _VidTop:dword extrn _ViewCosTable:dword
extrn _VidBottom:dword extrn _xNextTable:dword
extrn _Floors1:dword extrn _yNextTable:dword
extrn _Floors2:dword
extrn _PlayerAngle:word
extrn _BackArray:dword
extrn _gWinStartX:word
extrn _gWinStartY:word
extrn _gWinEndX:word
extrn _gWinEndY:word
extrn _gWinHeight:word
extrn _gWinWidth:word
extrn _gCenterRow:word
extrn _gCenterOff:word
extrn _scVid:dword extrn _LastMapPosn:word
extrn _scWall:dword extrn _LastObjectHit:word
extrn _scPal:dword extrn _TotalObjects:word
extrn _scdst:word extrn _FoundObjectCount:word
extrn _scwht:word extrn _ObjectsSeen:byte
extrn _scmulti:word extrn _MoveObjectCount:word
extrn _sctopht:word extrn _MoveObjectList:byte
extrn _scbotht:word extrn _ObjNumber:byte
extrn _scsavwht:word extrn _ObjRelDist:byte
extrn _scmulcnt:word extrn _ObjColumn:byte
extrn _scsavVid:dword
extrn _scbNum:word
extrn _scMulData:dword
extrn _scColumn:dword
extrn _WallbMaps:dword
extrn _FloorMap:word extrn _x_xPos:dword
extrn _CeilMap:word extrn _x_yPos:dword
extrn _LastWallHeight:word extrn _x_xNext:dword
extrn _ViewAngle:word extrn _x_yNext:dword
extrn _ScreenOffset:word extrn _y_xPos:dword
extrn _xPglobal:dword extrn _y_yPos:dword
extrn _yPglobal:dword extrn _y_xNext:dword
extrn _xBegGlobal:dword extrn _y_yNext:dword
extrn _yBegGlobal:dword
extrn _aeGlobal:dword
extrn _xGridGlobal:dword
extrn _yGridGlobal:dword
extrn _xPglobalHI:dword
extrn _yPglobalHI:dword
extrn _rbaTable:dword
extrn _rsHandle:word
extrn _LastX1:dword
extrn _LastY1:dword
extrn _iLastX:dword
extrn _iLastY;dword
extrn _MaxDistance:word
extrn _ErrorCode:word
extrn _xMapPosn:dword
extrn _yMapPosn:dword
extrn _Grid:dword
extrn _ObjGrid:dword
extrn _ViewHeight:word
extrn _CeilingHeight:word
extrn _gTopColor:byte
extrn _gBottomColor:byte
extrn _PlayerAngle:word
extrn _gScrnBuffer:dword
extrn _gBkgdBuffer:dword
extrn _gCenterOff:word
extrn _gWinHeight:word
extrn _SysFlags:word
extrn _Slice:dword
extrn _sPtr:dword
extrn _HitMap:byte
extrn _xSecretmPos:word extrn xRaySetup_:near
extrn _xSecretmPos1:word extrn yRaySetup_:near
extrn _xSecretColumn:word extrn BuildSlice_:near
extrn xRayCast_:near
extrn yRayCast_:near
extrn AckDrawFloor_:near
extrn AckDrawFloorOnly_:near
extrn AckDrawCeilingOnly_:near
extrn DrawWalls_:near
extrn CheckDoors_:near
extrn BuildSliceMulti_:near
extrn FindObject_:near
extrn _ySecretmPos:word public xRayCastMulti_
extrn _ySecretmPos1:word public yRayCastMulti_
extrn _ySecretColumn:word public ShowColLow_
public ShowColMaskLow_
extrn _TotalSecret:word public BuildUpView_
extrn _ViewColumn:word
extrn _SinTable:dword
extrn _CosTable:dword
extrn _LongTanTable:dword
extrn _LongInvTanTable:dword
extrn _InvCosTable:byte
extrn _InvSinTable:byte
extrn _LongCosTable:dword
extrn _ViewCosTable:dword
extrn _xNextTable:dword
extrn _yNextTable:dword
extrn _LastMapPosn:word
extrn _LastObjectHit:word
extrn _TotalObjects:word
extrn _FoundObjectCount:word
extrn _ObjectsSeen:byte
extrn _MoveObjectCount:word
extrn _MoveObjectList:byte
extrn _ObjNumber:byte
extrn _ObjRelDist:byte
extrn _ObjColumn:byte
extrn _x_xPos:dword
extrn _x_yPos:dword
extrn _x_xNext:dword
extrn _x_yNext:dword
extrn _y_xPos:dword
extrn _y_yPos:dword
extrn _y_xNext:dword
extrn _y_yNext:dword
extrn _Slice:dword
extrn _sPtr:dword
extrn _HitMap:byte
ACKEXT xRaySetup
ACKEXT yRaySetup
ACKEXT BuildSlice
ACKEXT xRayCast
ACKEXT yRayCast
ACKEXT AckDrawFloor
ACKEXT AckDrawFloorOnly
ACKEXT AckDrawCeilingOnly
ACKEXT DrawWalls
ACKEXT CheckDoors
ACKEXT BuildSliceMulti
ACKEXT FindObject
ACKPUBS xRayCastMulti
ACKPUBS yRayCastMulti
ACKPUBS ShowColLow
ACKPUBS ShowColMaskLow
ACKPUBS BuildUpView
align 2 align 2
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void ShowColLow(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC ShowColLow proc ShowColLow_ near
push ebp push ebp
push esi push esi
push edi push edi
@ -319,9 +317,9 @@ alldone:
align 2 align 2
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void ShowColMaskLow(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC ShowColMaskLow proc ShowColMaskLow_ near
push ebp push ebp
push esi push esi
push edi push edi
@ -463,12 +461,10 @@ m_alldone:
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; USHORT xRayCastMulti(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC xRayCastMulti proc xRayCastMulti_ near
push ebp ; sub esp,50
mov ebp,esp
sub esp,50
push esi push esi
push edi push edi
push ebx push ebx
@ -561,18 +557,14 @@ xRayDone:
pop ebx pop ebx
pop edi pop edi
pop esi pop esi
mov esp,ebp
pop ebp
ret ret
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; USHORT yRayCastMulti(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC yRayCastMulti proc yRayCastMulti_ near
push ebp ; sub esp,50
mov ebp,esp
sub esp,50
push esi push esi
push edi push edi
push ebx push ebx
@ -664,16 +656,14 @@ yRayDone:
pop ebx pop ebx
pop edi pop edi
pop esi pop esi
mov esp,ebp
pop ebp
ret ret
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void CheckHitMap(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC CheckHitMap proc CheckHitMap_ near
mov edi,offset _HitMap mov edi,offset _HitMap
mov edx,edi mov edx,edi
mov ecx,4096 mov ecx,4096
@ -701,9 +691,9 @@ chmDone:
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void BuildUpView(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC BuildUpView proc BuildUpView_ near
push ebp ; Save registers used by this routine push ebp ; Save registers used by this routine
push esi push esi
push edi push edi
@ -711,7 +701,7 @@ ACKPROC BuildUpView
push ecx push ecx
push edx push edx
ACKCALL CheckDoors ; Determine the state of the doors used in the view call CheckDoors_ ; Determine the state of the doors used in the view
mov edi,offset _HitMap ; Access the hit map mov edi,offset _HitMap ; Access the hit map
mov ecx,1024 ; Size of the hit map mov ecx,1024 ; Size of the hit map
@ -768,14 +758,14 @@ buv050:
add eax,ebx ; Add offset to base address add eax,ebx ; Add offset to base address
mov [_sPtr],eax ; Set up pointer to actual column slice mov [_sPtr],eax ; Set up pointer to actual column slice
movzx edi,[_ViewAngle] ; Use current viewing angle movzx edi,[_ViewAngle] ; Use current viewing angle
ACKCALL xRaySetup ; Set up x ray to start casting call xRaySetup_ ; Set up x ray to start casting
buv060: buv060:
ACKCALL yRaySetup ; Set up y ray to start casting call yRaySetup_ ; Set up y ray to start casting
buv070: buv070:
mov [word ptr _LastWallHeight],0 ; For checking mult-height walls mov [word ptr _LastWallHeight],0 ; For checking mult-height walls
ACKCALL BuildSlice ; Build the current slice call BuildSlice_ ; Build the current slice
cmp [word ptr _gMultiWalls],0 ; Are multi-height walls used? cmp [word ptr _gMultiWalls],0 ; Are multi-height walls used?
jz short buv080 ; Nope, no need to check jz short buv080 ; Nope, no need to check
@ -788,7 +778,7 @@ buv070:
cmp [word ptr eax+saDist],96 ; Distance from POV to slice is cmp [word ptr eax+saDist],96 ; Distance from POV to slice is
jle short buv080 ; less than or equal to 96 jle short buv080 ; less than or equal to 96
ACKCALL BuildSliceMulti ; Build the current slice for call BuildSliceMulti_ ; Build the current slice for
; a multi-height wall ; a multi-height wall
buv080: buv080:
movzx eax,[_ViewColumn] ; Get current column movzx eax,[_ViewColumn] ; Get current column
@ -811,10 +801,10 @@ buv100:
jl buv050 ; Nope; go build next slice jl buv050 ; Nope; go build next slice
buv_exit: buv_exit:
ACKCALL CheckHitMap call CheckHitMap_
ACKCALL FindObject ; Update slice structures with objects found call FindObject_ ; Update slice structures with objects found
call [dword ptr _FloorCeilRtn] ; Build the floor and ceiling call [dword ptr _FloorCeilRtn] ; Build the floor and ceiling
ACKCALL DrawWalls ; Build the walls call DrawWalls_ ; Build the walls
pop edx ; Restore the registers used pop edx ; Restore the registers used
pop ecx pop ecx

View file

@ -1,14 +1,12 @@
IDEAL IDEAL
JUMPS JUMPS
P386 P386
P387 ; Allow 386 processor P387 ; Allow 386 processor
model flat
MASM dataseg
.MODEL FLAT ;32-bit OS/2 model
.DATA
SVTABLE dd ? SVTABLE dd ?
@ -16,116 +14,106 @@ SAVEVID dd ?
SAVEROW dd ? SAVEROW dd ?
.CODE codeseg
IDEAL
include "ackrtn.inc" include "ackrtn.inc"
extrn _BackDropRows:dword extrn _BackDropRows:dword
extrn _PlayerAngle:word extrn _PlayerAngle:word
extrn _BackArray:dword extrn _BackArray:dword
extrn _Resolution:word extrn _Resolution:word
extrn _ScreenOffset:word extrn _ScreenOffset:word
extrn _bmDistance:dword extrn _bmDistance:dword
extrn _bmWall:dword extrn _bmWall:dword
extrn _scPtr:dword extrn _scPtr:dword
extrn _VidTop:dword extrn _VidTop:dword
extrn _VidBottom:dword extrn _VidBottom:dword
extrn _Floors1:dword extrn _Floors1:dword
extrn _Floors2:dword extrn _Floors2:dword
extrn _gPalTable:dword extrn _gPalTable:dword
extrn _gWinStartX:word extrn _gWinStartX:word
extrn _gWinStartY:word extrn _gWinStartY:word
extrn _gWinEndX:word extrn _gWinEndX:word
extrn _gWinEndY:word extrn _gWinEndY:word
extrn _gWinHeight:word extrn _gWinHeight:word
extrn _ViewHeight:word extrn _ViewHeight:word
extrn _SysFlags:word extrn _SysFlags:word
extrn _Slice:byte extrn _Slice:byte
extrn _gScrnBuffer:dword extrn _gScrnBuffer:dword
extrn _gCenterOff:word extrn _gCenterOff:word
extrn _gCenterRow:word extrn _gCenterRow:word
extrn _Floorscr:dword extrn _Floorscr:dword
extrn _gWinStartOffset:dword extrn _gWinStartOffset:dword
extrn _scVid:dword extrn _scVid:dword
extrn _scWall:dword extrn _scWall:dword
extrn _scPal:dword extrn _scPal:dword
extrn _scdst:word extrn _scdst:word
extrn _scwht:word extrn _scwht:word
extrn _scmulti:word extrn _scmulti:word
extrn _sctopht:word extrn _sctopht:word
extrn _scbotht:word extrn _scbotht:word
extrn _scsavwht:word extrn _scsavwht:word
extrn _scmulcnt:word extrn _scmulcnt:word
extrn _scsavVid:dword extrn _scsavVid:dword
extrn _scbNum:word extrn _scbNum:word
extrn _scMulData:dword extrn _scMulData:dword
extrn _scColumn:dword extrn _scColumn:dword
extrn _WallbMaps:dword extrn _WallbMaps:dword
extrn _LowerTable:dword extrn _LowerTable:dword
extrn _gBottomOff:dword extrn _gBottomOff:dword
extrn _LightFlag:word extrn _LightFlag:word
ACKEXT ShowCol extrn ShowCol_:near
ACKEXT ShowColMask extrn ShowColMask_:near
extrn _Resolution:word extrn _Resolution:word
extrn _Flooru:dword extrn _Flooru:dword
extrn _Floorv:dword extrn _Floorv:dword
extrn _Floordu:dword extrn _Floordu:dword
extrn _Floordv:dword extrn _Floordv:dword
extrn _Floorkx:dword extrn _Floorkx:dword
extrn _Floorky:dword extrn _Floorky:dword
extrn _Floorku:dword extrn _Floorku:dword
extrn _Floorkv:dword extrn _Floorkv:dword
extrn _Floorkdu:dword extrn _Floorkdu:dword
extrn _Floorkdv:dword extrn _Floorkdv:dword
extrn _Floorbm:dword extrn _Floorbm:dword
extrn _Floorscr:dword extrn _Floorscr:dword
extrn _Floors1:dword extrn _Floors1:dword
extrn _Floors2:dword extrn _Floors2:dword
extrn _FloorscrTop:dword extrn _FloorscrTop:dword
extrn _Floorptr2:dword extrn _Floorptr2:dword
extrn _Floorwt:dword extrn _Floorwt:dword
extrn _Floorvht:word extrn _Floorvht:word
extrn _Flooreht:word extrn _Flooreht:word
extrn _FloorMap:word extrn _FloorMap:word
extrn _gScrnBufferCenter:dword extrn _gScrnBufferCenter:dword
extrn _gWinHalfHeight:word extrn _gWinHalfHeight:word
extrn _zdTable:dword extrn _zdTable:dword
extrn _CosTable:dword extrn _CosTable:dword
extrn _SinTable:dword extrn _SinTable:dword
extrn _xPglobal:dword extrn _xPglobal:dword
extrn _yPglobal:dword extrn _yPglobal:dword
extrn _WallDistTable:dword extrn _WallDistTable:dword
extrn _CeilMap:word extrn _CeilMap:word
extrn _AckTimerCounter:dword extrn _AckTimerCounter:dword
ACKPUBS Mymemset public Mymemset_
ACKPUBS AckSpeedUp public AckSpeedUp_
ACKPUBS AckSlowDown public AckSlowDown_
ACKPUBS ShowColNS public ShowColNS_
ACKPUBS ShowColMaskNS public ShowColMaskNS_
ACKPUBS DrawBackDrop public DrawBackDrop_
ACKPUBS AckTimerHandler
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ;
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckTimerHandler proc Mymemset_ near
inc cs:[dword ptr _AckTimerCounter] push edi
iretd
endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
;
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC Mymemset
push edi
push ebx push ebx
push ecx push ecx
push edx push edx
@ -149,9 +137,9 @@ ACKPROC Mymemset
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void AckSpeedUp(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckSpeedUp proc AckSpeedUp_ near
push ebx push ebx
push edx push edx
mov bx,ax mov bx,ax
@ -174,9 +162,9 @@ ACKPROC AckSpeedUp
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void AckSlowDown(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckSlowDown proc AckSlowDown_ near
push edx push edx
mov dx,43h mov dx,43h
mov al,36h mov al,36h
@ -193,9 +181,9 @@ ACKPROC AckSlowDown
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void DrawBackDrop(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC DrawBackDrop proc DrawBackDrop_ near
push ebp push ebp
push esi push esi
push edi push edi
@ -254,9 +242,9 @@ dbd030:
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void ShowColNS(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC ShowColNS proc ShowColNS_ near
push ebp push ebp
push esi push esi
push edi push edi
@ -353,9 +341,9 @@ sns_alldone:
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void ShowColMaskNS(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC ShowColMaskNS proc ShowColMaskNS_ near
push ebp push ebp
push esi push esi
push edi push edi

View file

@ -1,152 +1,148 @@
IDEAL IDEAL
JUMPS JUMPS
P386 P386
P387 ; Allow 386 processor P387 ; Allow 386 processor
model flat
MASM include "ackrtn.inc"
.MODEL FLAT ;32-bit OS/2 model
IDEAL
extrn _WallDistTable:dword
extrn _FloorMap:word
extrn _CeilMap:word
extrn _LastWallHeight:word
extrn _ViewAngle:word
extrn _ScreenOffset:word
extrn _xPglobal:dword
extrn _yPglobal:dword
extrn _xBegGlobal:dword
extrn _yBegGlobal:dword
extrn _aeGlobal:dword
extrn _xGridGlobal:dword
extrn _yGridGlobal:dword
extrn _xPglobalHI:dword
extrn _yPglobalHI:dword
extrn _rbaTable:dword
extrn _rsHandle:dword
extrn _LastX1:dword
extrn _LastY1:dword
extrn _iLastX:dword
extrn _iLastY:dword
extrn _MaxDistance:word
extrn _BackArray:dword
extrn _zdTable:dword
extrn _ErrorCode:word
extrn _xMapPosn:dword
extrn _yMapPosn:dword
extrn _Grid:dword
extrn _ObjGrid:dword
extrn _WallbMaps:dword
extrn _ViewHeight:word
extrn _CeilingHeight:word
extrn _gTopColor:byte
extrn _gBottomColor:byte
extrn _PlayerAngle:word
extrn _gScrnBuffer:dword
extrn _gBkgdBuffer:dword
extrn _gCenterOff:word
extrn _gWinStartOffset:dword
extrn _gWinHeight:word
extrn _gWinEndY:dword
extrn _SysFlags:word
extrn _sPtr:dword
extrn _mxGridGlobal:dword
extrn _myGridGlobal:dword
include "ackrtn.inc" extrn _xSecretmPos:word
extrn _xSecretmPos1:word
extrn _xSecretColumn:word
extrn _WallDistTable:dword extrn _ySecretmPos:word
extrn _FloorMap:word extrn _ySecretmPos1:word
extrn _CeilMap:word extrn _ySecretColumn:word
extrn _LastWallHeight:word
extrn _ViewAngle:word
extrn _ScreenOffset:word
extrn _xPglobal:dword
extrn _yPglobal:dword
extrn _xBegGlobal:dword
extrn _yBegGlobal:dword
extrn _aeGlobal:dword
extrn _xGridGlobal:dword
extrn _yGridGlobal:dword
extrn _xPglobalHI:dword
extrn _yPglobalHI:dword
extrn _rbaTable:dword
extrn _rsHandle:word
extrn _LastX1:dword
extrn _LastY1:dword
extrn _iLastX:dword
extrn _iLastY;dword
extrn _MaxDistance:word
extrn _BackArray:dword
extrn _zdTable:dword
extrn _ErrorCode:word
extrn _xMapPosn:dword
extrn _yMapPosn:dword
extrn _Grid:dword
extrn _ObjGrid:dword
extrn _WallbMaps:dword
extrn _ViewHeight:word
extrn _CeilingHeight:word
extrn _gTopColor:byte
extrn _gBottomColor:byte
extrn _PlayerAngle:word
extrn _gScrnBuffer:dword
extrn _gBkgdBuffer:dword
extrn _gCenterOff:word
extrn _gWinStartOffset:dword
extrn _gWinHeight:word
extrn _gWinEndY:dword
extrn _SysFlags:word
extrn _sPtr:dword
extrn _mxGridGlobal:dword
extrn _myGridGlobal:dword
extrn _xSecretmPos:word extrn _TotalSecret:word
extrn _xSecretmPos1:word extrn _ViewColumn:word
extrn _xSecretColumn:word extrn _SinTable:dword
extrn _CosTable:dword
extrn _LongTanTable:dword
extrn _LongInvTanTable:dword
extrn _InvCosTable:byte
extrn _InvSinTable:byte
extrn _LongCosTable:dword
extrn _ViewCosTable:dword
extrn _xNextTable:dword
extrn _yNextTable:dword
extrn _ySecretmPos:word extrn _LastMapPosn:word
extrn _ySecretmPos1:word extrn _LastObjectHit:word
extrn _ySecretColumn:word extrn _TotalObjects:word
extrn _FoundObjectCount:word
extrn _ObjectsSeen:byte
extrn _MoveObjectCount:word
extrn _MoveObjectList:byte
extrn _ObjNumber:byte
extrn _ObjRelDist:byte
extrn _ObjColumn:byte
extrn _TotalSecret:word extrn _x_xPos:dword
extrn _ViewColumn:word extrn _x_yPos:dword
extrn _SinTable:dword extrn _x_xNext:dword
extrn _CosTable:dword extrn _x_yNext:dword
extrn _LongTanTable:dword extrn _y_xPos:dword
extrn _LongInvTanTable:dword extrn _y_yPos:dword
extrn _InvCosTable:byte extrn _y_xNext:dword
extrn _InvSinTable:byte extrn _y_yNext:dword
extrn _LongCosTable:dword
extrn _ViewCosTable:dword
extrn _xNextTable:dword
extrn _yNextTable:dword
extrn _LastMapPosn:word extrn _Resolution:word
extrn _LastObjectHit:word extrn _Flooru:dword
extrn _TotalObjects:word extrn _Floorv:dword
extrn _FoundObjectCount:word extrn _Floordu:dword
extrn _ObjectsSeen:byte extrn _Floordv:dword
extrn _MoveObjectCount:word extrn _Floorkx:dword
extrn _MoveObjectList:byte extrn _Floorky:dword
extrn _ObjNumber:byte extrn _Floorku:dword
extrn _ObjRelDist:byte extrn _Floorkv:dword
extrn _ObjColumn:byte extrn _Floorkdu:dword
extrn _Floorkdv:dword
extrn _Floorbm:dword
extrn _Floorscr:dword
extrn _Floors1:dword
extrn _Floors2:dword
extrn _FloorscrTop:dword
extrn _Floorptr2:dword
extrn _Floorht:dword
extrn _Floorwt:dword
extrn _Floorvht:word
extrn _Flooreht:word
extrn _FloorLastbNum:dword
extrn _FloorLastbm:dword
extrn _x_xPos:dword extrn _bmDistance:dword
extrn _x_yPos:dword extrn _scwht:word
extrn _x_xNext:dword extrn _scWall:dword
extrn _x_yNext:dword extrn _scPal:dword
extrn _y_xPos:dword extrn _scVid:dword
extrn _y_yPos:dword extrn _scantables:dword
extrn _y_xNext:dword
extrn _y_yNext:dword
extrn _Resolution:word extrn AckDrawFloor_:near
extrn _Flooru:dword extrn AckDrawFloorOnly_:near
extrn _Floorv:dword extrn AckDrawCeilingOnly_:near
extrn _Floordu:dword extrn DrawBackDrop_:near
extrn _Floordv:dword extrn AckDrawCeilingOnlyNS_:near
extrn _Floorkx:dword extrn AckDrawFloorOnlyNS_:near
extrn _Floorky:dword
extrn _Floorku:dword
extrn _Floorkv:dword
extrn _Floorkdu:dword
extrn _Floorkdv:dword
extrn _Floorbm:dword
extrn _Floorscr:dword
extrn _Floors1:dword
extrn _Floors2:dword
extrn _FloorscrTop:dword
extrn _Floorptr2:dword
extrn _Floorht:dword
extrn _Floorwt:dword
extrn _Floorvht:word
extrn _Flooreht:word
extrn _FloorLastbNum:dword
extrn _FloorLastbm:dword
extrn _bmDistance:dword public AckDrawFloorNS_
extrn _scwht:word public DrawSolidCeilAndFloorNS_
extrn _scWall:dword public DrawSolidCeilAndFloor_
extrn _scPal:dword public DrawSolidFloorAndCeilNS_
extrn _scVid:dword public DrawSolidFloorAndCeil_
extrn _scantables:dword public DrawSolidCeilSolidFloor_
public AckDoubleBuffer_
ACKEXT AckDrawFloor dataseg
ACKEXT AckDrawFloorOnly
ACKEXT AckDrawCeilingOnly
ACKEXT DrawBackDrop
ACKEXT AckDrawCeilingOnlyNS
ACKEXT AckDrawFloorOnlyNS
ACKPUBS AckDrawFloorNS
ACKPUBS DrawSolidCeilAndFloorNS
ACKPUBS DrawSolidCeilAndFloor
ACKPUBS DrawSolidFloorAndCeilNS
ACKPUBS DrawSolidFloorAndCeil
ACKPUBS DrawSolidCeilSolidFloor
ACKPUBS AckDoubleBuffer
MASM
.DATA
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; Globals used by the AckDrawFloor routine ; Globals used by the AckDrawFloor routine
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
@ -180,13 +176,12 @@ WALLDIST dd ?
DSTPTR dd ? DSTPTR dd ?
COLNUM dd ? COLNUM dd ?
.CODE codeseg
IDEAL
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void AckDrawFloorNS(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckDrawFloorNS proc AckDrawFloorNS_ near
push ebp push ebp
push esi push esi
push edi push edi
@ -415,9 +410,9 @@ adf_exit:
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ; void DrawSolidCeilAndFloor(void)
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC DrawSolidCeilAndFloor proc DrawSolidCeilAndFloor_ near
mov edi,[_gScrnBuffer] mov edi,[_gScrnBuffer]
movzx ecx,[word ptr _gCenterOff] movzx ecx,[word ptr _gCenterOff]
mov al,[byte ptr _gTopColor] mov al,[byte ptr _gTopColor]
@ -426,14 +421,14 @@ ACKPROC DrawSolidCeilAndFloor
rep stosw rep stosw
rcl cx,1 rcl cx,1
rep stosb rep stosb
ACKCALL AckDrawFloorOnly call AckDrawFloorOnly_
ret ret
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ;
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC DrawSolidCeilAndFloorNS proc DrawSolidCeilAndFloorNS_ near
mov edi,[_gScrnBuffer] mov edi,[_gScrnBuffer]
movzx ecx,[word ptr _gCenterOff] movzx ecx,[word ptr _gCenterOff]
mov al,[byte ptr _gTopColor] mov al,[byte ptr _gTopColor]
@ -442,14 +437,14 @@ ACKPROC DrawSolidCeilAndFloorNS
rep stosw rep stosw
rcl cx,1 rcl cx,1
rep stosb rep stosb
ACKCALL AckDrawFloorOnlyNS call AckDrawFloorOnlyNS_
ret ret
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ;
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC DrawSolidFloorAndCeilNS proc DrawSolidFloorAndCeilNS_ near
mov edi,[_gScrnBuffer] mov edi,[_gScrnBuffer]
movzx ecx,[word ptr _gCenterOff] movzx ecx,[word ptr _gCenterOff]
add edi,ecx add edi,ecx
@ -459,14 +454,14 @@ ACKPROC DrawSolidFloorAndCeilNS
rep stosw rep stosw
rcl cx,1 rcl cx,1
rep stosb rep stosb
ACKCALL AckDrawCeilingOnlyNS call AckDrawCeilingOnlyNS_
ret ret
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ;
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC DrawSolidFloorAndCeil proc DrawSolidFloorAndCeil_ near
mov edi,[_gScrnBuffer] mov edi,[_gScrnBuffer]
movzx ecx,[word ptr _gCenterOff] movzx ecx,[word ptr _gCenterOff]
add edi,ecx add edi,ecx
@ -476,14 +471,14 @@ ACKPROC DrawSolidFloorAndCeil
rep stosw rep stosw
rcl cx,1 rcl cx,1
rep stosb rep stosb
ACKCALL AckDrawCeilingOnly call AckDrawCeilingOnly_
ret ret
endp endp
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ;
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC DrawSolidCeilSolidFloor proc DrawSolidCeilSolidFloor_ near
mov edi,[_gScrnBuffer] mov edi,[_gScrnBuffer]
movzx ecx,[word ptr _gCenterOff] movzx ecx,[word ptr _gCenterOff]
mov al,[byte ptr _gTopColor] mov al,[byte ptr _gTopColor]
@ -508,7 +503,7 @@ ACKPROC DrawSolidCeilSolidFloor
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
; ;
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ACKPROC AckDoubleBuffer proc AckDoubleBuffer_ near
push ebp push ebp
mov ebp,esp mov ebp,esp
push esi push esi

View file

@ -1,46 +1,82 @@
#include <windows.h>
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dos.h> #include <dos.h>
#include <mem.h>
#include <io.h> #include <io.h>
#include <fcntl.h> #include <fcntl.h>
#include <time.h> #include <sys/types.h>
#include <string.h> #include <sys/stat.h>
#include <sys\stat.h>
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"
#include "ackext.h" #include "ackext.h"
typedef struct {
int sel;
int off;
} SELOFF;
void AckGetIntVector(int VecNum,int *sel,int *off);
void AckSetIntVector(int VecNum,int sel,void *VecOff);
void AckKbdInt(void);
void AckTimerHandler(void);
void AckSetTextMode(void);
long AckMemUsed; long AckMemUsed;
short AckDisplayErrors; short AckDisplayErrors;
SELOFF OldKeybdInt; void (__interrupt __far *OldKeybdInt)();
char AckKeyboardSetup; char AckKeyboardSetup;
SELOFF OldTimerInt; void (__interrupt __far *OldTimerInt)();
char AckTimerSetup; char AckTimerSetup;
//=============================================================================
// Keyboard interrupt 9
//=============================================================================
void __interrupt __far AckKbdInt(void)
{
UCHAR scanCode, x;
scanCode = inp(0x60); // read keyboard data port
x = inp(0x61);
outp(0x61, (x | 0x80));
outp(0x61, x);
outp(0x20, 0x20);
AckKeys[scanCode & 127] = 1;
KeyPressed = 1;
if (scanCode & 128)
{
AckKeys[scanCode & 127] = 0;
KeyPressed = 0;
}
}
//=============================================================================
// Timer interrupt - simply increments a counter for use in program
// Calls the old timer after X iterations have cycled so clock stays correct
//=============================================================================
void __interrupt __far AckTimerHandler(void)
{
AckTimerCounter++;
AckTmCount++;
if (AckTmCount > AckTmDelay)
{
OldTimerInt();
AckTmCount -= AckTmDelay;
}
else
{
_enable();
outp(0x20,0x20);
}
}
//±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± //±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
// Establish a hook into interrupt 9 for keyboard handling // Establish a hook into interrupt 9 for keyboard handling
// The application can access which key is pressed by looking at the // The application can access which key is pressed by looking at the
// AckKeys global array // AckKeys global array
//±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± //±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
#ifndef _MSC_VER
void AckSetupKeyboard(void) void AckSetupKeyboard(void)
{ {
AckGetIntVector(9,&OldKeybdInt.sel,&OldKeybdInt.off); memset(AckKeys, 0, sizeof(UCHAR)*128);
AckSetIntVector(9,_CS,AckKbdInt); KeyPressed = 0;
OldKeybdInt = _dos_getvect(0x9);
_dos_setvect(0x9, AckKbdInt);
AckKeyboardSetup = 1; AckKeyboardSetup = 1;
} }
@ -51,11 +87,13 @@ AckKeyboardSetup = 1;
//±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± //±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
void AckSetupTimer(void) void AckSetupTimer(void)
{ {
AckGetIntVector(0x1C,&OldTimerInt.sel,&OldTimerInt.off); AckTimerCounter = 0;
AckSetIntVector(0x1C,_CS,AckKbdInt); AckTmCount = 0;
OldTimerInt = _dos_getvect(0x1C);
_dos_setvect(0x1C, AckTimerHandler);
AckTimerSetup = 1; AckTimerSetup = 1;
} }
#endif
//±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± //±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
// Utility routine used to track memory usage by the ACK engine and // Utility routine used to track memory usage by the ACK engine and
@ -134,18 +172,18 @@ if (buf == NULL)
ErrCode = 0; ErrCode = 0;
if (!rsHandle) if (!rsHandle)
handle = _lopen(PalName,O_RDWR|O_BINARY); handle = open(PalName,O_RDONLY|O_BINARY);
else else
{ {
handle = rsHandle; handle = rsHandle;
_llseek(handle,rbaTable[(ULONG)PalName],SEEK_SET); lseek(handle,rbaTable[(ULONG)PalName],SEEK_SET);
} }
if (handle > 0) if (handle > 0)
{ {
read(handle,buf,768); read(handle,buf,768);
if (!rsHandle) if (!rsHandle)
_lclose(handle); close(handle);
memset(buf,0,3); // Make sure color 0 is always black memset(buf,0,3); // Make sure color 0 is always black
AckSetPalette(buf); AckSetPalette(buf);

View file

@ -1,17 +1,6 @@
// This file contains the declarations and functions to set up views for the // This file contains the declarations and functions to set up views for the
// ray casting engine. // ray casting engine.
#include <windows.h> // Required for Windows version of engine
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <conio.h>
#include <dos.h>
#include <mem.h>
#include <io.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <sys\stat.h>
#include <limits.h>
#include "ack3d.h" // Main ACK-3D internal and interface data structures #include "ack3d.h" // Main ACK-3D internal and interface data structures
#include "ackeng.h" // Intrnal structures and constants #include "ackeng.h" // Intrnal structures and constants

View file

@ -1,29 +1,15 @@
#include <windows.h>
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <dos.h> #include <dos.h>
#include <mem.h>
#include <io.h> #include <io.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <sys\stat.h>
#include "ack3d.h" #include "ack3d.h"
#include "ackeng.h" #include "ackeng.h"
#include "ackext.h" #include "ackext.h"
typedef struct {
int sel;
int off;
} SELOFF;
extern char AckKeyboardSetup; extern char AckKeyboardSetup;
extern SELOFF OldKeybdInt; extern void (__interrupt __far *OldKeybdInt)();
extern char AckTimerSetup; extern char AckTimerSetup;
extern SELOFF OldTimerInt; extern void (__interrupt __far *OldTimerInt)();
void AckSetIntVector(int VecNum,int sel,int VecOff);
//±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± //±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
// Frees up buffers and closes any resource file that may be open. // Frees up buffers and closes any resource file that may be open.
@ -63,12 +49,12 @@ short AckWrapUp (ACKENG * ae)
if (AckKeyboardSetup) if (AckKeyboardSetup)
{ {
AckSetIntVector(9,OldKeybdInt.sel,OldKeybdInt.off); _dos_setvect(0x9, OldKeybdInt);
AckKeyboardSetup = 0; AckKeyboardSetup = 0;
} }
if (AckTimerSetup) if (AckTimerSetup)
{ {
AckSetIntVector(0x1C,OldTimerInt.sel,OldTimerInt.off); _dos_setvect(0x1C, OldTimerInt);
AckTimerSetup = 0; AckTimerSetup = 0;
} }

View file

@ -1,3 +1,6 @@
#ifndef IFF_H_INCLUDED
#define IFF_H_INCLUDED
#ifndef NULL #ifndef NULL
#define NULL 0 #define NULL 0
#endif #endif
@ -95,3 +98,5 @@ void ByteFlipShort(short *);
short iffswab(unsigned short); short iffswab(unsigned short);
short swab(unsigned short); short swab(unsigned short);
#endif

View file

@ -4,6 +4,9 @@
// Module: KIT.H // Module: KIT.H
// (c) CopyRight 1994 All Rights Reserved // (c) CopyRight 1994 All Rights Reserved
#ifndef KIT_H_INCLUDED
#define KIT_H_INCLUDED
#define MODE_GRAPHICS 0x13 #define MODE_GRAPHICS 0x13
#define MODE_TEXT 0x03 #define MODE_TEXT 0x03
@ -137,3 +140,5 @@ short ShowPickList(char **p,short SortFlag);
//============================================================================= //=============================================================================
short LoadSet(char *fName); short LoadSet(char *fName);
#endif

70
ack_lib/makefile Normal file
View file

@ -0,0 +1,70 @@
target_config = debug
target_name = acklib
object_files = &
ackbkgd.obj &
ackdata.obj &
ackdoor.obj &
ackfloor.obj &
ackgif.obj &
ackiff.obj &
ackinit.obj &
ackldbmp.obj &
ackobj.obj &
ackover.obj &
ackpcx.obj &
ackpov.obj &
ackray.obj &
ackrtn.obj &
ackrtn1.obj &
ackrtn3.obj &
ackrtn4.obj &
ackrtn5.obj &
ackutil.obj &
ackview.obj &
ackwrap.obj &
cc_flags_debug = /d2 /zp1 /4r /fp3 /j
cc_flags_release = /d1+ /zp1 /4r /fp3 /ontx /oe=40 /j
cc_flags = /mf $(cc_flags_$(target_config))
link_flags_debug = debug all
link_flags_release = debug all
link_flags = $(link_flags_$(target_config))
asm_flags_debug = /zi
asm_flags_release = /zi
asm_flags = /m /ml $(asm_flags_$(target_config))
.c.obj: .AUTODEPEND
wcc386 $[. /zq $(cc_flags)
.asm.obj: .AUTODEPEND
tasm $[. /t $(asm_flags)
$(target_name).lbc: $(object_files)
%create $^@
@for %i in ($(object_files)) do %append $^@ +%i
$(target_name).lib: $(object_files) $(target_name).lbc
wlib /n /q /b $(target_name).lib @$(target_name).lbc
clean : .SYMBOLIC
del *.obj
del *.err
del $(target_name).exe
del $(target_name).lib
del $(target_name).lnk
del $(target_name).lbc
.NOCHECK
build : $(target_name).lib
.NOCHECK
library : $(target_name).lib