Commit 0d5404c8 authored by Steven Fuller's avatar Steven Fuller

More outdated code removal

parent 646cf19b
......@@ -9,11 +9,9 @@ word WindowX,WindowY,WindowW,WindowH;
// Internal variables
static char *ParmStrings[] = {"TEDLEVEL","NOWAIT"};
static char *ParmStrings[] = {"nowait"};
static boolean US_Started;
int CursorX,CursorY;
void (*USL_MeasureString)(char *,word *,word *) = VW_MeasurePropString,
(*USL_DrawString)(char *) = VWB_DrawPropString;
......@@ -43,19 +41,12 @@ void US_Startup(void)
US_InitRndT(true); // Initialize the random number generator
// Check for TED launching here
for (i = 1;i < _argc;i++)
{
n = US_CheckParm(_argv[i],ParmStrings);
switch(n)
{
case 0:
tedlevelnum = atoi(_argv[i + 1]);
if (tedlevelnum >= 0)
tedlevel = true;
break;
case 1:
NoWait = true;
break;
}
......@@ -217,8 +208,7 @@ void US_PrintCentered(char *s)
// advances to the next line. Newlines are not supported.
//
///////////////////////////////////////////////////////////////////////////
void
US_CPrintLine(char *s)
void US_CPrintLine(char *s)
{
word w,h;
......@@ -238,8 +228,7 @@ US_CPrintLine(char *s)
// supported.
//
///////////////////////////////////////////////////////////////////////////
void
US_CPrint(char *s)
void US_CPrint(char *s)
{
char c, *se;
......@@ -267,8 +256,7 @@ US_CPrint(char *s)
// cursor
//
///////////////////////////////////////////////////////////////////////////
void
US_ClearWindow(void)
void US_ClearWindow(void)
{
VWB_Bar(WindowX,WindowY,WindowW,WindowH,WHITE);
PrintX = WindowX;
......@@ -529,3 +517,43 @@ boolean US_LineInput(int x,int y,char *buf,char *def,boolean escok,
IN_ClearKeysDown();
return(result);
}
int rndtable[] ={
0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 140, 16, 66,
74, 21, 211, 47, 80, 242, 154, 27, 205, 128, 161, 89, 77, 36,
95, 110, 85, 48, 212, 140, 211, 249, 22, 79, 200, 50, 28, 188,
52, 140, 202, 120, 68, 145, 62, 70, 184, 190, 91, 197, 152, 224,
149, 104, 25, 178, 252, 182, 202, 182, 141, 197, 4, 81, 181, 242,
145, 42, 39, 227, 156, 198, 225, 193, 219, 93, 122, 175, 249, 0,
175, 143, 70, 239, 46, 246, 163, 53, 163, 109, 168, 135, 2, 235,
25, 92, 20, 145, 138, 77, 69, 166, 78, 176, 173, 212, 166, 113,
94, 161, 41, 50, 239, 49, 111, 164, 70, 60, 2, 37, 171, 75,
136, 156, 11, 56, 42, 146, 138, 229, 73, 146, 77, 61, 98, 196,
135, 106, 63, 197, 195, 86, 96, 203, 113, 101, 170, 247, 181, 113,
80, 250, 108, 7, 255, 237, 129, 226, 79, 107, 112, 166, 103, 241,
24, 223, 239, 120, 198, 58, 60, 82, 128, 3, 184, 66, 143, 224,
145, 224, 81, 206, 163, 45, 63, 90, 168, 114, 59, 33, 159, 95,
28, 139, 123, 98, 125, 196, 15, 70, 194, 253, 54, 14, 109, 226,
71, 17, 161, 93, 186, 87, 244, 138, 20, 52, 123, 251, 26, 36,
17, 46, 52, 231, 232, 76, 31, 221, 84, 37, 216, 165, 212, 106,
197, 242, 98, 43, 39, 175, 254, 145, 190, 84, 118, 222, 187, 136,
120, 163, 236, 249
};
static int rndindex = 0;
void US_InitRndT(boolean randomize)
{
if (randomize)
rndindex = time(NULL) & 0xFF;
else
rndindex = 0;
}
int US_RndT()
{
rndindex++;
rndindex &= 0xFF;
return rndtable[rndindex];
}
......@@ -22,9 +22,6 @@ typedef struct
px,py;
} WindowRec; // Record used to save & restore screen windows
extern boolean tedlevel; /* TODO: rename or remove */
extern int tedlevelnum;
extern boolean ingame, // Set by game code if a game is in progress
abortgame, // Set if a game load failed
loadedgame, // Set if the current game was loaded
......@@ -33,8 +30,6 @@ extern word PrintX,PrintY; // Current printing location in the window
extern word WindowX,WindowY,// Current location of window
WindowW,WindowH;// Current size of window
extern int CursorX,CursorY;
extern void (*USL_MeasureString)(char *,word *,word *),
(*USL_DrawString)(char *);
......
IDEAL
MODEL MEDIUM,C
; Assembly portion of the User Mgr. This is just John Carmack's table
; driven pseudo-random number generator, and we put it in the User Mgr
; because we couldn't figure out where it should go
;============================================================================
;
; RANDOM ROUTINES
;
;============================================================================
FARDATA
rndindex dw ?
rndtable db 0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 140, 16, 66
db 74, 21, 211, 47, 80, 242, 154, 27, 205, 128, 161, 89, 77, 36
db 95, 110, 85, 48, 212, 140, 211, 249, 22, 79, 200, 50, 28, 188
db 52, 140, 202, 120, 68, 145, 62, 70, 184, 190, 91, 197, 152, 224
db 149, 104, 25, 178, 252, 182, 202, 182, 141, 197, 4, 81, 181, 242
db 145, 42, 39, 227, 156, 198, 225, 193, 219, 93, 122, 175, 249, 0
db 175, 143, 70, 239, 46, 246, 163, 53, 163, 109, 168, 135, 2, 235
db 25, 92, 20, 145, 138, 77, 69, 166, 78, 176, 173, 212, 166, 113
db 94, 161, 41, 50, 239, 49, 111, 164, 70, 60, 2, 37, 171, 75
db 136, 156, 11, 56, 42, 146, 138, 229, 73, 146, 77, 61, 98, 196
db 135, 106, 63, 197, 195, 86, 96, 203, 113, 101, 170, 247, 181, 113
db 80, 250, 108, 7, 255, 237, 129, 226, 79, 107, 112, 166, 103, 241
db 24, 223, 239, 120, 198, 58, 60, 82, 128, 3, 184, 66, 143, 224
db 145, 224, 81, 206, 163, 45, 63, 90, 168, 114, 59, 33, 159, 95
db 28, 139, 123, 98, 125, 196, 15, 70, 194, 253, 54, 14, 109, 226
db 71, 17, 161, 93, 186, 87, 244, 138, 20, 52, 123, 251, 26, 36
db 17, 46, 52, 231, 232, 76, 31, 221, 84, 37, 216, 165, 212, 106
db 197, 242, 98, 43, 39, 175, 254, 145, 190, 84, 118, 222, 187, 136
db 120, 163, 236, 249
PUBLIC rndtable
CODESEG
LastRnd dw ?
;=================================================
;
; void US_InitRndT (boolean randomize)
; Init table based RND generator
; if randomize is false, the counter is set to 0
;
;=================================================
PROC US_InitRndT randomize:word
uses si,di
public US_InitRndT
mov ax,SEG rndtable
mov es,ax
mov ax,[randomize]
or ax,ax
jne @@timeit ;if randomize is true, really random
mov dx,0 ;set to a definite value
jmp @@setit
@@timeit:
mov ah,2ch
int 21h ;GetSystemTime
and dx,0ffh
@@setit:
mov [es:rndindex],dx
ret
ENDP
;=================================================
;
; int US_RndT (void)
; Return a random # between 0-255
; Exit : AX = value
;
;=================================================
PROC US_RndT
public US_RndT
mov ax,SEG rndtable
mov es,ax
mov bx,[es:rndindex]
inc bx
and bx,0ffh
mov [es:rndindex],bx
mov al,[es:rndtable+BX]
xor ah,ah
ret
ENDP
END
......@@ -3673,7 +3673,7 @@ void T_BJRun (objtype *ob)
===============
*/
void T_BJJump (objtype *ob)
void T_BJJump(objtype *ob)
{
long move;
......@@ -3690,9 +3690,9 @@ void T_BJJump (objtype *ob)
===============
*/
void T_BJYell (objtype *ob)
void T_BJYell(objtype *ob)
{
PlaySoundLocActor(YEAHSND,ob); // JAB
PlaySoundLocActor(YEAHSND, ob);
}
......
......@@ -30,7 +30,6 @@
//
// player state info
//
boolean running;
long thrustspeed;
unsigned plux,pluy; // player coordinates scaled to unsigned
......@@ -241,19 +240,12 @@ void ControlMovement (objtype *ob)
void StatusDrawPic (unsigned x, unsigned y, unsigned picnum)
{
unsigned temp;
temp = bufferofs;
bufferofs = 0;
bufferofs = PAGE1START+(200-STATUSLINES)*SCREENWIDTH;
/* TODO hmm */
LatchDrawPic (x,y,picnum);
bufferofs = PAGE2START+(200-STATUSLINES)*SCREENWIDTH;
/*
LatchDrawPic (x,y,picnum);
bufferofs = PAGE3START+(200-STATUSLINES)*SCREENWIDTH;
LatchDrawPic (x,y,picnum);
bufferofs = temp;
*/
}
......
......@@ -389,8 +389,6 @@ int DebugKeys (void)
if (Keyboard[sc_E]) // E = quit level
{
if (tedlevel)
Quit (NULL);
playstate = ex_completed;
// gamestate.mapon++;
}
......
......@@ -91,12 +91,6 @@
#define STATUSLINES 40
#define SCREENSIZE (SCREENBWIDE*208)
#define PAGE1START 0
#define PAGE2START (SCREENSIZE)
#define PAGE3START (SCREENSIZE*2u)
#define FREESTART (SCREENSIZE*3u)
#define STARTAMMO 8
// object flag values
......@@ -577,7 +571,7 @@ typedef struct statstruct
{
byte tilex,tiley;
byte *visspot;
int shapenum; // if shapenum == -1 the obj has been removed
int shapenum; /* if shapenum == -1 the obj has been removed */
byte flags;
byte itemnumber;
} statobj_t;
......@@ -610,25 +604,25 @@ typedef struct objstruct
classtype obclass;
statetype *state;
byte flags; // FL_SHOOTABLE, etc
byte flags; /* FL_SHOOTABLE, etc */
long distance; // if negative, wait for that door to open
long distance; /* if negative, wait for that door to open */
dirtype dir;
fixed x,y;
unsigned tilex,tiley;
byte areanumber;
int viewx;
int viewx;
unsigned viewheight;
fixed transx,transy; // in global coord
fixed transx, transy; /* in global coord */
int angle;
int hitpoints;
long speed;
int temp1,temp2,temp3;
struct objstruct *next,*prev;
int temp1,temp2,temp3;
struct objstruct *next,*prev;
} objtype;
......@@ -715,8 +709,6 @@ typedef enum {
extern boolean MS_CheckParm (char *string);
extern char str[80],str2[20];
extern int tedlevelnum;
extern boolean tedlevel;
extern fixed focallength;
extern unsigned viewangles;
......@@ -835,7 +827,7 @@ extern int extravbls;
//
// control info
//
extern boolean mouseenabled,joystickenabled,joypadenabled,joystickprogressive;
extern boolean mouseenabled,joystickenabled,joypadenabled;
extern int joystickport;
extern int dirscan[4];
extern int buttonscan[NUMBUTTONS];
......@@ -968,7 +960,7 @@ void FarScalePost (void);
=============================================================================
*/
#define TURNTICS 10
#define SPDPATROL 512
#define SPDDOG 1500
......@@ -1003,39 +995,15 @@ boolean CheckSight (objtype *ob);
=============================================================================
*/
#define COMPSCALECODESTART (65*4) // offset to start of code in comp scaler
typedef struct
{
unsigned codeofs[65];
unsigned width[65];
byte *code;
} t_compscale;
typedef struct
{
unsigned leftpix,rightpix;
unsigned dataofs[64];
// table data after dataofs[rightpix-leftpix+1]
/* table data after dataofs[rightpix-leftpix+1] */
} t_compshape;
extern t_compscale *scaledirectory[MAXSCALEHEIGHT+1];
extern long fullscalefarcall[MAXSCALEHEIGHT+1];
extern byte bitmasks1[8][8];
extern byte bitmasks2[8][8];
extern unsigned wordmasks[8][8];
extern byte mapmasks1[4][8];
extern byte mapmasks2[4][8];
extern byte mapmasks3[4][8];
extern int maxscale,maxscaleshl2;
extern boolean insetupscaling;
void SetupScaling (int maxscaleheight);
void ScaleShape (int xcenter, int shapenum, unsigned height);
void SimpleScaleShape (int xcenter, int shapenum, unsigned height);
......@@ -1051,7 +1019,6 @@ void SimpleScaleShape (int xcenter, int shapenum, unsigned height);
//
// player state info
//
extern boolean running;
extern long thrustspeed;
extern unsigned plux,pluy; // player coordinates scaled to unsigned
......
......@@ -1180,8 +1180,7 @@ void Died (void)
IN_UserInput(100);
SD_WaitSoundDone ();
if (tedlevel == false) // SO'S YA DON'T GET KILLED WHILE LAUNCHING!
gamestate.lives--;
gamestate.lives--;
if (gamestate.lives > -1)
{
......
......@@ -35,8 +35,6 @@
*/
char str[80],str2[20];
int tedlevelnum;
boolean tedlevel;
int dirangle[9] = {0,ANGLES/8,2*ANGLES/8,3*ANGLES/8,4*ANGLES/8,
5*ANGLES/8,6*ANGLES/8,7*ANGLES/8,ANGLES};
......@@ -105,7 +103,6 @@ void ReadConfig(void)
read(file,&mouseenabled,sizeof(mouseenabled));
read(file,&joystickenabled,sizeof(joystickenabled));
read(file,&joypadenabled,sizeof(joypadenabled));
read(file,&joystickprogressive,sizeof(joystickprogressive));
read(file,&joystickport,sizeof(joystickport));
read(file,&dirscan,sizeof(dirscan));
......@@ -165,7 +162,6 @@ void ReadConfig(void)
joystickenabled = false;
joypadenabled = false;
joystickport = 0;
joystickprogressive = false;
viewsize = 15;
mouseadjustment=5;
......@@ -204,7 +200,6 @@ void WriteConfig(void)
write(file,&mouseenabled,sizeof(mouseenabled));
write(file,&joystickenabled,sizeof(joystickenabled));
write(file,&joypadenabled,sizeof(joypadenabled));
write(file,&joystickprogressive,sizeof(joystickprogressive));
write(file,&joystickport,sizeof(joystickport));
write(file,&dirscan,sizeof(dirscan));
......@@ -1267,44 +1262,13 @@ void Quit (char *error)
=====================
*/
static char *ParmStrings[] = {"baby","easy","normal","hard",""};
void DemoLoop (void)
void DemoLoop (void)
{
static int LastDemo;
int i,level;
long nsize;
memptr nullblock;
//
// check for launch from ted
//
if (tedlevel)
{
NoWait = true;
NewGame(1,0);
for (i = 1;i < _argc;i++)
{
if ( (level = US_CheckParm(_argv[i],ParmStrings)) != -1)
{
gamestate.difficulty=level;
break;
}
}
#ifndef SPEAR
gamestate.episode = tedlevelnum/10;
gamestate.mapon = tedlevelnum%10;
#else
gamestate.episode = 0;
gamestate.mapon = tedlevelnum;
#endif
GameLoop();
Quit (NULL);
}
//
// main game cycle
//
......
......@@ -2,17 +2,6 @@
#include "wl_def.h"
/*
=============================================================================
LOCAL CONSTANTS
=============================================================================
*/
#define sc_Question 0x35
/*
=============================================================================
......@@ -53,7 +42,7 @@ byte update[UPDATESIZE];
//
// control info
//
boolean mouseenabled,joystickenabled,joypadenabled,joystickprogressive;
boolean mouseenabled,joystickenabled,joypadenabled;
int joystickport;
int dirscan[4] = {sc_UpArrow,sc_RightArrow,sc_DownArrow,sc_LeftArrow};
int buttonscan[NUMBUTTONS] =
......@@ -391,22 +380,11 @@ void PollMouseMove (void)
void PollJoystickMove (void)
{
int joyx,joyy;
int joyx, joyy;
INL_GetJoyDelta(joystickport,&joyx,&joyy);
if (joystickprogressive)
{
if (joyx > 64)
controlx += (joyx-64)*JOYSCALE*tics;
else if (joyx < -64)
controlx -= (-joyx-64)*JOYSCALE*tics;
if (joyy > 64)
controlx += (joyy-64)*JOYSCALE*tics;
else if (joyy < -64)
controly -= (-joyy-64)*JOYSCALE*tics;
}
else if (buttonstate[bt_run])
if (buttonstate[bt_run])
{
if (joyx > 64)
controlx += RUNMOVE*tics;
......@@ -1348,7 +1326,6 @@ void PlayLoop (void)
playstate = TimeCount = lasttimecount = 0;
frameon = 0;
running = false;
anglefrac = 0;
facecount = 0;
funnyticount = 0;
......
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