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; ...@@ -9,11 +9,9 @@ word WindowX,WindowY,WindowW,WindowH;
// Internal variables // Internal variables
static char *ParmStrings[] = {"TEDLEVEL","NOWAIT"}; static char *ParmStrings[] = {"nowait"};
static boolean US_Started; static boolean US_Started;
int CursorX,CursorY;
void (*USL_MeasureString)(char *,word *,word *) = VW_MeasurePropString, void (*USL_MeasureString)(char *,word *,word *) = VW_MeasurePropString,
(*USL_DrawString)(char *) = VWB_DrawPropString; (*USL_DrawString)(char *) = VWB_DrawPropString;
...@@ -43,19 +41,12 @@ void US_Startup(void) ...@@ -43,19 +41,12 @@ void US_Startup(void)
US_InitRndT(true); // Initialize the random number generator US_InitRndT(true); // Initialize the random number generator
// Check for TED launching here
for (i = 1;i < _argc;i++) for (i = 1;i < _argc;i++)
{ {
n = US_CheckParm(_argv[i],ParmStrings); n = US_CheckParm(_argv[i],ParmStrings);
switch(n) switch(n)
{ {
case 0: case 0:
tedlevelnum = atoi(_argv[i + 1]);
if (tedlevelnum >= 0)
tedlevel = true;
break;
case 1:
NoWait = true; NoWait = true;
break; break;
} }
...@@ -217,8 +208,7 @@ void US_PrintCentered(char *s) ...@@ -217,8 +208,7 @@ void US_PrintCentered(char *s)
// advances to the next line. Newlines are not supported. // advances to the next line. Newlines are not supported.
// //
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
void void US_CPrintLine(char *s)
US_CPrintLine(char *s)
{ {
word w,h; word w,h;
...@@ -238,8 +228,7 @@ US_CPrintLine(char *s) ...@@ -238,8 +228,7 @@ US_CPrintLine(char *s)
// supported. // supported.
// //
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
void void US_CPrint(char *s)
US_CPrint(char *s)
{ {
char c, *se; char c, *se;
...@@ -267,8 +256,7 @@ US_CPrint(char *s) ...@@ -267,8 +256,7 @@ US_CPrint(char *s)
// cursor // cursor
// //
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
void void US_ClearWindow(void)
US_ClearWindow(void)
{ {
VWB_Bar(WindowX,WindowY,WindowW,WindowH,WHITE); VWB_Bar(WindowX,WindowY,WindowW,WindowH,WHITE);
PrintX = WindowX; PrintX = WindowX;
...@@ -529,3 +517,43 @@ boolean US_LineInput(int x,int y,char *buf,char *def,boolean escok, ...@@ -529,3 +517,43 @@ boolean US_LineInput(int x,int y,char *buf,char *def,boolean escok,
IN_ClearKeysDown(); IN_ClearKeysDown();
return(result); 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 ...@@ -22,9 +22,6 @@ typedef struct
px,py; px,py;
} WindowRec; // Record used to save & restore screen windows } 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 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
loadedgame, // Set if the current game was loaded loadedgame, // Set if the current game was loaded
...@@ -33,8 +30,6 @@ extern word PrintX,PrintY; // Current printing location in the window ...@@ -33,8 +30,6 @@ extern word PrintX,PrintY; // Current printing location in the window
extern word WindowX,WindowY,// Current location of window extern word WindowX,WindowY,// Current location of window
WindowW,WindowH;// Current size of window WindowW,WindowH;// Current size of window
extern int CursorX,CursorY;
extern void (*USL_MeasureString)(char *,word *,word *), extern void (*USL_MeasureString)(char *,word *,word *),
(*USL_DrawString)(char *); (*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) ...@@ -3673,7 +3673,7 @@ void T_BJRun (objtype *ob)
=============== ===============
*/ */
void T_BJJump (objtype *ob) void T_BJJump(objtype *ob)
{ {
long move; long move;
...@@ -3690,9 +3690,9 @@ void T_BJJump (objtype *ob) ...@@ -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 @@ ...@@ -30,7 +30,6 @@
// //
// player state info // player state info
// //
boolean running;
long thrustspeed; long thrustspeed;
unsigned plux,pluy; // player coordinates scaled to unsigned unsigned plux,pluy; // player coordinates scaled to unsigned
...@@ -241,19 +240,12 @@ void ControlMovement (objtype *ob) ...@@ -241,19 +240,12 @@ void ControlMovement (objtype *ob)
void StatusDrawPic (unsigned x, unsigned y, unsigned picnum) void StatusDrawPic (unsigned x, unsigned y, unsigned picnum)
{ {
unsigned temp; /* TODO hmm */
temp = bufferofs;
bufferofs = 0;
bufferofs = PAGE1START+(200-STATUSLINES)*SCREENWIDTH;
LatchDrawPic (x,y,picnum); LatchDrawPic (x,y,picnum);
bufferofs = PAGE2START+(200-STATUSLINES)*SCREENWIDTH; /*
LatchDrawPic (x,y,picnum); LatchDrawPic (x,y,picnum);
bufferofs = PAGE3START+(200-STATUSLINES)*SCREENWIDTH;
LatchDrawPic (x,y,picnum); LatchDrawPic (x,y,picnum);
*/
bufferofs = temp;
} }
......
...@@ -389,8 +389,6 @@ int DebugKeys (void) ...@@ -389,8 +389,6 @@ int DebugKeys (void)
if (Keyboard[sc_E]) // E = quit level if (Keyboard[sc_E]) // E = quit level
{ {
if (tedlevel)
Quit (NULL);
playstate = ex_completed; playstate = ex_completed;
// gamestate.mapon++; // gamestate.mapon++;
} }
......
...@@ -91,12 +91,6 @@ ...@@ -91,12 +91,6 @@
#define STATUSLINES 40 #define STATUSLINES 40
#define SCREENSIZE (SCREENBWIDE*208)
#define PAGE1START 0
#define PAGE2START (SCREENSIZE)
#define PAGE3START (SCREENSIZE*2u)
#define FREESTART (SCREENSIZE*3u)
#define STARTAMMO 8 #define STARTAMMO 8
// object flag values // object flag values
...@@ -577,7 +571,7 @@ typedef struct statstruct ...@@ -577,7 +571,7 @@ typedef struct statstruct
{ {
byte tilex,tiley; byte tilex,tiley;
byte *visspot; 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 flags;
byte itemnumber; byte itemnumber;
} statobj_t; } statobj_t;
...@@ -610,25 +604,25 @@ typedef struct objstruct ...@@ -610,25 +604,25 @@ typedef struct objstruct
classtype obclass; classtype obclass;
statetype *state; 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; dirtype dir;
fixed x,y; fixed x,y;
unsigned tilex,tiley; unsigned tilex,tiley;
byte areanumber; byte areanumber;
int viewx; int viewx;
unsigned viewheight; unsigned viewheight;
fixed transx,transy; // in global coord fixed transx, transy; /* in global coord */
int angle; int angle;
int hitpoints; int hitpoints;
long speed; long speed;
int temp1,temp2,temp3; int temp1,temp2,temp3;
struct objstruct *next,*prev; struct objstruct *next,*prev;
} objtype; } objtype;
...@@ -715,8 +709,6 @@ typedef enum { ...@@ -715,8 +709,6 @@ typedef enum {
extern boolean MS_CheckParm (char *string); extern boolean MS_CheckParm (char *string);
extern char str[80],str2[20]; extern char str[80],str2[20];
extern int tedlevelnum;
extern boolean tedlevel;
extern fixed focallength; extern fixed focallength;
extern unsigned viewangles; extern unsigned viewangles;
...@@ -835,7 +827,7 @@ extern int extravbls; ...@@ -835,7 +827,7 @@ extern int extravbls;
// //
// control info // control info
// //
extern boolean mouseenabled,joystickenabled,joypadenabled,joystickprogressive; extern boolean mouseenabled,joystickenabled,joypadenabled;
extern int joystickport; extern int joystickport;
extern int dirscan[4]; extern int dirscan[4];
extern int buttonscan[NUMBUTTONS]; extern int buttonscan[NUMBUTTONS];
...@@ -968,7 +960,7 @@ void FarScalePost (void); ...@@ -968,7 +960,7 @@ void FarScalePost (void);
============================================================================= =============================================================================
*/ */
#define TURNTICS 10
#define SPDPATROL 512 #define SPDPATROL 512
#define SPDDOG 1500 #define SPDDOG 1500
...@@ -1003,39 +995,15 @@ boolean CheckSight (objtype *ob); ...@@ -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 typedef struct
{ {
unsigned leftpix,rightpix; unsigned leftpix,rightpix;
unsigned dataofs[64]; unsigned dataofs[64];
// table data after dataofs[rightpix-leftpix+1] /* table data after dataofs[rightpix-leftpix+1] */
} t_compshape; } 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 int maxscale,maxscaleshl2;
extern boolean insetupscaling;
void SetupScaling (int maxscaleheight); void SetupScaling (int maxscaleheight);
void ScaleShape (int xcenter, int shapenum, unsigned height); void ScaleShape (int xcenter, int shapenum, unsigned height);
void SimpleScaleShape (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); ...@@ -1051,7 +1019,6 @@ void SimpleScaleShape (int xcenter, int shapenum, unsigned height);
// //
// player state info // player state info
// //
extern boolean running;
extern long thrustspeed; extern long thrustspeed;
extern unsigned plux,pluy; // player coordinates scaled to unsigned extern unsigned plux,pluy; // player coordinates scaled to unsigned
......
...@@ -1180,8 +1180,7 @@ void Died (void) ...@@ -1180,8 +1180,7 @@ void Died (void)
IN_UserInput(100); IN_UserInput(100);
SD_WaitSoundDone (); SD_WaitSoundDone ();
if (tedlevel == false) // SO'S YA DON'T GET KILLED WHILE LAUNCHING! gamestate.lives--;
gamestate.lives--;
if (gamestate.lives > -1) if (gamestate.lives > -1)
{ {
......
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
*/ */
char str[80],str2[20]; char str[80],str2[20];
int tedlevelnum;
boolean tedlevel;
int dirangle[9] = {0,ANGLES/8,2*ANGLES/8,3*ANGLES/8,4*ANGLES/8, 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}; 5*ANGLES/8,6*ANGLES/8,7*ANGLES/8,ANGLES};
...@@ -105,7 +103,6 @@ void ReadConfig(void) ...@@ -105,7 +103,6 @@ void ReadConfig(void)
read(file,&mouseenabled,sizeof(mouseenabled)); read(file,&mouseenabled,sizeof(mouseenabled));
read(file,&joystickenabled,sizeof(joystickenabled)); read(file,&joystickenabled,sizeof(joystickenabled));
read(file,&joypadenabled,sizeof(joypadenabled)); read(file,&joypadenabled,sizeof(joypadenabled));
read(file,&joystickprogressive,sizeof(joystickprogressive));
read(file,&joystickport,sizeof(joystickport)); read(file,&joystickport,sizeof(joystickport));
read(file,&dirscan,sizeof(dirscan)); read(file,&dirscan,sizeof(dirscan));
...@@ -165,7 +162,6 @@ void ReadConfig(void) ...@@ -165,7 +162,6 @@ void ReadConfig(void)
joystickenabled = false; joystickenabled = false;
joypadenabled = false; joypadenabled = false;
joystickport = 0; joystickport = 0;
joystickprogressive = false;
viewsize = 15; viewsize = 15;
mouseadjustment=5; mouseadjustment=5;
...@@ -204,7 +200,6 @@ void WriteConfig(void) ...@@ -204,7 +200,6 @@ void WriteConfig(void)
write(file,&mouseenabled,sizeof(mouseenabled)); write(file,&mouseenabled,sizeof(mouseenabled));
write(file,&joystickenabled,sizeof(joystickenabled)); write(file,&joystickenabled,sizeof(joystickenabled));
write(file,&joypadenabled,sizeof(joypadenabled)); write(file,&joypadenabled,sizeof(joypadenabled));
write(file,&joystickprogressive,sizeof(joystickprogressive));
write(file,&joystickport,sizeof(joystickport)); write(file,&joystickport,sizeof(joystickport));
write(file,&dirscan,sizeof(dirscan)); write(file,&dirscan,sizeof(dirscan));
...@@ -1267,44 +1262,13 @@ void Quit (char *error) ...@@ -1267,44 +1262,13 @@ void Quit (char *error)
===================== =====================
*/ */
static char *ParmStrings[] = {"baby","easy","normal","hard",""}; void DemoLoop (void)
void DemoLoop (void)
{ {
static int LastDemo; static int LastDemo;
int i,level; int i,level;
long nsize; long nsize;
memptr nullblock; 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 // main game cycle
// //
......
...@@ -2,17 +2,6 @@ ...@@ -2,17 +2,6 @@
#include "wl_def.h" #include "wl_def.h"
/*
=============================================================================
LOCAL CONSTANTS
=============================================================================
*/
#define sc_Question 0x35
/* /*
============================================================================= =============================================================================
...@@ -53,7 +42,7 @@ byte update[UPDATESIZE]; ...@@ -53,7 +42,7 @@ byte update[UPDATESIZE];
// //
// control info // control info
// //
boolean mouseenabled,joystickenabled,joypadenabled,joystickprogressive; boolean mouseenabled,joystickenabled,joypadenabled;
int joystickport; int joystickport;
int dirscan[4] = {sc_UpArrow,sc_RightArrow,sc_DownArrow,sc_LeftArrow}; int dirscan[4] = {sc_UpArrow,sc_RightArrow,sc_DownArrow,sc_LeftArrow};
int buttonscan[NUMBUTTONS] = int buttonscan[NUMBUTTONS] =
...@@ -391,22 +380,11 @@ void PollMouseMove (void) ...@@ -391,22 +380,11 @@ void PollMouseMove (void)
void PollJoystickMove (void) void PollJoystickMove (void)
{ {
int joyx,joyy; int joyx, joyy;
INL_GetJoyDelta(joystickport,&joyx,&joyy); INL_GetJoyDelta(joystickport,&joyx,&joyy);
if (joystickprogressive) if (buttonstate[bt_run])
{
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 (joyx > 64) if (joyx > 64)
controlx += RUNMOVE*tics; controlx += RUNMOVE*tics;
...@@ -1348,7 +1326,6 @@ void PlayLoop (void) ...@@ -1348,7 +1326,6 @@ void PlayLoop (void)
playstate = TimeCount = lasttimecount = 0; playstate = TimeCount = lasttimecount = 0;
frameon = 0; frameon = 0;
running = false;
anglefrac = 0; anglefrac = 0;
facecount = 0; facecount = 0;
funnyticount = 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