Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove dead code.

git-svn-id: svn+ssh://jay/var/svn/wolf/trunk@158 32837ae5-38f0-4cfd-8401-3ff76d8497c4
  • Loading branch information...
commit a5ee03f9e382ff2871a918da00c766663b0c406b 1 parent bef56f2
paul authored
View
3  Makefile
@@ -21,7 +21,8 @@ OBJS = objs.o misc.o id_ca.o id_vh.o id_us.o \
wl_inter.o wl_menu.o wl_play.o wl_state.o wl_main.o \
wl_debug.o vi_comm.o tables.o mapheaders.o pagemap.c \
grstarts.o pictable.o pal4bit.o \
- sprites.o walls.o mapdata.o net.o
+ sprites.o walls.o mapdata.o
+# net.o
# romchunk.o
ROBJS = wl_draw.o
SOBJS = $(OBJS) $(ROBJS) vi_svga.o
View
1  build_pagemap.c
@@ -13,7 +13,6 @@ int main()
fread(header, 2, 3, f);
printf("#include \"wl_def.h\"\n");
- printf("const myint ChunksInFile = %d;\n", header[0]);
printf("const myint PMSpriteStart = %d;\n", header[1]);
#ifdef ENABLE_AUDIO
printf("const myint PMSoundStart = %d;\n", header[2]);
View
8 id_ca.c
@@ -523,6 +523,7 @@ void CA_Startup()
mapon = -1;
}
+#ifndef EMBEDDED
/*
======================
=
@@ -545,6 +546,7 @@ void CA_Shutdown()
CloseRead(audiohandle);
#endif
}
+#endif
/* ======================================================================== */
@@ -695,12 +697,14 @@ memptr CA_GetChunk(myint chunk)
}
#endif
+#ifndef EMBEDDED
void CA_UnCacheGrChunk(myint chunk)
{
}
void CA_CacheGrChunk(myint chunk)
{
}
+#endif
/* ======================================================================== */
@@ -780,9 +784,11 @@ void MM_Startup()
pool_offset = 0;
}
+#ifndef EMBEDDED
void MM_Shutdown()
{
}
+#endif
memptr MM_AllocPool(pool_id *id, unsigned long size)
{
@@ -967,8 +973,10 @@ static void PML_ClosePageFile()
memptr PM_GetPage(myint pagenum)
{
memptr addr;
+#ifndef EMBEDDED
if (pagenum >= ChunksInFile)
Quit("PM_GetPage: Invalid page request");
+#endif
if (PageAddr[pagenum])
return MM_PoolPtr(PageAddr[pagenum]);
View
2  id_ca.h
@@ -81,7 +81,7 @@ typedef struct {
} PageListStruct;
#ifdef ENABLE_PRECOMPILE
-extern const myint ChunksInFile, PMSpriteStart, PMSoundStart;
+extern const myint PMSpriteStart, PMSoundStart;
extern const PageListStruct PMPages[];
extern pool_id PageAddr[];
extern const uint32_t grstarts[NUMCHUNKS + 1];
View
4 id_us.c
@@ -8,9 +8,11 @@ typedef struct {
Point ul, lr;
} Rect;
+#ifndef EMBEDDED
// Global variables
word PrintX,PrintY;
word WindowX,WindowY,WindowW,WindowH;
+#endif
// Internal variables
@@ -46,6 +48,7 @@ void US_Startup()
}
+#ifndef EMBEDDED
///////////////////////////////////////////////////////////////////////////
//
// US_Shutdown() - Shuts down the User Mgr
@@ -59,7 +62,6 @@ void US_Shutdown()
US_Started = false;
}
-#ifndef EMBEDDED
// Window/Printing routines
///////////////////////////////////////////////////////////////////////////
View
10 id_vh.c
@@ -8,14 +8,15 @@ myint px, py;
byte fontcolor, backcolor;
myint fontnumber;
+#ifndef LUMINARY
+myint xfrac, yfrac;
+
boolean screenfaded;
#ifndef SKIPFADE
static byte palette1[256][3], palette2[256][3];
#endif
-myint xfrac, yfrac;
-
/* ======================================================================== */
#ifndef SKIPFADE
@@ -82,7 +83,6 @@ void VL_FadeOut(myint start, myint end, myint red, myint green, myint blue, myin
screenfaded = true;
}
-#ifndef LUMINARY
/*
=================
=
@@ -425,11 +425,15 @@ void VW_Startup()
{
VL_Startup();
+#ifndef EMBEDDED
xfrac = (vwidth << 16) / 320;
yfrac = (vheight << 16) / 200;
+#endif
}
+#ifndef EMBEDDED
void VW_Shutdown()
{
VL_Shutdown();
}
+#endif
View
3  luminary-crt0.S
@@ -97,7 +97,8 @@ __isr_vectors:
.word isr_handler /*39*/
.word isr_handler /*40*/
.word isr_handler /*41*/
-.word ethernet_isr /*42*/
+.word isr_handler /*42*/
+/*.word ethernet_isr *//*42*/
.word isr_handler /*43*/
.word isr_handler /*44*/
.word isr_handler /*45*/
View
2  misc.c
@@ -154,6 +154,7 @@ unsigned long sleepuntil(unsigned long t)
return now;
}
+#ifndef EMBEDDED
long filelength(myint handle)
{
#ifdef __linux__
@@ -170,7 +171,6 @@ long filelength(myint handle)
#endif
}
-#ifndef EMBEDDED
char *itoa(myint value, char *string, myint radix)
{
return ltoa(value, string, radix);
View
2  sd_null.c
@@ -6,7 +6,6 @@ boolean AdLibPresent, SoundBlasterPresent;
SDMode SoundMode;
SMMode MusicMode;
SDSMode DigiMode;
-#endif
void SD_SetDigiDevice(SDSMode mode)
{
@@ -128,3 +127,4 @@ void PlaySoundLocGlobal(word s, myint id, fixed gx,fixed gy)
void UpdateSoundLoc(fixed x, fixed y, myint angle)
{
}
+#endif
View
8 vi_bare.c
@@ -237,14 +237,6 @@ void VL_Startup()
#endif
}
-void VL_Shutdown()
-{
-}
-
-void VL_WaitVBL(int i)
-{
-}
-
void VW_UpdateScreen()
{
#ifdef LUMINARY
View
4 vi_comm.c
@@ -175,6 +175,7 @@ static void INL_StartKbd(void)
IN_ClearKeysDown();
}
+#ifndef EMBEDDED
///////////////////////////////////////////////////////////////////////////
//
// INL_ShutKbd() - Restores keyboard control to the BIOS
@@ -192,6 +193,7 @@ static void INL_ShutKbd(void)
static void INL_ShutMouse(void)
{
}
+#endif
#ifdef ENABLE_JOYSTICK
///////////////////////////////////////////////////////////////////////////
@@ -253,6 +255,7 @@ void IN_Startup(void)
IN_Started = true;
}
+#ifndef EMBEDDED
///////////////////////////////////////////////////////////////////////////
//
// IN_Shutdown() - Shuts down the Input Mgr
@@ -276,6 +279,7 @@ void IN_Shutdown(void)
IN_Started = false;
}
+#endif
///////////////////////////////////////////////////////////////////////////
//
View
2  wl_act2.c
@@ -2415,6 +2415,7 @@ void T_BJDone(objtype *ob)
//===========================================================================
+#ifndef EMBEDDED
/*
===============
=
@@ -2445,6 +2446,7 @@ boolean CheckPosition(objtype *ob)
return true;
}
+#endif
/*
View
11 wl_def.h
@@ -708,12 +708,21 @@ typedef enum PACKED {
extern char str[80], str2[20];
-extern myint viewwidth, viewheight;
+#ifdef EMBEDDED
+#define viewwidth 128
+#define sviewheight 64
+#define xoffset 0
+#define yoffset 0
+#define centerx (viewwidth/2-1)
+#define shootdelta (viewwidth/10)
+#else
+extern myint viewwidth, sviewheight;
extern myint viewwidthwin, viewheightwin;
extern myint xoffset, yoffset;
extern myint centerx;
extern myint shootdelta;
+#endif
extern boolean startgame,loadedgame;
extern myint mouseadjustment;
View
38 wl_draw.c
@@ -415,19 +415,19 @@ static void DrawPlayerWeapon()
if (gamestate.victoryflag)
{
if ((player->state == s_deathcam) && (get_TimeCount() & 32))
- SimpleScaleShape(viewwidth/2,SPR_DEATHCAM,viewheight+1);
+ SimpleScaleShape(viewwidth/2,SPR_DEATHCAM,sviewheight+1);
return;
}
#endif
if (gamestate.weapon != wp_none) {
shapenum = weaponscale[gamestate.weapon]+gamestate.weaponframe;
- SimpleScaleShape(viewwidth/2,shapenum,viewheight+1);
+ SimpleScaleShape(viewwidth/2,shapenum,sviewheight+1);
}
#ifdef ENABLE_DEMO
if (demorecord || demoplayback)
- SimpleScaleShape(viewwidth/2,SPR_DEMO,viewheight+1);
+ SimpleScaleShape(viewwidth/2,SPR_DEMO,sviewheight+1);
#endif
}
@@ -548,7 +548,7 @@ static void SetPlaneViewSize()
myint x, y;
byte *dest, *src;
- halfheight = viewheight >> 1;
+ halfheight = sviewheight >> 1;
for (y = 0; y < halfheight; y++) {
planeylookup[y] = gfxbuf + (halfheight-1-y)*vwidth;
@@ -587,7 +587,7 @@ void DrawPlanes()
myint height, lastheight;
myint x;
- if ((viewheight>>1) != halfheight)
+ if ((sviewheight>>1) != halfheight)
SetPlaneViewSize(); /* screen size has changed */
/* loop over all columns */
@@ -645,8 +645,8 @@ static void ClearScreen()
unsigned myint ceiling = Ceiling[gamestate.episode*10+mapon] & 0xFF;
unsigned myint floor = 0x19;
- VL_Bar(xoffset, yoffset, viewwidth, viewheight / 2, ceiling);
- VL_Bar(xoffset, yoffset + viewheight / 2, viewwidth, viewheight / 2, floor);
+ VL_Bar(xoffset, yoffset, viewwidth, sviewheight / 2, ceiling);
+ VL_Bar(xoffset, yoffset + sviewheight / 2, viewwidth, sviewheight / 2, floor);
}
/* ======================================================================== */
@@ -720,8 +720,8 @@ static void ScaleLine(unsigned myint height, byte *source, myint x)
frac = (64 << 16) / height;
delta = (64 << 16) - frac*height;
- if (height < viewheight) {
- y = yoffset + (viewheight - height) / 2;
+ if (height < sviewheight) {
+ y = yoffset + (sviewheight - height) / 2;
ScaledDraw(source, height, gfxbuf + (y * vpitch) + xoffset,
x, delta, frac);
@@ -729,10 +729,10 @@ static void ScaleLine(unsigned myint height, byte *source, myint x)
return;
}
- y = (height - viewheight) / 2;
+ y = (height - sviewheight) / 2;
y *= frac;
- ScaledDraw(source, viewheight, gfxbuf + (yoffset * vpitch) + xoffset,
+ ScaledDraw(source, sviewheight, gfxbuf + (yoffset * vpitch) + xoffset,
x, y+delta, frac);
}
}
@@ -808,7 +808,7 @@ static void RenderLine(unsigned myint height, byte *row, int x,
// FIXME: Cache delta and yclip across lines.
delta = (64 << 16) / height;
- if (height < viewheight) {
+ if (height < sviewheight) {
#ifdef ENABLE_COLOR
while (sprite[cmd+0]) {
y1 = sprite[cmd+0] / 2;
@@ -836,7 +836,7 @@ static void RenderLine(unsigned myint height, byte *row, int x,
x, 0/*frac*/, delta);
}
} else {
- yclip = (height - viewheight) / 2;
+ yclip = (height - sviewheight) / 2;
yclip *= delta;
ytop = yclip >> 16;
#ifdef ENABLE_COLOR
@@ -872,10 +872,10 @@ static void RenderLine(unsigned myint height, byte *row, int x,
pend = ((y1 - ytop) * height) >> 6;
}
- if (pend > viewheight)
- pend = viewheight;
+ if (pend > sviewheight)
+ pend = sviewheight;
- if (pstart < viewheight)
+ if (pstart < sviewheight)
ScaledDraw4(post, pend - pstart, row + (pstart * vpitch),
x, yfrac, delta);
}
@@ -926,8 +926,8 @@ static void RenderShape(myint xcenter, myint shapenum, unsigned height,
x -= left;
}
right -= left;
- if (height < viewheight)
- row = gfxbuf + (yoffset + (viewheight - height) / 2) * vpitch;
+ if (height < sviewheight)
+ row = gfxbuf + (yoffset + (sviewheight - height) / 2) * vpitch;
else
row = gfxbuf + yoffset * vpitch;
row += xoffset;
@@ -1410,7 +1410,7 @@ void FizzleFade(boolean abortable, myint frames, myint color)
return;
width = viewwidth / multiplier;
- height = viewheight / multiplier;
+ height = sviewheight / multiplier;
retr = -1;
View
6 wl_game.c
@@ -1205,7 +1205,9 @@ void GameLoop()
ClearMemory();
+#ifdef ENABLE_HIGHSCORES
CheckHighScore(gamestate.score,gamestate.mapon+1);
+#endif
strcpy(MainMenu[viewscores].string,STR_VS);
MainMenu[viewscores].routine = (MenuFunc)CP_ViewScores;
@@ -1273,7 +1275,9 @@ void GameLoop()
ClearMemory();
+#ifdef ENABLE_HIGHSCORES
CheckHighScore(gamestate.score,gamestate.mapon+1);
+#endif
return;
@@ -1290,7 +1294,9 @@ void GameLoop()
ClearMemory();
+#ifdef ENABLE_HIGHSCORES
CheckHighScore(gamestate.score,gamestate.mapon+1);
+#endif
return;
View
8 wl_inter.c
@@ -918,6 +918,7 @@ void PreloadGraphics()
//==========================================================================
+#ifdef ENABLE_HIGHSCORES
/*
==================
=
@@ -928,7 +929,6 @@ void PreloadGraphics()
void DrawHighScores()
{
-#ifdef ENABLE_HIGHSCORES
char buffer[16];
char buffer1[16], *str;
word i, w, h;
@@ -1039,7 +1039,6 @@ void DrawHighScores()
UnCacheLump(HIGHSCORES_LUMP_START, HIGHSCORES_LUMP_END);
fontnumber = 0;
#endif
-#endif
}
/*
@@ -1052,7 +1051,6 @@ void DrawHighScores()
void CheckHighScore(long score, word other)
{
-#ifdef ENABLE_HIGHSCORES
word i, j;
myint n;
HighScore myscore;
@@ -1081,7 +1079,9 @@ void CheckHighScore(long score, word other)
#else
StartCPMusic(ROSTER_MUS);
#endif
+#ifdef ENABLE_HIGHSCORES
DrawHighScores();
+#endif
VW_FadeIn();
@@ -1112,5 +1112,5 @@ void CheckHighScore(long score, word other)
IN_UserInput(500);
}
-#endif
}
+#endif
View
36 wl_main.c
@@ -14,18 +14,22 @@
#define FOCALLENGTH 0x5800 /* in global coordinates */
+#ifndef EMBEDDED
char str[80], str2[20];
+#endif
-myint viewwidth, viewheight;
-myint viewwidthwin, viewheightwin; /* for borders */
+#ifndef EMBEDDED
+myint viewwidth, sviewheight;
myint xoffset, yoffset;
-#ifndef LUMINARY
-myint vwidth, vheight, vpitch; /* size of screen */
-#endif
myint viewsize;
myint centerx;
myint shootdelta; /* pixels away from centerx a target can be */
+#endif
+#ifndef LUMINARY
+myint viewwidthwin, viewheightwin; /* for borders */
+myint vwidth, vheight, vpitch; /* size of screen */
+#endif
boolean startgame,loadedgame;
#ifdef MOUSE_ENABLED
@@ -248,7 +252,9 @@ myint WriteConfig()
static void SetDefaults()
{
+#ifndef EMBEDDED
viewsize = 15;
+#endif
#ifdef MOUSE_ENABLED
mouseenabled = false;
@@ -903,6 +909,7 @@ void SetupWalls()
}
}
+#ifndef EMBEDDED
void ShowViewSize(myint width)
{
myint oldwidth,oldheight;
@@ -917,6 +924,7 @@ void ShowViewSize(myint width)
viewheightwin = oldheight;
viewwidthwin = oldwidth;
}
+#endif
void NewViewSize(myint width)
{
@@ -937,18 +945,16 @@ void NewViewSize(myint width)
viewwidthwin = width*16*320/vwidth;
viewheightwin = width_to_height(width*16)*320/vwidth;
viewsize = width*320/vwidth;
-#else
- viewsize = width;
#endif
+#ifndef EMBEDDED
viewwidth = width*16;
- viewheight = width_to_height(width*16);
+ sviewheight = width_to_height(width*16);
centerx = viewwidth/2-1;
shootdelta = viewwidth/10;
-#ifndef EMBEDDED
- yoffset = (vheight-STATUSLINES*vheight/200-viewheight)/2;
+ yoffset = (vheight-STATUSLINES*vheight/200-sviewheight)/2;
xoffset = (vwidth-viewwidth)/2;
#endif
#ifndef LUMINARY
@@ -1122,6 +1128,7 @@ void DoJukebox()
/* ======================================================================== */
+#ifndef EMBEDDED
/*
==========================
=
@@ -1146,6 +1153,7 @@ void ShutdownId()
#endif
MM_Shutdown();
}
+#endif
/*
=====================
@@ -1185,7 +1193,9 @@ void NewGame(myint difficulty, myint episode)
void InitGame()
{
+#ifndef EMBEDDED
myint i;
+#endif
MM_Startup();
#ifdef ENABLE_COLOR
@@ -1205,16 +1215,22 @@ void InitGame()
ReadConfig();
+#ifndef EMBEDDED
/* load in and lock down some basic chunks */
CA_CacheGrChunk(STARTFONT);
CA_CacheGrChunk(STARTTILE8);
for (i = LATCHPICS_LUMP_START; i <= LATCHPICS_LUMP_END; i++)
CA_CacheGrChunk(i);
+#endif
SetupWalls();
+#ifdef EMBEDDED
+ NewViewSize(8);
+#else
NewViewSize(viewsize);
+#endif
//
View
12 wl_play.c
@@ -1018,6 +1018,7 @@ void InitRedShifts()
#endif
+#ifdef ENABLE_FLASHES
/*
=====================
=
@@ -1028,11 +1029,10 @@ void InitRedShifts()
void ClearPaletteShifts()
{
-#ifdef ENABLE_FLASHES
bonuscount = damagecount = 0;
-#endif
}
+#endif
/*
@@ -1077,9 +1077,9 @@ void StartDamageFlash(myint damage)
=====================
*/
+#ifdef ENABLE_FLASHES
void UpdatePaletteShifts()
{
-#ifdef ENABLE_FLASHES
myint red, white;
if (bonuscount)
@@ -1123,12 +1123,10 @@ void UpdatePaletteShifts()
VL_SetPalette(gamepal); // back to normal
palshifted = false;
}
-#endif
}
-#ifdef ENABLE_FLASHES
/*
=====================
=
@@ -1287,7 +1285,9 @@ void PlayLoop()
funnyticount = 0;
memset (buttonstate,0,sizeof(buttonstate));
+#ifdef ENABLE_FLASHES
ClearPaletteShifts();
+#endif
#ifdef ENABLE_MOUSE
IN_GetMouseDelta(NULL, NULL); // Clear accumulated mouse movement
@@ -1319,7 +1319,9 @@ void PlayLoop()
for (obj = player; obj; obj = obj_next(obj))
DoActor(obj);
+#ifdef ENABLE_FLASHES
UpdatePaletteShifts();
+#endif
ThreeDRefresh();
Please sign in to comment.
Something went wrong with that request. Please try again.