Commit e256f3a8 authored by Steven Fuller's avatar Steven Fuller

Lots of cleanups: removal of some instances of _seg, far, unused variables,

unused declarations, unused functions and such...
parent d76dd150
...@@ -88,15 +88,14 @@ typedef struct ...@@ -88,15 +88,14 @@ typedef struct
#define nil ((void *)0) #define nil ((void *)0)
#include "ID_MM.H" #include "id_mm.h"
#include "ID_PM.H" #include "id_pm.h"
#include "ID_CA.H" #include "id_ca.h"
#include "ID_VL.H" #include "id_vl.h"
#include "ID_VH.H" #include "id_vh.h"
#include "ID_IN.H" #include "id_in.h"
#include "ID_SD.H" #include "id_sd.h"
#include "ID_US.H" #include "id_us.h"
void Quit (char *error); // defined in user program void Quit (char *error); // defined in user program
...@@ -113,10 +112,7 @@ void Quit (char *error); // defined in user program ...@@ -113,10 +112,7 @@ void Quit (char *error); // defined in user program
#define MAXTICS 10 #define MAXTICS 10
#define DEMOTICS 4 #define DEMOTICS 4
#define UPDATETERMINATE 0x0301
extern unsigned mapwidth,mapheight,tics; extern unsigned mapwidth,mapheight,tics;
extern boolean compatability;
extern byte *updateptr; extern byte *updateptr;
extern unsigned uwidthtable[UPDATEHIGH]; extern unsigned uwidthtable[UPDATEHIGH];
......
...@@ -55,10 +55,8 @@ typedef enum ...@@ -55,10 +55,8 @@ typedef enum
gd_Hard gd_Hard
} GameDiff; } GameDiff;
// Hack import for TED launch support extern boolean tedlevel; /* TODO: rename or remove */
extern boolean tedlevel;
extern int tedlevelnum; extern int tedlevelnum;
extern void TEDDeath(void);
extern boolean ingame, // Set by game code if a game is in progress extern boolean ingame, // Set by game code if a game is in progress
abortgame, // Set if a game load failed abortgame, // Set if a game load failed
......
...@@ -177,19 +177,6 @@ US_Startup(void) ...@@ -177,19 +177,6 @@ US_Startup(void)
US_InitRndT(true); // Initialize the random number generator US_InitRndT(true); // Initialize the random number generator
for (i = 1;i < _argc;i++)
{
switch (US_CheckParm(_argv[i],ParmStrings2))
{
case 0:
compatability = true;
break;
case 1:
compatability = false;
break;
}
}
// Check for TED launching here // Check for TED launching here
for (i = 1;i < _argc;i++) for (i = 1;i < _argc;i++)
{ {
......
// ID_VH.C /* id_vh.c */
#include "id_heads.h" #include "id_heads.h"
#define SCREENWIDTH 80 #define PIXTOBLOCK 4 /* 16 pixels to an update block */
#define CHARWIDTH 2
#define TILEWIDTH 4
#define GRPLANES 4
#define BYTEPIXELS 4
#define SCREENXMASK (~3) /* ======================================================================== */
#define SCREENXPLUS (3)
#define SCREENXDIV (4)
#define VIEWWIDTH 80
#define PIXTOBLOCK 4 // 16 pixels to an update block
#define UNCACHEGRCHUNK(chunk) {MM_FreePtr(&grsegs[chunk]);grneeded[chunk]&=~ca_levelbit;}
byte update[UPDATEHIGH][UPDATEWIDE];
//==========================================================================
pictabletype _seg *pictable;
pictabletype *pictable;
int px,py; int px,py;
byte fontcolor,backcolor; byte fontcolor,backcolor;
int fontnumber; int fontnumber;
int bufferwidth,bufferheight; int bufferwidth, bufferheight;
//==========================================================================
void VWL_UpdateScreenBlocks (void);
//==========================================================================
void VW_DrawPropString (char far *string)
{
fontstruct far *font;
int width,step,height,i;
byte far *source, far *dest, far *origdest;
byte ch,mask;
font = (fontstruct far *)grsegs[STARTFONT+fontnumber];
height = bufferheight = font->height;
dest = origdest = MK_FP(SCREENSEG,bufferofs+ylookup[py]+(px>>2));
mask = 1<<(px&3);
while ((ch = *string++)!=0)
{
width = step = font->width[ch];
source = ((byte far *)font)+font->location[ch];
while (width--)
{
VGAMAPMASK(mask);
asm mov ah,[BYTE PTR fontcolor]
asm mov bx,[step]
asm mov cx,[height]
asm mov dx,[linewidth]
asm lds si,[source]
asm les di,[dest]
vertloop:
asm mov al,[si]
asm or al,al
asm je next
asm mov [es:di],ah // draw color
next:
asm add si,bx
asm add di,dx
asm loop vertloop
asm mov ax,ss
asm mov ds,ax
source++;
px++;
mask <<= 1;
if (mask == 16)
{
mask = 1;
dest++;
}
}
}
bufferheight = height;
bufferwidth = ((dest+1)-origdest)*4;
}
/* ======================================================================== */
void VW_DrawColorPropString (char far *string) void VW_DrawPropString(char *string)
{ {
fontstruct far *font; fontstruct *font;
int width,step,height,i; int width, step, height, i;
byte far *source, far *dest, far *origdest; byte *source, *dest, *origdest;
byte ch,mask; byte ch, mask;
font = (fontstruct far *)grsegs[STARTFONT+fontnumber]; font = (fontstruct *)grsegs[STARTFONT+fontnumber];
height = bufferheight = font->height; height = bufferheight = font->height;
dest = origdest = MK_FP(SCREENSEG,bufferofs+ylookup[py]+(px>>2)); dest = origdest = MK_FP(SCREENSEG,bufferofs+ylookup[py]+(px>>2));
mask = 1<<(px&3); mask = 1<<(px&3);
...@@ -109,7 +31,7 @@ void VW_DrawColorPropString (char far *string) ...@@ -109,7 +31,7 @@ void VW_DrawColorPropString (char far *string)
while ((ch = *string++)!=0) while ((ch = *string++)!=0)
{ {
width = step = font->width[ch]; width = step = font->width[ch];
source = ((byte far *)font)+font->location[ch]; source = ((byte *)font)+font->location[ch];
while (width--) while (width--)
{ {
VGAMAPMASK(mask); VGAMAPMASK(mask);
...@@ -130,13 +52,6 @@ asm mov [es:di],ah // draw color ...@@ -130,13 +52,6 @@ asm mov [es:di],ah // draw color
next: next:
asm add si,bx asm add si,bx
asm add di,dx asm add di,dx
asm rcr cx,1 // inc font color
asm jc cont
asm inc ah
cont:
asm rcl cx,1
asm loop vertloop asm loop vertloop
asm mov ax,ss asm mov ax,ss
asm mov ds,ax asm mov ds,ax
...@@ -155,10 +70,6 @@ bufferheight = height; ...@@ -155,10 +70,6 @@ bufferheight = height;
bufferwidth = ((dest+1)-origdest)*4; bufferwidth = ((dest+1)-origdest)*4;
} }
//==========================================================================
/* /*
================= =================
= =
...@@ -167,21 +78,21 @@ bufferwidth = ((dest+1)-origdest)*4; ...@@ -167,21 +78,21 @@ bufferwidth = ((dest+1)-origdest)*4;
================= =================
*/ */
void VL_MungePic (byte far *source, unsigned width, unsigned height) void VL_MungePic (byte *source, unsigned width, unsigned height)
{ {
unsigned x,y,plane,size,pwidth; unsigned x,y,plane,size,pwidth;
byte _seg *temp, far *dest, far *srcline; byte *temp, *dest, *srcline;
size = width*height; size = width*height;
if (width&3) if (width&3)
MS_Quit ("VL_MungePic: Not divisable by 4!"); Quit ("VL_MungePic: Not divisable by 4!");
// //
// copy the pic to a temp buffer // copy the pic to a temp buffer
// //
MM_GetPtr (&(memptr)temp,size); MM_GetPtr (&(memptr)temp,size);
_fmemcpy (temp,source,size); memcpy (temp,source,size);
// //
// munge it back into the original buffer // munge it back into the original buffer
...@@ -203,26 +114,19 @@ void VL_MungePic (byte far *source, unsigned width, unsigned height) ...@@ -203,26 +114,19 @@ void VL_MungePic (byte far *source, unsigned width, unsigned height)
MM_FreePtr (&(memptr)temp); MM_FreePtr (&(memptr)temp);
} }
void VWL_MeasureString (char far *string, word *width, word *height void VWL_MeasureString (char *string, word *width, word *height,
, fontstruct _seg *font) fontstruct *font)
{ {
*height = font->height; *height = font->height;
for (*width = 0;*string;string++) for (*width = 0;*string;string++)
*width += font->width[*((byte far *)string)]; // proportional width *width += font->width[*((byte *)string)]; // proportional width
} }
void VW_MeasurePropString (char far *string, word *width, word *height) void VW_MeasurePropString (char *string, word *width, word *height)
{ {
VWL_MeasureString(string,width,height,(fontstruct _seg *)grsegs[STARTFONT+fontnumber]); VWL_MeasureString(string,width,height,(fontstruct *)grsegs[STARTFONT+fontnumber]);
} }
void VW_MeasureMPropString (char far *string, word *width, word *height)
{
VWL_MeasureString(string,width,height,(fontstruct _seg *)grsegs[STARTFONTM+fontnumber]);
}
/* /*
============================================================================= =============================================================================
...@@ -294,13 +198,6 @@ void VWB_DrawTile8 (int x, int y, int tile) ...@@ -294,13 +198,6 @@ void VWB_DrawTile8 (int x, int y, int tile)
LatchDrawChar(x,y,tile); LatchDrawChar(x,y,tile);
} }
void VWB_DrawTile8M (int x, int y, int tile)
{
if (VW_MarkUpdateBlock (x,y,x+7,y+7))
VL_MemToScreen (((byte far *)grsegs[STARTTILE8M])+tile*64,8,8,x,y);
}
void VWB_DrawPic (int x, int y, int chunknum) void VWB_DrawPic (int x, int y, int chunknum)
{ {
int picnum = chunknum - STARTPICS; int picnum = chunknum - STARTPICS;
...@@ -315,9 +212,7 @@ void VWB_DrawPic (int x, int y, int chunknum) ...@@ -315,9 +212,7 @@ void VWB_DrawPic (int x, int y, int chunknum)
VL_MemToScreen (grsegs[chunknum],width,height,x,y); VL_MemToScreen (grsegs[chunknum],width,height,x,y);
} }
void VWB_DrawPropString(char *string)
void VWB_DrawPropString (char far *string)
{ {
int x; int x;
x=px; x=px;
...@@ -326,25 +221,25 @@ void VWB_DrawPropString (char far *string) ...@@ -326,25 +221,25 @@ void VWB_DrawPropString (char far *string)
} }
void VWB_Bar (int x, int y, int width, int height, int color) void VWB_Bar(int x, int y, int width, int height, int color)
{ {
if (VW_MarkUpdateBlock (x,y,x+width,y+height-1) ) if (VW_MarkUpdateBlock (x,y,x+width,y+height-1) )
VW_Bar (x,y,width,height,color); VW_Bar (x,y,width,height,color);
} }
void VWB_Plot (int x, int y, int color) void VWB_Plot(int x, int y, int color)
{ {
if (VW_MarkUpdateBlock (x,y,x,y)) if (VW_MarkUpdateBlock (x,y,x,y))
VW_Plot(x,y,color); VW_Plot(x,y,color);
} }
void VWB_Hlin (int x1, int x2, int y, int color) void VWB_Hlin(int x1, int x2, int y, int color)
{ {
if (VW_MarkUpdateBlock (x1,y,x2,y)) if (VW_MarkUpdateBlock (x1,y,x2,y))
VW_Hlin(x1,x2,y,color); VW_Hlin(x1,x2,y,color);
} }
void VWB_Vlin (int y1, int y2, int x, int color) void VWB_Vlin(int y1, int y2, int x, int color)
{ {
if (VW_MarkUpdateBlock (x,y1,x,y2)) if (VW_MarkUpdateBlock (x,y1,x,y2))
VW_Vlin(y1,y2,x,color); VW_Vlin(y1,y2,x,color);
...@@ -355,7 +250,6 @@ void VW_UpdateScreen (void) ...@@ -355,7 +250,6 @@ void VW_UpdateScreen (void)
VH_UpdateScreen (); VH_UpdateScreen ();
} }
/* /*
============================================================================= =============================================================================
...@@ -383,8 +277,7 @@ void LatchDrawPic (unsigned x, unsigned y, unsigned picnum) ...@@ -383,8 +277,7 @@ void LatchDrawPic (unsigned x, unsigned y, unsigned picnum)
VL_LatchToScreen (source,wide/4,height,x*8,y); VL_LatchToScreen (source,wide/4,height,x*8,y);
} }
/* ======================================================================== */
//==========================================================================
/* /*
=================== ===================
...@@ -397,15 +290,15 @@ void LatchDrawPic (unsigned x, unsigned y, unsigned picnum) ...@@ -397,15 +290,15 @@ void LatchDrawPic (unsigned x, unsigned y, unsigned picnum)
void LoadLatchMem (void) void LoadLatchMem (void)
{ {
int i,j,p,m,width,height,start,end; int i,j,p,m,width,height,start,end;
byte far *src; byte *src;
unsigned destoff; unsigned destoff;
// /*
// tile 8s tile 8s
// */
latchpics[0] = freelatch; latchpics[0] = freelatch;
CA_CacheGrChunk (STARTTILE8); CA_CacheGrChunk (STARTTILE8);
src = (byte _seg *)grsegs[STARTTILE8]; src = (byte *)grsegs[STARTTILE8];
destoff = freelatch; destoff = freelatch;
for (i=0;i<NUMTILE8;i++) for (i=0;i<NUMTILE8;i++)
...@@ -416,17 +309,17 @@ void LoadLatchMem (void) ...@@ -416,17 +309,17 @@ void LoadLatchMem (void)
} }
UNCACHEGRCHUNK (STARTTILE8); UNCACHEGRCHUNK (STARTTILE8);
#if 0 // ran out of latch space! #if 0 /* ran out of latch space! */
// /*
// tile 16s tile 16s
// */
src = (byte _seg *)grsegs[STARTTILE16]; src = (byte *)grsegs[STARTTILE16];
latchpics[1] = destoff; latchpics[1] = destoff;
for (i=0;i<NUMTILE16;i++) for (i=0;i<NUMTILE16;i++)
{ {
CA_CacheGrChunk (STARTTILE16+i); CA_CacheGrChunk (STARTTILE16+i);
src = (byte _seg *)grsegs[STARTTILE16+i]; src = (byte *)grsegs[STARTTILE16+i];
VL_MemToLatch (src,16,16,destoff); VL_MemToLatch (src,16,16,destoff);
destoff+=64; destoff+=64;
if (src) if (src)
...@@ -434,9 +327,9 @@ void LoadLatchMem (void) ...@@ -434,9 +327,9 @@ void LoadLatchMem (void)
} }
#endif #endif
// /*
// pics pics
// */
start = LATCHPICS_LUMP_START; start = LATCHPICS_LUMP_START;
end = LATCHPICS_LUMP_END; end = LATCHPICS_LUMP_END;
...@@ -451,10 +344,10 @@ void LoadLatchMem (void) ...@@ -451,10 +344,10 @@ void LoadLatchMem (void)
UNCACHEGRCHUNK(i); UNCACHEGRCHUNK(i);
} }
EGAMAPMASK(15); VGAMAPMASK(15);
} }
//========================================================================== /* ======================================================================== */
/* /*
=================== ===================
...@@ -466,8 +359,6 @@ void LoadLatchMem (void) ...@@ -466,8 +359,6 @@ void LoadLatchMem (void)
=================== ===================
*/ */
extern ControlInfo c;
boolean FizzleFade (unsigned source, unsigned dest, boolean FizzleFade (unsigned source, unsigned dest,
unsigned width,unsigned height, unsigned frames, boolean abortable) unsigned width,unsigned height, unsigned frames, boolean abortable)
{ {
...@@ -542,6 +433,4 @@ noxor: ...@@ -542,6 +433,4 @@ noxor:
while (TimeCount<frame) // don't go too fast while (TimeCount<frame) // don't go too fast
; ;
} while (1); } while (1);
} }
// ID_VH.H #ifndef __ID_VH_H__
#define __ID_VH_H__
#define WHITE 15
#define WHITE 15 // graphics mode independant colors
#define BLACK 0 #define BLACK 0
#define FIRSTCOLOR 1
#define SECONDCOLOR 12
#define F_WHITE 15
#define F_BLACK 0
#define F_FIRSTCOLOR 1
#define F_SECONDCOLOR 12
//===========================================================================
#define MAXSHIFTS 1
typedef struct
{
int width,
height,
orgx,orgy,
xl,yl,xh,yh,
shifts;
} spritetabletype;
typedef struct /* ======================================================================== */
{
unsigned sourceoffset[MAXSHIFTS];
unsigned planesize[MAXSHIFTS];
unsigned width[MAXSHIFTS];
byte data[];
} spritetype; // the memptr for each sprite points to this
typedef struct typedef struct
{ {
int width,height; int width, height;
} pictabletype; } pictabletype;
typedef struct typedef struct
{ {
int height; int height;
...@@ -44,13 +18,9 @@ typedef struct ...@@ -44,13 +18,9 @@ typedef struct
char width[256]; char width[256];
} fontstruct; } fontstruct;
/* ======================================================================== */
//=========================================================================== extern pictabletype *pictable;
extern pictabletype _seg *pictable;
extern pictabletype _seg *picmtable;
extern spritetabletype _seg *spritetable;
extern byte fontcolor; extern byte fontcolor;
extern int fontnumber; extern int fontnumber;
...@@ -60,7 +30,6 @@ extern int px,py; ...@@ -60,7 +30,6 @@ extern int px,py;
// Double buffer management routines // Double buffer management routines
// //
void VW_InitDoubleBuffer (void);
int VW_MarkUpdateBlock (int x1, int y1, int x2, int y2); int VW_MarkUpdateBlock (int x1, int y1, int x2, int y2);
void VW_UpdateScreen (void); void VW_UpdateScreen (void);
...@@ -70,54 +39,30 @@ void VW_UpdateScreen (void); ...@@ -70,54 +39,30 @@ void VW_UpdateScreen (void);
// regions marked in double buffer // regions marked in double buffer
// //
void VWB_DrawTile8 (int x, int y, int tile); void VWB_DrawTile8(int x, int y, int tile);
void VWB_DrawTile8M (int x, int y, int tile); void VWB_DrawPic(int x, int y, int chunknum);
void VWB_DrawTile16 (int x, int y, int tile); void VWB_Bar(int x, int y, int width, int height, int color);
void VWB_DrawTile16M (int x, int y, int tile);
void VWB_DrawPic (int x, int y, int chunknum);
void VWB_DrawMPic(int x, int y, int chunknum);
void VWB_Bar (int x, int y, int width, int height, int color);
void VWB_DrawPropString (char far *string);
void VWB_DrawMPropString (char far *string);
void VWB_DrawSprite (int x, int y, int chunknum);
void VWB_Plot (int x, int y, int color);
void VWB_Hlin (int x1, int x2, int y, int color);
void VWB_Vlin (int y1, int y2, int x, int color);
// void VWB_DrawPropString(char *string);
// wolfenstein EGA compatability stuff void VWB_Plot(int x, int y, int color);
// void VWB_Hlin(int x1, int x2, int y, int color);
extern byte far gamepal; void VWB_Vlin(int y1, int y2, int x, int color);
void VH_SetDefaultColors (void); extern byte gamepal;
#define VW_Startup VL_Startup #define VW_Startup VL_Startup
#define VW_Shutdown VL_Shutdown #define VW_Shutdown VL_Shutdown
#define VW_SetCRTC VL_SetCRTC
#define VW_SetScreen VL_SetScreen #define VW_SetScreen VL_SetScreen
#define VW_Bar VL_Bar #define VW_Bar VL_Bar
#define VW_Plot VL_Plot #define VW_Plot VL_Plot
#define VW_Hlin(x,z,y,c) VL_Hlin(x,y,(z)-(x)+1,c) #define VW_Hlin(x,z,y,c) VL_Hlin(x,y,(z)-(x)+1,c)
#define VW_Vlin(y,z,x,c) VL_Vlin(x,y,(z)-(y)+1,c) #define VW_Vlin(y,z,x,c) VL_Vlin(x,y,(z)-(y)+1,c)
#define VW_DrawPic VH_DrawPic
#define VW_SetSplitScreen VL_SetSplitScreen
#define VW_SetLineWidth VL_SetLineWidth
#define VW_ColorBorder VL_ColorBorder #define VW_ColorBorder VL_ColorBorder
#define VW_WaitVBL VL_WaitVBL #define VW_WaitVBL VL_WaitVBL
#define VW_FadeIn() VL_FadeIn(0,255,&gamepal,30); #define VW_FadeIn() VL_FadeIn(0,255,&gamepal,30);
#define VW_FadeOut() VL_FadeOut(0,255,0,0,0,30); #define VW_FadeOut() VL_FadeOut(0,255,0,0,0,30);
#define VW_ScreenToScreen VL_ScreenToScreen #define VW_ScreenToScreen VL_ScreenToScreen
#define VW_SetDefaultColors VH_SetDefaultColors void VW_MeasurePropString(char *string, word *width, word *height);
void VW_MeasurePropString (char far *string, word *width, word *height);
#define EGAMAPMASK(x) VGAMAPMASK(x)
#define EGAWRITEMODE(x) VGAWRITEMODE(x)
//#define VW_MemToScreen VL_MemToLatch
#define MS_Quit Quit
#define LatchDrawChar(x,y,p) VL_LatchToScreen(latchpics[0]+(p)*16,2,8,x,y) #define LatchDrawChar(x,y,p) VL_LatchToScreen(latchpics[0]+(p)*16,2,8,x,y)
#define LatchDrawTile(x,y,p) VL_LatchToScreen(latchpics[1]+(p)*64,4,16,x,y) #define LatchDrawTile(x,y,p) VL_LatchToScreen(latchpics[1]+(p)*64,4,16,x,y)
...@@ -127,8 +72,10 @@ void LoadLatchMem (void); ...@@ -127,8 +72,10 @@ void LoadLatchMem (void);
boolean FizzleFade (unsigned source, unsigned dest, boolean FizzleFade (unsigned source, unsigned dest,
unsigned width,unsigned height, unsigned frames,boolean abortable); unsigned width,unsigned height, unsigned frames,boolean abortable);
#define NUMLATCHPICS 100 #define NUMLATCHPICS 100
extern unsigned latchpics[NUMLATCHPICS]; extern unsigned latchpics[NUMLATCHPICS];
extern unsigned freelatch; extern unsigned freelatch;
#elif
#error "fix me: TODO"
#endif
// ID_VL.C /* id_vl.c */
#include <dos.h> #include <dos.h>
#include <alloc.h> #include <alloc.h>
#include <mem.h> #include <mem.h>
#include <string.h> #include <string.h>
#include "id_heads.h" #include "id_heads.h"
#include "id_vl.h"
#pragma hdrstop
// //
// SC_INDEX is expected to stay at SC_MAPMASK for proper operation // SC_INDEX is expected to stay at SC_MAPMASK for proper operation
// //
unsigned bufferofs; unsigned bufferofs;
unsigned displayofs,pelpan; unsigned displayofs;
unsigned screenseg=SCREENSEG; // set to 0xa000 for asm convenience unsigned screenseg=SCREENSEG; // set to 0xa000 for asm convenience
...@@ -25,39 +23,16 @@ unsigned bordercolor; ...@@ -25,39 +23,16 @@ unsigned bordercolor;
boolean fastpalette; // if true, use outsb to set boolean fastpalette; // if true, use outsb to set
byte far palette1[256][3],far palette2[256][3]; byte palette1[256][3],far palette2[256][3];
//=========================================================================== //===========================================================================
// asm
int VL_VideoID (void); int VL_VideoID (void);
void VL_SetCRTC (int crtc); void VL_SetCRTC (int crtc);
void VL_SetScreen (int crtc, int pelpan);
void VL_WaitVBL (int vbls); void VL_WaitVBL (int vbls);
//=========================================================================== //===========================================================================
/*
=======================
=
= VL_Startup
=
=======================
*/
#if 0
void VL_Startup (void)
{
if ( !MS_CheckParm ("HIDDENCARD") && VL_VideoID () != 5)
MS_Quit ("You need a VGA graphics card to run this!");
asm cld; // all string instructions assume forward
}
#endif
/* /*
======================= =======================
= =
...@@ -88,8 +63,6 @@ Quit ("Improper video card! If you really have a VGA card that I am not \n" ...@@ -88,8 +63,6 @@ Quit ("Improper video card! If you really have a VGA card that I am not \n"
} }
/* /*
======================= =======================
= =
...@@ -589,7 +562,6 @@ byte pixmasks[4] = {1,2,4,8}; ...@@ -589,7 +562,6 @@ byte pixmasks[4] = {1,2,4,8};
byte leftmasks[4] = {15,14,12,8}; byte leftmasks[4] = {15,14,12,8};
byte rightmasks[4] = {1,3,7,15}; byte rightmasks[4] = {1,3,7,15};
/* /*
================= =================
= =
...@@ -608,7 +580,6 @@ void VL_Plot (int x, int y, int color) ...@@ -608,7 +580,6 @@ void VL_Plot (int x, int y, int color)
VGAMAPMASK(15); VGAMAPMASK(15);
} }
/* /*
================= =================
= =
...@@ -806,49 +777,11 @@ void VL_MemToScreen (byte far *source, int width, int height, int x, int y) ...@@ -806,49 +777,11 @@ void VL_MemToScreen (byte far *source, int width, int height, int x, int y)
screen = dest; screen = dest;
for (y=0;y<height;y++,screen+=linewidth,source+=width) for (y=0;y<height;y++,screen+=linewidth,source+=width)
_fmemcpy (screen,source,width); memcpy (screen,source,width);
}
}
//==========================================================================
/*
=================
=
= VL_MaskedToScreen
=
= Masks a block of main memory to the screen.
=
=================
*/
void VL_MaskedToScreen (byte far *source, int width, int height, int x, int y)
{
byte far *screen,far *dest,mask;
byte far *maskptr;
int plane;
width>>=2;
dest = MK_FP(SCREENSEG,bufferofs+ylookup[y]+(x>>2) );
// mask = 1 << (x&3);
// maskptr = source;
for (plane = 0; plane<4; plane++)
{
VGAMAPMASK(mask);
mask <<= 1;
if (mask == 16)
mask = 1;
screen = dest;
for (y=0;y<height;y++,screen+=linewidth,source+=width)
_fmemcpy (screen,source,width);
} }
} }
//========================================================================== /* ======================================================================== */
/* /*
================= =================
...@@ -893,8 +826,7 @@ asm mov ds,ax ...@@ -893,8 +826,7 @@ asm mov ds,ax
VGAWRITEMODE(0); VGAWRITEMODE(0);
} }
/* ======================================================================== */
//===========================================================================
#if 0 #if 0
...@@ -935,150 +867,4 @@ asm mov ds,ax ...@@ -935,150 +867,4 @@ asm mov ds,ax
VGAWRITEMODE(0); VGAWRITEMODE(0);
} }
#endif #endif
/*
=============================================================================
STRING OUTPUT ROUTINES
=============================================================================
*/
/*
===================
=
= VL_DrawTile8String
=
===================
*/
void VL_DrawTile8String (char *str, char far *tile8ptr, int printx, int printy)
{
int i;
unsigned far *dest,far *screen,far *src;
dest = MK_FP(SCREENSEG,bufferofs+ylookup[printy]+(printx>>2));
while (*str)
{
src = (unsigned far *)(tile8ptr + (*str<<6));
// each character is 64 bytes
VGAMAPMASK(1);
screen = dest;
for (i=0;i<8;i++,screen+=linewidth)
*screen = *src++;
VGAMAPMASK(2);
screen = dest;
for (i=0;i<8;i++,screen+=linewidth)
*screen = *src++;
VGAMAPMASK(4);
screen = dest;
for (i=0;i<8;i++,screen+=linewidth)
*screen = *src++;
VGAMAPMASK(8);
screen = dest;
for (i=0;i<8;i++,screen+=linewidth)
*screen = *src++;
str++;
printx += 8;
dest+=2;
}
}
/*
===================
=
= VL_DrawLatch8String
=
===================
*/
void VL_DrawLatch8String (char *str, unsigned tile8ptr, int printx, int printy)
{
int i;
unsigned src,dest;
dest = bufferofs+ylookup[printy]+(printx>>2);
VGAWRITEMODE(1);
VGAMAPMASK(15);
while (*str)
{
src = tile8ptr + (*str<<4); // each character is 16 latch bytes
asm mov si,[src]
asm mov di,[dest]
asm mov dx,[linewidth]
asm mov ax,SCREENSEG
asm mov ds,ax
asm lodsw
asm mov [di],ax
asm add di,dx
asm lodsw
asm mov [di],ax
asm add di,dx
asm lodsw
asm mov [di],ax
asm add di,dx
asm lodsw
asm mov [di],ax
asm add di,dx
asm lodsw
asm mov [di],ax
asm add di,dx
asm lodsw
asm mov [di],ax
asm add di,dx
asm lodsw
asm mov [di],ax
asm add di,dx
asm lodsw
asm mov [di],ax
asm add di,dx
asm mov ax,ss
asm mov ds,ax
str++;
printx += 8;
dest+=2;
}
VGAWRITEMODE(0);
}
/*
===================
=
= VL_SizeTile8String
=
===================
*/
void VL_SizeTile8String (char *str, int *width, int *height)
{
*height = 8;
*width = 8*strlen(str);
}
// ID_VL.H // ID_VL.H
// wolf compatability
#define MS_Quit Quit
void Quit (char *error);
//=========================================================================== //===========================================================================
...@@ -82,7 +76,7 @@ void Quit (char *error); ...@@ -82,7 +76,7 @@ void Quit (char *error);
//=========================================================================== //===========================================================================
extern unsigned bufferofs; // all drawing is reletive to this extern unsigned bufferofs; // all drawing is reletive to this
extern unsigned displayofs,pelpan; // last setscreen coordinates extern unsigned displayofs; // last setscreen coordinates
extern unsigned screenseg; // set to 0xa000 for asm convenience extern unsigned screenseg; // set to 0xa000 for asm convenience
...@@ -149,11 +143,7 @@ void VL_DrawPicBare (int x, int y, byte far *pic, int width, int height); ...@@ -149,11 +143,7 @@ void VL_DrawPicBare (int x, int y, byte far *pic, int width, int height);
void VL_MemToLatch (byte far *source, int width, int height, unsigned dest); void VL_MemToLatch (byte far *source, int width, int height, unsigned dest);
void VL_ScreenToScreen (unsigned source, unsigned dest,int width, int height); void VL_ScreenToScreen (unsigned source, unsigned dest,int width, int height);
void VL_MemToScreen (byte far *source, int width, int height, int x, int y); void VL_MemToScreen (byte far *source, int width, int height, int x, int y);
void VL_MaskedToScreen (byte far *source, int width, int height, int x, int y);
void VL_DrawTile8String (char *str, char far *tile8ptr, int printx, int printy);
void VL_DrawLatch8String (char *str, unsigned tile8ptr, int printx, int printy);
void VL_SizeTile8String (char *str, int *width, int *height);
void VL_DrawPropString (char *str, unsigned tile8ptr, int printx, int printy); void VL_DrawPropString (char *str, unsigned tile8ptr, int printx, int printy);
void VL_SizePropString (char *str, int *width, int *height, char far *font); void VL_SizePropString (char *str, int *width, int *height, char far *font);
......
/*
=================
=
= VL_MungePic
=
=================
*/
void VL_MungePic (unsigned char far *source, unsigned width, unsigned height)
{
unsigned x,y,plane,size,pwidth;
unsigned char far *temp, far *dest, far *srcline;
size = width*height;
if (width&3)
errout ("VL_MungePic: Not divisable by 4!\n");
//
// copy the pic to a temp buffer
//
temp = (unsigned char far *)farmalloc (size);
if (!temp)
errout ("Non enough memory for munge buffer!\n");
_fmemcpy (temp,source,size);
//
// munge it back into the original buffer
//
dest = source;
pwidth = width/4;
for (plane=0;plane<4;plane++)
{
srcline = temp;
for (y=0;y<height;y++)
{
for (x=0;x<pwidth;x++)
*dest++ = *(srcline+x*4+plane);
srcline+=width;
}
}
free (temp);
}
"This game is shareware.\n"
"Share it with everyone.\n"
"Thanks.\n\n"
" Id Software\n"
"This game is NOT shareware.\n"
"Please do not distribute it.\n"
"Thanks.\n\n"
" Id Software\n"
...@@ -56,7 +56,6 @@ void DebugMemory (void) ...@@ -56,7 +56,6 @@ void DebugMemory (void)
int i; int i;
char scratch[80],str[10]; char scratch[80],str[10];
long mem; long mem;
spritetype _seg *block;
CenterWindow (16,7); CenterWindow (16,7);
......
...@@ -83,10 +83,6 @@ ...@@ -83,10 +83,6 @@
#define PLAYERSIZE MINDIST // player radius #define PLAYERSIZE MINDIST // player radius
#define MINACTORDIST 0x10000l // minimum dist from player center #define MINACTORDIST 0x10000l // minimum dist from player center
// to any actor center // to any actor center
#define NUMLATCHPICS 100
#define PI 3.141592657 #define PI 3.141592657
#define GLOBAL1 (1l<<16) #define GLOBAL1 (1l<<16)
...@@ -793,8 +789,6 @@ extern char configname[13]; ...@@ -793,8 +789,6 @@ extern char configname[13];
void HelpScreens (void); void HelpScreens (void);
void OrderingInfo (void); void OrderingInfo (void);
void TEDDeath(void);
void Quit (char *error);
void CalcProjection (long focal); void CalcProjection (long focal);
boolean SetViewSize (unsigned width, unsigned height); boolean SetViewSize (unsigned width, unsigned height);
void NewGame (int difficulty,int episode); void NewGame (int difficulty,int episode);
...@@ -815,7 +809,6 @@ void ShutdownId (void); ...@@ -815,7 +809,6 @@ void ShutdownId (void);
extern boolean ingame,fizzlein; extern boolean ingame,fizzlein;
extern unsigned latchpics[NUMLATCHPICS];
extern gametype gamestate; extern gametype gamestate;
extern int doornum; extern int doornum;
...@@ -959,7 +952,6 @@ void PicturePause (void); ...@@ -959,7 +952,6 @@ void PicturePause (void);
*/ */
extern unsigned screenloc[3]; extern unsigned screenloc[3];
extern unsigned freelatch;
extern long lasttimecount; extern long lasttimecount;
extern long frameon; extern long frameon;
......
...@@ -978,7 +978,7 @@ boolean PreloadUpdate(unsigned current, unsigned total) ...@@ -978,7 +978,7 @@ boolean PreloadUpdate(unsigned current, unsigned total)
w = ((long)w * current) / total; w = ((long)w * current) / total;
if (w) if (w)
{ {
VWB_Bar(WindowX + 5,WindowY + WindowH - 3,w,2,0x37); //SECONDCOLOR); VWB_Bar(WindowX + 5,WindowY + WindowH - 3,w,2,0x37);
VWB_Bar(WindowX + 5,WindowY + WindowH - 3,w-1,1,0x32); VWB_Bar(WindowX + 5,WindowY + WindowH - 3,w-1,1,0x32);
} }
......
// WL_MAIN.C /* wl_main.c */
#include <conio.h> #include <conio.h>
#include "wl_def.h" #include "wl_def.h"
#pragma hdrstop
/* /*
...@@ -29,9 +28,6 @@ ...@@ -29,9 +28,6 @@
#define FOCALLENGTH (0x5700l) // in global coordinates #define FOCALLENGTH (0x5700l) // in global coordinates
#define VIEWGLOBAL 0x10000 // globals visable flush to wall #define VIEWGLOBAL 0x10000 // globals visable flush to wall
#define VIEWWIDTH 256 // size of view window
#define VIEWHEIGHT 144
/* /*
============================================================================= =============================================================================
...@@ -932,7 +928,6 @@ void InitDigiMap (void) ...@@ -932,7 +928,6 @@ void InitDigiMap (void)
} }
#ifndef SPEAR #ifndef SPEAR
CP_iteminfo MusicItems={CTL_X,CTL_Y,6,0,32}; CP_iteminfo MusicItems={CTL_X,CTL_Y,6,0,32};
CP_itemtype far MusicMenu[]= CP_itemtype far MusicMenu[]=
...@@ -1544,8 +1539,6 @@ void DemoLoop (void) ...@@ -1544,8 +1539,6 @@ void DemoLoop (void)
========================== ==========================
*/ */
char *nosprtxt[] = {"nospr", nil};
void main (void) void main (void)
{ {
int i; int i;
......
...@@ -45,7 +45,6 @@ objtype *actorat[MAPSIZE][MAPSIZE]; ...@@ -45,7 +45,6 @@ objtype *actorat[MAPSIZE][MAPSIZE];
// replacing refresh manager // replacing refresh manager
// //
unsigned mapwidth,mapheight,tics; unsigned mapwidth,mapheight,tics;
boolean compatability;
byte *updateptr; byte *updateptr;
unsigned mapwidthtable[64]; unsigned mapwidthtable[64];
unsigned uwidthtable[UPDATEHIGH]; unsigned uwidthtable[UPDATEHIGH];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment